| Previous | 15994 Revisions | Next |
| r3958 Tuesday 23rd December, 2008 at 04:12:23 UTC by Nathan Woods |
|---|
| Updated to MAME 0.128u7; disabled some drivers and some Win32-specific functionality temporarily |
| [docs] | messnew.txt |
| [src/emu] | clifront.c cpuexec.c cpuexec.h cpuintrf.c cpuintrf.h debugger.c debugger.h deprecat.h devintrf.c devintrf.h info.c inptport.c mame.c mconfig.c mconfig.h memory.c memory.h romload.c sndintrf.c sndintrf.h sound.c streams.c streams.h timer.c timer.h ui.c validity.c video.c video.h |
| [src/emu/cpu] | cpu.mak drcbex64.c drcbex86.c drcfe.c vtlb.c |
| [src/emu/cpu/adsp2100] | 2100ops.c adsp2100.c adsp2100.h |
| [src/emu/cpu/alph8201] | alph8201.c alph8201.h |
| [src/emu/cpu/apexc] | apexc.c apexc.h |
| [src/emu/cpu/arm] | arm.c arm.h |
| [src/emu/cpu/arm7] | arm7.c arm7.h |
| [src/emu/cpu/asap] | asap.c asap.h |
| [src/emu/cpu/ccpu] | ccpu.c ccpu.h |
| [src/emu/cpu/cdp1802] | cdp1802.c cdp1802.h |
| [src/emu/cpu/cop400] | cop400.h cop410.c cop420.c cop440.c |
| [src/emu/cpu/cp1610] | cp1610.c cp1610.h |
| [src/emu/cpu/cubeqcpu] | cubeqcpu.c cubeqcpu.h |
| [src/emu/cpu/dsp32] | dsp32.c dsp32.h |
| [src/emu/cpu/dsp56k] | dsp56dsm.c dsp56k.c dsp56k.h dsp56ops.c dsp56pcu.c |
| [src/emu/cpu/e132xs] | e132xs.c e132xs.h |
| [src/emu/cpu/f8] | f8.c f8.h |
| [src/emu/cpu/g65816] | g65816.c g65816.h g65816cm.h g65816op.h |
| [src/emu/cpu/h6280] | h6280.c h6280.h |
| [src/emu/cpu/h83002] | h8.h h8_16.c h8_8.c |
| [src/emu/cpu/hd6309] | hd6309.c hd6309.h |
| [src/emu/cpu/i386] | i386.c i386.h i386priv.h* |
| [src/emu/cpu/i8085] | i8085.c i8085.h i8085cpu.h |
| [src/emu/cpu/i86] | i286.c i286.h* i86.c i86.h i86priv.h* |
| [src/emu/cpu/i8x41] | i8x41.c i8x41.h |
| [src/emu/cpu/i960] | i960.c i960.h |
| [src/emu/cpu/jaguar] | jaguar.c jaguar.h |
| [src/emu/cpu/konami] | konami.c konami.h |
| [src/emu/cpu/lh5801] | lh5801.c lh5801.h |
| [src/emu/cpu/lr35902] | lr35902.c lr35902.h |
| [src/emu/cpu/m37710] | m37710.c m37710.h m37710cm.h m37710op.h |
| [src/emu/cpu/m6502] | m4510.c m4510.h m6502.c m6502.h m6509.c m6509.h m65ce02.c m65ce02.h |
| [src/emu/cpu/m6800] | m6800.c m6800.h |
| [src/emu/cpu/m68000] | m68000.h m68kcpu.c |
| [src/emu/cpu/m6805] | m6805.c m6805.h |
| [src/emu/cpu/m6809] | m6809.c m6809.h |
| [src/emu/cpu/mb86233] | mb86233.c mb86233.h |
| [src/emu/cpu/mb88xx] | mb88xx.c mb88xx.h |
| [src/emu/cpu/mc68hc11] | mc68hc11.c mc68hc11.h |
| [src/emu/cpu/mcs48] | mcs48.c mcs48.h |
| [src/emu/cpu/mcs51] | mcs51.c mcs51.h |
| [src/emu/cpu/minx] | minx.c minx.h |
| [src/emu/cpu/mips] | mips3.c mips3.h mips3com.c mips3com.h mips3drc.c psx.c psx.h r3000.c r3000.h |
| [src/emu/cpu/nec] | nec.c nec.h necpriv.h* |
| [src/emu/cpu/pdp1] | pdp1.c pdp1.h tx0.c tx0.h |
| [src/emu/cpu/pic16c5x] | 16c5xdsm.c pic16c5x.c pic16c5x.h |
| [src/emu/cpu/powerpc] | ppc.c ppc.h ppccom.c ppccom.h ppcdrc.c |
| [src/emu/cpu/rsp] | rsp.c rsp.h |
| [src/emu/cpu/s2650] | s2650.c s2650.h |
| [src/emu/cpu/saturn] | saturn.c saturn.h |
| [src/emu/cpu/sc61860] | sc61860.c sc61860.h |
| [src/emu/cpu/se3208] | se3208.c se3208.h se3208dis.c |
| [src/emu/cpu/sh2] | sh2.c sh2.h sh2comn.c sh2comn.h sh2drc.c |
| [src/emu/cpu/sh4] | sh4.c sh4.h |
| [src/emu/cpu/sharc] | sharc.c sharc.h |
| [src/emu/cpu/sm8500] | sm8500.c sm8500.h sm85ops.h |
| [src/emu/cpu/spc700] | spc700.c spc700.h |
| [src/emu/cpu/ssp1601] | ssp1601.c ssp1601.h |
| [src/emu/cpu/t11] | t11.c t11.h |
| [src/emu/cpu/tlcs90] | tlcs90.c tlcs90.h |
| [src/emu/cpu/tms32010] | tms32010.c tms32010.h |
| [src/emu/cpu/tms32025] | tms32025.c tms32025.h |
| [src/emu/cpu/tms32031] | tms32031.c tms32031.h |
| [src/emu/cpu/tms32051] | tms32051.c tms32051.h |
| [src/emu/cpu/tms34010] | 34010ops.c tms34010.c tms34010.h |
| [src/emu/cpu/tms7000] | tms7000.c tms7000.h |
| [src/emu/cpu/tms9900] | 99xxcore.h tms9900.h |
| [src/emu/cpu/upd7810] | upd7810.c upd7810.h |
| [src/emu/cpu/v30mz] | nec.h* v30mz.c |
| [src/emu/cpu/v60] | v60.c v60.h |
| [src/emu/cpu/v810] | v810.c v810.h |
| [src/emu/cpu/z180] | z180.c z180.h |
| [src/emu/cpu/z80] | z80.c z80.h z80daisy.c |
| [src/emu/cpu/z8000] | z8000.c z8000.h |
| [src/emu/debug] | debugcmd.c debugcpu.c debughlp.c debugvw.c express.c |
| [src/emu/machine] | 53c810.c 53c810.h 6522via.c 6522via.h 6526cia.c 6526cia.h 6532riot.c 6532riot.h 6821pia.c 6850acia.c 6850acia.h 68681.c 68681.h 74123.c 74123.h 74148.c 74148.h 74153.c 74153.h 7474.c 7474.h 8042kbdc.c 8237dma.c 8237dma.h 8255ppi.c 8255ppi.h 8257dma.c 8257dma.h adc083x.c adc083x.h adc1213x.c adc1213x.h am53cf96.c at28c16.c at28c16.h cdp1852.c cdp1852.h cr589.c ds2401.c ds2401.h generic.c generic.h i2cmem.c i2cmem.h idectrl.c idectrl.h laserdsc.h latch8.c latch8.h ldcore.c ldpr8210.c ldv1000.c ldvp931.c mb87078.c mb87078.h microtch.c microtch.h msm6242.c msm6242.h pci.c pci.h pcshare.h pic8259.c pic8259.h pit8253.c pit8253.h rtc65271.c rtc65271.h scsi.c scsi.h scsicd.c scsidev.c scsihd.c smc91c9x.c smc91c9x.h timekpr.c timekpr.h wd33c93.c x2212.c x2212.h x76f041.c x76f041.h x76f100.c x76f100.h z80ctc.c z80ctc.h z80dma.c z80dma.h z80pio.c z80pio.h z80sio.c z80sio.h |
| [src/emu/sound] | 2151intf.c 2203intf.c 2413intf.c 2608intf.c 2610intf.c 2612intf.c 262intf.c 3812intf.c 5110intf.c 5110intf.h 5220intf.c aica.c astrocde.c ay8910.c beep.c bsmt2000.c c140.c c352.c c6280.c cdda.c cdp1869.c cem3394.c custom.c custom.h dac.c discrete.c dmadac.c es5503.c es5506.c es8712.c flt_rc.c flt_vol.c gaelco.c hc55516.c ics2115.c iremga20.c k005289.c k007232.c k051649.c k053260.c k054539.c msm5205.c msm5232.c multipcm.c n63701x.c namco.c namco52.c nes_apu.c nile.c okim6258.c okim6295.c pokey.c psx.c psx.h qsound.c rf5c400.c rf5c68.c s14001a.c saa1099.c samples.c scsp.c segapcm.c sid6581.c sn76477.c sn76496.c snkwave.c sp0250.c sp0256.c sp0256.h speaker.c st0016.c tiaintf.c tms3615.c tms36xx.c tms5110.c tms5110.h upd7759.c upd7759.h vlm5030.c votrax.c vrender0.c wave.c x1_010.c ymf271.c ymf278b.c ymz280b.c |
| [src/emu/video] | cdp1869.c cdp1869.h generic.c generic.h mc6845.c mc6845.h poly.c poly.h v9938.c v9938.h vector.c vector.h voodoo.c voodoo.h |
| [src/lib/util] | corefile.c |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/audio] | amiga.c attckufo.c bzone.c cage.c carnival.c cchasm.c cinemat.c cps3.c dcs.c dcs.h exidy.c exidy440.c flower.c galaxian.c geebee.c gomoku.c gottlieb.c gridlee.c jaguar.c leland.c mario.c mcr.c mcr.h n8080.c namco54.c namco54.h namcoc7x.c phoenix.c pleiads.c polepos.c qix.c redalert.c redbaron.c rockola.c scramble.c segag80r.c segasnd.c segasnd.h seibu.c seibu.h senjyo.c snes.c taito_en.c taito_en.h taitosnd.c tiamc1.c timeplt.c tx1.c warpwarp.c williams.c williams.h wiping.c |
| [src/mame/drivers] | 1942.c 1945kiii.c 20pacgal.c 2mindril.c 40love.c 4roses.c 8080bw.c ace.c acommand.c adp.c aeroboto.c aerofgt.c airbustr.c ajax.c aleck64.c alg.c aliens.c alpha68k.c ambush.c ampoker2.c amspdwy.c angelkds.c appoooh.c aquarium.c arabian.c arcadecl.c arcadia.c argus.c arkanoid.c armedf.c artmagic.c ashnojoe.c asterix.c asteroid.c astinvad.c astrocde.c astrocorp.c astrof.c asuka.c atarifb.c atarig1.c atarig42.c atarigx2.c atarisy1.c atarisy2.c ataxx.c attckufo.c avalnche.c aztarac.c backfire.c badlands.c bagman.c balsente.c bankp.c baraduke.c batman.c battlane.c battlex.c bbusters.c beaminv.c berzerk.c bestleag.c bfcobra.c bfm_sc2.c bigevglf.c bigfghtr.c bigstrkb.c bionicc.c bking.c blackt96.c bladestl.c blmbycar.c blockade.c blockhl.c blockout.c bloodbro.c blstroid.c bnstars.c bogeyman.c bombjack.c bottom9.c boxer.c brasil.c brkthru.c bsktball.c btoads.c bublbobl.c bwidow.c bwing.c bzone.c cabal.c calomega.c calorie.c canyon.c carjmbre.c carpolo.c carrera.c caswin.c* cave.c cball.c cbasebal.c cbuster.c ccastles.c cchasm.c cclimber.c centiped.c chaknpop.c cham24.c champbas.c champbwl.c chanbara.c cheekyms.c cherrym2.c chinagat.c chinsan.c chqflag.c cidelsa.c circus.c circusc.c cischeat.c citycon.c clayshoo.c cliffhgr.c cloak.c cloud9.c clshroad.c cninja.c cntsteer.c coinmstr.c cojag.c combatsc.c comebaby.c commando.c compgolf.c contra.c coolpool.c coolridr.c cop01.c copsnrob.c cosmic.c cowrace.c cps1.c cps2.c cps3.c crbaloon.c crgolf.c crimfght.c crospang.c crshrace.c cshooter.c cubeqst.c cubocd32.c cultures.c cvs.c cyberbal.c cybertnk.c dacholer.c darius.c darkhors.c darkmist.c darkseal.c dassault.c dblewing.c dcheese.c dcon.c dday.c ddayjlc.c ddenlovr.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco156.c deco32.c deco_mlc.c decocass.c deniam.c destroyr.c dgpix.c dietgo.c discoboy.c diverboy.c djboy.c dkong.c dlair.c dmndrby.c docastle.c dogfgt.c dominob.c dooyong.c dorachan.c dragrace.c dreamwld.c drgnmst.c dribling.c drmicro.c drtomy.c dunhuang.c dwarfd.c dynadice.c dynax.c dynduke.c egghunt.c enigma2.c eolith.c eolith16.c epos.c eprom.c equites.c esd16.c esh.c espial.c ettrivia.c exedexes.c exerion.c exidy.c exidy440.c expro02.c exprraid.c exterm.c exzisus.c f-32.c f1gp.c fantland.c fastfred.c fcombat.c fcrash.c fgoal.c filetto.c finalizr.c findout.c firebeat.c firefox.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c forte2.c fortecar.c freekick.c funkybee.c funkyjet.c funworld.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco3d.c gal3.c galaga.c galaxi.c galivan.c galpani2.c galpani3.c galpanic.c galspnbl.c gamecstl.c gameplan.c gaplus.c gatron.c gauntlet.c gberet.c gbusters.c genesis.c getrivia.c ghosteo.c gijoe.c ginganin.c gladiatr.c gng.c go2000.c goal92.c goindol.c goldnpkr.c goldstar.c good.c goodejan.c gotcha.c gottlieb.c gotya.c gpworld.c gradius3.c grchamp.c gstream.c gstriker.c gsword.c gticlub.c gtipoker.c guab.c gumbo.c gundealr.c gunpey.c gunsmoke.c gyruss.c halleys.c hanaawas.c hanaroku.c harddriv.c hexa.c hexion.c higemaru.c hitme.c hnayayoi.c hng64.c holeland.c homedata.c homerun.c hornet.c hotblock.c hshavoc.c hyhoo.c hyperspt.c hyprduel.c igs009.c igs_180.c igs_blit.c igs_m027.c igs_m68.c ikki.c imolagp.c intrscti.c iqblock.c ironhors.c istellar.c itech32.c itech8.c jack.c jackal.c jackpool.c jailbrek.c jalmah.c jangou.c janshi.c* jantotsu.c* jchan.c jedi.c jokrwild.c jollyjgr.c jongkyo.c jpmimpct.c jrpacman.c kaneko16.c kangaroo.c karnov.c kickgoal.c kingobox.c kingpin.c kinst.c klax.c kncljoe.c koikoi.c konamigq.c konamigv.c konamigx.c kopunch.c ksayakyu.c ksys573.c kyugo.c ladybug.c ladyfrog.c laserbas.c laserbat.c lasso.c lastduel.c leland.c lemmings.c lethal.c lgp.c liberate.c liberatr.c limenko.c littlerb.c lockon.c looping.c lordgun.c lsasquad.c ltcasino.c lucky74.c lvcards.c lwings.c m10.c m107.c m57.c m58.c m62.c m63.c m72.c m79amb.c m90.c m92.c macrossp.c madalien.c madmotor.c magic10.c magicfly.c magmax.c mainevt.c mainsnk.c mappy.c marineb.c marinedt.c mario.c markham.c mastboy.c matmania.c mayumi.c mazerbla.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c mediagx.c megadriv.c megadriv.h megaplay.c megasys1.c megatech.c megazone.c meijinsn.c merit.c meritm.c mermaid.c metlclsh.c metro.c mexico86.c mgolf.c mhavoc.c micro3d.c midas.c midvunit.c midyunit.c midzeus.c mikie.c miniboy7.c mirage.c mirax.c missb2.c missile.c mitchell.c mjkjidai.c mjsister.c mjsiyoub.c mlanding.c model1.c model2.c model3.c mogura.c mole.c momoko.c mouser.c mpu4.c mpu4drvr.c mquake.c mrflea.c mrjong.c ms32.c msisaac.c mugsmash.c multigam.c murogem.c mustache.c mw8080bw.c mwarr.c mystston.c mystwarr.c n8080.c namcona1.c namconb1.c namcond1.c namcos1.c namcos11.c namcos12.c namcos2.c namcos21.c namcos22.c namcos23.c namcos86.c naomi.c naughtyb.c nbmj8688.c nbmj8891.c nbmj8991.c nbmj9195.c nemesis.c neodrvr.c neogeo.c news.c ninjakd2.c ninjaw.c nitedrvr.c niyanpai.c nmg5.c nmk16.c nova2001.c nss.c nwk-tr.c nycaptor.c nyny.c offtwall.c ohmygod.c olibochu.c omegrace.c oneshot.c onetwo.c opwolf.c orbit.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c pangofun.c panicr.c paradise.c paranoia.c parentj.c* parodius.c pasha2.c pass.c pastelg.c pbaction.c pengo.c peplus.c pgm.c phoenix.c pingpong.c pipeline.c pirates.c pitnrun.c pkscram.c pktgaldx.c playch10.c playmark.c plygonet.c pntnpuzl.c polepos.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerbal.c powerins.c ppmast93.c prehisle.c psikyo.c psikyosh.c psychic5.c pturn.c puckpkmn.c punchout.c pushman.c qix.c quantum.c quasar.c queen.c quizdna.c quizpani.c quizpun2.c r2dtank.c rabbit.c raiden.c raiden2.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c rcasino.c realbrk.c redclash.c relief.c renegade.c retofinv.c rmhaihai.c rockola.c rohga.c rollerg.c rotaryf.c route16.c royalmah.c rpunch.c runaway.c rungun.c safarir.c sandscrp.c sangho.c sauro.c sbasketb.c sbowling.c sbrkout.c sbugger.c scobra.c scotrsht.c scramble.c scregg.c sderby.c seattle.c segae.c segag80r.c segag80v.c segahang.c segald.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c seta2.c sfkick.c sg1000a.c shadfrce.c shangha3.c shanghai.c shangkid.c shaolins.c shisen.c shootout.c shougi.c shuuz.c sidearms.c silkroad.c skullxbo.c skyarmy.c skydiver.c skyfox.c skykid.c skylncr.c skyraid.c slapfght.c slapshot.c sliver.c smstrv.c snesb.c snk.c snk68.c snookr10.c snowbros.c spacefb.c spbactn.c spcforce.c spdodgeb.c speedatk.c speedbal.c speedspn.c speglsht.c spiders.c spool99.c sprcros2.c sprint2.c sprint4.c sprint8.c spy.c srmp2.c srmp5.c srmp6.c srumbler.c ssfindo.c sshangha.c ssingles.c sslam.c sspeedr.c ssrj.c sstrangr.c ssv.c st0016.c stactics.c stadhero.c starfire.c starshp1.c starwars.c statriv2.c steaser.c stepstag.c stfight.c stlforce.c strnskil.c stv.c stvinit.c subs.c suna16.c suna8.c supbtime.c supdrapo.c superchs.c superdq.c superqix.c supertnk.c suprgolf.c suprnova.c suprridr.c suprslam.c system16.c system18.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_x.c taito_z.c taitoair.c taitojc.c taitosj.c taitowlf.c tank8.c tankbust.c taotaido.c tarzan.c tatsumi.c tattack.c taxidrvr.c tbowl.c tceptor.c tcl.c tecmo16.c tecmosys.c tehkanwc.c tempest.c terracre.c tetrisp2.c tetriunk.c thayers.c thedeep.c thepit.c thunderj.c thunderx.c tiamc1.c tigeroad.c timelimt.c timeplt.c tmaster.c tnzs.c toaplan1.c toaplan2.c toki.c toobin.c topshoot.c topspeed.c toratora.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c trucocl.c trvmadns.c trvquest.c tryout.c tsamurai.c ttchamp.c tubep.c tugboat.c tumbleb.c tumblep.c tunhunt.c turbo.c turbosub.c twin16.c twincobr.c twins.c tx1.c uapce.c ultraman.c ultratnk.c ultrsprt.c undrfire.c unico.c upscope.c usgames.c vamphalf.c vaportra.c vastar.c vball.c vcombat.c vegaeo.c vegas.c vendetta.c vertigo.c vicdual.c victory.c videopin.c vigilant.c vindictr.c viper.c vmetal.c volfied.c vroulet.c vsnes.c vulgus.c wallc.c wardner.c warpwarp.c warriorb.c wecleman.c welltris.c wgp.c wheelfir.c williams.c wink.c witch.c wiz.c wldarrow.c wolfpack.c wrally.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c xorworld.c xxmissio.c xybots.c yumefuda.c yunsun16.c zaccaria.c zaxxon.c zerozone.c zn.c zodiack.c zr107.c |
| [src/mame/includes] | amiga.h carpolo.h gaelco3d.h galaxold.h harddriv.h jaguar.h n64.h naomibd.h psx.h snes.h system16.h |
| [src/mame/machine] | amiga.c atari.c atarigen.c atarigen.h balsente.c bublbobl.c carpolo.c cubocd32.c dc.c fddebug.c fddebug.h* galaxold.c harddriv.c konppc.c konppc.h leland.c mcr.c mexico86.c midtunit.c midwayic.c midwayic.h midwunit.c midyunit.c model1.c n64.c namcoio.c namcos1.c naomibd.c pcecommn.c pcecommn.h pcshare.c playch10.c psx.c s16fd.c s24fd.c scramble.c segaic16.c seicop.c slapstic.c system16.c taitosj.c tnzs.c toaplan1.c tx1.c vertigo.c vsnes.c williams.c wrally.c zs01.c zs01.h |
| [src/mame/video] | 1942.c 1943.c 40love.c aeroboto.c ambush.c amspdwy.c appoooh.c arkanoid.c armedf.c ashnojoe.c atari.c avgdvg.c aztarac.c bagman.c bankp.c baraduke.c battlane.c battlex.c bionicc.c bking.c blktiger.c blockout.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c btime.c bublbobl.c buggychl.c cabal.c carpolo.c cbuster.c cchasm.c champbas.c cidelsa.c cinemat.c circusc.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 deco32.c decocass.c dietgo.c digdug.c docastle.c dogfgt.c dooyong.c drmicro.c dynduke.c equites.c esd16.c exprraid.c exzisus.c fastfred.c finalizr.c firetrap.c flower.c flstory.c freekick.c funkybee.c funkyjet.c funworld.c fuukifg2.c fuukifg3.c gaelco3d.c gaiden.c galaga.c galastrm.c galaxold.c gaplus.c gberet.c gladiatr.c gng.c goindol.c goldstar.c gottlieb.c gotya.c gtia.c gtia.h gticlub.c gunsmoke.c hanaawas.c hexa.c higemaru.c holeland.c hyperspt.c hyprduel.c ironhors.c jack.c jackal.c jagblit.c jagobj.c jaguar.c jailbrek.c kan_panb.c kan_pand.c kchamp.c kingobox.c ladybug.c lasso.c lastduel.c liberate.c lkage.c lockon.c lsasquad.c lwings.c m52.c m58.c m72.c m92.c madalien.c mainsnk.c mappy.c markham.c mermaid.c metlclsh.c metro.c midvunit.c midzeus.c midzeus2.c mikie.c mjkjidai.c model1.c model2.c model3.c mole.c mouser.c mrjong.c mustache.c n64.c n8080.c namcos1.c namcos22.c namcos86.c ninjakd2.c nmk16.c nova2001.c othldrby.c pacland.c paradise.c pastelg.c pbaction.c pcktgal.c pitnrun.c pktgaldx.c playch10.c pokechmp.c pooyan.c popeye.c powerins.c prehisle.c psikyo.c psx.c psychic5.c pushman.c qix.c quizdna.c rallyx.c realbrk.c redclash.c renegade.c retofinv.c rockola.c rocnrope.c rohga.c sauro.c sbasketb.c scotrsht.c segag80v.c senjyo.c seta2.c sf.c shangha3.c shaolins.c shisen.c shootout.c sidearms.c simpl156.c skykid.c snk.c solomon.c sonson.c spcforce.c spdodgeb.c speedatk.c speedbal.c srumbler.c sshangha.c ssozumo.c stfight.c strnskil.c stvvdp1.c suna16.c suna8.c supbtime.c superqix.c suprloco.c system1.c tagteam.c taitoic.c taitojc.c tecmo.c tecmo16.c tehkanwc.c terracre.c thedeep.c tigeroad.c timeplt.c toki.c trackfld.c travrusa.c tryout.c tsamurai.c tumblep.c twin16.c tx1.c vaportra.c vastar.c vball.c vertigo.c vsnes.c vulgus.c welltris.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c ygv608.c yiear.c yunsun16.c zaccaria.c zaxxon.c zodiack.c |
| [src/mess] | device.c device.h mess.mak messdriv.c uimess.c uimess.h |
| [src/mess/audio] | arcadia.c cdp1863.c channelf.c dai.c dave.c gb.c gmaster.c kaypro.c lmc1992.c lmc1992.h lynx.c mac.c mea8000.c mea8000.h special.c svision.c ted7360.c vc4000.c vic6560.c wswan.c |
| [src/mess/devices] | bitbngr.c bitbngr.h cassette.c cassette.h chd_cd.c chd_cd.h coco_vhd.c coco_vhd.h harddriv.c harddriv.h kermit.c kermit.h microdrv.c printer.c printer.h snapquik.c snapquik.h thomflop.c xmodem.c xmodem.h z80bin.c z80bin.h |
| [src/mess/drivers] | 3do.c a7800.c abc80.c abc80x.c adam.c amiga.c amstrad.c apogee.c apple1.c apple2.c apple3.c arcadia.c at.c atarist.c avigo.c bbc.c bbcbc.c bebox.c bw2.c c128.c c16.c c64.c c65.c cbmb.c cgenie.c channelf.c coco.c compis.c concept.c cpschngr.c dai.c einstein.c enterp.c exelv.c exidy.c gamecom.c gb.c intv.c jaguar.c jupiter.c kaypro.c kc.c kim1.c lisa.c lviv.c lynx.c mac.c mbee.c mekd2.c mephisto.c mikrosha.c mk1.c mk2.c mpf1.c msx.c mtx.c n64.c nc.c newbrain.c odyssey2.c oric.c osborne1.c osi.c p2000t.c partner.c pasogo.c pc.c pc8801.c pce.c pcw.c pcw16.c pentagon.c pet.c pmd85.c pocketc.c pokemini.c psx.c ql.c radio86.c samcoupe.c saturn.c scorpion.c sg1000.c sms.c snes.c sord.c specpls3.c spectrum.c ssystem3.c studio2.c svi318.c thomson.c ti85.c tmc2000e.c trs80.c tutor.c vc20.c vc4000.c vip.c votrpss.c vtech1.c vtech2.c wswan.c x68k.c z88.c |
| [src/mess/includes] | gamecom.h gamepock.h gmaster.h hp48.h odyssey2.h pc.h |
| [src/mess/machine] | 6530miot.c 6530miot.h 6551.c 6551.h 6883sam.c 6883sam.h 68901mfp.c 68901mfp.h 74145.c 74145.h 8530scc.c 8530scc.h 990_dk.c 990_hd.c 99_dsk.c 99_ide.c abc77.c abc77.h abc99.c adam.c adc080x.c adc080x.h amigacd.c amigacrt.c amigacrt.h amigakbd.c amstrad.c ap2_lang.c ap2_lang.h ap2_slot.c ap2_slot.h apple2.c apple2gs.c apple3.c applefdc.c applefdc.h at.c atom.c ay31015.c ay31015.h b2m.c bebox.c c128.c c16.c c64.c c65.c cbmb.c cdp1871.c cdp1871.h coco.c concept.c conkort.c dai.c e0516.c e0516.h gamecom.c gamepock.c gb.c genesis.c geneve.c hd63450.c hd63450.h hp48.c i82439tx.c i8271.c i8271.h ins8154.c ins8154.h ins8250.c ins8250.h kc.c kramermc.c lisa.c lviv.c mc6843.c mc6843.h mc6846.c mc6846.h mc6854.c mc6854.h mm58274c.c mm58274c.h mockngbd.c mockngbd.h msm8251.c msm8251.h msx.c mtx.c ncr5380.c nec765.c nec765.h nes.c odyssey2.c oric.c osborne1.c partner.c pc.c pc8801.c pc_fdc.c pc_fdc.h pc_hdc.c pcf8593.c pcf8593.h pet.c pokemini.c radio86.c smc92x4.c sms.c snescart.c spectrum.c svi318.c sym1.c tc8521.c tc8521.h ti99_4x.c tms5501.c tms5501.h tms9901.c tms9901.h tms9902.c tms9902.h upd7002.c upd7002.h vector06.c vtech1.c vtech2.c wd17xx.c wd17xx.h wswan.c x68k_hdc.c x68k_hdc.h z80dart.c z80dart.h zx8302.c zx8302.h |
| [src/mess/osd/windows] | dialog.c menu.c |
| [src/mess/tools/messtest] | main.c testmess.c |
| [src/mess/video] | abc800.c abc802.c abc806.c cdp1861.c cdp1861.h cdp1862.c cdp1862.h cdp1864.c cdp1864.h comx35.c crtc_ega.c crtc_ega.h dl1416.c dl1416.h i8275.c i8275.h msm6255.c msm6255.h odyssey2.c pc_aga.c pc_cga.c pc_ega.c pc_mda.c pc_t1t.c pecom.c saa5050.c tmc1800.c tmc600.c vectrex.c zx8301.c zx8301.h |
| [src/osd/windows] | debugwin.c input.c output.c winmain.c |
| [src/osd/winui] | properties.c treeview.c |
| r3957 | r3958 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | z80ctc_interface cchasm_ctc_intf = |
| 161 | 161 | { |
| 162 | "audio", /* clock from the audio CPU */ | |
| 163 | 0, /* clock (filled in from the CPU 0 clock */ | |
| 164 | 162 | 0, /* timer disables */ |
| 165 | 163 | ctc_interrupt, /* interrupt handler */ |
| 166 | 164 | 0, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | #include "driver.h" |
| 7 | #include "cpu/m6800/m6800.h" | |
| 7 | 8 | #include "qix.h" |
| 8 | 9 | #include "machine/6821pia.h" |
| 9 | 10 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | static | |
| 122 | static STREAM_UPDATE( warpwarp_sound_update | |
| 123 | 123 | { |
| 124 | 124 | static int vcarry = 0; |
| 125 | 125 | static int vcount = 0; |
| r3957 | r3958 | |
| 127 | 127 | static int mcount = 0; |
| 128 | 128 | stream_sample_t *buffer = outputs[0]; |
| 129 | 129 | |
| 130 | while (le | |
| 130 | while (samples | |
| 131 | 131 | { |
| 132 | 132 | *buffer++ = (sound_signal + music_signal) / 2; |
| 133 | 133 |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | #include "driver.h" |
| 7 | #include "deprecat.h" | |
| 8 | 7 | #include "streams.h" |
| 9 | 8 | #include "includes/cps3.h" |
| 10 | 9 | |
| r3957 | r3958 | |
| 25 | 24 | UINT16 key; |
| 26 | 25 | } chip; |
| 27 | 26 | |
| 28 | static | |
| 27 | static STREAM_UPDATE( cps3_stream_update | |
| 29 | 28 | { |
| 30 | 29 | int i; |
| 31 | INT8 *base = (INT8*)memory_region( | |
| 30 | INT8 *base = (INT8*)memory_region(device->machine, "user5"); | |
| 32 | 31 | |
| 33 | 32 | /* Clear the buffers */ |
| 34 | memset(buffer[0], 0, length*sizeof(*buffer[0])); | |
| 35 | memset(buffer[1], 0, length*sizeof(*buffer[1])); | |
| 33 | memset(outputs[0], 0, samples*sizeof(*outputs[0])); | |
| 34 | memset(outputs[1], 0, samples*sizeof(*outputs[1])); | |
| 36 | 35 | |
| 37 | 36 | for (i = 0; i < CPS3_VOICES; i ++) |
| 38 | 37 | { |
| r3957 | r3958 | |
| 62 | 61 | loop -= 0x400000; |
| 63 | 62 | |
| 64 | 63 | /* Go through the buffer and add voice contributions */ |
| 65 | for (j = 0; j < le | |
| 64 | for (j = 0; j < samples | |
| 66 | 65 | { |
| 67 | 66 | INT32 sample; |
| 68 | 67 | |
| r3957 | r3958 | |
| 86 | 85 | sample = base[BYTE4_XOR_LE(start + pos)]; |
| 87 | 86 | frac += step; |
| 88 | 87 | |
| 89 | buffer[0][j] += (sample * (vol_l >> 8)); | |
| 90 | buffer[1][j] += (sample * (vol_r >> 8)); | |
| 88 | outputs[0][j] += (sample * (vol_l >> 8)); | |
| 89 | outputs[1][j] += (sample * (vol_r >> 8)); | |
| 91 | 90 | } |
| 92 | 91 | |
| 93 | 92 | vptr->pos = pos; |
| r3957 | r3958 | |
|---|---|---|
| 1170 | 1170 | return auto_malloc(1); |
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | ||
| 1173 | STREAM_UPDATE( snes_sh_update | |
| 1174 | 1174 | { |
| 1175 | 1175 | int i; |
| 1176 | 1176 | short mix[2]; |
| 1177 | 1177 | |
| 1178 | for (i = 0; i < le | |
| 1178 | for (i = 0; i < samples | |
| 1179 | 1179 | { |
| 1180 | 1180 | mix[0] = mix[1] = 0; |
| 1181 | 1181 | DSP_Update(mix); |
| r3957 | r3958 | |
|---|---|---|
| 143 | 143 | ****************************************************************************/ |
| 144 | 144 | |
| 145 | 145 | #include "driver.h" |
| 146 | #include "deprecat.h" | |
| 147 | 146 | #include "memconv.h" |
| 148 | 147 | #include "includes/jaguar.h" |
| 149 | 148 | #include "cpu/jaguar/jaguar.h" |
| r3957 | r3958 | |
| 209 | 208 | * |
| 210 | 209 | *************************************/ |
| 211 | 210 | |
| 212 | static void update_gpu_irq( | |
| 211 | static void update_gpu_irq(running_machine *machine) | |
| 213 | 212 | { |
| 214 | 213 | if (gpu_irq_state & dsp_regs[JINTCTRL] & 0x1f) |
| 215 | 214 | { |
| 216 | cpu_set_input_line(Machine->cpu[1], 1, ASSERT_LINE); | |
| 217 | jaguar_gpu_resume(Machine); | |
| 215 | cpu_set_input_line(machine->cpu[1], 1, ASSERT_LINE); | |
| 216 | jaguar_gpu_resume(machine); | |
| 218 | 217 | } |
| 219 | 218 | else |
| 220 | cpu_set_input_line( | |
| 219 | cpu_set_input_line(machine->cpu[1], 1, CLEAR_LINE); | |
| 221 | 220 | } |
| 222 | 221 | |
| 223 | 222 | |
| r3957 | r3958 | |
| 227 | 226 | gpu_irq_state |= 1; |
| 228 | 227 | else |
| 229 | 228 | gpu_irq_state &= ~1; |
| 230 | update_gpu_irq(); | |
| 229 | update_gpu_irq(device->machine); | |
| 231 | 230 | } |
| 232 | 231 | |
| 233 | 232 | |
| r3957 | r3958 | |
| 283 | 282 | * |
| 284 | 283 | *************************************/ |
| 285 | 284 | |
| 286 | void cojag_sound_reset( | |
| 285 | void cojag_sound_reset(running_machine *machine) | |
| 287 | 286 | { |
| 288 | 287 | #if ENABLE_SPEEDUP_HACKS |
| 289 | serial_timer = timer_alloc( | |
| 288 | serial_timer = timer_alloc(machine, serial_chunky_callback, NULL); | |
| 290 | 289 | #else |
| 291 | serial_timer = timer_alloc( | |
| 290 | serial_timer = timer_alloc(machine, serial_callback, NULL); | |
| 292 | 291 | #endif |
| 293 | 292 | } |
| 294 | 293 | |
| r3957 | r3958 | |
| 323 | 322 | { |
| 324 | 323 | case JINTCTRL: |
| 325 | 324 | gpu_irq_state &= ~(dsp_regs[JINTCTRL] >> 8); |
| 326 | update_gpu_irq(); | |
| 325 | update_gpu_irq(space->machine); | |
| 327 | 326 | break; |
| 328 | 327 | } |
| 329 | 328 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | 12 | #include "streams.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | #include "sound/custom.h" |
| 15 | 14 | #include "sound/tms36xx.h" |
| 16 | 15 | #include "phoenix.h" |
| r3957 | r3958 | |
| 205 | 204 | return sum; |
| 206 | 205 | } |
| 207 | 206 | |
| 208 | static | |
| 207 | static STREAM_UPDATE( phoenix_sound_update | |
| 209 | 208 | { |
| 210 | int samplerate = | |
| 209 | int samplerate = device->machine->sample_rate; | |
| 211 | 210 | stream_sample_t *buffer = outputs[0]; |
| 212 | 211 | |
| 213 | while( le | |
| 212 | while( samples | |
| 214 | 213 | { |
| 215 | 214 | int sum = 0; |
| 216 | 215 | sum = noise(samplerate) / 2; |
| r3957 | r3958 | |
|---|---|---|
| 322 | 322 | |
| 323 | 323 | if (n8080_hardware == 1) |
| 324 | 324 | { |
| 325 | flip_screen_set_no_update(data & 0x20); | |
| 325 | flip_screen_set_no_update(machine, data & 0x20); | |
| 326 | 326 | } |
| 327 | 327 | if (n8080_hardware == 3) |
| 328 | 328 | { |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | 12 | #include "streams.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | #include "includes/amiga.h" |
| 15 | 14 | #include "cpu/m68000/m68000.h" |
| 16 | 15 | |
| r3957 | r3958 | |
| 123 | 122 | |
| 124 | 123 | |
| 125 | 124 | |
| 126 | static | |
| 125 | static STREAM_UPDATE( amiga_stream_update | |
| 127 | 126 | { |
| 128 | 127 | amiga_audio *audio = param; |
| 129 | 128 | int channum, sampoffs = 0; |
| r3957 | r3958 | |
| 138 | 137 | |
| 139 | 138 | /* clear the sample data to 0 */ |
| 140 | 139 | for (channum = 0; channum < 4; channum++) |
| 141 | memset(outputs[channum], 0, sizeof(stream_sample_t) * le | |
| 140 | memset(outputs[channum], 0, sizeof(stream_sample_t) * samples | |
| 142 | 141 | return; |
| 143 | 142 | } |
| 144 | 143 | |
| 145 | le | |
| 144 | samples | |
| 146 | 145 | |
| 147 | 146 | /* update the DMA states on each channel and reload if fresh */ |
| 148 | 147 | for (channum = 0; channum < 4; channum++) |
| r3957 | r3958 | |
| 154 | 153 | } |
| 155 | 154 | |
| 156 | 155 | /* loop until done */ |
| 157 | while (le | |
| 156 | while (samples | |
| 158 | 157 | { |
| 159 | 158 | int nextper, nextvol; |
| 160 | int ticks = le | |
| 159 | int ticks = samples | |
| 161 | 160 | |
| 162 | 161 | /* determine the number of ticks we can do in this chunk */ |
| 163 | 162 | if (ticks > audio->channel[0].curticks) |
| r3957 | r3958 | |
| 242 | 241 | /* if we're in manual mode, signal an interrupt once we latch the low byte */ |
| 243 | 242 | if (!chan->dmaenabled && chan->manualmode && (chan->curlocation & 1)) |
| 244 | 243 | { |
| 245 | signal_irq( | |
| 244 | signal_irq(device->machine, NULL, channum); | |
| 246 | 245 | chan->manualmode = FALSE; |
| 247 | 246 | } |
| 248 | 247 | } |
| r3957 | r3958 | |
| 250 | 249 | |
| 251 | 250 | /* bump ourselves forward by the number of ticks */ |
| 252 | 251 | sampoffs += ticks; |
| 253 | le | |
| 252 | samples | |
| 254 | 253 | } |
| 255 | 254 | } |
| 256 | 255 |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/z80/z80.h" | |
| 14 | 15 | #include "sound/ay8910.h" |
| 15 | 16 | #include "sound/flt_rc.h" |
| 16 | 17 | #include "timeplt.h" |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include " | |
| 20 | #include " | |
| 21 | 21 | #include "cpu/ccpu/ccpu.h" |
| 22 | 22 | #include "cpu/z80/z80daisy.h" |
| 23 | 23 | #include "machine/z80ctc.h" |
| r3957 | r3958 | |
| 52 | 52 | * |
| 53 | 53 | *************************************/ |
| 54 | 54 | |
| 55 | static void (*sound_handler)(UINT8 sound_val, UINT8 bits_changed); | |
| 55 | static void (*sound_handler)(running_machine *,UINT8 sound_val, UINT8 bits_changed); | |
| 56 | 56 | static UINT8 sound_control; |
| 57 | 57 | |
| 58 | 58 | /* general shift register variables */ |
| r3957 | r3958 | |
| 85 | 85 | |
| 86 | 86 | /* if something changed, call the sound subroutine */ |
| 87 | 87 | if ((sound_control != oldval) && sound_handler) |
| 88 | (*sound_handler)(sound_control, sound_control ^ oldval); | |
| 88 | (*sound_handler)(space->machine, sound_control, sound_control ^ oldval); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| r3957 | r3958 | |
| 96 | 96 | * |
| 97 | 97 | *************************************/ |
| 98 | 98 | |
| 99 | static void generic_init(running_machine *machine, void (*callback)(UINT8, UINT8)) | |
| 99 | static void generic_init(running_machine *machine, void (*callback)(running_machine *,UINT8, UINT8)) | |
| 100 | 100 | { |
| 101 | 101 | /* call the standard init */ |
| 102 | 102 | MACHINE_RESET_CALL(cinemat); |
| r3957 | r3958 | |
| 159 | 159 | spacewar_sample_names |
| 160 | 160 | }; |
| 161 | 161 | |
| 162 | static void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 162 | static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 163 | 163 | { |
| 164 | running_machine *machine = Machine; | |
| 165 | ||
| 166 | 164 | /* Explosion - rising edge */ |
| 167 | 165 | if (SOUNDVAL_RISING_EDGE(0x01)) |
| 168 | 166 | sample_start(0, (mame_rand(machine) & 1) ? 0 : 6, 0); |
| r3957 | r3958 | |
| 238 | 236 | barrier_sample_names |
| 239 | 237 | }; |
| 240 | 238 | |
| 241 | static void barrier_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 239 | static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 242 | 240 | { |
| 243 | 241 | /* Player die - rising edge */ |
| 244 | 242 | if (SOUNDVAL_RISING_EDGE(0x01)) |
| r3957 | r3958 | |
| 289 | 287 | speedfrk_sample_names |
| 290 | 288 | }; |
| 291 | 289 | |
| 292 | static void speedfrk_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 290 | static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 293 | 291 | { |
| 294 | 292 | /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */ |
| 295 | 293 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| r3957 | r3958 | |
| 352 | 350 | starhawk_sample_names |
| 353 | 351 | }; |
| 354 | 352 | |
| 355 | static void starhawk_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 353 | static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 356 | 354 | { |
| 357 | 355 | /* explosion - falling edge */ |
| 358 | 356 | if (SOUNDVAL_FALLING_EDGE(0x01)) |
| r3957 | r3958 | |
| 426 | 424 | sundance_sample_names |
| 427 | 425 | }; |
| 428 | 426 | |
| 429 | static void sundance_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 427 | static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 430 | 428 | { |
| 431 | 429 | /* bong - falling edge */ |
| 432 | 430 | if (SOUNDVAL_FALLING_EDGE(0x01)) |
| r3957 | r3958 | |
| 494 | 492 | tailg_sample_names |
| 495 | 493 | }; |
| 496 | 494 | |
| 497 | static void tailg_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 495 | static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 498 | 496 | { |
| 499 | 497 | /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */ |
| 500 | 498 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| r3957 | r3958 | |
| 580 | 578 | warrior_sample_names |
| 581 | 579 | }; |
| 582 | 580 | |
| 583 | static void warrior_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 581 | static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 584 | 582 | { |
| 585 | 583 | /* normal level - 0=on, 1=off */ |
| 586 | 584 | if (SOUNDVAL_FALLING_EDGE(0x01)) |
| r3957 | r3958 | |
| 649 | 647 | armora_sample_names |
| 650 | 648 | }; |
| 651 | 649 | |
| 652 | static void armora_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 650 | static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 653 | 651 | { |
| 654 | 652 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| 655 | 653 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| r3957 | r3958 | |
| 748 | 746 | ripoff_sample_names |
| 749 | 747 | }; |
| 750 | 748 | |
| 751 | static void ripoff_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 749 | static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 752 | 750 | { |
| 753 | 751 | /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */ |
| 754 | 752 | if (SOUNDVAL_RISING_EDGE(0x02)) |
| r3957 | r3958 | |
| 833 | 831 | starcas_sample_names |
| 834 | 832 | }; |
| 835 | 833 | |
| 836 | static void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 834 | static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 837 | 835 | { |
| 838 | running_machine *machine = Machine; | |
| 839 | 836 | UINT32 target_pitch; |
| 840 | 837 | |
| 841 | 838 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r3957 | r3958 | |
| 946 | 943 | solarq_sample_names |
| 947 | 944 | }; |
| 948 | 945 | |
| 949 | static void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 946 | static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 950 | 947 | { |
| 951 | running_machine *machine = Machine; | |
| 952 | 948 | static float target_volume, current_volume; |
| 953 | 949 | |
| 954 | 950 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r3957 | r3958 | |
| 1086 | 1082 | boxingb_sample_names |
| 1087 | 1083 | }; |
| 1088 | 1084 | |
| 1089 | static void boxingb_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 1085 | static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 1090 | 1086 | { |
| 1091 | 1087 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| 1092 | 1088 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| r3957 | r3958 | |
| 1215 | 1211 | wotw_sample_names |
| 1216 | 1212 | }; |
| 1217 | 1213 | |
| 1218 | static void wotw_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 1214 | static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 1219 | 1215 | { |
| 1220 | running_machine *machine = Machine; | |
| 1221 | 1216 | UINT32 target_pitch; |
| 1222 | 1217 | |
| 1223 | 1218 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r3957 | r3958 | |
| 1328 | 1323 | wotwc_sample_names |
| 1329 | 1324 | }; |
| 1330 | 1325 | |
| 1331 | static void wotwc_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 1326 | static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 1332 | 1327 | { |
| 1333 | running_machine *machine = Machine; | |
| 1334 | 1328 | UINT32 target_pitch; |
| 1335 | 1329 | |
| 1336 | 1330 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r3957 | r3958 | |
| 1428 | 1422 | } |
| 1429 | 1423 | |
| 1430 | 1424 | |
| 1431 | static void demon_sound_w(UINT8 sound_val, UINT8 bits_changed) | |
| 1425 | static void demon_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) | |
| 1432 | 1426 | { |
| 1433 | running_machine *machine = Machine; | |
| 1434 | ||
| 1435 | 1427 | /* all inputs are inverted */ |
| 1436 | 1428 | sound_val = ~sound_val; |
| 1437 | 1429 | |
| r3957 | r3958 | |
| 1508 | 1500 | |
| 1509 | 1501 | static z80ctc_interface demon_z80ctc_interface = |
| 1510 | 1502 | { |
| 1511 | "audio", /* clocked from the audio CPU */ | |
| 1512 | 0, /* clock (filled in from the CPU clock) */ | |
| 1513 | 1503 | 0, /* timer disables */ |
| 1514 | 1504 | ctc_interrupt, /* interrupt handler */ |
| 1515 | 1505 | 0, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 1570 | 1560 | MDRV_CPU_PROGRAM_MAP(demon_sound_map,0) |
| 1571 | 1561 | MDRV_CPU_IO_MAP(demon_sound_ports,0) |
| 1572 | 1562 | |
| 1573 | MDRV_Z80CTC_ADD("ctc", demon_z80ctc_interface) | |
| 1563 | MDRV_Z80CTC_ADD("ctc", 3579545 /* same as "audio" */, demon_z80ctc_interface) | |
| 1574 | 1564 | |
| 1575 | 1565 | MDRV_MACHINE_RESET(demon_sound) |
| 1576 | 1566 | |
| r3957 | r3958 | |
| 1600 | 1590 | static WRITE8_HANDLER( qb3_sound_w ) |
| 1601 | 1591 | { |
| 1602 | 1592 | UINT16 rega = cpu_get_reg(space->machine->cpu[0], CCPU_A); |
| 1603 | demon_sound_w(0x00 | (~rega & 0x0f), 0x10); | |
| 1593 | demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10); | |
| 1604 | 1594 | } |
| 1605 | 1595 | |
| 1606 | 1596 |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | static TIMER_CALLBACK( lfo_timer_cb ); |
| 71 | 71 | static TIMER_CALLBACK( galaxian_sh_update ); |
| 72 | 72 | |
| 73 | static | |
| 73 | static STREAM_UPDATE( tone_update | |
| 74 | 74 | { |
| 75 | stream_sample_t *buffer = output[0]; | |
| 75 | stream_sample_t *buffer = outputs[0]; | |
| 76 | 76 | int i,j; |
| 77 | 77 | INT16 *w = tonewave[vol]; |
| 78 | 78 | |
| 79 | 79 | /* only update if we have non-zero volume and frequency */ |
| 80 | 80 | if( pitch != 0xff ) |
| 81 | 81 | { |
| 82 | for (i = 0; i < le | |
| 82 | for (i = 0; i < samples | |
| 83 | 83 | { |
| 84 | 84 | int mix = 0; |
| 85 | 85 | |
| r3957 | r3958 | |
| 99 | 99 | } |
| 100 | 100 | else |
| 101 | 101 | { |
| 102 | for( i = 0; i < le | |
| 102 | for( i = 0; i < samples | |
| 103 | 103 | *buffer++ = 0; |
| 104 | 104 | } |
| 105 | 105 | } |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | pokey1_w(space, offset, data); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | static | |
| 65 | static STREAM_UPDATE( redbaron_sound_update | |
| 66 | 66 | { |
| 67 | 67 | stream_sample_t *buffer = outputs[0]; |
| 68 | while( le | |
| 68 | while( samples | |
| 69 | 69 | { |
| 70 | 70 | int sum = 0; |
| 71 | 71 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | #include "cpu/tms32031/tms32031.h" |
| 15 | 14 | #include "sound/dmadac.h" |
| 16 | 15 | #include "cage.h" |
| r3957 | r3958 | |
| 193 | 192 | void cage_reset_w(int state) |
| 194 | 193 | { |
| 195 | 194 | if (state) |
| 196 | cage_control_w( | |
| 195 | cage_control_w(cage_cpu->machine, 0); | |
| 197 | 196 | cpu_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); |
| 198 | 197 | } |
| 199 | 198 | |
| r3957 | r3958 | |
| 529 | 528 | |
| 530 | 529 | void main_to_cage_w(UINT16 data) |
| 531 | 530 | { |
| 531 | running_machine *machine = cage_cpu->machine; | |
| 532 | 532 | if (LOG_COMM) |
| 533 | logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(Machine), data); | |
| 534 | timer_call_after_resynch(Machine, NULL, data, deferred_cage_w); | |
| 533 | logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(machine), data); | |
| 534 | timer_call_after_resynch(machine, NULL, data, deferred_cage_w); | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "deprecat.h" | |
| 53 | 52 | #include "namco54.h" |
| 54 | 53 | #include "cpu/mb88xx/mb88xx.h" |
| 55 | 54 | |
| r3957 | r3958 | |
| 114 | 113 | cpu_set_input_line(device, 0, CLEAR_LINE); |
| 115 | 114 | } |
| 116 | 115 | |
| 117 | void namco_54xx_write(UINT8 data) | |
| 116 | void namco_54xx_write(running_machine *machine, UINT8 data) | |
| 118 | 117 | { |
| 119 | const device_config *device = cputag_get_cpu( | |
| 118 | const device_config *device = cputag_get_cpu(machine, CPUTAG_54XX); | |
| 120 | 119 | |
| 121 | 120 | if (device == NULL) |
| 122 | 121 | return; |
| 123 | 122 | |
| 124 | timer_call_after_resynch( | |
| 123 | timer_call_after_resynch(machine, NULL, data, namco_54xx_latch_callback); | |
| 125 | 124 | |
| 126 | 125 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 127 | 126 | |
| r3957 | r3958 | |
| 130 | 129 | // The input clock to the 06XX interface chip is 64H, that is |
| 131 | 130 | // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be |
| 132 | 131 | // asserted for one clock cycle ~= 21us. |
| 133 | timer_set( | |
| 132 | timer_set(machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear); | |
| 134 | 133 | } |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | /* z80 ctc */ |
| 41 | 41 | const z80ctc_interface senjyo_ctc_intf = |
| 42 | 42 | { |
| 43 | "sub", /* clock from sub CPU */ | |
| 44 | 0, /* clock (filled in from the CPU 0 clock */ | |
| 45 | 43 | NOTIMER_2, /* timer disables */ |
| 46 | 44 | daisy_interrupt, /* interrupt handler */ |
| 47 | 45 | z80ctc_trg1_w, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/m6809/m6809.h" | |
| 11 | 12 | #include "streams.h" |
| 12 | 13 | #include "exidy440.h" |
| 13 | 14 | |
| r3957 | r3958 | |
| 110 | 111 | |
| 111 | 112 | |
| 112 | 113 | /* function prototypes */ |
| 113 | static | |
| 114 | static STREAM_UPDATE( channel_update | |
| 114 | 115 | static void m6844_finished(int ch); |
| 115 | 116 | static void play_cvsd(running_machine *machine, int ch); |
| 116 | 117 | static void stop_cvsd(int ch); |
| r3957 | r3958 | |
| 276 | 277 | * |
| 277 | 278 | *************************************/ |
| 278 | 279 | |
| 279 | static | |
| 280 | static STREAM_UPDATE( channel_update | |
| 280 | 281 | { |
| 281 | 282 | int ch; |
| 282 | 283 | |
| 283 | 284 | /* reset the mixer buffers */ |
| 284 | memset(mixer_buffer_left, 0, length * sizeof(INT32)); | |
| 285 | memset(mixer_buffer_right, 0, length * sizeof(INT32)); | |
| 285 | memset(mixer_buffer_left, 0, samples * sizeof(INT32)); | |
| 286 | memset(mixer_buffer_right, 0, samples * sizeof(INT32)); | |
| 286 | 287 | |
| 287 | 288 | /* loop over channels */ |
| 288 | 289 | for (ch = 0; ch < 4; ch++) |
| 289 | 290 | { |
| 290 | 291 | sound_channel_data *channel = &sound_channel[ch]; |
| 291 | int | |
| 292 | int | |
| 292 | 293 | int effective_offset; |
| 293 | 294 | |
| 294 | 295 | /* if we're not active, bail */ |
| r3957 | r3958 | |
| 296 | 297 | continue; |
| 297 | 298 | |
| 298 | 299 | /* see how many samples to copy */ |
| 299 | | |
| 300 | | |
| 300 | 301 | |
| 301 | 302 | /* get a pointer to the sample data and copy to the left */ |
| 302 | 303 | volume = sound_volume[2 * ch + 0]; |
| 303 | 304 | if (volume) |
| 304 | add_and_scale_samples(ch, mixer_buffer_left, | |
| 305 | add_and_scale_samples(ch, mixer_buffer_left, | |
| 305 | 306 | |
| 306 | 307 | /* get a pointer to the sample data and copy to the left */ |
| 307 | 308 | volume = sound_volume[2 * ch + 1]; |
| 308 | 309 | if (volume) |
| 309 | add_and_scale_samples(ch, mixer_buffer_right, | |
| 310 | add_and_scale_samples(ch, mixer_buffer_right, | |
| 310 | 311 | |
| 311 | 312 | /* update our counters */ |
| 312 | channel->offset += samples; | |
| 313 | channel->remaining -= samples; | |
| 314 | left -= samples; | |
| 313 | channel->offset += length; | |
| 314 | channel->remaining -= length; | |
| 315 | left -= length; | |
| 315 | 316 | |
| 316 | 317 | /* update the MC6844 */ |
| 317 | 318 | effective_offset = (ch & 2) ? channel->offset / 2 : channel->offset; |
| r3957 | r3958 | |
| 326 | 327 | } |
| 327 | 328 | |
| 328 | 329 | /* all done, time to mix it */ |
| 329 | mix_to_16(le | |
| 330 | mix_to_16(samples | |
| 330 | 331 | } |
| 331 | 332 | |
| 332 | 333 |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ADDRESS_MAP_EXTERN( namco_54xx_map_data, 8 ); |
| 10 | 10 | ADDRESS_MAP_EXTERN( namco_54xx_map_io, 8 ); |
| 11 | 11 | |
| 12 | void namco_54xx_write(UINT8 data); | |
| 12 | void namco_54xx_write(running_machine *machine, UINT8 data); | |
| 13 | 13 | |
| 14 | 14 | /* discrete nodes */ |
| 15 | 15 | #define NAMCO_54XX_0_DATA NODE_01 |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "streams.h" |
| 9 | #include "deprecat.h" | |
| 10 | 9 | #include "includes/tx1.h" |
| 11 | 10 | #include "video/resnet.h" |
| 12 | 11 | #include "sound/custom.h" |
| r3957 | r3958 | |
| 211 | 210 | } |
| 212 | 211 | |
| 213 | 212 | |
| 214 | static | |
| 213 | static STREAM_UPDATE( tx1_stream_update | |
| 215 | 214 | { |
| 216 | 215 | UINT32 step_0, step_1, step_2; |
| 217 | 216 | double gain_0, gain_1, gain_2, gain_3; |
| 218 | 217 | |
| 219 | stream_sample_t *fl = &buffer[0][0]; | |
| 220 | stream_sample_t *fr = &buffer[1][0]; | |
| 218 | stream_sample_t *fl = &outputs[0][0]; | |
| 219 | stream_sample_t *fr = &outputs[1][0]; | |
| 221 | 220 | |
| 222 | 221 | static stream_sample_t pit0 = 0; |
| 223 | 222 | static stream_sample_t pit1 = 0; |
| 224 | 223 | static stream_sample_t pit2 = 0; |
| 225 | 224 | |
| 226 | 225 | /* Clear the buffers */ |
| 227 | memset(buffer[0], 0, length * sizeof(*buffer[0])); | |
| 228 | memset(buffer[1], 0, length * sizeof(*buffer[1])); | |
| 226 | memset(outputs[0], 0, samples * sizeof(*outputs[0])); | |
| 227 | memset(outputs[1], 0, samples * sizeof(*outputs[1])); | |
| 229 | 228 | |
| 230 | 229 | /* 8253 outputs for the player/opponent engine sounds. */ |
| 231 | 230 | step_0 = pit8253.counts[0].val ? (TX1_PIT_CLOCK / pit8253.counts[0].val) * freq_to_step : 0; |
| r3957 | r3958 | |
| 237 | 236 | gain_2 = tx1_engine_gains[ay_outputb & 0xf]; |
| 238 | 237 | gain_3 = BIT(ay_outputb, 5) ? 1.0f : 1.5f; |
| 239 | 238 | |
| 240 | while (le | |
| 239 | while (samples | |
| 241 | 240 | { |
| 242 | 241 | if (step0 & ((1 << TX1_FRAC))) |
| 243 | 242 | { |
| r3957 | r3958 | |
| 417 | 416 | } |
| 418 | 417 | |
| 419 | 418 | /* This is admittedly a bit of a hack job... */ |
| 420 | static | |
| 419 | static STREAM_UPDATE( buggyboy_stream_update | |
| 421 | 420 | { |
| 422 | 421 | UINT32 step_0, step_1; |
| 423 | 422 | int n1_en, n2_en; |
| 424 | 423 | double gain0, gain1_l, gain1_r; |
| 425 | 424 | |
| 426 | stream_sample_t *fl = &buffer[0][0]; | |
| 427 | stream_sample_t *fr = &buffer[1][0]; | |
| 425 | stream_sample_t *fl = &outputs[0][0]; | |
| 426 | stream_sample_t *fr = &outputs[1][0]; | |
| 428 | 427 | |
| 429 | 428 | /* Clear the buffers */ |
| 430 | memset(buffer[0], 0, length * sizeof(*buffer[0])); | |
| 431 | memset(buffer[1], 0, length * sizeof(*buffer[1])); | |
| 429 | memset(outputs[0], 0, samples * sizeof(*outputs[0])); | |
| 430 | memset(outputs[1], 0, samples * sizeof(*outputs[1])); | |
| 432 | 431 | |
| 433 | 432 | /* 8253 outputs for the player/opponent buggy engine sounds. */ |
| 434 | 433 | step_0 = pit8253.counts[0].val ? (BUGGYBOY_PIT_CLOCK / pit8253.counts[0].val) * freq_to_step : 0; |
| r3957 | r3958 | |
| 441 | 440 | gain1_l = bb_engine_gains[ym_outputa >> 4] * 5; |
| 442 | 441 | gain1_r = bb_engine_gains[ym_outputa & 0xf] * 5; |
| 443 | 442 | |
| 444 | while (le | |
| 443 | while (samples | |
| 445 | 444 | { |
| 446 | 445 | int i; |
| 447 | 446 | stream_sample_t pit0, pit1, n1, n2; |
| r3957 | r3958 | |
| 449 | 448 | pit1 = buggyboy_eng_voltages[(step1 >> 24) & 0xf]; |
| 450 | 449 | |
| 451 | 450 | /* Calculate the tyre screech noise source */ |
| 452 | for (i = 0; i < BUGGYBOY_NOISE_CLOCK / | |
| 451 | for (i = 0; i < BUGGYBOY_NOISE_CLOCK / device->machine->sample_rate; ++i) | |
| 453 | 452 | { |
| 454 | 453 | /* CD4006 is a 4-4-1-4-4-1 shift register */ |
| 455 | 454 | int p13 = BIT(noise_lfsra, 3); |
| r3957 | r3958 | |
|---|---|---|
| 67 | 67 | sound_global_enable(latch & 0x20); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | static | |
| 70 | static STREAM_UPDATE( bzone_sound_update | |
| 71 | 71 | { |
| 72 | 72 | stream_sample_t *buffer = outputs[0]; |
| 73 | while( le | |
| 73 | while( samples | |
| 74 | 74 | { |
| 75 | 75 | static int last_val = 0; |
| 76 | 76 | int sum = 0; |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | #include "audio/mcr.h" | |
| 12 | #include "audio/williams.h" | |
| 10 | #include "cpu/z80/z80.h" | |
| 11 | #include "cpu/m68000/m68000.h" | |
| 13 | 12 | #include "cpu/m6800/m6800.h" |
| 14 | 13 | #include "cpu/m6809/m6809.h" |
| 15 | 14 | #include "sound/5220intf.h" |
| 16 | 15 | #include "sound/ay8910.h" |
| 17 | 16 | #include "sound/dac.h" |
| 17 | #include "audio/williams.h" | |
| 18 | 18 | #include "includes/mcr.h" |
| 19 | 19 | #include "audio/mcr.h" |
| 20 | 20 | |
| r3957 | r3958 | |
| 99 | 99 | * |
| 100 | 100 | *************************************/ |
| 101 | 101 | |
| 102 | static void ssio_compute_ay8910_modulation( | |
| 102 | static void ssio_compute_ay8910_modulation(running_machine *machine); | |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | |
| r3957 | r3958 | |
| 120 | 120 | if (mcr_sound_config & MCR_SSIO) |
| 121 | 121 | { |
| 122 | 122 | ssio_sound_cpu = sound_cpu++; |
| 123 | ssio_compute_ay8910_modulation(); | |
| 123 | ssio_compute_ay8910_modulation(machine); | |
| 124 | 124 | state_save_register_global_array(machine, ssio_data); |
| 125 | 125 | state_save_register_global(machine, ssio_status); |
| 126 | 126 | state_save_register_global(machine, ssio_14024_count); |
| r3957 | r3958 | |
| 170 | 170 | /* Advanced Audio */ |
| 171 | 171 | if (mcr_sound_config & MCR_WILLIAMS_SOUND) |
| 172 | 172 | { |
| 173 | williams_cvsd_init(0); | |
| 173 | williams_cvsd_init(machine, 0); | |
| 174 | 174 | sound_cpu++; |
| 175 | 175 | dac_index++; |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| 180 | void mcr_sound_reset( | |
| 180 | void mcr_sound_reset(running_machine *machine) | |
| 181 | 181 | { |
| 182 | 182 | /* SSIO */ |
| 183 | 183 | if (mcr_sound_config & MCR_SSIO) |
| 184 | 184 | { |
| 185 | ssio_reset_w(1); | |
| 186 | ssio_reset_w(0); | |
| 185 | ssio_reset_w(machine, 1); | |
| 186 | ssio_reset_w(machine, 0); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /* Turbo Chip Squeak */ |
| 190 | 190 | if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK) |
| 191 | 191 | { |
| 192 | turbocs_reset_w(1); | |
| 193 | turbocs_reset_w(0); | |
| 192 | turbocs_reset_w(machine, 1); | |
| 193 | turbocs_reset_w(machine, 0); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /* Chip Squeak Deluxe */ |
| 197 | 197 | if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE) |
| 198 | 198 | { |
| 199 | csdeluxe_reset_w(1); | |
| 200 | csdeluxe_reset_w(0); | |
| 199 | csdeluxe_reset_w(machine, 1); | |
| 200 | csdeluxe_reset_w(machine, 0); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /* Sounds Good */ |
| 204 | 204 | if (mcr_sound_config & MCR_SOUNDS_GOOD) |
| 205 | 205 | { |
| 206 | soundsgood_reset_w(1); | |
| 207 | soundsgood_reset_w(0); | |
| 206 | soundsgood_reset_w(machine, 1); | |
| 207 | soundsgood_reset_w(machine, 0); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | /* Squawk n Talk */ |
| 211 | 211 | if (mcr_sound_config & MCR_SQUAWK_N_TALK) |
| 212 | 212 | { |
| 213 | squawkntalk_reset_w(1); | |
| 214 | squawkntalk_reset_w(0); | |
| 213 | squawkntalk_reset_w(machine, 1); | |
| 214 | squawkntalk_reset_w(machine, 0); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /* Advanced Audio */ |
| r3957 | r3958 | |
| 267 | 267 | frequency of sound output. So we simply apply a volume |
| 268 | 268 | adjustment to each voice according to the duty cycle. |
| 269 | 269 | */ |
| 270 | static void ssio_compute_ay8910_modulation( | |
| 270 | static void ssio_compute_ay8910_modulation(running_machine *machine) | |
| 271 | 271 | { |
| 272 | UINT8 *prom = memory_region( | |
| 272 | UINT8 *prom = memory_region(machine, "proms"); | |
| 273 | 273 | int volval; |
| 274 | 274 | |
| 275 | 275 | /* loop over all possible values of the duty cycle */ |
| r3957 | r3958 | |
| 391 | 391 | return ssio_status; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | void ssio_reset_w(int state) | |
| 394 | void ssio_reset_w(running_machine *machine, int state) | |
| 395 | 395 | { |
| 396 | 396 | /* going high halts the CPU */ |
| 397 | 397 | if (state) |
| 398 | 398 | { |
| 399 | 399 | int i; |
| 400 | 400 | |
| 401 | cpu_set_input_line( | |
| 401 | cpu_set_input_line(machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, ASSERT_LINE); | |
| 402 | 402 | |
| 403 | 403 | /* latches also get reset */ |
| 404 | 404 | for (i = 0; i < 4; i++) |
| r3957 | r3958 | |
| 408 | 408 | } |
| 409 | 409 | /* going low resets and reactivates the CPU */ |
| 410 | 410 | else |
| 411 | cpu_set_input_line( | |
| 411 | cpu_set_input_line(machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, CLEAR_LINE); | |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | READ8_HANDLER( ssio_input_port_r ) |
| r3957 | r3958 | |
| 581 | 581 | return csdeluxe_status; |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | void csdeluxe_reset_w(int state) | |
| 584 | void csdeluxe_reset_w(running_machine *machine, int state) | |
| 585 | 585 | { |
| 586 | cpu_set_input_line( | |
| 586 | cpu_set_input_line(machine->cpu[csdeluxe_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | |
| r3957 | r3958 | |
| 686 | 686 | return soundsgood_status; |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | void soundsgood_reset_w(int state) | |
| 689 | void soundsgood_reset_w(running_machine *machine, int state) | |
| 690 | 690 | { |
| 691 | 691 | //if (state) mame_printf_debug("SG Reset\n"); |
| 692 | cpu_set_input_line( | |
| 692 | cpu_set_input_line(machine->cpu[soundsgood_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | |
| r3957 | r3958 | |
| 782 | 782 | return turbocs_status; |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | void turbocs_reset_w(int state) | |
| 785 | void turbocs_reset_w(running_machine *machine, int state) | |
| 786 | 786 | { |
| 787 | cpu_set_input_line( | |
| 787 | cpu_set_input_line(machine->cpu[turbocs_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | |
| r3957 | r3958 | |
| 908 | 908 | timer_call_after_resynch(space->machine, NULL, data, squawkntalk_delayed_data_w); |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | void squawkntalk_reset_w(int state) | |
| 911 | void squawkntalk_reset_w(running_machine *machine, int state) | |
| 912 | 912 | { |
| 913 | cpu_set_input_line( | |
| 913 | cpu_set_input_line(machine->cpu[squawkntalk_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | 916 |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | 13 | #include "streams.h" |
| 14 | #include "deprecat.h" | |
| 15 | 14 | #include "segag80v.h" |
| 16 | 15 | #include "cpu/mcs48/mcs48.h" |
| 17 | 16 | #include "sound/sp0250.h" |
| r3957 | r3958 | |
| 311 | 310 | } |
| 312 | 311 | |
| 313 | 312 | |
| 314 | void sega_usb_reset(UINT8 t1_clock_mask) | |
| 313 | void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask) | |
| 315 | 314 | { |
| 316 | 315 | /* halt the USB CPU at reset time */ |
| 317 | 316 | cpu_set_input_line(usb.cpu, INPUT_LINE_RESET, ASSERT_LINE); |
| 318 | 317 | |
| 319 | 318 | /* start the clock timer */ |
| 320 | timer_pulse( | |
| 319 | timer_pulse(machine, attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock); | |
| 321 | 320 | usb.t1_clock_mask = t1_clock_mask; |
| 322 | 321 | } |
| 323 | 322 | |
| r3957 | r3958 | |
| 484 | 483 | } |
| 485 | 484 | |
| 486 | 485 | |
| 487 | static | |
| 486 | static STREAM_UPDATE( usb_stream_update | |
| 488 | 487 | { |
| 489 | 488 | stream_sample_t *dest = outputs[0]; |
| 490 | 489 | |
| 491 | 490 | /* iterate over samples */ |
| 492 | while (le | |
| 491 | while (samples | |
| 493 | 492 | { |
| 494 | 493 | double noiseval; |
| 495 | 494 | double sample = 0; |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "cpu/z80/z80.h" |
| 4 | 3 | #include "taitosnd.h" |
| 5 | 4 | |
| r3957 | r3958 | |
| 41 | 40 | static struct TC0140SYT tc0140syt; |
| 42 | 41 | |
| 43 | 42 | |
| 44 | static void Interrupt_Controller( | |
| 43 | static void Interrupt_Controller(running_machine *machine) | |
| 45 | 44 | { |
| 46 | 45 | if ( tc0140syt.nmi_req && tc0140syt.nmi_enabled ) |
| 47 | 46 | { |
| 48 | cpu_set_input_line( | |
| 47 | cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE ); | |
| 49 | 48 | tc0140syt.nmi_req = 0; |
| 50 | 49 | } |
| 51 | 50 | } |
| r3957 | r3958 | |
| 208 | 207 | logerror("tc0140syt: Slave cpu written in mode [%02x] data[%02x]\n",tc0140syt.submode, data & 0xff); |
| 209 | 208 | } |
| 210 | 209 | |
| 211 | Interrupt_Controller(); | |
| 210 | Interrupt_Controller(space->machine); | |
| 212 | 211 | |
| 213 | 212 | } |
| 214 | 213 | |
| r3957 | r3958 | |
| 250 | 249 | res = 0; |
| 251 | 250 | } |
| 252 | 251 | |
| 253 | Interrupt_Controller(); | |
| 252 | Interrupt_Controller(space->machine); | |
| 254 | 253 | |
| 255 | 254 | return res; |
| 256 | 255 | } |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | /************ Generic MCR routines ***************/ |
| 14 | 14 | |
| 15 | 15 | void mcr_sound_init(running_machine *machine, UINT8 config); |
| 16 | void mcr_sound_reset( | |
| 16 | void mcr_sound_reset(running_machine *machine); | |
| 17 | 17 | |
| 18 | 18 | WRITE8_HANDLER( ssio_data_w ); |
| 19 | 19 | READ8_HANDLER( ssio_status_r ); |
| 20 | 20 | READ8_HANDLER( ssio_input_port_r ); |
| 21 | 21 | WRITE8_HANDLER( ssio_output_port_w ); |
| 22 | void ssio_reset_w(int state); | |
| 22 | void ssio_reset_w(running_machine *machine, int state); | |
| 23 | 23 | void ssio_set_custom_input(int which, int mask, read8_space_func handler); |
| 24 | 24 | void ssio_set_custom_output(int which, int mask, write8_space_func handler); |
| 25 | 25 | |
| 26 | 26 | WRITE8_HANDLER( csdeluxe_data_w ); |
| 27 | 27 | READ8_HANDLER( csdeluxe_status_r ); |
| 28 | void csdeluxe_reset_w(int state); | |
| 28 | void csdeluxe_reset_w(running_machine *machine, int state); | |
| 29 | 29 | |
| 30 | 30 | WRITE8_HANDLER( turbocs_data_w ); |
| 31 | 31 | READ8_HANDLER( turbocs_status_r ); |
| 32 | void turbocs_reset_w(int state); | |
| 32 | void turbocs_reset_w(running_machine *machine, int state); | |
| 33 | 33 | |
| 34 | 34 | WRITE8_HANDLER( soundsgood_data_w ); |
| 35 | 35 | READ8_HANDLER( soundsgood_status_r ); |
| 36 | void soundsgood_reset_w(int state); | |
| 36 | void soundsgood_reset_w(running_machine *machine, int state); | |
| 37 | 37 | |
| 38 | 38 | WRITE8_HANDLER( squawkntalk_data_w ); |
| 39 | void squawkntalk_reset_w(int state); | |
| 39 | void squawkntalk_reset_w(running_machine *machine, int state); | |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | MACHINE_DRIVER_EXTERN( sega_universal_sound_board ); |
| 15 | 15 | MACHINE_DRIVER_EXTERN( sega_universal_sound_board_rom ); |
| 16 | 16 | |
| 17 | void sega_usb_reset(UINT8 t1_clock_mask); | |
| 17 | void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask); | |
| 18 | 18 | |
| 19 | 19 | READ8_HANDLER( sega_usb_status_r ); |
| 20 | 20 | WRITE8_HANDLER( sega_usb_data_w ); |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "deprecat.h" | |
| 15 | 14 | #include "streams.h" |
| 16 | 15 | #include "sound/custom.h" |
| 17 | 16 | #include "sound/sn76477.h" |
| r3957 | r3958 | |
| 394 | 393 | } |
| 395 | 394 | } |
| 396 | 395 | |
| 397 | static | |
| 396 | static STREAM_UPDATE( rockola_tone_update | |
| 398 | 397 | { |
| 399 | 398 | stream_sample_t *buffer = outputs[0]; |
| 400 | 399 | int i; |
| 401 | 400 | |
| 402 | 401 | for (i = 0; i < CHANNELS; i++) |
| 403 | validate_tone_channel( | |
| 402 | validate_tone_channel(device->machine, i); | |
| 404 | 403 | |
| 405 | while (le | |
| 404 | while (samples-- > 0) | |
| 406 | 405 | { |
| 407 | 406 | INT32 data = 0; |
| 408 | 407 | |
| r3957 | r3958 | |
| 435 | 434 | tone_channels[i].offset++; |
| 436 | 435 | tone_channels[i].offset &= tone_channels[i].mask; |
| 437 | 436 | |
| 438 | validate_tone_channel( | |
| 437 | validate_tone_channel(device->machine, i); | |
| 439 | 438 | } |
| 440 | 439 | |
| 441 | 440 | if (tone_channels[0].offset == 0 && Sound0StopOnRollover) |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | /* generate sound to the mix buffer in mono */ |
| 81 | static | |
| 81 | static STREAM_UPDATE( wiping_update_mono | |
| 82 | 82 | { |
| 83 | 83 | stream_sample_t *buffer = outputs[0]; |
| 84 | 84 | sound_channel *voice; |
| r3957 | r3958 | |
| 88 | 88 | /* if no sound, we're done */ |
| 89 | 89 | if (sound_enable == 0) |
| 90 | 90 | { |
| 91 | memset(buffer, 0, le | |
| 91 | memset(buffer, 0, samples | |
| 92 | 92 | return; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /* zap the contents of the mixer buffer */ |
| 96 | memset(mixer_buffer, 0, le | |
| 96 | memset(mixer_buffer, 0, samples | |
| 97 | 97 | |
| 98 | 98 | /* loop over each voice and add its contribution */ |
| 99 | 99 | for (voice = channel_list; voice < last_channel; voice++) |
| r3957 | r3958 | |
| 110 | 110 | mix = mixer_buffer; |
| 111 | 111 | |
| 112 | 112 | /* add our contribution */ |
| 113 | for (i = 0; i < le | |
| 113 | for (i = 0; i < samples | |
| 114 | 114 | { |
| 115 | 115 | int offs; |
| 116 | 116 | |
| r3957 | r3958 | |
| 155 | 155 | |
| 156 | 156 | /* mix it down */ |
| 157 | 157 | mix = mixer_buffer; |
| 158 | for (i = 0; i < le | |
| 158 | for (i = 0; i < samples | |
| 159 | 159 | *buffer++ = mixer_lookup[*mix++]; |
| 160 | 160 | } |
| 161 | 161 |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | #include "driver.h" |
| 81 | 81 | #include "streams.h" |
| 82 | #include "cpu/i86/i | |
| 82 | #include "cpu/i86/i | |
| 83 | 83 | #include "cpu/z80/z80.h" |
| 84 | 84 | #include "leland.h" |
| 85 | 85 | #include "sound/custom.h" |
| r3957 | r3958 | |
| 104 | 104 | |
| 105 | 105 | static sound_stream * dac_stream; |
| 106 | 106 | |
| 107 | static | |
| 107 | static STREAM_UPDATE( leland_update | |
| 108 | 108 | { |
| 109 | 109 | stream_sample_t *buffer = outputs[0]; |
| 110 | 110 | int dacnum; |
| 111 | 111 | |
| 112 | 112 | /* reset the buffer */ |
| 113 | memset(buffer, 0, le | |
| 113 | memset(buffer, 0, samples | |
| 114 | 114 | for (dacnum = 0; dacnum < 2; dacnum++) |
| 115 | 115 | { |
| 116 | 116 | int bufout = dac_bufout[dacnum]; |
| r3957 | r3958 | |
| 121 | 121 | UINT8 *base = dac_buffer[dacnum]; |
| 122 | 122 | int i; |
| 123 | 123 | |
| 124 | for (i = 0; i < le | |
| 124 | for (i = 0; i < samples | |
| 125 | 125 | { |
| 126 | 126 | buffer[i] += ((INT16)base[bufout] - 0x80) * 0x40; |
| 127 | 127 | bufout = (bufout + 1) & DAC_BUFFER_MASK; |
| r3957 | r3958 | |
| 304 | 304 | * |
| 305 | 305 | *************************************/ |
| 306 | 306 | |
| 307 | static | |
| 307 | static STREAM_UPDATE( leland_80186_dac_update | |
| 308 | 308 | { |
| 309 | 309 | stream_sample_t *buffer = outputs[0]; |
| 310 | 310 | int i, j, start, stop; |
| r3957 | r3958 | |
| 312 | 312 | if (LOG_SHORTAGES) logerror("----\n"); |
| 313 | 313 | |
| 314 | 314 | /* reset the buffer */ |
| 315 | memset(buffer, 0, le | |
| 315 | memset(buffer, 0, samples | |
| 316 | 316 | |
| 317 | 317 | /* if we're redline racer, we have more DACs */ |
| 318 | 318 | if (!is_redline) |
| r3957 | r3958 | |
| 335 | 335 | int step = d->step; |
| 336 | 336 | |
| 337 | 337 | /* sample-rate convert to the output frequency */ |
| 338 | for (j = 0; j < le | |
| 338 | for (j = 0; j < samples | |
| 339 | 339 | { |
| 340 | 340 | buffer[j] += base[source]; |
| 341 | 341 | frac += step; |
| r3957 | r3958 | |
| 345 | 345 | source &= DAC_BUFFER_SIZE_MASK; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | if (LOG_SHORTAGES && j < length) | |
| 349 | logerror("DAC #%d short by %d/%d samples\n", i, length - j, length); | |
| 348 | if (LOG_SHORTAGES && j < samples) | |
| 349 | logerror("DAC #%d short by %d/%d samples\n", i, samples - j, samples); | |
| 350 | 350 | |
| 351 | 351 | /* update the DAC state */ |
| 352 | 352 | d->fraction = frac; |
| r3957 | r3958 | |
| 367 | 367 | * |
| 368 | 368 | *************************************/ |
| 369 | 369 | |
| 370 | static | |
| 370 | static STREAM_UPDATE( leland_80186_dma_update | |
| 371 | 371 | { |
| 372 | 372 | const address_space *dmaspace = param; |
| 373 | 373 | stream_sample_t *buffer = outputs[0]; |
| 374 | 374 | int i, j; |
| 375 | 375 | |
| 376 | 376 | /* reset the buffer */ |
| 377 | memset(buffer, 0, le | |
| 377 | memset(buffer, 0, samples | |
| 378 | 378 | |
| 379 | 379 | /* loop over DMA buffers */ |
| 380 | 380 | for (i = 0; i < 2; i++) |
| r3957 | r3958 | |
| 416 | 416 | volume = dac[which].volume; |
| 417 | 417 | |
| 418 | 418 | /* sample-rate convert to the output frequency */ |
| 419 | for (j = 0; j < le | |
| 419 | for (j = 0; j < samples | |
| 420 | 420 | { |
| 421 | 421 | buffer[j] += ((int)memory_read_byte(dmaspace, source) - 0x80) * volume; |
| 422 | 422 | frac += step; |
| r3957 | r3958 | |
| 456 | 456 | * |
| 457 | 457 | *************************************/ |
| 458 | 458 | |
| 459 | static | |
| 459 | static STREAM_UPDATE( leland_80186_extern_update | |
| 460 | 460 | { |
| 461 | 461 | stream_sample_t *buffer = outputs[0]; |
| 462 | 462 | struct dac_state *d = &dac[7]; |
| r3957 | r3958 | |
| 464 | 464 | int j; |
| 465 | 465 | |
| 466 | 466 | /* reset the buffer */ |
| 467 | memset(buffer, 0, le | |
| 467 | memset(buffer, 0, samples | |
| 468 | 468 | |
| 469 | 469 | /* if we have data, process it */ |
| 470 | 470 | if (count > 0 && ext_active) |
| r3957 | r3958 | |
| 474 | 474 | int step = d->step; |
| 475 | 475 | |
| 476 | 476 | /* sample-rate convert to the output frequency */ |
| 477 | for (j = 0; j < le | |
| 477 | for (j = 0; j < samples | |
| 478 | 478 | { |
| 479 | 479 | buffer[j] += ((INT16)ext_base[source] - 0x80) * d->volume; |
| 480 | 480 | frac += step; |
| r3957 | r3958 | |
| 617 | 617 | if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", attotime_to_double(timer_get_time(device->machine)), i80186.intr.poll_status & 0x1f); |
| 618 | 618 | |
| 619 | 619 | /* clear the interrupt */ |
| 620 | c | |
| 620 | device | |
| 621 | 621 | i80186.intr.pending = 0; |
| 622 | 622 | |
| 623 | 623 | /* clear the request and set the in-service bit */ |
| r3957 | r3958 | |
|---|---|---|
| 300 | 300 | MDRV_CPU_PROGRAM_MAP(carnival_audio_map,0) |
| 301 | 301 | MDRV_CPU_IO_MAP(carnival_audio_io_map,0) |
| 302 | 302 | |
| 303 | MDRV_ | |
| 303 | MDRV_QUANTUM_TIME | |
| 304 | 304 | |
| 305 | 305 | MDRV_SOUND_ADD("psg", AY8910, PSG_CLOCK) |
| 306 | 306 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | /* generate sound to the mix buffer in mono */ |
| 81 | static | |
| 81 | static STREAM_UPDATE( gomoku_update_mono | |
| 82 | 82 | { |
| 83 | 83 | stream_sample_t *buffer = outputs[0]; |
| 84 | 84 | sound_channel *voice; |
| r3957 | r3958 | |
| 88 | 88 | /* if no sound, we're done */ |
| 89 | 89 | if (sound_enable == 0) |
| 90 | 90 | { |
| 91 | memset(buffer, 0, le | |
| 91 | memset(buffer, 0, samples | |
| 92 | 92 | return; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /* zap the contents of the mixer buffer */ |
| 96 | memset(mixer_buffer, 0, le | |
| 96 | memset(mixer_buffer, 0, samples | |
| 97 | 97 | |
| 98 | 98 | /* loop over each voice and add its contribution */ |
| 99 | 99 | for (ch = 0, voice = channel_list; voice < last_channel; ch++, voice++) |
| r3957 | r3958 | |
| 115 | 115 | mix = mixer_buffer; |
| 116 | 116 | |
| 117 | 117 | /* add our contribution */ |
| 118 | for (i = 0; i < le | |
| 118 | for (i = 0; i < samples | |
| 119 | 119 | { |
| 120 | 120 | c += f; |
| 121 | 121 | |
| r3957 | r3958 | |
| 156 | 156 | |
| 157 | 157 | /* mix it down */ |
| 158 | 158 | mix = mixer_buffer; |
| 159 | for (i = 0; i < le | |
| 159 | for (i = 0; i < samples | |
| 160 | 160 | *buffer++ = mixer_lookup[*mix++]; |
| 161 | 161 | } |
| 162 | 162 |
| r3957 | r3958 | |
|---|---|---|
| 258 | 258 | sound_ram[3]=ROM[0x80003]; |
| 259 | 259 | |
| 260 | 260 | /* reset CPU to catch any banking of startup vectors */ |
| 261 | c | |
| 261 | device | |
| 262 | 262 | //cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE); |
| 263 | 263 | } |
| 264 | 264 |
| r3957 | r3958 | |
|---|---|---|
| 141 | 141 | UINT8 *base; |
| 142 | 142 | } seibu_adpcm[2]; |
| 143 | 143 | |
| 144 | static | |
| 144 | static STREAM_UPDATE( seibu_adpcm_callback | |
| 145 | 145 | { |
| 146 | 146 | struct seibu_adpcm_state *state = param; |
| 147 | 147 | stream_sample_t *dest = outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 1 | #include "cpu/m68000/m68000.h" | |
| 1 | 2 | #include "sound/es5506.h" |
| 2 | 3 | |
| 3 | 4 | READ16_HANDLER(f3_68000_share_r); |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | * |
| 43 | 43 | *************************************/ |
| 44 | 44 | |
| 45 | static | |
| 45 | static STREAM_UPDATE( gridlee_stream_update | |
| 46 | 46 | { |
| 47 | 47 | stream_sample_t *buffer = outputs[0]; |
| 48 | 48 | |
| 49 | 49 | /* loop over samples */ |
| 50 | while (le | |
| 50 | while (samples | |
| 51 | 51 | { |
| 52 | 52 | /* tone channel */ |
| 53 | 53 | tone_fraction += tone_step; |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | static | |
| 65 | static STREAM_UPDATE( geebee_sound_update | |
| 66 | 66 | { |
| 67 | 67 | stream_sample_t *buffer = outputs[0]; |
| 68 | 68 | |
| 69 | while (le | |
| 69 | while (samples | |
| 70 | 70 | { |
| 71 | 71 | *buffer++ = sound_signal; |
| 72 | 72 | /* 1V = HSYNC = 18.432MHz / 3 / 2 / 384 = 8000Hz */ |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | #include "cpu/z80/z80.h" | |
| 26 | 27 | #include "sound/3812intf.h" |
| 27 | 28 | #include "sound/2151intf.h" |
| 28 | 29 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
| 247 | static | |
| 247 | static STREAM_UPDATE( tiamc1_sound_update | |
| 248 | 248 | { |
| 249 | 249 | int count, o0, o1, o2, len, or = 0; |
| 250 | 250 | |
| 251 | len = le | |
| 251 | len = samples | |
| 252 | 252 | |
| 253 | 253 | for (count = 0; count < len; count++) { |
| 254 | 254 | timer1_divider++; |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | 29 | #include "driver.h" |
| 30 | #include "cpu/m37710/m37710.h" | |
| 30 | 31 | #include "deprecat.h" |
| 31 | 32 | #include "audio/namcoc7x.h" |
| 32 | 33 | |
| r3957 | r3958 | |
| 79 | 80 | void namcoc7x_on_driver_init(running_machine *machine) |
| 80 | 81 | { |
| 81 | 82 | UINT8 *pROM = (UINT8 *)memory_region(machine, "c7x"); |
| 82 | | |
| 83 | const device_config *cpu | |
| 83 | 84 | |
| 84 | 85 | // clear the two 16-bits magic values at the start of the rom |
| 85 | 86 | // (prevents external init routines from getting called - they assume a |
| r3957 | r3958 | |
| 87 | 88 | memset(pROM, 0, 4); |
| 88 | 89 | |
| 89 | 90 | // install speedup cheat |
| 90 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) | |
| 91 | if (machine->config->cpu[cpunum].type == CPU_M37702) | |
| 92 | memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpunum], ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w); | |
| 91 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 92 | if (cpu_get_type(cpu) == CPU_M37702) | |
| 93 | memory_install_readwrite16_handler(cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w); | |
| 93 | 94 | } |
| 94 | 95 | |
| 95 | 96 | void namcoc7x_set_host_ram(UINT32 *hostram) |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | #include "streams.h" |
| 13 | 12 | #include "cpu/mcs48/mcs48.h" |
| 14 | 13 | #include "segag80r.h" |
| r3957 | r3958 | |
| 340 | 339 | |
| 341 | 340 | static SOUND_START( 005 ); |
| 342 | 341 | static CUSTOM_START( sega005_custom_start ); |
| 343 | static | |
| 342 | static STREAM_UPDATE( sega005_stream_update | |
| 344 | 343 | static TIMER_CALLBACK( sega005_auto_timer ); |
| 345 | 344 | static WRITE8_DEVICE_HANDLER( sega005_sound_a_w ); |
| 346 | 345 | static WRITE8_DEVICE_HANDLER( sega005_sound_b_w ); |
| r3957 | r3958 | |
| 595 | 594 | } |
| 596 | 595 | |
| 597 | 596 | |
| 598 | static | |
| 597 | static STREAM_UPDATE( sega005_stream_update | |
| 599 | 598 | { |
| 600 | const UINT8 *sound_prom = memory_region( | |
| 599 | const UINT8 *sound_prom = memory_region(device->machine, "proms"); | |
| 601 | 600 | int i; |
| 602 | 601 | |
| 603 | 602 | /* no implementation yet */ |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ****************************************************************************/ |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "streams.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | #include "sound/custom.h" |
| 13 | 12 | #include "sound/tms36xx.h" |
| 14 | 13 | #include "includes/phoenix.h" |
| r3957 | r3958 | |
| 397 | 396 | return sum / 2; |
| 398 | 397 | } |
| 399 | 398 | |
| 400 | static | |
| 399 | static STREAM_UPDATE( pleiads_sound_update | |
| 401 | 400 | { |
| 402 | int rate = | |
| 401 | int rate = device->machine->sample_rate; | |
| 403 | 402 | stream_sample_t *buffer = outputs[0]; |
| 404 | 403 | |
| 405 | while( le | |
| 404 | while( samples | |
| 406 | 405 | { |
| 407 | 406 | int sum = tone1(rate)/2 + tone23(rate)/2 + tone4(rate) + noise(rate); |
| 408 | 407 | *buffer++ = sum < 32768 ? sum > -32768 ? sum : -32768 : 32767; |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | ****************************************************************************/ |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "deprecat.h" | |
| 27 | 26 | #include "machine/6821pia.h" |
| 28 | 27 | #include "cpu/m6809/m6809.h" |
| 29 | 28 | #include "williams.h" |
| r3957 | r3958 | |
| 259 | 258 | INITIALIZATION |
| 260 | 259 | ****************************************************************************/ |
| 261 | 260 | |
| 262 | void williams_cvsd_init(int pianum) | |
| 261 | void williams_cvsd_init(running_machine *machine, int pianum) | |
| 263 | 262 | { |
| 264 | running_machine *machine = Machine; | |
| 265 | 263 | UINT8 *ROM; |
| 266 | 264 | int bank; |
| 267 | 265 | |
| r3957 | r3958 | |
| 296 | 294 | } |
| 297 | 295 | |
| 298 | 296 | |
| 299 | void williams_narc_init( | |
| 297 | void williams_narc_init(running_machine *machine) | |
| 300 | 298 | { |
| 301 | 299 | UINT8 *ROM; |
| 302 | 300 | int bank; |
| 303 | 301 | |
| 304 | 302 | /* configure the CPU */ |
| 305 | sound_cpu = cputag_get_cpu(Machine, "narc1"); | |
| 306 | soundalt_cpu = cputag_get_cpu(Machine, "narc2"); | |
| 303 | sound_cpu = cputag_get_cpu(machine, "narc1"); | |
| 304 | soundalt_cpu = cputag_get_cpu(machine, "narc2"); | |
| 307 | 305 | |
| 308 | 306 | /* configure master CPU banks */ |
| 309 | ROM = memory_region( | |
| 307 | ROM = memory_region(machine, "narc1"); | |
| 310 | 308 | for (bank = 0; bank < 16; bank++) |
| 311 | 309 | { |
| 312 | 310 | /* |
| r3957 | r3958 | |
| 315 | 313 | D3 -> A16 |
| 316 | 314 | */ |
| 317 | 315 | offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3); |
| 318 | memory_configure_bank( | |
| 316 | memory_configure_bank(machine, 5, bank, 1, &ROM[0x10000 + offset], 0); | |
| 319 | 317 | } |
| 320 | memory_set_bankptr( | |
| 318 | memory_set_bankptr( | |
| 321 | 319 | |
| 322 | 320 | /* configure slave CPU banks */ |
| 323 | ROM = memory_region( | |
| 321 | ROM = memory_region(machine, "narc2"); | |
| 324 | 322 | for (bank = 0; bank < 16; bank++) |
| 325 | 323 | { |
| 326 | 324 | /* |
| r3957 | r3958 | |
| 329 | 327 | D3 -> A16 |
| 330 | 328 | */ |
| 331 | 329 | offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3); |
| 332 | memory_configure_bank( | |
| 330 | memory_configure_bank(machine, 7, bank, 1, &ROM[0x10000 + offset], 0); | |
| 333 | 331 | } |
| 334 | memory_set_bankptr( | |
| 332 | memory_set_bankptr( | |
| 335 | 333 | |
| 336 | 334 | /* register for save states */ |
| 337 | state_save_register_global(sound_cpu->machine, williams_sound_int_state); | |
| 338 | state_save_register_global(sound_cpu->machine, audio_talkback); | |
| 339 | state_save_register_global(sound_cpu->machine, audio_sync); | |
| 335 | state_save_register_global(machine, williams_sound_int_state); | |
| 336 | state_save_register_global(machine, audio_talkback); | |
| 337 | state_save_register_global(machine, audio_sync); | |
| 340 | 338 | } |
| 341 | 339 | |
| 342 | 340 | |
| 343 | void williams_adpcm_init( | |
| 341 | void williams_adpcm_init(running_machine *machine) | |
| 344 | 342 | { |
| 345 | 343 | UINT8 *ROM; |
| 346 | 344 | |
| 347 | 345 | /* configure the CPU */ |
| 348 | sound_cpu = cputag_get_cpu( | |
| 346 | sound_cpu = cputag_get_cpu(machine, "adpcm"); | |
| 349 | 347 | soundalt_cpu = NULL; |
| 350 | 348 | |
| 351 | 349 | /* configure banks */ |
| 352 | ROM = memory_region(Machine, "adpcm"); | |
| 353 | memory_configure_bank(Machine, 5, 0, 8, &ROM[0x10000], 0x8000); | |
| 354 | memory_set_bankptr(sound_cpu->machine, 6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]); | |
| 350 | ROM = memory_region(machine, "adpcm"); | |
| 351 | memory_configure_bank(machine, 5, 0, 8, &ROM[0x10000], 0x8000); | |
| 352 | memory_set_bankptr(machine, 6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]); | |
| 355 | 353 | |
| 356 | 354 | /* expand ADPCM data */ |
| 357 | 355 | /* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */ |
| 358 | ROM = memory_region( | |
| 356 | ROM = memory_region(machine, "oki"); | |
| 359 | 357 | memcpy(ROM + 0x1c0000, ROM + 0x080000, 0x20000); /* expand individual banks */ |
| 360 | 358 | memcpy(ROM + 0x180000, ROM + 0x0a0000, 0x20000); |
| 361 | 359 | memcpy(ROM + 0x140000, ROM + 0x0c0000, 0x20000); |
| r3957 | r3958 | |
| 373 | 371 | memcpy(ROM + 0x020000, ROM + 0x060000, 0x20000); |
| 374 | 372 | |
| 375 | 373 | /* register for save states */ |
| 376 | state_save_register_global(sound_cpu->machine, williams_sound_int_state); | |
| 377 | state_save_register_global(sound_cpu->machine, audio_talkback); | |
| 374 | state_save_register_global(machine, williams_sound_int_state); | |
| 375 | state_save_register_global(machine, audio_talkback); | |
| 378 | 376 | } |
| 379 | 377 | |
| 380 | 378 | |
| r3957 | r3958 | |
| 477 | 475 | } |
| 478 | 476 | |
| 479 | 477 | |
| 480 | void williams_cvsd_data_w(int data) | |
| 478 | void williams_cvsd_data_w(running_machine *machine, int data) | |
| 481 | 479 | { |
| 482 | timer_call_after_resynch( | |
| 480 | timer_call_after_resynch(machine, NULL, data, williams_cvsd_delayed_data_w); | |
| 483 | 481 | } |
| 484 | 482 | |
| 485 | 483 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | MACHINE_DRIVER_EXTERN( williams_adpcm_sound ); |
| 9 | 9 | MACHINE_DRIVER_EXTERN( williams_narc_sound ); |
| 10 | 10 | |
| 11 | void williams_cvsd_init(int pianum); | |
| 12 | void williams_cvsd_data_w(int data); | |
| 11 | void williams_cvsd_init(running_machine *machine, int pianum); | |
| 12 | void williams_cvsd_data_w(running_machine *machine, int data); | |
| 13 | 13 | void williams_cvsd_reset_w(int state); |
| 14 | 14 | |
| 15 | void williams_adpcm_init( | |
| 15 | void williams_adpcm_init(running_machine *machine); | |
| 16 | 16 | void williams_adpcm_data_w(int data); |
| 17 | 17 | void williams_adpcm_reset_w(int state); |
| 18 | 18 | int williams_adpcm_sound_irq_r(void); |
| 19 | 19 | |
| 20 | void williams_narc_init( | |
| 20 | void williams_narc_init(running_machine *machine); | |
| 21 | 21 | void williams_narc_data_w(int data); |
| 22 | 22 | void williams_narc_reset_w(int state); |
| 23 | 23 | int williams_narc_talkback_r(void); |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "deprecat.h" | |
| 16 | 15 | #include "cpu/z80/z80.h" |
| 17 | 16 | #include "machine/7474.h" |
| 18 | 17 | #include "sound/flt_rc.h" |
| r3957 | r3958 | |
| 84 | 83 | { |
| 85 | 84 | /* the complement of bit 3 is connected to the flip-flop's clock */ |
| 86 | 85 | TTL7474_clock_w(2, ~data & 0x08); |
| 87 | TTL7474_update(2); | |
| 86 | TTL7474_update(device->machine, 2); | |
| 88 | 87 | |
| 89 | 88 | /* bit 4 is sound disable */ |
| 90 | 89 | sound_global_enable(~data & 0x10); |
| r3957 | r3958 | |
| 94 | 93 | { |
| 95 | 94 | /* bit 1 is connected to the flip-flop's clock */ |
| 96 | 95 | TTL7474_clock_w(3, data & 0x01); |
| 97 | TTL7474_update(3); | |
| 96 | TTL7474_update(space->machine, 3); | |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | 99 | WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w ) |
| 101 | 100 | { |
| 102 | 101 | /* the complement of bit 3 is connected to the flip-flop's clock */ |
| 103 | 102 | TTL7474_clock_w(2, ~data & 0x08); |
| 104 | TTL7474_update(2); | |
| 103 | TTL7474_update(device->machine, 2); | |
| 105 | 104 | } |
| 106 | 105 | |
| 107 | 106 | WRITE8_HANDLER( froggrmc_sh_irqtrigger_w ) |
| 108 | 107 | { |
| 109 | 108 | /* the complement of bit 0 is connected to the flip-flop's clock */ |
| 110 | 109 | TTL7474_clock_w(2, ~data & 0x01); |
| 111 | TTL7474_update(2); | |
| 110 | TTL7474_update(space->machine, 2); | |
| 112 | 111 | } |
| 113 | 112 | |
| 114 | 113 | |
| r3957 | r3958 | |
| 118 | 117 | we need to pulse the CLR line because MAME's core never clears this |
| 119 | 118 | line, only asserts it */ |
| 120 | 119 | TTL7474_clear_w(2, 0); |
| 121 | TTL7474_update(2); | |
| 120 | TTL7474_update(device->machine, 2); | |
| 122 | 121 | |
| 123 | 122 | TTL7474_clear_w(2, 1); |
| 124 | TTL7474_update(2); | |
| 123 | TTL7474_update(device->machine, 2); | |
| 125 | 124 | |
| 126 | 125 | return 0xff; |
| 127 | 126 | } |
| r3957 | r3958 | |
| 132 | 131 | we need to pulse the CLR line because MAME's core never clears this |
| 133 | 132 | line, only asserts it */ |
| 134 | 133 | TTL7474_clear_w(3, 0); |
| 135 | TTL7474_update(3); | |
| 134 | TTL7474_update(device->machine, 3); | |
| 136 | 135 | |
| 137 | 136 | TTL7474_clear_w(3, 1); |
| 138 | TTL7474_update(3); | |
| 137 | TTL7474_update(device->machine, 3); | |
| 139 | 138 | |
| 140 | 139 | return 0xff; |
| 141 | 140 | } |
| 142 | 141 | |
| 143 | 142 | |
| 144 | static void scramble_sh_7474_callback( | |
| 143 | static void scramble_sh_7474_callback(running_machine *machine) | |
| 145 | 144 | { |
| 146 | 145 | /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ |
| 147 | 146 | /* we need to complement Q bar */ |
| 148 | cpu_set_input_line( | |
| 147 | cpu_set_input_line(machine->cpu[1], 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE); | |
| 149 | 148 | } |
| 150 | 149 | |
| 151 | static void sfx_sh_7474_callback( | |
| 150 | static void sfx_sh_7474_callback(running_machine *machine) | |
| 152 | 151 | { |
| 153 | 152 | /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ |
| 154 | 153 | /* we need to complement Q bar */ |
| 155 | cpu_set_input_line( | |
| 154 | cpu_set_input_line(machine->cpu[2], 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE); | |
| 156 | 155 | } |
| 157 | 156 | |
| 158 | 157 | WRITE8_HANDLER( hotshock_sh_irqtrigger_w ) |
| r3957 | r3958 | |
| 209 | 208 | }; |
| 210 | 209 | |
| 211 | 210 | |
| 212 | void scramble_sh_init( | |
| 211 | void scramble_sh_init(running_machine *machine) | |
| 213 | 212 | { |
| 214 | running_machine *machine = Machine; | |
| 215 | 213 | cpu_set_irq_callback(machine->cpu[1], scramble_sh_irq_callback); |
| 216 | 214 | |
| 217 | 215 | TTL7474_config(machine, 2, &scramble_sh_7474_intf); |
| r3957 | r3958 | |
| 220 | 218 | TTL7474_d_w(2, 1); |
| 221 | 219 | } |
| 222 | 220 | |
| 223 | void sfx_sh_init( | |
| 221 | void sfx_sh_init(running_machine *machine) | |
| 224 | 222 | { |
| 225 | running_machine *machine = Machine; | |
| 226 | 223 | cpu_set_irq_callback(machine->cpu[2], sfx_sh_irq_callback); |
| 227 | 224 | |
| 228 | 225 | TTL7474_config(machine, 3, &sfx_sh_7474_intf); |
| r3957 | r3958 | |
| 338 | 335 | timer_set(machine, ATTOTIME_IN_HZ(AD2083_TMS5110_CLOCK / 2),NULL,1,ad2083_step); |
| 339 | 336 | } |
| 340 | 337 | |
| 341 | static int ad2083_speech_rom_read_bit(void) | |
| 338 | static int ad2083_speech_rom_read_bit(const device_config *device) | |
| 342 | 339 | { |
| 343 | UINT8 *ROM = memory_region( | |
| 340 | UINT8 *ROM = memory_region(device->machine, "tms5110"); | |
| 344 | 341 | int bit; |
| 345 | 342 | |
| 346 | 343 | speech_rom_address %= 4096; |
| r3957 | r3958 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | /* generate sound to the mix buffer in mono */ |
| 80 | static | |
| 80 | static STREAM_UPDATE( flower_update_mono | |
| 81 | 81 | { |
| 82 | 82 | stream_sample_t *buffer = outputs[0]; |
| 83 | 83 | sound_channel *voice; |
| r3957 | r3958 | |
| 87 | 87 | /* if no sound, we're done */ |
| 88 | 88 | if (sound_enable == 0) |
| 89 | 89 | { |
| 90 | memset(buffer, 0, le | |
| 90 | memset(buffer, 0, samples | |
| 91 | 91 | return; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /* zap the contents of the mixer buffer */ |
| 95 | memset(mixer_buffer, 0, le | |
| 95 | memset(mixer_buffer, 0, samples | |
| 96 | 96 | |
| 97 | 97 | /* loop over each voice and add its contribution */ |
| 98 | 98 | for (voice = channel_list; voice < last_channel; voice++) |
| r3957 | r3958 | |
| 109 | 109 | mix = mixer_buffer; |
| 110 | 110 | |
| 111 | 111 | /* add our contribution */ |
| 112 | for (i = 0; i < le | |
| 112 | for (i = 0; i < samples | |
| 113 | 113 | { |
| 114 | 114 | int offs; |
| 115 | 115 | |
| r3957 | r3958 | |
| 148 | 148 | |
| 149 | 149 | /* mix it down */ |
| 150 | 150 | mix = mixer_buffer; |
| 151 | for (i = 0; i < le | |
| 151 | for (i = 0; i < samples | |
| 152 | 152 | *buffer++ = mixer_lookup[*mix++]; |
| 153 | 153 | } |
| 154 | 154 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ****************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/m6800/m6800.h" | |
| 12 | #include "cpu/m6502/m6502.h" | |
| 11 | 13 | #include "machine/rescap.h" |
| 12 | 14 | #include "cpu/i8085/i8085.h" |
| 13 | 15 | #include "machine/6821pia.h" |
| r3957 | r3958 | |
| 181 | 183 | } |
| 182 | 184 | |
| 183 | 185 | |
| 184 | static | |
| 186 | static const i8085_config redalert_voice_i8085_config = | |
| 185 | 187 | { |
| 186 | i8085_set_sod_callback(machine->cpu[2], sod_callback); | |
| 187 | i8085_set_sid_callback(machine->cpu[2], sid_callback); | |
| 188 | } | |
| 188 | NULL, /* INTE changed callback */ | |
| 189 | NULL, /* STATUS changed callback */ | |
| 190 | sod_callback, /* SOD changed callback (8085A only) */ | |
| 191 | sid_callback /* SID changed callback (8085A only) */ | |
| 192 | }; | |
| 189 | 193 | |
| 190 | 194 | |
| 191 | 195 | static ADDRESS_MAP_START( redalert_voice_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r3957 | r3958 | |
| 206 | 210 | static SOUND_START( redalert ) |
| 207 | 211 | { |
| 208 | 212 | SOUND_START_CALL(redalert_audio); |
| 209 | SOUND_START_CALL(redalert_voice); | |
| 210 | 213 | } |
| 211 | 214 | |
| 212 | 215 | |
| r3957 | r3958 | |
| 240 | 243 | static MACHINE_DRIVER_START( redalert_audio_voice ) |
| 241 | 244 | |
| 242 | 245 | MDRV_CPU_ADD("voice", 8085A, REDALERT_VOICE_CPU_CLOCK) |
| 246 | MDRV_CPU_CONFIG(redalert_voice_i8085_config) | |
| 243 | 247 | MDRV_CPU_PROGRAM_MAP(redalert_voice_map,0) |
| 244 | 248 | |
| 245 | 249 | MDRV_SOUND_ADD("cvsd", HC55516, REDALERT_HC55516_CLOCK) |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "cpu/z80/z80.h" | |
| 2 | 3 | #include "cpu/mcs48/mcs48.h" |
| 3 | 4 | #include "sound/dac.h" |
| 4 | 5 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 264 | 265 | #endif |
| 265 | 266 | |
| 266 | 267 | state->eabank = 0; |
| 267 | if (audiocpu != NULL && | |
| 268 | if (audiocpu != NULL && | |
| 268 | 269 | { |
| 269 | 270 | state->eabank = 1; |
| 270 | 271 | memory_install_read8_handler(cpu_get_address_space(audiocpu, ADDRESS_SPACE_PROGRAM), 0x000, 0x7ff, 0, 0, SMH_BANK1); |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | ***************************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "deprecat.h" | |
| 10 | 9 | #include "cpu/m6502/m6502.h" |
| 11 | 10 | #include "machine/6532riot.h" |
| 12 | 11 | #include "sound/samples.h" |
| r3957 | r3958 | |
| 200 | 199 | |
| 201 | 200 | |
| 202 | 201 | #ifdef UNUSED_FUNCTION |
| 203 | void gottlieb_knocker( | |
| 202 | void gottlieb_knocker(running_machine *machine) | |
| 204 | 203 | { |
| 205 | if (!strcmp( | |
| 204 | if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */ | |
| 206 | 205 | { |
| 207 | 206 | } |
| 208 | 207 | else if (sndti_exists(SOUND_SAMPLES, 0)) /* qbert */ |
| r3957 | r3958 | |
|---|---|---|
| 150 | 150 | ****************************************************************************/ |
| 151 | 151 | |
| 152 | 152 | #include "driver.h" |
| 153 | #include "deprecat.h" | |
| 154 | 153 | #include "cpu/adsp2100/adsp2100.h" |
| 155 | 154 | #include "dcs.h" |
| 156 | 155 | #include "sound/dmadac.h" |
| r3957 | r3958 | |
| 319 | 318 | UINT8 last_output_full; |
| 320 | 319 | UINT8 last_input_empty; |
| 321 | 320 | UINT16 progflags; |
| 322 | void (*output_full_cb)(int); | |
| 323 | void (*input_empty_cb)(int); | |
| 321 | void (*output_full_cb)(running_machine *, int); | |
| 322 | void (*input_empty_cb)(running_machine *, int); | |
| 324 | 323 | UINT16 (*fifo_data_r)(const device_config *device); |
| 325 | 324 | UINT16 (*fifo_status_r)(const device_config *device); |
| 326 | 325 | |
| r3957 | r3958 | |
| 373 | 372 | |
| 374 | 373 | |
| 375 | 374 | |
| 376 | ||
| 377 | 375 | /************************************* |
| 378 | 376 | * |
| 379 | 377 | * Prototypes |
| r3957 | r3958 | |
| 586 | 584 | |
| 587 | 585 | /************************************* |
| 588 | 586 | * |
| 587 | * CPU configuration | |
| 588 | * | |
| 589 | *************************************/ | |
| 590 | ||
| 591 | static const adsp21xx_config adsp_config = | |
| 592 | { | |
| 593 | NULL, /* callback for serial receive */ | |
| 594 | sound_tx_callback, /* callback for serial transmit */ | |
| 595 | timer_enable_callback /* callback for timer fired */ | |
| 596 | }; | |
| 597 | ||
| 598 | ||
| 599 | ||
| 600 | /************************************* | |
| 601 | * | |
| 589 | 602 | * Original DCS Machine Drivers |
| 590 | 603 | * |
| 591 | 604 | *************************************/ |
| r3957 | r3958 | |
| 593 | 606 | /* Basic DCS system with ADSP-2105 and 2k of SRAM (T-unit, V-unit, Killer Instinct) */ |
| 594 | 607 | MACHINE_DRIVER_START( dcs_audio_2k ) |
| 595 | 608 | MDRV_CPU_ADD("dcs", ADSP2105, XTAL_10MHz) |
| 609 | MDRV_CPU_CONFIG(adsp_config) | |
| 596 | 610 | MDRV_CPU_PROGRAM_MAP(dcs_2k_program_map,0) |
| 597 | 611 | MDRV_CPU_DATA_MAP(dcs_2k_data_map,0) |
| 598 | 612 | |
| r3957 | r3958 | |
| 631 | 645 | |
| 632 | 646 | MACHINE_DRIVER_START( dcs2_audio_2115 ) |
| 633 | 647 | MDRV_CPU_ADD("dcs2", ADSP2115, XTAL_16MHz) |
| 648 | MDRV_CPU_CONFIG(adsp_config) | |
| 634 | 649 | MDRV_CPU_PROGRAM_MAP(dcs2_2115_program_map,0) |
| 635 | 650 | MDRV_CPU_DATA_MAP(dcs2_2115_data_map,0) |
| 636 | 651 | |
| r3957 | r3958 | |
| 661 | 676 | |
| 662 | 677 | MACHINE_DRIVER_START( dcs2_audio_dsio ) |
| 663 | 678 | MDRV_CPU_ADD("dsio", ADSP2181, XTAL_32MHz) |
| 679 | MDRV_CPU_CONFIG(adsp_config) | |
| 664 | 680 | MDRV_CPU_PROGRAM_MAP(dsio_program_map,0) |
| 665 | 681 | MDRV_CPU_DATA_MAP(dsio_data_map,0) |
| 666 | 682 | MDRV_CPU_IO_MAP(dsio_io_map,0) |
| r3957 | r3958 | |
| 684 | 700 | |
| 685 | 701 | MACHINE_DRIVER_START( dcs2_audio_denver ) |
| 686 | 702 | MDRV_CPU_ADD("denver", ADSP2181, XTAL_33_333MHz) |
| 703 | MDRV_CPU_CONFIG(adsp_config) | |
| 687 | 704 | MDRV_CPU_PROGRAM_MAP(denver_program_map,0) |
| 688 | 705 | MDRV_CPU_DATA_MAP(denver_data_map,0) |
| 689 | 706 | MDRV_CPU_IO_MAP(denver_io_map,0) |
| r3957 | r3958 | |
| 824 | 841 | SET_INPUT_EMPTY(); |
| 825 | 842 | SET_OUTPUT_EMPTY(); |
| 826 | 843 | if (!dcs.last_input_empty && dcs.input_empty_cb) |
| 827 | (*dcs.input_empty_cb)(dcs.last_input_empty = 1); | |
| 844 | (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 1); | |
| 828 | 845 | if (dcs.last_output_full && dcs.output_full_cb) |
| 829 | (*dcs.output_full_cb)(dcs.last_output_full = 0); | |
| 846 | (*dcs.output_full_cb)(machine, dcs.last_output_full = 0); | |
| 830 | 847 | |
| 831 | 848 | /* boot */ |
| 832 | 849 | dcs_boot(); |
| r3957 | r3958 | |
| 905 | 922 | state_save_register_postload(machine, sdrc_postload, NULL); |
| 906 | 923 | } |
| 907 | 924 | |
| 908 | ||
| 909 | 925 | void dcs_init(running_machine *machine) |
| 910 | 926 | { |
| 911 | 927 | memset(&dcs, 0, sizeof(dcs)); |
| r3957 | r3958 | |
| 918 | 934 | dcs.rev = 1; |
| 919 | 935 | dcs.channels = 1; |
| 920 | 936 | |
| 921 | /* initialize the ADSP Tx and timer callbacks */ | |
| 922 | adsp21xx_set_tx_handler(dcs.cpu, sound_tx_callback); | |
| 923 | adsp21xx_set_timer_handler(dcs.cpu, timer_enable_callback); | |
| 924 | ||
| 925 | 937 | /* configure boot and sound ROMs */ |
| 926 | 938 | dcs.bootrom = (UINT16 *)memory_region(machine, "dcs"); |
| 927 | 939 | dcs.bootrom_words = memory_region_length(machine, "dcs") / 2; |
| r3957 | r3958 | |
| 971 | 983 | dcs.data = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_DATA); |
| 972 | 984 | dcs.channels = 2; |
| 973 | 985 | |
| 974 | /* initialize the ADSP Tx and timer callbacks */ | |
| 975 | adsp21xx_set_tx_handler(dcs.cpu, sound_tx_callback); | |
| 976 | adsp21xx_set_timer_handler(dcs.cpu, timer_enable_callback); | |
| 977 | ||
| 978 | 986 | /* always boot from the base of "dcs" */ |
| 979 | 987 | dcs.bootrom = (UINT16 *)memory_region(machine, "dcs"); |
| 980 | 988 | dcs.bootrom_words = memory_region_length(machine, "dcs") / 2; |
| r3957 | r3958 | |
| 1068 | 1076 | * |
| 1069 | 1077 | *************************************/ |
| 1070 | 1078 | |
| 1071 | INLINE void sdrc_update_bank_pointers( | |
| 1079 | INLINE void sdrc_update_bank_pointers(running_machine *machine) | |
| 1072 | 1080 | { |
| 1073 | 1081 | if (SDRC_SM_EN != 0) |
| 1074 | 1082 | { |
| r3957 | r3958 | |
| 1079 | 1087 | { |
| 1080 | 1088 | /* ROM-based; use the memory page to select from ROM */ |
| 1081 | 1089 | if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3) |
| 1082 | memory_set_bankptr( | |
| 1090 | memory_set_bankptr(machine, 25, &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]); | |
| 1083 | 1091 | } |
| 1084 | 1092 | else |
| 1085 | 1093 | { |
| 1086 | 1094 | /* RAM-based; use the ROM page to select from ROM, and the memory page to select from RAM */ |
| 1087 | 1095 | if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3) |
| 1088 | memory_set_bankptr( | |
| 1096 | memory_set_bankptr(machine, 25, &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]); | |
| 1089 | 1097 | if (SDRC_DM_ST != 0) |
| 1090 | memory_set_bankptr( | |
| 1098 | memory_set_bankptr(machine, 26, &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]); | |
| 1091 | 1099 | } |
| 1092 | 1100 | } |
| 1093 | 1101 | } |
| r3957 | r3958 | |
| 1148 | 1156 | } |
| 1149 | 1157 | |
| 1150 | 1158 | /* update the bank pointers */ |
| 1151 | sdrc_update_bank_pointers(); | |
| 1159 | sdrc_update_bank_pointers(machine); | |
| 1152 | 1160 | } |
| 1153 | 1161 | |
| 1154 | 1162 | |
| r3957 | r3958 | |
| 1232 | 1240 | if (diff & 0x1833) |
| 1233 | 1241 | sdrc_remap_memory(space->machine); |
| 1234 | 1242 | if (diff & 0x0380) |
| 1235 | sdrc_update_bank_pointers(); | |
| 1243 | sdrc_update_bank_pointers(space->machine); | |
| 1236 | 1244 | break; |
| 1237 | 1245 | |
| 1238 | 1246 | /* offset 1 controls RAM mapping */ |
| r3957 | r3958 | |
| 1247 | 1255 | case 2: |
| 1248 | 1256 | sdrc.reg[2] = data; |
| 1249 | 1257 | if (diff & 0x1fff) |
| 1250 | sdrc_update_bank_pointers(); | |
| 1258 | sdrc_update_bank_pointers(space->machine); | |
| 1251 | 1259 | break; |
| 1252 | 1260 | |
| 1253 | 1261 | /* offset 3 controls security */ |
| r3957 | r3958 | |
| 1458 | 1466 | DCS COMMUNICATIONS |
| 1459 | 1467 | ****************************************************************************/ |
| 1460 | 1468 | |
| 1461 | void dcs_set_io_callbacks(void (*output_full_cb)(int), void (*input_empty_cb)(int)) | |
| 1469 | void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int)) | |
| 1462 | 1470 | { |
| 1463 | 1471 | dcs.input_empty_cb = input_empty_cb; |
| 1464 | 1472 | dcs.output_full_cb = output_full_cb; |
| r3957 | r3958 | |
| 1476 | 1484 | { |
| 1477 | 1485 | /* only boost for DCS2 boards */ |
| 1478 | 1486 | if (!dcs.auto_ack && !transfer.hle_enabled) |
| 1479 | cpuexec_boost_interleave( | |
| 1487 | cpuexec_boost_interleave(dcs.cpu->machine, ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5)); | |
| 1480 | 1488 | return dcs.latch_control; |
| 1481 | 1489 | } |
| 1482 | 1490 | |
| r3957 | r3958 | |
| 1486 | 1494 | /* going high halts the CPU */ |
| 1487 | 1495 | if (state) |
| 1488 | 1496 | { |
| 1489 | logerror("%s: DCS reset = %d\n", cpuexec_describe_context( | |
| 1497 | logerror("%s: DCS reset = %d\n", cpuexec_describe_context(dcs.cpu->machine), state); | |
| 1490 | 1498 | |
| 1491 | 1499 | /* just run through the init code again */ |
| 1492 | timer_call_after_resynch( | |
| 1500 | timer_call_after_resynch(dcs.cpu->machine, NULL, 0, dcs_reset); | |
| 1493 | 1501 | cpu_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE); |
| 1494 | 1502 | } |
| 1495 | 1503 | |
| r3957 | r3958 | |
| 1541 | 1549 | |
| 1542 | 1550 | /* indicate we are no longer empty */ |
| 1543 | 1551 | if (dcs.last_input_empty && dcs.input_empty_cb) |
| 1544 | (*dcs.input_empty_cb)(dcs.last_input_empty = 0); | |
| 1552 | (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 0); | |
| 1545 | 1553 | SET_INPUT_FULL(); |
| 1546 | 1554 | |
| 1547 | 1555 | /* set the data */ |
| r3957 | r3958 | |
| 1558 | 1566 | void dcs_data_w(int data) |
| 1559 | 1567 | { |
| 1560 | 1568 | /* preprocess the write */ |
| 1561 | if (preprocess_write( | |
| 1569 | if (preprocess_write(dcs.cpu->machine, data)) | |
| 1562 | 1570 | return; |
| 1563 | 1571 | |
| 1564 | 1572 | /* if we are DCS1, set a timer to latch the data */ |
| 1565 | 1573 | if (!dcs.sport_timer) |
| 1566 | timer_call_after_resynch( | |
| 1574 | timer_call_after_resynch(dcs.cpu->machine, NULL, data, dcs_delayed_data_w_callback); | |
| 1567 | 1575 | else |
| 1568 | dcs_delayed_data_w( | |
| 1576 | dcs_delayed_data_w(dcs.cpu->machine, data); | |
| 1569 | 1577 | } |
| 1570 | 1578 | |
| 1571 | 1579 | |
| 1572 | 1580 | static WRITE16_HANDLER( input_latch_ack_w ) |
| 1573 | 1581 | { |
| 1574 | 1582 | if (!dcs.last_input_empty && dcs.input_empty_cb) |
| 1575 | (*dcs.input_empty_cb)(dcs.last_input_empty = 1); | |
| 1583 | (*dcs.input_empty_cb)(space->machine, dcs.last_input_empty = 1); | |
| 1576 | 1584 | SET_INPUT_EMPTY(); |
| 1577 | 1585 | cpu_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE); |
| 1578 | 1586 | } |
| r3957 | r3958 | |
| 1596 | 1604 | static TIMER_CALLBACK( latch_delayed_w ) |
| 1597 | 1605 | { |
| 1598 | 1606 | if (!dcs.last_output_full && dcs.output_full_cb) |
| 1599 | (*dcs.output_full_cb)(dcs.last_output_full = 1); | |
| 1607 | (*dcs.output_full_cb)(machine, dcs.last_output_full = 1); | |
| 1600 | 1608 | SET_OUTPUT_FULL(); |
| 1601 | 1609 | dcs.output_data = param; |
| 1602 | 1610 | } |
| r3957 | r3958 | |
| 1624 | 1632 | |
| 1625 | 1633 | void dcs_ack_w(void) |
| 1626 | 1634 | { |
| 1627 | timer_call_after_resynch( | |
| 1635 | timer_call_after_resynch(dcs.cpu->machine, NULL, 0, delayed_ack_w_callback); | |
| 1628 | 1636 | } |
| 1629 | 1637 | |
| 1630 | 1638 | |
| r3957 | r3958 | |
| 1632 | 1640 | { |
| 1633 | 1641 | /* data is actually only 8 bit (read from d8-d15) */ |
| 1634 | 1642 | if (dcs.last_output_full && dcs.output_full_cb) |
| 1635 | (*dcs.output_full_cb)(dcs.last_output_full = 0); | |
| 1643 | (*dcs.output_full_cb)(dcs.cpu->machine, dcs.last_output_full = 0); | |
| 1636 | 1644 | if (dcs.auto_ack) |
| 1637 | 1645 | delayed_ack_w(); |
| 1638 | 1646 | |
| 1639 | 1647 | if (LOG_DCS_IO) |
| 1640 | logerror("%s:dcs_data_r(%04X)\n", cpuexec_describe_context( | |
| 1648 | logerror("%s:dcs_data_r(%04X)\n", cpuexec_describe_context(dcs.cpu->machine), dcs.output_data); | |
| 1641 | 1649 | return dcs.output_data; |
| 1642 | 1650 | } |
| 1643 | 1651 | |
| r3957 | r3958 | |
| 2064 | 2072 | if (transfer.state != 5 || transfer.fifo_entries == transfer.writes_left || transfer.fifo_entries >= 256) |
| 2065 | 2073 | { |
| 2066 | 2074 | for ( ; transfer.fifo_entries; transfer.fifo_entries--) |
| 2067 | preprocess_write( | |
| 2075 | preprocess_write(dcs.cpu->machine, (*dcs.fifo_data_r)(dcs.cpu)); | |
| 2068 | 2076 | } |
| 2069 | 2077 | } |
| 2070 | 2078 | |
| r3957 | r3958 | |
| 2363 | 2371 | if (result && dcs.input_empty_cb) |
| 2364 | 2372 | { |
| 2365 | 2373 | if (dcs.last_input_empty) |
| 2366 | (*dcs.input_empty_cb)(dcs.last_input_empty = 0); | |
| 2374 | (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 0); | |
| 2367 | 2375 | if (!dcs.last_input_empty) |
| 2368 | (*dcs.input_empty_cb)(dcs.last_input_empty = 1); | |
| 2376 | (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 1); | |
| 2369 | 2377 | } |
| 2370 | 2378 | return result; |
| 2371 | 2379 | } |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | void dcs_set_auto_ack(int state); |
| 18 | 18 | |
| 19 | 19 | void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(const device_config *device), UINT16 (*fifo_status_r)(const device_config *device)); |
| 20 | void dcs_set_io_callbacks(void (*output_full_cb)(int), void (*input_empty_cb)(int)); | |
| 20 | void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int)); | |
| 21 | 21 | |
| 22 | 22 | int dcs_data_r(void); |
| 23 | 23 | void dcs_ack_w(void); |
| r3957 | r3958 | |
|---|---|---|
| 132 | 132 | /************************************/ |
| 133 | 133 | /* Sound handler update */ |
| 134 | 134 | /************************************/ |
| 135 | static | |
| 135 | static STREAM_UPDATE( attckufo_update | |
| 136 | 136 | { |
| 137 | 137 | int i, v; |
| 138 | stream_sample_t *buffer = | |
| 138 | stream_sample_t *buffer = o | |
| 139 | 139 | |
| 140 | for (i = 0; i < le | |
| 140 | for (i = 0; i < samples | |
| 141 | 141 | { |
| 142 | 142 | v = 0; |
| 143 | 143 | if (TONE1_ON /*||(tone1pos!=0) */ ) |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | Sound handler |
| 4 | 4 | ****************************************************************************/ |
| 5 | 5 | #include "driver.h" |
| 6 | #include "deprecat.h" | |
| 7 | 6 | #include "streams.h" |
| 8 | 7 | #include "sound/filter.h" |
| 9 | 8 | #include "machine/rescap.h" |
| r3957 | r3958 | |
| 47 | 46 | /************************************/ |
| 48 | 47 | /* Stream updater */ |
| 49 | 48 | /************************************/ |
| 50 | static | |
| 49 | static STREAM_UPDATE( engine_sound_update | |
| 51 | 50 | { |
| 52 | 51 | static UINT32 current_position; |
| 53 | 52 | UINT32 step, clock, slot; |
| r3957 | r3958 | |
| 59 | 58 | /* if we're not enabled, just fill with 0 */ |
| 60 | 59 | if (!sample_enable) |
| 61 | 60 | { |
| 62 | memset(buffer, 0, le | |
| 61 | memset(buffer, 0, samples | |
| 63 | 62 | return; |
| 64 | 63 | } |
| 65 | 64 | |
| 66 | 65 | /* determine the effective clock rate */ |
| 67 | clock = (cpu_get_clock( | |
| 66 | clock = (cpu_get_clock(device->machine->cpu[0]) / 16) * ((sample_msb + 1) * 64 + sample_lsb + 1) / (64*64); | |
| 68 | 67 | step = (clock << 12) / OUTPUT_RATE; |
| 69 | 68 | |
| 70 | 69 | /* determine the volume */ |
| 71 | 70 | slot = (sample_msb >> 3) & 7; |
| 72 | 71 | volume = volume_table[slot]; |
| 73 | base = &memory_region( | |
| 72 | base = &memory_region(device->machine, "engine")[slot * 0x800]; | |
| 74 | 73 | |
| 75 | 74 | /* fill in the sample */ |
| 76 | while (le | |
| 75 | while (samples | |
| 77 | 76 | { |
| 78 | 77 | filter_engine[0].x0 = (3.4 / 255 * base[(current_position >> 12) & 0x7ff] - 2) * volume; |
| 79 | 78 | filter_engine[1].x0 = filter_engine[0].x0; |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/z80/z80.h" | |
| 8 | 9 | #include "machine/rescap.h" |
| 9 | 10 | #include "streams.h" |
| 10 | 11 | #include "cpu/m6502/m6502.h" |
| r3957 | r3958 | |
| 221 | 222 | * |
| 222 | 223 | *************************************/ |
| 223 | 224 | |
| 224 | static | |
| 225 | static STREAM_UPDATE( exidy_stream_update | |
| 225 | 226 | { |
| 226 | 227 | int noisy = ((sh6840_timer[0].cr & sh6840_timer[1].cr & sh6840_timer[2].cr & 0x02) == 0); |
| 227 | 228 | stream_sample_t *buffer = outputs[0]; |
| 228 | 229 | |
| 229 | 230 | /* loop over samples */ |
| 230 | while (le | |
| 231 | while (samples | |
| 231 | 232 | { |
| 232 | 233 | struct sh6840_timer_channel *t; |
| 233 | 234 | struct sh8253_timer_channel *c; |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "includes/amiga.h" |
| 4 | 3 | #include "cdrom.h" |
| 5 | 4 | #include "coreutil.h" |
| r3957 | r3958 | |
| 160 | 159 | } |
| 161 | 160 | } |
| 162 | 161 | |
| 163 | static void akiko_nvram_write(UINT32 data) | |
| 162 | static void akiko_nvram_write(running_machine *machine, UINT32 data) | |
| 164 | 163 | { |
| 165 | 164 | akiko.i2c_scl_out = BIT(data,31); |
| 166 | 165 | akiko.i2c_sda_out = BIT(data,30); |
| 167 | 166 | akiko.i2c_scl_dir = BIT(data,15); |
| 168 | 167 | akiko.i2c_sda_dir = BIT(data,14); |
| 169 | 168 | |
| 170 | i2cmem_write( 0, I2CMEM_SCL, akiko.i2c_scl_out ); | |
| 171 | i2cmem_write( 0, I2CMEM_SDA, akiko.i2c_sda_out ); | |
| 169 | i2cmem_write( machine, 0, I2CMEM_SCL, akiko.i2c_scl_out ); | |
| 170 | i2cmem_write( machine, 0, I2CMEM_SDA, akiko.i2c_sda_out ); | |
| 172 | 171 | } |
| 173 | 172 | |
| 174 | static UINT32 akiko_nvram_read( | |
| 173 | static UINT32 akiko_nvram_read(running_machine *machine) | |
| 175 | 174 | { |
| 176 | 175 | UINT32 v = 0; |
| 177 | 176 | |
| r3957 | r3958 | |
| 190 | 189 | } |
| 191 | 190 | else |
| 192 | 191 | { |
| 193 | v |= i2cmem_read( 0, I2CMEM_SDA ) << 30; | |
| 192 | v |= i2cmem_read( machine, 0, I2CMEM_SDA ) << 30; | |
| 194 | 193 | } |
| 195 | 194 | |
| 196 | 195 | v |= akiko.i2c_scl_dir << 15; |
| r3957 | r3958 | |
| 350 | 349 | return 0x15; /* no audio status */ |
| 351 | 350 | } |
| 352 | 351 | |
| 353 | static void akiko_set_cd_status( UINT32 status ) | |
| 352 | static void akiko_set_cd_status( running_machine *machine, UINT32 status ) | |
| 354 | 353 | { |
| 355 | 354 | akiko.cdrom_status[0] |= status; |
| 356 | 355 | |
| 357 | 356 | if ( akiko.cdrom_status[0] & akiko.cdrom_status[1] ) |
| 358 | 357 | { |
| 359 | 358 | if (LOG_AKIKO_CD) logerror( "Akiko CD IRQ\n" ); |
| 360 | amiga_custom_w(cpu_get_address_space( | |
| 359 | amiga_custom_w(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff); | |
| 361 | 360 | } |
| 362 | 361 | } |
| 363 | 362 | |
| r3957 | r3958 | |
| 373 | 372 | |
| 374 | 373 | if ( s == 0x11 ) |
| 375 | 374 | { |
| 376 | akiko_set_cd_status( 0x80000000 ); /* subcode ready */ | |
| 375 | akiko_set_cd_status( machine, 0x80000000 ); /* subcode ready */ | |
| 377 | 376 | } |
| 378 | 377 | |
| 379 | 378 | timer_adjust_oneshot( akiko.frame_timer, ATTOTIME_IN_HZ( 75 ), 0 ); |
| r3957 | r3958 | |
| 477 | 476 | } |
| 478 | 477 | |
| 479 | 478 | if ( akiko.cdrom_readreqmask == 0 ) |
| 480 | akiko_set_cd_status(0x04000000); | |
| 479 | akiko_set_cd_status(machine, 0x04000000); | |
| 481 | 480 | else |
| 482 | 481 | timer_adjust_oneshot( akiko.dma_timer, ATTOTIME_IN_USEC( CD_SECTOR_TIME / akiko.cdrom_speed ), 0 ); |
| 483 | 482 | } |
| r3957 | r3958 | |
| 522 | 521 | |
| 523 | 522 | akiko.cdrom_cmd_resp = (akiko.cdrom_cmd_resp+len) & 0xff; |
| 524 | 523 | |
| 525 | akiko_set_cd_status( 0x10000000 ); /* new data available */ | |
| 524 | akiko_set_cd_status( space->machine, 0x10000000 ); /* new data available */ | |
| 526 | 525 | } |
| 527 | 526 | |
| 528 | 527 | static TIMER_CALLBACK( akiko_cd_delayed_cmd ) |
| r3957 | r3958 | |
| 796 | 795 | return retval; |
| 797 | 796 | |
| 798 | 797 | case 0x30/4: /* NVRAM */ |
| 799 | return akiko_nvram_read(); | |
| 798 | return akiko_nvram_read(space->machine); | |
| 800 | 799 | |
| 801 | 800 | case 0x38/4: /* C2P */ |
| 802 | 801 | return akiko_c2p_read(); |
| r3957 | r3958 | |
| 871 | 870 | break; |
| 872 | 871 | |
| 873 | 872 | case 0x30/4: |
| 874 | akiko_nvram_write(data); | |
| 873 | akiko_nvram_write(space->machine, data); | |
| 875 | 874 | break; |
| 876 | 875 | |
| 877 | 876 | case 0x38/4: |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "video/ppu2c0x.h" |
| 4 | 3 | #include "machine/rp5h01.h" |
| 5 | 4 | #include "includes/playch10.h" |
| r3957 | r3958 | |
| 668 | 667 | static int gboard_last_bank; |
| 669 | 668 | static int gboard_command; |
| 670 | 669 | |
| 671 | static void gboard_scanline_cb( int num, int scanline, int vblank, int blanked ) | |
| 670 | static void gboard_scanline_cb( running_machine *machine, int num, int scanline, int vblank, int blanked ) | |
| 672 | 671 | { |
| 673 | 672 | if ( !vblank && !blanked ) |
| 674 | 673 | { |
| 675 | 674 | if ( --gboard_scanline_counter == -1 ) |
| 676 | 675 | { |
| 677 | 676 | gboard_scanline_counter = gboard_scanline_latch; |
| 678 | generic_pulse_irq_line( | |
| 677 | generic_pulse_irq_line(machine->cpu[1], 0); | |
| 679 | 678 | } |
| 680 | 679 | } |
| 681 | 680 | } |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); |
| 28 | 28 | |
| 29 | 29 | /* bit 5 resets mcu */ |
| 30 | if (space->machine->c | |
| 30 | if (space->machine->c | |
| 31 | 31 | cpu_set_input_line(space->machine->cpu[3], INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); |
| 32 | 32 | |
| 33 | 33 | /* bit 6 enables display */ |
| 34 | 34 | bublbobl_video_enable = data & 0x40; |
| 35 | 35 | |
| 36 | 36 | /* bit 7 flips screen */ |
| 37 | flip_screen_set(data & 0x80); | |
| 37 | flip_screen_set(space->machine, data & 0x80); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | WRITE8_HANDLER( tokio_bankswitch_w ) |
| r3957 | r3958 | |
| 48 | 48 | WRITE8_HANDLER( tokio_videoctrl_w ) |
| 49 | 49 | { |
| 50 | 50 | /* bit 7 flips screen */ |
| 51 | flip_screen_set(data & 0x80); | |
| 51 | flip_screen_set(space->machine, data & 0x80); | |
| 52 | 52 | |
| 53 | 53 | /* other bits unknown */ |
| 54 | 54 | } |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" | |
| 13 | 12 | #include "cpu/m68000/m68000.h" |
| 14 | 13 | #include "machine/fd1094.h" |
| 14 | #include "machine/fddebug.h" | |
| 15 | 15 | #include "includes/system16.h" |
| 16 | 16 | |
| 17 | 17 | |
| r3957 | r3958 | |
| 38 | 38 | return fd1094_userregion; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | static void set_decrypted_region( | |
| 41 | static void set_decrypted_region(running_machine *machine) | |
| 42 | 42 | { |
| 43 | 43 | if (fd1094_set_decrypted != NULL) |
| 44 | (*fd1094_set_decrypted)( | |
| 44 | (*fd1094_set_decrypted)(machine, (UINT8 *)fd1094_userregion); | |
| 45 | 45 | else |
| 46 | memory_set_decrypted_region(cpu_get_address_space( | |
| 46 | memory_set_decrypted_region(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0, fd1094_cpuregionsize - 1, fd1094_userregion); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /* this function checks the cache to see if the current state is cached, |
| 50 | 50 | if it is then it copies the cached data to the user region where code is |
| 51 | 51 | executed from, if its not cached then it gets decrypted to the current |
| 52 | 52 | cache position using the functions in fd1094.c */ |
| 53 | static void fd1094_setstate_and_decrypt(int state) | |
| 53 | static void fd1094_setstate_and_decrypt(running_machine *machine, int state) | |
| 54 | 54 | { |
| 55 | 55 | int i; |
| 56 | 56 | UINT32 addr; |
| r3957 | r3958 | |
| 65 | 65 | |
| 66 | 66 | fd1094_state = state; |
| 67 | 67 | |
| 68 | cpu_set_reg( | |
| 68 | cpu_set_reg(machine->cpu[0], M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache | |
| 69 | 69 | |
| 70 | 70 | /* set the FD1094 state ready to decrypt.. */ |
| 71 | 71 | state = fd1094_set_state(fd1094_key,state) & 0xff; |
| r3957 | r3958 | |
| 77 | 77 | { |
| 78 | 78 | /* copy cached state */ |
| 79 | 79 | fd1094_userregion=fd1094_cacheregion[i]; |
| 80 | set_decrypted_region(); | |
| 81 | m68k_set_encrypted_opcode_range(Machine->cpu[0],0,fd1094_cpuregionsize); | |
| 80 | set_decrypted_region(machine); | |
| 81 | m68k_set_encrypted_opcode_range(machine->cpu[0],0,fd1094_cpuregionsize); | |
| 82 | 82 | |
| 83 | 83 | return; |
| 84 | 84 | } |
| r3957 | r3958 | |
| 96 | 96 | |
| 97 | 97 | /* copy newly decrypted data to user region */ |
| 98 | 98 | fd1094_userregion=fd1094_cacheregion[fd1094_current_cacheposition]; |
| 99 | set_decrypted_region(); | |
| 100 | m68k_set_encrypted_opcode_range(Machine->cpu[0],0,fd1094_cpuregionsize); | |
| 99 | set_decrypted_region(machine); | |
| 100 | m68k_set_encrypted_opcode_range(machine->cpu[0],0,fd1094_cpuregionsize); | |
| 101 | 101 | |
| 102 | 102 | fd1094_current_cacheposition++; |
| 103 | 103 | |
| r3957 | r3958 | |
| 113 | 113 | { |
| 114 | 114 | if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ? |
| 115 | 115 | { |
| 116 | fd1094_setstate_and_decrypt((val & 0xffff0000) >> 16); | |
| 116 | fd1094_setstate_and_decrypt(device->machine, (val & 0xffff0000) >> 16); | |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /* Callback when the FD1094 enters interrupt code */ |
| 121 | 121 | static IRQ_CALLBACK(fd1094_int_callback) |
| 122 | 122 | { |
| 123 | fd1094_setstate_and_decrypt(FD1094_STATE_IRQ); | |
| 123 | fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_IRQ); | |
| 124 | 124 | return (0x60+irqline*4)/4; // vector address |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static void fd1094_rte_callback (const device_config *device) |
| 128 | 128 | { |
| 129 | fd1094_setstate_and_decrypt(FD1094_STATE_RTE); | |
| 129 | fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| r3957 | r3958 | |
| 147 | 147 | if (!fd1094_key) |
| 148 | 148 | return; |
| 149 | 149 | |
| 150 | fd1094_setstate_and_decrypt(FD1094_STATE_RESET); | |
| 150 | fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RESET); | |
| 151 | 151 | fd1094_kludge_reset_values(); |
| 152 | 152 | |
| 153 | cpu_set_info_fct(device, CPUINFO_PTR_M68K_CMPILD_CALLBACK, (genf *)fd1094_cmp_callback); | |
| 154 | cpu_set_info_fct(device, CPUINFO_PTR_M68K_RTE_CALLBACK, (genf *)fd1094_rte_callback); | |
| 153 | device_set_info_fct(device, CPUINFO_FCT_M68K_CMPILD_CALLBACK, (genf *)fd1094_cmp_callback); | |
| 154 | device_set_info_fct(device, CPUINFO_FCT_M68K_RTE_CALLBACK, (genf *)fd1094_rte_callback); | |
| 155 | 155 | cpu_set_irq_callback(device, fd1094_int_callback); |
| 156 | 156 | |
| 157 | c | |
| 157 | device | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | static STATE_POSTLOAD( fd1094_postload ) |
| r3957 | r3958 | |
| 166 | 166 | |
| 167 | 167 | fd1094_machine_init(machine->cpu[0]); |
| 168 | 168 | |
| 169 | fd1094_setstate_and_decrypt(selected_state); | |
| 170 | fd1094_setstate_and_decrypt(state); | |
| 169 | fd1094_setstate_and_decrypt(machine, selected_state); | |
| 170 | fd1094_setstate_and_decrypt(machine, state); | |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| 175 | static void key_changed( | |
| 175 | static void key_changed(running_machine *machine) | |
| 176 | 176 | { |
| 177 | 177 | int addr; |
| 178 | 178 | |
| r3957 | r3958 | |
| 186 | 186 | |
| 187 | 187 | /* set cache entry 0 to be the active one, and reset the cache position to 1 */ |
| 188 | 188 | fd1094_userregion = fd1094_cacheregion[0]; |
| 189 | set_decrypted_region(); | |
| 189 | set_decrypted_region(machine); | |
| 190 | 190 | fd1094_current_cacheposition = 1; |
| 191 | 191 | |
| 192 | 192 | /* flush the prefetch queue */ |
| 193 | cpu_set_reg( | |
| 193 | cpu_set_reg(machine->cpu[0], M68K_PREF_ADDR, 0x0010); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| r3957 | r3958 | |
| 219 | 219 | /* key debugging */ |
| 220 | 220 | if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0 && memory_region(machine, "user2") != NULL) |
| 221 | 221 | { |
| 222 | void fd1094_init_debugging(running_machine *machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(void)); | |
| 223 | 222 | fd1094_init_debugging(machine, "main", "user1", "user2", key_changed); |
| 224 | 223 | } |
| 225 | 224 |
| r3957 | r3958 | |
|---|---|---|
| 713 | 713 | /* bit 2 resets the mcu */ |
| 714 | 714 | if (data & 0x04) |
| 715 | 715 | { |
| 716 | if (space->machine->c | |
| 716 | if (space->machine->c | |
| 717 | 717 | cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, PULSE_LINE); |
| 718 | 718 | } |
| 719 | 719 | /* Coin count and lockout is handled by the i8742 */ |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" | |
| 13 | 12 | #include "cpu/m6502/m6502.h" |
| 14 | 13 | #include "includes/atari.h" |
| 15 | 14 | #include "sound/pokey.h" |
| r3957 | r3958 | |
| 708 | 707 | |
| 709 | 708 | |
| 710 | 709 | |
| 711 | static UINT8 console_read( | |
| 710 | static UINT8 console_read(const address_space *space) | |
| 712 | 711 | { |
| 713 | return input_port_read( | |
| 712 | return input_port_read(space->machine, "console"); | |
| 714 | 713 | } |
| 715 | 714 | |
| 716 | 715 | |
| 717 | 716 | |
| 718 | static void console_write(UINT8 data) | |
| 717 | static void console_write(const address_space *space, UINT8 data) | |
| 719 | 718 | { |
| 720 | 719 | if (data & 0x08) |
| 721 | 720 | dac_data_w(0, -120); |
| r3957 | r3958 | |
|---|---|---|
| 292 | 292 | switch (sound) |
| 293 | 293 | { |
| 294 | 294 | case SOUND_CVSD_SMALL: |
| 295 | williams_cvsd_init(0); | |
| 295 | williams_cvsd_init(machine, 0); | |
| 296 | 296 | memory_install_write8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, cvsd_protection_w); |
| 297 | 297 | cvsd_protection_base = memory_region(machine, "cvsd") + 0x10000 + (prot_start - 0x8000); |
| 298 | 298 | break; |
| 299 | 299 | |
| 300 | 300 | case SOUND_CVSD: |
| 301 | williams_cvsd_init(0); | |
| 301 | williams_cvsd_init(machine, 0); | |
| 302 | 302 | memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); |
| 303 | 303 | memory_set_bankptr(machine, 9, auto_malloc(0x80)); |
| 304 | 304 | break; |
| 305 | 305 | |
| 306 | 306 | case SOUND_ADPCM: |
| 307 | williams_adpcm_init(); | |
| 307 | williams_adpcm_init(machine); | |
| 308 | 308 | memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); |
| 309 | 309 | memory_set_bankptr(machine, 9, auto_malloc(0x80)); |
| 310 | 310 | break; |
| 311 | 311 | |
| 312 | 312 | case SOUND_NARC: |
| 313 | williams_narc_init(); | |
| 313 | williams_narc_init(machine); | |
| 314 | 314 | memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); |
| 315 | 315 | memory_set_bankptr(machine, 9, auto_malloc(0x80)); |
| 316 | 316 | break; |
| r3957 | r3958 | |
| 573 | 573 | case SOUND_CVSD_SMALL: |
| 574 | 574 | case SOUND_CVSD: |
| 575 | 575 | williams_cvsd_reset_w((~data & 0x100) >> 8); |
| 576 | williams_cvsd_data_w((data & 0xff) | ((data & 0x200) >> 1)); | |
| 576 | williams_cvsd_data_w(space->machine, (data & 0xff) | ((data & 0x200) >> 1)); | |
| 577 | 577 | break; |
| 578 | 578 | |
| 579 | 579 | case SOUND_ADPCM: |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | /* Konami PowerPC-based 3D games common functions */ |
| 2 | 2 | |
| 3 | 3 | #include "driver.h" |
| 4 | #include "deprecat.h" | |
| 5 | 4 | #include "cpu/sharc/sharc.h" |
| 6 | 5 | #include "video/voodoo.h" |
| 7 | 6 | #include "konppc.h" |
| r3957 | r3958 | |
| 40 | 39 | |
| 41 | 40 | /*****************************************************************************/ |
| 42 | 41 | |
| 43 | void init_konami_cgboard(int num_boards, int type) | |
| 42 | void init_konami_cgboard(running_machine *machine, int num_boards, int type) | |
| 44 | 43 | { |
| 45 | running_machine *machine = Machine; | |
| 46 | 44 | int i; |
| 47 | 45 | num_cgboards = num_boards; |
| 48 | 46 | |
| r3957 | r3958 | |
| 119 | 117 | } |
| 120 | 118 | } |
| 121 | 119 | |
| 122 | void set_cgboard_texture_bank(int board, int bank, UINT8 *rom) | |
| 120 | void set_cgboard_texture_bank(running_machine *machine, int board, int bank, UINT8 *rom) | |
| 123 | 121 | { |
| 124 | 122 | texture_bank[board] = bank; |
| 125 | 123 | |
| 126 | memory_configure_bank( | |
| 124 | memory_configure_bank(machine, bank, 0, 2, rom, 0x800000); | |
| 127 | 125 | } |
| 128 | 126 | |
| 129 | 127 | /*****************************************************************************/ |
| r3957 | r3958 | |
| 349 | 347 | |
| 350 | 348 | /*****************************************************************************/ |
| 351 | 349 | |
| 352 | static UINT32 nwk_fifo_r(int board) | |
| 350 | static UINT32 nwk_fifo_r(const address_space *space, int board) | |
| 353 | 351 | { |
| 354 | 352 | int cpu = (board == 0) ? 2 : 3; |
| 353 | const device_config *device = space->machine->cpu[cpu]; | |
| 355 | 354 | UINT32 data; |
| 356 | 355 | |
| 357 | 356 | if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r) |
| 358 | 357 | { |
| 359 | sharc_set_flag_input( | |
| 358 | sharc_set_flag_input(d | |
| 360 | 359 | } |
| 361 | 360 | else |
| 362 | 361 | { |
| 363 | sharc_set_flag_input( | |
| 362 | sharc_set_flag_input(d | |
| 364 | 363 | } |
| 365 | 364 | |
| 366 | 365 | if (nwk_fifo_read_ptr[board] < nwk_fifo_full) |
| 367 | 366 | { |
| 368 | sharc_set_flag_input( | |
| 367 | sharc_set_flag_input(d | |
| 369 | 368 | } |
| 370 | 369 | else |
| 371 | 370 | { |
| 372 | sharc_set_flag_input( | |
| 371 | sharc_set_flag_input(d | |
| 373 | 372 | } |
| 374 | 373 | |
| 375 | 374 | data = nwk_fifo[board][nwk_fifo_read_ptr[board]]; |
| r3957 | r3958 | |
| 379 | 378 | return data; |
| 380 | 379 | } |
| 381 | 380 | |
| 382 | static void nwk_fifo_w(int board, UINT32 data) | |
| 381 | static void nwk_fifo_w(running_machine *machine, int board, UINT32 data) | |
| 383 | 382 | { |
| 384 | 383 | int cpu = (board == 0) ? 2 : 3; |
| 384 | const device_config *device = machine->cpu[cpu]; | |
| 385 | 385 | |
| 386 | 386 | if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w) |
| 387 | 387 | { |
| 388 | sharc_set_flag_input( | |
| 388 | sharc_set_flag_input(d | |
| 389 | 389 | } |
| 390 | 390 | else |
| 391 | 391 | { |
| 392 | sharc_set_flag_input( | |
| 392 | sharc_set_flag_input(d | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | sharc_set_flag_input( | |
| 395 | sharc_set_flag_input(d | |
| 396 | 396 | |
| 397 | 397 | nwk_fifo[board][nwk_fifo_write_ptr[board]] = data; |
| 398 | 398 | nwk_fifo_write_ptr[board]++; |
| r3957 | r3958 | |
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | static UINT32 K033906_r(int chip, int reg) | |
| 423 | static UINT32 K033906_r(const address_space *space, int chip, int reg) | |
| 424 | 424 | { |
| 425 | 425 | switch(reg) |
| 426 | 426 | { |
| r3957 | r3958 | |
| 430 | 430 | case 0x0f: return K033906_reg[chip][0x0f]; // interrupt_line, interrupt_pin, min_gnt, max_lat |
| 431 | 431 | |
| 432 | 432 | default: |
| 433 | fatalerror("%s:K033906_r: %d, %08X", cpuexec_describe_context( | |
| 433 | fatalerror("%s:K033906_r: %d, %08X", cpuexec_describe_context(space->machine), chip, reg); | |
| 434 | 434 | } |
| 435 | 435 | return 0; |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | static void K033906_w( | |
| 438 | static void K033906_w(const address_spac | |
| 439 | 439 | { |
| 440 | 440 | switch(reg) |
| 441 | 441 | { |
| r3957 | r3958 | |
| 466 | 466 | |
| 467 | 467 | case 0x10: // initEnable |
| 468 | 468 | { |
| 469 | const device_config *device = device_list_find_by_index(machine->config->devicelist, VOODOO_GRAPHICS, chip); | |
| 469 | const device_config *device = device_list_find_by_index(space->machine->config->devicelist, VOODOO_GRAPHICS, chip); | |
| 470 | 470 | voodoo_set_init_enable(device, data); |
| 471 | 471 | break; |
| 472 | 472 | } |
| r3957 | r3958 | |
| 479 | 479 | break; |
| 480 | 480 | |
| 481 | 481 | default: |
| 482 | fatalerror("%s:K033906_w: %d, %08X, %08X", cpuexec_describe_context(machine), chip, data, reg); | |
| 482 | fatalerror("%s:K033906_w: %d, %08X, %08X", cpuexec_describe_context(space->machine), chip, data, reg); | |
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | |
| r3957 | r3958 | |
| 487 | 487 | { |
| 488 | 488 | if (nwk_device_sel[0] & 0x01) |
| 489 | 489 | { |
| 490 | return nwk_fifo_r(0); | |
| 490 | return nwk_fifo_r(space, 0); | |
| 491 | 491 | } |
| 492 | 492 | else |
| 493 | 493 | { |
| 494 | 494 | if (pci_bridge_enable[0]) |
| 495 | 495 | { |
| 496 | return K033906_r(0, offset); | |
| 496 | return K033906_r(space, 0, offset); | |
| 497 | 497 | } |
| 498 | 498 | else |
| 499 | 499 | { |
| r3957 | r3958 | |
| 506 | 506 | { |
| 507 | 507 | if (pci_bridge_enable[0]) |
| 508 | 508 | { |
| 509 | K033906_w(space | |
| 509 | K033906_w(space | |
| 510 | 510 | } |
| 511 | 511 | else |
| 512 | 512 | { |
| r3957 | r3958 | |
| 518 | 518 | { |
| 519 | 519 | if (nwk_device_sel[1] & 0x01) |
| 520 | 520 | { |
| 521 | return nwk_fifo_r(1); | |
| 521 | return nwk_fifo_r(space, 1); | |
| 522 | 522 | } |
| 523 | 523 | else |
| 524 | 524 | { |
| 525 | 525 | if (pci_bridge_enable[1]) |
| 526 | 526 | { |
| 527 | return K033906_r(1, offset); | |
| 527 | return K033906_r(space, 1, offset); | |
| 528 | 528 | } |
| 529 | 529 | else |
| 530 | 530 | { |
| r3957 | r3958 | |
| 537 | 537 | { |
| 538 | 538 | if (pci_bridge_enable[1]) |
| 539 | 539 | { |
| 540 | K033906_w(space | |
| 540 | K033906_w(space | |
| 541 | 541 | } |
| 542 | 542 | else |
| 543 | 543 | { |
| r3957 | r3958 | |
| 551 | 551 | { |
| 552 | 552 | if (nwk_device_sel[0] & 0x01) |
| 553 | 553 | { |
| 554 | nwk_fifo_w(0, data); | |
| 554 | nwk_fifo_w(device->machine, 0, data); | |
| 555 | 555 | } |
| 556 | 556 | else if (nwk_device_sel[0] & 0x02) |
| 557 | 557 | { |
| r3957 | r3958 | |
| 568 | 568 | { |
| 569 | 569 | if (nwk_device_sel[1] & 0x01) |
| 570 | 570 | { |
| 571 | nwk_fifo_w(1, data); | |
| 571 | nwk_fifo_w(device->machine, 1, data); | |
| 572 | 572 | } |
| 573 | 573 | else if (nwk_device_sel[1] & 0x02) |
| 574 | 574 | { |
| r3957 | r3958 | |
| 609 | 609 | { |
| 610 | 610 | if (nwk_device_sel[0] & 0x01) |
| 611 | 611 | { |
| 612 | nwk_fifo_w(0, data); | |
| 612 | nwk_fifo_w(device->machine, 0, data); | |
| 613 | 613 | } |
| 614 | 614 | else if (nwk_device_sel[0] & 0x02) |
| 615 | 615 | { |
| r3957 | r3958 | |
| 626 | 626 | { |
| 627 | 627 | if (nwk_device_sel[1] & 0x01) |
| 628 | 628 | { |
| 629 | nwk_fifo_w(1, data); | |
| 629 | nwk_fifo_w(device->machine, 1, data); | |
| 630 | 630 | } |
| 631 | 631 | else if (nwk_device_sel[1] & 0x02) |
| 632 | 632 | { |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/i86/i86.h" | |
| 10 | 11 | #include "machine/eeprom.h" |
| 11 | 12 | #include "cpu/z80/z80.h" |
| 12 | 13 | #include "leland.h" |
| r3957 | r3958 | |
| 409 | 410 | memory_set_bankptr(machine, 3, &slave_base[0x10000]); |
| 410 | 411 | |
| 411 | 412 | /* if we have an I80186 CPU, reset it */ |
| 412 | if (machine->c | |
| 413 | if (cpu_get_type(machine->c | |
| 413 | 414 | leland_80186_sound_init(); |
| 414 | 415 | } |
| 415 | 416 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | #define CGBOARD_TYPE_HORNET 3 |
| 8 | 8 | #define CGBOARD_TYPE_HANGPLT 4 |
| 9 | 9 | |
| 10 | void init_konami_cgboard(int board_id, int type); | |
| 10 | void init_konami_cgboard(running_machine *machine, int board_id, int type); | |
| 11 | 11 | void set_cgboard_id(int board_id); |
| 12 | 12 | int get_cgboard_id(void); |
| 13 | void set_cgboard_texture_bank(int board, int bank, UINT8 *rom); | |
| 13 | void set_cgboard_texture_bank(running_machine *machine, int board, int bank, UINT8 *rom); | |
| 14 | 14 | |
| 15 | 15 | READ32_HANDLER( cgboard_dsp_comm_r_ppc ); |
| 16 | 16 | WRITE32_HANDLER( cgboard_dsp_comm_w_ppc ); |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "debugger.h" |
| 10 | 9 | #include "midwayic.h" |
| 11 | 10 | #include "machine/idectrl.h" |
| r3957 | r3958 | |
| 206 | 205 | } |
| 207 | 206 | |
| 208 | 207 | |
| 209 | UINT8 midway_serial_pic_r( | |
| 208 | UINT8 midway_serial_pic_r(const address_space *space) | |
| 210 | 209 | { |
| 211 | logerror("%s:security R = %04X\n", cpuexec_describe_context( | |
| 210 | logerror("%s:security R = %04X\n", cpuexec_describe_context(space->machine), serial.buffer); | |
| 212 | 211 | serial.status = 1; |
| 213 | 212 | return serial.buffer; |
| 214 | 213 | } |
| 215 | 214 | |
| 216 | 215 | |
| 217 | void midway_serial_pic_w(UINT8 data) | |
| 216 | void midway_serial_pic_w(const address_space *space, UINT8 data) | |
| 218 | 217 | { |
| 219 | logerror("%s:security W = %04X\n", cpuexec_describe_context( | |
| 218 | logerror("%s:security W = %04X\n", cpuexec_describe_context(space->machine), data); | |
| 220 | 219 | |
| 221 | 220 | /* status seems to reflect the clock bit */ |
| 222 | 221 | serial.status = (data >> 4) & 1; |
| r3957 | r3958 | |
| 294 | 293 | } |
| 295 | 294 | |
| 296 | 295 | |
| 297 | UINT8 midway_serial_pic2_status_r( | |
| 296 | UINT8 midway_serial_pic2_status_r(const address_space *space) | |
| 298 | 297 | { |
| 299 | 298 | UINT8 result = 0; |
| 300 | 299 | |
| 301 | 300 | /* if we're still holding the data ready bit high, do it */ |
| 302 | 301 | if (pic.latch & 0xf00) |
| 303 | 302 | { |
| 304 | if (attotime_compare(timer_get_time( | |
| 303 | if (attotime_compare(timer_get_time(space->machine), pic.latch_expire_time) > 0) | |
| 305 | 304 | pic.latch &= 0xff; |
| 306 | 305 | else |
| 307 | 306 | pic.latch -= 0x100; |
| 308 | 307 | result = 1; |
| 309 | 308 | } |
| 310 | 309 | |
| 311 | logerror("%s:PIC status %d\n", cpuexec_describe_context( | |
| 310 | logerror("%s:PIC status %d\n", cpuexec_describe_context(space->machine), result); | |
| 312 | 311 | return result; |
| 313 | 312 | } |
| 314 | 313 | |
| 315 | 314 | |
| 316 | UINT8 midway_serial_pic2_r( | |
| 315 | UINT8 midway_serial_pic2_r(const address_space *space) | |
| 317 | 316 | { |
| 318 | 317 | UINT8 result = 0; |
| 319 | 318 | |
| 320 | 319 | /* PIC data register */ |
| 321 | logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", cpuexec_describe_context( | |
| 320 | logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", cpuexec_describe_context(space->machine), pic.index, pic.total, pic.latch); | |
| 322 | 321 | |
| 323 | 322 | /* return the current result */ |
| 324 | 323 | if (pic.latch & 0xf00) |
| r3957 | r3958 | |
| 333 | 332 | } |
| 334 | 333 | |
| 335 | 334 | |
| 336 | void midway_serial_pic2_w( | |
| 335 | void midway_serial_pic2_w(const address_spac | |
| 337 | 336 | { |
| 337 | running_machine *machine = space->machine; | |
| 338 | 338 | static FILE *nvramlog; |
| 339 | 339 | if (LOG_NVRAM && !nvramlog) |
| 340 | 340 | nvramlog = fopen("nvram.log", "w"); |
| r3957 | r3958 | |
| 560 | 560 | |
| 561 | 561 | static UINT16 ioasic_fifo_r(const device_config *device); |
| 562 | 562 | static UINT16 ioasic_fifo_status_r(const device_config *device); |
| 563 | static void ioasic_input_empty(int state); | |
| 564 | static void ioasic_output_full(int state); | |
| 563 | static void ioasic_input_empty(running_machine *machine, int state); | |
| 564 | static void ioasic_output_full(running_machine *machine, int state); | |
| 565 | 565 | static void update_ioasic_irq(running_machine *machine); |
| 566 | 566 | static void cage_irq_handler(running_machine *machine, int state); |
| 567 | 567 | |
| r3957 | r3958 | |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | |
| 698 | static void ioasic_input_empty(int state) | |
| 698 | static void ioasic_input_empty(running_machine *machine, int state) | |
| 699 | 699 | { |
| 700 | 700 | // logerror("ioasic_input_empty(%d)\n", state); |
| 701 | 701 | if (state) |
| 702 | 702 | ioasic.sound_irq_state |= 0x0080; |
| 703 | 703 | else |
| 704 | 704 | ioasic.sound_irq_state &= ~0x0080; |
| 705 | update_ioasic_irq( | |
| 705 | update_ioasic_irq(machine); | |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | |
| 709 | static void ioasic_output_full(int state) | |
| 709 | static void ioasic_output_full(running_machine *machine, int state) | |
| 710 | 710 | { |
| 711 | 711 | // logerror("ioasic_output_full(%d)\n", state); |
| 712 | 712 | if (state) |
| 713 | 713 | ioasic.sound_irq_state |= 0x0040; |
| 714 | 714 | else |
| 715 | 715 | ioasic.sound_irq_state &= ~0x0040; |
| 716 | update_ioasic_irq( | |
| 716 | update_ioasic_irq(machine); | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | |
| r3957 | r3958 | |
| 925 | 925 | break; |
| 926 | 926 | |
| 927 | 927 | case IOASIC_PICIN: |
| 928 | result = midway_serial_pic2_r() | (midway_serial_pic2_status_r() << 8); | |
| 928 | result = midway_serial_pic2_r(space) | (midway_serial_pic2_status_r(space) << 8); | |
| 929 | 929 | break; |
| 930 | 930 | |
| 931 | 931 | default: |
| r3957 | r3958 | |
| 1025 | 1025 | |
| 1026 | 1026 | case IOASIC_PICOUT: |
| 1027 | 1027 | if (ioasic.shuffle_type == MIDWAY_IOASIC_VAPORTRX) |
| 1028 | midway_serial_pic2_w(space | |
| 1028 | midway_serial_pic2_w(space | |
| 1029 | 1029 | else if (ioasic.shuffle_type == MIDWAY_IOASIC_SFRUSHRK) |
| 1030 | midway_serial_pic2_w(space | |
| 1030 | midway_serial_pic2_w(space | |
| 1031 | 1031 | else |
| 1032 | midway_serial_pic2_w(space | |
| 1032 | midway_serial_pic2_w(space | |
| 1033 | 1033 | break; |
| 1034 | 1034 | |
| 1035 | 1035 | case IOASIC_INTCTL: |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | void midway_serial_pic_init(running_machine *machine, int upper); |
| 10 | 10 | void midway_serial_pic_reset_w(int state); |
| 11 | 11 | UINT8 midway_serial_pic_status_r(void); |
| 12 | UINT8 midway_serial_pic_r(void); | |
| 13 | void midway_serial_pic_w(UINT8 data); | |
| 12 | UINT8 midway_serial_pic_r(const address_space *space); | |
| 13 | void midway_serial_pic_w(const address_space *space, UINT8 data); | |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | /* 2nd generation Midway serial/NVRAM/RTC PIC */ |
| 17 | 17 | void midway_serial_pic2_init(running_machine *machine, int upper, int yearoffs); |
| 18 | 18 | void midway_serial_pic2_set_default_nvram(const UINT8 *nvram); |
| 19 | UINT8 midway_serial_pic2_status_r(void); | |
| 20 | UINT8 midway_serial_pic2_r(void); | |
| 21 | void midway_serial_pic2_w(running_machine *machine, UINT8 data); | |
| 19 | UINT8 midway_serial_pic2_status_r(const address_space *space); | |
| 20 | UINT8 midway_serial_pic2_r(const address_space *space); | |
| 21 | void midway_serial_pic2_w(const address_space *space, UINT8 data); | |
| 22 | 22 | NVRAM_HANDLER( midway_serial_pic2 ); |
| 23 | 23 | |
| 24 | 24 |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | ***************************************************************************/ |
| 5 | 5 | |
| 6 | 6 | #include "driver.h" |
| 7 | #include "cpu/z80/z80.h" | |
| 7 | 8 | #include "cpu/m68000/m68000.h" |
| 8 | 9 | #include "cpu/tms32010/tms32010.h" |
| 9 | 10 | #include "includes/toaplan1.h" |
| r3957 | r3958 | |
| 232 | 233 | logerror("PC:%04x Resetting Sound CPU and Sound chip (%08x)\n",cpu_get_previouspc(space->cpu),data); |
| 233 | 234 | if (space->machine->config->sound[0].type == SOUND_YM3812) |
| 234 | 235 | sndti_reset(SOUND_YM3812, 0); |
| 235 | if (space->machine->c | |
| 236 | if (space->machine->c | |
| 236 | 237 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, PULSE_LINE); |
| 237 | 238 | } |
| 238 | 239 | } |
| r3957 | r3958 | |
|---|---|---|
| 932 | 932 | case NAMCOIO_50XX_2: namco_50xx_2_write(machine, data); break; |
| 933 | 933 | case NAMCOIO_51XX: namcoio_51XX_write(machine,chipnum,data); break; |
| 934 | 934 | case NAMCOIO_52XX: namcoio_52xx_write(data); break; |
| 935 | case NAMCOIO_54XX: namco_54xx_write(data); break; | |
| 935 | case NAMCOIO_54XX: namco_54xx_write(machine, data); break; | |
| 936 | 936 | default: |
| 937 | 937 | logerror("%s: custom IO type %d unsupported write\n",cpuexec_describe_context(machine),io[chipnum].type); |
| 938 | 938 | break; |
| r3957 | r3958 | |
|---|---|---|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | level=dc_compute_interrupt_level(machine); |
| 240 | c | |
| 240 | device | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | READ64_HANDLER( dc_sysctrl_r ) |
| r3957 | r3958 | |
| 279 | 279 | ddtdata.direction=0; |
| 280 | 280 | ddtdata.channel=2; |
| 281 | 281 | ddtdata.mode=25; //011001 |
| 282 | c | |
| 282 | device | |
| 283 | 283 | #if DEBUG_SYSCTRL |
| 284 | 284 | if ((address >= 0x11000000) && (address <= 0x11FFFFFF)) |
| 285 | 285 | if (dc_sysctrl_regs[SB_LMMODE0]) |
| r3957 | r3958 | |
| 386 | 386 | ddtdata.direction=0; // 0 source to buffer, 1 buffer to source |
| 387 | 387 | ddtdata.channel= -1; // not used |
| 388 | 388 | ddtdata.mode= -1; // copy from/to buffer |
| 389 | c | |
| 389 | device | |
| 390 | 390 | |
| 391 | 391 | maple_regs[reg] = 0; |
| 392 | 392 | endflag=buff[0] & 0x80000000; |
| r3957 | r3958 | |
| 418 | 418 | ddtdata.direction=0; |
| 419 | 419 | ddtdata.channel= -1; |
| 420 | 420 | ddtdata.mode=-1; |
| 421 | c | |
| 421 | device | |
| 422 | 422 | chk=0; |
| 423 | 423 | for (a=1;a < length;a++) |
| 424 | 424 | { |
| r3957 | r3958 | |
| 446 | 446 | ddtdata.direction=0; |
| 447 | 447 | ddtdata.channel= -1; |
| 448 | 448 | ddtdata.mode=-1; |
| 449 | c | |
| 449 | device | |
| 450 | 450 | |
| 451 | 451 | subcommand = buff[0] & 0xff; |
| 452 | 452 | #if DEBUG_MAPLE |
| r3957 | r3958 | |
| 656 | 656 | ddtdata.destination=destination; |
| 657 | 657 | ddtdata.buffer=buff; |
| 658 | 658 | ddtdata.direction=1; |
| 659 | c | |
| 659 | device | |
| 660 | 660 | |
| 661 | 661 | if (endflag) |
| 662 | 662 | { |
| r3957 | r3958 | |
| 773 | 773 | ddtdata.channel= -1; // not used |
| 774 | 774 | ddtdata.mode= -1; // copy from/to buffer |
| 775 | 775 | mame_printf_verbose("G1CTRL: transfer %x from ROM %08x to sdram %08x\n", g1bus_regs[SB_GDLEN], dmaoffset, g1bus_regs[SB_GDSTAR]); |
| 776 | c | |
| 776 | device | |
| 777 | 777 | g1bus_regs[SB_GDST]=0; |
| 778 | 778 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_GDROM; |
| 779 | 779 | } |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | MACHINE_RESET_CALL(galaxold); |
| 22 | 22 | |
| 23 | 23 | if (machine->cpu[1] != NULL) |
| 24 | scramble_sh_init(); | |
| 24 | scramble_sh_init(machine); | |
| 25 | 25 | |
| 26 | 26 | security_2B_counter = 0; |
| 27 | 27 | } |
| r3957 | r3958 | |
| 30 | 30 | { |
| 31 | 31 | MACHINE_RESET_CALL(scramble); |
| 32 | 32 | |
| 33 | sfx_sh_init(); | |
| 33 | sfx_sh_init(machine); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static int monsterz_count = 0; |
| r3957 | r3958 | |
| 47 | 47 | */ |
| 48 | 48 | MACHINE_RESET_CALL(scramble); |
| 49 | 49 | |
| 50 | sfx_sh_init(); | |
| 50 | sfx_sh_init(machine); | |
| 51 | 51 | |
| 52 | 52 | monsterz_count = 0; |
| 53 | 53 | } |
| r3957 | r3958 | |
|---|---|---|
| 419 | 419 | { |
| 420 | 420 | case SOUND_ADPCM: |
| 421 | 421 | case SOUND_ADPCM_LARGE: |
| 422 | williams_adpcm_init(); | |
| 422 | williams_adpcm_init(machine); | |
| 423 | 423 | break; |
| 424 | 424 | |
| 425 | 425 | case SOUND_DCS: |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "cpu/m6502/m6502.h" |
| 12 | 11 | #include "machine/6821pia.h" |
| 13 | 12 | #include "machine/7474.h" |
| r3957 | r3958 | |
| 88 | 87 | static UINT8 last_wheel_value[4]; |
| 89 | 88 | |
| 90 | 89 | |
| 91 | static void TTL74148_3S_cb( | |
| 90 | static void TTL74148_3S_cb(running_machine *machine) | |
| 92 | 91 | { |
| 93 | cpu_set_input_line( | |
| 92 | cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, TTL74148_output_valid_r(TTL74148_3S) ? CLEAR_LINE : ASSERT_LINE); | |
| 94 | 93 | } |
| 95 | 94 | |
| 96 | 95 | |
| 97 | 96 | /* the outputs of the flip-flops are connected to the priority encoder */ |
| 98 | static void TTL7474_2S_1_cb( | |
| 97 | static void TTL7474_2S_1_cb(running_machine *machine) | |
| 99 | 98 | { |
| 100 | 99 | TTL74148_input_line_w(TTL74148_3S, COIN1_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2S_1)); |
| 101 | TTL74148_update(TTL74148_3S); | |
| 100 | TTL74148_update(machine, TTL74148_3S); | |
| 102 | 101 | } |
| 103 | 102 | |
| 104 | static void TTL7474_2S_2_cb( | |
| 103 | static void TTL7474_2S_2_cb(running_machine *machine) | |
| 105 | 104 | { |
| 106 | 105 | TTL74148_input_line_w(TTL74148_3S, COIN2_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2S_2)); |
| 107 | TTL74148_update(TTL74148_3S); | |
| 106 | TTL74148_update(machine, TTL74148_3S); | |
| 108 | 107 | } |
| 109 | 108 | |
| 110 | static void TTL7474_2U_1_cb( | |
| 109 | static void TTL7474_2U_1_cb(running_machine *machine) | |
| 111 | 110 | { |
| 112 | 111 | TTL74148_input_line_w(TTL74148_3S, COIN3_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2U_1)); |
| 113 | TTL74148_update(TTL74148_3S); | |
| 112 | TTL74148_update(machine, TTL74148_3S); | |
| 114 | 113 | } |
| 115 | 114 | |
| 116 | static void TTL7474_2U_2_cb( | |
| 115 | static void TTL7474_2U_2_cb(running_machine *machine) | |
| 117 | 116 | { |
| 118 | 117 | TTL74148_input_line_w(TTL74148_3S, COIN4_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2U_2)); |
| 119 | TTL74148_update(TTL74148_3S); | |
| 118 | TTL74148_update(machine, TTL74148_3S); | |
| 120 | 119 | } |
| 121 | 120 | |
| 122 | 121 | |
| 123 | void carpolo_generate_ball_screen_interrupt(UINT8 cause) | |
| 122 | void carpolo_generate_ball_screen_interrupt(running_machine *machine, UINT8 cause) | |
| 124 | 123 | { |
| 125 | 124 | ball_screen_collision_cause = cause; |
| 126 | 125 | |
| 127 | 126 | TTL74148_input_line_w(TTL74148_3S, BALL_SCREEN_PRIORITY_LINE, 0); |
| 128 | TTL74148_update(TTL74148_3S); | |
| 127 | TTL74148_update(machine, TTL74148_3S); | |
| 129 | 128 | } |
| 130 | 129 | |
| 131 | void carpolo_generate_car_car_interrupt(int car1, int car2) | |
| 130 | void carpolo_generate_car_car_interrupt(running_machine *machine, int car1, int car2) | |
| 132 | 131 | { |
| 133 | 132 | car_car_collision_cause = ~((1 << (3 - car1)) | (1 << (3 - car2))); |
| 134 | 133 | |
| 135 | 134 | TTL74148_input_line_w(TTL74148_3S, CAR_CAR_PRIORITY_LINE, 0); |
| 136 | TTL74148_update(TTL74148_3S); | |
| 135 | TTL74148_update(machine, TTL74148_3S); | |
| 137 | 136 | } |
| 138 | 137 | |
| 139 | void carpolo_generate_car_goal_interrupt(int car, int right_goal) | |
| 138 | void carpolo_generate_car_goal_interrupt(running_machine *machine, int car, int right_goal) | |
| 140 | 139 | { |
| 141 | 140 | car_goal_collision_cause = car | (right_goal ? 0x08 : 0x00); |
| 142 | 141 | |
| 143 | 142 | TTL74148_input_line_w(TTL74148_3S, CAR_GOAL_PRIORITY_LINE, 0); |
| 144 | TTL74148_update(TTL74148_3S); | |
| 143 | TTL74148_update(machine, TTL74148_3S); | |
| 145 | 144 | } |
| 146 | 145 | |
| 147 | void carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y) | |
| 146 | void carpolo_generate_car_ball_interrupt(running_machine *machine, int car, int car_x, int car_y) | |
| 148 | 147 | { |
| 149 | 148 | car_ball_collision_cause = car; |
| 150 | 149 | car_ball_collision_x = car_x; |
| r3957 | r3958 | |
| 153 | 152 | priority_0_extension = CAR_BALL_EXTRA_BITS; |
| 154 | 153 | |
| 155 | 154 | TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 0); |
| 156 | TTL74148_update(TTL74148_3S); | |
| 155 | TTL74148_update(machine, TTL74148_3S); | |
| 157 | 156 | } |
| 158 | 157 | |
| 159 | void carpolo_generate_car_border_interrupt(int car, int horizontal_border) | |
| 158 | void carpolo_generate_car_border_interrupt(running_machine *machine, int car, int horizontal_border) | |
| 160 | 159 | { |
| 161 | 160 | car_border_collision_cause = car | (horizontal_border ? 0x04 : 0x00); |
| 162 | 161 | |
| 163 | 162 | priority_0_extension = CAR_BORDER_EXTRA_BITS; |
| 164 | 163 | |
| 165 | 164 | TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 0); |
| 166 | TTL74148_update(TTL74148_3S); | |
| 165 | TTL74148_update(machine, TTL74148_3S); | |
| 167 | 166 | } |
| 168 | 167 | |
| 169 | 168 | |
| r3957 | r3958 | |
| 237 | 236 | TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 0); |
| 238 | 237 | priority_0_extension = TIMER_EXTRA_BITS; |
| 239 | 238 | |
| 240 | TTL74148_update(TTL74148_3S); | |
| 239 | TTL74148_update(device->machine, TTL74148_3S); | |
| 241 | 240 | |
| 242 | 241 | |
| 243 | 242 | /* check the coins here as well - they drive the clock of the flip-flops */ |
| r3957 | r3958 | |
| 248 | 247 | TTL7474_clock_w(TTL7474_2U_1, port_value & 0x04); |
| 249 | 248 | TTL7474_clock_w(TTL7474_2U_2, port_value & 0x08); |
| 250 | 249 | |
| 251 | TTL7474_update(TTL7474_2S_1); | |
| 252 | TTL7474_update(TTL7474_2S_2); | |
| 253 | TTL7474_update(TTL7474_2U_1); | |
| 254 | TTL7474_update(TTL7474_2U_2); | |
| 250 | TTL7474_update(device->machine, TTL7474_2S_1); | |
| 251 | TTL7474_update(device->machine, TTL7474_2S_2); | |
| 252 | TTL7474_update(device->machine, TTL7474_2U_1); | |
| 253 | TTL7474_update(device->machine, TTL7474_2U_2); | |
| 255 | 254 | |
| 256 | 255 | |
| 257 | 256 | /* read the steering controls */ |
| r3957 | r3958 | |
| 275 | 274 | TTL7474_clock_w(movement_flip_flop, port_value & 0x01); |
| 276 | 275 | TTL7474_clock_w(dir_flip_flop, port_value & 0x01); |
| 277 | 276 | |
| 278 | TTL7474_update(movement_flip_flop); | |
| 279 | TTL7474_update(dir_flip_flop); | |
| 277 | TTL7474_update(device->machine, movement_flip_flop); | |
| 278 | TTL7474_update(device->machine, dir_flip_flop); | |
| 280 | 279 | } |
| 281 | 280 | |
| 282 | 281 | |
| r3957 | r3958 | |
| 314 | 313 | static WRITE8_HANDLER( coin1_interrupt_clear_w ) |
| 315 | 314 | { |
| 316 | 315 | TTL7474_clear_w(TTL7474_2S_1, data); |
| 317 | TTL7474_update(TTL7474_2S_1); | |
| 316 | TTL7474_update(space->machine, TTL7474_2S_1); | |
| 318 | 317 | } |
| 319 | 318 | |
| 320 | 319 | static WRITE8_HANDLER( coin2_interrupt_clear_w ) |
| 321 | 320 | { |
| 322 | 321 | TTL7474_clear_w(TTL7474_2S_2, data); |
| 323 | TTL7474_update(TTL7474_2S_2); | |
| 322 | TTL7474_update(space->machine, TTL7474_2S_2); | |
| 324 | 323 | } |
| 325 | 324 | |
| 326 | 325 | static WRITE8_HANDLER( coin3_interrupt_clear_w ) |
| 327 | 326 | { |
| 328 | 327 | TTL7474_clear_w(TTL7474_2U_1, data); |
| 329 | TTL7474_update(TTL7474_2U_1); | |
| 328 | TTL7474_update(space->machine, TTL7474_2U_1); | |
| 330 | 329 | } |
| 331 | 330 | |
| 332 | 331 | static WRITE8_HANDLER( coin4_interrupt_clear_w ) |
| 333 | 332 | { |
| 334 | 333 | TTL7474_clear_w(TTL7474_2U_2, data); |
| 335 | TTL7474_update(TTL7474_2U_2); | |
| 334 | TTL7474_update(space->machine, TTL7474_2U_2); | |
| 336 | 335 | } |
| 337 | 336 | |
| 338 | 337 | WRITE8_HANDLER( carpolo_ball_screen_interrupt_clear_w ) |
| 339 | 338 | { |
| 340 | 339 | TTL74148_input_line_w(TTL74148_3S, BALL_SCREEN_PRIORITY_LINE, 1); |
| 341 | TTL74148_update(TTL74148_3S); | |
| 340 | TTL74148_update(space->machine, TTL74148_3S); | |
| 342 | 341 | } |
| 343 | 342 | |
| 344 | 343 | WRITE8_HANDLER( carpolo_car_car_interrupt_clear_w ) |
| 345 | 344 | { |
| 346 | 345 | TTL74148_input_line_w(TTL74148_3S, CAR_CAR_PRIORITY_LINE, 1); |
| 347 | TTL74148_update(TTL74148_3S); | |
| 346 | TTL74148_update(space->machine, TTL74148_3S); | |
| 348 | 347 | } |
| 349 | 348 | |
| 350 | 349 | WRITE8_HANDLER( carpolo_car_goal_interrupt_clear_w ) |
| 351 | 350 | { |
| 352 | 351 | TTL74148_input_line_w(TTL74148_3S, CAR_GOAL_PRIORITY_LINE, 1); |
| 353 | TTL74148_update(TTL74148_3S); | |
| 352 | TTL74148_update(space->machine, TTL74148_3S); | |
| 354 | 353 | } |
| 355 | 354 | |
| 356 | 355 | WRITE8_HANDLER( carpolo_car_ball_interrupt_clear_w ) |
| 357 | 356 | { |
| 358 | 357 | TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 1); |
| 359 | TTL74148_update(TTL74148_3S); | |
| 358 | TTL74148_update(space->machine, TTL74148_3S); | |
| 360 | 359 | } |
| 361 | 360 | |
| 362 | 361 | WRITE8_HANDLER( carpolo_car_border_interrupt_clear_w ) |
| 363 | 362 | { |
| 364 | 363 | TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 1); |
| 365 | TTL74148_update(TTL74148_3S); | |
| 364 | TTL74148_update(space->machine, TTL74148_3S); | |
| 366 | 365 | } |
| 367 | 366 | |
| 368 | 367 | WRITE8_HANDLER( carpolo_timer_interrupt_clear_w ) |
| 369 | 368 | { |
| 370 | 369 | TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 1); |
| 371 | TTL74148_update(TTL74148_3S); | |
| 370 | TTL74148_update(space->machine, TTL74148_3S); | |
| 372 | 371 | } |
| 373 | 372 | |
| 374 | 373 | |
| r3957 | r3958 | |
| 397 | 396 | TTL7474_clear_w(TTL7474_1C_1, data & 0x08); |
| 398 | 397 | TTL7474_clear_w(TTL7474_1A_1, data & 0x08); |
| 399 | 398 | |
| 400 | TTL7474_update(TTL7474_1F_1); | |
| 401 | TTL7474_update(TTL7474_1D_1); | |
| 402 | TTL7474_update(TTL7474_1C_1); | |
| 403 | TTL7474_update(TTL7474_1A_1); | |
| 399 | TTL7474_update(space->machine, TTL7474_1F_1); | |
| 400 | TTL7474_update(space->machine, TTL7474_1D_1); | |
| 401 | TTL7474_update(space->machine, TTL7474_1C_1); | |
| 402 | TTL7474_update(space->machine, TTL7474_1A_1); | |
| 404 | 403 | } |
| 405 | 404 | |
| 406 | 405 | |
| r3957 | r3958 | |
| 579 | 578 | |
| 580 | 579 | |
| 581 | 580 | /* set up the pedal handling chips */ |
| 582 | TTL74153_config(TTL74153_1K, 0); | |
| 581 | TTL74153_config(machine, TTL74153_1K, 0); | |
| 583 | 582 | |
| 584 | 583 | TTL74153_enable_w(TTL74153_1K, 0, 0); |
| 585 | 584 | TTL74153_enable_w(TTL74153_1K, 1, 0); |
| r3957 | r3958 | |
|---|---|---|
| 106 | 106 | ***************************************************************************/ |
| 107 | 107 | |
| 108 | 108 | #include "driver.h" |
| 109 | #include "deprecat.h" | |
| 110 | 109 | #include "machine/fd1094.h" |
| 111 | 110 | #include "cpu/m68000/m68kcpu.h" |
| 112 | #undef REG_PC | |
| 113 | 111 | |
| 114 | 112 | #include "debug/debugcmd.h" |
| 115 | 113 | #include "debug/debugcon.h" |
| 116 | 114 | #include "debug/debugcpu.h" |
| 117 | 115 | #include "debug/debugvw.h" |
| 116 | #include "machine/fddebug.h" | |
| 118 | 117 | |
| 119 | 118 | |
| 120 | 119 | |
| r3957 | r3958 | |
| 247 | 246 | static UINT32 keystatus_words; |
| 248 | 247 | |
| 249 | 248 | /* key changed callback */ |
| 250 | static void (*key_changed)( | |
| 249 | static void (*key_changed)(running_machine *); | |
| 251 | 250 | |
| 252 | 251 | |
| 253 | 252 | |
| r3957 | r3958 | |
| 258 | 257 | static void set_default_key_params(running_machine *machine); |
| 259 | 258 | static void load_overlay_file(running_machine *machine); |
| 260 | 259 | static void save_overlay_file(running_machine *machine); |
| 261 | static void fd1094_regenerate_key(void); | |
| 262 | 260 | |
| 263 | 261 | static int instruction_hook(const device_config *device, offs_t curpc); |
| 264 | 262 | |
| r3957 | r3958 | |
| 478 | 476 | fd1094_init_debugging - set up debugging |
| 479 | 477 | -----------------------------------------------*/ |
| 480 | 478 | |
| 481 | void fd1094_init_debugging(running_machine *machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)( | |
| 479 | void fd1094_init_debugging(running_machine *machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(running_machine *)) | |
| 482 | 480 | { |
| 483 | 481 | /* set the key changed callback */ |
| 484 | 482 | key_changed = changed; |
| r3957 | r3958 | |
| 542 | 540 | |
| 543 | 541 | /* regenerate the key */ |
| 544 | 542 | if (keydirty) |
| 545 | fd1094_regenerate_key(); | |
| 543 | fd1094_regenerate_key(machine); | |
| 546 | 544 | } |
| 547 | 545 | |
| 548 | 546 | |
| r3957 | r3958 | |
| 645 | 643 | data |
| 646 | 644 | -----------------------------------------------*/ |
| 647 | 645 | |
| 648 | void fd1094_regenerate_key( | |
| 646 | void fd1094_regenerate_key(running_machine *machine) | |
| 649 | 647 | { |
| 650 | 648 | int reps = keystatus_words / KEY_SIZE; |
| 651 | 649 | int keyaddr, repnum; |
| r3957 | r3958 | |
| 676 | 674 | |
| 677 | 675 | /* update the key with the current fd1094 manager */ |
| 678 | 676 | if (key_changed != NULL) |
| 679 | (*key_changed)(); | |
| 677 | (*key_changed)(machine); | |
| 680 | 678 | |
| 681 | 679 | /* force all memory and disassembly views to update */ |
| 682 | debug_view_update_type(Machine, DVT_MEMORY); | |
| 683 | debug_view_update_type(Machine, DVT_DISASSEMBLY); | |
| 680 | debug_view_update_type(machine, DVT_MEMORY); | |
| 681 | debug_view_update_type(machine, DVT_DISASSEMBLY); | |
| 684 | 682 | |
| 685 | 683 | /* reset keydirty */ |
| 686 | 684 | keydirty = FALSE; |
| r3957 | r3958 | |
| 725 | 723 | /* try all possible decodings at the current pc */ |
| 726 | 724 | posscount = try_all_possibilities(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist; |
| 727 | 725 | if (keydirty) |
| 728 | fd1094_regenerate_key(); | |
| 726 | fd1094_regenerate_key(device->machine); | |
| 729 | 727 | |
| 730 | 728 | /* if we only ended up with one possibility, mark that one as good */ |
| 731 | 729 | if (posscount == 1) |
| 732 | 730 | { |
| 733 | 731 | tag_possibility(device->machine, &posslist[0], STATUS_LOCKED); |
| 734 | fd1094_regenerate_key(); | |
| 732 | fd1094_regenerate_key(device->machine); | |
| 735 | 733 | return 0; |
| 736 | 734 | } |
| 737 | 735 | |
| r3957 | r3958 | |
| 764 | 762 | |
| 765 | 763 | /* make sure we're up-to-date */ |
| 766 | 764 | if (keydirty) |
| 767 | fd1094_regenerate_key(); | |
| 765 | fd1094_regenerate_key(machine); | |
| 768 | 766 | |
| 769 | 767 | /* determin the filename and open the file */ |
| 770 | 768 | filerr = mame_fopen(SEARCHPATH_RAW, param[0], OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file); |
| r3957 | r3958 | |
| 799 | 797 | memset(keystatus, 0, keystatus_words * sizeof(keystatus[0])); |
| 800 | 798 | |
| 801 | 799 | /* regenerate the key and reset the 68000 */ |
| 802 | fd1094_regenerate_key(); | |
| 800 | fd1094_regenerate_key(machine); | |
| 803 | 801 | } |
| 804 | 802 | |
| 805 | 803 | |
| r3957 | r3958 | |
| 828 | 826 | |
| 829 | 827 | /* tag this possibility as indicated by the ref parameter, and then regenerate the key */ |
| 830 | 828 | tag_possibility(machine, &posslist[num1], ref); |
| 831 | fd1094_regenerate_key(); | |
| 829 | fd1094_regenerate_key(machine); | |
| 832 | 830 | } |
| 833 | 831 | |
| 834 | 832 | |
| r3957 | r3958 | |
| 964 | 962 | { |
| 965 | 963 | /* copy the undobuffer back and regenerate the key */ |
| 966 | 964 | memcpy(keystatus, undobuff, keystatus_words * 2); |
| 967 | fd1094_regenerate_key(); | |
| 965 | fd1094_regenerate_key(machine); | |
| 968 | 966 | debug_console_printf(machine, "Undid last change\n"); |
| 969 | 967 | } |
| 970 | 968 | |
| r3957 | r3958 | |
| 1016 | 1014 | if (!debug_command_parameter_number(machine, param[0], &newstate)) |
| 1017 | 1015 | return; |
| 1018 | 1016 | fd1094_set_state(keyregion, newstate); |
| 1019 | fd1094_regenerate_key(); | |
| 1017 | fd1094_regenerate_key(machine); | |
| 1020 | 1018 | debug_view_update_type(machine, DVT_MEMORY); |
| 1021 | 1019 | debug_view_update_type(machine, DVT_DISASSEMBLY); |
| 1022 | 1020 | } |
| r3957 | r3958 | |
| 1041 | 1039 | newpc = cpu_get_pc(cpu); |
| 1042 | 1040 | |
| 1043 | 1041 | /* set the new PC */ |
| 1044 | cpu_set_reg(cpu, REG_PC, newpc); | |
| 1042 | cpu_set_reg(cpu, REG_GENPC, newpc); | |
| 1045 | 1043 | |
| 1046 | 1044 | /* recompute around that */ |
| 1047 | 1045 | instruction_hook(cpu, newpc); |
| r3957 | r3958 | |
| 1094 | 1092 | } |
| 1095 | 1093 | |
| 1096 | 1094 | /* set this as our current PC and run the instruction hook */ |
| 1097 | cpu_set_reg(space->cpu, REG_PC, pc); | |
| 1095 | cpu_set_reg(space->cpu, REG_GENPC, pc); | |
| 1098 | 1096 | if (instruction_hook(space->cpu, pc)) |
| 1099 | 1097 | break; |
| 1100 | 1098 | } |
| r3957 | r3958 | |
|---|---|---|
| 681 | 681 | /* Main bankswitching routine */ |
| 682 | 682 | static void set_bank(running_machine *machine, int banknum, const bankhandler *handler) |
| 683 | 683 | { |
| 684 | const address_space *space = cpu_get_address_space(machine->cpu[(banknum >> 3) & 1], ADDRESS_SPACE_PROGRAM); | |
| 684 | 685 | int bankstart = (banknum & 7) * 0x2000; |
| 685 | int cpunum = (banknum >> 3) & 1; | |
| 686 | 686 | |
| 687 | 687 | /* for BANK handlers , memory direct and OP-code base */ |
| 688 | 688 | if (handler->bank_pointer) |
| r3957 | r3958 | |
| 692 | 692 | if (!handler->bank_handler_r) |
| 693 | 693 | { |
| 694 | 694 | if (namcos1_active_bank[banknum].bank_handler_r) |
| 695 | memory_install_read8_handler( | |
| 695 | memory_install_read8_handler( | |
| 696 | 696 | } |
| 697 | 697 | else |
| 698 | 698 | { |
| 699 | 699 | if (!namcos1_active_bank[banknum].bank_handler_r) |
| 700 | memory_install_read8_handler( | |
| 700 | memory_install_read8_handler( | |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | /* write handlers (except for the 0xe000-0xffff range) */ |
| r3957 | r3958 | |
| 706 | 706 | if (!handler->bank_handler_w) |
| 707 | 707 | { |
| 708 | 708 | if (namcos1_active_bank[banknum].bank_handler_w) |
| 709 | memory_install_write8_handler( | |
| 709 | memory_install_write8_handler( | |
| 710 | 710 | } |
| 711 | 711 | else |
| 712 | 712 | { |
| 713 | 713 | if (!namcos1_active_bank[banknum].bank_handler_r) |
| 714 | memory_install_write8_handler( | |
| 714 | memory_install_write8_handler( | |
| 715 | 715 | } |
| 716 | 716 | } |
| 717 | 717 | |
| r3957 | r3958 | |
| 873 | 873 | namcos1_bankswitch(machine, 1, 0x0e01, 0xff); |
| 874 | 874 | |
| 875 | 875 | /* reset Cpu 0 and stop all other CPUs */ |
| 876 | c | |
| 876 | device | |
| 877 | 877 | cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE); |
| 878 | 878 | cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE); |
| 879 | 879 | cpu_set_input_line(machine->cpu[3], INPUT_LINE_RESET, ASSERT_LINE); |
| r3957 | r3958 | |
|---|---|---|
| 325 | 325 | if (LOG_MEMORY_MAP) mame_printf_debug("----\nRemapping:\n"); |
| 326 | 326 | |
| 327 | 327 | /* first reset everything back to the beginning */ |
| 328 | memory_install_readwrite16_handler(cpu_get_address_space( | |
| 328 | memory_install_readwrite16_handler(cpu_get_address_space( | |
| 329 | 329 | |
| 330 | 330 | /* loop over the regions */ |
| 331 | 331 | for (rgnum = 0; chip->map[rgnum].regbase != 0; rgnum++) |
| r0 | r3958 | |
|---|---|---|
| 1 | void fd1094_regenerate_key(running_machine *machine); | |
| 2 | void fd1094_init_debugging(running_machine *machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(running_machine *)); | |
| 3 | ||
| 4 |
| r3957 | r3958 | |
|---|---|---|
| 465 | 465 | { |
| 466 | 466 | case 0x00/4: // SP_PC_REG |
| 467 | 467 | //printf( "Setting PC to: %08x\n", 0x04001000 | (data & 0xfff ) ); |
| 468 | if( c | |
| 468 | if( device | |
| 469 | 469 | { |
| 470 | c | |
| 470 | device | |
| 471 | 471 | } |
| 472 | 472 | else |
| 473 | 473 | { |
| 474 | c | |
| 474 | device | |
| 475 | 475 | } |
| 476 | 476 | break; |
| 477 | 477 | |
| r3957 | r3958 | |
| 529 | 529 | |
| 530 | 530 | case 0x04/4: // DP_END_REG |
| 531 | 531 | dp_end = data; |
| 532 | rdp_process_list(); | |
| 532 | rdp_process_list(space->machine); | |
| 533 | 533 | break; |
| 534 | 534 | |
| 535 | 535 | case 0x0c/4: // DP_STATUS_REG |
| r3957 | r3958 | |
| 1628 | 1628 | |
| 1629 | 1629 | cic_status = 0; |
| 1630 | 1630 | |
| 1631 | c | |
| 1631 | device | |
| 1632 | 1632 | |
| 1633 | 1633 | /* configure fast RAM regions for DRC */ |
| 1634 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 1635 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 1636 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); | |
| 1637 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rdram); | |
| 1638 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 1634 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 1635 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 1636 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); | |
| 1637 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rdram); | |
| 1638 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 1639 | 1639 | |
| 1640 | 1640 | audio_timer = timer_alloc(machine, audio_timer_callback, NULL); |
| 1641 | 1641 | timer_adjust_oneshot(audio_timer, attotime_never, 0); |
| r3957 | r3958 | |
|---|---|---|
| 189 | 189 | memory_configure_bank(machine, 2, 0, numbanks, &memory_region(machine, "main")[0x12000], 0x6000); |
| 190 | 190 | memory_set_bank(space->machine, 1, 0); |
| 191 | 191 | memory_set_bank(space->machine, 2, 0); |
| 192 | c | |
| 192 | device | |
| 193 | 193 | |
| 194 | 194 | /* start a timer to generate interrupts */ |
| 195 | 195 | scanline_timer = timer_alloc(machine, interrupt_timer, NULL); |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | #include "video/ppu2c0x.h" |
| 13 | 12 | #include "includes/vsnes.h" |
| 14 | 13 | |
| r3957 | r3958 | |
| 88 | 87 | |
| 89 | 88 | |
| 90 | 89 | /* remap callback */ |
| 91 | static int remap_colors( int num, int addr, int data ) | |
| 90 | static int remap_colors( running_machine *machine, int num, int addr, int data ) | |
| 92 | 91 | { |
| 93 | 92 | /* this is the protection. color codes are shuffled around */ |
| 94 | 93 | /* the ones with value 0xff are unknown */ |
| r3957 | r3958 | |
| 806 | 805 | static int MMC3_prg_chunks, MMC3_prg_mask; |
| 807 | 806 | static int IRQ_enable, IRQ_count, IRQ_count_latch; |
| 808 | 807 | |
| 809 | static void mapper4_set_prg ( | |
| 808 | static void mapper4_set_prg (const address_space *space) | |
| 810 | 809 | { |
| 811 | UINT8 *prg = memory_region( | |
| 810 | UINT8 *prg = memory_region( space->machine, "main" ); | |
| 812 | 811 | MMC3_prg0 &= MMC3_prg_mask; |
| 813 | 812 | MMC3_prg1 &= MMC3_prg_mask; |
| 814 | 813 | |
| r3957 | r3958 | |
| 825 | 824 | memcpy( &prg[0xa000], &prg[0x2000 * (MMC3_prg1) + 0x10000], 0x2000 ); |
| 826 | 825 | } |
| 827 | 826 | |
| 828 | static void mapper4_set_chr ( | |
| 827 | static void mapper4_set_chr (const address_space *space) | |
| 829 | 828 | { |
| 830 | 829 | UINT8 chr_page = (MMC3_cmd & 0x80) >> 5; |
| 831 | 830 | ppu2c0x_set_videorom_bank(0, chr_page ^ 0, 2, MMC3_chr[0], 1); |
| r3957 | r3958 | |
| 839 | 838 | #define BOTTOM_VISIBLE_SCANLINE 239 /* The bottommost visible scanline */ |
| 840 | 839 | #define NUM_SCANLINE 262 |
| 841 | 840 | |
| 842 | static void mapper4_irq ( int num, int scanline, int vblank, int blanked ) | |
| 841 | static void mapper4_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked ) | |
| 843 | 842 | { |
| 844 | 843 | mame_printf_debug("entra\n"); |
| 845 | 844 | if ((scanline < BOTTOM_VISIBLE_SCANLINE) || (scanline == NUM_SCANLINE-1)) |
| r3957 | r3958 | |
| 849 | 848 | if (IRQ_count == 0) |
| 850 | 849 | { |
| 851 | 850 | IRQ_count = IRQ_count_latch; |
| 852 | cpu_set_input_line ( | |
| 851 | cpu_set_input_line (machine->cpu[0], 0, HOLD_LINE); | |
| 853 | 852 | } |
| 854 | 853 | IRQ_count --; |
| 855 | 854 | } |
| r3957 | r3958 | |
| 867 | 866 | if (last_bank != (data & 0xc0)) |
| 868 | 867 | { |
| 869 | 868 | /* Reset the banks */ |
| 870 | mapper4_set_prg (); | |
| 871 | mapper4_set_chr (); | |
| 869 | mapper4_set_prg (space); | |
| 870 | mapper4_set_chr (space); | |
| 872 | 871 | |
| 873 | 872 | } |
| 874 | 873 | last_bank = data & 0xc0; |
| r3957 | r3958 | |
| 882 | 881 | case 0: case 1: |
| 883 | 882 | data &= 0xfe; |
| 884 | 883 | MMC3_chr[cmd] = data * 64; |
| 885 | mapper4_set_chr (); | |
| 884 | mapper4_set_chr (space); | |
| 886 | 885 | |
| 887 | 886 | break; |
| 888 | 887 | |
| 889 | 888 | case 2: case 3: case 4: case 5: |
| 890 | 889 | MMC3_chr[cmd] = data * 64; |
| 891 | mapper4_set_chr (); | |
| 890 | mapper4_set_chr (space); | |
| 892 | 891 | |
| 893 | 892 | break; |
| 894 | 893 | |
| 895 | 894 | case 6: |
| 896 | 895 | MMC3_prg0 = data; |
| 897 | mapper4_set_prg (); | |
| 896 | mapper4_set_prg (space); | |
| 898 | 897 | break; |
| 899 | 898 | |
| 900 | 899 | case 7: |
| 901 | 900 | MMC3_prg1 = data; |
| 902 | mapper4_set_prg (); | |
| 901 | mapper4_set_prg (space); | |
| 903 | 902 | break; |
| 904 | 903 | } |
| 905 | 904 | break; |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | static int joystick_port_select; /* internal index of joystick ports */ |
| 18 | 18 | static int joystick_data_select; /* which nibble of joystick data we want */ |
| 19 | 19 | |
| 20 | static UINT8 (*pce_joystick_readinputport_callback)( | |
| 20 | static UINT8 (*pce_joystick_readinputport_callback)(running_machine *) = NULL; | |
| 21 | 21 | |
| 22 | 22 | DRIVER_INIT( pce ) { |
| 23 | 23 | pce.io_port_options = PCE_JOY_SIG | CONST_SIG; |
| r3957 | r3958 | |
| 53 | 53 | |
| 54 | 54 | if ( pce_joystick_readinputport_callback != NULL ) |
| 55 | 55 | { |
| 56 | data = pce_joystick_readinputport_callback(); | |
| 56 | data = pce_joystick_readinputport_callback(space->machine); | |
| 57 | 57 | } |
| 58 | 58 | else |
| 59 | 59 | { |
| r3957 | r3958 | |
| 67 | 67 | return (ret); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)( | |
| 70 | void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(running_machine *)) | |
| 71 | 71 | { |
| 72 | 72 | pce_joystick_readinputport_callback = joy_read; |
| 73 | 73 | } |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | WRITE8_HANDLER( mexico86_f008_w ) |
| 24 | 24 | { |
| 25 | 25 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); |
| 26 | if (space->machine->c | |
| 26 | if (space->machine->c | |
| 27 | 27 | { |
| 28 | 28 | // mexico 86, knight boy |
| 29 | 29 | cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | DRIVER_INIT( pce ); |
| 31 | 31 | MACHINE_RESET( pce ); |
| 32 | 32 | |
| 33 | void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)( | |
| 33 | void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(running_machine *)); | |
| 34 | 34 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | zaccept = 1; |
| 54 | 54 | zready = 0; |
| 55 | 55 | busreq = 0; |
| 56 | if (machine->config->cpu[2].type != CPU_DUMMY) | |
| 57 | cpu_set_input_line(machine->cpu[2],0,CLEAR_LINE); | |
| 56 | if (machine->cpu[2] != NULL) | |
| 57 | cpu_set_input_line(machine->cpu[2],0,CLEAR_LINE); | |
| 58 | 58 | |
| 59 | 59 | spacecr_prot_value = 0; |
| 60 | 60 | } |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" | |
| 13 | 12 | #include "includes/amiga.h" |
| 14 | 13 | #include "cpu/m68000/m68000.h" |
| 15 | 14 | #include "machine/6526cia.h" |
| r3957 | r3958 | |
| 170 | 169 | * |
| 171 | 170 | *************************************/ |
| 172 | 171 | |
| 173 | static void custom_reset(void); | |
| 174 | static void autoconfig_reset(void); | |
| 172 | static void custom_reset(running_machine *machine); | |
| 173 | static void autoconfig_reset(running_machine *machine); | |
| 175 | 174 | static TIMER_CALLBACK( amiga_irq_proc ); |
| 176 | 175 | static TIMER_CALLBACK( amiga_blitter_proc ); |
| 177 | 176 | static TIMER_CALLBACK( scanline_callback ); |
| r3957 | r3958 | |
| 284 | 283 | /* Initialize the various chips */ |
| 285 | 284 | devtag_reset(device->machine, CIA8520, "cia_0"); |
| 286 | 285 | devtag_reset(device->machine, CIA8520, "cia_1"); |
| 287 | custom_reset(); | |
| 288 | autoconfig_reset(); | |
| 286 | custom_reset(device->machine); | |
| 287 | autoconfig_reset(device->machine); | |
| 289 | 288 | |
| 290 | 289 | /* set the overlay bit */ |
| 291 | 290 | if ( IS_AGA(amiga_intf) ) |
| r3957 | r3958 | |
| 304 | 303 | // const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 305 | 304 | |
| 306 | 305 | /* set m68k reset function */ |
| 307 | c | |
| 306 | device | |
| 308 | 307 | |
| 309 | 308 | amiga_m68k_reset(machine->cpu[0]); |
| 310 | 309 | |
| 311 | 310 | /* call the system-specific callback */ |
| 312 | 311 | if (amiga_intf->reset_callback) |
| 313 | (*amiga_intf->reset_callback)(); | |
| 312 | (*amiga_intf->reset_callback)(machine); | |
| 314 | 313 | |
| 315 | 314 | /* start the scanline timer */ |
| 316 | 315 | timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), NULL, 0, scanline_callback); |
| r3957 | r3958 | |
| 341 | 340 | |
| 342 | 341 | /* call the system-specific callback */ |
| 343 | 342 | if (amiga_intf->scanline0_callback != NULL) |
| 344 | (*amiga_intf->scanline0_callback)(); | |
| 343 | (*amiga_intf->scanline0_callback)(machine); | |
| 345 | 344 | } |
| 346 | 345 | |
| 347 | 346 | /* on every scanline, clock the second CIA TOD */ |
| r3957 | r3958 | |
| 1111 | 1110 | * |
| 1112 | 1111 | *************************************/ |
| 1113 | 1112 | |
| 1114 | static void custom_reset( | |
| 1113 | static void custom_reset(running_machine *machine) | |
| 1115 | 1114 | { |
| 1116 | int clock = cpu_get_clock( | |
| 1115 | int clock = cpu_get_clock(machine->cpu[0]); | |
| 1117 | 1116 | UINT16 vidmode = (clock == AMIGA_68000_NTSC_CLOCK || clock == AMIGA_68EC020_NTSC_CLOCK ) ? 0x1000 : 0x0000; /* NTSC or PAL? */ |
| 1118 | 1117 | |
| 1119 | 1118 | CUSTOM_REG(REG_DDFSTRT) = 0x18; |
| r3957 | r3958 | |
| 1176 | 1175 | |
| 1177 | 1176 | case REG_JOY0DAT: |
| 1178 | 1177 | if (amiga_intf->joy0dat_r != NULL) |
| 1179 | return (*amiga_intf->joy0dat_r)(); | |
| 1178 | return (*amiga_intf->joy0dat_r)(space->machine); | |
| 1180 | 1179 | return input_port_read_safe(space->machine, "JOY0DAT", 0xffff); |
| 1181 | 1180 | |
| 1182 | 1181 | case REG_JOY1DAT: |
| 1183 | 1182 | if (amiga_intf->joy1dat_r != NULL) |
| 1184 | return (*amiga_intf->joy1dat_r)(); | |
| 1183 | return (*amiga_intf->joy1dat_r)(space->machine); | |
| 1185 | 1184 | return input_port_read_safe(space->machine, "JOY1DAT", 0xffff); |
| 1186 | 1185 | |
| 1187 | 1186 | case REG_ADKCONR: |
| r3957 | r3958 | |
| 1198 | 1197 | |
| 1199 | 1198 | case REG_DSKBYTR: |
| 1200 | 1199 | if (amiga_intf->dskbytr_r != NULL) |
| 1201 | return (*amiga_intf->dskbytr_r)(); | |
| 1200 | return (*amiga_intf->dskbytr_r)(space->machine); | |
| 1202 | 1201 | return 0x0000; |
| 1203 | 1202 | |
| 1204 | 1203 | case REG_INTENAR: |
| r3957 | r3958 | |
| 1270 | 1269 | |
| 1271 | 1270 | case REG_DSKLEN: |
| 1272 | 1271 | if (amiga_intf->dsklen_w != NULL) |
| 1273 | (*amiga_intf->dsklen_w)(data); | |
| 1272 | (*amiga_intf->dsklen_w)(space->machine, data); | |
| 1274 | 1273 | break; |
| 1275 | 1274 | |
| 1276 | 1275 | case REG_POTGO: |
| 1277 | 1276 | if (amiga_intf->potgo_w != NULL) |
| 1278 | (*amiga_intf->potgo_w)(data); | |
| 1277 | (*amiga_intf->potgo_w)(space->machine, data); | |
| 1279 | 1278 | break; |
| 1280 | 1279 | |
| 1281 | 1280 | case REG_SERDAT: |
| 1282 | 1281 | if (amiga_intf->serdat_w != NULL) |
| 1283 | (*amiga_intf->serdat_w)(data); | |
| 1282 | (*amiga_intf->serdat_w)(space->machine, data); | |
| 1284 | 1283 | CUSTOM_REG(REG_SERDATR) &= ~0x3000; |
| 1285 | timer_set(space->machine, amiga_get_serial_char_period(), NULL, 0, finish_serial_write); | |
| 1284 | timer_set(space->machine, amiga_get_serial_char_period(space->machine), NULL, 0, finish_serial_write); | |
| 1286 | 1285 | break; |
| 1287 | 1286 | |
| 1288 | 1287 | case REG_BLTSIZE: |
| r3957 | r3958 | |
| 1469 | 1468 | * |
| 1470 | 1469 | *************************************/ |
| 1471 | 1470 | |
| 1472 | void amiga_serial_in_w(UINT16 data) | |
| 1471 | void amiga_serial_in_w(running_machine *machine, UINT16 data) | |
| 1473 | 1472 | { |
| 1473 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 1474 | 1474 | int mask = (CUSTOM_REG(REG_SERPER) & 0x8000) ? 0x1ff : 0xff; |
| 1475 | 1475 | |
| 1476 | 1476 | /* copy the data to the low 8 bits of SERDATR and set RBF */ |
| r3957 | r3958 | |
| 1485 | 1485 | } |
| 1486 | 1486 | |
| 1487 | 1487 | /* signal an interrupt */ |
| 1488 | amiga_custom_w( | |
| 1488 | amiga_custom_w( | |
| 1489 | 1489 | } |
| 1490 | 1490 | |
| 1491 | 1491 | |
| 1492 | attotime amiga_get_serial_char_period( | |
| 1492 | attotime amiga_get_serial_char_period(running_machine *machine) | |
| 1493 | 1493 | { |
| 1494 | 1494 | UINT32 divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1; |
| 1495 | UINT32 baud = cpu_get_clock( | |
| 1495 | UINT32 baud = cpu_get_clock(machine->cpu[0]) / 2 / divisor; | |
| 1496 | 1496 | UINT32 numbits = 2 + ((CUSTOM_REG(REG_SERPER) & 0x8000) ? 9 : 8); |
| 1497 | 1497 | return attotime_mul(ATTOTIME_IN_HZ(baud), numbits); |
| 1498 | 1498 | } |
| r3957 | r3958 | |
| 1505 | 1505 | * |
| 1506 | 1506 | *************************************/ |
| 1507 | 1507 | |
| 1508 | void amiga_add_autoconfig(const amiga_autoconfig_device *device) | |
| 1508 | void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_device *device) | |
| 1509 | 1509 | { |
| 1510 | 1510 | autoconfig_device *dev, **d; |
| 1511 | 1511 | |
| 1512 | 1512 | /* validate the data */ |
| 1513 | assert_always(mame_get_phase( | |
| 1513 | assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call amiga_add_autoconfig at init time!"); | |
| 1514 | 1514 | assert_always((device->size & (device->size - 1)) == 0, "device->size must be power of 2!"); |
| 1515 | 1515 | |
| 1516 | 1516 | /* allocate memory and link it in at the end of the list */ |
| r3957 | r3958 | |
| 1532 | 1532 | * |
| 1533 | 1533 | *************************************/ |
| 1534 | 1534 | |
| 1535 | static void autoconfig_reset( | |
| 1535 | static void autoconfig_reset(running_machine *machine) | |
| 1536 | 1536 | { |
| 1537 | 1537 | autoconfig_device *dev; |
| 1538 | 1538 | |
| r3957 | r3958 | |
| 1540 | 1540 | for (dev = autoconfig_list; dev; dev = dev->next) |
| 1541 | 1541 | if (dev->base && dev->device.uninstall) |
| 1542 | 1542 | { |
| 1543 | (*dev->device.uninstall)(dev->base); | |
| 1543 | (*dev->device.uninstall)(machine, dev->base); | |
| 1544 | 1544 | dev->base = 0; |
| 1545 | 1545 | } |
| 1546 | 1546 | |
| r3957 | r3958 | |
| 1672 | 1672 | case 0x40/4: |
| 1673 | 1673 | byte = 0x00; |
| 1674 | 1674 | if (cur_autoconfig->device.int_control_r) |
| 1675 | byte = (*cur_autoconfig->device.int_control_r)(); | |
| 1675 | byte = (*cur_autoconfig->device.int_control_r)(space->machine); | |
| 1676 | 1676 | break; |
| 1677 | 1677 | |
| 1678 | 1678 | default: |
| r3957 | r3958 | |
| 1731 | 1731 | { |
| 1732 | 1732 | logerror("Install to %06X\n", cur_autoconfig->base); |
| 1733 | 1733 | if (cur_autoconfig->base && cur_autoconfig->device.install) |
| 1734 | (*cur_autoconfig->device.install)(cur_autoconfig->base); | |
| 1734 | (*cur_autoconfig->device.install)(space->machine, cur_autoconfig->base); | |
| 1735 | 1735 | cur_autoconfig = cur_autoconfig->next; |
| 1736 | 1736 | } |
| 1737 | 1737 | } |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "vertigo.h" |
| 10 | 9 | #include "exidy440.h" |
| 11 | 10 | #include "machine/74148.h" |
| r3957 | r3958 | |
| 21 | 20 | |
| 22 | 21 | static PIT8253_OUTPUT_CHANGED( v_irq4_w ); |
| 23 | 22 | static PIT8253_OUTPUT_CHANGED( v_irq3_w ); |
| 24 | static void update_irq( | |
| 23 | static void update_irq(running_machine *machine); | |
| 25 | 24 | |
| 26 | 25 | |
| 27 | 26 | |
| r3957 | r3958 | |
| 75 | 74 | * |
| 76 | 75 | *************************************/ |
| 77 | 76 | |
| 78 | static void update_irq( | |
| 77 | static void update_irq(running_machine *machine) | |
| 79 | 78 | { |
| 80 | 79 | if (irq_state < 7) |
| 81 | cpu_set_input_line( | |
| 80 | cpu_set_input_line(machine->cpu[0], irq_state ^ 7, CLEAR_LINE); | |
| 82 | 81 | |
| 83 | 82 | irq_state = TTL74148_output_r(0); |
| 84 | 83 | |
| 85 | 84 | if (irq_state < 7) |
| 86 | cpu_set_input_line( | |
| 85 | cpu_set_input_line(machine->cpu[0], irq_state ^ 7, ASSERT_LINE); | |
| 87 | 86 | } |
| 88 | 87 | |
| 89 | 88 | |
| 90 | static void update_irq_encoder(int line, int state) | |
| 89 | static void update_irq_encoder(running_machine *machine, int line, int state) | |
| 91 | 90 | { |
| 92 | 91 | TTL74148_input_line_w(0, line, !state); |
| 93 | TTL74148_update(0); | |
| 92 | TTL74148_update(machine, 0); | |
| 94 | 93 | } |
| 95 | 94 | |
| 96 | 95 | |
| 97 | 96 | static PIT8253_OUTPUT_CHANGED( v_irq4_w ) |
| 98 | 97 | { |
| 99 | update_irq_encoder(INPUT_LINE_IRQ4, state); | |
| 98 | update_irq_encoder(device->machine, INPUT_LINE_IRQ4, state); | |
| 100 | 99 | vertigo_vproc(cpu_attotime_to_clocks(device->machine->cpu[0], attotime_sub(timer_get_time(device->machine), irq4_time)), state); |
| 101 | 100 | irq4_time = timer_get_time(device->machine); |
| 102 | 101 | } |
| r3957 | r3958 | |
| 107 | 106 | if (state) |
| 108 | 107 | cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_IRQ0, ASSERT_LINE); |
| 109 | 108 | |
| 110 | update_irq_encoder(INPUT_LINE_IRQ3, state); | |
| 109 | update_irq_encoder(device->machine, INPUT_LINE_IRQ3, state); | |
| 111 | 110 | } |
| 112 | 111 | |
| 113 | 112 | |
| r3957 | r3958 | |
| 127 | 126 | else |
| 128 | 127 | adc_result = input_port_read(space->machine, adcnames[offset]); |
| 129 | 128 | |
| 130 | update_irq_encoder(INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 129 | update_irq_encoder(space->machine, INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 131 | 130 | return 0; |
| 132 | 131 | } |
| 133 | 132 | |
| 134 | 133 | |
| 135 | 134 | READ16_HANDLER( vertigo_io_adc ) |
| 136 | 135 | { |
| 137 | update_irq_encoder(INPUT_LINE_IRQ2, CLEAR_LINE); | |
| 136 | update_irq_encoder(space->machine, INPUT_LINE_IRQ2, CLEAR_LINE); | |
| 138 | 137 | return adc_result; |
| 139 | 138 | } |
| 140 | 139 | |
| 141 | 140 | |
| 142 | 141 | READ16_HANDLER( vertigo_coin_r ) |
| 143 | 142 | { |
| 144 | update_irq_encoder(INPUT_LINE_IRQ6, CLEAR_LINE); | |
| 143 | update_irq_encoder(space->machine, INPUT_LINE_IRQ6, CLEAR_LINE); | |
| 145 | 144 | return (input_port_read(space->machine, "COIN")); |
| 146 | 145 | } |
| 147 | 146 | |
| r3957 | r3958 | |
| 150 | 149 | { |
| 151 | 150 | /* Coin inputs cause IRQ6 */ |
| 152 | 151 | if ((input_port_read(device->machine, "COIN") & 0x7) < 0x7) |
| 153 | update_irq_encoder(INPUT_LINE_IRQ6, ASSERT_LINE); | |
| 152 | update_irq_encoder(device->machine, INPUT_LINE_IRQ6, ASSERT_LINE); | |
| 154 | 153 | } |
| 155 | 154 | |
| 156 | 155 | |
| r3957 | r3958 | |
| 218 | 217 | for (i = 0; i < 8; i++) |
| 219 | 218 | TTL74148_input_line_w(0, i, 1); |
| 220 | 219 | |
| 221 | TTL74148_update(0); | |
| 220 | TTL74148_update(machine, 0); | |
| 222 | 221 | vertigo_vproc_init(machine); |
| 223 | 222 | |
| 224 | 223 | irq4_time = timer_get_time(machine); |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "deprecat.h" | |
| 25 | 24 | #include "machine/pcshare.h" |
| 26 | 25 | #include "machine/pckeybrd.h" |
| 27 | 26 | |
| 28 | 27 | #define VERBOSE_DBG 0 /* general debug messages */ |
| 29 | 28 | #define DBG_LOG(N,M,A) \ |
| 30 | if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time( | |
| 29 | if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time(pc_keyb.machine)),(char*)M ); logerror A; } | |
| 31 | 30 | |
| 32 | 31 | #define VERBOSE_JOY 0 /* JOY (joystick port) */ |
| 33 | 32 | #define JOY_LOG(N,M,A) \ |
| 34 | if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time( | |
| 33 | if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time(pc_keyb.machine)),(char*)M ); logerror A; } | |
| 35 | 34 | |
| 36 | 35 | |
| 37 | static emu_timer *pc_keyboard_timer; | |
| 38 | static void (*set_keyb_int)(int); | |
| 39 | 36 | static TIMER_CALLBACK( pc_keyb_timer ); |
| 40 | 37 | |
| 38 | /* | |
| 39 | keyboard seams to permanently sent data clocked by the mainboard | |
| 40 | clock line low for longer means "resync", keyboard sends 0xaa as answer | |
| 41 | will become automatically 0x00 after a while | |
| 42 | */ | |
| 41 | 43 | |
| 42 | void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(int)) | |
| 44 | static struct { | |
| 45 | running_machine *machine; | |
| 46 | void (*int_cb)(running_machine *, int); | |
| 47 | emu_timer *timer; | |
| 48 | UINT8 data; | |
| 49 | int on; | |
| 50 | int self_test; | |
| 51 | } pc_keyb; | |
| 52 | ||
| 53 | ||
| 54 | ||
| 55 | void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int)) | |
| 43 | 56 | { |
| 44 | 57 | /* PC-XT keyboard */ |
| 45 | 58 | if (flags & PCCOMMON_KEYBOARD_AT) |
| r3957 | r3958 | |
| 48 | 61 | at_keyboard_init(machine, AT_KEYBOARD_TYPE_PC); |
| 49 | 62 | at_keyboard_set_scan_code_set(1); |
| 50 | 63 | |
| 51 | set_keyb_int = set_keyb_int_func; | |
| 52 | ||
| 53 | pc_keyboard_timer = timer_alloc(machine, pc_keyb_timer, NULL); | |
| 64 | memset(&pc_keyb, 0, sizeof(pc_keyb)); | |
| 65 | pc_keyb.machine = machine; | |
| 66 | pc_keyb.int_cb = set_keyb_int_func; | |
| 67 | pc_keyb.timer = timer_alloc(machine, pc_keyb_timer, NULL); | |
| 54 | 68 | } |
| 55 | 69 | |
| 56 | /* | |
| 57 | keyboard seams to permanently sent data clocked by the mainboard | |
| 58 | clock line low for longer means "resync", keyboard sends 0xaa as answer | |
| 59 | will become automatically 0x00 after a while | |
| 60 | */ | |
| 61 | ||
| 62 | static struct { | |
| 63 | UINT8 data; | |
| 64 | int on; | |
| 65 | int self_test; | |
| 66 | } pc_keyb= { 0 }; | |
| 67 | ||
| 68 | 70 | UINT8 pc_keyb_read(void) |
| 69 | 71 | { |
| 70 | 72 | return pc_keyb.data; |
| r3957 | r3958 | |
| 92 | 94 | if (pc_keyb.on != on) |
| 93 | 95 | { |
| 94 | 96 | if (!on) |
| 95 | timer_adjust_oneshot(pc_keyb | |
| 97 | timer_adjust_oneshot(pc_keyb. | |
| 96 | 98 | else { |
| 97 | 99 | if ( pc_keyb.self_test ) { |
| 98 | 100 | /* The self test of the keyboard takes some time. 2 msec seems to work. */ |
| 99 | 101 | /* This still needs to verified against a real keyboard. */ |
| 100 | timer_adjust_oneshot(pc_keyb | |
| 102 | timer_adjust_oneshot(pc_keyb. | |
| 101 | 103 | } else { |
| 102 | timer_reset(pc_keyb | |
| 104 | timer_reset(pc_keyb. | |
| 103 | 105 | pc_keyb.self_test = 0; |
| 104 | 106 | } |
| 105 | 107 | } |
| r3957 | r3958 | |
| 111 | 113 | void pc_keyb_clear(void) |
| 112 | 114 | { |
| 113 | 115 | pc_keyb.data = 0; |
| 114 | if ( set_keyb_int ) { | |
| 115 | set_keyb_int(0); | |
| 116 | if ( pc_keyb.int_cb ) { | |
| 117 | pc_keyb.int_cb(pc_keyb.machine, 0); | |
| 116 | 118 | } |
| 117 | 119 | } |
| 118 | 120 | |
| r3957 | r3958 | |
| 127 | 129 | if ( (data=at_keyboard_read())!=-1) { |
| 128 | 130 | pc_keyb.data = data; |
| 129 | 131 | DBG_LOG(1,"KB_scancode",("$%02x\n", pc_keyb.data)); |
| 130 | if ( set_keyb_int ) { | |
| 131 | set_keyb_int(1); | |
| 132 | if ( pc_keyb.int_cb ) { | |
| 133 | pc_keyb.int_cb(pc_keyb.machine, 1); | |
| 132 | 134 | } |
| 133 | 135 | pc_keyb.self_test = 0; |
| 134 | 136 | } |
| r3957 | r3958 | |
|---|---|---|
| 535 | 535 | slapstic and sets the chip number. |
| 536 | 536 | ---------------------------------------------------------------*/ |
| 537 | 537 | |
| 538 | void atarigen_slapstic_init( | |
| 538 | void atarigen_slapstic_init(const device_ | |
| 539 | 539 | { |
| 540 | 540 | /* reset in case we have no state */ |
| 541 | 541 | atarigen_slapstic_num = chipnum; |
| r3957 | r3958 | |
| 545 | 545 | if (chipnum != 0) |
| 546 | 546 | { |
| 547 | 547 | /* initialize the slapstic */ |
| 548 | slapstic_init(machine, chipnum); | |
| 548 | slapstic_init(device->machine, chipnum); | |
| 549 | 549 | |
| 550 | 550 | /* install the memory handlers */ |
| 551 | atarigen_slapstic = memory_install_readwrite16_handler(cpu_get_address_space( | |
| 551 | atarigen_slapstic = memory_install_readwrite16_handler(cpu_get_address_space(d | |
| 552 | 552 | |
| 553 | 553 | /* allocate memory for a copy of bank 0 */ |
| 554 | 554 | atarigen_slapstic_bank0 = auto_malloc(0x2000); |
| r3957 | r3958 | |
| 560 | 560 | /* install an opcode base handler if we are a 68000 or variant */ |
| 561 | 561 | atarigen_slapstic_base = base; |
| 562 | 562 | atarigen_slapstic_mirror = mirror; |
| 563 | memory_set_direct_update_handler(cpu_get_address_space( | |
| 563 | memory_set_direct_update_handler(cpu_get_address_space(d | |
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | #include "machine/zs01.h" |
| 13 | 12 | |
| 14 | 13 | #define VERBOSE_LEVEL ( 0 ) |
| r3957 | r3958 | |
| 67 | 66 | #define STATE_LOAD_COMMAND ( 2 ) |
| 68 | 67 | #define STATE_READ_DATA ( 3 ) |
| 69 | 68 | |
| 70 | void zs01_init( int chip, UINT8 *data, zs01_write_handler write, zs01_read_handler read, UINT8 *ds2401 ) | |
| 69 | void zs01_init( running_machine *machine, int chip, UINT8 *data, zs01_write_handler write, zs01_read_handler read, UINT8 *ds2401 ) | |
| 71 | 70 | { |
| 72 | running_machine *machine = Machine; | |
| 73 | 71 | int offset; |
| 74 | 72 | struct zs01_chip *c; |
| 75 | 73 | |
| r3957 | r3958 | |
| 134 | 132 | state_save_register_item_pointer( machine, "zs01", NULL, chip, c->data_key, SIZE_DATA ); |
| 135 | 133 | } |
| 136 | 134 | |
| 137 | void zs01_rst_write( int chip, int rst ) | |
| 135 | void zs01_rst_write( running_machine *machine, int chip, int rst ) | |
| 138 | 136 | { |
| 139 | running_machine *machine = Machine; | |
| 140 | 137 | struct zs01_chip *c; |
| 141 | 138 | |
| 142 | 139 | if( chip >= ZS01_MAXCHIP ) |
| r3957 | r3958 | |
| 161 | 158 | c->rst = rst; |
| 162 | 159 | } |
| 163 | 160 | |
| 164 | void zs01_cs_write( int chip, int cs ) | |
| 161 | void zs01_cs_write( running_machine *machine, int chip, int cs ) | |
| 165 | 162 | { |
| 166 | running_machine *machine = Machine; | |
| 167 | 163 | struct zs01_chip *c; |
| 168 | 164 | |
| 169 | 165 | if( chip >= ZS01_MAXCHIP ) |
| r3957 | r3958 | |
| 391 | 387 | return block * SIZE_DATA_BUFFER; |
| 392 | 388 | } |
| 393 | 389 | |
| 394 | void zs01_scl_write( int chip, int scl ) | |
| 390 | void zs01_scl_write( running_machine *machine, int chip, int scl ) | |
| 395 | 391 | { |
| 396 | running_machine *machine = Machine; | |
| 397 | 392 | struct zs01_chip *c; |
| 398 | 393 | |
| 399 | 394 | if( chip >= ZS01_MAXCHIP ) |
| r3957 | r3958 | |
| 601 | 596 | c->scl = scl; |
| 602 | 597 | } |
| 603 | 598 | |
| 604 | void zs01_sda_write( int chip, int sda ) | |
| 599 | void zs01_sda_write( running_machine *machine, int chip, int sda ) | |
| 605 | 600 | { |
| 606 | running_machine *machine = Machine; | |
| 607 | 601 | struct zs01_chip *c; |
| 608 | 602 | |
| 609 | 603 | if( chip >= ZS01_MAXCHIP ) |
| r3957 | r3958 | |
| 649 | 643 | c->sdaw = sda; |
| 650 | 644 | } |
| 651 | 645 | |
| 652 | int zs01_sda_read( int chip ) | |
| 646 | int zs01_sda_read( running_machine *machine, int chip ) | |
| 653 | 647 | { |
| 654 | running_machine *machine = Machine; | |
| 655 | 648 | struct zs01_chip *c; |
| 656 | 649 | |
| 657 | 650 | if( chip >= ZS01_MAXCHIP ) |
| r3957 | r3958 | |
|---|---|---|
| 134 | 134 | SLAPSTIC HANDLING |
| 135 | 135 | ---------------------------------------------------------------*/ |
| 136 | 136 | |
| 137 | void atarigen_slapstic_init( | |
| 137 | void atarigen_slapstic_init(const device_ | |
| 138 | 138 | void atarigen_slapstic_reset(void); |
| 139 | 139 | |
| 140 | 140 | WRITE16_HANDLER( atarigen_slapstic_w ); |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | **************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "cpu/tms34010/tms34010.h" |
| 10 | 9 | #include "cpu/m6809/m6809.h" |
| 11 | 10 | #include "audio/dcs.h" |
| r3957 | r3958 | |
| 30 | 29 | |
| 31 | 30 | /* prototype */ |
| 32 | 31 | static READ16_HANDLER( midwunit_sound_state_r ); |
| 33 | static void midxunit_dcs_output_full(int state); | |
| 32 | static void midxunit_dcs_output_full(running_machine *machine, int state); | |
| 34 | 33 | |
| 35 | 34 | |
| 36 | 35 | |
| r3957 | r3958 | |
| 254 | 253 | * |
| 255 | 254 | *************************************/ |
| 256 | 255 | |
| 257 | void midxunit_dcs_output_full(int state) | |
| 256 | static void midxunit_dcs_output_full(running_machine *machine, int state) | |
| 258 | 257 | { |
| 259 | 258 | /* only signal if not in loopback state */ |
| 260 | 259 | if (uart[1] != 0x66) |
| 261 | cpu_set_input_line( | |
| 260 | cpu_set_input_line(machine->cpu[0], 1, state ? ASSERT_LINE : CLEAR_LINE); | |
| 262 | 261 | } |
| 263 | 262 | |
| 264 | 263 | |
| r3957 | r3958 | |
| 647 | 646 | |
| 648 | 647 | READ16_HANDLER( midwunit_security_r ) |
| 649 | 648 | { |
| 650 | return midway_serial_pic_r(); | |
| 649 | return midway_serial_pic_r(space); | |
| 651 | 650 | } |
| 652 | 651 | |
| 653 | 652 | |
| 654 | 653 | WRITE16_HANDLER( midwunit_security_w ) |
| 655 | 654 | { |
| 656 | 655 | if (offset == 0 && ACCESSING_BITS_0_7) |
| 657 | midway_serial_pic_w(data); | |
| 656 | midway_serial_pic_w(space, data); | |
| 658 | 657 | } |
| 659 | 658 | |
| 660 | 659 | |
| r3957 | r3958 | |
| 668 | 667 | WRITE16_HANDLER( midxunit_security_clock_w ) |
| 669 | 668 | { |
| 670 | 669 | if (offset == 0 && ACCESSING_BITS_0_7) |
| 671 | midway_serial_pic_w(((~data & 2) << 3) | security_bits); | |
| 670 | midway_serial_pic_w(space, ((~data & 2) << 3) | security_bits); | |
| 672 | 671 | } |
| 673 | 672 | |
| 674 | 673 |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #define ZS01_MAXCHIP ( 2 ) |
| 11 | 11 | |
| 12 | typedef void (*zs01_write_handler)( int pin, int value ); | |
| 13 | typedef int (*zs01_read_handler)( int pin ); | |
| 12 | typedef void (*zs01_write_handler)( running_machine *machine, int pin, int value ); | |
| 13 | typedef int (*zs01_read_handler)( running_machine *machine, int pin ); | |
| 14 | 14 | |
| 15 | extern void zs01_init( int chip, UINT8 *data, zs01_write_handler write, zs01_read_handler read, UINT8 *ds2401 ); | |
| 16 | extern void zs01_cs_write( int chip, int cs ); | |
| 17 | extern void zs01_rst_write( int chip, int rst ); | |
| 18 | extern void zs01_scl_write( int chip, int scl ); | |
| 19 | extern void zs01_sda_write( int chip, int sda ); | |
| 20 | extern int zs01_sda_read( int chip ); | |
| 15 | extern void zs01_init( running_machine *machine, int chip, UINT8 *data, zs01_write_handler write, zs01_read_handler read, UINT8 *ds2401 ); | |
| 16 | extern void zs01_cs_write( running_machine *machine, int chip, int cs ); | |
| 17 | extern void zs01_rst_write( running_machine *machine, int chip, int rst ); | |
| 18 | extern void zs01_scl_write( running_machine *machine, int chip, int scl ); | |
| 19 | extern void zs01_sda_write( running_machine *machine, int chip, int sda ); | |
| 20 | extern int zs01_sda_read( running_machine *machine, int chip ); | |
| 21 | 21 | extern NVRAM_HANDLER( zs01_0 ); |
| 22 | 22 | extern NVRAM_HANDLER( zs01_1 ); |
| 23 | 23 |
| r3957 | r3958 | |
|---|---|---|
| 224 | 224 | { |
| 225 | 225 | UINT64 ret; |
| 226 | 226 | |
| 227 | ret = x76f100_sda_read( 0 ) << 15; | |
| 227 | ret = x76f100_sda_read( device->machine, 0 ) << 15; | |
| 228 | 228 | |
| 229 | 229 | return ret << 32; |
| 230 | 230 | } |
| r3957 | r3958 | |
| 273 | 273 | } |
| 274 | 274 | else if ((offset == 15) && ACCESSING_BITS_0_15) |
| 275 | 275 | { |
| 276 | running_machine *machine = device->machine; | |
| 277 | ||
| 276 | 278 | // NAOMI_BOARDID_WRITE |
| 277 | x76f100_cs_write(0, (data >> 2) & 1 ); | |
| 278 | x76f100_rst_write(0, (data >> 3) & 1 ); | |
| 279 | x76f100_scl_write(0, (data >> 1) & 1 ); | |
| 280 | x76f100_sda_write(0, (data >> 0) & 1 ); | |
| 279 | x76f100_cs_write(machine, 0, (data >> 2) & 1 ); | |
| 280 | x76f100_rst_write(machine, 0, (data >> 3) & 1 ); | |
| 281 | x76f100_scl_write(machine, 0, (data >> 1) & 1 ); | |
| 282 | x76f100_sda_write(machine, 0, (data >> 0) & 1 ); | |
| 281 | 283 | } |
| 282 | 284 | else if ((offset == 2) && ACCESSING_BITS_32_63) |
| 283 | 285 | { |
| r3957 | r3958 | |
| 629 | 631 | switch (config->type) |
| 630 | 632 | { |
| 631 | 633 | default: |
| 632 | case ROM_BOARD: info->s = "Naomi Rom Board"; break; | |
| 633 | case DIMM_BOARD: info->s = "Naomi Dimm Board"; break; | |
| 634 | case ROM_BOARD: strcpy(info->s, "Naomi Rom Board"); break; | |
| 635 | case DIMM_BOARD: strcpy(info->s, "Naomi Dimm Board"); break; | |
| 634 | 636 | } |
| 635 | 637 | break; |
| 636 | case DEVINFO_STR_FAMILY: info->s = "Naomi plug-in board"; break; | |
| 637 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 638 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 639 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 638 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Naomi plug-in board"); break; | |
| 639 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 640 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 641 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 640 | 642 | } |
| 641 | 643 | } |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | #include "driver.h" |
| 7 | #include "deprecat.h" | |
| 8 | 7 | #include "debugger.h" |
| 9 | 8 | #include "machine/8255ppi.h" |
| 10 | 9 | #include "tx1.h" |
| r3957 | r3958 | |
| 188 | 187 | SN74S516.ZWfl = 0; |
| 189 | 188 | } |
| 190 | 189 | |
| 191 | static void sn_divide( | |
| 190 | static void sn_divide(running_machine *machine) | |
| 192 | 191 | { |
| 193 | 192 | INT32 Z = 0; |
| 194 | 193 | INT32 W = 0; |
| 195 | 194 | |
| 196 | 195 | if ( SN74S516.X == 0 ) |
| 197 | 196 | { |
| 198 | mame_printf_debug("%s:SN74S516 tried to divide by zero\n", cpuexec_describe_context( | |
| 197 | mame_printf_debug("%s:SN74S516 tried to divide by zero\n", cpuexec_describe_context(machine)); | |
| 199 | 198 | SN74S516.ZW.Z = 0xffff; |
| 200 | 199 | SN74S516.ZW.W = 0xffff; |
| 201 | 200 | SN74S516.ZWfl = 0; |
| r3957 | r3958 | |
| 237 | 236 | SN74S516.ZWfl = 0; |
| 238 | 237 | } |
| 239 | 238 | |
| 240 | static void sn74s516_update(c | |
| 239 | static void sn74s516_update(running_machine *machine, int ins) | |
| 241 | 240 | { |
| 242 | 241 | SN74S516.state = state_table[SN74S516.state][ins]; |
| 243 | 242 | |
| r3957 | r3958 | |
| 248 | 247 | } |
| 249 | 248 | else if ( SN74S516.state == 5 ) |
| 250 | 249 | { |
| 251 | sn_divide(); | |
| 250 | sn_divide(machine); | |
| 252 | 251 | SN74S516.state = 10; |
| 253 | 252 | } |
| 254 | 253 | } |
| 255 | 254 | |
| 256 | static void kick_sn74s516(UINT16 *data, const int ins) | |
| 255 | static void kick_sn74s516(running_machine *machine, UINT16 *data, const int ins) | |
| 257 | 256 | { |
| 258 | 257 | |
| 259 | 258 | #define LOAD_X (SN74S516.X = *data) |
| r3957 | r3958 | |
| 279 | 278 | if (ins < 4) |
| 280 | 279 | { |
| 281 | 280 | LOAD_Y; |
| 282 | sn74s516_update(ins); | |
| 281 | sn74s516_update(machine, ins); | |
| 283 | 282 | } |
| 284 | 283 | else if (ins == 4) |
| 285 | 284 | { |
| 286 | sn74s516_update(ins); | |
| 285 | sn74s516_update(machine, ins); | |
| 287 | 286 | } |
| 288 | 287 | else if (ins < 7) |
| 289 | 288 | { |
| 290 | 289 | LOAD_X; |
| 291 | sn74s516_update(ins); | |
| 290 | sn74s516_update(machine, ins); | |
| 292 | 291 | } |
| 293 | 292 | else if (ins == 7) |
| 294 | 293 | { |
| r3957 | r3958 | |
| 307 | 306 | if (ins < 4) |
| 308 | 307 | { |
| 309 | 308 | LOAD_Y; |
| 310 | sn74s516_update(ins); | |
| 309 | sn74s516_update(machine, ins); | |
| 311 | 310 | } |
| 312 | 311 | else if (ins == 4) |
| 313 | 312 | { |
| 314 | sn74s516_update(ins); | |
| 313 | sn74s516_update(machine, ins); | |
| 315 | 314 | } |
| 316 | 315 | else if (ins == 5) |
| 317 | 316 | { |
| 318 | 317 | // Rounding |
| 319 | 318 | // Operation |
| 320 | sn74s516_update(ins); | |
| 319 | sn74s516_update(machine, ins); | |
| 321 | 320 | } |
| 322 | 321 | else if (ins == 6) |
| 323 | 322 | { |
| 324 | 323 | LOAD_X; |
| 325 | sn74s516_update(ins); | |
| 324 | sn74s516_update(machine, ins); | |
| 326 | 325 | } |
| 327 | 326 | else if (ins == 7) |
| 328 | 327 | { |
| 329 | 328 | READ_ZW; |
| 330 | sn74s516_update(ins); | |
| 329 | sn74s516_update(machine, ins); | |
| 331 | 330 | } |
| 332 | 331 | break; |
| 333 | 332 | } |
| r3957 | r3958 | |
| 337 | 336 | if (SN74S516.code == 0x6666) |
| 338 | 337 | { |
| 339 | 338 | CLEAR_SEQUENCE; |
| 340 | mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", cpuexec_describe_context( | |
| 339 | mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", cpuexec_describe_context(machine), math.promaddr); | |
| 341 | 340 | } |
| 342 | 341 | |
| 343 | 342 | UPDATE_SEQUENCE; |
| 344 | 343 | if (ins < 4) |
| 345 | 344 | { |
| 346 | 345 | LOAD_Y; |
| 347 | sn74s516_update(ins); | |
| 346 | sn74s516_update(machine, ins); | |
| 348 | 347 | } |
| 349 | 348 | else if (ins < 6) |
| 350 | 349 | { |
| 351 | sn74s516_update(ins); | |
| 350 | sn74s516_update(machine, ins); | |
| 352 | 351 | } |
| 353 | 352 | else if (ins == 6) |
| 354 | 353 | { |
| 355 | 354 | LOAD_Z; |
| 356 | sn74s516_update(ins); | |
| 355 | sn74s516_update(machine, ins); | |
| 357 | 356 | } |
| 358 | 357 | else if (ins == 7) |
| 359 | 358 | { |
| 360 | 359 | // Pointless operation. |
| 361 | sn74s516_update(ins); | |
| 360 | sn74s516_update(machine, ins); | |
| 362 | 361 | } |
| 363 | 362 | |
| 364 | 363 | break; |
| r3957 | r3958 | |
| 369 | 368 | if (ins < 4) |
| 370 | 369 | { |
| 371 | 370 | LOAD_Y; |
| 372 | sn74s516_update(ins); | |
| 371 | sn74s516_update(machine, ins); | |
| 373 | 372 | } |
| 374 | 373 | else if (ins == 4) |
| 375 | 374 | { |
| 376 | 375 | LOAD_W; |
| 377 | sn74s516_update(ins); | |
| 376 | sn74s516_update(machine, ins); | |
| 378 | 377 | } |
| 379 | 378 | else if (ins == 5) |
| 380 | 379 | { |
| 381 | sn74s516_update(ins); | |
| 380 | sn74s516_update(machine, ins); | |
| 382 | 381 | } |
| 383 | 382 | else if (ins == 6) |
| 384 | 383 | { |
| 385 | 384 | LOAD_W; |
| 386 | sn74s516_update(ins); | |
| 385 | sn74s516_update(machine, ins); | |
| 387 | 386 | } |
| 388 | 387 | else if (ins == 7) |
| 389 | 388 | { |
| 390 | 389 | READ_ZW; |
| 391 | sn74s516_update(ins); | |
| 390 | sn74s516_update(machine, ins); | |
| 392 | 391 | } |
| 393 | 392 | break; |
| 394 | 393 | } |
| r3957 | r3958 | |
| 398 | 397 | if (ins < 4) |
| 399 | 398 | { |
| 400 | 399 | LOAD_Y; |
| 401 | sn74s516_update(ins); | |
| 400 | sn74s516_update(machine, ins); | |
| 402 | 401 | } |
| 403 | 402 | else if (ins < 6) |
| 404 | 403 | { |
| 405 | sn74s516_update(ins); | |
| 404 | sn74s516_update(machine, ins); | |
| 406 | 405 | } |
| 407 | 406 | else if (ins == 6) |
| 408 | 407 | { |
| 409 | 408 | // CHECK: Incomplete state |
| 410 | sn74s516_update(ins); | |
| 409 | sn74s516_update(machine, ins); | |
| 411 | 410 | } |
| 412 | 411 | else if (ins == 7) |
| 413 | 412 | { |
| 414 | 413 | /* 6667 = Load X, Load Z, Load W, Clear Z */ |
| 415 | 414 | SN74S516.ZW.Z = 0; |
| 416 | sn74s516_update(ins); | |
| 415 | sn74s516_update(machine, ins); | |
| 417 | 416 | } |
| 418 | 417 | break; |
| 419 | 418 | } |
| r3957 | r3958 | |
| 424 | 423 | } |
| 425 | 424 | |
| 426 | 425 | math.dbgaddr = math.promaddr; |
| 427 | math.dbgpc = cpu_get_previouspc( | |
| 426 | math.dbgpc = cpu_get_previouspc(machine->cpu[1]); | |
| 428 | 427 | } |
| 429 | 428 | |
| 430 | 429 | |
| r3957 | r3958 | |
| 548 | 547 | else if ( dsel == 3 ) |
| 549 | 548 | data = ROL16(SWAP16(math.muxlatch), 3); |
| 550 | 549 | |
| 551 | kick_sn74s516(&data, ins); | |
| 550 | kick_sn74s516(machine, &data, ins); | |
| 552 | 551 | } |
| 553 | 552 | /* |
| 554 | 553 | TODO: Changed ppshift to muxlatch for TX-1 |
| r3957 | r3958 | |
| 564 | 563 | { |
| 565 | 564 | UINT16 data; |
| 566 | 565 | |
| 567 | kick_sn74s516(&data, ins); | |
| 566 | kick_sn74s516(machine, &data, ins); | |
| 568 | 567 | |
| 569 | 568 | /* All latches enabled */ |
| 570 | 569 | if ( LHIEN(math.inslatch) && LLOEN(math.inslatch) ) |
| r3957 | r3958 | |
| 638 | 637 | { |
| 639 | 638 | if ( math.mux == TX1_SEL_PPSEN ) |
| 640 | 639 | { |
| 641 | kick_sn74s516(&math.ppshift, ins); | |
| 640 | kick_sn74s516(machine, &math.ppshift, ins); | |
| 642 | 641 | } |
| 643 | 642 | else |
| 644 | 643 | { |
| 645 | 644 | /* Bus pullups give 0xffff */ |
| 646 | 645 | UINT16 data = 0xffff; |
| 647 | kick_sn74s516(&data, ins); | |
| 646 | kick_sn74s516(machine, &data, ins); | |
| 648 | 647 | } |
| 649 | 648 | } |
| 650 | 649 | } |
| r3957 | r3958 | |
| 677 | 676 | } |
| 678 | 677 | |
| 679 | 678 | /* TODO What do we return? */ |
| 680 | kick_sn74s516(&math.retval, ins); | |
| 679 | kick_sn74s516(space->machine, &math.retval, ins); | |
| 681 | 680 | } |
| 682 | 681 | /* /PPSEN */ |
| 683 | 682 | else if ( offset < 0x800 ) |
| r3957 | r3958 | |
| 794 | 793 | ins = (offset >> 1) & 7; |
| 795 | 794 | } |
| 796 | 795 | |
| 797 | kick_sn74s516(&math.cpulatch, ins); | |
| 796 | kick_sn74s516(space->machine, &math.cpulatch, ins); | |
| 798 | 797 | } |
| 799 | 798 | /* /PPSEN */ |
| 800 | 799 | else if ( (offset & 0xc00) == 0x400 ) |
| r3957 | r3958 | |
| 872 | 871 | int ins = math.inslatch & 7; |
| 873 | 872 | |
| 874 | 873 | TX1_SET_INS0_BIT; |
| 875 | kick_sn74s516(&math.cpulatch, ins); | |
| 874 | kick_sn74s516(space->machine, &math.cpulatch, ins); | |
| 876 | 875 | } |
| 877 | 876 | else if ( math.mux == TX1_SEL_PPSEN ) |
| 878 | 877 | { |
| r3957 | r3958 | |
| 936 | 935 | int ins = math.inslatch & 7; |
| 937 | 936 | |
| 938 | 937 | TX1_SET_INS0_BIT; |
| 939 | kick_sn74s516(&math.cpulatch, ins); | |
| 938 | kick_sn74s516(space->machine, &math.cpulatch, ins); | |
| 940 | 939 | } |
| 941 | 940 | else if ( math.mux == TX1_SEL_PPSEN ) |
| 942 | 941 | { |
| r3957 | r3958 | |
| 1071 | 1070 | { |
| 1072 | 1071 | UINT16 *romdata = (UINT16*)memory_region(machine, "user1"); |
| 1073 | 1072 | UINT16 addr = get_bb_datarom_addr(); |
| 1074 | kick_sn74s516(&romdata[addr], ins); | |
| 1073 | kick_sn74s516(machine, &romdata[addr], ins); | |
| 1075 | 1074 | } |
| 1076 | 1075 | else if ( math.mux == BB_MUX_PPOE ) |
| 1077 | 1076 | { |
| 1078 | kick_sn74s516(&math.ppshift, ins); | |
| 1077 | kick_sn74s516(machine, &math.ppshift, ins); | |
| 1079 | 1078 | } |
| 1080 | 1079 | /* This is quite tricky. */ |
| 1081 | 1080 | /* It can either be a read operation or */ |
| r3957 | r3958 | |
| 1084 | 1083 | { |
| 1085 | 1084 | UINT16 data; |
| 1086 | 1085 | |
| 1087 | kick_sn74s516(&data, ins); | |
| 1086 | kick_sn74s516(machine, &data, ins); | |
| 1088 | 1087 | |
| 1089 | 1088 | if ( LHIEN(math.inslatch) && LLOEN(math.inslatch) ) |
| 1090 | 1089 | { |
| r3957 | r3958 | |
| 1121 | 1120 | { |
| 1122 | 1121 | if ( math.mux == BB_MUX_PPSEN ) |
| 1123 | 1122 | { |
| 1124 | kick_sn74s516(&math.ppshift, ins); | |
| 1123 | kick_sn74s516(machine, &math.ppshift, ins); | |
| 1125 | 1124 | } |
| 1126 | 1125 | else |
| 1127 | 1126 | { |
| 1128 | 1127 | /* Bus pullups give 0xffff */ |
| 1129 | 1128 | UINT16 data = 0xffff; |
| 1130 | kick_sn74s516(&data, ins); | |
| 1129 | kick_sn74s516(machine, &data, ins); | |
| 1131 | 1130 | } |
| 1132 | 1131 | } |
| 1133 | 1132 | } |
| r3957 | r3958 | |
| 1170 | 1169 | } |
| 1171 | 1170 | |
| 1172 | 1171 | /* TODO What do we return? */ |
| 1173 | kick_sn74s516(&math.retval, ins); | |
| 1172 | kick_sn74s516(space->machine, &math.retval, ins); | |
| 1174 | 1173 | |
| 1175 | 1174 | /* TODO */ |
| 1176 | 1175 | //if (math.mux == BB_MUX_PPSEN) |
| r3957 | r3958 | |
| 1247 | 1246 | ins = (offset >> 1) & 7; |
| 1248 | 1247 | } |
| 1249 | 1248 | |
| 1250 | kick_sn74s516(&math.cpulatch, ins); | |
| 1249 | kick_sn74s516(space->machine, &math.cpulatch, ins); | |
| 1251 | 1250 | } |
| 1252 | 1251 | /* /PPSEN */ |
| 1253 | 1252 | else if ( (offset & 0xc00) == 0x400 ) |
| r3957 | r3958 | |
| 1326 | 1325 | int ins = math.inslatch & 7; |
| 1327 | 1326 | |
| 1328 | 1327 | BB_SET_INS0_BIT; |
| 1329 | kick_sn74s516(&math.cpulatch, ins); | |
| 1328 | kick_sn74s516(space->machine, &math.cpulatch, ins); | |
| 1330 | 1329 | } |
| 1331 | 1330 | else if ( math.mux == BB_MUX_PPSEN ) |
| 1332 | 1331 | { |
| r3957 | r3958 | |
| 1394 | 1393 | int ins = math.inslatch & 7; |
| 1395 | 1394 | |
| 1396 | 1395 | BB_SET_INS0_BIT; |
| 1397 | kick_sn74s516(&math.cpulatch, ins); | |
| 1396 | kick_sn74s516(space->machine, &math.cpulatch, ins); | |
| 1398 | 1397 | } |
| 1399 | 1398 | else if ( math.mux == BB_MUX_PPSEN ) |
| 1400 | 1399 | { |
| r3957 | r3958 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | const z80ctc_interface mcr_ctc_intf = |
| 220 | 220 | { |
| 221 | "main", /* clock from the main CPU */ | |
| 222 | 0, /* clock (filled in from the CPU 0 clock) */ | |
| 223 | 221 | 0, /* timer disables */ |
| 224 | 222 | ctc_interrupt, /* interrupt handler */ |
| 225 | 223 | z80ctc_trg1_w, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 230 | 228 | |
| 231 | 229 | const z80ctc_interface nflfoot_ctc_intf = |
| 232 | 230 | { |
| 233 | "ipu", /* clock from the IPU cpu */ | |
| 234 | 0, /* clock (filled in from the CPU 3 clock) */ | |
| 235 | 231 | 0, /* timer disables */ |
| 236 | 232 | ipu_ctc_interrupt, /* interrupt handler */ |
| 237 | 233 | 0, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 254 | 250 | |
| 255 | 251 | const z80sio_interface nflfoot_sio_intf = |
| 256 | 252 | { |
| 257 | "ipu", /* clock from the IPU cpu */ | |
| 258 | 0, /* clock (filled in from the CPU 3 clock) */ | |
| 259 | 253 | ipu_ctc_interrupt, /* interrupt handler */ |
| 260 | 254 | 0, /* DTR changed handler */ |
| 261 | 255 | 0, /* RTS changed handler */ |
| r3957 | r3958 | |
| 290 | 284 | mcr_cocktail_flip = 0; |
| 291 | 285 | |
| 292 | 286 | /* initialize the sound */ |
| 293 | mcr_sound_reset(); | |
| 287 | mcr_sound_reset(machine); | |
| 294 | 288 | } |
| 295 | 289 | |
| 296 | 290 | |
| r3957 | r3958 | |
| 360 | 354 | mcr_cocktail_flip = 0; |
| 361 | 355 | |
| 362 | 356 | /* initialize the sound */ |
| 363 | mcr_sound_reset(); | |
| 357 | mcr_sound_reset(machine); | |
| 364 | 358 | } |
| 365 | 359 | |
| 366 | 360 |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "deprecat.h" | |
| 10 | 9 | #include "cpu/m68000/m68000.h" |
| 11 | 10 | #include "machine/fd1094.h" |
| 12 | 11 | |
| r3957 | r3958 | |
| 30 | 29 | if it is then it copies the cached data to the user region where code is |
| 31 | 30 | executed from, if its not cached then it gets decrypted to the current |
| 32 | 31 | cache position using the functions in s24_fd1094.c */ |
| 33 | static void s24_fd1094_setstate_and_decrypt(int state) | |
| 32 | static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state) | |
| 34 | 33 | { |
| 35 | 34 | int i; |
| 36 | 35 | UINT32 addr; |
| r3957 | r3958 | |
| 45 | 44 | |
| 46 | 45 | fd1094_state = state; |
| 47 | 46 | |
| 48 | cpu_set_reg( | |
| 47 | cpu_set_reg(machine->cpu[1], M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache | |
| 49 | 48 | |
| 50 | 49 | /* set the s24_fd1094 state ready to decrypt.. */ |
| 51 | 50 | state = fd1094_set_state(s24_fd1094_key,state) & 0xff; |
| r3957 | r3958 | |
| 57 | 56 | { |
| 58 | 57 | /* copy cached state */ |
| 59 | 58 | s24_fd1094_userregion=s24_fd1094_cacheregion[i]; |
| 60 | memory_set_decrypted_region(cpu_get_address_space(Machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion); | |
| 61 | m68k_set_encrypted_opcode_range(Machine->cpu[1],0,s24_fd1094_cpuregionsize); | |
| 59 | memory_set_decrypted_region(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion); | |
| 60 | m68k_set_encrypted_opcode_range(machine->cpu[1],0,s24_fd1094_cpuregionsize); | |
| 62 | 61 | |
| 63 | 62 | return; |
| 64 | 63 | } |
| r3957 | r3958 | |
| 78 | 77 | |
| 79 | 78 | /* copy newly decrypted data to user region */ |
| 80 | 79 | s24_fd1094_userregion=s24_fd1094_cacheregion[fd1094_current_cacheposition]; |
| 81 | memory_set_decrypted_region(cpu_get_address_space(Machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion); | |
| 82 | m68k_set_encrypted_opcode_range(Machine->cpu[1],0,s24_fd1094_cpuregionsize); | |
| 80 | memory_set_decrypted_region(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion); | |
| 81 | m68k_set_encrypted_opcode_range(machine->cpu[1],0,s24_fd1094_cpuregionsize); | |
| 83 | 82 | |
| 84 | 83 | fd1094_current_cacheposition++; |
| 85 | 84 | |
| r3957 | r3958 | |
| 95 | 94 | { |
| 96 | 95 | if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ? |
| 97 | 96 | { |
| 98 | s24_fd1094_setstate_and_decrypt((val & 0xffff0000) >> 16); | |
| 97 | s24_fd1094_setstate_and_decrypt(device->machine, (val & 0xffff0000) >> 16); | |
| 99 | 98 | } |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 | /* Callback when the s24_fd1094 enters interrupt code */ |
| 103 | 102 | static IRQ_CALLBACK(s24_fd1094_int_callback) |
| 104 | 103 | { |
| 105 | s24_fd1094_setstate_and_decrypt(FD1094_STATE_IRQ); | |
| 104 | s24_fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_IRQ); | |
| 106 | 105 | return (0x60+irqline*4)/4; // vector address |
| 107 | 106 | } |
| 108 | 107 | |
| 109 | 108 | static void s24_fd1094_rte_callback (const device_config *device) |
| 110 | 109 | { |
| 111 | s24_fd1094_setstate_and_decrypt(FD1094_STATE_RTE); | |
| 110 | s24_fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE); | |
| 112 | 111 | } |
| 113 | 112 | |
| 114 | 113 | |
| r3957 | r3958 | |
| 123 | 122 | |
| 124 | 123 | |
| 125 | 124 | /* function, to be called from MACHINE_RESET (every reset) */ |
| 126 | void s24_fd1094_machine_init( | |
| 125 | void s24_fd1094_machine_init(running_machine *machine) | |
| 127 | 126 | { |
| 128 | 127 | /* punt if no key; this allows us to be called even for non-s24_fd1094 games */ |
| 129 | 128 | if (!s24_fd1094_key) |
| 130 | 129 | return; |
| 131 | 130 | |
| 132 | s24_fd1094_setstate_and_decrypt(FD1094_STATE_RESET); | |
| 131 | s24_fd1094_setstate_and_decrypt(machine, FD1094_STATE_RESET); | |
| 133 | 132 | s24_fd1094_kludge_reset_values(); |
| 134 | 133 | |
| 135 | cpu_set_info_fct(Machine->cpu[1], CPUINFO_PTR_M68K_CMPILD_CALLBACK, (genf *)s24_fd1094_cmp_callback); | |
| 136 | cpu_set_info_fct(Machine->cpu[1], CPUINFO_PTR_M68K_RTE_CALLBACK, (genf *)s24_fd1094_rte_callback); | |
| 137 | cpu_set_irq_callback(Machine->cpu[1], s24_fd1094_int_callback); | |
| 134 | device_set_info_fct(machine->cpu[1], CPUINFO_FCT_M68K_CMPILD_CALLBACK, (genf *)s24_fd1094_cmp_callback); | |
| 135 | device_set_info_fct(machine->cpu[1], CPUINFO_FCT_M68K_RTE_CALLBACK, (genf *)s24_fd1094_rte_callback); | |
| 136 | cpu_set_irq_callback(machine->cpu[1], s24_fd1094_int_callback); | |
| 138 | 137 | |
| 139 | c | |
| 138 | device | |
| 140 | 139 | } |
| 141 | 140 | |
| 142 | 141 | static STATE_POSTLOAD( s24_fd1094_postload ) |
| r3957 | r3958 | |
| 146 | 145 | int selected_state = fd1094_selected_state; |
| 147 | 146 | int state = fd1094_state; |
| 148 | 147 | |
| 149 | s24_fd1094_machine_init(); | |
| 148 | s24_fd1094_machine_init(machine); | |
| 150 | 149 | |
| 151 | s24_fd1094_setstate_and_decrypt(selected_state); | |
| 152 | s24_fd1094_setstate_and_decrypt(state); | |
| 150 | s24_fd1094_setstate_and_decrypt(machine, selected_state); | |
| 151 | s24_fd1094_setstate_and_decrypt(machine, state); | |
| 153 | 152 | } |
| 154 | 153 | } |
| 155 | 154 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | #include "machine/7474.h" |
| 13 | 12 | #include "includes/galaxold.h" |
| 14 | 13 | |
| r3957 | r3958 | |
| 17 | 16 | |
| 18 | 17 | static UINT8 _4in1_bank; |
| 19 | 18 | |
| 20 | static void galaxold_7474_9M_2_callback( | |
| 19 | static void galaxold_7474_9M_2_callback(running_machine *machine) | |
| 21 | 20 | { |
| 22 | 21 | /* Q bar clocks the other flip-flop, |
| 23 | 22 | Q is VBLANK (not visible to the CPU) */ |
| 24 | 23 | TTL7474_clock_w(1, TTL7474_output_comp_r(0)); |
| 25 | TTL7474_update(1); | |
| 24 | TTL7474_update(machine, 1); | |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | static void galaxold_7474_9M_1_callback( | |
| 27 | static void galaxold_7474_9M_1_callback(running_machine *machine) | |
| 29 | 28 | { |
| 30 | 29 | /* Q goes to the NMI line */ |
| 31 | cpu_set_input_line( | |
| 30 | cpu_set_input_line(machine->cpu[0], irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE); | |
| 32 | 31 | } |
| 33 | 32 | |
| 34 | 33 | static const struct TTL7474_interface galaxold_7474_9M_2_intf = |
| r3957 | r3958 | |
| 45 | 44 | WRITE8_HANDLER( galaxold_nmi_enable_w ) |
| 46 | 45 | { |
| 47 | 46 | TTL7474_preset_w(1, data); |
| 48 | TTL7474_update(1); | |
| 47 | TTL7474_update(space->machine, 1); | |
| 49 | 48 | } |
| 50 | 49 | |
| 51 | 50 | |
| r3957 | r3958 | |
| 61 | 60 | |
| 62 | 61 | timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(machine->primary_screen, param, 0), param); |
| 63 | 62 | |
| 64 | TTL7474_update(0); | |
| 63 | TTL7474_update(machine, 0); | |
| 65 | 64 | } |
| 66 | 65 | |
| 67 | 66 |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "cpu/tms34010/tms34010.h" |
| 10 | 9 | #include "cpu/adsp2100/adsp2100.h" |
| 11 | 10 | #include "cpu/m68000/m68000.h" |
| r3957 | r3958 | |
| 1415 | 1414 | * |
| 1416 | 1415 | *************************************/ |
| 1417 | 1416 | |
| 1418 | void hddsk_update_pif(UINT32 pins) | |
| 1417 | void hddsk_update_pif(const device_config *device, UINT32 pins) | |
| 1419 | 1418 | { |
| 1420 | 1419 | atarigen_sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0); |
| 1421 | hd68k_update_interrupts( | |
| 1420 | hd68k_update_interrupts(device->machine); | |
| 1422 | 1421 | } |
| 1423 | 1422 | |
| 1424 | 1423 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "cpu/mips/psx.h" |
| 12 | 11 | #include "includes/psx.h" |
| 13 | 12 | |
| r3957 | r3958 | |
| 225 | 224 | n_address &= n_adrmask; |
| 226 | 225 | n_nextaddress = g_p_n_psxram[ n_address / 4 ]; |
| 227 | 226 | n_size = n_nextaddress >> 24; |
| 228 | m_p_fn_dma_write[ n_channel ]( n_address + 4, n_size ); | |
| 227 | m_p_fn_dma_write[ n_channel ]( machine, n_address + 4, n_size ); | |
| 229 | 228 | //FIXME: |
| 230 | 229 | // The following conditions will cause an endless loop. |
| 231 | 230 | // If stopping the transfer is correct I cannot judge |
| r3957 | r3958 | |
| 312 | 311 | m_p_fn_dma_read[ n_channel ] != NULL ) |
| 313 | 312 | { |
| 314 | 313 | verboselog( machine, 1, "dma %d read block %08x %08x\n", n_channel, n_address, n_size ); |
| 315 | m_p_fn_dma_read[ n_channel ]( n_address, n_size ); | |
| 316 | dma_finished( space->machine, n_channel ); | |
| 314 | m_p_fn_dma_read[ n_channel ]( space->machine, n_address, n_size ); | |
| 315 | dma_finished( machine, n_channel ); | |
| 317 | 316 | } |
| 318 | 317 | else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x01000200 && |
| 319 | 318 | m_p_fn_dma_read[ n_channel ] != NULL ) |
| 320 | 319 | { |
| 321 | 320 | verboselog( machine, 1, "dma %d read block %08x %08x\n", n_channel, n_address, n_size ); |
| 322 | m_p_fn_dma_read[ n_channel ]( n_address, n_size ); | |
| 321 | m_p_fn_dma_read[ n_channel ]( space->machine, n_address, n_size ); | |
| 323 | 322 | if( n_channel == 1 ) |
| 324 | 323 | { |
| 325 | 324 | dma_start_timer( n_channel, 26000 ); |
| 326 | 325 | } |
| 327 | 326 | else |
| 328 | 327 | { |
| 329 | dma_finished( | |
| 328 | dma_finished( | |
| 330 | 329 | } |
| 331 | 330 | } |
| 332 | 331 | else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x01000201 && |
| 333 | 332 | m_p_fn_dma_write[ n_channel ] != NULL ) |
| 334 | 333 | { |
| 335 | 334 | verboselog( machine, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size ); |
| 336 | m_p_fn_dma_write[ n_channel ]( n_address, n_size ); | |
| 337 | dma_finished( space->machine, n_channel ); | |
| 335 | m_p_fn_dma_write[ n_channel ]( space->machine, n_address, n_size ); | |
| 336 | dma_finished( machine, n_channel ); | |
| 338 | 337 | } |
| 339 | 338 | else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x11050100 && |
| 340 | 339 | m_p_fn_dma_write[ n_channel ] != NULL ) |
| 341 | 340 | { |
| 342 | 341 | /* todo: check this is a write not a read... */ |
| 343 | 342 | verboselog( machine, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size ); |
| 344 | m_p_fn_dma_write[ n_channel ]( n_address, n_size ); | |
| 345 | dma_finished( space->machine, n_channel ); | |
| 343 | m_p_fn_dma_write[ n_channel ]( space->machine, n_address, n_size ); | |
| 344 | dma_finished( machine, n_channel ); | |
| 346 | 345 | } |
| 347 | 346 | else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x11150100 && |
| 348 | 347 | m_p_fn_dma_write[ n_channel ] != NULL ) |
| 349 | 348 | { |
| 350 | 349 | /* todo: check this is a write not a read... */ |
| 351 | 350 | verboselog( machine, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size ); |
| 352 | m_p_fn_dma_write[ n_channel ]( n_address, n_size ); | |
| 353 | dma_finished( space->machine, n_channel ); | |
| 351 | m_p_fn_dma_write[ n_channel ]( space->machine, n_address, n_size ); | |
| 352 | dma_finished( machine, n_channel ); | |
| 354 | 353 | } |
| 355 | 354 | else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x01000401 && |
| 356 | 355 | n_channel == 2 && |
| r3957 | r3958 | |
| 359 | 358 | verboselog( machine, 1, "dma %d write linked list %08x\n", |
| 360 | 359 | n_channel, m_p_n_dmabase[ n_channel ] ); |
| 361 | 360 | |
| 362 | dma_finished( | |
| 361 | dma_finished( | |
| 363 | 362 | } |
| 364 | 363 | else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x11000002 && |
| 365 | 364 | n_channel == 6 ) |
| r3957 | r3958 | |
| 483 | 482 | #define RC_CLC ( 0x100 ) |
| 484 | 483 | #define RC_DIV ( 0x200 ) |
| 485 | 484 | |
| 486 | static UINT64 psxcpu_gettotalcycles( | |
| 485 | static UINT64 psxcpu_gettotalcycles( running_machine *machine ) | |
| 487 | 486 | { |
| 488 | 487 | /* TODO: should return the start of the current tick. */ |
| 489 | return cpu_get_total_cycles( | |
| 488 | return cpu_get_total_cycles(machine->cpu[0]) * 2; | |
| 490 | 489 | } |
| 491 | 490 | |
| 492 | 491 | static int root_divider( int n_counter ) |
| r3957 | r3958 | |
| 507 | 506 | return 1; |
| 508 | 507 | } |
| 509 | 508 | |
| 510 | static UINT16 root_current( int n_counter ) | |
| 509 | static UINT16 root_current( running_machine *machine, int n_counter ) | |
| 511 | 510 | { |
| 512 | 511 | if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 ) |
| 513 | 512 | { |
| r3957 | r3958 | |
| 516 | 515 | else |
| 517 | 516 | { |
| 518 | 517 | UINT64 n_current; |
| 519 | n_current = psxcpu_gettotalcycles() - m_p_n_root_start[ n_counter ]; | |
| 518 | n_current = psxcpu_gettotalcycles(machine) - m_p_n_root_start[ n_counter ]; | |
| 520 | 519 | n_current /= root_divider( n_counter ); |
| 521 | 520 | n_current += m_p_n_root_count[ n_counter ]; |
| 522 | 521 | if( n_current > 0xffff ) |
| 523 | 522 | { |
| 524 | 523 | /* TODO: use timer for wrap on 0x10000. */ |
| 525 | 524 | m_p_n_root_count[ n_counter ] = n_current; |
| 526 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 525 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine); | |
| 527 | 526 | } |
| 528 | 527 | return n_current; |
| 529 | 528 | } |
| r3957 | r3958 | |
| 539 | 538 | return 0x10000; |
| 540 | 539 | } |
| 541 | 540 | |
| 542 | static void root_timer_adjust( int n_counter ) | |
| 541 | static void root_timer_adjust( running_machine *machine, int n_counter ) | |
| 543 | 542 | { |
| 544 | 543 | if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 ) |
| 545 | 544 | { |
| r3957 | r3958 | |
| 549 | 548 | { |
| 550 | 549 | int n_duration; |
| 551 | 550 | |
| 552 | n_duration = root_target( n_counter ) - root_current( n_counter ); | |
| 551 | n_duration = root_target( n_counter ) - root_current( machine, n_counter ); | |
| 553 | 552 | if( n_duration < 1 ) |
| 554 | 553 | { |
| 555 | 554 | n_duration += 0x10000; |
| r3957 | r3958 | |
| 565 | 564 | { |
| 566 | 565 | int n_counter = param; |
| 567 | 566 | |
| 568 | verboselog( machine, 2, "root_finished( %d ) %04x\n", n_counter, root_current( n_counter ) ); | |
| 567 | verboselog( machine, 2, "root_finished( %d ) %04x\n", n_counter, root_current( machine, n_counter ) ); | |
| 569 | 568 | // if( ( m_p_n_root_mode[ n_counter ] & RC_COUNTTARGET ) != 0 ) |
| 570 | 569 | { |
| 571 | 570 | /* TODO: wrap should be handled differently as RC_COUNTTARGET & RC_IRQTARGET don't have to be the same. */ |
| 572 | 571 | m_p_n_root_count[ n_counter ] = 0; |
| 573 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 572 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine); | |
| 574 | 573 | } |
| 575 | 574 | if( ( m_p_n_root_mode[ n_counter ] & RC_REPEAT ) != 0 ) |
| 576 | 575 | { |
| 577 | root_timer_adjust( n_counter ); | |
| 576 | root_timer_adjust( machine, n_counter ); | |
| 578 | 577 | } |
| 579 | 578 | if( ( m_p_n_root_mode[ n_counter ] & RC_IRQOVERFLOW ) != 0 || |
| 580 | 579 | ( m_p_n_root_mode[ n_counter ] & RC_IRQTARGET ) != 0 ) |
| r3957 | r3958 | |
| 595 | 594 | { |
| 596 | 595 | case 0: |
| 597 | 596 | m_p_n_root_count[ n_counter ] = data; |
| 598 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 597 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine); | |
| 599 | 598 | break; |
| 600 | 599 | case 1: |
| 601 | m_p_n_root_count[ n_counter ] = root_current( n_counter ); | |
| 602 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 600 | m_p_n_root_count[ n_counter ] = root_current( space->machine, n_counter ); | |
| 601 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine); | |
| 603 | 602 | m_p_n_root_mode[ n_counter ] = data; |
| 604 | 603 | |
| 605 | 604 | if( ( m_p_n_root_mode[ n_counter ] & RC_RESET ) != 0 ) |
| r3957 | r3958 | |
| 621 | 620 | return; |
| 622 | 621 | } |
| 623 | 622 | |
| 624 | root_timer_adjust( n_counter ); | |
| 623 | root_timer_adjust( space->machine, n_counter ); | |
| 625 | 624 | } |
| 626 | 625 | |
| 627 | 626 | READ32_HANDLER( psx_counter_r ) |
| r3957 | r3958 | |
| 634 | 633 | switch( offset % 4 ) |
| 635 | 634 | { |
| 636 | 635 | case 0: |
| 637 | data = root_current( n_counter ); | |
| 636 | data = root_current( space->machine, n_counter ); | |
| 638 | 637 | break; |
| 639 | 638 | case 1: |
| 640 | 639 | data = m_p_n_root_mode[ n_counter ]; |
| r3957 | r3958 | |
| 701 | 700 | } |
| 702 | 701 | } |
| 703 | 702 | |
| 704 | static void sio_timer_adjust( int n_port ) | |
| 703 | static void sio_timer_adjust( running_machine *machine, int n_port ) | |
| 705 | 704 | { |
| 706 | running_machine *machine = Machine; | |
| 707 | 705 | attotime n_time; |
| 708 | 706 | if( ( m_p_n_sio_status[ n_port ] & SIO_STATUS_TX_EMPTY ) == 0 || m_p_n_sio_tx_bits[ n_port ] != 0 ) |
| 709 | 707 | { |
| r3957 | r3958 | |
| 775 | 773 | if( n_port == 0 ) |
| 776 | 774 | { |
| 777 | 775 | m_p_n_sio_tx[ n_port ] &= ~PSX_SIO_OUT_CLOCK; |
| 778 | m_p_f_sio_handler[ n_port ]( m_p_n_sio_tx[ n_port ] ); | |
| 776 | m_p_f_sio_handler[ n_port ]( machine, m_p_n_sio_tx[ n_port ] ); | |
| 779 | 777 | m_p_n_sio_tx[ n_port ] |= PSX_SIO_OUT_CLOCK; |
| 780 | 778 | } |
| 781 | m_p_f_sio_handler[ n_port ]( m_p_n_sio_tx[ n_port ] ); | |
| 779 | m_p_f_sio_handler[ n_port ]( machine, m_p_n_sio_tx[ n_port ] ); | |
| 782 | 780 | } |
| 783 | 781 | |
| 784 | 782 | if( m_p_n_sio_tx_bits[ n_port ] == 0 && |
| r3957 | r3958 | |
| 811 | 809 | } |
| 812 | 810 | } |
| 813 | 811 | |
| 814 | sio_timer_adjust( n_port ); | |
| 812 | sio_timer_adjust( machine, n_port ); | |
| 815 | 813 | } |
| 816 | 814 | |
| 817 | 815 | void psx_sio_input( running_machine *machine, int n_port, int n_mask, int n_data ) |
| r3957 | r3958 | |
| 849 | 847 | m_p_n_sio_tx_data[ n_port ] = data; |
| 850 | 848 | m_p_n_sio_status[ n_port ] &= ~( SIO_STATUS_TX_RDY ); |
| 851 | 849 | m_p_n_sio_status[ n_port ] &= ~( SIO_STATUS_TX_EMPTY ); |
| 852 | sio_timer_adjust( n_port ); | |
| 850 | sio_timer_adjust( machine, n_port ); | |
| 853 | 851 | break; |
| 854 | 852 | case 1: |
| 855 | 853 | verboselog( machine, 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); |
| r3957 | r3958 | |
| 890 | 888 | { |
| 891 | 889 | if( m_p_f_sio_handler[ n_port ] != NULL ) |
| 892 | 890 | { |
| 893 | m_p_f_sio_handler[ n_port ]( m_p_n_sio_tx[ n_port ] ); | |
| 891 | m_p_f_sio_handler[ n_port ]( space->machine, m_p_n_sio_tx[ n_port ] ); | |
| 894 | 892 | } |
| 895 | 893 | } |
| 896 | 894 | m_p_n_sio_tx_prev[ n_port ] = m_p_n_sio_tx[ n_port ]; |
| r3957 | r3958 | |
| 1339 | 1337 | mdec_decoded = ( 24 * 16 ) / 2; |
| 1340 | 1338 | } |
| 1341 | 1339 | |
| 1342 | static void mdec0_write( UINT32 n_address, INT32 n_size ) | |
| 1340 | static void mdec0_write( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 1343 | 1341 | { |
| 1344 | running_machine *machine = Machine; | |
| 1345 | 1342 | int n_index; |
| 1346 | 1343 | |
| 1347 | 1344 | verboselog( machine, 2, "mdec0_write( %08x, %08x )\n", n_address, n_size ); |
| r3957 | r3958 | |
| 1396 | 1393 | } |
| 1397 | 1394 | } |
| 1398 | 1395 | |
| 1399 | static void mdec1_read( UINT32 n_address, INT32 n_size ) | |
| 1396 | static void mdec1_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 1400 | 1397 | { |
| 1401 | 1398 | UINT32 n_this; |
| 1402 | 1399 | UINT32 n_nextaddress; |
| 1403 | 1400 | |
| 1404 | verboselog( | |
| 1401 | verboselog( machine, 2, "mdec1_read( %08x, %08x )\n", n_address, n_size ); | |
| 1405 | 1402 | if( ( m_n_mdec0_command & ( 1L << 29 ) ) != 0 && m_n_mdec0_size != 0 ) |
| 1406 | 1403 | { |
| 1407 | 1404 | while( n_size > 0 ) |
| r3957 | r3958 | |
| 1484 | 1481 | return 0; |
| 1485 | 1482 | } |
| 1486 | 1483 | |
| 1487 | static void gpu_read( UINT32 n_address, INT32 n_size ) | |
| 1484 | static void gpu_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 1488 | 1485 | { |
| 1489 | psx_gpu_read( &g_p_n_psxram[ n_address / 4 ], n_size ); | |
| 1486 | psx_gpu_read( machine, &g_p_n_psxram[ n_address / 4 ], n_size ); | |
| 1490 | 1487 | } |
| 1491 | 1488 | |
| 1492 | static void gpu_write( UINT32 n_address, INT32 n_size ) | |
| 1489 | static void gpu_write( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 1493 | 1490 | { |
| 1494 | psx_gpu_write( &g_p_n_psxram[ n_address / 4 ], n_size ); | |
| 1491 | psx_gpu_write( machine, &g_p_n_psxram[ n_address / 4 ], n_size ); | |
| 1495 | 1492 | } |
| 1496 | 1493 | |
| 1497 | 1494 | void psx_machine_init( running_machine *machine ) |
| r3957 | r3958 | |
| 1551 | 1548 | |
| 1552 | 1549 | for( n = 0; n < 3; n++ ) |
| 1553 | 1550 | { |
| 1554 | root_timer_adjust( n ); | |
| 1551 | root_timer_adjust( machine, n ); | |
| 1555 | 1552 | } |
| 1556 | 1553 | |
| 1557 | 1554 | for( n = 0; n < 2; n++ ) |
| 1558 | 1555 | { |
| 1559 | sio_timer_adjust( n ); | |
| 1556 | sio_timer_adjust( machine, n ); | |
| 1560 | 1557 | } |
| 1561 | 1558 | |
| 1562 | 1559 | mdec_cos_precalc(); |
| r3957 | r3958 | |
| 1568 | 1565 | |
| 1569 | 1566 | for( n = 0; n < 7; n++ ) |
| 1570 | 1567 | { |
| 1571 | m_p_timer_dma[ n ] = timer_alloc( machine, dma_finished_callback | |
| 1568 | m_p_timer_dma[ n ] = timer_alloc( machine, dma_finished_callback | |
| 1572 | 1569 | m_p_fn_dma_read[ n ] = NULL; |
| 1573 | 1570 | m_p_fn_dma_write[ n ] = NULL; |
| 1574 | 1571 | } |
| r3957 | r3958 | |
|---|---|---|
| 933 | 933 | |
| 934 | 934 | MACHINE_START( joust2 ) |
| 935 | 935 | { |
| 936 | williams_cvsd_init(3); | |
| 936 | williams_cvsd_init(machine, 3); | |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | |
| r3957 | r3958 | |
| 963 | 963 | static WRITE8_HANDLER( joust2_snd_cmd_w ) |
| 964 | 964 | { |
| 965 | 965 | joust2_current_sound_data = (joust2_current_sound_data & ~0xff) | (data & 0xff); |
| 966 | williams_cvsd_data_w(joust2_current_sound_data); | |
| 966 | williams_cvsd_data_w(space->machine, joust2_current_sound_data); | |
| 967 | 967 | timer_call_after_resynch(space->machine, NULL, joust2_current_sound_data, joust2_deferred_snd_cmd_w); |
| 968 | 968 | } |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "system16.h" |
| 4 | 3 | #include "sound/upd7759.h" |
| 5 | 4 | |
| r3957 | r3958 | |
| 9 | 8 | UINT16 *sys16_extraram2; |
| 10 | 9 | UINT16 *sys16_extraram3; |
| 11 | 10 | |
| 12 | static void patch_codeX( | |
| 11 | static void patch_codeX( UINT16 *mem, offs_t offset, int data | |
| 13 | 12 | int aligned_offset = offset&0xfffffe; |
| 14 | UINT16 *mem = (UINT16 *)memory_region(Machine, cpu); | |
| 15 | 13 | int old_word = mem[aligned_offset/2]; |
| 16 | 14 | |
| 17 | 15 | if( offset&1 ) |
| r3957 | r3958 | |
| 22 | 20 | mem[aligned_offset/2] = data; |
| 23 | 21 | } |
| 24 | 22 | |
| 25 | void sys16_patch_code( int offset, int data ){ | |
| 26 | patch_codeX(offset,data,"main"); | |
| 23 | void sys16_patch_code( running_machine *machine, const sys16_patch *data, int count ){ | |
| 24 | int i; | |
| 25 | UINT16 *mem = (UINT16 *)memory_region(machine, "main"); | |
| 26 | for (i=0; i<count; i++) | |
| 27 | patch_codeX(mem, data[i].offset, data[i].data); | |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | |
| r3957 | r3958 | |
| 54 | 55 | |
| 55 | 56 | /* sound */ |
| 56 | 57 | |
| 57 | static void sound_cause_nmi( int chip ){ | |
| 58 | static void sound_cause_nmi( const device_config *device, int chip ){ | |
| 58 | 59 | /* upd7759 callback */ |
| 59 | cpu_set_input_line( | |
| 60 | cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); | |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | WRITE16_HANDLER( wrally_flipscreen_w ) |
| 30 | 30 | { |
| 31 | flip_screen_set(data & 0x01); | |
| 31 | flip_screen_set(space->machine, data & 0x01); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | WRITE16_HANDLER( OKIM6295_bankswitch_w ) |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | 5 | #include "driver.h" |
| 6 | #include "deprecat.h" | |
| 7 | 6 | #include "debugger.h" |
| 8 | 7 | #include "cpu/mb86233/mb86233.h" |
| 9 | 8 | #include "cpu/v60/v60.h" |
| 10 | 9 | #include "includes/model1.h" |
| 11 | 10 | |
| 11 | #define TGP_FUNCTION(name) void name(running_machine *machine) | |
| 12 | typedef void (*tgp_func)(running_machine *machine); | |
| 13 | ||
| 14 | ||
| 12 | 15 | enum {FIFO_SIZE = 256}; |
| 13 | 16 | enum {MAT_STACK_SIZE = 32}; |
| 14 | 17 | |
| r3957 | r3958 | |
| 21 | 24 | static int model1_swa; |
| 22 | 25 | |
| 23 | 26 | static int fifoin_cbcount; |
| 24 | static | |
| 27 | static tgp_func | |
| 25 | 28 | |
| 26 | 29 | static INT32 fifoout_rpos, fifoout_wpos; |
| 27 | 30 | static UINT32 fifoout_data[FIFO_SIZE]; |
| r3957 | r3958 | |
| 95 | 98 | logerror("TGP FIFOIN overflow\n"); |
| 96 | 99 | fifoin_cbcount--; |
| 97 | 100 | if(!fifoin_cbcount) |
| 98 | fifoin_cb(); | |
| 101 | fifoin_cb(space->machine); | |
| 99 | 102 | } |
| 100 | 103 | |
| 101 | 104 | static float fifoin_pop_f(void) |
| r3957 | r3958 | |
| 103 | 106 | return u2f(fifoin_pop()); |
| 104 | 107 | } |
| 105 | 108 | |
| 106 | static void function_get_vf(void); | |
| 107 | static void function_get_swa(void); | |
| 109 | static TGP_FUNCTION( function_get_vf ); | |
| 110 | static TGP_FUNCTION( function_get_swa ); | |
| 108 | 111 | |
| 109 | 112 | static void next_fn(void) |
| 110 | 113 | { |
| r3957 | r3958 | |
| 146 | 149 | return u2f(ram_data[ram_scanadr++]); |
| 147 | 150 | } |
| 148 | 151 | |
| 149 | static | |
| 152 | static TGP_FUNCTION( fadd | |
| 150 | 153 | { |
| 151 | 154 | float a = fifoin_pop_f(); |
| 152 | 155 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 156 | 159 | next_fn(); |
| 157 | 160 | } |
| 158 | 161 | |
| 159 | static | |
| 162 | static TGP_FUNCTION( fsub | |
| 160 | 163 | { |
| 161 | 164 | float a = fifoin_pop_f(); |
| 162 | 165 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 167 | 170 | next_fn(); |
| 168 | 171 | } |
| 169 | 172 | |
| 170 | static | |
| 173 | static TGP_FUNCTION( fmul | |
| 171 | 174 | { |
| 172 | 175 | float a = fifoin_pop_f(); |
| 173 | 176 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 177 | 180 | next_fn(); |
| 178 | 181 | } |
| 179 | 182 | |
| 180 | static | |
| 183 | static TGP_FUNCTION( fdiv | |
| 181 | 184 | { |
| 182 | 185 | float a = fifoin_pop_f(); |
| 183 | 186 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 188 | 191 | next_fn(); |
| 189 | 192 | } |
| 190 | 193 | |
| 191 | static | |
| 194 | static TGP_FUNCTION( matrix_push | |
| 192 | 195 | { |
| 193 | 196 | if(mat_stack_pos != MAT_STACK_SIZE) { |
| 194 | 197 | memcpy(mat_stack[mat_stack_pos], cmat, sizeof(cmat)); |
| r3957 | r3958 | |
| 198 | 201 | next_fn(); |
| 199 | 202 | } |
| 200 | 203 | |
| 201 | static | |
| 204 | static TGP_FUNCTION( matrix_pop | |
| 202 | 205 | { |
| 203 | 206 | if(mat_stack_pos) { |
| 204 | 207 | mat_stack_pos--; |
| r3957 | r3958 | |
| 208 | 211 | next_fn(); |
| 209 | 212 | } |
| 210 | 213 | |
| 211 | static | |
| 214 | static TGP_FUNCTION( matrix_write | |
| 212 | 215 | { |
| 213 | 216 | int i; |
| 214 | 217 | for(i=0; i<12; i++) |
| r3957 | r3958 | |
| 219 | 222 | next_fn(); |
| 220 | 223 | } |
| 221 | 224 | |
| 222 | static | |
| 225 | static TGP_FUNCTION( clear_stack | |
| 223 | 226 | { |
| 224 | 227 | logerror("TGP clear_stack (%x)\n", pushpc); |
| 225 | 228 | mat_stack_pos = 0; |
| 226 | 229 | next_fn(); |
| 227 | 230 | } |
| 228 | 231 | |
| 229 | static | |
| 232 | static TGP_FUNCTION( matrix_mul | |
| 230 | 233 | { |
| 231 | 234 | float m[12]; |
| 232 | 235 | float a = fifoin_pop_f(); |
| r3957 | r3958 | |
| 259 | 262 | next_fn(); |
| 260 | 263 | } |
| 261 | 264 | |
| 262 | static | |
| 265 | static TGP_FUNCTION( anglev | |
| 263 | 266 | { |
| 264 | 267 | float a = fifoin_pop_f(); |
| 265 | 268 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 279 | 282 | next_fn(); |
| 280 | 283 | } |
| 281 | 284 | |
| 282 | static | |
| 285 | static TGP_FUNCTION( f11 | |
| 283 | 286 | { |
| 284 | 287 | float a = fifoin_pop_f(); |
| 285 | 288 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 306 | 309 | next_fn(); |
| 307 | 310 | } |
| 308 | 311 | |
| 309 | static | |
| 312 | static TGP_FUNCTION( normalize | |
| 310 | 313 | { |
| 311 | 314 | float a = fifoin_pop_f(); |
| 312 | 315 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 319 | 322 | next_fn(); |
| 320 | 323 | } |
| 321 | 324 | |
| 322 | static | |
| 325 | static TGP_FUNCTION( acc_seti | |
| 323 | 326 | { |
| 324 | 327 | INT32 a = fifoin_pop(); |
| 325 | 328 | model1_dump = 1; |
| r3957 | r3958 | |
| 328 | 331 | next_fn(); |
| 329 | 332 | } |
| 330 | 333 | |
| 331 | static | |
| 334 | static TGP_FUNCTION( track_select | |
| 332 | 335 | { |
| 333 | 336 | INT32 a = fifoin_pop(); |
| 334 | 337 | logerror("TGP track_select %d (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 336 | 339 | next_fn(); |
| 337 | 340 | } |
| 338 | 341 | |
| 339 | static | |
| 342 | static TGP_FUNCTION( f14 | |
| 340 | 343 | { |
| 341 | 344 | tgp_vr_base[0] = fifoin_pop_f(); |
| 342 | 345 | tgp_vr_base[1] = fifoin_pop_f(); |
| r3957 | r3958 | |
| 346 | 349 | next_fn(); |
| 347 | 350 | } |
| 348 | 351 | |
| 349 | static | |
| 352 | static TGP_FUNCTION( f15_swa | |
| 350 | 353 | { |
| 351 | 354 | logerror("TGP f15_swa (%x)\n", pushpc); |
| 352 | 355 | |
| 353 | 356 | next_fn(); |
| 354 | 357 | } |
| 355 | 358 | |
| 356 | static | |
| 359 | static TGP_FUNCTION( anglep | |
| 357 | 360 | { |
| 358 | 361 | float a = fifoin_pop_f(); |
| 359 | 362 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 377 | 380 | next_fn(); |
| 378 | 381 | } |
| 379 | 382 | |
| 380 | static | |
| 383 | static TGP_FUNCTION( matrix_ident | |
| 381 | 384 | { |
| 382 | 385 | logerror("TGP matrix_ident (%x)\n", pushpc); |
| 383 | 386 | memset(cmat, 0, sizeof(cmat)); |
| r3957 | r3958 | |
| 387 | 390 | next_fn(); |
| 388 | 391 | } |
| 389 | 392 | |
| 390 | static | |
| 393 | static TGP_FUNCTION( matrix_read | |
| 391 | 394 | { |
| 392 | 395 | int i; |
| 393 | 396 | logerror("TGP matrix_read (%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f) (%x)\n", |
| r3957 | r3958 | |
| 397 | 400 | next_fn(); |
| 398 | 401 | } |
| 399 | 402 | |
| 400 | static | |
| 403 | static TGP_FUNCTION( matrix_trans | |
| 401 | 404 | { |
| 402 | 405 | float a = fifoin_pop_f(); |
| 403 | 406 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 409 | 412 | next_fn(); |
| 410 | 413 | } |
| 411 | 414 | |
| 412 | static | |
| 415 | static TGP_FUNCTION( matrix_scale | |
| 413 | 416 | { |
| 414 | 417 | float a = fifoin_pop_f(); |
| 415 | 418 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 427 | 430 | next_fn(); |
| 428 | 431 | } |
| 429 | 432 | |
| 430 | static | |
| 433 | static TGP_FUNCTION( matrix_rotx | |
| 431 | 434 | { |
| 432 | 435 | INT16 a = fifoin_pop(); |
| 433 | 436 | float s = tsin(a); |
| r3957 | r3958 | |
| 449 | 452 | next_fn(); |
| 450 | 453 | } |
| 451 | 454 | |
| 452 | static | |
| 455 | static TGP_FUNCTION( matrix_roty | |
| 453 | 456 | { |
| 454 | 457 | INT16 a = fifoin_pop(); |
| 455 | 458 | float s = tsin(a); |
| r3957 | r3958 | |
| 472 | 475 | next_fn(); |
| 473 | 476 | } |
| 474 | 477 | |
| 475 | static | |
| 478 | static TGP_FUNCTION( matrix_rotz | |
| 476 | 479 | { |
| 477 | 480 | INT16 a = fifoin_pop(); |
| 478 | 481 | float s = tsin(a); |
| r3957 | r3958 | |
| 495 | 498 | next_fn(); |
| 496 | 499 | } |
| 497 | 500 | |
| 498 | static | |
| 501 | static TGP_FUNCTION( track_read_quad | |
| 499 | 502 | { |
| 500 | const UINT32 *tgp_data = (const UINT32 *)memory_region( | |
| 503 | const UINT32 *tgp_data = (const UINT32 *)memory_region(machine, "user2"); | |
| 501 | 504 | UINT32 a = fifoin_pop(); |
| 502 | 505 | int offd; |
| 503 | 506 | |
| r3957 | r3958 | |
| 519 | 522 | next_fn(); |
| 520 | 523 | } |
| 521 | 524 | |
| 522 | static | |
| 525 | static TGP_FUNCTION( f24_swa | |
| 523 | 526 | { |
| 524 | 527 | float a = fifoin_pop_f(); |
| 525 | 528 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 540 | 543 | next_fn(); |
| 541 | 544 | } |
| 542 | 545 | |
| 543 | static | |
| 546 | static TGP_FUNCTION( transform_point | |
| 544 | 547 | { |
| 545 | 548 | float x = fifoin_pop_f(); |
| 546 | 549 | float y = fifoin_pop_f(); |
| r3957 | r3958 | |
| 553 | 556 | next_fn(); |
| 554 | 557 | } |
| 555 | 558 | |
| 556 | static | |
| 559 | static TGP_FUNCTION( fcos_m1 | |
| 557 | 560 | { |
| 558 | 561 | INT16 a = fifoin_pop(); |
| 559 | 562 | logerror("TGP fcos %d (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 561 | 564 | next_fn(); |
| 562 | 565 | } |
| 563 | 566 | |
| 564 | static | |
| 567 | static TGP_FUNCTION( fsin_m1 | |
| 565 | 568 | { |
| 566 | 569 | INT16 a = fifoin_pop(); |
| 567 | 570 | logerror("TGP fsin %d (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 569 | 572 | next_fn(); |
| 570 | 573 | } |
| 571 | 574 | |
| 572 | static | |
| 575 | static TGP_FUNCTION( fcosm_m1 | |
| 573 | 576 | { |
| 574 | 577 | INT16 a = fifoin_pop(); |
| 575 | 578 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 578 | 581 | next_fn(); |
| 579 | 582 | } |
| 580 | 583 | |
| 581 | static | |
| 584 | static TGP_FUNCTION( fsinm_m1 | |
| 582 | 585 | { |
| 583 | 586 | INT16 a = fifoin_pop(); |
| 584 | 587 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 588 | 591 | next_fn(); |
| 589 | 592 | } |
| 590 | 593 | |
| 591 | static | |
| 594 | static TGP_FUNCTION( distance3 | |
| 592 | 595 | { |
| 593 | 596 | float a = fifoin_pop_f(); |
| 594 | 597 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 604 | 607 | next_fn(); |
| 605 | 608 | } |
| 606 | 609 | |
| 607 | static | |
| 610 | static TGP_FUNCTION( ftoi | |
| 608 | 611 | { |
| 609 | 612 | float a = fifoin_pop_f(); |
| 610 | 613 | logerror("TGP ftoi %f (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 612 | 615 | next_fn(); |
| 613 | 616 | } |
| 614 | 617 | |
| 615 | static | |
| 618 | static TGP_FUNCTION( itof | |
| 616 | 619 | { |
| 617 | 620 | INT32 a = fifoin_pop(); |
| 618 | 621 | logerror("TGP itof %d (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 620 | 623 | next_fn(); |
| 621 | 624 | } |
| 622 | 625 | |
| 623 | static | |
| 626 | static TGP_FUNCTION( acc_set | |
| 624 | 627 | { |
| 625 | 628 | float a = fifoin_pop_f(); |
| 626 | 629 | logerror("TGP acc_set %f (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 628 | 631 | next_fn(); |
| 629 | 632 | } |
| 630 | 633 | |
| 631 | static | |
| 634 | static TGP_FUNCTION( acc_get | |
| 632 | 635 | { |
| 633 | 636 | logerror("TGP acc_get (%x)\n", pushpc); |
| 634 | 637 | fifoout_push_f(acc); |
| 635 | 638 | next_fn(); |
| 636 | 639 | } |
| 637 | 640 | |
| 638 | static | |
| 641 | static TGP_FUNCTION( acc_add | |
| 639 | 642 | { |
| 640 | 643 | float a = fifoin_pop_f(); |
| 641 | 644 | logerror("TGP acc_add %f (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 643 | 646 | next_fn(); |
| 644 | 647 | } |
| 645 | 648 | |
| 646 | static | |
| 649 | static TGP_FUNCTION( acc_sub | |
| 647 | 650 | { |
| 648 | 651 | float a = fifoin_pop_f(); |
| 649 | 652 | logerror("TGP acc_sub %f (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 651 | 654 | next_fn(); |
| 652 | 655 | } |
| 653 | 656 | |
| 654 | static | |
| 657 | static TGP_FUNCTION( acc_mul | |
| 655 | 658 | { |
| 656 | 659 | float a = fifoin_pop_f(); |
| 657 | 660 | logerror("TGP acc_mul %f (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 659 | 662 | next_fn(); |
| 660 | 663 | } |
| 661 | 664 | |
| 662 | static | |
| 665 | static TGP_FUNCTION( acc_div | |
| 663 | 666 | { |
| 664 | 667 | float a = fifoin_pop_f(); |
| 665 | 668 | logerror("TGP acc_div %f (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 667 | 670 | next_fn(); |
| 668 | 671 | } |
| 669 | 672 | |
| 670 | static | |
| 673 | static TGP_FUNCTION( f42 | |
| 671 | 674 | { |
| 672 | 675 | float a = fifoin_pop_f(); |
| 673 | 676 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 676 | 679 | (void)b; |
| 677 | 680 | (void)c; |
| 678 | 681 | logerror("TGP f42 %f, %f, %f (%x)\n", a, b, c, pushpc); |
| 679 | // fifoout_push_f((mame_rand( | |
| 682 | // fifoout_push_f((mame_rand(machine) % 1000) - 500); | |
| 680 | 683 | fifoout_push_f(0); |
| 681 | 684 | fifoout_push_f(0); |
| 682 | 685 | fifoout_push_f(0); |
| r3957 | r3958 | |
| 689 | 692 | |
| 690 | 693 | // r = (x2 + y2 + z2)1/2, f = tan-1(y/(x2+z2)1/2), q = tan-1(z/x) |
| 691 | 694 | |
| 692 | static | |
| 695 | static TGP_FUNCTION( xyz2rqf | |
| 693 | 696 | { |
| 694 | 697 | float a = fifoin_pop_f(); |
| 695 | 698 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 727 | 730 | next_fn(); |
| 728 | 731 | } |
| 729 | 732 | |
| 730 | static | |
| 733 | static TGP_FUNCTION( f43 | |
| 731 | 734 | { |
| 732 | 735 | float a = fifoin_pop_f(); |
| 733 | 736 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 749 | 752 | next_fn(); |
| 750 | 753 | } |
| 751 | 754 | |
| 752 | static | |
| 755 | static TGP_FUNCTION( f43_swa | |
| 753 | 756 | { |
| 754 | 757 | float a = fifoin_pop_f(); |
| 755 | 758 | int b = fifoin_pop(); |
| r3957 | r3958 | |
| 764 | 767 | next_fn(); |
| 765 | 768 | } |
| 766 | 769 | |
| 767 | static | |
| 770 | static TGP_FUNCTION( f44 | |
| 768 | 771 | { |
| 769 | 772 | float a = fifoin_pop_f(); |
| 770 | 773 | (void)a; |
| r3957 | r3958 | |
| 775 | 778 | next_fn(); |
| 776 | 779 | } |
| 777 | 780 | |
| 778 | static | |
| 781 | static TGP_FUNCTION( matrix_sdir | |
| 779 | 782 | { |
| 780 | 783 | float a = fifoin_pop_f(); |
| 781 | 784 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 825 | 828 | next_fn(); |
| 826 | 829 | } |
| 827 | 830 | |
| 828 | static | |
| 831 | static TGP_FUNCTION( f45 | |
| 829 | 832 | { |
| 830 | 833 | float a = fifoin_pop_f(); |
| 831 | 834 | (void)a; |
| r3957 | r3958 | |
| 834 | 837 | next_fn(); |
| 835 | 838 | } |
| 836 | 839 | |
| 837 | static | |
| 840 | static TGP_FUNCTION( vlength | |
| 838 | 841 | { |
| 839 | 842 | float a = fifoin_pop_f() - tgp_vr_base[0]; |
| 840 | 843 | float b = fifoin_pop_f() - tgp_vr_base[1]; |
| r3957 | r3958 | |
| 849 | 852 | next_fn(); |
| 850 | 853 | } |
| 851 | 854 | |
| 852 | static | |
| 855 | static TGP_FUNCTION( f47 | |
| 853 | 856 | { |
| 854 | 857 | float a = fifoin_pop_f(); |
| 855 | 858 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 860 | 863 | next_fn(); |
| 861 | 864 | } |
| 862 | 865 | |
| 863 | static | |
| 866 | static TGP_FUNCTION( track_read_info | |
| 864 | 867 | { |
| 865 | const UINT32 *tgp_data = (const UINT32 *)memory_region( | |
| 868 | const UINT32 *tgp_data = (const UINT32 *)memory_region(machine, "user2"); | |
| 866 | 869 | UINT16 a = fifoin_pop(); |
| 867 | 870 | int offd; |
| 868 | 871 | |
| r3957 | r3958 | |
| 873 | 876 | next_fn(); |
| 874 | 877 | } |
| 875 | 878 | |
| 876 | static | |
| 879 | static TGP_FUNCTION( colbox_set | |
| 877 | 880 | { |
| 878 | 881 | float a = fifoin_pop_f(); |
| 879 | 882 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 903 | 906 | next_fn(); |
| 904 | 907 | } |
| 905 | 908 | |
| 906 | static | |
| 909 | static TGP_FUNCTION( colbox_test | |
| 907 | 910 | { |
| 908 | 911 | float a = fifoin_pop_f(); |
| 909 | 912 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 919 | 922 | next_fn(); |
| 920 | 923 | } |
| 921 | 924 | |
| 922 | static | |
| 925 | static TGP_FUNCTION( f49_swa | |
| 923 | 926 | { |
| 924 | 927 | float a = fifoin_pop_f(); |
| 925 | 928 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 937 | 940 | next_fn(); |
| 938 | 941 | } |
| 939 | 942 | |
| 940 | static | |
| 943 | static TGP_FUNCTION( f50_swa | |
| 941 | 944 | { |
| 942 | 945 | float a = fifoin_pop_f(); |
| 943 | 946 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 952 | 955 | next_fn(); |
| 953 | 956 | } |
| 954 | 957 | |
| 955 | static | |
| 958 | static TGP_FUNCTION( f52 | |
| 956 | 959 | { |
| 957 | 960 | logerror("TGP f52 (%x)\n", pushpc); |
| 958 | 961 | next_fn(); |
| 959 | 962 | } |
| 960 | 963 | |
| 961 | static | |
| 964 | static TGP_FUNCTION( matrix_rdir | |
| 962 | 965 | { |
| 963 | 966 | float a = fifoin_pop_f(); |
| 964 | 967 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1007 | 1010 | *t2 = (bx*py-by*px)/d; |
| 1008 | 1011 | } |
| 1009 | 1012 | |
| 1010 | static | |
| 1013 | static TGP_FUNCTION( track_lookup | |
| 1011 | 1014 | { |
| 1012 | const UINT32 *tgp_data = (const UINT32 *)memory_region( | |
| 1015 | const UINT32 *tgp_data = (const UINT32 *)memory_region(machine, "user2"); | |
| 1013 | 1016 | float a = fifoin_pop_f(); |
| 1014 | 1017 | UINT32 b = fifoin_pop(); |
| 1015 | 1018 | float c = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1065 | 1068 | next_fn(); |
| 1066 | 1069 | } |
| 1067 | 1070 | |
| 1068 | static | |
| 1071 | static TGP_FUNCTION( f56 | |
| 1069 | 1072 | { |
| 1070 | 1073 | float a = fifoin_pop_f(); |
| 1071 | 1074 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1087 | 1090 | next_fn(); |
| 1088 | 1091 | } |
| 1089 | 1092 | |
| 1090 | static | |
| 1093 | static TGP_FUNCTION( f57 | |
| 1091 | 1094 | { |
| 1092 | 1095 | logerror("TGP f57 (%x)\n", pushpc); |
| 1093 | 1096 | fifoout_push_f(0); |
| r3957 | r3958 | |
| 1096 | 1099 | next_fn(); |
| 1097 | 1100 | } |
| 1098 | 1101 | |
| 1099 | static | |
| 1102 | static TGP_FUNCTION( matrix_readt | |
| 1100 | 1103 | { |
| 1101 | 1104 | logerror("TGP matrix_readt (%x)\n", pushpc); |
| 1102 | 1105 | fifoout_push_f(cmat[9]); |
| r3957 | r3958 | |
| 1105 | 1108 | next_fn(); |
| 1106 | 1109 | } |
| 1107 | 1110 | |
| 1108 | static | |
| 1111 | static TGP_FUNCTION( acc_geti | |
| 1109 | 1112 | { |
| 1110 | 1113 | logerror("TGP acc_geti (%x)\n", pushpc); |
| 1111 | 1114 | fifoout_push((int)acc); |
| 1112 | 1115 | next_fn(); |
| 1113 | 1116 | } |
| 1114 | 1117 | |
| 1115 | static | |
| 1118 | static TGP_FUNCTION( f60 | |
| 1116 | 1119 | { |
| 1117 | 1120 | logerror("TGP f60 (%x)\n", pushpc); |
| 1118 | 1121 | fifoout_push_f(0); |
| r3957 | r3958 | |
| 1121 | 1124 | next_fn(); |
| 1122 | 1125 | } |
| 1123 | 1126 | |
| 1124 | static | |
| 1127 | static TGP_FUNCTION( col_setcirc | |
| 1125 | 1128 | { |
| 1126 | 1129 | float a = fifoin_pop_f(); |
| 1127 | 1130 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1133 | 1136 | next_fn(); |
| 1134 | 1137 | } |
| 1135 | 1138 | |
| 1136 | static | |
| 1139 | static TGP_FUNCTION( col_testpt | |
| 1137 | 1140 | { |
| 1138 | 1141 | float x, y; |
| 1139 | 1142 | float a = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1145 | 1148 | next_fn(); |
| 1146 | 1149 | } |
| 1147 | 1150 | |
| 1148 | static | |
| 1151 | static TGP_FUNCTION( push_and_ident | |
| 1149 | 1152 | { |
| 1150 | 1153 | if(mat_stack_pos != MAT_STACK_SIZE) { |
| 1151 | 1154 | memcpy(mat_stack[mat_stack_pos], cmat, sizeof(cmat)); |
| r3957 | r3958 | |
| 1159 | 1162 | next_fn(); |
| 1160 | 1163 | } |
| 1161 | 1164 | |
| 1162 | static | |
| 1165 | static TGP_FUNCTION( catmull_rom | |
| 1163 | 1166 | { |
| 1164 | 1167 | float a = fifoin_pop_f(); |
| 1165 | 1168 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1193 | 1196 | next_fn(); |
| 1194 | 1197 | } |
| 1195 | 1198 | |
| 1196 | static | |
| 1199 | static TGP_FUNCTION( distance | |
| 1197 | 1200 | { |
| 1198 | 1201 | float a = fifoin_pop_f(); |
| 1199 | 1202 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1206 | 1209 | next_fn(); |
| 1207 | 1210 | } |
| 1208 | 1211 | |
| 1209 | static | |
| 1212 | static TGP_FUNCTION( car_move | |
| 1210 | 1213 | { |
| 1211 | 1214 | INT16 a = fifoin_pop(); |
| 1212 | 1215 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1225 | 1228 | next_fn(); |
| 1226 | 1229 | } |
| 1227 | 1230 | |
| 1228 | static | |
| 1231 | static TGP_FUNCTION( cpa | |
| 1229 | 1232 | { |
| 1230 | 1233 | float dv_x, dv_y, dv_z, dv2, dw_x, dw_y, dw_z, dt; |
| 1231 | 1234 | |
| r3957 | r3958 | |
| 1269 | 1272 | next_fn(); |
| 1270 | 1273 | } |
| 1271 | 1274 | |
| 1272 | static | |
| 1275 | static TGP_FUNCTION( vmat_store | |
| 1273 | 1276 | { |
| 1274 | 1277 | UINT32 a = fifoin_pop(); |
| 1275 | 1278 | if(a<21) |
| r3957 | r3958 | |
| 1280 | 1283 | next_fn(); |
| 1281 | 1284 | } |
| 1282 | 1285 | |
| 1283 | static | |
| 1286 | static TGP_FUNCTION( vmat_restore | |
| 1284 | 1287 | { |
| 1285 | 1288 | UINT32 a = fifoin_pop(); |
| 1286 | 1289 | if(a<21) |
| r3957 | r3958 | |
| 1291 | 1294 | next_fn(); |
| 1292 | 1295 | } |
| 1293 | 1296 | |
| 1294 | static | |
| 1297 | static TGP_FUNCTION( vmat_mul | |
| 1295 | 1298 | { |
| 1296 | 1299 | UINT32 a = fifoin_pop(); |
| 1297 | 1300 | UINT32 b = fifoin_pop(); |
| r3957 | r3958 | |
| 1314 | 1317 | next_fn(); |
| 1315 | 1318 | } |
| 1316 | 1319 | |
| 1317 | static | |
| 1320 | static TGP_FUNCTION( vmat_read | |
| 1318 | 1321 | { |
| 1319 | 1322 | UINT32 a = fifoin_pop(); |
| 1320 | 1323 | logerror("TGP vmat_read %d (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 1331 | 1334 | next_fn(); |
| 1332 | 1335 | } |
| 1333 | 1336 | |
| 1334 | static | |
| 1337 | static TGP_FUNCTION( matrix_rtrans | |
| 1335 | 1338 | { |
| 1336 | 1339 | logerror("TGP matrix_rtrans (%x)\n", pushpc); |
| 1337 | 1340 | fifoout_push_f(cmat[ 9]); |
| r3957 | r3958 | |
| 1340 | 1343 | next_fn(); |
| 1341 | 1344 | } |
| 1342 | 1345 | |
| 1343 | static | |
| 1346 | static TGP_FUNCTION( matrix_unrot | |
| 1344 | 1347 | { |
| 1345 | 1348 | logerror("TGP matrix_unrot (%x)\n", pushpc); |
| 1346 | 1349 | memset(cmat, 0, 9*sizeof(cmat[0])); |
| r3957 | r3958 | |
| 1350 | 1353 | next_fn(); |
| 1351 | 1354 | } |
| 1352 | 1355 | |
| 1353 | static | |
| 1356 | static TGP_FUNCTION( f80 | |
| 1354 | 1357 | { |
| 1355 | 1358 | logerror("TGP f80 (%x)\n", pushpc); |
| 1356 | 1359 | // cmat[9] = cmat[10] = cmat[11] = 0; |
| 1357 | 1360 | next_fn(); |
| 1358 | 1361 | } |
| 1359 | 1362 | |
| 1360 | static | |
| 1363 | static TGP_FUNCTION( vmat_save | |
| 1361 | 1364 | { |
| 1362 | 1365 | UINT32 a = fifoin_pop(); |
| 1363 | 1366 | int i; |
| r3957 | r3958 | |
| 1367 | 1370 | next_fn(); |
| 1368 | 1371 | } |
| 1369 | 1372 | |
| 1370 | static | |
| 1373 | static TGP_FUNCTION( vmat_load | |
| 1371 | 1374 | { |
| 1372 | 1375 | UINT32 a = fifoin_pop(); |
| 1373 | 1376 | int i; |
| r3957 | r3958 | |
| 1377 | 1380 | next_fn(); |
| 1378 | 1381 | } |
| 1379 | 1382 | |
| 1380 | static | |
| 1383 | static TGP_FUNCTION( ram_setadr | |
| 1381 | 1384 | { |
| 1382 | 1385 | ram_scanadr = fifoin_pop() - 0x8000; |
| 1383 | 1386 | logerror("TGP f0 ram_setadr 0x%x (%x)\n", ram_scanadr+0x8000, pushpc); |
| 1384 | 1387 | next_fn(); |
| 1385 | 1388 | } |
| 1386 | 1389 | |
| 1387 | static | |
| 1390 | static TGP_FUNCTION( groundbox_test | |
| 1388 | 1391 | { |
| 1389 | 1392 | int out_x, out_y, out_z; |
| 1390 | 1393 | float x, y, z; |
| r3957 | r3958 | |
| 1407 | 1410 | next_fn(); |
| 1408 | 1411 | } |
| 1409 | 1412 | |
| 1410 | static | |
| 1413 | static TGP_FUNCTION( f89 | |
| 1411 | 1414 | { |
| 1412 | 1415 | UINT32 a = fifoin_pop(); |
| 1413 | 1416 | UINT32 b = fifoin_pop(); |
| r3957 | r3958 | |
| 1421 | 1424 | next_fn(); |
| 1422 | 1425 | } |
| 1423 | 1426 | |
| 1424 | static | |
| 1427 | static TGP_FUNCTION( f92 | |
| 1425 | 1428 | { |
| 1426 | 1429 | float a = fifoin_pop_f(); |
| 1427 | 1430 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1435 | 1438 | next_fn(); |
| 1436 | 1439 | } |
| 1437 | 1440 | |
| 1438 | static | |
| 1441 | static TGP_FUNCTION( f93 | |
| 1439 | 1442 | { |
| 1440 | 1443 | float a = fifoin_pop_f(); |
| 1441 | 1444 | (void)a; |
| r3957 | r3958 | |
| 1443 | 1446 | next_fn(); |
| 1444 | 1447 | } |
| 1445 | 1448 | |
| 1446 | static | |
| 1449 | static TGP_FUNCTION( f94 | |
| 1447 | 1450 | { |
| 1448 | 1451 | UINT32 a = fifoin_pop(); |
| 1449 | 1452 | (void)a; |
| r3957 | r3958 | |
| 1451 | 1454 | next_fn(); |
| 1452 | 1455 | } |
| 1453 | 1456 | |
| 1454 | static | |
| 1457 | static TGP_FUNCTION( vmat_flatten | |
| 1455 | 1458 | { |
| 1456 | 1459 | int i; |
| 1457 | 1460 | float m[12]; |
| r3957 | r3958 | |
| 1477 | 1480 | next_fn(); |
| 1478 | 1481 | } |
| 1479 | 1482 | |
| 1480 | static | |
| 1483 | static TGP_FUNCTION( vmat_load1 | |
| 1481 | 1484 | { |
| 1482 | 1485 | UINT32 a = fifoin_pop(); |
| 1483 | 1486 | logerror("TGP vmat_load1 0x%x (%x)\n", a, pushpc); |
| r3957 | r3958 | |
| 1485 | 1488 | next_fn(); |
| 1486 | 1489 | } |
| 1487 | 1490 | |
| 1488 | static | |
| 1491 | static TGP_FUNCTION( ram_trans | |
| 1489 | 1492 | { |
| 1490 | 1493 | float a = ram_get_f(); |
| 1491 | 1494 | float b = ram_get_f(); |
| r3957 | r3958 | |
| 1497 | 1500 | next_fn(); |
| 1498 | 1501 | } |
| 1499 | 1502 | |
| 1500 | static | |
| 1503 | static TGP_FUNCTION( f98_load | |
| 1501 | 1504 | { |
| 1502 | 1505 | int i; |
| 1503 | 1506 | for(i=0; i<list_length; i++) { |
| r3957 | r3958 | |
| 1508 | 1511 | next_fn(); |
| 1509 | 1512 | } |
| 1510 | 1513 | |
| 1511 | static | |
| 1514 | static TGP_FUNCTION( f98 | |
| 1512 | 1515 | { |
| 1513 | 1516 | UINT32 a = fifoin_pop(); |
| 1514 | 1517 | (void)a; |
| r3957 | r3958 | |
| 1517 | 1520 | fifoin_cb = f98_load; |
| 1518 | 1521 | } |
| 1519 | 1522 | |
| 1520 | static | |
| 1523 | static TGP_FUNCTION( f99 | |
| 1521 | 1524 | { |
| 1522 | 1525 | logerror("TGP f99 (%x)\n", pushpc); |
| 1523 | 1526 | next_fn(); |
| 1524 | 1527 | } |
| 1525 | 1528 | |
| 1526 | static | |
| 1529 | static TGP_FUNCTION( f100 | |
| 1527 | 1530 | { |
| 1528 | 1531 | int i; |
| 1529 | 1532 | logerror("TGP f100 get list (%x)\n", pushpc); |
| 1530 | 1533 | for(i=0; i<list_length; i++) |
| 1531 | fifoout_push_f((mame_rand( | |
| 1534 | fifoout_push_f((mame_rand(machine) % 1000)/100.0); | |
| 1532 | 1535 | next_fn(); |
| 1533 | 1536 | } |
| 1534 | 1537 | |
| 1535 | static | |
| 1538 | static TGP_FUNCTION( groundbox_set | |
| 1536 | 1539 | { |
| 1537 | 1540 | float a = fifoin_pop_f(); |
| 1538 | 1541 | float b = fifoin_pop_f(); |
| r3957 | r3958 | |
| 1553 | 1556 | next_fn(); |
| 1554 | 1557 | } |
| 1555 | 1558 | |
| 1556 | static | |
| 1559 | static TGP_FUNCTION( f102 | |
| 1557 | 1560 | { |
| 1558 | 1561 | static int ccount = 0; |
| 1559 | 1562 | float px, py, pz; |
| r3957 | r3958 | |
| 1606 | 1609 | next_fn(); |
| 1607 | 1610 | } |
| 1608 | 1611 | |
| 1609 | static | |
| 1612 | static TGP_FUNCTION( f103 | |
| 1610 | 1613 | { |
| 1611 | 1614 | ram_scanadr = fifoin_pop() - 0x8000; |
| 1612 | 1615 | logerror("TGP f0 mve_setadr 0x%x (%x)\n", ram_scanadr, pushpc); |
| r3957 | r3958 | |
| 1615 | 1618 | } |
| 1616 | 1619 | |
| 1617 | 1620 | struct function { |
| 1618 | | |
| 1621 | tgp_func | |
| 1619 | 1622 | int count; |
| 1620 | 1623 | }; |
| 1621 | 1624 | |
| r3957 | r3958 | |
| 1813 | 1816 | }; |
| 1814 | 1817 | |
| 1815 | 1818 | |
| 1816 | static | |
| 1819 | static TGP_FUNCTION( dump | |
| 1817 | 1820 | { |
| 1818 | 1821 | logerror("TGP FIFOIN write %08x (%x)\n", fifoin_pop(), pushpc); |
| 1819 | 1822 | fifoin_cbcount = 1; |
| 1820 | 1823 | fifoin_cb = dump; |
| 1821 | 1824 | } |
| 1822 | 1825 | |
| 1823 | static | |
| 1826 | static TGP_FUNCTION( function_get_vf | |
| 1824 | 1827 | { |
| 1825 | 1828 | UINT32 f = fifoin_pop() >> 23; |
| 1826 | 1829 | |
| r3957 | r3958 | |
| 1835 | 1838 | fifoin_cb = ftab_vf[f].cb; |
| 1836 | 1839 | // logerror("TGP function %d request, %d parameters\n", f, fifoin_cbcount); |
| 1837 | 1840 | if(!fifoin_cbcount) |
| 1838 | fifoin_cb(); | |
| 1841 | fifoin_cb(machine); | |
| 1839 | 1842 | } else { |
| 1840 | 1843 | logerror("TGP function %d unimplemented (%x)\n", f, pushpc); |
| 1841 | 1844 | fifoin_cbcount = 1; |
| r3957 | r3958 | |
| 1843 | 1846 | } |
| 1844 | 1847 | } |
| 1845 | 1848 | |
| 1846 | static | |
| 1849 | static TGP_FUNCTION( function_get_swa | |
| 1847 | 1850 | { |
| 1848 | 1851 | UINT32 f = fifoin_pop(); |
| 1849 | 1852 | |
| r3957 | r3958 | |
| 1858 | 1861 | fifoin_cb = ftab_swa[f].cb; |
| 1859 | 1862 | // logerror("TGP function %d request, %d parameters\n", f, fifoin_cbcount); |
| 1860 | 1863 | if(!fifoin_cbcount) |
| 1861 | fifoin_cb(); | |
| 1864 | fifoin_cb(machine); | |
| 1862 | 1865 | } else { |
| 1863 | 1866 | logerror("TGP function %d unimplemented (%x)\n", f, pushpc); |
| 1864 | 1867 | fifoin_cbcount = 1; |
| r3957 | r3958 | |
|---|---|---|
| 163 | 163 | visarea.min_y = 0; \ |
| 164 | 164 | visarea.max_y = _y_-1; \ |
| 165 | 165 | video_screen_configure(space->machine->primary_screen, _x_, _y_, &visarea, video_screen_get_frame_period(space->machine->primary_screen).attoseconds ); \ |
| 166 | flip_screen_set(_flip_); \ | |
| 166 | flip_screen_set(space->machine, _flip_); \ | |
| 167 | 167 | } \ |
| 168 | 168 | |
| 169 | 169 | /*TODO: numbers over 65535?*/ |
| r3957 | r3958 | |
|---|---|---|
| 179 | 179 | *************************************************************************/ |
| 180 | 180 | |
| 181 | 181 | #include "driver.h" |
| 182 | #include "cpu/m6800/m6800.h" | |
| 182 | 183 | #include "slapstic.h" |
| 183 | 184 | #include "cpu/m68000/m68000.h" |
| 184 | 185 | |
| r3957 | r3958 | |
| 806 | 807 | |
| 807 | 808 | void slapstic_init(running_machine *machine, int chip) |
| 808 | 809 | { |
| 810 | cpu_type cputype = cpu_get_type(machine->cpu[0]); | |
| 811 | ||
| 809 | 812 | /* only a small number of chips are known to exist */ |
| 810 | 813 | if (chip < 101 || chip > 118) |
| 811 | 814 | return; |
| r3957 | r3958 | |
| 819 | 822 | slapstic_reset(); |
| 820 | 823 | |
| 821 | 824 | /* see if we're 68k or 6502/6809 based */ |
| 822 | access_68k = (machine->config->cpu[0].type == CPU_M68000 || | |
| 823 | machine->config->cpu[0].type == CPU_M68010); | |
| 825 | access_68k = (cputype == CPU_M68000 || cputype == CPU_M68010); | |
| 824 | 826 | |
| 825 | 827 | /* save state */ |
| 826 | 828 | state_save_register_item(machine, "slapstic", NULL, 0, state); |
| r3957 | r3958 | |
|---|---|---|
| 412 | 412 | DRIVER( hyhoo2 ) /* (c) 1987 */ |
| 413 | 413 | |
| 414 | 414 | DRIVER( jangou ) /* (c) 1983 */ |
| 415 | /* Jangou Night *//* (c) 1983 */ | |
| 415 | 416 | DRIVER( jngolady ) /* (c) 1984 */ |
| 417 | DRIVER( cntrygrl ) /* (c) 1984 Royal Denshi */ | |
| 418 | ||
| 416 | 419 | DRIVER( pastelg ) /* (c) 1985 */ |
| 420 | DRIVER( 3ds ) /* (c) 1985 */ | |
| 417 | 421 | |
| 418 | 422 | DRIVER( crystalg ) /* (c) 1986 */ |
| 419 | 423 | DRIVER( crystal2 ) /* (c) 1986 */ |
| r3957 | r3958 | |
| 1725 | 1729 | DRIVER( cadashu ) /* C21 (c) 1989 Taito America Corporation */ |
| 1726 | 1730 | DRIVER( cadashi ) /* C21 (c) 1989 Taito Corporation Japan */ |
| 1727 | 1731 | DRIVER( cadashf ) /* C21 (c) 1989 Taito Corporation Japan */ |
| 1732 | DRIVER( parentj ) /* C42 (c) 199? Taito */ | |
| 1728 | 1733 | DRIVER( galmedes ) /* (c) 1992 Visco (Japan) */ |
| 1729 | 1734 | DRIVER( earthjkr ) /* (c) 1993 Visco (Japan) */ |
| 1730 | 1735 | DRIVER( eto ) /* (c) 1994 Visco (Japan) */ |
| r3957 | r3958 | |
| 2767 | 2772 | DRIVER( spf2xjd ) |
| 2768 | 2773 | DRIVER( ddsomud ) |
| 2769 | 2774 | DRIVER( megamn2d ) |
| 2770 | DRIVER( sfz2a | |
| 2775 | DRIVER( sfz2ald ) | |
| 2771 | 2776 | DRIVER( xmvsfu1d ) |
| 2772 | 2777 | DRIVER( batcird ) |
| 2773 | 2778 | DRIVER( vsavd ) |
| r3957 | r3958 | |
| 5830 | 5835 | DRIVER( bangbead ) /* 0259 (c) 2000 Visco */ |
| 5831 | 5836 | DRIVER( nitd ) /* 0260 (c) 2000 Eleven / Gavaking */ |
| 5832 | 5837 | DRIVER( nitdbl ) /* bootleg */ |
| 5833 | DRIVER( sengoku3 ) /* 0261 (c) 2001 SNK */ | |
| 5838 | DRIVER( sengoku3 ) /* 0261 (c) 2001 Noise Factory / SNK */ | |
| 5834 | 5839 | DRIVER( kof2001 ) /* 0262 (c) 2001 Eolith / SNK */ |
| 5835 | 5840 | DRIVER( kof2001h ) /* 0262 (c) 2001 Eolith / SNK */ |
| 5836 | 5841 | DRIVER( cthd2003 ) /* bootleg of kof2001 */ |
| r3957 | r3958 | |
| 6008 | 6013 | DRIVER( agress ) /* TA-0029 (c) 1991 Palco */ |
| 6009 | 6014 | DRIVER( agressb ) /* TA-0029 (c) 1991 Palco */ |
| 6010 | 6015 | DRIVER( ddragon3 ) /* TA-0030 (c) 1990 */ |
| 6016 | DRIVER( ddrago3p ) /* TA-0030 (c) 1990 */ | |
| 6011 | 6017 | DRIVER( ddrago3j ) /* TA-0030 (c) 1990 (Japan) */ |
| 6012 | 6018 | DRIVER( ddrago3b ) /* bootleg */ |
| 6013 | 6019 | DRIVER( wwfwfest ) /* TA-0031 (c) 1991 (US) */ |
| r3957 | r3958 | |
| 7401 | 7407 | DRIVER( cb3 ) /* (c) 19?? Dyna/bootleg? */ |
| 7402 | 7408 | DRIVER( cmv801 ) /* (c) 198? Corsica */ |
| 7403 | 7409 | DRIVER( cmaster ) /* (c) 1991 Dyna */ |
| 7410 | DRIVER( cmasterb ) /* (c) 1991 Dyna */ | |
| 7411 | DRIVER( lucky8 ) /* (c) 1989 Wing Co.Ltd */ | |
| 7404 | 7412 | DRIVER( cpoker ) /* (c) 1993? IGS */ |
| 7405 | 7413 | DRIVER( cpokert ) /* (c) 1993? Tuning */ |
| 7406 | 7414 | DRIVER( csk227it ) /* (c) 198? IGS */ |
| r3957 | r3958 | |
| 7411 | 7419 | DRIVER( grndtour ) /* (c) 1993 */ |
| 7412 | 7420 | DRIVER( cabaret ) |
| 7413 | 7421 | DRIVER( jingbell ) /* (c) 1995? */ |
| 7422 | DRIVER( gp98 ) /* (c) 19?? */ | |
| 7414 | 7423 | DRIVER( lhb ) /* (c) 1995 */ |
| 7415 | 7424 | DRIVER( lhba ) /* (c) 1995 */ |
| 7416 | 7425 | DRIVER( dbc ) /* (c) 199? */ |
| r3957 | r3958 | |
| 7521 | 7530 | DRIVER( yachtmn ) /* (c) 1982 [Sanritsu] Esco */ |
| 7522 | 7531 | DRIVER( rougien ) /* (c) 1982 Sanritsu */ |
| 7523 | 7532 | DRIVER( drmicro ) /* (c) 1983 Sanritsu */ |
| 7533 | DRIVER( jantotsu ) /* (c) 1983 Sanritsu */ | |
| 7524 | 7534 | DRIVER( appoooh ) /* (c) 1984 Sega, made by Sanritsu */ |
| 7525 | 7535 | DRIVER( robowres ) /* (c) 1986 Sega */ |
| 7526 | 7536 | DRIVER( robowrb ) /* bootleg */ |
| r3957 | r3958 | |
| 8089 | 8099 | DRIVER( jolyccra ) /* (c) 1985 TAB-Austria */ |
| 8090 | 8100 | DRIVER( jolyccrb ) /* (c) 1993 Soft Design */ |
| 8091 | 8101 | DRIVER( jolycdit ) /* 199? bootleg */ |
| 8102 | DRIVER( jolycdib ) /* 1990 bootleg */ | |
| 8092 | 8103 | DRIVER( sjcd2kx3 ) /* (c) 1985 M.P.*/ |
| 8093 | 8104 | DRIVER( jolycdab ) /* (c) 1986 Inter Games */ |
| 8094 | 8105 | DRIVER( bigdeal ) /* (c) 1986 Funworld */ |
| r3957 | r3958 | |
| 8146 | 8157 | DRIVER( videomat ) /* 1990 bootleg */ |
| 8147 | 8158 | DRIVER( sigmapkr ) /* (c) 1995 Sigma */ |
| 8148 | 8159 | DRIVER( sigma2k ) /* (c) 2000 Sigma */ |
| 8149 | DRIVER( lucky8 ) /* (c) 1989 Falcon */ | |
| 8150 | 8160 | DRIVER( sidewndr ) /* (c) 1981? ACE */ |
| 8151 | 8161 | DRIVER( spellbnd ) /* (c) 1981? ACE */ |
| 8152 | 8162 | DRIVER( starspnr ) /* (c) 1982? ACE */ |
| r3957 | r3958 | |
| 8302 | 8312 | DRIVER( tetriunk ) |
| 8303 | 8313 | DRIVER( smstrv ) /* (c) 1984 SMS MFG CORP */ |
| 8304 | 8314 | DRIVER( skylncr ) /* (c) 1995 Bordun International */ |
| 8315 | DRIVER( butrfly ) /* (c) 1995 Bordun International */ | |
| 8305 | 8316 | DRIVER( madzoo ) /* (c) 1995 Bordun International */ |
| 8317 | DRIVER( leader ) /* Bootleg? */ | |
| 8306 | 8318 | DRIVER( livequiz ) /* (c) 1999 Andamiro */ |
| 8307 | 8319 | DRIVER( cowrace ) /* (c) 19?? unknown */ |
| 8308 | 8320 | DRIVER( mjsiyoub ) /* (c) 1986 Visco */ |
| r3957 | r3958 | |
| 8425 | 8437 | /* STG? */ |
| 8426 | 8438 | DRIVER ( queen ) |
| 8427 | 8439 | |
| 8440 | /* Aristocrat */ | |
| 8441 | DRIVER ( caswin ) | |
| 8442 | ||
| 8443 | /* Eagle */ | |
| 8444 | DRIVER ( janshi ) | |
| 8445 | ||
| 8428 | 8446 | #endif /* DRIVER_RECURSIVE */ |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | void jaguar_dsp_resume(running_machine *machine); |
| 34 | 34 | |
| 35 | 35 | void cojag_sound_init(running_machine *machine); |
| 36 | void cojag_sound_reset( | |
| 36 | void cojag_sound_reset(running_machine *machine); | |
| 37 | 37 | |
| 38 | 38 | void jaguar_external_int(const device_config *device, int state); |
| 39 | 39 |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | WRITE8_HANDLER( carpolo_car_border_interrupt_clear_w ); |
| 31 | 31 | WRITE8_HANDLER( carpolo_timer_interrupt_clear_w ); |
| 32 | 32 | |
| 33 | void carpolo_generate_car_car_interrupt(int car1, int car2); | |
| 34 | void carpolo_generate_ball_screen_interrupt(UINT8 cause); | |
| 35 | void carpolo_generate_car_goal_interrupt(int car, int right_goal); | |
| 36 | void carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y); | |
| 37 | void carpolo_generate_car_border_interrupt(int car, int horizontal_border); | |
| 33 | void carpolo_generate_car_car_interrupt(running_machine *machine, int car1, int car2); | |
| 34 | void carpolo_generate_ball_screen_interrupt(running_machine *machine, UINT8 cause); | |
| 35 | void carpolo_generate_car_goal_interrupt(running_machine *machine, int car, int right_goal); | |
| 36 | void carpolo_generate_car_ball_interrupt(running_machine *machine, int car, int car_x, int car_y); | |
| 37 | void carpolo_generate_car_border_interrupt(running_machine *machine, int car, int horizontal_border); | |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | /*----------- defined in video/carpolo.c -----------*/ |
| r3957 | r3958 | |
|---|---|---|
| 309 | 309 | { |
| 310 | 310 | UINT32 chip_ram_mask; |
| 311 | 311 | |
| 312 | UINT16 (*joy0dat_r)(void); | |
| 313 | UINT16 (*joy1dat_r)(void); | |
| 314 | void (*potgo_w)(UINT16 data); | |
| 312 | UINT16 (*joy0dat_r)(running_machine *machine); | |
| 313 | UINT16 (*joy1dat_r)(running_machine *machine); | |
| 314 | void (*potgo_w)(running_machine *machine, UINT16 data); | |
| 315 | 315 | |
| 316 | UINT16 (*dskbytr_r)(void); | |
| 317 | void (*dsklen_w)(UINT16 data); | |
| 316 | UINT16 (*dskbytr_r)(running_machine *machine); | |
| 317 | void (*dsklen_w)(running_machine *machine, UINT16 data); | |
| 318 | 318 | |
| 319 | void (*serdat_w)(UINT16 data); | |
| 319 | void (*serdat_w)(running_machine *machine, UINT16 data); | |
| 320 | 320 | |
| 321 | void (*scanline0_callback)(void); | |
| 322 | void (*reset_callback)(void); | |
| 323 | void (*nmi_callback)(void); | |
| 321 | void (*scanline0_callback)(running_machine *machine); | |
| 322 | void (*reset_callback)(running_machine *machine); | |
| 323 | void (*nmi_callback)(running_machine *machine); | |
| 324 | 324 | |
| 325 | 325 | UINT32 flags; |
| 326 | 326 | }; |
| r3957 | r3958 | |
| 342 | 342 | UINT16 mfr_number; /* manufacturers number */ |
| 343 | 343 | UINT32 serial_number; /* serial number */ |
| 344 | 344 | UINT16 rom_vector; /* ROM vector offset */ |
| 345 | UINT8 (*int_control_r)(void); /* interrupt control read */ | |
| 346 | void (*int_control_w)(UINT8 data); /* interrupt control write */ | |
| 347 | void (*install)(offs_t base); /* memory installation */ | |
| 348 | void (*uninstall)(offs_t base); /* memory uninstallation */ | |
| 345 | UINT8 (*int_control_r)(running_machine *machine); /* interrupt control read */ | |
| 346 | void (*int_control_w)(running_machine *machine, UINT8 data); /* interrupt control write */ | |
| 347 | void (*install)(running_machine *machine, offs_t base); /* memory installation */ | |
| 348 | void (*uninstall)(running_machine *machine, offs_t base); /* memory uninstallation */ | |
| 349 | 349 | }; |
| 350 | 350 | |
| 351 | 351 | |
| r3957 | r3958 | |
| 376 | 376 | READ16_HANDLER( amiga_custom_r ); |
| 377 | 377 | WRITE16_HANDLER( amiga_custom_w ); |
| 378 | 378 | |
| 379 | void amiga_serial_in_w(UINT16 data); | |
| 380 | attotime amiga_get_serial_char_period(void); | |
| 379 | void amiga_serial_in_w(running_machine *machine, UINT16 data); | |
| 380 | attotime amiga_get_serial_char_period(running_machine *machine); | |
| 381 | 381 | |
| 382 | void amiga_add_autoconfig(const amiga_autoconfig_device *device); | |
| 382 | void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_device *device); | |
| 383 | 383 | READ16_HANDLER( amiga_autoconfig_r ); |
| 384 | 384 | WRITE16_HANDLER( amiga_autoconfig_w ); |
| 385 | 385 |
| r3957 | r3958 | |
|---|---|---|
| 128 | 128 | WRITE16_HANDLER( hd68k_ds3_program_w ); |
| 129 | 129 | |
| 130 | 130 | /* DSK board */ |
| 131 | void hddsk_update_pif(UINT32 pins); | |
| 131 | void hddsk_update_pif(const device_config *device, UINT32 pins); | |
| 132 | 132 | WRITE16_HANDLER( hd68k_dsk_control_w ); |
| 133 | 133 | READ16_HANDLER( hd68k_dsk_ram_r ); |
| 134 | 134 | WRITE16_HANDLER( hd68k_dsk_ram_w ); |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | VIDEO_UPDATE( psx ); |
| 15 | 15 | INTERRUPT_GEN( psx_vblank ); |
| 16 | 16 | extern void psx_gpu_reset( running_machine *machine ); |
| 17 | extern void psx_gpu_read( UINT32 *p_ram, INT32 n_size ); | |
| 18 | extern void psx_gpu_write( UINT32 *p_ram, INT32 n_size ); | |
| 17 | extern void psx_gpu_read( running_machine *, UINT32 *p_ram, INT32 n_size ); | |
| 18 | extern void psx_gpu_write( running_machine *, UINT32 *p_ram, INT32 n_size ); | |
| 19 | 19 | READ32_HANDLER( psx_gpu_r ); |
| 20 | 20 | WRITE32_HANDLER( psx_gpu_w ); |
| 21 | 21 | extern void psx_lightgun_set( int, int ); |
| r3957 | r3958 | |
| 24 | 24 | |
| 25 | 25 | extern UINT32 *g_p_n_psxram; |
| 26 | 26 | extern size_t g_n_psxramsize; |
| 27 | typedef void ( *psx_dma_read_handler )( UINT32, INT32 ); | |
| 28 | typedef void ( *psx_dma_write_handler )( UINT32, INT32 ); | |
| 27 | typedef void ( *psx_dma_read_handler )( running_machine *, UINT32, INT32 ); | |
| 28 | typedef void ( *psx_dma_write_handler )( running_machine *, UINT32, INT32 ); | |
| 29 | 29 | WRITE32_HANDLER( psx_com_delay_w ); |
| 30 | 30 | READ32_HANDLER( psx_com_delay_r ); |
| 31 | 31 | WRITE32_HANDLER( psx_irq_w ); |
| r3957 | r3958 | |
| 39 | 39 | READ32_HANDLER( psx_counter_r ); |
| 40 | 40 | WRITE32_HANDLER( psx_sio_w ); |
| 41 | 41 | READ32_HANDLER( psx_sio_r ); |
| 42 | typedef void ( *psx_sio_handler )( int ); | |
| 42 | typedef void ( *psx_sio_handler )( running_machine *, int ); | |
| 43 | 43 | extern void psx_sio_install_handler( int, psx_sio_handler ); |
| 44 | 44 | extern void psx_sio_input( running_machine *, int, int, int ); |
| 45 | 45 |
| r3957 | r3958 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | extern int sys18_sound_info[4*2]; |
| 103 | 103 | |
| 104 | extern void sys16_patch_code( int offset, int data ); | |
| 104 | typedef struct _sys16_patch sys16_patch; | |
| 105 | struct _sys16_patch | |
| 106 | { | |
| 107 | offs_t offset; | |
| 108 | UINT8 data; | |
| 109 | }; | |
| 105 | 110 | |
| 111 | extern void sys16_patch_code( running_machine *machine, const sys16_patch *patch, int count ); | |
| 112 | ||
| 106 | 113 | #define SYS16_MWA16_PALETTERAM sys16_paletteram_w |
| 107 | 114 | #define SYS16_MRA16_PALETTERAM SMH_RAM |
| 108 | 115 |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | extern offs_t gaelco3d_texture_size; |
| 15 | 15 | extern offs_t gaelco3d_texmask_size; |
| 16 | 16 | |
| 17 | void gaelco3d_render(voi | |
| 17 | void gaelco3d_render(const device_config *screen); | |
| 18 | 18 | WRITE32_HANDLER( gaelco3d_render_w ); |
| 19 | 19 | |
| 20 | 20 | WRITE16_HANDLER( gaelco3d_paletteram_w ); |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | extern VIDEO_START( n64 ); |
| 11 | 11 | extern VIDEO_UPDATE( n64 ); |
| 12 | extern void rdp_process_list( | |
| 12 | extern void rdp_process_list(running_machine *machine); | |
| 13 | 13 | |
| 14 | 14 | #define DACRATE_NTSC (48681812) |
| 15 | 15 | #define DACRATE_PAL (49656530) |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #ifndef _SNES_H_ |
| 2 | 2 | #define _SNES_H_ |
| 3 | 3 | |
| 4 | #include "streams.h" | |
| 4 | 5 | #include "sound/custom.h" |
| 5 | 6 | |
| 6 | 7 | /* |
| r3957 | r3958 | |
| 493 | 494 | extern WRITE8_HANDLER( spc_ram_w ); |
| 494 | 495 | extern READ8_HANDLER( spc_ipl_r ); |
| 495 | 496 | extern CUSTOM_START( snes_sh_start ); |
| 496 | extern | |
| 497 | extern STREAM_UPDATE( snes_sh_update | |
| 497 | 498 | |
| 498 | 499 | /* Stuff from OpenSPC 0.3.99 by Brad Martin */ |
| 499 | 500 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | 51 | #define MDRV_NAOMIBD_ADD(_tag, _type) \ |
| 52 | MDRV_DEVICE_ADD(_tag, NAOMI_BOARD) \ | |
| 52 | MDRV_DEVICE_ADD(_tag, NAOMI_BOARD, 0) \ | |
| 53 | 53 | MDRV_DEVICE_CONFIG_DATA32(naomibd_config, type, _type) |
| 54 | 54 | |
| 55 | 55 | #define MDRV_NAOMI_ROM_BOARD_ADD(_tag, _region) \ |
| r3957 | r3958 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | /*----------- defined in audio/scramble.c -----------*/ |
| 191 | 191 | |
| 192 | void scramble_sh_init(void); | |
| 193 | void sfx_sh_init(void); | |
| 192 | void scramble_sh_init(running_machine *machine); | |
| 193 | void sfx_sh_init(running_machine *machine); | |
| 194 | 194 | |
| 195 | 195 | WRITE8_HANDLER( scramble_filter_w ); |
| 196 | 196 | WRITE8_HANDLER( frogger_filter_w ); |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | CPUS += Z80 |
| 37 | 37 | CPUS += Z180 |
| 38 | CPUS += 8080 | |
| 39 | CPUS += 8085A | |
| 38 | CPUS += I8085 | |
| 40 | 39 | CPUS += M6502 |
| 41 | 40 | CPUS += M65C02 |
| 42 | 41 | CPUS += M65SC02 |
| r3957 | r3958 | |
| 133 | 132 | CPUS += TMS32032 |
| 134 | 133 | CPUS += TMS32051 |
| 135 | 134 | CPUS += CCPU |
| 136 | CPUS += ADSP2100 | |
| 137 | CPUS += ADSP2101 | |
| 138 | CPUS += ADSP2104 | |
| 139 | CPUS += ADSP2105 | |
| 140 | CPUS += ADSP2115 | |
| 141 | CPUS += ADSP2181 | |
| 135 | CPUS += ADSP21XX | |
| 142 | 136 | CPUS += PSXCPU |
| 143 | 137 | CPUS += CXD8661R |
| 144 | 138 | CPUS += ASAP |
| r3957 | r3958 | |
| 1173 | 1167 | $(DRIVERS)/bankp.o $(VIDEO)/bankp.o \ |
| 1174 | 1168 | $(DRIVERS)/chinsan.o \ |
| 1175 | 1169 | $(DRIVERS)/drmicro.o $(VIDEO)/drmicro.o \ |
| 1170 | $(DRIVERS)/jantotsu.o \ | |
| 1176 | 1171 | $(DRIVERS)/mayumi.o $(VIDEO)/mayumi.o \ |
| 1177 | 1172 | $(DRIVERS)/mermaid.o $(VIDEO)/mermaid.o \ |
| 1178 | 1173 | $(DRIVERS)/mjkjidai.o $(VIDEO)/mjkjidai.o \ |
| r3957 | r3958 | |
| 1363 | 1358 | $(DRIVERS)/nycaptor.o $(MACHINE)/nycaptor.o $(VIDEO)/nycaptor.o \ |
| 1364 | 1359 | $(DRIVERS)/opwolf.o $(MACHINE)/opwolf.o \ |
| 1365 | 1360 | $(DRIVERS)/othunder.o $(VIDEO)/othunder.o \ |
| 1361 | $(DRIVERS)/parentj.o \ | |
| 1366 | 1362 | $(DRIVERS)/pitnrun.o $(MACHINE)/pitnrun.o $(VIDEO)/pitnrun.o \ |
| 1367 | 1363 | $(DRIVERS)/qix.o $(MACHINE)/qix.o $(AUDIO)/qix.o $(VIDEO)/qix.o \ |
| 1368 | 1364 | $(DRIVERS)/rainbow.o $(MACHINE)/rainbow.o \ |
| r3957 | r3958 | |
| 1555 | 1551 | $(DRIVERS)/koftball.o \ |
| 1556 | 1552 | $(DRIVERS)/calomega.o $(VIDEO)/calomega.o \ |
| 1557 | 1553 | $(DRIVERS)/carrera.o \ |
| 1554 | $(DRIVERS)/caswin.o \ | |
| 1558 | 1555 | $(DRIVERS)/cave.o $(VIDEO)/cave.o \ |
| 1559 | $(DRIVERS)/cherrym.o \ | |
| 1560 | 1556 | $(DRIVERS)/cidelsa.o $(VIDEO)/cidelsa.o \ |
| 1561 | 1557 | $(DRIVERS)/coinmstr.o \ |
| 1562 | 1558 | $(DRIVERS)/comebaby.o \ |
| r3957 | r3958 | |
| 1606 | 1602 | $(DRIVERS)/itgambl3.o \ |
| 1607 | 1603 | $(DRIVERS)/itgamble.o \ |
| 1608 | 1604 | $(DRIVERS)/jackpool.o \ |
| 1605 | $(DRIVERS)/janshi.o \ | |
| 1609 | 1606 | $(DRIVERS)/jokrwild.o \ |
| 1610 | 1607 | $(DRIVERS)/jongkyo.o \ |
| 1611 | 1608 | $(DRIVERS)/kingpin.o \ |
| r3957 | r3958 | |
| 1617 | 1614 | $(DRIVERS)/limenko.o \ |
| 1618 | 1615 | $(DRIVERS)/ltcasino.o \ |
| 1619 | 1616 | $(DRIVERS)/lucky74.o $(VIDEO)/lucky74.o \ |
| 1620 | $(DRIVERS)/lucky8.o \ | |
| 1621 | 1617 | $(DRIVERS)/magic10.o \ |
| 1622 | 1618 | $(DRIVERS)/magicfly.o \ |
| 1623 | 1619 | $(DRIVERS)/magictg.o \ |
| r3957 | r3958 | |
|---|---|---|
| 194 | 194 | UINT8 color = ((attr & 0x03) << 4) | ((attr & 0x3c) >> 2); |
| 195 | 195 | SET_TILE_INFO( |
| 196 | 196 | 0, |
| 197 | xevious_fg_videoram[tile_index] | (flip_screen_get() ? 0x100 : 0), | |
| 197 | xevious_fg_videoram[tile_index] | (flip_screen_get(machine) ? 0x100 : 0), | |
| 198 | 198 | color, |
| 199 | TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen_get() ? TILE_FLIPX : 0)); | |
| 199 | TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen_get(machine) ? TILE_FLIPX : 0)); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 311 | 311 | tilemap_set_scrolly(fg_tilemap,0,scroll); |
| 312 | 312 | break; |
| 313 | 313 | case 7: |
| 314 | flip_screen_set(scroll & 1); | |
| 314 | flip_screen_set(space->machine, scroll & 1); | |
| 315 | 315 | break; |
| 316 | 316 | default: |
| 317 | 317 | logerror("CRTC WRITE REG: %x Data: %03x\n",reg, scroll); |
| r3957 | r3958 | |
| 454 | 454 | sx = spriteram_2[offs + 1] - 40 + 0x100*(spriteram_3[offs + 1] & 1); |
| 455 | 455 | sy = 28*8-spriteram_2[offs]-1; |
| 456 | 456 | |
| 457 | if (flip_screen_get()) | |
| 457 | if (flip_screen_get(machine)) | |
| 458 | 458 | { |
| 459 | 459 | flipx = !flipx; |
| 460 | 460 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 163 | 163 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); |
| 164 | 164 | |
| 165 | 165 | /* bit 6 flips screen */ |
| 166 | flip_screen_set(data & 0x40); | |
| 166 | flip_screen_set(space->machine, data & 0x40); | |
| 167 | 167 | |
| 168 | 168 | /* bit 7 enables characters? Just a guess */ |
| 169 | 169 | chon = ~data & 0x80; |
| r3957 | r3958 | |
| 208 | 208 | int color = attr & 0x07; |
| 209 | 209 | int flipx = attr & 0x08; |
| 210 | 210 | |
| 211 | if (flip_screen_get()) | |
| 211 | if (flip_screen_get(machine)) | |
| 212 | 212 | { |
| 213 | 213 | sx = 240 - sx; |
| 214 | 214 | sy = 240 - sy; |
| r3957 | r3958 | |
| 218 | 218 | drawgfx(bitmap,machine->gfx[2], |
| 219 | 219 | code, |
| 220 | 220 | color, |
| 221 | flipx,flip_screen_get(), | |
| 221 | flipx,flip_screen_get(machine), | |
| 222 | 222 | sx,sy, |
| 223 | 223 | cliprect,TRANSPARENCY_PEN,15); |
| 224 | 224 | } |
| r3957 | r3958 | |
|---|---|---|
| 127 | 127 | if (data&0x4) txt_enable = 0; else txt_enable = 1; |
| 128 | 128 | if (data&0x8) sprite_enable=0; else sprite_enable=1; |
| 129 | 129 | |
| 130 | flip_screen_set(data & 0x40); | |
| 130 | flip_screen_set(space->machine, data & 0x40); | |
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| r3957 | r3958 | |
| 154 | 154 | sprite = buffered_spriteram16[offs+1]; |
| 155 | 155 | sprite &= 0x3fff; |
| 156 | 156 | |
| 157 | if (flip_screen_get()) { | |
| 157 | if (flip_screen_get(machine)) { | |
| 158 | 158 | x=240-x; |
| 159 | 159 | y=240-y; |
| 160 | 160 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | WRITE8_HANDLER( tryout_flipscreen_w ) |
| 153 | 153 | { |
| 154 | flip_screen_set(data & 1); | |
| 154 | flip_screen_set(space->machine, data & 1); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | static TILEMAP_MAPPER( get_fg_memory_offset ) |
| r3957 | r3958 | |
| 199 | 199 | fy = 0; |
| 200 | 200 | inc = 16; |
| 201 | 201 | |
| 202 | if (flip_screen_get()) | |
| 202 | if (flip_screen_get(machine)) | |
| 203 | 203 | { |
| 204 | 204 | x = 240 - x; |
| 205 | 205 | fx = !fx; |
| r3957 | r3958 | |
| 239 | 239 | |
| 240 | 240 | int scrollx; |
| 241 | 241 | |
| 242 | if (!flip_screen_get()) | |
| 242 | if (!flip_screen_get(screen->machine)) | |
| 243 | 243 | tilemap_set_scrollx(fg_tilemap, 0, 16); /* Assumed hard-wired */ |
| 244 | 244 | else |
| 245 | 245 | tilemap_set_scrollx(fg_tilemap, 0, -8); /* Assumed hard-wired */ |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | x = sx + xc * 8; |
| 79 | 79 | y = (sy + yc * 8) & 0xff; |
| 80 | 80 | |
| 81 | if (flip_screen_get()) | |
| 81 | if (flip_screen_get(screen->machine)) | |
| 82 | 82 | { |
| 83 | 83 | x = 248 - x; |
| 84 | 84 | y = 248 - y; |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | WRITE8_HANDLER( rocnrope_flipscreen_w ) |
| 98 | 98 | { |
| 99 | if (flip_screen_get() != (~data & 0x01)) | |
| 99 | if (flip_screen_get(space->machine) != (~data & 0x01)) | |
| 100 | 100 | { |
| 101 | flip_screen_set(~data & 0x01); | |
| 101 | flip_screen_set(space->machine, ~data & 0x01); | |
| 102 | 102 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 103 | 103 | } |
| 104 | 104 | } |
| r3957 | r3958 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | READ8_HANDLER( docastle_flipscreen_off_r ) |
| 79 | 79 | { |
| 80 | flip_screen_set(0); | |
| 80 | flip_screen_set(space->machine, 0); | |
| 81 | 81 | tilemap_mark_all_tiles_dirty(docastle_tilemap); |
| 82 | 82 | return 0; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | READ8_HANDLER( docastle_flipscreen_on_r ) |
| 86 | 86 | { |
| 87 | flip_screen_set(1); | |
| 87 | flip_screen_set(space->machine, 1); | |
| 88 | 88 | tilemap_mark_all_tiles_dirty(docastle_tilemap); |
| 89 | 89 | return 1; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | WRITE8_HANDLER( docastle_flipscreen_off_w ) |
| 93 | 93 | { |
| 94 | flip_screen_set(0); | |
| 94 | flip_screen_set(space->machine, 0); | |
| 95 | 95 | tilemap_mark_all_tiles_dirty(docastle_tilemap); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | WRITE8_HANDLER( docastle_flipscreen_on_w ) |
| 99 | 99 | { |
| 100 | flip_screen_set(1); | |
| 100 | flip_screen_set(space->machine, 1); | |
| 101 | 101 | tilemap_mark_all_tiles_dirty(docastle_tilemap); |
| 102 | 102 | } |
| 103 | 103 | |
| r3957 | r3958 | |
| 188 | 188 | flipy = spriteram[offs + 2] & 0x80; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | if (flip_screen_get()) | |
| 191 | if (flip_screen_get(machine)) | |
| 192 | 192 | { |
| 193 | 193 | sx = 240 - sx; |
| 194 | 194 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | { |
| 57 | 57 | int bank; |
| 58 | 58 | |
| 59 | flip_screen_set(~data & 0x80); | |
| 59 | flip_screen_set(space->machine, ~data & 0x80); | |
| 60 | 60 | |
| 61 | 61 | tilemap_set_palette_offset(bg_tilemap, (data & 0x07) << 4); |
| 62 | 62 | tilemap_set_palette_offset(tx_tilemap, (data & 0x07) << 4); |
| r3957 | r3958 | |
| 107 | 107 | sx = 288-16 - sx; |
| 108 | 108 | sy += 8; |
| 109 | 109 | |
| 110 | if (flip_screen_get()) | |
| 110 | if (flip_screen_get(machine)) | |
| 111 | 111 | { |
| 112 | 112 | sx = 288-16 - sx; |
| 113 | 113 | sy = 224-16 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "deprecat.h" | |
| 34 | 33 | #include "namcond1.h" // only while debugging |
| 35 | 34 | #include "video/ygv608.h" |
| 36 | 35 | |
| r3957 | r3958 | |
| 51 | 50 | static tilemap *tilemap_B = NULL; |
| 52 | 51 | static bitmap_t *work_bitmap = NULL; |
| 53 | 52 | |
| 54 | static void HandleYGV608Reset( void ); | |
| 55 | static void HandleRomTransfers( void ); | |
| 53 | static void HandleYGV608Reset( running_machine *machine ); | |
| 54 | static void HandleRomTransfers( running_machine *machine ); | |
| 56 | 55 | static void SetPreShortcuts( int reg, int data ); |
| 57 | static void SetPostShortcuts( int reg ); | |
| 56 | static void SetPostShortcuts( running_machine *machine, int reg ); | |
| 58 | 57 | |
| 59 | 58 | #ifdef MAME_DEBUG |
| 60 | 59 | static void ShowYGV608Registers( void ); |
| r3957 | r3958 | |
| 482 | 481 | ygv608.tilemap_resize = 1; |
| 483 | 482 | |
| 484 | 483 | for(i = 0; i < 50; i++) |
| 485 | SetPostShortcuts(i); | |
| 484 | SetPostShortcuts(machine, i); | |
| 486 | 485 | } |
| 487 | 486 | |
| 488 | 487 | static void ygv608_register_state_save(running_machine *machine) |
| r3957 | r3958 | |
| 1238 | 1237 | #endif |
| 1239 | 1238 | SetPreShortcuts (regNum, data); |
| 1240 | 1239 | ygv608.regs.b[regNum] = data; |
| 1241 | SetPostShortcuts (regNum); | |
| 1240 | SetPostShortcuts (space->machine, regNum); | |
| 1242 | 1241 | if (ygv608.ports.s.p5 & p5_rwai) |
| 1243 | 1242 | { |
| 1244 | 1243 | regNum ++; |
| r3957 | r3958 | |
| 1265 | 1264 | case 0x07: /* P#7 - system control port */ |
| 1266 | 1265 | ygv608.ports.b[7] = data; |
| 1267 | 1266 | if (ygv608.ports.b[7] & 0x3e) |
| 1268 | HandleRomTransfers(); | |
| 1267 | HandleRomTransfers(space->machine); | |
| 1269 | 1268 | if (ygv608.ports.b[7] & 0x01) |
| 1270 | HandleYGV608Reset(); | |
| 1269 | HandleYGV608Reset(space->machine); | |
| 1271 | 1270 | break; |
| 1272 | 1271 | |
| 1273 | 1272 | default: |
| r3957 | r3958 | |
| 1276 | 1275 | } |
| 1277 | 1276 | } |
| 1278 | 1277 | |
| 1279 | static void HandleYGV608Reset( | |
| 1278 | static void HandleYGV608Reset( running_machine *machine ) | |
| 1280 | 1279 | { |
| 1281 | 1280 | int i; |
| 1282 | 1281 | |
| r3957 | r3958 | |
| 1297 | 1296 | /* should set shortcuts here too */ |
| 1298 | 1297 | for( i=0; i<50; i++ ) { |
| 1299 | 1298 | //SetPreShortcuts( i ); |
| 1300 | SetPostShortcuts( i ); | |
| 1299 | SetPostShortcuts( machine, i ); | |
| 1301 | 1300 | } |
| 1302 | 1301 | } |
| 1303 | 1302 | |
| r3957 | r3958 | |
| 1308 | 1307 | - So leave it in! |
| 1309 | 1308 | */ |
| 1310 | 1309 | |
| 1311 | static void HandleRomTransfers( | |
| 1310 | static void HandleRomTransfers(running_machine *machine) | |
| 1312 | 1311 | { |
| 1313 | 1312 | #if 0 |
| 1314 | 1313 | static UINT8 *sdt = (UINT8 *)ygv608.scroll_data_table; |
| 1315 | 1314 | static UINT8 *sat = (UINT8 *)ygv608.sprite_attribute_table.b; |
| 1316 | 1315 | |
| 1317 | 1316 | /* fudge copy from sprite data for now... */ |
| 1318 | UINT8 *RAM = | |
| 1317 | UINT8 *RAM = machine->memory_region[0]; | |
| 1319 | 1318 | int i; |
| 1320 | 1319 | |
| 1321 | 1320 | int src = ( ( (int)ygv608.regs.s.tb13 << 8 ) + |
| r3957 | r3958 | |
| 1420 | 1419 | // Set any "short-cut" variables after we have updated the YGV608 registers |
| 1421 | 1420 | // - these are used only in optimisation of the emulation |
| 1422 | 1421 | |
| 1423 | static void SetPostShortcuts( int reg ) | |
| 1422 | static void SetPostShortcuts( running_machine *machine, int reg ) | |
| 1424 | 1423 | { |
| 1425 | 1424 | int plane, addr; |
| 1426 | 1425 | |
| r3957 | r3958 | |
| 1431 | 1430 | UINT8 yTile = ygv608.regs.s.r0 & r0_pny; |
| 1432 | 1431 | |
| 1433 | 1432 | if (yTile >= ygv608.page_y) |
| 1434 | logerror ("%s:setting pny(%d) >= page_y(%d)\n", cpuexec_describe_context( | |
| 1433 | logerror ("%s:setting pny(%d) >= page_y(%d)\n", cpuexec_describe_context(machine), | |
| 1435 | 1434 | yTile, ygv608.page_y ); |
| 1436 | 1435 | yTile &= (ygv608.page_y - 1); |
| 1437 | 1436 | ygv608.regs.s.r0 &= ~r0_pny; |
| r3957 | r3958 | |
| 1444 | 1443 | UINT8 xTile = ygv608.regs.s.r1 & r1_pnx; |
| 1445 | 1444 | |
| 1446 | 1445 | if (xTile >= ygv608.page_x) |
| 1447 | logerror ("%s:setting pnx(%d) >= page_x(%d)\n", cpuexec_describe_context( | |
| 1446 | logerror ("%s:setting pnx(%d) >= page_x(%d)\n", cpuexec_describe_context(machine), | |
| 1448 | 1447 | xTile, ygv608.page_x ); |
| 1449 | 1448 | xTile &= (ygv608.page_x - 1); |
| 1450 | 1449 | ygv608.regs.s.r1 &= ~r1_pnx; |
| r3957 | r3958 | |
|---|---|---|
| 181 | 181 | count = 0; |
| 182 | 182 | strwid = senjyo_bgstripes; |
| 183 | 183 | if (strwid == 0) strwid = 0x100; |
| 184 | if (flip_screen_get()) strwid ^= 0xff; | |
| 184 | if (flip_screen_get(machine)) strwid ^= 0xff; | |
| 185 | 185 | |
| 186 | 186 | for (x = 0;x < 256;x++) |
| 187 | 187 | { |
| 188 | if (flip_screen_get()) | |
| 188 | if (flip_screen_get(machine)) | |
| 189 | 189 | for (y = 0;y < 256;y++) |
| 190 | 190 | *BITMAP_ADDR16(bitmap, y, 255 - x) = 384 + pen; |
| 191 | 191 | else |
| r3957 | r3958 | |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | static void draw_radar(bitmap_t *bitmap,const rectangle *cliprect) | |
| 205 | static void draw_radar(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect) | |
| 206 | 206 | { |
| 207 | 207 | int offs,x; |
| 208 | 208 | |
| r3957 | r3958 | |
| 215 | 215 | sx = (8 * (offs % 8) + x) + 256-64; |
| 216 | 216 | sy = ((offs & 0x1ff) / 8) + 96; |
| 217 | 217 | |
| 218 | if (flip_screen_get()) | |
| 218 | if (flip_screen_get(machine)) | |
| 219 | 219 | { |
| 220 | 220 | sx = 255 - sx; |
| 221 | 221 | sy = 255 - sy; |
| r3957 | r3958 | |
| 250 | 250 | flipx = spriteram[offs+1] & 0x40; |
| 251 | 251 | flipy = spriteram[offs+1] & 0x80; |
| 252 | 252 | |
| 253 | if (flip_screen_get()) | |
| 253 | if (flip_screen_get(machine)) | |
| 254 | 254 | { |
| 255 | 255 | flipx = !flipx; |
| 256 | 256 | flipy = !flipy; |
| r3957 | r3958 | |
| 295 | 295 | |
| 296 | 296 | scrollx = senjyo_scrollx1[0]; |
| 297 | 297 | scrolly = senjyo_scrolly1[0] + 256 * senjyo_scrolly1[1]; |
| 298 | if (flip_screen_get()) | |
| 298 | if (flip_screen_get(screen->machine)) | |
| 299 | 299 | scrollx = -scrollx; |
| 300 | 300 | tilemap_set_scrollx(bg1_tilemap,0,scrollx); |
| 301 | 301 | tilemap_set_scrolly(bg1_tilemap,0,scrolly); |
| r3957 | r3958 | |
| 307 | 307 | scrollx = senjyo_scrollx1[0]; |
| 308 | 308 | scrolly = senjyo_scrolly1[0] + 256 * senjyo_scrolly1[1]; |
| 309 | 309 | } |
| 310 | if (flip_screen_get()) | |
| 310 | if (flip_screen_get(screen->machine)) | |
| 311 | 311 | scrollx = -scrollx; |
| 312 | 312 | tilemap_set_scrollx(bg2_tilemap,0,scrollx); |
| 313 | 313 | tilemap_set_scrolly(bg2_tilemap,0,scrolly); |
| 314 | 314 | |
| 315 | 315 | scrollx = senjyo_scrollx3[0]; |
| 316 | 316 | scrolly = senjyo_scrolly3[0] + 256 * senjyo_scrolly3[1]; |
| 317 | if (flip_screen_get()) | |
| 317 | if (flip_screen_get(screen->machine)) | |
| 318 | 318 | scrollx = -scrollx; |
| 319 | 319 | tilemap_set_scrollx(bg3_tilemap,0,scrollx); |
| 320 | 320 | tilemap_set_scrolly(bg3_tilemap,0,scrolly); |
| r3957 | r3958 | |
| 329 | 329 | tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0); |
| 330 | 330 | draw_sprites(screen->machine, bitmap,cliprect,3); |
| 331 | 331 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); |
| 332 | draw_radar(bitmap,cliprect); | |
| 332 | draw_radar(screen->machine,bitmap,cliprect); | |
| 333 | 333 | |
| 334 | 334 | #if 0 |
| 335 | 335 | { |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "deprecat.h" | |
| 21 | 20 | #include "sound/scsp.h" |
| 22 | 21 | #include "includes/stv.h" |
| 23 | 22 | |
| r3957 | r3958 | |
| 186 | 185 | |
| 187 | 186 | |
| 188 | 187 | |
| 189 | static void stv_vdp1_process_list( | |
| 188 | static void stv_vdp1_process_list(running_machine *machine); | |
| 190 | 189 | |
| 191 | 190 | READ32_HANDLER( stv_vdp1_regs_r ) |
| 192 | 191 | { |
| r3957 | r3958 | |
| 314 | 313 | if ( STV_VDP1_PTMR == 1 ) |
| 315 | 314 | { |
| 316 | 315 | if ( vdp1_sprite_log ) logerror( "VDP1: Access to register PTMR = %1X\n", STV_VDP1_PTMR ); |
| 317 | stv_vdp1_process_list( ); | |
| 316 | stv_vdp1_process_list( space->machine ); | |
| 318 | 317 | } |
| 319 | 318 | } |
| 320 | 319 | else if ( ACCESSING_BITS_0_15 ) |
| r3957 | r3958 | |
| 856 | 855 | static UINT16 sprite_colorbank; |
| 857 | 856 | |
| 858 | 857 | |
| 859 | static void (*drawpixel)(int x, int y, int patterndata, int offsetcnt); | |
| 858 | static void (*drawpixel)(running_machine *machine, int x, int y, int patterndata, int offsetcnt); | |
| 860 | 859 | |
| 861 | static void drawpixel_poly(int x, int y, int patterndata, int offsetcnt) | |
| 860 | static void drawpixel_poly(running_machine *machine, int x, int y, int patterndata, int offsetcnt) | |
| 862 | 861 | { |
| 863 | 862 | stv_framebuffer_draw_lines[y][x] = stv2_current_sprite.CMDCOLR; |
| 864 | 863 | } |
| 865 | 864 | |
| 866 | static void drawpixel_8bpp_trans(int x, int y, int patterndata, int offsetcnt) | |
| 865 | static void drawpixel_8bpp_trans(running_machine *machine, int x, int y, int patterndata, int offsetcnt) | |
| 867 | 866 | { |
| 868 | 867 | UINT16 pix; |
| 869 | 868 | |
| r3957 | r3958 | |
| 874 | 873 | } |
| 875 | 874 | } |
| 876 | 875 | |
| 877 | static void drawpixel_4bpp_notrans(int x, int y, int patterndata, int offsetcnt) | |
| 876 | static void drawpixel_4bpp_notrans(running_machine *machine, int x, int y, int patterndata, int offsetcnt) | |
| 878 | 877 | { |
| 879 | 878 | UINT16 pix; |
| 880 | 879 | |
| r3957 | r3958 | |
| 883 | 882 | stv_framebuffer_draw_lines[y][x] = pix | sprite_colorbank; |
| 884 | 883 | } |
| 885 | 884 | |
| 886 | static void drawpixel_4bpp_trans(int x, int y, int patterndata, int offsetcnt) | |
| 885 | static void drawpixel_4bpp_trans(running_machine *machine, int x, int y, int patterndata, int offsetcnt) | |
| 887 | 886 | { |
| 888 | 887 | UINT16 pix; |
| 889 | 888 | |
| r3957 | r3958 | |
| 893 | 892 | stv_framebuffer_draw_lines[y][x] = pix | sprite_colorbank; |
| 894 | 893 | } |
| 895 | 894 | |
| 896 | static void drawpixel_generic(int x, int y, int patterndata, int offsetcnt) | |
| 895 | static void drawpixel_generic(running_machine *machine, int x, int y, int patterndata, int offsetcnt) | |
| 897 | 896 | { |
| 898 | 897 | int pix,mode,transmask, spd = stv2_current_sprite.CMDPMOD & 0x40; |
| 899 | 898 | int mesh = stv2_current_sprite.CMDPMOD & 0x100; |
| r3957 | r3958 | |
| 964 | 963 | pix = pix+(stv2_current_sprite.CMDCOLR&0xff80); |
| 965 | 964 | transmask = 0x7f; |
| 966 | 965 | mode = 3; |
| 967 | // pix = mame_rand( | |
| 966 | // pix = mame_rand(machine); | |
| 968 | 967 | break; |
| 969 | 968 | case 0x0020: // mode 4 256 colour bank mode (8bits) (hanagumi title) |
| 970 | 969 | pix = gfxdata[patterndata+offsetcnt]; |
| r3957 | r3958 | |
| 978 | 977 | transmask = 0xffff; |
| 979 | 978 | break; |
| 980 | 979 | default: // other settings illegal |
| 981 | pix = mame_rand( | |
| 980 | pix = mame_rand(machine); | |
| 982 | 981 | mode = 0; |
| 983 | 982 | transmask = 0xff; |
| 984 | 983 | } |
| r3957 | r3958 | |
| 1083 | 1082 | } |
| 1084 | 1083 | |
| 1085 | 1084 | |
| 1086 | static void vdp1_fill_slope(const rectangle *cliprect, int patterndata, int xsize, | |
| 1085 | static void vdp1_fill_slope(running_machine *machine, const rectangle *cliprect, int patterndata, int xsize, | |
| 1087 | 1086 | INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2, |
| 1088 | 1087 | INT32 u1, INT32 u2, INT32 slu1, INT32 slu2, INT32 *nu1, INT32 *nu2, |
| 1089 | 1088 | INT32 v1, INT32 v2, INT32 slv1, INT32 slv2, INT32 *nv1, INT32 *nv2, |
| r3957 | r3958 | |
| 1173 | 1172 | xx2 = cliprect->max_x; |
| 1174 | 1173 | |
| 1175 | 1174 | while(xx1 <= xx2) { |
| 1176 | drawpixel(xx1,_y1, | |
| 1175 | drawpixel(machine,xx1,_y1, | |
| 1177 | 1176 | patterndata, |
| 1178 | 1177 | (v>>FRAC_SHIFT)*xsize+(u>>FRAC_SHIFT)); |
| 1179 | 1178 | xx1++; |
| r3957 | r3958 | |
| 1199 | 1198 | *nv2 = v2; |
| 1200 | 1199 | } |
| 1201 | 1200 | |
| 1202 | static void vdp1_fill_line(const rectangle *cliprect, int patterndata, int xsize, INT32 y, | |
| 1201 | static void vdp1_fill_line(running_machine *machine, const rectangle *cliprect, int patterndata, int xsize, INT32 y, | |
| 1203 | 1202 | INT32 x1, INT32 x2, INT32 u1, INT32 u2, INT32 v1, INT32 v2) |
| 1204 | 1203 | { |
| 1205 | 1204 | int xx1 = x1>>FRAC_SHIFT; |
| r3957 | r3958 | |
| 1227 | 1226 | xx2 = cliprect->max_x; |
| 1228 | 1227 | |
| 1229 | 1228 | while(xx1 <= xx2) { |
| 1230 | drawpixel(xx1,y, | |
| 1229 | drawpixel(machine,xx1,y, | |
| 1231 | 1230 | patterndata, |
| 1232 | 1231 | (v>>FRAC_SHIFT)*xsize+(u>>FRAC_SHIFT)); |
| 1233 | 1232 | xx1++; |
| r3957 | r3958 | |
| 1237 | 1236 | } |
| 1238 | 1237 | } |
| 1239 | 1238 | |
| 1240 | static void vdp1_fill_quad(const rectangle *cliprect, int patterndata, int xsize, const struct spoint *q) | |
| 1239 | static void vdp1_fill_quad(running_machine *machine, const rectangle *cliprect, int patterndata, int xsize, const struct spoint *q) | |
| 1241 | 1240 | { |
| 1242 | 1241 | INT32 sl1, sl2, slu1, slu2, slv1, slv2, cury, limy, x1, x2, u1, u2, v1, v2, delta; |
| 1243 | 1242 | int pmin, pmax, i, ps1, ps2; |
| r3957 | r3958 | |
| 1277 | 1276 | v2 = p[i].v; |
| 1278 | 1277 | } |
| 1279 | 1278 | } |
| 1280 | vdp1_fill_line(cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2); | |
| 1279 | vdp1_fill_line(machine, cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2); | |
| 1281 | 1280 | return; |
| 1282 | 1281 | } |
| 1283 | 1282 | |
| r3957 | r3958 | |
| 1296 | 1295 | |
| 1297 | 1296 | for(;;) { |
| 1298 | 1297 | if(p[ps1-1].y == p[ps2+1].y) { |
| 1299 | vdp1_fill_slope(cliprect, patterndata, xsize, | |
| 1298 | vdp1_fill_slope(machine, cliprect, patterndata, xsize, | |
| 1300 | 1299 | x1, x2, sl1, sl2, &x1, &x2, |
| 1301 | 1300 | u1, u2, slu1, slu2, &u1, &u2, |
| 1302 | 1301 | v1, v2, slv1, slv2, &v1, &v2, |
| r3957 | r3958 | |
| 1329 | 1328 | slu2 = (u2-p[ps2+1].u)/delta; |
| 1330 | 1329 | slv2 = (v2-p[ps2+1].v)/delta; |
| 1331 | 1330 | } else if(p[ps1-1].y < p[ps2+1].y) { |
| 1332 | vdp1_fill_slope(cliprect, patterndata, xsize, | |
| 1331 | vdp1_fill_slope(machine, cliprect, patterndata, xsize, | |
| 1333 | 1332 | x1, x2, sl1, sl2, &x1, &x2, |
| 1334 | 1333 | u1, u2, slu1, slu2, &u1, &u2, |
| 1335 | 1334 | v1, v2, slv1, slv2, &v1, &v2, |
| r3957 | r3958 | |
| 1349 | 1348 | slu1 = (u1-p[ps1-1].u)/delta; |
| 1350 | 1349 | slv1 = (v1-p[ps1-1].v)/delta; |
| 1351 | 1350 | } else { |
| 1352 | vdp1_fill_slope(cliprect, patterndata, xsize, | |
| 1351 | vdp1_fill_slope(machine, cliprect, patterndata, xsize, | |
| 1353 | 1352 | x1, x2, sl1, sl2, &x1, &x2, |
| 1354 | 1353 | u1, u2, slu1, slu2, &u1, &u2, |
| 1355 | 1354 | v1, v2, slv1, slv2, &v1, &v2, |
| r3957 | r3958 | |
| 1371 | 1370 | } |
| 1372 | 1371 | } |
| 1373 | 1372 | if(cury == limy) |
| 1374 | vdp1_fill_line(cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2); | |
| 1373 | vdp1_fill_line(machine, cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2); | |
| 1375 | 1374 | } |
| 1376 | 1375 | |
| 1377 | 1376 | static int x2s(int v) |
| r3957 | r3958 | |
| 1384 | 1383 | return (INT32)(INT16)v + stvvdp1_local_y; |
| 1385 | 1384 | } |
| 1386 | 1385 | |
| 1387 | static void stv_vdp1_draw_line( const rectangle *cliprect) | |
| 1386 | static void stv_vdp1_draw_line(running_machine *machine, const rectangle *cliprect) | |
| 1388 | 1387 | { |
| 1389 | 1388 | struct spoint q[4]; |
| 1390 | 1389 | |
| r3957 | r3958 | |
| 1400 | 1399 | q[0].u = q[3].u = q[1].u = q[2].u = 0; |
| 1401 | 1400 | q[0].v = q[1].v = q[2].v = q[3].v = 0; |
| 1402 | 1401 | |
| 1403 | vdp1_fill_quad(cliprect, 0, 1, q); | |
| 1402 | vdp1_fill_quad(machine, cliprect, 0, 1, q); | |
| 1404 | 1403 | } |
| 1405 | 1404 | |
| 1406 | static void stv_vdp1_draw_poly_line( const rectangle *cliprect) | |
| 1405 | static void stv_vdp1_draw_poly_line(running_machine *machine, const rectangle *cliprect) | |
| 1407 | 1406 | { |
| 1408 | 1407 | struct spoint q[4]; |
| 1409 | 1408 | |
| r3957 | r3958 | |
| 1419 | 1418 | q[0].u = q[3].u = q[1].u = q[2].u = 0; |
| 1420 | 1419 | q[0].v = q[1].v = q[2].v = q[3].v = 0; |
| 1421 | 1420 | |
| 1422 | vdp1_fill_quad(cliprect, 0, 1, q); | |
| 1421 | vdp1_fill_quad(machine, cliprect, 0, 1, q); | |
| 1423 | 1422 | |
| 1424 | 1423 | q[0].x = x2s(stv2_current_sprite.CMDXB); |
| 1425 | 1424 | q[0].y = y2s(stv2_current_sprite.CMDYB); |
| r3957 | r3958 | |
| 1433 | 1432 | q[0].u = q[3].u = q[1].u = q[2].u = 0; |
| 1434 | 1433 | q[0].v = q[1].v = q[2].v = q[3].v = 0; |
| 1435 | 1434 | |
| 1436 | vdp1_fill_quad(cliprect, 0, 1, q); | |
| 1435 | vdp1_fill_quad(machine, cliprect, 0, 1, q); | |
| 1437 | 1436 | |
| 1438 | 1437 | q[0].x = x2s(stv2_current_sprite.CMDXC); |
| 1439 | 1438 | q[0].y = y2s(stv2_current_sprite.CMDYC); |
| r3957 | r3958 | |
| 1447 | 1446 | q[0].u = q[3].u = q[1].u = q[2].u = 0; |
| 1448 | 1447 | q[0].v = q[1].v = q[2].v = q[3].v = 0; |
| 1449 | 1448 | |
| 1450 | vdp1_fill_quad(cliprect, 0, 1, q); | |
| 1449 | vdp1_fill_quad(machine, cliprect, 0, 1, q); | |
| 1451 | 1450 | |
| 1452 | 1451 | q[0].x = x2s(stv2_current_sprite.CMDXD); |
| 1453 | 1452 | q[0].y = y2s(stv2_current_sprite.CMDYD); |
| r3957 | r3958 | |
| 1462 | 1461 | q[0].v = q[1].v = q[2].v = q[3].v = 0; |
| 1463 | 1462 | |
| 1464 | 1463 | stv_vdp1_setup_shading(q, cliprect); |
| 1465 | vdp1_fill_quad(cliprect, 0, 1, q); | |
| 1464 | vdp1_fill_quad(machine, cliprect, 0, 1, q); | |
| 1466 | 1465 | |
| 1467 | 1466 | } |
| 1468 | 1467 | |
| 1469 | static void stv_vpd1_draw_distorted_sprite(const rectangle *cliprect) | |
| 1468 | static void stv_vpd1_draw_distorted_sprite(running_machine *machine, const rectangle *cliprect) | |
| 1470 | 1469 | { |
| 1471 | 1470 | struct spoint q[4]; |
| 1472 | 1471 | |
| r3957 | r3958 | |
| 1521 | 1520 | } |
| 1522 | 1521 | |
| 1523 | 1522 | stv_vdp1_setup_shading(q, cliprect); |
| 1524 | vdp1_fill_quad(cliprect, patterndata, xsize, q); | |
| 1523 | vdp1_fill_quad(machine, cliprect, patterndata, xsize, q); | |
| 1525 | 1524 | } |
| 1526 | 1525 | |
| 1527 | static void stv_vpd1_draw_scaled_sprite(const rectangle *cliprect) | |
| 1526 | static void stv_vpd1_draw_scaled_sprite(running_machine *machine, const rectangle *cliprect) | |
| 1528 | 1527 | { |
| 1529 | 1528 | struct spoint q[4]; |
| 1530 | 1529 | |
| r3957 | r3958 | |
| 1668 | 1667 | } |
| 1669 | 1668 | |
| 1670 | 1669 | stv_vdp1_setup_shading(q, cliprect); |
| 1671 | vdp1_fill_quad(cliprect, patterndata, xsize, q); | |
| 1670 | vdp1_fill_quad(machine, cliprect, patterndata, xsize, q); | |
| 1672 | 1671 | } |
| 1673 | 1672 | |
| 1674 | 1673 | |
| 1675 | static void stv_vpd1_draw_normal_sprite(const rectangle *cliprect, int sprite_type) | |
| 1674 | static void stv_vpd1_draw_normal_sprite(running_machine *machine, const rectangle *cliprect, int sprite_type) | |
| 1676 | 1675 | { |
| 1677 | 1676 | UINT16 *destline; |
| 1678 | 1677 | |
| r3957 | r3958 | |
| 1751 | 1750 | su = u; |
| 1752 | 1751 | for (drawxpos = x; drawxpos <= maxdrawxpos; drawxpos++ ) |
| 1753 | 1752 | { |
| 1754 | drawpixel( drawxpos, drawypos, patterndata, u ); | |
| 1753 | drawpixel( machine, drawxpos, drawypos, patterndata, u ); | |
| 1755 | 1754 | u += dux; |
| 1756 | 1755 | } |
| 1757 | 1756 | u = su + duy; |
| 1758 | 1757 | } |
| 1759 | 1758 | } |
| 1760 | 1759 | |
| 1761 | static void stv_vdp1_process_list() | |
| 1760 | static void stv_vdp1_process_list(running_machine *machine) | |
| 1762 | 1761 | { |
| 1763 | 1762 | int position; |
| 1764 | 1763 | int spritecount; |
| r3957 | r3958 | |
| 1913 | 1912 | case 0x0000: |
| 1914 | 1913 | if (vdp1_sprite_log) logerror ("Sprite List Normal Sprite\n"); |
| 1915 | 1914 | stv2_current_sprite.ispoly = 0; |
| 1916 | stv_vpd1_draw_normal_sprite(cliprect, 0); | |
| 1915 | stv_vpd1_draw_normal_sprite(machine, cliprect, 0); | |
| 1917 | 1916 | break; |
| 1918 | 1917 | |
| 1919 | 1918 | case 0x0001: |
| 1920 | 1919 | if (vdp1_sprite_log) logerror ("Sprite List Scaled Sprite\n"); |
| 1921 | 1920 | stv2_current_sprite.ispoly = 0; |
| 1922 | stv_vpd1_draw_scaled_sprite(cliprect); | |
| 1921 | stv_vpd1_draw_scaled_sprite(machine, cliprect); | |
| 1923 | 1922 | break; |
| 1924 | 1923 | |
| 1925 | 1924 | case 0x0002: |
| 1926 | 1925 | if (vdp1_sprite_log) logerror ("Sprite List Distorted Sprite\n"); |
| 1927 | 1926 | stv2_current_sprite.ispoly = 0; |
| 1928 | stv_vpd1_draw_distorted_sprite(cliprect); | |
| 1927 | stv_vpd1_draw_distorted_sprite(machine, cliprect); | |
| 1929 | 1928 | break; |
| 1930 | 1929 | |
| 1931 | 1930 | case 0x0004: |
| 1932 | 1931 | if (vdp1_sprite_log) logerror ("Sprite List Polygon\n"); |
| 1933 | 1932 | stv2_current_sprite.ispoly = 1; |
| 1934 | stv_vpd1_draw_distorted_sprite(cliprect); | |
| 1933 | stv_vpd1_draw_distorted_sprite(machine, cliprect); | |
| 1935 | 1934 | break; |
| 1936 | 1935 | |
| 1937 | 1936 | case 0x0005: |
| 1938 | 1937 | if (vdp1_sprite_log) logerror ("Sprite List Polyline\n"); |
| 1939 | 1938 | stv2_current_sprite.ispoly = 1; |
| 1940 | stv_vdp1_draw_poly_line(cliprect); | |
| 1939 | stv_vdp1_draw_poly_line(machine, cliprect); | |
| 1941 | 1940 | break; |
| 1942 | 1941 | |
| 1943 | 1942 | case 0x0006: |
| 1944 | 1943 | if (vdp1_sprite_log) logerror ("Sprite List Line\n"); |
| 1945 | 1944 | stv2_current_sprite.ispoly = 1; |
| 1946 | stv_vdp1_draw_line(cliprect); | |
| 1945 | stv_vdp1_draw_line(machine, cliprect); | |
| 1947 | 1946 | break; |
| 1948 | 1947 | |
| 1949 | 1948 | case 0x0008: |
| r3957 | r3958 | |
| 1989 | 1988 | |
| 1990 | 1989 | /* not here! this is done every frame drawn even if the cpu isn't running eg in the debugger */ |
| 1991 | 1990 | // if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/ |
| 1992 | // cpu_set_input_line_and_vector( | |
| 1991 | // cpu_set_input_line_and_vector(machine->cpu[0], 2, HOLD_LINE , 0x4d); | |
| 1993 | 1992 | |
| 1994 | 1993 | if (vdp1_sprite_log) logerror ("End of list processing!\n"); |
| 1995 | 1994 | } |
| r3957 | r3958 | |
| 2064 | 2063 | break; |
| 2065 | 2064 | case 2:/*Automatic Draw*/ |
| 2066 | 2065 | if ( framebufer_changed ) |
| 2067 | stv_vdp1_process_list(); | |
| 2066 | stv_vdp1_process_list(machine); | |
| 2068 | 2067 | break; |
| 2069 | 2068 | case 3: /*<invalid>*/ |
| 2070 | 2069 | logerror("Warning: Invalid PTM mode set for VDP1!\n"); |
| r3957 | r3958 | |
|---|---|---|
| 71 | 71 | { |
| 72 | 72 | /* bit 0 flips screen */ |
| 73 | 73 | |
| 74 | if (flip_screen_get() != (data & 0x01)) | |
| 74 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 75 | 75 | { |
| 76 | flip_screen_set(data & 0x01); | |
| 76 | flip_screen_set(space->machine, data & 0x01); | |
| 77 | 77 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 78 | 78 | } |
| 79 | 79 | |
| r3957 | r3958 | |
| 122 | 122 | int sy = 240 - spriteram[offs + 1]; |
| 123 | 123 | int sx = spriteram_2[offs]; |
| 124 | 124 | |
| 125 | if (flip_screen_get()) | |
| 125 | if (flip_screen_get(machine)) | |
| 126 | 126 | { |
| 127 | 127 | sy = 240 - sy; |
| 128 | 128 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | WRITE8_HANDLER( sonson_flipscreen_w ) |
| 118 | 118 | { |
| 119 | flip_screen_set(~data & 0x01); | |
| 119 | flip_screen_set(space->machine, ~data & 0x01); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 148 | 148 | int sx = spriteram[offs + 3]; |
| 149 | 149 | int sy = spriteram[offs + 0]; |
| 150 | 150 | |
| 151 | if (flip_screen_get()) | |
| 151 | if (flip_screen_get(machine)) | |
| 152 | 152 | { |
| 153 | 153 | sx = 240 - sx; |
| 154 | 154 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | int offs; |
| 41 | 41 | |
| 42 | 42 | //FIXME: flip_screen_x should not be written! |
| 43 | flip_screen_set_no_update(1); | |
| 43 | flip_screen_set_no_update(machine, 1); | |
| 44 | 44 | |
| 45 | 45 | for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien |
| 46 | 46 | { |
| r3957 | r3958 | |
| 86 | 86 | inc = 1; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | if (flip_screen_get()) | |
| 89 | if (flip_screen_get(machine)) | |
| 90 | 90 | { |
| 91 | 91 | y=240-y; |
| 92 | 92 | x=304-x; |
| r3957 | r3958 | |
|---|---|---|
| 108 | 108 | color = (spriteram16[offs+1]>>12)&0xf; |
| 109 | 109 | sprite = spriteram16[offs+1]&0xfff; |
| 110 | 110 | |
| 111 | if (flip_screen_get()) { | |
| 111 | if (flip_screen_get(machine)) { | |
| 112 | 112 | x=240-x; |
| 113 | 113 | y=240-y; |
| 114 | 114 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 145 | 145 | tilemap_set_enable(pf3_layer,!(deadang_scroll_ram[0x34]&1)); |
| 146 | 146 | tilemap_set_enable(pf1_layer,!(deadang_scroll_ram[0x34]&2)); |
| 147 | 147 | tilemap_set_enable(pf2_layer,!(deadang_scroll_ram[0x34]&4)); |
| 148 | flip_screen_set( deadang_scroll_ram[0x34]&0x40 ); | |
| 148 | flip_screen_set(screen->machine, deadang_scroll_ram[0x34]&0x40 ); | |
| 149 | 149 | |
| 150 | 150 | bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); |
| 151 | 151 | bitmap_fill(priority_bitmap,cliprect,0); |
| r3957 | r3958 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | coin_lockout_global_w(~data & 0x01); |
| 151 | 151 | |
| 152 | flip_screen_set_no_update(data & 0x04); | |
| 152 | flip_screen_set_no_update(space->machine, data & 0x04); | |
| 153 | 153 | |
| 154 | tilemap_set_flip(ALL_TILEMAPS, flip_screen_get() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); | |
| 154 | tilemap_set_flip(ALL_TILEMAPS, flip_screen_get(space->machine) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); | |
| 155 | 155 | |
| 156 | 156 | controller = data & 0x02; |
| 157 | 157 | |
| r3957 | r3958 | |
| 323 | 323 | latch = 0x0400; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? -xld : xld); | |
| 327 | tilemap_set_scrolly(bg_tilemap, 0, flip_screen_get() ? -yld : yld); | |
| 326 | tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get(machine) ? -xld : xld); | |
| 327 | tilemap_set_scrolly(bg_tilemap, 0, flip_screen_get(machine) ? -yld : yld); | |
| 328 | 328 | |
| 329 | 329 | tilemap_draw(helper0, &rect, bg_tilemap, 0, 0); |
| 330 | 330 | |
| r3957 | r3958 | |
| 350 | 350 | int col = (xld + x) / 8 + 1; |
| 351 | 351 | int row = (yld + y) / 8 + 0; |
| 352 | 352 | |
| 353 | latch |= (flip_screen_get() ? 31 - col : col) << 0; | |
| 354 | latch |= (flip_screen_get() ? 31 - row : row) << 5; | |
| 353 | latch |= (flip_screen_get(machine) ? 31 - col : col) << 0; | |
| 354 | latch |= (flip_screen_get(machine) ? 31 - row : row) << 5; | |
| 355 | 355 | |
| 356 | 356 | pc3259_output[0] = (latch >> 0x0) & 0xf; |
| 357 | 357 | pc3259_output[1] = (latch >> 0x4) & 0xf; |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | case 2: COMBINE_DATA(&ddragon3_bg_scrollx); break; // Scroll X, BG0 |
| 29 | 29 | case 3: COMBINE_DATA(&ddragon3_bg_scrolly); break; // Scroll Y, BG0 |
| 30 | 30 | case 4: break; // Unknown write |
| 31 | case 5: flip_screen_set(data & 0x01); break; // Flip Screen | |
| 31 | case 5: flip_screen_set(space->machine, data & 0x01); break; // Flip Screen | |
| 32 | 32 | case 6: |
| 33 | 33 | COMBINE_DATA(&ddragon3_bg_tilebase); // BG Tile Base |
| 34 | 34 | ddragon3_bg_tilebase &= 0x1ff; |
| r3957 | r3958 | |
| 45 | 45 | case 1: return ddragon3_fg_scrolly; |
| 46 | 46 | case 2: return ddragon3_bg_scrollx; |
| 47 | 47 | case 3: return ddragon3_bg_scrolly; |
| 48 | case 5: return flip_screen_get(); | |
| 48 | case 5: return flip_screen_get(space->machine); | |
| 49 | 49 | case 6: return ddragon3_bg_tilebase; |
| 50 | 50 | } |
| 51 | 51 | |
| r3957 | r3958 | |
| 153 | 153 | if (attr & 0x02) sy = 239 + (0x100 - sy); else sy = 240 - sy; |
| 154 | 154 | if (sx > 0x17f) sx = 0 - (0x200 - sx); |
| 155 | 155 | |
| 156 | if (flip_screen_get()) | |
| 156 | if (flip_screen_get(machine)) | |
| 157 | 157 | { |
| 158 | 158 | sx = 304 - sx; |
| 159 | 159 | sy = 224 - sy; |
| r3957 | r3958 | |
| 164 | 164 | for (i = 0; i <= height; i++) |
| 165 | 165 | { |
| 166 | 166 | drawgfx(bitmap, machine->gfx[1], code + i, color, flipx, flipy, |
| 167 | sx, sy + (flip_screen_get() ? (i * 16) : (-i * 16)), cliprect, | |
| 167 | sx, sy + (flip_screen_get(machine) ? (i * 16) : (-i * 16)), cliprect, | |
| 168 | 168 | TRANSPARENCY_PEN, 0); |
| 169 | 169 | } |
| 170 | 170 | } |
| r3957 | r3958 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | code = videoram[offs] | ((col & 0x60) << 3); |
| 75 | 75 | |
| 76 | if (flip_screen_get()) | |
| 76 | if (flip_screen_get(machine)) | |
| 77 | 77 | { |
| 78 | 78 | sx = 31 - sx; |
| 79 | 79 | sy = 31 - sy; |
| r3957 | r3958 | |
| 83 | 83 | drawgfx(bitmap,machine->gfx[0], |
| 84 | 84 | code, |
| 85 | 85 | (col & 0x0f) | ((*ambush_colorbank & 0x03) << 4), |
| 86 | flip_screen_get(),flip_screen_get(), | |
| 86 | flip_screen_get(machine),flip_screen_get(machine), | |
| 87 | 87 | 8*sx, (8*sy + scroll) & 0xff, |
| 88 | 88 | cliprect,transparency,0); |
| 89 | 89 | } |
| r3957 | r3958 | |
| 124 | 124 | /* 16x16 sprites */ |
| 125 | 125 | gfx = 1; |
| 126 | 126 | |
| 127 | if (!flip_screen_get()) | |
| 127 | if (!flip_screen_get(screen->machine)) | |
| 128 | 128 | { |
| 129 | 129 | sy = 240 - sy; |
| 130 | 130 | } |
| r3957 | r3958 | |
| 139 | 139 | gfx = 0; |
| 140 | 140 | code <<= 2; |
| 141 | 141 | |
| 142 | if (!flip_screen_get()) | |
| 142 | if (!flip_screen_get(screen->machine)) | |
| 143 | 143 | { |
| 144 | 144 | sy = 248 - sy; |
| 145 | 145 | } |
| r3957 | r3958 | |
| 153 | 153 | flipx = spriteram[offs + 1] & 0x40; |
| 154 | 154 | flipy = spriteram[offs + 1] & 0x80; |
| 155 | 155 | |
| 156 | if (flip_screen_get()) | |
| 156 | if (flip_screen_get(screen->machine)) | |
| 157 | 157 | { |
| 158 | 158 | flipx = !flipx; |
| 159 | 159 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | WRITE8_HANDLER( sauro_scroll_fg_w ) |
| 80 | 80 | { |
| 81 | const int *map = (flip_screen_get() ? scroll2_map_flip : scroll2_map); | |
| 81 | const int *map = (flip_screen_get(space->machine) ? scroll2_map_flip : scroll2_map); | |
| 82 | 82 | int scroll = (data & 0xf8) | map[data & 7]; |
| 83 | 83 | |
| 84 | 84 | tilemap_set_scrollx(fg_tilemap, 0, scroll); |
| r3957 | r3958 | |
| 126 | 126 | |
| 127 | 127 | flipx = spriteram[offs+3] & 0x04; |
| 128 | 128 | |
| 129 | if (flip_screen_get()) | |
| 129 | if (flip_screen_get(machine)) | |
| 130 | 130 | { |
| 131 | 131 | flipx = !flipx; |
| 132 | 132 | sx = (235 - sx) & 0xff; // The &0xff is not 100% percent correct |
| r3957 | r3958 | |
| 136 | 136 | drawgfx(bitmap, machine->gfx[2], |
| 137 | 137 | code, |
| 138 | 138 | color, |
| 139 | flipx,flip_screen_get(), | |
| 139 | flipx,flip_screen_get(machine), | |
| 140 | 140 | sx,sy, |
| 141 | 141 | cliprect,TRANSPARENCY_PEN,0); |
| 142 | 142 | } |
| r3957 | r3958 | |
| 201 | 201 | |
| 202 | 202 | flipx = spriteram[offs+3] & 0x04; |
| 203 | 203 | |
| 204 | if (flip_screen_get()) | |
| 204 | if (flip_screen_get(machine)) | |
| 205 | 205 | { |
| 206 | 206 | flipx = !flipx; |
| 207 | 207 | sx = (235 - sx) & 0xff; /* The &0xff is not 100% percent correct */ |
| r3957 | r3958 | |
| 211 | 211 | drawgfx(bitmap, machine->gfx[1], |
| 212 | 212 | code, |
| 213 | 213 | color, |
| 214 | flipx,flip_screen_get(), | |
| 214 | flipx,flip_screen_get(machine), | |
| 215 | 215 | sx,sy, |
| 216 | 216 | cliprect,TRANSPARENCY_PEN,0); |
| 217 | 217 | } |
| r3957 | r3958 | |
|---|---|---|
| 290 | 290 | int duplicate = spriteram_3[offs] & 0x80; |
| 291 | 291 | int x,y; |
| 292 | 292 | |
| 293 | if (flip_screen_get()) | |
| 293 | if (flip_screen_get(machine)) | |
| 294 | 294 | { |
| 295 | 295 | flipx ^= 1; |
| 296 | 296 | flipy ^= 1; |
| r3957 | r3958 | |
| 319 | 319 | VIDEO_UPDATE( gaplus ) |
| 320 | 320 | { |
| 321 | 321 | /* flip screen control is embedded in RAM */ |
| 322 | flip_screen_set(gaplus_spriteram[0x1f7f-0x800] & 1); | |
| 322 | flip_screen_set(screen->machine, gaplus_spriteram[0x1f7f-0x800] & 1); | |
| 323 | 323 | |
| 324 | 324 | bitmap_fill(bitmap, cliprect, 0); |
| 325 | 325 |
| r3957 | r3958 | |
|---|---|---|
| 603 | 603 | car1_x, car1_y, car1_code, car1_flipy, |
| 604 | 604 | car2_x, car2_y, car2_code, car2_flipy, |
| 605 | 605 | &col_x, &col_y)) |
| 606 | carpolo_generate_car_car_interrupt(0, 1); | |
| 606 | carpolo_generate_car_car_interrupt(machine, 0, 1); | |
| 607 | 607 | |
| 608 | 608 | /* cars 1 and 3 */ |
| 609 | 609 | else if (check_sprite_sprite_collision(machine, |
| 610 | 610 | car1_x, car1_y, car1_code, car1_flipy, |
| 611 | 611 | car3_x, car3_y, car3_code, car3_flipy, |
| 612 | 612 | &col_x, &col_y)) |
| 613 | carpolo_generate_car_car_interrupt(0, 2); | |
| 613 | carpolo_generate_car_car_interrupt(machine, 0, 2); | |
| 614 | 614 | |
| 615 | 615 | /* cars 1 and 4 */ |
| 616 | 616 | else if (check_sprite_sprite_collision(machine, |
| 617 | 617 | car1_x, car1_y, car1_code, car1_flipy, |
| 618 | 618 | car4_x, car4_y, car4_code, car4_flipy, |
| 619 | 619 | &col_x, &col_y)) |
| 620 | carpolo_generate_car_car_interrupt(0, 3); | |
| 620 | carpolo_generate_car_car_interrupt(machine, 0, 3); | |
| 621 | 621 | |
| 622 | 622 | /* cars 2 and 3 */ |
| 623 | 623 | else if (check_sprite_sprite_collision(machine, |
| 624 | 624 | car2_x, car2_y, car2_code, car2_flipy, |
| 625 | 625 | car3_x, car3_y, car3_code, car3_flipy, |
| 626 | 626 | &col_x, &col_y)) |
| 627 | carpolo_generate_car_car_interrupt(1, 2); | |
| 627 | carpolo_generate_car_car_interrupt(machine, 1, 2); | |
| 628 | 628 | |
| 629 | 629 | /* cars 2 and 4 */ |
| 630 | 630 | else if (check_sprite_sprite_collision(machine, |
| 631 | 631 | car2_x, car2_y, car2_code, car2_flipy, |
| 632 | 632 | car4_x, car4_y, car4_code, car4_flipy, |
| 633 | 633 | &col_x, &col_y)) |
| 634 | carpolo_generate_car_car_interrupt(1, 3); | |
| 634 | carpolo_generate_car_car_interrupt(machine, 1, 3); | |
| 635 | 635 | |
| 636 | 636 | /* cars 3 and 4 */ |
| 637 | 637 | else if (check_sprite_sprite_collision(machine, |
| 638 | 638 | car3_x, car3_y, car3_code, car3_flipy, |
| 639 | 639 | car4_x, car4_y, car4_code, car4_flipy, |
| 640 | 640 | &col_x, &col_y)) |
| 641 | carpolo_generate_car_car_interrupt(2, 3); | |
| 641 | carpolo_generate_car_car_interrupt(machine, 2, 3); | |
| 642 | 642 | |
| 643 | 643 | |
| 644 | 644 | |
| r3957 | r3958 | |
| 647 | 647 | car1_x, car1_y, car1_code, car1_flipy, |
| 648 | 648 | ball_x, ball_y, ball_code, ball_flipy, |
| 649 | 649 | &col_x, &col_y)) |
| 650 | carpolo_generate_car_ball_interrupt(0, col_x, col_y); | |
| 650 | carpolo_generate_car_ball_interrupt(machine, 0, col_x, col_y); | |
| 651 | 651 | |
| 652 | 652 | else if (check_sprite_sprite_collision(machine, |
| 653 | 653 | car2_x, car2_y, car2_code, car2_flipy, |
| 654 | 654 | ball_x, ball_y, ball_code, ball_flipy, |
| 655 | 655 | &col_x, &col_y)) |
| 656 | carpolo_generate_car_ball_interrupt(1, col_x, col_y); | |
| 656 | carpolo_generate_car_ball_interrupt(machine, 1, col_x, col_y); | |
| 657 | 657 | |
| 658 | 658 | else if (check_sprite_sprite_collision(machine, |
| 659 | 659 | car3_x, car3_y, car3_code, car3_flipy, |
| 660 | 660 | ball_x, ball_y, ball_code, ball_flipy, |
| 661 | 661 | &col_x, &col_y)) |
| 662 | carpolo_generate_car_ball_interrupt(2, col_x, col_y); | |
| 662 | carpolo_generate_car_ball_interrupt(machine, 2, col_x, col_y); | |
| 663 | 663 | |
| 664 | 664 | else if (check_sprite_sprite_collision(machine, |
| 665 | 665 | car4_x, car4_y, car4_code, car4_flipy, |
| 666 | 666 | ball_x, ball_y, ball_code, ball_flipy, |
| 667 | 667 | &col_x, &col_y)) |
| 668 | carpolo_generate_car_ball_interrupt(3, col_x, col_y); | |
| 668 | carpolo_generate_car_ball_interrupt(machine, 3, col_x, col_y); | |
| 669 | 669 | |
| 670 | 670 | |
| 671 | 671 | /* check car-goal collision */ |
| 672 | 672 | if (check_sprite_left_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1)) |
| 673 | carpolo_generate_car_goal_interrupt(0, 0); | |
| 673 | carpolo_generate_car_goal_interrupt(machine, 0, 0); | |
| 674 | 674 | |
| 675 | 675 | else if (check_sprite_right_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1)) |
| 676 | carpolo_generate_car_goal_interrupt(0, 1); | |
| 676 | carpolo_generate_car_goal_interrupt(machine, 0, 1); | |
| 677 | 677 | |
| 678 | 678 | else if (check_sprite_left_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1)) |
| 679 | carpolo_generate_car_goal_interrupt(1, 0); | |
| 679 | carpolo_generate_car_goal_interrupt(machine, 1, 0); | |
| 680 | 680 | |
| 681 | 681 | else if (check_sprite_right_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1)) |
| 682 | carpolo_generate_car_goal_interrupt(1, 1); | |
| 682 | carpolo_generate_car_goal_interrupt(machine, 1, 1); | |
| 683 | 683 | |
| 684 | 684 | else if (check_sprite_left_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1)) |
| 685 | carpolo_generate_car_goal_interrupt(2, 0); | |
| 685 | carpolo_generate_car_goal_interrupt(machine, 2, 0); | |
| 686 | 686 | |
| 687 | 687 | else if (check_sprite_right_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1)) |
| 688 | carpolo_generate_car_goal_interrupt(2, 1); | |
| 688 | carpolo_generate_car_goal_interrupt(machine, 2, 1); | |
| 689 | 689 | |
| 690 | 690 | else if (check_sprite_left_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1)) |
| 691 | carpolo_generate_car_goal_interrupt(3, 0); | |
| 691 | carpolo_generate_car_goal_interrupt(machine, 3, 0); | |
| 692 | 692 | |
| 693 | 693 | else if (check_sprite_right_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1)) |
| 694 | carpolo_generate_car_goal_interrupt(3, 1); | |
| 694 | carpolo_generate_car_goal_interrupt(machine, 3, 1); | |
| 695 | 695 | |
| 696 | 696 | |
| 697 | 697 | /* check ball collision with static screen elements */ |
| r3957 | r3958 | |
| 700 | 700 | |
| 701 | 701 | col = check_sprite_left_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0); |
| 702 | 702 | |
| 703 | if (col == 1) carpolo_generate_ball_screen_interrupt(0x05); | |
| 704 | if (col == 2) carpolo_generate_ball_screen_interrupt(0x03); | |
| 703 | if (col == 1) carpolo_generate_ball_screen_interrupt(machine, 0x05); | |
| 704 | if (col == 2) carpolo_generate_ball_screen_interrupt(machine, 0x03); | |
| 705 | 705 | |
| 706 | 706 | |
| 707 | 707 | col = check_sprite_right_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0); |
| 708 | 708 | |
| 709 | if (col == 1) carpolo_generate_ball_screen_interrupt(0x05 | 0x08); | |
| 710 | if (col == 2) carpolo_generate_ball_screen_interrupt(0x03 | 0x08); | |
| 709 | if (col == 1) carpolo_generate_ball_screen_interrupt(machine, 0x05 | 0x08); | |
| 710 | if (col == 2) carpolo_generate_ball_screen_interrupt(machine, 0x03 | 0x08); | |
| 711 | 711 | |
| 712 | 712 | |
| 713 | 713 | if (check_sprite_border_collision(machine, ball_x, ball_y, ball_code, ball_flipy)) |
| 714 | carpolo_generate_ball_screen_interrupt(0x06); | |
| 714 | carpolo_generate_ball_screen_interrupt(machine, 0x06); | |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | |
| r3957 | r3958 | |
| 722 | 722 | col = check_sprite_border_collision(machine, car1_x, car1_y, car1_code, car1_flipy); |
| 723 | 723 | |
| 724 | 724 | if (col) |
| 725 | carpolo_generate_car_border_interrupt(0, (col == 2)); | |
| 725 | carpolo_generate_car_border_interrupt(machine, 0, (col == 2)); | |
| 726 | 726 | else |
| 727 | 727 | { |
| 728 | 728 | col = check_sprite_border_collision(machine, car2_x, car2_y, car2_code, car2_flipy); |
| 729 | 729 | |
| 730 | 730 | if (col) |
| 731 | carpolo_generate_car_border_interrupt(1, (col == 2)); | |
| 731 | carpolo_generate_car_border_interrupt(machine, 1, (col == 2)); | |
| 732 | 732 | else |
| 733 | 733 | { |
| 734 | 734 | col = check_sprite_border_collision(machine, car3_x, car3_y, car3_code, car3_flipy); |
| 735 | 735 | |
| 736 | 736 | if (col) |
| 737 | carpolo_generate_car_border_interrupt(2, (col == 2)); | |
| 737 | carpolo_generate_car_border_interrupt(machine, 2, (col == 2)); | |
| 738 | 738 | else |
| 739 | 739 | { |
| 740 | 740 | col = check_sprite_border_collision(machine, car4_x, car4_y, car4_code, car4_flipy); |
| 741 | 741 | |
| 742 | 742 | if (col) |
| 743 | carpolo_generate_car_border_interrupt(3, (col == 2)); | |
| 743 | carpolo_generate_car_border_interrupt(machine, 3, (col == 2)); | |
| 744 | 744 | } |
| 745 | 745 | } |
| 746 | 746 | } |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | /****************************************************************************/ |
| 19 | 19 | |
| 20 | void drmicro_flip_w( int flip ) | |
| 20 | void drmicro_flip_w( running_machine *machine, int flip ) | |
| 21 | 21 | { |
| 22 | 22 | flipscreen = flip ? 1 : 0; |
| 23 | flip_screen_set(flip); | |
| 23 | flip_screen_set(machine, flip); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | WRITE8_HANDLER( drmicro_videoram_w ) |
| r3957 | r3958 | |
|---|---|---|
| 97 | 97 | { |
| 98 | 98 | /*temporary hook-up.*/ |
| 99 | 99 | case 0x0d: |
| 100 | flip_screen_set(data & 8); | |
| 100 | flip_screen_set(space->machine, data & 8); | |
| 101 | 101 | tilemap_set_scrolldx(bg_tilemap,0,data & 0x40); |
| 102 | 102 | break; |
| 103 | 103 | default: |
| r3957 | r3958 | |
|---|---|---|
| 164 | 164 | system1_video_mode = data; |
| 165 | 165 | |
| 166 | 166 | /* bit 7 is flip screen */ |
| 167 | flip_screen_set(data & 0x80); | |
| 167 | flip_screen_set(space->machine, data & 0x80); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | READ8_HANDLER( system1_videomode_r ) |
| r3957 | r3958 | |
| 289 | 289 | x_flipped = x; |
| 290 | 290 | y = y_flipped = sy+row; |
| 291 | 291 | |
| 292 | if (flip_screen_get()) | |
| 292 | if (flip_screen_get(machine)) | |
| 293 | 293 | { |
| 294 | 294 | y_flipped = 258 - sy - height + row; |
| 295 | 295 | x_flipped = (252*2) - x; |
| r3957 | r3958 | |
| 323 | 323 | if (color1) |
| 324 | 324 | draw_pixel(machine,bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color1); |
| 325 | 325 | x++; |
| 326 | x_flipped += flip_screen_get() ? -1 : 1; | |
| 326 | x_flipped += flip_screen_get(machine) ? -1 : 1; | |
| 327 | 327 | |
| 328 | 328 | if (color2 == 15) break; |
| 329 | 329 | if (color2) |
| 330 | 330 | draw_pixel(machine,bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color2); |
| 331 | 331 | x++; |
| 332 | x_flipped += flip_screen_get() ? -1 : 1; | |
| 332 | x_flipped += flip_screen_get(machine) ? -1 : 1; | |
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | } |
| r3957 | r3958 | |
| 383 | 383 | sx = (offs/2) % 32; |
| 384 | 384 | sy = (offs/2) / 32; |
| 385 | 385 | |
| 386 | if (flip_screen_get()) | |
| 386 | if (flip_screen_get(machine)) | |
| 387 | 387 | { |
| 388 | 388 | sx = 31 - sx; |
| 389 | 389 | sy = 31 - sy; |
| r3957 | r3958 | |
| 397 | 397 | drawgfx(bitmap,machine->gfx[0], |
| 398 | 398 | code, |
| 399 | 399 | color, |
| 400 | flip_screen_get(),flip_screen_get(), | |
| 400 | flip_screen_get(machine),flip_screen_get(machine), | |
| 401 | 401 | 8*sx + blockgal_kludgeoffset,8*sy, |
| 402 | 402 | cliprect,TRANSPARENCY_PEN,0); |
| 403 | 403 | } |
| r3957 | r3958 | |
| 442 | 442 | sx = (offs/2) % 32; |
| 443 | 443 | sy = (offs/2) / 32; |
| 444 | 444 | |
| 445 | if (flip_screen_get()) | |
| 445 | if (flip_screen_get(machine)) | |
| 446 | 446 | { |
| 447 | 447 | sx = 31 - sx; |
| 448 | 448 | sy = 31 - sy; |
| r3957 | r3958 | |
| 451 | 451 | drawgfx(tmp_bitmap,machine->gfx[0], |
| 452 | 452 | code, |
| 453 | 453 | color, |
| 454 | flip_screen_get(),flip_screen_get(), | |
| 454 | flip_screen_get(machine),flip_screen_get(machine), | |
| 455 | 455 | 8*sx,8*sy, |
| 456 | 456 | 0,TRANSPARENCY_NONE,0); |
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /* copy the temporary bitmap to the screen */ |
| 461 | if (flip_screen_get()) | |
| 461 | if (flip_screen_get(machine)) | |
| 462 | 462 | copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx_flip,1,&background_scrolly_flip,cliprect); |
| 463 | 463 | else |
| 464 | 464 | copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx,1,&background_scrolly,cliprect); |
| r3957 | r3958 | |
| 480 | 480 | sx = (offs/2) % 32; |
| 481 | 481 | sy = (offs/2) / 32; |
| 482 | 482 | |
| 483 | if (flip_screen_get()) | |
| 483 | if (flip_screen_get(machine)) | |
| 484 | 484 | { |
| 485 | 485 | sx = 8*(31-sx) + background_scrollx_flip; |
| 486 | 486 | sy = 8*(31-sy) + background_scrolly_flip; |
| r3957 | r3958 | |
| 495 | 495 | drawgfx(bitmap,machine->gfx[0], |
| 496 | 496 | code, |
| 497 | 497 | color, |
| 498 | flip_screen_get(),flip_screen_get(), | |
| 498 | flip_screen_get(machine),flip_screen_get(machine), | |
| 499 | 499 | sx,sy, |
| 500 | 500 | cliprect,TRANSPARENCY_PEN,0); |
| 501 | 501 | drawgfx(bitmap,machine->gfx[0], |
| 502 | 502 | code, |
| 503 | 503 | color, |
| 504 | flip_screen_get(),flip_screen_get(), | |
| 504 | flip_screen_get(machine),flip_screen_get(machine), | |
| 505 | 505 | sx-256,sy, |
| 506 | 506 | cliprect,TRANSPARENCY_PEN,0); |
| 507 | 507 | drawgfx(bitmap,machine->gfx[0], |
| 508 | 508 | code, |
| 509 | 509 | color, |
| 510 | flip_screen_get(),flip_screen_get(), | |
| 510 | flip_screen_get(machine),flip_screen_get(machine), | |
| 511 | 511 | sx,sy-256, |
| 512 | 512 | cliprect,TRANSPARENCY_PEN,0); |
| 513 | 513 | drawgfx(bitmap,machine->gfx[0], |
| 514 | 514 | code, |
| 515 | 515 | color, |
| 516 | flip_screen_get(),flip_screen_get(), | |
| 516 | flip_screen_get(machine),flip_screen_get(machine), | |
| 517 | 517 | sx-256,sy-256, |
| 518 | 518 | cliprect,TRANSPARENCY_PEN,0); |
| 519 | 519 | } |
| r3957 | r3958 | |
| 584 | 584 | sx = (offs/2) % 32; |
| 585 | 585 | sy = (offs/2) / 32; |
| 586 | 586 | |
| 587 | if (flip_screen_get()) | |
| 587 | if (flip_screen_get(machine)) | |
| 588 | 588 | { |
| 589 | 589 | sx = 31 - sx; |
| 590 | 590 | sy = 31 - sy; |
| r3957 | r3958 | |
| 593 | 593 | drawgfx(tmp_bitmap,machine->gfx[0], |
| 594 | 594 | code, |
| 595 | 595 | color, |
| 596 | flip_screen_get(),flip_screen_get(), | |
| 596 | flip_screen_get(machine),flip_screen_get(machine), | |
| 597 | 597 | 8*sx,8*sy, |
| 598 | 598 | 0,TRANSPARENCY_NONE,0); |
| 599 | 599 | } |
| r3957 | r3958 | |
| 602 | 602 | /* copy the temporary bitmap to the screen */ |
| 603 | 603 | if (choplifter_scroll_x_on) |
| 604 | 604 | { |
| 605 | if (flip_screen_get()) | |
| 605 | if (flip_screen_get(machine)) | |
| 606 | 606 | { |
| 607 | 607 | int scrollx_row_flip[32],i; |
| 608 | 608 | |
| r3957 | r3958 | |
| 634 | 634 | sx = (offs/2) % 32; |
| 635 | 635 | sy = (offs/2) / 32; |
| 636 | 636 | |
| 637 | if (flip_screen_get()) | |
| 637 | if (flip_screen_get(machine)) | |
| 638 | 638 | { |
| 639 | 639 | sx = 8*(31-sx); |
| 640 | 640 | |
| r3957 | r3958 | |
| 654 | 654 | drawgfx(bitmap,machine->gfx[0], |
| 655 | 655 | code, |
| 656 | 656 | color, |
| 657 | flip_screen_get(),flip_screen_get(), | |
| 657 | flip_screen_get(machine),flip_screen_get(machine), | |
| 658 | 658 | sx,8*sy, |
| 659 | 659 | cliprect,TRANSPARENCY_PEN,0); |
| 660 | 660 | } |
| r3957 | r3958 | |
| 737 | 737 | if (x > 256) x -= 512; |
| 738 | 738 | if (y > 224) y -= 512; |
| 739 | 739 | |
| 740 | if (flip_screen_get()) | |
| 740 | if (flip_screen_get(machine)) | |
| 741 | 741 | { |
| 742 | 742 | x = 248 - x; |
| 743 | 743 | y = 248 - y; |
| r3957 | r3958 | |
| 751 | 751 | drawgfx(bitmap,machine->gfx[0], |
| 752 | 752 | code, |
| 753 | 753 | ((code >> 5) & 0x3f) + 64, |
| 754 | flip_screen_get(),flip_screen_get(), | |
| 754 | flip_screen_get(machine),flip_screen_get(machine), | |
| 755 | 755 | x,y, |
| 756 | 756 | cliprect, TRANSPARENCY_NONE, 0); |
| 757 | 757 | else if (priority) |
| 758 | 758 | drawgfx(bitmap,machine->gfx[0], |
| 759 | 759 | code, |
| 760 | 760 | ((code >> 5) & 0x3f) + 64, |
| 761 | flip_screen_get(),flip_screen_get(), | |
| 761 | flip_screen_get(machine),flip_screen_get(machine), | |
| 762 | 762 | x,y, |
| 763 | 763 | cliprect, TRANSPARENCY_PEN, 0); |
| 764 | 764 | |
| r3957 | r3958 | |
| 783 | 783 | code = wbml_paged_videoram[offs] | (wbml_paged_videoram[offs+1] << 8); |
| 784 | 784 | code = ((code >> 4) & 0x800) | (code & 0x7ff); |
| 785 | 785 | |
| 786 | if (flip_screen_get()) | |
| 786 | if (flip_screen_get(machine)) | |
| 787 | 787 | { |
| 788 | 788 | sx = 31 - sx; |
| 789 | 789 | sy = 31 - sy; |
| r3957 | r3958 | |
| 792 | 792 | drawgfx(bitmap,machine->gfx[0], |
| 793 | 793 | code, |
| 794 | 794 | (code >> 5) & 0x3f, |
| 795 | flip_screen_get(),flip_screen_get(), | |
| 795 | flip_screen_get(machine),flip_screen_get(machine), | |
| 796 | 796 | 8*sx,8*sy, |
| 797 | 797 | cliprect,TRANSPARENCY_PEN,0); |
| 798 | 798 | } |
| r3957 | r3958 | |
| 838 | 838 | if (x > 256) x -= 512; |
| 839 | 839 | if (y > 224) y -= 512; |
| 840 | 840 | |
| 841 | if (flip_screen_get()) | |
| 841 | if (flip_screen_get(machine)) | |
| 842 | 842 | { |
| 843 | 843 | x = 248 - x; |
| 844 | 844 | y = 248 - y; |
| r3957 | r3958 | |
| 852 | 852 | drawgfx(bitmap,machine->gfx[0], |
| 853 | 853 | code, |
| 854 | 854 | ((code >> 5) & 0x3f) + 64, |
| 855 | flip_screen_get(),flip_screen_get(), | |
| 855 | flip_screen_get(machine),flip_screen_get(machine), | |
| 856 | 856 | x,y, |
| 857 | 857 | cliprect, TRANSPARENCY_NONE, 0); |
| 858 | 858 | else if (priority) |
| 859 | 859 | drawgfx(bitmap,machine->gfx[0], |
| 860 | 860 | code, |
| 861 | 861 | ((code >> 5) & 0x3f) + 64, |
| 862 | flip_screen_get(),flip_screen_get(), | |
| 862 | flip_screen_get(machine),flip_screen_get(machine), | |
| 863 | 863 | x,y, |
| 864 | 864 | cliprect, TRANSPARENCY_PEN, 0); |
| 865 | 865 |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | WRITE16_HANDLER( powerins_flipscreen_w ) |
| 61 | 61 | { |
| 62 | if (ACCESSING_BITS_0_7) flip_screen_set( data & 1 ); | |
| 62 | if (ACCESSING_BITS_0_7) flip_screen_set(space->machine, data & 1 ); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | WRITE16_HANDLER( powerins_tilebank_w ) |
| r3957 | r3958 | |
| 298 | 298 | |
| 299 | 299 | /* Handle flip_screen. Apply a global offset of 32 pixels along x too */ |
| 300 | 300 | |
| 301 | if (flip_screen_get()) | |
| 301 | if (flip_screen_get(machine)) | |
| 302 | 302 | { sx = screen_w - sx - dimx*16 - 32; flipx = !flipx; |
| 303 | 303 | sy = screen_h - sy - dimy*16; flipy = !flipy; |
| 304 | 304 | code += dimx*dimy-1; inc = -1; } |
| r3957 | r3958 | |
|---|---|---|
| 128 | 128 | switch( offset*2 ) |
| 129 | 129 | { |
| 130 | 130 | case 0x1c: // FLIP SCREEN (myangel) <- this is actually zoom |
| 131 | flip_screen_set( data & 1 ); | |
| 131 | flip_screen_set(space->machine, data & 1 ); | |
| 132 | 132 | if (data & ~1) logerror("CPU #0 PC %06X: flip screen unknown bits %04X\n",cpu_get_pc(space->cpu),data); |
| 133 | 133 | break; |
| 134 | 134 | case 0x2a: // FLIP X (pzlbowl) |
| 135 | flip_screen_x_set( data & 1 ); | |
| 135 | flip_screen_x_set(space->machine, data & 1 ); | |
| 136 | 136 | if (data & ~1) logerror("CPU #0 PC %06X: flipx unknown bits %04X\n",cpu_get_pc(space->cpu),data); |
| 137 | 137 | break; |
| 138 | 138 | case 0x2c: // FLIP Y (pzlbowl) |
| 139 | flip_screen_y_set( data & 1 ); | |
| 139 | flip_screen_y_set(space->machine, data & 1 ); | |
| 140 | 140 | if (data & ~1) logerror("CPU #0 PC %06X: flipy unknown bits %04X\n",cpu_get_pc(space->cpu),data); |
| 141 | 141 | break; |
| 142 | 142 |
| r3957 | r3958 | |
|---|---|---|
| 106 | 106 | int flipx = (attributes & 0x04); |
| 107 | 107 | int flipy = 0; |
| 108 | 108 | |
| 109 | if (flip_screen_get()) { | |
| 109 | if (flip_screen_get(machine)) { | |
| 110 | 110 | flipx = !flipx; |
| 111 | 111 | flipy = !flipy; |
| 112 | 112 | } |
| r3957 | r3958 | |
| 117 | 117 | |
| 118 | 118 | vx = sx; |
| 119 | 119 | vy = sy; |
| 120 | if (flip_screen_get()) { | |
| 120 | if (flip_screen_get(machine)) { | |
| 121 | 121 | vx = 240 - vx; |
| 122 | 122 | vy = 240 - vy; |
| 123 | 123 | } |
| r3957 | r3958 | |
| 136 | 136 | |
| 137 | 137 | vx = sx; |
| 138 | 138 | vy = sy; |
| 139 | if (flip_screen_get()) { | |
| 139 | if (flip_screen_get(machine)) { | |
| 140 | 140 | vx = 240 - vx; |
| 141 | 141 | vy = 240 - vy; |
| 142 | 142 | } |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | WRITE8_HANDLER( paradise_flipscreen_w ) |
| 41 | 41 | { |
| 42 | flip_screen_set(data ? 0 : 1); | |
| 42 | flip_screen_set(space->machine, data ? 0 : 1); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | WRITE8_HANDLER( tgtball_flipscreen_w ) |
| 46 | 46 | { |
| 47 | flip_screen_set(data ? 1 : 0); | |
| 47 | flip_screen_set(space->machine, data ? 1 : 0); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| r3957 | r3958 | |
| 192 | 192 | int flipx = 0; // ? |
| 193 | 193 | int flipy = 0; |
| 194 | 194 | |
| 195 | if (flip_screen_get()) { x = 0xf0 - x; flipx = !flipx; | |
| 195 | if (flip_screen_get(machine)) { x = 0xf0 - x; flipx = !flipx; | |
| 196 | 196 | y = 0xf0 - y; flipy = !flipy; } |
| 197 | 197 | |
| 198 | 198 | drawgfx(bitmap,machine->gfx[0], |
| r3957 | r3958 | |
| 253 | 253 | |
| 254 | 254 | if (layers_ctrl&1) tilemap_draw(bitmap,cliprect, tilemap_0, 0,0); |
| 255 | 255 | if (layers_ctrl&2) tilemap_draw(bitmap,cliprect, tilemap_1, 0,0); |
| 256 | if (layers_ctrl&4) copybitmap_trans(bitmap,tmpbitmap,flip_screen_get(),flip_screen_get(),0,0,cliprect, 0x80f); | |
| 256 | if (layers_ctrl&4) copybitmap_trans(bitmap,tmpbitmap,flip_screen_get(screen->machine),flip_screen_get(screen->machine),0,0,cliprect, 0x80f); | |
| 257 | 257 | |
| 258 | 258 | if (paradise_priority & 2) |
| 259 | 259 | { |
| r3957 | r3958 | |
|---|---|---|
| 205 | 205 | |
| 206 | 206 | // ashnojoe_tilemap_reg[0] & 0x10 // ?? on coin insertion |
| 207 | 207 | |
| 208 | flip_screen_set(ashnojoe_tilemap_reg[0] & 1); | |
| 208 | flip_screen_set(screen->machine, ashnojoe_tilemap_reg[0] & 1); | |
| 209 | 209 | |
| 210 | 210 | if(ashnojoe_tilemap_reg[0] & 0x02) |
| 211 | 211 | tilemap_draw(bitmap,cliprect,joetilemap7,0,0); |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | color += 16 * (spritepalettebank[(tile>>1)&0xff] & 0x0f); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | if (flip_screen_get()) | |
| 81 | if (flip_screen_get(machine)) | |
| 82 | 82 | { |
| 83 | 83 | sx=240-sx; |
| 84 | 84 | sy=240-sy; |
| r3957 | r3958 | |
| 169 | 169 | { |
| 170 | 170 | coin_counter_w( 0, data&0x01 ); |
| 171 | 171 | coin_counter_w( 1, (data&0x02)>>1 ); |
| 172 | flip_screen_set(data&0x04); | |
| 172 | flip_screen_set(space->machine, data&0x04); | |
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | WRITE8_HANDLER( mouser_flip_screen_x_w ) |
| 47 | 47 | { |
| 48 | flip_screen_x_set(~data & 1); | |
| 48 | flip_screen_x_set(space->machine, ~data & 1); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | WRITE8_HANDLER( mouser_flip_screen_y_w ) |
| 52 | 52 | { |
| 53 | flip_screen_y_set(~data & 1); | |
| 53 | flip_screen_y_set(space->machine, ~data & 1); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | VIDEO_UPDATE( mouser ) |
| r3957 | r3958 | |
| 68 | 68 | sx = offs % 32; |
| 69 | 69 | sy = offs / 32; |
| 70 | 70 | |
| 71 | if (flip_screen_x_get()) | |
| 71 | if (flip_screen_x_get(screen->machine)) | |
| 72 | 72 | { |
| 73 | 73 | sx = 31 - sx; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | if (flip_screen_y_get()) | |
| 76 | if (flip_screen_y_get(screen->machine)) | |
| 77 | 77 | { |
| 78 | 78 | sy = 31 - sy; |
| 79 | 79 | } |
| r3957 | r3958 | |
| 90 | 90 | drawgfx(bitmap,screen->machine->gfx[0], |
| 91 | 91 | videoram[offs] | (colorram[color_offs]>>5)*256 | ((colorram[color_offs]>>4)&1)*512, |
| 92 | 92 | colorram[color_offs]%16, |
| 93 | flip_screen_x_get(),flip_screen_y_get(), | |
| 93 | flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine), | |
| 94 | 94 | 8*sx,scrolled_y_position, |
| 95 | 95 | cliprect,TRANSPARENCY_NONE,0); |
| 96 | 96 | } |
| r3957 | r3958 | |
| 106 | 106 | flipx = (spriteram[offs]&0x40)>>6; |
| 107 | 107 | flipy = (spriteram[offs]&0x80)>>7; |
| 108 | 108 | |
| 109 | if (flip_screen_x_get()) | |
| 109 | if (flip_screen_x_get(screen->machine)) | |
| 110 | 110 | { |
| 111 | 111 | flipx = !flipx; |
| 112 | 112 | sx = 240 - sx; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | if (flip_screen_y_get()) | |
| 115 | if (flip_screen_y_get(screen->machine)) | |
| 116 | 116 | { |
| 117 | 117 | flipy = !flipy; |
| 118 | 118 | sy = 238 - sy; |
| r3957 | r3958 | |
| 136 | 136 | flipx = (spriteram[offs]&0x40)>>6; |
| 137 | 137 | flipy = (spriteram[offs]&0x80)>>7; |
| 138 | 138 | |
| 139 | if (flip_screen_x_get()) | |
| 139 | if (flip_screen_x_get(screen->machine)) | |
| 140 | 140 | { |
| 141 | 141 | flipx = !flipx; |
| 142 | 142 | sx = 240 - sx; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | if (flip_screen_y_get()) | |
| 145 | if (flip_screen_y_get(screen->machine)) | |
| 146 | 146 | { |
| 147 | 147 | flipy = !flipy; |
| 148 | 148 | sy = 238 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 240 | 240 | fx = !(spritedata[offs+0]&0x4000); |
| 241 | 241 | fy = !(spritedata[offs+0]&0x8000); |
| 242 | 242 | |
| 243 | if (!flip_screen_get()) { | |
| 243 | if (!flip_screen_get(machine)) { | |
| 244 | 244 | sx = sx & 0x01ff; |
| 245 | 245 | sy = sy & 0x01ff; |
| 246 | 246 | if (sx>0x180) sx=-(0x200 - sx); |
| r3957 | r3958 | |
| 1218 | 1218 | int pf1_enable,pf2_enable,pf3_enable; |
| 1219 | 1219 | static int last_pf3_bank; |
| 1220 | 1220 | |
| 1221 | flip_screen_set(deco32_pf12_control[0]&0x80); | |
| 1222 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 1221 | flip_screen_set(screen->machine, deco32_pf12_control[0]&0x80); | |
| 1222 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 1223 | 1223 | |
| 1224 | 1224 | deco32_setup_scroll(pf1_tilemap, 256,(deco32_pf12_control[5]>>0)&0xff,(deco32_pf12_control[6]>>0)&0xff,deco32_pf12_control[2],deco32_pf12_control[1],deco32_pf1_rowscroll,deco32_pf1_rowscroll+0x200); |
| 1225 | 1225 | deco32_setup_scroll(pf1a_tilemap,512,(deco32_pf12_control[5]>>0)&0xff,(deco32_pf12_control[6]>>0)&0xff,deco32_pf12_control[2],deco32_pf12_control[1],deco32_pf1_rowscroll,deco32_pf1_rowscroll+0x200); |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | #define MC_LENGTH 512 |
| 59 | 59 | |
| 60 | #define V_ADDPOINT(h,v,c,i) \ | |
| 61 | vector_add_point (((h) & 0x7ff) << 14, (0x6ff - ((v) & 0x7ff)) << 14, VECTOR_COLOR444(c), (i)) | |
| 60 | #define V_ADDPOINT(m,h,v,c,i) \ | |
| 61 | vector_add_point (m, ((h) & 0x7ff) << 14, (0x6ff - ((v) & 0x7ff)) << 14, VECTOR_COLOR444(c), (i)) | |
| 62 | 62 | |
| 63 | 63 | #define ADD(r,s,c) (((r) + (s) + (c)) & 0xffff) |
| 64 | 64 | #define SUBR(r,s,c) ((~(r) + (s) + (c)) & 0xffff) |
| r3957 | r3958 | |
| 140 | 140 | |
| 141 | 141 | typedef struct _vector_generator |
| 142 | 142 | { |
| 143 | running_machine *machine; | |
| 143 | 144 | UINT32 sreg; /* shift register */ |
| 144 | 145 | UINT32 l1; /* latch 1 adder operand only */ |
| 145 | 146 | UINT32 l2; /* latch 2 adder operand only */ |
| r3957 | r3958 | |
| 242 | 243 | memset(&vs, 0, sizeof(vs)); |
| 243 | 244 | memset(&bsp, 0, sizeof(bsp)); |
| 244 | 245 | memset(&vgen, 0, sizeof(vgen)); |
| 246 | vgen.machine = machine; | |
| 245 | 247 | |
| 246 | 248 | state_save_register_item_array(machine, "vector_proc", NULL, 0, vs.sram); |
| 247 | 249 | state_save_register_item(machine, "vector_proc", NULL, 0, vs.ramlatch); |
| r3957 | r3958 | |
| 456 | 458 | if (vg->brez ^ vg->ven) |
| 457 | 459 | { |
| 458 | 460 | if (vg->brez) |
| 459 | V_ADDPOINT (vg->c_h, vg->c_v, 0, 0); | |
| 461 | V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, 0, 0); | |
| 460 | 462 | else |
| 461 | V_ADDPOINT (vg->c_h, vg->c_v, vg->color, vg->intensity); | |
| 463 | V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, vg->color, vg->intensity); | |
| 462 | 464 | vg->ven = vg->brez; |
| 463 | 465 | } |
| 464 | 466 | } |
| r3957 | r3958 | |
|---|---|---|
| 255 | 255 | palette_set_color_rgb(machine, i, pal5bit(i >> 10), pal5bit(i >> 5), pal5bit(i >> 0)); |
| 256 | 256 | |
| 257 | 257 | /* initialize polygon engine */ |
| 258 | poly = poly_alloc(10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 258 | poly = poly_alloc(machine, 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 259 | 259 | |
| 260 | 260 | /* we need to cleanup on exit */ |
| 261 | 261 | add_exit_callback(machine, exit_handler); |
| r3957 | r3958 | |
|---|---|---|
| 128 | 128 | priority_mask = (0xf0); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | if (flip_screen_x_get()) | |
| 131 | if (flip_screen_x_get(machine)) | |
| 132 | 132 | { |
| 133 | 133 | sx = 239 - sx - 24; |
| 134 | 134 | flipx = !flipx; |
| 135 | 135 | } |
| 136 | if( flip_screen_y_get() ) | |
| 136 | if( flip_screen_y_get(machine) ) | |
| 137 | 137 | { |
| 138 | 138 | sy = 254 - 16*height - sy; |
| 139 | 139 | flipy = !flipy; |
| r3957 | r3958 | |
| 165 | 165 | { |
| 166 | 166 | int bank; |
| 167 | 167 | |
| 168 | flip_screen_x_set(~lkage_vreg[2] & 0x01); | |
| 169 | flip_screen_y_set(~lkage_vreg[2] & 0x02); | |
| 168 | flip_screen_x_set(screen->machine, ~lkage_vreg[2] & 0x01); | |
| 169 | flip_screen_y_set(screen->machine, ~lkage_vreg[2] & 0x02); | |
| 170 | 170 | |
| 171 | 171 | bank = lkage_vreg[1]&0x08; |
| 172 | 172 | if( bg_tile_bank != bank ) |
| r3957 | r3958 | |
|---|---|---|
| 180 | 180 | WRITE16_HANDLER( gaiden_flip_w ) |
| 181 | 181 | { |
| 182 | 182 | if (ACCESSING_BITS_0_7) |
| 183 | flip_screen_set(data & 1); | |
| 183 | flip_screen_set(space->machine, data & 1); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
| r3957 | r3958 | |
| 330 | 330 | if (ypos >= 256) |
| 331 | 331 | ypos -= 512; |
| 332 | 332 | |
| 333 | if (flip_screen_get()) | |
| 333 | if (flip_screen_get(machine)) | |
| 334 | 334 | { |
| 335 | 335 | flipx = !flipx; |
| 336 | 336 | flipy = !flipy; |
| r3957 | r3958 | |
| 426 | 426 | if (ypos >= 256) |
| 427 | 427 | ypos -= 512; |
| 428 | 428 | |
| 429 | if (flip_screen_get()) | |
| 429 | if (flip_screen_get(machine)) | |
| 430 | 430 | { |
| 431 | 431 | flipx = !flipx; |
| 432 | 432 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 189 | 189 | WRITE8_HANDLER( zaxxon_flipscreen_w ) |
| 190 | 190 | { |
| 191 | 191 | /* low bit controls flip; background and sprite flip are handled at render time */ |
| 192 | flip_screen_set_no_update(~data & 1); | |
| 193 | tilemap_set_flip(fg_tilemap, flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 192 | flip_screen_set_no_update(space->machine, ~data & 1); | |
| 193 | tilemap_set_flip(fg_tilemap, flip_screen_get(space->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| r3957 | r3958 | |
| 313 | 313 | int colorbase = bg_color + (congo_color_bank << 8); |
| 314 | 314 | int xmask = pixmap->width - 1; |
| 315 | 315 | int ymask = pixmap->height - 1; |
| 316 | int flipmask = flip_screen_get() ? 0xff : 0x00; | |
| 317 | int flipoffs = flip_screen_get() ? 0x38 : 0x40; | |
| 316 | int flipmask = flip_screen_get(machine) ? 0xff : 0x00; | |
| 317 | int flipoffs = flip_screen_get(machine) ? 0x38 : 0x40; | |
| 318 | 318 | int x, y; |
| 319 | 319 | |
| 320 | 320 | /* the starting X value is offset by 1 pixel (normal) or 7 pixels */ |
| 321 | 321 | /* (flipped) due to a delay in the loading */ |
| 322 | if (!flip_screen_get()) | |
| 322 | if (!flip_screen_get(machine)) | |
| 323 | 323 | flipoffs -= 1; |
| 324 | 324 | else |
| 325 | 325 | flipoffs += 7; |
| r3957 | r3958 | |
| 375 | 375 | * |
| 376 | 376 | *************************************/ |
| 377 | 377 | |
| 378 | INLINE int find_minimum_y(UINT8 value) | |
| 378 | INLINE int find_minimum_y(UINT8 value, int flip) | |
| 379 | 379 | { |
| 380 | int flipmask = flip_screen_get() ? 0xff : 0x00; | |
| 381 | int flipconst = flip_screen_get() ? 0xef : 0xf1; | |
| 380 | int flipmask = flip ? 0xff : 0x00; | |
| 381 | int flipconst = flip ? 0xef : 0xf1; | |
| 382 | 382 | int y; |
| 383 | 383 | |
| 384 | 384 | /* the sum of the Y position plus a constant based on the flip state */ |
| r3957 | r3958 | |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | |
| 409 | INLINE int find_minimum_x(UINT8 value) | |
| 409 | INLINE int find_minimum_x(UINT8 value, int flip) | |
| 410 | 410 | { |
| 411 | int flipmask = flip | |
| 411 | int flipmask = flip | |
| 412 | 412 | int x; |
| 413 | 413 | |
| 414 | 414 | /* the sum of the X position plus a constant specifies the address within */ |
| r3957 | r3958 | |
| 422 | 422 | |
| 423 | 423 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 flipxmask, UINT16 flipymask) |
| 424 | 424 | { |
| 425 | int flipmask = flip_screen_get() ? 0xff : 0x00; | |
| 425 | int flip = flip_screen_get(machine); | |
| 426 | int flipmask = flip ? 0xff : 0x00; | |
| 426 | 427 | int offs; |
| 427 | 428 | |
| 428 | 429 | /* only the lower half of sprite RAM is read during rendering */ |
| 429 | 430 | for (offs = 0x7c; offs >= 0; offs -= 4) |
| 430 | 431 | { |
| 431 | int sy = find_minimum_y(spriteram[offs]); | |
| 432 | int sy = find_minimum_y(spriteram[offs], flip); | |
| 432 | 433 | int flipy = (spriteram[offs + (flipymask >> 8)] ^ flipmask) & flipymask; |
| 433 | 434 | int flipx = (spriteram[offs + (flipxmask >> 8)] ^ flipmask) & flipxmask; |
| 434 | 435 | int code = spriteram[offs + 1]; |
| 435 | 436 | int color = (spriteram[offs + 2] & 0x1f) + (congo_color_bank << 5); |
| 436 | int sx = find_minimum_x(spriteram[offs + 3]); | |
| 437 | int sx = find_minimum_x(spriteram[offs + 3], flip); | |
| 437 | 438 | |
| 438 | 439 | /* draw with 256 pixel offsets to ensure we wrap properly */ |
| 439 | 440 | drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0); |
| r3957 | r3958 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | WRITE8_HANDLER( trackfld_flipscreen_w ) |
| 109 | 109 | { |
| 110 | if (flip_screen_get() != data) | |
| 110 | if (flip_screen_get(space->machine) != data) | |
| 111 | 111 | { |
| 112 | flip_screen_set(data); | |
| 112 | flip_screen_set(space->machine, data); | |
| 113 | 113 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 114 | 114 | } |
| 115 | 115 | } |
| r3957 | r3958 | |
| 202 | 202 | int sx = spriteram[offs] - 1; |
| 203 | 203 | int sy = 240 - spriteram_2[offs + 1]; |
| 204 | 204 | |
| 205 | if (flip_screen_get()) | |
| 205 | if (flip_screen_get(machine)) | |
| 206 | 206 | { |
| 207 | 207 | sy = 240 - sy; |
| 208 | 208 | flipy = !flipy; |
| r3957 | r3958 | |
| 238 | 238 | for (row = 0; row < 32; row++) |
| 239 | 239 | { |
| 240 | 240 | scrollx = trackfld_scroll[row] + 256 * (trackfld_scroll2[row] & 0x01); |
| 241 | if (flip_screen_get()) scrollx = -scrollx; | |
| 241 | if (flip_screen_get(screen->machine)) scrollx = -scrollx; | |
| 242 | 242 | tilemap_set_scrollx(bg_tilemap, row, scrollx); |
| 243 | 243 | } |
| 244 | 244 |
| r3957 | r3958 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | WRITE8_HANDLER( fastfred_flip_screen_x_w ) |
| 221 | 221 | { |
| 222 | if (flip_screen_x_get() != (data & 0x01)) | |
| 222 | if (flip_screen_x_get(space->machine) != (data & 0x01)) | |
| 223 | 223 | { |
| 224 | flip_screen_x_set(data & 0x01); | |
| 224 | flip_screen_x_set(space->machine, data & 0x01); | |
| 225 | 225 | |
| 226 | tilemap_set_flip(bg_tilemap, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) | (flip_screen_y_get() ? TILEMAP_FLIPY : 0)); | |
| 226 | tilemap_set_flip(bg_tilemap, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0)); | |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | WRITE8_HANDLER( fastfred_flip_screen_y_w ) |
| 231 | 231 | { |
| 232 | if (flip_screen_y_get() != (data & 0x01)) | |
| 232 | if (flip_screen_y_get(space->machine) != (data & 0x01)) | |
| 233 | 233 | { |
| 234 | flip_screen_y_set(data & 0x01); | |
| 234 | flip_screen_y_set(space->machine, data & 0x01); | |
| 235 | 235 | |
| 236 | tilemap_set_flip(bg_tilemap, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) | (flip_screen_y_get() ? TILEMAP_FLIPY : 0)); | |
| 236 | tilemap_set_flip(bg_tilemap, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0)); | |
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
| r3957 | r3958 | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | |
| 290 | if (flip_screen_x_get()) | |
| 290 | if (flip_screen_x_get(machine)) | |
| 291 | 291 | { |
| 292 | 292 | sx = 240 - sx; |
| 293 | 293 | flipx = !flipx; |
| 294 | 294 | } |
| 295 | if (flip_screen_y_get()) | |
| 295 | if (flip_screen_y_get(machine)) | |
| 296 | 296 | { |
| 297 | 297 | sy = 240 - sy; |
| 298 | 298 | flipy = !flipy; |
| r3957 | r3958 | |
| 303 | 303 | colorbank | (fastfred_spriteram[offs + 2] & 0x07), |
| 304 | 304 | flipx,flipy, |
| 305 | 305 | sx,sy, |
| 306 | flip_screen_x_get() ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0); | |
| 306 | flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0); | |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 |
| r3957 | r3958 | |
|---|---|---|
| 203 | 203 | flipx = buffered_spriteram[offs + 1] & 0x02; |
| 204 | 204 | flipy = buffered_spriteram[offs + 1] & 0x04; |
| 205 | 205 | |
| 206 | if (flip_screen_get()) | |
| 206 | if (flip_screen_get(machine)) | |
| 207 | 207 | { |
| 208 | 208 | sx = 240 - sx; |
| 209 | 209 | sy = 240 - sy; |
| r3957 | r3958 | |
| 252 | 252 | flipy = 1; |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | if (flip_screen_get()) | |
| 255 | if (flip_screen_get(machine)) | |
| 256 | 256 | { |
| 257 | 257 | sx = 240 - sx; |
| 258 | 258 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | WRITE8_HANDLER( tecmo_flipscreen_w ) |
| 153 | 153 | { |
| 154 | flip_screen_set(data & 1); | |
| 154 | flip_screen_set(space->machine, data & 1); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
| r3957 | r3958 | |
| 201 | 201 | flipx = bank & 1; |
| 202 | 202 | flipy = bank & 2; |
| 203 | 203 | |
| 204 | if (flip_screen_get()) | |
| 204 | if (flip_screen_get(machine)) | |
| 205 | 205 | { |
| 206 | 206 | xpos = 256 - (8 * size) - xpos; |
| 207 | 207 | ypos = 256 - (8 * size) - ypos; |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | UINT8 *finalizr_videoram2,*finalizr_colorram2; |
| 15 | 15 | static int spriterambank,charbank; |
| 16 | 16 | |
| 17 | static tilemap *bg_tilemap; | |
| 18 | static tilemap *fg_tilemap; | |
| 17 | 19 | |
| 18 | 20 | |
| 21 | ||
| 19 | 22 | PALETTE_INIT( finalizr ) |
| 20 | 23 | { |
| 21 | 24 | int i; |
| r3957 | r3958 | |
| 49 | 52 | } |
| 50 | 53 | } |
| 51 | 54 | |
| 55 | static TILE_GET_INFO( get_bg_tile_info ) | |
| 56 | { | |
| 57 | int attr = colorram[tile_index]; | |
| 58 | int code = videoram[tile_index] + ((attr & 0xc0) << 2) + (charbank<<10); | |
| 59 | int color = attr & 0x0f; | |
| 60 | int flags = TILE_FLIPYX((attr & 0x30) >> 4); | |
| 61 | ||
| 62 | SET_TILE_INFO(0, code, color, flags); | |
| 63 | } | |
| 64 | ||
| 65 | static TILE_GET_INFO( get_fg_tile_info ) | |
| 66 | { | |
| 67 | int attr = finalizr_colorram2[tile_index]; | |
| 68 | int code = finalizr_videoram2[tile_index] + ((attr & 0xc0) << 2); | |
| 69 | int color = attr & 0x0f; | |
| 70 | int flags = TILE_FLIPYX((attr & 0x30) >> 4); | |
| 71 | ||
| 72 | SET_TILE_INFO(0, code, color, flags); | |
| 73 | } | |
| 74 | ||
| 52 | 75 | VIDEO_START( finalizr ) |
| 53 | 76 | { |
| 54 | tmpbitmap = auto_bitmap_alloc(256,256,video_screen_get_format(machine->primary_screen)); | |
| 77 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 78 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 55 | 79 | } |
| 56 | 80 | |
| 57 | 81 | |
| r3957 | r3958 | |
| 71 | 95 | { |
| 72 | 96 | int offs; |
| 73 | 97 | |
| 98 | tilemap_mark_all_tiles_dirty(bg_tilemap); | |
| 99 | tilemap_mark_all_tiles_dirty(fg_tilemap); | |
| 74 | 100 | |
| 75 | /* for every character in the Video RAM */ | |
| 76 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 77 | { | |
| 78 | int sx,sy; | |
| 101 | tilemap_set_scrollx(bg_tilemap, 0, *finalizr_scroll-16); | |
| 102 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 79 | 103 | |
| 80 | ||
| 81 | sx = offs % 32; | |
| 82 | sy = offs / 32; | |
| 83 | ||
| 84 | drawgfx(tmpbitmap,screen->machine->gfx[0], | |
| 85 | videoram[offs] + ((colorram[offs] & 0xc0) << 2) + (charbank<<10), | |
| 86 | (colorram[offs] & 0x0f), | |
| 87 | colorram[offs] & 0x10,colorram[offs] & 0x20, | |
| 88 | 8*sx,8*sy, | |
| 89 | 0,TRANSPARENCY_NONE,0); | |
| 90 | } | |
| 91 | ||
| 92 | ||
| 93 | /* copy the temporary bitmap to the screen */ | |
| 94 | { | |
| 95 | int scroll; | |
| 96 | ||
| 97 | ||
| 98 | scroll = -*finalizr_scroll + 16; | |
| 99 | ||
| 100 | copyscrollbitmap(bitmap,tmpbitmap,1,&scroll,0,0,cliprect); | |
| 101 | } | |
| 102 | ||
| 103 | ||
| 104 | 104 | /* Draw the sprites. */ |
| 105 | 105 | { |
| 106 | UINT8 *sr; | |
| 106 | const gfx_element *gfx1 = screen->machine->gfx[1]; | |
| 107 | const gfx_element *gfx2 = screen->machine->gfx[2]; | |
| 107 | 108 | |
| 109 | UINT8 *sr = spriterambank ? spriteram_2 : spriteram; | |
| 108 | 110 | |
| 109 | if (spriterambank != 0) | |
| 110 | sr = spriteram_2; | |
| 111 | else sr = spriteram; | |
| 112 | 111 | |
| 113 | for (offs = 0;offs < spriteram_size;offs += 5) | |
| 112 | for (offs = 0;offs <= spriteram_size-5;offs += 5) | |
| 114 | 113 | { |
| 115 | int sx,sy,flipx,flipy,code,color; | |
| 114 | int sx,sy,flipx,flipy,code,color,size; | |
| 116 | 115 | |
| 117 | 116 | |
| 118 | 117 | sx = 16 + sr[offs+3] - ((sr[offs+4] & 0x01) << 8); |
| r3957 | r3958 | |
| 124 | 123 | |
| 125 | 124 | // (sr[offs+4] & 0x02) is used, meaning unknown |
| 126 | 125 | |
| 127 | switch (sr[offs+4] & 0x1c) | |
| 126 | size = sr[offs+4] & 0x1c; | |
| 127 | ||
| 128 | if (size >= 0x10) /* 32x32 */ | |
| 128 | 129 | { |
| 129 | case 0x10: /* 32x32? */ | |
| 130 | case 0x14: /* ? */ | |
| 131 | case 0x18: /* ? */ | |
| 132 | case 0x1c: /* ? */ | |
| 133 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 134 | code, | |
| 135 | color, | |
| 136 | flipx,flipy, | |
| 137 | flipx?sx+16:sx,flipy?sy+16:sy, | |
| 138 | cliprect,TRANSPARENCY_PEN,0); | |
| 139 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 140 | code + 1, | |
| 141 | color, | |
| 142 | flipx,flipy, | |
| 143 | flipx?sx:sx+16,flipy?sy+16:sy, | |
| 144 | cliprect,TRANSPARENCY_PEN,0); | |
| 145 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 146 | code + 2, | |
| 147 | color, | |
| 148 | flipx,flipy, | |
| 149 | flipx?sx+16:sx,flipy?sy:sy+16, | |
| 150 | cliprect,TRANSPARENCY_PEN,0); | |
| 151 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 152 | code + 3, | |
| 153 | color, | |
| 154 | flipx,flipy, | |
| 155 | flipx?sx:sx+16,flipy?sy:sy+16, | |
| 156 | cliprect,TRANSPARENCY_PEN,0); | |
| 157 | break; | |
| 130 | if (flip_screen_get(screen->machine)) | |
| 131 | { | |
| 132 | sx = 256 - sx; | |
| 133 | sy = 224 - sy; | |
| 134 | flipx = !flipx; | |
| 135 | flipy = !flipy; | |
| 136 | } | |
| 158 | 137 | |
| 159 | case 0x00: /* 16x16 */ | |
| 160 | drawgfx(bitmap,screen->machine->gfx[1], | |
| 138 | drawgfx(bitmap,gfx1, | |
| 139 | code, | |
| 140 | color, | |
| 141 | flipx,flipy, | |
| 142 | flipx?sx+16:sx,flipy?sy+16:sy, | |
| 143 | cliprect,TRANSPARENCY_PEN,0); | |
| 144 | drawgfx(bitmap,gfx1, | |
| 145 | code + 1, | |
| 146 | color, | |
| 147 | flipx,flipy, | |
| 148 | flipx?sx:sx+16,flipy?sy+16:sy, | |
| 149 | cliprect,TRANSPARENCY_PEN,0); | |
| 150 | drawgfx(bitmap,gfx1, | |
| 151 | code + 2, | |
| 152 | color, | |
| 153 | flipx,flipy, | |
| 154 | flipx?sx+16:sx,flipy?sy:sy+16, | |
| 155 | cliprect,TRANSPARENCY_PEN,0); | |
| 156 | drawgfx(bitmap,gfx1, | |
| 157 | code + 3, | |
| 158 | color, | |
| 159 | flipx,flipy, | |
| 160 | flipx?sx:sx+16,flipy?sy:sy+16, | |
| 161 | cliprect,TRANSPARENCY_PEN,0); | |
| 162 | } | |
| 163 | else | |
| 164 | { | |
| 165 | if (flip_screen_get(screen->machine)) | |
| 166 | { | |
| 167 | sx = ((size & 0x08) ? 280:272) - sx; | |
| 168 | sy = ((size & 0x04) ? 248:240) - sy; | |
| 169 | flipx = !flipx; | |
| 170 | flipy = !flipy; | |
| 171 | } | |
| 172 | ||
| 173 | if (size == 0x00) /* 16x16 */ | |
| 174 | { | |
| 175 | drawgfx(bitmap,gfx1, | |
| 161 | 176 | code, |
| 162 | 177 | color, |
| 163 | 178 | flipx,flipy, |
| 164 | 179 | sx,sy, |
| 165 | 180 | cliprect,TRANSPARENCY_PEN,0); |
| 166 | break; | |
| 167 | ||
| 168 | case 0x04: /* 16x8 */ | |
| 181 | } | |
| 182 | else | |
| 183 | { | |
| 169 | 184 | code = ((code & 0x3ff) << 2) | ((code & 0xc00) >> 10); |
| 170 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 171 | code & ~1, | |
| 172 | color, | |
| 173 | flipx,flipy, | |
| 174 | flipx?sx+8:sx,sy, | |
| 175 | cliprect,TRANSPARENCY_PEN,0); | |
| 176 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 177 | code | 1, | |
| 178 | color, | |
| 179 | flipx,flipy, | |
| 180 | flipx?sx:sx+8,sy, | |
| 181 | cliprect,TRANSPARENCY_PEN,0); | |
| 182 | break; | |
| 183 | 185 | |
| 184 | case 0x08: /* 8x16 */ | |
| 185 | code = ((code & 0x3ff) << 2) | ((code & 0xc00) >> 10); | |
| 186 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 187 | code & ~2, | |
| 188 | color, | |
| 189 | flipx,flipy, | |
| 190 | sx,flipy?sy+8:sy, | |
| 191 | cliprect,TRANSPARENCY_PEN,0); | |
| 192 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 193 | code | 2, | |
| 194 | color, | |
| 195 | flipx,flipy, | |
| 196 | sx,flipy?sy:sy+8, | |
| 197 | cliprect,TRANSPARENCY_PEN,0); | |
| 198 | break; | |
| 199 | ||
| 200 | case 0x0c: /* 8x8 */ | |
| 201 | code = ((code & 0x3ff) << 2) | ((code & 0xc00) >> 10); | |
| 202 | drawgfx(bitmap,screen->machine->gfx[2], | |
| 203 | code, | |
| 204 | color, | |
| 205 | flipx,flipy, | |
| 206 | sx,sy, | |
| 207 | cliprect,TRANSPARENCY_PEN,0); | |
| 208 | break; | |
| 186 | if (size == 0x04) /* 16x8 */ | |
| 187 | { | |
| 188 | drawgfx(bitmap,gfx2, | |
| 189 | code & ~1, | |
| 190 | color, | |
| 191 | flipx,flipy, | |
| 192 | flipx?sx+8:sx,sy, | |
| 193 | cliprect,TRANSPARENCY_PEN,0); | |
| 194 | drawgfx(bitmap,gfx2, | |
| 195 | code | 1, | |
| 196 | color, | |
| 197 | flipx,flipy, | |
| 198 | flipx?sx:sx+8,sy, | |
| 199 | cliprect,TRANSPARENCY_PEN,0); | |
| 200 | } | |
| 201 | else if (size == 0x08) /* 8x16 */ | |
| 202 | { | |
| 203 | drawgfx(bitmap,gfx2, | |
| 204 | code & ~2, | |
| 205 | color, | |
| 206 | flipx,flipy, | |
| 207 | sx,flipy?sy+8:sy, | |
| 208 | cliprect,TRANSPARENCY_PEN,0); | |
| 209 | drawgfx(bitmap,gfx2, | |
| 210 | code | 2, | |
| 211 | color, | |
| 212 | flipx,flipy, | |
| 213 | sx,flipy?sy:sy+8, | |
| 214 | cliprect,TRANSPARENCY_PEN,0); | |
| 215 | } | |
| 216 | else if (size == 0x0c) /* 8x8 */ | |
| 217 | { | |
| 218 | drawgfx(bitmap,gfx2, | |
| 219 | code, | |
| 220 | color, | |
| 221 | flipx,flipy, | |
| 222 | sx,sy, | |
| 223 | cliprect,TRANSPARENCY_PEN,0); | |
| 224 | } | |
| 225 | } | |
| 209 | 226 | } |
| 210 | 227 | } |
| 211 | 228 | } |
| 212 | 229 | |
| 213 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 214 | 230 | { |
| 215 | int sx,sy; | |
| 231 | const rectangle *visarea = video_screen_get_visible_area(screen); | |
| 232 | rectangle clip = *cliprect; | |
| 216 | 233 | |
| 234 | /* draw top status region */ | |
| 235 | clip.min_x = visarea->min_x; | |
| 236 | clip.max_x = visarea->min_x + 15; | |
| 237 | tilemap_set_scrolldx(fg_tilemap, 0,-16); | |
| 238 | tilemap_draw(bitmap, &clip, fg_tilemap, 0, 0); | |
| 217 | 239 | |
| 218 | sx = offs % 32; | |
| 219 | if (sx < 6) | |
| 220 | { | |
| 221 | if (sx >= 3) sx += 30; | |
| 222 | sy = offs / 32; | |
| 223 | ||
| 224 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 225 | finalizr_videoram2[offs] + ((finalizr_colorram2[offs] & 0xc0) << 2), | |
| 226 | (finalizr_colorram2[offs] & 0x0f), | |
| 227 | finalizr_colorram2[offs] & 0x10,finalizr_colorram2[offs] & 0x20, | |
| 228 | 8*sx,8*sy, | |
| 229 | cliprect,TRANSPARENCY_NONE,0); | |
| 230 | } | |
| 240 | /* draw bottom status region */ | |
| 241 | clip.min_x = visarea->max_x - 15; | |
| 242 | clip.max_x = visarea->max_x; | |
| 243 | tilemap_set_scrolldx(fg_tilemap,-16, 0); | |
| 244 | tilemap_draw(bitmap, &clip, fg_tilemap, 0, 0); | |
| 231 | 245 | } |
| 232 | 246 | return 0; |
| 233 | 247 | } |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | int bankaddress; |
| 24 | 24 | |
| 25 | 25 | /* bit 0 = flipx (or y?) */ |
| 26 | if (flip_screen_x_get() != (data & 0x01)) | |
| 26 | if (flip_screen_x_get(space->machine) != (data & 0x01)) | |
| 27 | 27 | { |
| 28 | flip_screen_x_set(data & 0x01); | |
| 28 | flip_screen_x_set(space->machine, data & 0x01); | |
| 29 | 29 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /* bit 1 = flipy (or x?) */ |
| 33 | if (flip_screen_y_get() != (data & 0x02)) | |
| 33 | if (flip_screen_y_get(space->machine) != (data & 0x02)) | |
| 34 | 34 | { |
| 35 | flip_screen_y_set(data & 0x02); | |
| 35 | flip_screen_y_set(space->machine, data & 0x02); | |
| 36 | 36 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 37 | 37 | } |
| 38 | 38 |
| r3957 | r3958 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | WRITE8_HANDLER( cloak_flipscreen_w ) |
| 157 | 157 | { |
| 158 | flip_screen_set(data & 0x80); | |
| 158 | flip_screen_set(space->machine, data & 0x80); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 215 | 215 | int sx = spriteram[offs + 192]; |
| 216 | 216 | int sy = 240 - spriteram[offs]; |
| 217 | 217 | |
| 218 | if (flip_screen_get()) | |
| 218 | if (flip_screen_get(machine)) | |
| 219 | 219 | { |
| 220 | 220 | sx -= 9; |
| 221 | 221 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "cpu/sharc/sharc.h" |
| 4 | 3 | #include "machine/konppc.h" |
| 5 | 4 | #include "video/poly.h" |
| r3957 | r3958 | |
| 222 | 221 | |
| 223 | 222 | K001005_3d_fifo = auto_malloc(0x10000 * sizeof(UINT32)); |
| 224 | 223 | |
| 225 | poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 224 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 226 | 225 | add_exit_callback(machine, K001005_exit); |
| 227 | 226 | |
| 228 | 227 | for (i=0; i < 128; i++) |
| r3957 | r3958 | |
| 482 | 481 | } |
| 483 | 482 | } |
| 484 | 483 | |
| 484 | static UINT8 *gfxrom; | |
| 485 | ||
| 485 | 486 | static void draw_scanline_tex(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 486 | 487 | { |
| 487 | 488 | const poly_extra_data *extra = extradata; |
| 488 | 489 | bitmap_t *destmap = dest; |
| 489 | UINT8 *texrom = | |
| 490 | UINT8 *texrom = | |
| 490 | 491 | int pal_chip = (extra->texture_palette & 0x8) ? 1 : 0; |
| 491 | 492 | int palette_index = (extra->texture_palette & 0x7) * 256; |
| 492 | 493 | float z = extent->param[0].start; |
| r3957 | r3958 | |
| 978 | 979 | tick = 0; |
| 979 | 980 | debug_tex_page = 0; |
| 980 | 981 | debug_tex_palette = 0; |
| 982 | gfxrom = memory_region(machine, "gfx1"); | |
| 981 | 983 | |
| 982 | 984 | K001006_init(machine); |
| 983 | 985 | K001005_init(machine); |
| r3957 | r3958 | |
|---|---|---|
| 242 | 242 | int sx = buffered_spriteram16[offs+3]; |
| 243 | 243 | int sy = sprite_offy+240-(buffered_spriteram16[offs+0]&0x1ff); |
| 244 | 244 | |
| 245 | if (flip_screen_get()) { | |
| 245 | if (flip_screen_get(machine)) { | |
| 246 | 246 | sx = 320 - sx + 176; /* don't ask where 176 comes from, just tried it out */ |
| 247 | 247 | sy = 240 - sy + 1; /* don't ask where 1 comes from, just tried it out */ |
| 248 | 248 | flipx = !flipx; /* the values seem to result in pixel-correct placement */ |
| r3957 | r3958 | |
|---|---|---|
| 183 | 183 | interrupt_enable_w(space,0,data & 0x01); |
| 184 | 184 | |
| 185 | 185 | /* bit 1 flip screen */ |
| 186 | flip_screen_set(data & 0x02); | |
| 186 | flip_screen_set(space->machine, data & 0x02); | |
| 187 | 187 | |
| 188 | 188 | /* bits 2-3 unknown */ |
| 189 | 189 | |
| r3957 | r3958 | |
| 203 | 203 | /* bit 7 unknown (used) */ |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | static void appoooh_draw_sprites(bitmap_t *dest_bmp, | |
| 206 | static void appoooh_draw_sprites(running_machine *machine, | |
| 207 | bitmap_t *dest_bmp, | |
| 207 | 208 | const rectangle *cliprect, |
| 208 | 209 | const gfx_element *gfx, |
| 209 | 210 | UINT8 *sprite) |
| r3957 | r3958 | |
| 220 | 221 | |
| 221 | 222 | if(sx>=248) sx -= 256; |
| 222 | 223 | |
| 223 | if (flip_screen_get()) | |
| 224 | if (flip_screen_get(machine)) | |
| 224 | 225 | { |
| 225 | 226 | sx = 239 - sx; |
| 226 | 227 | sy = 239 - sy; |
| r3957 | r3958 | |
| 229 | 230 | drawgfx( dest_bmp, gfx, |
| 230 | 231 | code, |
| 231 | 232 | color, |
| 232 | flipx,flip_screen_get(), | |
| 233 | flipx,flip_screen_get(machine), | |
| 233 | 234 | sx, sy, |
| 234 | 235 | cliprect, |
| 235 | 236 | TRANSPARENCY_PEN , 0); |
| 236 | 237 | } |
| 237 | 238 | } |
| 238 | 239 | |
| 239 | static void robowres_draw_sprites(bitmap_t *dest_bmp, | |
| 240 | static void robowres_draw_sprites(running_machine *machine, | |
| 241 | bitmap_t *dest_bmp, | |
| 240 | 242 | const rectangle *cliprect, |
| 241 | 243 | const gfx_element *gfx, |
| 242 | 244 | UINT8 *sprite) |
| r3957 | r3958 | |
| 253 | 255 | |
| 254 | 256 | if(sx>=248) sx -= 256; |
| 255 | 257 | |
| 256 | if (flip_screen_get()) | |
| 258 | if (flip_screen_get(machine)) | |
| 257 | 259 | { |
| 258 | 260 | sx = 239 - sx; |
| 259 | 261 | sy = 239 - sy; |
| r3957 | r3958 | |
| 262 | 264 | drawgfx( dest_bmp, gfx, |
| 263 | 265 | code, |
| 264 | 266 | color, |
| 265 | flipx,flip_screen_get(), | |
| 267 | flipx,flip_screen_get(machine), | |
| 266 | 268 | sx, sy, |
| 267 | 269 | cliprect, |
| 268 | 270 | TRANSPARENCY_PEN , 0); |
| r3957 | r3958 | |
| 281 | 283 | if (priority == 1) |
| 282 | 284 | { |
| 283 | 285 | /* sprite set #1 */ |
| 284 | appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 286 | appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 285 | 287 | /* sprite set #2 */ |
| 286 | appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 288 | appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 287 | 289 | } |
| 288 | 290 | else |
| 289 | 291 | { |
| 290 | 292 | /* sprite set #2 */ |
| 291 | appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 293 | appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 292 | 294 | /* sprite set #1 */ |
| 293 | appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 295 | appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 294 | 296 | } |
| 295 | 297 | |
| 296 | 298 | if (priority != 0) /* fg in front of sprites */ |
| r3957 | r3958 | |
| 309 | 311 | if (priority == 1) |
| 310 | 312 | { |
| 311 | 313 | /* sprite set #1 */ |
| 312 | robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 314 | robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 313 | 315 | /* sprite set #2 */ |
| 314 | robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 316 | robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 315 | 317 | } |
| 316 | 318 | else |
| 317 | 319 | { |
| 318 | 320 | /* sprite set #2 */ |
| 319 | robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 321 | robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2); | |
| 320 | 322 | /* sprite set #1 */ |
| 321 | robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 323 | robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram); | |
| 322 | 324 | } |
| 323 | 325 | |
| 324 | 326 | if (priority != 0) /* fg in front of sprites */ |
| r3957 | r3958 | |
|---|---|---|
| 276 | 276 | /* screen flip is handled both by software and hardware */ |
| 277 | 277 | data ^= ~input_port_read(space->machine, "DSW2") & 1; |
| 278 | 278 | |
| 279 | flip_screen_set(data & 1); | |
| 279 | flip_screen_set(space->machine, data & 1); | |
| 280 | 280 | |
| 281 | 281 | coin_counter_w(0,data & 0x02); |
| 282 | 282 | coin_counter_w(1,data & 0x20); |
| r3957 | r3958 | |
| 304 | 304 | 8*8, 32*8-1 |
| 305 | 305 | }; |
| 306 | 306 | rectangle clip = *cliprect; |
| 307 | if (flip_screen_get()) | |
| 307 | if (flip_screen_get(machine)) | |
| 308 | 308 | sect_rect(&clip, &spritevisibleareaflip); |
| 309 | 309 | else |
| 310 | 310 | sect_rect(&clip, &spritevisiblearea); |
| r3957 | r3958 | |
| 319 | 319 | int flipx = attr & 0x40; |
| 320 | 320 | int flipy = attr & 0x80; |
| 321 | 321 | |
| 322 | if (flip_screen_get()) | |
| 322 | if (flip_screen_get(machine)) | |
| 323 | 323 | { |
| 324 | 324 | sx = 240 - sx; |
| 325 | 325 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "deprecat.h" | |
| 22 | 21 | #include "includes/psx.h" |
| 23 | 22 | |
| 24 | 23 | #define STOP_ON_ERROR ( 0 ) |
| r3957 | r3958 | |
| 946 | 945 | |iy|ix|ty| | tp| abr|ty| tx |
| 947 | 946 | */ |
| 948 | 947 | |
| 949 | INLINE void decode_tpage( struct PSXGPU *p_psxgpu, UINT32 tpage ) | |
| 948 | INLINE void decode_tpage( running_machine *machine, struct PSXGPU *p_psxgpu, UINT32 tpage ) | |
| 950 | 949 | { |
| 951 | running_machine *machine = Machine; | |
| 952 | ||
| 953 | 950 | if( m_n_gputype == 2 ) |
| 954 | 951 | { |
| 955 | 952 | m_n_gpustatus = ( m_n_gpustatus & 0xfffff800 ) | ( tpage & 0x7ff ); |
| r3957 | r3958 | |
| 1451 | 1448 | } \ |
| 1452 | 1449 | } |
| 1453 | 1450 | |
| 1454 | static void FlatPolygon( int n_points ) | |
| 1451 | static void FlatPolygon( running_machine *machine, int n_points ) | |
| 1455 | 1452 | { |
| 1456 | running_machine *machine = Machine; | |
| 1457 | 1453 | INT16 n_y; |
| 1458 | 1454 | INT16 n_x; |
| 1459 | 1455 | |
| r3957 | r3958 | |
| 1607 | 1603 | } |
| 1608 | 1604 | } |
| 1609 | 1605 | |
| 1610 | static void FlatTexturedPolygon( int n_points ) | |
| 1606 | static void FlatTexturedPolygon( running_machine *machine, int n_points ) | |
| 1611 | 1607 | { |
| 1612 | running_machine *machine = Machine; | |
| 1613 | 1608 | INT16 n_y; |
| 1614 | 1609 | INT16 n_x; |
| 1615 | 1610 | int n_tx; |
| r3957 | r3958 | |
| 1686 | 1681 | n_cu2.d = 0; |
| 1687 | 1682 | n_cv2.d = 0; |
| 1688 | 1683 | |
| 1689 | decode_tpage( &psxgpu, m_packet.FlatTexturedPolygon.vertex[ 1 ].n_texture.w.h ); | |
| 1684 | decode_tpage( machine, &psxgpu, m_packet.FlatTexturedPolygon.vertex[ 1 ].n_texture.w.h ); | |
| 1690 | 1685 | TEXTURESETUP |
| 1691 | 1686 | |
| 1692 | 1687 | switch( n_cmd & 0x01 ) |
| r3957 | r3958 | |
| 1830 | 1825 | } |
| 1831 | 1826 | } |
| 1832 | 1827 | |
| 1833 | static void GouraudPolygon( int n_points ) | |
| 1828 | static void GouraudPolygon( running_machine *machine, int n_points ) | |
| 1834 | 1829 | { |
| 1835 | running_machine *machine = Machine; | |
| 1836 | 1830 | INT16 n_y; |
| 1837 | 1831 | INT16 n_x; |
| 1838 | 1832 | |
| r3957 | r3958 | |
| 2044 | 2038 | } |
| 2045 | 2039 | } |
| 2046 | 2040 | |
| 2047 | static void GouraudTexturedPolygon( int n_points ) | |
| 2041 | static void GouraudTexturedPolygon( running_machine *machine, int n_points ) | |
| 2048 | 2042 | { |
| 2049 | running_machine *machine = Machine; | |
| 2050 | 2043 | INT16 n_y; |
| 2051 | 2044 | INT16 n_x; |
| 2052 | 2045 | int n_tx; |
| r3957 | r3958 | |
| 2141 | 2134 | n_cu2.d = 0; |
| 2142 | 2135 | n_cv2.d = 0; |
| 2143 | 2136 | |
| 2144 | decode_tpage( &psxgpu, m_packet.GouraudTexturedPolygon.vertex[ 1 ].n_texture.w.h ); | |
| 2137 | decode_tpage( machine, &psxgpu, m_packet.GouraudTexturedPolygon.vertex[ 1 ].n_texture.w.h ); | |
| 2145 | 2138 | TEXTURESETUP |
| 2146 | 2139 | |
| 2147 | 2140 | if( n_points == 4 ) |
| r3957 | r3958 | |
| 2615 | 2608 | } |
| 2616 | 2609 | } |
| 2617 | 2610 | |
| 2618 | static void FlatRectangle( | |
| 2611 | static void FlatRectangle( running_machine *machine ) | |
| 2619 | 2612 | { |
| 2620 | running_machine *machine = Machine; | |
| 2621 | 2613 | INT16 n_y; |
| 2622 | 2614 | INT16 n_x; |
| 2623 | 2615 | |
| r3957 | r3958 | |
| 2681 | 2673 | } |
| 2682 | 2674 | } |
| 2683 | 2675 | |
| 2684 | static void FlatRectangle8x8( | |
| 2676 | static void FlatRectangle8x8( running_machine *machine ) | |
| 2685 | 2677 | { |
| 2686 | running_machine *machine = Machine; | |
| 2687 | 2678 | INT16 n_y; |
| 2688 | 2679 | INT16 n_x; |
| 2689 | 2680 | |
| r3957 | r3958 | |
| 2747 | 2738 | } |
| 2748 | 2739 | } |
| 2749 | 2740 | |
| 2750 | static void FlatRectangle16x16( | |
| 2741 | static void FlatRectangle16x16( running_machine *machine ) | |
| 2751 | 2742 | { |
| 2752 | running_machine *machine = Machine; | |
| 2753 | 2743 | INT16 n_y; |
| 2754 | 2744 | INT16 n_x; |
| 2755 | 2745 | |
| r3957 | r3958 | |
| 2813 | 2803 | } |
| 2814 | 2804 | } |
| 2815 | 2805 | |
| 2816 | static void FlatTexturedRectangle( | |
| 2806 | static void FlatTexturedRectangle( running_machine *machine ) | |
| 2817 | 2807 | { |
| 2818 | running_machine *machine = Machine; | |
| 2819 | 2808 | INT16 n_y; |
| 2820 | 2809 | INT16 n_x; |
| 2821 | 2810 | int n_tx; |
| r3957 | r3958 | |
| 2912 | 2901 | } |
| 2913 | 2902 | } |
| 2914 | 2903 | |
| 2915 | static void Sprite8x8( | |
| 2904 | static void Sprite8x8( running_machine *machine ) | |
| 2916 | 2905 | { |
| 2917 | running_machine *machine = Machine; | |
| 2918 | 2906 | INT16 n_y; |
| 2919 | 2907 | INT16 n_x; |
| 2920 | 2908 | int n_tx; |
| r3957 | r3958 | |
| 3011 | 2999 | } |
| 3012 | 3000 | } |
| 3013 | 3001 | |
| 3014 | static void Sprite16x16( | |
| 3002 | static void Sprite16x16( running_machine *machine ) | |
| 3015 | 3003 | { |
| 3016 | running_machine *machine = Machine; | |
| 3017 | 3004 | INT16 n_y; |
| 3018 | 3005 | INT16 n_x; |
| 3019 | 3006 | int n_tx; |
| r3957 | r3958 | |
| 3192 | 3179 | } |
| 3193 | 3180 | } |
| 3194 | 3181 | |
| 3195 | void psx_gpu_write( UINT32 *p_ram, INT32 n_size ) | |
| 3182 | void psx_gpu_write( running_machine *machine, UINT32 *p_ram, INT32 n_size ) | |
| 3196 | 3183 | { |
| 3197 | running_machine *machine = Machine; | |
| 3198 | ||
| 3199 | 3184 | while( n_size > 0 ) |
| 3200 | 3185 | { |
| 3201 | 3186 | UINT32 data = *( p_ram ); |
| r3957 | r3958 | |
| 3234 | 3219 | else |
| 3235 | 3220 | { |
| 3236 | 3221 | verboselog( machine, 1, "%02x: monochrome 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3237 | FlatPolygon( 3 ); | |
| 3222 | FlatPolygon( machine, 3 ); | |
| 3238 | 3223 | m_n_gpu_buffer_offset = 0; |
| 3239 | 3224 | } |
| 3240 | 3225 | break; |
| r3957 | r3958 | |
| 3249 | 3234 | else |
| 3250 | 3235 | { |
| 3251 | 3236 | verboselog( machine, 1, "%02x: textured 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3252 | FlatTexturedPolygon( 3 ); | |
| 3237 | FlatTexturedPolygon( machine, 3 ); | |
| 3253 | 3238 | m_n_gpu_buffer_offset = 0; |
| 3254 | 3239 | } |
| 3255 | 3240 | break; |
| r3957 | r3958 | |
| 3264 | 3249 | else |
| 3265 | 3250 | { |
| 3266 | 3251 | verboselog( machine, 1, "%02x: monochrome 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3267 | FlatPolygon( 4 ); | |
| 3252 | FlatPolygon( machine, 4 ); | |
| 3268 | 3253 | m_n_gpu_buffer_offset = 0; |
| 3269 | 3254 | } |
| 3270 | 3255 | break; |
| r3957 | r3958 | |
| 3279 | 3264 | else |
| 3280 | 3265 | { |
| 3281 | 3266 | verboselog( machine, 1, "%02x: textured 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3282 | FlatTexturedPolygon( 4 ); | |
| 3267 | FlatTexturedPolygon( machine, 4 ); | |
| 3283 | 3268 | m_n_gpu_buffer_offset = 0; |
| 3284 | 3269 | } |
| 3285 | 3270 | break; |
| r3957 | r3958 | |
| 3294 | 3279 | else |
| 3295 | 3280 | { |
| 3296 | 3281 | verboselog( machine, 1, "%02x: gouraud 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3297 | GouraudPolygon( 3 ); | |
| 3282 | GouraudPolygon( machine, 3 ); | |
| 3298 | 3283 | m_n_gpu_buffer_offset = 0; |
| 3299 | 3284 | } |
| 3300 | 3285 | break; |
| r3957 | r3958 | |
| 3309 | 3294 | else |
| 3310 | 3295 | { |
| 3311 | 3296 | verboselog( machine, 1, "%02x: gouraud textured 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3312 | GouraudTexturedPolygon( 3 ); | |
| 3297 | GouraudTexturedPolygon( machine, 3 ); | |
| 3313 | 3298 | m_n_gpu_buffer_offset = 0; |
| 3314 | 3299 | } |
| 3315 | 3300 | break; |
| r3957 | r3958 | |
| 3324 | 3309 | else |
| 3325 | 3310 | { |
| 3326 | 3311 | verboselog( machine, 1, "%02x: gouraud 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3327 | GouraudPolygon( 4 ); | |
| 3312 | GouraudPolygon( machine, 4 ); | |
| 3328 | 3313 | m_n_gpu_buffer_offset = 0; |
| 3329 | 3314 | } |
| 3330 | 3315 | break; |
| r3957 | r3958 | |
| 3339 | 3324 | else |
| 3340 | 3325 | { |
| 3341 | 3326 | verboselog( machine, 1, "%02x: gouraud textured 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 ); |
| 3342 | GouraudTexturedPolygon( 4 ); | |
| 3327 | GouraudTexturedPolygon( machine, 4 ); | |
| 3343 | 3328 | m_n_gpu_buffer_offset = 0; |
| 3344 | 3329 | } |
| 3345 | 3330 | break; |
| r3957 | r3958 | |
| 3433 | 3418 | m_packet.n_entry[ 0 ] >> 24, |
| 3434 | 3419 | (INT16)( m_packet.n_entry[ 1 ] & 0xffff ), (INT16)( m_packet.n_entry[ 1 ] >> 16 ), |
| 3435 | 3420 | (INT16)( m_packet.n_entry[ 2 ] & 0xffff ), (INT16)( m_packet.n_entry[ 2 ] >> 16 ) ); |
| 3436 | FlatRectangle(); | |
| 3421 | FlatRectangle(machine); | |
| 3437 | 3422 | m_n_gpu_buffer_offset = 0; |
| 3438 | 3423 | } |
| 3439 | 3424 | break; |
| r3957 | r3958 | |
| 3452 | 3437 | (INT16)( m_packet.n_entry[ 1 ] & 0xffff ), (INT16)( m_packet.n_entry[ 1 ] >> 16 ), |
| 3453 | 3438 | m_packet.n_entry[ 3 ] & 0xffff, m_packet.n_entry[ 3 ] >> 16, |
| 3454 | 3439 | m_packet.n_entry[ 0 ], m_packet.n_entry[ 2 ] ); |
| 3455 | FlatTexturedRectangle(); | |
| 3440 | FlatTexturedRectangle(machine); | |
| 3456 | 3441 | m_n_gpu_buffer_offset = 0; |
| 3457 | 3442 | } |
| 3458 | 3443 | break; |
| r3957 | r3958 | |
| 3483 | 3468 | { |
| 3484 | 3469 | verboselog( machine, 1, "%02x: 16x16 rectangle %08x %08x\n", m_packet.n_entry[ 0 ] >> 24, |
| 3485 | 3470 | m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ] ); |
| 3486 | FlatRectangle8x8(); | |
| 3471 | FlatRectangle8x8(machine); | |
| 3487 | 3472 | m_n_gpu_buffer_offset = 0; |
| 3488 | 3473 | } |
| 3489 | 3474 | break; |
| r3957 | r3958 | |
| 3499 | 3484 | { |
| 3500 | 3485 | verboselog( machine, 1, "%02x: 8x8 sprite %08x %08x %08x\n", m_packet.n_entry[ 0 ] >> 24, |
| 3501 | 3486 | m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ], m_packet.n_entry[ 2 ] ); |
| 3502 | Sprite8x8(); | |
| 3487 | Sprite8x8(machine); | |
| 3503 | 3488 | m_n_gpu_buffer_offset = 0; |
| 3504 | 3489 | } |
| 3505 | 3490 | break; |
| r3957 | r3958 | |
| 3514 | 3499 | { |
| 3515 | 3500 | verboselog( machine, 1, "%02x: 16x16 rectangle %08x %08x\n", m_packet.n_entry[ 0 ] >> 24, |
| 3516 | 3501 | m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ] ); |
| 3517 | FlatRectangle16x16(); | |
| 3502 | FlatRectangle16x16(machine); | |
| 3518 | 3503 | m_n_gpu_buffer_offset = 0; |
| 3519 | 3504 | } |
| 3520 | 3505 | break; |
| r3957 | r3958 | |
| 3530 | 3515 | { |
| 3531 | 3516 | verboselog( machine, 1, "%02x: 16x16 sprite %08x %08x %08x\n", m_packet.n_entry[ 0 ] >> 24, |
| 3532 | 3517 | m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ], m_packet.n_entry[ 2 ] ); |
| 3533 | Sprite16x16(); | |
| 3518 | Sprite16x16(machine); | |
| 3534 | 3519 | m_n_gpu_buffer_offset = 0; |
| 3535 | 3520 | } |
| 3536 | 3521 | break; |
| r3957 | r3958 | |
| 3599 | 3584 | case 0xe1: |
| 3600 | 3585 | verboselog( machine, 1, "%02x: draw mode %06x\n", m_packet.n_entry[ 0 ] >> 24, |
| 3601 | 3586 | m_packet.n_entry[ 0 ] & 0xffffff ); |
| 3602 | decode_tpage( &psxgpu, m_packet.n_entry[ 0 ] & 0xffffff ); | |
| 3587 | decode_tpage( machine, &psxgpu, m_packet.n_entry[ 0 ] & 0xffffff ); | |
| 3603 | 3588 | break; |
| 3604 | 3589 | case 0xe2: |
| 3605 | 3590 | m_n_twy = ( ( ( m_packet.n_entry[ 0 ] >> 15 ) & 0x1f ) << 3 ); |
| r3957 | r3958 | |
| 3682 | 3667 | switch( offset ) |
| 3683 | 3668 | { |
| 3684 | 3669 | case 0x00: |
| 3685 | psx_gpu_write( &data, 1 ); | |
| 3670 | psx_gpu_write( machine, &data, 1 ); | |
| 3686 | 3671 | break; |
| 3687 | 3672 | case 0x01: |
| 3688 | 3673 | switch( data >> 24 ) |
| r3957 | r3958 | |
| 3841 | 3826 | } |
| 3842 | 3827 | |
| 3843 | 3828 | |
| 3844 | void psx_gpu_read( UINT32 *p_ram, INT32 n_size ) | |
| 3829 | void psx_gpu_read( running_machine *machine, UINT32 *p_ram, INT32 n_size ) | |
| 3845 | 3830 | { |
| 3846 | running_machine *machine = Machine; | |
| 3847 | ||
| 3848 | 3831 | while( n_size > 0 ) |
| 3849 | 3832 | { |
| 3850 | 3833 | if( ( m_n_gpustatus & ( 1L << 0x1b ) ) != 0 ) |
| r3957 | r3958 | |
| 3898 | 3881 | switch( offset ) |
| 3899 | 3882 | { |
| 3900 | 3883 | case 0x00: |
| 3901 | psx_gpu_read( &data, 1 ); | |
| 3884 | psx_gpu_read( space->machine, &data, 1 ); | |
| 3902 | 3885 | break; |
| 3903 | 3886 | case 0x01: |
| 3904 | 3887 | verboselog( space->machine, 1, "read GPU status (%08x)\n", m_n_gpustatus ); |
| r3957 | r3958 | |
|---|---|---|
| 194 | 194 | if (sx < -7) sx += 256; |
| 195 | 195 | sy = 240 - spriteram[offs+2]; |
| 196 | 196 | |
| 197 | if (flip_screen_get()) | |
| 197 | if (flip_screen_get(machine)) | |
| 198 | 198 | { |
| 199 | 199 | sx = 240 - sx; flipx = !flipx; |
| 200 | 200 | sy = 240 - sy; flipy = !flipy; if (sizey) sy+=16; |
| r3957 | r3958 | |
| 243 | 243 | if (metlclsh_scrollx[0] & 0x08) // background (if enabled) |
| 244 | 244 | { |
| 245 | 245 | /* The background seems to be always flipped along x */ |
| 246 | tilemap_set_flip(bg_tilemap, (flip_screen_get() ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX); | |
| 246 | tilemap_set_flip(bg_tilemap, (flip_screen_get(screen->machine) ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX); | |
| 247 | 247 | tilemap_set_scrollx(bg_tilemap, 0,metlclsh_scrollx[1] + ((metlclsh_scrollx[0]&0x02)<<7) ); |
| 248 | 248 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); |
| 249 | 249 | } |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | size_t goldstar_video_size; |
| 15 | 15 | UINT8 *goldstar_reel1_scroll, *goldstar_reel2_scroll, *goldstar_reel3_scroll; |
| 16 | 16 | |
| 17 | static bitmap_t *tmpbitmap4; | |
| 18 | 17 | static int bgcolor; |
| 19 | 18 | |
| 20 | 19 | |
| r3957 | r3958 | |
| 24 | 23 | Start the video hardware emulation. |
| 25 | 24 | |
| 26 | 25 | ***************************************************************************/ |
| 27 | static tilemap *reel1_tilemap; | |
| 26 | ||
| 27 | static tilemap *goldstar_fg_tilemap; | |
| 28 | ||
| 29 | ||
| 30 | WRITE8_HANDLER( goldstar_fg_vidram_w ) | |
| 31 | { | |
| 32 | videoram[offset] = data; | |
| 33 | tilemap_mark_tile_dirty(goldstar_fg_tilemap,offset); | |
| 34 | } | |
| 35 | ||
| 36 | WRITE8_HANDLER( goldstar_fg_atrram_w ) | |
| 37 | { | |
| 38 | colorram[offset] = data; | |
| 39 | tilemap_mark_tile_dirty(goldstar_fg_tilemap,offset); | |
| 40 | } | |
| 41 | ||
| 42 | static TILE_GET_INFO( get_goldstar_fg_tile_info ) | |
| 43 | { | |
| 44 | int code = videoram[tile_index]; | |
| 45 | int attr = colorram[tile_index]; | |
| 46 | ||
| 47 | SET_TILE_INFO( | |
| 48 | 0, | |
| 49 | code | (attr & 0xf0)<<4, | |
| 50 | attr&0x0f, | |
| 51 | 0); | |
| 52 | } | |
| 53 | ||
| 54 | // colour / high tile bits are swapped around | |
| 55 | static TILE_GET_INFO( get_cherrym_fg_tile_info ) | |
| 56 | { | |
| 57 | int code = videoram[tile_index]; | |
| 58 | int attr = colorram[tile_index]; | |
| 59 | ||
| 60 | SET_TILE_INFO( | |
| 61 | 0, | |
| 62 | code | (attr & 0x0f)<<8, | |
| 63 | (attr&0xf0)>>4, | |
| 64 | 0); | |
| 65 | } | |
| 66 | ||
| 67 | ||
| 68 | ||
| 69 | static tilemap *goldstar_reel1_tilemap; | |
| 28 | 70 | UINT8 *goldstar_reel1_ram; |
| 29 | 71 | |
| 30 | 72 | WRITE8_HANDLER( goldstar_reel1_ram_w ) |
| 31 | 73 | { |
| 32 | 74 | goldstar_reel1_ram[offset] = data; |
| 33 | tilemap_mark_tile_dirty(reel1_tilemap,offset); | |
| 75 | tilemap_mark_tile_dirty(goldstar_reel1_tilemap,offset); | |
| 34 | 76 | } |
| 35 | 77 | |
| 36 | static TILE_GET_INFO( get_reel1_tile_info ) | |
| 78 | static TILE_GET_INFO( get_goldstar_reel1_tile_info ) | |
| 37 | 79 | { |
| 38 | 80 | int code = goldstar_reel1_ram[tile_index]; |
| 39 | 81 | |
| r3957 | r3958 | |
| 45 | 87 | } |
| 46 | 88 | |
| 47 | 89 | |
| 48 | static tilemap *reel2_tilemap; | |
| 90 | static tilemap *goldstar_reel2_tilemap; | |
| 49 | 91 | UINT8 *goldstar_reel2_ram; |
| 50 | 92 | |
| 51 | 93 | WRITE8_HANDLER( goldstar_reel2_ram_w ) |
| 52 | 94 | { |
| 53 | 95 | goldstar_reel2_ram[offset] = data; |
| 54 | tilemap_mark_tile_dirty(reel2_tilemap,offset); | |
| 96 | tilemap_mark_tile_dirty(goldstar_reel2_tilemap,offset); | |
| 55 | 97 | } |
| 56 | 98 | |
| 57 | static TILE_GET_INFO( get_reel2_tile_info ) | |
| 99 | static TILE_GET_INFO( get_goldstar_reel2_tile_info ) | |
| 58 | 100 | { |
| 59 | 101 | int code = goldstar_reel2_ram[tile_index]; |
| 60 | 102 | |
| r3957 | r3958 | |
| 65 | 107 | 0); |
| 66 | 108 | } |
| 67 | 109 | |
| 68 | static tilemap *reel3_tilemap; | |
| 110 | static tilemap *goldstar_reel3_tilemap; | |
| 69 | 111 | UINT8 *goldstar_reel3_ram; |
| 70 | 112 | |
| 71 | 113 | WRITE8_HANDLER( goldstar_reel3_ram_w ) |
| 72 | 114 | { |
| 73 | 115 | goldstar_reel3_ram[offset] = data; |
| 74 | tilemap_mark_tile_dirty(reel3_tilemap,offset); | |
| 116 | tilemap_mark_tile_dirty(goldstar_reel3_tilemap,offset); | |
| 75 | 117 | } |
| 76 | 118 | |
| 77 | static TILE_GET_INFO( get_reel3_tile_info ) | |
| 119 | static TILE_GET_INFO( get_goldstar_reel3_tile_info ) | |
| 78 | 120 | { |
| 79 | 121 | int code = goldstar_reel3_ram[tile_index]; |
| 80 | 122 | |
| r3957 | r3958 | |
| 89 | 131 | |
| 90 | 132 | VIDEO_START( goldstar ) |
| 91 | 133 | { |
| 92 | tmpbitmap4 = video_screen_auto_bitmap_alloc(machine->primary_screen); | |
| 134 | goldstar_reel1_tilemap = tilemap_create(machine,get_goldstar_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 135 | goldstar_reel2_tilemap = tilemap_create(machine,get_goldstar_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 136 | goldstar_reel3_tilemap = tilemap_create(machine,get_goldstar_reel3_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 93 | 137 | |
| 94 | reel1_tilemap = tilemap_create(machine,get_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 95 | reel2_tilemap = tilemap_create(machine,get_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 96 | reel3_tilemap = tilemap_create(machine,get_reel3_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 138 | tilemap_set_scroll_cols(goldstar_reel1_tilemap, 64); | |
| 139 | tilemap_set_scroll_cols(goldstar_reel2_tilemap, 64); | |
| 140 | tilemap_set_scroll_cols(goldstar_reel3_tilemap, 64); | |
| 97 | 141 | |
| 98 | tilemap_set_scroll_cols(reel1_tilemap, 64); | |
| 99 | tilemap_set_scroll_cols(reel2_tilemap, 64); | |
| 100 | tilemap_set_scroll_cols(reel3_tilemap, 64); | |
| 142 | goldstar_fg_tilemap = tilemap_create(machine,get_goldstar_fg_tile_info,tilemap_scan_rows,8,8, 64, 32); | |
| 143 | tilemap_set_transparent_pen(goldstar_fg_tilemap,0); | |
| 144 | } | |
| 101 | 145 | |
| 146 | VIDEO_START( cherrym ) | |
| 147 | { | |
| 148 | goldstar_reel1_tilemap = tilemap_create(machine,get_goldstar_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 149 | goldstar_reel2_tilemap = tilemap_create(machine,get_goldstar_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 150 | goldstar_reel3_tilemap = tilemap_create(machine,get_goldstar_reel3_tile_info,tilemap_scan_rows,8,32, 64, 8); | |
| 151 | ||
| 152 | tilemap_set_scroll_cols(goldstar_reel1_tilemap, 64); | |
| 153 | tilemap_set_scroll_cols(goldstar_reel2_tilemap, 64); | |
| 154 | tilemap_set_scroll_cols(goldstar_reel3_tilemap, 64); | |
| 155 | ||
| 156 | goldstar_fg_tilemap = tilemap_create(machine,get_cherrym_fg_tile_info,tilemap_scan_rows,8,8, 64, 32); | |
| 157 | tilemap_set_transparent_pen(goldstar_fg_tilemap,0); | |
| 102 | 158 | } |
| 103 | 159 | |
| 104 | 160 | |
| 105 | 161 | |
| 106 | ||
| 107 | 162 | WRITE8_HANDLER( goldstar_fa00_w ) |
| 108 | 163 | { |
| 109 | 164 | /* bit 1 toggles continuously - might be irq enable or watchdog reset */ |
| r3957 | r3958 | |
| 114 | 169 | |
| 115 | 170 | |
| 116 | 171 | // are these hardcoded, or registers? |
| 117 | static const rectangle visible1 = { 14*8, (14+48)*8-1, 4*8, (4+7)*8-1 }; | |
| 118 | static const rectangle visible2 = { 14*8, (14+48)*8-1, 12*8, (12+7)*8-1 }; | |
| 119 | static const rectangle visible3 = { 14*8, (14+48)*8-1, 20*8, (20+7)*8-1 }; | |
| 172 | static const rectangle visible1 = { 0*8, (14+48)*8-1, 4*8, (4+7)*8-1 }; | |
| 173 | static const rectangle visible2 = { 0*8, (14+48)*8-1, 12*8, (12+7)*8-1 }; | |
| 174 | static const rectangle visible3 = { 0*8, (14+48)*8-1, 20*8, (20+7)*8-1 }; | |
| 120 | 175 | |
| 121 | 176 | |
| 122 | 177 | VIDEO_UPDATE( goldstar ) |
| 123 | 178 | { |
| 124 | int offs; | |
| 125 | 179 | int i; |
| 126 | 180 | |
| 127 | 181 | bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); |
| 128 | 182 | |
| 129 | 183 | for (i= 0;i < 64;i++) |
| 130 | 184 | { |
| 131 | tilemap_set_scrolly(reel1_tilemap, i, goldstar_reel1_scroll[i]); | |
| 132 | tilemap_set_scrolly(reel2_tilemap, i, goldstar_reel2_scroll[i]); | |
| 133 | tilemap_set_scrolly(reel3_tilemap, i, goldstar_reel3_scroll[i]); | |
| 185 | tilemap_set_scrolly(goldstar_reel1_tilemap, i, goldstar_reel1_scroll[i]); | |
| 186 | tilemap_set_scrolly(goldstar_reel2_tilemap, i, goldstar_reel2_scroll[i]); | |
| 187 | tilemap_set_scrolly(goldstar_reel3_tilemap, i, goldstar_reel3_scroll[i]); | |
| 134 | 188 | } |
| 135 | 189 | |
| 136 | tilemap_draw(bitmap,&visible1,reel1_tilemap,0,0); | |
| 137 | tilemap_draw(bitmap,&visible2,reel2_tilemap,0,0); | |
| 138 | tilemap_draw(bitmap,&visible3,reel3_tilemap,0,0); | |
| 190 | tilemap_draw(bitmap,&visible1,goldstar_reel1_tilemap,0,0); | |
| 191 | tilemap_draw(bitmap,&visible2,goldstar_reel2_tilemap,0,0); | |
| 192 | tilemap_draw(bitmap,&visible3,goldstar_reel3_tilemap,0,0); | |
| 139 | 193 | |
| 194 | tilemap_draw(bitmap,cliprect,goldstar_fg_tilemap,0,0); | |
| 140 | 195 | |
| 141 | ||
| 142 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 143 | { | |
| 144 | int sx,sy; | |
| 145 | ||
| 146 | ||
| 147 | sx = offs % 64; | |
| 148 | sy = offs / 64; | |
| 149 | ||
| 150 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 151 | videoram[offs] + ((colorram[offs] & 0xf0) << 4), | |
| 152 | colorram[offs] & 0x0f, | |
| 153 | 0,0, | |
| 154 | 8*sx,8*sy, | |
| 155 | 0,TRANSPARENCY_PEN,0); | |
| 156 | } | |
| 157 | ||
| 158 | 196 | return 0; |
| 159 | 197 | } |
| 160 | ||
| 161 | ||
| 162 | VIDEO_UPDATE( cherrym ) | |
| 163 | { | |
| 164 | int offs; | |
| 165 | int i; | |
| 166 | ||
| 167 | bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); | |
| 168 | ||
| 169 | for (i= 0;i < 64;i++) | |
| 170 | { | |
| 171 | tilemap_set_scrolly(reel1_tilemap, i, goldstar_reel1_scroll[i]); | |
| 172 | tilemap_set_scrolly(reel2_tilemap, i, goldstar_reel2_scroll[i]); | |
| 173 | tilemap_set_scrolly(reel3_tilemap, i, goldstar_reel3_scroll[i]); | |
| 174 | } | |
| 175 | ||
| 176 | tilemap_draw(bitmap,&visible1,reel1_tilemap,0,0); | |
| 177 | tilemap_draw(bitmap,&visible2,reel2_tilemap,0,0); | |
| 178 | tilemap_draw(bitmap,&visible3,reel3_tilemap,0,0); | |
| 179 | ||
| 180 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 181 | { | |
| 182 | int sx,sy; | |
| 183 | ||
| 184 | ||
| 185 | sx = offs % 64; | |
| 186 | sy = offs / 64; | |
| 187 | ||
| 188 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 189 | videoram[offs] + ((colorram[offs] & 0x0f) << 8), | |
| 190 | (colorram[offs] & 0xf0)>>4, | |
| 191 | 0,0, | |
| 192 | 8*sx,8*sy, | |
| 193 | 0,TRANSPARENCY_PEN,0); | |
| 194 | } | |
| 195 | ||
| 196 | return 0; | |
| 197 | } |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | case 0x23: invert_controls = data ? 0x00ff : 0x0000; break; |
| 57 | 57 | case 0x28: coin_counter_w(0, data & 1); break; |
| 58 | 58 | case 0x29: coin_counter_w(1, data & 1); break; |
| 59 | case 0x30: flip_screen_set(data & 0x01); break; | |
| 59 | case 0x30: flip_screen_set(space->machine, data & 0x01); break; | |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| r3957 | r3958 | |
| 127 | 127 | |
| 128 | 128 | if (sx & 0x200) sx = -(0xff - (sx & 0xff)); // wraparound |
| 129 | 129 | |
| 130 | if (flip_screen_get()) | |
| 130 | if (flip_screen_get(machine)) | |
| 131 | 131 | { |
| 132 | 132 | sx = 240 - sx; |
| 133 | 133 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 130 | 130 | } while (0) |
| 131 | 131 | #endif |
| 132 | 132 | |
| 133 | static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags) | |
| 133 | static void FUNCNAME(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags) | |
| 134 | 134 | { |
| 135 | 135 | UINT32 a1_base = blitter_regs[A1_BASE]; |
| 136 | 136 | INT32 a1_pitch = (A1FIXED & 3) ^ ((A1FIXED & 2) >> 1); |
| r3957 | r3958 | |
| 165 | 165 | UINT8 a1_phrase_mode = 0; |
| 166 | 166 | UINT8 a2_phrase_mode = 0; |
| 167 | 167 | |
| 168 | void *a1_base_mem = get_jaguar_memory(a1_base); | |
| 169 | void *a2_base_mem = get_jaguar_memory(a2_base); | |
| 168 | void *a1_base_mem = get_jaguar_memory(machine, a1_base); | |
| 169 | void *a2_base_mem = get_jaguar_memory(machine, a2_base); | |
| 170 | 170 | |
| 171 | 171 | void *asrc_base_mem = (COMMAND & 0x00000800) ? a1_base_mem : a2_base_mem; |
| 172 | 172 | UINT32 asrcflags = (COMMAND & 0x00000800) ? A1FIXED : A2FIXED; |
| r3957 | r3958 | |
| 195 | 195 | { |
| 196 | 196 | if (LOG_BAD_BLITS) |
| 197 | 197 | { |
| 198 | logerror("%s:Blit!\n", cpuexec_describe_context( | |
| 198 | logerror("%s:Blit!\n", cpuexec_describe_context(machine)); | |
| 199 | 199 | logerror(" a1_base = %08X\n", a1_base); |
| 200 | 200 | logerror(" a2_base = %08X\n", a2_base); |
| 201 | 201 | } |
| r3957 | r3958 | |
| 275 | 275 | |
| 276 | 276 | if (LOG_BLITS) |
| 277 | 277 | { |
| 278 | logerror("%s:Blit!\n", cpuexec_describe_context( | |
| 278 | logerror("%s:Blit!\n", cpuexec_describe_context(machine)); | |
| 279 | 279 | logerror(" a1_base = %08X\n", a1_base); |
| 280 | 280 | logerror(" a1_pitch = %d\n", a1_pitch); |
| 281 | 281 | logerror(" a1_psize = %d\n", 1 << ((A1FIXED >> 3) & 7)); |
| r3957 | r3958 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | number &= ~(chain - 1); |
| 156 | 156 | |
| 157 | if (flip_screen_get()) | |
| 157 | if (flip_screen_get(machine)) | |
| 158 | 158 | { |
| 159 | 159 | flipy = !flipy; |
| 160 | 160 | flipx = !flipx; |
| r3957 | r3958 | |
| 164 | 164 | |
| 165 | 165 | for (count=0;count<chain;count++) |
| 166 | 166 | { |
| 167 | if (flip_screen_get()) | |
| 167 | if (flip_screen_get(machine)) | |
| 168 | 168 | { |
| 169 | 169 | if (!flipy) |
| 170 | 170 | { |
| r3957 | r3958 | |
|---|---|---|
| 724 | 724 | return 0; |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | static void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size) | |
| 727 | static void push_object(running_machine *machine, UINT32 tex_adr, UINT32 poly_adr, UINT32 size) | |
| 728 | 728 | { |
| 729 | 729 | int i; |
| 730 | 730 | UINT32 flags; |
| r3957 | r3958 | |
| 889 | 889 | { |
| 890 | 890 | /*float dif=mult_vector(&vn, &view.light); |
| 891 | 891 | float ln=lightparams[lightmode].a + lightparams[lightmode].d*MAX(0.0,dif); |
| 892 | cquad.col = scale_color(Machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln)); | |
| 893 | cquad.col = scale_color(Machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln)); | |
| 892 | cquad.col = scale_color(machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln)); | |
| 893 | cquad.col = scale_color(machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln)); | |
| 894 | 894 | */ |
| 895 | 895 | float dif=mult_vector(&vn, &view.light); |
| 896 | 896 | float spec=compute_specular(&vn,&view.light,dif,lightmode); |
| r3957 | r3958 | |
| 1065 | 1065 | b=(model1_color_xlat[(b<<8)|lumval|0x4000]>>3)&0x1f; |
| 1066 | 1066 | cquad.col=(r<<10)|(g<<5)|(b<<0); |
| 1067 | 1067 | } |
| 1068 | //cquad.col = scale_color( | |
| 1068 | //cquad.col = scale_color(machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)],((float) (lum>>24)) / 128.0); | |
| 1069 | 1069 | if(flags & 0x00002000) |
| 1070 | 1070 | cquad.col |= MOIRE; |
| 1071 | 1071 | |
| r3957 | r3958 | |
| 1173 | 1173 | LOG_TGP(("VIDEO: control=%08x\n", (listctl[1]<<16)|listctl[0])); |
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | static void tgp_render(bitmap_t *bitmap, const rectangle *cliprect) | |
| 1176 | static void tgp_render(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 1177 | 1177 | { |
| 1178 | 1178 | render_done = 1; |
| 1179 | 1179 | if((listctl[1] & 0x1f) == 0x1f) { |
| r3957 | r3958 | |
| 1202 | 1202 | // 6 = ?? draw object (57bd4, 387460, 2ad) |
| 1203 | 1203 | |
| 1204 | 1204 | if(1 || zz >= 666) |
| 1205 | push_object(readi(list+2), readi(list+4), readi(list+6)); | |
| 1205 | push_object(machine, readi(list+2), readi(list+4), readi(list+6)); | |
| 1206 | 1206 | list += 8; |
| 1207 | 1207 | break; |
| 1208 | 1208 | case 2: |
| r3957 | r3958 | |
| 1515 | 1515 | sys24_tile_draw(screen->machine, bitmap, cliprect, 2, 0, 0); |
| 1516 | 1516 | sys24_tile_draw(screen->machine, bitmap, cliprect, 0, 0, 0); |
| 1517 | 1517 | |
| 1518 | tgp_render(bitmap, cliprect); | |
| 1518 | tgp_render(screen->machine, bitmap, cliprect); | |
| 1519 | 1519 | |
| 1520 | 1520 | sys24_tile_draw(screen->machine, bitmap, cliprect, 7, 0, 0); |
| 1521 | 1521 | sys24_tile_draw(screen->machine, bitmap, cliprect, 5, 0, 0); |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | if (attr & 0x01) sx = sx - 256; |
| 139 | 139 | if (sy > 0xf0) sy = sy - 256; |
| 140 | 140 | |
| 141 | if (flip_screen_get()) | |
| 141 | if (flip_screen_get(machine)) | |
| 142 | 142 | { |
| 143 | 143 | sx = 240 - sx; |
| 144 | 144 | sy = 240 - sy; |
| r3957 | r3958 | |
| 151 | 151 | int spritenum = sn1*4 + ((sn2 & (8+4)) >> 2) + ((sn2 & (2+1)) << 10); |
| 152 | 152 | int mod = -8; |
| 153 | 153 | |
| 154 | if (flip_screen_get()) | |
| 154 | if (flip_screen_get(machine)) | |
| 155 | 155 | { |
| 156 | 156 | sx += 8; |
| 157 | 157 | sy -= 8; |
| r3957 | r3958 | |
| 160 | 160 | |
| 161 | 161 | if ((attr & 0x0C) == 0x0C) |
| 162 | 162 | { |
| 163 | if (flip_screen_get()) sy += 16; | |
| 163 | if (flip_screen_get(machine)) sy += 16; | |
| 164 | 164 | DRAW_SPRITE(bank + 1, spritenum, sx, sy) |
| 165 | 165 | } |
| 166 | 166 | |
| r3957 | r3958 | |
| 183 | 183 | |
| 184 | 184 | if (attr & 0x10) |
| 185 | 185 | { |
| 186 | if (flip_screen_get()) | |
| 186 | if (flip_screen_get(machine)) | |
| 187 | 187 | { |
| 188 | 188 | sx -= 16; |
| 189 | 189 | sy -= 16; |
| r3957 | r3958 | |
|---|---|---|
| 577 | 577 | /* Note: various assumptions are made in these routines, typically that |
| 578 | 578 | only CPU#0 is of interest. If in doubt, check the routine. */ |
| 579 | 579 | |
| 580 | static int has_write_handler( | |
| 580 | static int has_write_handler(const devi | |
| 581 | 581 | { |
| 582 | const device_config *cpu = machine->cpu[cpunum]; | |
| 583 | 582 | if (cpu != NULL) |
| 584 | 583 | { |
| 585 | 584 | const address_space *space = cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM); |
| r3957 | r3958 | |
| 596 | 595 | |
| 597 | 596 | int TC0100SCN_count(running_machine *machine) |
| 598 | 597 | { |
| 599 | int mask = (has_write_handler(machine, 0, TC0100SCN_word_0_w) || | |
| 600 | has_write_handler(machine, 0, TC0100SCN_dual_screen_w) || | |
| 601 | has_write_handler(machine, 0, TC0100SCN_triple_screen_w)) ? 1 : 0; | |
| 602 | mask |= has_write_handler(machine, 0, TC0100SCN_word_1_w) << 1; | |
| 603 | mask |= has_write_handler(machine, 0, TC0100SCN_word_2_w) << 2; | |
| 598 | int mask = (has_write_handler(machine->cpu[0], TC0100SCN_word_0_w) || | |
| 599 | has_write_handler(machine->cpu[0], TC0100SCN_dual_screen_w) || | |
| 600 | has_write_handler(machine->cpu[0], TC0100SCN_triple_screen_w)) ? 1 : 0; | |
| 601 | mask |= has_write_handler(machine->cpu[0], TC0100SCN_word_1_w) << 1; | |
| 602 | mask |= has_write_handler(machine->cpu[0], TC0100SCN_word_2_w) << 2; | |
| 604 | 603 | |
| 605 | 604 | /* Catch illegal configurations */ |
| 606 | 605 | /* TODO: we should give an appropriate warning */ |
| r3957 | r3958 | |
| 611 | 610 | |
| 612 | 611 | int TC0110PCR_mask(running_machine *machine) |
| 613 | 612 | { |
| 614 | int mask = (has_write_handler(machine, 0, TC0110PCR_word_w) || | |
| 615 | has_write_handler(machine, 0, TC0110PCR_step1_word_w) || | |
| 616 | has_write_handler(machine, 0, TC0110PCR_step1_rbswap_word_w) || | |
| 617 | has_write_handler(machine, 0, TC0110PCR_step1_4bpg_word_w)) ? 1 : 0; | |
| 618 | mask |= has_write_handler(machine, 0, TC0110PCR_step1_word_1_w) << 1; | |
| 619 | mask |= has_write_handler(machine, 0, TC0110PCR_step1_word_2_w) << 2; | |
| 613 | int mask = (has_write_handler(machine->cpu[0], TC0110PCR_word_w) || | |
| 614 | has_write_handler(machine->cpu[0], TC0110PCR_step1_word_w) || | |
| 615 | has_write_handler(machine->cpu[0], TC0110PCR_step1_rbswap_word_w) || | |
| 616 | has_write_handler(machine->cpu[0], TC0110PCR_step1_4bpg_word_w)) ? 1 : 0; | |
| 617 | mask |= has_write_handler(machine->cpu[0], TC0110PCR_step1_word_1_w) << 1; | |
| 618 | mask |= has_write_handler(machine->cpu[0], TC0110PCR_step1_word_2_w) << 2; | |
| 620 | 619 | return mask; |
| 621 | 620 | } |
| 622 | 621 | |
| 623 | 622 | int has_TC0150ROD(running_machine *machine) |
| 624 | 623 | { |
| 625 | return has_write_handler(machine, 0, TC0150ROD_word_w) || | |
| 626 | has_write_handler(machine, 1, TC0150ROD_word_w) || | |
| 627 | has_write_handler(machine, 2, TC0150ROD_word_w); | |
| 624 | return has_write_handler(machine->cpu[0], TC0150ROD_word_w) || | |
| 625 | has_write_handler(machine->cpu[1], TC0150ROD_word_w) || | |
| 626 | has_write_handler(machine->cpu[2], TC0150ROD_word_w); | |
| 628 | 627 | } |
| 629 | 628 | |
| 630 | 629 | |
| 631 | 630 | int has_TC0280GRD(running_machine *machine) |
| 632 | 631 | { |
| 633 | return has_write_handler(machine | |
| 632 | return has_write_handler(machine->cpu[0], TC0280GRD_word_w); | |
| 634 | 633 | } |
| 635 | 634 | |
| 636 | 635 | |
| 637 | 636 | int has_TC0360PRI(running_machine *machine) |
| 638 | 637 | { |
| 639 | return has_write_handler(machine, 0, TC0360PRI_halfword_w) || | |
| 640 | has_write_handler(machine, 0, TC0360PRI_halfword_swap_w); | |
| 638 | return has_write_handler(machine->cpu[0], TC0360PRI_halfword_w) || | |
| 639 | has_write_handler(machine->cpu[0], TC0360PRI_halfword_swap_w); | |
| 641 | 640 | } |
| 642 | 641 | |
| 643 | 642 | |
| 644 | 643 | int has_TC0430GRW(running_machine *machine) |
| 645 | 644 | { |
| 646 | return has_write_handler(machine | |
| 645 | return has_write_handler(machine->cpu[0], TC0430GRW_word_w); | |
| 647 | 646 | } |
| 648 | 647 | |
| 649 | 648 | |
| 650 | 649 | int has_TC0480SCP(running_machine *machine) |
| 651 | 650 | { |
| 652 | return has_write_handler(machine | |
| 651 | return has_write_handler(machine->cpu[0], TC0480SCP_word_w); | |
| 653 | 652 | } |
| 654 | 653 | |
| 655 | 654 |
| r3957 | r3958 | |
|---|---|---|
| 300 | 300 | sx += sprite_xoffs; |
| 301 | 301 | sy -= sprite_yoffs; |
| 302 | 302 | |
| 303 | if (flip_screen_get()) | |
| 303 | if (flip_screen_get(machine)) | |
| 304 | 304 | { |
| 305 | 305 | sx = -sx - sizex; |
| 306 | 306 | sy = -sy - sizey; |
| r3957 | r3958 | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
| 331 | static void set_scroll(int layer) | |
| 331 | static void set_scroll(running_machine *machine, int layer) | |
| 332 | 332 | { |
| 333 | 333 | static const int xdisp[4] = { 47, 49, 46, 48 }; |
| 334 | 334 | int scrollx,scrolly; |
| 335 | 335 | |
| 336 | 336 | scrollx = xscroll[layer] - xdisp[layer]; |
| 337 | 337 | scrolly = yscroll[layer] + 9; |
| 338 | if (flip_screen_get()) | |
| 338 | if (flip_screen_get(machine)) | |
| 339 | 339 | { |
| 340 | 340 | scrollx = -scrollx; |
| 341 | 341 | scrolly = -scrolly; |
| r3957 | r3958 | |
| 350 | 350 | int layer; |
| 351 | 351 | |
| 352 | 352 | /* flip screen is embedded in the sprite control registers */ |
| 353 | /* can't use flip_screen_set() because the visible area is asymmetrical */ | |
| 354 | flip_screen_set_no_update(spriteram[0x07f6] & 1); | |
| 355 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 356 | set_scroll(0); | |
| 357 | set_scroll(1); | |
| 358 | set_scroll(2); | |
| 359 | set_scroll(3); | |
| 353 | /* can't use flip_screen_set(screen->machine, ) because the visible area is asymmetrical */ | |
| 354 | flip_screen_set_no_update(screen->machine, spriteram[0x07f6] & 1); | |
| 355 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 356 | set_scroll(screen->machine, 0); | |
| 357 | set_scroll(screen->machine, 1); | |
| 358 | set_scroll(screen->machine, 2); | |
| 359 | set_scroll(screen->machine, 3); | |
| 360 | 360 | |
| 361 | 361 | bitmap_fill(priority_bitmap, cliprect, 0); |
| 362 | 362 |
| r3957 | r3958 | |
|---|---|---|
| 318 | 318 | if (flipx) tile_flipx = !tile_flipx; |
| 319 | 319 | if (flipy) tile_flipy = !tile_flipy; |
| 320 | 320 | |
| 321 | if (flip_screen_get()) | |
| 321 | if (flip_screen_get(machine)) | |
| 322 | 322 | { sx = max_x - sx; tile_flipx = !tile_flipx; |
| 323 | 323 | sy = max_y - sy; tile_flipy = !tile_flipy; } |
| 324 | 324 | |
| r3957 | r3958 | |
| 383 | 383 | int sx = x + tx * 8; |
| 384 | 384 | int sy = (y + real_ty * 8) & 0xff; |
| 385 | 385 | |
| 386 | if (flip_screen_get()) | |
| 386 | if (flip_screen_get(machine)) | |
| 387 | 387 | { sx = max_x - sx; flipx = !flipx; |
| 388 | 388 | sy = max_y - sy; flipy = !flipy; } |
| 389 | 389 |
| r3957 | r3958 | |
|---|---|---|
| 121 | 121 | inc = 1; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | if (flip_screen_get()) | |
| 124 | if (flip_screen_get(machine)) | |
| 125 | 125 | { |
| 126 | 126 | y=240-y; |
| 127 | 127 | x=240-x; |
| r3957 | r3958 | |
| 150 | 150 | { |
| 151 | 151 | int pri=vaportra_priority[0] & 0x03; |
| 152 | 152 | |
| 153 | flip_screen_set( !(deco16_pf12_control[0]&0x80) ); | |
| 153 | flip_screen_set(screen->machine, !(deco16_pf12_control[0]&0x80) ); | |
| 154 | 154 | |
| 155 | 155 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 156 | 156 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| r3957 | r3958 | |
|---|---|---|
| 268 | 268 | // Bit 7 = Flip Screen |
| 269 | 269 | |
| 270 | 270 | btime_palette = (data & 0x30) >> 3; |
| 271 | flip_screen_set(data & 0x80); | |
| 271 | flip_screen_set(space->machine, data & 0x80); | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | WRITE8_HANDLER( btime_video_control_w ) |
| r3957 | r3958 | |
| 278 | 278 | // Bit 0 = Flip screen |
| 279 | 279 | // Bit 1-7 = Unknown |
| 280 | 280 | |
| 281 | flip_screen_set(data & 0x01); | |
| 281 | flip_screen_set(space->machine, data & 0x01); | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | WRITE8_HANDLER( bnj_video_control_w ) |
| r3957 | r3958 | |
| 312 | 312 | |
| 313 | 313 | if (!(input_port_read(space->machine, "DSW1") & 0x40)) /* cocktail mode */ |
| 314 | 314 | { |
| 315 | flip_screen_set(data & 0x01); | |
| 315 | flip_screen_set(space->machine, data & 0x01); | |
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
| r3957 | r3958 | |
| 338 | 338 | /* check priority */ |
| 339 | 339 | if ((priority != -1) && (priority != ((code >> 7) & 0x01))) continue; |
| 340 | 340 | |
| 341 | if (flip_screen_get()) | |
| 341 | if (flip_screen_get(machine)) | |
| 342 | 342 | { |
| 343 | 343 | x = 31 - x; |
| 344 | 344 | y = 31 - y; |
| r3957 | r3958 | |
| 347 | 347 | drawgfx(bitmap,machine->gfx[0], |
| 348 | 348 | code, |
| 349 | 349 | color, |
| 350 | flip_screen_get(),flip_screen_get(), | |
| 350 | flip_screen_get(machine),flip_screen_get(machine), | |
| 351 | 351 | 8*x,8*y, |
| 352 | 352 | cliprect,transparency,0); |
| 353 | 353 | } |
| r3957 | r3958 | |
| 374 | 374 | flipx = sprite_ram[offs + 0] & 0x04; |
| 375 | 375 | flipy = sprite_ram[offs + 0] & 0x02; |
| 376 | 376 | |
| 377 | if (flip_screen_get()) | |
| 377 | if (flip_screen_get(machine)) | |
| 378 | 378 | { |
| 379 | 379 | x = 240 - x; |
| 380 | 380 | y = 240 - y + sprite_y_adjust_flip_screen; |
| r3957 | r3958 | |
| 392 | 392 | x, y, |
| 393 | 393 | cliprect,TRANSPARENCY_PEN,0); |
| 394 | 394 | |
| 395 | y = y + (flip_screen_get() ? -256 : 256); | |
| 395 | y = y + (flip_screen_get(machine) ? -256 : 256); | |
| 396 | 396 | |
| 397 | 397 | // Wrap around |
| 398 | 398 | drawgfx(bitmap,machine->gfx[1], |
| r3957 | r3958 | |
| 426 | 426 | int x = 240 - (16 * (offs / 16) + scroll); |
| 427 | 427 | int y = 16 * (offs % 16); |
| 428 | 428 | |
| 429 | if (flip_screen_get()) | |
| 429 | if (flip_screen_get(machine)) | |
| 430 | 430 | { |
| 431 | 431 | x = 240 - x; |
| 432 | 432 | y = 240 - y; |
| r3957 | r3958 | |
| 435 | 435 | drawgfx(bitmap, machine->gfx[2], |
| 436 | 436 | gfx[tileoffset + offs], |
| 437 | 437 | color, |
| 438 | flip_screen_get(),flip_screen_get(), | |
| 438 | flip_screen_get(machine),flip_screen_get(machine), | |
| 439 | 439 | x,y, |
| 440 | 440 | cliprect,TRANSPARENCY_NONE,0); |
| 441 | 441 | } |
| r3957 | r3958 | |
| 489 | 489 | // Generate tile map |
| 490 | 490 | static UINT8 btime_tilemap[4]; |
| 491 | 491 | |
| 492 | if (flip_screen_get()) | |
| 492 | if (flip_screen_get(screen->machine)) | |
| 493 | 493 | start = 0; |
| 494 | 494 | else |
| 495 | 495 | start = 1; |
| r3957 | r3958 | |
| 562 | 562 | sy = 16 * (((offs % 0x100) < 0x80) ? offs % 8 : (offs % 8) + 8); |
| 563 | 563 | sx = 496 - sx; |
| 564 | 564 | |
| 565 | if (flip_screen_get()) | |
| 565 | if (flip_screen_get(screen->machine)) | |
| 566 | 566 | { |
| 567 | 567 | sx = 496 - sx; |
| 568 | 568 | sy = 240 - sy; |
| r3957 | r3958 | |
| 571 | 571 | drawgfx(background_bitmap, screen->machine->gfx[2], |
| 572 | 572 | (bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32, |
| 573 | 573 | 0, |
| 574 | flip_screen_get(), flip_screen_get(), | |
| 574 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), | |
| 575 | 575 | sx, sy, |
| 576 | 576 | 0, TRANSPARENCY_NONE, 0); |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | /* copy the background bitmap to the screen */ |
| 580 | 580 | scroll = (bnj_scroll1 & 0x02) * 128 + 511 - bnj_scroll2; |
| 581 | if (!flip_screen_get()) | |
| 581 | if (!flip_screen_get(screen->machine)) | |
| 582 | 582 | scroll = 767-scroll; |
| 583 | 583 | copyscrollbitmap(bitmap, background_bitmap, 1, &scroll, 0, 0, cliprect); |
| 584 | 584 | |
| r3957 | r3958 | |
| 609 | 609 | sx = 31 - (offs / 32); |
| 610 | 610 | sy = offs % 32; |
| 611 | 611 | |
| 612 | if (flip_screen_get()) | |
| 612 | if (flip_screen_get(screen->machine)) | |
| 613 | 613 | { |
| 614 | 614 | sx = 31 - sx; |
| 615 | 615 | sy = 31 - sy; |
| r3957 | r3958 | |
| 618 | 618 | drawgfx(bitmap, screen->machine->gfx[2], |
| 619 | 619 | bnj_backgroundram[offs], |
| 620 | 620 | 0, |
| 621 | flip_screen_get(), flip_screen_get(), | |
| 621 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), | |
| 622 | 622 | 8*sx,8*sy, |
| 623 | 623 | cliprect, TRANSPARENCY_NONE, 0); |
| 624 | 624 | } |
| r3957 | r3958 | |
|---|---|---|
| 241 | 241 | WRITE8_HANDLER( nova2001_flipscreen_w ) |
| 242 | 242 | { |
| 243 | 243 | // inverted |
| 244 | flip_screen_set(~data & 1); | |
| 244 | flip_screen_set(space->machine, ~data & 1); | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | WRITE8_HANDLER( pkunwar_flipscreen_w ) |
| 248 | 248 | { |
| 249 | flip_screen_set(data & 1); | |
| 249 | flip_screen_set(space->machine, data & 1); | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| r3957 | r3958 | |
| 277 | 277 | continue; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | if (flip_screen_get()) | |
| 280 | if (flip_screen_get(machine)) | |
| 281 | 281 | { |
| 282 | 282 | sx = 240 - sx; |
| 283 | 283 | sy = 240 - sy; |
| r3957 | r3958 | |
| 314 | 314 | continue; |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | if (flip_screen_get()) | |
| 317 | if (flip_screen_get(machine)) | |
| 318 | 318 | { |
| 319 | 319 | sx = 240 - sx; |
| 320 | 320 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 2210 | 2210 | { |
| 2211 | 2211 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 2212 | 2212 | { \ |
| 2213 | if (flip_screen_get()) \ | |
| 2213 | if (flip_screen_get(machine)) \ | |
| 2214 | 2214 | pdrawgfx(bitmap,machine->gfx[2], \ |
| 2215 | 2215 | CODE, \ |
| 2216 | 2216 | COLOR, \ |
| r3957 | r3958 | |
| 2446 | 2446 | { |
| 2447 | 2447 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 2448 | 2448 | { \ |
| 2449 | if (flip_screen_get()) \ | |
| 2449 | if (flip_screen_get(machine)) \ | |
| 2450 | 2450 | pdrawgfx(bitmap,machine->gfx[2], \ |
| 2451 | 2451 | CODE, \ |
| 2452 | 2452 | COLOR, \ |
| r3957 | r3958 | |
| 2613 | 2613 | int sy = (offs % 256); |
| 2614 | 2614 | sx = (sx - stars2x + (col & 0x1f)) & 0x1ff; |
| 2615 | 2615 | sy = (sy - stars2y) & 0xff; |
| 2616 | if (flip_screen_get()) | |
| 2616 | if (flip_screen_get(screen->machine)) | |
| 2617 | 2617 | { |
| 2618 | 2618 | sx = 511 - sx; |
| 2619 | 2619 | sy = 255 - sy; |
| r3957 | r3958 | |
| 2639 | 2639 | int sy = (offs % 256); |
| 2640 | 2640 | sx = (sx - stars1x + (col & 0x1f)) & 0x1ff; |
| 2641 | 2641 | sy = (sy - stars1y) & 0xff; |
| 2642 | if (flip_screen_get()) | |
| 2642 | if (flip_screen_get(screen->machine)) | |
| 2643 | 2643 | { |
| 2644 | 2644 | sx = 511 - sx; |
| 2645 | 2645 | sy = 255 - sy; |
| r3957 | r3958 | |
| 2699 | 2699 | int videocontrol = cps1_cps_a_regs[CPS1_VIDEOCONTROL]; |
| 2700 | 2700 | |
| 2701 | 2701 | |
| 2702 | flip_screen_set(videocontrol & 0x8000); | |
| 2702 | flip_screen_set(screen->machine, videocontrol & 0x8000); | |
| 2703 | 2703 | |
| 2704 | 2704 | layercontrol = cps1_cps_b_regs[cps1_game_config->layer_control/2]; |
| 2705 | 2705 |
| r3957 | r3958 | |
|---|---|---|
| 176 | 176 | x += sprites_scrolldx; |
| 177 | 177 | y += sprites_scrolldy; |
| 178 | 178 | |
| 179 | if (flip_screen_get()) // not used? | |
| 179 | if (flip_screen_get(machine)) // not used? | |
| 180 | 180 | { |
| 181 | 181 | flipx = !flipx; x = max_x - x - 16; |
| 182 | 182 | flipy = !flipy; y = max_y - y - 16; |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | WRITE8_HANDLER( mermaid_flip_screen_x_w ) |
| 76 | 76 | { |
| 77 | flip_screen_x_set(data & 0x01); | |
| 77 | flip_screen_x_set(space->machine, data & 0x01); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | WRITE8_HANDLER( mermaid_flip_screen_y_w ) |
| 81 | 81 | { |
| 82 | flip_screen_y_set(data & 0x01); | |
| 82 | flip_screen_y_set(space->machine, data & 0x01); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | WRITE8_HANDLER( mermaid_bg_scroll_w ) |
| r3957 | r3958 | |
| 187 | 187 | code |= rougien_gfxbank1 * 0x2800; |
| 188 | 188 | code |= rougien_gfxbank2 * 0x2400; |
| 189 | 189 | |
| 190 | if (flip_screen_x_get()) | |
| 190 | if (flip_screen_x_get(machine)) | |
| 191 | 191 | { |
| 192 | 192 | flipx = !flipx; |
| 193 | 193 | sx = 240 - sx; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | if (flip_screen_y_get()) | |
| 196 | if (flip_screen_y_get(machine)) | |
| 197 | 197 | { |
| 198 | 198 | flipy = !flipy; |
| 199 | 199 | sy = 240 - sy; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy, |
| 203 | (flip_screen_x_get() ? &flip_spritevisiblearea : &spritevisiblearea), | |
| 203 | (flip_screen_x_get(machine) ? &flip_spritevisiblearea : &spritevisiblearea), | |
| 204 | 204 | TRANSPARENCY_PEN, 0); |
| 205 | 205 | } |
| 206 | 206 | } |
| r3957 | r3958 | |
| 266 | 266 | code |= rougien_gfxbank1 * 0x2800; |
| 267 | 267 | code |= rougien_gfxbank2 * 0x2400; |
| 268 | 268 | |
| 269 | if (flip_screen_x_get()) | |
| 269 | if (flip_screen_x_get(machine)) | |
| 270 | 270 | { |
| 271 | 271 | flipx = !flipx; |
| 272 | 272 | sx = 240 - sx; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | if (flip_screen_y_get()) | |
| 275 | if (flip_screen_y_get(machine)) | |
| 276 | 276 | { |
| 277 | 277 | flipy = !flipy; |
| 278 | 278 | sy = 240 - sy; |
| r3957 | r3958 | |
| 338 | 338 | code2 |= rougien_gfxbank1 * 0x2800; |
| 339 | 339 | code2 |= rougien_gfxbank2 * 0x2400; |
| 340 | 340 | |
| 341 | if (flip_screen_x_get()) | |
| 341 | if (flip_screen_x_get(machine)) | |
| 342 | 342 | { |
| 343 | 343 | flipx2 = !flipx2; |
| 344 | 344 | sx2 = 240 - sx2; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | if (flip_screen_y_get()) | |
| 347 | if (flip_screen_y_get(machine)) | |
| 348 | 348 | { |
| 349 | 349 | flipy2 = !flipy2; |
| 350 | 350 | sy2 = 240 - sy2; |
| r3957 | r3958 | |
| 380 | 380 | code |= rougien_gfxbank1 * 0x2800; |
| 381 | 381 | code |= rougien_gfxbank2 * 0x2400; |
| 382 | 382 | |
| 383 | if (flip_screen_x_get()) | |
| 383 | if (flip_screen_x_get(machine)) | |
| 384 | 384 | { |
| 385 | 385 | flipx = !flipx; |
| 386 | 386 | sx = 240 - sx; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | if (flip_screen_y_get()) | |
| 389 | if (flip_screen_y_get(machine)) | |
| 390 | 390 | { |
| 391 | 391 | flipy = !flipy; |
| 392 | 392 | sy = 240 - sy; |
| r3957 | r3958 | |
| 428 | 428 | code2 |= rougien_gfxbank1 * 0x2800; |
| 429 | 429 | code2 |= rougien_gfxbank2 * 0x2400; |
| 430 | 430 | |
| 431 | if (flip_screen_x_get()) | |
| 431 | if (flip_screen_x_get(machine)) | |
| 432 | 432 | { |
| 433 | 433 | flipx2 = !flipx2; |
| 434 | 434 | sx2 = 240 - sx2; |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | if (flip_screen_y_get()) | |
| 437 | if (flip_screen_y_get(machine)) | |
| 438 | 438 | { |
| 439 | 439 | flipy2 = !flipy2; |
| 440 | 440 | sy2 = 240 - sy2; |
| r3957 | r3958 | |
| 470 | 470 | code |= rougien_gfxbank1 * 0x2800; |
| 471 | 471 | code |= rougien_gfxbank2 * 0x2400; |
| 472 | 472 | |
| 473 | if (flip_screen_x_get()) | |
| 473 | if (flip_screen_x_get(machine)) | |
| 474 | 474 | { |
| 475 | 475 | flipx = !flipx; |
| 476 | 476 | sx = 240 - sx; |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | if (flip_screen_y_get()) | |
| 479 | if (flip_screen_y_get(machine)) | |
| 480 | 480 | { |
| 481 | 481 | flipy = !flipy; |
| 482 | 482 | sy = 240 - sy; |
| r3957 | r3958 | |
| 518 | 518 | code2 |= rougien_gfxbank1 * 0x2800; |
| 519 | 519 | code2 |= rougien_gfxbank2 * 0x2400; |
| 520 | 520 | |
| 521 | if (flip_screen_x_get()) | |
| 521 | if (flip_screen_x_get(machine)) | |
| 522 | 522 | { |
| 523 | 523 | flipx2 = !flipx2; |
| 524 | 524 | sx2 = 240 - sx2; |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | if (flip_screen_y_get()) | |
| 527 | if (flip_screen_y_get(machine)) | |
| 528 | 528 | { |
| 529 | 529 | flipy2 = !flipy2; |
| 530 | 530 | sy2 = 240 - sy2; |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | **************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "eminline.h" |
| 12 | 11 | #include "gaelco3d.h" |
| 13 | 12 | #include "cpu/tms32031/tms32031.h" |
| r3957 | r3958 | |
| 77 | 76 | { |
| 78 | 77 | int width, height; |
| 79 | 78 | |
| 80 | poly = poly_alloc(2000, sizeof(poly_extra_data), 0); | |
| 79 | poly = poly_alloc(machine, 2000, sizeof(poly_extra_data), 0); | |
| 81 | 80 | add_exit_callback(machine, gaelco3d_exit); |
| 82 | 81 | |
| 83 | 82 | screenbits = video_screen_auto_bitmap_alloc(machine->primary_screen); |
| r3957 | r3958 | |
| 373 | 372 | * |
| 374 | 373 | *************************************/ |
| 375 | 374 | |
| 376 | void gaelco3d_render(voi | |
| 375 | void gaelco3d_render(const device_config *screen) | |
| 377 | 376 | { |
| 378 | 377 | /* wait for any queued stuff to complete */ |
| 379 | 378 | poly_wait(poly, "Time to render"); |
| 380 | 379 | |
| 381 | 380 | #if DISPLAY_STATS |
| 382 | 381 | { |
| 383 | int scan = video_screen_get_vpos(machine->primary_screen); | |
| 384 | popmessage("Polys = %4d Timeleft = %3d", polygons, (lastscan < scan) ? (scan - lastscan) : (scan + (lastscan - video_screen_get_visible_area(Machine->primary_screen)->max_y))); | |
| 382 | int scan = video_screen_get_vpos(screen); | |
| 383 | popmessage("Polys = %4d Timeleft = %3d", polygons, (lastscan < scan) ? (scan - lastscan) : (scan + (lastscan - video_screen_get_visible_area(screen)->max_y))); | |
| 385 | 384 | } |
| 386 | 385 | #endif |
| 387 | 386 |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | sizex = (buf_spriteram[offs+2] & 0x000f) + 1; |
| 154 | 154 | sizey = (buf_spriteram[offs+3] & 0x000f) + 1; |
| 155 | 155 | |
| 156 | if (flip_screen_get()) | |
| 156 | if (flip_screen_get(machine)) | |
| 157 | 157 | { |
| 158 | 158 | flipx = !flipx; |
| 159 | 159 | flipy = !flipy; |
| r3957 | r3958 | |
| 181 | 181 | int layer; |
| 182 | 182 | |
| 183 | 183 | |
| 184 | flip_screen_set(vreg[0x0f] & 0x80); | |
| 184 | flip_screen_set(screen->machine, vreg[0x0f] & 0x80); | |
| 185 | 185 | |
| 186 | 186 | for (layer = 0;layer < 3;layer++) |
| 187 | 187 | { |
| 188 | if (flip_screen_get()) | |
| 188 | if (flip_screen_get(screen->machine)) | |
| 189 | 189 | { |
| 190 | 190 | tilemap_set_scrollx(bg_tilemap[layer],0,vreg[2*layer]+59); |
| 191 | 191 | tilemap_set_scrolly(bg_tilemap[layer],0,vreg[2*layer+1]+248); |
| r3957 | r3958 | |
|---|---|---|
| 424 | 424 | |
| 425 | 425 | WRITE8_HANDLER( marvins_flipscreen_w ) |
| 426 | 426 | { |
| 427 | flip_screen_set(data & 0x80); | |
| 427 | flip_screen_set(space->machine, data & 0x80); | |
| 428 | 428 | |
| 429 | 429 | // other bits unknown |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | WRITE8_HANDLER( sgladiat_flipscreen_w ) |
| 433 | 433 | { |
| 434 | flip_screen_set(data & 0x80); | |
| 434 | flip_screen_set(space->machine, data & 0x80); | |
| 435 | 435 | |
| 436 | 436 | tilemap_set_palette_offset(bg_tilemap, ((data & 0xf) ^ 8) << 4); |
| 437 | 437 | |
| r3957 | r3958 | |
| 440 | 440 | |
| 441 | 441 | WRITE8_HANDLER( hal21_flipscreen_w ) |
| 442 | 442 | { |
| 443 | flip_screen_set(data & 0x80); | |
| 443 | flip_screen_set(space->machine, data & 0x80); | |
| 444 | 444 | |
| 445 | 445 | tilemap_set_palette_offset(bg_tilemap, ((data & 0xf) ^ 8) << 4); |
| 446 | 446 | tilemap_set_pen_data_offset(bg_tilemap, ((data & 0x20) << 3) * space->machine->gfx[1]->char_modulo); |
| r3957 | r3958 | |
| 483 | 483 | -------X scrollx MSB (sprites) |
| 484 | 484 | */ |
| 485 | 485 | |
| 486 | flip_screen_set(data & 0x20); | |
| 486 | flip_screen_set(space->machine, data & 0x20); | |
| 487 | 487 | |
| 488 | 488 | bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4); |
| 489 | 489 | sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5); |
| r3957 | r3958 | |
| 505 | 505 | -------X scrollx MSB (sprites) |
| 506 | 506 | */ |
| 507 | 507 | |
| 508 | flip_screen_set(data & 0x80); | |
| 508 | flip_screen_set(space->machine, data & 0x80); | |
| 509 | 509 | |
| 510 | 510 | tilemap_set_pen_data_offset(tx_tilemap, ((data & 0x40) << 2) * space->machine->gfx[0]->char_modulo); |
| 511 | 511 | |
| r3957 | r3958 | |
| 560 | 560 | |
| 561 | 561 | WRITE8_HANDLER( gwar_videoattrs_w ) |
| 562 | 562 | { |
| 563 | flip_screen_set(data & 0x04); | |
| 563 | flip_screen_set(space->machine, data & 0x04); | |
| 564 | 564 | |
| 565 | 565 | sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x80) << 1); |
| 566 | 566 | sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x40) << 2); |
| r3957 | r3958 | |
| 572 | 572 | |
| 573 | 573 | WRITE8_HANDLER( gwara_videoattrs_w ) |
| 574 | 574 | { |
| 575 | flip_screen_set(data & 0x10); | |
| 575 | flip_screen_set(space->machine, data & 0x10); | |
| 576 | 576 | |
| 577 | 577 | bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7); |
| 578 | 578 | bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8); |
| r3957 | r3958 | |
| 627 | 627 | int flipy = (attributes&0x20); |
| 628 | 628 | int flipx = 0; |
| 629 | 629 | |
| 630 | if (flip_screen_get()) | |
| 630 | if (flip_screen_get(machine)) | |
| 631 | 631 | { |
| 632 | 632 | sx = 89 - 16 - sx; |
| 633 | 633 | sy = 262 - 16 - sy; |
| r3957 | r3958 | |
| 692 | 692 | yflip = attributes & 0x20; |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | if (flip_screen_get()) | |
| 695 | if (flip_screen_get(machine)) | |
| 696 | 696 | { |
| 697 | 697 | sx = 89 - size - sx; // this causes slight misalignment in tnk3 but is correct for athena and fitegolf |
| 698 | 698 | sy = 262 - size - sy; |
| r3957 | r3958 | |
| 825 | 825 | if (hw_xflip) |
| 826 | 826 | sx = 495 - size - sx; |
| 827 | 827 | |
| 828 | if (flip_screen_get()) | |
| 828 | if (flip_screen_get(machine)) | |
| 829 | 829 | { |
| 830 | 830 | sx = 495 - size - sx; |
| 831 | 831 | sy = 258 - size - sy; |
| r3957 | r3958 | |
|---|---|---|
| 460 | 460 | |
| 461 | 461 | gfxdata = base_gfx + (8*8*4/8) * (((attr & 0x000f) << 16) + code); |
| 462 | 462 | |
| 463 | if (flip_screen_get()) | |
| 463 | if (flip_screen_get(machine)) | |
| 464 | 464 | { |
| 465 | 465 | flipx = !flipx; x = max_x - x - width; |
| 466 | 466 | flipy = !flipy; y = max_y - y - height; |
| r3957 | r3958 | |
| 470 | 470 | { |
| 471 | 471 | /* prepare GfxElement on the fly */ |
| 472 | 472 | gfx_element gfx; |
| 473 | gfx.machine = machine; | |
| 473 | 474 | gfx.width = width; |
| 474 | 475 | gfx.height = height; |
| 475 | 476 | gfx.total_elements = 1; |
| r3957 | r3958 | |
| 482 | 483 | gfx.line_modulo = width; |
| 483 | 484 | gfx.char_modulo = 0; /* doesn't matter */ |
| 484 | 485 | gfx.flags = 0; |
| 486 | gfx.machine = machine; | |
| 485 | 487 | |
| 486 | 488 | /* Bounds checking */ |
| 487 | 489 | if ( (gfxdata + width * height - 1) >= gfx_max ) |
| r3957 | r3958 | |
| 500 | 502 | { |
| 501 | 503 | /* prepare GfxElement on the fly */ |
| 502 | 504 | gfx_element gfx; |
| 505 | gfx.machine = machine; | |
| 503 | 506 | gfx.width = width; |
| 504 | 507 | gfx.height = height; |
| 505 | 508 | gfx.total_elements = 1; |
| r3957 | r3958 | |
| 512 | 515 | gfx.line_modulo = width/2; |
| 513 | 516 | gfx.char_modulo = 0; /* doesn't matter */ |
| 514 | 517 | gfx.flags = GFX_ELEMENT_PACKED; |
| 518 | gfx.machine = machine; | |
| 515 | 519 | |
| 516 | 520 | /* Bounds checking */ |
| 517 | 521 | if ( (gfxdata + width/2 * height - 1) >= gfx_max ) |
| r3957 | r3958 | |
| 650 | 654 | ---- ---- ---- --1- ? Blank Screen |
| 651 | 655 | ---- ---- ---- ---0 Flip Screen */ |
| 652 | 656 | if (screenctrl & 2) return 0; |
| 653 | flip_screen_set(screenctrl & 1); | |
| 657 | flip_screen_set(screen->machine, screenctrl & 1); | |
| 654 | 658 | |
| 655 | 659 | /* If the game supports 16x16 tiles, make sure that the |
| 656 | 660 | 16x16 and 8x8 tilemaps of a given layer are not simultaneously |
| r3957 | r3958 | |
|---|---|---|
| 102 | 102 | } |
| 103 | 103 | palette_bank = (data & 0x20) >> 5; |
| 104 | 104 | |
| 105 | flip_screen_set(flipscreen); | |
| 105 | flip_screen_set(space->machine, flipscreen); | |
| 106 | 106 | |
| 107 | 107 | //popmessage("%04x: gfxctrl = %02x\n",cpu_get_pc(space->cpu),data); |
| 108 | 108 | |
| r3957 | r3958 | |
| 124 | 124 | if (data & 0x04) |
| 125 | 125 | { |
| 126 | 126 | flipscreen = (data & 0x01); |
| 127 | flip_screen_set(flipscreen); | |
| 127 | flip_screen_set(space->machine, flipscreen); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | //popmessage("%04x: gfxctrl = %02x\n",cpu_get_pc(space->cpu),data); |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | { |
| 57 | 57 | strnskil_scrl_ctrl = data >> 5; |
| 58 | 58 | |
| 59 | if (flip_screen_get() != (data & 0x08)) | |
| 59 | if (flip_screen_get(space->machine) != (data & 0x08)) | |
| 60 | 60 | { |
| 61 | flip_screen_set(data & 0x08); | |
| 61 | flip_screen_set(space->machine, data & 0x08); | |
| 62 | 62 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 63 | 63 | } |
| 64 | 64 | } |
| r3957 | r3958 | |
| 88 | 88 | { |
| 89 | 89 | int code = spriteram[offs + 1]; |
| 90 | 90 | int color = spriteram[offs + 2] & 0x3f; |
| 91 | int flipx = flip_screen_x_get(); | |
| 92 | int flipy = flip_screen_y_get(); | |
| 91 | int flipx = flip_screen_x_get(machine); | |
| 92 | int flipy = flip_screen_y_get(machine); | |
| 93 | 93 | |
| 94 | 94 | int sx = spriteram[offs + 3]; |
| 95 | 95 | int sy = spriteram[offs]; |
| 96 | 96 | int px, py; |
| 97 | 97 | |
| 98 | if (flip_screen_get()) | |
| 98 | if (flip_screen_get(machine)) | |
| 99 | 99 | { |
| 100 | 100 | px = 240 - sx + 0; /* +2 or +0 ? */ |
| 101 | 101 | py = sy; |
| r3957 | r3958 | |
|---|---|---|
| 266 | 266 | { |
| 267 | 267 | if (data & 0x80) |
| 268 | 268 | { |
| 269 | if (flip_screen_get()) | |
| 269 | if (flip_screen_get(machine)) | |
| 270 | 270 | *BITMAP_ADDR16(bitmap, 255-y, 255-x) = pen; |
| 271 | 271 | else |
| 272 | 272 | *BITMAP_ADDR16(bitmap, y, x) = pen; |
| r3957 | r3958 | |
| 332 | 332 | UINT8 x1; |
| 333 | 333 | int hc, hb_; |
| 334 | 334 | |
| 335 | if (flip_screen_get()) | |
| 335 | if (flip_screen_get(screen->machine)) | |
| 336 | 336 | x1 = x - video_screen_get_frame_number(screen); |
| 337 | 337 | else |
| 338 | 338 | x1 = x + video_screen_get_frame_number(screen); |
| r3957 | r3958 | |
| 403 | 403 | if (!(vert_data & horz_data & 0x80)) /* NAND gate */ |
| 404 | 404 | { |
| 405 | 405 | /* blue */ |
| 406 | if (flip_screen_get()) | |
| 406 | if (flip_screen_get(machine)) | |
| 407 | 407 | *BITMAP_ADDR16(bitmap, 255-y, 255-x) = 4; |
| 408 | 408 | else |
| 409 | 409 | *BITMAP_ADDR16(bitmap, y, x) = 4; |
| r3957 | r3958 | |
| 488 | 488 | if (!hd_ & hc_ & !hb_) |
| 489 | 489 | { |
| 490 | 490 | offs_t offs = ((x >> 3) & 0x03) | ((y & 0x1f) << 2) | |
| 491 | (flip_screen_get() ? 0x80 : 0); | |
| 491 | (flip_screen_get(screen->machine) ? 0x80 : 0); | |
| 492 | 492 | |
| 493 | 493 | UINT8 plane1 = PROM[offs ] << (x & 0x07); |
| 494 | 494 | UINT8 plane2 = PROM[offs | 0x0400] << (x & 0x07); |
| r3957 | r3958 | |
| 522 | 522 | |
| 523 | 523 | if (color != 0) |
| 524 | 524 | { |
| 525 | if (flip_screen_get()) | |
| 525 | if (flip_screen_get(screen->machine)) | |
| 526 | 526 | *BITMAP_ADDR16(bitmap, 255-y, 255-x) = color; |
| 527 | 527 | else |
| 528 | 528 | *BITMAP_ADDR16(bitmap, y, x) = color; |
| r3957 | r3958 | |
|---|---|---|
| 124 | 124 | { |
| 125 | 125 | shaolins_nmi_enable = data; |
| 126 | 126 | |
| 127 | if (flip_screen_get() != (data & 0x01)) | |
| 127 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 128 | 128 | { |
| 129 | flip_screen_set(data & 0x01); | |
| 129 | flip_screen_set(space->machine, data & 0x01); | |
| 130 | 130 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 131 | 131 | } |
| 132 | 132 | } |
| r3957 | r3958 | |
| 164 | 164 | int sx = 240 - spriteram[offs + 6]; |
| 165 | 165 | int sy = 248 - spriteram[offs + 4]; |
| 166 | 166 | |
| 167 | if (flip_screen_get()) | |
| 167 | if (flip_screen_get(machine)) | |
| 168 | 168 | { |
| 169 | 169 | sx = 240 - sx; |
| 170 | 170 | sy = 248 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 2703 | 2703 | sys24_tile_vh_start(machine, 0x3fff); |
| 2704 | 2704 | sys24_bitmap = bitmap_alloc(width, height+4, BITMAP_FORMAT_INDEXED16); |
| 2705 | 2705 | |
| 2706 | poly = poly_alloc(4000, sizeof(poly_extra_data), 0); | |
| 2706 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0); | |
| 2707 | 2707 | add_exit_callback(machine, model2_exit); |
| 2708 | 2708 | |
| 2709 | 2709 | /* initialize the geometry engine */ |
| r3957 | r3958 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | sprite &= ~multi; |
| 88 | 88 | |
| 89 | if (flip_screen_get()) | |
| 89 | if (flip_screen_get(machine)) | |
| 90 | 90 | { |
| 91 | 91 | y=240-y; |
| 92 | 92 | x=304-x; |
| r3957 | r3958 | |
| 187 | 187 | static int last_pf1_bank,last_pf2_bank; |
| 188 | 188 | int offs; |
| 189 | 189 | |
| 190 | flip_screen_set_no_update(sshangha_control_0[0]&0x80); | |
| 191 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_x_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 190 | flip_screen_set_no_update(screen->machine, sshangha_control_0[0]&0x80); | |
| 191 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_x_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 192 | 192 | |
| 193 | 193 | tilemap_set_enable( pf2_tilemap, sshangha_control_0[5]&0x8000); |
| 194 | 194 | tilemap_set_enable( pf1_8x8_tilemap, sshangha_control_0[5]&0x0080); |
| r3957 | r3958 | |
|---|---|---|
| 193 | 193 | sx = 8 * (offset % 128); |
| 194 | 194 | sy = 8 * (offset / 128); |
| 195 | 195 | |
| 196 | if (flip_screen_get()) | |
| 196 | if (flip_screen_get(space->machine)) | |
| 197 | 197 | sy = 512-8 - sy; |
| 198 | 198 | |
| 199 | 199 | colour = data & 0x0f; |
| r3957 | r3958 | |
| 210 | 210 | sx = 8 * (offset % 64); |
| 211 | 211 | sy = 4 * (offset / 64); |
| 212 | 212 | |
| 213 | if (flip_screen_get()) | |
| 213 | if (flip_screen_get(space->machine)) | |
| 214 | 214 | sy = 512-4 - sy; |
| 215 | 215 | |
| 216 | 216 | colour = data & 0x0f; |
| r3957 | r3958 | |
| 269 | 269 | static int lastflip = 0; |
| 270 | 270 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 271 | 271 | |
| 272 | if (lastflip != flip_screen_get()) | |
| 272 | if (lastflip != flip_screen_get(machine)) | |
| 273 | 273 | { |
| 274 | 274 | for (offs = 0;offs < popeye_bitmapram_size;offs++) |
| 275 | 275 | popeye_bitmap_w(space,offs,popeye_bitmapram[offs]); |
| 276 | 276 | |
| 277 | lastflip = flip_screen_get(); | |
| 277 | lastflip = flip_screen_get(machine); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | set_background_palette(machine, (*popeye_palettebank & 0x08) >> 3); |
| r3957 | r3958 | |
| 290 | 290 | if (bitmap_type == TYPE_SKYSKIPR) |
| 291 | 291 | scrollx = 2*scrollx - 512; |
| 292 | 292 | |
| 293 | if (flip_screen_get()) | |
| 293 | if (flip_screen_get(machine)) | |
| 294 | 294 | { |
| 295 | 295 | if (bitmap_type == TYPE_POPEYE) |
| 296 | 296 | scrollx = -scrollx; |
| r3957 | r3958 | |
| 336 | 336 | sx = 2*(spriteram[offs])-8; |
| 337 | 337 | sy = 2*(256-spriteram[offs + 1]); |
| 338 | 338 | |
| 339 | if (flip_screen_get()) | |
| 339 | if (flip_screen_get(machine)) | |
| 340 | 340 | { |
| 341 | 341 | flipx = !flipx; |
| 342 | 342 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 99 | 99 | flipx=spriteram16[offs+1]&2; |
| 100 | 100 | flipy=spriteram16[offs+1]&1; /* flip y untested */ |
| 101 | 101 | |
| 102 | if (flip_screen_get()) | |
| 102 | if (flip_screen_get(machine)) | |
| 103 | 103 | { |
| 104 | 104 | x = 240 - x; |
| 105 | 105 | y = 240 - y; |
| r3957 | r3958 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | WRITE8_HANDLER( hyperspt_flipscreen_w ) |
| 107 | 107 | { |
| 108 | if (flip_screen_get() != (data & 0x01)) | |
| 108 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 109 | 109 | { |
| 110 | flip_screen_set(data & 0x01); | |
| 110 | flip_screen_set(space->machine, data & 0x01); | |
| 111 | 111 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 112 | 112 | } |
| 113 | 113 | } |
| r3957 | r3958 | |
| 141 | 141 | int flipx = ~spriteram[offs] & 0x40; |
| 142 | 142 | int flipy = spriteram[offs] & 0x80; |
| 143 | 143 | |
| 144 | if (flip_screen_get()) | |
| 144 | if (flip_screen_get(machine)) | |
| 145 | 145 | { |
| 146 | 146 | sy = 240 - sy; |
| 147 | 147 | flipy = !flipy; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | /* Note that this adjustment must be done AFTER handling flip_screen_get(), thus */ | |
| 150 | /* Note that this adjustment must be done AFTER handling flip_screen_get(machine), thus */ | |
| 151 | 151 | /* proving that this is a hardware related "feature" */ |
| 152 | 152 | |
| 153 | 153 | sy += 1; |
| r3957 | r3958 | |
| 179 | 179 | for (row = 0; row < 32; row++) |
| 180 | 180 | { |
| 181 | 181 | int scrollx = hyperspt_scroll[row * 2] + (hyperspt_scroll[(row * 2) + 1] & 0x01) * 256; |
| 182 | if (flip_screen_get()) scrollx = -scrollx; | |
| 182 | if (flip_screen_get(screen->machine)) scrollx = -scrollx; | |
| 183 | 183 | tilemap_set_scrollx(bg_tilemap, row, scrollx); |
| 184 | 184 | } |
| 185 | 185 |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | WRITE8_HANDLER( zodiack_flipscreen_w ) |
| 48 | 48 | { |
| 49 | if (flip_screen_get() != (~data & 0x01)) | |
| 49 | if (flip_screen_get(space->machine) != (~data & 0x01)) | |
| 50 | 50 | { |
| 51 | flip_screen_set(~data & 0x01); | |
| 51 | flip_screen_set(space->machine, ~data & 0x01); | |
| 52 | 52 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 53 | 53 | } |
| 54 | 54 | } |
| r3957 | r3958 | |
| 131 | 131 | tilemap_set_scroll_cols(fg_tilemap, 32); |
| 132 | 132 | |
| 133 | 133 | /* FIXME: flip_screen_x should not be written. */ |
| 134 | flip_screen_set_no_update(0); | |
| 134 | flip_screen_set_no_update(machine, 0); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| r3957 | r3958 | |
| 145 | 145 | x = zodiack_bulletsram[offs + 3] + 7; |
| 146 | 146 | y = 255 - zodiack_bulletsram[offs + 1]; |
| 147 | 147 | |
| 148 | if (flip_screen_get() && percuss_hardware) | |
| 148 | if (flip_screen_get(machine) && percuss_hardware) | |
| 149 | 149 | { |
| 150 | 150 | y = 255 - y; |
| 151 | 151 | } |
| r3957 | r3958 | |
| 175 | 175 | flipy = spriteram[offs + 1] & 0x80; |
| 176 | 176 | spritecode = spriteram[offs + 1] & 0x3f; |
| 177 | 177 | |
| 178 | if (flip_screen_get() && percuss_hardware) | |
| 178 | if (flip_screen_get(machine) && percuss_hardware) | |
| 179 | 179 | { |
| 180 | 180 | sy = 240 - sy; |
| 181 | 181 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | WRITE8_HANDLER( mole_flipscreen_w ) |
| 50 | 50 | { |
| 51 | flip_screen_set(data & 0x01); | |
| 51 | flip_screen_set(space->machine, data & 0x01); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | VIDEO_UPDATE( mole ) |
| r3957 | r3958 | |
|---|---|---|
| 489 | 489 | * |
| 490 | 490 | *************************************/ |
| 491 | 491 | |
| 492 | static UINT32 *process_bitmap(UINT32 *objdata, int vc, int logit) | |
| 492 | static UINT32 *process_bitmap(running_machine *machine, UINT32 *objdata, int vc, int logit) | |
| 493 | 493 | { |
| 494 | 494 | /* extract minimal data */ |
| 495 | 495 | UINT32 upper = objdata[0]; |
| r3957 | r3958 | |
| 498 | 498 | UINT32 height = (lower >> 14) & 0x3ff; |
| 499 | 499 | UINT32 link = (lower >> 24) | ((upper & 0x7ff) << 8); |
| 500 | 500 | UINT32 data = (upper >> 11); |
| 501 | UINT32 *src = (UINT32 *)get_jaguar_memory(data << 3); | |
| 501 | UINT32 *src = (UINT32 *)get_jaguar_memory(machine, data << 3); | |
| 502 | 502 | |
| 503 | 503 | if (logit) |
| 504 | 504 | { |
| r3957 | r3958 | |
| 651 | 651 | objdata[1] = lower - (1 << 14); |
| 652 | 652 | } |
| 653 | 653 | |
| 654 | return (UINT32 *)get_jaguar_memory(link << 3); | |
| 654 | return (UINT32 *)get_jaguar_memory(machine, link << 3); | |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | |
| r3957 | r3958 | |
| 662 | 662 | * |
| 663 | 663 | *************************************/ |
| 664 | 664 | |
| 665 | static UINT32 *process_scaled_bitmap(UINT32 *objdata, int vc, int logit) | |
| 665 | static UINT32 *process_scaled_bitmap(running_machine *machine, UINT32 *objdata, int vc, int logit) | |
| 666 | 666 | { |
| 667 | 667 | /* extract data */ |
| 668 | 668 | UINT32 upper = objdata[0]; |
| r3957 | r3958 | |
| 671 | 671 | UINT32 height = (lower >> 14) & 0x3ff; |
| 672 | 672 | UINT32 link = (lower >> 24) | ((upper & 0x7ff) << 8); |
| 673 | 673 | UINT32 data = (upper >> 11); |
| 674 | UINT32 *src = (UINT32 *)get_jaguar_memory(data << 3); | |
| 674 | UINT32 *src = (UINT32 *)get_jaguar_memory(machine, data << 3); | |
| 675 | 675 | |
| 676 | 676 | /* third phrase */ |
| 677 | 677 | UINT32 lower3 = objdata[5]; |
| r3957 | r3958 | |
| 824 | 824 | objdata[5] = (lower3 & ~0xff0000) | ((remainder & 0xff) << 16); |
| 825 | 825 | } |
| 826 | 826 | |
| 827 | return (UINT32 *)get_jaguar_memory(link << 3); | |
| 827 | return (UINT32 *)get_jaguar_memory(machine, link << 3); | |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | |
| r3957 | r3958 | |
| 835 | 835 | * |
| 836 | 836 | *************************************/ |
| 837 | 837 | |
| 838 | static UINT32 *process_branch(UINT32 *objdata, int vc, int logit) | |
| 838 | static UINT32 *process_branch(running_machine *machine, UINT32 *objdata, int vc, int logit) | |
| 839 | 839 | { |
| 840 | 840 | UINT32 upper = objdata[0]; |
| 841 | 841 | UINT32 lower = objdata[1]; |
| r3957 | r3958 | |
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | /* handle the branch */ |
| 892 | return taken ? (UINT32 *)get_jaguar_memory(link << 3) : (objdata + 2); | |
| 892 | return taken ? (UINT32 *)get_jaguar_memory(machine, link << 3) : (objdata + 2); | |
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | |
| r3957 | r3958 | |
| 915 | 915 | logit = LOG_OBJECTS; |
| 916 | 916 | |
| 917 | 917 | /* fetch the object pointer */ |
| 918 | objdata = (UINT32 *)get_jaguar_memory((gpu_regs[OLP_H] << 16) | gpu_regs[OLP_L]); | |
| 918 | objdata = (UINT32 *)get_jaguar_memory(machine, (gpu_regs[OLP_H] << 16) | gpu_regs[OLP_L]); | |
| 919 | 919 | while (!done && objdata && count++ < 100) |
| 920 | 920 | { |
| 921 | 921 | /* the low 3 bits determine the command */ |
| r3957 | r3958 | |
| 925 | 925 | case 0: |
| 926 | 926 | if (logit) |
| 927 | 927 | logerror("bitmap = %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3]); |
| 928 | objdata = process_bitmap(objdata, vc, logit); | |
| 928 | objdata = process_bitmap(machine, objdata, vc, logit); | |
| 929 | 929 | break; |
| 930 | 930 | |
| 931 | 931 | /* scaled bitmap object */ |
| 932 | 932 | case 1: |
| 933 | 933 | if (logit) |
| 934 | 934 | logerror("scaled = %08X-%08X %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3], objdata[4], objdata[5]); |
| 935 | objdata = process_scaled_bitmap(objdata, vc, logit); | |
| 935 | objdata = process_scaled_bitmap(machine, objdata, vc, logit); | |
| 936 | 936 | break; |
| 937 | 937 | |
| 938 | 938 | /* branch */ |
| 939 | 939 | case 3: |
| 940 | 940 | if (logit) |
| 941 | 941 | logerror("branch = %08X-%08X\n", objdata[0], objdata[1]); |
| 942 | objdata = process_branch(objdata, vc, logit); | |
| 942 | objdata = process_branch(machine, objdata, vc, logit); | |
| 943 | 943 | break; |
| 944 | 944 | |
| 945 | 945 | /* stop */ |
| r3957 | r3958 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | taitojc_char_dirty = 1; |
| 200 | 200 | |
| 201 | poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 201 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 202 | 202 | add_exit_callback(machine, taitojc_exit); |
| 203 | 203 | |
| 204 | 204 | /* find first empty slot to decode gfx */ |
| r3957 | r3958 | |
|---|---|---|
| 202 | 202 | flipy = (spriteram[offs+1]&0x80)>>7; |
| 203 | 203 | flipx = (spriteram[offs+1]&0x40)>>6; |
| 204 | 204 | |
| 205 | if (flip_screen_x_get()) | |
| 205 | if (flip_screen_x_get(machine)) | |
| 206 | 206 | { |
| 207 | 207 | sx = 256 - sx; |
| 208 | 208 | flipx = !flipx; |
| 209 | 209 | } |
| 210 | if (flip_screen_y_get()) | |
| 210 | if (flip_screen_y_get(machine)) | |
| 211 | 211 | { |
| 212 | 212 | sy = 240 - sy; |
| 213 | 213 | flipy = !flipy; |
| r3957 | r3958 | |
| 257 | 257 | dx=128-pitnrun_h_heed+((pitnrun_ha&8)<<5)+3; |
| 258 | 258 | dy=128-pitnrun_v_heed+((pitnrun_ha&0x10)<<4); |
| 259 | 259 | |
| 260 | if (flip_screen_x_get()) | |
| 260 | if (flip_screen_x_get(screen->machine)) | |
| 261 | 261 | dx=128-dx+16; |
| 262 | 262 | |
| 263 | if (flip_screen_y_get()) | |
| 263 | if (flip_screen_y_get(screen->machine)) | |
| 264 | 264 | dy=128-dy; |
| 265 | 265 | |
| 266 | 266 | myclip.min_x=dx; |
| r3957 | r3958 | |
| 281 | 281 | draw_sprites(screen->machine,bitmap,&myclip); |
| 282 | 282 | |
| 283 | 283 | if(pitnrun_ha&4) |
| 284 | copybitmap_trans(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x_get(),flip_screen_y_get(),dx,dy,&myclip, 1); | |
| 284 | copybitmap_trans(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine),dx,dy,&myclip, 1); | |
| 285 | 285 | tilemap_draw(bitmap,cliprect,fg, 0,0); |
| 286 | 286 | return 0; |
| 287 | 287 | } |
| r3957 | r3958 | |
|---|---|---|
| 268 | 268 | waveram[1] = auto_malloc(WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 12); |
| 269 | 269 | |
| 270 | 270 | /* initialize polygon engine */ |
| 271 | poly = poly_alloc(10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 271 | poly = poly_alloc(machine, 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 272 | 272 | |
| 273 | 273 | /* we need to cleanup on exit */ |
| 274 | 274 | add_exit_callback(machine, exit_handler); |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | WRITE8_HANDLER( tehkanwc_flipscreen_x_w ) |
| 51 | 51 | { |
| 52 | flip_screen_x_set(data & 0x40); | |
| 52 | flip_screen_x_set(space->machine, data & 0x40); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | WRITE8_HANDLER( tehkanwc_flipscreen_y_w ) |
| 56 | 56 | { |
| 57 | flip_screen_y_set(data & 0x40); | |
| 57 | flip_screen_y_set(space->machine, data & 0x40); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | WRITE8_HANDLER( gridiron_led0_w ) |
| r3957 | r3958 | |
| 139 | 139 | int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128; |
| 140 | 140 | int sy = spriteram[offs + 3]; |
| 141 | 141 | |
| 142 | if (flip_screen_x_get()) | |
| 142 | if (flip_screen_x_get(machine)) | |
| 143 | 143 | { |
| 144 | 144 | sx = 240 - sx; |
| 145 | 145 | flipx = !flipx; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | if (flip_screen_y_get()) | |
| 148 | if (flip_screen_y_get(machine)) | |
| 149 | 149 | { |
| 150 | 150 | sy = 240 - sy; |
| 151 | 151 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 177 | 177 | { |
| 178 | 178 | if (ACCESSING_BITS_8_15) |
| 179 | 179 | { |
| 180 | flip_screen_set(data & 0x0100); | |
| 180 | flip_screen_set(space->machine, data & 0x0100); | |
| 181 | 181 | |
| 182 | 182 | tilemap_set_enable(bg_tilemap,data & 0x2000); /* guess */ |
| 183 | 183 | tilemap_set_enable(fg_tilemap,data & 0x1000); /* guess */ |
| r3957 | r3958 | |
| 211 | 211 | int sx = (INT16)buffered_spriteram16[offs+3]; /* signed */ |
| 212 | 212 | int sy = (INT16)buffered_spriteram16[offs+2]; /* signed */ |
| 213 | 213 | if(sy>512-16) sy-=512; |
| 214 | if (flip_screen_get()) | |
| 214 | if (flip_screen_get(machine)) | |
| 215 | 215 | { |
| 216 | 216 | sx = 240 - sx; |
| 217 | 217 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | /* bit 0 flips screen */ |
| 101 | 101 | /* it is also used to multiplex player 1 and player 2 controls */ |
| 102 | flip_screen_set(data & 0x01); | |
| 102 | flip_screen_set(space->machine, data & 0x01); | |
| 103 | 103 | |
| 104 | 104 | /* bits 1-3 are unknown */ |
| 105 | 105 | // if ((data & 0x0e) != 0) logerror("background register = %02x\n",data); |
| r3957 | r3958 | |
| 119 | 119 | sx = spriteram[offs + 3]; |
| 120 | 120 | sy = 239 - spriteram[offs]; |
| 121 | 121 | flipx = ~spriteram[offs + 2] & 0x10; |
| 122 | if (flip_screen_get()) | |
| 122 | if (flip_screen_get(machine)) | |
| 123 | 123 | { |
| 124 | 124 | sx = 240 - sx; |
| 125 | 125 | sy = 238 - sy; |
| r3957 | r3958 | |
| 129 | 129 | drawgfx(bitmap,machine->gfx[spriteram[offs + 1] & 0x80 ? 2 : 1], |
| 130 | 130 | spriteram[offs + 1] & 0x7f, |
| 131 | 131 | spriteram[offs + 2] & 0x0f, |
| 132 | flipx,flip_screen_get(), | |
| 132 | flipx,flip_screen_get(machine), | |
| 133 | 133 | sx,sy, |
| 134 | 134 | cliprect,TRANSPARENCY_PEN,0); |
| 135 | 135 | } |
| r3957 | r3958 | |
|---|---|---|
| 359 | 359 | zoomy = 32 - zoomy; |
| 360 | 360 | |
| 361 | 361 | |
| 362 | if (flip_screen_get()) | |
| 362 | if (flip_screen_get(machine)) | |
| 363 | 363 | { |
| 364 | 364 | x = width - x - (nx * zoomx)/2; |
| 365 | 365 | y = height - y - (ny * zoomy)/2; |
| r3957 | r3958 | |
| 434 | 434 | |
| 435 | 435 | tilemap *tmptilemap0, *tmptilemap1; |
| 436 | 436 | |
| 437 | flip_screen_set(~input_port_read(screen->machine, "DSW") & 0x00010000); // hardwired to a DSW bit | |
| 437 | flip_screen_set(screen->machine, ~input_port_read(screen->machine, "DSW") & 0x00010000); // hardwired to a DSW bit | |
| 438 | 438 | |
| 439 | 439 | /* Layers enable (not quite right) */ |
| 440 | 440 |
| r3957 | r3958 | |
|---|---|---|
| 130 | 130 | esd16_tilemap0_color = data & 3; |
| 131 | 131 | tilemap_mark_all_tiles_dirty(esdtilemap_0); |
| 132 | 132 | |
| 133 | flip_screen_set(data & 0x80); | |
| 133 | flip_screen_set(space->machine, data & 0x80); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| r3957 | r3958 | |
| 233 | 233 | sy = 0x100 - ((sy & 0xff) - (sy & 0x100)); |
| 234 | 234 | sy -= dimy*16; |
| 235 | 235 | |
| 236 | if (flip_screen_get()) | |
| 236 | if (flip_screen_get(machine)) | |
| 237 | 237 | { flipx = !flipx; sx = max_x - sx - 1 * 16 + 2; // small offset |
| 238 | 238 | flipy = !flipy; sy = max_y - sy - dimy * 16; } |
| 239 | 239 | |
| r3957 | r3958 | |
| 292 | 292 | |
| 293 | 293 | sy = 0x1ff-sy; |
| 294 | 294 | |
| 295 | if (flip_screen_get()) | |
| 295 | if (flip_screen_get(machine)) | |
| 296 | 296 | { flipx = !flipx; sx = max_x - sx - 1 * 16 + 2; // small offset |
| 297 | 297 | flipy = !flipy; sy = max_y - sy - dimy * 16; } |
| 298 | 298 |
| r3957 | r3958 | |
|---|---|---|
| 166 | 166 | { |
| 167 | 167 | int width, height; |
| 168 | 168 | |
| 169 | poly = poly_alloc(4000, sizeof(poly_extra_data), 0); | |
| 169 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0); | |
| 170 | 170 | add_exit_callback(machine, model3_exit); |
| 171 | 171 | |
| 172 | 172 | width = video_screen_get_width(machine->primary_screen); |
| r3957 | r3958 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | WRITE8_HANDLER( sbasketb_flipscreen_w ) |
| 114 | 114 | { |
| 115 | if (flip_screen_get() != data) | |
| 115 | if (flip_screen_get(space->machine) != data) | |
| 116 | 116 | { |
| 117 | flip_screen_set(data); | |
| 117 | flip_screen_set(space->machine, data); | |
| 118 | 118 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 119 | 119 | } |
| 120 | 120 | } |
| r3957 | r3958 | |
| 152 | 152 | int flipx = spriteram[offs + 1] & 0x40; |
| 153 | 153 | int flipy = spriteram[offs + 1] & 0x80; |
| 154 | 154 | |
| 155 | if (flip_screen_get()) | |
| 155 | if (flip_screen_get(machine)) | |
| 156 | 156 | { |
| 157 | 157 | sx = 240 - sx; |
| 158 | 158 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | case LENGTH: |
| 80 | 80 | if (move) |
| 81 | 81 | { |
| 82 | vector_add_point (currentx, currenty, 0, 0); | |
| 82 | vector_add_point (machine, currentx, currenty, 0, 0); | |
| 83 | 83 | move = 0; |
| 84 | 84 | } |
| 85 | 85 | |
| r3957 | r3958 | |
| 89 | 89 | total_length += abs(data); |
| 90 | 90 | |
| 91 | 91 | if (color) |
| 92 | vector_add_point (currentx, currenty, color, 0xff); | |
| 92 | vector_add_point (machine, currentx, currenty, color, 0xff); | |
| 93 | 93 | else |
| 94 | 94 | move = 1; |
| 95 | 95 | break; |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | inc = 1; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | if (flip_screen_get()) | |
| 56 | if (flip_screen_get(machine)) | |
| 57 | 57 | { |
| 58 | 58 | y=240-y; |
| 59 | 59 | x=304-x; |
| r3957 | r3958 | |
| 79 | 79 | |
| 80 | 80 | VIDEO_UPDATE( funkyjet ) |
| 81 | 81 | { |
| 82 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 82 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 83 | 83 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 84 | 84 | |
| 85 | 85 | bitmap_fill(bitmap,cliprect,768); |
| r3957 | r3958 | |
|---|---|---|
| 430 | 430 | static const mc6845_interface mc6845_intf = |
| 431 | 431 | { |
| 432 | 432 | "main", /* screen we are acting on */ |
| 433 | QIX_CHARACTER_CLOCK, /* the clock (pin 21) of the chip */ | |
| 434 | 433 | 8, /* number of pixels per video memory address */ |
| 435 | 434 | begin_update, /* before pixel update callback */ |
| 436 | 435 | update_row, /* row update callback */ |
| r3957 | r3958 | |
| 455 | 454 | MDRV_VIDEO_START(qix) |
| 456 | 455 | MDRV_VIDEO_UPDATE(qix) |
| 457 | 456 | |
| 458 | MDRV_DEVICE_ADD(MC6845_TAG, MC6845) | |
| 459 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 457 | MDRV_MC6845_ADD(MC6845_TAG, MC6845, QIX_CHARACTER_CLOCK, mc6845_intf) | |
| 460 | 458 | |
| 461 | 459 | MDRV_SCREEN_ADD("main", RASTER) |
| 462 | 460 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| r3957 | r3958 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | WRITE8_HANDLER( ironhors_flipscreen_w ) |
| 126 | 126 | { |
| 127 | if (flip_screen_get() != (~data & 0x08)) | |
| 127 | if (flip_screen_get(space->machine) != (~data & 0x08)) | |
| 128 | 128 | { |
| 129 | flip_screen_set(~data & 0x08); | |
| 129 | flip_screen_set(space->machine, ~data & 0x08); | |
| 130 | 130 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 131 | 131 | } |
| 132 | 132 | |
| r3957 | r3958 | |
| 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 * palettebank; |
| 173 | // int mod = flip_screen_get() ? -8 : 8; | |
| 173 | // int mod = flip_screen_get(machine) ? -8 : 8; | |
| 174 | 174 | |
| 175 | if (flip_screen_get()) | |
| 175 | if (flip_screen_get(machine)) | |
| 176 | 176 | { |
| 177 | 177 | sx = 240 - sx; |
| 178 | 178 | sy = 240 - sy; |
| r3957 | r3958 | |
| 193 | 193 | |
| 194 | 194 | case 0x04: /* 16x8 */ |
| 195 | 195 | { |
| 196 | if (flip_screen_get()) sy += 8; // this fixes the train wheels' position | |
| 196 | if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position | |
| 197 | 197 | |
| 198 | 198 | drawgfx(bitmap,machine->gfx[2], |
| 199 | 199 | code & ~1, |
| r3957 | r3958 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | /* bit 7 is flip screen */ |
| 62 | 62 | |
| 63 | if (flip_screen_get() != (data & 0x80)) | |
| 63 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 64 | 64 | { |
| 65 | flip_screen_set(data & 0x80); | |
| 65 | flip_screen_set(space->machine, data & 0x80); | |
| 66 | 66 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 67 | 67 | } |
| 68 | 68 | } |
| r3957 | r3958 | |
| 96 | 96 | int flipy = source[1] & 0x80; |
| 97 | 97 | int flipx = source[1] & 0x40; |
| 98 | 98 | |
| 99 | if (flip_screen_get()) | |
| 99 | if (flip_screen_get(machine)) | |
| 100 | 100 | { |
| 101 | 101 | sx = 240 - sx; |
| 102 | 102 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | /* move to the starting position if we're not there already */ |
| 65 | 65 | if (sx != lastx || sy != lasty) |
| 66 | vector_add_point(sx << 16, sy << 16, 0, 0); | |
| 66 | vector_add_point(device->machine, sx << 16, sy << 16, 0, 0); | |
| 67 | 67 | |
| 68 | 68 | /* draw the vector */ |
| 69 | vector_add_point(ex << 16, ey << 16, vector_color, intensity); | |
| 69 | vector_add_point(device->machine, ex << 16, ey << 16, vector_color, intensity); | |
| 70 | 70 | |
| 71 | 71 | /* remember the last point */ |
| 72 | 72 | lastx = ex; |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | interrupt_enable_w(space,0,data & 1); |
| 60 | 60 | |
| 61 | 61 | /* bit 1 = flip screen */ |
| 62 | flip_screen_set(data & 0x02); | |
| 62 | flip_screen_set(space->machine, data & 0x02); | |
| 63 | 63 | |
| 64 | 64 | /* bit 2 =display enable */ |
| 65 | 65 | display_enable = data & 0x04; |
| r3957 | r3958 | |
| 104 | 104 | |
| 105 | 105 | sx += (spriteram_2[offs] & 0x20) >> 5; // not sure about this |
| 106 | 106 | |
| 107 | if (flip_screen_get()) | |
| 107 | if (flip_screen_get(machine)) | |
| 108 | 108 | { |
| 109 | 109 | sx = 496 - sx; |
| 110 | 110 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | int sx = spriteram[i + 2] - ((attr & 0x80) << 1); |
| 81 | 81 | int sy = spriteram[i + 3]; |
| 82 | 82 | |
| 83 | if (flip_screen_get()) | |
| 83 | if (flip_screen_get(machine)) | |
| 84 | 84 | { |
| 85 | 85 | sx = 240 - sx; |
| 86 | 86 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 127 | 127 | interrupt_enable_w(space,0,(data & 0x10)>>4); |
| 128 | 128 | |
| 129 | 129 | /* bit 5 controls screen flip */ |
| 130 | flip_screen_set(data & 0x20); | |
| 130 | flip_screen_set(space->machine, data & 0x20); | |
| 131 | 131 | |
| 132 | 132 | /* bits 6-7 unknown */ |
| 133 | 133 | } |
| r3957 | r3958 | |
| 166 | 166 | |
| 167 | 167 | VIDEO_UPDATE( bankp ) |
| 168 | 168 | { |
| 169 | if (flip_screen_get()) | |
| 169 | if (flip_screen_get(screen->machine)) | |
| 170 | 170 | { |
| 171 | 171 | tilemap_set_scrollx(fg_tilemap, 0, -scroll_x); |
| 172 | 172 | tilemap_set_scrollx(bg_tilemap, 0, 0); |
| r3957 | r3958 | |
|---|---|---|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | ||
| 99 | WRITE8_HANDLER( threeds_romsel_w ) | |
| 100 | { | |
| 101 | if (data&0xfc) printf("%02x\n",data); | |
| 102 | pastelg_gfxrom = (data & 0x3); | |
| 103 | } | |
| 104 | ||
| 105 | ||
| 98 | 106 | WRITE8_HANDLER( pastelg_romsel_w ) |
| 99 | 107 | { |
| 100 | 108 | int gfxlen = memory_region_length(space->machine, "gfx1"); |
| r3957 | r3958 | |
| 153 | 161 | int dx, dy; |
| 154 | 162 | int startx, starty; |
| 155 | 163 | int sizex, sizey; |
| 156 | int | |
| 164 | int | |
| 157 | 165 | int ctrx, ctry; |
| 158 | 166 | int readflag; |
| 159 | 167 | int gfxaddr, gfxlen; |
| 168 | int count; | |
| 160 | 169 | UINT8 color; |
| 161 | 170 | |
| 162 | 171 | nb1413m3_busyctr = 0; |
| r3957 | r3958 | |
| 164 | 173 | startx = blitter_destx + blitter_sizex; |
| 165 | 174 | starty = blitter_desty + blitter_sizey; |
| 166 | 175 | |
| 176 | ||
| 167 | 177 | if (blitter_direction_x) |
| 168 | 178 | { |
| 169 | sizex = blitter_sizex ^ 0xff; | |
| 170 | skipx = 1; | |
| 179 | if (blitter_sizex&0x80) sizex = 0xff-blitter_sizex; | |
| 180 | else sizex=blitter_sizex; | |
| 181 | incx = 1; | |
| 171 | 182 | } |
| 172 | 183 | else |
| 173 | 184 | { |
| 174 | 185 | sizex = blitter_sizex; |
| 175 | | |
| 186 | | |
| 176 | 187 | } |
| 177 | 188 | |
| 178 | 189 | if (blitter_direction_y) |
| 179 | 190 | { |
| 180 | sizey = blitter_sizey ^ 0xff; | |
| 181 | skipy = 1; | |
| 191 | if (blitter_sizey&0x80) sizey = 0xff-blitter_sizey; | |
| 192 | else sizey=blitter_sizey; | |
| 193 | incy = 1; | |
| 182 | 194 | } |
| 183 | 195 | else |
| 184 | 196 | { |
| 185 | 197 | sizey = blitter_sizey; |
| 186 | | |
| 198 | | |
| 187 | 199 | } |
| 188 | 200 | |
| 189 | 201 | gfxlen = memory_region_length(machine, "gfx1"); |
| r3957 | r3958 | |
| 191 | 203 | |
| 192 | 204 | readflag = 0; |
| 193 | 205 | |
| 194 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) | |
| 206 | count = 0; | |
| 207 | y = starty; | |
| 208 | ||
| 209 | for (ctry = sizey; ctry >= 0; ctry--) | |
| 195 | 210 | { |
| 196 | for (x = startx, ctrx = sizex; ctrx >= 0; x += skipx, ctrx--) | |
| 211 | x = startx; | |
| 212 | ||
| 213 | for (ctrx = sizex; ctrx >= 0; ctrx--) | |
| 197 | 214 | { |
| 215 | gfxaddr = (pastelg_gfxrom << 16) + ((blitter_src_addr + count)); | |
| 216 | ||
| 198 | 217 | if ((gfxaddr > (gfxlen - 1))) |
| 199 | 218 | { |
| 200 | 219 | #ifdef MAME_DEBUG |
| r3957 | r3958 | |
| 223 | 242 | { |
| 224 | 243 | // 2nd, 4th, 6th, ... read |
| 225 | 244 | color = (color & 0xf0) >> 4; |
| 226 | | |
| 245 | count | |
| 227 | 246 | } |
| 228 | 247 | |
| 229 | 248 | readflag ^= 1; |
| r3957 | r3958 | |
| 243 | 262 | } |
| 244 | 263 | |
| 245 | 264 | nb1413m3_busyctr++; |
| 265 | x += incx; | |
| 246 | 266 | } |
| 267 | ||
| 268 | y += incy; | |
| 247 | 269 | } |
| 248 | 270 | |
| 249 | 271 | nb1413m3_busyflag = 0; |
| r3957 | r3958 | |
|---|---|---|
| 108 | 108 | UINT8 *gfx = memory_region(machine, "gfx2") + (code << 7); |
| 109 | 109 | |
| 110 | 110 | |
| 111 | if (flip_screen_get()) | |
| 111 | if (flip_screen_get(machine)) | |
| 112 | 112 | sy += 32; |
| 113 | 113 | |
| 114 | 114 | /* assume no collision */ |
| r3957 | r3958 | |
|---|---|---|
| 222 | 222 | int flipx = spriteram[offs] & 1; |
| 223 | 223 | int flipy = spriteram[offs] & 2; |
| 224 | 224 | int color = spriteram_2[offs + 1] & 0x3f; |
| 225 | if (flip_screen_get()) sx += 32-2; | |
| 225 | if (flip_screen_get(machine)) sx += 32-2; | |
| 226 | 226 | |
| 227 | 227 | drawgfx(bitmap,machine->gfx[1], |
| 228 | 228 | (spriteram[offs] & 0xfc) >> 2, |
| r3957 | r3958 | |
| 245 | 245 | |
| 246 | 246 | x = bosco_radarx[offs] + ((~bosco_radarattr[offs] & 0x01) << 8); |
| 247 | 247 | y = 253 - bosco_radary[offs]; |
| 248 | if (flip_screen_get()) x -= 3; | |
| 248 | if (flip_screen_get(machine)) x -= 3; | |
| 249 | 249 | |
| 250 | 250 | drawgfx(bitmap,machine->gfx[2], |
| 251 | 251 | ((bosco_radarattr[offs] & 0x0e) >> 1) ^ 0x07, |
| r3957 | r3958 | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| 260 | static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect) | |
| 260 | static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect, int flip) | |
| 261 | 261 | { |
| 262 | 262 | if (1) |
| 263 | 263 | { |
| r3957 | r3958 | |
| 280 | 280 | /* dont draw the stars that are off the screen */ |
| 281 | 281 | if ( x < 224 && y < 224 ) |
| 282 | 282 | { |
| 283 | if (flip | |
| 283 | if (flip | |
| 284 | 284 | |
| 285 | 285 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 286 | 286 | *BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col; |
| r3957 | r3958 | |
| 297 | 297 | the screen, and clip it to only the position where it is supposed to be shown */ |
| 298 | 298 | rectangle fg_clip = *cliprect; |
| 299 | 299 | rectangle bg_clip = *cliprect; |
| 300 | if (flip_screen_get()) | |
| 300 | if (flip_screen_get(screen->machine)) | |
| 301 | 301 | { |
| 302 | 302 | bg_clip.min_x = 8*8; |
| 303 | 303 | fg_clip.max_x = 8*8-1; |
| r3957 | r3958 | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); |
| 312 | draw_stars(bitmap,cliprect); | |
| 312 | draw_stars(bitmap,cliprect,flip_screen_get(screen->machine)); | |
| 313 | 313 | |
| 314 | 314 | tilemap_draw(bitmap,&bg_clip,bg_tilemap,0,0); |
| 315 | 315 | tilemap_draw(bitmap,&fg_clip,fg_tilemap,0,0); |
| r3957 | r3958 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | WRITE8_HANDLER( funkybee_scroll_w ) |
| 67 | 67 | { |
| 68 | tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? -data : data); | |
| 68 | tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get(space->machine) ? -data : data); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | WRITE8_HANDLER( funkybee_flipscreen_w ) |
| 72 | 72 | { |
| 73 | flip_screen_set(data & 0x01); | |
| 73 | flip_screen_set(space->machine, data & 0x01); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 107 | 107 | int sx = videoram[offs2 + 0x10]; |
| 108 | 108 | int sy = 224 - colorram[offs2]; |
| 109 | 109 | |
| 110 | if (flip_screen_get()) | |
| 110 | if (flip_screen_get(machine)) | |
| 111 | 111 | { |
| 112 | 112 | sy += 32; |
| 113 | 113 | flipx = !flipx; |
| r3957 | r3958 | |
| 127 | 127 | |
| 128 | 128 | for (offs = 0x1f;offs >= 0;offs--) |
| 129 | 129 | { |
| 130 | int const flip = flip_screen_get(); | |
| 130 | int const flip = flip_screen_get(machine); | |
| 131 | 131 | int code = videoram[0x1c00 + offs]; |
| 132 | 132 | int color = colorram[0x1f10] & 0x03; |
| 133 | 133 | int sx = flip ? videoram[0x1f1f] : videoram[0x1f10]; |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | tmpbitmaps = video_screen_auto_bitmap_alloc(machine->primary_screen); |
| 54 | 54 | polybitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); |
| 55 | 55 | |
| 56 | poly = poly_alloc(16, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 56 | poly = poly_alloc(machine, 16, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 57 | 57 | add_exit_callback(machine, galastrm_exit); |
| 58 | 58 | } |
| 59 | 59 |
| r3957 | r3958 | |
|---|---|---|
| 128 | 128 | { |
| 129 | 129 | if (ACCESSING_BITS_0_7) |
| 130 | 130 | { |
| 131 | flip_screen_set(data & 0x01); | |
| 131 | flip_screen_set(space->machine, data & 0x01); | |
| 132 | 132 | |
| 133 | 133 | coin_lockout_w(0,~data & 0x10); |
| 134 | 134 | coin_lockout_w(1,~data & 0x20); |
| r3957 | r3958 | |
| 234 | 234 | flipy = attr & sprite_flipy_mask; /* 0x40 for lastduel, 0x80 for madgear */ |
| 235 | 235 | color = attr & 0x0f; |
| 236 | 236 | |
| 237 | if (flip_screen_get()) | |
| 237 | if (flip_screen_get(machine)) | |
| 238 | 238 | { |
| 239 | 239 | sx = 496 - sx; |
| 240 | 240 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | int flipy = 0; |
| 45 | 45 | int color = spriteram[offs + 1] & 0x1f; |
| 46 | 46 | |
| 47 | if (flip_screen_x_get()) | |
| 47 | if (flip_screen_x_get(machine)) | |
| 48 | 48 | { |
| 49 | 49 | xpos = 240 - xpos; |
| 50 | 50 | flipx = !flipx; |
| 51 | 51 | } |
| 52 | if (flip_screen_y_get()) | |
| 52 | if (flip_screen_y_get(machine)) | |
| 53 | 53 | { |
| 54 | 54 | ypos = 256 - ypos; |
| 55 | 55 | flipy = !flipy; |
| r3957 | r3958 | |
| 79 | 79 | int flipy = 0;//spriteram[offs + 0] & 0x40; |
| 80 | 80 | int color = spriteram[offs + 1] & 0x0f; |
| 81 | 81 | |
| 82 | if (flip_screen_x_get()) | |
| 82 | if (flip_screen_x_get(machine)) | |
| 83 | 83 | { |
| 84 | 84 | xpos = 240 - xpos; |
| 85 | 85 | flipx = !flipx; |
| 86 | 86 | } |
| 87 | if (flip_screen_y_get()) | |
| 87 | if (flip_screen_y_get(machine)) | |
| 88 | 88 | { |
| 89 | 89 | ypos = 256 - ypos; |
| 90 | 90 | flipy = !flipy; |
| r3957 | r3958 | |
| 115 | 115 | int flipy = spriteram[offs + 2] & 0x40; |
| 116 | 116 | int color = spriteram[offs + 2] & 0x1f; |
| 117 | 117 | |
| 118 | if (flip_screen_x_get()) | |
| 118 | if (flip_screen_x_get(machine)) | |
| 119 | 119 | { |
| 120 | 120 | xpos = 240 - xpos; |
| 121 | 121 | flipx = !flipx; |
| 122 | 122 | } |
| 123 | if (flip_screen_y_get()) | |
| 123 | if (flip_screen_y_get(machine)) | |
| 124 | 124 | { |
| 125 | 125 | ypos = 256 - ypos; |
| 126 | 126 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "deprecat.h" | |
| 38 | 37 | #include "eminline.h" |
| 39 | 38 | #include "video/rgbutil.h" |
| 40 | 39 | #include "namcos22.h" |
| r3957 | r3958 | |
| 174 | 173 | } /* Clamp256 */ |
| 175 | 174 | |
| 176 | 175 | #ifdef MAME_DEBUG |
| 177 | static void Dump( FILE *f, unsigned addr1, unsigned addr2, const char *name ); | |
| 176 | static void Dump( const address_space *space, FILE *f, unsigned addr1, unsigned addr2, const char *name ); | |
| 178 | 177 | #endif |
| 179 | 178 | |
| 180 | 179 | static struct |
| r3957 | r3958 | |
| 253 | 252 | { |
| 254 | 253 | rgbint fogColor; |
| 255 | 254 | rgbint fadeColor; |
| 256 | | |
| 255 | const pen_t *pens; | |
| 257 | 256 | int bn; |
| 258 | 257 | UINT16 flags; |
| 259 | 258 | int cmode; |
| r3957 | r3958 | |
| 280 | 279 | bitmap_t *bitmap = dest; |
| 281 | 280 | const poly_extra_data *extra = extradata; |
| 282 | 281 | int bn = extra->bn * 0x1000; |
| 283 | const pen_t *pens = | |
| 282 | const pen_t *pens = | |
| 284 | 283 | int fogFactor = 0xff - extra->fogFactor; |
| 285 | 284 | int fadeFactor = 0xff - extra->fadeFactor; |
| 286 | 285 | int transFactor = 0xff; |
| r3957 | r3958 | |
| 437 | 436 | |
| 438 | 437 | extra = poly_get_extra_data(poly); |
| 439 | 438 | |
| 440 | extra-> | |
| 439 | extra->pens | |
| 441 | 440 | extra->bn = textureBank; |
| 442 | 441 | extra->flags = flags; |
| 443 | 442 | extra->cmode = cmode; |
| r3957 | r3958 | |
| 491 | 490 | int dx = extent->param[0].dpdx * 65536.0f; |
| 492 | 491 | const poly_extra_data *extra = extradata; |
| 493 | 492 | bitmap_t *destmap = destbase; |
| 494 | const pen_t *pal = | |
| 493 | const pen_t *pal = | |
| 495 | 494 | int prioverchar = extra->prioverchar; |
| 496 | 495 | int z = extra->z; |
| 497 | 496 | int alpha = extra->alpha; |
| r3957 | r3958 | |
| 597 | 596 | extra->alpha = alpha; |
| 598 | 597 | extra->prioverchar = prioverchar; |
| 599 | 598 | extra->line_modulo = gfx->line_modulo; |
| 600 | extra-> | |
| 599 | extra->pens | |
| 601 | 600 | extra->source = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo; |
| 602 | 601 | #ifdef RENDER_AS_QUADS |
| 603 | 602 | poly_render_quad_fan(poly, dest_bmp, clip, renderscanline_sprite, 2, 4, &vert[0]); |
| r3957 | r3958 | |
| 608 | 607 | } /* mydrawgfxzoom */ |
| 609 | 608 | |
| 610 | 609 | static void |
| 611 | ApplyGamma( bitmap_t *bitmap ) | |
| 610 | ApplyGamma( running_machine *machine, bitmap_t *bitmap ) | |
| 612 | 611 | { |
| 613 | 612 | int x,y; |
| 614 | 613 | if( mbSuperSystem22 ) |
| r3957 | r3958 | |
| 636 | 635 | } |
| 637 | 636 | else |
| 638 | 637 | { /* system 22 */ |
| 639 | const UINT8 *rlut = 0x000+(const UINT8 *)memory_region( | |
| 638 | const UINT8 *rlut = 0x000+(const UINT8 *)memory_region(machine, "user1"); | |
| 640 | 639 | const UINT8 *glut = 0x100+rlut; |
| 641 | 640 | const UINT8 *blut = 0x200+rlut; |
| 642 | 641 | for( y=0; y<bitmap->height; y++ ) |
| r3957 | r3958 | |
| 2246 | 2245 | mpPolyH = mpPolyM + mPtRomSize; |
| 2247 | 2246 | |
| 2248 | 2247 | #ifdef RENDER_AS_QUADS |
| 2249 | poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 2248 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 2250 | 2249 | #else |
| 2251 | poly = poly_alloc(4000, sizeof(poly_extra_data), 0); | |
| 2250 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0); | |
| 2252 | 2251 | #endif |
| 2253 | 2252 | add_reset_callback(machine, namcos22_reset); |
| 2254 | 2253 | add_exit_callback(machine, namcos22_exit); |
| r3957 | r3958 | |
| 2275 | 2274 | UINT32 bgColor; |
| 2276 | 2275 | UpdateVideoMixer(); |
| 2277 | 2276 | bgColor = (mixer.rBackColor<<16)|(mixer.gBackColor<<8)|mixer.bBackColor; |
| 2278 | bitmap_fill( bitmap, cliprect , bgColor); | |
| 2279 | UpdatePaletteS(screen->machine); | |
| 2280 | DrawCharacterLayer(screen->machine, bitmap, cliprect ); | |
| 2277 | bitmap_fill( bitmap, cliprect , bgColor); | |
| 2278 | UpdatePaletteS(screen->machine); | |
| 2279 | DrawCharacterLayer(screen->machine, bitmap, cliprect ); | |
| 2281 | 2280 | DrawPolygons( bitmap ); |
| 2282 | DrawSprites( bitmap, cliprect ); | |
| 2283 | RenderScene(screen->machine, bitmap ); | |
| 2281 | DrawSprites( bitmap, cliprect ); | |
| 2282 | RenderScene(screen->machine, bitmap ); | |
| 2284 | 2283 | DrawTranslucentCharacters( bitmap, cliprect ); |
| 2285 | ApplyGamma( bitmap ); | |
| 2284 | ApplyGamma( screen->machine, bitmap ); | |
| 2286 | 2285 | |
| 2287 | 2286 | #ifdef MAME_DEBUG |
| 2288 | 2287 | if( input_code_pressed(KEYCODE_D) ) |
| r3957 | r3958 | |
| 2290 | 2289 | FILE *f = fopen( "dump.txt", "wb" ); |
| 2291 | 2290 | if( f ) |
| 2292 | 2291 | { |
| 2292 | const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 2293 | ||
| 2293 | 2294 | { |
| 2294 | 2295 | int i,bank; |
| 2295 | 2296 | for( bank=0; bank<4; bank++ ) |
| r3957 | r3958 | |
| 2303 | 2304 | } |
| 2304 | 2305 | } |
| 2305 | 2306 | |
| 2306 | Dump(f,0x810000, 0x81000f, "cz attr" ); | |
| 2307 | Dump(f,0x820000, 0x8202ff, "unk_ac" ); | |
| 2308 | Dump(f,0x824000, 0x8243ff, "gamma"); | |
| 2309 | Dump(f,0x828000, 0x83ffff, "palette" ); | |
| 2310 | Dump(f,0x8a0000, 0x8a000f, "tilemap_attr"); | |
| 2311 | Dump(f,0x880000, 0x89ffff, "cgram/textram"); | |
| 2312 | Dump(f,0x900000, 0x90ffff, "vics_data"); | |
| 2313 | Dump(f,0x940000, 0x94007f, "vics_control"); | |
| 2314 | Dump(f,0x980000, 0x9affff, "sprite374" ); | |
| 2315 | Dump(f,0xc00000, 0xc1ffff, "polygonram"); | |
| 2307 | Dump(space, f,0x810000, 0x81000f, "cz attr" ); | |
| 2308 | Dump(space, f,0x820000, 0x8202ff, "unk_ac" ); | |
| 2309 | Dump(space, f,0x824000, 0x8243ff, "gamma"); | |
| 2310 | Dump(space, f,0x828000, 0x83ffff, "palette" ); | |
| 2311 | Dump(space, f,0x8a0000, 0x8a000f, "tilemap_attr"); | |
| 2312 | Dump(space, f,0x880000, 0x89ffff, "cgram/textram"); | |
| 2313 | Dump(space, f,0x900000, 0x90ffff, "vics_data"); | |
| 2314 | Dump(space, f,0x940000, 0x94007f, "vics_control"); | |
| 2315 | Dump(space, f,0x980000, 0x9affff, "sprite374" ); | |
| 2316 | Dump(space, f,0xc00000, 0xc1ffff, "polygonram"); | |
| 2316 | 2317 | fclose( f ); |
| 2317 | 2318 | } |
| 2318 | 2319 | while( input_code_pressed(KEYCODE_D) ){} |
| r3957 | r3958 | |
| 2324 | 2325 | VIDEO_UPDATE( namcos22 ) |
| 2325 | 2326 | { |
| 2326 | 2327 | UpdateVideoMixer(); |
| 2327 | ||
| 2328 | | |
| 2328 | 2329 | UpdatePalette(screen->machine); |
| 2329 | 2330 | DrawCharacterLayer(screen->machine, bitmap, cliprect ); |
| 2330 | DrawPolygons( bitmap ); | |
| 2331 | RenderScene(screen->machine, bitmap); | |
| 2331 | DrawPolygons( bitmap ); | |
| 2332 | RenderScene(screen->machine, bitmap); | |
| 2332 | 2333 | DrawTranslucentCharacters( bitmap, cliprect ); |
| 2333 | ApplyGamma( bitmap ); | |
| 2334 | ApplyGamma( screen->machine, bitmap ); | |
| 2334 | 2335 | |
| 2335 | 2336 | #ifdef MAME_DEBUG |
| 2336 | 2337 | if( input_code_pressed(KEYCODE_D) ) |
| r3957 | r3958 | |
| 2338 | 2339 | FILE *f = fopen( "dump.txt", "wb" ); |
| 2339 | 2340 | if( f ) |
| 2340 | 2341 | { |
| 2341 | // Dump(f,0x90000000, 0x90000003, "led?" ); | |
| 2342 | // Dump(f,0x90010000, 0x90017fff, "cz_ram"); | |
| 2343 | // Dump(f,0x900a0000, 0x900a000f, "tilemap_attr"); | |
| 2344 | Dump(f,0x90020000, 0x90027fff, "gamma"); | |
| 2345 | // 0x90020000, 0x90027fff | |
| 2346 | // Dump(f,0x70000000, 0x7001ffff, "polygonram"); | |
| 2342 | const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 2343 | ||
| 2344 | // Dump(space, f,0x90000000, 0x90000003, "led?" ); | |
| 2345 | // Dump(space, f,0x90010000, 0x90017fff, "cz_ram"); | |
| 2346 | // Dump(space, f,0x900a0000, 0x900a000f, "tilemap_attr"); | |
| 2347 | Dump(space, f,0x90020000, 0x90027fff, "gamma"); | |
| 2348 | // Dump(space, f,0x70000000, 0x7001ffff, "polygonram"); | |
| 2347 | 2349 | fclose( f ); |
| 2348 | 2350 | } |
| 2349 | 2351 | while( input_code_pressed(KEYCODE_D) ){} |
| r3957 | r3958 | |
| 2409 | 2411 | |
| 2410 | 2412 | #ifdef MAME_DEBUG |
| 2411 | 2413 | static void |
| 2412 | Dump( FILE *f, unsigned addr1, unsigned addr2, const char *name ) | |
| 2414 | Dump( const address_space *space, FILE *f, unsigned addr1, unsigned addr2, const char *name ) | |
| 2413 | 2415 | { |
| 2414 | const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 2415 | 2416 | unsigned addr; |
| 2416 | 2417 | fprintf( f, "%s:\n", name ); |
| 2417 | 2418 | for( addr=addr1; addr<=addr2; addr+=16 ) |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | WRITE8_HANDLER( redclash_flipscreen_w ) |
| 121 | 121 | { |
| 122 | flip_screen_set(data & 0x01); | |
| 122 | flip_screen_set(space->machine, data & 0x01); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | void redclash_set_stars_enable( UINT8 on ); //temp |
| r3957 | r3958 | |
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | static void draw_bullets(bitmap_t *bitmap, const rectangle *cliprect ) | |
| 263 | static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) | |
| 264 | 264 | { |
| 265 | 265 | int offs; |
| 266 | 266 | |
| r3957 | r3958 | |
| 270 | 270 | int sx = 8 * offs + (videoram[offs] & 0x07); /* ?? */ |
| 271 | 271 | int sy = 0xff - videoram[offs + 0x20]; |
| 272 | 272 | |
| 273 | if (flip_screen_get()) | |
| 273 | if (flip_screen_get(machine)) | |
| 274 | 274 | { |
| 275 | 275 | sx = 240 - sx; |
| 276 | 276 | } |
| r3957 | r3958 | |
| 424 | 424 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 425 | 425 | redclash_draw_stars(bitmap, cliprect, 0x60, 0, 0x00, 0xff); |
| 426 | 426 | draw_sprites(screen->machine, bitmap, cliprect); |
| 427 | draw_bullets(bitmap, cliprect); | |
| 427 | draw_bullets(screen->machine, bitmap, cliprect); | |
| 428 | 428 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 429 | 429 | return 0; |
| 430 | 430 | } |
| r3957 | r3958 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | /* bit 7 flips screen */ |
| 142 | 142 | |
| 143 | if (flip_screen_get() != (data & 0x80)) | |
| 143 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 144 | 144 | { |
| 145 | flip_screen_set(data & 0x80); | |
| 145 | flip_screen_set(space->machine, data & 0x80); | |
| 146 | 146 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 147 | 147 | } |
| 148 | 148 | } |
| r3957 | r3958 | |
| 248 | 248 | { |
| 249 | 249 | /* bit 0 flips screen */ |
| 250 | 250 | |
| 251 | if (flip_screen_get() != (data & 0x01)) | |
| 251 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 252 | 252 | { |
| 253 | flip_screen_set(data & 0x01); | |
| 253 | flip_screen_set(space->machine, data & 0x01); | |
| 254 | 254 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 255 | 255 | } |
| 256 | 256 |
| r3957 | r3958 | |
|---|---|---|
| 1245 | 1245 | { |
| 1246 | 1246 | int i, color; |
| 1247 | 1247 | |
| 1248 | if (flip_screen_x_get()) x++; | |
| 1248 | if (flip_screen_x_get(machine)) x++; | |
| 1249 | 1249 | |
| 1250 | 1250 | x = x - 6; |
| 1251 | 1251 | |
| r3957 | r3958 | |
| 1416 | 1416 | int col1 = base + dambustr_bg_color_1; |
| 1417 | 1417 | int col2 = base + dambustr_bg_color_2; |
| 1418 | 1418 | |
| 1419 | if (flip_screen_x_get()) | |
| 1419 | if (flip_screen_x_get(machine)) | |
| 1420 | 1420 | { |
| 1421 | 1421 | plot_box(bitmap, 0, 0, 256-dambustr_bg_split_line, 256, col2); |
| 1422 | 1422 | plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col1); |
| r3957 | r3958 | |
| 1429 | 1429 | |
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | static void dambustr_draw_upper_background(bitmap_t *bitmap, const rectangle *cliprect) | |
| 1432 | static void dambustr_draw_upper_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 1433 | 1433 | { |
| 1434 | 1434 | static rectangle clip = { 0, 0, 0, 0 }; |
| 1435 | 1435 | |
| 1436 | if (flip_screen_x_get()) | |
| 1436 | if (flip_screen_x_get(machine)) | |
| 1437 | 1437 | { |
| 1438 | 1438 | clip.min_x = 254 - dambustr_bg_split_line; |
| 1439 | 1439 | clip.max_x = dambustr_bg_split_line; |
| r3957 | r3958 | |
| 1892 | 1892 | if (dambustr_bg_priority) |
| 1893 | 1893 | { |
| 1894 | 1894 | /* draw the upper part of the background, as it has priority */ |
| 1895 | dambustr_draw_upper_background(bitmap, cliprect); | |
| 1895 | dambustr_draw_upper_background(screen->machine, bitmap, cliprect); | |
| 1896 | 1896 | |
| 1897 | 1897 | /* only rows with color code > 3 are stronger than the background */ |
| 1898 | 1898 | memset(dambustr_videoram2, 0x20, 0x0400); |
| r3957 | r3958 | |
|---|---|---|
| 175 | 175 | tilemap_mark_all_tiles_dirty(char_tilemap); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | flip_screen_set(data & 0x80); | |
| 178 | flip_screen_set(space->machine, data & 0x80); | |
| 179 | 179 | |
| 180 | 180 | spritepalettebank = (data & 0x20) >> 5; |
| 181 | 181 | pixelpalettebank = (data & 0x08) >> 3; |
| r3957 | r3958 | |
|---|---|---|
| 190 | 190 | inc = 1; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | if (flip_screen_get()) { | |
| 193 | if (flip_screen_get(machine)) { | |
| 194 | 194 | y=240-y; |
| 195 | 195 | x=240-x; |
| 196 | 196 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 215 | 215 | |
| 216 | 216 | /******************************************************************************/ |
| 217 | 217 | |
| 218 | static void custom_tilemap_draw(bitmap_t *bitmap, | |
| 218 | static void custom_tilemap_draw(running_machine *machine, | |
| 219 | bitmap_t *bitmap, | |
| 219 | 220 | const rectangle *cliprect, |
| 220 | 221 | tilemap *tilemap_ptr, |
| 221 | 222 | const UINT16 *rowscroll_ptr, |
| r3957 | r3958 | |
| 255 | 256 | doesn't affect any games. |
| 256 | 257 | */ |
| 257 | 258 | |
| 258 | if (flip_screen_get()) | |
| 259 | if (flip_screen_get(machine)) | |
| 259 | 260 | src_y = (src_bitmap->height - 256) - scrolly; |
| 260 | 261 | else |
| 261 | 262 | src_y = scrolly; |
| r3957 | r3958 | |
| 266 | 267 | else |
| 267 | 268 | src_x=scrollx; |
| 268 | 269 | |
| 269 | if (flip_screen_get()) | |
| 270 | if (flip_screen_get(machine)) | |
| 270 | 271 | src_x=(src_bitmap->width - 256) - src_x; |
| 271 | 272 | |
| 272 | 273 | for (x=0; x<=cliprect->max_x; x++) { |
| r3957 | r3958 | |
| 294 | 295 | |
| 295 | 296 | /******************************************************************************/ |
| 296 | 297 | |
| 297 | static void dec0_pf1_draw(bitmap_t *bitmap,const rectangle *cliprect,int flags) | |
| 298 | static void dec0_pf1_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags) | |
| 298 | 299 | { |
| 299 | 300 | switch (dec0_pf1_control_0[3]&0x3) { |
| 300 | 301 | case 0: /* 4x1 */ |
| 301 | custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_0,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags); | |
| 302 | custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_0,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags); | |
| 302 | 303 | break; |
| 303 | 304 | case 1: /* 2x2 */ |
| 304 | 305 | default: |
| 305 | custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_1,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags); | |
| 306 | custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_1,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags); | |
| 306 | 307 | break; |
| 307 | 308 | case 2: /* 1x4 */ |
| 308 | custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_2,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags); | |
| 309 | custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_2,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags); | |
| 309 | 310 | break; |
| 310 | 311 | }; |
| 311 | 312 | } |
| 312 | 313 | |
| 313 | static void dec0_pf2_draw(bitmap_t *bitmap,const rectangle *cliprect,int flags) | |
| 314 | static void dec0_pf2_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags) | |
| 314 | 315 | { |
| 315 | 316 | switch (dec0_pf2_control_0[3]&0x3) { |
| 316 | 317 | case 0: /* 4x1 */ |
| 317 | custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_0,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags); | |
| 318 | custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_0,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags); | |
| 318 | 319 | break; |
| 319 | 320 | case 1: /* 2x2 */ |
| 320 | 321 | default: |
| 321 | custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_1,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags); | |
| 322 | custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_1,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags); | |
| 322 | 323 | break; |
| 323 | 324 | case 2: /* 1x4 */ |
| 324 | custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_2,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags); | |
| 325 | custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_2,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags); | |
| 325 | 326 | break; |
| 326 | 327 | }; |
| 327 | 328 | } |
| 328 | 329 | |
| 329 | static void dec0_pf3_draw(bitmap_t *bitmap,const rectangle *cliprect,int flags) | |
| 330 | static void dec0_pf3_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags) | |
| 330 | 331 | { |
| 331 | 332 | switch (dec0_pf3_control_0[3]&0x3) { |
| 332 | 333 | case 0: /* 4x1 */ |
| 333 | custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_0,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags); | |
| 334 | custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_0,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags); | |
| 334 | 335 | break; |
| 335 | 336 | case 1: /* 2x2 */ |
| 336 | 337 | default: |
| 337 | custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_1,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags); | |
| 338 | custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_1,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags); | |
| 338 | 339 | break; |
| 339 | 340 | case 2: /* 1x4 */ |
| 340 | custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_2,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags); | |
| 341 | custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_2,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags); | |
| 341 | 342 | break; |
| 342 | 343 | }; |
| 343 | 344 | } |
| r3957 | r3958 | |
| 346 | 347 | |
| 347 | 348 | VIDEO_UPDATE( hbarrel ) |
| 348 | 349 | { |
| 349 | flip_screen_set(dec0_pf1_control_0[0]&0x80); | |
| 350 | flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80); | |
| 350 | 351 | |
| 351 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 352 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 352 | 353 | draw_sprites(screen->machine,bitmap,cliprect,0x08,0x08); |
| 353 | dec0_pf2_draw(bitmap,cliprect,0); | |
| 354 | dec0_pf2_draw(screen->machine,bitmap,cliprect,0); | |
| 354 | 355 | |
| 355 | 356 | /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */ |
| 356 | 357 | |
| 357 | 358 | draw_sprites(screen->machine,bitmap,cliprect,0x08,0x00); |
| 358 | dec0_pf1_draw(bitmap,cliprect,0); | |
| 359 | dec0_pf1_draw(screen->machine,bitmap,cliprect,0); | |
| 359 | 360 | return 0; |
| 360 | 361 | } |
| 361 | 362 | |
| r3957 | r3958 | |
| 363 | 364 | |
| 364 | 365 | VIDEO_UPDATE( baddudes ) |
| 365 | 366 | { |
| 366 | flip_screen_set(dec0_pf1_control_0[0]&0x80); | |
| 367 | flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80); | |
| 367 | 368 | |
| 368 | 369 | /* WARNING: inverted wrt Midnight Resistance */ |
| 369 | 370 | if ((dec0_pri & 0x01) == 0) |
| 370 | 371 | { |
| 371 | dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 372 | dec0_pf3_draw(bitmap,cliprect,0); | |
| 372 | dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 373 | dec0_pf3_draw(screen->machine,bitmap,cliprect,0); | |
| 373 | 374 | |
| 374 | 375 | if (dec0_pri & 2) |
| 375 | dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 376 | dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 376 | 377 | |
| 377 | 378 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); |
| 378 | 379 | |
| 379 | 380 | if (dec0_pri & 4) |
| 380 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 381 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 381 | 382 | } |
| 382 | 383 | else |
| 383 | 384 | { |
| 384 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 385 | dec0_pf2_draw(bitmap,cliprect,0); | |
| 385 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 386 | dec0_pf2_draw(screen->machine,bitmap,cliprect,0); | |
| 386 | 387 | |
| 387 | 388 | if (dec0_pri & 2) |
| 388 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 389 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 389 | 390 | |
| 390 | 391 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); |
| 391 | 392 | |
| 392 | 393 | if (dec0_pri & 4) |
| 393 | dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 394 | dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */ | |
| 394 | 395 | } |
| 395 | 396 | |
| 396 | dec0_pf1_draw(bitmap,cliprect,0); | |
| 397 | dec0_pf1_draw(screen->machine,bitmap,cliprect,0); | |
| 397 | 398 | return 0; |
| 398 | 399 | } |
| 399 | 400 | |
| r3957 | r3958 | |
| 403 | 404 | { |
| 404 | 405 | int trans; |
| 405 | 406 | |
| 406 | flip_screen_set(dec0_pf1_control_0[0]&0x80); | |
| 407 | flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80); | |
| 407 | 408 | |
| 408 | 409 | if (dec0_pri & 0x04) |
| 409 | 410 | trans = 0x08; |
| r3957 | r3958 | |
| 416 | 417 | /* Robocop uses it only for the title screen, so this might be just */ |
| 417 | 418 | /* completely wrong. The top 8 bits of the register might mean */ |
| 418 | 419 | /* something (they are 0x80 in midres, 0x00 here) */ |
| 419 | dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_DRAW_OPAQUE); | |
| 420 | dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_DRAW_OPAQUE); | |
| 420 | 421 | |
| 421 | 422 | if (dec0_pri & 0x02) |
| 422 | 423 | draw_sprites(screen->machine,bitmap,cliprect,0x08,trans); |
| 423 | 424 | |
| 424 | dec0_pf3_draw(bitmap,cliprect,0); | |
| 425 | dec0_pf3_draw(screen->machine,bitmap,cliprect,0); | |
| 425 | 426 | } |
| 426 | 427 | else |
| 427 | 428 | { |
| 428 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 429 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 429 | 430 | |
| 430 | 431 | if (dec0_pri & 0x02) |
| 431 | 432 | draw_sprites(screen->machine,bitmap,cliprect,0x08,trans); |
| 432 | 433 | |
| 433 | dec0_pf2_draw(bitmap,cliprect,0); | |
| 434 | dec0_pf2_draw(screen->machine,bitmap,cliprect,0); | |
| 434 | 435 | } |
| 435 | 436 | |
| 436 | 437 | if (dec0_pri & 0x02) |
| r3957 | r3958 | |
| 438 | 439 | else |
| 439 | 440 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); |
| 440 | 441 | |
| 441 | dec0_pf1_draw(bitmap,cliprect,0); | |
| 442 | dec0_pf1_draw(screen->machine,bitmap,cliprect,0); | |
| 442 | 443 | return 0; |
| 443 | 444 | } |
| 444 | 445 | |
| r3957 | r3958 | |
| 446 | 447 | |
| 447 | 448 | VIDEO_UPDATE( birdtry ) |
| 448 | 449 | { |
| 449 | flip_screen_set(dec0_pf1_control_0[0]&0x80); | |
| 450 | flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80); | |
| 450 | 451 | |
| 451 | 452 | /* This game doesn't have the extra playfield chip on the game board, but |
| 452 | 453 | the palette does show through. */ |
| 453 | 454 | bitmap_fill(bitmap,cliprect,screen->machine->pens[768]); |
| 454 | dec0_pf2_draw(bitmap,cliprect,0); | |
| 455 | dec0_pf2_draw(screen->machine,bitmap,cliprect,0); | |
| 455 | 456 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); |
| 456 | dec0_pf1_draw(bitmap,cliprect,0); | |
| 457 | dec0_pf1_draw(screen->machine,bitmap,cliprect,0); | |
| 457 | 458 | return 0; |
| 458 | 459 | } |
| 459 | 460 | |
| r3957 | r3958 | |
| 461 | 462 | |
| 462 | 463 | VIDEO_UPDATE( hippodrm ) |
| 463 | 464 | { |
| 464 | flip_screen_set(dec0_pf1_control_0[0]&0x80); | |
| 465 | flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80); | |
| 465 | 466 | |
| 466 | 467 | if (dec0_pri & 0x01) |
| 467 | 468 | { |
| 468 | dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 469 | dec0_pf3_draw(bitmap,cliprect,0); | |
| 469 | dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 470 | dec0_pf3_draw(screen->machine,bitmap,cliprect,0); | |
| 470 | 471 | } |
| 471 | 472 | else |
| 472 | 473 | { |
| 473 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 474 | dec0_pf2_draw(bitmap,cliprect,0); | |
| 474 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 475 | dec0_pf2_draw(screen->machine,bitmap,cliprect,0); | |
| 475 | 476 | } |
| 476 | 477 | |
| 477 | 478 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); |
| 478 | dec0_pf1_draw(bitmap,cliprect,0); | |
| 479 | dec0_pf1_draw(screen->machine,bitmap,cliprect,0); | |
| 479 | 480 | return 0; |
| 480 | 481 | } |
| 481 | 482 | |
| r3957 | r3958 | |
| 483 | 484 | |
| 484 | 485 | VIDEO_UPDATE( slyspy ) |
| 485 | 486 | { |
| 486 | flip_screen_set(dec0_pf1_control_0[0]&0x80); | |
| 487 | flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80); | |
| 487 | 488 | |
| 488 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 489 | dec0_pf2_draw(bitmap,cliprect,0); | |
| 489 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 490 | dec0_pf2_draw(screen->machine,bitmap,cliprect,0); | |
| 490 | 491 | |
| 491 | 492 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); |
| 492 | 493 | |
| 493 | 494 | /* Redraw top 8 pens of top 8 palettes over sprites */ |
| 494 | 495 | if (dec0_pri&0x80) |
| 495 | dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); | |
| 496 | dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); | |
| 496 | 497 | |
| 497 | dec0_pf1_draw(bitmap,cliprect,0); | |
| 498 | dec0_pf1_draw(screen->machine,bitmap,cliprect,0); | |
| 498 | 499 | return 0; |
| 499 | 500 | } |
| 500 | 501 | |
| r3957 | r3958 | |
| 504 | 505 | { |
| 505 | 506 | int trans; |
| 506 | 507 | |
| 507 | flip_screen_set(dec0_pf1_control_0[0]&0x80); | |
| 508 | flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80); | |
| 508 | 509 | |
| 509 | 510 | if (dec0_pri & 0x04) |
| 510 | 511 | trans = 0x00; |
| r3957 | r3958 | |
| 512 | 513 | |
| 513 | 514 | if (dec0_pri & 0x01) |
| 514 | 515 | { |
| 515 | dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 516 | dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 516 | 517 | |
| 517 | 518 | if (dec0_pri & 0x02) |
| 518 | 519 | draw_sprites(screen->machine,bitmap,cliprect,0x08,trans); |
| 519 | 520 | |
| 520 | dec0_pf3_draw(bitmap,cliprect,0); | |
| 521 | dec0_pf3_draw(screen->machine,bitmap,cliprect,0); | |
| 521 | 522 | } |
| 522 | 523 | else |
| 523 | 524 | { |
| 524 | dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 525 | dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE); | |
| 525 | 526 | |
| 526 | 527 | if (dec0_pri & 0x02) |
| 527 | 528 | draw_sprites(screen->machine,bitmap,cliprect,0x08,trans); |
| 528 | 529 | |
| 529 | dec0_pf2_draw(bitmap,cliprect,0); | |
| 530 | dec0_pf2_draw(screen->machine,bitmap,cliprect,0); | |
| 530 | 531 | } |
| 531 | 532 | |
| 532 | 533 | if (dec0_pri & 0x02) |
| r3957 | r3958 | |
| 534 | 535 | else |
| 535 | 536 | draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00); |
| 536 | 537 | |
| 537 | dec0_pf1_draw(bitmap,cliprect,0); | |
| 538 | dec0_pf1_draw(screen->machine,bitmap,cliprect,0); | |
| 538 | 539 | return 0; |
| 539 | 540 | } |
| 540 | 541 |
| r3957 | r3958 | |
|---|---|---|
| 154 | 154 | { |
| 155 | 155 | coin_counter_w(0,data & 1); |
| 156 | 156 | coin_counter_w(1,data & 2); |
| 157 | flip_screen_set(data & 4); | |
| 157 | flip_screen_set(space->machine, data & 4); | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
| r3957 | r3958 | |
| 185 | 185 | sx = (spriteram[offs+3] - 0x80) + 256 * (attr & 0x01); |
| 186 | 186 | sy = 240 - spriteram[offs]; |
| 187 | 187 | |
| 188 | if (flip_screen_get()) | |
| 188 | if (flip_screen_get(machine)) | |
| 189 | 189 | { |
| 190 | 190 | sx = 240 - sx; |
| 191 | 191 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | /* dirty both current and next offsets */ |
| 77 | 77 | tilemap_mark_tile_dirty(bg_tilemap, offset); |
| 78 | tilemap_mark_tile_dirty(bg_tilemap, (offset + (flip_screen_get() ? -1 : 1)) & 0x03ff); | |
| 78 | tilemap_mark_tile_dirty(bg_tilemap, (offset + (flip_screen_get(space->machine) ? -1 : 1)) & 0x03ff); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | WRITE8_HANDLER( hanaawas_portB_w ) |
| 82 | 82 | { |
| 83 | 83 | /* bit 7 is flip screen */ |
| 84 | if (flip_screen_get() != (~data & 0x80)) | |
| 84 | if (flip_screen_get(space->machine) != (~data & 0x80)) | |
| 85 | 85 | { |
| 86 | flip_screen_set(~data & 0x80); | |
| 86 | flip_screen_set(space->machine, ~data & 0x80); | |
| 87 | 87 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 88 | 88 | } |
| 89 | 89 | } |
| r3957 | r3958 | |
| 91 | 91 | static TILE_GET_INFO( get_bg_tile_info ) |
| 92 | 92 | { |
| 93 | 93 | /* the color is determined by the current color byte, but the bank is via the previous one!!! */ |
| 94 | int offset = (tile_index + (flip_screen_get() ? 1 : -1)) & 0x3ff; | |
| 94 | int offset = (tile_index + (flip_screen_get(machine) ? 1 : -1)) & 0x3ff; | |
| 95 | 95 | int attr = colorram[offset]; |
| 96 | 96 | int gfxbank = (attr & 0x40) >> 6; |
| 97 | 97 | int code = videoram[tile_index] + ((attr & 0x20) << 3); |
| r3957 | r3958 | |
|---|---|---|
| 681 | 681 | |
| 682 | 682 | gfxdata = base_gfx + (8*8*4/8) * (((attr & 0x000f) << 16) + code); |
| 683 | 683 | |
| 684 | if (flip_screen_get()) | |
| 684 | if (flip_screen_get(machine)) | |
| 685 | 685 | { |
| 686 | 686 | flipx = !flipx; x = max_x - x - width; |
| 687 | 687 | flipy = !flipy; y = max_y - y - height; |
| r3957 | r3958 | |
| 691 | 691 | { |
| 692 | 692 | /* prepare GfxElement on the fly */ |
| 693 | 693 | gfx_element gfx; |
| 694 | gfx.machine = machine; | |
| 694 | 695 | gfx.width = width; |
| 695 | 696 | gfx.height = height; |
| 696 | 697 | gfx.total_elements = 1; |
| r3957 | r3958 | |
| 703 | 704 | gfx.line_modulo = width; |
| 704 | 705 | gfx.char_modulo = 0; /* doesn't matter */ |
| 705 | 706 | gfx.flags = 0; |
| 707 | gfx.machine = machine; | |
| 706 | 708 | |
| 707 | 709 | /* Bounds checking */ |
| 708 | 710 | if ( (gfxdata + width * height - 1) >= gfx_max ) |
| r3957 | r3958 | |
| 721 | 723 | { |
| 722 | 724 | /* prepare GfxElement on the fly */ |
| 723 | 725 | gfx_element gfx; |
| 726 | gfx.machine = machine; | |
| 724 | 727 | gfx.width = width; |
| 725 | 728 | gfx.height = height; |
| 726 | 729 | gfx.total_elements = 1; |
| r3957 | r3958 | |
| 733 | 736 | gfx.line_modulo = width/2; |
| 734 | 737 | gfx.char_modulo = 0; /* doesn't matter */ |
| 735 | 738 | gfx.flags = GFX_ELEMENT_PACKED; |
| 739 | gfx.machine = machine; | |
| 736 | 740 | |
| 737 | 741 | /* Bounds checking */ |
| 738 | 742 | if ( (gfxdata + width/2 * height - 1) >= gfx_max ) |
| r3957 | r3958 | |
| 929 | 933 | ---- ---- ---- --1- ? Blank Screen |
| 930 | 934 | ---- ---- ---- ---0 Flip Screen */ |
| 931 | 935 | if (screenctrl & 2) return 0; |
| 932 | flip_screen_set(screenctrl & 1); | |
| 936 | flip_screen_set(screen->machine, screenctrl & 1); | |
| 933 | 937 | |
| 934 | 938 | /* If the game supports 16x16 tiles, make sure that the |
| 935 | 939 | 16x16 and 8x8 tilemaps of a given layer are not simultaneously |
| r3957 | r3958 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | WRITE8_HANDLER( circusc_flipscreen_w ) |
| 156 | 156 | { |
| 157 | flip_screen_set(data & 1); | |
| 157 | flip_screen_set(space->machine, data & 1); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
| r3957 | r3958 | |
| 185 | 185 | int flipx = sr[offs + 1] & 0x40; |
| 186 | 186 | int flipy = sr[offs + 1] & 0x80; |
| 187 | 187 | |
| 188 | if (flip_screen_get()) | |
| 188 | if (flip_screen_get(machine)) | |
| 189 | 189 | { |
| 190 | 190 | sx = 240 - sx; |
| 191 | 191 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | WRITE8_HANDLER( mikie_flipscreen_w ) |
| 115 | 115 | { |
| 116 | if (flip_screen_get() != (data & 0x01)) | |
| 116 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 117 | 117 | { |
| 118 | flip_screen_set(data & 0x01); | |
| 118 | flip_screen_set(space->machine, data & 0x01); | |
| 119 | 119 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 120 | 120 | } |
| 121 | 121 | } |
| r3957 | r3958 | |
| 149 | 149 | int flipx = ~spriteram[offs] & 0x10; |
| 150 | 150 | int flipy = spriteram[offs] & 0x20; |
| 151 | 151 | |
| 152 | if (flip_screen_get()) | |
| 152 | if (flip_screen_get(machine)) | |
| 153 | 153 | { |
| 154 | 154 | sy = 242 - sy; |
| 155 | 155 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 77 | 77 | VIDEO_START( midvunit ) |
| 78 | 78 | { |
| 79 | 79 | scanline_timer = timer_alloc(machine, scanline_timer_cb, NULL); |
| 80 | poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 80 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); | |
| 81 | 81 | add_exit_callback(machine, midvunit_exit); |
| 82 | 82 | |
| 83 | 83 | state_save_register_global_array(machine, video_regs); |
| r3957 | r3958 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | if (ACCESSING_BITS_0_7) |
| 67 | 67 | { |
| 68 | flip_screen_set( data & 1 ); | |
| 68 | flip_screen_set(space->machine, data & 1 ); | |
| 69 | 69 | color_bank = ( data & 4 ) >> 2; |
| 70 | 70 | } |
| 71 | 71 | if (data & ~(1|4)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(space->cpu), data); |
| r3957 | r3958 | |
| 75 | 75 | { |
| 76 | 76 | if (ACCESSING_BITS_0_7) |
| 77 | 77 | { |
| 78 | flip_screen_set( data & 0x10 ); | |
| 78 | flip_screen_set(space->machine, data & 0x10 ); | |
| 79 | 79 | // color_bank = ( data & 0x07 ); |
| 80 | 80 | } |
| 81 | 81 | if (data & ~(0x10)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(space->cpu), data); |
| r3957 | r3958 | |
| 182 | 182 | |
| 183 | 183 | if (flipx) tile_flipx = !tile_flipx; |
| 184 | 184 | |
| 185 | if (flip_screen_get()) | |
| 185 | if (flip_screen_get(machine)) | |
| 186 | 186 | { |
| 187 | 187 | sx = max_x - sx; |
| 188 | 188 | sy = max_y - sy; |
| r3957 | r3958 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | WRITE8_HANDLER( zaccaria_flip_screen_x_w ) |
| 190 | 190 | { |
| 191 | flip_screen_x_set(data & 1); | |
| 191 | flip_screen_x_set(space->machine, data & 1); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | WRITE8_HANDLER( zaccaria_flip_screen_y_w ) |
| 195 | 195 | { |
| 196 | flip_screen_y_set(data & 1); | |
| 196 | flip_screen_y_set(space->machine, data & 1); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| r3957 | r3958 | |
| 209 | 209 | int offs; |
| 210 | 210 | rectangle clip = *cliprect; |
| 211 | 211 | |
| 212 | if (flip_screen_x_get()) | |
| 212 | if (flip_screen_x_get(machine)) | |
| 213 | 213 | sect_rect(&clip, &spritevisiblearea_flipx); |
| 214 | 214 | else |
| 215 | 215 | sect_rect(&clip, &spritevisiblearea); |
| r3957 | r3958 | |
| 235 | 235 | int flipx = spriteram_2[offs + 2] & 0x40; |
| 236 | 236 | int flipy = spriteram_2[offs + 2] & 0x80; |
| 237 | 237 | |
| 238 | if (flip_screen_x_get()) | |
| 238 | if (flip_screen_x_get(machine)) | |
| 239 | 239 | { |
| 240 | 240 | sx = 240 - sx; |
| 241 | 241 | flipx = !flipx; |
| 242 | 242 | } |
| 243 | if (flip_screen_y_get()) | |
| 243 | if (flip_screen_y_get(machine)) | |
| 244 | 244 | { |
| 245 | 245 | sy = 240 - sy; |
| 246 | 246 | flipy = !flipy; |
| r3957 | r3958 | |
| 261 | 261 | int flipx = spriteram[offs + 1] & 0x40; |
| 262 | 262 | int flipy = spriteram[offs + 1] & 0x80; |
| 263 | 263 | |
| 264 | if (flip_screen_x_get()) | |
| 264 | if (flip_screen_x_get(machine)) | |
| 265 | 265 | { |
| 266 | 266 | sx = 240 - sx; |
| 267 | 267 | flipx = !flipx; |
| 268 | 268 | } |
| 269 | if (flip_screen_y_get()) | |
| 269 | if (flip_screen_y_get(machine)) | |
| 270 | 270 | { |
| 271 | 271 | sy = 240 - sy; |
| 272 | 272 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | flipx = flipy = 0; |
| 104 | 104 | |
| 105 | if(flip_screen_get()) | |
| 105 | if(flip_screen_get(machine)) | |
| 106 | 106 | { |
| 107 | 107 | x = 246 - x; |
| 108 | 108 | y = 238 - y; |
| r3957 | r3958 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | WRITE8_HANDLER( tagteam_flipscreen_w ) |
| 114 | 114 | { |
| 115 | if (flip_screen_get() != (data &0x01)) | |
| 115 | if (flip_screen_get(space->machine) != (data &0x01)) | |
| 116 | 116 | { |
| 117 | flip_screen_set(data & 0x01); | |
| 117 | flip_screen_set(space->machine, data & 0x01); | |
| 118 | 118 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 119 | 119 | } |
| 120 | 120 | } |
| r3957 | r3958 | |
| 149 | 149 | |
| 150 | 150 | if (!(videoram[offs] & 0x01)) continue; |
| 151 | 151 | |
| 152 | if (flip_screen_get()) | |
| 152 | if (flip_screen_get(machine)) | |
| 153 | 153 | { |
| 154 | 154 | sx = 240 - sx; |
| 155 | 155 | sy = 240 - sy; |
| r3957 | r3958 | |
| 168 | 168 | |
| 169 | 169 | code = videoram[offs + 0x20] + 256 * spritebank; |
| 170 | 170 | color = palettebank; |
| 171 | sy += (flip_screen_get() ? -256 : 256); | |
| 171 | sy += (flip_screen_get(machine) ? -256 : 256); | |
| 172 | 172 | |
| 173 | 173 | drawgfx(bitmap, machine->gfx[1], |
| 174 | 174 | code, color, |
| r3957 | r3958 | |
|---|---|---|
| 227 | 227 | case 30: return gtia.r.gtia1e; |
| 228 | 228 | |
| 229 | 229 | case 31: |
| 230 | gtia.r.cons = gtia.intf.console_read ? (gtia.intf.console_read() & 0x0F) : 0x00; | |
| 230 | gtia.r.cons = gtia.intf.console_read ? (gtia.intf.console_read(space) & 0x0F) : 0x00; | |
| 231 | 231 | return gtia.r.cons; |
| 232 | 232 | } |
| 233 | 233 | return 0xff; |
| r3957 | r3958 | |
| 752 | 752 | break; |
| 753 | 753 | gtia.w.cons = data; |
| 754 | 754 | if (gtia.intf.console_write) |
| 755 | gtia.intf.console_write(gtia.w.cons); | |
| 755 | gtia.intf.console_write(space, gtia.w.cons); | |
| 756 | 756 | break; |
| 757 | 757 | } |
| 758 | 758 | } |
| r3957 | r3958 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | WRITE8_HANDLER( bagman_flipscreen_w ) |
| 88 | 88 | { |
| 89 | if (flip_screen_get() != (data & 0x01)) | |
| 89 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 90 | 90 | { |
| 91 | flip_screen_set(data & 0x01); | |
| 91 | flip_screen_set(space->machine, data & 0x01); | |
| 92 | 92 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 93 | 93 | } |
| 94 | 94 | } |
| r3957 | r3958 | |
| 121 | 121 | sy = 240 - spriteram[offs + 2]; |
| 122 | 122 | flipx = spriteram[offs] & 0x40; |
| 123 | 123 | flipy = spriteram[offs] & 0x80; |
| 124 | if (flip_screen_x_get()) | |
| 124 | if (flip_screen_x_get(machine)) | |
| 125 | 125 | { |
| 126 | 126 | sx = 240 - sx +1; /* compensate misplacement */ |
| 127 | 127 | flipx = !flipx; |
| 128 | 128 | } |
| 129 | if (flip_screen_y_get()) | |
| 129 | if (flip_screen_y_get(machine)) | |
| 130 | 130 | { |
| 131 | 131 | sy = 240 - sy; |
| 132 | 132 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | typedef struct _gtia_interface gtia_interface; |
| 17 | 17 | struct _gtia_interface |
| 18 | 18 | { |
| 19 | UINT8 (*console_read)(void); | |
| 20 | void (*console_write)(UINT8 data); | |
| 19 | UINT8 (*console_read)(const address_space *space); | |
| 20 | void (*console_write)(const address_space *space, UINT8 data); | |
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | 23 |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 63 | 63 | |
| 64 | 64 | // bit 7 flips screen |
| 65 | flip_screen_set(data & 0x80); | |
| 65 | flip_screen_set(space->machine, data & 0x80); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 112 | 112 | int sx = buffered_spriteram[offs + 3] - ((attr & 0x01) << 8); |
| 113 | 113 | int sy = buffered_spriteram[offs + 2]; |
| 114 | 114 | |
| 115 | if (flip_screen_get()) | |
| 115 | if (flip_screen_get(machine)) | |
| 116 | 116 | { |
| 117 | 117 | sx = 240 - sx; |
| 118 | 118 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 368 | 368 | int const big = (sprptr[2] & 0x04) >> 2; |
| 369 | 369 | int x,y; |
| 370 | 370 | |
| 371 | if (flip_screen_get()) | |
| 371 | if (flip_screen_get(machine)) | |
| 372 | 372 | { |
| 373 | 373 | sx = 240 - 16*big - sx; |
| 374 | 374 | sy = 240 - 16*big - sy; |
| r3957 | r3958 | |
|---|---|---|
| 279 | 279 | WRITE8_HANDLER( m52_flipscreen_w ) |
| 280 | 280 | { |
| 281 | 281 | /* screen flip is handled both by software and hardware */ |
| 282 | flip_screen_set((data & 0x01) ^ (~input_port_read(space->machine, "DSW2") & 0x01)); | |
| 282 | flip_screen_set(space->machine, (data & 0x01) ^ (~input_port_read(space->machine, "DSW2") & 0x01)); | |
| 283 | 283 | |
| 284 | 284 | coin_counter_w(0, data & 0x02); |
| 285 | 285 | coin_counter_w(1, data & 0x20); |
| r3957 | r3958 | |
| 287 | 287 | |
| 288 | 288 | WRITE8_HANDLER( alpha1v_flipscreen_w ) |
| 289 | 289 | { |
| 290 | flip_screen_set(data & 0x01); | |
| 290 | flip_screen_set(space->machine, data & 0x01); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | |
| r3957 | r3958 | |
| 303 | 303 | rectangle rect; |
| 304 | 304 | const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen); |
| 305 | 305 | |
| 306 | if (flip_screen_get()) | |
| 306 | if (flip_screen_get(machine)) | |
| 307 | 307 | { |
| 308 | 308 | xpos = 255 - xpos; |
| 309 | 309 | ypos = 255 - ypos - BGHEIGHT; |
| r3957 | r3958 | |
| 316 | 316 | |
| 317 | 317 | drawgfx(bitmap, machine->gfx[image], |
| 318 | 318 | 0, 0, |
| 319 | flip_screen_get(), | |
| 320 | flip_screen_get(), | |
| 319 | flip_screen_get(machine), | |
| 320 | flip_screen_get(machine), | |
| 321 | 321 | xpos, |
| 322 | 322 | ypos, |
| 323 | 323 | cliprect, |
| r3957 | r3958 | |
| 325 | 325 | |
| 326 | 326 | drawgfx(bitmap, machine->gfx[image], |
| 327 | 327 | 0, 0, |
| 328 | flip_screen_get(), | |
| 329 | flip_screen_get(), | |
| 328 | flip_screen_get(machine), | |
| 329 | flip_screen_get(machine), | |
| 330 | 330 | xpos - 256, |
| 331 | 331 | ypos, |
| 332 | 332 | cliprect, |
| r3957 | r3958 | |
| 335 | 335 | rect.min_x = visarea->min_x; |
| 336 | 336 | rect.max_x = visarea->max_x; |
| 337 | 337 | |
| 338 | if (flip_screen_get()) | |
| 338 | if (flip_screen_get(machine)) | |
| 339 | 339 | { |
| 340 | 340 | rect.min_y = ypos - BGHEIGHT; |
| 341 | 341 | rect.max_y = ypos - 1; |
| r3957 | r3958 | |
| 375 | 375 | draw_background(screen->machine, bitmap, cliprect, bg1xpos, bg1ypos, 4); /* cityscape */ |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | tilemap_set_flip(bg_tilemap, flip_screen_get() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); | |
| 378 | tilemap_set_flip(bg_tilemap, flip_screen_get(screen->machine) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); | |
| 379 | 379 | |
| 380 | 380 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 381 | 381 | |
| r3957 | r3958 | |
| 399 | 399 | clip.min_y = 128, clip.max_y = 255; |
| 400 | 400 | |
| 401 | 401 | /* adjust for flipping */ |
| 402 | if (flip_screen_get()) | |
| 402 | if (flip_screen_get(screen->machine)) | |
| 403 | 403 | { |
| 404 | 404 | int temp = clip.min_y; |
| 405 | 405 | clip.min_y = 255 - clip.max_y; |
| r3957 | r3958 | |
|---|---|---|
| 110 | 110 | inc = 1; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | if (flip_screen_get()) { | |
| 113 | if (flip_screen_get(machine)) { | |
| 114 | 114 | y=240-y; |
| 115 | 115 | x=240-x; |
| 116 | 116 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 137 | 137 | |
| 138 | 138 | VIDEO_UPDATE( twocrude ) |
| 139 | 139 | { |
| 140 | flip_screen_set( !(deco16_pf12_control[0]&0x80) ); | |
| 140 | flip_screen_set(screen->machine, !(deco16_pf12_control[0]&0x80) ); | |
| 141 | 141 | |
| 142 | 142 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 143 | 143 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| r3957 | r3958 | |
|---|---|---|
| 135 | 135 | ****************************************************************************/ |
| 136 | 136 | |
| 137 | 137 | #include "driver.h" |
| 138 | #include "deprecat.h" | |
| 139 | 138 | #include "memconv.h" |
| 140 | 139 | #include "profiler.h" |
| 141 | 140 | #include "machine/atarigen.h" |
| r3957 | r3958 | |
| 214 | 213 | static void process_object_list(running_machine *machine, int vc, UINT16 *_scanline); |
| 215 | 214 | |
| 216 | 215 | /* from jagblit.c */ |
| 217 | static void generic_blitter(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 218 | static void blitter_09800001_010020_010020(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 219 | static void blitter_09800009_000020_000020(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 220 | static void blitter_01800009_000028_000028(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 221 | static void blitter_01800001_000018_000018(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 222 | static void blitter_01c00001_000018_000018(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 216 | static void generic_blitter(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 217 | static void blitter_09800001_010020_010020(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 218 | static void blitter_09800009_000020_000020(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 219 | static void blitter_01800009_000028_000028(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 220 | static void blitter_01800001_000018_000018(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 221 | static void blitter_01c00001_000018_000018(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 223 | 222 | |
| 224 | 223 | #ifdef MESS |
| 225 | static void blitter_00010000_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 226 | static void blitter_01800001_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 227 | static void blitter_x1800x01_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 224 | static void blitter_00010000_xxxxxx_xxxxxx(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 225 | static void blitter_01800001_xxxxxx_xxxxxx(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 226 | static void blitter_x1800x01_xxxxxx_xxxxxx(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags); | |
| 228 | 227 | #endif |
| 229 | 228 | |
| 230 | 229 | |
| r3957 | r3958 | |
| 478 | 477 | * |
| 479 | 478 | *************************************/ |
| 480 | 479 | |
| 481 | static UINT8 *get_jaguar_memory(UINT32 offset) | |
| 480 | static UINT8 *get_jaguar_memory(running_machine *machine, UINT32 offset) | |
| 482 | 481 | { |
| 483 | return memory_get_read_ptr(cpu_get_address_space( | |
| 482 | return memory_get_read_ptr(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), offset); | |
| 484 | 483 | } |
| 485 | 484 | |
| 486 | 485 | |
| r3957 | r3958 | |
| 491 | 490 | * |
| 492 | 491 | *************************************/ |
| 493 | 492 | |
| 494 | static void blitter_run( | |
| 493 | static void blitter_run(running_machine *machine) | |
| 495 | 494 | { |
| 496 | 495 | UINT32 command = blitter_regs[B_CMD] & STATIC_COMMAND_MASK; |
| 497 | 496 | UINT32 a1flags = blitter_regs[A1_FLAGS] & STATIC_FLAGS_MASK; |
| r3957 | r3958 | |
| 503 | 502 | { |
| 504 | 503 | if (command == 0x09800001 && a1flags == 0x010020) |
| 505 | 504 | { |
| 506 | blitter_09800001_010020_010020(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 505 | blitter_09800001_010020_010020(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 507 | 506 | return; |
| 508 | 507 | } |
| 509 | 508 | if (command == 0x09800009 && a1flags == 0x000020) |
| 510 | 509 | { |
| 511 | blitter_09800009_000020_000020(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 510 | blitter_09800009_000020_000020(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 512 | 511 | return; |
| 513 | 512 | } |
| 514 | 513 | if (command == 0x01800009 && a1flags == 0x000028) |
| 515 | 514 | { |
| 516 | blitter_01800009_000028_000028(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 515 | blitter_01800009_000028_000028(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 517 | 516 | return; |
| 518 | 517 | } |
| 519 | 518 | |
| 520 | 519 | if (command == 0x01800001 && a1flags == 0x000018) |
| 521 | 520 | { |
| 522 | blitter_01800001_000018_000018(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 521 | blitter_01800001_000018_000018(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 523 | 522 | return; |
| 524 | 523 | } |
| 525 | 524 | |
| 526 | 525 | if (command == 0x01c00001 && a1flags == 0x000018) |
| 527 | 526 | { |
| 528 | blitter_01c00001_000018_000018(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 527 | blitter_01c00001_000018_000018(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 529 | 528 | return; |
| 530 | 529 | } |
| 531 | 530 | } |
| r3957 | r3958 | |
| 533 | 532 | #ifdef MESS |
| 534 | 533 | if (command == 0x00010000) |
| 535 | 534 | { |
| 536 | blitter_00010000_xxxxxx_xxxxxx(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 535 | blitter_00010000_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 537 | 536 | return; |
| 538 | 537 | } |
| 539 | 538 | |
| 540 | 539 | if (command == 0x01800001) |
| 541 | 540 | { |
| 542 | blitter_01800001_xxxxxx_xxxxxx(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 541 | blitter_01800001_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 543 | 542 | return; |
| 544 | 543 | } |
| 545 | 544 | |
| 546 | 545 | if ((command & 0x0ffff0ff) == 0x01800001) |
| 547 | 546 | { |
| 548 | blitter_x1800x01_xxxxxx_xxxxxx(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 547 | blitter_x1800x01_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 549 | 548 | return; |
| 550 | 549 | } |
| 551 | 550 | #endif |
| r3957 | r3958 | |
| 585 | 584 | } |
| 586 | 585 | } |
| 587 | 586 | |
| 588 | generic_blitter(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 587 | generic_blitter(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]); | |
| 589 | 588 | profiler_mark(PROFILER_END); |
| 590 | 589 | } |
| 591 | 590 | |
| r3957 | r3958 | |
| 608 | 607 | { |
| 609 | 608 | COMBINE_DATA(&blitter_regs[offset]); |
| 610 | 609 | if (offset == B_CMD) |
| 611 | blitter_run(); | |
| 610 | blitter_run(space->machine); | |
| 612 | 611 | |
| 613 | 612 | if (LOG_BLITTER_WRITE) |
| 614 | 613 | logerror("%08X:Blitter write register @ F022%02X = %08X\n", cpu_get_previouspc(space->cpu), offset * 4, data); |
| r3957 | r3958 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | WRITE8_HANDLER( gng_flipscreen_w ) |
| 105 | 105 | { |
| 106 | flip_screen_set(~data & 1); | |
| 106 | flip_screen_set(space->machine, ~data & 1); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| r3957 | r3958 | |
| 128 | 128 | int flipx = attributes & 0x04; |
| 129 | 129 | int flipy = attributes & 0x08; |
| 130 | 130 | |
| 131 | if (flip_screen_get()) | |
| 131 | if (flip_screen_get(machine)) | |
| 132 | 132 | { |
| 133 | 133 | sx = 240 - sx; |
| 134 | 134 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | sheriff_color_mode = (data >> 3) & 3; |
| 29 | 29 | sheriff_color_data = (data >> 0) & 7; |
| 30 | 30 | |
| 31 | flip_screen_set_no_update(data & 0x20); | |
| 31 | flip_screen_set_no_update(space->machine, data & 0x20); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| r3957 | r3958 | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | static void helifire_next_line( | |
| 79 | static void helifire_next_line(running_machine *machine) | |
| 80 | 80 | { |
| 81 | 81 | helifire_mv++; |
| 82 | 82 | |
| r3957 | r3958 | |
| 86 | 86 | } |
| 87 | 87 | else |
| 88 | 88 | { |
| 89 | if (flip_screen_get()) | |
| 89 | if (flip_screen_get(machine)) | |
| 90 | 90 | { |
| 91 | 91 | helifire_mv %= 255; |
| 92 | 92 | } |
| r3957 | r3958 | |
| 107 | 107 | { |
| 108 | 108 | cannon_timer = timer_alloc(machine, spacefev_stop_red_cannon, NULL); |
| 109 | 109 | |
| 110 | flip_screen_set_no_update(0); | |
| 110 | flip_screen_set_no_update(machine, 0); | |
| 111 | 111 | |
| 112 | 112 | spacefev_red_screen = 0; |
| 113 | 113 | spacefev_red_cannon = 0; |
| r3957 | r3958 | |
| 116 | 116 | |
| 117 | 117 | VIDEO_START( sheriff ) |
| 118 | 118 | { |
| 119 | flip_screen_set_no_update(0); | |
| 119 | flip_screen_set_no_update(machine, 0); | |
| 120 | 120 | |
| 121 | 121 | sheriff_color_mode = 0; |
| 122 | 122 | sheriff_color_data = 0; |
| r3957 | r3958 | |
| 143 | 143 | helifire_LSFR[i] = data; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | flip_screen_set_no_update(0); | |
| 146 | flip_screen_set_no_update(machine, 0); | |
| 147 | 147 | |
| 148 | 148 | helifire_flash = 0; |
| 149 | 149 | } |
| r3957 | r3958 | |
| 151 | 151 | |
| 152 | 152 | VIDEO_UPDATE( spacefev ) |
| 153 | 153 | { |
| 154 | UINT8 mask = flip_screen_get() ? 0xff : 0x00; | |
| 154 | UINT8 mask = flip_screen_get(screen->machine) ? 0xff : 0x00; | |
| 155 | 155 | |
| 156 | 156 | int x; |
| 157 | 157 | int y; |
| r3957 | r3958 | |
| 222 | 222 | |
| 223 | 223 | VIDEO_UPDATE( sheriff ) |
| 224 | 224 | { |
| 225 | UINT8 mask = flip_screen_get() ? 0xff : 0x00; | |
| 225 | UINT8 mask = flip_screen_get(screen->machine) ? 0xff : 0x00; | |
| 226 | 226 | |
| 227 | 227 | const UINT8* pPROM = memory_region(screen->machine, "proms"); |
| 228 | 228 | |
| r3957 | r3958 | |
| 339 | 339 | |
| 340 | 340 | for (n = 0; n < 8; n++) |
| 341 | 341 | { |
| 342 | if (flip_screen_get()) | |
| 342 | if (flip_screen_get(screen->machine)) | |
| 343 | 343 | { |
| 344 | 344 | if ((videoram[offset ^ 0x1fff] << n) & 0x80) |
| 345 | 345 | { |
| r3957 | r3958 | |
| 358 | 358 | |
| 359 | 359 | /* next line */ |
| 360 | 360 | |
| 361 | helifire_next_line(); | |
| 361 | helifire_next_line(screen->machine); | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | helifire_mv = saved_mv; |
| r3957 | r3958 | |
| 400 | 400 | |
| 401 | 401 | for (i = 0; i < 256; i++) |
| 402 | 402 | { |
| 403 | helifire_next_line(); | |
| 403 | helifire_next_line(machine); | |
| 404 | 404 | } |
| 405 | 405 | } |
| r3957 | r3958 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | WRITE8_HANDLER( holeland_flipscreen_w ) |
| 99 | 99 | { |
| 100 | if (offset) flip_screen_y_set(data); | |
| 101 | else flip_screen_x_set(data); | |
| 100 | if (offset) flip_screen_y_set(space->machine, data); | |
| 101 | else flip_screen_x_set(space->machine, data); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| r3957 | r3958 | |
| 120 | 120 | flipx = spriteram[offs+3] & 0x04; |
| 121 | 121 | flipy = spriteram[offs+3] & 0x08; |
| 122 | 122 | |
| 123 | if (flip_screen_x_get()) | |
| 123 | if (flip_screen_x_get(machine)) | |
| 124 | 124 | { |
| 125 | 125 | flipx = !flipx; |
| 126 | 126 | sx = 240 - sx; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | if (flip_screen_y_get()) | |
| 129 | if (flip_screen_y_get(machine)) | |
| 130 | 130 | { |
| 131 | 131 | flipy = !flipy; |
| 132 | 132 | sy = 240 - sy; |
| r3957 | r3958 | |
| 158 | 158 | flipx = spriteram[offs+3] & 0x04; |
| 159 | 159 | flipy = spriteram[offs+3] & 0x08; |
| 160 | 160 | |
| 161 | if (flip_screen_x_get()) | |
| 161 | if (flip_screen_x_get(machine)) | |
| 162 | 162 | { |
| 163 | 163 | flipx = !flipx; |
| 164 | 164 | sx = 240 - sx; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | if (flip_screen_y_get()) | |
| 167 | if (flip_screen_y_get(machine)) | |
| 168 | 168 | { |
| 169 | 169 | flipy = !flipy; |
| 170 | 170 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 93 | 93 | tilemap_mark_all_tiles_dirty(background_tilemap); |
| 94 | 94 | } |
| 95 | 95 | background_disable=data&0x4; |
| 96 | flip_screen_set(data&0x1); | |
| 96 | flip_screen_set(space->machine, data&0x1); | |
| 97 | 97 | break; |
| 98 | 98 | case 7: /* Background palette resistors? */ |
| 99 | 99 | /* Todo */ |
| r3957 | r3958 | |
| 214 | 214 | |
| 215 | 215 | if (multi && fy==0) sy-=16; |
| 216 | 216 | |
| 217 | if (flip_screen_get()) { | |
| 217 | if (flip_screen_get(machine)) { | |
| 218 | 218 | sy=240-sy; |
| 219 | 219 | sx=240-sx; |
| 220 | 220 | if (fy) |
| r3957 | r3958 | |
| 275 | 275 | // if (multi) sy-=16; |
| 276 | 276 | if (fy && multi) { code2=code; code++; } |
| 277 | 277 | |
| 278 | if (flip_screen_get()) { | |
| 278 | if (flip_screen_get(machine)) { | |
| 279 | 279 | sy=240-sy; |
| 280 | 280 | sx=240-sx; |
| 281 | 281 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 331 | 331 | // if (multi) sy-=16; |
| 332 | 332 | if (fy && multi) { code2=code; code++; } |
| 333 | 333 | |
| 334 | if (flip_screen_get()) { | |
| 334 | if (flip_screen_get(machine)) { | |
| 335 | 335 | sy=240-sy; |
| 336 | 336 | sx=240-sx; |
| 337 | 337 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | UINT8 *rom = memory_region(space->machine, "main"); |
| 119 | 119 | |
| 120 | 120 | /* bit 0 = flip screen */ |
| 121 | flip_screen_set(data & 0x01); | |
| 121 | flip_screen_set(space->machine, data & 0x01); | |
| 122 | 122 | |
| 123 | 123 | /* bit 1 = ROM bank switch */ |
| 124 | 124 | memory_set_bankptr(space->machine, 1,rom + 0x10000 + 0x4000 * ((~data & 0x02) >> 1)); |
| r3957 | r3958 | |
| 179 | 179 | int dy = -16; |
| 180 | 180 | int cy; |
| 181 | 181 | |
| 182 | if (flip_screen_get()) | |
| 182 | if (flip_screen_get(machine)) | |
| 183 | 183 | { |
| 184 | 184 | sx = 240 - sx; |
| 185 | 185 | sy = 240 - sy; |
| r3957 | r3958 | |
| 198 | 198 | break; |
| 199 | 199 | |
| 200 | 200 | case 1: /* double y */ |
| 201 | if (flip_screen_get()) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; } | |
| 201 | if (flip_screen_get(machine)) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; } | |
| 202 | 202 | cy = sy + dy; |
| 203 | 203 | which &= ~1; |
| 204 | 204 | DRAW_SPRITE(0,sx,cy); |
| r3957 | r3958 | |
|---|---|---|
| 88 | 88 | /* bit 5 resets the sound CPU? - we ignore it */ |
| 89 | 89 | |
| 90 | 90 | /* bit 6 flips screen */ |
| 91 | flip_screen_set(data & 0x40); | |
| 91 | flip_screen_set(space->machine, data & 0x40); | |
| 92 | 92 | |
| 93 | 93 | /* bit 7 enables characters? */ |
| 94 | 94 | chon = data & 0x80; |
| r3957 | r3958 | |
| 167 | 167 | if (bank == 3) bank += sprite3bank; |
| 168 | 168 | code += 256 * bank; |
| 169 | 169 | |
| 170 | if (flip_screen_get()) | |
| 170 | if (flip_screen_get(machine)) | |
| 171 | 171 | { |
| 172 | 172 | sx = 240 - sx; |
| 173 | 173 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 361 | 361 | |
| 362 | 362 | if ((y & 1) ^ ((x >> 4) & 1)) |
| 363 | 363 | { |
| 364 | if (flip_screen_x_get()) | |
| 364 | if (flip_screen_x_get(screen->machine)) | |
| 365 | 365 | x = ~x; |
| 366 | 366 | |
| 367 | if (flip_screen_y_get()) | |
| 367 | if (flip_screen_y_get(screen->machine)) | |
| 368 | 368 | y = ~y; |
| 369 | 369 | |
| 370 | 370 | if ((y >= cliprect->min_y) && (y <= cliprect->max_y) && |
| r3957 | r3958 | |
|---|---|---|
| 123 | 123 | inc = 1; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | if (flip_screen_get()) { | |
| 126 | if (flip_screen_get(machine)) { | |
| 127 | 127 | x=304-x; |
| 128 | 128 | y=240-y; |
| 129 | 129 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 216 | 216 | inc = 1; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | if (flip_screen_get()) { | |
| 219 | if (flip_screen_get(machine)) { | |
| 220 | 220 | x=304-x; |
| 221 | 221 | y=240-y; |
| 222 | 222 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 394 | 394 | fx = (spriteptr[offs+0]&0x4000); |
| 395 | 395 | fy = (spriteptr[offs+0]&0x8000); |
| 396 | 396 | |
| 397 | if (!flip_screen_get()) { /* Inverted from Mutant Fighter! */ | |
| 397 | if (!flip_screen_get(machine)) { /* Inverted from Mutant Fighter! */ | |
| 398 | 398 | if (fx) fx=0; else fx=1; |
| 399 | 399 | if (fy) fy=0; else fy=1; |
| 400 | 400 | |
| r3957 | r3958 | |
| 439 | 439 | static void update_rohga(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr) |
| 440 | 440 | { |
| 441 | 441 | /* Update playfields */ |
| 442 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 442 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 443 | 443 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 444 | 444 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 445 | 445 | |
| r3957 | r3958 | |
| 496 | 496 | VIDEO_UPDATE( wizdfire ) |
| 497 | 497 | { |
| 498 | 498 | /* Update playfields */ |
| 499 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 499 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 500 | 500 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 501 | 501 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 502 | 502 | |
| r3957 | r3958 | |
| 525 | 525 | VIDEO_UPDATE( nitrobal ) |
| 526 | 526 | { |
| 527 | 527 | /* Update playfields */ |
| 528 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 528 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 529 | 529 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 530 | 530 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 531 | 531 |
| r3957 | r3958 | |
|---|---|---|
| 136 | 136 | int flipy = 0; |
| 137 | 137 | int dy = -16; |
| 138 | 138 | |
| 139 | if (flip_screen_get()) | |
| 139 | if (flip_screen_get(machine)) | |
| 140 | 140 | { |
| 141 | 141 | sx = 240 - sx; |
| 142 | 142 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | coin_counter_w(1,data & 1); |
| 81 | 81 | |
| 82 | 82 | /* bit 7 flips screen */ |
| 83 | if (flip_screen_get() != (data & 0x80)) | |
| 83 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 84 | 84 | { |
| 85 | flip_screen_set(data & 0x80); | |
| 85 | flip_screen_set(space->machine, data & 0x80); | |
| 86 | 86 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 87 | 87 | } |
| 88 | 88 | } |
| r3957 | r3958 | |
| 114 | 114 | sy = spriteram[offs + 8]; |
| 115 | 115 | flipx = spriteram[offs + 4] & 0x10; |
| 116 | 116 | flipy = spriteram[offs + 4] & 0x20; |
| 117 | if (flip_screen_get()) | |
| 117 | if (flip_screen_get(machine)) | |
| 118 | 118 | { |
| 119 | 119 | sx = 240 - sx; |
| 120 | 120 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 187 | 187 | |
| 188 | 188 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 189 | 189 | |
| 190 | flip_screen_set(data & 0x80); | |
| 190 | flip_screen_set(space->machine, data & 0x80); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | |
| r3957 | r3958 | |
| 213 | 213 | sx = spriteram[offs + 3] - 0x10 * (spriteram[offs + 1] & 0x10); |
| 214 | 214 | sy = spriteram[offs + 2]; |
| 215 | 215 | dir = 1; |
| 216 | if (flip_screen_get()) | |
| 216 | if (flip_screen_get(machine)) | |
| 217 | 217 | { |
| 218 | 218 | sx = 240 - sx; |
| 219 | 219 | sy = 240 - sy; |
| r3957 | r3958 | |
| 228 | 228 | { |
| 229 | 229 | drawgfx(bitmap,machine->gfx[2], |
| 230 | 230 | code + i,col, |
| 231 | flip_screen_get(),flip_screen_get(), | |
| 231 | flip_screen_get(machine),flip_screen_get(machine), | |
| 232 | 232 | sx,sy + 16 * i * dir, |
| 233 | 233 | cliprect,TRANSPARENCY_PEN,15); |
| 234 | 234 |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | WRITE8_HANDLER( bombjack_flipscreen_w ) |
| 37 | 37 | { |
| 38 | if (flip_screen_get() != (data & 0x01)) | |
| 38 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 39 | 39 | { |
| 40 | flip_screen_set(data & 0x01); | |
| 40 | flip_screen_set(space->machine, data & 0x01); | |
| 41 | 41 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 42 | 42 | } |
| 43 | 43 | } |
| r3957 | r3958 | |
| 106 | 106 | sy = 241-spriteram[offs+2]; |
| 107 | 107 | flipx = spriteram[offs+1] & 0x40; |
| 108 | 108 | flipy = spriteram[offs+1] & 0x80; |
| 109 | if (flip_screen_get()) | |
| 109 | if (flip_screen_get(machine)) | |
| 110 | 110 | { |
| 111 | 111 | if (spriteram[offs+1] & 0x20) |
| 112 | 112 | { |
| r3957 | r3958 | |
|---|---|---|
| 504 | 504 | x > cliprect->max_x) |
| 505 | 505 | return; |
| 506 | 506 | |
| 507 | if (flip_screen_x_get()) | |
| 507 | if (flip_screen_x_get(machine)) | |
| 508 | 508 | x = 255 - x; |
| 509 | 509 | |
| 510 | if (flip_screen_y_get()) | |
| 510 | if (flip_screen_y_get(machine)) | |
| 511 | 511 | y = 255 - y; |
| 512 | 512 | |
| 513 | 513 | if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x) % 0x144) == 0) |
| r3957 | r3958 | |
| 540 | 540 | int color = spriteram_2[offs + 1] & 0x3f; |
| 541 | 541 | int flipx = spriteram[offs] & 1; |
| 542 | 542 | int flipy = spriteram[offs] & 2; |
| 543 | if (flip_screen_get()) sx -= 2*displacement; | |
| 543 | if (flip_screen_get(machine)) sx -= 2*displacement; | |
| 544 | 544 | |
| 545 | 545 | pdrawgfx(bitmap,machine->gfx[1], |
| 546 | 546 | (spriteram[offs] & 0xfc) >> 2, |
| r3957 | r3958 | |
| 585 | 585 | |
| 586 | 586 | x = rallyx_radarx[offs] + ((~rallyx_radarattr[offs & 0x0f] & 0x01) << 8); |
| 587 | 587 | y = 253 - rallyx_radary[offs]; |
| 588 | if (flip_screen_get()) x -= 3; | |
| 588 | if (flip_screen_get(machine)) x -= 3; | |
| 589 | 589 | |
| 590 | 590 | drawgfx(bitmap,machine->gfx[2], |
| 591 | 591 | ((rallyx_radarattr[offs & 0x0f] & 0x0e) >> 1) ^ 0x07, |
| r3957 | r3958 | |
| 651 | 651 | the screen, and clip it to only the position where it is supposed to be shown */ |
| 652 | 652 | rectangle fg_clip = *cliprect; |
| 653 | 653 | rectangle bg_clip = *cliprect; |
| 654 | if (flip_screen_get()) | |
| 654 | if (flip_screen_get(screen->machine)) | |
| 655 | 655 | { |
| 656 | 656 | bg_clip.min_x = 8*8; |
| 657 | 657 | fg_clip.max_x = 8*8-1; |
| r3957 | r3958 | |
| 683 | 683 | the screen, and clip it to only the position where it is supposed to be shown */ |
| 684 | 684 | rectangle fg_clip = *cliprect; |
| 685 | 685 | rectangle bg_clip = *cliprect; |
| 686 | if (flip_screen_get()) | |
| 686 | if (flip_screen_get(screen->machine)) | |
| 687 | 687 | { |
| 688 | 688 | bg_clip.min_x = 8*8; |
| 689 | 689 | fg_clip.max_x = 8*8-1; |
| r3957 | r3958 | |
| 719 | 719 | the screen, and clip it to only the position where it is supposed to be shown */ |
| 720 | 720 | rectangle fg_clip = *cliprect; |
| 721 | 721 | rectangle bg_clip = *cliprect; |
| 722 | if (flip_screen_get()) | |
| 722 | if (flip_screen_get(screen->machine)) | |
| 723 | 723 | { |
| 724 | 724 | /* handle reduced visible area in some games */ |
| 725 | 725 | if (video_screen_get_visible_area(screen)->max_x == 32*8-1) |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | coin_counter_w(0, data & 0x0001); |
| 37 | 37 | coin_counter_w(1, data & 0x0004); |
| 38 | 38 | |
| 39 | flip_screen_set( data & 0x0080); | |
| 39 | flip_screen_set(space->machine, data & 0x0080); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if (ACCESSING_BITS_8_15) |
| r3957 | r3958 | |
| 262 | 262 | xdim = ((zoom & 0x00ff) >> 0) << (16-6+4); |
| 263 | 263 | ydim = ((zoom & 0xff00) >> 8) << (16-6+4); |
| 264 | 264 | |
| 265 | if (flip_screen_x_get()) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 266 | if (flip_screen_y_get()) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 265 | if (flip_screen_x_get(machine)) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 266 | if (flip_screen_y_get(machine)) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 267 | 267 | |
| 268 | 268 | if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; } |
| 269 | 269 | else { xstart = 0; xend = xnum; xinc = +1; } |
| r3957 | r3958 | |
| 424 | 424 | xdim = ((zoom & 0x00ff) >> 0) << (16-6+4); |
| 425 | 425 | ydim = ((zoom & 0xff00) >> 8) << (16-6+4); |
| 426 | 426 | |
| 427 | if (flip_screen_x_get()) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 428 | if (flip_screen_y_get()) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 427 | if (flip_screen_x_get(machine)) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 428 | if (flip_screen_y_get(machine)) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 429 | 429 | |
| 430 | 430 | if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; } |
| 431 | 431 | else { xstart = 0; xend = xnum; xinc = +1; } |
| r3957 | r3958 | |
|---|---|---|
| 179 | 179 | /* Add a starting point to the vector list. */ |
| 180 | 180 | clipped = adjust_xy(curx, cury, &adjx, &adjy); |
| 181 | 181 | if (!clipped) |
| 182 | vector_add_point(adjx, adjy, 0, 0); | |
| 182 | vector_add_point(machine, adjx, adjy, 0, 0); | |
| 183 | 183 | |
| 184 | 184 | /* Loop until we run out of time. */ |
| 185 | 185 | while (total_time > 0) |
| r3957 | r3958 | |
| 287 | 287 | { |
| 288 | 288 | /* if we're just becoming unclipped, add an empty point */ |
| 289 | 289 | if (!newclip) |
| 290 | vector_add_point(adjx, adjy, 0, 0); | |
| 290 | vector_add_point(machine, adjx, adjy, 0, 0); | |
| 291 | 291 | |
| 292 | 292 | /* otherwise, add a colored point */ |
| 293 | 293 | else |
| 294 | vector_add_point(adjx, adjy, color, intensity); | |
| 294 | vector_add_point(machine, adjx, adjy, color, intensity); | |
| 295 | 295 | } |
| 296 | 296 | clipped = newclip; |
| 297 | 297 | |
| r3957 | r3958 | |
| 301 | 301 | |
| 302 | 302 | /* We're done; if we are not clipped, add a final point. */ |
| 303 | 303 | if (!clipped) |
| 304 | vector_add_point(adjx, adjy, color, intensity); | |
| 304 | vector_add_point(machine, adjx, adjy, color, intensity); | |
| 305 | 305 | |
| 306 | 306 | /* if the high bit of the attribute is set, we break out of */ |
| 307 | 307 | /* this loop and fetch another symbol */ |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | code |= ((source[2] & 0x01) << 6); |
| 81 | 81 | code |= ((source[2] & 0x08) << 4); |
| 82 | 82 | |
| 83 | if(flip_screen_get()) | |
| 83 | if(flip_screen_get(machine)) | |
| 84 | 84 | { |
| 85 | 85 | flipx = !flipx; |
| 86 | 86 | flipy = !flipy; |
| r3957 | r3958 | |
| 174 | 174 | |
| 175 | 175 | draw_sprites(screen->machine,bitmap,cliprect); |
| 176 | 176 | |
| 177 | if(flip_screen_get()) | |
| 177 | if(flip_screen_get(screen->machine)) | |
| 178 | 178 | { |
| 179 | 179 | myclip.min_x = cliprect->min_x; |
| 180 | 180 | myclip.max_x = cliprect->min_x + 15; |
| r3957 | r3958 | |
| 211 | 211 | |
| 212 | 212 | WRITE8_HANDLER( flower_flipscreen_w ) |
| 213 | 213 | { |
| 214 | flip_screen_set(data); | |
| 214 | flip_screen_set(space->machine, data); | |
| 215 | 215 | } |
| r3957 | r3958 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | WRITE8_HANDLER( xain_flipscreen_w ) |
| 160 | 160 | { |
| 161 | flip_screen_set(data & 1); | |
| 161 | flip_screen_set(space->machine, data & 1); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| r3957 | r3958 | |
| 184 | 184 | sy = 240 - spriteram[offs]; |
| 185 | 185 | if (sy <= -7) sy += 256; |
| 186 | 186 | flipx = attr & 0x40; |
| 187 | if (flip_screen_get()) | |
| 187 | if (flip_screen_get(machine)) | |
| 188 | 188 | { |
| 189 | 189 | sx = 239 - sx; |
| 190 | 190 | sy = 240 - sy; |
| r3957 | r3958 | |
| 196 | 196 | drawgfx(bitmap,machine->gfx[3], |
| 197 | 197 | numtile, |
| 198 | 198 | color, |
| 199 | flipx,flip_screen_get(), | |
| 200 | sx-1,flip_screen_get() ? sy+16:sy-16, | |
| 199 | flipx,flip_screen_get(machine), | |
| 200 | sx-1,flip_screen_get(machine) ? sy+16:sy-16, | |
| 201 | 201 | cliprect,TRANSPARENCY_PEN,0); |
| 202 | 202 | drawgfx(bitmap,machine->gfx[3], |
| 203 | 203 | numtile+1, |
| 204 | 204 | color, |
| 205 | flipx,flip_screen_get(), | |
| 205 | flipx,flip_screen_get(machine), | |
| 206 | 206 | sx-1,sy, |
| 207 | 207 | cliprect,TRANSPARENCY_PEN,0); |
| 208 | 208 | } |
| r3957 | r3958 | |
| 211 | 211 | drawgfx(bitmap,machine->gfx[3], |
| 212 | 212 | numtile, |
| 213 | 213 | color, |
| 214 | flipx,flip_screen_get(), | |
| 214 | flipx,flip_screen_get(machine), | |
| 215 | 215 | sx,sy, |
| 216 | 216 | cliprect,TRANSPARENCY_PEN,0); |
| 217 | 217 | } |
| r3957 | r3958 | |
|---|---|---|
| 308 | 308 | sx += sprite_xoffs; |
| 309 | 309 | sy -= sprite_yoffs; |
| 310 | 310 | |
| 311 | if (flip_screen_get()) | |
| 311 | if (flip_screen_get(machine)) | |
| 312 | 312 | { |
| 313 | 313 | sx = -sx - sizex; |
| 314 | 314 | sy = -sy - sizey; |
| r3957 | r3958 | |
| 343 | 343 | rectangle new_clip = *cliprect; |
| 344 | 344 | |
| 345 | 345 | /* flip screen is embedded in the sprite control registers */ |
| 346 | /* can't use flip_screen_set() because the visible area is asymmetrical */ | |
| 347 | flip_screen_set_no_update(spriteram[0x07f6] & 1); | |
| 348 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 346 | /* can't use flip_screen_set(screen->machine, ) because the visible area is asymmetrical */ | |
| 347 | flip_screen_set_no_update(screen->machine, spriteram[0x07f6] & 1); | |
| 348 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 349 | 349 | |
| 350 | 350 | |
| 351 | 351 | /* background color */ |
| r3957 | r3958 | |
| 377 | 377 | scrollx = ( namcos1_playfield_control[j+1] + (namcos1_playfield_control[j+0]<<8) ) - disp_x[i]; |
| 378 | 378 | scrolly = ( namcos1_playfield_control[j+3] + (namcos1_playfield_control[j+2]<<8) ) + 8; |
| 379 | 379 | |
| 380 | if (flip_screen_get()) | |
| 380 | if (flip_screen_get(screen->machine)) | |
| 381 | 381 | { |
| 382 | 382 | scrollx = -scrollx; |
| 383 | 383 | scrolly = -scrolly; |
| r3957 | r3958 | |
|---|---|---|
| 201 | 201 | flipy = 0; |
| 202 | 202 | tile = (sprite_word[1] & 0xfff) + ((sprite_word[2] & 0x8000) >> 3); |
| 203 | 203 | |
| 204 | if (flip_screen_get()) { | |
| 204 | if (flip_screen_get(machine)) { | |
| 205 | 205 | x=240-x; |
| 206 | 206 | y=240-y; |
| 207 | 207 | if (flipx) flipx=0; else flipx=1; |
| r3957 | r3958 | |
| 283 | 283 | tilemap_set_scrollx( foreground_layer, 0, foreground_x_scroll ); |
| 284 | 284 | tilemap_set_scrolly( foreground_layer, 0, foreground_y_scroll ); |
| 285 | 285 | |
| 286 | flip_screen_set((toki_scrollram16[0x28]&0x8000)==0); | |
| 286 | flip_screen_set(screen->machine, (toki_scrollram16[0x28]&0x8000)==0); | |
| 287 | 287 | |
| 288 | 288 | if (toki_scrollram16[0x28]&0x100) { |
| 289 | 289 | tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_DRAW_OPAQUE,0); |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | if (fortyl_flipscreen != f) |
| 154 | 154 | { |
| 155 | 155 | fortyl_flipscreen = f; |
| 156 | flip_screen_set(fortyl_flipscreen); | |
| 156 | flip_screen_set(space->machine, fortyl_flipscreen); | |
| 157 | 157 | fortyl_pix_redraw = 1; |
| 158 | 158 | |
| 159 | 159 | for (offs=0;offs<32;offs++) |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | WRITE8_HANDLER( renegade_flipscreen_w ) |
| 29 | 29 | { |
| 30 | flip_screen_set(~data & 0x01); | |
| 30 | flip_screen_set(space->machine, ~data & 0x01); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | WRITE8_HANDLER( renegade_scroll0_w ) |
| r3957 | r3958 | |
| 94 | 94 | if (sx > 248) |
| 95 | 95 | sx -= 256; |
| 96 | 96 | |
| 97 | if (flip_screen_get()) | |
| 97 | if (flip_screen_get(machine)) | |
| 98 | 98 | { |
| 99 | 99 | sx = 240 - sx; |
| 100 | 100 | sy = 240 - sy; |
| r3957 | r3958 | |
| 107 | 107 | drawgfx(bitmap, machine->gfx[sprite_bank], |
| 108 | 108 | sprite_number + 1, |
| 109 | 109 | color, |
| 110 | xflip, flip_screen_get(), | |
| 111 | sx, sy + (flip_screen_get() ? -16 : 16), | |
| 110 | xflip, flip_screen_get(machine), | |
| 111 | sx, sy + (flip_screen_get(machine) ? -16 : 16), | |
| 112 | 112 | cliprect, TRANSPARENCY_PEN, 0); |
| 113 | 113 | } |
| 114 | 114 | else |
| 115 | 115 | { |
| 116 | sy += (flip_screen_get() ? -16 : 16); | |
| 116 | sy += (flip_screen_get(machine) ? -16 : 16); | |
| 117 | 117 | } |
| 118 | 118 | drawgfx(bitmap, machine->gfx[sprite_bank], |
| 119 | 119 | sprite_number, |
| 120 | 120 | color, |
| 121 | xflip, flip_screen_get(), | |
| 121 | xflip, flip_screen_get(machine), | |
| 122 | 122 | sx, sy, |
| 123 | 123 | cliprect, TRANSPARENCY_PEN, 0); |
| 124 | 124 | } |
| r3957 | r3958 | |
|---|---|---|
| 424 | 424 | int color = galaga_videoram[tile_index + 0x400] & 0x3f; |
| 425 | 425 | SET_TILE_INFO( |
| 426 | 426 | 0, |
| 427 | (galaga_videoram[tile_index] & 0x7f) | (flip_screen_get() ? 0x80 : 0) | (galaga_gfxbank << 8), | |
| 427 | (galaga_videoram[tile_index] & 0x7f) | (flip_screen_get(machine) ? 0x80 : 0) | (galaga_gfxbank << 8), | |
| 428 | 428 | color, |
| 429 | flip_screen_get() ? TILE_FLIPX : 0); | |
| 429 | flip_screen_get(machine) ? TILE_FLIPX : 0); | |
| 430 | 430 | tileinfo->group = color; |
| 431 | 431 | } |
| 432 | 432 | |
| r3957 | r3958 | |
| 519 | 519 | sy -= 16 * sizey; |
| 520 | 520 | sy = (sy & 0xff) - 32; // fix wraparound |
| 521 | 521 | |
| 522 | if (flip_screen_get()) | |
| 522 | if (flip_screen_get(machine)) | |
| 523 | 523 | { |
| 524 | 524 | flipx ^= 1; |
| 525 | 525 | flipy ^= 1; |
| r3957 | r3958 | |
|---|---|---|
| 231 | 231 | static WRITE8_HANDLER( lasso_flip_screen_w ) |
| 232 | 232 | { |
| 233 | 233 | /* don't know which is which, but they are always set together */ |
| 234 | flip_screen_x_set(data & 0x01); | |
| 235 | flip_screen_y_set( data & 0x02); | |
| 234 | flip_screen_x_set(space->machine, data & 0x01); | |
| 235 | flip_screen_y_set(space->machine, data & 0x02); | |
| 236 | 236 | |
| 237 | tilemap_set_flip(ALL_TILEMAPS, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) | | |
| 238 | (flip_screen_y_get() ? TILEMAP_FLIPY : 0)); | |
| 237 | tilemap_set_flip(ALL_TILEMAPS, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) | | |
| 238 | (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0)); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | |
| r3957 | r3958 | |
| 309 | 309 | flipx = source[1] & 0x40; |
| 310 | 310 | flipy = source[1] & 0x80; |
| 311 | 311 | |
| 312 | if (flip_screen_x_get()) | |
| 312 | if (flip_screen_x_get(machine)) | |
| 313 | 313 | { |
| 314 | 314 | sx = 240 - sx; |
| 315 | 315 | flipx = !flipx; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | if (flip_screen_y_get()) | |
| 318 | if (flip_screen_y_get(machine)) | |
| 319 | 319 | { |
| 320 | 320 | flipy = !flipy; |
| 321 | 321 | } |
| r3957 | r3958 | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | static void draw_lasso(bitmap_t *bitmap, const rectangle *cliprect) | |
| 343 | static void draw_lasso(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 344 | 344 | { |
| 345 | 345 | offs_t offs; |
| 346 | 346 | pen_t pen = 0x3f; |
| r3957 | r3958 | |
| 352 | 352 | UINT8 x; |
| 353 | 353 | UINT8 y = offs >> 5; |
| 354 | 354 | |
| 355 | if (flip_screen_y_get()) | |
| 355 | if (flip_screen_y_get(machine)) | |
| 356 | 356 | y = ~y; |
| 357 | 357 | |
| 358 | 358 | if ((y < cliprect->min_y) || (y > cliprect->max_y)) |
| r3957 | r3958 | |
| 361 | 361 | x = (offs & 0x1f) << 3; |
| 362 | 362 | data = lasso_bitmap_ram[offs]; |
| 363 | 363 | |
| 364 | if (flip_screen_x_get()) | |
| 364 | if (flip_screen_x_get(machine)) | |
| 365 | 365 | x = ~x; |
| 366 | 366 | |
| 367 | 367 | for (bit = 0; bit < 8; bit++) |
| r3957 | r3958 | |
| 369 | 369 | if ((data & 0x80) && (x >= cliprect->min_x) && (x <= cliprect->max_x)) |
| 370 | 370 | *BITMAP_ADDR16(bitmap, y, x) = pen; |
| 371 | 371 | |
| 372 | if (flip_screen_x_get()) | |
| 372 | if (flip_screen_x_get(machine)) | |
| 373 | 373 | x = x - 1; |
| 374 | 374 | else |
| 375 | 375 | x = x + 1; |
| r3957 | r3958 | |
| 386 | 386 | bitmap_fill(bitmap, cliprect, 0); |
| 387 | 387 | |
| 388 | 388 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 389 | draw_lasso(bitmap, cliprect); | |
| 389 | draw_lasso(screen->machine, bitmap, cliprect); | |
| 390 | 390 | draw_sprites(screen->machine, bitmap, cliprect, 0); |
| 391 | 391 | |
| 392 | 392 | return 0; |
| r3957 | r3958 | |
|---|---|---|
| 341 | 341 | if (attr & 0x01) sx -= 256; |
| 342 | 342 | if (attr & 0x04) sy -= 256; |
| 343 | 343 | |
| 344 | if (flip_screen_get()) | |
| 344 | if (flip_screen_get(machine)) | |
| 345 | 345 | { |
| 346 | 346 | sx = 224 - sx; |
| 347 | 347 | sy = 224 - sy; |
| r3957 | r3958 | |
| 366 | 366 | } |
| 367 | 367 | else |
| 368 | 368 | { |
| 369 | if (flip_screen_get()) | |
| 369 | if (flip_screen_get(machine)) | |
| 370 | 370 | DRAW_SPRITE(code, sx + 16, sy + 16) |
| 371 | 371 | else |
| 372 | 372 | DRAW_SPRITE(code, sx, sy) |
| r3957 | r3958 | |
| 423 | 423 | case 11: case 13: clip.max_x = sx1; break; |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | if (flip_screen_get()) | |
| 426 | if (flip_screen_get(machine)) | |
| 427 | 427 | { |
| 428 | 428 | int min_x,max_x,min_y,max_y; |
| 429 | 429 | min_x = 255 - clip.max_x; |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | WRITE8_HANDLER( mrjong_flipscreen_w ) |
| 82 | 82 | { |
| 83 | if (flip_screen_get() != (data & 0x01)) | |
| 83 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 84 | 84 | { |
| 85 | flip_screen_set(data & 0x01); | |
| 85 | flip_screen_set(space->machine, data & 0x01); | |
| 86 | 86 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 87 | 87 | } |
| 88 | 88 | } |
| r3957 | r3958 | |
| 119 | 119 | |
| 120 | 120 | sx = 224 - spriteram[offs + 2]; |
| 121 | 121 | sy = spriteram[offs + 0]; |
| 122 | if (flip_screen_get()) | |
| 122 | if (flip_screen_get(machine)) | |
| 123 | 123 | { |
| 124 | 124 | sx = 208 - sx; |
| 125 | 125 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "video/ppu2c0x.h" |
| 4 | 3 | #include "includes/vsnes.h" |
| 5 | 4 | |
| r3957 | r3958 | |
| 15 | 14 | ppu2c0x_init_palette(machine, 8*4*16 ); |
| 16 | 15 | } |
| 17 | 16 | |
| 18 | static void ppu_irq( int num, int *ppu_regs ) | |
| 17 | static void ppu_irq( running_machine *machine, int num, int *ppu_regs ) | |
| 19 | 18 | { |
| 20 | cpu_set_input_line( | |
| 19 | cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE ); | |
| 21 | 20 | } |
| 22 | 21 | |
| 23 | 22 | /* our ppu interface */ |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | /* bit 5 resets the sound CPU - we ignore it */ |
| 154 | 154 | |
| 155 | 155 | /* bit 6 flips screen */ |
| 156 | flip_screen_set(data & 0x40); | |
| 156 | flip_screen_set(space->machine, data & 0x40); | |
| 157 | 157 | |
| 158 | 158 | /* bit 7 enables characters */ |
| 159 | 159 | chon = data & 0x80; |
| r3957 | r3958 | |
| 234 | 234 | int sx = spriteram[offs + 3] - ((attr & 0x10) << 4); |
| 235 | 235 | int sy = spriteram[offs + 2]; |
| 236 | 236 | |
| 237 | if (flip_screen_get()) | |
| 237 | if (flip_screen_get(machine)) | |
| 238 | 238 | { |
| 239 | 239 | sx = 240 - sx; |
| 240 | 240 | sy = 240 - sy; |
| r3957 | r3958 | |
| 245 | 245 | { |
| 246 | 246 | if (color != 0x0a && color != 0x0b) |
| 247 | 247 | { |
| 248 | drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(), flip_screen_get(), | |
| 248 | drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), | |
| 249 | 249 | sx, sy, cliprect, TRANSPARENCY_PEN, 0); |
| 250 | 250 | } |
| 251 | 251 | } |
| r3957 | r3958 | |
| 253 | 253 | { |
| 254 | 254 | if (color == 0x0a || color == 0x0b) |
| 255 | 255 | { |
| 256 | drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(), flip_screen_get(), | |
| 256 | drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), | |
| 257 | 257 | sx, sy, cliprect, TRANSPARENCY_PEN, 0); |
| 258 | 258 | } |
| 259 | 259 | } |
| r3957 | r3958 | |
|---|---|---|
| 309 | 309 | sprite &= ~sizex; |
| 310 | 310 | sprite &= ~(sizey << 1); |
| 311 | 311 | |
| 312 | if (flip_screen_get()) | |
| 312 | if (flip_screen_get(machine)) | |
| 313 | 313 | { |
| 314 | 314 | flipx ^= 1; |
| 315 | 315 | flipy ^= 1; |
| r3957 | r3958 | |
| 379 | 379 | int row; |
| 380 | 380 | |
| 381 | 381 | for (row = 5; row < 29; row++) |
| 382 | tilemap_set_scrollx(fg_tilemap, row, flip_screen_get() ? scroll0-7 : scroll0); | |
| 383 | tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? scroll1-4 : scroll1-3); | |
| 382 | tilemap_set_scrollx(fg_tilemap, row, flip_screen_get(screen->machine) ? scroll0-7 : scroll0); | |
| 383 | tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get(screen->machine) ? scroll1-4 : scroll1-3); | |
| 384 | 384 | |
| 385 | 385 | /* draw high priority sprite pixels, setting priority bitmap to non-zero |
| 386 | 386 | wherever there is a high-priority pixel; note that we draw to the bitmap |
| r3957 | r3958 | |
|---|---|---|
| 196 | 196 | inc = 1; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | if (flip_screen_get()) { | |
| 199 | if (flip_screen_get(machine)) { | |
| 200 | 200 | y=240-y; |
| 201 | 201 | x=240-x; |
| 202 | 202 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 264 | 264 | inc = 1; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | if (flip_screen_get()) { | |
| 267 | if (flip_screen_get(machine)) { | |
| 268 | 268 | y=240-y; |
| 269 | 269 | x=304-x; |
| 270 | 270 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 354 | 354 | fx = (spriteptr[offs+0]&0x4000); |
| 355 | 355 | fy = (spriteptr[offs+0]&0x8000); |
| 356 | 356 | |
| 357 | if (flip_screen_get()) { | |
| 357 | if (flip_screen_get(machine)) { | |
| 358 | 358 | if (fx) fx=0; else fx=1; |
| 359 | 359 | if (fy) fy=0; else fy=1; |
| 360 | 360 | |
| r3957 | r3958 | |
| 397 | 397 | |
| 398 | 398 | VIDEO_UPDATE( cninja ) |
| 399 | 399 | { |
| 400 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 400 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 401 | 401 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 402 | 402 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 403 | 403 | |
| r3957 | r3958 | |
| 415 | 415 | |
| 416 | 416 | VIDEO_UPDATE( edrandy ) |
| 417 | 417 | { |
| 418 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 418 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 419 | 419 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 420 | 420 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 421 | 421 | |
| r3957 | r3958 | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /* Update playfields */ |
| 449 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 449 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 450 | 450 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 451 | 451 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 452 | 452 | |
| r3957 | r3958 | |
| 482 | 482 | |
| 483 | 483 | VIDEO_UPDATE( mutantf ) |
| 484 | 484 | { |
| 485 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 485 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 486 | 486 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 487 | 487 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 488 | 488 |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | if (flipon != (data & 0x80)) |
| 71 | 71 | { |
| 72 | 72 | flipon = data & 0x80; |
| 73 | flip_screen_set(flipon); | |
| 73 | flip_screen_set(space->machine, flipon); | |
| 74 | 74 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 75 | 75 | } |
| 76 | 76 | } |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | READ8_HANDLER( jack_flipscreen_r ) |
| 32 | 32 | { |
| 33 | flip_screen_set(offset); | |
| 33 | flip_screen_set(space->machine, offset); | |
| 34 | 34 | return 0; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | WRITE8_HANDLER( jack_flipscreen_w ) |
| 38 | 38 | { |
| 39 | flip_screen_set(offset); | |
| 39 | flip_screen_set(space->machine, offset); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 73 | 73 | flipx = (spriteram[offs + 3] & 0x80); |
| 74 | 74 | flipy = (spriteram[offs + 3] & 0x40); |
| 75 | 75 | |
| 76 | if (flip_screen_get()) | |
| 76 | if (flip_screen_get(machine)) | |
| 77 | 77 | { |
| 78 | 78 | sx = 248 - sx; |
| 79 | 79 | sy = 248 - sy; |
| r3957 | r3958 | |
| 154 | 154 | flipx = (spriteram[offs + 3] & 0x80); |
| 155 | 155 | flipy = (spriteram[offs + 3] & 0x40); |
| 156 | 156 | |
| 157 | if (flip_screen_get()) | |
| 157 | if (flip_screen_get(machine)) | |
| 158 | 158 | { |
| 159 | 159 | sx = 248 - sx; |
| 160 | 160 | sy = 248 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | inc = 1; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | if (flip_screen_get()) | |
| 59 | if (flip_screen_get(machine)) | |
| 60 | 60 | { |
| 61 | 61 | y=240-y; |
| 62 | 62 | x=304-x; |
| r3957 | r3958 | |
| 87 | 87 | |
| 88 | 88 | VIDEO_UPDATE(tumblep) |
| 89 | 89 | { |
| 90 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 90 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 91 | 91 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 92 | 92 | |
| 93 | 93 | bitmap_fill(bitmap,cliprect,256); /* not verified */ |
| r3957 | r3958 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | for (i = 0;i < 3;i++) |
| 130 | 130 | color |= ((bitmapram[offset + BITMAPRAM_SIZE/3 * i] >> subx) & 1) << i; |
| 131 | if (flip_screen_get()) | |
| 131 | if (flip_screen_get(space->machine)) | |
| 132 | 132 | *BITMAP_ADDR16(pixbitmap, y^0xff, (x+subx)^0xff) = PIXMAP_COLOR_BASE + 8*pixcolor + color; |
| 133 | 133 | else |
| 134 | 134 | *BITMAP_ADDR16(pixbitmap, y, x+subx) = PIXMAP_COLOR_BASE + 8*pixcolor + color; |
| r3957 | r3958 | |
| 172 | 172 | coin_counter_w(1,data & 0x20); |
| 173 | 173 | |
| 174 | 174 | /* bit 7 is screen flip */ |
| 175 | flip_screen_set(data & 0x80); | |
| 175 | flip_screen_set(space->machine, data & 0x80); | |
| 176 | 176 | |
| 177 | 177 | /* other bits unused? */ |
| 178 | 178 | logerror("PC %04x: 1800 = %02x\n",cpu_get_pc(space->cpu),data); |
| r3957 | r3958 | |
| 199 | 199 | sy = (240 - spriteram[offs+2]) & 0xff; |
| 200 | 200 | flipx = spriteram[offs] & 0x04; |
| 201 | 201 | flipy = spriteram[offs] & 0x02; |
| 202 | if (flip_screen_get()) | |
| 202 | if (flip_screen_get(machine)) | |
| 203 | 203 | { |
| 204 | 204 | sx = 240 - sx; |
| 205 | 205 | sy = 240 - sy; |
| r3957 | r3958 | |
| 224 | 224 | int offs; |
| 225 | 225 | |
| 226 | 226 | |
| 227 | if (lastflip != flip_screen_get() || lastpixcolor != pixcolor) | |
| 227 | if (lastflip != flip_screen_get(screen->machine) || lastpixcolor != pixcolor) | |
| 228 | 228 | { |
| 229 | 229 | const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 230 | 230 | |
| 231 | lastflip = flip_screen_get(); | |
| 231 | lastflip = flip_screen_get(screen->machine); | |
| 232 | 232 | lastpixcolor = pixcolor; |
| 233 | 233 | |
| 234 | 234 | for (offs = 0;offs < BITMAPRAM_SIZE;offs++) |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | inc = 1; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | if (flip_screen_get()) | |
| 44 | if (flip_screen_get(machine)) | |
| 45 | 45 | { |
| 46 | 46 | y=240-y; |
| 47 | 47 | x=304-x; |
| r3957 | r3958 | |
| 80 | 80 | |
| 81 | 81 | VIDEO_UPDATE(dietgo) |
| 82 | 82 | { |
| 83 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 83 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 84 | 84 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 85 | 85 | |
| 86 | 86 | bitmap_fill(bitmap,cliprect,256); /* not verified */ |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | **************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "deprecat.h" | |
| 16 | 15 | #include "avgdvg.h" |
| 17 | 16 | #include "video/vector.h" |
| 18 | 17 | |
| r3957 | r3958 | |
| 69 | 68 | |
| 70 | 69 | typedef struct _vgdata |
| 71 | 70 | { |
| 71 | running_machine *machine; | |
| 72 | ||
| 72 | 73 | UINT16 pc; |
| 73 | 74 | UINT8 sp; |
| 74 | 75 | UINT16 dvx; |
| r3957 | r3958 | |
| 167 | 168 | * |
| 168 | 169 | *************************************/ |
| 169 | 170 | |
| 170 | static void vg_flush ( | |
| 171 | static void vg_flush (running_machine *machine) | |
| 171 | 172 | { |
| 172 | 173 | int i; |
| 173 | 174 | |
| 174 | 175 | for (i = 0; i < nvect; i++) |
| 175 | 176 | { |
| 176 | 177 | if (vectbuf[i].status == VGVECTOR) |
| 177 | vector_add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, vectbuf[i].intensity); | |
| 178 | vector_add_point(machine, vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, vectbuf[i].intensity); | |
| 178 | 179 | |
| 179 | 180 | if (vectbuf[i].status == VGCLIP) |
| 180 | 181 | vector_add_clip(vectbuf[i].x, vectbuf[i].y, vectbuf[i].arg1, vectbuf[i].arg2); |
| r3957 | r3958 | |
| 475 | 476 | |
| 476 | 477 | if (vg->pc & 0x2000) |
| 477 | 478 | { |
| 478 | bank = &memory_region( | |
| 479 | bank = &memory_region(vg->machine, "alpha")[0x18000]; | |
| 479 | 480 | vg->data = bank[(vg->map << 13) | ((vg->pc ^ 1) & 0x1fff)]; |
| 480 | 481 | } |
| 481 | 482 | else |
| r3957 | r3958 | |
| 751 | 752 | */ |
| 752 | 753 | |
| 753 | 754 | vector_clear_list(); |
| 754 | vg_flush(); | |
| 755 | vg_flush(vg->machine); | |
| 755 | 756 | } |
| 756 | 757 | } |
| 757 | 758 | else |
| r3957 | r3958 | |
| 804 | 805 | | ((vg->dvy >> 1) & 2) |
| 805 | 806 | | ((vg->dvy << 1) & 4) |
| 806 | 807 | | ((vg->dvy << 2) & 8) |
| 807 | | ((mame_rand( | |
| 808 | | ((mame_rand(vg->machine) & 0x7) << 4); | |
| 808 | 809 | } |
| 809 | 810 | else |
| 810 | 811 | { |
| r3957 | r3958 | |
| 1240 | 1241 | */ |
| 1241 | 1242 | vector_clear_list(); |
| 1242 | 1243 | } |
| 1243 | vg_flush(); | |
| 1244 | vg_flush(space->machine); | |
| 1244 | 1245 | |
| 1245 | 1246 | vgc->vggo(vg); |
| 1246 | 1247 | vg_set_halt(0); |
| r3957 | r3958 | |
| 1454 | 1455 | { |
| 1455 | 1456 | const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen); |
| 1456 | 1457 | |
| 1458 | vg = &vgd; | |
| 1459 | vg->machine = machine; | |
| 1460 | ||
| 1457 | 1461 | xmin = visarea->min_x; |
| 1458 | 1462 | ymin = visarea->min_y; |
| 1459 | 1463 | xmax = visarea->max_x; |
| r3957 | r3958 | |
| 1485 | 1489 | |
| 1486 | 1490 | vgc = &dvg_default; |
| 1487 | 1491 | vg = &vgd; |
| 1492 | vg->machine = machine; | |
| 1488 | 1493 | |
| 1489 | 1494 | xmin = visarea->min_x; |
| 1490 | 1495 | ymin = visarea->min_y; |
| r3957 | r3958 | |
| 1499 | 1504 | VIDEO_START( avg ) |
| 1500 | 1505 | { |
| 1501 | 1506 | vgc = &avg_default; |
| 1502 | vg = &vgd; | |
| 1503 | 1507 | VIDEO_START_CALL(avg_common); |
| 1504 | 1508 | } |
| 1505 | 1509 | |
| 1506 | 1510 | VIDEO_START( avg_starwars ) |
| 1507 | 1511 | { |
| 1508 | 1512 | vgc = &avg_starwars; |
| 1509 | vg = &vgd; | |
| 1510 | 1513 | VIDEO_START_CALL(avg_common); |
| 1511 | 1514 | } |
| 1512 | 1515 | |
| 1513 | 1516 | VIDEO_START( avg_tempest ) |
| 1514 | 1517 | { |
| 1515 | 1518 | vgc = &avg_tempest; |
| 1516 | vg = &vgd; | |
| 1517 | 1519 | VIDEO_START_CALL(avg_common); |
| 1518 | 1520 | } |
| 1519 | 1521 | |
| 1520 | 1522 | VIDEO_START( avg_mhavoc ) |
| 1521 | 1523 | { |
| 1522 | 1524 | vgc = &avg_mhavoc; |
| 1523 | vg = &vgd; | |
| 1524 | 1525 | VIDEO_START_CALL(avg_common); |
| 1525 | 1526 | } |
| 1526 | 1527 | |
| 1527 | 1528 | VIDEO_START( avg_bzone ) |
| 1528 | 1529 | { |
| 1529 | 1530 | vgc = &avg_bzone; |
| 1530 | vg = &vgd; | |
| 1531 | 1531 | VIDEO_START_CALL(avg_common); |
| 1532 | 1532 | } |
| 1533 | 1533 | |
| 1534 | 1534 | VIDEO_START( avg_quantum ) |
| 1535 | 1535 | { |
| 1536 | 1536 | vgc = &avg_quantum; |
| 1537 | vg = &vgd; | |
| 1538 | 1537 | VIDEO_START_CALL(avg_common); |
| 1539 | 1538 | } |
| 1540 | 1539 |
| r3957 | r3958 | |
|---|---|---|
| 174 | 174 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | if (flip_screen_get() != (data & 0x80)) | |
| 177 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 178 | 178 | { |
| 179 | flip_screen_set(data & 0x80); | |
| 179 | flip_screen_set(space->machine, data & 0x80); | |
| 180 | 180 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 181 | 181 | } |
| 182 | 182 | } |
| r3957 | r3958 | |
| 229 | 229 | sx = spriteram[roffs+1]; |
| 230 | 230 | sy = spriteram[roffs]; |
| 231 | 231 | |
| 232 | if (flip_screen_get()) | |
| 232 | if (flip_screen_get(machine)) | |
| 233 | 233 | { |
| 234 | 234 | sx = 240 - sx; |
| 235 | 235 | sy = 240 - sy; |
| r3957 | r3958 | |
| 289 | 289 | int sx = spriteram[offs+2]; |
| 290 | 290 | int sy = spriteram[offs]; |
| 291 | 291 | |
| 292 | if (flip_screen_get()) | |
| 292 | if (flip_screen_get(machine)) | |
| 293 | 293 | { |
| 294 | 294 | sx = 240 - sx; |
| 295 | 295 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | WRITE16_HANDLER( blockout_videoram_w ) |
| 93 | 93 | { |
| 94 | UINT16 oldword = blockout_videoram[offset]; | |
| 95 | 94 | COMBINE_DATA(&blockout_videoram[offset]); |
| 96 | 95 | |
| 97 | if (oldword != blockout_videoram[offset]) | |
| 98 | update_pixels(space->machine->primary_screen, (offset % 256)*2, (offset / 256) % 256); | |
| 96 | update_pixels(space->machine->primary_screen, (offset % 256)*2, (offset / 256) % 256); | |
| 99 | 97 | } |
| 100 | 98 | |
| 101 | 99 |
| r3957 | r3958 | |
|---|---|---|
| 173 | 173 | /* So I'm using this specific check. -kal 11 jul 2002 */ |
| 174 | 174 | // if(sprite_type == 1) sy=sy+2; |
| 175 | 175 | |
| 176 | if( flip_screen_get() ) | |
| 176 | if( flip_screen_get(machine) ) | |
| 177 | 177 | { |
| 178 | 178 | drawgfx( bitmap,gfx, |
| 179 | 179 | sprite_number&0x7f, |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | x = dx; |
| 31 | 31 | y = dy; |
| 32 | 32 | |
| 33 | if (flip_screen_get()) | |
| 33 | if (flip_screen_get(screen->machine)) | |
| 34 | 34 | { |
| 35 | 35 | sx = 240 - x; |
| 36 | 36 | sy = 240 - y; |
| r3957 | r3958 | |
| 62 | 62 | x = dx; |
| 63 | 63 | y = dy; |
| 64 | 64 | |
| 65 | if (flip_screen_get()) | |
| 65 | if (flip_screen_get(screen->machine)) | |
| 66 | 66 | { |
| 67 | 67 | sx = 240 - x; |
| 68 | 68 | sy = 240 - y; |
| r3957 | r3958 | |
| 117 | 117 | x = dx; |
| 118 | 118 | y = dy; |
| 119 | 119 | |
| 120 | if (flip_screen_get()) | |
| 120 | if (flip_screen_get(screen->machine)) | |
| 121 | 121 | { |
| 122 | 122 | sx = 240 - x; |
| 123 | 123 | sy = 240 - y; |
| r3957 | r3958 | |
| 165 | 165 | |
| 166 | 166 | if (wrapr == 8) xpos -= 256; |
| 167 | 167 | |
| 168 | if (flip_screen_get()) | |
| 168 | if (flip_screen_get(screen->machine)) | |
| 169 | 169 | { |
| 170 | 170 | xpos = 240 - xpos; |
| 171 | 171 | ypos = 240 - ypos; |
| r3957 | r3958 | |
| 245 | 245 | if (x > 511) x &= 0x1ff; |
| 246 | 246 | if (y > 511) y &= 0x1ff; |
| 247 | 247 | |
| 248 | if (flip_screen_get()) | |
| 248 | if (flip_screen_get(screen->machine)) | |
| 249 | 249 | { |
| 250 | 250 | sx = 240 - x; |
| 251 | 251 | sy = 240 - y; |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | x = (sx + (xc << 3)) & 0xff; |
| 139 | 139 | y = (sy + (yc << 3)) & 0xff; |
| 140 | 140 | |
| 141 | if (flip_screen_get()) | |
| 141 | if (flip_screen_get(screen->machine)) | |
| 142 | 142 | { |
| 143 | 143 | x = 248 - x; |
| 144 | 144 | y = 248 - y; |
| r3957 | r3958 | |
| 147 | 147 | drawgfx(bitmap, screen->machine->gfx[0], |
| 148 | 148 | code & 0x3fff, |
| 149 | 149 | color, |
| 150 | flip_screen_get(), flip_screen_get(), | |
| 150 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), | |
| 151 | 151 | x, y, |
| 152 | 152 | cliprect, TRANSPARENCY_PEN, 15); |
| 153 | 153 | goffs += 2; |
| r3957 | r3958 | |
| 208 | 208 | x = (sx + (xc << 3)) & 0xff; |
| 209 | 209 | y = (sy + (yc << 3)) & 0xff; |
| 210 | 210 | |
| 211 | if (flip_screen_get()) | |
| 211 | if (flip_screen_get(screen->machine)) | |
| 212 | 212 | { |
| 213 | 213 | x = 248 - x; |
| 214 | 214 | y = 248 - y; |
| r3957 | r3958 | |
| 217 | 217 | drawgfx(bitmap, screen->machine->gfx[1], |
| 218 | 218 | code & 0x3fff, |
| 219 | 219 | color, |
| 220 | flip_screen_get(), flip_screen_get(), | |
| 220 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), | |
| 221 | 221 | x, y, |
| 222 | 222 | cliprect, TRANSPARENCY_PEN, 15); |
| 223 | 223 | goffs += 2; |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "render.h" |
| 9 | #include "video/resnet.h" | |
| 9 | 10 | #include "cpu/i86/i86.h" |
| 10 | #include "video/resnet.h" | |
| 11 | 11 | #include "tx1.h" |
| 12 | 12 | |
| 13 | 13 |
| r3957 | r3958 | |
|---|---|---|
| 71 | 71 | inc = 1; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | if (flip_screen_get()) { | |
| 74 | if (flip_screen_get(machine)) { | |
| 75 | 75 | y=240-y; |
| 76 | 76 | x=304-x; |
| 77 | 77 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 166 | 166 | VIDEO_UPDATE( dassault ) |
| 167 | 167 | { |
| 168 | 168 | /* Update tilemaps */ |
| 169 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 169 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 170 | 170 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 171 | 171 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 172 | 172 |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | scroll_bit_8 = data & 0x01; |
| 89 | 89 | |
| 90 | if (flip_screen_get() != (data & 0x02)) | |
| 90 | if (flip_screen_get(space->machine) != (data & 0x02)) | |
| 91 | 91 | { |
| 92 | flip_screen_set(data & 0x02); | |
| 92 | flip_screen_set(space->machine, data & 0x02); | |
| 93 | 93 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 94 | 94 | } |
| 95 | 95 | } |
| r3957 | r3958 | |
| 120 | 120 | { |
| 121 | 121 | int row; |
| 122 | 122 | |
| 123 | if (flip_screen_get()) | |
| 123 | if (flip_screen_get(machine)) | |
| 124 | 124 | { |
| 125 | 125 | sx = 35 - sx; |
| 126 | 126 | } |
| r3957 | r3958 | |
| 129 | 129 | { |
| 130 | 130 | int sy; |
| 131 | 131 | |
| 132 | if (flip_screen_get()) | |
| 132 | if (flip_screen_get(machine)) | |
| 133 | 133 | { |
| 134 | 134 | sy = row; |
| 135 | 135 | } |
| r3957 | r3958 | |
| 141 | 141 | drawgfx(bitmap,machine->gfx[0], |
| 142 | 142 | gotya_videoram2[row * 32 + col], |
| 143 | 143 | gotya_videoram2[row * 32 + col + 0x10] & 0x0f, |
| 144 | flip_screen_x_get(), flip_screen_y_get(), | |
| 144 | flip_screen_x_get(machine), flip_screen_y_get(machine), | |
| 145 | 145 | 8 * sx, 8 * sy, |
| 146 | 146 | cliprect, |
| 147 | 147 | TRANSPARENCY_NONE, 0); |
| r3957 | r3958 | |
| 159 | 159 | int sx = 256 - spriteram[offs + 0x10] + (spriteram[offs + 0x01] & 0x01) * 256; |
| 160 | 160 | int sy = spriteram[offs + 0x00]; |
| 161 | 161 | |
| 162 | if (flip_screen_get()) | |
| 162 | if (flip_screen_get(machine)) | |
| 163 | 163 | { |
| 164 | 164 | sy = 240 - sy; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | drawgfx(bitmap,machine->gfx[1], |
| 168 | 168 | code, color, |
| 169 | flip_screen_x_get(), flip_screen_y_get(), | |
| 169 | flip_screen_x_get(machine), flip_screen_y_get(machine), | |
| 170 | 170 | sx, sy, |
| 171 | 171 | cliprect, |
| 172 | 172 | TRANSPARENCY_PEN, 0); |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | #include "video/vector.h" |
| 9 | 9 | #include "aztarac.h" |
| 10 | 10 | |
| 11 | #define AVECTOR(x, y, color, intensity) \ | |
| 12 | vector_add_point (xcenter + ((x) << 16), ycenter - ((y) << 16), color, intensity) | |
| 11 | #define AVECTOR(m, x, y, color, intensity) \ | |
| 12 | vector_add_point (m, xcenter + ((x) << 16), ycenter - ((y) << 16), color, intensity) | |
| 13 | 13 | |
| 14 | 14 | UINT16 *aztarac_vectorram; |
| 15 | 15 | |
| r3957 | r3958 | |
| 44 | 44 | if ((c & 0x2000) == 0) |
| 45 | 45 | { |
| 46 | 46 | defaddr = (c >> 1) & 0x7ff; |
| 47 | AVECTOR (xoffset, yoffset, 0, 0); | |
| 47 | AVECTOR (space->machine, xoffset, yoffset, 0, 0); | |
| 48 | 48 | |
| 49 | 49 | read_vectorram (defaddr, &x, &ndefs, &c); |
| 50 | 50 | ndefs++; |
| r3957 | r3958 | |
| 59 | 59 | defaddr++; |
| 60 | 60 | read_vectorram (defaddr, &x, &y, &c); |
| 61 | 61 | if ((c & 0xff00) == 0) |
| 62 | AVECTOR (x + xoffset, y + yoffset, 0, 0); | |
| 62 | AVECTOR (space->machine, x + xoffset, y + yoffset, 0, 0); | |
| 63 | 63 | else |
| 64 | AVECTOR (x + xoffset, y + yoffset, color, intensity); | |
| 64 | AVECTOR (space->machine, x + xoffset, y + yoffset, color, intensity); | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | else |
| r3957 | r3958 | |
| 72 | 72 | defaddr++; |
| 73 | 73 | read_vectorram (defaddr, &x, &y, &c); |
| 74 | 74 | color = VECTOR_COLOR222(c & 0x3f); |
| 75 | AVECTOR (x + xoffset, y + yoffset, color, c >> 8); | |
| 75 | AVECTOR (space->machine, x + xoffset, y + yoffset, color, c >> 8); | |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | } |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | inc = 1; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | if (flip_screen_get()) | |
| 60 | if (flip_screen_get(machine)) | |
| 61 | 61 | { |
| 62 | 62 | y=240-y; |
| 63 | 63 | x=304-x; |
| r3957 | r3958 | |
| 90 | 90 | |
| 91 | 91 | VIDEO_UPDATE(supbtime) |
| 92 | 92 | { |
| 93 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 93 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 94 | 94 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 95 | 95 | |
| 96 | 96 | bitmap_fill(bitmap,cliprect,768); |
| r3957 | r3958 | |
|---|---|---|
| 147 | 147 | switch (offset) |
| 148 | 148 | { |
| 149 | 149 | case 0: |
| 150 | flip_screen_set(data & 1); | |
| 150 | flip_screen_set(space->machine, data & 1); | |
| 151 | 151 | break; |
| 152 | 152 | |
| 153 | 153 | case 1: |
| r3957 | r3958 | |
| 206 | 206 | sprite &= ~sizex; |
| 207 | 207 | sprite &= ~(sizey << 1); |
| 208 | 208 | |
| 209 | if (flip_screen_get()) | |
| 209 | if (flip_screen_get(machine)) | |
| 210 | 210 | { |
| 211 | 211 | flipx ^= 1; |
| 212 | 212 | flipy ^= 1; |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | if (multi) sy -= 16; |
| 120 | 120 | |
| 121 | if (flip_screen_get()) | |
| 121 | if (flip_screen_get(machine)) | |
| 122 | 122 | { |
| 123 | 123 | sx = 240 - sx; |
| 124 | 124 | sy = 240 - sy; |
| r3957 | r3958 | |
| 138 | 138 | drawgfx(bitmap,machine->gfx[2], |
| 139 | 139 | code + 1, color, |
| 140 | 140 | flipx, flipy, |
| 141 | sx, sy + (flip_screen_get() ? -16 : 16), | |
| 141 | sx, sy + (flip_screen_get(machine) ? -16 : 16), | |
| 142 | 142 | cliprect, |
| 143 | 143 | TRANSPARENCY_PEN, 0); |
| 144 | 144 | } |
| r3957 | r3958 | |
|---|---|---|
| 348 | 348 | coin_counter_w(1,data & 0x02); |
| 349 | 349 | |
| 350 | 350 | /* bit 2 is flip screen (handled both by software and hardware) */ |
| 351 | flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(space->machine, "DSW") >> 8) & 1)); | |
| 351 | flip_screen_set(space->machine, ((data & 0x04) >> 2) ^ ((~input_port_read(space->machine, "DSW") >> 8) & 1)); | |
| 352 | 352 | |
| 353 | 353 | /* bit 3 is display disable */ |
| 354 | 354 | video_off = data & 0x08; |
| r3957 | r3958 | |
| 374 | 374 | coin_counter_w(1,data & 0x02); |
| 375 | 375 | |
| 376 | 376 | /* bit 2 is flip screen (handled both by software and hardware) */ |
| 377 | flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(space->machine, "DSW") >> 8) & 1)); | |
| 377 | flip_screen_set(space->machine, ((data & 0x04) >> 2) ^ ((~input_port_read(space->machine, "DSW") >> 8) & 1)); | |
| 378 | 378 | |
| 379 | 379 | /* bit 3 is display disable */ |
| 380 | 380 | video_off = data & 0x08; |
| r3957 | r3958 | |
| 424 | 424 | h = 1 << ((m72_spriteram[offs+2] & 0x3000) >> 12); |
| 425 | 425 | sy -= 16 * h; |
| 426 | 426 | |
| 427 | if (flip_screen_get()) | |
| 427 | if (flip_screen_get(machine)) | |
| 428 | 428 | { |
| 429 | 429 | sx = 512 - 16*w - sx; |
| 430 | 430 | sy = 284 - 16*h - sy; |
| r3957 | r3958 | |
| 476 | 476 | h = 1 << ((spriteram16_2[offs+2] & 0x3000) >> 12); |
| 477 | 477 | sy -= 16 * h; |
| 478 | 478 | |
| 479 | if (flip_screen_get()) | |
| 479 | if (flip_screen_get(machine)) | |
| 480 | 480 | { |
| 481 | 481 | sx = 512 - 16*w - sx; |
| 482 | 482 | sy = 256 - 16*h - sy; |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | WRITE8_HANDLER( pokechmp_flipscreen_w ) |
| 14 | 14 | { |
| 15 | if (flip_screen_get() != (data & 0x80)) | |
| 15 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 16 | 16 | { |
| 17 | flip_screen_set(data & 0x80); | |
| 17 | flip_screen_set(space->machine, data & 0x80); | |
| 18 | 18 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 19 | 19 | } |
| 20 | 20 | } |
| r3957 | r3958 | |
| 49 | 49 | |
| 50 | 50 | flipx = spriteram[offs+1] & 0x04; |
| 51 | 51 | flipy = spriteram[offs+1] & 0x02; |
| 52 | if (flip_screen_get()) { | |
| 52 | if (flip_screen_get(machine)) { | |
| 53 | 53 | sx=240-sx; |
| 54 | 54 | sy=240-sy; |
| 55 | 55 | if (flipx) flipx=0; else flipx=1; |
| r3957 | r3958 | |
|---|---|---|
| 379 | 379 | static const mc6845_interface mc6845_intf = |
| 380 | 380 | { |
| 381 | 381 | "main", /* screen we are acting on */ |
| 382 | PIXEL_CLOCK / 8, /* the clock of the chip */ | |
| 383 | 382 | 8, /* number of pixels per video memory address */ |
| 384 | 383 | NULL, /* before pixel update callback */ |
| 385 | 384 | NULL, /* row update callback */ |
| r3957 | r3958 | |
| 401 | 400 | MDRV_VIDEO_START(madalien) |
| 402 | 401 | MDRV_VIDEO_UPDATE(madalien) |
| 403 | 402 | |
| 404 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 405 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 403 | MDRV_MC6845_ADD("crtc", MC6845, PIXEL_CLOCK / 8, mc6845_intf) | |
| 406 | 404 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | READ8_HANDLER( aeroboto_in0_r ) |
| 77 | 77 | { |
| 78 | return input_port_read(space->machine, flip_screen_get() ? "P2" : "P1"); | |
| 78 | return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1"); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | WRITE8_HANDLER( aeroboto_3000_w ) |
| 82 | 82 | { |
| 83 | 83 | /* bit 0 selects both flip screen and player1/player2 controls */ |
| 84 | flip_screen_set(data & 0x01); | |
| 84 | flip_screen_set(space->machine, data & 0x01); | |
| 85 | 85 | |
| 86 | 86 | /* bit 1 = char bank select */ |
| 87 | 87 | if (aeroboto_charbank != ((data & 0x02) >> 1)) |
| r3957 | r3958 | |
| 126 | 126 | int x = spriteram[offs+3]; |
| 127 | 127 | int y = 240 - spriteram[offs]; |
| 128 | 128 | |
| 129 | if (flip_screen_get()) | |
| 129 | if (flip_screen_get(machine)) | |
| 130 | 130 | { |
| 131 | 131 | x = 248 - x; |
| 132 | 132 | y = 240 - y; |
| r3957 | r3958 | |
| 135 | 135 | drawgfx(bitmap, machine->gfx[1], |
| 136 | 136 | spriteram[offs+1], |
| 137 | 137 | spriteram[offs+2] & 0x07, |
| 138 | flip_screen_get(), flip_screen_get(), | |
| 138 | flip_screen_get(machine), flip_screen_get(machine), | |
| 139 | 139 | ((x + 8) & 0xff) - 8, y, |
| 140 | 140 | cliprect, TRANSPARENCY_PEN, 0); |
| 141 | 141 | } |
| r3957 | r3958 | |
|---|---|---|
| 227 | 227 | color = ((spriteram[offs + 1] & 0x08) >> 2) | (spriteram[offs + 1] & 0x01); |
| 228 | 228 | flipx = spriteram[offs + 1] & 0x04; |
| 229 | 229 | flipy = spriteram[offs + 1] & 0x02; |
| 230 | if (flip_screen_get()) | |
| 230 | if (flip_screen_get(machine)) | |
| 231 | 231 | { |
| 232 | 232 | sx = 240 - sx; |
| 233 | 233 | sy = 240 - sy; |
| r3957 | r3958 | |
| 237 | 237 | |
| 238 | 238 | if (spriteram[offs + 1] & 0x10) /* double width */ |
| 239 | 239 | { |
| 240 | if (flip_screen_get()) sy -= 16; | |
| 240 | if (flip_screen_get(machine)) sy -= 16; | |
| 241 | 241 | |
| 242 | 242 | drawgfx(bitmap,machine->gfx[3], |
| 243 | 243 | code & ~1, |
| r3957 | r3958 | |
|---|---|---|
| 176 | 176 | if (color & 1) sx -= 256; |
| 177 | 177 | if (attr & 1) sy -= 256; |
| 178 | 178 | |
| 179 | if (flip_screen_get()) | |
| 179 | if (flip_screen_get(machine)) | |
| 180 | 180 | { |
| 181 | 181 | flipx = !flipx; |
| 182 | 182 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | { |
| 30 | 30 | static int flip = 0; |
| 31 | 31 | flip ^= 1; |
| 32 | flip_screen_set( flip ); | |
| 32 | flip_screen_set(space->machine, flip ); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /*************************************************************************** |
| r3957 | r3958 | |
| 117 | 117 | int flipx = attr & 0x80; |
| 118 | 118 | int flipy = attr & 0x40; |
| 119 | 119 | |
| 120 | if (flip_screen_get()) | |
| 120 | if (flip_screen_get(machine)) | |
| 121 | 121 | { |
| 122 | 122 | x = max_x - x - 8; y = max_y - y - 8; |
| 123 | 123 | flipx = !flipx; flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 84 | 84 | WRITE8_HANDLER( srumbler_4009_w ) |
| 85 | 85 | { |
| 86 | 86 | /* bit 0 flips screen */ |
| 87 | flip_screen_set(data & 1); | |
| 87 | flip_screen_set(space->machine, data & 1); | |
| 88 | 88 | |
| 89 | 89 | /* bits 4-5 used during attract mode, unknown */ |
| 90 | 90 | |
| r3957 | r3958 | |
| 142 | 142 | sx = buffered_spriteram[offs + 3] + 0x100 * ( attr & 0x01); |
| 143 | 143 | flipy = attr & 0x02; |
| 144 | 144 | |
| 145 | if (flip_screen_get()) | |
| 145 | if (flip_screen_get(machine)) | |
| 146 | 146 | { |
| 147 | 147 | sx = 496 - sx; |
| 148 | 148 | sy = 240 - sy; |
| r3957 | r3958 | |
| 152 | 152 | drawgfx(bitmap,machine->gfx[2], |
| 153 | 153 | code, |
| 154 | 154 | colour, |
| 155 | flip_screen_get(),flipy, | |
| 155 | flip_screen_get(machine),flipy, | |
| 156 | 156 | sx, sy, |
| 157 | 157 | cliprect,TRANSPARENCY_PEN,15); |
| 158 | 158 | } |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | WRITE8_HANDLER( pbaction_scroll_w ) |
| 42 | 42 | { |
| 43 | 43 | scroll = data - 3; |
| 44 | if (flip_screen_get()) scroll = -scroll; | |
| 44 | if (flip_screen_get(space->machine)) scroll = -scroll; | |
| 45 | 45 | tilemap_set_scrollx(bg_tilemap, 0, scroll); |
| 46 | 46 | tilemap_set_scrollx(fg_tilemap, 0, scroll); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | WRITE8_HANDLER( pbaction_flipscreen_w ) |
| 50 | 50 | { |
| 51 | flip_screen_set(data & 0x01); | |
| 51 | flip_screen_set(space->machine, data & 0x01); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 100 | 100 | sy = 241-spriteram[offs+2]; |
| 101 | 101 | flipx = spriteram[offs+1] & 0x40; |
| 102 | 102 | flipy = spriteram[offs+1] & 0x80; |
| 103 | if (flip_screen_get()) | |
| 103 | if (flip_screen_get(machine)) | |
| 104 | 104 | { |
| 105 | 105 | if (spriteram[offs] & 0x80) |
| 106 | 106 | { |
| r3957 | r3958 | |
| 120 | 120 | spriteram[offs], |
| 121 | 121 | spriteram[offs + 1] & 0x0f, |
| 122 | 122 | flipx,flipy, |
| 123 | sx + (flip_screen_get() ? scroll : -scroll), sy, | |
| 123 | sx + (flip_screen_get(machine) ? scroll : -scroll), sy, | |
| 124 | 124 | cliprect,TRANSPARENCY_PEN,0); |
| 125 | 125 | } |
| 126 | 126 | } |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | Written by Roberto Fresca. |
| 9 | 9 | |
| 10 | 10 | |
| 11 | Games running | |
| 11 | Games running on this hardware: | |
| 12 | 12 | |
| 13 | 13 | * Jolly Card (austrian), TAB-Austria, 1985. |
| 14 | 14 | * Jolly Card (3x3 deal), TAB-Austria, 1985. |
| r3957 | r3958 | |
| 17 | 17 | * Jolly Card (croatian, set 1), TAB-Austria, 1985. |
| 18 | 18 | * Jolly Card (croatian, set 2), Soft Design, 1993. |
| 19 | 19 | * Jolly Card (italian, blue TAB board, encrypted), bootleg, 199?. |
| 20 | * Jolly Card (italian, encrypted bootleg), bootleg, 1990. | |
| 20 | 21 | * Super Joly 2000 - 3x, M.P. 1985. |
| 21 | 22 | * Jolly Card (austrian, Funworld, bootleg), Inter Games, 1986. |
| 22 | 23 | * Big Deal (hungarian, set 1), Funworld, 1986. |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | WRITE8_HANDLER( spcforce_flip_screen_w ) |
| 16 | 16 | { |
| 17 | flip_screen_set(~data & 0x01); | |
| 17 | flip_screen_set(space->machine, ~data & 0x01); | |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | |
| r3957 | r3958 | |
| 39 | 39 | code = videoram[offs] + ((colorram[offs] & 0x01) << 8); |
| 40 | 40 | col = (~colorram[offs] >> 4) & 0x07; |
| 41 | 41 | |
| 42 | if (flip_screen_get()) | |
| 42 | if (flip_screen_get(screen->machine)) | |
| 43 | 43 | { |
| 44 | 44 | sx = 248 - sx; |
| 45 | 45 | sy = 248 - sy; |
| r3957 | r3958 | |
| 47 | 47 | |
| 48 | 48 | drawgfx(bitmap,screen->machine->gfx[0], |
| 49 | 49 | code, col, |
| 50 | flip_screen_get(), flip_screen_get(), | |
| 50 | flip_screen_get(screen->machine), flip_screen_get(screen->machine), | |
| 51 | 51 | sx, sy, |
| 52 | 52 | cliprect,TRANSPARENCY_PEN,0); |
| 53 | 53 | } |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | WRITE8_HANDLER( exprraid_flipscreen_w ) |
| 20 | 20 | { |
| 21 | if (flip_screen_get() != (data & 0x01)) | |
| 21 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 22 | 22 | { |
| 23 | flip_screen_set(data & 0x01); | |
| 23 | flip_screen_set(space->machine, data & 0x01); | |
| 24 | 24 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 25 | 25 | } |
| 26 | 26 | } |
| r3957 | r3958 | |
| 106 | 106 | int sx = ((248 - spriteram[offs + 2]) & 0xff) - 8; |
| 107 | 107 | int sy = spriteram[offs]; |
| 108 | 108 | |
| 109 | if (flip_screen_get()) | |
| 109 | if (flip_screen_get(machine)) | |
| 110 | 110 | { |
| 111 | 111 | sx = 240 - sx; |
| 112 | 112 | sy = 240 - sy; |
| r3957 | r3958 | |
| 127 | 127 | drawgfx(bitmap,machine->gfx[1], |
| 128 | 128 | code + 1, color, |
| 129 | 129 | flipx, flipy, |
| 130 | sx, sy + (flip_screen_get() ? -16 : 16), | |
| 130 | sx, sy + (flip_screen_get(machine) ? -16 : 16), | |
| 131 | 131 | cliprect, TRANSPARENCY_PEN, 0); |
| 132 | 132 | } |
| 133 | 133 | } |
| r3957 | r3958 | |
|---|---|---|
| 170 | 170 | WRITE16_HANDLER( tecmo16_flipscreen_w ) |
| 171 | 171 | { |
| 172 | 172 | flipscreen = data & 0x01; |
| 173 | flip_screen_set(flipscreen); | |
| 173 | flip_screen_set(space->machine, flipscreen); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /******************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | WRITE8_HANDLER( kchamp_flipscreen_w ) |
| 40 | 40 | { |
| 41 | flip_screen_set(data & 0x01); | |
| 41 | flip_screen_set(space->machine, data & 0x01); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 80 | 80 | int sx = spriteram[offs + 3] - 8; |
| 81 | 81 | int sy = 247 - spriteram[offs]; |
| 82 | 82 | |
| 83 | if (flip_screen_get()) | |
| 83 | if (flip_screen_get(machine)) | |
| 84 | 84 | { |
| 85 | 85 | sx = 240 - sx; |
| 86 | 86 | sy = 240 - sy; |
| r3957 | r3958 | |
| 108 | 108 | int sx = spriteram[offs + 3]; |
| 109 | 109 | int sy = 240 - spriteram[offs]; |
| 110 | 110 | |
| 111 | if (flip_screen_get()) | |
| 111 | if (flip_screen_get(machine)) | |
| 112 | 112 | { |
| 113 | 113 | sx = 240 - sx; |
| 114 | 114 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 134 | 134 | characters when screen is flipped, we have to flip them back. */ |
| 135 | 135 | SET_TILE_INFO( |
| 136 | 136 | 0, |
| 137 | (code & 0x7f) | (flip_screen_get() ? 0x80 : 0), | |
| 137 | (code & 0x7f) | (flip_screen_get(machine) ? 0x80 : 0), | |
| 138 | 138 | color, |
| 139 | flip_screen_get() ? TILE_FLIPX : 0); | |
| 139 | flip_screen_get(machine) ? TILE_FLIPX : 0); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| r3957 | r3958 | |
| 235 | 235 | break; |
| 236 | 236 | |
| 237 | 237 | case 7: /* FLIP */ |
| 238 | flip_screen_set(data & 1); | |
| 238 | flip_screen_set(space->machine, data & 1); | |
| 239 | 239 | break; |
| 240 | 240 | } |
| 241 | 241 | } |
| r3957 | r3958 | |
| 280 | 280 | sy -= 16 * size; |
| 281 | 281 | sy = (sy & 0xff) - 32; // fix wraparound |
| 282 | 282 | |
| 283 | if (flip_screen_get()) | |
| 283 | if (flip_screen_get(machine)) | |
| 284 | 284 | { |
| 285 | 285 | flipx ^= 1; |
| 286 | 286 | flipy ^= 1; |
| r3957 | r3958 | |
|---|---|---|
| 108 | 108 | int sx = spriteram[i + 2] - ((attr & 0x80) << 1); |
| 109 | 109 | int sy = spriteram[i + 3]; |
| 110 | 110 | |
| 111 | if (flip_screen_get()) | |
| 111 | if (flip_screen_get(machine)) | |
| 112 | 112 | { |
| 113 | 113 | sx = 240 - sx; |
| 114 | 114 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | WRITE8_HANDLER( markham_flipscreen_w ) |
| 53 | 53 | { |
| 54 | if (flip_screen_get() != (data & 0x01)) | |
| 54 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 55 | 55 | { |
| 56 | flip_screen_set(data & 0x01); | |
| 56 | flip_screen_set(space->machine, data & 0x01); | |
| 57 | 57 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 58 | 58 | } |
| 59 | 59 | } |
| r3957 | r3958 | |
| 84 | 84 | int chr = spriteram[offs+1]; |
| 85 | 85 | int col = spriteram[offs+2]; |
| 86 | 86 | |
| 87 | int fx = flip_screen_get(); | |
| 88 | int fy = flip_screen_get(); | |
| 87 | int fx = flip_screen_get(machine); | |
| 88 | int fy = flip_screen_get(machine); | |
| 89 | 89 | |
| 90 | 90 | int x = spriteram[offs+3]; |
| 91 | 91 | int y = spriteram[offs+0]; |
| 92 | 92 | int px,py; |
| 93 | 93 | col &= 0x3f ; |
| 94 | 94 | |
| 95 | if (flip_screen_get()==0) | |
| 95 | if (flip_screen_get(machine)==0) | |
| 96 | 96 | { |
| 97 | 97 | px = x-2; |
| 98 | 98 | py = 240-y; |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | memory_set_bank(space->machine, 1, (data & 0x08) >> 3); |
| 139 | 139 | |
| 140 | 140 | interrupt_enable_w(space,0,data & 0x10); |
| 141 | flip_screen_set(data & 0x20); | |
| 141 | flip_screen_set(space->machine, data & 0x20); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | WRITE8_HANDLER( superqix_0410_w ) |
| r3957 | r3958 | |
| 180 | 180 | int sx = spriteram[offs + 1] + 256 * (spriteram[offs] & 0x01); |
| 181 | 181 | int sy = spriteram[offs + 2]; |
| 182 | 182 | |
| 183 | if (flip_screen_get()) | |
| 183 | if (flip_screen_get(machine)) | |
| 184 | 184 | { |
| 185 | 185 | sx = 240 - sx; |
| 186 | 186 | sy = 240 - sy; |
| r3957 | r3958 | |
| 189 | 189 | drawgfx(bitmap,machine->gfx[1], |
| 190 | 190 | code, |
| 191 | 191 | color, |
| 192 | flip_screen_get(), flip_screen_get(), | |
| 192 | flip_screen_get(machine), flip_screen_get(machine), | |
| 193 | 193 | sx, sy, |
| 194 | 194 | cliprect, TRANSPARENCY_PEN, 0); |
| 195 | 195 | } |
| r3957 | r3958 | |
| 209 | 209 | int sx = spriteram[offs + 1]; |
| 210 | 210 | int sy = spriteram[offs + 2]; |
| 211 | 211 | |
| 212 | if (flip_screen_get()) | |
| 212 | if (flip_screen_get(machine)) | |
| 213 | 213 | { |
| 214 | 214 | sx = 240 - sx; |
| 215 | 215 | sy = 240 - sy; |
| r3957 | r3958 | |
| 255 | 255 | VIDEO_UPDATE( superqix ) |
| 256 | 256 | { |
| 257 | 257 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0); |
| 258 | copybitmap_trans(bitmap,fg_bitmap[show_bitmap],flip_screen_get(),flip_screen_get(),0,0,cliprect,0); | |
| 258 | copybitmap_trans(bitmap,fg_bitmap[show_bitmap],flip_screen_get(screen->machine),flip_screen_get(screen->machine),0,0,cliprect,0); | |
| 259 | 259 | superqix_draw_sprites(screen->machine, bitmap,cliprect); |
| 260 | 260 | tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 0); |
| 261 | 261 | return 0; |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "video/ppu2c0x.h" |
| 4 | 3 | #include "includes/playch10.h" |
| 5 | 4 | |
| r3957 | r3958 | |
| 58 | 57 | ppu2c0x_init_palette(machine, 256 ); |
| 59 | 58 | } |
| 60 | 59 | |
| 61 | static void ppu_irq( int num, int *ppu_regs ) | |
| 60 | static void ppu_irq( running_machine *machine, int num, int *ppu_regs ) | |
| 62 | 61 | { |
| 63 | cpu_set_input_line( | |
| 62 | cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE ); | |
| 64 | 63 | pc10_int_detect = 1; |
| 65 | 64 | } |
| 66 | 65 |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "lockon.h" |
| 9 | #include "cpu/nec/nec.h" | |
| 9 | 10 | #include "video/resnet.h" |
| 10 | #include "cpu/nec/nec.h" | |
| 11 | 11 | |
| 12 | 12 | #define CURSOR_XPOS 168 |
| 13 | 13 | #define CURSOR_YPOS 239 |
| r3957 | r3958 | |
|---|---|---|
| 377 | 377 | |
| 378 | 378 | WRITE8_HANDLER( superpac_flipscreen_w ) |
| 379 | 379 | { |
| 380 | flip_screen_set(data & 1); | |
| 380 | flip_screen_set(space->machine, data & 1); | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | READ8_HANDLER( superpac_flipscreen_r ) |
| 384 | 384 | { |
| 385 | flip_screen_set(1); | |
| 385 | flip_screen_set(space->machine, 1); | |
| 386 | 386 | return 0xff; |
| 387 | 387 | } |
| 388 | 388 | |
| r3957 | r3958 | |
| 430 | 430 | sy -= 16 * sizey; |
| 431 | 431 | sy = (sy & 0xff) - 32; // fix wraparound |
| 432 | 432 | |
| 433 | if (flip_screen_get()) | |
| 433 | if (flip_screen_get(machine)) | |
| 434 | 434 | { |
| 435 | 435 | flipx ^= 1; |
| 436 | 436 | flipy ^= 1; |
| r3957 | r3958 | |
| 506 | 506 | sy -= 8 * sizey; |
| 507 | 507 | sy = (sy & 0xff) - 32; // fix wraparound |
| 508 | 508 | |
| 509 | if (flip_screen_get()) | |
| 509 | if (flip_screen_get(machine)) | |
| 510 | 510 | { |
| 511 | 511 | flipx ^= 1; |
| 512 | 512 | flipy ^= 1; |
| r3957 | r3958 | |
| 562 | 562 | VIDEO_UPDATE( phozon ) |
| 563 | 563 | { |
| 564 | 564 | /* flip screen control is embedded in RAM */ |
| 565 | flip_screen_set(mappy_spriteram[0x1f7f-0x800] & 1); | |
| 565 | flip_screen_set(screen->machine, mappy_spriteram[0x1f7f-0x800] & 1); | |
| 566 | 566 | |
| 567 | 567 | tilemap_set_scrolldx(bg_tilemap, 0, 96); |
| 568 | 568 | tilemap_set_scrolldy(bg_tilemap, 0, 0); |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | /* bit 1 flips screen */ |
| 21 | 21 | |
| 22 | if (flip_screen_get() != (data & 0x02)) | |
| 22 | if (flip_screen_get(space->machine) != (data & 0x02)) | |
| 23 | 23 | { |
| 24 | flip_screen_set(data & 0x02); | |
| 24 | flip_screen_set(space->machine, data & 0x02); | |
| 25 | 25 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 26 | 26 | } |
| 27 | 27 | |
| r3957 | r3958 | |
| 88 | 88 | if (sx > 0x100) sx -= 0x200; |
| 89 | 89 | if (sy > 0x100) sy -= 0x200; |
| 90 | 90 | |
| 91 | if (flip_screen_get()) | |
| 91 | if (flip_screen_get(machine)) | |
| 92 | 92 | { |
| 93 | 93 | sx = 240 - sx; |
| 94 | 94 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ******************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "includes/atari.h" |
| 12 | 11 | #include "video/gtia.h" |
| 13 | 12 | |
| r3957 | r3958 | |
| 1243 | 1242 | |
| 1244 | 1243 | |
| 1245 | 1244 | |
| 1246 | INLINE void LMS(int new_cmd) | |
| 1245 | INLINE void LMS(running_machine *machine, int new_cmd) | |
| 1247 | 1246 | { |
| 1248 | 1247 | /************************************************************** |
| 1249 | 1248 | * If the LMS bit (load memory scan) of the current display |
| r3957 | r3958 | |
| 1253 | 1252 | **************************************************************/ |
| 1254 | 1253 | if( new_cmd & ANTIC_LMS ) |
| 1255 | 1254 | { |
| 1256 | const address_space *space = cpu_get_address_space( | |
| 1255 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 1257 | 1256 | int addr = RDANTIC(space); |
| 1258 | 1257 | antic.doffs = ++antic.doffs & DOFFS; |
| 1259 | 1258 | addr += 256 * RDANTIC(space); |
| r3957 | r3958 | |
| 1379 | 1378 | } |
| 1380 | 1379 | break; |
| 1381 | 1380 | case 0x02: |
| 1382 | LMS(new_cmd); | |
| 1381 | LMS(machine, new_cmd); | |
| 1383 | 1382 | antic.chbase = (antic.w.chbash & 0xfc) << 8; |
| 1384 | 1383 | antic.modelines = 8 - (vscrol_subtract & 7); |
| 1385 | 1384 | if( antic.w.chactl & 4 ) /* decrement chbasl? */ |
| 1386 | 1385 | antic.w.chbasl = antic.modelines - 1; |
| 1387 | 1386 | break; |
| 1388 | 1387 | case 0x03: |
| 1389 | LMS(new_cmd); | |
| 1388 | LMS(machine, new_cmd); | |
| 1390 | 1389 | antic.chbase = (antic.w.chbash & 0xfc) << 8; |
| 1391 | 1390 | antic.modelines = 10 - (vscrol_subtract & 9); |
| 1392 | 1391 | if( antic.w.chactl & 4 ) /* decrement chbasl? */ |
| 1393 | 1392 | antic.w.chbasl = antic.modelines - 1; |
| 1394 | 1393 | break; |
| 1395 | 1394 | case 0x04: |
| 1396 | LMS(new_cmd); | |
| 1395 | LMS(machine, new_cmd); | |
| 1397 | 1396 | antic.chbase = (antic.w.chbash & 0xfc) << 8; |
| 1398 | 1397 | antic.modelines = 8 - (vscrol_subtract & 7); |
| 1399 | 1398 | if( antic.w.chactl & 4 ) /* decrement chbasl? */ |
| 1400 | 1399 | antic.w.chbasl = antic.modelines - 1; |
| 1401 | 1400 | break; |
| 1402 | 1401 | case 0x05: |
| 1403 | LMS(new_cmd); | |
| 1402 | LMS(machine, new_cmd); | |
| 1404 | 1403 | antic.chbase = (antic.w.chbash & 0xfc) << 8; |
| 1405 | 1404 | antic.modelines = 16 - (vscrol_subtract & 15); |
| 1406 | 1405 | if( antic.w.chactl & 4 ) /* decrement chbasl? */ |
| 1407 | 1406 | antic.w.chbasl = antic.modelines - 1; |
| 1408 | 1407 | break; |
| 1409 | 1408 | case 0x06: |
| 1410 | LMS(new_cmd); | |
| 1409 | LMS(machine, new_cmd); | |
| 1411 | 1410 | antic.chbase = (antic.w.chbash & 0xfe) << 8; |
| 1412 | 1411 | antic.modelines = 8 - (vscrol_subtract & 7); |
| 1413 | 1412 | if( antic.w.chactl & 4 ) /* decrement chbasl? */ |
| 1414 | 1413 | antic.w.chbasl = antic.modelines - 1; |
| 1415 | 1414 | break; |
| 1416 | 1415 | case 0x07: |
| 1417 | LMS(new_cmd); | |
| 1416 | LMS(machine, new_cmd); | |
| 1418 | 1417 | antic.chbase = (antic.w.chbash & 0xfe) << 8; |
| 1419 | 1418 | antic.modelines = 16 - (vscrol_subtract & 15); |
| 1420 | 1419 | if( antic.w.chactl & 4 ) /* decrement chbasl? */ |
| 1421 | 1420 | antic.w.chbasl = antic.modelines - 1; |
| 1422 | 1421 | break; |
| 1423 | 1422 | case 0x08: |
| 1424 | LMS(new_cmd); | |
| 1423 | LMS(machine, new_cmd); | |
| 1425 | 1424 | antic.modelines = 8 - (vscrol_subtract & 7); |
| 1426 | 1425 | break; |
| 1427 | 1426 | case 0x09: |
| 1428 | LMS(new_cmd); | |
| 1427 | LMS(machine, new_cmd); | |
| 1429 | 1428 | antic.modelines = 4 - (vscrol_subtract & 3); |
| 1430 | 1429 | break; |
| 1431 | 1430 | case 0x0a: |
| 1432 | LMS(new_cmd); | |
| 1431 | LMS(machine, new_cmd); | |
| 1433 | 1432 | antic.modelines = 4 - (vscrol_subtract & 3); |
| 1434 | 1433 | break; |
| 1435 | 1434 | case 0x0b: |
| 1436 | LMS(new_cmd); | |
| 1435 | LMS(machine, new_cmd); | |
| 1437 | 1436 | antic.modelines = 2 - (vscrol_subtract & 1); |
| 1438 | 1437 | break; |
| 1439 | 1438 | case 0x0c: |
| 1440 | LMS(new_cmd); | |
| 1439 | LMS(machine, new_cmd); | |
| 1441 | 1440 | antic.modelines = 1; |
| 1442 | 1441 | break; |
| 1443 | 1442 | case 0x0d: |
| 1444 | LMS(new_cmd); | |
| 1443 | LMS(machine, new_cmd); | |
| 1445 | 1444 | antic.modelines = 2 - (vscrol_subtract & 1); |
| 1446 | 1445 | break; |
| 1447 | 1446 | case 0x0e: |
| 1448 | LMS(new_cmd); | |
| 1447 | LMS(machine, new_cmd); | |
| 1449 | 1448 | antic.modelines = 1; |
| 1450 | 1449 | break; |
| 1451 | 1450 | case 0x0f: |
| 1452 | LMS(new_cmd); | |
| 1451 | LMS(machine, new_cmd); | |
| 1453 | 1452 | /* bits 6+7 of the priority select register determine */ |
| 1454 | 1453 | /* if newer GTIA or plain graphics modes are used */ |
| 1455 | 1454 | switch (gtia.w.prior >> 6) |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | quizdna_flipscreen = tmp; |
| 121 | 121 | |
| 122 | flip_screen_set(tmp); | |
| 122 | flip_screen_set(space->machine, tmp); | |
| 123 | 123 | tilemap_set_scrolldx( quizdna_fg_tilemap, 64, -64 +16); |
| 124 | 124 | } |
| 125 | 125 |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | y = dy; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | if (flip_screen_get()) | |
| 122 | if (flip_screen_get(machine)) | |
| 123 | 123 | { |
| 124 | 124 | sx = 240 - x; |
| 125 | 125 | sy = 240 - y; |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, UINT16* spriteram_base, int gfx_region) |
| 5 | 5 | { |
| 6 | 6 | int offs; |
| 7 | int flipscreen=!flip_screen_get(); | |
| 7 | int flipscreen=!flip_screen_get(machine); | |
| 8 | 8 | |
| 9 | 9 | for (offs = 0x400-4;offs >= 0;offs -= 4) |
| 10 | 10 | { |
| r3957 | r3958 | |
| 158 | 158 | |
| 159 | 159 | VIDEO_UPDATE(boogwing) |
| 160 | 160 | { |
| 161 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 161 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 162 | 162 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 163 | 163 | deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll); |
| 164 | 164 |
| r3957 | r3958 | |
|---|---|---|
| 212 | 212 | |
| 213 | 213 | WRITE16_HANDLER(equites_flip0_w) |
| 214 | 214 | { |
| 215 | flip_screen_set(0); | |
| 215 | flip_screen_set(space->machine, 0); | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | WRITE16_HANDLER(equites_flip1_w) |
| 219 | 219 | { |
| 220 | flip_screen_set(1); | |
| 220 | flip_screen_set(space->machine, 1); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | WRITE16_HANDLER(splndrbt_flip0_w) |
| 224 | 224 | { |
| 225 | 225 | if (ACCESSING_BITS_0_7) |
| 226 | flip_screen_set(0); | |
| 226 | flip_screen_set(space->machine, 0); | |
| 227 | 227 | |
| 228 | 228 | if (ACCESSING_BITS_8_15) |
| 229 | 229 | bgcolor = data >> 8; |
| r3957 | r3958 | |
| 232 | 232 | WRITE16_HANDLER(splndrbt_flip1_w) |
| 233 | 233 | { |
| 234 | 234 | if (ACCESSING_BITS_0_7) |
| 235 | flip_screen_set(1); | |
| 235 | flip_screen_set(space->machine, 1); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | WRITE16_HANDLER(splndrbt_bg_scrollx_w) |
| r3957 | r3958 | |
| 269 | 269 | int sy = (spriteram16[offs] & 0x00ff); |
| 270 | 270 | int transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0); |
| 271 | 271 | |
| 272 | if (flip_screen_get()) | |
| 272 | if (flip_screen_get(machine)) | |
| 273 | 273 | { |
| 274 | 274 | sx = 240 - sx; |
| 275 | 275 | sy = 240 - sy; |
| r3957 | r3958 | |
| 357 | 357 | |
| 358 | 358 | sy += 16; |
| 359 | 359 | |
| 360 | if (flip_screen_get()) | |
| 360 | if (flip_screen_get(machine)) | |
| 361 | 361 | { |
| 362 | 362 | // sx NOT inverted |
| 363 | 363 | fx = fx ^ 1; |
| r3957 | r3958 | |
| 409 | 409 | const UINT8 * const yrom = xrom + 0x2000; |
| 410 | 410 | int scroll_x = splndrbt_bg_scrollx; |
| 411 | 411 | int scroll_y = splndrbt_bg_scrolly; |
| 412 | int const dinvert = flip_screen_get() ? 0xff : 0x00; | |
| 412 | int const dinvert = flip_screen_get(machine) ? 0xff : 0x00; | |
| 413 | 413 | int src_y = 0; |
| 414 | 414 | int dst_y; |
| 415 | 415 | |
| 416 | if (flip_screen_get()) | |
| 416 | if (flip_screen_get(machine)) | |
| 417 | 417 | { |
| 418 | 418 | scroll_x = -scroll_x - 8; |
| 419 | 419 | scroll_y = -scroll_y; |
| r3957 | r3958 | |
|---|---|---|
| 427 | 427 | flipx = sprite_ram[offs + 0] & 0x04; |
| 428 | 428 | flipy = sprite_ram[offs + 0] & 0x02; |
| 429 | 429 | |
| 430 | if (flip_screen_get()) | |
| 430 | if (flip_screen_get(machine)) | |
| 431 | 431 | { |
| 432 | 432 | sx = 240 - sx; |
| 433 | 433 | sy = 240 - sy + sprite_y_adjust_flip_screen; |
| r3957 | r3958 | |
| 445 | 445 | sx,sy, |
| 446 | 446 | cliprect, TRANSPARENCY_PEN, 0); |
| 447 | 447 | |
| 448 | sy += (flip_screen_get() ? -256 : 256); | |
| 448 | sy += (flip_screen_get(machine) ? -256 : 256); | |
| 449 | 449 | |
| 450 | 450 | // Wrap around |
| 451 | 451 | drawgfx(bitmap,machine->gfx[1], |
| r3957 | r3958 | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | |
| 461 | static void draw_missiles(bitmap_t *bitmap, const rectangle *cliprect, | |
| 461 | static void draw_missiles(running_machine *machine,bitmap_t *bitmap, const rectangle *cliprect, | |
| 462 | 462 | int missile_y_adjust, int missile_y_adjust_flip_screen, |
| 463 | 463 | UINT8 *missile_ram, int interleave) |
| 464 | 464 | { |
| r3957 | r3958 | |
| 472 | 472 | |
| 473 | 473 | sy = 255 - missile_ram[offs + 0*interleave]; |
| 474 | 474 | sx = 255 - missile_ram[offs + 2*interleave]; |
| 475 | if (flip_screen_get()) | |
| 475 | if (flip_screen_get(machine)) | |
| 476 | 476 | { |
| 477 | 477 | sx = 240 - sx; |
| 478 | 478 | sy = 240 - sy + missile_y_adjust_flip_screen; |
| r3957 | r3958 | |
| 488 | 488 | |
| 489 | 489 | sy = 255 - missile_ram[offs + 1*interleave]; |
| 490 | 490 | sx = 255 - missile_ram[offs + 3*interleave]; |
| 491 | if (flip_screen_get()) | |
| 491 | if (flip_screen_get(machine)) | |
| 492 | 492 | { |
| 493 | 493 | sx = 240 - sx; |
| 494 | 494 | sy = 240 - sy + missile_y_adjust_flip_screen; |
| r3957 | r3958 | |
| 708 | 708 | } |
| 709 | 709 | tilemap_draw(bitmap,cliprect, fg_tilemap, 0, 0); |
| 710 | 710 | draw_sprites(screen->machine,bitmap,cliprect, (color_center_bot >> 1) & 1, 0, 0, decocass_fgvideoram, 0x20); |
| 711 | draw_missiles(bitmap,cliprect, 1, 0, decocass_colorram, 0x20); | |
| 711 | draw_missiles(screen->machine,bitmap,cliprect, 1, 0, decocass_colorram, 0x20); | |
| 712 | 712 | return 0; |
| 713 | 713 | } |
| 714 | 714 |
| r3957 | r3958 | |
|---|---|---|
| 83 | 83 | characters when screen is flipped, we have to flip them back. */ |
| 84 | 84 | SET_TILE_INFO( |
| 85 | 85 | 0, |
| 86 | skykid_textram[tile_index] | (flip_screen_get() ? 0x100 : 0), | |
| 86 | skykid_textram[tile_index] | (flip_screen_get(machine) ? 0x100 : 0), | |
| 87 | 87 | skykid_textram[tile_index + 0x400] & 0x3f, |
| 88 | flip_screen_get() ? (TILE_FLIPY | TILE_FLIPX) : 0); | |
| 88 | flip_screen_get(machine) ? (TILE_FLIPY | TILE_FLIPX) : 0); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| r3957 | r3958 | |
| 124 | 124 | state_save_register_global(machine, scroll_x); |
| 125 | 125 | state_save_register_global(machine, scroll_y); |
| 126 | 126 | //FIXME: flip_screen |
| 127 | //state_save_register_global(machine, flip_screen_x_get()); | |
| 127 | //state_save_register_global(machine, flip_screen_x_get(machine)); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| r3957 | r3958 | |
| 170 | 170 | WRITE8_HANDLER( skykid_flipscreen_priority_w ) |
| 171 | 171 | { |
| 172 | 172 | priority = data; |
| 173 | flip_screen_set(offset & 1); | |
| 173 | flip_screen_set(space->machine, offset & 1); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| r3957 | r3958 | |
| 206 | 206 | sprite &= ~sizex; |
| 207 | 207 | sprite &= ~(sizey << 1); |
| 208 | 208 | |
| 209 | if (flip_screen_get()) | |
| 209 | if (flip_screen_get(machine)) | |
| 210 | 210 | { |
| 211 | 211 | flipx ^= 1; |
| 212 | 212 | flipy ^= 1; |
| r3957 | r3958 | |
| 234 | 234 | |
| 235 | 235 | VIDEO_UPDATE( skykid ) |
| 236 | 236 | { |
| 237 | if (flip_screen_get()) | |
| 237 | if (flip_screen_get(screen->machine)) | |
| 238 | 238 | { |
| 239 | 239 | tilemap_set_scrollx(bg_tilemap, 0, 189 - (scroll_x ^ 1)); |
| 240 | 240 | tilemap_set_scrolly(bg_tilemap, 0, 7 - scroll_y); |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | WRITE8_HANDLER (mustache_video_control_w) |
| 54 | 54 | { |
| 55 | if (flip_screen_get() != (data & 0x01)) | |
| 55 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 56 | 56 | { |
| 57 | flip_screen_set(data & 0x01); | |
| 57 | flip_screen_set(space->machine, data & 0x01); | |
| 58 | 58 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 59 | 59 | } |
| 60 | 60 | |
| r3957 | r3958 | |
| 116 | 116 | if ((control_byte & 0xa)) |
| 117 | 117 | clip.max_y = visarea->max_y; |
| 118 | 118 | else |
| 119 | if (flip_screen_get()) | |
| 119 | if (flip_screen_get(machine)) | |
| 120 | 120 | clip.min_y = visarea->min_y + 56; |
| 121 | 121 | else |
| 122 | 122 | clip.max_y = visarea->max_y - 56; |
| 123 | 123 | |
| 124 | if (flip_screen_get()) | |
| 124 | if (flip_screen_get(machine)) | |
| 125 | 125 | { |
| 126 | 126 | sx = 240 - sx; |
| 127 | 127 | sy = 240 - sy; |
| r3957 | r3958 | |
| 130 | 130 | drawgfx(bitmap,gfx, |
| 131 | 131 | code, |
| 132 | 132 | color, |
| 133 | flip_screen_get(),flip_screen_get(), | |
| 133 | flip_screen_get(machine),flip_screen_get(machine), | |
| 134 | 134 | sx,sy, |
| 135 | 135 | &clip,TRANSPARENCY_PEN,0); |
| 136 | 136 | } |
| r3957 | r3958 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | WRITE8_HANDLER( ladybug_flipscreen_w ) |
| 163 | 163 | { |
| 164 | if (flip_screen_get() != (data & 0x01)) | |
| 164 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 165 | 165 | { |
| 166 | flip_screen_set(data & 0x01); | |
| 166 | flip_screen_set(space->machine, data & 0x01); | |
| 167 | 167 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 168 | 168 | } |
| 169 | 169 | } |
| r3957 | r3958 | |
| 250 | 250 | // bit3 = enable stars |
| 251 | 251 | // bit210 = stars speed/dir |
| 252 | 252 | |
| 253 | if (flip_screen_get() != (data & 0x80)) | |
| 253 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 254 | 254 | { |
| 255 | flip_screen_set(data & 0x80); | |
| 255 | flip_screen_set(space->machine, data & 0x80); | |
| 256 | 256 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 257 | 257 | } |
| 258 | 258 | |
| r3957 | r3958 | |
| 370 | 370 | int sx = offs % 4; |
| 371 | 371 | int sy = offs / 4; |
| 372 | 372 | |
| 373 | if (flip_screen_get()) | |
| 373 | if (flip_screen_get(screen->machine)) | |
| 374 | 374 | tilemap_set_scrollx(bg_tilemap, offs, -videoram[32 * sx + sy]); |
| 375 | 375 | else |
| 376 | 376 | tilemap_set_scrollx(bg_tilemap, offs, videoram[32 * sx + sy]); |
| r3957 | r3958 | |
| 399 | 399 | int sx = offs % 4; |
| 400 | 400 | int sy = offs / 4; |
| 401 | 401 | |
| 402 | if (flip_screen_get()) | |
| 402 | if (flip_screen_get(screen->machine)) | |
| 403 | 403 | tilemap_set_scrollx(bg_tilemap, offs, -videoram[32 * sx + sy]); |
| 404 | 404 | else |
| 405 | 405 | tilemap_set_scrollx(bg_tilemap, offs, videoram[32 * sx + sy]); |
| r3957 | r3958 | |
| 409 | 409 | bitmap_fill(bitmap,cliprect,0); |
| 410 | 410 | |
| 411 | 411 | // draw the stars |
| 412 | if (flip_screen_get()) | |
| 412 | if (flip_screen_get(screen->machine)) | |
| 413 | 413 | redclash_draw_stars(bitmap,cliprect,0x60,1,0x27,0xff); |
| 414 | 414 | else |
| 415 | 415 | redclash_draw_stars(bitmap,cliprect,0x60,1,0x00,0xd8); |
| r3957 | r3958 | |
| 418 | 418 | colortable_palette_set_color(screen->machine->colortable, 0x40, MAKE_RGB(sraider_grid_color & 0x40 ? 0xff : 0, |
| 419 | 419 | sraider_grid_color & 0x20 ? 0xff : 0, |
| 420 | 420 | sraider_grid_color & 0x10 ? 0xff : 0)); |
| 421 | tilemap_draw(bitmap, cliprect, grid_tilemap, 0, flip_screen_get()); | |
| 421 | tilemap_draw(bitmap, cliprect, grid_tilemap, 0, flip_screen_get(screen->machine)); | |
| 422 | 422 | |
| 423 | 423 | for (i = 0; i < 0x100; i++) |
| 424 | 424 | { |
| r3957 | r3958 | |
| 428 | 428 | |
| 429 | 429 | int height = cliprect->max_y - cliprect->min_y + 1; |
| 430 | 430 | |
| 431 | if (flip_screen_get()) | |
| 431 | if (flip_screen_get(screen->machine)) | |
| 432 | 432 | x = ~x; |
| 433 | 433 | |
| 434 | 434 | plot_box(bitmap, x, cliprect->min_y, 1, height, 0x81); |
| r3957 | r3958 | |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | // now the chars |
| 439 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, flip_screen_get()); | |
| 439 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, flip_screen_get(screen->machine)); | |
| 440 | 440 | |
| 441 | 441 | // now the sprites |
| 442 | 442 | draw_sprites(screen->machine, bitmap, cliprect); |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | WRITE8_HANDLER( blueprnt_flipscreen_w ) |
| 58 | 58 | { |
| 59 | flip_screen_set(~data & 0x02); | |
| 59 | flip_screen_set(space->machine, ~data & 0x02); | |
| 60 | 60 | |
| 61 | 61 | if (gfx_bank != ((data & 0x04) >> 2)) |
| 62 | 62 | { |
| r3957 | r3958 | |
| 97 | 97 | int flipx = spriteram[offs + 2] & 0x40; |
| 98 | 98 | int flipy = spriteram[offs + 2 - 4] & 0x80; // -4? Awkward, isn't it? |
| 99 | 99 | |
| 100 | if (flip_screen_get()) | |
| 100 | if (flip_screen_get(machine)) | |
| 101 | 101 | { |
| 102 | 102 | sx = 248 - sx; |
| 103 | 103 | sy = 240 - sy; |
| r3957 | r3958 | |
| 115 | 115 | { |
| 116 | 116 | int i; |
| 117 | 117 | |
| 118 | if (flip_screen_get()) | |
| 118 | if (flip_screen_get(screen->machine)) | |
| 119 | 119 | for (i = 0; i < 32; i++) |
| 120 | 120 | tilemap_set_scrolly(bg_tilemap, i, blueprnt_scrollram[32 - i]); |
| 121 | 121 | else |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | bit0 = VINV |
| 71 | 71 | */ |
| 72 | 72 | |
| 73 | flip_screen_y_set(data & 0x01); | |
| 74 | flip_screen_x_set(data & 0x02); | |
| 73 | flip_screen_y_set(space->machine, data & 0x01); | |
| 74 | flip_screen_x_set(space->machine, data & 0x02); | |
| 75 | 75 | |
| 76 | 76 | bg_on = data & 0x04; |
| 77 | 77 | sky_on = data & 0x08; |
| r3957 | r3958 | |
| 112 | 112 | int sx = offs % 32; |
| 113 | 113 | int sy = offs / 32; |
| 114 | 114 | |
| 115 | if (flip_screen_x_get()) sx = 31 - sx; | |
| 116 | if (flip_screen_y_get()) sy = 31 - sy; | |
| 115 | if (flip_screen_x_get(machine)) sx = 31 - sx; | |
| 116 | if (flip_screen_y_get(machine)) sy = 31 - sy; | |
| 117 | 117 | |
| 118 | 118 | drawgfx(tmpbitmap1,machine->gfx[0], |
| 119 | 119 | code, |
| 120 | 120 | 2, |
| 121 | flip_screen_x_get(),flip_screen_y_get(), | |
| 121 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 122 | 122 | 8*sx,8*sy, |
| 123 | 123 | NULL,TRANSPARENCY_NONE,0); |
| 124 | 124 | } |
| r3957 | r3958 | |
| 151 | 151 | |
| 152 | 152 | int code = videoram[offs]; |
| 153 | 153 | |
| 154 | if (flip_screen_x_get()) sx = 31 - sx; | |
| 155 | if (flip_screen_y_get()) sy = 31 - sy; | |
| 154 | if (flip_screen_x_get(machine)) sx = 31 - sx; | |
| 155 | if (flip_screen_y_get(machine)) sy = 31 - sy; | |
| 156 | 156 | |
| 157 | 157 | drawgfx(bitmap,machine->gfx[0], |
| 158 | 158 | code, |
| 159 | 159 | 0, |
| 160 | flip_screen_x_get(),flip_screen_y_get(), | |
| 160 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 161 | 161 | 8*sx,8*sy, |
| 162 | 162 | cliprect,transp,0); |
| 163 | 163 | } |
| r3957 | r3958 | |
| 190 | 190 | |
| 191 | 191 | for (y = 0;y < 64;y++) |
| 192 | 192 | { |
| 193 | int dy = flip_screen_y_get() ? (255 - sy - y) : (sy + y); | |
| 193 | int dy = flip_screen_y_get(machine) ? (255 - sy - y) : (sy + y); | |
| 194 | 194 | |
| 195 | 195 | if ((dy & ~0xff) == 0) |
| 196 | 196 | { |
| r3957 | r3958 | |
| 219 | 219 | col = pendata[x]; |
| 220 | 220 | if (col) |
| 221 | 221 | { |
| 222 | int dx = flip_screen_x_get() ? (255 - sx - px) : (sx + px); | |
| 222 | int dx = flip_screen_x_get(machine) ? (255 - sx - px) : (sx + px); | |
| 223 | 223 | if ((dx & ~0xff) == 0) |
| 224 | 224 | *BITMAP_ADDR16(bitmap, dy, dx) = sprite_color_base + col; |
| 225 | 225 | } |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | 5 | #include "driver.h" |
| 6 | #include "deprecat.h" | |
| 7 | 6 | #include "includes/n64.h" |
| 8 | 7 | |
| 9 | 8 | #define LOG_RDP_EXECUTION 0 |
| r3957 | r3958 | |
| 2866 | 2865 | // RDP COMMANDS |
| 2867 | 2866 | //////////////////////// |
| 2868 | 2867 | |
| 2869 | static void rdp_invalid(UINT32 w1, UINT32 w2) | |
| 2868 | typedef void (*rdp_command_func)(running_machine *machine, UINT32 w1, UINT32 w2); | |
| 2869 | #define RDP_COMMAND(name) void name(running_machine *machine, UINT32 w1, UINT32 w2) | |
| 2870 | ||
| 2871 | static RDP_COMMAND( rdp_invalid ) | |
| 2870 | 2872 | { |
| 2871 | 2873 | fatalerror("RDP: invalid command %d, %08X %08X\n", (w1 >> 24) & 0x3f, w1, w2); |
| 2872 | 2874 | } |
| 2873 | 2875 | |
| 2874 | static | |
| 2876 | static RDP_COMMAND( rdp_noop | |
| 2875 | 2877 | { |
| 2876 | 2878 | |
| 2877 | 2879 | } |
| 2878 | 2880 | |
| 2879 | static | |
| 2881 | static RDP_COMMAND( rdp_tri_noshade | |
| 2880 | 2882 | { |
| 2881 | 2883 | //fatalerror("RDP: unhandled command tri_noshade, %08X %08X\n", w1, w2); |
| 2882 | 2884 | triangle(w1, w2, 0, 0, 0); |
| 2883 | 2885 | } |
| 2884 | 2886 | |
| 2885 | static | |
| 2887 | static RDP_COMMAND( rdp_tri_noshade_z | |
| 2886 | 2888 | { |
| 2887 | 2889 | //fatalerror("RDP: unhandled command tri_noshade_z, %08X %08X\n", w1, w2); |
| 2888 | 2890 | triangle(w1, w2, 0, 0, 1); |
| 2889 | 2891 | } |
| 2890 | 2892 | |
| 2891 | static | |
| 2893 | static RDP_COMMAND( rdp_tri_tex | |
| 2892 | 2894 | { |
| 2893 | 2895 | //osd_die("RDP: unhandled command tri_tex, %08X %08X\n", w1, w2); |
| 2894 | 2896 | |
| 2895 | 2897 | triangle(w1, w2, 0, 1, 0); |
| 2896 | 2898 | } |
| 2897 | 2899 | |
| 2898 | static | |
| 2900 | static RDP_COMMAND( rdp_tri_tex_z | |
| 2899 | 2901 | { |
| 2900 | 2902 | //osd_die("RDP: unhandled command tri_tex_z, %08X %08X\n", w1, w2); |
| 2901 | 2903 | |
| 2902 | 2904 | triangle(w1, w2, 0, 1, 1); |
| 2903 | 2905 | } |
| 2904 | 2906 | |
| 2905 | static | |
| 2907 | static RDP_COMMAND( rdp_tri_shade | |
| 2906 | 2908 | { |
| 2907 | 2909 | //osd_die("RDP: unhandled command tri_shade, %08X %08X\n", w1, w2); |
| 2908 | 2910 | |
| 2909 | 2911 | triangle(w1, w2, 1, 0, 0); |
| 2910 | 2912 | } |
| 2911 | 2913 | |
| 2912 | static | |
| 2914 | static RDP_COMMAND( rdp_tri_shade_z | |
| 2913 | 2915 | { |
| 2914 | 2916 | //osd_die("RDP: unhandled command tri_shade_z, %08X %08X\n", w1, w2); |
| 2915 | 2917 | |
| 2916 | 2918 | triangle(w1, w2, 1, 0, 1); |
| 2917 | 2919 | } |
| 2918 | 2920 | |
| 2919 | static | |
| 2921 | static RDP_COMMAND( rdp_tri_texshade | |
| 2920 | 2922 | { |
| 2921 | 2923 | //osd_die("RDP: unhandled command tri_texshade, %08X %08X\n", w1, w2); |
| 2922 | 2924 | |
| 2923 | 2925 | triangle(w1, w2, 1, 1, 0); |
| 2924 | 2926 | } |
| 2925 | 2927 | |
| 2926 | static | |
| 2928 | static RDP_COMMAND( rdp_tri_texshade_z | |
| 2927 | 2929 | { |
| 2928 | 2930 | //osd_die("RDP: unhandled command tri_texshade_z, %08X %08X\n", w1, w2); |
| 2929 | 2931 | |
| 2930 | 2932 | triangle(w1, w2, 1, 1, 1); |
| 2931 | 2933 | } |
| 2932 | 2934 | |
| 2933 | static | |
| 2935 | static RDP_COMMAND( rdp_tex_rect | |
| 2934 | 2936 | { |
| 2935 | 2937 | UINT32 w3, w4; |
| 2936 | 2938 | TEX_RECTANGLE rect; |
| r3957 | r3958 | |
| 2955 | 2957 | } |
| 2956 | 2958 | } |
| 2957 | 2959 | |
| 2958 | static | |
| 2960 | static RDP_COMMAND( rdp_tex_rect_flip | |
| 2959 | 2961 | { |
| 2960 | 2962 | UINT32 w3, w4; |
| 2961 | 2963 | TEX_RECTANGLE rect; |
| r3957 | r3958 | |
| 2980 | 2982 | } |
| 2981 | 2983 | } |
| 2982 | 2984 | |
| 2983 | static | |
| 2985 | static RDP_COMMAND( rdp_sync_load | |
| 2984 | 2986 | { |
| 2985 | 2987 | // Nothing to do? |
| 2986 | 2988 | } |
| 2987 | 2989 | |
| 2988 | static | |
| 2990 | static RDP_COMMAND( rdp_sync_pipe | |
| 2989 | 2991 | { |
| 2990 | 2992 | // Nothing to do? |
| 2991 | 2993 | } |
| 2992 | 2994 | |
| 2993 | static | |
| 2995 | static RDP_COMMAND( rdp_sync_tile | |
| 2994 | 2996 | { |
| 2995 | 2997 | // Nothing to do? |
| 2996 | 2998 | } |
| 2997 | 2999 | |
| 2998 | static | |
| 3000 | static RDP_COMMAND( rdp_sync_full | |
| 2999 | 3001 | { |
| 3000 | dp_full_sync( | |
| 3002 | dp_full_sync(machine); | |
| 3001 | 3003 | } |
| 3002 | 3004 | |
| 3003 | static | |
| 3005 | static RDP_COMMAND( rdp_set_key_gb | |
| 3004 | 3006 | { |
| 3005 | 3007 | //osd_die("RDP: unhandled command set_key_gb, %08X %08X\n", w1, w2); |
| 3006 | 3008 | } |
| 3007 | 3009 | |
| 3008 | static | |
| 3010 | static RDP_COMMAND( rdp_set_key_r | |
| 3009 | 3011 | { |
| 3010 | 3012 | //osd_die("RDP: unhandled command set_key_r, %08X %08X\n", w1, w2); |
| 3011 | 3013 | } |
| 3012 | 3014 | |
| 3013 | static | |
| 3015 | static RDP_COMMAND( rdp_set_convert | |
| 3014 | 3016 | { |
| 3015 | 3017 | //osd_die("RDP: unhandled command set_convert, %08X %08X\n", w1, w2); |
| 3016 | 3018 | } |
| 3017 | 3019 | |
| 3018 | static | |
| 3020 | static RDP_COMMAND( rdp_set_scissor | |
| 3019 | 3021 | { |
| 3020 | 3022 | clip.xh = (w1 >> 12) & 0xfff; |
| 3021 | 3023 | clip.yh = (w1 >> 0) & 0xfff; |
| r3957 | r3958 | |
| 3025 | 3027 | // TODO: handle f & o? |
| 3026 | 3028 | } |
| 3027 | 3029 | |
| 3028 | static | |
| 3030 | static RDP_COMMAND( rdp_set_prim_depth | |
| 3029 | 3031 | { |
| 3030 | 3032 | primitive_z = (UINT16)(w2 >> 16); |
| 3031 | 3033 | primitive_delta_z = (UINT16)(w1); |
| 3032 | 3034 | } |
| 3033 | 3035 | |
| 3034 | static | |
| 3036 | static RDP_COMMAND( rdp_set_other_modes | |
| 3035 | 3037 | { |
| 3036 | 3038 | other_modes.cycle_type = (w1 >> 20) & 0x3; |
| 3037 | 3039 | other_modes.persp_tex_en = (w1 & 0x80000) ? 1 : 0; |
| r3957 | r3958 | |
| 3090 | 3092 | } |
| 3091 | 3093 | } |
| 3092 | 3094 | |
| 3093 | static | |
| 3095 | static RDP_COMMAND( rdp_load_tlut | |
| 3094 | 3096 | { |
| 3095 | 3097 | int i; |
| 3096 | 3098 | UINT16 sl, sh; |
| r3957 | r3958 | |
| 3127 | 3129 | |
| 3128 | 3130 | } |
| 3129 | 3131 | |
| 3130 | static | |
| 3132 | static RDP_COMMAND( rdp_set_tile_size | |
| 3131 | 3133 | { |
| 3132 | 3134 | int tilenum = (w2 >> 24) & 0x7; |
| 3133 | 3135 | |
| r3957 | r3958 | |
| 3137 | 3139 | tile[tilenum].th = (w2 >> 0) & 0xfff; |
| 3138 | 3140 | } |
| 3139 | 3141 | |
| 3140 | static | |
| 3142 | static RDP_COMMAND( rdp_load_block | |
| 3141 | 3143 | { |
| 3142 | 3144 | int i, width; |
| 3143 | 3145 | UINT16 sl, sh, tl, dxt; |
| r3957 | r3958 | |
| 3190 | 3192 | } |
| 3191 | 3193 | } |
| 3192 | 3194 | |
| 3193 | static | |
| 3195 | static RDP_COMMAND( rdp_load_tile | |
| 3194 | 3196 | { |
| 3195 | 3197 | int i, j; |
| 3196 | 3198 | UINT16 sl, sh, tl, th; |
| r3957 | r3958 | |
| 3285 | 3287 | |
| 3286 | 3288 | } |
| 3287 | 3289 | |
| 3288 | static | |
| 3290 | static RDP_COMMAND( rdp_set_tile | |
| 3289 | 3291 | { |
| 3290 | 3292 | int tilenum = (w2 >> 24) & 0x7; |
| 3291 | 3293 | |
| r3957 | r3958 | |
| 3305 | 3307 | // TODO: clamp & mirror parameters |
| 3306 | 3308 | } |
| 3307 | 3309 | |
| 3308 | static | |
| 3310 | static RDP_COMMAND( rdp_fill_rect | |
| 3309 | 3311 | { |
| 3310 | 3312 | RECTANGLE rect; |
| 3311 | 3313 | rect.xl = (w1 >> 12) & 0xfff; |
| r3957 | r3958 | |
| 3320 | 3322 | } |
| 3321 | 3323 | } |
| 3322 | 3324 | |
| 3323 | static | |
| 3325 | static RDP_COMMAND( rdp_set_fill_color | |
| 3324 | 3326 | { |
| 3325 | 3327 | fill_color = w2; |
| 3326 | 3328 | } |
| 3327 | 3329 | |
| 3328 | static | |
| 3330 | static RDP_COMMAND( rdp_set_fog_color | |
| 3329 | 3331 | { |
| 3330 | 3332 | fog_color.r = (w2 >> 24) & 0xff; |
| 3331 | 3333 | fog_color.g = (w2 >> 16) & 0xff; |
| r3957 | r3958 | |
| 3333 | 3335 | fog_color.a = (w2 >> 0) & 0xff; |
| 3334 | 3336 | } |
| 3335 | 3337 | |
| 3336 | static | |
| 3338 | static RDP_COMMAND( rdp_set_blend_color | |
| 3337 | 3339 | { |
| 3338 | 3340 | blend_color.r = (w2 >> 24) & 0xff; |
| 3339 | 3341 | blend_color.g = (w2 >> 16) & 0xff; |
| r3957 | r3958 | |
| 3341 | 3343 | blend_color.a = (w2 >> 0) & 0xff; |
| 3342 | 3344 | } |
| 3343 | 3345 | |
| 3344 | static | |
| 3346 | static RDP_COMMAND( rdp_set_prim_color | |
| 3345 | 3347 | { |
| 3346 | 3348 | // TODO: prim min level, prim_level |
| 3347 | 3349 | prim_color.r = (w2 >> 24) & 0xff; |
| r3957 | r3958 | |
| 3350 | 3352 | prim_color.a = (w2 >> 0) & 0xff; |
| 3351 | 3353 | } |
| 3352 | 3354 | |
| 3353 | static | |
| 3355 | static RDP_COMMAND( rdp_set_env_color | |
| 3354 | 3356 | { |
| 3355 | 3357 | env_color.r = (w2 >> 24) & 0xff; |
| 3356 | 3358 | env_color.g = (w2 >> 16) & 0xff; |
| r3957 | r3958 | |
| 3358 | 3360 | env_color.a = (w2 >> 0) & 0xff; |
| 3359 | 3361 | } |
| 3360 | 3362 | |
| 3361 | static | |
| 3363 | static RDP_COMMAND( rdp_set_combine | |
| 3362 | 3364 | { |
| 3363 | 3365 | combine.sub_a_rgb0 = (w1 >> 20) & 0xf; |
| 3364 | 3366 | combine.mul_rgb0 = (w1 >> 15) & 0x1f; |
| r3957 | r3958 | |
| 3397 | 3399 | SET_SUB_ALPHA_INPUT(&combiner_alphaadd[1], combine.add_a1); |
| 3398 | 3400 | } |
| 3399 | 3401 | |
| 3400 | static | |
| 3402 | static RDP_COMMAND( rdp_set_texture_image | |
| 3401 | 3403 | { |
| 3402 | 3404 | ti_format = (w1 >> 21) & 0x7; |
| 3403 | 3405 | ti_size = (w1 >> 19) & 0x3; |
| r3957 | r3958 | |
| 3405 | 3407 | ti_address = w2 & 0x01ffffff; |
| 3406 | 3408 | } |
| 3407 | 3409 | |
| 3408 | static | |
| 3410 | static RDP_COMMAND( rdp_set_mask_image | |
| 3409 | 3411 | { |
| 3410 | 3412 | zb_address = w2 & 0x01ffffff; |
| 3411 | 3413 | } |
| 3412 | 3414 | |
| 3413 | static | |
| 3415 | static RDP_COMMAND( rdp_set_color_image | |
| 3414 | 3416 | { |
| 3415 | 3417 | fb_format = (w1 >> 21) & 0x7; |
| 3416 | 3418 | fb_size = (w1 >> 19) & 0x3; |
| r3957 | r3958 | |
| 3423 | 3425 | |
| 3424 | 3426 | /*****************************************************************************/ |
| 3425 | 3427 | |
| 3426 | static | |
| 3428 | static | |
| 3427 | 3429 | { |
| 3428 | 3430 | /* 0x00 */ |
| 3429 | 3431 | rdp_noop, rdp_invalid, rdp_invalid, rdp_invalid, |
| r3957 | r3958 | |
| 3447 | 3449 | rdp_set_combine, rdp_set_texture_image, rdp_set_mask_image, rdp_set_color_image |
| 3448 | 3450 | }; |
| 3449 | 3451 | |
| 3450 | void rdp_process_list( | |
| 3452 | void rdp_process_list(running_machine *machine) | |
| 3451 | 3453 | { |
| 3452 | 3454 | int i; |
| 3453 | 3455 | UINT32 cmd, length, cmd_length; |
| r3957 | r3958 | |
| 3498 | 3500 | } |
| 3499 | 3501 | |
| 3500 | 3502 | // execute the command |
| 3501 | rdp_command_table[cmd](rdp_cmd_data[rdp_cmd_cur+0], rdp_cmd_data[rdp_cmd_cur+1]); | |
| 3503 | rdp_command_table[cmd](machine, rdp_cmd_data[rdp_cmd_cur+0], rdp_cmd_data[rdp_cmd_cur+1]); | |
| 3502 | 3504 | |
| 3503 | 3505 | rdp_cmd_cur += rdp_command_length[cmd] / 4; |
| 3504 | 3506 | }; |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | int flipx = attr & 0x10; |
| 154 | 154 | int flipy = attr & 0x20; |
| 155 | 155 | |
| 156 | if (flip_screen_get()) | |
| 156 | if (flip_screen_get(machine)) | |
| 157 | 157 | { |
| 158 | 158 | sx = 240 - sx; |
| 159 | 159 | sy = 240 - sy; |
| r3957 | r3958 | |
| 205 | 205 | int flipx = attr & 0x10; |
| 206 | 206 | int flipy = attr & 0x20; |
| 207 | 207 | |
| 208 | if (flip_screen_get()) | |
| 208 | if (flip_screen_get(machine)) | |
| 209 | 209 | { |
| 210 | 210 | sx = 240 - sx; |
| 211 | 211 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 235 | 235 | /* 0x40 = sprites */ |
| 236 | 236 | tilemap_set_enable(bg_tilemap,data & 0x20); |
| 237 | 237 | tilemap_set_enable(fg_tilemap,data & 0x10); |
| 238 | flip_screen_set(data & 0x01); | |
| 238 | flip_screen_set(space->machine, data & 0x01); | |
| 239 | 239 | break; |
| 240 | 240 | } |
| 241 | 241 | } |
| r3957 | r3958 | |
| 272 | 272 | sx -= 0x100; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | if (flip_screen_get()) | |
| 275 | if (flip_screen_get(machine)) | |
| 276 | 276 | { |
| 277 | 277 | sx = 240 - sx; |
| 278 | 278 | sy = 240 - sy; |
| r3957 | r3958 | |
| 284 | 284 | pdrawgfx(bitmap,machine->gfx[4], |
| 285 | 285 | code, |
| 286 | 286 | color, |
| 287 | flipx,flip_screen_get(), | |
| 287 | flipx,flip_screen_get(machine), | |
| 288 | 288 | sx,sy, |
| 289 | 289 | cliprect,TRANSPARENCY_PEN,0x0f, |
| 290 | 290 | pri ? 0x02 : 0); |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | background_priority = data & 0x01; |
| 65 | 65 | |
| 66 | 66 | /* bit 1 controls horizonal flip screen */ |
| 67 | if (flip_screen_x_get() != (data & 0x02)) | |
| 67 | if (flip_screen_x_get(space->machine) != (data & 0x02)) | |
| 68 | 68 | { |
| 69 | flip_screen_x_set(data & 0x02); | |
| 69 | flip_screen_x_set(space->machine, data & 0x02); | |
| 70 | 70 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /* bit 2 controls horizonal flip screen */ |
| 74 | if (flip_screen_y_get() != (data & 0x04)) | |
| 74 | if (flip_screen_y_get(space->machine) != (data & 0x04)) | |
| 75 | 75 | { |
| 76 | flip_screen_y_set(data & 0x04); | |
| 76 | flip_screen_y_set(space->machine, data & 0x04); | |
| 77 | 77 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 78 | 78 | } |
| 79 | 79 | |
| r3957 | r3958 | |
| 194 | 194 | int sy = (spriteram[offs]) - 13; |
| 195 | 195 | int code = (255 ^ spriteram[offs + 2]) + 256 * spritebank; |
| 196 | 196 | |
| 197 | if (flip_screen_x_get()) sx = 233 - sx; | |
| 198 | if (flip_screen_y_get()) sy = 244 - sy; | |
| 197 | if (flip_screen_x_get(machine)) sx = 233 - sx; | |
| 198 | if (flip_screen_y_get(machine)) sy = 244 - sy; | |
| 199 | 199 | |
| 200 | 200 | drawgfx(bitmap, machine->gfx[2], |
| 201 | 201 | code, 0, |
| 202 | flip_screen_x_get(), flip_screen_y_get(), | |
| 202 | flip_screen_x_get(machine), flip_screen_y_get(machine), | |
| 203 | 203 | sx,sy, |
| 204 | 204 | &clip, |
| 205 | 205 | TRANSPARENCY_PEN, 0); |
| r3957 | r3958 | |
|---|---|---|
| 203 | 203 | which = src[i+3] + ( ( src[i+2] & 0x0f ) << 8 ); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | if (flip_screen_get()) | |
| 206 | if (flip_screen_get(machine)) | |
| 207 | 207 | { |
| 208 | 208 | sx = 240 - sx; |
| 209 | 209 | sy = 256 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | WRITE8_HANDLER( pcktgal_flipscreen_w ) |
| 40 | 40 | { |
| 41 | if (flip_screen_get() != (data & 0x80)) | |
| 41 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 42 | 42 | { |
| 43 | flip_screen_set(data & 0x80); | |
| 43 | flip_screen_set(space->machine, data & 0x80); | |
| 44 | 44 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 45 | 45 | } |
| 46 | 46 | } |
| r3957 | r3958 | |
| 75 | 75 | |
| 76 | 76 | flipx = spriteram[offs+1] & 0x04; |
| 77 | 77 | flipy = spriteram[offs+1] & 0x02; |
| 78 | if (flip_screen_get()) { | |
| 78 | if (flip_screen_get(machine)) { | |
| 79 | 79 | sx=240-sx; |
| 80 | 80 | sy=240-sy; |
| 81 | 81 | if (flipx) flipx=0; else flipx=1; |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | WRITE8_HANDLER( solomon_flipscreen_w ) |
| 33 | 33 | { |
| 34 | if (flip_screen_get() != (data & 0x01)) | |
| 34 | if (flip_screen_get(space->machine) != (data & 0x01)) | |
| 35 | 35 | { |
| 36 | flip_screen_set(data & 0x01); | |
| 36 | flip_screen_set(space->machine, data & 0x01); | |
| 37 | 37 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 38 | 38 | } |
| 39 | 39 | } |
| r3957 | r3958 | |
| 81 | 81 | int sx = spriteram[offs + 3]; |
| 82 | 82 | int sy = 241 - spriteram[offs + 2]; |
| 83 | 83 | |
| 84 | if (flip_screen_get()) | |
| 84 | if (flip_screen_get(machine)) | |
| 85 | 85 | { |
| 86 | 86 | sx = 240 - sx; |
| 87 | 87 | sy = 242 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 221 | 221 | int color = src[1] & 0x1f; |
| 222 | 222 | int x,y; |
| 223 | 223 | |
| 224 | if (flip_screen_get()) | |
| 224 | if (flip_screen_get(machine)) | |
| 225 | 225 | { |
| 226 | 226 | xflip = !xflip; |
| 227 | 227 | yflip = !yflip; |
| r3957 | r3958 | |
| 291 | 291 | int scroll; |
| 292 | 292 | |
| 293 | 293 | scroll = bg_scrollx + ((video_attributes & 0x04) << 6); |
| 294 | tilemap_set_scrollx(bg_tilemap, 0, scroll ^ (flip_screen_get() ? 0x0f : 0)); | |
| 294 | tilemap_set_scrollx(bg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine) ? 0x0f : 0)); | |
| 295 | 295 | scroll = fg_scrollx + ((video_attributes & 0x08) << 5); |
| 296 | tilemap_set_scrollx(fg_tilemap, 0, scroll ^ (flip_screen_get() ? 0x0f : 0)); | |
| 296 | tilemap_set_scrollx(fg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine) ? 0x0f : 0)); | |
| 297 | 297 | |
| 298 | 298 | // always 0 anyway |
| 299 | 299 | tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly); |
| r3957 | r3958 | |
|---|---|---|
| 100 | 100 | sx = sprite_ram[offs]; |
| 101 | 101 | sy = 240-sprite_ram[offs+1]; |
| 102 | 102 | |
| 103 | if (flip_screen_get()) | |
| 103 | if (flip_screen_get(machine)) | |
| 104 | 104 | { |
| 105 | 105 | sx = 248 - sx; |
| 106 | 106 | sy = 248 - sy; |
| r3957 | r3958 | |
| 115 | 115 | drawgfx(bitmap,machine->gfx[gfxbank], |
| 116 | 116 | tile, |
| 117 | 117 | palette, |
| 118 | flip_screen_get(),flip_screen_get(), | |
| 118 | flip_screen_get(machine),flip_screen_get(machine), | |
| 119 | 119 | sx,sy, |
| 120 | 120 | cliprect, |
| 121 | 121 | TRANSPARENCY_PEN, 0); |
| 122 | 122 | drawgfx(bitmap,machine->gfx[gfxbank], |
| 123 | 123 | tile+1, |
| 124 | 124 | palette, |
| 125 | flip_screen_get(),flip_screen_get(), | |
| 126 | sx,sy + (flip_screen_get() ? -8 : 8), | |
| 125 | flip_screen_get(machine),flip_screen_get(machine), | |
| 126 | sx,sy + (flip_screen_get(machine) ? -8 : 8), | |
| 127 | 127 | cliprect, |
| 128 | 128 | TRANSPARENCY_PEN, 0); |
| 129 | 129 | } |
| r3957 | r3958 | |
|---|---|---|
| 60 | 60 | tilemap_set_flip(background_layer,flip); |
| 61 | 61 | tilemap_set_flip(text_layer,flip); |
| 62 | 62 | |
| 63 | flip_screen_set(data & 0x20); | |
| 63 | flip_screen_set(space->machine, data & 0x20); | |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| r3957 | r3958 | |
| 119 | 119 | |
| 120 | 120 | if ( sx>256 ) sx -= 512; |
| 121 | 121 | |
| 122 | if (flip_screen_get()) | |
| 122 | if (flip_screen_get(machine)) | |
| 123 | 123 | { |
| 124 | 124 | sx = 240 - sx; |
| 125 | 125 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 156 | 156 | |
| 157 | 157 | static CDP1869_INTERFACE( destryer_cdp1869_intf ) |
| 158 | 158 | { |
| 159 | SCREEN_TAG, | |
| 160 | MAIN_CPU_TAG, | |
| 161 | DESTRYER_CHR2, | |
| 162 | 0, | |
| 163 | 159 | CDP1869_PAL, |
| 164 | 160 | cidelsa_pageram_r, |
| 165 | 161 | cidelsa_pageram_w, |
| r3957 | r3958 | |
| 171 | 167 | |
| 172 | 168 | static CDP1869_INTERFACE( altair_cdp1869_intf ) |
| 173 | 169 | { |
| 174 | SCREEN_TAG, | |
| 175 | MAIN_CPU_TAG, | |
| 176 | ALTAIR_CHR2, | |
| 177 | 0, | |
| 178 | 170 | CDP1869_PAL, |
| 179 | 171 | cidelsa_pageram_r, |
| 180 | 172 | cidelsa_pageram_w, |
| r3957 | r3958 | |
| 186 | 178 | |
| 187 | 179 | static CDP1869_INTERFACE( draco_cdp1869_intf ) |
| 188 | 180 | { |
| 189 | SCREEN_TAG, | |
| 190 | MAIN_CPU_TAG, | |
| 191 | DRACO_CHR2, | |
| 192 | 0, | |
| 193 | 181 | CDP1869_PAL, |
| 194 | 182 | draco_pageram_r, |
| 195 | 183 | draco_pageram_w, |
| r3957 | r3958 | |
| 272 | 260 | MDRV_SCREEN_RAW_PARAMS(DESTRYER_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) |
| 273 | 261 | MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.4, 0.044) |
| 274 | 262 | |
| 275 | MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO) | |
| 276 | MDRV_DEVICE_CONFIG(destryer_cdp1869_intf) | |
| 263 | MDRV_CDP1869_ADD(CDP1869_TAG, SCREEN_TAG, DESTRYER_CHR2, 0, MAIN_CPU_TAG, destryer_cdp1869_intf) | |
| 277 | 264 | MACHINE_DRIVER_END |
| 278 | 265 | |
| 279 | 266 | MACHINE_DRIVER_START( altair_video ) |
| r3957 | r3958 | |
| 288 | 275 | MDRV_SCREEN_RAW_PARAMS(ALTAIR_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) |
| 289 | 276 | MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.4, 0.044) |
| 290 | 277 | |
| 291 | MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO) | |
| 292 | MDRV_DEVICE_CONFIG(altair_cdp1869_intf) | |
| 278 | MDRV_CDP1869_ADD(CDP1869_TAG, SCREEN_TAG, ALTAIR_CHR2, 0, MAIN_CPU_TAG, altair_cdp1869_intf) | |
| 293 | 279 | MACHINE_DRIVER_END |
| 294 | 280 | |
| 295 | 281 | MACHINE_DRIVER_START( draco_video ) |
| r3957 | r3958 | |
| 304 | 290 | MDRV_SCREEN_RAW_PARAMS(DRACO_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) |
| 305 | 291 | MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.360, 0.024) |
| 306 | 292 | |
| 307 | MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO) | |
| 308 | MDRV_DEVICE_CONFIG(draco_cdp1869_intf) | |
| 293 | MDRV_CDP1869_ADD(CDP1869_TAG, SCREEN_TAG, DRACO_CHR2, 0, MAIN_CPU_TAG, draco_cdp1869_intf) | |
| 309 | 294 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | WRITE8_HANDLER( suprloco_scrollram_w ) |
| 121 | 121 | { |
| 122 | int adj = flip_screen_get() ? -8 : 8; | |
| 122 | int adj = flip_screen_get(space->machine) ? -8 : 8; | |
| 123 | 123 | |
| 124 | 124 | suprloco_scrollram[offset] = data; |
| 125 | 125 | tilemap_set_scrollx(bg_tilemap,offset, data - adj); |
| r3957 | r3958 | |
| 145 | 145 | coin_counter_w(0, data & 0x01); |
| 146 | 146 | coin_counter_w(1, data & 0x02); |
| 147 | 147 | |
| 148 | flip_screen_set(data & 0x80); | |
| 148 | flip_screen_set(space->machine, data & 0x80); | |
| 149 | 149 | |
| 150 | 150 | control = data; |
| 151 | 151 | } |
| r3957 | r3958 | |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | |
| 161 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color) | |
| 161 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color,int flip) | |
| 162 | 162 | { |
| 163 | if (flip | |
| 163 | if (flip | |
| 164 | 164 | { |
| 165 | 165 | x = bitmap->width - x - 1; |
| 166 | 166 | y = bitmap->height - y - 1; |
| r3957 | r3958 | |
| 178 | 178 | |
| 179 | 179 | static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int spr_number) |
| 180 | 180 | { |
| 181 | int flip = flip_screen_get(machine); | |
| 181 | 182 | int sx,sy,col,row,height,src,adjy,dy; |
| 182 | 183 | UINT8 *spr_reg; |
| 183 | 184 | UINT8 *gfx2; |
| r3957 | r3958 | |
| 195 | 196 | sx = spr_reg[SPR_X]; |
| 196 | 197 | sy = spr_reg[SPR_Y_TOP] + 1; |
| 197 | 198 | |
| 198 | if (!flip_screen_get()) | |
| 199 | if (!flip_screen_get(machine)) | |
| 199 | 200 | { |
| 200 | 201 | adjy = sy; |
| 201 | 202 | dy = 1; |
| r3957 | r3958 | |
| 238 | 239 | |
| 239 | 240 | if (color1 == 15) break; |
| 240 | 241 | if (color1) |
| 241 | draw_pixel(bitmap,cliprect,sx+col, adjy,pen_base + color1); | |
| 242 | draw_pixel(bitmap,cliprect,sx+col, adjy,pen_base + color1, flip); | |
| 242 | 243 | |
| 243 | 244 | if (color2 == 15) break; |
| 244 | 245 | if (color2) |
| 245 | draw_pixel(bitmap,cliprect,sx+col+1,adjy,pen_base + color2); | |
| 246 | draw_pixel(bitmap,cliprect,sx+col+1,adjy,pen_base + color2, flip); | |
| 246 | 247 | |
| 247 | 248 | col += 2; |
| 248 | 249 | } |
| r3957 | r3958 | |
|---|---|---|
| 339 | 339 | x &= 0x1ff; |
| 340 | 340 | for (i=0; i<y_multi; i++) |
| 341 | 341 | { |
| 342 | if (flip_screen_get()) { | |
| 342 | if (flip_screen_get(machine)) { | |
| 343 | 343 | pdrawgfx(bitmap,machine->gfx[1], |
| 344 | 344 | sprite + s_ptr, |
| 345 | 345 | colour, |
| r3957 | r3958 | |
| 463 | 463 | |
| 464 | 464 | /* Flipscreen appears hardwired to the dipswitch - strange */ |
| 465 | 465 | if (input_port_read(screen->machine, "DSW") & 0x100) |
| 466 | flip_screen_set(0); | |
| 466 | flip_screen_set(screen->machine, 0); | |
| 467 | 467 | else |
| 468 | flip_screen_set(1); | |
| 468 | flip_screen_set(screen->machine, 1); | |
| 469 | 469 | return 0; |
| 470 | 470 | } |
| r3957 | r3958 | |
|---|---|---|
| 202 | 202 | WRITE8_HANDLER( yard_flipscreen_w ) |
| 203 | 203 | { |
| 204 | 204 | /* screen flip is handled both by software and hardware */ |
| 205 | flip_screen_set((data & 0x01) ^ (~input_port_read(space->machine, "DSW2") & 0x01)); | |
| 205 | flip_screen_set(space->machine, (data & 0x01) ^ (~input_port_read(space->machine, "DSW2") & 0x01)); | |
| 206 | 206 | |
| 207 | 207 | coin_counter_w(0, data & 0x02); |
| 208 | 208 | coin_counter_w(1, data & 0x20); |
| r3957 | r3958 | |
| 246 | 246 | code2 = code1 + 0x40; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | if (flip_screen_get()) | |
| 249 | if (flip_screen_get(machine)) | |
| 250 | 250 | { |
| 251 | 251 | sx = 240 - sx; |
| 252 | 252 | sy2 = 192 - sy1; |
| r3957 | r3958 | |
| 286 | 286 | 0*8, 6*8-1, |
| 287 | 287 | 1*8, 31*8-1 |
| 288 | 288 | }; |
| 289 | rectangle clip = flip_screen_get() ? clippanelflip : clippanel; | |
| 289 | rectangle clip = flip_screen_get(machine) ? clippanelflip : clippanel; | |
| 290 | 290 | const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen); |
| 291 | int sx = flip_screen_get() ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH; | |
| 292 | int yoffs = flip_screen_get() ? -40 : -16; | |
| 291 | int sx = flip_screen_get(machine) ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH; | |
| 292 | int yoffs = flip_screen_get(machine) ? -40 : -16; | |
| 293 | 293 | |
| 294 | 294 | clip.min_y += visarea->min_y + yoffs; |
| 295 | 295 | clip.max_y += visarea->max_y + yoffs; |
| 296 | 296 | |
| 297 | copybitmap(bitmap, scroll_panel_bitmap, flip_screen_get(), flip_screen_get(), | |
| 297 | copybitmap(bitmap, scroll_panel_bitmap, flip_screen_get(machine), flip_screen_get(machine), | |
| 298 | 298 | sx, visarea->min_y + yoffs, &clip); |
| 299 | 299 | } |
| 300 | 300 | } |
| r3957 | r3958 | |
|---|---|---|
| 189 | 189 | number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8; |
| 190 | 190 | colourbank = (source[4] & 0x000f); |
| 191 | 191 | |
| 192 | if (flip_screen_get()) { | |
| 192 | if (flip_screen_get(machine)) { | |
| 193 | 193 | if (flipy) flipy=0; else flipy=1; |
| 194 | 194 | if (flipx) flipx=0; else flipx=1; |
| 195 | 195 | ypos=240-ypos-sprite_xoff; |
| r3957 | r3958 | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | for (count=0;count<chain;count++) { |
| 200 | if (flip_screen_get()) { | |
| 200 | if (flip_screen_get(machine)) { | |
| 201 | 201 | if (!flipy) { |
| 202 | 202 | drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),cliprect,TRANSPARENCY_PEN,0); |
| 203 | 203 | } else { |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) |
| 9 | 9 | { |
| 10 | 10 | int offs; |
| 11 | int flipscreen=!flip_screen_get(); | |
| 11 | int flipscreen=!flip_screen_get(machine); | |
| 12 | 12 | |
| 13 | 13 | for (offs = 0;offs < 0x400;offs += 4) |
| 14 | 14 | { |
| r3957 | r3958 | |
| 85 | 85 | |
| 86 | 86 | VIDEO_UPDATE(pktgaldx) |
| 87 | 87 | { |
| 88 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 88 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 89 | 89 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 90 | 90 | |
| 91 | 91 | bitmap_fill(bitmap,cliprect,0); /* not Confirmed */ |
| r3957 | r3958 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | WRITE8_HANDLER( timeplt_flipscreen_w ) |
| 142 | 142 | { |
| 143 | flip_screen_set(~data & 1); | |
| 143 | flip_screen_set(space->machine, ~data & 1); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 |
| r3957 | r3958 | |
|---|---|---|
| 187 | 187 | sx = (sx & 0x1ff) - (sx & 0x200); |
| 188 | 188 | sy = (sy & 0x1ff) - (sy & 0x200); |
| 189 | 189 | |
| 190 | if (flip_screen_get()) | |
| 190 | if (flip_screen_get(screen->machine)) | |
| 191 | 191 | { flipx = !flipx; sx = max_x - sx - xnum * 16; |
| 192 | 192 | flipy = !flipy; sy = max_y - sy - ynum * 16; } |
| 193 | 193 | |
| r3957 | r3958 | |
| 310 | 310 | tm_middle = pri_table[ fuuki16_priority[0] & 0x0f ][1]; |
| 311 | 311 | tm_back = pri_table[ fuuki16_priority[0] & 0x0f ][2]; |
| 312 | 312 | |
| 313 | flip_screen_set(fuuki16_vregs[0x1e/2] & 1); | |
| 313 | flip_screen_set(screen->machine, fuuki16_vregs[0x1e/2] & 1); | |
| 314 | 314 | |
| 315 | 315 | /* Layers scrolling */ |
| 316 | 316 | |
| 317 | scrolly_offs = fuuki16_vregs[0xc/2] - (flip_screen_get() ? 0x103 : 0x1f3); | |
| 318 | scrollx_offs = fuuki16_vregs[0xe/2] - (flip_screen_get() ? 0x2a7 : 0x3f6); | |
| 317 | scrolly_offs = fuuki16_vregs[0xc/2] - (flip_screen_get(screen->machine) ? 0x103 : 0x1f3); | |
| 318 | scrollx_offs = fuuki16_vregs[0xe/2] - (flip_screen_get(screen->machine) ? 0x2a7 : 0x3f6); | |
| 319 | 319 | |
| 320 | 320 | layer0_scrolly = fuuki16_vregs[0x0/2] + scrolly_offs; |
| 321 | 321 | layer0_scrollx = fuuki16_vregs[0x2/2] + scrollx_offs; |
| r3957 | r3958 | |
|---|---|---|
| 150 | 150 | coin_counter_w(1, data & 0x02); |
| 151 | 151 | |
| 152 | 152 | /* bit 7 flips screen */ |
| 153 | flip_screen_set(data & 0x80); | |
| 153 | flip_screen_set(space->machine, data & 0x80); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| r3957 | r3958 | |
| 185 | 185 | sx = spriteram[offs + 3]; |
| 186 | 186 | sy = spriteram[offs + 2]; |
| 187 | 187 | dir = 1; |
| 188 | if (flip_screen_get()) | |
| 188 | if (flip_screen_get(machine)) | |
| 189 | 189 | { |
| 190 | 190 | sx = 240 - sx; |
| 191 | 191 | sy = 240 - sy; |
| r3957 | r3958 | |
| 200 | 200 | drawgfx(bitmap,machine->gfx[2], |
| 201 | 201 | code + i, |
| 202 | 202 | col, |
| 203 | flip_screen_get(),flip_screen_get(), | |
| 203 | flip_screen_get(machine),flip_screen_get(machine), | |
| 204 | 204 | sx, sy + 16 * i * dir, |
| 205 | 205 | cliprect,TRANSPARENCY_PEN,15); |
| 206 | 206 | |
| r3957 | r3958 | |
| 208 | 208 | drawgfx(bitmap,machine->gfx[2], |
| 209 | 209 | code + i, |
| 210 | 210 | col, |
| 211 | flip_screen_get(),flip_screen_get(), | |
| 211 | flip_screen_get(machine),flip_screen_get(machine), | |
| 212 | 212 | sx, sy + 16 * i * dir - dir * 256, |
| 213 | 213 | cliprect,TRANSPARENCY_PEN,15); |
| 214 | 214 | i--; |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | if (ACCESSING_BITS_0_7) |
| 97 | 97 | { |
| 98 | 98 | /* bit 7 flips screen, the rest seems to always be set to 0x7e */ |
| 99 | flip_screen_set(data & 0x80); | |
| 99 | flip_screen_set(space->machine, data & 0x80); | |
| 100 | 100 | |
| 101 | 101 | if ((data & 0x7f) != 0x7e) popmessage("flipscreen_w %02x",data); |
| 102 | 102 | } |
| r3957 | r3958 | |
| 133 | 133 | zoomx = shangha3_ram[offs+10]; |
| 134 | 134 | zoomy = shangha3_ram[offs+13]; |
| 135 | 135 | |
| 136 | if (flip_screen_get()) | |
| 136 | if (flip_screen_get(space->machine)) | |
| 137 | 137 | { |
| 138 | 138 | sx = 383 - sx - sizex; |
| 139 | 139 | sy = 255 - sy - sizey; |
| r3957 | r3958 | |
|---|---|---|
| 146 | 146 | flipx = spriteram_3[offs] & 0x02; |
| 147 | 147 | flipy = spriteram_3[offs] & 0x01; |
| 148 | 148 | |
| 149 | if (flip_screen_get()) | |
| 149 | if (flip_screen_get(machine)) | |
| 150 | 150 | { |
| 151 | 151 | flipx = !flipx; |
| 152 | 152 | flipy = !flipy; |
| r3957 | r3958 | |
| 154 | 154 | |
| 155 | 155 | if (spriteram_2[offs] & 0x08) /* double width */ |
| 156 | 156 | { |
| 157 | if (!flip_screen_get()) | |
| 157 | if (!flip_screen_get(machine)) | |
| 158 | 158 | sy = 224 - sy; |
| 159 | 159 | |
| 160 | 160 | drawgfx(bitmap,machine->gfx[2], |
| r3957 | r3958 | |
| 173 | 173 | } |
| 174 | 174 | else |
| 175 | 175 | { |
| 176 | if (!flip_screen_get()) | |
| 176 | if (!flip_screen_get(machine)) | |
| 177 | 177 | sy = 240 - sy; |
| 178 | 178 | |
| 179 | 179 | drawgfx(bitmap,machine->gfx[1], |
| r3957 | r3958 | |
|---|---|---|
| 191 | 191 | |
| 192 | 192 | WRITE8_HANDLER( champbas_flipscreen_w ) |
| 193 | 193 | { |
| 194 | flip_screen_set(~data & 1); | |
| 194 | flip_screen_set(space->machine, ~data & 1); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 |
| r3957 | r3958 | |
|---|---|---|
| 261 | 261 | |
| 262 | 262 | sy -= 16 * sizey; |
| 263 | 263 | |
| 264 | if (flip_screen_get()) | |
| 264 | if (flip_screen_get(machine)) | |
| 265 | 265 | { |
| 266 | 266 | sx = 496+3 - 16 * sizex - sx; |
| 267 | 267 | sy = 240 - 16 * sizey - sy; |
| r3957 | r3958 | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| 292 | static void set_scroll(int layer) | |
| 292 | static void set_scroll(running_machine *machine, int layer) | |
| 293 | 293 | { |
| 294 | 294 | static const int xdisp[2] = { 26, 24 }; |
| 295 | 295 | int scrollx, scrolly; |
| 296 | 296 | |
| 297 | 297 | scrollx = xscroll[layer] + xdisp[layer]; |
| 298 | 298 | scrolly = yscroll[layer] + 9; |
| 299 | if (flip_screen_get()) | |
| 299 | if (flip_screen_get(machine)) | |
| 300 | 300 | { |
| 301 | 301 | scrollx = -scrollx + 3; |
| 302 | 302 | scrolly = -scrolly; |
| r3957 | r3958 | |
| 312 | 312 | int back; |
| 313 | 313 | |
| 314 | 314 | /* flip screen is embedded in the sprite control registers */ |
| 315 | /* can't use flip_screen_set() because the visible area is asymmetrical */ | |
| 316 | flip_screen_set_no_update(spriteram[0x07f6] & 0x01); | |
| 317 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 318 | set_scroll(0); | |
| 319 | set_scroll(1); | |
| 315 | /* can't use flip_screen_set(screen->machine, ) because the visible area is asymmetrical */ | |
| 316 | flip_screen_set_no_update(screen->machine, spriteram[0x07f6] & 0x01); | |
| 317 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get(screen->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 318 | set_scroll(screen->machine, 0); | |
| 319 | set_scroll(screen->machine, 1); | |
| 320 | 320 | |
| 321 | 321 | if (((xscroll[0] & 0x0e00) >> 9) == 6) |
| 322 | 322 | back = 1; |
| r3957 | r3958 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | WRITE8_HANDLER( ssozumo_flipscreen_w ) |
| 110 | 110 | { |
| 111 | flip_screen_set(data & 0x80); | |
| 111 | flip_screen_set(space->machine, data & 0x80); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | static TILE_GET_INFO( get_bg_tile_info ) |
| r3957 | r3958 | |
| 154 | 154 | int sx = 239 - spriteram[offs + 3]; |
| 155 | 155 | int sy = (240 - spriteram[offs + 2]) & 0xff; |
| 156 | 156 | |
| 157 | if (flip_screen_get()) | |
| 157 | if (flip_screen_get(machine)) | |
| 158 | 158 | { |
| 159 | 159 | sx = 240 - sx; |
| 160 | 160 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | int bank; |
| 25 | 25 | |
| 26 | 26 | /* bits 0 and 1 flip X and Y, I don't know which is which */ |
| 27 | if (flip_screen_x_get() != (data & 0x01)) { | |
| 28 | flip_screen_x_set(data & 0x01); | |
| 27 | if (flip_screen_x_get(space->machine) != (data & 0x01)) { | |
| 28 | flip_screen_x_set(space->machine, data & 0x01); | |
| 29 | 29 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | if (flip_screen_y_get() != (data & 0x02)) { | |
| 33 | flip_screen_y_set(data & 0x02); | |
| 32 | if (flip_screen_y_get(space->machine) != (data & 0x02)) { | |
| 33 | flip_screen_y_set(space->machine, data & 0x02); | |
| 34 | 34 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 35 | 35 | } |
| 36 | 36 | |
| r3957 | r3958 | |
| 97 | 97 | |
| 98 | 98 | sx = spriteram[offs]; |
| 99 | 99 | sy = 248 - spriteram[offs + 1]; |
| 100 | if (flip_screen_x_get()) sx = 248 - sx; | |
| 101 | if (flip_screen_y_get()) sy = 248 - sy; | |
| 100 | if (flip_screen_x_get(machine)) sx = 248 - sx; | |
| 101 | if (flip_screen_y_get(machine)) sy = 248 - sy; | |
| 102 | 102 | |
| 103 | 103 | code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) + 1024 * gfxbank; |
| 104 | 104 | |
| 105 | 105 | drawgfx(bitmap,machine->gfx[0], |
| 106 | 106 | 2 * code, |
| 107 | 107 | ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank, |
| 108 | flip_screen_x_get(),flip_screen_y_get(), | |
| 109 | sx,sy + (flip_screen_y_get() ? 8 : -8), | |
| 108 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 109 | sx,sy + (flip_screen_y_get(machine) ? 8 : -8), | |
| 110 | 110 | cliprect,TRANSPARENCY_PEN,0); |
| 111 | 111 | drawgfx(bitmap,machine->gfx[0], |
| 112 | 112 | 2 * code + 1, |
| 113 | 113 | ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank, |
| 114 | flip_screen_x_get(),flip_screen_y_get(), | |
| 114 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 115 | 115 | sx,sy, |
| 116 | 116 | cliprect,TRANSPARENCY_PEN,0); |
| 117 | 117 | } |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | case 0: |
| 60 | 60 | COMBINE_DATA( &video_register ); |
| 61 | 61 | |
| 62 | flip_screen_x_set(video_register & TWIN16_SCREEN_FLIPX); | |
| 62 | flip_screen_x_set(space->machine, video_register & TWIN16_SCREEN_FLIPX); | |
| 63 | 63 | |
| 64 | 64 | if (twin16_custom_video) |
| 65 | flip_screen_y_set(video_register & TWIN16_SCREEN_FLIPY); | |
| 65 | flip_screen_y_set(space->machine, video_register & TWIN16_SCREEN_FLIPY); | |
| 66 | 66 | else |
| 67 | flip_screen_y_set(~video_register & TWIN16_SCREEN_FLIPY); | |
| 67 | flip_screen_y_set(space->machine, ~video_register & TWIN16_SCREEN_FLIPY); | |
| 68 | 68 | |
| 69 | 69 | break; |
| 70 | 70 |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | WRITE8_HANDLER( clshroad_flipscreen_w ) |
| 50 | 50 | { |
| 51 | flip_screen_set( data & 1 ); | |
| 51 | flip_screen_set(space->machine, data & 1 ); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| r3957 | r3958 | |
| 305 | 305 | int flipy = 0; |
| 306 | 306 | |
| 307 | 307 | x -= 0x4a/2; |
| 308 | if (flip_screen_get()) | |
| 308 | if (flip_screen_get(machine)) | |
| 309 | 309 | { |
| 310 | 310 | y = 240 - y; |
| 311 | 311 | flipx = !flipx; |
| r3957 | r3958 | |
|---|---|---|
| 109 | 109 | if (ACCESSING_BITS_0_7) |
| 110 | 110 | { |
| 111 | 111 | sf_active = data & 0xff; |
| 112 | flip_screen_set(data & 0x04); | |
| 112 | flip_screen_set(space->machine, data & 0x04); | |
| 113 | 113 | tilemap_set_enable(tx_tilemap,data & 0x08); |
| 114 | 114 | tilemap_set_enable(bg_tilemap,data & 0x20); |
| 115 | 115 | tilemap_set_enable(fg_tilemap,data & 0x40); |
| r3957 | r3958 | |
| 148 | 148 | { |
| 149 | 149 | int c1,c2,c3,c4,t; |
| 150 | 150 | |
| 151 | if (flip_screen_get()) | |
| 151 | if (flip_screen_get(machine)) | |
| 152 | 152 | { |
| 153 | 153 | sx = 480 - sx; |
| 154 | 154 | sy = 224 - sy; |
| r3957 | r3958 | |
| 203 | 203 | } |
| 204 | 204 | else |
| 205 | 205 | { |
| 206 | if (flip_screen_get()) | |
| 206 | if (flip_screen_get(machine)) | |
| 207 | 207 | { |
| 208 | 208 | sx = 496 - sx; |
| 209 | 209 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | base = 64 * scrollram[offs+1]; |
| 21 | 21 | sx = 8*(offs/4) + scrollx; |
| 22 | if (flip_screen_get()) sx = 248 - sx; | |
| 22 | if (flip_screen_get(machine)) sx = 248 - sx; | |
| 23 | 23 | sx &= 0xff; |
| 24 | 24 | |
| 25 | 25 | for (y = 0;y < 32;y++) |
| r3957 | r3958 | |
| 27 | 27 | int attr; |
| 28 | 28 | |
| 29 | 29 | sy = 8*y + scrolly; |
| 30 | if (flip_screen_get()) sy = 248 - sy; | |
| 30 | if (flip_screen_get(machine)) sy = 248 - sy; | |
| 31 | 31 | sy &= 0xff; |
| 32 | 32 | |
| 33 | 33 | attr = videoram[base + 2*y + 1]; |
| r3957 | r3958 | |
| 37 | 37 | drawgfx(bitmap,machine->gfx[0], |
| 38 | 38 | code, |
| 39 | 39 | color, |
| 40 | flip_screen_get(),flip_screen_get(), | |
| 40 | flip_screen_get(machine),flip_screen_get(machine), | |
| 41 | 41 | sx,sy, |
| 42 | 42 | cliprect,TRANSPARENCY_PEN,15); |
| 43 | 43 | if (sx > 248) /* wraparound */ |
| 44 | 44 | drawgfx(bitmap,machine->gfx[0], |
| 45 | 45 | code, |
| 46 | 46 | color, |
| 47 | flip_screen_get(),flip_screen_get(), | |
| 47 | flip_screen_get(machine),flip_screen_get(machine), | |
| 48 | 48 | sx-256,sy, |
| 49 | 49 | cliprect,TRANSPARENCY_PEN,15); |
| 50 | 50 | } |
| r3957 | r3958 | |
| 104 | 104 | base = 64 * lsasquad_scrollram[offs+1]; |
| 105 | 105 | sx = scrollx+stepx; |
| 106 | 106 | |
| 107 | if (flip_screen_get()) sx = 248 - sx; | |
| 107 | if (flip_screen_get(machine)) sx = 248 - sx; | |
| 108 | 108 | sx &= 0xff; |
| 109 | 109 | |
| 110 | 110 | for (y = 0;y < 32;y++) |
| r3957 | r3958 | |
| 112 | 112 | int attr; |
| 113 | 113 | |
| 114 | 114 | sy = 8*y + scrolly; |
| 115 | if (flip_screen_get()) sy = 248 - sy; | |
| 115 | if (flip_screen_get(machine)) sy = 248 - sy; | |
| 116 | 116 | sy &= 0xff; |
| 117 | 117 | |
| 118 | 118 | attr = videoram[base + 2*y + 1]; |
| r3957 | r3958 | |
| 125 | 125 | drawgfx(bitmap,machine->gfx[0], |
| 126 | 126 | code, |
| 127 | 127 | color, |
| 128 | flip_screen_get(),flip_screen_get(), | |
| 128 | flip_screen_get(machine),flip_screen_get(machine), | |
| 129 | 129 | sx,sy, |
| 130 | 130 | cliprect,TRANSPARENCY_PEN,15); |
| 131 | 131 | if (sx > 248) /* wraparound */ |
| 132 | 132 | drawgfx(bitmap,machine->gfx[0], |
| 133 | 133 | code, |
| 134 | 134 | color, |
| 135 | flip_screen_get(),flip_screen_get(), | |
| 135 | flip_screen_get(machine),flip_screen_get(machine), | |
| 136 | 136 | sx-256,sy, |
| 137 | 137 | cliprect,TRANSPARENCY_PEN,15); |
| 138 | 138 | } |
| r3957 | r3958 | |
| 176 | 176 | flipx = attr & 0x40; |
| 177 | 177 | flipy = attr & 0x80; |
| 178 | 178 | |
| 179 | if (flip_screen_get()) | |
| 179 | if (flip_screen_get(machine)) | |
| 180 | 180 | { |
| 181 | 181 | sx = 240 - sx; |
| 182 | 182 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 141 | 141 | sprites_disabled = data & 0x10; |
| 142 | 142 | |
| 143 | 143 | /* bit 6 is flip screen */ |
| 144 | flip_screen_set(data & 0x40); | |
| 144 | flip_screen_set(space->machine, data & 0x40); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | WRITE8_HANDLER( pollux_ctrl_w ) |
| 148 | 148 | { |
| 149 | 149 | /* bit 0 is flip screen */ |
| 150 | flip_screen_set(data & 0x01); | |
| 150 | flip_screen_set(space->machine, data & 0x01); | |
| 151 | 151 | |
| 152 | 152 | /* bits 6 and 7 are coin counters */ |
| 153 | 153 | coin_counter_w(0, data & 0x80); |
| r3957 | r3958 | |
| 169 | 169 | tx_pri = data & 0x08; |
| 170 | 170 | |
| 171 | 171 | /* bit 4 flips screen */ |
| 172 | flip_screen_set(data & 0x10); | |
| 172 | flip_screen_set(space->machine, data & 0x10); | |
| 173 | 173 | |
| 174 | 174 | /* bit 5 used but unknown */ |
| 175 | 175 | |
| r3957 | r3958 | |
| 179 | 179 | WRITE8_HANDLER( flytiger_ctrl_w ) |
| 180 | 180 | { |
| 181 | 181 | /* bit 0 is flip screen */ |
| 182 | flip_screen_set(data & 0x01); | |
| 182 | flip_screen_set(space->machine, data & 0x01); | |
| 183 | 183 | |
| 184 | 184 | /* bits 1, 2, 3 used but unknown */ |
| 185 | 185 | |
| r3957 | r3958 | |
| 192 | 192 | if (ACCESSING_BITS_0_7) |
| 193 | 193 | { |
| 194 | 194 | /* bit 0 flips screen */ |
| 195 | flip_screen_set(data & 0x0001); | |
| 195 | flip_screen_set(space->machine, data & 0x0001); | |
| 196 | 196 | |
| 197 | 197 | /* bit 4 changes tilemaps priority */ |
| 198 | 198 | rshark_pri = data & 0x0010; |
| r3957 | r3958 | |
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | if (flip_screen_get()) | |
| 417 | if (flip_screen_get(machine)) | |
| 418 | 418 | { |
| 419 | 419 | sx = 498 - sx; |
| 420 | 420 | sy = 240 - (16 * height) - sy; |
| r3957 | r3958 | |
| 476 | 476 | width = buffered_spriteram16[offs+1] & 0x000f; |
| 477 | 477 | height = (buffered_spriteram16[offs+1] & 0x00f0) >> 4; |
| 478 | 478 | |
| 479 | if (flip_screen_get()) | |
| 479 | if (flip_screen_get(machine)) | |
| 480 | 480 | { |
| 481 | 481 | sx = 498 - (16 * width) - sx; |
| 482 | 482 | sy = 240 - (16 * height) - sy; |
| r3957 | r3958 | |
|---|---|---|
| 276 | 276 | y=(y+16)%0x200; |
| 277 | 277 | x=256 - x; |
| 278 | 278 | y=256 - y; |
| 279 | if (flip_screen_get()) { | |
| 279 | if (flip_screen_get(machine)) { | |
| 280 | 280 | y=240-y; |
| 281 | 281 | x=240-x; |
| 282 | 282 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 348 | 348 | inc = 1; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | if (flip_screen_get()) { | |
| 351 | if (flip_screen_get(machine)) { | |
| 352 | 352 | y=240-y; |
| 353 | 353 | x=240-x; |
| 354 | 354 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 394 | 394 | fx = buffered_spriteram[offs+1] & 0x04; |
| 395 | 395 | multi = buffered_spriteram[offs+1] & 0x10; |
| 396 | 396 | |
| 397 | if (flip_screen_get()) { | |
| 397 | if (flip_screen_get(machine)) { | |
| 398 | 398 | sy=240-sy; |
| 399 | 399 | sx=240-sx; |
| 400 | 400 | if (fx) fx=0; else fx=1; |
| r3957 | r3958 | |
| 405 | 405 | drawgfx(bitmap,machine->gfx[1], |
| 406 | 406 | code, |
| 407 | 407 | color, |
| 408 | fx,flip_screen_get(), | |
| 408 | fx,flip_screen_get(machine), | |
| 409 | 409 | sx,sy, |
| 410 | 410 | cliprect,TRANSPARENCY_PEN,0); |
| 411 | 411 | if (multi) |
| 412 | 412 | drawgfx(bitmap,machine->gfx[1], |
| 413 | 413 | code+1, |
| 414 | 414 | color, |
| 415 | fx,flip_screen_get(), | |
| 415 | fx,flip_screen_get(machine), | |
| 416 | 416 | sx,sy2, |
| 417 | 417 | cliprect,TRANSPARENCY_PEN,0); |
| 418 | 418 | } |
| r3957 | r3958 | |
| 448 | 448 | tilemap_set_scrolly( dec8_pf0_tilemap,0, (dec8_pf0_control[0x12]<<8)+dec8_pf0_control[0x13] ); |
| 449 | 449 | tilemap_set_scrollx( dec8_pf1_tilemap,0, (dec8_pf1_control[0x10]<<8)+dec8_pf1_control[0x11] ); |
| 450 | 450 | tilemap_set_scrolly( dec8_pf1_tilemap,0, (dec8_pf1_control[0x12]<<8)+dec8_pf1_control[0x13] ); |
| 451 | flip_screen_set(dec8_pf0_control[0]>>7); | |
| 451 | flip_screen_set(screen->machine, dec8_pf0_control[0]>>7); | |
| 452 | 452 | |
| 453 | 453 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,0,0); |
| 454 | 454 | draw_sprites2(screen->machine,bitmap,cliprect,1); |
| r3957 | r3958 | |
| 573 | 573 | { |
| 574 | 574 | tilemap_set_scrollx( dec8_pf0_tilemap,0, (dec8_pf0_control[0x10]<<8)+dec8_pf0_control[0x11] ); |
| 575 | 575 | tilemap_set_scrolly( dec8_pf0_tilemap,0, (dec8_pf0_control[0x12]<<8)+dec8_pf0_control[0x13] ); |
| 576 | flip_screen_set(dec8_pf0_control[1]>>7); | |
| 576 | flip_screen_set(screen->machine, dec8_pf0_control[1]>>7); | |
| 577 | 577 | |
| 578 | 578 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 0,0); |
| 579 | 579 | tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 1,0); |
| r3957 | r3958 | |
|---|---|---|
| 211 | 211 | sx = (sx & 0x1ff) - (sx & 0x200); |
| 212 | 212 | sy = (sy & 0x1ff) - (sy & 0x200); |
| 213 | 213 | |
| 214 | if (flip_screen_get()) | |
| 214 | if (flip_screen_get(screen->machine)) | |
| 215 | 215 | { flipx = !flipx; sx = max_x - sx - xnum * 16; |
| 216 | 216 | flipy = !flipy; sy = max_y - sy - ynum * 16; } |
| 217 | 217 | |
| r3957 | r3958 | |
| 341 | 341 | tm_middle = pri_table[ (fuuki32_priority[0]>>16) & 0x0f ][1]; |
| 342 | 342 | tm_back = pri_table[ (fuuki32_priority[0]>>16) & 0x0f ][2]; |
| 343 | 343 | |
| 344 | flip_screen_set((fuuki32_vregs[0x1e/4]&0x0000ffff) & 1); | |
| 344 | flip_screen_set(screen->machine, (fuuki32_vregs[0x1e/4]&0x0000ffff) & 1); | |
| 345 | 345 | |
| 346 | 346 | /* Layers scrolling */ |
| 347 | 347 | |
| 348 | scrolly_offs = ((fuuki32_vregs[0xc/4]&0xffff0000)>>16) - (flip_screen_get() ? 0x103 : 0x1f3); | |
| 349 | scrollx_offs = (fuuki32_vregs[0xc/4]&0x0000ffff) - (flip_screen_get() ? 0x2c7 : 0x3f6); | |
| 348 | scrolly_offs = ((fuuki32_vregs[0xc/4]&0xffff0000)>>16) - (flip_screen_get(screen->machine) ? 0x103 : 0x1f3); | |
| 349 | scrollx_offs = (fuuki32_vregs[0xc/4]&0x0000ffff) - (flip_screen_get(screen->machine) ? 0x2c7 : 0x3f6); | |
| 350 | 350 | |
| 351 | 351 | layer0_scrolly = ((fuuki32_vregs[0x0/4]&0xffff0000)>>16) + scrolly_offs; |
| 352 | 352 | layer0_scrollx = ((fuuki32_vregs[0x0/4]&0x0000ffff)) + scrollx_offs; |
| r3957 | r3958 | |
|---|---|---|
| 182 | 182 | flipx = attr & 0x04; |
| 183 | 183 | flipy = attr & 0x02; |
| 184 | 184 | |
| 185 | if (!flip_screen_get()) | |
| 185 | if (!flip_screen_get(machine)) | |
| 186 | 186 | { |
| 187 | 187 | sx = 240 - sx; |
| 188 | 188 | sy = 240 - sy; |
| r3957 | r3958 | |
| 226 | 226 | |
| 227 | 227 | if (data) |
| 228 | 228 | { |
| 229 | if (flip_screen_get()) | |
| 229 | if (flip_screen_get(machine)) | |
| 230 | 230 | *BITMAP_ADDR16(bitmap, 255 - y, 255 - x) = data; |
| 231 | 231 | else |
| 232 | 232 | *BITMAP_ADDR16(bitmap, y, x) = data; |
| r3957 | r3958 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | WRITE8_HANDLER( pooyan_flipscreen_w ) |
| 149 | 149 | { |
| 150 | flip_screen_set(~data & 0x01); | |
| 150 | flip_screen_set(space->machine, ~data & 0x01); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 |
| r3957 | r3958 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | if (high_priority != priority) continue; |
| 128 | 128 | |
| 129 | if (flip_screen_get()) { | |
| 129 | if (flip_screen_get(machine)) { | |
| 130 | 130 | sy = sy + 248; |
| 131 | 131 | } |
| 132 | 132 | |
| r3957 | r3958 | |
| 181 | 181 | VIDEO_UPDATE( wrally ) |
| 182 | 182 | { |
| 183 | 183 | /* set scroll registers */ |
| 184 | if (!flip_screen_get()) { | |
| 184 | if (!flip_screen_get(screen->machine)) { | |
| 185 | 185 | tilemap_set_scrolly(wrally_pant[0], 0, wrally_vregs[0]); |
| 186 | 186 | tilemap_set_scrollx(wrally_pant[0], 0, wrally_vregs[1]+4); |
| 187 | 187 | tilemap_set_scrolly(wrally_pant[1], 0, wrally_vregs[2]); |
| r3957 | r3958 | |
|---|---|---|
| 63 | 63 | // on Irem boards, screen flip is handled in both hardware and software. |
| 64 | 64 | // this game doesn't have cocktail mode so if there's software control we don't |
| 65 | 65 | // know where it is mapped. |
| 66 | flip_screen_set(~input_port_read(screen->machine, "DSW2") & 1); | |
| 66 | flip_screen_set(screen->machine, ~input_port_read(screen->machine, "DSW2") & 1); | |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| r3957 | r3958 | |
|---|---|---|
| 370 | 370 | WRITE16_HANDLER( nmk_flipscreen_w ) |
| 371 | 371 | { |
| 372 | 372 | if (ACCESSING_BITS_0_7) |
| 373 | flip_screen_set(data & 0x01); | |
| 373 | flip_screen_set(space->machine, data & 0x01); | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | WRITE16_HANDLER( nmk_tilebank_w ) |
| r3957 | r3958 | |
| 434 | 434 | if(pri != priority) |
| 435 | 435 | continue; |
| 436 | 436 | |
| 437 | if (flip_screen_get()) | |
| 437 | if (flip_screen_get(machine)) | |
| 438 | 438 | { |
| 439 | 439 | sx = 368 - sx; |
| 440 | 440 | sy = 240 - sy; |
| r3957 | r3958 | |
| 451 | 451 | drawgfx(bitmap,machine->gfx[2], |
| 452 | 452 | code, |
| 453 | 453 | color, |
| 454 | flip_screen_get(), flip_screen_get(), | |
| 454 | flip_screen_get(machine), flip_screen_get(machine), | |
| 455 | 455 | ((x + 16) & 0x1ff) - 16,sy & 0x1ff, |
| 456 | 456 | cliprect,TRANSPARENCY_PEN,15); |
| 457 | 457 | code++; |
| r3957 | r3958 | |
| 488 | 488 | if(pri != priority) |
| 489 | 489 | continue; |
| 490 | 490 | |
| 491 | flipx ^= flip_screen_get(); | |
| 492 | flipy ^= flip_screen_get(); | |
| 491 | flipx ^= flip_screen_get(machine); | |
| 492 | flipy ^= flip_screen_get(machine); | |
| 493 | 493 | |
| 494 | if (flip_screen_get()) | |
| 494 | if (flip_screen_get(machine)) | |
| 495 | 495 | { |
| 496 | 496 | sx = 368 - sx; |
| 497 | 497 | sy = 240 - sy; |
| r3957 | r3958 | |
| 1068 | 1068 | if (dsw_flipscreen) |
| 1069 | 1069 | { |
| 1070 | 1070 | |
| 1071 | flip_screen_x_set(~input_port_read(machine, "DSW1") & 0x0100); | |
| 1072 | flip_screen_y_set(~input_port_read(machine, "DSW1") & 0x0200); | |
| 1071 | flip_screen_x_set(machine, ~input_port_read(machine, "DSW1") & 0x0100); | |
| 1072 | flip_screen_y_set(machine, ~input_port_read(machine, "DSW1") & 0x0200); | |
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | tilemap_set_scrollx(tilemap_0, 0, afega_scroll_0[1] + xoffset); |
| r3957 | r3958 | |
|---|---|---|
| 1740 | 1740 | MDRV_VIDEO_UPDATE(bfcobra) |
| 1741 | 1741 | |
| 1742 | 1742 | /* ACIAs */ |
| 1743 | MDRV_DEVICE_ADD("acia6850_0", ACIA6850) | |
| 1744 | MDRV_DEVICE_CONFIG(z80_acia_if) | |
| 1745 | MDRV_DEVICE_ADD("acia6850_1", ACIA6850) | |
| 1746 | MDRV_DEVICE_CONFIG(m6809_acia_if) | |
| 1747 | MDRV_DEVICE_ADD("acia6850_2", ACIA6850) | |
| 1748 | MDRV_DEVICE_CONFIG(data_acia_if) | |
| 1743 | MDRV_ACIA6850_ADD("acia6850_0", z80_acia_if) | |
| 1744 | MDRV_ACIA6850_ADD("acia6850_1", m6809_acia_if) | |
| 1745 | MDRV_ACIA6850_ADD("acia6850_2", data_acia_if) | |
| 1749 | 1746 | MACHINE_DRIVER_END |
| 1750 | 1747 | |
| 1751 | 1748 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/z80/z80.h" | |
| 38 | 39 | #include "sound/ay8910.h" |
| 39 | 40 | |
| 40 | 41 | static tilemap *bg_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 98 | 98 | */ |
| 99 | 99 | |
| 100 | 100 | #include "driver.h" |
| 101 | #include "cpu/i8085/i8085.h" | |
| 101 | 102 | #include "deprecat.h" |
| 102 | 103 | #include "sound/sn76496.h" |
| 103 | 104 |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/z80/z80.h" | |
| 15 | 16 | |
| 16 | 17 | static READ8_HANDLER( unk_r ) |
| 17 | 18 | { |
| r3957 | r3958 | |
|---|---|---|
| 784 | 784 | MDRV_CPU_ADD("mcu", M68705,2000000) |
| 785 | 785 | MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| 786 | 786 | |
| 787 | MDRV_ | |
| 787 | MDRV_QUANTUM_TIME | |
| 788 | 788 | |
| 789 | 789 | /* synchronization of the CPUs */ |
| 790 | 790 | MDRV_MACHINE_RESET(ta7630) |
| r3957 | r3958 | |
| 848 | 848 | MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| 849 | 849 | #endif |
| 850 | 850 | |
| 851 | MDRV_ | |
| 851 | MDRV_QUANTUM_TIME | |
| 852 | 852 | MDRV_MACHINE_RESET(ta7630) |
| 853 | 853 | |
| 854 | 854 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 906 | 906 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 907 | 907 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) |
| 908 | 908 | |
| 909 | MDRV_ | |
| 909 | MDRV_QUANTUM_TIME | |
| 910 | 910 | MDRV_MACHINE_RESET(ta7630) |
| 911 | 911 | |
| 912 | 912 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | #include "driver.h" |
| 81 | #include "cpu/z80/z80.h" | |
| 81 | 82 | #include "deprecat.h" |
| 82 | 83 | #include "machine/eeprom.h" |
| 83 | 84 | #include "includes/cps1.h" |
| r3957 | r3958 | |
|---|---|---|
| 237 | 237 | ***************************************************************************/ |
| 238 | 238 | |
| 239 | 239 | #include "driver.h" |
| 240 | #include "cpu/z80/z80.h" | |
| 241 | #include "cpu/m68000/m68000.h" | |
| 240 | 242 | #include "taitoipt.h" |
| 241 | 243 | #include "video/taitoic.h" |
| 242 | 244 | #include "audio/taitosnd.h" |
| r3957 | r3958 | |
| 616 | 618 | MDRV_CPU_ADD("audio", Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 617 | 619 | MDRV_CPU_PROGRAM_MAP(rainbow_s_readmem,rainbow_s_writemem) |
| 618 | 620 | |
| 619 | MDRV_ | |
| 621 | MDRV_QUANTUM_TIME | |
| 620 | 622 | |
| 621 | 623 | /* video hardware */ |
| 622 | 624 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 653 | 655 | MDRV_CPU_ADD("audio", Z80, XTAL_18_432MHz/6) /* not verified but music tempo matches original */ |
| 654 | 656 | MDRV_CPU_PROGRAM_MAP(jumping_sound_readmem,jumping_sound_writemem) |
| 655 | 657 | |
| 656 | MDRV_ | |
| 658 | MDRV_QUANTUM_TIME | |
| 657 | 659 | |
| 658 | 660 | /* video hardware */ |
| 659 | 661 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/m68000/m68000.h" | |
| 22 | 23 | #include "cpu/z80/z80.h" |
| 23 | 24 | #include "sound/okim6295.h" |
| 24 | 25 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 63 | 63 | ***************************************************************************/ |
| 64 | 64 | |
| 65 | 65 | #include "driver.h" |
| 66 | #include "cpu/nec/nec.h" | |
| 66 | 67 | #include "cpu/z80/z80.h" |
| 67 | 68 | #include "audio/seibu.h" |
| 68 | 69 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 292 | 293 | |
| 293 | 294 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 294 | 295 | |
| 295 | MDRV_ | |
| 296 | MDRV_QUANTUM_TIME | |
| 296 | 297 | |
| 297 | 298 | MDRV_MACHINE_RESET(seibu_sound) |
| 298 | 299 |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6502/m6502.h" | |
| 8 | 9 | |
| 9 | 10 | static UINT8* mgolf_video_ram; |
| 10 | 11 |
| r3957 | r3958 | |
|---|---|---|
| 723 | 723 | static DRIVER_INIT( avengrgs ) |
| 724 | 724 | { |
| 725 | 725 | // init options |
| 726 | c | |
| 726 | device | |
| 727 | 727 | |
| 728 | 728 | // set up speed cheat |
| 729 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 730 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x3234); | |
| 731 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 732 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x32dc); | |
| 729 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 730 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x3234); | |
| 731 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 732 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x32dc); | |
| 733 | 733 | |
| 734 | 734 | mainCpuIsArm=0; |
| 735 | 735 | memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r ); |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "cpu/m6502/m6502.h" | |
| 52 | 53 | #include "deprecat.h" |
| 53 | 54 | #include "sound/pokey.h" |
| 54 | 55 |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ****************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/m6502/m6502.h" | |
| 16 | 17 | #include "deprecat.h" |
| 17 | 18 | #include "sound/2203intf.h" |
| 18 | 19 |
| r3957 | r3958 | |
|---|---|---|
| 72 | 72 | *********************************************************************/ |
| 73 | 73 | |
| 74 | 74 | #include "driver.h" |
| 75 | #include "cpu/e132xs/e132xs.h" | |
| 75 | 76 | #include "machine/eeprom.h" |
| 76 | 77 | #include "sound/okim6295.h" |
| 77 | 78 |
| r3957 | r3958 | |
|---|---|---|
| 336 | 336 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 337 | 337 | MDRV_CPU_PERIODIC_INT(audio_interrupt, 480) |
| 338 | 338 | |
| 339 | MDRV_ | |
| 339 | MDRV_QUANTUM_TIME | |
| 340 | 340 | |
| 341 | 341 | MDRV_GFXDECODE(rungun) |
| 342 | 342 |
| r3957 | r3958 | |
|---|---|---|
| 278 | 278 | ***************************************************************************/ |
| 279 | 279 | |
| 280 | 280 | #include "driver.h" |
| 281 | #include "cpu/m6502/m6502.h" | |
| 281 | 282 | #include "machine/mathbox.h" |
| 282 | 283 | #include "video/avgdvg.h" |
| 283 | 284 | #include "video/vector.h" |
| r3957 | r3958 | |
| 554 | 555 | MDRV_CPU_ADD("main", M6502, MASTER_CLOCK / 8) |
| 555 | 556 | MDRV_CPU_PROGRAM_MAP(main_map, 0) |
| 556 | 557 | MDRV_CPU_PERIODIC_INT(irq0_line_assert, (double)MASTER_CLOCK / 4096 / 12) |
| 557 | MDRV_WATCHDOG_TIME_INIT( | |
| 558 | MDRV_WATCHDOG_TIME_INIT( | |
| 558 | 559 | MDRV_NVRAM_HANDLER(atari_vg) |
| 559 | 560 | |
| 560 | 561 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/m68000/m68000.h" | |
| 16 | 17 | #include "cpu/h6280/h6280.h" |
| 17 | 18 | #include "sound/2203intf.h" |
| 18 | 19 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/m68000/m68000.h" | |
| 27 | 28 | #include "machine/atarigen.h" |
| 28 | 29 | #include "audio/atarijsa.h" |
| 29 | 30 | #include "eprom.h" |
| r3957 | r3958 | |
| 416 | 417 | MDRV_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2) |
| 417 | 418 | MDRV_CPU_PROGRAM_MAP(extra_map,0) |
| 418 | 419 | |
| 419 | MDRV_ | |
| 420 | MDRV_QUANTUM_TIME | |
| 420 | 421 | |
| 421 | 422 | MDRV_MACHINE_RESET(eprom) |
| 422 | 423 | MDRV_NVRAM_HANDLER(atarigen) |
| r3957 | r3958 | |
| 447 | 448 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 448 | 449 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen) |
| 449 | 450 | |
| 450 | MDRV_ | |
| 451 | MDRV_QUANTUM_TIME | |
| 451 | 452 | |
| 452 | 453 | MDRV_MACHINE_RESET(klaxp) |
| 453 | 454 | MDRV_NVRAM_HANDLER(atarigen) |
| r3957 | r3958 | |
| 477 | 478 | MDRV_CPU_PROGRAM_MAP(guts_map,0) |
| 478 | 479 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen) |
| 479 | 480 | |
| 480 | MDRV_ | |
| 481 | MDRV_QUANTUM_TIME | |
| 481 | 482 | |
| 482 | 483 | MDRV_MACHINE_RESET(eprom) |
| 483 | 484 | MDRV_NVRAM_HANDLER(atarigen) |
| r3957 | r3958 | |
|---|---|---|
| 269 | 269 | ***************************************************************************/ |
| 270 | 270 | |
| 271 | 271 | #include "driver.h" |
| 272 | #include "cpu/z80/z80.h" | |
| 273 | #include "cpu/m6800/m6800.h" | |
| 272 | 274 | #include "deprecat.h" |
| 273 | 275 | #include "sound/2203intf.h" |
| 274 | 276 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 699 | 701 | MDRV_CPU_ADD("audio", Z80, MAIN_XTAL/8) // 3 MHz |
| 700 | 702 | MDRV_CPU_PROGRAM_MAP(tokio_sound_map, 0) // NMIs are triggered by the main CPU, IRQs are triggered by the YM2203 |
| 701 | 703 | |
| 702 | MDRV_ | |
| 704 | MDRV_QUANTUM_TIME | |
| 703 | 705 | |
| 704 | 706 | // video hardware |
| 705 | 707 | |
| r3957 | r3958 | |
| 743 | 745 | MDRV_CPU_PROGRAM_MAP(mcu_map, 0) |
| 744 | 746 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse) // comes from the same clock that latches the INT pin on the second Z80 |
| 745 | 747 | |
| 746 | MDRV_ | |
| 748 | MDRV_QUANTUM_TIME | |
| 747 | 749 | |
| 748 | 750 | // video hardware |
| 749 | 751 |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 43 | 44 | #include "machine/mc8123.h" |
| 44 | 45 | #include "sound/2203intf.h" |
| 45 | 46 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/z80/z80.h" | |
| 20 | 21 | #include "sound/2203intf.h" |
| 21 | 22 | |
| 22 | 23 | /* Variables defined in video: */ |
| r3957 | r3958 | |
|---|---|---|
| 84 | 84 | */ |
| 85 | 85 | |
| 86 | 86 | #include "driver.h" |
| 87 | #include "cpu/z80/z80.h" | |
| 87 | 88 | #include "deprecat.h" |
| 88 | 89 | #include "audio/seibu.h" |
| 89 | 90 |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | ***************************************************************************/ |
| 60 | 60 | |
| 61 | 61 | #include "driver.h" |
| 62 | #include "cpu/m68000/m68000.h" | |
| 62 | 63 | #include "cpu/z80/z80.h" |
| 63 | 64 | #include "sound/2610intf.h" |
| 64 | 65 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/m6800/m6800.h" | |
| 20 | 21 | #include "includes/fgoal.h" |
| 21 | 22 | |
| 22 | 23 | UINT8* fgoal_video_ram; |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "cpu/z80/z80.h" | |
| 26 | 27 | #include "machine/6821pia.h" |
| 27 | 28 | #include "video/mc6845.h" |
| 28 | 29 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 648 | 649 | MDRV_VIDEO_START(coinmstr) |
| 649 | 650 | MDRV_VIDEO_UPDATE(coinmstr) |
| 650 | 651 | |
| 651 | MDRV_ | |
| 652 | MDRV_M | |
| 652 | 653 | |
| 653 | 654 | /* sound hardware */ |
| 654 | 655 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | ***************************************************************************/ |
| 154 | 154 | |
| 155 | 155 | #include "driver.h" |
| 156 | #include "cpu/z80/z80.h" | |
| 156 | 157 | #include "deprecat.h" |
| 157 | 158 | #include "sound/msm5205.h" |
| 158 | 159 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
|---|---|---|
| 145 | 145 | */ |
| 146 | 146 | |
| 147 | 147 | #include "driver.h" |
| 148 | #include "cpu/m68000/m68000.h" | |
| 148 | 149 | #include "deprecat.h" |
| 149 | 150 | #include "includes/kaneko16.h" |
| 150 | 151 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
| 500 | 501 | MDRV_PALETTE_INIT(berlwall) |
| 501 | 502 | |
| 502 | 503 | /* arm watchdog */ |
| 503 | MDRV_WATCHDOG_TIME_INIT( | |
| 504 | MDRV_WATCHDOG_TIME_INIT( | |
| 504 | 505 | |
| 505 | 506 | /* sound hardware */ |
| 506 | 507 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
| 519 | 520 | MDRV_CPU_MODIFY("main") |
| 520 | 521 | MDRV_CPU_PROGRAM_MAP(fantasia_map,0) |
| 521 | 522 | |
| 522 | MDRV_WATCHDOG_TIME_INIT( | |
| 523 | MDRV_WATCHDOG_TIME_INIT( | |
| 523 | 524 | |
| 524 | 525 | MACHINE_DRIVER_END |
| 525 | 526 |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m68000/m68000.h" | |
| 8 | 9 | #include "cpu/powerpc/ppc.h" |
| 9 | 10 | #include "sound/k054539.h" |
| 10 | 11 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 81 | 82 | static MACHINE_START( ultrsprt ) |
| 82 | 83 | { |
| 83 | 84 | /* set conservative DRC options */ |
| 84 | c | |
| 85 | device | |
| 85 | 86 | |
| 86 | 87 | /* configure fast RAM regions for DRC */ |
| 87 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 88 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 89 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x0007ffff); | |
| 90 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, vram); | |
| 91 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 88 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 89 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 90 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x0007ffff); | |
| 91 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, vram); | |
| 92 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 92 | 93 | |
| 93 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 1); | |
| 94 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x7f000000); | |
| 95 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x7f01ffff); | |
| 96 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); | |
| 97 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 94 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 1); | |
| 95 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x7f000000); | |
| 96 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x7f01ffff); | |
| 97 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); | |
| 98 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 98 | 99 | } |
| 99 | 100 | |
| 100 | 101 | |
| r3957 | r3958 | |
| 239 | 240 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 240 | 241 | MDRV_CPU_PERIODIC_INT(irq5_line_hold, 1) // ??? |
| 241 | 242 | |
| 242 | MDRV_ | |
| 243 | MDRV_QUANTUM_TIME | |
| 243 | 244 | |
| 244 | 245 | MDRV_NVRAM_HANDLER(ultrsprt) |
| 245 | 246 | MDRV_MACHINE_START(ultrsprt) |
| r3957 | r3958 | |
|---|---|---|
| 108 | 108 | */ |
| 109 | 109 | |
| 110 | 110 | #include "driver.h" |
| 111 | #include "cpu/z80/z80.h" | |
| 111 | 112 | #include "snk.h" |
| 112 | 113 | #include "sound/ay8910.h" |
| 113 | 114 |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/m6502/m6502.h" | |
| 17 | 18 | #include "sound/ay8910.h" |
| 18 | 19 | #include "mystston.h" |
| 19 | 20 |
| r3957 | r3958 | |
|---|---|---|
| 112 | 112 | **************************************************************************/ |
| 113 | 113 | |
| 114 | 114 | #include "driver.h" |
| 115 | #include "cpu/z80/z80.h" | |
| 115 | 116 | #include "cpu/tms34010/tms34010.h" |
| 116 | 117 | #include "audio/williams.h" |
| 117 | 118 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/i8085/i8085.h" | |
| 18 | 19 | #include "hitme.h" |
| 19 | 20 | #include "sound/discrete.h" |
| 20 | 21 |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "cpu/m68000/m68000.h" | |
| 26 | 27 | #include "machine/atarigen.h" |
| 27 | 28 | #include "rampart.h" |
| 28 | 29 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
| 528 | 529 | |
| 529 | 530 | atarigen_eeprom_default = compressed_default_eeprom; |
| 530 | 531 | memcpy(&rom[0x140000], &rom[0x40000], 0x8000); |
| 531 | atarigen_slapstic_init(machine | |
| 532 | atarigen_slapstic_init(machine->cpu[0], 0x140000, 0x438000, 118); | |
| 532 | 533 | } |
| 533 | 534 | |
| 534 | 535 |
| r3957 | r3958 | |
|---|---|---|
| 69 | 69 | ***************************************************************************/ |
| 70 | 70 | |
| 71 | 71 | #include "driver.h" |
| 72 | #include "cpu/z80/z80.h" | |
| 72 | 73 | #include "sound/sn76496.h" |
| 73 | 74 | #include "sound/samples.h" |
| 74 | 75 | #include "machine/segacrpt.h" |
| r3957 | r3958 | |
| 94 | 95 | |
| 95 | 96 | static WRITE8_HANDLER( flip_screen_w ) |
| 96 | 97 | { |
| 97 | flip_screen_set(data); | |
| 98 | flip_screen_set(space->machine, data); | |
| 98 | 99 | } |
| 99 | 100 | |
| 100 | 101 | static WRITE8_HANDLER( paletteram_IIBBGGRR_w ) |
| r3957 | r3958 | |
| 606 | 607 | MDRV_MACHINE_RESET(senjyo) |
| 607 | 608 | |
| 608 | 609 | MDRV_Z80PIO_ADD( "z80pio", senjyo_pio_intf ) |
| 609 | MDRV_Z80CTC_ADD( "z80ctc", senjyo_ctc_intf ) | |
| 610 | MDRV_Z80CTC_ADD( "z80ctc", 2000000 /* same as "sub" */, senjyo_ctc_intf ) | |
| 610 | 611 | |
| 611 | 612 | /* video hardware */ |
| 612 | 613 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 95 | 95 | */ |
| 96 | 96 | |
| 97 | 97 | #include "driver.h" |
| 98 | #include "cpu/m6800/m6800.h" | |
| 98 | 99 | #include "video/mc6845.h" |
| 99 | 100 | |
| 100 | 101 | static UINT8 *murogem_videoram; |
| r3957 | r3958 | |
| 212 | 213 | MDRV_PALETTE_INIT(murogem) |
| 213 | 214 | MDRV_VIDEO_UPDATE(murogem) |
| 214 | 215 | |
| 215 | MDRV_ | |
| 216 | MDRV_M | |
| 216 | 217 | MACHINE_DRIVER_END |
| 217 | 218 | |
| 218 | 219 |
| r3957 | r3958 | |
|---|---|---|
| 76 | 76 | static WRITE16_HANDLER( snowbros_flipscreen_w ) |
| 77 | 77 | { |
| 78 | 78 | if (ACCESSING_BITS_8_15) |
| 79 | flip_screen_set(~data & 0x8000); | |
| 79 | flip_screen_set(space->machine, ~data & 0x8000); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 |
| r3957 | r3958 | |
|---|---|---|
| 201 | 201 | ***************************************************************************/ |
| 202 | 202 | |
| 203 | 203 | #include "driver.h" |
| 204 | #include "cpu/m6502/m6502.h" | |
| 204 | 205 | #include "video/vector.h" |
| 205 | 206 | #include "video/avgdvg.h" |
| 206 | 207 | #include "machine/mathbox.h" |
| r3957 | r3958 | |
|---|---|---|
| 184 | 184 | ***************************************************************************/ |
| 185 | 185 | |
| 186 | 186 | #include "driver.h" |
| 187 | #include "cpu/m6502/m6502.h" | |
| 187 | 188 | #include "machine/atari_vg.h" |
| 188 | 189 | #include "video/avgdvg.h" |
| 189 | 190 | #include "video/vector.h" |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/z80/z80.h" | |
| 23 | 24 | #include "system16.h" |
| 24 | 25 | #include "cpu/m68000/m68000.h" |
| 25 | 26 | #include "machine/segaic16.h" |
| r3957 | r3958 | |
| 210 | 211 | segaic16_tilemap_reset(machine, 0); |
| 211 | 212 | |
| 212 | 213 | /* hook the RESET line, which resets CPU #1 */ |
| 213 | c | |
| 214 | device | |
| 214 | 215 | |
| 215 | 216 | /* set up the compare/timer chip */ |
| 216 | 217 | segaic16_compare_timer_init(0, sound_data_w, timer_ack_callback); |
| r3957 | r3958 | |
| 1138 | 1139 | |
| 1139 | 1140 | MDRV_MACHINE_RESET(xboard) |
| 1140 | 1141 | MDRV_NVRAM_HANDLER(xboard) |
| 1141 | MDRV_ | |
| 1142 | MDRV_QUANTUM_TIME | |
| 1142 | 1143 | |
| 1143 | 1144 | /* video hardware */ |
| 1144 | 1145 | MDRV_GFXDECODE(segaxbd) |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | ******************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/z80/z80.h" | |
| 23 | 24 | #include "machine/z80ctc.h" |
| 24 | 25 | #include "nb1413m3.h" // needed for mahjong input controller |
| 25 | 26 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 490 | 491 | |
| 491 | 492 | static z80ctc_interface ctc_intf_main = |
| 492 | 493 | { |
| 493 | "main", /* clock from main CPU */ | |
| 494 | 0, /* clock */ | |
| 495 | 494 | 0, /* timer disables */ |
| 496 | 495 | ctc0_interrupt, /* interrupt handler */ |
| 497 | 496 | 0, /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */ |
| r3957 | r3958 | |
| 501 | 500 | |
| 502 | 501 | static z80ctc_interface ctc_intf_audio = |
| 503 | 502 | { |
| 504 | "audio", /* clock from audio CPU */ | |
| 505 | 0, /* clock */ | |
| 506 | 503 | 0, /* timer disables */ |
| 507 | 504 | ctc1_interrupt, /* interrupt handler */ |
| 508 | 505 | z80ctc_trg3_w, /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */ |
| r3957 | r3958 | |
| 3640 | 3637 | MDRV_CPU_PROGRAM_MAP(sound_readmem, sound_writemem) |
| 3641 | 3638 | MDRV_CPU_IO_MAP(sound_readport, sound_writeport) |
| 3642 | 3639 | |
| 3643 | MDRV_Z80CTC_ADD("main_ctc", ctc_intf_main) | |
| 3644 | MDRV_Z80CTC_ADD("audio_ctc", ctc_intf_audio) | |
| 3640 | MDRV_Z80CTC_ADD("main_ctc", 12000000/2 /* same as "main" */, ctc_intf_main) | |
| 3641 | MDRV_Z80CTC_ADD("audio_ctc", 8000000/1 /* same as "audio" */, ctc_intf_audio) | |
| 3645 | 3642 | |
| 3646 | 3643 | MDRV_MACHINE_RESET(sailorws) |
| 3647 | 3644 |
| r3957 | r3958 | |
|---|---|---|
| 88 | 88 | *******************************************************************************************/ |
| 89 | 89 | |
| 90 | 90 | #include "driver.h" |
| 91 | #include "cpu/z80/z80.h" | |
| 91 | 92 | #include "sound/okim6295.h" |
| 92 | 93 | #include "machine/eeprom.h" |
| 93 | 94 |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | #include "cpu/m68000/m68000.h" | |
| 84 | 85 | #include "cpu/mcs51/mcs51.h" |
| 85 | 86 | #include "sound/okim6295.h" |
| 86 | 87 |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/z80/z80.h" | |
| 67 | 68 | #include "render.h" |
| 68 | 69 | #include "machine/laserdsc.h" |
| 69 | 70 |
| r3957 | r3958 | |
|---|---|---|
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | #include "cpu/nec/nec.h" | |
| 40 | 41 | #include "deprecat.h" |
| 41 | 42 | #include "audio/seibu.h" |
| 42 | 43 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 237 | 238 | |
| 238 | 239 | SEIBU3A_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) |
| 239 | 240 | |
| 240 | MDRV_ | |
| 241 | MDRV_QUANTUM_TIME | |
| 241 | 242 | |
| 242 | 243 | MDRV_MACHINE_RESET(seibu_sound) |
| 243 | 244 |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | *********************************************************/ |
| 75 | 75 | |
| 76 | 76 | #include "driver.h" |
| 77 | #include "cpu/z80/z80.h" | |
| 77 | 78 | #include "render.h" |
| 78 | 79 | #include "machine/laserdsc.h" |
| 79 | 80 | #include "video/tms9928a.h" |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | ***************************************************************************/ |
| 57 | 57 | |
| 58 | 58 | #include "driver.h" |
| 59 | #include "cpu/m6502/m6502.h" | |
| 59 | 60 | #include "copsnrob.h" |
| 60 | 61 | #include "copsnrob.lh" |
| 61 | 62 |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/m68000/m68000.h" | |
| 25 | 26 | #include "cpu/tms34010/tms34010.h" |
| 26 | 27 | #include "video/tlc34076.h" |
| 27 | 28 | #include "artmagic.h" |
| r3957 | r3958 | |
| 699 | 700 | MDRV_CPU_PROGRAM_MAP(tms_map,0) |
| 700 | 701 | |
| 701 | 702 | MDRV_MACHINE_RESET(artmagic) |
| 702 | MDRV_ | |
| 703 | MDRV_QUANTUM_TIME | |
| 703 | 704 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 704 | 705 | |
| 705 | 706 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | *******************************************************************************/ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/m6502/m6502.h" | |
| 29 | 30 | #include "deprecat.h" |
| 30 | 31 | #include "cpu/m6809/m6809.h" |
| 31 | 32 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 432 | 433 | { |
| 433 | 434 | rotation_sign = !(data & 1); |
| 434 | 435 | |
| 435 | flip_screen_set(!(data & 4)); | |
| 436 | flip_screen_set(space->machine, !(data & 4)); | |
| 436 | 437 | |
| 437 | 438 | scrolly_hi = (data & 0xf0) << 4; |
| 438 | 439 |
| r3957 | r3958 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | |
| 190 | 190 | #include "driver.h" |
| 191 | #include "cpu/z80/z80.h" | |
| 191 | 192 | #include "cpu/m68000/m68000.h" |
| 192 | 193 | #include "cpu/tms32010/tms32010.h" |
| 193 | 194 | #include "twincobr.h" |
| r3957 | r3958 | |
| 716 | 717 | /* Data Map is internal to the CPU */ |
| 717 | 718 | MDRV_CPU_IO_MAP(DSP_io_map, 0) |
| 718 | 719 | |
| 719 | MDRV_ | |
| 720 | MDRV_QUANTUM_TIME | |
| 720 | 721 | |
| 721 | 722 | MDRV_MACHINE_RESET(twincobr) /* Reset fshark bootleg 8741 MCU data */ |
| 722 | 723 |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | ***************************************************************************/ |
| 80 | 80 | |
| 81 | 81 | #include "driver.h" |
| 82 | #include "cpu/z80/z80.h" | |
| 82 | 83 | #include "deprecat.h" |
| 83 | 84 | #include "sound/okim6295.h" |
| 84 | 85 | #include "sound/k051649.h" |
| r3957 | r3958 | |
| 104 | 105 | coin_counter_w(1,data & 0x02); |
| 105 | 106 | |
| 106 | 107 | /* bit 5 = flip screen */ |
| 107 | flip_screen_set(data & 0x20); | |
| 108 | flip_screen_set(space->machine, data & 0x20); | |
| 108 | 109 | |
| 109 | 110 | /* other bit unknown */ |
| 110 | 111 | if ((data & 0xdc) != 0x10) popmessage("coincntr %02x",data); |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | 18 | #include "driver.h" |
| 19 | #include "cpu/z80/z80.h" | |
| 19 | 20 | #include "cpu/m6805/m6805.h" |
| 20 | 21 | #include "sound/ay8910.h" |
| 21 | 22 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 483 | 484 | |
| 484 | 485 | MDRV_MACHINE_RESET(buggychl) |
| 485 | 486 | |
| 486 | MDRV_ | |
| 487 | MDRV_QUANTUM_TIME | |
| 487 | 488 | MACHINE_DRIVER_END |
| 488 | 489 | |
| 489 | 490 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/z80/z80.h" | |
| 20 | 21 | #include "cpu/m68000/m68000.h" |
| 21 | 22 | #include "decocrpt.h" |
| 22 | 23 | #include "deco16ic.h" |
| r3957 | r3958 | |
| 103 | 104 | inc = 1; |
| 104 | 105 | } |
| 105 | 106 | |
| 106 | if (flip_screen_get()) | |
| 107 | if (flip_screen_get(machine)) | |
| 107 | 108 | { |
| 108 | 109 | y=240-y; |
| 109 | 110 | x=304-x; |
| r3957 | r3958 | |
| 153 | 154 | |
| 154 | 155 | static VIDEO_UPDATE(dblewing) |
| 155 | 156 | { |
| 156 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 157 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 157 | 158 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 158 | 159 | |
| 159 | 160 | bitmap_fill(bitmap,cliprect,0); /* not Confirmed */ |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/m68000/m68000.h" | |
| 25 | 26 | #include "deprecat.h" |
| 26 | 27 | #include "machine/eeprom.h" |
| 27 | 28 | #include "kaneko16.h" |
| r3957 | r3958 | |
|---|---|---|
| 67 | 67 | ***************************************************************************/ |
| 68 | 68 | |
| 69 | 69 | #include "driver.h" |
| 70 | #include "cpu/z80/z80.h" | |
| 70 | 71 | #include "arabian.h" |
| 71 | 72 | #include "sound/ay8910.h" |
| 72 | 73 |
| r3957 | r3958 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | #include "driver.h" |
| 85 | #include "cpu/alph8201/alph8201.h" | |
| 85 | 86 | #include "cpu/z80/z80.h" |
| 86 | 87 | #include "sound/ay8910.h" |
| 87 | 88 | #include "video/resnet.h" |
| r3957 | r3958 | |
| 387 | 388 | MDRV_CPU_ADD("mcu", ALPHA8201, 10000000/4/8) |
| 388 | 389 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 389 | 390 | |
| 390 | MDRV_ | |
| 391 | MDRV_QUANTUM_TIME | |
| 391 | 392 | MDRV_WATCHDOG_VBLANK_INIT(16) // assuming it's the same as champbas |
| 392 | 393 | |
| 393 | 394 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 308 | 308 | */ |
| 309 | 309 | |
| 310 | 310 | #include "driver.h" |
| 311 | #include " | |
| 311 | #include " | |
| 312 | 312 | #include "cpu/powerpc/ppc.h" |
| 313 | 313 | #include "cpu/sharc/sharc.h" |
| 314 | 314 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 1007 | 1007 | memset(jvs_sdata, 0, 1024); |
| 1008 | 1008 | |
| 1009 | 1009 | /* set conservative DRC options */ |
| 1010 | c | |
| 1010 | device | |
| 1011 | 1011 | |
| 1012 | 1012 | /* configure fast RAM regions for DRC */ |
| 1013 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 1014 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 1015 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); | |
| 1016 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); | |
| 1017 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 1013 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 1014 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 1015 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); | |
| 1016 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); | |
| 1017 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 1018 | 1018 | |
| 1019 | 1019 | state_save_register_global(machine, led_reg0); |
| 1020 | 1020 | state_save_register_global(machine, led_reg1); |
| r3957 | r3958 | |
| 1043 | 1043 | NVRAM_HANDLER_CALL(93C46); |
| 1044 | 1044 | } |
| 1045 | 1045 | |
| 1046 | static const timekeeper_config timekeeper_intf = | |
| 1047 | { | |
| 1048 | "m48t58" | |
| 1049 | }; | |
| 1050 | ||
| 1051 | 1046 | static MACHINE_DRIVER_START( hornet ) |
| 1052 | 1047 | |
| 1053 | 1048 | /* basic machine hardware */ |
| r3957 | r3958 | |
| 1061 | 1056 | MDRV_CPU_CONFIG(sharc_cfg) |
| 1062 | 1057 | MDRV_CPU_DATA_MAP(sharc0_map, 0) |
| 1063 | 1058 | |
| 1064 | MDRV_ | |
| 1059 | MDRV_QUANTUM_TIME | |
| 1065 | 1060 | |
| 1066 | 1061 | MDRV_MACHINE_START( hornet ) |
| 1067 | 1062 | MDRV_MACHINE_RESET( hornet ) |
| r3957 | r3958 | |
| 1091 | 1086 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| 1092 | 1087 | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 1093 | 1088 | |
| 1094 | MDRV_DEVICE_ADD( "m48t58", M48T58 ) | |
| 1095 | MDRV_DEVICE_CONFIG( timekeeper_intf ) | |
| 1089 | MDRV_M48T58_ADD( "m48t58" ) | |
| 1096 | 1090 | MACHINE_DRIVER_END |
| 1097 | 1091 | |
| 1098 | 1092 | static MACHINE_RESET( hornet_2board ) |
| r3957 | r3958 | |
| 1173 | 1167 | |
| 1174 | 1168 | /*****************************************************************************/ |
| 1175 | 1169 | |
| 1176 | static void jamma_jvs_cmd_exec( | |
| 1170 | static void jamma_jvs_cmd_exec(running_machine *machine); | |
| 1177 | 1171 | |
| 1178 | static void jamma_jvs_w(UINT8 data) | |
| 1172 | static void jamma_jvs_w(const device_config *device, UINT8 data) | |
| 1179 | 1173 | { |
| 1180 | 1174 | if (jvs_sdata_ptr == 0 && data != 0xe0) |
| 1181 | 1175 | return; |
| r3957 | r3958 | |
| 1183 | 1177 | jvs_sdata_ptr++; |
| 1184 | 1178 | |
| 1185 | 1179 | if (jvs_sdata_ptr >= 3 && jvs_sdata_ptr >= 3 + jvs_sdata[2]) |
| 1186 | jamma_jvs_cmd_exec(); | |
| 1180 | jamma_jvs_cmd_exec(device->machine); | |
| 1187 | 1181 | } |
| 1188 | 1182 | |
| 1189 | static int jvs_encode_data(UINT8 *in, int length) | |
| 1183 | static int jvs_encode_data(running_machine *machine, UINT8 *in, int length) | |
| 1190 | 1184 | { |
| 1191 | running_machine *machine = Machine; | |
| 1192 | 1185 | int inptr = 0; |
| 1193 | 1186 | int sum = 0; |
| 1194 | 1187 | |
| r3957 | r3958 | |
| 1238 | 1231 | return outptr; |
| 1239 | 1232 | } |
| 1240 | 1233 | |
| 1241 | static void jamma_jvs_cmd_exec( | |
| 1234 | static void jamma_jvs_cmd_exec(running_machine *machine) | |
| 1242 | 1235 | { |
| 1243 | running_machine *machine = Machine; | |
| 1244 | 1236 | UINT8 sync, node, byte_num; |
| 1245 | 1237 | UINT8 data[1024], rdata[1024]; |
| 1246 | 1238 | int length; |
| r3957 | r3958 | |
| 1303 | 1295 | ppc4xx_spu_receive_byte(machine->cpu[0], 0xe0); // sync |
| 1304 | 1296 | ppc4xx_spu_receive_byte(machine->cpu[0], 0x00); // node |
| 1305 | 1297 | ppc4xx_spu_receive_byte(machine->cpu[0], rdata_ptr+1); // num of bytes |
| 1306 | sum += jvs_encode_data(rdata, rdata_ptr); | |
| 1298 | sum += jvs_encode_data(machine, rdata, rdata_ptr); | |
| 1307 | 1299 | ppc4xx_spu_receive_byte(machine->cpu[0], sum - 1); // checksum |
| 1308 | 1300 | |
| 1309 | 1301 | jvs_sdata_ptr = 0; |
| r3957 | r3958 | |
| 1326 | 1318 | |
| 1327 | 1319 | static DRIVER_INIT(hornet) |
| 1328 | 1320 | { |
| 1329 | init_konami_cgboard(1, CGBOARD_TYPE_HORNET); | |
| 1330 | set_cgboard_texture_bank(0, 5, memory_region(machine, "user5")); | |
| 1321 | init_konami_cgboard(machine, 1, CGBOARD_TYPE_HORNET); | |
| 1322 | set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5")); | |
| 1331 | 1323 | |
| 1332 | 1324 | K056800_init(machine, sound_irq_callback); |
| 1333 | 1325 | K033906_init(machine); |
| r3957 | r3958 | |
| 1339 | 1331 | |
| 1340 | 1332 | static DRIVER_INIT(hornet_2board) |
| 1341 | 1333 | { |
| 1342 | init_konami_cgboard(2, CGBOARD_TYPE_HORNET); | |
| 1343 | set_cgboard_texture_bank(0, 5, memory_region(machine, "user5")); | |
| 1344 | set_cgboard_texture_bank(1, 6, memory_region(machine, "user5")); | |
| 1334 | init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET); | |
| 1335 | set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5")); | |
| 1336 | set_cgboard_texture_bank(machine, 1, 6, memory_region(machine, "user5")); | |
| 1345 | 1337 | |
| 1346 | 1338 | K056800_init(machine, sound_irq_callback); |
| 1347 | 1339 | K033906_init(machine); |
| r3957 | r3958 | |
| 1355 | 1347 | |
| 1356 | 1348 | ROM_START(sscope) |
| 1357 | 1349 | ROM_REGION32_BE(0x400000, "user1", 0) /* PowerPC program */ |
| 1358 | ROM_LOAD16_WORD_SWAP("ss1-1.27p", 0x200000, 0x200000, CRC(3b6bb075) SHA1(babc134c3a20c7cdcaa735d5f1fd5cab38667a14)) | |
| 1350 | ROM_LOAD16_WORD_SWAP("ss1-1.27p", 0x200000, 0x200000, CRC(3b6bb075) SHA1(babc134c3a20c7cdcaa735d5f1fd5cab38667a14) ) | |
| 1359 | 1351 | ROM_RELOAD(0x000000, 0x200000) |
| 1360 | 1352 | |
| 1361 | 1353 | ROM_REGION32_BE(0x800000, "user2", ROMREGION_ERASE00) /* Data roms */ |
| 1362 | 1354 | |
| 1363 | 1355 | ROM_REGION(0x80000, "audio", 0) /* 68K Program */ |
| 1364 | ROM_LOAD16_WORD_SWAP("ss1-1.7s", 0x000000, 0x80000, CRC(2805ea1d) SHA1(2556a51ee98cb8f59bf081e916c69a24532196f1)) | |
| 1356 | ROM_LOAD16_WORD_SWAP("ss1-1.7s", 0x000000, 0x80000, CRC(2805ea1d) SHA1(2556a51ee98cb8f59bf081e916c69a24532196f1) ) | |
| 1365 | 1357 | |
| 1366 | 1358 | ROM_REGION(0x1000000, "user5", 0) /* CG Board texture roms */ |
| 1367 | 1359 | ROM_LOAD32_WORD( "ss1-3.u32", 0x000000, 0x400000, CRC(335793e1) SHA1(d582b53c3853abd59bc728f619a30c27cfc9497c) ) |
| r3957 | r3958 | |
| 1377 | 1369 | |
| 1378 | 1370 | ROM_START(sscopea) |
| 1379 | 1371 | ROM_REGION32_BE(0x400000, "user1", 0) /* PowerPC program */ |
| 1380 | ROM_LOAD16_WORD_SWAP("830_a01.bin", 0x200000, 0x200000, CRC(39e353f1) SHA1(569b06969ae7a690f6d6e63cc3b5336061663a37)) | |
| 1372 | ROM_LOAD16_WORD_SWAP("830_a01.bin", 0x200000, 0x200000, CRC(39e353f1) SHA1(569b06969ae7a690f6d6e63cc3b5336061663a37) ) | |
| 1381 | 1373 | ROM_RELOAD(0x000000, 0x200000) |
| 1382 | 1374 | |
| 1383 | 1375 | ROM_REGION32_BE(0x800000, "user2", ROMREGION_ERASE00) /* Data roms */ |
| 1384 | 1376 | |
| 1385 | 1377 | ROM_REGION(0x80000, "audio", 0) /* 68K Program */ |
| 1386 | ROM_LOAD16_WORD_SWAP("ss1-1.7s", 0x000000, 0x80000, CRC(2805ea1d) SHA1(2556a51ee98cb8f59bf081e916c69a24532196f1)) | |
| 1378 | ROM_LOAD16_WORD_SWAP("ss1-1.7s", 0x000000, 0x80000, CRC(2805ea1d) SHA1(2556a51ee98cb8f59bf081e916c69a24532196f1) ) | |
| 1387 | 1379 | |
| 1388 | 1380 | ROM_REGION(0x1000000, "user5", 0) /* CG Board texture roms */ |
| 1389 | 1381 | ROM_LOAD32_WORD( "ss1-3.u32", 0x000000, 0x400000, CRC(335793e1) SHA1(d582b53c3853abd59bc728f619a30c27cfc9497c) ) |
| r3957 | r3958 | |
| 1399 | 1391 | |
| 1400 | 1392 | ROM_START(sscope2) |
| 1401 | 1393 | ROM_REGION32_BE(0x400000, "user1", 0) /* PowerPC program */ |
| 1402 | ROM_LOAD16_WORD_SWAP("931d01.bin", 0x200000, 0x200000, CRC(4065fde6) SHA1(84f2dedc3e8f61651b22c0a21433a64993e1b9e2)) | |
| 1394 | ROM_LOAD16_WORD_SWAP("931d01.bin", 0x200000, 0x200000, CRC(4065fde6) SHA1(84f2dedc3e8f61651b22c0a21433a64993e1b9e2) ) | |
| 1403 | 1395 | ROM_RELOAD(0x000000, 0x200000) |
| 1404 | 1396 | |
| 1405 | 1397 | ROM_REGION32_BE(0x800000, "user2", 0) /* Data roms */ |
| 1406 | ROM_LOAD32_WORD_SWAP("931a04.bin", 0x000000, 0x200000, CRC(4f5917e6) SHA1(a63a107f1d6d9756e4ab0965d72ea446f0692814)) | |
| 1398 | ROM_LOAD32_WORD_SWAP("931a04.bin", 0x000000, 0x200000, CRC(4f5917e6) SHA1(a63a107f1d6d9756e4ab0965d72ea446f0692814) ) | |
| 1407 | 1399 | |
| 1408 | 1400 | ROM_REGION32_BE(0x800000, "user3", 0) /* Comm board roms */ |
| 1409 | ROM_LOAD("931a19.bin", 0x000000, 0x400000, BAD_DUMP CRC(8e8bb6af) SHA1(1bb399f7897fbcbe6852fda3215052b2810437d8)) | |
| 1410 | ROM_LOAD("931a20.bin", 0x400000, 0x400000, BAD_DUMP CRC(a14a7887) SHA1(daf0cbaf83e59680a0d3c4d66fcc48d02c9723d1)) | |
| 1401 | ROM_LOAD("931a19.bin", 0x000000, 0x400000, CRC(8b25a6f1) SHA1(41f9c2046a6aae1e9f5f3ffa3e0ffb15eba46211) ) | |
| 1402 | ROM_LOAD("931a20.bin", 0x400000, 0x400000, CRC(ecf665f6) SHA1(5a73e87435560a7bb2d0f9be7fba12254b18708d) ) | |
| 1411 | 1403 | |
| 1412 | 1404 | ROM_REGION(0x800000, "user5", ROMREGION_ERASE00) /* CG Board texture roms */ |
| 1413 | 1405 | |
| 1414 | 1406 | ROM_REGION(0x80000, "audio", 0) /* 68K Program */ |
| 1415 | ROM_LOAD16_WORD_SWAP("931a08.bin", 0x000000, 0x80000, CRC(1597d604) SHA1(a1eab4d25907930b59ea558b484c3b6ddcb9303c)) | |
| 1407 | ROM_LOAD16_WORD_SWAP("931a08.bin", 0x000000, 0x80000, CRC(1597d604) SHA1(a1eab4d25907930b59ea558b484c3b6ddcb9303c) ) | |
| 1416 | 1408 | |
| 1417 | 1409 | ROM_REGION(0xc00000, "rf", 0) /* PCM sample roms */ |
| 1418 | 1410 | ROM_LOAD( "931a09.bin", 0x000000, 0x400000, CRC(694c354c) SHA1(42f54254a5959e1b341f2801f1ad032c4ed6f329) ) |
| r3957 | r3958 | |
|---|---|---|
| 120 | 120 | ***************************************************************************/ |
| 121 | 121 | |
| 122 | 122 | #include "driver.h" |
| 123 | #include "cpu/m6502/m6502.h" | |
| 123 | 124 | #include "sound/pokey.h" |
| 124 | 125 | #include "ccastles.h" |
| 125 | 126 |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | Combatribes has sprite lag but it seems to be caused by poor |
| 13 | 13 | programming and I think the original does the same. |
| 14 | 14 | |
| 15 | ||
| 16 | ||
| 17 | Double Dragon 3 PCB Layout | |
| 18 | -------------------------- | |
| 19 | ||
| 20 | TA-0030-P1-03 (early version with EPROMs) | |
| 21 | TA-0030-P1-04 (later version with MASKROMs) | |
| 22 | |----------------------------------------------| | |
| 23 | |VOL M51516 YM3012 YM2151 3.579545MHz IC15 | | |
| 24 | | MB3615 1.056MHz Z80 IC14|-| | |
| 25 | | MB3615 M6295 IC43 | | | |
| 26 | | 6116 IC13| | | |
| 27 | | IC74 6116 |-------| IC12| | | |
| 28 | | IC73 28MHz|TECHNOS| | | | |
| 29 | | 6116 |TJ-003 | IC11| | | |
| 30 | |J | | IC10|-| | |
| 31 | |A 6116 |-------| | | |
| 32 | |M 30.IC38 IC9 | | |
| 33 | |M DSW1 |-------| IC8 |-| | |
| 34 | |A |TECHNOS| | | | |
| 35 | | DSW2 |TJ-002 | IC7 | | | |
| 36 | | 6116 | | IC6 | | | |
| 37 | | 6116 |-------| | | | |
| 38 | | IC79 IC80 6264 IC5 | | | |
| 39 | |CN4 6264 6264 IC4 |-| | |
| 40 | | 68000 6264 20MHz | | |
| 41 | |----------------------------------------------| | |
| 42 | Notes: | |
| 43 | 6264 - 8k x8 SRAM | |
| 44 | 6116 - 2k x8 SRAM | |
| 45 | 68000 clock - 10.000MHz [20/2] | |
| 46 | Z80 clock - 3.579545MHz | |
| 47 | M6295 clock - 1.056MHz. Pin 7 HIGH | |
| 48 | YM2151 clock - 3.579545MHz | |
| 49 | VSync - 57.4446Hz | |
| 50 | HSync - 15.6250kHz | |
| 51 | CN4 - connector for extra controls | |
| 52 | ||
| 53 | IC4 to IC15 not populated | |
| 54 | IC79 - 1M EPROM (27C010) | |
| 55 | IC80 - 2M EPROM (27C020) | |
| 56 | IC73/74 - 2M EPROM (27C020) | |
| 57 | IC43 - 512k EPROM (27C512) | |
| 58 | 30.IC38 - MB7114 / 82S129 Bipolar PROM | |
| 59 | ||
| 60 | ||
| 61 | ROM Board (only used on earlier version -03 main board) | |
| 62 | --------- | |
| 63 | TA-0028-P2-10 | |
| 64 | |------------------------| | |
| 65 | |IC33 | | |
| 66 | |IC34 |-| | |
| 67 | |IC35 IC19 IC3 | | | |
| 68 | |IC36 IC20 IC4 | | | |
| 69 | |IC37 IC21 IC5 | | | |
| 70 | | IC22 IC6 | | | |
| 71 | |IC38 IC23 IC7 | | | |
| 72 | |IC39 IC8 |-| | |
| 73 | |IC40 IC24 | | |
| 74 | |IC41 IC25 | | |
| 75 | |IC42 IC26 |-| | |
| 76 | |IC43 IC27 | | | |
| 77 | | IC28 | | | |
| 78 | |IC44 | | | |
| 79 | |IC45 IC29 IC13 | | | |
| 80 | |IC46 IC30 IC14 | | | |
| 81 | |IC47 IC31 IC15 |-| | |
| 82 | |IC48 IC32 IC16 | | |
| 83 | |------------------------| | |
| 84 | Notes: | |
| 85 | ||
| 86 | ROMs (All ROMs are 27C010 EPROM. - means not populated) | |
| 87 | Label Location | |
| 88 | ---------------- | |
| 89 | 25 IC3 | |
| 90 | 26 IC4 | |
| 91 | 27 IC5 | |
| 92 | 28 IC6 | |
| 93 | 30A9-0 IC7 | |
| 94 | - IC8 | |
| 95 | 30 IC13 | |
| 96 | 31 IC14 | |
| 97 | - IC15 | |
| 98 | - IC16 | |
| 99 | 16 IC19 | |
| 100 | 17 IC20 | |
| 101 | 18 IC21 | |
| 102 | 19 IC22 | |
| 103 | 30A10-0 IC23 | |
| 104 | - IC24 | |
| 105 | 21 IC25 | |
| 106 | 22 IC26 | |
| 107 | - IC27 | |
| 108 | - IC28 | |
| 109 | 23 IC29 | |
| 110 | 24 IC30 | |
| 111 | - IC31 | |
| 112 | - IC32 | |
| 113 | 4 IC33 | |
| 114 | 5 IC34 | |
| 115 | 6 IC35 | |
| 116 | 7 IC36 | |
| 117 | 30A11-0 IC37 | |
| 118 | - IC38 | |
| 119 | 9 IC39 | |
| 120 | 10 IC40 | |
| 121 | 11 IC41 | |
| 122 | 12 IC42 | |
| 123 | 30A12-0 IC43 | |
| 124 | - IC44 | |
| 125 | 14 IC45 | |
| 126 | 15 IC46 | |
| 127 | - IC47 | |
| 128 | - IC48 | |
| 129 | ||
| 15 | 130 | ******************************************************************/ |
| 16 | 131 | |
| 17 | 132 | /* |
| r3957 | r3958 | |
| 24 | 139 | |
| 25 | 140 | |
| 26 | 141 | #include "driver.h" |
| 27 | #include "deprecat.h" | |
| 28 | 142 | #include "cpu/z80/z80.h" |
| 29 | 143 | #include "cpu/m68000/m68000.h" |
| 30 | 144 | #include "sound/2151intf.h" |
| 31 | 145 | #include "sound/okim6295.h" |
| 32 | 146 | |
| 147 | #define PIXEL_CLOCK (XTAL_28MHz / 4) | |
| 33 | 148 | |
| 34 | 149 | extern UINT16 *ddragon3_bg_videoram16; |
| 35 | 150 | extern UINT16 *ddragon3_fg_videoram16; |
| r3957 | r3958 | |
| 76 | 191 | /* this gets written to on startup and at the end of IRQ6 |
| 77 | 192 | ** possibly trigger IRQ on sound CPU |
| 78 | 193 | */ |
| 194 | cpu_set_input_line(space->machine->cpu[0], 6, CLEAR_LINE); | |
| 79 | 195 | break; |
| 80 | 196 | |
| 81 | 197 | case 3: |
| 82 | 198 | /* this gets written to on startup, |
| 83 | 199 | ** and at the end of IRQ5 (input port read) */ |
| 200 | cpu_set_input_line(space->machine->cpu[0], 5, CLEAR_LINE); | |
| 84 | 201 | break; |
| 85 | 202 | |
| 86 | 203 | case 4: |
| 87 | 204 | /* this gets written to at the end of IRQ6 only */ |
| 205 | cpu_set_input_line(space->machine->cpu[0], 6, CLEAR_LINE); | |
| 88 | 206 | break; |
| 89 | 207 | |
| 90 | 208 | default: |
| r3957 | r3958 | |
| 303 | 421 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 304 | 422 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 305 | 423 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 306 | PORT_BIT( 0x0800, IP_ACTIVE_ | |
| 424 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 307 | 425 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 308 | 426 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 309 | 427 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r3957 | r3958 | |
| 467 | 585 | * |
| 468 | 586 | *************************************/ |
| 469 | 587 | |
| 470 | static INTERRUPT_GEN( ddragon3_cpu_interrupt ) { /* 6:0x177e - 5:0x176a */ | |
| 471 | if( cpu_getiloops(device) == 0 ){ | |
| 472 | cpu_set_input_line(device, 6, HOLD_LINE); /* VBlank */ | |
| 588 | static TIMER_DEVICE_CALLBACK( ddragon3_scanline ) | |
| 589 | { | |
| 590 | int scanline = param; | |
| 591 | ||
| 592 | /* An interrupt is generated every 16 scanlines */ | |
| 593 | if (scanline % 16 == 0) | |
| 594 | { | |
| 595 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 596 | cpu_set_input_line(timer->machine->cpu[0], 5, ASSERT_LINE); | |
| 473 | 597 | } |
| 474 | else { | |
| 475 | cpu_set_input_line(device, 5, HOLD_LINE); /* Input Ports */ | |
| 598 | ||
| 599 | /* Vblank is raised on scanline 248 */ | |
| 600 | if (scanline == 248) | |
| 601 | { | |
| 602 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 603 | cpu_set_input_line(timer->machine->cpu[0], 6, ASSERT_LINE); | |
| 476 | 604 | } |
| 605 | ||
| 606 | /* Adjust for next scanline */ | |
| 607 | if (++scanline >= video_screen_get_height(timer->machine->primary_screen)) | |
| 608 | { | |
| 609 | scanline = 0; | |
| 610 | } | |
| 477 | 611 | } |
| 478 | 612 | |
| 479 | 613 | /************************************* |
| r3957 | r3958 | |
| 484 | 618 | |
| 485 | 619 | static MACHINE_DRIVER_START( ddragon3 ) |
| 486 | 620 | /* basic machine hardware */ |
| 487 | MDRV_CPU_ADD("main", M68000, | |
| 621 | MDRV_CPU_ADD("main", M68000, XTAL_20MHz | |
| 488 | 622 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 489 | MDRV_ | |
| 623 | MDRV_TIMER_ | |
| 490 | 624 | |
| 491 | MDRV_CPU_ADD("audio", Z80, 3579545 | |
| 625 | MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz | |
| 492 | 626 | MDRV_CPU_PROGRAM_MAP(readmem_sound, writemem_sound) |
| 493 | 627 | |
| 494 | 628 | /* video hardware */ |
| 495 | 629 | MDRV_SCREEN_ADD("main", RASTER) |
| 496 | MDRV_SCREEN_REFRESH_RATE(57) | |
| 497 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 498 | 630 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 499 | MDRV_SCREEN_SIZE(40*8, 32*8) | |
| 500 | MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) | |
| 631 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 448, 0, 320, 272, 8, 248) /* HTOTAL and VTOTAL are guessed */ | |
| 501 | 632 | |
| 502 | 633 | MDRV_GFXDECODE(ddragon3) |
| 503 | 634 | MDRV_PALETTE_LENGTH(768) |
| r3957 | r3958 | |
| 508 | 639 | /* sound hardware */ |
| 509 | 640 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 510 | 641 | |
| 511 | MDRV_SOUND_ADD("ym2151", YM2151, 3579545) | |
| 642 | MDRV_SOUND_ADD("ym2151", YM2151, XTAL_3_579545MHz) | |
| 512 | 643 | MDRV_SOUND_CONFIG(ym2151_config) |
| 513 | 644 | MDRV_SOUND_ROUTE(0, "left", 0.50) |
| 514 | 645 | MDRV_SOUND_ROUTE(1, "right", 0.50) |
| 515 | 646 | |
| 516 | MDRV_SOUND_ADD("oki", OKIM6295, 1000000) /* sound fx */ | |
| 517 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified | |
| 647 | MDRV_SOUND_ADD("oki", OKIM6295, XTAL_1_056MHz) | |
| 648 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) | |
| 518 | 649 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.50) |
| 519 | 650 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.50) |
| 520 | 651 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 535 | 666 | MDRV_CPU_MODIFY("audio") |
| 536 | 667 | MDRV_CPU_PROGRAM_MAP(ctribe_readmem_sound,ctribe_writemem_sound) |
| 537 | 668 | |
| 538 | MDRV_SCREEN_MODIFY("main") | |
| 539 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
| 540 | ||
| 541 | 669 | MDRV_VIDEO_UPDATE(ctribe) |
| 542 | 670 | |
| 543 | 671 | MDRV_SOUND_MODIFY("ym2151") |
| r3957 | r3958 | |
| 563 | 691 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ |
| 564 | 692 | ROM_LOAD( "30a13-0.ic43", 0x00000, 0x10000, CRC(1e974d9b) SHA1(8e54ff747efe587a2e971c15e729445c4e232f0f) ) |
| 565 | 693 | |
| 566 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) | |
| 567 | ROM_LOAD( "30j-7.ic4", 0x000000, 0x40000, CRC(89d58d32) SHA1(54cfc154024e014f537c7ae0c2275ece50413bc5) ) /* Background */ | |
| 694 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 695 | ROM_LOAD( "30j-7.ic4", 0x000000, 0x40000, CRC(89d58d32) SHA1(54cfc154024e014f537c7ae0c2275ece50413bc5) ) | |
| 568 | 696 | ROM_LOAD( "30j-6.ic5", 0x040000, 0x40000, CRC(9bf1538e) SHA1(c7cb96c6b1ac73ec52f46b2a6687bfcfd375ab44) ) |
| 569 | 697 | ROM_LOAD( "30j-5.ic6", 0x080000, 0x40000, CRC(8f671a62) SHA1(b5dba61ad6ed39440bb98f7b2dc1111779d6c4a1) ) |
| 570 | 698 | ROM_LOAD( "30j-4.ic7", 0x0c0000, 0x40000, CRC(0f74ea1c) SHA1(6bd8dd89bd22b29038cf502a898336e95e50a9cc) ) |
| 571 | 699 | |
| 572 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) | |
| 700 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 573 | 701 | ROM_LOAD( "30j-3.ic9", 0x000000, 0x80000, CRC(b3151871) SHA1(a647b4d9bddd6b8715a1d24641391a2e2d0f8867) ) |
| 574 | 702 | ROM_LOAD( "30a12-0.ic8", 0x080000, 0x10000, CRC(20d64bea) SHA1(c2bd86bc5310f13f158ca2f93cfc57e5dbf01f7e) ) |
| 575 | 703 | ROM_LOAD( "30j-2.ic11", 0x100000, 0x80000, CRC(41c6fb08) SHA1(9fb6105bdc9ff8eeaacf378d208cf6d32a09401b) ) |
| r3957 | r3958 | |
| 594 | 722 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ |
| 595 | 723 | ROM_LOAD( "30j13.ic43", 0x00000, 0x10000, CRC(1e974d9b) SHA1(8e54ff747efe587a2e971c15e729445c4e232f0f) ) |
| 596 | 724 | |
| 597 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) | |
| 598 | ROM_LOAD( "30j-7.ic4", 0x000000, 0x40000, CRC(89d58d32) SHA1(54cfc154024e014f537c7ae0c2275ece50413bc5) ) /* Background */ | |
| 725 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 726 | ROM_LOAD( "30j-7.ic4", 0x000000, 0x40000, CRC(89d58d32) SHA1(54cfc154024e014f537c7ae0c2275ece50413bc5) ) | |
| 599 | 727 | ROM_LOAD( "30j-6.ic5", 0x040000, 0x40000, CRC(9bf1538e) SHA1(c7cb96c6b1ac73ec52f46b2a6687bfcfd375ab44) ) |
| 600 | 728 | ROM_LOAD( "30j-5.ic6", 0x080000, 0x40000, CRC(8f671a62) SHA1(b5dba61ad6ed39440bb98f7b2dc1111779d6c4a1) ) |
| 601 | 729 | ROM_LOAD( "30j-4.ic7", 0x0c0000, 0x40000, CRC(0f74ea1c) SHA1(6bd8dd89bd22b29038cf502a898336e95e50a9cc) ) |
| 602 | 730 | |
| 603 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) | |
| 731 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 604 | 732 | ROM_LOAD( "30j-3.ic9", 0x000000, 0x80000, CRC(b3151871) SHA1(a647b4d9bddd6b8715a1d24641391a2e2d0f8867) ) |
| 605 | 733 | ROM_LOAD( "30j12-0.ic8", 0x080000, 0x10000, CRC(1e9290d7) SHA1(77e660d2dc9a0e2c4c8ceb3e47b7ce674bceb34a) ) |
| 606 | 734 | ROM_LOAD( "30j-2.ic11", 0x100000, 0x80000, CRC(41c6fb08) SHA1(9fb6105bdc9ff8eeaacf378d208cf6d32a09401b) ) |
| r3957 | r3958 | |
| 617 | 745 | ROM_LOAD( "mb7114h.ic38", 0x000000, 0x00100, CRC(113c7443) SHA1(7b0b13e9f0c219f6d436aeec06494734d1f4a599) ) |
| 618 | 746 | ROM_END |
| 619 | 747 | |
| 748 | ROM_START( ddrago3p ) | |
| 749 | ROM_REGION( 0x80000, "main", 0 ) /* 64k for cpu code */ | |
| 750 | ROM_LOAD16_BYTE( "30a14-0.ic80", 0x00001, 0x40000, CRC(f42fe016) SHA1(11511aa43caa12b36a795bfaefee824821282523) ) | |
| 751 | ROM_LOAD16_BYTE( "30a15-0.ic79", 0x00000, 0x20000, CRC(ad50e92c) SHA1(facac5bbe11716d076a40eacbb67f7caab7a4a27) ) | |
| 752 | ||
| 753 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ | |
| 754 | ROM_LOAD( "30a13-0.ic43", 0x00000, 0x10000, CRC(1e974d9b) SHA1(8e54ff747efe587a2e971c15e729445c4e232f0f) ) | |
| 755 | ||
| 756 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 757 | ROM_LOAD( "14.ic45", 0x000000, 0x20000, CRC(b036a27b) SHA1(c13589c3882bb86f14a3b0143f2d9a4474350ddd) ) | |
| 758 | ROM_LOAD( "15.ic46", 0x020000, 0x20000, CRC(24d0bf41) SHA1(2e9c26c8078d17323af6ba378c7ceaed9045d3f7) ) | |
| 759 | ROM_LOAD( "30.ic13", 0x040000, 0x20000, CRC(72fe2b16) SHA1(92f02381c0216cf5cfede6813e4dcb814a040091) ) | |
| 760 | ROM_LOAD( "31.ic14", 0x060000, 0x20000, CRC(ab48a0c8) SHA1(b908f601a621697ad3b5067d26b6fb1713c4af39) ) | |
| 761 | ROM_LOAD( "23.ic29", 0x080000, 0x20000, CRC(0768fedd) SHA1(757c4378f53b4b8cc024b4c5a74d19ab653e886e) ) | |
| 762 | ROM_LOAD( "24.ic30", 0x0a0000, 0x20000, CRC(ec9db18a) SHA1(7e4085ba4c0e20ec00f392a2bf9cdb81be53b97f) ) | |
| 763 | ROM_LOAD( "21.ic25", 0x0c0000, 0x20000, CRC(902744b9) SHA1(eea623ce013bc270b1611982dd2f9388b205dbb3) ) | |
| 764 | ROM_LOAD( "22.ic26", 0x0e0000, 0x20000, CRC(5b142d4d) SHA1(88e22e102efa35449c0d9f6139eb0718528a9d72) ) | |
| 765 | ||
| 766 | ROM_REGION( 0x480000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 767 | ROM_LOAD( "9.ic39", 0x000000, 0x20000, CRC(726c49b7) SHA1(dbafad47bb6b717c409fdc5d81c413f1282f2bbb) ) | |
| 768 | ROM_LOAD( "10.ic40", 0x020000, 0x20000, CRC(37a1c335) SHA1(de70ba51788b601591c3aff71cb94aae349b272d) ) | |
| 769 | ROM_LOAD( "11.ic41", 0x040000, 0x20000, CRC(2bcfe63c) SHA1(678ef0e7cc38e4df1e1d1e3f5cba6601aa520ec6) ) | |
| 770 | ROM_LOAD( "12.ic42", 0x060000, 0x20000, CRC(b864cf17) SHA1(39a5155f40ba500bf201acca6f7d230cb0ea8309) ) | |
| 771 | ROM_COPY( "gfx2", 0x400000, 0x080000, 0x10000 ) | |
| 772 | ROM_LOAD( "4.ic33", 0x100000, 0x20000, CRC(8c71eb06) SHA1(e47acf9e2d5eeec0cff9654210a43c690a45d447) ) | |
| 773 | ROM_LOAD( "5.ic34", 0x120000, 0x20000, CRC(3e134be9) SHA1(0a75b56353bed2743f7ce8f3f74379fc9f0d3cb9) ) | |
| 774 | ROM_LOAD( "6.ic35", 0x140000, 0x20000, CRC(b4115ef0) SHA1(d90943f75051c7590a0effcc30fa813890c9ad11) ) | |
| 775 | ROM_LOAD( "7.ic36", 0x160000, 0x20000, CRC(4639333d) SHA1(8e3c982d6fa38cbec42e8de780f165547b5b0271) ) | |
| 776 | ROM_COPY( "gfx2", 0x420000, 0x180000, 0x10000 ) | |
| 777 | ROM_LOAD( "16.ic19", 0x200000, 0x20000, CRC(04420cc8) SHA1(ed148c52374bbd0d29c12070ea1499333fc04449) ) | |
| 778 | ROM_LOAD( "17.ic20", 0x220000, 0x20000, CRC(33f97b2f) SHA1(40dc5357caa17ed6673588422332966ee97752b7) ) | |
| 779 | ROM_LOAD( "18.ic21", 0x240000, 0x20000, CRC(0f9a8f2a) SHA1(d7e46d32067d3f8b3bacbf96ea313645a9a48410) ) | |
| 780 | ROM_LOAD( "19.ic22", 0x260000, 0x20000, CRC(15c91772) SHA1(8578b6c501e3af64863bd6b28ef59c6884dfe028) ) | |
| 781 | ROM_COPY( "gfx2", 0x440000, 0x280000, 0x10000 ) | |
| 782 | ROM_LOAD( "25.ic3", 0x300000, 0x20000, CRC(894734b3) SHA1(46fa174a303e85f439254976252835626c4b2ddc) ) | |
| 783 | ROM_LOAD( "26.ic4", 0x320000, 0x20000, CRC(cd504584) SHA1(674481b524853dbfcb7d173d58250b1be8464313) ) | |
| 784 | ROM_LOAD( "27.ic5", 0x340000, 0x20000, CRC(38e8a9ad) SHA1(1c66acde8f72fa7c6415a7aadc2dbf4300446c88) ) | |
| 785 | ROM_LOAD( "28.ic6", 0x360000, 0x20000, CRC(80c1cb74) SHA1(5558fa36b238cff1bee9df921e77d7de2062bf15) ) | |
| 786 | ROM_COPY( "gfx2", 0x460000, 0x380000, 0x10000 ) | |
| 787 | ||
| 788 | /* These ROMs are 128kB but only the lower 64kB is addressed */ | |
| 789 | ROM_LOAD( "30a12-0.ic43", 0x400000, 0x20000, CRC(91da004c) SHA1(d61c8545e622de6872ce1f1487dd0342fd81572c) ) | |
| 790 | ROM_LOAD( "30a11-0.ic37", 0x420000, 0x20000, CRC(5f419232) SHA1(86a883d7f0dfdfcc34c90e54f0b65b23b5822c16) ) | |
| 791 | ROM_LOAD( "30a10-0.ic23", 0x440000, 0x20000, CRC(12f641ba) SHA1(1e197a584bcc0b2f3b97e1a8ec61864b279ab951) ) | |
| 792 | ROM_LOAD( "30a9-0.ic7", 0x460000, 0x20000, CRC(9199a77b) SHA1(35b9a2a707ffd7dd2cfc2bea0c78f02f3639d1bd) ) | |
| 793 | ||
| 794 | ROM_REGION( 0x080000, "oki", 0 ) /* ADPCM Samples */ | |
| 795 | ROM_LOAD( "2.ic73", 0x000000, 0x40000, CRC(3af21dbe) SHA1(295d0b7f33c55ef37a71382a22edd8fc97fa5353) ) | |
| 796 | ROM_LOAD( "3.ic74", 0x040000, 0x40000, CRC(c28b53cd) SHA1(93d29669ec899fd5852f61b1d91d0a90cc30e192) ) | |
| 797 | ||
| 798 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 799 | ROM_LOAD( "30.ic38", 0x000000, 0x00100, CRC(113c7443) SHA1(7b0b13e9f0c219f6d436aeec06494734d1f4a599) ) | |
| 800 | ROM_END | |
| 801 | ||
| 620 | 802 | ROM_START( ddrago3b ) |
| 621 | 803 | ROM_REGION( 0x80000, "main", 0 ) /* 64k for cpu code */ |
| 622 | 804 | ROM_LOAD16_BYTE( "dd3.01", 0x00001, 0x20000, CRC(68321d8b) SHA1(bd34d361e8ef18ef2b7e8bfe438b1b098c3151b5) ) |
| r3957 | r3958 | |
| 627 | 809 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ |
| 628 | 810 | ROM_LOAD( "dd3.06", 0x00000, 0x10000, CRC(1e974d9b) SHA1(8e54ff747efe587a2e971c15e729445c4e232f0f) ) |
| 629 | 811 | |
| 630 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) | |
| 631 | /* Background */ | |
| 812 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 632 | 813 | ROM_LOAD( "dd3.f", 0x000000, 0x40000, CRC(89d58d32) SHA1(54cfc154024e014f537c7ae0c2275ece50413bc5) ) |
| 633 | 814 | ROM_LOAD( "dd3.e", 0x040000, 0x40000, CRC(9bf1538e) SHA1(c7cb96c6b1ac73ec52f46b2a6687bfcfd375ab44) ) |
| 634 | 815 | ROM_LOAD( "dd3.b", 0x080000, 0x40000, CRC(8f671a62) SHA1(b5dba61ad6ed39440bb98f7b2dc1111779d6c4a1) ) |
| 635 | 816 | ROM_LOAD( "dd3.a", 0x0c0000, 0x40000, CRC(0f74ea1c) SHA1(6bd8dd89bd22b29038cf502a898336e95e50a9cc) ) |
| 636 | 817 | |
| 637 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) | |
| 638 | /* sprites */ | |
| 818 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 639 | 819 | ROM_LOAD( "dd3.3e", 0x000000, 0x20000, CRC(726c49b7) SHA1(dbafad47bb6b717c409fdc5d81c413f1282f2bbb) ) //4a |
| 640 | 820 | ROM_LOAD( "dd3.3d", 0x020000, 0x20000, CRC(37a1c335) SHA1(de70ba51788b601591c3aff71cb94aae349b272d) ) //3a |
| 641 | 821 | ROM_LOAD( "dd3.3c", 0x040000, 0x20000, CRC(2bcfe63c) SHA1(678ef0e7cc38e4df1e1d1e3f5cba6601aa520ec6) ) //2a |
| r3957 | r3958 | |
| 678 | 858 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ |
| 679 | 859 | ROM_LOAD( "28a10-0.ic89", 0x00000, 0x8000, CRC(4346de13) SHA1(67c6de90ba31a325f03e64d28c9391a315ee359c) ) |
| 680 | 860 | |
| 681 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) | |
| 682 | ROM_LOAD( "28j7-0.ic11", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) /* Background */ | |
| 861 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 862 | ROM_LOAD( "28j7-0.ic11", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) | |
| 683 | 863 | ROM_LOAD( "28j6-0.ic13", 0x040000, 0x40000, CRC(617530fc) SHA1(b9155ed0ae1437bf4d0b7a95e769bc05a820ecec) ) |
| 684 | 864 | ROM_LOAD( "28j5-0.ic12", 0x080000, 0x40000, CRC(cef0a821) SHA1(c7a35048d5ebf3f09abf9d27f91d12adc03befeb) ) |
| 685 | 865 | ROM_LOAD( "28j4-0.ic14", 0x0c0000, 0x40000, CRC(b84fda09) SHA1(3ae0c0ec6c398dea17e248b017ea3e2f6c3571e1) ) |
| 686 | 866 | |
| 687 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) | |
| 688 | ROM_LOAD( "28j3-0.ic77", 0x000000, 0x80000, CRC(1ac2a461) SHA1(17436f5dcf29041ca5f470dfae538e4fc12153cc) ) /* Sprites */ | |
| 867 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 868 | ROM_LOAD( "28j3-0.ic77", 0x000000, 0x80000, CRC(1ac2a461) SHA1(17436f5dcf29041ca5f470dfae538e4fc12153cc) ) | |
| 689 | 869 | ROM_LOAD( "28a14-0.ic60", 0x080000, 0x10000, CRC(972faddb) SHA1(f2b211e8f8301667e6c9a3ce9612e39b16e66a67) ) |
| 690 | 870 | ROM_LOAD( "28j2-0.ic78", 0x100000, 0x80000, CRC(8c796707) SHA1(7417ad0413083876ed65a8612845ccb0d2717530) ) |
| 691 | 871 | ROM_LOAD( "28a13-0.ic61", 0x180000, 0x10000, CRC(eb3ab374) SHA1(db66cb7976c111fa76a3a211e96ad1d7b78ce0ad) ) |
| r3957 | r3958 | |
| 712 | 892 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ |
| 713 | 893 | ROM_LOAD( "28a10-0.ic89", 0x00000, 0x8000, CRC(4346de13) SHA1(67c6de90ba31a325f03e64d28c9391a315ee359c) ) |
| 714 | 894 | |
| 715 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) | |
| 716 | ROM_LOAD( "28j7-0.ic11", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) /* Background */ | |
| 895 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 896 | ROM_LOAD( "28j7-0.ic11", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) | |
| 717 | 897 | ROM_LOAD( "28j6-0.ic13", 0x040000, 0x40000, CRC(617530fc) SHA1(b9155ed0ae1437bf4d0b7a95e769bc05a820ecec) ) |
| 718 | 898 | ROM_LOAD( "28j5-0.ic12", 0x080000, 0x40000, CRC(cef0a821) SHA1(c7a35048d5ebf3f09abf9d27f91d12adc03befeb) ) |
| 719 | 899 | ROM_LOAD( "28j4-0.ic14", 0x0c0000, 0x40000, CRC(b84fda09) SHA1(3ae0c0ec6c398dea17e248b017ea3e2f6c3571e1) ) |
| 720 | 900 | |
| 721 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) | |
| 722 | ROM_LOAD( "28j3-0.ic77", 0x000000, 0x80000, CRC(1ac2a461) SHA1(17436f5dcf29041ca5f470dfae538e4fc12153cc) ) /* Sprites */ | |
| 901 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 902 | ROM_LOAD( "28j3-0.ic77", 0x000000, 0x80000, CRC(1ac2a461) SHA1(17436f5dcf29041ca5f470dfae538e4fc12153cc) ) | |
| 723 | 903 | ROM_LOAD( "28a14-0.ic60", 0x080000, 0x10000, CRC(972faddb) SHA1(f2b211e8f8301667e6c9a3ce9612e39b16e66a67) ) |
| 724 | 904 | ROM_LOAD( "28j2-0.ic78", 0x100000, 0x80000, CRC(8c796707) SHA1(7417ad0413083876ed65a8612845ccb0d2717530) ) |
| 725 | 905 | ROM_LOAD( "28a13-0.ic61", 0x180000, 0x10000, CRC(eb3ab374) SHA1(db66cb7976c111fa76a3a211e96ad1d7b78ce0ad) ) |
| r3957 | r3958 | |
| 746 | 926 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ |
| 747 | 927 | ROM_LOAD( "ct_ep4.rom", 0x00000, 0x8000, CRC(4346de13) SHA1(67c6de90ba31a325f03e64d28c9391a315ee359c) ) |
| 748 | 928 | |
| 749 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) | |
| 750 | ROM_LOAD( "ct_mr7.rom", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) /* Background */ | |
| 929 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 930 | ROM_LOAD( "ct_mr7.rom", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) | |
| 751 | 931 | ROM_LOAD( "ct_mr6.rom", 0x040000, 0x40000, CRC(617530fc) SHA1(b9155ed0ae1437bf4d0b7a95e769bc05a820ecec) ) |
| 752 | 932 | ROM_LOAD( "ct_mr5.rom", 0x080000, 0x40000, CRC(cef0a821) SHA1(c7a35048d5ebf3f09abf9d27f91d12adc03befeb) ) |
| 753 | 933 | ROM_LOAD( "ct_mr4.rom", 0x0c0000, 0x40000, CRC(b84fda09) SHA1(3ae0c0ec6c398dea17e248b017ea3e2f6c3571e1) ) |
| 754 | 934 | |
| 755 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) | |
| 756 | ROM_LOAD( "ct_mr3.rom", 0x000000, 0x80000, CRC(1ac2a461) SHA1(17436f5dcf29041ca5f470dfae538e4fc12153cc) ) /* Sprites */ | |
| 935 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 936 | ROM_LOAD( "ct_mr3.rom", 0x000000, 0x80000, CRC(1ac2a461) SHA1(17436f5dcf29041ca5f470dfae538e4fc12153cc) ) | |
| 757 | 937 | ROM_LOAD( "ct_ep5.rom", 0x080000, 0x10000, CRC(972faddb) SHA1(f2b211e8f8301667e6c9a3ce9612e39b16e66a67) ) |
| 758 | 938 | ROM_LOAD( "ct_mr2.rom", 0x100000, 0x80000, CRC(8c796707) SHA1(7417ad0413083876ed65a8612845ccb0d2717530) ) |
| 759 | 939 | ROM_LOAD( "ct_ep6.rom", 0x180000, 0x10000, CRC(eb3ab374) SHA1(db66cb7976c111fa76a3a211e96ad1d7b78ce0ad) ) |
| r3957 | r3958 | |
| 777 | 957 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound cpu code */ |
| 778 | 958 | ROM_LOAD( "6.bin", 0x00000, 0x10000, CRC(0101df2d) SHA1(35e1efa4a11c0f9d9db5ee057926e5de29c3a4c1) ) |
| 779 | 959 | |
| 780 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) | |
| 781 | ROM_LOAD( "7.bin", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) /* Background */ | |
| 960 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 961 | ROM_LOAD( "7.bin", 0x000000, 0x40000, CRC(a8b773f1) SHA1(999e41dfeb3fb937da769c4a33bb29bf4076dc63) ) | |
| 782 | 962 | ROM_LOAD( "8.bin", 0x040000, 0x40000, CRC(617530fc) SHA1(b9155ed0ae1437bf4d0b7a95e769bc05a820ecec) ) |
| 783 | 963 | ROM_LOAD( "11.bin", 0x080000, 0x40000, CRC(cef0a821) SHA1(c7a35048d5ebf3f09abf9d27f91d12adc03befeb) ) |
| 784 | 964 | ROM_LOAD( "12.bin", 0x0c0000, 0x40000, CRC(b84fda09) SHA1(3ae0c0ec6c398dea17e248b017ea3e2f6c3571e1) ) |
| r3957 | r3958 | |
| 787 | 967 | ROM_LOAD( "13.bin", 0x180000, 0x20000, CRC(59e01fe1) SHA1(67f5a4e9c9e9ebc6218b7c2ede0e5ff51682ee2f) ) |
| 788 | 968 | ROM_LOAD( "14.bin", 0x1c0000, 0x20000, CRC(a69ab4f3) SHA1(bc99c6a587c972cb5c9e719c53ef921a28f1498e) ) |
| 789 | 969 | |
| 790 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) | |
| 791 | ROM_LOAD( "34.bin", 0x000000, 0x20000, CRC(5b498f0e) SHA1(9d93ca1f44e1f04eb3b66db6027130683c9431a2) ) /* Sprites */ | |
| 970 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Sprites */ | |
| 971 | ROM_LOAD( "34.bin", 0x000000, 0x20000, CRC(5b498f0e) SHA1(9d93ca1f44e1f04eb3b66db6027130683c9431a2) ) | |
| 792 | 972 | ROM_LOAD( "33.bin", 0x020000, 0x20000, CRC(14d79049) SHA1(250c87aa238fc794cd0f07e3388b97137cc1228f) ) |
| 793 | 973 | ROM_LOAD( "32.bin", 0x040000, 0x20000, CRC(9631ea23) SHA1(de0a6595731d185ea18959bd04e3ac9e4261a8f8) ) |
| 794 | 974 | ROM_LOAD( "31.bin", 0x060000, 0x20000, CRC(0ca8d3b9) SHA1(c48e7c456acb9deb7f01c19ab9a66360af09a13d) ) |
| r3957 | r3958 | |
| 821 | 1001 | *************************************/ |
| 822 | 1002 | |
| 823 | 1003 | GAME( 1990, ddragon3, 0, ddragon3, ddragon3, 0, ROT0, "Technos", "Double Dragon 3 - The Rosetta Stone (US)", GAME_SUPPORTS_SAVE ) |
| 824 | GAME( 1990, ddrago3j, ddragon3, ddragon3, ddragon3, 0, ROT0, "Technos", "Double Dragon 3 - The Rosetta Stone (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1004 | GAME( 1990, ddrago3j, ddragon3, ddragon3, ddragon3, 0, ROT0, "Technos", "Double Dragon 3 - The Rosetta Stone (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1005 | GAME( 1990, ddrago3p, ddragon3, ddragon3, ddragon3, 0, ROT0, "Technos", "Double Dragon 3 - The Rosetta Stone (prototype)", GAME_SUPPORTS_SAVE ) | |
| 825 | 1006 | GAME( 1990, ddrago3b, ddragon3, ddrago3b, ddrago3b, 0, ROT0, "bootleg", "Double Dragon 3 - The Rosetta Stone (bootleg)", GAME_SUPPORTS_SAVE ) |
| 826 | 1007 | GAME( 1990, ctribe, 0, ctribe, ctribe, 0, ROT0, "Technos", "The Combatribes (US)", GAME_SUPPORTS_SAVE ) |
| 827 | 1008 | GAME( 1990, ctribe1, ctribe, ctribe, ctribe, 0, ROT0, "Technos", "The Combatribes (US Set 1?)", GAME_SUPPORTS_SAVE ) |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m6502/m6502.h" | |
| 21 | 22 | #include "sprint2.h" |
| 22 | 23 | #include "sound/discrete.h" |
| 23 | 24 |
| r3957 | r3958 | |
|---|---|---|
| 489 | 489 | MDRV_CPU_ADD("audioslave", M6502, 2000000) |
| 490 | 490 | MDRV_CPU_PROGRAM_MAP(sound_slave_map,0) |
| 491 | 491 | |
| 492 | MDRV_ | |
| 492 | MDRV_QUANTUM_TIME | |
| 493 | 493 | |
| 494 | 494 | MDRV_MACHINE_RESET(exterm) |
| 495 | 495 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6800/m6800.h" | |
| 8 | 9 | #include "deprecat.h" |
| 9 | 10 | #include "dragrace.h" |
| 10 | 11 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | #include "cpu/z80/z80.h" | |
| 39 | 40 | #include "deprecat.h" |
| 40 | 41 | #include "sound/msm5205.h" |
| 41 | 42 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | */ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/i386/i386.h" | |
| 67 | 68 | #include "devconv.h" |
| 68 | #include "deprecat.h" | |
| 69 | 69 | #include "machine/8237dma.h" |
| 70 | 70 | #include "machine/pic8259.h" |
| 71 | 71 | #include "machine/pit8253.h" |
| r3957 | r3958 | |
| 75 | 75 | #include "machine/8042kbdc.h" |
| 76 | 76 | #include "machine/pckeybrd.h" |
| 77 | 77 | #include "machine/idectrl.h" |
| 78 | #include "cpu/i386/i386.h" | |
| 79 | 78 | #include "sound/dmadac.h" |
| 80 | 79 | |
| 81 | 80 | #define SPEEDUP_HACKS 1 |
| r3957 | r3958 | |
| 792 | 791 | |
| 793 | 792 | static const struct dma8237_interface dma8237_1_config = |
| 794 | 793 | { |
| 795 | | |
| 794 | "main", | |
| 796 | 795 | 1.0e-6, // 1us |
| 797 | 796 | |
| 798 | 797 | pc_dma_read_byte, |
| r3957 | r3958 | |
| 806 | 805 | |
| 807 | 806 | static const struct dma8237_interface dma8237_2_config = |
| 808 | 807 | { |
| 809 | | |
| 808 | "main", | |
| 810 | 809 | 1.0e-6, // 1us |
| 811 | 810 | |
| 812 | 811 | NULL, |
| r3957 | r3958 | |
| 957 | 956 | cpu_set_irq_callback(machine->cpu[0], irq_callback); |
| 958 | 957 | |
| 959 | 958 | memcpy(bios_ram, rom, 0x40000); |
| 960 | c | |
| 959 | device | |
| 961 | 960 | |
| 962 | 961 | dacl = auto_malloc(65536 * sizeof(INT16)); |
| 963 | 962 | dacr = auto_malloc(65536 * sizeof(INT16)); |
| r3957 | r3958 | |
| 1074 | 1073 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0) |
| 1075 | 1074 | MACHINE_DRIVER_END |
| 1076 | 1075 | |
| 1077 | static void set_gate_a20(int a20) | |
| 1076 | static void set_gate_a20(running_machine *machine, int a20) | |
| 1078 | 1077 | { |
| 1079 | cpu_set_input_line( | |
| 1078 | cpu_set_input_line(machine->cpu[0], INPUT_LINE_A20, a20); | |
| 1080 | 1079 | } |
| 1081 | 1080 | |
| 1082 | static void keyboard_interrupt(int state) | |
| 1081 | static void keyboard_interrupt(running_machine *machine, int state) | |
| 1083 | 1082 | { |
| 1084 | 1083 | pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state); |
| 1085 | 1084 | } |
| r3957 | r3958 | |
| 1098 | 1097 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, mediagx_get_out2 |
| 1099 | 1098 | }; |
| 1100 | 1099 | |
| 1101 | static void mediagx_set_keyb_int(int state) { | |
| 1100 | static void mediagx_set_keyb_int(running_machine *machine, int state) { | |
| 1102 | 1101 | pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state); |
| 1103 | 1102 | } |
| 1104 | 1103 |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | ***************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "cpu/z80/z80.h" | |
| 37 | 38 | #include "sound/ay8910.h" |
| 38 | 39 | |
| 39 | 40 | |
| r3957 | r3958 | |
| 52 | 53 | |
| 53 | 54 | static WRITE8_HANDLER( flip_screen_w ) |
| 54 | 55 | { |
| 55 | flip_screen_set(data); | |
| 56 | flip_screen_set(space->machine, data); | |
| 56 | 57 | } |
| 57 | 58 | |
| 58 | 59 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m6800/m6800.h" | |
| 21 | 22 | #include "orbit.h" |
| 22 | 23 | #include "sound/discrete.h" |
| 23 | 24 |
| r3957 | r3958 | |
|---|---|---|
| 669 | 669 | */ |
| 670 | 670 | |
| 671 | 671 | #include "driver.h" |
| 672 | #include "cpu/z80/z80.h" | |
| 673 | #include "cpu/i386/i386.h" | |
| 672 | 674 | #include "machine/ds2404.h" |
| 673 | 675 | #include "machine/eeprom.h" |
| 674 | 676 | #include "machine/intelfsh.h" |
| r3957 | r3958 | |
| 1737 | 1739 | static MACHINE_DRIVER_START( spi ) |
| 1738 | 1740 | |
| 1739 | 1741 | /* basic machine hardware */ |
| 1740 | MDRV_CPU_ADD("main",I386, 50000000/2) /* Intel 386DX, 25MHz */ | |
| 1742 | MDRV_CPU_ADD("main", I386, 50000000/2) /* Intel 386DX, 25MHz */ | |
| 1741 | 1743 | MDRV_CPU_PROGRAM_MAP(spi_map, 0) |
| 1742 | 1744 | MDRV_CPU_VBLANK_INT("main", spi_interrupt) |
| 1743 | 1745 | |
| 1744 | 1746 | MDRV_CPU_ADD("sound", Z80, 28636360/4) |
| 1745 | 1747 | MDRV_CPU_PROGRAM_MAP(spisound_map, 0) |
| 1746 | 1748 | |
| 1747 | MDRV_ | |
| 1749 | MDRV_QUANTUM_TIME | |
| 1748 | 1750 | |
| 1749 | 1751 | MDRV_MACHINE_RESET(spi) |
| 1750 | 1752 | MDRV_NVRAM_HANDLER(spi) |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | ***************************************************************************/ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "cpu/tms32010/tms32010.h" | |
| 28 | 29 | #include "cpu/tms34010/tms34010.h" |
| 29 | 30 | #include "cpu/tms32025/tms32025.h" |
| 30 | 31 | #include "video/tlc34076.h" |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | */ |
| 40 | 40 | |
| 41 | 41 | #include "driver.h" |
| 42 | #include "cpu/m68000/m68000.h" | |
| 42 | 43 | #include "sound/okim6295.h" |
| 43 | 44 | |
| 44 | 45 | static tilemap *bg_tilemap, *mlow_tilemap, *mhigh_tilemap, *tx_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | static WRITE8_HANDLER( flip_screen_w ) |
| 129 | 129 | { |
| 130 | flip_screen_set(data); | |
| 130 | flip_screen_set(space->machine, data); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static WRITE8_HANDLER( adpcm_w ) |
| r3957 | r3958 | |
| 135 | 135 | sp0256_ALD_w(space, 0, data); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | static void lrq_callback(int state) | |
| 138 | static void lrq_callback(const device_config *device, int state) | |
| 139 | 139 | { |
| 140 | //cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); | |
| 141 | cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, state); | |
| 140 | //cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); | |
| 141 | cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, state); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static ADDRESS_MAP_START( sauro_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r3957 | r3958 | |
|---|---|---|
| 150 | 150 | ***************************************************************************/ |
| 151 | 151 | |
| 152 | 152 | #include "driver.h" |
| 153 | #include "cpu/m6809/m6809.h" | |
| 153 | 154 | #include "machine/namcoio.h" |
| 154 | 155 | #include "sound/namco.h" |
| 155 | 156 | #include "sound/samples.h" |
| r3957 | r3958 | |
| 255 | 256 | static WRITE8_HANDLER( gaplus_irq_1_ctrl_w ) |
| 256 | 257 | { |
| 257 | 258 | int bit = !BIT(offset,11); |
| 258 | cpu_interrupt_enable(0,bit); | |
| 259 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 259 | 260 | if (!bit) |
| 260 | 261 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 261 | 262 | } |
| r3957 | r3958 | |
| 263 | 264 | static WRITE8_HANDLER( gaplus_irq_3_ctrl_w ) |
| 264 | 265 | { |
| 265 | 266 | int bit = !BIT(offset,13); |
| 266 | cpu_interrupt_enable(2,bit); | |
| 267 | cpu_interrupt_enable(space->machine->cpu[2],bit); | |
| 267 | 268 | if (!bit) |
| 268 | 269 | cpu_set_input_line(space->machine->cpu[2], 0, CLEAR_LINE); |
| 269 | 270 | } |
| r3957 | r3958 | |
| 271 | 272 | static WRITE8_HANDLER( gaplus_irq_2_ctrl_w ) |
| 272 | 273 | { |
| 273 | 274 | int bit = offset & 1; |
| 274 | cpu_interrupt_enable(1,bit); | |
| 275 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 275 | 276 | if (!bit) |
| 276 | 277 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 277 | 278 | } |
| r3957 | r3958 | |
| 295 | 296 | static MACHINE_RESET( gaplus ) |
| 296 | 297 | { |
| 297 | 298 | /* on reset, VINTON is reset, while the other flags don't seem to be affected */ |
| 298 | cpu_interrupt_enable(1,0); | |
| 299 | cpu_interrupt_enable(machine->cpu[1],0); | |
| 299 | 300 | cpu_set_input_line(machine->cpu[1], 0, CLEAR_LINE); |
| 300 | 301 | } |
| 301 | 302 | |
| r3957 | r3958 | |
| 552 | 553 | MDRV_CPU_PROGRAM_MAP(readmem_cpu3,writemem_cpu3) |
| 553 | 554 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 554 | 555 | |
| 555 | MDRV_ | |
| 556 | MDRV_QUANTUM_TIME | |
| 556 | 557 | MDRV_MACHINE_RESET(gaplus) |
| 557 | 558 | |
| 558 | 559 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ****************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/m6502/m6502.h" | |
| 20 | 21 | #include "machine/6821pia.h" |
| 21 | 22 | #include "carpolo.h" |
| 22 | 23 |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | *****************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "sound/msm5205.h" |
| 13 | 14 | #include "sound/sn76496.h" |
| 14 | 15 | |
| r3957 | r3958 | |
| 23 | 24 | |
| 24 | 25 | WRITE8_HANDLER( drmicro_videoram_w ); |
| 25 | 26 | |
| 26 | extern void drmicro_flip_w( int flip ); | |
| 27 | extern void drmicro_flip_w( running_machine *machine, int flip ); | |
| 27 | 28 | |
| 28 | 29 | /****************************************************************************/ |
| 29 | 30 | |
| r3957 | r3958 | |
| 38 | 39 | static WRITE8_HANDLER( nmi_enable_w ) |
| 39 | 40 | { // bit2,3 unknown |
| 40 | 41 | drmicro_nmi_enable = data & 1; |
| 41 | drmicro_flip_w(data & 2); | |
| 42 | drmicro_flip_w(space->machine, data & 2); | |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | /****************************************************************************/ |
| r3957 | r3958 | |
| 224 | 225 | MDRV_CPU_IO_MAP(io_map,0) |
| 225 | 226 | MDRV_CPU_VBLANK_INT("main", drmicro_interrupt) |
| 226 | 227 | |
| 227 | MDRV_ | |
| 228 | MDRV_QUANTUM_TIME | |
| 228 | 229 | |
| 229 | 230 | /* video hardware */ |
| 230 | 231 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 75 | 75 | *****************************************************************************************/ |
| 76 | 76 | |
| 77 | 77 | #include "driver.h" |
| 78 | #include "cpu/z80/z80.h" | |
| 78 | 79 | #include "sound/ay8910.h" |
| 79 | 80 | |
| 80 | 81 | static UINT8 mux_data; |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/z80/z80.h" | |
| 38 | 39 | #include "machine/8255ppi.h" |
| 39 | 40 | #include "sound/ay8910.h" |
| 40 | 41 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | */ |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "cpu/nec/nec.h" | |
| 52 | 53 | #include "sound/ay8910.h" |
| 53 | 54 | |
| 54 | 55 | static UINT16 *twins_videoram; |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/i86/i86.h" | |
| 12 | 13 | |
| 13 | 14 | static int crtindex; |
| 14 | 15 | static int crtdata[256]; |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "sound/okim6295.h" |
| 13 | 14 | |
| 14 | 15 | #define MCLK 16000000 |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | ***************************************************************************/ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "cpu/z80/z80.h" | |
| 29 | #include "cpu/m68000/m68000.h" | |
| 28 | 30 | #include "machine/nmk112.h" |
| 29 | 31 | #include "sound/okim6295.h" |
| 30 | 32 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | ******************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 37 | #include "cpu/m68000/m68000.h" | |
| 36 | 38 | #include "machine/m68kfmly.h" |
| 37 | 39 | #include "machine/z80ctc.h" |
| 38 | 40 | #include "nb1413m3.h" |
| r3957 | r3958 | |
| 172 | 174 | |
| 173 | 175 | static z80ctc_interface ctc_intf = |
| 174 | 176 | { |
| 175 | "audio", /* clock from the audio CPU */ | |
| 176 | 0, /* clock */ | |
| 177 | 177 | 0, /* timer disables */ |
| 178 | 178 | ctc0_interrupt, /* interrupt handler */ |
| 179 | 179 | z80ctc_trg3_w, /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */ |
| r3957 | r3958 | |
| 859 | 859 | MDRV_CPU_PROGRAM_MAP(sound_readmem, sound_writemem) |
| 860 | 860 | MDRV_CPU_IO_MAP(sound_io_map,0) |
| 861 | 861 | |
| 862 | MDRV_Z80CTC_ADD("ctc", ctc_intf) | |
| 862 | MDRV_Z80CTC_ADD("ctc", 8000000/1 /* same as "audio" */, ctc_intf) | |
| 863 | 863 | |
| 864 | 864 | MDRV_MACHINE_RESET(niyanpai) |
| 865 | 865 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/z80/z80.h" | |
| 13 | 14 | #include "deprecat.h" |
| 14 | 15 | #include "sound/ay8910.h" |
| 15 | 16 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
|---|---|---|
| 349 | 349 | MDRV_CPU_ADD("main", M6502, JEDI_MAIN_CPU_CLOCK) |
| 350 | 350 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 351 | 351 | |
| 352 | MDRV_ | |
| 352 | MDRV_QUANTUM_TIME | |
| 353 | 353 | |
| 354 | 354 | MDRV_MACHINE_START(jedi) |
| 355 | 355 | MDRV_MACHINE_RESET(jedi) |
| r3957 | r3958 | |
|---|---|---|
| 2220 | 2220 | |
| 2221 | 2221 | static MACHINE_DRIVER_START( scorpion2_vid ) |
| 2222 | 2222 | MDRV_MACHINE_RESET( init ) // main scorpion2 board initialisation |
| 2223 | MDRV_ | |
| 2223 | MDRV_QUANTUM_TIME | |
| 2224 | 2224 | MDRV_CPU_ADD("main", M6809, MASTER_CLOCK/4 ) // 6809 CPU at 2 Mhz |
| 2225 | 2225 | MDRV_CPU_PROGRAM_MAP(memmap_vid,0) // setup scorpion2 board memorymap |
| 2226 | 2226 | MDRV_CPU_PERIODIC_INT(timer_irq, 1000) // generate 1000 IRQ's per second |
| r3957 | r3958 | |
|---|---|---|
| 1017 | 1017 | static void init_skns(running_machine *machine) |
| 1018 | 1018 | { |
| 1019 | 1019 | // init DRC to fastest options |
| 1020 | c | |
| 1020 | device | |
| 1021 | 1021 | |
| 1022 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 1023 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6f8); | |
| 1022 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 1023 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6f8); | |
| 1024 | 1024 | memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000028, 0x600002b, 0, 0, bios_skip_r ); |
| 1025 | 1025 | } |
| 1026 | 1026 | |
| 1027 | 1027 | static void set_drc_pcflush(running_machine *machine, UINT32 addr) |
| 1028 | 1028 | { |
| 1029 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 1030 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, addr); | |
| 1029 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 1030 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, addr); | |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | static DRIVER_INIT( galpani4 ) { skns_sprite_kludge(-5,-1); init_skns(machine); } |
| r3957 | r3958 | |
|---|---|---|
| 407 | 407 | ***************************************************************************/ |
| 408 | 408 | |
| 409 | 409 | #include "driver.h" |
| 410 | #include "cpu/m68000/m68000.h" | |
| 410 | 411 | #include "deprecat.h" |
| 411 | 412 | #include "machine/tmp68301.h" |
| 412 | 413 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 190 | 190 | */ |
| 191 | 191 | |
| 192 | 192 | #include "driver.h" |
| 193 | #include "cpu/z80/z80.h" | |
| 193 | 194 | #include "sound/es8712.h" |
| 194 | 195 | #include "sound/2203intf.h" |
| 195 | 196 |
| r3957 | r3958 | |
|---|---|---|
| 290 | 290 | MDRV_CPU_ADD("audio", Z80,3579545) /* NEC D780C-1, 3.579545 MHz */ |
| 291 | 291 | MDRV_CPU_PROGRAM_MAP(flkatck_readmem_sound,flkatck_writemem_sound) |
| 292 | 292 | |
| 293 | MDRV_ | |
| 293 | MDRV_QUANTUM_TIME | |
| 294 | 294 | |
| 295 | 295 | MDRV_MACHINE_RESET(flkatck) |
| 296 | 296 |
| r3957 | r3958 | |
|---|---|---|
| 71 | 71 | *********************************************************************************************************************/ |
| 72 | 72 | |
| 73 | 73 | #include "driver.h" |
| 74 | #include "cpu/z80/z80.h" | |
| 74 | 75 | #include "deprecat.h" |
| 75 | 76 | #include "includes/dynax.h" |
| 76 | 77 | #include "cpu/tlcs90/tlcs90.h" |
| r3957 | r3958 | |
| 3864 | 3865 | MDRV_SCREEN_VISIBLE_AREA(0, 336-1, 8, 256-1-8-1) |
| 3865 | 3866 | |
| 3866 | 3867 | /* devices */ |
| 3867 | MDRV_ | |
| 3868 | MDRV_MSM6242_ADD("rtc" | |
| 3868 | 3869 | MACHINE_DRIVER_END |
| 3869 | 3870 | |
| 3870 | 3871 | |
| r3957 | r3958 | |
| 3975 | 3976 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3976 | 3977 | |
| 3977 | 3978 | /* devices */ |
| 3978 | MDRV_ | |
| 3979 | MDRV_MSM6242_ADD("rtc" | |
| 3979 | 3980 | MACHINE_DRIVER_END |
| 3980 | 3981 | |
| 3981 | 3982 | |
| r3957 | r3958 | |
| 4122 | 4123 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4123 | 4124 | |
| 4124 | 4125 | /* devices */ |
| 4125 | MDRV_ | |
| 4126 | MDRV_MSM6242_ADD("rtc" | |
| 4126 | 4127 | MACHINE_DRIVER_END |
| 4127 | 4128 | |
| 4128 | 4129 | |
| r3957 | r3958 | |
| 4183 | 4184 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4184 | 4185 | |
| 4185 | 4186 | /* devices */ |
| 4186 | MDRV_ | |
| 4187 | MDRV_MSM6242_ADD("rtc" | |
| 4187 | 4188 | MACHINE_DRIVER_END |
| 4188 | 4189 | |
| 4189 | 4190 | static MACHINE_DRIVER_START( majrjhdx ) |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | static WRITE8_HANDLER( shootout_flipscreen_w ) |
| 68 | 68 | { |
| 69 | flip_screen_set(data & 0x01); | |
| 69 | flip_screen_set(space->machine, data & 0x01); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static WRITE8_HANDLER( shootout_coin_counter_w ) |
| r3957 | r3958 | |
|---|---|---|
| 256 | 256 | MDRV_CPU_ADD("audio", M6809, 2000000) |
| 257 | 257 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 258 | 258 | |
| 259 | MDRV_ | |
| 259 | MDRV_QUANTUM_TIME | |
| 260 | 260 | |
| 261 | 261 | /* video hardware */ |
| 262 | 262 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/m68000/m68000.h" | |
| 12 | 13 | #include "deprecat.h" |
| 13 | 14 | #include "cpu/mips/psx.h" |
| 14 | 15 | #include "cpu/z80/z80.h" |
| r3957 | r3958 | |
| 190 | 191 | return m_n_znsecsel; |
| 191 | 192 | } |
| 192 | 193 | |
| 193 | static void sio_znsec0_handler( int n_data ) | |
| 194 | static void sio_znsec0_handler( running_machine *machine, int n_data ) | |
| 194 | 195 | { |
| 195 | 196 | if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 ) |
| 196 | 197 | { |
| 197 | 198 | if( m_b_lastclock ) |
| 198 | 199 | { |
| 199 | psx_sio_input( | |
| 200 | psx_sio_input( machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 0, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA ); | |
| 200 | 201 | } |
| 201 | 202 | m_b_lastclock = 0; |
| 202 | 203 | } |
| r3957 | r3958 | |
| 206 | 207 | } |
| 207 | 208 | } |
| 208 | 209 | |
| 209 | static void sio_znsec1_handler( int n_data ) | |
| 210 | static void sio_znsec1_handler( running_machine *machine, int n_data ) | |
| 210 | 211 | { |
| 211 | 212 | if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 ) |
| 212 | 213 | { |
| 213 | 214 | if( m_b_lastclock ) |
| 214 | 215 | { |
| 215 | psx_sio_input( | |
| 216 | psx_sio_input( machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 1, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA ); | |
| 216 | 217 | } |
| 217 | 218 | m_b_lastclock = 0; |
| 218 | 219 | } |
| r3957 | r3958 | |
| 222 | 223 | } |
| 223 | 224 | } |
| 224 | 225 | |
| 225 | static void sio_pad_handler( int n_data ) | |
| 226 | static void sio_pad_handler( running_machine *machine, int n_data ) | |
| 226 | 227 | { |
| 227 | running_machine *machine = Machine; | |
| 228 | ||
| 229 | 228 | if( ( n_data & PSX_SIO_OUT_DTR ) != 0 ) |
| 230 | 229 | { |
| 231 | 230 | m_b_znsecport = 1; |
| r3957 | r3958 | |
| 239 | 238 | psx_sio_input( machine, 0, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR ); |
| 240 | 239 | } |
| 241 | 240 | |
| 242 | static void sio_dip_handler( int n_data ) | |
| 241 | static void sio_dip_handler( running_machine *machine, int n_data ) | |
| 243 | 242 | { |
| 244 | 243 | if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 ) |
| 245 | 244 | { |
| 246 | 245 | if( m_b_lastclock ) |
| 247 | 246 | { |
| 248 | running_machine *machine = Machine; | |
| 249 | 247 | int bit = ( ( input_port_read(machine, "DSW") >> m_n_dip_bit ) & 1 ); |
| 250 | 248 | verboselog( machine, 2, "read dip %02x -> %02x\n", n_data, bit * PSX_SIO_IN_DATA ); |
| 251 | 249 | psx_sio_input( machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA ); |
| r3957 | r3958 | |
| 439 | 437 | psx_machine_init(machine); |
| 440 | 438 | } |
| 441 | 439 | |
| 442 | static const at28c16_config at28c16_intf = | |
| 443 | { | |
| 444 | "at28c16", NULL | |
| 445 | }; | |
| 446 | ||
| 447 | 440 | static MACHINE_DRIVER_START( zn1_1mb_vram ) |
| 448 | 441 | /* basic machine hardware */ |
| 449 | 442 | MDRV_CPU_ADD( "main", PSXCPU, XTAL_67_7376MHz ) |
| r3957 | r3958 | |
| 472 | 465 | MDRV_SOUND_ROUTE(0, "left", 0.35) |
| 473 | 466 | MDRV_SOUND_ROUTE(1, "right", 0.35) |
| 474 | 467 | |
| 475 | MDRV_DEVICE_ADD( "at28c16", AT28C16 ) | |
| 476 | MDRV_DEVICE_CONFIG( at28c16_intf ) | |
| 468 | MDRV_AT28C16_ADD( "at28c16", NULL ) | |
| 477 | 469 | MACHINE_DRIVER_END |
| 478 | 470 | |
| 479 | 471 | static MACHINE_DRIVER_START( zn1_2mb_vram ) |
| r3957 | r3958 | |
| 511 | 503 | MDRV_SOUND_ROUTE(0, "left", 0.35) |
| 512 | 504 | MDRV_SOUND_ROUTE(1, "right", 0.35) |
| 513 | 505 | |
| 514 | MDRV_DEVICE_ADD( "at28c16", AT28C16 ) | |
| 515 | MDRV_DEVICE_CONFIG( at28c16_intf ) | |
| 506 | MDRV_AT28C16_ADD( "at28c16", NULL ) | |
| 516 | 507 | MACHINE_DRIVER_END |
| 517 | 508 | |
| 518 | 509 | /* |
| r3957 | r3958 | |
| 1599 | 1590 | } |
| 1600 | 1591 | } |
| 1601 | 1592 | |
| 1602 | static void atpsx_dma_read( UINT32 n_address, INT32 n_size ) | |
| 1593 | static void atpsx_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 1603 | 1594 | { |
| 1604 | const device_config *ide = device_list_find_by_tag( | |
| 1595 | const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"); | |
| 1605 | 1596 | |
| 1606 | 1597 | logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address); |
| 1607 | 1598 | |
| r3957 | r3958 | |
| 1622 | 1613 | } |
| 1623 | 1614 | } |
| 1624 | 1615 | |
| 1625 | static void atpsx_dma_write( UINT32 n_address, INT32 n_size ) | |
| 1616 | static void atpsx_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 1626 | 1617 | { |
| 1627 | 1618 | logerror("DMA write from %08x for %d bytes\n", n_address, n_size<<2); |
| 1628 | 1619 | } |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "cpu/z80/z80.h" | |
| 33 | 34 | #include "deprecat.h" |
| 34 | 35 | #include "paradise.h" |
| 35 | 36 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | ********************************************************************/ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 44 | #include "cpu/m68000/m68000.h" | |
| 43 | 45 | #include "taitoipt.h" |
| 44 | 46 | #include "video/taitoic.h" |
| 45 | 47 | #include "audio/taitosnd.h" |
| r3957 | r3958 | |
| 246 | 248 | MDRV_CPU_ADD("audio", Z80, 4000000) /* sound CPU, required to run the game */ |
| 247 | 249 | MDRV_CPU_PROGRAM_MAP(z80_map,0) |
| 248 | 250 | |
| 249 | MDRV_ | |
| 251 | MDRV_QUANTUM_TIME | |
| 250 | 252 | |
| 251 | 253 | /* video hardware */ |
| 252 | 254 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | ***************************************************************************/ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/z80/z80.h" | |
| 29 | 30 | #include "machine/8255ppi.h" |
| 30 | 31 | #include "dribling.h" |
| 31 | 32 |
| r3957 | r3958 | |
|---|---|---|
| 220 | 220 | ***************************************************************************/ |
| 221 | 221 | |
| 222 | 222 | #include "driver.h" |
| 223 | #include "cpu/z80/z80.h" | |
| 224 | #include "cpu/m6809/m6809.h" | |
| 225 | #include "cpu/m68000/m68000.h" | |
| 223 | 226 | #include "balsente.h" |
| 224 | 227 | #include "sound/cem3394.h" |
| 225 | 228 | |
| r3957 | r3958 | |
| 1191 | 1194 | MDRV_CPU_PROGRAM_MAP(cpu2_map,0) |
| 1192 | 1195 | MDRV_CPU_IO_MAP(cpu2_io_map,0) |
| 1193 | 1196 | |
| 1194 | MDRV_ | |
| 1197 | MDRV_QUANTUM_TIME | |
| 1195 | 1198 | |
| 1196 | 1199 | MDRV_MACHINE_RESET(balsente) |
| 1197 | 1200 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r3957 | r3958 | |
| 1244 | 1247 | MDRV_CPU_ADD("68k", M68000, 8000000) |
| 1245 | 1248 | MDRV_CPU_PROGRAM_MAP(shrike68k_map,0) |
| 1246 | 1249 | |
| 1247 | MDRV_ | |
| 1250 | MDRV_QUANTUM_TIME | |
| 1248 | 1251 | MACHINE_DRIVER_END |
| 1249 | 1252 | |
| 1250 | 1253 |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | #include "driver.h" |
| 69 | #include "cpu/z80/z80.h" | |
| 69 | 70 | #include "deprecat.h" |
| 70 | 71 | #include "sound/sn76496.h" |
| 71 | 72 | #include "sound/2612intf.h" |
| r3957 | r3958 | |
| 636 | 637 | ((megadrive_vdp_command_part2 & 0x0003) << 14); |
| 637 | 638 | } |
| 638 | 639 | |
| 639 | static UINT16 (*vdp_get_word_from_68k_mem)(UINT32 source); | |
| 640 | static UINT16 (*vdp_get_word_from_68k_mem)(running_machine *machine, UINT32 source); | |
| 640 | 641 | |
| 641 | static UINT16 vdp_get_word_from_68k_mem_default(UINT32 source) | |
| 642 | static UINT16 vdp_get_word_from_68k_mem_default(running_machine *machine, UINT32 source) | |
| 642 | 643 | { |
| 643 | 644 | if (( source >= 0x000000 ) && ( source <= 0x3fffff )) |
| 644 | 645 | { |
| 645 | UINT16 *rom = (UINT16*)memory_region( | |
| 646 | UINT16 *rom = (UINT16*)memory_region(machine, "main"); | |
| 646 | 647 | return rom[(source&0x3fffff)>>1]; |
| 647 | 648 | } |
| 648 | 649 | else if (( source >= 0xe00000 ) && ( source <= 0xffffff )) |
| r3957 | r3958 | |
| 654 | 655 | else |
| 655 | 656 | { |
| 656 | 657 | printf("DMA Read unmapped %06x\n",source); |
| 657 | return mame_rand( | |
| 658 | return mame_rand(machine); | |
| 658 | 659 | } |
| 659 | 660 | |
| 660 | 661 | } |
| r3957 | r3958 | |
| 712 | 713 | } |
| 713 | 714 | |
| 714 | 715 | /* Instant, but we pause the 68k a bit */ |
| 715 | static void megadrive_do_insta_68k_to_vram_dma(UINT32 source,int length) | |
| 716 | static void megadrive_do_insta_68k_to_vram_dma(running_machine *machine, UINT32 source,int length) | |
| 716 | 717 | { |
| 717 | 718 | int count; |
| 718 | 719 | |
| 719 | 720 | if (length==0x00) length = 0xffff; |
| 720 | 721 | |
| 721 | 722 | /* This is a hack until real DMA timings are implemented */ |
| 722 | cpu_spinuntil_time( | |
| 723 | cpu_spinuntil_time(machine->cpu[0], ATTOTIME_IN_NSEC(length*1000/3500)); | |
| 723 | 724 | |
| 724 | 725 | for (count = 0;count<(length>>1);count++) |
| 725 | 726 | { |
| 726 | vdp_vram_write(vdp_get_word_from_68k_mem(source)); | |
| 727 | vdp_vram_write(vdp_get_word_from_68k_mem(machine, source)); | |
| 727 | 728 | source+=2; |
| 728 | 729 | if (source>0xffffff) source = 0xe00000; |
| 729 | 730 | } |
| r3957 | r3958 | |
| 749 | 750 | { |
| 750 | 751 | //if (megadrive_vdp_address>=0x80) return; // abandon |
| 751 | 752 | |
| 752 | write_cram_value(machine, (megadrive_vdp_address&0x7e)>>1, vdp_get_word_from_68k_mem(source)); | |
| 753 | write_cram_value(machine, (megadrive_vdp_address&0x7e)>>1, vdp_get_word_from_68k_mem(machine, source)); | |
| 753 | 754 | source+=2; |
| 754 | 755 | |
| 755 | 756 | if (source>0xffffff) source = 0xfe0000; |
| r3957 | r3958 | |
| 767 | 768 | |
| 768 | 769 | } |
| 769 | 770 | |
| 770 | static void megadrive_do_insta_68k_to_vsram_dma(UINT32 source,UINT16 length) | |
| 771 | static void megadrive_do_insta_68k_to_vsram_dma(running_machine *machine,UINT32 source,UINT16 length) | |
| 771 | 772 | { |
| 772 | 773 | int count; |
| 773 | 774 | |
| r3957 | r3958 | |
| 777 | 778 | { |
| 778 | 779 | if (megadrive_vdp_address>=0x80) return; // abandon |
| 779 | 780 | |
| 780 | megadrive_vdp_vsram[(megadrive_vdp_address&0x7e)>>1] = vdp_get_word_from_68k_mem(source); | |
| 781 | megadrive_vdp_vsram[(megadrive_vdp_address&0x7e)>>1] = vdp_get_word_from_68k_mem(machine, source); | |
| 781 | 782 | source+=2; |
| 782 | 783 | |
| 783 | 784 | if (source>0xffffff) source = 0xfe0000; |
| r3957 | r3958 | |
| 823 | 824 | |
| 824 | 825 | /* The 68k is frozen during this transfer, it should be safe to throw a few cycles away and do 'instant' DMA because the 68k can't detect it being in progress (can the z80?) */ |
| 825 | 826 | //mame_printf_debug("68k->VRAM DMA transfer source %06x length %04x dest %04x enabled %01x\n", source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE); |
| 826 | if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vram_dma(source,length); | |
| 827 | if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vram_dma(machine,source,length); | |
| 827 | 828 | |
| 828 | 829 | } |
| 829 | 830 | else if (MEGADRIVE_REG17_DMATYPE==0x2) |
| r3957 | r3958 | |
| 884 | 885 | |
| 885 | 886 | /* The 68k is frozen during this transfer, it should be safe to throw a few cycles away and do 'instant' DMA because the 68k can't detect it being in progress (can the z80?) */ |
| 886 | 887 | //mame_printf_debug("68k->VSRAM DMA transfer source %06x length %04x dest %04x enabled %01x\n", source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE); |
| 887 | if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vsram_dma(source,length); | |
| 888 | if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vsram_dma(machine,source,length); | |
| 888 | 889 | } |
| 889 | 890 | else if (MEGADRIVE_REG17_DMATYPE==0x2) |
| 890 | 891 | { |
| r3957 | r3958 | |
| 1922 | 1923 | } |
| 1923 | 1924 | |
| 1924 | 1925 | /* used by megatech bios, the test mode accesses the joypad/stick inputs like this */ |
| 1925 | UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl) | |
| 1926 | UINT8 megatech_bios_port_cc_dc_r(running_machine *machine, int offset, int ctrl) | |
| 1926 | 1927 | { |
| 1927 | running_machine *machine = Machine; | |
| 1928 | 1928 | UINT8 retdata; |
| 1929 | 1929 | |
| 1930 | 1930 | if (ctrl==0x55) |
| r3957 | r3958 | |
| 3887 | 3887 | |
| 3888 | 3888 | |
| 3889 | 3889 | /* DMA read function for SVP */ |
| 3890 | static UINT16 vdp_get_word_from_68k_mem_svp(UINT32 source) | |
| 3890 | static UINT16 vdp_get_word_from_68k_mem_svp(running_machine *machine, UINT32 source) | |
| 3891 | 3891 | { |
| 3892 | 3892 | if ((source & 0xe00000) == 0x000000) |
| 3893 | 3893 | { |
| 3894 | UINT16 *rom = (UINT16*)memory_region( | |
| 3894 | UINT16 *rom = (UINT16*)memory_region(machine, "main"); | |
| 3895 | 3895 | source -= 2; // DMA latency |
| 3896 | 3896 | return rom[source >> 1]; |
| 3897 | 3897 | } |
| r3957 | r3958 | |
| 3909 | 3909 | else |
| 3910 | 3910 | { |
| 3911 | 3911 | mame_printf_debug("DMA Read unmapped %06x\n",source); |
| 3912 | return mame_rand( | |
| 3912 | return mame_rand(machine); | |
| 3913 | 3913 | } |
| 3914 | 3914 | } |
| 3915 | 3915 | |
| r3957 | r3958 | |
| 6375 | 6375 | // |
| 6376 | 6376 | // boosting the interleave here actually makes Kolibri run incorrectly however, that |
| 6377 | 6377 | // one works best just boosting the interleave on communications?! |
| 6378 | MDRV_ | |
| 6378 | MDRV_QUANTUM_TIME | |
| 6379 | 6379 | MACHINE_DRIVER_END |
| 6380 | 6380 | |
| 6381 | 6381 | |
| r3957 | r3958 | |
| 6492 | 6492 | |
| 6493 | 6493 | vdp_get_word_from_68k_mem = vdp_get_word_from_68k_mem_default; |
| 6494 | 6494 | |
| 6495 | c | |
| 6495 | device | |
| 6496 | 6496 | |
| 6497 | 6497 | if ((machine->gamedrv->ipt==ipt_megadri6) || (machine->gamedrv->ipt==ipt_ssf2ghw)) |
| 6498 | 6498 | { |
| r3957 | r3958 | |
| 6706 | 6706 | _32x_240mode = 0; |
| 6707 | 6707 | |
| 6708 | 6708 | // checking if these help brutal, they don't. |
| 6709 | cpu_set_info_int(machine->cpu[2], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); | |
| 6710 | cpu_set_info_int(machine->cpu[3], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); | |
| 6709 | device_set_info_int(machine->cpu[2], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); | |
| 6710 | device_set_info_int(machine->cpu[3], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); | |
| 6711 | 6711 | |
| 6712 | 6712 | DRIVER_INIT_CALL(megadriv); |
| 6713 | 6713 | } |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | */ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/m68000/m68000.h" | |
| 67 | 68 | #include "deprecat.h" |
| 68 | 69 | #include "sound/ymz280b.h" |
| 69 | 70 | #include "includes/suprnova.h" |
| r3957 | r3958 | |
|---|---|---|
| 293 | 293 | ****************************************************************************/ |
| 294 | 294 | |
| 295 | 295 | #include "driver.h" |
| 296 | #include "cpu/tms32031/tms32031.h" | |
| 297 | #include "cpu/m6800/m6800.h" | |
| 296 | 298 | #include "deprecat.h" |
| 297 | 299 | #include "cpu/m6809/m6809.h" |
| 298 | 300 | #include "cpu/m68000/m68000.h" |
| r3957 | r3958 | |
| 1745 | 1747 | // MDRV_CPU_ADD("comm", M6803, 8000000/4) -- network CPU |
| 1746 | 1748 | |
| 1747 | 1749 | MDRV_MACHINE_RESET(drivedge) |
| 1748 | MDRV_ | |
| 1750 | MDRV_QUANTUM_TIME | |
| 1749 | 1751 | MACHINE_DRIVER_END |
| 1750 | 1752 | |
| 1751 | 1753 | |
| r3957 | r3958 | |
| 1773 | 1775 | /* basic machine hardware */ |
| 1774 | 1776 | MDRV_IMPORT_FROM(sftm) |
| 1775 | 1777 | |
| 1776 | MDRV_ | |
| 1778 | MDRV_M48T02_ADD( "m48t02" | |
| 1777 | 1779 | MACHINE_DRIVER_END |
| 1778 | 1780 | |
| 1779 | 1781 |
| r3957 | r3958 | |
|---|---|---|
| 385 | 385 | MDRV_CPU_PROGRAM_MAP(sub_cpu_map,0) |
| 386 | 386 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 387 | 387 | |
| 388 | MDRV_ | |
| 388 | MDRV_QUANTUM_TIME | |
| 389 | 389 | /* synchronization of the CPUs */ |
| 390 | 390 | |
| 391 | 391 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | extern UINT16* megadriv_backupram; |
| 22 | 22 | extern int megadriv_backupram_length; |
| 23 | 23 | extern UINT16* megadrive_ram; |
| 24 | extern UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl); | |
| 24 | extern UINT8 megatech_bios_port_cc_dc_r(running_machine *machine, int offset, int ctrl); | |
| 25 | 25 | extern void megadriv_stop_scanline_timer(void); |
| 26 | 26 | |
| 27 | 27 | void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine); |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "cpu/z80/z80.h" | |
| 9 | 10 | #include "sound/ay8910.h" |
| 10 | 11 | #include "includes/chaknpop.h" |
| 11 | 12 |
| r3957 | r3958 | |
|---|---|---|
| 82 | 82 | */ |
| 83 | 83 | |
| 84 | 84 | #include "driver.h" |
| 85 | #include "cpu/m68000/m68000.h" | |
| 85 | 86 | #include "cpu/upd7810/upd7810.h" |
| 86 | 87 | #include "sound/okim6295.h" |
| 87 | 88 | #include "includes/fitfight.h" |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/z80/z80.h" | |
| 8 | 9 | #include "sspeedr.lh" |
| 9 | 10 | #include "includes/sspeedr.h" |
| 10 | 11 |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | ******************************************************************************************/ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/i86/i86.h" | |
| 67 | 68 | #include "video/generic.h" |
| 68 | 69 | #include "machine/pit8253.h" |
| 69 | 70 | #include "machine/8255ppi.h" |
| r3957 | r3958 | |
| 613 | 614 | |
| 614 | 615 | static const struct dma8237_interface dma8237_1_config = |
| 615 | 616 | { |
| 616 | | |
| 617 | "main", | |
| 617 | 618 | 1.0e-6, // 1us |
| 618 | 619 | |
| 619 | 620 | pc_dma_read_byte, |
| r3957 | r3958 | |
|---|---|---|
| 73 | 73 | *************************************************************************/ |
| 74 | 74 | |
| 75 | 75 | #include "driver.h" |
| 76 | #include "cpu/z80/z80.h" | |
| 77 | #include "cpu/m68000/m68000.h" | |
| 76 | 78 | #include "sound/2203intf.h" |
| 77 | 79 | #include "sound/msm5205.h" |
| 78 | 80 |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | */ |
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | #include "cpu/m68000/m68000.h" | |
| 84 | 85 | #include "deprecat.h" |
| 85 | 86 | #include "cpu/z80/z80.h" |
| 86 | 87 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 995 | 996 | ROM_LOAD( "1-n.bin", 0x10000, 0x8000, CRC(e300747a) SHA1(5875a46c215b12f1e9a889819215bca40e4459a6) ) |
| 996 | 997 | ROM_LOAD( "1-o.bin", 0x18000, 0x8000, CRC(cddc6a6c) SHA1(28d12342e0ada941f68845fa65793a3f5fa21246) ) // Booby Kids gfx hack changes these 2 roms ONLY |
| 997 | 998 | |
| 998 | ROM_REGION( 0x | |
| 999 | ROM_REGION( 0x400, "proms", 0 ) | |
| 999 | 1000 | ROM_LOAD( "kid_prom.10f", 0x000, 0x100, CRC(ca13ce23) SHA1(46f0ed22f601721fa35bab12ce8816f30b102f59) ) /* red */ |
| 1000 | 1001 | ROM_LOAD( "kid_prom.11f", 0x100, 0x100, CRC(fb44285a) SHA1(f9605e82f63188daeff044fd48d81c1dfc4d4f2a) ) /* green */ |
| 1001 | 1002 | ROM_LOAD( "kid_prom.12f", 0x200, 0x100, CRC(40d41237) SHA1(b33082540d739a3bfe096f68f3359fbf1360b5be) ) /* blue */ |
| 1002 | 1003 | ROM_LOAD( "kid_prom.2g", 0x300, 0x100, CRC(4b9be0ed) SHA1(81aa7bb24fe6ea13f5dffdb67ea699adf0b3129a) ) /* clut */ |
| 1003 | ROM_LOAD( "kid_prom.4e", 0x400, 0x100, CRC(e4fb54ee) SHA1(aba89d347b24dc6680e6f25b4a6c0d6657bb6a83) ) /* ctable */ | |
| 1004 | 1004 | |
| 1005 | 1005 | ROM_REGION( 0x0100, "user1", 0 ) |
| 1006 | ROM_LOAD( "kid_prom.4e", 0x000, 0x100, NO_DUMP ) /* ctable */ | |
| 1006 | ROM_LOAD( "kid_prom.4e", 0x000, 0x100, NO_DUMP CRC(e4fb54ee) SHA1(aba89d347b24dc6680e6f25b4a6c0d6657bb6a83) ) /* ctable */ | |
| 1007 | 1007 | ROM_END |
| 1008 | 1008 | |
| 1009 | 1009 | static DRIVER_INIT( amazon ) |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/z80/z80.h" | |
| 16 | 17 | #include "machine/8255ppi.h" |
| 17 | 18 | #include "machine/ticket.h" |
| 18 | 19 | #include "sound/dac.h" |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | *******************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/z80/z80.h" | |
| 16 | 17 | #include "deprecat.h" |
| 17 | 18 | #include "sound/ay8910.h" |
| 18 | 19 |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | *************************************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/nec/nec.h" | |
| 26 | #include "cpu/i86/i86.h" | |
| 25 | 27 | #include "fashion.lh" |
| 26 | 28 | |
| 27 | 29 | static UINT16 *blit_ram; |
| r3957 | r3958 | |
|---|---|---|
| 773 | 773 | MDRV_CPU_PROGRAM_MAP(cbombers_cpub_map, 0) |
| 774 | 774 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold) |
| 775 | 775 | |
| 776 | MDRV_ | |
| 776 | MDRV_QUANTUM_TIME | |
| 777 | 777 | |
| 778 | 778 | MDRV_MACHINE_RESET(undrfire) |
| 779 | 779 | MDRV_NVRAM_HANDLER(undrfire) |
| r3957 | r3958 | |
|---|---|---|
| 224 | 224 | ***************************************************************************/ |
| 225 | 225 | |
| 226 | 226 | #include "driver.h" |
| 227 | #include "cpu/z80/z80.h" | |
| 227 | 228 | #include "deprecat.h" |
| 228 | 229 | #include "cpu/arm/arm.h" |
| 229 | 230 | #include "cpu/h6280/h6280.h" |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/m6805/m6805.h" | |
| 14 | #include "cpu/m68000/m68000.h" | |
| 13 | 15 | #include "video/vector.h" |
| 14 | 16 | #include "vertigo.h" |
| 15 | 17 | #include "exidy440.h" |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | **************************************************************************/ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "cpu/tms32031/tms32031.h" | |
| 28 | 29 | #include "cpu/tms34010/tms34010.h" |
| 29 | 30 | #include "cpu/adsp2100/adsp2100.h" |
| 30 | 31 | #include "includes/midzeus.h" |
| r3957 | r3958 | |
| 93 | 94 | { |
| 94 | 95 | memcpy(ram_base, memory_region(machine, "user1"), 0x40000*4); |
| 95 | 96 | *ram_base <<= 1; |
| 96 | c | |
| 97 | device | |
| 97 | 98 | |
| 98 | 99 | cmos_protected = TRUE; |
| 99 | 100 | } |
| r3957 | r3958 | |
| 1150 | 1151 | /* sound hardware */ |
| 1151 | 1152 | MDRV_IMPORT_FROM(dcs2_audio_2104) |
| 1152 | 1153 | |
| 1153 | MDRV_ | |
| 1154 | MDRV_M48T35_ADD( "m48t35" | |
| 1154 | 1155 | MACHINE_DRIVER_END |
| 1155 | 1156 | |
| 1156 | 1157 |
| r3957 | r3958 | |
|---|---|---|
| 692 | 692 | |
| 693 | 693 | MDRV_MACHINE_RESET(grchamp) |
| 694 | 694 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 695 | MDRV_ | |
| 695 | MDRV_QUANTUM_TIME | |
| 696 | 696 | |
| 697 | 697 | /* video hardware */ |
| 698 | 698 | MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | #include "driver.h" |
| 90 | #include "cpu/z80/z80.h" | |
| 90 | 91 | #include "deprecat.h" |
| 91 | 92 | #include "sound/2203intf.h" |
| 92 | 93 | #include "includes/argus.h" |
| r3957 | r3958 | |
| 524 | 525 | MDRV_CPU_IO_MAP(sound_portmap_2,0) |
| 525 | 526 | #endif |
| 526 | 527 | |
| 527 | MDRV_ | |
| 528 | MDRV_QUANTUM_TIME | |
| 528 | 529 | |
| 529 | 530 | /* video hardware */ |
| 530 | 531 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 578 | 579 | MDRV_CPU_PROGRAM_MAP(sound_map_a,0) |
| 579 | 580 | MDRV_CPU_IO_MAP(sound_portmap_2,0) |
| 580 | 581 | |
| 581 | MDRV_ | |
| 582 | MDRV_QUANTUM_TIME | |
| 582 | 583 | |
| 583 | 584 | /* video hardware */ |
| 584 | 585 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 623 | 624 | MDRV_CPU_PROGRAM_MAP(sound_map_b,0) |
| 624 | 625 | MDRV_CPU_IO_MAP(sound_portmap_2,0) |
| 625 | 626 | |
| 626 | MDRV_ | |
| 627 | MDRV_QUANTUM_TIME | |
| 627 | 628 | |
| 628 | 629 | /* video hardware */ |
| 629 | 630 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/z80/z80.h" | |
| 24 | 25 | #include "render.h" |
| 25 | 26 | #include "sound/sn76496.h" |
| 26 | 27 | #include "sound/custom.h" |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | *******************************************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/nec/nec.h" | |
| 55 | 56 | #include "deprecat.h" |
| 56 | 57 | #include "audio/seibu.h" |
| 57 | 58 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | *******************************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/m68000/m68000.h" | |
| 23 | 24 | #include "sound/okim6295.h" |
| 24 | 25 | |
| 25 | 26 | /* Video Handling */ |
| r3957 | r3958 | |
|---|---|---|
| 305 | 305 | ***************************************************************************/ |
| 306 | 306 | |
| 307 | 307 | #include "driver.h" |
| 308 | #include "cpu/z80/z80.h" | |
| 308 | 309 | #include "machine/segacrpt.h" |
| 309 | 310 | #include "machine/8255ppi.h" |
| 310 | 311 | #include "audio/segasnd.h" |
| r3957 | r3958 | |
| 398 | 399 | static MACHINE_RESET( razmataz ) |
| 399 | 400 | { |
| 400 | 401 | /* the timer value is unknown, but this seems to work well */ |
| 401 | sega_usb_reset(0x10); | |
| 402 | sega_usb_reset(machine, 0x10); | |
| 402 | 403 | } |
| 403 | 404 | |
| 404 | 405 |
| r3957 | r3958 | |
|---|---|---|
| 399 | 399 | |
| 400 | 400 | MDRV_MACHINE_RESET(chinhero) |
| 401 | 401 | |
| 402 | MDRV_ | |
| 402 | MDRV_QUANTUM_TIME | |
| 403 | 403 | |
| 404 | 404 | /* video hardware */ |
| 405 | 405 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 166 | 166 | */ |
| 167 | 167 | |
| 168 | 168 | #include "driver.h" |
| 169 | #include "cpu/rsp/rsp.h" | |
| 169 | 170 | #include "cpu/mips/mips3.h" |
| 170 | 171 | #include "streams.h" |
| 171 | 172 | #include "sound/custom.h" |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/z80/z80.h" | |
| 22 | #include "cpu/m6800/m6800.h" | |
| 21 | 23 | #include "machine/konami1.h" |
| 22 | 24 | #include "cpu/m6809/m6809.h" |
| 23 | 25 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | ***************************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "cpu/z80/z80.h" | |
| 9 | 10 | #include "deprecat.h" |
| 10 | 11 | #include "fastfred.h" |
| 11 | 12 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | #include "driver.h" |
| 50 | #include "cpu/m6502/m6502.h" | |
| 50 | 51 | #include "astrof.h" |
| 51 | 52 | |
| 52 | 53 |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | *******************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "cpu/m68000/m68000.h" | |
| 42 | #include "cpu/m6502/m6502.h" | |
| 41 | 43 | #include "sound/2203intf.h" |
| 42 | 44 | #include "sound/3812intf.h" |
| 43 | 45 |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | ***************************************************************************/ |
| 47 | 47 | |
| 48 | 48 | #include "driver.h" |
| 49 | #include "cpu/z80/z80.h" | |
| 49 | 50 | #include "deprecat.h" |
| 50 | 51 | #include "lwings.h" |
| 51 | 52 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 80 | 81 | int bank; |
| 81 | 82 | |
| 82 | 83 | /* bit 0 is flip screen */ |
| 83 | flip_screen_set(~data & 0x01); | |
| 84 | flip_screen_set(space->machine, ~data & 0x01); | |
| 84 | 85 | |
| 85 | 86 | /* bits 1 and 2 select ROM bank */ |
| 86 | 87 | RAM = memory_region(space->machine, "main"); |
| r3957 | r3958 | |
|---|---|---|
| 105 | 105 | ***************************************************************************/ |
| 106 | 106 | |
| 107 | 107 | #include "driver.h" |
| 108 | #include "cpu/z80/z80.h" | |
| 108 | 109 | #include "cpu/m6502/m6502.h" |
| 109 | 110 | #include "sound/vlm5030.h" |
| 110 | 111 | #include "sound/nes_apu.h" |
| r3957 | r3958 | |
|---|---|---|
| 545 | 545 | dcs_idma_cs = 0; |
| 546 | 546 | |
| 547 | 547 | /* set the fastest DRC options, but strict verification */ |
| 548 | c | |
| 548 | device | |
| 549 | 549 | |
| 550 | 550 | /* configure fast RAM regions for DRC */ |
| 551 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 552 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 553 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, ramsize - 1); | |
| 554 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); | |
| 555 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 551 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 552 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 553 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, ramsize - 1); | |
| 554 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); | |
| 555 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 556 | 556 | |
| 557 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 558 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 559 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 560 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 561 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 557 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 558 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 559 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 560 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 561 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 562 | 562 | |
| 563 | 563 | /* register for save states */ |
| 564 | 564 | state_save_register_global(machine, nile_irq_state); |
| r3957 | r3958 | |
| 2488 | 2488 | |
| 2489 | 2489 | static void add_speedup(running_machine *machine, offs_t pc, UINT32 op) |
| 2490 | 2490 | { |
| 2491 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); | |
| 2492 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); | |
| 2493 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); | |
| 2494 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); | |
| 2491 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); | |
| 2492 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); | |
| 2493 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); | |
| 2494 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); | |
| 2495 | 2495 | } |
| 2496 | 2496 | |
| 2497 | 2497 |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "cpu/i8085/i8085.h" | |
| 2 | 3 | #include "deprecat.h" |
| 3 | 4 | |
| 4 | 5 | extern UINT8 *kopunch_videoram2; |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/z80/z80.h" | |
| 17 | 18 | #include "news.h" |
| 18 | 19 | #include "sound/okim6295.h" |
| 19 | 20 |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | ***************************************************************************/ |
| 119 | 119 | |
| 120 | 120 | #include "driver.h" |
| 121 | #include "cpu/m68000/m68000.h" | |
| 121 | 122 | #include "deprecat.h" |
| 122 | 123 | #include "includes/kaneko16.h" |
| 123 | 124 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
| 966 | 967 | MDRV_IMPORT_FROM(galpanic) |
| 967 | 968 | |
| 968 | 969 | /* arm watchdog */ |
| 969 | MDRV_WATCHDOG_TIME_INIT( | |
| 970 | MDRV_WATCHDOG_TIME_INIT( | |
| 970 | 971 | MACHINE_DRIVER_END |
| 971 | 972 | |
| 972 | 973 | static MACHINE_DRIVER_START( comad ) |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | extern UINT8 *finalizr_scroll; |
| 19 | 19 | extern UINT8 *finalizr_videoram2,*finalizr_colorram2; |
| 20 | static UINT8 | |
| 20 | static UINT8 nmi_enable,i | |
| 21 | 21 | |
| 22 | ||
| 22 | 23 | static int finalizr_T1_line; |
| 23 | 24 | |
| 24 | 25 | PALETTE_INIT( finalizr ); |
| r3957 | r3958 | |
| 32 | 33 | { |
| 33 | 34 | if (cpu_getiloops(device) == 0) |
| 34 | 35 | { |
| 35 | if ( | |
| 36 | if ( | |
| 36 | 37 | cpu_set_input_line(device, M6809_IRQ_LINE, HOLD_LINE); |
| 37 | 38 | } |
| 38 | 39 | else if (cpu_getiloops(device) % 2) |
| 39 | 40 | { |
| 40 | if ( | |
| 41 | if ( | |
| 41 | 42 | cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); |
| 42 | 43 | } |
| 43 | 44 | } |
| r3957 | r3958 | |
| 48 | 49 | coin_counter_w(1,data & 0x02); |
| 49 | 50 | } |
| 50 | 51 | |
| 52 | static WRITE8_HANDLER( finalizr_flipscreen_w ) | |
| 53 | { | |
| 54 | nmi_enable = data & 0x01; | |
| 55 | irq_enable = data & 0x02; | |
| 56 | ||
| 57 | flip_screen_set(space->machine, ~data & 0x08); | |
| 58 | } | |
| 59 | ||
| 51 | 60 | static WRITE8_HANDLER( finalizr_i8039_irq_w ) |
| 52 | 61 | { |
| 53 | 62 | cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE); |
| r3957 | r3958 | |
| 77 | 86 | */ |
| 78 | 87 | |
| 79 | 88 | finalizr_T1_line++; |
| 80 | if ((finalizr_T1_line % 3) == 0) | |
| 81 | { | |
| 82 | if (finalizr_T1_line == 15) | |
| 83 | { | |
| 84 | finalizr_T1_line = -1; | |
| 85 | return 0; | |
| 86 | } | |
| 87 | return 1; | |
| 88 | } | |
| 89 | return 0; | |
| 89 | finalizr_T1_line %= 16; | |
| 90 | return (!(finalizr_T1_line % 3) && (finalizr_T1_line > 0)); | |
| 90 | 91 | } |
| 91 | 92 | |
| 92 | 93 | static WRITE8_HANDLER( i8039_T0_w ) |
| r3957 | r3958 | |
| 99 | 100 | */ |
| 100 | 101 | } |
| 101 | 102 | |
| 102 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 103 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 104 | AM_RANGE(0x0001, 0x0001) AM_WRITE(SMH_RAM) AM_BASE(&finalizr_scroll) | |
| 105 | AM_RANGE(0x0003, 0x0003) AM_WRITE(finalizr_videoctrl_w) | |
| 106 | AM_RANGE(0x0004, 0x0004) AM_WRITE(finalizr_flipscreen_w) | |
| 107 | // AM_RANGE(0x0020, 0x003f) AM_WRITE(SMH_RAM) AM_BASE(&finalizr_scroll) | |
| 103 | 108 | AM_RANGE(0x0800, 0x0800) AM_READ_PORT("DSW3") |
| 104 | 109 | AM_RANGE(0x0808, 0x0808) AM_READ_PORT("DSW2") |
| 105 | 110 | AM_RANGE(0x0810, 0x0810) AM_READ_PORT("SYSTEM") |
| 106 | 111 | AM_RANGE(0x0811, 0x0811) AM_READ_PORT("P1") |
| 107 | 112 | AM_RANGE(0x0812, 0x0812) AM_READ_PORT("P2") |
| 108 | 113 | AM_RANGE(0x0813, 0x0813) AM_READ_PORT("DSW1") |
| 109 | AM_RANGE(0x2000, 0x2fff) AM_READ(SMH_RAM) | |
| 110 | AM_RANGE(0x3000, 0x3fff) AM_READ(SMH_RAM) | |
| 111 | AM_RANGE(0x4000, 0xffff) AM_READ(SMH_ROM) | |
| 112 | ADDRESS_MAP_END | |
| 113 | ||
| 114 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 115 | AM_RANGE(0x0001, 0x0001) AM_WRITE(SMH_RAM) AM_BASE(&finalizr_scroll) | |
| 116 | AM_RANGE(0x0003, 0x0003) AM_WRITE(finalizr_videoctrl_w) | |
| 117 | AM_RANGE(0x0004, 0x0004) AM_WRITE(SMH_RAM) AM_BASE(&finalizr_interrupt_enable) | |
| 118 | // AM_RANGE(0x0020, 0x003f) AM_WRITE(SMH_RAM) AM_BASE(&finalizr_scroll) | |
| 119 | 114 | AM_RANGE(0x0818, 0x0818) AM_WRITE(watchdog_reset_w) |
| 120 | 115 | AM_RANGE(0x0819, 0x0819) AM_WRITE(finalizr_coin_w) |
| 121 | 116 | AM_RANGE(0x081a, 0x081a) AM_WRITE(sn76496_0_w) /* This address triggers the SN chip to read the data port. */ |
| 122 | 117 | AM_RANGE(0x081b, 0x081b) AM_WRITE(SMH_NOP) /* Loads the snd command into the snd latch */ |
| 123 | 118 | AM_RANGE(0x081c, 0x081c) AM_WRITE(finalizr_i8039_irq_w) /* custom sound chip */ |
| 124 | 119 | AM_RANGE(0x081d, 0x081d) AM_WRITE(soundlatch_w) /* custom sound chip */ |
| 125 | AM_RANGE(0x2000, 0x23ff) AM_WRITE(SMH_RAM) AM_BASE(&colorram) | |
| 126 | AM_RANGE(0x2400, 0x27ff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 127 | AM_RANGE(0x2800, 0x2bff) AM_WRITE(SMH_RAM) AM_BASE(&finalizr_colorram2) | |
| 128 | AM_RANGE(0x2c00, 0x2fff) AM_WRITE(SMH_RAM) AM_BASE(&finalizr_videoram2) | |
| 129 | AM_RANGE(0x3000, 0x31ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 130 | AM_RANGE(0x3200, 0x37ff) AM_WRITE(SMH_RAM) | |
| 131 | AM_RANGE(0x3800, 0x39ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_2) | |
| 132 | AM_RANGE(0x3a00, 0x3fff) AM_WRITE(SMH_RAM) | |
| 133 | AM_RANGE(0x4000, 0xffff) AM_WRITE(SMH_ROM) | |
| 120 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_BASE(&colorram) | |
| 121 | AM_RANGE(0x2400, 0x27ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 122 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_BASE(&finalizr_colorram2) | |
| 123 | AM_RANGE(0x2c00, 0x2fff) AM_RAM AM_BASE(&finalizr_videoram2) | |
| 124 | AM_RANGE(0x3000, 0x31ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 125 | AM_RANGE(0x3200, 0x37ff) AM_RAM | |
| 126 | AM_RANGE(0x3800, 0x39ff) AM_RAM AM_BASE(&spriteram_2) | |
| 127 | AM_RANGE(0x3a00, 0x3fff) AM_RAM | |
| 128 | AM_RANGE(0x4000, 0xffff) AM_ROM | |
| 134 | 129 | ADDRESS_MAP_END |
| 135 | 130 | |
| 136 | static ADDRESS_MAP_START( i8039_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 137 | AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_ROM) | |
| 131 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 132 | AM_RANGE(0x0000, 0x0fff) AM_ROM | |
| 138 | 133 | ADDRESS_MAP_END |
| 139 | 134 | |
| 140 | static ADDRESS_MAP_START( i8039_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 141 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(SMH_ROM) | |
| 142 | ADDRESS_MAP_END | |
| 143 | ||
| 144 | static ADDRESS_MAP_START( i8039_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 135 | static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 145 | 136 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch_r) |
| 146 | 137 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w) |
| 147 | 138 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_w) |
| r3957 | r3958 | |
| 313 | 304 | static MACHINE_DRIVER_START( finalizr ) |
| 314 | 305 | |
| 315 | 306 | /* basic machine hardware */ |
| 316 | MDRV_CPU_ADD("main", M6809,18432000/6) /* ??? */ | |
| 317 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 307 | MDRV_CPU_ADD("main", M6809,XTAL_18_432MHz/6) /* ??? */ | |
| 308 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 318 | 309 | MDRV_CPU_VBLANK_INT_HACK(finalizr_interrupt,16) /* 1 IRQ + 8 NMI (generated by a custom IC) */ |
| 319 | 310 | |
| 320 | MDRV_CPU_ADD("audio", I8039,18432000/2) /* 9.216MHz clkin ?? */ | |
| 321 | MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem) | |
| 322 | MDRV_CPU_IO_MAP(i8039_io_map,0) | |
| 311 | MDRV_CPU_ADD("audio", I8039,XTAL_18_432MHz/2) /* 9.216MHz clkin ?? */ | |
| 312 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 313 | MDRV_CPU_IO_MAP(sound_io_map,0) | |
| 323 | 314 | |
| 324 | 315 | /* video hardware */ |
| 325 | 316 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 339 | 330 | /* sound hardware */ |
| 340 | 331 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 341 | 332 | |
| 342 | MDRV_SOUND_ADD("sn", SN7649 | |
| 333 | MDRV_SOUND_ADD("sn", SN76489A, XTAL_18_432MHz/12) | |
| 343 | 334 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 344 | 335 | |
| 345 | 336 | MDRV_SOUND_ADD("dac", DAC, 0) |
| r3957 | r3958 | |
| 411 | 402 | } |
| 412 | 403 | |
| 413 | 404 | |
| 414 | GAME( 1985, finalizr, 0, finalizr, finalizr, finalizr, ROT90, "Konami", "Finalizer - Super Transformation", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL ) | |
| 415 | GAME( 1985, finalizb, finalizr, finalizr, finalizb, finalizr, ROT90, "bootleg", "Finalizer - Super Transformation (bootleg)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL ) | |
| 405 | GAME( 1985, finalizr, 0, finalizr, finalizr, finalizr, ROT90, "Konami", "Finalizer - Super Transformation", GAME_IMPERFECT_SOUND ) | |
| 406 | GAME( 1985, finalizb, finalizr, finalizr, finalizb, finalizr, ROT90, "bootleg", "Finalizer - Super Transformation (bootleg)", GAME_IMPERFECT_SOUND ) | |
| 416 | 407 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/z80/z80.h" | |
| 13 | 14 | #include "system16.h" |
| 14 | 15 | #include "cpu/m68000/m68000.h" |
| 15 | 16 | #include "machine/segaic16.h" |
| r3957 | r3958 | |
| 967 | 968 | |
| 968 | 969 | MDRV_MACHINE_RESET(yboard) |
| 969 | 970 | MDRV_NVRAM_HANDLER(yboard) |
| 970 | MDRV_ | |
| 971 | MDRV_QUANTUM_TIME | |
| 971 | 972 | |
| 972 | 973 | /* video hardware */ |
| 973 | 974 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "shuuz.h" |
| 23 | 24 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 194 | 194 | ***************************************************************************/ |
| 195 | 195 | |
| 196 | 196 | #include "driver.h" |
| 197 | #include "cpu/z80/z80.h" | |
| 197 | 198 | #include "machine/segacrpt.h" |
| 198 | 199 | #include "sound/ay8910.h" |
| 199 | 200 | #include "sound/samples.h" |
| r3957 | r3958 | |
| 247 | 248 | |
| 248 | 249 | static TIMER_CALLBACK( disable_interrupts ) |
| 249 | 250 | { |
| 250 | cpu_interrupt_enable(0,0); | |
| 251 | cpu_interrupt_enable(machine->cpu[0],0); | |
| 251 | 252 | } |
| 252 | 253 | |
| 253 | 254 |
| r3957 | r3958 | |
|---|---|---|
| 205 | 205 | MDRV_CPU_PROGRAM_MAP(xorworld_map, 0) |
| 206 | 206 | MDRV_CPU_VBLANK_INT_HACK(xorworld_interrupt, 4) // 1 IRQ2 + 1 IRQ4 + 1 IRQ6 |
| 207 | 207 | |
| 208 | MDRV_ | |
| 208 | MDRV_QUANTUM_TIME | |
| 209 | 209 | |
| 210 | 210 | MDRV_NVRAM_HANDLER(xorworld) |
| 211 | 211 |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | ******************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/z80/z80.h" | |
| 24 | 25 | #include "sound/okim6295.h" |
| 25 | 26 | |
| 26 | 27 | /*** README INFO ************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | *********************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/z80/z80.h" | |
| 23 | #include "cpu/i8085/i8085.h" | |
| 22 | 24 | #include "deprecat.h" |
| 23 | 25 | #include "sound/ay8910.h" |
| 24 | 26 | |
| r3957 | r3958 | |
| 194 | 196 | offs_t color_map_address = (y >> 3 << 5) | (x >> 3); |
| 195 | 197 | /* the schematics shows it like this, but it doesn't work as this would |
| 196 | 198 | produce no stars, due to the contents of the PROM -- maybe there is |
| 197 | a star disabled bit somewhere that's connected here instead of flip_screen_get() */ | |
| 199 | a star disabled bit somewhere that's connected here instead of flip_screen_get(screen->machine) */ | |
| 198 | 200 | /* star_map_address = (y >> 4 << 6) | (engima2_flip_screen_get() << 5) | (x >> 3); */ |
| 199 | 201 | offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3); |
| 200 | 202 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | *************************************************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "sound/okim6295.h" |
| 11 | 12 | #include "sound/2203intf.h" |
| 12 | 13 |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/z80/z80.h" | |
| 17 | 18 | #include "system16.h" |
| 18 | 19 | #include "machine/fd1089.h" |
| 19 | 20 | #include "machine/segaic16.h" |
| r3957 | r3958 | |
| 257 | 258 | segaic16_tilemap_reset(machine, 0); |
| 258 | 259 | |
| 259 | 260 | /* hook the RESET line, which resets CPU #1 */ |
| 260 | c | |
| 261 | device | |
| 261 | 262 | |
| 262 | 263 | /* start timers to track interrupts */ |
| 263 | 264 | timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 223, 0), NULL, 223, scanline_callback); |
| r3957 | r3958 | |
| 816 | 817 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 817 | 818 | |
| 818 | 819 | MDRV_MACHINE_RESET(outrun) |
| 819 | MDRV_ | |
| 820 | MDRV_QUANTUM_TIME | |
| 820 | 821 | |
| 821 | 822 | MDRV_PPI8255_ADD( "ppi8255", single_ppi_intf ) |
| 822 | 823 |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | ***************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "cpu/z80/z80.h" | |
| 41 | 42 | #include "sound/ay8910.h" |
| 42 | 43 | |
| 43 | 44 | static int inputcnt=0; |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | *************************************************************************/ |
| 48 | 48 | |
| 49 | 49 | #include "driver.h" |
| 50 | #include "cpu/z80/z80.h" | |
| 50 | 51 | #include "sound/ay8910.h" |
| 51 | 52 | |
| 52 | 53 |
| r3957 | r3958 | |
|---|---|---|
| 219 | 219 | */ |
| 220 | 220 | |
| 221 | 221 | #include "driver.h" |
| 222 | #include "cpu/m68000/m68000.h" | |
| 222 | 223 | #include "machine/eeprom.h" |
| 223 | 224 | #include "cpu/powerpc/ppc.h" |
| 224 | 225 | #include "cpu/sharc/sharc.h" |
| 225 | 226 | #include "machine/konppc.h" |
| 226 | 227 | #include "machine/konamiic.h" |
| 227 | #include "machine/adc083x.h" | |
| 228 | 228 | #include "sound/rf5c400.h" |
| 229 | 229 | #include "video/voodoo.h" |
| 230 | 230 | #include "video/gticlub.h" |
| r3957 | r3958 | |
| 598 | 598 | static MACHINE_START( gticlub ) |
| 599 | 599 | { |
| 600 | 600 | /* set conservative DRC options */ |
| 601 | c | |
| 601 | device | |
| 602 | 602 | |
| 603 | 603 | /* configure fast RAM regions for DRC */ |
| 604 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 605 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 606 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); | |
| 607 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 608 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 604 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 605 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 606 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); | |
| 607 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 608 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r3957 | r3958 | |
| 924 | 924 | MDRV_CPU_CONFIG(sharc_cfg) |
| 925 | 925 | MDRV_CPU_DATA_MAP(sharc_map, 0) |
| 926 | 926 | |
| 927 | MDRV_ | |
| 927 | MDRV_QUANTUM_TIME | |
| 928 | 928 | |
| 929 | 929 | MDRV_NVRAM_HANDLER(gticlub) |
| 930 | 930 | MDRV_MACHINE_START(gticlub) |
| r3957 | r3958 | |
| 972 | 972 | MDRV_CPU_CONFIG(sharc_cfg) |
| 973 | 973 | MDRV_CPU_DATA_MAP(hangplt_sharc1_map, 0) |
| 974 | 974 | |
| 975 | MDRV_ | |
| 975 | MDRV_QUANTUM_TIME | |
| 976 | 976 | |
| 977 | 977 | MDRV_NVRAM_HANDLER(gticlub) |
| 978 | 978 | MDRV_MACHINE_START(gticlub) |
| r3957 | r3958 | |
| 1167 | 1167 | |
| 1168 | 1168 | static DRIVER_INIT(gticlub) |
| 1169 | 1169 | { |
| 1170 | init_konami_cgboard(1, CGBOARD_TYPE_GTICLUB); | |
| 1170 | init_konami_cgboard(machine, 1, CGBOARD_TYPE_GTICLUB); | |
| 1171 | 1171 | |
| 1172 | 1172 | sharc_dataram_0 = auto_malloc(0x100000); |
| 1173 | 1173 | gticlub_led_reg0 = gticlub_led_reg1 = 0x7f; |
| r3957 | r3958 | |
| 1181 | 1181 | |
| 1182 | 1182 | static DRIVER_INIT(hangplt) |
| 1183 | 1183 | { |
| 1184 | init_konami_cgboard(2, CGBOARD_TYPE_HANGPLT); | |
| 1185 | set_cgboard_texture_bank(0, 5, memory_region(machine, "user5")); | |
| 1186 | set_cgboard_texture_bank(1, 6, memory_region(machine, "user5")); | |
| 1184 | init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT); | |
| 1185 | set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5")); | |
| 1186 | set_cgboard_texture_bank(machine, 1, 6, memory_region(machine, "user5")); | |
| 1187 | 1187 | |
| 1188 | 1188 | sharc_dataram_0 = auto_malloc(0x100000); |
| 1189 | 1189 | sharc_dataram_1 = auto_malloc(0x100000); |
| r3957 | r3958 | |
|---|---|---|
| 112 | 112 | */ |
| 113 | 113 | |
| 114 | 114 | #include "driver.h" |
| 115 | #include "cpu/m6502/m6502.h" | |
| 115 | 116 | #include "deprecat.h" |
| 116 | 117 | #include "sound/pokey.h" |
| 117 | 118 | #include "includes/cloak.h" |
| r3957 | r3958 | |
| 337 | 338 | MDRV_CPU_PROGRAM_MAP(slave_map,0) |
| 338 | 339 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) |
| 339 | 340 | |
| 340 | MDRV_ | |
| 341 | MDRV_QUANTUM_TIME | |
| 341 | 342 | |
| 342 | 343 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 343 | 344 |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | ****************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | #include "cpu/z80/z80.h" | |
| 39 | 40 | #include "sound/ay8910.h" |
| 40 | 41 | |
| 41 | 42 | static UINT8 *cfb_ram; |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | #include "driver.h" |
| 77 | #include "cpu/m68000/m68000.h" | |
| 77 | 78 | #include "machine/atarigen.h" |
| 78 | 79 | #include "sound/pokey.h" |
| 79 | 80 | #include "foodf.h" |
| r3957 | r3958 | |
|---|---|---|
| 159 | 159 | ***************************************************************************/ |
| 160 | 160 | |
| 161 | 161 | #include "driver.h" |
| 162 | #include "cpu/m68000/m68000.h" | |
| 162 | 163 | #include "deprecat.h" |
| 163 | 164 | #include "namcona1.h" |
| 164 | 165 | #include "sound/c140.h" |
| r3957 | r3958 | |
| 1019 | 1020 | MDRV_NVRAM_HANDLER(namcosna1) |
| 1020 | 1021 | MDRV_MACHINE_START(namcona1) |
| 1021 | 1022 | MDRV_MACHINE_RESET(namcona1_mcu) |
| 1022 | MDRV_ | |
| 1023 | MDRV_QUANTUM_TIME | |
| 1023 | 1024 | |
| 1024 | 1025 | /* video hardware */ |
| 1025 | 1026 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/m6502/m6502.h" | |
| 27 | 28 | #include "deprecat.h" |
| 28 | 29 | #include "bsktball.h" |
| 29 | 30 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 173 | 173 | COMBINE_DATA(&armedf_vreg); |
| 174 | 174 | /* bits 0 and 1 of armedf_vreg are coin counters */ |
| 175 | 175 | /* bit 12 seems to handle screen flipping */ |
| 176 | flip_screen_set(armedf_vreg & 0x1000); | |
| 176 | flip_screen_set(space->machine, armedf_vreg & 0x1000); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | static WRITE16_HANDLER( terraf_io_w ) |
| r3957 | r3958 | |
| 181 | 181 | COMBINE_DATA(&armedf_vreg); |
| 182 | 182 | /* bits 0 and 1 of armedf_vreg are coin counters */ |
| 183 | 183 | /* bit 12 seems to handle screen flipping */ |
| 184 | flip_screen_set(armedf_vreg & 0x1000); | |
| 184 | flip_screen_set(space->machine, armedf_vreg & 0x1000); | |
| 185 | 185 | |
| 186 | 186 | |
| 187 | 187 | if ((armedf_vreg & 0x4000) && !(armedf_vreg & 0x0100)) |
| r3957 | r3958 | |
| 203 | 203 | COMBINE_DATA(&armedf_vreg); |
| 204 | 204 | /* bits 0 and 1 of armedf_vreg are coin counters */ |
| 205 | 205 | /* bit 12 seems to handle screen flipping */ |
| 206 | flip_screen_set(armedf_vreg & 0x1000); | |
| 206 | flip_screen_set(space->machine, armedf_vreg & 0x1000); | |
| 207 | 207 | |
| 208 | 208 | /* This is a temporary condition specification. */ |
| 209 | 209 | if (!(armedf_vreg & 0x0080)) |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | AM_RANGE(0xa0, 0xa0) AM_WRITE(ay8910_control_port_0_w) |
| 41 | 41 | AM_RANGE(0xa1, 0xa1) AM_WRITE(ay8910_write_port_0_w) |
| 42 | 42 | AM_RANGE(0xa2, 0xa2) AM_READ(ay8910_read_port_0_r) |
| 43 | AM_RANGE(0xa8, 0xa8) AM_RAM | |
| 44 | AM_RANGE(0xa9, 0xab) AM_NOP | |
| 43 | ||
| 44 | //Ports a8-ab are originally for communicating with the i8255 PPI on MSX. | |
| 45 | //( http://map.tni.nl/resources/msx_io_ports.php#ppi ) | |
| 46 | //Since this arcade board doesn't have one, those ports should be | |
| 47 | //unmapped, so setting a8 to RAM is wrong. The ROM hasn't been hacked | |
| 48 | //cleanly by removing all references to the PPI. PCB pics showing eg. lack | |
| 49 | // AM_RANGE(0xa8, 0xa8) AM_RAM | |
| 50 | // AM_RANGE(0xa9, 0xab) AM_NOP | |
| 45 | 51 | ADDRESS_MAP_END |
| 46 | 52 | |
| 47 | 53 | static INPUT_PORTS_START( pesadelo ) |
| r3957 | r3958 | |
|---|---|---|
| 299 | 299 | ***************************************************************************/ |
| 300 | 300 | |
| 301 | 301 | #include "driver.h" |
| 302 | #include "cpu/z80/z80.h" | |
| 302 | 303 | #include "cpu/s2650/s2650.h" |
| 303 | 304 | #include "cpu/m6502/m6502.h" |
| 304 | 305 | #include "includes/dkong.h" |
| r3957 | r3958 | |
| 338 | 339 | |
| 339 | 340 | static const z80dma_interface dk3_dma = |
| 340 | 341 | { |
| 341 | 0, | |
| 342 | CLOCK_1H, | |
| 342 | "main", | |
| 343 | 343 | |
| 344 | 344 | dk_dma_read_byte, |
| 345 | 345 | dk_dma_write_byte, |
| r3957 | r3958 | |
| 349 | 349 | |
| 350 | 350 | static const dma8257_interface dk_dma = |
| 351 | 351 | { |
| 352 | 0, | |
| 353 | CLOCK_1H, | |
| 352 | "main", | |
| 354 | 353 | |
| 355 | 354 | dk_dma_read_byte, |
| 356 | 355 | dk_dma_write_byte, |
| r3957 | r3958 | |
| 362 | 361 | |
| 363 | 362 | static const dma8257_interface hb_dma = |
| 364 | 363 | { |
| 365 | 0, | |
| 366 | CLOCK_1H, | |
| 364 | "main", | |
| 367 | 365 | |
| 368 | 366 | hb_dma_read_byte, |
| 369 | 367 | hb_dma_write_byte, |
| r3957 | r3958 | |
| 1575 | 1573 | MDRV_MACHINE_START(dkong2b) |
| 1576 | 1574 | MDRV_MACHINE_RESET(dkong) |
| 1577 | 1575 | |
| 1578 | MDRV_DEVICE_ADD("dma8257", DMA8257) | |
| 1579 | MDRV_DEVICE_CONFIG(dk_dma) | |
| 1576 | MDRV_DMA8257_ADD("dma8257", CLOCK_1H, dk_dma) | |
| 1580 | 1577 | |
| 1581 | 1578 | /* video hardware */ |
| 1582 | 1579 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 1644 | 1641 | |
| 1645 | 1642 | MDRV_MACHINE_START(dkong3) |
| 1646 | 1643 | |
| 1647 | MDRV_DEVICE_ADD("z80dma", Z80DMA) | |
| 1648 | MDRV_DEVICE_CONFIG(dk3_dma) | |
| 1644 | MDRV_Z80DMA_ADD("z80dma", CLOCK_1H, dk3_dma) | |
| 1649 | 1645 | |
| 1650 | 1646 | /* video hardware */ |
| 1651 | 1647 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6502/m6502.h" | |
| 8 | 9 | #include "audio/sprint4.h" |
| 9 | 10 | |
| 10 | 11 | #define MASTER_CLOCK 12096000 |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | ***************************************************************************/ |
| 49 | 49 | |
| 50 | 50 | #include "driver.h" |
| 51 | #include "cpu/z80/z80.h" | |
| 51 | 52 | #include "appoooh.h" |
| 52 | 53 | #include "machine/segacrpt.h" |
| 53 | 54 | #include "sound/msm5205.h" |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6502/m6502.h" | |
| 8 | 9 | |
| 9 | 10 | extern UINT8* skyraid_alpha_num_ram; |
| 10 | 11 | extern UINT8* skyraid_pos_ram; |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | ****************************************************************************/ |
| 49 | 49 | |
| 50 | 50 | #include "driver.h" |
| 51 | #include "cpu/z80/z80.h" | |
| 51 | 52 | #include "audio/irem.h" |
| 52 | 53 | |
| 53 | 54 | extern UINT8 *travrusa_videoram; |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/z80/z80.h" | |
| 14 | 15 | #include "sound/ay8910.h" |
| 15 | 16 | |
| 16 | 17 | /* video */ |
| r3957 | r3958 | |
| 53 | 54 | int sx = hanaroku_spriteram1[i + 0x200] | ((hanaroku_spriteram2[i + 0x200] & 0x07) << 8); |
| 54 | 55 | int sy = 242 - hanaroku_spriteram3[i]; |
| 55 | 56 | |
| 56 | if (flip_screen_get()) | |
| 57 | if (flip_screen_get(machine)) | |
| 57 | 58 | { |
| 58 | 59 | sy = 242 - sy; |
| 59 | 60 | flipx = !flipx; |
| r3957 | r3958 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | static WRITE8_HANDLER( metlclsh_flipscreen_w ) |
| 132 | 132 | { |
| 133 | flip_screen_set(data & 1); | |
| 133 | flip_screen_set(space->machine, data & 1); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static ADDRESS_MAP_START( metlclsh_readmem2, ADDRESS_SPACE_PROGRAM, 8 ) |
| r3957 | r3958 | |
| 308 | 308 | |
| 309 | 309 | static MACHINE_RESET( metlclsh ) |
| 310 | 310 | { |
| 311 | flip_screen_set(0); | |
| 311 | flip_screen_set(machine, 0); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static MACHINE_DRIVER_START( metlclsh ) |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/z80/z80.h" | |
| 11 | 12 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 12 | 13 | #include "video/konamiic.h" |
| 13 | 14 | #include "sound/k007232.h" |
| r3957 | r3958 | |
|---|---|---|
| 85 | 85 | ***************************************************************************/ |
| 86 | 86 | |
| 87 | 87 | #include "driver.h" |
| 88 | #include "cpu/m68000/m68000.h" | |
| 88 | 89 | #include "deprecat.h" |
| 89 | 90 | #include "cpu/z80/z80.h" |
| 90 | 91 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 6526 | 6527 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6527 | 6528 | |
| 6528 | 6529 | /* devices */ |
| 6529 | MDRV_ | |
| 6530 | MDRV_MSM6242_ADD("rtc" | |
| 6530 | 6531 | MACHINE_DRIVER_END |
| 6531 | 6532 | |
| 6532 | 6533 | static MACHINE_DRIVER_START( ddenlvrj ) |
| r3957 | r3958 | |
| 6594 | 6595 | /* I haven't found a irq ack register, so I need this kludge to |
| 6595 | 6596 | make sure I don't lose any interrupt generated by the blitter, |
| 6596 | 6597 | otherwise quizchq would lock up. */ |
| 6597 | if (c | |
| 6598 | if (device | |
| 6598 | 6599 | return; |
| 6599 | 6600 | |
| 6600 | 6601 | if ((++count % 60) == 0) |
| r3957 | r3958 | |
| 6643 | 6644 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6644 | 6645 | |
| 6645 | 6646 | /* devices */ |
| 6646 | MDRV_ | |
| 6647 | MDRV_MSM6242_ADD("rtc" | |
| 6647 | 6648 | MACHINE_DRIVER_END |
| 6648 | 6649 | |
| 6649 | 6650 | static MACHINE_DRIVER_START( rongrong ) |
| r3957 | r3958 | |
| 6674 | 6675 | /* I haven't found a irq ack register, so I need this kludge to |
| 6675 | 6676 | make sure I don't lose any interrupt generated by the blitter, |
| 6676 | 6677 | otherwise the game would lock up. */ |
| 6677 | if (c | |
| 6678 | if (device | |
| 6678 | 6679 | return; |
| 6679 | 6680 | |
| 6680 | 6681 | if ((++count % 60) == 0) |
| r3957 | r3958 | |
| 6724 | 6725 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6725 | 6726 | |
| 6726 | 6727 | /* devices */ |
| 6727 | MDRV_ | |
| 6728 | MDRV_MSM6242_ADD("rtc" | |
| 6728 | 6729 | MACHINE_DRIVER_END |
| 6729 | 6730 | |
| 6730 | 6731 | |
| r3957 | r3958 | |
| 6746 | 6747 | /* I haven't found a irq ack register, so I need this kludge to |
| 6747 | 6748 | make sure I don't lose any interrupt generated by the blitter, |
| 6748 | 6749 | otherwise quizchq would lock up. */ |
| 6749 | if (c | |
| 6750 | if (device | |
| 6750 | 6751 | return; |
| 6751 | 6752 | |
| 6752 | 6753 | if ((++count % 60) == 0) |
| r3957 | r3958 | |
| 6788 | 6789 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6789 | 6790 | |
| 6790 | 6791 | /* devices */ |
| 6791 | MDRV_ | |
| 6792 | MDRV_MSM6242_ADD("rtc" | |
| 6792 | 6793 | MACHINE_DRIVER_END |
| 6793 | 6794 | |
| 6794 | 6795 | static MACHINE_DRIVER_START( hkagerou ) |
| r3957 | r3958 | |
| 6822 | 6823 | /* I haven't found a irq ack register, so I need this kludge to |
| 6823 | 6824 | make sure I don't lose any interrupt generated by the blitter, |
| 6824 | 6825 | otherwise quizchq would lock up. */ |
| 6825 | if (c | |
| 6826 | if (device | |
| 6826 | 6827 | return; |
| 6827 | 6828 | |
| 6828 | 6829 | if ((++count % 60) == 0) |
| r3957 | r3958 | |
| 6880 | 6881 | /* I haven't found a irq ack register, so I need this kludge to |
| 6881 | 6882 | make sure I don't lose any interrupt generated by the blitter, |
| 6882 | 6883 | otherwise quizchq would lock up. */ |
| 6883 | if (c | |
| 6884 | if (device | |
| 6884 | 6885 | return; |
| 6885 | 6886 | |
| 6886 | 6887 | switch( cpu_getiloops(device) ) |
| r3957 | r3958 | |
| 6936 | 6937 | /* I haven't found a irq ack register, so I need this kludge to |
| 6937 | 6938 | make sure I don't lose any interrupt generated by the blitter, |
| 6938 | 6939 | otherwise hginga would lock up. */ |
| 6939 | if (c | |
| 6940 | if (device | |
| 6940 | 6941 | return; |
| 6941 | 6942 | |
| 6942 | 6943 | if ((++count % 60) == 0) |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | #include "driver.h" |
| 73 | #include "cpu/hd6309/hd6309.h" | |
| 73 | 74 | #include "cpu/m6809/m6809.h" |
| 74 | 75 | #include "cpu/z80/z80.h" |
| 75 | 76 | #include "cpu/mcs48/mcs48.h" |
| r3957 | r3958 | |
| 125 | 126 | ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 ); |
| 126 | 127 | ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 ); |
| 127 | 128 | |
| 128 | flip_screen_set(~data & 0x04); | |
| 129 | flip_screen_set(space->machine, ~data & 0x04); | |
| 129 | 130 | } |
| 130 | 131 | |
| 131 | 132 | static WRITE8_HANDLER( chinagat_bankswitch_w ) |
| r3957 | r3958 | |
| 505 | 506 | MDRV_CPU_ADD("audio", Z80, 3579545) /* 3.579545 MHz */ |
| 506 | 507 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 507 | 508 | |
| 508 | MDRV_ | |
| 509 | MDRV_QUANTUM_TIME | |
| 509 | 510 | |
| 510 | 511 | MDRV_MACHINE_RESET(chinagat) |
| 511 | 512 | |
| r3957 | r3958 | |
| 553 | 554 | MDRV_CPU_PROGRAM_MAP(i8748_map,0) |
| 554 | 555 | MDRV_CPU_IO_MAP(i8748_portmap,0) |
| 555 | 556 | |
| 556 | MDRV_ | |
| 557 | MDRV_QUANTUM_TIME | |
| 557 | 558 | |
| 558 | 559 | MDRV_MACHINE_RESET(chinagat) |
| 559 | 560 | |
| r3957 | r3958 | |
| 597 | 598 | MDRV_CPU_ADD("audio", Z80, 3579545) /* 3.579545 MHz oscillator */ |
| 598 | 599 | MDRV_CPU_PROGRAM_MAP(ym2203c_sound_map,0) |
| 599 | 600 | |
| 600 | MDRV_ | |
| 601 | MDRV_QUANTUM_TIME | |
| 601 | 602 | |
| 602 | 603 | MDRV_MACHINE_RESET(chinagat) |
| 603 | 604 |
| r3957 | r3958 | |
|---|---|---|
| 71 | 71 | ***************************************************************************/ |
| 72 | 72 | |
| 73 | 73 | #include "driver.h" |
| 74 | #include "cpu/z80/z80.h" | |
| 75 | #include "cpu/m68000/m68000.h" | |
| 74 | 76 | #include "deprecat.h" |
| 75 | 77 | #include "machine/eeprom.h" |
| 76 | 78 | #include "includes/kaneko16.h" |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | different hardware. There are also various bootlegs / hacks, it isn't clear |
| 8 | 8 | exactly what hardware each runs on, some appear to have no OKI for example. |
| 9 | 9 | |
| 10 | driver by Mirko Buffoni | |
| 10 | Driver by Mirko Buffoni. | |
| 11 | Additional Work: David Haywood, Roberto Fresca. | |
| 11 | 12 | |
| 12 | 13 | ***************************************************************************/ |
| 14 | ||
| 13 | 15 | #include "driver.h" |
| 16 | #include "cpu/z80/z80.h" | |
| 14 | 17 | #include "sound/ay8910.h" |
| 15 | 18 | #include "sound/okim6295.h" |
| 19 | #include "sound/sn76496.h" | |
| 20 | #include "machine/8255ppi.h" | |
| 16 | 21 | |
| 17 | 22 | static int dataoffset=0; |
| 18 | 23 | |
| r3957 | r3958 | |
| 29 | 34 | extern UINT8 *goldstar_reel3_ram; |
| 30 | 35 | extern WRITE8_HANDLER( goldstar_reel3_ram_w ); |
| 31 | 36 | |
| 37 | extern WRITE8_HANDLER( goldstar_fg_vidram_w ); | |
| 38 | extern WRITE8_HANDLER( goldstar_fg_atrram_w ); | |
| 39 | ||
| 32 | 40 | WRITE8_HANDLER( goldstar_fa00_w ); |
| 33 | 41 | VIDEO_START( goldstar ); |
| 42 | VIDEO_START( cherrym ); | |
| 34 | 43 | VIDEO_UPDATE( goldstar ); |
| 35 | VIDEO_UPDATE( cherrym ); | |
| 36 | 44 | |
| 37 | 45 | static UINT8 *nvram; |
| 38 | 46 | static size_t nvram_size; |
| r3957 | r3958 | |
| 70 | 78 | AM_RANGE(0x0000, 0xb7ff) AM_ROM |
| 71 | 79 | AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size) |
| 72 | 80 | AM_RANGE(0xc000, 0xc7ff) AM_ROM |
| 73 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 74 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&colorram) | |
| 81 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(goldstar_fg_vidram_w) AM_BASE(&videoram) | |
| 82 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(goldstar_fg_atrram_w) AM_BASE(&colorram) | |
| 75 | 83 | AM_RANGE(0xd800, 0xd9ff) AM_RAM AM_WRITE( goldstar_reel1_ram_w ) AM_BASE(&goldstar_reel1_ram) |
| 76 | 84 | AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_WRITE( goldstar_reel2_ram_w ) AM_BASE(&goldstar_reel2_ram) |
| 77 | 85 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_WRITE( goldstar_reel3_ram_w ) AM_BASE(&goldstar_reel3_ram) |
| r3957 | r3958 | |
| 97 | 105 | AM_RANGE(0xfe00, 0xfe00) AM_READWRITE(protection_r,protection_w) |
| 98 | 106 | ADDRESS_MAP_END |
| 99 | 107 | |
| 108 | static ADDRESS_MAP_START( goldstar_readport, ADDRESS_SPACE_IO, 8 ) | |
| 109 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 110 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW6") | |
| 111 | ADDRESS_MAP_END | |
| 112 | ||
| 113 | ||
| 100 | 114 | static ADDRESS_MAP_START( ncb3_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 101 | 115 | AM_RANGE(0x0000, 0xb7ff) AM_ROM |
| 102 | 116 | AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size) |
| 103 | 117 | AM_RANGE(0xc000, 0xc7ff) AM_ROM |
| 104 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 105 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&colorram) | |
| 106 | AM_RANGE(0xd800, 0xd9ff) AM_RAM AM_WRITE( goldstar_reel1_ram_w ) AM_BASE(&goldstar_reel1_ram) | |
| 107 | AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_WRITE( goldstar_reel2_ram_w ) AM_BASE(&goldstar_reel2_ram) | |
| 108 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_WRITE( goldstar_reel3_ram_w ) AM_BASE(&goldstar_reel3_ram) | |
| 118 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(goldstar_fg_vidram_w) AM_BASE(&videoram) | |
| 119 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(goldstar_fg_atrram_w) AM_BASE(&colorram) | |
| 120 | AM_RANGE(0xd800, 0xd9ff) AM_RAM AM_WRITE(goldstar_reel1_ram_w) AM_BASE(&goldstar_reel1_ram) | |
| 121 | AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_WRITE(goldstar_reel2_ram_w) AM_BASE(&goldstar_reel2_ram) | |
| 122 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_WRITE(goldstar_reel3_ram_w) AM_BASE(&goldstar_reel3_ram) | |
| 109 | 123 | AM_RANGE(0xf040, 0xf07f) AM_RAM AM_BASE(&goldstar_reel1_scroll) |
| 110 | 124 | AM_RANGE(0xf080, 0xf0bf) AM_RAM AM_BASE(&goldstar_reel2_scroll) |
| 111 | AM_RANGE(0xf100, 0xf17f) AM_RAM AM_BASE(&goldstar_reel3_scroll) // moved compared to | |
| 125 | AM_RANGE(0xf100, 0xf17f) AM_RAM AM_BASE(&goldstar_reel3_scroll) // moved compared to goldstar | |
| 112 | 126 | |
| 113 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("IN0") | |
| 114 | AM_RANGE(0xf801, 0xf801) AM_READ_PORT("IN1") /* Test Mode */ | |
| 115 | AM_RANGE(0xf802, 0xf802) AM_READ_PORT("DSW1") | |
| 116 | // AM_RANGE(0xf803, 0xf803) | |
| 117 | // AM_RANGE(0xf804, 0xf804) | |
| 118 | AM_RANGE(0xf805, 0xf805) AM_READ_PORT("DSW4") /* DSW 4 (also appears in 8910 port) */ | |
| 119 | AM_RANGE(0xf806, 0xf806) AM_READ_PORT("DSW7") /* (don't know to which one of the */ | |
| 120 | AM_RANGE(0xf810, 0xf810) AM_READ_PORT("UNK1") | |
| 121 | AM_RANGE(0xf811, 0xf811) AM_READ_PORT("UNK2") | |
| 122 | AM_RANGE(0xf820, 0xf820) AM_READ_PORT("DSW2") | |
| 123 | // AM_RANGE(0xf830, 0xf830) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w) | |
| 124 | // AM_RANGE(0xf840, 0xf840) AM_WRITE(ay8910_control_port_0_w) | |
| 125 | // AM_RANGE(0xfa00, 0xfa00) AM_WRITE(goldstar_fa00_w) | |
| 126 | // AM_RANGE(0xfb00, 0xfb00) AM_READWRITE(okim6295_status_0_r,okim6295_data_0_w) | |
| 127 | // AM_RANGE(0xfd00, 0xfdff) AM_READWRITE(SMH_RAM,paletteram_BBGGGRRR_w) AM_BASE(&paletteram) | |
| 128 | // AM_RANGE(0xfe00, 0xfe00) AM_READWRITE(protection_r,protection_w) | |
| 127 | AM_RANGE(0xf800, 0xf803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w) /* Input Ports */ | |
| 128 | AM_RANGE(0xf810, 0xf813) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w) /* Input Ports */ | |
| 129 | AM_RANGE(0xf820, 0xf823) AM_DEVREADWRITE(PPI8255, "ppi8255_2", ppi8255_r, ppi8255_w) /* Input/Output Ports */ | |
| 130 | AM_RANGE(0xf830, 0xf830) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w) | |
| 131 | AM_RANGE(0xf840, 0xf840) AM_WRITE(ay8910_control_port_0_w) | |
| 132 | AM_RANGE(0xf870, 0xf870) AM_WRITE(sn76496_0_w) /* guess... device is initialized, but doesn't seems to be used.*/ | |
| 129 | 133 | ADDRESS_MAP_END |
| 130 | 134 | |
| 131 | ||
| 132 | ||
| 133 | static ADDRESS_MAP_START( goldstar_readport, ADDRESS_SPACE_IO, 8 ) | |
| 135 | static ADDRESS_MAP_START( ncb3_readwriteport, ADDRESS_SPACE_IO, 8 ) | |
| 134 | 136 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 135 | AM_RANGE(0x | |
| 137 | // AM_RANGE(0x | |
| 136 | 138 | ADDRESS_MAP_END |
| 137 | 139 | |
| 140 | /* ncb3 findings... | |
| 138 | 141 | |
| 142 | f800-f803 = 8255_1 (ctrl=9b) ; portA, B & C (input) | |
| 143 | f810-f813 = 8255_2 (ctrl=9b) ; portA, B & C (input) | |
| 144 | f820-f823 = 8255_3 (ctrl=90) ; portA (input); ports B & C (output) | |
| 145 | f830 = AY8910 RW | |
| 146 | f840 = AY8910 ctrl | |
| 147 | f850 = Unknown | |
| 148 | f870 = PSG (init writes) | |
| 149 | ||
| 150 | ||
| 151 | I/O | |
| 152 | ||
| 153 | 00 = RW | |
| 154 | 06 = RW | |
| 155 | 08 = RW | |
| 156 | 81 = W | |
| 157 | ||
| 158 | */ | |
| 159 | ||
| 160 | ||
| 139 | 161 | static ADDRESS_MAP_START( cm_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 140 | 162 | AM_RANGE(0x0000, 0xbfff) AM_ROM AM_WRITENOP |
| 141 | 163 | |
| 142 | ||
| 143 | 164 | AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size) // not here.. |
| 144 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 145 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&colorram) | |
| 165 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(goldstar_fg_vidram_w) AM_BASE(&videoram) | |
| 166 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(goldstar_fg_atrram_w) AM_BASE(&colorram) | |
| 146 | 167 | |
| 147 | 168 | AM_RANGE(0xd000, 0xd7ff) AM_RAM // main? |
| 148 | 169 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| r3957 | r3958 | |
| 337 | 358 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 338 | 359 | INPUT_PORTS_END |
| 339 | 360 | |
| 361 | static ADDRESS_MAP_START( lucky8_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 362 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 363 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 364 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size) | |
| 365 | AM_RANGE(0x8800, 0x8fff) AM_RAM AM_WRITE(goldstar_fg_vidram_w) AM_BASE(&videoram) | |
| 366 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_WRITE(goldstar_fg_atrram_w) AM_BASE(&colorram) | |
| 367 | AM_RANGE(0x9800, 0x99ff) AM_RAM AM_WRITE(goldstar_reel1_ram_w) AM_BASE(&goldstar_reel1_ram) | |
| 368 | AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_WRITE(goldstar_reel2_ram_w) AM_BASE(&goldstar_reel2_ram) | |
| 369 | AM_RANGE(0xa800, 0xa9ff) AM_RAM AM_WRITE(goldstar_reel3_ram_w) AM_BASE(&goldstar_reel3_ram) | |
| 370 | AM_RANGE(0xb040, 0xb07f) AM_RAM AM_BASE(&goldstar_reel1_scroll) | |
| 371 | AM_RANGE(0xb080, 0xb0bf) AM_RAM AM_BASE(&goldstar_reel2_scroll) | |
| 372 | AM_RANGE(0xb100, 0xb17f) AM_RAM AM_BASE(&goldstar_reel3_scroll) | |
| 373 | ||
| 374 | /* none of the inputs are verified / tested */ | |
| 375 | AM_RANGE(0xb800, 0xb800) AM_READ_PORT("IN0") | |
| 376 | AM_RANGE(0xb801, 0xb801) AM_READ_PORT("IN1") /* Test Mode */ | |
| 377 | AM_RANGE(0xb802, 0xb802) AM_READ_PORT("DSW1") | |
| 378 | //AM_RANGE(0xb803, 0xb803) | |
| 379 | //AM_RANGE(0xb804, 0xb804) | |
| 380 | AM_RANGE(0xb805, 0xb805) AM_READ_PORT("DSW4") /* DSW 4 (also appears in 8910 port) */ | |
| 381 | AM_RANGE(0xb806, 0xb806) AM_READ_PORT("DSW7") /* (don't know to which one of the */ | |
| 382 | AM_RANGE(0xb810, 0xb810) AM_READ_PORT("UNK1") | |
| 383 | AM_RANGE(0xb811, 0xb811) AM_READ_PORT("UNK2") | |
| 384 | AM_RANGE(0xb820, 0xb820) AM_READ_PORT("DSW2") | |
| 385 | AM_RANGE(0xb830, 0xb830) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w) | |
| 386 | AM_RANGE(0xb840, 0xb840) AM_WRITE(ay8910_control_port_0_w) | |
| 387 | // AM_RANGE(0xba00, 0xba00) AM_WRITE(goldstar_fa00_w) | |
| 388 | // AM_RANGE(0xbb00, 0xbb00) AM_READWRITE(okim6295_status_0_r,okim6295_data_0_w) | |
| 389 | // AM_RANGE(0xbd00, 0xbdff) AM_READWRITE(SMH_RAM,paletteram_BBGGGRRR_w) AM_BASE(&paletteram) | |
| 390 | // AM_RANGE(0xbe00, 0xbe00) AM_READWRITE(protection_r,protection_w) | |
| 391 | ADDRESS_MAP_END | |
| 392 | ||
| 393 | ||
| 340 | 394 | static INPUT_PORTS_START( goldstar ) |
| 341 | 395 | PORT_START("IN0") |
| 342 | 396 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r3957 | r3958 | |
| 463 | 517 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 464 | 518 | INPUT_PORTS_END |
| 465 | 519 | |
| 520 | static INPUT_PORTS_START( chryigld ) | |
| 521 | PORT_START("IN0") | |
| 522 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 523 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 524 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 2 / Double-Up") PORT_CODE(KEYCODE_X) | |
| 525 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Blue Bet / Card 3") PORT_CODE(KEYCODE_B) | |
| 526 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1") PORT_CODE(KEYCODE_Z) | |
| 527 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Red Bet / Card 2") PORT_CODE(KEYCODE_V) | |
| 528 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 3 / Info / Card 1") PORT_CODE(KEYCODE_C) | |
| 529 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start / Stop All / Card 4") PORT_CODE(KEYCODE_N) | |
| 466 | 530 | |
| 531 | PORT_START("IN1") | |
| 532 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 533 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 534 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1) PORT_IMPULSE(2) // Coin1? | |
| 535 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 536 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2) PORT_IMPULSE(2) // Coin2? | |
| 537 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3) PORT_IMPULSE(2) // Coin3? | |
| 538 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q) | |
| 539 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4) PORT_IMPULSE(2) // Coin4? | |
| 467 | 540 | |
| 541 | PORT_START("IN2") | |
| 542 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 543 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 544 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 545 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 546 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W) | |
| 547 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 548 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9) | |
| 549 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats") PORT_CODE(KEYCODE_0) | |
| 468 | 550 | |
| 551 | PORT_START("DSW1") | |
| 552 | PORT_DIPNAME( 0x07, 0x04, "Main Game %" ) | |
| 553 | PORT_DIPSETTING( 0x00, "55%" ) | |
| 554 | PORT_DIPSETTING( 0x01, "60%" ) | |
| 555 | PORT_DIPSETTING( 0x02, "65%" ) | |
| 556 | PORT_DIPSETTING( 0x03, "70%" ) | |
| 557 | PORT_DIPSETTING( 0x04, "75%" ) | |
| 558 | PORT_DIPSETTING( 0x05, "80%" ) | |
| 559 | PORT_DIPSETTING( 0x06, "85%" ) | |
| 560 | PORT_DIPSETTING( 0x07, "90%" ) | |
| 561 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 562 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 563 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 564 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 565 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 566 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 567 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 568 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 569 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 570 | PORT_DIPNAME( 0x40, 0x00, "Key-In Type" ) | |
| 571 | PORT_DIPSETTING( 0x40, "B-Type" ) | |
| 572 | PORT_DIPSETTING( 0x00, "A-Type" ) | |
| 573 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 574 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 575 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 576 | ||
| 577 | PORT_START("DSW2") | |
| 578 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 579 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 580 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 581 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 582 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 583 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 584 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 585 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 586 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 587 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 588 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 589 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 590 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 591 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 592 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 593 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 594 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 595 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 596 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 597 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 598 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 599 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 600 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 601 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 602 | ||
| 603 | PORT_START("DSW3") | |
| 604 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 605 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 606 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 607 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 608 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 609 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 610 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 611 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 612 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 613 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 614 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 615 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 616 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 617 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 618 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 619 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 620 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 621 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 622 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 623 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 624 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 625 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 626 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 627 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 628 | ||
| 629 | PORT_START("DSW4") | |
| 630 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 631 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 632 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 633 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 634 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 635 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 636 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 637 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 638 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 639 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 640 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 641 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 642 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 643 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 644 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 645 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 646 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 647 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 648 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 649 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 650 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 651 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 652 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 653 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 654 | ||
| 655 | PORT_START("DSW5") | |
| 656 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 657 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 658 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 659 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 660 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 661 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 662 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 663 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 664 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 665 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 666 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 667 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 668 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 669 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 670 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 671 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 672 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 673 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 674 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 675 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 676 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 677 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 678 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 679 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 680 | INPUT_PORTS_END | |
| 681 | ||
| 682 | static INPUT_PORTS_START( ncb3 ) | |
| 683 | PORT_START("IN0") | |
| 684 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 685 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 686 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 2 / Double-Up") PORT_CODE(KEYCODE_X) | |
| 687 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Blue Bet / Card 3") PORT_CODE(KEYCODE_B) | |
| 688 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1") PORT_CODE(KEYCODE_Z) | |
| 689 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Red Bet / Card 2") PORT_CODE(KEYCODE_V) | |
| 690 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 3 / Info / Card 1") PORT_CODE(KEYCODE_C) | |
| 691 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start / Stop All / Card 4") PORT_CODE(KEYCODE_N) | |
| 692 | ||
| 693 | PORT_START("IN1") | |
| 694 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 695 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 696 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1) PORT_IMPULSE(2) // Coin1? | |
| 697 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 698 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2) PORT_IMPULSE(2) // Coin2? | |
| 699 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3) PORT_IMPULSE(2) // Coin3? | |
| 700 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q) | |
| 701 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4) PORT_IMPULSE(2) // Coin4? | |
| 702 | ||
| 703 | PORT_START("IN2") | |
| 704 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 705 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 706 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 707 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 708 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W) | |
| 709 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 710 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9) | |
| 711 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats") PORT_CODE(KEYCODE_0) | |
| 712 | ||
| 713 | PORT_START("DSW1") | |
| 714 | PORT_DIPNAME( 0x07, 0x04, "Main Game %" ) | |
| 715 | PORT_DIPSETTING( 0x00, "55%" ) | |
| 716 | PORT_DIPSETTING( 0x01, "60%" ) | |
| 717 | PORT_DIPSETTING( 0x02, "65%" ) | |
| 718 | PORT_DIPSETTING( 0x03, "70%" ) | |
| 719 | PORT_DIPSETTING( 0x04, "75%" ) | |
| 720 | PORT_DIPSETTING( 0x05, "80%" ) | |
| 721 | PORT_DIPSETTING( 0x06, "85%" ) | |
| 722 | PORT_DIPSETTING( 0x07, "90%" ) | |
| 723 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 724 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 725 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 726 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 727 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 728 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 729 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 730 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 731 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 732 | PORT_DIPNAME( 0x40, 0x00, "Key-In Type" ) | |
| 733 | PORT_DIPSETTING( 0x40, "B-Type" ) | |
| 734 | PORT_DIPSETTING( 0x00, "A-Type" ) | |
| 735 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 736 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 737 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 738 | ||
| 739 | PORT_START("DSW2") | |
| 740 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 741 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 742 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 743 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 744 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 745 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 746 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 747 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 748 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 749 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 750 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 751 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 752 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 753 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 754 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 755 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 756 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 757 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 758 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 759 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 760 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 761 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 762 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 763 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 764 | ||
| 765 | PORT_START("DSW3") | |
| 766 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 767 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 768 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 769 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 770 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 771 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 772 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 773 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 774 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 775 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 776 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 777 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 778 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 779 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 780 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 781 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 782 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 783 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 784 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 785 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 786 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 787 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 788 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 789 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 790 | ||
| 791 | PORT_START("DSW4") | |
| 792 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 793 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 794 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 795 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 796 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 797 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 798 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 799 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 800 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 801 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 802 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 803 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 804 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 805 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 806 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 807 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 808 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 809 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 810 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 811 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 812 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 813 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 814 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 815 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 816 | ||
| 817 | PORT_START("DSW5") | |
| 818 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 819 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 820 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 821 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 822 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 823 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 824 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 825 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 826 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 827 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 828 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 829 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 830 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 831 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 832 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 833 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 834 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 835 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 836 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 837 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 838 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 839 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 840 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 841 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 842 | INPUT_PORTS_END | |
| 843 | ||
| 844 | ||
| 845 | ||
| 469 | 846 | static const gfx_layout charlayout = |
| 470 | 847 | { |
| 471 | 848 | 8,8, /* 8*8 characters */ |
| r3957 | r3958 | |
| 560 | 937 | 32*8 |
| 561 | 938 | }; |
| 562 | 939 | |
| 940 | static const gfx_layout tiles8x32x5_layout = | |
| 941 | { | |
| 942 | 8,32, | |
| 943 | RGN_FRAC(1,5), | |
| 944 | 5, | |
| 945 | { RGN_FRAC(0,5), RGN_FRAC(1,5), RGN_FRAC(2,5), RGN_FRAC(3,5), RGN_FRAC(4,5) }, | |
| 946 | { 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 947 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, | |
| 948 | 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8, | |
| 949 | 16*8,17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, | |
| 950 | 24*8,25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8 | |
| 951 | }, | |
| 952 | 32*8 | |
| 953 | }; | |
| 563 | 954 | |
| 564 | ||
| 565 | ||
| 566 | 955 | static GFXDECODE_START( goldstar ) |
| 567 | 956 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) |
| 568 | 957 | GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 128, 8 ) |
| 569 | 958 | GFXDECODE_END |
| 959 | ||
| 570 | 960 | static GFXDECODE_START( bl ) |
| 571 | 961 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) |
| 572 | 962 | GFXDECODE_ENTRY( "gfx2", 0, tilelayoutbl, 128, 8 ) |
| 573 | 963 | GFXDECODE_END |
| 964 | ||
| 574 | 965 | static GFXDECODE_START( ml ) |
| 575 | 966 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) |
| 576 | 967 | GFXDECODE_ENTRY( "gfx2", 0x18000, tilelayout, 128, 8 ) |
| r3957 | r3958 | |
| 586 | 977 | GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 128+64, 4 ) |
| 587 | 978 | GFXDECODE_END |
| 588 | 979 | |
| 980 | static GFXDECODE_START( cmasterb ) | |
| 981 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0, 16 ) | |
| 982 | GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x5_layout, 0, 4 ) | |
| 983 | GFXDECODE_END | |
| 984 | ||
| 985 | ||
| 986 | /************************************* | |
| 987 | * PPI 8255 (x3) Interfaces * | |
| 988 | *************************************/ | |
| 989 | ||
| 990 | static const ppi8255_interface ppi8255_intf[4] = | |
| 991 | { | |
| 992 | { /* A, B & C set as input */ | |
| 993 | DEVICE8_PORT("IN0"), /* Port A read, IN0 */ | |
| 994 | NULL, /* Port B read, IN1 */ | |
| 995 | NULL, /* Port C read */ | |
| 996 | NULL, /* Port A write */ | |
| 997 | NULL, /* Port B write */ | |
| 998 | NULL /* Port C write */ | |
| 999 | }, | |
| 1000 | { /* A, B & C set as input */ | |
| 1001 | DEVICE8_PORT("IN1"), /* Port A read, IN2 */ | |
| 1002 | DEVICE8_PORT("IN2"), /* Port B read, IN3 */ | |
| 1003 | NULL, /* Port C read */ | |
| 1004 | NULL, /* Port A write */ | |
| 1005 | NULL, /* Port B write */ | |
| 1006 | NULL /* Port C write */ | |
| 1007 | }, | |
| 1008 | { /* A set as input */ | |
| 1009 | DEVICE8_PORT("DSW1"), /* Port A read, DSW4 */ | |
| 1010 | NULL, /* Port B read */ | |
| 1011 | NULL, /* Port C read */ | |
| 1012 | NULL, /* Port A write */ | |
| 1013 | NULL, /* Port B write */ | |
| 1014 | NULL /* Port C write */ | |
| 1015 | } | |
| 1016 | }; | |
| 1017 | ||
| 589 | 1018 | static const ay8910_interface ay8910_config = |
| 590 | 1019 | { |
| 591 | 1020 | AY8910_LEGACY_OUTPUT, |
| r3957 | r3958 | |
| 701 | 1130 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)//all sound goes to the 'mono' speaker, at 1.0 X maximum |
| 702 | 1131 | MACHINE_DRIVER_END |
| 703 | 1132 | |
| 1133 | static PALETTE_INIT(cm) | |
| 1134 | { | |
| 1135 | int i; | |
| 1136 | for (i=0;i<0x100;i++) | |
| 1137 | { | |
| 1138 | int r,g,b; | |
| 1139 | UINT8 dat; | |
| 704 | 1140 | |
| 1141 | UINT8*proms = memory_region(machine, "proms"); | |
| 705 | 1142 | |
| 706 | ||
| 1143 | dat = proms[0x000+i] | | |
| 707 | 1144 | |
| 1145 | r = (dat & 0x07) << 5; | |
| 1146 | g = (dat & 0x38) << 2; | |
| 1147 | b = (dat & 0xc0) << 0; | |
| 1148 | ||
| 1149 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 1150 | ||
| 1151 | } | |
| 1152 | } | |
| 1153 | ||
| 1154 | static MACHINE_DRIVER_START( chryigld ) | |
| 1155 | ||
| 708 | 1156 | /* basic machine hardware */ |
| 709 | 1157 | MDRV_CPU_ADD("main", Z80, 3579545)//(4000000?) |
| 710 | MDRV_CPU_PROGRAM_MAP(goldstar_map,0) | |
| 711 | MDRV_CPU_IO_MAP(goldstar_readport,0) | |
| 1158 | MDRV_CPU_PROGRAM_MAP(ncb3_map,0) | |
| 1159 | MDRV_CPU_IO_MAP(ncb3_readwriteport,0) | |
| 712 | 1160 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 713 | 1161 | |
| 1162 | /* 3x 8255 */ | |
| 1163 | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] ) | |
| 1164 | MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] ) | |
| 1165 | MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] ) | |
| 1166 | ||
| 714 | 1167 | /* video hardware */ |
| 715 | 1168 | MDRV_SCREEN_ADD("main", RASTER) |
| 716 | 1169 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 721 | 1174 | |
| 722 | 1175 | MDRV_GFXDECODE(chry10) |
| 723 | 1176 | MDRV_PALETTE_LENGTH(256) |
| 1177 | MDRV_PALETTE_INIT(cm) | |
| 724 | 1178 | MDRV_NVRAM_HANDLER(goldstar) |
| 725 | 1179 | |
| 726 | 1180 | MDRV_VIDEO_START(goldstar) |
| 727 | 1181 | MDRV_VIDEO_UPDATE(goldstar) |
| 728 | 1182 | |
| 729 | 1183 | /* sound hardware */ |
| 730 | MDRV_SPEAKER_STANDARD_MONO("mono")//set up a standard mono speaker called 'mono' | |
| 731 | MDRV_SOUND_ADD("ay", AY8910,1500000)//1 AY8910, at clock 150000Hz | |
| 732 | MDRV_SOUND_CONFIG(ay8910_config)//read extra data from interface | |
| 733 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)//all sound goes to the 'mono' speaker, at 0.50 X maximum | |
| 1184 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 734 | 1185 | |
| 735 | MDRV_SOUND_ADD("oki", OKIM6295, 1056000)//clock | |
| 736 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified //"oki" | |
| 737 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)//all sound goes to the 'mono' speaker, at 1.0 X maximum | |
| 1186 | MDRV_SOUND_ADD("sn1", SN76489, 3000000) /* 3 MHz. */ | |
| 1187 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) | |
| 1188 | ||
| 1189 | MDRV_SOUND_ADD("ay", AY8910,1500000) | |
| 1190 | MDRV_SOUND_CONFIG(ay8910_config) | |
| 1191 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 738 | 1192 | MACHINE_DRIVER_END |
| 739 | 1193 | |
| 740 | 1194 | |
| r3957 | r3958 | |
| 745 | 1199 | /* basic machine hardware */ |
| 746 | 1200 | MDRV_CPU_ADD("main", Z80, 3579545)//(4000000?) |
| 747 | 1201 | MDRV_CPU_PROGRAM_MAP(ncb3_map,0) |
| 748 | MDRV_CPU_IO_MAP( | |
| 1202 | MDRV_CPU_IO_MAP(ncb3 | |
| 749 | 1203 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 750 | 1204 | |
| 1205 | /* 3x 8255 */ | |
| 1206 | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] ) | |
| 1207 | MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] ) | |
| 1208 | MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] ) | |
| 1209 | ||
| 751 | 1210 | /* video hardware */ |
| 752 | 1211 | MDRV_SCREEN_ADD("main", RASTER) |
| 753 | 1212 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 758 | 1217 | |
| 759 | 1218 | MDRV_GFXDECODE(ncb3) |
| 760 | 1219 | MDRV_PALETTE_LENGTH(256) |
| 1220 | // MDRV_PALETTE_INIT(cm) | |
| 1221 | ||
| 761 | 1222 | MDRV_NVRAM_HANDLER(goldstar) |
| 762 | 1223 | |
| 763 | 1224 | MDRV_VIDEO_START(goldstar) |
| r3957 | r3958 | |
| 765 | 1226 | |
| 766 | 1227 | /* sound hardware */ |
| 767 | 1228 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1229 | ||
| 1230 | MDRV_SOUND_ADD("sn1", SN76489, 3000000) /* 3 MHz. */ | |
| 1231 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) | |
| 1232 | ||
| 768 | 1233 | MDRV_SOUND_ADD("ay", AY8910,1500000) |
| 769 | 1234 | MDRV_SOUND_CONFIG(ay8910_config) |
| 770 | 1235 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 771 | 1236 | MACHINE_DRIVER_END |
| 772 | 1237 | |
| 773 | // wrong | |
| 774 | static PALETTE_INIT(cm) | |
| 775 | { | |
| 776 | int i; | |
| 777 | for (i=0;i<0x100;i++) | |
| 778 | { | |
| 779 | int r,g,b; | |
| 780 | UINT8 dat; | |
| 781 | 1238 | |
| 782 | ||
| 1239 | ||
| 783 | 1240 | |
| 784 | dat = proms[0x000+i] | (proms[0x100+i]<<4); | |
| 1241 | /* basic machine hardware */ | |
| 1242 | MDRV_CPU_ADD("main", Z80, 3579545)//(4000000?) | |
| 1243 | MDRV_CPU_PROGRAM_MAP(cm_map,0) | |
| 1244 | MDRV_CPU_IO_MAP(cm_portmap,0) | |
| 1245 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 785 | 1246 | |
| 786 | r = (dat & 0x07) << 5; | |
| 787 | g = (dat & 0x38) << 2; | |
| 788 | b = (dat & 0xc0) << 0; | |
| 1247 | /* video hardware */ | |
| 1248 | MDRV_SCREEN_ADD("main", RASTER) | |
| 1249 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1250 | // MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1251 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1252 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 1253 | MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) | |
| 789 | 1254 | |
| 790 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 1255 | MDRV_GFXDECODE(ncb3) | |
| 1256 | MDRV_PALETTE_LENGTH(256) | |
| 1257 | MDRV_PALETTE_INIT(cm) | |
| 1258 | // MDRV_NVRAM_HANDLER(goldstar) | |
| 791 | 1259 | |
| 792 | } | |
| 793 | } | |
| 794 | static MACHINE_DRIVER_START( cm ) | |
| 1260 | MDRV_VIDEO_START(cherrym) | |
| 1261 | MDRV_VIDEO_UPDATE(goldstar) | |
| 795 | 1262 | |
| 1263 | /* sound hardware */ | |
| 1264 | MDRV_SPEAKER_STANDARD_MONO("mono")//set up a standard mono speaker called 'mono' | |
| 1265 | MDRV_SOUND_ADD("ay", AY8910,1500000)//1 AY8910, at clock 150000Hz | |
| 1266 | MDRV_SOUND_CONFIG(ay8910_config)//read extra data from interface | |
| 1267 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)//all sound goes to the 'mono' speaker, at 0.50 X maximum | |
| 1268 | ||
| 1269 | MDRV_SOUND_ADD("oki", OKIM6295, 1056000)//clock | |
| 1270 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified //"oki" | |
| 1271 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)//all sound goes to the 'mono' speaker, at 1.0 X maximum | |
| 1272 | MACHINE_DRIVER_END | |
| 1273 | ||
| 1274 | static MACHINE_DRIVER_START( cmb ) | |
| 1275 | ||
| 796 | 1276 | /* basic machine hardware */ |
| 797 | 1277 | MDRV_CPU_ADD("main", Z80, 3579545)//(4000000?) |
| 798 | 1278 | MDRV_CPU_PROGRAM_MAP(cm_map,0) |
| r3957 | r3958 | |
| 807 | 1287 | MDRV_SCREEN_SIZE(64*8, 32*8) |
| 808 | 1288 | MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) |
| 809 | 1289 | |
| 810 | MDRV_GFXDECODE( | |
| 1290 | MDRV_GFXDECODE( | |
| 811 | 1291 | MDRV_PALETTE_LENGTH(256) |
| 812 | 1292 | MDRV_PALETTE_INIT(cm) |
| 813 | 1293 | // MDRV_NVRAM_HANDLER(goldstar) |
| 814 | 1294 | |
| 815 | MDRV_VIDEO_START(goldstar) | |
| 816 | MDRV_VIDEO_UPDATE(cherrym) | |
| 1295 | MDRV_VIDEO_START(cherrym) | |
| 1296 | MDRV_VIDEO_UPDATE(goldstar) | |
| 817 | 1297 | |
| 818 | 1298 | /* sound hardware */ |
| 819 | 1299 | MDRV_SPEAKER_STANDARD_MONO("mono")//set up a standard mono speaker called 'mono' |
| r3957 | r3958 | |
| 827 | 1307 | MACHINE_DRIVER_END |
| 828 | 1308 | |
| 829 | 1309 | |
| 1310 | static MACHINE_DRIVER_START( lucky8 ) | |
| 1311 | ||
| 1312 | /* basic machine hardware */ | |
| 1313 | MDRV_CPU_ADD("main", Z80, 12000000/3) // ?? Mhz | |
| 1314 | MDRV_CPU_PROGRAM_MAP(lucky8_map,0) | |
| 1315 | //MDRV_CPU_IO_MAP(goldstar_readport,0) | |
| 1316 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) | |
| 1317 | ||
| 1318 | /* video hardware */ | |
| 1319 | MDRV_SCREEN_ADD("main", RASTER) | |
| 1320 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 1321 | // MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1322 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1323 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 1324 | MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) | |
| 1325 | ||
| 1326 | MDRV_GFXDECODE(ncb3) | |
| 1327 | MDRV_PALETTE_LENGTH(256) | |
| 1328 | MDRV_NVRAM_HANDLER(goldstar) | |
| 1329 | ||
| 1330 | MDRV_VIDEO_START(goldstar) | |
| 1331 | MDRV_VIDEO_UPDATE(goldstar) | |
| 1332 | ||
| 1333 | /* sound hardware */ | |
| 1334 | MDRV_SPEAKER_STANDARD_MONO("mono")//set up a standard mono speaker called 'mono' | |
| 1335 | MDRV_SOUND_ADD("ay", AY8910,1500000)//1 AY8910, at clock 150000Hz | |
| 1336 | MDRV_SOUND_CONFIG(ay8910_config)//read extra data from interface | |
| 1337 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)//all sound goes to the 'mono' speaker, at 0.50 X maximum | |
| 1338 | MACHINE_DRIVER_END | |
| 1339 | ||
| 1340 | ||
| 1341 | ||
| 830 | 1342 | /*************************************************************************** |
| 831 | 1343 | |
| 832 | 1344 | Game driver(s) |
| r3957 | r3958 | |
| 891 | 1403 | 1x ispLSI1024-60LJ (pl3)(read protected) |
| 892 | 1404 | 3x PALCE16V8H (pl4,pl6,pl7)(read protected) |
| 893 | 1405 | 1x PEEL22CV10 (pl5)(read protected) |
| 1406 | ||
| 894 | 1407 | Note |
| 895 | 1408 | |
| 896 | 1409 | 1x 36x2 edge connector |
| r3957 | r3958 | |
| 950 | 1463 | ROM_REGION( 0x08000, "gfx2", ROMREGION_DISPOSE ) |
| 951 | 1464 | ROM_LOAD( "1.u3", 0x00000, 0x08000, CRC(32b46e5c) SHA1(49e59589188324e15ec2b8157839423faea9833f) ) |
| 952 | 1465 | |
| 953 | ROM_REGION( 0x0200, "prom", ROMREGION_DISPOSE ) | |
| 1466 | ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE ) | |
| 954 | 1467 | ROM_LOAD( "82s147.u2", 0x00000, 0x0200, CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) ) |
| 955 | 1468 | |
| 956 | 1469 | ROM_REGION( 0x02e5, "palgal", ROMREGION_DISPOSE ) |
| r3957 | r3958 | |
| 960 | 1473 | ROM_LOAD( "gal22v10b.pl5.bad.dump", 0x00000, 0x02e5, BAD_DUMP CRC(996854bc) SHA1(647d2f49b739f7ca55c0b85290b6a21256834fd8) ) |
| 961 | 1474 | ROM_LOAD( "palce16v8h.pl6.bad.dump", 0x00000, 0x0117, BAD_DUMP CRC(7e3d99d8) SHA1(983e10eba11e4aeab5103ae644a8e6181d9b27a9) ) |
| 962 | 1475 | ROM_LOAD( "palce16v8h.pl7.bad.dump", 0x00000, 0x0117, BAD_DUMP CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) |
| 963 | ||
| 964 | ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 ) | |
| 965 | /* no oki on this pcb .. */ | |
| 966 | 1476 | ROM_END |
| 967 | 1477 | |
| 968 | 1478 | |
| r3957 | r3958 | |
| 977 | 1487 | ROM_REGION( 0x08000, "gfx2", ROMREGION_DISPOSE ) |
| 978 | 1488 | ROM_LOAD( "1.u3", 0x00000, 0x08000, CRC(32b46e5c) SHA1(49e59589188324e15ec2b8157839423faea9833f) ) |
| 979 | 1489 | |
| 980 | ROM_REGION( 0x0200, "prom", ROMREGION_DISPOSE ) | |
| 1490 | ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE ) | |
| 981 | 1491 | ROM_LOAD( "82s147.u2", 0x00000, 0x0200, CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) ) |
| 982 | 1492 | |
| 983 | 1493 | ROM_REGION( 0x02dd, "palgal", ROMREGION_DISPOSE ) |
| r3957 | r3958 | |
| 987 | 1497 | ROM_LOAD( "peel22cv10a.pl5.bad.dump",0x00000, 0x02dd, BAD_DUMP CRC(8e6075d9) SHA1(f2c1b6497a4d9e873d36b89771c135a2cd91d05f) ) |
| 988 | 1498 | ROM_LOAD( "palce16v8h.pl6.bad.dump", 0x00000, 0x0117, BAD_DUMP CRC(7e3d99d8) SHA1(983e10eba11e4aeab5103ae644a8e6181d9b27a9) ) |
| 989 | 1499 | ROM_LOAD( "palce16v8h.pl7.bad.dump", 0x00000, 0x0117, BAD_DUMP CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) |
| 990 | ||
| 991 | ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 ) | |
| 992 | /* no oki on this pcb .. */ | |
| 993 | 1500 | ROM_END |
| 994 | 1501 | |
| 995 | 1502 | |
| 996 | ||
| 997 | 1503 | ROM_START( moonlght ) |
| 998 | 1504 | ROM_REGION( 0x20000, "main", 0 ) |
| 999 | 1505 | ROM_LOAD( "4.bin", 0x0000, 0x20000, CRC(ecb06cfb) SHA1(e32613cac5583a0fecf04fca98796b91698e530c) ) |
| r3957 | r3958 | |
| 1009 | 1515 | ROM_END |
| 1010 | 1516 | |
| 1011 | 1517 | |
| 1518 | ||
| 1012 | 1519 | ROM_START( ncb3 ) |
| 1013 | 1520 | ROM_REGION( 0x10000, "main", 0 ) |
| 1014 | 1521 | ROM_LOAD( "8.512", 0x00000, 0x10000, CRC(1f669cd0) SHA1(fd394119e33c017507fde87a710577e37dcdec07) ) |
| r3957 | r3958 | |
| 1025 | 1532 | ROM_LOAD( "6.764", 0x04000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) ) |
| 1026 | 1533 | ROM_LOAD( "7.764", 0x06000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) ) |
| 1027 | 1534 | |
| 1028 | ROM_REGION( 0x0200, "prom", ROMREGION_DISPOSE ) | |
| 1029 | /* prom missing? */ | |
| 1535 | ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE ) | |
| 1536 | ROM_LOAD( "colour_proms", 0x000, 0x200, NO_DUMP ) | |
| 1030 | 1537 | |
| 1031 | 1538 | ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 ) |
| 1032 | 1539 | /* no oki on this pcb? */ |
| r3957 | r3958 | |
| 1061 | 1568 | ROM_LOAD( "6.764", 0x04000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) ) |
| 1062 | 1569 | ROM_LOAD( "7.764", 0x06000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) ) |
| 1063 | 1570 | |
| 1064 | ROM_REGION( 0x0200, "prom", ROMREGION_DISPOSE ) | |
| 1065 | /* prom missing? */ | |
| 1571 | ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE ) | |
| 1572 | ROM_LOAD( "colour_proms", 0x000, 0x200, NO_DUMP ) | |
| 1066 | 1573 | |
| 1067 | 1574 | ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 ) |
| 1068 | 1575 | /* no oki on this pcb? */ |
| r3957 | r3958 | |
| 1080 | 1587 | ROM_LOAD( "m7.256", 0x10000, 0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) ) |
| 1081 | 1588 | |
| 1082 | 1589 | ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) |
| 1083 | ROM_LOAD( "m1.64", 0x0000, 0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) ) | |
| 1084 | ROM_LOAD( "m2.64", 0x2000, 0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) ) | |
| 1085 | ROM_LOAD( "m3.64", 0x4000, 0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) ) | |
| 1086 | ROM_LOAD( "m4.64", 0x6000, 0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) ) | |
| 1590 | ROM_LOAD( "m3.64", 0x0000, 0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) ) | |
| 1591 | ROM_LOAD( "m4.64", 0x2000, 0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) ) | |
| 1592 | ROM_LOAD( "m1.64", 0x4000, 0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) ) | |
| 1593 | ROM_LOAD( "m2.64", 0x6000, 0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) ) | |
| 1087 | 1594 | |
| 1088 | 1595 | ROM_REGION( 0x200, "proms", 0 ) // pal |
| 1089 | 1596 | ROM_LOAD( "prom2.287", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) ) |
| r3957 | r3958 | |
| 1119 | 1626 | ROM_LOAD( "p4.bin", 0x0300, 0x0100, CRC(72212427) SHA1(e87a91f28284313c706ebb8175a3586780636e31) ) |
| 1120 | 1627 | ROM_END |
| 1121 | 1628 | |
| 1629 | ROM_START( cmasterb ) | |
| 1630 | ROM_REGION( 0x10000, "main", 0 ) | |
| 1631 | ROM_LOAD( "3.bin", 0x00000, 0x10000, CRC(ccb64229) SHA1(532f4b59952702a3609ff20239acbbacaf71f38f) ) | |
| 1122 | 1632 | |
| 1633 | ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE ) | |
| 1634 | ROM_LOAD( "6.bin", 0x00000, 0x10000, CRC(a98d610f) SHA1(d14b3bc8bd6dc9fe2d3fb05ec08224b1a9d52bee) ) | |
| 1635 | ROM_LOAD( "7.bin", 0x10000, 0x10000, CRC(a0ffd2d6) SHA1(e78d20d3ab578ccc880bc19678782cb1f8d3671e) ) | |
| 1636 | ROM_LOAD( "8.bin", 0x20000, 0x10000, CRC(4f67fca7) SHA1(808e84b9b1f67f137528bb76b0e8aac3dceba20c) ) | |
| 1123 | 1637 | |
| 1638 | ROM_REGION( 0x50000, "gfx2", ROMREGION_DISPOSE ) | |
| 1639 | ROM_LOAD( "9.bin", 0x00000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) ) | |
| 1640 | ROM_LOAD( "1.bin", 0x10000, 0x10000, CRC(634fe2ad) SHA1(2284a09446c8928060270861d372a19c0c9d827a) ) | |
| 1641 | ROM_LOAD( "2.bin", 0x20000, 0x10000, CRC(a3d59f79) SHA1(588c45550cca673390a35af9617c68c853ff84ba) ) | |
| 1642 | ROM_LOAD( "4.bin", 0x30000, 0x10000, CRC(52240e0f) SHA1(7b8375e1f91fdff2b4ccc2e81fbcf843f7ede292) ) | |
| 1643 | ROM_LOAD( "5.bin", 0x40000, 0x10000, CRC(763973c1) SHA1(b364f22041f1d678332554edb3c718cf0ad778b4) ) | |
| 1644 | ||
| 1645 | ROM_REGION( 0x400, "proms", 0 ) // from cmaster | |
| 1646 | ROM_LOAD( "p1.bin", 0x0000, 0x0100, CRC(ac529f04) SHA1(5bc92e50c85bb23e609172cc15c430ddea7fdcb5) ) | |
| 1647 | ROM_LOAD( "p2.bin", 0x0100, 0x0100, CRC(3febce95) SHA1(c7c0fec0fb024ebf7d7365a09d28ba3d0037b0b4) ) | |
| 1648 | ROM_LOAD( "p3.bin", 0x0200, 0x0100, CRC(99dbdf19) SHA1(3680335406f63289f8d9a81b4cd163e4aa0c14d4) ) | |
| 1649 | ROM_LOAD( "p4.bin", 0x0300, 0x0100, CRC(72212427) SHA1(e87a91f28284313c706ebb8175a3586780636e31) ) | |
| 1650 | ROM_END | |
| 1651 | ||
| 1652 | /* | |
| 1653 | ||
| 1654 | Lucky 8 Line | |
| 1655 | Falcon 1989 | |
| 1656 | ||
| 1657 | G14 6116 9 | |
| 1658 | G13 D13 8 | |
| 1659 | D12 | |
| 1660 | 6116 Z80 | |
| 1661 | 6116 8255 | |
| 1662 | 7 8255 | |
| 1663 | 6 SW1 8255 | |
| 1664 | 12MHz 5 SW2 8910 | |
| 1665 | 4 6116 SW4 | |
| 1666 | 3 6116 SW3 | |
| 1667 | 2 6116 | |
| 1668 | 1 6116 | |
| 1669 | ||
| 1670 | --- | |
| 1671 | ||
| 1672 | */ | |
| 1673 | ||
| 1674 | ROM_START( lucky8 ) | |
| 1675 | ROM_REGION( 0x8000, "main", 0 ) | |
| 1676 | ROM_LOAD( "8", 0x0000, 0x4000, CRC(a187573e) SHA1(864627502025dbc83a0049fc98505655cec7b181) ) | |
| 1677 | ROM_LOAD( "9", 0x4000, 0x4000, CRC(6f62672e) SHA1(05662ef1a70f93b09e48de497b049a282f070735) ) | |
| 1678 | ||
| 1679 | ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE ) | |
| 1680 | ROM_LOAD( "5", 0x00000, 0x8000, CRC(59026af3) SHA1(3d7f7e78968ca26275635aeaa0e994468a3da575) ) | |
| 1681 | ROM_LOAD( "6", 0x08000, 0x8000, CRC(67a073c1) SHA1(36194d57d0dc0601fa1fdf2e6806f11b2ea6da36) ) | |
| 1682 | ROM_LOAD( "7", 0x10000, 0x8000, CRC(c415b9d0) SHA1(fd558fe8a116c33bbd712a639224d041447a45c1) ) | |
| 1683 | ||
| 1684 | ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) | |
| 1685 | ROM_LOAD( "3", 0x0000, 0x2000, CRC(898b9ed5) SHA1(11b7d1cfcf425d00d086c74e0dbcb72068dda9fe) ) | |
| 1686 | ROM_LOAD( "4", 0x2000, 0x2000, CRC(4f7cfb35) SHA1(0617cf4419be00d9bacc78724089cb8af4104d68) ) | |
| 1687 | ROM_LOAD( "1", 0x4000, 0x2000, CRC(29d6f197) SHA1(1542ca457594f6b7fe8f28f7d78023edd7021bc8) ) | |
| 1688 | ROM_LOAD( "2", 0x6000, 0x2000, CRC(5f812e65) SHA1(70d9ea82f9337936bf21f82b6961768d436f3a6f) ) | |
| 1689 | ||
| 1690 | ROM_REGION( 0x200, "proms", 0 ) | |
| 1691 | ROM_LOAD( "d12", 0x0100, 0x0100, CRC(23e81049) SHA1(78071dae70fad870e972d944642fb3a2374be5e4) ) | |
| 1692 | ROM_LOAD( "g14", 0x0000, 0x0100, CRC(bd48de71) SHA1(e4fa1e774af1499bc568be5b2deabb859d8c8172) ) | |
| 1693 | ||
| 1694 | ROM_REGION( 0x40, "proms2", 0 ) | |
| 1695 | ROM_LOAD( "d13", 0x0000, 0x0020, CRC(c6b41352) SHA1(d7c3b5aa32e4e456c9432a13bede1db6d62eb270) ) | |
| 1696 | ROM_LOAD( "g13", 0x0020, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) ) | |
| 1697 | ROM_END | |
| 1698 | ||
| 1699 | ||
| 1124 | 1700 | static DRIVER_INIT(goldstar) |
| 1125 | 1701 | { |
| 1126 | 1702 | int A; |
| r3957 | r3958 | |
| 1152 | 1728 | 0x1800, 0x3000, 0x6800, 0x7000, |
| 1153 | 1729 | 0x0000, 0x4800, 0x2000, 0x5000, |
| 1154 | 1730 | 0x1000, 0x7800, 0x6000, 0x3800, |
| 1155 | /* bit below, I'm not sure, no match */ | |
| 1731 | /* bit below, I'm not sure, no exact match, but only the first ones matter? */ | |
| 1156 | 1732 | 0xc000, 0xc800, 0xd000, 0xd800, |
| 1157 | 1733 | 0xe000, 0xe800, 0xf000, 0xf800, |
| 1158 | 1734 | 0x8000, 0x8800, 0x9000, 0x9800, |
| r3957 | r3958 | |
| 1193 | 1769 | } |
| 1194 | 1770 | |
| 1195 | 1771 | |
| 1196 | GAME( 199?, goldstar, 0, goldstar, goldstar, goldstar, ROT0, "IGS", "Golden Star", 0 ) | |
| 1197 | GAME( 199?, goldstbl, goldstar, goldstbl, goldstar, 0, ROT0, "IGS", "Golden Star (Blue version)", 0 ) | |
| 1198 | GAME( 199?, moonlght, goldstar, moonlght, goldstar, 0, ROT0, "bootleg", "Moon Light (bootleg of Golden Star)", 0 ) | |
| 1199 | GAME( 199?, chry10, goldstar, chry10, goldstar, chry10, ROT0, "bootleg", "Cherry 10 (bootleg of Golden Star)", GAME_NOT_WORKING ) | |
| 1200 | GAME( 199?, chryigld, goldstar, chry10, goldstar, chryigld, ROT0, "bootleg", "Cherry I Gold (bootleg of Golden Star)", GAME_NOT_WORKING ) | |
| 1772 | /********************************************* | |
| 1773 | * Game Drivers * | |
| 1774 | ********************************************** | |
| 1201 | 1775 | |
| 1776 | YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ | |
| 1777 | GAME( 199?, goldstar, 0, goldstar, goldstar, goldstar, ROT0, "IGS", "Golden Star", 0 ) | |
| 1778 | GAME( 199?, goldstbl, goldstar, goldstbl, goldstar, 0, ROT0, "IGS", "Golden Star (Blue version)", 0 ) | |
| 1779 | GAME( 199?, moonlght, goldstar, moonlght, goldstar, 0, ROT0, "bootleg", "Moon Light (bootleg of Golden Star)", 0 ) | |
| 1780 | GAME( 199?, chryigld, goldstar, chryigld, chryigld, chryigld, ROT0, "bootleg", "Cherry I Gold (bootleg of Golden Star)", 0 ) | |
| 1781 | GAME( 199?, chry10, goldstar, chryigld, goldstar, chry10, ROT0, "bootleg", "Cherry 10 (bootleg of Golden Star)", GAME_NOT_WORKING ) | |
| 1782 | ||
| 1202 | 1783 | // are these really dyna, or bootlegs? |
| 1203 | GAME( 19??, ncb3, goldstar, ncb3, goldstar, 0, ROT0, "Dyna", "(New?) Cherry Bonus III", GAME_NOT_WORKING | GAME_NO_SOUND ) // set was labeled 'new cherry bonus 3' but there is no 'new' in the gfx roms | |
| 1204 | GAME( 19??, cb3, goldstar, ncb3, goldstar, 0, ROT0, "Dyna", "Cherry Bonus III", GAME_NOT_WORKING | GAME_NO_SOUND ) | |
| 1784 | GAME( 19??, ncb3, goldstar, ncb3, ncb3, 0, ROT0, "Dyna", "Cherry Bonus III (Version 1.40)", GAME_NOT_WORKING | GAME_WRONG_COLORS ) // set was labeled 'new cherry bonus 3' but there is no 'new' in the gfx roms | |
| 1785 | GAME( 19??, cb3, goldstar, ncb3, goldstar, 0, ROT0, "Dyna", "Cherry Bonus III", GAME_NOT_WORKING | GAME_WRONG_COLORS | GAME_NO_SOUND ) | |
| 1205 | 1786 | |
| 1206 | 1787 | // cherry master hardware has a rather different mem map, but is basically the same |
| 1207 | GAME( 198?, cmv801, 0, cm, cmv801, 0, ROT0, "Corsica", "Cherry Master (Corsica, v8.01)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING ) // says ED-96 where the manufacturer is on some games.. | |
| 1208 | GAME( 1991, cmaster, 0, cm, cmv801, 0, ROT0, "Dyna", "Cherry Master 91?", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING ) // different HW? closer to cherry master 2? | |
| 1788 | GAME( 198?, cmv801, 0, cm, cmv801, 0, ROT0, "Corsica", "Cherry Master (Corsica, v8.01)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING ) // says ED-96 where the manufacturer is on some games.. | |
| 1789 | GAME( 1991, cmaster, 0, cm, cmv801, 0, ROT0, "Dyna", "Cherry Master 91?", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING ) // different HW? closer to cherry master 2? | |
| 1790 | GAME( 1991, cmasterb, cmaster, cmb, cmv801, 0, ROT0, "Dyna", "Cherry Master I (v1.01)", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING ) | |
| 1791 | GAME( 1989, lucky8, 0, lucky8, goldstar, 0, ROT0, "Wing Co.Ltd", "New Lucky 8 Lines", GAME_NOT_WORKING ) |
| r3957 | r3958 | |
|---|---|---|
| 170 | 170 | *******************************************************************************************/ |
| 171 | 171 | |
| 172 | 172 | #include "driver.h" |
| 173 | #include "cpu/z80/z80.h" | |
| 174 | #include "cpu/m68000/m68000.h" | |
| 173 | 175 | #include "deprecat.h" |
| 174 | 176 | #include "sound/3812intf.h" |
| 175 | 177 | |
| r3957 | r3958 | |
| 572 | 574 | MDRV_CPU_ADD("audio", Z80,3579500) |
| 573 | 575 | MDRV_CPU_PROGRAM_MAP(sound_mem,0) |
| 574 | 576 | |
| 575 | MDRV_ | |
| 577 | MDRV_QUANTUM_TIME | |
| 576 | 578 | |
| 577 | 579 | /* video hardware */ |
| 578 | 580 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | #include "driver.h" |
| 122 | #include "cpu/m68000/m68000.h" | |
| 123 | #include "cpu/m6502/m6502.h" | |
| 122 | 124 | #include "machine/atarigen.h" |
| 123 | 125 | #include "sound/5220intf.h" |
| 124 | 126 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 1628 | 1630 | { |
| 1629 | 1631 | UINT8 *rom = memory_region(machine, "main"); |
| 1630 | 1632 | atarigen_eeprom_default = NULL; |
| 1631 | atarigen_slapstic_init(machine | |
| 1633 | atarigen_slapstic_init(machine->cpu[0], 0x038000, 0, slapstic); | |
| 1632 | 1634 | |
| 1633 | 1635 | /* swap the top and bottom halves of the main CPU ROM images */ |
| 1634 | 1636 | atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000); |
| r3957 | r3958 | |
|---|---|---|
| 168 | 168 | /********** BITS & PIECES **********/ |
| 169 | 169 | |
| 170 | 170 | #include "driver.h" |
| 171 | #include "cpu/z80/z80.h" | |
| 172 | #include "cpu/v60/v60.h" | |
| 171 | 173 | #include "deprecat.h" |
| 172 | 174 | #include "sound/ymf271.h" |
| 173 | 175 | #include "includes/ms32.h" |
| r3957 | r3958 | |
| 1214 | 1216 | MDRV_CPU_ADD("audio", Z80, 4000000) |
| 1215 | 1217 | MDRV_CPU_PROGRAM_MAP(ms32_snd_readmem, ms32_snd_writemem) |
| 1216 | 1218 | |
| 1217 | MDRV_ | |
| 1219 | MDRV_QUANTUM_TIME | |
| 1218 | 1220 | |
| 1219 | 1221 | MDRV_MACHINE_RESET(ms32) |
| 1220 | 1222 |
| r3957 | r3958 | |
|---|---|---|
| 434 | 434 | memory_configure_bank(machine, 1, 0, 8, &rom[0x01000], 0x10000); |
| 435 | 435 | |
| 436 | 436 | memory_set_bank(machine, 1,0); |
| 437 | c | |
| 437 | device | |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | } |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | /************************************************************************************************************* |
| 2 | 2 | |
| 3 | Sky Lancer | |
| 3 | Sky Lancer / Mad Zoo | |
| 4 | 4 | |
| 5 | preliminary driver by Luca Elia | |
| 5 | Original preliminary driver by Luca Elia. | |
| 6 | Additional Work: Roberto Fresca & David Haywood. | |
| 6 | 7 | |
| 7 | compare with carrera.c & cherrym2.c | |
| 8 | 8 | |
| 9 | ************************************************************************************************************** | |
| 10 | ||
| 11 | Notes: | |
| 12 | ||
| 13 | - Some of the tiles look badly scaled down, and others appear to have columns swapped. | |
| 14 | This might actually be correct. | |
| 15 | ||
| 16 | - Skylncr and madzoo can run with the same program roms, they're basically graphics swaps. | |
| 17 | ||
| 18 | - To enter the Service Mode, press F2. All the game settings are there. | |
| 19 | Change regular values using DIP switches, and jackpot value using STOP2 and STOP3. | |
| 20 | To exit the mode, press START. You must reset the machine (F3) to update the changes. | |
| 21 | ||
| 22 | - Press key 0 to navigate between statistics pages. Press START to exit the mode. | |
| 23 | ||
| 24 | ||
| 25 | TODO: | |
| 26 | ||
| 27 | - Hook the PPI 8255 devices and rework the I/O based on them. | |
| 28 | - Proper M5M82C255 emulation. | |
| 29 | ||
| 30 | ||
| 9 | 31 | *************************************************************************************************************/ |
| 10 | 32 | |
| 33 | ||
| 34 | #define MASTER_CLOCK XTAL_12MHz /* confirmed */ | |
| 35 | ||
| 11 | 36 | #include "driver.h" |
| 37 | #include "cpu/z80/z80.h" | |
| 12 | 38 | #include "sound/ay8910.h" |
| 13 | 39 | |
| 14 | static tilemap *tmap | |
| 40 | static tilemap *tmap | |
| 15 | 41 | |
| 16 | 42 | static UINT8 *skylncr_videoram,*skylncr_colorram; |
| 17 | static UINT8 *skylncr_videoram2,*skylncr_colorram2; | |
| 18 | 43 | |
| 44 | static UINT8* reeltiles_1_ram; | |
| 45 | static UINT8* reeltiles_2_ram; | |
| 46 | static UINT8* reeltiles_3_ram; | |
| 47 | static UINT8* reeltiles_4_ram; | |
| 48 | static UINT8* reeltileshigh_1_ram; | |
| 49 | static UINT8* reeltileshigh_2_ram; | |
| 50 | static UINT8* reeltileshigh_3_ram; | |
| 51 | static UINT8* reeltileshigh_4_ram; | |
| 52 | static tilemap *reel_1_tilemap; | |
| 53 | static tilemap *reel_2_tilemap; | |
| 54 | static tilemap *reel_3_tilemap; | |
| 55 | static tilemap *reel_4_tilemap; | |
| 56 | static UINT8* reelscroll1; | |
| 57 | static UINT8* reelscroll2; | |
| 58 | static UINT8* reelscroll3; | |
| 59 | static UINT8* reelscroll4; | |
| 60 | ||
| 61 | ||
| 19 | 62 | static WRITE8_HANDLER( skylncr_videoram_w ) |
| 20 | 63 | { |
| 21 | 64 | skylncr_videoram[offset] = data; |
| r3957 | r3958 | |
| 28 | 71 | tilemap_mark_tile_dirty(tmap, offset); |
| 29 | 72 | } |
| 30 | 73 | |
| 74 | ||
| 31 | 75 | static TILE_GET_INFO( get_tile_info ) |
| 32 | 76 | { |
| 33 | 77 | UINT16 code = skylncr_videoram[ tile_index ] + (skylncr_colorram[ tile_index ] << 8); |
| 34 | 78 | SET_TILE_INFO(0, code, 0, TILE_FLIPYX( 0 )); |
| 35 | 79 | } |
| 36 | 80 | |
| 37 | ||
| 38 | static WRITE8_HANDLER( skylncr_videoram2_w ) | |
| 81 | static TILE_GET_INFO( get_reel_1_tile_info ) | |
| 39 | 82 | { |
| 40 | skylncr_videoram2[offset] = data; | |
| 41 | tilemap_mark_tile_dirty(tmap2, offset); | |
| 83 | UINT16 code = reeltiles_1_ram[ tile_index ] + (reeltileshigh_1_ram[ tile_index ] << 8); | |
| 84 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); | |
| 42 | 85 | } |
| 43 | 86 | |
| 44 | static | |
| 87 | static | |
| 45 | 88 | { |
| 46 | skylncr_colorram2[offset] = data; | |
| 47 | tilemap_mark_tile_dirty(tmap2, offset); | |
| 89 | UINT16 code = reeltiles_2_ram[ tile_index ] + (reeltileshigh_2_ram[ tile_index ] << 8); | |
| 90 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); | |
| 48 | 91 | } |
| 49 | 92 | |
| 50 | static TILE_GET_INFO( get_tile_info | |
| 93 | static TILE_GET_INFO( get_reel_3_tile_info | |
| 51 | 94 | { |
| 52 | UINT16 code = | |
| 95 | UINT16 code = | |
| 53 | 96 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 54 | 97 | } |
| 55 | 98 | |
| 56 | #define TILES_PER_PAGE_X (0x40) | |
| 57 | #define TILES_PER_PAGE_Y (0x8) | |
| 58 | #define PAGES_PER_TMAP_X (0x2) | |
| 59 | #define PAGES_PER_TMAP_Y (0x2) | |
| 60 | ||
| 61 | static TILEMAP_MAPPER( skylncr_tilemap_scan_pages ) | |
| 99 | static TILE_GET_INFO( get_reel_4_tile_info ) | |
| 62 | 100 | { |
| 63 | return (col / TILES_PER_PAGE_X) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y + | |
| 64 | (col % TILES_PER_PAGE_X) + | |
| 65 | ||
| 66 | (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * PAGES_PER_TMAP_X + | |
| 67 | (row % TILES_PER_PAGE_Y) * TILES_PER_PAGE_X; | |
| 101 | UINT16 code = reeltiles_4_ram[ tile_index ] + (reeltileshigh_4_ram[ tile_index ] << 8); | |
| 102 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); | |
| 68 | 103 | } |
| 69 | 104 | |
| 105 | ||
| 70 | 106 | static VIDEO_START( skylncr ) |
| 71 | 107 | { |
| 72 | 108 | |
| 73 | 109 | tmap = tilemap_create( machine, get_tile_info, tilemap_scan_rows, |
| 74 | 110 | 8,8, 0x40,0x20 ); |
| 75 | 111 | |
| 76 | tmap2 = tilemap_create( machine, get_tile_info2, skylncr_tilemap_scan_pages, | |
| 77 | 8,32, | |
| 78 | TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y ); | |
| 112 | reel_1_tilemap = tilemap_create(machine, get_reel_1_tile_info, tilemap_scan_rows, 8,32, 64,8 ); | |
| 113 | reel_2_tilemap = tilemap_create(machine, get_reel_2_tile_info, tilemap_scan_rows, 8,32, 64,8 ); | |
| 114 | reel_3_tilemap = tilemap_create(machine, get_reel_3_tile_info, tilemap_scan_rows, 8,32, 64,8 ); | |
| 115 | reel_4_tilemap = tilemap_create(machine, get_reel_4_tile_info, tilemap_scan_rows, 8,32, 64,8 ); | |
| 79 | 116 | |
| 80 | tilemap_set_transparent_pen(tmap, 0); | |
| 81 | tilemap_set_transparent_pen(tmap2, 0); | |
| 117 | tilemap_set_scroll_cols(reel_2_tilemap, 0x40); | |
| 118 | tilemap_set_scroll_cols(reel_3_tilemap, 0x40); | |
| 119 | tilemap_set_scroll_cols(reel_4_tilemap, 0x40); | |
| 120 | ||
| 121 | tilemap_set_transparent_pen(reel_2_tilemap, 0); | |
| 122 | tilemap_set_transparent_pen(reel_3_tilemap, 0); | |
| 123 | tilemap_set_transparent_pen(reel_4_tilemap, 0); | |
| 124 | ||
| 125 | ||
| 126 | tilemap_set_transparent_pen(tmap, 0); | |
| 82 | 127 | } |
| 83 | 128 | |
| 129 | // are these hardcoded, or registers? | |
| 130 | static const rectangle visible1 = { 0*8, (14+48)*8-1, 4*8, (4+7)*8-1 }; | |
| 131 | static const rectangle visible2 = { 0*8, (14+48)*8-1, 12*8, (12+7)*8-1 }; | |
| 132 | static const rectangle visible3 = { 0*8, (14+48)*8-1, 20*8, (20+7)*8-1 }; | |
| 133 | ||
| 134 | ||
| 84 | 135 | static VIDEO_UPDATE( skylncr ) |
| 85 | 136 | { |
| 137 | int i; | |
| 138 | ||
| 86 | 139 | bitmap_fill(bitmap,cliprect,0); |
| 87 | tilemap_draw(bitmap,cliprect, tmap2, 0, 0); | |
| 140 | tilemap_draw(bitmap,cliprect, reel_1_tilemap, 0, 0); | |
| 141 | ||
| 142 | for (i= 0;i < 64;i++) | |
| 143 | { | |
| 144 | tilemap_set_scrolly(reel_2_tilemap, i, reelscroll2[i]); | |
| 145 | tilemap_set_scrolly(reel_3_tilemap, i, reelscroll3[i]); | |
| 146 | tilemap_set_scrolly(reel_4_tilemap, i, reelscroll4[i]); | |
| 147 | } | |
| 148 | ||
| 149 | tilemap_draw(bitmap,&visible1,reel_2_tilemap,0,0); | |
| 150 | tilemap_draw(bitmap,&visible2,reel_3_tilemap,0,0); | |
| 151 | tilemap_draw(bitmap,&visible3,reel_4_tilemap,0,0); | |
| 152 | ||
| 153 | ||
| 88 | 154 | tilemap_draw(bitmap,cliprect, tmap, 0, 0); |
| 89 | 155 | return 0; |
| 90 | 156 | } |
| 91 | 157 | |
| 158 | WRITE8_HANDLER( reeltiles_1_w ) | |
| 159 | { | |
| 160 | reeltiles_1_ram[offset] = data; | |
| 161 | tilemap_mark_tile_dirty(reel_1_tilemap, offset); | |
| 162 | } | |
| 163 | ||
| 164 | WRITE8_HANDLER( reeltiles_2_w ) | |
| 165 | { | |
| 166 | reeltiles_2_ram[offset] = data; | |
| 167 | tilemap_mark_tile_dirty(reel_2_tilemap, offset); | |
| 168 | } | |
| 169 | ||
| 170 | WRITE8_HANDLER( reeltiles_3_w ) | |
| 171 | { | |
| 172 | reeltiles_3_ram[offset] = data; | |
| 173 | tilemap_mark_tile_dirty(reel_3_tilemap, offset); | |
| 174 | } | |
| 175 | ||
| 176 | WRITE8_HANDLER( reeltiles_4_w ) | |
| 177 | { | |
| 178 | reeltiles_4_ram[offset] = data; | |
| 179 | tilemap_mark_tile_dirty(reel_4_tilemap, offset); | |
| 180 | } | |
| 181 | ||
| 182 | WRITE8_HANDLER( reeltileshigh_1_w ) | |
| 183 | { | |
| 184 | reeltileshigh_1_ram[offset] = data; | |
| 185 | tilemap_mark_tile_dirty(reel_1_tilemap, offset); | |
| 186 | } | |
| 187 | ||
| 188 | WRITE8_HANDLER( reeltileshigh_2_w ) | |
| 189 | { | |
| 190 | reeltileshigh_2_ram[offset] = data; | |
| 191 | tilemap_mark_tile_dirty(reel_2_tilemap, offset); | |
| 192 | } | |
| 193 | ||
| 194 | WRITE8_HANDLER( reeltileshigh_3_w ) | |
| 195 | { | |
| 196 | reeltileshigh_3_ram[offset] = data; | |
| 197 | tilemap_mark_tile_dirty(reel_3_tilemap, offset); | |
| 198 | } | |
| 199 | ||
| 200 | WRITE8_HANDLER( reeltileshigh_4_w ) | |
| 201 | { | |
| 202 | reeltileshigh_4_ram[offset] = data; | |
| 203 | tilemap_mark_tile_dirty(reel_4_tilemap, offset); | |
| 204 | } | |
| 205 | ||
| 206 | ||
| 92 | 207 | static READ8_HANDLER( ret_ff ) |
| 93 | 208 | { |
| 94 | 209 | return 0xff; |
| r3957 | r3958 | |
| 146 | 261 | } |
| 147 | 262 | } |
| 148 | 263 | |
| 264 | static WRITE8_HANDLER( reelscroll1_w ) | |
| 265 | { | |
| 266 | reelscroll1[offset] = data; | |
| 267 | } | |
| 268 | ||
| 269 | static WRITE8_HANDLER( reelscroll2_w ) | |
| 270 | { | |
| 271 | reelscroll2[offset] = data; | |
| 272 | } | |
| 273 | ||
| 274 | static WRITE8_HANDLER( reelscroll3_w ) | |
| 275 | { | |
| 276 | reelscroll3[offset] = data; | |
| 277 | } | |
| 278 | ||
| 279 | static WRITE8_HANDLER( reelscroll4_w ) | |
| 280 | { | |
| 281 | reelscroll4[offset] = data; | |
| 282 | } | |
| 283 | ||
| 284 | ||
| 149 | 285 | static ADDRESS_MAP_START( mem_map_skylncr, ADDRESS_SPACE_PROGRAM, 8 ) |
| 150 | 286 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 151 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 287 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 152 | 288 | |
| 153 | 289 | AM_RANGE(0x8800, 0x8fff) AM_READWRITE( SMH_RAM, skylncr_videoram_w ) AM_BASE( &skylncr_videoram ) |
| 154 | 290 | AM_RANGE(0x9000, 0x97ff) AM_READWRITE( SMH_RAM, skylncr_colorram_w ) AM_BASE( &skylncr_colorram ) |
| 155 | 291 | |
| 156 | AM_RANGE(0x9800, 0x9fff) AM_READWRITE( SMH_RAM, skylncr_videoram2_w ) AM_BASE( &skylncr_videoram2 ) | |
| 157 | AM_RANGE(0xa000, 0xa7ff) AM_READWRITE( SMH_RAM, skylncr_colorram2_w ) AM_BASE( &skylncr_colorram2 ) | |
| 292 | AM_RANGE(0x9800, 0x99ff) AM_READWRITE( SMH_RAM, reeltiles_1_w ) AM_BASE( &reeltiles_1_ram ) | |
| 293 | AM_RANGE(0x9a00, 0x9bff) AM_READWRITE( SMH_RAM, reeltiles_2_w ) AM_BASE( &reeltiles_2_ram ) | |
| 294 | AM_RANGE(0x9c00, 0x9dff) AM_READWRITE( SMH_RAM, reeltiles_3_w ) AM_BASE( &reeltiles_3_ram ) | |
| 295 | AM_RANGE(0x9e00, 0x9fff) AM_READWRITE( SMH_RAM, reeltiles_4_w ) AM_BASE( &reeltiles_4_ram ) | |
| 296 | AM_RANGE(0xa000, 0xa1ff) AM_READWRITE( SMH_RAM, reeltileshigh_1_w ) AM_BASE( &reeltileshigh_1_ram ) | |
| 297 | AM_RANGE(0xa200, 0xa3ff) AM_READWRITE( SMH_RAM, reeltileshigh_2_w ) AM_BASE( &reeltileshigh_2_ram ) | |
| 298 | AM_RANGE(0xa400, 0xa5ff) AM_READWRITE( SMH_RAM, reeltileshigh_3_w ) AM_BASE( &reeltileshigh_3_ram ) | |
| 299 | AM_RANGE(0xa600, 0xa7ff) AM_READWRITE( SMH_RAM, reeltileshigh_4_w ) AM_BASE( &reeltileshigh_4_ram ) | |
| 158 | 300 | |
| 159 | 301 | AM_RANGE(0xaa55, 0xaa55) AM_READ( ret_ff ) |
| 160 | 302 | |
| 161 | AM_RANGE(0xb000, 0xb7ff) AM_RAM | |
| 303 | AM_RANGE(0xb000, 0xb03f) AM_RAM AM_WRITE(reelscroll1_w) AM_BASE(&reelscroll1) | |
| 304 | AM_RANGE(0xb040, 0xb07f) AM_RAM AM_WRITE(reelscroll1_w) | |
| 305 | AM_RANGE(0xb080, 0xb0bf) AM_RAM AM_WRITE(reelscroll1_w) | |
| 306 | AM_RANGE(0xb0c0, 0xb0ff) AM_RAM AM_WRITE(reelscroll1_w) | |
| 307 | AM_RANGE(0xb100, 0xb13f) AM_RAM AM_WRITE(reelscroll1_w) | |
| 308 | AM_RANGE(0xb140, 0xb17f) AM_RAM AM_WRITE(reelscroll1_w) | |
| 309 | AM_RANGE(0xb180, 0xb1bf) AM_RAM AM_WRITE(reelscroll1_w) | |
| 310 | AM_RANGE(0xb1c0, 0xb1ff) AM_RAM AM_WRITE(reelscroll1_w) | |
| 162 | 311 | |
| 312 | AM_RANGE(0xb200, 0xb23f) AM_RAM AM_WRITE(reelscroll2_w) AM_BASE(&reelscroll2) | |
| 313 | AM_RANGE(0xb240, 0xb27f) AM_RAM AM_WRITE(reelscroll2_w) | |
| 314 | AM_RANGE(0xb280, 0xb2bf) AM_RAM AM_WRITE(reelscroll2_w) | |
| 315 | AM_RANGE(0xb2c0, 0xb2ff) AM_RAM AM_WRITE(reelscroll2_w) | |
| 316 | AM_RANGE(0xb300, 0xb33f) AM_RAM AM_WRITE(reelscroll2_w) | |
| 317 | AM_RANGE(0xb340, 0xb37f) AM_RAM AM_WRITE(reelscroll2_w) | |
| 318 | AM_RANGE(0xb380, 0xb3bf) AM_RAM AM_WRITE(reelscroll2_w) | |
| 319 | AM_RANGE(0xb3c0, 0xb3ff) AM_RAM AM_WRITE(reelscroll2_w) | |
| 320 | ||
| 321 | AM_RANGE(0xb400, 0xb43f) AM_RAM AM_WRITE(reelscroll3_w) AM_BASE(&reelscroll3) | |
| 322 | AM_RANGE(0xb440, 0xb47f) AM_RAM AM_WRITE(reelscroll3_w) | |
| 323 | AM_RANGE(0xb480, 0xb4bf) AM_RAM AM_WRITE(reelscroll3_w) | |
| 324 | AM_RANGE(0xb4c0, 0xb4ff) AM_RAM AM_WRITE(reelscroll3_w) | |
| 325 | AM_RANGE(0xb500, 0xb53f) AM_RAM AM_WRITE(reelscroll3_w) | |
| 326 | AM_RANGE(0xb540, 0xb57f) AM_RAM AM_WRITE(reelscroll3_w) | |
| 327 | AM_RANGE(0xb580, 0xb5bf) AM_RAM AM_WRITE(reelscroll3_w) | |
| 328 | AM_RANGE(0xb5c0, 0xb5ff) AM_RAM AM_WRITE(reelscroll3_w) | |
| 329 | ||
| 330 | AM_RANGE(0xb600, 0xb63f) AM_RAM AM_WRITE(reelscroll4_w) AM_BASE(&reelscroll4) | |
| 331 | AM_RANGE(0xb640, 0xb67f) AM_RAM AM_WRITE(reelscroll4_w) | |
| 332 | AM_RANGE(0xb680, 0xb6bf) AM_RAM AM_WRITE(reelscroll4_w) | |
| 333 | AM_RANGE(0xb6c0, 0xb6ff) AM_RAM AM_WRITE(reelscroll4_w) | |
| 334 | AM_RANGE(0xb700, 0xb73f) AM_RAM AM_WRITE(reelscroll4_w) | |
| 335 | AM_RANGE(0xb740, 0xb77f) AM_RAM AM_WRITE(reelscroll4_w) | |
| 336 | AM_RANGE(0xb780, 0xb7bf) AM_RAM AM_WRITE(reelscroll4_w) | |
| 337 | AM_RANGE(0xb7c0, 0xb7ff) AM_RAM AM_WRITE(reelscroll4_w) | |
| 338 | ||
| 163 | 339 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 164 | 340 | ADDRESS_MAP_END |
| 165 | 341 | |
| r3957 | r3958 | |
| 173 | 349 | static ADDRESS_MAP_START( io_map_skylncr, ADDRESS_SPACE_IO, 8 ) |
| 174 | 350 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 175 | 351 | |
| 176 | AM_RANGE(0x00, 0x00) AM_READ_PORT("SYSTEM") | |
| 177 | AM_RANGE(0x01, 0x01) AM_READ_PORT("BUTTONS") | |
| 352 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN1") | |
| 353 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN2") | |
| 178 | 354 | AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW1") |
| 179 | 355 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW2") |
| 180 | AM_RANGE(0x11, 0x11) AM_READ_PORT("COIN1") | |
| 181 | AM_RANGE(0x12, 0x12) AM_READ_PORT("COIN2") | |
| 356 | AM_RANGE(0x11, 0x11) AM_READ_PORT("IN3") | |
| 357 | AM_RANGE(0x12, 0x12) AM_READ_PORT("IN4") | |
| 182 | 358 | |
| 183 | 359 | AM_RANGE(0x20, 0x20) AM_WRITE( skylncr_coin_w ) |
| 184 | 360 | |
| r3957 | r3958 | |
| 214 | 390 | RGN_FRAC(1,2), |
| 215 | 391 | 8, |
| 216 | 392 | { STEP8(0,1) }, |
| 217 | { 8*0,8*4,8*1,8*5,8*2,8*6,8*3,8*7 }, | |
| 218 | 393 | { |
| 219 | RGN_FRAC(1,2)+8*8*0, RGN_FRAC(0,2)+8*8*0, | |
| 220 | RGN_FRAC(1,2)+8*8*1, RGN_FRAC(0,2)+8*8*1, | |
| 221 | RGN_FRAC(1,2)+8*8*2, RGN_FRAC(0,2)+8*8*2, | |
| 222 | RGN_FRAC(1,2)+8*8*3, RGN_FRAC(0,2)+8*8*3, | |
| 223 | RGN_FRAC(1,2)+8*8*4, RGN_FRAC(0,2)+8*8*4, | |
| 224 | RGN_FRAC(1,2)+8*8*5, RGN_FRAC(0,2)+8*8*5, | |
| 225 | RGN_FRAC(1,2)+8*8*6, RGN_FRAC(0,2)+8*8*6, | |
| 226 | RGN_FRAC(1,2)+8*8*7, RGN_FRAC(0,2)+8*8*7, | |
| 227 | RGN_FRAC(1,2)+8*8*8, RGN_FRAC(0,2)+8*8*8, | |
| 228 | RGN_FRAC(1,2)+8*8*9, RGN_FRAC(0,2)+8*8*9, | |
| 229 | RGN_FRAC(1,2)+8*8*10,RGN_FRAC(0,2)+8*8*10, | |
| 230 | RGN_FRAC(1,2)+8*8*11,RGN_FRAC(0,2)+8*8*11, | |
| 231 | RGN_FRAC(1,2)+8*8*12,RGN_FRAC(0,2)+8*8*12, | |
| 232 | RGN_FRAC(1,2)+8*8*13,RGN_FRAC(0,2)+8*8*13, | |
| 233 | RGN_FRAC(1,2)+8*8*14,RGN_FRAC(0,2)+8*8*14, | |
| 234 | RGN_FRAC(1,2)+8*8*15,RGN_FRAC(0,2)+8*8*15 | |
| 235 | }, | |
| 236 | 8*16*8 | |
| 237 | }; | |
| 238 | ||
| 239 | static const gfx_layout layout8x32x8_rot = | |
| 240 | { | |
| 241 | 8,32, | |
| 242 | RGN_FRAC(1,2), | |
| 243 | 8, | |
| 244 | { STEP8(0,1) }, | |
| 245 | { | |
| 246 | 394 | 8*0, 8*1, |
| 247 | 395 | RGN_FRAC(1,2)+8*0, RGN_FRAC(1,2)+8*1, |
| 248 | 396 | 8*2, 8*3, |
| r3957 | r3958 | |
| 255 | 403 | 8*32*8/2 |
| 256 | 404 | }; |
| 257 | 405 | |
| 258 | static const gfx_layout mz_layout8x8x8 = | |
| 406 | /* this will decode the big x2 x3 'correctly' however, maybe they're | |
| 407 | simply not meant to appear correct? */ | |
| 408 | static const gfx_layout layout8x32x8_rot = | |
| 259 | 409 | { |
| 260 | 8,8, | |
| 261 | RGN_FRAC(1,2), | |
| 262 | 8, | |
| 263 | { STEP8(0,1) }, | |
| 264 | { | |
| 265 | 8*0,8*1, | |
| 266 | RGN_FRAC(1,2)+8*0,RGN_FRAC(1,2)+8*1, | |
| 267 | 8*2,8*3, | |
| 268 | RGN_FRAC(1,2)+8*2,RGN_FRAC(1,2)+8*3 | |
| 269 | }, | |
| 270 | { STEP8(0,8*4) }, | |
| 271 | 8*8*4 | |
| 272 | }; | |
| 273 | ||
| 274 | static const gfx_layout mz_layout8x32x8 = | |
| 275 | { | |
| 276 | 410 | 8,32, |
| 277 | 411 | RGN_FRAC(1,2), |
| 278 | 412 | 8, |
| 279 | 413 | { STEP8(0,1) }, |
| 280 | { 8*0,8*1,8*2,8*3,8*4,8*5,8*6,8*7 }, | |
| 281 | 414 | { |
| 282 | RGN_FRAC(1,2)+8*8*0, RGN_FRAC(0,2)+8*8*0, | |
| 283 | RGN_FRAC(1,2)+8*8*1, RGN_FRAC(0,2)+8*8*1, | |
| 284 | RGN_FRAC(1,2)+8*8*2, RGN_FRAC(0,2)+8*8*2, | |
| 285 | RGN_FRAC(1,2)+8*8*3, RGN_FRAC(0,2)+8*8*3, | |
| 286 | RGN_FRAC(1,2)+8*8*4, RGN_FRAC(0,2)+8*8*4, | |
| 287 | RGN_FRAC(1,2)+8*8*5, RGN_FRAC(0,2)+8*8*5, | |
| 288 | RGN_FRAC(1,2)+8*8*6, RGN_FRAC(0,2)+8*8*6, | |
| 289 | RGN_FRAC(1,2)+8*8*7, RGN_FRAC(0,2)+8*8*7, | |
| 290 | RGN_FRAC(1,2)+8*8*8, RGN_FRAC(0,2)+8*8*8, | |
| 291 | RGN_FRAC(1,2)+8*8*9, RGN_FRAC(0,2)+8*8*9, | |
| 292 | RGN_FRAC(1,2)+8*8*10,RGN_FRAC(0,2)+8*8*10, | |
| 293 | RGN_FRAC(1,2)+8*8*11,RGN_FRAC(0,2)+8*8*11, | |
| 294 | RGN_FRAC(1,2)+8*8*12,RGN_FRAC(0,2)+8*8*12, | |
| 295 | RGN_FRAC(1,2)+8*8*13,RGN_FRAC(0,2)+8*8*13, | |
| 296 | RGN_FRAC(1,2)+8*8*14,RGN_FRAC(0,2)+8*8*14, | |
| 297 | RGN_FRAC(1,2)+8*8*15,RGN_FRAC(0,2)+8*8*15 | |
| 298 | }, | |
| 299 | 8*16*8 | |
| 300 | }; | |
| 301 | ||
| 302 | static const gfx_layout mz_layout8x32x8_rot = | |
| 303 | { | |
| 304 | 8,32, | |
| 305 | RGN_FRAC(1,2), | |
| 306 | 8, | |
| 307 | { STEP8(0,1) }, | |
| 308 | { | |
| 309 | 415 | 8*0, 8*1, |
| 310 | RGN_FRAC(1,2)+8* | |
| 416 | RGN_FRAC(1,2)+8*1, RGN_FRAC(1,2)+8*0, | |
| 311 | 417 | 8*2, 8*3, |
| 312 | RGN_FRAC(1,2)+8* | |
| 418 | RGN_FRAC(1,2)+8*3, RGN_FRAC(1,2)+8*2 | |
| 313 | 419 | }, |
| 314 | 420 | { |
| 315 | 421 | STEP16(0,8*4), |
| r3957 | r3958 | |
| 320 | 426 | |
| 321 | 427 | static GFXDECODE_START( skylncr ) |
| 322 | 428 | GFXDECODE_ENTRY( "gfx1", 0, layout8x8x8, 0, 2 ) |
| 429 | GFXDECODE_ENTRY( "gfx2", 0, layout8x32x8, 0, 2 ) | |
| 323 | 430 | GFXDECODE_ENTRY( "gfx2", 0, layout8x32x8_rot, 0, 2 ) |
| 324 | GFXDECODE_ENTRY( "gfx2", 0, layout8x32x8, 0, 2 ) | |
| 325 | 431 | GFXDECODE_END |
| 326 | 432 | |
| 327 | static GFXDECODE_START( madzoo ) | |
| 328 | GFXDECODE_ENTRY( "gfx1", 0, mz_layout8x8x8, 0, 2 ) | |
| 329 | GFXDECODE_ENTRY( "gfx2", 0, mz_layout8x32x8_rot, 0, 2 ) | |
| 330 | GFXDECODE_ENTRY( "gfx2", 0, mz_layout8x32x8, 0, 2 ) | |
| 331 | GFXDECODE_END | |
| 332 | 433 | |
| 333 | 434 | static INPUT_PORTS_START( skylncr ) |
| 334 | PORT_START("SYSTEM") /* $0 "PORT0 A" */ | |
| 335 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1) | |
| 336 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2) | |
| 337 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3) | |
| 338 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4) | |
| 339 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1) | |
| 340 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2) | |
| 341 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3) | |
| 342 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4) | |
| 435 | PORT_START("IN1") /* $0 "PORT0 A" */ | |
| 436 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6) PORT_NAME("Stop 2") PORT_CODE(KEYCODE_X) | |
| 437 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 438 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("Stop 1") PORT_CODE(KEYCODE_Z) | |
| 439 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 440 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7) PORT_NAME("Stop 3") PORT_CODE(KEYCODE_C) | |
| 441 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 442 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 443 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 343 | 444 | |
| 344 | PORT_START("BUTTONS") /* $1 "PORT0 B" */ | |
| 345 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1) | |
| 346 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2) | |
| 347 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3) | |
| 348 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4) | |
| 349 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) // skip test | |
| 350 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2) | |
| 351 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2) | |
| 352 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(2) | |
| 445 | PORT_START("IN2") /* $1 "PORT0 B" */ | |
| 446 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Bet") PORT_CODE(KEYCODE_2) | |
| 447 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 448 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON9) PORT_NAME("Option 2 (D-UP)") PORT_CODE(KEYCODE_S) | |
| 449 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 450 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Start") PORT_CODE(KEYCODE_1) | |
| 451 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 452 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 453 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 353 | 454 | |
| 455 | PORT_START("IN3") /* $11 "PORT1 B" */ | |
| 456 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) | |
| 457 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) | |
| 458 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) | |
| 459 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q) | |
| 460 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Option 1 (D-UP)") PORT_CODE(KEYCODE_A) | |
| 461 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("D-UP") PORT_CODE(KEYCODE_3) | |
| 462 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 463 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take Score") PORT_CODE(KEYCODE_4) | |
| 464 | ||
| 465 | PORT_START("IN4") /* $12 "PORT1 C" */ | |
| 466 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 467 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Reset") PORT_CODE(KEYCODE_R) | |
| 468 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats") PORT_CODE(KEYCODE_0) | |
| 469 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) /* Settings */ | |
| 470 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 471 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 472 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 473 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out") PORT_CODE(KEYCODE_W) | |
| 474 | ||
| 354 | 475 | PORT_START("DSW1") /* $2 "DSW1" */ |
| 355 | PORT_DIPNAME( 0x01, 0x01, "DSW1" ) | |
| 356 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 357 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 358 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 359 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 360 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 361 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 362 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 363 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 364 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 365 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 366 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 367 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 368 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 369 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 370 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 371 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 372 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 373 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 374 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 375 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 376 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 377 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 378 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 476 | PORT_DIPNAME( 0x11, 0x01, "D-UP Percentage" ) | |
| 477 | PORT_DIPSETTING( 0x11, "60%" ) | |
| 478 | PORT_DIPSETTING( 0x01, "70%" ) | |
| 479 | PORT_DIPSETTING( 0x10, "80%" ) | |
| 480 | PORT_DIPSETTING( 0x00, "90%" ) | |
| 481 | PORT_DIPNAME( 0x0e, 0x0e, "Main Game Percentage" ) | |
| 482 | PORT_DIPSETTING( 0x0e, "75%" ) | |
| 483 | PORT_DIPSETTING( 0x0c, "78%" ) | |
| 484 | PORT_DIPSETTING( 0x0a, "81%" ) | |
| 485 | PORT_DIPSETTING( 0x08, "84%" ) | |
| 486 | PORT_DIPSETTING( 0x06, "87%" ) | |
| 487 | PORT_DIPSETTING( 0x04, "90%" ) | |
| 488 | PORT_DIPSETTING( 0x02, "93%" ) | |
| 489 | PORT_DIPSETTING( 0x00, "96%" ) | |
| 490 | PORT_DIPNAME( 0x20, 0x20, "Reels Speed" ) | |
| 491 | PORT_DIPSETTING( 0x20, "Slow" ) | |
| 492 | PORT_DIPSETTING( 0x00, "Fast" ) | |
| 493 | PORT_DIPNAME( 0x40, 0x40, "Bonus Score" ) | |
| 494 | PORT_DIPSETTING( 0x40, "32" ) | |
| 495 | PORT_DIPSETTING( 0x00, "24" ) | |
| 496 | PORT_DIPNAME( 0x80, 0x00, "Key Out" ) | |
| 497 | PORT_DIPSETTING( 0x80, "x100" ) | |
| 498 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 379 | 499 | |
| 380 | 500 | PORT_START("DSW2") /* $10 "DSW2" */ |
| 381 | 501 | PORT_DIPNAME( 0x01, 0x01, "DSW2" ) |
| r3957 | r3958 | |
| 384 | 504 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 385 | 505 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 386 | 506 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 387 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 388 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 389 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 390 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 391 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 392 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 393 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 394 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 395 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 507 | PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) | |
| 508 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 509 | PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) | |
| 510 | PORT_DIPNAME( 0x18, 0x08, "Payout Limit" ) | |
| 511 | PORT_DIPSETTING( 0x00, "0" ) | |
| 512 | PORT_DIPSETTING( 0x08, "5000" ) | |
| 513 | PORT_DIPSETTING( 0x10, "2000" ) | |
| 514 | PORT_DIPSETTING( 0x18, "1000" ) | |
| 396 | 515 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 397 | 516 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 398 | 517 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 399 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 400 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 401 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 402 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 403 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 404 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 518 | PORT_DIPNAME( 0xc0, 0xc0, "Clown Percentage" ) | |
| 519 | PORT_DIPSETTING( 0xc0, "60%" ) | |
| 520 | PORT_DIPSETTING( 0x80, "70%" ) | |
| 521 | PORT_DIPSETTING( 0x40, "80%" ) | |
| 522 | PORT_DIPSETTING( 0x00, "90%" ) | |
| 405 | 523 | |
| 406 | PORT_START("COIN1") /* $11 "PORT1 B" */ | |
| 407 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 408 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 409 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 410 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 411 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 412 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 413 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 414 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 415 | ||
| 416 | PORT_START("COIN2") /* $12 "PORT1 C" */ | |
| 417 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2) | |
| 418 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 419 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 420 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 421 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 422 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 423 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 424 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 425 | ||
| 426 | PORT_START("DSW4") /* AY8910 port A */ | |
| 427 | PORT_DIPNAME( 0x01, 0x01, "DSW4" ) | |
| 428 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 429 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 430 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 431 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 432 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 433 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 434 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 435 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 524 | PORT_START("DSW3") /* AY8910 port A */ | |
| 525 | PORT_DIPNAME( 0x07, 0x07, "Coinage A, B & C" ) | |
| 526 | PORT_DIPSETTING( 0x00, "1 Coin / 1 Credit" ) | |
| 527 | PORT_DIPSETTING( 0x01, "1 Coin / 5 Credits" ) | |
| 528 | PORT_DIPSETTING( 0x02, "1 Coin / 10 Credits" ) | |
| 529 | PORT_DIPSETTING( 0x03, "1 Coin / 20 Credits" ) | |
| 530 | PORT_DIPSETTING( 0x04, "1 Coin / 30 Credits" ) | |
| 531 | PORT_DIPSETTING( 0x05, "1 Coin / 40 Credits" ) | |
| 532 | PORT_DIPSETTING( 0x06, "1 Coin / 50 Credits" ) | |
| 533 | PORT_DIPSETTING( 0x07, "1 Coin / 100 Credit" ) | |
| 436 | 534 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 437 | 535 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 438 | 536 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 439 | 537 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 440 | 538 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 441 | 539 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 442 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 443 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 444 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 445 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 446 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 447 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 448 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 449 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 450 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 540 | PORT_DIPNAME( 0x20, 0x20, "Max Win Bonus" ) | |
| 541 | PORT_DIPSETTING( 0x20, "10000" ) | |
| 542 | PORT_DIPSETTING( 0x00, "20000" ) | |
| 543 | PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) | |
| 544 | PORT_DIPSETTING( 0xc0, "0" ) | |
| 545 | PORT_DIPSETTING( 0x80, "8" ) | |
| 546 | PORT_DIPSETTING( 0x40, "16" ) | |
| 547 | PORT_DIPSETTING( 0x00, "32" ) | |
| 451 | 548 | |
| 452 | PORT_START("DSW3") /* AY8910 port B */ | |
| 453 | PORT_DIPNAME( 0x01, 0x01, "DSW3" ) | |
| 454 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 455 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 456 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 457 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 458 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 459 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 460 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 461 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 462 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 463 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 464 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 465 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 466 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 467 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 549 | PORT_START("DSW4") /* AY8910 port B */ | |
| 550 | PORT_DIPNAME( 0x07, 0x07, "Remote Credits" ) | |
| 551 | PORT_DIPSETTING( 0x00, "1 Pulse / 100 Credits" ) | |
| 552 | PORT_DIPSETTING( 0x01, "1 Pulse / 110 Credits" ) | |
| 553 | PORT_DIPSETTING( 0x02, "1 Pulse / 120 Credits" ) | |
| 554 | PORT_DIPSETTING( 0x03, "1 Pulse / 130 Credits" ) | |
| 555 | PORT_DIPSETTING( 0x04, "1 Pulse / 200 Credits" ) | |
| 556 | PORT_DIPSETTING( 0x05, "1 Pulse / 400 Credits" ) | |
| 557 | PORT_DIPSETTING( 0x06, "1 Pulse / 500 Credits" ) | |
| 558 | PORT_DIPSETTING( 0x07, "1 Pulse / 1000 Credits" ) | |
| 559 | PORT_DIPNAME( 0x18, 0x00, "Max Bet" ) | |
| 560 | PORT_DIPSETTING( 0x18, "32" ) | |
| 561 | PORT_DIPSETTING( 0x10, "64" ) | |
| 562 | PORT_DIPSETTING( 0x08, "72" ) | |
| 563 | PORT_DIPSETTING( 0x00, "80" ) | |
| 468 | 564 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 469 | 565 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 470 | 566 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| r3957 | r3958 | |
| 474 | 570 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 475 | 571 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 476 | 572 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 477 | ||
| 478 | 573 | INPUT_PORTS_END |
| 479 | 574 | |
| 575 | ||
| 480 | 576 | static const ay8910_interface ay8910_config = |
| 481 | 577 | { |
| 482 | 578 | AY8910_LEGACY_OUTPUT, |
| r3957 | r3958 | |
| 497 | 593 | static MACHINE_DRIVER_START( skylncr ) |
| 498 | 594 | |
| 499 | 595 | /* basic machine hardware */ |
| 500 | MDRV_CPU_ADD("main", Z80, | |
| 596 | MDRV_CPU_ADD("main", Z80, MASTER_CLOCK/4) | |
| 501 | 597 | MDRV_CPU_PROGRAM_MAP(mem_map_skylncr,0) |
| 502 | 598 | MDRV_CPU_IO_MAP(io_map_skylncr,0) |
| 503 | 599 | MDRV_CPU_VBLANK_INT("main", skylncr_vblank_interrupt) |
| 504 | 600 | |
| 601 | MDRV_NVRAM_HANDLER(generic_0fill) | |
| 602 | ||
| 505 | 603 | /* video hardware */ |
| 506 | 604 | MDRV_SCREEN_ADD("main", RASTER) |
| 507 | 605 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 518 | 616 | |
| 519 | 617 | /* sound hardware */ |
| 520 | 618 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 521 | MDRV_SOUND_ADD("ay", AY8910, | |
| 619 | MDRV_SOUND_ADD("ay", AY8910, MASTER_CLOCK/8) | |
| 522 | 620 | MDRV_SOUND_CONFIG(ay8910_config) |
| 523 | 621 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 524 | 622 | MACHINE_DRIVER_END |
| 525 | 623 | |
| 526 | static MACHINE_DRIVER_START( madzoo ) | |
| 527 | ||
| 528 | /* basic machine hardware */ | |
| 529 | MDRV_IMPORT_FROM(skylncr) | |
| 530 | ||
| 531 | /* video hardware */ | |
| 532 | MDRV_GFXDECODE(madzoo) | |
| 533 | MACHINE_DRIVER_END | |
| 534 | ||
| 535 | 624 | /* |
| 536 | 625 | |
| 537 | 626 | Sky Lancer PCB Layout |
| r3957 | r3958 | |
| 573 | 662 | ROM_LOAD( "574200.u33", 0x00000, 0x80000, CRC(19b25221) SHA1(2f32d337125a9fd0bc7f50713b05e564fd4f81b2) ) |
| 574 | 663 | ROM_END |
| 575 | 664 | |
| 665 | ROM_START( butrfly ) | |
| 666 | ROM_REGION( 0x80000, "main", 0 ) | |
| 667 | ROM_LOAD( "butterfly.prg", 0x00000, 0x10000, CRC(b35b289c) SHA1(5a02bfb6e1fb608099b9f491c10795ef888a3b36) ) | |
| 668 | ||
| 669 | ROM_REGION( 0x80000, "gfx1", 0 ) | |
| 670 | ROM_LOAD16_BYTE( "u29", 0x00000, 0x20000, CRC(2ff775ea) SHA1(2219c75cbac2969485607446ab116587bdee7278) ) | |
| 671 | ROM_LOAD16_BYTE( "u31", 0x00001, 0x20000, CRC(029d2214) SHA1(cf8256157db0b297ed457b3da6b6517907128843) ) | |
| 672 | ROM_LOAD16_BYTE( "u33", 0x40000, 0x20000, CRC(37bad677) SHA1(c077f0c07b097b376a01e5637446e4c4f82d9e28) ) | |
| 673 | ROM_LOAD16_BYTE( "u35", 0x40001, 0x20000, CRC(d14c7713) SHA1(c229ef64f3b0a04ff8e27bc56cff6a55ca34b80c) ) | |
| 674 | ||
| 675 | ROM_REGION( 0x80000, "gfx2", 0 ) | |
| 676 | ROM_LOAD16_BYTE( "u52", 0x00000, 0x20000, CRC(15051537) SHA1(086c38c05c605f297a7bc470eb51763a7648e72c) ) | |
| 677 | ROM_LOAD16_BYTE( "u54", 0x00001, 0x20000, CRC(8e34d029) SHA1(ae316f2f34768938a07d62db110ce59d2751abaa) ) | |
| 678 | ROM_LOAD16_BYTE( "u56", 0x40000, 0x20000, CRC(a53daaef) SHA1(7b88bb986bd5e47576163d6999f8770c720c5bfc) ) | |
| 679 | ROM_LOAD16_BYTE( "u58", 0x40001, 0x20000, CRC(21ca47f8) SHA1(b192be06a2eb817776309580dc64fd76772a8d50) ) | |
| 680 | ROM_END | |
| 681 | ||
| 576 | 682 | /* |
| 577 | 683 | |
| 578 | 684 | Mad Zoo PCB Layout |
| r3957 | r3958 | |
| 608 | 714 | ROM_LOAD( "27512.u9", 0x00000, 0x10000, CRC(98b1c9fe) SHA1(9ca1706d25038a078fb07ba5c2e6681ed468bc88) ) |
| 609 | 715 | |
| 610 | 716 | ROM_REGION( 0x80000, "gfx1", 0 ) |
| 611 | ROM_LOAD( "27c301.u29", 0x00000, 0x20000, CRC(4d58ab1d) SHA1(a6c9a855de6c7c502deea6afe2061dbbc6a1dfce) ) | |
| 612 | ROM_LOAD( "27c301.u31", 0x20000, 0x20000, CRC(511a8d19) SHA1(d49cc025b7b44a1f364b843dbe215fd2aa1e8986) ) | |
| 613 | ROM_LOAD( "27c301.u33", 0x40000, 0x20000, CRC(63e7ec89) SHA1(5184c164c356976325c7ad715d0f32a16bd44061) ) | |
| 614 | ROM_LOAD( "27c301.u35", 0x60000, 0x20000, CRC(a1ef51d1) SHA1(76508de6ab9effd1c8e27753403f161da073014c) ) | |
| 717 | ROM_LOAD16_BYTE( "27c301.u29", 0x00000, 0x20000, CRC(44645bb8) SHA1(efaf88d63e09029aa023ddaf72dbd9ee1df10315) ) | |
| 718 | ROM_LOAD16_BYTE( "27c301.u31", 0x00001, 0x20000, CRC(58267dbc) SHA1(dd64e4b44d10e2d93ded255622891f058b2b8bb9) ) | |
| 719 | ROM_LOAD16_BYTE( "27c301.u33", 0x40000, 0x20000, CRC(6adb1c2c) SHA1(d782a778a34e6240a3ae09cd11124790864a9149) ) | |
| 720 | ROM_LOAD16_BYTE( "27c301.u35", 0x40001, 0x20000, CRC(a8d3a174) SHA1(b668bb1db1d27aff52e808aa9b972f24693161b3) ) | |
| 615 | 721 | |
| 616 | 722 | ROM_REGION( 0x80000, "gfx2", 0 ) |
| 617 | ROM_LOAD( "27c301.u52", 0x00000, 0x20000, CRC(00cd5c9d) SHA1(68c2ffdba4018bcb03fe8a96c4a269d3ec7379d8) ) | |
| 618 | ROM_LOAD( "27c301.u54", 0x20000, 0x20000, CRC(9bd8af17) SHA1(5f32523ea797821205c5bb0f3c53c09ca784555b) ) | |
| 619 | ROM_LOAD( "27c301.u56", 0x40000, 0x20000, CRC(d73278a6) SHA1(2865659d80c76d73f19b178748cf67d792cd6a84) ) | |
| 620 | ROM_LOAD( "27c301.u58", 0x60000, 0x20000, CRC(895b2dac) SHA1(2a6dfec2a18a63f0cc4344506653ab7b14c31a59) ) | |
| 723 | ROM_LOAD16_BYTE( "27c301.u52", 0x00000, 0x20000, CRC(dd1997ed) SHA1(9197a0b4a0b6284ae7eeb6364c87589f6f8a614d) ) | |
| 724 | ROM_LOAD16_BYTE( "27c301.u54", 0x00001, 0x20000, CRC(a654a6df) SHA1(54292953df1103ad830e1f40fdf96c48e0e13be7) ) | |
| 725 | ROM_LOAD16_BYTE( "27c301.u56", 0x40000, 0x20000, CRC(f2e3c394) SHA1(8e09516fe822d7c125be57b154c896ab3e024f98) ) | |
| 726 | ROM_LOAD16_BYTE( "27c301.u58", 0x40001, 0x20000, CRC(65d2015b) SHA1(121494a2684276276e2504d6f853718e93f4d458) ) | |
| 621 | 727 | ROM_END |
| 622 | 728 | |
| 729 | ROM_START( leader ) | |
| 730 | ROM_REGION( 0x80000, "main", 0 ) | |
| 731 | ROM_LOAD( "leader.prg", 0x00000, 0x10000, CRC(1a6e1129) SHA1(639f687e7720bab89628b377dca0475f17a35041) ) | |
| 623 | 732 | |
| 733 | ROM_REGION( 0x80000, "gfx1", 0 ) | |
| 734 | ROM_LOAD16_BYTE( "leadergfx1.dmp11", 0x00000, 0x20000, CRC(08acae31) SHA1(8b93066a2159e56607499fe1b1748a70a73a326c) ) | |
| 735 | ROM_LOAD16_BYTE( "leadergfx1.dmp21", 0x00001, 0x20000, CRC(88cd7a49) SHA1(f7187c7e3e584180de03998f376001f8d5966882) ) | |
| 736 | ROM_LOAD16_BYTE( "leadergfx1.dmp12", 0x40000, 0x20000, CRC(e57e145e) SHA1(3f6169ed1d907de3438787c02dc53c73ca6bdb73) ) | |
| 737 | ROM_LOAD16_BYTE( "leadergfx1.dmp22", 0x40001, 0x20000, CRC(e8368d29) SHA1(19e7d7d6e320f5f06e91013cb4c92b3987dbe24e) ) | |
| 738 | ||
| 739 | ROM_REGION( 0x80000, "gfx2", 0 ) | |
| 740 | ROM_LOAD16_BYTE( "leadergfx2.dmp11", 0x00000, 0x20000, CRC(1d62edf4) SHA1(7ba43bf0d0d0cadd5c7fcbe940ecf3fab5c9127b) ) | |
| 741 | ROM_LOAD16_BYTE( "leadergfx2.dmp21", 0x00001, 0x20000, CRC(57b9d159) SHA1(ee98aea160653d55017bd893cc253d23c7b1faf4) ) | |
| 742 | ROM_LOAD16_BYTE( "leadergfx2.dmp12", 0x40000, 0x20000, CRC(91e73bf9) SHA1(90a9c1119ae05bbd66a4d3c2266ec02cc53969bd) ) | |
| 743 | ROM_LOAD16_BYTE( "leadergfx2.dmp22", 0x40001, 0x20000, CRC(04cc0118) SHA1(016ccbe7daf8c4676830aadcc906a64e2826d11a) ) | |
| 744 | ROM_END | |
| 745 | ||
| 746 | ||
| 624 | 747 | static DRIVER_INIT( skylncr ) |
| 625 | 748 | { |
| 626 | 749 | paletteram = auto_malloc(0x100*3); |
| r3957 | r3958 | |
| 632 | 755 | Game Drivers |
| 633 | 756 | *****************************************************/ |
| 634 | 757 | |
| 635 | GAME( 1995, skylncr, 0, skylncr, skylncr, skylncr, ROT0, "Bordun International", "Sky Lancer (Bordun International)", GAME_NOT_WORKING ) | |
| 636 | GAME( 1995, madzoo, 0, madzoo, skylncr, skylncr, ROT0, "Bordun International", "Mad Zoo", GAME_NOT_WORKING ) | |
| 758 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ | |
| 759 | GAME( 1995, skylncr, 0, skylncr, skylncr, skylncr, ROT0, "Bordun International", "Sky Lancer (Bordun, ver.U450C)", 0 ) | |
| 760 | GAME( 1995, butrfly, 0, skylncr, skylncr, skylncr, ROT0, "Bordun International", "Butterfly Video Game (ver.U350C)", 0 ) | |
| 761 | GAME( 1995, madzoo, 0, skylncr, skylncr, skylncr, ROT0, "Bordun International", "Mad Zoo (ver.U450C)", 0 ) | |
| 762 | GAME( 1995, leader, 0, skylncr, skylncr, skylncr, ROT0, "Bootleg", "Leader", GAME_NOT_WORKING ) |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/m68000/m68000.h" | |
| 17 | 18 | #include "cpu/h6280/h6280.h" |
| 18 | 19 | #include "sound/2203intf.h" |
| 19 | 20 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | #include "cpu/z180/z180.h" | |
| 39 | 40 | #include "machine/eeprom.h" |
| 40 | 41 | #include "sound/namco.h" |
| 41 | 42 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 65 | 66 | { |
| 66 | 67 | int bit = data & 1; |
| 67 | 68 | |
| 68 | cpu_interrupt_enable(0, bit); | |
| 69 | cpu_interrupt_enable(space->machine->cpu[0], bit); | |
| 69 | 70 | |
| 70 | 71 | if (!bit) |
| 71 | 72 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE ); |
| r3957 | r3958 | |
|---|---|---|
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | 45 | #include "driver.h" |
| 46 | #include "cpu/z80/z80.h" | |
| 47 | #include "cpu/m6800/m6800.h" | |
| 46 | 48 | #include "sound/ay8910.h" |
| 47 | 49 | #include "sound/dac.h" |
| 48 | 50 | |
| r3957 | r3958 | |
| 98 | 100 | { |
| 99 | 101 | //logerror("PC %04x: 8910 port B = %02x\n",cpu_get_pc(space->cpu),data); |
| 100 | 102 | /* bit 0 is IRQ enable */ |
| 101 | cpu_interrupt_enable(0,data & 1); | |
| 103 | cpu_interrupt_enable(space->machine->cpu[0],data & 1); | |
| 102 | 104 | |
| 103 | 105 | /* bit 1 flips screen */ |
| 104 | 106 | |
| r3957 | r3958 | |
| 410 | 412 | MDRV_CPU_ADD("mcu", NSC8105, 6000000) /* ??? */ |
| 411 | 413 | MDRV_CPU_PROGRAM_MAP(mcu_nvram_map,0) |
| 412 | 414 | |
| 413 | MDRV_ | |
| 415 | MDRV_QUANTUM_TIME | |
| 414 | 416 | /* synchronization of the CPUs */ |
| 415 | 417 | MDRV_MACHINE_RESET(friskyt) |
| 416 | 418 | MDRV_NVRAM_HANDLER(seicross) |
| r3957 | r3958 | |
|---|---|---|
| 126 | 126 | *******************************************************************************/ |
| 127 | 127 | |
| 128 | 128 | #include "driver.h" |
| 129 | #include "cpu/z80/z80.h" | |
| 130 | #include "cpu/m68000/m68000.h" | |
| 129 | 131 | #include "sound/okim6295.h" |
| 130 | 132 | #include "sound/3812intf.h" |
| 131 | 133 |
| r3957 | r3958 | |
|---|---|---|
| 793 | 793 | |
| 794 | 794 | static MACHINE_RESET( dduxbl ) |
| 795 | 795 | { |
| 796 | sys16_patch_code( 0x1eb2e, 0x01 ); | |
| 797 | sys16_patch_code( 0x1eb2f, 0x01 ); | |
| 798 | sys16_patch_code( 0x1eb3c, 0x00 ); | |
| 799 | sys16_patch_code( 0x1eb3d, 0x00 ); | |
| 800 | sys16_patch_code( 0x23132, 0x01 ); | |
| 801 | sys16_patch_code( 0x23133, 0x01 ); | |
| 802 | sys16_patch_code( 0x23140, 0x00 ); | |
| 803 | sys16_patch_code( 0x23141, 0x00 ); | |
| 804 | sys16_patch_code( 0x24a9a, 0x01 ); | |
| 805 | sys16_patch_code( 0x24a9b, 0x01 ); | |
| 806 | sys16_patch_code( 0x24aa8, 0x00 ); | |
| 807 | sys16_patch_code( 0x24aa9, 0x00 ); | |
| 796 | static const sys16_patch patch[] = | |
| 797 | { | |
| 798 | { 0x1eb2e, 0x01 }, | |
| 799 | { 0x1eb2f, 0x01 }, | |
| 800 | { 0x1eb3c, 0x00 }, | |
| 801 | { 0x1eb3d, 0x00 }, | |
| 802 | { 0x23132, 0x01 }, | |
| 803 | { 0x23133, 0x01 }, | |
| 804 | { 0x23140, 0x00 }, | |
| 805 | { 0x23141, 0x00 }, | |
| 806 | { 0x24a9a, 0x01 }, | |
| 807 | { 0x24a9b, 0x01 }, | |
| 808 | { 0x24aa8, 0x00 }, | |
| 809 | { 0x24aa9, 0x00 } | |
| 810 | }; | |
| 811 | ||
| 812 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 808 | 813 | } |
| 809 | 814 | |
| 810 | 815 | static DRIVER_INIT( dduxbl ) |
| r3957 | r3958 | |
| 923 | 928 | 2,3, 6,7, |
| 924 | 929 | 10,11, 14,15 |
| 925 | 930 | }; |
| 931 | static const sys16_patch patch[] = | |
| 932 | { | |
| 933 | { 0x3897, 0x11 } | |
| 934 | }; | |
| 935 | ||
| 936 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 937 | ||
| 926 | 938 | sys16_obj_bank = bank; |
| 927 | 939 | sys16_sprxoffset = -0x23c; |
| 928 | 940 | |
| 929 | sys16_patch_code( 0x3897, 0x11 ); | |
| 930 | 941 | |
| 931 | 942 | sys16_update_proc = eswatbl_update_proc; |
| 932 | 943 | } |
| r3957 | r3958 | |
| 1016 | 1027 | |
| 1017 | 1028 | static MACHINE_RESET( fpointbl ) |
| 1018 | 1029 | { |
| 1019 | sys16_patch_code( 0x454, 0x33 ); | |
| 1020 | sys16_patch_code( 0x455, 0xf8 ); | |
| 1021 | sys16_patch_code( 0x456, 0xe0 ); | |
| 1022 | sys16_patch_code( 0x457, 0xe2 ); | |
| 1023 | sys16_patch_code( 0x8ce8, 0x16 ); | |
| 1024 | sys16_patch_code( 0x8ce9, 0x66 ); | |
| 1025 | sys16_patch_code( 0x17687, 0x00 ); | |
| 1026 | sys16_patch_code( 0x7bed, 0x04 ); | |
| 1030 | static const sys16_patch patch[] = | |
| 1031 | { | |
| 1032 | { 0x454, 0x33 }, | |
| 1033 | { 0x455, 0xf8 }, | |
| 1034 | { 0x456, 0xe0 }, | |
| 1035 | { 0x457, 0xe2 }, | |
| 1036 | { 0x8ce8, 0x16 }, | |
| 1037 | { 0x8ce9, 0x66 }, | |
| 1038 | { 0x17687, 0x00 }, | |
| 1039 | { 0x7bed, 0x04 }, | |
| 1027 | 1040 | |
| 1028 | sys16_patch_code( 0x7ea8, 0x61 ); | |
| 1029 | sys16_patch_code( 0x7ea9, 0x00 ); | |
| 1030 | sys16_patch_code( 0x7eaa, 0x84 ); | |
| 1031 | sys16_patch_code( 0x7eab, 0x16 ); | |
| 1032 | sys16_patch_code( 0x2c0, 0xe7 ); | |
| 1033 | sys16_patch_code( 0x2c1, 0x48 ); | |
| 1034 | sys16_patch_code( 0x2c2, 0xe7 ); | |
| 1035 | sys16_patch_code( 0x2c3, 0x49 ); | |
| 1036 | sys16_patch_code( 0x2c4, 0x04 ); | |
| 1037 | sys16_patch_code( 0x2c5, 0x40 ); | |
| 1038 | sys16_patch_code( 0x2c6, 0x00 ); | |
| 1039 | sys16_patch_code( 0x2c7, 0x10 ); | |
| 1040 | sys16_patch_code( 0x2c8, 0x4e ); | |
| 1041 | sys16_patch_code( 0x2c9, 0x75 ); | |
| 1041 | { 0x7ea8, 0x61 }, | |
| 1042 | { 0x7ea9, 0x00 }, | |
| 1043 | { 0x7eaa, 0x84 }, | |
| 1044 | { 0x7eab, 0x16 }, | |
| 1045 | { 0x2c0, 0xe7 }, | |
| 1046 | { 0x2c1, 0x48 }, | |
| 1047 | { 0x2c2, 0xe7 }, | |
| 1048 | { 0x2c3, 0x49 }, | |
| 1049 | { 0x2c4, 0x04 }, | |
| 1050 | { 0x2c5, 0x40 }, | |
| 1051 | { 0x2c6, 0x00 }, | |
| 1052 | { 0x2c7, 0x10 }, | |
| 1053 | { 0x2c8, 0x4e }, | |
| 1054 | { 0x2c9, 0x75 } | |
| 1055 | }; | |
| 1042 | 1056 | |
| 1057 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 1043 | 1058 | sys16_update_proc = fpoint_update_proc; |
| 1044 | 1059 | } |
| 1045 | 1060 | |
| r3957 | r3958 | |
| 1249 | 1264 | 2,3,6,7, |
| 1250 | 1265 | 10,11,0,0 |
| 1251 | 1266 | }; |
| 1267 | #if 0 | |
| 1268 | // protection patch; no longer needed | |
| 1269 | static const sys16_patch patch = | |
| 1270 | { | |
| 1271 | { 0x3CB2, 0x60 }, | |
| 1272 | { 0x3CB3, 0x1e } | |
| 1273 | }; | |
| 1274 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 1275 | #endif | |
| 1276 | ||
| 1252 | 1277 | sys16_obj_bank = bank; |
| 1253 | 1278 | |
| 1254 | // protection patch; no longer needed | |
| 1255 | // sys16_patch_code( 0x3CB2, 0x60 ); | |
| 1256 | // sys16_patch_code( 0x3CB3, 0x1e ); | |
| 1257 | 1279 | |
| 1258 | 1280 | sys16_sprxoffset = -0xb8; |
| 1259 | 1281 | sys16_update_proc = goldnaxe_update_proc; |
| r3957 | r3958 | |
| 1451 | 1473 | |
| 1452 | 1474 | static MACHINE_RESET( passsht ) |
| 1453 | 1475 | { |
| 1476 | // fix name entry | |
| 1477 | static const sys16_patch patch[] = | |
| 1478 | { | |
| 1479 | { 0x13a8,0xc0 } | |
| 1480 | }; | |
| 1481 | ||
| 1482 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 1454 | 1483 | sys16_sprxoffset = -0x48; |
| 1455 | 1484 | sys16_spritesystem = sys16_sprite_passshot; |
| 1456 | 1485 | |
| 1457 | // fix name entry | |
| 1458 | sys16_patch_code( 0x13a8,0xc0); | |
| 1459 | ||
| 1460 | 1486 | sys16_update_proc = passsht_update_proc; |
| 1461 | 1487 | } |
| 1462 | 1488 | |
| 1463 | 1489 | static MACHINE_RESET( passht4b ) |
| 1464 | 1490 | { |
| 1491 | // fix name entry | |
| 1492 | static const sys16_patch patch[] = | |
| 1493 | { | |
| 1494 | { 0x138a,0xc0 } | |
| 1495 | }; | |
| 1496 | ||
| 1497 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 1465 | 1498 | sys16_sprxoffset = -0xb8; |
| 1466 | 1499 | sys16_spritesystem = sys16_sprite_passshot; |
| 1467 | 1500 | |
| 1468 | // fix name entry | |
| 1469 | sys16_patch_code( 0x138a,0xc0); | |
| 1470 | ||
| 1471 | 1501 | sys16_update_proc = passht4b_update_proc; |
| 1472 | 1502 | } |
| 1473 | 1503 | |
| r3957 | r3958 | |
| 1775 | 1805 | |
| 1776 | 1806 | static MACHINE_RESET( tetrisbl ) |
| 1777 | 1807 | { |
| 1778 | // sys16_patch_code( 0xba6, 0x4e ); | |
| 1779 | // sys16_patch_code( 0xba7, 0x71 ); | |
| 1808 | #if 0 | |
| 1809 | static const sys16_patch patch[] = | |
| 1810 | { | |
| 1811 | { 0xba6, 0x4e }, | |
| 1812 | { 0xba7, 0x71 } | |
| 1813 | }; | |
| 1780 | 1814 | |
| 1815 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 1816 | #endif | |
| 1817 | ||
| 1781 | 1818 | sys16_sprxoffset = -0x40; |
| 1782 | 1819 | sys16_update_proc = tetris_bootleg_update_proc; |
| 1783 | 1820 | } |
| r3957 | r3958 | |
| 2102 | 2139 | 0,1, |
| 2103 | 2140 | 0,0 |
| 2104 | 2141 | }; |
| 2105 | sys16_obj_bank = bank; | |
| 2106 | 2142 | #if 1 |
| 2107 | sys16_patch_code( 0x17058, 0x4e ); | |
| 2108 | sys16_patch_code( 0x17059, 0xb9 ); | |
| 2109 | sys16_patch_code( 0x1705a, 0x00 ); | |
| 2110 | sys16_patch_code( 0x1705b, 0x00 ); | |
| 2111 | sys16_patch_code( 0x1705c, 0x09 ); | |
| 2112 | sys16_patch_code( 0x1705d, 0xdc ); | |
| 2113 | sys16_patch_code( 0x1705e, 0x4e ); | |
| 2114 | sys16_patch_code( 0x1705f, 0xf9 ); | |
| 2115 | sys16_patch_code( 0x17060, 0x00 ); | |
| 2116 | sys16_patch_code( 0x17061, 0x01 ); | |
| 2117 | sys16_patch_code( 0x17062, 0x70 ); | |
| 2118 | sys16_patch_code( 0x17063, 0xe0 ); | |
| 2119 | sys16_patch_code( 0x1a3a, 0x31 ); | |
| 2120 | sys16_patch_code( 0x1a3b, 0x7c ); | |
| 2121 | sys16_patch_code( 0x1a3c, 0x80 ); | |
| 2122 | sys16_patch_code( 0x1a3d, 0x00 ); | |
| 2123 | sys16_patch_code( 0x23df8, 0x14 ); | |
| 2124 | sys16_patch_code( 0x23df9, 0x41 ); | |
| 2125 | sys16_patch_code( 0x23dfa, 0x10 ); | |
| 2126 | sys16_patch_code( 0x23dfd, 0x14 ); | |
| 2127 | sys16_patch_code( 0x23dff, 0x1c ); | |
| 2143 | static const sys16_patch patch[] = | |
| 2144 | { | |
| 2145 | { 0x17058, 0x4e }, | |
| 2146 | { 0x17059, 0xb9 }, | |
| 2147 | { 0x1705a, 0x00 }, | |
| 2148 | { 0x1705b, 0x00 }, | |
| 2149 | { 0x1705c, 0x09 }, | |
| 2150 | { 0x1705d, 0xdc }, | |
| 2151 | { 0x1705e, 0x4e }, | |
| 2152 | { 0x1705f, 0xf9 }, | |
| 2153 | { 0x17060, 0x00 }, | |
| 2154 | { 0x17061, 0x01 }, | |
| 2155 | { 0x17062, 0x70 }, | |
| 2156 | { 0x17063, 0xe0 }, | |
| 2157 | { 0x1a3a, 0x31 }, | |
| 2158 | { 0x1a3b, 0x7c }, | |
| 2159 | { 0x1a3c, 0x80 }, | |
| 2160 | { 0x1a3d, 0x00 }, | |
| 2161 | { 0x23df8, 0x14 }, | |
| 2162 | { 0x23df9, 0x41 }, | |
| 2163 | { 0x23dfa, 0x10 }, | |
| 2164 | { 0x23dfd, 0x14 }, | |
| 2165 | { 0x23dff, 0x1c } | |
| 2166 | }; | |
| 2167 | ||
| 2168 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 2128 | 2169 | #endif |
| 2170 | sys16_obj_bank = bank; | |
| 2129 | 2171 | sys16_update_proc = wb3bbl_update_proc; |
| 2130 | 2172 | } |
| 2131 | 2173 |
| r3957 | r3958 | |
|---|---|---|
| 32 | 32 | ***************************************************************************/ |
| 33 | 33 | |
| 34 | 34 | #include "driver.h" |
| 35 | #include "cpu/m68000/m68000.h" | |
| 35 | 36 | #include "cpu/z80/z80.h" |
| 36 | 37 | #include "sound/okim6295.h" |
| 37 | 38 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 262 | 263 | static void irqhandler(running_machine *machine, int linestate) |
| 263 | 264 | { |
| 264 | 265 | /* system 16c doesn't have the sound CPU */ |
| 265 | if (machine->c | |
| 266 | if (machine->c | |
| 266 | 267 | cpu_set_input_line(machine->cpu[1],0,linestate); |
| 267 | 268 | } |
| 268 | 269 |
| r3957 | r3958 | |
|---|---|---|
| 402 | 402 | static const mc6845_interface mc6845_intf = |
| 403 | 403 | { |
| 404 | 404 | "main", /* screen we are acting on */ |
| 405 | CRTC_CLOCK, /* the clock (pin 21) of the chip */ | |
| 406 | 405 | 8, /* number of pixels per video memory address */ |
| 407 | 406 | begin_update, /* before pixel update callback */ |
| 408 | 407 | update_row, /* row update callback */ |
| r3957 | r3958 | |
| 684 | 683 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 685 | 684 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */ |
| 686 | 685 | |
| 687 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 688 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 686 | MDRV_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) | |
| 689 | 687 | |
| 690 | 688 | /* 74LS123 */ |
| 691 | 689 | |
| 692 | MDRV_DEVICE_ADD("ic48_1", TTL74123) | |
| 693 | MDRV_DEVICE_CONFIG(ic48_1_config) | |
| 690 | MDRV_TTL74123_ADD("ic48_1", ic48_1_config) | |
| 694 | 691 | |
| 695 | 692 | /* audio hardware */ |
| 696 | 693 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/e132xs/e132xs.h" | |
| 27 | 28 | #include "machine/eeprom.h" |
| 28 | 29 | #include "sound/okim6295.h" |
| 29 | 30 | #include "cpu/mcs51/mcs51.h" |
| r3957 | r3958 | |
| 380 | 381 | gfxdata = base_gfx + 64 * code; |
| 381 | 382 | |
| 382 | 383 | /* prepare GfxElement on the fly */ |
| 384 | gfx.machine = machine; | |
| 383 | 385 | gfx.width = width; |
| 384 | 386 | gfx.height = height; |
| 385 | 387 | gfx.total_elements = 1; |
| r3957 | r3958 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | #include "driver.h" |
| 86 | #include "cpu/z80/z80.h" | |
| 86 | 87 | #include "deprecat.h" |
| 87 | 88 | #include "machine/z80ctc.h" |
| 88 | 89 | #include "audio/mcr.h" |
| r3957 | r3958 | |
| 260 | 261 | static WRITE8_HANDLER( rampage_op6_w ) |
| 261 | 262 | { |
| 262 | 263 | /* bit 5 controls reset of the Sounds Good board */ |
| 263 | soundsgood_reset_w((~data >> 5) & 1); | |
| 264 | soundsgood_reset_w(space->machine, (~data >> 5) & 1); | |
| 264 | 265 | |
| 265 | 266 | /* low 5 bits go directly to the Sounds Good board */ |
| 266 | 267 | soundsgood_data_w(space, offset, data); |
| r3957 | r3958 | |
| 304 | 305 | static WRITE8_HANDLER( powerdrv_op6_w ) |
| 305 | 306 | { |
| 306 | 307 | /* bit 5 controls reset of the Sounds Good board */ |
| 307 | soundsgood_reset_w((~data >> 5) & 1); | |
| 308 | soundsgood_reset_w(space->machine, (~data >> 5) & 1); | |
| 308 | 309 | |
| 309 | 310 | /* low 5 bits go directly to the Sounds Good board */ |
| 310 | 311 | soundsgood_data_w(space, offset, data); |
| r3957 | r3958 | |
| 347 | 348 | static WRITE8_HANDLER( stargrds_op6_w ) |
| 348 | 349 | { |
| 349 | 350 | /* bit 6 controls reset of the Sounds Good board */ |
| 350 | soundsgood_reset_w((~data >> 6) & 1); | |
| 351 | soundsgood_reset_w(space->machine, (~data >> 6) & 1); | |
| 351 | 352 | |
| 352 | 353 | /* unline the other games, the STROBE is in the high bit instead of the low bit */ |
| 353 | 354 | soundsgood_data_w(space, offset, (data << 1) | (data >> 7)); |
| r3957 | r3958 | |
| 1055 | 1056 | MDRV_CPU_CONFIG(mcr_daisy_chain) |
| 1056 | 1057 | MDRV_CPU_VBLANK_INT_HACK(mcr_interrupt,2) |
| 1057 | 1058 | |
| 1058 | MDRV_Z80CTC_ADD("ctc", mcr_ctc_intf) | |
| 1059 | MDRV_Z80CTC_ADD("ctc", MASTER_CLOCK/4 /* same as "main" */, mcr_ctc_intf) | |
| 1059 | 1060 | |
| 1060 | 1061 | MDRV_WATCHDOG_VBLANK_INIT(16) |
| 1061 | 1062 | MDRV_MACHINE_START(mcr) |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | */ |
| 49 | 49 | |
| 50 | 50 | #include "driver.h" |
| 51 | #include "cpu/z80/z80.h" | |
| 51 | 52 | #include "machine/z80ctc.h" |
| 52 | 53 | #include "sound/2203intf.h" |
| 53 | 54 | #include "machine/8255ppi.h" |
| r3957 | r3958 | |
| 292 | 293 | |
| 293 | 294 | static const z80ctc_interface ctc_intf = |
| 294 | 295 | { |
| 295 | "audio", // clock from audio CPU | |
| 296 | 0, // clock | |
| 297 | 296 | 0, // timer disables |
| 298 | 297 | ctc0_interrupt, // interrupt handler |
| 299 | 298 | 0, // ZC/TO0 callback |
| r3957 | r3958 | |
| 379 | 378 | MDRV_CPU_ADD("mcu", M68705, 7372800/2) |
| 380 | 379 | MDRV_CPU_PROGRAM_MAP(mcu_mem, 0) |
| 381 | 380 | |
| 382 | MDRV_Z80CTC_ADD( "ctc", ctc_intf ) | |
| 381 | MDRV_Z80CTC_ADD( "ctc", 7372800/2 /* same as "audio" */, ctc_intf ) | |
| 383 | 382 | |
| 384 | 383 | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] ) |
| 385 | 384 | MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] ) |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | ***************************************************************************/ |
| 63 | 63 | |
| 64 | 64 | #include "driver.h" |
| 65 | #include "cpu/z80/z80.h" | |
| 65 | 66 | #include "machine/segacrpt.h" |
| 66 | 67 | #include "pacman.h" |
| 67 | 68 | #include "sound/namco.h" |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/m68000/m68000.h" | |
| 10 | 11 | #include "cpu/m6502/m6502.h" |
| 11 | 12 | #include "sound/2203intf.h" |
| 12 | 13 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 13 | #include "cpu/m68000/m68000.h" | |
| 12 | 14 | #include "sound/upd7759.h" |
| 13 | 15 | #include "sound/3812intf.h" |
| 14 | 16 |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | *******************************************************************************/ |
| 139 | 139 | |
| 140 | 140 | #include "driver.h" |
| 141 | #include "deprecat.h" | |
| 142 | 141 | #include "cpu/m68000/m68000.h" |
| 143 | 142 | #include "cpu/z80/z80.h" |
| 144 | 143 | #include "sound/2151intf.h" |
| 145 | 144 | #include "sound/okim6295.h" |
| 146 | 145 | |
| 146 | #define MASTER_CLOCK XTAL_20MHz | |
| 147 | #define CPU_CLOCK MASTER_CLOCK / 2 | |
| 148 | #define PIXEL_CLOCK MASTER_CLOCK / 4 | |
| 149 | ||
| 147 | 150 | /* in (video/wwfsstar.c) */ |
| 148 | 151 | VIDEO_START( wwfsstar ); |
| 149 | 152 | VIDEO_UPDATE( wwfsstar ); |
| r3957 | r3958 | |
| 157 | 160 | static WRITE16_HANDLER ( wwfsstar_soundwrite ); |
| 158 | 161 | static WRITE16_HANDLER ( wwfsstar_scrollwrite ); |
| 159 | 162 | |
| 160 | static int vblank; | |
| 163 | static int vblank = 0; | |
| 161 | 164 | |
| 162 | 165 | /******************************************************************************* |
| 163 | 166 | Memory Maps |
| r3957 | r3958 | |
| 222 | 225 | |
| 223 | 226 | static WRITE16_HANDLER( wwfsstar_flipscreen_w ) |
| 224 | 227 | { |
| 225 | flip_screen_set(data & 1); | |
| 228 | flip_screen_set(space->machine, data & 1); | |
| 226 | 229 | } |
| 227 | 230 | |
| 228 | 231 | static WRITE16_HANDLER( wwfsstar_irqack_w ) |
| 229 | 232 | { |
| 230 | if(offset == 0) | |
| 233 | if (offset == 0) | |
| 231 | 234 | cpu_set_input_line(space->machine->cpu[0], 6, CLEAR_LINE); |
| 232 | 235 | |
| 233 | 236 | else |
| r3957 | r3958 | |
| 247 | 250 | A hack is required: raise the vblank bit a scanline early. |
| 248 | 251 | */ |
| 249 | 252 | |
| 250 | static | |
| 253 | static | |
| 251 | 254 | { |
| 252 | int scanline = | |
| 255 | int scanline = | |
| 253 | 256 | |
| 254 | /* Vblank is lowered on scanline 0 | |
| 257 | /* Vblank is lowered on scanline 0 | |
| 255 | 258 | if (scanline == 0) |
| 256 | 259 | { |
| 257 | 260 | vblank = 0; |
| 258 | 261 | } |
| 259 | 262 | /* Hack */ |
| 260 | else if (scanline==2 | |
| 263 | else if (scanline == (240-1)) /* -1 is an hack needed to avoid deadlocks */ | |
| 261 | 264 | { |
| 262 | 265 | vblank = 1; |
| 263 | 266 | } |
| 264 | /* Vblank is raised on scanline 240 (248) */ | |
| 265 | else if (scanline==240) | |
| 267 | ||
| 268 | /* An interrupt is generated every 16 scanlines */ | |
| 269 | if (scanline % 16 == 0) | |
| 266 | 270 | { |
| 267 | video_screen_update_partial(device->machine->primary_screen, scanline); | |
| 268 | cpu_set_input_line(device, 6, ASSERT_LINE); | |
| 271 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 272 | cpu_set_input_line(timer->machine->cpu[0], 5, ASSERT_LINE); | |
| 269 | 273 | } |
| 270 | 274 | |
| 271 | /* An interrupt is generated every 16 scanlines */ | |
| 272 | if (scanline%16 == 0) | |
| 275 | /* Vblank is raised on scanline 240 */ | |
| 276 | if (scanline == 240) | |
| 273 | 277 | { |
| 274 | video_screen_update_partial(device->machine->primary_screen, scanline); | |
| 275 | cpu_set_input_line(device, 5, ASSERT_LINE); | |
| 278 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 279 | cpu_set_input_line(timer->machine->cpu[0], 6, ASSERT_LINE); | |
| 276 | 280 | } |
| 281 | ||
| 282 | /* Adjust for next scanline */ | |
| 283 | if (++scanline >= video_screen_get_height(timer->machine->primary_screen)) | |
| 284 | { | |
| 285 | scanline = 0; | |
| 286 | } | |
| 277 | 287 | } |
| 278 | 288 | |
| 279 | 289 | static CUSTOM_INPUT( wwfsstar_vblank_r ) |
| r3957 | r3958 | |
| 432 | 442 | static MACHINE_DRIVER_START( wwfsstar ) |
| 433 | 443 | |
| 434 | 444 | /* basic machine hardware */ |
| 435 | MDRV_CPU_ADD("main", M68000, | |
| 445 | MDRV_CPU_ADD("main", M68000, CPU | |
| 436 | 446 | MDRV_CPU_PROGRAM_MAP(main_map, 0) |
| 437 | MDRV_ | |
| 447 | MDRV_TIMER_ | |
| 438 | 448 | |
| 439 | 449 | MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) |
| 440 | 450 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 441 | 451 | |
| 442 | 452 | /* video hardware */ |
| 443 | 453 | MDRV_SCREEN_ADD("main", RASTER) |
| 444 | MDRV_SCREEN_REFRESH_RATE(57.44) | |
| 445 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 446 | 454 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 447 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 448 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
| 455 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 320, 0, 256, 272, 8, 248) /* HTOTAL and VTOTAL are guessed */ | |
| 449 | 456 | |
| 450 | 457 | MDRV_GFXDECODE(wwfsstar) |
| 451 | 458 | MDRV_PALETTE_LENGTH(384) |
| r3957 | r3958 | |
|---|---|---|
| 625 | 625 | */ |
| 626 | 626 | |
| 627 | 627 | #include "driver.h" |
| 628 | #include "cpu/v60/v60.h" | |
| 628 | 629 | #include "deprecat.h" |
| 629 | 630 | #include "machine/eeprom.h" |
| 630 | 631 | #include "system16.h" |
| r3957 | r3958 | |
|---|---|---|
| 211 | 211 | ***************************************************************************/ |
| 212 | 212 | |
| 213 | 213 | #include "driver.h" |
| 214 | #include "cpu/z80/z80.h" | |
| 215 | #include "cpu/mb88xx/mb88xx.h" | |
| 214 | 216 | #include "deprecat.h" |
| 215 | 217 | #include "machine/namcoio.h" |
| 216 | 218 | #include "sound/namco.h" |
| r3957 | r3958 | |
| 286 | 288 | switch (offset) |
| 287 | 289 | { |
| 288 | 290 | case 0x00: /* IRQON */ |
| 289 | cpu_interrupt_enable(0,bit); | |
| 291 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 290 | 292 | if (!bit) |
| 291 | 293 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 292 | 294 | break; |
| r3957 | r3958 | |
| 330 | 332 | { |
| 331 | 333 | data &= 1; |
| 332 | 334 | |
| 333 | cpu_interrupt_enable( | |
| 335 | cpu_interrupt_enable( | |
| 334 | 336 | if (!data) |
| 335 | 337 | cpu_set_input_line(space->cpu, 0, CLEAR_LINE); |
| 336 | 338 | } |
| r3957 | r3958 | |
| 857 | 859 | |
| 858 | 860 | MDRV_WATCHDOG_VBLANK_INIT(16) // 128V clocks the same as VBLANK |
| 859 | 861 | |
| 860 | MDRV_ | |
| 862 | MDRV_QUANTUM_TIME | |
| 861 | 863 | |
| 862 | 864 | MDRV_MACHINE_RESET(polepos) |
| 863 | 865 | MDRV_NVRAM_HANDLER(generic_1fill) |
| r3957 | r3958 | |
|---|---|---|
| 168 | 168 | ***************************************************************************/ |
| 169 | 169 | |
| 170 | 170 | #include "driver.h" |
| 171 | #include " | |
| 171 | #include " | |
| 172 | 172 | #include "taitoipt.h" |
| 173 | 173 | #include "cpu/m68000/m68000.h" |
| 174 | 174 | #include "video/taitoic.h" |
| r3957 | r3958 | |
| 341 | 341 | { |
| 342 | 342 | if (offset==0) |
| 343 | 343 | { |
| 344 | MB87078_data_w(0, data>>8, 0); | |
| 344 | MB87078_data_w(space->machine, 0, data>>8, 0); | |
| 345 | 345 | //logerror("MB87078 dsel=0 data=%4x\n",data); |
| 346 | 346 | } |
| 347 | 347 | else |
| 348 | 348 | { |
| 349 | MB87078_data_w(0, data>>8, 1); | |
| 349 | MB87078_data_w(space->machine, 0, data>>8, 1); | |
| 350 | 350 | //logerror("MB87078 dsel=1 data=%4x\n",data); |
| 351 | 351 | } |
| 352 | 352 | } |
| r3957 | r3958 | |
| 2387 | 2387 | Both ym2610 and ym2610b generate 3 (PSG like) + 2 (fm left,right) channels. |
| 2388 | 2388 | I use mixer_set_volume() to emulate the effect. |
| 2389 | 2389 | */ |
| 2390 | static void mb87078_gain_changed(int channel, int percent) | |
| 2390 | static void mb87078_gain_changed(running_machine *machine, int channel, int percent) | |
| 2391 | 2391 | { |
| 2392 | 2392 | if (channel==1) |
| 2393 | 2393 | { |
| 2394 | sound_type type = | |
| 2394 | sound_type type = machine->config->sound[0].type; | |
| 2395 | 2395 | sndti_set_output_gain(type, 0, 0, percent / 100.0); |
| 2396 | 2396 | sndti_set_output_gain(type, 1, 0, percent / 100.0); |
| 2397 | 2397 | sndti_set_output_gain(type, 2, 0, percent / 100.0); |
| r3957 | r3958 | |
| 2407 | 2407 | |
| 2408 | 2408 | static MACHINE_RESET( mb87078 ) |
| 2409 | 2409 | { |
| 2410 | MB87078_start(0, &mb87078_interface); /*chip #0*/ | |
| 2410 | MB87078_start(machine, 0, &mb87078_interface); /*chip #0*/ | |
| 2411 | 2411 | /* |
| 2412 | 2412 | { |
| 2413 | 2413 | int i; |
| r3957 | r3958 | |
| 2428 | 2428 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2429 | 2429 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2430 | 2430 | |
| 2431 | MDRV_ | |
| 2431 | MDRV_QUANTUM_TIME | |
| 2432 | 2432 | |
| 2433 | 2433 | /* video hardware */ |
| 2434 | 2434 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2466 | 2466 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2467 | 2467 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2468 | 2468 | |
| 2469 | MDRV_ | |
| 2469 | MDRV_QUANTUM_TIME | |
| 2470 | 2470 | |
| 2471 | 2471 | /* video hardware */ |
| 2472 | 2472 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2504 | 2504 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2505 | 2505 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2506 | 2506 | |
| 2507 | MDRV_ | |
| 2507 | MDRV_QUANTUM_TIME | |
| 2508 | 2508 | |
| 2509 | 2509 | /* video hardware */ |
| 2510 | 2510 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2542 | 2542 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2543 | 2543 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2544 | 2544 | |
| 2545 | MDRV_ | |
| 2545 | MDRV_QUANTUM_TIME | |
| 2546 | 2546 | |
| 2547 | 2547 | /* video hardware */ |
| 2548 | 2548 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2579 | 2579 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2580 | 2580 | MDRV_CPU_PROGRAM_MAP(masterw_sound_readmem,masterw_sound_writemem) |
| 2581 | 2581 | |
| 2582 | MDRV_ | |
| 2582 | MDRV_QUANTUM_TIME | |
| 2583 | 2583 | |
| 2584 | 2584 | /* video hardware */ |
| 2585 | 2585 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2617 | 2617 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2618 | 2618 | MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem) |
| 2619 | 2619 | |
| 2620 | MDRV_ | |
| 2620 | MDRV_QUANTUM_TIME | |
| 2621 | 2621 | |
| 2622 | 2622 | /* video hardware */ |
| 2623 | 2623 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2661 | 2661 | MDRV_CPU_ADD("audio", Z80, XTAL_24MHz/6) /* verified on pcb */ |
| 2662 | 2662 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2663 | 2663 | |
| 2664 | MDRV_ | |
| 2664 | MDRV_QUANTUM_TIME | |
| 2665 | 2665 | |
| 2666 | 2666 | /* video hardware */ |
| 2667 | 2667 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2699 | 2699 | MDRV_CPU_ADD("audio", Z80, XTAL_24MHz/6) /* verified on pcb */ |
| 2700 | 2700 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2701 | 2701 | |
| 2702 | MDRV_ | |
| 2702 | MDRV_QUANTUM_TIME | |
| 2703 | 2703 | |
| 2704 | 2704 | /* video hardware */ |
| 2705 | 2705 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2737 | 2737 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2738 | 2738 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2739 | 2739 | |
| 2740 | MDRV_ | |
| 2740 | MDRV_QUANTUM_TIME | |
| 2741 | 2741 | |
| 2742 | 2742 | MDRV_MACHINE_RESET(mb87078) |
| 2743 | 2743 | MDRV_NVRAM_HANDLER(taito_b) |
| r3957 | r3958 | |
| 2778 | 2778 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2779 | 2779 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2780 | 2780 | |
| 2781 | MDRV_ | |
| 2781 | MDRV_QUANTUM_TIME | |
| 2782 | 2782 | |
| 2783 | 2783 | MDRV_MACHINE_RESET(mb87078) |
| 2784 | 2784 | MDRV_NVRAM_HANDLER(taito_b) |
| r3957 | r3958 | |
| 2819 | 2819 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2820 | 2820 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2821 | 2821 | |
| 2822 | MDRV_ | |
| 2822 | MDRV_QUANTUM_TIME | |
| 2823 | 2823 | |
| 2824 | 2824 | /* video hardware */ |
| 2825 | 2825 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2857 | 2857 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2858 | 2858 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2859 | 2859 | |
| 2860 | MDRV_ | |
| 2860 | MDRV_QUANTUM_TIME | |
| 2861 | 2861 | |
| 2862 | 2862 | MDRV_MACHINE_RESET(mb87078) |
| 2863 | 2863 | MDRV_NVRAM_HANDLER(taito_b) |
| r3957 | r3958 | |
| 2898 | 2898 | MDRV_CPU_ADD("audio", Z80, 6000000) /* 6 MHz verified */ |
| 2899 | 2899 | MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem) |
| 2900 | 2900 | |
| 2901 | MDRV_ | |
| 2901 | MDRV_QUANTUM_TIME | |
| 2902 | 2902 | |
| 2903 | 2903 | /* video hardware */ |
| 2904 | 2904 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2940 | 2940 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2941 | 2941 | MDRV_CPU_PROGRAM_MAP(masterw_sound_readmem,masterw_sound_writemem) |
| 2942 | 2942 | |
| 2943 | MDRV_ | |
| 2943 | MDRV_QUANTUM_TIME | |
| 2944 | 2944 | |
| 2945 | 2945 | /* video hardware */ |
| 2946 | 2946 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 2979 | 2979 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 2980 | 2980 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 2981 | 2981 | |
| 2982 | MDRV_ | |
| 2982 | MDRV_QUANTUM_TIME | |
| 2983 | 2983 | |
| 2984 | 2984 | /* video hardware */ |
| 2985 | 2985 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3017 | 3017 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 3018 | 3018 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 3019 | 3019 | |
| 3020 | MDRV_ | |
| 3020 | MDRV_QUANTUM_TIME | |
| 3021 | 3021 | |
| 3022 | 3022 | /* video hardware */ |
| 3023 | 3023 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3064 | 3064 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 3065 | 3065 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 3066 | 3066 | |
| 3067 | MDRV_ | |
| 3067 | MDRV_QUANTUM_TIME | |
| 3068 | 3068 | |
| 3069 | 3069 | /* video hardware */ |
| 3070 | 3070 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3109 | 3109 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz */ |
| 3110 | 3110 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 3111 | 3111 | |
| 3112 | MDRV_ | |
| 3112 | MDRV_QUANTUM_TIME | |
| 3113 | 3113 | |
| 3114 | 3114 | /* video hardware */ |
| 3115 | 3115 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 92 | 92 | static WRITE8_HANDLER( jackal_flipscreen_w ) |
| 93 | 93 | { |
| 94 | 94 | irq_enable = data & 0x02; |
| 95 | flip_screen_set(data & 0x08); | |
| 95 | flip_screen_set(space->machine, data & 0x08); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /* Memory Maps */ |
| r3957 | r3958 | |
| 307 | 307 | MDRV_CPU_ADD("slave", M6809, MASTER_CLOCK/12) // verified on pcb |
| 308 | 308 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| 309 | 309 | |
| 310 | MDRV_ | |
| 310 | MDRV_QUANTUM_TIME | |
| 311 | 311 | |
| 312 | 312 | MDRV_MACHINE_RESET(jackal) |
| 313 | 313 |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6800/m6800.h" | |
| 8 | 9 | #include "tank8.h" |
| 9 | 10 | #include "sound/discrete.h" |
| 10 | 11 |
| r3957 | r3958 | |
|---|---|---|
| 590 | 590 | devtag_reset(machine, IDE_CONTROLLER, "ide"); |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | static const timekeeper_config timekeeper_intf = | |
| 594 | { | |
| 595 | "m48t58" | |
| 596 | }; | |
| 597 | ||
| 598 | 593 | static MACHINE_DRIVER_START(viper) |
| 599 | 594 | |
| 600 | 595 | /* basic machine hardware */ |
| r3957 | r3958 | |
| 627 | 622 | /* sound hardware */ |
| 628 | 623 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 629 | 624 | |
| 630 | MDRV_DEVICE_ADD( "m48t58", M48T58 ) | |
| 631 | MDRV_DEVICE_CONFIG( timekeeper_intf ) | |
| 625 | MDRV_M48T58_ADD( "m48t58" ) | |
| 632 | 626 | MACHINE_DRIVER_END |
| 633 | 627 | |
| 634 | 628 | /*****************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | ****************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "cpu/z80/z80.h" | |
| 38 | #include "cpu/i8085/i8085.h" | |
| 37 | 39 | #include "deprecat.h" |
| 38 | 40 | #include "machine/pcecommn.h" |
| 39 | 41 | #include "video/vdc.h" |
| r3957 | r3958 | |
| 135 | 137 | MDRV_CPU_IO_MAP(pce_io, 0) |
| 136 | 138 | MDRV_CPU_VBLANK_INT_HACK(pce_interrupt, VDC_LPF) |
| 137 | 139 | |
| 138 | MDRV_ | |
| 140 | MDRV_QUANTUM_TIME | |
| 139 | 141 | |
| 140 | 142 | MDRV_CPU_ADD("sub", 8085A, 18000000/3) |
| 141 | 143 | MDRV_CPU_PROGRAM_MAP(paranoia_8085_map,0) |
| r3957 | r3958 | |
|---|---|---|
| 141 | 141 | ****************************************************************************/ |
| 142 | 142 | |
| 143 | 143 | #include "driver.h" |
| 144 | #include "cpu/i8085/i8085.h" | |
| 144 | 145 | #include "rendlay.h" |
| 145 | 146 | #include "machine/rescap.h" |
| 146 | 147 | #include "mw8080bw.h" |
| r3957 | r3958 | |
| 834 | 835 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 835 | 836 | MDRV_CPU_MODIFY("main") |
| 836 | 837 | MDRV_CPU_IO_MAP(zzzap_io_map,0) |
| 837 | MDRV_WATCHDOG_TIME_INIT( | |
| 838 | MDRV_WATCHDOG_TIME_INIT( | |
| 838 | 839 | |
| 839 | 840 | /* audio hardware */ |
| 840 | 841 | /* MDRV_IMPORT_FROM(zzzap_audio) */ |
| r3957 | r3958 | |
| 946 | 947 | MDRV_CPU_MODIFY("main") |
| 947 | 948 | MDRV_CPU_IO_MAP(maze_io_map,0) |
| 948 | 949 | MDRV_MACHINE_START(maze) |
| 949 | MDRV_WATCHDOG_TIME_INIT( | |
| 950 | MDRV_WATCHDOG_TIME_INIT( | |
| 950 | 951 | |
| 951 | 952 | /* audio hardware */ |
| 952 | 953 | MDRV_IMPORT_FROM(maze_audio) |
| r3957 | r3958 | |
| 1037 | 1038 | MDRV_CPU_MODIFY("main") |
| 1038 | 1039 | MDRV_CPU_IO_MAP(boothill_io_map,0) |
| 1039 | 1040 | MDRV_MACHINE_START(boothill) |
| 1040 | MDRV_WATCHDOG_TIME_INIT( | |
| 1041 | MDRV_WATCHDOG_TIME_INIT( | |
| 1041 | 1042 | |
| 1042 | 1043 | /* audio hardware */ |
| 1043 | 1044 | MDRV_IMPORT_FROM(boothill_audio) |
| r3957 | r3958 | |
| 1139 | 1140 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 1140 | 1141 | MDRV_CPU_MODIFY("main") |
| 1141 | 1142 | MDRV_CPU_IO_MAP(checkmat_io_map,0) |
| 1142 | MDRV_WATCHDOG_TIME_INIT( | |
| 1143 | MDRV_WATCHDOG_TIME_INIT( | |
| 1143 | 1144 | |
| 1144 | 1145 | /* audio hardware */ |
| 1145 | 1146 | MDRV_IMPORT_FROM(checkmat_audio) |
| r3957 | r3958 | |
| 1275 | 1276 | MDRV_CPU_MODIFY("main") |
| 1276 | 1277 | MDRV_CPU_IO_MAP(desertgu_io_map,0) |
| 1277 | 1278 | MDRV_MACHINE_START(desertgu) |
| 1278 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1279 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1279 | 1280 | |
| 1280 | 1281 | /* audio hardware */ |
| 1281 | 1282 | MDRV_IMPORT_FROM(desertgu_audio) |
| r3957 | r3958 | |
| 1472 | 1473 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 1473 | 1474 | MDRV_CPU_MODIFY("main") |
| 1474 | 1475 | MDRV_CPU_IO_MAP(dplay_io_map,0) |
| 1475 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1476 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1476 | 1477 | |
| 1477 | 1478 | /* audio hardware */ |
| 1478 | 1479 | MDRV_IMPORT_FROM(dplay_audio) |
| r3957 | r3958 | |
| 1654 | 1655 | MDRV_CPU_MODIFY("main") |
| 1655 | 1656 | MDRV_CPU_IO_MAP(m4_io_map,0) |
| 1656 | 1657 | MDRV_MACHINE_START(m4) |
| 1657 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1658 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1658 | 1659 | |
| 1659 | 1660 | /* audio hardware */ |
| 1660 | 1661 | MDRV_IMPORT_FROM(m4_audio) |
| r3957 | r3958 | |
| 1828 | 1829 | MDRV_CPU_MODIFY("main") |
| 1829 | 1830 | MDRV_CPU_IO_MAP(clowns_io_map,0) |
| 1830 | 1831 | MDRV_MACHINE_START(clowns) |
| 1831 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1832 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1832 | 1833 | |
| 1833 | 1834 | /* audio hardware */ |
| 1834 | 1835 | MDRV_IMPORT_FROM(clowns_audio) |
| r3957 | r3958 | |
| 1906 | 1907 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 1907 | 1908 | MDRV_CPU_MODIFY("main") |
| 1908 | 1909 | MDRV_CPU_IO_MAP(shuffle_io_map,0) |
| 1909 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1910 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1910 | 1911 | |
| 1911 | 1912 | /* audio hardware */ |
| 1912 | 1913 | /* MDRV_IMPORT_FROM(shuffle_audio) */ |
| r3957 | r3958 | |
| 1991 | 1992 | MDRV_CPU_IO_MAP(dogpatch_io_map,0) |
| 1992 | 1993 | /* the watch dog time is unknown, but all other */ |
| 1993 | 1994 | /* Midway boards of the era used the same circuit */ |
| 1994 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1995 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1995 | 1996 | |
| 1996 | 1997 | /* audio hardware */ |
| 1997 | 1998 | MDRV_IMPORT_FROM(dogpatch_audio) |
| r3957 | r3958 | |
| 2157 | 2158 | MDRV_CPU_MODIFY("main") |
| 2158 | 2159 | MDRV_CPU_IO_MAP(spcenctr_io_map,0) |
| 2159 | 2160 | MDRV_MACHINE_START(spcenctr) |
| 2160 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2161 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2161 | 2162 | |
| 2162 | 2163 | /* timers */ |
| 2163 | 2164 | MDRV_TIMER_ADD_PERIODIC("strobeon", spcenctr_strobe_timer_callback, HZ(SPCENCTR_STROBE_FREQ)) |
| r3957 | r3958 | |
| 2265 | 2266 | MDRV_CPU_MODIFY("main") |
| 2266 | 2267 | MDRV_CPU_IO_MAP(phantom2_io_map,0) |
| 2267 | 2268 | MDRV_MACHINE_START(phantom2) |
| 2268 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2269 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2269 | 2270 | |
| 2270 | 2271 | /* video hardware */ |
| 2271 | 2272 | MDRV_VIDEO_UPDATE(phantom2) |
| r3957 | r3958 | |
| 2401 | 2402 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 2402 | 2403 | MDRV_CPU_MODIFY("main") |
| 2403 | 2404 | MDRV_CPU_IO_MAP(bowler_io_map,0) |
| 2404 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2405 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2405 | 2406 | |
| 2406 | 2407 | /* audio hardware */ |
| 2407 | 2408 | MDRV_IMPORT_FROM(bowler_audio) |
| r3957 | r3958 | |
| 2627 | 2628 | MDRV_CPU_MODIFY("main") |
| 2628 | 2629 | MDRV_CPU_IO_MAP(invaders_io_map,0) |
| 2629 | 2630 | MDRV_MACHINE_START(invaders) |
| 2630 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2631 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2631 | 2632 | |
| 2632 | 2633 | /* video hardware */ |
| 2633 | 2634 | MDRV_VIDEO_UPDATE(invaders) |
| r3957 | r3958 | |
| 2706 | 2707 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 2707 | 2708 | MDRV_CPU_MODIFY("main") |
| 2708 | 2709 | MDRV_CPU_IO_MAP(blueshrk_io_map,0) |
| 2709 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2710 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2710 | 2711 | |
| 2711 | 2712 | /* audio hardware */ |
| 2712 | 2713 | MDRV_IMPORT_FROM(blueshrk_audio) |
| r3957 | r3958 | |
| 2804 | 2805 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 2805 | 2806 | MDRV_CPU_MODIFY("main") |
| 2806 | 2807 | MDRV_CPU_IO_MAP(invad2ct_io_map,0) |
| 2807 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2808 | MDRV_WATCHDOG_TIME_INIT(U | |
| 2808 | 2809 | |
| 2809 | 2810 | /* audio hardware */ |
| 2810 | 2811 | MDRV_IMPORT_FROM(invad2ct_audio) |
| r3957 | r3958 | |
|---|---|---|
| 175 | 175 | *******************************************************************/ |
| 176 | 176 | |
| 177 | 177 | #include "driver.h" |
| 178 | #include "cpu/m6809/m6809.h" | |
| 178 | 179 | #include "cpu/m6800/m6800.h" |
| 179 | 180 | #include "sound/2151intf.h" |
| 180 | 181 | #include "sound/namco.h" |
| r3957 | r3958 | |
| 1069 | 1070 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 1070 | 1071 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* ??? */ |
| 1071 | 1072 | |
| 1072 | MDRV_ | |
| 1073 | MDRV_QUANTUM_TIME | |
| 1073 | 1074 | |
| 1074 | 1075 | MDRV_MACHINE_RESET(namco86) |
| 1075 | 1076 |
| r3957 | r3958 | |
|---|---|---|
| 501 | 501 | */ |
| 502 | 502 | static WRITE8_HANDLER( hardhead_flipscreen_w ) |
| 503 | 503 | { |
| 504 | flip_screen_set( data & 0x04); | |
| 504 | flip_screen_set(space->machine, data & 0x04); | |
| 505 | 505 | coin_lockout_w ( 0, data & 0x08); |
| 506 | 506 | coin_lockout_w ( 1, data & 0x10); |
| 507 | 507 | } |
| r3957 | r3958 | |
| 559 | 559 | |
| 560 | 560 | memory_set_bank(space->machine, 1, bank); |
| 561 | 561 | |
| 562 | flip_screen_set( data & 0x20); | |
| 562 | flip_screen_set(space->machine, data & 0x20); | |
| 563 | 563 | coin_lockout_w ( 0, data & 0x40); |
| 564 | 564 | coin_lockout_w ( 1, data & 0x80); |
| 565 | 565 | } |
| r3957 | r3958 | |
| 642 | 642 | { |
| 643 | 643 | suna8_spritebank = (data >> 1) & 1; |
| 644 | 644 | if (data & ~0x03) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(space->cpu),data); |
| 645 | flip_screen_set( data & 0x01 ); | |
| 645 | flip_screen_set(space->machine, data & 0x01 ); | |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | static WRITE8_HANDLER( brickzn_unknown_w ) |
| r3957 | r3958 | |
| 711 | 711 | */ |
| 712 | 712 | static WRITE8_HANDLER( hardhea2_flipscreen_w ) |
| 713 | 713 | { |
| 714 | flip_screen_set(data & 0x01); | |
| 714 | flip_screen_set(space->machine, data & 0x01); | |
| 715 | 715 | if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(space->cpu),data); |
| 716 | 716 | } |
| 717 | 717 | |
| r3957 | r3958 | |
| 876 | 876 | */ |
| 877 | 877 | static WRITE8_HANDLER( sparkman_flipscreen_w ) |
| 878 | 878 | { |
| 879 | flip_screen_set(data & 0x01); | |
| 879 | flip_screen_set(space->machine, data & 0x01); | |
| 880 | 880 | if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(space->cpu),data); |
| 881 | 881 | } |
| 882 | 882 |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/m68000/m68000.h" | |
| 12 | 13 | #include "cpu/h6280/h6280.h" |
| 13 | 14 | #include "sound/2203intf.h" |
| 14 | 15 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | ****************************************************************************************/ |
| 48 | 48 | |
| 49 | 49 | #include "driver.h" |
| 50 | #include "cpu/m6809/m6809.h" | |
| 50 | 51 | #include "sound/2203intf.h" |
| 51 | 52 | |
| 52 | 53 | static tilemap *bg_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 230 | 230 | ***************************************************************************/ |
| 231 | 231 | |
| 232 | 232 | #include "driver.h" |
| 233 | #include "cpu/z80/z80.h" | |
| 234 | #include "cpu/pic16c5x/pic16c5x.h" | |
| 235 | #include "cpu/m68000/m68000.h" | |
| 233 | 236 | #include "machine/eeprom.h" |
| 234 | 237 | #include "sound/2151intf.h" |
| 235 | 238 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | ******************************************************************************/ |
| 119 | 119 | |
| 120 | 120 | #include "driver.h" |
| 121 | #include "cpu/z80/z80.h" | |
| 121 | 122 | #include "deprecat.h" |
| 122 | 123 | #include "sound/ay8910.h" |
| 123 | 124 | #include "nova2001.h" |
| r3957 | r3958 | |
| 743 | 744 | MDRV_CPU_PROGRAM_MAP(ninjakun_cpu2_map,0) |
| 744 | 745 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* ? */ |
| 745 | 746 | |
| 746 | MDRV_ | |
| 747 | MDRV_QUANTUM_TIME | |
| 747 | 748 | |
| 748 | 749 | MDRV_MACHINE_START(ninjakun) |
| 749 | 750 | |
| r3957 | r3958 | |
| 819 | 820 | MDRV_CPU_PROGRAM_MAP(raiders5_cpu2_map,0) |
| 820 | 821 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* ? */ |
| 821 | 822 | |
| 822 | MDRV_ | |
| 823 | MDRV_QUANTUM_TIME | |
| 823 | 824 | |
| 824 | 825 | /* video hardware */ |
| 825 | 826 | MDRV_SCREEN_ADD("main", RASTER) |
| r0 | r3958 | |
|---|---|---|
| 1 | /******************************************************************************************* | |
| 2 | ||
| 3 | 4nin-uchi Mahjong Jantotsu (c) 1983 Sanritsu | |
| 4 | ||
| 5 | driver by David Haywood and Angelo Salese | |
| 6 | ||
| 7 | Notes: | |
| 8 | -The 1-2 Player tiles on hand are actually shown on different screen sides.The Service Mode | |
| 9 | is for adjusting these screens (to not let the human opponent to read your tiles). | |
| 10 | ||
| 11 | TODO: | |
| 12 | -Video buffering? If you coin up,you can see the "credit 1" msg that gets build into the | |
| 13 | video bitmaps... | |
| 14 | -According to the flyer,color bitplanes might be wrong on the A-N mahjong charset,might be a | |
| 15 | BTANB however... | |
| 16 | -I need schematics / pcb photos (component + solder sides) to understand if the background | |
| 17 | color is hard-wired to the DIP-Switches or there's something else wrong. | |
| 18 | -Missing MSM5205 samples; | |
| 19 | ||
| 20 | ============================================================================================ | |
| 21 | Debug cheats: | |
| 22 | ||
| 23 | c01b-c028 player-1 tiles | |
| 24 | c02b-c038 right computer tiles | |
| 25 | c03b-c048 up computer tiles / player-2 tiles | |
| 26 | c04b-c058 left computer tiles | |
| 27 | ||
| 28 | ============================================================================================ | |
| 29 | ||
| 30 | 4nin-uchi mahjong Jantotsu | |
| 31 | (c)1983 Sanritsu | |
| 32 | ||
| 33 | C2-00159_A | |
| 34 | ||
| 35 | CPU: Z80 | |
| 36 | Sound: SN76489ANx2 MSM5205 | |
| 37 | OSC: 18.432MHz | |
| 38 | ||
| 39 | ROMs: | |
| 40 | JAT-00.2B (2764) | |
| 41 | JAT-01.3B | |
| 42 | JAT-02.4B | |
| 43 | JAT-03.2E | |
| 44 | JAT-04.3E | |
| 45 | JAT-05.4E | |
| 46 | ||
| 47 | JAT-40.6B | |
| 48 | JAT-41.7B | |
| 49 | JAT-42.8B | |
| 50 | JAT-43.9B | |
| 51 | ||
| 52 | JAT-60.10P (7051) - color PROM | |
| 53 | ||
| 54 | This game requires special control panel. | |
| 55 | Standard mahjong control panel + these 3 buttons. | |
| 56 | - 9syu nagare | |
| 57 | - Continue Yes | |
| 58 | - Continue No | |
| 59 | ||
| 60 | dumped by sayu | |
| 61 | ||
| 62 | *******************************************************************************************/ | |
| 63 | ||
| 64 | #include "driver.h" | |
| 65 | #include "cpu/z80/z80.h" | |
| 66 | #include "sound/sn76496.h" | |
| 67 | ||
| 68 | static UINT8 *jan_bitmap_1,*jan_bitmap_2,*jan_bitmap_3,*jan_bitmap_4; | |
| 69 | static UINT8 vram_bank,col_bank; | |
| 70 | static UINT8 mux_data; | |
| 71 | ||
| 72 | VIDEO_START(jantotsu) | |
| 73 | { | |
| 74 | jan_bitmap_1 = auto_malloc(0x2000); | |
| 75 | jan_bitmap_2 = auto_malloc(0x2000); | |
| 76 | jan_bitmap_3 = auto_malloc(0x2000); | |
| 77 | jan_bitmap_4 = auto_malloc(0x2000); | |
| 78 | vram_bank = 0; | |
| 79 | } | |
| 80 | ||
| 81 | VIDEO_UPDATE(jantotsu) | |
| 82 | { | |
| 83 | int x,y,i; | |
| 84 | int count; | |
| 85 | ||
| 86 | count = 0; | |
| 87 | for(y=0;y<256;y++) | |
| 88 | { | |
| 89 | for(x=0;x<256;x+=8) | |
| 90 | { | |
| 91 | int pen[4],color; | |
| 92 | ||
| 93 | for (i=0;i<8;i++) | |
| 94 | { | |
| 95 | pen[0] = (jan_bitmap_1[count])>>(7-i); | |
| 96 | pen[1] = (jan_bitmap_2[count])>>(7-i); | |
| 97 | pen[2] = (jan_bitmap_3[count])>>(7-i); | |
| 98 | pen[3] = (jan_bitmap_4[count])>>(7-i); | |
| 99 | ||
| 100 | color = ((pen[0] & 1)<<0); | |
| 101 | color|= ((pen[1] & 1)<<1); | |
| 102 | color|= ((pen[2] & 1)<<2); | |
| 103 | color|= ((pen[3] & 1)<<3); | |
| 104 | color|= col_bank; | |
| 105 | ||
| 106 | if((x+i)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y) | |
| 107 | *BITMAP_ADDR32(bitmap, y, x+i) = screen->machine->pens[color]; | |
| 108 | } | |
| 109 | ||
| 110 | count++; | |
| 111 | } | |
| 112 | } | |
| 113 | ||
| 114 | return 0; | |
| 115 | } | |
| 116 | ||
| 117 | static READ8_HANDLER( jantotsu_bitmap_r ) | |
| 118 | { | |
| 119 | switch(vram_bank & 3) | |
| 120 | { | |
| 121 | case 0: return jan_bitmap_1[offset]; | |
| 122 | case 1: return jan_bitmap_2[offset]; | |
| 123 | case 2: return jan_bitmap_3[offset]; | |
| 124 | case 3: return jan_bitmap_4[offset]; | |
| 125 | } | |
| 126 | return 0; | |
| 127 | } | |
| 128 | ||
| 129 | static WRITE8_HANDLER( jantotsu_bitmap_w ) | |
| 130 | { | |
| 131 | switch(vram_bank & 3) | |
| 132 | { | |
| 133 | case 0: jan_bitmap_1[offset] = data; break; | |
| 134 | case 1: jan_bitmap_2[offset] = data; break; | |
| 135 | case 2: jan_bitmap_3[offset] = data; break; | |
| 136 | case 3: jan_bitmap_4[offset] = data; break; | |
| 137 | } | |
| 138 | } | |
| 139 | ||
| 140 | static WRITE8_HANDLER( bankaddr_w ) | |
| 141 | { | |
| 142 | vram_bank = ((data & 0xc0)>>6); // top 2 bits? | |
| 143 | ||
| 144 | // looks like the top 2 bits and bottom 2 bits are used.. | |
| 145 | // multiple buffers? different read / write ? | |
| 146 | ||
| 147 | // printf("%02x\n",data & 0x03); | |
| 148 | } | |
| 149 | ||
| 150 | static PALETTE_INIT( jantotsu ) | |
| 151 | { | |
| 152 | int bit0, bit1, bit2 , r, g, b; | |
| 153 | int i; | |
| 154 | ||
| 155 | for (i = 0; i < 0x20; ++i) | |
| 156 | { | |
| 157 | bit0 = (color_prom[0] >> 0) & 0x01; | |
| 158 | bit1 = (color_prom[0] >> 1) & 0x01; | |
| 159 | bit2 = (color_prom[0] >> 2) & 0x01; | |
| 160 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 161 | bit0 = (color_prom[0] >> 3) & 0x01; | |
| 162 | bit1 = (color_prom[0] >> 4) & 0x01; | |
| 163 | bit2 = (color_prom[0] >> 5) & 0x01; | |
| 164 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 165 | bit0 = 0; | |
| 166 | bit1 = (color_prom[0] >> 6) & 0x01; | |
| 167 | bit2 = (color_prom[0] >> 7) & 0x01; | |
| 168 | b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 169 | ||
| 170 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 171 | color_prom++; | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 175 | /*Multiplexer is mapped as 6-bits reads,bits 6 & 7 are always connected to the coin mechs.*/ | |
| 176 | static READ8_HANDLER( jantotsu_mux_r ) | |
| 177 | { | |
| 178 | static UINT8 coin_port; | |
| 179 | ||
| 180 | coin_port = input_port_read(space->machine, "COINS"); | |
| 181 | ||
| 182 | // printf("%02x\n",mux_data); | |
| 183 | ||
| 184 | switch(mux_data) | |
| 185 | { | |
| 186 | case 1: return input_port_read(space->machine, "PL1_1") | coin_port; | |
| 187 | case 2: return input_port_read(space->machine, "PL1_2") | coin_port; | |
| 188 | case 4: return input_port_read(space->machine, "PL1_3") | coin_port; | |
| 189 | case 8: return input_port_read(space->machine, "PL1_4") | coin_port; | |
| 190 | case 0x10: return input_port_read(space->machine, "PL2_1") | coin_port; | |
| 191 | case 0x20: return input_port_read(space->machine, "PL2_2") | coin_port; | |
| 192 | case 0x40: return input_port_read(space->machine, "PL2_3") | coin_port; | |
| 193 | case 0x80: return input_port_read(space->machine, "PL2_4") | coin_port; | |
| 194 | } | |
| 195 | ||
| 196 | return coin_port; | |
| 197 | } | |
| 198 | ||
| 199 | static WRITE8_HANDLER( jantotsu_mux_w ) | |
| 200 | { | |
| 201 | mux_data = ~data; | |
| 202 | } | |
| 203 | ||
| 204 | /*If bits 6 & 7 doesn't return 0x80,the game hangs until this bit is set, | |
| 205 | so I'm guessing that these bits can't be read by the z80 at all but directly | |
| 206 | hard-wired to the video chip.However I need the schematics / pcb snaps and/or | |
| 207 | a side-by-side test (to know if the background colors really works) to be sure. */ | |
| 208 | static READ8_HANDLER( jantotsu_dsw2_r ) | |
| 209 | { | |
| 210 | return (input_port_read(space->machine, "DSW2") & 0x3f) | 0x80; | |
| 211 | } | |
| 212 | ||
| 213 | static ADDRESS_MAP_START( jantotsu_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 214 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 215 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 216 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(jantotsu_bitmap_r,jantotsu_bitmap_w) | |
| 217 | ADDRESS_MAP_END | |
| 218 | ||
| 219 | static ADDRESS_MAP_START( jantotsu_io, ADDRESS_SPACE_IO, 8 ) | |
| 220 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 221 | AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1") AM_WRITE(sn76496_0_w) | |
| 222 | AM_RANGE(0x01, 0x01) AM_READ(jantotsu_dsw2_r) AM_WRITE(sn76496_1_w) | |
| 223 | //02-03 MSM samples | |
| 224 | AM_RANGE(0x04, 0x04) AM_READWRITE(jantotsu_mux_r,jantotsu_mux_w) | |
| 225 | AM_RANGE(0x07, 0x07) AM_WRITE(bankaddr_w) | |
| 226 | ADDRESS_MAP_END | |
| 227 | ||
| 228 | static INPUT_PORTS_START( jantotsu ) | |
| 229 | PORT_START("COINS") | |
| 230 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 231 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 232 | PORT_START("DSW1") | |
| 233 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1") | |
| 234 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 235 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 236 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW1:2" ) | |
| 237 | PORT_DIPNAME( 0x1c, 0x00, "Player vs. CPU timer decrement speed") PORT_DIPLOCATION("SW1:3,4,5") //in msecs I suppose | |
| 238 | PORT_DIPSETTING( 0x00, "30") | |
| 239 | PORT_DIPSETTING( 0x08, "50" ) | |
| 240 | PORT_DIPSETTING( 0x04, "70") | |
| 241 | PORT_DIPSETTING( 0x0c, "90" ) | |
| 242 | PORT_DIPSETTING( 0x10, "110" ) | |
| 243 | PORT_DIPSETTING( 0x18, "130" ) | |
| 244 | PORT_DIPSETTING( 0x14, "150" ) | |
| 245 | PORT_DIPSETTING( 0x1c, "170" ) | |
| 246 | PORT_DIPNAME( 0xe0, 0x00, "Player vs. Player timer decrement speed" ) PORT_DIPLOCATION("SW1:6,7,8") //in msecs I suppose | |
| 247 | PORT_DIPSETTING( 0x00, "100" ) | |
| 248 | PORT_DIPSETTING( 0x40, "120" ) | |
| 249 | PORT_DIPSETTING( 0x20, "140" ) | |
| 250 | PORT_DIPSETTING( 0x60, "160" ) | |
| 251 | PORT_DIPSETTING( 0x80, "180" ) | |
| 252 | PORT_DIPSETTING( 0xc0, "200" ) | |
| 253 | PORT_DIPSETTING( 0xa0, "220" ) | |
| 254 | PORT_DIPSETTING( 0xe0, "240" ) | |
| 255 | PORT_START("DSW2") | |
| 256 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2,3") | |
| 257 | PORT_DIPSETTING( 0x07, DEF_STR( Easy ) ) | |
| 258 | PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) | |
| 259 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) | |
| 260 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW2:4" ) | |
| 261 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW2:5") | |
| 262 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 263 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) | |
| 264 | PORT_DIPNAME( 0x20, 0x00, "Play BGM") PORT_DIPLOCATION("SW2:6") | |
| 265 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 266 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 267 | PORT_DIPNAME( 0xc0, 0x40, "Background Color" ) PORT_DIPLOCATION("SW2:7,8") | |
| 268 | PORT_DIPSETTING( 0xc0, "Purple" ) | |
| 269 | PORT_DIPSETTING( 0x80, "Green" ) | |
| 270 | PORT_DIPSETTING( 0x40, "Blue" ) | |
| 271 | PORT_DIPSETTING( 0x00, "Black" ) | |
| 272 | PORT_START("PL1_1") | |
| 273 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) | |
| 274 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Mahjong Nagare") PORT_CODE(KEYCODE_S) | |
| 275 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Continue Button Yes") PORT_CODE(KEYCODE_Y) | |
| 276 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Continue Button No") PORT_CODE(KEYCODE_O) | |
| 277 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) | |
| 278 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) | |
| 279 | PORT_START("PL1_2") | |
| 280 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M ) | |
| 281 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N ) | |
| 282 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) | |
| 283 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) | |
| 284 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) | |
| 285 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) | |
| 286 | PORT_START("PL1_3") | |
| 287 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_G ) | |
| 288 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) | |
| 289 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) | |
| 290 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_J ) | |
| 291 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_K ) | |
| 292 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_L ) | |
| 293 | PORT_START("PL1_4") | |
| 294 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) | |
| 295 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B ) | |
| 296 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_C ) | |
| 297 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_D ) | |
| 298 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) | |
| 299 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_F ) | |
| 300 | PORT_START("PL2_1") | |
| 301 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) | |
| 302 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Mahjong Nagare") PORT_PLAYER(2) | |
| 303 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Continue Button Yes") PORT_PLAYER(2) | |
| 304 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Continue Button No") PORT_PLAYER(2) | |
| 305 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 306 | PORT_START("PL2_2") | |
| 307 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2) | |
| 308 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2) | |
| 309 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) | |
| 310 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) | |
| 311 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) | |
| 312 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) | |
| 313 | PORT_START("PL2_3") | |
| 314 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) | |
| 315 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) | |
| 316 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) | |
| 317 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) | |
| 318 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) | |
| 319 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) | |
| 320 | PORT_START("PL2_4") | |
| 321 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) | |
| 322 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) | |
| 323 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) | |
| 324 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) | |
| 325 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) | |
| 326 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) | |
| 327 | INPUT_PORTS_END | |
| 328 | ||
| 329 | static INTERRUPT_GEN( jantotsu_irq ) | |
| 330 | { | |
| 331 | cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE ); | |
| 332 | } | |
| 333 | ||
| 334 | static MACHINE_RESET( jantotsu ) | |
| 335 | { | |
| 336 | mux_data = 0; | |
| 337 | /*Load hard-wired background color.*/ | |
| 338 | col_bank = (input_port_read(machine, "DSW2") & 0xc0)>>3; | |
| 339 | } | |
| 340 | ||
| 341 | static MACHINE_DRIVER_START( jantotsu ) | |
| 342 | /* basic machine hardware */ | |
| 343 | MDRV_CPU_ADD("main", Z80,18432000/4) | |
| 344 | MDRV_CPU_PROGRAM_MAP(0,jantotsu_map) | |
| 345 | MDRV_CPU_IO_MAP(0,jantotsu_io) | |
| 346 | MDRV_CPU_VBLANK_INT("main", jantotsu_irq) | |
| 347 | ||
| 348 | MDRV_MACHINE_RESET(jantotsu) | |
| 349 | /* video hardware */ | |
| 350 | MDRV_SCREEN_ADD("main", RASTER) | |
| 351 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 352 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) //not accurate | |
| 353 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) | |
| 354 | MDRV_SCREEN_SIZE(256, 256) | |
| 355 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 240-1) | |
| 356 | ||
| 357 | MDRV_PALETTE_INIT(jantotsu) | |
| 358 | MDRV_PALETTE_LENGTH(0x20) | |
| 359 | ||
| 360 | MDRV_VIDEO_START(jantotsu) | |
| 361 | MDRV_VIDEO_UPDATE(jantotsu) | |
| 362 | ||
| 363 | /* sound hardware */ | |
| 364 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 365 | ||
| 366 | MDRV_SOUND_ADD("sn1", SN76489A, 18432000/4) | |
| 367 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 368 | ||
| 369 | MDRV_SOUND_ADD("sn2", SN76489A, 18432000/4) | |
| 370 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 371 | MACHINE_DRIVER_END | |
| 372 | ||
| 373 | ||
| 374 | ||
| 375 | ROM_START( jantotsu ) | |
| 376 | ROM_REGION( 0x10000, "main", 0 ) | |
| 377 | ROM_LOAD( "jat-00.2b", 0x00000, 0x02000, CRC(bed10f86) SHA1(c5ac845b32fa295b0ff205b1401bcc071d604d6e) ) | |
| 378 | ROM_LOAD( "jat-01.3b", 0x02000, 0x02000, CRC(cc9312e9) SHA1(b08d38cc58d92378305c015c5a001b4da072188b) ) | |
| 379 | ROM_LOAD( "jat-02.4b", 0x04000, 0x02000, CRC(292969f1) SHA1(e7cb93b67296e84ea012fcceb72df712c7e0f135) ) | |
| 380 | ROM_LOAD( "jat-03.2e", 0x06000, 0x02000, CRC(7452ff63) SHA1(b258674e77eee5548a065419a3092877957dec66) ) | |
| 381 | ROM_LOAD( "jat-04.3e", 0x08000, 0x02000, CRC(734e029f) SHA1(75aa13397847b4db32c41aaa6ff2ac82f16bd7a2) ) | |
| 382 | ROM_LOAD( "jat-05.4e", 0x0a000, 0x02000, CRC(1a725e1a) SHA1(1d39d607850f47b9389f41147d4570da8814f639) ) | |
| 383 | ||
| 384 | ROM_REGION( 0x8000, "gfx1", 0 ) | |
| 385 | ROM_LOAD( "jat-40.6b", 0x00000, 0x02000, CRC(2275253e) SHA1(64e9415faf2775c6b9ab497dce7fda8c4775192e) ) | |
| 386 | ROM_LOAD( "jat-41.7b", 0x02000, 0x02000, CRC(ce08ed71) SHA1(8554e5e7ec178f57bed5fbdd5937e3a35f72c454) ) | |
| 387 | ROM_LOAD( "jat-42.8b", 0x04000, 0x02000, CRC(3ac3efbf) SHA1(846faea7c7c01fb7500aa33a70d4b54e878c0e41) ) | |
| 388 | ROM_LOAD( "jat-43.9b", 0x06000, 0x02000, CRC(3c1d843c) SHA1(7a836e66cad4e94916f0d80a439efde49306a0e1) ) | |
| 389 | ||
| 390 | ROM_REGION( 0x20, "proms", 0 ) | |
| 391 | ROM_LOAD( "jat-60.10p", 0x00, 0x20, CRC(65528ae0) SHA1(6e3bf27d10ec14e3c6a494667b03b68726fcff14) ) | |
| 392 | ROM_END | |
| 393 | ||
| 394 | GAME( 1983, jantotsu, 0, jantotsu, jantotsu, 0, ROT270, "Sanritsu", "4nin-uchi Mahjong Jantotsu", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| r3957 | r3958 | |
|---|---|---|
| 86 | 86 | ***************************************************************************/ |
| 87 | 87 | |
| 88 | 88 | #include "driver.h" |
| 89 | #include "cpu/z80/z80.h" | |
| 90 | #include "cpu/m68000/m68000.h" | |
| 89 | 91 | #include "sound/okim6295.h" |
| 90 | 92 | #include "sound/3812intf.h" |
| 91 | 93 |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | ***************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 36 | 37 | #include "machine/8255ppi.h" |
| 37 | 38 | #include "galaxold.h" |
| 38 | 39 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 158 | 158 | ***************************************************************************/ |
| 159 | 159 | |
| 160 | 160 | #include "driver.h" |
| 161 | #include "cpu/z80/z80.h" | |
| 161 | 162 | #include "deprecat.h" |
| 162 | 163 | #include "sound/ay8910.h" |
| 163 | 164 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | ****************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/i8085/i8085.h" | |
| 44 | 45 | #include "stactics.h" |
| 45 | 46 | #include "stactics.lh" |
| 46 | 47 |
| r3957 | r3958 | |
|---|---|---|
| 114 | 114 | ***************************************************************************/ |
| 115 | 115 | |
| 116 | 116 | #include "driver.h" |
| 117 | #include "cpu/z80/z80.h" | |
| 117 | 118 | #include "sound/ay8910.h" |
| 118 | 119 | |
| 119 | 120 | extern UINT8* mermaid_videoram2; |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | */ |
| 79 | 79 | |
| 80 | 80 | #include "driver.h" |
| 81 | #include "cpu/z80/z80.h" | |
| 81 | 82 | #include "machine/segacrpt.h" |
| 82 | 83 | #include "sound/ay8910.h" |
| 83 | 84 | |
| r3957 | r3958 | |
| 141 | 142 | ypos = 0xff - calorie_sprites[x+2]; |
| 142 | 143 | xpos = calorie_sprites[x+3]; |
| 143 | 144 | |
| 144 | if(flip_screen_get()) | |
| 145 | if(flip_screen_get(screen->machine)) | |
| 145 | 146 | { |
| 146 | 147 | if( calorie_sprites[x+1] & 0x10 ) |
| 147 | 148 | ypos = 0xff - ypos + 32; |
| r3957 | r3958 | |
| 185 | 186 | |
| 186 | 187 | static WRITE8_HANDLER( calorie_flipscreen_w ) |
| 187 | 188 | { |
| 188 | flip_screen_set(data & 1); | |
| 189 | flip_screen_set(space->machine, data & 1); | |
| 189 | 190 | } |
| 190 | 191 | |
| 191 | 192 | static READ8_HANDLER( calorie_soundlatch_r ) |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/m68000/m68000.h" | |
| 11 | 12 | #include "sound/okim6295.h" |
| 12 | 13 | |
| 13 | 14 | static UINT16 *drtomy_spriteram; |
| r3957 | r3958 | |
|---|---|---|
| 143 | 143 | **************************************************************************/ |
| 144 | 144 | |
| 145 | 145 | #include "driver.h" |
| 146 | #include "cpu/m68000/m68000.h" | |
| 146 | 147 | #include "gaelco3d.h" |
| 147 | 148 | #include "cpu/tms32031/tms32031.h" |
| 148 | 149 | #include "cpu/adsp2100/adsp2100.h" |
| r3957 | r3958 | |
| 193 | 194 | adsp_ram_base[i] = opcode; |
| 194 | 195 | } |
| 195 | 196 | |
| 196 | /* initialize the ADSP Tx callback */ | |
| 197 | adsp21xx_set_tx_handler(machine->cpu[2], adsp_tx_callback); | |
| 198 | ||
| 199 | 197 | /* allocate a timer for feeding the autobuffer */ |
| 200 | 198 | adsp_autobuffer_timer = timer_alloc(machine, adsp_autobuffer_irq, NULL); |
| 201 | 199 | |
| r3957 | r3958 | |
| 242 | 240 | |
| 243 | 241 | static INTERRUPT_GEN( vblank_gen ) |
| 244 | 242 | { |
| 245 | gaelco3d_render(); | |
| 243 | gaelco3d_render(device->machine->primary_screen); | |
| 246 | 244 | cpu_set_input_line(device, 2, ASSERT_LINE); |
| 247 | 245 | } |
| 248 | 246 | |
| r3957 | r3958 | |
| 907 | 905 | * |
| 908 | 906 | *************************************/ |
| 909 | 907 | |
| 908 | static const adsp21xx_config adsp_config = | |
| 909 | { | |
| 910 | NULL, /* callback for serial receive */ | |
| 911 | adsp_tx_callback, /* callback for serial transmit */ | |
| 912 | NULL /* callback for timer fired */ | |
| 913 | }; | |
| 914 | ||
| 910 | 915 | static const tms32031_config tms_config = |
| 911 | 916 | { |
| 912 | 917 | 0x1000, |
| r3957 | r3958 | |
| 924 | 929 | MDRV_CPU_VBLANK_INT("main", vblank_gen) |
| 925 | 930 | |
| 926 | 931 | MDRV_CPU_ADD("tms", TMS32031, 60000000) |
| 932 | MDRV_CPU_CONFIG(tms_config) | |
| 927 | 933 | MDRV_CPU_PROGRAM_MAP(tms_map,0) |
| 928 | MDRV_CPU_CONFIG(tms_config) | |
| 929 | 934 | |
| 930 | 935 | MDRV_CPU_ADD("adsp", ADSP2115, 16000000) |
| 936 | MDRV_CPU_CONFIG(adsp_config) | |
| 931 | 937 | MDRV_CPU_PROGRAM_MAP(adsp_program_map,0) |
| 932 | 938 | MDRV_CPU_DATA_MAP(adsp_data_map, 0) |
| 933 | 939 | |
| 934 | 940 | MDRV_MACHINE_RESET(gaelco3d) |
| 935 | 941 | MDRV_NVRAM_HANDLER(93C66B) |
| 936 | 942 | |
| 937 | MDRV_ | |
| 943 | MDRV_QUANTUM_TIME | |
| 938 | 944 | |
| 939 | 945 | /* video hardware */ |
| 940 | 946 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/m6502/m6502.h" | |
| 31 | 32 | #include "deprecat.h" |
| 32 | 33 | #include "sound/discrete.h" |
| 33 | 34 | #include "avalnche.h" |
| r3957 | r3958 | |
|---|---|---|
| 638 | 638 | |
| 639 | 639 | static UINT32 m_n_bankoffset; |
| 640 | 640 | |
| 641 | INLINE void bankswitch_rom8( int n_bank, int n_data ) | |
| 641 | INLINE void bankswitch_rom8( const address_space *space, int n_bank, int n_data ) | |
| 642 | 642 | { |
| 643 | memory_set_bank( | |
| 643 | memory_set_bank( space->machine, n_bank + 1, ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) ); | |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | static WRITE32_HANDLER( bankswitch_rom32_w ) |
| r3957 | r3958 | |
| 649 | 649 | |
| 650 | 650 | if( ACCESSING_BITS_0_15 ) |
| 651 | 651 | { |
| 652 | bankswitch_rom8( ( offset * 2 ), data & 0xffff ); | |
| 652 | bankswitch_rom8( space, ( offset * 2 ), data & 0xffff ); | |
| 653 | 653 | } |
| 654 | 654 | if( ACCESSING_BITS_16_31 ) |
| 655 | 655 | { |
| 656 | bankswitch_rom8( ( offset * 2 ) + 1, data >> 16 ); | |
| 656 | bankswitch_rom8( space, ( offset * 2 ) + 1, data >> 16 ); | |
| 657 | 657 | } |
| 658 | 658 | } |
| 659 | 659 | |
| r3957 | r3958 | |
| 671 | 671 | } |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | INLINE void bankswitch_rom64( int n_bank, int n_data ) | |
| 674 | INLINE void bankswitch_rom64( const address_space *space, int n_bank, int n_data ) | |
| 675 | 675 | { |
| 676 | 676 | /* todo: verify behaviour */ |
| 677 | memory_set_bank( | |
| 677 | memory_set_bank( space->machine, n_bank + 1, ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ m_n_bankoffset ) ); | |
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | static WRITE32_HANDLER( bankswitch_rom64_w ) |
| r3957 | r3958 | |
| 683 | 683 | |
| 684 | 684 | if( ACCESSING_BITS_0_15 ) |
| 685 | 685 | { |
| 686 | bankswitch_rom64( ( offset * 2 ), data & 0xffff ); | |
| 686 | bankswitch_rom64( space, ( offset * 2 ), data & 0xffff ); | |
| 687 | 687 | } |
| 688 | 688 | if( ACCESSING_BITS_16_31 ) |
| 689 | 689 | { |
| 690 | bankswitch_rom64( ( offset * 2 ) + 1, data >> 16 ); | |
| 690 | bankswitch_rom64( space, ( offset * 2 ) + 1, data >> 16 ); | |
| 691 | 691 | } |
| 692 | 692 | } |
| 693 | 693 | |
| r3957 | r3958 | |
| 894 | 894 | NAMCO_C7X_MCU_SHARED(16384000) |
| 895 | 895 | NAMCO_C7X_SOUND(16384000) |
| 896 | 896 | |
| 897 | MDRV_ | |
| 897 | MDRV_AT28C16_ADD( "at28c16", NULL | |
| 898 | 898 | MACHINE_DRIVER_END |
| 899 | 899 | |
| 900 | 900 | static MACHINE_DRIVER_START( coh110 ) |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/m68000/m68000.h" | |
| 16 | 17 | #include "cpu/z80/z80.h" |
| 17 | 18 | #include "audio/seibu.h" |
| 18 | 19 |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/m68000/m68000.h" | |
| 38 | 39 | #include "cpu/pic16c5x/pic16c5x.h" |
| 39 | 40 | #include "machine/eeprom.h" |
| 40 | 41 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 495 | 495 | |
| 496 | 496 | |
| 497 | 497 | #include "driver.h" |
| 498 | #include "cpu/z80/z80.h" | |
| 499 | #include "cpu/m68000/m68000.h" | |
| 500 | #include "cpu/hd6309/hd6309.h" | |
| 498 | 501 | #include "cpu/m6809/m6809.h" |
| 499 | 502 | #include "machine/6821pia.h" |
| 500 | 503 | #include "machine/6522via.h" |
| r3957 | r3958 | |
| 589 | 592 | |
| 590 | 593 | void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter) |
| 591 | 594 | { |
| 595 | cpu_type main_cpu_type = cpu_get_type(machine->cpu[0]); | |
| 596 | ||
| 592 | 597 | /* update the states */ |
| 593 | 598 | if (periodic != -1) periodic_int = periodic; |
| 594 | 599 | if (tms34061 != -1) tms34061_int = tms34061; |
| 595 | 600 | if (blitter != -1) blitter_int = blitter; |
| 596 | 601 | |
| 597 | 602 | /* handle the 6809 case */ |
| 598 | if (ma | |
| 603 | if (ma | |
| 599 | 604 | { |
| 600 | 605 | /* just modify lines that have changed */ |
| 601 | 606 | if (periodic != -1) cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE); |
| r3957 | r3958 | |
| 673 | 678 | |
| 674 | 679 | static MACHINE_RESET( itech8 ) |
| 675 | 680 | { |
| 681 | cpu_type main_cpu_type = cpu_get_type(machine->cpu[0]); | |
| 682 | ||
| 676 | 683 | /* make sure bank 0 is selected */ |
| 677 | if (ma | |
| 684 | if (ma | |
| 678 | 685 | { |
| 679 | 686 | memory_set_bankptr(machine, 1, &memory_region(machine, "main")[0x4000]); |
| 680 | c | |
| 687 | device | |
| 681 | 688 | } |
| 682 | 689 | |
| 683 | 690 | /* reset the PIA (if used) */ |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/m68000/m68000.h" | |
| 18 | 19 | #include "sound/okim6295.h" |
| 19 | 20 | |
| 20 | 21 |
| r3957 | r3958 | |
|---|---|---|
| 198 | 198 | ***************************************************************************/ |
| 199 | 199 | |
| 200 | 200 | #include "driver.h" |
| 201 | #include "cpu/z80/z80.h" | |
| 202 | #include "cpu/m68000/m68000.h" | |
| 201 | 203 | #include "sound/2608intf.h" |
| 202 | 204 | #include "sound/2610intf.h" |
| 203 | 205 |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | ******************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 37 | #include "cpu/m68000/m68000.h" | |
| 36 | 38 | #include "gstriker.h" |
| 37 | 39 | #include "sound/2610intf.h" |
| 38 | 40 |
| r3957 | r3958 | |
|---|---|---|
| 258 | 258 | ***************************************************************************/ |
| 259 | 259 | |
| 260 | 260 | #include "driver.h" |
| 261 | #include "cpu/z80/z80.h" | |
| 261 | 262 | #include "snk.h" |
| 262 | 263 | #include "sound/snkwave.h" |
| 263 | 264 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 3584 | 3585 | MDRV_CPU_IO_MAP(marvins_sound_portmap,0) |
| 3585 | 3586 | MDRV_CPU_PERIODIC_INT(nmi_line_assert, 244) // schematics show a separate 244Hz timer |
| 3586 | 3587 | |
| 3587 | MDRV_ | |
| 3588 | MDRV_QUANTUM_TIME | |
| 3588 | 3589 | |
| 3589 | 3590 | /* video hardware */ |
| 3590 | 3591 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
| 3645 | 3646 | MDRV_CPU_IO_MAP(jcross_sound_portmap,0) |
| 3646 | 3647 | MDRV_CPU_PERIODIC_INT(irq0_line_assert, 244) // Marvin's frequency, sounds ok |
| 3647 | 3648 | |
| 3648 | MDRV_ | |
| 3649 | MDRV_QUANTUM_TIME | |
| 3649 | 3650 | |
| 3650 | 3651 | /* video hardware */ |
| 3651 | 3652 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
| 3728 | 3729 | MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 3729 | 3730 | MDRV_CPU_PROGRAM_MAP(tnk3_YM3526_sound_map,0) |
| 3730 | 3731 | |
| 3731 | MDRV_ | |
| 3732 | MDRV_QUANTUM_TIME | |
| 3732 | 3733 | |
| 3733 | 3734 | /* video hardware */ |
| 3734 | 3735 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
| 3819 | 3820 | MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 3820 | 3821 | MDRV_CPU_PROGRAM_MAP(YM3526_YM3526_sound_map,0) |
| 3821 | 3822 | |
| 3822 | MDRV_ | |
| 3823 | MDRV_QUANTUM_TIME | |
| 3823 | 3824 | |
| 3824 | 3825 | /* video hardware */ |
| 3825 | 3826 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
| 3879 | 3880 | MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 3880 | 3881 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 3881 | 3882 | |
| 3882 | MDRV_ | |
| 3883 | MDRV_QUANTUM_TIME | |
| 3883 | 3884 | |
| 3884 | 3885 | /* video hardware */ |
| 3885 | 3886 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3990 | 3991 | MDRV_CPU_ADD("audio", Z80, 4000000) |
| 3991 | 3992 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 3992 | 3993 | |
| 3993 | MDRV_ | |
| 3994 | MDRV_QUANTUM_TIME | |
| 3994 | 3995 | |
| 3995 | 3996 | /* video hardware */ |
| 3996 | 3997 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | ***************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "cpu/m68000/m68000.h" | |
| 41 | 42 | #include "deprecat.h" |
| 42 | 43 | #include "sound/2151intf.h" |
| 43 | 44 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | #include "driver.h" |
| 70 | #include "cpu/m68000/m68000.h" | |
| 70 | 71 | #include "machine/atarigen.h" |
| 71 | 72 | #include "arcadecl.h" |
| 72 | 73 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 270 | 270 | Custom 169 (120 pin PQFP) |
| 271 | 271 | */ |
| 272 | 272 | #include "driver.h" |
| 273 | #include "cpu/m68000/m68000.h" | |
| 273 | 274 | #include "deprecat.h" |
| 274 | 275 | #include "namconb1.h" |
| 275 | 276 | #include "namcos2.h" |
| r3957 | r3958 | |
|---|---|---|
| 668 | 668 | MDRV_CPU_ADD("mcu", M68705,XTAL_18_432MHz/6) /* verified on pcb */ |
| 669 | 669 | MDRV_CPU_PROGRAM_MAP(flstory_m68705_map,0) |
| 670 | 670 | |
| 671 | MDRV_ | |
| 671 | MDRV_QUANTUM_TIME | |
| 672 | 672 | /* synchronization of the CPUs */ |
| 673 | 673 | MDRV_MACHINE_RESET(ta7630) |
| 674 | 674 | |
| r3957 | r3958 | |
| 725 | 725 | // MDRV_CPU_ADD("mcu", M68705,4000000) /* ??? */ |
| 726 | 726 | // MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| 727 | 727 | |
| 728 | MDRV_ | |
| 728 | MDRV_QUANTUM_TIME | |
| 729 | 729 | /* synchronization of the CPUs */ |
| 730 | 730 | MDRV_MACHINE_RESET(ta7630) |
| 731 | 731 | |
| r3957 | r3958 | |
| 782 | 782 | // MDRV_CPU_ADD("mcu", M68705,4000000) /* ??? */ |
| 783 | 783 | // MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| 784 | 784 | |
| 785 | MDRV_ | |
| 785 | MDRV_QUANTUM_TIME | |
| 786 | 786 | /* synchronization of the CPUs */ |
| 787 | 787 | MDRV_MACHINE_RESET(ta7630) |
| 788 | 788 |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | */ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 36 | 37 | #include "cpu/m68000/m68000.h" |
| 37 | 38 | #include "cps1.h" |
| 38 | 39 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 210 | 211 | int videocontrol=cps1_cps_a_regs[0x22/2]; |
| 211 | 212 | |
| 212 | 213 | |
| 213 | flip_screen_set(videocontrol & 0x8000); | |
| 214 | flip_screen_set(screen->machine, videocontrol & 0x8000); | |
| 214 | 215 | |
| 215 | 216 | layercontrol = cps1_cps_b_regs[0x20/2]; |
| 216 | 217 | |
| r3957 | r3958 | |
| 281 | 282 | int videocontrol=cps1_cps_a_regs[0x22/2]; |
| 282 | 283 | |
| 283 | 284 | |
| 284 | flip_screen_set(videocontrol & 0x8000); | |
| 285 | flip_screen_set(screen->machine, videocontrol & 0x8000); | |
| 285 | 286 | |
| 286 | 287 | layercontrol = cps1_cps_b_regs[0x20/2]; |
| 287 | 288 |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | ******************************************************************************/ |
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | #include "cpu/z80/z80.h" | |
| 85 | #include "cpu/m68000/m68000.h" | |
| 84 | 86 | #include "video/konamiic.h" |
| 85 | 87 | #include "sound/2610intf.h" |
| 86 | 88 |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | *********************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/e132xs/e132xs.h" | |
| 15 | 16 | #include "machine/eeprom.h" |
| 16 | 17 | #include "sound/2151intf.h" |
| 17 | 18 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 616 | 616 | #define SND_CLOCK (MASTER_CLOCK/8) |
| 617 | 617 | |
| 618 | 618 | #include "driver.h" |
| 619 | #include "cpu/m6502/m6502.h" | |
| 619 | 620 | #include "video/mc6845.h" |
| 620 | 621 | #include "machine/6821pia.h" |
| 621 | 622 | #include "machine/6850acia.h" |
| r3957 | r3958 | |
| 1929 | 1930 | MDRV_VIDEO_START(calomega) |
| 1930 | 1931 | MDRV_VIDEO_UPDATE(calomega) |
| 1931 | 1932 | |
| 1932 | MDRV_ | |
| 1933 | MDRV_M | |
| 1933 | 1934 | |
| 1934 | 1935 | /* sound hardware */ |
| 1935 | 1936 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
| 1938 | 1939 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 1939 | 1940 | |
| 1940 | 1941 | /* acia */ |
| 1941 | MDRV_DEVICE_ADD("acia6850_0", ACIA6850) | |
| 1942 | MDRV_DEVICE_CONFIG(acia6850_intf) | |
| 1942 | MDRV_ACIA6850_ADD("acia6850_0", acia6850_intf) | |
| 1943 | 1943 | MACHINE_DRIVER_END |
| 1944 | 1944 | |
| 1945 | 1945 | static MACHINE_DRIVER_START( sys905 ) |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | *****************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/z80/z80.h" | |
| 18 | 19 | #include "deprecat.h" |
| 19 | 20 | #include "sound/sn76496.h" |
| 20 | 21 | |
| r3957 | r3958 | |
| 345 | 346 | MDRV_CPU_PROGRAM_MAP(strnskil_readmem2,strnskil_writemem2) |
| 346 | 347 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) |
| 347 | 348 | |
| 348 | MDRV_ | |
| 349 | MDRV_QUANTUM_TIME | |
| 349 | 350 | |
| 350 | 351 | /* video hardware */ |
| 351 | 352 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 441 | 441 | |
| 442 | 442 | static INTERRUPT_GEN( sfkick_interrupt ) |
| 443 | 443 | { |
| 444 | v9938_interrupt(0); | |
| 444 | v9938_interrupt(device->machine, 0); | |
| 445 | 445 | } |
| 446 | 446 | static void irqhandler(running_machine *machine, int irq) |
| 447 | 447 | { |
| r3957 | r3958 | |
| 465 | 465 | MDRV_CPU_IO_MAP(main_io,0) |
| 466 | 466 | MDRV_CPU_VBLANK_INT_HACK(sfkick_interrupt,262) |
| 467 | 467 | |
| 468 | MDRV_ | |
| 468 | MDRV_QUANTUM_TIME | |
| 469 | 469 | |
| 470 | 470 | MDRV_CPU_ADD("sound",Z80,MASTER_CLOCK/6) |
| 471 | 471 | MDRV_CPU_PROGRAM_MAP(sound_mem,0) |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | *********************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/e132xs/e132xs.h" | |
| 53 | 54 | |
| 54 | 55 | static UINT32 *vram; |
| 55 | 56 | static int vbuffer = 0; |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | #include "driver.h" |
| 30 | #include "cpu/tms9900/tms9900.h" | |
| 30 | 31 | #include "deprecat.h" |
| 31 | 32 | #include "cpu/z80/z80.h" |
| 32 | 33 | #include "sound/samples.h" |
| r3957 | r3958 | |
| 461 | 462 | |
| 462 | 463 | static WRITE8_HANDLER( flip_screen_w ) |
| 463 | 464 | { |
| 464 | flip_screen_set(data&0x80); | |
| 465 | flip_screen_set(space->machine, data&0x80); | |
| 465 | 466 | } |
| 466 | 467 | |
| 467 | 468 |
| r3957 | r3958 | |
|---|---|---|
| 173 | 173 | #define MASTER_CLOCK XTAL_16MHz |
| 174 | 174 | |
| 175 | 175 | #include "driver.h" |
| 176 | #include "cpu/m6502/m6502.h" | |
| 176 | 177 | #include "video/mc6845.h" |
| 177 | 178 | #include "sound/ay8910.h" |
| 178 | 179 | |
| r3957 | r3958 | |
| 380 | 381 | MDRV_VIDEO_START(funworld) |
| 381 | 382 | MDRV_VIDEO_UPDATE(funworld) |
| 382 | 383 | |
| 383 | MDRV_ | |
| 384 | MDRV_M | |
| 384 | 385 | |
| 385 | 386 | /* sound hardware */ |
| 386 | 387 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 212 | 212 | { |
| 213 | 213 | v9938_set_sprite_limit(0, 0); |
| 214 | 214 | v9938_set_resolution(0, 2); |
| 215 | v9938_interrupt(0); | |
| 215 | v9938_interrupt(device->machine, 0); | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/m6809/m6809.h" | |
| 10 | 11 | #include "deprecat.h" |
| 11 | 12 | #include "sound/sn76496.h" |
| 12 | 13 |
| r3957 | r3958 | |
|---|---|---|
| 353 | 353 | |
| 354 | 354 | // copy the 68k vector table into RAM |
| 355 | 355 | memcpy(model2_soundram, memory_region(machine, "audio")+0x80000, 16); |
| 356 | c | |
| 356 | device | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | static MACHINE_RESET(model2) |
| r3957 | r3958 | |
| 1890 | 1890 | //MDRV_CPU_CONFIG(sharc_cfg) |
| 1891 | 1891 | //MDRV_CPU_DATA_MAP(geo_sharc_map, 0) |
| 1892 | 1892 | |
| 1893 | MDRV_ | |
| 1893 | MDRV_QUANTUM_TIME | |
| 1894 | 1894 | |
| 1895 | 1895 | MDRV_MACHINE_RESET(model2b) |
| 1896 | 1896 | MDRV_NVRAM_HANDLER( model2 ) |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/i86/i86.h" | |
| 29 | 30 | #include "machine/eeprom.h" |
| 30 | 31 | #include "cpu/z80/z80.h" |
| 31 | 32 | #include "leland.h" |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | ***************************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/z80/z80.h" | |
| 56 | #include "cpu/m68000/m68000.h" | |
| 55 | 57 | #include "sound/2203intf.h" |
| 56 | 58 | #include "sound/okim6295.h" |
| 57 | 59 |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/z80/z80.h" | |
| 25 | 26 | #include "deprecat.h" |
| 26 | 27 | #include "kyugo.h" |
| 27 | 28 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 40 | 41 | { |
| 41 | 42 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 42 | 43 | // must start with interrupts and sub CPU disabled |
| 43 | cpu_interrupt_enable(0, 0); | |
| 44 | cpu_interrupt_enable(machine->cpu[0], 0); | |
| 44 | 45 | kyugo_sub_cpu_control_w(space, 0, 0); |
| 45 | 46 | } |
| 46 | 47 | |
| r3957 | r3958 | |
| 472 | 473 | MDRV_CPU_IO_MAP(gyrodine_sub_portmap,0) |
| 473 | 474 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) |
| 474 | 475 | |
| 475 | MDRV_ | |
| 476 | MDRV_QUANTUM_TIME | |
| 476 | 477 | |
| 477 | 478 | MDRV_MACHINE_RESET(kyugo) |
| 478 | 479 |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/i86/i86.h" | |
| 45 | 46 | #include "machine/eeprom.h" |
| 46 | 47 | #include "cpu/z80/z80.h" |
| 47 | 48 | #include "leland.h" |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | */ |
| 32 | 32 | |
| 33 | 33 | #include "driver.h" |
| 34 | #include "cpu/z80/z80.h" | |
| 34 | 35 | #include "sound/ay8910.h" |
| 35 | 36 | #include "sound/msm5205.h" |
| 36 | 37 |
| r3957 | r3958 | |
|---|---|---|
| 444 | 444 | static WRITE8_HANDLER( popeye_portB_w ) |
| 445 | 445 | { |
| 446 | 446 | /* bit 0 flips screen */ |
| 447 | flip_screen_set(data & 1); | |
| 447 | flip_screen_set(space->machine, data & 1); | |
| 448 | 448 | |
| 449 | 449 | /* bits 1-3 select DSW1 bit to read */ |
| 450 | 450 | dswbit = (data & 0x0e) >> 1; |
| r3957 | r3958 | |
|---|---|---|
| 95 | 95 | *********************************************************************/ |
| 96 | 96 | |
| 97 | 97 | #include "driver.h" |
| 98 | #include "cpu/e132xs/e132xs.h" | |
| 98 | 99 | #include "sound/okim6295.h" |
| 99 | 100 | |
| 100 | 101 | static UINT32 *gstream_vram; |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/z80/z80.h" | |
| 8 | 9 | #include "machine/8255ppi.h" |
| 9 | 10 | #include "taxidrvr.h" |
| 10 | 11 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 49 | 50 | |
| 50 | 51 | /* bit 2 toggles during gameplay */ |
| 51 | 52 | |
| 52 | flip_screen_set(data & 8); | |
| 53 | flip_screen_set(device->machine, data & 8); | |
| 53 | 54 | |
| 54 | 55 | // popmessage("%02x",data&0x0f); |
| 55 | 56 | } |
| r3957 | r3958 | |
| 373 | 374 | MDRV_CPU_IO_MAP(cpu3_port_map,0) |
| 374 | 375 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* ??? */ |
| 375 | 376 | |
| 376 | MDRV_ | |
| 377 | MDRV_QUANTUM_TIME | |
| 377 | 378 | /* synchronization of the CPUs */ |
| 378 | 379 | |
| 379 | 380 | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] ) |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | ****************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/i8085/i8085.h" | |
| 32 | 33 | #include "includes/blockade.h" |
| 33 | 34 | #include "sound/samples.h" |
| 34 | 35 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ****************************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/m6809/m6809.h" | |
| 14 | 15 | #include "sound/2203intf.h" |
| 15 | 16 | |
| 16 | 17 | extern UINT8 *compgolf_bg_ram; |
| r3957 | r3958 | |
|---|---|---|
| 584 | 584 | ***************************************************************************/ |
| 585 | 585 | |
| 586 | 586 | #include "driver.h" |
| 587 | #include "cpu/z80/z80.h" | |
| 587 | 588 | #include "deprecat.h" |
| 588 | 589 | #include "machine/eeprom.h" |
| 589 | 590 | #include "cpu/m68000/m68000.h" |
| r3957 | r3958 | |
| 8116 | 8117 | ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) ) |
| 8117 | 8118 | ROM_END |
| 8118 | 8119 | |
| 8119 | ROM_START( sfz2a | |
| 8120 | ROM_START( sfz2ald ) | |
| 8120 | 8121 | ROM_REGION( CODE_SIZE, "main", 0 ) /* 68000 code */ |
| 8121 | 8122 | ROM_LOAD16_WORD_SWAP( "szaad.03", 0x000000, 0x80000, CRC(89f9483b) SHA1(5da4f82ddc79d9b5697ba2fea96dcaf460118248) ) |
| 8122 | 8123 | ROM_LOAD16_WORD_SWAP( "szaad.04", 0x080000, 0x80000, CRC(aef27ae5) SHA1(5877a05e7355195d686a4d0a97062aacbd3277ee) ) |
| r3957 | r3958 | |
| 8508 | 8509 | GAME( 1996, spf2xjd, spf2t, dead_cps2, cps2_2p2b, cps2, ROT0, "bootleg", "Super Puzzle Fighter II X (Japan 960531 Phoenix Edition) (bootleg)", 0 ) |
| 8509 | 8510 | GAME( 1996, ddsomud, ddsom, dead_cps2, cps2_4p4b, cps2, ROT0, "bootleg", "Dungeons & Dragons: Shadow over Mystara (USA 960619 Phoenix Edition) (bootleg)", 0 ) |
| 8510 | 8511 | GAME( 1996, megamn2d, megaman2,dead_cps2, cps2_2p3b, cps2, ROT0, "bootleg", "Mega Man 2: The Power Fighters (USA 960708 Phoenix Edition) (bootleg)", 0 ) |
| 8511 | GAME( 1996, sfz2a | |
| 8512 | GAME( 1996, sfz2ald, sfz2al, | |
| 8512 | 8513 | GAME( 1996, xmvsfu1d, xmvsf, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "X-Men Vs. Street Fighter (USA 961004 Phoenix Edition) (bootleg)", 0 ) |
| 8513 | 8514 | GAME( 1997, batcird, batcir, dead_cps2, cps2_4p2b, cps2, ROT0, "bootleg", "Battle Circuit (Euro 970319 Phoenix Edition) (bootleg)", 0 ) |
| 8514 | 8515 | GAME( 1997, vsavd, vsav, dead_cps2, cps2_2p6b, cps2, ROT0, "bootleg", "Vampire Savior: The Lord of Vampire (Euro 970519 Phoenix Edition) (bootleg)", 0 ) |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | ***************************************************************************/ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/z80/z80.h" | |
| 30 | #include "cpu/m68000/m68000.h" | |
| 29 | 31 | #include "machine/8255ppi.h" |
| 30 | 32 | #include "machine/eeprom.h" |
| 31 | 33 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | 18 | #include "driver.h" |
| 19 | #include "cpu/m6809/m6809.h" | |
| 20 | #include "cpu/m68000/m68000.h" | |
| 19 | 21 | #include "lemmings.h" |
| 20 | 22 | #include "sound/2151intf.h" |
| 21 | 23 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/m68000/m68000.h" | |
| 27 | 28 | #include "cpu/z80/z80.h" |
| 28 | 29 | #include "cpu/m6805/m6805.h" |
| 29 | 30 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 42 | 43 | { |
| 43 | 44 | if (ACCESSING_BITS_8_15) |
| 44 | 45 | { |
| 45 | flip_screen_set(data & 0x0200); | |
| 46 | flip_screen_set(space->machine, data & 0x0200); | |
| 46 | 47 | coin_counter_w(0, data & 0x4000); |
| 47 | 48 | coin_counter_w(1, data & 0x8000); |
| 48 | 49 | } |
| r3957 | r3958 | |
| 463 | 464 | MDRV_CPU_ADD("mcu", M68705, 4000000) /* No idea */ |
| 464 | 465 | MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem) |
| 465 | 466 | |
| 466 | MDRV_ | |
| 467 | MDRV_QUANTUM_TIME | |
| 467 | 468 | |
| 468 | 469 | /* video hardware */ |
| 469 | 470 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 501 | 502 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 502 | 503 | MDRV_CPU_IO_MAP(sound_io_map,0) |
| 503 | 504 | |
| 504 | MDRV_ | |
| 505 | MDRV_QUANTUM_TIME | |
| 505 | 506 | |
| 506 | 507 | MDRV_MACHINE_RESET(bballs) |
| 507 | 508 |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | #include "driver.h" |
| 30 | #include "cpu/z80/z80.h" | |
| 31 | #include "cpu/m68000/m68000.h" | |
| 30 | 32 | #include "sound/okim6295.h" |
| 31 | 33 | |
| 32 | 34 | VIDEO_START( zerozone ); |
| r3957 | r3958 | |
| 181 | 183 | MDRV_CPU_ADD("audio", Z80, 1000000) /* 1 MHz ??? */ |
| 182 | 184 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 183 | 185 | |
| 184 | MDRV_ | |
| 186 | MDRV_QUANTUM_TIME | |
| 185 | 187 | |
| 186 | 188 | /* video hardware */ |
| 187 | 189 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | static TIMER_CALLBACK( interrupt_disable ) |
| 20 | 20 | { |
| 21 | 21 | //interrupt_enable = 0; |
| 22 | cpu_interrupt_enable(0,0); | |
| 22 | cpu_interrupt_enable(machine->cpu[0],0); | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | MACHINE_RESET( espial ) |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/z80/z80.h" | |
| 8 | 9 | #include "machine/konami1.h" |
| 9 | 10 | #include "cpu/m6809/m6809.h" |
| 10 | 11 | #include "sound/vlm5030.h" |
| r3957 | r3958 | |
|---|---|---|
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | 117 | #include "driver.h" |
| 118 | #include "cpu/i8085/i8085.h" | |
| 118 | 119 | #include "includes/tiamc1.h" |
| 119 | 120 | |
| 120 | 121 | static UINT8 *video_ram; |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | ***************************************************************************/ |
| 63 | 63 | |
| 64 | 64 | #include "driver.h" |
| 65 | #include "cpu/z80/z80.h" | |
| 66 | #include "cpu/m68000/m68000.h" | |
| 65 | 67 | #include "cpu/tms32010/tms32010.h" |
| 66 | 68 | #include "toaplan1.h" |
| 67 | 69 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 1249 | 1251 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| 1250 | 1252 | MDRV_CPU_IO_MAP(rallybik_sound_io_map, 0) |
| 1251 | 1253 | |
| 1252 | MDRV_ | |
| 1254 | MDRV_QUANTUM_TIME | |
| 1253 | 1255 | |
| 1254 | 1256 | MDRV_MACHINE_RESET(toaplan1) |
| 1255 | 1257 | |
| r3957 | r3958 | |
| 1289 | 1291 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| 1290 | 1292 | MDRV_CPU_IO_MAP(truxton_sound_io_map, 0) |
| 1291 | 1293 | |
| 1292 | MDRV_ | |
| 1294 | MDRV_QUANTUM_TIME | |
| 1293 | 1295 | |
| 1294 | 1296 | MDRV_MACHINE_RESET(toaplan1) |
| 1295 | 1297 | |
| r3957 | r3958 | |
| 1329 | 1331 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| 1330 | 1332 | MDRV_CPU_IO_MAP(hellfire_sound_io_map, 0) |
| 1331 | 1333 | |
| 1332 | MDRV_ | |
| 1334 | MDRV_QUANTUM_TIME | |
| 1333 | 1335 | |
| 1334 | 1336 | MDRV_MACHINE_RESET(toaplan1) |
| 1335 | 1337 | |
| r3957 | r3958 | |
| 1369 | 1371 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| 1370 | 1372 | MDRV_CPU_IO_MAP(zerowing_sound_io_map, 0) |
| 1371 | 1373 | |
| 1372 | MDRV_ | |
| 1374 | MDRV_QUANTUM_TIME | |
| 1373 | 1375 | |
| 1374 | 1376 | MDRV_MACHINE_RESET(zerozone) |
| 1375 | 1377 | |
| r3957 | r3958 | |
| 1413 | 1415 | MDRV_CPU_PROGRAM_MAP(DSP_program_map,0) |
| 1414 | 1416 | MDRV_CPU_IO_MAP(DSP_io_map,0) |
| 1415 | 1417 | |
| 1416 | MDRV_ | |
| 1418 | MDRV_QUANTUM_TIME | |
| 1417 | 1419 | |
| 1418 | 1420 | MDRV_MACHINE_RESET(demonwld) |
| 1419 | 1421 | |
| r3957 | r3958 | |
| 1487 | 1489 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| 1488 | 1490 | MDRV_CPU_IO_MAP(outzone_sound_io_map, 0) |
| 1489 | 1491 | |
| 1490 | MDRV_ | |
| 1492 | MDRV_QUANTUM_TIME | |
| 1491 | 1493 | |
| 1492 | 1494 | MDRV_MACHINE_RESET(zerozone) |
| 1493 | 1495 |
| r3957 | r3958 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | static MACHINE_RESET( pignewt ) |
| 174 | 174 | { |
| 175 | sega_usb_reset(0x10); | |
| 175 | sega_usb_reset(machine, 0x10); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 |
| r3957 | r3958 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | #include "driver.h" |
| 74 | #include "cpu/m68000/m68000.h" | |
| 74 | 75 | #include "sound/okim6295.h" |
| 75 | 76 | #include "sgsafari.lh" |
| 76 | 77 |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | ****************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 36 | 37 | #include "sound/2203intf.h" |
| 37 | 38 | #include "sound/msm5205.h" |
| 38 | 39 |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | ***************************************************************************/ |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "cpu/nec/nec.h" | |
| 26 | 27 | #include "audio/seibu.h" |
| 27 | 28 | #include "video/hd63484.h" |
| 28 | 29 | |
| r3957 | r3958 | |
| 496 | 497 | |
| 497 | 498 | SEIBU3A_SOUND_SYSTEM_CPU(14318180/4) |
| 498 | 499 | |
| 499 | MDRV_ | |
| 500 | MDRV_QUANTUM_TIME | |
| 500 | 501 | |
| 501 | 502 | MDRV_MACHINE_RESET(seibu_sound) |
| 502 | 503 |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | ****************************************************************************/ |
| 79 | 79 | |
| 80 | 80 | #include "driver.h" |
| 81 | #include "cpu/m68000/m68000.h" | |
| 81 | 82 | #include "cpu/tms34010/tms34010.h" |
| 82 | 83 | #include "sound/upd7759.h" |
| 83 | 84 | #include "jpmimpct.h" |
| r3957 | r3958 | |
| 850 | 851 | MDRV_CPU_CONFIG(tms_config) |
| 851 | 852 | MDRV_CPU_PROGRAM_MAP(tms_program_map, 0) |
| 852 | 853 | |
| 853 | MDRV_ | |
| 854 | MDRV_QUANTUM_TIME | |
| 854 | 855 | MDRV_MACHINE_RESET(jpmimpct) |
| 855 | 856 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 856 | 857 |
| r3957 | r3958 | |
|---|---|---|
| 922 | 922 | */ |
| 923 | 923 | |
| 924 | 924 | #include "driver.h" |
| 925 | #include "deprecat.h" | |
| 926 | 925 | #include "cpu/mips/psx.h" |
| 927 | 926 | #include "cpu/h83002/h8.h" |
| 928 | 927 | #include "includes/psx.h" |
| r3957 | r3958 | |
| 1016 | 1015 | verboselog( space->machine, 1, "dmaoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, m_n_dmaoffset ); |
| 1017 | 1016 | } |
| 1018 | 1017 | |
| 1019 | static void namcos12_rom_read( UINT32 n_address, INT32 n_size ) | |
| 1018 | static void namcos12_rom_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 1020 | 1019 | { |
| 1021 | running_machine *machine = Machine; | |
| 1022 | 1020 | const char *n_region; |
| 1023 | 1021 | int n_offset; |
| 1024 | 1022 | |
| r3957 | r3958 | |
| 1505 | 1503 | MDRV_SOUND_ROUTE(2, "right", 1.00) |
| 1506 | 1504 | MDRV_SOUND_ROUTE(3, "left", 1.00) |
| 1507 | 1505 | |
| 1508 | MDRV_ | |
| 1506 | MDRV_AT28C16_ADD( "at28c16", NULL | |
| 1509 | 1507 | MACHINE_DRIVER_END |
| 1510 | 1508 | |
| 1511 | 1509 | static INPUT_PORTS_START( namcos12 ) |
| r3957 | r3958 | |
|---|---|---|
| 136 | 136 | */ |
| 137 | 137 | |
| 138 | 138 | #include "driver.h" |
| 139 | #include "cpu/nec/nec.h" | |
| 139 | 140 | #include "cpu/z80/z80.h" |
| 140 | 141 | #include "audio/seibu.h" |
| 141 | 142 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/z80/z80.h" | |
| 22 | 23 | #include "deprecat.h" |
| 23 | 24 | #include "sound/ay8910.h" |
| 24 | 25 | #include "includes/espial.h" |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | ***************************************************************************/ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/z80/z80.h" | |
| 29 | 30 | #include "cpu/s2650/s2650.h" |
| 30 | 31 | #include "machine/8255ppi.h" |
| 31 | 32 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | /* Mogura Desse */ |
| 2 | 2 | |
| 3 | 3 | #include "driver.h" |
| 4 | #include "cpu/z80/z80.h" | |
| 4 | 5 | #include "sound/dac.h" |
| 5 | 6 | |
| 6 | 7 | static UINT8 *mogura_tileram; |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | // 0x3E7 round point/passing point control? |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/m6502/m6502.h" | |
| 45 | 46 | #include "sound/ay8910.h" |
| 46 | 47 | |
| 47 | 48 |
| r3957 | r3958 | |
|---|---|---|
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | static MACHINE_RESET( mwalkbl ){ |
| 843 | sys16_bg_priority_value=0x1000; | |
| 844 | sys16_sprxoffset = -0x238; | |
| 843 | static const sys16_patch patch[] = | |
| 844 | { | |
| 845 | { 0x70116, 0x4e }, | |
| 846 | { 0x70117, 0x71 }, | |
| 845 | 847 | |
| 846 | sys16_patch_code( 0x70116, 0x4e); | |
| 847 | sys16_patch_code( 0x70117, 0x71); | |
| 848 | { 0x0314a, 0x46 }, | |
| 849 | { 0x0314b, 0x42 }, | |
| 850 | { 0x0311b, 0x3f }, | |
| 848 | 851 | |
| 849 | sys16_patch_code( 0x314a, 0x46); | |
| 850 | sys16_patch_code( 0x314b, 0x42); | |
| 852 | { 0x70103, 0x00 }, | |
| 853 | { 0x70109, 0x00 }, | |
| 854 | { 0x07727, 0x00 }, | |
| 855 | { 0x07729, 0x00 }, | |
| 856 | { 0x0780d, 0x00 }, | |
| 857 | { 0x0780f, 0x00 }, | |
| 858 | { 0x07861, 0x00 }, | |
| 859 | { 0x07863, 0x00 }, | |
| 860 | { 0x07d47, 0x00 }, | |
| 861 | { 0x07863, 0x00 }, | |
| 862 | { 0x08533, 0x00 }, | |
| 863 | { 0x08535, 0x00 }, | |
| 864 | { 0x085bd, 0x00 }, | |
| 865 | { 0x085bf, 0x00 }, | |
| 866 | { 0x09a4b, 0x00 }, | |
| 867 | { 0x09a4d, 0x00 }, | |
| 868 | { 0x09b2f, 0x00 }, | |
| 869 | { 0x09b31, 0x00 }, | |
| 870 | { 0x0a05b, 0x00 }, | |
| 871 | { 0x0a05d, 0x00 }, | |
| 872 | { 0x0a23f, 0x00 }, | |
| 873 | { 0x0a241, 0x00 }, | |
| 874 | { 0x10159, 0x00 }, | |
| 875 | { 0x1015b, 0x00 }, | |
| 876 | { 0x109fb, 0x00 }, | |
| 877 | { 0x109fd, 0x00 }, | |
| 851 | 878 | |
| 852 | sys16_patch_code( 0x311b, 0x3f); | |
| 879 | // * SEGA mark | |
| 880 | { 0x70212, 0x4e }, | |
| 881 | { 0x70213, 0x71 } | |
| 882 | }; | |
| 853 | 883 | |
| 854 | sys16_patch_code( 0x70103, 0x00); | |
| 855 | sys16_patch_code( 0x70109, 0x00); | |
| 856 | sys16_patch_code( 0x07727, 0x00); | |
| 857 | sys16_patch_code( 0x07729, 0x00); | |
| 858 | sys16_patch_code( 0x0780d, 0x00); | |
| 859 | sys16_patch_code( 0x0780f, 0x00); | |
| 860 | sys16_patch_code( 0x07861, 0x00); | |
| 861 | sys16_patch_code( 0x07863, 0x00); | |
| 862 | sys16_patch_code( 0x07d47, 0x00); | |
| 863 | sys16_patch_code( 0x07863, 0x00); | |
| 864 | sys16_patch_code( 0x08533, 0x00); | |
| 865 | sys16_patch_code( 0x08535, 0x00); | |
| 866 | sys16_patch_code( 0x085bd, 0x00); | |
| 867 | sys16_patch_code( 0x085bf, 0x00); | |
| 868 | sys16_patch_code( 0x09a4b, 0x00); | |
| 869 | sys16_patch_code( 0x09a4d, 0x00); | |
| 870 | sys16_patch_code( 0x09b2f, 0x00); | |
| 871 | sys16_patch_code( 0x09b31, 0x00); | |
| 872 | sys16_patch_code( 0x0a05b, 0x00); | |
| 873 | sys16_patch_code( 0x0a05d, 0x00); | |
| 874 | sys16_patch_code( 0x0a23f, 0x00); | |
| 875 | sys16_patch_code( 0x0a241, 0x00); | |
| 876 | sys16_patch_code( 0x10159, 0x00); | |
| 877 | sys16_patch_code( 0x1015b, 0x00); | |
| 878 | sys16_patch_code( 0x109fb, 0x00); | |
| 879 | sys16_patch_code( 0x109fd, 0x00); | |
| 884 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 885 | sys16_bg_priority_value=0x1000; | |
| 886 | sys16_sprxoffset = -0x238; | |
| 880 | 887 | |
| 881 | // * SEGA mark | |
| 882 | sys16_patch_code( 0x70212, 0x4e); | |
| 883 | sys16_patch_code( 0x70213, 0x71); | |
| 884 | ||
| 885 | 888 | sys16_update_proc = mwalkbl_update_proc; |
| 886 | 889 | } |
| 887 | 890 | |
| r3957 | r3958 | |
| 989 | 992 | } |
| 990 | 993 | |
| 991 | 994 | static MACHINE_RESET( astormbl ){ |
| 992 | sys16_fgxoffset = sys16_bgxoffset = -9; | |
| 995 | static const sys16_patch patch[] = | |
| 996 | { | |
| 997 | { 0x02D6E, 0x32 }, | |
| 998 | { 0x02D6F, 0x3c }, | |
| 999 | { 0x02D70, 0x80 }, | |
| 1000 | { 0x02D71, 0x00 }, | |
| 1001 | { 0x02D72, 0x33 }, | |
| 1002 | { 0x02D73, 0xc1 }, | |
| 1003 | { 0x02ea2, 0x30 }, | |
| 1004 | { 0x02ea3, 0x38 }, | |
| 1005 | { 0x02ea4, 0xec }, | |
| 1006 | { 0x02ea5, 0xf6 }, | |
| 1007 | { 0x02ea6, 0x30 }, | |
| 1008 | { 0x02ea7, 0x80 }, | |
| 1009 | { 0x02e5c, 0x30 }, | |
| 1010 | { 0x02e5d, 0x38 }, | |
| 1011 | { 0x02e5e, 0xec }, | |
| 1012 | { 0x02e5f, 0xe2 }, | |
| 1013 | { 0x02e60, 0xc0 }, | |
| 1014 | { 0x02e61, 0x7c }, | |
| 993 | 1015 | |
| 994 | sys16_patch_code( 0x2D6E, 0x32 ); | |
| 995 | sys16_patch_code( 0x2D6F, 0x3c ); | |
| 996 | sys16_patch_code( 0x2D70, 0x80 ); | |
| 997 | sys16_patch_code( 0x2D71, 0x00 ); | |
| 998 | sys16_patch_code( 0x2D72, 0x33 ); | |
| 999 | sys16_patch_code( 0x2D73, 0xc1 ); | |
| 1000 | sys16_patch_code( 0x2ea2, 0x30 ); | |
| 1001 | sys16_patch_code( 0x2ea3, 0x38 ); | |
| 1002 | sys16_patch_code( 0x2ea4, 0xec ); | |
| 1003 | sys16_patch_code( 0x2ea5, 0xf6 ); | |
| 1004 | sys16_patch_code( 0x2ea6, 0x30 ); | |
| 1005 | sys16_patch_code( 0x2ea7, 0x80 ); | |
| 1006 | sys16_patch_code( 0x2e5c, 0x30 ); | |
| 1007 | sys16_patch_code( 0x2e5d, 0x38 ); | |
| 1008 | sys16_patch_code( 0x2e5e, 0xec ); | |
| 1009 | sys16_patch_code( 0x2e5f, 0xe2 ); | |
| 1010 | sys16_patch_code( 0x2e60, 0xc0 ); | |
| 1011 | sys16_patch_code( 0x2e61, 0x7c ); | |
| 1016 | { 0x04cd8, 0x02 }, | |
| 1017 | { 0x04cec, 0x03 }, | |
| 1018 | { 0x2dc6c, 0xe9 }, | |
| 1019 | { 0x2dc64, 0x10 }, | |
| 1020 | { 0x2dc65, 0x10 }, | |
| 1021 | { 0x3a100, 0x10 }, | |
| 1022 | { 0x3a101, 0x13 }, | |
| 1023 | { 0x3a102, 0x90 }, | |
| 1024 | { 0x3a103, 0x2b }, | |
| 1025 | { 0x3a104, 0x00 }, | |
| 1026 | { 0x3a105, 0x01 }, | |
| 1027 | { 0x3a106, 0x0c }, | |
| 1028 | { 0x3a107, 0x00 }, | |
| 1029 | { 0x3a108, 0x00 }, | |
| 1030 | { 0x3a109, 0x01 }, | |
| 1031 | { 0x3a10a, 0x66 }, | |
| 1032 | { 0x3a10b, 0x06 }, | |
| 1033 | { 0x3a10c, 0x42 }, | |
| 1034 | { 0x3a10d, 0x40 }, | |
| 1035 | { 0x3a10e, 0x54 }, | |
| 1036 | { 0x3a10f, 0x8b }, | |
| 1037 | { 0x3a110, 0x60 }, | |
| 1038 | { 0x3a111, 0x02 }, | |
| 1039 | { 0x3a112, 0x30 }, | |
| 1040 | { 0x3a113, 0x1b }, | |
| 1041 | { 0x3a114, 0x34 }, | |
| 1042 | { 0x3a115, 0xc0 }, | |
| 1043 | { 0x3a116, 0x34 }, | |
| 1044 | { 0x3a117, 0xdb }, | |
| 1045 | { 0x3a118, 0x24 }, | |
| 1046 | { 0x3a119, 0xdb }, | |
| 1047 | { 0x3a11a, 0x24 }, | |
| 1048 | { 0x3a11b, 0xdb }, | |
| 1049 | { 0x3a11c, 0x4e }, | |
| 1050 | { 0x3a11d, 0x75 }, | |
| 1051 | { 0x0af8e, 0x66 }, | |
| 1012 | 1052 | |
| 1013 | sys16_patch_code( 0x4cd8, 0x02 ); | |
| 1014 | sys16_patch_code( 0x4cec, 0x03 ); | |
| 1015 | sys16_patch_code( 0x2dc6c, 0xe9 ); | |
| 1016 | sys16_patch_code( 0x2dc64, 0x10 ); | |
| 1017 | sys16_patch_code( 0x2dc65, 0x10 ); | |
| 1018 | sys16_patch_code( 0x3a100, 0x10 ); | |
| 1019 | sys16_patch_code( 0x3a101, 0x13 ); | |
| 1020 | sys16_patch_code( 0x3a102, 0x90 ); | |
| 1021 | sys16_patch_code( 0x3a103, 0x2b ); | |
| 1022 | sys16_patch_code( 0x3a104, 0x00 ); | |
| 1023 | sys16_patch_code( 0x3a105, 0x01 ); | |
| 1024 | sys16_patch_code( 0x3a106, 0x0c ); | |
| 1025 | sys16_patch_code( 0x3a107, 0x00 ); | |
| 1026 | sys16_patch_code( 0x3a108, 0x00 ); | |
| 1027 | sys16_patch_code( 0x3a109, 0x01 ); | |
| 1028 | sys16_patch_code( 0x3a10a, 0x66 ); | |
| 1029 | sys16_patch_code( 0x3a10b, 0x06 ); | |
| 1030 | sys16_patch_code( 0x3a10c, 0x42 ); | |
| 1031 | sys16_patch_code( 0x3a10d, 0x40 ); | |
| 1032 | sys16_patch_code( 0x3a10e, 0x54 ); | |
| 1033 | sys16_patch_code( 0x3a10f, 0x8b ); | |
| 1034 | sys16_patch_code( 0x3a110, 0x60 ); | |
| 1035 | sys16_patch_code( 0x3a111, 0x02 ); | |
| 1036 | sys16_patch_code( 0x3a112, 0x30 ); | |
| 1037 | sys16_patch_code( 0x3a113, 0x1b ); | |
| 1038 | sys16_patch_code( 0x3a114, 0x34 ); | |
| 1039 | sys16_patch_code( 0x3a115, 0xc0 ); | |
| 1040 | sys16_patch_code( 0x3a116, 0x34 ); | |
| 1041 | sys16_patch_code( 0x3a117, 0xdb ); | |
| 1042 | sys16_patch_code( 0x3a118, 0x24 ); | |
| 1043 | sys16_patch_code( 0x3a119, 0xdb ); | |
| 1044 | sys16_patch_code( 0x3a11a, 0x24 ); | |
| 1045 | sys16_patch_code( 0x3a11b, 0xdb ); | |
| 1046 | sys16_patch_code( 0x3a11c, 0x4e ); | |
| 1047 | sys16_patch_code( 0x3a11d, 0x75 ); | |
| 1048 | sys16_patch_code( 0xaf8e, 0x66 ); | |
| 1053 | /* fix missing credit text */ | |
| 1054 | { 0x03f9a, 0xec }, | |
| 1055 | { 0x03f9b, 0x36 } | |
| 1056 | }; | |
| 1049 | 1057 | |
| 1050 | /* fix missing credit text */ | |
| 1051 | sys16_patch_code( 0x3f9a, 0xec ); | |
| 1052 | sys16_patch_code( 0x3f9b, 0x36 ); | |
| 1053 | ||
| 1058 | sys16_patch_code(machine, patch, ARRAY_LENGTH(patch)); | |
| 1059 | sys16_fgxoffset = sys16_bgxoffset = -9; | |
| 1054 | 1060 | sys16_update_proc = astormbl_update_proc; |
| 1055 | 1061 | } |
| 1056 | 1062 |
| r3957 | r3958 | |
|---|---|---|
| 350 | 350 | */ |
| 351 | 351 | |
| 352 | 352 | #include "driver.h" |
| 353 | #include "cpu/tms32051/tms32051.h" | |
| 354 | #include "cpu/m68000/m68000.h" | |
| 353 | 355 | #include "taito_f3.h" |
| 354 | 356 | #include "cpu/mc68hc11/mc68hc11.h" |
| 355 | 357 | #include "sound/es5506.h" |
| r3957 | r3958 | |
| 1307 | 1309 | MDRV_CPU_PROGRAM_MAP(tms_program_map, 0) |
| 1308 | 1310 | MDRV_CPU_DATA_MAP(tms_data_map, 0) |
| 1309 | 1311 | |
| 1310 | MDRV_ | |
| 1312 | MDRV_QUANTUM_TIME | |
| 1311 | 1313 | |
| 1312 | 1314 | MDRV_MACHINE_RESET(taitojc) |
| 1313 | 1315 | MDRV_NVRAM_HANDLER(93C46) |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/z80/z80.h" | |
| 17 | 18 | #include "sound/okim6295.h" |
| 18 | 19 | #include "sound/3812intf.h" |
| 19 | 20 | #include "includes/bublbobl.h" |
| r3957 | r3958 | |
| 96 | 97 | x = sx + xc * 8; |
| 97 | 98 | y = (sy + yc * 8) & 0xff; |
| 98 | 99 | |
| 99 | if (flip_screen_get()) | |
| 100 | if (flip_screen_get(screen->machine)) | |
| 100 | 101 | { |
| 101 | 102 | x = 248 - x; |
| 102 | 103 | y = 248 - y; |
| r3957 | r3958 | |
| 368 | 369 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 369 | 370 | MDRV_CPU_VBLANK_INT("main", missb2_interrupt) |
| 370 | 371 | |
| 371 | MDRV_ | |
| 372 | MDRV_QUANTUM_TIME | |
| 372 | 373 | |
| 373 | 374 | // video hardware |
| 374 | 375 |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | */ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/z80/z80.h" | |
| 67 | 68 | #include "cpu/m6805/m6805.h" |
| 68 | 69 | #include "sound/ay8910.h" |
| 69 | 70 | #include "includes/pitnrun.h" |
| r3957 | r3958 | |
| 82 | 83 | |
| 83 | 84 | static WRITE8_HANDLER(pitnrun_hflip_w) |
| 84 | 85 | { |
| 85 | flip_screen_x_set(data); | |
| 86 | flip_screen_x_set(space->machine, data); | |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | 89 | static WRITE8_HANDLER(pitnrun_vflip_w) |
| 89 | 90 | { |
| 90 | flip_screen_y_set(data); | |
| 91 | flip_screen_y_set(space->machine, data); | |
| 91 | 92 | } |
| 92 | 93 | |
| 93 | 94 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r3957 | r3958 | |
| 267 | 268 | |
| 268 | 269 | MDRV_MACHINE_RESET(pitnrun) |
| 269 | 270 | |
| 270 | MDRV_ | |
| 271 | MDRV_QUANTUM_TIME | |
| 271 | 272 | |
| 272 | 273 | /* video hardware */ |
| 273 | 274 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 134 | 134 | ******************************************************************************************/ |
| 135 | 135 | |
| 136 | 136 | #include "driver.h" |
| 137 | #include "cpu/m6502/m6502.h" | |
| 137 | 138 | #include "deprecat.h" |
| 138 | 139 | #include "machine/atari_vg.h" |
| 139 | 140 | #include "sound/pokey.h" |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "exidy.h" |
| 13 | 14 | #include "machine/74181.h" |
| 14 | 15 | #include "sound/s14001a.h" |
| r3957 | r3958 | |
|---|---|---|
| 671 | 671 | MDRV_CPU_IO_MAP(sound_port,0) |
| 672 | 672 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 673 | 673 | |
| 674 | MDRV_ | |
| 674 | MDRV_QUANTUM_TIME | |
| 675 | 675 | |
| 676 | 676 | /* video hardware */ |
| 677 | 677 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | ********************************************************************/ |
| 56 | 56 | |
| 57 | 57 | #include "driver.h" |
| 58 | #include "cpu/z80/z80.h" | |
| 59 | #include "cpu/m68000/m68000.h" | |
| 58 | 60 | #include "deprecat.h" |
| 59 | 61 | #include "sound/2151intf.h" |
| 60 | 62 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/m6809/m6809.h" | |
| 10 | 11 | #include "sound/ay8910.h" |
| 11 | 12 | #include "sound/2203intf.h" |
| 12 | 13 | |
| r3957 | r3958 | |
| 24 | 25 | |
| 25 | 26 | static READ8_HANDLER( citycon_in_r ) |
| 26 | 27 | { |
| 27 | return input_port_read(space->machine, flip_screen_get() ? "P2" : "P1"); | |
| 28 | return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1"); | |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | ***************************************************************************/ |
| 81 | 81 | |
| 82 | 82 | #include "driver.h" |
| 83 | #include "cpu/z80/z80.h" | |
| 83 | 84 | #include "suprridr.h" |
| 84 | 85 | #include "sound/ay8910.h" |
| 85 | 86 |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | - The hardware is similar to other IGS002 + IGS003 based boards. |
| 13 | 13 | The interesting part is the background tilemap, that is designed specifically |
| 14 | for simulating the nine reels of a slot machine. The way it works is similar, | |
| 15 | but more complicated than what's emulated in iqblock.c or goldstar.c. | |
| 16 | It's not emulated properly yet, hence the game is not playable and marked NOT_WORKING. | |
| 14 | for simulating the nine reels of a slot machine. | |
| 17 | 15 | |
| 18 | 16 | ***************************************************************************/ |
| 19 | 17 | |
| r3957 | r3958 | |
| 27 | 25 | Video Hardware |
| 28 | 26 | ***************************************************************************/ |
| 29 | 27 | |
| 30 | static UINT8 *fg_tile_ram, *fg_color_ram; | |
| 31 | static UINT8 *bg_tile_ram, *bg_scroll, *bg_scroll2; | |
| 32 | 28 | |
| 33 | static tilemap *fg_tilemap; | |
| 34 | static tilemap *bg_tilemap; | |
| 29 | static tilemap *gp98_reel1_tilemap; | |
| 30 | UINT8 *gp98_reel1_ram; | |
| 35 | 31 | |
| 36 | static int video_enable; | |
| 32 | WRITE8_HANDLER( gp98_reel1_ram_w ) | |
| 33 | { | |
| 34 | gp98_reel1_ram[offset] = data; | |
| 35 | tilemap_mark_tile_dirty(gp98_reel1_tilemap,offset); | |
| 36 | } | |
| 37 | 37 | |
| 38 | static | |
| 38 | static | |
| 39 | 39 | { |
| 40 | bg_scroll[offset] = data; | |
| 41 | tilemap_set_scrolly(bg_tilemap,offset,data); | |
| 40 | int code = gp98_reel1_ram[tile_index]; | |
| 41 | ||
| 42 | SET_TILE_INFO( | |
| 43 | 0, | |
| 44 | (code)+(((tile_index+1)&0x3)*0x100), | |
| 45 | 0, | |
| 46 | 0); | |
| 42 | 47 | } |
| 43 | 48 | |
| 44 | 49 | |
| 45 | static TILE_GET_INFO( get_ | |
| 50 | static TILE_GET_INFO( get_ | |
| 46 | 51 | { |
| 47 | int code = bg_tile_ram[tile_index]; | |
| 48 | SET_TILE_INFO(0, code + ((tile_index+1) % 4) * 0x100, (code & 0x80) ? 0xc : 0, 0); | |
| 52 | int code = gp98_reel1_ram[tile_index]; | |
| 53 | ||
| 54 | SET_TILE_INFO( | |
| 55 | 0, | |
| 56 | (code*4)+(tile_index&0x3), | |
| 57 | 0, | |
| 58 | 0); | |
| 49 | 59 | } |
| 50 | 60 | |
| 51 | static WRITE8_HANDLER( bg_tile_w ) | |
| 61 | static tilemap *gp98_reel2_tilemap; | |
| 62 | UINT8 *gp98_reel2_ram; | |
| 63 | ||
| 64 | WRITE8_HANDLER( gp98_reel2_ram_w ) | |
| 52 | 65 | { |
| 53 | bg_tile_ram[offset] = data; | |
| 54 | tilemap_mark_tile_dirty(bg_tilemap,offset); | |
| 66 | gp98_reel2_ram[offset] = data; | |
| 67 | tilemap_mark_tile_dirty(gp98_reel2_tilemap,offset); | |
| 55 | 68 | } |
| 56 | 69 | |
| 70 | static TILE_GET_INFO( get_jingbell_reel2_tile_info ) | |
| 71 | { | |
| 72 | int code = gp98_reel2_ram[tile_index]; | |
| 57 | 73 | |
| 74 | SET_TILE_INFO( | |
| 75 | 0, | |
| 76 | (code)+(((tile_index+1)&0x3)*0x100), | |
| 77 | 0, | |
| 78 | 0); | |
| 79 | } | |
| 80 | ||
| 81 | static TILE_GET_INFO( get_gp98_reel2_tile_info ) | |
| 82 | { | |
| 83 | int code = gp98_reel2_ram[tile_index]; | |
| 84 | ||
| 85 | SET_TILE_INFO( | |
| 86 | 0, | |
| 87 | (code*4)+(tile_index&0x3), | |
| 88 | 0, | |
| 89 | 0); | |
| 90 | } | |
| 91 | ||
| 92 | ||
| 93 | static tilemap *gp98_reel3_tilemap; | |
| 94 | UINT8 *gp98_reel3_ram; | |
| 95 | ||
| 96 | WRITE8_HANDLER( gp98_reel3_ram_w ) | |
| 97 | { | |
| 98 | gp98_reel3_ram[offset] = data; | |
| 99 | tilemap_mark_tile_dirty(gp98_reel3_tilemap,offset); | |
| 100 | } | |
| 101 | ||
| 102 | static TILE_GET_INFO( get_jingbell_reel3_tile_info ) | |
| 103 | { | |
| 104 | int code = gp98_reel3_ram[tile_index]; | |
| 105 | ||
| 106 | SET_TILE_INFO( | |
| 107 | 0, | |
| 108 | (code)+(((tile_index+1)&0x3)*0x100), | |
| 109 | 0, | |
| 110 | 0); | |
| 111 | } | |
| 112 | ||
| 113 | static TILE_GET_INFO( get_gp98_reel3_tile_info ) | |
| 114 | { | |
| 115 | int code = gp98_reel3_ram[tile_index]; | |
| 116 | ||
| 117 | SET_TILE_INFO( | |
| 118 | 0, | |
| 119 | (code*4)+(tile_index&0x3), | |
| 120 | 0, | |
| 121 | 0); | |
| 122 | } | |
| 123 | ||
| 124 | ||
| 125 | static tilemap *gp98_reel4_tilemap; | |
| 126 | UINT8 *gp98_reel4_ram; | |
| 127 | ||
| 128 | WRITE8_HANDLER( gp98_reel4_ram_w ) | |
| 129 | { | |
| 130 | gp98_reel4_ram[offset] = data; | |
| 131 | tilemap_mark_tile_dirty(gp98_reel4_tilemap,offset); | |
| 132 | } | |
| 133 | ||
| 134 | static TILE_GET_INFO( get_jingbell_reel4_tile_info ) | |
| 135 | { | |
| 136 | int code = gp98_reel4_ram[tile_index]; | |
| 137 | ||
| 138 | SET_TILE_INFO( | |
| 139 | 0, | |
| 140 | (code)+(((tile_index+1)&0x3)*0x100), | |
| 141 | 0, | |
| 142 | 0); | |
| 143 | } | |
| 144 | ||
| 145 | static TILE_GET_INFO( get_gp98_reel4_tile_info ) | |
| 146 | { | |
| 147 | int code = gp98_reel4_ram[tile_index]; | |
| 148 | ||
| 149 | SET_TILE_INFO( | |
| 150 | 0, | |
| 151 | (code*4)+(tile_index&0x3), | |
| 152 | 0, | |
| 153 | 0); | |
| 154 | } | |
| 155 | ||
| 156 | ||
| 157 | ||
| 158 | ||
| 159 | static UINT8 *fg_tile_ram, *fg_color_ram; | |
| 160 | static UINT8 *bg_scroll, *bg_scroll2; | |
| 161 | ||
| 162 | static tilemap *fg_tilemap; | |
| 163 | ||
| 164 | static int video_enable; | |
| 165 | ||
| 166 | static WRITE8_HANDLER( bg_scroll_w ) | |
| 167 | { | |
| 168 | bg_scroll[offset] = data; | |
| 169 | // tilemap_set_scrolly(bg_tilemap,offset,data); | |
| 170 | } | |
| 171 | ||
| 172 | ||
| 58 | 173 | static TILE_GET_INFO( get_fg_tile_info ) |
| 59 | 174 | { |
| 60 | 175 | int code = fg_tile_ram[tile_index] | (fg_color_ram[tile_index] << 8); |
| r3957 | r3958 | |
| 75 | 190 | |
| 76 | 191 | static VIDEO_START(jingbell) |
| 77 | 192 | { |
| 78 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 32, 0x80,0x20); | |
| 79 | 193 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 0x80,0x20); |
| 194 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 80 | 195 | |
| 81 | tilemap_set_transparent_pen(bg_tilemap, 0); | |
| 196 | gp98_reel1_tilemap = tilemap_create(machine,get_jingbell_reel1_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 197 | gp98_reel2_tilemap = tilemap_create(machine,get_jingbell_reel2_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 198 | gp98_reel3_tilemap = tilemap_create(machine,get_jingbell_reel3_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 199 | gp98_reel4_tilemap = tilemap_create(machine,get_jingbell_reel4_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 200 | ||
| 201 | tilemap_set_scroll_cols(gp98_reel1_tilemap, 128); | |
| 202 | tilemap_set_scroll_cols(gp98_reel2_tilemap, 128); | |
| 203 | tilemap_set_scroll_cols(gp98_reel3_tilemap, 128); | |
| 204 | tilemap_set_scroll_cols(gp98_reel4_tilemap, 128); | |
| 205 | } | |
| 206 | ||
| 207 | ||
| 208 | static VIDEO_START(gp98) | |
| 209 | { | |
| 210 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 0x80,0x20); | |
| 82 | 211 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 83 | 212 | |
| 84 | tilemap_set_scroll_cols(bg_tilemap, 0x80); | |
| 213 | gp98_reel1_tilemap = tilemap_create(machine,get_gp98_reel1_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 214 | gp98_reel2_tilemap = tilemap_create(machine,get_gp98_reel2_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 215 | gp98_reel3_tilemap = tilemap_create(machine,get_gp98_reel3_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 216 | gp98_reel4_tilemap = tilemap_create(machine,get_gp98_reel4_tile_info,tilemap_scan_rows,8,32, 128, 8); | |
| 217 | ||
| 218 | tilemap_set_scroll_cols(gp98_reel1_tilemap, 128); | |
| 219 | tilemap_set_scroll_cols(gp98_reel2_tilemap, 128); | |
| 220 | tilemap_set_scroll_cols(gp98_reel3_tilemap, 128); | |
| 221 | tilemap_set_scroll_cols(gp98_reel4_tilemap, 128); | |
| 222 | ||
| 85 | 223 | } |
| 86 | 224 | |
| 225 | ||
| 87 | 226 | static VIDEO_UPDATE(jingbell) |
| 88 | 227 | { |
| 89 | 228 | int layers_ctrl = video_enable ? -1 : 0; |
| r3957 | r3958 | |
| 101 | 240 | |
| 102 | 241 | if (layers_ctrl & 1) |
| 103 | 242 | { |
| 104 | if (1) | |
| 243 | int zz,i; | |
| 244 | int startclipmin = 0; | |
| 245 | const rectangle *visarea = video_screen_get_visible_area(screen); | |
| 246 | ||
| 247 | ||
| 248 | for (i= 0;i < 0x80;i++) | |
| 105 | 249 | { |
| 106 | // ********* experimental version of the bg rendering | |
| 107 | int x,y,z, tmap, ystart = 0; | |
| 108 | rectangle myclip; | |
| 250 | tilemap_set_scrolly(gp98_reel1_tilemap, i, bg_scroll[i]*2); | |
| 251 | tilemap_set_scrolly(gp98_reel2_tilemap, i, bg_scroll[i+0x80]*2); | |
| 252 | tilemap_set_scrolly(gp98_reel3_tilemap, i, bg_scroll[i+0x100]*2); | |
| 253 | tilemap_set_scrolly(gp98_reel4_tilemap, i, bg_scroll[i+0x180]*2); | |
| 254 | } | |
| 109 | 255 | |
| 110 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); | |
| 111 | 256 | |
| 112 | memcpy(&myclip,cliprect,sizeof(myclip)); | |
| 113 | 257 | |
| 114 | for (tmap = 0; tmap < 4; tmap++) | |
| 258 | ||
| 259 | for (zz=0;zz<0x80-8;zz++) // -8 because of visible area (2*8 = 16) | |
| 260 | { | |
| 261 | rectangle clip; | |
| 262 | int rowenable = bg_scroll2[zz]; | |
| 263 | ||
| 264 | /* draw top of screen */ | |
| 265 | clip.min_x = visarea->min_x; | |
| 266 | clip.max_x = visarea->max_x; | |
| 267 | clip.min_y = startclipmin; | |
| 268 | clip.max_y = startclipmin+2; | |
| 269 | ||
| 270 | bitmap_fill(bitmap,&clip,screen->machine->pens[rowenable]); | |
| 271 | ||
| 272 | if (rowenable==0) | |
| 273 | { // 0 and 1 are the same? or is there a global switchoff? | |
| 274 | tilemap_draw(bitmap,&clip,gp98_reel1_tilemap,0,0); | |
| 275 | } | |
| 276 | else if (rowenable==1) | |
| 115 | 277 | { |
| 116 | myclip.min_y = ystart; | |
| 117 | myclip.max_y = ystart+0x0100/4 - 1; | |
| 118 | for (y = 0; y < 0x8; y++) | |
| 119 | { | |
| 120 | for (x = 0; x < 0x80; x++) | |
| 121 | { | |
| 122 | int code = bg_tile_ram[x + y * 0x80 + bg_scroll2[tmap*0x20 + 4] * 0x80 * 0x8]; | |
| 123 | for (z = 0; z < 2; z++) | |
| 124 | { | |
| 125 | drawgfx(bitmap,screen->machine->gfx[0], | |
| 126 | code + ((x+1) % 4) * 0x100, (code & 0x80) ? 0xc : 0, | |
| 127 | 0, 0, | |
| 128 | x * 8, ystart + (y * 32 - ((bg_scroll[x + tmap * 0x80] + tmap*0x100/4) & 0xff)) + z * 0x8 * 0x20, | |
| 129 | // &myclip, TRANSPARENCY_PEN, 0); | |
| 130 | &myclip, TRANSPARENCY_NONE, 0); | |
| 131 | } | |
| 132 | } | |
| 133 | } | |
| 134 | ystart += 0x100/4; | |
| 278 | tilemap_draw(bitmap,&clip,gp98_reel2_tilemap,0,0); | |
| 135 | 279 | } |
| 136 | // ********* | |
| 280 | else if (rowenable==2) | |
| 281 | { | |
| 282 | tilemap_draw(bitmap,&clip,gp98_reel3_tilemap,0,0); | |
| 283 | } | |
| 284 | else if (rowenable==3) | |
| 285 | { | |
| 286 | tilemap_draw(bitmap,&clip,gp98_reel4_tilemap,0,0); | |
| 287 | } | |
| 288 | ||
| 289 | ||
| 290 | startclipmin+=2; | |
| 137 | 291 | } |
| 138 | ||
| 292 | ||
| 139 | 293 | } |
| 140 | 294 | else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 141 | 295 | |
| r3957 | r3958 | |
| 250 | 404 | return 0; |
| 251 | 405 | } |
| 252 | 406 | |
| 407 | ||
| 408 | ||
| 409 | ||
| 253 | 410 | static ADDRESS_MAP_START( jingbell_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 254 | 411 | AM_RANGE( 0x00000, 0x0f3ff ) AM_ROM |
| 255 | 412 | AM_RANGE( 0x0f400, 0x0ffff ) AM_RAM AM_BASE( &generic_nvram ) AM_SIZE( &generic_nvram_size ) |
| r3957 | r3958 | |
| 263 | 420 | AM_RANGE( 0x2000, 0x23ff ) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_BASE( &paletteram ) |
| 264 | 421 | AM_RANGE( 0x2400, 0x27ff ) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_BASE( &paletteram_2 ) |
| 265 | 422 | |
| 266 | AM_RANGE( 0x3000, 0x3fff ) AM_RAM_WRITE( bg_tile_w ) AM_BASE( &bg_tile_ram ) | |
| 423 | AM_RANGE( 0x3000, 0x33ff ) AM_RAM_WRITE( gp98_reel1_ram_w ) AM_BASE( &gp98_reel1_ram ) | |
| 424 | AM_RANGE( 0x3400, 0x37ff ) AM_RAM_WRITE( gp98_reel2_ram_w ) AM_BASE( &gp98_reel2_ram ) | |
| 425 | AM_RANGE( 0x3800, 0x3bff ) AM_RAM_WRITE( gp98_reel3_ram_w ) AM_BASE( &gp98_reel3_ram ) | |
| 426 | AM_RANGE( 0x3c00, 0x3fff ) AM_RAM_WRITE( gp98_reel4_ram_w ) AM_BASE( &gp98_reel4_ram ) | |
| 267 | 427 | |
| 268 | 428 | AM_RANGE( 0x4000, 0x407f ) AM_RAM AM_BASE( &bg_scroll2 ) |
| 269 | 429 | |
| r3957 | r3958 | |
| 426 | 586 | GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x6, 0, 16 ) |
| 427 | 587 | GFXDECODE_END |
| 428 | 588 | |
| 589 | static const gfx_layout tiles8x8_layout = | |
| 590 | { | |
| 591 | 8,8, | |
| 592 | RGN_FRAC(1,3), | |
| 593 | 6, | |
| 594 | { RGN_FRAC(2,3)+0, RGN_FRAC(2,3)+1, RGN_FRAC(1,3)+0, RGN_FRAC(1,3)+1, RGN_FRAC(0,3)+0, RGN_FRAC(0,3)+1 }, | |
| 595 | { 8,10,12,14, 0, 2, 4, 6, }, | |
| 596 | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, | |
| 597 | 16*8 | |
| 598 | }; | |
| 429 | 599 | |
| 600 | static const gfx_layout tiles8x32_layout = | |
| 601 | { | |
| 602 | 8,32, | |
| 603 | RGN_FRAC(1,3), | |
| 604 | 6, | |
| 605 | { RGN_FRAC(2,3)+0, RGN_FRAC(2,3)+1, RGN_FRAC(1,3)+0, RGN_FRAC(1,3)+1, RGN_FRAC(0,3)+0, RGN_FRAC(0,3)+1 }, | |
| 606 | { 8,10,12,14, 0, 2, 4, 6, }, | |
| 607 | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,8*16,9*16,10*16,11*16,12*16,13*16,14*16,15*16,16*16,17*16,18*16,19*16,20*16,21*16,22*16,23*16,24*16,25*16,26*16,27*16,28*16,29*16,30*16,31*16 }, | |
| 608 | 32*16 | |
| 609 | }; | |
| 610 | ||
| 611 | static GFXDECODE_START( gp98 ) | |
| 612 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x32_layout, 0, 16 ) | |
| 613 | GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0, 16 ) | |
| 614 | GFXDECODE_END | |
| 615 | ||
| 616 | ||
| 430 | 617 | /*************************************************************************** |
| 431 | 618 | Machine Drivers |
| 432 | 619 | ***************************************************************************/ |
| r3957 | r3958 | |
| 479 | 666 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 480 | 667 | MACHINE_DRIVER_END |
| 481 | 668 | |
| 669 | static MACHINE_DRIVER_START( gp98 ) | |
| 670 | MDRV_IMPORT_FROM(jingbell) | |
| 671 | MDRV_GFXDECODE(gp98) | |
| 672 | ||
| 673 | MDRV_VIDEO_START(gp98) | |
| 674 | MACHINE_DRIVER_END | |
| 675 | ||
| 676 | ||
| 482 | 677 | /*************************************************************************** |
| 483 | 678 | |
| 484 | 679 | Jingle Bell |
| r3957 | r3958 | |
| 571 | 766 | rom[0x01f19] = 0x18; |
| 572 | 767 | } |
| 573 | 768 | |
| 769 | ROM_START( gp98 ) | |
| 770 | ROM_REGION( 0x20000, "main", 0 ) | |
| 771 | ROM_LOAD( "prg", 0x00000, 0x20000, CRC(1c02b8cc) SHA1(b8a29cbd96581f8ae1c1028279b8ee703be29f5f) ) | |
| 772 | ||
| 773 | ROM_REGION( 0x8000, "data", 0 ) | |
| 774 | ROM_COPY( "main", 0x10000, 0x00000, 0x8000 ) | |
| 775 | ||
| 776 | ROM_REGION( 0x180000, "gfx1", ROMREGION_DISPOSE ) // 6bpp (2bpp per rom) font at tile # 0x4000 | |
| 777 | ROM_LOAD( "49", 0x000000, 0x80000, BAD_DUMP CRC(a9d9367d) SHA1(91c74740fc8394f1e1cd68feb8c993afd2042d70) ) | |
| 778 | ROM_LOAD( "50", 0x080000, 0x80000, CRC(48f6190d) SHA1(b430131a258b4e2fc178ac0e3e3f0010a82eac65) ) | |
| 779 | ROM_LOAD( "51", 0x100000, 0x80000, CRC(30a2ef85) SHA1(38ea637acd83b175eccd2969ef21879265b88992) ) | |
| 780 | ||
| 781 | ROM_REGION( 0x180000, "gfx2", ROMREGION_DISPOSE ) // 6bpp (2bpp per rom) font at tile # 0x4000 | |
| 782 | ROM_COPY( "gfx1", 0x00000, 0x00000, 0x180000 ) | |
| 783 | ||
| 784 | ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 ) | |
| 785 | /* no OKI on this */ | |
| 786 | ROM_END | |
| 787 | ||
| 574 | 788 | GAME( 1995?, jingbell, 0, jingbell, jingbell, jingbell, ROT0, "IGS", "Jingle Bell (Italy, V133I)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) |
| 789 | GAME( 19??, gp98, 0, gp98, jingbell, 0, ROT0, "unknown", "Grand Prix '98",GAME_NOT_WORKING| GAME_NO_SOUND ) |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/z80/z80.h" | |
| 21 | 22 | #include "cpu/m6809/m6809.h" |
| 22 | 23 | #include "video/konamiic.h" |
| 23 | 24 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 61 | 61 | *****/ |
| 62 | 62 | |
| 63 | 63 | #include "driver.h" |
| 64 | #include "cpu/z80/z80.h" | |
| 65 | #include "cpu/m68000/m68000.h" | |
| 64 | 66 | #include "sound/2610intf.h" |
| 65 | 67 | #include "sound/ymf278b.h" |
| 66 | 68 |
| r3957 | r3958 | |
|---|---|---|
| 356 | 356 | #define MASTER_CLOCK XTAL_6MHz |
| 357 | 357 | |
| 358 | 358 | #include "driver.h" |
| 359 | #include "cpu/z80/z80.h" | |
| 359 | 360 | #include "sound/ay8910.h" |
| 360 | 361 | #include "ampoker2.lh" |
| 361 | 362 | #include "sigmapkr.lh" |
| r3957 | r3958 | |
| 1024 | 1025 | MDRV_CPU_PROGRAM_MAP(ampoker2_map, 0) |
| 1025 | 1026 | MDRV_CPU_IO_MAP(ampoker2_io_map, 0) |
| 1026 | 1027 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 1536) |
| 1027 | MDRV_WATCHDOG_TIME_INIT( | |
| 1028 | MDRV_WATCHDOG_TIME_INIT( | |
| 1028 | 1029 | |
| 1029 | 1030 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 1030 | 1031 |
| r3957 | r3958 | |
|---|---|---|
| 32 | 32 | */ |
| 33 | 33 | |
| 34 | 34 | #include "driver.h" |
| 35 | #include "cpu/z80/z80.h" | |
| 36 | #include "cpu/i8085/i8085.h" | |
| 35 | 37 | #include "sound/ay8910.h" |
| 36 | 38 | |
| 37 | 39 | static tilemap *bg_tilemap,*top_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/m68000/m68000.h" | |
| 43 | 44 | #include "machine/eeprom.h" |
| 44 | 45 | #include "cpu/pic16c5x/pic16c5x.h" |
| 45 | 46 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | ******************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/z80/z80.h" | |
| 22 | 23 | #include "sound/dac.h" |
| 23 | 24 | #include "sound/msm5205.h" |
| 24 | 25 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 54 | 55 | tilemap_mark_all_tiles_dirty(bg_tilemap); |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | flip_screen_set(data & 0xc); // probably one bit for flipx and one for flipy | |
| 58 | flip_screen_set(space->machine, data & 0xc); // probably one bit for flipx and one for flipy | |
| 58 | 59 | |
| 59 | 60 | } |
| 60 | 61 | |
| r3957 | r3958 | |
| 316 | 317 | sx = (spriteram[offs+3] - 128) + 256 * (attr & 0x01); |
| 317 | 318 | sy = 248 - spriteram[offs]; |
| 318 | 319 | |
| 319 | if (flip_screen_get()) | |
| 320 | if (flip_screen_get(machine)) | |
| 320 | 321 | { |
| 321 | 322 | sx = 240 - sx; |
| 322 | 323 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | ***************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/z80/z80.h" | |
| 45 | #include "cpu/m68000/m68000.h" | |
| 44 | 46 | #include "deprecat.h" |
| 45 | 47 | #include "machine/eeprom.h" |
| 46 | 48 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | driver by David Haywood,Angelo Salese and Phil Bennett |
| 6 | 6 | |
| 7 | 7 | TODO: |
| 8 | -convert the video hw to true 4bpp; | |
| 9 | -some charset transparency pens are wrong,likely that the buffer trigger isn't correct; | |
| 10 | 8 | -unemulated screen flipping; |
| 11 | -jngolady: if you do a soft reset sometimes the z80<->mcu communication fails,causing a | |
| 12 | black screen after the title screen. | |
| 9 | -jngolady: RNG in this isn't working properly...looking at the code,when the mcu isn't on | |
| 10 | irq routine there's a poll to the [8] ram address,unsurprisingly it's the RNG seed. | |
| 11 | The problem is that when the rti opcode occurs the program flow doesn't return to feed the | |
| 12 | RNG but executes another irq,probably there are too many irq pollings and the mcu goes out | |
| 13 | of cycles...for now I'm kludging it,my guess is that it can be either a cpu bug,a comms bug | |
| 14 | or 8 is really connected to a RNG seed and the starting code is just for initializing it. | |
| 13 | 15 | |
| 14 | 16 | ============================================================================================ |
| 15 | 17 | Debug cheats: |
| 16 | 18 | |
| 19 | *jangou | |
| 17 | 20 | $c132 coin counter |
| 18 | 21 | $c088-$c095 player tiles |
| 19 | 22 | |
| 20 | ============================================================================================ | |
| 21 | ||
| 22 | JANGOU (C)1982 Nichibutsu | |
| 23 | ||
| 24 | CPU: Z80 *2 | |
| 25 | XTAL: 19.968MHz | |
| 26 | SOUND: AY-3-8910 | |
| 27 | ||
| 28 | Location 2-P: HARRIS HCI-55536-5 | |
| 29 | Location 3-G: MB7051 | |
| 30 | ||
| 31 | --- | |
| 32 | ||
| 33 | Jangou Lady | |
| 34 | (c)1984 Nihon Bussan | |
| 35 | ||
| 36 | CPU: Z80 x2 (#1,#2) | |
| 37 | (40pin unknown:#3) | |
| 38 | SOUND: AY-3-8910 | |
| 39 | MSM5218RS | |
| 40 | OSC: 19.968MHz | |
| 41 | 400KHz | |
| 42 | ||
| 43 | ||
| 44 | 1.5N chr. | |
| 45 | 2.5M | |
| 46 | 3.5L | |
| 47 | ||
| 48 | 4.9P Z80#1 prg. | |
| 49 | 5.9N | |
| 50 | 6.9M | |
| 51 | 7.9L | |
| 52 | ||
| 53 | 8.9H Z80#2 prg. | |
| 54 | 9.9G | |
| 55 | 10.9F | |
| 56 | 11.9E | |
| 57 | 12.9D | |
| 58 | ||
| 59 | M13.13 CPU#3 prg. (?) | |
| 60 | ||
| 61 | JL.3G color | |
| 62 | ||
| 63 | 23 | *******************************************************************************************/ |
| 64 | 24 | |
| 65 | 25 | #include "driver.h" |
| 26 | #include "cpu/z80/z80.h" | |
| 27 | #include "cpu/m6800/m6800.h" | |
| 66 | 28 | #include "sound/ay8910.h" |
| 67 | 29 | #include "sound/hc55516.h" |
| 68 | 30 | #include "sound/msm5205.h" |
| r3957 | r3958 | |
| 192 | 154 | int src,x,y,h,w, flipx; |
| 193 | 155 | blit_data[offset] = data; |
| 194 | 156 | |
| 195 | /*trigger blitter write to ram,might not be correct...*/ | |
| 196 | 157 | if(offset == 5) |
| 197 | 158 | { |
| 198 | // | |
| 159 | // | |
| 199 | 160 | w = (blit_data[4] & 0xff)+1; |
| 200 | 161 | h = (blit_data[5] & 0xff)+1; |
| 201 | 162 | src = ((blit_data[1]<<8)|(blit_data[0]<<0)); |
| r3957 | r3958 | |
| 221 | 182 | UINT8 cur_pen_hi = pen_data[(dat & 0xf0)>>4]; |
| 222 | 183 | UINT8 cur_pen_lo = pen_data[(dat & 0x0f)>>0]; |
| 223 | 184 | |
| 224 | /*TODO: simplify this when blitter internal ram is converted to 4bpp*/ | |
| 225 | /*don't use hi & lo user-selected bits*/ | |
| 226 | if((cur_pen_hi & 0x20) && (cur_pen_lo & 0x20)) | |
| 185 | dat = cur_pen_lo | cur_pen_hi<<4; | |
| 186 | ||
| 187 | if((dat & 0xff) != 0) | |
| 227 | 188 | plot_jangou_gfx_pixel(dat, drawx,drawy); |
| 228 | else if(cur_pen_lo & 0x20)//use hi pen user-selected bit | |
| 229 | { | |
| 230 | dat = (pen_data[cur_pen_hi]<<4) | (dat & 0xf); | |
| 231 | plot_jangou_gfx_pixel(dat, drawx,drawy); | |
| 232 | } | |
| 233 | else if(cur_pen_hi & 0x20)//use lo pen user-selected bit | |
| 234 | { | |
| 235 | dat = (pen_data[cur_pen_lo]) | (dat & 0xf0); | |
| 236 | plot_jangou_gfx_pixel(dat, drawx,drawy); | |
| 237 | } | |
| 238 | else //use hi & lo pens user-selected bits | |
| 239 | { | |
| 240 | dat = (pen_data[cur_pen_lo]) | (pen_data[cur_pen_hi]<<4); | |
| 241 | plot_jangou_gfx_pixel(dat, drawx,drawy); | |
| 242 | } | |
| 243 | 189 | |
| 244 | 190 | if (!flipx) count--; |
| 245 | 191 | else count++; |
| r3957 | r3958 | |
| 249 | 195 | } |
| 250 | 196 | } |
| 251 | 197 | |
| 252 | /*Every offset of these registers controls a pen. | |
| 253 | If the bit 6 (0x20) is high,use the pen from the internal gfx rom. | |
| 254 | If the bit 6 is low,use an user-selected pen,defined by this register.*/ | |
| 198 | /* What is the bit 5 (0x20) for?*/ | |
| 255 | 199 | static WRITE8_HANDLER( blit_vregs_w ) |
| 256 | 200 | { |
| 257 | pen_data[offset] = data; | |
| 201 | // printf("%02x %02x\n",offset,data); | |
| 202 | pen_data[offset] = data & 0xf; | |
| 258 | 203 | } |
| 259 | 204 | |
| 260 | ||
| 261 | 205 | /************************************* |
| 262 | 206 | * |
| 263 | 207 | * I/O |
| r3957 | r3958 | |
| 370 | 314 | * |
| 371 | 315 | *************************************/ |
| 372 | 316 | |
| 373 | static UINT8 nsc_latch; | |
| 317 | static UINT8 nsc_latch,z80_latch; | |
| 374 | 318 | |
| 375 | 319 | static READ8_HANDLER( master_com_r ) |
| 376 | 320 | { |
| 377 | return | |
| 321 | return z80_latch; | |
| 378 | 322 | } |
| 379 | 323 | |
| 380 | 324 | static WRITE8_HANDLER( master_com_w ) |
| r3957 | r3958 | |
| 390 | 334 | |
| 391 | 335 | static WRITE8_HANDLER( slave_com_w ) |
| 392 | 336 | { |
| 393 | nsc_latch = data; | |
| 394 | // cpu_set_input_line(space->machine->cpu[0], 0, HOLD_LINE); | |
| 337 | z80_latch = data; | |
| 395 | 338 | } |
| 396 | 339 | |
| 397 | 340 | /************************************* |
| r3957 | r3958 | |
| 465 | 408 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 466 | 409 | ADDRESS_MAP_END |
| 467 | 410 | |
| 411 | /************************************* | |
| 412 | * | |
| 413 | * Country Girl Memory Map | |
| 414 | * | |
| 415 | *************************************/ | |
| 468 | 416 | |
| 417 | static ADDRESS_MAP_START( cntrygrl_cpu0_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 418 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 419 | // AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 420 | AM_RANGE(0xe000, 0xefff) AM_RAM | |
| 421 | ADDRESS_MAP_END | |
| 422 | ||
| 423 | static ADDRESS_MAP_START( cntrygrl_cpu0_io, ADDRESS_SPACE_IO, 8 ) | |
| 424 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 425 | AM_RANGE(0x01,0x01) AM_READ(ay8910_read_port_0_r) | |
| 426 | AM_RANGE(0x02,0x02) AM_WRITE(ay8910_write_port_0_w) | |
| 427 | AM_RANGE(0x03,0x03) AM_WRITE(ay8910_control_port_0_w) | |
| 428 | AM_RANGE(0x10,0x10) AM_READ_PORT("DSW") //dsw + blitter busy flag | |
| 429 | AM_RANGE(0x10,0x10) AM_WRITE(output_w) | |
| 430 | AM_RANGE(0x11,0x11) AM_WRITE(mux_w) | |
| 431 | AM_RANGE(0x12,0x17) AM_WRITE(blitter_process_w) | |
| 432 | AM_RANGE(0x20,0x2f) AM_WRITE(blit_vregs_w ) | |
| 433 | AM_RANGE(0x30,0x30) AM_WRITENOP //? polls 0x03 continously | |
| 434 | // AM_RANGE(0x31,0x31) AM_WRITE(sound_latch_w) | |
| 435 | ADDRESS_MAP_END | |
| 436 | ||
| 469 | 437 | /************************************* |
| 470 | 438 | * |
| 471 | 439 | * Input Port Definitions |
| r3957 | r3958 | |
| 547 | 515 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 548 | 516 | INPUT_PORTS_END |
| 549 | 517 | |
| 518 | static INPUT_PORTS_START( cntrygrl ) | |
| 519 | PORT_START("PL1_1") | |
| 520 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P Keep 1") PORT_CODE(KEYCODE_Z) | |
| 521 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("1P Keep 2") PORT_CODE(KEYCODE_X) | |
| 522 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1P Keep 3") PORT_CODE(KEYCODE_C) | |
| 523 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("1P Keep 4") PORT_CODE(KEYCODE_V) | |
| 524 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("1P Keep 5") PORT_CODE(KEYCODE_B) | |
| 525 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 526 | PORT_START("PL1_2") | |
| 527 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("1P Play") PORT_CODE(KEYCODE_Q) | |
| 528 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 529 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) //probably a button | |
| 530 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) //probably a button | |
| 531 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("1P Flip Flop") | |
| 532 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("1P Bonus") PORT_CODE(KEYCODE_W) | |
| 533 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("1P Take") PORT_CODE(KEYCODE_A) | |
| 534 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 535 | PORT_START("PL2_1") | |
| 536 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("2P Keep 1") | |
| 537 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("2P Keep 2") | |
| 538 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("2P Keep 3") | |
| 539 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("2P Keep 4") | |
| 540 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("2P Keep 5") | |
| 541 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 542 | PORT_START("PL2_2") | |
| 543 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("2P Play") | |
| 544 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 545 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) //probably a button | |
| 546 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )PORT_PLAYER(2) //probably a button | |
| 547 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) PORT_NAME("2P Flip Flop") | |
| 548 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("1P Bonus") | |
| 549 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_PLAYER(2) PORT_NAME("1P Take") | |
| 550 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 551 | PORT_START("PL1_3") | |
| 552 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 553 | PORT_START("PL2_3") | |
| 554 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 555 | PORT_START("SYSTEM") | |
| 556 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) | |
| 557 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 558 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 559 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 560 | PORT_DIPNAME( 0x04, 0x04, "Memory Reset" ) | |
| 561 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 562 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 563 | PORT_DIPNAME( 0x08, 0x08, "Analyzer" ) | |
| 564 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 565 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 566 | PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) | |
| 567 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 568 | PORT_DIPNAME( 0x40, 0x40, "Credit Clear" ) | |
| 569 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 570 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 571 | PORT_DIPNAME( 0x80, 0x00, "Two Pairs" ) PORT_DIPLOCATION("SW1:8") | |
| 572 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 573 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 574 | ||
| 575 | PORT_START("DSW") | |
| 576 | PORT_DIPNAME( 0x03, 0x03, "Maximum Rate") PORT_DIPLOCATION("SW1:1,2") | |
| 577 | PORT_DIPSETTING( 0x00, "90" ) | |
| 578 | PORT_DIPSETTING( 0x01, "83" ) | |
| 579 | PORT_DIPSETTING( 0x02, "76" ) | |
| 580 | PORT_DIPSETTING( 0x03, "69" ) | |
| 581 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") | |
| 582 | PORT_DIPSETTING( 0x00, "3" ) | |
| 583 | PORT_DIPSETTING( 0x04, "2") | |
| 584 | PORT_DIPSETTING( 0x08, "1" ) | |
| 585 | PORT_DIPSETTING( 0x0c, "0" ) | |
| 586 | PORT_DIPNAME( 0x10, 0x10, "Maximum Bet" ) PORT_DIPLOCATION("SW1:5") | |
| 587 | PORT_DIPSETTING( 0x10, "1" ) | |
| 588 | PORT_DIPSETTING( 0x00, "20" ) | |
| 589 | PORT_DIPNAME( 0x20, 0x20, "Coin A setting" ) PORT_DIPLOCATION("SW1:6") | |
| 590 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_1C ) ) | |
| 591 | PORT_DIPSETTING( 0x00, "1 Coin / 25 Credits" ) | |
| 592 | PORT_DIPNAME( 0x40, 0x40, "Coin B setting" ) PORT_DIPLOCATION("SW1:7") | |
| 593 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) | |
| 594 | PORT_DIPSETTING( 0x00, "1 Coin / 10 Credits" ) | |
| 595 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // blitter busy flag | |
| 596 | INPUT_PORTS_END | |
| 597 | ||
| 550 | 598 | static INPUT_PORTS_START( jngolady ) |
| 551 | 599 | PORT_INCLUDE( jangou ) |
| 552 | 600 | |
| r3957 | r3958 | |
| 652 | 700 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 653 | 701 | MACHINE_DRIVER_END |
| 654 | 702 | |
| 703 | static MACHINE_DRIVER_START( cntrygrl ) | |
| 704 | /* basic machine hardware */ | |
| 705 | MDRV_IMPORT_FROM(jangou) | |
| 655 | 706 | |
| 707 | MDRV_CPU_MODIFY("cpu0") | |
| 708 | MDRV_CPU_PROGRAM_MAP(0, cntrygrl_cpu0_map ) | |
| 709 | MDRV_CPU_IO_MAP(0,cntrygrl_cpu0_io ) | |
| 710 | ||
| 711 | MDRV_CPU_REMOVE("cpu1") | |
| 712 | ||
| 713 | /* sound hardware */ | |
| 714 | MDRV_SOUND_START(NULL) | |
| 715 | MDRV_SOUND_REMOVE("cvsd") | |
| 716 | MACHINE_DRIVER_END | |
| 717 | ||
| 718 | /* | |
| 719 | JANGOU (C)1982 Nichibutsu | |
| 720 | ||
| 721 | CPU: Z80 *2 | |
| 722 | XTAL: 19.968MHz | |
| 723 | SOUND: AY-3-8910 | |
| 724 | ||
| 725 | Location 2-P: HARRIS HCI-55536-5 | |
| 726 | Location 3-G: MB7051 | |
| 727 | */ | |
| 728 | ||
| 656 | 729 | ROM_START( jangou ) |
| 657 | 730 | ROM_REGION( 0x10000, "cpu0", 0 ) |
| 658 | 731 | ROM_LOAD( "jg05.bin", 0x00000, 0x02000, CRC(a3cfe33f) SHA1(9ad34a2167568316d242c990ea6fe42dadd4ac30) ) |
| r3957 | r3958 | |
| 672 | 745 | ROM_LOAD( "jg3_g.bin", 0x00, 0x20, CRC(d389549d) SHA1(763486052b34f8a38247820109b114118a9f829f) ) |
| 673 | 746 | ROM_END |
| 674 | 747 | |
| 748 | /* | |
| 749 | Jangou Lady | |
| 750 | (c)1984 Nihon Bussan | |
| 751 | ||
| 752 | CPU: Z80 x2 (#1,#2) | |
| 753 | (40pin unknown:#3) | |
| 754 | SOUND: AY-3-8910 | |
| 755 | MSM5218RS | |
| 756 | OSC: 19.968MHz | |
| 757 | 400KHz | |
| 758 | ||
| 759 | ||
| 760 | 1.5N chr. | |
| 761 | 2.5M | |
| 762 | 3.5L | |
| 763 | ||
| 764 | 4.9P Z80#1 prg. | |
| 765 | 5.9N | |
| 766 | 6.9M | |
| 767 | 7.9L | |
| 768 | ||
| 769 | 8.9H Z80#2 prg. | |
| 770 | 9.9G | |
| 771 | 10.9F | |
| 772 | 11.9E | |
| 773 | 12.9D | |
| 774 | ||
| 775 | M13.13 CPU#3 prg. (?) | |
| 776 | ||
| 777 | JL.3G color | |
| 778 | */ | |
| 779 | ||
| 675 | 780 | ROM_START( jngolady ) |
| 676 | 781 | ROM_REGION( 0xa000, "cpu0", 0 ) |
| 677 | 782 | ROM_LOAD( "8.9h", 0x08000, 0x02000, CRC(69e31165) SHA1(81b166c101136ed453a4f4cd88445eb1da5dd0aa) ) |
| r3957 | r3958 | |
| 698 | 803 | ROM_LOAD( "3.5l", 0x04000, 0x04000, CRC(14688574) SHA1(241eaf1838239e38d11dff3556fb0a609a4b46aa) ) |
| 699 | 804 | ROM_END |
| 700 | 805 | |
| 701 | GAME( 1983, jangou, 0, jangou, jangou, 0, ROT0, "Nichibutsu", "Jangou", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) | |
| 702 | GAME( 1984, jngolady, 0, jngolady, jngolady, 0, ROT0, "Nichibutsu", "Jangou Lady", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) | |
| 806 | ROM_START( cntrygrl ) | |
| 807 | ROM_REGION( 0x10000, "cpu0", 0 ) | |
| 808 | ROM_LOAD( "rom4.bin", 0x00000, 0x02000, CRC(adba8e2f) SHA1(2aae77838e3de6e665b32a7fe4ac3f627c35b871) ) | |
| 809 | ROM_LOAD( "rom5.bin", 0x02000, 0x02000, CRC(24d210ed) SHA1(6a0eae9d459975fbaad75bf21284baac3ba4f872) ) | |
| 810 | ||
| 811 | /*wtf,these 2 roms are next to the CPU roms, one is a CPU rom from Moon Quasar, the other a GFX rom from Crazy Climber, | |
| 812 | I dunno what's going on,game doesn't appear to need these two....*/ | |
| 813 | ROM_REGION( 0x1000, "user1", 0 ) | |
| 814 | ROM_LOAD( "rom6.bin", 0x00000, 0x0800, CRC(33965a89) SHA1(92912cea76a472d9b709c664d9818844a07fcc32) ) // = mq3 Moon Quasar | |
| 815 | ROM_LOAD( "rom7.bin", 0x00800, 0x0800, CRC(481b64cc) SHA1(3f35c545fc784ed4f969aba2d7be6e13a5ae32b7) ) // = cc06 Crazy Climber (US) | |
| 816 | ||
| 817 | ROM_REGION( 0x6000, "gfx", 0 ) | |
| 818 | ROM_LOAD( "rom1.bin", 0x00000, 0x02000, CRC(92033f37) SHA1(aa407c2feb1cbb7cbc6c59656338453c5a670749) ) | |
| 819 | ROM_LOAD( "rom2.bin", 0x02000, 0x02000, CRC(0588cc48) SHA1(f769ece2955eb9f055c499b6243a2fead9d07984) ) | |
| 820 | ROM_LOAD( "rom3.bin", 0x04000, 0x02000, CRC(ce00ff56) SHA1(c5e58707a5dd0f57c34b09de542ef30e96ab95d1) ) | |
| 821 | ||
| 822 | ROM_REGION( 0x20, "proms", 0 ) | |
| 823 | ROM_LOAD( "countrygirl_prom.bin", 0x00, 0x20, CRC(dc54dc52) SHA1(db91a7ae05eb6b6e4b42f91dfe20ac0da6680b46) ) | |
| 824 | ROM_END | |
| 825 | ||
| 826 | /*Temporary kludge for make the RNG work*/ | |
| 827 | static READ8_HANDLER( jngolady_rng_r ) | |
| 828 | { | |
| 829 | return mame_rand(space->machine); | |
| 830 | } | |
| 831 | ||
| 832 | static DRIVER_INIT( jngolady ) | |
| 833 | { | |
| 834 | memory_install_read8_handler(cpu_get_address_space(machine->cpu[2], ADDRESS_SPACE_PROGRAM), 0x08, 0x08, 0, 0, jngolady_rng_r ); | |
| 835 | } | |
| 836 | ||
| 837 | ||
| 838 | ||
| 839 | /* flyer shows a bet version of Jangou Lady too,does it truly exists?*/ | |
| 840 | GAME( 1983, jangou, 0, jangou, jangou, 0, ROT0, "Nichibutsu", "Jangou [BET] (Japan)", GAME_NO_COCKTAIL ) | |
| 841 | /* Jangou Night */ | |
| 842 | GAME( 1984, jngolady, 0, jngolady, jngolady, jngolady, ROT0, "Nichibutsu", "Jangou Lady (Japan)", GAME_NO_COCKTAIL ) | |
| 843 | GAME( 1984, cntrygrl, 0, cntrygrl, cntrygrl, 0, ROT0, "Royal Denshi", "Country Girl (Japan)", GAME_NO_COCKTAIL ) |
| r3957 | r3958 | |
|---|---|---|
| 359 | 359 | */ |
| 360 | 360 | |
| 361 | 361 | #include "driver.h" |
| 362 | #include "cpu/m68000/m68000.h" | |
| 362 | 363 | #include "deprecat.h" |
| 363 | 364 | #include "cpu/powerpc/ppc.h" |
| 364 | 365 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 379 | 380 | static int model3_controls_bank; |
| 380 | 381 | static UINT32 real3d_device_id; |
| 381 | 382 | |
| 382 | static void real3d_dma_callback(UINT32 src, UINT32 dst, int length, int byteswap); | |
| 383 | static void real3d_dma_callback(running_machine *machine, UINT32 src, UINT32 dst, int length, int byteswap); | |
| 383 | 384 | |
| 384 | 385 | static UINT16 *model3_soundram; |
| 385 | 386 | |
| r3957 | r3958 | |
| 765 | 766 | } |
| 766 | 767 | } |
| 767 | 768 | |
| 768 | static UINT32 scsi_fetch(UINT32 dsp) | |
| 769 | static UINT32 scsi_fetch(running_machine *machine, UINT32 dsp) | |
| 769 | 770 | { |
| 770 | const address_space *space = cpu_get_address_space( | |
| 771 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 771 | 772 | UINT32 result; |
| 772 | 773 | result = memory_read_dword(space, dsp); |
| 773 | 774 | return FLIPENDIAN_INT32(result); |
| r3957 | r3958 | |
| 825 | 826 | int length = FLIPENDIAN_INT32((UINT32)(data >> 32)) * 4; |
| 826 | 827 | if (dma_endian & 0x80) |
| 827 | 828 | { |
| 828 | real3d_dma_callback(dma_source, dma_dest, length, 0); | |
| 829 | real3d_dma_callback(space->machine, dma_source, dma_dest, length, 0); | |
| 829 | 830 | } |
| 830 | 831 | else |
| 831 | 832 | { |
| 832 | real3d_dma_callback(dma_source, dma_dest, length, 1); | |
| 833 | real3d_dma_callback(space->machine, dma_source, dma_dest, length, 1); | |
| 833 | 834 | } |
| 834 | 835 | dma_irq |= 0x01; |
| 835 | 836 | scsi_irq_callback(space->machine, 1); |
| r3957 | r3958 | |
| 871 | 872 | fatalerror("real3d_dma_w: %08X, %08X%08X, %08X%08X", offset, (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); |
| 872 | 873 | } |
| 873 | 874 | |
| 874 | static void real3d_dma_callback(UINT32 src, UINT32 dst, int length, int byteswap) | |
| 875 | static void real3d_dma_callback(running_machine *machine, UINT32 src, UINT32 dst, int length, int byteswap) | |
| 875 | 876 | { |
| 876 | const address_space *space = cpu_get_address_space( | |
| 877 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 877 | 878 | switch(dst >> 24) |
| 878 | 879 | { |
| 879 | 880 | case 0x88: /* Display List End Trigger */ |
| r3957 | r3958 | |
| 897 | 898 | case 0x9c: /* Unknown */ |
| 898 | 899 | break; |
| 899 | 900 | default: |
| 900 | fatalerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc( | |
| 901 | fatalerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(machine->cpu[0])); | |
| 901 | 902 | break; |
| 902 | 903 | } |
| 903 | 904 | } |
| r3957 | r3958 | |
| 981 | 982 | static void configure_fast_ram(running_machine *machine) |
| 982 | 983 | { |
| 983 | 984 | /* set conservative DRC options */ |
| 984 | c | |
| 985 | device | |
| 985 | 986 | |
| 986 | 987 | /* configure fast RAM regions for DRC */ |
| 987 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 988 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 989 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x007fffff); | |
| 990 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 991 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 988 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 989 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 990 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x007fffff); | |
| 991 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 992 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 992 | 993 | } |
| 993 | 994 | |
| 994 | 995 | static MACHINE_START(model3_10) |
| 995 | 996 | { |
| 996 | lsi53c810_init(&scsi_intf); | |
| 997 | lsi53c810_init(machine, &scsi_intf); | |
| 997 | 998 | add_exit_callback(machine, model3_exit); |
| 998 | 999 | configure_fast_ram(machine); |
| 999 | 1000 | } |
| 1000 | 1001 | static MACHINE_START(model3_15) |
| 1001 | 1002 | { |
| 1002 | lsi53c810_init(&scsi_intf); | |
| 1003 | lsi53c810_init(machine, &scsi_intf); | |
| 1003 | 1004 | add_exit_callback(machine, model3_exit); |
| 1004 | 1005 | configure_fast_ram(machine); |
| 1005 | 1006 | } |
| r3957 | r3958 | |
| 1022 | 1023 | |
| 1023 | 1024 | // copy the 68k vector table into RAM |
| 1024 | 1025 | memcpy(model3_soundram, memory_region(machine, "audio")+0x80000, 16); |
| 1025 | c | |
| 1026 | device | |
| 1026 | 1027 | |
| 1027 | 1028 | model3_machine_init(step); // step 1.5 |
| 1028 | 1029 | model3_tap_reset(); |
| r3957 | r3958 | |
| 4342 | 4343 | MDRV_CPU_ADD("audio", M68000, 12000000) |
| 4343 | 4344 | MDRV_CPU_PROGRAM_MAP(model3_snd, 0) |
| 4344 | 4345 | |
| 4345 | MDRV_ | |
| 4346 | MDRV_QUANTUM_TIME | |
| 4346 | 4347 | |
| 4347 | 4348 | MDRV_MACHINE_START(model3_10) |
| 4348 | 4349 | MDRV_MACHINE_RESET(model3_10) |
| r3957 | r3958 | |
|---|---|---|
| 289 | 289 | JP3 |
| 290 | 290 | */ |
| 291 | 291 | #include "driver.h" |
| 292 | #include "cpu/m68000/m68000.h" | |
| 293 | #include "cpu/m6805/m6805.h" | |
| 292 | 294 | #include "deprecat.h" |
| 293 | 295 | #include "namcos2.h" |
| 294 | 296 | #include "cpu/m6809/m6809.h" |
| r3957 | r3958 | |
| 557 | 559 | } |
| 558 | 560 | |
| 559 | 561 | static UINT16 |
| 560 | ReadWordFromSlaveInput( | |
| 562 | ReadWordFromSlaveInput( const address_space *space ) | |
| 561 | 563 | { |
| 562 | 564 | UINT16 data = 0; |
| 563 | 565 | if( mpDspState->slaveBytesAvailable>0 ) |
| r3957 | r3958 | |
| 569 | 571 | { |
| 570 | 572 | mpDspState->slaveBytesAdvertised--; |
| 571 | 573 | } |
| 572 | logerror( "%s:-%04x(0x%04x)\n", cpuexec_describe_context( | |
| 574 | logerror( "%s:-%04x(0x%04x)\n", cpuexec_describe_context(space->machine), data, mpDspState->slaveBytesAvailable ); | |
| 573 | 575 | } |
| 574 | 576 | return data; |
| 575 | 577 | } /* ReadWordFromSlaveInput */ |
| r3957 | r3958 | |
| 887 | 889 | |
| 888 | 890 | static READ16_HANDLER(slave_port0_r) |
| 889 | 891 | { |
| 890 | return ReadWordFromSlaveInput(); | |
| 892 | return ReadWordFromSlaveInput(space); | |
| 891 | 893 | } /* slave_port0_r */ |
| 892 | 894 | |
| 893 | 895 | static WRITE16_HANDLER(slave_port0_w) |
| r3957 | r3958 | |
| 1559 | 1561 | MDRV_CPU_DATA_MAP(slave_dsp_data,0) |
| 1560 | 1562 | MDRV_CPU_IO_MAP(slave_dsp_io,0) |
| 1561 | 1563 | |
| 1562 | MDRV_ | |
| 1564 | MDRV_QUANTUM_TIME | |
| 1563 | 1565 | |
| 1564 | 1566 | MDRV_MACHINE_START(namcos2) |
| 1565 | 1567 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
| 1633 | 1635 | MDRV_CPU_DATA_MAP(winrun_dsp_data,0) |
| 1634 | 1636 | MDRV_CPU_IO_MAP(winrun_dsp_io,0) |
| 1635 | 1637 | |
| 1636 | MDRV_ | |
| 1638 | MDRV_QUANTUM_TIME | |
| 1637 | 1639 | |
| 1638 | 1640 | MDRV_MACHINE_START(namcos2) |
| 1639 | 1641 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
| 1692 | 1694 | MDRV_CPU_PROGRAM_MAP(am_gpu_winrun,0) |
| 1693 | 1695 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_gpu_vblank) |
| 1694 | 1696 | |
| 1695 | MDRV_ | |
| 1697 | MDRV_QUANTUM_TIME | |
| 1696 | 1698 | |
| 1697 | 1699 | MDRV_MACHINE_START(namcos2) |
| 1698 | 1700 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
|---|---|---|
| 281 | 281 | #define PGMARM7SPEEDHACK 1 |
| 282 | 282 | |
| 283 | 283 | #include "driver.h" |
| 284 | #include "cpu/z80/z80.h" | |
| 285 | #include "cpu/m68000/m68000.h" | |
| 286 | #include "cpu/arm7/arm7.h" | |
| 284 | 287 | #include "deprecat.h" |
| 285 | 288 | #include "sound/ics2115.h" |
| 286 | 289 | #include "cpu/arm7/arm7core.h" |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/z80/z80.h" | |
| 54 | #include "cpu/z180/z180.h" | |
| 53 | 55 | #include "deprecat.h" |
| 54 | 56 | #include "machine/8255ppi.h" |
| 55 | 57 | #include "iqblock.h" |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | ****************************************************************************/ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/m6502/m6502.h" | |
| 67 | 68 | #include "machine/6532riot.h" |
| 68 | 69 | #include "machine/6522via.h" |
| 69 | 70 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | *****************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "deprecat.h" |
| 13 | 14 | #include "sound/sn76496.h" |
| 14 | 15 | |
| r3957 | r3958 | |
| 201 | 202 | MDRV_CPU_PROGRAM_MAP(ikki_cpu2,0) |
| 202 | 203 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) |
| 203 | 204 | |
| 204 | MDRV_ | |
| 205 | MDRV_QUANTUM_TIME | |
| 205 | 206 | |
| 206 | 207 | /* video hardware */ |
| 207 | 208 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 127 | 127 | ***************************************************************************/ |
| 128 | 128 | |
| 129 | 129 | #include "driver.h" |
| 130 | #include "cpu/m68000/m68000.h" | |
| 130 | 131 | #include "video/taitoic.h" |
| 131 | 132 | #include "cpu/z80/z80.h" |
| 132 | 133 | #include "audio/taitosnd.h" |
| r3957 | r3958 | |
| 845 | 846 | MDRV_CPU_PROGRAM_MAP(darius_sound2_readmem,darius_sound2_writemem) |
| 846 | 847 | MDRV_CPU_IO_MAP(darius_sound2_io_map,0) |
| 847 | 848 | |
| 848 | MDRV_ | |
| 849 | MDRV_QUANTUM_TIME | |
| 849 | 850 | |
| 850 | 851 | MDRV_MACHINE_START(darius) |
| 851 | 852 | MDRV_MACHINE_RESET(darius) |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/z80/z80.h" | |
| 25 | 26 | #include "sound/ay8910.h" |
| 26 | 27 | #include "video/mc6845.h" |
| 27 | 28 | |
| r3957 | r3958 | |
| 86 | 87 | static const mc6845_interface mc6845_intf = |
| 87 | 88 | { |
| 88 | 89 | "main", |
| 89 | 1000000, /* ? MHz */ | |
| 90 | 90 | 8, |
| 91 | 91 | NULL, |
| 92 | 92 | update_row, |
| r3957 | r3958 | |
| 271 | 271 | MDRV_VIDEO_START(ssingles) |
| 272 | 272 | MDRV_VIDEO_UPDATE(ssingles) |
| 273 | 273 | |
| 274 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 275 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 274 | MDRV_MC6845_ADD("crtc", MC6845, 1000000 /* ? MHz */, mc6845_intf) | |
| 276 | 275 | |
| 277 | 276 | /* sound hardware */ |
| 278 | 277 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /* set the fastest DRC options */ |
| 193 | c | |
| 193 | device | |
| 194 | 194 | |
| 195 | 195 | /* configure fast RAM regions for DRC */ |
| 196 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 197 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x08000000); | |
| 198 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x087fffff); | |
| 199 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase2); | |
| 200 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 196 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 197 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x08000000); | |
| 198 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x087fffff); | |
| 199 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase2); | |
| 200 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 201 | 201 | |
| 202 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 203 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 204 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x0007ffff); | |
| 205 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); | |
| 206 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 202 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 203 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 204 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x0007ffff); | |
| 205 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); | |
| 206 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 207 | 207 | |
| 208 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); | |
| 209 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 210 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 211 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 212 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 208 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); | |
| 209 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 210 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 211 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 212 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/z80/z80.h" | |
| 16 | 17 | #include "includes/cps1.h" |
| 17 | 18 | #include "machine/eeprom.h" |
| 18 | 19 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/v810/v810.h" | |
| 11 | 12 | #include "deprecat.h" |
| 12 | 13 | #include "cpu/z80/z80.h" |
| 13 | 14 | #include "sound/st0016.h" |
| r3957 | r3958 | |
| 452 | 453 | MDRV_CPU_IO_MAP(st0016_m2_io,0) |
| 453 | 454 | MDRV_CPU_ADD("sub", V810, 10000000)//25 Mhz ? |
| 454 | 455 | MDRV_CPU_PROGRAM_MAP(v810_mem,0) |
| 455 | MDRV_ | |
| 456 | MDRV_QUANTUM_TIME | |
| 456 | 457 | MACHINE_DRIVER_END |
| 457 | 458 | |
| 458 | 459 | /************************************* |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/z80/z80.h" | |
| 17 | #include "cpu/m68000/m68000.h" | |
| 16 | 18 | #include "video/vector.h" |
| 17 | 19 | #include "machine/6840ptm.h" |
| 18 | 20 | #include "machine/z80ctc.h" |
| r3957 | r3958 | |
| 161 | 163 | MDRV_CPU_PROGRAM_MAP(sound_memmap,0) |
| 162 | 164 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 163 | 165 | |
| 164 | MDRV_Z80CTC_ADD("ctc", cchasm_ctc_intf) | |
| 166 | MDRV_Z80CTC_ADD("ctc", 3584229 /* same as "audio" */, cchasm_ctc_intf) | |
| 165 | 167 | |
| 166 | 168 | MDRV_MACHINE_START(cchasm) |
| 167 | 169 |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | ***************************************************************************/ |
| 40 | 40 | |
| 41 | 41 | #include "driver.h" |
| 42 | #include "cpu/z80/z80.h" | |
| 42 | 43 | #include "machine/konami1.h" |
| 43 | 44 | #include "cpu/m6809/m6809.h" |
| 44 | 45 | #include "sound/vlm5030.h" |
| r3957 | r3958 | |
|---|---|---|
| 285 | 285 | */ |
| 286 | 286 | |
| 287 | 287 | #include "driver.h" |
| 288 | #include "cpu/i86/i86.h" | |
| 288 | 289 | #include "sound/ay8910.h" |
| 289 | 290 | #include "machine/8255ppi.h" |
| 290 | 291 |
| r3957 | r3958 | |
|---|---|---|
| 88 | 88 | ***************************************************************************/ |
| 89 | 89 | |
| 90 | 90 | #include "driver.h" |
| 91 | #include "cpu/m68000/m68000.h" | |
| 91 | 92 | #include "cpu/h6280/h6280.h" |
| 92 | 93 | #include "sound/2151intf.h" |
| 93 | 94 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/z80/z80.h" | |
| 24 | 25 | #include "sound/ay8910.h" |
| 25 | 26 | |
| 26 | 27 | static UINT8 *skyarmy_videoram; |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | */ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/z80/z80.h" | |
| 67 | 68 | #include "deprecat.h" |
| 68 | 69 | #include "sound/ay8910.h" |
| 69 | 70 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 249 | 250 | MDRV_CPU_PROGRAM_MAP(soundcpu_map,0) |
| 250 | 251 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) |
| 251 | 252 | |
| 252 | MDRV_ | |
| 253 | MDRV_QUANTUM_TIME | |
| 253 | 254 | |
| 254 | 255 | /* video hardware */ |
| 255 | 256 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 222 | 222 | ***************************************************************************/ |
| 223 | 223 | |
| 224 | 224 | #include "driver.h" |
| 225 | #include "cpu/m6805/m6805.h" | |
| 225 | 226 | #include "rendlay.h" |
| 226 | 227 | #include "machine/6821pia.h" |
| 227 | 228 | #include "qix.h" |
| r3957 | r3958 | |
| 559 | 560 | |
| 560 | 561 | /* high interleave needed to ensure correct text in service mode */ |
| 561 | 562 | /* Zookeeper settings and high score table seem especially sensitive to this */ |
| 562 | MDRV_ | |
| 563 | MDRV_QUANTUM_TIME | |
| 563 | 564 | |
| 564 | 565 | MDRV_MACHINE_START(qix) |
| 565 | 566 | MDRV_MACHINE_RESET(qix) |
| r3957 | r3958 | |
| 603 | 604 | /* basic machine hardware */ |
| 604 | 605 | MDRV_IMPORT_FROM(qix) |
| 605 | 606 | |
| 606 | MDRV_CPU_REPLACE("main", M6809, SLITHER_CLOCK_OSC/4/4) /* 1.34 MHz */ | |
| 607 | MDRV_CPU_MODIFY("main") | |
| 608 | MDRV_CPU_CLOCK(SLITHER_CLOCK_OSC/4/4) /* 1.34 MHz */ | |
| 607 | 609 | |
| 608 | 610 | MDRV_MACHINE_START(slither) |
| 609 | 611 |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/z80/z80.h" | |
| 18 | 19 | #include "sound/2203intf.h" |
| 19 | 20 | |
| 20 | 21 | static tilemap *suprgolf_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | ***************************************************************************/ |
| 63 | 63 | |
| 64 | 64 | #include "driver.h" |
| 65 | #include "cpu/m68000/m68000.h" | |
| 65 | 66 | #include "deprecat.h" |
| 66 | 67 | #include "video/konamiic.h" |
| 67 | 68 | #include "cpu/z80/z80.h" |
| r3957 | r3958 | |
| 463 | 464 | MDRV_CPU_ADD("audio", Z80, 8000000) |
| 464 | 465 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 465 | 466 | |
| 466 | MDRV_ | |
| 467 | MDRV_QUANTUM_TIME | |
| 467 | 468 | |
| 468 | 469 | MDRV_MACHINE_START(xexex) |
| 469 | 470 | MDRV_MACHINE_RESET(xexex) |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | ****************************************************************************/ |
| 49 | 49 | |
| 50 | 50 | #include "driver.h" |
| 51 | #include "cpu/z80/z80.h" | |
| 51 | 52 | #include "video/resnet.h" |
| 52 | 53 | #include "sound/ay8910.h" |
| 53 | 54 |
| r3957 | r3958 | |
|---|---|---|
| 95 | 95 | */ |
| 96 | 96 | |
| 97 | 97 | #include "driver.h" |
| 98 | #include "cpu/z80/z80.h" | |
| 98 | 99 | |
| 99 | 100 | static bitmap_t *tile, *obj1, *obj2; |
| 100 | 101 | static tilemap *tx_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "deprecat.h" |
| 11 | 12 | #include "cpu/m6809/m6809.h" |
| 12 | 13 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/z80/z80.h" | |
| 44 | 45 | #include "deprecat.h" |
| 45 | 46 | #include "sound/ay8910.h" |
| 46 | 47 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "skullxbo.h" |
| r3957 | r3958 | |
|---|---|---|
| 144 | 144 | */ |
| 145 | 145 | |
| 146 | 146 | #include "driver.h" |
| 147 | #include "cpu/m68000/m68000.h" | |
| 147 | 148 | #include "sound/ay8910.h" |
| 148 | 149 | #include "video/hd63484.h" |
| 149 | 150 | #include "machine/microtch.h" |
| r3957 | r3958 | |
| 174 | 175 | } |
| 175 | 176 | }; |
| 176 | 177 | |
| 177 | static void microtouch_tx(UINT8 data) | |
| 178 | static void microtouch_tx(running_machine *machine, UINT8 data) | |
| 178 | 179 | { |
| 179 | 180 | duart68681_rx_data(skattv_devices.duart68681, 0, data); |
| 180 | 181 | } |
| r3957 | r3958 | |
| 196 | 197 | |
| 197 | 198 | static const duart68681_config skattv_duart68681_config = |
| 198 | 199 | { |
| 199 | XTAL_8_664MHz / 2, //?? | |
| 200 | 200 | duart_irq_handler, |
| 201 | 201 | duart_tx, |
| 202 | 202 | duart_input, |
| r3957 | r3958 | |
| 535 | 535 | MDRV_MACHINE_START(skattv) |
| 536 | 536 | MDRV_MACHINE_RESET(skattv) |
| 537 | 537 | |
| 538 | MDRV_DEVICE_ADD( "duart68681", DUART68681 ) | |
| 539 | MDRV_DEVICE_CONFIG( skattv_duart68681_config ) | |
| 538 | MDRV_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) | |
| 540 | 539 | |
| 541 | 540 | MDRV_SCREEN_ADD("main", RASTER) |
| 542 | 541 | MDRV_SCREEN_REFRESH_RATE(30) |
| r3957 | r3958 | |
| 564 | 563 | MDRV_MACHINE_START(skattv) |
| 565 | 564 | MDRV_MACHINE_RESET(skattv) |
| 566 | 565 | |
| 567 | MDRV_DEVICE_ADD( "duart68681", DUART68681 ) | |
| 568 | MDRV_DEVICE_CONFIG( skattv_duart68681_config ) | |
| 566 | MDRV_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) | |
| 569 | 567 | |
| 570 | 568 | MDRV_SCREEN_ADD("main", RASTER) |
| 571 | 569 | MDRV_SCREEN_REFRESH_RATE(30) |
| r3957 | r3958 | |
|---|---|---|
| 65 | 65 | */ |
| 66 | 66 | |
| 67 | 67 | #include "driver.h" |
| 68 | #include "cpu/m68000/m68000.h" | |
| 68 | 69 | #include "deprecat.h" |
| 69 | 70 | #include "sound/okim6295.h" |
| 70 | 71 | #include "cpu/mcs51/mcs51.h" |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | */ |
| 47 | 47 | |
| 48 | 48 | #include "driver.h" |
| 49 | #include "cpu/m68000/m68000.h" | |
| 49 | 50 | #include "cpu/mips/psx.h" |
| 50 | 51 | #include "includes/psx.h" |
| 51 | 52 | #include "machine/konamigx.h" |
| r3957 | r3958 | |
| 278 | 279 | |
| 279 | 280 | static UINT8 sector_buffer[ 512 ]; |
| 280 | 281 | |
| 281 | static void scsi_dma_read( UINT32 n_address, INT32 n_size ) | |
| 282 | static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 282 | 283 | { |
| 283 | 284 | int i; |
| 284 | 285 | int n_this; |
| r3957 | r3958 | |
| 311 | 312 | } |
| 312 | 313 | } |
| 313 | 314 | |
| 314 | static void scsi_dma_write( UINT32 n_address, INT32 n_size ) | |
| 315 | static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 315 | 316 | { |
| 316 | 317 | } |
| 317 | 318 |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | ***************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/z80/z80.h" | |
| 32 | 33 | #include "machine/8255ppi.h" |
| 33 | 34 | #include "sound/ay8910.h" |
| 34 | 35 | #include "epos.h" |
| r3957 | r3958 | |
|---|---|---|
| 278 | 278 | MDRV_CPU_IO_MAP(inout_io_map,0) |
| 279 | 279 | MDRV_CPU_VBLANK_INT_HACK(mrflea_io_interrupt,2) |
| 280 | 280 | |
| 281 | MDRV_ | |
| 281 | MDRV_QUANTUM_TIME | |
| 282 | 282 | |
| 283 | 283 | /* video hardware */ |
| 284 | 284 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 725 | 725 | int i; |
| 726 | 726 | |
| 727 | 727 | // set strict verify |
| 728 | c | |
| 728 | device | |
| 729 | 729 | |
| 730 | 730 | cps3_key1 = -1; |
| 731 | 731 | cps3_key2 = -1; |
| r3957 | r3958 | |
|---|---|---|
| 496 | 496 | static const mc6845_interface mc6845_intf = |
| 497 | 497 | { |
| 498 | 498 | "main", /* screen we are acting on */ |
| 499 | CRTC_CLOCK, /* the clock (pin 21) of the chip */ | |
| 500 | 499 | 8, /* number of pixels per video memory address */ |
| 501 | 500 | begin_update, /* before pixel update callback */ |
| 502 | 501 | update_row, /* row update callback */ |
| r3957 | r3958 | |
| 705 | 704 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 706 | 705 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */ |
| 707 | 706 | |
| 708 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 709 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 707 | MDRV_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) | |
| 710 | 708 | |
| 711 | 709 | /* 74LS123 */ |
| 712 | 710 | |
| 713 | MDRV_DEVICE_ADD("ic60", TTL74123) | |
| 714 | MDRV_DEVICE_CONFIG(ic60_intf) | |
| 711 | MDRV_TTL74123_ADD("ic60", ic60_intf) | |
| 715 | 712 | |
| 716 | 713 | /* audio hardware */ |
| 717 | 714 | MDRV_IMPORT_FROM(spiders_audio) |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | ***************************************************************************/ |
| 82 | 82 | #include "driver.h" |
| 83 | #include "cpu/spc700/spc700.h" | |
| 84 | #include "cpu/g65816/g65816.h" | |
| 83 | 85 | #include "includes/snes.h" |
| 84 | 86 | |
| 85 | 87 | static INT8 *shared_ram; |
| r3957 | r3958 | |
| 551 | 553 | MDRV_CPU_ADD("sound", SPC700, 2048000/2) /* 2.048 Mhz, but internal divider */ |
| 552 | 554 | MDRV_CPU_PROGRAM_MAP(spc_mem, 0) |
| 553 | 555 | |
| 554 | MDRV_ | |
| 556 | MDRV_QUANTUM_TIME | |
| 555 | 557 | |
| 556 | 558 | MDRV_MACHINE_START( snes ) |
| 557 | 559 | MDRV_MACHINE_RESET( snes ) |
| r3957 | r3958 | |
|---|---|---|
| 136 | 136 | ******************************************************************************/ |
| 137 | 137 | |
| 138 | 138 | #include "driver.h" |
| 139 | #include "cpu/z80/z80.h" | |
| 140 | #include "cpu/m68000/m68000.h" | |
| 139 | 141 | #include "sound/2610intf.h" |
| 140 | 142 | #include "includes/mcatadv.h" |
| 141 | 143 | |
| r3957 | r3958 | |
| 490 | 492 | MDRV_GFXDECODE(mcatadv) |
| 491 | 493 | MDRV_PALETTE_LENGTH(0x2000/2) |
| 492 | 494 | |
| 493 | MDRV_WATCHDOG_TIME_INIT( | |
| 495 | MDRV_WATCHDOG_TIME_INIT( | |
| 494 | 496 | |
| 495 | 497 | MDRV_VIDEO_START(mcatadv) |
| 496 | 498 | MDRV_VIDEO_EOF(mcatadv) // Buffer Spriteram |
| r3957 | r3958 | |
|---|---|---|
| 243 | 243 | |
| 244 | 244 | |
| 245 | 245 | #include "driver.h" |
| 246 | #include "cpu/z180/z180.h" | |
| 247 | #include "cpu/nec/nec.h" | |
| 246 | 248 | #include "cpu/m68000/m68000.h" |
| 247 | 249 | #include "cpu/z80/z80.h" |
| 248 | 250 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 308 | 310 | This is important for games with common RAM; the RAM test will fail |
| 309 | 311 | when leaving service mode if the sound CPU is not reset. |
| 310 | 312 | */ |
| 311 | c | |
| 313 | device | |
| 312 | 314 | } |
| 313 | 315 | |
| 314 | 316 | static MACHINE_RESET( ghox ) |
| r3957 | r3958 | |
| 3582 | 3584 | MDRV_CPU_ADD("audio", Z80,XTAL_27MHz/8) /* verified on pcb */ |
| 3583 | 3585 | MDRV_CPU_PROGRAM_MAP(sound_z80_mem, 0) |
| 3584 | 3586 | |
| 3585 | MDRV_ | |
| 3587 | MDRV_QUANTUM_TIME | |
| 3586 | 3588 | |
| 3587 | 3589 | MDRV_MACHINE_RESET(toaplan2) |
| 3588 | 3590 | |
| r3957 | r3958 | |
| 3622 | 3624 | /* Change this to 10MHz when HD647180 gets dumped. 10MHz Oscillator */ |
| 3623 | 3625 | MDRV_CPU_PROGRAM_MAP(sound_z80_mem, 0) |
| 3624 | 3626 | |
| 3625 | MDRV_ | |
| 3627 | MDRV_QUANTUM_TIME | |
| 3626 | 3628 | |
| 3627 | 3629 | MDRV_MACHINE_RESET(toaplan2) |
| 3628 | 3630 | |
| r3957 | r3958 | |
| 3661 | 3663 | MDRV_CPU_ADD("audio", Z80, XTAL_27MHz/8) /* ??? 3.37MHz */ |
| 3662 | 3664 | MDRV_CPU_PROGRAM_MAP(sound_z80_mem, 0) |
| 3663 | 3665 | |
| 3664 | MDRV_ | |
| 3666 | MDRV_QUANTUM_TIME | |
| 3665 | 3667 | |
| 3666 | 3668 | MDRV_MACHINE_RESET(toaplan2) |
| 3667 | 3669 | |
| r3957 | r3958 | |
| 3914 | 3916 | MDRV_CPU_ADD("audio", Z80, XTAL_32MHz/8) /* 4MHz , 32MHz Oscillator */ |
| 3915 | 3917 | MDRV_CPU_PROGRAM_MAP(raizing_sound_z80_mem, 0) |
| 3916 | 3918 | |
| 3917 | MDRV_ | |
| 3919 | MDRV_QUANTUM_TIME | |
| 3918 | 3920 | |
| 3919 | 3921 | MDRV_MACHINE_RESET(toaplan2) |
| 3920 | 3922 | |
| r3957 | r3958 | |
| 3956 | 3958 | MDRV_CPU_ADD("audio", Z80, XTAL_32MHz/8) /* 4MHz , 32MHz Oscillator */ |
| 3957 | 3959 | MDRV_CPU_PROGRAM_MAP(raizing_sound_z80_mem, 0) |
| 3958 | 3960 | |
| 3959 | MDRV_ | |
| 3961 | MDRV_QUANTUM_TIME | |
| 3960 | 3962 | |
| 3961 | 3963 | MDRV_MACHINE_RESET(toaplan2) |
| 3962 | 3964 | |
| r3957 | r3958 | |
| 3998 | 4000 | MDRV_CPU_ADD("audio", Z80, XTAL_32MHz/8) /* 4MHz , 32MHz Oscillator */ |
| 3999 | 4001 | MDRV_CPU_PROGRAM_MAP(bgaregga_sound_z80_mem, 0) |
| 4000 | 4002 | |
| 4001 | MDRV_ | |
| 4003 | MDRV_QUANTUM_TIME | |
| 4002 | 4004 | |
| 4003 | 4005 | MDRV_MACHINE_RESET(bgaregga) |
| 4004 | 4006 | |
| r3957 | r3958 | |
| 4041 | 4043 | MDRV_CPU_PROGRAM_MAP(batrider_sound_z80_mem, 0) |
| 4042 | 4044 | MDRV_CPU_IO_MAP(batrider_sound_z80_port, 0) |
| 4043 | 4045 | |
| 4044 | MDRV_ | |
| 4046 | MDRV_QUANTUM_TIME | |
| 4045 | 4047 | |
| 4046 | 4048 | MDRV_MACHINE_RESET(bgaregga) |
| 4047 | 4049 | |
| r3957 | r3958 | |
| 4087 | 4089 | MDRV_CPU_IO_MAP(bbakraid_sound_z80_port, 0) |
| 4088 | 4090 | MDRV_CPU_PERIODIC_INT(bbakraid_snd_interrupt, 448) |
| 4089 | 4091 | |
| 4090 | MDRV_ | |
| 4092 | MDRV_QUANTUM_TIME | |
| 4091 | 4093 | |
| 4092 | 4094 | MDRV_MACHINE_RESET(toaplan2) |
| 4093 | 4095 | MDRV_NVRAM_HANDLER(bbakraid) |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/z80/z80.h" | |
| 25 | 26 | #include "streams.h" |
| 26 | 27 | #include "sound/sn76496.h" |
| 27 | 28 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
| 46 | 47 | UINT8 *base; |
| 47 | 48 | } mjkjidai_adpcm; |
| 48 | 49 | |
| 49 | static | |
| 50 | static STREAM_UPDATE( mjkjidai_adpcm_callback | |
| 50 | 51 | { |
| 51 | 52 | struct mjkjidai_adpcm_state *state = param; |
| 52 | 53 | stream_sample_t *dest = outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 168 | 168 | */ |
| 169 | 169 | |
| 170 | 170 | #include "driver.h" |
| 171 | #include "cpu/m68000/m68000.h" | |
| 171 | 172 | #include "deprecat.h" |
| 172 | 173 | #include "sound/ymz280b.h" |
| 173 | 174 | #include "includes/suprnova.h" |
| r3957 | r3958 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | nmi_enable = data & 0x01; |
| 63 | 63 | irq_enable = data & 0x02; |
| 64 | flip_screen_set(data & 0x08); | |
| 64 | flip_screen_set(space->machine, data & 0x08); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static INTERRUPT_GEN( jb_interrupt ) |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | #include "driver.h" |
| 7 | #include "cpu/z80/z80.h" | |
| 8 | #include "cpu/m68000/m68000.h" | |
| 7 | 9 | #include "deprecat.h" |
| 8 | 10 | #include "audio/taitosnd.h" |
| 9 | 11 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 231 | 231 | MDRV_CPU_ADD("audio", M6809, 8867000/4) /* 68B09, 2.21675 MHz? */ |
| 232 | 232 | MDRV_CPU_PROGRAM_MAP(bigkarnk_readmem_snd,bigkarnk_writemem_snd) |
| 233 | 233 | |
| 234 | MDRV_ | |
| 234 | MDRV_QUANTUM_TIME | |
| 235 | 235 | |
| 236 | 236 | /* video hardware */ |
| 237 | 237 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 624 | 624 | MDRV_CPU_PROGRAM_MAP(squash_readmem,squash_writemem) |
| 625 | 625 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold) |
| 626 | 626 | |
| 627 | MDRV_ | |
| 627 | MDRV_QUANTUM_TIME | |
| 628 | 628 | |
| 629 | 629 | /* video hardware */ |
| 630 | 630 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 775 | 775 | MDRV_CPU_PROGRAM_MAP(squash_readmem,thoop_writemem) |
| 776 | 776 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold) |
| 777 | 777 | |
| 778 | MDRV_ | |
| 778 | MDRV_QUANTUM_TIME | |
| 779 | 779 | |
| 780 | 780 | /* video hardware */ |
| 781 | 781 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | #include "driver.h" |
| 99 | #include "cpu/z80/z80.h" | |
| 99 | 100 | #include "sound/sn76496.h" |
| 100 | 101 | |
| 101 | 102 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/z80/z80.h" | |
| 20 | 21 | #include "sound/ay8910.h" |
| 21 | 22 | |
| 22 | 23 | |
| r3957 | r3958 | |
| 350 | 351 | MDRV_CPU_PROGRAM_MAP(map_cpu2,0) |
| 351 | 352 | MDRV_CPU_IO_MAP(port_map_cpu2,0) |
| 352 | 353 | |
| 353 | MDRV_ | |
| 354 | MDRV_QUANTUM_TIME | |
| 354 | 355 | |
| 355 | 356 | MDRV_MACHINE_RESET( tankbust ) |
| 356 | 357 |
| r3957 | r3958 | |
|---|---|---|
| 270 | 270 | ***************************************************************************/ |
| 271 | 271 | |
| 272 | 272 | #include "driver.h" |
| 273 | #include "cpu/z80/z80.h" | |
| 274 | #include "cpu/m68000/m68000.h" | |
| 273 | 275 | #include "deprecat.h" |
| 274 | 276 | #include "video/konamiic.h" |
| 275 | 277 | #include "cpu/m6809/m6809.h" |
| r3957 | r3958 | |
| 1089 | 1091 | MDRV_CPU_ADD("audio", Z80, 3579545) |
| 1090 | 1092 | MDRV_CPU_PROGRAM_MAP(wecleman_sound_map,0) |
| 1091 | 1093 | |
| 1092 | MDRV_ | |
| 1094 | MDRV_QUANTUM_TIME | |
| 1093 | 1095 | |
| 1094 | 1096 | MDRV_MACHINE_RESET(wecleman) |
| 1095 | 1097 | |
| r3957 | r3958 | |
| 1146 | 1148 | |
| 1147 | 1149 | /* Amuse: every 2 ms */ |
| 1148 | 1150 | |
| 1149 | MDRV_ | |
| 1151 | MDRV_QUANTUM_TIME | |
| 1150 | 1152 | |
| 1151 | 1153 | /* video hardware */ |
| 1152 | 1154 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/z80/z80.h" | |
| 18 | 19 | #include "crbaloon.h" |
| 19 | 20 | |
| 20 | 21 | |
| r3957 | r3958 | |
| 53 | 54 | } |
| 54 | 55 | |
| 55 | 56 | |
| 56 | static void pc3092_update( | |
| 57 | static void pc3092_update(running_machine *machine) | |
| 57 | 58 | { |
| 58 | flip_screen_set((pc3092_data[1] & 0x01) ? TRUE : FALSE); | |
| 59 | flip_screen_set(machine, (pc3092_data[1] & 0x01) ? TRUE : FALSE); | |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | 62 | |
| r3957 | r3958 | |
| 65 | 66 | |
| 66 | 67 | if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", cpu_get_pc(space->cpu), offset, pc3092_data[offset]); |
| 67 | 68 | |
| 68 | pc3092_update(); | |
| 69 | pc3092_update(space->machine); | |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | 72 | |
| r3957 | r3958 | |
| 159 | 160 | static WRITE8_HANDLER( port_sound_w ) |
| 160 | 161 | { |
| 161 | 162 | /* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */ |
| 162 | cpu_interrupt_enable(0, (data & 0x01) ? TRUE : FALSE); | |
| 163 | cpu_interrupt_enable(space->machine->cpu[0], (data & 0x01) ? TRUE : FALSE); | |
| 163 | 164 | crbaloon_set_clear_collision_address((data & 0x01) ? TRUE : FALSE); |
| 164 | 165 | |
| 165 | 166 | /* D1 - SOUND STOP */ |
| r3957 | r3958 | |
|---|---|---|
| 2 | 2 | G4001 |
| 3 | 3 | Diamond Derby - Electrocoin on an SNK board |
| 4 | 4 | |
| 5 | ||
| 5 | SWP | |
| 6 | 6 | |
| 7 | SNK/Electrocoin 1987 | |
| 7 | SNK/Electrocoin 1986 | |
| 8 | Re-released in 1994 (see dderbya) for changed uk gaming rules. | |
| 8 | 9 | |
| 9 | 10 | -------------------------------------------- |
| 10 | 11 | G4001UP01 |
| r3957 | r3958 | |
| 33 | 34 | 2114 H10 |
| 34 | 35 | |
| 35 | 36 | |
| 37 | Driver Improvements by Mike Green | |
| 38 | ||
| 36 | 39 | */ |
| 37 | 40 | |
| 38 | 41 | #include "driver.h" |
| 42 | #include "cpu/z80/z80.h" | |
| 43 | #include "sound/ay8910.h" | |
| 44 | #include "video/resnet.h" | |
| 39 | 45 | |
| 40 | static UINT8* dderby_vid; | |
| 46 | static UINT8* dderby_vidchars; | |
| 47 | static UINT8* dderby_soundmem; | |
| 48 | static UINT8* scroll_ram; | |
| 49 | static UINT8* dderby_vidattribs; | |
| 50 | static UINT8* sprite_ram; | |
| 51 | static UINT8 *nvram; | |
| 52 | static UINT8 *main_rom; | |
| 53 | static UINT8 *main_ram; | |
| 54 | static size_t nvram_size; | |
| 55 | static UINT8 *racetrack_tilemap_rom; | |
| 56 | static tilemap *racetrack_tilemap; | |
| 41 | 57 | |
| 42 | static R | |
| 58 | static NVR | |
| 43 | 59 | { |
| 44 | return mame_rand(space->machine); | |
| 60 | if (read_or_write) | |
| 61 | mame_fwrite(file,nvram,nvram_size); | |
| 62 | else if (file) | |
| 63 | mame_fread(file,nvram,nvram_size); | |
| 45 | 64 | } |
| 46 | 65 | |
| 66 | static WRITE8_HANDLER( dderby_sound_w ) | |
| 67 | { | |
| 68 | static UINT8 last=0; | |
| 69 | if(data!=last) | |
| 70 | soundlatch_w(space,0,data); | |
| 71 | ||
| 72 | last=data; | |
| 73 | } | |
| 74 | ||
| 75 | ||
| 47 | 76 | static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 ) |
| 48 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 49 | AM_RANGE(0x8000, 0x8fff) AM_RAM | |
| 50 | AM_RANGE(0xC000, 0xC007) AM_READ(dderby_random_reader) | |
| 51 | AM_RANGE(0xC802, 0xC802) AM_READ(dderby_random_reader) | |
| 52 | AM_RANGE(0xC803, 0xC803) AM_READ(dderby_random_reader) | |
| 53 | AM_RANGE(0xCA01, 0xCA01) AM_WRITE(SMH_NOP) | |
| 54 | AM_RANGE(0xD000, 0xD7ff) AM_RAM AM_BASE(&dderby_vid) | |
| 77 | AM_RANGE(0x0000, 0x5fff) AM_ROM AM_BASE(&main_rom) | |
| 78 | // AM_RANGE(0x6000,0x67ff) AM_RAM AM_SHARE(1) | |
| 79 | // AM_RANGE(0x8810, 0x8810) AM_WRITE(SMH_NOP) // sound hook? | |
| 80 | // AM_RANGE(0x8810, 0x8810) AM_READ(dderby_ff) | |
| 81 | AM_RANGE(0x8811, 0x8811) AM_READ_PORT("IN2") // ??? doubt if this is dip 2. | |
| 82 | // AM_RANGE(0x8bab, 0x8bab) AM_READ_PORT("IN1") // ??? doubt if this is dip 2. | |
| 83 | // AM_RANGE(0x8baa, 0x8baa) AM_READ_PORT("IN1") // ??? doubt if this is dip 2. | |
| 84 | // AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(&main_ram) | |
| 85 | AM_RANGE(0x8880, 0x8880) AM_MIRROR(0x8) AM_READ_PORT("KEY0") // ??? doubt if this is dip 2. | |
| 86 | AM_RANGE(0x8881, 0x8881) AM_MIRROR(0x8) AM_READ_PORT("KEYA") // ??? doubt if this is dip 2. | |
| 87 | AM_RANGE(0x8882, 0x8882) AM_READ_PORT("KEY1") //AM_MIRROR(0x8)// ??? doubt if this is dip 2. | |
| 88 | AM_RANGE(0x8883, 0x8883) AM_MIRROR(0x8) AM_READ_PORT("KEY2") // ??? doubt if this is dip 2. | |
| 89 | AM_RANGE(0x8884, 0x8884) AM_MIRROR(0x8) AM_READ_PORT("KEY3") // ??? doubt if this is dip 2. | |
| 90 | AM_RANGE(0x8885, 0x8885) AM_MIRROR(0x8) AM_READ_PORT("KEY4") // ??? COLLECT?? | |
| 91 | AM_RANGE(0x8886, 0x8886) AM_MIRROR(0x8) AM_READ_PORT("KEY5") // ??? doubt if this is dip 2. | |
| 92 | AM_RANGE(0x8887, 0x8887) AM_MIRROR(0x8) AM_READ_PORT("KEY6") // ??? doubt if this is dip 2. | |
| 93 | AM_RANGE(0x8888, 0x8888) AM_READ_PORT("KEY7") // ??? doubt if this is dip 2. | |
| 94 | AM_RANGE(0x8889, 0x8889) AM_READ_PORT("KEY8") // ??? doubt if this is dip 2. | |
| 95 | AM_RANGE(0x888a, 0x888a) AM_READ_PORT("KEY9") // ??? doubt if this is dip 2. | |
| 96 | // AM_RANGE(0x888e, 0x888e) AM_READ_PORT("KEY0") // ??? doubt if this is dip 2. | |
| 97 | /* AM_RANGE(0x888f, 0x888f) AM_READ_PORT("KEYA") // ??? doubt if this is dip 2. | |
| 98 | AM_RANGE(0x888a, 0x888a) AM_READ_PORT("KEY1") // ??? doubt if this is dip 2. | |
| 99 | AM_RANGE(0x888b, 0x888b) AM_READ_PORT("KEY2") // ??? doubt if this is dip 2. | |
| 100 | AM_RANGE(0x888c, 0x888c) AM_READ_PORT("KEY3") // ??? doubt if this is dip 2. | |
| 101 | AM_RANGE(0x888d, 0x888d) AM_READ_PORT("KEY4") // ??? COLLECT?? | |
| 102 | AM_RANGE(0x888e, 0x888e) AM_READ_PORT("KEY5") // ??? doubt if this is dip 2. | |
| 103 | */ | |
| 104 | // AM_RANGE(0x8887, 0x8887) AM_READ_PORT("KEY6") // ??? doubt if this is dip 2. | |
| 105 | ||
| 106 | // AM_RANGE(0x8887, 0x8887) AM_READ_PORT("IN1") // ??? doubt if this is dip 2. | |
| 107 | // AM_RANGE(0x8889, 0x8889) AM_READ_PORT("IN2") | |
| 108 | ||
| 109 | AM_RANGE(0x8887, 0x8887) AM_MIRROR(0x8) AM_READ_PORT("SERVICE") | |
| 110 | // AM_RANGE(0x888f, 0x888f) AM_READ_PORT("SERVICE") | |
| 111 | ||
| 112 | AM_RANGE(0x8888, 0x8888) AM_MIRROR(0x8) AM_READ_PORT("DOOR") | |
| 113 | // AM_RANGE(0x8890, 0x8890) AM_READ_PORT("DOOR") | |
| 114 | ||
| 115 | AM_RANGE(0x8892, 0x8892) AM_MIRROR(0x8) AM_READ_PORT("DOOR2") | |
| 116 | // AM_RANGE(0x889a, 0x889a) AM_READ_PORT("DOOR2") | |
| 117 | AM_RANGE(0x8893, 0x8893) AM_MIRROR(0x8)AM_READ_PORT("DOOR3") | |
| 118 | // AM_RANGE(0x889b, 0x889b) AM_READ_PORT("DOOR3") | |
| 119 | ||
| 120 | AM_RANGE(0x8e00, 0x8fff) AM_RAM // nvram maybe! | |
| 121 | ||
| 122 | AM_RANGE(0x8000, 0x8dff) AM_RAM AM_BASE(&main_ram) | |
| 123 | ||
| 124 | AM_RANGE(0xC000, 0xC007) AM_RAM // shared ram to 2nd cpu?? battery backed ram? | |
| 125 | ||
| 126 | AM_RANGE(0xC802, 0xC802) AM_READ_PORT("DSW") // first dip | |
| 127 | // AM_RANGE(0xc803, 0xc803) AM_READ_PORT("IN1") // ??? doubt if this is dip 2. | |
| 128 | ||
| 129 | AM_RANGE(0xCA02, 0xCA03) AM_RAM AM_WRITE(dderby_sound_w) // BEST GUESS SO FAR! | |
| 130 | AM_RANGE(0xCA00, 0xCA00) AM_RAM AM_WRITE(dderby_sound_w) // BEST GUESS SO FAR! | |
| 131 | AM_RANGE(0xCA00, 0xCA03) AM_RAM //AM_WRITE(SMH_NOP) // sound hook? | |
| 132 | ||
| 133 | AM_RANGE(0xCC00, 0xCC05) AM_RAM AM_BASE(&scroll_ram) | |
| 134 | ||
| 135 | // CORRECT HERE (I THINK!) | |
| 136 | AM_RANGE(0xCE08, 0XCE1F) AM_RAM AM_BASE(&sprite_ram) // horse sprites | |
| 137 | AM_RANGE(0xD000, 0xD3ff) AM_RAM AM_BASE(&dderby_vidchars) // char ram | |
| 138 | AM_RANGE(0xD400, 0xD7ff) AM_RAM AM_BASE(&dderby_vidattribs) // colours/ attrib ram | |
| 139 | ||
| 55 | 140 | ADDRESS_MAP_END |
| 56 | 141 | |
| 142 | static ADDRESS_MAP_START( dderby_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 143 | AM_RANGE(0x0000, 0x0fff) AM_ROM | |
| 144 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&dderby_soundmem) AM_SHARE(1) | |
| 145 | AM_RANGE(0x1000, 0x1000) AM_RAM | |
| 146 | AM_RANGE(0x4000, 0x4000) AM_WRITE(ay8910_control_port_0_w) | |
| 147 | AM_RANGE(0x4001, 0x4001) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w) | |
| 57 | 148 | |
| 149 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r) | |
| 150 | ||
| 151 | ADDRESS_MAP_END | |
| 152 | ||
| 58 | 153 | static INPUT_PORTS_START( dderby ) |
| 59 | PORT_START("IN0") /* 8bit */ | |
| 60 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 154 | ||
| 155 | PORT_START("SERVICE") | |
| 156 | PORT_DIPNAME(0xff,0xff,"Refill Key") | |
| 157 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 158 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 159 | PORT_START("KEY0") | |
| 160 | PORT_DIPNAME(0xff,0xff,"KEY0") | |
| 161 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 162 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 163 | PORT_START("KEYA") | |
| 164 | PORT_DIPNAME(0xff,0xff,"KEYA") | |
| 165 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 166 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 167 | ||
| 168 | ||
| 169 | PORT_START("KEY1") | |
| 170 | PORT_DIPNAME(0xff,0xff,"KEY1") | |
| 171 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 172 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 173 | ||
| 174 | PORT_START("KEY2") | |
| 175 | PORT_DIPNAME(0xff,0xff,"KEY2") | |
| 176 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 177 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 178 | ||
| 179 | PORT_START("KEY3") | |
| 180 | PORT_DIPNAME(0xff,0xff,"KEY3") | |
| 181 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 182 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 183 | ||
| 184 | PORT_START("KEY4") | |
| 185 | PORT_DIPNAME(0xff,0xff,"KEY4") | |
| 186 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 187 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 188 | ||
| 189 | PORT_START("KEY5") | |
| 190 | PORT_DIPNAME(0xff,0xff,"KEY5") | |
| 191 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 192 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 193 | ||
| 194 | PORT_START("KEY6") | |
| 195 | PORT_DIPNAME(0xff,0xff,"KEY6") | |
| 196 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 197 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 198 | ||
| 199 | PORT_START("KEY7") | |
| 200 | PORT_DIPNAME(0xff,0xff,"KEY7") | |
| 201 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 202 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 203 | ||
| 204 | PORT_START("KEY8") | |
| 205 | PORT_DIPNAME(0xff,0xff,"KEY8") | |
| 206 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 207 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 208 | ||
| 209 | PORT_START("KEY9") | |
| 210 | PORT_DIPNAME(0xff,0xff,"KEY9") | |
| 211 | PORT_DIPSETTING(0xff, DEF_STR( Off )) | |
| 212 | PORT_DIPSETTING(0x00,DEF_STR( On )) | |
| 213 | ||
| 214 | PORT_START("DOOR") | |
| 215 | PORT_DIPNAME(0x02,0x02,"Door") | |
| 216 | PORT_DIPSETTING(0x02, "Open") | |
| 217 | PORT_DIPSETTING(0x00," CLOSED") | |
| 218 | PORT_START("DOOR2") | |
| 219 | PORT_DIPNAME(0x02,0x02,"Door") | |
| 220 | PORT_DIPSETTING(0x02, "Open") | |
| 221 | PORT_DIPSETTING(0x00," CLOSED") | |
| 222 | PORT_START("DOOR3") | |
| 223 | PORT_DIPNAME(0x02,0x02,"Door") | |
| 224 | PORT_DIPSETTING(0x02, "Open") | |
| 225 | PORT_DIPSETTING(0x00," CLOSED") | |
| 226 | ||
| 227 | PORT_START("DSW") /* 8bit */ | |
| 228 | PORT_DIPNAME( 0x01, 0x01, " Unknown 1") | |
| 61 | 229 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 62 | 230 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 63 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 231 | PORT_DIPNAME( 0x08, 0x08, " Unknown 2" ) | |
| 232 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 233 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 234 | PORT_DIPNAME( 0x06, 0x00, "Max Prize" ) | |
| 235 | PORT_DIPSETTING( 0x06, "240p (cash)" ) | |
| 236 | PORT_DIPSETTING( 0x02, "300p (cash)" ) | |
| 237 | PORT_DIPSETTING( 0x04, "480p (cash + tokens)" ) | |
| 238 | PORT_DIPSETTING( 0x00, "600p (cash + tokens)" ) | |
| 239 | PORT_DIPNAME( 0x30, 0x00, "Percentage Payout" ) | |
| 240 | PORT_DIPSETTING( 0x00, "76%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80) | |
| 241 | PORT_DIPSETTING( 0x10, "80%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80) | |
| 242 | PORT_DIPSETTING( 0x20, "86%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80) | |
| 243 | PORT_DIPSETTING( 0x30, "88%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80) | |
| 244 | ||
| 245 | PORT_DIPSETTING( 0x00, "78%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80) | |
| 246 | PORT_DIPSETTING( 0x10, "82%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80) | |
| 247 | PORT_DIPSETTING( 0x20, "86%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80) | |
| 248 | PORT_DIPSETTING( 0x30, "90%" ) PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80) | |
| 249 | ||
| 250 | PORT_DIPNAME( 0xc0, 0x80, "Price Per Game" ) | |
| 251 | PORT_DIPSETTING( 0x00, "2p" ) | |
| 252 | PORT_DIPSETTING( 0x40, "5p" ) | |
| 253 | PORT_DIPSETTING( 0x80, "10p" ) | |
| 254 | PORT_DIPSETTING( 0xc0, "20p" ) | |
| 255 | ||
| 256 | PORT_START("IN1") /* 8bit */ | |
| 257 | PORT_DIPNAME( 0x01, 0x01, "Show Results") | |
| 258 | PORT_DIPSETTING( 0x01, "Last Race" ) | |
| 259 | PORT_DIPSETTING( 0x00, "Last 6 Races" ) | |
| 260 | PORT_DIPNAME( 0x02, 0x02, " Unknown 2" ) | |
| 64 | 261 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 65 | 262 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 66 | PORT_DIPNAME( 0x04, 0x04, | |
| 263 | PORT_DIPNAME( 0x04, 0x04, " | |
| 67 | 264 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 68 | 265 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 69 | PORT_DIPNAME( 0x08, 0x08, | |
| 266 | PORT_DIPNAME( 0x08, 0x08, " | |
| 70 | 267 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 71 | 268 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 72 | PORT_DIPNAME( 0x10, 0x10, | |
| 269 | PORT_DIPNAME( 0x10, 0x10, " | |
| 73 | 270 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 74 | 271 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 75 | PORT_DIPNAME( 0x20, 0x20, | |
| 272 | PORT_DIPNAME( 0x20, 0x20, " | |
| 76 | 273 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 77 | 274 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 78 | PORT_DIPNAME( 0x40, 0x40, | |
| 275 | PORT_DIPNAME( 0x40, 0x40, " | |
| 79 | 276 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 80 | 277 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 81 | PORT_DIPNAME( 0x80, 0x80, | |
| 278 | PORT_DIPNAME( 0x80, 0x80, " | |
| 82 | 279 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 83 | 280 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 281 | ||
| 282 | PORT_START("IN2") /* 8bit */ | |
| 283 | PORT_DIPNAME( 0x01, 0x00, " Unknown 1") // token error ??? | |
| 284 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 285 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 286 | PORT_DIPNAME( 0x02, 0x02, " Unknown 2" ) | |
| 287 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 288 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 289 | PORT_DIPNAME( 0x04, 0x04, " Unknown 3" ) | |
| 290 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 291 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 292 | PORT_DIPNAME( 0x08, 0x08, " Unknown 4" ) | |
| 293 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 294 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 295 | PORT_DIPNAME( 0x10, 0x10, " Unknown 1") | |
| 296 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 297 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 298 | PORT_DIPNAME( 0x20, 0x20, " Unknown 2" ) | |
| 299 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 300 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 301 | PORT_DIPNAME( 0x40, 0x40, " Unknown 3" ) | |
| 302 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 303 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 304 | PORT_DIPNAME( 0x80, 0x80, " Unknown 4" ) | |
| 305 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 306 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 307 | ||
| 84 | 308 | INPUT_PORTS_END |
| 85 | 309 | |
| 310 | static INPUT_PORTS_START( dderbya ) | |
| 311 | PORT_INCLUDE( dderby ) | |
| 312 | PORT_MODIFY("DSW") /* 8bit */ | |
| 313 | PORT_DIPNAME( 0x01, 0x01, "Price Per Play") | |
| 314 | PORT_DIPSETTING( 0x01, "5p" ) | |
| 315 | PORT_DIPSETTING( 0x00, "10p" ) | |
| 316 | PORT_DIPNAME( 0x06, 0x02, "Max Prize" ) | |
| 317 | PORT_DIPSETTING( 0x00, "400p (cash + tokens)" ) | |
| 318 | PORT_DIPSETTING( 0x04, "300p (cash + tokens)" ) | |
| 319 | PORT_DIPSETTING( 0x02, "200p (cash)" ) | |
| 320 | PORT_DIPSETTING( 0x06, "150p (cash)" ) | |
| 321 | PORT_DIPNAME( 0x18, 0x08, "Percentage" ) | |
| 322 | PORT_DIPSETTING( 0x00, "76%" ) | |
| 323 | PORT_DIPSETTING( 0x08, "80%" ) | |
| 324 | PORT_DIPSETTING( 0x10, "84%" ) | |
| 325 | PORT_DIPSETTING( 0x18, "88%" ) | |
| 326 | PORT_DIPNAME( 0x20, 0x20, " Unknown 2" ) | |
| 327 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 328 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 329 | PORT_DIPNAME( 0x40, 0x40, " Unknown 3" ) | |
| 330 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 331 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 332 | PORT_DIPNAME( 0x80, 0x80, " Unknown 4" ) | |
| 333 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 334 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 335 | ||
| 336 | INPUT_PORTS_END | |
| 337 | ||
| 86 | 338 | static const gfx_layout tiles8x8_layout = |
| 87 | 339 | { |
| 88 | 340 | 8,8, |
| 89 | 341 | RGN_FRAC(1,2), |
| 90 | 342 | 4, |
| 91 | { 0,4,RGN_FRAC(1,2) | |
| 343 | { 0,4,RGN_FRAC(1,2) | |
| 92 | 344 | { 0, 1, 2, 3,8,9,10,11 }, |
| 93 | 345 | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, |
| 94 | 346 | 16*8 |
| 95 | 347 | }; |
| 96 | 348 | |
| 97 | static const gfx_layout tiles | |
| 349 | static const gfx_layout tiles16x16_layout | |
| 98 | 350 | { |
| 99 | 8,8, | |
| 100 | RGN_FRAC(1,1), | |
| 101 | 2, | |
| 102 | { 0,8 }, | |
| 103 | { 0, 1, 2, 3,4,5,6,7}, | |
| 104 | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, | |
| 105 | 16*8 | |
| 106 | }; | |
| 351 | 16,16, /* 16*16 sprites */ | |
| 352 | RGN_FRAC(1,3), /* 256 sprites */ | |
| 353 | 3, /* 3 bits per pixel */ | |
| 354 | { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) }, // the three bitplanes are separated | |
| 355 | { 0, 1, 2, 3, 4, 5, 6, 7, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 }, | |
| 356 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, | |
| 357 | 32*8 // every sprite takes 32 consecutive bytes | |
| 107 | 358 | |
| 108 | static const UINT32 tiles8x64_layout_yoffset[64] = | |
| 109 | { | |
| 110 | 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8,16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8,24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8, | |
| 111 | 32*8,33*8,34*8,35*8,36*8,37*8,38*8,39*8,40*8,41*8,42*8,43*8,44*8,45*8,46*8,47*8,48*8,49*8,50*8,51*8,52*8,53*8,54*8,55*8,56*8,57*8,58*8,59*8,60*8,61*8,62*8,63*8 | |
| 112 | 359 | }; |
| 113 | 360 | |
| 114 | /* i'm not convinced they will be used like this, might just be used as 8x8 tiles .. */ | |
| 115 | static const gfx_layout tiles8x64_layout = | |
| 361 | static const gfx_layout tiles8x8_layout2 = | |
| 116 | 362 | { |
| 117 | 8, | |
| 363 | 8,8 | |
| 118 | 364 | RGN_FRAC(1,3), |
| 119 | 365 | 3, |
| 120 | 366 | { 0,RGN_FRAC(1,3),RGN_FRAC(2,3) }, |
| 121 | 367 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 122 | EXTENDED_YOFFS, | |
| 123 | 64*8, | |
| 124 | NULL, | |
| 125 | tiles8x64_layout_yoffset | |
| 368 | {0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8}, | |
| 369 | 8*8, | |
| 126 | 370 | }; |
| 127 | 371 | |
| 128 | 372 | static GFXDECODE_START( dmndrby ) |
| 129 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) | |
| 130 | GFXDECODE_ENTRY( "gfx2", 0, tiles8x64_layout, 0, 16 ) | |
| 131 | GFXDECODE_ENTRY( "gfx3", 0, tiles8x8_layout2, 0, 16 ) | |
| 373 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 32*16, 16 ) | |
| 374 | GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout2, 0, 8) | |
| 375 | GFXDECODE_ENTRY( "gfx3", 0, tiles16x16_layout, 16*16, 32 ) | |
| 132 | 376 | |
| 133 | 377 | GFXDECODE_END |
| 134 | 378 | |
| 379 | ||
| 380 | ||
| 381 | ||
| 382 | ||
| 383 | static TILE_GET_INFO( get_dmndrby_tile_info ) | |
| 384 | { | |
| 385 | int code = racetrack_tilemap_rom[tile_index]; | |
| 386 | int attr = racetrack_tilemap_rom[tile_index+0x2000]; | |
| 387 | ||
| 388 | int col = attr&0x1f; | |
| 389 | int flipx = (attr&0x40)>>6; | |
| 390 | ||
| 391 | ||
| 392 | SET_TILE_INFO( | |
| 393 | 2, | |
| 394 | code, | |
| 395 | col, | |
| 396 | TILE_FLIPYX(flipx) ); | |
| 397 | } | |
| 398 | ||
| 399 | ||
| 135 | 400 | static VIDEO_START(dderby) |
| 136 | 401 | { |
| 402 | racetrack_tilemap_rom = memory_region(machine,"user1"); | |
| 403 | racetrack_tilemap = tilemap_create(machine,get_dmndrby_tile_info,tilemap_scan_rows,16,16, 16, 512); | |
| 404 | tilemap_mark_all_tiles_dirty(racetrack_tilemap); | |
| 405 | ||
| 137 | 406 | } |
| 138 | 407 | |
| 139 | 408 | static VIDEO_UPDATE(dderby) |
| 140 | 409 | { |
| 141 | 410 | int x,y,count; |
| 411 | int off,scrolly; | |
| 412 | static int bg=0; | |
| 142 | 413 | const gfx_element *gfx = screen->machine->gfx[0]; |
| 414 | const gfx_element *sprites = screen->machine->gfx[1]; | |
| 415 | const gfx_element *track = screen->machine->gfx[2]; | |
| 143 | 416 | |
| 144 | 417 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 145 | 418 | |
| 419 | ||
| 420 | /* Draw racetrack | |
| 421 | ||
| 422 | racetrack seems to be stored in 4th and 5th prom. | |
| 423 | can we draw it with the tilemap? maybe not, the layout is a litle strange | |
| 424 | ||
| 425 | */ | |
| 426 | // base = scroll_ram[0]; | |
| 427 | ||
| 428 | off=0x1900-(bg*0x100)+(scroll_ram[1])*0x100; | |
| 429 | scrolly = 0xff-(scroll_ram[0]); | |
| 430 | if(scroll_ram[1]==0xff) off=0x1800; | |
| 431 | for(x=0;x<16;x++) { | |
| 432 | for(y=0;y<16;y++) { | |
| 433 | int chr = racetrack_tilemap_rom[off]; | |
| 434 | int col = racetrack_tilemap_rom[off+0x2000]&0x1f; | |
| 435 | int flipx = racetrack_tilemap_rom[off+0x2000]&0x40; | |
| 436 | drawgfx(bitmap,track,chr,col,flipx,0,y*16+scrolly,x*16,cliprect,TRANSPARENCY_NONE,0); | |
| 437 | // draw another bit of track | |
| 438 | // a rubbish way of doing it | |
| 439 | chr = racetrack_tilemap_rom[off-0x100]; | |
| 440 | col = racetrack_tilemap_rom[off+0x1f00]&0x1f; | |
| 441 | flipx = racetrack_tilemap_rom[off+0x1f00]&0x40; | |
| 442 | drawgfx(bitmap,track,chr,col,flipx,0,y*16-256+scrolly,x*16,cliprect,TRANSPARENCY_NONE,0); | |
| 443 | off++; | |
| 444 | } | |
| 445 | } | |
| 446 | ||
| 447 | ||
| 448 | //return 0; | |
| 449 | ||
| 450 | /* draw sprites | |
| 451 | ||
| 452 | guess work again! seems to work fine and horse labels match up | |
| 453 | wouldnt like to say its the most effective way though... | |
| 454 | -- maybe they should be decoded as 'big sprites' instead? | |
| 455 | ||
| 456 | */ | |
| 457 | for (count=5;count>=0;count-- ) | |
| 458 | { | |
| 459 | int a=0; | |
| 460 | int b=0; | |
| 461 | int base = count*4; | |
| 462 | int sprx=sprite_ram[base+3]; | |
| 463 | int spry=sprite_ram[base+2]; | |
| 464 | //sprite_ram[base+1]; | |
| 465 | int col = (sprite_ram[base+1]&0x1f); | |
| 466 | int anim = (sprite_ram[base]&0x3)*0x40; // animation frame - probably wrong but seems right | |
| 467 | int horse = (sprite_ram[base+1]&0x7)*8+7; // horse label from 1 - 6 | |
| 468 | ||
| 469 | for (a=0;a<8 ;a++) | |
| 470 | { | |
| 471 | for(b=0;b<7;b++) { | |
| 472 | drawgfx(bitmap,sprites,anim+a*8+b,col,0,0,sprx+a*8,spry+b*8,cliprect,TRANSPARENCY_PEN,0); | |
| 473 | } | |
| 474 | } | |
| 475 | // draw the horse number | |
| 476 | a=3; | |
| 477 | b=3; | |
| 478 | drawgfx(bitmap,sprites,anim+horse,col,0,0,sprx+a*8,spry+b*8,cliprect,TRANSPARENCY_PEN,0); | |
| 479 | ||
| 480 | ||
| 481 | } | |
| 482 | ||
| 483 | ||
| 484 | // char tiles. seems right - no idea about the palette | |
| 146 | 485 | count=0; |
| 147 | 486 | for (y=0;y<32;y++) |
| 148 | 487 | { |
| 149 | 488 | for(x=0;x<32;x++) |
| 150 | 489 | { |
| 151 | int tileno,bank; | |
| 490 | int tileno,bank,color; | |
| 491 | int trans = TRANSPARENCY_NONE;//((dderby_vidattribs[count]&0x10)==0x10)?TRANSPARENCY_PEN:TRANSPARENCY_NONE; | |
| 492 | tileno=dderby_vidchars[count]; | |
| 493 | bank=dderby_vidattribs[count]&0x20; | |
| 494 | color=((dderby_vidattribs[count]+bg)&0x1f); | |
| 495 | if(tileno!=0x38) { | |
| 496 | if (bank) | |
| 497 | tileno+=0x100; | |
| 152 | 498 | |
| 153 | tileno=dderby_vid[count]; | |
| 154 | bank=dderby_vid[count+0x400]&0x20; | |
| 155 | 499 | |
| 156 | if (bank) tileno+=0x100; | |
| 157 | 500 | |
| 158 | drawgfx(bitmap,gfx,tileno,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_PEN,0); | |
| 501 | drawgfx(bitmap,gfx,tileno,color,0,0,x*8,y*8,cliprect,trans,0); | |
| 502 | } | |
| 503 | ||
| 159 | 504 | count++; |
| 160 | 505 | } |
| 161 | 506 | } |
| 162 | 507 | |
| 163 | 508 | |
| 164 | ||
| 165 | 509 | return 0; |
| 166 | 510 | } |
| 167 | 511 | |
| 512 | ||
| 168 | 513 | static INTERRUPT_GEN( dderby_interrupt ) |
| 169 | 514 | { |
| 170 | // cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0x8); // almost certainly wrong? | |
| 171 | // cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0x10); // almost certainly wrong? | |
| 172 | // cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0x18); // almost certainly wrong? | |
| 173 | // cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0x20); // almost certainly wrong? | |
| 515 | cpu_set_input_line_and_vector(cputag_get_cpu(device->machine, "main"), 0, HOLD_LINE, 0x8a); // game | |
| 174 | 516 | } |
| 175 | 517 | |
| 518 | ||
| 519 | static INTERRUPT_GEN( dderby_sound_interrupt ) | |
| 520 | { | |
| 521 | cpu_set_input_line_and_vector(cputag_get_cpu(device->machine, "audio"), 0, HOLD_LINE, 0x50); | |
| 522 | } | |
| 523 | ||
| 524 | ||
| 525 | // copied from elsewhere. maybe incorrect | |
| 526 | static PALETTE_INIT( dmnderby ) | |
| 527 | { | |
| 528 | static const int resistances_rg[3] = { 1000, 470, 220 }; | |
| 529 | static const int resistances_b [2] = { 470, 220 }; | |
| 530 | double rweights[3], gweights[3], bweights[2]; | |
| 531 | int i; | |
| 532 | ||
| 533 | /* compute the color output resistor weights */ | |
| 534 | compute_resistor_weights(0, 255, -1.0, | |
| 535 | 3, &resistances_rg[0], rweights, 470, 0, | |
| 536 | 3, &resistances_rg[0], gweights, 470, 0, | |
| 537 | 2, &resistances_b[0], bweights, 470, 0); | |
| 538 | ||
| 539 | /* allocate the colortable */ | |
| 540 | machine->colortable = colortable_alloc(machine, 0x20); | |
| 541 | ||
| 542 | /* create a lookup table for the palette */ | |
| 543 | for (i = 0; i < 0x20; i++) | |
| 544 | { | |
| 545 | int bit0, bit1, bit2; | |
| 546 | int r, g, b; | |
| 547 | ||
| 548 | /* red component */ | |
| 549 | bit0 = (color_prom[i] >> 0) & 0x01; | |
| 550 | bit1 = (color_prom[i] >> 1) & 0x01; | |
| 551 | bit2 = (color_prom[i] >> 2) & 0x01; | |
| 552 | r = combine_3_weights(rweights, bit0, bit1, bit2); | |
| 553 | ||
| 554 | /* green component */ | |
| 555 | bit0 = (color_prom[i] >> 3) & 0x01; | |
| 556 | bit1 = (color_prom[i] >> 4) & 0x01; | |
| 557 | bit2 = (color_prom[i] >> 5) & 0x01; | |
| 558 | g = combine_3_weights(gweights, bit0, bit1, bit2); | |
| 559 | ||
| 560 | /* blue component */ | |
| 561 | bit0 = (color_prom[i] >> 6) & 0x01; | |
| 562 | bit1 = (color_prom[i] >> 7) & 0x01; | |
| 563 | b = combine_2_weights(bweights, bit0, bit1); | |
| 564 | ||
| 565 | colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b)); | |
| 566 | } | |
| 567 | ||
| 568 | /* color_prom now points to the beginning of the lookup table */ | |
| 569 | color_prom = memory_region(machine,"proms2"); | |
| 570 | ||
| 571 | /* normal tiles use colors 0-15 */ | |
| 572 | for (i = 0x000; i < 0x300; i++) | |
| 573 | { | |
| 574 | UINT8 ctabentry = color_prom[i]; | |
| 575 | colortable_entry_set_value(machine->colortable, i, ctabentry); | |
| 576 | } | |
| 577 | } | |
| 578 | ||
| 176 | 579 | static MACHINE_DRIVER_START( dderby ) |
| 177 | 580 | /* basic machine hardware */ |
| 178 | MDRV_CPU_ADD("main", Z80, | |
| 581 | MDRV_CPU_ADD("main", Z80,4000000) /* ? MHz */ | |
| 179 | 582 | MDRV_CPU_PROGRAM_MAP(memmap,0) |
| 180 | MDRV_CPU_VBLANK_INT("main", dderby_interrupt) | |
| 583 | MDRV_CPU_PERIODIC_INT(dderby_interrupt, 244) // seems about right judging by countdown timer on screen (15 > 1) | |
| 584 | // MDRV_CPU_VBLANK_INT("main", dderby_interrupt) | |
| 181 | 585 | |
| 586 | // SOUND CPU (PROBABLY WRONG) | |
| 587 | // | |
| 588 | MDRV_CPU_ADD("audio", Z80, 4000000) /* verified on schematics */ | |
| 589 | MDRV_CPU_PROGRAM_MAP(dderby_sound_map,0) | |
| 590 | MDRV_CPU_PERIODIC_INT(dderby_sound_interrupt, 100) // total guess | |
| 591 | ||
| 592 | MDRV_QUANTUM_TIME(HZ(6000)) | |
| 593 | MDRV_NVRAM_HANDLER(dderby) | |
| 594 | ||
| 182 | 595 | /* video hardware */ |
| 183 | 596 | MDRV_SCREEN_ADD("main", RASTER) |
| 184 | 597 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 188 | 601 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) |
| 189 | 602 | |
| 190 | 603 | MDRV_GFXDECODE(dmndrby) |
| 191 | MDRV_PALETTE_LENGTH(0x100) | |
| 604 | MDRV_PALETTE_LENGTH(0x300) | |
| 605 | MDRV_PALETTE_INIT(dmnderby) | |
| 192 | 606 | |
| 193 | 607 | MDRV_VIDEO_START(dderby) |
| 194 | 608 | MDRV_VIDEO_UPDATE(dderby) |
| 609 | ||
| 610 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 611 | ||
| 612 | MDRV_SOUND_ADD("ay1", AY8910, 1789750) // frequency guessed | |
| 613 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) | |
| 195 | 614 | MACHINE_DRIVER_END |
| 196 | 615 | |
| 616 | ||
| 197 | 617 | ROM_START( dmndrby ) |
| 198 | ROM_REGION( 0x04000, "gfx1", 0 ) | |
| 199 | ROM_LOAD( "dd01.e1", 0x00000, 0x02000, CRC(2e120288) SHA1(0ea29aff07e956b19080f05bd18b427195694ce8) ) | |
| 200 | ROM_LOAD( "dd02.e2", 0x02000, 0x02000, CRC(ca028c8c) SHA1(f882eea2191cf1f3ea57d49fd6862f98401555be) ) | |
| 201 | ||
| 202 | ROM_REGION( 0x10000, "cpu1", 0 ) /* sound cpu */ | |
| 203 | ROM_LOAD( "dd03.j9", 0x00000, 0x01000, CRC(660f0cae) SHA1(b3b414e52342de877a5c20886a87002a63310a94) ) | |
| 204 | ||
| 205 | 618 | ROM_REGION( 0x10000, "main", 0 ) /* main cpu */ |
| 206 | 619 | ROM_LOAD( "dd04.m6", 0x00000, 0x02000, CRC(a3cfd28e) SHA1(7ba14876fa4409634a699e049bce3bc457522932) ) |
| 207 | 620 | ROM_LOAD( "dd05.m7", 0x02000, 0x02000, CRC(16f7ac0b) SHA1(030b8c2b294a0287f3aaf72424304fc191315888) ) |
| 208 | 621 | ROM_LOAD( "dd06.m8", 0x04000, 0x02000, CRC(914ba8f5) SHA1(d1b3f3d5d2625e42ea6cb5c777942cec7faea58e) ) |
| 209 | 622 | |
| 210 | ROM_REGION( 0x18000, "gfx2", 0 ) | |
| 623 | ROM_REGION( 0x10000, "audio", 0 ) /* sound cpu */ | |
| 624 | ROM_LOAD( "dd03.j9", 0x00000, 0x01000, CRC(660f0cae) SHA1(b3b414e52342de877a5c20886a87002a63310a94) ) | |
| 625 | ||
| 626 | ROM_REGION( 0x04000, "gfx1", 0 ) /* tiles */ | |
| 627 | ROM_LOAD( "dd01.e1", 0x00000, 0x02000, CRC(2e120288) SHA1(0ea29aff07e956b19080f05bd18b427195694ce8) ) | |
| 628 | ROM_LOAD( "dd02.e2", 0x02000, 0x02000, CRC(ca028c8c) SHA1(f882eea2191cf1f3ea57d49fd6862f98401555be) ) | |
| 629 | ||
| 630 | ROM_REGION( 0x4000, "user1", 0 ) // tracerack data | |
| 631 | ROM_LOAD( "dd22.n6", 0x00000, 0x02000, CRC(db6b13fc) SHA1(3415deb2ffa86679e4f8abb644b75963e5368ba0) ) | |
| 632 | ROM_LOAD( "dd23.n7", 0x02000, 0x02000, CRC(595fdb9b) SHA1(133d227bb156be52337da974e37973b049722e49) ) | |
| 633 | ||
| 634 | ROM_REGION( 0x18000, "gfx2", 0 ) /* horse sprites (kinda) */ | |
| 211 | 635 | ROM_LOAD( "dd07.b1", 0x00000, 0x02000, CRC(207a534a) SHA1(ddbd292f79cc9fb7bd9f0ee9874da87909147789) ) |
| 212 | 636 | ROM_LOAD( "dd08.b2", 0x02000, 0x02000, CRC(f380e2c4) SHA1(860a6557ae8b81d310c353f88f9194e1ffd551ec) ) |
| 213 | 637 | ROM_LOAD( "dd09.b3", 0x04000, 0x02000, CRC(68ebf74c) SHA1(959ee6c4ce700cff86af39442063dc79b8f8913e) ) |
| r3957 | r3958 | |
| 226 | 650 | ROM_LOAD( "dd20.n3", 0x02000, 0x02000, CRC(1497e52f) SHA1(f08c20c97c8d2148fcc705297cf1129bc65c9b83) ) |
| 227 | 651 | ROM_LOAD( "dd21.n4", 0x04000, 0x02000, CRC(87605d44) SHA1(c985fb15eac7bcc89e92909cf588b5982d0cabd0) ) |
| 228 | 652 | |
| 229 | ROM_REGION( 0x4000, "user1", 0 ) // something else | |
| 230 | ROM_LOAD( "dd22.n6", 0x00000, 0x02000, CRC(db6b13fc) SHA1(3415deb2ffa86679e4f8abb644b75963e5368ba0) ) | |
| 231 | ROM_LOAD( "dd23.n7", 0x02000, 0x02000, CRC(595fdb9b) SHA1(133d227bb156be52337da974e37973b049722e49) ) | |
| 653 | ROM_REGION( 0x020, "proms", 0 ) // palette | |
| 654 | ROM_LOAD( "ddprom3.h5", 0x0000, 0x0020, CRC(aea3cff6) SHA1(1139dd52c127436873a674be8a14527190091a82) ) | |
| 232 | 655 | |
| 233 | ROM_REGION( 0x520, "user2", 0 ) // proms | |
| 234 | ROM_LOAD( "ddprom1.c1", 0x0000, 0x0100, CRC(e1c2fa1b) SHA1(6b8b0b2c1ac4b2796070452c923ba96dd8b29048) ) | |
| 235 | ROM_LOAD( "ddprom2.j5", 0x0100, 0x0100, CRC(3e5402dc) SHA1(2f497333f49064c54995cec8919f3aebdc17e977) ) | |
| 236 | ROM_LOAD( "ddprom4.h10",0x0200, 0x0100, CRC(7280f000) SHA1(bfad2b547b8abe6c67928bec08e7d00431c539d5) ) | |
| 237 | ROM_LOAD( "ddprom5.k1", 0x0300, 0x0100, CRC(15edbdac) SHA1(298640afb24830d32f54c0c7c5960d777f51f2bd) ) | |
| 238 | ROM_LOAD( "ddprom6.m12",0x0400, 0x0100, CRC(7f677b7d) SHA1(946014cb01f5954a3cb196796741ee174a0de641) ) | |
| 239 | ROM_LOAD( "ddprom3.h5", 0x0500, 0x0020, CRC(aea3cff6) SHA1(1139dd52c127436873a674be8a14527190091a82) ) | |
| 656 | ROM_REGION( 0x300, "proms2", 0 ) // lookup | |
| 657 | ROM_LOAD( "ddprom4.h10",0x0000, 0x0100, CRC(7280f000) SHA1(bfad2b547b8abe6c67928bec08e7d00431c539d5) ) // HORSES | |
| 658 | ROM_LOAD( "ddprom5.k1", 0x0100, 0x0100, CRC(15edbdac) SHA1(298640afb24830d32f54c0c7c5960d777f51f2bd) ) // TILES? | |
| 659 | ROM_LOAD( "ddprom1.c1", 0x0200, 0x0100, CRC(e1c2fa1b) SHA1(6b8b0b2c1ac4b2796070452c923ba96dd8b29048) ) // ??? | |
| 660 | ||
| 661 | ROM_REGION( 0x200, "proms3", 0 ) // other | |
| 662 | ROM_LOAD( "ddprom2.j5", 0x0000, 0x0100, CRC(3e5402dc) SHA1(2f497333f49064c54995cec8919f3aebdc17e977) ) | |
| 663 | ROM_LOAD( "ddprom6.m12",0x0100, 0x0100, CRC(7f677b7d) SHA1(946014cb01f5954a3cb196796741ee174a0de641) ) | |
| 240 | 664 | ROM_END |
| 241 | 665 | |
| 242 | 666 | ROM_START( dmndrbya ) |
| 667 | ROM_REGION( 0x10000, "main", 0 ) | |
| 668 | ROM_LOAD( "dd4", 0x00000, 0x02000, CRC(29b06e0f) SHA1(301fc2fe25ce47c2ad5112f0b795cd6bae605071) ) | |
| 669 | ROM_LOAD( "dd5", 0x02000, 0x02000, CRC(5299d020) SHA1(678d338d2cee5250154454be97456d5f80bb4759) ) | |
| 670 | ROM_LOAD( "dd6", 0x04000, 0x02000, CRC(f7e30ec0) SHA1(bf898987366ee9def190e3575108395b0aaef2d6) ) | |
| 671 | ||
| 672 | ROM_REGION( 0x10000, "audio", 0 ) /* sound cpu */ | |
| 673 | ROM_LOAD( "dd03.j9", 0x00000, 0x01000, CRC(660f0cae) SHA1(b3b414e52342de877a5c20886a87002a63310a94) ) | |
| 674 | ||
| 243 | 675 | ROM_REGION( 0x04000, "gfx1", 0 ) |
| 244 | 676 | ROM_LOAD( "dd1", 0x00000, 0x02000, CRC(7fe475a6) SHA1(008bbaff87baad7f4c2497e40bf5e3fc95f993b4) ) |
| 245 | 677 | ROM_LOAD( "dd2", 0x02000, 0x02000, CRC(54def3ee) SHA1(fb88852ada2b5b555c0e8c0a082ed9978ff27434) ) |
| 246 | 678 | |
| 247 | ROM_REGION( 0x10000, "cpu1", 0 ) /* sound cpu */ | |
| 248 | ROM_LOAD( "dd03.j9", 0x00000, 0x01000, CRC(660f0cae) SHA1(b3b414e52342de877a5c20886a87002a63310a94) ) | |
| 679 | ROM_REGION( 0x4000, "user1", 0 ) // tracerack data | |
| 680 | ROM_LOAD( "dd22.n6", 0x00000, 0x02000, CRC(db6b13fc) SHA1(3415deb2ffa86679e4f8abb644b75963e5368ba0) ) | |
| 681 | ROM_LOAD( "dd23.n7", 0x02000, 0x02000, CRC(595fdb9b) SHA1(133d227bb156be52337da974e37973b049722e49) ) | |
| 249 | 682 | |
| 250 | ROM_REGION( 0x10000, "main", 0 ) | |
| 251 | ROM_LOAD( "dd4", 0x00000, 0x02000, CRC(29b06e0f) SHA1(301fc2fe25ce47c2ad5112f0b795cd6bae605071) ) | |
| 252 | ROM_LOAD( "dd5", 0x02000, 0x02000, CRC(5299d020) SHA1(678d338d2cee5250154454be97456d5f80bb4759) ) | |
| 253 | ROM_LOAD( "dd6", 0x04000, 0x02000, CRC(f7e30ec0) SHA1(bf898987366ee9def190e3575108395b0aaef2d6) ) | |
| 254 | ||
| 255 | 683 | ROM_REGION( 0x18000, "gfx2", 0 ) |
| 256 | 684 | ROM_LOAD( "dd07.b1", 0x00000, 0x02000, CRC(207a534a) SHA1(ddbd292f79cc9fb7bd9f0ee9874da87909147789) ) |
| 257 | 685 | ROM_LOAD( "dd08.b2", 0x02000, 0x02000, CRC(f380e2c4) SHA1(860a6557ae8b81d310c353f88f9194e1ffd551ec) ) |
| r3957 | r3958 | |
| 271 | 699 | ROM_LOAD( "dd20.n3", 0x02000, 0x02000, CRC(1497e52f) SHA1(f08c20c97c8d2148fcc705297cf1129bc65c9b83) ) |
| 272 | 700 | ROM_LOAD( "dd21.n4", 0x04000, 0x02000, CRC(87605d44) SHA1(c985fb15eac7bcc89e92909cf588b5982d0cabd0) ) |
| 273 | 701 | |
| 274 | ROM_REGION( 0x4000, "user1", 0 ) // something else | |
| 275 | ROM_LOAD( "dd22.n6", 0x00000, 0x02000, CRC(db6b13fc) SHA1(3415deb2ffa86679e4f8abb644b75963e5368ba0) ) | |
| 276 | ROM_LOAD( "dd23.n7", 0x02000, 0x02000, CRC(595fdb9b) SHA1(133d227bb156be52337da974e37973b049722e49) ) | |
| 702 | ROM_REGION( 0x020, "proms", 0 ) // palette | |
| 703 | ROM_LOAD( "ddprom3.h5", 0x0000, 0x0020, CRC(aea3cff6) SHA1(1139dd52c127436873a674be8a14527190091a82) ) | |
| 277 | 704 | |
| 278 | ROM_REGION( 0x520, "user2", 0 ) // proms | |
| 279 | ROM_LOAD( "ddprom1.c1", 0x0000, 0x0100, CRC(e1c2fa1b) SHA1(6b8b0b2c1ac4b2796070452c923ba96dd8b29048) ) | |
| 280 | ROM_LOAD( "ddprom2.j5", 0x0100, 0x0100, CRC(3e5402dc) SHA1(2f497333f49064c54995cec8919f3aebdc17e977) ) // wasn't in this set | |
| 281 | ROM_LOAD( "ddprom4.h10",0x0200, 0x0100, CRC(7280f000) SHA1(bfad2b547b8abe6c67928bec08e7d00431c539d5) ) | |
| 282 | ROM_LOAD( "ddprom5.k1", 0x0300, 0x0100, CRC(15edbdac) SHA1(298640afb24830d32f54c0c7c5960d777f51f2bd) ) | |
| 283 | ROM_LOAD( "ddprom6.m12",0x0400, 0x0100, CRC(7f677b7d) SHA1(946014cb01f5954a3cb196796741ee174a0de641) ) | |
| 284 | ROM_LOAD( "ddprom3.h5", 0x0500, 0x0020, CRC(aea3cff6) SHA1(1139dd52c127436873a674be8a14527190091a82) ) | |
| 705 | ROM_REGION( 0x300, "proms2", 0 ) // lookup | |
| 706 | ROM_LOAD( "ddprom4.h10",0x0000, 0x0100, CRC(7280f000) SHA1(bfad2b547b8abe6c67928bec08e7d00431c539d5) ) // HORSES | |
| 707 | ROM_LOAD( "ddprom5.k1", 0x0100, 0x0100, CRC(15edbdac) SHA1(298640afb24830d32f54c0c7c5960d777f51f2bd) ) // TILES? | |
| 708 | ROM_LOAD( "ddprom1.c1", 0x0200, 0x0100, CRC(e1c2fa1b) SHA1(6b8b0b2c1ac4b2796070452c923ba96dd8b29048) ) // ??? | |
| 709 | ||
| 710 | ROM_REGION( 0x200, "proms3", 0 ) // other | |
| 711 | ROM_LOAD( "ddprom2.j5", 0x0000, 0x0100, CRC(3e5402dc) SHA1(2f497333f49064c54995cec8919f3aebdc17e977) ) | |
| 712 | ROM_LOAD( "ddprom6.m12",0x0100, 0x0100, CRC(7f677b7d) SHA1(946014cb01f5954a3cb196796741ee174a0de641) ) | |
| 285 | 713 | ROM_END |
| 286 | 714 | |
| 287 | 715 | |
| 288 | ||
| 289 | GAME( 1986, dmndrby, 0, dderby, dderby, 0, ROT0, "Electrocoin", "Diamond Derby (set 1)",GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 290 | GAME( 1986, dmndrbya, dmndrby, dderby, dderby, 0, ROT0, "Electrocoin", "Diamond Derby (set 2)",GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 716 | /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME */ | |
| 717 | GAME( 1994, dmndrby, 0, dderby, dderby, 0, ROT0, "Electrocoin", "Diamond Derby (Newer)",GAME_NOT_WORKING|GAME_NO_SOUND ) // hack? | |
| 718 | GAME( 1986, dmndrbya, dmndrby, dderby, dderbya, 0, ROT0, "Electrocoin", "Diamond Derby (Original)",GAME_NOT_WORKING|GAME_NO_SOUND ) |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | ******************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/z80/z80.h" | |
| 24 | 25 | #include "nb1413m3.h" |
| 25 | 26 | #include "sound/ay8910.h" |
| 26 | 27 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 40 | 41 | |
| 41 | 42 | extern WRITE8_HANDLER( pastelg_clut_w ); |
| 42 | 43 | extern WRITE8_HANDLER( pastelg_romsel_w ); |
| 44 | extern WRITE8_HANDLER( threeds_romsel_w ); | |
| 43 | 45 | extern WRITE8_HANDLER( pastelg_blitter_w ); |
| 44 | 46 | extern int pastelg_blitter_src_addr_r(void); |
| 45 | 47 | |
| r3957 | r3958 | |
| 56 | 58 | return ROM[pastelg_blitter_src_addr_r() & 0x7fff]; |
| 57 | 59 | } |
| 58 | 60 | |
| 59 | ||
| 60 | static ADDRESS_MAP_START( readmem_pastelg, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 61 | AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM) | |
| 62 | AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM) | |
| 61 | static ADDRESS_MAP_START( pastelg_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 62 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 63 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&nb1413m3_nvram) AM_SIZE(&nb1413m3_nvram_size) | |
| 63 | 64 | ADDRESS_MAP_END |
| 64 | 65 | |
| 65 | static ADDRESS_MAP_START( writemem_pastelg, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 66 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM) | |
| 67 | AM_RANGE(0xe000, 0xe7ff) AM_WRITE(SMH_RAM) AM_BASE(&nb1413m3_nvram) AM_SIZE(&nb1413m3_nvram_size) | |
| 68 | ADDRESS_MAP_END | |
| 69 | 66 | |
| 70 | ||
| 71 | ||
| 72 | 67 | static ADDRESS_MAP_START( pastelg_io_map, ADDRESS_SPACE_IO, 8 ) |
| 73 | 68 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 74 | 69 | // AM_RANGE(0x00, 0x00) AM_WRITE(SMH_NOP) |
| r3957 | r3958 | |
| 86 | 81 | AM_RANGE(0xe0, 0xe0) AM_READ_PORT("DSWC") |
| 87 | 82 | ADDRESS_MAP_END |
| 88 | 83 | |
| 84 | static UINT8 mux_data; | |
| 85 | ||
| 86 | static READ8_HANDLER( threeds_inputport1_r ) | |
| 87 | { | |
| 88 | switch(mux_data) | |
| 89 | { | |
| 90 | case 0x01: return input_port_read(space->machine,"KEY0_PL1"); | |
| 91 | case 0x02: return input_port_read(space->machine,"KEY1_PL1"); | |
| 92 | case 0x04: return input_port_read(space->machine,"KEY2_PL1"); | |
| 93 | case 0x08: return input_port_read(space->machine,"KEY3_PL1"); | |
| 94 | case 0x10: return input_port_read(space->machine,"KEY4_PL1"); | |
| 95 | } | |
| 96 | ||
| 97 | return 0xff; | |
| 98 | } | |
| 99 | ||
| 100 | static READ8_HANDLER( threeds_inputport2_r ) | |
| 101 | { | |
| 102 | switch(mux_data) | |
| 103 | { | |
| 104 | case 0x01: return input_port_read(space->machine,"KEY0_PL2"); | |
| 105 | case 0x02: return input_port_read(space->machine,"KEY1_PL2"); | |
| 106 | case 0x04: return input_port_read(space->machine,"KEY2_PL2"); | |
| 107 | case 0x08: return input_port_read(space->machine,"KEY3_PL2"); | |
| 108 | case 0x10: return input_port_read(space->machine,"KEY4_PL2"); | |
| 109 | } | |
| 110 | ||
| 111 | return 0xff; | |
| 112 | } | |
| 113 | ||
| 114 | static WRITE8_HANDLER( threeds_inputportsel_w ) | |
| 115 | { | |
| 116 | mux_data = ~data; | |
| 117 | } | |
| 118 | ||
| 119 | static ADDRESS_MAP_START( threeds_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 120 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 121 | AM_RANGE(0x81, 0x81) AM_READ(ay8910_read_port_0_r) | |
| 122 | AM_RANGE(0x82, 0x82) AM_WRITE(ay8910_write_port_0_w) | |
| 123 | AM_RANGE(0x83, 0x83) AM_WRITE(ay8910_control_port_0_w) | |
| 124 | AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM") AM_WRITE( threeds_romsel_w ) | |
| 125 | AM_RANGE(0xf0, 0xf6) AM_WRITE(pastelg_blitter_w) | |
| 126 | AM_RANGE(0xa0, 0xa0) AM_READWRITE(threeds_inputport1_r, threeds_inputportsel_w) | |
| 127 | AM_RANGE(0xb0, 0xb0) AM_READ(threeds_inputport2_r) | |
| 128 | AM_RANGE(0xc0, 0xcf) AM_WRITE(pastelg_clut_w) | |
| 129 | AM_RANGE(0xc0, 0xc0) AM_READ_PORT("DSWC") | |
| 130 | AM_RANGE(0xd0, 0xd0) AM_READWRITE(SMH_NOP, DAC_0_WRITE) // unknown | |
| 131 | ADDRESS_MAP_END | |
| 132 | ||
| 89 | 133 | static INPUT_PORTS_START( pastelg ) |
| 90 | 134 | PORT_START("DSWA") |
| 91 | 135 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) |
| r3957 | r3958 | |
| 173 | 217 | PORT_INCLUDE( nbmjcontrols ) |
| 174 | 218 | INPUT_PORTS_END |
| 175 | 219 | |
| 220 | // stops the game hanging.. | |
| 221 | CUSTOM_INPUT( nb1413m3_hackbusyflag_r ) | |
| 222 | { | |
| 223 | static int i = 0; | |
| 224 | i ^= 1; | |
| 225 | return i; | |
| 226 | } | |
| 176 | 227 | |
| 228 | static INPUT_PORTS_START( threeds ) | |
| 229 | PORT_START("DSWA") | |
| 230 | PORT_DIPNAME( 0x01, 0x01, "0" ) | |
| 231 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 232 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 233 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 234 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 235 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 236 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 237 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 238 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 239 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 240 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 241 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 242 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 243 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 244 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 245 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 246 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 247 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 248 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 249 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 250 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 251 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 252 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 253 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 254 | ||
| 255 | PORT_START("DSWB") | |
| 256 | PORT_DIPNAME( 0x01, 0x01, "1" ) | |
| 257 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 258 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 259 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 260 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 261 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 262 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 263 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 264 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 265 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 266 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 267 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 268 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 269 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 270 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 271 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 272 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 273 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 274 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 275 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 276 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 277 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 278 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 279 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 280 | ||
| 281 | PORT_START("DSWC") | |
| 282 | PORT_DIPNAME( 0x01, 0x01, "2" ) | |
| 283 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 284 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 285 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 286 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 287 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 288 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 289 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 290 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 291 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 292 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 293 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 294 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 295 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 296 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 297 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 298 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 299 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 300 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 301 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 302 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 303 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 304 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 305 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 306 | ||
| 307 | PORT_START("KEY0_PL1") | |
| 308 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 309 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("1P Start / Deal") | |
| 310 | PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 311 | PORT_DIPNAME( 0x40, 0x40, "1P-Side Character Test Mode" ) //only combined with the service mode | |
| 312 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 313 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 314 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 315 | ||
| 316 | PORT_START("KEY1_PL1") | |
| 317 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 318 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_NAME("1P Bet") PORT_CODE(KEYCODE_S) | |
| 319 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("1P Hold 5") PORT_CODE(KEYCODE_B) | |
| 320 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1P Hold 3") PORT_CODE(KEYCODE_C) | |
| 321 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P Hold 1") PORT_CODE(KEYCODE_Z) | |
| 322 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 323 | ||
| 324 | PORT_START("KEY2_PL1") | |
| 325 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 326 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("1P Change Dealer") PORT_CODE(KEYCODE_A) | |
| 327 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 328 | ||
| 329 | PORT_START("KEY3_PL1") | |
| 330 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 331 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("1P Hold 4") PORT_CODE(KEYCODE_V) | |
| 332 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("1P Hold 2") PORT_CODE(KEYCODE_X) | |
| 333 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 334 | ||
| 335 | PORT_START("KEY4_PL1") | |
| 336 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_NAME("1P Small") | |
| 337 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_NAME("1P Big") | |
| 338 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("1P Flip Flop") | |
| 339 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_NAME("1P Double Up") | |
| 340 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_NAME("1P Take Score") | |
| 341 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 342 | ||
| 343 | PORT_START("KEY0_PL2") | |
| 344 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 345 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("2P Start / Deal") | |
| 346 | PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 347 | PORT_DIPNAME( 0x40, 0x40, "2P-Side Character Test Mode" ) //only combined with the service mode | |
| 348 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 349 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 350 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 351 | ||
| 352 | PORT_START("KEY1_PL2") | |
| 353 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 354 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_NAME("2P Bet") PORT_PLAYER(2) | |
| 355 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("2P Hold 5") PORT_PLAYER(2) | |
| 356 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("2P Hold 3") PORT_PLAYER(2) | |
| 357 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("2P Hold 1") PORT_PLAYER(2) | |
| 358 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 359 | ||
| 360 | PORT_START("KEY2_PL2") | |
| 361 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 362 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("2P Change Dealer") PORT_PLAYER(2) | |
| 363 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 364 | ||
| 365 | PORT_START("KEY3_PL2") | |
| 366 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 367 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("2P Hold 4") PORT_PLAYER(2) | |
| 368 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("2P Hold 2") PORT_PLAYER(2) | |
| 369 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 370 | ||
| 371 | PORT_START("KEY4_PL2") | |
| 372 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_NAME("2P Small") PORT_PLAYER(2) | |
| 373 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_NAME("2P Big") PORT_PLAYER(2) | |
| 374 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("2P Flip Flop") PORT_PLAYER(2) | |
| 375 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_NAME("2P Double Up") PORT_PLAYER(2) | |
| 376 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_NAME("2P Take Score") PORT_PLAYER(2) | |
| 377 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 378 | ||
| 379 | PORT_START("SYSTEM") | |
| 380 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_hackbusyflag_r, NULL) // DRAW BUSY | |
| 381 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) // | |
| 382 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET | |
| 383 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER | |
| 384 | PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST | |
| 385 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1 | |
| 386 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE4 ) // CREDIT CLEAR | |
| 387 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // SERVICE | |
| 388 | INPUT_PORTS_END | |
| 389 | ||
| 390 | ||
| 177 | 391 | static const ay8910_interface ay8910_config = |
| 178 | 392 | { |
| 179 | 393 | AY8910_LEGACY_OUTPUT, |
| r3957 | r3958 | |
| 189 | 403 | |
| 190 | 404 | /* basic machine hardware */ |
| 191 | 405 | MDRV_CPU_ADD("main", Z80, 19968000/8) /* 2.496 MHz ? */ |
| 192 | MDRV_CPU_PROGRAM_MAP( | |
| 406 | MDRV_CPU_PROGRAM_MAP( | |
| 193 | 407 | MDRV_CPU_IO_MAP(pastelg_io_map,0) |
| 194 | 408 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt,96) // nmiclock not written, chip is 1411M1 instead of 1413M3 |
| 195 | 409 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt) |
| r3957 | r3958 | |
| 222 | 436 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 223 | 437 | MACHINE_DRIVER_END |
| 224 | 438 | |
| 439 | /* | |
| 225 | 440 | |
| 441 | Produttore Nichibutsu | |
| 442 | N.revisione TD-1412a | |
| 443 | CPU | |
| 444 | 1x custom Nichibutsu PG14111 (DIL40)(main?) | |
| 445 | 1x custom Nichibutsu PG14112 (DIL40)(sound?) | |
| 446 | 1x custom Nichibutsu PG14113 (DIL20)(PAL) | |
| 447 | 1x custom Nichibutsu PG14114 (DIL20)(PAL) | |
| 448 | 1x custom Nichibutsu PG1411M1XBA (DIL28)(maybe it's ram) | |
| 449 | 1x oscillator 19.968MHz | |
| 450 | ROMs | |
| 451 | 7x MBM27256 | |
| 452 | 3x MBM27128 | |
| 453 | 2x PROM MB7112E | |
| 454 | Note | |
| 455 | 1x 18x2 edge connector | |
| 456 | 1x 10x2 edge connector | |
| 457 | 2x trimmer (MAIN, SUB) | |
| 458 | 2x 8 switches dip | |
| 459 | ||
| 460 | */ | |
| 461 | ||
| 462 | static MACHINE_DRIVER_START( threeds ) | |
| 463 | ||
| 464 | /* basic machine hardware */ | |
| 465 | MDRV_CPU_ADD("main", Z80, 19968000/8) /* 2.496 MHz ? */ | |
| 466 | MDRV_CPU_PROGRAM_MAP(pastelg_map,0) | |
| 467 | MDRV_CPU_IO_MAP(threeds_io_map,0) | |
| 468 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt) | |
| 469 | ||
| 470 | MDRV_MACHINE_RESET(nb1413m3) | |
| 471 | MDRV_NVRAM_HANDLER(nb1413m3) | |
| 472 | ||
| 473 | /* video hardware */ | |
| 474 | MDRV_SCREEN_ADD("main", RASTER) | |
| 475 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 476 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 477 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 478 | MDRV_SCREEN_SIZE(256, 256) | |
| 479 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 240-1) | |
| 480 | ||
| 481 | MDRV_PALETTE_LENGTH(32) | |
| 482 | ||
| 483 | MDRV_PALETTE_INIT(pastelg) | |
| 484 | MDRV_VIDEO_START(pastelg) | |
| 485 | MDRV_VIDEO_UPDATE(pastelg) | |
| 486 | ||
| 487 | /* sound hardware */ | |
| 488 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 489 | ||
| 490 | MDRV_SOUND_ADD("ay", AY8910, 1250000) | |
| 491 | MDRV_SOUND_CONFIG(ay8910_config) | |
| 492 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) | |
| 493 | ||
| 494 | MDRV_SOUND_ADD("dac", DAC, 0) | |
| 495 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 496 | MACHINE_DRIVER_END | |
| 497 | ||
| 498 | ||
| 226 | 499 | ROM_START( pastelg ) |
| 227 | 500 | ROM_REGION( 0x10000, "main", 0 ) /* program */ |
| 228 | 501 | ROM_LOAD( "pgal_09.bin", 0x00000, 0x04000, CRC(1e494af3) SHA1(1597a7da22ecfbb1df83cf9d0acc7a8be461bc2c) ) |
| r3957 | r3958 | |
| 246 | 519 | ROM_LOAD( "pgal_bp2.bin", 0x0020, 0x0020, CRC(4433021e) SHA1(e0d6619a193d26ad24788d4af5ef01ee89cffacd) ) |
| 247 | 520 | ROM_END |
| 248 | 521 | |
| 522 | ROM_START( 3ds ) | |
| 523 | ROM_REGION( 0x10000, "main", 0 ) /* program */ | |
| 524 | ROM_LOAD( "up9.9a", 0x00000, 0x04000, CRC(bc0e7cfd) SHA1(4e84f573fb2c1228757d34b8bc69649b145d9707) ) | |
| 525 | ROM_LOAD( "up10.10a", 0x04000, 0x04000, CRC(e185d9f5) SHA1(98d4a824ed6a89e42543fb87daed33ef606bcced) ) | |
| 526 | ROM_LOAD( "up11.11a", 0x08000, 0x04000, CRC(d1fb728b) SHA1(46e8e6ccdc1b78da29c969cd9290158c96bac4c4) ) | |
| 249 | 527 | |
| 528 | ROM_REGION( 0x08000, "voice", ROMREGION_ERASE00 ) /* voice */ | |
| 529 | ||
| 530 | ROM_REGION( 0x38000, "gfx1", 0 ) /* gfx */ | |
| 531 | ROM_LOAD( "1.1a", 0x00000, 0x08000, CRC(5734ca7d) SHA1(d22b9e604cc4e2c0bb4eb32ded06bb5fa519965f) ) | |
| 532 | ROM_LOAD( "2.2a", 0x08000, 0x08000, CRC(c7f21718) SHA1(4b2956d499e4db63e7f2329420e3d0313e6360ed) ) | |
| 533 | ROM_LOAD( "3.3a", 0x10000, 0x08000, CRC(87bd0a9e) SHA1(a0443017ef4c19f0135c4f764a96457f02cda743) ) | |
| 534 | ROM_LOAD( "4.4a", 0x18000, 0x08000, CRC(b75ecf2b) SHA1(50b8f27988dd24ff475a500d361db3c7a7051f40) ) | |
| 535 | ROM_LOAD( "5.5a", 0x20000, 0x08000, CRC(22ee5cf6) SHA1(09725a73f5f107e6fcb1994d94a50748726318b0) ) | |
| 536 | ROM_LOAD( "6.6a", 0x28000, 0x08000, CRC(d86ebe8d) SHA1(2ede43899501ae27db26b48f53f010a4f0df0307) ) | |
| 537 | ROM_LOAD( "7.7a", 0x30000, 0x08000, CRC(6704950a) SHA1(fd60ff2351deb87f19e517cfaedc7ac3dd4aac8d) ) | |
| 538 | ||
| 539 | ROM_REGION( 0x0040, "proms", 0 ) /* color */ | |
| 540 | ROM_LOAD( "mb7112e.7h", 0x0000, 0x0020, CRC(2c4f7343) SHA1(7b069c4a4d68ef308d1c1f773ece4b124428da3f) ) | |
| 541 | ROM_LOAD( "mb7112e.7j", 0x0020, 0x0020, CRC(181f2a88) SHA1(a75ea981127fc667bb6b9f2ae2766aa2147ff04a) ) | |
| 542 | ROM_END | |
| 543 | ||
| 544 | ||
| 250 | 545 | GAME( 1985, pastelg, 0, pastelg, pastelg, pastelg, ROT0, "Nichibutsu", "Pastel Gal (Japan 851224)", 0 ) |
| 546 | GAME( 1985, 3ds, 0, threeds, threeds, pastelg, ROT0, "Nihon Bussan", "Three Ds - Three Dealers Casino House", GAME_IMPERFECT_GRAPHICS ) | |
| 251 | 547 |
| r3957 | r3958 | |
|---|---|---|
| 511 | 511 | galileo.timer[3].timer = timer_alloc(machine, galileo_timer_callback, NULL); |
| 512 | 512 | |
| 513 | 513 | /* set the fastest DRC options, but strict verification */ |
| 514 | c | |
| 514 | device | |
| 515 | 515 | |
| 516 | 516 | /* configure fast RAM regions for DRC */ |
| 517 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 518 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 519 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); | |
| 520 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); | |
| 521 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 517 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 518 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 519 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); | |
| 520 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); | |
| 521 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 522 | 522 | |
| 523 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 524 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 525 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 526 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 527 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 523 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 524 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 525 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 526 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 527 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 528 | 528 | |
| 529 | 529 | /* register for save states */ |
| 530 | 530 | state_save_register_global_array(machine, galileo.reg); |
| r3957 | r3958 | |
| 2813 | 2813 | |
| 2814 | 2814 | static void add_speedup(running_machine *machine, offs_t pc, UINT32 op) |
| 2815 | 2815 | { |
| 2816 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); | |
| 2817 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); | |
| 2818 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); | |
| 2819 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); | |
| 2816 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); | |
| 2817 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); | |
| 2818 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); | |
| 2819 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); | |
| 2820 | 2820 | } |
| 2821 | 2821 | |
| 2822 | 2822 |
| r3957 | r3958 | |
|---|---|---|
| 84 | 84 | **************************************************************************/ |
| 85 | 85 | |
| 86 | 86 | #include "driver.h" |
| 87 | #include "cpu/z80/z80.h" | |
| 87 | 88 | #include "cpu/mcs48/mcs48.h" |
| 88 | 89 | #include "sound/5220intf.h" |
| 89 | 90 |
| r3957 | r3958 | |
|---|---|---|
| 72 | 72 | ***************************************************************************/ |
| 73 | 73 | |
| 74 | 74 | #include "driver.h" |
| 75 | #include "cpu/z80/z80.h" | |
| 75 | 76 | #include "sound/ay8910.h" |
| 76 | 77 | |
| 77 | 78 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | **************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "cpu/tms34010/tms34010.h" |
| 11 | 12 | #include "video/tlc34076.h" |
| 12 | 13 | #include "btoads.h" |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | ***************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "cpu/m68000/m68000.h" | |
| 37 | 38 | #include "sound/okim6295.h" |
| 38 | 39 | #include "sound/ymz280b.h" |
| 39 | 40 | #include "rocknms.lh" |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | **************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/z80/z80.h" | |
| 21 | #include "cpu/m68000/m68000.h" | |
| 20 | 22 | #include "deprecat.h" |
| 21 | 23 | #include "sound/2203intf.h" |
| 22 | 24 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 183 | 183 | ***************************************************************************/ |
| 184 | 184 | |
| 185 | 185 | #include "driver.h" |
| 186 | #include "cpu/m68000/m68000.h" | |
| 186 | 187 | #include "deprecat.h" |
| 187 | 188 | #include "cpu/z80/z80.h" |
| 188 | 189 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/m68000/m68000.h" | |
| 38 | 39 | #include "cpu/pic16c5x/pic16c5x.h" |
| 39 | 40 | #include "sound/okim6295.h" |
| 40 | 41 | #include "includes/drgnmst.h" |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/m6502/m6502.h" | |
| 12 | 13 | |
| 13 | 14 | #define MASTER_CLOCK XTAL_12_096MHz |
| 14 | 15 |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | ***************************************************************************/ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "cpu/z80/z80.h" | |
| 48 | 49 | #include "includes/starfire.h" |
| 49 | 50 | |
| 50 | 51 |
| r3957 | r3958 | |
|---|---|---|
| 99 | 99 | ***************************************************************************/ |
| 100 | 100 | |
| 101 | 101 | #include "driver.h" |
| 102 | #include "cpu/m68000/m68000.h" | |
| 102 | 103 | #include "deprecat.h" |
| 103 | 104 | #include "sound/okim6295.h" |
| 104 | 105 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 157 | 158 | } |
| 158 | 159 | }; |
| 159 | 160 | |
| 160 | static void microtouch_tx(UINT8 data) | |
| 161 | static void microtouch_tx(running_machine *machine, UINT8 data) | |
| 161 | 162 | { |
| 162 | 163 | duart68681_rx_data(tmaster_devices.duart68681, 0, data); |
| 163 | 164 | } |
| r3957 | r3958 | |
| 764 | 765 | |
| 765 | 766 | static const duart68681_config tmaster_duart68681_config = |
| 766 | 767 | { |
| 767 | ||
| 768 | ||
| 768 | 769 | duart_irq_handler, |
| 769 | 770 | duart_tx, |
| 770 | 771 | NULL, |
| r3957 | r3958 | |
| 779 | 780 | MDRV_MACHINE_START(tmaster) |
| 780 | 781 | MDRV_MACHINE_RESET(tmaster) |
| 781 | 782 | |
| 782 | MDRV_DEVICE_ADD( "duart68681", DUART68681 ) | |
| 783 | MDRV_DEVICE_CONFIG( tmaster_duart68681_config ) | |
| 783 | MDRV_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2 /*??*/, tmaster_duart68681_config ) | |
| 784 | 784 | |
| 785 | 785 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 786 | 786 | |
| r3957 | r3958 | |
| 832 | 832 | memory_set_bank(machine, 2, 0); // ram |
| 833 | 833 | memory_set_bank(machine, 4, 0); // ram |
| 834 | 834 | |
| 835 | c | |
| 835 | device | |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | static MACHINE_DRIVER_START( galgames ) |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | VSync: 60Hz |
| 35 | 35 | HSync: 15.15kHz |
| 36 | 36 | |
| 37 | This appears to be based off a Blue | |
| 38 | Dyna Cherry Master board -- emualted goldstar.c | |
| 39 | but with extra protection (the sub-board with CPU) | |
| 40 | ||
| 37 | 41 | */ |
| 38 | 42 | |
| 39 | 43 | #include "driver.h" |
| 44 | #include "cpu/z80/z80.h" | |
| 40 | 45 | #include "machine/8255ppi.h" |
| 41 | 46 | #include "sound/ay8910.h" |
| 42 | 47 |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/z80/z80.h" | |
| 29 | 30 | #include "machine/8255ppi.h" |
| 30 | 31 | #include "machine/mc8123.h" |
| 31 | 32 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
| 65 | 66 | { |
| 66 | 67 | /* flip Y/X could be the other way round... */ |
| 67 | 68 | if (offset) |
| 68 | flip_screen_y_set(~data & 1); | |
| 69 | flip_screen_y_set(space->machine, ~data & 1); | |
| 69 | 70 | else |
| 70 | flip_screen_x_set(~data & 1); | |
| 71 | flip_screen_x_set(space->machine, ~data & 1); | |
| 71 | 72 | } |
| 72 | 73 | |
| 73 | 74 | static WRITE8_HANDLER( coin_w ) |
| r3957 | r3958 | |
|---|---|---|
| 168 | 168 | ***************************************************************************/ |
| 169 | 169 | |
| 170 | 170 | #include "driver.h" |
| 171 | #include "cpu/m68000/m68000.h" | |
| 171 | 172 | #include "deprecat.h" |
| 172 | 173 | #include "megasys1.h" |
| 173 | 174 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 1777 | 1778 | MDRV_CPU_PROGRAM_MAP(bigrun_sound_readmem,bigrun_sound_writemem) |
| 1778 | 1779 | MDRV_CPU_VBLANK_INT_HACK(irq4_line_hold,CISCHEAT_SOUND_INTERRUPT_NUM) |
| 1779 | 1780 | |
| 1780 | MDRV_ | |
| 1781 | MDRV_QUANTUM_TIME | |
| 1781 | 1782 | |
| 1782 | 1783 | /* video hardware */ |
| 1783 | 1784 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
|---|---|---|
| 1109 | 1109 | */ |
| 1110 | 1110 | |
| 1111 | 1111 | #include "driver.h" |
| 1112 | #include "cpu/m68000/m68000.h" | |
| 1112 | 1113 | #include "deprecat.h" |
| 1113 | 1114 | #include "namcos22.h" |
| 1114 | 1115 | #include "cpu/tms32025/tms32025.h" |
| r3957 | r3958 | |
| 2790 | 2791 | MDRV_CPU_IO_MAP( mcu_io, 0 ) |
| 2791 | 2792 | MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 3) |
| 2792 | 2793 | |
| 2793 | MDRV_ | |
| 2794 | MDRV_QUANTUM_TIME | |
| 2794 | 2795 | |
| 2795 | 2796 | MDRV_NVRAM_HANDLER(namcos22) |
| 2796 | 2797 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6502/m6502.h" | |
| 8 | 9 | |
| 9 | 10 | #define MASTER_CLOCK ( XTAL_12_096MHz ) |
| 10 | 11 | |
| r3957 | r3958 | |
| 72 | 73 | |
| 73 | 74 | for (i = 0; i < 0x1000; i++) |
| 74 | 75 | rombase[i] = ROM[i ^ 0x1ff]; |
| 75 | c | |
| 76 | device | |
| 76 | 77 | |
| 77 | 78 | timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), NULL, 0, flyball_quarter_callback); |
| 78 | 79 | } |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/z80/z80.h" | |
| 24 | 25 | |
| 25 | 26 | |
| 26 | 27 | extern WRITE8_HANDLER( redclash_videoram_w ); |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | ****************************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/z80/z80.h" | |
| 56 | #include "cpu/i8085/i8085.h" | |
| 55 | 57 | #include "vicdual.h" |
| 56 | 58 | |
| 57 | 59 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "xybots.h" |
| r3957 | r3958 | |
| 383 | 384 | static DRIVER_INIT( xybots ) |
| 384 | 385 | { |
| 385 | 386 | atarigen_eeprom_default = NULL; |
| 386 | atarigen_slapstic_init(machine | |
| 387 | atarigen_slapstic_init(machine->cpu[0], 0x008000, 0, 107); | |
| 387 | 388 | atarijsa_init(machine, "FFE200", 0x0100); |
| 388 | 389 | } |
| 389 | 390 |
| r3957 | r3958 | |
|---|---|---|
| 331 | 331 | MDRV_CPU_PROGRAM_MAP(speglsht_mem,0) |
| 332 | 332 | MDRV_CPU_VBLANK_INT("main", irq4_gen) |
| 333 | 333 | |
| 334 | MDRV_ | |
| 334 | MDRV_QUANTUM_TIME | |
| 335 | 335 | MDRV_MACHINE_RESET(speglsht) |
| 336 | 336 | |
| 337 | 337 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 823 | 823 | MDRV_VIDEO_START(satansat) |
| 824 | 824 | MDRV_VIDEO_UPDATE(rockola) |
| 825 | 825 | |
| 826 | MDRV_ | |
| 826 | MDRV_M | |
| 827 | 827 | |
| 828 | 828 | // sound hardware |
| 829 | 829 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
| 898 | 898 | MDRV_VIDEO_START(rockola) |
| 899 | 899 | MDRV_VIDEO_UPDATE(rockola) |
| 900 | 900 | |
| 901 | MDRV_ | |
| 901 | MDRV_M | |
| 902 | 902 | |
| 903 | 903 | // sound hardware |
| 904 | 904 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 396 | 396 | #define MASTER_CLOCK XTAL_10MHz |
| 397 | 397 | |
| 398 | 398 | #include "driver.h" |
| 399 | #include "cpu/m6502/m6502.h" | |
| 399 | 400 | #include "video/mc6845.h" |
| 400 | 401 | #include "sound/dac.h" |
| 401 | 402 | |
| r3957 | r3958 | |
| 757 | 758 | MDRV_VIDEO_START(magicfly) |
| 758 | 759 | MDRV_VIDEO_UPDATE(magicfly) |
| 759 | 760 | |
| 760 | MDRV_ | |
| 761 | MDRV_M | |
| 761 | 762 | |
| 762 | 763 | /* sound hardware */ |
| 763 | 764 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 417 | 417 | ***************************************************************************/ |
| 418 | 418 | |
| 419 | 419 | #include "driver.h" |
| 420 | #include "cpu/m6502/m6502.h" | |
| 420 | 421 | #include "cpu/s2650/s2650.h" |
| 421 | 422 | #include "machine/atari_vg.h" |
| 422 | 423 | #include "centiped.h" |
| r3957 | r3958 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | #include "driver.h" |
| 120 | #include "cpu/m68000/m68000.h" | |
| 121 | #include "cpu/m6502/m6502.h" | |
| 120 | 122 | #include "machine/atarigen.h" |
| 121 | 123 | #include "machine/6522via.h" |
| 122 | 124 | #include "atarisy1.h" |
| r3957 | r3958 | |
| 2146 | 2148 | static DRIVER_INIT( marble ) |
| 2147 | 2149 | { |
| 2148 | 2150 | atarigen_eeprom_default = NULL; |
| 2149 | atarigen_slapstic_init(machine | |
| 2151 | atarigen_slapstic_init(machine->cpu[0], 0x080000, 0, 103); | |
| 2150 | 2152 | |
| 2151 | 2153 | joystick_type = 0; /* none */ |
| 2152 | 2154 | trackball_type = 1; /* rotated */ |
| r3957 | r3958 | |
| 2156 | 2158 | static DRIVER_INIT( peterpak ) |
| 2157 | 2159 | { |
| 2158 | 2160 | atarigen_eeprom_default = NULL; |
| 2159 | atarigen_slapstic_init(machine | |
| 2161 | atarigen_slapstic_init(machine->cpu[0], 0x080000, 0, 107); | |
| 2160 | 2162 | |
| 2161 | 2163 | joystick_type = 1; /* digital */ |
| 2162 | 2164 | trackball_type = 0; /* none */ |
| r3957 | r3958 | |
| 2166 | 2168 | static DRIVER_INIT( indytemp ) |
| 2167 | 2169 | { |
| 2168 | 2170 | atarigen_eeprom_default = NULL; |
| 2169 | atarigen_slapstic_init(machine | |
| 2171 | atarigen_slapstic_init(machine->cpu[0], 0x080000, 0, 105); | |
| 2170 | 2172 | |
| 2171 | 2173 | joystick_type = 1; /* digital */ |
| 2172 | 2174 | trackball_type = 0; /* none */ |
| r3957 | r3958 | |
| 2176 | 2178 | static DRIVER_INIT( roadrunn ) |
| 2177 | 2179 | { |
| 2178 | 2180 | atarigen_eeprom_default = NULL; |
| 2179 | atarigen_slapstic_init(machine | |
| 2181 | atarigen_slapstic_init(machine->cpu[0], 0x080000, 0, 108); | |
| 2180 | 2182 | |
| 2181 | 2183 | joystick_type = 2; /* analog */ |
| 2182 | 2184 | trackball_type = 0; /* none */ |
| r3957 | r3958 | |
| 2186 | 2188 | static DRIVER_INIT( roadb109 ) |
| 2187 | 2189 | { |
| 2188 | 2190 | atarigen_eeprom_default = NULL; |
| 2189 | atarigen_slapstic_init(machine | |
| 2191 | atarigen_slapstic_init(machine->cpu[0], 0x080000, 0, 109); | |
| 2190 | 2192 | |
| 2191 | 2193 | joystick_type = 3; /* pedal */ |
| 2192 | 2194 | trackball_type = 2; /* steering wheel */ |
| r3957 | r3958 | |
| 2196 | 2198 | static DRIVER_INIT( roadb110 ) |
| 2197 | 2199 | { |
| 2198 | 2200 | atarigen_eeprom_default = NULL; |
| 2199 | atarigen_slapstic_init(machine | |
| 2201 | atarigen_slapstic_init(machine->cpu[0], 0x080000, 0, 110); | |
| 2200 | 2202 | |
| 2201 | 2203 | joystick_type = 3; /* pedal */ |
| 2202 | 2204 | trackball_type = 2; /* steering wheel */ |
| r3957 | r3958 | |
|---|---|---|
| 394 | 394 | ***************************************************************************/ |
| 395 | 395 | |
| 396 | 396 | #include "driver.h" |
| 397 | #include "cpu/z80/z80.h" | |
| 397 | 398 | #include "taitoipt.h" |
| 398 | 399 | #include "cpu/m68000/m68000.h" |
| 399 | 400 | #include "video/taitoic.h" |
| r3957 | r3958 | |
| 969 | 970 | MDRV_MACHINE_START(wgp) |
| 970 | 971 | MDRV_MACHINE_RESET(wgp) |
| 971 | 972 | |
| 972 | MDRV_ | |
| 973 | MDRV_QUANTUM_TIME | |
| 973 | 974 | |
| 974 | 975 | /* video hardware */ |
| 975 | 976 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 1000 | 1001 | static MACHINE_DRIVER_START( wgp2 ) |
| 1001 | 1002 | MDRV_IMPORT_FROM(wgp) |
| 1002 | 1003 | |
| 1003 | MDRV_ | |
| 1004 | MDRV_QUANTUM_TIME | |
| 1004 | 1005 | /* video hardware */ |
| 1005 | 1006 | MDRV_VIDEO_START(wgp2) |
| 1006 | 1007 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 350 | 350 | |
| 351 | 351 | MDRV_PALETTE_LENGTH(512) |
| 352 | 352 | MDRV_MACHINE_RESET( turbosub ) |
| 353 | MDRV_ | |
| 353 | MDRV_QUANTUM_TIME | |
| 354 | 354 | |
| 355 | 355 | MDRV_VIDEO_START(turbosub) |
| 356 | 356 | MDRV_VIDEO_UPDATE(turbosub) |
| r3957 | r3958 | |
|---|---|---|
| 313 | 313 | #define WELLTRIS_4P_HACK 0 |
| 314 | 314 | |
| 315 | 315 | #include "driver.h" |
| 316 | #include "cpu/z80/z80.h" | |
| 317 | #include "cpu/m68000/m68000.h" | |
| 316 | 318 | #include "sound/2610intf.h" |
| 317 | 319 | |
| 318 | 320 | UINT16 *welltris_spriteram; |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6800/m6800.h" | |
| 8 | 9 | #include "includes/sprint8.h" |
| 9 | 10 | |
| 10 | 11 | static int steer_dir[8]; |
| r3957 | r3958 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | */ |
| 77 | 77 | #include "driver.h" |
| 78 | #include "cpu/z80/z80.h" | |
| 78 | 79 | #include "deprecat.h" |
| 79 | 80 | #include "sound/ay8910.h" |
| 80 | 81 | |
| r3957 | r3958 | |
| 143 | 144 | flipy=spriteram[offs+1]&0x80; |
| 144 | 145 | |
| 145 | 146 | |
| 146 | if (flip_screen_x_get()) | |
| 147 | if (flip_screen_x_get(screen->machine)) | |
| 147 | 148 | { |
| 148 | 149 | sx = 224 - sx; |
| 149 | 150 | flipx ^= 0x40; |
| 150 | 151 | } |
| 151 | 152 | |
| 152 | if (flip_screen_y_get()) | |
| 153 | if (flip_screen_y_get(screen->machine)) | |
| 153 | 154 | { |
| 154 | 155 | flipy ^= 0x80; |
| 155 | 156 | sy = 224 - sy; |
| r3957 | r3958 | |
| 242 | 243 | |
| 243 | 244 | static WRITE8_HANDLER(flip_w) |
| 244 | 245 | { |
| 245 | flip_screen_set(data); | |
| 246 | flip_screen_set(space->machine, data); | |
| 246 | 247 | } |
| 247 | 248 | |
| 248 | 249 |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | */ |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/m68000/m68000.h" | |
| 45 | 46 | #include "sound/okim6295.h" |
| 46 | 47 | |
| 47 | 48 | UINT16 *gumbo_bg_videoram; |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | */ |
| 80 | 80 | |
| 81 | 81 | #include "driver.h" |
| 82 | #include "cpu/z80/z80.h" | |
| 82 | 83 | #include "machine/8255ppi.h" |
| 83 | 84 | #include "machine/ticket.h" |
| 84 | 85 | #include "sound/dac.h" |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/m6502/m6502.h" | |
| 53 | 54 | #include "deprecat.h" |
| 54 | 55 | #include "sound/ay8910.h" |
| 55 | 56 | #include "includes/btime.h" |
| r3957 | r3958 | |
|---|---|---|
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | 45 | #include "driver.h" |
| 46 | #include "cpu/m68000/m68000.h" | |
| 46 | 47 | #include "cpu/m6502/m6502.h" |
| 47 | 48 | #include "cpu/h6280/h6280.h" |
| 48 | 49 | #include "dec0.h" |
| r3957 | r3958 | |
| 983 | 984 | MDRV_CPU_ADD("sub", H6280,21477200/16) /* 21.4772MHz clock */ |
| 984 | 985 | MDRV_CPU_PROGRAM_MAP(robocop_sub_readmem,robocop_sub_writemem) |
| 985 | 986 | |
| 986 | MDRV_ | |
| 987 | MDRV_QUANTUM_TIME | |
| 987 | 988 | |
| 988 | 989 | /* video hardware */ |
| 989 | 990 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 1072 | 1073 | MDRV_CPU_ADD("sub", H6280,21477200/16) /* 21.4772MHz clock */ |
| 1073 | 1074 | MDRV_CPU_PROGRAM_MAP(hippodrm_sub_readmem,hippodrm_sub_writemem) |
| 1074 | 1075 | |
| 1075 | MDRV_ | |
| 1076 | MDRV_QUANTUM_TIME | |
| 1076 | 1077 | |
| 1077 | 1078 | /* video hardware */ |
| 1078 | 1079 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 180 | 180 | ***************************************************************************/ |
| 181 | 181 | |
| 182 | 182 | #include "driver.h" |
| 183 | #include "cpu/v810/v810.h" | |
| 184 | #include "cpu/v60/v60.h" | |
| 183 | 185 | #include "deprecat.h" |
| 184 | 186 | #include "machine/eeprom.h" |
| 185 | 187 | #include "sound/es5506.h" |
| r0 | r3958 | |
|---|---|---|
| 1 | /* Janshi */ | |
| 2 | ||
| 3 | /* | |
| 4 | ||
| 5 | Janshi | |
| 6 | (c)1992 Eagle | |
| 7 | ||
| 8 | CPU: 68000? -- no, it isn't, might be Z180 internal rom? | |
| 9 | Sound: AY-3-8910, M6295 | |
| 10 | Others: Battery | |
| 11 | ||
| 12 | ROMs: | |
| 13 | 1.1A [92b140a5] | |
| 14 | 2.1B [6de7e086] | |
| 15 | 3.1D [4e94d8f2] | |
| 16 | 4.1F [a5f6e3ef] | |
| 17 | 5.1H [ff2cc769] | |
| 18 | 6.1K [8197034d] | |
| 19 | 11.1L [a7692ddf] | |
| 20 | ||
| 21 | ||
| 22 | ||
| 23 | --- Team Japump!!! --- | |
| 24 | Dumped by Chackn | |
| 25 | 04/May/2007 | |
| 26 | ||
| 27 | */ | |
| 28 | ||
| 29 | #include "driver.h" | |
| 30 | #include "news.h" | |
| 31 | #include "cpu/z80/z80.h" | |
| 32 | #include "sound/okim6295.h" | |
| 33 | ||
| 34 | ||
| 35 | static ADDRESS_MAP_START( mainmap, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 36 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 37 | ADDRESS_MAP_END | |
| 38 | ||
| 39 | VIDEO_START(janshi) | |
| 40 | { | |
| 41 | ||
| 42 | } | |
| 43 | ||
| 44 | VIDEO_UPDATE(janshi) | |
| 45 | { | |
| 46 | return 0; | |
| 47 | } | |
| 48 | ||
| 49 | ||
| 50 | static INPUT_PORTS_START( janshi ) | |
| 51 | INPUT_PORTS_END | |
| 52 | ||
| 53 | ||
| 54 | static const gfx_layout tiles8x8_layout = | |
| 55 | { | |
| 56 | 8,8, | |
| 57 | RGN_FRAC(1,5), | |
| 58 | 5, | |
| 59 | { RGN_FRAC(0,5),RGN_FRAC(1,5),RGN_FRAC(2,5),RGN_FRAC(3,5),RGN_FRAC(4,5) }, | |
| 60 | { 0, 1,2,3,4,5,6,7 }, | |
| 61 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 62 | 8*8 | |
| 63 | }; | |
| 64 | ||
| 65 | static GFXDECODE_START( janshi ) | |
| 66 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) | |
| 67 | GFXDECODE_END | |
| 68 | ||
| 69 | ||
| 70 | ||
| 71 | static MACHINE_DRIVER_START( janshi ) | |
| 72 | /* basic machine hardware */ | |
| 73 | MDRV_CPU_ADD("main", Z80,8000000)/*Z80? Z180?*/ /* ? MHz */ | |
| 74 | MDRV_CPU_PROGRAM_MAP(0,mainmap) | |
| 75 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 76 | ||
| 77 | /* video hardware */ | |
| 78 | MDRV_SCREEN_ADD("main", RASTER) | |
| 79 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 80 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 81 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 82 | MDRV_SCREEN_SIZE(256, 256) | |
| 83 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) | |
| 84 | ||
| 85 | MDRV_GFXDECODE(janshi) | |
| 86 | MDRV_PALETTE_LENGTH(0x100) | |
| 87 | ||
| 88 | MDRV_VIDEO_START(janshi) | |
| 89 | MDRV_VIDEO_UPDATE(janshi) | |
| 90 | ||
| 91 | /* sound hardware */ | |
| 92 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 93 | ||
| 94 | MDRV_SOUND_ADD("oki", OKIM6295, 1056000) | |
| 95 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified | |
| 96 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 97 | MACHINE_DRIVER_END | |
| 98 | ||
| 99 | ||
| 100 | ||
| 101 | ROM_START( janshi ) | |
| 102 | ROM_REGION( 0x20000, "user1", 0 ) | |
| 103 | ROM_LOAD( "11.1l", 0x00000, 0x20000, CRC(a7692ddf) SHA1(5e7f43d8337583977baf22a28bbcd9b2182c0cde) ) | |
| 104 | ||
| 105 | ROM_REGION( 0x10000, "main", 0 ) | |
| 106 | ROM_COPY( "user1", 0x10000, 0x00000, 0x4000 )// no.. is there any valid startup code, or should there be internal rom? | |
| 107 | ||
| 108 | ROM_REGION( 0x140000, "gfx1", 0 ) | |
| 109 | ROM_LOAD( "1.1a", 0x000000, 0x40000, CRC(92b140a5) SHA1(f3b38563f74650604ed0faaf84460e0b04b386b7) ) | |
| 110 | ROM_LOAD( "2.1b", 0x040000, 0x40000, CRC(6de7e086) SHA1(e87426264f0181c17383ffe0f7ec7ff5fce3d809) ) | |
| 111 | ROM_LOAD( "3.1d", 0x080000, 0x40000, CRC(4e94d8f2) SHA1(a25f542943d74915fc82910baafb9ff9db1ffd70) ) | |
| 112 | ROM_LOAD( "4.1f", 0x0c0000, 0x40000, CRC(a5f6e3ef) SHA1(f1f3d28b27eea682aa71855a311fb3abdf9af2cd) ) | |
| 113 | ROM_LOAD( "5.1h", 0x100000, 0x40000, CRC(ff2cc769) SHA1(ba4cf2923cf3d4d815a9327595f8e1801c3c8a2b) ) | |
| 114 | ||
| 115 | ROM_REGION( 0x40000, "oki", 0 ) | |
| 116 | ROM_LOAD( "6.1k", 0x00000, 0x40000, CRC(8197034d) SHA1(b501dc7a27b1faad1361c309afd726da14b8b5f5) ) | |
| 117 | ROM_END | |
| 118 | ||
| 119 | GAME( 1992, janshi, 0, janshi, janshi, 0, ROT0, "Eagle", "Janshi", GAME_NOT_WORKING ) |
| r3957 | r3958 | |
|---|---|---|
| 216 | 216 | ****************************************************************************/ |
| 217 | 217 | |
| 218 | 218 | #include "driver.h" |
| 219 | #include "cpu/z80/z80.h" | |
| 220 | #include "cpu/m68000/m68000.h" | |
| 219 | 221 | #include "taitoipt.h" |
| 220 | 222 | #include "audio/taitosnd.h" |
| 221 | 223 | #include "video/taitoic.h" |
| r3957 | r3958 | |
| 611 | 613 | MDRV_CPU_DATA_MAP(DSP_map_data, 0) |
| 612 | 614 | MDRV_CPU_IO_MAP(DSP_map_io, 0) |
| 613 | 615 | |
| 614 | MDRV_ | |
| 616 | MDRV_QUANTUM_TIME | |
| 615 | 617 | |
| 616 | 618 | MDRV_MACHINE_START(taitoair) |
| 617 | 619 |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/m68000/m68000.h" | |
| 22 | 23 | #include "machine/atarigen.h" |
| 23 | 24 | #include "machine/asic65.h" |
| 24 | 25 | #include "audio/atarijsa.h" |
| r3957 | r3958 | |
|---|---|---|
| 400 | 400 | MDRV_CPU_IO_MAP(mcu_io_map,0) |
| 401 | 401 | MDRV_CPU_VBLANK_INT("2d", mcu_vb_interrupt) |
| 402 | 402 | |
| 403 | MDRV_ | |
| 403 | MDRV_QUANTUM_TIME | |
| 404 | 404 | |
| 405 | 405 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 406 | 406 |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | ***************************************************************************/ |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/z80/z80.h" | |
| 53 | 54 | #include "sound/ay8910.h" |
| 54 | 55 | #include "sound/3812intf.h" |
| 55 | 56 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "vindictr.h" |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | ***************************************************************************/ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/z80/z80.h" | |
| 29 | 30 | #include "sound/ay8910.h" |
| 30 | 31 | |
| 31 | 32 |
| r3957 | r3958 | |
|---|---|---|
| 1619 | 1619 | static const mc6845_interface hd6845_intf = |
| 1620 | 1620 | { |
| 1621 | 1621 | "main", /* screen we are acting on */ |
| 1622 | MPU4_MASTER_CLOCK / 4 / 8, /* the clock (pin 21) of the chip (educated guess)*/ | |
| 1623 | 1622 | 8, /* number of pixels per video memory address */ |
| 1624 | 1623 | NULL, /* before pixel update callback */ |
| 1625 | 1624 | NULL, /* row update callback */ |
| r3957 | r3958 | |
| 1670 | 1669 | MDRV_CPU_PROGRAM_MAP(mpu4_68k_map,0) |
| 1671 | 1670 | MDRV_CPU_VBLANK_INT("main", mpu4_vid_irq) |
| 1672 | 1671 | |
| 1673 | MDRV_ | |
| 1672 | MDRV_QUANTUM_TIME | |
| 1674 | 1673 | |
| 1675 | 1674 | MDRV_MACHINE_START(mpu4_vid) |
| 1676 | 1675 | MDRV_MACHINE_RESET(mpu4_vid) |
| r3957 | r3958 | |
| 1690 | 1689 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.00) |
| 1691 | 1690 | |
| 1692 | 1691 | /* ACIAs */ |
| 1693 | MDRV_DEVICE_ADD("acia6850_0", ACIA6850) | |
| 1694 | MDRV_DEVICE_CONFIG(m6809_acia_if) | |
| 1695 | MDRV_DEVICE_ADD("acia6850_1", ACIA6850) | |
| 1696 | MDRV_DEVICE_CONFIG(m68k_acia_if) | |
| 1692 | MDRV_ACIA6850_ADD("acia6850_0", m6809_acia_if) | |
| 1693 | MDRV_ACIA6850_ADD("acia6850_1", m68k_acia_if) | |
| 1697 | 1694 | MACHINE_DRIVER_END |
| 1698 | 1695 | |
| 1699 | 1696 | static MACHINE_DRIVER_START( vgpoker ) |
| r3957 | r3958 | |
| 1732 | 1729 | MDRV_PALETTE_LENGTH(32) |
| 1733 | 1730 | MDRV_PALETTE_INIT(dealem) |
| 1734 | 1731 | |
| 1735 | MDRV_DEVICE_ADD("crtc", HD6845) /* HD68B45 */ | |
| 1736 | MDRV_DEVICE_CONFIG(hd6845_intf) | |
| 1732 | MDRV_MC6845_ADD("crtc", HD6845, MPU4_MASTER_CLOCK / 4 / 8, hd6845_intf) /* HD68B45 */ | |
| 1737 | 1733 | MACHINE_DRIVER_END |
| 1738 | 1734 | |
| 1739 | 1735 |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/z80/z80.h" | |
| 54 | #include "cpu/m68000/m68000.h" | |
| 53 | 55 | #include "sound/2151intf.h" |
| 54 | 56 | #include "sound/okim6295.h" |
| 55 | 57 | #include "includes/aquarium.h" |
| r3957 | r3958 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | 84 | #include "deprecat.h" |
| 85 | #include "cpu/z80/z80.h" | |
| 86 | #include "cpu/m68000/m68000.h" | |
| 85 | 87 | #include "cpu/h83002/h8.h" |
| 86 | 88 | #include "cpu/upd7810/upd7810.h" |
| 87 | 89 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 333 | 335 | static UINT16 metro_soundstatus; |
| 334 | 336 | static int porta, portb, busy_sndcpu; |
| 335 | 337 | |
| 336 | static int metro_io_callback(int ioline, int state) | |
| 338 | static int metro_io_callback(const device_config *device, int ioline, int state) | |
| 337 | 339 | { |
| 338 | const address_space *space = cpu_get_address_space( | |
| 340 | const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 339 | 341 | |
| 340 | 342 | UINT8 data = 0; |
| 341 | 343 | |
| 342 | ||
| 344 | | |
| 343 | 345 | { |
| 344 | 346 | case UPD7810_RXD: /* read the RxD line */ |
| 345 | 347 | data = soundlatch_r(space,0); |
| r3957 | r3958 | |
| 348 | 350 | break; |
| 349 | 351 | default: |
| 350 | 352 | logerror("upd7810 ioline %d not handled\n", ioline); |
| 351 | ||
| 353 | | |
| 352 | 354 | |
| 353 | 355 | return state; |
| 354 | 356 | } |
| r3957 | r3958 | |
|---|---|---|
| 68 | 68 | */ |
| 69 | 69 | |
| 70 | 70 | #include "driver.h" |
| 71 | #include "cpu/m68000/m68000.h" | |
| 71 | 72 | |
| 72 | 73 | VIDEO_START(gal3) |
| 73 | 74 | { |
| r3957 | r3958 | |
|---|---|---|
| 608 | 608 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 609 | 609 | MDRV_CPU_IO_MAP(sub_portmap,0) |
| 610 | 610 | |
| 611 | MDRV_ | |
| 611 | MDRV_QUANTUM_TIME | |
| 612 | 612 | |
| 613 | 613 | /* video hardware */ |
| 614 | 614 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 99 | 99 | ***************************************************************************/ |
| 100 | 100 | |
| 101 | 101 | #include "driver.h" |
| 102 | #include "cpu/z80/z80.h" | |
| 102 | 103 | #include "pacman.h" |
| 103 | 104 | #include "sound/namco.h" |
| 104 | 105 |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/z80/z80.h" | |
| 39 | #include "cpu/m68000/m68000.h" | |
| 38 | 40 | #include "genesis.h" |
| 39 | 41 | |
| 40 | 42 | #define MASTER_CLOCK 53693100 |
| r3957 | r3958 | |
| 139 | 141 | MDRV_CPU_PROGRAM_MAP(genesis_z80_readmem, genesis_z80_writemem) |
| 140 | 142 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* from vdp at scanline 0xe0 */ |
| 141 | 143 | |
| 142 | MDRV_ | |
| 144 | MDRV_QUANTUM_TIME | |
| 143 | 145 | |
| 144 | 146 | MDRV_MACHINE_START(genesis) |
| 145 | 147 | MDRV_MACHINE_RESET(genesis) |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | ***************************************************************************/ |
| 49 | 49 | |
| 50 | 50 | #include "driver.h" |
| 51 | #include "cpu/z80/z80.h" | |
| 51 | 52 | #include "machine/konami1.h" |
| 52 | 53 | #include "cpu/m6809/m6809.h" |
| 53 | 54 | #include "sound/dac.h" |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ********************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/z80/z80.h" | |
| 20 | 21 | #include "deprecat.h" |
| 21 | 22 | |
| 22 | 23 | static UINT8 *vram1,*vram2; |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/z80/z80.h" | |
| 20 | 21 | #include "cpu/m6809/m6809.h" |
| 21 | 22 | #include "sound/sn76496.h" |
| 22 | 23 |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/z80/z80.h" | |
| 23 | 24 | #include "video/tms9928a.h" |
| 24 | 25 | #include "sound/ay8910.h" |
| 25 | 26 |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | dcs_reset_w(0); |
| 75 | 75 | |
| 76 | 76 | memcpy(ram_base, memory_region(machine, "user1"), 0x20000*4); |
| 77 | c | |
| 77 | device | |
| 78 | 78 | |
| 79 | 79 | timer[0] = timer_alloc(machine, NULL, NULL); |
| 80 | 80 | timer[1] = timer_alloc(machine, NULL, NULL); |
| r3957 | r3958 | |
| 87 | 87 | dcs_reset_w(0); |
| 88 | 88 | |
| 89 | 89 | memcpy(ram_base, memory_region(machine, "user1"), 0x20000*4); |
| 90 | c | |
| 90 | device | |
| 91 | 91 | |
| 92 | 92 | timer[0] = timer_alloc(machine, NULL, NULL); |
| 93 | 93 | timer[1] = timer_alloc(machine, NULL, NULL); |
| r3957 | r3958 | |
| 375 | 375 | |
| 376 | 376 | static READ32_HANDLER( offroadc_serial_status_r ) |
| 377 | 377 | { |
| 378 | int status = midway_serial_pic2_status_r(); | |
| 378 | int status = midway_serial_pic2_status_r(space); | |
| 379 | 379 | return (input_port_read(space->machine, "991030") & 0x7fff7fff) | (status << 31) | (status << 15); |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | |
| 383 | 383 | static READ32_HANDLER( offroadc_serial_data_r ) |
| 384 | 384 | { |
| 385 | return midway_serial_pic2_r() << 16; | |
| 385 | return midway_serial_pic2_r(space) << 16; | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | |
| 389 | 389 | static WRITE32_HANDLER( offroadc_serial_data_w ) |
| 390 | 390 | { |
| 391 | midway_serial_pic2_w(space | |
| 391 | midway_serial_pic2_w(space | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | *************************************************************/ |
| 67 | 67 | |
| 68 | 68 | #include "driver.h" |
| 69 | #include "cpu/m68000/m68000.h" | |
| 69 | 70 | #include "video/ygv608.h" |
| 70 | 71 | #include "cpu/h83002/h8.h" |
| 71 | 72 | #include "namcond1.h" |
| r3957 | r3958 | |
| 293 | 294 | MDRV_CPU_IO_MAP( nd1h8iomap, 0 ) |
| 294 | 295 | MDRV_CPU_VBLANK_INT("main", mcu_interrupt) |
| 295 | 296 | |
| 296 | MDRV_ | |
| 297 | MDRV_QUANTUM_TIME | |
| 297 | 298 | |
| 298 | 299 | MDRV_MACHINE_START(namcond1) |
| 299 | 300 | MDRV_MACHINE_RESET(namcond1) |
| r3957 | r3958 | |
| 321 | 322 | MDRV_SOUND_ROUTE(2, "right", 1.00) |
| 322 | 323 | MDRV_SOUND_ROUTE(3, "left", 1.00) |
| 323 | 324 | |
| 324 | MDRV_ | |
| 325 | MDRV_AT28C16_ADD( "at28c16", NULL | |
| 325 | 326 | MACHINE_DRIVER_END |
| 326 | 327 | |
| 327 | 328 | ROM_START( ncv1 ) |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/m6809/m6809.h" | |
| 27 | 28 | #include "deprecat.h" |
| 28 | 29 | #include "video/mc6845.h" |
| 29 | 30 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 249 | 250 | MDRV_VIDEO_START(usgames) |
| 250 | 251 | MDRV_VIDEO_UPDATE(usgames) |
| 251 | 252 | |
| 252 | MDRV_ | |
| 253 | MDRV_M | |
| 253 | 254 | |
| 254 | 255 | /* sound hardware */ |
| 255 | 256 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 107 | 107 | #define SOUND_CPU_CLOCK (XTAL_8MHz / 2) /* clock for Z80 sound CPU */ |
| 108 | 108 | |
| 109 | 109 | #include "driver.h" |
| 110 | #include "cpu/z80/z80.h" | |
| 111 | #include "cpu/m68000/m68000.h" | |
| 110 | 112 | #include "taitoipt.h" |
| 111 | 113 | #include "video/taitoic.h" |
| 112 | 114 | #include "audio/taitosnd.h" |
| r3957 | r3958 | |
| 584 | 586 | MDRV_CPU_ADD("audio", Z80, SOUND_CPU_CLOCK ) /* 4 MHz */ |
| 585 | 587 | MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem) |
| 586 | 588 | |
| 587 | MDRV_ | |
| 589 | MDRV_QUANTUM_TIME | |
| 588 | 590 | |
| 589 | 591 | MDRV_MACHINE_START(opwolf) |
| 590 | 592 | MDRV_MACHINE_RESET(opwolf) |
| r3957 | r3958 | |
| 637 | 639 | MDRV_CPU_PROGRAM_MAP(sub_z80_readmem,sub_z80_writemem) |
| 638 | 640 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 639 | 641 | |
| 640 | MDRV_ | |
| 642 | MDRV_QUANTUM_TIME | |
| 641 | 643 | |
| 642 | 644 | MDRV_MACHINE_START(opwolf) |
| 643 | 645 |
| r3957 | r3958 | |
|---|---|---|
| 90 | 90 | */ |
| 91 | 91 | |
| 92 | 92 | #include "driver.h" |
| 93 | #include "cpu/i386/i386.h" | |
| 93 | 94 | |
| 94 | 95 | static VIDEO_START(pangofun) |
| 95 | 96 | { |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/z80/z80.h" | |
| 26 | #include "cpu/m68000/m68000.h" | |
| 25 | 27 | #include "deprecat.h" |
| 26 | 28 | #include "sound/dac.h" |
| 27 | 29 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 853 | 855 | MDRV_CPU_PROGRAM_MAP(bssoccer_pcm_2_readmem,bssoccer_pcm_2_writemem) |
| 854 | 856 | MDRV_CPU_IO_MAP(bssoccer_pcm_2_io_map,0) |
| 855 | 857 | |
| 856 | MDRV_ | |
| 858 | MDRV_QUANTUM_TIME | |
| 857 | 859 | |
| 858 | 860 | /* video hardware */ |
| 859 | 861 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 911 | 913 | |
| 912 | 914 | /* 2nd PCM Z80 missing */ |
| 913 | 915 | |
| 914 | MDRV_ | |
| 916 | MDRV_QUANTUM_TIME | |
| 915 | 917 | |
| 916 | 918 | MDRV_MACHINE_RESET(uballoon) |
| 917 | 919 | |
| r3957 | r3958 | |
| 962 | 964 | |
| 963 | 965 | /* 2nd PCM Z80 missing */ |
| 964 | 966 | |
| 965 | MDRV_ | |
| 967 | MDRV_QUANTUM_TIME | |
| 966 | 968 | |
| 967 | 969 | /* video hardware */ |
| 968 | 970 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 1034 | 1036 | |
| 1035 | 1037 | /* 2nd PCM Z80 missing */ |
| 1036 | 1038 | |
| 1037 | MDRV_ | |
| 1039 | MDRV_QUANTUM_TIME | |
| 1038 | 1040 | |
| 1039 | 1041 | /* video hardware */ |
| 1040 | 1042 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | ***************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "cpu/z80/z80.h" | |
| 38 | #include "cpu/m6800/m6800.h" | |
| 37 | 39 | #include "machine/6821pia.h" |
| 38 | 40 | #include "machine/8255ppi.h" |
| 39 | 41 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | */ |
| 79 | 79 | |
| 80 | 80 | #include "driver.h" |
| 81 | #include "deprecat.h" | |
| 81 | #include "cpu/z80/z80.h" | |
| 82 | #include "cpu/m68000/m68000.h" | |
| 82 | 83 | #include "sound/2151intf.h" |
| 83 | 84 | #include "sound/okim6295.h" |
| 84 | 85 | |
| 86 | #define MASTER_CLOCK XTAL_28MHz | |
| 87 | #define CPU_CLOCK MASTER_CLOCK / 2 | |
| 88 | #define PIXEL_CLOCK MASTER_CLOCK / 4 | |
| 89 | ||
| 85 | 90 | UINT16 *shadfrce_fgvideoram, *shadfrce_bg0videoram, *shadfrce_bg1videoram, *shadfrce_spvideoram; |
| 86 | 91 | |
| 87 | 92 | /* in video */ |
| r3957 | r3958 | |
| 98 | 103 | |
| 99 | 104 | int shadfrce_video_enable = 0; |
| 100 | 105 | static int shadfrce_irqs_enable = 0; |
| 101 | static int shadfrce_scanline = 0; | |
| 102 | static emu_timer *raster_irq_timer; | |
| 106 | static int raster_scanline = 0; | |
| 107 | static int raster_irq_enable = 0; | |
| 103 | 108 | static int vblank = 0; |
| 104 | 109 | |
| 105 | 110 | |
| 106 | 111 | static WRITE16_HANDLER( shadfrce_flip_screen ) |
| 107 | 112 | { |
| 108 | flip_screen_set(data & 0x01); | |
| 113 | flip_screen_set(space->machine, data & 0x01); | |
| 109 | 114 | } |
| 110 | 115 | |
| 111 | 116 | |
| r3957 | r3958 | |
| 229 | 234 | } |
| 230 | 235 | } |
| 231 | 236 | |
| 232 | static TIMER_CALLBACK( raster_interrupt ) | |
| 233 | { | |
| 234 | // force a screen partial update on the previous scanline | |
| 235 | if (shadfrce_scanline != 0) | |
| 236 | video_screen_update_partial(machine->primary_screen, shadfrce_scanline - 1); | |
| 237 | ||
| 238 | shadfrce_scanline = (shadfrce_scanline + 1) % 256; | |
| 239 | ||
| 240 | // fire another raster irq for the next scanline | |
| 241 | cpu_set_input_line(machine->cpu[0], 1, ASSERT_LINE); | |
| 242 | timer_adjust_oneshot(raster_irq_timer, video_screen_get_time_until_pos(machine->primary_screen, shadfrce_scanline, 0), 0); | |
| 243 | } | |
| 244 | ||
| 245 | 237 | static WRITE16_HANDLER( shadfrce_irq_ack_w ) |
| 246 | 238 | { |
| 247 | 239 | cpu_set_input_line(space->machine->cpu[0], offset ^ 3, CLEAR_LINE); |
| r3957 | r3958 | |
| 251 | 243 | { |
| 252 | 244 | static int prev_value = 0; |
| 253 | 245 | |
| 254 | shadfrce_irqs_enable = data & 1; // maybe, it's set/unset inside every trap instruction which is executed | |
| 255 | shadfrce_video_enable = data & 8; // probably | |
| 246 | shadfrce_irqs_enable = data & 1; /* maybe, it's set/unset inside every trap instruction which is executed */ | |
| 247 | shadfrce_video_enable = data & 8; /* probably */ | |
| 256 | 248 | |
| 257 | / | |
| 249 | /* check if there's a high transition to enable the raster IRQ */ | |
| 258 | 250 | if((~prev_value & 4) && (data & 4)) |
| 259 | 251 | { |
| 260 | if( !timer_enabled(raster_irq_timer) ) | |
| 261 | { | |
| 262 | timer_enable(raster_irq_timer, 1); | |
| 263 | timer_adjust_oneshot(raster_irq_timer, video_screen_get_time_until_pos(space->machine->primary_screen, shadfrce_scanline, 0), 0); | |
| 264 | } | |
| 252 | raster_irq_enable = 1; | |
| 265 | 253 | } |
| 266 | 254 | |
| 267 | / | |
| 255 | /* check if there's a low transition to disable the raster IRQ */ | |
| 268 | 256 | if((prev_value & 4) && (~data & 4)) |
| 269 | 257 | { |
| 270 | if( timer_enabled(raster_irq_timer) ) | |
| 271 | { | |
| 272 | timer_enable(raster_irq_timer, 0); | |
| 273 | } | |
| 258 | raster_irq_enable = 0; | |
| 274 | 259 | } |
| 275 | 260 | |
| 276 | 261 | prev_value = data; |
| r3957 | r3958 | |
| 278 | 263 | |
| 279 | 264 | static WRITE16_HANDLER( shadfrce_scanline_w ) |
| 280 | 265 | { |
| 281 | | |
| 266 | | |
| 282 | 267 | } |
| 283 | 268 | |
| 269 | static TIMER_DEVICE_CALLBACK( shadfrce_scanline ) | |
| 270 | { | |
| 271 | int scanline = param; | |
| 284 | 272 | |
| 273 | /* Vblank is lowered on scanline 0 */ | |
| 274 | if (scanline == 0) | |
| 275 | { | |
| 276 | vblank = 0; | |
| 277 | } | |
| 278 | /* Hack */ | |
| 279 | else if (scanline == (248-1)) /* -1 is an hack needed to avoid deadlocks */ | |
| 280 | { | |
| 281 | vblank = 4; | |
| 282 | } | |
| 285 | 283 | |
| 284 | /* Raster interrupt - Perform raster effect on given scanline */ | |
| 285 | if (raster_irq_enable) | |
| 286 | { | |
| 287 | if (scanline == raster_scanline) | |
| 288 | { | |
| 289 | raster_scanline = (raster_scanline + 1) % 240; | |
| 290 | video_screen_update_partial(timer->machine->primary_screen, raster_scanline - 1); | |
| 291 | cpu_set_input_line(timer->machine->cpu[0], 1, ASSERT_LINE); | |
| 292 | } | |
| 293 | } | |
| 294 | ||
| 295 | /* An interrupt is generated every 16 scanlines */ | |
| 296 | if (shadfrce_irqs_enable) | |
| 297 | { | |
| 298 | if (scanline % 16 == 0) | |
| 299 | { | |
| 300 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 301 | cpu_set_input_line(timer->machine->cpu[0], 2, ASSERT_LINE); | |
| 302 | } | |
| 303 | } | |
| 304 | ||
| 305 | /* Vblank is raised on scanline 248 */ | |
| 306 | if (shadfrce_irqs_enable) | |
| 307 | { | |
| 308 | if (scanline == 248) | |
| 309 | { | |
| 310 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 311 | cpu_set_input_line(timer->machine->cpu[0], 3, ASSERT_LINE); | |
| 312 | } | |
| 313 | } | |
| 314 | ||
| 315 | /* Adjust for next scanline */ | |
| 316 | if (++scanline >= video_screen_get_height(timer->machine->primary_screen)) | |
| 317 | { | |
| 318 | scanline = 0; | |
| 319 | } | |
| 320 | } | |
| 321 | ||
| 322 | ||
| 323 | ||
| 286 | 324 | /* Memory Maps */ |
| 287 | 325 | |
| 288 | 326 | static ADDRESS_MAP_START( shadfrce_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r3957 | r3958 | |
| 347 | 385 | |
| 348 | 386 | |
| 349 | 387 | static INPUT_PORTS_START( shadfrce ) |
| 350 | PORT_START("P1") /* Fake IN0 (player 1 inputs) */ | |
| 388 | PORT_START("P1") /* Fake IN0 (player 1 inputs) */ | |
| 351 | 389 | SHADFRCE_PLAYER_INPUT( 1, IPT_START1 ) |
| 352 | 390 | |
| 353 | PORT_START("P2") /* Fake IN1 (player 2 inputs) */ | |
| 391 | PORT_START("P2") /* Fake IN1 (player 2 inputs) */ | |
| 354 | 392 | SHADFRCE_PLAYER_INPUT( 2, IPT_START2 ) |
| 355 | 393 | |
| 356 | 394 | PORT_START("EXTRA") /* Fake IN2 (players 1 & 2 extra inputs */ |
| r3957 | r3958 | |
| 368 | 406 | |
| 369 | 407 | PORT_START("SYSTEM") /* Fake IN4 (system inputs) */ |
| 370 | 408 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 371 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) /* only in "test mode" ? */ | |
| 372 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* only in "test mode" ? */ | |
| 409 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) /* only in "test mode" ? */ | |
| 410 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* only in "test mode" ? */ | |
| 373 | 411 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 374 | 412 | |
| 375 | 413 | PORT_START("MISC") /* Fake IN5 (misc) */ |
| 376 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) /* guess */ | |
| 377 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* must be ACTIVE_LOW or 'shadfrcj' jumps to the end (code at 0x04902e) */ | |
| 414 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) /* guess */ | |
| 415 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* must be ACTIVE_LOW or 'shadfrcj' jumps to the end (code at 0x04902e) */ | |
| 378 | 416 | PORT_BIT( 0xeb, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 379 | 417 | |
| 380 | 418 | PORT_START("DSW1") /* Fake IN6 (DIP1) */ |
| r3957 | r3958 | |
| 478 | 516 | irq_handler |
| 479 | 517 | }; |
| 480 | 518 | |
| 481 | /* | |
| 482 | Interrupts generation is guessed, but it requires the same hack as in wwfsstar.c | |
| 483 | */ | |
| 484 | static INTERRUPT_GEN( shadfrce_interrupt ) | |
| 485 | { | |
| 486 | int scanline = 255 - cpu_getiloops(device); | |
| 487 | ||
| 488 | /* Vblank is lowered on scanline 0 (8) */ | |
| 489 | if (scanline == 0) | |
| 490 | { | |
| 491 | vblank = 0; | |
| 492 | } | |
| 493 | /* Hack */ | |
| 494 | else if (scanline==(248-1)) | |
| 495 | { | |
| 496 | vblank = 4; | |
| 497 | } | |
| 498 | /* Vblank is raised on scanline 248 (256) */ | |
| 499 | else if (scanline==248) | |
| 500 | { | |
| 501 | if(shadfrce_irqs_enable) | |
| 502 | cpu_set_input_line(device, 3, ASSERT_LINE); | |
| 503 | } | |
| 504 | ||
| 505 | /* An interrupt is generated every 16 scanlines */ | |
| 506 | if (scanline%16 == 0) | |
| 507 | { | |
| 508 | if(shadfrce_irqs_enable) | |
| 509 | cpu_set_input_line(device, 2, ASSERT_LINE); | |
| 510 | } | |
| 511 | } | |
| 512 | ||
| 513 | static MACHINE_RESET( shadfrce ) | |
| 514 | { | |
| 515 | raster_irq_timer = timer_alloc(machine, raster_interrupt, NULL); | |
| 516 | timer_enable(raster_irq_timer, 0); | |
| 517 | shadfrce_scanline = 0; | |
| 518 | } | |
| 519 | ||
| 520 | 519 | static MACHINE_DRIVER_START( shadfrce ) |
| 521 | MDRV_CPU_ADD("main", M68000, | |
| 520 | MDRV_CPU_ADD("main", M68000, CPU | |
| 522 | 521 | MDRV_CPU_PROGRAM_MAP(shadfrce_map,0) |
| 523 | MDRV_ | |
| 522 | MDRV_TIMER_ | |
| 524 | 523 | |
| 525 | MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) /* verified on pcb */ | |
| 524 | MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) /* verified on pcb */ | |
| 526 | 525 | MDRV_CPU_PROGRAM_MAP(shadfrce_sound_map,0) |
| 527 | 526 | |
| 528 | MDRV_MACHINE_RESET(shadfrce) | |
| 529 | ||
| 530 | 527 | MDRV_SCREEN_ADD("main", RASTER) |
| 531 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 532 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 533 | 528 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 534 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 535 | MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) | |
| 529 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 432, 0, 320, 272, 8, 248) /* HTOTAL and VTOTAL are guessed */ | |
| 536 | 530 | |
| 537 | 531 | MDRV_GFXDECODE(shadfrce) |
| 538 | 532 | MDRV_PALETTE_LENGTH(0x4000) |
| r3957 | r3958 | |
| 544 | 538 | /* sound hardware */ |
| 545 | 539 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 546 | 540 | |
| 547 | MDRV_SOUND_ADD("ym", YM2151, XTAL_3_579545MHz) /* verified on pcb */ | |
| 541 | MDRV_SOUND_ADD("ym", YM2151, XTAL_3_579545MHz) /* verified on pcb */ | |
| 548 | 542 | MDRV_SOUND_CONFIG(ym2151_config) |
| 549 | 543 | MDRV_SOUND_ROUTE(0, "left", 0.50) |
| 550 | 544 | MDRV_SOUND_ROUTE(1, "right", 0.50) |
| 551 | 545 | |
| 552 | MDRV_SOUND_ADD("oki", OKIM6295, XTAL_13_4952MHz/8) /* verified on pcb */ | |
| 553 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) /* verified on pcb, pin7 is at 2.4v */ | |
| 546 | MDRV_SOUND_ADD("oki", OKIM6295, XTAL_13_4952MHz/8) /* verified on pcb */ | |
| 547 | MDRV_SOUND_CONFIG(okim6295_interface_pin7high) /* verified on pcb, pin7 is at 2.4v */ | |
| 554 | 548 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50) |
| 555 | 549 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50) |
| 556 | 550 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 51 | 51 | ***************************************************************************/ |
| 52 | 52 | |
| 53 | 53 | #include "driver.h" |
| 54 | #include "cpu/z80/z80.h" | |
| 54 | 55 | #include "deprecat.h" |
| 55 | 56 | #include "sound/3812intf.h" |
| 56 | 57 | |
| r3957 | r3958 | |
| 67 | 68 | { |
| 68 | 69 | coin_counter_w(0, data & 0x80); |
| 69 | 70 | coin_counter_w(1, data & 0x40); |
| 70 | flip_screen_set(data & 8); // also changes data & 0x10 at the same time too (flipx and flipy?) | |
| 71 | flip_screen_set(space->machine, data & 8); // also changes data & 0x10 at the same time too (flipx and flipy?) | |
| 71 | 72 | /* unknown: (data & 0x10) and (data & 4) */ |
| 72 | 73 | } |
| 73 | 74 |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | *******************************************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/z80/z80.h" | |
| 55 | 56 | #include "machine/eeprom.h" |
| 56 | 57 | #include "sound/ay8910.h" |
| 57 | 58 | |
| r3957 | r3958 | |
| 202 | 203 | { |
| 203 | 204 | switch(address) |
| 204 | 205 | { |
| 205 | case 0x0d: flip_screen_set(data & 0x80); break; | |
| 206 | case 0x0d: flip_screen_set(space->machine, data & 0x80); break; | |
| 206 | 207 | default: |
| 207 | 208 | logerror("Video Register %02x called with %02x data\n",address,data); |
| 208 | 209 | } |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | /* Jongkyo */ |
| 2 | 2 | #include "driver.h" |
| 3 | #include "cpu/z80/z80.h" | |
| 3 | 4 | #include "sound/ay8910.h" |
| 4 | 5 | #include "machine/segacrpt.h" |
| 5 | 6 |
| r3957 | r3958 | |
|---|---|---|
| 43 | 43 | ****************************************/ |
| 44 | 44 | |
| 45 | 45 | #include "driver.h" |
| 46 | #include "cpu/m6502/m6502.h" | |
| 46 | 47 | #include "includes/attckufo.h" |
| 47 | 48 | |
| 48 | 49 |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | */ |
| 60 | 60 | |
| 61 | 61 | #include "driver.h" |
| 62 | #include "cpu/m68000/m68000.h" | |
| 62 | 63 | |
| 63 | 64 | static UINT16 littlerb_vdp_address_low; |
| 64 | 65 | static UINT16 littlerb_vdp_address_high; |
| r3957 | r3958 | |
|---|---|---|
| 109 | 109 | */ |
| 110 | 110 | |
| 111 | 111 | #include "driver.h" |
| 112 | #include " | |
| 112 | #include " | |
| 113 | 113 | #include "cpu/powerpc/ppc.h" |
| 114 | 114 | #include "machine/intelfsh.h" |
| 115 | 115 | #include "machine/scsicd.h" |
| r3957 | r3958 | |
| 884 | 884 | atapi_cdata_wait = 0; |
| 885 | 885 | |
| 886 | 886 | // allocate two SCSI CD-ROM devices |
| 887 | SCSIAllocInstance( SCSI_DEVICE_CDROM, &atapi_device_data[0], "scsi0" ); | |
| 887 | SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &atapi_device_data[0], "scsi0" ); | |
| 888 | 888 | // TODO: the slave drive can be either CD-ROM, DVD-ROM or HDD |
| 889 | SCSIAllocInstance( SCSI_DEVICE_CDROM, &atapi_device_data[1], "scsi1" ); | |
| 889 | SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &atapi_device_data[1], "scsi1" ); | |
| 890 | 890 | add_exit_callback(machine, atapi_exit); |
| 891 | 891 | } |
| 892 | 892 | |
| r3957 | r3958 | |
| 1764 | 1764 | static MACHINE_START( firebeat ) |
| 1765 | 1765 | { |
| 1766 | 1766 | /* set conservative DRC options */ |
| 1767 | c | |
| 1767 | device | |
| 1768 | 1768 | |
| 1769 | 1769 | /* configure fast RAM regions for DRC */ |
| 1770 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 1771 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 1772 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x01ffffff); | |
| 1773 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 1774 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 1770 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 1771 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 1772 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x01ffffff); | |
| 1773 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 1774 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 1775 | 1775 | } |
| 1776 | 1776 | |
| 1777 | 1777 | static ADDRESS_MAP_START( firebeat_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r3957 | r3958 | |
| 2252 | 2252 | return r; |
| 2253 | 2253 | } |
| 2254 | 2254 | |
| 2255 | static void security_w(UINT8 data) | |
| 2255 | static void security_w(const device_config *device, UINT8 data) | |
| 2256 | 2256 | { |
| 2257 | 2257 | int r = ibutton_w(data); |
| 2258 | 2258 | if (r >= 0) |
| 2259 | ppc4xx_spu_receive_byte( | |
| 2259 | ppc4xx_spu_receive_byte(device->machine->cpu[0], r); | |
| 2260 | 2260 | } |
| 2261 | 2261 | |
| 2262 | 2262 | /*****************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ****************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/z80/z80.h" | |
| 16 | 17 | #include "machine/8255ppi.h" |
| 17 | 18 | |
| 18 | 19 |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | *********************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/e132xs/e132xs.h" | |
| 55 | 56 | #include "deprecat.h" |
| 56 | 57 | #include "machine/eeprom.h" |
| 57 | 58 |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | ***************************************************************************/ |
| 57 | 57 | |
| 58 | 58 | #include "driver.h" |
| 59 | #include "cpu/z80/z80.h" | |
| 59 | 60 | #include "deprecat.h" |
| 60 | 61 | #include "sound/ay8910.h" |
| 61 | 62 | #include "sound/msm5232.h" |
| r3957 | r3958 | |
| 445 | 446 | MDRV_CPU_ADD("mcu", M68705,2000000) /* ??? */ |
| 446 | 447 | MDRV_CPU_PROGRAM_MAP(m68705_map,0) |
| 447 | 448 | |
| 448 | MDRV_ | |
| 449 | MDRV_QUANTUM_TIME | |
| 449 | 450 | |
| 450 | 451 | MDRV_MACHINE_RESET(bigevglf) |
| 451 | 452 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 61 | 61 | ***************************************************************************/ |
| 62 | 62 | |
| 63 | 63 | #include "driver.h" |
| 64 | #include " | |
| 64 | #include " | |
| 65 | 65 | #include "sound/ay8910.h" |
| 66 | 66 | #include "sound/5110intf.h" |
| 67 | 67 | #include "sound/tms5110.h" |
| r3957 | r3958 | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | static int bagman_speech_rom_read_bit(void) | |
| 108 | static int bagman_speech_rom_read_bit(const device_config *device) | |
| 109 | 109 | { |
| 110 | UINT8 *ROM = memory_region( | |
| 110 | UINT8 *ROM = memory_region(device->machine, "speech"); | |
| 111 | 111 | int bit_no = (ls259_buf[0]<<2) | (ls259_buf[1]<<1) | (ls259_buf[2]<<0); |
| 112 | 112 | int byte = 0; |
| 113 | 113 |
| r3957 | r3958 | |
|---|---|---|
| 1301 | 1301 | MDRV_CPU_IO_MAP( s23h8iomap, 0 ) |
| 1302 | 1302 | MDRV_CPU_VBLANK_INT("main", irq1_line_pulse) |
| 1303 | 1303 | |
| 1304 | MDRV_ | |
| 1304 | MDRV_QUANTUM_TIME | |
| 1305 | 1305 | |
| 1306 | 1306 | MDRV_SCREEN_ADD("main", RASTER) |
| 1307 | 1307 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 1345 | 1345 | MDRV_CPU_VBLANK_INT("main", irq1_line_pulse) |
| 1346 | 1346 | |
| 1347 | 1347 | |
| 1348 | MDRV_ | |
| 1348 | MDRV_QUANTUM_TIME | |
| 1349 | 1349 | |
| 1350 | 1350 | MDRV_SCREEN_ADD("main", RASTER) |
| 1351 | 1351 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 1384 | 1384 | MDRV_CPU_IO_MAP( s23h8iomap, 0 ) |
| 1385 | 1385 | MDRV_CPU_VBLANK_INT("main", irq1_line_pulse) |
| 1386 | 1386 | |
| 1387 | MDRV_ | |
| 1387 | MDRV_QUANTUM_TIME | |
| 1388 | 1388 | |
| 1389 | 1389 | MDRV_SCREEN_ADD("main", RASTER) |
| 1390 | 1390 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | ****************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/z80/z80.h" | |
| 22 | 23 | |
| 23 | 24 | |
| 24 | 25 | static tilemap *tmap; |
| r3957 | r3958 | |
|---|---|---|
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | 45 | #include "driver.h" |
| 46 | #include "cpu/z80/z80.h" | |
| 46 | 47 | #include "deprecat.h" |
| 47 | 48 | #include "sound/2203intf.h" |
| 48 | 49 |
| r3957 | r3958 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | |
| 126 | 126 | #include "driver.h" |
| 127 | #include "cpu/m6502/m6502.h" | |
| 127 | 128 | #include "cpu/t11/t11.h" |
| 128 | 129 | #include "machine/atarigen.h" |
| 129 | 130 | #include "slapstic.h" |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | *****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "deprecat.h" |
| 11 | 12 | #include "sound/dac.h" |
| 12 | 13 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 121 | 121 | ******************************************************************************/ |
| 122 | 122 | |
| 123 | 123 | #include "driver.h" |
| 124 | #include "cpu/z80/z80.h" | |
| 124 | 125 | #include "sound/2203intf.h" |
| 125 | 126 | #include "sound/samples.h" |
| 126 | 127 | #include "machine/mc8123.h" |
| r3957 | r3958 | |
| 193 | 194 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 194 | 195 | |
| 195 | 196 | // bit 7 flips screen |
| 196 | flip_screen_set(data & 0x80); | |
| 197 | flip_screen_set(space->machine, data & 0x80); | |
| 197 | 198 | |
| 198 | 199 | // other bits unused |
| 199 | 200 | } |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | ***************************************************************************/ |
| 88 | 88 | |
| 89 | 89 | #include "driver.h" |
| 90 | #include "cpu/m6800/m6800.h" | |
| 90 | 91 | #include "deprecat.h" |
| 91 | 92 | #include "skydiver.h" |
| 92 | 93 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 105 | 105 | ****************************************************************************/ |
| 106 | 106 | |
| 107 | 107 | #include "driver.h" |
| 108 | #include "cpu/z80/z80.h" | |
| 108 | 109 | #include "spacefb.h" |
| 109 | 110 | #include "cpu/mcs48/mcs48.h" |
| 110 | 111 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 338 | 339 | MDRV_CPU_PROGRAM_MAP(spacefb_audio_map,0) |
| 339 | 340 | MDRV_CPU_IO_MAP(spacefb_audio_io_map,0) |
| 340 | 341 | |
| 341 | MDRV_ | |
| 342 | MDRV_QUANTUM_TIME | |
| 342 | 343 | |
| 343 | 344 | MDRV_MACHINE_START(spacefb) |
| 344 | 345 | MDRV_MACHINE_RESET(spacefb) |
| r3957 | r3958 | |
|---|---|---|
| 127 | 127 | ***************************************************************************/ |
| 128 | 128 | |
| 129 | 129 | #include "driver.h" |
| 130 | #include "cpu/i8085/i8085.h" | |
| 130 | 131 | #include "sound/custom.h" |
| 131 | 132 | #include "warpwarp.h" |
| 132 | 133 | #include "geebee.lh" |
| 133 | 134 | #include "sos.lh" |
| 134 | 135 | |
| 136 | #define MASTER_CLOCK XTAL_18_432MHz | |
| 135 | 137 | |
| 138 | ||
| 136 | 139 | /******************************************************* |
| 137 | 140 | * |
| 138 | 141 | * Gee Bee overlay |
| r3957 | r3958 | |
| 150 | 153 | res = input_port_read_safe(space->machine, portnames[offset], 0); |
| 151 | 154 | if (offset == 3) |
| 152 | 155 | { |
| 153 | res = input_port_read(space->machine, (flip_screen_get() & 1) ? "IN2" : "IN1"); // read player 2 input in cocktail mode | |
| 156 | res = input_port_read(space->machine, (flip_screen_get(space->machine) & 1) ? "IN2" : "IN1"); // read player 2 input in cocktail mode | |
| 154 | 157 | if (handle_joystick) |
| 155 | 158 | { |
| 156 | 159 | /* map digital two-way joystick to two fixed VOLIN values */ |
| r3957 | r3958 | |
| 210 | 213 | warpwarp_ball_on = data & 1; |
| 211 | 214 | break; |
| 212 | 215 | case 7: |
| 213 | flip_screen_set(data & 1); | |
| 216 | flip_screen_set(space->machine, data & 1); | |
| 214 | 217 | break; |
| 215 | 218 | } |
| 216 | 219 | } |
| r3957 | r3958 | |
| 233 | 236 | { |
| 234 | 237 | int res; |
| 235 | 238 | |
| 236 | res = input_port_read(space->machine, (flip_screen_get() & 1) ? "VOLIN2" : "VOLIN1"); | |
| 239 | res = input_port_read(space->machine, (flip_screen_get(space->machine) & 1) ? "VOLIN2" : "VOLIN1"); | |
| 237 | 240 | if (handle_joystick) |
| 238 | 241 | { |
| 239 | 242 | if (res & 1) return 0x0f; |
| r3957 | r3958 | |
| 288 | 291 | break; |
| 289 | 292 | case 6: |
| 290 | 293 | warpwarp_ball_on = data & 1; |
| 291 | cpu_interrupt_enable(0,data & 1); | |
| 294 | cpu_interrupt_enable(space->machine->cpu[0],data & 1); | |
| 292 | 295 | if (~data & 1) |
| 293 | 296 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 294 | 297 | break; |
| 295 | 298 | case 7: |
| 296 | flip_screen_set(data & 1); | |
| 299 | flip_screen_set(space->machine, data & 1); | |
| 297 | 300 | break; |
| 298 | 301 | } |
| 299 | 302 | } |
| r3957 | r3958 | |
| 733 | 736 | static MACHINE_DRIVER_START( geebee ) |
| 734 | 737 | |
| 735 | 738 | /* basic machine hardware */ |
| 736 | MDRV_CPU_ADD("main", 8080, | |
| 739 | MDRV_CPU_ADD("main", 8080, MASTER_CLOCK | |
| 737 | 740 | MDRV_CPU_PROGRAM_MAP(geebee_map,0) |
| 738 | 741 | MDRV_CPU_IO_MAP(geebee_port_map,0) |
| 739 | MDRV_CPU_VBLANK_INT("main", irq0_line_ | |
| 742 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 740 | 743 | |
| 741 | 744 | /* video hardware */ |
| 742 | 745 | MDRV_SCREEN_ADD("main", RASTER) |
| 743 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 744 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
| 745 | 746 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 746 | MDRV_SCREEN_SIZE(34*8, 28*8) | |
| 747 | MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 28*8-1) | |
| 747 | MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224) | |
| 748 | 748 | |
| 749 | 749 | MDRV_GFXDECODE(1k) |
| 750 | 750 | MDRV_PALETTE_LENGTH(4*2) |
| r3957 | r3958 | |
| 777 | 777 | static MACHINE_DRIVER_START( bombbee ) |
| 778 | 778 | |
| 779 | 779 | /* basic machine hardware */ |
| 780 | MDRV_CPU_ADD("main", 8080, | |
| 780 | MDRV_CPU_ADD("main", 8080, MASTER_CLOCK/9) /* 18.432 MHz / 9 */ | |
| 781 | 781 | MDRV_CPU_PROGRAM_MAP(bombbee_map,0) |
| 782 | 782 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 783 | 783 | |
| 784 | 784 | /* video hardware */ |
| 785 | 785 | MDRV_SCREEN_ADD("main", RASTER) |
| 786 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 787 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0) /* frames per second, vblank duration */) | |
| 788 | 786 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 789 | MDRV_SCREEN_SIZE(34*8, 28*8) | |
| 790 | MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 28*8-1) | |
| 787 | MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224) | |
| 791 | 788 | |
| 792 | 789 | MDRV_GFXDECODE(color) |
| 793 | 790 | MDRV_PALETTE_LENGTH(2*256+1) |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | */ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "cpu/m68000/m68000.h" | |
| 48 | 49 | #include "sound/custom.h" |
| 49 | 50 | #include "includes/amiga.h" |
| 50 | 51 | #include "includes/cubocd32.h" |
| r3957 | r3958 | |
| 223 | 224 | static const cia6526_interface cia_0_intf = |
| 224 | 225 | { |
| 225 | 226 | amiga_cia_0_irq, /* irq_func */ |
| 226 | AMIGA_68EC020_PAL_CLOCK / 10, /* clock */ | |
| 227 | 227 | 0, /* tod_clock */ |
| 228 | 228 | { |
| 229 | 229 | { cd32_cia_0_porta_r, cd32_cia_0_porta_w }, /* port A */ |
| r3957 | r3958 | |
| 234 | 234 | static const cia6526_interface cia_1_intf = |
| 235 | 235 | { |
| 236 | 236 | amiga_cia_1_irq, /* irq_func */ |
| 237 | AMIGA_68EC020_PAL_CLOCK / 10, /* clock */ | |
| 238 | 237 | 0, /* tod_clock */ |
| 239 | 238 | { |
| 240 | 239 | { NULL, NULL }, /* port A */ |
| r3957 | r3958 | |
| 282 | 281 | MDRV_SOUND_ROUTE( 1, "right", 0.50 ) |
| 283 | 282 | |
| 284 | 283 | /* cia */ |
| 285 | MDRV_DEVICE_ADD("cia_0", CIA8520) | |
| 286 | MDRV_DEVICE_CONFIG(cia_0_intf) | |
| 287 | MDRV_DEVICE_ADD("cia_1", CIA8520) | |
| 288 | MDRV_DEVICE_CONFIG(cia_1_intf) | |
| 284 | MDRV_CIA8520_ADD("cia_0", AMIGA_68EC020_PAL_CLOCK / 10, cia_0_intf) | |
| 285 | MDRV_CIA8520_ADD("cia_1", AMIGA_68EC020_PAL_CLOCK / 10, cia_1_intf) | |
| 289 | 286 | MACHINE_DRIVER_END |
| 290 | 287 | |
| 291 | 288 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "cpu/m68000/m68000.h" | |
| 52 | 53 | #include "deprecat.h" |
| 53 | 54 | |
| 54 | 55 | static int toggle_bit; |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | #include "driver.h" |
| 42 | #include "cpu/m68000/m68000.h" | |
| 42 | 43 | #include "deprecat.h" |
| 43 | 44 | |
| 44 | 45 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/m68000/m68000.h" | |
| 20 | 21 | #include "cpu/h6280/h6280.h" |
| 21 | 22 | #include "sound/2203intf.h" |
| 22 | 23 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/arm7/arm7.h" | |
| 55 | 56 | #include "cpu/arm7/arm7core.h" |
| 56 | 57 | |
| 57 | 58 | static UINT32 *system_memory; |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | *********************************************************************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/z80/z80.h" | |
| 53 | 54 | #include "sound/ay8910.h" |
| 54 | 55 | #include "sound/okim6295.h" |
| 55 | 56 | #include "sound/2413intf.h" |
| r3957 | r3958 | |
| 679 | 680 | MDRV_CPU_IO_MAP(dunhuang_io_map,0) |
| 680 | 681 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 681 | 682 | |
| 682 | MDRV_WATCHDOG_TIME_INIT( | |
| 683 | MDRV_WATCHDOG_TIME_INIT( | |
| 683 | 684 | |
| 684 | 685 | /* video hardware */ |
| 685 | 686 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/z80/z80.h" | |
| 24 | 25 | #include "deprecat.h" |
| 25 | 26 | #include "cpu/m6809/m6809.h" |
| 26 | 27 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 43 | 44 | #include "sound/okim6295.h" |
| 44 | 45 | #include "sound/3812intf.h" |
| 45 | 46 |
| r3957 | r3958 | |
|---|---|---|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | static | |
| 96 | static const i8085_config n8080_cpu_config = | |
| 97 | 97 | { |
| 98 | const device_config *cpu = cputag_get_cpu(machine, "main"); | |
| 98 | n8080_inte_callback, /* INTE changed callback */ | |
| 99 | n8080_status_callback, /* STATUS changed callback */ | |
| 100 | NULL, /* SOD changed callback (8085A only) */ | |
| 101 | NULL, /* SID changed callback (8085A only) */ | |
| 102 | }; | |
| 99 | 103 | |
| 100 | i8085_set_status_callback(cpu, n8080_status_callback); | |
| 101 | i8085_set_inte_callback(cpu, n8080_inte_callback); | |
| 102 | } | |
| 103 | ||
| 104 | 104 | static MACHINE_DRIVER_START( spacefev ) |
| 105 | 105 | |
| 106 | 106 | /* basic machine hardware */ |
| 107 | 107 | MDRV_CPU_ADD("main", 8080, 20160000 / 10) |
| 108 | MDRV_CPU_CONFIG(n8080_cpu_config) | |
| 108 | 109 | MDRV_CPU_PROGRAM_MAP(main_cpu_map, 0) |
| 109 | 110 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 110 | 111 | |
| 111 | MDRV_MACHINE_START(spacefev) | |
| 112 | ||
| 113 | 112 | /* video hardware */ |
| 114 | 113 | MDRV_SCREEN_ADD("main", RASTER) |
| 115 | 114 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 134 | 133 | |
| 135 | 134 | /* basic machine hardware */ |
| 136 | 135 | MDRV_CPU_ADD("main", 8080, 20160000 / 10) |
| 136 | MDRV_CPU_CONFIG(n8080_cpu_config) | |
| 137 | 137 | MDRV_CPU_PROGRAM_MAP(main_cpu_map, 0) |
| 138 | 138 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 139 | 139 | |
| 140 | MDRV_MACHINE_START(spacefev) | |
| 141 | ||
| 142 | 140 | /* video hardware */ |
| 143 | 141 | MDRV_SCREEN_ADD("main", RASTER) |
| 144 | 142 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
| 163 | 161 | |
| 164 | 162 | /* basic machine hardware */ |
| 165 | 163 | MDRV_CPU_ADD("main", 8080, 20160000 / 10) |
| 164 | MDRV_CPU_CONFIG(n8080_cpu_config) | |
| 166 | 165 | MDRV_CPU_PROGRAM_MAP(helifire_main_cpu_map, 0) |
| 167 | 166 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 168 | 167 | |
| 169 | MDRV_MACHINE_START(spacefev) | |
| 170 | ||
| 171 | 168 | /* video hardware */ |
| 172 | 169 | MDRV_SCREEN_ADD("main", RASTER) |
| 173 | 170 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | ******************************************************************************/ |
| 45 | 45 | |
| 46 | 46 | #include "driver.h" |
| 47 | #include "cpu/z80/z80.h" | |
| 47 | 48 | #include "nb1413m3.h" |
| 48 | 49 | #include "sound/dac.h" |
| 49 | 50 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | ***************************************************************************/ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "cpu/z80/z80.h" | |
| 29 | 30 | #include "cpu/m6800/m6800.h" |
| 30 | 31 | #include "sound/ay8910.h" |
| 31 | 32 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/z80/z80.h" | |
| 15 | 16 | #include "sound/ay8910.h" |
| 16 | 17 | |
| 17 | 18 | VIDEO_START( holeland ); |
| r3957 | r3958 | |
|---|---|---|
| 525 | 525 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 526 | 526 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) |
| 527 | 527 | |
| 528 | MDRV_ | |
| 528 | MDRV_QUANTUM_TIME | |
| 529 | 529 | |
| 530 | 530 | /* video hardware */ |
| 531 | 531 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 553 | 553 | MACHINE_DRIVER_END |
| 554 | 554 | |
| 555 | 555 | static MACHINE_DRIVER_START( liberatb ) |
| 556 | MDRV_IMPORT_FROM(liberate) | |
| 556 | 557 | |
| 557 | 558 | /* basic machine hardware */ |
| 558 | MDRV_CPU_ADD("main", M6502, 2000000) | |
| 559 | MDRV_CPU_MODIFY("main") | |
| 560 | MDRV_CPU_TYPE(M6502) | |
| 559 | 561 | MDRV_CPU_PROGRAM_MAP(liberatb_readmem,liberatb_writemem) |
| 560 | 562 | MDRV_CPU_VBLANK_INT("main", deco16_interrupt) |
| 561 | 563 | |
| 562 | MDRV_IMPORT_FROM(liberate) | |
| 563 | 564 | MDRV_CPU_REMOVE("main") |
| 564 | 565 | MACHINE_DRIVER_END |
| 565 | 566 | |
| r3957 | r3958 | |
| 572 | 573 | |
| 573 | 574 | static MACHINE_DRIVER_START( prosoccr ) |
| 574 | 575 | |
| 576 | MDRV_IMPORT_FROM(liberate) | |
| 577 | ||
| 575 | 578 | /* basic machine hardware */ |
| 576 | MDRV_CPU_ADD("main", DECO16, 3000000) | |
| 579 | MDRV_CPU_MODIFY("main") | |
| 580 | MDRV_CPU_CLOCK(3000000) | |
| 577 | 581 | MDRV_CPU_PROGRAM_MAP(liberate_readmem,liberate_writemem) |
| 578 | 582 | MDRV_CPU_IO_MAP(deco16_io_map,0) |
| 579 | 583 | |
| 580 | MDRV_IMPORT_FROM(liberate) | |
| 581 | MDRV_CPU_REMOVE("main") | |
| 582 | ||
| 583 | 584 | MDRV_VIDEO_START(prosoccr) |
| 584 | 585 | MDRV_VIDEO_UPDATE(prosoccr) |
| 585 | 586 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 595 | 596 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 596 | 597 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) |
| 597 | 598 | |
| 598 | MDRV_ | |
| 599 | MDRV_QUANTUM_TIME | |
| 599 | 600 | |
| 600 | 601 | /* video hardware */ |
| 601 | 602 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/m6502/m6502.h" | |
| 25 | 26 | #include "deprecat.h" |
| 26 | 27 | #include "cpu/m6809/m6809.h" |
| 27 | 28 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 67 | 67 | ***************************************************************************/ |
| 68 | 68 | |
| 69 | 69 | #include "driver.h" |
| 70 | #include "cpu/z80/z80.h" | |
| 70 | 71 | #include "deprecat.h" |
| 71 | 72 | #include "sound/2203intf.h" |
| 72 | 73 |
| r3957 | r3958 | |
|---|---|---|
| 83 | 83 | ***************************************************************************/ |
| 84 | 84 | |
| 85 | 85 | #include "driver.h" |
| 86 | #include "deprecat.h" | |
| 87 | 86 | #include "cpu/s2650/s2650.h" |
| 88 | 87 | #include "sound/dac.h" |
| 89 | 88 | #include "sound/5110intf.h" |
| r3957 | r3958 | |
| 252 | 251 | } |
| 253 | 252 | |
| 254 | 253 | |
| 255 | static void cvs_dac_cpu_interrupt( | |
| 254 | static void cvs_dac_cpu_interrupt(running_machine *machine) | |
| 256 | 255 | { |
| 257 | cpu_set_input_line_vector(Machine->cpu[CVS_DAC_CPU_INDEX], 0, 0x03); | |
| 258 | cpu_set_input_line(Machine->cpu[CVS_DAC_CPU_INDEX], 0, HOLD_LINE); | |
| 256 | cpu_set_input_line_vector(machine->cpu[CVS_DAC_CPU_INDEX], 0, 0x03); | |
| 257 | cpu_set_input_line(machine->cpu[CVS_DAC_CPU_INDEX], 0, HOLD_LINE); | |
| 259 | 258 | } |
| 260 | 259 | |
| 261 | 260 | |
| r3957 | r3958 | |
| 432 | 431 | } |
| 433 | 432 | |
| 434 | 433 | |
| 435 | static int speech_rom_read_bit(void) | |
| 434 | static int speech_rom_read_bit(const device_config *device) | |
| 436 | 435 | { |
| 437 | UINT8 *ROM = memory_region(Machine, "speechdata"); | |
| 438 | int bit; | |
| 436 | running_machine *machine = device->machine; | |
| 437 | UINT8 *ROM = memory_region(machine, "speechdata"); | |
| 438 | int bit; | |
| 439 | 439 | |
| 440 | 440 | /* before reading the bit, clamp the address to the region length */ |
| 441 | speech_rom_bit_address = speech_rom_bit_address & ((memory_region_length( | |
| 441 | speech_rom_bit_address = speech_rom_bit_address & ((memory_region_length(machine, "speechdata") * 8) - 1); | |
| 442 | 442 | bit = (ROM[speech_rom_bit_address >> 3] >> (speech_rom_bit_address & 0x07)) & 0x01; |
| 443 | 443 | |
| 444 | 444 | /* prepare for next bit */ |
| r3957 | r3958 | |
| 468 | 468 | if (data & 0x80) |
| 469 | 469 | { |
| 470 | 470 | soundlatch_w(space, 0, data); |
| 471 | cvs_dac_cpu_interrupt(); | |
| 471 | cvs_dac_cpu_interrupt(space->machine); | |
| 472 | 472 | |
| 473 | 473 | LOG(("%04x : CVS: Audio command = %02x\n", cpu_get_pc(space->cpu), data)); |
| 474 | 474 | } |
| r3957 | r3958 | |
|---|---|---|
| 145 | 145 | **************************************************************************/ |
| 146 | 146 | |
| 147 | 147 | #include "driver.h" |
| 148 | #include "cpu/z80/z80.h" | |
| 148 | 149 | #include "machine/8255ppi.h" |
| 149 | 150 | #include "turbo.h" |
| 150 | 151 | #include "machine/segacrpt.h" |
| r3957 | r3958 | |
| 1144 | 1145 | MDRV_CPU_PROGRAM_MAP(buckrog_cpu2_map,0) |
| 1145 | 1146 | MDRV_CPU_IO_MAP(buckrog_cpu2_portmap,0) |
| 1146 | 1147 | |
| 1147 | MDRV_ | |
| 1148 | MDRV_QUANTUM_TIME | |
| 1148 | 1149 | MDRV_MACHINE_RESET(buckrog) |
| 1149 | 1150 | |
| 1150 | 1151 | MDRV_PPI8255_ADD( "ppi8255_0", buckrog_8255_intf[0] ) |
| r3957 | r3958 | |
|---|---|---|
| 1288 | 1288 | ***************************************************************************/ |
| 1289 | 1289 | |
| 1290 | 1290 | #include "driver.h" |
| 1291 | #include "cpu/z80/z80.h" | |
| 1292 | #include "cpu/m68000/m68000.h" | |
| 1293 | #include "cpu/m6502/m6502.h" | |
| 1291 | 1294 | #include "deprecat.h" |
| 1292 | 1295 | #include "seta.h" |
| 1293 | 1296 | #include "machine/6821pia.h" |
| r3957 | r3958 | |
| 8228 | 8231 | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 8229 | 8232 | |
| 8230 | 8233 | /* devices */ |
| 8231 | MDRV_ | |
| 8234 | MDRV_MSM6242_ADD("rtc" | |
| 8232 | 8235 | MACHINE_DRIVER_END |
| 8233 | 8236 | |
| 8234 | 8237 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/m6800/m6800.h" | |
| 20 | 21 | #include "cpu/s2650/s2650.h" |
| 21 | 22 | #include "machine/6821pia.h" |
| 22 | 23 | #include "video/s2636.h" |
| r3957 | r3958 | |
| 79 | 80 | { |
| 80 | 81 | laserbat_input_mux = (data & 0x30) >> 4; |
| 81 | 82 | |
| 82 | flip_screen_set_no_update(data & 0x08); | |
| 83 | flip_screen_set_no_update(space->machine, data & 0x08); | |
| 83 | 84 | |
| 84 | 85 | coin_counter_w(0,data & 1); |
| 85 | 86 |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/m6809/m6809.h" | |
| 38 | 39 | #include "machine/6522via.h" |
| 39 | 40 | #include "sound/ay8910.h" |
| 40 | 41 | #include "gameplan.h" |
| r3957 | r3958 | |
|---|---|---|
| 620 | 620 | |
| 621 | 621 | |
| 622 | 622 | #include "driver.h" |
| 623 | #include "cpu/z80/z80.h" | |
| 623 | 624 | #include "taitoipt.h" |
| 624 | 625 | #include "cpu/i8x41/i8x41.h" |
| 625 | 626 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 1648 | 1649 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1649 | 1650 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1650 | 1651 | |
| 1651 | MDRV_ | |
| 1652 | MDRV_QUANTUM_PERFECT_CPU("main")//TIME(HZ(600000)) | |
| 1652 | 1653 | |
| 1653 | 1654 | MDRV_MACHINE_RESET(tnzs) |
| 1654 | 1655 | |
| r3957 | r3958 | |
| 1687 | 1688 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1688 | 1689 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1689 | 1690 | |
| 1690 | MDRV_ | |
| 1691 | MDRV_QUANTUM_TIME | |
| 1691 | 1692 | |
| 1692 | 1693 | MDRV_MACHINE_RESET(tnzs) |
| 1693 | 1694 | |
| r3957 | r3958 | |
| 1729 | 1730 | MDRV_CPU_ADD("mcu", I8742 ,12000000/2) /* 400KHz ??? - Main board Crystal is 12MHz */ |
| 1730 | 1731 | MDRV_CPU_IO_MAP(i8742_io_map,0) |
| 1731 | 1732 | |
| 1732 | MDRV_ | |
| 1733 | MDRV_QUANTUM_TIME | |
| 1733 | 1734 | |
| 1734 | 1735 | MDRV_MACHINE_RESET(tnzs) |
| 1735 | 1736 | |
| r3957 | r3958 | |
| 1767 | 1768 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1768 | 1769 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1769 | 1770 | |
| 1770 | MDRV_ | |
| 1771 | MDRV_QUANTUM_TIME | |
| 1771 | 1772 | |
| 1772 | 1773 | MDRV_MACHINE_RESET(tnzs) |
| 1773 | 1774 | |
| r3957 | r3958 | |
| 1805 | 1806 | MDRV_CPU_PROGRAM_MAP(kageki_sub_readmem,kageki_sub_writemem) |
| 1806 | 1807 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1807 | 1808 | |
| 1808 | MDRV_ | |
| 1809 | MDRV_QUANTUM_TIME | |
| 1809 | 1810 | |
| 1810 | 1811 | MDRV_MACHINE_RESET(tnzs) |
| 1811 | 1812 | |
| r3957 | r3958 | |
| 1854 | 1855 | MDRV_CPU_PROGRAM_MAP(tnzsb_cpu2_map,0) |
| 1855 | 1856 | MDRV_CPU_IO_MAP(tnzsb_io_map,0) |
| 1856 | 1857 | |
| 1857 | MDRV_ | |
| 1858 | MDRV_QUANTUM_TIME | |
| 1858 | 1859 | |
| 1859 | 1860 | MDRV_MACHINE_RESET(tnzs) |
| 1860 | 1861 | |
| r3957 | r3958 | |
| 1918 | 1919 | MDRV_CPU_PROGRAM_MAP(jpopnics_sub_map,0) |
| 1919 | 1920 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1920 | 1921 | |
| 1921 | MDRV_ | |
| 1922 | MDRV_QUANTUM_TIME | |
| 1922 | 1923 | |
| 1923 | 1924 | /* video hardware */ |
| 1924 | 1925 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 65 | 65 | ***************************************************************************/ |
| 66 | 66 | |
| 67 | 67 | #include "driver.h" |
| 68 | #include "cpu/z80/z80.h" | |
| 69 | #include "cpu/m6809/m6809.h" | |
| 68 | 70 | #include "sound/sn76496.h" |
| 69 | 71 | #include "sound/flt_rc.h" |
| 70 | 72 | |
| r3957 | r3958 | |
| 429 | 431 | MDRV_CPU_ADD("audio", Z80,XTAL_14_31818MHz/4) /* verified on pcb */ |
| 430 | 432 | MDRV_CPU_PROGRAM_MAP(audio_map,0) |
| 431 | 433 | |
| 432 | MDRV_ | |
| 434 | MDRV_QUANTUM_TIME | |
| 433 | 435 | /* synchronization of the CPUs */ |
| 434 | 436 | /* video hardware */ |
| 435 | 437 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 108 | 108 | ***************************************************************************/ |
| 109 | 109 | |
| 110 | 110 | #include "driver.h" |
| 111 | #include "cpu/m68000/m68000.h" | |
| 111 | 112 | #include "cpu/h6280/h6280.h" |
| 112 | 113 | #include "decocrpt.h" |
| 113 | 114 | #include "decoprot.h" |
| r3957 | r3958 | |
|---|---|---|
| 137 | 137 | */ |
| 138 | 138 | static WRITE8_HANDLER( vb_scrollx_hi_w ) |
| 139 | 139 | { |
| 140 | flip_screen_set(~data&1); | |
| 140 | flip_screen_set(space->machine, ~data&1); | |
| 141 | 141 | vb_scrollx_hi = (data & 0x02) << 7; |
| 142 | 142 | vb_bgprombank_w(space->machine, (data >> 2)&0x07); |
| 143 | 143 | vb_spprombank_w(space->machine, (data >> 5)&0x07); |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ****************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/z80/z80.h" | |
| 14 | 15 | #include "deprecat.h" |
| 15 | 16 | #include "sound/ay8910.h" |
| 16 | 17 |
| r3957 | r3958 | |
|---|---|---|
| 105 | 105 | static const UINT16 dsp56k_shared_ram_16_size = 0x2000; static UINT16* dsp56k_shared_ram_16; |
| 106 | 106 | static const UINT16 dsp56k_bank04_size = 0x1fc0; static UINT16* dsp56k_bank04_ram; |
| 107 | 107 | |
| 108 | static direct_update_func dsp56k_update_handler = NULL; | |
| 109 | ||
| 108 | 110 | static const eeprom_interface eeprom_intf = |
| 109 | 111 | { |
| 110 | 112 | 7, /* address bits */ |
| r3957 | r3958 | |
| 187 | 189 | /* irq 3 is network. don't generate if you don't emulate the network h/w! */ |
| 188 | 190 | /* irq 5 is vblank */ |
| 189 | 191 | /* irq 7 does nothing (it jsrs to a rts and then rte) */ |
| 190 | ||
| 191 | 192 | static INTERRUPT_GEN(polygonet_interrupt) |
| 192 | 193 | { |
| 193 | 194 | cpu_set_input_line(device, M68K_IRQ_5, HOLD_LINE); |
| 194 | 195 | } |
| 195 | 196 | |
| 196 | 197 | /* sound CPU communications */ |
| 197 | ||
| 198 | 198 | static READ32_HANDLER( sound_r ) |
| 199 | 199 | { |
| 200 | 200 | int latch = soundlatch3_r(space, 0); |
| r3957 | r3958 | |
| 230 | 230 | if (mem_mask == 0x0000ff00) { hi_addr++; } /* Low byte */ |
| 231 | 231 | if (mem_mask == 0xff000000) {} /* High byte */ |
| 232 | 232 | |
| 233 | value = dsp56k_host_interface_read((device_config*)space->cp | |
| 233 | value = dsp56k_host_interface_read((device_config*)cputag_get_cpu(space->machine, "dsp"), hi_addr); | |
| 234 | 234 | |
| 235 | 235 | if (mem_mask == 0x0000ff00) { value <<= 8; } |
| 236 | 236 | if (mem_mask == 0xff000000) { value <<= 24; } |
| r3957 | r3958 | |
| 284 | 284 | cputag_set_input_line(space->machine, "dsp", DSP56K_IRQ_MODB, CLEAR_LINE); |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | /* 0x04000000 is the ??? line */ | |
| 288 | ||
| 287 | /* 0x04000000 is the COMBNK line - it switches who has access to the shared RAM - the dsp or the 68020 */ | |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | 290 | static WRITE32_HANDLER( dsp_host_interface_w ) |
| r3957 | r3958 | |
| 300 | 299 | if (mem_mask == 0xff000000) { hi_data = (data & 0xff000000) >> 24; } |
| 301 | 300 | |
| 302 | 301 | logerror("write (host-side) %08x %08x %08x (HI %04x)\n", offset, mem_mask, data, hi_addr); |
| 303 | dsp56k_host_interface_write((device_config*)space->cp | |
| 302 | dsp56k_host_interface_write((device_config*)cputag_get_cpu(space->machine, "dsp"), hi_addr, hi_data); | |
| 304 | 303 | } |
| 305 | 304 | |
| 306 | 305 | |
| r3957 | r3958 | |
| 309 | 308 | return 0x08000000; |
| 310 | 309 | } |
| 311 | 310 | |
| 311 | ||
| 312 | WRITE32_HANDLER( plygonet_palette_w ) | |
| 313 | { | |
| 314 | int r,g,b; | |
| 315 | ||
| 316 | COMBINE_DATA(&paletteram32[offset]); | |
| 317 | ||
| 318 | r = (paletteram32[offset] >>16) & 0xff; | |
| 319 | g = (paletteram32[offset] >> 8) & 0xff; | |
| 320 | b = (paletteram32[offset] >> 0) & 0xff; | |
| 321 | ||
| 322 | palette_set_color(space->machine,offset,MAKE_RGB(r,g,b)); | |
| 323 | } | |
| 324 | ||
| 325 | ||
| 312 | 326 | /**********************************************************************************/ |
| 313 | 327 | /******* DSP56k maps *******/ |
| 314 | 328 | /**********************************************************************************/ |
| r3957 | r3958 | |
| 321 | 335 | |
| 322 | 336 | static DIRECT_UPDATE_HANDLER( plygonet_dsp56k_direct_handler ) |
| 323 | 337 | { |
| 324 | if (address >= 0x7000 && address <= 0x7fff) | |
| 338 | /* Call the dsp's update handler first */ | |
| 339 | if (dsp56k_update_handler != NULL) | |
| 325 | 340 | { |
| 326 | direct->raw = direct->decrypted = (void*)(dsp56k_p_mirror - 0x7000); | |
| 341 | if ((*dsp56k_update_handler)(space, address, direct) == ~0) | |
| 342 | return ~0; | |
| 343 | } | |
| 344 | ||
| 345 | /* If the requested region wasn't in there, see if it needs to be caught driver-side */ | |
| 346 | if (address >= (0x7000<<1) && address <= (0x7fff<<1)) | |
| 347 | { | |
| 348 | direct->raw = direct->decrypted = (UINT8*)(dsp56k_p_mirror) - (0x7000<<1); | |
| 327 | 349 | return ~0; |
| 328 | 350 | } |
| 329 | else if (address >= 0x8000 && address <= 0x87ff) | |
| 351 | else if (address >= (0x8000<<1) && address <= (0x87ff<<1)) | |
| 330 | 352 | { |
| 331 | direct->raw = direct->decrypted = ( | |
| 353 | direct->raw = direct->decrypted = (UINT8*)(dsp56k_p_8000) - (0x8000<<1); | |
| 332 | 354 | return ~0; |
| 333 | 355 | } |
| 334 | 356 | |
| r3957 | r3958 | |
| 496 | 518 | } |
| 497 | 519 | |
| 498 | 520 | |
| 499 | WRITE32_HANDLER( plygonet_palette_w ) | |
| 500 | { | |
| 501 | int r,g,b; | |
| 502 | ||
| 503 | COMBINE_DATA(&paletteram32[offset]); | |
| 504 | ||
| 505 | r = (paletteram32[offset] >>16) & 0xff; | |
| 506 | g = (paletteram32[offset] >> 8) & 0xff; | |
| 507 | b = (paletteram32[offset] >> 0) & 0xff; | |
| 508 | ||
| 509 | palette_set_color(space->machine,offset,MAKE_RGB(r,g,b)); | |
| 510 | } | |
| 511 | ||
| 512 | ||
| 513 | 521 | /**********************************************************************************/ |
| 514 | 522 | |
| 515 | 523 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r3957 | r3958 | |
| 643 | 651 | MDRV_NVRAM_HANDLER(polygonet) |
| 644 | 652 | |
| 645 | 653 | /* TODO: TEMPORARY! UNTIL A MORE LOCALIZED SYNC CAN BE MADE */ |
| 646 | MDRV_ | |
| 654 | MDRV_QUANTUM_TIME | |
| 647 | 655 | |
| 648 | 656 | /* video hardware */ |
| 649 | 657 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 715 | 723 | memset(dsp56k_bank04_ram, 0, 2 * 8 * dsp56k_bank04_size * sizeof(UINT16)); |
| 716 | 724 | |
| 717 | 725 | /* The dsp56k occasionally executes out of mapped memory */ |
| 718 | memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), plygonet_dsp56k_direct_handler); | |
| 726 | dsp56k_update_handler = memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), plygonet_dsp56k_direct_handler); | |
| 719 | 727 | } |
| 720 | 728 | |
| 721 | 729 | ROM_START( plygonet ) |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "batman.h" |
| r3957 | r3958 | |
|---|---|---|
| 653 | 653 | */ |
| 654 | 654 | |
| 655 | 655 | #include "driver.h" |
| 656 | #include "cpu/arm7/arm7.h" | |
| 656 | 657 | #include "video/generic.h" |
| 657 | 658 | #include "machine/eeprom.h" |
| 658 | 659 | #include "naomibd.h" |
| r3957 | r3958 | |
|---|---|---|
| 37 | 37 | ***************************************************************************/ |
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | #include "cpu/m68000/m68000.h" | |
| 40 | 41 | #include "deprecat.h" |
| 41 | 42 | #include "cpu/z80/z80.h" |
| 42 | 43 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | **************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "sound/dac.h" |
| 11 | 12 | |
| 12 | 13 |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/z80/z80.h" | |
| 27 | 28 | #include "cpu/m68000/m68000.h" |
| 28 | 29 | #include "sound/ay8910.h" |
| 29 | 30 | |
| r3957 | r3958 | |
| 377 | 378 | MDRV_CPU_PROGRAM_MAP(magmax_soundreadmem,magmax_soundwritemem) |
| 378 | 379 | MDRV_CPU_IO_MAP(magmax_sound_io_map,0) |
| 379 | 380 | |
| 380 | MDRV_ | |
| 381 | MDRV_QUANTUM_TIME | |
| 381 | 382 | |
| 382 | 383 | MDRV_MACHINE_START(magmax) |
| 383 | 384 | MDRV_MACHINE_RESET(magmax) |
| r3957 | r3958 | |
|---|---|---|
| 166 | 166 | ***************************************************************************/ |
| 167 | 167 | |
| 168 | 168 | #include "driver.h" |
| 169 | #include "cpu/m6502/m6502.h" | |
| 169 | 170 | #include "rendlay.h" |
| 170 | 171 | #include "video/vector.h" |
| 171 | 172 | #include "video/avgdvg.h" |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/m68000/m68000.h" | |
| 17 | 18 | #include "machine/eeprom.h" |
| 18 | 19 | #include "sound/okim6295.h" |
| 19 | 20 |
| r3957 | r3958 | |
|---|---|---|
| 154 | 154 | */ |
| 155 | 155 | |
| 156 | 156 | #include "driver.h" |
| 157 | #include "cpu/m68000/m68000.h" | |
| 157 | 158 | #include "machine/eeprom.h" |
| 158 | 159 | #include "cpu/sh2/sh2.h" |
| 159 | 160 | #include "machine/stvcd.h" |
| r3957 | r3958 | |
| 1971 | 1972 | logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),data); |
| 1972 | 1973 | cpuexec_boost_interleave(space->machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost)); |
| 1973 | 1974 | cpuexec_trigger(space->machine, 1000); |
| 1974 | c | |
| 1975 | device | |
| 1975 | 1976 | } |
| 1976 | 1977 | |
| 1977 | 1978 | static WRITE32_HANDLER( sinit_w ) |
| 1978 | 1979 | { |
| 1979 | 1980 | logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),data); |
| 1980 | 1981 | cpuexec_boost_interleave(space->machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost)); |
| 1981 | c | |
| 1982 | device | |
| 1982 | 1983 | } |
| 1983 | 1984 | |
| 1984 | 1985 | |
| r3957 | r3958 | |
| 2329 | 2330 | // do strict overwrite verification - maruchan and rsgun crash after coinup without this. |
| 2330 | 2331 | // cottonbm needs strict PCREL |
| 2331 | 2332 | // todo: test what games need this and don't turn it on for them... |
| 2332 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2333 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2333 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2334 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2334 | 2335 | |
| 2335 | 2336 | /* debug .. watch the command buffer rsgun, cottonbm etc. appear to use to communicate between cpus */ |
| 2336 | 2337 | memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write ); |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | */ |
| 80 | 80 | #include "driver.h" |
| 81 | #include "cpu/z80/z80.h" | |
| 81 | 82 | #include "genesis.h" |
| 82 | 83 | #include "rendlay.h" |
| 83 | 84 | #include "megadriv.h" |
| r3957 | r3958 | |
| 542 | 543 | |
| 543 | 544 | static READ8_HANDLER (megatech_bios_joypad_r) |
| 544 | 545 | { |
| 545 | return megatech_bios_port_cc_dc_r(offset,bios_port_ctrl); | |
| 546 | return megatech_bios_port_cc_dc_r(space->machine,offset,bios_port_ctrl); | |
| 546 | 547 | } |
| 547 | 548 | |
| 548 | 549 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/i386/i386.h" | |
| 20 | 21 | |
| 21 | 22 | VIDEO_START(queen) |
| 22 | 23 | { |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/z80/z80.h" | |
| 14 | 15 | #include "sound/ay8910.h" |
| 15 | 16 | |
| 16 | 17 | /* from video */ |
| r3957 | r3958 | |
| 270 | 271 | MDRV_CPU_IO_MAP(sound_io_map,0) |
| 271 | 272 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* ? */ |
| 272 | 273 | |
| 273 | MDRV_ | |
| 274 | MDRV_QUANTUM_TIME | |
| 274 | 275 | |
| 275 | 276 | MDRV_MACHINE_START(timelimt) |
| 276 | 277 | MDRV_MACHINE_RESET(timelimt) |
| r3957 | r3958 | |
|---|---|---|
| 144 | 144 | ***************************************************************************/ |
| 145 | 145 | |
| 146 | 146 | #include "driver.h" |
| 147 | #include "cpu/z80/z80.h" | |
| 147 | 148 | #include "taitoipt.h" |
| 148 | 149 | #include "rendlay.h" |
| 149 | 150 | #include "cpu/m68000/m68000.h" |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | ***************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/m68000/m68000.h" | |
| 44 | 45 | #include "deprecat.h" |
| 45 | 46 | #include "sound/okim6295.h" |
| 46 | 47 | #include "sound/2413intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/z80/z80.h" | |
| 12 | #include "cpu/m68000/m68000.h" | |
| 11 | 13 | #include "sound/2203intf.h" |
| 12 | 14 | #include "sound/okim6295.h" |
| 13 | 15 | #include "sound/msm5205.h" |
| r3957 | r3958 | |
|---|---|---|
| 151 | 151 | */ |
| 152 | 152 | |
| 153 | 153 | #include "driver.h" |
| 154 | #include "cpu/z80/z80.h" | |
| 154 | 155 | #include "sound/x1_010.h" |
| 155 | 156 | #include "includes/tnzs.h" |
| 156 | 157 |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | *********************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/mcs51/mcs51.h" | |
| 32 | #include "cpu/e132xs/e132xs.h" | |
| 31 | 33 | #include "machine/eeprom.h" |
| 32 | 34 | #include "sound/2151intf.h" |
| 33 | 35 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 77 | 77 | #define AUDIO_CLOCK (XTAL_12MHz/8) /* 12MHz is the only OSC on the PCB */ |
| 78 | 78 | |
| 79 | 79 | #include "driver.h" |
| 80 | #include "cpu/z80/z80.h" | |
| 80 | 81 | #include "deprecat.h" |
| 81 | 82 | #include "sound/ay8910.h" |
| 82 | 83 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | *****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "sound/2203intf.h" |
| 11 | 12 | |
| 12 | 13 | #define MCLK 10000000 |
| r3957 | r3958 | |
| 36 | 37 | |
| 37 | 38 | int_enable = data & 1; |
| 38 | 39 | |
| 39 | flip_screen_set(data & 2); | |
| 40 | flip_screen_set(space->machine, data & 2); | |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | static MACHINE_RESET( mayumi ) |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6800/m6800.h" | |
| 8 | 9 | #include "poolshrk.h" |
| 9 | 10 | #include "sound/discrete.h" |
| 10 | 11 |
| r3957 | r3958 | |
|---|---|---|
| 108 | 108 | **************************************************************************/ |
| 109 | 109 | |
| 110 | 110 | #include "driver.h" |
| 111 | #include "cpu/m68000/m68000.h" | |
| 111 | 112 | #include "audio/seibu.h" |
| 112 | 113 | #include "cpu/z80/z80.h" |
| 113 | 114 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | #include "cpu/nec/nec.h" | |
| 39 | 40 | #include "cpu/z80/z80.h" |
| 40 | 41 | #include "audio/seibu.h" |
| 41 | 42 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 244 | 245 | |
| 245 | 246 | SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */ |
| 246 | 247 | |
| 247 | MDRV_ | |
| 248 | MDRV_QUANTUM_TIME | |
| 248 | 249 | |
| 249 | 250 | MDRV_MACHINE_RESET(seibu_sound) |
| 250 | 251 | |
| r3957 | r3958 | |
| 283 | 284 | |
| 284 | 285 | SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */ |
| 285 | 286 | |
| 286 | MDRV_ | |
| 287 | MDRV_QUANTUM_TIME | |
| 287 | 288 | |
| 288 | 289 | MDRV_MACHINE_RESET(seibu_sound) |
| 289 | 290 |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | **************************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/m68000/m68000.h" | |
| 24 | 25 | #include "render.h" |
| 25 | 26 | #include "includes/amiga.h" |
| 26 | 27 | #include "machine/laserdsc.h" |
| r3957 | r3958 | |
| 113 | 114 | UINT8 data = laserdisc_data_r(laserdisc); |
| 114 | 115 | if (data != 0x0a) |
| 115 | 116 | mame_printf_debug("Sending serial data = %02X\n", data); |
| 116 | amiga_serial_in_w(data); | |
| 117 | amiga_serial_in_w(machine, data); | |
| 117 | 118 | } |
| 118 | 119 | |
| 119 | 120 | /* if there's more to come, set another timer */ |
| 120 | 121 | if (laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE) |
| 121 | timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0); | |
| 122 | timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0); | |
| 122 | 123 | else |
| 123 | 124 | serial_timer_active = FALSE; |
| 124 | 125 | } |
| 125 | 126 | |
| 126 | 127 | |
| 127 | static void vsync_callback( | |
| 128 | static void vsync_callback(running_machine *machine) | |
| 128 | 129 | { |
| 129 | 130 | /* if we have data available, set a timer to read it */ |
| 130 | 131 | if (!serial_timer_active && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE) |
| 131 | 132 | { |
| 132 | timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0); | |
| 133 | timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0); | |
| 133 | 134 | serial_timer_active = TRUE; |
| 134 | 135 | } |
| 135 | 136 | } |
| 136 | 137 | |
| 137 | 138 | |
| 138 | static void serial_w(UINT16 data) | |
| 139 | static void serial_w(running_machine *machine, UINT16 data) | |
| 139 | 140 | { |
| 140 | 141 | /* write to the laserdisc player */ |
| 141 | 142 | laserdisc_data_w(laserdisc, data & 0xff); |
| r3957 | r3958 | |
| 143 | 144 | /* if we have data available, set a timer to read it */ |
| 144 | 145 | if (!serial_timer_active && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE) |
| 145 | 146 | { |
| 146 | timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0); | |
| 147 | timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0); | |
| 147 | 148 | serial_timer_active = TRUE; |
| 148 | 149 | } |
| 149 | 150 | } |
| r3957 | r3958 | |
| 156 | 157 | * |
| 157 | 158 | *************************************/ |
| 158 | 159 | |
| 159 | static void alg_potgo_w(UINT16 data) | |
| 160 | static void alg_potgo_w(running_machine *machine, UINT16 data) | |
| 160 | 161 | { |
| 161 | 162 | /* bit 15 controls whether pin 9 is input/output */ |
| 162 | 163 | /* bit 14 controls the value, which selects which player's controls to read */ |
| r3957 | r3958 | |
| 390 | 391 | static const cia6526_interface cia_0_intf = |
| 391 | 392 | { |
| 392 | 393 | amiga_cia_0_irq, /* irq_func */ |
| 393 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 394 | 394 | 0, /* tod_clock */ |
| 395 | 395 | { |
| 396 | 396 | { alg_cia_0_porta_r, alg_cia_0_porta_w }, /* port A */ |
| r3957 | r3958 | |
| 401 | 401 | static const cia6526_interface cia_1_intf = |
| 402 | 402 | { |
| 403 | 403 | amiga_cia_1_irq, /* irq_func */ |
| 404 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 405 | 404 | 0, /* tod_clock */ |
| 406 | 405 | { |
| 407 | 406 | { alg_cia_1_porta_r, alg_cia_1_porta_w, }, /* port A */ |
| r3957 | r3958 | |
| 450 | 449 | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 451 | 450 | |
| 452 | 451 | /* cia */ |
| 453 | MDRV_DEVICE_ADD("cia_0", CIA8520) | |
| 454 | MDRV_DEVICE_CONFIG(cia_0_intf) | |
| 455 | MDRV_DEVICE_ADD("cia_1", CIA8520) | |
| 456 | MDRV_DEVICE_CONFIG(cia_1_intf) | |
| 452 | MDRV_CIA8520_ADD("cia_0", AMIGA_68000_NTSC_CLOCK / 10, cia_0_intf) | |
| 453 | MDRV_CIA8520_ADD("cia_1", AMIGA_68000_NTSC_CLOCK / 10, cia_1_intf) | |
| 457 | 454 | MACHINE_DRIVER_END |
| 458 | 455 | |
| 459 | 456 |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | *********************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/e132xs/e132xs.h" | |
| 16 | 17 | #include "deprecat.h" |
| 17 | 18 | #include "machine/at28c16.h" |
| 18 | 19 | #include "eolithsp.h" |
| r3957 | r3958 | |
| 182 | 183 | MDRV_VIDEO_UPDATE(vega) |
| 183 | 184 | |
| 184 | 185 | /* sound hardware */ |
| 185 | MDRV_ | |
| 186 | MDRV_AT28C16_ADD( "at28c16", NULL | |
| 186 | 187 | MACHINE_DRIVER_END |
| 187 | 188 | |
| 188 | 189 | /* |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | ***************************************************************************/ |
| 97 | 97 | |
| 98 | 98 | #include "driver.h" |
| 99 | #include "cpu/z80/z80.h" | |
| 99 | 100 | #include "sound/ay8910.h" |
| 100 | 101 | |
| 101 | 102 |
| r3957 | r3958 | |
|---|---|---|
| 189 | 189 | ***************************************************************************/ |
| 190 | 190 | |
| 191 | 191 | #include "driver.h" |
| 192 | #include "cpu/z80/z80.h" | |
| 192 | 193 | #include "audio/timeplt.h" |
| 193 | 194 | #include "sound/namco.h" |
| 194 | 195 | #include "sound/samples.h" |
| r3957 | r3958 | |
| 240 | 241 | break; |
| 241 | 242 | |
| 242 | 243 | case 0x01: /* INT ON */ |
| 243 | cpu_interrupt_enable(0,bit); | |
| 244 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 244 | 245 | if (!bit) |
| 245 | 246 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 246 | 247 | break; |
| r3957 | r3958 | |
| 251 | 252 | break; |
| 252 | 253 | |
| 253 | 254 | case 0x03: /* FLIP */ |
| 254 | flip_screen_set(bit); | |
| 255 | flip_screen_set(space->machine, bit); | |
| 255 | 256 | break; |
| 256 | 257 | |
| 257 | 258 | case 0x04: |
| r3957 | r3958 | |
| 284 | 285 | break; |
| 285 | 286 | |
| 286 | 287 | case 0x01: /* INTST */ |
| 287 | cpu_interrupt_enable(0,bit); | |
| 288 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 288 | 289 | break; |
| 289 | 290 | |
| 290 | 291 | case 0x02: /* MUT */ |
| r3957 | r3958 | |
| 292 | 293 | break; |
| 293 | 294 | |
| 294 | 295 | case 0x03: /* FLIP */ |
| 295 | flip_screen_set(bit); | |
| 296 | flip_screen_set(space->machine, bit); | |
| 296 | 297 | break; |
| 297 | 298 | |
| 298 | 299 | case 0x04: /* OUT1 */ |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | ***************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 36 | 37 | #include "sound/dac.h" |
| 37 | 38 | |
| 38 | 39 | /* from video */ |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/m68000/m68000.h" | |
| 17 | 18 | #include "sound/okim6295.h" |
| 18 | 19 | |
| 19 | 20 | static VIDEO_START(igs_m68) |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | */ |
| 88 | 88 | |
| 89 | 89 | #include "driver.h" |
| 90 | #include "cpu/z80/z80.h" | |
| 91 | #include "cpu/v60/v60.h" | |
| 90 | 92 | #include "deprecat.h" |
| 91 | 93 | #include "sound/ymf271.h" |
| 92 | 94 | #include "rendlay.h" |
| r3957 | r3958 | |
| 1335 | 1337 | // MDRV_CPU_ADD("audio", Z80, 4000000) |
| 1336 | 1338 | // MDRV_CPU_PROGRAM_MAP(bnstars_z80_map, 0) |
| 1337 | 1339 | |
| 1338 | MDRV_ | |
| 1340 | MDRV_QUANTUM_TIME | |
| 1339 | 1341 | |
| 1340 | 1342 | MDRV_MACHINE_RESET(ms32) |
| 1341 | 1343 |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | ***************************************************************************/ |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "cpu/m68000/m68000.h" | |
| 26 | 27 | #include "machine/eeprom.h" |
| 27 | 28 | #include "unico.h" |
| 28 | 29 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/z80/z80.h" | |
| 23 | 24 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 24 | 25 | #include "video/konamiic.h" |
| 25 | 26 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | */ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "cpu/pic16c5x/pic16c5x.h" | |
| 49 | #include "cpu/m68000/m68000.h" | |
| 48 | 50 | #include "sound/okim6295.h" |
| 49 | 51 | |
| 50 | 52 | static VIDEO_START( blackt96 ) |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | ***************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/m68000/m68000.h" | |
| 44 | 45 | #include "deprecat.h" |
| 45 | 46 | #include "machine/tmp68301.h" |
| 46 | 47 | #include "realbrk.h" |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | */ |
| 48 | 48 | |
| 49 | 49 | #include "driver.h" |
| 50 | #include "cpu/z80/z80.h" | |
| 51 | #include "cpu/m68000/m68000.h" | |
| 50 | 52 | #include "sound/okim6295.h" |
| 51 | 53 | |
| 52 | 54 | extern UINT16 *diverboy_spriteram; |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | ***************************************************************************/ |
| 49 | 49 | |
| 50 | 50 | #include "driver.h" |
| 51 | #include "cpu/m68000/m68000.h" | |
| 51 | 52 | #include "sound/custom.h" |
| 52 | 53 | #include "includes/amiga.h" |
| 53 | 54 | #include "machine/6526cia.h" |
| r3957 | r3958 | |
| 174 | 175 | } |
| 175 | 176 | |
| 176 | 177 | |
| 177 | static void arcadia_reset_coins( | |
| 178 | static void arcadia_reset_coins(running_machine *machine) | |
| 178 | 179 | { |
| 179 | 180 | /* reset coin counters */ |
| 180 | 181 | coin_counter[0] = coin_counter[1] = 0; |
| r3957 | r3958 | |
| 283 | 284 | static const cia6526_interface cia_0_intf = |
| 284 | 285 | { |
| 285 | 286 | amiga_cia_0_irq, /* irq_func */ |
| 286 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 287 | 287 | 0, /* tod_clock */ |
| 288 | 288 | { |
| 289 | 289 | { arcadia_cia_0_porta_r, arcadia_cia_0_porta_w }, /* port A */ |
| r3957 | r3958 | |
| 294 | 294 | static const cia6526_interface cia_1_intf = |
| 295 | 295 | { |
| 296 | 296 | amiga_cia_1_irq, /* irq_func */ |
| 297 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 298 | 297 | 0, /* tod_clock */ |
| 299 | 298 | { |
| 300 | 299 | { NULL, NULL }, /* port A */ |
| r3957 | r3958 | |
| 337 | 336 | MDRV_SOUND_ROUTE(3, "left", 0.50) |
| 338 | 337 | |
| 339 | 338 | /* cia */ |
| 340 | MDRV_DEVICE_ADD("cia_0", CIA8520) | |
| 341 | MDRV_DEVICE_CONFIG(cia_0_intf) | |
| 342 | MDRV_DEVICE_ADD("cia_1", CIA8520) | |
| 343 | MDRV_DEVICE_CONFIG(cia_1_intf) | |
| 339 | MDRV_CIA8520_ADD("cia_0", AMIGA_68000_NTSC_CLOCK / 10, cia_0_intf) | |
| 340 | MDRV_CIA8520_ADD("cia_1", AMIGA_68000_NTSC_CLOCK / 10, cia_1_intf) | |
| 344 | 341 | MACHINE_DRIVER_END |
| 345 | 342 | |
| 346 | 343 |
| r3957 | r3958 | |
|---|---|---|
| 133 | 133 | ***************************************************************************/ |
| 134 | 134 | |
| 135 | 135 | #include "driver.h" |
| 136 | #include "cpu/z80/z80.h" | |
| 136 | 137 | #include "sound/ay8910.h" |
| 137 | 138 | #include "sound/samples.h" |
| 138 | 139 | #include "audio/segasnd.h" |
| r3957 | r3958 | |
| 201 | 202 | { |
| 202 | 203 | /* if we have a Universal Sound Board, reset it here */ |
| 203 | 204 | if (has_usb) |
| 204 | sega_usb_reset(0x10); | |
| 205 | sega_usb_reset(machine, 0x10); | |
| 205 | 206 | } |
| 206 | 207 | |
| 207 | 208 |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | */ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/z80/z80.h" | |
| 44 | 45 | #include "sound/ay8910.h" |
| 45 | 46 | |
| 46 | 47 | WRITE8_HANDLER( carjmbre_flipscreen_w ); |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | ****************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "cpu/i8085/i8085.h" | |
| 41 | 42 | |
| 42 | 43 | #define MASTER_CLOCK XTAL_18MHz |
| 43 | 44 |
| r3957 | r3958 | |
|---|---|---|
| 76 | 76 | */ |
| 77 | 77 | |
| 78 | 78 | #include "driver.h" |
| 79 | #include "cpu/m68000/m68000.h" | |
| 79 | 80 | #include "sound/okim6295.h" |
| 80 | 81 | #include "sound/es8712.h" |
| 81 | 82 |
| r3957 | r3958 | |
|---|---|---|
| 227 | 227 | #define MASTER_CLOCK XTAL_16MHz |
| 228 | 228 | |
| 229 | 229 | #include "driver.h" |
| 230 | #include "cpu/z80/z80.h" | |
| 230 | 231 | #include "sound/sn76496.h" |
| 231 | 232 | #include "machine/8255ppi.h" |
| 232 | 233 |
| r3957 | r3958 | |
|---|---|---|
| 422 | 422 | MDRV_CPU_PROGRAM_MAP(superchs_cpub_readmem,superchs_cpub_writemem) |
| 423 | 423 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold)/* VBL */ |
| 424 | 424 | |
| 425 | MDRV_ | |
| 425 | MDRV_QUANTUM_TIME | |
| 426 | 426 | |
| 427 | 427 | MDRV_MACHINE_RESET(superchs) |
| 428 | 428 | MDRV_NVRAM_HANDLER(superchs) |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/z80/z80.h" | |
| 16 | 17 | #include "deprecat.h" |
| 17 | 18 | #include "cpu/m6809/m6809.h" |
| 18 | 19 | #include "video/konamiic.h" |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | */ |
| 71 | 71 | |
| 72 | 72 | #include "driver.h" |
| 73 | #include "cpu/z80/z80.h" | |
| 73 | 74 | #include "deprecat.h" |
| 74 | 75 | #include "includes/flower.h" |
| 75 | 76 |
| r3957 | r3958 | |
|---|---|---|
| 82 | 82 | */ |
| 83 | 83 | |
| 84 | 84 | #include "driver.h" |
| 85 | #include "cpu/m68000/m68000.h" | |
| 85 | 86 | #include "sound/okim6295.h" |
| 86 | 87 | |
| 87 | 88 | #define MASTER_CLOCK 32000000 |
| r3957 | r3958 | |
|---|---|---|
| 475 | 475 | |
| 476 | 476 | MDRV_MACHINE_START(xsleena) |
| 477 | 477 | |
| 478 | MDRV_ | |
| 478 | MDRV_QUANTUM_TIME | |
| 479 | 479 | |
| 480 | 480 | /* video hardware */ |
| 481 | 481 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | ***************************************************************************/ |
| 48 | 48 | |
| 49 | 49 | #include "driver.h" |
| 50 | #include "cpu/z80/z80.h" | |
| 50 | 51 | #include "deprecat.h" |
| 51 | 52 | #include "sound/2203intf.h" |
| 52 | 53 |
| r3957 | r3958 | |
|---|---|---|
| 990 | 990 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 991 | 991 | |
| 992 | 992 | // heavy sync required to prevent CPUs from fighting for video RAM access and going into deadlocks |
| 993 | MDRV_ | |
| 993 | MDRV_QUANTUM_TIME | |
| 994 | 994 | |
| 995 | 995 | MDRV_MACHINE_RESET(namcos1) |
| 996 | 996 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r3957 | r3958 | |
|---|---|---|
| 658 | 658 | MDRV_CPU_ADD("audio", M6502, MASTER_XTAL/8) |
| 659 | 659 | MDRV_CPU_PROGRAM_MAP(audio_map, 0) |
| 660 | 660 | |
| 661 | MDRV_ | |
| 661 | MDRV_QUANTUM_TIME | |
| 662 | 662 | |
| 663 | 663 | MDRV_MACHINE_START(firefox) |
| 664 | MDRV_WATCHDOG_TIME_INIT( | |
| 664 | MDRV_WATCHDOG_TIME_INIT( | |
| 665 | 665 | |
| 666 | 666 | /* video hardware */ |
| 667 | 667 | MDRV_LASERDISC_SCREEN_ADD_NTSC("main", BITMAP_FORMAT_RGB32) |
| r3957 | r3958 | |
| 675 | 675 | MDRV_LASERDISC_OVERLAY(firefox, 64*8, 525, BITMAP_FORMAT_RGB32) |
| 676 | 676 | MDRV_LASERDISC_OVERLAY_CLIP(7*8, 53*8-1, 44, 480+44) |
| 677 | 677 | |
| 678 | MDRV_DEVICE_ADD("nvram_1c",X2212) | |
| 679 | MDRV_DEVICE_ADD("nvram_1d",X2212) | |
| 678 | MDRV_X2212_ADD("nvram_1c") | |
| 679 | MDRV_X2212_ADD("nvram_1d") | |
| 680 | 680 | MDRV_RIOT6532_ADD("riot", MASTER_XTAL/8, riot_intf) |
| 681 | 681 | |
| 682 | 682 | /* sound hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/z80/z80.h" | |
| 25 | #include "cpu/hd6309/hd6309.h" | |
| 24 | 26 | #include "deprecat.h" |
| 25 | 27 | #include "video/konamiic.h" |
| 26 | 28 | #include "cpu/m6809/m6809.h" |
| r3957 | r3958 | |
|---|---|---|
| 68 | 68 | **************************************************************************/ |
| 69 | 69 | |
| 70 | 70 | #include "driver.h" |
| 71 | #include "cpu/z80/z80.h" | |
| 71 | 72 | #include "m62.h" |
| 72 | 73 | #include "iremipt.h" |
| 73 | 74 | #include "audio/irem.h" |
| r3957 | r3958 | |
|---|---|---|
| 110 | 110 | ****************************************************************************/ |
| 111 | 111 | |
| 112 | 112 | #include "driver.h" |
| 113 | #include "cpu/z80/z80.h" | |
| 113 | 114 | #include "cpu/z80/z80daisy.h" |
| 114 | 115 | #include "includes/astrocde.h" |
| 115 | 116 | #include "machine/z80ctc.h" |
| r3957 | r3958 | |
| 503 | 504 | |
| 504 | 505 | static z80ctc_interface ctc_intf = |
| 505 | 506 | { |
| 506 | "sub", /* clock comes from sub CPU */ | |
| 507 | 0, /* clock (filled in from the CPU 0 clock) */ | |
| 508 | 507 | 0, /* timer disables */ |
| 509 | 508 | ctc_interrupt, /* interrupt handler */ |
| 510 | 509 | 0, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 1467 | 1466 | MDRV_CPU_PROGRAM_MAP(tenpin_sub_map,0) |
| 1468 | 1467 | MDRV_CPU_IO_MAP(tenpin_sub_io_map,0) |
| 1469 | 1468 | |
| 1470 | MDRV_Z80CTC_ADD("ctc", ctc_intf) | |
| 1469 | MDRV_Z80CTC_ADD("ctc", ASTROCADE_CLOCK/4 /* same as "sub" */, ctc_intf) | |
| 1471 | 1470 | |
| 1472 | 1471 | /* sound hardware */ |
| 1473 | 1472 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 320 | 320 | MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem) |
| 321 | 321 | MDRV_CPU_IO_MAP(i8039_io_map,0) |
| 322 | 322 | |
| 323 | MDRV_ | |
| 323 | MDRV_QUANTUM_TIME | |
| 324 | 324 | |
| 325 | 325 | /* video hardware */ |
| 326 | 326 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | int offs; |
| 63 | 63 | |
| 64 | flip_screen_set_no_update(1); | |
| 64 | flip_screen_set_no_update(machine, 1); | |
| 65 | 65 | |
| 66 | 66 | for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien |
| 67 | 67 | { |
| r3957 | r3958 | |
| 107 | 107 | inc = 1; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | if (flip_screen_x_get()) | |
| 110 | if (flip_screen_x_get(machine)) | |
| 111 | 111 | { |
| 112 | 112 | y=240-y; |
| 113 | 113 | x=304-x; |
| r3957 | r3958 | |
|---|---|---|
| 100 | 100 | */ |
| 101 | 101 | |
| 102 | 102 | #include "driver.h" |
| 103 | #include "cpu/z80/z80.h" | |
| 104 | #include "cpu/m68000/m68000.h" | |
| 103 | 105 | #include "sound/2203intf.h" |
| 104 | 106 | #include "sound/okim6295.h" |
| 105 | 107 |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | ***************************************************************************/ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/m68000/m68000.h" | |
| 38 | 39 | #include "cpu/z80/z80.h" |
| 39 | 40 | #include "audio/seibu.h" |
| 40 | 41 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 539 | 539 | crt_access=nSO; |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | ||
| 543 | static const i8085_config dwarfd_i8085_config = | |
| 544 | { | |
| 545 | NULL, /* INTE changed callback */ | |
| 546 | NULL, /* STATUS changed callback */ | |
| 547 | dwarfd_sod_callback, /* SOD changed callback (8085A only) */ | |
| 548 | NULL /* SID changed callback (8085A only) */ | |
| 549 | }; | |
| 550 | ||
| 551 | ||
| 542 | 552 | #define NUM_LINES 25 |
| 543 | 553 | static INTERRUPT_GEN( dwarfd_interrupt ) |
| 544 | 554 | { |
| 545 | 555 | if(cpu_getiloops(device) < NUM_LINES) |
| 546 | 556 | { |
| 547 | i8085_set_sod_callback(device, dwarfd_sod_callback); | |
| 548 | 557 | cpu_set_input_line(device,I8085_RST65_LINE,HOLD_LINE); // 34 - every 8th line |
| 549 | 558 | line=cpu_getiloops(device); |
| 550 | 559 | idx=0; |
| r3957 | r3958 | |
| 689 | 698 | /* basic machine hardware */ |
| 690 | 699 | /* FIXME: The 8085A had a max clock of 6MHz, internally divided by 2! */ |
| 691 | 700 | MDRV_CPU_ADD("main", 8085A, 10595000/3*2) /* ? MHz */ |
| 692 | ||
| 701 | MDRV_CPU_CONFIG(dwarfd_i8085_config) | |
| 693 | 702 | MDRV_CPU_PROGRAM_MAP(mem_map, 0) |
| 694 | 703 | MDRV_CPU_IO_MAP(io_map, 0) |
| 695 | 704 | |
| r3957 | r3958 | |
| 776 | 785 | // src[i] = src[i]&0xe0; |
| 777 | 786 | } |
| 778 | 787 | |
| 779 | i8085_set_sod_callback(machine->cpu[0], dwarfd_sod_callback); | |
| 780 | ||
| 781 | 788 | videobuf=auto_malloc(0x8000); |
| 782 | 789 | dwarfd_ram=auto_malloc(0x1000); |
| 783 | 790 | memset(videobuf,0,0x8000); |
| r3957 | r3958 | |
|---|---|---|
| 1034 | 1034 | MDRV_CPU_ADD("mcu",M68705,18432000/6) /* OK */ |
| 1035 | 1035 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 1036 | 1036 | |
| 1037 | MDRV_ | |
| 1037 | MDRV_QUANTUM_TIME | |
| 1038 | 1038 | MDRV_MACHINE_RESET(ta7630) /* init machine */ |
| 1039 | 1039 | |
| 1040 | 1040 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | UINT8 *base; |
| 139 | 139 | } renegade_adpcm; |
| 140 | 140 | |
| 141 | static | |
| 141 | static STREAM_UPDATE( renegade_adpcm_callback | |
| 142 | 142 | { |
| 143 | 143 | struct renegade_adpcm_state *state = param; |
| 144 | 144 | stream_sample_t *dest = outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 112 | 112 | ******************************************************/ |
| 113 | 113 | |
| 114 | 114 | #include "driver.h" |
| 115 | #include "cpu/z80/z80.h" | |
| 115 | 116 | #include "sound/sn76496.h" |
| 116 | 117 | #include "video/tms9928a.h" |
| 117 | 118 | #include "machine/8255ppi.h" |
| r3957 | r3958 | |
|---|---|---|
| 695 | 695 | ***************************************************************************/ |
| 696 | 696 | |
| 697 | 697 | #include "driver.h" |
| 698 | #include "cpu/z80/z80.h" | |
| 699 | #include "cpu/mb88xx/mb88xx.h" | |
| 698 | 700 | #include "machine/atari_vg.h" |
| 699 | 701 | #include "machine/namcoio.h" |
| 700 | 702 | #include "machine/namco50.h" |
| r3957 | r3958 | |
| 725 | 727 | |
| 726 | 728 | static WRITE8_HANDLER( galaga_flip_screen_w ) |
| 727 | 729 | { |
| 728 | flip_screen_set(data & 1); | |
| 730 | flip_screen_set(space->machine, data & 1); | |
| 729 | 731 | } |
| 730 | 732 | |
| 731 | 733 | static WRITE8_HANDLER( bosco_flip_screen_w ) |
| 732 | 734 | { |
| 733 | flip_screen_set(~data & 1); | |
| 735 | flip_screen_set(space->machine, ~data & 1); | |
| 734 | 736 | } |
| 735 | 737 | |
| 736 | 738 | |
| r3957 | r3958 | |
| 741 | 743 | switch (offset) |
| 742 | 744 | { |
| 743 | 745 | case 0x00: /* IRQ1 */ |
| 744 | cpu_interrupt_enable(0,bit); | |
| 746 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 745 | 747 | if (!bit) |
| 746 | 748 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 747 | 749 | break; |
| 748 | 750 | |
| 749 | 751 | case 0x01: /* IRQ2 */ |
| 750 | cpu_interrupt_enable(1,bit); | |
| 752 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 751 | 753 | if (!bit) |
| 752 | 754 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 753 | 755 | break; |
| 754 | 756 | |
| 755 | 757 | case 0x02: /* NMION */ |
| 756 | cpu_interrupt_enable(2,!bit); | |
| 758 | cpu_interrupt_enable(space->machine->cpu[2],!bit); | |
| 757 | 759 | break; |
| 758 | 760 | |
| 759 | 761 | case 0x03: /* RESET */ |
| r3957 | r3958 | |
| 1647 | 1649 | MDRV_CPU_IO_MAP(namco_54xx_map_io,0) |
| 1648 | 1650 | |
| 1649 | 1651 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1650 | MDRV_ | |
| 1652 | MDRV_QUANTUM_TIME | |
| 1651 | 1653 | /* synchronization of the CPUs */ |
| 1652 | 1654 | MDRV_MACHINE_START(galaga) |
| 1653 | 1655 | MDRV_MACHINE_RESET(bosco) |
| r3957 | r3958 | |
| 1706 | 1708 | MDRV_CPU_IO_MAP(namco_54xx_map_io,0) |
| 1707 | 1709 | |
| 1708 | 1710 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1709 | MDRV_ | |
| 1711 | MDRV_QUANTUM_TIME | |
| 1710 | 1712 | /* synchronization of the CPUs */ |
| 1711 | 1713 | MDRV_MACHINE_START(galaga) |
| 1712 | 1714 | MDRV_MACHINE_RESET(galaga) |
| r3957 | r3958 | |
| 1780 | 1782 | MDRV_CPU_IO_MAP(namco_54xx_map_io,0) |
| 1781 | 1783 | |
| 1782 | 1784 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1783 | MDRV_ | |
| 1785 | MDRV_QUANTUM_TIME | |
| 1784 | 1786 | /* synchronization of the CPUs */ |
| 1785 | 1787 | MDRV_MACHINE_START(galaga) |
| 1786 | 1788 | MDRV_MACHINE_RESET(xevious) |
| r3957 | r3958 | |
| 1853 | 1855 | MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK/6) /* 3.072 MHz */ |
| 1854 | 1856 | MDRV_CPU_PROGRAM_MAP(digdug_map,0) |
| 1855 | 1857 | |
| 1856 | MDRV_ | |
| 1858 | MDRV_QUANTUM_TIME | |
| 1857 | 1859 | /* synchronization of the CPUs */ |
| 1858 | 1860 | MDRV_MACHINE_START(galaga) |
| 1859 | 1861 | MDRV_MACHINE_RESET(digdug) |
| r3957 | r3958 | |
|---|---|---|
| 60 | 60 | */ |
| 61 | 61 | |
| 62 | 62 | #include "driver.h" |
| 63 | #include "cpu/z80/z80.h" | |
| 64 | #include "cpu/nec/nec.h" | |
| 63 | 65 | #include "deprecat.h" |
| 64 | 66 | #include "audio/t5182.h" |
| 65 | 67 |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/z80/z80.h" | |
| 23 | 24 | #include "render.h" |
| 24 | 25 | #include "machine/laserdsc.h" |
| 25 | 26 |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/m6502/m6502.h" | |
| 31 | 32 | #include "cpu/z80/z80.h" |
| 32 | 33 | #include "lasso.h" |
| 33 | 34 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 472 | 473 | MDRV_CPU_ADD("audio", M6502, 600000) |
| 473 | 474 | MDRV_CPU_PROGRAM_MAP(lasso_audio_map, 0) |
| 474 | 475 | |
| 475 | MDRV_ | |
| 476 | MDRV_QUANTUM_TIME | |
| 476 | 477 | |
| 477 | 478 | /* video hardware */ |
| 478 | 479 | MDRV_SCREEN_ADD("main", RASTER) |
| r0 | r3958 | |
|---|---|---|
| 1 | /******************************************************************************************* | |
| 2 | ||
| 3 | Casino Winner (c) 1985 Aristocrat | |
| 4 | ||
| 5 | driver by Chris Hardy & Angelo Salese | |
| 6 | ||
| 7 | TODO: | |
| 8 | -missing prom; | |
| 9 | -NVRAM emulation? Likely to be just backup ram | |
| 10 | -Cherry-type subgames appears to have wrong graphics alignment,maybe it's some fancy window | |
| 11 | effect? | |
| 12 | ||
| 13 | *******************************************************************************************/ | |
| 14 | ||
| 15 | #include "driver.h" | |
| 16 | #include "cpu/z80/z80.h" | |
| 17 | #include "sound/ay8910.h" | |
| 18 | ||
| 19 | static UINT8 *sc0_vram,*sc0_attr; | |
| 20 | static tilemap *sc0_tilemap; | |
| 21 | ||
| 22 | static TILE_GET_INFO( get_sc0_tile_info ) | |
| 23 | { | |
| 24 | int tile = (sc0_vram[tile_index] | ((sc0_attr[tile_index] & 0x70)<<4)) & 0x7ff; | |
| 25 | int colour = sc0_attr[tile_index] & 0xf; | |
| 26 | ||
| 27 | SET_TILE_INFO( | |
| 28 | 0, | |
| 29 | tile, | |
| 30 | colour, | |
| 31 | 0); | |
| 32 | } | |
| 33 | ||
| 34 | VIDEO_START(vvillage) | |
| 35 | { | |
| 36 | sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,32,32); | |
| 37 | } | |
| 38 | ||
| 39 | VIDEO_UPDATE(vvillage) | |
| 40 | { | |
| 41 | tilemap_draw(bitmap,cliprect,sc0_tilemap,0,0); | |
| 42 | return 0; | |
| 43 | } | |
| 44 | ||
| 45 | static WRITE8_HANDLER( sc0_vram_w ) | |
| 46 | { | |
| 47 | sc0_vram[offset] = data; | |
| 48 | tilemap_mark_tile_dirty(sc0_tilemap,offset); | |
| 49 | } | |
| 50 | ||
| 51 | static WRITE8_HANDLER( sc0_attr_w ) | |
| 52 | { | |
| 53 | sc0_attr[offset] = data; | |
| 54 | tilemap_mark_tile_dirty(sc0_tilemap,offset); | |
| 55 | } | |
| 56 | ||
| 57 | /*These two are tested during the two cherry sub-games.I really don't know what is supposed to do...*/ | |
| 58 | static WRITE8_HANDLER( scroll_w ) | |
| 59 | { | |
| 60 | } | |
| 61 | ||
| 62 | /*---- --x- enable some weird effect*/ | |
| 63 | static WRITE8_HANDLER( vregs_w ) | |
| 64 | { | |
| 65 | } | |
| 66 | ||
| 67 | /********************** | |
| 68 | * | |
| 69 | * End of Video Hardware | |
| 70 | * | |
| 71 | **********************/ | |
| 72 | ||
| 73 | static READ8_HANDLER( input_buttons_r ) | |
| 74 | { | |
| 75 | return input_port_read(space->machine,"DSW1"); | |
| 76 | } | |
| 77 | ||
| 78 | static READ8_HANDLER( input_coins_r ) | |
| 79 | { | |
| 80 | return input_port_read(space->machine,"DSW2"); | |
| 81 | } | |
| 82 | ||
| 83 | static READ8_HANDLER( vvillage_rng_r ) | |
| 84 | { | |
| 85 | return mame_rand(space->machine); | |
| 86 | } | |
| 87 | ||
| 88 | static WRITE8_HANDLER( output_w ) | |
| 89 | { | |
| 90 | coin_counter_w(0,data & 1); | |
| 91 | coin_counter_w(1,data & 1); | |
| 92 | coin_lockout_w(0,data & 0x20); | |
| 93 | coin_lockout_w(1,data & 0x20); | |
| 94 | } | |
| 95 | ||
| 96 | static WRITE8_HANDLER( lamps_w ) | |
| 97 | { | |
| 98 | /* | |
| 99 | ---x ---- lamp button 5 | |
| 100 | ---- x--- lamp button 4 | |
| 101 | ---- -x-- lamp button 3 | |
| 102 | ---- --x- lamp button 2 | |
| 103 | ---- ---x lamp button 1 | |
| 104 | */ | |
| 105 | } | |
| 106 | ||
| 107 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 108 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 109 | AM_RANGE(0xa000, 0xa000) AM_READ(vvillage_rng_r) | |
| 110 | AM_RANGE(0xe000, 0xefff) AM_RAM | |
| 111 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(&sc0_vram) | |
| 112 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(sc0_attr_w) AM_BASE(&sc0_attr) | |
| 113 | ADDRESS_MAP_END | |
| 114 | ||
| 115 | static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 ) | |
| 116 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 117 | AM_RANGE(0x01,0x01) AM_READ(ay8910_read_port_0_r) | |
| 118 | AM_RANGE(0x02,0x02) AM_WRITE(ay8910_write_port_0_w) | |
| 119 | AM_RANGE(0x03,0x03) AM_WRITE(ay8910_control_port_0_w) | |
| 120 | AM_RANGE(0x10,0x10) AM_READ_PORT("IN0") | |
| 121 | AM_RANGE(0x11,0x11) AM_READ_PORT("IN1") | |
| 122 | AM_RANGE(0x10,0x10) AM_WRITE(scroll_w) | |
| 123 | AM_RANGE(0x11,0x11) AM_WRITE(vregs_w) | |
| 124 | AM_RANGE(0x12,0x12) AM_WRITE(lamps_w) | |
| 125 | AM_RANGE(0x13,0x13) AM_WRITE(output_w) | |
| 126 | ADDRESS_MAP_END | |
| 127 | ||
| 128 | ||
| 129 | static INPUT_PORTS_START( vvillage ) | |
| 130 | PORT_START("IN0") | |
| 131 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z) | |
| 132 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X) | |
| 133 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C) | |
| 134 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V) | |
| 135 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B) | |
| 136 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 137 | ||
| 138 | PORT_START("IN1") | |
| 139 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 140 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 141 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Payout") PORT_CODE(KEYCODE_7) | |
| 142 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 143 | ||
| 144 | PORT_START("DSW1") | |
| 145 | PORT_DIPNAME( 0x01, 0x00, "Poker" ) | |
| 146 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 147 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 148 | PORT_DIPNAME( 0x02, 0x00, "Black Jack" ) | |
| 149 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 150 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 151 | PORT_DIPNAME( 0x04, 0x00, "Hi & Low" ) | |
| 152 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 153 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 154 | PORT_DIPNAME( 0x08, 0x00, "Five Line" ) | |
| 155 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 156 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 157 | PORT_DIPNAME( 0x10, 0x00, "Super Conti" ) | |
| 158 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 159 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 160 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 161 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 162 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 163 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 164 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 165 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 166 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 167 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 168 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 169 | PORT_START("DSW2") | |
| 170 | PORT_DIPNAME( 0x01, 0x00, "Auto Hopper" ) | |
| 171 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 172 | PORT_DIPSETTING( 0x01, DEF_STR( Yes ) ) | |
| 173 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 174 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 175 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 176 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 177 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 178 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 179 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 180 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 181 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 182 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 183 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 184 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 185 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 186 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 187 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 188 | PORT_DIPNAME( 0x40, 0x40, "Show Dip-Switches Status" ) | |
| 189 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 190 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 191 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) ) //analyzer | |
| 192 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 193 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 194 | INPUT_PORTS_END | |
| 195 | ||
| 196 | ||
| 197 | static const gfx_layout tiles8x8_layout = | |
| 198 | { | |
| 199 | 8,8, | |
| 200 | RGN_FRAC(1,2), | |
| 201 | 2, | |
| 202 | { 0,RGN_FRAC(1,2) }, | |
| 203 | { 7, 6, 5, 4, 3, 2, 1, 0 }, | |
| 204 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 205 | 8*8 | |
| 206 | }; | |
| 207 | ||
| 208 | static GFXDECODE_START( vvillage ) | |
| 209 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) | |
| 210 | GFXDECODE_END | |
| 211 | ||
| 212 | static const ay8910_interface ay8910_config = | |
| 213 | { | |
| 214 | AY8910_LEGACY_OUTPUT, | |
| 215 | AY8910_DEFAULT_LOADS, | |
| 216 | input_buttons_r, | |
| 217 | input_coins_r, | |
| 218 | NULL, | |
| 219 | NULL | |
| 220 | }; | |
| 221 | ||
| 222 | static MACHINE_DRIVER_START( vvillage ) | |
| 223 | /* basic machine hardware */ | |
| 224 | MDRV_CPU_ADD("main", Z80,4000000) /* ? MHz */ | |
| 225 | MDRV_CPU_PROGRAM_MAP(readmem,0) | |
| 226 | MDRV_CPU_IO_MAP(portmap,0) | |
| 227 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold ) | |
| 228 | ||
| 229 | /* video hardware */ | |
| 230 | MDRV_SCREEN_ADD("main", RASTER) | |
| 231 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 232 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 233 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 234 | MDRV_SCREEN_SIZE(256, 256) | |
| 235 | MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) | |
| 236 | ||
| 237 | MDRV_GFXDECODE(vvillage) | |
| 238 | MDRV_PALETTE_LENGTH(0x100) | |
| 239 | ||
| 240 | MDRV_VIDEO_START(vvillage) | |
| 241 | MDRV_VIDEO_UPDATE(vvillage) | |
| 242 | ||
| 243 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 244 | ||
| 245 | MDRV_SOUND_ADD("ay", AY8910, 4000000 / 4) | |
| 246 | MDRV_SOUND_CONFIG(ay8910_config) | |
| 247 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) | |
| 248 | MACHINE_DRIVER_END | |
| 249 | ||
| 250 | ROM_START( caswin ) | |
| 251 | ROM_REGION( 0x8000, "main", 0 ) | |
| 252 | ROM_LOAD( "cw_v5_0_1.26", 0x0000, 0x4000, CRC(ae3d2cf0) SHA1(268572730389f12cf962782008690305fad1ac1b) ) | |
| 253 | ROM_LOAD( "cw_v5_0_2.24", 0x4000, 0x4000, CRC(2855b3b8) SHA1(f5cc0bbeee6c1fb0dc6aebc2e3af09dccdb248ad) ) | |
| 254 | ||
| 255 | ROM_REGION( 0x8000, "gfx1", 0 ) | |
| 256 | ROM_LOAD( "cw_4.19", 0x00000, 0x4000, CRC(d2deab75) SHA1(12cf3fd02dbad9a40cfa6cece0cb66ce2c4dc315) ) | |
| 257 | ROM_LOAD( "cw_3.22", 0x04000, 0x4000, CRC(7e79966c) SHA1(39190ee8cd7f3b8f895b32327f3a5555a0713315) ) | |
| 258 | ||
| 259 | ROM_REGION( 0x20, "proms", 0 ) | |
| 260 | ROM_LOAD( "prom.x", 0x00, 0x20, NO_DUMP ) | |
| 261 | ROM_END | |
| 262 | ||
| 263 | ||
| 264 | GAME( 1985, caswin, 0, vvillage, vvillage, 0, ROT270, "Aristocrat", "Casino Winner", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS ) |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | ******************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/z80/z80.h" | |
| 31 | 32 | #include "nb1413m3.h" |
| 32 | 33 | #include "sound/dac.h" |
| 33 | 34 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | ***********************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "cpu/i8085/i8085.h" | |
| 41 | 42 | #include "deprecat.h" |
| 42 | 43 | #include "cpu/mcs48/mcs48.h" |
| 43 | 44 | #include "video/resnet.h" |
| r3957 | r3958 | |
| 60 | 61 | SET_TILE_INFO(0, tileno, 0, 0); |
| 61 | 62 | } |
| 62 | 63 | |
| 63 | static void plot_pixel_sbw(int x, int y, int col) | |
| 64 | static void plot_pixel_sbw(int x, int y, int col, int flip) | |
| 64 | 65 | { |
| 65 | if (flip | |
| 66 | if (flip | |
| 66 | 67 | { |
| 67 | 68 | y = 255-y; |
| 68 | 69 | x = 247-x; |
| r3957 | r3958 | |
| 72 | 73 | |
| 73 | 74 | static WRITE8_HANDLER( sbw_videoram_w ) |
| 74 | 75 | { |
| 76 | int flip = flip_screen_get(space->machine); | |
| 75 | 77 | int x,y,i,v1,v2; |
| 76 | 78 | |
| 77 | 79 | videoram[offset] = data; |
| r3957 | r3958 | |
| 86 | 88 | |
| 87 | 89 | for(i = 0; i < 8; i++) |
| 88 | 90 | { |
| 89 | plot_pixel_sbw(x++, y, color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ) ); | |
| 91 | plot_pixel_sbw(x++, y, color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ), flip); | |
| 90 | 92 | v1 >>= 1; |
| 91 | 93 | v2 >>= 1; |
| 92 | 94 | } |
| r3957 | r3958 | |
| 147 | 149 | -----x-- 1 ? |
| 148 | 150 | ----x--- flip screen/controls |
| 149 | 151 | */ |
| 150 | flip_screen_set(data&1); | |
| 152 | flip_screen_set(space->machine, data&1); | |
| 151 | 153 | |
| 152 | 154 | if((sbw_system^data)&1) |
| 153 | 155 | { |
| r3957 | r3958 | |
|---|---|---|
| 310 | 310 | */ |
| 311 | 311 | |
| 312 | 312 | #include "driver.h" |
| 313 | #include "cpu/z80/z80.h" | |
| 313 | 314 | #include "deprecat.h" |
| 314 | 315 | #include "sound/2203intf.h" |
| 315 | 316 | |
| r3957 | r3958 | |
| 340 | 341 | static MACHINE_RESET( psychic5 ) |
| 341 | 342 | { |
| 342 | 343 | psychic5_bank_latch = 0xff; |
| 343 | flip_screen_set(0); | |
| 344 | flip_screen_set(machine, 0); | |
| 344 | 345 | } |
| 345 | 346 | |
| 346 | 347 | /*************************************************************************** |
| r3957 | r3958 | |
| 403 | 404 | // bit 7 toggles flip screen |
| 404 | 405 | if (data & 0x80) |
| 405 | 406 | { |
| 406 | flip_screen_set(!flip_screen_get()); | |
| 407 | flip_screen_set(space->machine, !flip_screen_get(space->machine)); | |
| 407 | 408 | } |
| 408 | 409 | } |
| 409 | 410 | |
| r3957 | r3958 | |
| 412 | 413 | // bit 7 toggles flip screen |
| 413 | 414 | if (data & 0x80) |
| 414 | 415 | { |
| 415 | flip_screen_set(!flip_screen_get()); | |
| 416 | flip_screen_set(space->machine, !flip_screen_get(space->machine)); | |
| 416 | 417 | } |
| 417 | 418 | } |
| 418 | 419 | |
| r3957 | r3958 | |
| 691 | 692 | MDRV_CPU_PROGRAM_MAP(psychic5_sound_map,0) |
| 692 | 693 | MDRV_CPU_IO_MAP(psychic5_soundport_map,0) |
| 693 | 694 | |
| 694 | MDRV_ | |
| 695 | MDRV_QUANTUM_TIME | |
| 695 | 696 | MDRV_MACHINE_RESET(psychic5) |
| 696 | 697 | |
| 697 | 698 | /* video hardware */ |
| r3957 | r3958 | |
| 738 | 739 | MDRV_CPU_PROGRAM_MAP(bombsa_sound_map,0) |
| 739 | 740 | MDRV_CPU_IO_MAP(bombsa_soundport_map,0) |
| 740 | 741 | |
| 741 | MDRV_ | |
| 742 | MDRV_QUANTUM_TIME | |
| 742 | 743 | MDRV_MACHINE_RESET(psychic5) |
| 743 | 744 | |
| 744 | 745 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | |
| 130 | 130 | #include "driver.h" |
| 131 | #include "cpu/z80/z80.h" | |
| 132 | #include "cpu/m68000/m68000.h" | |
| 131 | 133 | #include "taitoipt.h" |
| 132 | 134 | #include "audio/taitosnd.h" |
| 133 | 135 | #include "video/taitoic.h" |
| r3957 | r3958 | |
| 589 | 591 | MDRV_MACHINE_START(taitoh) |
| 590 | 592 | MDRV_MACHINE_RESET(taitoh) |
| 591 | 593 | |
| 592 | MDRV_ | |
| 594 | MDRV_QUANTUM_TIME | |
| 593 | 595 | |
| 594 | 596 | /* video hardware */ |
| 595 | 597 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 629 | 631 | MDRV_MACHINE_START(taitoh) |
| 630 | 632 | MDRV_MACHINE_RESET(taitoh) |
| 631 | 633 | |
| 632 | MDRV_ | |
| 634 | MDRV_QUANTUM_TIME | |
| 633 | 635 | |
| 634 | 636 | /* video hardware */ |
| 635 | 637 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 669 | 671 | MDRV_MACHINE_START(taitoh) |
| 670 | 672 | MDRV_MACHINE_RESET(taitoh) |
| 671 | 673 | |
| 672 | MDRV_ | |
| 674 | MDRV_QUANTUM_TIME | |
| 673 | 675 | |
| 674 | 676 | /* video hardware */ |
| 675 | 677 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | */ |
| 32 | 32 | |
| 33 | 33 | #include "driver.h" |
| 34 | #include "cpu/m68000/m68000.h" | |
| 34 | 35 | #include "sound/okim6295.h" |
| 35 | 36 | |
| 36 | 37 | static tilemap *bg_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | /****************************************************************************/ |
| 88 | 88 | |
| 89 | 89 | #include "driver.h" |
| 90 | #include "cpu/m6800/m6800.h" | |
| 91 | #include "cpu/i8085/i8085.h" | |
| 90 | 92 | #include "deprecat.h" |
| 91 | 93 | #include "8080bw.h" |
| 92 | 94 | #include "mw8080bw.h" |
| r3957 | r3958 | |
|---|---|---|
| 231 | 231 | ***************************************************************************/ |
| 232 | 232 | |
| 233 | 233 | #include "driver.h" |
| 234 | #include "cpu/z80/z80.h" | |
| 234 | 235 | #include "taitoipt.h" |
| 235 | 236 | #include "cpu/m68000/m68000.h" |
| 236 | 237 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "cpu/m6809/m6809.h" | |
| 53 | #include "cpu/m68000/m68000.h" | |
| 52 | 54 | #include "deprecat.h" |
| 53 | 55 | #include "sound/ay8910.h" |
| 54 | 56 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/m68000/m68000.h" | |
| 13 | 14 | #include "video/konamiic.h" |
| 14 | 15 | #include "cpu/z80/z80.h" |
| 15 | 16 | #include "sound/2608intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 51 | 51 | */ |
| 52 | 52 | |
| 53 | 53 | #include "driver.h" |
| 54 | #include "cpu/i8085/i8085.h" | |
| 54 | 55 | |
| 55 | 56 | static UINT8 *ramtek_videoram; |
| 56 | 57 | static UINT8 *mask; |
| r3957 | r3958 | |
|---|---|---|
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | 45 | #include "driver.h" |
| 46 | #include "cpu/z80/z80.h" | |
| 46 | 47 | #include "sound/sn76496.h" |
| 47 | 48 | |
| 48 | 49 |
| r3957 | r3958 | |
|---|---|---|
| 335 | 335 | |
| 336 | 336 | MDRV_MACHINE_START( cvs ) |
| 337 | 337 | |
| 338 | MDRV_ | |
| 338 | MDRV_QUANTUM_TIME | |
| 339 | 339 | |
| 340 | 340 | /* video hardware */ |
| 341 | 341 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 231 | 231 | microtouch_rx(count, data); |
| 232 | 232 | }; |
| 233 | 233 | |
| 234 | static void meritm_microtouch_tx_callback(UINT8 data) | |
| 234 | static void meritm_microtouch_tx_callback(running_machine *machine, UINT8 data) | |
| 235 | 235 | { |
| 236 | pc16552d_rx_data( | |
| 236 | pc16552d_rx_data(machine, 0, 0, data); | |
| 237 | 237 | }; |
| 238 | 238 | |
| 239 | 239 | /************************************* |
| r3957 | r3958 | |
| 241 | 241 | * Microtouch touch coordinate transformation |
| 242 | 242 | * |
| 243 | 243 | *************************************/ |
| 244 | static int meritm_touch_coord_transform(int *touch_x, int *touch_y) | |
| 244 | static int meritm_touch_coord_transform(running_machine *machine, int *touch_x, int *touch_y) | |
| 245 | 245 | { |
| 246 | 246 | int xscr = (int)((double)(*touch_x)/0x4000*544); |
| 247 | 247 | int yscr = (int)((double)(*touch_y)/0x4000*480); |
| r3957 | r3958 | |
| 281 | 281 | { |
| 282 | 282 | v9938_set_sprite_limit(0, 0); |
| 283 | 283 | v9938_set_resolution(0, RENDER_HIGH); |
| 284 | v9938_interrupt(0); | |
| 284 | v9938_interrupt(device->machine, 0); | |
| 285 | 285 | |
| 286 | 286 | v9938_set_sprite_limit(1, 0); |
| 287 | 287 | v9938_set_resolution(1, RENDER_HIGH); |
| 288 | v9938_interrupt(1); | |
| 288 | v9938_interrupt(device->machine, 1); | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | static void meritm_vdp0_interrupt(running_machine *machine, int i) |
| r3957 | r3958 | |
| 376 | 376 | static int meritm_bank; |
| 377 | 377 | static int meritm_psd_a15; |
| 378 | 378 | |
| 379 | static void meritm_crt250_switch_banks( | |
| 379 | static void meritm_crt250_switch_banks( running_machine *machine ) | |
| 380 | 380 | { |
| 381 | 381 | int rombank = (meritm_bank & 0x07) ^ 0x07; |
| 382 | 382 | |
| 383 | 383 | //logerror( "CRT250: Switching banks: rom = %0x (bank = %x)\n", rombank, meritm_bank ); |
| 384 | memory_set_bank( | |
| 384 | memory_set_bank(machine, 1, rombank ); | |
| 385 | 385 | }; |
| 386 | 386 | |
| 387 | 387 | static WRITE8_HANDLER(meritm_crt250_bank_w) |
| 388 | 388 | { |
| 389 | meritm_crt250_switch_banks(); | |
| 389 | meritm_crt250_switch_banks(space->machine); | |
| 390 | 390 | }; |
| 391 | 391 | |
| 392 | static void meritm_switch_banks( | |
| 392 | static void meritm_switch_banks( running_machine *machine ) | |
| 393 | 393 | { |
| 394 | 394 | int rambank = (meritm_psd_a15 >> 2) & 0x3; |
| 395 | 395 | int rombank = (((meritm_bank >> 3) & 0x3) << 5) | |
| r3957 | r3958 | |
| 398 | 398 | (meritm_psd_a15 & 0x1); |
| 399 | 399 | |
| 400 | 400 | //logerror( "Switching banks: rom = %0x (bank = %x), ram = %0x\n", rombank, meritm_bank, rambank); |
| 401 | memory_set_bank(Machine, 1, rombank ); | |
| 402 | memory_set_bank(Machine, 2, rombank | 0x01); | |
| 403 | memory_set_bank(Machine, 3, rambank); | |
| 401 | memory_set_bank(machine, 1, rombank ); | |
| 402 | memory_set_bank(machine, 2, rombank | 0x01); | |
| 403 | memory_set_bank(machine, 3, rambank); | |
| 404 | 404 | }; |
| 405 | 405 | |
| 406 | 406 | static WRITE8_HANDLER(meritm_psd_a15_w) |
| 407 | 407 | { |
| 408 | 408 | meritm_psd_a15 = data; |
| 409 | 409 | //logerror( "Writing PSD_A15 with %02x at PC=%04X\n", data, cpu_get_pc(space->cpu) ); |
| 410 | meritm_switch_banks(); | |
| 410 | meritm_switch_banks(space->machine); | |
| 411 | 411 | }; |
| 412 | 412 | |
| 413 | 413 | static WRITE8_HANDLER(meritm_bank_w) |
| 414 | 414 | { |
| 415 | meritm_switch_banks(); | |
| 415 | meritm_switch_banks(space->machine); | |
| 416 | 416 | }; |
| 417 | 417 | |
| 418 | 418 | /************************************* |
| r3957 | r3958 | |
| 823 | 823 | 0 |
| 824 | 824 | }; |
| 825 | 825 | |
| 826 | #ifdef UNUSED_FUNCTION | |
| 827 | static void meritm_pio1_portb_input_changed_callback(void *param, UINT32 oldval, UINT32 newval) | |
| 828 | { | |
| 829 | z80pio_p_w(Machine, 1, 1, (UINT8)newval); | |
| 830 | } | |
| 831 | #endif | |
| 832 | ||
| 833 | 826 | static const z80_daisy_chain meritm_daisy_chain[] = |
| 834 | 827 | { |
| 835 | 828 | { Z80PIO, "z80pio_1" }, |
| r3957 | r3958 | |
| 841 | 834 | { |
| 842 | 835 | meritm_z80pio[0] = devtag_get_device( machine, Z80PIO, "z80pio_0" ); |
| 843 | 836 | meritm_z80pio[1] = devtag_get_device( machine, Z80PIO, "z80pio_1" ); |
| 844 | //input_port_set_changed_callback(port_tag_to_index("PIO1_PORTB"), 0xff, meritm_pio1_portb_input_changed_callback, NULL); | |
| 845 | 837 | |
| 846 | 838 | }; |
| 847 | 839 | |
| r3957 | r3958 | |
| 849 | 841 | { |
| 850 | 842 | memory_configure_bank(machine, 1, 0, 8, memory_region(machine, "main"), 0x10000); |
| 851 | 843 | meritm_bank = 0xff; |
| 852 | meritm_crt250_switch_banks(); | |
| 844 | meritm_crt250_switch_banks(machine); | |
| 853 | 845 | MACHINE_START_CALL(merit_common); |
| 854 | 846 | state_save_register_global(machine, meritm_bank); |
| 855 | 847 | |
| r3957 | r3958 | |
| 870 | 862 | memory_configure_bank(machine, 3, 0, 4, meritm_ram, 0x2000); |
| 871 | 863 | meritm_bank = 0xff; |
| 872 | 864 | meritm_psd_a15 = 0; |
| 873 | meritm_switch_banks(); | |
| 865 | meritm_switch_banks(machine); | |
| 874 | 866 | MACHINE_START_CALL(merit_common); |
| 875 | 867 | pc16552d_init(machine, 0, UART_CLK, NULL, pc16650d_tx_callback); |
| 876 | 868 | microtouch_init(machine, meritm_microtouch_tx_callback, meritm_touch_coord_transform); |
| r3957 | r3958 | |
| 953 | 945 | |
| 954 | 946 | MDRV_PPI8255_RECONFIG( "ppi8255", crt260_ppi8255_intf ) |
| 955 | 947 | |
| 956 | MDRV_WATCHDOG_TIME_INIT( | |
| 948 | MDRV_WATCHDOG_TIME_INIT( | |
| 957 | 949 | MDRV_MACHINE_START(meritm_crt260) |
| 958 | 950 | |
| 959 | 951 | MDRV_NVRAM_HANDLER(meritm_crt260) |
| r3957 | r3958 | |
|---|---|---|
| 132 | 132 | ***************************************************************************/ |
| 133 | 133 | |
| 134 | 134 | #include "driver.h" |
| 135 | #include "cpu/z80/z80.h" | |
| 135 | 136 | #include "cpu/m68000/m68000.h" |
| 136 | 137 | #include "video/taitoic.h" |
| 137 | 138 | #include "audio/taitosnd.h" |
| r3957 | r3958 | |
| 535 | 536 | MDRV_CPU_ADD("audio", Z80,32000000/8) /* 4 MHz */ |
| 536 | 537 | MDRV_CPU_PROGRAM_MAP(z80_sound_readmem,z80_sound_writemem) |
| 537 | 538 | |
| 538 | MDRV_ | |
| 539 | MDRV_QUANTUM_TIME | |
| 539 | 540 | |
| 540 | 541 | MDRV_MACHINE_START(slapshot) |
| 541 | 542 | |
| r3957 | r3958 | |
| 564 | 565 | MDRV_SOUND_ROUTE(1, "left", 1.0) |
| 565 | 566 | MDRV_SOUND_ROUTE(2, "right", 1.0) |
| 566 | 567 | |
| 567 | MDRV_ | |
| 568 | MDRV_MK48T08_ADD( "mk48t08" | |
| 568 | 569 | MACHINE_DRIVER_END |
| 569 | 570 | |
| 570 | 571 | static MACHINE_DRIVER_START( opwolf3 ) |
| r3957 | r3958 | |
| 577 | 578 | MDRV_CPU_ADD("audio", Z80,32000000/8) /* 4 MHz */ |
| 578 | 579 | MDRV_CPU_PROGRAM_MAP(z80_sound_readmem,z80_sound_writemem) |
| 579 | 580 | |
| 580 | MDRV_ | |
| 581 | MDRV_QUANTUM_TIME | |
| 581 | 582 | |
| 582 | 583 | /* video hardware */ |
| 583 | 584 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 604 | 605 | MDRV_SOUND_ROUTE(1, "left", 1.0) |
| 605 | 606 | MDRV_SOUND_ROUTE(2, "right", 1.0) |
| 606 | 607 | |
| 607 | MDRV_ | |
| 608 | MDRV_MK48T08_ADD( "mk48t08" | |
| 608 | 609 | MACHINE_DRIVER_END |
| 609 | 610 | |
| 610 | 611 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 130 | 130 | ***************************************************************************/ |
| 131 | 131 | |
| 132 | 132 | #include "driver.h" |
| 133 | #include "cpu/m6502/m6502.h" | |
| 133 | 134 | #include "rendlay.h" |
| 134 | 135 | #include "video/ppu2c0x.h" |
| 135 | 136 | #include "machine/rp5h01.h" |
| r3957 | r3958 | |
| 137 | 138 | #include "sound/nes_apu.h" |
| 138 | 139 | #include "includes/vsnes.h" |
| 139 | 140 | |
| 140 | /* clock frequency */ | |
| 141 | #define N2A03_DEFAULTCLOCK ( 21477272.724 / 12 ) | |
| 142 | ||
| 143 | 141 | #define DUAL_RBI 1 |
| 144 | 142 | |
| 145 | 143 | /******************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 95 | 95 | ***************************************************************************/ |
| 96 | 96 | |
| 97 | 97 | #include "driver.h" |
| 98 | #include "cpu/z80/z80.h" | |
| 98 | 99 | #include "exidy.h" |
| 99 | 100 | #include "victory.h" |
| 100 | 101 |
| r3957 | r3958 | |
|---|---|---|
| 667 | 667 | |
| 668 | 668 | |
| 669 | 669 | #include "driver.h" |
| 670 | #include "cpu/z80/z80.h" | |
| 670 | 671 | #include "sound/ay8910.h" |
| 671 | 672 | #include "sound/sn76496.h" |
| 672 | 673 | #include "sound/msm5205.h" |
| r3957 | r3958 | |
| 724 | 725 | bit 0 contains the screen orientation. |
| 725 | 726 | */ |
| 726 | 727 | ym2149_portb = data; |
| 727 | flip_screen_set(data & 0x01); | |
| 728 | flip_screen_set(space->machine, data & 0x01); | |
| 728 | 729 | } |
| 729 | 730 | |
| 730 | 731 | static READ8_HANDLER( usart_8251_r ) |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | ***************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/z80/z80.h" | |
| 45 | #include "cpu/m68000/m68000.h" | |
| 44 | 46 | #include "cninja.h" |
| 45 | 47 | #include "cpu/h6280/h6280.h" |
| 46 | 48 | #include "deco16ic.h" |
| r3957 | r3958 | |
|---|---|---|
| 173 | 173 | ***************************************************************************/ |
| 174 | 174 | |
| 175 | 175 | #include "driver.h" |
| 176 | #include "cpu/m6809/m6809.h" | |
| 176 | 177 | #include "cpu/m6800/m6800.h" |
| 177 | 178 | #include "sound/namco.h" |
| 178 | 179 | |
| r3957 | r3958 | |
| 199 | 200 | static WRITE8_HANDLER( pacland_flipscreen_w ) |
| 200 | 201 | { |
| 201 | 202 | int bit = !BIT(offset,11); |
| 202 | /* can't use flip_screen_set() because the visible area is asymmetrical */ | |
| 203 | flip_screen_set_no_update(bit); | |
| 204 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 203 | /* can't use flip_screen_set(space->machine, ) because the visible area is asymmetrical */ | |
| 204 | flip_screen_set_no_update(space->machine, bit); | |
| 205 | tilemap_set_flip(ALL_TILEMAPS,flip_screen_get(space->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 205 | 206 | } |
| 206 | 207 | |
| 207 | 208 | |
| r3957 | r3958 | |
| 232 | 233 | static WRITE8_HANDLER( pacland_irq_1_ctrl_w ) |
| 233 | 234 | { |
| 234 | 235 | int bit = !BIT(offset,11); |
| 235 | cpu_interrupt_enable(0,bit); | |
| 236 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 236 | 237 | if (!bit) |
| 237 | 238 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 238 | 239 | } |
| r3957 | r3958 | |
| 240 | 241 | static WRITE8_HANDLER( pacland_irq_2_ctrl_w ) |
| 241 | 242 | { |
| 242 | 243 | int bit = !BIT(offset,13); |
| 243 | cpu_interrupt_enable(1,bit); | |
| 244 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 244 | 245 | if (!bit) |
| 245 | 246 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 246 | 247 | } |
| r3957 | r3958 | |
| 422 | 423 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 423 | 424 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 424 | 425 | |
| 425 | MDRV_ | |
| 426 | MDRV_QUANTUM_TIME | |
| 426 | 427 | |
| 427 | 428 | /* video hardware */ |
| 428 | 429 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | |
| 126 | 126 | #include "driver.h" |
| 127 | #include "cpu/z80/z80.h" | |
| 127 | 128 | #include "cpu/tms32010/tms32010.h" |
| 128 | 129 | #include "twincobr.h" |
| 129 | 130 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 451 | 452 | /* Data Map is internal to the CPU */ |
| 452 | 453 | MDRV_CPU_IO_MAP(DSP_io_map, 0) |
| 453 | 454 | |
| 454 | MDRV_ | |
| 455 | MDRV_QUANTUM_TIME | |
| 455 | 456 | |
| 456 | 457 | MDRV_MACHINE_RESET(wardner) |
| 457 | 458 |
| r3957 | r3958 | |
|---|---|---|
| 293 | 293 | |
| 294 | 294 | ***************************************************************************/ |
| 295 | 295 | #include "driver.h" |
| 296 | #include "cpu/spc700/spc700.h" | |
| 297 | #include "cpu/g65816/g65816.h" | |
| 296 | 298 | #include "includes/snes.h" |
| 297 | 299 | |
| 298 | 300 | static ADDRESS_MAP_START( snes_map, ADDRESS_SPACE_PROGRAM, 8) |
| r3957 | r3958 | |
| 418 | 420 | MDRV_CPU_ADD("audio", SPC700, 2048000/2) /* 2.048 Mhz, but internal divider */ |
| 419 | 421 | MDRV_CPU_PROGRAM_MAP(spc_mem, 0) |
| 420 | 422 | |
| 421 | MDRV_ | |
| 423 | MDRV_QUANTUM_TIME | |
| 422 | 424 | |
| 423 | 425 | MDRV_MACHINE_START( snes ) |
| 424 | 426 | MDRV_MACHINE_RESET( snes ) |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "cpu/m68000/m68000.h" | |
| 37 | 38 | #include "decocrpt.h" |
| 38 | 39 | #include "decoprot.h" |
| 39 | 40 | #include "deco16ic.h" |
| r3957 | r3958 | |
| 81 | 82 | inc = 1; |
| 82 | 83 | } |
| 83 | 84 | |
| 84 | if (flip_screen_get()) | |
| 85 | if (flip_screen_get(machine)) | |
| 85 | 86 | { |
| 86 | 87 | y=240-y; |
| 87 | 88 | x=304-x; |
| r3957 | r3958 | |
| 120 | 121 | |
| 121 | 122 | static VIDEO_UPDATE(mirage) |
| 122 | 123 | { |
| 123 | flip_screen_set( deco16_pf12_control[0]&0x80 ); | |
| 124 | flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); | |
| 124 | 125 | deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); |
| 125 | 126 | |
| 126 | 127 | bitmap_fill(bitmap,cliprect,256); /* not verified */ |
| r3957 | r3958 | |
|---|---|---|
| 350 | 350 | MDRV_CPU_ADD("cpu2", M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 351 | 351 | MDRV_CPU_PROGRAM_MAP(readmem_cpu2,writemem_cpu2) |
| 352 | 352 | |
| 353 | MDRV_ | |
| 353 | MDRV_QUANTUM_TIME | |
| 354 | 354 | |
| 355 | 355 | /* video hardware */ |
| 356 | 356 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 328 | 328 | *****************************************************************************************/ |
| 329 | 329 | |
| 330 | 330 | #include "driver.h" |
| 331 | #include "cpu/m6502/m6502.h" | |
| 331 | 332 | #include "sound/pokey.h" |
| 332 | 333 | |
| 333 | 334 |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | */ |
| 80 | 80 | |
| 81 | 81 | #include "driver.h" |
| 82 | #include "cpu/z80/z80.h" | |
| 82 | 83 | #include "deprecat.h" |
| 83 | 84 | #include "sound/ay8910.h" |
| 84 | 85 | |
| r3957 | r3958 | |
| 318 | 319 | MDRV_CPU_PROGRAM_MAP(popper_sound_readmem,popper_sound_writemem) |
| 319 | 320 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) //NMIs caused by the main CPU |
| 320 | 321 | |
| 321 | MDRV_ | |
| 322 | MDRV_QUANTUM_TIME | |
| 322 | 323 | |
| 323 | 324 | /* video hardware */ |
| 324 | 325 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | #define ladyfrog_scr_size 0 |
| 48 | 48 | |
| 49 | 49 | #include "driver.h" |
| 50 | #include "cpu/z80/z80.h" | |
| 50 | 51 | #include "deprecat.h" |
| 51 | 52 | #include "sound/ay8910.h" |
| 52 | 53 | #include "sound/msm5232.h" |
| r3957 | r3958 | |
| 289 | 290 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) |
| 290 | 291 | |
| 291 | 292 | /* video hardware */ |
| 292 | MDRV_ | |
| 293 | MDRV_QUANTUM_TIME | |
| 293 | 294 | |
| 294 | 295 | |
| 295 | 296 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/m68000/m68000.h" | |
| 25 | 26 | |
| 26 | 27 | static UINT16* go2000_video; |
| 27 | 28 | static UINT16* go2000_video2; |
| r3957 | r3958 | |
|---|---|---|
| 841 | 841 | MDRV_CPU_IO_MAP(cpu2_port_am,0) |
| 842 | 842 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 843 | 843 | |
| 844 | MDRV_ | |
| 844 | MDRV_QUANTUM_TIME | |
| 845 | 845 | |
| 846 | 846 | MDRV_SCREEN_ADD("main", RASTER) |
| 847 | 847 | MDRV_SCREEN_REFRESH_RATE(60) |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | #include "cpu/z80/z80.h" | |
| 39 | 40 | #include "sound/2203intf.h" |
| 40 | 41 | #include "sound/2151intf.h" |
| 41 | 42 | |
| r3957 | r3958 | |
| 812 | 813 | MDRV_CPU_IO_MAP(whizz_io_map,0) |
| 813 | 814 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 814 | 815 | |
| 815 | MDRV_ | |
| 816 | MDRV_QUANTUM_TIME | |
| 816 | 817 | |
| 817 | 818 | /* video hardware */ |
| 818 | 819 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
|---|---|---|
| 311 | 311 | ***************************************************************************/ |
| 312 | 312 | |
| 313 | 313 | #include "driver.h" |
| 314 | #include "cpu/z80/z80.h" | |
| 315 | #include "cpu/m68000/m68000.h" | |
| 314 | 316 | #include "taitoipt.h" |
| 315 | 317 | #include "audio/taitosnd.h" |
| 316 | 318 | #include "seta.h" |
| r3957 | r3958 | |
| 1003 | 1005 | MDRV_CPU_ADD("audio", Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 1004 | 1006 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 1005 | 1007 | |
| 1006 | MDRV_ | |
| 1008 | MDRV_QUANTUM_TIME | |
| 1007 | 1009 | |
| 1008 | 1010 | MDRV_MACHINE_START(taitox) |
| 1009 | 1011 | MDRV_MACHINE_RESET(cchip1) |
| r3957 | r3958 | |
| 1043 | 1045 | MDRV_CPU_ADD("audio", Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 1044 | 1046 | MDRV_CPU_PROGRAM_MAP(daisenpu_sound_readmem,daisenpu_sound_writemem) |
| 1045 | 1047 | |
| 1046 | MDRV_ | |
| 1048 | MDRV_QUANTUM_TIME | |
| 1047 | 1049 | |
| 1048 | 1050 | MDRV_MACHINE_START(taitox) |
| 1049 | 1051 | |
| r3957 | r3958 | |
| 1080 | 1082 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz ??? */ |
| 1081 | 1083 | MDRV_CPU_PROGRAM_MAP(ballbros_sound_readmem,ballbros_sound_writemem) |
| 1082 | 1084 | |
| 1083 | MDRV_ | |
| 1085 | MDRV_QUANTUM_TIME | |
| 1084 | 1086 | |
| 1085 | 1087 | MDRV_MACHINE_START(taitox) |
| 1086 | 1088 | |
| r3957 | r3958 | |
| 1119 | 1121 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz ??? */ |
| 1120 | 1122 | MDRV_CPU_PROGRAM_MAP(ballbros_sound_readmem,ballbros_sound_writemem) |
| 1121 | 1123 | |
| 1122 | MDRV_ | |
| 1124 | MDRV_QUANTUM_TIME | |
| 1123 | 1125 | |
| 1124 | 1126 | MDRV_MACHINE_START(taitox) |
| 1125 | 1127 |
| r3957 | r3958 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | static WRITE8_HANDLER( joinem_misc_w ) |
| 85 | 85 | { |
| 86 | flip_screen_set(data & 0x80); | |
| 86 | flip_screen_set(space->machine, data & 0x80); | |
| 87 | 87 | joinem_snd_bit = data & 1; |
| 88 | 88 | } |
| 89 | 89 |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/m68000/m68000.h" | |
| 43 | 44 | #include "cpu/h6280/h6280.h" |
| 44 | 45 | #include "decocrpt.h" |
| 45 | 46 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/m6502/m6502.h" | |
| 11 | 12 | #include "deprecat.h" |
| 12 | 13 | #include "dogfgt.h" |
| 13 | 14 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 248 | 249 | MDRV_CPU_ADD("sub", M6502, 1500000) /* 1.5 MHz ???? */ |
| 249 | 250 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 250 | 251 | |
| 251 | MDRV_ | |
| 252 | MDRV_QUANTUM_TIME | |
| 252 | 253 | |
| 253 | 254 | /* video hardware */ |
| 254 | 255 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m68000/m68000.h" | |
| 8 | 9 | #include "cpu/h6280/h6280.h" |
| 9 | 10 | #include "sound/2151intf.h" |
| 10 | 11 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 1884 | 1884 | MDRV_CPU_ADD("mcu", M68705,3000000) /* xtal is 3MHz, divided by 4 internally */ |
| 1885 | 1885 | MDRV_CPU_PROGRAM_MAP(taitosj_mcu_map,0) |
| 1886 | 1886 | |
| 1887 | MDRV_ | |
| 1887 | MDRV_QUANTUM_TIME | |
| 1888 | 1888 | MACHINE_DRIVER_END |
| 1889 | 1889 | |
| 1890 | 1890 |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/z80/z80.h" | |
| 18 | 19 | #include "deprecat.h" |
| 19 | 20 | #include "audio/m72.h" |
| 20 | 21 | #include "sound/dac.h" |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | 18 | #include "driver.h" |
| 19 | #include "cpu/z80/z80.h" | |
| 19 | 20 | #include "sound/ay8910.h" |
| 20 | 21 | #include "sound/dac.h" |
| 21 | 22 | |
| r3957 | r3958 | |
| 559 | 560 | MDRV_CPU_IO_MAP(sound_io_map,0) |
| 560 | 561 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 6000) /* Hz */ |
| 561 | 562 | |
| 562 | MDRV_ | |
| 563 | MDRV_QUANTUM_TIME | |
| 563 | 564 | |
| 564 | 565 | /* video hardware */ |
| 565 | 566 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 609 | 610 | MDRV_CPU_IO_MAP(rk_sound_io_map,0) |
| 610 | 611 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 6000) /* Hz */ |
| 611 | 612 | |
| 612 | MDRV_ | |
| 613 | MDRV_QUANTUM_TIME | |
| 613 | 614 | |
| 614 | 615 | /* video hardware */ |
| 615 | 616 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/z80/z80.h" | |
| 31 | 32 | #include "sound/dac.h" |
| 32 | 33 | #include "sound/3812intf.h" |
| 33 | 34 | |
| r3957 | r3958 | |
| 53 | 54 | UINT8 *RAM = memory_region(machine, "main"); |
| 54 | 55 | |
| 55 | 56 | memory_set_bankptr(machine, 1,&RAM[0x10000]); |
| 56 | c | |
| 57 | device | |
| 57 | 58 | // layers = 0x60; |
| 58 | 59 | } |
| 59 | 60 |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | ******************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/z80/z80.h" | |
| 32 | 33 | #include "deprecat.h" |
| 33 | 34 | #include "nb1413m3.h" |
| 34 | 35 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 68 | 69 | |
| 69 | 70 | static MACHINE_RESET( nbmj8991 ) |
| 70 | 71 | { |
| 71 | if (machine->c | |
| 72 | if (cpu_get_type(machine->c | |
| 72 | 73 | { |
| 73 | 74 | memory_configure_bank(machine, 1, 0, 4, memory_region(machine, "audio") + 0x8000, 0x8000); |
| 74 | 75 | memory_set_bank(machine, 1, 0); |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/m68000/m68000.h" | |
| 13 | 14 | #include "deprecat.h" |
| 14 | 15 | #include "cpu/z80/z80.h" |
| 15 | 16 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 360 | 361 | GAME( 1989, blockout, 0, blockout, blockout, 0, ROT0, "Technos + California Dreams", "Block Out (set 1)", 0 ) |
| 361 | 362 | GAME( 1989, blckout2, blockout, blockout, blockout, 0, ROT0, "Technos + California Dreams", "Block Out (set 2)", 0 ) |
| 362 | 363 | GAME( 1989, blckoutj, blockout, blockout, blckoutj, 0, ROT0, "Technos + California Dreams", "Block Out (Japan)", 0 ) |
| 363 | GAME( 1991, agress, 0, blockout, agress, 0, ROT0, "Palco", "Agress", GAME_IMPERFECT_GRAPHICS ) | |
| 364 | GAME( 2003, agressb, agress, blockout, agress, 0, ROT0, "Palco", "Agress (English bootleg)", GAME_IMPERFECT_GRAPHICS ) | |
| 364 | GAME( 1991, agress, 0, blockout, agress, 0, ROT0, "Palco", "Agress", 0 ) | |
| 365 | GAME( 2003, agressb, agress, blockout, agress, 0, ROT0, "Palco", "Agress (English bootleg)", 0 ) |
| r3957 | r3958 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | static WRITE8_HANDLER( flip_screen_w ) |
| 123 | 123 | { |
| 124 | flip_screen_set(data); | |
| 124 | flip_screen_set(space->machine, data); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static WRITE8_HANDLER( tsamurai_coin_counter_w ) |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/arm7/arm7.h" | |
| 18 | 19 | #include "cpu/arm7/arm7core.h" |
| 19 | 20 | |
| 20 | 21 |
| r3957 | r3958 | |
|---|---|---|
| 37 | 37 | ***************************************************************************/ |
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | #include "cpu/m6502/m6502.h" | |
| 40 | 41 | #include "canyon.h" |
| 41 | 42 | #include "sound/discrete.h" |
| 42 | 43 |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "cpu/z80/z80.h" | |
| 28 | 29 | #include "sound/ay8910.h" |
| 29 | 30 | |
| 30 | 31 | /* it uses the same palette layout as in naughtyb */ |
| r3957 | r3958 | |
| 64 | 65 | |
| 65 | 66 | coin_counter_w(0, data & 0x80); |
| 66 | 67 | |
| 67 | flip_screen_set(data & 1); | |
| 68 | flip_screen_set(space->machine, data & 1); | |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | static READ8_HANDLER( ettrivia_question_r ) |
| r3957 | r3958 | |
|---|---|---|
| 101 | 101 | *******************************************************************************************/ |
| 102 | 102 | |
| 103 | 103 | #include "driver.h" |
| 104 | #include "deprecat.h" | |
| 105 | 104 | #include "cpu/m68000/m68000.h" |
| 106 | 105 | #include "sound/okim6295.h" |
| 107 | 106 | |
| r3957 | r3958 | |
| 893 | 892 | static WRITE16_HANDLER( jalmah_flip_screen_w ) |
| 894 | 893 | { |
| 895 | 894 | /*---- ----x flip screen*/ |
| 896 | flip_screen_set(data & 1); | |
| 895 | flip_screen_set(space->machine, data & 1); | |
| 897 | 896 | |
| 898 | 897 | // popmessage("%04x",data); |
| 899 | 898 | } |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/z80/z80.h" | |
| 24 | #include "cpu/m68000/m68000.h" | |
| 23 | 25 | #include "video/konamiic.h" |
| 24 | 26 | #include "f1gp.h" |
| 25 | 27 | #include "sound/2610intf.h" |
| r3957 | r3958 | |
| 483 | 485 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 484 | 486 | MDRV_CPU_IO_MAP(sound_io_map,0) |
| 485 | 487 | |
| 486 | MDRV_ | |
| 488 | MDRV_QUANTUM_TIME | |
| 487 | 489 | |
| 488 | 490 | /* video hardware */ |
| 489 | 491 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 522 | 524 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold) |
| 523 | 525 | |
| 524 | 526 | /* NO sound CPU */ |
| 525 | MDRV_ | |
| 527 | MDRV_QUANTUM_TIME | |
| 526 | 528 | |
| 527 | 529 | /* video hardware */ |
| 528 | 530 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/z80/z80.h" | |
| 27 | 28 | #include "sound/ay8910.h" |
| 28 | 29 | |
| 29 | 30 | static tilemap *fg_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | ***************************************************************************/ |
| 75 | 75 | |
| 76 | 76 | #include "driver.h" |
| 77 | #include "cpu/z80/z80.h" | |
| 77 | 78 | #include "sound/ay8910.h" |
| 78 | 79 | |
| 79 | 80 | extern WRITE8_HANDLER( lvcards_videoram_w ); |
| r3957 | r3958 | |
|---|---|---|
| 447 | 447 | ***************************************************************************/ |
| 448 | 448 | |
| 449 | 449 | #include "driver.h" |
| 450 | #include "cpu/m68000/m68000.h" | |
| 451 | #include "cpu/m6805/m6805.h" | |
| 450 | 452 | #include "deprecat.h" |
| 451 | 453 | #include "namcos2.h" |
| 452 | 454 | #include "cpu/m6809/m6809.h" |
| r3957 | r3958 | |
| 1602 | 1604 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1603 | 1605 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1604 | 1606 | |
| 1605 | MDRV_ | |
| 1607 | MDRV_QUANTUM_TIME | |
| 1606 | 1608 | |
| 1607 | 1609 | MDRV_MACHINE_START(namcos2) |
| 1608 | 1610 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
| 1676 | 1678 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1677 | 1679 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1678 | 1680 | |
| 1679 | MDRV_ | |
| 1681 | MDRV_QUANTUM_TIME | |
| 1680 | 1682 | |
| 1681 | 1683 | MDRV_MACHINE_START(namcos2) |
| 1682 | 1684 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
| 1726 | 1728 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1727 | 1729 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1728 | 1730 | |
| 1729 | MDRV_ | |
| 1731 | MDRV_QUANTUM_TIME | |
| 1730 | 1732 | |
| 1731 | 1733 | MDRV_MACHINE_START(namcos2) |
| 1732 | 1734 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
| 1776 | 1778 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1777 | 1779 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1778 | 1780 | |
| 1779 | MDRV_ | |
| 1781 | MDRV_QUANTUM_TIME | |
| 1780 | 1782 | |
| 1781 | 1783 | MDRV_MACHINE_START(namcos2) |
| 1782 | 1784 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
| 1826 | 1828 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1827 | 1829 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1828 | 1830 | |
| 1829 | MDRV_ | |
| 1831 | MDRV_QUANTUM_TIME | |
| 1830 | 1832 | |
| 1831 | 1833 | MDRV_MACHINE_START(namcos2) |
| 1832 | 1834 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
| 1876 | 1878 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1877 | 1879 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1878 | 1880 | |
| 1879 | MDRV_ | |
| 1881 | MDRV_QUANTUM_TIME | |
| 1880 | 1882 | |
| 1881 | 1883 | MDRV_MACHINE_START(namcos2) |
| 1882 | 1884 | MDRV_MACHINE_RESET(namcos2) |
| r3957 | r3958 | |
|---|---|---|
| 116 | 116 | ***************************************************************************/ |
| 117 | 117 | |
| 118 | 118 | #include "driver.h" |
| 119 | #include "cpu/z80/z80.h" | |
| 119 | 120 | #include "cpu/mcs48/mcs48.h" |
| 120 | 121 | #include "sound/ay8910.h" |
| 121 | 122 | #include "sound/samples.h" |
| r3957 | r3958 | |
| 215 | 216 | |
| 216 | 217 | static WRITE8_HANDLER( m63_flipscreen_w ) |
| 217 | 218 | { |
| 218 | if (flip_screen_get() != (~data & 0x01)) | |
| 219 | if (flip_screen_get(space->machine) != (~data & 0x01)) | |
| 219 | 220 | { |
| 220 | flip_screen_set(~data & 0x01); | |
| 221 | flip_screen_set(space->machine, ~data & 0x01); | |
| 221 | 222 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 222 | 223 | } |
| 223 | 224 | } |
| 224 | 225 | |
| 225 | 226 | static WRITE8_HANDLER( fghtbskt_flipscreen_w ) |
| 226 | 227 | { |
| 227 | flip_screen_set(data); | |
| 228 | fg_flag = flip_screen_get() ? TILE_FLIPX : 0; | |
| 228 | flip_screen_set(space->machine, data); | |
| 229 | fg_flag = flip_screen_get(space->machine) ? TILE_FLIPX : 0; | |
| 229 | 230 | } |
| 230 | 231 | |
| 231 | 232 | |
| r3957 | r3958 | |
| 272 | 273 | int sx = spriteram[offs + 3]; |
| 273 | 274 | int sy = sy_offset - spriteram[offs]; |
| 274 | 275 | |
| 275 | if (flip_screen_get()) | |
| 276 | if (flip_screen_get(machine)) | |
| 276 | 277 | { |
| 277 | 278 | sx = 240 - sx; |
| 278 | 279 | sy = sy_offset - sy; |
| r3957 | r3958 | |
|---|---|---|
| 68 | 68 | ***************************************************************************/ |
| 69 | 69 | |
| 70 | 70 | #include "driver.h" |
| 71 | #include "cpu/z80/z80.h" | |
| 71 | 72 | #include "deprecat.h" |
| 72 | 73 | #include "sound/dac.h" |
| 73 | 74 | #include "sound/sn76477.h" |
| r3957 | r3958 | |
|---|---|---|
| 182 | 182 | */ |
| 183 | 183 | |
| 184 | 184 | #include "driver.h" |
| 185 | #include "cpu/z80/z80.h" | |
| 185 | 186 | #include "machine/eeprom.h" |
| 186 | 187 | #include "tecmosys.h" |
| 187 | 188 | #include "cpu/m68000/m68000.h" |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | ****************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/z80/z80.h" | |
| 31 | 32 | #include "taitoipt.h" |
| 32 | 33 | #include "audio/taitosnd.h" |
| 33 | 34 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 81 | 82 | } |
| 82 | 83 | } |
| 83 | 84 | |
| 84 | flip_screen_set(data & 0x40); | |
| 85 | flip_screen_set(space->machine, data & 0x40); | |
| 85 | 86 | } |
| 86 | 87 | |
| 87 | 88 | static WRITE8_HANDLER( exzisus_cpub_bankswitch_w ) |
| r3957 | r3958 | |
| 98 | 99 | } |
| 99 | 100 | } |
| 100 | 101 | |
| 101 | flip_screen_set(data & 0x40); | |
| 102 | flip_screen_set(space->machine, data & 0x40); | |
| 102 | 103 | } |
| 103 | 104 | |
| 104 | 105 | static WRITE8_HANDLER( exzisus_coincounter_w ) |
| r3957 | r3958 | |
| 340 | 341 | MDRV_CPU_PROGRAM_MAP(cpuc_readmem,cpuc_writemem) |
| 341 | 342 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 342 | 343 | |
| 343 | MDRV_ | |
| 344 | MDRV_QUANTUM_TIME | |
| 344 | 345 | |
| 345 | 346 | /* video hardware */ |
| 346 | 347 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 215 | 215 | ***************************************************************************/ |
| 216 | 216 | |
| 217 | 217 | #include "driver.h" |
| 218 | #include "cpu/m6809/m6809.h" | |
| 218 | 219 | #include "exidy440.h" |
| 219 | 220 | |
| 220 | 221 |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | ***************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/z80/z80.h" | |
| 45 | #include "cpu/i86/i86.h" | |
| 44 | 46 | #include "sound/ay8910.h" |
| 45 | 47 | #include "sound/custom.h" |
| 46 | #include "cpu/i86/i86.h" | |
| 47 | 48 | #include "rendlay.h" |
| 48 | 49 | #include "tx1.h" |
| 49 | 50 |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/z80/z80.h" | |
| 14 | 15 | #include "render.h" |
| 15 | 16 | #include "machine/laserdsc.h" |
| 16 | 17 | #include "cpu/cop400/cop400.h" |
| r3957 | r3958 | |
|---|---|---|
| 134 | 134 | */ |
| 135 | 135 | |
| 136 | 136 | #include "driver.h" |
| 137 | #include "cpu/z80/z80.h" | |
| 138 | #include "cpu/m68000/m68000.h" | |
| 137 | 139 | #include "genesis.h" |
| 138 | 140 | |
| 139 | 141 | |
| r3957 | r3958 | |
| 244 | 246 | MDRV_CPU_PROGRAM_MAP(genesis_z80_readmem, genesis_z80_writemem) |
| 245 | 247 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* from vdp at scanline 0xe0 */ |
| 246 | 248 | |
| 247 | MDRV_ | |
| 249 | MDRV_QUANTUM_TIME | |
| 248 | 250 | |
| 249 | 251 | MDRV_MACHINE_START(genesis) |
| 250 | 252 | MDRV_MACHINE_RESET(genesis) |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 43 | 44 | #include "machine/8255ppi.h" |
| 44 | 45 | #include "sound/ay8910.h" |
| 45 | 46 | #include "video/mc6845.h" |
| r3957 | r3958 | |
| 254 | 255 | static const mc6845_interface mc6845_intf = |
| 255 | 256 | { |
| 256 | 257 | "main", /* screen we are acting on */ |
| 257 | CRTC_CLOCK, /* the clock (pin 21) of the chip */ | |
| 258 | 258 | 8, /* number of pixels per video memory address */ |
| 259 | 259 | begin_update, /* before pixel update callback */ |
| 260 | 260 | update_row, /* row update callback */ |
| r3957 | r3958 | |
| 289 | 289 | |
| 290 | 290 | static WRITE8_DEVICE_HANDLER( misc_w ) |
| 291 | 291 | { |
| 292 | flip_screen_set(~data & 0x10); | |
| 292 | flip_screen_set(device->machine, ~data & 0x10); | |
| 293 | 293 | extra_video_bank_bit = (data & 2) << 8; |
| 294 | 294 | lscnblk = (data >> 3) & 1; |
| 295 | 295 | |
| r3957 | r3958 | |
| 298 | 298 | |
| 299 | 299 | static WRITE8_DEVICE_HANDLER( misc_couple_w ) |
| 300 | 300 | { |
| 301 | flip_screen_set(~data & 0x10); | |
| 301 | flip_screen_set(device->machine, ~data & 0x10); | |
| 302 | 302 | extra_video_bank_bit = (data & 2) << 8; |
| 303 | 303 | lscnblk = (data >> 3) & 1; |
| 304 | 304 | |
| r3957 | r3958 | |
| 1049 | 1049 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1050 | 1050 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 512, 0, 512, 256, 0, 256) /* temporary, CRTC will configure screen */ |
| 1051 | 1051 | |
| 1052 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 1053 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 1052 | MDRV_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) | |
| 1054 | 1053 | |
| 1055 | 1054 | MDRV_VIDEO_UPDATE(merit) |
| 1056 | 1055 |
| r3957 | r3958 | |
|---|---|---|
| 122 | 122 | ***************************************************************************/ |
| 123 | 123 | |
| 124 | 124 | #include "driver.h" |
| 125 | #include "cpu/m68000/m68000.h" | |
| 125 | 126 | #include "cpu/h6280/h6280.h" |
| 126 | 127 | #include "deco16ic.h" |
| 127 | 128 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 564 | 565 | MDRV_CPU_ADD("audio", H6280,32220000/8) /* Accurate */ |
| 565 | 566 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 566 | 567 | |
| 567 | MDRV_ | |
| 568 | MDRV_QUANTUM_TIME | |
| 568 | 569 | |
| 569 | 570 | /* video hardware */ |
| 570 | 571 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "cpu/z80/z80.h" | |
| 2 | 3 | #include "deprecat.h" |
| 3 | 4 | #include "sound/sn76496.h" |
| 4 | 5 |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | ************************************/ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "cpu/z80/z80.h" | |
| 33 | 34 | #include "sound/ay8910.h" |
| 34 | 35 | |
| 35 | 36 | extern UINT8 *ssrj_vram1,*ssrj_vram2,*ssrj_vram3,*ssrj_vram4,*ssrj_scrollram; |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "blstroid.h" |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | ****************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "cpu/z80/z80.h" | |
| 37 | 38 | #include "sound/samples.h" |
| 38 | 39 | #include "includes/gotya.h" |
| 39 | 40 |
| r3957 | r3958 | |
|---|---|---|
| 2 | 2 | /* Nothing else is known about this set / game */ |
| 3 | 3 | |
| 4 | 4 | #include "driver.h" |
| 5 | #include "cpu/z80/z80.h" | |
| 5 | 6 | |
| 6 | 7 | static VIDEO_START(gtipoker) |
| 7 | 8 | { |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/z80/z80.h" | |
| 18 | #include "cpu/m68000/m68000.h" | |
| 17 | 19 | #include "video/vector.h" |
| 18 | 20 | #include "aztarac.h" |
| 19 | 21 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | ***************************************************************************/ |
| 139 | 139 | |
| 140 | 140 | #include "driver.h" |
| 141 | #include "cpu/z80/z80.h" | |
| 142 | #include "cpu/nec/nec.h" | |
| 143 | #include "cpu/m68000/m68000.h" | |
| 141 | 144 | #include "tatsumi.h" |
| 142 | 145 | #include "sound/2151intf.h" |
| 143 | 146 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
| 846 | 849 | MDRV_CPU_ADD("sub2", Z80, 8000000) //??? |
| 847 | 850 | MDRV_CPU_PROGRAM_MAP(apache3_z80_map,0) |
| 848 | 851 | |
| 849 | MDRV_ | |
| 852 | MDRV_QUANTUM_TIME | |
| 850 | 853 | |
| 851 | 854 | /* video hardware */ |
| 852 | 855 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 889 | 892 | MDRV_CPU_ADD("audio", Z80, 4000000) //??? |
| 890 | 893 | MDRV_CPU_PROGRAM_MAP(roundup5_z80_map,0) |
| 891 | 894 | |
| 892 | MDRV_ | |
| 895 | MDRV_QUANTUM_TIME | |
| 893 | 896 | |
| 894 | 897 | /* video hardware */ |
| 895 | 898 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 933 | 936 | MDRV_CPU_ADD("audio", Z80, 16000000 / 4) /* Confirmed */ |
| 934 | 937 | MDRV_CPU_PROGRAM_MAP(cyclwarr_z80_map,0) |
| 935 | 938 | |
| 936 | MDRV_ | |
| 939 | MDRV_QUANTUM_TIME | |
| 937 | 940 | |
| 938 | 941 | /* video hardware */ |
| 939 | 942 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 977 | 980 | MDRV_CPU_ADD("audio", Z80, 16000000 / 4) /* Confirmed */ |
| 978 | 981 | MDRV_CPU_PROGRAM_MAP(cyclwarr_z80_map,0) |
| 979 | 982 | |
| 980 | MDRV_ | |
| 983 | MDRV_QUANTUM_TIME | |
| 981 | 984 | |
| 982 | 985 | /* video hardware */ |
| 983 | 986 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "cpu/m68000/m68000.h" | |
| 24 | 25 | #include "cpu/h6280/h6280.h" |
| 25 | 26 | #include "sound/2151intf.h" |
| 26 | 27 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/m68000/m68000.h" | |
| 27 | 28 | #include "sound/okim6295.h" |
| 28 | 29 | |
| 29 | 30 | /* Variables defined in video: */ |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m6800/m6800.h" | |
| 21 | 22 | #include "machine/6821pia.h" |
| 22 | 23 | #include "sound/sn76477.h" |
| 23 | 24 |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | ***************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/z80/z80.h" | |
| 32 | 33 | #include "deprecat.h" |
| 33 | 34 | #include "cpu/m6805/m6805.h" |
| 34 | 35 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
| 74 | 75 | { |
| 75 | 76 | int bit = data & 1; |
| 76 | 77 | |
| 77 | cpu_interrupt_enable(0,bit); | |
| 78 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 78 | 79 | if (!bit) |
| 79 | 80 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 80 | 81 | } |
| r3957 | r3958 | |
| 83 | 84 | { |
| 84 | 85 | int bit = data & 1; |
| 85 | 86 | |
| 86 | cpu_interrupt_enable(1,bit); | |
| 87 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 87 | 88 | if (!bit) |
| 88 | 89 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 89 | 90 | } |
| r3957 | r3958 | |
| 353 | 354 | MDRV_CPU_ADD("68705", M68705,18432000/6) /* 3.072 MHz? */ |
| 354 | 355 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 355 | 356 | |
| 356 | MDRV_ | |
| 357 | MDRV_QUANTUM_TIME | |
| 357 | 358 | |
| 358 | 359 | /* video hardware */ |
| 359 | 360 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/z80/z80.h" | |
| 11 | 12 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 12 | 13 | #include "video/konamiic.h" |
| 13 | 14 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 43 | 44 | #include "deprecat.h" |
| 44 | 45 | #include "genesis.h" |
| 45 | 46 | #include "megadriv.h" |
| r3957 | r3958 | |
| 794 | 795 | MDRV_CPU_IO_MAP(megaplay_bios_io_map,0) |
| 795 | 796 | MDRV_CPU_VBLANK_INT_HACK(megaplay_bios_irq, 262) |
| 796 | 797 | |
| 797 | MDRV_ | |
| 798 | MDRV_QUANTUM_TIME | |
| 798 | 799 | |
| 799 | 800 | MDRV_SOUND_ADD("sn2", SN76496, MASTER_CLOCK/15) |
| 800 | 801 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.25) /* 3.58 MHz */ |
| r3957 | r3958 | |
|---|---|---|
| 597 | 597 | MDRV_CPU_PROGRAM_MAP(audio_map,0) |
| 598 | 598 | MDRV_CPU_PERIODIC_INT(audio_interrupt, (double)5000000/131072) |
| 599 | 599 | |
| 600 | MDRV_ | |
| 600 | MDRV_QUANTUM_TIME | |
| 601 | 601 | |
| 602 | 602 | /* video hardware */ |
| 603 | 603 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 43 | 43 | static int last; |
| 44 | 44 | |
| 45 | 45 | // bit 0 is flipscreen |
| 46 | flip_screen_set(data & 0x01); | |
| 46 | flip_screen_set(space->machine, data & 0x01); | |
| 47 | 47 | |
| 48 | 48 | // bit 5 goes to 8910 #0 BDIR pin |
| 49 | 49 | if ((last & 0x20) == 0x20 && (data & 0x20) == 0x00) |
| r3957 | r3958 | |
|---|---|---|
| 204 | 204 | |
| 205 | 205 | |
| 206 | 206 | #include "driver.h" |
| 207 | #include "cpu/m68000/m68000.h" | |
| 207 | 208 | #include "cpu/tms34010/tms34010.h" |
| 208 | 209 | #include "cpu/tms32010/tms32010.h" |
| 209 | 210 | #include "cpu/adsp2100/adsp2100.h" |
| r3957 | r3958 | |
| 1014 | 1015 | MDRV_CPU_PROGRAM_MAP(driver_gsp_map,0) |
| 1015 | 1016 | MDRV_CPU_CONFIG(gsp_config_driver) |
| 1016 | 1017 | |
| 1017 | MDRV_ | |
| 1018 | MDRV_QUANTUM_TIME | |
| 1018 | 1019 | |
| 1019 | 1020 | MDRV_MACHINE_START(harddriv) |
| 1020 | 1021 | MDRV_MACHINE_RESET(harddriv) |
| r3957 | r3958 | |
| 1111 | 1112 | MDRV_CPU_PROGRAM_MAP(ds3_program_map,0) |
| 1112 | 1113 | MDRV_CPU_DATA_MAP(ds3_data_map,0) |
| 1113 | 1114 | |
| 1114 | MDRV_ | |
| 1115 | MDRV_QUANTUM_TIME | |
| 1115 | 1116 | MACHINE_DRIVER_END |
| 1116 | 1117 | |
| 1117 | 1118 | |
| r3957 | r3958 | |
| 3461 | 3462 | memory_install_write16_handler(cpu_get_address_space(hdcpu_main, ADDRESS_SPACE_PROGRAM), 0x823800, 0x823fff, 0, 0, hd68k_ds3_control_w); |
| 3462 | 3463 | |
| 3463 | 3464 | /* if we have a sound DSP, boot it */ |
| 3464 | if (hdcpu_sound != NULL && | |
| 3465 | if (hdcpu_sound != NULL && | |
| 3465 | 3466 | adsp2105_load_boot_data((UINT8 *)(hdcpu_sound->region + 0x10000), (UINT32 *)hdcpu_sound->region); |
| 3466 | 3467 | |
| 3467 | if (hdcpu_sounddsp != NULL && | |
| 3468 | if (hdcpu_sounddsp != NULL && | |
| 3468 | 3469 | adsp2105_load_boot_data((UINT8 *)(hdcpu_sounddsp->region + 0x10000), (UINT32 *)hdcpu_sounddsp->region); |
| 3469 | 3470 | |
| 3470 | 3471 | /* |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | #include "driver.h" |
| 59 | #include "cpu/z80/z80.h" | |
| 60 | #include "cpu/m68000/m68000.h" | |
| 59 | 61 | #include "deprecat.h" |
| 60 | 62 | #include "sound/ay8910.h" |
| 61 | 63 | #include "sound/msm5205.h" |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | ***************************************************************************/ |
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | #include "cpu/z80/z80.h" | |
| 85 | #include "cpu/nec/nec.h" | |
| 84 | 86 | #include "deprecat.h" |
| 85 | 87 | #include "machine/irem_cpu.h" |
| 86 | 88 | #include "audio/m72.h" |
| r3957 | r3958 | |
| 88 | 90 | #include "sound/2151intf.h" |
| 89 | 91 | #include "iremipt.h" |
| 90 | 92 | #include "m72.h" |
| 91 | #include "cpu/nec/nec.h" | |
| 92 | 93 | #include "cpu/mcs51/mcs51.h" |
| 93 | 94 | |
| 94 | 95 | #define MASTER_CLOCK XTAL_32MHz |
| r3957 | r3958 | |
|---|---|---|
| 387 | 387 | static const mc6845_interface mc6845_intf = |
| 388 | 388 | { |
| 389 | 389 | "main", /* screen we are acting on */ |
| 390 | CRTC_CLOCK, /* the clock (pin 21) of the chip */ | |
| 391 | 390 | 8, /* number of pixels per video memory address */ |
| 392 | 391 | begin_update, /* before pixel update callback */ |
| 393 | 392 | update_row, /* row update callback */ |
| r3957 | r3958 | |
| 550 | 549 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 551 | 550 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */ |
| 552 | 551 | |
| 553 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 554 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 552 | MDRV_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) | |
| 555 | 553 | |
| 556 | 554 | /* 74LS123 */ |
| 557 | 555 | |
| 558 | MDRV_DEVICE_ADD("74123", TTL74123) | |
| 559 | MDRV_DEVICE_CONFIG(ttl74123_intf) | |
| 556 | MDRV_TTL74123_ADD("74123", ttl74123_intf) | |
| 560 | 557 | |
| 561 | 558 | /* audio hardware */ |
| 562 | 559 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/m68000/m68000.h" | |
| 15 | 16 | #include "sound/okim6295.h" |
| 16 | 17 | |
| 17 | 18 | |
| r3957 | r3958 | |
| 335 | 336 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold) |
| 336 | 337 | |
| 337 | 338 | MDRV_MACHINE_RESET(ohmygod) |
| 338 | MDRV_WATCHDOG_TIME_INIT( | |
| 339 | MDRV_WATCHDOG_TIME_INIT( | |
| 339 | 340 | |
| 340 | 341 | /* video hardware */ |
| 341 | 342 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | ***************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "cpu/m68000/m68000.h" | |
| 44 | 45 | #include "cpu/z80/z80.h" |
| 45 | 46 | #include "sound/3812intf.h" |
| 46 | 47 | #include "sound/upd7759.h" |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/m6502/m6502.h" | |
| 10 | 11 | #include "sound/ay8910.h" |
| 11 | 12 | #include "video/mc6845.h" |
| 12 | 13 | #include "madalien.h" |
| r3957 | r3958 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | ***************************************************************************/ |
| 130 | 130 | |
| 131 | static void draw_sprite(bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr) | |
| 131 | static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr) | |
| 132 | 132 | { |
| 133 | 133 | // prepare GfxElement on the fly |
| 134 | 134 | gfx_element gfx; |
| 135 | 135 | |
| 136 | gfx.machine = machine; | |
| 136 | 137 | gfx.width = dimx; |
| 137 | 138 | gfx.height = dimy; |
| 138 | 139 | gfx.total_elements = 1; |
| r3957 | r3958 | |
| 183 | 184 | |
| 184 | 185 | color = (s[7] & 0xe0) >> 5; |
| 185 | 186 | |
| 186 | draw_sprite(bitmap, cliprect, sx, sy, dimx, dimy, flipx, flipy, color, addr); | |
| 187 | draw_sprite(machine, bitmap, cliprect, sx, sy, dimx, dimy, flipx, flipy, color, addr); | |
| 187 | 188 | } |
| 188 | 189 | } |
| 189 | 190 | |
| 190 | 191 | // A simple gfx viewer (toggle with T) |
| 191 | static int debug_viewer(bitmap_t *bitmap,const rectangle *cliprect) | |
| 192 | static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) | |
| 192 | 193 | { |
| 193 | 194 | #ifdef MAME_DEBUG |
| 194 | 195 | static int toggle = 0; |
| r3957 | r3958 | |
| 220 | 221 | |
| 221 | 222 | bitmap_fill(bitmap,cliprect,0); |
| 222 | 223 | |
| 223 | draw_sprite(bitmap, cliprect, 0,0, w,h, 0,0, 0, a); | |
| 224 | draw_sprite(machine, bitmap, cliprect, 0,0, w,h, 0,0, 0, a); | |
| 224 | 225 | |
| 225 | 226 | popmessage("a: %08X w: %03X p: %02X-%02x-%02x",a,w,sprites_gfx[a/3*3+0],sprites_gfx[a/3*3+1],sprites_gfx[a/3*3+2]); |
| 226 | 227 | osd_sleep(200000); |
| r3957 | r3958 | |
| 245 | 246 | } |
| 246 | 247 | #endif |
| 247 | 248 | |
| 248 | if (debug_viewer(bitmap,cliprect)) | |
| 249 | if (debug_viewer(screen->machine, bitmap,cliprect)) | |
| 249 | 250 | return 0; |
| 250 | 251 | |
| 251 | 252 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0); |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | ****************************************************************************/ |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "cpu/m6809/m6809.h" | |
| 26 | 27 | #include "sound/ay8910.h" |
| 27 | 28 | |
| 28 | 29 |
| r3957 | r3958 | |
|---|---|---|
| 206 | 206 | |
| 207 | 207 | /* SCSI */ |
| 208 | 208 | |
| 209 | static void scsi_dma_read( UINT32 n_address, INT32 n_size ) | |
| 209 | static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 210 | 210 | { |
| 211 | 211 | int i; |
| 212 | 212 | int n_this; |
| r3957 | r3958 | |
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | static void scsi_dma_write( UINT32 n_address, INT32 n_size ) | |
| 252 | static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 253 | 253 | { |
| 254 | 254 | int i; |
| 255 | 255 | int n_this; |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | ***************************************************************************/ |
| 58 | 58 | |
| 59 | 59 | #include "driver.h" |
| 60 | #include "cpu/z80/z80.h" | |
| 60 | 61 | #include "deprecat.h" |
| 61 | 62 | #include "cpu/m6502/m6502.h" |
| 62 | 63 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
| 239 | 240 | |
| 240 | 241 | static WRITE8_HANDLER( flip_screen_w ) |
| 241 | 242 | { |
| 242 | flip_screen_set(data); | |
| 243 | flip_screen_set(space->machine, data); | |
| 243 | 244 | } |
| 244 | 245 | |
| 245 | 246 |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "cpu/z80/z80.h" | |
| 33 | 34 | #include "crgolf.h" |
| 34 | 35 | #include "sound/ay8910.h" |
| 35 | 36 | #include "sound/msm5205.h" |
| r3957 | r3958 | |
| 375 | 376 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 376 | 377 | |
| 377 | 378 | MDRV_MACHINE_START(crgolf) |
| 378 | MDRV_ | |
| 379 | MDRV_QUANTUM_TIME | |
| 379 | 380 | |
| 380 | 381 | /* video hardware */ |
| 381 | 382 | MDRV_IMPORT_FROM(crgolf_video) |
| r3957 | r3958 | |
|---|---|---|
| 434 | 434 | */ |
| 435 | 435 | |
| 436 | 436 | #include "driver.h" |
| 437 | #include "cpu/z180/z180.h" | |
| 437 | 438 | #include "sound/saa1099.h" |
| 438 | 439 | #include "sound/msm5205.h" |
| 439 | 440 |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | ***************************************************************************/ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "cpu/z80/z80.h" | |
| 29 | #include "cpu/m6502/m6502.h" | |
| 28 | 30 | #include "deprecat.h" |
| 29 | 31 | #include "thedeep.h" |
| 30 | 32 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 71 | 73 | switch (protection_command) |
| 72 | 74 | { |
| 73 | 75 | case 0x11: |
| 74 | flip_screen_set(1); | |
| 76 | flip_screen_set(space->machine, 1); | |
| 75 | 77 | break; |
| 76 | 78 | |
| 77 | 79 | case 0x20: |
| 78 | flip_screen_set(0); | |
| 80 | flip_screen_set(space->machine, 0); | |
| 79 | 81 | break; |
| 80 | 82 | |
| 81 | 83 | case 0x30: |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "cpu/z80/z80.h" | |
| 34 | #include "cpu/m68000/m68000.h" | |
| 33 | 35 | #include "sound/okim6295.h" |
| 34 | 36 | #include "sound/3812intf.h" |
| 35 | 37 | #include "includes/oneshot.h" |
| r3957 | r3958 | |
|---|---|---|
| 68 | 68 | */ |
| 69 | 69 | |
| 70 | 70 | #include "driver.h" |
| 71 | #include "cpu/m68000/m68000.h" | |
| 71 | 72 | #include "machine/eeprom.h" |
| 72 | 73 | #include "sound/okim6295.h" |
| 73 | 74 |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | ***************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/z80/z80.h" | |
| 32 | 33 | #include "sound/ay8910.h" |
| 33 | 34 | #include "sound/msm5205.h" |
| 34 | 35 | |
| r3957 | r3958 | |
| 142 | 143 | |
| 143 | 144 | static WRITE8_HANDLER( ctrl_w ) |
| 144 | 145 | { |
| 145 | flip_screen_set(data & 0x01); | |
| 146 | flip_screen_set(space->machine, data & 0x01); | |
| 146 | 147 | |
| 147 | 148 | // (data & 0x02) is switched on and off in service mode |
| 148 | 149 |
| r3957 | r3958 | |
|---|---|---|
| 230 | 230 | ***************************************************************************/ |
| 231 | 231 | |
| 232 | 232 | #include "driver.h" |
| 233 | #include "cpu/z80/z80.h" | |
| 233 | 234 | #include "taitoipt.h" |
| 234 | 235 | #include "cpu/m68000/m68000.h" |
| 235 | 236 | #include "video/taitoic.h" |
| r3957 | r3958 | |
|---|---|---|
| 174 | 174 | */ |
| 175 | 175 | |
| 176 | 176 | #include "driver.h" |
| 177 | #include " | |
| 177 | #include " | |
| 178 | 178 | #include "cpu/powerpc/ppc.h" |
| 179 | 179 | #include "cpu/sharc/sharc.h" |
| 180 | 180 | #include "sound/k054539.h" |
| r3957 | r3958 | |
| 299 | 299 | |
| 300 | 300 | static CUSTOM_INPUT( adcdo_r ) |
| 301 | 301 | { |
| 302 | return adc083x_do_read(0); | |
| 302 | return adc083x_do_read(field->port->machine, 0); | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | static READ8_HANDLER( sysreg_r ) |
| r3957 | r3958 | |
| 323 | 323 | 0x20 = SARS (A/D busy flag) |
| 324 | 324 | 0x10 = EEPDO (EEPROM DO) |
| 325 | 325 | */ |
| 326 | r = (adc083x_sars_read(0) << 5) | (eeprom_read_bit() << 4); | |
| 326 | r = (adc083x_sars_read(space->machine, 0) << 5) | (eeprom_read_bit() << 4); | |
| 327 | 327 | break; |
| 328 | 328 | |
| 329 | 329 | case 5: /* Parallel data port */ |
| r3957 | r3958 | |
| 382 | 382 | if (data & 0x40) /* CG Board 0 IRQ Ack */ |
| 383 | 383 | cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ0, CLEAR_LINE); |
| 384 | 384 | set_cgboard_id((data >> 4) & 3); |
| 385 | adc083x_cs_write(0, (data >> 2) & 1); | |
| 386 | adc083x_di_write(0, (data >> 1) & 1); | |
| 387 | adc083x_clk_write(0, (data >> 0) & 1); | |
| 385 | adc083x_cs_write(space->machine, 0, (data >> 2) & 1); | |
| 386 | adc083x_di_write(space->machine, 0, (data >> 1) & 1); | |
| 387 | adc083x_clk_write(space->machine, 0, (data >> 0) & 1); | |
| 388 | 388 | mame_printf_debug("System register 1 = %02X\n", data); |
| 389 | 389 | break; |
| 390 | 390 | |
| r3957 | r3958 | |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | static double adc0838_callback(int input) | |
| 402 | static double adc0838_callback(running_machine *machine, int input) | |
| 403 | 403 | { |
| 404 | 404 | switch (input) |
| 405 | 405 | { |
| 406 | 406 | case ADC083X_CH0: |
| 407 | return (double)(5 * input_port_read( | |
| 407 | return (double)(5 * input_port_read(machine, "ANALOG1")) / 255.0; | |
| 408 | 408 | case ADC083X_CH1: |
| 409 | return (double)(5 * input_port_read( | |
| 409 | return (double)(5 * input_port_read(machine, "ANALOG2")) / 255.0; | |
| 410 | 410 | case ADC083X_CH2: |
| 411 | return (double)(5 * input_port_read( | |
| 411 | return (double)(5 * input_port_read(machine, "ANALOG3")) / 255.0; | |
| 412 | 412 | case ADC083X_CH3: |
| 413 | 413 | return 0; |
| 414 | 414 | case ADC083X_COM: |
| r3957 | r3958 | |
| 459 | 459 | static MACHINE_START( zr107 ) |
| 460 | 460 | { |
| 461 | 461 | /* set conservative DRC options */ |
| 462 | c | |
| 462 | device | |
| 463 | 463 | |
| 464 | 464 | /* configure fast RAM regions for DRC */ |
| 465 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 466 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 467 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); | |
| 468 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); | |
| 469 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 465 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 466 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 467 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); | |
| 468 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); | |
| 469 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | static ADDRESS_MAP_START( zr107_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r3957 | r3958 | |
| 748 | 748 | MDRV_CPU_CONFIG(sharc_cfg) |
| 749 | 749 | MDRV_CPU_DATA_MAP(sharc_map, 0) |
| 750 | 750 | |
| 751 | MDRV_ | |
| 751 | MDRV_QUANTUM_TIME | |
| 752 | 752 | |
| 753 | 753 | MDRV_NVRAM_HANDLER(93C46) |
| 754 | 754 | MDRV_MACHINE_START(zr107) |
| r3957 | r3958 | |
| 793 | 793 | MDRV_CPU_CONFIG(sharc_cfg) |
| 794 | 794 | MDRV_CPU_DATA_MAP(sharc_map, 0) |
| 795 | 795 | |
| 796 | MDRV_ | |
| 796 | MDRV_QUANTUM_TIME | |
| 797 | 797 | |
| 798 | 798 | MDRV_NVRAM_HANDLER(93C46) |
| 799 | 799 | MDRV_MACHINE_START(zr107) |
| r3957 | r3958 | |
| 853 | 853 | |
| 854 | 854 | static DRIVER_INIT(zr107) |
| 855 | 855 | { |
| 856 | init_konami_cgboard(1, CGBOARD_TYPE_ZR107); | |
| 856 | init_konami_cgboard(machine, 1, CGBOARD_TYPE_ZR107); | |
| 857 | 857 | init_zr107(machine); |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | 860 | static DRIVER_INIT(jetwave) |
| 861 | 861 | { |
| 862 | init_konami_cgboard(1, CGBOARD_TYPE_GTICLUB); | |
| 862 | init_konami_cgboard(machine, 1, CGBOARD_TYPE_GTICLUB); | |
| 863 | 863 | init_zr107(machine); |
| 864 | 864 | } |
| 865 | 865 |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/z80/z80.h" | |
| 17 | 18 | #include "sound/2151intf.h" |
| 18 | 19 | |
| 19 | 20 | /* Variables & functions defined in video: */ |
| r3957 | r3958 | |
|---|---|---|
| 296 | 296 | */ |
| 297 | 297 | |
| 298 | 298 | #include "driver.h" |
| 299 | #include " | |
| 299 | #include " | |
| 300 | 300 | #include "sound/sn76496.h" |
| 301 | 301 | #include "machine/mc8123.h" |
| 302 | 302 | #include "machine/segacrpt.h" |
| r3957 | r3958 | |
| 570 | 570 | GEN_VDP = 3 // Genesis VDP running in SMS2 Mode |
| 571 | 571 | }; |
| 572 | 572 | |
| 573 | static int sms_vdp_null_irq_callback(int status) | |
| 573 | static int sms_vdp_null_irq_callback(running_machine *machine, int status) | |
| 574 | 574 | { |
| 575 | 575 | return -1; |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | static int sms_vdp_cpu0_irq_callback(int status) | |
| 578 | static int sms_vdp_cpu0_irq_callback(running_machine *machine, int status) | |
| 579 | 579 | { |
| 580 | 580 | if (status==1) |
| 581 | cpu_set_input_line( | |
| 581 | cpu_set_input_line(machine->cpu[0],0,HOLD_LINE); | |
| 582 | 582 | else |
| 583 | cpu_set_input_line( | |
| 583 | cpu_set_input_line(machine->cpu[0],0,CLEAR_LINE); | |
| 584 | 584 | |
| 585 | 585 | return 0; |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | static int sms_vdp_cpu1_irq_callback(int status) | |
| 588 | static int sms_vdp_cpu1_irq_callback(running_machine *machine, int status) | |
| 589 | 589 | { |
| 590 | 590 | if (status==1) |
| 591 | cpu_set_input_line( | |
| 591 | cpu_set_input_line(machine->cpu[1],0,HOLD_LINE); | |
| 592 | 592 | else |
| 593 | cpu_set_input_line( | |
| 593 | cpu_set_input_line(machine->cpu[1],0,CLEAR_LINE); | |
| 594 | 594 | |
| 595 | 595 | return 0; |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | 598 | |
| 599 | static int sms_vdp_cpu2_irq_callback(int status) | |
| 599 | static int sms_vdp_cpu2_irq_callback(running_machine *machine, int status) | |
| 600 | 600 | { |
| 601 | 601 | if (status==1) |
| 602 | cpu_set_input_line( | |
| 602 | cpu_set_input_line(machine->cpu[2],0,HOLD_LINE); | |
| 603 | 603 | else |
| 604 | cpu_set_input_line( | |
| 604 | cpu_set_input_line(machine->cpu[2],0,CLEAR_LINE); | |
| 605 | 605 | |
| 606 | 606 | return 0; |
| 607 | 607 | } |
| r3957 | r3958 | |
| 648 | 648 | int sms_framerate; |
| 649 | 649 | emu_timer* sms_scanline_timer; |
| 650 | 650 | UINT16* cram_mamecolours; // for use on RGB_DIRECT screen |
| 651 | int (*set_irq)(int state); | |
| 651 | int (*set_irq)(running_machine *machine, int state); | |
| 652 | 652 | |
| 653 | 653 | }; |
| 654 | 654 | |
| r3957 | r3958 | |
| 687 | 687 | chip->vram = auto_malloc(0x4000); |
| 688 | 688 | memset(chip->vram,0x00,0x4000); |
| 689 | 689 | |
| 690 | //printf("%d\n", (*chip->set_irq)(200)); | |
| 690 | //printf("%d\n", (*chip->set_irq)(machine, 200)); | |
| 691 | 691 | |
| 692 | 692 | if (chip->vdp_type==GG_VDP) |
| 693 | 693 | { |
| r3957 | r3958 | |
| 825 | 825 | |
| 826 | 826 | } |
| 827 | 827 | |
| 828 | static UINT8 vdp_ctrl_r(struct sms_vdp *chip) | |
| 828 | static UINT8 vdp_ctrl_r(const address_space *space, struct sms_vdp *chip) | |
| 829 | 829 | { |
| 830 | 830 | UINT8 retvalue; |
| 831 | 831 | |
| r3957 | r3958 | |
| 839 | 839 | chip->sprite_collision = 0; |
| 840 | 840 | chip->sprite_overflow = 0; |
| 841 | 841 | |
| 842 | (chip->set_irq)(0); // clear IRQ; | |
| 842 | (chip->set_irq)(space->machine, 0); // clear IRQ; | |
| 843 | 843 | |
| 844 | 844 | |
| 845 | 845 | return retvalue; |
| r3957 | r3958 | |
| 852 | 852 | chip->cmd_reg = (chip->cmd_part2&0xc0)>>6; |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | static void vdp_set_register(struct sms_vdp *chip) | |
| 855 | static void vdp_set_register(running_machine *machine, struct sms_vdp *chip) | |
| 856 | 856 | { |
| 857 | 857 | UINT8 reg = chip->cmd_part2&0x0f; |
| 858 | 858 | chip->regs[reg] = chip->cmd_part1; |
| r3957 | r3958 | |
| 865 | 865 | { |
| 866 | 866 | if ((chip->regs[0x1]&0x20) && chip->frame_irq_pending) |
| 867 | 867 | { |
| 868 | (chip->set_irq)(1); // set IRQ; | |
| 868 | (chip->set_irq)(machine, 1); // set IRQ; | |
| 869 | 869 | } |
| 870 | 870 | else |
| 871 | 871 | { |
| 872 | (chip->set_irq)(0); // clear IRQ; | |
| 872 | (chip->set_irq)(machine, 0); // clear IRQ; | |
| 873 | 873 | } |
| 874 | 874 | } |
| 875 | 875 | |
| r3957 | r3958 | |
| 877 | 877 | { |
| 878 | 878 | if ((chip->regs[0x0]&0x10) && chip->line_irq_pending) |
| 879 | 879 | { |
| 880 | (chip->set_irq)(1); // set IRQ; | |
| 880 | (chip->set_irq)(machine, 1); // set IRQ; | |
| 881 | 881 | } |
| 882 | 882 | else |
| 883 | 883 | { |
| 884 | (chip->set_irq)(0); // clear IRQ; | |
| 884 | (chip->set_irq)(machine, 0); // clear IRQ; | |
| 885 | 885 | } |
| 886 | 886 | } |
| 887 | 887 | |
| r3957 | r3958 | |
| 889 | 889 | // printf("VDP: setting register %01x to %02x\n",reg, chip->cmd_part1); |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | static void vdp_ctrl_w(UINT8 data, struct sms_vdp *chip) | |
| 892 | static void vdp_ctrl_w(const address_space *space, UINT8 data, struct sms_vdp *chip) | |
| 893 | 893 | { |
| 894 | 894 | if (chip->cmd_pend) |
| 895 | 895 | { /* Part 2 of a command word write */ |
| r3957 | r3958 | |
| 910 | 910 | break; |
| 911 | 911 | |
| 912 | 912 | case 0x2: /* REG setting */ |
| 913 | vdp_set_register(chip); | |
| 913 | vdp_set_register(space->machine, chip); | |
| 914 | 914 | chip->writemode = 0; |
| 915 | 915 | break; |
| 916 | 916 | |
| r3957 | r3958 | |
| 946 | 946 | |
| 947 | 947 | READ8_HANDLER( md_sms_vdp_ctrl_r ) |
| 948 | 948 | { |
| 949 | return vdp_ctrl_r(md_sms_vdp); | |
| 949 | return vdp_ctrl_r(space, md_sms_vdp); | |
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | WRITE8_HANDLER( md_sms_vdp_ctrl_w ) |
| 953 | 953 | { |
| 954 | vdp_ctrl_w(data, md_sms_vdp); | |
| 954 | vdp_ctrl_w(space, data, md_sms_vdp); | |
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | |
| r3957 | r3958 | |
| 974 | 974 | |
| 975 | 975 | READ8_HANDLER( sms_vdp_ctrl_r ) |
| 976 | 976 | { |
| 977 | return vdp_ctrl_r(vdp1); | |
| 977 | return vdp_ctrl_r(space, vdp1); | |
| 978 | 978 | } |
| 979 | 979 | |
| 980 | 980 | WRITE8_HANDLER( sms_vdp_ctrl_w ) |
| 981 | 981 | { |
| 982 | vdp_ctrl_w(data, vdp1); | |
| 982 | vdp_ctrl_w(space, data, vdp1); | |
| 983 | 983 | } |
| 984 | 984 | |
| 985 | 985 | WRITE8_HANDLER( sms_sn76496_w ) |
| r3957 | r3958 | |
| 1313 | 1313 | chip->hint_counter=chip->regs[0xa]; |
| 1314 | 1314 | if (chip->regs[0x0]&0x10) |
| 1315 | 1315 | { |
| 1316 | (chip->set_irq)(1); // set IRQ; | |
| 1316 | (chip->set_irq)(machine, 1); // set IRQ; | |
| 1317 | 1317 | } |
| 1318 | 1318 | else |
| 1319 | 1319 | { |
| 1320 | (chip->set_irq)(0); // clear IRQ; | |
| 1320 | (chip->set_irq)(machine, 0); // clear IRQ; | |
| 1321 | 1321 | } |
| 1322 | 1322 | } |
| 1323 | 1323 | |
| r3957 | r3958 | |
| 1333 | 1333 | chip->frame_irq_pending = 1; |
| 1334 | 1334 | if (chip->regs[0x1]&0x20) |
| 1335 | 1335 | { |
| 1336 | (chip->set_irq)(1); // set IRQ; | |
| 1336 | (chip->set_irq)(machine, 1); // set IRQ; | |
| 1337 | 1337 | } |
| 1338 | 1338 | else |
| 1339 | 1339 | { |
| 1340 | (chip->set_irq)(0); // clear IRQ; | |
| 1340 | (chip->set_irq)(machine, 0); // clear IRQ; | |
| 1341 | 1341 | } |
| 1342 | 1342 | } |
| 1343 | 1343 | } |
| r3957 | r3958 | |
| 2092 | 2092 | |
| 2093 | 2093 | static READ8_HANDLER( sms_vdp_2_ctrl_r ) |
| 2094 | 2094 | { |
| 2095 | return vdp_ctrl_r(vdp2); | |
| 2095 | return vdp_ctrl_r(space, vdp2); | |
| 2096 | 2096 | } |
| 2097 | 2097 | |
| 2098 | 2098 | static WRITE8_HANDLER( sms_vdp_2_ctrl_w ) |
| 2099 | 2099 | { |
| 2100 | vdp_ctrl_w(data, vdp2); | |
| 2100 | vdp_ctrl_w(space, data, vdp2); | |
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | 2103 | static WRITE8_HANDLER( segasyse_videoram_w ) |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | ***************************************************************************************/ |
| 45 | 45 | |
| 46 | 46 | #include "driver.h" |
| 47 | #include "cpu/z80/z80.h" | |
| 48 | #include "cpu/nec/nec.h" | |
| 49 | #include "cpu/i86/i86.h" | |
| 50 | #include "cpu/i86/i86.h" | |
| 47 | 51 | #include "sound/2151intf.h" |
| 48 | 52 | #include "sound/3812intf.h" |
| 49 | 53 | #include "sound/dac.h" |
| r3957 | r3958 | |
| 826 | 830 | |
| 827 | 831 | MDRV_MACHINE_RESET(fantland) |
| 828 | 832 | |
| 829 | MDRV_ | |
| 833 | MDRV_QUANTUM_TIME | |
| 830 | 834 | |
| 831 | 835 | /* video hardware */ |
| 832 | 836 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | sx = spriteram[offs]; |
| 52 | 52 | sy = 248 - spriteram[offs + 1]; |
| 53 | if (flip_screen_x_get()) sx = 248 - sx; | |
| 54 | if (flip_screen_y_get()) sy = 248 - sy; | |
| 53 | if (flip_screen_x_get(machine)) sx = 248 - sx; | |
| 54 | if (flip_screen_y_get(machine)) sy = 248 - sy; | |
| 55 | 55 | |
| 56 | 56 | code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) ; |
| 57 | 57 | |
| 58 | 58 | drawgfx(bitmap,machine->gfx[0], |
| 59 | 59 | 2 * code, |
| 60 | 60 | ((spriteram[offs + 2] & 0xf8) >> 3) , |
| 61 | flip_screen_x_get(),flip_screen_y_get(), | |
| 62 | sx,sy + (flip_screen_y_get() ? 8 : -8), | |
| 61 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 62 | sx,sy + (flip_screen_y_get(machine) ? 8 : -8), | |
| 63 | 63 | cliprect,TRANSPARENCY_PEN,0); |
| 64 | 64 | drawgfx(bitmap,machine->gfx[0], |
| 65 | 65 | 2 * code + 1, |
| 66 | 66 | ((spriteram[offs + 2] & 0xf8) >> 3) , |
| 67 | flip_screen_x_get(),flip_screen_y_get(), | |
| 67 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 68 | 68 | sx,sy, |
| 69 | 69 | cliprect,TRANSPARENCY_PEN,0); |
| 70 | 70 | } |
| r3957 | r3958 | |
|---|---|---|
| 205 | 205 | */ |
| 206 | 206 | |
| 207 | 207 | #include "driver.h" |
| 208 | #include "deprecat.h" | |
| 209 | 208 | #include "cdrom.h" |
| 210 | 209 | #include "cpu/mips/psx.h" |
| 211 | 210 | #include "includes/psx.h" |
| r3957 | r3958 | |
| 289 | 288 | |
| 290 | 289 | static READ32_HANDLER( jamma_r ) |
| 291 | 290 | { |
| 291 | running_machine *machine = space->machine; | |
| 292 | 292 | UINT32 data = 0; |
| 293 | 293 | |
| 294 | 294 | switch (offset) |
| 295 | 295 | { |
| 296 | 296 | case 0: |
| 297 | data = input_port_read( | |
| 297 | data = input_port_read( | |
| 298 | 298 | break; |
| 299 | 299 | case 1: |
| 300 | 300 | { |
| 301 | data = input_port_read( | |
| 301 | data = input_port_read( | |
| 302 | 302 | data |= 0x000000c0; |
| 303 | 303 | |
| 304 | 304 | if( has_ds2401[ security_cart_number ] ) |
| 305 | 305 | { |
| 306 | data |= ds2401_read( security_cart_number ) << 14; | |
| 306 | data |= ds2401_read( machine, security_cart_number ) << 14; | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | data |= adc083x_do_read( 0 ) << 16; | |
| 309 | data |= adc083x_do_read( machine, 0 ) << 16; | |
| 310 | 310 | |
| 311 | 311 | switch( chiptype[ security_cart_number ] ) |
| 312 | 312 | { |
| 313 | 313 | case 1: |
| 314 | data |= x76f041_sda_read( security_cart_number ) << 18; | |
| 314 | data |= x76f041_sda_read( machine, security_cart_number ) << 18; | |
| 315 | 315 | break; |
| 316 | 316 | |
| 317 | 317 | case 2: |
| 318 | data |= x76f100_sda_read( security_cart_number ) << 18; | |
| 318 | data |= x76f100_sda_read( machine, security_cart_number ) << 18; | |
| 319 | 319 | break; |
| 320 | 320 | |
| 321 | 321 | case 3: |
| 322 | data |= zs01_sda_read( security_cart_number ) << 18; | |
| 322 | data |= zs01_sda_read( machine, security_cart_number ) << 18; | |
| 323 | 323 | break; |
| 324 | 324 | } |
| 325 | 325 | |
| r3957 | r3958 | |
| 334 | 334 | break; |
| 335 | 335 | } |
| 336 | 336 | case 2: |
| 337 | data = input_port_read( | |
| 337 | data = input_port_read( | |
| 338 | 338 | break; |
| 339 | 339 | case 3: |
| 340 | data = input_port_read( | |
| 340 | data = input_port_read( | |
| 341 | 341 | break; |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | verboselog( | |
| 344 | verboselog( | |
| 345 | 345 | |
| 346 | 346 | return data; |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | static WRITE32_HANDLER( jamma_w ) |
| 350 | 350 | { |
| 351 | verboselog( space->machine, 2, "jamma_w( %08x, %08x, %08x )\n", offset, mem_mask, data ); | |
| 351 | running_machine *machine = space->machine; | |
| 352 | verboselog( machine, 2, "jamma_w( %08x, %08x, %08x )\n", offset, mem_mask, data ); | |
| 352 | 353 | |
| 353 | 354 | switch( offset ) |
| 354 | 355 | { |
| 355 | 356 | case 0: |
| 356 | adc083x_cs_write( 0, ( data >> 1 ) & 1 ); | |
| 357 | adc083x_clk_write( 0, ( data >> 2 ) & 1 ); | |
| 358 | adc083x_di_write( 0, ( data >> 0 ) & 1 ); | |
| 359 | adc083x_se_write( 0, 0 ); | |
| 357 | adc083x_cs_write( machine, 0, ( data >> 1 ) & 1 ); | |
| 358 | adc083x_clk_write( machine, 0, ( data >> 2 ) & 1 ); | |
| 359 | adc083x_di_write( machine, 0, ( data >> 0 ) & 1 ); | |
| 360 | adc083x_se_write( machine, 0, 0 ); | |
| 360 | 361 | break; |
| 361 | 362 | |
| 362 | 363 | default: |
| 363 | verboselog( | |
| 364 | verboselog( | |
| 364 | 365 | break; |
| 365 | 366 | } |
| 366 | 367 | } |
| r3957 | r3958 | |
| 386 | 387 | switch( chiptype[ security_cart_number ] ) |
| 387 | 388 | { |
| 388 | 389 | case 3: |
| 389 | zs01_sda_write( security_cart_number, !( ( control >> 6 ) & 1 ) ); /* 0x40 */ | |
| 390 | zs01_sda_write( space->machine, security_cart_number, !( ( control >> 6 ) & 1 ) ); /* 0x40 */ | |
| 390 | 391 | break; |
| 391 | 392 | } |
| 392 | 393 | |
| r3957 | r3958 | |
| 908 | 909 | { |
| 909 | 910 | if( get_disk_handle( diskregions[i] ) != NULL ) |
| 910 | 911 | { |
| 911 | SCSIAllocInstance( &SCSIClassCr589, &available_cdroms[ i ], diskregions[i] ); | |
| 912 | SCSIAllocInstance( machine, &SCSIClassCr589, &available_cdroms[ i ], diskregions[i] ); | |
| 912 | 913 | } |
| 913 | 914 | else |
| 914 | 915 | { |
| r3957 | r3958 | |
| 953 | 954 | } |
| 954 | 955 | } |
| 955 | 956 | |
| 956 | static void cdrom_dma_read( UINT32 n_address, INT32 n_size ) | |
| 957 | static void cdrom_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 957 | 958 | { |
| 958 | verboselog( | |
| 959 | verboselog( machine, 2, "cdrom_dma_read( %08x, %08x )\n", n_address, n_size ); | |
| 959 | 960 | // mame_printf_debug("DMA read: address %08x size %08x\n", n_address, n_size); |
| 960 | 961 | } |
| 961 | 962 | |
| 962 | static void cdrom_dma_write( UINT32 n_address, INT32 n_size ) | |
| 963 | static void cdrom_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 963 | 964 | { |
| 964 | running_machine *machine = Machine; | |
| 965 | ||
| 966 | 965 | verboselog( machine, 2, "cdrom_dma_write( %08x, %08x )\n", n_address, n_size ); |
| 967 | 966 | // mame_printf_debug("DMA write: address %08x size %08x\n", n_address, n_size); |
| 968 | 967 | |
| r3957 | r3958 | |
| 971 | 970 | verboselog( machine, 2, "atapi_xfer_end: %d %d\n", atapi_xferlen, atapi_xfermod ); |
| 972 | 971 | |
| 973 | 972 | // set a transfer complete timer (Note: CYCLES_PER_SECTOR can't be lower than 2000 or the BIOS ends up "out of order") |
| 974 | timer_adjust_oneshot(atapi_timer, cpu_clocks_to_attotime( | |
| 973 | timer_adjust_oneshot(atapi_timer, cpu_clocks_to_attotime(machine->cpu[0], (ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048))), 0); | |
| 975 | 974 | } |
| 976 | 975 | |
| 977 | 976 | static UINT32 m_n_security_control; |
| 978 | static void (*security_bit7_write)( int data ); | |
| 979 | static void (*security_bit6_write)( int data ); | |
| 980 | static void (*security_bit5_write)( int data ); | |
| 977 | static void (*security_bit7_write)( running_machine *machine, int data ); | |
| 978 | static void (*security_bit6_write)( running_machine *machine, int data ); | |
| 979 | static void (*security_bit5_write)( running_machine *machine, int data ); | |
| 981 | 980 | |
| 982 | 981 | static WRITE32_HANDLER( security_w ) |
| 983 | 982 | { |
| 983 | running_machine *machine = space->machine; | |
| 984 | 984 | COMBINE_DATA( &m_n_security_control ); |
| 985 | 985 | |
| 986 | 986 | verboselog( space->machine, 2, "security_w( %08x, %08x, %08x )\n", offset, mem_mask, data ); |
| r3957 | r3958 | |
| 990 | 990 | switch( chiptype[ security_cart_number ] ) |
| 991 | 991 | { |
| 992 | 992 | case 1: |
| 993 | x76f041_sda_write( security_cart_number, ( data >> 0 ) & 1 ); | |
| 994 | x76f041_scl_write( security_cart_number, ( data >> 1 ) & 1 ); | |
| 995 | x76f041_cs_write( security_cart_number, ( data >> 2 ) & 1 ); | |
| 996 | x76f041_rst_write( security_cart_number, ( data >> 3 ) & 1 ); | |
| 993 | x76f041_sda_write( machine, security_cart_number, ( data >> 0 ) & 1 ); | |
| 994 | x76f041_scl_write( machine, security_cart_number, ( data >> 1 ) & 1 ); | |
| 995 | x76f041_cs_write( machine, security_cart_number, ( data >> 2 ) & 1 ); | |
| 996 | x76f041_rst_write( machine, security_cart_number, ( data >> 3 ) & 1 ); | |
| 997 | 997 | break; |
| 998 | 998 | |
| 999 | 999 | case 2: |
| 1000 | x76f100_sda_write( security_cart_number, ( data >> 0 ) & 1 ); | |
| 1001 | x76f100_scl_write( security_cart_number, ( data >> 1 ) & 1 ); | |
| 1002 | x76f100_cs_write( security_cart_number, ( data >> 2 ) & 1 ); | |
| 1003 | x76f100_rst_write( security_cart_number, ( data >> 3 ) & 1 ); | |
| 1000 | x76f100_sda_write( machine, security_cart_number, ( data >> 0 ) & 1 ); | |
| 1001 | x76f100_scl_write( machine, security_cart_number, ( data >> 1 ) & 1 ); | |
| 1002 | x76f100_cs_write( machine, security_cart_number, ( data >> 2 ) & 1 ); | |
| 1003 | x76f100_rst_write( machine, security_cart_number, ( data >> 3 ) & 1 ); | |
| 1004 | 1004 | break; |
| 1005 | 1005 | |
| 1006 | 1006 | case 3: |
| 1007 | zs01_scl_write( security_cart_number, ( data >> 1 ) & 1 ); | |
| 1008 | zs01_cs_write( security_cart_number, ( data >> 2 ) & 1 ); | |
| 1009 | zs01_rst_write( security_cart_number, ( data >> 3 ) & 1 ); | |
| 1007 | zs01_scl_write( machine, security_cart_number, ( data >> 1 ) & 1 ); | |
| 1008 | zs01_cs_write( machine, security_cart_number, ( data >> 2 ) & 1 ); | |
| 1009 | zs01_rst_write( machine, security_cart_number, ( data >> 3 ) & 1 ); | |
| 1010 | 1010 | break; |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | 1013 | if( has_ds2401[ security_cart_number ] ) |
| 1014 | 1014 | { |
| 1015 | ds2401_write( security_cart_number, !( ( data >> 4 ) & 1 ) ); | |
| 1015 | ds2401_write( machine, security_cart_number, !( ( data >> 4 ) & 1 ) ); | |
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | if( security_bit5_write != NULL ) |
| 1019 | 1019 | { |
| 1020 | security_bit5_write( ( data >> 5 ) & 1 ); | |
| 1020 | security_bit5_write( machine, ( data >> 5 ) & 1 ); | |
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | 1023 | if( security_bit6_write != NULL ) |
| 1024 | 1024 | { |
| 1025 | security_bit6_write( ( data >> 6 ) & 1 ); | |
| 1025 | security_bit6_write( machine, ( data >> 6 ) & 1 ); | |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | if( security_bit7_write != NULL ) |
| 1029 | 1029 | { |
| 1030 | security_bit7_write( ( data >> 7 ) & 1 ); | |
| 1030 | security_bit7_write( machine, ( data >> 7 ) & 1 ); | |
| 1031 | 1031 | } |
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| r3957 | r3958 | |
| 1123 | 1123 | #define RC_CLC ( 0x100 ) |
| 1124 | 1124 | #define RC_DIV ( 0x200 ) |
| 1125 | 1125 | |
| 1126 | static UINT64 psxcpu_gettotalcycles( | |
| 1126 | static UINT64 psxcpu_gettotalcycles( running_machine *machine ) | |
| 1127 | 1127 | { |
| 1128 | 1128 | /* TODO: should return the start of the current tick. */ |
| 1129 | return cpu_get_total_cycles( | |
| 1129 | return cpu_get_total_cycles(machine->cpu[0]) * 2; | |
| 1130 | 1130 | } |
| 1131 | 1131 | |
| 1132 | 1132 | static int root_divider( int n_counter ) |
| r3957 | r3958 | |
| 1147 | 1147 | return 1; |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | static UINT16 root_current( int n_counter ) | |
| 1150 | static UINT16 root_current( running_machine *machine, int n_counter ) | |
| 1151 | 1151 | { |
| 1152 | 1152 | if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 ) |
| 1153 | 1153 | { |
| r3957 | r3958 | |
| 1156 | 1156 | else |
| 1157 | 1157 | { |
| 1158 | 1158 | UINT64 n_current; |
| 1159 | n_current = psxcpu_gettotalcycles() - m_p_n_root_start[ n_counter ]; | |
| 1159 | n_current = psxcpu_gettotalcycles(machine) - m_p_n_root_start[ n_counter ]; | |
| 1160 | 1160 | n_current /= root_divider( n_counter ); |
| 1161 | 1161 | n_current += m_p_n_root_count[ n_counter ]; |
| 1162 | 1162 | if( n_current > 0xffff ) |
| 1163 | 1163 | { |
| 1164 | 1164 | /* TODO: use timer for wrap on 0x10000. */ |
| 1165 | 1165 | m_p_n_root_count[ n_counter ] = n_current; |
| 1166 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 1166 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine); | |
| 1167 | 1167 | } |
| 1168 | 1168 | return n_current; |
| 1169 | 1169 | } |
| r3957 | r3958 | |
| 1179 | 1179 | return 0x10000; |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | static void root_timer_adjust( int n_counter ) | |
| 1182 | static void root_timer_adjust( running_machine *machine, int n_counter ) | |
| 1183 | 1183 | { |
| 1184 | 1184 | if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 ) |
| 1185 | 1185 | { |
| r3957 | r3958 | |
| 1189 | 1189 | { |
| 1190 | 1190 | int n_duration; |
| 1191 | 1191 | |
| 1192 | n_duration = root_target( n_counter ) - root_current( n_counter ); | |
| 1192 | n_duration = root_target( n_counter ) - root_current( machine, n_counter ); | |
| 1193 | 1193 | if( n_duration < 1 ) |
| 1194 | 1194 | { |
| 1195 | 1195 | n_duration += 0x10000; |
| r3957 | r3958 | |
| 1209 | 1209 | { |
| 1210 | 1210 | /* TODO: wrap should be handled differently as RC_COUNTTARGET & RC_IRQTARGET don't have to be the same. */ |
| 1211 | 1211 | m_p_n_root_count[ n_counter ] = 0; |
| 1212 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 1212 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine); | |
| 1213 | 1213 | } |
| 1214 | 1214 | if( ( m_p_n_root_mode[ n_counter ] & RC_REPEAT ) != 0 ) |
| 1215 | 1215 | { |
| 1216 | root_timer_adjust( n_counter ); | |
| 1216 | root_timer_adjust( machine, n_counter ); | |
| 1217 | 1217 | } |
| 1218 | 1218 | if( ( m_p_n_root_mode[ n_counter ] & RC_IRQOVERFLOW ) != 0 || |
| 1219 | 1219 | ( m_p_n_root_mode[ n_counter ] & RC_IRQTARGET ) != 0 ) |
| r3957 | r3958 | |
| 1232 | 1232 | { |
| 1233 | 1233 | case 0: |
| 1234 | 1234 | m_p_n_root_count[ n_counter ] = data; |
| 1235 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 1235 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine); | |
| 1236 | 1236 | break; |
| 1237 | 1237 | case 1: |
| 1238 | m_p_n_root_count[ n_counter ] = root_current( n_counter ); | |
| 1239 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(); | |
| 1238 | m_p_n_root_count[ n_counter ] = root_current( space->machine, n_counter ); | |
| 1239 | m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine); | |
| 1240 | 1240 | m_p_n_root_mode[ n_counter ] = data; |
| 1241 | 1241 | |
| 1242 | 1242 | if( ( m_p_n_root_mode[ n_counter ] & RC_RESET ) != 0 ) |
| r3957 | r3958 | |
| 1259 | 1259 | return; |
| 1260 | 1260 | } |
| 1261 | 1261 | |
| 1262 | root_timer_adjust( n_counter ); | |
| 1262 | root_timer_adjust( space->machine, n_counter ); | |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | static READ32_HANDLER( k573_counter_r ) |
| r3957 | r3958 | |
| 1272 | 1272 | switch( offset % 4 ) |
| 1273 | 1273 | { |
| 1274 | 1274 | case 0: |
| 1275 | data = root_current( n_counter ); | |
| 1275 | data = root_current( space->machine, n_counter ); | |
| 1276 | 1276 | break; |
| 1277 | 1277 | case 1: |
| 1278 | 1278 | data = m_p_n_root_mode[ n_counter ]; |
| r3957 | r3958 | |
| 1378 | 1378 | state_save_register_global(machine, control ); |
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | static double analogue_inputs_callback( int input ) | |
| 1381 | static double analogue_inputs_callback( running_machine *machine, int input ) | |
| 1382 | 1382 | { |
| 1383 | 1383 | switch( input ) |
| 1384 | 1384 | { |
| 1385 | 1385 | case ADC083X_CH0: |
| 1386 | return (double) ( input_port_read_safe( | |
| 1386 | return (double) ( input_port_read_safe(machine, "analog0", 0 ) * 5 ) / 255; | |
| 1387 | 1387 | case ADC083X_CH1: |
| 1388 | return (double) ( input_port_read_safe( | |
| 1388 | return (double) ( input_port_read_safe(machine, "analog1", 0 ) * 5 ) / 255; | |
| 1389 | 1389 | case ADC083X_CH2: |
| 1390 | return (double) ( input_port_read_safe( | |
| 1390 | return (double) ( input_port_read_safe(machine, "analog2", 0 ) * 5 ) / 255; | |
| 1391 | 1391 | case ADC083X_CH3: |
| 1392 | return (double) ( input_port_read_safe( | |
| 1392 | return (double) ( input_port_read_safe(machine, "analog3", 0 ) * 5 ) / 255; | |
| 1393 | 1393 | case ADC083X_AGND: |
| 1394 | 1394 | return 0; |
| 1395 | 1395 | case ADC083X_VREF: |
| r3957 | r3958 | |
| 1448 | 1448 | break; |
| 1449 | 1449 | |
| 1450 | 1450 | case 0x1014: |
| 1451 | zs01_init( cart, eeprom_rom, NULL, NULL, ds2401_rom ); | |
| 1451 | zs01_init( machine, cart, eeprom_rom, NULL, NULL, ds2401_rom ); | |
| 1452 | 1452 | chiptype[ cart ] = 3; |
| 1453 | 1453 | |
| 1454 | 1454 | switch( cart ) |
| r3957 | r3958 | |
| 1685 | 1685 | */ |
| 1686 | 1686 | |
| 1687 | 1687 | static UINT8 gx700pwbf_output_data[ 4 ]; |
| 1688 | static void (*gx700pwfbf_output_callback)( int offset, int data ); | |
| 1688 | static void (*gx700pwfbf_output_callback)( running_machine *machine, int offset, int data ); | |
| 1689 | 1689 | |
| 1690 | 1690 | static READ32_HANDLER( gx700pwbf_io_r ) |
| 1691 | 1691 | { |
| r3957 | r3958 | |
| 1718 | 1718 | return data; |
| 1719 | 1719 | } |
| 1720 | 1720 | |
| 1721 | static void gx700pwbf_output( int offset, UINT8 data ) | |
| 1721 | static void gx700pwbf_output( running_machine *machine, int offset, UINT8 data ) | |
| 1722 | 1722 | { |
| 1723 | 1723 | if( gx700pwfbf_output_callback != NULL ) |
| 1724 | 1724 | { |
| r3957 | r3958 | |
| 1730 | 1730 | int newbit = ( data >> shift[ i ] ) & 1; |
| 1731 | 1731 | if( oldbit != newbit ) |
| 1732 | 1732 | { |
| 1733 | gx700pwfbf_output_callback( ( offset * 8 ) + i, newbit ); | |
| 1733 | gx700pwfbf_output_callback( machine, ( offset * 8 ) + i, newbit ); | |
| 1734 | 1734 | } |
| 1735 | 1735 | } |
| 1736 | 1736 | } |
| r3957 | r3958 | |
| 1747 | 1747 | |
| 1748 | 1748 | if( ACCESSING_BITS_0_15 ) |
| 1749 | 1749 | { |
| 1750 | gx700pwbf_output( 0, data & 0xff ); | |
| 1750 | gx700pwbf_output( space->machine, 0, data & 0xff ); | |
| 1751 | 1751 | } |
| 1752 | 1752 | break; |
| 1753 | 1753 | |
| 1754 | 1754 | case 0x22: |
| 1755 | 1755 | if( ACCESSING_BITS_0_15 ) |
| 1756 | 1756 | { |
| 1757 | gx700pwbf_output( 1, data & 0xff ); | |
| 1757 | gx700pwbf_output( space->machine, 1, data & 0xff ); | |
| 1758 | 1758 | } |
| 1759 | 1759 | break; |
| 1760 | 1760 | |
| 1761 | 1761 | case 0x24: |
| 1762 | 1762 | if( ACCESSING_BITS_0_15 ) |
| 1763 | 1763 | { |
| 1764 | gx700pwbf_output( 2, data & 0xff ); | |
| 1764 | gx700pwbf_output( space->machine, 2, data & 0xff ); | |
| 1765 | 1765 | } |
| 1766 | 1766 | break; |
| 1767 | 1767 | |
| 1768 | 1768 | case 0x26: |
| 1769 | 1769 | if( ACCESSING_BITS_0_15 ) |
| 1770 | 1770 | { |
| 1771 | gx700pwbf_output( 3, data & 0xff ); | |
| 1771 | gx700pwbf_output( space->machine, 3, data & 0xff ); | |
| 1772 | 1772 | } |
| 1773 | 1773 | break; |
| 1774 | 1774 | |
| r3957 | r3958 | |
| 1778 | 1778 | } |
| 1779 | 1779 | } |
| 1780 | 1780 | |
| 1781 | static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) ) | |
| 1781 | static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) ) | |
| 1782 | 1782 | { |
| 1783 | 1783 | memset( gx700pwbf_output_data, 0, sizeof( gx700pwbf_output_data ) ); |
| 1784 | 1784 | |
| r3957 | r3958 | |
| 1826 | 1826 | stage[ offset ].DO = !data; |
| 1827 | 1827 | } |
| 1828 | 1828 | |
| 1829 | static void gn845pwbb_clk_w( int offset, int data ) | |
| 1829 | static void gn845pwbb_clk_w( running_machine *machine, int offset, int data ) | |
| 1830 | 1830 | { |
| 1831 | 1831 | int clk = !data; |
| 1832 | 1832 | |
| r3957 | r3958 | |
| 1870 | 1870 | } |
| 1871 | 1871 | } |
| 1872 | 1872 | |
| 1873 | verboselog( | |
| 1873 | verboselog( machine, 2, "stage: %dp data clk=%d state=%d d0=%d shift=%08x bit=%d stage_mask=%08x\n", offset + 1, clk, stage[ offset ].state, stage[ offset ].DO, stage[ offset ].shift, stage[ offset ].bit, stage_mask ); | |
| 1874 | 1874 | } |
| 1875 | 1875 | |
| 1876 | 1876 | static CUSTOM_INPUT( gn845pwbb_read ) |
| r3957 | r3958 | |
| 1878 | 1878 | return input_port_read(field->port->machine, "STAGE" ) & stage_mask; |
| 1879 | 1879 | } |
| 1880 | 1880 | |
| 1881 | static void gn845pwbb_output_callback( int offset, int data ) | |
| 1881 | static void gn845pwbb_output_callback( running_machine *machine, int offset, int data ) | |
| 1882 | 1882 | { |
| 1883 | 1883 | switch( offset ) |
| 1884 | 1884 | { |
| r3957 | r3958 | |
| 1903 | 1903 | break; |
| 1904 | 1904 | |
| 1905 | 1905 | case 7: |
| 1906 | gn845pwbb_clk_w( 0, !data ); | |
| 1906 | gn845pwbb_clk_w( machine, 0, !data ); | |
| 1907 | 1907 | break; |
| 1908 | 1908 | |
| 1909 | 1909 | case 8: |
| r3957 | r3958 | |
| 1927 | 1927 | break; |
| 1928 | 1928 | |
| 1929 | 1929 | case 15: |
| 1930 | gn845pwbb_clk_w( 1, !data ); | |
| 1930 | gn845pwbb_clk_w( machine, 1, !data ); | |
| 1931 | 1931 | break; |
| 1932 | 1932 | |
| 1933 | 1933 | case 17: |
| r3957 | r3958 | |
| 2120 | 2120 | case 0x3b: |
| 2121 | 2121 | if( ACCESSING_BITS_16_31 ) |
| 2122 | 2122 | { |
| 2123 | data |= ds2401_read( 2 ) << 28; | |
| 2123 | data |= ds2401_read( space->machine, 2 ) << 28; | |
| 2124 | 2124 | } |
| 2125 | 2125 | break; |
| 2126 | 2126 | case 0x3d: |
| r3957 | r3958 | |
| 2158 | 2158 | static UINT32 a,b,c,d; |
| 2159 | 2159 | |
| 2160 | 2160 | static UINT16 gx894pwbba_output_data[ 8 ]; |
| 2161 | static void (*gx894pwbba_output_callback)( int offset, int data ); | |
| 2161 | static void (*gx894pwbba_output_callback)( running_machine *machine, int offset, int data ); | |
| 2162 | 2162 | |
| 2163 | static void gx894pwbba_output( int offset, UINT8 data ) | |
| 2163 | static void gx894pwbba_output( running_machine *machine, int offset, UINT8 data ) | |
| 2164 | 2164 | { |
| 2165 | 2165 | if( gx894pwbba_output_callback != NULL ) |
| 2166 | 2166 | { |
| r3957 | r3958 | |
| 2172 | 2172 | int newbit = ( data >> shift[ i ] ) & 1; |
| 2173 | 2173 | if( oldbit != newbit ) |
| 2174 | 2174 | { |
| 2175 | gx894pwbba_output_callback( ( offset * 4 ) + i, newbit ); | |
| 2175 | gx894pwbba_output_callback( machine, ( offset * 4 ) + i, newbit ); | |
| 2176 | 2176 | } |
| 2177 | 2177 | } |
| 2178 | 2178 | } |
| r3957 | r3958 | |
| 2236 | 2236 | case 0x38: |
| 2237 | 2237 | if( ACCESSING_BITS_16_31 ) |
| 2238 | 2238 | { |
| 2239 | gx894pwbba_output( 0, ( data >> 28 ) & 0xf ); | |
| 2239 | gx894pwbba_output( space->machine, 0, ( data >> 28 ) & 0xf ); | |
| 2240 | 2240 | } |
| 2241 | 2241 | if( ACCESSING_BITS_0_15 ) |
| 2242 | 2242 | { |
| 2243 | gx894pwbba_output( 1, ( data >> 12 ) & 0xf ); | |
| 2243 | gx894pwbba_output( space->machine, 1, ( data >> 12 ) & 0xf ); | |
| 2244 | 2244 | } |
| 2245 | 2245 | COMBINE_DATA( &a ); |
| 2246 | 2246 | break; |
| 2247 | 2247 | case 0x39: |
| 2248 | 2248 | if( ACCESSING_BITS_16_31 ) |
| 2249 | 2249 | { |
| 2250 | gx894pwbba_output( 7, ( data >> 28 ) & 0xf ); | |
| 2250 | gx894pwbba_output( space->machine, 7, ( data >> 28 ) & 0xf ); | |
| 2251 | 2251 | } |
| 2252 | 2252 | if( ACCESSING_BITS_0_15 ) |
| 2253 | 2253 | { |
| 2254 | gx894pwbba_output( 3, ( data >> 12 ) & 0xf ); | |
| 2254 | gx894pwbba_output( space->machine, 3, ( data >> 12 ) & 0xf ); | |
| 2255 | 2255 | } |
| 2256 | 2256 | COMBINE_DATA( &b ); |
| 2257 | 2257 | break; |
| 2258 | 2258 | case 0x3b: |
| 2259 | 2259 | if( ACCESSING_BITS_16_31 ) |
| 2260 | 2260 | { |
| 2261 | ds2401_write( 2, !( ( data >> 28 ) & 1 ) ); | |
| 2261 | ds2401_write( space->machine, 2, !( ( data >> 28 ) & 1 ) ); | |
| 2262 | 2262 | } |
| 2263 | 2263 | break; |
| 2264 | 2264 | case 0x3e: |
| r3957 | r3958 | |
| 2286 | 2286 | |
| 2287 | 2287 | if( ACCESSING_BITS_16_31 ) |
| 2288 | 2288 | { |
| 2289 | gx894pwbba_output( 4, ( data >> 28 ) & 0xf ); | |
| 2289 | gx894pwbba_output( space->machine, 4, ( data >> 28 ) & 0xf ); | |
| 2290 | 2290 | } |
| 2291 | 2291 | COMBINE_DATA( &c ); |
| 2292 | 2292 | break; |
| 2293 | 2293 | case 0x3f: |
| 2294 | 2294 | if( ACCESSING_BITS_16_31 ) |
| 2295 | 2295 | { |
| 2296 | gx894pwbba_output( 2, ( data >> 28 ) & 0xf ); | |
| 2296 | gx894pwbba_output( space->machine, 2, ( data >> 28 ) & 0xf ); | |
| 2297 | 2297 | } |
| 2298 | 2298 | if( ACCESSING_BITS_0_15 ) |
| 2299 | 2299 | { |
| 2300 | gx894pwbba_output( 5, ( data >> 12 ) & 0xf ); | |
| 2300 | gx894pwbba_output( space->machine, 5, ( data >> 12 ) & 0xf ); | |
| 2301 | 2301 | } |
| 2302 | 2302 | COMBINE_DATA( &d ); |
| 2303 | 2303 | break; |
| r3957 | r3958 | |
| 2311 | 2311 | } |
| 2312 | 2312 | } |
| 2313 | 2313 | |
| 2314 | static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) ) | |
| 2314 | static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) ) | |
| 2315 | 2315 | { |
| 2316 | 2316 | int gx894_ram_size = 24 * 1024 * 1024; |
| 2317 | 2317 | |
| r3957 | r3958 | |
| 2351 | 2351 | |
| 2352 | 2352 | /* ddr solo */ |
| 2353 | 2353 | |
| 2354 | static void ddrsolo_output_callback( int offset, int data ) | |
| 2354 | static void ddrsolo_output_callback( running_machine *machine, int offset, int data ) | |
| 2355 | 2355 | { |
| 2356 | 2356 | switch( offset ) |
| 2357 | 2357 | { |
| r3957 | r3958 | |
| 2413 | 2413 | |
| 2414 | 2414 | /* drummania */ |
| 2415 | 2415 | |
| 2416 | static void drmn_output_callback( int offset, int data ) | |
| 2416 | static void drmn_output_callback( running_machine *machine, int offset, int data ) | |
| 2417 | 2417 | { |
| 2418 | 2418 | switch( offset ) |
| 2419 | 2419 | { |
| r3957 | r3958 | |
| 2493 | 2493 | |
| 2494 | 2494 | /* dance maniax */ |
| 2495 | 2495 | |
| 2496 | static void dmx_output_callback( int offset, int data ) | |
| 2496 | static void dmx_output_callback( running_machine *machine, int offset, int data ) | |
| 2497 | 2497 | { |
| 2498 | 2498 | switch( offset ) |
| 2499 | 2499 | { |
| r3957 | r3958 | |
| 2649 | 2649 | static int salarymc_lamp_data; |
| 2650 | 2650 | static int salarymc_lamp_clk; |
| 2651 | 2651 | |
| 2652 | static void salarymc_lamp_data_write( int data ) | |
| 2652 | static void salarymc_lamp_data_write( running_machine *machine, int data ) | |
| 2653 | 2653 | { |
| 2654 | 2654 | salarymc_lamp_data = data; |
| 2655 | 2655 | } |
| 2656 | 2656 | |
| 2657 | static void salarymc_lamp_rst_write( int data ) | |
| 2657 | static void salarymc_lamp_rst_write( running_machine *machine, int data ) | |
| 2658 | 2658 | { |
| 2659 | 2659 | if( data ) |
| 2660 | 2660 | { |
| r3957 | r3958 | |
| 2663 | 2663 | } |
| 2664 | 2664 | } |
| 2665 | 2665 | |
| 2666 | static void salarymc_lamp_clk_write( int data ) | |
| 2666 | static void salarymc_lamp_clk_write( running_machine *machine, int data ) | |
| 2667 | 2667 | { |
| 2668 | 2668 | if( salarymc_lamp_clk != data ) |
| 2669 | 2669 | { |
| r3957 | r3958 | |
| 2683 | 2683 | { |
| 2684 | 2684 | if( ( salarymc_lamp_shift & ~0xe38 ) != 0 ) |
| 2685 | 2685 | { |
| 2686 | verboselog( | |
| 2686 | verboselog( machine, 0, "unknown bits in salarymc_lamp_shift %08x\n", salarymc_lamp_shift & ~0xe38 ); | |
| 2687 | 2687 | } |
| 2688 | 2688 | |
| 2689 | 2689 | output_set_value( "player 1 red", ( salarymc_lamp_shift >> 11 ) & 1 ); |
| r3957 | r3958 | |
| 2715 | 2715 | state_save_register_global(machine, salarymc_lamp_clk ); |
| 2716 | 2716 | } |
| 2717 | 2717 | |
| 2718 | static const timekeeper_config timekeeper_intf = | |
| 2719 | { | |
| 2720 | "m48t58" | |
| 2721 | }; | |
| 2722 | ||
| 2723 | 2718 | static MACHINE_DRIVER_START( konami573 ) |
| 2724 | 2719 | /* basic machine hardware */ |
| 2725 | 2720 | MDRV_CPU_ADD("main", PSXCPU, XTAL_67_7376MHz ) |
| r3957 | r3958 | |
| 2755 | 2750 | MDRV_SOUND_ROUTE( 0, "left", 1.0 ) |
| 2756 | 2751 | MDRV_SOUND_ROUTE( 1, "right", 1.0 ) |
| 2757 | 2752 | |
| 2758 | MDRV_DEVICE_ADD( "m48t58", M48T58 ) | |
| 2759 | MDRV_DEVICE_CONFIG( timekeeper_intf ) | |
| 2753 | MDRV_M48T58_ADD( "m48t58" ) | |
| 2760 | 2754 | MACHINE_DRIVER_END |
| 2761 | 2755 | |
| 2762 | 2756 | static INPUT_PORTS_START( konami573 ) |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/m68000/m68000.h" | |
| 22 | 23 | #include "machine/atarigen.h" |
| 23 | 24 | #include "audio/atarijsa.h" |
| 24 | 25 | #include "video/atarirle.h" |
| r3957 | r3958 | |
| 955 | 956 | state_save_register_postload(machine, pitfighb_state_postload, NULL); |
| 956 | 957 | } |
| 957 | 958 | else if (slapstic != 0) |
| 958 | atarigen_slapstic_init(machine | |
| 959 | atarigen_slapstic_init(machine->cpu[0], slapstic_base, 0, slapstic); | |
| 959 | 960 | atarijsa_init(machine, "IN0", 0x4000); |
| 960 | 961 | |
| 961 | 962 | atarig1_pitfight = is_pitfight; |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | ***************************************************************************/ |
| 32 | 32 | |
| 33 | 33 | #include "driver.h" |
| 34 | #include "cpu/m6502/m6502.h" | |
| 34 | 35 | #include "sound/dac.h" |
| 35 | 36 | |
| 36 | 37 | #include "sbrkout.lh" |
| r3957 | r3958 | |
|---|---|---|
| 322 | 322 | MDRV_CPU_ADD("audio", M6809, 2000000) |
| 323 | 323 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 324 | 324 | |
| 325 | MDRV_ | |
| 325 | MDRV_QUANTUM_TIME | |
| 326 | 326 | |
| 327 | 327 | /* video hardware */ |
| 328 | 328 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "toobin.h" |
| r3957 | r3958 | |
|---|---|---|
| 217 | 217 | ***************************************************************************/ |
| 218 | 218 | |
| 219 | 219 | #include "driver.h" |
| 220 | #include "cpu/m6502/m6502.h" | |
| 220 | 221 | #include "video/vector.h" |
| 221 | 222 | #include "video/avgdvg.h" |
| 222 | 223 | #include "machine/atari_vg.h" |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "deprecat.h" |
| 13 | 14 | #include "cpu/m6809/m6809.h" |
| 14 | 15 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | *************************************************************************************************************/ |
| 47 | 47 | |
| 48 | 48 | #include "driver.h" |
| 49 | #include "cpu/m68000/m68000.h" | |
| 49 | 50 | #include "sound/ymz280b.h" |
| 50 | 51 | #include "machine/eeprom.h" |
| 51 | 52 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "cpu/m68000/m68000.h" | |
| 52 | 53 | #include "audio/mcr.h" |
| 53 | 54 | #include "audio/williams.h" |
| 54 | 55 | #include "mcr.h" |
| r3957 | r3958 | |
| 158 | 159 | /* turbocs_reset_w(~control_word & 0x0080);*/ |
| 159 | 160 | turbocs_data_w(space, offset, (control_word >> 8) & 0x001f); |
| 160 | 161 | |
| 161 | soundsgood_reset_w(~control_word & 0x2000); | |
| 162 | soundsgood_reset_w(space->machine, ~control_word & 0x2000); | |
| 162 | 163 | soundsgood_data_w(space, offset, (control_word >> 8) & 0x001f); |
| 163 | 164 | } |
| 164 | 165 | |
| r3957 | r3958 | |
| 210 | 211 | { |
| 211 | 212 | COMBINE_DATA(&control_word); |
| 212 | 213 | williams_cvsd_reset_w(~control_word & 0x0400); |
| 213 | williams_cvsd_data_w(control_word & 0x3ff); | |
| 214 | williams_cvsd_data_w(space->machine, control_word & 0x3ff); | |
| 214 | 215 | } |
| 215 | 216 | |
| 216 | 217 |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | ***************************************************************************/ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/z80/z80.h" | |
| 67 | 68 | #include "deprecat.h" |
| 68 | 69 | #include "sound/ay8910.h" |
| 69 | 70 | #include "machine/segacrpt.h" |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | Rewrite and aditional work: Roberto Fresca. |
| 8 | 8 | |
| 9 | 9 | |
| 10 | Games running on this hardware: | |
| 10 | 11 | |
| 11 | Games running in this hardware: | |
| 12 | ||
| 13 | 12 | * Jolly Card (austrian), TAB-Austria, 1985. |
| 14 | 13 | * Jolly Card (3x3 deal), TAB-Austria, 1985. |
| 15 | 14 | * Jolly Card Professional 2.0, Spale-Soft, 2000. |
| r3957 | r3958 | |
| 17 | 16 | * Jolly Card (croatian, set 1), TAB-Austria, 1985. |
| 18 | 17 | * Jolly Card (croatian, set 2), Soft Design, 1993. |
| 19 | 18 | * Jolly Card (italian, blue TAB board, encrypted), bootleg, 199?. |
| 19 | * Jolly Card (italian, encrypted bootleg), bootleg, 1990. | |
| 20 | 20 | * Super Joly 2000 - 3x, M.P. 1985. |
| 21 | 21 | * Jolly Card (austrian, Funworld, bootleg), Inter Games, 1986. |
| 22 | 22 | * Big Deal (hungarian, set 1), Funworld, 1986. |
| r3957 | r3958 | |
| 459 | 459 | - 1x trimmer (volume)(missing) |
| 460 | 460 | |
| 461 | 461 | |
| 462 | Jolly Card (italian encrypted bootleg) | |
| 463 | -------------------------------------- | |
| 462 | 464 | |
| 465 | - 1x UM6845P | |
| 466 | - 1x R65C02P3 (main CPU) | |
| 467 | - 1x AY-3-8910 (sound) | |
| 468 | - 2x MC68B21P | |
| 469 | - 1x oscillator 16.000 MHz | |
| 470 | - ROMs 3x 27256. | |
| 471 | - 1x PROM M1-7649-5 (not dumped) | |
| 472 | - 2x PLD HY18CV8S (not dumped) | |
| 473 | - 1x PAL16L8ACN (not dumped) | |
| 474 | - 1x 22x2 edge connector | |
| 475 | - 1x 18x2 edge connector | |
| 476 | - 1x trimmer (volume) | |
| 477 | - 1x 8x2 DIP switches. | |
| 478 | ||
| 479 | ||
| 463 | 480 | Big Deal (hungarian) |
| 464 | 481 | ------------------ |
| 465 | 482 | |
| r3957 | r3958 | |
| 976 | 993 | - Renamed the sets magiccrd, magiccda and magiccdb, to magicrd2, magicd2a and magicd2b. |
| 977 | 994 | - Updated technical notes. |
| 978 | 995 | |
| 996 | [2008/12/15] | |
| 997 | - Added new set: Jolly Card (italian, encrypted bootleg). | |
| 998 | No coins... Only remote credits. After nvram init, set the Payout DIP to 'manual' | |
| 999 | to allow the remote credits mode to work. | |
| 1000 | - Created inputs from the scratch for jolycdib. | |
| 1001 | - Updated technical notes. | |
| 979 | 1002 | |
| 1003 | ||
| 980 | 1004 | *** TO DO *** |
| 981 | 1005 | |
| 982 | 1006 | - Figure out the royalcdc & jokercrd encryption. |
| r3957 | r3958 | |
| 996 | 1020 | #define MASTER_CLOCK XTAL_16MHz |
| 997 | 1021 | |
| 998 | 1022 | #include "driver.h" |
| 1023 | #include "cpu/m6502/m6502.h" | |
| 999 | 1024 | #include "video/mc6845.h" |
| 1000 | 1025 | #include "machine/6821pia.h" |
| 1001 | 1026 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 1314 | 1339 | PORT_DIPSETTING( 0x80, "Manual Payout SW" ) |
| 1315 | 1340 | INPUT_PORTS_END |
| 1316 | 1341 | |
| 1342 | static INPUT_PORTS_START( jolycdib ) | |
| 1343 | PORT_START("IN0") | |
| 1344 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Remote") PORT_CODE(KEYCODE_Q) | |
| 1345 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop (Hold) 1") PORT_CODE(KEYCODE_Z) | |
| 1346 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Cancel / Autohold / Accredito (Take)") PORT_CODE(KEYCODE_N) | |
| 1347 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Doppio (Double)") | |
| 1348 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Stop (Hold) 5 / Bet / Half Gamble") PORT_CODE(KEYCODE_B) | |
| 1349 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1350 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 ) | |
| 1351 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Stop (Hold) 4 / Alta (High)") PORT_CODE(KEYCODE_V) | |
| 1352 | ||
| 1353 | PORT_START("IN1") | |
| 1354 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop (Hold) 2 / Bassa (Low)") PORT_CODE(KEYCODE_X) | |
| 1355 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop (Hold) 3") PORT_CODE(KEYCODE_C) | |
| 1356 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test1") PORT_CODE(KEYCODE_A) | |
| 1357 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test2") PORT_CODE(KEYCODE_S) | |
| 1358 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test3") PORT_CODE(KEYCODE_D) | |
| 1359 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1360 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test4") PORT_CODE(KEYCODE_F) | |
| 1361 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_M) | |
| 1362 | ||
| 1363 | PORT_START("IN2") | |
| 1364 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1365 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test5") PORT_CODE(KEYCODE_G) | |
| 1366 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test6") PORT_CODE(KEYCODE_H) | |
| 1367 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test7") PORT_CODE(KEYCODE_J) | |
| 1368 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test8") PORT_CODE(KEYCODE_K) | |
| 1369 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test9") PORT_CODE(KEYCODE_L) | |
| 1370 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test10") PORT_CODE(KEYCODE_E) | |
| 1371 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("test11") PORT_CODE(KEYCODE_R) | |
| 1372 | ||
| 1373 | PORT_START("DSW") | |
| 1374 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") | |
| 1375 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 1376 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1377 | PORT_DIPNAME( 0x02, 0x00, "Remote" ) PORT_DIPLOCATION("SW1:7") | |
| 1378 | PORT_DIPSETTING( 0x00, "10 Points/Pulse" ) | |
| 1379 | PORT_DIPSETTING( 0x02, "100 Points/Pulse" ) | |
| 1380 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") | |
| 1381 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1382 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1383 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") | |
| 1384 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1385 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1386 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") | |
| 1387 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1388 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1389 | PORT_DIPNAME( 0x20, 0x00, "Joker" ) PORT_DIPLOCATION("SW1:3") | |
| 1390 | PORT_DIPSETTING( 0x00, "With Joker" ) /* also enable Five of a Kind */ | |
| 1391 | PORT_DIPSETTING( 0x20, "Without Joker" ) | |
| 1392 | PORT_DIPNAME( 0x40, 0x00, "Auto Hold" ) PORT_DIPLOCATION("SW1:2") | |
| 1393 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1394 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* when is ON, allow the player to activate/deactivate the autohold through CANCEL button */ | |
| 1395 | ||
| 1396 | /* after nvram init, set the following one to 'manual' | |
| 1397 | to allow the remote credits mode to work */ | |
| 1398 | PORT_DIPNAME( 0x80, 0x00, "Payout" ) PORT_DIPLOCATION("SW1:1") | |
| 1399 | PORT_DIPSETTING( 0x00, "Hopper" ) | |
| 1400 | PORT_DIPSETTING( 0x80, "Manual Payout SW" ) | |
| 1401 | INPUT_PORTS_END | |
| 1402 | ||
| 1317 | 1403 | static INPUT_PORTS_START( jolyc980 ) |
| 1318 | 1404 | PORT_START("IN0") |
| 1319 | 1405 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Navijanje (Remote)") PORT_CODE(KEYCODE_Q) |
| r3957 | r3958 | |
| 1907 | 1993 | MDRV_VIDEO_START(funworld) |
| 1908 | 1994 | MDRV_VIDEO_UPDATE(funworld) |
| 1909 | 1995 | |
| 1910 | MDRV_ | |
| 1996 | MDRV_M | |
| 1911 | 1997 | |
| 1912 | 1998 | /* sound hardware */ |
| 1913 | 1999 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
| 2057 | 2143 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) |
| 2058 | 2144 | ROM_END |
| 2059 | 2145 | |
| 2060 | ROM_START( jolycdit ) /* encrypted graphics */ | |
| 2146 | ROM_START( jolycdit ) /* blue TAB PCB, encrypted graphics */ | |
| 2061 | 2147 | ROM_REGION( 0x10000, "main", 0 ) |
| 2062 | 2148 | ROM_LOAD( "jn.bin", 0x8000, 0x8000, CRC(6ae00ed0) SHA1(5921c2882aeb5eadd0e04a477fa505ad35e9d98c) ) |
| 2063 | 2149 | |
| r3957 | r3958 | |
| 2072 | 2158 | ROM_LOAD( "gal16v8b.bin", 0x0000, 0x0117, CRC(3ad712b1) SHA1(54214841fb178e4b59bf6051522718f7667bad28) ) |
| 2073 | 2159 | ROM_END |
| 2074 | 2160 | |
| 2161 | /* jolycdit vs jolycdib: | |
| 2162 | ||
| 2163 | 1.BIN 1.BIN IDENTICAL | |
| 2164 | 2.BIN 2.bin IDENTICAL | |
| 2165 | jn.BIN 3.BIN 97.726440% | |
| 2166 | ||
| 2167 | jolycdib program seems to be the original for blue TAB PCB. | |
| 2168 | jolycdit has some code patches and redirected parts to suspicious offsets (as d500, d000, etc) | |
| 2169 | */ | |
| 2170 | ROM_START( jolycdib ) /* bootleg PCB, encrypted graphics */ | |
| 2171 | ROM_REGION( 0x10000, "main", 0 ) | |
| 2172 | ROM_LOAD( "3.bin", 0x8000, 0x8000, CRC(c76fdc79) SHA1(fc75c274d64fa9c99a546d424f38e79f1acf2576) ) | |
| 2173 | ||
| 2174 | ROM_REGION( 0x10000, "gfx1", ROMREGION_DISPOSE ) | |
| 2175 | ROM_LOAD( "2.bin", 0x0000, 0x8000, CRC(46805150) SHA1(63687ac44f6ace6d8924b2629536bcc7d3979ed2) ) | |
| 2176 | ROM_LOAD( "1.bin", 0x8000, 0x8000, CRC(43bcb2df) SHA1(5022bc3a0b852a7cd433e25c3c90a720e6328261) ) | |
| 2177 | ||
| 2178 | ROM_REGION( 0x0200, "proms", 0 ) | |
| 2179 | ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) ) | |
| 2180 | ||
| 2181 | ROM_REGION( 0x0200, "plds", 0 ) | |
| 2182 | ROM_LOAD( "gal16v8b.bin", 0x0000, 0x0117, CRC(3ad712b1) SHA1(54214841fb178e4b59bf6051522718f7667bad28) ) | |
| 2183 | ROM_END | |
| 2184 | ||
| 2075 | 2185 | ROM_START( sjcd2kx3 ) /* Super Joly 2000 3x */ |
| 2076 | 2186 | ROM_REGION( 0x10000, "main", 0 ) |
| 2077 | 2187 | ROM_LOAD( "sj3.bin", 0x8000, 0x8000, CRC(c530b518) SHA1(36934d8e1e2cb2f71eb44a05b86ec970c9f398cd) ) |
| r3957 | r3958 | |
| 2816 | 2926 | GAME( 1985, jolyccra, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "TAB-Austria", "Jolly Card (croatian, set 1)", 0 ) |
| 2817 | 2927 | GAME( 1993, jolyccrb, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "Soft Design", "Jolly Card (croatian, set 2)", 0 ) |
| 2818 | 2928 | GAME( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, tabblue, ROT0, "bootleg", "Jolly Card (italian, blue TAB board, encrypted)", 0 ) |
| 2929 | GAME( 1990, jolycdib, jollycrd, cuoreuno, jolycdib, tabblue, ROT0, "bootleg", "Jolly Card (italian, encrypted bootleg)", 0 ) /* not a real TAB blue PCB */ | |
| 2819 | 2930 | GAME( 1985, sjcd2kx3, jollycrd, funworld, funworld, funworld, ROT0, "M.P.", "Super Joly 2000 - 3x", 0 ) |
| 2820 | 2931 | GAME( 1986, jolycdab, jollycrd, funworld, funworld, funworld, ROT0, "Inter Games", "Jolly Card (austrian, Funworld, bootleg)", GAME_NOT_WORKING ) |
| 2821 | 2932 | GAME( 1986, bigdeal, 0, funworld, bigdeal, funworld, ROT0, "Funworld", "Big Deal (hungarian, set 1)", GAME_IMPERFECT_COLORS ) |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "cpu/m68000/m68000.h" | |
| 22 | 23 | #include "deprecat.h" |
| 23 | 24 | #include "video/konamiic.h" |
| 24 | 25 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 401 | 402 | /* 60 fps, that's how I fixed it for now. */ |
| 402 | 403 | MDRV_CPU_PROGRAM_MAP(overdriv_s_readmem,overdriv_s_writemem) |
| 403 | 404 | |
| 404 | MDRV_ | |
| 405 | MDRV_QUANTUM_TIME | |
| 405 | 406 | |
| 406 | 407 | MDRV_MACHINE_RESET(overdriv) |
| 407 | 408 | MDRV_NVRAM_HANDLER(overdriv) |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 13 | 14 | #include "video/konamiic.h" |
| 14 | 15 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/m68000/m68000.h" | |
| 12 | 13 | #include "deprecat.h" |
| 13 | 14 | #include "sound/okim6295.h" |
| 14 | 15 |
| r3957 | r3958 | |
|---|---|---|
| 256 | 256 | /* FIXME: The 8085A had a max clock of 6MHz, internally divided by 2! */ |
| 257 | 257 | MDRV_CPU_ADD("main", 8085A, 8000000 * 2) /* 4.00 MHz??? */ |
| 258 | 258 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 259 | MDRV_CPU_VBLANK_INT("main", irq3_line_ | |
| 259 | MDRV_CPU_VBLANK_INT("main", irq3_line_pulse) | |
| 260 | 260 | |
| 261 | 261 | MDRV_CPU_ADD("audio", I8035, 6144000) /* divisor ??? */ |
| 262 | 262 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r3957 | r3958 | |
|---|---|---|
| 707 | 707 | MDRV_CPU_ADD("audio", Z80, XTAL_18MHz/6) /* verified on pcb */ |
| 708 | 708 | MDRV_CPU_PROGRAM_MAP(cpu3_map,0) |
| 709 | 709 | |
| 710 | MDRV_ | |
| 710 | MDRV_QUANTUM_TIME | |
| 711 | 711 | |
| 712 | 712 | MDRV_MACHINE_RESET(gsword) |
| 713 | 713 | |
| 714 | 714 | #if 1 |
| 715 | 715 | /* to MCU timeout champbbj */ |
| 716 | MDRV_ | |
| 716 | MDRV_QUANTUM_TIME | |
| 717 | 717 | #endif |
| 718 | 718 | |
| 719 | 719 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/m68000/m68000.h" | |
| 43 | 44 | #include "sound/okim6295.h" |
| 44 | 45 | #include "galaxi.lh" |
| 45 | 46 |
| r3957 | r3958 | |
|---|---|---|
| 220 | 220 | */ |
| 221 | 221 | |
| 222 | 222 | #include "driver.h" |
| 223 | #include "cpu/z80/z80.h" | |
| 224 | #include "cpu/m68000/m68000.h" | |
| 223 | 225 | #include "sound/okim6295.h" |
| 224 | 226 | #include "sound/3812intf.h" |
| 225 | 227 |
| r3957 | r3958 | |
|---|---|---|
| 90 | 90 | ***************************************************************************/ |
| 91 | 91 | |
| 92 | 92 | #include "driver.h" |
| 93 | #include "cpu/z80/z80.h" | |
| 93 | 94 | #include "machine/z80dma.h" |
| 94 | 95 | |
| 95 | 96 | #include "mario.h" |
| r3957 | r3958 | |
| 105 | 106 | |
| 106 | 107 | static const z80dma_interface mario_dma = |
| 107 | 108 | { |
| 108 | 0, | |
| 109 | Z80_CLOCK, | |
| 109 | "main", | |
| 110 | 110 | |
| 111 | 111 | mario_dma_read_byte, |
| 112 | 112 | mario_dma_write_byte, |
| r3957 | r3958 | |
| 346 | 346 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) |
| 347 | 347 | |
| 348 | 348 | /* devices */ |
| 349 | MDRV_DEVICE_ADD("z80dma", Z80DMA) | |
| 350 | MDRV_DEVICE_CONFIG(mario_dma) | |
| 349 | MDRV_Z80DMA_ADD("z80dma", Z80_CLOCK, mario_dma) | |
| 351 | 350 | |
| 352 | 351 | /* video hardware */ |
| 353 | 352 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/m68000/m68000.h" | |
| 17 | 18 | #include "deprecat.h" |
| 18 | 19 | #include "video/konamiic.h" |
| 19 | 20 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 103 | 103 | ***************************************************************************/ |
| 104 | 104 | |
| 105 | 105 | #include "driver.h" |
| 106 | #include "cpu/m6502/m6502.h" | |
| 106 | 107 | #include "deprecat.h" |
| 107 | 108 | #include "atarifb.h" |
| 108 | 109 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "cpu/m68000/m68000.h" | |
| 2 | 3 | #include "sound/2151intf.h" |
| 3 | 4 | #include "sound/okim6295.h" |
| 4 | 5 |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/z80/z80.h" | |
| 15 | 16 | #include "sound/ay8910.h" |
| 16 | 17 | |
| 17 | 18 | static tilemap *bg_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 593 | 593 | memory_set_bankptr(machine, 1, &prgrom[0x10000]); |
| 594 | 594 | memory_set_bankptr(machine, 2, &prgrom[0x48000]); |
| 595 | 595 | /* force reset again to read proper reset vector */ |
| 596 | c | |
| 596 | device | |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | static const gfx_layout lethal_6bpp = |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | *************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/m6502/m6502.h" | |
| 14 | 15 | #include "videopin.h" |
| 15 | 16 | #include "videopin.lh" |
| 16 | 17 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 209 | 209 | ***************************************************************************/ |
| 210 | 210 | |
| 211 | 211 | #include "driver.h" |
| 212 | #include "cpu/m6502/m6502.h" | |
| 212 | 213 | #include "cpu/m6809/m6809.h" |
| 213 | 214 | #include "sound/2203intf.h" |
| 214 | 215 | #include "sound/3812intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 447 | 447 | MDRV_CPU_ADD("audio", Z80,8000000/2) /* 4MHz */ |
| 448 | 448 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 449 | 449 | /* NMIs are triggered by the main CPU */ |
| 450 | MDRV_ | |
| 450 | MDRV_QUANTUM_TIME | |
| 451 | 451 | |
| 452 | 452 | /* video hardware */ |
| 453 | 453 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 487 | 487 | MDRV_CPU_ADD("audio", Z80,8000000/2) /* 4MHz */ |
| 488 | 488 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 489 | 489 | /* NMIs are triggered by the main CPU */ |
| 490 | MDRV_ | |
| 490 | MDRV_QUANTUM_TIME | |
| 491 | 491 | |
| 492 | 492 | /* video hardware */ |
| 493 | 493 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | */ |
| 54 | 54 | |
| 55 | 55 | #include "driver.h" |
| 56 | #include "cpu/m68000/m68000.h" | |
| 56 | 57 | #include "sound/2610intf.h" |
| 57 | 58 | |
| 58 | 59 | static UINT16 *unkram; |
| r3957 | r3958 | |
|---|---|---|
| 103 | 103 | ***************************************************************************/ |
| 104 | 104 | |
| 105 | 105 | #include "driver.h" |
| 106 | #include "cpu/z80/z80.h" | |
| 106 | 107 | #include "sound/custom.h" |
| 107 | 108 | #include "sound/tms36xx.h" |
| 108 | 109 | #include "includes/phoenix.h" |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ****************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/m6502/m6502.h" | |
| 14 | 15 | #include "machine/atari_vg.h" |
| 15 | 16 | #include "sound/pokey.h" |
| 16 | 17 |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | #include "driver.h" |
| 7 | #include "cpu/i386/i386.h" | |
| 7 | 8 | #include "memconv.h" |
| 8 | 9 | #include "devconv.h" |
| 9 | #include "deprecat.h" | |
| 10 | 10 | #include "machine/8237dma.h" |
| 11 | 11 | #include "machine/pic8259.h" |
| 12 | 12 | #include "machine/pit8253.h" |
| r3957 | r3958 | |
| 16 | 16 | #include "machine/8042kbdc.h" |
| 17 | 17 | #include "machine/pckeybrd.h" |
| 18 | 18 | #include "machine/idectrl.h" |
| 19 | #include "cpu/i386/i386.h" | |
| 20 | 19 | |
| 21 | 20 | static void ide_interrupt(const device_config *device, int state); |
| 22 | 21 | |
| r3957 | r3958 | |
| 386 | 385 | |
| 387 | 386 | static const struct dma8237_interface dma8237_1_config = |
| 388 | 387 | { |
| 389 | | |
| 388 | "main", | |
| 390 | 389 | 1.0e-6, // 1us |
| 391 | 390 | |
| 392 | 391 | pc_dma_read_byte, |
| r3957 | r3958 | |
| 400 | 399 | |
| 401 | 400 | static const struct dma8237_interface dma8237_2_config = |
| 402 | 401 | { |
| 403 | | |
| 402 | "main", | |
| 404 | 403 | 1.0e-6, // 1us |
| 405 | 404 | |
| 406 | 405 | NULL, |
| r3957 | r3958 | |
| 638 | 637 | |
| 639 | 638 | MACHINE_DRIVER_END |
| 640 | 639 | |
| 641 | static void set_gate_a20(int a20) | |
| 640 | static void set_gate_a20(running_machine *machine, int a20) | |
| 642 | 641 | { |
| 643 | cpu_set_input_line( | |
| 642 | cpu_set_input_line(machine->cpu[0], INPUT_LINE_A20, a20); | |
| 644 | 643 | } |
| 645 | 644 | |
| 646 | static void keyboard_interrupt(int state) | |
| 645 | static void keyboard_interrupt(running_machine *machine, int state) | |
| 647 | 646 | { |
| 648 | 647 | pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state); |
| 649 | 648 | } |
| r3957 | r3958 | |
| 662 | 661 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, taitowlf_get_out2 |
| 663 | 662 | }; |
| 664 | 663 | |
| 665 | static void taitowlf_set_keyb_int(int state) { | |
| 664 | static void taitowlf_set_keyb_int(running_machine *machine, int state) { | |
| 666 | 665 | pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state); |
| 667 | 666 | } |
| 668 | 667 |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | ****************************************/ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "cpu/m6809/m6809.h" | |
| 34 | #include "cpu/m68000/m68000.h" | |
| 33 | 35 | #include "machine/namcoio.h" |
| 34 | 36 | #include "sound/namco.h" |
| 35 | 37 | |
| r3957 | r3958 | |
| 77 | 79 | } |
| 78 | 80 | static WRITE8_HANDLER( flip ) |
| 79 | 81 | { |
| 80 | flip_screen_set(data & 1); | |
| 82 | flip_screen_set(space->machine, data & 1); | |
| 81 | 83 | } |
| 82 | 84 | |
| 83 | 85 | /* chip #0: player inputs, buttons, coins */ |
| r3957 | r3958 | |
| 154 | 156 | |
| 155 | 157 | static READ8_HANDLER( toypop_main_interrupt_enable_r ) |
| 156 | 158 | { |
| 157 | cpu_interrupt_enable(0,1); | |
| 159 | cpu_interrupt_enable(space->machine->cpu[0],1); | |
| 158 | 160 | return 0; |
| 159 | 161 | } |
| 160 | 162 | |
| 161 | 163 | static WRITE8_HANDLER( toypop_main_interrupt_enable_w ) |
| 162 | 164 | { |
| 163 | cpu_interrupt_enable(0,1); | |
| 165 | cpu_interrupt_enable(space->machine->cpu[0],1); | |
| 164 | 166 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 165 | 167 | } |
| 166 | 168 | |
| 167 | 169 | static WRITE8_HANDLER( toypop_main_interrupt_disable_w ) |
| 168 | 170 | { |
| 169 | cpu_interrupt_enable(0,0); | |
| 171 | cpu_interrupt_enable(space->machine->cpu[0],0); | |
| 170 | 172 | } |
| 171 | 173 | |
| 172 | 174 | static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w ) |
| 173 | 175 | { |
| 174 | cpu_interrupt_enable(1,1); | |
| 176 | cpu_interrupt_enable(space->machine->cpu[1],1); | |
| 175 | 177 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 176 | 178 | } |
| 177 | 179 | |
| 178 | 180 | static WRITE8_HANDLER( toypop_sound_interrupt_disable_w ) |
| 179 | 181 | { |
| 180 | cpu_interrupt_enable(1,0); | |
| 182 | cpu_interrupt_enable(space->machine->cpu[1],0); | |
| 181 | 183 | } |
| 182 | 184 | |
| 183 | 185 | static INTERRUPT_GEN( toypop_main_interrupt ) |
| r3957 | r3958 | |
| 212 | 214 | |
| 213 | 215 | static TIMER_CALLBACK( disable_interrupts ) |
| 214 | 216 | { |
| 215 | cpu_interrupt_enable(0,0); | |
| 217 | cpu_interrupt_enable(machine->cpu[0],0); | |
| 216 | 218 | cpu_set_input_line(machine->cpu[0], 0, CLEAR_LINE); |
| 217 | cpu_interrupt_enable(1,0); | |
| 219 | cpu_interrupt_enable(machine->cpu[1],0); | |
| 218 | 220 | cpu_set_input_line(machine->cpu[1], 0, CLEAR_LINE); |
| 219 | 221 | interrupt_enable_68k = 0; |
| 220 | 222 | } |
| r3957 | r3958 | |
| 580 | 582 | MDRV_CPU_PROGRAM_MAP(readmem_68k,writemem_68k) |
| 581 | 583 | MDRV_CPU_VBLANK_INT("main", toypop_m68000_interrupt) |
| 582 | 584 | |
| 583 | MDRV_ | |
| 585 | MDRV_QUANTUM_TIME | |
| 584 | 586 | /* synchronization of the CPUs */ |
| 585 | 587 | MDRV_MACHINE_RESET(toypop) |
| 586 | 588 |
| r3957 | r3958 | |
|---|---|---|
| 309 | 309 | ***************************************************************************/ |
| 310 | 310 | |
| 311 | 311 | #include "driver.h" |
| 312 | #include "cpu/z80/z80.h" | |
| 313 | #include "cpu/m68000/m68000.h" | |
| 312 | 314 | #include "cpu/h6280/h6280.h" |
| 313 | 315 | #include "decocrpt.h" |
| 314 | 316 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | /*====================================================================*/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include " | |
| 25 | #include " | |
| 26 | 26 | #include "cpu/tms34010/tms34010.h" |
| 27 | 27 | #include "cpu/mcs51/mcs51.h" |
| 28 | 28 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 874 | 874 | MDRV_CPU_IO_MAP(soundmem_io,0) |
| 875 | 875 | |
| 876 | 876 | MDRV_MACHINE_RESET(micro3d) |
| 877 | MDRV_ | |
| 877 | MDRV_QUANTUM_TIME | |
| 878 | 878 | |
| 879 | 879 | MDRV_PALETTE_LENGTH(32768) |
| 880 | 880 |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | *****************************************************************************/ |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/z80/z80.h" | |
| 45 | 46 | #include "sound/2203intf.h" |
| 46 | 47 | |
| 47 | 48 | extern UINT8 *momoko_bg_scrollx; |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/z80/z80.h" | |
| 14 | 15 | #include "deprecat.h" |
| 15 | 16 | #include "sound/ay8910.h" |
| 16 | 17 | |
| r3957 | r3958 | |
| 67 | 68 | |
| 68 | 69 | static WRITE8_HANDLER( olibochu_flipscreen_w ) |
| 69 | 70 | { |
| 70 | if (flip_screen_get() != (data & 0x80)) | |
| 71 | if (flip_screen_get(space->machine) != (data & 0x80)) | |
| 71 | 72 | { |
| 72 | flip_screen_set(data & 0x80); | |
| 73 | flip_screen_set(space->machine, data & 0x80); | |
| 73 | 74 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 74 | 75 | } |
| 75 | 76 | |
| r3957 | r3958 | |
| 108 | 109 | int sx = spriteram[offs+3]; |
| 109 | 110 | int sy = ((spriteram[offs+2] + 8) & 0xff) - 8; |
| 110 | 111 | |
| 111 | if (flip_screen_get()) | |
| 112 | if (flip_screen_get(machine)) | |
| 112 | 113 | { |
| 113 | 114 | sx = 240 - sx; |
| 114 | 115 | sy = 240 - sy; |
| r3957 | r3958 | |
| 136 | 137 | int sx = spriteram_2[offs+3]; |
| 137 | 138 | int sy = spriteram_2[offs+2]; |
| 138 | 139 | |
| 139 | if (flip_screen_get()) | |
| 140 | if (flip_screen_get(machine)) | |
| 140 | 141 | { |
| 141 | 142 | sx = 248 - sx; |
| 142 | 143 | sy = 248 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6502/m6502.h" | |
| 8 | 9 | #include "ultratnk.h" |
| 9 | 10 | #include "audio/sprint4.h" |
| 10 | 11 |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | *****************************************************************************/ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "cpu/z80/z80.h" | |
| 29 | #include "cpu/nec/nec.h" | |
| 28 | 30 | #include "deprecat.h" |
| 29 | 31 | #include "iremipt.h" |
| 30 | 32 | #include "machine/irem_cpu.h" |
| 31 | 33 | #include "audio/m72.h" |
| 32 | 34 | #include "sound/dac.h" |
| 33 | 35 | #include "sound/2151intf.h" |
| 34 | #include "cpu/nec/nec.h" | |
| 35 | 36 | |
| 36 | 37 | static UINT32 bankaddress; |
| 37 | 38 |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ****************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/m6502/m6502.h" | |
| 25 | 26 | #include "machine/6821pia.h" |
| 26 | 27 | #include "sound/ay8910.h" |
| 27 | 28 |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | ***************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 37 | #include "cpu/m6809/m6809.h" | |
| 36 | 38 | #include "sound/2203intf.h" |
| 37 | 39 | |
| 38 | 40 | extern UINT8 *scotrsht_scroll; |
| r3957 | r3958 | |
| 51 | 53 | static WRITE8_HANDLER( ctrl_w ) |
| 52 | 54 | { |
| 53 | 55 | irq_enable = data & 0x02; |
| 54 | flip_screen_set(data & 0x08); | |
| 56 | flip_screen_set(space->machine, data & 0x08); | |
| 55 | 57 | } |
| 56 | 58 | |
| 57 | 59 | static INTERRUPT_GEN( scotrsht_interrupt ) |
| r3957 | r3958 | |
|---|---|---|
| 858 | 858 | ***************************************************************************/ |
| 859 | 859 | |
| 860 | 860 | #include "driver.h" |
| 861 | #include "cpu/z80/z80.h" | |
| 861 | 862 | #include "taitoipt.h" |
| 862 | 863 | #include "cpu/m68000/m68000.h" |
| 863 | 864 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
| 3253 | 3254 | |
| 3254 | 3255 | MDRV_MACHINE_START(taitoz) |
| 3255 | 3256 | |
| 3256 | MDRV_ | |
| 3257 | MDRV_QUANTUM_TIME | |
| 3257 | 3258 | |
| 3258 | 3259 | /* video hardware */ |
| 3259 | 3260 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3307 | 3308 | |
| 3308 | 3309 | MDRV_MACHINE_START(taitoz) |
| 3309 | 3310 | |
| 3310 | MDRV_ | |
| 3311 | MDRV_QUANTUM_TIME | |
| 3311 | 3312 | |
| 3312 | 3313 | /* video hardware */ |
| 3313 | 3314 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3362 | 3363 | |
| 3363 | 3364 | MDRV_MACHINE_START(taitoz) |
| 3364 | 3365 | |
| 3365 | MDRV_ | |
| 3366 | MDRV_QUANTUM_TIME | |
| 3366 | 3367 | |
| 3367 | 3368 | /* video hardware */ |
| 3368 | 3369 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3417 | 3418 | |
| 3418 | 3419 | MDRV_MACHINE_START(taitoz) |
| 3419 | 3420 | |
| 3420 | MDRV_ | |
| 3421 | MDRV_QUANTUM_TIME | |
| 3421 | 3422 | |
| 3422 | 3423 | /* video hardware */ |
| 3423 | 3424 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3473 | 3474 | |
| 3474 | 3475 | MDRV_MACHINE_START(taitoz) |
| 3475 | 3476 | |
| 3476 | MDRV_ | |
| 3477 | MDRV_QUANTUM_TIME | |
| 3477 | 3478 | |
| 3478 | 3479 | /* video hardware */ |
| 3479 | 3480 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3580 | 3581 | |
| 3581 | 3582 | MDRV_MACHINE_START(taitoz) |
| 3582 | 3583 | |
| 3583 | MDRV_ | |
| 3584 | MDRV_QUANTUM_TIME | |
| 3584 | 3585 | |
| 3585 | 3586 | /* video hardware */ |
| 3586 | 3587 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 3634 | 3635 | MDRV_CPU_VBLANK_INT("main", dblaxle_cpub_interrupt) |
| 3635 | 3636 | |
| 3636 | 3637 | MDRV_MACHINE_START(taitoz) |
| 3637 | MDRV_ | |
| 3638 | MDRV_QUANTUM_TIME | |
| 3638 | 3639 | |
| 3639 | 3640 | /* video hardware */ |
| 3640 | 3641 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "cpu/z80/z80.h" | |
| 33 | 34 | #include "sound/tms36xx.h" |
| 34 | 35 | #include "cpu/i8085/i8085.h" |
| 35 | 36 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 503 | 504 | |
| 504 | 505 | /* Same as Phoenix, but uses an AY8910 and an extra visible line (column) */ |
| 505 | 506 | |
| 507 | static const i8085_config survival_i8085_config = | |
| 508 | { | |
| 509 | NULL, /* INTE changed callback */ | |
| 510 | NULL, /* STATUS changed callback */ | |
| 511 | NULL, /* SOD changed callback (8085A only) */ | |
| 512 | survival_sid_callback /* SID changed callback (8085A only) */ | |
| 513 | }; | |
| 514 | ||
| 506 | 515 | static MACHINE_DRIVER_START( survival ) |
| 507 | 516 | |
| 508 | 517 | /* basic machine hardware */ |
| 509 | 518 | MDRV_CPU_ADD("main", 8085A, CPU_CLOCK) /* 5.50 MHz */ |
| 519 | MDRV_CPU_CONFIG(survival_i8085_config) | |
| 510 | 520 | MDRV_CPU_PROGRAM_MAP(survival_memory_map, 0) |
| 511 | 521 | |
| 512 | 522 | MDRV_MACHINE_RESET(phoenix) |
| r3957 | r3958 | |
| 1018 | 1028 | memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x5000, 0x5000, 0, 0, input_port_read_handler8(machine->portconfig, "DSW1") ); |
| 1019 | 1029 | } |
| 1020 | 1030 | |
| 1021 | static DRIVER_INIT( survival ) | |
| 1022 | { | |
| 1023 | i8085_set_sid_callback(machine->cpu[0], survival_sid_callback); | |
| 1024 | } | |
| 1025 | 1031 | |
| 1026 | 1032 | |
| 1027 | ||
| 1028 | 1033 | GAME( 1980, phoenix, 0, phoenix, phoenix, 0, ROT90, "Amstar", "Phoenix (Amstar)", GAME_SUPPORTS_SAVE ) |
| 1029 | 1034 | GAME( 1980, phoenixa, phoenix, phoenix, phoenixa, 0, ROT90, "Amstar (Centuri license)", "Phoenix (Centuri, set 1)", GAME_SUPPORTS_SAVE ) |
| 1030 | 1035 | GAME( 1980, phoenixb, phoenix, phoenix, phoenixa, 0, ROT90, "Amstar (Centuri license)", "Phoenix (Centuri, set 2)", GAME_SUPPORTS_SAVE ) |
| r3957 | r3958 | |
| 1048 | 1053 | GAME( 1981, pleiadce, pleiads, pleiads, pleiadce, 0, ROT90, "Tehkan (Centuri license)", "Pleiads (Centuri)", GAME_IMPERFECT_COLORS ) |
| 1049 | 1054 | GAME( 1981, capitol, pleiads, phoenix, capitol, 0, ROT90, "Universal Video Spiel", "Capitol", GAME_IMPERFECT_COLORS ) |
| 1050 | 1055 | |
| 1051 | GAME( 1982, survival, 0, survival, survival, | |
| 1056 | GAME( 1982, survival, 0, survival, survival, 0 |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | *****************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "sound/sn76496.h" |
| 13 | 14 | |
| 14 | 15 | WRITE8_HANDLER( markham_videoram_w ); |
| r3957 | r3958 | |
| 206 | 207 | MDRV_CPU_PROGRAM_MAP(readmem2,writemem2) |
| 207 | 208 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 208 | 209 | |
| 209 | MDRV_ | |
| 210 | MDRV_QUANTUM_TIME | |
| 210 | 211 | |
| 211 | 212 | /* video hardware */ |
| 212 | 213 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 76 | 76 | #if 0 |
| 77 | 77 | static WRITE8_HANDLER( flip_screen_w ) |
| 78 | 78 | { |
| 79 | flip_screen_set(data); | |
| 79 | flip_screen_set(space->machine, data); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static WRITE8_HANDLER( msisaac_coin_counter_w ) |
| r3957 | r3958 | |
|---|---|---|
| 107 | 107 | ***************************************************************************/ |
| 108 | 108 | |
| 109 | 109 | #include "driver.h" |
| 110 | #include "cpu/z80/z80.h" | |
| 110 | 111 | #include "deprecat.h" |
| 111 | 112 | #include "cpu/m6805/m6805.h" |
| 112 | 113 | #include "cpu/mcs51/mcs51.h" |
| r3957 | r3958 | |
| 242 | 243 | coin_lockout_global_w((data & 1) ^ invert_coin_lockout); |
| 243 | 244 | break; |
| 244 | 245 | case 4: |
| 245 | flip_screen_set(data & 1); | |
| 246 | flip_screen_set(space->machine, data & 1); | |
| 246 | 247 | break; |
| 247 | 248 | case 5: |
| 248 | 249 | port1 = data; |
| r3957 | r3958 | |
| 304 | 305 | |
| 305 | 306 | static WRITE8_HANDLER( bootleg_flipscreen_w ) |
| 306 | 307 | { |
| 307 | flip_screen_set(~data & 1); | |
| 308 | flip_screen_set(space->machine, ~data & 1); | |
| 308 | 309 | } |
| 309 | 310 | |
| 310 | 311 | |
| r3957 | r3958 | |
| 1060 | 1061 | MDRV_CPU_ADD("mcu", I8751, 12000000/3) /* ??? */ |
| 1061 | 1062 | MDRV_CPU_IO_MAP(mcu_io_map,0) |
| 1062 | 1063 | |
| 1063 | MDRV_ | |
| 1064 | MDRV_QUANTUM_TIME | |
| 1064 | 1065 | |
| 1065 | 1066 | MDRV_MACHINE_START(superqix) |
| 1066 | 1067 |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/z80/z80.h" | |
| 53 | 54 | #include "sound/ay8910.h" |
| 54 | 55 | |
| 55 | 56 | extern UINT8 *dday_bgvideoram; |
| r3957 | r3958 | |
|---|---|---|
| 290 | 290 | ***************************************************************************/ |
| 291 | 291 | |
| 292 | 292 | #include "driver.h" |
| 293 | #include "cpu/m6502/m6502.h" | |
| 293 | 294 | #include "video/ppu2c0x.h" |
| 294 | 295 | #include "cpu/z80/z80.h" |
| 295 | 296 | #include "machine/rp5h01.h" |
| r3957 | r3958 | |
|---|---|---|
| 289 | 289 | |
| 290 | 290 | |
| 291 | 291 | #include "driver.h" |
| 292 | #include "cpu/m68000/m68000.h" | |
| 292 | 293 | #include "cpu/mips/r3000.h" |
| 293 | 294 | #include "cpu/jaguar/jaguar.h" |
| 294 | 295 | #include "machine/idectrl.h" |
| r3957 | r3958 | |
| 372 | 373 | jaguardsp_ctrl_w(machine->cpu[2], D_CTRL, 0, 0xffffffff); |
| 373 | 374 | |
| 374 | 375 | /* init the sound system */ |
| 375 | cojag_sound_reset(); | |
| 376 | cojag_sound_reset(machine); | |
| 376 | 377 | |
| 377 | 378 | /* reset the IDE controller */ |
| 378 | 379 | devtag_reset(machine, IDE_CONTROLLER, "ide"); |
| r3957 | r3958 | |
| 1504 | 1505 | static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UINT16 spin_pc) |
| 1505 | 1506 | { |
| 1506 | 1507 | /* copy over the ROM */ |
| 1507 | cojag_is_r3000 = (machine->c | |
| 1508 | cojag_is_r3000 = (cpu_get_type(machine->c | |
| 1508 | 1509 | |
| 1509 | 1510 | /* install synchronization hooks for GPU */ |
| 1510 | 1511 | if (cojag_is_r3000) |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/m68000/m68000.h" | |
| 24 | #include "cpu/m6502/m6502.h" | |
| 23 | 25 | #include "rendlay.h" |
| 24 | 26 | #include "machine/atarigen.h" |
| 25 | 27 | #include "audio/atarijsa.h" |
| r3957 | r3958 | |
| 424 | 426 | MDRV_CPU_PROGRAM_MAP(sound_68k_map,0) |
| 425 | 427 | MDRV_CPU_PERIODIC_INT(cyberbal_sound_68k_irq_gen, 10000) |
| 426 | 428 | |
| 427 | MDRV_ | |
| 429 | MDRV_QUANTUM_TIME | |
| 428 | 430 | |
| 429 | 431 | MDRV_MACHINE_RESET(cyberbal) |
| 430 | 432 | MDRV_NVRAM_HANDLER(atarigen) |
| r3957 | r3958 | |
| 971 | 973 | static DRIVER_INIT( cyberbal ) |
| 972 | 974 | { |
| 973 | 975 | atarigen_eeprom_default = default_eeprom; |
| 974 | atarigen_slapstic_init(machine | |
| 976 | atarigen_slapstic_init(machine->cpu[0], 0x018000, 0, 0); | |
| 975 | 977 | } |
| 976 | 978 | |
| 977 | 979 | |
| 978 | 980 | static DRIVER_INIT( cyberbt ) |
| 979 | 981 | { |
| 980 | 982 | atarigen_eeprom_default = default_eeprom; |
| 981 | atarigen_slapstic_init(machine | |
| 983 | atarigen_slapstic_init(machine->cpu[0], 0x018000, 0, 116); | |
| 982 | 984 | } |
| 983 | 985 | |
| 984 | 986 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/z80/z80.h" | |
| 14 | #include "cpu/nec/nec.h" | |
| 13 | 15 | #include "sound/2203intf.h" |
| 14 | 16 | #include "sound/flt_vol.h" |
| 15 | 17 | #include "lockon.h" |
| r3957 | r3958 | |
| 471 | 473 | MDRV_CPU_PROGRAM_MAP(sound_prg, 0) |
| 472 | 474 | MDRV_CPU_IO_MAP(sound_io, 0) |
| 473 | 475 | |
| 474 | MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_NSEC(PERIOD_OF_555_ASTABLE_NSEC(10000, 4700, 10000e-12) * 4096)) | |
| 475 | MDRV_INTERLEAVE(10) | |
| 476 | MDRV_WATCHDOG_TIME_INIT(NSEC(PERIOD_OF_555_ASTABLE_NSEC(10000, 4700, 10000e-12) * 4096)) | |
| 477 | MDRV_QUANTUM_TIME(HZ(600)) | |
| 476 | 478 | |
| 477 | 479 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) |
| 478 | 480 |
| r3957 | r3958 | |
|---|---|---|
| 547 | 547 | ***************************************************************************/ |
| 548 | 548 | |
| 549 | 549 | #include "driver.h" |
| 550 | #include "cpu/m6809/m6809.h" | |
| 550 | 551 | #include "machine/namcoio.h" |
| 551 | 552 | #include "sound/dac.h" |
| 552 | 553 | #include "sound/namco.h" |
| r3957 | r3958 | |
| 702 | 703 | switch (offset & 0x0e) |
| 703 | 704 | { |
| 704 | 705 | case 0x00: /* INT ON 2 */ |
| 705 | cpu_interrupt_enable(1,bit); | |
| 706 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 706 | 707 | if (!bit) |
| 707 | 708 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 708 | 709 | break; |
| 709 | 710 | |
| 710 | 711 | case 0x02: /* INT ON */ |
| 711 | cpu_interrupt_enable(0,bit); | |
| 712 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 712 | 713 | if (!bit) |
| 713 | 714 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 714 | 715 | break; |
| r3957 | r3958 | |
| 744 | 745 | switch (offset & 0x0e) |
| 745 | 746 | { |
| 746 | 747 | case 0x00: |
| 747 | cpu_interrupt_enable(1,bit); | |
| 748 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 748 | 749 | if (!bit) |
| 749 | 750 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 750 | 751 | break; |
| 751 | 752 | |
| 752 | 753 | case 0x02: |
| 753 | cpu_interrupt_enable(0,bit); | |
| 754 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 754 | 755 | if (!bit) |
| 755 | 756 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 756 | 757 | break; |
| 757 | 758 | |
| 758 | 759 | case 0x04: |
| 759 | cpu_interrupt_enable(2,bit); | |
| 760 | cpu_interrupt_enable(space->machine->cpu[2],bit); | |
| 760 | 761 | if (!bit) |
| 761 | 762 | cpu_set_input_line(space->machine->cpu[2], 0, CLEAR_LINE); |
| 762 | 763 | break; |
| r3957 | r3958 | |
| 790 | 791 | switch (offset & 0x0e) |
| 791 | 792 | { |
| 792 | 793 | case 0x00: /* INT ON 2 */ |
| 793 | cpu_interrupt_enable(1,bit); | |
| 794 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 794 | 795 | if (!bit) |
| 795 | 796 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 796 | 797 | break; |
| 797 | 798 | |
| 798 | 799 | case 0x02: /* INT ON */ |
| 799 | cpu_interrupt_enable(0,bit); | |
| 800 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 800 | 801 | if (!bit) |
| 801 | 802 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 802 | 803 | break; |
| 803 | 804 | |
| 804 | 805 | case 0x04: /* FLIP */ |
| 805 | flip_screen_set(bit); | |
| 806 | flip_screen_set(space->machine, bit); | |
| 806 | 807 | break; |
| 807 | 808 | |
| 808 | 809 | case 0x06: /* SOUND ON */ |
| r3957 | r3958 | |
| 1583 | 1584 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 1584 | 1585 | |
| 1585 | 1586 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1586 | MDRV_ | |
| 1587 | MDRV_QUANTUM_TIME | |
| 1587 | 1588 | /* synchronization of the CPUs */ |
| 1588 | 1589 | MDRV_MACHINE_RESET(superpac) |
| 1589 | 1590 | |
| r3957 | r3958 | |
| 1634 | 1635 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 1635 | 1636 | |
| 1636 | 1637 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1637 | MDRV_ | |
| 1638 | MDRV_QUANTUM_TIME | |
| 1638 | 1639 | /* synchronization of the CPUs */ |
| 1639 | 1640 | MDRV_MACHINE_RESET(phozon) |
| 1640 | 1641 | |
| r3957 | r3958 | |
| 1671 | 1672 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 1672 | 1673 | |
| 1673 | 1674 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1674 | MDRV_ | |
| 1675 | MDRV_QUANTUM_TIME | |
| 1675 | 1676 | /* synchronization of the CPUs */ |
| 1676 | 1677 | MDRV_MACHINE_RESET(mappy) |
| 1677 | 1678 |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | ****************************************************************************/ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "cpu/i8085/i8085.h" | |
| 48 | 49 | |
| 49 | 50 | |
| 50 | 51 | static UINT8 *ram_1, *ram_2; |
| r3957 | r3958 | |
|---|---|---|
| 157 | 157 | ***************************************************************************/ |
| 158 | 158 | |
| 159 | 159 | #include "driver.h" |
| 160 | #include "cpu/z80/z80.h" | |
| 161 | #include "cpu/m68000/m68000.h" | |
| 160 | 162 | #include "taitoipt.h" |
| 161 | 163 | #include "video/taitoic.h" |
| 162 | 164 | #include "audio/taitosnd.h" |
| r3957 | r3958 | |
| 390 | 392 | MDRV_CPU_ADD("audio", Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 391 | 393 | MDRV_CPU_PROGRAM_MAP(rastan_s_map,0) |
| 392 | 394 | |
| 393 | MDRV_ | |
| 395 | MDRV_QUANTUM_TIME | |
| 394 | 396 | |
| 395 | 397 | /* video hardware */ |
| 396 | 398 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 121 | 121 | */ |
| 122 | 122 | |
| 123 | 123 | #include "driver.h" |
| 124 | #include "cpu/m68000/m68000.h" | |
| 124 | 125 | #include "machine/eeprom.h" |
| 125 | 126 | |
| 126 | 127 |
| r3957 | r3958 | |
|---|---|---|
| 37 | 37 | ***************************************************************************/ |
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | #include "cpu/m68000/m68000.h" | |
| 40 | 41 | #include "video/konamiic.h" |
| 41 | 42 | #include "cpu/z80/z80.h" |
| 42 | 43 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | 27 | #include "deprecat.h" |
| 28 | #include "cpu/z80/z80.h" | |
| 29 | #include "cpu/h6280/h6280.h" | |
| 30 | #include "sound/c6280.h" | |
| 28 | 31 | #include "machine/pcecommn.h" |
| 29 | 32 | #include "video/vdc.h" |
| 30 | #include "cpu/h6280/h6280.h" | |
| 31 | #include "sound/c6280.h" | |
| 32 | 33 | |
| 33 | 34 | static UINT8 jamma_if_control_latch = 0; |
| 34 | 35 | |
| r3957 | r3958 | |
| 96 | 97 | return dsw_val & 1; |
| 97 | 98 | } |
| 98 | 99 | |
| 99 | static UINT8 jamma_if_read_joystick( | |
| 100 | static UINT8 jamma_if_read_joystick( running_machine *machine ) | |
| 100 | 101 | { |
| 101 | 102 | if ( jamma_if_control_latch & 0x10 ) |
| 102 | 103 | { |
| 103 | return input_port_read( | |
| 104 | return input_port_read(machine, "JOY" ); | |
| 104 | 105 | } |
| 105 | 106 | else |
| 106 | 107 | { |
| 107 | return input_port_read( | |
| 108 | return input_port_read(machine, "JOY" ) | 0x08; | |
| 108 | 109 | } |
| 109 | 110 | } |
| 110 | 111 | |
| r3957 | r3958 | |
| 187 | 188 | MDRV_CPU_ADD("sub", Z80, 1400000) |
| 188 | 189 | MDRV_CPU_PROGRAM_MAP(z80_map, 0) |
| 189 | 190 | |
| 190 | MDRV_ | |
| 191 | MDRV_QUANTUM_TIME | |
| 191 | 192 | |
| 192 | 193 | MDRV_MACHINE_RESET( uapce ) |
| 193 | 194 |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/m68000/m68000.h" | |
| 23 | 24 | #include "cpu/z80/z80.h" |
| 24 | 25 | #include "sound/2203intf.h" |
| 25 | 26 | #include "sound/msm5205.h" |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | */ |
| 54 | 54 | |
| 55 | 55 | #include "driver.h" |
| 56 | #include "cpu/tms9900/tms9900.h" | |
| 56 | 57 | #include "sound/ay8910.h" |
| 57 | 58 | #include "sound/dac.h" |
| 58 | 59 | #include "sound/5220intf.h" |
| r3957 | r3958 | |
| 192 | 193 | static WRITE8_HANDLER( flip_screen_x_w ) |
| 193 | 194 | { |
| 194 | 195 | looping_state *state = space->machine->driver_data; |
| 195 | flip_screen_x_set(~data & 0x01); | |
| 196 | tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0); | |
| 196 | flip_screen_x_set(space->machine, ~data & 0x01); | |
| 197 | tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0); | |
| 197 | 198 | } |
| 198 | 199 | |
| 199 | 200 | |
| 200 | 201 | static WRITE8_HANDLER( flip_screen_y_w ) |
| 201 | 202 | { |
| 202 | 203 | looping_state *state = space->machine->driver_data; |
| 203 | flip_screen_y_set(~data & 0x01); | |
| 204 | tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0); | |
| 204 | flip_screen_y_set(space->machine, ~data & 0x01); | |
| 205 | tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0); | |
| 205 | 206 | } |
| 206 | 207 | |
| 207 | 208 | |
| r3957 | r3958 | |
| 256 | 257 | int code = source[1] & 0x3f; |
| 257 | 258 | int color = source[2]; |
| 258 | 259 | |
| 259 | if (flip_screen_x_get()) | |
| 260 | if (flip_screen_x_get(machine)) | |
| 260 | 261 | { |
| 261 | 262 | sx = 240 - sx; |
| 262 | 263 | flipx = !flipx; |
| 263 | 264 | } |
| 264 | 265 | |
| 265 | if (flip_screen_y_get()) | |
| 266 | if (flip_screen_y_get(machine)) | |
| 266 | 267 | { |
| 267 | 268 | sy = 240 - sy; |
| 268 | 269 | flipy = !flipy; |
| r3957 | r3958 | |
|---|---|---|
| 292 | 292 | ***************************************************************************/ |
| 293 | 293 | |
| 294 | 294 | #include "driver.h" |
| 295 | #include "cpu/z80/z80.h" | |
| 296 | #include "cpu/v60/v60.h" | |
| 297 | #include "cpu/nec/nec.h" | |
| 295 | 298 | #include "rendlay.h" |
| 296 | 299 | #include "segas32.h" |
| 297 | 300 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | 56 | #include "driver.h" |
| 57 | #include "cpu/m68000/m68000.h" | |
| 57 | 58 | #include "sound/okim6295.h" |
| 58 | 59 | |
| 59 | 60 | static UINT16* k3_spriteram_1; |
| r3957 | r3958 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | #include "driver.h" |
| 96 | #include "cpu/z80/z80.h" | |
| 97 | #include "cpu/m68000/m68000.h" | |
| 98 | #include "cpu/m6502/m6502.h" | |
| 96 | 99 | #include "machine/atarigen.h" |
| 97 | 100 | #include "badlands.h" |
| 98 | 101 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 399 | 399 | ***************************************************************************/ |
| 400 | 400 | |
| 401 | 401 | #include "driver.h" |
| 402 | #include "cpu/z80/z80.h" | |
| 402 | 403 | #include "deprecat.h" |
| 403 | 404 | #include "cpu/m6805/m6805.h" |
| 404 | 405 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 932 | 933 | MDRV_CPU_PROGRAM_MAP(perfrman_sound_readmem,perfrman_sound_writemem) |
| 933 | 934 | MDRV_CPU_VBLANK_INT_HACK(getstar_interrupt,4) /* music speed, verified */ |
| 934 | 935 | |
| 935 | MDRV_ | |
| 936 | MDRV_QUANTUM_TIME | |
| 936 | 937 | |
| 937 | 938 | MDRV_MACHINE_RESET(slapfight) |
| 938 | 939 | |
| r3957 | r3958 | |
| 979 | 980 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 980 | 981 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,6) /* ??? */ |
| 981 | 982 | |
| 982 | MDRV_ | |
| 983 | MDRV_QUANTUM_TIME | |
| 983 | 984 | |
| 984 | 985 | MDRV_MACHINE_RESET(slapfight) |
| 985 | 986 | |
| r3957 | r3958 | |
| 1028 | 1029 | MDRV_CPU_ADD("mcu", M68705,XTAL_36MHz/12) /* verified on pcb */ |
| 1029 | 1030 | MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| 1030 | 1031 | |
| 1031 | MDRV_ | |
| 1032 | MDRV_QUANTUM_TIME | |
| 1032 | 1033 | |
| 1033 | 1034 | MDRV_MACHINE_RESET(slapfight) |
| 1034 | 1035 | |
| r3957 | r3958 | |
| 1075 | 1076 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 1076 | 1077 | MDRV_CPU_VBLANK_INT_HACK(getstar_interrupt, 3) |
| 1077 | 1078 | |
| 1078 | MDRV_ | |
| 1079 | MDRV_QUANTUM_TIME | |
| 1079 | 1080 | |
| 1080 | 1081 | MDRV_MACHINE_RESET(slapfight) |
| 1081 | 1082 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "cpu/z80/z80.h" | |
| 20 | 21 | #include "machine/8255ppi.h" |
| 21 | 22 | #include "sound/samples.h" |
| 22 | 23 |
| r3957 | r3958 | |
|---|---|---|
| 1139 | 1139 | |
| 1140 | 1140 | static DRIVER_INIT( soldivid ) |
| 1141 | 1141 | { |
| 1142 | c | |
| 1142 | device | |
| 1143 | 1143 | use_factory_eeprom=eeprom_0; |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| 1146 | 1146 | static DRIVER_INIT( s1945ii ) |
| 1147 | 1147 | { |
| 1148 | c | |
| 1148 | device | |
| 1149 | 1149 | use_factory_eeprom=eeprom_DEFAULT; |
| 1150 | 1150 | } |
| 1151 | 1151 | |
| r3957 | r3958 | |
| 1153 | 1153 | { |
| 1154 | 1154 | UINT8 *RAM = memory_region(machine, "main"); |
| 1155 | 1155 | memory_set_bankptr(machine, 1,&RAM[0x100000]); |
| 1156 | c | |
| 1156 | device | |
| 1157 | 1157 | use_factory_eeprom=eeprom_DARAKU; |
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | 1160 | static DRIVER_INIT( sbomberb ) |
| 1161 | 1161 | { |
| 1162 | c | |
| 1162 | device | |
| 1163 | 1163 | use_factory_eeprom=eeprom_DEFAULT; |
| 1164 | 1164 | } |
| 1165 | 1165 | |
| r3957 | r3958 | |
| 1167 | 1167 | { |
| 1168 | 1168 | UINT8 *RAM = memory_region(machine, "main"); |
| 1169 | 1169 | memory_set_bankptr(machine, 1,&RAM[0x100000]); |
| 1170 | c | |
| 1170 | device | |
| 1171 | 1171 | use_factory_eeprom=eeprom_DEFAULT; |
| 1172 | 1172 | } |
| 1173 | 1173 | |
| r3957 | r3958 | |
| 1175 | 1175 | { |
| 1176 | 1176 | UINT8 *RAM = memory_region(machine, "main"); |
| 1177 | 1177 | memory_set_bankptr(machine, 1,&RAM[0x100000]); |
| 1178 | c | |
| 1178 | device | |
| 1179 | 1179 | use_factory_eeprom=eeprom_S1945III; |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | static DRIVER_INIT( dragnblz ) |
| 1183 | 1183 | { |
| 1184 | c | |
| 1184 | device | |
| 1185 | 1185 | use_factory_eeprom=eeprom_DRAGNBLZ; |
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | static DRIVER_INIT( gnbarich ) |
| 1189 | 1189 | { |
| 1190 | c | |
| 1190 | device | |
| 1191 | 1191 | use_factory_eeprom=eeprom_GNBARICH; |
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | 1194 | static DRIVER_INIT( mjgtaste ) |
| 1195 | 1195 | { |
| 1196 | c | |
| 1196 | device | |
| 1197 | 1197 | use_factory_eeprom=eeprom_MJGTASTE; |
| 1198 | 1198 | /* needs to install mahjong controls too (can select joystick in test mode tho) */ |
| 1199 | 1199 | } |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | *****************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "sound/2203intf.h" |
| 13 | 14 | #include "sound/okim6295.h" |
| 14 | 15 |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | #include "driver.h" |
| 99 | #include "cpu/tms9900/tms9900.h" | |
| 99 | 100 | #include "sound/ay8910.h" |
| 100 | 101 | |
| 101 | 102 |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | ***************************************************************************/ |
| 56 | 56 | |
| 57 | 57 | #include "driver.h" |
| 58 | #include "cpu/m68000/m68000.h" | |
| 58 | 59 | #include "deprecat.h" |
| 59 | 60 | #include "machine/eeprom.h" |
| 60 | 61 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "offtwall.h" |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | **********************************************************************************/ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/m68000/m68000.h" | |
| 27 | 28 | #include "includes/amiga.h" |
| 28 | 29 | #include "machine/6526cia.h" |
| 29 | 30 | |
| r3957 | r3958 | |
| 58 | 59 | * |
| 59 | 60 | *************************************/ |
| 60 | 61 | |
| 61 | static void upscope_reset( | |
| 62 | static void upscope_reset(running_machine *machine) | |
| 62 | 63 | { |
| 63 | 64 | prev_cia1_porta = 0xff; |
| 64 | 65 | } |
| r3957 | r3958 | |
| 289 | 290 | static const cia6526_interface cia_0_intf = |
| 290 | 291 | { |
| 291 | 292 | amiga_cia_0_irq, /* irq_func */ |
| 292 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 293 | 293 | 0, /* tod_clock */ |
| 294 | 294 | { |
| 295 | 295 | { NULL, upscope_cia_0_porta_w }, /* port A */ |
| r3957 | r3958 | |
| 300 | 300 | static const cia6526_interface cia_1_intf = |
| 301 | 301 | { |
| 302 | 302 | amiga_cia_1_irq, /* irq_func */ |
| 303 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 304 | 303 | 0, /* tod_clock */ |
| 305 | 304 | { |
| 306 | 305 | { upscope_cia_1_porta_r, upscope_cia_1_porta_w, }, /* port A */ |
| r3957 | r3958 | |
| 344 | 343 | MDRV_SOUND_ROUTE(3, "right", 0.50) |
| 345 | 344 | |
| 346 | 345 | /* cia */ |
| 347 | MDRV_DEVICE_ADD("cia_0", CIA8520) | |
| 348 | MDRV_DEVICE_CONFIG(cia_0_intf) | |
| 349 | MDRV_DEVICE_ADD("cia_1", CIA8520) | |
| 350 | MDRV_DEVICE_CONFIG(cia_1_intf) | |
| 346 | MDRV_CIA8520_ADD("cia_0", AMIGA_68000_NTSC_CLOCK / 10, cia_0_intf) | |
| 347 | MDRV_CIA8520_ADD("cia_1", AMIGA_68000_NTSC_CLOCK / 10, cia_1_intf) | |
| 351 | 348 | MACHINE_DRIVER_END |
| 352 | 349 | |
| 353 | 350 |
| r3957 | r3958 | |
|---|---|---|
| 364 | 364 | // Directives |
| 365 | 365 | |
| 366 | 366 | #include "driver.h" |
| 367 | #include "cpu/m68000/m68000.h" | |
| 368 | #include "cpu/alph8201/alph8201.h" | |
| 367 | 369 | #include "deprecat.h" |
| 368 | 370 | #include "cpu/i8085/i8085.h" |
| 369 | 371 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 396 | 398 | |
| 397 | 399 | static MACHINE_RESET(equites) |
| 398 | 400 | { |
| 399 | flip_screen_set(0); | |
| 401 | flip_screen_set(machine, 0); | |
| 400 | 402 | } |
| 401 | 403 | |
| 402 | 404 | /******************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "cpu/z80/z80.h" | |
| 26 | 27 | #include "machine/laserdsc.h" |
| 27 | 28 | |
| 28 | 29 | /* From daphne */ |
| r3957 | r3958 | |
|---|---|---|
| 7707 | 7707 | GAME( 2000, kof2000, neogeo, neogeo, neogeo, kof2000, ROT0, "SNK", "The King of Fighters 2000" , 0 ) /* Encrypted Code & GFX */ |
| 7708 | 7708 | GAME( 2000, kof2000n, kof2000, neogeo, neogeo, kof2000n, ROT0, "SNK", "The King of Fighters 2000 (not encrypted)" , 0 ) /* Encrypted GFX */ |
| 7709 | 7709 | GAME( 2001, zupapa, neogeo, neogeo, neogeo, zupapa, ROT0, "SNK", "Zupapa!" , 0 ) /* Encrypted GFX */ |
| 7710 | GAME( 2001, sengoku3, neogeo, neogeo, neogeo, sengoku3, ROT0, "SNK", "Sengoku 3" , 0 ) /* Encrypted GFX */ | |
| 7710 | GAME( 2001, sengoku3, neogeo, neogeo, neogeo, sengoku3, ROT0, "Noise Factory / SNK", "Sengoku 3" , 0 ) /* Encrypted GFX */ | |
| 7711 | 7711 | GAME( 2001, kof2001, neogeo, neogeo, neogeo, kof2001, ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 1)" , 0 ) /* Encrypted GFX */ |
| 7712 | 7712 | GAME( 2001, kof2001h, kof2001, neogeo, neogeo, kof2001, ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 2)" , 0 ) /* Encrypted GFX */ |
| 7713 | 7713 | GAME( 2003, cthd2003, kof2001, neogeo, neogeo, cthd2003, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */ |
| r3957 | r3958 | |
|---|---|---|
| 61 | 61 | */ |
| 62 | 62 | |
| 63 | 63 | #include "driver.h" |
| 64 | #include "cpu/z80/z80.h" | |
| 64 | 65 | #include "deprecat.h" |
| 65 | 66 | #include "sound/ay8910.h" |
| 66 | 67 |
| r3957 | r3958 | |
|---|---|---|
| 349 | 349 | MDRV_CPU_ADD("audio", Z80, 3579545) |
| 350 | 350 | MDRV_CPU_PROGRAM_MAP(gradius3_s_map,0) |
| 351 | 351 | |
| 352 | MDRV_ | |
| 352 | MDRV_QUANTUM_TIME | |
| 353 | 353 | |
| 354 | 354 | MDRV_MACHINE_RESET(gradius3) |
| 355 | 355 |
| r3957 | r3958 | |
|---|---|---|
| 217 | 217 | ***************************************************************************/ |
| 218 | 218 | |
| 219 | 219 | #include "driver.h" |
| 220 | #include "cpu/z80/z80.h" | |
| 220 | 221 | #include "video/vector.h" |
| 221 | 222 | #include "video/avgdvg.h" |
| 222 | 223 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | ***********************************************************************/ |
| 54 | 54 | |
| 55 | 55 | #include "driver.h" |
| 56 | #include "cpu/m6502/m6502.h" | |
| 57 | #include "cpu/i8x41/i8x41.h" | |
| 56 | 58 | #include "machine/decocass.h" |
| 57 | 59 | #include "sound/ay8910.h" |
| 58 | 60 | |
| r3957 | r3958 | |
| 388 | 390 | MDRV_CPU_ADD("mcu", I8041,500000*15) /* 500 kHz ( I doubt it is 400kHz Al! )*/ |
| 389 | 391 | MDRV_CPU_IO_MAP(decocass_mcu_portmap,0) |
| 390 | 392 | |
| 391 | MDRV_ | |
| 393 | MDRV_QUANTUM_TIME | |
| 392 | 394 | |
| 393 | 395 | MDRV_MACHINE_RESET(decocass) |
| 394 | 396 |
| r3957 | r3958 | |
|---|---|---|
| 942 | 942 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 943 | 943 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 480) |
| 944 | 944 | |
| 945 | MDRV_ | |
| 945 | MDRV_QUANTUM_TIME | |
| 946 | 946 | |
| 947 | 947 | MDRV_NVRAM_HANDLER(mystwarr) |
| 948 | 948 | MDRV_MACHINE_START(mystwarr) |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | *************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/z80/z80.h" | |
| 36 | 37 | #include "render.h" |
| 37 | 38 | #include "cpu/z80/z80daisy.h" |
| 38 | 39 | #include "machine/laserdsc.h" |
| r3957 | r3958 | |
| 106 | 107 | |
| 107 | 108 | static const z80ctc_interface ctc_intf = |
| 108 | 109 | { |
| 109 | "main", /* clock comes from main CPU's clock */ | |
| 110 | 0, /* clock (filled in from the CPU clock) */ | |
| 111 | 110 | 0, /* timer disables */ |
| 112 | 111 | dleuro_interrupt, /* interrupt handler */ |
| 113 | 112 | 0, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 118 | 117 | |
| 119 | 118 | static const z80sio_interface sio_intf = |
| 120 | 119 | { |
| 121 | "main", /* clock comes from main CPU's clock */ | |
| 122 | 0, /* clock (filled in from the CPU clock) */ | |
| 123 | 120 | dleuro_interrupt, /* interrupt handler */ |
| 124 | 121 | 0, /* DTR changed handler */ |
| 125 | 122 | 0, /* RTS changed handler */ |
| r3957 | r3958 | |
| 743 | 740 | MDRV_CPU_IO_MAP(dleuro_io_map,0) |
| 744 | 741 | MDRV_CPU_VBLANK_INT("main", vblank_callback) |
| 745 | 742 | |
| 746 | MDRV_Z80CTC_ADD("ctc", ctc_intf) | |
| 747 | MDRV_Z80SIO_ADD("sio", sio_intf) | |
| 743 | MDRV_Z80CTC_ADD("ctc", MASTER_CLOCK_EURO/4 /* same as "main" */, ctc_intf) | |
| 744 | MDRV_Z80SIO_ADD("sio", MASTER_CLOCK_EURO/4 /* same as "main" */, sio_intf) | |
| 748 | 745 | |
| 749 | MDRV_WATCHDOG_TIME_INIT( | |
| 746 | MDRV_WATCHDOG_TIME_INIT( | |
| 750 | 747 | |
| 751 | 748 | MDRV_MACHINE_START(dlair) |
| 752 | 749 | MDRV_MACHINE_RESET(dlair) |
| r3957 | r3958 | |
|---|---|---|
| 98 | 98 | */ |
| 99 | 99 | |
| 100 | 100 | #include "driver.h" |
| 101 | #include "cpu/z80/z80.h" | |
| 101 | 102 | #include "sound/ay8910.h" |
| 102 | 103 | |
| 103 | 104 | static tilemap *bg_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/m6809/m6809.h" | |
| 17 | 18 | #include "cpu/m6800/m6800.h" |
| 18 | 19 | #include "sound/namco.h" |
| 19 | 20 | |
| r3957 | r3958 | |
| 90 | 91 | static WRITE8_HANDLER( skykid_irq_1_ctrl_w ) |
| 91 | 92 | { |
| 92 | 93 | int bit = !BIT(offset,11); |
| 93 | cpu_interrupt_enable(0,bit); | |
| 94 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 94 | 95 | if (!bit) |
| 95 | 96 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 96 | 97 | } |
| r3957 | r3958 | |
| 98 | 99 | static WRITE8_HANDLER( skykid_irq_2_ctrl_w ) |
| 99 | 100 | { |
| 100 | 101 | int bit = !BIT(offset,13); |
| 101 | cpu_interrupt_enable(1,bit); | |
| 102 | cpu_interrupt_enable(space->machine->cpu[1],bit); | |
| 102 | 103 | if (!bit) |
| 103 | 104 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); |
| 104 | 105 | } |
| r3957 | r3958 | |
| 459 | 460 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 460 | 461 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert) |
| 461 | 462 | |
| 462 | MDRV_ | |
| 463 | MDRV_QUANTUM_TIME | |
| 463 | 464 | |
| 464 | 465 | MDRV_MACHINE_START(skykid) |
| 465 | 466 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "klax.h" |
| 23 | 24 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | /* CPU might not be z80 */ |
| 4 | 4 | |
| 5 | 5 | #include "driver.h" |
| 6 | #include "cpu/z80/z80.h" | |
| 6 | 7 | |
| 7 | 8 | #if 0 |
| 8 | 9 | static UINT16 *file1_data; |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | *************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "driver.h" |
| 36 | #include "cpu/m68000/m68000.h" | |
| 36 | 37 | #include "machine/nmk112.h" |
| 37 | 38 | #include "sound/okim6295.h" |
| 38 | 39 |
| r3957 | r3958 | |
|---|---|---|
| 158 | 158 | // Compiler Directives |
| 159 | 159 | |
| 160 | 160 | #include "driver.h" |
| 161 | #include "cpu/z80/z80.h" | |
| 161 | 162 | #include "taitoipt.h" |
| 162 | 163 | #include "deprecat.h" |
| 163 | 164 | #include "cpu/m6809/m6809.h" |
| r3957 | r3958 | |
|---|---|---|
| 121 | 121 | */ |
| 122 | 122 | |
| 123 | 123 | #include "driver.h" |
| 124 | #include "cpu/arm7/arm7.h" | |
| 124 | 125 | #include "cpu/arm7/arm7core.h" |
| 125 | 126 | |
| 126 | 127 | enum |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "cpu/m6800/m6800.h" | |
| 9 | 10 | #include "firetrk.h" |
| 10 | 11 | #include "sound/discrete.h" |
| 11 | 12 |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | ****************************************************************************/ |
| 49 | 49 | |
| 50 | 50 | #include "driver.h" |
| 51 | #include "cpu/z80/z80.h" | |
| 51 | 52 | #include "iremipt.h" |
| 52 | 53 | #include "m57.h" |
| 53 | 54 | #include "audio/irem.h" |
| r3957 | r3958 | |
|---|---|---|
| 217 | 217 | static const mc6845_interface mc6845_intf = |
| 218 | 218 | { |
| 219 | 219 | "main", /* screen we are acting on */ |
| 220 | MC6845_CLOCK, /* the clock (pin 21) of the chip */ | |
| 221 | 220 | 8, /* number of pixels per video memory address */ |
| 222 | 221 | NULL, /* before pixel update callback */ |
| 223 | 222 | NULL, /* row update callback */ |
| r3957 | r3958 | |
| 426 | 425 | |
| 427 | 426 | static WRITE8_HANDLER(i2c_nvram_w) |
| 428 | 427 | { |
| 429 | i2cmem_write(0, I2CMEM_SCL, BIT(data, 2)); | |
| 428 | i2cmem_write(space->machine, 0, I2CMEM_SCL, BIT(data, 2)); | |
| 430 | 429 | sda_dir = BIT(data, 1); |
| 431 | i2cmem_write(0, I2CMEM_SDA, BIT(data, 0)); | |
| 430 | i2cmem_write(space->machine, 0, I2CMEM_SDA, BIT(data, 0)); | |
| 432 | 431 | } |
| 433 | 432 | |
| 434 | 433 | |
| r3957 | r3958 | |
| 518 | 517 | UINT8 sda = 0; |
| 519 | 518 | if(!sda_dir) |
| 520 | 519 | { |
| 521 | sda = i2cmem_read(0, I2CMEM_SDA); | |
| 520 | sda = i2cmem_read(space->machine, 0, I2CMEM_SDA); | |
| 522 | 521 | } |
| 523 | 522 | |
| 524 | 523 | if ((input_port_read_safe(space->machine, "SENSOR",0x00) & 0x01) == 0x01 && coin_state == 0) { |
| r3957 | r3958 | |
| 1006 | 1005 | MDRV_GFXDECODE(peplus) |
| 1007 | 1006 | MDRV_PALETTE_LENGTH(16*16) |
| 1008 | 1007 | |
| 1009 | MDRV_DEVICE_ADD("crtc", R6545_1) | |
| 1010 | MDRV_DEVICE_CONFIG(mc6845_intf) | |
| 1008 | MDRV_MC6845_ADD("crtc", R6545_1, MC6845_CLOCK, mc6845_intf) | |
| 1011 | 1009 | |
| 1012 | 1010 | MDRV_PALETTE_INIT(peplus) |
| 1013 | 1011 | MDRV_VIDEO_START(peplus) |
| r3957 | r3958 | |
|---|---|---|
| 347 | 347 | |
| 348 | 348 | UINT16* s24_mainram1; |
| 349 | 349 | |
| 350 | extern void s24_fd1094_machine_init( | |
| 350 | extern void s24_fd1094_machine_init(running_machine *machine); | |
| 351 | 351 | extern void s24_fd1094_driver_init(running_machine *machine); |
| 352 | 352 | |
| 353 | 353 | VIDEO_START(system24); |
| r3957 | r3958 | |
| 697 | 697 | cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, PULSE_LINE); |
| 698 | 698 | // mame_printf_debug("enable 2nd cpu!\n"); |
| 699 | 699 | // debugger_break(machine); |
| 700 | s24_fd1094_machine_init(); | |
| 700 | s24_fd1094_machine_init(machine); | |
| 701 | 701 | |
| 702 | 702 | } else |
| 703 | 703 | cpu_set_input_line(machine->cpu[1], INPUT_LINE_HALT, ASSERT_LINE); |
| r3957 | r3958 | |
| 1812 | 1812 | MDRV_CPU_ADD("sub", M68000, MASTER_CLOCK/2) |
| 1813 | 1813 | MDRV_CPU_PROGRAM_MAP(system24_cpu2_map, 0) |
| 1814 | 1814 | |
| 1815 | MDRV_ | |
| 1815 | MDRV_QUANTUM_TIME | |
| 1816 | 1816 | |
| 1817 | 1817 | MDRV_MACHINE_START(system24) |
| 1818 | 1818 | MDRV_MACHINE_RESET(system24) |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | ***************************************************************************/ |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/z80/z80.h" | |
| 31 | 32 | #include "audio/seibu.h" // for seibu_sound_decrypt on the MAIN cpu (not sound) |
| 32 | 33 | #include "audio/t5182.h" |
| 33 | 34 |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/z80/z80.h" | |
| 55 | 56 | #include "sound/ay8910.h" |
| 56 | 57 | |
| 57 | 58 | static INT32 char_bank = 0; |
| r3957 | r3958 | |
| 408 | 409 | MDRV_CPU_PROGRAM_MAP(sound_cpu,0) |
| 409 | 410 | MDRV_CPU_VBLANK_INT("main", ddayjlc_snd_interrupt) |
| 410 | 411 | |
| 411 | MDRV_ | |
| 412 | MDRV_QUANTUM_TIME | |
| 412 | 413 | |
| 413 | 414 | /* video hardware */ |
| 414 | 415 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 144 | 144 | */ |
| 145 | 145 | |
| 146 | 146 | #include "driver.h" |
| 147 | #include "cpu/z80/z80.h" | |
| 148 | #include "cpu/m68000/m68000.h" | |
| 149 | #include "cpu/mcs51/mcs51.h" | |
| 147 | 150 | #include "system16.h" |
| 148 | 151 | #include "machine/8255ppi.h" |
| 149 | 152 | #include "machine/fd1089.h" |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | ****************************************************************************/ |
| 81 | 81 | |
| 82 | 82 | #include "driver.h" |
| 83 | #include "cpu/m68000/m68000.h" | |
| 83 | 84 | #include "neogeo.h" |
| 84 | 85 | #include "machine/pd4990a.h" |
| 85 | 86 | #include "cpu/z80/z80.h" |
| r3957 | r3958 | |
| 1011 | 1012 | /* reset system control registers */ |
| 1012 | 1013 | for (offs = 0; offs < 8; offs++) |
| 1013 | 1014 | system_control_w(space, offs, 0, 0x00ff); |
| 1014 | c | |
| 1015 | device | |
| 1015 | 1016 | |
| 1016 | 1017 | neogeo_reset_rng(); |
| 1017 | 1018 | |
| r3957 | r3958 | |
| 1234 | 1235 | MDRV_CPU_PROGRAM_MAP(audio_map,0) |
| 1235 | 1236 | MDRV_CPU_IO_MAP(auido_io_map,0) |
| 1236 | 1237 | |
| 1237 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1238 | MDRV_WATCHDOG_TIME_INIT(U | |
| 1238 | 1239 | |
| 1239 | 1240 | MDRV_MACHINE_START(neogeo) |
| 1240 | 1241 | MDRV_MACHINE_RESET(neogeo) |
| r3957 | r3958 | |
|---|---|---|
| 362 | 362 | #define MASTER_CLOCK XTAL_16MHz |
| 363 | 363 | |
| 364 | 364 | #include "driver.h" |
| 365 | #include "cpu/m6502/m6502.h" | |
| 365 | 366 | #include "sound/okim6295.h" |
| 366 | 367 | #include "snookr10.lh" |
| 367 | 368 |
| r3957 | r3958 | |
|---|---|---|
| 847 | 847 | |
| 848 | 848 | static READ32_HANDLER( adc0834_r ) |
| 849 | 849 | { |
| 850 | return adc083x_do_read( 0 ) << 24; | |
| 850 | return adc083x_do_read( space->machine, 0 ) << 24; | |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | static WRITE32_HANDLER( adc0834_w ) |
| 854 | 854 | { |
| 855 | adc083x_clk_write( 0, ( data >> 24 ) & 1 ); | |
| 856 | adc083x_di_write( 0, ( data >> 25 ) & 1 ); | |
| 857 | adc083x_cs_write( 0, ( data >> 26 ) & 1 ); | |
| 855 | running_machine *machine = space->machine; | |
| 856 | adc083x_clk_write( machine, 0, ( data >> 24 ) & 1 ); | |
| 857 | adc083x_di_write( machine, 0, ( data >> 25 ) & 1 ); | |
| 858 | adc083x_cs_write( machine, 0, ( data >> 26 ) & 1 ); | |
| 858 | 859 | } |
| 859 | 860 | |
| 860 | static double adc0834_callback( int input ) | |
| 861 | static double adc0834_callback( running_machine *machine, int input ) | |
| 861 | 862 | { |
| 862 | 863 | switch( input ) |
| 863 | 864 | { |
| 864 | 865 | case ADC083X_CH0: |
| 865 | return ( (double)5 * input_port_read( | |
| 866 | return ( (double)5 * input_port_read(machine, "AN0" ) ) / 255; // steer | |
| 866 | 867 | case ADC083X_CH1: |
| 867 | return ( (double)5 * input_port_read( | |
| 868 | return ( (double)5 * input_port_read(machine, "AN1" ) ) / 255; // gas | |
| 868 | 869 | case ADC083X_VREF: |
| 869 | 870 | return 5; |
| 870 | 871 | } |
| r3957 | r3958 | |
| 1309 | 1310 | MDRV_CPU_PROGRAM_MAP(gxsndmap, 0) |
| 1310 | 1311 | MDRV_CPU_PERIODIC_INT(irq2_line_hold, 480) |
| 1311 | 1312 | |
| 1312 | MDRV_ | |
| 1313 | MDRV_QUANTUM_TIME | |
| 1313 | 1314 | |
| 1314 | 1315 | MDRV_MACHINE_START(konamigx) |
| 1315 | 1316 | MDRV_MACHINE_RESET(konamigx) |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/z80/z80.h" | |
| 18 | #include "cpu/mcs51/mcs51.h" | |
| 17 | 19 | #include "deprecat.h" |
| 18 | 20 | #include "system16.h" |
| 19 | 21 | #include "machine/segaic16.h" |
| r3957 | r3958 | |
| 880 | 882 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 881 | 883 | |
| 882 | 884 | MDRV_MACHINE_RESET(hangon) |
| 883 | MDRV_ | |
| 885 | MDRV_QUANTUM_TIME | |
| 884 | 886 | |
| 885 | 887 | MDRV_PPI8255_ADD( "ppi8255_0", hangon_ppi_intf[0] ) |
| 886 | 888 | MDRV_PPI8255_ADD( "ppi8255_1", hangon_ppi_intf[1] ) |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | */ |
| 56 | 56 | |
| 57 | 57 | #include "driver.h" |
| 58 | #include "cpu/z80/z80.h" | |
| 58 | 59 | #include "deprecat.h" |
| 59 | 60 | #include "sound/sn76496.h" |
| 60 | 61 |
| r3957 | r3958 | |
|---|---|---|
| 620 | 620 | |
| 621 | 621 | static INTERRUPT_GEN( statriv2_interrupt ) |
| 622 | 622 | { |
| 623 | cpu_set_input_line(device, I8085_RST75_LINE, HOLD_LINE); | |
| 623 | cpu_set_input_line(device, I8085_RST75_LINE, ASSERT_LINE); | |
| 624 | cpu_set_input_line(device, I8085_RST75_LINE, CLEAR_LINE); | |
| 624 | 625 | } |
| 625 | 626 | |
| 626 | 627 | static MACHINE_DRIVER_START( statriv2 ) |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | #define MASTER_CLOCK 22118400 |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/z80/z80.h" | |
| 45 | 46 | #include "sound/ay8910.h" |
| 46 | 47 | #include "video/mc6845.h" |
| 47 | 48 | |
| r3957 | r3958 | |
| 304 | 305 | |
| 305 | 306 | MDRV_VIDEO_UPDATE(carrera) |
| 306 | 307 | |
| 307 | MDRV_ | |
| 308 | MDRV_M | |
| 308 | 309 | |
| 309 | 310 | /* sound hardware */ |
| 310 | 311 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "deprecat.h" |
| 13 | 14 | |
| 14 | 15 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "audio/atarijsa.h" |
| 23 | 24 | #include "thunderj.h" |
| r3957 | r3958 | |
| 324 | 325 | |
| 325 | 326 | MDRV_MACHINE_RESET(thunderj) |
| 326 | 327 | MDRV_NVRAM_HANDLER(atarigen) |
| 327 | MDRV_ | |
| 328 | MDRV_QUANTUM_TIME | |
| 328 | 329 | |
| 329 | 330 | /* video hardware */ |
| 330 | 331 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r3957 | r3958 | |
|---|---|---|
| 253 | 253 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 254 | 254 | MDRV_CPU_IO_MAP(sound_io_map,0) |
| 255 | 255 | |
| 256 | MDRV_ | |
| 256 | MDRV_QUANTUM_TIME | |
| 257 | 257 | |
| 258 | 258 | /* video hardware */ |
| 259 | 259 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 11 | 12 | #include "video/konamiic.h" |
| 12 | 13 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | */ |
| 60 | 60 | |
| 61 | 61 | #include "driver.h" |
| 62 | #include "cpu/z80/z80.h" | |
| 62 | 63 | #include "sound/sn76496.h" |
| 63 | 64 | |
| 64 | 65 |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | ***************************************************************************/ |
| 45 | 45 | |
| 46 | 46 | #include "driver.h" |
| 47 | #include "cpu/m68000/m68000.h" | |
| 47 | 48 | #include "video/vector.h" |
| 48 | 49 | #include "video/avgdvg.h" |
| 49 | 50 | #include "sound/pokey.h" |
| r3957 | r3958 | |
|---|---|---|
| 122 | 122 | ***************************************************************************/ |
| 123 | 123 | |
| 124 | 124 | #include "driver.h" |
| 125 | #include "cpu/hd6309/hd6309.h" | |
| 125 | 126 | #include "cpu/z80/z80.h" |
| 126 | 127 | #include "sound/2203intf.h" |
| 127 | 128 | #include "sound/upd7759.h" |
| r3957 | r3958 | |
| 582 | 583 | MDRV_CPU_ADD("audio", Z80,3579545) /* 3.579545 MHz */ |
| 583 | 584 | MDRV_CPU_PROGRAM_MAP(combasc_readmem_sound,combasc_writemem_sound) |
| 584 | 585 | |
| 585 | MDRV_ | |
| 586 | MDRV_QUANTUM_TIME | |
| 586 | 587 | |
| 587 | 588 | MDRV_MACHINE_RESET(combasc) |
| 588 | 589 | |
| r3957 | r3958 | |
| 623 | 624 | MDRV_CPU_ADD("audio", Z80,3579545) /* 3.579545 MHz */ |
| 624 | 625 | MDRV_CPU_PROGRAM_MAP(combasc_readmem_sound,combasc_writemem_sound) /* FAKE */ |
| 625 | 626 | |
| 626 | MDRV_ | |
| 627 | MDRV_QUANTUM_TIME | |
| 627 | 628 | |
| 628 | 629 | MDRV_MACHINE_RESET(combasc) |
| 629 | 630 |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | ***************************************************************************/ |
| 40 | 40 | |
| 41 | 41 | #include "driver.h" |
| 42 | #include "cpu/z80/z80.h" | |
| 42 | 43 | #include "sound/2203intf.h" |
| 43 | 44 | |
| 44 | 45 | #define VERBOSE_PROTECTION_LOG 0 |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | void install_stvbios_speedups(running_machine *machine) |
| 120 | 120 | { |
| 121 | 121 | // flushes 0 & 1 on both CPUs are for the BIOS speedups |
| 122 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 123 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); | |
| 124 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 125 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); | |
| 122 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 123 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); | |
| 124 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 125 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); | |
| 126 | 126 | |
| 127 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 128 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); | |
| 129 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 130 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); | |
| 127 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); | |
| 128 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); | |
| 129 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); | |
| 130 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | DRIVER_INIT(shienryu) |
| r3957 | r3958 | |
| 136 | 136 | stv_default_eeprom_length = sizeof(shienryu_default_eeprom); |
| 137 | 137 | |
| 138 | 138 | // master |
| 139 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 140 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c6); | |
| 139 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 140 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c6); | |
| 141 | 141 | // slave |
| 142 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 143 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600440e); | |
| 142 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 143 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600440e); | |
| 144 | 144 | |
| 145 | 145 | DRIVER_INIT_CALL(stv); |
| 146 | 146 | } |
| r3957 | r3958 | |
| 155 | 155 | (loops for 263473 instructions) |
| 156 | 156 | */ |
| 157 | 157 | // master |
| 158 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 159 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018640); | |
| 158 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 159 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018640); | |
| 160 | 160 | // slave |
| 161 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 162 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018c6e); | |
| 161 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 162 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018c6e); | |
| 163 | 163 | |
| 164 | 164 | DRIVER_INIT_CALL(stv); |
| 165 | 165 | |
| r3957 | r3958 | |
| 187 | 187 | |
| 188 | 188 | (loops for 288688 instructions) |
| 189 | 189 | */ |
| 190 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 191 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6010160); | |
| 190 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 191 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6010160); | |
| 192 | 192 | |
| 193 | 193 | DRIVER_INIT_CALL(stv); |
| 194 | 194 | } |
| r3957 | r3958 | |
| 214 | 214 | |
| 215 | 215 | DRIVER_INIT(puyosun) |
| 216 | 216 | { |
| 217 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 218 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6021cf0); | |
| 217 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 218 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6021cf0); | |
| 219 | 219 | |
| 220 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 221 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60236fe); | |
| 220 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 221 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60236fe); | |
| 222 | 222 | |
| 223 | 223 | DRIVER_INIT_CALL(stv); |
| 224 | 224 | |
| r3957 | r3958 | |
| 238 | 238 | |
| 239 | 239 | DRIVER_INIT(mausuke) |
| 240 | 240 | { |
| 241 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 242 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60461A0); | |
| 241 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 242 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60461A0); | |
| 243 | 243 | |
| 244 | 244 | DRIVER_INIT_CALL(stv); |
| 245 | 245 | |
| r3957 | r3958 | |
| 249 | 249 | |
| 250 | 250 | DRIVER_INIT(cottonbm) |
| 251 | 251 | { |
| 252 | // cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 253 | // cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6030ee2); | |
| 254 | // cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 255 | // cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6032b52); | |
| 252 | // device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 253 | // device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6030ee2); | |
| 254 | // device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 255 | // device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6032b52); | |
| 256 | 256 | |
| 257 | 257 | DRIVER_INIT_CALL(stv); |
| 258 | 258 | |
| r3957 | r3958 | |
| 261 | 261 | |
| 262 | 262 | DRIVER_INIT(cotton2) |
| 263 | 263 | { |
| 264 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 265 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6031c7a); | |
| 266 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 267 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60338ea); | |
| 264 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 265 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6031c7a); | |
| 266 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 267 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60338ea); | |
| 268 | 268 | |
| 269 | 269 | DRIVER_INIT_CALL(stv); |
| 270 | 270 | |
| r3957 | r3958 | |
| 274 | 274 | DRIVER_INIT(dnmtdeka) |
| 275 | 275 | { |
| 276 | 276 | // install all 3 speedups on both master and slave |
| 277 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 278 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); | |
| 279 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 280 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 281 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 282 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 277 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 278 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); | |
| 279 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 280 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 281 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 282 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 283 | 283 | |
| 284 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 285 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); | |
| 286 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 287 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 288 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 289 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 284 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 285 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); | |
| 286 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 287 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 288 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 289 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 290 | 290 | |
| 291 | 291 | DRIVER_INIT_CALL(stv); |
| 292 | 292 | } |
| r3957 | r3958 | |
| 294 | 294 | DRIVER_INIT(diehard) |
| 295 | 295 | { |
| 296 | 296 | // install all 3 speedups on both master and slave |
| 297 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 298 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); | |
| 299 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 300 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 301 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 302 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 297 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 298 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); | |
| 299 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 300 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 301 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 302 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 303 | 303 | |
| 304 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 305 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); | |
| 306 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 307 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 308 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 309 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 304 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 305 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); | |
| 306 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 307 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); | |
| 308 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 309 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); | |
| 310 | 310 | |
| 311 | 311 | DRIVER_INIT_CALL(stv); |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | DRIVER_INIT(fhboxers) |
| 315 | 315 | { |
| 316 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 317 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c2); | |
| 318 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 319 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600bb0a); | |
| 320 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 321 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600b31e); | |
| 316 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 317 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c2); | |
| 318 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 319 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600bb0a); | |
| 320 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 321 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600b31e); | |
| 322 | 322 | |
| 323 | 323 | DRIVER_INIT_CALL(stv); |
| 324 | 324 | } |
| r3957 | r3958 | |
| 342 | 342 | |
| 343 | 343 | DRIVER_INIT( groovef ) |
| 344 | 344 | { |
| 345 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 346 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e7c); | |
| 347 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 348 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e86); | |
| 349 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 350 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60a4970); | |
| 345 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 346 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e7c); | |
| 347 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 348 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e86); | |
| 349 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); | |
| 350 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60a4970); | |
| 351 | 351 | |
| 352 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 353 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60060c2); | |
| 352 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 353 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60060c2); | |
| 354 | 354 | |
| 355 | 355 | /* prevent game from hanging on startup -- todo: remove these hacks */ |
| 356 | 356 | memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x60ca6cc, 0x60ca6cf, 0, 0, groovef_hack2_r ); |
| r3957 | r3958 | |
| 399 | 399 | |
| 400 | 400 | DRIVER_INIT( danchih ) |
| 401 | 401 | { |
| 402 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 403 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028b28); | |
| 404 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 405 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028c8e); | |
| 406 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 407 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602ae26); | |
| 402 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 403 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028b28); | |
| 404 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 405 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028c8e); | |
| 406 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 407 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602ae26); | |
| 408 | 408 | |
| 409 | 409 | /* prevent game from hanging on title screen -- todo: remove these hacks */ |
| 410 | 410 | memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x60ffcbc, 0x60ffcbf, 0, 0, danchih_hack_r ); |
| r3957 | r3958 | |
| 445 | 445 | |
| 446 | 446 | DRIVER_INIT( astrass ) |
| 447 | 447 | { |
| 448 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 449 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60011b8); | |
| 450 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 451 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605b9da); | |
| 448 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 449 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60011b8); | |
| 450 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 451 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605b9da); | |
| 452 | 452 | |
| 453 | 453 | memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x06000770, 0x06000773, 0, 0, astrass_hack_r ); |
| 454 | 454 | |
| r3957 | r3958 | |
| 459 | 459 | |
| 460 | 460 | DRIVER_INIT(thunt) |
| 461 | 461 | { |
| 462 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 463 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602A024); | |
| 464 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 465 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013EEA); | |
| 466 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 467 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602AAF8); | |
| 462 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 463 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602A024); | |
| 464 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 465 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013EEA); | |
| 466 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 467 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602AAF8); | |
| 468 | 468 | |
| 469 | 469 | DRIVER_INIT_CALL(stv); |
| 470 | 470 | |
| r3957 | r3958 | |
| 473 | 473 | |
| 474 | 474 | DRIVER_INIT(sandor) |
| 475 | 475 | { |
| 476 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 477 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602a0f8); | |
| 478 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 479 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013fbe); | |
| 480 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 481 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602abcc); | |
| 476 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 477 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602a0f8); | |
| 478 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); | |
| 479 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013fbe); | |
| 480 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 481 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602abcc); | |
| 482 | 482 | |
| 483 | 483 | DRIVER_INIT_CALL(stv); |
| 484 | 484 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1); |
| r3957 | r3958 | |
| 487 | 487 | |
| 488 | 488 | DRIVER_INIT(grdforce) |
| 489 | 489 | { |
| 490 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 491 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6041e32); | |
| 492 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 493 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6043aa2); | |
| 490 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 491 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6041e32); | |
| 492 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 493 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6043aa2); | |
| 494 | 494 | |
| 495 | 495 | DRIVER_INIT_CALL(stv); |
| 496 | 496 | |
| r3957 | r3958 | |
| 499 | 499 | |
| 500 | 500 | DRIVER_INIT(batmanfr) |
| 501 | 501 | { |
| 502 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 503 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60121c0); | |
| 504 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 505 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60125bc); | |
| 502 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 503 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60121c0); | |
| 504 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 505 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60125bc); | |
| 506 | 506 | |
| 507 | 507 | DRIVER_INIT_CALL(stv); |
| 508 | 508 | |
| r3957 | r3958 | |
| 512 | 512 | |
| 513 | 513 | DRIVER_INIT(colmns97) |
| 514 | 514 | { |
| 515 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 516 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60298a2); | |
| 515 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 516 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60298a2); | |
| 517 | 517 | |
| 518 | 518 | DRIVER_INIT_CALL(stv); |
| 519 | 519 | |
| r3957 | r3958 | |
| 523 | 523 | |
| 524 | 524 | DRIVER_INIT(winterht) |
| 525 | 525 | { |
| 526 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 527 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6098aea); | |
| 528 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 529 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x609ae4e); | |
| 526 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 527 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6098aea); | |
| 528 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 529 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x609ae4e); | |
| 530 | 530 | |
| 531 | 531 | DRIVER_INIT_CALL(stv); |
| 532 | 532 | |
| r3957 | r3958 | |
| 535 | 535 | |
| 536 | 536 | DRIVER_INIT(seabass) |
| 537 | 537 | { |
| 538 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 539 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602cbfa); | |
| 540 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 541 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60321ee); | |
| 538 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 539 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602cbfa); | |
| 540 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 541 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60321ee); | |
| 542 | 542 | |
| 543 | 543 | DRIVER_INIT_CALL(stv); |
| 544 | 544 | |
| r3957 | r3958 | |
| 547 | 547 | |
| 548 | 548 | DRIVER_INIT(vfremix) |
| 549 | 549 | { |
| 550 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 551 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602c30c); | |
| 552 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 553 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604c332); | |
| 550 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 551 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602c30c); | |
| 552 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 553 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604c332); | |
| 554 | 554 | |
| 555 | 555 | DRIVER_INIT_CALL(stv); |
| 556 | 556 | |
| r3957 | r3958 | |
| 559 | 559 | |
| 560 | 560 | DRIVER_INIT(sss) |
| 561 | 561 | { |
| 562 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 563 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6026398); | |
| 564 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 565 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028cd6); | |
| 562 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 563 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6026398); | |
| 564 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 565 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028cd6); | |
| 566 | 566 | |
| 567 | 567 | install_standard_protection(machine); |
| 568 | 568 | |
| r3957 | r3958 | |
| 573 | 573 | |
| 574 | 574 | DRIVER_INIT(othellos) |
| 575 | 575 | { |
| 576 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 577 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602bcbe); | |
| 578 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 579 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602d92e); | |
| 576 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 577 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602bcbe); | |
| 578 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 579 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602d92e); | |
| 580 | 580 | |
| 581 | 581 | DRIVER_INIT_CALL(stv); |
| 582 | 582 | |
| r3957 | r3958 | |
| 586 | 586 | |
| 587 | 587 | DRIVER_INIT(sasissu) |
| 588 | 588 | { |
| 589 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 590 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60710be); | |
| 589 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 590 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60710be); | |
| 591 | 591 | |
| 592 | 592 | DRIVER_INIT_CALL(stv); |
| 593 | 593 | |
| r3957 | r3958 | |
| 596 | 596 | |
| 597 | 597 | DRIVER_INIT(gaxeduel) |
| 598 | 598 | { |
| 599 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 600 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ee4); | |
| 599 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 600 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ee4); | |
| 601 | 601 | |
| 602 | 602 | DRIVER_INIT_CALL(stv); |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | DRIVER_INIT(suikoenb) |
| 606 | 606 | { |
| 607 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 608 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013f7a); | |
| 607 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 608 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013f7a); | |
| 609 | 609 | |
| 610 | 610 | DRIVER_INIT_CALL(stv); |
| 611 | 611 | } |
| r3957 | r3958 | |
| 620 | 620 | |
| 621 | 621 | DRIVER_INIT(znpwfv) |
| 622 | 622 | { |
| 623 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 624 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ec2); | |
| 625 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 626 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60175a6); | |
| 623 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 624 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ec2); | |
| 625 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 626 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60175a6); | |
| 627 | 627 | |
| 628 | 628 | DRIVER_INIT_CALL(stv); |
| 629 | 629 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_NSEC(500); |
| r3957 | r3958 | |
| 631 | 631 | |
| 632 | 632 | DRIVER_INIT(twcup98) |
| 633 | 633 | { |
| 634 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 635 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605edde); | |
| 636 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 637 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); | |
| 634 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 635 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605edde); | |
| 636 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 637 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); | |
| 638 | 638 | |
| 639 | 639 | DRIVER_INIT_CALL(stv); |
| 640 | 640 | install_standard_protection(machine); |
| r3957 | r3958 | |
| 644 | 644 | |
| 645 | 645 | DRIVER_INIT(smleague) |
| 646 | 646 | { |
| 647 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 648 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6063bf4); | |
| 649 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 650 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); | |
| 647 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 648 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6063bf4); | |
| 649 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 650 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); | |
| 651 | 651 | |
| 652 | 652 | DRIVER_INIT_CALL(stv); |
| 653 | 653 | |
| r3957 | r3958 | |
| 656 | 656 | |
| 657 | 657 | DRIVER_INIT(finlarch) |
| 658 | 658 | { |
| 659 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 660 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6064d60); | |
| 659 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 660 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6064d60); | |
| 661 | 661 | |
| 662 | 662 | DRIVER_INIT_CALL(stv); |
| 663 | 663 | |
| r3957 | r3958 | |
| 665 | 665 | |
| 666 | 666 | DRIVER_INIT(maruchan) |
| 667 | 667 | { |
| 668 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 669 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); | |
| 670 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 671 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); | |
| 668 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 669 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); | |
| 670 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 671 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); | |
| 672 | 672 | |
| 673 | 673 | DRIVER_INIT_CALL(stv); |
| 674 | 674 | |
| r3957 | r3958 | |
| 677 | 677 | |
| 678 | 678 | DRIVER_INIT(pblbeach) |
| 679 | 679 | { |
| 680 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 681 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605eb78); | |
| 680 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 681 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605eb78); | |
| 682 | 682 | |
| 683 | 683 | DRIVER_INIT_CALL(stv); |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | DRIVER_INIT(shanhigw) |
| 687 | 687 | { |
| 688 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 689 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6020c5c); | |
| 688 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 689 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6020c5c); | |
| 690 | 690 | |
| 691 | 691 | DRIVER_INIT_CALL(stv); |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | DRIVER_INIT(elandore) |
| 695 | 695 | { |
| 696 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 697 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604eac0); | |
| 698 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 699 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605340a); | |
| 696 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 697 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604eac0); | |
| 698 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 699 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605340a); | |
| 700 | 700 | |
| 701 | 701 | install_standard_protection(machine); |
| 702 | 702 | |
| r3957 | r3958 | |
| 707 | 707 | |
| 708 | 708 | DRIVER_INIT(rsgun) |
| 709 | 709 | { |
| 710 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 711 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6034d04); | |
| 712 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 713 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6036152); | |
| 710 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 711 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6034d04); | |
| 712 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 713 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6036152); | |
| 714 | 714 | |
| 715 | 715 | install_standard_protection(machine); |
| 716 | 716 | |
| r3957 | r3958 | |
| 734 | 734 | |
| 735 | 735 | DRIVER_INIT(nameclv3) |
| 736 | 736 | { |
| 737 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 738 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601eb4c); | |
| 739 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 740 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602b80e); | |
| 737 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 738 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601eb4c); | |
| 739 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); | |
| 740 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602b80e); | |
| 741 | 741 | |
| 742 | 742 | DRIVER_INIT_CALL(stv); |
| 743 | 743 | } |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | */ |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/nec/nec.h" | |
| 45 | 46 | |
| 46 | 47 | static UINT16 *peno_vram; |
| 47 | 48 |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | */ |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/z80/z80.h" | |
| 45 | 46 | #include "sound/okim6295.h" |
| 46 | 47 | |
| 47 | 48 | static UINT8 *egghunt_bgram; |
| r3957 | r3958 | |
|---|---|---|
| 58 | 58 | ***************************************************************************/ |
| 59 | 59 | |
| 60 | 60 | #include "driver.h" |
| 61 | #include "cpu/z80/z80.h" | |
| 62 | #include "cpu/m68000/m68000.h" | |
| 61 | 63 | #include "sound/2151intf.h" |
| 62 | 64 | #include "sound/okim6295.h" |
| 63 | 65 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/m6502/m6502.h" | |
| 11 | 12 | #include "includes/starshp1.h" |
| 12 | 13 | |
| 13 | 14 | int starshp1_attract; |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "cpu/m68000/m68000.h" | |
| 16 | 17 | #include "sound/okim6295.h" |
| 17 | 18 | |
| 18 | 19 | /* |
| r3957 | r3958 | |
|---|---|---|
| 392 | 392 | MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem) |
| 393 | 393 | MDRV_CPU_IO_MAP(i8039_io_map,0) |
| 394 | 394 | |
| 395 | MDRV_ | |
| 395 | MDRV_QUANTUM_TIME | |
| 396 | 396 | |
| 397 | 397 | MDRV_MACHINE_RESET(pandoras) |
| 398 | 398 |
| r3957 | r3958 | |
|---|---|---|
| 293 | 293 | ***************************************************************************/ |
| 294 | 294 | |
| 295 | 295 | #include "driver.h" |
| 296 | #include "cpu/z80/z80.h" | |
| 296 | 297 | #include "taitoipt.h" |
| 297 | 298 | #include "cpu/m68000/m68000.h" |
| 298 | 299 | #include "video/taitoic.h" |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | ***************************************************************************/ |
| 67 | 67 | |
| 68 | 68 | #include "driver.h" |
| 69 | #include "cpu/z80/z80.h" | |
| 69 | 70 | #include "deprecat.h" |
| 70 | 71 | #include "sound/sn76496.h" |
| 71 | 72 | |
| r3957 | r3958 | |
| 119 | 120 | nmi_enable = data & 0x01; |
| 120 | 121 | irq_enable = data & 0x04; |
| 121 | 122 | |
| 122 | flip_screen_set(data & 0x08); | |
| 123 | flip_screen_set(space->machine, data & 0x08); | |
| 123 | 124 | } |
| 124 | 125 | |
| 125 | 126 | static WRITE8_HANDLER( mrgoemon_coin_counter_w ) |
| r3957 | r3958 | |
| 140 | 141 | nmi_enable = data & 0x01; |
| 141 | 142 | irq_enable = data & 0x02; |
| 142 | 143 | |
| 143 | flip_screen_set(data & 0x08); | |
| 144 | flip_screen_set(space->machine, data & 0x08); | |
| 144 | 145 | } |
| 145 | 146 | |
| 146 | 147 | /* Memory Maps */ |
| r3957 | r3958 | |
|---|---|---|
| 229 | 229 | *****************************************************************************/ |
| 230 | 230 | |
| 231 | 231 | #include "driver.h" |
| 232 | #include "cpu/z80/z80.h" | |
| 232 | 233 | #include "sound/2203intf.h" |
| 233 | 234 | #include "sound/msm5205.h" |
| 234 | 235 | #include "includes/stfight.h" |
| r3957 | r3958 | |
| 462 | 463 | MDRV_CPU_PROGRAM_MAP(readmem_cpu2,writemem_cpu2) |
| 463 | 464 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,120) |
| 464 | 465 | |
| 465 | MDRV_ | |
| 466 | MDRV_QUANTUM_TIME | |
| 466 | 467 | |
| 467 | 468 | MDRV_MACHINE_RESET(stfight) |
| 468 | 469 |
| r3957 | r3958 | |
|---|---|---|
| 177 | 177 | ***************************************************************************/ |
| 178 | 178 | |
| 179 | 179 | #include "driver.h" |
| 180 | #include "cpu/i86/i86.h" | |
| 180 | 181 | #include "machine/6532riot.h" |
| 181 | 182 | #include "machine/laserdsc.h" |
| 182 | 183 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 71 | 71 | */ |
| 72 | 72 | |
| 73 | 73 | #include "driver.h" |
| 74 | #include "cpu/z80/z80.h" | |
| 75 | #include "cpu/m68000/m68000.h" | |
| 74 | 76 | #include "machine/eeprom.h" |
| 75 | 77 | #include "includes/kaneko16.h" |
| 76 | 78 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 441 | 443 | MDRV_CPU_PROGRAM_MAP(sandscrp_soundmem,0) |
| 442 | 444 | MDRV_CPU_IO_MAP(sandscrp_soundport,0) |
| 443 | 445 | |
| 444 | MDRV_WATCHDOG_TIME_INIT( | |
| 446 | MDRV_WATCHDOG_TIME_INIT( | |
| 445 | 447 | |
| 446 | 448 | MDRV_MACHINE_RESET(sandscrp) |
| 447 | 449 |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 43 | 44 | #include "machine/laserdsc.h" |
| 44 | 45 | |
| 45 | 46 | /* Assumed to be the same as segald hardware */ |
| r3957 | r3958 | |
| 76 | 77 | } |
| 77 | 78 | } |
| 78 | 79 | |
| 79 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color) | |
| 80 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color,int flip) | |
| 80 | 81 | { |
| 81 | if (flip | |
| 82 | if (flip | |
| 82 | 83 | { |
| 83 | 84 | x = bitmap->width - x - 1; |
| 84 | 85 | y = bitmap->height - y - 1; |
| r3957 | r3958 | |
| 103 | 104 | const int SPR_SKIP_HI = 5; |
| 104 | 105 | const int SPR_GFXOFS_LO = 6; |
| 105 | 106 | const int SPR_GFXOFS_HI = 7; |
| 107 | int flip = flip_screen_get(machine); | |
| 106 | 108 | |
| 107 | 109 | int i; |
| 108 | 110 | |
| r3957 | r3958 | |
| 133 | 135 | |
| 134 | 136 | logerror("%02x %02x %02x %02x %02x %02x %02x %02x\n", spr_reg[SPR_Y_TOP], spr_reg[SPR_Y_BOTTOM], spr_reg[SPR_X_LO], spr_reg[SPR_X_HI], |
| 135 | 137 | spr_reg[SPR_SKIP_LO], spr_reg[SPR_SKIP_HI], spr_reg[SPR_GFXOFS_LO], spr_reg[SPR_GFXOFS_HI]); |
| 136 | draw_pixel(bitmap,cliprect,sx,sy,0xffffffff); | |
| 138 | draw_pixel(bitmap,cliprect,sx,sy,0xffffffff,flip); | |
| 137 | 139 | */ |
| 138 | 140 | |
| 139 | 141 | for (row = 0; row < height; row++) |
| r3957 | r3958 | |
| 179 | 181 | } |
| 180 | 182 | |
| 181 | 183 | /* Daphne says "don't draw the pixel if it's black". */ |
| 182 | draw_pixel(bitmap,cliprect,x+0,y,palette_get_color(machine, pixel1 + (sprite_color*0x10 + 0x200))); | |
| 183 | draw_pixel(bitmap,cliprect,x+1,y,palette_get_color(machine, pixel2 + (sprite_color*0x10 + 0x200))); | |
| 184 | draw_pixel(bitmap,cliprect,x+2,y,palette_get_color(machine, pixel3 + (sprite_color*0x10 + 0x200))); | |
| 185 | draw_pixel(bitmap,cliprect,x+3,y,palette_get_color(machine, pixel4 + (sprite_color*0x10 + 0x200))); | |
| 184 | draw_pixel(bitmap,cliprect,x+0,y,palette_get_color(machine, pixel1 + (sprite_color*0x10 + 0x200)),flip); | |
| 185 | draw_pixel(bitmap,cliprect,x+1,y,palette_get_color(machine, pixel2 + (sprite_color*0x10 + 0x200)),flip); | |
| 186 | draw_pixel(bitmap,cliprect,x+2,y,palette_get_color(machine, pixel3 + (sprite_color*0x10 + 0x200)),flip); | |
| 187 | draw_pixel(bitmap,cliprect,x+3,y,palette_get_color(machine, pixel4 + (sprite_color*0x10 + 0x200)),flip); | |
| 186 | 188 | |
| 187 | 189 | x += 4; |
| 188 | 190 |
| r3957 | r3958 | |
|---|---|---|
| 69 | 69 | ***************************************************************************/ |
| 70 | 70 | |
| 71 | 71 | #include "driver.h" |
| 72 | #include "cpu/hd6309/hd6309.h" | |
| 72 | 73 | #include "cpu/m6800/m6800.h" |
| 73 | 74 | #include "cpu/m6805/m6805.h" |
| 74 | 75 | #include "cpu/m6809/m6809.h" |
| r3957 | r3958 | |
| 215 | 216 | { |
| 216 | 217 | ddragon_scrollx_hi = ((data & 0x01) << 8); |
| 217 | 218 | ddragon_scrolly_hi = ((data & 0x02) << 7); |
| 218 | flip_screen_set(~data & 0x04); | |
| 219 | flip_screen_set(space->machine, ~data & 0x04); | |
| 219 | 220 | |
| 220 | 221 | /* bit 3 unknown */ |
| 221 | 222 | |
| r3957 | r3958 | |
| 233 | 234 | ddragon_scrollx_hi = ((data & 0x01) << 8); |
| 234 | 235 | ddragon_scrolly_hi = ((data & 0x02) << 7); |
| 235 | 236 | |
| 236 | // flip_screen_set(~data & 0x04); | |
| 237 | // flip_screen_set(space->machine, ~data & 0x04); | |
| 237 | 238 | |
| 238 | 239 | /* bit 3 unknown */ |
| 239 | 240 | |
| r3957 | r3958 | |
| 290 | 291 | ddragon_scrollx_hi = ((data & 0x01) << 8); |
| 291 | 292 | ddragon_scrolly_hi = ((data & 0x02) << 7); |
| 292 | 293 | |
| 293 | // flip_screen_set(~data & 0x04); | |
| 294 | // flip_screen_set(space->machine, ~data & 0x04); | |
| 294 | 295 | |
| 295 | 296 | /* bit 3 unknown */ |
| 296 | 297 | |
| r3957 | r3958 | |
| 986 | 987 | MDRV_CPU_ADD("sound", M6809, MAIN_CLOCK/2) /* 6MHz / 4 internally */ |
| 987 | 988 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 988 | 989 | |
| 989 | MDRV_ | |
| 990 | MDRV_QUANTUM_TIME | |
| 990 | 991 | |
| 991 | 992 | MDRV_MACHINE_START(ddragon) |
| 992 | 993 | MDRV_MACHINE_RESET(ddragon) |
| r3957 | r3958 | |
| 1051 | 1052 | MDRV_CPU_ADD("sound", M6809, MAIN_CLOCK/2) /* 6MHz / 4 internally */ |
| 1052 | 1053 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 1053 | 1054 | |
| 1054 | MDRV_ | |
| 1055 | MDRV_QUANTUM_TIME | |
| 1055 | 1056 | |
| 1056 | 1057 | MDRV_MACHINE_START(ddragon) |
| 1057 | 1058 | MDRV_MACHINE_RESET(ddragon) |
| r3957 | r3958 | |
| 1097 | 1098 | MDRV_CPU_ADD("sound", Z80, 3579545) |
| 1098 | 1099 | MDRV_CPU_PROGRAM_MAP(dd2_sound_map,0) |
| 1099 | 1100 | |
| 1100 | MDRV_ | |
| 1101 | MDRV_QUANTUM_TIME | |
| 1101 | 1102 | |
| 1102 | 1103 | MDRV_MACHINE_START(ddragon) |
| 1103 | 1104 | MDRV_MACHINE_RESET(ddragon) |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | *******************************************************************************************/ |
| 57 | 57 | |
| 58 | 58 | #include "driver.h" |
| 59 | #include "cpu/m68000/m68000.h" | |
| 59 | 60 | #include "deprecat.h" |
| 60 | 61 | #include "sound/okim6295.h" |
| 61 | 62 | |
| r3957 | r3958 | |
| 112 | 113 | int xx,yy,x; |
| 113 | 114 | int delta = 16; |
| 114 | 115 | |
| 115 | flipx ^= flip_screen_get(); | |
| 116 | flipy ^= flip_screen_get(); | |
| 116 | flipx ^= flip_screen_get(machine); | |
| 117 | flipy ^= flip_screen_get(machine); | |
| 117 | 118 | |
| 118 | 119 | if ((pri&pri_mask)!=priority) continue; |
| 119 | 120 | |
| 120 | if (flip_screen_get()) | |
| 121 | if (flip_screen_get(machine)) | |
| 121 | 122 | { |
| 122 | 123 | sx = 368 - sx; |
| 123 | 124 | sy = 240 - sy; |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/m68000/m68000.h" | |
| 13 | 14 | #include "video/konamiic.h" |
| 14 | 15 | #include "cpu/z80/z80.h" |
| 15 | 16 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | #include "driver.h" |
| 102 | #include "cpu/m6800/m6800.h" | |
| 102 | 103 | #include "cpu/z80/z80.h" |
| 103 | 104 | #include "cpu/m6805/m6805.h" |
| 104 | 105 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 917 | 918 | MDRV_CPU_ADD("nsc",NSC8105,6000000) /* 6 MHz Xtal - divided internally ??? */ |
| 918 | 919 | MDRV_CPU_PROGRAM_MAP(nsc_map,0) |
| 919 | 920 | |
| 920 | MDRV_ | |
| 921 | MDRV_QUANTUM_TIME | |
| 921 | 922 | |
| 922 | 923 | MDRV_MACHINE_START(tubep) |
| 923 | 924 | MDRV_MACHINE_RESET(tubep) |
| r3957 | r3958 | |
|---|---|---|
| 594 | 594 | #define CPU_CLOCK (MASTER_CLOCK/16) |
| 595 | 595 | |
| 596 | 596 | #include "driver.h" |
| 597 | #include "cpu/m6502/m6502.h" | |
| 597 | 598 | #include "video/mc6845.h" |
| 598 | 599 | #include "machine/6821pia.h" |
| 599 | 600 | #include "sound/discrete.h" |
| r3957 | r3958 | |
| 2266 | 2267 | MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8) /* From MC6845 init, registers 00 & 04 (programmed with value-1). */ |
| 2267 | 2268 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1) /* From MC6845 init, registers 01 & 06. */ |
| 2268 | 2269 | |
| 2269 | MDRV_ | |
| 2270 | MDRV_M | |
| 2270 | 2271 | |
| 2271 | 2272 | MDRV_GFXDECODE(goldnpkr) |
| 2272 | 2273 | MDRV_PALETTE_INIT(goldnpkr) |
| r3957 | r3958 | |
|---|---|---|
| 130 | 130 | */ |
| 131 | 131 | |
| 132 | 132 | #include "driver.h" |
| 133 | #include "cpu/z80/z80.h" | |
| 133 | 134 | #include "sound/3812intf.h" |
| 134 | 135 | #include "sound/2413intf.h" |
| 135 | 136 | #include "sound/dac.h" |
| r3957 | r3958 | |
|---|---|---|
| 217 | 217 | ***************************************************************************/ |
| 218 | 218 | |
| 219 | 219 | #include "driver.h" |
| 220 | #include "cpu/z80/z80.h" | |
| 220 | 221 | #include "cpu/m6809/m6809.h" |
| 221 | 222 | #include "cpu/upd7810/upd7810.h" |
| 222 | 223 | #include "homedata.h" |
| r3957 | r3958 | |
| 1286 | 1287 | MDRV_CPU_IO_MAP(reikaids_upd7807_io_map,0) |
| 1287 | 1288 | MDRV_CPU_VBLANK_INT("main", upd7807_irq) |
| 1288 | 1289 | |
| 1289 | MDRV_ | |
| 1290 | MDRV_QUANTUM_TIME | |
| 1290 | 1291 | |
| 1291 | 1292 | MDRV_MACHINE_RESET(reikaids_upd7807) |
| 1292 | 1293 | |
| r3957 | r3958 | |
| 1336 | 1337 | MDRV_CPU_IO_MAP(pteacher_upd7807_io_map,0) |
| 1337 | 1338 | MDRV_CPU_VBLANK_INT("main", upd7807_irq) |
| 1338 | 1339 | |
| 1339 | MDRV_ | |
| 1340 | MDRV_QUANTUM_TIME | |
| 1340 | 1341 | |
| 1341 | 1342 | MDRV_MACHINE_RESET(pteacher_upd7807) |
| 1342 | 1343 |
| r3957 | r3958 | |
|---|---|---|
| 126 | 126 | ***************************************************************************/ |
| 127 | 127 | |
| 128 | 128 | #include "driver.h" |
| 129 | #include "cpu/m6502/m6502.h" | |
| 129 | 130 | #include "deprecat.h" |
| 130 | 131 | #include "exidy.h" |
| 131 | 132 | #include "targ.h" |
| r3957 | r3958 | |
| 843 | 844 | MDRV_CPU_MODIFY("main") |
| 844 | 845 | MDRV_CPU_PROGRAM_MAP(exidy_map,venture_map) |
| 845 | 846 | |
| 846 | MDRV_ | |
| 847 | MDRV_QUANTUM_TIME | |
| 847 | 848 | |
| 848 | 849 | /* audio hardware */ |
| 849 | 850 | MDRV_IMPORT_FROM(venture_audio) |
| r3957 | r3958 | |
| 864 | 865 | /* basic machine hardware */ |
| 865 | 866 | MDRV_IMPORT_FROM(venture) |
| 866 | 867 | |
| 867 | MDRV_ | |
| 868 | MDRV_QUANTUM_TIME | |
| 868 | 869 | |
| 869 | 870 | /* audio hardware */ |
| 870 | 871 | MDRV_IMPORT_FROM(mtrap_cvsd_audio) |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | *****************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "deprecat.h" |
| 13 | 14 | #include "sound/2203intf.h" |
| 14 | 15 | |
| r3957 | r3958 | |
| 317 | 318 | MDRV_CPU_PROGRAM_MAP(map2,0) |
| 318 | 319 | MDRV_CPU_VBLANK_INT_HACK(xxmissio_interrupt_s,2) |
| 319 | 320 | |
| 320 | MDRV_ | |
| 321 | MDRV_QUANTUM_TIME | |
| 321 | 322 | |
| 322 | 323 | MDRV_MACHINE_START(xxmissio) |
| 323 | 324 |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 44 | #include "cpu/m68000/m68000.h" | |
| 43 | 45 | #include "sound/2151intf.h" |
| 44 | 46 | #include "sound/okim6295.h" |
| 45 | 47 |
| r3957 | r3958 | |
|---|---|---|
| 91 | 91 | #define MASTER_CLOCK XTAL_8MHz /* guess */ |
| 92 | 92 | |
| 93 | 93 | #include "driver.h" |
| 94 | #include "cpu/m6809/m6809.h" | |
| 94 | 95 | #include "video/mc6845.h" |
| 95 | 96 | #include "machine/6821pia.h" |
| 96 | 97 | |
| r3957 | r3958 | |
| 357 | 358 | MDRV_VIDEO_START(jokrwild) |
| 358 | 359 | MDRV_VIDEO_UPDATE(jokrwild) |
| 359 | 360 | |
| 360 | MDRV_ | |
| 361 | MDRV_M | |
| 361 | 362 | |
| 362 | 363 | MACHINE_DRIVER_END |
| 363 | 364 |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | ******************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "cpu/z80/z80.h" | |
| 25 | 26 | #include "nb1413m3.h" |
| 26 | 27 | #include "sound/ay8910.h" |
| 27 | 28 | #include "sound/dac.h" |
| r3957 | r3958 | |
|---|---|---|
| 458 | 458 | |
| 459 | 459 | #define MASTER_CLOCK 50000000 |
| 460 | 460 | #include "driver.h" |
| 461 | #include "cpu/z80/z80.h" | |
| 462 | #include "cpu/nec/nec.h" | |
| 461 | 463 | #include "deprecat.h" |
| 462 | 464 | #include "cpu/mips/mips3.h" |
| 463 | 465 | |
| r3957 | r3958 | |
| 1488 | 1490 | activeBuffer = 0 ; |
| 1489 | 1491 | |
| 1490 | 1492 | /* set the fastest DRC options */ |
| 1491 | c | |
| 1493 | device | |
| 1492 | 1494 | |
| 1493 | 1495 | /* configure fast RAM regions for DRC */ |
| 1494 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 1495 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 1496 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x00ffffff); | |
| 1497 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_mainram); | |
| 1498 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 1496 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); | |
| 1497 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); | |
| 1498 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x00ffffff); | |
| 1499 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_mainram); | |
| 1500 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); | |
| 1499 | 1501 | |
| 1500 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 1501 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x04000000); | |
| 1502 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x05ffffff); | |
| 1503 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_cart); | |
| 1504 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 1502 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); | |
| 1503 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x04000000); | |
| 1504 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x05ffffff); | |
| 1505 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_cart); | |
| 1506 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 1505 | 1507 | |
| 1506 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); | |
| 1507 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 1508 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 1509 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 1510 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 1508 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); | |
| 1509 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); | |
| 1510 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); | |
| 1511 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); | |
| 1512 | device_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); | |
| 1511 | 1513 | } |
| 1512 | 1514 | |
| 1513 | 1515 |
| r3957 | r3958 | |
|---|---|---|
| 37 | 37 | ******************************************************************************/ |
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | #include "cpu/m68000/m68000.h" | |
| 40 | 41 | #include "sound/es5506.h" |
| 41 | 42 | |
| 42 | 43 | /*** README INFO ************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 182 | 182 | ***************************************************************************/ |
| 183 | 183 | |
| 184 | 184 | #include "driver.h" |
| 185 | #include "cpu/m6809/m6809.h" | |
| 185 | 186 | #include "machine/tait8741.h" |
| 186 | 187 | #include "cpu/z80/z80.h" |
| 187 | 188 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 271 | 272 | { |
| 272 | 273 | UINT8 *rom = memory_region(machine, "audio") + 0x10000; |
| 273 | 274 | memory_set_bankptr(machine, 2,rom); |
| 274 | c | |
| 275 | device | |
| 275 | 276 | } |
| 276 | 277 | } |
| 277 | 278 | |
| r3957 | r3958 | |
| 321 | 322 | |
| 322 | 323 | static WRITE8_HANDLER( gladiatr_flipscreen_w ) |
| 323 | 324 | { |
| 324 | flip_screen_set(data & 1); | |
| 325 | flip_screen_set(space->machine, data & 1); | |
| 325 | 326 | } |
| 326 | 327 | |
| 327 | 328 | |
| r3957 | r3958 | |
| 704 | 705 | MDRV_CPU_ADD("audio", M6809, XTAL_12MHz/16) /* verified on pcb */ |
| 705 | 706 | MDRV_CPU_PROGRAM_MAP(ppking_cpu3_map,0) |
| 706 | 707 | |
| 707 | MDRV_ | |
| 708 | MDRV_QUANTUM_TIME | |
| 708 | 709 | |
| 709 | 710 | MDRV_MACHINE_RESET(ppking) |
| 710 | 711 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r3957 | r3958 | |
| 753 | 754 | MDRV_CPU_ADD("audio", M6809, XTAL_12MHz/16) /* verified on pcb */ |
| 754 | 755 | MDRV_CPU_PROGRAM_MAP(gladiatr_cpu3_map,0) |
| 755 | 756 | |
| 756 | MDRV_ | |
| 757 | MDRV_QUANTUM_TIME | |
| 757 | 758 | |
| 758 | 759 | MDRV_MACHINE_RESET(gladiator) |
| 759 | 760 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r3957 | r3958 | |
|---|---|---|
| 415 | 415 | MDRV_CPU_IO_MAP(readport_slave,0) |
| 416 | 416 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 417 | 417 | |
| 418 | MDRV_ | |
| 418 | MDRV_QUANTUM_TIME | |
| 419 | 419 | |
| 420 | 420 | MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf ) |
| 421 | 421 |
| r3957 | r3958 | |
|---|---|---|
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | 45 | #include "driver.h" |
| 46 | #include "cpu/m68000/m68000.h" | |
| 46 | 47 | #include "genesis.h" |
| 47 | 48 | |
| 48 | 49 | #define MASTER_CLOCK 53693100 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/m68000/m68000.h" | |
| 11 | 12 | |
| 12 | 13 | static READ16_HANDLER( unknown_read_0xc00000 ) |
| 13 | 14 | { |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/z80/z80.h" | |
| 21 | 22 | #include "deprecat.h" |
| 22 | 23 | #include "sound/2203intf.h" |
| 23 | 24 | |
| r3957 | r3958 | |
| 49 | 50 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | flip_screen_set(data & 0x20); | |
| 53 | flip_screen_set(space->machine, data & 0x20); | |
| 53 | 54 | } |
| 54 | 55 | |
| 55 | 56 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | **********************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/e132xs/e132xs.h" | |
| 13 | 14 | #include "deprecat.h" |
| 14 | 15 | #include "machine/eeprom.h" |
| 15 | 16 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 2115 | 2115 | MDRV_CPU_PROGRAM_MAP(fhawk_2_readmem,fhawk_2_writemem) |
| 2116 | 2116 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,3) /* fixes slow down problems */ |
| 2117 | 2117 | |
| 2118 | MDRV_ | |
| 2118 | MDRV_QUANTUM_TIME | |
| 2119 | 2119 | |
| 2120 | 2120 | MDRV_MACHINE_RESET(fhawk) |
| 2121 | 2121 | |
| r3957 | r3958 | |
| 2211 | 2211 | MDRV_CPU_PROGRAM_MAP(kurikint_2_readmem,kurikint_2_writemem) |
| 2212 | 2212 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 2213 | 2213 | |
| 2214 | MDRV_ | |
| 2214 | MDRV_QUANTUM_TIME | |
| 2215 | 2215 | |
| 2216 | 2216 | MDRV_MACHINE_RESET(kurikint) |
| 2217 | 2217 | |
| r3957 | r3958 | |
| 2351 | 2351 | MDRV_CPU_PROGRAM_MAP(evilston_2_readmem,evilston_2_writemem) |
| 2352 | 2352 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 2353 | 2353 | |
| 2354 | MDRV_ | |
| 2354 | MDRV_QUANTUM_TIME | |
| 2355 | 2355 | |
| 2356 | 2356 | MDRV_MACHINE_RESET(evilston) |
| 2357 | 2357 |
| r3957 | r3958 | |
|---|---|---|
| 56 | 56 | ***************************************************************************/ |
| 57 | 57 | |
| 58 | 58 | #include "driver.h" |
| 59 | #include "cpu/z80/z80.h" | |
| 60 | #include "cpu/m6809/m6809.h" | |
| 59 | 61 | #include "machine/konami1.h" |
| 60 | 62 | #include "cpu/mcs48/mcs48.h" |
| 61 | 63 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
| 519 | 521 | MDRV_CPU_PROGRAM_MAP(audio_cpu2_map,0) |
| 520 | 522 | MDRV_CPU_IO_MAP(audio_cpu2_io_map,0) |
| 521 | 523 | |
| 522 | MDRV_ | |
| 524 | MDRV_QUANTUM_TIME | |
| 523 | 525 | |
| 524 | 526 | /* video hardware */ |
| 525 | 527 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 60 | 60 | */ |
| 61 | 61 | |
| 62 | 62 | #include "driver.h" |
| 63 | #include "cpu/i386/i386.h" | |
| 63 | 64 | #include "memconv.h" |
| 64 | 65 | #include "devconv.h" |
| 65 | #include "deprecat.h" | |
| 66 | 66 | #include "machine/8237dma.h" |
| 67 | 67 | #include "machine/pic8259.h" |
| 68 | 68 | #include "machine/pit8253.h" |
| r3957 | r3958 | |
| 72 | 72 | #include "machine/8042kbdc.h" |
| 73 | 73 | #include "machine/pckeybrd.h" |
| 74 | 74 | #include "machine/idectrl.h" |
| 75 | #include "cpu/i386/i386.h" | |
| 76 | 75 | |
| 77 | 76 | static void ide_interrupt(const device_config *device, int state); |
| 78 | 77 | |
| r3957 | r3958 | |
| 441 | 440 | |
| 442 | 441 | static const struct dma8237_interface dma8237_1_config = |
| 443 | 442 | { |
| 444 | | |
| 443 | "main", | |
| 445 | 444 | 1.0e-6, // 1us |
| 446 | 445 | |
| 447 | 446 | pc_dma_read_byte, |
| r3957 | r3958 | |
| 455 | 454 | |
| 456 | 455 | static const struct dma8237_interface dma8237_2_config = |
| 457 | 456 | { |
| 458 | | |
| 457 | "main", | |
| 459 | 458 | 1.0e-6, // 1us |
| 460 | 459 | |
| 461 | 460 | NULL, |
| r3957 | r3958 | |
| 689 | 688 | |
| 690 | 689 | MACHINE_DRIVER_END |
| 691 | 690 | |
| 692 | static void set_gate_a20(int a20) | |
| 691 | static void set_gate_a20(running_machine *machine, int a20) | |
| 693 | 692 | { |
| 694 | cpu_set_input_line( | |
| 693 | cpu_set_input_line(machine->cpu[0], INPUT_LINE_A20, a20); | |
| 695 | 694 | } |
| 696 | 695 | |
| 697 | static void keyboard_interrupt(int state) | |
| 696 | static void keyboard_interrupt(running_machine *machine, int state) | |
| 698 | 697 | { |
| 699 | 698 | pic8259_set_irq_line( gamecstl_devices.pic8259_1, 1, state); |
| 700 | 699 | } |
| r3957 | r3958 | |
| 713 | 712 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, gamecstl_get_out2 |
| 714 | 713 | }; |
| 715 | 714 | |
| 716 | static void gamecstl_set_keyb_int(int state) { | |
| 715 | static void gamecstl_set_keyb_int(running_machine *machine, int state) { | |
| 717 | 716 | pic8259_set_irq_line(gamecstl_devices.pic8259_1, 1, state); |
| 718 | 717 | } |
| 719 | 718 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/z80/z80.h" | |
| 21 | 22 | #include "render.h" |
| 22 | 23 | #include "machine/laserdsc.h" |
| 23 | 24 |
| r3957 | r3958 | |
|---|---|---|
| 154 | 154 | ***************************************************************************/ |
| 155 | 155 | |
| 156 | 156 | #include "driver.h" |
| 157 | #include "cpu/mb88xx/mb88xx.h" | |
| 157 | 158 | #include "kangaroo.h" |
| 158 | 159 | #include "cpu/z80/z80.h" |
| 159 | 160 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | **********************************/ |
| 17 | 17 | |
| 18 | 18 | #include "driver.h" |
| 19 | #include "cpu/i8085/i8085.h" | |
| 19 | 20 | #include "sound/dac.h" |
| 20 | 21 | |
| 21 | 22 |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | ******************************************************************/ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "cpu/m68000/m68000.h" | |
| 48 | 49 | #include "cpu/z80/z80.h" |
| 49 | 50 | #include "audio/seibu.h" |
| 50 | 51 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 559 | 560 | MDRV_CPU_IO_MAP(cabalbl_talk2_portmap,0) |
| 560 | 561 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,8000) |
| 561 | 562 | |
| 562 | MDRV_ | |
| 563 | MDRV_QUANTUM_TIME | |
| 563 | 564 | |
| 564 | 565 | MDRV_MACHINE_RESET(cabalbl) |
| 565 | 566 |
| r3957 | r3958 | |
|---|---|---|
| 246 | 246 | |
| 247 | 247 | static CDP1852_INTERFACE( cidelsa_cdp1852_in0_intf ) |
| 248 | 248 | { |
| 249 | CDP1852_CLOCK_HIGH, // really tied to CDP1876 CMSEL (pin 32) | |
| 250 | 249 | CDP1852_MODE_INPUT, |
| 251 | 250 | cidelsa_in0_r, |
| 252 | 251 | NULL, |
| r3957 | r3958 | |
| 255 | 254 | |
| 256 | 255 | static CDP1852_INTERFACE( cidelsa_cdp1852_in1_intf ) |
| 257 | 256 | { |
| 258 | CDP1852_CLOCK_HIGH, | |
| 259 | 257 | CDP1852_MODE_INPUT, |
| 260 | 258 | cidelsa_in1_r, |
| 261 | 259 | NULL, |
| r3957 | r3958 | |
| 264 | 262 | |
| 265 | 263 | static CDP1852_INTERFACE( cidelsa_cdp1852_in2_intf ) |
| 266 | 264 | { |
| 267 | CDP1852_CLOCK_HIGH, | |
| 268 | 265 | CDP1852_MODE_INPUT, |
| 269 | 266 | cidelsa_in2_r, |
| 270 | 267 | NULL, |
| r3957 | r3958 | |
| 273 | 270 | |
| 274 | 271 | static CDP1852_INTERFACE( altair_cdp1852_out1_intf ) |
| 275 | 272 | { |
| 276 | ALTAIR_CHR1 / 8, // CDP1802 TPB | |
| 277 | 273 | CDP1852_MODE_OUTPUT, |
| 278 | 274 | NULL, |
| 279 | 275 | altair_out1_w, |
| r3957 | r3958 | |
| 282 | 278 | |
| 283 | 279 | static CDP1852_INTERFACE( draco_cdp1852_out1_intf ) |
| 284 | 280 | { |
| 285 | DRACO_CHR1 / 8, // CDP1802 TPB | |
| 286 | 281 | CDP1852_MODE_OUTPUT, |
| 287 | 282 | NULL, |
| 288 | 283 | draco_out1_w, |
| r3957 | r3958 | |
| 651 | 646 | |
| 652 | 647 | // input/output hardware |
| 653 | 648 | |
| 654 | MDRV_DEVICE_ADD("ic23", CDP1852) | |
| 655 | MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in0_intf) | |
| 649 | MDRV_CDP1852_ADD("ic23", CDP1852_CLOCK_HIGH, cidelsa_cdp1852_in0_intf) /* clock is really tied to CDP1876 CMSEL (pin 32) */ | |
| 650 | MDRV_CDP1852_ADD("ic24", CDP1852_CLOCK_HIGH, cidelsa_cdp1852_in1_intf) | |
| 651 | MDRV_CDP1852_ADD("ic25", CDP1852_CLOCK_HIGH, cidelsa_cdp1852_in2_intf) | |
| 652 | MDRV_CDP1852_ADD("ic26", ALTAIR_CHR1 / 8, altair_cdp1852_out1_intf) /* clock is CDP1802 TPB */ | |
| 656 | 653 | |
| 657 | MDRV_DEVICE_ADD("ic24", CDP1852) | |
| 658 | MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in1_intf) | |
| 659 | ||
| 660 | MDRV_DEVICE_ADD("ic25", CDP1852) | |
| 661 | MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in2_intf) | |
| 662 | ||
| 663 | MDRV_DEVICE_ADD("ic26", CDP1852) | |
| 664 | MDRV_DEVICE_CONFIG(altair_cdp1852_out1_intf) | |
| 665 | ||
| 666 | 654 | // video hardware |
| 667 | 655 | |
| 668 | 656 | MDRV_IMPORT_FROM(altair_video) |
| r3957 | r3958 | |
| 696 | 684 | |
| 697 | 685 | // input/output hardware |
| 698 | 686 | |
| 699 | MDRV_DEVICE_ADD("ic29", CDP1852) | |
| 700 | MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in0_intf) | |
| 687 | MDRV_CDP1852_ADD("ic29", CDP1852_CLOCK_HIGH, cidelsa_cdp1852_in0_intf) /* clock is really tied to CDP1876 CMSEL (pin 32) */ | |
| 688 | MDRV_CDP1852_ADD("ic30", CDP1852_CLOCK_HIGH, cidelsa_cdp1852_in1_intf) | |
| 689 | MDRV_CDP1852_ADD("ic31", CDP1852_CLOCK_HIGH, cidelsa_cdp1852_in2_intf) | |
| 690 | MDRV_CDP1852_ADD("ic32", DRACO_CHR1 / 8, draco_cdp1852_out1_intf) /* clock is CDP1802 TPB */ | |
| 701 | 691 | |
| 702 | MDRV_DEVICE_ADD("ic30", CDP1852) | |
| 703 | MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in1_intf) | |
| 704 | ||
| 705 | MDRV_DEVICE_ADD("ic31", CDP1852) | |
| 706 | MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in2_intf) | |
| 707 | ||
| 708 | MDRV_DEVICE_ADD("ic32", CDP1852) | |
| 709 | MDRV_DEVICE_CONFIG(draco_cdp1852_out1_intf) | |
| 710 | ||
| 711 | 692 | // video hardware |
| 712 | 693 | |
| 713 | 694 | MDRV_IMPORT_FROM(draco_video) |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | */ |
| 43 | 43 | |
| 44 | 44 | #include "driver.h" |
| 45 | #include "cpu/i86/i86.h" | |
| 45 | 46 | #include "sound/ay8910.h" |
| 46 | 47 | |
| 47 | 48 | static UINT8 *hotblock_ram; |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "cpu/z80/z80.h" | |
| 33 | 34 | #include "cpu/mips/r3000.h" |
| 34 | 35 | #include "sound/st0016.h" |
| 35 | 36 | #include "st0016.h" |
| r3957 | r3958 | |
| 639 | 640 | MDRV_CPU_PROGRAM_MAP(srmp5_mem,0) |
| 640 | 641 | MDRV_CPU_VBLANK_INT("main", irq4_gen) |
| 641 | 642 | |
| 642 | MDRV_ | |
| 643 | MDRV_QUANTUM_TIME | |
| 643 | 644 | |
| 644 | 645 | /* video hardware */ |
| 645 | 646 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 194 | 194 | *****************************************************************************/ |
| 195 | 195 | |
| 196 | 196 | #include "driver.h" |
| 197 | #include "cpu/nec/nec.h" | |
| 197 | 198 | #include "m92.h" |
| 198 | 199 | #include "iremipt.h" |
| 199 | 200 | #include "machine/irem_cpu.h" |
| 200 | 201 | #include "sound/2151intf.h" |
| 201 | 202 | #include "sound/iremga20.h" |
| 202 | #include "cpu/nec/nec.h" | |
| 203 | 203 | |
| 204 | 204 | static UINT8 irqvector; |
| 205 | 205 | static UINT16 sound_status; |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ****************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "cpu/z80/z80.h" | |
| 13 | 14 | #include "iremipt.h" |
| 14 | 15 | #include "m58.h" |
| 15 | 16 | #include "audio/irem.h" |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | ***************************************************************************/ |
| 88 | 88 | |
| 89 | 89 | #include "driver.h" |
| 90 | #include "cpu/z80/z80.h" | |
| 90 | 91 | #include "video/konamiic.h" |
| 91 | 92 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 92 | 93 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/z80/z80.h" | |
| 32 | 33 | #include "sound/ay8910.h" |
| 33 | 34 | |
| 34 | 35 |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6800/m6800.h" | |
| 8 | 9 | #include "deprecat.h" |
| 9 | 10 | |
| 10 | 11 | extern VIDEO_UPDATE( destroyr ); |
| r3957 | r3958 | |
|---|---|---|
| 868 | 868 | |
| 869 | 869 | |
| 870 | 870 | #include "driver.h" |
| 871 | #include "deprecat.h" | |
| 871 | #include "cpu/z80/z80.h" | |
| 872 | #include "cpu/m68000/m68000.h" | |
| 873 | #include "cpu/mcs51/mcs51.h" | |
| 872 | 874 | #include "system16.h" |
| 873 | 875 | #include "machine/segaic16.h" |
| 874 | 876 | #include "machine/fd1089.h" |
| r3957 | r3958 | |
| 1342 | 1344 | } |
| 1343 | 1345 | |
| 1344 | 1346 | |
| 1345 | static void upd7759_generate_nmi(int state) | |
| 1347 | static void upd7759_generate_nmi(const device_config *device, int state) | |
| 1346 | 1348 | { |
| 1347 | 1349 | if (state) |
| 1348 | cpu_set_input_line( | |
| 1350 | cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); | |
| 1349 | 1351 | } |
| 1350 | 1352 | |
| 1351 | 1353 |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | *******************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "deprecat.h" | |
| 42 | 41 | #include "cpu/m68000/m68000.h" |
| 43 | 42 | #include "cpu/z80/z80.h" |
| 44 | 43 | #include "wwfwfest.h" |
| 45 | 44 | #include "sound/2151intf.h" |
| 46 | 45 | #include "sound/okim6295.h" |
| 47 | 46 | |
| 47 | #define MASTER_CLOCK XTAL_24MHz | |
| 48 | #define CPU_CLOCK MASTER_CLOCK / 2 | |
| 49 | #define PIXEL_CLOCK MASTER_CLOCK / 4 | |
| 50 | ||
| 48 | 51 | /*- in this file -*/ |
| 49 | 52 | static READ16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r ); |
| 50 | 53 | static WRITE16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w ); |
| r3957 | r3958 | |
| 52 | 55 | static WRITE16_HANDLER( wwfwfest_scroll_write ); /* scrolling write */ |
| 53 | 56 | static WRITE8_HANDLER( oki_bankswitch_w ); |
| 54 | 57 | static WRITE16_HANDLER ( wwfwfest_soundwrite ); |
| 58 | static WRITE16_HANDLER ( wwfwfest_flipscreen_w ); | |
| 59 | static WRITE16_HANDLER ( wwfwfest_irq_ack_w ); | |
| 55 | 60 | |
| 56 | static WRITE16_HANDLER( wwfwfest_flipscreen_w ) | |
| 57 | { | |
| 58 | flip_screen_set(data&1); | |
| 59 | } | |
| 60 | ||
| 61 | 61 | /******************************************************************************* |
| 62 | 62 | Memory Maps |
| 63 | 63 | ******************************************************************************** |
| r3957 | r3958 | |
| 74 | 74 | AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(wwfwfest_bg1_videoram_w) AM_BASE(&wwfwfest_bg1_videoram) /* BG1 Ram - 2 bytes per tile */ |
| 75 | 75 | AM_RANGE(0x100000, 0x100007) AM_WRITE(wwfwfest_scroll_write) |
| 76 | 76 | AM_RANGE(0x10000a, 0x10000b) AM_WRITE(wwfwfest_flipscreen_w) |
| 77 | AM_RANGE(0x140000, 0x140001) AM_WRITE(SMH_NOP) /* Irq 3 ack */ | |
| 78 | AM_RANGE(0x140002, 0x140003) AM_WRITE(SMH_NOP) /* Irq 2 ack */ | |
| 77 | AM_RANGE(0x140000, 0x140003) AM_WRITE(wwfwfest_irq_ack_w) | |
| 79 | 78 | AM_RANGE(0x14000c, 0x14000d) AM_WRITE(wwfwfest_soundwrite) |
| 80 | 79 | AM_RANGE(0x140010, 0x140011) AM_WRITE(wwfwfest_1410_write) |
| 81 | 80 | AM_RANGE(0x140020, 0x140021) AM_READ_PORT("P1") |
| r3957 | r3958 | |
| 102 | 101 | as used by the above memory map |
| 103 | 102 | *******************************************************************************/ |
| 104 | 103 | |
| 104 | static WRITE16_HANDLER( wwfwfest_irq_ack_w ) | |
| 105 | { | |
| 106 | if (offset == 0) | |
| 107 | cpu_set_input_line(space->machine->cpu[0], 3, CLEAR_LINE); | |
| 108 | ||
| 109 | else | |
| 110 | cpu_set_input_line(space->machine->cpu[0], 2, CLEAR_LINE); | |
| 111 | } | |
| 112 | ||
| 113 | static WRITE16_HANDLER( wwfwfest_flipscreen_w ) | |
| 114 | { | |
| 115 | flip_screen_set(space->machine, data&1); | |
| 116 | } | |
| 117 | ||
| 105 | 118 | /*- Palette Reads/Writes -*/ |
| 106 | 119 | |
| 107 | 120 | static READ16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r ) |
| r3957 | r3958 | |
| 331 | 344 | Interrupt Function |
| 332 | 345 | *******************************************************************************/ |
| 333 | 346 | |
| 334 | static INTERRUPT_GEN( wwfwfest_interrupt ) { | |
| 335 | if( cpu_getiloops(device) == 0 ) | |
| 336 | cpu_set_input_line(device, 3, HOLD_LINE); | |
| 337 | else | |
| 338 | cpu_set_input_line(device, 2, HOLD_LINE); | |
| 347 | static TIMER_DEVICE_CALLBACK( wwfwfest_scanline ) | |
| 348 | { | |
| 349 | int scanline = param; | |
| 350 | ||
| 351 | /* An interrupt is generated every 16 scanlines */ | |
| 352 | if (scanline % 16 == 0) | |
| 353 | { | |
| 354 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 355 | cpu_set_input_line(timer->machine->cpu[0], 2, ASSERT_LINE); | |
| 356 | } | |
| 357 | ||
| 358 | /* Vblank is raised on scanline 248 */ | |
| 359 | if (scanline == 248) | |
| 360 | { | |
| 361 | video_screen_update_partial(timer->machine->primary_screen, scanline - 1); | |
| 362 | cpu_set_input_line(timer->machine->cpu[0], 3, ASSERT_LINE); | |
| 363 | } | |
| 364 | ||
| 365 | /* Adjust for next scanline */ | |
| 366 | if (++scanline >= video_screen_get_height(timer->machine->primary_screen)) | |
| 367 | { | |
| 368 | scanline = 0; | |
| 369 | } | |
| 339 | 370 | } |
| 340 | 371 | |
| 341 | 372 | /******************************************************************************* |
| r3957 | r3958 | |
| 368 | 399 | static MACHINE_DRIVER_START( wwfwfest ) |
| 369 | 400 | |
| 370 | 401 | /* basic machine hardware */ |
| 371 | MDRV_CPU_ADD("main", M68000, | |
| 402 | MDRV_CPU_ADD("main", M68000, CPU | |
| 372 | 403 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 373 | MDRV_ | |
| 404 | MDRV_TIMER_ | |
| 374 | 405 | |
| 375 | 406 | MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) |
| 376 | 407 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r3957 | r3958 | |
| 379 | 410 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| 380 | 411 | |
| 381 | 412 | MDRV_SCREEN_ADD("main", RASTER) |
| 382 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 383 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
| 384 | 413 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 385 | MDRV_SCREEN_SIZE(320, 256) | |
| 386 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 1*8, 31*8-1) | |
| 414 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 320, 272, 8, 248) /* HTOTAL and VTOTAL are guessed */ | |
| 387 | 415 | |
| 388 | 416 | MDRV_GFXDECODE(wwfwfest) |
| 389 | 417 | MDRV_PALETTE_LENGTH(8192) |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | #include "cpu/z80/z80.h" | |
| 39 | 40 | #include "sound/ay8910.h" |
| 40 | 41 | #include "includes/espial.h" |
| 41 | 42 |
| r3957 | r3958 | |
|---|---|---|
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | 56 | #include "driver.h" |
| 57 | #include "cpu/m68000/m68000.h" | |
| 57 | 58 | #include "decocrpt.h" |
| 58 | 59 | #include "decoprot.h" |
| 59 | 60 | #include "deco16ic.h" |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | ***************************************************************************/ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "cpu/z80/z80.h" | |
| 48 | 49 | #include "timeplt.h" |
| 49 | 50 | #include "audio/timeplt.h" |
| 50 | 51 |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "deprecat.h" | |
| 44 | 43 | #include "video/ppu2c0x.h" |
| 45 | 44 | #include "sound/nes_apu.h" |
| 46 | 45 | #include "cpu/m6502/m6502.h" |
| r3957 | r3958 | |
| 206 | 205 | static int multigam3_mmc3_last_bank; |
| 207 | 206 | static UINT8* multigmc_mmc3_6000_ram; |
| 208 | 207 | |
| 209 | static void multigam3_mmc3_scanline_cb( int num, int scanline, int vblank, int blanked ) | |
| 208 | static void multigam3_mmc3_scanline_cb( running_machine *machine, int num, int scanline, int vblank, int blanked ) | |
| 210 | 209 | { |
| 211 | 210 | if ( !vblank && !blanked ) |
| 212 | 211 | { |
| 213 | 212 | if ( --multigam3_mmc3_scanline_counter == -1 ) |
| 214 | 213 | { |
| 215 | 214 | multigam3_mmc3_scanline_counter = multigam3_mmc3_scanline_latch; |
| 216 | generic_pulse_irq_line( | |
| 215 | generic_pulse_irq_line(machine->cpu[0], 0); | |
| 217 | 216 | } |
| 218 | 217 | } |
| 219 | 218 | } |
| r3957 | r3958 | |
| 513 | 512 | ppu2c0x_init_palette(machine, 0 ); |
| 514 | 513 | } |
| 515 | 514 | |
| 516 | static void ppu_irq( int num, int *ppu_regs ) | |
| 515 | static void ppu_irq( running_machine *machine, int num, int *ppu_regs ) | |
| 517 | 516 | { |
| 518 | cpu_set_input_line( | |
| 517 | cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE ); | |
| 519 | 518 | } |
| 520 | 519 | |
| 521 | 520 | /* our ppu interface */ |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/m68000/m68000.h" | |
| 23 | 24 | #include "machine/atarigen.h" |
| 24 | 25 | #include "audio/atarijsa.h" |
| 25 | 26 | #include "video/atarirle.h" |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | ***************************************************************************/ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/z80/z80.h" | |
| 39 | #include "cpu/m68000/m68000.h" | |
| 38 | 40 | #include "sound/2203intf.h" |
| 39 | 41 | #include "sound/3812intf.h" |
| 40 | 42 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 213 | 213 | */ |
| 214 | 214 | |
| 215 | 215 | #include "driver.h" |
| 216 | #include " | |
| 216 | #include " | |
| 217 | 217 | #include "cpu/powerpc/ppc.h" |
| 218 | 218 | #include "cpu/sharc/sharc.h" |
| 219 | 219 | #include "machine/konppc.h" |
| r3957 | r3958 | |
| 734 | 734 | |
| 735 | 735 | /*****************************************************************************/ |
| 736 | 736 | |
| 737 | static double adc12138_input_callback(int input) | |
| 737 | static double adc12138_input_callback(running_machine *machine, int input) | |
| 738 | 738 | { |
| 739 | 739 | int value = 0; |
| 740 | 740 | switch (input) |
| 741 | 741 | { |
| 742 | case 0: value = input_port_read(Machine, "ANALOG1") - 0x800; break; | |
| 743 | case 1: value = input_port_read(Machine, "ANALOG2"); break; | |
| 744 | case 2: value = input_port_read(Machine, "ANALOG3"); break; | |
| 745 | case 3: value = input_port_read(Machine, "ANALOG4"); break; | |
| 746 | case 4: value = input_port_read(Machine, "ANALOG5"); break; | |
| 742 | case 0: value = input_port_read(machine, "ANALOG1") - 0x800; break; | |
| 743 | case 1: value = input_port_read(machine, "ANALOG2"); break; | |
| 744 | case 2: value = input_port_read(machine, "ANALOG3"); break; | |
| 745 | case 3: value = input_port_read(machine, "ANALOG4"); break; | |
| 746 | case 4: value = input_port_read(machine, "ANALOG5"); break; | |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | return (double)(value) / 2047.0; |
| r3957 | r3958 | |
| 804 | 804 | int di = (data >> 25) & 0x1; |
| 805 | 805 | int sclk = (data >> 24) & 0x1; |
| 806 | 806 | |
| 807 | adc1213x_cs_w(0, cs); | |
| 807 | adc1213x_cs_w(space->machine, 0, cs); | |
| 808 | 808 | adc1213x_conv_w(0, conv); |
| 809 | 809 | adc1213x_di_w(0, di); |
| 810 | 810 | adc1213x_sclk_w(0, sclk); |
| r3957 | r3958 | |
| 949 | 949 | static MACHINE_START( nwktr ) |
| 950 | 950 | { |
| 951 | 951 | /* set conservative DRC options */ |
| 952 | c | |
| 952 | device | |
| 953 | 953 | |
| 954 | 954 | /* configure fast RAM regions for DRC */ |
| 955 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 956 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 957 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); | |
| 958 | cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 959 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 955 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); | |
| 956 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 957 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); | |
| 958 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); | |
| 959 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); | |
| 960 | 960 | } |
| 961 | 961 | |
| 962 | 962 | static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r3957 | r3958 | |
| 1090 | 1090 | cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE); |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | static const timekeeper_config timekeeper_intf = | |
| 1094 | { | |
| 1095 | "m48t58" | |
| 1096 | }; | |
| 1097 | ||
| 1098 | 1093 | static MACHINE_DRIVER_START( nwktr ) |
| 1099 | 1094 | |
| 1100 | 1095 | /* basic machine hardware */ |
| r3957 | r3958 | |
| 1108 | 1103 | MDRV_CPU_CONFIG(sharc_cfg) |
| 1109 | 1104 | MDRV_CPU_DATA_MAP(sharc_map, 0) |
| 1110 | 1105 | |
| 1111 | MDRV_ | |
| 1106 | MDRV_QUANTUM_TIME | |
| 1112 | 1107 | |
| 1113 | 1108 | MDRV_MACHINE_START(nwktr) |
| 1114 | 1109 | MDRV_MACHINE_RESET(nwktr) |
| r3957 | r3958 | |
| 1137 | 1132 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| 1138 | 1133 | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 1139 | 1134 | |
| 1140 | MDRV_DEVICE_ADD( "m48t58", M48T58 ) | |
| 1141 | MDRV_DEVICE_CONFIG( timekeeper_intf ) | |
| 1135 | MDRV_M48T58_ADD( "m48t58" ) | |
| 1142 | 1136 | MACHINE_DRIVER_END |
| 1143 | 1137 | |
| 1144 | 1138 | /*****************************************************************************/ |
| r3957 | r3958 | |
| 1153 | 1147 | |
| 1154 | 1148 | static DRIVER_INIT(nwktr) |
| 1155 | 1149 | { |
| 1156 | init_konami_cgboard(1, CGBOARD_TYPE_NWKTR); | |
| 1157 | set_cgboard_texture_bank(0, 5, memory_region(machine, "user5")); | |
| 1150 | init_konami_cgboard(machine, 1, CGBOARD_TYPE_NWKTR); | |
| 1151 | set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5")); | |
| 1158 | 1152 | |
| 1159 | 1153 | sharc_dataram = auto_malloc(0x100000); |
| 1160 | 1154 | led_reg0 = led_reg1 = 0x7f; |
| r3957 | r3958 | |
| 1162 | 1156 | K056800_init(machine, sound_irq_callback); |
| 1163 | 1157 | K033906_init(machine); |
| 1164 | 1158 | |
| 1165 | // cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_TX_HANDLER, (genf *)jamma_jvs_w); | |
| 1166 | // cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_RX_HANDLER, (genf *)jamma_jvs_r); | |
| 1159 | // device_set_info_fct(machine->cpu[0], CPUINFO_FCT_SPU_TX_HANDLER, (genf *)jamma_jvs_w); | |
| 1160 | // device_set_info_fct(machine->cpu[0], CPUINFO_FCT_SPU_RX_HANDLER, (genf *)jamma_jvs_r); | |
| 1167 | 1161 | |
| 1168 | 1162 | adc1213x_init(0, adc12138_input_callback); |
| 1169 | 1163 | lanc2_init(); |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | 42 | #include "driver.h" |
| 43 | #include "cpu/z80/z80.h" | |
| 43 | 44 | #include "deprecat.h" |
| 44 | 45 | #include "sound/ay8910.h" |
| 45 | 46 |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | ***************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "cpu/m6502/m6502.h" | |
| 37 | 38 | #include "deprecat.h" |
| 38 | 39 | #include "sound/samples.h" |
| 39 | 40 | #include "circus.h" |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | *******************************************************************************************/ |
| 60 | 60 | |
| 61 | 61 | #include "driver.h" |
| 62 | #include "cpu/m68000/m68000.h" | |
| 62 | 63 | #include "sound/okim6295.h" |
| 63 | 64 | #include "sderby.lh" |
| 64 | 65 | #include "spacewin.lh" |
| r3957 | r3958 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | #include <stdio.h> |
| 71 | 71 | #include "driver.h" |
| 72 | #include "cpu/m68000/m68000.h" | |
| 72 | 73 | #include "video/generic.h" |
| 73 | 74 | |
| 74 | 75 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 75 | AM_RANGE(0x000000, 0xfffff) AM_ROM | |
| 76 | AM_RANGE(0x000000, 0x0fffff) AM_ROM | |
| 77 | AM_RANGE(0x200000, 0x201fff) AM_RAM /* At the very least! */ | |
| 76 | 78 | ADDRESS_MAP_END |
| 77 | 79 | |
| 78 | 80 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 79 | AM_RANGE(0x000000, 0x3ffff) AM_ROM | |
| 81 | AM_RANGE(0x000000, 0x03ffff) AM_ROM | |
| 80 | 82 | ADDRESS_MAP_END |
| 81 | 83 | |
| 82 | 84 | /* |
| r3957 | r3958 | |
| 93 | 95 | return 0; |
| 94 | 96 | } |
| 95 | 97 | |
| 98 | static const gfx_layout vcombat_charlayout = | |
| 99 | { | |
| 100 | 8, 8, | |
| 101 | 0x100000 / 0x80, | |
| 102 | 8, | |
| 103 | { 0,1,2,3,4,5,6,7 }, | |
| 104 | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, | |
| 105 | { 0*16*8, 1*16*8, 2*16*8, 3*16*8, 4*16*8, 5*16*8, 6*16*8, 7*16*8 }, | |
| 106 | 8 * 0x80 | |
| 107 | }; | |
| 108 | ||
| 109 | static GFXDECODE_START( vcombat ) | |
| 110 | GFXDECODE_ENTRY( "main", 0, vcombat_charlayout, 0, 256 ) | |
| 111 | GFXDECODE_END | |
| 112 | ||
| 96 | 113 | static MACHINE_DRIVER_START( vcombat ) |
| 97 | 114 | MDRV_CPU_ADD("main", M68000, XTAL_12MHz) |
| 98 | 115 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 116 | MDRV_CPU_VBLANK_INT("main", irq7_line_hold) /* The only un-masked irq thus far */ | |
| 99 | 117 | |
| 100 | 118 | MDRV_CPU_ADD("sound", M68000, XTAL_12MHz) |
| 101 | 119 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 120 | ||
| 102 | 121 | /* |
| 103 | 122 | Virtual combat has an i860 on each of its two upper boards. |
| 104 | 123 | MDRV_CPU_ADD("video", i860, XTAL_20MHz) |
| r3957 | r3958 | |
| 110 | 129 | MDRV_SCREEN_REFRESH_RATE(60) |
| 111 | 130 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 112 | 131 | MDRV_SCREEN_SIZE(640, 480) |
| 132 | MDRV_GFXDECODE(vcombat) | |
| 113 | 133 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 114 | 134 | |
| 115 | MDRV_PALETTE_LENGTH(0x100) | |
| 135 | /*MDRV_PALETTE_LENGTH(0x100)*/ | |
| 116 | 136 | |
| 137 | MDRV_QUANTUM_TIME(HZ(120000)) /* Temporary */ | |
| 138 | ||
| 117 | 139 | MDRV_VIDEO_UPDATE(vcombat) |
| 118 | 140 | MACHINE_DRIVER_END |
| 119 | 141 | |
| r3957 | r3958 | |
| 137 | 159 | ROM_LOAD( "ds1220y.b53", 0x000, 0x800, CRC(b21cfe5f) SHA1(898ace3cd0913ea4b0dc84320219777773ef856f) ) |
| 138 | 160 | |
| 139 | 161 | /* These roms are identical on both of the upper boards */ |
| 140 | ROM_REGION( 0x200000, "gfx1", 0 ) | |
| 141 | ROM_LOAD( "9.u54", 0x000000, 0x80000, CRC(a276e18b) SHA1(6d60e519196a4858b82241504592413df498e12f) ) | |
| 142 | ROM_LOAD( "10.u55", 0x080000, 0x80000, CRC(8921f20e) SHA1(6e9ca2eaad3e1108ba0e1d7792fd5d0305bec201) ) | |
| 143 | ROM_LOAD( "11.u56", 0x100000, 0x80000, CRC(a83094ce) SHA1(c3512375fecdb5e7eb02a4aa140ae4efe0233cb8) ) | |
| 144 | ROM_LOAD( "12.u57", 0x180000, 0x80000, CRC(0cdffd4f) SHA1(65ace78711b3ef6e0ff9a7ad7343b5558e652f6c) ) | |
| 162 | ROM_REGION( 0x200000, "3d", 0 ) | |
| 163 | ROM_LOAD16_BYTE( "11.u56", 0x000000, 0x80000, CRC(a83094ce) SHA1(c3512375fecdb5e7eb02a4aa140ae4efe0233cb8) ) | |
| 164 | ROM_LOAD16_BYTE( "9.u54", 0x000001, 0x80000, CRC(a276e18b) SHA1(6d60e519196a4858b82241504592413df498e12f) ) | |
| 165 | ROM_LOAD16_BYTE( "12.u57", 0x100000, 0x80000, CRC(0cdffd4f) SHA1(65ace78711b3ef6e0ff9a7ad7343b5558e652f6c) ) | |
| 166 | ROM_LOAD16_BYTE( "10.u55", 0x100001, 0x80000, CRC(8921f20e) SHA1(6e9ca2eaad3e1108ba0e1d7792fd5d0305bec201) ) | |
| 145 | 167 | |
| 146 | 168 | ROM_REGION( 0x400, "plds", 0 ) |
| 147 | 169 | ROM_LOAD( "pal1_w2.u51", 0x000, 0x1f1, CRC(af497420) SHA1(03aa82189d91ae194dd5a6e7b9dbdb7cd473ddb6) ) |
| r3957 | r3958 | |
| 164 | 186 | ROM_REGION( 0x800, "user1", 0 ) /* The SRAM module */ |
| 165 | 187 | ROM_LOAD( "shadfgtr.b53", 0x000, 0x800, CRC(e766a3ab) SHA1(e7696ec08d5c86f64d768480f43edbd19ded162d) ) |
| 166 | 188 | |
| 167 | ROM_REGION( 0x200000, "gfx1", 0 ) | |
| 168 | ROM_LOAD( "shadfgtr.u54", 0x000000, 0x80000, CRC(c45d68d6) SHA1(a133e4f13d3af18bccf0d060a659d64ac699b159) ) | |
| 169 | ROM_LOAD( "shadfgtr.u55", 0x080000, 0x80000, CRC(e807631d) SHA1(9027ff7dc60b808434dac292c08f0630d3d52186) ) | |
| 170 | ROM_LOAD( "shadfgtr.u56", 0x100000, 0x80000, CRC(fb76db5a) SHA1(fa546f465df113c13037abed1162bfa6f9b1dc9b) ) | |
| 171 | ROM_LOAD( "shadfgtr.u57", 0x180000, 0x80000, CRC(60d701d7) SHA1(936473b5e3b2e9e9e3b50cf977fc5a670a097850) ) | |
| 189 | /* These roms are identical on both of the upper boards */ | |
| 190 | ROM_REGION( 0x200000, "3d", 0 ) | |
| 191 | ROM_LOAD16_BYTE( "shadfgtr.u56", 0x000000, 0x80000, CRC(fb76db5a) SHA1(fa546f465df113c13037abed1162bfa6f9b1dc9b) ) | |
| 192 | ROM_LOAD16_BYTE( "shadfgtr.u54", 0x000001, 0x80000, CRC(c45d68d6) SHA1(a133e4f13d3af18bccf0d060a659d64ac699b159) ) | |
| 193 | ROM_LOAD16_BYTE( "shadfgtr.u57", 0x100000, 0x80000, CRC(60d701d7) SHA1(936473b5e3b2e9e9e3b50cf977fc5a670a097850) ) | |
| 194 | ROM_LOAD16_BYTE( "shadfgtr.u55", 0x100001, 0x80000, CRC(e807631d) SHA1(9027ff7dc60b808434dac292c08f0630d3d52186) ) | |
| 172 | 195 | |
| 173 | 196 | ROM_REGION( 0x200, "plds", 0 ) |
| 174 | 197 | ROM_LOAD( "shadfgtr.u51", 0x000, 0x1f1, CRC(bab58337) SHA1(c4a79c8e53aeadb7f64d49d214b607b5b36f144e) ) |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/m68000/m68000.h" | |
| 23 | 24 | #include "cpu/z80/z80.h" |
| 24 | 25 | #include "sound/ay8910.h" |
| 25 | 26 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/m68000/m68000.h" | |
| 15 | 16 | #include "sound/2203intf.h" |
| 16 | 17 | |
| 17 | 18 | static int interrupt_scanline=192; |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | ***************************************************************************/ |
| 63 | 63 | |
| 64 | 64 | #include "driver.h" |
| 65 | #include "cpu/z80/z80.h" | |
| 65 | 66 | #include "deprecat.h" |
| 66 | 67 | #include "sound/ay8910.h" |
| 67 | 68 | |
| r3957 | r3958 | |
| 109 | 110 | |
| 110 | 111 | static WRITE8_HANDLER( flip_screen_w ) |
| 111 | 112 | { |
| 112 | flip_screen_set(data); | |
| 113 | flip_screen_set(space->machine, data); | |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | 116 | |
| r3957 | r3958 | |
| 317 | 318 | MDRV_CPU_IO_MAP(cpu2_port_map,0) |
| 318 | 319 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* ??? */ |
| 319 | 320 | |
| 320 | MDRV_ | |
| 321 | MDRV_QUANTUM_TIME | |
| 321 | 322 | /* synchronization of the CPUs */ |
| 322 | 323 | MDRV_MACHINE_RESET(vastar) |
| 323 | 324 |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "cpu/z80/z80.h" | |
| 68 | #include "cpu/m68000/m68000.h" | |
| 67 | 69 | #include "sound/2610intf.h" |
| 68 | 70 | #include "includes/taotaido.h" |
| 69 | 71 |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/z80/z80.h" | |
| 27 | 28 | #include "machine/eeprom.h" |
| 28 | 29 | #include "sound/ay8910.h" |
| 29 | 30 | #include "machine/8255ppi.h" |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "machine/atarigen.h" |
| 22 | 23 | #include "relief.h" |
| 23 | 24 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | */ |
| 47 | 47 | |
| 48 | 48 | #include "driver.h" |
| 49 | #include "cpu/nec/nec.h" | |
| 49 | 50 | |
| 50 | 51 | static UINT16 *unkram; |
| 51 | 52 | static UINT16 *mainram; |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | #include "cpu/m68000/m68000.h" | |
| 39 | 40 | #include "machine/eeprom.h" |
| 40 | 41 | #include "taito_f3.h" |
| 41 | 42 | #include "sound/es5506.h" |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | #include "driver.h" |
| 19 | #include "cpu/z80/z80.h" | |
| 19 | 20 | #include "machine/8255ppi.h" |
| 20 | 21 | #include "sound/2203intf.h" |
| 21 | 22 |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "driver.h" |
| 23 | #include "cpu/m68000/m68000.h" | |
| 23 | 24 | #include "machine/6840ptm.h" |
| 24 | 25 | #include "video/tms34061.h" |
| 25 | 26 | #include "sound/sn76496.h" |
| r3957 | r3958 | |
|---|---|---|
| 105 | 105 | ***************************************************************************/ |
| 106 | 106 | |
| 107 | 107 | #include "driver.h" |
| 108 | #include "cpu/m6809/m6809.h" | |
| 108 | 109 | #include "cpu/m6800/m6800.h" |
| 109 | 110 | #include "sound/namco.h" |
| 110 | 111 | |
| r3957 | r3958 | |
| 401 | 402 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 402 | 403 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 403 | 404 | |
| 404 | MDRV_ | |
| 405 | MDRV_QUANTUM_TIME | |
| 405 | 406 | |
| 406 | 407 | /* video hardware */ |
| 407 | 408 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | ***************************************************************************/ |
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | #include "cpu/z80/z80.h" | |
| 85 | #include "cpu/alph8201/alph8201.h" | |
| 84 | 86 | #include "sound/ay8910.h" |
| 85 | 87 | #include "sound/dac.h" |
| 86 | 88 | |
| r3957 | r3958 | |
| 128 | 130 | { |
| 129 | 131 | int bit = data & 1; |
| 130 | 132 | |
| 131 | cpu_interrupt_enable(0,bit); | |
| 133 | cpu_interrupt_enable(space->machine->cpu[0],bit); | |
| 132 | 134 | if (!bit) |
| 133 | 135 | cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); |
| 134 | 136 | } |
| r3957 | r3958 | |
| 637 | 639 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 638 | 640 | |
| 639 | 641 | /* to MCU timeout champbbj */ |
| 640 | MDRV_ | |
| 642 | MDRV_QUANTUM_TIME | |
| 641 | 643 | MACHINE_DRIVER_END |
| 642 | 644 | |
| 643 | 645 |
| r3957 | r3958 | |
|---|---|---|
| 283 | 283 | |
| 284 | 284 | |
| 285 | 285 | #include "driver.h" |
| 286 | #include "cpu/z80/z80.h" | |
| 286 | 287 | #include "deprecat.h" |
| 287 | 288 | #include "machine/z80ctc.h" |
| 288 | 289 | #include "machine/z80pio.h" |
| r3957 | r3958 | |
| 1516 | 1517 | MDRV_CPU_IO_MAP(cpu_90009_portmap,0) |
| 1517 | 1518 | MDRV_CPU_VBLANK_INT_HACK(mcr_interrupt,2) |
| 1518 | 1519 | |
| 1519 | MDRV_Z80CTC_ADD("ctc", mcr_ctc_intf) | |
| 1520 | MDRV_Z80CTC_ADD("ctc", MAIN_OSC_MCR_I/8 /* same as "main" */, mcr_ctc_intf) | |
| 1520 | 1521 | |
| 1521 | 1522 | MDRV_WATCHDOG_VBLANK_INIT(16) |
| 1522 | 1523 | MDRV_MACHINE_START(mcr) |
| r3957 | r3958 | |
| 1578 | 1579 | MDRV_IMPORT_FROM(mcr_90010) |
| 1579 | 1580 | |
| 1580 | 1581 | /* basic machine hardware */ |
| 1581 | MDRV_CPU_REPLACE("main", Z80, 5000000) | |
| 1582 | MDRV_CPU_MODIFY("main") | |
| 1583 | MDRV_CPU_CLOCK(5000000) | |
| 1582 | 1584 | MDRV_CPU_PROGRAM_MAP(cpu_91490_map,0) |
| 1583 | 1585 | MDRV_CPU_IO_MAP(cpu_91490_portmap,0) |
| 1586 | ||
| 1587 | MDRV_DEVICE_MODIFY("ctc", Z80CTC) | |
| 1588 | MDRV_DEVICE_CLOCK(5000000 /* same as "main" */) | |
| 1584 | 1589 | MACHINE_DRIVER_END |
| 1585 | 1590 | |
| 1586 | 1591 | |
| r3957 | r3958 | |
| 1606 | 1611 | MDRV_CPU_IO_MAP(ipu_91695_portmap,0) |
| 1607 | 1612 | MDRV_CPU_VBLANK_INT_HACK(mcr_ipu_interrupt,2) |
| 1608 | 1613 | |
| 1609 | MDRV_Z80CTC_ADD("ipu_ctc", nflfoot_ctc_intf) | |
| 1614 | MDRV_Z80CTC_ADD("ipu_ctc", 7372800/2 /* same as "ipu" */, nflfoot_ctc_intf) | |
| 1610 | 1615 | MDRV_Z80PIO_ADD("ipu_pio0", nflfoot_pio_intf) |
| 1611 | 1616 | MDRV_Z80PIO_ADD("ipu_pio1", nflfoot_pio_intf) |
| 1612 | MDRV_Z80SIO_ADD("ipu_sio", nflfoot_sio_intf) | |
| 1617 | MDRV_Z80SIO_ADD("ipu_sio", 7372800/2 /* same as "ipu" */, nflfoot_sio_intf) | |
| 1613 | 1618 | MACHINE_DRIVER_END |
| 1614 | 1619 | |
| 1615 | 1620 |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | ***************************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/z80/z80.h" | |
| 55 | 56 | |
| 56 | 57 | |
| 57 | 58 | static UINT8 *beaminv_videoram; |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | *******************************************************************************/ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/nec/nec.h" | |
| 27 | 28 | #include "m107.h" |
| 28 | 29 | #include "iremipt.h" |
| 29 | 30 | #include "machine/irem_cpu.h" |
| 30 | 31 | #include "sound/2151intf.h" |
| 31 | 32 | #include "sound/iremga20.h" |
| 32 | #include "cpu/nec/nec.h" | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | #define M107_IRQ_0 ((m107_irq_vectorbase+0)/4) /* VBL interrupt*/ |
| r3957 | r3958 | |
|---|---|---|
| 190 | 190 | ***************************************************************************/ |
| 191 | 191 | |
| 192 | 192 | #include "driver.h" |
| 193 | #include "cpu/z80/z80.h" | |
| 193 | 194 | #include "taitoipt.h" |
| 194 | 195 | #include "cpu/m68000/m68000.h" |
| 195 | 196 | #include "video/taitoic.h" |
| r3957 | r3958 | |
| 631 | 632 | MDRV_CPU_PROGRAM_MAP(ninjaw_cpub_readmem,ninjaw_cpub_writemem) |
| 632 | 633 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold) |
| 633 | 634 | |
| 634 | MDRV_ | |
| 635 | MDRV_QUANTUM_TIME | |
| 635 | 636 | |
| 636 | 637 | MDRV_MACHINE_START(ninjaw) |
| 637 | 638 | MDRV_MACHINE_RESET(ninjaw) |
| r3957 | r3958 | |
| 704 | 705 | MDRV_CPU_PROGRAM_MAP(darius2_cpub_readmem,darius2_cpub_writemem) |
| 705 | 706 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold) |
| 706 | 707 | |
| 707 | MDRV_ | |
| 708 | MDRV_QUANTUM_TIME | |
| 708 | 709 | |
| 709 | 710 | MDRV_MACHINE_START(ninjaw) |
| 710 | 711 | MDRV_MACHINE_RESET(ninjaw) |
| r3957 | r3958 | |
|---|---|---|
| 329 | 329 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 330 | 330 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,15) /* ???? */ |
| 331 | 331 | /* IRQs are caused by the main CPU */ |
| 332 | MDRV_ | |
| 332 | MDRV_QUANTUM_TIME | |
| 333 | 333 | |
| 334 | 334 | /* video hardware */ |
| 335 | 335 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 386 | 386 | MDRV_CPU_ADD("mcu", M68705, 1500000*2) /* (don't know really how fast, but it doesn't need to even be this fast) */ |
| 387 | 387 | MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem) |
| 388 | 388 | |
| 389 | MDRV_ | |
| 389 | MDRV_QUANTUM_TIME | |
| 390 | 390 | |
| 391 | 391 | /* video hardware */ |
| 392 | 392 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 469 | 469 | ***************************************************************************/ |
| 470 | 470 | |
| 471 | 471 | #include "driver.h" |
| 472 | #include "cpu/z80/z80.h" | |
| 472 | 473 | #include "arkanoid.h" |
| 473 | 474 | #include "sound/ay8910.h" |
| 474 | 475 | #include "cpu/m6805/m6805.h" |
| r3957 | r3958 | |
| 767 | 768 | MDRV_CPU_ADD("mcu", M68705, XTAL_12MHz/4) /* verified on pcb */ |
| 768 | 769 | MDRV_CPU_PROGRAM_MAP(mcu_map, 0) |
| 769 | 770 | |
| 770 | MDRV_ | |
| 771 | MDRV_QUANTUM_TIME | |
| 771 | 772 | |
| 772 | 773 | MDRV_MACHINE_START(arkanoid) |
| 773 | 774 | MDRV_MACHINE_RESET(arkanoid) |
| r3957 | r3958 | |
| 1049 | 1050 | ROM_LOAD( "82s129.5kl", 0x0300, 0x0100, CRC(085d625a) SHA1(26c96a1c1b7562fed84c31dd92fdf7829e96a9c7) ) /* green component = a75-08.bpr*/ |
| 1050 | 1051 | ROM_LOAD( "82s129.5mn", 0x0400, 0x0100, CRC(0fe0b108) SHA1(fcf27619208922345a1e42b3a219b4274f66968d) ) /* blue component + */ |
| 1051 | 1052 | ROM_LOAD( "63s141.5m", 0x0500, 0x0100, CRC(5553f675) SHA1(c50255af8d99664b92e0bb34a527fd42ebf7e759) ) /* blue component = a75-09.bpr*/ |
| 1053 | ||
| 1054 | ROM_REGION( 0x0200, "pal", ROMREGION_DISPOSE ) | |
| 1055 | ROM_LOAD( "pal16r8.5f", 0x0000, 0x0104, CRC(36471917) SHA1(d0f295a94d480b44416e66be4b480b299aad5c3c) ) | |
| 1052 | 1056 | ROM_END |
| 1053 | 1057 | |
| 1054 | 1058 | ROM_START( paddle2 ) |
| r3957 | r3958 | |
|---|---|---|
| 905 | 905 | MDRV_CPU_ADD("audio", Z80, 3579545) |
| 906 | 906 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 907 | 907 | |
| 908 | MDRV_ | |
| 908 | MDRV_QUANTUM_TIME | |
| 909 | 909 | |
| 910 | 910 | // video hardware |
| 911 | 911 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
| 945 | 945 | |
| 946 | 946 | static MACHINE_DRIVER_START( devilw ) |
| 947 | 947 | MDRV_IMPORT_FROM(twin16) |
| 948 | MDRV_ | |
| 948 | MDRV_QUANTUM_TIME | |
| 949 | 949 | MACHINE_DRIVER_END |
| 950 | 950 | |
| 951 | 951 | static MACHINE_DRIVER_START( fround ) |
| r3957 | r3958 | |
| 957 | 957 | MDRV_CPU_ADD("audio", Z80, 3579545) |
| 958 | 958 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 959 | 959 | |
| 960 | MDRV_ | |
| 960 | MDRV_QUANTUM_TIME | |
| 961 | 961 | |
| 962 | 962 | /* video hardware */ |
| 963 | 963 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | #define OKI4_SOUND_CLOCK XTAL_4MHz |
| 119 | 119 | |
| 120 | 120 | #include "driver.h" |
| 121 | #include "cpu/z80/z80.h" | |
| 122 | #include "cpu/m68000/m68000.h" | |
| 121 | 123 | #include "deprecat.h" |
| 122 | 124 | #include "megasys1.h" |
| 123 | 125 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 604 | 606 | MDRV_CPU_ADD("sound", M68000, SOUND_CPU_CLOCK) /* 7MHz verified */ |
| 605 | 607 | MDRV_CPU_PROGRAM_MAP(sound_readmem_A,sound_writemem_A) |
| 606 | 608 | |
| 607 | MDRV_ | |
| 609 | MDRV_QUANTUM_TIME | |
| 608 | 610 | |
| 609 | 611 | MDRV_MACHINE_RESET(megasys1) |
| 610 | 612 |
| r3957 | r3958 | |
|---|---|---|
| 127 | 127 | ***************************************************************************/ |
| 128 | 128 | |
| 129 | 129 | #include "driver.h" |
| 130 | #include "cpu/z80/z80.h" | |
| 131 | #include "cpu/m68000/m68000.h" | |
| 130 | 132 | #include "video/konamiic.h" |
| 131 | 133 | #include "sound/2610intf.h" |
| 132 | 134 | #include "crshrace.h" |
| r3957 | r3958 | |
|---|---|---|
| 301 | 301 | { |
| 302 | 302 | airbustr_bankswitch(space->machine, "slave", 2, data); |
| 303 | 303 | |
| 304 | flip_screen_set(data & 0x10); | |
| 304 | flip_screen_set(space->machine, data & 0x10); | |
| 305 | 305 | |
| 306 | 306 | // used at the end of levels, after defeating the boss, to leave trails |
| 307 | 307 | pandora_set_clear_bitmap(data&0x20); |
| r3957 | r3958 | |
| 619 | 619 | MDRV_CPU_IO_MAP(sound_io_map, 0) |
| 620 | 620 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) // nmi are caused by sub cpu writing a sound command |
| 621 | 621 | |
| 622 | MDRV_ | |
| 622 | MDRV_QUANTUM_TIME | |
| 623 | 623 | // Maybe a high value is safer in order to avoid glitches |
| 624 | 624 | MDRV_MACHINE_RESET(airbustr) |
| 625 | MDRV_WATCHDOG_TIME_INIT( | |
| 625 | MDRV_WATCHDOG_TIME_INIT( | |
| 626 | 626 | |
| 627 | 627 | // video hardware |
| 628 | 628 | |
| r3957 | r3958 | |
| 656 | 656 | |
| 657 | 657 | static MACHINE_DRIVER_START( airbusb ) |
| 658 | 658 | MDRV_IMPORT_FROM(airbustr) |
| 659 | MDRV_WATCHDOG_TIME_INIT( | |
| 659 | MDRV_WATCHDOG_TIME_INIT( | |
| 660 | 660 | MACHINE_DRIVER_END |
| 661 | 661 | |
| 662 | 662 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/z80/z80.h" | |
| 21 | 22 | #include "sound/custom.h" |
| 22 | 23 | |
| 23 | 24 | /* Variables & functions defined in video: */ |
| r3957 | r3958 | |
| 43 | 44 | |
| 44 | 45 | static MACHINE_RESET( clshroad ) |
| 45 | 46 | { |
| 46 | flip_screen_set(0); | |
| 47 | flip_screen_set(machine, 0); | |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | 50 |
| r3957 | r3958 | |
|---|---|---|
| 337 | 337 | ****************************************************************************/ |
| 338 | 338 | |
| 339 | 339 | #include "driver.h" |
| 340 | #include "cpu/z80/z80.h" | |
| 340 | 341 | #include "deprecat.h" |
| 341 | 342 | #include "pacman.h" |
| 342 | 343 | #include "cpu/s2650/s2650.h" |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/m6809/m6809.h" | |
| 33 | #include "cpu/m68000/m68000.h" | |
| 32 | 34 | #include "machine/eeprom.h" |
| 33 | 35 | #include "machine/ticket.h" |
| 34 | 36 | #include "sound/bsmt2000.h" |
| r0 | r3958 | |
|---|---|---|
| 1 | /* Taito | |
| 2 | 'Parent Jack' | |
| 3 | (Medal Game) | |
| 4 | */ | |
| 5 | ||
| 6 | ||
| 7 | ||
| 8 | #include "driver.h" | |
| 9 | #include "cpu/m68000/m68000.h" | |
| 10 | ||
| 11 | static UINT16* parentj_video; | |
| 12 | ||
| 13 | VIDEO_START(parentj) | |
| 14 | { | |
| 15 | ||
| 16 | ||
| 17 | } | |
| 18 | ||
| 19 | VIDEO_UPDATE(parentj) | |
| 20 | { | |
| 21 | const gfx_element *gfx = screen->machine->gfx[0]; | |
| 22 | int count = 0x0c000/2; | |
| 23 | ||
| 24 | int y,x; | |
| 25 | ||
| 26 | ||
| 27 | for (y=0;y<64;y++) | |
| 28 | { | |
| 29 | for (x=0;x<64;x++) | |
| 30 | { | |
| 31 | int tile = parentj_video[count]; | |
| 32 | //int colour = tile>>12; | |
| 33 | drawgfx(bitmap,gfx,tile,9,0,0,x*16,y*16,cliprect,TRANSPARENCY_NONE,0); | |
| 34 | ||
| 35 | count++; | |
| 36 | } | |
| 37 | } | |
| 38 | ||
| 39 | ||
| 40 | return 0; | |
| 41 | } | |
| 42 | ||
| 43 | static ADDRESS_MAP_START( parentj_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 44 | AM_RANGE(0x000000, 0x01ffff) AM_ROM | |
| 45 | AM_RANGE(0x100000, 0x103fff) AM_RAM | |
| 46 | ||
| 47 | ||
| 48 | AM_RANGE(0x200004, 0x200005) AM_WRITE(SMH_NOP) | |
| 49 | ||
| 50 | AM_RANGE(0x400000, 0x41ffff) AM_RAM AM_BASE(&parentj_video) | |
| 51 | ||
| 52 | AM_RANGE(0x500800, 0x500fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 53 | ||
| 54 | ||
| 55 | ADDRESS_MAP_END | |
| 56 | ||
| 57 | ||
| 58 | ||
| 59 | static const gfx_layout parentj_layout = | |
| 60 | { | |
| 61 | 16,16, | |
| 62 | RGN_FRAC(1,8), | |
| 63 | 4, | |
| 64 | { 0,1,2,3 }, | |
| 65 | { RGN_FRAC(7,8)+4, RGN_FRAC(7,8)+0, | |
| 66 | RGN_FRAC(6,8)+4, RGN_FRAC(6,8)+0, | |
| 67 | RGN_FRAC(5,8)+4, RGN_FRAC(5,8)+0, | |
| 68 | RGN_FRAC(4,8)+4, RGN_FRAC(4,8)+0, | |
| 69 | RGN_FRAC(3,8)+4, RGN_FRAC(3,8)+0, | |
| 70 | RGN_FRAC(2,8)+4, RGN_FRAC(2,8)+0, | |
| 71 | RGN_FRAC(1,8)+4, RGN_FRAC(1,8)+0, | |
| 72 | RGN_FRAC(0,8)+4, RGN_FRAC(0,8)+0 | |
| 73 | }, | |
| 74 | { 0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120}, | |
| 75 | ||
| 76 | 1*128 | |
| 77 | }; | |
| 78 | ||
| 79 | static GFXDECODE_START( parentj ) | |
| 80 | GFXDECODE_ENTRY( "gfx1", 0, parentj_layout, 0x0, 0x400/16 ) | |
| 81 | GFXDECODE_END | |
| 82 | ||
| 83 | ||
| 84 | static INPUT_PORTS_START( parentj ) | |
| 85 | INPUT_PORTS_END | |
| 86 | ||
| 87 | static MACHINE_DRIVER_START( parentj ) | |
| 88 | MDRV_CPU_ADD("main", M68000, 16000000) // ? | |
| 89 | MDRV_CPU_PROGRAM_MAP(parentj_map,0) | |
| 90 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold) // 4/5/6 valid? | |
| 91 | ||
| 92 | MDRV_GFXDECODE(parentj) | |
| 93 | ||
| 94 | MDRV_SCREEN_ADD("main", RASTER) | |
| 95 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 96 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 97 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 98 | MDRV_SCREEN_SIZE(64*16, 64*16) | |
| 99 | MDRV_SCREEN_VISIBLE_AREA(32*16, 64*16-1, 0*16, 32*16-1) | |
| 100 | ||
| 101 | MDRV_PALETTE_LENGTH(0x400) | |
| 102 | ||
| 103 | MDRV_VIDEO_START(parentj) | |
| 104 | MDRV_VIDEO_UPDATE(parentj) | |
| 105 | MACHINE_DRIVER_END | |
| 106 | ||
| 107 | ||
| 108 | ROM_START( parentj ) | |
| 109 | ROM_REGION( 0x20000, "main", 0 ) /* 68000 Code */ | |
| 110 | ROM_LOAD16_BYTE( "c42-13.21", 0x00000, 0x10000, CRC(823623eb) SHA1(7302cc0ac532f6190ae35218ea05bf8cf11fd687) ) | |
| 111 | ROM_LOAD16_BYTE( "c42-12.20", 0x00001, 0x10000, CRC(8654b0ab) SHA1(edd23a731c1c60cab353e51ef5e66d33bc3fde61) ) | |
| 112 | ||
| 113 | ROM_REGION( 0x100000, "gfx1", 0 ) | |
| 114 | ROM_LOAD( "c42-05.06", 0x00000, 0x20000, CRC(7af0d45d) SHA1(bc527b74185596e4e77b34d08eb3e1678614b451) ) | |
| 115 | ROM_LOAD( "c42-04.05", 0x20000, 0x20000, CRC(133009a1) SHA1(fae5dd600384790225c24a62d1f8a00f0366dae9) ) | |
| 116 | ROM_LOAD( "c42-09.13", 0x40000, 0x20000, CRC(ba35fb03) SHA1(b76e50d298ccc0f230c865b563cd8e02866a4ffb) ) | |
| 117 | ROM_LOAD( "c42-08.12", 0x60000, 0x20000, CRC(7fae35a7) SHA1(f4bc6c6fd4afc167eb36b8f16589e1bfd729085e) ) | |
| 118 | ROM_LOAD( "c42-07.10", 0x80000, 0x20000, CRC(f92c6f03) SHA1(ff42318ee425b423b67e2cec1fe3ef9d9785ebf6) ) | |
| 119 | ROM_LOAD( "c42-06.09", 0xa0000, 0x20000, CRC(3685febd) SHA1(637946377f6d934f791d52e9790c91f60a5b2c65) ) | |
| 120 | ROM_LOAD( "c42-11.17", 0xc0000, 0x20000, CRC(5d8d3c59) SHA1(c8a8a957ac9f2f1c346b4504495893c71fbfe14b) ) | |
| 121 | ROM_LOAD( "c42-10.16", 0xe0000, 0x20000, CRC(e85e536e) SHA1(9ed9e316869333338e39cb0d1293e3380861a3ca) ) | |
| 122 | ||
| 123 | ROM_REGION( 0x2dd, "misc", 0 ) | |
| 124 | ROM_LOAD( "ampal22v10a-0233.c42", 0x000, 0x2dd, CRC(0c030a81) SHA1(0f8198df2cb046683d2db9ac8e609cdff53083ed) ) | |
| 125 | ROM_END | |
| 126 | ||
| 127 | GAME( 199?, parentj, 0, parentj, parentj, 0, ROT0, "Taito", "Parent Jack", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| r3957 | r3958 | |
|---|---|---|
| 354 | 354 | MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 355 | 355 | MDRV_CPU_PROGRAM_MAP(chqflag_readmem_sound,chqflag_writemem_sound) |
| 356 | 356 | |
| 357 | MDRV_ | |
| 357 | MDRV_QUANTUM_TIME | |
| 358 | 358 | |
| 359 | 359 | /* video hardware */ |
| 360 | 360 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r3957 | r3958 | |
|---|---|---|
| 399 | 399 | MDRV_CPU_IO_MAP(bwp3_io_map,0) |
| 400 | 400 | MDRV_CPU_PERIODIC_INT(bwp3_interrupt, 1000) |
| 401 | 401 | |
| 402 | MDRV_ | |
| 402 | MDRV_QUANTUM_TIME | |
| 403 | 403 | |
| 404 | 404 | MDRV_MACHINE_RESET(bwing) |
| 405 | 405 |
| r3957 | r3958 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | #include "driver.h" |
| 70 | #include "cpu/m68000/m68000.h" | |
| 70 | 71 | #include "deprecat.h" |
| 71 | 72 | #include "sound/nile.h" |
| 72 | 73 |
| r3957 | r3958 | |
|---|---|---|
| 147 | 147 | ***************************************************************************/ |
| 148 | 148 | |
| 149 | 149 | #include "driver.h" |
| 150 | #include "cpu/z80/z80.h" | |
| 150 | 151 | #include "cpu/m6805/m6805.h" |
| 151 | 152 | #include "sound/ay8910.h" |
| 152 | 153 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 162 | 163 | /* bit 3 is zeroed on startup, maybe reset sound CPU */ |
| 163 | 164 | |
| 164 | 165 | /* bit 4 flips screen */ |
| 165 | flip_screen_set(data & 0x10); | |
| 166 | flip_screen_set(space->machine, data & 0x10); | |
| 166 | 167 | |
| 167 | 168 | /* other bits unknown */ |
| 168 | 169 | } |
| r3957 | r3958 | |
| 569 | 570 | MDRV_CPU_ADD("mcu", M68705,4000000) /* ? */ |
| 570 | 571 | MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| 571 | 572 | |
| 572 | MDRV_ | |
| 573 | MDRV_QUANTUM_TIME | |
| 573 | 574 | /* synchronization of the CPUs */ |
| 574 | 575 | /* main<->sound synchronization depends on this */ |
| 575 | 576 | |
| r3957 | r3958 | |
| 612 | 613 | MDRV_CPU_PROGRAM_MAP(sound_mem_daikaiju, 0) |
| 613 | 614 | /* IRQs are triggered by the YM2203 */ |
| 614 | 615 | |
| 615 | MDRV_ | |
| 616 | MDRV_QUANTUM_TIME | |
| 616 | 617 | /* synchronization of the CPUs */ |
| 617 | 618 | /* main<->sound synchronization depends on this */ |
| 618 | 619 |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6800/m6800.h" | |
| 8 | 9 | |
| 9 | 10 | static UINT8* cball_video_ram; |
| 10 | 11 |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | *******************************************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "cpu/nec/nec.h" | |
| 55 | 56 | #include "audio/seibu.h" |
| 56 | 57 | #include "sound/3812intf.h" |
| 57 | 58 |
| r3957 | r3958 | |
|---|---|---|
| 69 | 69 | ***************************************************************************/ |
| 70 | 70 | |
| 71 | 71 | #include "driver.h" |
| 72 | #include "cpu/m68000/m68000.h" | |
| 72 | 73 | #include "machine/eeprom.h" |
| 73 | 74 | #include "machine/nmk112.h" |
| 74 | 75 | #include "cpu/z80/z80.h" |
| r3957 | r3958 | |
| 2325 | 2326 | MDRV_CPU_PROGRAM_MAP(mazinger_sound_readmem,mazinger_sound_writemem) |
| 2326 | 2327 | MDRV_CPU_IO_MAP(mazinger_sound_readport,mazinger_sound_writeport) |
| 2327 | 2328 | |
| 2328 | MDRV_WATCHDOG_TIME_INIT( | |
| 2329 | MDRV_WATCHDOG_TIME_INIT( | |
| 2329 | 2330 | |
| 2330 | 2331 | MDRV_MACHINE_RESET(cave) |
| 2331 | 2332 | MDRV_NVRAM_HANDLER(cave) |
| r3957 | r3958 | |
| 2381 | 2382 | MDRV_CPU_PROGRAM_MAP(metmqstr_sound_readmem,metmqstr_sound_writemem) |
| 2382 | 2383 | MDRV_CPU_IO_MAP(metmqstr_sound_readport,metmqstr_sound_writeport) |
| 2383 | 2384 | |
| 2384 | MDRV_WATCHDOG_TIME_INIT( | |
| 2385 | MDRV_WATCHDOG_TIME_INIT( | |
| 2385 | 2386 | |
| 2386 | 2387 | MDRV_MACHINE_RESET(cave) /* start with the watchdog armed */ |
| 2387 | 2388 | MDRV_NVRAM_HANDLER(cave) |
| r3957 | r3958 | |
| 2497 | 2498 | MDRV_CPU_PROGRAM_MAP(sailormn_sound_readmem,sailormn_sound_writemem) |
| 2498 | 2499 | MDRV_CPU_IO_MAP(sailormn_sound_readport,sailormn_sound_writeport) |
| 2499 | 2500 | |
| 2500 | // MDRV_ | |
| 2501 | // MDRV_QUANTUM_TIME | |
| 2501 | 2502 | |
| 2502 | 2503 | MDRV_MACHINE_RESET(cave) |
| 2503 | 2504 | MDRV_NVRAM_HANDLER(cave) |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | */ |
| 56 | 56 | |
| 57 | 57 | #include "driver.h" |
| 58 | #include "deprecat.h" | |
| 59 | 58 | #include "video/ppu2c0x.h" |
| 60 | 59 | #include "sound/nes_apu.h" |
| 61 | 60 | #include "cpu/m6502/m6502.h" |
| r3957 | r3958 | |
| 203 | 202 | |
| 204 | 203 | memcpy( &dst[0x8000], &src[0x0f8000], 0x4000 ); |
| 205 | 204 | memcpy( &dst[0xc000], &src[0x0f8000], 0x4000 ); |
| 206 | c | |
| 205 | device | |
| 207 | 206 | |
| 208 | 207 | /* reset the ppu */ |
| 209 | 208 | ppu2c0x_reset( machine, 0, 1 ); |
| r3957 | r3958 | |
| 214 | 213 | ppu2c0x_init_palette(machine, 0 ); |
| 215 | 214 | } |
| 216 | 215 | |
| 217 | static void ppu_irq( int num, int *ppu_regs ) | |
| 216 | static void ppu_irq( running_machine *machine, int num, int *ppu_regs ) | |
| 218 | 217 | { |
| 219 | cpu_set_input_line( | |
| 218 | cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE ); | |
| 220 | 219 | } |
| 221 | 220 | |
| 222 | 221 | /* our ppu interface */ |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/z80/z80.h" | |
| 54 | #include "cpu/m68000/m68000.h" | |
| 53 | 55 | #include "deprecat.h" |
| 54 | 56 | #include "sound/2203intf.h" |
| 55 | 57 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
| 71 | 73 | |
| 72 | 74 | static WRITE8_HANDLER( flip_screen_w ) |
| 73 | 75 | { |
| 74 | flip_screen_set(data); | |
| 76 | flip_screen_set(space->machine, data); | |
| 75 | 77 | } |
| 76 | 78 | |
| 77 | 79 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 72 | 72 | static WRITE8_HANDLER( brkthru_1803_w ) |
| 73 | 73 | { |
| 74 | 74 | /* bit 0 = NMI enable */ |
| 75 | cpu_interrupt_enable(0, ~data & 1); | |
| 75 | cpu_interrupt_enable(space->machine->cpu[0], ~data & 1); | |
| 76 | 76 | |
| 77 | 77 | /* bit 1 = ? maybe IRQ acknowledge */ |
| 78 | 78 | } |
| 79 | 79 | static WRITE8_HANDLER( darwin_0803_w ) |
| 80 | 80 | { |
| 81 | 81 | /* bit 0 = NMI enable */ |
| 82 | /*cpu_interrupt_enable(1, ~data & 1);*/ | |
| 82 | /*cpu_interrupt_enable(space->machine->cpu[1], ~data & 1);*/ | |
| 83 | 83 | logerror("0803 %02X\n",data); |
| 84 | cpu_interrupt_enable(0, data & 1); | |
| 84 | cpu_interrupt_enable(space->machine->cpu[0], data & 1); | |
| 85 | 85 | /* bit 1 = ? maybe IRQ acknowledge */ |
| 86 | 86 | } |
| 87 | 87 |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | */ |
| 58 | 58 | |
| 59 | 59 | #include "driver.h" |
| 60 | #include "cpu/i386/i386.h" | |
| 60 | 61 | |
| 61 | 62 | static VIDEO_START(comebaby) |
| 62 | 63 | { |
| r3957 | r3958 | |
|---|---|---|
| 492 | 492 | ***************************************************************************/ |
| 493 | 493 | |
| 494 | 494 | #include "driver.h" |
| 495 | #include "cpu/m6809/m6809.h" | |
| 496 | #include "cpu/m6800/m6800.h" | |
| 495 | 497 | #include "machine/6821pia.h" |
| 496 | 498 | #include "audio/williams.h" |
| 497 | 499 | #include "williams.h" |
| r3957 | r3958 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | #include "driver.h" |
| 161 | #include "cpu/z80/z80.h" | |
| 162 | #include "cpu/m68000/m68000.h" | |
| 161 | 163 | #include "sound/262intf.h" |
| 162 | 164 | #include "sound/ymf278b.h" |
| 163 | 165 |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | ***************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "cpu/hd6309/hd6309.h" | |
| 41 | 42 | #include "cpu/m6809/m6809.h" |
| 42 | 43 | #include "cpu/m6502/m6502.h" |
| 43 | 44 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 367 | 368 | |
| 368 | 369 | if (data&1) int_enable=1; else int_enable=0; |
| 369 | 370 | if (data&2) nmi_enable=1; else nmi_enable=0; |
| 370 | flip_screen_set(data & 0x08); | |
| 371 | flip_screen_set(space->machine, data & 0x08); | |
| 371 | 372 | } |
| 372 | 373 | |
| 373 | 374 | static WRITE8_HANDLER( csilver_control_w ) |
| r3957 | r3958 | |
| 493 | 494 | |
| 494 | 495 | static READ8_HANDLER( shackled_sprite_r ) { return spriteram[offset]; } |
| 495 | 496 | static WRITE8_HANDLER( shackled_sprite_w ) { spriteram[offset]=data; } |
| 496 | static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(data); } | |
| 497 | static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(space->machine, data); } | |
| 497 | 498 | |
| 498 | 499 | /******************************************************************************/ |
| 499 | 500 | |
| r3957 | r3958 | |
| 2222 | 2223 | MDRV_CPU_ADD("audio", M6502, XTAL_12MHz/8) |
| 2223 | 2224 | MDRV_CPU_PROGRAM_MAP(dec8_s_readmem,oscar_s_writemem) |
| 2224 | 2225 | /* NMIs are caused by the main CPU */ |
| 2225 | MDRV_ | |
| 2226 | MDRV_QUANTUM_TIME | |
| 2226 | 2227 | |
| 2227 | 2228 | /* video hardware */ |
| 2228 | 2229 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
| 2266 | 2267 | MDRV_CPU_ADD("audio", M6502, 1500000) |
| 2267 | 2268 | MDRV_CPU_PROGRAM_MAP(ym3526_s_readmem,ym3526_s_writemem) |
| 2268 | 2269 | /* NMIs are caused by the main CPU */ |
| 2269 | MDRV_ | |
| 2270 | MDRV_QUANTUM_TIME | |
| 2270 | 2271 | |
| 2271 | 2272 | /* video hardware */ |
| 2272 | 2273 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
| 2310 | 2311 | MDRV_CPU_ADD("audio", M6502, 1500000) |
| 2311 | 2312 | MDRV_CPU_PROGRAM_MAP(ym3526_s_readmem,ym3526_s_writemem) |
| 2312 | 2313 | /* NMIs are caused by the main CPU */ |
| 2313 | MDRV_ | |
| 2314 | MDRV_QUANTUM_TIME | |
| 2314 | 2315 | |
| 2315 | 2316 | /* video hardware */ |
| 2316 | 2317 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
| 2355 | 2356 | MDRV_CPU_ADD("audio", M6502, XTAL_12MHz/8) /* verified on pcb */ |
| 2356 | 2357 | MDRV_CPU_PROGRAM_MAP(csilver_s_readmem,csilver_s_writemem) |
| 2357 | 2358 | /* NMIs are caused by the main CPU */ |
| 2358 | MDRV_ | |
| 2359 | MDRV_QUANTUM_TIME | |
| 2359 | 2360 | |
| 2360 | 2361 | /* video hardware */ |
| 2361 | 2362 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r3957 | r3958 | |
|---|---|---|
| 493 | 493 | MDRV_CPU_ADD("audio", Z80, 4000000) /* Actual Z80 */ |
| 494 | 494 | MDRV_CPU_PROGRAM_MAP(6206A_map,0) |
| 495 | 495 | |
| 496 | MDRV_ | |
| 496 | MDRV_QUANTUM_TIME | |
| 497 | 497 | |
| 498 | 498 | /* video hardware */ |
| 499 | 499 | MDRV_GFXDECODE(tbowl) |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | 0x01 = Y Scroll MSB |
| 47 | 47 | */ |
| 48 | 48 | |
| 49 | flip_screen_set(data & 0x80); | |
| 49 | flip_screen_set(space->machine, data & 0x80); | |
| 50 | 50 | |
| 51 | 51 | /* |
| 52 | 52 | I think that the NMI is an inhibitor. It is constantly set |
| r3957 | r3958 | |
| 262 | 262 | MDRV_CPU_ADD("sub", M6809, 1250000) /* 1.25 MHz ? */ |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(battlane_map, 0) |
| 264 | 264 | |
| 265 | MDRV_ | |
| 265 | MDRV_QUANTUM_TIME | |
| 266 | 266 | |
| 267 | 267 | /* video hardware */ |
| 268 | 268 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "cpu/z80/z80.h" | |
| 28 | 29 | #include "sound/ay8910.h" |
| 29 | 30 | /* video */ |
| 30 | 31 |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | */ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/m68000/m68000.h" | |
| 53 | 54 | #include "sound/okim6295.h" |
| 54 | 55 | #include "machine/eeprom.h" |
| 55 | 56 |
| r3957 | r3958 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | **********************************************************************/ |
| 111 | 111 | #include "driver.h" |
| 112 | #include "cpu/z80/z80.h" | |
| 113 | #include "cpu/m68000/m68000.h" | |
| 112 | 114 | #include "deprecat.h" |
| 113 | 115 | #include "sound/dac.h" |
| 114 | 116 | #include "sound/okim6295.h" |
| r3957 | r3958 | |
| 286 | 288 | static WRITE16_HANDLER( io_w ) |
| 287 | 289 | { |
| 288 | 290 | COMBINE_DATA(&vreg); |
| 289 | flip_screen_set(vreg & 0x1000); | |
| 291 | flip_screen_set(space->machine, vreg & 0x1000); | |
| 290 | 292 | } |
| 291 | 293 | |
| 292 | 294 | static int read_latch=0; |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/z80/z80.h" | |
| 16 | #include "cpu/m68000/m68000.h" | |
| 15 | 17 | #include "genesis.h" |
| 16 | 18 | |
| 17 | 19 | #define MASTER_CLOCK 53693100 |
| r3957 | r3958 | |
| 148 | 150 | MACHINE_RESET( genesis ) |
| 149 | 151 | { |
| 150 | 152 | /* C2 doesn't have a Z80, so we can't just assume */ |
| 151 | if (machine->c | |
| 153 | if (machine->c | |
| 152 | 154 | { |
| 153 | 155 | /* the following ensures that the Z80 begins without running away from 0 */ |
| 154 | 156 | /* 0x76 is just a forced 'halt' as soon as the CPU is initially run */ |
| r3957 | r3958 | |
| 651 | 653 | MDRV_CPU_PROGRAM_MAP(genesis_z80_readmem, genesis_z80_writemem) |
| 652 | 654 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* from vdp at scanline 0xe0 */ |
| 653 | 655 | |
| 654 | MDRV_ | |
| 656 | MDRV_QUANTUM_TIME | |
| 655 | 657 | |
| 656 | 658 | MDRV_MACHINE_START(genesis) |
| 657 | 659 | MDRV_MACHINE_RESET(genesis) |
| r3957 | r3958 | |
|---|---|---|
| 115 | 115 | ***************************************************************************/ |
| 116 | 116 | |
| 117 | 117 | #include "driver.h" |
| 118 | #include "cpu/z80/z80.h" | |
| 118 | 119 | #include "sound/ay8910.h" |
| 119 | 120 | |
| 120 | 121 |
| r3957 | r3958 | |
|---|---|---|
| 61 | 61 | */ |
| 62 | 62 | |
| 63 | 63 | #include "driver.h" |
| 64 | #include "cpu/z80/z80.h" | |
| 64 | 65 | #include "sound/ay8910.h" |
| 65 | 66 | |
| 66 | 67 | static tilemap *bg_tilemap; |
| r3957 | r3958 | |
|---|---|---|
| 91 | 91 | ***************************************************************************/ |
| 92 | 92 | |
| 93 | 93 | #include "driver.h" |
| 94 | #include "cpu/m6502/m6502.h" | |
| 94 | 95 | #include "sound/pokey.h" |
| 95 | 96 | #include "cloud9.h" |
| 96 | 97 |
| r3957 | r3958 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | #include "driver.h" |
| 108 | #include "cpu/z80/z80.h" | |
| 109 | #include "cpu/m68000/m68000.h" | |
| 108 | 110 | #include "cpu/m6809/m6809.h" |
| 109 | 111 | #include "sound/2151intf.h" |
| 110 | 112 | #include "sound/upd7759.h" |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/z80/z80.h" | |
| 15 | 16 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 16 | 17 | #include "video/konamiic.h" |
| 17 | 18 | #include "sound/2151intf.h" |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | */ |
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | #include "cpu/m68000/m68000.h" | |
| 84 | 85 | #include "deprecat.h" |
| 85 | 86 | #include "machine/eeprom.h" |
| 86 | 87 |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "cpu/i8085/i8085.h" | |
| 9 | 10 | #include "deprecat.h" |
| 10 | 11 | |
| 11 | 12 |
| r3957 | r3958 | |
|---|---|---|
| 213 | 213 | ***************************************************************************/ |
| 214 | 214 | |
| 215 | 215 | #include "driver.h" |
| 216 | #include "cpu/z80/z80.h" | |
| 217 | #include "cpu/m68000/m68000.h" | |
| 216 | 218 | #include "taitoipt.h" |
| 217 | 219 | #include "video/taitoic.h" |
| 218 | 220 | #include "audio/taitosnd.h" |
| r3957 | r3958 | |
| 795 | 797 | MDRV_CPU_ADD("audio", Z80,4000000) /* sound CPU, also required for test mode */ |
| 796 | 798 | MDRV_CPU_PROGRAM_MAP(bonzeadv_z80_map,0) |
| 797 | 799 | |
| 798 | MDRV_ | |
| 800 | MDRV_QUANTUM_TIME | |
| 799 | 801 | |
| 800 | 802 | /* video hardware */ |
| 801 | 803 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 834 | 836 | MDRV_CPU_ADD("audio", Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 835 | 837 | MDRV_CPU_PROGRAM_MAP(z80_map,0) |
| 836 | 838 | |
| 837 | MDRV_ | |
| 839 | MDRV_QUANTUM_TIME | |
| 838 | 840 | |
| 839 | 841 | /* video hardware */ |
| 840 | 842 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 876 | 878 | MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 877 | 879 | MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0) |
| 878 | 880 | |
| 879 | MDRV_ | |
| 881 | MDRV_QUANTUM_TIME | |
| 880 | 882 | |
| 881 | 883 | /* video hardware */ |
| 882 | 884 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 914 | 916 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz ??? */ |
| 915 | 917 | MDRV_CPU_PROGRAM_MAP(z80_map,0) |
| 916 | 918 | |
| 917 | MDRV_ | |
| 919 | MDRV_QUANTUM_TIME | |
| 918 | 920 | |
| 919 | 921 | /* video hardware */ |
| 920 | 922 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 956 | 958 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz ??? */ |
| 957 | 959 | MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0) |
| 958 | 960 | |
| 959 | MDRV_ | |
| 961 | MDRV_QUANTUM_TIME | |
| 960 | 962 | |
| 961 | 963 | /* video hardware */ |
| 962 | 964 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 994 | 996 | MDRV_CPU_ADD("audio", Z80, 4000000) /* 4 MHz ??? */ |
| 995 | 997 | MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0) |
| 996 | 998 | |
| 997 | MDRV_ | |
| 999 | MDRV_QUANTUM_TIME | |
| 998 | 1000 | |
| 999 | 1001 | /* video hardware */ |
| 1000 | 1002 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/m6800/m6800.h" | |
| 14 | 15 | #include "triplhnt.h" |
| 15 | 16 | |
| 16 | 17 | static UINT8 triplhnt_cmos[16]; |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "cpu/z80/z80.h" | |
| 12 | 13 | #include "pooyan.h" |
| 13 | 14 | #include "audio/timeplt.h" |
| 14 | 15 |
| r3957 | r3958 | |
|---|---|---|
| 91 | 91 | { |
| 92 | 92 | int offs; |
| 93 | 93 | |
| 94 | flip_screen_set_no_update(1); | |
| 94 | flip_screen_set_no_update(machine, 1); | |
| 95 | 95 | |
| 96 | 96 | for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien |
| 97 | 97 | { |
| r3957 | r3958 | |
| 141 | 141 | inc = 1; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | if (flip_screen_x_get()) | |
| 144 | if (flip_screen_x_get(machine)) | |
| 145 | 145 | { |
| 146 | 146 | y=240-y; |
| 147 | 147 | x=304-x; |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ****************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m68000/m68000.h" | |
| 21 | 22 | #include "cpu/cubeqcpu/cubeqcpu.h" |
| 22 | 23 | #include "sound/dac.h" |
| 23 | 24 | #include "sound/custom.h" |
| r3957 | r3958 | |
| 504 | 505 | MDRV_CPU_PROGRAM_MAP(line_sound_map, 0) |
| 505 | 506 | MDRV_CPU_CONFIG(snd_config) |
| 506 | 507 | |
| 507 | MDRV_ | |
| 508 | MDRV_QUANTUM_TIME | |
| 508 | 509 | |
| 509 | 510 | MDRV_MACHINE_START(cubeqst) |
| 510 | 511 | MDRV_MACHINE_RESET(cubeqst) |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "cpu/z80/z80.h" | |
| 10 | 11 | #include "video/konamiic.h" |
| 11 | 12 | #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ |
| 12 | 13 | #include "machine/eeprom.h" |
| r3957 | r3958 | |
|---|---|---|
| 320 | 320 | MDRV_CPU_ADD("main", M6809, MASTER_CLOCK / 8) |
| 321 | 321 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 322 | 322 | MDRV_CPU_PERIODIC_INT(irq0_line_assert, (double)MASTER_CLOCK / 4096 / 12) |
| 323 | MDRV_WATCHDOG_TIME_INIT( | |
| 323 | MDRV_WATCHDOG_TIME_INIT( | |
| 324 | 324 | |
| 325 | 325 | MDRV_CPU_ADD("audio", M6809, MASTER_CLOCK / 8) |
| 326 | 326 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/m6502/m6502.h" | |
| 8 | 9 | #include "sound/s14001a.h" |
| 9 | 10 | |
| 10 | 11 | extern int wolfpack_collision; |
| r3957 | r3958 | |
|---|---|---|
| 88 | 88 | ---*/ |
| 89 | 89 | |
| 90 | 90 | #include "driver.h" |
| 91 | #include "cpu/m68000/m68000.h" | |
| 91 | 92 | #include "machine/eeprom.h" |
| 92 | 93 | #include "sound/okim6295.h" |
| 93 | 94 |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/z80/z80.h" | |
| 17 | 18 | #include "exerion.h" |
| 18 | 19 | #include "sound/ay8910.h" |
| 19 | 20 |
| r3957 | r3958 | |
|---|---|---|
| 256 | 256 | MDRV_CPU_PROGRAM_MAP(dallas_rom, 0) |
| 257 | 257 | MDRV_CPU_IO_MAP(dallas_ram, 0) |
| 258 | 258 | |
| 259 | MDRV_ | |
| 259 | MDRV_QUANTUM_TIME | |
| 260 | 260 | |
| 261 | 261 | /* video hardware */ |
| 262 | 262 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "cpu/z80/z80.h" | |
| 32 | #include "cpu/m68000/m68000.h" | |
| 33 | #include "cpu/mcs51/mcs51.h" | |
| 31 | 34 | #include "deprecat.h" |
| 32 | 35 | #include "machine/segaic16.h" |
| 33 | 36 | #include "system16.h" |
| r3957 | r3958 | |
| 202 | 205 | fd1094_machine_init(machine->cpu[0]); |
| 203 | 206 | |
| 204 | 207 | /* if we are running with a real live 8751, we need to boost the interleave at startup */ |
| 205 | if (machine->c | |
| 208 | if (machine->c | |
| 206 | 209 | timer_call_after_resynch(machine, NULL, 0, boost_interleave); |
| 207 | 210 | } |
| 208 | 211 |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | */ |
| 61 | 61 | #include "driver.h" |
| 62 | #include "cpu/z80/z80.h" | |
| 63 | #include "cpu/m68000/m68000.h" | |
| 62 | 64 | #include "deprecat.h" |
| 63 | 65 | #include "video/resnet.h" |
| 64 | 66 | #include "sound/ay8910.h" |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "cpu/m6502/m6502.h" | |
| 17 | 18 | #include "sound/ay8910.h" |
| 18 | 19 | |
| 19 | 20 | static UINT8 *ltcasino_tile_num_ram, *ltcasino_tile_atr_ram; |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "cpu/m68000/m68000.h" | |
| 15 | 16 | #include "machine/eeprom.h" |
| 16 | 17 | #include "sound/okim6295.h" |
| 17 | 18 |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "cpu/z80/z80.h" | |
| 33 | #include "cpu/m68000/m68000.h" | |
| 32 | 34 | #include "sound/okim6295.h" |
| 33 | 35 | #include "sound/3812intf.h" |
| 34 | 36 |
| r3957 | r3958 | |
|---|---|---|
| 85 | 85 | ****************************************************************************/ |
| 86 | 86 | |
| 87 | 87 | #include "driver.h" |
| 88 | #include "cpu/z80/z80.h" | |
| 88 | 89 | #include "deprecat.h" |
| 89 | 90 | #include "cpu/tlcs90/tlcs90.h" |
| 90 | 91 | #include "machine/msm6242.h" |
| r3957 | r3958 | |
| 308 | 309 | |
| 309 | 310 | static WRITE8_HANDLER( mjapinky_palbank_w ) |
| 310 | 311 | { |
| 311 | flip_screen_set(~data & 4); | |
| 312 | flip_screen_set(space->machine, ~data & 4); | |
| 312 | 313 | palette_base = (data >> 3) & 0x01; |
| 313 | 314 | coin_counter_w(0,data & 2); // in |
| 314 | 315 | coin_counter_w(1,data & 1); // out |
| r3957 | r3958 | |
| 533 | 534 | |
| 534 | 535 | static WRITE8_HANDLER( janptr96_coin_counter_w ) |
| 535 | 536 | { |
| 536 | flip_screen_set(~data & 4); | |
| 537 | flip_screen_set(space->machine, ~data & 4); | |
| 537 | 538 | coin_counter_w(0,data & 2); // in |
| 538 | 539 | coin_counter_w(1,data & 1); // out |
| 539 | 540 | } |
| r3957 | r3958 | |
| 562 | 563 | |
| 563 | 564 | static WRITE8_HANDLER( mjifb_coin_counter_w ) |
| 564 | 565 | { |
| 565 | flip_screen_set( data & 4); | |
| 566 | flip_screen_set(space->machine, data & 4); | |
| 566 | 567 | coin_counter_w(0,data & 2); // in |
| 567 | 568 | coin_counter_w(1,data & 1); // out |
| 568 | 569 | } |
| r3957 | r3958 | |
| 2325 | 2326 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 9, 255-8) |
| 2326 | 2327 | |
| 2327 | 2328 | /* devices */ |
| 2328 | MDRV_ | |
| 2329 | MDRV_MSM6242_ADD("rtc" | |
| 2329 | 2330 | MACHINE_DRIVER_END |
| 2330 | 2331 | |
| 2331 | 2332 | |
| r3957 | r3958 | |
| 2373 | 2374 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
| 2374 | 2375 | |
| 2375 | 2376 | /* devices */ |
| 2376 | MDRV_ | |
| 2377 | MDRV_MSM6242_ADD("rtc" | |
| 2377 | 2378 | MACHINE_DRIVER_END |
| 2378 | 2379 | |
| 2379 | 2380 | static MACHINE_DRIVER_START( cafetime ) |
| r3957 | r3958 | |
| 2387 | 2388 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
| 2388 | 2389 | |
| 2389 | 2390 | /* devices */ |
| 2390 | MDRV_ | |
| 2391 | MDRV_MSM6242_ADD("rtc" | |
| 2391 | 2392 | MACHINE_DRIVER_END |
| 2392 | 2393 | |
| 2393 | 2394 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "cpu/m6502/m6502.h" | |
| 21 | 22 | #include "deprecat.h" |
| 22 | 23 | #include "subs.h" |
| 23 | 24 | #include "sound/discrete.h" |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | */ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "cpu/sh2/sh2.h" | |
| 54 | #include "cpu/m68000/m68000.h" | |
| 53 | 55 | #include "deprecat.h" |
| 54 | 56 | #include "sound/scsp.h" |
| 55 | 57 |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "cpu/z80/z80.h" | |
| 27 | 28 | #include "deprecat.h" |
| 28 | 29 | #include "audio/t5182.h" |
| 29 | 30 |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "cpu/z80/z80.h" | |
| 15 | #include "cpu/m6809/m6809.h" | |
| 16 | #include "cpu/konami/konami.h" | |
| 14 | 17 | #include "video/konamiic.h" |
| 15 | 18 | #include "sound/2151intf.h" |
| 16 | 19 | #include "sound/k007232.h" |
| r3957 | r3958 | |
| 236 | 239 | MDRV_CPU_ADD("audio", Z80, 3579545) /* 3.58 MHz */ |
| 237 | 240 | MDRV_CPU_PROGRAM_MAP(ajax_sound_map,0) |
| 238 | 241 | |
| 239 | MDRV_ | |
| 242 | MDRV_QUANTUM_TIME | |
| 240 | 243 | |
| 241 | 244 | MDRV_MACHINE_RESET(ajax) |
| 242 | 245 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "cpu/m68000/m68000.h" | |
| 11 | 12 | #include "includes/amiga.h" |
| 12 | 13 | #include "sound/es5503.h" |
| 13 | 14 | #include "machine/6526cia.h" |
| r3957 | r3958 | |
| 351 | 352 | static const cia6526_interface cia_0_intf = |
| 352 | 353 | { |
| 353 | 354 | amiga_cia_0_irq, /* irq_func */ |
| 354 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 355 | 355 | 0, /* tod_clock */ |
| 356 | 356 | { |
| 357 | 357 | { mquake_cia_0_porta_r, mquake_cia_0_porta_w }, /* port A */ |
| r3957 | r3958 | |
| 362 | 362 | static const cia6526_interface cia_1_intf = |
| 363 | 363 | { |
| 364 | 364 | amiga_cia_1_irq, /* irq_func */ |
| 365 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 366 | 365 | 0, /* tod_clock */ |
| 367 | 366 | { |
| 368 | 367 | { NULL, NULL }, /* port A */ |
| r3957 | r3958 | |
| 413 | 412 | MDRV_SOUND_ROUTE(1, "right", 0.50) |
| 414 | 413 | |
| 415 | 414 | /* cia */ |
| 416 | MDRV_DEVICE_ADD("cia_0", CIA8520) | |
| 417 | MDRV_DEVICE_CONFIG(cia_0_intf) | |
| 418 | MDRV_DEVICE_ADD("cia_1", CIA8520) | |
| 419 | MDRV_DEVICE_CONFIG(cia_1_intf) | |
| 415 | MDRV_CIA8520_ADD("cia_0", AMIGA_68000_NTSC_CLOCK / 10, cia_0_intf) | |
| 416 | MDRV_CIA8520_ADD("cia_1", AMIGA_68000_NTSC_CLOCK / 10, cia_1_intf) | |
| 420 | 417 | MACHINE_DRIVER_END |
| 421 | 418 | |
| 422 | 419 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "cpu/z80/z80.h" | |
| 52 | 53 | #include "sound/okim6295.h" |
| 53 | 54 | |
| 54 | 55 | /* video/funybubl.c */ |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | if (video_screen_get_vblank(device->machine->primary_screen)) |
| 32 | 32 | cpu_set_input_line(device, I8085_RST55_LINE, HOLD_LINE); |
| 33 | 33 | else |
| 34 | cpu_set_input_line(device, I8085_RST75_LINE, HOLD_LINE); | |
| 35 | ||
| 34 | { | |
| 35 | cpu_set_input_line(device, I8085_RST75_LINE, ASSERT_LINE); | |
| 36 | cpu_set_input_line(device, I8085_RST75_LINE, CLEAR_LINE); | |
| 37 | } | |
| 36 | 38 | } |
| 37 | 39 | |
| 38 | 40 |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | #include "driver.h" |
| 9 | #include "cpu/z80/z80.h" | |
| 9 | 10 | #include "deprecat.h" |
| 10 | 11 | #include "audio/m72.h" |
| 11 | 12 | #include "sound/dac.h" |
| r3957 | r3958 | |
|---|---|---|
| 152 | 152 | ********************************************************************/ |
| 153 | 153 | |
| 154 | 154 | #include "driver.h" |
| 155 | #include "cpu/z80/z80.h" | |
| 156 | #include "cpu/tlcs90/tlcs90.h" | |
| 157 | #include "cpu/m68000/m68000.h" | |
| 155 | 158 | #include "deprecat.h" |
| 156 | 159 | #include "audio/seibu.h" |
| 157 | 160 | #include "sound/2203intf.h" |
| r3957 | r3958 | |
| 4630 | 4633 | static WRITE16_HANDLER( twinactn_flipscreen_w ) |
| 4631 | 4634 | { |
| 4632 | 4635 | if (ACCESSING_BITS_0_7) |
| 4633 | flip_screen_set(data & 1); | |
| 4636 | flip_screen_set(space->machine, data & 1); | |
| 4634 | 4637 | |
| 4635 | 4638 | if (data & (~1)) |
| 4636 | 4639 | logerror("%06x: unknown flip screen bit written %04x\n", cpu_get_pc(space->cpu), data); |
| r3957 | r3958 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | ***************************************************************************/ |
| 113 | 113 | #include "driver.h" |
| 114 | #include "cpu/m6502/m6502.h" | |
| 114 | 115 | #include "machine/rescap.h" |
| 115 | 116 | #include "sound/samples.h" |
| 116 | 117 | #include "machine/74123.h" |
| r3957 | r3958 | |
| 833 | 834 | |
| 834 | 835 | /* 74LS123 */ |
| 835 | 836 | |
| 836 | MDRV_DEVICE_ADD("ic8j1", TTL74123) | |
| 837 | MDRV_DEVICE_CONFIG(ic8j1_intf) | |
| 838 | MDRV_DEVICE_ADD("ic8j2", TTL74123) | |
| 839 | MDRV_DEVICE_CONFIG(ic8j2_intf) | |
| 837 | MDRV_TTL74123_ADD("ic8j1", ic8j1_intf) | |
| 838 | MDRV_TTL74123_ADD("ic8j2", ic8j2_intf) | |
| 840 | 839 | |
| 841 | 840 | /* sound hardware */ |
| 842 | 841 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 124 | 124 | #define MASTER_CLOCK 10000000 /* 10MHz */ |
| 125 | 125 | |
| 126 | 126 | #include "driver.h" |
| 127 | #include "cpu/m6502/m6502.h" | |
| 127 | 128 | #include "video/mc6845.h" |
| 128 | 129 | |
| 129 | 130 | |
| r3957 | r3958 | |
| 273 | 274 | MDRV_VIDEO_START(miniboy7) |
| 274 | 275 | MDRV_VIDEO_UPDATE(miniboy7) |
| 275 | 276 | |
| 276 | MDRV_ | |
| 277 | MDRV_M | |
| 277 | 278 | MACHINE_DRIVER_END |
| 278 | 279 | |
| 279 | 280 |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | ***************************************************************************/ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "cpu/m6502/m6502.h" | |
| 38 | 39 | #include "machine/rescap.h" |
| 39 | 40 | #include "sound/discrete.h" |
| 40 | 41 | #include "nitedrvr.h" |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | // MAME headers |
| 15 | 15 | #include "osdepend.h" |
| 16 | 16 | #include "driver.h" |
| 17 | #include "deprecat.h" | |
| 18 | 17 | |
| 19 | 18 | // MAMEOS headers |
| 20 | 19 | #include "output.h" |
| r3957 | r3958 | |
| 111 | 110 | NULL); |
| 112 | 111 | assert(output_hwnd != NULL); |
| 113 | 112 | |
| 113 | // set a pointer to the running machine | |
| 114 | SetWindowLongPtr(output_hwnd, GWLP_USERDATA, (LONG_PTR)machine); | |
| 115 | ||
| 114 | 116 | // allocate message ids |
| 115 | 117 | om_mame_start = RegisterWindowMessage(OM_MAME_START); |
| 116 | 118 | assert(om_mame_start != 0); |
| r3957 | r3958 | |
| 187 | 189 | |
| 188 | 190 | static LRESULT CALLBACK output_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) |
| 189 | 191 | { |
| 192 | LONG_PTR ptr = GetWindowLongPtr(wnd, GWLP_USERDATA); | |
| 193 | running_machine *machine = (running_machine *)ptr; | |
| 194 | ||
| 190 | 195 | // register a new client |
| 191 | 196 | if (message == om_mame_register_client) |
| 192 | 197 | return register_client((HWND)wparam, lparam); |
| r3957 | r3958 | |
| 197 | 202 | |
| 198 | 203 | // get a string for an ID |
| 199 | 204 | else if (message == om_mame_get_id_string) |
| 200 | return send_id_string( | |
| 205 | return send_id_string(machine, (HWND)wparam, lparam); | |
| 201 | 206 | |
| 202 | 207 | else |
| 203 | 208 | return DefWindowProc(wnd, message, wparam, lparam); |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | #include "osdepend.h" |
| 30 | 30 | #include "driver.h" |
| 31 | 31 | #include "ui.h" |
| 32 | #include "deprecat.h" | |
| 33 | 32 | |
| 34 | 33 | // MAMEOS headers |
| 35 | 34 | #include "winmain.h" |
| r3957 | r3958 | |
| 145 | 144 | void (*poll)(device_info *info); |
| 146 | 145 | |
| 147 | 146 | // MAME information |
| 147 | running_machine * machine; | |
| 148 | 148 | input_device * device; |
| 149 | 149 | |
| 150 | 150 | // device state |
| r3957 | r3958 | |
| 226 | 226 | static void device_list_reset_devices(device_info *devlist_head); |
| 227 | 227 | |
| 228 | 228 | // generic device management |
| 229 | static device_info *generic_device_alloc(device_info **devlist_head_ptr, const TCHAR *name); | |
| 229 | static device_info *generic_device_alloc(running_machine *machine, device_info **devlist_head_ptr, const TCHAR *name); | |
| 230 | 230 | static void generic_device_free(device_info *devinfo); |
| 231 | 231 | static int generic_device_index(device_info *devlist_head, device_info *devinfo); |
| 232 | 232 | static void generic_device_reset(device_info *devinfo); |
| r3957 | r3958 | |
| 243 | 243 | static void dinput_init(running_machine *machine); |
| 244 | 244 | static void dinput_exit(running_machine *machine); |
| 245 | 245 | static HRESULT dinput_set_dword_property(LPDIRECTINPUTDEVICE device, REFGUID property_guid, DWORD object, DWORD how, DWORD value); |
| 246 | static device_info *dinput_device_create(device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level); | |
| 246 | static device_info *dinput_device_create(running_machine *machine, device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level); | |
| 247 | 247 | static void dinput_device_release(device_info *devinfo); |
| 248 | 248 | static const char *dinput_device_item_name(device_info *devinfo, int offset, const TCHAR *defstring, const TCHAR *suffix); |
| 249 | 249 | static HRESULT dinput_device_poll(device_info *devinfo); |
| r3957 | r3958 | |
| 258 | 258 | // RawInput-specific code |
| 259 | 259 | static void rawinput_init(running_machine *machine); |
| 260 | 260 | static void rawinput_exit(running_machine *machine); |
| 261 | static device_info *rawinput_device_create(device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device); | |
| 261 | static device_info *rawinput_device_create(running_machine *machine, device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device); | |
| 262 | 262 | static void rawinput_device_release(device_info *info); |
| 263 | 263 | static TCHAR *rawinput_device_improve_name(TCHAR *name); |
| 264 | static void rawinput_keyboard_enum(PRAWINPUTDEVICELIST device); | |
| 264 | static void rawinput_keyboard_enum(running_machine *machine, PRAWINPUTDEVICELIST device); | |
| 265 | 265 | static void rawinput_keyboard_update(HANDLE device, RAWKEYBOARD *data); |
| 266 | static void rawinput_mouse_enum(PRAWINPUTDEVICELIST device); | |
| 266 | static void rawinput_mouse_enum(running_machine *machine, PRAWINPUTDEVICELIST device); | |
| 267 | 267 | static void rawinput_mouse_update(HANDLE device, RAWMOUSE *data); |
| 268 | 268 | static void rawinput_mouse_poll(device_info *devinfo); |
| 269 | 269 | |
| r3957 | r3958 | |
| 742 | 742 | |
| 743 | 743 | #ifdef MESS |
| 744 | 744 | case IPT_OSD_2: |
| 745 | if (ui_mess_use_new_ui( | |
| 745 | if (ui_mess_use_new_ui( | |
| 746 | 746 | { |
| 747 | 747 | typedesc->token = "TOGGLE_MENUBAR"; |
| 748 | 748 | typedesc->name = "Toggle Menubar"; |
| r3957 | r3958 | |
| 789 | 789 | // generic_device_alloc |
| 790 | 790 | //============================================================ |
| 791 | 791 | |
| 792 | static device_info *generic_device_alloc(device_info **devlist_head_ptr, const TCHAR *name) | |
| 792 | static device_info *generic_device_alloc(running_machine *machine, device_info **devlist_head_ptr, const TCHAR *name) | |
| 793 | 793 | { |
| 794 | 794 | device_info **curdev_ptr; |
| 795 | 795 | device_info *devinfo; |
| r3957 | r3958 | |
| 798 | 798 | devinfo = malloc_or_die(sizeof(*devinfo)); |
| 799 | 799 | memset(devinfo, 0, sizeof(*devinfo)); |
| 800 | 800 | devinfo->head = devlist_head_ptr; |
| 801 | devinfo->machine = machine; | |
| 801 | 802 | |
| 802 | 803 | // allocate a UTF8 copy of the name |
| 803 | 804 | devinfo->name = utf8_from_tstring(name); |
| r3957 | r3958 | |
| 889 | 890 | |
| 890 | 891 | static INT32 generic_button_get_state(void *device_internal, void *item_internal) |
| 891 | 892 | { |
| 893 | device_info *devinfo = device_internal; | |
| 892 | 894 | BYTE *itemdata = item_internal; |
| 893 | 895 | |
| 894 | 896 | // return the current state |
| 895 | poll_if_necessary( | |
| 897 | poll_if_necessary(devinfo->machine); | |
| 896 | 898 | return *itemdata >> 7; |
| 897 | 899 | } |
| 898 | 900 | |
| r3957 | r3958 | |
| 903 | 905 | |
| 904 | 906 | static INT32 generic_axis_get_state(void *device_internal, void *item_internal) |
| 905 | 907 | { |
| 908 | device_info *devinfo = device_internal; | |
| 906 | 909 | LONG *axisdata = item_internal; |
| 907 | 910 | |
| 908 | 911 | // return the current state |
| 909 | poll_if_necessary( | |
| 912 | poll_if_necessary(devinfo->machine); | |
| 910 | 913 | return *axisdata; |
| 911 | 914 | } |
| 912 | 915 | |
| r3957 | r3958 | |
| 934 | 937 | int axisnum, butnum; |
| 935 | 938 | |
| 936 | 939 | // allocate a device |
| 937 | devinfo = generic_device_alloc(&lightgun_list, gun_names[gunnum]); | |
| 940 | devinfo = generic_device_alloc(machine, &lightgun_list, gun_names[gunnum]); | |
| 938 | 941 | if (devinfo == NULL) |
| 939 | 942 | break; |
| 940 | 943 | |
| r3957 | r3958 | |
| 1098 | 1101 | if (keyboard_list == NULL) |
| 1099 | 1102 | { |
| 1100 | 1103 | // enumerate the ones we have |
| 1101 | result = IDirectInput_EnumDevices(dinput, didevtype_keyboard, dinput_keyboard_enum, | |
| 1104 | result = IDirectInput_EnumDevices(dinput, didevtype_keyboard, dinput_keyboard_enum, machine, DIEDFL_ATTACHEDONLY); | |
| 1102 | 1105 | if (result != DI_OK) |
| 1103 | 1106 | fatalerror("DirectInput: Unable to enumerate keyboards (result=%08X)\n", (UINT32)result); |
| 1104 | 1107 | } |
| r3957 | r3958 | |
| 1107 | 1110 | if (mouse_list == NULL) |
| 1108 | 1111 | { |
| 1109 | 1112 | // enumerate the ones we have |
| 1110 | result = IDirectInput_EnumDevices(dinput, didevtype_mouse, dinput_mouse_enum, | |
| 1113 | result = IDirectInput_EnumDevices(dinput, didevtype_mouse, dinput_mouse_enum, machine, DIEDFL_ATTACHEDONLY); | |
| 1111 | 1114 | if (result != DI_OK) |
| 1112 | 1115 | fatalerror("DirectInput: Unable to enumerate mice (result=%08X)\n", (UINT32)result); |
| 1113 | 1116 | } |
| 1114 | 1117 | |
| 1115 | 1118 | // initialize joystick devices |
| 1116 | result = IDirectInput_EnumDevices(dinput, didevtype_joystick, dinput_joystick_enum, | |
| 1119 | result = IDirectInput_EnumDevices(dinput, didevtype_joystick, dinput_joystick_enum, machine, DIEDFL_ATTACHEDONLY); | |
| 1117 | 1120 | if (result != DI_OK) |
| 1118 | 1121 | fatalerror("DirectInput: Unable to enumerate joysticks (result=%08X)\n", (UINT32)result); |
| 1119 | 1122 | } |
| r3957 | r3958 | |
| 1164 | 1167 | // dinput_device_create |
| 1165 | 1168 | //============================================================ |
| 1166 | 1169 | |
| 1167 | static device_info *dinput_device_create(device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level) | |
| 1170 | static device_info *dinput_device_create(running_machine *machine, device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level) | |
| 1168 | 1171 | { |
| 1169 | 1172 | device_info *devinfo; |
| 1170 | 1173 | HRESULT result; |
| 1171 | 1174 | |
| 1172 | 1175 | // allocate memory for the device object |
| 1173 | devinfo = generic_device_alloc(devlist_head_ptr, instance->tszInstanceName); | |
| 1176 | devinfo = generic_device_alloc(machine, devlist_head_ptr, instance->tszInstanceName); | |
| 1174 | 1177 | |
| 1175 | 1178 | // attempt to create a device |
| 1176 | 1179 | result = IDirectInput_CreateDevice(dinput, &instance->guidInstance, &devinfo->dinput.device, NULL); |
| r3957 | r3958 | |
| 1308 | 1311 | |
| 1309 | 1312 | static BOOL CALLBACK dinput_keyboard_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref) |
| 1310 | 1313 | { |
| 1314 | running_machine *machine = ref; | |
| 1311 | 1315 | device_info *devinfo; |
| 1312 | 1316 | int keynum; |
| 1313 | 1317 | |
| 1314 | 1318 | // allocate and link in a new device |
| 1315 | devinfo = dinput_device_create(&keyboard_list, instance, &c_dfDIKeyboard, NULL, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); | |
| 1319 | devinfo = dinput_device_create(machine, &keyboard_list, instance, &c_dfDIKeyboard, NULL, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); | |
| 1316 | 1320 | if (devinfo == NULL) |
| 1317 | 1321 | goto exit; |
| 1318 | 1322 | |
| 1319 | 1323 | // add the device |
| 1320 | devinfo->device = input_device_add( | |
| 1324 | devinfo->device = input_device_add(machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo); | |
| 1321 | 1325 | devinfo->poll = dinput_keyboard_poll; |
| 1322 | 1326 | |
| 1323 | 1327 | // populate it |
| r3957 | r3958 | |
| 1363 | 1367 | static BOOL CALLBACK dinput_mouse_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref) |
| 1364 | 1368 | { |
| 1365 | 1369 | device_info *devinfo, *guninfo = NULL; |
| 1370 | running_machine *machine = ref; | |
| 1366 | 1371 | int axisnum, butnum; |
| 1367 | 1372 | HRESULT result; |
| 1368 | 1373 | |
| 1369 | 1374 | // allocate and link in a new device |
| 1370 | devinfo = dinput_device_create(&mouse_list, instance, &c_dfDIMouse2, &c_dfDIMouse, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); | |
| 1375 | devinfo = dinput_device_create(machine, &mouse_list, instance, &c_dfDIMouse2, &c_dfDIMouse, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); | |
| 1371 | 1376 | if (devinfo == NULL) |
| 1372 | 1377 | goto exit; |
| 1373 | 1378 | |
| r3957 | r3958 | |
| 1375 | 1380 | // we only support a single gun in dinput mode, so only add one |
| 1376 | 1381 | if (!lightgun_shared_axis_mode && devinfo == mouse_list) |
| 1377 | 1382 | { |
| 1378 | guninfo = generic_device_alloc(&lightgun_list, instance->tszInstanceName); | |
| 1383 | guninfo = generic_device_alloc(machine, &lightgun_list, instance->tszInstanceName); | |
| 1379 | 1384 | if (guninfo == NULL) |
| 1380 | 1385 | goto exit; |
| 1381 | 1386 | } |
| r3957 | r3958 | |
| 1389 | 1394 | } |
| 1390 | 1395 | |
| 1391 | 1396 | // add the device |
| 1392 | devinfo->device = input_device_add( | |
| 1397 | devinfo->device = input_device_add(machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo); | |
| 1393 | 1398 | devinfo->poll = dinput_mouse_poll; |
| 1394 | 1399 | if (guninfo != NULL) |
| 1395 | 1400 | { |
| 1396 | guninfo->device = input_device_add( | |
| 1401 | guninfo->device = input_device_add(machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo); | |
| 1397 | 1402 | guninfo->poll = win32_lightgun_poll; |
| 1398 | 1403 | } |
| 1399 | 1404 | |
| r3957 | r3958 | |
| 1464 | 1469 | { |
| 1465 | 1470 | DWORD cooperative_level = (HAS_WINDOW_MENU ? DISCL_BACKGROUND : DISCL_FOREGROUND) | DISCL_EXCLUSIVE; |
| 1466 | 1471 | int axisnum, axiscount, povnum, butnum; |
| 1472 | running_machine *machine = ref; | |
| 1467 | 1473 | device_info *devinfo; |
| 1468 | 1474 | HRESULT result; |
| 1469 | 1475 | |
| 1470 | 1476 | // allocate and link in a new device |
| 1471 | devinfo = dinput_device_create(&joystick_list, instance, &c_dfDIJoystick, NULL, cooperative_level); | |
| 1477 | devinfo = dinput_device_create(machine, &joystick_list, instance, &c_dfDIJoystick, NULL, cooperative_level); | |
| 1472 | 1478 | if (devinfo == NULL) |
| 1473 | 1479 | goto exit; |
| 1474 | 1480 | |
| r3957 | r3958 | |
| 1493 | 1499 | devinfo->dinput.caps.dwButtons = MIN(devinfo->dinput.caps.dwButtons, 128); |
| 1494 | 1500 | |
| 1495 | 1501 | // add the device |
| 1496 | devinfo->device = input_device_add( | |
| 1502 | devinfo->device = input_device_add(machine, DEVICE_CLASS_JOYSTICK, devinfo->name, devinfo); | |
| 1497 | 1503 | devinfo->poll = dinput_joystick_poll; |
| 1498 | 1504 | |
| 1499 | 1505 | // populate the axes |
| r3957 | r3958 | |
| 1593 | 1599 | DWORD pov; |
| 1594 | 1600 | |
| 1595 | 1601 | // get the current state |
| 1596 | poll_if_necessary( | |
| 1602 | poll_if_necessary(devinfo->machine); | |
| 1597 | 1603 | pov = devinfo->joystick.state.rgdwPOV[povnum]; |
| 1598 | 1604 | |
| 1599 | 1605 | // if invalid, return 0 |
| r3957 | r3958 | |
| 1656 | 1662 | |
| 1657 | 1663 | // handle keyboards |
| 1658 | 1664 | if (device->dwType == RIM_TYPEKEYBOARD && !FORCE_DIRECTINPUT) |
| 1659 | rawinput_keyboard_enum(device); | |
| 1665 | rawinput_keyboard_enum(machine, device); | |
| 1660 | 1666 | |
| 1661 | 1667 | // handle mice |
| 1662 | 1668 | else if (device->dwType == RIM_TYPEMOUSE && !FORCE_DIRECTINPUT) |
| 1663 | rawinput_mouse_enum(device); | |
| 1669 | rawinput_mouse_enum(machine, device); | |
| 1664 | 1670 | } |
| 1665 | 1671 | |
| 1666 | 1672 | // finally, register to recieve raw input WM_INPUT messages |
| r3957 | r3958 | |
| 1716 | 1722 | // rawinput_device_create |
| 1717 | 1723 | //============================================================ |
| 1718 | 1724 | |
| 1719 | static device_info *rawinput_device_create(device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device) | |
| 1725 | static device_info *rawinput_device_create(running_machine *machine, device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device) | |
| 1720 | 1726 | { |
| 1721 | 1727 | device_info *devinfo = NULL; |
| 1722 | 1728 | TCHAR *tname = NULL; |
| r3957 | r3958 | |
| 1735 | 1741 | |
| 1736 | 1742 | // improve the name and then allocate a device |
| 1737 | 1743 | tname = rawinput_device_improve_name(tname); |
| 1738 | devinfo = generic_device_alloc(devlist_head_ptr, tname); | |
| 1744 | devinfo = generic_device_alloc(machine, devlist_head_ptr, tname); | |
| 1739 | 1745 | free(tname); |
| 1740 | 1746 | |
| 1741 | 1747 | // copy the handle |
| r3957 | r3958 | |
| 1915 | 1921 | // rawinput_keyboard_enum |
| 1916 | 1922 | //============================================================ |
| 1917 | 1923 | |
| 1918 | static void rawinput_keyboard_enum(PRAWINPUTDEVICELIST device) | |
| 1924 | static void rawinput_keyboard_enum(running_machine *machine, PRAWINPUTDEVICELIST device) | |
| 1919 | 1925 | { |
| 1920 | 1926 | device_info *devinfo; |
| 1921 | 1927 | int keynum; |
| 1922 | 1928 | |
| 1923 | 1929 | // allocate and link in a new device |
| 1924 | devinfo = rawinput_device_create(&keyboard_list, device); | |
| 1930 | devinfo = rawinput_device_create(machine, &keyboard_list, device); | |
| 1925 | 1931 | if (devinfo == NULL) |
| 1926 | 1932 | return; |
| 1927 | 1933 | |
| 1928 | 1934 | // add the device |
| 1929 | devinfo->device = input_device_add( | |
| 1935 | devinfo->device = input_device_add(machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo); | |
| 1930 | 1936 | |
| 1931 | 1937 | // populate it |
| 1932 | 1938 | for (keynum = 0; keynum < MAX_KEYS; keynum++) |
| r3957 | r3958 | |
| 1980 | 1986 | // rawinput_mouse_enum |
| 1981 | 1987 | //============================================================ |
| 1982 | 1988 | |
| 1983 | static void rawinput_mouse_enum(PRAWINPUTDEVICELIST device) | |
| 1989 | static void rawinput_mouse_enum(running_machine *machine, PRAWINPUTDEVICELIST device) | |
| 1984 | 1990 | { |
| 1985 | 1991 | device_info *devinfo, *guninfo = NULL; |
| 1986 | 1992 | int axisnum, butnum; |
| 1987 | 1993 | |
| 1988 | 1994 | // allocate and link in a new mouse device |
| 1989 | devinfo = rawinput_device_create(&mouse_list, device); | |
| 1995 | devinfo = rawinput_device_create(machine, &mouse_list, device); | |
| 1990 | 1996 | if (devinfo == NULL) |
| 1991 | 1997 | return; |
| 1992 | 1998 | devinfo->poll = rawinput_mouse_poll; |
| r3957 | r3958 | |
| 1994 | 2000 | // allocate a second device for the gun (unless we are using the shared axis mode) |
| 1995 | 2001 | if (!lightgun_shared_axis_mode) |
| 1996 | 2002 | { |
| 1997 | guninfo = rawinput_device_create(&lightgun_list, device); | |
| 2003 | guninfo = rawinput_device_create(machine, &lightgun_list, device); | |
| 1998 | 2004 | assert(guninfo != NULL); |
| 1999 | 2005 | } |
| 2000 | 2006 | |
| 2001 | 2007 | // add the device |
| 2002 | devinfo->device = input_device_add( | |
| 2008 | devinfo->device = input_device_add(machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo); | |
| 2003 | 2009 | if (guninfo != NULL) |
| 2004 | 2010 | { |
| 2005 | guninfo->device = input_device_add( | |
| 2011 | guninfo->device = input_device_add(machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo); | |
| 2006 | 2012 | guninfo->poll = (guninfo == lightgun_list) ? win32_lightgun_poll : NULL; |
| 2007 | 2013 | guninfo->mouse.partner = &devinfo->mouse; |
| 2008 | 2014 | } |
| r3957 | r3958 | |
| 2094 | 2100 | |
| 2095 | 2101 | static void rawinput_mouse_poll(device_info *devinfo) |
| 2096 | 2102 | { |
| 2097 | poll_if_necessary( | |
| 2103 | poll_if_necessary(devinfo->machine); | |
| 2098 | 2104 | |
| 2099 | 2105 | // copy the accumulated raw state to the actual state |
| 2100 | 2106 | osd_lock_acquire(input_lock); |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | #include "strconv.h" |
| 35 | 35 | #include "winutf8.h" |
| 36 | 36 | #include "winutil.h" |
| 37 | #include "debug | |
| 37 | #include "debug | |
| 38 | 38 | |
| 39 | 39 | #define ENABLE_PROFILER 0 |
| 40 | 40 | #define DEBUG_SLOW_LOCKS 0 |
| r3957 | r3958 | |
| 455 | 455 | already_hit = 1; |
| 456 | 456 | |
| 457 | 457 | // flush any debugging traces that were live |
| 458 | { | |
| 459 | extern running_machine *Machine; | |
| 460 | if (Machine != NULL) | |
| 461 | debug_cpu_flush_traces(Machine); | |
| 462 | } | |
| 458 | debugger_flush_all_traces_on_abnormal_exit(); | |
| 463 | 459 | |
| 464 | 460 | // find our man |
| 465 | 461 | for (i = 0; exception_table[i].code != 0; i++) |
| r3957 | r3958 | |
|---|---|---|
| 2201 | 2201 | const address_space *space = disasm_view_get_current_subview(info->view[0].view)->space; |
| 2202 | 2202 | if (debug_cpu_get_visible_cpu(info->machine) == space->cpu) |
| 2203 | 2203 | { |
| 2204 | offs_t address = | |
| 2204 | offs_t address = | |
| 2205 | 2205 | sprintf(command, "go %X", address); |
| 2206 | 2206 | debug_console_execute_command(info->machine, command, 1); |
| 2207 | 2207 | } |
| r3957 | r3958 | |
| 2214 | 2214 | const address_space *space = disasm_view_get_current_subview(info->view[0].view)->space; |
| 2215 | 2215 | if (debug_cpu_get_visible_cpu(info->machine) == space->cpu) |
| 2216 | 2216 | { |
| 2217 | offs_t address = | |
| 2217 | offs_t address = | |
| 2218 | 2218 | cpu_debug_data *cpuinfo = cpu_get_debug_data(space->cpu); |
| 2219 | 2219 | debug_cpu_breakpoint *bp; |
| 2220 | 2220 | INT32 bpindex = -1; |
| r3957 | r3958 | |
|---|---|---|
| 872 | 872 | |
| 873 | 873 | void CreateCPUFolders(int parent_index) |
| 874 | 874 | { |
| 875 | // FIXME 0.128u7 | |
| 876 | #if 0 | |
| 875 | 877 | int i,jj; |
| 876 | 878 | int nGames = driver_list_get_count(drivers); |
| 877 | 879 | int nFolder = numFolders; |
| r3957 | r3958 | |
| 928 | 930 | } |
| 929 | 931 | machine_config_free(config); |
| 930 | 932 | } |
| 933 | #endif | |
| 931 | 934 | } |
| 932 | 935 | |
| 933 | 936 | void CreateSoundFolders(int parent_index) |
| r3957 | r3958 | |
|---|---|---|
| 602 | 602 | /* Build CPU info string */ |
| 603 | 603 | static char *GameInfoCPU(UINT nIndex) |
| 604 | 604 | { |
| 605 | int chipnum; | |
| 605 | //int chipnum; | |
| 606 | 606 | static char buf[1024] = ""; |
| 607 | 607 | machine_config *config = machine_config_alloc(drivers[nIndex]->machine_config); |
| 608 | 608 | |
| 609 | 609 | ZeroMemory(buf, sizeof(buf)); |
| 610 | 610 | |
| 611 | cpuintrf_init(NULL); | |
| 612 | ||
| 611 | // FIXME 0.128u7 | |
| 612 | #if 0 | |
| 613 | 613 | for (chipnum = 0; chipnum < ARRAY_LENGTH(config->cpu); chipnum++) |
| 614 | 614 | { |
| 615 | 615 | if (config->cpu[chipnum].type != CPU_DUMMY) |
| r3957 | r3958 | |
| 630 | 630 | strcat(buf, "\n"); |
| 631 | 631 | } |
| 632 | 632 | } |
| 633 | #endif | |
| 633 | 634 | /* Free the structure */ |
| 634 | 635 | machine_config_free(config); |
| 635 | ||
| 636 | 636 | return buf; |
| 637 | 637 | } |
| 638 | 638 |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | /*************************************************************************** |
| 82 | LOCAL VARIABLES | |
| 83 | ***************************************************************************/ | |
| 84 | ||
| 85 | ||
| 86 | ||
| 87 | /*************************************************************************** | |
| 88 | 82 | FUNCTION PROTOTYPES |
| 89 | 83 | ***************************************************************************/ |
| 90 | 84 | |
| r3957 | r3958 | |
| 160 | 154 | { |
| 161 | 155 | const device_config *first_screen = video_screen_first(machine->config); |
| 162 | 156 | debugcpu_private *global; |
| 163 | int cpunum, regnum; | |
| 157 | const device_config *cpu; | |
| 158 | int regnum; | |
| 164 | 159 | |
| 165 | 160 | /* allocate and reset globals */ |
| 166 | 161 | machine->debugcpu_data = global = auto_malloc(sizeof(*global)); |
| r3957 | r3958 | |
| 189 | 184 | } |
| 190 | 185 | |
| 191 | 186 | /* loop over CPUs and build up their info */ |
| 192 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 193 | if (machine->cpu[cpunum] != NULL) | |
| 194 | { | |
| 195 | const device_config *cpu = machine->cpu[cpunum]; | |
| 196 | cpu_class_header *classheader = cpu->classtoken; | |
| 197 | cpu_debug_data *info; | |
| 187 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 188 | { | |
| 189 | cpu_class_header *classheader = cpu_get_class_header(cpu); | |
| 190 | cpu_debug_data *info; | |
| 198 | 191 | |
| 199 | /* allocate some information */ | |
| 200 | info = auto_malloc(sizeof(*info)); | |
| 201 | memset(info, 0, sizeof(*info)); | |
| 202 | classheader->debug = info; | |
| 192 | /* allocate some information */ | |
| 193 | info = auto_malloc(sizeof(*info)); | |
| 194 | memset(info, 0, sizeof(*info)); | |
| 195 | classheader->debug = info; | |
| 203 | 196 | |
| 204 | /* reset the PC data */ | |
| 205 | info->flags = DEBUG_FLAG_OBSERVING | DEBUG_FLAG_HISTORY; | |
| 206 | info->device = machine->cpu[cpunum]; | |
| 207 | info->opwidth = cpu_get_min_opcode_bytes(info->device); | |
| 197 | /* reset the PC data */ | |
| 198 | info->flags = DEBUG_FLAG_OBSERVING | DEBUG_FLAG_HISTORY; | |
| 199 | info->device = cpu; | |
| 200 | info->opwidth = cpu_get_min_opcode_bytes(info->device); | |
| 208 | 201 | |
| 209 | /* fetch the memory accessors */ | |
| 210 | info->read = (cpu_read_func)cpu_get_info_fct(info->device, CPUINFO_PTR_READ); | |
| 211 | info->write = (cpu_write_func)cpu_get_info_fct(info->device, CPUINFO_PTR_WRITE); | |
| 212 | info->readop = (cpu_readop_func)cpu_get_info_fct(info->device, CPUINFO_PTR_READOP); | |
| 202 | /* fetch the memory accessors */ | |
| 203 | info->read = (cpu_read_func)device_get_info_fct(info->device, CPUINFO_FCT_READ); | |
| 204 | info->write = (cpu_write_func)device_get_info_fct(info->device, CPUINFO_FCT_WRITE); | |
| 205 | info->readop = (cpu_readop_func)device_get_info_fct(info->device, CPUINFO_FCT_READOP); | |
| 213 | 206 | |
| 214 | /* allocate a symbol table */ | |
| 215 | info->symtable = symtable_alloc(global->symtable, (void *)cpu); | |
| 207 | /* allocate a symbol table */ | |
| 208 | info->symtable = symtable_alloc(global->symtable, (void *)cpu); | |
| 216 | 209 | |
| 217 | /* add a global symbol for the current instruction pointer */ | |
| 218 | symtable_add_register(info->symtable, "curpc", NULL, get_current_pc, 0); | |
| 219 | symtable_add_register(info->symtable, "cycles", NULL, get_cycles, NULL); | |
| 220 | if (classheader->space[ADDRESS_SPACE_PROGRAM] != NULL) | |
| 221 | symtable_add_register(info->symtable, "logunmap", (void *)classheader->space[ADDRESS_SPACE_PROGRAM], get_logunmap, set_logunmap); | |
| 222 | if (classheader->space[ADDRESS_SPACE_DATA] != NULL) | |
| 223 | symtable_add_register(info->symtable, "logunmapd", (void *)classheader->space[ADDRESS_SPACE_DATA], get_logunmap, set_logunmap); | |
| 224 | if (classheader->space[ADDRESS_SPACE_IO] != NULL) | |
| 225 | symtable_add_register(info->symtable, "logunmapi", (void *)classheader->space[ADDRESS_SPACE_IO], get_logunmap, set_logunmap); | |
| 210 | /* add a global symbol for the current instruction pointer */ | |
| 211 | symtable_add_register(info->symtable, "cycles", NULL, get_cycles, NULL); | |
| 212 | if (classheader->space[ADDRESS_SPACE_PROGRAM] != NULL) | |
| 213 | symtable_add_register(info->symtable, "logunmap", (void *)classheader->space[ADDRESS_SPACE_PROGRAM], get_logunmap, set_logunmap); | |
| 214 | if (classheader->space[ADDRESS_SPACE_DATA] != NULL) | |
| 215 | symtable_add_register(info->symtable, "logunmapd", (void *)classheader->space[ADDRESS_SPACE_DATA], get_logunmap, set_logunmap); | |
| 216 | if (classheader->space[ADDRESS_SPACE_IO] != NULL) | |
| 217 | symtable_add_register(info->symtable, "logunmapi", (void *)classheader->space[ADDRESS_SPACE_IO], get_logunmap, set_logunmap); | |
| 226 | 218 | |
| 227 | /* add all registers into it */ | |
| 228 | for (regnum = 0; regnum < MAX_REGS; regnum++) | |
| 229 | { | |
| 230 | const char *str = cpu_get_reg_string(info->device, regnum); | |
| 231 | const char *colon; | |
| 232 | char symname[256]; | |
| 233 | int charnum; | |
| 219 | /* add all registers into it */ | |
| 220 | for (regnum = 0; regnum < MAX_REGS; regnum++) | |
| 221 | { | |
| 222 | const char *str = cpu_get_reg_string(info->device, regnum); | |
| 223 | const char *colon; | |
| 224 | char symname[256]; | |
| 225 | int charnum; | |
| 234 | 226 | |
| 235 | /* skip if we don't get a valid string, or one without a colon */ | |
| 236 | if (str == NULL) | |
| 237 | continue; | |
| 238 | if (str[0] == '~') | |
| 239 | str++; | |
| 240 | colon = strchr(str, ':'); | |
| 241 | if (colon == NULL) | |
| 242 | continue; | |
| 227 | /* skip if we don't get a valid string, or one without a colon */ | |
| 228 | if (str == NULL) | |
| 229 | continue; | |
| 230 | if (str[0] == '~') | |
| 231 | str++; | |
| 232 | colon = strchr(str, ':'); | |
| 233 | if (colon == NULL) | |
| 234 | continue; | |
| 243 | 235 | |
| 244 | /* strip all spaces from the name and convert to lowercase */ | |
| 245 | for (charnum = 0; charnum < sizeof(symname) - 1 && str < colon; str++) | |
| 246 | if (!isspace(*str)) | |
| 247 | symname[charnum++] = tolower(*str); | |
| 248 | symname[charnum] = 0; | |
| 236 | /* strip all spaces from the name and convert to lowercase */ | |
| 237 | for (charnum = 0; charnum < sizeof(symname) - 1 && str < colon; str++) | |
| 238 | if (!isspace(*str)) | |
| 239 | symname[charnum++] = tolower(*str); | |
| 240 | symname[charnum] = 0; | |
| 249 | 241 | |
| 250 | /* add the symbol to the table */ | |
| 251 | symtable_add_register(info->symtable, symname, (void *)(FPTR)regnum, get_cpu_reg, set_cpu_reg); | |
| 252 | } | |
| 242 | /* add the symbol to the table */ | |
| 243 | symtable_add_register(info->symtable, symname, (void *)(FPTR)regnum, get_cpu_reg, set_cpu_reg); | |
| 253 | 244 | } |
| 254 | 245 | |
| 246 | /* if no curpc, add one */ | |
| 247 | if (symtable_find(info->symtable, "curpc") == NULL) | |
| 248 | symtable_add_register(info->symtable, "curpc", NULL, get_current_pc, 0); | |
| 249 | } | |
| 250 | ||
| 255 | 251 | /* first CPU is visible by default */ |
| 256 | 252 | global->visiblecpu = machine->cpu[0]; |
| 257 | 253 | |
| r3957 | r3958 | |
| 271 | 267 | |
| 272 | 268 | void debug_cpu_flush_traces(running_machine *machine) |
| 273 | 269 | { |
| 274 | | |
| 270 | const device_config *cpu | |
| 275 | 271 | |
| 276 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 277 | if (machine->cpu[cpunum] != NULL) | |
| 278 | { | |
| 279 | cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 272 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 273 | { | |
| 274 | cpu_debug_data *info = cpu_get_debug_data(cpu); | |
| 280 | 275 | |
| 281 | /* this can be called on exit even when no debugging is enabled, so | |
| 282 | make sure the info is valid before proceeding */ | |
| 283 | if (info != NULL && info->trace.file != NULL) | |
| 284 | fflush(info->trace.file); | |
| 285 | } | |
| 276 | /* this can be called on exit even when no debugging is enabled, so | |
| 277 | make sure the info is valid before proceeding */ | |
| 278 | if (info != NULL && info->trace.file != NULL) | |
| 279 | fflush(info->trace.file); | |
| 280 | } | |
| 286 | 281 | } |
| 287 | 282 | |
| 288 | 283 | |
| r3957 | r3958 | |
| 321 | 316 | int debug_cpu_is_stopped(running_machine *machine) |
| 322 | 317 | { |
| 323 | 318 | debugcpu_private *global = machine->debugcpu_data; |
| 324 | return global->execution_state == EXECUTION_STATE_STOPPED; | |
| 319 | return (global != NULL) ? (global->execution_state == EXECUTION_STATE_STOPPED) : FALSE; | |
| 325 | 320 | } |
| 326 | 321 | |
| 327 | 322 | |
| r3957 | r3958 | |
| 923 | 918 | int debug_cpu_breakpoint_clear(running_machine *machine, int bpnum) |
| 924 | 919 | { |
| 925 | 920 | debug_cpu_breakpoint *bp, *pbp; |
| 926 | | |
| 921 | const device_config *cpu | |
| 927 | 922 | |
| 928 | 923 | /* loop over CPUs and find the requested breakpoint */ |
| 929 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 930 | if (machine->cpu[cpunum] != NULL) | |
| 931 | { | |
| 932 | cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 933 | for (pbp = NULL, bp = info->bplist; bp != NULL; pbp = bp, bp = bp->next) | |
| 934 | if (bp->index == bpnum) | |
| 935 | { | |
| 936 | /* unlink us from the list */ | |
| 937 | if (pbp == NULL) | |
| 938 | info->bplist = bp->next; | |
| 939 | else | |
| 940 | pbp->next = bp->next; | |
| 924 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 925 | { | |
| 926 | cpu_debug_data *info = cpu_get_debug_data(cpu); | |
| 927 | for (pbp = NULL, bp = info->bplist; bp != NULL; pbp = bp, bp = bp->next) | |
| 928 | if (bp->index == bpnum) | |
| 929 | { | |
| 930 | /* unlink us from the list */ | |
| 931 | if (pbp == NULL) | |
| 932 | info->bplist = bp->next; | |
| 933 | else | |
| 934 | pbp->next = bp->next; | |
| 941 | 935 | |
| 942 | /* free the memory */ | |
| 943 | if (bp->condition != NULL) | |
| 944 | expression_free(bp->condition); | |
| 945 | if (bp->action != NULL) | |
| 946 | free(bp->action); | |
| 947 | free(bp); | |
| 936 | /* free the memory */ | |
| 937 | if (bp->condition != NULL) | |
| 938 | expression_free(bp->condition); | |
| 939 | if (bp->action != NULL) | |
| 940 | free(bp->action); | |
| 941 | free(bp); | |
| 948 | 942 | |
| 949 | /* update the flags */ | |
| 950 | breakpoint_update_flags(info); | |
| 951 | return TRUE; | |
| 952 | } | |
| 953 | } | |
| 943 | /* update the flags */ | |
| 944 | breakpoint_update_flags(info); | |
| 945 | return TRUE; | |
| 946 | } | |
| 947 | } | |
| 954 | 948 | |
| 955 | 949 | /* we didn't find it; return an error */ |
| 956 | 950 | return FALSE; |
| r3957 | r3958 | |
| 965 | 959 | int debug_cpu_breakpoint_enable(running_machine *machine, int bpnum, int enable) |
| 966 | 960 | { |
| 967 | 961 | debug_cpu_breakpoint *bp; |
| 968 | | |
| 962 | const device_config *cpu | |
| 969 | 963 | |
| 970 | 964 | /* loop over CPUs and find the requested breakpoint */ |
| 971 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 972 | if (machine->cpu[cpunum] != NULL) | |
| 973 | { | |
| 974 | cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 975 | for (bp = info->bplist; bp != NULL; bp = bp->next) | |
| 976 | if (bp->index == bpnum) | |
| 977 | { | |
| 978 | bp->enabled = (enable != 0); | |
| 979 | breakpoint_update_flags(info); | |
| 980 | return TRUE; | |
| 981 | } | |
| 982 | } | |
| 965 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 966 | { | |
| 967 | cpu_debug_data *info = cpu_get_debug_data(cpu); | |
| 968 | for (bp = info->bplist; bp != NULL; bp = bp->next) | |
| 969 | if (bp->index == bpnum) | |
| 970 | { | |
| 971 | bp->enabled = (enable != 0); | |
| 972 | breakpoint_update_flags(info); | |
| 973 | return TRUE; | |
| 974 | } | |
| 975 | } | |
| 983 | 976 | |
| 984 | 977 | return FALSE; |
| 985 | 978 | } |
| r3957 | r3958 | |
| 1033 | 1026 | int debug_cpu_watchpoint_clear(running_machine *machine, int wpnum) |
| 1034 | 1027 | { |
| 1035 | 1028 | debug_cpu_watchpoint *wp, *pwp; |
| 1036 | int cpunum, spacenum; | |
| 1029 | const device_config *cpu; | |
| 1030 | int spacenum; | |
| 1037 | 1031 | |
| 1038 | 1032 | /* loop over CPUs and find the requested watchpoint */ |
| 1039 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1040 | if (machine->cpu[cpunum] != NULL) | |
| 1041 | { | |
| 1042 | cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1033 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1034 | { | |
| 1035 | cpu_debug_data *info = cpu_get_debug_data(cpu); | |
| 1043 | 1036 | |
| 1044 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1045 | for (pwp = NULL, wp = info->wplist[spacenum]; wp != NULL; pwp = wp, wp = wp->next) | |
| 1046 | if (wp->index == wpnum) | |
| 1047 | { | |
| 1048 | /* unlink us from the list */ | |
| 1049 | if (pwp == NULL) | |
| 1050 | info->wplist[spacenum] = wp->next; | |
| 1051 | else | |
| 1052 | pwp->next = wp->next; | |
| 1037 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1038 | for (pwp = NULL, wp = info->wplist[spacenum]; wp != NULL; pwp = wp, wp = wp->next) | |
| 1039 | if (wp->index == wpnum) | |
| 1040 | { | |
| 1041 | /* unlink us from the list */ | |
| 1042 | if (pwp == NULL) | |
| 1043 | info->wplist[spacenum] = wp->next; | |
| 1044 | else | |
| 1045 | pwp->next = wp->next; | |
| 1053 | 1046 | |
| 1054 | /* free the memory */ | |
| 1055 | if (wp->condition != NULL) | |
| 1056 | expression_free(wp->condition); | |
| 1057 | if (wp->action != NULL) | |
| 1058 | free(wp->action); | |
| 1059 | free(wp); | |
| 1047 | /* free the memory */ | |
| 1048 | if (wp->condition != NULL) | |
| 1049 | expression_free(wp->condition); | |
| 1050 | if (wp->action != NULL) | |
| 1051 | free(wp->action); | |
| 1052 | free(wp); | |
| 1060 | 1053 | |
| 1061 | watchpoint_update_flags(cpu_get_address_space(machine->cpu[cpunum], spacenum)); | |
| 1062 | return TRUE; | |
| 1063 | } | |
| 1054 | watchpoint_update_flags(cpu_get_address_space(cpu, spacenum)); | |
| 1055 | return TRUE; | |
| 1056 | } | |
| 1064 | 1057 | } |
| 1065 | 1058 | |
| 1066 | 1059 | /* we didn't find it; return an error */ |
| r3957 | r3958 | |
| 1076 | 1069 | int debug_cpu_watchpoint_enable(running_machine *machine, int wpnum, int enable) |
| 1077 | 1070 | { |
| 1078 | 1071 | debug_cpu_watchpoint *wp; |
| 1079 | int cpunum, spacenum; | |
| 1072 | const device_config *cpu; | |
| 1073 | int spacenum; | |
| 1080 | 1074 | |
| 1081 | 1075 | /* loop over CPUs and address spaces and find the requested watchpoint */ |
| 1082 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1083 | if (machine->cpu[cpunum] != NULL) | |
| 1084 | { | |
| 1085 | cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1076 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1077 | { | |
| 1078 | cpu_debug_data *info = cpu_get_debug_data(cpu); | |
| 1086 | 1079 | |
| 1087 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1088 | for (wp = info->wplist[spacenum]; wp != NULL; wp = wp->next) | |
| 1089 | if (wp->index == wpnum) | |
| 1090 | { | |
| 1091 | wp->enabled = (enable != 0); | |
| 1092 | watchpoint_update_flags(cpu_get_address_space(machine->cpu[cpunum], spacenum)); | |
| 1093 | return TRUE; | |
| 1094 | } | |
| 1095 | } | |
| 1080 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1081 | for (wp = info->wplist[spacenum]; wp != NULL; wp = wp->next) | |
| 1082 | if (wp->index == wpnum) | |
| 1083 | { | |
| 1084 | wp->enabled = (enable != 0); | |
| 1085 | watchpoint_update_flags(cpu_get_address_space(cpu, spacenum)); | |
| 1086 | return TRUE; | |
| 1087 | } | |
| 1088 | } | |
| 1096 | 1089 | return FALSE; |
| 1097 | 1090 | } |
| 1098 | 1091 | |
| r3957 | r3958 | |
| 1770 | 1763 | static void debug_cpu_exit(running_machine *machine) |
| 1771 | 1764 | { |
| 1772 | 1765 | debugcpu_private *global = machine->debugcpu_data; |
| 1773 | int cpunum, spacenum; | |
| 1766 | const device_config *cpu; | |
| 1767 | int spacenum; | |
| 1774 | 1768 | |
| 1775 | 1769 | /* loop over all watchpoints and breakpoints to free their memory */ |
| 1776 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1777 | if (machine->cpu[cpunum] != NULL) | |
| 1778 | { | |
| 1779 | cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1770 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1771 | { | |
| 1772 | cpu_debug_data *info = cpu_get_debug_data(cpu); | |
| 1780 | 1773 | |
| 1781 | /* close any tracefiles */ | |
| 1782 | if (info->trace.file != NULL) | |
| 1783 | fclose(info->trace.file); | |
| 1784 | if (info->trace.action != NULL) | |
| 1785 | free(info->trace.action); | |
| 1774 | /* close any tracefiles */ | |
| 1775 | if (info->trace.file != NULL) | |
| 1776 | fclose(info->trace.file); | |
| 1777 | if (info->trace.action != NULL) | |
| 1778 | free(info->trace.action); | |
| 1786 | 1779 | |
| 1787 | /* free the symbol table */ | |
| 1788 | if (info->symtable != NULL) | |
| 1789 | symtable_free(info->symtable); | |
| 1780 | /* free the symbol table */ | |
| 1781 | if (info->symtable != NULL) | |
| 1782 | symtable_free(info->symtable); | |
| 1790 | 1783 | |
| 1791 | /* free all breakpoints */ | |
| 1792 | while (info->bplist != NULL) | |
| 1793 | debug_cpu_breakpoint_clear(machine, info->bplist->index); | |
| 1784 | /* free all breakpoints */ | |
| 1785 | while (info->bplist != NULL) | |
| 1786 | debug_cpu_breakpoint_clear(machine, info->bplist->index); | |
| 1794 | 1787 | |
| 1795 | /* loop over all address spaces */ | |
| 1796 | for (spacenum = 0; spacenum < ARRAY_LENGTH(info->wplist); spacenum++) | |
| 1797 | { | |
| 1798 | /* free all watchpoints */ | |
| 1799 | while (info->wplist[spacenum] != NULL) | |
| 1800 | debug_cpu_watchpoint_clear(machine, info->wplist[spacenum]->index); | |
| 1801 | } | |
| 1788 | /* loop over all address spaces */ | |
| 1789 | for (spacenum = 0; spacenum < ARRAY_LENGTH(info->wplist); spacenum++) | |
| 1790 | { | |
| 1791 | /* free all watchpoints */ | |
| 1792 | while (info->wplist[spacenum] != NULL) | |
| 1793 | debug_cpu_watchpoint_clear(machine, info->wplist[spacenum]->index); | |
| 1802 | 1794 | } |
| 1795 | } | |
| 1803 | 1796 | |
| 1804 | 1797 | /* free the global symbol table */ |
| 1805 | 1798 | if (global != NULL && global->symtable != NULL) |
| r3957 | r3958 | |
| 1826 | 1819 | |
| 1827 | 1820 | static void reset_transient_flags(running_machine *machine) |
| 1828 | 1821 | { |
| 1829 | | |
| 1822 | const device_config *cpu | |
| 1830 | 1823 | |
| 1831 | 1824 | /* loop over CPUs and reset the transient flags */ |
| 1832 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1833 | if (machine->cpu[cpunum] != NULL) | |
| 1834 | cpu_get_debug_data(machine->cpu[cpunum])->flags &= ~DEBUG_FLAG_TRANSIENT; | |
| 1825 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1826 | cpu_get_debug_data(cpu)->flags &= ~DEBUG_FLAG_TRANSIENT; | |
| 1835 | 1827 | } |
| 1836 | 1828 | |
| 1837 | 1829 |
| r3957 | r3958 | |
|---|---|---|
| 1043 | 1043 | astring *tempstring = astring_alloc(); |
| 1044 | 1044 | registers_subview_item *head = NULL; |
| 1045 | 1045 | registers_subview_item **tailptr = &head; |
| 1046 | const device_config *cpu; | |
| 1046 | 1047 | int curindex = 0; |
| 1047 | int cpunum; | |
| 1048 | 1048 | |
| 1049 | 1049 | /* iterate over CPUs with program address spaces */ |
| 1050 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1051 | if (machine->cpu[cpunum] != NULL) | |
| 1052 | { | |
| 1053 | const device_config *device = machine->cpu[cpunum]; | |
| 1054 | registers_subview_item *subview; | |
| 1050 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1051 | { | |
| 1052 | registers_subview_item *subview; | |
| 1055 | 1053 | |
| 1056 | /* determine the string and allocate a subview large enough */ | |
| 1057 | astring_printf(tempstring, "CPU '%s' (%s)", device->tag, cpu_get_name(device)); | |
| 1058 | subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); | |
| 1059 | memset(subview, 0, sizeof(*subview)); | |
| 1054 | /* determine the string and allocate a subview large enough */ | |
| 1055 | astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu)); | |
| 1056 | subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); | |
| 1057 | memset(subview, 0, sizeof(*subview)); | |
| 1060 | 1058 | |
| 1061 | /* populate the subview */ | |
| 1062 | subview->next = NULL; | |
| 1063 | subview->index = curindex++; | |
| 1064 | subview->device = device; | |
| 1065 | strcpy(subview->name, astring_c(tempstring)); | |
| 1059 | /* populate the subview */ | |
| 1060 | subview->next = NULL; | |
| 1061 | subview->index = curindex++; | |
| 1062 | subview->device = cpu; | |
| 1063 | strcpy(subview->name, astring_c(tempstring)); | |
| 1066 | 1064 | |
| 1067 | /* add to the list */ | |
| 1068 | *tailptr = subview; | |
| 1069 | tailptr = &subview->next; | |
| 1070 | } | |
| 1065 | /* add to the list */ | |
| 1066 | *tailptr = subview; | |
| 1067 | tailptr = &subview->next; | |
| 1068 | } | |
| 1071 | 1069 | |
| 1072 | 1070 | /* free the temporary string */ |
| 1073 | 1071 | astring_free(tempstring); |
| r3957 | r3958 | |
| 1187 | 1185 | { |
| 1188 | 1186 | debug_view_registers *regdata = view->extra_data; |
| 1189 | 1187 | int regnum, maxtaglen, maxvallen; |
| 1190 | const | |
| 1188 | const cpu_state_table * | |
| 1191 | 1189 | |
| 1192 | 1190 | /* if no CPU, reset to the first one */ |
| 1193 | 1191 | if (regdata->device == NULL) |
| 1194 | 1192 | regdata->device = view->machine->cpu[0]; |
| 1195 | | |
| 1193 | | |
| 1196 | 1194 | |
| 1197 | 1195 | /* reset the view parameters */ |
| 1198 | 1196 | view->topleft.y = 0; |
| r3957 | r3958 | |
| 1266 | 1264 | int regid; |
| 1267 | 1265 | |
| 1268 | 1266 | /* identify the register id */ |
| 1269 | regid = list ? list[regnum] : regnum; | |
| 1270 | if (regid < 0) | |
| 1271 | break; | |
| 1267 | if (table != NULL) | |
| 1268 | { | |
| 1269 | if (regnum >= table->entrycount) | |
| 1270 | break; | |
| 1271 | if ((table->entrylist[regnum].validmask & table->subtypemask) == 0) | |
| 1272 | continue; | |
| 1273 | regid = table->entrylist[regnum].index; | |
| 1274 | } | |
| 1275 | else | |
| 1276 | regid = regnum; | |
| 1272 | 1277 | |
| 1273 | 1278 | /* retrieve the string for this register */ |
| 1274 | 1279 | str = cpu_get_reg_string(regdata->device, regid); |
| 1275 | 1280 | |
| 1276 | 1281 | /* did we get a string? */ |
| 1277 | if (str && str[0] != | |
| 1282 | if (str != NULL && str[0] != | |
| 1278 | 1283 | registers_view_add_register(view, regid, str); |
| 1279 | 1284 | } |
| 1280 | 1285 | |
| r3957 | r3958 | |
| 1488 | 1493 | astring *tempstring = astring_alloc(); |
| 1489 | 1494 | disasm_subview_item *head = NULL; |
| 1490 | 1495 | disasm_subview_item **tailptr = &head; |
| 1496 | const device_config *cpu; | |
| 1491 | 1497 | int curindex = 0; |
| 1492 | int cpunum; | |
| 1493 | 1498 | |
| 1494 | 1499 | /* iterate over CPUs with program address spaces */ |
| 1495 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1496 | if (machine->cpu[cpunum] != NULL) | |
| 1500 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1501 | { | |
| 1502 | const address_space *space = cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM); | |
| 1503 | if (space != NULL) | |
| 1497 | 1504 | { |
| 1498 | const address_space *space = cpu_get_address_space(machine->cpu[cpunum], ADDRESS_SPACE_PROGRAM); | |
| 1499 | if (space != NULL) | |
| 1500 | { | |
| 1501 | disasm_subview_item *subview; | |
| 1505 | disasm_subview_item *subview; | |
| 1502 | 1506 | |
| 1503 | /* determine the string and allocate a subview large enough */ | |
| 1504 | astring_printf(tempstring, "CPU '%s' (%s)", space->cpu->tag, cpu_get_name(space->cpu)); | |
| 1505 | subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); | |
| 1506 | memset(subview, 0, sizeof(*subview)); | |
| 1507 | /* determine the string and allocate a subview large enough */ | |
| 1508 | astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu)); | |
| 1509 | subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); | |
| 1510 | memset(subview, 0, sizeof(*subview)); | |
| 1507 | 1511 | |
| 1508 | /* populate the subview */ | |
| 1509 | subview->next = NULL; | |
| 1510 | subview->index = curindex++; | |
| 1511 | subview->space = space; | |
| 1512 | strcpy(subview->name, astring_c(tempstring)); | |
| 1512 | /* populate the subview */ | |
| 1513 | subview->next = NULL; | |
| 1514 | subview->index = curindex++; | |
| 1515 | subview->space = space; | |
| 1516 | strcpy(subview->name, astring_c(tempstring)); | |
| 1513 | 1517 | |
| 1514 | /* add to the list */ | |
| 1515 | *tailptr = subview; | |
| 1516 | tailptr = &subview->next; | |
| 1517 | } | |
| 1518 | /* add to the list */ | |
| 1519 | *tailptr = subview; | |
| 1520 | tailptr = &subview->next; | |
| 1518 | 1521 | } |
| 1522 | } | |
| 1519 | 1523 | |
| 1520 | 1524 | /* free the temporary string */ |
| 1521 | 1525 | astring_free(tempstring); |
| r3957 | r3958 | |
| 1532 | 1536 | { |
| 1533 | 1537 | debug_view_disasm *dasmdata; |
| 1534 | 1538 | int total_comments = 0; |
| 1535 | | |
| 1539 | const device_config *cpu | |
| 1536 | 1540 | |
| 1537 | 1541 | /* fail if no available subviews */ |
| 1538 | 1542 | if (view->machine->debugvw_data->disasm_subviews == NULL) |
| r3957 | r3958 | |
| 1551 | 1555 | debug_view_expression_alloc(&dasmdata->expression); |
| 1552 | 1556 | |
| 1553 | 1557 | /* count the number of comments */ |
| 1554 | for (cpunum = 0; cpunum < ARRAY_LENGTH(view->machine->cpu); cpunum++) | |
| 1555 | if (view->machine->cpu[cpunum] != NULL) | |
| 1556 | total_comments += debug_comment_get_count(view->machine->cpu[cpunum]); | |
| 1558 | for (cpu = view->machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1559 | total_comments += debug_comment_get_count(cpu); | |
| 1557 | 1560 | |
| 1558 | 1561 | /* initialize */ |
| 1559 | 1562 | dasmdata->right_column = (total_comments > 0) ? DASM_RIGHTCOL_COMMENTS : DASM_RIGHTCOL_RAW; |
| r3957 | r3958 | |
| 2406 | 2409 | astring *tempstring = astring_alloc(); |
| 2407 | 2410 | memory_subview_item *head = NULL; |
| 2408 | 2411 | memory_subview_item **tailptr = &head; |
| 2409 | int cpunum, spacenum; | |
| 2412 | const device_config *cpu; | |
| 2413 | int spacenum; | |
| 2410 | 2414 | const char *rgntag; |
| 2411 | 2415 | int curindex = 0; |
| 2412 | 2416 | int itemnum; |
| 2413 | 2417 | |
| 2414 | 2418 | /* first add all the CPUs' address spaces */ |
| 2415 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 2416 | if (machine->cpu[cpunum] != NULL) | |
| 2417 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 2419 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 2420 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 2421 | { | |
| 2422 | const address_space *space = cpu_get_address_space(cpu, spacenum); | |
| 2423 | if (space != NULL) | |
| 2418 | 2424 | { |
| 2419 | const address_space *space = cpu_get_address_space(machine->cpu[cpunum], spacenum); | |
| 2420 | if (space != NULL) | |
| 2421 | { | |
| 2422 | memory_subview_item *subview; | |
| 2425 | memory_subview_item *subview; | |
| 2423 | 2426 | |
| 2424 | /* determine the string and allocate a subview large enough */ | |
| 2425 | astring_printf(tempstring, "CPU '%s' (%s) %s memory", space->cpu->tag, cpu_get_name(space->cpu), space->name); | |
| 2426 | subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); | |
| 2427 | memset(subview, 0, sizeof(*subview)); | |
| 2427 | /* determine the string and allocate a subview large enough */ | |
| 2428 | astring_printf(tempstring, "CPU '%s' (%s) %s memory", cpu->tag, cpu_get_name(cpu), space->name); | |
| 2429 | subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); | |
| 2430 | memset(subview, 0, sizeof(*subview)); | |
| 2428 | 2431 | |
| 2429 | /* populate the subview */ | |
| 2430 | subview->next = NULL; | |
| 2431 | subview->index = curindex++; | |
| 2432 | subview->space = space; | |
| 2433 | subview->endianness = space->endianness; | |
| 2434 | subview->prefsize = space->dbits / 8; | |
| 2435 | strcpy(subview->name, astring_c(tempstring)); | |
| 2432 | /* populate the subview */ | |
| 2433 | subview->next = NULL; | |
| 2434 | subview->index = curindex++; | |
| 2435 | subview->space = space; | |
| 2436 | subview->endianness = space->endianness; | |
| 2437 | subview->prefsize = space->dbits / 8; | |
| 2438 | strcpy(subview->name, astring_c(tempstring)); | |
| 2436 | 2439 | |
| 2437 | /* add to the list */ | |
| 2438 | *tailptr = subview; | |
| 2439 | tailptr = &subview->next; | |
| 2440 | } | |
| 2441 | } | |
| 2440 | /* add to the list */ | |
| 2441 | *tailptr = subview; | |
| 2442 | tailptr = &subview->next; | |
| 2443 | } | |
| 2444 | } | |
| 2442 | 2445 | |
| 2443 | 2446 | /* then add all the memory regions */ |
| 2444 | 2447 | for (rgntag = memory_region_next(machine, NULL); rgntag != NULL; rgntag = memory_region_next(machine, rgntag)) |
| 2445 | 2448 | { |
| 2446 | 2449 | UINT32 length = memory_region_length(machine, rgntag); |
| 2447 | 2450 | UINT32 flags = memory_region_flags(machine, rgntag); |
| 2448 | ||
| 2449 | 2451 | if (length > 0 && (flags & ROMREGION_DATATYPEMASK) == ROMREGION_DATATYPEROM) |
| 2450 | 2452 | { |
| 2451 | UINT8 little_endian = ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE); | |
| 2452 | UINT8 width = 1 << ((flags & ROMREGION_WIDTHMASK) >> 8); | |
| 2453 | memory_subview_item *subview; | |
| 2453 | UINT8 little_endian = ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE); | |
| 2454 | UINT8 width = 1 << ((flags & ROMREGION_WIDTHMASK) >> 8); | |
| 2455 | memory_subview_item *subview; | |
| 2454 | 2456 | |
| 2455 | 2457 | /* determine the string and allocate a subview large enough */ |
| 2456 | 2458 | astring_printf(tempstring, "Region '%s'", rgntag); |
| r3957 | r3958 | |
| 2666 | 2668 | for (chunknum = 0; chunknum < memdata->chunks_per_row; chunknum++) |
| 2667 | 2669 | { |
| 2668 | 2670 | int chunkindex = memdata->reverse_view ? (memdata->chunks_per_row - 1 - chunknum) : chunknum; |
| 2669 | UINT64 chunkdata; | |
| 2670 | int ismapped; | |
| 2671 | UINT64 chunkdata; | |
| 2672 | int ismapped; | |
| 2671 | 2673 | |
| 2672 | | |
| 2674 | | |
| 2673 | 2675 | dest = destrow + memdata->section[1].pos + 1 + chunkindex * posdata->spacing; |
| 2674 | 2676 | for (ch = 0; ch < posdata->spacing; ch++, dest++) |
| 2675 | 2677 | if (dest >= destmin && dest < destmax) |
| 2676 | 2678 | { |
| 2677 | 2679 | UINT8 shift = posdata->shift[ch]; |
| 2678 | 2680 | if (shift < 64) |
| 2679 | dest->byte = ismapped ? "0123456789ABCDEF"[(chunkdata >> shift) & 0x0f] : '*'; | |
| 2681 | dest->byte = ismapped ? "0123456789ABCDEF"[(chunkdata >> shift) & 0x0f] : '*'; | |
| 2680 | 2682 | } |
| 2681 | 2683 | } |
| 2682 | 2684 | |
| r3957 | r3958 | |
| 2783 | 2785 | hexchar = strchr(hexvals, tolower(chval)); |
| 2784 | 2786 | if (hexchar == NULL) |
| 2785 | 2787 | break; |
| 2786 | ||
| 2787 | 2788 | ismapped = memory_view_read(memdata, memdata->bytes_per_chunk, address, &data); |
| 2788 | 2789 | if (!ismapped) |
| 2789 | 2790 | break; |
| r3957 | r3958 | |
| 3021 | 3022 | int ismapped; |
| 3022 | 3023 | |
| 3023 | 3024 | ismapped = memdata->no_translation ? TRUE : memory_address_physical(space, TRANSLATE_READ_DEBUG, &dummyaddr); |
| 3025 | *data = ~(UINT64)0; | |
| 3024 | 3026 | if (ismapped) |
| 3025 | 3027 | { |
| 3026 | 3028 | switch (size) |
| r3957 | r3958 | |
| 3031 | 3033 | case 8: *data = debug_read_qword(space, offs, !memdata->no_translation); break; |
| 3032 | 3034 | } |
| 3033 | 3035 | } |
| 3034 | ||
| 3035 | 3036 | return ismapped; |
| 3036 | 3037 | } |
| 3037 | 3038 | |
| r3957 | r3958 | |
| 3044 | 3045 | size /= 2; |
| 3045 | 3046 | ismapped = memory_view_read(memdata, size, offs + 0 * size, &data0); |
| 3046 | 3047 | ismapped |= memory_view_read(memdata, size, offs + 1 * size, &data1); |
| 3047 | ||
| 3048 | 3048 | if (memdata->desc->endianness == ENDIANNESS_LITTLE) |
| 3049 | 3049 | *data = data0 | (data1 << (size * 8)); |
| 3050 | 3050 | else |
| 3051 | 3051 | *data = data1 | (data0 << (size * 8)); |
| 3052 | ||
| 3053 | 3052 | return ismapped; |
| 3054 | 3053 | } |
| 3055 | 3054 | |
| 3056 | 3055 | /* all 0xff if out of bounds */ |
| 3057 | 3056 | offs ^= memdata->desc->offsetxor; |
| 3058 | 3057 | if (offs >= memdata->desc->length) |
| 3059 | return FALSE; | |
| 3060 | ||
| 3061 | *data = *((UINT8 *)memdata->desc->base + offs); | |
| 3062 | return TRUE; | |
| 3058 | return FALSE; | |
| 3059 | *data = *((UINT8 *)memdata->desc->base + offs); | |
| 3060 | return TRUE; | |
| 3063 | 3061 | } |
| 3064 | 3062 | |
| 3065 | 3063 | |
| r3957 | r3958 | |
| 3112 | 3110 | #ifdef FD1094_HACK |
| 3113 | 3111 | if (memdata->desc->base == memory_region(view->machine, "user2")) |
| 3114 | 3112 | { |
| 3115 | extern void fd1094_regenerate_key(void); | |
| 3116 | fd1094_regenerate_key(); | |
| 3113 | extern void fd1094_regenerate_key(running_machine *machine); | |
| 3114 | fd1094_regenerate_key(view->machine); | |
| 3117 | 3115 | } |
| 3118 | 3116 | #endif |
| 3119 | 3117 | } |
| r3957 | r3958 | |
|---|---|---|
| 124 | 124 | void debug_command_init(running_machine *machine) |
| 125 | 125 | { |
| 126 | 126 | symbol_table *symtable = debug_cpu_get_global_symtable(machine); |
| 127 | | |
| 127 | const dev | |
| 128 | 128 | const char *name; |
| 129 | int itemnum; | |
| 129 | 130 | |
| 130 | 131 | /* add a few simple global functions */ |
| 131 | 132 | symtable_add_function(symtable, "min", NULL, 2, 2, execute_min); |
| r3957 | r3958 | |
| 244 | 245 | debug_console_register_command(machine, "hardreset", CMDFLAG_NONE, 0, 0, 1, execute_hardreset); |
| 245 | 246 | |
| 246 | 247 | /* ask all the CPUs if they would like to register functions or symbols */ |
| 247 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 248 | if (machine->cpu[cpunum] != NULL) | |
| 249 | { | |
| 250 | cpu_debug_init_func debug_init; | |
| 251 | debug_init = (cpu_debug_init_func)cpu_get_info_fct(machine->cpu[cpunum], CPUINFO_PTR_DEBUG_INIT); | |
| 252 | if (debug_init != NULL) | |
| 253 | (*debug_init)(machine->cpu[cpunum]); | |
| 254 | } | |
| 248 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 249 | { | |
| 250 | cpu_debug_init_func debug_init; | |
| 251 | debug_init = (cpu_debug_init_func)device_get_info_fct(cpu, CPUINFO_FCT_DEBUG_INIT); | |
| 252 | if (debug_init != NULL) | |
| 253 | (*debug_init)(cpu); | |
| 254 | } | |
| 255 | 255 | |
| 256 | 256 | add_exit_callback(machine, debug_command_exit); |
| 257 | 257 | |
| r3957 | r3958 | |
| 268 | 268 | |
| 269 | 269 | static void debug_command_exit(running_machine *machine) |
| 270 | 270 | { |
| 271 | | |
| 271 | const device_config *cpu | |
| 272 | 272 | |
| 273 | 273 | /* turn off all traces */ |
| 274 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 275 | if (machine->cpu[cpunum] != NULL) | |
| 276 | debug_cpu_trace(machine->cpu[cpunum], NULL, 0, NULL); | |
| 274 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 275 | debug_cpu_trace(cpu, NULL, 0, NULL); | |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | 278 | |
| r3957 | r3958 | |
| 854 | 853 | |
| 855 | 854 | static void execute_focus(running_machine *machine, int ref, int params, const char *param[]) |
| 856 | 855 | { |
| 856 | const device_config *scancpu; | |
| 857 | 857 | const device_config *cpu; |
| 858 | int cpunum; | |
| 859 | 858 | |
| 860 | 859 | /* validate params */ |
| 861 | 860 | if (!debug_command_parameter_cpu(machine, param[0], &cpu)) |
| r3957 | r3958 | |
| 865 | 864 | debug_cpu_ignore_cpu(cpu, 0); |
| 866 | 865 | |
| 867 | 866 | /* then loop over CPUs and set the ignore flags on all other CPUs */ |
| 868 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 869 | if (machine->cpu[cpunum] != NULL && machine->cpu[cpunum] != cpu) | |
| 870 | debug_cpu_ignore_cpu(machine->cpu[cpunum], 1); | |
| 867 | for (scancpu = machine->cpu[0]; scancpu != NULL; scancpu = scancpu->typenext) | |
| 868 | if (scancpu != cpu) | |
| 869 | debug_cpu_ignore_cpu(scancpu, 1); | |
| 871 | 870 | debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag); |
| 872 | 871 | } |
| 873 | 872 | |
| r3957 | r3958 | |
| 879 | 878 | static void execute_ignore(running_machine *machine, int ref, int params, const char *param[]) |
| 880 | 879 | { |
| 881 | 880 | const device_config *cpuwhich[MAX_COMMAND_PARAMS]; |
| 882 | int cpunum, paramnum; | |
| 881 | const device_config *cpu; | |
| 882 | int paramnum; | |
| 883 | 883 | char buffer[100]; |
| 884 | 884 | int buflen = 0; |
| 885 | 885 | |
| r3957 | r3958 | |
| 887 | 887 | if (params == 0) |
| 888 | 888 | { |
| 889 | 889 | /* loop over all CPUs */ |
| 890 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 891 | if (machine->cpu[cpunum] != NULL) | |
| 892 | { | |
| 893 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 890 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 891 | { | |
| 892 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 894 | 893 | |
| 895 | /* build up a comma-separated list */ | |
| 896 | if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) == 0) | |
| 897 | { | |
| 898 | if (buflen == 0) | |
| 899 | buflen += sprintf(&buffer[buflen], "Currently ignoring CPU '%s'", machine->cpu[cpunum]->tag); | |
| 900 | else | |
| 901 | buflen += sprintf(&buffer[buflen], ", '%s'", machine->cpu[cpunum]->tag); | |
| 902 | } | |
| 894 | /* build up a comma-separated list */ | |
| 895 | if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) == 0) | |
| 896 | { | |
| 897 | if (buflen == 0) | |
| 898 | buflen += sprintf(&buffer[buflen], "Currently ignoring CPU '%s'", cpu->tag); | |
| 899 | else | |
| 900 | buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag); | |
| 903 | 901 | } |
| 902 | } | |
| 904 | 903 | |
| 905 | 904 | /* special message for none */ |
| 906 | 905 | if (buflen == 0) |
| r3957 | r3958 | |
| 920 | 919 | for (paramnum = 0; paramnum < params; paramnum++) |
| 921 | 920 | { |
| 922 | 921 | /* make sure this isn't the last live CPU */ |
| 923 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 924 | if (machine->cpu[cpunum] != NULL && machine->cpu[cpunum] != cpuwhich[paramnum]) | |
| 925 | if ((cpu_get_debug_data(machine->cpu[cpunum])->flags & DEBUG_FLAG_OBSERVING) != 0) | |
| 926 | break; | |
| 927 | if (cpunum == ARRAY_LENGTH(machine->cpu)) | |
| 922 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 923 | if (cpu != cpuwhich[paramnum] && (cpu_get_debug_data(cpu)->flags & DEBUG_FLAG_OBSERVING) != 0) | |
| 924 | break; | |
| 925 | if (cpu == NULL) | |
| 928 | 926 | { |
| 929 | 927 | debug_console_printf(machine, "Can't ignore all CPUs!\n"); |
| 930 | 928 | return; |
| r3957 | r3958 | |
| 944 | 942 | static void execute_observe(running_machine *machine, int ref, int params, const char *param[]) |
| 945 | 943 | { |
| 946 | 944 | const device_config *cpuwhich[MAX_COMMAND_PARAMS]; |
| 947 | int cpunum, paramnum; | |
| 945 | const device_config *cpu; | |
| 946 | int paramnum; | |
| 948 | 947 | char buffer[100]; |
| 949 | 948 | int buflen = 0; |
| 950 | 949 | |
| r3957 | r3958 | |
| 952 | 951 | if (params == 0) |
| 953 | 952 | { |
| 954 | 953 | /* loop over all CPUs */ |
| 955 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 956 | if (machine->cpu[cpunum] != NULL) | |
| 957 | { | |
| 958 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 954 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 955 | { | |
| 956 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 959 | 957 | |
| 960 | /* build up a comma-separated list */ | |
| 961 | if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) != 0) | |
| 962 | { | |
| 963 | if (buflen == 0) | |
| 964 | buflen += sprintf(&buffer[buflen], "Currently observing CPU '%s'", machine->cpu[cpunum]->tag); | |
| 965 | else | |
| 966 | buflen += sprintf(&buffer[buflen], ", '%s'", machine->cpu[cpunum]->tag); | |
| 967 | } | |
| 958 | /* build up a comma-separated list */ | |
| 959 | if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) != 0) | |
| 960 | { | |
| 961 | if (buflen == 0) | |
| 962 | buflen += sprintf(&buffer[buflen], "Currently observing CPU '%s'", cpu->tag); | |
| 963 | else | |
| 964 | buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag); | |
| 968 | 965 | } |
| 966 | } | |
| 969 | 967 | |
| 970 | 968 | /* special message for none */ |
| 971 | 969 | if (buflen == 0) |
| r3957 | r3958 | |
| 1103 | 1101 | /* if 0 parameters, clear all */ |
| 1104 | 1102 | if (params == 0) |
| 1105 | 1103 | { |
| 1106 | | |
| 1104 | const device_config *cpu | |
| 1107 | 1105 | |
| 1108 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1109 | if (machine->cpu[cpunum] != NULL) | |
| 1110 | { | |
| 1111 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1112 | debug_cpu_breakpoint *bp; | |
| 1113 | while ((bp = cpuinfo->bplist) != NULL) | |
| 1114 | debug_cpu_breakpoint_clear(machine, bp->index); | |
| 1115 | } | |
| 1106 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1107 | { | |
| 1108 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 1109 | debug_cpu_breakpoint *bp; | |
| 1110 | while ((bp = cpuinfo->bplist) != NULL) | |
| 1111 | debug_cpu_breakpoint_clear(machine, bp->index); | |
| 1112 | } | |
| 1116 | 1113 | debug_console_printf(machine, "Cleared all breakpoints\n"); |
| 1117 | 1114 | } |
| 1118 | 1115 | |
| r3957 | r3958 | |
| 1142 | 1139 | /* if 0 parameters, clear all */ |
| 1143 | 1140 | if (params == 0) |
| 1144 | 1141 | { |
| 1145 | | |
| 1142 | const device_config *cpu | |
| 1146 | 1143 | |
| 1147 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1148 | if (machine->cpu[cpunum] != NULL) | |
| 1149 | { | |
| 1150 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1151 | debug_cpu_breakpoint *bp; | |
| 1152 | for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next) | |
| 1153 | debug_cpu_breakpoint_enable(machine, bp->index, ref); | |
| 1154 | } | |
| 1144 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1145 | { | |
| 1146 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 1147 | debug_cpu_breakpoint *bp; | |
| 1148 | for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next) | |
| 1149 | debug_cpu_breakpoint_enable(machine, bp->index, ref); | |
| 1150 | } | |
| 1155 | 1151 | if (ref == 0) |
| 1156 | 1152 | debug_console_printf(machine, "Disabled all breakpoints\n"); |
| 1157 | 1153 | else |
| r3957 | r3958 | |
| 1179 | 1175 | |
| 1180 | 1176 | static void execute_bplist(running_machine *machine, int ref, int params, const char *param[]) |
| 1181 | 1177 | { |
| 1182 | int cpunum, printed = 0; | |
| 1178 | const device_config *cpu; | |
| 1179 | int printed = 0; | |
| 1183 | 1180 | char buffer[256]; |
| 1184 | 1181 | |
| 1185 | 1182 | /* loop over all CPUs */ |
| 1186 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1187 | if (machine->cpu[cpunum] != NULL) | |
| 1183 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1184 | { | |
| 1185 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 1186 | ||
| 1187 | if (cpuinfo->bplist != NULL) | |
| 1188 | 1188 | { |
| 1189 | | |
| 1189 | | |
| 1190 | 1190 | |
| 1191 | if (cpuinfo->bplist != NULL) | |
| 1192 | { | |
| 1193 | debug_cpu_breakpoint *bp; | |
| 1191 | debug_console_printf(machine, "CPU '%s' breakpoints:\n", cpu->tag); | |
| 1194 | 1192 | |
| 1195 | debug_console_printf(machine, "CPU %d breakpoints:\n", cpunum); | |
| 1196 | ||
| 1197 | /* loop over the breakpoints */ | |
| 1198 | for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next) | |
| 1199 | { | |
| 1200 | int buflen; | |
| 1201 | buflen = sprintf(buffer, "%c%4X @ %08X", bp->enabled ? ' ' : 'D', bp->index, bp->address); | |
| 1202 | if (bp->condition) | |
| 1203 | buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(bp->condition)); | |
| 1204 | if (bp->action) | |
| 1205 | buflen += sprintf(&buffer[buflen], " do %s", bp->action); | |
| 1206 | debug_console_printf(machine, "%s\n", buffer); | |
| 1207 | printed++; | |
| 1208 | } | |
| 1193 | /* loop over the breakpoints */ | |
| 1194 | for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next) | |
| 1195 | { | |
| 1196 | int buflen; | |
| 1197 | buflen = sprintf(buffer, "%c%4X @ %08X", bp->enabled ? ' ' : 'D', bp->index, bp->address); | |
| 1198 | if (bp->condition) | |
| 1199 | buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(bp->condition)); | |
| 1200 | if (bp->action) | |
| 1201 | buflen += sprintf(&buffer[buflen], " do %s", bp->action); | |
| 1202 | debug_console_printf(machine, "%s\n", buffer); | |
| 1203 | printed++; | |
| 1209 | 1204 | } |
| 1210 | 1205 | } |
| 1206 | } | |
| 1211 | 1207 | |
| 1212 | 1208 | if (!printed) |
| 1213 | 1209 | debug_console_printf(machine, "No breakpoints currently installed\n"); |
| r3957 | r3958 | |
| 1279 | 1275 | /* if 0 parameters, clear all */ |
| 1280 | 1276 | if (params == 0) |
| 1281 | 1277 | { |
| 1282 | | |
| 1278 | const device_config *cpu | |
| 1283 | 1279 | |
| 1284 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1285 | if (machine->cpu[cpunum] != NULL) | |
| 1286 | { | |
| 1287 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1288 | int spacenum; | |
| 1280 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1281 | { | |
| 1282 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 1283 | int spacenum; | |
| 1289 | 1284 | |
| 1290 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1291 | { | |
| 1292 | debug_cpu_watchpoint *wp; | |
| 1293 | while ((wp = cpuinfo->wplist[spacenum]) != NULL) | |
| 1294 | debug_cpu_watchpoint_clear(machine, wp->index); | |
| 1295 | } | |
| 1285 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1286 | { | |
| 1287 | debug_cpu_watchpoint *wp; | |
| 1288 | while ((wp = cpuinfo->wplist[spacenum]) != NULL) | |
| 1289 | debug_cpu_watchpoint_clear(machine, wp->index); | |
| 1296 | 1290 | } |
| 1291 | } | |
| 1297 | 1292 | debug_console_printf(machine, "Cleared all watchpoints\n"); |
| 1298 | 1293 | } |
| 1299 | 1294 | |
| r3957 | r3958 | |
| 1323 | 1318 | /* if 0 parameters, clear all */ |
| 1324 | 1319 | if (params == 0) |
| 1325 | 1320 | { |
| 1326 | | |
| 1321 | const device_config *cpu | |
| 1327 | 1322 | |
| 1328 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1329 | if (machine->cpu[cpunum] != NULL) | |
| 1330 | { | |
| 1331 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1332 | int spacenum; | |
| 1323 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1324 | { | |
| 1325 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 1326 | int spacenum; | |
| 1333 | 1327 | |
| 1334 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1335 | { | |
| 1336 | debug_cpu_watchpoint *wp; | |
| 1337 | for (wp = cpuinfo->wplist[spacenum]; wp != NULL; wp = wp->next) | |
| 1338 | debug_cpu_watchpoint_enable(machine, wp->index, ref); | |
| 1339 | } | |
| 1328 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1329 | { | |
| 1330 | debug_cpu_watchpoint *wp; | |
| 1331 | for (wp = cpuinfo->wplist[spacenum]; wp != NULL; wp = wp->next) | |
| 1332 | debug_cpu_watchpoint_enable(machine, wp->index, ref); | |
| 1340 | 1333 | } |
| 1334 | } | |
| 1341 | 1335 | if (ref == 0) |
| 1342 | 1336 | debug_console_printf(machine, "Disabled all watchpoints\n"); |
| 1343 | 1337 | else |
| r3957 | r3958 | |
| 1365 | 1359 | |
| 1366 | 1360 | static void execute_wplist(running_machine *machine, int ref, int params, const char *param[]) |
| 1367 | 1361 | { |
| 1368 | int cpunum, printed = 0; | |
| 1362 | const device_config *cpu; | |
| 1363 | int printed = 0; | |
| 1369 | 1364 | char buffer[256]; |
| 1370 | 1365 | |
| 1371 | 1366 | /* loop over all CPUs */ |
| 1372 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1373 | if (machine->cpu[cpunum] != NULL) | |
| 1374 | { | |
| 1375 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1376 | int spacenum; | |
| 1367 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1368 | { | |
| 1369 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 1370 | int spacenum; | |
| 1377 | 1371 | |
| 1378 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1379 | if (cpuinfo->wplist[spacenum] != NULL) | |
| 1380 | { | |
| 1381 | static const char *const types[] = { "unkn ", "read ", "write", "r/w " }; | |
| 1382 | const address_space *space = cpu_get_address_space(machine->cpu[cpunum], spacenum); | |
| 1383 | debug_cpu_watchpoint *wp; | |
| 1372 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1373 | if (cpuinfo->wplist[spacenum] != NULL) | |
| 1374 | { | |
| 1375 | static const char *const types[] = { "unkn ", "read ", "write", "r/w " }; | |
| 1376 | const address_space *space = cpu_get_address_space(cpu, spacenum); | |
| 1377 | debug_cpu_watchpoint *wp; | |
| 1384 | 1378 | |
| 1385 | | |
| 1379 | | |
| 1386 | 1380 | |
| 1387 | /* loop over the watchpoints */ | |
| 1388 | for (wp = cpuinfo->wplist[spacenum]; wp != NULL; wp = wp->next) | |
| 1389 | { | |
| 1390 | int buflen; | |
| 1391 | buflen = sprintf(buffer, "%c%4X @ %08X-%08X %s", wp->enabled ? ' ' : 'D', | |
| 1392 | wp->index, memory_byte_to_address(space, wp->address), memory_byte_to_address_end(space, wp->address + wp->length) - 1, types[wp->type & 3]); | |
| 1393 | if (wp->condition) | |
| 1394 | buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(wp->condition)); | |
| 1395 | if (wp->action) | |
| 1396 | buflen += sprintf(&buffer[buflen], " do %s", wp->action); | |
| 1397 | debug_console_printf(machine, "%s\n", buffer); | |
| 1398 | printed++; | |
| 1399 | } | |
| 1381 | /* loop over the watchpoints */ | |
| 1382 | for (wp = cpuinfo->wplist[spacenum]; wp != NULL; wp = wp->next) | |
| 1383 | { | |
| 1384 | int buflen; | |
| 1385 | buflen = sprintf(buffer, "%c%4X @ %08X-%08X %s", wp->enabled ? ' ' : 'D', | |
| 1386 | wp->index, memory_byte_to_address(space, wp->address), memory_byte_to_address_end(space, wp->address + wp->length) - 1, types[wp->type & 3]); | |
| 1387 | if (wp->condition) | |
| 1388 | buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(wp->condition)); | |
| 1389 | if (wp->action) | |
| 1390 | buflen += sprintf(&buffer[buflen], " do %s", wp->action); | |
| 1391 | debug_console_printf(machine, "%s\n", buffer); | |
| 1392 | printed++; | |
| 1400 | 1393 | } |
| 1401 | } | |
| 1394 | } | |
| 1395 | } | |
| 1402 | 1396 | |
| 1403 | 1397 | if (!printed) |
| 1404 | 1398 | debug_console_printf(machine, "No watchpoints currently installed\n"); |
| r3957 | r3958 | |
| 1420 | 1414 | if (params == 0) |
| 1421 | 1415 | { |
| 1422 | 1416 | int cleared = FALSE; |
| 1423 | int cpunum; | |
| 1424 | 1417 | |
| 1425 | 1418 | /* loop over CPUs and find live spots */ |
| 1426 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1427 | if (machine->cpu[cpunum] != NULL) | |
| 1428 | { | |
| 1429 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]); | |
| 1419 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1420 | { | |
| 1421 | const cpu_debug_data *cpuinfo = cpu_get_debug_data(cpu); | |
| 1430 | 1422 | |
| 1431 | if (cpuinfo->hotspots != NULL) | |
| 1432 | { | |
| 1433 | debug_cpu_hotspot_track(cpuinfo->device, 0, 0); | |
| 1434 | debug_console_printf(machine, "Cleared hotspot tracking on CPU '%s'\n", machine->cpu[cpunum]->tag); | |
| 1435 | cleared = TRUE; | |
| 1436 | } | |
| 1423 | if (cpuinfo->hotspots != NULL) | |
| 1424 | { | |
| 1425 | debug_cpu_hotspot_track(cpuinfo->device, 0, 0); | |
| 1426 | debug_console_printf(machine, "Cleared hotspot tracking on CPU '%s'\n", cpu->tag); | |
| 1427 | cleared = TRUE; | |
| 1437 | 1428 | } |
| 1429 | } | |
| 1438 | 1430 | |
| 1439 | 1431 | /* if we cleared, we're done */ |
| 1440 | 1432 | if (cleared) |
| r3957 | r3958 | |
|---|---|---|
| 1953 | 1953 | int strindex; |
| 1954 | 1954 | int all_digits, i; |
| 1955 | 1955 | |
| 1956 | assert_always(entry->table == table, "Mismatched symbol tables"); | |
| 1957 | ||
| 1956 | 1958 | /* we cannot add numeric symbols */ |
| 1957 | 1959 | all_digits = TRUE; |
| 1958 | 1960 | for (i = 0; name[i]; i++) |
| r3957 | r3958 | |
| 2018 | 2020 | symbol.type = SMT_REGISTER; |
| 2019 | 2021 | symbol.info.reg.getter = getter; |
| 2020 | 2022 | symbol.info.reg.setter = setter; |
| 2023 | symbol.table = table; | |
| 2021 | 2024 | return symtable_add(table, name, &symbol); |
| 2022 | 2025 | } |
| 2023 | 2026 | |
| r3957 | r3958 | |
| 2036 | 2039 | symbol.info.func.minparams = minparams; |
| 2037 | 2040 | symbol.info.func.maxparams = maxparams; |
| 2038 | 2041 | symbol.info.func.execute = execute; |
| 2042 | symbol.table = table; | |
| 2039 | 2043 | return symtable_add(table, name, &symbol); |
| 2040 | 2044 | } |
| 2041 | 2045 | |
| r3957 | r3958 | |
| 2052 | 2056 | symbol.ref = NULL; |
| 2053 | 2057 | symbol.type = SMT_VALUE; |
| 2054 | 2058 | symbol.info.gen.value = value; |
| 2059 | symbol.table = table; | |
| 2055 | 2060 | return symtable_add(table, name, &symbol); |
| 2056 | 2061 | } |
| 2057 | 2062 |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | "\n" |
| 79 | 79 | " help [<topic>] -- get help on a particular topic\n" |
| 80 | 80 | " do <expression> -- evaluates the given expression\n" |
| 81 | " symlist [<cpu | |
| 81 | " symlist [<cpu | |
| 82 | 82 | " softreset -- executes a soft reset\n" |
| 83 | 83 | " hardreset -- executes a hard reset\n" |
| 84 | 84 | " print <item>[,...] -- prints one or more <item>s to the console\n" |
| r3957 | r3958 | |
| 95 | 95 | "Memory Commands\n" |
| 96 | 96 | "Type help <command> for further details on each command\n" |
| 97 | 97 | "\n" |
| 98 | " dasm <filename>,<address>,<length>[,<opcodes>[,<cpu | |
| 98 | " dasm <filename>,<address>,<length>[,<opcodes>[,<cpu | |
| 99 | 99 | " f[ind] <address>,<length>[,<data>[,...]] -- search program memory for data\n" |
| 100 | 100 | " f[ind]d <address>,<length>[,<data>[,...]] -- search data memory for data\n" |
| 101 | 101 | " f[ind]i <address>,<length>[,<data>[,...]] -- search I/O memory for data\n" |
| 102 | " dump <filename>,<address>,<length>[,<size>[,<ascii>[,<cpunum>]]] -- dump program memory as text\n" | |
| 103 | " dumpd <filename>,<address>,<length>[,<size>[,<ascii>[,<cpunum>]]] -- dump data memory as text\n" | |
| 104 | " dumpi <filename>,<address>,<length>[,<size>[,<ascii>[,<cpunum>]]] -- dump I/O memory as text\n" | |
| 105 | " save <filename>,<address>,<length>[,<cpunum>] -- save binary program memory to the given file\n" | |
| 106 | " saved <filename>,<address>,<length>[,<cpunum>] -- save binary data memory to the given file\n" | |
| 107 | " savei <filename>,<address>,<length>[,<cpunum>] -- save binary I/O memory to the given file\n" | |
| 102 | " dump <filename>,<address>,<length>[,<size>[,<ascii>[,<cpu>]]] -- dump program memory as text\n" | |
| 103 | " dumpd <filename>,<address>,<length>[,<size>[,<ascii>[,<cpu>]]] -- dump data memory as text\n" | |
| 104 | " dumpi <filename>,<address>,<length>[,<size>[,<ascii>[,<cpu>]]] -- dump I/O memory as text\n" | |
| 105 | " save <filename>,<address>,<length>[,<cpu>] -- save binary program memory to the given file\n" | |
| 106 | " saved <filename>,<address>,<length>[,<cpu>] -- save binary data memory to the given file\n" | |
| 107 | " savei <filename>,<address>,<length>[,<cpu>] -- save binary I/O memory to the given file\n" | |
| 108 | 108 | " map <address> -- map logical program address to physical address and bank\n" |
| 109 | 109 | " mapd <address> -- map logical data address to physical address and bank\n" |
| 110 | 110 | " mapi <address> -- map logical I/O address to physical address and bank\n" |
| r3957 | r3958 | |
| 124 | 124 | " gt[ime] <milliseconds> -- resumes execution until the given delay has elapsed\n" |
| 125 | 125 | " gv[blank] -- resumes execution, setting temp breakpoint on the next VBLANK (F8)\n" |
| 126 | 126 | " n[ext] -- executes until the next CPU switch (F6)\n" |
| 127 | " focus <cpunum> -- focuses debugger only on <cpunum>\n" | |
| 128 | " ignore [<cpunum>[,<cpunum>[,...]]] -- stops debugging on <cpunum>\n" | |
| 129 | " observe [<cpunum>[,<cpunum>[,...]]] -- resumes debugging on <cpunum>\n" | |
| 130 | " trace {<filename>|OFF}[,<cpunum>[,<action>]] -- trace the given CPU to a file (defaults to active CPU)\n" | |
| 131 | " traceover {<filename>|OFF}[,<cpunum>[,<action>]] -- trace the given CPU to a file, but skip subroutines (defaults to active CPU)\n" | |
| 127 | " focus <cpu> -- focuses debugger only on <cpu>\n" | |
| 128 | " ignore [<cpu>[,<cpu>[,...]]] -- stops debugging on <cpu>\n" | |
| 129 | " observe [<cpu>[,<cpu>[,...]]] -- resumes debugging on <cpu>\n" | |
| 130 | " trace {<filename>|OFF}[,<cpu>[,<action>]] -- trace the given CPU to a file (defaults to active CPU)\n" | |
| 131 | " traceover {<filename>|OFF}[,<cpu>[,<action>]] -- trace the given CPU to a file, but skip subroutines (defaults to active CPU)\n" | |
| 132 | 132 | " traceflush -- flushes all open trace files\n" |
| 133 | 133 | }, |
| 134 | 134 | { |
| r3957 | r3958 | |
| 156 | 156 | " wpdisable [<wpnum>] -- disables a given watchpoint or all if no <wpnum> specified\n" |
| 157 | 157 | " wpenable [<wpnum>] -- enables a given watchpoint or all if no <wpnum> specified\n" |
| 158 | 158 | " wplist -- lists all the watchpoints\n" |
| 159 | " hotspot [<cpu | |
| 159 | " hotspot [<cpu | |
| 160 | 160 | }, |
| 161 | 161 | { |
| 162 | 162 | "expressions", |
| r3957 | r3958 | |
| 219 | 219 | { |
| 220 | 220 | "symlist", |
| 221 | 221 | "\n" |
| 222 | " symlist [<cpu | |
| 222 | " symlist [<cpu | |
| 223 | 223 | "\n" |
| 224 | "Lists registered symbols. If <cpunum> is not specified, then symbols in the global symbol table are " | |
| 225 | "displayed; otherwise, the symbols for <cpunum>'s specific CPU are displayed. Symbols are listed " | |
| 224 | "Lists registered symbols. If <cpu> is not specified, then symbols in the global symbol table are " | |
| 225 | "displayed; otherwise, the symbols for <cpu>'s specific CPU are displayed. Symbols are listed " | |
| 226 | 226 | "alphabetically. Read-only symbols are flagged with an asterisk.\n" |
| 227 | 227 | "\n" |
| 228 | 228 | "Examples:\n" |
| r3957 | r3958 | |
| 377 | 377 | { |
| 378 | 378 | "dasm", |
| 379 | 379 | "\n" |
| 380 | " dasm <filename>,<address>,<length>[,<opcodes>[,<cpu | |
| 380 | " dasm <filename>,<address>,<length>[,<opcodes>[,<cpu | |
| 381 | 381 | "\n" |
| 382 | 382 | "The dasm command disassembles program memory to the file specified in the <filename> parameter. " |
| 383 | 383 | "<address> indicates the address of the start of disassembly, and <length> indicates how much " |
| 384 | 384 | "memory to disassemble. The range <address> through <address>+<length>-1 inclusive will be " |
| 385 | 385 | "output to the file. By default, the raw opcode data is output with each line. The optional " |
| 386 | 386 | "<opcodes> parameter can be used to enable (1) or disable(0) this feature. Finally, you can " |
| 387 | "disassemble code from another CPU by specifying the <cpu | |
| 387 | "disassemble code from another CPU by specifying the <cpu | |
| 388 | 388 | "\n" |
| 389 | 389 | "Examples:\n" |
| 390 | 390 | "\n" |
| r3957 | r3958 | |
| 431 | 431 | { |
| 432 | 432 | "dump", |
| 433 | 433 | "\n" |
| 434 | " dump[{d|i}] <filename>,<address>,<length>[,<size>[,<ascii>[,<cpu | |
| 434 | " dump[{d|i}] <filename>,<address>,<length>[,<size>[,<ascii>[,<cpu | |
| 435 | 435 | "\n" |
| 436 | 436 | "The dump/dumpd/dumpi commands dump memory to the text file specified in the <filename> " |
| 437 | 437 | "parameter. 'dump' will dump program space memory, while 'dumpd' will dump data space memory " |
| r3957 | r3958 | |
| 442 | 442 | "<size> parameter, which can be used to group the data in 1, 2, 4 or 8-byte chunks. The optional " |
| 443 | 443 | "<ascii> parameter can be used to enable (1) or disable (0) the output of ASCII characters to the " |
| 444 | 444 | "right of each line; by default, this is enabled. Finally, you can dump memory from another CPU " |
| 445 | "by specifying the <cpu | |
| 445 | "by specifying the <cpu | |
| 446 | 446 | "\n" |
| 447 | 447 | "Examples:\n" |
| 448 | 448 | "\n" |
| r3957 | r3958 | |
| 457 | 457 | { |
| 458 | 458 | "save", |
| 459 | 459 | "\n" |
| 460 | " save[{d|i}] <filename>,<address>,<length>[,<cpu | |
| 460 | " save[{d|i}] <filename>,<address>,<length>[,<cpu | |
| 461 | 461 | "\n" |
| 462 | 462 | "The save/saved/savei commands save raw memory to the binary file specified in the <filename> " |
| 463 | 463 | "parameter. 'save' will save program space memory, while 'saved' will save data space memory " |
| 464 | 464 | "and 'savei' will save I/O space memory. <address> indicates the address of the start of saving, " |
| 465 | 465 | "and <length> indicates how much memory to save. The range <address> through <address>+<length>-1 " |
| 466 | 466 | "inclusive will be output to the file. You can also save memory from another CPU by specifying the " |
| 467 | "<cpu | |
| 467 | "<cpu | |
| 468 | 468 | "\n" |
| 469 | 469 | "Examples:\n" |
| 470 | 470 | "\n" |
| r3957 | r3958 | |
| 610 | 610 | { |
| 611 | 611 | "focus", |
| 612 | 612 | "\n" |
| 613 | " focus <cpu | |
| 613 | " focus <cpu | |
| 614 | 614 | "\n" |
| 615 | "Sets the debugger focus exclusively to the given <cpu | |
| 615 | "Sets the debugger focus exclusively to the given <cpu | |
| 616 | 616 | "'ignore' on all other CPUs.\n" |
| 617 | 617 | "\n" |
| 618 | 618 | "Examples:\n" |
| r3957 | r3958 | |
| 623 | 623 | { |
| 624 | 624 | "ignore", |
| 625 | 625 | "\n" |
| 626 | " ignore [<cpu | |
| 626 | " ignore [<cpu | |
| 627 | 627 | "\n" |
| 628 | "Ignores the specified <cpu | |
| 628 | "Ignores the specified <cpu | |
| 629 | 629 | "on that CPU, nor will you be able to set breakpoints on that CPU. To undo this change use " |
| 630 | "the 'observe' command. You can specify multiple <cpu | |
| 630 | "the 'observe' command. You can specify multiple <cpu | |
| 631 | 631 | "you are not permitted to ignore all CPUs; at least one must be active at all times.\n" |
| 632 | 632 | "\n" |
| 633 | 633 | "Examples:\n" |
| r3957 | r3958 | |
| 644 | 644 | { |
| 645 | 645 | "observe", |
| 646 | 646 | "\n" |
| 647 | " observe [<cpu | |
| 647 | " observe [<cpu | |
| 648 | 648 | "\n" |
| 649 | "Re-enables interaction with the specified <cpunum> in the debugger. This command undoes the " | |
| 650 | "effects of the 'ignore' command. You can specify multiple <cpunum>s in a single command.\n" | |
| 649 | "Re-enables interaction with the specified <cpu> in the debugger. This command undoes the " | |
| 650 | "effects of the 'ignore' command. You can specify multiple <cpu>s in a single command.\n" | |
| 651 | 651 | "\n" |
| 652 | 652 | "Examples:\n" |
| 653 | 653 | "\n" |
| r3957 | r3958 | |
| 663 | 663 | { |
| 664 | 664 | "trace", |
| 665 | 665 | "\n" |
| 666 | " trace {<filename>|OFF}[,<cpu | |
| 666 | " trace {<filename>|OFF}[,<cpu | |
| 667 | 667 | "\n" |
| 668 | "Starts or stops tracing of the execution of the specified <cpu | |
| 668 | "Starts or stops tracing of the execution of the specified <cpu | |
| 669 | 669 | "the currently active CPU is specified. When enabling tracing, specify the filename in the " |
| 670 | 670 | "<filename> parameter. To disable tracing, substitute the keyword 'off' for <filename>. If you " |
| 671 | 671 | "wish to log additional information on each trace, you can append an <action> parameter which " |
| r3957 | r3958 | |
| 695 | 695 | { |
| 696 | 696 | "traceover", |
| 697 | 697 | "\n" |
| 698 | " traceover {<filename>|OFF}[,<cpu | |
| 698 | " traceover {<filename>|OFF}[,<cpu | |
| 699 | 699 | "\n" |
| 700 | "Starts or stops tracing of the execution of the specified <cpu | |
| 700 | "Starts or stops tracing of the execution of the specified <cpu | |
| 701 | 701 | "a subroutine or call, tracing will skip over the subroutine. The same algorithm is used as is " |
| 702 | 702 | "used in the step over command. This means that traceover will not work properly when calls " |
| 703 | 703 | "are recusive or the return address is not immediately following the call instruction. If " |
| 704 | "<cpu | |
| 704 | "<cpu | |
| 705 | 705 | "filename in the <filename> parameter. To disable tracing, substitute the keyword 'off' for " |
| 706 | 706 | "<filename>. If you wish to log additional information on each trace, you can append an <action> " |
| 707 | 707 | "parameter which is a command that is executed before each trace is logged. Generally, this is " |
| r3957 | r3958 | |
| 929 | 929 | { |
| 930 | 930 | "hotspot", |
| 931 | 931 | "\n" |
| 932 | " hotspot [<cpu | |
| 932 | " hotspot [<cpu | |
| 933 | 933 | "\n" |
| 934 | 934 | "The hotspot command attempts to help locate hotspots in the code where speedup opportunities " |
| 935 | "might be present. <cpu | |
| 935 | "might be present. <cpu | |
| 936 | 936 | "processor's memory to track. <depth>, which defaults to 64, controls the depth of the search " |
| 937 | 937 | "buffer. The search buffer tracks the last <depth> memory reads from unique PCs. The <hits> " |
| 938 | 938 | "parameter, which defaults to 250, specifies the minimum number of hits to report.\n" |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | int nmi_state; |
| 67 | 67 | } m6805_Regs; |
| 68 | 68 | |
| 69 | /****************************************************************************/ | |
| 70 | /* Read a byte from given memory location */ | |
| 71 | /****************************************************************************/ | |
| 72 | #define M6805_RDMEM(Addr) ((unsigned)memory_read_byte_8be(cpustate->program, Addr)) | |
| 73 | ||
| 74 | /****************************************************************************/ | |
| 75 | /* Write a byte to given memory location */ | |
| 76 | /****************************************************************************/ | |
| 77 | #define M6805_WRMEM(Addr,Value) (memory_write_byte_8be(cpustate->program, Addr,Value)) | |
| 78 | ||
| 79 | /****************************************************************************/ | |
| 80 | /* M6805_RDOP() is identical to M6805_RDMEM() except it is used for reading */ | |
| 81 | /* opcodes. In case of system with memory mapped I/O, this function can be */ | |
| 82 | /* used to greatly speed up emulation */ | |
| 83 | /****************************************************************************/ | |
| 84 | #define M6805_RDOP(Addr) ((unsigned)memory_decrypted_read_byte(cpustate->program, Addr)) | |
| 85 | ||
| 86 | /****************************************************************************/ | |
| 87 | /* M6805_RDOP_ARG() is identical to M6805_RDOP() but it's used for reading */ | |
| 88 | /* opcode arguments. This difference can be used to support systems that */ | |
| 89 | /* use different encoding mechanisms for opcodes and opcode arguments */ | |
| 90 | /****************************************************************************/ | |
| 91 | #define M6805_RDOP_ARG(Addr) ((unsigned)memory_raw_read_byte(cpustate->program, Addr)) | |
| 92 | ||
| 69 | 93 | #define SUBTYPE cpustate->subtype /* CPU Type */ |
| 70 | 94 | #define SP_MASK cpustate->sp_mask /* stack pointer mask */ |
| 71 | 95 | #define SP_LOW cpustate->sp_low /* stack pointer low water mark */ |
| r3957 | r3958 | |
| 903 | 927 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 904 | 928 | case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; |
| 905 | 929 | |
| 906 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 907 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 12; break; | |
| 908 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 909 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 910 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 911 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 912 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 913 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 914 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 930 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 931 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 12; break; | |
| 932 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 933 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 934 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 935 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 936 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 937 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 938 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 915 | 939 | |
| 916 | 940 | case CPUINFO_INT_INPUT_STATE + M6805_IRQ_LINE: info->i = cpustate->irq_state[M6805_IRQ_LINE]; break; |
| 917 | 941 | |
| r3957 | r3958 | |
| 926 | 950 | case CPUINFO_INT_REGISTER + M6805_CC: info->i = CC; break; |
| 927 | 951 | |
| 928 | 952 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 929 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6805); break; | |
| 930 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6805); break; | |
| 931 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m6805); break; | |
| 932 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m6805); break; | |
| 933 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6805); break; | |
| 934 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 935 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6805);break; | |
| 953 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6805); break; | |
| 954 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6805); break; | |
| 955 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m6805); break; | |
| 956 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m6805); break; | |
| 957 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6805); break; | |
| 958 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 959 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6805);break; | |
| 936 | 960 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->iCount; break; |
| 937 | 961 | |
| 938 | 962 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 990 | 1014 | case CPUINFO_INT_INPUT_STATE + M68705_INT_TIMER: info->i = cpustate->irq_state[M68705_INT_TIMER]; break; |
| 991 | 1015 | |
| 992 | 1016 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 993 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68705); break; | |
| 994 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m68705); break; | |
| 995 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m68705); break; | |
| 1017 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68705); break; | |
| 1018 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m68705); break; | |
| 1019 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m68705); break; | |
| 996 | 1020 | |
| 997 | 1021 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 998 | 1022 | case CPUINFO_STR_NAME: strcpy(info->s, "M68705"); break; |
| r3957 | r3958 | |
| 1046 | 1070 | case CPUINFO_INT_INPUT_STATE + HD63705_INT_ADCONV: info->i = cpustate->irq_state[HD63705_INT_ADCONV]; break; |
| 1047 | 1071 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->irq_state[HD63705_INT_NMI]; break; |
| 1048 | 1072 | |
| 1049 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 1073 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 1050 | 1074 | |
| 1051 | 1075 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1052 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(hd63705); break; | |
| 1053 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(hd63705); break; | |
| 1054 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(hd63705); break; | |
| 1076 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(hd63705); break; | |
| 1077 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(hd63705); break; | |
| 1078 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(hd63705); break; | |
| 1055 | 1079 | |
| 1056 | 1080 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1057 | 1081 | case CPUINFO_STR_NAME: strcpy(info->s, "HD63705"); break; |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | #define M6805_IRQ_LINE 0 |
| 13 | 13 | |
| 14 | 14 | extern CPU_GET_INFO( m6805 ); |
| 15 | #define CPU_M6805 CPU_GET_INFO_NAME( m6805 ) | |
| 15 | 16 | |
| 16 | 17 | /**************************************************************************** |
| 17 | 18 | * 68705 section |
| r3957 | r3958 | |
| 29 | 30 | #define M68705_INT_TIMER 0x01 |
| 30 | 31 | |
| 31 | 32 | extern CPU_GET_INFO( m68705 ); |
| 33 | #define CPU_M68705 CPU_GET_INFO_NAME( m68705 ) | |
| 32 | 34 | #endif |
| 33 | 35 | |
| 34 | 36 | /**************************************************************************** |
| r3957 | r3958 | |
| 58 | 60 | #define HD63705_INT_NMI 0x08 |
| 59 | 61 | |
| 60 | 62 | extern CPU_GET_INFO( hd63705 ); |
| 63 | #define CPU_HD63705 CPU_GET_INFO_NAME( hd63705 ) | |
| 61 | 64 | #endif |
| 62 | 65 | |
| 63 | /****************************************************************************/ | |
| 64 | /* Read a byte from given memory location */ | |
| 65 | /****************************************************************************/ | |
| 66 | #define M6805_RDMEM(Addr) ((unsigned)memory_read_byte_8be(cpustate->program, Addr)) | |
| 67 | ||
| 68 | /****************************************************************************/ | |
| 69 | /* Write a byte to given memory location */ | |
| 70 | /****************************************************************************/ | |
| 71 | #define M6805_WRMEM(Addr,Value) (memory_write_byte_8be(cpustate->program, Addr,Value)) | |
| 72 | ||
| 73 | /****************************************************************************/ | |
| 74 | /* M6805_RDOP() is identical to M6805_RDMEM() except it is used for reading */ | |
| 75 | /* opcodes. In case of system with memory mapped I/O, this function can be */ | |
| 76 | /* used to greatly speed up emulation */ | |
| 77 | /****************************************************************************/ | |
| 78 | #define M6805_RDOP(Addr) ((unsigned)memory_decrypted_read_byte(cpustate->program, Addr)) | |
| 79 | ||
| 80 | /****************************************************************************/ | |
| 81 | /* M6805_RDOP_ARG() is identical to M6805_RDOP() but it's used for reading */ | |
| 82 | /* opcode arguments. This difference can be used to support systems that */ | |
| 83 | /* use different encoding mechanisms for opcodes and opcode arguments */ | |
| 84 | /****************************************************************************/ | |
| 85 | #define M6805_RDOP_ARG(Addr) ((unsigned)memory_raw_read_byte(cpustate->program, Addr)) | |
| 86 | ||
| 87 | 66 | CPU_DISASSEMBLE( m6805 ); |
| 88 | 67 | |
| 89 | 68 | #endif /* __M6805_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | typedef UINT32 DWORD; |
| 51 | 51 | |
| 52 | 52 | #include "v30mz.h" |
| 53 | #include "nec | |
| 53 | #include "nec | |
| 54 | 54 | |
| 55 | 55 | extern int necv_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom); |
| 56 | 56 | |
| r3957 | r3958 | |
| 913 | 913 | return necv_dasm_one(buffer, pc, oprom); |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | static void nec_init(const device_config *device, | |
| 916 | static void nec_init(const device_config *device, | |
| 917 | 917 | { |
| 918 | 918 | v30mz_state *cpustate = device->token; |
| 919 | 919 | |
| r3957 | r3958 | |
| 942 | 942 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | static CPU_INIT( v30mz ) { nec_init(device, i | |
| 945 | static CPU_INIT( v30mz ) { nec_init(device, i | |
| 946 | 946 | static CPU_EXECUTE( v30mz ) |
| 947 | 947 | { |
| 948 | 948 | v30mz_state *cpustate = device->token; |
| r3957 | r3958 | |
| 1050 | 1050 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1051 | 1051 | case CPUINFO_INT_MAX_CYCLES: info->i = 80; break; |
| 1052 | 1052 | |
| 1053 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1054 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 1055 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1056 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1057 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1058 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1059 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1060 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 1061 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1053 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1054 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 1055 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1056 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1057 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1058 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1059 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1060 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 1061 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1062 | 1062 | |
| 1063 | 1063 | case CPUINFO_INT_INPUT_STATE + 0: info->i = (cpustate->pending_irq & INT_IRQ) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1064 | 1064 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; |
| r3957 | r3958 | |
| 1086 | 1086 | case CPUINFO_INT_REGISTER + NEC_PENDING: info->i = cpustate->pending_irq; break; |
| 1087 | 1087 | |
| 1088 | 1088 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1089 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(nec); break; | |
| 1090 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(nec); break; | |
| 1091 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(nec); break; | |
| 1092 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1093 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(nec); break; | |
| 1089 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(nec); break; | |
| 1090 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(nec); break; | |
| 1091 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(nec); break; | |
| 1092 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1093 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(nec); break; | |
| 1094 | 1094 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1095 | 1095 | |
| 1096 | 1096 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1138 | 1138 | case CPUINFO_STR_REGISTER + NEC_VECTOR: sprintf(info->s, "V:%02X", cpustate->int_vector); break; |
| 1139 | 1139 | |
| 1140 | 1140 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1141 | case CPUINFO_ | |
| 1141 | case CPUINFO_FCT | |
| 1142 | 1142 | break; |
| 1143 | case CPUINFO_ | |
| 1143 | case CPUINFO_FCT | |
| 1144 | 1144 | break; |
| 1145 | 1145 | |
| 1146 | 1146 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r0 | r3958 | |
|---|---|---|
| 1 | /* ASG 971222 -- rewrote this interface */ | |
| 2 | #ifndef __NECINTRF_H__ | |
| 3 | #define __NECINTRF_H__ | |
| 4 | ||
| 5 | #include "cpuintrf.h" | |
| 6 | ||
| 7 | enum | |
| 8 | { | |
| 9 | NEC_PC=0, | |
| 10 | NEC_IP, NEC_AW, NEC_CW, NEC_DW, NEC_BW, NEC_SP, NEC_BP, NEC_IX, NEC_IY, | |
| 11 | NEC_FLAGS, NEC_ES, NEC_CS, NEC_SS, NEC_DS, | |
| 12 | NEC_VECTOR, NEC_PENDING | |
| 13 | }; | |
| 14 | ||
| 15 | /* Public functions */ | |
| 16 | extern CPU_GET_INFO( v30mz ); | |
| 17 | #define CPU_V30MZ CPU_GET_INFO_NAME( v30mz ) | |
| 18 | ||
| 19 | #endif /* __NECINTRF_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 190 | 190 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 191 | 191 | case CPUINFO_INT_MAX_CYCLES: info->i = 19; break; |
| 192 | 192 | |
| 193 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 194 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 195 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 196 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 197 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 198 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 199 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 200 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 201 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 193 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 194 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 195 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 196 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 197 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 198 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 199 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 200 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 201 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 202 | 202 | |
| 203 | 203 | case CPUINFO_INT_INPUT_STATE: info->i = cpustate->irq_state; break; |
| 204 | 204 | |
| r3957 | r3958 | |
| 220 | 220 | case CPUINFO_INT_REGISTER + LH5801_DP: info->i = cpustate->dp; break; |
| 221 | 221 | |
| 222 | 222 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 223 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(lh5801); break; | |
| 224 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(lh5801); break; | |
| 225 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(lh5801); break; | |
| 226 | case CPUINFO_PTR_EXIT: info->exit = NULL; break; | |
| 227 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(lh5801); break; | |
| 228 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 229 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(lh5801); break; | |
| 223 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(lh5801); break; | |
| 224 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(lh5801); break; | |
| 225 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(lh5801); break; | |
| 226 | case CPUINFO_FCT_EXIT: info->exit = NULL; break; | |
| 227 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(lh5801); break; | |
| 228 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 229 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(lh5801); break; | |
| 230 | 230 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 231 | 231 | |
| 232 | 232 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 78 | 78 | #define LH5801_IRQ 1 |
| 79 | 79 | |
| 80 | 80 | CPU_GET_INFO( lh5801 ); |
| 81 | #define CPU_LH5801 CPU_GET_INFO_NAME( lh5801 ) | |
| 81 | 82 | extern CPU_DISASSEMBLE( lh5801 ); |
| 82 | 83 | |
| 83 | 84 | #endif /* __LH5801_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 1107 | 1107 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 1108 | 1108 | case CPUINFO_INT_MAX_CYCLES: info->i = 19; break; |
| 1109 | 1109 | |
| 1110 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1111 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1112 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1113 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1114 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1115 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1116 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1117 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1118 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1110 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1111 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1112 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1113 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1114 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1115 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1116 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1117 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1118 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1119 | 1119 | |
| 1120 | 1120 | case CPUINFO_INT_INPUT_STATE + M6809_IRQ_LINE: info->i = m68_state->irq_state[M6809_IRQ_LINE]; break; |
| 1121 | 1121 | case CPUINFO_INT_INPUT_STATE + M6809_FIRQ_LINE: info->i = m68_state->irq_state[M6809_FIRQ_LINE]; break; |
| r3957 | r3958 | |
| 1136 | 1136 | case CPUINFO_INT_REGISTER + M6809_DP: info->i = DP; break; |
| 1137 | 1137 | |
| 1138 | 1138 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1139 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6809); break; | |
| 1140 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6809); break; | |
| 1141 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m6809); break; | |
| 1142 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m6809); break; | |
| 1143 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6809); break; | |
| 1144 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1145 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6809); break; | |
| 1139 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6809); break; | |
| 1140 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6809); break; | |
| 1141 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m6809); break; | |
| 1142 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m6809); break; | |
| 1143 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6809); break; | |
| 1144 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1145 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6809); break; | |
| 1146 | 1146 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &m68_state->icount; break; |
| 1147 | 1147 | |
| 1148 | 1148 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | #define M6809_FIRQ_LINE 1 /* FIRQ line number */ |
| 18 | 18 | |
| 19 | 19 | CPU_GET_INFO( m6809 ); |
| 20 | #define CPU_M6809 CPU_GET_INFO_NAME( m6809 ) | |
| 20 | 21 | |
| 21 | 22 | /* M6809e has LIC line to indicate opcode/data fetch */ |
| 22 | 23 | CPU_GET_INFO( m6809e ); |
| 24 | #define CPU_M6809E CPU_GET_INFO_NAME( m6809e ) | |
| 23 | 25 | |
| 24 | 26 | |
| 25 | 27 | CPU_DISASSEMBLE( m6809 ); |
| r3957 | r3958 | |
|---|---|---|
| 86 | 86 | H8_SERIAL_1, |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | CPU_GET_INFO( h8_300 ); | |
| 90 | 89 | CPU_GET_INFO( h8_3002 ); |
| 91 | CPU_GET_INFO( h8_3344 ); | |
| 90 | CPU_GET_INFO( h8_3007 ); | |
| 91 | CPU_GET_INFO( h8_3044 ); | |
| 92 | CPU_GET_INFO( h8_3334 ); | |
| 92 | 93 | |
| 94 | #define CPU_H83002 CPU_GET_INFO_NAME( h8_3002 ) | |
| 95 | #define CPU_H83007 CPU_GET_INFO_NAME( h8_3007 ) | |
| 96 | #define CPU_H83044 CPU_GET_INFO_NAME( h8_3044 ) | |
| 97 | #define CPU_H83334 CPU_GET_INFO_NAME( h8_3334 ) | |
| 98 | ||
| 99 | ||
| 93 | 100 | #endif /* __H83002_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 541 | 541 | |
| 542 | 542 | switch(state) { |
| 543 | 543 | // Interface functions and variables |
| 544 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(h8); break; | |
| 545 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(h8); break; | |
| 546 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(h8); break; | |
| 547 | case CPUINFO_PTR_EXIT: info->exit = 0; break; | |
| 548 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(h8); break; | |
| 549 | case CPUINFO_PTR_BURN: info->burn = 0; break; | |
| 550 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h8_32); break; | |
| 544 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(h8); break; | |
| 545 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(h8); break; | |
| 546 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(h8); break; | |
| 547 | case CPUINFO_FCT_EXIT: info->exit = 0; break; | |
| 548 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(h8); break; | |
| 549 | case CPUINFO_FCT_BURN: info->burn = 0; break; | |
| 550 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h8_32); break; | |
| 551 | 551 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &h8->cyccnt; break; |
| 552 | 552 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(h83xx_state); break; |
| 553 | 553 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; |
| 554 | 554 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 10; break; |
| 555 | 555 | |
| 556 | 556 | // Bus sizes |
| 557 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 558 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 559 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 560 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 561 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 562 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 563 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 564 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 565 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 557 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 558 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 559 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 560 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 561 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 562 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 563 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 564 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 565 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 566 | 566 | |
| 567 | 567 | // Internal maps |
| 568 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(h8_3002_internal_map); break; | |
| 569 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map16 = NULL; break; | |
| 570 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map16 = NULL; break; | |
| 568 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(h8_3002_internal_map); break; | |
| 569 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map16 = NULL; break; | |
| 570 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map16 = NULL; break; | |
| 571 | 571 | |
| 572 | 572 | // CPU misc parameters |
| 573 | 573 | case CPUINFO_STR_NAME: strcpy(info->s, "H8/3002"); break; |
| r3957 | r3958 | |
| 614 | 614 | { |
| 615 | 615 | switch (state) |
| 616 | 616 | { |
| 617 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(h8_3044_internal_map); break; | |
| 618 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h8_24); break; | |
| 617 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(h8_3044_internal_map); break; | |
| 618 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h8_24); break; | |
| 619 | 619 | case CPUINFO_STR_NAME: strcpy(info->s, "H8/3044"); break; |
| 620 | 620 | default: |
| 621 | 621 | CPU_GET_INFO_CALL(h8_3002); |
| r3957 | r3958 | |
| 626 | 626 | { |
| 627 | 627 | switch (state) |
| 628 | 628 | { |
| 629 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = address_map_h8_3007_internal_map; break; | |
| 630 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(h8_3007); break; | |
| 629 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = address_map_h8_3007_internal_map; break; | |
| 630 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(h8_3007); break; | |
| 631 | 631 | case CPUINFO_STR_NAME: strcpy(info->s, "H8/3007"); break; |
| 632 | 632 | default: |
| 633 | 633 | CPU_GET_INFO_CALL(h8_3002); |
| r3957 | r3958 | |
|---|---|---|
| 517 | 517 | |
| 518 | 518 | switch(state) { |
| 519 | 519 | // Interface functions and variables |
| 520 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(h8); break; | |
| 521 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(h8bit); break; | |
| 522 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(h8bit); break; | |
| 523 | case CPUINFO_PTR_EXIT: info->exit = 0; break; | |
| 524 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(h8); break; | |
| 525 | case CPUINFO_PTR_BURN: info->burn = 0; break; | |
| 526 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h8); break; | |
| 520 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(h8); break; | |
| 521 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(h8bit); break; | |
| 522 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(h8bit); break; | |
| 523 | case CPUINFO_FCT_EXIT: info->exit = 0; break; | |
| 524 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(h8); break; | |
| 525 | case CPUINFO_FCT_BURN: info->burn = 0; break; | |
| 526 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h8); break; | |
| 527 | 527 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &h8->cyccnt; break; |
| 528 | 528 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(h83xx_state); break; |
| 529 | 529 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; |
| 530 | 530 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 10; break; |
| 531 | 531 | |
| 532 | 532 | // Bus sizes |
| 533 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 534 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 535 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 536 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 537 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 538 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 539 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 540 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 541 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 533 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 534 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 535 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 536 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 537 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 538 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 539 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 540 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 541 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 542 | 542 | |
| 543 | 543 | // Internal maps |
| 544 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = address_map_h8_3334_internal_map; break; | |
| 545 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = NULL; break; | |
| 546 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map16 = NULL; break; | |
| 544 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = address_map_h8_3334_internal_map; break; | |
| 545 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = NULL; break; | |
| 546 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map16 = NULL; break; | |
| 547 | 547 | |
| 548 | 548 | // CPU misc parameters |
| 549 | 549 | case CPUINFO_STR_NAME: strcpy(info->s, "H8/3334"); break; |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | enum |
| 61 | 61 | { |
| 62 | CPUINFO_PTR_M68K_RESET_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC, | |
| 63 | CPUINFO_PTR_M68K_CMPILD_CALLBACK, | |
| 64 | CPUINFO_PTR_M68K_RTE_CALLBACK, | |
| 65 | CPUINFO_PTR_M68K_TAS_CALLBACK | |
| 62 | CPUINFO_FCT_M68K_RESET_CALLBACK = CPUINFO_FCT_CPU_SPECIFIC, | |
| 63 | CPUINFO_FCT_M68K_CMPILD_CALLBACK, | |
| 64 | CPUINFO_FCT_M68K_RTE_CALLBACK, | |
| 65 | CPUINFO_FCT_M68K_TAS_CALLBACK | |
| 66 | 66 | }; |
| 67 | 67 | |
| 68 | 68 | typedef void (*m68k_bkpt_ack_func)(const device_config *device, UINT32 data); |
| r3957 | r3958 | |
| 79 | 79 | CPU_GET_INFO( m68020 ); |
| 80 | 80 | CPU_GET_INFO( m68040 ); |
| 81 | 81 | |
| 82 | #define CPU_M68000 CPU_GET_INFO_NAME( m68000 ) | |
| 83 | #define CPU_M68008 CPU_GET_INFO_NAME( m68008 ) | |
| 84 | #define CPU_M68010 CPU_GET_INFO_NAME( m68010 ) | |
| 85 | #define CPU_M68EC020 CPU_GET_INFO_NAME( m68ec020 ) | |
| 86 | #define CPU_M68020 CPU_GET_INFO_NAME( m68020 ) | |
| 87 | #define CPU_M68040 CPU_GET_INFO_NAME( m68040 ) | |
| 88 | ||
| 82 | 89 | void m68k_set_encrypted_opcode_range(const device_config *device, offs_t start, offs_t end); |
| 83 | 90 | |
| 84 | 91 | unsigned int m68k_disassemble_raw(char* str_buff, unsigned int pc, const unsigned char* opdata, const unsigned char* argdata, unsigned int cpu_type); |
| r3957 | r3958 | |
|---|---|---|
| 597 | 597 | case CPUINFO_INT_MIN_CYCLES: info->i = 4; break; |
| 598 | 598 | case CPUINFO_INT_MAX_CYCLES: info->i = 158; break; |
| 599 | 599 | |
| 600 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 601 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 602 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 603 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 604 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 605 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 606 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 607 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 608 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 600 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 601 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 602 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 603 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 604 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 605 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 606 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 607 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 608 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 609 | 609 | |
| 610 | 610 | case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* there is no level 0 */ break; |
| 611 | 611 | case CPUINFO_INT_INPUT_STATE + 1: info->i = (m68k->virq_state >> 1) & 1; break; |
| r3957 | r3958 | |
| 645 | 645 | case CPUINFO_INT_REGISTER + M68K_PREF_DATA: info->i = m68k->pref_data; break; |
| 646 | 646 | |
| 647 | 647 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 648 | case CPUINFO_PTR_SET_INFO: /* set per-core */ break; | |
| 649 | case CPUINFO_PTR_INIT: /* set per-core */ break; | |
| 650 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m68k); break; | |
| 651 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m68k); break; | |
| 652 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m68k); break; | |
| 648 | case CPUINFO_FCT_SET_INFO: /* set per-core */ break; | |
| 649 | case CPUINFO_FCT_INIT: /* set per-core */ break; | |
| 650 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m68k); break; | |
| 651 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m68k); break; | |
| 652 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m68k); break; | |
| 653 | 653 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &m68k->remaining_cycles; break; |
| 654 | 654 | |
| 655 | 655 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 756 | 756 | case CPUINFO_INT_REGISTER + M68K_PREF_ADDR: m68k->pref_addr = info->i; break; |
| 757 | 757 | |
| 758 | 758 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 759 | case CPUINFO_PTR_M68K_RESET_CALLBACK: m68k->reset_instr_callback = (m68k_reset_func)info->f; break; | |
| 760 | case CPUINFO_PTR_M68K_CMPILD_CALLBACK: m68k->cmpild_instr_callback = (m68k_cmpild_func)info->f; break; | |
| 761 | case CPUINFO_PTR_M68K_RTE_CALLBACK: m68k->rte_instr_callback = (m68k_rte_func)info->f; break; | |
| 762 | case CPUINFO_PTR_M68K_TAS_CALLBACK: m68k->tas_instr_callback = (m68k_tas_func)info->f; break; | |
| 759 | case CPUINFO_FCT_M68K_RESET_CALLBACK: m68k->reset_instr_callback = (m68k_reset_func)info->f; break; | |
| 760 | case CPUINFO_FCT_M68K_CMPILD_CALLBACK: m68k->cmpild_instr_callback = (m68k_cmpild_func)info->f; break; | |
| 761 | case CPUINFO_FCT_M68K_RTE_CALLBACK: m68k->rte_instr_callback = (m68k_rte_func)info->f; break; | |
| 762 | case CPUINFO_FCT_M68K_TAS_CALLBACK: m68k->tas_instr_callback = (m68k_tas_func)info->f; break; | |
| 763 | 763 | } |
| 764 | 764 | } |
| 765 | 765 | |
| r3957 | r3958 | |
| 939 | 939 | switch (state) |
| 940 | 940 | { |
| 941 | 941 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 942 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68000); break; | |
| 943 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m68000); break; | |
| 942 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68000); break; | |
| 943 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m68000); break; | |
| 944 | 944 | |
| 945 | 945 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 946 | 946 | case CPUINFO_STR_NAME: strcpy(info->s, "68000"); break; |
| r3957 | r3958 | |
| 987 | 987 | switch (state) |
| 988 | 988 | { |
| 989 | 989 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 990 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 991 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 22; break; | |
| 990 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 991 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 22; break; | |
| 992 | 992 | |
| 993 | 993 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 994 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68008); break; | |
| 995 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m68008); break; | |
| 994 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68008); break; | |
| 995 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m68008); break; | |
| 996 | 996 | |
| 997 | 997 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 998 | 998 | case CPUINFO_STR_NAME: strcpy(info->s, "68008"); break; |
| r3957 | r3958 | |
| 1054 | 1054 | case CPUINFO_INT_REGISTER + M68K_DFC: info->i = m68k->dfc; break; |
| 1055 | 1055 | |
| 1056 | 1056 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1057 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68010); break; | |
| 1058 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m68010); break; | |
| 1057 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68010); break; | |
| 1058 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m68010); break; | |
| 1059 | 1059 | |
| 1060 | 1060 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1061 | 1061 | case CPUINFO_STR_NAME: strcpy(info->s, "68010"); break; |
| r3957 | r3958 | |
| 1129 | 1129 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 1130 | 1130 | case CPUINFO_INT_MAX_CYCLES: info->i = 158; break; |
| 1131 | 1131 | |
| 1132 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1133 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1132 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1133 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1134 | 1134 | |
| 1135 | 1135 | case CPUINFO_INT_PC: info->i = REG_PC; break; |
| 1136 | 1136 | case CPUINFO_INT_REGISTER + M68K_MSP: info->i = (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP; break; |
| r3957 | r3958 | |
| 1141 | 1141 | case CPUINFO_INT_REGISTER + M68K_DFC: info->i = m68k->dfc; break; |
| 1142 | 1142 | |
| 1143 | 1143 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1144 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68020); break; | |
| 1145 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m68020); break; | |
| 1144 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68020); break; | |
| 1145 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m68020); break; | |
| 1146 | 1146 | |
| 1147 | 1147 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1148 | 1148 | case CPUINFO_STR_NAME: strcpy(info->s, "68020"); break; |
| r3957 | r3958 | |
| 1225 | 1225 | switch (state) |
| 1226 | 1226 | { |
| 1227 | 1227 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1228 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 1228 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 1229 | 1229 | case CPUINFO_INT_PC: info->i = REG_PC & 0x00ffffff; break; |
| 1230 | 1230 | |
| 1231 | 1231 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1232 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68ec020); break; | |
| 1233 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m68ec020); break; | |
| 1232 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68ec020); break; | |
| 1233 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m68ec020); break; | |
| 1234 | 1234 | |
| 1235 | 1235 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1236 | 1236 | case CPUINFO_STR_NAME: strcpy(info->s, "68EC020"); break; |
| r3957 | r3958 | |
| 1300 | 1300 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 1301 | 1301 | case CPUINFO_INT_MAX_CYCLES: info->i = 158; break; |
| 1302 | 1302 | |
| 1303 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1304 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1303 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1304 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1305 | 1305 | |
| 1306 | 1306 | case CPUINFO_INT_PC: info->i = REG_PC; break; |
| 1307 | 1307 | case CPUINFO_INT_REGISTER + M68K_MSP: info->i = (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP; break; |
| r3957 | r3958 | |
| 1312 | 1312 | case CPUINFO_INT_REGISTER + M68K_DFC: info->i = m68k->dfc; break; |
| 1313 | 1313 | |
| 1314 | 1314 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1315 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68040); break; | |
| 1316 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m68040); break; | |
| 1315 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m68040); break; | |
| 1316 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m68040); break; | |
| 1317 | 1317 | |
| 1318 | 1318 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1319 | 1319 | case CPUINFO_STR_NAME: strcpy(info->s, "68040"); break; |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | ***************************************************************************/ |
| 58 | 58 | |
| 59 | 59 | CPU_GET_INFO( ccpu ); |
| 60 | #define CPU_CCPU CPU_GET_INFO_NAME( ccpu ) | |
| 61 | ||
| 60 | 62 | void ccpu_wdt_timer_trigger(const device_config *device); |
| 61 | 63 | |
| 62 | 64 | CPU_DISASSEMBLE( ccpu ); |
| r3957 | r3958 | |
|---|---|---|
| 737 | 737 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 738 | 738 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 739 | 739 | |
| 740 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 741 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 15; break; | |
| 742 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 743 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 744 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 745 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -1; break; | |
| 746 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 747 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 5; break; | |
| 748 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 740 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 741 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 15; break; | |
| 742 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 743 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 16; break; | |
| 744 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 8; break; | |
| 745 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -1; break; | |
| 746 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 747 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 5; break; | |
| 748 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 749 | 749 | |
| 750 | 750 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ break; |
| 751 | 751 | |
| r3957 | r3958 | |
| 770 | 770 | case CPUINFO_INT_REGISTER + CCPU_T: info->i = cpustate->T; break; |
| 771 | 771 | |
| 772 | 772 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 773 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ccpu); break; | |
| 774 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ccpu); break; | |
| 775 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ccpu); break; | |
| 776 | case CPUINFO_PTR_EXIT: info->exit = NULL; break; | |
| 777 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ccpu); break; | |
| 778 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 779 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ccpu); break; | |
| 773 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ccpu); break; | |
| 774 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ccpu); break; | |
| 775 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ccpu); break; | |
| 776 | case CPUINFO_FCT_EXIT: info->exit = NULL; break; | |
| 777 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ccpu); break; | |
| 778 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 779 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ccpu); break; | |
| 780 | 780 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 781 | 781 | |
| 782 | 782 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | /* register indexes for get_reg and set_reg */ |
| 20 | 20 | enum |
| 21 | 21 | { |
| 22 | TMS34010_PC | |
| 22 | TMS34010_PC | |
| 23 | 23 | TMS34010_SP, |
| 24 | 24 | TMS34010_ST, |
| 25 | 25 | TMS34010_A0, |
| r3957 | r3958 | |
| 51 | 51 | TMS34010_B11, |
| 52 | 52 | TMS34010_B12, |
| 53 | 53 | TMS34010_B13, |
| 54 | TMS34010_B14 | |
| 54 | TMS34010_B14, | |
| 55 | ||
| 56 | TMS34010_GENPC = REG_GENPC, | |
| 57 | TMS34010_GENSP = REG_GENSP, | |
| 58 | TMS34010_GENPCBASE = REG_GENPCBASE | |
| 55 | 59 | }; |
| 56 | 60 | |
| 57 | 61 | |
| r3957 | r3958 | |
| 207 | 211 | void tms34010_get_display_params(const device_config *cpu, tms34010_display_params *params); |
| 208 | 212 | |
| 209 | 213 | CPU_GET_INFO( tms34010 ); |
| 214 | #define CPU_TMS34010 CPU_GET_INFO_NAME( tms34010 ) | |
| 210 | 215 | |
| 211 | 216 | /* PUBLIC FUNCTIONS - 34020 */ |
| 212 | 217 | CPU_GET_INFO( tms34020 ); |
| 218 | #define CPU_TMS34020 CPU_GET_INFO_NAME( tms34020 ) | |
| 213 | 219 | |
| 214 | 220 | |
| 215 | 221 | /* Host control interface */ |
| r3957 | r3958 | |
|---|---|---|
| 88 | 88 | return; |
| 89 | 89 | |
| 90 | 90 | PUSH(tms, tms->pc); |
| 91 | PUSH(tms, | |
| 91 | PUSH(tms, | |
| 92 | 92 | RESET_ST(tms); |
| 93 | 93 | tms->pc = RLONG(tms, 0xfffffc20); |
| 94 | 94 | COUNT_UNKNOWN_CYCLES(tms,16); |
| r3957 | r3958 | |
| 1562 | 1562 | |
| 1563 | 1563 | #define GETST(R) \ |
| 1564 | 1564 | { \ |
| 1565 | R##REG(tms,DSTREG(op)) = | |
| 1565 | R##REG(tms,DSTREG(op)) = | |
| 1566 | 1566 | COUNT_CYCLES(tms,1); \ |
| 1567 | 1567 | } |
| 1568 | 1568 | static void getst_a (tms34010_state *tms, UINT16 op) { GETST(A); } |
| r3957 | r3958 | |
| 1844 | 1844 | |
| 1845 | 1845 | static void pushst(tms34010_state *tms, UINT16 op) |
| 1846 | 1846 | { |
| 1847 | PUSH(tms, | |
| 1847 | PUSH(tms, | |
| 1848 | 1848 | COUNT_CYCLES(tms,2); |
| 1849 | 1849 | } |
| 1850 | 1850 | |
| r3957 | r3958 | |
| 1892 | 1892 | if (t) |
| 1893 | 1893 | { |
| 1894 | 1894 | PUSH(tms, tms->pc); |
| 1895 | PUSH(tms, | |
| 1895 | PUSH(tms, | |
| 1896 | 1896 | } |
| 1897 | 1897 | RESET_ST(tms); |
| 1898 | 1898 | tms->pc = RLONG(tms, 0xffffffe0-(t<<5)); |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | struct _tms34010_state |
| 46 | 46 | { |
| 47 | 47 | UINT32 pc; |
| 48 | UINT32 ppc; | |
| 48 | 49 | UINT32 st; |
| 49 | 50 | void (*pixel_write)(tms34010_state *tms, offs_t offset, UINT32 data); |
| 50 | 51 | UINT32 (*pixel_read)(tms34010_state *tms, offs_t offset); |
| r3957 | r3958 | |
| 76 | 77 | XY xy; |
| 77 | 78 | } regs[31]; |
| 78 | 79 | |
| 79 | /* for the 34010, we only copy 32 of these into the new state */ | |
| 80 | 80 | UINT16 IOregs[64]; |
| 81 | ||
| 82 | cpu_state_table state; | |
| 81 | 83 | }; |
| 82 | 84 | |
| 83 | 85 | #include "34010ops.h" |
| 84 | 86 | |
| 85 | 87 | |
| 88 | ||
| 86 | 89 | /*************************************************************************** |
| 87 | 90 | GLOBAL VARIABLES |
| 88 | 91 | ***************************************************************************/ |
| r3957 | r3958 | |
| 98 | 101 | static STATE_POSTLOAD( tms34010_state_postload ); |
| 99 | 102 | |
| 100 | 103 | |
| 104 | ||
| 101 | 105 | /*************************************************************************** |
| 102 | 106 | MACROS |
| 103 | 107 | ***************************************************************************/ |
| r3957 | r3958 | |
| 188 | 192 | |
| 189 | 193 | |
| 190 | 194 | /*************************************************************************** |
| 191 | | |
| 195 | CPU | |
| 192 | 196 | ***************************************************************************/ |
| 193 | 197 | |
| 194 | /* Combine indiviual flags into the Status Register */ | |
| 195 | INLINE UINT32 GET_ST(tms34010_state *tms) | |
| 198 | #define TMS340X0_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \ | |
| 199 | CPU_STATE_ENTRY(TMS34010_##_name, #_name, _format, tms34010_state, _member, _datamask, ~0, _flags) | |
| 200 | ||
| 201 | static const cpu_state_entry state_array[] = | |
| 196 | 202 | { |
| 197 | return tms->st; | |
| 198 | } | |
| 203 | TMS340X0_STATE_ENTRY(PC, "%08X", pc, 0xffffffff, 0) | |
| 204 | TMS340X0_STATE_ENTRY(GENPC, "%08X", pc, 0xffffffff, CPUSTATE_NOSHOW) | |
| 205 | TMS340X0_STATE_ENTRY(GENPCBASE, "%08X", ppc, 0xffffffff, CPUSTATE_NOSHOW) | |
| 199 | 206 | |
| 207 | TMS340X0_STATE_ENTRY(SP, "%08X", regs[15].reg, 0xffffffff, 0) | |
| 208 | TMS340X0_STATE_ENTRY(GENSP, "%08X", regs[15].reg, 0xffffffff, CPUSTATE_NOSHOW) | |
| 209 | ||
| 210 | TMS340X0_STATE_ENTRY(ST, "%08X", st, 0xffffffff, 0) | |
| 211 | ||
| 212 | TMS340X0_STATE_ENTRY(A0, "%08X", regs[0].reg, 0xffffffff, 0) | |
| 213 | TMS340X0_STATE_ENTRY(A1, "%08X", regs[1].reg, 0xffffffff, 0) | |
| 214 | TMS340X0_STATE_ENTRY(A2, "%08X", regs[2].reg, 0xffffffff, 0) | |
| 215 | TMS340X0_STATE_ENTRY(A3, "%08X", regs[3].reg, 0xffffffff, 0) | |
| 216 | TMS340X0_STATE_ENTRY(A4, "%08X", regs[4].reg, 0xffffffff, 0) | |
| 217 | TMS340X0_STATE_ENTRY(A5, "%08X", regs[5].reg, 0xffffffff, 0) | |
| 218 | TMS340X0_STATE_ENTRY(A6, "%08X", regs[6].reg, 0xffffffff, 0) | |
| 219 | TMS340X0_STATE_ENTRY(A7, "%08X", regs[7].reg, 0xffffffff, 0) | |
| 220 | TMS340X0_STATE_ENTRY(A8, "%08X", regs[8].reg, 0xffffffff, 0) | |
| 221 | TMS340X0_STATE_ENTRY(A9, "%08X", regs[9].reg, 0xffffffff, 0) | |
| 222 | TMS340X0_STATE_ENTRY(A10, "%08X", regs[10].reg, 0xffffffff, 0) | |
| 223 | TMS340X0_STATE_ENTRY(A11, "%08X", regs[11].reg, 0xffffffff, 0) | |
| 224 | TMS340X0_STATE_ENTRY(A12, "%08X", regs[12].reg, 0xffffffff, 0) | |
| 225 | TMS340X0_STATE_ENTRY(A13, "%08X", regs[13].reg, 0xffffffff, 0) | |
| 226 | TMS340X0_STATE_ENTRY(A14, "%08X", regs[14].reg, 0xffffffff, 0) | |
| 227 | TMS340X0_STATE_ENTRY(B0, "%08X", regs[30-0].reg, 0xffffffff, 0) | |
| 228 | TMS340X0_STATE_ENTRY(B1, "%08X", regs[30-1].reg, 0xffffffff, 0) | |
| 229 | TMS340X0_STATE_ENTRY(B2, "%08X", regs[30-2].reg, 0xffffffff, 0) | |
| 230 | TMS340X0_STATE_ENTRY(B3, "%08X", regs[30-3].reg, 0xffffffff, 0) | |
| 231 | TMS340X0_STATE_ENTRY(B4, "%08X", regs[30-4].reg, 0xffffffff, 0) | |
| 232 | TMS340X0_STATE_ENTRY(B5, "%08X", regs[30-5].reg, 0xffffffff, 0) | |
| 233 | TMS340X0_STATE_ENTRY(B6, "%08X", regs[30-6].reg, 0xffffffff, 0) | |
| 234 | TMS340X0_STATE_ENTRY(B7, "%08X", regs[30-7].reg, 0xffffffff, 0) | |
| 235 | TMS340X0_STATE_ENTRY(B8, "%08X", regs[30-8].reg, 0xffffffff, 0) | |
| 236 | TMS340X0_STATE_ENTRY(B9, "%08X", regs[30-9].reg, 0xffffffff, 0) | |
| 237 | TMS340X0_STATE_ENTRY(B10, "%08X", regs[30-10].reg, 0xffffffff, 0) | |
| 238 | TMS340X0_STATE_ENTRY(B11, "%08X", regs[30-11].reg, 0xffffffff, 0) | |
| 239 | TMS340X0_STATE_ENTRY(B12, "%08X", regs[30-12].reg, 0xffffffff, 0) | |
| 240 | TMS340X0_STATE_ENTRY(B13, "%08X", regs[30-13].reg, 0xffffffff, 0) | |
| 241 | TMS340X0_STATE_ENTRY(B14, "%08X", regs[30-14].reg, 0xffffffff, 0) | |
| 242 | }; | |
| 243 | ||
| 244 | static const cpu_state_table state_table_template = | |
| 245 | { | |
| 246 | NULL, /* pointer to the base of state (offsets are relative to this) */ | |
| 247 | 0, /* subtype this table refers to */ | |
| 248 | ARRAY_LENGTH(state_array), /* number of entries */ | |
| 249 | state_array /* array of entries */ | |
| 250 | }; | |
| 251 | ||
| 252 | ||
| 253 | ||
| 254 | /*************************************************************************** | |
| 255 | INLINE SHORTCUTS | |
| 256 | ***************************************************************************/ | |
| 257 | ||
| 200 | 258 | /* Break up Status Register into indiviual flags */ |
| 201 | 259 | INLINE void SET_ST(tms34010_state *tms, UINT32 st) |
| 202 | 260 | { |
| r3957 | r3958 | |
| 326 | 384 | ***************************************************************************/ |
| 327 | 385 | |
| 328 | 386 | /* No Raster Op + No Transparency */ |
| 329 | #define WP(T,m1,m2) | |
| 387 | #define WP(T,m1,m2) | |
| 330 | 388 | UINT32 a = TOBYTE(offset & 0xfffffff0); \ |
| 331 | 389 | UINT32 pix = TMS34010_RDMEM_WORD(T,a); \ |
| 332 | 390 | UINT32 shiftcount = offset & m1; \ |
| r3957 | r3958 | |
| 363 | 421 | TMS34010_WRMEM_WORD(T, a, pix); \ |
| 364 | 422 | |
| 365 | 423 | /* Raster Op + Transparency */ |
| 366 | #define WP_R_T(T,m1,m2) | |
| 424 | #define WP_R_T(T,m1,m2) | |
| 367 | 425 | UINT32 a = TOBYTE(offset & 0xfffffff0); \ |
| 368 | 426 | UINT32 pix = TMS34010_RDMEM_WORD(T,a); \ |
| 369 | 427 | UINT32 shiftcount = offset & m1; \ |
| r3957 | r3958 | |
| 540 | 598 | if (!(IOREG(tms, REG_HSTCTLH) & 0x0200)) |
| 541 | 599 | { |
| 542 | 600 | PUSH(tms, tms->pc); |
| 543 | PUSH(tms, | |
| 601 | PUSH(tms, | |
| 544 | 602 | } |
| 545 | 603 | |
| 546 | 604 | /* leap to the vector */ |
| r3957 | r3958 | |
| 596 | 654 | if (vector) |
| 597 | 655 | { |
| 598 | 656 | PUSH(tms, tms->pc); |
| 599 | PUSH(tms, | |
| 657 | PUSH(tms, | |
| 600 | 658 | RESET_ST(tms); |
| 601 | 659 | tms->pc = RLONG(tms, vector); |
| 602 | 660 | COUNT_CYCLES(tms,16); |
| r3957 | r3958 | |
| 624 | 682 | tms->irq_callback = irqcallback; |
| 625 | 683 | tms->device = device; |
| 626 | 684 | tms->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 627 | tms->screen = dev | |
| 685 | tms->screen = devtag_ge | |
| 628 | 686 | |
| 687 | /* set up the state table */ | |
| 688 | tms->state = state_table_template; | |
| 689 | tms->state.baseptr = tms; | |
| 690 | tms->state.subtypemask = 1; | |
| 691 | ||
| 629 | 692 | /* allocate a scanline timer and set it to go off at the start */ |
| 630 | 693 | tms->scantimer = timer_alloc(device->machine, scanline_callback, tms); |
| 631 | timer_adjust_oneshot(tms->scantimer, attotime_zero, | |
| 694 | timer_adjust_oneshot(tms->scantimer, attotime_zero, 0 | |
| 632 | 695 | |
| 633 | 696 | /* allocate the shiftreg */ |
| 634 | 697 | tms->shiftreg = auto_malloc(SHIFTREG_SIZE); |
| r3957 | r3958 | |
| 656 | 719 | UINT16 *shiftreg = tms->shiftreg; |
| 657 | 720 | cpu_irq_callback save_irqcallback = tms->irq_callback; |
| 658 | 721 | emu_timer *save_scantimer = tms->scantimer; |
| 722 | cpu_state_table savetable = tms->state; | |
| 659 | 723 | |
| 660 | 724 | memset(tms, 0, sizeof(*tms)); |
| 661 | 725 | |
| r3957 | r3958 | |
| 666 | 730 | tms->scantimer = save_scantimer; |
| 667 | 731 | tms->device = device; |
| 668 | 732 | tms->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 733 | tms->state = savetable; | |
| 669 | 734 | |
| 670 | 735 | /* fetch the initial PC and reset the state */ |
| 671 | 736 | tms->pc = RLONG(tms, 0xffffffe0) & 0xfffffff0; |
| r3957 | r3958 | |
| 737 | 802 | { |
| 738 | 803 | tms34010_state *tms = ptr; |
| 739 | 804 | int type = param; |
| 740 | int cpunum; | |
| 741 | 805 | |
| 742 | 806 | /* call through to the CPU to generate the int */ |
| 743 | 807 | IOREG(tms, REG_INTPEND) |= type; |
| 744 | 808 | LOG(("TMS34010 '%s' set internal interrupt $%04x\n", tms->device->tag, type)); |
| 745 | 809 | |
| 746 | 810 | /* generate triggers so that spin loops can key off them */ |
| 747 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 748 | if (machine->cpu[cpunum] == tms->device) | |
| 749 | { | |
| 750 | cpu_triggerint(machine->cpu[cpunum]); | |
| 751 | break; | |
| 752 | } | |
| 811 | cpu_triggerint(tms->device); | |
| 753 | 812 | } |
| 754 | 813 | |
| 755 | 814 | |
| r3957 | r3958 | |
| 783 | 842 | { |
| 784 | 843 | do |
| 785 | 844 | { |
| 786 | UINT16 op = ROPCODE(tms); | |
| 845 | UINT16 op; | |
| 846 | tms->ppc = tms->pc; | |
| 847 | op = ROPCODE(tms); | |
| 787 | 848 | (*opcode_table[op >> 4])(tms, op); |
| 788 | 849 | } while (tms->icount > 0); |
| 789 | 850 | } |
| r3957 | r3958 | |
| 792 | 853 | do |
| 793 | 854 | { |
| 794 | 855 | UINT16 op; |
| 795 | if ((tms->device->machine->debug_flags & DEBUG_FLAG_CALL_HOOK) != 0) | |
| 796 | { | |
| 797 | tms->st = GET_ST(tms); | |
| 798 | debugger_instruction_hook(tms->device, tms->pc); | |
| 799 | } | |
| 856 | debugger_instruction_hook(tms->device, tms->pc); | |
| 857 | tms->ppc = tms->pc; | |
| 800 | 858 | op = ROPCODE(tms); |
| 801 | 859 | (*opcode_table[op >> 4])(tms, op); |
| 802 | 860 | } while (tms->icount > 0); |
| r3957 | r3958 | |
| 893 | 951 | tms34010_state *tms = ptr; |
| 894 | 952 | const rectangle *current_visarea; |
| 895 | 953 | int vsblnk, veblnk, vtotal; |
| 896 | int vcount = param >> 8; | |
| 897 | int cpunum = param & 0xff; | |
| 954 | int vcount = param; | |
| 898 | 955 | int enabled; |
| 899 | 956 | int master; |
| 900 | 957 | |
| r3957 | r3958 | |
| 1025 | 1082 | |
| 1026 | 1083 | /* note that we add !master (0 or 1) as a attoseconds value; this makes no practical difference */ |
| 1027 | 1084 | /* but helps ensure that masters are updated first before slaves */ |
| 1028 | timer_adjust_oneshot(tms->scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos(tms->screen, vcount, 0), !master), | |
| 1085 | timer_adjust_oneshot(tms->scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos(tms->screen, vcount, 0), !master), | |
| 1029 | 1086 | } |
| 1030 | 1087 | |
| 1031 | 1088 | |
| r3957 | r3958 | |
| 1068 | 1125 | pen_t blackpen = get_black_pen(screen->machine); |
| 1069 | 1126 | tms34010_display_params params; |
| 1070 | 1127 | tms34010_state *tms = NULL; |
| 1071 | | |
| 1128 | const device_config *cpu; | |
| 1072 | 1129 | int x; |
| 1073 | 1130 | |
| 1074 | 1131 | /* find the owning CPU */ |
| 1075 | for (cpu | |
| 1132 | for (cpu | |
| 1076 | 1133 | { |
| 1077 | const device_config *cpudevice = screen->machine->cpu[cpunum]; | |
| 1078 | if (cpudevice != NULL) | |
| 1134 | cpu_type type = cpu_get_type(cpu); | |
| 1135 | if (type == CPU_TMS34010 || type == CPU_TMS34020) | |
| 1079 | 1136 | { |
| 1080 | const cpu_class_header *classdata = cpudevice->classtoken; | |
| 1081 | if (classdata->cputype == CPU_TMS34010 || classdata->cputype == CPU_TMS34020) | |
| 1082 | { | |
| 1083 | tms = cpudevice->token; | |
| 1084 | if (tms->config != NULL && tms->config->scanline_callback != NULL && tms->screen == screen) | |
| 1085 | break; | |
| 1086 | tms = NULL; | |
| 1087 | } | |
| 1137 | tms = cpu->token; | |
| 1138 | if (tms->config != NULL && tms->config->scanline_callback != NULL && tms->screen == screen) | |
| 1139 | break; | |
| 1140 | tms = NULL; | |
| 1088 | 1141 | } |
| 1089 | 1142 | } |
| 1090 | 1143 | if (tms == NULL) |
| r3957 | r3958 | |
| 1259 | 1312 | } |
| 1260 | 1313 | |
| 1261 | 1314 | // if (LOG_CONTROL_REGS) |
| 1262 | // logerror(" | |
| 1315 | // logerror(" | |
| 1263 | 1316 | } |
| 1264 | 1317 | |
| 1265 | 1318 | |
| r3957 | r3958 | |
| 1296 | 1349 | IOREG(tms, offset) = data; |
| 1297 | 1350 | |
| 1298 | 1351 | // if (LOG_CONTROL_REGS) |
| 1299 | // logerror(" | |
| 1352 | // logerror(" | |
| 1300 | 1353 | |
| 1301 | 1354 | switch (offset) |
| 1302 | 1355 | { |
| r3957 | r3958 | |
| 1455 | 1508 | int result, total; |
| 1456 | 1509 | |
| 1457 | 1510 | // if (LOG_CONTROL_REGS) |
| 1458 | // logerror(" | |
| 1511 | // logerror(" | |
| 1459 | 1512 | |
| 1460 | 1513 | switch (offset) |
| 1461 | 1514 | { |
| r3957 | r3958 | |
| 1498 | 1551 | int result, total; |
| 1499 | 1552 | |
| 1500 | 1553 | // if (LOG_CONTROL_REGS) |
| 1501 | // logerror(" | |
| 1554 | // logerror(" | |
| 1502 | 1555 | |
| 1503 | 1556 | switch (offset) |
| 1504 | 1557 | { |
| r3957 | r3958 | |
| 1666 | 1719 | switch (state) |
| 1667 | 1720 | { |
| 1668 | 1721 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 1669 | case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(tms, 0, info->i); break; | |
| 1670 | case CPUINFO_INT_INPUT_STATE + 1: set_irq_line(tms, 1, info->i); break; | |
| 1671 | ||
| 1672 | case CPUINFO_INT_PC: tms->pc = info->i; break; | |
| 1673 | case CPUINFO_INT_REGISTER + TMS34010_PC: tms->pc = info->i; break; | |
| 1674 | case CPUINFO_INT_SP: | |
| 1675 | case CPUINFO_INT_REGISTER + TMS34010_SP: SP(tms) = info->i; break; | |
| 1676 | case CPUINFO_INT_REGISTER + TMS34010_ST: tms->st = info->i; break; | |
| 1677 | case CPUINFO_INT_REGISTER + TMS34010_A0: AREG(tms, 0) = info->i; break; | |
| 1678 | case CPUINFO_INT_REGISTER + TMS34010_A1: AREG(tms, 1) = info->i; break; | |
| 1679 | case CPUINFO_INT_REGISTER + TMS34010_A2: AREG(tms, 2) = info->i; break; | |
| 1680 | case CPUINFO_INT_REGISTER + TMS34010_A3: AREG(tms, 3) = info->i; break; | |
| 1681 | case CPUINFO_INT_REGISTER + TMS34010_A4: AREG(tms, 4) = info->i; break; | |
| 1682 | case CPUINFO_INT_REGISTER + TMS34010_A5: AREG(tms, 5) = info->i; break; | |
| 1683 | case CPUINFO_INT_REGISTER + TMS34010_A6: AREG(tms, 6) = info->i; break; | |
| 1684 | case CPUINFO_INT_REGISTER + TMS34010_A7: AREG(tms, 7) = info->i; break; | |
| 1685 | case CPUINFO_INT_REGISTER + TMS34010_A8: AREG(tms, 8) = info->i; break; | |
| 1686 | case CPUINFO_INT_REGISTER + TMS34010_A9: AREG(tms, 9) = info->i; break; | |
| 1687 | case CPUINFO_INT_REGISTER + TMS34010_A10: AREG(tms, 10) = info->i; break; | |
| 1688 | case CPUINFO_INT_REGISTER + TMS34010_A11: AREG(tms, 11) = info->i; break; | |
| 1689 | case CPUINFO_INT_REGISTER + TMS34010_A12: AREG(tms, 12) = info->i; break; | |
| 1690 | case CPUINFO_INT_REGISTER + TMS34010_A13: AREG(tms, 13) = info->i; break; | |
| 1691 | case CPUINFO_INT_REGISTER + TMS34010_A14: AREG(tms, 14) = info->i; break; | |
| 1692 | case CPUINFO_INT_REGISTER + TMS34010_B0: BREG(tms, 0) = info->i; break; | |
| 1693 | case CPUINFO_INT_REGISTER + TMS34010_B1: BREG(tms, 1) = info->i; break; | |
| 1694 | case CPUINFO_INT_REGISTER + TMS34010_B2: BREG(tms, 2) = info->i; break; | |
| 1695 | case CPUINFO_INT_REGISTER + TMS34010_B3: BREG(tms, 3) = info->i; break; | |
| 1696 | case CPUINFO_INT_REGISTER + TMS34010_B4: BREG(tms, 4) = info->i; break; | |
| 1697 | case CPUINFO_INT_REGISTER + TMS34010_B5: BREG(tms, 5) = info->i; break; | |
| 1698 | case CPUINFO_INT_REGISTER + TMS34010_B6: BREG(tms, 6) = info->i; break; | |
| 1699 | case CPUINFO_INT_REGISTER + TMS34010_B7: BREG(tms, 7) = info->i; break; | |
| 1700 | case CPUINFO_INT_REGISTER + TMS34010_B8: BREG(tms, 8) = info->i; break; | |
| 1701 | case CPUINFO_INT_REGISTER + TMS34010_B9: BREG(tms, 9) = info->i; break; | |
| 1702 | case CPUINFO_INT_REGISTER + TMS34010_B10: BREG(tms, 10) = info->i; break; | |
| 1703 | case CPUINFO_INT_REGISTER + TMS34010_B11: BREG(tms, 11) = info->i; break; | |
| 1704 | case CPUINFO_INT_REGISTER + TMS34010_B12: BREG(tms, 12) = info->i; break; | |
| 1705 | case CPUINFO_INT_REGISTER + TMS34010_B13: BREG(tms, 13) = info->i; break; | |
| 1706 | case CPUINFO_INT_REGISTER + TMS34010_B14: BREG(tms, 14) = info->i; break; | |
| 1722 | case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(tms, 0, info->i); break; | |
| 1723 | case CPUINFO_INT_INPUT_STATE + 1: set_irq_line(tms, 1, info->i); break; | |
| 1707 | 1724 | } |
| 1708 | 1725 | } |
| 1709 | 1726 | |
| r3957 | r3958 | |
| 1720 | 1737 | switch (state) |
| 1721 | 1738 | { |
| 1722 | 1739 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1723 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(tms34010_state); break; | |
| 1724 | case CPUINFO_INT_INPUT_LINES: info->i = 2; break; | |
| 1725 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; | |
| 1726 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; | |
| 1727 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; | |
| 1728 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 8; break; | |
| 1729 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; | |
| 1730 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 10; break; | |
| 1731 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; | |
| 1732 | case CPUINFO_INT_MAX_CYCLES: info->i = 10000; break; | |
| 1740 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(tms34010_state); break; | |
| 1741 | case CPUINFO_INT_INPUT_LINES: info->i = 2; break; | |
| 1742 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; | |
| 1743 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; | |
| 1744 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; | |
| 1745 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 8; break; | |
| 1746 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; | |
| 1747 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 10; break; | |
| 1748 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; | |
| 1749 | case CPUINFO_INT_MAX_CYCLES: info->i = 10000; break; | |
| 1733 | 1750 | |
| 1734 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1735 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1736 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 3; break; | |
| 1737 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1738 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1739 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1740 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1741 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1742 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1751 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1752 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1753 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 3; break; | |
| 1743 | 1754 | |
| 1744 | 1755 | case CPUINFO_INT_INPUT_STATE + 0: info->i = (IOREG(tms, REG_INTPEND) & TMS34010_INT1) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1745 | 1756 | case CPUINFO_INT_INPUT_STATE + 1: info->i = (IOREG(tms, REG_INTPEND) & TMS34010_INT2) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1746 | 1757 | |
| 1747 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ break; | |
| 1758 | /* --- the following bits of info are returned as pointers to functions --- */ | |
| 1759 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms34010); break; | |
| 1760 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tms34010); break; | |
| 1761 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms34010); break; | |
| 1762 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(tms34010); break; | |
| 1763 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms34010); break; | |
| 1764 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1765 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms34010); break; | |
| 1748 | 1766 | |
| 1749 | case CPUINFO_INT_PC: | |
| 1750 | case CPUINFO_INT_REGISTER + TMS34010_PC: info->i = tms->pc; break; | |
| 1751 | case CPUINFO_INT_SP: | |
| 1752 | case CPUINFO_INT_REGISTER + TMS34010_SP: info->i = SP(tms); break; | |
| 1753 | case CPUINFO_INT_REGISTER + TMS34010_ST: info->i = tms->st; break; | |
| 1754 | case CPUINFO_INT_REGISTER + TMS34010_A0: info->i = AREG(tms, 0); break; | |
| 1755 | case CPUINFO_INT_REGISTER + TMS34010_A1: info->i = AREG(tms, 1); break; | |
| 1756 | case CPUINFO_INT_REGISTER + TMS34010_A2: info->i = AREG(tms, 2); break; | |
| 1757 | case CPUINFO_INT_REGISTER + TMS34010_A3: info->i = AREG(tms, 3); break; | |
| 1758 | case CPUINFO_INT_REGISTER + TMS34010_A4: info->i = AREG(tms, 4); break; | |
| 1759 | case CPUINFO_INT_REGISTER + TMS34010_A5: info->i = AREG(tms, 5); break; | |
| 1760 | case CPUINFO_INT_REGISTER + TMS34010_A6: info->i = AREG(tms, 6); break; | |
| 1761 | case CPUINFO_INT_REGISTER + TMS34010_A7: info->i = AREG(tms, 7); break; | |
| 1762 | case CPUINFO_INT_REGISTER + TMS34010_A8: info->i = AREG(tms, 8); break; | |
| 1763 | case CPUINFO_INT_REGISTER + TMS34010_A9: info->i = AREG(tms, 9); break; | |
| 1764 | case CPUINFO_INT_REGISTER + TMS34010_A10: info->i = AREG(tms, 10); break; | |
| 1765 | case CPUINFO_INT_REGISTER + TMS34010_A11: info->i = AREG(tms, 11); break; | |
| 1766 | case CPUINFO_INT_REGISTER + TMS34010_A12: info->i = AREG(tms, 12); break; | |
| 1767 | case CPUINFO_INT_REGISTER + TMS34010_A13: info->i = AREG(tms, 13); break; | |
| 1768 | case CPUINFO_INT_REGISTER + TMS34010_A14: info->i = AREG(tms, 14); break; | |
| 1769 | case CPUINFO_INT_REGISTER + TMS34010_B0: info->i = BREG(tms, 0); break; | |
| 1770 | case CPUINFO_INT_REGISTER + TMS34010_B1: info->i = BREG(tms, 1); break; | |
| 1771 | case CPUINFO_INT_REGISTER + TMS34010_B2: info->i = BREG(tms, 2); break; | |
| 1772 | case CPUINFO_INT_REGISTER + TMS34010_B3: info->i = BREG(tms, 3); break; | |
| 1773 | case CPUINFO_INT_REGISTER + TMS34010_B4: info->i = BREG(tms, 4); break; | |
| 1774 | case CPUINFO_INT_REGISTER + TMS34010_B5: info->i = BREG(tms, 5); break; | |
| 1775 | case CPUINFO_INT_REGISTER + TMS34010_B6: info->i = BREG(tms, 6); break; | |
| 1776 | case CPUINFO_INT_REGISTER + TMS34010_B7: info->i = BREG(tms, 7); break; | |
| 1777 | case CPUINFO_INT_REGISTER + TMS34010_B8: info->i = BREG(tms, 8); break; | |
| 1778 | case CPUINFO_INT_REGISTER + TMS34010_B9: info->i = BREG(tms, 9); break; | |
| 1779 | case CPUINFO_INT_REGISTER + TMS34010_B10: info->i = BREG(tms, 10); break; | |
| 1780 | case CPUINFO_INT_REGISTER + TMS34010_B11: info->i = BREG(tms, 11); break; | |
| 1781 | case CPUINFO_INT_REGISTER + TMS34010_B12: info->i = BREG(tms, 12); break; | |
| 1782 | case CPUINFO_INT_REGISTER + TMS34010_B13: info->i = BREG(tms, 13); break; | |
| 1783 | case CPUINFO_INT_REGISTER + TMS34010_B14: info->i = BREG(tms, 14); break; | |
| 1784 | ||
| 1785 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 1786 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms34010); break; | |
| 1787 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tms34010); break; | |
| 1788 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms34010); break; | |
| 1789 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(tms34010); break; | |
| 1790 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms34010); break; | |
| 1791 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1792 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms34010); break; | |
| 1767 | /* --- the following bits of info are returned as pointers --- */ | |
| 1793 | 1768 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &tms->icount; break; |
| 1769 | case CPUINFO_PTR_STATE_TABLE: info->state_table = &tms->state; break; | |
| 1794 | 1770 | |
| 1795 | 1771 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1796 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS34010"); | |
| 1772 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS34010"); | |
| 1797 | 1773 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Texas Instruments 340x0"); break; |
| 1798 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 1799 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1774 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 1775 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1800 | 1776 | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Alex Pasadyn/Zsolt Vasvari\nParts based on code by Aaron Giles"); break; |
| 1801 | 1777 | |
| 1802 | 1778 | case CPUINFO_STR_FLAGS: |
| r3957 | r3958 | |
| 1820 | 1796 | tms->st & 0x00000002 ? 'F':'.', |
| 1821 | 1797 | tms->st & 0x00000001 ? 'F':'.'); |
| 1822 | 1798 | break; |
| 1823 | ||
| 1824 | case CPUINFO_STR_REGISTER + TMS34010_PC: sprintf(info->s, "PC :%08X", tms->pc); break; | |
| 1825 | case CPUINFO_STR_REGISTER + TMS34010_SP: sprintf(info->s, "SP :%08X", AREG(tms, 15)); break; | |
| 1826 | case CPUINFO_STR_REGISTER + TMS34010_ST: sprintf(info->s, "ST :%08X", tms->st); break; | |
| 1827 | case CPUINFO_STR_REGISTER + TMS34010_A0: sprintf(info->s, "A0 :%08X", AREG(tms, 0)); break; | |
| 1828 | case CPUINFO_STR_REGISTER + TMS34010_A1: sprintf(info->s, "A1 :%08X", AREG(tms, 1)); break; | |
| 1829 | case CPUINFO_STR_REGISTER + TMS34010_A2: sprintf(info->s, "A2 :%08X", AREG(tms, 2)); break; | |
| 1830 | case CPUINFO_STR_REGISTER + TMS34010_A3: sprintf(info->s, "A3 :%08X", AREG(tms, 3)); break; | |
| 1831 | case CPUINFO_STR_REGISTER + TMS34010_A4: sprintf(info->s, "A4 :%08X", AREG(tms, 4)); break; | |
| 1832 | case CPUINFO_STR_REGISTER + TMS34010_A5: sprintf(info->s, "A5 :%08X", AREG(tms, 5)); break; | |
| 1833 | case CPUINFO_STR_REGISTER + TMS34010_A6: sprintf(info->s, "A6 :%08X", AREG(tms, 6)); break; | |
| 1834 | case CPUINFO_STR_REGISTER + TMS34010_A7: sprintf(info->s, "A7 :%08X", AREG(tms, 7)); break; | |
| 1835 | case CPUINFO_STR_REGISTER + TMS34010_A8: sprintf(info->s, "A8 :%08X", AREG(tms, 8)); break; | |
| 1836 | case CPUINFO_STR_REGISTER + TMS34010_A9: sprintf(info->s, "A9 :%08X", AREG(tms, 9)); break; | |
| 1837 | case CPUINFO_STR_REGISTER + TMS34010_A10: sprintf(info->s,"A10:%08X", AREG(tms, 10)); break; | |
| 1838 | case CPUINFO_STR_REGISTER + TMS34010_A11: sprintf(info->s,"A11:%08X", AREG(tms, 11)); break; | |
| 1839 | case CPUINFO_STR_REGISTER + TMS34010_A12: sprintf(info->s,"A12:%08X", AREG(tms, 12)); break; | |
| 1840 | case CPUINFO_STR_REGISTER + TMS34010_A13: sprintf(info->s,"A13:%08X", AREG(tms, 13)); break; | |
| 1841 | case CPUINFO_STR_REGISTER + TMS34010_A14: sprintf(info->s,"A14:%08X", AREG(tms, 14)); break; | |
| 1842 | case CPUINFO_STR_REGISTER + TMS34010_B0: sprintf(info->s, "B0 :%08X", BREG(tms, 0)); break; | |
| 1843 | case CPUINFO_STR_REGISTER + TMS34010_B1: sprintf(info->s, "B1 :%08X", BREG(tms, 1)); break; | |
| 1844 | case CPUINFO_STR_REGISTER + TMS34010_B2: sprintf(info->s, "B2 :%08X", BREG(tms, 2)); break; | |
| 1845 | case CPUINFO_STR_REGISTER + TMS34010_B3: sprintf(info->s, "B3 :%08X", BREG(tms, 3)); break; | |
| 1846 | case CPUINFO_STR_REGISTER + TMS34010_B4: sprintf(info->s, "B4 :%08X", BREG(tms, 4)); break; | |
| 1847 | case CPUINFO_STR_REGISTER + TMS34010_B5: sprintf(info->s, "B5 :%08X", BREG(tms, 5)); break; | |
| 1848 | case CPUINFO_STR_REGISTER + TMS34010_B6: sprintf(info->s, "B6 :%08X", BREG(tms, 6)); break; | |
| 1849 | case CPUINFO_STR_REGISTER + TMS34010_B7: sprintf(info->s, "B7 :%08X", BREG(tms, 7)); break; | |
| 1850 | case CPUINFO_STR_REGISTER + TMS34010_B8: sprintf(info->s, "B8 :%08X", BREG(tms, 8)); break; | |
| 1851 | case CPUINFO_STR_REGISTER + TMS34010_B9: sprintf(info->s, "B9 :%08X", BREG(tms, 9)); break; | |
| 1852 | case CPUINFO_STR_REGISTER + TMS34010_B10: sprintf(info->s,"B10:%08X", BREG(tms, 10)); break; | |
| 1853 | case CPUINFO_STR_REGISTER + TMS34010_B11: sprintf(info->s,"B11:%08X", BREG(tms, 11)); break; | |
| 1854 | case CPUINFO_STR_REGISTER + TMS34010_B12: sprintf(info->s,"B12:%08X", BREG(tms, 12)); break; | |
| 1855 | case CPUINFO_STR_REGISTER + TMS34010_B13: sprintf(info->s,"B13:%08X", BREG(tms, 13)); break; | |
| 1856 | case CPUINFO_STR_REGISTER + TMS34010_B14: sprintf(info->s,"B14:%08X", BREG(tms, 14)); break; | |
| 1857 | 1799 | } |
| 1858 | 1800 | } |
| 1859 | 1801 | |
| r3957 | r3958 | |
| 1867 | 1809 | switch (state) |
| 1868 | 1810 | { |
| 1869 | 1811 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1870 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(tms34010_state); break; | |
| 1871 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; | |
| 1872 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 1812 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 1873 | 1813 | |
| 1874 | 1814 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1875 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms34020); break; | |
| 1876 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms34020); break; | |
| 1815 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms34020); break; | |
| 1816 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms34020); break; | |
| 1877 | 1817 | |
| 1878 | 1818 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1879 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS34020"); | |
| 1819 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS34020"); | |
| 1880 | 1820 | |
| 1881 | 1821 | default: CPU_GET_INFO_CALL(tms34010); break; |
| 1882 | 1822 | } |
| r3957 | r3958 | |
|---|---|---|
| 77 | 77 | extern CPU_GET_INFO( tms32031 ); |
| 78 | 78 | extern CPU_GET_INFO( tms32032 ); |
| 79 | 79 | |
| 80 | #define CPU_TMS32031 CPU_GET_INFO_NAME( tms32031 ) | |
| 81 | #define CPU_TMS32032 CPU_GET_INFO_NAME( tms32032 ) | |
| 82 | ||
| 80 | 83 | extern float convert_tms3203x_fp_to_float(UINT32 floatdata); |
| 81 | 84 | extern double convert_tms3203x_fp_to_double(UINT32 floatdata); |
| 82 | 85 | extern UINT32 convert_float_to_tms3203x_fp(float fval); |
| r3957 | r3958 | |
|---|---|---|
| 708 | 708 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 709 | 709 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 710 | 710 | |
| 711 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 712 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 713 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -2; break; | |
| 714 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 715 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 716 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 717 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 718 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 719 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 711 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 712 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 713 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -2; break; | |
| 714 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 715 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 716 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 717 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 718 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 719 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 720 | 720 | |
| 721 | 721 | case CPUINFO_INT_INPUT_STATE + TMS32031_IRQ0: info->i = (IREG(tms, TMR_IF) & (1 << TMS32031_IRQ0)) ? ASSERT_LINE : CLEAR_LINE; break; |
| 722 | 722 | case CPUINFO_INT_INPUT_STATE + TMS32031_IRQ1: info->i = (IREG(tms, TMR_IF) & (1 << TMS32031_IRQ1)) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 775 | 775 | case CPUINFO_INT_REGISTER + TMS32031_RC: info->i = IREG(tms, TMR_RC); break; |
| 776 | 776 | |
| 777 | 777 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 778 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms32031); break; | |
| 779 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tms32031); break; | |
| 780 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms32031); break; | |
| 781 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(tms32031); break; | |
| 782 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms32031); break; | |
| 783 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 784 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32031); break; | |
| 778 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms32031); break; | |
| 779 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tms32031); break; | |
| 780 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms32031); break; | |
| 781 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(tms32031); break; | |
| 782 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms32031); break; | |
| 783 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 784 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32031); break; | |
| 785 | 785 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &tms->icount; break; |
| 786 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 786 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 787 | 787 | |
| 788 | 788 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 789 | 789 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS32031"); break; |
| r3957 | r3958 | |
| 853 | 853 | switch (state) |
| 854 | 854 | { |
| 855 | 855 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 856 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms32032); break; | |
| 857 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(internal_32032); break; | |
| 856 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms32032); break; | |
| 857 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(internal_32032); break; | |
| 858 | 858 | |
| 859 | 859 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 860 | 860 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS32032"); break; |
| r3957 | r3958 | |
|---|---|---|
| 693 | 693 | mcs48_init - generic MCS-48 initialization |
| 694 | 694 | -------------------------------------------------*/ |
| 695 | 695 | |
| 696 | static void mcs48_init(const device_config *device, | |
| 696 | static void mcs48_init(const device_config *device, | |
| 697 | 697 | { |
| 698 | 698 | mcs48_state *cpustate = device->token; |
| 699 | 699 | |
| r3957 | r3958 | |
| 747 | 747 | #if (HAS_I8035 || HAS_MB8884) |
| 748 | 748 | static CPU_INIT( i8035 ) |
| 749 | 749 | { |
| 750 | mcs48_init(device, i | |
| 750 | mcs48_init(device, i | |
| 751 | 751 | } |
| 752 | 752 | #endif |
| 753 | 753 | |
| r3957 | r3958 | |
| 761 | 761 | #if (HAS_I8048 || HAS_I8648 || HAS_I8748 || HAS_N7751) |
| 762 | 762 | static CPU_INIT( i8048 ) |
| 763 | 763 | { |
| 764 | mcs48_init(device, i | |
| 764 | mcs48_init(device, i | |
| 765 | 765 | } |
| 766 | 766 | #endif |
| 767 | 767 | |
| r3957 | r3958 | |
| 775 | 775 | #if (HAS_I8039) |
| 776 | 776 | static CPU_INIT( i8039 ) |
| 777 | 777 | { |
| 778 | mcs48_init(device, i | |
| 778 | mcs48_init(device, i | |
| 779 | 779 | } |
| 780 | 780 | #endif |
| 781 | 781 | |
| r3957 | r3958 | |
| 789 | 789 | #if (HAS_I8049 || HAS_I8749 || HAS_M58715) |
| 790 | 790 | static CPU_INIT( i8049 ) |
| 791 | 791 | { |
| 792 | mcs48_init(device, i | |
| 792 | mcs48_init(device, i | |
| 793 | 793 | } |
| 794 | 794 | #endif |
| 795 | 795 | |
| r3957 | r3958 | |
| 1043 | 1043 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1044 | 1044 | case CPUINFO_INT_MAX_CYCLES: info->i = 3; break; |
| 1045 | 1045 | |
| 1046 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1047 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 12; break; | |
| 1048 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1049 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 1050 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: /*info->i = 6 or 7;*/ break; | |
| 1051 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1052 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1053 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 1054 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1046 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1047 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 12; break; | |
| 1048 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1049 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 1050 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: /*info->i = 6 or 7;*/ break; | |
| 1051 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1052 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1053 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 1054 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1055 | 1055 | |
| 1056 | 1056 | case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_IRQ: info->i = cpustate->irq_state ? ASSERT_LINE : CLEAR_LINE; break; |
| 1057 | 1057 | case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA: info->i = cpustate->ea; break; |
| r3957 | r3958 | |
| 1076 | 1076 | case CPUINFO_INT_REGISTER + MCS48_EA: info->i = cpustate->ea; break; |
| 1077 | 1077 | |
| 1078 | 1078 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1079 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mcs48); break; | |
| 1080 | case CPUINFO_PTR_INIT: /*info->init = CPU_INIT_NAME(i8039);*/ break; | |
| 1081 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(mcs48); break; | |
| 1082 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(mcs48); break; | |
| 1083 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1084 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mcs48); break; | |
| 1079 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mcs48); break; | |
| 1080 | case CPUINFO_FCT_INIT: /*info->init = CPU_INIT_NAME(i8039);*/ break; | |
| 1081 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mcs48); break; | |
| 1082 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(mcs48); break; | |
| 1083 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1084 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mcs48); break; | |
| 1085 | 1085 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1086 | 1086 | |
| 1087 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: /*info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);*/ break; | |
| 1088 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: /*info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);*/ break; | |
| 1087 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: /*info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);*/ break; | |
| 1088 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: /*info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);*/ break; | |
| 1089 | 1089 | |
| 1090 | 1090 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1091 | 1091 | case CPUINFO_STR_NAME: /*strcpy(info->s, "I8039");*/ break; |
| r3957 | r3958 | |
| 1137 | 1137 | { |
| 1138 | 1138 | switch (state) |
| 1139 | 1139 | { |
| 1140 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 1141 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1142 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8035); break; | |
| 1140 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 1141 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1142 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8035); break; | |
| 1143 | 1143 | case CPUINFO_STR_NAME: strcpy(info->s, "I8035"); break; |
| 1144 | 1144 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1145 | 1145 | } |
| r3957 | r3958 | |
| 1151 | 1151 | { |
| 1152 | 1152 | switch (state) |
| 1153 | 1153 | { |
| 1154 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 1155 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1156 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1157 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1154 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 1155 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1156 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1157 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1158 | 1158 | case CPUINFO_STR_NAME: strcpy(info->s, "I8048"); break; |
| 1159 | 1159 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1160 | 1160 | } |
| r3957 | r3958 | |
| 1166 | 1166 | { |
| 1167 | 1167 | switch (state) |
| 1168 | 1168 | { |
| 1169 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 1170 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1171 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1172 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1169 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 1170 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1171 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1172 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1173 | 1173 | case CPUINFO_STR_NAME: strcpy(info->s, "I8648"); break; |
| 1174 | 1174 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1175 | 1175 | } |
| r3957 | r3958 | |
| 1181 | 1181 | { |
| 1182 | 1182 | switch (state) |
| 1183 | 1183 | { |
| 1184 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 1185 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1186 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1187 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1184 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 1185 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1186 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1187 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1188 | 1188 | case CPUINFO_STR_NAME: strcpy(info->s, "I8748"); break; |
| 1189 | 1189 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1190 | 1190 | } |
| r3957 | r3958 | |
| 1196 | 1196 | { |
| 1197 | 1197 | switch (state) |
| 1198 | 1198 | { |
| 1199 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 1200 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1201 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8035); break; | |
| 1199 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 1200 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1201 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8035); break; | |
| 1202 | 1202 | case CPUINFO_STR_NAME: strcpy(info->s, "MB8884"); break; |
| 1203 | 1203 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1204 | 1204 | } |
| r3957 | r3958 | |
| 1210 | 1210 | { |
| 1211 | 1211 | switch (state) |
| 1212 | 1212 | { |
| 1213 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 1214 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1215 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1216 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1213 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 1214 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1215 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break; | |
| 1216 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8048); break; | |
| 1217 | 1217 | case CPUINFO_STR_NAME: strcpy(info->s, "N7751"); break; |
| 1218 | 1218 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1219 | 1219 | } |
| r3957 | r3958 | |
| 1227 | 1227 | { |
| 1228 | 1228 | switch (state) |
| 1229 | 1229 | { |
| 1230 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 1231 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1232 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8039); break; | |
| 1230 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1231 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1232 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8039); break; | |
| 1233 | 1233 | case CPUINFO_STR_NAME: strcpy(info->s, "I8039"); break; |
| 1234 | 1234 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1235 | 1235 | } |
| r3957 | r3958 | |
| 1241 | 1241 | { |
| 1242 | 1242 | switch (state) |
| 1243 | 1243 | { |
| 1244 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 1245 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1246 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1247 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8049); break; | |
| 1244 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1245 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1246 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1247 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8049); break; | |
| 1248 | 1248 | case CPUINFO_STR_NAME: strcpy(info->s, "I8049"); break; |
| 1249 | 1249 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1250 | 1250 | } |
| r3957 | r3958 | |
| 1256 | 1256 | { |
| 1257 | 1257 | switch (state) |
| 1258 | 1258 | { |
| 1259 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 1260 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1261 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1262 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8049); break; | |
| 1259 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1260 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1261 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1262 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8049); break; | |
| 1263 | 1263 | case CPUINFO_STR_NAME: strcpy(info->s, "I8749"); break; |
| 1264 | 1264 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1265 | 1265 | } |
| r3957 | r3958 | |
| 1271 | 1271 | { |
| 1272 | 1272 | switch (state) |
| 1273 | 1273 | { |
| 1274 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 1275 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1276 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1277 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8049); break; | |
| 1274 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1275 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1276 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1277 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8049); break; | |
| 1278 | 1278 | case CPUINFO_STR_NAME: strcpy(info->s, "M58715"); break; |
| 1279 | 1279 | default: CPU_GET_INFO_CALL(mcs48); break; |
| 1280 | 1280 | } |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | CPU_GET_INFO( mb8884 ); |
| 80 | 80 | CPU_GET_INFO( n7751 ); |
| 81 | 81 | |
| 82 | #define CPU_I8035 CPU_GET_INFO_NAME( i8035 ) | |
| 83 | #define CPU_I8048 CPU_GET_INFO_NAME( i8048 ) | |
| 84 | #define CPU_I8648 CPU_GET_INFO_NAME( i8648 ) | |
| 85 | #define CPU_I8748 CPU_GET_INFO_NAME( i8748 ) | |
| 86 | #define CPU_MB8884 CPU_GET_INFO_NAME( mb8884 ) | |
| 87 | #define CPU_N7751 CPU_GET_INFO_NAME( n7751 ) | |
| 88 | ||
| 82 | 89 | /* variants with 128 bytes of internal RAM and up to 2k of internal ROM */ |
| 83 | 90 | CPU_GET_INFO( i8039 ); |
| 84 | 91 | CPU_GET_INFO( i8049 ); |
| 85 | 92 | CPU_GET_INFO( i8749 ); |
| 86 | 93 | CPU_GET_INFO( m58715 ); |
| 87 | 94 | |
| 95 | #define CPU_I8039 CPU_GET_INFO_NAME( i8039 ) | |
| 96 | #define CPU_I8049 CPU_GET_INFO_NAME( i8049 ) | |
| 97 | #define CPU_I8749 CPU_GET_INFO_NAME( i8749 ) | |
| 98 | #define CPU_M58715 CPU_GET_INFO_NAME( m58715 ) | |
| 99 | ||
| 88 | 100 | /* disassembler */ |
| 89 | 101 | CPU_DISASSEMBLE( mcs48 ); |
| 90 | 102 |
| r3957 | r3958 | |
|---|---|---|
| 1076 | 1076 | case CPUINFO_INT_MAX_CYCLES: info->i = 20; /* rough guess */ break; |
| 1077 | 1077 | case CPUINFO_INT_INPUT_LINES: info->i = M37710_LINE_MAX; break; |
| 1078 | 1078 | |
| 1079 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1080 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 1081 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1082 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1083 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1084 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1085 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1086 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 1087 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1079 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1080 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 1081 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1082 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1083 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1084 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1085 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1086 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 1087 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1088 | 1088 | |
| 1089 | 1089 | case CPUINFO_INT_INPUT_STATE + M37710_LINE_IRQ0: info->i = 0; break; |
| 1090 | 1090 | case CPUINFO_INT_INPUT_STATE + M37710_LINE_IRQ1: info->i = 0; break; |
| r3957 | r3958 | |
| 1110 | 1110 | case CPUINFO_INT_REGISTER + M37710_IRQ_STATE: info->i = m37710_get_reg(cpustate, M37710_IRQ_STATE); break; |
| 1111 | 1111 | |
| 1112 | 1112 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1113 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m37710); break; | |
| 1114 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m37710); break; | |
| 1115 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m37710); break; | |
| 1116 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m37710); break; | |
| 1117 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m37710); break; | |
| 1118 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1119 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m37710); break; | |
| 1113 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m37710); break; | |
| 1114 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m37710); break; | |
| 1115 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m37710); break; | |
| 1116 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m37710); break; | |
| 1117 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m37710); break; | |
| 1118 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1119 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m37710); break; | |
| 1120 | 1120 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->ICount; break; |
| 1121 | 1121 | |
| 1122 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(m37710_internal_map); break; | |
| 1123 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map16 = NULL; break; | |
| 1124 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map8 = NULL; break; | |
| 1122 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(m37710_internal_map); break; | |
| 1123 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map16 = NULL; break; | |
| 1124 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map8 = NULL; break; | |
| 1125 | 1125 | |
| 1126 | 1126 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1127 | 1127 | case CPUINFO_STR_NAME: strcpy(info->s, "M37710"); break; |
| r3957 | r3958 | |
|---|---|---|
| 2903 | 2903 | case M37710_D: return REG_D; |
| 2904 | 2904 | case M37710_P: return m37710i_get_reg_p(cpustate); |
| 2905 | 2905 | case M37710_IRQ_STATE: return LINE_IRQ; |
| 2906 | case REG_ | |
| 2906 | case REG_G | |
| 2907 | 2907 | } |
| 2908 | 2908 | return 0; |
| 2909 | 2909 | } |
| r3957 | r3958 | |
|---|---|---|
| 85 | 85 | M37710_SER0_XMIT, M37710_SER1_REC, M37710_SER1_XMIT |
| 86 | 86 | }; |
| 87 | 87 | |
| 88 | /* ======================================================================== */ | |
| 89 | /* ================================= MAME ================================= */ | |
| 90 | /* ======================================================================== */ | |
| 91 | ||
| 92 | /* Clean up after the emulation core - Not used in this core - */ | |
| 93 | CPU_EXIT( m37710 ); | |
| 94 | ||
| 95 | /* Save the current CPU state to disk */ | |
| 96 | void m37710_state_save(void *file); | |
| 97 | ||
| 98 | /* Load a CPU state from disk */ | |
| 99 | void m37710_state_load(void *file); | |
| 100 | ||
| 101 | #undef M37710_CALL_DEBUGGER | |
| 102 | ||
| 103 | #define M37710_CALL_DEBUGGER(x) debugger_instruction_hook(cpustate->device, x) | |
| 104 | #define m37710_read_8(addr) memory_read_byte_16le(cpustate->program, addr) | |
| 105 | #define m37710_write_8(addr,data) memory_write_byte_16le(cpustate->program, addr,data) | |
| 106 | #define m37710_read_8_immediate(A) memory_read_byte_16le(cpustate->program, A) | |
| 107 | #define m37710_read_16(addr) memory_read_word_16le(cpustate->program, addr) | |
| 108 | #define m37710_write_16(addr,data) memory_write_word_16le(cpustate->program, addr,data) | |
| 109 | #define m37710_jumping(A) | |
| 110 | #define m37710_branching(A) | |
| 111 | ||
| 112 | ||
| 113 | 88 | CPU_GET_INFO( m37710 ); |
| 89 | CPU_GET_INFO( m37702 ); | |
| 114 | 90 | |
| 91 | #define CPU_M37710 CPU_GET_INFO_NAME( m37710 ) | |
| 92 | #define CPU_M37702 CPU_GET_INFO_NAME( m37702 ) | |
| 93 | ||
| 115 | 94 | /* ======================================================================== */ |
| 116 | 95 | /* ============================== END OF FILE ============================= */ |
| 117 | 96 | /* ======================================================================== */ |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | /* ======================================================================== */ |
| 21 | /* ================================= MAME ================================= */ | |
| 22 | /* ======================================================================== */ | |
| 23 | ||
| 24 | /* Clean up after the emulation core - Not used in this core - */ | |
| 25 | CPU_EXIT( m37710 ); | |
| 26 | ||
| 27 | /* Save the current CPU state to disk */ | |
| 28 | void m37710_state_save(void *file); | |
| 29 | ||
| 30 | /* Load a CPU state from disk */ | |
| 31 | void m37710_state_load(void *file); | |
| 32 | ||
| 33 | #undef M37710_CALL_DEBUGGER | |
| 34 | ||
| 35 | #define M37710_CALL_DEBUGGER(x) debugger_instruction_hook(cpustate->device, x) | |
| 36 | #define m37710_read_8(addr) memory_read_byte_16le(cpustate->program, addr) | |
| 37 | #define m37710_write_8(addr,data) memory_write_byte_16le(cpustate->program, addr,data) | |
| 38 | #define m37710_read_8_immediate(A) memory_read_byte_16le(cpustate->program, A) | |
| 39 | #define m37710_read_16(addr) memory_read_word_16le(cpustate->program, addr) | |
| 40 | #define m37710_write_16(addr,data) memory_write_word_16le(cpustate->program, addr,data) | |
| 41 | #define m37710_jumping(A) | |
| 42 | #define m37710_branching(A) | |
| 43 | ||
| 44 | ||
| 45 | /* ======================================================================== */ | |
| 21 | 46 | /* ================================ GENERAL =============================== */ |
| 22 | 47 | /* ======================================================================== */ |
| 23 | 48 |
| r3957 | r3958 | |
|---|---|---|
| 142 | 142 | # Analog Devices ADSP21xx series |
| 143 | 143 | #------------------------------------------------- |
| 144 | 144 | |
| 145 | CPUDEFS += -DHAS_ADSP2100=$(if $(filter ADSP2100,$(CPUS)),1,0) | |
| 146 | CPUDEFS += -DHAS_ADSP2101=$(if $(filter ADSP2101,$(CPUS)),1,0) | |
| 147 | CPUDEFS += -DHAS_ADSP2104=$(if $(filter ADSP2104,$(CPUS)),1,0) | |
| 148 | CPUDEFS += -DHAS_ADSP2105=$(if $(filter ADSP2105,$(CPUS)),1,0) | |
| 149 | CPUDEFS += -DHAS_ADSP2115=$(if $(filter ADSP2115,$(CPUS)),1,0) | |
| 150 | CPUDEFS += -DHAS_ADSP2181=$(if $(filter ADSP2181,$(CPUS)),1,0) | |
| 145 | CPUDEFS += -DHAS_ADSP21XX=$(if $(filter ADSP21XX,$(CPUS)),1,0) | |
| 151 | 146 | |
| 152 | ifneq ($(filter ADSP21 | |
| 147 | ifneq ($(filter ADSP21XX | |
| 153 | 148 | OBJDIRS += $(CPUOBJ)/adsp2100 |
| 154 | 149 | CPUOBJS += $(CPUOBJ)/adsp2100/adsp2100.o |
| 155 | 150 | DBGOBJS += $(CPUOBJ)/adsp2100/2100dasm.o |
| r3957 | r3958 | |
| 627 | 622 | # Intel 8080/8085A |
| 628 | 623 | #------------------------------------------------- |
| 629 | 624 | |
| 630 | CPUDEFS += -DHAS_8080=$(if $(filter 8080,$(CPUS)),1,0) | |
| 631 | CPUDEFS += -DHAS_8085A=$(if $(filter 8085A,$(CPUS)),1,0) | |
| 625 | CPUDEFS += -DHAS_I8085=$(if $(filter I8085,$(CPUS)),1,0) | |
| 632 | 626 | |
| 633 | ifneq ($(filter 808 | |
| 627 | ifneq ($(filter I808 | |
| 634 | 628 | OBJDIRS += $(CPUOBJ)/i8085 |
| 635 | 629 | CPUOBJS += $(CPUOBJ)/i8085/i8085.o |
| 636 | 630 | DBGOBJS += $(CPUOBJ)/i8085/8085dasm.o |
| r3957 | r3958 | |
| 755 | 749 | endif |
| 756 | 750 | |
| 757 | 751 | I86DEPS = \ |
| 758 | $(CPUSRC)/i86/i86.h \ | |
| 752 | $(CPUSRC)/i86/i86priv.h \ | |
| 759 | 753 | $(CPUSRC)/i86/ea.h \ |
| 760 | 754 | $(CPUSRC)/i86/host.h \ |
| 761 | 755 | $(CPUSRC)/i86/modrm.h |
| 762 | 756 | |
| 763 | 757 | $(CPUOBJ)/i86/i86.o: $(CPUSRC)/i86/i86.c \ |
| 758 | $(CPUSRC)/i86/i86.h \ | |
| 764 | 759 | $(CPUSRC)/i86/instr86.c \ |
| 765 | 760 | $(CPUSRC)/i86/instr186.c \ |
| 766 | $(CPUSRC)/i86/i86intf.h \ | |
| 767 | $(CPUSRC)/i86/i186intf.h \ | |
| 768 | 761 | $(I86DEPS) |
| 769 | 762 | |
| 770 | $(CPUOBJ)/i86/i286.o: $(CPUSRC)/i86/i86.c \ | |
| 763 | $(CPUOBJ)/i86/i286.o: $(CPUSRC)/i86/i286.c \ | |
| 764 | $(CPUSRC)/i86/i286.h \ | |
| 771 | 765 | $(CPUSRC)/i86/instr286.c \ |
| 772 | $(CPUSRC)/i86/i286intf.h \ | |
| 773 | 766 | $(I86DEPS) |
| 774 | 767 | |
| 775 | 768 | $(CPUOBJ)/i386/i386.o: $(CPUSRC)/i386/i386.c \ |
| 776 | 769 | $(CPUSRC)/i386/i386.h \ |
| 777 | $(CPUSRC)/i386/i386i | |
| 770 | $(CPUSRC)/i386/i386priv | |
| 778 | 771 | $(CPUSRC)/i386/i386op16.c \ |
| 779 | 772 | $(CPUSRC)/i386/i386op32.c \ |
| 780 | 773 | $(CPUSRC)/i386/i386ops.c \ |
| r3957 | r3958 | |
| 1274 | 1267 | |
| 1275 | 1268 | $(CPUOBJ)/nec/nec.o: $(CPUSRC)/nec/nec.c \ |
| 1276 | 1269 | $(CPUSRC)/nec/nec.h \ |
| 1277 | $(CPUSRC)/nec/necintrf.h \ | |
| 1278 | 1270 | $(CPUSRC)/nec/necea.h \ |
| 1279 | 1271 | $(CPUSRC)/nec/nechost.h \ |
| 1280 | 1272 | $(CPUSRC)/nec/necinstr.h \ |
| 1281 | $(CPUSRC)/nec/necmodrm.h | |
| 1273 | $(CPUSRC)/nec/necmodrm.h \ | |
| 1274 | $(CPUSRC)/nec/necpriv.h | |
| 1282 | 1275 | |
| 1283 | 1276 | $(CPUOBJ)/v30mz/v30mz.o: $(CPUSRC)/v30mz/v30mz.c \ |
| 1284 | 1277 | $(CPUSRC)/v30mz/v30mz.h \ |
| r3957 | r3958 | |
| 1286 | 1279 | $(CPUSRC)/v30mz/necinstr.h \ |
| 1287 | 1280 | $(CPUSRC)/v30mz/necea.h \ |
| 1288 | 1281 | $(CPUSRC)/v30mz/nechost.h \ |
| 1289 | $(CPUSRC)/v30mz/nec | |
| 1282 | $(CPUSRC)/v30mz/nec | |
| 1290 | 1283 | |
| 1291 | 1284 | |
| 1292 | 1285 |
| r3957 | r3958 | |
|---|---|---|
| 1081 | 1081 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1082 | 1082 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 1083 | 1083 | |
| 1084 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 1085 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 1086 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -3; break; | |
| 1087 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 32; break; | |
| 1088 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 32; break; | |
| 1089 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -2; break; | |
| 1090 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1091 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1092 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1084 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 1085 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 1086 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -3; break; | |
| 1087 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 32; break; | |
| 1088 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 32; break; | |
| 1089 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -2; break; | |
| 1090 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1091 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1092 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1093 | 1093 | |
| 1094 | 1094 | case CPUINFO_INT_INPUT_STATE: info->i = CLEAR_LINE; break; |
| 1095 | 1095 | |
| r3957 | r3958 | |
| 1197 | 1197 | case CPUINFO_INT_REGISTER + SHARC_B15: info->i = cpustate->dag2.b[7]; break; |
| 1198 | 1198 | |
| 1199 | 1199 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1200 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(sharc); break; | |
| 1201 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(sharc); break; | |
| 1202 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(sharc); break; | |
| 1203 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(sharc);break; | |
| 1204 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1205 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sharc); break; | |
| 1200 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(sharc); break; | |
| 1201 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(sharc); break; | |
| 1202 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(sharc); break; | |
| 1203 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sharc);break; | |
| 1204 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1205 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sharc); break; | |
| 1206 | 1206 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1207 | case CPUINFO_PTR_READ: info->read = CPU_READ_NAME(sharc); break; | |
| 1208 | case CPUINFO_PTR_READOP: info->readop = CPU_READOP_NAME(sharc); break; | |
| 1209 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map64 = ADDRESS_MAP_NAME(internal_pgm); break; | |
| 1207 | case CPUINFO_FCT_READ: info->read = CPU_READ_NAME(sharc); break; | |
| 1208 | case CPUINFO_FCT_READOP: info->readop = CPU_READOP_NAME(sharc); break; | |
| 1209 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map64 = ADDRESS_MAP_NAME(internal_pgm); break; | |
| 1210 | 1210 | |
| 1211 | 1211 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1212 | 1212 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "SHARC"); break; |
| r3957 | r3958 | |
| 1324 | 1324 | switch(state) |
| 1325 | 1325 | { |
| 1326 | 1326 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1327 | case CPUINFO_ | |
| 1327 | case CPUINFO_FCT | |
| 1328 | 1328 | |
| 1329 | 1329 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1330 | 1330 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP21062"); break; |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | #if (HAS_ADSP21062) |
| 31 | 31 | CPU_GET_INFO( adsp21062 ); |
| 32 | #define CPU_ADSP21062 CPU_GET_INFO_NAME( adsp21062 ) | |
| 32 | 33 | #endif |
| 33 | 34 | |
| 34 | 35 | extern UINT32 sharc_dasm_one(char *buffer, offs_t pc, UINT64 opcode); |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | const device_config *device; |
| 119 | 119 | const address_space *program; |
| 120 | 120 | const address_space *iospace; |
| 121 | cpu_state_table state; | |
| 122 | UINT8 rtemp; | |
| 123 | UINT32 ioltemp; | |
| 121 | 124 | int icount; |
| 122 | 125 | }; |
| 123 | 126 | |
| r3957 | r3958 | |
| 758 | 761 | #define Z180_IOCR_RMASK 0xff |
| 759 | 762 | #define Z180_IOCR_WMASK 0xff |
| 760 | 763 | |
| 764 | ||
| 765 | /*************************************************************************** | |
| 766 | CPU STATE DESCRIPTION | |
| 767 | ***************************************************************************/ | |
| 768 | ||
| 769 | #define Z180_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \ | |
| 770 | CPU_STATE_ENTRY(Z180_##_name, #_name, _format, z180_state, _member, _datamask, ~0, _flags) | |
| 771 | ||
| 772 | #define Z180_STATE_IO_ENTRY(_name, _flags) \ | |
| 773 | CPU_STATE_ENTRY(Z180_##_name, #_name, "%02X", z180_state, IO_##_name, 0xff, ~0, _flags) | |
| 774 | ||
| 775 | ||
| 776 | static const cpu_state_entry state_array[] = | |
| 777 | { | |
| 778 | Z180_STATE_ENTRY(PC, "%04X", PC.w.l, 0xffff, 0) | |
| 779 | Z180_STATE_ENTRY(GENPC, "%04X", _PCD, 0xffff, CPUSTATE_NOSHOW) | |
| 780 | Z180_STATE_ENTRY(GENPCBASE, "%04X", PREPC.w.l, 0xffff, CPUSTATE_NOSHOW) | |
| 781 | ||
| 782 | Z180_STATE_ENTRY(SP, "%04X", _SPD, 0xffff, 0) | |
| 783 | Z180_STATE_ENTRY(GENSP, "%04X", SP.w.l, 0xffff, CPUSTATE_NOSHOW) | |
| 784 | ||
| 785 | Z180_STATE_ENTRY(A, "%02X", _A, 0xff, CPUSTATE_NOSHOW) | |
| 786 | Z180_STATE_ENTRY(B, "%02X", _B, 0xff, CPUSTATE_NOSHOW) | |
| 787 | Z180_STATE_ENTRY(C, "%02X", _C, 0xff, CPUSTATE_NOSHOW) | |
| 788 | Z180_STATE_ENTRY(D, "%02X", _D, 0xff, CPUSTATE_NOSHOW) | |
| 789 | Z180_STATE_ENTRY(E, "%02X", _E, 0xff, CPUSTATE_NOSHOW) | |
| 790 | Z180_STATE_ENTRY(H, "%02X", _H, 0xff, CPUSTATE_NOSHOW) | |
| 791 | Z180_STATE_ENTRY(L, "%02X", _L, 0xff, CPUSTATE_NOSHOW) | |
| 792 | ||
| 793 | Z180_STATE_ENTRY(AF, "%04X", AF.w.l, 0xffff, 0) | |
| 794 | Z180_STATE_ENTRY(BC, "%04X", BC.w.l, 0xffff, 0) | |
| 795 | Z180_STATE_ENTRY(DE, "%04X", DE.w.l, 0xffff, 0) | |
| 796 | Z180_STATE_ENTRY(HL, "%04X", HL.w.l, 0xffff, 0) | |
| 797 | Z180_STATE_ENTRY(IX, "%04X", IX.w.l, 0xffff, 0) | |
| 798 | Z180_STATE_ENTRY(IY, "%04X", IY.w.l, 0xffff, 0) | |
| 799 | ||
| 800 | Z180_STATE_ENTRY(AF2, "%04X", AF2.w.l, 0xffff, 0) | |
| 801 | Z180_STATE_ENTRY(BC2, "%04X", BC2.w.l, 0xffff, 0) | |
| 802 | Z180_STATE_ENTRY(DE2, "%04X", DE2.w.l, 0xffff, 0) | |
| 803 | Z180_STATE_ENTRY(HL2, "%04X", HL2.w.l, 0xffff, 0) | |
| 804 | ||
| 805 | Z180_STATE_ENTRY(R, "%02X", rtemp, 0xff, CPUSTATE_EXPORT | CPUSTATE_IMPORT) | |
| 806 | Z180_STATE_ENTRY(I, "%02X", I, 0xff, 0) | |
| 807 | Z180_STATE_ENTRY(IM, "%1u", IM, 0x3, 0) | |
| 808 | Z180_STATE_ENTRY(IFF1, "%1u", IFF1, 0x1, 0) | |
| 809 | Z180_STATE_ENTRY(IFF2, "%1u", IFF2, 0x1, 0) | |
| 810 | Z180_STATE_ENTRY(HALT, "%1u", HALT, 0x1, 0) | |
| 811 | ||
| 812 | Z180_STATE_ENTRY(IOLINES, "%06X", ioltemp, 0xffffff, CPUSTATE_IMPORT) | |
| 813 | ||
| 814 | Z180_STATE_IO_ENTRY(CNTLA0, 0) | |
| 815 | Z180_STATE_IO_ENTRY(CNTLA1, 0) | |
| 816 | Z180_STATE_IO_ENTRY(CNTLB0, 0) | |
| 817 | Z180_STATE_IO_ENTRY(CNTLB1, 0) | |
| 818 | Z180_STATE_IO_ENTRY(STAT0, 0) | |
| 819 | Z180_STATE_IO_ENTRY(STAT1, 0) | |
| 820 | Z180_STATE_IO_ENTRY(TDR0, 0) | |
| 821 | Z180_STATE_IO_ENTRY(TDR1, 0) | |
| 822 | Z180_STATE_IO_ENTRY(RDR0, 0) | |
| 823 | Z180_STATE_IO_ENTRY(RDR1, 0) | |
| 824 | Z180_STATE_IO_ENTRY(CNTR, 0) | |
| 825 | Z180_STATE_IO_ENTRY(TRDR, 0) | |
| 826 | Z180_STATE_IO_ENTRY(TMDR0L, 0) | |
| 827 | Z180_STATE_IO_ENTRY(TMDR0H, 0) | |
| 828 | Z180_STATE_IO_ENTRY(RLDR0L, 0) | |
| 829 | Z180_STATE_IO_ENTRY(RLDR0H, 0) | |
| 830 | Z180_STATE_IO_ENTRY(TCR, 0) | |
| 831 | Z180_STATE_IO_ENTRY(IO11, 0) | |
| 832 | Z180_STATE_IO_ENTRY(ASEXT0, 0) | |
| 833 | Z180_STATE_IO_ENTRY(ASEXT1, 0) | |
| 834 | Z180_STATE_IO_ENTRY(TMDR1L, 0) | |
| 835 | Z180_STATE_IO_ENTRY(TMDR1H, 0) | |
| 836 | Z180_STATE_IO_ENTRY(RLDR1L, 0) | |
| 837 | Z180_STATE_IO_ENTRY(RLDR1H, 0) | |
| 838 | Z180_STATE_IO_ENTRY(FRC, 0) | |
| 839 | Z180_STATE_IO_ENTRY(IO19, 0) | |
| 840 | Z180_STATE_IO_ENTRY(ASTC0L, 0) | |
| 841 | Z180_STATE_IO_ENTRY(ASTC0H, 0) | |
| 842 | Z180_STATE_IO_ENTRY(ASTC1L, 0) | |
| 843 | Z180_STATE_IO_ENTRY(ASTC1H, 0) | |
| 844 | Z180_STATE_IO_ENTRY(CMR, 0) | |
| 845 | Z180_STATE_IO_ENTRY(CCR, 0) | |
| 846 | Z180_STATE_IO_ENTRY(SAR0L, 0) | |
| 847 | Z180_STATE_IO_ENTRY(SAR0H, 0) | |
| 848 | Z180_STATE_IO_ENTRY(SAR0B, 0) | |
| 849 | Z180_STATE_IO_ENTRY(DAR0L, 0) | |
| 850 | Z180_STATE_IO_ENTRY(DAR0H, 0) | |
| 851 | Z180_STATE_IO_ENTRY(DAR0B, 0) | |
| 852 | Z180_STATE_IO_ENTRY(BCR0L, 0) | |
| 853 | Z180_STATE_IO_ENTRY(BCR0H, 0) | |
| 854 | Z180_STATE_IO_ENTRY(MAR1L, 0) | |
| 855 | Z180_STATE_IO_ENTRY(MAR1H, 0) | |
| 856 | Z180_STATE_IO_ENTRY(MAR1B, 0) | |
| 857 | Z180_STATE_IO_ENTRY(IAR1L, 0) | |
| 858 | Z180_STATE_IO_ENTRY(IAR1H, 0) | |
| 859 | Z180_STATE_IO_ENTRY(IAR1B, 0) | |
| 860 | Z180_STATE_IO_ENTRY(BCR1L, 0) | |
| 861 | Z180_STATE_IO_ENTRY(BCR1H, 0) | |
| 862 | Z180_STATE_IO_ENTRY(DSTAT, 0) | |
| 863 | Z180_STATE_IO_ENTRY(DMODE, 0) | |
| 864 | Z180_STATE_IO_ENTRY(DCNTL, 0) | |
| 865 | Z180_STATE_IO_ENTRY(IL, 0) | |
| 866 | Z180_STATE_IO_ENTRY(ITC, 0) | |
| 867 | Z180_STATE_IO_ENTRY(IO35, 0) | |
| 868 | Z180_STATE_IO_ENTRY(RCR, 0) | |
| 869 | Z180_STATE_IO_ENTRY(IO37, 0) | |
| 870 | Z180_STATE_IO_ENTRY(CBR, CPUSTATE_IMPORT) | |
| 871 | Z180_STATE_IO_ENTRY(BBR, CPUSTATE_IMPORT) | |
| 872 | Z180_STATE_IO_ENTRY(CBAR, CPUSTATE_IMPORT) | |
| 873 | Z180_STATE_IO_ENTRY(IO3B, 0) | |
| 874 | Z180_STATE_IO_ENTRY(IO3C, 0) | |
| 875 | Z180_STATE_IO_ENTRY(IO3D, 0) | |
| 876 | Z180_STATE_IO_ENTRY(OMCR, 0) | |
| 877 | Z180_STATE_IO_ENTRY(IOCR, 0) | |
| 878 | }; | |
| 879 | ||
| 880 | static const cpu_state_table state_table_template = | |
| 881 | { | |
| 882 | NULL, /* pointer to the base of state (offsets are relative to this) */ | |
| 883 | 0, /* subtype this table refers to */ | |
| 884 | ARRAY_LENGTH(state_array), /* number of entries */ | |
| 885 | state_array /* array of entries */ | |
| 886 | }; | |
| 887 | ||
| 888 | ||
| 889 | ||
| 761 | 890 | static UINT8 SZ[256]; /* zero and sign flags */ |
| 762 | 891 | static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ |
| 763 | 892 | static UINT8 SZP[256]; /* zero, sign and parity flags */ |
| r3957 | r3958 | |
| 1884 | 2013 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 1885 | 2014 | cpustate->iospace = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| 1886 | 2015 | |
| 2016 | /* set up the state table */ | |
| 2017 | cpustate->state = state_table_template; | |
| 2018 | cpustate->state.baseptr = cpustate; | |
| 2019 | cpustate->state.subtypemask = 1; | |
| 2020 | ||
| 1887 | 2021 | state_save_register_device_item(device, 0, cpustate->AF.w.l); |
| 1888 | 2022 | state_save_register_device_item(device, 0, cpustate->BC.w.l); |
| 1889 | 2023 | state_save_register_device_item(device, 0, cpustate->DE.w.l); |
| r3957 | r3958 | |
| 1919 | 2053 | z180_state *cpustate = device->token; |
| 1920 | 2054 | z80_daisy_state *save_daisy; |
| 1921 | 2055 | cpu_irq_callback save_irqcallback; |
| 2056 | cpu_state_table save_table; | |
| 1922 | 2057 | int i, p; |
| 1923 | 2058 | int oldval, newval, val; |
| 1924 | 2059 | UINT8 *padd, *padc, *psub, *psbc; |
| r3957 | r3958 | |
| 1997 | 2132 | |
| 1998 | 2133 | save_daisy = cpustate->daisy; |
| 1999 | 2134 | save_irqcallback = cpustate->irq_callback; |
| 2135 | save_table = cpustate->state; | |
| 2000 | 2136 | memset(cpustate, 0, sizeof(*cpustate)); |
| 2001 | 2137 | cpustate->daisy = save_daisy; |
| 2002 | 2138 | cpustate->irq_callback = save_irqcallback; |
| 2139 | cpustate->state = save_table; | |
| 2003 | 2140 | cpustate->device = device; |
| 2004 | 2141 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 2005 | 2142 | cpustate->iospace = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| r3957 | r3958 | |
| 2303 | 2440 | return TRUE; |
| 2304 | 2441 | } |
| 2305 | 2442 | |
| 2443 | ||
| 2306 | 2444 | /************************************************************************** |
| 2445 | * STATE IMPORT/EXPORT | |
| 2446 | **************************************************************************/ | |
| 2447 | ||
| 2448 | static CPU_IMPORT_STATE( z180 ) | |
| 2449 | { | |
| 2450 | z180_state *cpustate = device->token; | |
| 2451 | ||
| 2452 | switch (entry->index) | |
| 2453 | { | |
| 2454 | case Z180_R: | |
| 2455 | cpustate->R = cpustate->rtemp & 0x7f; | |
| 2456 | cpustate->R2 = cpustate->rtemp & 0x80; | |
| 2457 | break; | |
| 2458 | ||
| 2459 | case Z180_CBR: | |
| 2460 | case Z180_BBR: | |
| 2461 | case Z180_CBAR: | |
| 2462 | z180_mmu(cpustate); | |
| 2463 | break; | |
| 2464 | ||
| 2465 | case Z180_IOLINES: | |
| 2466 | z180_write_iolines(cpustate, cpustate->ioltemp); | |
| 2467 | break; | |
| 2468 | ||
| 2469 | default: | |
| 2470 | fatalerror("CPU_IMPORT_STATE(z80) called for unexpected value\n"); | |
| 2471 | break; | |
| 2472 | } | |
| 2473 | } | |
| 2474 | ||
| 2475 | ||
| 2476 | static CPU_EXPORT_STATE( z180 ) | |
| 2477 | { | |
| 2478 | z180_state *cpustate = device->token; | |
| 2479 | ||
| 2480 | switch (entry->index) | |
| 2481 | { | |
| 2482 | case Z180_R: | |
| 2483 | cpustate->rtemp = (cpustate->R & 0x7f) | (cpustate->R2 & 0x80); | |
| 2484 | break; | |
| 2485 | ||
| 2486 | case Z180_IOLINES: | |
| 2487 | cpustate->ioltemp = cpustate->iol; | |
| 2488 | break; | |
| 2489 | ||
| 2490 | default: | |
| 2491 | fatalerror("CPU_EXPORT_STATE(z80) called for unexpected value\n"); | |
| 2492 | break; | |
| 2493 | } | |
| 2494 | } | |
| 2495 | ||
| 2496 | ||
| 2497 | /************************************************************************** | |
| 2307 | 2498 | * Generic set_info |
| 2308 | 2499 | **************************************************************************/ |
| 2309 | 2500 | |
| r3957 | r3958 | |
| 2314 | 2505 | { |
| 2315 | 2506 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 2316 | 2507 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(cpustate, INPUT_LINE_NMI, info->i); break; |
| 2317 | case CPUINFO_INT_INPUT_STATE + Z180_INT0: set_irq_line(cpustate, Z180_INT0, info->i); break; | |
| 2318 | case CPUINFO_INT_INPUT_STATE + Z180_INT1: set_irq_line(cpustate, Z180_INT1, info->i); break; | |
| 2319 | case CPUINFO_INT_INPUT_STATE + Z180_INT2: set_irq_line(cpustate, Z180_INT2, info->i); break; | |
| 2508 | case CPUINFO_INT_INPUT_STATE + Z180_INT0: set_irq_line(cpustate, Z180_INT0, info->i); break; | |
| 2320 | 2509 | |
| 2321 | case CPUINFO_INT_PC: cpustate->_PC = info->i; break; | |
| 2322 | case CPUINFO_INT_REGISTER + Z180_PC: cpustate->PC.w.l = info->i; break; | |
| 2323 | case CPUINFO_INT_SP: cpustate->_SP = info->i; break; | |
| 2324 | case CPUINFO_INT_REGISTER + Z180_SP: cpustate->SP.w.l = info->i; break; | |
| 2325 | case CPUINFO_INT_REGISTER + Z180_AF: cpustate->AF.w.l = info->i; break; | |
| 2326 | case CPUINFO_INT_REGISTER + Z180_BC: cpustate->BC.w.l = info->i; break; | |
| 2327 | case CPUINFO_INT_REGISTER + Z180_DE: cpustate->DE.w.l = info->i; break; | |
| 2328 | case CPUINFO_INT_REGISTER + Z180_HL: cpustate->HL.w.l = info->i; break; | |
| 2329 | case CPUINFO_INT_REGISTER + Z180_IX: cpustate->IX.w.l = info->i; break; | |
| 2330 | case CPUINFO_INT_REGISTER + Z180_IY: cpustate->IY.w.l = info->i; break; | |
| 2331 | case CPUINFO_INT_REGISTER + Z180_R: cpustate->R = info->i; cpustate->R2 = info->i & 0x80; break; | |
| 2332 | case CPUINFO_INT_REGISTER + Z180_I: cpustate->I = info->i; break; | |
| 2333 | case CPUINFO_INT_REGISTER + Z180_AF2: cpustate->AF2.w.l = info->i; break; | |
| 2334 | case CPUINFO_INT_REGISTER + Z180_BC2: cpustate->BC2.w.l = info->i; break; | |
| 2335 | case CPUINFO_INT_REGISTER + Z180_DE2: cpustate->DE2.w.l = info->i; break; | |
| 2336 | case CPUINFO_INT_REGISTER + Z180_HL2: cpustate->HL2.w.l = info->i; break; | |
| 2337 | case CPUINFO_INT_REGISTER + Z180_IM: cpustate->IM = info->i; break; | |
| 2338 | case CPUINFO_INT_REGISTER + Z180_IFF1: cpustate->IFF1 = info->i; break; | |
| 2339 | case CPUINFO_INT_REGISTER + Z180_IFF2: cpustate->IFF2 = info->i; break; | |
| 2340 | case CPUINFO_INT_REGISTER + Z180_HALT: cpustate->HALT = info->i; break; | |
| 2341 | case CPUINFO_INT_REGISTER + Z180_CNTLA0: cpustate->io[0x00] = info->i; break; | |
| 2342 | case CPUINFO_INT_REGISTER + Z180_CNTLA1: cpustate->io[0x01] = info->i; break; | |
| 2343 | case CPUINFO_INT_REGISTER + Z180_CNTLB0: cpustate->io[0x02] = info->i; break; | |
| 2344 | case CPUINFO_INT_REGISTER + Z180_CNTLB1: cpustate->io[0x03] = info->i; break; | |
| 2345 | case CPUINFO_INT_REGISTER + Z180_STAT0: cpustate->io[0x04] = info->i; break; | |
| 2346 | case CPUINFO_INT_REGISTER + Z180_STAT1: cpustate->io[0x05] = info->i; break; | |
| 2347 | case CPUINFO_INT_REGISTER + Z180_TDR0: cpustate->io[0x06] = info->i; break; | |
| 2348 | case CPUINFO_INT_REGISTER + Z180_TDR1: cpustate->io[0x07] = info->i; break; | |
| 2349 | case CPUINFO_INT_REGISTER + Z180_RDR0: cpustate->io[0x08] = info->i; break; | |
| 2350 | case CPUINFO_INT_REGISTER + Z180_RDR1: cpustate->io[0x09] = info->i; break; | |
| 2351 | case CPUINFO_INT_REGISTER + Z180_CNTR: cpustate->io[0x0a] = info->i; break; | |
| 2352 | case CPUINFO_INT_REGISTER + Z180_TRDR: cpustate->io[0x0b] = info->i; break; | |
| 2353 | case CPUINFO_INT_REGISTER + Z180_TMDR0L: cpustate->io[0x0c] = info->i; break; | |
| 2354 | case CPUINFO_INT_REGISTER + Z180_TMDR0H: cpustate->io[0x0d] = info->i; break; | |
| 2355 | case CPUINFO_INT_REGISTER + Z180_RLDR0L: cpustate->io[0x0e] = info->i; break; | |
| 2356 | case CPUINFO_INT_REGISTER + Z180_RLDR0H: cpustate->io[0x0f] = info->i; break; | |
| 2357 | case CPUINFO_INT_REGISTER + Z180_TCR: cpustate->io[0x10] = info->i; break; | |
| 2358 | case CPUINFO_INT_REGISTER + Z180_IO11: cpustate->io[0x11] = info->i; break; | |
| 2359 | case CPUINFO_INT_REGISTER + Z180_ASEXT0: cpustate->io[0x12] = info->i; break; | |
| 2360 | case CPUINFO_INT_REGISTER + Z180_ASEXT1: cpustate->io[0x13] = info->i; break; | |
| 2361 | case CPUINFO_INT_REGISTER + Z180_TMDR1L: cpustate->io[0x14] = info->i; break; | |
| 2362 | case CPUINFO_INT_REGISTER + Z180_TMDR1H: cpustate->io[0x15] = info->i; break; | |
| 2363 | case CPUINFO_INT_REGISTER + Z180_RLDR1L: cpustate->io[0x16] = info->i; break; | |
| 2364 | case CPUINFO_INT_REGISTER + Z180_RLDR1H: cpustate->io[0x17] = info->i; break; | |
| 2365 | case CPUINFO_INT_REGISTER + Z180_FRC: cpustate->io[0x18] = info->i; break; | |
| 2366 | case CPUINFO_INT_REGISTER + Z180_IO19: cpustate->io[0x19] = info->i; break; | |
| 2367 | case CPUINFO_INT_REGISTER + Z180_ASTC0L: cpustate->io[0x1a] = info->i; break; | |
| 2368 | case CPUINFO_INT_REGISTER + Z180_ASTC0H: cpustate->io[0x1b] = info->i; break; | |
| 2369 | case CPUINFO_INT_REGISTER + Z180_ASTC1L: cpustate->io[0x1c] = info->i; break; | |
| 2370 | case CPUINFO_INT_REGISTER + Z180_ASTC1H: cpustate->io[0x1d] = info->i; break; | |
| 2371 | case CPUINFO_INT_REGISTER + Z180_CMR: cpustate->io[0x1e] = info->i; break; | |
| 2372 | case CPUINFO_INT_REGISTER + Z180_CCR: cpustate->io[0x1f] = info->i; break; | |
| 2373 | case CPUINFO_INT_REGISTER + Z180_SAR0L: cpustate->io[0x20] = info->i; break; | |
| 2374 | case CPUINFO_INT_REGISTER + Z180_SAR0H: cpustate->io[0x21] = info->i; break; | |
| 2375 | case CPUINFO_INT_REGISTER + Z180_SAR0B: cpustate->io[0x22] = info->i; break; | |
| 2376 | case CPUINFO_INT_REGISTER + Z180_DAR0L: cpustate->io[0x23] = info->i; break; | |
| 2377 | case CPUINFO_INT_REGISTER + Z180_DAR0H: cpustate->io[0x24] = info->i; break; | |
| 2378 | case CPUINFO_INT_REGISTER + Z180_DAR0B: cpustate->io[0x25] = info->i; break; | |
| 2379 | case CPUINFO_INT_REGISTER + Z180_BCR0L: cpustate->io[0x26] = info->i; break; | |
| 2380 | case CPUINFO_INT_REGISTER + Z180_BCR0H: cpustate->io[0x27] = info->i; break; | |
| 2381 | case CPUINFO_INT_REGISTER + Z180_MAR1L: cpustate->io[0x28] = info->i; break; | |
| 2382 | case CPUINFO_INT_REGISTER + Z180_MAR1H: cpustate->io[0x29] = info->i; break; | |
| 2383 | case CPUINFO_INT_REGISTER + Z180_MAR1B: cpustate->io[0x2a] = info->i; break; | |
| 2384 | case CPUINFO_INT_REGISTER + Z180_IAR1L: cpustate->io[0x2b] = info->i; break; | |
| 2385 | case CPUINFO_INT_REGISTER + Z180_IAR1H: cpustate->io[0x2c] = info->i; break; | |
| 2386 | case CPUINFO_INT_REGISTER + Z180_IAR1B: cpustate->io[0x2d] = info->i; break; | |
| 2387 | case CPUINFO_INT_REGISTER + Z180_BCR1L: cpustate->io[0x2e] = info->i; break; | |
| 2388 | case CPUINFO_INT_REGISTER + Z180_BCR1H: cpustate->io[0x2f] = info->i; break; | |
| 2389 | case CPUINFO_INT_REGISTER + Z180_DSTAT: cpustate->io[0x30] = info->i; break; | |
| 2390 | case CPUINFO_INT_REGISTER + Z180_DMODE: cpustate->io[0x31] = info->i; break; | |
| 2391 | case CPUINFO_INT_REGISTER + Z180_DCNTL: cpustate->io[0x32] = info->i; break; | |
| 2392 | case CPUINFO_INT_REGISTER + Z180_IL: cpustate->io[0x33] = info->i; break; | |
| 2393 | case CPUINFO_INT_REGISTER + Z180_ITC: cpustate->io[0x34] = info->i; break; | |
| 2394 | case CPUINFO_INT_REGISTER + Z180_IO35: cpustate->io[0x35] = info->i; break; | |
| 2395 | case CPUINFO_INT_REGISTER + Z180_RCR: cpustate->io[0x36] = info->i; break; | |
| 2396 | case CPUINFO_INT_REGISTER + Z180_IO37: cpustate->io[0x37] = info->i; break; | |
| 2397 | case CPUINFO_INT_REGISTER + Z180_CBR: cpustate->io[0x38] = info->i; z180_mmu(cpustate); break; | |
| 2398 | case CPUINFO_INT_REGISTER + Z180_BBR: cpustate->io[0x39] = info->i; z180_mmu(cpustate); break; | |
| 2399 | case CPUINFO_INT_REGISTER + Z180_CBAR: cpustate->io[0x3a] = info->i; z180_mmu(cpustate); break; | |
| 2400 | case CPUINFO_INT_REGISTER + Z180_IO3B: cpustate->io[0x3b] = info->i; break; | |
| 2401 | case CPUINFO_INT_REGISTER + Z180_IO3C: cpustate->io[0x3c] = info->i; break; | |
| 2402 | case CPUINFO_INT_REGISTER + Z180_IO3D: cpustate->io[0x3d] = info->i; break; | |
| 2403 | case CPUINFO_INT_REGISTER + Z180_OMCR: cpustate->io[0x3e] = info->i; break; | |
| 2404 | case CPUINFO_INT_REGISTER + Z180_IOCR: cpustate->io[0x3f] = info->i; break; | |
| 2405 | case CPUINFO_INT_REGISTER + Z180_IOLINES: z180_write_iolines(cpustate, info->i); break; | |
| 2406 | ||
| 2407 | 2510 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 2408 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: cc[Z180_TABLE_op] = info->p; break; | |
| 2409 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb: cc[Z180_TABLE_cb] = info->p; break; | |
| 2410 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed: cc[Z180_TABLE_ed] = info->p; break; | |
| 2411 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy: cc[Z180_TABLE_xy] = info->p; break; | |
| 2412 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb: cc[Z180_TABLE_xycb] = info->p; break; | |
| 2413 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex: cc[Z180_TABLE_ex] = info->p; break; | |
| 2511 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: cc[Z180_TABLE_op] = info->p; break; | |
| 2512 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb: cc[Z180_TABLE_cb] = info->p; break; | |
| 2513 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed: cc[Z180_TABLE_ed] = info->p; break; | |
| 2514 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy: cc[Z180_TABLE_xy] = info->p; break; | |
| 2515 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb: cc[Z180_TABLE_xycb] = info->p; break; | |
| 2516 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex: cc[Z180_TABLE_ex] = info->p; break; | |
| 2414 | 2517 | } |
| 2415 | 2518 | } |
| 2416 | 2519 | |
| r3957 | r3958 | |
| 2436 | 2539 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2437 | 2540 | case CPUINFO_INT_MAX_CYCLES: info->i = 16; break; |
| 2438 | 2541 | |
| 2439 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 2440 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 2441 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2442 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2443 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2444 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2445 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2446 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 2447 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2542 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 2543 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 2544 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2545 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2546 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 2547 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2448 | 2548 | |
| 2449 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; | |
| 2450 | case CPUINFO_INT_INPUT_STATE + Z180_INT0: info->i = cpustate->irq_state[0]; break; | |
| 2451 | case CPUINFO_INT_INPUT_STATE + Z180_INT1: info->i = cpustate->irq_state[1]; break; | |
| 2452 | case CPUINFO_INT_INPUT_STATE + Z180_INT2: info->i = cpustate->irq_state[2]; break; | |
| 2549 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; | |
| 2550 | case CPUINFO_INT_INPUT_STATE + Z180_INT0: info->i = cpustate->irq_state[0]; break; | |
| 2551 | case CPUINFO_INT_INPUT_STATE + Z180_INT1: info->i = cpustate->irq_state[1]; break; | |
| 2552 | case CPUINFO_INT_INPUT_STATE + Z180_INT2: info->i = cpustate->irq_state[2]; break; | |
| 2453 | 2553 | |
| 2454 | case CPUINFO_INT_PREVIOUSPC: info->i = cpustate->PREPC.w.l; break; | |
| 2554 | /* --- the following bits of info are returned as pointers --- */ | |
| 2555 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(z180); break; | |
| 2556 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(z180); break; | |
| 2557 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(z180); break; | |
| 2558 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(z180); break; | |
| 2559 | case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(z180); break; | |
| 2560 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(z180); break; | |
| 2561 | case CPUINFO_FCT_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(z180); break; | |
| 2562 | case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(z180); break; | |
| 2563 | case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(z180); break; | |
| 2455 | 2564 | |
| 2456 | case CPUINFO_INT_PC: info->i = cpustate->_PCD; break; | |
| 2457 | case CPUINFO_INT_REGISTER + Z180_PC: info->i = cpustate->PC.w.l; break; | |
| 2458 | case CPUINFO_INT_SP: info->i = cpustate->_SPD; break; | |
| 2459 | case CPUINFO_INT_REGISTER + Z180_SP: info->i = cpustate->SP.w.l; break; | |
| 2460 | case CPUINFO_INT_REGISTER + Z180_AF: info->i = cpustate->AF.w.l; break; | |
| 2461 | case CPUINFO_INT_REGISTER + Z180_BC: info->i = cpustate->BC.w.l; break; | |
| 2462 | case CPUINFO_INT_REGISTER + Z180_DE: info->i = cpustate->DE.w.l; break; | |
| 2463 | case CPUINFO_INT_REGISTER + Z180_HL: info->i = cpustate->HL.w.l; break; | |
| 2464 | case CPUINFO_INT_REGISTER + Z180_IX: info->i = cpustate->IX.w.l; break; | |
| 2465 | case CPUINFO_INT_REGISTER + Z180_IY: info->i = cpustate->IY.w.l; break; | |
| 2466 | case CPUINFO_INT_REGISTER + Z180_R: info->i = (cpustate->R & 0x7f) | (cpustate->R2 & 0x80); break; | |
| 2467 | case CPUINFO_INT_REGISTER + Z180_I: info->i = cpustate->I; break; | |
| 2468 | case CPUINFO_INT_REGISTER + Z180_AF2: info->i = cpustate->AF2.w.l; break; | |
| 2469 | case CPUINFO_INT_REGISTER + Z180_BC2: info->i = cpustate->BC2.w.l; break; | |
| 2470 | case CPUINFO_INT_REGISTER + Z180_DE2: info->i = cpustate->DE2.w.l; break; | |
| 2471 | case CPUINFO_INT_REGISTER + Z180_HL2: info->i = cpustate->HL2.w.l; break; | |
| 2472 | case CPUINFO_INT_REGISTER + Z180_IM: info->i = cpustate->IM; break; | |
| 2473 | case CPUINFO_INT_REGISTER + Z180_IFF1: info->i = cpustate->IFF1; break; | |
| 2474 | case CPUINFO_INT_REGISTER + Z180_IFF2: info->i = cpustate->IFF2; break; | |
| 2475 | case CPUINFO_INT_REGISTER + Z180_HALT: info->i = cpustate->HALT; break; | |
| 2476 | case CPUINFO_INT_REGISTER + Z180_CNTLA0: info->i = cpustate->io[0x00]; break; | |
| 2477 | case CPUINFO_INT_REGISTER + Z180_CNTLA1: info->i = cpustate->io[0x01]; break; | |
| 2478 | case CPUINFO_INT_REGISTER + Z180_CNTLB0: info->i = cpustate->io[0x02]; break; | |
| 2479 | case CPUINFO_INT_REGISTER + Z180_CNTLB1: info->i = cpustate->io[0x03]; break; | |
| 2480 | case CPUINFO_INT_REGISTER + Z180_STAT0: info->i = cpustate->io[0x04]; break; | |
| 2481 | case CPUINFO_INT_REGISTER + Z180_STAT1: info->i = cpustate->io[0x05]; break; | |
| 2482 | case CPUINFO_INT_REGISTER + Z180_TDR0: info->i = cpustate->io[0x06]; break; | |
| 2483 | case CPUINFO_INT_REGISTER + Z180_TDR1: info->i = cpustate->io[0x07]; break; | |
| 2484 | case CPUINFO_INT_REGISTER + Z180_RDR0: info->i = cpustate->io[0x08]; break; | |
| 2485 | case CPUINFO_INT_REGISTER + Z180_RDR1: info->i = cpustate->io[0x09]; break; | |
| 2486 | case CPUINFO_INT_REGISTER + Z180_CNTR: info->i = cpustate->io[0x0a]; break; | |
| 2487 | case CPUINFO_INT_REGISTER + Z180_TRDR: info->i = cpustate->io[0x0b]; break; | |
| 2488 | case CPUINFO_INT_REGISTER + Z180_TMDR0L: info->i = cpustate->io[0x0c]; break; | |
| 2489 | case CPUINFO_INT_REGISTER + Z180_TMDR0H: info->i = cpustate->io[0x0d]; break; | |
| 2490 | case CPUINFO_INT_REGISTER + Z180_RLDR0L: info->i = cpustate->io[0x0e]; break; | |
| 2491 | case CPUINFO_INT_REGISTER + Z180_RLDR0H: info->i = cpustate->io[0x0f]; break; | |
| 2492 | case CPUINFO_INT_REGISTER + Z180_TCR: info->i = cpustate->io[0x10]; break; | |
| 2493 | case CPUINFO_INT_REGISTER + Z180_IO11: info->i = cpustate->io[0x11]; break; | |
| 2494 | case CPUINFO_INT_REGISTER + Z180_ASEXT0: info->i = cpustate->io[0x12]; break; | |
| 2495 | case CPUINFO_INT_REGISTER + Z180_ASEXT1: info->i = cpustate->io[0x13]; break; | |
| 2496 | case CPUINFO_INT_REGISTER + Z180_TMDR1L: info->i = cpustate->io[0x14]; break; | |
| 2497 | case CPUINFO_INT_REGISTER + Z180_TMDR1H: info->i = cpustate->io[0x15]; break; | |
| 2498 | case CPUINFO_INT_REGISTER + Z180_RLDR1L: info->i = cpustate->io[0x16]; break; | |
| 2499 | case CPUINFO_INT_REGISTER + Z180_RLDR1H: info->i = cpustate->io[0x17]; break; | |
| 2500 | case CPUINFO_INT_REGISTER + Z180_FRC: info->i = cpustate->io[0x18]; break; | |
| 2501 | case CPUINFO_INT_REGISTER + Z180_IO19: info->i = cpustate->io[0x19]; break; | |
| 2502 | case CPUINFO_INT_REGISTER + Z180_ASTC0L: info->i = cpustate->io[0x1a]; break; | |
| 2503 | case CPUINFO_INT_REGISTER + Z180_ASTC0H: info->i = cpustate->io[0x1b]; break; | |
| 2504 | case CPUINFO_INT_REGISTER + Z180_ASTC1L: info->i = cpustate->io[0x1c]; break; | |
| 2505 | case CPUINFO_INT_REGISTER + Z180_ASTC1H: info->i = cpustate->io[0x1d]; break; | |
| 2506 | case CPUINFO_INT_REGISTER + Z180_CMR: info->i = cpustate->io[0x1e]; break; | |
| 2507 | case CPUINFO_INT_REGISTER + Z180_CCR: info->i = cpustate->io[0x1f]; break; | |
| 2508 | case CPUINFO_INT_REGISTER + Z180_SAR0L: info->i = cpustate->io[0x20]; break; | |
| 2509 | case CPUINFO_INT_REGISTER + Z180_SAR0H: info->i = cpustate->io[0x21]; break; | |
| 2510 | case CPUINFO_INT_REGISTER + Z180_SAR0B: info->i = cpustate->io[0x22]; break; | |
| 2511 | case CPUINFO_INT_REGISTER + Z180_DAR0L: info->i = cpustate->io[0x23]; break; | |
| 2512 | case CPUINFO_INT_REGISTER + Z180_DAR0H: info->i = cpustate->io[0x24]; break; | |
| 2513 | case CPUINFO_INT_REGISTER + Z180_DAR0B: info->i = cpustate->io[0x25]; break; | |
| 2514 | case CPUINFO_INT_REGISTER + Z180_BCR0L: info->i = cpustate->io[0x26]; break; | |
| 2515 | case CPUINFO_INT_REGISTER + Z180_BCR0H: info->i = cpustate->io[0x27]; break; | |
| 2516 | case CPUINFO_INT_REGISTER + Z180_MAR1L: info->i = cpustate->io[0x28]; break; | |
| 2517 | case CPUINFO_INT_REGISTER + Z180_MAR1H: info->i = cpustate->io[0x29]; break; | |
| 2518 | case CPUINFO_INT_REGISTER + Z180_MAR1B: info->i = cpustate->io[0x2a]; break; | |
| 2519 | case CPUINFO_INT_REGISTER + Z180_IAR1L: info->i = cpustate->io[0x2b]; break; | |
| 2520 | case CPUINFO_INT_REGISTER + Z180_IAR1H: info->i = cpustate->io[0x2c]; break; | |
| 2521 | case CPUINFO_INT_REGISTER + Z180_IAR1B: info->i = cpustate->io[0x2d]; break; | |
| 2522 | case CPUINFO_INT_REGISTER + Z180_BCR1L: info->i = cpustate->io[0x2e]; break; | |
| 2523 | case CPUINFO_INT_REGISTER + Z180_BCR1H: info->i = cpustate->io[0x2f]; break; | |
| 2524 | case CPUINFO_INT_REGISTER + Z180_DSTAT: info->i = cpustate->io[0x30]; break; | |
| 2525 | case CPUINFO_INT_REGISTER + Z180_DMODE: info->i = cpustate->io[0x31]; break; | |
| 2526 | case CPUINFO_INT_REGISTER + Z180_DCNTL: info->i = cpustate->io[0x32]; break; | |
| 2527 | case CPUINFO_INT_REGISTER + Z180_IL: info->i = cpustate->io[0x33]; break; | |
| 2528 | case CPUINFO_INT_REGISTER + Z180_ITC: info->i = cpustate->io[0x34]; break; | |
| 2529 | case CPUINFO_INT_REGISTER + Z180_IO35: info->i = cpustate->io[0x35]; break; | |
| 2530 | case CPUINFO_INT_REGISTER + Z180_RCR: info->i = cpustate->io[0x36]; break; | |
| 2531 | case CPUINFO_INT_REGISTER + Z180_IO37: info->i = cpustate->io[0x37]; break; | |
| 2532 | case CPUINFO_INT_REGISTER + Z180_CBR: info->i = cpustate->io[0x38]; break; | |
| 2533 | case CPUINFO_INT_REGISTER + Z180_BBR: info->i = cpustate->io[0x39]; break; | |
| 2534 | case CPUINFO_INT_REGISTER + Z180_CBAR: info->i = cpustate->io[0x3a]; break; | |
| 2535 | case CPUINFO_INT_REGISTER + Z180_IO3B: info->i = cpustate->io[0x3b]; break; | |
| 2536 | case CPUINFO_INT_REGISTER + Z180_IO3C: info->i = cpustate->io[0x3c]; break; | |
| 2537 | case CPUINFO_INT_REGISTER + Z180_IO3D: info->i = cpustate->io[0x3d]; break; | |
| 2538 | case CPUINFO_INT_REGISTER + Z180_OMCR: info->i = cpustate->io[0x3e]; break; | |
| 2539 | case CPUINFO_INT_REGISTER + Z180_IOCR: info->i = cpustate->io[0x3f]; break; | |
| 2540 | case CPUINFO_INT_REGISTER + Z180_IOLINES: info->i = cpustate->iol; break; | |
| 2565 | /* --- the following bits of info are returned as pointers to functions --- */ | |
| 2566 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 2567 | case CPUINFO_PTR_STATE_TABLE: info->state_table = &cpustate->state; break; | |
| 2541 | 2568 | |
| 2542 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 2543 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(z180); break; | |
| 2544 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(z180); break; | |
| 2545 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(z180); break; | |
| 2546 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(z180); break; | |
| 2547 | case CPUINFO_PTR_BURN: info->burn = CPU_BURN_NAME(z180); break; | |
| 2548 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(z180); break; | |
| 2549 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 2550 | case CPUINFO_PTR_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(z180); break; | |
| 2551 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: info->p = (void *)cc[Z180_TABLE_op]; break; | |
| 2552 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb: info->p = (void *)cc[Z180_TABLE_cb]; break; | |
| 2553 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed: info->p = (void *)cc[Z180_TABLE_ed]; break; | |
| 2554 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy: info->p = (void *)cc[Z180_TABLE_xy]; break; | |
| 2555 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb: info->p = (void *)cc[Z180_TABLE_xycb]; break; | |
| 2556 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex: info->p = (void *)cc[Z180_TABLE_ex]; break; | |
| 2569 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: info->p = (void *)cc[Z180_TABLE_op]; break; | |
| 2570 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb: info->p = (void *)cc[Z180_TABLE_cb]; break; | |
| 2571 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed: info->p = (void *)cc[Z180_TABLE_ed]; break; | |
| 2572 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy: info->p = (void *)cc[Z180_TABLE_xy]; break; | |
| 2573 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb: info->p = (void *)cc[Z180_TABLE_xycb]; break; | |
| 2574 | case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex: info->p = (void *)cc[Z180_TABLE_ex]; break; | |
| 2557 | 2575 | |
| 2558 | 2576 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2559 | 2577 | case CPUINFO_STR_NAME: strcpy(info->s, "Z180"); break; |
| r3957 | r3958 | |
| 2573 | 2591 | cpustate->AF.b.l & 0x02 ? 'N':'.', |
| 2574 | 2592 | cpustate->AF.b.l & 0x01 ? 'C':'.'); |
| 2575 | 2593 | break; |
| 2576 | ||
| 2577 | case CPUINFO_STR_REGISTER + Z180_PC: sprintf(info->s, "PC:%04X", cpustate->PC.w.l); break; | |
| 2578 | case CPUINFO_STR_REGISTER + Z180_SP: sprintf(info->s, "SP:%04X", cpustate->SP.w.l); break; | |
| 2579 | case CPUINFO_STR_REGISTER + Z180_AF: sprintf(info->s, "AF:%04X", cpustate->AF.w.l); break; | |
| 2580 | case CPUINFO_STR_REGISTER + Z180_BC: sprintf(info->s, "BC:%04X", cpustate->BC.w.l); break; | |
| 2581 | case CPUINFO_STR_REGISTER + Z180_DE: sprintf(info->s, "DE:%04X", cpustate->DE.w.l); break; | |
| 2582 | case CPUINFO_STR_REGISTER + Z180_HL: sprintf(info->s, "HL:%04X", cpustate->HL.w.l); break; | |
| 2583 | case CPUINFO_STR_REGISTER + Z180_IX: sprintf(info->s, "IX:%04X", cpustate->IX.w.l); break; | |
| 2584 | case CPUINFO_STR_REGISTER + Z180_IY: sprintf(info->s, "IY:%04X", cpustate->IY.w.l); break; | |
| 2585 | case CPUINFO_STR_REGISTER + Z180_R: sprintf(info->s, "R :%02X", (cpustate->R & 0x7f) | (cpustate->R2 & 0x80)); break; | |
| 2586 | case CPUINFO_STR_REGISTER + Z180_I: sprintf(info->s, "I :%02X", cpustate->I); break; | |
| 2587 | case CPUINFO_STR_REGISTER + Z180_IL: sprintf(info->s, "IL :%02X", cpustate->io[Z180_IL-Z180_CNTLA0]); break; | |
| 2588 | case CPUINFO_STR_REGISTER + Z180_AF2: sprintf(info->s, "AF2:%04X", cpustate->AF2.w.l); break; | |
| 2589 | case CPUINFO_STR_REGISTER + Z180_BC2: sprintf(info->s, "BC2:%04X", cpustate->BC2.w.l); break; | |
| 2590 | case CPUINFO_STR_REGISTER + Z180_DE2: sprintf(info->s, "DE2:%04X", cpustate->DE2.w.l); break; | |
| 2591 | case CPUINFO_STR_REGISTER + Z180_HL2: sprintf(info->s, "HL2:%04X", cpustate->HL2.w.l); break; | |
| 2592 | case CPUINFO_STR_REGISTER + Z180_IM: sprintf(info->s, "IM :%X", cpustate->IM); break; | |
| 2593 | case CPUINFO_STR_REGISTER + Z180_IFF1: sprintf(info->s, "IFF1:%X", cpustate->IFF1); break; | |
| 2594 | case CPUINFO_STR_REGISTER + Z180_IFF2: sprintf(info->s, "IFF2:%X", cpustate->IFF2); break; | |
| 2595 | case CPUINFO_STR_REGISTER + Z180_HALT: sprintf(info->s, "HALT:%X", cpustate->HALT); break; | |
| 2596 | case CPUINFO_STR_REGISTER + Z180_CCR: sprintf(info->s, "CCR :%02X", cpustate->io[Z180_CCR-Z180_CNTLA0]); break; | |
| 2597 | case CPUINFO_STR_REGISTER + Z180_ITC: sprintf(info->s, "ITC :%02X", cpustate->io[Z180_ITC-Z180_CNTLA0]); break; | |
| 2598 | case CPUINFO_STR_REGISTER + Z180_CBR: sprintf(info->s, "CBR :%02X", cpustate->io[Z180_CBR-Z180_CNTLA0]); break; | |
| 2599 | case CPUINFO_STR_REGISTER + Z180_BBR: sprintf(info->s, "BBR :%02X", cpustate->io[Z180_BBR-Z180_CNTLA0]); break; | |
| 2600 | case CPUINFO_STR_REGISTER + Z180_CBAR: sprintf(info->s, "CBAR:%02X", cpustate->io[Z180_CBAR-Z180_CNTLA0]); break; | |
| 2601 | case CPUINFO_STR_REGISTER + Z180_OMCR: sprintf(info->s, "OMCR:%02X", cpustate->io[Z180_OMCR-Z180_CNTLA0]); break; | |
| 2602 | case CPUINFO_STR_REGISTER + Z180_IOCR: sprintf(info->s, "IOCR:%02X", cpustate->io[Z180_IOCR-Z180_CNTLA0]); break; | |
| 2603 | 2594 | } |
| 2604 | 2595 | } |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | enum |
| 9 | 9 | { |
| 10 | Z180_PC | |
| 10 | Z180_PC | |
| 11 | 11 | Z180_SP, |
| 12 | 12 | Z180_AF, |
| 13 | 13 | Z180_BC, |
| r3957 | r3958 | |
| 15 | 15 | Z180_HL, |
| 16 | 16 | Z180_IX, |
| 17 | 17 | Z180_IY, |
| 18 | Z180_A, | |
| 19 | Z180_B, | |
| 20 | Z180_C, | |
| 21 | Z180_D, | |
| 22 | Z180_E, | |
| 23 | Z180_H, | |
| 24 | Z180_L, | |
| 18 | 25 | Z180_AF2, |
| 19 | 26 | Z180_BC2, |
| 20 | 27 | Z180_DE2, |
| r3957 | r3958 | |
| 93 | 100 | Z180_IO3D, /* 3d reserved */ |
| 94 | 101 | Z180_OMCR, /* 3e operation mode control register */ |
| 95 | 102 | Z180_IOCR, /* 3f I/O control register */ |
| 96 | Z180_IOLINES /* read/write I/O lines */ | |
| 103 | Z180_IOLINES, /* read/write I/O lines */ | |
| 104 | ||
| 105 | Z180_GENPC = REG_GENPC, | |
| 106 | Z180_GENSP = REG_GENSP, | |
| 107 | Z180_GENPCBASE = REG_GENPCBASE | |
| 97 | 108 | }; |
| 98 | 109 | |
| 99 | 110 | enum |
| r3957 | r3958 | |
| 129 | 140 | extern void z180_writemem(const device_config *device, offs_t offset, UINT8 data); |
| 130 | 141 | |
| 131 | 142 | extern CPU_GET_INFO( z180 ); |
| 143 | #define CPU_Z180 CPU_GET_INFO_NAME( z180 ) | |
| 132 | 144 | |
| 133 | 145 | CPU_DISASSEMBLE( z180 ); |
| 134 | 146 |
| r3957 | r3958 | |
|---|---|---|
| 147 | 147 | drcfe->device = cpu; |
| 148 | 148 | drcfe->program = memory_find_address_space(cpu, ADDRESS_SPACE_PROGRAM); |
| 149 | 149 | drcfe->pageshift = cpu_get_page_shift(cpu, ADDRESS_SPACE_PROGRAM); |
| 150 | drcfe->translate = (cpu_translate_func)c | |
| 150 | drcfe->translate = (cpu_translate_func)device | |
| 151 | 151 | #ifdef LSB_FIRST |
| 152 | 152 | if (cpu_get_endianness(cpu) == ENDIANNESS_BIG) |
| 153 | 153 | #else |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | #include "cpuintrf.h" |
| 9 | 9 | |
| 10 | 10 | #include "host.h" |
| 11 | #include "i86priv.h" | |
| 11 | 12 | #include "i86.h" |
| 12 | #include "i86intf.h" | |
| 13 | 13 | |
| 14 | 14 | #include "i86mem.h" |
| 15 | 15 | |
| r3957 | r3958 | |
| 51 | 51 | INT8 test_state; /* PJB 03/05 */ |
| 52 | 52 | INT32 extra_cycles; /* extra cycles for interrupts */ |
| 53 | 53 | |
| 54 | UINT16 ip; | |
| 55 | UINT32 sp; | |
| 56 | ||
| 54 | 57 | memory_interface mem; |
| 55 | 58 | |
| 56 | 59 | const device_config *device; |
| 57 | 60 | const address_space *program; |
| 58 | 61 | const address_space *io; |
| 59 | 62 | int icount; |
| 63 | cpu_state_table state; | |
| 60 | 64 | |
| 61 | 65 | unsigned prefix_base; /* base address of the latest prefix segment */ |
| 62 | 66 | char seg_prefix; /* prefix segment indicator */ |
| r3957 | r3958 | |
| 65 | 69 | }; |
| 66 | 70 | |
| 67 | 71 | |
| 72 | /*************************************************************************** | |
| 73 | CPU STATE DESCRIPTION | |
| 74 | ***************************************************************************/ | |
| 68 | 75 | |
| 76 | #define I86_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \ | |
| 77 | CPU_STATE_ENTRY(I8086_##_name, #_name, _format, i8086_state, _member, _datamask, ~0, _flags) | |
| 78 | ||
| 79 | static const cpu_state_entry state_array[] = | |
| 80 | { | |
| 81 | I86_STATE_ENTRY(GENPC, "%9s", pc, 0xfffff, CPUSTATE_IMPORT) | |
| 82 | I86_STATE_ENTRY(GENPCBASE, "%08X", pc, 0xfffff, CPUSTATE_NOSHOW) /* not implemented */ | |
| 83 | I86_STATE_ENTRY(IP, "%04X", ip, 0xffff, CPUSTATE_IMPORT | CPUSTATE_EXPORT) | |
| 84 | ||
| 85 | I86_STATE_ENTRY(FLAGS, "%04X", flags, 0xffff, CPUSTATE_NOSHOW | CPUSTATE_IMPORT | CPUSTATE_EXPORT) | |
| 86 | ||
| 87 | I86_STATE_ENTRY(AX, "%04X", regs.w[AX], 0xffff, 0) | |
| 88 | I86_STATE_ENTRY(BX, "%04X", regs.w[BX], 0xffff, 0) | |
| 89 | I86_STATE_ENTRY(CX, "%04X", regs.w[CX], 0xffff, 0) | |
| 90 | I86_STATE_ENTRY(DX, "%04X", regs.w[DX], 0xffff, 0) | |
| 91 | I86_STATE_ENTRY(SI, "%04X", regs.w[SI], 0xffff, 0) | |
| 92 | I86_STATE_ENTRY(DI, "%04X", regs.w[DI], 0xffff, 0) | |
| 93 | I86_STATE_ENTRY(BP, "%04X", regs.w[BP], 0xffff, 0) | |
| 94 | I86_STATE_ENTRY(SP, "%04X", regs.w[SP], 0xffff, 0) | |
| 95 | I86_STATE_ENTRY(GENSP, "%9s", sp, 0xfffff, CPUSTATE_IMPORT | CPUSTATE_EXPORT) | |
| 96 | ||
| 97 | I86_STATE_ENTRY(AL, "%02X", regs.b[AL], 0xff, CPUSTATE_NOSHOW) | |
| 98 | I86_STATE_ENTRY(BL, "%02X", regs.b[BL], 0xff, CPUSTATE_NOSHOW) | |
| 99 | I86_STATE_ENTRY(CL, "%02X", regs.b[CL], 0xff, CPUSTATE_NOSHOW) | |
| 100 | I86_STATE_ENTRY(DL, "%02X", regs.b[DL], 0xff, CPUSTATE_NOSHOW) | |
| 101 | I86_STATE_ENTRY(AH, "%02X", regs.b[AH], 0xff, CPUSTATE_NOSHOW) | |
| 102 | I86_STATE_ENTRY(BH, "%02X", regs.b[BH], 0xff, CPUSTATE_NOSHOW) | |
| 103 | I86_STATE_ENTRY(CH, "%02X", regs.b[CH], 0xff, CPUSTATE_NOSHOW) | |
| 104 | I86_STATE_ENTRY(DH, "%02X", regs.b[DH], 0xff, CPUSTATE_NOSHOW) | |
| 105 | ||
| 106 | I86_STATE_ENTRY(CS, "%04X", sregs[CS], 0xffff, CPUSTATE_IMPORT) | |
| 107 | I86_STATE_ENTRY(DS, "%04X", sregs[DS], 0xffff, CPUSTATE_IMPORT) | |
| 108 | I86_STATE_ENTRY(ES, "%04X", sregs[ES], 0xffff, CPUSTATE_IMPORT) | |
| 109 | I86_STATE_ENTRY(SS, "%04X", sregs[SS], 0xffff, CPUSTATE_IMPORT) | |
| 110 | }; | |
| 111 | ||
| 112 | static const cpu_state_table state_table_template = | |
| 113 | { | |
| 114 | NULL, /* pointer to the base of state (offsets are relative to this) */ | |
| 115 | 0, /* subtype this table refers to */ | |
| 116 | ARRAY_LENGTH(state_array), /* number of entries */ | |
| 117 | state_array /* array of entries */ | |
| 118 | }; | |
| 119 | ||
| 120 | ||
| 121 | ||
| 69 | 122 | #include "i86time.c" |
| 70 | 123 | |
| 71 | 124 | /***************************************************************************/ |
| r3957 | r3958 | |
| 152 | 205 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 153 | 206 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| 154 | 207 | |
| 208 | /* set up the state table */ | |
| 209 | cpustate->state = state_table_template; | |
| 210 | cpustate->state.baseptr = cpustate; | |
| 211 | cpustate->state.subtypemask = 1; | |
| 212 | ||
| 155 | 213 | i8086_state_register(device); |
| 156 | 214 | configure_memory_16bit(cpustate); |
| 157 | 215 | } |
| r3957 | r3958 | |
| 170 | 228 | i8086_state *cpustate = device->token; |
| 171 | 229 | cpu_irq_callback save_irqcallback; |
| 172 | 230 | memory_interface save_mem; |
| 231 | cpu_state_table save_state; | |
| 173 | 232 | |
| 174 | 233 | save_irqcallback = cpustate->irq_callback; |
| 175 | 234 | save_mem = cpustate->mem; |
| 235 | save_state = cpustate->state; | |
| 176 | 236 | memset(cpustate, 0, sizeof(*cpustate)); |
| 177 | 237 | cpustate->irq_callback = save_irqcallback; |
| 178 | 238 | cpustate->mem = save_mem; |
| 239 | cpustate->state = save_state; | |
| 179 | 240 | cpustate->device = device; |
| 180 | 241 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 181 | 242 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| r3957 | r3958 | |
| 225 | 286 | { |
| 226 | 287 | i8086_state *cpustate = device->token; |
| 227 | 288 | |
| 228 | cpustate->base[CS] = SegBase(CS); | |
| 229 | cpustate->base[DS] = SegBase(DS); | |
| 230 | cpustate->base[ES] = SegBase(ES); | |
| 231 | cpustate->base[SS] = SegBase(SS); | |
| 232 | ||
| 233 | 289 | /* copy over the cycle counts if they're not correct */ |
| 234 | 290 | if (timing.id != 8086) |
| 235 | 291 | timing = i8086_cycles; |
| r3957 | r3958 | |
| 268 | 324 | |
| 269 | 325 | #if (HAS_I80186 || HAS_I80188) |
| 270 | 326 | |
| 271 | #include "i | |
| 327 | #include "i | |
| 272 | 328 | |
| 273 | 329 | #undef PREFIX |
| 274 | 330 | #define PREFIX(name) i80186##name |
| r3957 | r3958 | |
| 286 | 342 | { |
| 287 | 343 | i8086_state *cpustate = device->token; |
| 288 | 344 | |
| 289 | cpustate->base[CS] = SegBase(CS); | |
| 290 | cpustate->base[DS] = SegBase(DS); | |
| 291 | cpustate->base[ES] = SegBase(ES); | |
| 292 | cpustate->base[SS] = SegBase(SS); | |
| 293 | ||
| 294 | 345 | /* copy over the cycle counts if they're not correct */ |
| 295 | 346 | if (timing.id != 80186) |
| 296 | 347 | timing = i80186_cycles; |
| r3957 | r3958 | |
| 324 | 375 | |
| 325 | 376 | |
| 326 | 377 | /************************************************************************** |
| 327 | * | |
| 378 | * STATE | |
| 328 | 379 | **************************************************************************/ |
| 329 | 380 | |
| 330 | static CPU_ | |
| 381 | static CPU_ | |
| 331 | 382 | { |
| 332 | 383 | i8086_state *cpustate = device->token; |
| 333 | 384 | |
| 334 | switch ( | |
| 385 | switch (entry->index) | |
| 335 | 386 | { |
| 336 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 337 | case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(cpustate, 0, info->i); break; | |
| 338 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(cpustate, INPUT_LINE_NMI, info->i); break; | |
| 339 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_TEST: set_test_line(cpustate, info->i); break; /* PJB 03/05 */ | |
| 340 | ||
| 341 | case CPUINFO_INT_PC: | |
| 342 | case CPUINFO_INT_REGISTER + I8086_PC: | |
| 343 | if (info->i - cpustate->base[CS] >= 0x10000) | |
| 387 | case I8086_GENPC: | |
| 388 | if (cpustate->pc - cpustate->base[CS] >= 0x10000) | |
| 344 | 389 | { |
| 345 | cpustate->base[CS] = | |
| 390 | cpustate->base[CS] = cpustate->pc & 0xffff0; | |
| 346 | 391 | cpustate->sregs[CS] = cpustate->base[CS] >> 4; |
| 347 | 392 | } |
| 348 | cpustate->pc = info->i; | |
| 349 | 393 | break; |
| 350 | case CPUINFO_INT_REGISTER + I8086_IP: cpustate->pc = cpustate->base[CS] + info->i; break; | |
| 351 | case CPUINFO_INT_SP: | |
| 352 | if (info->i - cpustate->base[SS] < 0x10000) | |
| 394 | ||
| 395 | case I8086_IP: | |
| 396 | cpustate->pc = cpustate->base[CS] + cpustate->ip; | |
| 397 | break; | |
| 398 | ||
| 399 | case I8086_GENSP: | |
| 400 | if (cpustate->sp - cpustate->base[SS] >= 0x10000) | |
| 353 | 401 | { |
| 354 | cpustate->regs.w[SP] = info->i - cpustate->base[SS]; | |
| 355 | } | |
| 356 | else | |
| 357 | { | |
| 358 | cpustate->base[SS] = info->i & 0xffff0; | |
| 402 | cpustate->base[SS] = cpustate->sp & 0xffff0; | |
| 359 | 403 | cpustate->sregs[SS] = cpustate->base[SS] >> 4; |
| 360 | cpustate->regs.w[SP] = info->i & 0x0000f; | |
| 361 | 404 | } |
| 405 | cpustate->regs.w[SP] = cpustate->sp - cpustate->base[SS]; | |
| 362 | 406 | break; |
| 363 | case CPUINFO_INT_REGISTER + I8086_SP: cpustate->regs.w[SP] = info->i; break; | |
| 364 | case CPUINFO_INT_REGISTER + I8086_FLAGS: cpustate->flags = info->i; ExpandFlags(info->i); break; | |
| 365 | case CPUINFO_INT_REGISTER + I8086_AX: cpustate->regs.w[AX] = info->i; break; | |
| 366 | case CPUINFO_INT_REGISTER + I8086_CX: cpustate->regs.w[CX] = info->i; break; | |
| 367 | case CPUINFO_INT_REGISTER + I8086_DX: cpustate->regs.w[DX] = info->i; break; | |
| 368 | case CPUINFO_INT_REGISTER + I8086_BX: cpustate->regs.w[BX] = info->i; break; | |
| 369 | case CPUINFO_INT_REGISTER + I8086_BP: cpustate->regs.w[BP] = info->i; break; | |
| 370 | case CPUINFO_INT_REGISTER + I8086_SI: cpustate->regs.w[SI] = info->i; break; | |
| 371 | case CPUINFO_INT_REGISTER + I8086_DI: cpustate->regs.w[DI] = info->i; break; | |
| 372 | case CPUINFO_INT_REGISTER + I8086_ES: cpustate->sregs[ES] = info->i; cpustate->base[ES] = SegBase(ES); break; | |
| 373 | case CPUINFO_INT_REGISTER + I8086_CS: cpustate->sregs[CS] = info->i; cpustate->base[CS] = SegBase(CS); break; | |
| 374 | case CPUINFO_INT_REGISTER + I8086_SS: cpustate->sregs[SS] = info->i; cpustate->base[SS] = SegBase(SS); break; | |
| 375 | case CPUINFO_INT_REGISTER + I8086_DS: cpustate->sregs[DS] = info->i; cpustate->base[DS] = SegBase(DS); break; | |
| 376 | case CPUINFO_INT_REGISTER + I8086_VECTOR: cpustate->int_vector = info->i; break; | |
| 407 | ||
| 408 | case I8086_FLAGS: | |
| 409 | ExpandFlags(cpustate->flags); | |
| 410 | break; | |
| 411 | ||
| 412 | case I8086_ES: | |
| 413 | cpustate->base[ES] = SegBase(ES); | |
| 414 | break; | |
| 415 | ||
| 416 | case I8086_CS: | |
| 417 | cpustate->base[CS] = SegBase(CS); | |
| 418 | break; | |
| 419 | ||
| 420 | case I8086_SS: | |
| 421 | cpustate->base[SS] = SegBase(SS); | |
| 422 | break; | |
| 423 | ||
| 424 | case I8086_DS: | |
| 425 | cpustate->base[DS] = SegBase(DS); | |
| 426 | break; | |
| 427 | ||
| 428 | default: | |
| 429 | fatalerror("CPU_IMPORT_STATE(i8086) called for unexpected value\n"); | |
| 430 | break; | |
| 377 | 431 | } |
| 378 | 432 | } |
| 379 | 433 | |
| 380 | 434 | |
| 435 | static CPU_EXPORT_STATE( i8086 ) | |
| 436 | { | |
| 437 | i8086_state *cpustate = device->token; | |
| 381 | 438 | |
| 439 | switch (entry->index) | |
| 440 | { | |
| 441 | case I8086_IP: | |
| 442 | cpustate->ip = cpustate->pc - cpustate->base[CS]; | |
| 443 | break; | |
| 444 | ||
| 445 | case I8086_FLAGS: | |
| 446 | cpustate->flags = CompressFlags(); | |
| 447 | break; | |
| 448 | ||
| 449 | case I8086_GENSP: | |
| 450 | cpustate->sp = cpustate->base[SS] + cpustate->regs.w[SP]; | |
| 451 | break; | |
| 452 | ||
| 453 | default: | |
| 454 | fatalerror("CPU_EXPORT_STATE(i8086) called for unexpected value\n"); | |
| 455 | break; | |
| 456 | } | |
| 457 | } | |
| 458 | ||
| 459 | ||
| 460 | static CPU_EXPORT_STRING( i8086 ) | |
| 461 | { | |
| 462 | i8086_state *cpustate = device->token; | |
| 463 | ||
| 464 | switch (entry->index) | |
| 465 | { | |
| 466 | case I8086_GENPC: | |
| 467 | sprintf(string, "%04X:%04X", cpustate->sregs[CS] & 0xffff, (cpustate->pc - cpustate->base[CS]) & 0xffff); | |
| 468 | break; | |
| 469 | ||
| 470 | case I8086_GENSP: | |
| 471 | sprintf(string, "%04X:%04X", cpustate->sregs[SS] & 0xffff, cpustate->regs.w[SP] & 0xffff); | |
| 472 | break; | |
| 473 | ||
| 474 | default: | |
| 475 | fatalerror("CPU_EXPORT_STRING(i8086) called for unexpected value\n"); | |
| 476 | break; | |
| 477 | } | |
| 478 | } | |
| 479 | ||
| 480 | ||
| 382 | 481 | /************************************************************************** |
| 482 | * Generic set_info | |
| 483 | **************************************************************************/ | |
| 484 | ||
| 485 | static CPU_SET_INFO( i8086 ) | |
| 486 | { | |
| 487 | i8086_state *cpustate = device->token; | |
| 488 | ||
| 489 | switch (state) | |
| 490 | { | |
| 491 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 492 | case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(cpustate, 0, info->i); break; | |
| 493 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(cpustate, INPUT_LINE_NMI, info->i); break; | |
| 494 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_TEST: set_test_line(cpustate, info->i); break; /* PJB 03/05 */ | |
| 495 | } | |
| 496 | } | |
| 497 | ||
| 498 | ||
| 499 | ||
| 500 | /************************************************************************** | |
| 383 | 501 | * Generic get_info |
| 384 | 502 | **************************************************************************/ |
| 385 | 503 | |
| r3957 | r3958 | |
| 401 | 519 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 402 | 520 | case CPUINFO_INT_MAX_CYCLES: info->i = 50; break; |
| 403 | 521 | |
| 404 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 405 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 406 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 407 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 408 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 409 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 410 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 411 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 412 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 522 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 523 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 524 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 525 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 526 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 527 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 528 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 529 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 530 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 413 | 531 | |
| 414 | 532 | case CPUINFO_INT_INPUT_STATE + 0: info->i = cpustate->irq_state; break; |
| 415 | 533 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; |
| r3957 | r3958 | |
| 418 | 536 | |
| 419 | 537 | case CPUINFO_INT_PREVIOUSPC: info->i = cpustate->prevpc; break; |
| 420 | 538 | |
| 421 | case CPUINFO_INT_PC: | |
| 422 | case CPUINFO_INT_REGISTER + I8086_PC: info->i = cpustate->pc; break; | |
| 423 | case CPUINFO_INT_REGISTER + I8086_IP: info->i = cpustate->pc - cpustate->base[CS]; break; | |
| 424 | case CPUINFO_INT_SP: info->i = cpustate->base[SS] + cpustate->regs.w[SP]; break; | |
| 425 | case CPUINFO_INT_REGISTER + I8086_SP: info->i = cpustate->regs.w[SP]; break; | |
| 426 | case CPUINFO_INT_REGISTER + I8086_FLAGS: cpustate->flags = CompressFlags(); info->i = cpustate->flags; break; | |
| 427 | case CPUINFO_INT_REGISTER + I8086_AX: info->i = cpustate->regs.w[AX]; break; | |
| 428 | case CPUINFO_INT_REGISTER + I8086_CX: info->i = cpustate->regs.w[CX]; break; | |
| 429 | case CPUINFO_INT_REGISTER + I8086_DX: info->i = cpustate->regs.w[DX]; break; | |
| 430 | case CPUINFO_INT_REGISTER + I8086_BX: info->i = cpustate->regs.w[BX]; break; | |
| 431 | case CPUINFO_INT_REGISTER + I8086_BP: info->i = cpustate->regs.w[BP]; break; | |
| 432 | case CPUINFO_INT_REGISTER + I8086_SI: info->i = cpustate->regs.w[SI]; break; | |
| 433 | case CPUINFO_INT_REGISTER + I8086_DI: info->i = cpustate->regs.w[DI]; break; | |
| 434 | case CPUINFO_INT_REGISTER + I8086_ES: info->i = cpustate->sregs[ES]; break; | |
| 435 | case CPUINFO_INT_REGISTER + I8086_CS: info->i = cpustate->sregs[CS]; break; | |
| 436 | case CPUINFO_INT_REGISTER + I8086_SS: info->i = cpustate->sregs[SS]; break; | |
| 437 | case CPUINFO_INT_REGISTER + I8086_DS: info->i = cpustate->sregs[DS]; break; | |
| 438 | case CPUINFO_INT_REGISTER + I8086_VECTOR: info->i = cpustate->int_vector; break; | |
| 439 | ||
| 440 | 539 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 441 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i8086); break; | |
| 442 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8086); break; | |
| 443 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(i8086); break; | |
| 444 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(i8086); break; | |
| 445 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(i8086); break; | |
| 446 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 447 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8086); break; | |
| 448 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 540 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i8086); break; | |
| 541 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8086); break; | |
| 542 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(i8086); break; | |
| 543 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(i8086); break; | |
| 544 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i8086); break; | |
| 545 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 546 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8086); break; | |
| 547 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 548 | case CPUINFO_PTR_STATE_TABLE: info->state_table = &cpustate->state; break; | |
| 549 | case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(i8086); break; | |
| 550 | case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(i8086); break; | |
| 551 | case CPUINFO_FCT_EXPORT_STRING: info->export_string = CPU_EXPORT_STRING_NAME(i8086);break; | |
| 449 | 552 | |
| 450 | 553 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 451 | 554 | case CPUINFO_STR_NAME: strcpy(info->s, "8086"); break; |
| r3957 | r3958 | |
| 474 | 577 | cpustate->flags & 0x0002 ? 'N' : '.', |
| 475 | 578 | cpustate->flags & 0x0001 ? 'C' : '.'); |
| 476 | 579 | break; |
| 477 | ||
| 478 | case CPUINFO_STR_REGISTER + I8086_PC: sprintf(info->s, "PC:%04X", cpustate->pc); break; | |
| 479 | case CPUINFO_STR_REGISTER + I8086_IP: sprintf(info->s, "IP: %04X", cpustate->pc - cpustate->base[CS]); break; | |
| 480 | case CPUINFO_STR_REGISTER + I8086_SP: sprintf(info->s, "SP: %04X", cpustate->regs.w[SP]); break; | |
| 481 | case CPUINFO_STR_REGISTER + I8086_FLAGS: sprintf(info->s, "F:%04X", cpustate->flags); break; | |
| 482 | case CPUINFO_STR_REGISTER + I8086_AX: sprintf(info->s, "AX:%04X", cpustate->regs.w[AX]); break; | |
| 483 | case CPUINFO_STR_REGISTER + I8086_CX: sprintf(info->s, "CX:%04X", cpustate->regs.w[CX]); break; | |
| 484 | case CPUINFO_STR_REGISTER + I8086_DX: sprintf(info->s, "DX:%04X", cpustate->regs.w[DX]); break; | |
| 485 | case CPUINFO_STR_REGISTER + I8086_BX: sprintf(info->s, "BX:%04X", cpustate->regs.w[BX]); break; | |
| 486 | case CPUINFO_STR_REGISTER + I8086_BP: sprintf(info->s, "BP:%04X", cpustate->regs.w[BP]); break; | |
| 487 | case CPUINFO_STR_REGISTER + I8086_SI: sprintf(info->s, "SI: %04X", cpustate->regs.w[SI]); break; | |
| 488 | case CPUINFO_STR_REGISTER + I8086_DI: sprintf(info->s, "DI: %04X", cpustate->regs.w[DI]); break; | |
| 489 | case CPUINFO_STR_REGISTER + I8086_ES: sprintf(info->s, "ES:%04X", cpustate->sregs[ES]); break; | |
| 490 | case CPUINFO_STR_REGISTER + I8086_CS: sprintf(info->s, "CS:%04X", cpustate->sregs[CS]); break; | |
| 491 | case CPUINFO_STR_REGISTER + I8086_SS: sprintf(info->s, "SS:%04X", cpustate->sregs[SS]); break; | |
| 492 | case CPUINFO_STR_REGISTER + I8086_DS: sprintf(info->s, "DS:%04X", cpustate->sregs[DS]); break; | |
| 493 | case CPUINFO_STR_REGISTER + I8086_VECTOR: sprintf(info->s, "V:%02X", cpustate->int_vector); break; | |
| 494 | 580 | } |
| 495 | 581 | } |
| 496 | 582 | |
| r3957 | r3958 | |
| 505 | 591 | switch (state) |
| 506 | 592 | { |
| 507 | 593 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 508 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 509 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 594 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 595 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 510 | 596 | |
| 511 | 597 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 512 | case CPUINFO_ | |
| 598 | case CPUINFO_FCT | |
| 513 | 599 | |
| 514 | 600 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 515 | 601 | case CPUINFO_STR_NAME: strcpy(info->s, "8088"); break; |
| r3957 | r3958 | |
| 534 | 620 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 2; break; |
| 535 | 621 | |
| 536 | 622 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 537 | case CPUINFO_ | |
| 623 | case CPUINFO_FCT | |
| 538 | 624 | |
| 539 | 625 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 540 | 626 | case CPUINFO_STR_NAME: strcpy(info->s, "80186"); break; |
| r3957 | r3958 | |
| 555 | 641 | switch (state) |
| 556 | 642 | { |
| 557 | 643 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 558 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 559 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 644 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 645 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 560 | 646 | |
| 561 | 647 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 562 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8088); break; | |
| 563 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(i80186);break; | |
| 648 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8088); break; | |
| 649 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i80186);break; | |
| 564 | 650 | |
| 565 | 651 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 566 | 652 | case CPUINFO_STR_NAME: strcpy(info->s, "80188"); break; |
| r3957 | r3958 | |
|---|---|---|
| 1 | /****************************************************************************/ | |
| 2 | /* real mode i286 emulator by Fabrice Frances */ | |
| 3 | /* (initial work based on David Hedley's pcemu) */ | |
| 4 | /* */ | |
| 5 | /****************************************************************************/ | |
| 1 | /* ASG 971222 -- rewrote this interface */ | |
| 6 | 2 | #pragma once |
| 7 | 3 | |
| 8 | #ifndef __I86_H__ | |
| 9 | #define __I86_H__ | |
| 4 | #ifndef __I86INTF_H__ | |
| 5 | #define __I86INTF_H__ | |
| 10 | 6 | |
| 11 | #define I8086_NMI_INT_VECTOR 2 | |
| 7 | #include "cpuintrf.h" | |
| 8 | ||
| 12 | 9 | #define INPUT_LINE_TEST 20 /* PJB 03/05 */ |
| 13 | 10 | |
| 14 | typedef enum { ES, CS, SS, DS } SREGS; | |
| 15 | typedef enum { AX, CX, DX, BX, SP, BP, SI, DI } WREGS; | |
| 11 | enum | |
| 12 | { | |
| 13 | I8086_IP, | |
| 14 | I8086_AX, | |
| 15 | I8086_CX, | |
| 16 | I8086_DX, | |
| 17 | I8086_BX, | |
| 18 | I8086_SP, | |
| 19 | I8086_BP, | |
| 20 | I8086_SI, | |
| 21 | I8086_DI, | |
| 22 | I8086_AL, | |
| 23 | I8086_CL, | |
| 24 | I8086_DL, | |
| 25 | I8086_BL, | |
| 26 | I8086_AH, | |
| 27 | I8086_CH, | |
| 28 | I8086_DH, | |
| 29 | I8086_BH, | |
| 30 | I8086_FLAGS, | |
| 31 | I8086_ES, | |
| 32 | I8086_CS, | |
| 33 | I8086_SS, | |
| 34 | I8086_DS, | |
| 35 | I8086_VECTOR, | |
| 16 | 36 | |
| 17 | #ifndef FALSE | |
| 18 | #define FALSE 0 | |
| 19 | #define TRUE 1 | |
| 20 | #endif | |
| 37 | I8086_GENPC = REG_GENPC, | |
| 38 | I8086_GENSP = REG_GENSP, | |
| 39 | I8086_GENPCBASE = REG_GENPCBASE | |
| 40 | }; | |
| 21 | 41 | |
| 22 | #ifdef LSB_FIRST | |
| 23 | typedef enum { AL,AH,CL,CH,DL,DH,BL,BH,SPL,SPH,BPL,BPH,SIL,SIH,DIL,DIH } BREGS; | |
| 24 | #else | |
| 25 | typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,SIH,SIL,DIH,DIL } BREGS; | |
| 26 | #endif | |
| 42 | /* Public functions */ | |
| 43 | CPU_GET_INFO( i8086 ); | |
| 44 | #define CPU_I8086 CPU_GET_INFO_NAME( i8086 ) | |
| 27 | 45 | |
| 28 | /* parameter x = result, y = source 1, z = source 2 */ | |
| 46 | CPU_GET_INFO( i8088 ); | |
| 47 | #define CPU_I8088 CPU_GET_INFO_NAME( i8088 ) | |
| 29 | 48 | |
| 30 | #define SetTF(x) (cpustate->TF = (x)) | |
| 31 | #define SetIF(x) (cpustate->IF = (x)) | |
| 32 | #define SetDF(x) (cpustate->DirVal = (x) ? -1 : 1) | |
| 49 | CPU_GET_INFO( i80186 ); | |
| 50 | #define CPU_I80186 CPU_GET_INFO_NAME( i80186 ) | |
| 33 | 51 | |
| 34 | #define SetOFW_Add(x,y,z) (cpustate->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x8000) | |
| 35 | #define SetOFB_Add(x,y,z) (cpustate->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x80) | |
| 36 | #define SetOFW_Sub(x,y,z) (cpustate->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x8000) | |
| 37 | #define SetOFB_Sub(x,y,z) (cpustate->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x80) | |
| 52 | CPU_GET_INFO( i80188 ); | |
| 53 | #define CPU_I80188 CPU_GET_INFO_NAME( i80188 ) | |
| 38 | 54 | |
| 39 | #define SetCFB(x) (cpustate->CarryVal = (x) & 0x100) | |
| 40 | #define SetCFW(x) (cpustate->CarryVal = (x) & 0x10000) | |
| 41 | #define SetAF(x,y,z) (cpustate->AuxVal = ((x) ^ ((y) ^ (z))) & 0x10) | |
| 42 | #define SetSF(x) (cpustate->SignVal = (x)) | |
| 43 | #define SetZF(x) (cpustate->ZeroVal = (x)) | |
| 44 | #define SetPF(x) (cpustate->ParityVal = (x)) | |
| 45 | ||
| 46 | #define SetSZPF_Byte(x) (cpustate->ParityVal = cpustate->SignVal = cpustate->ZeroVal = (INT8)(x)) | |
| 47 | #define SetSZPF_Word(x) (cpustate->ParityVal = cpustate->SignVal = cpustate->ZeroVal = (INT16)(x)) | |
| 48 | ||
| 49 | #define ADDB(dst,src) { unsigned res=dst+src; SetCFB(res); SetOFB_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 50 | #define ADDW(dst,src) { unsigned res=dst+src; SetCFW(res); SetOFW_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 51 | ||
| 52 | #define SUBB(dst,src) { unsigned res=dst-src; SetCFB(res); SetOFB_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 53 | #define SUBW(dst,src) { unsigned res=dst-src; SetCFW(res); SetOFW_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 54 | ||
| 55 | #define ORB(dst,src) dst |= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Byte(dst) | |
| 56 | #define ORW(dst,src) dst |= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Word(dst) | |
| 57 | ||
| 58 | #define ANDB(dst,src) dst &= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Byte(dst) | |
| 59 | #define ANDW(dst,src) dst &= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Word(dst) | |
| 60 | ||
| 61 | #define XORB(dst,src) dst ^= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Byte(dst) | |
| 62 | #define XORW(dst,src) dst ^= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Word(dst) | |
| 63 | ||
| 64 | #define CF (cpustate->CarryVal != 0) | |
| 65 | #define SF (cpustate->SignVal < 0) | |
| 66 | #define ZF (cpustate->ZeroVal == 0) | |
| 67 | #define PF parity_table[cpustate->ParityVal] | |
| 68 | #define AF (cpustate->AuxVal != 0) | |
| 69 | #define OF (cpustate->OverVal != 0) | |
| 70 | #define DF (cpustate->DirVal < 0) | |
| 71 | ||
| 72 | /************************************************************************/ | |
| 73 | ||
| 74 | #define read_byte(a) (*cpustate->mem.rbyte)(cpustate->program, a) | |
| 75 | #define read_word(a) (*cpustate->mem.rword)(cpustate->program, a) | |
| 76 | #define write_byte(a,d) (*cpustate->mem.wbyte)(cpustate->program, (a),(d)) | |
| 77 | #define write_word(a,d) (*cpustate->mem.wword)(cpustate->program, (a),(d)) | |
| 78 | ||
| 79 | #define read_port_byte(a) (*cpustate->mem.rbyte)(cpustate->io, a) | |
| 80 | #define read_port_word(a) (*cpustate->mem.rword)(cpustate->io, a) | |
| 81 | #define write_port_byte(a,d) (*cpustate->mem.wbyte)(cpustate->io, (a),(d)) | |
| 82 | #define write_port_word(a,d) (*cpustate->mem.wword)(cpustate->io, (a),(d)) | |
| 83 | ||
| 84 | /************************************************************************/ | |
| 85 | ||
| 86 | #define SegBase(Seg) (cpustate->sregs[Seg] << 4) | |
| 87 | ||
| 88 | #define DefaultBase(Seg) ((cpustate->seg_prefix && (Seg == DS || Seg == SS)) ? cpustate->prefix_base : cpustate->base[Seg]) | |
| 89 | ||
| 90 | #define GetMemB(Seg,Off) (read_byte((DefaultBase(Seg) + (Off)) & AMASK)) | |
| 91 | #define GetMemW(Seg,Off) (read_word((DefaultBase(Seg) + (Off)) & AMASK)) | |
| 92 | #define PutMemB(Seg,Off,x) write_byte((DefaultBase(Seg) + (Off)) & AMASK, (x)) | |
| 93 | #define PutMemW(Seg,Off,x) write_word((DefaultBase(Seg) + (Off)) & AMASK, (x)) | |
| 94 | ||
| 95 | #define PEEKBYTE(ea) (read_byte((ea) & AMASK)) | |
| 96 | #define ReadByte(ea) (read_byte((ea) & AMASK)) | |
| 97 | #define ReadWord(ea) (read_word((ea) & AMASK)) | |
| 98 | #define WriteByte(ea,val) write_byte((ea) & AMASK, val); | |
| 99 | #define WriteWord(ea,val) write_word((ea) & AMASK, val); | |
| 100 | ||
| 101 | #define FETCH_XOR(a) ((a) ^ cpustate->mem.fetch_xor) | |
| 102 | #define FETCH (memory_raw_read_byte(cpustate->program, FETCH_XOR(cpustate->pc++))) | |
| 103 | #define FETCHOP (memory_decrypted_read_byte(cpustate->program, FETCH_XOR(cpustate->pc++))) | |
| 104 | #define PEEKOP(addr) (memory_decrypted_read_byte(cpustate->program, FETCH_XOR(addr))) | |
| 105 | #define FETCHWORD(var) { var = memory_raw_read_byte(cpustate->program, FETCH_XOR(cpustate->pc)); var += (memory_raw_read_byte(cpustate->program, FETCH_XOR(cpustate->pc + 1)) << 8); cpustate->pc += 2; } | |
| 106 | #define CHANGE_PC(addr) | |
| 107 | #define PUSH(val) { cpustate->regs.w[SP] -= 2; WriteWord(((cpustate->base[SS] + cpustate->regs.w[SP]) & AMASK), val); } | |
| 108 | #define POP(var) { var = ReadWord(((cpustate->base[SS] + cpustate->regs.w[SP]) & AMASK)); cpustate->regs.w[SP] += 2; } | |
| 109 | ||
| 110 | /************************************************************************/ | |
| 111 | ||
| 112 | #define CompressFlags() (WORD)(CF | (PF << 2) | (AF << 4) | (ZF << 6) \ | |
| 113 | | (SF << 7) | (cpustate->TF << 8) | (cpustate->IF << 9) \ | |
| 114 | | (DF << 10) | (OF << 11)) | |
| 115 | ||
| 116 | #define ExpandFlags(f) \ | |
| 117 | { \ | |
| 118 | cpustate->CarryVal = (f) & 1; \ | |
| 119 | cpustate->ParityVal = !((f) & 4); \ | |
| 120 | cpustate->AuxVal = (f) & 16; \ | |
| 121 | cpustate->ZeroVal = !((f) & 64); \ | |
| 122 | cpustate->SignVal = ((f) & 128) ? -1 : 0; \ | |
| 123 | cpustate->TF = ((f) & 256) >> 8; \ | |
| 124 | cpustate->IF = ((f) & 512) >> 9; \ | |
| 125 | cpustate->DirVal = ((f) & 1024) ? -1 : 1; \ | |
| 126 | cpustate->OverVal = (f) & 2048; \ | |
| 127 | } | |
| 128 | ||
| 129 | #endif /* __I86_H__ */ | |
| 55 | #endif /* __I86INTF_H__ */ |
| r0 | r3958 | |
|---|---|---|
| 1 | /****************************************************************************/ | |
| 2 | /* real mode i286 emulator by Fabrice Frances */ | |
| 3 | /* (initial work based on David Hedley's pcemu) */ | |
| 4 | /* */ | |
| 5 | /****************************************************************************/ | |
| 6 | #pragma once | |
| 7 | ||
| 8 | #ifndef __I86_H__ | |
| 9 | #define __I86_H__ | |
| 10 | ||
| 11 | #define I8086_NMI_INT_VECTOR 2 | |
| 12 | ||
| 13 | typedef enum { ES, CS, SS, DS } SREGS; | |
| 14 | typedef enum { AX, CX, DX, BX, SP, BP, SI, DI } WREGS; | |
| 15 | ||
| 16 | #ifndef FALSE | |
| 17 | #define FALSE 0 | |
| 18 | #define TRUE 1 | |
| 19 | #endif | |
| 20 | ||
| 21 | #ifdef LSB_FIRST | |
| 22 | typedef enum { AL,AH,CL,CH,DL,DH,BL,BH,SPL,SPH,BPL,BPH,SIL,SIH,DIL,DIH } BREGS; | |
| 23 | #else | |
| 24 | typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,SIH,SIL,DIH,DIL } BREGS; | |
| 25 | #endif | |
| 26 | ||
| 27 | /* parameter x = result, y = source 1, z = source 2 */ | |
| 28 | ||
| 29 | #define SetTF(x) (cpustate->TF = (x)) | |
| 30 | #define SetIF(x) (cpustate->IF = (x)) | |
| 31 | #define SetDF(x) (cpustate->DirVal = (x) ? -1 : 1) | |
| 32 | ||
| 33 | #define SetOFW_Add(x,y,z) (cpustate->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x8000) | |
| 34 | #define SetOFB_Add(x,y,z) (cpustate->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x80) | |
| 35 | #define SetOFW_Sub(x,y,z) (cpustate->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x8000) | |
| 36 | #define SetOFB_Sub(x,y,z) (cpustate->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x80) | |
| 37 | ||
| 38 | #define SetCFB(x) (cpustate->CarryVal = (x) & 0x100) | |
| 39 | #define SetCFW(x) (cpustate->CarryVal = (x) & 0x10000) | |
| 40 | #define SetAF(x,y,z) (cpustate->AuxVal = ((x) ^ ((y) ^ (z))) & 0x10) | |
| 41 | #define SetSF(x) (cpustate->SignVal = (x)) | |
| 42 | #define SetZF(x) (cpustate->ZeroVal = (x)) | |
| 43 | #define SetPF(x) (cpustate->ParityVal = (x)) | |
| 44 | ||
| 45 | #define SetSZPF_Byte(x) (cpustate->ParityVal = cpustate->SignVal = cpustate->ZeroVal = (INT8)(x)) | |
| 46 | #define SetSZPF_Word(x) (cpustate->ParityVal = cpustate->SignVal = cpustate->ZeroVal = (INT16)(x)) | |
| 47 | ||
| 48 | #define ADDB(dst,src) { unsigned res=dst+src; SetCFB(res); SetOFB_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 49 | #define ADDW(dst,src) { unsigned res=dst+src; SetCFW(res); SetOFW_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 50 | ||
| 51 | #define SUBB(dst,src) { unsigned res=dst-src; SetCFB(res); SetOFB_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 52 | #define SUBW(dst,src) { unsigned res=dst-src; SetCFW(res); SetOFW_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 53 | ||
| 54 | #define ORB(dst,src) dst |= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Byte(dst) | |
| 55 | #define ORW(dst,src) dst |= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Word(dst) | |
| 56 | ||
| 57 | #define ANDB(dst,src) dst &= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Byte(dst) | |
| 58 | #define ANDW(dst,src) dst &= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Word(dst) | |
| 59 | ||
| 60 | #define XORB(dst,src) dst ^= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Byte(dst) | |
| 61 | #define XORW(dst,src) dst ^= src; cpustate->CarryVal = cpustate->OverVal = cpustate->AuxVal = 0; SetSZPF_Word(dst) | |
| 62 | ||
| 63 | #define CF (cpustate->CarryVal != 0) | |
| 64 | #define SF (cpustate->SignVal < 0) | |
| 65 | #define ZF (cpustate->ZeroVal == 0) | |
| 66 | #define PF parity_table[cpustate->ParityVal] | |
| 67 | #define AF (cpustate->AuxVal != 0) | |
| 68 | #define OF (cpustate->OverVal != 0) | |
| 69 | #define DF (cpustate->DirVal < 0) | |
| 70 | ||
| 71 | /************************************************************************/ | |
| 72 | ||
| 73 | #define read_byte(a) (*cpustate->mem.rbyte)(cpustate->program, a) | |
| 74 | #define read_word(a) (*cpustate->mem.rword)(cpustate->program, a) | |
| 75 | #define write_byte(a,d) (*cpustate->mem.wbyte)(cpustate->program, (a),(d)) | |
| 76 | #define write_word(a,d) (*cpustate->mem.wword)(cpustate->program, (a),(d)) | |
| 77 | ||
| 78 | #define read_port_byte(a) (*cpustate->mem.rbyte)(cpustate->io, a) | |
| 79 | #define read_port_word(a) (*cpustate->mem.rword)(cpustate->io, a) | |
| 80 | #define write_port_byte(a,d) (*cpustate->mem.wbyte)(cpustate->io, (a),(d)) | |
| 81 | #define write_port_word(a,d) (*cpustate->mem.wword)(cpustate->io, (a),(d)) | |
| 82 | ||
| 83 | /************************************************************************/ | |
| 84 | ||
| 85 | #define SegBase(Seg) (cpustate->sregs[Seg] << 4) | |
| 86 | ||
| 87 | #define DefaultBase(Seg) ((cpustate->seg_prefix && (Seg == DS || Seg == SS)) ? cpustate->prefix_base : cpustate->base[Seg]) | |
| 88 | ||
| 89 | #define GetMemB(Seg,Off) (read_byte((DefaultBase(Seg) + (Off)) & AMASK)) | |
| 90 | #define GetMemW(Seg,Off) (read_word((DefaultBase(Seg) + (Off)) & AMASK)) | |
| 91 | #define PutMemB(Seg,Off,x) write_byte((DefaultBase(Seg) + (Off)) & AMASK, (x)) | |
| 92 | #define PutMemW(Seg,Off,x) write_word((DefaultBase(Seg) + (Off)) & AMASK, (x)) | |
| 93 | ||
| 94 | #define PEEKBYTE(ea) (read_byte((ea) & AMASK)) | |
| 95 | #define ReadByte(ea) (read_byte((ea) & AMASK)) | |
| 96 | #define ReadWord(ea) (read_word((ea) & AMASK)) | |
| 97 | #define WriteByte(ea,val) write_byte((ea) & AMASK, val); | |
| 98 | #define WriteWord(ea,val) write_word((ea) & AMASK, val); | |
| 99 | ||
| 100 | #define FETCH_XOR(a) ((a) ^ cpustate->mem.fetch_xor) | |
| 101 | #define FETCH (memory_raw_read_byte(cpustate->program, FETCH_XOR(cpustate->pc++))) | |
| 102 | #define FETCHOP (memory_decrypted_read_byte(cpustate->program, FETCH_XOR(cpustate->pc++))) | |
| 103 | #define PEEKOP(addr) (memory_decrypted_read_byte(cpustate->program, FETCH_XOR(addr))) | |
| 104 | #define FETCHWORD(var) { var = memory_raw_read_byte(cpustate->program, FETCH_XOR(cpustate->pc)); var += (memory_raw_read_byte(cpustate->program, FETCH_XOR(cpustate->pc + 1)) << 8); cpustate->pc += 2; } | |
| 105 | #define CHANGE_PC(addr) | |
| 106 | #define PUSH(val) { cpustate->regs.w[SP] -= 2; WriteWord(((cpustate->base[SS] + cpustate->regs.w[SP]) & AMASK), val); } | |
| 107 | #define POP(var) { var = ReadWord(((cpustate->base[SS] + cpustate->regs.w[SP]) & AMASK)); cpustate->regs.w[SP] += 2; } | |
| 108 | ||
| 109 | /************************************************************************/ | |
| 110 | ||
| 111 | #define CompressFlags() (WORD)(CF | (PF << 2) | (AF << 4) | (ZF << 6) \ | |
| 112 | | (SF << 7) | (cpustate->TF << 8) | (cpustate->IF << 9) \ | |
| 113 | | (DF << 10) | (OF << 11)) | |
| 114 | ||
| 115 | #define ExpandFlags(f) \ | |
| 116 | { \ | |
| 117 | cpustate->CarryVal = (f) & 1; \ | |
| 118 | cpustate->ParityVal = !((f) & 4); \ | |
| 119 | cpustate->AuxVal = (f) & 16; \ | |
| 120 | cpustate->ZeroVal = !((f) & 64); \ | |
| 121 | cpustate->SignVal = ((f) & 128) ? -1 : 0; \ | |
| 122 | cpustate->TF = ((f) & 256) >> 8; \ | |
| 123 | cpustate->IF = ((f) & 512) >> 9; \ | |
| 124 | cpustate->DirVal = ((f) & 1024) ? -1 : 1; \ | |
| 125 | cpustate->OverVal = (f) & 2048; \ | |
| 126 | } | |
| 127 | ||
| 128 | #endif /* __I86_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | #define INPUT_LINE_A20 1 |
| 18 | 18 | |
| 19 | #include "i86.h" | |
| 20 | #include "i286intf.h" | |
| 19 | #include "i86priv.h" | |
| 20 | #include "i286.h" | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | #include "i86time.c" |
| r3957 | r3958 | |
| 381 | 381 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 382 | 382 | case CPUINFO_INT_MAX_CYCLES: info->i = 50; break; |
| 383 | 383 | |
| 384 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 385 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 386 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 387 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 388 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 389 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 390 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 391 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 392 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 384 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 385 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 386 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 387 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 388 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 389 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 390 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 391 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 392 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 393 | 393 | |
| 394 | 394 | case CPUINFO_INT_INPUT_STATE + 0: info->i = cpustate->irq_state; break; |
| 395 | 395 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; |
| r3957 | r3958 | |
| 425 | 425 | case CPUINFO_INT_REGISTER + I80286_TR_LIMIT: info->i = cpustate->tr.limit; break; |
| 426 | 426 | |
| 427 | 427 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 428 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i80286); break; | |
| 429 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i80286); break; | |
| 430 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(i80286); break; | |
| 431 | case CPUINFO_PTR_EXIT: info->exit = NULL; break; | |
| 432 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(i80286); break; | |
| 433 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 434 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80286); break; | |
| 428 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i80286); break; | |
| 429 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80286); break; | |
| 430 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(i80286); break; | |
| 431 | case CPUINFO_FCT_EXIT: info->exit = NULL; break; | |
| 432 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i80286); break; | |
| 433 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 434 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80286); break; | |
| 435 | 435 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 436 | 436 | |
| 437 | 437 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r0 | r3958 | |
|---|---|---|
| 1 | /* ASG 971222 -- rewrote this interface */ | |
| 2 | #pragma once | |
| 3 | ||
| 4 | #ifndef __I286INTF_H__ | |
| 5 | #define __I286INTF_H__ | |
| 6 | ||
| 7 | #include "i86.h" | |
| 8 | ||
| 9 | enum | |
| 10 | { | |
| 11 | I80286_PC=0, | |
| 12 | I80286_IP, | |
| 13 | I80286_AX, | |
| 14 | I80286_CX, | |
| 15 | I80286_DX, | |
| 16 | I80286_BX, | |
| 17 | I80286_SP, | |
| 18 | I80286_BP, | |
| 19 | I80286_SI, | |
| 20 | I80286_DI, | |
| 21 | I80286_FLAGS, | |
| 22 | I80286_ES, | |
| 23 | I80286_CS, | |
| 24 | I80286_SS, | |
| 25 | I80286_DS, | |
| 26 | I80286_ES_2, | |
| 27 | I80286_CS_2, | |
| 28 | I80286_SS_2, | |
| 29 | I80286_DS_2, | |
| 30 | I80286_MSW, | |
| 31 | I80286_GDTR_BASE, | |
| 32 | I80286_IDTR_BASE, | |
| 33 | I80286_LDTR_BASE, | |
| 34 | I80286_TR_BASE, | |
| 35 | I80286_GDTR_LIMIT, | |
| 36 | I80286_IDTR_LIMIT, | |
| 37 | I80286_LDTR_LIMIT, | |
| 38 | I80286_TR_LIMIT, | |
| 39 | I80286_VECTOR, | |
| 40 | I80286_PENDING, | |
| 41 | I80286_NMI_STATE, | |
| 42 | I80286_IRQ_STATE | |
| 43 | }; | |
| 44 | ||
| 45 | /* Public functions */ | |
| 46 | CPU_GET_INFO( i80286 ); | |
| 47 | #define CPU_I80286 CPU_GET_INFO_NAME( i80286 ) | |
| 48 | ||
| 49 | #endif /* __I286INTF_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | #include "debugger.h" |
| 14 | 14 | #include "cubeqcpu.h" |
| 15 | #include " | |
| 15 | #include "driver | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | /*************************************************************************** |
| r3957 | r3958 | |
| 1864 | 1864 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1865 | 1865 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 1866 | 1866 | |
| 1867 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 1868 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1869 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -3; break; | |
| 1870 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1871 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1872 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1873 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1874 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1875 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1867 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 1868 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1869 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -3; break; | |
| 1870 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1871 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1872 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1873 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1874 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1875 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1876 | 1876 | |
| 1877 | 1877 | case CPUINFO_INT_PC: |
| 1878 | 1878 | case CPUINFO_INT_REGISTER + CQUESTSND_PC: info->i = cpustate->pc; break; |
| r3957 | r3958 | |
| 1880 | 1880 | case CPUINFO_INT_REGISTER + CQUESTSND_ADRCNTR: info->i = cpustate->adrcntr; break; |
| 1881 | 1881 | |
| 1882 | 1882 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1883 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cquestsnd); break; | |
| 1884 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cquestsnd); break; | |
| 1885 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cquestsnd); break; | |
| 1886 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(cquestsnd); break; | |
| 1887 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cquestsnd); break; | |
| 1888 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1889 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cquestsnd); break; | |
| 1883 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cquestsnd); break; | |
| 1884 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cquestsnd); break; | |
| 1885 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cquestsnd); break; | |
| 1886 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(cquestsnd); break; | |
| 1887 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cquestsnd); break; | |
| 1888 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1889 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cquestsnd); break; | |
| 1890 | 1890 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1891 | 1891 | |
| 1892 | 1892 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1982 | 1982 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1983 | 1983 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 1984 | 1984 | |
| 1985 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 1986 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 9; break; | |
| 1987 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -3; break; | |
| 1988 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1989 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1990 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1991 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1992 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1993 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1985 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 1986 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 9; break; | |
| 1987 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -3; break; | |
| 1988 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1989 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1990 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1991 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1992 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1993 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1994 | 1994 | |
| 1995 | 1995 | case CPUINFO_INT_PC: |
| 1996 | 1996 | case CPUINFO_INT_REGISTER + CQUESTROT_PC: info->i = cpustate->pc; break; |
| 1997 | 1997 | |
| 1998 | 1998 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1999 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cquestrot); break; | |
| 2000 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cquestrot); break; | |
| 2001 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cquestrot); break; | |
| 2002 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(cquestrot); break; | |
| 2003 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cquestrot); break; | |
| 2004 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2005 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cquestrot); break; | |
| 1999 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cquestrot); break; | |
| 2000 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cquestrot); break; | |
| 2001 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cquestrot); break; | |
| 2002 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(cquestrot); break; | |
| 2003 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cquestrot); break; | |
| 2004 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2005 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cquestrot); break; | |
| 2006 | 2006 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2007 | 2007 | |
| 2008 | 2008 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 2100 | 2100 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2101 | 2101 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 2102 | 2102 | |
| 2103 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 2104 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 2105 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -3; break; | |
| 2106 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2107 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2108 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2109 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2110 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2111 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2103 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 2104 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 2105 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -3; break; | |
| 2106 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2107 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2108 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2109 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 2110 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 2111 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2112 | 2112 | |
| 2113 | 2113 | case CPUINFO_INT_PC: |
| 2114 | 2114 | case CPUINFO_INT_REGISTER + CQUESTLIN_FGPC: info->i = cpustate->pc[cpustate->clkcnt & 3 ? BACKGROUND : FOREGROUND]; break; |
| 2115 | 2115 | |
| 2116 | 2116 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2117 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cquestlin); break; | |
| 2118 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cquestlin); break; | |
| 2119 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cquestlin); break; | |
| 2120 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(cquestlin); break; | |
| 2121 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cquestlin); break; | |
| 2122 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2123 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cquestlin); break; | |
| 2117 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cquestlin); break; | |
| 2118 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cquestlin); break; | |
| 2119 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cquestlin); break; | |
| 2120 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(cquestlin); break; | |
| 2121 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cquestlin); break; | |
| 2122 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2123 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cquestlin); break; | |
| 2124 | 2124 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2125 | 2125 | |
| 2126 | 2126 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 156 | 156 | UINT8 cubeqcpu_get_ptr_ram_val(const device_config *device, int i); |
| 157 | 157 | UINT32* cubeqcpu_get_stack_ram(const device_config *device); |
| 158 | 158 | |
| 159 | CPU_GET_INFO( cquestsnd ); | |
| 160 | CPU_GET_INFO( cquestrot ); | |
| 161 | CPU_GET_INFO( cquestlin ); | |
| 159 | 162 | |
| 163 | #define CPU_CQUESTSND CPU_GET_INFO_NAME( cquestsnd ) | |
| 164 | #define CPU_CQUESTROT CPU_GET_INFO_NAME( cquestrot ) | |
| 165 | #define CPU_CQUESTLIN CPU_GET_INFO_NAME( cquestlin ) | |
| 166 | ||
| 160 | 167 | #endif /* _CUBEQCPU_H */ |
| r3957 | r3958 | |
|---|---|---|
| 987 | 987 | { |
| 988 | 988 | TXD = cpustate->txs & 1; |
| 989 | 989 | if (cpustate->config.io_callback) |
| 990 | (*cpustate->config.io_callback)(UPD7810_TXD,TXD); | |
| 990 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TXD,TXD); | |
| 991 | 991 | cpustate->txs >>= 1; |
| 992 | 992 | cpustate->txcnt--; |
| 993 | 993 | if (0 == cpustate->txcnt) |
| r3957 | r3958 | |
| 1086 | 1086 | if (cpustate->rxcnt > 0) |
| 1087 | 1087 | { |
| 1088 | 1088 | if (cpustate->config.io_callback) |
| 1089 | RXD = (*cpustate->config.io_callback)(UPD7810_RXD,RXD); | |
| 1089 | RXD = (*cpustate->config.io_callback)(cpustate->device,UPD7810_RXD,RXD); | |
| 1090 | 1090 | cpustate->rxs = (cpustate->rxs >> 1) | ((UINT16)RXD << 15); |
| 1091 | 1091 | cpustate->rxcnt--; |
| 1092 | 1092 | if (0 == cpustate->rxcnt) |
| r3957 | r3958 | |
| 1288 | 1288 | { |
| 1289 | 1289 | TO ^= 1; |
| 1290 | 1290 | if (cpustate->config.io_callback) |
| 1291 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1291 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1292 | 1292 | } |
| 1293 | 1293 | /* timer 1 chained with timer 0 ? */ |
| 1294 | 1294 | if ((TMM & 0xe0) == 0x60) |
| r3957 | r3958 | |
| 1303 | 1303 | { |
| 1304 | 1304 | TO ^= 1; |
| 1305 | 1305 | if (cpustate->config.io_callback) |
| 1306 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1306 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1307 | 1307 | } |
| 1308 | 1308 | } |
| 1309 | 1309 | } |
| r3957 | r3958 | |
| 1325 | 1325 | { |
| 1326 | 1326 | TO ^= 1; |
| 1327 | 1327 | if (cpustate->config.io_callback) |
| 1328 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1328 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1329 | 1329 | } |
| 1330 | 1330 | /* timer 1 chained with timer 0 ? */ |
| 1331 | 1331 | if ((TMM & 0xe0) == 0x60) |
| r3957 | r3958 | |
| 1340 | 1340 | { |
| 1341 | 1341 | TO ^= 1; |
| 1342 | 1342 | if (cpustate->config.io_callback) |
| 1343 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1343 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1344 | 1344 | } |
| 1345 | 1345 | } |
| 1346 | 1346 | } |
| r3957 | r3958 | |
| 1376 | 1376 | { |
| 1377 | 1377 | TO ^= 1; |
| 1378 | 1378 | if (cpustate->config.io_callback) |
| 1379 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1379 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1380 | 1380 | } |
| 1381 | 1381 | } |
| 1382 | 1382 | } |
| r3957 | r3958 | |
| 1396 | 1396 | { |
| 1397 | 1397 | TO ^= 1; |
| 1398 | 1398 | if (cpustate->config.io_callback) |
| 1399 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1399 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1400 | 1400 | } |
| 1401 | 1401 | } |
| 1402 | 1402 | } |
| r3957 | r3958 | |
| 1417 | 1417 | { |
| 1418 | 1418 | TO ^= 1; |
| 1419 | 1419 | if (cpustate->config.io_callback) |
| 1420 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1420 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1421 | 1421 | OVCF -= 3; |
| 1422 | 1422 | } |
| 1423 | 1423 | } |
| r3957 | r3958 | |
| 1609 | 1609 | if (0x00 == (TMM & 0x03)) { |
| 1610 | 1610 | TO ^= 1; |
| 1611 | 1611 | if (cpustate->config.io_callback) |
| 1612 | (*cpustate->config.io_callback)(UPD7810_TO,TO); | |
| 1612 | (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO); | |
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | 1615 | while ( cpustate->ovc0 <= 0 ) { |
| r3957 | r3958 | |
| 2016 | 2016 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2017 | 2017 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 2018 | 2018 | |
| 2019 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 2020 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 2021 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2022 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2023 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2024 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2025 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2026 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2027 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2019 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 2020 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 2021 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2022 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2023 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2024 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2025 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2026 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 8; break; | |
| 2027 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2028 | 2028 | |
| 2029 | 2029 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = (IRR & INTNMI) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2030 | 2030 | case CPUINFO_INT_INPUT_STATE + UPD7810_INTF1: info->i = (IRR & INTF1) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 2087 | 2087 | case CPUINFO_INT_REGISTER + UPD7810_CO1: info->i = CO1; break; |
| 2088 | 2088 | |
| 2089 | 2089 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2090 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(upd7810); break; | |
| 2091 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(upd7810); break; | |
| 2092 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(upd7810); break; | |
| 2093 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(upd7810); break; | |
| 2094 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(upd7810); break; | |
| 2095 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2096 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd7810); break; | |
| 2090 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(upd7810); break; | |
| 2091 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(upd7810); break; | |
| 2092 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(upd7810); break; | |
| 2093 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(upd7810); break; | |
| 2094 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(upd7810); break; | |
| 2095 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2096 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd7810); break; | |
| 2097 | 2097 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2098 | 2098 | |
| 2099 | 2099 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 2178 | 2178 | switch (state) |
| 2179 | 2179 | { |
| 2180 | 2180 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2181 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(upd7807); break; | |
| 2182 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd7807); break; | |
| 2181 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(upd7807); break; | |
| 2182 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd7807); break; | |
| 2183 | 2183 | |
| 2184 | 2184 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2185 | 2185 | case CPUINFO_STR_NAME: strcpy(info->s, "uPD7807"); break; |
| r3957 | r3958 | |
| 2190 | 2190 | |
| 2191 | 2191 | CPU_GET_INFO( upd7801 ) { |
| 2192 | 2192 | switch( state ) { |
| 2193 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(upd7801); break; | |
| 2194 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd7801); break; | |
| 2193 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(upd7801); break; | |
| 2194 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd7801); break; | |
| 2195 | 2195 | |
| 2196 | 2196 | case CPUINFO_STR_NAME: strcpy(info->s, "uPD7801"); break; |
| 2197 | 2197 | |
| r3957 | r3958 | |
| 2203 | 2203 | switch ( state ) { |
| 2204 | 2204 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; |
| 2205 | 2205 | |
| 2206 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(upd78c05); break; | |
| 2207 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd78c05); break; | |
| 2206 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(upd78c05); break; | |
| 2207 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(upd78c05); break; | |
| 2208 | 2208 | |
| 2209 | 2209 | case CPUINFO_STR_NAME: strcpy(info->s, "uPD78C05"); break; |
| 2210 | 2210 | |
| r3957 | r3958 | |
| 2248 | 2248 | |
| 2249 | 2249 | CPU_GET_INFO( upd78c06 ) { |
| 2250 | 2250 | switch ( state ) { |
| 2251 | case CPUINFO_ | |
| 2251 | case CPUINFO_FCT | |
| 2252 | 2252 | |
| 2253 | 2253 | case CPUINFO_STR_NAME: strcpy(info->s, "uPD78C06"); break; |
| 2254 | 2254 |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | * It will be called whenever an output signal changes or a new |
| 32 | 32 | * input line state is to be sampled. |
| 33 | 33 | */ |
| 34 | typedef int (*upd7810_io_callback)(int ioline, int state); | |
| 34 | typedef int (*upd7810_io_callback)(const device_config *device, int ioline, int state); | |
| 35 | 35 | |
| 36 | 36 | // use it as reset parameter in the Machine struct |
| 37 | 37 | typedef struct { |
| r3957 | r3958 | |
| 77 | 77 | CPU_GET_INFO( upd78c05 ); |
| 78 | 78 | CPU_GET_INFO( upd78c06 ); |
| 79 | 79 | |
| 80 | #define CPU_UPD7810 CPU_GET_INFO_NAME( upd7810 ) | |
| 81 | #define CPU_UPD7807 CPU_GET_INFO_NAME( upd7807 ) | |
| 82 | #define CPU_UPD7801 CPU_GET_INFO_NAME( upd7801 ) | |
| 83 | #define CPU_UPD78C05 CPU_GET_INFO_NAME( upd78c05 ) | |
| 84 | #define CPU_UPD78C06 CPU_GET_INFO_NAME( upd78c06 ) | |
| 85 | ||
| 80 | 86 | CPU_DISASSEMBLE( upd7810 ); |
| 81 | 87 | CPU_DISASSEMBLE( upd7807 ); |
| 82 | 88 | CPU_DISASSEMBLE( upd7801 ); |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | UINT8 *sc61860_internal_ram(const device_config *device); |
| 58 | 58 | |
| 59 | 59 | CPU_GET_INFO( sc61860 ); |
| 60 | #define CPU_SC61860 CPU_GET_INFO_NAME( sc61860 ) | |
| 60 | 61 | |
| 61 | 62 | #endif /* __SC61860_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 179 | 179 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 180 | 180 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 181 | 181 | |
| 182 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 183 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 184 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 185 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 186 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 187 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 188 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 189 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 190 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 182 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 183 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 184 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 185 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 186 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 187 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 188 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 189 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 190 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 191 | 191 | |
| 192 | 192 | case CPUINFO_INT_PREVIOUSPC: info->i = cpustate->oldpc; break; |
| 193 | 193 | |
| r3957 | r3958 | |
| 202 | 202 | case CPUINFO_INT_REGISTER + SC61860_ZERO: info->i = cpustate->zero; break; |
| 203 | 203 | |
| 204 | 204 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 205 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sc61860); break; | |
| 206 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(sc61860); break; | |
| 207 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(sc61860); break; | |
| 208 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(sc61860); break; | |
| 209 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 210 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sc61860); break; | |
| 205 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sc61860); break; | |
| 206 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(sc61860); break; | |
| 207 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(sc61860); break; | |
| 208 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sc61860); break; | |
| 209 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 210 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sc61860); break; | |
| 211 | 211 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 212 | 212 | |
| 213 | 213 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | MINX_XI, MINX_YI, |
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | CPU_GET_INFO( minx ); | |
| 19 | #define CPU_MINX CPU_GET_INFO_NAME( minx ) | |
| 20 | ||
| 18 | 21 | extern CPU_DISASSEMBLE( minx ); |
| 19 | 22 | |
| 20 | 23 | #endif /* __MINX_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 214 | 214 | { |
| 215 | 215 | switch( regnum ) |
| 216 | 216 | { |
| 217 | case REG_PC: return GET_MINX_PC; | |
| 217 | case REG_GENPC: return GET_MINX_PC; | |
| 218 | 218 | case MINX_PC: return regs.PC; |
| 219 | case REG_SP: | |
| 219 | case REG_GENSP: | |
| 220 | 220 | case MINX_SP: return regs.SP; |
| 221 | 221 | case MINX_BA: return regs.BA; |
| 222 | 222 | case MINX_HL: return regs.HL; |
| r3957 | r3958 | |
| 239 | 239 | { |
| 240 | 240 | switch( regnum ) |
| 241 | 241 | { |
| 242 | case REG_PC: break; | |
| 242 | case REG_GENPC: break; | |
| 243 | 243 | case MINX_PC: regs.PC = val; break; |
| 244 | case REG_SP: | |
| 244 | case REG_GENSP: | |
| 245 | 245 | case MINX_SP: regs.SP = val; break; |
| 246 | 246 | case MINX_BA: regs.BA = val; break; |
| 247 | 247 | case MINX_HL: regs.HL = val; break; |
| r3957 | r3958 | |
| 312 | 312 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 5; break; |
| 313 | 313 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 314 | 314 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 315 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 316 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 317 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 318 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 319 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 320 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 321 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 322 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 323 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 315 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 316 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 317 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 318 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 319 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 320 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 321 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 322 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 323 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 324 | 324 | case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; break; |
| 325 | case CPUINFO_INT_REGISTER + REG_PC: info->i = GET_MINX_PC; break; | |
| 326 | case CPUINFO_INT_REGISTER + REG_SP: | |
| 325 | case CPUINFO_INT_REGISTER + REG_GENPC: info->i = GET_MINX_PC; break; | |
| 326 | case CPUINFO_INT_REGISTER + REG_GENSP: | |
| 327 | 327 | case CPUINFO_INT_REGISTER + MINX_PC: |
| 328 | 328 | case CPUINFO_INT_REGISTER + MINX_SP: |
| 329 | 329 | case CPUINFO_INT_REGISTER + MINX_BA: |
| r3957 | r3958 | |
| 339 | 339 | case CPUINFO_INT_REGISTER + MINX_XI: |
| 340 | 340 | case CPUINFO_INT_REGISTER + MINX_YI: info->i = minx_get_reg( state - CPUINFO_INT_REGISTER ); break; |
| 341 | 341 | case CPUINFO_INT_PREVIOUSPC: info->i = 0x0000; break; |
| 342 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(minx); break; | |
| 343 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(minx); break; | |
| 344 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(minx); break; | |
| 345 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(minx); break; | |
| 346 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(minx); break; | |
| 347 | case CPUINFO_PTR_BURN: info->burn = CPU_BURN_NAME(minx); break; | |
| 348 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(minx); break; | |
| 342 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(minx); break; | |
| 343 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(minx); break; | |
| 344 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(minx); break; | |
| 345 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(minx); break; | |
| 346 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(minx); break; | |
| 347 | case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(minx); break; | |
| 348 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(minx); break; | |
| 349 | 349 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &minx_icount; break; |
| 350 | 350 | case CPUINFO_STR_NAME: strcpy( info->s, "Minx" ); break; |
| 351 | 351 | case CPUINFO_STR_CORE_FAMILY: strcpy( info->s, "Nintendo Minx" ); break; |
| r3957 | r3958 | |
|---|---|---|
| 578 | 578 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 579 | 579 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 580 | 580 | |
| 581 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 582 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 583 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 584 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 585 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 586 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 587 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 588 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 24; break; | |
| 589 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 581 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 582 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 583 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 584 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 585 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 586 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 587 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 588 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 24; break; | |
| 589 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 590 | 590 | |
| 591 | 591 | case CPUINFO_INT_INPUT_STATE + 0: info->i = cpustate->irq_line; break; |
| 592 | 592 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_line; break; |
| r3957 | r3958 | |
| 655 | 655 | case CPUINFO_INT_REGISTER + V60_ADTMR1: info->i = cpustate->ADTMR1; break; |
| 656 | 656 | |
| 657 | 657 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 658 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(v60); break; | |
| 659 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(v60); break; | |
| 660 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(v60); break; | |
| 661 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(v60); break; | |
| 662 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(v60); break; | |
| 663 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 664 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(v60); break; | |
| 658 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(v60); break; | |
| 659 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v60); break; | |
| 660 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(v60); break; | |
| 661 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(v60); break; | |
| 662 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(v60); break; | |
| 663 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 664 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(v60); break; | |
| 665 | 665 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 666 | 666 | |
| 667 | 667 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 744 | 744 | switch (state) |
| 745 | 745 | { |
| 746 | 746 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 747 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 748 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 749 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 747 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 748 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 749 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 750 | 750 | |
| 751 | 751 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 752 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(v70); break; | |
| 753 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(v70); break; | |
| 752 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v70); break; | |
| 753 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(v70); break; | |
| 754 | 754 | |
| 755 | 755 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 756 | 756 | case CPUINFO_STR_NAME: strcpy(info->s, "V70"); break; |
| r3957 | r3958 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | #if HAS_V60 |
| 85 | 85 | CPU_GET_INFO( v60 ); |
| 86 | #define CPU_V60 CPU_GET_INFO_NAME( v60 ) | |
| 86 | 87 | #endif /* HAS_V60 */ |
| 87 | 88 | |
| 88 | 89 | #if HAS_V70 |
| 89 | 90 | CPU_GET_INFO( v70 ); |
| 91 | #define CPU_V70 CPU_GET_INFO_NAME( v70 ) | |
| 90 | 92 | #endif /* HAS_V70 */ |
| 91 | 93 | |
| 92 | 94 | #endif /* __V60_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | // Needed for MAME |
| 68 | 68 | extern CPU_GET_INFO( dsp56k ); |
| 69 | #define CPU_DSP56156 CPU_GET_INFO_NAME( dsp56k ) | |
| 69 | 70 | |
| 70 | 71 | |
| 71 | 72 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | // |
| 16 | 16 | // |
| 17 | 17 | |
| 18 | /* | |
| 19 | TODO: | |
| 20 | - 0x01ee: should this move sign extend? otherwise the test-against-minus means nothing. | |
| 21 | - Restore only the proper bits upon loop termination! | |
| 22 | - BFCLR has some errata in the docs that may need to be applied. | |
| 23 | - *_bit_set(0) is difficult to read. maybe make it *_bit_chg(0). | |
| 24 | - Potentially "better" reporting for unimplemented opcodes. | |
| 25 | */ | |
| 26 | ||
| 18 | 27 | /************************/ |
| 19 | 28 | /* Datatypes and macros */ |
| 20 | 29 | /************************/ |
| r3957 | r3958 | |
| 175 | 184 | static int decode_cccc_table(dsp56k_core* cpustate, UINT16 cccc); |
| 176 | 185 | static void decode_DDDDD_table(dsp56k_core* cpustate, UINT16 DDDDD, typed_pointer* ret); |
| 177 | 186 | static void decode_DD_table(dsp56k_core* cpustate, UINT16 DD, typed_pointer* ret); |
| 187 | static void decode_DDF_table(dsp56k_core* cpustate, UINT16 DD, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret); | |
| 178 | 188 | static void decode_F_table(dsp56k_core* cpustate, UINT16 F, typed_pointer* ret); |
| 179 | 189 | static void decode_h0hF_table(dsp56k_core* cpustate, UINT16 h0h, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret); |
| 180 | 190 | static void decode_HH_table(dsp56k_core* cpustate, UINT16 HH, typed_pointer* ret); |
| r3957 | r3958 | |
| 1125 | 1135 | case DT_LONG_WORD: useVal = (UINT64)*((UINT64*)S.addr); break; |
| 1126 | 1136 | } |
| 1127 | 1137 | |
| 1128 | /* TODO: Verify : Sign-extend everyone for proper add/sub op */ | |
| 1129 | if (useVal & U64(0x0000000080000000)) | |
| 1130 | useVal |= U64(0xffffffff00000000); | |
| 1138 | /* Sign-extend word for proper add/sub op */ | |
| 1139 | if ((S.data_type == DT_WORD) && useVal & U64(0x0000000080000000)) | |
| 1140 | useVal |= U64(0x000000ff00000000); | |
| 1131 | 1141 | |
| 1132 | 1142 | /* Operate*/ |
| 1133 | 1143 | if (op_type == OP_ADD) |
| r3957 | r3958 | |
| 1141 | 1151 | /* S L E U N Z V C */ |
| 1142 | 1152 | /* * * * * * * * * */ |
| 1143 | 1153 | /* TODO S, L, E, U, V, C */ |
| 1144 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1145 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); | |
| 1154 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1155 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1146 | 1156 | |
| 1147 | 1157 | cycles += 2; /* TODO: + mv oscillator cycles */ |
| 1148 | 1158 | return 1; |
| r3957 | r3958 | |
| 1192 | 1202 | /* S L E U N Z V C */ |
| 1193 | 1203 | /* * * * * * * * - */ |
| 1194 | 1204 | /* TODO: S, L, E, V */ |
| 1195 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1196 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); | |
| 1205 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1206 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1197 | 1207 | |
| 1198 | 1208 | cycles += 2; /* TODO: +mv oscillator cycles */ |
| 1199 | 1209 | return 1; |
| r3957 | r3958 | |
| 1246 | 1256 | /* S L E U N Z V C */ |
| 1247 | 1257 | /* * * * * * * * - */ |
| 1248 | 1258 | /* TODO: S, L, E, V */ |
| 1249 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1250 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); | |
| 1259 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1260 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1251 | 1261 | |
| 1252 | 1262 | cycles += 2; /* TODO: +mv oscillator cycles */ |
| 1253 | 1263 | return 1; |
| r3957 | r3958 | |
| 1334 | 1344 | case DT_LONG_WORD: addVal = (UINT64)*((UINT64*)S.addr); break; |
| 1335 | 1345 | } |
| 1336 | 1346 | |
| 1337 | /* TODO: Verify : Sign-extend everyone for proper addition op */ | |
| 1338 | if (addVal & U64(0x0000000080000000)) | |
| 1339 | addVal |= U64(0xffffffff00000000); | |
| 1347 | /* Sign-extend word for proper add/sub op */ | |
| 1348 | if ((S.data_type == DT_WORD) && addVal & U64(0x0000000080000000)) | |
| 1349 | addVal |= U64(0x000000ff00000000); | |
| 1340 | 1350 | |
| 1341 | 1351 | /* Operate*/ |
| 1342 | 1352 | *((UINT64*)D.addr) += addVal; |
| r3957 | r3958 | |
| 1347 | 1357 | /* S L E U N Z V C */ |
| 1348 | 1358 | /* * * * * * * * * */ |
| 1349 | 1359 | /* TODO S, L, E, U, V, C */ |
| 1350 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1351 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); | |
| 1360 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1361 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1352 | 1362 | |
| 1353 | 1363 | cycles += 2; /* TODO: + mv oscillator cycles */ |
| 1354 | 1364 | return 1; |
| r3957 | r3958 | |
| 1395 | 1405 | /* RND : .... .... 0010 F000 : A-188 */ |
| 1396 | 1406 | static size_t dsp56k_op_rnd(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) |
| 1397 | 1407 | { |
| 1408 | typed_pointer D = {NULL, DT_BYTE}; | |
| 1409 | ||
| 1410 | decode_F_table(cpustate, BITS(op_byte,0x0008), &D); | |
| 1411 | ||
| 1412 | *p_accum = *((UINT64*)D.addr); | |
| 1413 | ||
| 1414 | /* WARNING : ROUNDING NOT FULLY IMPLEMENTED YET! */ | |
| 1415 | if ((*((UINT64*)D.addr) & U64(0x000000000000ffff)) >= 0x8000) | |
| 1416 | *((UINT64*)D.addr) += U64(0x0000000000010000); | |
| 1417 | ||
| 1418 | *((UINT64*)D.addr) = *((UINT64*)D.addr) & U64(0x000000ffffff0000); | |
| 1419 | ||
| 1420 | d_register->addr = D.addr; | |
| 1421 | d_register->data_type = D.data_type; | |
| 1422 | ||
| 1398 | 1423 | /* S L E U N Z V C */ |
| 1399 | 1424 | /* * * * * * * * - */ |
| 1400 | return 0; | |
| 1425 | /* TODO: S, L, E, U, V */ | |
| 1426 | if ((*((UINT64*)D.addr)) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1427 | if ((*((UINT64*)D.addr)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1428 | ||
| 1429 | cycles += 2; /* TODO: + mv oscillator clock cycles */ | |
| 1430 | return 1; | |
| 1401 | 1431 | } |
| 1402 | 1432 | |
| 1403 | 1433 | /* TST : .... .... 0010 F001 : A-218 */ |
| r3957 | r3958 | |
| 1445 | 1475 | /* S L E U N Z V C */ |
| 1446 | 1476 | /* * * * * * * * * */ |
| 1447 | 1477 | /* TODO: S, L, E, U, V, C */ |
| 1448 | if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1449 | if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) Z_bit_set(cpustate, 1); | |
| 1478 | if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1479 | if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1450 | 1480 | |
| 1451 | 1481 | cycles += 2; /* TODO: +mv oscillator cycles */ |
| 1452 | 1482 | return 1; |
| r3957 | r3958 | |
| 1478 | 1508 | /* S L E U N Z V C */ |
| 1479 | 1509 | /* * * * * * ? * * */ |
| 1480 | 1510 | /* TODO: S, L, E, U, V, C */ |
| 1481 | if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1482 | if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) Z_bit_set(cpustate, 1); | |
| 1511 | if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1512 | if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1483 | 1513 | |
| 1484 | 1514 | cycles += 2; /* TODO: + mv oscillator clock cycles */ |
| 1485 | 1515 | return 1; |
| r3957 | r3958 | |
| 1536 | 1566 | /* S L E U N Z V C */ |
| 1537 | 1567 | /* * * * * * * 0 ? */ |
| 1538 | 1568 | /* TODO: S, L, E, U */ |
| 1539 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1540 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); | |
| 1569 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1570 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1541 | 1571 | V_bit_set(cpustate, 0); |
| 1542 | if (*p_accum & U64(0x0000000000000001)) C_bit_set(cpustate, 1); | |
| 1572 | if (*p_accum & U64(0x0000000000000001)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 1543 | 1573 | |
| 1544 | 1574 | cycles += 2; /* TODO: + mv oscillator cycles */ |
| 1545 | 1575 | return 1; |
| r3957 | r3958 | |
| 1577 | 1607 | /* * * - - ? ? 0 ? */ |
| 1578 | 1608 | /* TODO: S, L */ |
| 1579 | 1609 | N_bit_set(cpustate, 0); |
| 1580 | if (((PAIR64*)D.addr)->w.h == 0) | |
| 1610 | if (((PAIR64*)D.addr)->w.h == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1581 | 1611 | V_bit_set(cpustate, 0); |
| 1582 | if (*p_accum & U64(0x0000000000010000)) | |
| 1612 | if (*p_accum & U64(0x0000000000010000)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 1583 | 1613 | |
| 1584 | 1614 | cycles += 2; /* TODO: + mv oscillator cycles */ |
| 1585 | 1615 | return 1; |
| r3957 | r3958 | |
| 1656 | 1686 | |
| 1657 | 1687 | switch(S.data_type) |
| 1658 | 1688 | { |
| 1659 | case DT_WORD: cmpVal = (UINT64)*((UINT16*)S.addr); break; | |
| 1689 | case DT_WORD: cmpVal = (UINT64)*((UINT16*)S.addr) << 16; break; | |
| 1660 | 1690 | case DT_DOUBLE_WORD: cmpVal = (UINT64)*((UINT32*)S.addr); break; |
| 1661 | 1691 | case DT_LONG_WORD: cmpVal = (UINT64)*((UINT64*)S.addr); break; |
| 1662 | 1692 | } |
| 1663 | 1693 | |
| 1694 | /* Sign-extend word for proper subtraction op */ | |
| 1695 | if ((S.data_type == DT_WORD) && cmpVal & U64(0x0000000080000000)) | |
| 1696 | cmpVal |= U64(0x000000ff00000000); | |
| 1697 | ||
| 1698 | /* Make sure they're both real 40-bit values */ | |
| 1699 | cmpVal &= U64(0x000000ffffffffff); | |
| 1700 | *((UINT64*)D.addr) &= U64(0x000000ffffffffff); | |
| 1701 | ||
| 1702 | /* Operate */ | |
| 1664 | 1703 | result = *((UINT64*)D.addr) - cmpVal; |
| 1665 | 1704 | |
| 1666 | 1705 | d_register->addr = D.addr; |
| r3957 | r3958 | |
| 1669 | 1708 | /* S L E U N Z V C */ |
| 1670 | 1709 | /* * * * * * * * * */ |
| 1671 | 1710 | /* TODO: S, L, E, U, N, V, C */ |
| 1672 | if (result == 0) Z_bit_set(cpustate, 1); | |
| 1711 | if (result == 0) Z_bit_set(cpustate, 1); | |
| 1673 | 1712 | |
| 1674 | 1713 | |
| 1675 | 1714 | cycles += 2; /* TODO: + mv oscillator clock cycles */ |
| r3957 | r3958 | |
| 1701 | 1740 | /* S L E U N Z V C */ |
| 1702 | 1741 | /* * * - - ? ? 0 - */ |
| 1703 | 1742 | /* TODO: S?, L */ |
| 1704 | if ( *((UINT64*)D.addr) & U64(0x0000000080000000)) N_bit_set(cpustate, 1); | |
| 1705 | if ((*((UINT64*)D.addr) & U64(0x00000000ffff0000)) == 0) Z_bit_set(cpustate, 1); | |
| 1743 | if ( *((UINT64*)D.addr) & U64(0x0000000080000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1744 | if ((*((UINT64*)D.addr) & U64(0x00000000ffff0000)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1706 | 1745 | V_bit_set(cpustate, 0); |
| 1707 | 1746 | |
| 1708 | 1747 | cycles += 2; /* TODO: + mv oscillator cycles */ |
| r3957 | r3958 | |
| 1743 | 1782 | /* S L E U N Z V C */ |
| 1744 | 1783 | /* * * * * * ? * * */ |
| 1745 | 1784 | /* TODO: S, L, E, U, V, C */ |
| 1746 | if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1747 | if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) Z_bit_set(cpustate, 1); | |
| 1785 | if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1786 | if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1748 | 1787 | |
| 1749 | 1788 | cycles += 2; /* TODO: + mv oscillator clock cycles */ |
| 1750 | 1789 | return 1; |
| r3957 | r3958 | |
| 1770 | 1809 | /* S L E U N Z V C */ |
| 1771 | 1810 | /* * * - - ? ? 0 - */ |
| 1772 | 1811 | /* TODO: S, L */ |
| 1773 | if ( *((UINT64*)D.addr) & U64(0x0000000080000000)) N_bit_set(cpustate, 1); | |
| 1774 | if ((*((UINT64*)D.addr) & U64(0x00000000ffff0000)) == 0) Z_bit_set(cpustate, 1); | |
| 1812 | if ( *((UINT64*)D.addr) & U64(0x0000000080000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1813 | if ((*((UINT64*)D.addr) & U64(0x00000000ffff0000)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1775 | 1814 | V_bit_set(cpustate, 0); |
| 1776 | 1815 | |
| 1777 | 1816 | cycles += 2; /* TODO: + mv oscillator cycles */ |
| r3957 | r3958 | |
| 1861 | 1900 | /* S L E U N Z V C */ |
| 1862 | 1901 | /* * * * * * * * * */ |
| 1863 | 1902 | /* TODO: S, L, E, U, V, C */ |
| 1864 | if ( (absResult) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1865 | if (((absResult) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1903 | if ( (absResult) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1904 | if (((absResult) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1866 | 1905 | |
| 1867 | 1906 | cycles += 2; /* TODO: +mv oscillator cycles */ |
| 1868 | 1907 | return 1; |
| r3957 | r3958 | |
| 1901 | 1940 | /* S L E U N Z V C */ |
| 1902 | 1941 | /* * * * * * * * - */ |
| 1903 | 1942 | /* TODO: S, L, E, V */ |
| 1904 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1905 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); | |
| 1943 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 1944 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1906 | 1945 | |
| 1907 | 1946 | cycles += 2; /* TODO: +mv oscillator cycles */ |
| 1908 | 1947 | return 1; |
| r3957 | r3958 | |
| 1967 | 2006 | /* S L E U N Z V C */ |
| 1968 | 2007 | /* * * * * * * * - */ |
| 1969 | 2008 | /* TODO: S, L, E, V */ |
| 1970 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 1971 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); | |
| 2009 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 2010 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 1972 | 2011 | |
| 1973 | 2012 | cycles += 2; /* TODO: +mv oscillator cycles */ |
| 1974 | 2013 | return 1; |
| r3957 | r3958 | |
| 2015 | 2054 | |
| 2016 | 2055 | /* Round the result */ |
| 2017 | 2056 | /* WARNING : ROUNDING NOT FULLY IMPLEMENTED YET! */ |
| 2057 | if ((opD & U64(0x000000000000ffff)) >= 0x8000) | |
| 2058 | opD += U64(0x0000000000010000); | |
| 2059 | ||
| 2018 | 2060 | opD &= U64(0x000000ffffff0000); |
| 2019 | 2061 | |
| 2020 | 2062 | /* And out the bits that don't live in the register */ |
| r3957 | r3958 | |
| 2030 | 2072 | /* S L E U N Z V C */ |
| 2031 | 2073 | /* * * * * * * * - */ |
| 2032 | 2074 | /* TODO: S, L, E, V */ |
| 2033 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 2034 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); | |
| 2075 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 2076 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2035 | 2077 | |
| 2036 | 2078 | cycles += 2; /* TODO: +mv oscillator cycles */ |
| 2037 | 2079 | return 1; |
| r3957 | r3958 | |
| 2101 | 2143 | not the same. */ |
| 2102 | 2144 | /* C - Set if bit 36 of source operand is set. Cleared otherwise. */ |
| 2103 | 2145 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); |
| 2104 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2146 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2105 | 2147 | if ( (*((UINT64*)D.addr) & U64(0x000000ff00000000)) != (p_accum & U64(0x000000ff00000000)) ) V_bit_set(cpustate, 1); else V_bit_set(cpustate, 0); |
| 2106 | if (p_accum & U64(0x0000001000000000)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 2148 | if (p_accum & U64(0x0000001000000000)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 2107 | 2149 | |
| 2108 | 2150 | cycles += 2; |
| 2109 | 2151 | return 1; |
| r3957 | r3958 | |
| 2132 | 2174 | /* TODO: E, U */ |
| 2133 | 2175 | /* C - Set if bit 3 of source operand is set. Cleared otherwise. */ |
| 2134 | 2176 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); |
| 2135 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2177 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2136 | 2178 | V_bit_set(cpustate, 0); |
| 2137 | if (p_accum & U64(0x0000000000000008)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 2179 | if (p_accum & U64(0x0000000000000008)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 2138 | 2180 | |
| 2139 | 2181 | cycles += 2; |
| 2140 | 2182 | return 1; |
| r3957 | r3958 | |
| 2161 | 2203 | /* - * * * * * 0 ? */ |
| 2162 | 2204 | /* TODO: E, U */ |
| 2163 | 2205 | if (*((UINT64*)D.addr) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); |
| 2164 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2206 | if (*((UINT64*)D.addr) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2165 | 2207 | V_bit_set(cpustate, 0); |
| 2166 | if (backupVal & U64(0x0000000000008000)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 2208 | if (backupVal & U64(0x0000000000008000)) C_bit_set(cpustate, 1); else C_bit_set(cpustate, 0); | |
| 2167 | 2209 | |
| 2168 | 2210 | cycles += 2; |
| 2169 | 2211 | return 1; |
| r3957 | r3958 | |
| 2184 | 2226 | UINT16 iVal = op2 & 0x00ff; |
| 2185 | 2227 | decode_BBB_bitmask(cpustate, BITS(op2,0xe000), &iVal); |
| 2186 | 2228 | |
| 2187 | workAddr = assemble_address_from_Pppppp_table(cpustate, BITS( | |
| 2229 | workAddr = assemble_address_from_Pppppp_table(cpustate, BITS(op,0x0020), BITS(op,0x001f)); | |
| 2188 | 2230 | previousValue = memory_read_word_16le(cpustate->data, WORD(workAddr)); |
| 2189 | 2231 | workingWord = previousValue; |
| 2190 | 2232 | |
| r3957 | r3958 | |
| 2596 | 2638 | /* WARNING : DOCS SAY THERE IS A PARALLEL MOVE HERE !!! */ |
| 2597 | 2639 | static size_t dsp56k_op_div(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) |
| 2598 | 2640 | { |
| 2641 | /* WARNING : THIS DOES NOT WORK. IT DOESN'T EVEN TRY !!! */ | |
| 2642 | typed_pointer S = {NULL, DT_BYTE}; | |
| 2643 | typed_pointer D = {NULL, DT_BYTE}; | |
| 2644 | ||
| 2645 | decode_DDF_table(cpustate, BITS(op,0x0003), BITS(op,0x0008), &S, &D); | |
| 2646 | ||
| 2599 | 2647 | /* S L E U N Z V C */ |
| 2600 | 2648 | /* - * - - - - ? ? */ |
| 2601 | 2649 | /* V - Set if an arithmetic overflow occurs in the 40 bit result. Also set if the most significantst |
| 2602 | 2650 | bit of the destination operand is changed as a result of the left shift. Cleared otherwise. */ |
| 2603 | 2651 | /* C - Set if bit 39 of the result is cleared. Cleared otherwise. */ |
| 2604 | return 0; | |
| 2652 | cycles += 2; | |
| 2653 | return 1; | |
| 2605 | 2654 | } |
| 2606 | 2655 | |
| 2607 | 2656 | /* DMAC : 0001 0101 10s1 FsQQ : A-80 */ |
| 2608 | 2657 | static size_t dsp56k_op_dmac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) |
| 2609 | 2658 | { |
| 2659 | UINT8 ss = 0; | |
| 2660 | INT64 result = 0; | |
| 2661 | ||
| 2662 | void* D = NULL; | |
| 2663 | void* S1 = NULL; | |
| 2664 | void* S2 = NULL; | |
| 2665 | ||
| 2666 | decode_QQF_special_table(cpustate, BITS(op,0x0003), BITS(op,0x0008), &S1, &S2, &D); | |
| 2667 | ||
| 2668 | ss = BITS(op,0x0024); | |
| 2669 | ||
| 2670 | /* Fixed-point 2's complement multiplication requires a shift */ | |
| 2671 | if (ss == 0x00 || ss == 0x01) | |
| 2672 | { | |
| 2673 | /* Signed * Signed */ | |
| 2674 | INT32 s1 = ((INT32)(*((UINT16*)S1))); | |
| 2675 | INT32 s2 = ((INT32)(*((UINT16*)S2))); | |
| 2676 | result = ( s1 * s2 ) << 1; | |
| 2677 | } | |
| 2678 | else if (ss == 0x2) | |
| 2679 | { | |
| 2680 | /* Signed * Unsigned */ | |
| 2681 | /* WARNING : THERE IS A HUGE CHANCE THIS DOESN'T WORK RIGHT */ | |
| 2682 | INT32 s1 = ((INT32)(*((UINT16*)S1))); | |
| 2683 | INT32 s2 = (UINT32)(*((UINT16*)S2)); | |
| 2684 | result = ( s1 * s2 ) << 1; | |
| 2685 | } | |
| 2686 | else if (ss == 0x3) | |
| 2687 | { | |
| 2688 | /* Unsigned * Unsigned */ | |
| 2689 | UINT32 s1 = (UINT32)(*((UINT16*)S1)); | |
| 2690 | UINT32 s2 = (UINT32)(*((UINT16*)S2)); | |
| 2691 | result = ( s1 * s2 ) << 1; | |
| 2692 | } | |
| 2693 | ||
| 2694 | /* Shift right, then accumulate */ | |
| 2695 | (*((UINT64*)D)) = (*((UINT64*)D)) >> 16; | |
| 2696 | (*((UINT64*)D)) += result; | |
| 2697 | ||
| 2610 | 2698 | /* S L E U N Z V C */ |
| 2611 | 2699 | /* - * * * * * * - */ |
| 2612 | return 0; | |
| 2700 | /* TODO: L, E, U, V */ | |
| 2701 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 2702 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2703 | ||
| 2704 | cycles += 2; | |
| 2705 | return 1; | |
| 2613 | 2706 | } |
| 2614 | 2707 | |
| 2615 | 2708 | /* DO : 0000 0000 110- --RR xxxx xxxx xxxx xxxx : A-82 */ |
| r3957 | r3958 | |
| 2623 | 2716 | /* DO : 0000 1110 iiii iiii xxxx xxxx xxxx xxxx : A-82 */ |
| 2624 | 2717 | static size_t dsp56k_op_do_1(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) |
| 2625 | 2718 | { |
| 2719 | UINT8 retSize = 0; | |
| 2626 | 2720 | UINT8 iValue = BITS(op,0x00ff); |
| 2627 | 2721 | |
| 2628 | 2722 | /* Don't execute if the loop counter == 0 */ |
| r3957 | r3958 | |
| 2645 | 2739 | /* Third instruction cycle */ |
| 2646 | 2740 | LF_bit_set(cpustate, 1); |
| 2647 | 2741 | |
| 2742 | /* Undocumented, but it must be true to nest Dos in DoForevers */ | |
| 2743 | FV_bit_set(cpustate, 0); | |
| 2648 | 2744 | |
| 2745 | ||
| 2649 | 2746 | /* S L E U N Z V C */ |
| 2650 | 2747 | /* - * - - - - - - */ |
| 2651 | 2748 | /* TODO : L */ |
| 2652 | 2749 | |
| 2653 | 2750 | cycles += 6; /* TODO: + mv oscillator cycles */ |
| 2751 | retSize = 2; | |
| 2654 | 2752 | } |
| 2655 | 2753 | else |
| 2656 | 2754 | { |
| 2755 | /* Skip over the contents of the loop */ | |
| 2756 | cpustate->ppc = PC; | |
| 2757 | PC = PC + 2 + op2; | |
| 2758 | ||
| 2657 | 2759 | cycles += 10; /* TODO: + mv oscillator cycles */ |
| 2760 | retSize = 0; | |
| 2658 | 2761 | } |
| 2659 | 2762 | |
| 2660 | return | |
| 2763 | return retSize; | |
| 2661 | 2764 | } |
| 2662 | 2765 | |
| 2663 | 2766 | /* DO : 0000 0100 000D DDDD xxxx xxxx xxxx xxxx : A-82 */ |
| 2664 | 2767 | static size_t dsp56k_op_do_2(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) |
| 2665 | 2768 | { |
| 2769 | UINT8 retSize = 0; | |
| 2666 | 2770 | UINT16 lValue = 0x0000; |
| 2667 | 2771 | typed_pointer S = {NULL, DT_BYTE}; |
| 2668 | 2772 | decode_DDDDD_table(cpustate, BITS(op,0x001f), &S); |
| r3957 | r3958 | |
| 2704 | 2808 | /* TODO : L */ |
| 2705 | 2809 | |
| 2706 | 2810 | cycles += 6; /* TODO: + mv oscillator cycles */ |
| 2811 | retSize = 2; | |
| 2707 | 2812 | } |
| 2708 | 2813 | else |
| 2709 | 2814 | { |
| 2815 | /* Skip over the contents of the loop */ | |
| 2816 | cpustate->ppc = PC; | |
| 2817 | PC = PC + 2 + op2; | |
| 2818 | ||
| 2710 | 2819 | cycles += 10; /* TODO: + mv oscillator cycles */ |
| 2820 | retSize = 0; | |
| 2711 | 2821 | } |
| 2712 | 2822 | |
| 2713 | return | |
| 2823 | return retSize; | |
| 2714 | 2824 | } |
| 2715 | 2825 | |
| 2716 | 2826 | /* DO FOREVER : 0000 0000 0000 0010 xxxx xxxx xxxx xxxx : A-88 */ |
| r3957 | r3958 | |
| 2977 | 3087 | else |
| 2978 | 3088 | { |
| 2979 | 3089 | /* Signed * Unsigned */ |
| 2980 | /* TODO: THERE IS A HUGE CHANCE THIS DOESN'T WORK RIGHT */ | |
| 2981 | UINT32 s1 = (UINT32)((INT32)(*((UINT16*)S1))); | |
| 2982 | UINT32 s2 = (UINT32)(*((UINT16*)S2)); | |
| 3090 | /* WARNING : THERE IS A HUGE CHANCE THIS DOESN'T WORK RIGHT */ | |
| 3091 | INT32 s1 = ((INT32)(*((UINT16*)S1))); | |
| 3092 | INT32 s2 = (UINT32)(*((UINT16*)S2)); | |
| 2983 | 3093 | result = ( s1 * s2 ) << 1; |
| 2984 | 3094 | } |
| 2985 | 3095 | |
| 2986 | 3096 | (*((UINT64*)D)) += result; |
| 2987 | 3097 | |
| 3098 | /* And out the bits that don't live in the register */ | |
| 3099 | (*((UINT64*)D)) &= U64(0x000000ffffffffff); | |
| 3100 | ||
| 2988 | 3101 | /* S L E U N Z V C */ |
| 2989 | 3102 | /* - * * * * * * - */ |
| 2990 | 3103 | /* TODO: L, E, U, V */ |
| 2991 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); | |
| 2992 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); | |
| 3104 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 3105 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 2993 | 3106 | |
| 2994 | 3107 | cycles += 2; |
| 2995 | 3108 | return 1; |
| r3957 | r3958 | |
| 3383 | 3496 | pp = op & 0x001f; |
| 3384 | 3497 | pp = assemble_address_from_IO_short_address(cpustate, pp); |
| 3385 | 3498 | |
| 3386 | W = BITS( | |
| 3499 | W = BITS(op,0x0100); | |
| 3387 | 3500 | |
| 3388 | 3501 | /* A little different than most W if's - opposite read and write */ |
| 3389 | 3502 | if (W) |
| r3957 | r3958 | |
| 3403 | 3516 | } |
| 3404 | 3517 | |
| 3405 | 3518 | // Postincrement |
| 3406 | execute_m_table(cpustate, BITS( | |
| 3519 | execute_m_table(cpustate, BITS(op,0x00c0), BITS(op,0x0020)); | |
| 3407 | 3520 | |
| 3408 | 3521 | /* S L E U N Z V C */ |
| 3409 | 3522 | /* * * - - - - - - */ |
| r3957 | r3958 | |
| 3423 | 3536 | /* MPY(su,uu) : 0001 0101 1100 FsQQ : A-164 */ |
| 3424 | 3537 | static size_t dsp56k_op_mpysuuu(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) |
| 3425 | 3538 | { |
| 3539 | UINT8 s = 0; | |
| 3540 | INT64 result = 0; | |
| 3541 | ||
| 3542 | void* D = NULL; | |
| 3543 | void* S1 = NULL; | |
| 3544 | void* S2 = NULL; | |
| 3545 | ||
| 3546 | decode_QQF_special_table(cpustate, BITS(op,0x0003), BITS(op,0x0008), &S1, &S2, &D); | |
| 3547 | ||
| 3548 | s = BITS(op,0x0004); | |
| 3549 | ||
| 3550 | /* Fixed-point 2's complement multiplication requires a shift */ | |
| 3551 | if (s) | |
| 3552 | { | |
| 3553 | /* Unsigned * Unsigned */ | |
| 3554 | UINT32 s1 = (UINT32)(*((UINT16*)S1)); | |
| 3555 | UINT32 s2 = (UINT32)(*((UINT16*)S2)); | |
| 3556 | result = ( s1 * s2 ) << 1; | |
| 3557 | } | |
| 3558 | else | |
| 3559 | { | |
| 3560 | /* Signed * Unsigned */ | |
| 3561 | /* WARNING : THERE IS A HUGE CHANCE THIS DOESN'T WORK RIGHT */ | |
| 3562 | INT32 s1 = ((INT32)(*((UINT16*)S1))); | |
| 3563 | INT32 s2 = (UINT32)(*((UINT16*)S2)); | |
| 3564 | result = ( s1 * s2 ) << 1; | |
| 3565 | } | |
| 3566 | ||
| 3567 | (*((UINT64*)D)) = result; | |
| 3568 | ||
| 3569 | /* And out the bits that don't live in the register */ | |
| 3570 | (*((UINT64*)D)) &= U64(0x000000ffffffffff); | |
| 3571 | ||
| 3426 | 3572 | /* S L E U N Z V C */ |
| 3427 | 3573 | /* - * * * * * * - */ |
| 3428 | return 0; | |
| 3574 | /* TODO: L, E, U, V */ | |
| 3575 | if ( *((UINT64*)D) & U64(0x0000008000000000)) N_bit_set(cpustate, 1); else N_bit_set(cpustate, 0); | |
| 3576 | if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) Z_bit_set(cpustate, 1); else Z_bit_set(cpustate, 0); | |
| 3577 | ||
| 3578 | cycles += 2; | |
| 3579 | return 1; | |
| 3429 | 3580 | } |
| 3430 | 3581 | |
| 3431 | 3582 | /* NEGC : 0001 0101 0110 F000 : A-168 */ |
| r3957 | r3958 | |
| 3554 | 3705 | /* RTI : 0000 0000 0000 0111 : A-194 */ |
| 3555 | 3706 | static size_t dsp56k_op_rti(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) |
| 3556 | 3707 | { |
| 3708 | /* WARNING : THERE SHOULD BE A MORE GENERAL HANDLING OF STACK ERRORS. */ | |
| 3709 | if (SP == 0) | |
| 3710 | { | |
| 3711 | dsp56k_add_pending_interrupt(cpustate, "Stack Error"); | |
| 3712 | return 0; | |
| 3713 | } | |
| 3714 | ||
| 3557 | 3715 | cpustate->ppc = PC; |
| 3558 | 3716 | PC = SSH; |
| 3559 | 3717 | |
| r3957 | r3958 | |
| 3786 | 3944 | } |
| 3787 | 3945 | } |
| 3788 | 3946 | |
| 3947 | static void decode_DDF_table(dsp56k_core* cpustate, UINT16 DD, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret) | |
| 3948 | { | |
| 3949 | UINT16 switchVal = (DD << 1) | F; | |
| 3950 | ||
| 3951 | switch (switchVal) | |
| 3952 | { | |
| 3953 | case 0x0: src_ret->addr = &X0; src_ret->data_type = DT_WORD; dst_ret->addr = &A; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3954 | case 0x1: src_ret->addr = &X0; src_ret->data_type = DT_WORD; dst_ret->addr = &B; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3955 | case 0x2: src_ret->addr = &Y0; src_ret->data_type = DT_WORD; dst_ret->addr = &A; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3956 | case 0x3: src_ret->addr = &Y0; src_ret->data_type = DT_WORD; dst_ret->addr = &B; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3957 | case 0x4: src_ret->addr = &X1; src_ret->data_type = DT_WORD; dst_ret->addr = &A; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3958 | case 0x5: src_ret->addr = &X1; src_ret->data_type = DT_WORD; dst_ret->addr = &B; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3959 | case 0x6: src_ret->addr = &Y1; src_ret->data_type = DT_WORD; dst_ret->addr = &A; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3960 | case 0x7: src_ret->addr = &Y1; src_ret->data_type = DT_WORD; dst_ret->addr = &B; dst_ret->data_type = DT_LONG_WORD; break; | |
| 3961 | } | |
| 3962 | } | |
| 3963 | ||
| 3789 | 3964 | static void decode_F_table(dsp56k_core* cpustate, UINT16 F, typed_pointer* ret) |
| 3790 | 3965 | { |
| 3791 | 3966 | switch(F) |
| r3957 | r3958 | |
| 4250 | 4425 | if (LC == 1) |
| 4251 | 4426 | { |
| 4252 | 4427 | /* End of loop processing */ |
| 4253 | SR = SSL; /* TODO: A-83. I believe only the Loop Flag comes back here. */ | |
| 4428 | SR = SSL; /* TODO: A-83. I believe only the Loop Flag comes back here. And maybe the do forever bit too. */ | |
| 4254 | 4429 | SP--; |
| 4255 | 4430 | |
| 4256 | 4431 | LA = SSH; |
| r3957 | r3958 | |
| 4531 | 4706 | { |
| 4532 | 4707 | case DT_BYTE: *((UINT64*)dest.addr) = (*((UINT8*)source.addr)) & 0xff; break; |
| 4533 | 4708 | |
| 4534 | case DT_WORD: destinationValue = (*((INT16*)source.addr)) << 16; /* Sign extend */ | |
| 4535 | destinationValue &= U64(0x000000ffffff0000); | |
| 4536 | *((UINT64*)dest.addr) = destinationValue; break; /* Forget not, yon shift register */ | |
| 4709 | case DT_WORD: destinationValue = (*((UINT16*)source.addr)) << 16; | |
| 4710 | if (destinationValue & U64(0x0000000080000000)) | |
| 4711 | destinationValue |= U64(0x000000ff00000000); | |
| 4712 | *((UINT64*)dest.addr) = (UINT64)destinationValue; break; /* Forget not, yon shift register */ | |
| 4537 | 4713 | |
| 4538 | 4714 | case DT_DOUBLE_WORD: *((UINT64*)dest.addr) = (*((UINT32*)source.addr)) & 0xffffffff; break; |
| 4539 | 4715 | case DT_LONG_WORD: *((UINT64*)dest.addr) = (*((UINT64*)source.addr)) & U64(0x000000ffffffffff); break; |
| r3957 | r3958 | |
|---|---|---|
| 308 | 308 | int parallelType = -1; |
| 309 | 309 | |
| 310 | 310 | /* Note: it's important that NPDM comes before RtRDM here */ |
| 311 | /* No Parallel Data Move : 0100 1010 | |
| 311 | /* No Parallel Data Move : 0100 1010 .... .... : A-131 */ | |
| 312 | 312 | if ((op & 0xff00) == 0x4a00) |
| 313 | 313 | { |
| 314 | 314 | op_byte = op & 0x00ff; |
| 315 | 315 | parallelType = kNoParallelDataMove; |
| 316 | 316 | } |
| 317 | /* Register to Register Data Move : 0100 IIII | |
| 317 | /* Register to Register Data Move : 0100 IIII .... .... : A-133 */ | |
| 318 | 318 | else if ((op & 0xf000) == 0x4000) |
| 319 | 319 | { |
| 320 | 320 | op_byte = op & 0x00ff; |
| 321 | 321 | parallelType = kRegisterToRegister; |
| 322 | 322 | } |
| 323 | /* Address Register Update : 0011 0zRR | |
| 323 | /* Address Register Update : 0011 0zRR .... .... : A-135 */ | |
| 324 | 324 | else if ((op & 0xf800) == 0x3000) |
| 325 | 325 | { |
| 326 | 326 | op_byte = op & 0x00ff; |
| 327 | 327 | parallelType = kAddressRegister; |
| 328 | 328 | } |
| 329 | /* X Memory Data Move : 1mRR HHHW | |
| 329 | /* X Memory Data Move : 1mRR HHHW .... .... : A-137 */ | |
| 330 | 330 | else if ((op & 0x8000) == 0x8000) |
| 331 | 331 | { |
| 332 | 332 | op_byte = op & 0x00ff; |
| 333 | 333 | parallelType = kXMemoryDataMove; |
| 334 | 334 | } |
| 335 | /* X Memory Data Move : 0101 HHHW | |
| 335 | /* X Memory Data Move : 0101 HHHW .... .... : A-137 */ | |
| 336 | 336 | else if ((op & 0xf000) == 0x5000) |
| 337 | 337 | { |
| 338 | 338 | op_byte = op & 0x00ff; |
| 339 | 339 | parallelType = kXMemoryDataMove2; |
| 340 | 340 | } |
| 341 | /* X Memory Data Move with short displacement : 0000 0101 BBBB BBBB ---- HHHW | |
| 341 | /* X Memory Data Move with short displacement : 0000 0101 BBBB BBBB ---- HHHW .... .... : A-139 */ | |
| 342 | 342 | else if ((op & 0xff00) == 0x0500) |
| 343 | 343 | { |
| 344 | 344 | /* Now check it against all the other potential collisions */ |
| r3957 | r3958 | |
|---|---|---|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | static void pcu_init(dsp56k_core* cpustate | |
| 116 | static void pcu_init(dsp56k_core* cpustate | |
| 117 | 117 | { |
| 118 | 118 | // Init the irq table |
| 119 | 119 | dsp56k_irq_table_init(); |
| r3957 | r3958 | |
| 142 | 142 | // This, in actuality, is handled with the internal boot ROM. |
| 143 | 143 | for (i = 0; i < 0x800; i++) |
| 144 | 144 | { |
| 145 | UINT32 mem_offset = (0xc000 | |
| 145 | UINT32 mem_offset = (0xc000 | |
| 146 | 146 | |
| 147 | 147 | // TODO - DO I HAVE TO FLIP THIS WORD? |
| 148 | 148 | // P:$c000 -> Internal P:$0000 low byte |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | ***************************************************************************/ |
| 40 | 40 | static CPU_RESET( dsp56k ); |
| 41 | 41 | |
| 42 | ||
| 42 | 43 | /*************************************************************************** |
| 43 | 44 | ONBOARD MEMORY ALLOCATION |
| 44 | 45 | ***************************************************************************/ |
| 46 | // TODO: Put these in the cpustate!!! | |
| 45 | 47 | static UINT16 *dsp56k_peripheral_ram; |
| 46 | 48 | static UINT16 *dsp56k_program_ram; |
| 47 | 49 | |
| 50 | ||
| 48 | 51 | /*************************************************************************** |
| 49 | 52 | COMPONENT FUNCTIONALITY |
| 50 | 53 | ***************************************************************************/ |
| r3957 | r3958 | |
| 63 | 66 | // 4-8 Memory handlers for on-chip peripheral memory. |
| 64 | 67 | #include "dsp56mem.c" |
| 65 | 68 | |
| 69 | ||
| 66 | 70 | /*************************************************************************** |
| 71 | Direct Update Handler | |
| 72 | ***************************************************************************/ | |
| 73 | static DIRECT_UPDATE_HANDLER( dsp56k_direct_handler ) | |
| 74 | { | |
| 75 | if (address >= (0x0000<<1) && address <= (0x07ff<<1)) | |
| 76 | { | |
| 77 | direct->raw = direct->decrypted = (void*)(dsp56k_program_ram - (0x0000<<1)); | |
| 78 | return ~0; | |
| 79 | } | |
| 80 | ||
| 81 | return address; | |
| 82 | } | |
| 83 | ||
| 84 | ||
| 85 | /*************************************************************************** | |
| 67 | 86 | MEMORY ACCESSORS |
| 68 | 87 | ***************************************************************************/ |
| 69 | 88 | #define ROPCODE(pc) memory_decrypted_read_word(cpustate->program, pc) |
| r3957 | r3958 | |
| 150 | 169 | dsp56k_core* cpustate = device->token; |
| 151 | 170 | |
| 152 | 171 | // Call specific module inits |
| 153 | pcu_init(cpustate, index); | |
| 154 | // agu_init(cpustate, index); | |
| 155 | // alu_init(cpustate, index); | |
| 172 | pcu_init(cpustate); | |
| 173 | // agu_init(cpustate); | |
| 174 | // alu_init(cpustate); | |
| 156 | 175 | |
| 157 | 176 | // HACK - You're not in bootstrap mode upon bootup |
| 158 | 177 | cpustate->bootstrap_mode = BOOTSTRAP_OFF; |
| r3957 | r3958 | |
| 172 | 191 | cpustate->device = device; |
| 173 | 192 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 174 | 193 | cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA); |
| 194 | ||
| 195 | /* Setup the direct memory handler for this CPU */ | |
| 196 | /* NOTE: Be sure to grab this guy and call him if you ever install another direct_update_hander in a driver! */ | |
| 197 | memory_set_direct_update_handler(cpustate->program, dsp56k_direct_handler); | |
| 175 | 198 | } |
| 176 | 199 | |
| 177 | 200 | static void agu_reset(dsp56k_core* cpustate) |
| r3957 | r3958 | |
| 219 | 242 | agu_reset(cpustate); |
| 220 | 243 | alu_reset(cpustate); |
| 221 | 244 | |
| 222 | /* HACK - Put a jump to 0x0000 at 0x0000 - this keeps the CPU | |
| 245 | /* HACK - Put a jump to 0x0000 at 0x0000 - this keeps the CPU locked to the instruction at address 0x0000 */ | |
| 223 | 246 | memory_write_word_16le(cpustate->program, 0x0000, 0x0124); |
| 224 | 247 | } |
| 225 | 248 | |
| r3957 | r3958 | |
| 381 | 404 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; // ? |
| 382 | 405 | case CPUINFO_INT_MAX_CYCLES: info->i = 8; break; // ? |
| 383 | 406 | |
| 384 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; // 1-5 | |
| 385 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; // 1-5 | |
| 386 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; | |
| 387 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 388 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 389 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -1; break; | |
| 390 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 391 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 392 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 407 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; // 1-5 | |
| 408 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; // 1-5 | |
| 409 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 410 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 16; break; | |
| 411 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 16; break; | |
| 412 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -1; break; | |
| 413 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 414 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 415 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 393 | 416 | |
| 394 | 417 | case CPUINFO_INT_INPUT_STATE + DSP56K_IRQ_MODA: info->i = DSP56K_IRQ_MODA; break; |
| 395 | 418 | case CPUINFO_INT_INPUT_STATE + DSP56K_IRQ_MODB: info->i = DSP56K_IRQ_MODB; break; |
| r3957 | r3958 | |
| 451 | 474 | case CPUINFO_INT_REGISTER + DSP56K_ST15: info->i = ST15; break; |
| 452 | 475 | |
| 453 | 476 | // --- the following bits of info are returned as pointers to data or functions --- |
| 454 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(dsp56k); break; | |
| 455 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(dsp56k); break; | |
| 456 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(dsp56k); break; | |
| 457 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(dsp56k); break; | |
| 458 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(dsp56k); break; | |
| 459 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 460 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(dsp56k); break; | |
| 461 | case CPUINFO_PTR_DEBUG_INIT: info->debug_init = NULL; break; | |
| 462 | case CPUINFO_PTR_TRANSLATE: info->translate = NULL; break; | |
| 463 | case CPUINFO_PTR_READ: info->read = NULL; break; | |
| 464 | case CPUINFO_PTR_WRITE: info->write = NULL; break; | |
| 465 | case CPUINFO_PTR_READOP: info->readop = NULL; break; | |
| 477 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(dsp56k); break; | |
| 478 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(dsp56k); break; | |
| 479 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(dsp56k); break; | |
| 480 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(dsp56k); break; | |
| 481 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(dsp56k); break; | |
| 482 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 483 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(dsp56k); break; | |
| 484 | case CPUINFO_FCT_DEBUG_INIT: info->debug_init = NULL; break; | |
| 485 | case CPUINFO_FCT_TRANSLATE: info->translate = NULL; break; | |
| 486 | case CPUINFO_FCT_READ: info->read = NULL; break; | |
| 487 | case CPUINFO_FCT_WRITE: info->write = NULL; break; | |
| 488 | case CPUINFO_FCT_READOP: info->readop = NULL; break; | |
| 466 | 489 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 467 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 490 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 468 | 491 | info->internal_map16 = ADDRESS_MAP_NAME(dsp56156_x_data_map); break; |
| 469 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 492 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 470 | 493 | info->internal_map16 = ADDRESS_MAP_NAME(dsp56156_program_map); break; |
| 471 | 494 | |
| 472 | 495 | // --- the following bits of info are returned as NULL-terminated strings --- |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | #ifndef __SPC700_H__ |
| 4 | 4 | #define __SPC700_H__ |
| 5 | 5 | |
| 6 | #include "cpuintrf.h" | |
| 7 | ||
| 8 | extern CPU_GET_INFO( spc700 ); | |
| 9 | #define CPU_SPC700 CPU_GET_INFO_NAME( spc700 ) | |
| 10 | ||
| 6 | 11 | /* ======================================================================== */ |
| 7 | 12 | /* ============================= Configuration ============================ */ |
| 8 | 13 | /* ======================================================================== */ |
| r3957 | r3958 | |
| 31 | 36 | #define SPC700_INT_IRQ 1 |
| 32 | 37 | #define SPC700_INT_NMI 2 |
| 33 | 38 | |
| 34 | /* CPU Structure */ | |
| 35 | typedef struct | |
| 36 | { | |
| 37 | uint a; /* Accumulator */ | |
| 38 | uint x; /* Index Register X */ | |
| 39 | uint y; /* Index Register Y */ | |
| 40 | uint s; /* Stack Pointer */ | |
| 41 | uint pc; /* Program Counter */ | |
| 42 | uint ppc; /* Previous Program Counter */ | |
| 43 | uint flag_n; /* Negative Flag */ | |
| 44 | uint flag_z; /* Zero flag */ | |
| 45 | uint flag_v; /* Overflow Flag */ | |
| 46 | uint flag_p; /* Direct Page Flag */ | |
| 47 | uint flag_b; /* BRK Instruction Flag */ | |
| 48 | uint flag_h; /* Half-carry Flag */ | |
| 49 | uint flag_i; /* Interrupt Mask Flag */ | |
| 50 | uint flag_c; /* Carry Flag */ | |
| 51 | uint line_irq; /* Status of the IRQ line */ | |
| 52 | uint line_nmi; /* Status of the NMI line */ | |
| 53 | uint line_rst; /* Status of the RESET line */ | |
| 54 | uint ir; /* Instruction Register */ | |
| 55 | cpu_irq_callback int_ack; | |
| 56 | const device_config *device; | |
| 57 | const address_space *program; | |
| 58 | uint stopped; /* stopped status */ | |
| 59 | int ICount; | |
| 60 | uint source; | |
| 61 | uint destination; | |
| 62 | uint temp1, temp2, temp3; | |
| 63 | short spc_int16; | |
| 64 | int spc_int32; | |
| 65 | } spc700i_cpu; | |
| 66 | 39 | |
| 67 | ||
| 68 | 40 | /* ======================================================================== */ |
| 69 | /* ============================= INTERFACE API ============================ */ | |
| 70 | /* ======================================================================== */ | |
| 71 | ||
| 72 | /* This is the interface, not the implementation. Please call the */ | |
| 73 | /* implementation APIs below. */ | |
| 74 | ||
| 75 | ||
| 76 | CPU_INIT( spc700 ); | |
| 77 | ||
| 78 | /* Pulse the RESET pin on the CPU */ | |
| 79 | CPU_RESET( spc700 ); | |
| 80 | ||
| 81 | /* Set the RESET line on the CPU */ | |
| 82 | void spc700_set_reset_line(spc700i_cpu *cpustate, int state, void* param); | |
| 83 | ||
| 84 | /* Clean up after the emulation core - Not used in this core - */ | |
| 85 | CPU_EXIT( spc700 ); | |
| 86 | ||
| 87 | /* Get the current Program Counter */ | |
| 88 | unsigned spc700_get_pc(spc700i_cpu *cpustate); | |
| 89 | ||
| 90 | /* Set the current Program Counter */ | |
| 91 | void spc700_set_pc(spc700i_cpu *cpustate,unsigned val); | |
| 92 | ||
| 93 | /* Get the current Stack Pointer */ | |
| 94 | unsigned spc700_get_sp(spc700i_cpu *cpustate); | |
| 95 | ||
| 96 | /* Set the current Stack Pointer */ | |
| 97 | void spc700_set_sp(spc700i_cpu *cpustate,unsigned val); | |
| 98 | ||
| 99 | /* Get a register from the core */ | |
| 100 | unsigned spc700_get_reg(spc700i_cpu *cpustate,int regnum); | |
| 101 | ||
| 102 | /* Set a register in the core */ | |
| 103 | void spc700_set_reg(spc700i_cpu *cpustate,int regnum, unsigned val); | |
| 104 | ||
| 105 | /* Note about NMI: | |
| 106 | * NMI is a one-shot trigger. In order to trigger NMI again, you must | |
| 107 | * clear NMI and then assert it again. | |
| 108 | */ | |
| 109 | void spc700_set_nmi_line(spc700i_cpu *cpustate,int state); | |
| 110 | ||
| 111 | /* Assert or clear the IRQ pin */ | |
| 112 | void spc700_set_irq_line(spc700i_cpu *cpustate,int line, int state); | |
| 113 | ||
| 114 | /* Set the callback that will be called when an interrupt is serviced */ | |
| 115 | void spc700_set_irq_callback(spc700i_cpu *cpustate,cpu_irq_callback callback); | |
| 116 | ||
| 117 | /* Get a formatted string representing a register and its contents */ | |
| 118 | const char *spc700_info(spc700i_cpu *cpustate,void *context, int regnum); | |
| 119 | ||
| 120 | ||
| 121 | /* Pulse the SO (Set Overflow) pin on the CPU */ | |
| 122 | void spc700_pulse_so(spc700i_cpu *cpustate); | |
| 123 | ||
| 124 | ||
| 125 | /* ======================================================================== */ | |
| 126 | /* =================== Functions Implemented by the Host ================== */ | |
| 127 | /* ======================================================================== */ | |
| 128 | ||
| 129 | /* Read data from RAM */ | |
| 130 | unsigned int spc700_read_8(unsigned int address); | |
| 131 | ||
| 132 | /* Read data from the direct page */ | |
| 133 | unsigned int spc700_read_8_direct(unsigned int address); | |
| 134 | ||
| 135 | /* Read data from ROM */ | |
| 136 | unsigned int spc700_read_8_immediate(unsigned int address); | |
| 137 | unsigned int spc700_read_8_instruction(unsigned int address); | |
| 138 | ||
| 139 | /* Write data to RAM */ | |
| 140 | void spc700_write_8(unsigned int address, unsigned int value); | |
| 141 | void spc700_write_8_direct(unsigned int address, unsigned int value); | |
| 142 | ||
| 143 | void spc700_jumping(unsigned int new_pc); | |
| 144 | void spc700_branching(unsigned int new_pc); | |
| 145 | ||
| 146 | ||
| 147 | ||
| 148 | /* ======================================================================== */ | |
| 149 | /* ================================= MAME ================================= */ | |
| 150 | /* ======================================================================== */ | |
| 151 | ||
| 152 | #include "cpuintrf.h" | |
| 153 | ||
| 154 | extern CPU_GET_INFO( spc700 ); | |
| 155 | ||
| 156 | #define spc700_read_8(addr) memory_read_byte_8le(cpustate->program,addr) | |
| 157 | #define spc700_write_8(addr,data) memory_write_byte_8le(cpustate->program,addr,data) | |
| 158 | ||
| 159 | #define spc700_read_8_direct(A) spc700_read_8(A) | |
| 160 | #define spc700_write_8_direct(A, V) spc700_write_8(A, V) | |
| 161 | //#define spc700_read_instruction(A) memory_decrypted_read_byte(cpustate->program,A) | |
| 162 | //#define spc700_read_8_immediate(A) memory_raw_read_byte(cpustate->program,A) | |
| 163 | #define spc700_read_instruction(A) memory_read_byte_8le(cpustate->program,A) | |
| 164 | #define spc700_read_8_immediate(A) memory_read_byte_8le(cpustate->program,A) | |
| 165 | #define spc700_jumping(A) | |
| 166 | #define spc700_branching(A) | |
| 167 | ||
| 168 | ||
| 169 | ||
| 170 | /* ======================================================================== */ | |
| 171 | 41 | /* ============================== END OF FILE ============================= */ |
| 172 | 42 | /* ======================================================================== */ |
| 173 | 43 |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | #include "debugger.h" |
| 65 | 65 | #include "spc700.h" |
| 66 | 66 | |
| 67 | /* CPU Structure */ | |
| 68 | typedef struct | |
| 69 | { | |
| 70 | uint a; /* Accumulator */ | |
| 71 | uint x; /* Index Register X */ | |
| 72 | uint y; /* Index Register Y */ | |
| 73 | uint s; /* Stack Pointer */ | |
| 74 | uint pc; /* Program Counter */ | |
| 75 | uint ppc; /* Previous Program Counter */ | |
| 76 | uint flag_n; /* Negative Flag */ | |
| 77 | uint flag_z; /* Zero flag */ | |
| 78 | uint flag_v; /* Overflow Flag */ | |
| 79 | uint flag_p; /* Direct Page Flag */ | |
| 80 | uint flag_b; /* BRK Instruction Flag */ | |
| 81 | uint flag_h; /* Half-carry Flag */ | |
| 82 | uint flag_i; /* Interrupt Mask Flag */ | |
| 83 | uint flag_c; /* Carry Flag */ | |
| 84 | uint line_irq; /* Status of the IRQ line */ | |
| 85 | uint line_nmi; /* Status of the NMI line */ | |
| 86 | uint line_rst; /* Status of the RESET line */ | |
| 87 | uint ir; /* Instruction Register */ | |
| 88 | cpu_irq_callback int_ack; | |
| 89 | const device_config *device; | |
| 90 | const address_space *program; | |
| 91 | uint stopped; /* stopped status */ | |
| 92 | int ICount; | |
| 93 | uint source; | |
| 94 | uint destination; | |
| 95 | uint temp1, temp2, temp3; | |
| 96 | short spc_int16; | |
| 97 | int spc_int32; | |
| 98 | } spc700i_cpu; | |
| 99 | ||
| 67 | 100 | /* ======================================================================== */ |
| 68 | 101 | /* ==================== ARCHITECTURE-DEPENDANT DEFINES ==================== */ |
| 69 | 102 | /* ======================================================================== */ |
| r3957 | r3958 | |
| 206 | 239 | #define NZFLAG_16(A) (((A)&0x7f) | (((A)>>1)&0x40) | (((A)>>8)&0xff)) |
| 207 | 240 | #define CFLAG_16(A) ((A)>>8) |
| 208 | 241 | |
| 242 | ||
| 209 | 243 | /* ======================================================================== */ |
| 244 | /* ================================= MAME ================================= */ | |
| 245 | /* ======================================================================== */ | |
| 246 | ||
| 247 | #define spc700_read_8(addr) memory_read_byte_8le(cpustate->program,addr) | |
| 248 | #define spc700_write_8(addr,data) memory_write_byte_8le(cpustate->program,addr,data) | |
| 249 | ||
| 250 | #define spc700_read_8_direct(A) spc700_read_8(A) | |
| 251 | #define spc700_write_8_direct(A, V) spc700_write_8(A, V) | |
| 252 | //#define spc700_read_instruction(A) memory_decrypted_read_byte(cpustate->program,A) | |
| 253 | //#define spc700_read_8_immediate(A) memory_raw_read_byte(cpustate->program,A) | |
| 254 | #define spc700_read_instruction(A) memory_read_byte_8le(cpustate->program,A) | |
| 255 | #define spc700_read_8_immediate(A) memory_read_byte_8le(cpustate->program,A) | |
| 256 | #define spc700_jumping(A) | |
| 257 | #define spc700_branching(A) | |
| 258 | ||
| 259 | ||
| 260 | ||
| 261 | /* ======================================================================== */ | |
| 262 | /* ============================= INTERFACE API ============================ */ | |
| 263 | /* ======================================================================== */ | |
| 264 | ||
| 265 | /* This is the interface, not the implementation. Please call the */ | |
| 266 | /* implementation APIs below. */ | |
| 267 | ||
| 268 | ||
| 269 | CPU_INIT( spc700 ); | |
| 270 | ||
| 271 | /* Pulse the RESET pin on the CPU */ | |
| 272 | CPU_RESET( spc700 ); | |
| 273 | ||
| 274 | /* Set the RESET line on the CPU */ | |
| 275 | void spc700_set_reset_line(spc700i_cpu *cpustate, int state, void* param); | |
| 276 | ||
| 277 | /* Clean up after the emulation core - Not used in this core - */ | |
| 278 | CPU_EXIT( spc700 ); | |
| 279 | ||
| 280 | /* Get the current Program Counter */ | |
| 281 | unsigned spc700_get_pc(spc700i_cpu *cpustate); | |
| 282 | ||
| 283 | /* Set the current Program Counter */ | |
| 284 | void spc700_set_pc(spc700i_cpu *cpustate,unsigned val); | |
| 285 | ||
| 286 | /* Get the current Stack Pointer */ | |
| 287 | unsigned spc700_get_sp(spc700i_cpu *cpustate); | |
| 288 | ||
| 289 | /* Set the current Stack Pointer */ | |
| 290 | void spc700_set_sp(spc700i_cpu *cpustate,unsigned val); | |
| 291 | ||
| 292 | /* Get a register from the core */ | |
| 293 | unsigned spc700_get_reg(spc700i_cpu *cpustate,int regnum); | |
| 294 | ||
| 295 | /* Set a register in the core */ | |
| 296 | void spc700_set_reg(spc700i_cpu *cpustate,int regnum, unsigned val); | |
| 297 | ||
| 298 | /* Note about NMI: | |
| 299 | * NMI is a one-shot trigger. In order to trigger NMI again, you must | |
| 300 | * clear NMI and then assert it again. | |
| 301 | */ | |
| 302 | void spc700_set_nmi_line(spc700i_cpu *cpustate,int state); | |
| 303 | ||
| 304 | /* Assert or clear the IRQ pin */ | |
| 305 | void spc700_set_irq_line(spc700i_cpu *cpustate,int line, int state); | |
| 306 | ||
| 307 | /* Set the callback that will be called when an interrupt is serviced */ | |
| 308 | void spc700_set_irq_callback(spc700i_cpu *cpustate,cpu_irq_callback callback); | |
| 309 | ||
| 310 | /* Get a formatted string representing a register and its contents */ | |
| 311 | const char *spc700_info(spc700i_cpu *cpustate,void *context, int regnum); | |
| 312 | ||
| 313 | ||
| 314 | /* Pulse the SO (Set Overflow) pin on the CPU */ | |
| 315 | void spc700_pulse_so(spc700i_cpu *cpustate); | |
| 316 | ||
| 317 | ||
| 318 | /* ======================================================================== */ | |
| 210 | 319 | /* ============================ UTILITY MACROS ============================ */ |
| 211 | 320 | /* ======================================================================== */ |
| 212 | 321 | |
| r3957 | r3958 | |
| 1599 | 1708 | spc700i_cpu *cpustate = (device != NULL) ? device->token : NULL; |
| 1600 | 1709 | uint p = 0; |
| 1601 | 1710 | |
| 1602 | if ( | |
| 1711 | if ( | |
| 1603 | 1712 | { |
| 1604 | 1713 | p = ((cpustate->flag_n & 0x80) | |
| 1605 | 1714 | ((cpustate->flag_v & 0x80) >> 1) | |
| r3957 | r3958 | |
| 1625 | 1734 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 1626 | 1735 | case CPUINFO_INT_MAX_CYCLES: info->i = 8; break; |
| 1627 | 1736 | |
| 1628 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1629 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1630 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1631 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1632 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1633 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1634 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1635 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1636 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1737 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1738 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1739 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1740 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1741 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1742 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1743 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1744 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1745 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1637 | 1746 | |
| 1638 | 1747 | case CPUINFO_INT_INPUT_STATE + 0: info->i = (LINE_IRQ == IRQ_SET) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1639 | 1748 | |
| r3957 | r3958 | |
| 1649 | 1758 | case CPUINFO_INT_REGISTER + SPC700_Y: info->i = REG_Y; break; |
| 1650 | 1759 | |
| 1651 | 1760 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1652 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(spc700); break; | |
| 1653 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(spc700); break; | |
| 1654 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(spc700); break; | |
| 1655 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(spc700); break; | |
| 1656 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(spc700); break; | |
| 1657 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1658 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(spc700); break; | |
| 1761 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(spc700); break; | |
| 1762 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(spc700); break; | |
| 1763 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(spc700); break; | |
| 1764 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(spc700); break; | |
| 1765 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(spc700); break; | |
| 1766 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1767 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(spc700); break; | |
| 1659 | 1768 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->ICount; break; |
| 1660 | 1769 | |
| 1661 | 1770 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | /* PUBLIC FUNCTIONS */ |
| 21 | 21 | CPU_GET_INFO( hd6309 ); |
| 22 | #define CPU_HD6309 CPU_GET_INFO_NAME( hd6309 ) | |
| 22 | 23 | |
| 23 | 24 | |
| 24 | 25 | CPU_DISASSEMBLE( hd6309 ); |
| r3957 | r3958 | |
|---|---|---|
| 1265 | 1265 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1266 | 1266 | case CPUINFO_INT_MAX_CYCLES: info->i = 20; break; |
| 1267 | 1267 | |
| 1268 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1269 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1270 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1271 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1272 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1273 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1274 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1275 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1276 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1268 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1269 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1270 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1271 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1272 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1273 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1274 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1275 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1276 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1277 | 1277 | |
| 1278 | 1278 | case CPUINFO_INT_INPUT_STATE + HD6309_IRQ_LINE: info->i = m68_state->irq_state[HD6309_IRQ_LINE]; break; |
| 1279 | 1279 | case CPUINFO_INT_INPUT_STATE + HD6309_FIRQ_LINE:info->i = m68_state->irq_state[HD6309_FIRQ_LINE]; break; |
| r3957 | r3958 | |
| 1298 | 1298 | case CPUINFO_INT_REGISTER + HD6309_DP: info->i = DP; break; |
| 1299 | 1299 | |
| 1300 | 1300 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1301 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(hd6309); break; | |
| 1302 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(hd6309); break; | |
| 1303 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(hd6309); break; | |
| 1304 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(hd6309); break; | |
| 1305 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(hd6309); break; | |
| 1306 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1307 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hd6309); break; | |
| 1301 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(hd6309); break; | |
| 1302 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(hd6309); break; | |
| 1303 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(hd6309); break; | |
| 1304 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(hd6309); break; | |
| 1305 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(hd6309); break; | |
| 1306 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1307 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hd6309); break; | |
| 1308 | 1308 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &m68_state->icount; break; |
| 1309 | 1309 | |
| 1310 | 1310 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | #if (HAS_SSP1601) |
| 20 | 20 | CPU_GET_INFO( ssp1601 ); |
| 21 | #define CPU_SSP1601 CPU_GET_INFO_NAME( ssp1601 ) | |
| 21 | 22 | #endif |
| 22 | 23 | |
| 23 | 24 | extern unsigned dasm_ssp1601(char *buffer, unsigned pc, const UINT8 *oprom); |
| r3957 | r3958 | |
|---|---|---|
| 824 | 824 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 825 | 825 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 826 | 826 | |
| 827 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 828 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 829 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; | |
| 830 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 831 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 832 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 833 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 834 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 4; break; | |
| 835 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 827 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 828 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 829 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 830 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 831 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 832 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 833 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 834 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 4; break; | |
| 835 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 836 | 836 | |
| 837 | 837 | case CPUINFO_INT_INPUT_STATE + 0: /* not implemented */ break; |
| 838 | 838 | |
| r3957 | r3958 | |
| 863 | 863 | case CPUINFO_INT_REGISTER + SSP_PR7: info->i = ssp1601_state->r[7]; break; |
| 864 | 864 | |
| 865 | 865 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 866 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ssp1601); break; | |
| 867 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ssp1601); break; | |
| 868 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ssp1601); break; | |
| 869 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(ssp1601); break; | |
| 870 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ssp1601); break; | |
| 871 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 872 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ssp1601); break; | |
| 866 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ssp1601); break; | |
| 867 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ssp1601); break; | |
| 868 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ssp1601); break; | |
| 869 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(ssp1601); break; | |
| 870 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ssp1601); break; | |
| 871 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 872 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ssp1601); break; | |
| 873 | 873 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &ssp1601_state->g_cycles; break; |
| 874 | 874 | |
| 875 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map16 = NULL; break; | |
| 876 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map16 = NULL; break; | |
| 875 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map16 = NULL; break; | |
| 876 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map16 = NULL; break; | |
| 877 | 877 | |
| 878 | 878 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 879 | 879 | case CPUINFO_STR_NAME: strcpy(info->s, CHIP_NAME); break; |
| r3957 | r3958 | |
|---|---|---|
| 2741 | 2741 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 2742 | 2742 | case CPUINFO_INT_MAX_CYCLES: info->i = 26; break; |
| 2743 | 2743 | |
| 2744 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 2745 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 2746 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2744 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 2745 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 2746 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2747 | 2747 | |
| 2748 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2749 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2750 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2748 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2749 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2750 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2751 | 2751 | |
| 2752 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2753 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 2754 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2752 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2753 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 2754 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2755 | 2755 | |
| 2756 | 2756 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->irq_state & (1 << INTNMI); break; |
| 2757 | 2757 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_IRQ0: info->i = cpustate->irq_state & (1 << INT0); break; |
| r3957 | r3958 | |
| 2779 | 2779 | |
| 2780 | 2780 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2781 | 2781 | |
| 2782 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(t90); break; | |
| 2783 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(t90); break; | |
| 2784 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(t90); break; | |
| 2785 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(t90); break; | |
| 2786 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(t90); break; | |
| 2787 | case CPUINFO_PTR_BURN: info->burn = CPU_BURN_NAME(t90); break; | |
| 2788 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(t90); break; | |
| 2782 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(t90); break; | |
| 2783 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(t90); break; | |
| 2784 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(t90); break; | |
| 2785 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(t90); break; | |
| 2786 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(t90); break; | |
| 2787 | case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(t90); break; | |
| 2788 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(t90); break; | |
| 2789 | 2789 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2790 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2790 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2791 | 2791 | |
| 2792 | 2792 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2793 | 2793 | |
| r3957 | r3958 | |
| 2833 | 2833 | { |
| 2834 | 2834 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2835 | 2835 | |
| 2836 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2836 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2837 | 2837 | |
| 2838 | 2838 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2839 | 2839 | |
| r3957 | r3958 | |
| 2849 | 2849 | { |
| 2850 | 2850 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2851 | 2851 | |
| 2852 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2852 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2853 | 2853 | |
| 2854 | 2854 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2855 | 2855 | |
| r3957 | r3958 | |
| 2865 | 2865 | { |
| 2866 | 2866 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2867 | 2867 | |
| 2868 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2868 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2869 | 2869 | |
| 2870 | 2870 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2871 | 2871 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | CPU_GET_INFO( tmp91640 ); |
| 11 | 11 | CPU_GET_INFO( tmp91641 ); |
| 12 | 12 | |
| 13 | #define CPU_TMP90840 CPU_GET_INFO_NAME( tmp90840 ) | |
| 14 | #define CPU_TMP90841 CPU_GET_INFO_NAME( tmp90841 ) | |
| 15 | #define CPU_TMP91640 CPU_GET_INFO_NAME( tmp91640 ) | |
| 16 | #define CPU_TMP91641 CPU_GET_INFO_NAME( tmp91641 ) | |
| 17 | ||
| 13 | 18 | CPU_DISASSEMBLE( t90 ); |
| 14 | 19 | |
| 15 | 20 | #define T90_IOBASE 0xffc0 |
| r3957 | r3958 | |
|---|---|---|
| 1522 | 1522 | case CPUINFO_INT_MIN_CYCLES: info->i = 5; break; |
| 1523 | 1523 | case CPUINFO_INT_MAX_CYCLES: info->i = 13; break; |
| 1524 | 1524 | |
| 1525 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1526 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 15; break; | |
| 1527 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1525 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1526 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 15; break; | |
| 1527 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1528 | 1528 | |
| 1529 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1530 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1531 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1529 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1530 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1531 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1532 | 1532 | |
| 1533 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1534 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 1535 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1533 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1534 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 1535 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1536 | 1536 | |
| 1537 | 1537 | case CPUINFO_INT_INPUT_STATE + 0: info->i = s2650c->irq_state; break; |
| 1538 | 1538 | case CPUINFO_INT_INPUT_STATE + 1: info->i = s2650_get_sense(s2650c) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 1556 | 1556 | case CPUINFO_INT_REGISTER + S2650_FO: info->i = s2650_get_flag(s2650c); break; |
| 1557 | 1557 | |
| 1558 | 1558 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1559 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(s2650); break; | |
| 1560 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(s2650); break; | |
| 1561 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(s2650); break; | |
| 1562 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(s2650); break; | |
| 1563 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(s2650); break; | |
| 1564 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1565 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(s2650); break; | |
| 1559 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(s2650); break; | |
| 1560 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(s2650); break; | |
| 1561 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(s2650); break; | |
| 1562 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(s2650); break; | |
| 1563 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(s2650); break; | |
| 1564 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1565 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(s2650); break; | |
| 1566 | 1566 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &s2650c->icount; break; |
| 1567 | 1567 | |
| 1568 | 1568 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | #define S2650_SENSE_PORT 0x102 |
| 26 | 26 | |
| 27 | 27 | extern CPU_GET_INFO( s2650 ); |
| 28 | #define CPU_S2650 CPU_GET_INFO_NAME( s2650 ) | |
| 28 | 29 | |
| 29 | 30 | extern CPU_DISASSEMBLE( s2650 ); |
| 30 | 31 |
| r3957 | r3958 | |
|---|---|---|
| 993 | 993 | case CPUINFO_INT_MIN_CYCLES: info->i = CDP1802_CYCLES_EXECUTE * 2; break; |
| 994 | 994 | case CPUINFO_INT_MAX_CYCLES: info->i = CDP1802_CYCLES_EXECUTE * 3; break; |
| 995 | 995 | |
| 996 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 997 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 998 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 999 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1000 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1001 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1002 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1003 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 3; break; | |
| 1004 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 996 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 997 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 998 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 999 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1000 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1001 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1002 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1003 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 3; break; | |
| 1004 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1005 | 1005 | |
| 1006 | 1006 | case CPUINFO_INT_INPUT_STATE + CDP1802_INPUT_LINE_INT: info->i = cpustate->irq; break; |
| 1007 | 1007 | case CPUINFO_INT_INPUT_STATE + CDP1802_INPUT_LINE_DMAIN: info->i = cpustate->dmain; break; |
| r3957 | r3958 | |
| 1040 | 1040 | case CPUINFO_INT_REGISTER + CDP1802_PC: info->i = cpustate->r[cpustate->p]; break; |
| 1041 | 1041 | |
| 1042 | 1042 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1043 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cdp1802); break; | |
| 1044 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cdp1802); break; | |
| 1045 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cdp1802); break; | |
| 1046 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cdp1802); break; | |
| 1047 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1048 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cdp1802); break; | |
| 1043 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cdp1802); break; | |
| 1044 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cdp1802); break; | |
| 1045 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cdp1802); break; | |
| 1046 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cdp1802); break; | |
| 1047 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1048 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cdp1802); break; | |
| 1049 | 1049 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1050 | 1050 | |
| 1051 | 1051 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 88 | 88 | }; |
| 89 | 89 | |
| 90 | 90 | CPU_GET_INFO( cdp1802 ); |
| 91 | #define CPU_CDP1802 CPU_GET_INFO_NAME( cdp1802 ) | |
| 91 | 92 | |
| 92 | 93 | typedef cdp1802_control_mode (*cdp1802_mode_read_func)(const device_config *device); |
| 93 | 94 | #define CDP1802_MODE_READ(name) cdp1802_control_mode name(const device_config *device) |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | UINT8 IRQ; |
| 28 | 28 | UINT8 NMI; |
| 29 | 29 | |
| 30 | int | |
| 30 | int ic | |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | 33 | #define FLAG_C 0x0080 |
| r3957 | r3958 | |
| 1702 | 1702 | OpTable[i]=DecodeOp(i); |
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | static CPU_RESET( | |
| 1705 | static CPU_RESET( se3208 ) | |
| 1706 | 1706 | { |
| 1707 | 1707 | se3208_state_t *se3208_state = device->token; |
| 1708 | 1708 | |
| r3957 | r3958 | |
| 1745 | 1745 | } |
| 1746 | 1746 | |
| 1747 | 1747 | |
| 1748 | static CPU_EXECUTE( | |
| 1748 | static CPU_EXECUTE( se3208 ) | |
| 1749 | 1749 | { |
| 1750 | 1750 | se3208_state_t *se3208_state = device->token; |
| 1751 | 1751 | |
| 1752 | se3208_state-> | |
| 1752 | se3208_state->ic | |
| 1753 | 1753 | do |
| 1754 | 1754 | { |
| 1755 | 1755 | UINT16 Opcode=memory_decrypted_read_word(se3208_state->program, WORD_XOR_LE(se3208_state->PC)); |
| r3957 | r3958 | |
| 1769 | 1769 | { |
| 1770 | 1770 | SE3208_Interrupt(se3208_state); |
| 1771 | 1771 | } |
| 1772 | --(se3208_state->SE3208_ICount); | |
| 1773 | } while(se3208_state->SE3208_ICount>0); | |
| 1772 | --(se3208_state->icount); | |
| 1773 | } while(se3208_state->icount>0); | |
| 1774 | 1774 | |
| 1775 | return cycles-se3208_state-> | |
| 1775 | return cycles-se3208_state->ic | |
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | static CPU_INIT( | |
| 1778 | static CPU_INIT( se3208 ) | |
| 1779 | 1779 | { |
| 1780 | 1780 | se3208_state_t *se3208_state = device->token; |
| 1781 | 1781 | |
| r3957 | r3958 | |
| 1786 | 1786 | se3208_state->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 1787 | 1787 | } |
| 1788 | 1788 | |
| 1789 | static CPU_EXIT( | |
| 1789 | static CPU_EXIT( se3208 ) | |
| 1790 | 1790 | { |
| 1791 | 1791 | if(OpTable) |
| 1792 | 1792 | free(OpTable); |
| r3957 | r3958 | |
| 1802 | 1802 | } |
| 1803 | 1803 | |
| 1804 | 1804 | |
| 1805 | static CPU_SET_INFO( | |
| 1805 | static CPU_SET_INFO( se3208 ) | |
| 1806 | 1806 | { |
| 1807 | 1807 | se3208_state_t *se3208_state = device->token; |
| 1808 | 1808 | |
| r3957 | r3958 | |
| 1830 | 1830 | } |
| 1831 | 1831 | |
| 1832 | 1832 | |
| 1833 | CPU_GET_INFO( | |
| 1833 | CPU_GET_INFO( se3208 ) | |
| 1834 | 1834 | { |
| 1835 | 1835 | se3208_state_t *se3208_state = (device != NULL) ? device->token : NULL; |
| 1836 | 1836 | |
| r3957 | r3958 | |
| 1848 | 1848 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1849 | 1849 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 1850 | 1850 | |
| 1851 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1852 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1853 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1854 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1855 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1856 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1857 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1858 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1859 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1851 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1852 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1853 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1854 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1855 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1856 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1857 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1858 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1859 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1860 | 1860 | |
| 1861 | 1861 | case CPUINFO_INT_INPUT_STATE + SE3208_INT: info->i = se3208_state->IRQ; break; |
| 1862 | 1862 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = se3208_state->NMI; break; |
| r3957 | r3958 | |
| 1879 | 1879 | case CPUINFO_INT_REGISTER + SE3208_R7: info->i = se3208_state->R[ 7]; break; |
| 1880 | 1880 | |
| 1881 | 1881 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1882 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(SE3208); break; | |
| 1883 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(SE3208); break; | |
| 1884 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(SE3208); break; | |
| 1885 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(SE3208); break; | |
| 1886 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(SE3208);break; | |
| 1887 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1888 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(SE3208); break; | |
| 1889 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &se3208_state->SE3208_ICount; break; | |
| 1882 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(se3208); break; | |
| 1883 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(se3208); break; | |
| 1884 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(se3208); break; | |
| 1885 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(se3208); break; | |
| 1886 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(se3208);break; | |
| 1887 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1888 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(se3208); break; | |
| 1889 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &se3208_state->icount; break; | |
| 1890 | 1890 | |
| 1891 | 1891 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1892 | 1892 | case CPUINFO_STR_NAME: strcpy(info->s, "SE3208"); break; |
| r3957 | r3958 | |
|---|---|---|
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | 1402 | |
| 1403 | CPU_DISASSEMBLE( | |
| 1403 | CPU_DISASSEMBLE( se3208 ) | |
| 1404 | 1404 | { |
| 1405 | 1405 | UINT16 Opcode; |
| 1406 | 1406 |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #define SE3208_INT 0 |
| 10 | 10 | |
| 11 | extern CPU_GET_INFO( SE3208 ); | |
| 11 | extern CPU_GET_INFO( se3208 ); | |
| 12 | #define CPU_SE3208 CPU_GET_INFO_NAME( se3208 ) | |
| 12 | 13 | |
| 13 | CPU_DISASSEMBLE( | |
| 14 | CPU_DISASSEMBLE( se3208 ); |
| r3957 | r3958 | |
|---|---|---|
| 1521 | 1521 | ISR &= ~(1 << irqline); |
| 1522 | 1522 | } |
| 1523 | 1523 | |
| 1524 | static void hyperstone_init(const device_config *device, | |
| 1524 | static void hyperstone_init(const device_config *device, | |
| 1525 | 1525 | { |
| 1526 | 1526 | hyperstone_state *cpustate = device->token; |
| 1527 | 1527 | |
| r3957 | r3958 | |
| 1544 | 1544 | } |
| 1545 | 1545 | |
| 1546 | 1546 | #if (HAS_E116T || HAS_E116XT || HAS_E116XS || HAS_E116XSR || HAS_GMS30C2116 || HAS_GMS30C2216) |
| 1547 | static void e116_init(const device_config *device, | |
| 1547 | static void e116_init(const device_config *device, | |
| 1548 | 1548 | { |
| 1549 | 1549 | hyperstone_state *cpustate = device->token; |
| 1550 | hyperstone_init(device, i | |
| 1550 | hyperstone_init(device, i | |
| 1551 | 1551 | cpustate->opcodexor = 0; |
| 1552 | 1552 | } |
| 1553 | 1553 | #endif |
| r3957 | r3958 | |
| 1555 | 1555 | #if (HAS_E116T) |
| 1556 | 1556 | static CPU_INIT( e116t ) |
| 1557 | 1557 | { |
| 1558 | e116_init(device, i | |
| 1558 | e116_init(device, i | |
| 1559 | 1559 | } |
| 1560 | 1560 | #endif |
| 1561 | 1561 | |
| 1562 | 1562 | #if (HAS_E116XT) |
| 1563 | 1563 | static CPU_INIT( e116xt ) |
| 1564 | 1564 | { |
| 1565 | e116_init(device, i | |
| 1565 | e116_init(device, i | |
| 1566 | 1566 | } |
| 1567 | 1567 | #endif |
| 1568 | 1568 | |
| 1569 | 1569 | #if (HAS_E116XS) |
| 1570 | 1570 | static CPU_INIT( e116xs ) |
| 1571 | 1571 | { |
| 1572 | e116_init(device, i | |
| 1572 | e116_init(device, i | |
| 1573 | 1573 | } |
| 1574 | 1574 | #endif |
| 1575 | 1575 | |
| 1576 | 1576 | #if (HAS_E116XSR) |
| 1577 | 1577 | static CPU_INIT( e116xsr ) |
| 1578 | 1578 | { |
| 1579 | e116_init(device, i | |
| 1579 | e116_init(device, i | |
| 1580 | 1580 | } |
| 1581 | 1581 | #endif |
| 1582 | 1582 | |
| 1583 | 1583 | #if (HAS_GMS30C2116) |
| 1584 | 1584 | static CPU_INIT( gms30c2116 ) |
| 1585 | 1585 | { |
| 1586 | e116_init(device, i | |
| 1586 | e116_init(device, i | |
| 1587 | 1587 | } |
| 1588 | 1588 | #endif |
| 1589 | 1589 | |
| 1590 | 1590 | #if (HAS_GMS30C2216) |
| 1591 | 1591 | static CPU_INIT( gms30c2216 ) |
| 1592 | 1592 | { |
| 1593 | e116_init(device, i | |
| 1593 | e116_init(device, i | |
| 1594 | 1594 | } |
| 1595 | 1595 | #endif |
| 1596 | 1596 | |
| 1597 | 1597 | #if (HAS_E132N || HAS_E132T || HAS_E132XN || HAS_E132XT || HAS_E132XS || HAS_E132XSR || HAS_GMS30C2132 || HAS_GMS30C2232) |
| 1598 | static void e132_init(const device_config *device, | |
| 1598 | static void e132_init(const device_config *device, | |
| 1599 | 1599 | { |
| 1600 | 1600 | hyperstone_state *cpustate = device->token; |
| 1601 | hyperstone_init(device, i | |
| 1601 | hyperstone_init(device, i | |
| 1602 | 1602 | cpustate->opcodexor = WORD_XOR_BE(0); |
| 1603 | 1603 | } |
| 1604 | 1604 | #endif |
| r3957 | r3958 | |
| 1606 | 1606 | #if (HAS_E132N) |
| 1607 | 1607 | static CPU_INIT( e132n ) |
| 1608 | 1608 | { |
| 1609 | e132_init(device, i | |
| 1609 | e132_init(device, i | |
| 1610 | 1610 | } |
| 1611 | 1611 | #endif |
| 1612 | 1612 | |
| 1613 | 1613 | #if (HAS_E132T) |
| 1614 | 1614 | static CPU_INIT( e132t ) |
| 1615 | 1615 | { |
| 1616 | e132_init(device, i | |
| 1616 | e132_init(device, i | |
| 1617 | 1617 | } |
| 1618 | 1618 | #endif |
| 1619 | 1619 | |
| 1620 | 1620 | #if (HAS_E132XN) |
| 1621 | 1621 | static CPU_INIT( e132xn ) |
| 1622 | 1622 | { |
| 1623 | e132_init(device, i | |
| 1623 | e132_init(device, i | |
| 1624 | 1624 | } |
| 1625 | 1625 | #endif |
| 1626 | 1626 | |
| 1627 | 1627 | #if (HAS_E132XT) |
| 1628 | 1628 | static CPU_INIT( e132xt ) |
| 1629 | 1629 | { |
| 1630 | e132_init(device, i | |
| 1630 | e132_init(device, i | |
| 1631 | 1631 | } |
| 1632 | 1632 | #endif |
| 1633 | 1633 | |
| 1634 | 1634 | #if (HAS_E132XS) |
| 1635 | 1635 | static CPU_INIT( e132xs ) |
| 1636 | 1636 | { |
| 1637 | e132_init(device, i | |
| 1637 | e132_init(device, i | |
| 1638 | 1638 | } |
| 1639 | 1639 | #endif |
| 1640 | 1640 | |
| 1641 | 1641 | #if (HAS_E132XSR) |
| 1642 | 1642 | static CPU_INIT( e132xsr ) |
| 1643 | 1643 | { |
| 1644 | e132_init(device, i | |
| 1644 | e132_init(device, i | |
| 1645 | 1645 | } |
| 1646 | 1646 | #endif |
| 1647 | 1647 | |
| 1648 | 1648 | #if (HAS_GMS30C2132) |
| 1649 | 1649 | static CPU_INIT( gms30c2132 ) |
| 1650 | 1650 | { |
| 1651 | e132_init(device, i | |
| 1651 | e132_init(device, i | |
| 1652 | 1652 | } |
| 1653 | 1653 | #endif |
| 1654 | 1654 | |
| 1655 | 1655 | #if (HAS_GMS30C2232) |
| 1656 | 1656 | static CPU_INIT( gms30c2232 ) |
| 1657 | 1657 | { |
| 1658 | e132_init(device, i | |
| 1658 | e132_init(device, i | |
| 1659 | 1659 | } |
| 1660 | 1660 | #endif |
| 1661 | 1661 | |
| r3957 | r3958 | |
| 4885 | 4885 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 4886 | 4886 | case CPUINFO_INT_MAX_CYCLES: info->i = 36; break; |
| 4887 | 4887 | |
| 4888 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 4889 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 4890 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4891 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4892 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4893 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 15; break; | |
| 4894 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 4888 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 4889 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 4890 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 4891 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 4892 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 4893 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 15; break; | |
| 4894 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 4895 | 4895 | |
| 4896 | 4896 | case CPUINFO_INT_INPUT_STATE + 0: /* not implemented */ break; |
| 4897 | 4897 | |
| r3957 | r3958 | |
| 5013 | 5013 | case CPUINFO_INT_REGISTER + E132XS_L63: info->i = cpustate->local_regs[63]; break; |
| 5014 | 5014 | |
| 5015 | 5015 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5016 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(hyperstone); break; | |
| 5017 | case CPUINFO_PTR_INIT: info->init = NULL; break; | |
| 5018 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(hyperstone); break; | |
| 5019 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(hyperstone); break; | |
| 5020 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(hyperstone); break; | |
| 5021 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 5022 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hyperstone); break; | |
| 5016 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(hyperstone); break; | |
| 5017 | case CPUINFO_FCT_INIT: info->init = NULL; break; | |
| 5018 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(hyperstone); break; | |
| 5019 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(hyperstone); break; | |
| 5020 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(hyperstone); break; | |
| 5021 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 5022 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hyperstone); break; | |
| 5023 | 5023 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 5024 | 5024 | |
| 5025 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map16 = NULL; break; | |
| 5026 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map16 = NULL; break; | |
| 5025 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map16 = NULL; break; | |
| 5026 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map16 = NULL; break; | |
| 5027 | 5027 | |
| 5028 | 5028 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5029 | 5029 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Hyperstone CPU"); break; |
| r3957 | r3958 | |
| 5174 | 5174 | switch (state) |
| 5175 | 5175 | { |
| 5176 | 5176 | |
| 5177 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 5178 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 5177 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 5178 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 5179 | 5179 | |
| 5180 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5180 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5181 | 5181 | |
| 5182 | 5182 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5183 | case CPUINFO_ | |
| 5183 | case CPUINFO_FCT | |
| 5184 | 5184 | |
| 5185 | 5185 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5186 | 5186 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-16T"); break; |
| r3957 | r3958 | |
| 5197 | 5197 | switch (state) |
| 5198 | 5198 | { |
| 5199 | 5199 | |
| 5200 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 5201 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 5200 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 5201 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 5202 | 5202 | |
| 5203 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5203 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5204 | 5204 | |
| 5205 | 5205 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5206 | case CPUINFO_ | |
| 5206 | case CPUINFO_FCT | |
| 5207 | 5207 | |
| 5208 | 5208 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5209 | 5209 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XT"); break; |
| r3957 | r3958 | |
| 5220 | 5220 | switch (state) |
| 5221 | 5221 | { |
| 5222 | 5222 | |
| 5223 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 5224 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 5223 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 5224 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 5225 | 5225 | |
| 5226 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5226 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5227 | 5227 | |
| 5228 | 5228 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5229 | case CPUINFO_ | |
| 5229 | case CPUINFO_FCT | |
| 5230 | 5230 | |
| 5231 | 5231 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5232 | 5232 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XS"); break; |
| r3957 | r3958 | |
| 5243 | 5243 | switch (state) |
| 5244 | 5244 | { |
| 5245 | 5245 | |
| 5246 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 5247 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 5246 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 5247 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 5248 | 5248 | |
| 5249 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5249 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5250 | 5250 | |
| 5251 | 5251 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5252 | case CPUINFO_ | |
| 5252 | case CPUINFO_FCT | |
| 5253 | 5253 | |
| 5254 | 5254 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5255 | 5255 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XSR"); break; |
| r3957 | r3958 | |
| 5266 | 5266 | switch (state) |
| 5267 | 5267 | { |
| 5268 | 5268 | |
| 5269 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5270 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5269 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5270 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5271 | 5271 | |
| 5272 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5272 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5273 | 5273 | |
| 5274 | 5274 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5275 | case CPUINFO_ | |
| 5275 | case CPUINFO_FCT | |
| 5276 | 5276 | |
| 5277 | 5277 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5278 | 5278 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-32N"); break; |
| r3957 | r3958 | |
| 5289 | 5289 | switch (state) |
| 5290 | 5290 | { |
| 5291 | 5291 | |
| 5292 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5293 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5292 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5293 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5294 | 5294 | |
| 5295 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5295 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5296 | 5296 | |
| 5297 | 5297 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5298 | case CPUINFO_ | |
| 5298 | case CPUINFO_FCT | |
| 5299 | 5299 | |
| 5300 | 5300 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5301 | 5301 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-32T"); break; |
| r3957 | r3958 | |
| 5312 | 5312 | switch (state) |
| 5313 | 5313 | { |
| 5314 | 5314 | |
| 5315 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5316 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5315 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5316 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5317 | 5317 | |
| 5318 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5318 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5319 | 5319 | |
| 5320 | 5320 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5321 | case CPUINFO_ | |
| 5321 | case CPUINFO_FCT | |
| 5322 | 5322 | |
| 5323 | 5323 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5324 | 5324 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XN"); break; |
| r3957 | r3958 | |
| 5335 | 5335 | switch (state) |
| 5336 | 5336 | { |
| 5337 | 5337 | |
| 5338 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5339 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5338 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5339 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5340 | 5340 | |
| 5341 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5341 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5342 | 5342 | |
| 5343 | 5343 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5344 | case CPUINFO_ | |
| 5344 | case CPUINFO_FCT | |
| 5345 | 5345 | |
| 5346 | 5346 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5347 | 5347 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XT"); break; |
| r3957 | r3958 | |
| 5358 | 5358 | switch (state) |
| 5359 | 5359 | { |
| 5360 | 5360 | |
| 5361 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5362 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5361 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5362 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5363 | 5363 | |
| 5364 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5364 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5365 | 5365 | |
| 5366 | 5366 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5367 | case CPUINFO_ | |
| 5367 | case CPUINFO_FCT | |
| 5368 | 5368 | |
| 5369 | 5369 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5370 | 5370 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XS"); break; |
| r3957 | r3958 | |
| 5381 | 5381 | switch (state) |
| 5382 | 5382 | { |
| 5383 | 5383 | |
| 5384 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5385 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5384 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5385 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5386 | 5386 | |
| 5387 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5387 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5388 | 5388 | |
| 5389 | 5389 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5390 | case CPUINFO_ | |
| 5390 | case CPUINFO_FCT | |
| 5391 | 5391 | |
| 5392 | 5392 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5393 | 5393 | case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XSR"); break; |
| r3957 | r3958 | |
| 5404 | 5404 | switch (state) |
| 5405 | 5405 | { |
| 5406 | 5406 | |
| 5407 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 5408 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 5407 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 5408 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 5409 | 5409 | |
| 5410 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5410 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5411 | 5411 | |
| 5412 | 5412 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5413 | case CPUINFO_ | |
| 5413 | case CPUINFO_FCT | |
| 5414 | 5414 | |
| 5415 | 5415 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5416 | 5416 | case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2116"); break; |
| r3957 | r3958 | |
| 5427 | 5427 | switch (state) |
| 5428 | 5428 | { |
| 5429 | 5429 | |
| 5430 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5431 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5430 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5431 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5432 | 5432 | |
| 5433 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5433 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5434 | 5434 | |
| 5435 | 5435 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5436 | case CPUINFO_ | |
| 5436 | case CPUINFO_FCT | |
| 5437 | 5437 | |
| 5438 | 5438 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5439 | 5439 | case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2132"); break; |
| r3957 | r3958 | |
| 5450 | 5450 | switch (state) |
| 5451 | 5451 | { |
| 5452 | 5452 | |
| 5453 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 5454 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 5453 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 5454 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 5455 | 5455 | |
| 5456 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5456 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5457 | 5457 | |
| 5458 | 5458 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5459 | case CPUINFO_ | |
| 5459 | case CPUINFO_FCT | |
| 5460 | 5460 | |
| 5461 | 5461 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5462 | 5462 | case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2216"); break; |
| r3957 | r3958 | |
| 5473 | 5473 | switch (state) |
| 5474 | 5474 | { |
| 5475 | 5475 | |
| 5476 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 5477 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 5476 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 5477 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 5478 | 5478 | |
| 5479 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5479 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 5480 | 5480 | |
| 5481 | 5481 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 5482 | case CPUINFO_ | |
| 5482 | case CPUINFO_FCT | |
| 5483 | 5483 | |
| 5484 | 5484 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 5485 | 5485 | case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2232"); break; |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | #if (HAS_E116T) |
| 27 | 27 | CPU_GET_INFO( e116t ); |
| 28 | #define CPU_E116T CPU_GET_INFO_NAME( e116t ) | |
| 28 | 29 | #endif |
| 29 | 30 | |
| 30 | 31 | #if (HAS_E116XT) |
| 31 | 32 | CPU_GET_INFO( e116xt ); |
| 33 | #define CPU_E116XT CPU_GET_INFO_NAME( e116xt ) | |
| 32 | 34 | #endif |
| 33 | 35 | |
| 34 | 36 | #if (HAS_E116XS) |
| 35 | 37 | CPU_GET_INFO( e116xs ); |
| 38 | #define CPU_E116XS CPU_GET_INFO_NAME( e116xs ) | |
| 36 | 39 | #endif |
| 37 | 40 | |
| 38 | 41 | #if (HAS_E116XSR) |
| 39 | 42 | CPU_GET_INFO( e116xsr ); |
| 43 | #define CPU_E116XSR CPU_GET_INFO_NAME( e116xsr ) | |
| 40 | 44 | #endif |
| 41 | 45 | |
| 42 | 46 | #if (HAS_E132N) |
| 43 | 47 | CPU_GET_INFO( e132n ); |
| 48 | #define CPU_E132N CPU_GET_INFO_NAME( e132n ) | |
| 44 | 49 | #endif |
| 45 | 50 | |
| 46 | 51 | #if (HAS_E132T) |
| 47 | 52 | CPU_GET_INFO( e132t ); |
| 53 | #define CPU_E132T CPU_GET_INFO_NAME( e132t ) | |
| 48 | 54 | #endif |
| 49 | 55 | |
| 50 | 56 | #if (HAS_E132XN) |
| 51 | 57 | CPU_GET_INFO( e132xn ); |
| 58 | #define CPU_E132XN CPU_GET_INFO_NAME( e132xn ) | |
| 52 | 59 | #endif |
| 53 | 60 | |
| 54 | 61 | #if (HAS_E132XT) |
| 55 | 62 | CPU_GET_INFO( e132xt ); |
| 63 | #define CPU_E132XT CPU_GET_INFO_NAME( e132xt ) | |
| 56 | 64 | #endif |
| 57 | 65 | |
| 58 | 66 | #if (HAS_E132XS) |
| 59 | 67 | CPU_GET_INFO( e132xs ); |
| 68 | #define CPU_E132XS CPU_GET_INFO_NAME( e132xs ) | |
| 60 | 69 | #endif |
| 61 | 70 | |
| 62 | 71 | #if (HAS_E132XSR) |
| 63 | 72 | CPU_GET_INFO( e132xsr ); |
| 73 | #define CPU_E132XSR CPU_GET_INFO_NAME( e132xsr ) | |
| 64 | 74 | #endif |
| 65 | 75 | |
| 66 | 76 | #if (HAS_GMS30C2116) |
| 67 | 77 | CPU_GET_INFO( gms30c2116 ); |
| 78 | #define CPU_GMS30C2116 CPU_GET_INFO_NAME( gms30c2116 ) | |
| 68 | 79 | #endif |
| 69 | 80 | |
| 70 | 81 | #if (HAS_GMS30C2132) |
| 71 | 82 | CPU_GET_INFO( gms30c2132 ); |
| 83 | #define CPU_GMS30C2132 CPU_GET_INFO_NAME( gms30c2132 ) | |
| 72 | 84 | #endif |
| 73 | 85 | |
| 74 | 86 | #if (HAS_GMS30C2216) |
| 75 | 87 | CPU_GET_INFO( gms30c2216 ); |
| 88 | #define CPU_GMS30C2216 CPU_GET_INFO_NAME( gms30c2216 ) | |
| 76 | 89 | #endif |
| 77 | 90 | |
| 78 | 91 | #if (HAS_GMS30C2232) |
| 79 | 92 | CPU_GET_INFO( gms30c2232 ); |
| 93 | #define CPU_GMS30C2232 CPU_GET_INFO_NAME( gms30c2232 ) | |
| 80 | 94 | #endif |
| 81 | 95 | |
| 82 | 96 | extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned h_flag, int private_fp); |
| r3957 | r3958 | |
|---|---|---|
| 2462 | 2462 | case CPUINFO_INT_MAX_CYCLES: info->i = 20; /* rough guess */ break; |
| 2463 | 2463 | case CPUINFO_INT_INPUT_LINES: info->i = 3; break; |
| 2464 | 2464 | |
| 2465 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 2466 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 2467 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2468 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 2469 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 9; /* due to sfr mapping */ break; | |
| 2470 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2471 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2472 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 18; /* 128k for ds5002fp */ break; | |
| 2473 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2465 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 2466 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 2467 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2468 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 2469 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 9; /* due to sfr mapping */ break; | |
| 2470 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2471 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2472 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 18; /* 128k for ds5002fp */ break; | |
| 2473 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2474 | 2474 | |
| 2475 | 2475 | case CPUINFO_INT_PREVIOUSPC: info->i = PPC; break; |
| 2476 | 2476 | case CPUINFO_INT_PC: info->i = PC; break; |
| r3957 | r3958 | |
| 2495 | 2495 | case CPUINFO_INT_REGISTER + MCS51_RB: info->i = R_REG(8); break; |
| 2496 | 2496 | |
| 2497 | 2497 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2498 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mcs51); break; | |
| 2499 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(mcs51); break; | |
| 2500 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(mcs51); break; | |
| 2501 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(mcs51); break; | |
| 2502 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(mcs51); break; | |
| 2503 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2504 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8051); break; | |
| 2498 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mcs51); break; | |
| 2499 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(mcs51); break; | |
| 2500 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mcs51); break; | |
| 2501 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(mcs51); break; | |
| 2502 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(mcs51); break; | |
| 2503 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2504 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8051); break; | |
| 2505 | 2505 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &mcs51_state->icount; break; |
| 2506 | 2506 | |
| 2507 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = NULL; break; | |
| 2508 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = NULL; break; | |
| 2509 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map8 = NULL; break; | |
| 2507 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = NULL; break; | |
| 2508 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = NULL; break; | |
| 2509 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map8 = NULL; break; | |
| 2510 | 2510 | |
| 2511 | 2511 | case CPUINFO_STR_NAME: strcpy(info->s, "I8051"); break; |
| 2512 | 2512 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "MCS-51"); break; |
| r3957 | r3958 | |
| 2554 | 2554 | { |
| 2555 | 2555 | switch (state) |
| 2556 | 2556 | { |
| 2557 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2557 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2558 | 2558 | case CPUINFO_STR_NAME: strcpy(info->s, "I8031"); break; |
| 2559 | 2559 | default: CPU_GET_INFO_CALL(mcs51); break; |
| 2560 | 2560 | } |
| r3957 | r3958 | |
| 2565 | 2565 | { |
| 2566 | 2566 | switch (state) |
| 2567 | 2567 | { |
| 2568 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_12bit); break; | |
| 2569 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 2568 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_12bit); break; | |
| 2569 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 2570 | 2570 | case CPUINFO_STR_NAME: strcpy(info->s, "I8051"); break; |
| 2571 | 2571 | default: CPU_GET_INFO_CALL(mcs51); break; |
| 2572 | 2572 | } |
| r3957 | r3958 | |
| 2577 | 2577 | { |
| 2578 | 2578 | switch (state) |
| 2579 | 2579 | { |
| 2580 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8052); break; | |
| 2581 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 2582 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; | |
| 2580 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8052); break; | |
| 2581 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 2582 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; | |
| 2583 | 2583 | case CPUINFO_STR_NAME: strcpy(info->s, "I8032"); break; |
| 2584 | 2584 | default: CPU_GET_INFO_CALL(mcs51); break; |
| 2585 | 2585 | } |
| r3957 | r3958 | |
| 2589 | 2589 | { |
| 2590 | 2590 | switch (state) |
| 2591 | 2591 | { |
| 2592 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8052); break; | |
| 2593 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_13bit); break; | |
| 2594 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 2595 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; | |
| 2592 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8052); break; | |
| 2593 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_13bit); break; | |
| 2594 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 2595 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; | |
| 2596 | 2596 | case CPUINFO_STR_NAME: strcpy(info->s, "I8052"); break; |
| 2597 | 2597 | default: CPU_GET_INFO_CALL(mcs51); break; |
| 2598 | 2598 | } |
| r3957 | r3958 | |
| 2602 | 2602 | { |
| 2603 | 2603 | switch (state) |
| 2604 | 2604 | { |
| 2605 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_12bit); break; | |
| 2606 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 2605 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_12bit); break; | |
| 2606 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 2607 | 2607 | case CPUINFO_STR_NAME: strcpy(info->s, "I8751"); break; |
| 2608 | 2608 | default: CPU_GET_INFO_CALL(mcs51); break; |
| 2609 | 2609 | } |
| r3957 | r3958 | |
| 2613 | 2613 | { |
| 2614 | 2614 | switch (state) |
| 2615 | 2615 | { |
| 2616 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8052); break; | |
| 2617 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_13bit); break; | |
| 2618 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 2619 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; | |
| 2616 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8052); break; | |
| 2617 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_13bit); break; | |
| 2618 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 2619 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8052); break; | |
| 2620 | 2620 | case CPUINFO_STR_NAME: strcpy(info->s, "I8752"); break; |
| 2621 | 2621 | default: CPU_GET_INFO_CALL(mcs51); break; |
| 2622 | 2622 | } |
| r3957 | r3958 | |
| 2632 | 2632 | * of i80c52 with 128 bytes internal ram */ |
| 2633 | 2633 | switch (state) |
| 2634 | 2634 | { |
| 2635 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i80c31); break; | |
| 2636 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = NULL; break; | |
| 2637 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 2638 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; | |
| 2635 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c31); break; | |
| 2636 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = NULL; break; | |
| 2637 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 2638 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; | |
| 2639 | 2639 | case CPUINFO_STR_NAME: strcpy(info->s, "I80C31"); break; |
| 2640 | 2640 | default: CPU_GET_INFO_CALL(i8031); break; |
| 2641 | 2641 | } |
| r3957 | r3958 | |
| 2645 | 2645 | { |
| 2646 | 2646 | switch (state) |
| 2647 | 2647 | { |
| 2648 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i80c51); break; | |
| 2649 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; | |
| 2648 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c51); break; | |
| 2649 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c51); break; | |
| 2650 | 2650 | case CPUINFO_STR_NAME: strcpy(info->s, "I80C51"); break; |
| 2651 | 2651 | default: CPU_GET_INFO_CALL(i8051); break; |
| 2652 | 2652 | } |
| r3957 | r3958 | |
| 2656 | 2656 | { |
| 2657 | 2657 | switch (state) |
| 2658 | 2658 | { |
| 2659 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i80c52); break; | |
| 2660 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c52); break; | |
| 2659 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80c52); break; | |
| 2660 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i80c52); break; | |
| 2661 | 2661 | case CPUINFO_STR_NAME: strcpy(info->s, "I80C32"); break; |
| 2662 | 2662 | default: CPU_GET_INFO_CALL(i8032); break; |
| 2663 | 2663 | } |
| r3957 | r3958 | |
| 2667 | 2667 | { |
| 2668 | 2668 | switch (state) |
| 2669 | 2669 | { |
| 2670 | case CPUINFO_ | |
| 2670 | case CPUINFO_FCT | |
| 2671 | 2671 | case CPUINFO_STR_NAME: strcpy(info->s, "I80C52"); break; |
| 2672 | case CPUINFO_ | |
| 2672 | case CPUINFO_FCT | |
| 2673 | 2673 | default: CPU_GET_INFO_CALL(i8052); break; |
| 2674 | 2674 | } |
| 2675 | 2675 | } |
| r3957 | r3958 | |
| 2678 | 2678 | { |
| 2679 | 2679 | switch (state) |
| 2680 | 2680 | { |
| 2681 | case CPUINFO_ | |
| 2681 | case CPUINFO_FCT | |
| 2682 | 2682 | case CPUINFO_STR_NAME: strcpy(info->s, "I87C51"); break; |
| 2683 | case CPUINFO_ | |
| 2683 | case CPUINFO_FCT | |
| 2684 | 2684 | default: CPU_GET_INFO_CALL(i8751); break; |
| 2685 | 2685 | } |
| 2686 | 2686 | } |
| r3957 | r3958 | |
| 2689 | 2689 | { |
| 2690 | 2690 | switch (state) |
| 2691 | 2691 | { |
| 2692 | case CPUINFO_ | |
| 2692 | case CPUINFO_FCT | |
| 2693 | 2693 | case CPUINFO_STR_NAME: strcpy(info->s, "I87C52"); break; |
| 2694 | case CPUINFO_ | |
| 2694 | case CPUINFO_FCT | |
| 2695 | 2695 | default: CPU_GET_INFO_CALL(i8752); break; |
| 2696 | 2696 | } |
| 2697 | 2697 | } |
| r3957 | r3958 | |
| 2704 | 2704 | { |
| 2705 | 2705 | switch (state) |
| 2706 | 2706 | { |
| 2707 | case CPUINFO_ | |
| 2707 | case CPUINFO_FCT | |
| 2708 | 2708 | case CPUINFO_STR_NAME: strcpy(info->s, "AT89C4051"); break; |
| 2709 | case CPUINFO_ | |
| 2709 | case CPUINFO_FCT | |
| 2710 | 2710 | default: CPU_GET_INFO_CALL(i8051); break; |
| 2711 | 2711 | } |
| 2712 | 2712 | } |
| r3957 | r3958 | |
| 2715 | 2715 | { |
| 2716 | 2716 | switch (state) |
| 2717 | 2717 | { |
| 2718 | case CPUINFO_ | |
| 2718 | case CPUINFO_FCT | |
| 2719 | 2719 | case CPUINFO_STR_NAME: strcpy(info->s, "DS5002FP"); break; |
| 2720 | 2720 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Dallas"); break; |
| 2721 | 2721 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; |
| 2722 | 2722 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; |
| 2723 | 2723 | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Manuel Abadia"); break; |
| 2724 | case CPUINFO_ | |
| 2724 | case CPUINFO_FCT | |
| 2725 | 2725 | default: CPU_GET_INFO_CALL(i8051); break; |
| 2726 | 2726 | } |
| 2727 | 2727 | } |
| r3957 | r3958 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | /* variants with no internal rom and 128 byte internal memory */ |
| 100 | 100 | CPU_GET_INFO( i8031 ); |
| 101 | #define CPU_I8031 CPU_GET_INFO_NAME( i8031 ) | |
| 101 | 102 | |
| 102 | 103 | /* variants with no internal rom and 256 byte internal memory */ |
| 103 | 104 | CPU_GET_INFO( i8032 ); |
| 105 | #define CPU_I8032 CPU_GET_INFO_NAME( i8032 ) | |
| 104 | 106 | |
| 105 | 107 | /* variants 4k internal rom and 128 byte internal memory */ |
| 106 | 108 | CPU_GET_INFO( i8051 ); |
| 107 | 109 | CPU_GET_INFO( i8751 ); |
| 108 | 110 | |
| 111 | #define CPU_I8051 CPU_GET_INFO_NAME( i8051 ) | |
| 112 | #define CPU_I8751 CPU_GET_INFO_NAME( i8751 ) | |
| 113 | ||
| 109 | 114 | /* variants 8k internal rom and 256 byte internal memory and more registers */ |
| 110 | 115 | CPU_GET_INFO( i8052 ); |
| 111 | 116 | CPU_GET_INFO( i8752 ); |
| 112 | 117 | |
| 118 | #define CPU_I8052 CPU_GET_INFO_NAME( i8052 ) | |
| 119 | #define CPU_I8752 CPU_GET_INFO_NAME( i8752 ) | |
| 120 | ||
| 113 | 121 | /* cmos variants */ |
| 114 | 122 | CPU_GET_INFO( i80c31 ); |
| 115 | 123 | CPU_GET_INFO( i80c51 ); |
| 116 | 124 | CPU_GET_INFO( i87c51 ); |
| 117 | 125 | |
| 126 | #define CPU_I80C31 CPU_GET_INFO_NAME( i80c31 ) | |
| 127 | #define CPU_I80C32 CPU_GET_INFO_NAME( i80c32 ) | |
| 128 | #define CPU_I80C51 CPU_GET_INFO_NAME( i80c51 ) | |
| 129 | ||
| 118 | 130 | CPU_GET_INFO( i80c32 ); |
| 119 | 131 | CPU_GET_INFO( i80c52 ); |
| 120 | 132 | CPU_GET_INFO( i87c52 ); |
| 121 | 133 | |
| 134 | #define CPU_I80C52 CPU_GET_INFO_NAME( i80c52 ) | |
| 135 | #define CPU_I87C51 CPU_GET_INFO_NAME( i87c51 ) | |
| 136 | #define CPU_I87C52 CPU_GET_INFO_NAME( i87c52 ) | |
| 137 | ||
| 122 | 138 | /* 4k internal perom and 128 internal ram and 2 analog comparators */ |
| 123 | 139 | CPU_GET_INFO( at89c4051 ); |
| 140 | #define CPU_AT89C4051 CPU_GET_INFO_NAME( at89c4051 ) | |
| 124 | 141 | |
| 125 | 142 | /* |
| 126 | 143 | * The DS5002FP has 2 16 bits data address buses (the byte-wide bus and the expanded bus). The exact memory position accessed depends on the |
| r3957 | r3958 | |
| 139 | 156 | */ |
| 140 | 157 | |
| 141 | 158 | CPU_GET_INFO( ds5002fp ); |
| 159 | #define CPU_DS5002FP CPU_GET_INFO_NAME( ds5002fp ) | |
| 142 | 160 | |
| 143 | 161 | |
| 144 | 162 | /**************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #pragma once |
| 2 | 2 | |
| 3 | #ifndef __I386_H__ | |
| 4 | #define __I386_H__ | |
| 3 | #ifndef __I386INTF_H__ | |
| 4 | #define __I386INTF_H__ | |
| 5 | 5 | |
| 6 | #include "cpuintrf.h" | |
| 7 | ||
| 8 | #define I386OP(XX) i386_##XX | |
| 9 | #define I486OP(XX) i486_##XX | |
| 10 | #define PENTIUMOP(XX) pentium_##XX | |
| 11 | #define MMXOP(XX) mmx_##XX | |
| 12 | ||
| 13 | 6 | #define INPUT_LINE_A20 1 |
| 14 | 7 | |
| 15 | ||
| 8 | # | |
| 16 | 9 | |
| 17 | typedef enum { ES, CS, SS, DS, FS, GS } SREGS; | |
| 10 | // mingw has this defined for 32-bit compiles | |
| 11 | #undef i386 | |
| 18 | 12 | |
| 19 | #ifdef LSB_FIRST | |
| 20 | typedef enum | |
| 21 | { | |
| 22 | AL = 0, | |
| 23 | AH = 1, | |
| 24 | CL = 4, | |
| 25 | CH = 5, | |
| 26 | DL = 8, | |
| 27 | DH = 9, | |
| 28 | BL = 12, | |
| 29 | BH = 13 | |
| 30 | } BREGS; | |
| 31 | #else | |
| 32 | typedef enum | |
| 33 | { | |
| 34 | AL = 3, | |
| 35 | AH = 2, | |
| 36 | CL = 7, | |
| 37 | CH = 6, | |
| 38 | DL = 11, | |
| 39 | DH = 10, | |
| 40 | BL = 15, | |
| 41 | BH = 14 | |
| 42 | } BREGS; | |
| 43 | #endif | |
| 13 | CPU_GET_INFO( i386 ); | |
| 14 | CPU_GET_INFO( i486 ); | |
| 15 | CPU_GET_INFO( pentium ); | |
| 16 | CPU_GET_INFO( mediagx ); | |
| 44 | 17 | |
| 45 | #ifdef LSB_FIRST | |
| 46 | typedef enum | |
| 47 | { | |
| 48 | AX = 0, | |
| 49 | CX = 2, | |
| 50 | DX = 4, | |
| 51 | BX = 6, | |
| 52 | SP = 8, | |
| 53 | BP = 10, | |
| 54 | SI = 12, | |
| 55 | DI = 14 | |
| 56 | } WREGS; | |
| 57 | #else | |
| 58 | typedef enum | |
| 59 | { | |
| 60 | AX = 1, | |
| 61 | CX = 3, | |
| 62 | DX = 5, | |
| 63 | BX = 7, | |
| 64 | SP = 9, | |
| 65 | BP = 11, | |
| 66 | SI = 13, | |
| 67 | DI = 15 | |
| 68 | } WREGS; | |
| 69 | #endif | |
| 18 | #define CPU_I386 CPU_GET_INFO_NAME( i386 ) | |
| 19 | #define CPU_I486 CPU_GET_INFO_NAME( i486 ) | |
| 20 | #define CPU_PENTIUM CPU_GET_INFO_NAME( pentium ) | |
| 21 | #define CPU_MEDIAGX CPU_GET_INFO_NAME( mediagx ) | |
| 70 | 22 | |
| 71 | typedef enum { EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI } DREGS; | |
| 72 | 23 | |
| 73 | enum | |
| 74 | { | |
| 75 | I386_PC = 0, | |
| 76 | 24 | |
| 77 | /* 8-bit registers */ | |
| 78 | I386_AL, | |
| 79 | I386_AH, | |
| 80 | I386_BL, | |
| 81 | I386_BH, | |
| 82 | I386_CL, | |
| 83 | I386_CH, | |
| 84 | I386_DL, | |
| 85 | I386_DH, | |
| 86 | ||
| 87 | /* 16-bit registers */ | |
| 88 | I386_AX, | |
| 89 | I386_BX, | |
| 90 | I386_CX, | |
| 91 | I386_DX, | |
| 92 | I386_BP, | |
| 93 | I386_SP, | |
| 94 | I386_SI, | |
| 95 | I386_DI, | |
| 96 | I386_IP, | |
| 97 | ||
| 98 | /* 32-bit registers */ | |
| 99 | I386_EAX, | |
| 100 | I386_ECX, | |
| 101 | I386_EDX, | |
| 102 | I386_EBX, | |
| 103 | I386_EBP, | |
| 104 | I386_ESP, | |
| 105 | I386_ESI, | |
| 106 | I386_EDI, | |
| 107 | I386_EIP, | |
| 108 | ||
| 109 | /* segment registers */ | |
| 110 | I386_CS, | |
| 111 | I386_CS_BASE, | |
| 112 | I386_CS_LIMIT, | |
| 113 | I386_CS_FLAGS, | |
| 114 | I386_SS, | |
| 115 | I386_SS_BASE, | |
| 116 | I386_SS_LIMIT, | |
| 117 | I386_SS_FLAGS, | |
| 118 | I386_DS, | |
| 119 | I386_DS_BASE, | |
| 120 | I386_DS_LIMIT, | |
| 121 | I386_DS_FLAGS, | |
| 122 | I386_ES, | |
| 123 | I386_ES_BASE, | |
| 124 | I386_ES_LIMIT, | |
| 125 | I386_ES_FLAGS, | |
| 126 | I386_FS, | |
| 127 | I386_FS_BASE, | |
| 128 | I386_FS_LIMIT, | |
| 129 | I386_FS_FLAGS, | |
| 130 | I386_GS, | |
| 131 | I386_GS_BASE, | |
| 132 | I386_GS_LIMIT, | |
| 133 | I386_GS_FLAGS, | |
| 134 | ||
| 135 | /* other */ | |
| 136 | I386_EFLAGS, | |
| 137 | ||
| 138 | I386_CR0, | |
| 139 | I386_CR1, | |
| 140 | I386_CR2, | |
| 141 | I386_CR3, | |
| 142 | ||
| 143 | I386_DR0, | |
| 144 | I386_DR1, | |
| 145 | I386_DR2, | |
| 146 | I386_DR3, | |
| 147 | I386_DR4, | |
| 148 | I386_DR5, | |
| 149 | I386_DR6, | |
| 150 | I386_DR7, | |
| 151 | ||
| 152 | I386_TR6, | |
| 153 | I386_TR7, | |
| 154 | ||
| 155 | I386_GDTR_BASE, | |
| 156 | I386_GDTR_LIMIT, | |
| 157 | I386_IDTR_BASE, | |
| 158 | I386_IDTR_LIMIT, | |
| 159 | I386_TR, | |
| 160 | I386_TR_BASE, | |
| 161 | I386_TR_LIMIT, | |
| 162 | I386_TR_FLAGS, | |
| 163 | I386_LDTR, | |
| 164 | I386_LDTR_BASE, | |
| 165 | I386_LDTR_LIMIT, | |
| 166 | I386_LDTR_FLAGS, | |
| 167 | ||
| 168 | X87_CTRL, | |
| 169 | X87_STATUS, | |
| 170 | X87_ST0, | |
| 171 | X87_ST1, | |
| 172 | X87_ST2, | |
| 173 | X87_ST3, | |
| 174 | X87_ST4, | |
| 175 | X87_ST5, | |
| 176 | X87_ST6, | |
| 177 | X87_ST7, | |
| 178 | }; | |
| 179 | ||
| 180 | typedef struct { | |
| 181 | UINT16 selector; | |
| 182 | UINT16 flags; | |
| 183 | UINT32 base; | |
| 184 | UINT32 limit; | |
| 185 | int d; // Operand size | |
| 186 | } I386_SREG; | |
| 187 | ||
| 188 | typedef struct { | |
| 189 | UINT32 base; | |
| 190 | UINT16 limit; | |
| 191 | } I386_SYS_TABLE; | |
| 192 | ||
| 193 | typedef struct { | |
| 194 | UINT16 segment; | |
| 195 | UINT16 flags; | |
| 196 | UINT32 base; | |
| 197 | UINT32 limit; | |
| 198 | } I386_SEG_DESC; | |
| 199 | ||
| 200 | typedef union { | |
| 201 | UINT32 d[8]; | |
| 202 | UINT16 w[16]; | |
| 203 | UINT8 b[32]; | |
| 204 | } I386_GPR; | |
| 205 | ||
| 206 | typedef union { | |
| 207 | UINT64 i; | |
| 208 | double f; | |
| 209 | } X87_REG; | |
| 210 | ||
| 211 | typedef struct _i386_state i386_state; | |
| 212 | struct _i386_state | |
| 213 | { | |
| 214 | I386_GPR reg; | |
| 215 | I386_SREG sreg[6]; | |
| 216 | UINT32 eip; | |
| 217 | UINT32 pc; | |
| 218 | UINT32 prev_eip; | |
| 219 | UINT32 eflags; | |
| 220 | UINT8 CF; | |
| 221 | UINT8 DF; | |
| 222 | UINT8 SF; | |
| 223 | UINT8 OF; | |
| 224 | UINT8 ZF; | |
| 225 | UINT8 PF; | |
| 226 | UINT8 AF; | |
| 227 | UINT8 IF; | |
| 228 | UINT8 TF; | |
| 229 | ||
| 230 | UINT8 performed_intersegment_jump; | |
| 231 | ||
| 232 | UINT32 cr[4]; // Control registers | |
| 233 | UINT32 dr[8]; // Debug registers | |
| 234 | UINT32 tr[8]; // Test registers | |
| 235 | ||
| 236 | I386_SYS_TABLE gdtr; // Global Descriptor Table Register | |
| 237 | I386_SYS_TABLE idtr; // Interrupt Descriptor Table Register | |
| 238 | I386_SEG_DESC task; // Task register | |
| 239 | I386_SEG_DESC ldtr; // Local Descriptor Table Register | |
| 240 | ||
| 241 | int halted; | |
| 242 | ||
| 243 | int operand_size; | |
| 244 | int address_size; | |
| 245 | ||
| 246 | int segment_prefix; | |
| 247 | int segment_override; | |
| 248 | ||
| 249 | int cycles; | |
| 250 | int base_cycles; | |
| 251 | UINT8 opcode; | |
| 252 | ||
| 253 | UINT8 irq_state; | |
| 254 | cpu_irq_callback irq_callback; | |
| 255 | const device_config *device; | |
| 256 | const address_space *program; | |
| 257 | const address_space *io; | |
| 258 | UINT32 a20_mask; | |
| 259 | ||
| 260 | int cpuid_max_input_value_eax; | |
| 261 | UINT32 cpuid_id0, cpuid_id1, cpuid_id2; | |
| 262 | UINT32 cpu_version; | |
| 263 | UINT32 feature_flags; | |
| 264 | UINT64 tsc; | |
| 265 | ||
| 266 | // FPU | |
| 267 | X87_REG fpu_reg[8]; | |
| 268 | UINT16 fpu_control_word; | |
| 269 | UINT16 fpu_status_word; | |
| 270 | UINT16 fpu_tag_word; | |
| 271 | UINT64 fpu_data_ptr; | |
| 272 | UINT64 fpu_inst_ptr; | |
| 273 | UINT16 fpu_opcode; | |
| 274 | int fpu_top; | |
| 275 | ||
| 276 | void (*opcode_table1_16[256])(i386_state *cpustate); | |
| 277 | void (*opcode_table1_32[256])(i386_state *cpustate); | |
| 278 | void (*opcode_table2_16[256])(i386_state *cpustate); | |
| 279 | void (*opcode_table2_32[256])(i386_state *cpustate); | |
| 280 | ||
| 281 | UINT8 *cycle_table_pm; | |
| 282 | UINT8 *cycle_table_rm; | |
| 283 | }; | |
| 284 | ||
| 285 | ||
| 286 | extern int i386_parity_table[256]; | |
| 287 | ||
| 288 | #define PROTECTED_MODE (cpustate->cr[0] & 0x1) | |
| 289 | #define STACK_32BIT (cpustate->sreg[SS].d) | |
| 290 | #define V8086_MODE (cpustate->eflags & 0x00020000) | |
| 291 | ||
| 292 | #define SetOF_Add32(r,s,d) (cpustate->OF = (((r) ^ (s)) & ((r) ^ (d)) & 0x80000000) ? 1: 0) | |
| 293 | #define SetOF_Add16(r,s,d) (cpustate->OF = (((r) ^ (s)) & ((r) ^ (d)) & 0x8000) ? 1 : 0) | |
| 294 | #define SetOF_Add8(r,s,d) (cpustate->OF = (((r) ^ (s)) & ((r) ^ (d)) & 0x80) ? 1 : 0) | |
| 295 | ||
| 296 | #define SetOF_Sub32(r,s,d) (cpustate->OF = (((d) ^ (s)) & ((d) ^ (r)) & 0x80000000) ? 1 : 0) | |
| 297 | #define SetOF_Sub16(r,s,d) (cpustate->OF = (((d) ^ (s)) & ((d) ^ (r)) & 0x8000) ? 1 : 0) | |
| 298 | #define SetOF_Sub8(r,s,d) (cpustate->OF = (((d) ^ (s)) & ((d) ^ (r)) & 0x80) ? 1 : 0) | |
| 299 | ||
| 300 | #define SetCF8(x) {cpustate->CF = ((x) & 0x100) ? 1 : 0; } | |
| 301 | #define SetCF16(x) {cpustate->CF = ((x) & 0x10000) ? 1 : 0; } | |
| 302 | #define SetCF32(x) {cpustate->CF = ((x) & (((UINT64)1) << 32)) ? 1 : 0; } | |
| 303 | ||
| 304 | #define SetSF(x) (cpustate->SF = (x)) | |
| 305 | #define SetZF(x) (cpustate->ZF = (x)) | |
| 306 | #define SetAF(x,y,z) (cpustate->AF = (((x) ^ ((y) ^ (z))) & 0x10) ? 1 : 0) | |
| 307 | #define SetPF(x) (cpustate->PF = i386_parity_table[(x) & 0xFF]) | |
| 308 | ||
| 309 | #define SetSZPF8(x) {cpustate->ZF = ((UINT8)(x)==0); cpustate->SF = ((x)&0x80) ? 1 : 0; cpustate->PF = i386_parity_table[x & 0xFF]; } | |
| 310 | #define SetSZPF16(x) {cpustate->ZF = ((UINT16)(x)==0); cpustate->SF = ((x)&0x8000) ? 1 : 0; cpustate->PF = i386_parity_table[x & 0xFF]; } | |
| 311 | #define SetSZPF32(x) {cpustate->ZF = ((UINT32)(x)==0); cpustate->SF = ((x)&0x80000000) ? 1 : 0; cpustate->PF = i386_parity_table[x & 0xFF]; } | |
| 312 | ||
| 313 | /***********************************************************************************/ | |
| 314 | ||
| 315 | typedef struct { | |
| 316 | struct { | |
| 317 | int b; | |
| 318 | int w; | |
| 319 | int d; | |
| 320 | } reg; | |
| 321 | struct { | |
| 322 | int b; | |
| 323 | int w; | |
| 324 | int d; | |
| 325 | } rm; | |
| 326 | } MODRM_TABLE; | |
| 327 | ||
| 328 | extern MODRM_TABLE i386_MODRM_table[256]; | |
| 329 | ||
| 330 | #define REG8(x) (cpustate->reg.b[x]) | |
| 331 | #define REG16(x) (cpustate->reg.w[x]) | |
| 332 | #define REG32(x) (cpustate->reg.d[x]) | |
| 333 | ||
| 334 | #define LOAD_REG8(x) (REG8(i386_MODRM_table[x].reg.b)) | |
| 335 | #define LOAD_REG16(x) (REG16(i386_MODRM_table[x].reg.w)) | |
| 336 | #define LOAD_REG32(x) (REG32(i386_MODRM_table[x].reg.d)) | |
| 337 | #define LOAD_RM8(x) (REG8(i386_MODRM_table[x].rm.b)) | |
| 338 | #define LOAD_RM16(x) (REG16(i386_MODRM_table[x].rm.w)) | |
| 339 | #define LOAD_RM32(x) (REG32(i386_MODRM_table[x].rm.d)) | |
| 340 | ||
| 341 | #define STORE_REG8(x, value) (REG8(i386_MODRM_table[x].reg.b) = value) | |
| 342 | #define STORE_REG16(x, value) (REG16(i386_MODRM_table[x].reg.w) = value) | |
| 343 | #define STORE_REG32(x, value) (REG32(i386_MODRM_table[x].reg.d) = value) | |
| 344 | #define STORE_RM8(x, value) (REG8(i386_MODRM_table[x].rm.b) = value) | |
| 345 | #define STORE_RM16(x, value) (REG16(i386_MODRM_table[x].rm.w) = value) | |
| 346 | #define STORE_RM32(x, value) (REG32(i386_MODRM_table[x].rm.d) = value) | |
| 347 | ||
| 348 | /***********************************************************************************/ | |
| 349 | ||
| 350 | INLINE UINT32 i386_translate(i386_state *cpustate, int segment, UINT32 ip) | |
| 351 | { | |
| 352 | // TODO: segment limit | |
| 353 | return cpustate->sreg[segment].base + ip; | |
| 354 | } | |
| 355 | ||
| 356 | INLINE int translate_address(i386_state *cpustate, UINT32 *address) | |
| 357 | { | |
| 358 | UINT32 a = *address; | |
| 359 | UINT32 pdbr = cpustate->cr[3] & 0xfffff000; | |
| 360 | UINT32 directory = (a >> 22) & 0x3ff; | |
| 361 | UINT32 table = (a >> 12) & 0x3ff; | |
| 362 | UINT32 offset = a & 0xfff; | |
| 363 | ||
| 364 | // TODO: 4MB pages | |
| 365 | UINT32 page_dir = memory_read_dword_32le(cpustate->program, pdbr + directory * 4); | |
| 366 | UINT32 page_entry = memory_read_dword_32le(cpustate->program, (page_dir & 0xfffff000) + (table * 4)); | |
| 367 | ||
| 368 | *address = (page_entry & 0xfffff000) | offset; | |
| 369 | return 1; | |
| 370 | } | |
| 371 | ||
| 372 | INLINE void CHANGE_PC(i386_state *cpustate, UINT32 pc) | |
| 373 | { | |
| 374 | UINT32 address; | |
| 375 | cpustate->pc = i386_translate(cpustate, CS, pc ); | |
| 376 | ||
| 377 | address = cpustate->pc; | |
| 378 | ||
| 379 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 380 | { | |
| 381 | translate_address(cpustate,&address); | |
| 382 | } | |
| 383 | } | |
| 384 | ||
| 385 | INLINE void NEAR_BRANCH(i386_state *cpustate, INT32 offs) | |
| 386 | { | |
| 387 | UINT32 address; | |
| 388 | /* TODO: limit */ | |
| 389 | cpustate->eip += offs; | |
| 390 | cpustate->pc += offs; | |
| 391 | ||
| 392 | address = cpustate->pc; | |
| 393 | ||
| 394 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 395 | { | |
| 396 | translate_address(cpustate,&address); | |
| 397 | } | |
| 398 | } | |
| 399 | ||
| 400 | INLINE UINT8 FETCH(i386_state *cpustate) | |
| 401 | { | |
| 402 | UINT8 value; | |
| 403 | UINT32 address = cpustate->pc; | |
| 404 | ||
| 405 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 406 | { | |
| 407 | translate_address(cpustate,&address); | |
| 408 | } | |
| 409 | ||
| 410 | value = memory_decrypted_read_byte(cpustate->program, address & cpustate->a20_mask); | |
| 411 | cpustate->eip++; | |
| 412 | cpustate->pc++; | |
| 413 | return value; | |
| 414 | } | |
| 415 | INLINE UINT16 FETCH16(i386_state *cpustate) | |
| 416 | { | |
| 417 | UINT16 value; | |
| 418 | UINT32 address = cpustate->pc; | |
| 419 | ||
| 420 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 421 | { | |
| 422 | translate_address(cpustate,&address); | |
| 423 | } | |
| 424 | ||
| 425 | if( address & 0x1 ) { /* Unaligned read */ | |
| 426 | address &= cpustate->a20_mask; | |
| 427 | value = (memory_decrypted_read_byte(cpustate->program, address+0) << 0) | | |
| 428 | (memory_decrypted_read_byte(cpustate->program, address+1) << 8); | |
| 429 | } else { | |
| 430 | address &= cpustate->a20_mask; | |
| 431 | value = memory_decrypted_read_word(cpustate->program, address); | |
| 432 | } | |
| 433 | cpustate->eip += 2; | |
| 434 | cpustate->pc += 2; | |
| 435 | return value; | |
| 436 | } | |
| 437 | INLINE UINT32 FETCH32(i386_state *cpustate) | |
| 438 | { | |
| 439 | UINT32 value; | |
| 440 | UINT32 address = cpustate->pc; | |
| 441 | ||
| 442 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 443 | { | |
| 444 | translate_address(cpustate,&address); | |
| 445 | } | |
| 446 | ||
| 447 | if( cpustate->pc & 0x3 ) { /* Unaligned read */ | |
| 448 | address &= cpustate->a20_mask; | |
| 449 | value = (memory_decrypted_read_byte(cpustate->program, address+0) << 0) | | |
| 450 | (memory_decrypted_read_byte(cpustate->program, address+1) << 8) | | |
| 451 | (memory_decrypted_read_byte(cpustate->program, address+2) << 16) | | |
| 452 | (memory_decrypted_read_byte(cpustate->program, address+3) << 24); | |
| 453 | } else { | |
| 454 | address &= cpustate->a20_mask; | |
| 455 | value = memory_decrypted_read_dword(cpustate->program, address); | |
| 456 | } | |
| 457 | cpustate->eip += 4; | |
| 458 | cpustate->pc += 4; | |
| 459 | return value; | |
| 460 | } | |
| 461 | ||
| 462 | INLINE UINT8 READ8(i386_state *cpustate,UINT32 ea) | |
| 463 | { | |
| 464 | UINT32 address = ea; | |
| 465 | ||
| 466 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 467 | { | |
| 468 | translate_address(cpustate,&address); | |
| 469 | } | |
| 470 | ||
| 471 | address &= cpustate->a20_mask; | |
| 472 | return memory_read_byte_32le(cpustate->program, address); | |
| 473 | } | |
| 474 | INLINE UINT16 READ16(i386_state *cpustate,UINT32 ea) | |
| 475 | { | |
| 476 | UINT16 value; | |
| 477 | UINT32 address = ea; | |
| 478 | ||
| 479 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 480 | { | |
| 481 | translate_address(cpustate,&address); | |
| 482 | } | |
| 483 | ||
| 484 | address &= cpustate->a20_mask; | |
| 485 | if( ea & 0x1 ) { /* Unaligned read */ | |
| 486 | value = (memory_read_byte_32le( cpustate->program, address+0 ) << 0) | | |
| 487 | (memory_read_byte_32le( cpustate->program, address+1 ) << 8); | |
| 488 | } else { | |
| 489 | value = memory_read_word_32le( cpustate->program, address ); | |
| 490 | } | |
| 491 | return value; | |
| 492 | } | |
| 493 | INLINE UINT32 READ32(i386_state *cpustate,UINT32 ea) | |
| 494 | { | |
| 495 | UINT32 value; | |
| 496 | UINT32 address = ea; | |
| 497 | ||
| 498 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 499 | { | |
| 500 | translate_address(cpustate,&address); | |
| 501 | } | |
| 502 | ||
| 503 | address &= cpustate->a20_mask; | |
| 504 | if( ea & 0x3 ) { /* Unaligned read */ | |
| 505 | value = (memory_read_byte_32le( cpustate->program, address+0 ) << 0) | | |
| 506 | (memory_read_byte_32le( cpustate->program, address+1 ) << 8) | | |
| 507 | (memory_read_byte_32le( cpustate->program, address+2 ) << 16) | | |
| 508 | (memory_read_byte_32le( cpustate->program, address+3 ) << 24); | |
| 509 | } else { | |
| 510 | value = memory_read_dword_32le( cpustate->program, address ); | |
| 511 | } | |
| 512 | return value; | |
| 513 | } | |
| 514 | ||
| 515 | INLINE UINT64 READ64(i386_state *cpustate,UINT32 ea) | |
| 516 | { | |
| 517 | UINT64 value; | |
| 518 | UINT32 address = ea; | |
| 519 | ||
| 520 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 521 | { | |
| 522 | translate_address(cpustate,&address); | |
| 523 | } | |
| 524 | ||
| 525 | address &= cpustate->a20_mask; | |
| 526 | if( ea & 0x7 ) { /* Unaligned read */ | |
| 527 | value = (((UINT64) memory_read_byte_32le( cpustate->program, address+0 )) << 0) | | |
| 528 | (((UINT64) memory_read_byte_32le( cpustate->program, address+1 )) << 8) | | |
| 529 | (((UINT64) memory_read_byte_32le( cpustate->program, address+2 )) << 16) | | |
| 530 | (((UINT64) memory_read_byte_32le( cpustate->program, address+3 )) << 24) | | |
| 531 | (((UINT64) memory_read_byte_32le( cpustate->program, address+4 )) << 32) | | |
| 532 | (((UINT64) memory_read_byte_32le( cpustate->program, address+5 )) << 40) | | |
| 533 | (((UINT64) memory_read_byte_32le( cpustate->program, address+6 )) << 48) | | |
| 534 | (((UINT64) memory_read_byte_32le( cpustate->program, address+7 )) << 56); | |
| 535 | } else { | |
| 536 | value = (((UINT64) memory_read_dword_32le( cpustate->program, address+0 )) << 0) | | |
| 537 | (((UINT64) memory_read_dword_32le( cpustate->program, address+4 )) << 32); | |
| 538 | } | |
| 539 | return value; | |
| 540 | } | |
| 541 | ||
| 542 | INLINE void WRITE8(i386_state *cpustate,UINT32 ea, UINT8 value) | |
| 543 | { | |
| 544 | UINT32 address = ea; | |
| 545 | ||
| 546 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 547 | { | |
| 548 | translate_address(cpustate,&address); | |
| 549 | } | |
| 550 | ||
| 551 | address &= cpustate->a20_mask; | |
| 552 | memory_write_byte_32le(cpustate->program, address, value); | |
| 553 | } | |
| 554 | INLINE void WRITE16(i386_state *cpustate,UINT32 ea, UINT16 value) | |
| 555 | { | |
| 556 | UINT32 address = ea; | |
| 557 | ||
| 558 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 559 | { | |
| 560 | translate_address(cpustate,&address); | |
| 561 | } | |
| 562 | ||
| 563 | address &= cpustate->a20_mask; | |
| 564 | if( ea & 0x1 ) { /* Unaligned write */ | |
| 565 | memory_write_byte_32le( cpustate->program, address+0, value & 0xff ); | |
| 566 | memory_write_byte_32le( cpustate->program, address+1, (value >> 8) & 0xff ); | |
| 567 | } else { | |
| 568 | memory_write_word_32le(cpustate->program, address, value); | |
| 569 | } | |
| 570 | } | |
| 571 | INLINE void WRITE32(i386_state *cpustate,UINT32 ea, UINT32 value) | |
| 572 | { | |
| 573 | UINT32 address = ea; | |
| 574 | ||
| 575 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 576 | { | |
| 577 | translate_address(cpustate,&address); | |
| 578 | } | |
| 579 | ||
| 580 | ea &= cpustate->a20_mask; | |
| 581 | if( ea & 0x3 ) { /* Unaligned write */ | |
| 582 | memory_write_byte_32le( cpustate->program, address+0, value & 0xff ); | |
| 583 | memory_write_byte_32le( cpustate->program, address+1, (value >> 8) & 0xff ); | |
| 584 | memory_write_byte_32le( cpustate->program, address+2, (value >> 16) & 0xff ); | |
| 585 | memory_write_byte_32le( cpustate->program, address+3, (value >> 24) & 0xff ); | |
| 586 | } else { | |
| 587 | memory_write_dword_32le(cpustate->program, address, value); | |
| 588 | } | |
| 589 | } | |
| 590 | ||
| 591 | INLINE void WRITE64(i386_state *cpustate,UINT32 ea, UINT64 value) | |
| 592 | { | |
| 593 | UINT32 address = ea; | |
| 594 | ||
| 595 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 596 | { | |
| 597 | translate_address(cpustate,&address); | |
| 598 | } | |
| 599 | ||
| 600 | ea &= cpustate->a20_mask; | |
| 601 | if( ea & 0x7 ) { /* Unaligned write */ | |
| 602 | memory_write_byte_32le( cpustate->program, address+0, value & 0xff ); | |
| 603 | memory_write_byte_32le( cpustate->program, address+1, (value >> 8) & 0xff ); | |
| 604 | memory_write_byte_32le( cpustate->program, address+2, (value >> 16) & 0xff ); | |
| 605 | memory_write_byte_32le( cpustate->program, address+3, (value >> 24) & 0xff ); | |
| 606 | memory_write_byte_32le( cpustate->program, address+4, (value >> 32) & 0xff ); | |
| 607 | memory_write_byte_32le( cpustate->program, address+5, (value >> 40) & 0xff ); | |
| 608 | memory_write_byte_32le( cpustate->program, address+6, (value >> 48) & 0xff ); | |
| 609 | memory_write_byte_32le( cpustate->program, address+7, (value >> 56) & 0xff ); | |
| 610 | } else { | |
| 611 | memory_write_dword_32le(cpustate->program, address+0, value & 0xffffffff); | |
| 612 | memory_write_dword_32le(cpustate->program, address+4, (value >> 32) & 0xffffffff); | |
| 613 | } | |
| 614 | } | |
| 615 | ||
| 616 | /***********************************************************************************/ | |
| 617 | ||
| 618 | INLINE UINT8 OR8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 619 | { | |
| 620 | UINT8 res = dst | src; | |
| 621 | cpustate->CF = cpustate->OF = 0; | |
| 622 | SetSZPF8(res); | |
| 623 | return res; | |
| 624 | } | |
| 625 | INLINE UINT16 OR16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 626 | { | |
| 627 | UINT16 res = dst | src; | |
| 628 | cpustate->CF = cpustate->OF = 0; | |
| 629 | SetSZPF16(res); | |
| 630 | return res; | |
| 631 | } | |
| 632 | INLINE UINT32 OR32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 633 | { | |
| 634 | UINT32 res = dst | src; | |
| 635 | cpustate->CF = cpustate->OF = 0; | |
| 636 | SetSZPF32(res); | |
| 637 | return res; | |
| 638 | } | |
| 639 | ||
| 640 | INLINE UINT8 AND8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 641 | { | |
| 642 | UINT8 res = dst & src; | |
| 643 | cpustate->CF = cpustate->OF = 0; | |
| 644 | SetSZPF8(res); | |
| 645 | return res; | |
| 646 | } | |
| 647 | INLINE UINT16 AND16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 648 | { | |
| 649 | UINT16 res = dst & src; | |
| 650 | cpustate->CF = cpustate->OF = 0; | |
| 651 | SetSZPF16(res); | |
| 652 | return res; | |
| 653 | } | |
| 654 | INLINE UINT32 AND32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 655 | { | |
| 656 | UINT32 res = dst & src; | |
| 657 | cpustate->CF = cpustate->OF = 0; | |
| 658 | SetSZPF32(res); | |
| 659 | return res; | |
| 660 | } | |
| 661 | ||
| 662 | INLINE UINT8 XOR8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 663 | { | |
| 664 | UINT8 res = dst ^ src; | |
| 665 | cpustate->CF = cpustate->OF = 0; | |
| 666 | SetSZPF8(res); | |
| 667 | return res; | |
| 668 | } | |
| 669 | INLINE UINT16 XOR16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 670 | { | |
| 671 | UINT16 res = dst ^ src; | |
| 672 | cpustate->CF = cpustate->OF = 0; | |
| 673 | SetSZPF16(res); | |
| 674 | return res; | |
| 675 | } | |
| 676 | INLINE UINT32 XOR32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 677 | { | |
| 678 | UINT32 res = dst ^ src; | |
| 679 | cpustate->CF = cpustate->OF = 0; | |
| 680 | SetSZPF32(res); | |
| 681 | return res; | |
| 682 | } | |
| 683 | ||
| 684 | INLINE UINT8 SUB8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 685 | { | |
| 686 | UINT16 res = (UINT16)dst - (UINT16)src; | |
| 687 | SetCF8(res); | |
| 688 | SetOF_Sub8(res,src,dst); | |
| 689 | SetAF(res,src,dst); | |
| 690 | SetSZPF8(res); | |
| 691 | return (UINT8)res; | |
| 692 | } | |
| 693 | INLINE UINT16 SUB16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 694 | { | |
| 695 | UINT32 res = (UINT32)dst - (UINT32)src; | |
| 696 | SetCF16(res); | |
| 697 | SetOF_Sub16(res,src,dst); | |
| 698 | SetAF(res,src,dst); | |
| 699 | SetSZPF16(res); | |
| 700 | return (UINT16)res; | |
| 701 | } | |
| 702 | INLINE UINT32 SUB32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 703 | { | |
| 704 | UINT64 res = (UINT64)dst - (UINT64)src; | |
| 705 | SetCF32(res); | |
| 706 | SetOF_Sub32(res,src,dst); | |
| 707 | SetAF(res,src,dst); | |
| 708 | SetSZPF32(res); | |
| 709 | return (UINT32)res; | |
| 710 | } | |
| 711 | ||
| 712 | INLINE UINT8 ADD8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 713 | { | |
| 714 | UINT16 res = (UINT16)dst + (UINT16)src; | |
| 715 | SetCF8(res); | |
| 716 | SetOF_Add8(res,src,dst); | |
| 717 | SetAF(res,src,dst); | |
| 718 | SetSZPF8(res); | |
| 719 | return (UINT8)res; | |
| 720 | } | |
| 721 | INLINE UINT16 ADD16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 722 | { | |
| 723 | UINT32 res = (UINT32)dst + (UINT32)src; | |
| 724 | SetCF16(res); | |
| 725 | SetOF_Add16(res,src,dst); | |
| 726 | SetAF(res,src,dst); | |
| 727 | SetSZPF16(res); | |
| 728 | return (UINT16)res; | |
| 729 | } | |
| 730 | INLINE UINT32 ADD32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 731 | { | |
| 732 | UINT64 res = (UINT64)dst + (UINT64)src; | |
| 733 | SetCF32(res); | |
| 734 | SetOF_Add32(res,src,dst); | |
| 735 | SetAF(res,src,dst); | |
| 736 | SetSZPF32(res); | |
| 737 | return (UINT32)res; | |
| 738 | } | |
| 739 | ||
| 740 | INLINE UINT8 INC8(i386_state *cpustate,UINT8 dst) | |
| 741 | { | |
| 742 | UINT16 res = (UINT16)dst + 1; | |
| 743 | SetOF_Add8(res,1,dst); | |
| 744 | SetAF(res,1,dst); | |
| 745 | SetSZPF8(res); | |
| 746 | return (UINT8)res; | |
| 747 | } | |
| 748 | INLINE UINT16 INC16(i386_state *cpustate,UINT16 dst) | |
| 749 | { | |
| 750 | UINT32 res = (UINT32)dst + 1; | |
| 751 | SetOF_Add16(res,1,dst); | |
| 752 | SetAF(res,1,dst); | |
| 753 | SetSZPF16(res); | |
| 754 | return (UINT16)res; | |
| 755 | } | |
| 756 | INLINE UINT32 INC32(i386_state *cpustate,UINT32 dst) | |
| 757 | { | |
| 758 | UINT64 res = (UINT64)dst + 1; | |
| 759 | SetOF_Add32(res,1,dst); | |
| 760 | SetAF(res,1,dst); | |
| 761 | SetSZPF32(res); | |
| 762 | return (UINT32)res; | |
| 763 | } | |
| 764 | ||
| 765 | INLINE UINT8 DEC8(i386_state *cpustate,UINT8 dst) | |
| 766 | { | |
| 767 | UINT16 res = (UINT16)dst - 1; | |
| 768 | SetOF_Sub8(res,1,dst); | |
| 769 | SetAF(res,1,dst); | |
| 770 | SetSZPF8(res); | |
| 771 | return (UINT8)res; | |
| 772 | } | |
| 773 | INLINE UINT16 DEC16(i386_state *cpustate,UINT16 dst) | |
| 774 | { | |
| 775 | UINT32 res = (UINT32)dst - 1; | |
| 776 | SetOF_Sub16(res,1,dst); | |
| 777 | SetAF(res,1,dst); | |
| 778 | SetSZPF16(res); | |
| 779 | return (UINT16)res; | |
| 780 | } | |
| 781 | INLINE UINT32 DEC32(i386_state *cpustate,UINT32 dst) | |
| 782 | { | |
| 783 | UINT64 res = (UINT64)dst - 1; | |
| 784 | SetOF_Sub32(res,1,dst); | |
| 785 | SetAF(res,1,dst); | |
| 786 | SetSZPF32(res); | |
| 787 | return (UINT32)res; | |
| 788 | } | |
| 789 | ||
| 790 | ||
| 791 | ||
| 792 | INLINE void PUSH16(i386_state *cpustate,UINT16 value) | |
| 793 | { | |
| 794 | UINT32 ea; | |
| 795 | if( STACK_32BIT ) { | |
| 796 | REG32(ESP) -= 2; | |
| 797 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 798 | WRITE16(cpustate, ea, value ); | |
| 799 | } else { | |
| 800 | REG16(SP) -= 2; | |
| 801 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 802 | WRITE16(cpustate, ea, value ); | |
| 803 | } | |
| 804 | } | |
| 805 | INLINE void PUSH32(i386_state *cpustate,UINT32 value) | |
| 806 | { | |
| 807 | UINT32 ea; | |
| 808 | if( STACK_32BIT ) { | |
| 809 | REG32(ESP) -= 4; | |
| 810 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 811 | WRITE32(cpustate, ea, value ); | |
| 812 | } else { | |
| 813 | REG16(SP) -= 4; | |
| 814 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 815 | WRITE32(cpustate, ea, value ); | |
| 816 | } | |
| 817 | } | |
| 818 | INLINE void PUSH8(i386_state *cpustate,UINT8 value) | |
| 819 | { | |
| 820 | if( cpustate->operand_size ) { | |
| 821 | PUSH32(cpustate,(INT32)(INT8)value); | |
| 822 | } else { | |
| 823 | PUSH16(cpustate,(INT16)(INT8)value); | |
| 824 | } | |
| 825 | } | |
| 826 | ||
| 827 | INLINE UINT8 POP8(i386_state *cpustate) | |
| 828 | { | |
| 829 | UINT8 value; | |
| 830 | UINT32 ea; | |
| 831 | if( STACK_32BIT ) { | |
| 832 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 833 | value = READ8(cpustate, ea ); | |
| 834 | REG32(ESP) += 1; | |
| 835 | } else { | |
| 836 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 837 | value = READ8(cpustate, ea ); | |
| 838 | REG16(SP) += 1; | |
| 839 | } | |
| 840 | return value; | |
| 841 | } | |
| 842 | INLINE UINT16 POP16(i386_state *cpustate) | |
| 843 | { | |
| 844 | UINT16 value; | |
| 845 | UINT32 ea; | |
| 846 | if( STACK_32BIT ) { | |
| 847 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 848 | value = READ16(cpustate, ea ); | |
| 849 | REG32(ESP) += 2; | |
| 850 | } else { | |
| 851 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 852 | value = READ16(cpustate, ea ); | |
| 853 | REG16(SP) += 2; | |
| 854 | } | |
| 855 | return value; | |
| 856 | } | |
| 857 | INLINE UINT32 POP32(i386_state *cpustate) | |
| 858 | { | |
| 859 | UINT32 value; | |
| 860 | UINT32 ea; | |
| 861 | if( STACK_32BIT ) { | |
| 862 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 863 | value = READ32(cpustate, ea ); | |
| 864 | REG32(ESP) += 4; | |
| 865 | } else { | |
| 866 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 867 | value = READ32(cpustate, ea ); | |
| 868 | REG16(SP) += 4; | |
| 869 | } | |
| 870 | return value; | |
| 871 | } | |
| 872 | ||
| 873 | INLINE void BUMP_SI(i386_state *cpustate,int adjustment) | |
| 874 | { | |
| 875 | if ( cpustate->address_size ) | |
| 876 | REG32(ESI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 877 | else | |
| 878 | REG16(SI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 879 | } | |
| 880 | ||
| 881 | INLINE void BUMP_DI(i386_state *cpustate,int adjustment) | |
| 882 | { | |
| 883 | if ( cpustate->address_size ) | |
| 884 | REG32(EDI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 885 | else | |
| 886 | REG16(DI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 887 | } | |
| 888 | ||
| 889 | ||
| 890 | ||
| 891 | /***********************************************************************************/ | |
| 892 | ||
| 893 | #define READPORT8(port) (memory_read_byte_32le(cpustate->io, port)) | |
| 894 | #define READPORT16(port) (memory_read_word_32le(cpustate->io, port)) | |
| 895 | #define READPORT32(port) (memory_read_dword_32le(cpustate->io, port)) | |
| 896 | #define WRITEPORT8(port, value) (memory_write_byte_32le(cpustate->io, port, value)) | |
| 897 | #define WRITEPORT16(port, value) (memory_write_word_32le(cpustate->io, port, value)) | |
| 898 | #define WRITEPORT32(port, value) (memory_write_dword_32le(cpustate->io, port, value)) | |
| 899 | ||
| 900 | #endif /* __I386_H__ */ | |
| 25 | #endif /* __I386INTF_H__ */ |
| r0 | r3958 | |
|---|---|---|
| 1 | #pragma once | |
| 2 | ||
| 3 | #ifndef __I386_H__ | |
| 4 | #define __I386_H__ | |
| 5 | ||
| 6 | #include "cpuintrf.h" | |
| 7 | ||
| 8 | #define I386OP(XX) i386_##XX | |
| 9 | #define I486OP(XX) i486_##XX | |
| 10 | #define PENTIUMOP(XX) pentium_##XX | |
| 11 | #define MMXOP(XX) mmx_##XX | |
| 12 | ||
| 13 | extern int i386_dasm_one(char *buffer, UINT32 pc, const UINT8 *oprom, int mode); | |
| 14 | ||
| 15 | typedef enum { ES, CS, SS, DS, FS, GS } SREGS; | |
| 16 | ||
| 17 | #ifdef LSB_FIRST | |
| 18 | typedef enum | |
| 19 | { | |
| 20 | AL = 0, | |
| 21 | AH = 1, | |
| 22 | CL = 4, | |
| 23 | CH = 5, | |
| 24 | DL = 8, | |
| 25 | DH = 9, | |
| 26 | BL = 12, | |
| 27 | BH = 13 | |
| 28 | } BREGS; | |
| 29 | #else | |
| 30 | typedef enum | |
| 31 | { | |
| 32 | AL = 3, | |
| 33 | AH = 2, | |
| 34 | CL = 7, | |
| 35 | CH = 6, | |
| 36 | DL = 11, | |
| 37 | DH = 10, | |
| 38 | BL = 15, | |
| 39 | BH = 14 | |
| 40 | } BREGS; | |
| 41 | #endif | |
| 42 | ||
| 43 | #ifdef LSB_FIRST | |
| 44 | typedef enum | |
| 45 | { | |
| 46 | AX = 0, | |
| 47 | CX = 2, | |
| 48 | DX = 4, | |
| 49 | BX = 6, | |
| 50 | SP = 8, | |
| 51 | BP = 10, | |
| 52 | SI = 12, | |
| 53 | DI = 14 | |
| 54 | } WREGS; | |
| 55 | #else | |
| 56 | typedef enum | |
| 57 | { | |
| 58 | AX = 1, | |
| 59 | CX = 3, | |
| 60 | DX = 5, | |
| 61 | BX = 7, | |
| 62 | SP = 9, | |
| 63 | BP = 11, | |
| 64 | SI = 13, | |
| 65 | DI = 15 | |
| 66 | } WREGS; | |
| 67 | #endif | |
| 68 | ||
| 69 | typedef enum { EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI } DREGS; | |
| 70 | ||
| 71 | enum | |
| 72 | { | |
| 73 | I386_PC = 0, | |
| 74 | ||
| 75 | /* 8-bit registers */ | |
| 76 | I386_AL, | |
| 77 | I386_AH, | |
| 78 | I386_BL, | |
| 79 | I386_BH, | |
| 80 | I386_CL, | |
| 81 | I386_CH, | |
| 82 | I386_DL, | |
| 83 | I386_DH, | |
| 84 | ||
| 85 | /* 16-bit registers */ | |
| 86 | I386_AX, | |
| 87 | I386_BX, | |
| 88 | I386_CX, | |
| 89 | I386_DX, | |
| 90 | I386_BP, | |
| 91 | I386_SP, | |
| 92 | I386_SI, | |
| 93 | I386_DI, | |
| 94 | I386_IP, | |
| 95 | ||
| 96 | /* 32-bit registers */ | |
| 97 | I386_EAX, | |
| 98 | I386_ECX, | |
| 99 | I386_EDX, | |
| 100 | I386_EBX, | |
| 101 | I386_EBP, | |
| 102 | I386_ESP, | |
| 103 | I386_ESI, | |
| 104 | I386_EDI, | |
| 105 | I386_EIP, | |
| 106 | ||
| 107 | /* segment registers */ | |
| 108 | I386_CS, | |
| 109 | I386_CS_BASE, | |
| 110 | I386_CS_LIMIT, | |
| 111 | I386_CS_FLAGS, | |
| 112 | I386_SS, | |
| 113 | I386_SS_BASE, | |
| 114 | I386_SS_LIMIT, | |
| 115 | I386_SS_FLAGS, | |
| 116 | I386_DS, | |
| 117 | I386_DS_BASE, | |
| 118 | I386_DS_LIMIT, | |
| 119 | I386_DS_FLAGS, | |
| 120 | I386_ES, | |
| 121 | I386_ES_BASE, | |
| 122 | I386_ES_LIMIT, | |
| 123 | I386_ES_FLAGS, | |
| 124 | I386_FS, | |
| 125 | I386_FS_BASE, | |
| 126 | I386_FS_LIMIT, | |
| 127 | I386_FS_FLAGS, | |
| 128 | I386_GS, | |
| 129 | I386_GS_BASE, | |
| 130 | I386_GS_LIMIT, | |
| 131 | I386_GS_FLAGS, | |
| 132 | ||
| 133 | /* other */ | |
| 134 | I386_EFLAGS, | |
| 135 | ||
| 136 | I386_CR0, | |
| 137 | I386_CR1, | |
| 138 | I386_CR2, | |
| 139 | I386_CR3, | |
| 140 | ||
| 141 | I386_DR0, | |
| 142 | I386_DR1, | |
| 143 | I386_DR2, | |
| 144 | I386_DR3, | |
| 145 | I386_DR4, | |
| 146 | I386_DR5, | |
| 147 | I386_DR6, | |
| 148 | I386_DR7, | |
| 149 | ||
| 150 | I386_TR6, | |
| 151 | I386_TR7, | |
| 152 | ||
| 153 | I386_GDTR_BASE, | |
| 154 | I386_GDTR_LIMIT, | |
| 155 | I386_IDTR_BASE, | |
| 156 | I386_IDTR_LIMIT, | |
| 157 | I386_TR, | |
| 158 | I386_TR_BASE, | |
| 159 | I386_TR_LIMIT, | |
| 160 | I386_TR_FLAGS, | |
| 161 | I386_LDTR, | |
| 162 | I386_LDTR_BASE, | |
| 163 | I386_LDTR_LIMIT, | |
| 164 | I386_LDTR_FLAGS, | |
| 165 | ||
| 166 | X87_CTRL, | |
| 167 | X87_STATUS, | |
| 168 | X87_ST0, | |
| 169 | X87_ST1, | |
| 170 | X87_ST2, | |
| 171 | X87_ST3, | |
| 172 | X87_ST4, | |
| 173 | X87_ST5, | |
| 174 | X87_ST6, | |
| 175 | X87_ST7, | |
| 176 | }; | |
| 177 | ||
| 178 | typedef struct { | |
| 179 | UINT16 selector; | |
| 180 | UINT16 flags; | |
| 181 | UINT32 base; | |
| 182 | UINT32 limit; | |
| 183 | int d; // Operand size | |
| 184 | } I386_SREG; | |
| 185 | ||
| 186 | typedef struct { | |
| 187 | UINT32 base; | |
| 188 | UINT16 limit; | |
| 189 | } I386_SYS_TABLE; | |
| 190 | ||
| 191 | typedef struct { | |
| 192 | UINT16 segment; | |
| 193 | UINT16 flags; | |
| 194 | UINT32 base; | |
| 195 | UINT32 limit; | |
| 196 | } I386_SEG_DESC; | |
| 197 | ||
| 198 | typedef union { | |
| 199 | UINT32 d[8]; | |
| 200 | UINT16 w[16]; | |
| 201 | UINT8 b[32]; | |
| 202 | } I386_GPR; | |
| 203 | ||
| 204 | typedef union { | |
| 205 | UINT64 i; | |
| 206 | double f; | |
| 207 | } X87_REG; | |
| 208 | ||
| 209 | typedef struct _i386_state i386_state; | |
| 210 | struct _i386_state | |
| 211 | { | |
| 212 | I386_GPR reg; | |
| 213 | I386_SREG sreg[6]; | |
| 214 | UINT32 eip; | |
| 215 | UINT32 pc; | |
| 216 | UINT32 prev_eip; | |
| 217 | UINT32 eflags; | |
| 218 | UINT8 CF; | |
| 219 | UINT8 DF; | |
| 220 | UINT8 SF; | |
| 221 | UINT8 OF; | |
| 222 | UINT8 ZF; | |
| 223 | UINT8 PF; | |
| 224 | UINT8 AF; | |
| 225 | UINT8 IF; | |
| 226 | UINT8 TF; | |
| 227 | ||
| 228 | UINT8 performed_intersegment_jump; | |
| 229 | ||
| 230 | UINT32 cr[4]; // Control registers | |
| 231 | UINT32 dr[8]; // Debug registers | |
| 232 | UINT32 tr[8]; // Test registers | |
| 233 | ||
| 234 | I386_SYS_TABLE gdtr; // Global Descriptor Table Register | |
| 235 | I386_SYS_TABLE idtr; // Interrupt Descriptor Table Register | |
| 236 | I386_SEG_DESC task; // Task register | |
| 237 | I386_SEG_DESC ldtr; // Local Descriptor Table Register | |
| 238 | ||
| 239 | int halted; | |
| 240 | ||
| 241 | int operand_size; | |
| 242 | int address_size; | |
| 243 | ||
| 244 | int segment_prefix; | |
| 245 | int segment_override; | |
| 246 | ||
| 247 | int cycles; | |
| 248 | int base_cycles; | |
| 249 | UINT8 opcode; | |
| 250 | ||
| 251 | UINT8 irq_state; | |
| 252 | cpu_irq_callback irq_callback; | |
| 253 | const device_config *device; | |
| 254 | const address_space *program; | |
| 255 | const address_space *io; | |
| 256 | UINT32 a20_mask; | |
| 257 | ||
| 258 | int cpuid_max_input_value_eax; | |
| 259 | UINT32 cpuid_id0, cpuid_id1, cpuid_id2; | |
| 260 | UINT32 cpu_version; | |
| 261 | UINT32 feature_flags; | |
| 262 | UINT64 tsc; | |
| 263 | ||
| 264 | // FPU | |
| 265 | X87_REG fpu_reg[8]; | |
| 266 | UINT16 fpu_control_word; | |
| 267 | UINT16 fpu_status_word; | |
| 268 | UINT16 fpu_tag_word; | |
| 269 | UINT64 fpu_data_ptr; | |
| 270 | UINT64 fpu_inst_ptr; | |
| 271 | UINT16 fpu_opcode; | |
| 272 | int fpu_top; | |
| 273 | ||
| 274 | void (*opcode_table1_16[256])(i386_state *cpustate); | |
| 275 | void (*opcode_table1_32[256])(i386_state *cpustate); | |
| 276 | void (*opcode_table2_16[256])(i386_state *cpustate); | |
| 277 | void (*opcode_table2_32[256])(i386_state *cpustate); | |
| 278 | ||
| 279 | UINT8 *cycle_table_pm; | |
| 280 | UINT8 *cycle_table_rm; | |
| 281 | }; | |
| 282 | ||
| 283 | ||
| 284 | extern int i386_parity_table[256]; | |
| 285 | ||
| 286 | #define PROTECTED_MODE (cpustate->cr[0] & 0x1) | |
| 287 | #define STACK_32BIT (cpustate->sreg[SS].d) | |
| 288 | #define V8086_MODE (cpustate->eflags & 0x00020000) | |
| 289 | ||
| 290 | #define SetOF_Add32(r,s,d) (cpustate->OF = (((r) ^ (s)) & ((r) ^ (d)) & 0x80000000) ? 1: 0) | |
| 291 | #define SetOF_Add16(r,s,d) (cpustate->OF = (((r) ^ (s)) & ((r) ^ (d)) & 0x8000) ? 1 : 0) | |
| 292 | #define SetOF_Add8(r,s,d) (cpustate->OF = (((r) ^ (s)) & ((r) ^ (d)) & 0x80) ? 1 : 0) | |
| 293 | ||
| 294 | #define SetOF_Sub32(r,s,d) (cpustate->OF = (((d) ^ (s)) & ((d) ^ (r)) & 0x80000000) ? 1 : 0) | |
| 295 | #define SetOF_Sub16(r,s,d) (cpustate->OF = (((d) ^ (s)) & ((d) ^ (r)) & 0x8000) ? 1 : 0) | |
| 296 | #define SetOF_Sub8(r,s,d) (cpustate->OF = (((d) ^ (s)) & ((d) ^ (r)) & 0x80) ? 1 : 0) | |
| 297 | ||
| 298 | #define SetCF8(x) {cpustate->CF = ((x) & 0x100) ? 1 : 0; } | |
| 299 | #define SetCF16(x) {cpustate->CF = ((x) & 0x10000) ? 1 : 0; } | |
| 300 | #define SetCF32(x) {cpustate->CF = ((x) & (((UINT64)1) << 32)) ? 1 : 0; } | |
| 301 | ||
| 302 | #define SetSF(x) (cpustate->SF = (x)) | |
| 303 | #define SetZF(x) (cpustate->ZF = (x)) | |
| 304 | #define SetAF(x,y,z) (cpustate->AF = (((x) ^ ((y) ^ (z))) & 0x10) ? 1 : 0) | |
| 305 | #define SetPF(x) (cpustate->PF = i386_parity_table[(x) & 0xFF]) | |
| 306 | ||
| 307 | #define SetSZPF8(x) {cpustate->ZF = ((UINT8)(x)==0); cpustate->SF = ((x)&0x80) ? 1 : 0; cpustate->PF = i386_parity_table[x & 0xFF]; } | |
| 308 | #define SetSZPF16(x) {cpustate->ZF = ((UINT16)(x)==0); cpustate->SF = ((x)&0x8000) ? 1 : 0; cpustate->PF = i386_parity_table[x & 0xFF]; } | |
| 309 | #define SetSZPF32(x) {cpustate->ZF = ((UINT32)(x)==0); cpustate->SF = ((x)&0x80000000) ? 1 : 0; cpustate->PF = i386_parity_table[x & 0xFF]; } | |
| 310 | ||
| 311 | /***********************************************************************************/ | |
| 312 | ||
| 313 | typedef struct { | |
| 314 | struct { | |
| 315 | int b; | |
| 316 | int w; | |
| 317 | int d; | |
| 318 | } reg; | |
| 319 | struct { | |
| 320 | int b; | |
| 321 | int w; | |
| 322 | int d; | |
| 323 | } rm; | |
| 324 | } MODRM_TABLE; | |
| 325 | ||
| 326 | extern MODRM_TABLE i386_MODRM_table[256]; | |
| 327 | ||
| 328 | #define REG8(x) (cpustate->reg.b[x]) | |
| 329 | #define REG16(x) (cpustate->reg.w[x]) | |
| 330 | #define REG32(x) (cpustate->reg.d[x]) | |
| 331 | ||
| 332 | #define LOAD_REG8(x) (REG8(i386_MODRM_table[x].reg.b)) | |
| 333 | #define LOAD_REG16(x) (REG16(i386_MODRM_table[x].reg.w)) | |
| 334 | #define LOAD_REG32(x) (REG32(i386_MODRM_table[x].reg.d)) | |
| 335 | #define LOAD_RM8(x) (REG8(i386_MODRM_table[x].rm.b)) | |
| 336 | #define LOAD_RM16(x) (REG16(i386_MODRM_table[x].rm.w)) | |
| 337 | #define LOAD_RM32(x) (REG32(i386_MODRM_table[x].rm.d)) | |
| 338 | ||
| 339 | #define STORE_REG8(x, value) (REG8(i386_MODRM_table[x].reg.b) = value) | |
| 340 | #define STORE_REG16(x, value) (REG16(i386_MODRM_table[x].reg.w) = value) | |
| 341 | #define STORE_REG32(x, value) (REG32(i386_MODRM_table[x].reg.d) = value) | |
| 342 | #define STORE_RM8(x, value) (REG8(i386_MODRM_table[x].rm.b) = value) | |
| 343 | #define STORE_RM16(x, value) (REG16(i386_MODRM_table[x].rm.w) = value) | |
| 344 | #define STORE_RM32(x, value) (REG32(i386_MODRM_table[x].rm.d) = value) | |
| 345 | ||
| 346 | /***********************************************************************************/ | |
| 347 | ||
| 348 | INLINE UINT32 i386_translate(i386_state *cpustate, int segment, UINT32 ip) | |
| 349 | { | |
| 350 | // TODO: segment limit | |
| 351 | return cpustate->sreg[segment].base + ip; | |
| 352 | } | |
| 353 | ||
| 354 | INLINE int translate_address(i386_state *cpustate, UINT32 *address) | |
| 355 | { | |
| 356 | UINT32 a = *address; | |
| 357 | UINT32 pdbr = cpustate->cr[3] & 0xfffff000; | |
| 358 | UINT32 directory = (a >> 22) & 0x3ff; | |
| 359 | UINT32 table = (a >> 12) & 0x3ff; | |
| 360 | UINT32 offset = a & 0xfff; | |
| 361 | ||
| 362 | // TODO: 4MB pages | |
| 363 | UINT32 page_dir = memory_read_dword_32le(cpustate->program, pdbr + directory * 4); | |
| 364 | UINT32 page_entry = memory_read_dword_32le(cpustate->program, (page_dir & 0xfffff000) + (table * 4)); | |
| 365 | ||
| 366 | *address = (page_entry & 0xfffff000) | offset; | |
| 367 | return 1; | |
| 368 | } | |
| 369 | ||
| 370 | INLINE void CHANGE_PC(i386_state *cpustate, UINT32 pc) | |
| 371 | { | |
| 372 | UINT32 address; | |
| 373 | cpustate->pc = i386_translate(cpustate, CS, pc ); | |
| 374 | ||
| 375 | address = cpustate->pc; | |
| 376 | ||
| 377 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 378 | { | |
| 379 | translate_address(cpustate,&address); | |
| 380 | } | |
| 381 | } | |
| 382 | ||
| 383 | INLINE void NEAR_BRANCH(i386_state *cpustate, INT32 offs) | |
| 384 | { | |
| 385 | UINT32 address; | |
| 386 | /* TODO: limit */ | |
| 387 | cpustate->eip += offs; | |
| 388 | cpustate->pc += offs; | |
| 389 | ||
| 390 | address = cpustate->pc; | |
| 391 | ||
| 392 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 393 | { | |
| 394 | translate_address(cpustate,&address); | |
| 395 | } | |
| 396 | } | |
| 397 | ||
| 398 | INLINE UINT8 FETCH(i386_state *cpustate) | |
| 399 | { | |
| 400 | UINT8 value; | |
| 401 | UINT32 address = cpustate->pc; | |
| 402 | ||
| 403 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 404 | { | |
| 405 | translate_address(cpustate,&address); | |
| 406 | } | |
| 407 | ||
| 408 | value = memory_decrypted_read_byte(cpustate->program, address & cpustate->a20_mask); | |
| 409 | cpustate->eip++; | |
| 410 | cpustate->pc++; | |
| 411 | return value; | |
| 412 | } | |
| 413 | INLINE UINT16 FETCH16(i386_state *cpustate) | |
| 414 | { | |
| 415 | UINT16 value; | |
| 416 | UINT32 address = cpustate->pc; | |
| 417 | ||
| 418 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 419 | { | |
| 420 | translate_address(cpustate,&address); | |
| 421 | } | |
| 422 | ||
| 423 | if( address & 0x1 ) { /* Unaligned read */ | |
| 424 | address &= cpustate->a20_mask; | |
| 425 | value = (memory_decrypted_read_byte(cpustate->program, address+0) << 0) | | |
| 426 | (memory_decrypted_read_byte(cpustate->program, address+1) << 8); | |
| 427 | } else { | |
| 428 | address &= cpustate->a20_mask; | |
| 429 | value = memory_decrypted_read_word(cpustate->program, address); | |
| 430 | } | |
| 431 | cpustate->eip += 2; | |
| 432 | cpustate->pc += 2; | |
| 433 | return value; | |
| 434 | } | |
| 435 | INLINE UINT32 FETCH32(i386_state *cpustate) | |
| 436 | { | |
| 437 | UINT32 value; | |
| 438 | UINT32 address = cpustate->pc; | |
| 439 | ||
| 440 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 441 | { | |
| 442 | translate_address(cpustate,&address); | |
| 443 | } | |
| 444 | ||
| 445 | if( cpustate->pc & 0x3 ) { /* Unaligned read */ | |
| 446 | address &= cpustate->a20_mask; | |
| 447 | value = (memory_decrypted_read_byte(cpustate->program, address+0) << 0) | | |
| 448 | (memory_decrypted_read_byte(cpustate->program, address+1) << 8) | | |
| 449 | (memory_decrypted_read_byte(cpustate->program, address+2) << 16) | | |
| 450 | (memory_decrypted_read_byte(cpustate->program, address+3) << 24); | |
| 451 | } else { | |
| 452 | address &= cpustate->a20_mask; | |
| 453 | value = memory_decrypted_read_dword(cpustate->program, address); | |
| 454 | } | |
| 455 | cpustate->eip += 4; | |
| 456 | cpustate->pc += 4; | |
| 457 | return value; | |
| 458 | } | |
| 459 | ||
| 460 | INLINE UINT8 READ8(i386_state *cpustate,UINT32 ea) | |
| 461 | { | |
| 462 | UINT32 address = ea; | |
| 463 | ||
| 464 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 465 | { | |
| 466 | translate_address(cpustate,&address); | |
| 467 | } | |
| 468 | ||
| 469 | address &= cpustate->a20_mask; | |
| 470 | return memory_read_byte_32le(cpustate->program, address); | |
| 471 | } | |
| 472 | INLINE UINT16 READ16(i386_state *cpustate,UINT32 ea) | |
| 473 | { | |
| 474 | UINT16 value; | |
| 475 | UINT32 address = ea; | |
| 476 | ||
| 477 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 478 | { | |
| 479 | translate_address(cpustate,&address); | |
| 480 | } | |
| 481 | ||
| 482 | address &= cpustate->a20_mask; | |
| 483 | if( ea & 0x1 ) { /* Unaligned read */ | |
| 484 | value = (memory_read_byte_32le( cpustate->program, address+0 ) << 0) | | |
| 485 | (memory_read_byte_32le( cpustate->program, address+1 ) << 8); | |
| 486 | } else { | |
| 487 | value = memory_read_word_32le( cpustate->program, address ); | |
| 488 | } | |
| 489 | return value; | |
| 490 | } | |
| 491 | INLINE UINT32 READ32(i386_state *cpustate,UINT32 ea) | |
| 492 | { | |
| 493 | UINT32 value; | |
| 494 | UINT32 address = ea; | |
| 495 | ||
| 496 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 497 | { | |
| 498 | translate_address(cpustate,&address); | |
| 499 | } | |
| 500 | ||
| 501 | address &= cpustate->a20_mask; | |
| 502 | if( ea & 0x3 ) { /* Unaligned read */ | |
| 503 | value = (memory_read_byte_32le( cpustate->program, address+0 ) << 0) | | |
| 504 | (memory_read_byte_32le( cpustate->program, address+1 ) << 8) | | |
| 505 | (memory_read_byte_32le( cpustate->program, address+2 ) << 16) | | |
| 506 | (memory_read_byte_32le( cpustate->program, address+3 ) << 24); | |
| 507 | } else { | |
| 508 | value = memory_read_dword_32le( cpustate->program, address ); | |
| 509 | } | |
| 510 | return value; | |
| 511 | } | |
| 512 | ||
| 513 | INLINE UINT64 READ64(i386_state *cpustate,UINT32 ea) | |
| 514 | { | |
| 515 | UINT64 value; | |
| 516 | UINT32 address = ea; | |
| 517 | ||
| 518 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 519 | { | |
| 520 | translate_address(cpustate,&address); | |
| 521 | } | |
| 522 | ||
| 523 | address &= cpustate->a20_mask; | |
| 524 | if( ea & 0x7 ) { /* Unaligned read */ | |
| 525 | value = (((UINT64) memory_read_byte_32le( cpustate->program, address+0 )) << 0) | | |
| 526 | (((UINT64) memory_read_byte_32le( cpustate->program, address+1 )) << 8) | | |
| 527 | (((UINT64) memory_read_byte_32le( cpustate->program, address+2 )) << 16) | | |
| 528 | (((UINT64) memory_read_byte_32le( cpustate->program, address+3 )) << 24) | | |
| 529 | (((UINT64) memory_read_byte_32le( cpustate->program, address+4 )) << 32) | | |
| 530 | (((UINT64) memory_read_byte_32le( cpustate->program, address+5 )) << 40) | | |
| 531 | (((UINT64) memory_read_byte_32le( cpustate->program, address+6 )) << 48) | | |
| 532 | (((UINT64) memory_read_byte_32le( cpustate->program, address+7 )) << 56); | |
| 533 | } else { | |
| 534 | value = (((UINT64) memory_read_dword_32le( cpustate->program, address+0 )) << 0) | | |
| 535 | (((UINT64) memory_read_dword_32le( cpustate->program, address+4 )) << 32); | |
| 536 | } | |
| 537 | return value; | |
| 538 | } | |
| 539 | ||
| 540 | INLINE void WRITE8(i386_state *cpustate,UINT32 ea, UINT8 value) | |
| 541 | { | |
| 542 | UINT32 address = ea; | |
| 543 | ||
| 544 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 545 | { | |
| 546 | translate_address(cpustate,&address); | |
| 547 | } | |
| 548 | ||
| 549 | address &= cpustate->a20_mask; | |
| 550 | memory_write_byte_32le(cpustate->program, address, value); | |
| 551 | } | |
| 552 | INLINE void WRITE16(i386_state *cpustate,UINT32 ea, UINT16 value) | |
| 553 | { | |
| 554 | UINT32 address = ea; | |
| 555 | ||
| 556 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 557 | { | |
| 558 | translate_address(cpustate,&address); | |
| 559 | } | |
| 560 | ||
| 561 | address &= cpustate->a20_mask; | |
| 562 | if( ea & 0x1 ) { /* Unaligned write */ | |
| 563 | memory_write_byte_32le( cpustate->program, address+0, value & 0xff ); | |
| 564 | memory_write_byte_32le( cpustate->program, address+1, (value >> 8) & 0xff ); | |
| 565 | } else { | |
| 566 | memory_write_word_32le(cpustate->program, address, value); | |
| 567 | } | |
| 568 | } | |
| 569 | INLINE void WRITE32(i386_state *cpustate,UINT32 ea, UINT32 value) | |
| 570 | { | |
| 571 | UINT32 address = ea; | |
| 572 | ||
| 573 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 574 | { | |
| 575 | translate_address(cpustate,&address); | |
| 576 | } | |
| 577 | ||
| 578 | ea &= cpustate->a20_mask; | |
| 579 | if( ea & 0x3 ) { /* Unaligned write */ | |
| 580 | memory_write_byte_32le( cpustate->program, address+0, value & 0xff ); | |
| 581 | memory_write_byte_32le( cpustate->program, address+1, (value >> 8) & 0xff ); | |
| 582 | memory_write_byte_32le( cpustate->program, address+2, (value >> 16) & 0xff ); | |
| 583 | memory_write_byte_32le( cpustate->program, address+3, (value >> 24) & 0xff ); | |
| 584 | } else { | |
| 585 | memory_write_dword_32le(cpustate->program, address, value); | |
| 586 | } | |
| 587 | } | |
| 588 | ||
| 589 | INLINE void WRITE64(i386_state *cpustate,UINT32 ea, UINT64 value) | |
| 590 | { | |
| 591 | UINT32 address = ea; | |
| 592 | ||
| 593 | if (cpustate->cr[0] & 0x80000000) // page translation enabled | |
| 594 | { | |
| 595 | translate_address(cpustate,&address); | |
| 596 | } | |
| 597 | ||
| 598 | ea &= cpustate->a20_mask; | |
| 599 | if( ea & 0x7 ) { /* Unaligned write */ | |
| 600 | memory_write_byte_32le( cpustate->program, address+0, value & 0xff ); | |
| 601 | memory_write_byte_32le( cpustate->program, address+1, (value >> 8) & 0xff ); | |
| 602 | memory_write_byte_32le( cpustate->program, address+2, (value >> 16) & 0xff ); | |
| 603 | memory_write_byte_32le( cpustate->program, address+3, (value >> 24) & 0xff ); | |
| 604 | memory_write_byte_32le( cpustate->program, address+4, (value >> 32) & 0xff ); | |
| 605 | memory_write_byte_32le( cpustate->program, address+5, (value >> 40) & 0xff ); | |
| 606 | memory_write_byte_32le( cpustate->program, address+6, (value >> 48) & 0xff ); | |
| 607 | memory_write_byte_32le( cpustate->program, address+7, (value >> 56) & 0xff ); | |
| 608 | } else { | |
| 609 | memory_write_dword_32le(cpustate->program, address+0, value & 0xffffffff); | |
| 610 | memory_write_dword_32le(cpustate->program, address+4, (value >> 32) & 0xffffffff); | |
| 611 | } | |
| 612 | } | |
| 613 | ||
| 614 | /***********************************************************************************/ | |
| 615 | ||
| 616 | INLINE UINT8 OR8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 617 | { | |
| 618 | UINT8 res = dst | src; | |
| 619 | cpustate->CF = cpustate->OF = 0; | |
| 620 | SetSZPF8(res); | |
| 621 | return res; | |
| 622 | } | |
| 623 | INLINE UINT16 OR16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 624 | { | |
| 625 | UINT16 res = dst | src; | |
| 626 | cpustate->CF = cpustate->OF = 0; | |
| 627 | SetSZPF16(res); | |
| 628 | return res; | |
| 629 | } | |
| 630 | INLINE UINT32 OR32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 631 | { | |
| 632 | UINT32 res = dst | src; | |
| 633 | cpustate->CF = cpustate->OF = 0; | |
| 634 | SetSZPF32(res); | |
| 635 | return res; | |
| 636 | } | |
| 637 | ||
| 638 | INLINE UINT8 AND8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 639 | { | |
| 640 | UINT8 res = dst & src; | |
| 641 | cpustate->CF = cpustate->OF = 0; | |
| 642 | SetSZPF8(res); | |
| 643 | return res; | |
| 644 | } | |
| 645 | INLINE UINT16 AND16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 646 | { | |
| 647 | UINT16 res = dst & src; | |
| 648 | cpustate->CF = cpustate->OF = 0; | |
| 649 | SetSZPF16(res); | |
| 650 | return res; | |
| 651 | } | |
| 652 | INLINE UINT32 AND32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 653 | { | |
| 654 | UINT32 res = dst & src; | |
| 655 | cpustate->CF = cpustate->OF = 0; | |
| 656 | SetSZPF32(res); | |
| 657 | return res; | |
| 658 | } | |
| 659 | ||
| 660 | INLINE UINT8 XOR8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 661 | { | |
| 662 | UINT8 res = dst ^ src; | |
| 663 | cpustate->CF = cpustate->OF = 0; | |
| 664 | SetSZPF8(res); | |
| 665 | return res; | |
| 666 | } | |
| 667 | INLINE UINT16 XOR16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 668 | { | |
| 669 | UINT16 res = dst ^ src; | |
| 670 | cpustate->CF = cpustate->OF = 0; | |
| 671 | SetSZPF16(res); | |
| 672 | return res; | |
| 673 | } | |
| 674 | INLINE UINT32 XOR32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 675 | { | |
| 676 | UINT32 res = dst ^ src; | |
| 677 | cpustate->CF = cpustate->OF = 0; | |
| 678 | SetSZPF32(res); | |
| 679 | return res; | |
| 680 | } | |
| 681 | ||
| 682 | INLINE UINT8 SUB8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 683 | { | |
| 684 | UINT16 res = (UINT16)dst - (UINT16)src; | |
| 685 | SetCF8(res); | |
| 686 | SetOF_Sub8(res,src,dst); | |
| 687 | SetAF(res,src,dst); | |
| 688 | SetSZPF8(res); | |
| 689 | return (UINT8)res; | |
| 690 | } | |
| 691 | INLINE UINT16 SUB16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 692 | { | |
| 693 | UINT32 res = (UINT32)dst - (UINT32)src; | |
| 694 | SetCF16(res); | |
| 695 | SetOF_Sub16(res,src,dst); | |
| 696 | SetAF(res,src,dst); | |
| 697 | SetSZPF16(res); | |
| 698 | return (UINT16)res; | |
| 699 | } | |
| 700 | INLINE UINT32 SUB32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 701 | { | |
| 702 | UINT64 res = (UINT64)dst - (UINT64)src; | |
| 703 | SetCF32(res); | |
| 704 | SetOF_Sub32(res,src,dst); | |
| 705 | SetAF(res,src,dst); | |
| 706 | SetSZPF32(res); | |
| 707 | return (UINT32)res; | |
| 708 | } | |
| 709 | ||
| 710 | INLINE UINT8 ADD8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 711 | { | |
| 712 | UINT16 res = (UINT16)dst + (UINT16)src; | |
| 713 | SetCF8(res); | |
| 714 | SetOF_Add8(res,src,dst); | |
| 715 | SetAF(res,src,dst); | |
| 716 | SetSZPF8(res); | |
| 717 | return (UINT8)res; | |
| 718 | } | |
| 719 | INLINE UINT16 ADD16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 720 | { | |
| 721 | UINT32 res = (UINT32)dst + (UINT32)src; | |
| 722 | SetCF16(res); | |
| 723 | SetOF_Add16(res,src,dst); | |
| 724 | SetAF(res,src,dst); | |
| 725 | SetSZPF16(res); | |
| 726 | return (UINT16)res; | |
| 727 | } | |
| 728 | INLINE UINT32 ADD32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 729 | { | |
| 730 | UINT64 res = (UINT64)dst + (UINT64)src; | |
| 731 | SetCF32(res); | |
| 732 | SetOF_Add32(res,src,dst); | |
| 733 | SetAF(res,src,dst); | |
| 734 | SetSZPF32(res); | |
| 735 | return (UINT32)res; | |
| 736 | } | |
| 737 | ||
| 738 | INLINE UINT8 INC8(i386_state *cpustate,UINT8 dst) | |
| 739 | { | |
| 740 | UINT16 res = (UINT16)dst + 1; | |
| 741 | SetOF_Add8(res,1,dst); | |
| 742 | SetAF(res,1,dst); | |
| 743 | SetSZPF8(res); | |
| 744 | return (UINT8)res; | |
| 745 | } | |
| 746 | INLINE UINT16 INC16(i386_state *cpustate,UINT16 dst) | |
| 747 | { | |
| 748 | UINT32 res = (UINT32)dst + 1; | |
| 749 | SetOF_Add16(res,1,dst); | |
| 750 | SetAF(res,1,dst); | |
| 751 | SetSZPF16(res); | |
| 752 | return (UINT16)res; | |
| 753 | } | |
| 754 | INLINE UINT32 INC32(i386_state *cpustate,UINT32 dst) | |
| 755 | { | |
| 756 | UINT64 res = (UINT64)dst + 1; | |
| 757 | SetOF_Add32(res,1,dst); | |
| 758 | SetAF(res,1,dst); | |
| 759 | SetSZPF32(res); | |
| 760 | return (UINT32)res; | |
| 761 | } | |
| 762 | ||
| 763 | INLINE UINT8 DEC8(i386_state *cpustate,UINT8 dst) | |
| 764 | { | |
| 765 | UINT16 res = (UINT16)dst - 1; | |
| 766 | SetOF_Sub8(res,1,dst); | |
| 767 | SetAF(res,1,dst); | |
| 768 | SetSZPF8(res); | |
| 769 | return (UINT8)res; | |
| 770 | } | |
| 771 | INLINE UINT16 DEC16(i386_state *cpustate,UINT16 dst) | |
| 772 | { | |
| 773 | UINT32 res = (UINT32)dst - 1; | |
| 774 | SetOF_Sub16(res,1,dst); | |
| 775 | SetAF(res,1,dst); | |
| 776 | SetSZPF16(res); | |
| 777 | return (UINT16)res; | |
| 778 | } | |
| 779 | INLINE UINT32 DEC32(i386_state *cpustate,UINT32 dst) | |
| 780 | { | |
| 781 | UINT64 res = (UINT64)dst - 1; | |
| 782 | SetOF_Sub32(res,1,dst); | |
| 783 | SetAF(res,1,dst); | |
| 784 | SetSZPF32(res); | |
| 785 | return (UINT32)res; | |
| 786 | } | |
| 787 | ||
| 788 | ||
| 789 | ||
| 790 | INLINE void PUSH16(i386_state *cpustate,UINT16 value) | |
| 791 | { | |
| 792 | UINT32 ea; | |
| 793 | if( STACK_32BIT ) { | |
| 794 | REG32(ESP) -= 2; | |
| 795 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 796 | WRITE16(cpustate, ea, value ); | |
| 797 | } else { | |
| 798 | REG16(SP) -= 2; | |
| 799 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 800 | WRITE16(cpustate, ea, value ); | |
| 801 | } | |
| 802 | } | |
| 803 | INLINE void PUSH32(i386_state *cpustate,UINT32 value) | |
| 804 | { | |
| 805 | UINT32 ea; | |
| 806 | if( STACK_32BIT ) { | |
| 807 | REG32(ESP) -= 4; | |
| 808 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 809 | WRITE32(cpustate, ea, value ); | |
| 810 | } else { | |
| 811 | REG16(SP) -= 4; | |
| 812 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 813 | WRITE32(cpustate, ea, value ); | |
| 814 | } | |
| 815 | } | |
| 816 | INLINE void PUSH8(i386_state *cpustate,UINT8 value) | |
| 817 | { | |
| 818 | if( cpustate->operand_size ) { | |
| 819 | PUSH32(cpustate,(INT32)(INT8)value); | |
| 820 | } else { | |
| 821 | PUSH16(cpustate,(INT16)(INT8)value); | |
| 822 | } | |
| 823 | } | |
| 824 | ||
| 825 | INLINE UINT8 POP8(i386_state *cpustate) | |
| 826 | { | |
| 827 | UINT8 value; | |
| 828 | UINT32 ea; | |
| 829 | if( STACK_32BIT ) { | |
| 830 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 831 | value = READ8(cpustate, ea ); | |
| 832 | REG32(ESP) += 1; | |
| 833 | } else { | |
| 834 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 835 | value = READ8(cpustate, ea ); | |
| 836 | REG16(SP) += 1; | |
| 837 | } | |
| 838 | return value; | |
| 839 | } | |
| 840 | INLINE UINT16 POP16(i386_state *cpustate) | |
| 841 | { | |
| 842 | UINT16 value; | |
| 843 | UINT32 ea; | |
| 844 | if( STACK_32BIT ) { | |
| 845 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 846 | value = READ16(cpustate, ea ); | |
| 847 | REG32(ESP) += 2; | |
| 848 | } else { | |
| 849 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 850 | value = READ16(cpustate, ea ); | |
| 851 | REG16(SP) += 2; | |
| 852 | } | |
| 853 | return value; | |
| 854 | } | |
| 855 | INLINE UINT32 POP32(i386_state *cpustate) | |
| 856 | { | |
| 857 | UINT32 value; | |
| 858 | UINT32 ea; | |
| 859 | if( STACK_32BIT ) { | |
| 860 | ea = i386_translate(cpustate, SS, REG32(ESP) ); | |
| 861 | value = READ32(cpustate, ea ); | |
| 862 | REG32(ESP) += 4; | |
| 863 | } else { | |
| 864 | ea = i386_translate(cpustate, SS, REG16(SP) ); | |
| 865 | value = READ32(cpustate, ea ); | |
| 866 | REG16(SP) += 4; | |
| 867 | } | |
| 868 | return value; | |
| 869 | } | |
| 870 | ||
| 871 | INLINE void BUMP_SI(i386_state *cpustate,int adjustment) | |
| 872 | { | |
| 873 | if ( cpustate->address_size ) | |
| 874 | REG32(ESI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 875 | else | |
| 876 | REG16(SI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 877 | } | |
| 878 | ||
| 879 | INLINE void BUMP_DI(i386_state *cpustate,int adjustment) | |
| 880 | { | |
| 881 | if ( cpustate->address_size ) | |
| 882 | REG32(EDI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 883 | else | |
| 884 | REG16(DI) += ((cpustate->DF) ? -adjustment : +adjustment); | |
| 885 | } | |
| 886 | ||
| 887 | ||
| 888 | ||
| 889 | /***********************************************************************************/ | |
| 890 | ||
| 891 | #define READPORT8(port) (memory_read_byte_32le(cpustate->io, port)) | |
| 892 | #define READPORT16(port) (memory_read_word_32le(cpustate->io, port)) | |
| 893 | #define READPORT32(port) (memory_read_dword_32le(cpustate->io, port)) | |
| 894 | #define WRITEPORT8(port, value) (memory_write_byte_32le(cpustate->io, port, value)) | |
| 895 | #define WRITEPORT16(port, value) (memory_write_word_32le(cpustate->io, port, value)) | |
| 896 | #define WRITEPORT32(port, value) (memory_write_dword_32le(cpustate->io, port, value)) | |
| 897 | ||
| 898 | #endif /* __I386_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | #include "debugger.h" |
| 14 | #include "i386priv.h" | |
| 14 | 15 | #include "i386.h" |
| 15 | #include "i386intf.h" | |
| 16 | 16 | |
| 17 | 17 | #include "debug/debugcpu.h" |
| 18 | 18 | |
| r3957 | r3958 | |
| 862 | 862 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 863 | 863 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 864 | 864 | |
| 865 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 866 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 867 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 868 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 869 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 12; break; | |
| 870 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 871 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 872 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 873 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 874 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 875 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 865 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 866 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 867 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 868 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 32; break; | |
| 869 | case CPUINFO_INT_PAGE_SHIFT_PROGRAM: info->i = 12; break; | |
| 870 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 871 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 872 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 873 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 874 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 32; break; | |
| 875 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 876 | 876 | |
| 877 | 877 | case CPUINFO_INT_INPUT_STATE: info->i = CLEAR_LINE; break; |
| 878 | 878 | |
| r3957 | r3958 | |
| 959 | 959 | case CPUINFO_INT_REGISTER + I386_LDTR_FLAGS: info->i = cpustate->ldtr.flags; break; |
| 960 | 960 | |
| 961 | 961 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 962 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i386); break; | |
| 963 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i386); break; | |
| 964 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(i386); break; | |
| 965 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(i386); break; | |
| 966 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 962 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i386); break; | |
| 963 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i386); break; | |
| 964 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(i386); break; | |
| 965 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i386); break; | |
| 966 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 967 | 967 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->cycles; break; |
| 968 | case CPUINFO_PTR_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(i386); break; | |
| 969 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i386); break; | |
| 970 | case CPUINFO_PTR_DEBUG_INIT: info->debug_init = CPU_DEBUG_INIT_NAME(i386); break; | |
| 968 | case CPUINFO_FCT_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(i386); break; | |
| 969 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i386); break; | |
| 970 | case CPUINFO_FCT_DEBUG_INIT: info->debug_init = CPU_DEBUG_INIT_NAME(i386); break; | |
| 971 | 971 | |
| 972 | 972 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 973 | 973 | case CPUINFO_STR_NAME: strcpy(info->s, "I386"); break; |
| r3957 | r3958 | |
| 1138 | 1138 | i386_state *cpustate = (device != NULL) ? device->token : NULL; |
| 1139 | 1139 | switch (state) |
| 1140 | 1140 | { |
| 1141 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i486);break; | |
| 1142 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i486); break; | |
| 1143 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(i486); break; | |
| 1144 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(i486); break; | |
| 1141 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i486);break; | |
| 1142 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i486); break; | |
| 1143 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(i486); break; | |
| 1144 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(i486); break; | |
| 1145 | 1145 | |
| 1146 | 1146 | case CPUINFO_INT_REGISTER + X87_CTRL: info->i = cpustate->fpu_control_word; break; |
| 1147 | 1147 | case CPUINFO_INT_REGISTER + X87_STATUS: info->i = cpustate->fpu_status_word; break; |
| r3957 | r3958 | |
| 1271 | 1271 | i386_state *cpustate = (device != NULL) ? device->token : NULL; |
| 1272 | 1272 | switch (state) |
| 1273 | 1273 | { |
| 1274 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pentium); break; | |
| 1275 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(pentium); break; | |
| 1276 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(pentium); break; | |
| 1277 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(pentium); break; | |
| 1274 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pentium); break; | |
| 1275 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(pentium); break; | |
| 1276 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pentium); break; | |
| 1277 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(pentium); break; | |
| 1278 | 1278 | |
| 1279 | 1279 | case CPUINFO_INT_REGISTER + X87_CTRL: info->i = cpustate->fpu_control_word; break; |
| 1280 | 1280 | case CPUINFO_INT_REGISTER + X87_STATUS: info->i = cpustate->fpu_status_word; break; |
| r3957 | r3958 | |
| 1404 | 1404 | i386_state *cpustate = (device != NULL) ? device->token : NULL; |
| 1405 | 1405 | switch (state) |
| 1406 | 1406 | { |
| 1407 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mediagx); break; | |
| 1408 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(mediagx); break; | |
| 1409 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(mediagx); break; | |
| 1410 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(mediagx); break; | |
| 1407 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mediagx); break; | |
| 1408 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(mediagx); break; | |
| 1409 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mediagx); break; | |
| 1410 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(mediagx); break; | |
| 1411 | 1411 | |
| 1412 | 1412 | case CPUINFO_INT_REGISTER + X87_CTRL: info->i = cpustate->fpu_control_word; break; |
| 1413 | 1413 | case CPUINFO_INT_REGISTER + X87_STATUS: info->i = cpustate->fpu_status_word; break; |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | offs_t hc11_disasm(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); |
| 9 | 9 | |
| 10 | 10 | CPU_GET_INFO( mc68hc11 ); |
| 11 | #define CPU_MC68HC11 CPU_GET_INFO_NAME( mc68hc11 ) | |
| 11 | 12 | |
| 12 | 13 | |
| 13 | 14 | #define MC68HC11_IO_PORTA 0x00 |
| r3957 | r3958 | |
|---|---|---|
| 425 | 425 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 426 | 426 | case CPUINFO_INT_MAX_CYCLES: info->i = 41; break; |
| 427 | 427 | |
| 428 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 429 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 430 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 431 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 432 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 433 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 434 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 435 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 436 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 428 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 429 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 430 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 431 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 432 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 433 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 434 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 435 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 8; break; | |
| 436 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 437 | 437 | |
| 438 | 438 | case CPUINFO_INT_INPUT_STATE: info->i = CLEAR_LINE; break; |
| 439 | 439 | |
| r3957 | r3958 | |
| 448 | 448 | case CPUINFO_INT_REGISTER + HC11_IY: info->i = cpustate->iy; break; |
| 449 | 449 | |
| 450 | 450 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 451 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mc68hc11); break; | |
| 452 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(hc11); break; | |
| 453 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(hc11); break; | |
| 454 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(hc11); break; | |
| 455 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(hc11); break; | |
| 456 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 457 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = hc11_disasm; break; | |
| 451 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mc68hc11); break; | |
| 452 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(hc11); break; | |
| 453 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(hc11); break; | |
| 454 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(hc11); break; | |
| 455 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(hc11); break; | |
| 456 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 457 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = hc11_disasm; break; | |
| 458 | 458 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 459 | 459 | |
| 460 | 460 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /*************************************************************************** |
| 18 | | |
| 18 | TYPE | |
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | /* transmit and receive data callbacks types */ |
| r3957 | r3958 | |
| 23 | 23 | typedef void (*adsp21xx_tx_func)(const device_config *device, int port, INT32 data); |
| 24 | 24 | typedef void (*adsp21xx_timer_func)(const device_config *device, int enable); |
| 25 | 25 | |
| 26 | typedef struct _adsp21xx_config adsp21xx_config; | |
| 27 | struct _adsp21xx_config | |
| 28 | { | |
| 29 | adsp21xx_rx_func rx; /* callback for serial receive */ | |
| 30 | adsp21xx_tx_func tx; /* callback for serial transmit */ | |
| 31 | adsp21xx_timer_func timer; /* callback for timer fired */ | |
| 32 | }; | |
| 26 | 33 | |
| 34 | ||
| 35 | ||
| 27 | 36 | /*************************************************************************** |
| 28 | 37 | REGISTER ENUMERATION |
| 29 | 38 | ***************************************************************************/ |
| 30 | 39 | |
| 31 | 40 | enum |
| 32 | 41 | { |
| 33 | ADSP2100_PC | |
| 42 | ADSP2100_PC | |
| 34 | 43 | ADSP2100_AX0, ADSP2100_AX1, ADSP2100_AY0, ADSP2100_AY1, ADSP2100_AR, ADSP2100_AF, |
| 35 | 44 | ADSP2100_MX0, ADSP2100_MX1, ADSP2100_MY0, ADSP2100_MY1, ADSP2100_MR0, ADSP2100_MR1, ADSP2100_MR2, ADSP2100_MF, |
| 36 | 45 | ADSP2100_SI, ADSP2100_SE, ADSP2100_SB, ADSP2100_SR0, ADSP2100_SR1, |
| r3957 | r3958 | |
| 43 | 52 | ADSP2100_FLAGIN, ADSP2100_FLAGOUT, ADSP2100_FL0, ADSP2100_FL1, ADSP2100_FL2, |
| 44 | 53 | ADSP2100_AX0_SEC, ADSP2100_AX1_SEC, ADSP2100_AY0_SEC, ADSP2100_AY1_SEC, ADSP2100_AR_SEC, ADSP2100_AF_SEC, |
| 45 | 54 | ADSP2100_MX0_SEC, ADSP2100_MX1_SEC, ADSP2100_MY0_SEC, ADSP2100_MY1_SEC, ADSP2100_MR0_SEC, ADSP2100_MR1_SEC, ADSP2100_MR2_SEC, ADSP2100_MF_SEC, |
| 46 | ADSP2100_SI_SEC, ADSP2100_SE_SEC, ADSP2100_SB_SEC, ADSP2100_SR0_SEC, ADSP2100_SR1_SEC | |
| 47 | }; | |
| 55 | ADSP2100_SI_SEC, ADSP2100_SE_SEC, ADSP2100_SB_SEC, ADSP2100_SR0_SEC, ADSP2100_SR1_SEC, | |
| 48 | 56 | |
| 49 | enum | |
| 50 | { | |
| 51 | CPUINFO_PTR_ADSP2100_RX_HANDLER = CPUINFO_PTR_CPU_SPECIFIC, | |
| 52 | CPUINFO_PTR_ADSP2100_TX_HANDLER, | |
| 53 | CPUINFO_PTR_ADSP2100_TIMER_HANDLER | |
| 57 | ADSP2100_GENPC = REG_GENPC, | |
| 58 | ADSP2100_GENSP = REG_GENSP, | |
| 59 | ADSP2100_GENPCBASE = REG_GENPCBASE | |
| 54 | 60 | }; |
| 55 | 61 | |
| 56 | 62 | |
| 63 | ||
| 57 | 64 | /*************************************************************************** |
| 58 | 65 | PUBLIC FUNCTIONS |
| 59 | 66 | ***************************************************************************/ |
| r3957 | r3958 | |
| 65 | 72 | #define ADSP2100_IRQ2 2 /* IRQ2 */ |
| 66 | 73 | #define ADSP2100_IRQ3 3 /* IRQ3 */ |
| 67 | 74 | |
| 68 | #if (HAS_ADSP2100) | |
| 69 | extern CPU_GET_INFO( adsp2100 ); | |
| 70 | #endif | |
| 75 | CPU_GET_INFO( adsp2100 ); | |
| 76 | #define CPU_ADSP2100 CPU_GET_INFO_NAME( adsp2100 ) | |
| 71 | 77 | |
| 78 | ||
| 72 | 79 | /************************************************************************** |
| 73 | 80 | * ADSP2101 section |
| 74 | 81 | **************************************************************************/ |
| r3957 | r3958 | |
| 82 | 89 | #define ADSP2101_SPORT0_TX 4 /* SPORT0 transmit IRQ */ |
| 83 | 90 | #define ADSP2101_TIMER 5 /* internal timer IRQ */ |
| 84 | 91 | |
| 85 | #if (HAS_ADSP2101) | |
| 86 | extern CPU_GET_INFO( adsp2101 ); | |
| 87 | #endif | |
| 92 | CPU_GET_INFO( adsp2101 ); | |
| 93 | #define CPU_ADSP2101 CPU_GET_INFO_NAME( adsp2101 ) | |
| 88 | 94 | |
| 89 | ||
| 95 | ||
| 90 | 96 | /************************************************************************** |
| 91 | 97 | * ADSP2104 section |
| 92 | 98 | **************************************************************************/ |
| r3957 | r3958 | |
| 100 | 106 | #define ADSP2104_SPORT0_TX 4 /* SPORT0 transmit IRQ */ |
| 101 | 107 | #define ADSP2104_TIMER 5 /* internal timer IRQ */ |
| 102 | 108 | |
| 103 | extern CPU_GET_INFO( adsp2104 ); | |
| 104 | extern void adsp2104_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 105 | #endif /* (HAS_ADSP2104) */ | |
| 109 | CPU_GET_INFO( adsp2104 ); | |
| 110 | #define CPU_ADSP2104 CPU_GET_INFO_NAME( adsp2104 ) | |
| 106 | 111 | |
| 107 | #if (HAS_ADSP2105) | |
| 112 | void adsp2104_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 113 | ||
| 114 | ||
| 108 | 115 | /************************************************************************** |
| 109 | 116 | * ADSP2105 section |
| 110 | 117 | **************************************************************************/ |
| r3957 | r3958 | |
| 116 | 123 | #define ADSP2105_IRQ2 2 /* IRQ2 */ |
| 117 | 124 | #define ADSP2105_TIMER 5 /* internal timer IRQ */ |
| 118 | 125 | |
| 119 | extern CPU_GET_INFO( adsp2105 ); | |
| 120 | extern void adsp2105_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 121 | #endif /* (HAS_ADSP2105) */ | |
| 126 | CPU_GET_INFO( adsp2105 ); | |
| 127 | #define CPU_ADSP2105 CPU_GET_INFO_NAME( adsp2105 ) | |
| 122 | 128 | |
| 123 | #if (HAS_ADSP2115) | |
| 129 | void adsp2105_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 130 | ||
| 131 | ||
| 124 | 132 | /************************************************************************** |
| 125 | 133 | * ADSP2115 section |
| 126 | 134 | **************************************************************************/ |
| r3957 | r3958 | |
| 134 | 142 | #define ADSP2115_SPORT0_TX 4 /* SPORT0 transmit IRQ */ |
| 135 | 143 | #define ADSP2115_TIMER 5 /* internal timer IRQ */ |
| 136 | 144 | |
| 137 | extern CPU_GET_INFO( adsp2115 ); | |
| 138 | extern void adsp2115_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 139 | #endif /* (HAS_ADSP2115) */ | |
| 145 | CPU_GET_INFO( adsp2115 ); | |
| 146 | #define CPU_ADSP2115 CPU_GET_INFO_NAME( adsp2115 ) | |
| 140 | 147 | |
| 141 | #if (HAS_ADSP2181) | |
| 148 | void adsp2115_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 149 | ||
| 150 | ||
| 142 | 151 | /************************************************************************** |
| 143 | 152 | * ADSP2181 section |
| 144 | 153 | **************************************************************************/ |
| r3957 | r3958 | |
| 155 | 164 | #define ADSP2181_IRQL1 7 /* IRQL1 */ |
| 156 | 165 | #define ADSP2181_IRQL2 8 /* IRQL2 */ |
| 157 | 166 | |
| 158 | extern CPU_GET_INFO( adsp2181 ); | |
| 159 | extern void adsp2181_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 160 | extern void adsp2181_idma_addr_w(const device_config *device, UINT16 data); | |
| 161 | extern UINT16 adsp2181_idma_addr_r(const device_config *device); | |
| 162 | extern void adsp2181_idma_data_w(const device_config *device, UINT16 data); | |
| 163 | extern UINT16 adsp2181_idma_data_r(const device_config *device); | |
| 164 | #endif /* (HAS_ADSP2181) */ | |
| 167 | CPU_GET_INFO( adsp2181 ); | |
| 168 | #define CPU_ADSP2181 CPU_GET_INFO_NAME( adsp2181 ) | |
| 165 | 169 | |
| 170 | void adsp2181_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); | |
| 171 | void adsp2181_idma_addr_w(const device_config *device, UINT16 data); | |
| 172 | UINT16 adsp2181_idma_addr_r(const device_config *device); | |
| 173 | void adsp2181_idma_data_w(const device_config *device, UINT16 data); | |
| 174 | UINT16 adsp2181_idma_data_r(const device_config *device); | |
| 166 | 175 | |
| 167 | INLINE void adsp21xx_set_rx_handler(const device_config *device, adsp21xx_rx_func handler) | |
| 168 | { | |
| 169 | cpu_set_info_fct(device, CPUINFO_PTR_ADSP2100_RX_HANDLER, (genf *)handler); | |
| 170 | } | |
| 171 | 176 | |
| 172 | INLINE void adsp21xx_set_tx_handler(const device_config *device, adsp21xx_tx_func handler) | |
| 173 | { | |
| 174 | cpu_set_info_fct(device, CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)handler); | |
| 175 | } | |
| 176 | ||
| 177 | INLINE void adsp21xx_set_timer_handler(const device_config *device, adsp21xx_timer_func handler) | |
| 178 | { | |
| 179 | cpu_set_info_fct(device, CPUINFO_PTR_ADSP2100_TIMER_HANDLER, (genf *)handler); | |
| 180 | } | |
| 181 | ||
| 182 | ||
| 183 | 177 | #endif /* __ADSP2100_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | #define MSTAT_GOMODE 0x40 /* go mode enable */ |
| 82 | 82 | |
| 83 | 83 | /* you must call this in order to change MSTAT */ |
| 84 | INLINE void | |
| 84 | INLINE void update_mstat(adsp2100_state *adsp | |
| 85 | 85 | { |
| 86 | if (( | |
| 86 | if (( | |
| 87 | 87 | { |
| 88 | 88 | ADSPCORE temp = adsp->core; |
| 89 | 89 | adsp->core = adsp->alt; |
| 90 | 90 | adsp->alt = temp; |
| 91 | 91 | } |
| 92 | if (( | |
| 92 | if (( | |
| 93 | 93 | if (adsp->timer_fired != NULL) |
| 94 | (*adsp->timer_fired)(adsp->device, (new_value & MSTAT_TIMER) != 0); | |
| 95 | if (new_value & MSTAT_STICKYV) | |
| 94 | (*adsp->timer_fired)(adsp->device, (adsp->mstat & MSTAT_TIMER) != 0); | |
| 95 | if (adsp->mstat & MSTAT_STICKYV) | |
| 96 | 96 | adsp->astat_clear = ~(CFLAG | NFLAG | ZFLAG); |
| 97 | 97 | else |
| 98 | 98 | adsp->astat_clear = ~(CFLAG | VFLAG | NFLAG | ZFLAG); |
| 99 | adsp->mstat = | |
| 99 | adsp->mstat_prev = | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| r3957 | r3958 | |
| 291 | 291 | if (adsp->stat_sp == 0) |
| 292 | 292 | adsp->sstat |= STATUS_EMPTY; |
| 293 | 293 | } |
| 294 | set_mstat(adsp, adsp->stat_stack[adsp->stat_sp][0]); | |
| 294 | adsp->mstat = adsp->stat_stack[adsp->stat_sp][0]; | |
| 295 | update_mstat(adsp); | |
| 295 | 296 | adsp->imask = adsp->stat_stack[adsp->stat_sp][1]; |
| 296 | 297 | adsp->astat = adsp->stat_stack[adsp->stat_sp][2]; |
| 297 | 298 | check_irqs(adsp); |
| r3957 | r3958 | |
| 322 | 323 | register writing |
| 323 | 324 | ===========================================================================*/ |
| 324 | 325 | |
| 326 | INLINE void update_i(adsp2100_state *adsp, int which) | |
| 327 | { | |
| 328 | adsp->base[which] = adsp->i[which] & adsp->lmask[which]; | |
| 329 | } | |
| 330 | ||
| 331 | INLINE void update_l(adsp2100_state *adsp, int which) | |
| 332 | { | |
| 333 | adsp->lmask[which] = mask_table[adsp->l[which] & 0x3fff]; | |
| 334 | adsp->base[which] = adsp->i[which] & adsp->lmask[which]; | |
| 335 | } | |
| 336 | ||
| 325 | 337 | static void wr_inval(adsp2100_state *adsp, INT32 val) { logerror( "ADSP %04x: Writing to an invalid register!\n", adsp->ppc ); } |
| 326 | 338 | static void wr_ax0(adsp2100_state *adsp, INT32 val) { adsp->core.ax0.s = val; } |
| 327 | 339 | static void wr_ax1(adsp2100_state *adsp, INT32 val) { adsp->core.ax1.s = val; } |
| r3957 | r3958 | |
| 339 | 351 | static void wr_mr2(adsp2100_state *adsp, INT32 val) { adsp->core.mr.mrx.mr2.s = (INT8)val; } |
| 340 | 352 | static void wr_sr0(adsp2100_state *adsp, INT32 val) { adsp->core.sr.srx.sr0.s = val; } |
| 341 | 353 | static void wr_sr1(adsp2100_state *adsp, INT32 val) { adsp->core.sr.srx.sr1.s = val; } |
| 342 | static void wr_i0(adsp2100_state *adsp, INT32 val) { adsp->i[0] = val & 0x3fff; adsp->base[0] = val & adsp->lmask[0]; } | |
| 343 | static void wr_i1(adsp2100_state *adsp, INT32 val) { adsp->i[1] = val & 0x3fff; adsp->base[1] = val & adsp->lmask[1]; } | |
| 344 | static void wr_i2(adsp2100_state *adsp, INT32 val) { adsp->i[2] = val & 0x3fff; adsp->base[2] = val & adsp->lmask[2]; } | |
| 345 | static void wr_i3(adsp2100_state *adsp, INT32 val) { adsp->i[3] = val & 0x3fff; adsp->base[3] = val & adsp->lmask[3]; } | |
| 346 | static void wr_i4(adsp2100_state *adsp, INT32 val) { adsp->i[4] = val & 0x3fff; adsp->base[4] = val & adsp->lmask[4]; } | |
| 347 | static void wr_i5(adsp2100_state *adsp, INT32 val) { adsp->i[5] = val & 0x3fff; adsp->base[5] = val & adsp->lmask[5]; } | |
| 348 | static void wr_i6(adsp2100_state *adsp, INT32 val) { adsp->i[6] = val & 0x3fff; adsp->base[6] = val & adsp->lmask[6]; } | |
| 349 | static void wr_i7(adsp2100_state *adsp, INT32 val) { adsp->i[7] = val & 0x3fff; adsp->base[7] = val & adsp->lmask[7]; } | |
| 354 | static void wr_i0(adsp2100_state *adsp, INT32 val) { adsp->i[0] = val & 0x3fff; update_i(adsp, 0); } | |
| 355 | static void wr_i1(adsp2100_state *adsp, INT32 val) { adsp->i[1] = val & 0x3fff; update_i(adsp, 1); } | |
| 356 | static void wr_i2(adsp2100_state *adsp, INT32 val) { adsp->i[2] = val & 0x3fff; update_i(adsp, 2); } | |
| 357 | static void wr_i3(adsp2100_state *adsp, INT32 val) { adsp->i[3] = val & 0x3fff; update_i(adsp, 3); } | |
| 358 | static void wr_i4(adsp2100_state *adsp, INT32 val) { adsp->i[4] = val & 0x3fff; update_i(adsp, 4); } | |
| 359 | static void wr_i5(adsp2100_state *adsp, INT32 val) { adsp->i[5] = val & 0x3fff; update_i(adsp, 5); } | |
| 360 | static void wr_i6(adsp2100_state *adsp, INT32 val) { adsp->i[6] = val & 0x3fff; update_i(adsp, 6); } | |
| 361 | static void wr_i7(adsp2100_state *adsp, INT32 val) { adsp->i[7] = val & 0x3fff; update_i(adsp, 7); } | |
| 350 | 362 | static void wr_m0(adsp2100_state *adsp, INT32 val) { adsp->m[0] = (INT32)(val << 18) >> 18; } |
| 351 | 363 | static void wr_m1(adsp2100_state *adsp, INT32 val) { adsp->m[1] = (INT32)(val << 18) >> 18; } |
| 352 | 364 | static void wr_m2(adsp2100_state *adsp, INT32 val) { adsp->m[2] = (INT32)(val << 18) >> 18; } |
| r3957 | r3958 | |
| 355 | 367 | static void wr_m5(adsp2100_state *adsp, INT32 val) { adsp->m[5] = (INT32)(val << 18) >> 18; } |
| 356 | 368 | static void wr_m6(adsp2100_state *adsp, INT32 val) { adsp->m[6] = (INT32)(val << 18) >> 18; } |
| 357 | 369 | static void wr_m7(adsp2100_state *adsp, INT32 val) { adsp->m[7] = (INT32)(val << 18) >> 18; } |
| 358 | static void wr_l0(adsp2100_state *adsp, INT32 val) { adsp->l[0] = val & 0x3fff; adsp->lmask[0] = mask_table[val & 0x3fff]; adsp->base[0] = adsp->i[0] & adsp->lmask[0]; } | |
| 359 | static void wr_l1(adsp2100_state *adsp, INT32 val) { adsp->l[1] = val & 0x3fff; adsp->lmask[1] = mask_table[val & 0x3fff]; adsp->base[1] = adsp->i[1] & adsp->lmask[1]; } | |
| 360 | static void wr_l2(adsp2100_state *adsp, INT32 val) { adsp->l[2] = val & 0x3fff; adsp->lmask[2] = mask_table[val & 0x3fff]; adsp->base[2] = adsp->i[2] & adsp->lmask[2]; } | |
| 361 | static void wr_l3(adsp2100_state *adsp, INT32 val) { adsp->l[3] = val & 0x3fff; adsp->lmask[3] = mask_table[val & 0x3fff]; adsp->base[3] = adsp->i[3] & adsp->lmask[3]; } | |
| 362 | static void wr_l4(adsp2100_state *adsp, INT32 val) { adsp->l[4] = val & 0x3fff; adsp->lmask[4] = mask_table[val & 0x3fff]; adsp->base[4] = adsp->i[4] & adsp->lmask[4]; } | |
| 363 | static void wr_l5(adsp2100_state *adsp, INT32 val) { adsp->l[5] = val & 0x3fff; adsp->lmask[5] = mask_table[val & 0x3fff]; adsp->base[5] = adsp->i[5] & adsp->lmask[5]; } | |
| 364 | static void wr_l6(adsp2100_state *adsp, INT32 val) { adsp->l[6] = val & 0x3fff; adsp->lmask[6] = mask_table[val & 0x3fff]; adsp->base[6] = adsp->i[6] & adsp->lmask[6]; } | |
| 365 | static void wr_l7(adsp2100_state *adsp, INT32 val) { adsp->l[7] = val & 0x3fff; adsp->lmask[7] = mask_table[val & 0x3fff]; adsp->base[7] = adsp->i[7] & adsp->lmask[7]; } | |
| 370 | static void wr_l0(adsp2100_state *adsp, INT32 val) { adsp->l[0] = val & 0x3fff; update_l(adsp, 0); } | |
| 371 | static void wr_l1(adsp2100_state *adsp, INT32 val) { adsp->l[1] = val & 0x3fff; update_l(adsp, 1); } | |
| 372 | static void wr_l2(adsp2100_state *adsp, INT32 val) { adsp->l[2] = val & 0x3fff; update_l(adsp, 2); } | |
| 373 | static void wr_l3(adsp2100_state *adsp, INT32 val) { adsp->l[3] = val & 0x3fff; update_l(adsp, 3); } | |
| 374 | static void wr_l4(adsp2100_state *adsp, INT32 val) { adsp->l[4] = val & 0x3fff; update_l(adsp, 4); } | |
| 375 | static void wr_l5(adsp2100_state *adsp, INT32 val) { adsp->l[5] = val & 0x3fff; update_l(adsp, 5); } | |
| 376 | static void wr_l6(adsp2100_state *adsp, INT32 val) { adsp->l[6] = val & 0x3fff; update_l(adsp, 6); } | |
| 377 | static void wr_l7(adsp2100_state *adsp, INT32 val) { adsp->l[7] = val & 0x3fff; update_l(adsp, 7); } | |
| 366 | 378 | static void wr_astat(adsp2100_state *adsp, INT32 val) { adsp->astat = val & 0x00ff; } |
| 367 | static void wr_mstat(adsp2100_state *adsp, INT32 val) { set_mstat(adsp, val & adsp->mstat_mask); } | |
| 368 | static void wr_sstat(adsp2100_state *adsp, INT32 val) { adsp->sstat = val & 0x00ff; } | |
| 379 | static void wr_mstat(adsp2100_state *adsp, INT32 val) { adsp->mstat = val & adsp->mstat_mask; update_mstat(adsp); } | |
| 369 | 380 | static void wr_imask(adsp2100_state *adsp, INT32 val) { adsp->imask = val & adsp->imask_mask; check_irqs(adsp); } |
| 370 | 381 | static void wr_icntl(adsp2100_state *adsp, INT32 val) { adsp->icntl = val & 0x001f; check_irqs(adsp); } |
| 371 | 382 | static void wr_cntr(adsp2100_state *adsp, INT32 val) { cntr_stack_push(adsp); adsp->cntr = val & 0x3fff; } |
| r3957 | r3958 | |
| 374 | 385 | static void wr_ifc(adsp2100_state *adsp, INT32 val) |
| 375 | 386 | { |
| 376 | 387 | adsp->ifc = val; |
| 377 | #if (HAS_ADSP2181) | |
| 378 | 388 | if (adsp->chip_type >= CHIP_TYPE_ADSP2181) |
| 379 | 389 | { |
| 380 | 390 | /* clear timer */ |
| r3957 | r3958 | |
| 395 | 405 | if (val & 0x8000) adsp->irq_latch[ADSP2181_IRQ2] = 1; |
| 396 | 406 | } |
| 397 | 407 | else |
| 398 | #endif | |
| 399 | 408 | { |
| 400 | 409 | /* clear timer */ |
| 401 | 410 | if (val & 0x002) adsp->irq_latch[ADSP2101_IRQ0] = 0; |
| r3957 | r3958 | |
|---|---|---|
| 211 | 211 | UINT32 astat; |
| 212 | 212 | UINT32 sstat; |
| 213 | 213 | UINT32 mstat; |
| 214 | UINT32 mstat_prev; | |
| 214 | 215 | UINT32 astat_clear; |
| 215 | 216 | UINT32 idle; |
| 216 | 217 | |
| r3957 | r3958 | |
| 261 | 262 | adsp21xx_tx_func sport_tx_callback; |
| 262 | 263 | adsp21xx_timer_func timer_fired; |
| 263 | 264 | |
| 264 | /* | |
| 265 | /* memory spaces */ | |
| 265 | 266 | const address_space *program; |
| 266 | 267 | const address_space *data; |
| 267 | 268 | const address_space *io; |
| 269 | cpu_state_table state; | |
| 268 | 270 | |
| 269 | 271 | } adsp2100_state; |
| 270 | 272 | |
| r3957 | r3958 | |
| 283 | 285 | #endif |
| 284 | 286 | |
| 285 | 287 | |
| 288 | ||
| 286 | 289 | /*************************************************************************** |
| 290 | CPU STATE DESCRIPTION | |
| 291 | ***************************************************************************/ | |
| 292 | ||
| 293 | #define ADSP21XX_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \ | |
| 294 | CPU_STATE_ENTRY(ADSP2100_##_name, #_name, _format, adsp2100_state, _member, _datamask, ~0, _flags) | |
| 295 | ||
| 296 | #define ADSP21XX_STATE_ENTRY_MASK(_name, _format, _member, _datamask, _flags, _validmask) \ | |
| 297 | CPU_STATE_ENTRY(ADSP2100_##_name, #_name, _format, adsp2100_state, _member, _datamask, _validmask, _flags) | |
| 298 | ||
| 299 | static const cpu_state_entry state_array[] = | |
| 300 | { | |
| 301 | ADSP21XX_STATE_ENTRY(PC, "%04X", pc, 0xffff, 0) | |
| 302 | ADSP21XX_STATE_ENTRY(GENPC, "%04X", pc, 0xffff, CPUSTATE_NOSHOW) | |
| 303 | ADSP21XX_STATE_ENTRY(GENPCBASE, "%04X", ppc, 0xffff, CPUSTATE_NOSHOW) | |
| 304 | ||
| 305 | ADSP21XX_STATE_ENTRY(AX0, "%04X", core.ax0.u, 0xffff, 0) | |
| 306 | ADSP21XX_STATE_ENTRY(AX1, "%04X", core.ax1.u, 0xffff, 0) | |
| 307 | ADSP21XX_STATE_ENTRY(AY0, "%04X", core.ay0.u, 0xffff, 0) | |
| 308 | ADSP21XX_STATE_ENTRY(AY1, "%04X", core.ay1.u, 0xffff, 0) | |
| 309 | ADSP21XX_STATE_ENTRY(AR, "%04X", core.ar.u, 0xffff, 0) | |
| 310 | ADSP21XX_STATE_ENTRY(AF, "%04X", core.af.u, 0xffff, 0) | |
| 311 | ||
| 312 | ADSP21XX_STATE_ENTRY(MX0, "%04X", core.mx0.u, 0xffff, 0) | |
| 313 | ADSP21XX_STATE_ENTRY(MX1, "%04X", core.mx1.u, 0xffff, 0) | |
| 314 | ADSP21XX_STATE_ENTRY(MY0, "%04X", core.my0.u, 0xffff, 0) | |
| 315 | ADSP21XX_STATE_ENTRY(MY1, "%04X", core.my1.u, 0xffff, 0) | |
| 316 | ADSP21XX_STATE_ENTRY(MR0, "%04X", core.mr.mrx.mr0.u, 0xffff, 0) | |
| 317 | ADSP21XX_STATE_ENTRY(MR1, "%04X", core.mr.mrx.mr1.u, 0xffff, 0) | |
| 318 | ADSP21XX_STATE_ENTRY(MR2, "%02X", core.mr.mrx.mr2.u, 0xff, CPUSTATE_IMPORT_SEXT) | |
| 319 | ADSP21XX_STATE_ENTRY(MF, "%04X", core.mf.u, 0xffff, 0) | |
| 320 | ||
| 321 | ADSP21XX_STATE_ENTRY(SI, "%04X", core.si.u, 0xffff, 0) | |
| 322 | ADSP21XX_STATE_ENTRY(SE, "%02X", core.se.u, 0xff, CPUSTATE_IMPORT_SEXT) | |
| 323 | ADSP21XX_STATE_ENTRY(SB, "%02X", core.sb.u, 0x1f, CPUSTATE_IMPORT_SEXT) | |
| 324 | ADSP21XX_STATE_ENTRY(SR0, "%04X", core.sr.srx.sr0.u, 0xffff, 0) | |
| 325 | ADSP21XX_STATE_ENTRY(SR1, "%04X", core.sr.srx.sr0.u, 0xffff, 0) | |
| 326 | ||
| 327 | ADSP21XX_STATE_ENTRY(AX0_SEC, "%04X", alt.ax0.u, 0xffff, 0) | |
| 328 | ADSP21XX_STATE_ENTRY(AX1_SEC, "%04X", alt.ax1.u, 0xffff, 0) | |
| 329 | ADSP21XX_STATE_ENTRY(AY0_SEC, "%04X", alt.ay0.u, 0xffff, 0) | |
| 330 | ADSP21XX_STATE_ENTRY(AY1_SEC, "%04X", alt.ay1.u, 0xffff, 0) | |
| 331 | ADSP21XX_STATE_ENTRY(AR_SEC, "%04X", alt.ar.u, 0xffff, 0) | |
| 332 | ADSP21XX_STATE_ENTRY(AF_SEC, "%04X", alt.af.u, 0xffff, 0) | |
| 333 | ||
| 334 | ADSP21XX_STATE_ENTRY(MX0_SEC, "%04X", alt.mx0.u, 0xffff, 0) | |
| 335 | ADSP21XX_STATE_ENTRY(MX1_SEC, "%04X", alt.mx1.u, 0xffff, 0) | |
| 336 | ADSP21XX_STATE_ENTRY(MY0_SEC, "%04X", alt.my0.u, 0xffff, 0) | |
| 337 | ADSP21XX_STATE_ENTRY(MY1_SEC, "%04X", alt.my1.u, 0xffff, 0) | |
| 338 | ADSP21XX_STATE_ENTRY(MR0_SEC, "%04X", alt.mr.mrx.mr0.u, 0xffff, 0) | |
| 339 | ADSP21XX_STATE_ENTRY(MR1_SEC, "%04X", alt.mr.mrx.mr1.u, 0xffff, 0) | |
| 340 | ADSP21XX_STATE_ENTRY(MR2_SEC, "%02X", alt.mr.mrx.mr2.u, 0xff, CPUSTATE_IMPORT_SEXT) | |
| 341 | ADSP21XX_STATE_ENTRY(MF_SEC, "%04X", alt.mf.u, 0xffff, 0) | |
| 342 | ||
| 343 | ADSP21XX_STATE_ENTRY(SI_SEC, "%04X", alt.si.u, 0xffff, 0) | |
| 344 | ADSP21XX_STATE_ENTRY(SE_SEC, "%02X", alt.se.u, 0xff, CPUSTATE_IMPORT_SEXT) | |
| 345 | ADSP21XX_STATE_ENTRY(SB_SEC, "%02X", alt.sb.u, 0x1f, CPUSTATE_IMPORT_SEXT) | |
| 346 | ADSP21XX_STATE_ENTRY(SR0_SEC, "%04X", alt.sr.srx.sr0.u, 0xffff, 0) | |
| 347 | ADSP21XX_STATE_ENTRY(SR1_SEC, "%04X", alt.sr.srx.sr0.u, 0xffff, 0) | |
| 348 | ||
| 349 | ADSP21XX_STATE_ENTRY(I0, "%04X", i[0], 0x3fff, CPUSTATE_IMPORT) | |
| 350 | ADSP21XX_STATE_ENTRY(I1, "%04X", i[1], 0x3fff, CPUSTATE_IMPORT) | |
| 351 | ADSP21XX_STATE_ENTRY(I2, "%04X", i[2], 0x3fff, CPUSTATE_IMPORT) | |
| 352 | ADSP21XX_STATE_ENTRY(I3, "%04X", i[3], 0x3fff, CPUSTATE_IMPORT) | |
| 353 | ADSP21XX_STATE_ENTRY(I4, "%04X", i[4], 0x3fff, CPUSTATE_IMPORT) | |
| 354 | ADSP21XX_STATE_ENTRY(I5, "%04X", i[5], 0x3fff, CPUSTATE_IMPORT) | |
| 355 | ADSP21XX_STATE_ENTRY(I6, "%04X", i[6], 0x3fff, CPUSTATE_IMPORT) | |
| 356 | ADSP21XX_STATE_ENTRY(I7, "%04X", i[7], 0x3fff, CPUSTATE_IMPORT) | |
| 357 | ||
| 358 | ADSP21XX_STATE_ENTRY(L0, "%04X", l[0], 0x3fff, CPUSTATE_IMPORT) | |
| 359 | ADSP21XX_STATE_ENTRY(L1, "%04X", l[1], 0x3fff, CPUSTATE_IMPORT) | |
| 360 | ADSP21XX_STATE_ENTRY(L2, "%04X", l[2], 0x3fff, CPUSTATE_IMPORT) | |
| 361 | ADSP21XX_STATE_ENTRY(L3, "%04X", l[3], 0x3fff, CPUSTATE_IMPORT) | |
| 362 | ADSP21XX_STATE_ENTRY(L4, "%04X", l[4], 0x3fff, CPUSTATE_IMPORT) | |
| 363 | ADSP21XX_STATE_ENTRY(L5, "%04X", l[5], 0x3fff, CPUSTATE_IMPORT) | |
| 364 | ADSP21XX_STATE_ENTRY(L6, "%04X", l[6], 0x3fff, CPUSTATE_IMPORT) | |
| 365 | ADSP21XX_STATE_ENTRY(L7, "%04X", l[7], 0x3fff, CPUSTATE_IMPORT) | |
| 366 | ||
| 367 | ADSP21XX_STATE_ENTRY(M0, "%04X", m[0], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 368 | ADSP21XX_STATE_ENTRY(M1, "%04X", m[1], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 369 | ADSP21XX_STATE_ENTRY(M2, "%04X", m[2], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 370 | ADSP21XX_STATE_ENTRY(M3, "%04X", m[3], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 371 | ADSP21XX_STATE_ENTRY(M4, "%04X", m[4], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 372 | ADSP21XX_STATE_ENTRY(M5, "%04X", m[5], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 373 | ADSP21XX_STATE_ENTRY(M6, "%04X", m[6], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 374 | ADSP21XX_STATE_ENTRY(M7, "%04X", m[7], 0x3fff, CPUSTATE_IMPORT_SEXT) | |
| 375 | ||
| 376 | ADSP21XX_STATE_ENTRY(PX, "%02X", px, 0xff, 0) | |
| 377 | ADSP21XX_STATE_ENTRY(CNTR, "%04X", cntr, 0x3fff, 0) | |
| 378 | ADSP21XX_STATE_ENTRY(ASTAT, "%02X", astat, 0xff, 0) | |
| 379 | ADSP21XX_STATE_ENTRY(SSTAT, "%02X", sstat, 0xff, 0) | |
| 380 | ADSP21XX_STATE_ENTRY_MASK(MSTAT, "%01X", mstat, 0x0f, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2100)) | |
| 381 | ADSP21XX_STATE_ENTRY_MASK(MSTAT, "%02X", mstat, 0x7f, CPUSTATE_IMPORT, ~(1 << CHIP_TYPE_ADSP2100)) | |
| 382 | ||
| 383 | ADSP21XX_STATE_ENTRY(PCSP, "%02X", pc_sp, 0xff, 0) | |
| 384 | ADSP21XX_STATE_ENTRY(GENSP, "%02X", pc_sp, 0xff, CPUSTATE_NOSHOW) | |
| 385 | ADSP21XX_STATE_ENTRY(CNTRSP, "%01X", cntr_sp, 0xf, 0) | |
| 386 | ADSP21XX_STATE_ENTRY(STATSP, "%01X", stat_sp, 0xf, 0) | |
| 387 | ADSP21XX_STATE_ENTRY(LOOPSP, "%01X", loop_sp, 0xf, 0) | |
| 388 | ||
| 389 | ADSP21XX_STATE_ENTRY_MASK(IMASK, "%01X", imask, 0x00f, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2100)) | |
| 390 | ADSP21XX_STATE_ENTRY_MASK(IMASK, "%02X", imask, 0x03f, CPUSTATE_IMPORT, ~((1 << CHIP_TYPE_ADSP2100) | (1 << CHIP_TYPE_ADSP2181))) | |
| 391 | ADSP21XX_STATE_ENTRY_MASK(IMASK, "%03X", imask, 0x3ff, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2181)) | |
| 392 | ADSP21XX_STATE_ENTRY(ICNTL, "%02X", icntl, 0x1f, CPUSTATE_IMPORT) | |
| 393 | ADSP21XX_STATE_ENTRY(IRQSTATE0, "%1u", irq_state[0], 0x1, CPUSTATE_IMPORT) | |
| 394 | ADSP21XX_STATE_ENTRY(IRQSTATE1, "%1u", irq_state[1], 0x1, CPUSTATE_IMPORT) | |
| 395 | ADSP21XX_STATE_ENTRY(IRQSTATE2, "%1u", irq_state[2], 0x1, CPUSTATE_IMPORT) | |
| 396 | ADSP21XX_STATE_ENTRY_MASK(IRQSTATE3, "%1u", irq_state[3], 0x1, CPUSTATE_IMPORT, (1 << CHIP_TYPE_ADSP2100)) | |
| 397 | ||
| 398 | ADSP21XX_STATE_ENTRY(FLAGIN, "%1u", flagin, 0x1, 0) | |
| 399 | ADSP21XX_STATE_ENTRY(FLAGOUT, "%1u", flagout, 0x1, 0) | |
| 400 | ADSP21XX_STATE_ENTRY(FL0, "%1u", fl0, 0x1, 0) | |
| 401 | ADSP21XX_STATE_ENTRY(FL1, "%1u", fl1, 0x1, 0) | |
| 402 | ADSP21XX_STATE_ENTRY(FL2, "%1u", fl2, 0x1, 0) | |
| 403 | }; | |
| 404 | ||
| 405 | static const cpu_state_table state_table_template = | |
| 406 | { | |
| 407 | NULL, /* pointer to the base of state (offsets are relative to this) */ | |
| 408 | 0, /* subtype this table refers to */ | |
| 409 | ARRAY_LENGTH(state_array), /* number of entries */ | |
| 410 | state_array /* array of entries */ | |
| 411 | }; | |
| 412 | ||
| 413 | ||
| 414 | ||
| 415 | /*************************************************************************** | |
| 287 | 416 | PRIVATE FUNCTION PROTOTYPES |
| 288 | 417 | ***************************************************************************/ |
| 289 | 418 | |
| r3957 | r3958 | |
| 419 | 548 | { |
| 420 | 549 | UINT8 check; |
| 421 | 550 | |
| 422 | #if (HAS_ADSP2181) | |
| 423 | 551 | if (adsp->chip_type >= CHIP_TYPE_ADSP2181) |
| 424 | 552 | { |
| 425 | 553 | /* check IRQ2 */ |
| r3957 | r3958 | |
| 469 | 597 | if (check && adsp2181_generate_irq(adsp, ADSP2181_TIMER, 9)) |
| 470 | 598 | return; |
| 471 | 599 | } |
| 472 | else | |
| 473 | #endif | |
| 474 | if (adsp->chip_type >= CHIP_TYPE_ADSP2101) | |
| 600 | else if (adsp->chip_type >= CHIP_TYPE_ADSP2101) | |
| 475 | 601 | { |
| 476 | 602 | /* check IRQ2 */ |
| 477 | 603 | check = (adsp->icntl & 4) ? adsp->irq_latch[ADSP2101_IRQ2] : adsp->irq_state[ADSP2101_IRQ2]; |
| r3957 | r3958 | |
| 544 | 670 | INITIALIZATION AND SHUTDOWN |
| 545 | 671 | ***************************************************************************/ |
| 546 | 672 | |
| 547 | static adsp2100_state *adsp21xx_init(const device_config *device, | |
| 673 | static adsp2100_state *adsp21xx_init(const device_config *device, | |
| 548 | 674 | { |
| 675 | const adsp21xx_config *config = device->static_config; | |
| 549 | 676 | adsp2100_state *adsp = device->token; |
| 550 | 677 | |
| 551 | 678 | /* create the tables */ |
| r3957 | r3958 | |
| 553 | 680 | fatalerror("creating adsp2100 tables failed"); |
| 554 | 681 | |
| 555 | 682 | /* set the IRQ callback */ |
| 683 | adsp->chip_type = chiptype; | |
| 556 | 684 | adsp->irq_callback = irqcallback; |
| 557 | adsp->device = device; | |
| 558 | 685 | |
| 686 | /* fetch device parameters */ | |
| 687 | adsp->device = device; | |
| 559 | 688 | adsp->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 560 | 689 | adsp->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA); |
| 561 | 690 | adsp->io = cpu_get_address_space(device, ADDRESS_SPACE_IO); |
| 562 | 691 | |
| 692 | /* copy function pointers from the config */ | |
| 693 | if (config != NULL) | |
| 694 | { | |
| 695 | adsp->sport_rx_callback = config->rx; | |
| 696 | adsp->sport_tx_callback = config->tx; | |
| 697 | adsp->timer_fired = config->timer; | |
| 698 | } | |
| 563 | 699 | |
| 700 | /* set up the state table */ | |
| 701 | adsp->state = state_table_template; | |
| 702 | adsp->state.baseptr = adsp; | |
| 703 | adsp->state.subtypemask = 1 << chiptype; | |
| 564 | 704 | |
| 565 | 705 | /* set up ALU register pointers */ |
| 566 | 706 | adsp->alu_xregs[0] = &adsp->core.ax0; |
| r3957 | r3958 | |
| 653 | 793 | state_save_register_device_item(device, 0, adsp->astat); |
| 654 | 794 | state_save_register_device_item(device, 0, adsp->sstat); |
| 655 | 795 | state_save_register_device_item(device, 0, adsp->mstat); |
| 796 | state_save_register_device_item(device, 0, adsp->mstat_prev); | |
| 656 | 797 | state_save_register_device_item(device, 0, adsp->astat_clear); |
| 657 | 798 | state_save_register_device_item(device, 0, adsp->idle); |
| 658 | 799 | |
| r3957 | r3958 | |
| 734 | 875 | adsp->mstat = 0; |
| 735 | 876 | adsp->sstat = 0x55; |
| 736 | 877 | adsp->idle = 0; |
| 878 | update_mstat(adsp); | |
| 737 | 879 | |
| 738 | 880 | /* reset stacks */ |
| 739 | 881 | adsp->pc_sp = 0; |
| r3957 | r3958 | |
| 892 | 1034 | |
| 893 | 1035 | check_irqs(adsp); |
| 894 | 1036 | |
| 895 | /* reset the core */ | |
| 896 | set_mstat(adsp, adsp->mstat); | |
| 897 | ||
| 898 | 1037 | /* count cycles and interrupt cycles */ |
| 899 | 1038 | adsp->icount = cycles; |
| 900 | 1039 | |
| r3957 | r3958 | |
| 1086 | 1225 | break; |
| 1087 | 1226 | case 0x0c: |
| 1088 | 1227 | /* 00001100 xxxxxxxx xxxxxxxx mode control */ |
| 1089 | temp = adsp->mstat; | |
| 1090 | 1228 | if (adsp->chip_type >= CHIP_TYPE_ADSP2101) |
| 1091 | 1229 | { |
| 1092 | if (op & 0x000008) temp = (temp & ~MSTAT_GOMODE) | ((op << 5) & MSTAT_GOMODE); | |
| 1093 | if (op & 0x002000) temp = (temp & ~MSTAT_INTEGER) | ((op >> 8) & MSTAT_INTEGER); | |
| 1094 | if (op & 0x008000) temp = (temp & ~MSTAT_TIMER) | ((op >> 9) & MSTAT_TIMER); | |
| 1230 | if (op & 0x000008) adsp->mstat = (adsp->mstat & ~MSTAT_GOMODE) | ((op << 5) & MSTAT_GOMODE); | |
| 1231 | if (op & 0x002000) adsp->mstat = (adsp->mstat & ~MSTAT_INTEGER) | ((op >> 8) & MSTAT_INTEGER); | |
| 1232 | if (op & 0x008000) adsp->mstat = (adsp->mstat & ~MSTAT_TIMER) | ((op >> 9) & MSTAT_TIMER); | |
| 1095 | 1233 | } |
| 1096 | if (op & 0x000020) temp = (temp & ~MSTAT_BANK) | ((op >> 4) & MSTAT_BANK); | |
| 1097 | if (op & 0x000080) temp = (temp & ~MSTAT_REVERSE) | ((op >> 5) & MSTAT_REVERSE); | |
| 1098 | if (op & 0x000200) temp = (temp & ~MSTAT_STICKYV) | ((op >> 6) & MSTAT_STICKYV); | |
| 1099 | if (op & 0x000800) temp = (temp & ~MSTAT_SATURATE) | ((op >> 7) & MSTAT_SATURATE); | |
| 1100 | set_mstat(adsp, temp); | |
| 1234 | if (op & 0x000020) adsp->mstat = (adsp->mstat & ~MSTAT_BANK) | ((op >> 4) & MSTAT_BANK); | |
| 1235 | if (op & 0x000080) adsp->mstat = (adsp->mstat & ~MSTAT_REVERSE) | ((op >> 5) & MSTAT_REVERSE); | |
| 1236 | if (op & 0x000200) adsp->mstat = (adsp->mstat & ~MSTAT_STICKYV) | ((op >> 6) & MSTAT_STICKYV); | |
| 1237 | if (op & 0x000800) adsp->mstat = (adsp->mstat & ~MSTAT_SATURATE) | ((op >> 7) & MSTAT_SATURATE); | |
| 1238 | update_mstat(adsp); | |
| 1101 | 1239 | break; |
| 1102 | 1240 | case 0x0d: |
| 1103 | 1241 | /* 00001101 0000xxxx xxxxxxxx internal data move */ |
| r3957 | r3958 | |
| 1641 | 1779 | |
| 1642 | 1780 | |
| 1643 | 1781 | |
| 1644 | /************************************************************************** | |
| 1645 | * Generic set_info | |
| 1646 | **************************************************************************/ | |
| 1782 | /*************************************************************************** | |
| 1783 | STATE HANDLING CALLBACKS | |
| 1784 | ***************************************************************************/ | |
| 1647 | 1785 | |
| 1648 | static CPU_ | |
| 1786 | static CPU_ | |
| 1649 | 1787 | { |
| 1650 | 1788 | adsp2100_state *adsp = device->token; |
| 1651 | switch ( | |
| 1789 | switch (entry->index) | |
| 1652 | 1790 | { |
| 1653 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 1654 | case CPUINFO_INT_PC: | |
| 1655 | case CPUINFO_INT_REGISTER + ADSP2100_PC: adsp->pc = info->i; break; | |
| 1791 | case ADSP2100_MSTAT: | |
| 1792 | update_mstat(adsp); | |
| 1793 | break; | |
| 1656 | 1794 | |
| 1657 | case CPUINFO_INT_REGISTER + ADSP2100_AX0: wr_ax0(adsp, info->i); break; | |
| 1658 | case CPUINFO_INT_REGISTER + ADSP2100_AX1: wr_ax1(adsp, info->i); break; | |
| 1659 | case CPUINFO_INT_REGISTER + ADSP2100_AY0: wr_ay0(adsp, info->i); break; | |
| 1660 | case CPUINFO_INT_REGISTER + ADSP2100_AY1: wr_ay1(adsp, info->i); break; | |
| 1661 | case CPUINFO_INT_REGISTER + ADSP2100_AR: wr_ar(adsp, info->i); break; | |
| 1662 | case CPUINFO_INT_REGISTER + ADSP2100_AF: adsp->core.af.u = info->i; break; | |
| 1795 | case ADSP2100_IMASK: | |
| 1796 | case ADSP2100_ICNTL: | |
| 1797 | case ADSP2100_IRQSTATE0: | |
| 1798 | case ADSP2100_IRQSTATE1: | |
| 1799 | case ADSP2100_IRQSTATE2: | |
| 1800 | case ADSP2100_IRQSTATE3: | |
| 1801 | check_irqs(adsp); | |
| 1802 | break; | |
| 1663 | 1803 | |
| 1664 | case CPUINFO_INT_REGISTER + ADSP2100_MX0: wr_mx0(adsp, info->i); break; | |
| 1665 | case CPUINFO_INT_REGISTER + ADSP2100_MX1: wr_mx1(adsp, info->i); break; | |
| 1666 | case CPUINFO_INT_REGISTER + ADSP2100_MY0: wr_my0(adsp, info->i); break; | |
| 1667 | case CPUINFO_INT_REGISTER + ADSP2100_MY1: wr_my1(adsp, info->i); break; | |
| 1668 | case CPUINFO_INT_REGISTER + ADSP2100_MR0: wr_mr0(adsp, info->i); break; | |
| 1669 | case CPUINFO_INT_REGISTER + ADSP2100_MR1: wr_mr1(adsp, info->i); break; | |
| 1670 | case CPUINFO_INT_REGISTER + ADSP2100_MR2: wr_mr2(adsp, info->i); break; | |
| 1671 | case CPUINFO_INT_REGISTER + ADSP2100_MF: adsp->core.mf.u = info->i; break; | |
| 1804 | case ADSP2100_I0: | |
| 1805 | case ADSP2100_I1: | |
| 1806 | case ADSP2100_I2: | |
| 1807 | case ADSP2100_I3: | |
| 1808 | case ADSP2100_I4: | |
| 1809 | case ADSP2100_I5: | |
| 1810 | case ADSP2100_I6: | |
| 1811 | case ADSP2100_I7: | |
| 1812 | update_i(adsp, entry->index - ADSP2100_I0); | |
| 1813 | break; | |
| 1672 | 1814 | |
| 1673 | case CPUINFO_INT_REGISTER + ADSP2100_SI: wr_si(adsp, info->i); break; | |
| 1674 | case CPUINFO_INT_REGISTER + ADSP2100_SE: wr_se(adsp, info->i); break; | |
| 1675 | case CPUINFO_INT_REGISTER + ADSP2100_SB: wr_sb(adsp, info->i); break; | |
| 1676 | case CPUINFO_INT_REGISTER + ADSP2100_SR0: wr_sr0(adsp, info->i); break; | |
| 1677 | case CPUINFO_INT_REGISTER + ADSP2100_SR1: wr_sr1(adsp, info->i); break; | |
| 1815 | case ADSP2100_L0: | |
| 1816 | case ADSP2100_L1: | |
| 1817 | case ADSP2100_L2: | |
| 1818 | case ADSP2100_L3: | |
| 1819 | case ADSP2100_L4: | |
| 1820 | case ADSP2100_L5: | |
| 1821 | case ADSP2100_L6: | |
| 1822 | case ADSP2100_L7: | |
| 1823 | update_l(adsp, entry->index - ADSP2100_L0); | |
| 1824 | break; | |
| 1678 | 1825 | |
| 1679 | case CPUINFO_INT_REGISTER + ADSP2100_AX0_SEC: adsp->alt.ax0.s = info->i; break; | |
| 1680 | case CPUINFO_INT_REGISTER + ADSP2100_AX1_SEC: adsp->alt.ax1.s = info->i; break; | |
| 1681 | case CPUINFO_INT_REGISTER + ADSP2100_AY0_SEC: adsp->alt.ay0.s = info->i; break; | |
| 1682 | case CPUINFO_INT_REGISTER + ADSP2100_AY1_SEC: adsp->alt.ay1.s = info->i; break; | |
| 1683 | case CPUINFO_INT_REGISTER + ADSP2100_AR_SEC: adsp->alt.ar.s = info->i; break; | |
| 1684 | case CPUINFO_INT_REGISTER + ADSP2100_AF_SEC: adsp->alt.af.u = info->i; break; | |
| 1826 | default: | |
| 1827 | fatalerror("CPU_IMPORT_STATE(adsp21xx) called for unexpected value\n"); | |
| 1828 | break; | |
| 1829 | } | |
| 1830 | } | |
| 1685 | 1831 | |
| 1686 | case CPUINFO_INT_REGISTER + ADSP2100_MX0_SEC: adsp->alt.mx0.s = info->i; break; | |
| 1687 | case CPUINFO_INT_REGISTER + ADSP2100_MX1_SEC: adsp->alt.mx1.s = info->i; break; | |
| 1688 | case CPUINFO_INT_REGISTER + ADSP2100_MY0_SEC: adsp->alt.my0.s = info->i; break; | |
| 1689 | case CPUINFO_INT_REGISTER + ADSP2100_MY1_SEC: adsp->alt.my1.s = info->i; break; | |
| 1690 | case CPUINFO_INT_REGISTER + ADSP2100_MR0_SEC: adsp->alt.mr.mrx.mr0.s = info->i; break; | |
| 1691 | case CPUINFO_INT_REGISTER + ADSP2100_MR1_SEC: adsp->alt.mr.mrx.mr1.s = info->i; adsp->alt.mr.mrx.mr2.s = (INT16)info->i >> 15; break; | |
| 1692 | case CPUINFO_INT_REGISTER + ADSP2100_MR2_SEC: adsp->alt.mr.mrx.mr2.s = (INT8)info->i; break; | |
| 1693 | case CPUINFO_INT_REGISTER + ADSP2100_MF_SEC: adsp->alt.mf.u = info->i; break; | |
| 1694 | 1832 | |
| 1695 | case CPUINFO_INT_REGISTER + ADSP2100_SI_SEC: adsp->alt.si.s = info->i; break; | |
| 1696 | case CPUINFO_INT_REGISTER + ADSP2100_SE_SEC: adsp->alt.se.s = (INT8)info->i; break; | |
| 1697 | case CPUINFO_INT_REGISTER + ADSP2100_SB_SEC: adsp->alt.sb.s = (INT32)(info->i << 27) >> 27; break; | |
| 1698 | case CPUINFO_INT_REGISTER + ADSP2100_SR0_SEC: adsp->alt.sr.srx.sr0.s = info->i; break; | |
| 1699 | case CPUINFO_INT_REGISTER + ADSP2100_SR1_SEC: adsp->alt.sr.srx.sr1.s = info->i; break; | |
| 1700 | 1833 | |
| 1701 | case CPUINFO_INT_REGISTER + ADSP2100_I0: wr_i0(adsp, info->i); break; | |
| 1702 | case CPUINFO_INT_REGISTER + ADSP2100_I1: wr_i1(adsp, info->i); break; | |
| 1703 | case CPUINFO_INT_REGISTER + ADSP2100_I2: wr_i2(adsp, info->i); break; | |
| 1704 | case CPUINFO_INT_REGISTER + ADSP2100_I3: wr_i3(adsp, info->i); break; | |
| 1705 | case CPUINFO_INT_REGISTER + ADSP2100_I4: wr_i4(adsp, info->i); break; | |
| 1706 | case CPUINFO_INT_REGISTER + ADSP2100_I5: wr_i5(adsp, info->i); break; | |
| 1707 | case CPUINFO_INT_REGISTER + ADSP2100_I6: wr_i6(adsp, info->i); break; | |
| 1708 | case CPUINFO_INT_REGISTER + ADSP2100_I7: wr_i7(adsp, info->i); break; | |
| 1834 | /************************************************************************** | |
| 1835 | * Generic set_info | |
| 1836 | **************************************************************************/ | |
| 1709 | 1837 | |
| 1710 | case CPUINFO_INT_REGISTER + ADSP2100_L0: wr_l0(adsp, info->i); break; | |
| 1711 | case CPUINFO_INT_REGISTER + ADSP2100_L1: wr_l1(adsp, info->i); break; | |
| 1712 | case CPUINFO_INT_REGISTER + ADSP2100_L2: wr_l2(adsp, info->i); break; | |
| 1713 | case CPUINFO_INT_REGISTER + ADSP2100_L3: wr_l3(adsp, info->i); break; | |
| 1714 | case CPUINFO_INT_REGISTER + ADSP2100_L4: wr_l4(adsp, info->i); break; | |
| 1715 | case CPUINFO_INT_REGISTER + ADSP2100_L5: wr_l5(adsp, info->i); break; | |
| 1716 | case CPUINFO_INT_REGISTER + ADSP2100_L6: wr_l6(adsp, info->i); break; | |
| 1717 | case CPUINFO_INT_REGISTER + ADSP2100_L7: wr_l7(adsp, info->i); break; | |
| 1718 | ||
| 1719 | case CPUINFO_INT_REGISTER + ADSP2100_M0: wr_m0(adsp, info->i); break; | |
| 1720 | case CPUINFO_INT_REGISTER + ADSP2100_M1: wr_m1(adsp, info->i); break; | |
| 1721 | case CPUINFO_INT_REGISTER + ADSP2100_M2: wr_m2(adsp, info->i); break; | |
| 1722 | case CPUINFO_INT_REGISTER + ADSP2100_M3: wr_m3(adsp, info->i); break; | |
| 1723 | case CPUINFO_INT_REGISTER + ADSP2100_M4: wr_m4(adsp, info->i); break; | |
| 1724 | case CPUINFO_INT_REGISTER + ADSP2100_M5: wr_m5(adsp, info->i); break; | |
| 1725 | case CPUINFO_INT_REGISTER + ADSP2100_M6: wr_m6(adsp, info->i); break; | |
| 1726 | case CPUINFO_INT_REGISTER + ADSP2100_M7: wr_m7(adsp, info->i); break; | |
| 1727 | ||
| 1728 | case CPUINFO_INT_REGISTER + ADSP2100_PX: wr_px(adsp, info->i); break; | |
| 1729 | case CPUINFO_INT_REGISTER + ADSP2100_CNTR: adsp->cntr = info->i; break; | |
| 1730 | case CPUINFO_INT_REGISTER + ADSP2100_ASTAT: wr_astat(adsp, info->i); break; | |
| 1731 | case CPUINFO_INT_REGISTER + ADSP2100_SSTAT: wr_sstat(adsp, info->i); break; | |
| 1732 | case CPUINFO_INT_REGISTER + ADSP2100_MSTAT: wr_mstat(adsp, info->i); break; | |
| 1733 | ||
| 1734 | case CPUINFO_INT_SP: | |
| 1735 | case CPUINFO_INT_REGISTER + ADSP2100_PCSP: adsp->pc_sp = info->i; break; | |
| 1736 | case CPUINFO_INT_REGISTER + ADSP2100_CNTRSP: adsp->cntr_sp = info->i; break; | |
| 1737 | case CPUINFO_INT_REGISTER + ADSP2100_STATSP: adsp->stat_sp = info->i; break; | |
| 1738 | case CPUINFO_INT_REGISTER + ADSP2100_LOOPSP: adsp->loop_sp = info->i; break; | |
| 1739 | ||
| 1740 | case CPUINFO_INT_REGISTER + ADSP2100_IMASK: wr_imask(adsp, info->i); break; | |
| 1741 | case CPUINFO_INT_REGISTER + ADSP2100_ICNTL: wr_icntl(adsp, info->i); break; | |
| 1742 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE0: adsp->irq_state[0] = info->i; break; | |
| 1743 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE1: adsp->irq_state[1] = info->i; break; | |
| 1744 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE2: adsp->irq_state[2] = info->i; break; | |
| 1745 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE3: adsp->irq_state[3] = info->i; break; | |
| 1746 | ||
| 1747 | case CPUINFO_INT_REGISTER + ADSP2100_FLAGIN: adsp->flagin = info->i; break; | |
| 1748 | case CPUINFO_INT_REGISTER + ADSP2100_FLAGOUT: adsp->flagout = info->i; break; | |
| 1749 | case CPUINFO_INT_REGISTER + ADSP2100_FL0: adsp->fl0 = info->i; break; | |
| 1750 | case CPUINFO_INT_REGISTER + ADSP2100_FL1: adsp->fl1 = info->i; break; | |
| 1751 | case CPUINFO_INT_REGISTER + ADSP2100_FL2: adsp->fl2 = info->i; break; | |
| 1838 | static CPU_SET_INFO( adsp21xx ) | |
| 1839 | { | |
| 1840 | adsp2100_state *adsp = device->token; | |
| 1841 | switch (state) | |
| 1842 | { | |
| 1843 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 1844 | case CPUINFO_INT_INPUT_STATE + 0: | |
| 1845 | case CPUINFO_INT_INPUT_STATE + 1: | |
| 1846 | case CPUINFO_INT_INPUT_STATE + 2: | |
| 1847 | case CPUINFO_INT_INPUT_STATE + 3: | |
| 1848 | case CPUINFO_INT_INPUT_STATE + 4: | |
| 1849 | case CPUINFO_INT_INPUT_STATE + 5: | |
| 1850 | case CPUINFO_INT_INPUT_STATE + 6: | |
| 1851 | case CPUINFO_INT_INPUT_STATE + 7: | |
| 1852 | case CPUINFO_INT_INPUT_STATE + 8: | |
| 1853 | case CPUINFO_INT_INPUT_STATE + 9: | |
| 1854 | set_irq_line(adsp, state - CPUINFO_INT_INPUT_STATE, info->i); | |
| 1855 | break; | |
| 1752 | 1856 | } |
| 1753 | 1857 | } |
| 1754 | 1858 | |
| r3957 | r3958 | |
| 1767 | 1871 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(adsp2100_state); break; |
| 1768 | 1872 | case CPUINFO_INT_INPUT_LINES: /* set per CPU */ break; |
| 1769 | 1873 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; |
| 1770 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; | |
| 1874 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; | |
| 1771 | 1875 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; |
| 1772 | 1876 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |
| 1773 | 1877 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 4; break; |
| r3957 | r3958 | |
| 1775 | 1879 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1776 | 1880 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 1777 | 1881 | |
| 1778 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1779 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 14; break; | |
| 1780 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -2; break; | |
| 1781 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 1782 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 14; break; | |
| 1783 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -1; break; | |
| 1784 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1785 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1786 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1882 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1883 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 14; break; | |
| 1884 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -2; break; | |
| 1885 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 16; break; | |
| 1886 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 14; break; | |
| 1887 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -1; break; | |
| 1787 | 1888 | |
| 1788 | case CPUINFO_INT_PREVIOUSPC: info->i = adsp->ppc; break; | |
| 1789 | case CPUINFO_INT_PC: | |
| 1790 | case CPUINFO_INT_REGISTER + ADSP2100_PC: info->i = adsp->pc; break; | |
| 1889 | case CPUINFO_INT_INPUT_STATE + 0: | |
| 1890 | case CPUINFO_INT_INPUT_STATE + 1: | |
| 1891 | case CPUINFO_INT_INPUT_STATE + 2: | |
| 1892 | case CPUINFO_INT_INPUT_STATE + 3: | |
| 1893 | case CPUINFO_INT_INPUT_STATE + 4: | |
| 1894 | case CPUINFO_INT_INPUT_STATE + 5: | |
| 1895 | case CPUINFO_INT_INPUT_STATE + 6: | |
| 1896 | case CPUINFO_INT_INPUT_STATE + 7: | |
| 1897 | case CPUINFO_INT_INPUT_STATE + 8: | |
| 1898 | case CPUINFO_INT_INPUT_STATE + 9: | |
| 1899 | info->i = adsp->irq_state[state - CPUINFO_INT_INPUT_STATE]; | |
| 1900 | break; | |
| 1791 | 1901 | |
| 1792 | case CPUINFO_INT_REGISTER + ADSP2100_AX0: info->i = adsp->core.ax0.u; break; | |
| 1793 | case CPUINFO_INT_REGISTER + ADSP2100_AX1: info->i = adsp->core.ax1.u; break; | |
| 1794 | case CPUINFO_INT_REGISTER + ADSP2100_AY0: info->i = adsp->core.ay0.u; break; | |
| 1795 | case CPUINFO_INT_REGISTER + ADSP2100_AY1: info->i = adsp->core.ay1.u; break; | |
| 1796 | case CPUINFO_INT_REGISTER + ADSP2100_AR: info->i = adsp->core.ar.u; break; | |
| 1797 | case CPUINFO_INT_REGISTER + ADSP2100_AF: info->i = adsp->core.af.u; break; | |
| 1902 | /* --- the following bits of info are returned as pointers to functions --- */ | |
| 1903 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp21xx); break; | |
| 1904 | case CPUINFO_FCT_INIT: /* set per CPU */ break; | |
| 1905 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(adsp21xx); break; | |
| 1906 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(adsp21xx); break; | |
| 1907 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(adsp21xx); break; | |
| 1908 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(adsp21xx); break; | |
| 1909 | case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(adsp21xx); break; | |
| 1798 | 1910 | |
| 1799 | case CPUINFO_INT_REGISTER + ADSP2100_MX0: info->i = adsp->core.mx0.u; break; | |
| 1800 | case CPUINFO_INT_REGISTER + ADSP2100_MX1: info->i = adsp->core.mx1.u; break; | |
| 1801 | case CPUINFO_INT_REGISTER + ADSP2100_MY0: info->i = adsp->core.my0.u; break; | |
| 1802 | case CPUINFO_INT_REGISTER + ADSP2100_MY1: info->i = adsp->core.my1.u; break; | |
| 1803 | case CPUINFO_INT_REGISTER + ADSP2100_MR0: info->i = adsp->core.mr.mrx.mr0.u; break; | |
| 1804 | case CPUINFO_INT_REGISTER + ADSP2100_MR1: info->i = adsp->core.mr.mrx.mr1.u; break; | |
| 1805 | case CPUINFO_INT_REGISTER + ADSP2100_MR2: info->i = adsp->core.mr.mrx.mr2.u; break; | |
| 1806 | case CPUINFO_INT_REGISTER + ADSP2100_MF: info->i = adsp->core.mf.u; break; | |
| 1807 | ||
| 1808 | case CPUINFO_INT_REGISTER + ADSP2100_SI: info->i = adsp->core.si.u; break; | |
| 1809 | case CPUINFO_INT_REGISTER + ADSP2100_SE: info->i = adsp->core.se.u; break; | |
| 1810 | case CPUINFO_INT_REGISTER + ADSP2100_SB: info->i = adsp->core.sb.u; break; | |
| 1811 | case CPUINFO_INT_REGISTER + ADSP2100_SR0: info->i = adsp->core.sr.srx.sr0.u; break; | |
| 1812 | case CPUINFO_INT_REGISTER + ADSP2100_SR1: info->i = adsp->core.sr.srx.sr1.u; break; | |
| 1813 | ||
| 1814 | case CPUINFO_INT_REGISTER + ADSP2100_AX0_SEC: info->i = adsp->alt.ax0.u; break; | |
| 1815 | case CPUINFO_INT_REGISTER + ADSP2100_AX1_SEC: info->i = adsp->alt.ax1.u; break; | |
| 1816 | case CPUINFO_INT_REGISTER + ADSP2100_AY0_SEC: info->i = adsp->alt.ay0.u; break; | |
| 1817 | case CPUINFO_INT_REGISTER + ADSP2100_AY1_SEC: info->i = adsp->alt.ay1.u; break; | |
| 1818 | case CPUINFO_INT_REGISTER + ADSP2100_AR_SEC: info->i = adsp->alt.ar.u; break; | |
| 1819 | case CPUINFO_INT_REGISTER + ADSP2100_AF_SEC: info->i = adsp->alt.af.u; break; | |
| 1820 | ||
| 1821 | case CPUINFO_INT_REGISTER + ADSP2100_MX0_SEC: info->i = adsp->alt.mx0.u; break; | |
| 1822 | case CPUINFO_INT_REGISTER + ADSP2100_MX1_SEC: info->i = adsp->alt.mx1.u; break; | |
| 1823 | case CPUINFO_INT_REGISTER + ADSP2100_MY0_SEC: info->i = adsp->alt.my0.u; break; | |
| 1824 | case CPUINFO_INT_REGISTER + ADSP2100_MY1_SEC: info->i = adsp->alt.my1.u; break; | |
| 1825 | case CPUINFO_INT_REGISTER + ADSP2100_MR0_SEC: info->i = adsp->alt.mr.mrx.mr0.u; break; | |
| 1826 | case CPUINFO_INT_REGISTER + ADSP2100_MR1_SEC: info->i = adsp->alt.mr.mrx.mr1.u; break; | |
| 1827 | case CPUINFO_INT_REGISTER + ADSP2100_MR2_SEC: info->i = adsp->alt.mr.mrx.mr2.u; break; | |
| 1828 | case CPUINFO_INT_REGISTER + ADSP2100_MF_SEC: info->i = adsp->alt.mf.u; break; | |
| 1829 | ||
| 1830 | case CPUINFO_INT_REGISTER + ADSP2100_SI_SEC: info->i = adsp->alt.si.u; break; | |
| 1831 | case CPUINFO_INT_REGISTER + ADSP2100_SE_SEC: info->i = adsp->alt.se.u; break; | |
| 1832 | case CPUINFO_INT_REGISTER + ADSP2100_SB_SEC: info->i = adsp->alt.sb.u; break; | |
| 1833 | case CPUINFO_INT_REGISTER + ADSP2100_SR0_SEC: info->i = adsp->alt.sr.srx.sr0.u; break; | |
| 1834 | case CPUINFO_INT_REGISTER + ADSP2100_SR1_SEC: info->i = adsp->alt.sr.srx.sr1.u; break; | |
| 1835 | ||
| 1836 | case CPUINFO_INT_REGISTER + ADSP2100_I0: info->i = adsp->i[0]; break; | |
| 1837 | case CPUINFO_INT_REGISTER + ADSP2100_I1: info->i = adsp->i[1]; break; | |
| 1838 | case CPUINFO_INT_REGISTER + ADSP2100_I2: info->i = adsp->i[2]; break; | |
| 1839 | case CPUINFO_INT_REGISTER + ADSP2100_I3: info->i = adsp->i[3]; break; | |
| 1840 | case CPUINFO_INT_REGISTER + ADSP2100_I4: info->i = adsp->i[4]; break; | |
| 1841 | case CPUINFO_INT_REGISTER + ADSP2100_I5: info->i = adsp->i[5]; break; | |
| 1842 | case CPUINFO_INT_REGISTER + ADSP2100_I6: info->i = adsp->i[6]; break; | |
| 1843 | case CPUINFO_INT_REGISTER + ADSP2100_I7: info->i = adsp->i[7]; break; | |
| 1844 | ||
| 1845 | case CPUINFO_INT_REGISTER + ADSP2100_L0: info->i = adsp->l[0]; break; | |
| 1846 | case CPUINFO_INT_REGISTER + ADSP2100_L1: info->i = adsp->l[1]; break; | |
| 1847 | case CPUINFO_INT_REGISTER + ADSP2100_L2: info->i = adsp->l[2]; break; | |
| 1848 | case CPUINFO_INT_REGISTER + ADSP2100_L3: info->i = adsp->l[3]; break; | |
| 1849 | case CPUINFO_INT_REGISTER + ADSP2100_L4: info->i = adsp->l[4]; break; | |
| 1850 | case CPUINFO_INT_REGISTER + ADSP2100_L5: info->i = adsp->l[5]; break; | |
| 1851 | case CPUINFO_INT_REGISTER + ADSP2100_L6: info->i = adsp->l[6]; break; | |
| 1852 | case CPUINFO_INT_REGISTER + ADSP2100_L7: info->i = adsp->l[7]; break; | |
| 1853 | ||
| 1854 | case CPUINFO_INT_REGISTER + ADSP2100_M0: info->i = adsp->m[0]; break; | |
| 1855 | case CPUINFO_INT_REGISTER + ADSP2100_M1: info->i = adsp->m[1]; break; | |
| 1856 | case CPUINFO_INT_REGISTER + ADSP2100_M2: info->i = adsp->m[2]; break; | |
| 1857 | case CPUINFO_INT_REGISTER + ADSP2100_M3: info->i = adsp->m[3]; break; | |
| 1858 | case CPUINFO_INT_REGISTER + ADSP2100_M4: info->i = adsp->m[4]; break; | |
| 1859 | case CPUINFO_INT_REGISTER + ADSP2100_M5: info->i = adsp->m[5]; break; | |
| 1860 | case CPUINFO_INT_REGISTER + ADSP2100_M6: info->i = adsp->m[6]; break; | |
| 1861 | case CPUINFO_INT_REGISTER + ADSP2100_M7: info->i = adsp->m[7]; break; | |
| 1862 | ||
| 1863 | case CPUINFO_INT_REGISTER + ADSP2100_PX: info->i = adsp->px; break; | |
| 1864 | case CPUINFO_INT_REGISTER + ADSP2100_CNTR: info->i = adsp->cntr; break; | |
| 1865 | case CPUINFO_INT_REGISTER + ADSP2100_ASTAT: info->i = adsp->astat; break; | |
| 1866 | case CPUINFO_INT_REGISTER + ADSP2100_SSTAT: info->i = adsp->sstat; break; | |
| 1867 | case CPUINFO_INT_REGISTER + ADSP2100_MSTAT: info->i = adsp->mstat; break; | |
| 1868 | ||
| 1869 | case CPUINFO_INT_SP: | |
| 1870 | case CPUINFO_INT_REGISTER + ADSP2100_PCSP: info->i = adsp->pc_sp; break; | |
| 1871 | case CPUINFO_INT_REGISTER + ADSP2100_CNTRSP: info->i = adsp->cntr_sp; break; | |
| 1872 | case CPUINFO_INT_REGISTER + ADSP2100_STATSP: info->i = adsp->stat_sp; break; | |
| 1873 | case CPUINFO_INT_REGISTER + ADSP2100_LOOPSP: info->i = adsp->loop_sp; break; | |
| 1874 | ||
| 1875 | case CPUINFO_INT_REGISTER + ADSP2100_IMASK: info->i = adsp->imask; break; | |
| 1876 | case CPUINFO_INT_REGISTER + ADSP2100_ICNTL: info->i = adsp->icntl; break; | |
| 1877 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE0: info->i = adsp->irq_state[0]; break; | |
| 1878 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE1: info->i = adsp->irq_state[1]; break; | |
| 1879 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE2: info->i = adsp->irq_state[2]; break; | |
| 1880 | case CPUINFO_INT_REGISTER + ADSP2100_IRQSTATE3: info->i = adsp->irq_state[3]; break; | |
| 1881 | ||
| 1882 | case CPUINFO_INT_REGISTER + ADSP2100_FLAGIN: info->i = adsp->flagin; break; | |
| 1883 | case CPUINFO_INT_REGISTER + ADSP2100_FLAGOUT: info->i = adsp->flagout; break; | |
| 1884 | case CPUINFO_INT_REGISTER + ADSP2100_FL0: info->i = adsp->fl0; break; | |
| 1885 | case CPUINFO_INT_REGISTER + ADSP2100_FL1: info->i = adsp->fl1; break; | |
| 1886 | case CPUINFO_INT_REGISTER + ADSP2100_FL2: info->i = adsp->fl2; break; | |
| 1887 | ||
| 1888 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 1889 | case CPUINFO_PTR_SET_INFO: /* set per CPU */ break; | |
| 1890 | case CPUINFO_PTR_INIT: /* set per CPU */ break; | |
| 1891 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(adsp21xx); break; | |
| 1892 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(adsp21xx); break; | |
| 1893 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(adsp21xx); break; | |
| 1894 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1895 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(adsp21xx); break; | |
| 1911 | /* --- the following bits of info are returned as pointers --- */ | |
| 1896 | 1912 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &adsp->icount; break; |
| 1913 | case CPUINFO_PTR_STATE_TABLE: info->state_table = &adsp->state; break; | |
| 1897 | 1914 | |
| 1898 | 1915 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1899 | 1916 | case CPUINFO_STR_NAME: /* set per CPU */ break; |
| r3957 | r3958 | |
| 1913 | 1930 | adsp->astat & 0x02 ? 'N':'.', |
| 1914 | 1931 | adsp->astat & 0x01 ? 'Z':'.'); |
| 1915 | 1932 | break; |
| 1916 | ||
| 1917 | case CPUINFO_STR_REGISTER + ADSP2100_PC: sprintf(info->s, "PC: %04X", adsp->pc); break; | |
| 1918 | ||
| 1919 | case CPUINFO_STR_REGISTER + ADSP2100_AX0: sprintf(info->s, "AX0: %04X", adsp->core.ax0.u); break; | |
| 1920 | case CPUINFO_STR_REGISTER + ADSP2100_AX1: sprintf(info->s, "AX1: %04X", adsp->core.ax1.u); break; | |
| 1921 | case CPUINFO_STR_REGISTER + ADSP2100_AY0: sprintf(info->s, "AY0: %04X", adsp->core.ay0.u); break; | |
| 1922 | case CPUINFO_STR_REGISTER + ADSP2100_AY1: sprintf(info->s, "AY1: %04X", adsp->core.ay1.u); break; | |
| 1923 | case CPUINFO_STR_REGISTER + ADSP2100_AR: sprintf(info->s, "AR: %04X", adsp->core.ar.u); break; | |
| 1924 | case CPUINFO_STR_REGISTER + ADSP2100_AF: sprintf(info->s, "AF: %04X", adsp->core.af.u); break; | |
| 1925 | ||
| 1926 | case CPUINFO_STR_REGISTER + ADSP2100_MX0: sprintf(info->s, "MX0: %04X", adsp->core.mx0.u); break; | |
| 1927 | case CPUINFO_STR_REGISTER + ADSP2100_MX1: sprintf(info->s, "MX1: %04X", adsp->core.mx1.u); break; | |
| 1928 | case CPUINFO_STR_REGISTER + ADSP2100_MY0: sprintf(info->s, "MY0: %04X", adsp->core.my0.u); break; | |
| 1929 | case CPUINFO_STR_REGISTER + ADSP2100_MY1: sprintf(info->s, "MY1: %04X", adsp->core.my1.u); break; | |
| 1930 | case CPUINFO_STR_REGISTER + ADSP2100_MR0: sprintf(info->s, "MR0: %04X", adsp->core.mr.mrx.mr0.u); break; | |
| 1931 | case CPUINFO_STR_REGISTER + ADSP2100_MR1: sprintf(info->s, "MR1: %04X", adsp->core.mr.mrx.mr1.u); break; | |
| 1932 | case CPUINFO_STR_REGISTER + ADSP2100_MR2: sprintf(info->s, "MR2: %02X", adsp->core.mr.mrx.mr2.u & 0x00ff); break; | |
| 1933 | case CPUINFO_STR_REGISTER + ADSP2100_MF: sprintf(info->s, "MF: %04X", adsp->core.mf.u); break; | |
| 1934 | ||
| 1935 | case CPUINFO_STR_REGISTER + ADSP2100_SI: sprintf(info->s, "SI: %04X", adsp->core.si.u); break; | |
| 1936 | case CPUINFO_STR_REGISTER + ADSP2100_SE: sprintf(info->s, "SE: %02X ", adsp->core.se.u & 0x00ff); break; | |
| 1937 | case CPUINFO_STR_REGISTER + ADSP2100_SB: sprintf(info->s, "SB: %02X ", adsp->core.sb.u & 0x001f); break; | |
| 1938 | case CPUINFO_STR_REGISTER + ADSP2100_SR0: sprintf(info->s, "SR0: %04X", adsp->core.sr.srx.sr0.u); break; | |
| 1939 | case CPUINFO_STR_REGISTER + ADSP2100_SR1: sprintf(info->s, "SR1: %04X", adsp->core.sr.srx.sr1.u); break; | |
| 1940 | ||
| 1941 | case CPUINFO_STR_REGISTER + ADSP2100_AX0_SEC: sprintf(info->s, "AX0_SEC: %04X", adsp->alt.ax0.u); break; | |
| 1942 | case CPUINFO_STR_REGISTER + ADSP2100_AX1_SEC: sprintf(info->s, "AX1_SEC: %04X", adsp->alt.ax1.u); break; | |
| 1943 | case CPUINFO_STR_REGISTER + ADSP2100_AY0_SEC: sprintf(info->s, "AY0_SEC: %04X", adsp->alt.ay0.u); break; | |
| 1944 | case CPUINFO_STR_REGISTER + ADSP2100_AY1_SEC: sprintf(info->s, "AY1_SEC: %04X", adsp->alt.ay1.u); break; | |
| 1945 | case CPUINFO_STR_REGISTER + ADSP2100_AR_SEC: sprintf(info->s, "AR_SEC: %04X", adsp->alt.ar.u); break; | |
| 1946 | case CPUINFO_STR_REGISTER + ADSP2100_AF_SEC: sprintf(info->s, "AF_SEC: %04X", adsp->alt.af.u); break; | |
| 1947 | ||
| 1948 | case CPUINFO_STR_REGISTER + ADSP2100_MX0_SEC: sprintf(info->s, "MX0_SEC: %04X", adsp->alt.mx0.u); break; | |
| 1949 | case CPUINFO_STR_REGISTER + ADSP2100_MX1_SEC: sprintf(info->s, "MX1_SEC: %04X", adsp->alt.mx1.u); break; | |
| 1950 | case CPUINFO_STR_REGISTER + ADSP2100_MY0_SEC: sprintf(info->s, "MY0_SEC: %04X", adsp->alt.my0.u); break; | |
| 1951 | case CPUINFO_STR_REGISTER + ADSP2100_MY1_SEC: sprintf(info->s, "MY1_SEC: %04X", adsp->alt.my1.u); break; | |
| 1952 | case CPUINFO_STR_REGISTER + ADSP2100_MR0_SEC: sprintf(info->s, "MR0_SEC: %04X", adsp->alt.mr.mrx.mr0.u); break; | |
| 1953 | case CPUINFO_STR_REGISTER + ADSP2100_MR1_SEC: sprintf(info->s, "MR1_SEC: %04X", adsp->alt.mr.mrx.mr1.u); break; | |
| 1954 | case CPUINFO_STR_REGISTER + ADSP2100_MR2_SEC: sprintf(info->s, "MR2_SEC: %02X", adsp->alt.mr.mrx.mr2.u & 0x00ff); break; | |
| 1955 | case CPUINFO_STR_REGISTER + ADSP2100_MF_SEC: sprintf(info->s, "MF_SEC: %04X", adsp->alt.mf.u); break; | |
| 1956 | ||
| 1957 | case CPUINFO_STR_REGISTER + ADSP2100_SI_SEC: sprintf(info->s, "SI_SEC: %04X", adsp->alt.si.u); break; | |
| 1958 | case CPUINFO_STR_REGISTER + ADSP2100_SE_SEC: sprintf(info->s, "SE_SEC: %02X ", adsp->alt.se.u & 0x00ff); break; | |
| 1959 | case CPUINFO_STR_REGISTER + ADSP2100_SB_SEC: sprintf(info->s, "SB_SEC: %02X ", adsp->alt.sb.u & 0x001f); break; | |
| 1960 | case CPUINFO_STR_REGISTER + ADSP2100_SR0_SEC: sprintf(info->s, "SR0_SEC: %04X", adsp->alt.sr.srx.sr0.u); break; | |
| 1961 | case CPUINFO_STR_REGISTER + ADSP2100_SR1_SEC: sprintf(info->s, "SR1_SEC: %04X", adsp->alt.sr.srx.sr1.u); break; | |
| 1962 | ||
| 1963 | case CPUINFO_STR_REGISTER + ADSP2100_I0: sprintf(info->s, "I0: %04X", adsp->i[0]); break; | |
| 1964 | case CPUINFO_STR_REGISTER + ADSP2100_I1: sprintf(info->s, "I1: %04X", adsp->i[1]); break; | |
| 1965 | case CPUINFO_STR_REGISTER + ADSP2100_I2: sprintf(info->s, "I2: %04X", adsp->i[2]); break; | |
| 1966 | case CPUINFO_STR_REGISTER + ADSP2100_I3: sprintf(info->s, "I3: %04X", adsp->i[3]); break; | |
| 1967 | case CPUINFO_STR_REGISTER + ADSP2100_I4: sprintf(info->s, "I4: %04X", adsp->i[4]); break; | |
| 1968 | case CPUINFO_STR_REGISTER + ADSP2100_I5: sprintf(info->s, "I5: %04X", adsp->i[5]); break; | |
| 1969 | case CPUINFO_STR_REGISTER + ADSP2100_I6: sprintf(info->s, "I6: %04X", adsp->i[6]); break; | |
| 1970 | case CPUINFO_STR_REGISTER + ADSP2100_I7: sprintf(info->s, "I7: %04X", adsp->i[7]); break; | |
| 1971 | ||
| 1972 | case CPUINFO_STR_REGISTER + ADSP2100_L0: sprintf(info->s, "L0: %04X", adsp->l[0]); break; | |
| 1973 | case CPUINFO_STR_REGISTER + ADSP2100_L1: sprintf(info->s, "L1: %04X", adsp->l[1]); break; | |
| 1974 | case CPUINFO_STR_REGISTER + ADSP2100_L2: sprintf(info->s, "L2: %04X", adsp->l[2]); break; | |
| 1975 | case CPUINFO_STR_REGISTER + ADSP2100_L3: sprintf(info->s, "L3: %04X", adsp->l[3]); break; | |
| 1976 | case CPUINFO_STR_REGISTER + ADSP2100_L4: sprintf(info->s, "L4: %04X", adsp->l[4]); break; | |
| 1977 | case CPUINFO_STR_REGISTER + ADSP2100_L5: sprintf(info->s, "L5: %04X", adsp->l[5]); break; | |
| 1978 | case CPUINFO_STR_REGISTER + ADSP2100_L6: sprintf(info->s, "L6: %04X", adsp->l[6]); break; | |
| 1979 | case CPUINFO_STR_REGISTER + ADSP2100_L7: sprintf(info->s, "L7: %04X", adsp->l[7]); break; | |
| 1980 | ||
| 1981 | case CPUINFO_STR_REGISTER + ADSP2100_M0: sprintf(info->s, "M0: %04X", adsp->m[0]); break; | |
| 1982 | case CPUINFO_STR_REGISTER + ADSP2100_M1: sprintf(info->s, "M1: %04X", adsp->m[1]); break; | |
| 1983 | case CPUINFO_STR_REGISTER + ADSP2100_M2: sprintf(info->s, "M2: %04X", adsp->m[2]); break; | |
| 1984 | case CPUINFO_STR_REGISTER + ADSP2100_M3: sprintf(info->s, "M3: %04X", adsp->m[3]); break; | |
| 1985 | case CPUINFO_STR_REGISTER + ADSP2100_M4: sprintf(info->s, "M4: %04X", adsp->m[4]); break; | |
| 1986 | case CPUINFO_STR_REGISTER + ADSP2100_M5: sprintf(info->s, "M5: %04X", adsp->m[5]); break; | |
| 1987 | case CPUINFO_STR_REGISTER + ADSP2100_M6: sprintf(info->s, "M6: %04X", adsp->m[6]); break; | |
| 1988 | case CPUINFO_STR_REGISTER + ADSP2100_M7: sprintf(info->s, "M7: %04X", adsp->m[7]); break; | |
| 1989 | ||
| 1990 | case CPUINFO_STR_REGISTER + ADSP2100_PX: sprintf(info->s, "PX: %02X ", adsp->px); break; | |
| 1991 | case CPUINFO_STR_REGISTER + ADSP2100_CNTR: sprintf(info->s, "CNTR:%04X", adsp->cntr); break; | |
| 1992 | case CPUINFO_STR_REGISTER + ADSP2100_ASTAT: sprintf(info->s, "ASTA:%02X ", adsp->astat); break; | |
| 1993 | case CPUINFO_STR_REGISTER + ADSP2100_SSTAT: sprintf(info->s, "SSTA:%02X ", adsp->sstat); break; | |
| 1994 | case CPUINFO_STR_REGISTER + ADSP2100_MSTAT: sprintf(info->s, "MSTA:%02X ", adsp->mstat); break; | |
| 1995 | ||
| 1996 | case CPUINFO_STR_REGISTER + ADSP2100_PCSP: sprintf(info->s, "PCSP:%02X ", adsp->pc_sp); break; | |
| 1997 | case CPUINFO_STR_REGISTER + ADSP2100_CNTRSP: sprintf(info->s, "CTSP:%01X ", adsp->cntr_sp); break; | |
| 1998 | case CPUINFO_STR_REGISTER + ADSP2100_STATSP: sprintf(info->s, "STSP:%01X ", adsp->stat_sp); break; | |
| 1999 | case CPUINFO_STR_REGISTER + ADSP2100_LOOPSP: sprintf(info->s, "LPSP:%01X ", adsp->loop_sp); break; | |
| 2000 | ||
| 2001 | case CPUINFO_STR_REGISTER + ADSP2100_IMASK: sprintf(info->s, "IMSK:%03X ", adsp->imask); break; | |
| 2002 | case CPUINFO_STR_REGISTER + ADSP2100_ICNTL: sprintf(info->s, "ICTL:%02X ", adsp->icntl); break; | |
| 2003 | case CPUINFO_STR_REGISTER + ADSP2100_IRQSTATE0: sprintf(info->s, "IRQ0:%X ", adsp->irq_state[0]); break; | |
| 2004 | case CPUINFO_STR_REGISTER + ADSP2100_IRQSTATE1: sprintf(info->s, "IRQ1:%X ", adsp->irq_state[1]); break; | |
| 2005 | case CPUINFO_STR_REGISTER + ADSP2100_IRQSTATE2: sprintf(info->s, "IRQ2:%X ", adsp->irq_state[2]); break; | |
| 2006 | case CPUINFO_STR_REGISTER + ADSP2100_IRQSTATE3: sprintf(info->s, "IRQ3:%X ", adsp->irq_state[3]); break; | |
| 2007 | ||
| 2008 | case CPUINFO_STR_REGISTER + ADSP2100_FLAGIN: sprintf(info->s, "FI: %X ", adsp->flagin); break; | |
| 2009 | case CPUINFO_STR_REGISTER + ADSP2100_FLAGOUT: sprintf(info->s, "FO: %X ", adsp->flagout); break; | |
| 2010 | case CPUINFO_STR_REGISTER + ADSP2100_FL0: sprintf(info->s, "FL0: %X ", adsp->fl0); break; | |
| 2011 | case CPUINFO_STR_REGISTER + ADSP2100_FL1: sprintf(info->s, "FL1: %X ", adsp->fl1); break; | |
| 2012 | case CPUINFO_STR_REGISTER + ADSP2100_FL2: sprintf(info->s, "FL2: %X ", adsp->fl2); break; | |
| 2013 | 1933 | } |
| 2014 | 1934 | } |
| 2015 | 1935 | |
| 2016 | #if (HAS_ADSP2104||HAS_ADSP2105||HAS_ADSP2115||HAS_ADSP2181) | |
| 2017 | 1936 | static void adsp21xx_load_boot_data(UINT8 *srcdata, UINT32 *dstdata) |
| 2018 | 1937 | { |
| 2019 | 1938 | /* see how many words we need to copy */ |
| r3957 | r3958 | |
| 2025 | 1944 | dstdata[i] = opcode; |
| 2026 | 1945 | } |
| 2027 | 1946 | } |
| 2028 | #endif | |
| 2029 | 1947 | |
| 2030 | ||
| 1948 | ||
| 2031 | 1949 | /************************************************************************** |
| 2032 | 1950 | * ADSP2100 section |
| 2033 | 1951 | **************************************************************************/ |
| 2034 | 1952 | |
| 2035 | 1953 | static CPU_INIT( adsp2100 ) |
| 2036 | 1954 | { |
| 2037 | adsp2100_state *adsp = adsp21xx_init(device, index, clock, irqcallback); | |
| 2038 | adsp->chip_type = CHIP_TYPE_ADSP2100; | |
| 1955 | adsp2100_state *adsp = adsp21xx_init(device, irqcallback, CHIP_TYPE_ADSP2100); | |
| 2039 | 1956 | adsp->mstat_mask = 0x0f; |
| 2040 | 1957 | adsp->imask_mask = 0x0f; |
| 2041 | 1958 | } |
| 2042 | 1959 | |
| 2043 | static CPU_SET_INFO( adsp2100 ) | |
| 2044 | { | |
| 2045 | adsp2100_state *adsp = device->token; | |
| 2046 | switch (state) | |
| 2047 | { | |
| 2048 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 2049 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ0: set_irq_line(adsp, ADSP2100_IRQ0, info->i); break; | |
| 2050 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ1: set_irq_line(adsp, ADSP2100_IRQ1, info->i); break; | |
| 2051 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ2: set_irq_line(adsp, ADSP2100_IRQ2, info->i); break; | |
| 2052 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ3: set_irq_line(adsp, ADSP2100_IRQ3, info->i); break; | |
| 2053 | ||
| 2054 | default: | |
| 2055 | CPU_SET_INFO_CALL(adsp21xx); | |
| 2056 | break; | |
| 2057 | } | |
| 2058 | } | |
| 2059 | ||
| 2060 | 1960 | CPU_GET_INFO( adsp2100 ) |
| 2061 | 1961 | { |
| 2062 | adsp2100_state *adsp = (device != NULL) ? device->token : NULL; | |
| 2063 | 1962 | switch (state) |
| 2064 | 1963 | { |
| 2065 | 1964 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2066 | case CPUINFO_INT_INPUT_LINES: info->i = 4; break; | |
| 2067 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ0: info->i = adsp->irq_state[ADSP2100_IRQ0]; break; | |
| 2068 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ1: info->i = adsp->irq_state[ADSP2100_IRQ1]; break; | |
| 2069 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ2: info->i = adsp->irq_state[ADSP2100_IRQ2]; break; | |
| 2070 | case CPUINFO_INT_INPUT_STATE + ADSP2100_IRQ3: info->i = adsp->irq_state[ADSP2100_IRQ3]; break; | |
| 1965 | case CPUINFO_INT_INPUT_LINES: info->i = 4; break; | |
| 2071 | 1966 | |
| 2072 | 1967 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2073 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2100); break; | |
| 2074 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2100); break; | |
| 1968 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2100); break; | |
| 2075 | 1969 | |
| 2076 | 1970 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2077 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2100"); | |
| 1971 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2100"); | |
| 2078 | 1972 | |
| 2079 | 1973 | default: |
| 2080 | 1974 | CPU_GET_INFO_CALL(adsp21xx); |
| 2081 | 1975 | break; |
| 2082 | 1976 | } |
| 2083 | 1977 | } |
| 2084 | #endif | |
| 2085 | 1978 | |
| 2086 | ||
| 2087 | #if (HAS_ADSP2101) | |
| 2088 | 1979 | /************************************************************************** |
| 2089 | 1980 | * ADSP2101 section |
| 2090 | 1981 | **************************************************************************/ |
| 2091 | 1982 | |
| 2092 | 1983 | static CPU_INIT( adsp2101 ) |
| 2093 | 1984 | { |
| 2094 | adsp2100_state *adsp = adsp21xx_init(device, index, clock, irqcallback); | |
| 2095 | adsp->chip_type = CHIP_TYPE_ADSP2101; | |
| 1985 | adsp2100_state *adsp = adsp21xx_init(device, irqcallback, CHIP_TYPE_ADSP2101); | |
| 2096 | 1986 | adsp->mstat_mask = 0x7f; |
| 2097 | 1987 | adsp->imask_mask = 0x3f; |
| 2098 | 1988 | } |
| 2099 | 1989 | |
| 2100 | static CPU_SET_INFO( adsp2101 ) | |
| 2101 | { | |
| 2102 | adsp2100_state *adsp = device->token; | |
| 2103 | switch (state) | |
| 2104 | { | |
| 2105 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 2106 | case CPUINFO_INT_INPUT_STATE + ADSP2101_IRQ0: set_irq_line(adsp, ADSP2101_IRQ0, info->i); break; | |
| 2107 | case CPUINFO_INT_INPUT_STATE + ADSP2101_IRQ1: set_irq_line(adsp, ADSP2101_IRQ1, info->i); break; | |
| 2108 | case CPUINFO_INT_INPUT_STATE + ADSP2101_IRQ2: set_irq_line(adsp, ADSP2101_IRQ2, info->i); break; | |
| 2109 | case CPUINFO_INT_INPUT_STATE + ADSP2101_SPORT0_RX:set_irq_line(adsp, ADSP2101_SPORT0_RX, info->i); break; | |
| 2110 | case CPUINFO_INT_INPUT_STATE + ADSP2101_SPORT0_TX:set_irq_line(adsp, ADSP2101_SPORT0_TX, info->i); break; | |
| 2111 | case CPUINFO_INT_INPUT_STATE + ADSP2101_TIMER: set_irq_line(adsp, ADSP2101_TIMER, info->i); break; | |
| 2112 | ||
| 2113 | /* --- the following bits of info are set as pointers to data or functions --- */ | |
| 2114 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break; | |
| 2115 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break; | |
| 2116 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break; | |
| 2117 | ||
| 2118 | default: | |
| 2119 | CPU_SET_INFO_CALL(adsp21xx); | |
| 2120 | break; | |
| 2121 | } | |
| 2122 | } | |
| 2123 | ||
| 2124 | 1990 | CPU_GET_INFO( adsp2101 ) |
| 2125 | 1991 | { |
| 2126 | adsp2100_state *adsp = (device != NULL) ? device->token : NULL; | |
| 2127 | 1992 | switch (state) |
| 2128 | 1993 | { |
| 2129 | 1994 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2130 | case CPUINFO_INT_INPUT_LINES: info->i = 5; break; | |
| 2131 | case CPUINFO_INT_INPUT_STATE + ADSP2101_IRQ0: info->i = adsp->irq_state[ADSP2101_IRQ0]; break; | |
| 2132 | case CPUINFO_INT_INPUT_STATE + ADSP2101_IRQ1: info->i = adsp->irq_state[ADSP2101_IRQ1]; break; | |
| 2133 | case CPUINFO_INT_INPUT_STATE + ADSP2101_IRQ2: info->i = adsp->irq_state[ADSP2101_IRQ2]; break; | |
| 2134 | case CPUINFO_INT_INPUT_STATE + ADSP2101_SPORT0_RX:info->i = adsp->irq_state[ADSP2101_SPORT0_RX];break; | |
| 2135 | case CPUINFO_INT_INPUT_STATE + ADSP2101_SPORT0_TX:info->i = adsp->irq_state[ADSP2101_SPORT0_TX];break; | |
| 2136 | case CPUINFO_INT_INPUT_STATE + ADSP2101_TIMER: info->i = adsp->irq_state[ADSP2101_TIMER]; break; | |
| 1995 | case CPUINFO_INT_INPUT_LINES: info->i = 5; break; | |
| 2137 | 1996 | |
| 2138 | 1997 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2139 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2101); break; | |
| 2140 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2101); break; | |
| 1998 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2101); break; | |
| 2141 | 1999 | |
| 2142 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break; | |
| 2143 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break; | |
| 2144 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break; | |
| 2145 | ||
| 2146 | 2000 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2147 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2101"); | |
| 2001 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2101"); | |
| 2148 | 2002 | |
| 2149 | 2003 | default: |
| 2150 | 2004 | CPU_GET_INFO_CALL(adsp21xx); |
| 2151 | 2005 | break; |
| 2152 | 2006 | } |
| 2153 | 2007 | } |
| 2154 | #endif | |
| 2155 | 2008 | |
| 2156 | ||
| 2157 | #if (HAS_ADSP2104) | |
| 2158 | 2009 | /************************************************************************** |
| 2159 | 2010 | * ADSP2104 section |
| 2160 | 2011 | **************************************************************************/ |
| 2161 | 2012 | |
| 2162 | 2013 | static CPU_INIT( adsp2104 ) |
| 2163 | 2014 | { |
| 2164 | adsp2100_state *adsp = adsp21xx_init(device, index, clock, irqcallback); | |
| 2165 | adsp->chip_type = CHIP_TYPE_ADSP2104; | |
| 2015 | adsp2100_state *adsp = adsp21xx_init(device, irqcallback, CHIP_TYPE_ADSP2104); | |
| 2166 | 2016 | adsp->mstat_mask = 0x7f; |
| 2167 | 2017 | adsp->imask_mask = 0x3f; |
| 2168 | 2018 | } |
| r3957 | r3958 | |
| 2172 | 2022 | adsp21xx_load_boot_data(srcdata, dstdata); |
| 2173 | 2023 | } |
| 2174 | 2024 | |
| 2175 | static CPU_SET_INFO( adsp2104 ) | |
| 2176 | { | |
| 2177 | adsp2100_state *adsp = device->token; | |
| 2178 | switch (state) | |
| 2179 | { | |
| 2180 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 2181 | case CPUINFO_INT_INPUT_STATE + ADSP2104_IRQ0: set_irq_line(adsp, ADSP2104_IRQ0, info->i); break; | |
| 2182 | case CPUINFO_INT_INPUT_STATE + ADSP2104_IRQ1: set_irq_line(adsp, ADSP2104_IRQ1, info->i); break; | |
| 2183 | case CPUINFO_INT_INPUT_STATE + ADSP2104_IRQ2: set_irq_line(adsp, ADSP2104_IRQ2, info->i); break; | |
| 2184 | case CPUINFO_INT_INPUT_STATE + ADSP2104_SPORT0_RX:set_irq_line(adsp, ADSP2104_SPORT0_RX, info->i); break; | |
| 2185 | case CPUINFO_INT_INPUT_STATE + ADSP2104_SPORT0_TX:set_irq_line(adsp, ADSP2104_SPORT0_TX, info->i); break; | |
| 2186 | case CPUINFO_INT_INPUT_STATE + ADSP2104_TIMER: set_irq_line(adsp, ADSP2104_TIMER, info->i); break; | |
| 2187 | ||
| 2188 | /* --- the following bits of info are set as pointers to data or functions --- */ | |
| 2189 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break; | |
| 2190 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break; | |
| 2191 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break; | |
| 2192 | ||
| 2193 | default: | |
| 2194 | CPU_SET_INFO_CALL(adsp21xx); | |
| 2195 | break; | |
| 2196 | } | |
| 2197 | } | |
| 2198 | ||
| 2199 | 2025 | CPU_GET_INFO( adsp2104 ) |
| 2200 | 2026 | { |
| 2201 | adsp2100_state *adsp = (device != NULL) ? device->token : NULL; | |
| 2202 | 2027 | switch (state) |
| 2203 | 2028 | { |
| 2204 | 2029 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2205 | case CPUINFO_INT_INPUT_LINES: info->i = 5; break; | |
| 2206 | case CPUINFO_INT_INPUT_STATE + ADSP2104_IRQ0: info->i = adsp->irq_state[ADSP2104_IRQ0]; break; | |
| 2207 | case CPUINFO_INT_INPUT_STATE + ADSP2104_IRQ1: info->i = adsp->irq_state[ADSP2104_IRQ1]; break; | |
| 2208 | case CPUINFO_INT_INPUT_STATE + ADSP2104_IRQ2: info->i = adsp->irq_state[ADSP2104_IRQ2]; break; | |
| 2209 | case CPUINFO_INT_INPUT_STATE + ADSP2104_SPORT0_RX:info->i = adsp->irq_state[ADSP2104_SPORT0_RX];break; | |
| 2210 | case CPUINFO_INT_INPUT_STATE + ADSP2104_SPORT0_TX:info->i = adsp->irq_state[ADSP2104_SPORT0_TX];break; | |
| 2211 | case CPUINFO_INT_INPUT_STATE + ADSP2104_TIMER: info->i = adsp->irq_state[ADSP2104_TIMER]; break; | |
| 2030 | case CPUINFO_INT_INPUT_LINES: info->i = 6; break; | |
| 2212 | 2031 | |
| 2213 | 2032 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2214 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2104); break; | |
| 2215 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2104); break; | |
| 2033 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2104); break; | |
| 2216 | 2034 | |
| 2217 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break; | |
| 2218 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break; | |
| 2219 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break; | |
| 2220 | ||
| 2221 | 2035 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2222 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2104"); | |
| 2036 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2104"); | |
| 2223 | 2037 | |
| 2224 | 2038 | default: |
| 2225 | 2039 | CPU_GET_INFO_CALL(adsp21xx); |
| 2226 | 2040 | break; |
| 2227 | 2041 | } |
| 2228 | 2042 | } |
| 2229 | #endif | |
| 2230 | 2043 | |
| 2231 | ||
| 2232 | #if (HAS_ADSP2105) | |
| 2233 | 2044 | /************************************************************************** |
| 2234 | 2045 | * ADSP2105 section |
| 2235 | 2046 | **************************************************************************/ |
| 2236 | 2047 | |
| 2237 | 2048 | static CPU_INIT( adsp2105 ) |
| 2238 | 2049 | { |
| 2239 | adsp2100_state *adsp = adsp21xx_init(device, index, clock, irqcallback); | |
| 2240 | adsp->chip_type = CHIP_TYPE_ADSP2105; | |
| 2050 | adsp2100_state *adsp = adsp21xx_init(device, irqcallback, CHIP_TYPE_ADSP2105); | |
| 2241 | 2051 | adsp->mstat_mask = 0x7f; |
| 2242 | 2052 | adsp->imask_mask = 0x3f; |
| 2243 | 2053 | } |
| r3957 | r3958 | |
| 2247 | 2057 | adsp21xx_load_boot_data(srcdata, dstdata); |
| 2248 | 2058 | } |
| 2249 | 2059 | |
| 2250 | static CPU_SET_INFO( adsp2105 ) | |
| 2251 | { | |
| 2252 | adsp2100_state *adsp = device->token; | |
| 2253 | switch (state) | |
| 2254 | { | |
| 2255 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 2256 | case CPUINFO_INT_INPUT_STATE + ADSP2105_IRQ0: set_irq_line(adsp, ADSP2105_IRQ0, info->i); break; | |
| 2257 | case CPUINFO_INT_INPUT_STATE + ADSP2105_IRQ1: set_irq_line(adsp, ADSP2105_IRQ1, info->i); break; | |
| 2258 | case CPUINFO_INT_INPUT_STATE + ADSP2105_IRQ2: set_irq_line(adsp, ADSP2105_IRQ2, info->i); break; | |
| 2259 | ||
| 2260 | /* --- the following bits of info are set as pointers to data or functions --- */ | |
| 2261 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break; | |
| 2262 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break; | |
| 2263 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break; | |
| 2264 | ||
| 2265 | default: | |
| 2266 | CPU_SET_INFO_CALL(adsp21xx); | |
| 2267 | break; | |
| 2268 | } | |
| 2269 | } | |
| 2270 | ||
| 2271 | 2060 | CPU_GET_INFO( adsp2105 ) |
| 2272 | 2061 | { |
| 2273 | adsp2100_state *adsp = (device != NULL) ? device->token : NULL; | |
| 2274 | 2062 | switch (state) |
| 2275 | 2063 | { |
| 2276 | 2064 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2277 | case CPUINFO_INT_INPUT_LINES: info->i = 3; break; | |
| 2278 | case CPUINFO_INT_INPUT_STATE + ADSP2105_IRQ0: info->i = adsp->irq_state[ADSP2105_IRQ0]; break; | |
| 2279 | case CPUINFO_INT_INPUT_STATE + ADSP2105_IRQ1: info->i = adsp->irq_state[ADSP2105_IRQ1]; break; | |
| 2280 | case CPUINFO_INT_INPUT_STATE + ADSP2105_IRQ2: info->i = adsp->irq_state[ADSP2105_IRQ2]; break; | |
| 2065 | case CPUINFO_INT_INPUT_LINES: info->i = 3; break; | |
| 2281 | 2066 | |
| 2282 | 2067 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2283 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2105); break; | |
| 2284 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2105); break; | |
| 2068 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2105); break; | |
| 2285 | 2069 | |
| 2286 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break; | |
| 2287 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break; | |
| 2288 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break; | |
| 2289 | ||
| 2290 | 2070 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2291 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2105"); | |
| 2071 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2105"); | |
| 2292 | 2072 | |
| 2293 | 2073 | default: |
| 2294 | 2074 | CPU_GET_INFO_CALL(adsp21xx); |
| 2295 | 2075 | break; |
| 2296 | 2076 | } |
| 2297 | 2077 | } |
| 2298 | #endif | |
| 2299 | 2078 | |
| 2300 | ||
| 2301 | #if (HAS_ADSP2115) | |
| 2302 | 2079 | /************************************************************************** |
| 2303 | 2080 | * ADSP2115 section |
| 2304 | 2081 | **************************************************************************/ |
| 2305 | 2082 | |
| 2306 | 2083 | static CPU_INIT( adsp2115 ) |
| 2307 | 2084 | { |
| 2308 | adsp2100_state *adsp = adsp21xx_init(device, index, clock, irqcallback); | |
| 2309 | adsp->chip_type = CHIP_TYPE_ADSP2115; | |
| 2085 | adsp2100_state *adsp = adsp21xx_init(device, irqcallback, CHIP_TYPE_ADSP2115); | |
| 2310 | 2086 | adsp->mstat_mask = 0x7f; |
| 2311 | 2087 | adsp->imask_mask = 0x3f; |
| 2312 | 2088 | } |
| r3957 | r3958 | |
| 2316 | 2092 | adsp21xx_load_boot_data(srcdata, dstdata); |
| 2317 | 2093 | } |
| 2318 | 2094 | |
| 2319 | static CPU_SET_INFO( adsp2115 ) | |
| 2320 | { | |
| 2321 | adsp2100_state *adsp = device->token; | |
| 2322 | switch (state) | |
| 2323 | { | |
| 2324 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 2325 | case CPUINFO_INT_INPUT_STATE + ADSP2115_IRQ0: set_irq_line(adsp, ADSP2115_IRQ0, info->i); break; | |
| 2326 | case CPUINFO_INT_INPUT_STATE + ADSP2115_IRQ1: set_irq_line(adsp, ADSP2115_IRQ1, info->i); break; | |
| 2327 | case CPUINFO_INT_INPUT_STATE + ADSP2115_IRQ2: set_irq_line(adsp, ADSP2115_IRQ2, info->i); break; | |
| 2328 | case CPUINFO_INT_INPUT_STATE + ADSP2115_SPORT0_RX:set_irq_line(adsp, ADSP2115_SPORT0_RX, info->i); break; | |
| 2329 | case CPUINFO_INT_INPUT_STATE + ADSP2115_SPORT0_TX:set_irq_line(adsp, ADSP2115_SPORT0_TX, info->i); break; | |
| 2330 | case CPUINFO_INT_INPUT_STATE + ADSP2115_TIMER: set_irq_line(adsp, ADSP2115_TIMER, info->i); break; | |
| 2331 | ||
| 2332 | /* --- the following bits of info are set as pointers to data or functions --- */ | |
| 2333 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break; | |
| 2334 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break; | |
| 2335 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break; | |
| 2336 | ||
| 2337 | default: | |
| 2338 | CPU_SET_INFO_CALL(adsp21xx); | |
| 2339 | break; | |
| 2340 | } | |
| 2341 | } | |
| 2342 | ||
| 2343 | 2095 | CPU_GET_INFO( adsp2115 ) |
| 2344 | 2096 | { |
| 2345 | adsp2100_state *adsp = (device != NULL) ? device->token : NULL; | |
| 2346 | 2097 | switch (state) |
| 2347 | 2098 | { |
| 2348 | 2099 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2349 | case CPUINFO_INT_INPUT_LINES: info->i = 4; break; | |
| 2350 | case CPUINFO_INT_INPUT_STATE + ADSP2115_IRQ0: info->i = adsp->irq_state[ADSP2115_IRQ0]; break; | |
| 2351 | case CPUINFO_INT_INPUT_STATE + ADSP2115_IRQ1: info->i = adsp->irq_state[ADSP2115_IRQ1]; break; | |
| 2352 | case CPUINFO_INT_INPUT_STATE + ADSP2115_IRQ2: info->i = adsp->irq_state[ADSP2115_IRQ2]; break; | |
| 2353 | case CPUINFO_INT_INPUT_STATE + ADSP2115_SPORT0_RX:info->i = adsp->irq_state[ADSP2115_SPORT0_RX];break; | |
| 2354 | case CPUINFO_INT_INPUT_STATE + ADSP2115_SPORT0_TX:info->i = adsp->irq_state[ADSP2115_SPORT0_TX];break; | |
| 2355 | case CPUINFO_INT_INPUT_STATE + ADSP2115_TIMER: info->i = adsp->irq_state[ADSP2115_TIMER]; break; | |
| 2100 | case CPUINFO_INT_INPUT_LINES: info->i = 6; break; | |
| 2356 | 2101 | |
| 2357 | 2102 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2358 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2115); break; | |
| 2359 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2115); break; | |
| 2103 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2115); break; | |
| 2360 | 2104 | |
| 2361 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break; | |
| 2362 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break; | |
| 2363 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break; | |
| 2364 | ||
| 2365 | 2105 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2366 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2115"); | |
| 2106 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2115"); | |
| 2367 | 2107 | |
| 2368 | 2108 | default: |
| 2369 | 2109 | CPU_GET_INFO_CALL(adsp21xx); |
| 2370 | 2110 | break; |
| 2371 | 2111 | } |
| 2372 | 2112 | } |
| 2373 | #endif | |
| 2374 | 2113 | |
| 2375 | ||
| 2376 | #if (HAS_ADSP2181) | |
| 2377 | 2114 | /************************************************************************** |
| 2378 | 2115 | * ADSP2181 section |
| 2379 | 2116 | **************************************************************************/ |
| 2380 | 2117 | |
| 2381 | 2118 | static CPU_INIT( adsp2181 ) |
| 2382 | 2119 | { |
| 2383 | adsp2100_state *adsp = adsp21xx_init(device, index, clock, irqcallback); | |
| 2384 | adsp->chip_type = CHIP_TYPE_ADSP2181; | |
| 2120 | adsp2100_state *adsp = adsp21xx_init(device, irqcallback, CHIP_TYPE_ADSP2181); | |
| 2385 | 2121 | adsp->mstat_mask = 0x7f; |
| 2386 | 2122 | adsp->imask_mask = 0x3ff; |
| 2387 | 2123 | } |
| r3957 | r3958 | |
| 2391 | 2127 | adsp21xx_load_boot_data(srcdata, dstdata); |
| 2392 | 2128 | } |
| 2393 | 2129 | |
| 2394 | static CPU_SET_INFO( adsp2181 ) | |
| 2395 | { | |
| 2396 | adsp2100_state *adsp = device->token; | |
| 2397 | switch (state) | |
| 2398 | { | |
| 2399 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 2400 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQ0: set_irq_line(adsp, ADSP2181_IRQ0, info->i); break; | |
| 2401 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQ1: set_irq_line(adsp, ADSP2181_IRQ1, info->i); break; | |
| 2402 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQ2: set_irq_line(adsp, ADSP2181_IRQ2, info->i); break; | |
| 2403 | case CPUINFO_INT_INPUT_STATE + ADSP2181_SPORT0_RX:set_irq_line(adsp, ADSP2181_SPORT0_RX, info->i); break; | |
| 2404 | case CPUINFO_INT_INPUT_STATE + ADSP2181_SPORT0_TX:set_irq_line(adsp, ADSP2181_SPORT0_TX, info->i); break; | |
| 2405 | case CPUINFO_INT_INPUT_STATE + ADSP2181_TIMER: set_irq_line(adsp, ADSP2181_TIMER, info->i); break; | |
| 2406 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQE: set_irq_line(adsp, ADSP2181_IRQE, info->i); break; | |
| 2407 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQL1: set_irq_line(adsp, ADSP2181_IRQL1, info->i); break; | |
| 2408 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQL2: set_irq_line(adsp, ADSP2181_IRQL2, info->i); break; | |
| 2409 | ||
| 2410 | /* --- the following bits of info are set as pointers to data or functions --- */ | |
| 2411 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break; | |
| 2412 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break; | |
| 2413 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break; | |
| 2414 | ||
| 2415 | default: | |
| 2416 | CPU_SET_INFO_CALL(adsp21xx); | |
| 2417 | break; | |
| 2418 | } | |
| 2419 | } | |
| 2420 | ||
| 2421 | 2130 | CPU_GET_INFO( adsp2181 ) |
| 2422 | 2131 | { |
| 2423 | adsp2100_state *adsp = (device != NULL) ? device->token : NULL; | |
| 2424 | 2132 | switch (state) |
| 2425 | 2133 | { |
| 2426 | 2134 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2427 | case CPUINFO_INT_INPUT_LINES: info->i = 4; break; | |
| 2428 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQ0: info->i = adsp->irq_state[ADSP2181_IRQ0]; break; | |
| 2429 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQ1: info->i = adsp->irq_state[ADSP2181_IRQ1]; break; | |
| 2430 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQ2: info->i = adsp->irq_state[ADSP2181_IRQ2]; break; | |
| 2431 | case CPUINFO_INT_INPUT_STATE + ADSP2181_SPORT0_RX:info->i = adsp->irq_state[ADSP2181_SPORT0_RX];break; | |
| 2432 | case CPUINFO_INT_INPUT_STATE + ADSP2181_SPORT0_TX:info->i = adsp->irq_state[ADSP2181_SPORT0_TX];break; | |
| 2433 | case CPUINFO_INT_INPUT_STATE + ADSP2181_TIMER: info->i = adsp->irq_state[ADSP2181_TIMER]; break; | |
| 2434 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQE: info->i = adsp->irq_state[ADSP2181_IRQE]; break; | |
| 2435 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQL1: info->i = adsp->irq_state[ADSP2181_IRQL1]; break; | |
| 2436 | case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQL2: info->i = adsp->irq_state[ADSP2181_IRQL2]; break; | |
| 2135 | case CPUINFO_INT_INPUT_LINES: info->i = 9; break; | |
| 2437 | 2136 | |
| 2438 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 2439 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 11; break; | |
| 2440 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = -1; break; | |
| 2137 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 2138 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 11; break; | |
| 2139 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = -1; break; | |
| 2441 | 2140 | |
| 2442 | 2141 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2443 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2181); break; | |
| 2444 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2181); break; | |
| 2142 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(adsp2181); break; | |
| 2445 | 2143 | |
| 2446 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break; | |
| 2447 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break; | |
| 2448 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break; | |
| 2449 | ||
| 2450 | 2144 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2451 | 2145 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2181"); break; |
| 2452 | 2146 | |
| r3957 | r3958 | |
| 2525 | 2219 | |
| 2526 | 2220 | return result; |
| 2527 | 2221 | } |
| 2528 | ||
| 2529 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | typedef struct _dsp32_config dsp32_config; |
| 71 | 71 | struct _dsp32_config |
| 72 | 72 | { |
| 73 | void (*output_pins_changed)(UINT32 pins); /* a change has occurred on an output pin */ | |
| 73 | void (*output_pins_changed)(const device_config *device, UINT32 pins); /* a change has occurred on an output pin */ | |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | 76 | |
| r3957 | r3958 | |
| 80 | 80 | ***************************************************************************/ |
| 81 | 81 | |
| 82 | 82 | extern CPU_GET_INFO( dsp32c ); |
| 83 | #define CPU_DSP32C CPU_GET_INFO_NAME( dsp32c ) | |
| 83 | 84 | |
| 84 | 85 | extern void dsp32c_pio_w(const device_config *device, int reg, int data); |
| 85 | 86 | extern int dsp32c_pio_r(const device_config *device, int reg); |
| r3957 | r3958 | |
|---|---|---|
| 181 | 181 | int icount; |
| 182 | 182 | UINT8 lastpins; |
| 183 | 183 | UINT32 ppc; |
| 184 | void (*output_pins_changed)(UINT32 pins); | |
| 184 | void (*output_pins_changed)(const device_config *device, UINT32 pins); | |
| 185 | 185 | const device_config *device; |
| 186 | 186 | const address_space *program; |
| 187 | 187 | }; |
| r3957 | r3958 | |
| 283 | 283 | if (newoutput != cpustate->lastpins) |
| 284 | 284 | { |
| 285 | 285 | cpustate->lastpins = newoutput; |
| 286 | (*cpustate->output_pins_changed)(newoutput); | |
| 286 | (*cpustate->output_pins_changed)(cpustate->device, newoutput); | |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | } |
| r3957 | r3958 | |
| 735 | 735 | case CPUINFO_INT_MIN_CYCLES: info->i = 4; break; |
| 736 | 736 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 737 | 737 | |
| 738 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 739 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 740 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 741 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 742 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 743 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 744 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 745 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 746 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 738 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 739 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 740 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 741 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 742 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 743 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 744 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 745 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 746 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 747 | 747 | |
| 748 | 748 | case CPUINFO_INT_INPUT_STATE + DSP32_IRQ0: info->i = 0; break; |
| 749 | 749 | case CPUINFO_INT_INPUT_STATE + DSP32_IRQ1: info->i = 0; break; |
| r3957 | r3958 | |
| 806 | 806 | case CPUINFO_INT_REGISTER + DSP32_IOC: info->i = cpustate->IOC; break; |
| 807 | 807 | |
| 808 | 808 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 809 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(dsp32c); break; | |
| 810 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(dsp32c); break; | |
| 811 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(dsp32c); break; | |
| 812 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(dsp32c); break; | |
| 813 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(dsp32c); break; | |
| 814 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 815 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(dsp32c); break; | |
| 809 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(dsp32c); break; | |
| 810 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(dsp32c); break; | |
| 811 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(dsp32c); break; | |
| 812 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(dsp32c); break; | |
| 813 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(dsp32c); break; | |
| 814 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 815 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(dsp32c); break; | |
| 816 | 816 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 817 | 817 | |
| 818 | 818 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 175 | 175 | #include "debugger.h" |
| 176 | 176 | #include "x86emit.h" |
| 177 | 177 | #include "eminline.h" |
| 178 | #undef REG_SP | |
| 179 | 178 | #include "x86log.h" |
| 180 | 179 | #include <math.h> |
| 181 | 180 | #include <stddef.h> |
| r3957 | r3958 | |
|---|---|---|
| 2933 | 2933 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2934 | 2934 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 2935 | 2935 | |
| 2936 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2937 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2938 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2939 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2940 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2941 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2942 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2943 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2944 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2936 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2937 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2938 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2939 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2940 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2941 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2942 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 2943 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 2944 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2945 | 2945 | |
| 2946 | 2946 | case CPUINFO_INT_INPUT_STATE: info->i = CLEAR_LINE; break; |
| 2947 | 2947 | |
| r3957 | r3958 | |
| 2988 | 2988 | case CPUINFO_INT_REGISTER + RSP_STEPCNT: info->i = cpustate->step_count; break; |
| 2989 | 2989 | |
| 2990 | 2990 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2991 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(rsp); break; | |
| 2992 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(rsp); break; | |
| 2993 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(rsp); break; | |
| 2994 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(rsp); break; | |
| 2995 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(rsp); break; | |
| 2996 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2997 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(rsp); break; | |
| 2991 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(rsp); break; | |
| 2992 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(rsp); break; | |
| 2993 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(rsp); break; | |
| 2994 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(rsp); break; | |
| 2995 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(rsp); break; | |
| 2996 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2997 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(rsp); break; | |
| 2998 | 2998 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2999 | 2999 | |
| 3000 | 3000 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 72 | 72 | #define RSP_STATUS_SIGNAL7 0x4000 |
| 73 | 73 | |
| 74 | 74 | CPU_GET_INFO( rsp ); |
| 75 | #define CPU_RSP CPU_GET_INFO_NAME( rsp ) | |
| 75 | 76 | |
| 76 | 77 | extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); |
| 77 | 78 |
| r3957 | r3958 | |
|---|---|---|
| 195 | 195 | |
| 196 | 196 | /* set clock divider */ |
| 197 | 197 | |
| 198 | c | |
| 198 | device | |
| 199 | 199 | |
| 200 | 200 | /* allocate serial timer */ |
| 201 | 201 | |
| 202 | 202 | cop400->serial_timer = timer_alloc(device->machine, cop400_serial_tick, cop400); |
| 203 | timer_adjust_periodic(cop400->serial_timer, attotime_zero, | |
| 203 | timer_adjust_periodic(cop400->serial_timer, attotime_zero, 0 | |
| 204 | 204 | |
| 205 | 205 | /* initialize instruction length array */ |
| 206 | 206 | |
| r3957 | r3958 | |
| 413 | 413 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 414 | 414 | case CPUINFO_INT_MAX_CYCLES: info->i = 2; break; |
| 415 | 415 | |
| 416 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 417 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 9; break; | |
| 418 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 419 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 420 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 421 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 422 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 423 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 424 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 416 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 417 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 9; break; | |
| 418 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 419 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 420 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 421 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 422 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 423 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 424 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 425 | 425 | |
| 426 | 426 | case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; break; |
| 427 | 427 | |
| r3957 | r3958 | |
| 441 | 441 | case CPUINFO_INT_REGISTER + COP400_SKL: info->i = SKL; break; |
| 442 | 442 | |
| 443 | 443 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 444 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cop410); break; | |
| 445 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cop410); break; | |
| 446 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cop410); break; | |
| 447 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop410); break; | |
| 448 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 449 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop410); break; | |
| 444 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cop410); break; | |
| 445 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop410); break; | |
| 446 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cop410); break; | |
| 447 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop410); break; | |
| 448 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 449 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop410); break; | |
| 450 | 450 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cop400->icount; break; |
| 451 | case CPUINFO_ | |
| 451 | case CPUINFO_FCT | |
| 452 | 452 | |
| 453 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 453 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 454 | 454 | info->internal_map8 = ADDRESS_MAP_NAME(cop410_internal_rom); break; |
| 455 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 455 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 456 | 456 | info->internal_map8 = ADDRESS_MAP_NAME(cop410_internal_ram); break; |
| 457 | 457 | |
| 458 | 458 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 487 | 487 | switch (state) |
| 488 | 488 | { |
| 489 | 489 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 490 | case CPUINFO_ | |
| 490 | case CPUINFO_FCT | |
| 491 | 491 | |
| 492 | 492 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 493 | 493 | case CPUINFO_STR_NAME: strcpy(info->s, "COP411"); break; |
| r3957 | r3958 | |
| 506 | 506 | case CPUINFO_STR_NAME: strcpy(info->s, "COP401"); break; |
| 507 | 507 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "National Semiconductor COPS"); break; |
| 508 | 508 | |
| 509 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 509 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 510 | 510 | info->internal_map8 = NULL; break; |
| 511 | 511 | |
| 512 | 512 | default: CPU_GET_INFO_CALL(cop410); break; |
| r3957 | r3958 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | /* set clock divider */ |
| 200 | 200 | |
| 201 | c | |
| 201 | device | |
| 202 | 202 | |
| 203 | 203 | /* allocate serial timer */ |
| 204 | 204 | |
| 205 | 205 | cop400->serial_timer = timer_alloc(device->machine, cop400_serial_tick, cop400); |
| 206 | timer_adjust_periodic(cop400->serial_timer, attotime_zero, 0, ATTOTIME_IN_HZ(clock)); | |
| 206 | timer_adjust_periodic(cop400->serial_timer, attotime_zero, 0, ATTOTIME_IN_HZ(device->clock / 16)); | |
| 207 | 207 | |
| 208 | 208 | /* allocate counter timer */ |
| 209 | 209 | |
| 210 | 210 | cop400->counter_timer = timer_alloc(device->machine, cop400_counter_tick, cop400); |
| 211 | timer_adjust_periodic(cop400->counter_timer, attotime_zero, 0, ATTOTIME_IN_HZ(clock / 4)); | |
| 211 | timer_adjust_periodic(cop400->counter_timer, attotime_zero, 0, ATTOTIME_IN_HZ(device->clock / 16 / 4)); | |
| 212 | 212 | |
| 213 | 213 | /* allocate IN latch timer */ |
| 214 | 214 | |
| 215 | 215 | cop400->inil_timer = timer_alloc(device->machine, cop400_inil_tick, cop400); |
| 216 | timer_adjust_periodic(cop400->inil_timer, attotime_zero, 0, ATTOTIME_IN_HZ(clock)); | |
| 216 | timer_adjust_periodic(cop400->inil_timer, attotime_zero, 0, ATTOTIME_IN_HZ(device->clock / 16)); | |
| 217 | 217 | |
| 218 | 218 | /* allocate Microbus timer */ |
| 219 | 219 | |
| 220 | 220 | if (cop400->intf->microbus == COP400_MICROBUS_ENABLED) |
| 221 | 221 | { |
| 222 | 222 | cop400->microbus_timer = timer_alloc(device->machine, cop400_microbus_tick, cop400); |
| 223 | timer_adjust_periodic(cop400->microbus_timer, attotime_zero, 0, ATTOTIME_IN_HZ(clock)); | |
| 223 | timer_adjust_periodic(cop400->microbus_timer, attotime_zero, 0, ATTOTIME_IN_HZ(device->clock / 16)); | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /* initialize instruction length array */ |
| r3957 | r3958 | |
| 497 | 497 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 498 | 498 | case CPUINFO_INT_MAX_CYCLES: info->i = 2; break; |
| 499 | 499 | |
| 500 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 501 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 10; break; | |
| 502 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 503 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 504 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 505 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 506 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 507 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 508 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 500 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 501 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10; break; | |
| 502 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 503 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 504 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 505 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 506 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 507 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 508 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 509 | 509 | |
| 510 | 510 | case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; break; |
| 511 | 511 | |
| r3957 | r3958 | |
| 526 | 526 | case CPUINFO_INT_REGISTER + COP400_SKL: info->i = SKL; break; |
| 527 | 527 | |
| 528 | 528 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 529 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cop420); break; | |
| 530 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cop420); break; | |
| 531 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cop420); break; | |
| 532 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop420); break; | |
| 533 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 534 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop420); break; | |
| 529 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cop420); break; | |
| 530 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop420); break; | |
| 531 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cop420); break; | |
| 532 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop420); break; | |
| 533 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 534 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop420); break; | |
| 535 | 535 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cop400->icount; break; |
| 536 | case CPUINFO_ | |
| 536 | case CPUINFO_FCT | |
| 537 | 537 | |
| 538 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 538 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 539 | 539 | info->internal_map8 = ADDRESS_MAP_NAME(cop420_internal_rom); break; |
| 540 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 540 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 541 | 541 | info->internal_map8 = ADDRESS_MAP_NAME(cop420_internal_ram); break; |
| 542 | 542 | |
| 543 | 543 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 573 | 573 | switch (state) |
| 574 | 574 | { |
| 575 | 575 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 576 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cop421); break; | |
| 577 | case CPUINFO_PTR_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop421); break; | |
| 576 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop421); break; | |
| 577 | case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop421); break; | |
| 578 | 578 | |
| 579 | 579 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 580 | 580 | case CPUINFO_STR_NAME: strcpy(info->s, "COP421"); break; |
| r3957 | r3958 | |
| 591 | 591 | switch (state) |
| 592 | 592 | { |
| 593 | 593 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 594 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cop422); break; | |
| 595 | case CPUINFO_PTR_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop421); break; | |
| 594 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop422); break; | |
| 595 | case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop421); break; | |
| 596 | 596 | |
| 597 | 597 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 598 | 598 | case CPUINFO_STR_NAME: strcpy(info->s, "COP422"); break; |
| r3957 | r3958 | |
| 609 | 609 | switch (state) |
| 610 | 610 | { |
| 611 | 611 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 612 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 612 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 613 | 613 | info->internal_map8 = NULL; break; |
| 614 | 614 | |
| 615 | 615 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | /* set clock divider */ |
| 212 | 212 | |
| 213 | c | |
| 213 | device | |
| 214 | 214 | |
| 215 | 215 | /* allocate serial timer */ |
| 216 | 216 | |
| 217 | 217 | cop400->serial_timer = timer_alloc(device->machine, cop400_serial_tick, cop400); |
| 218 | timer_adjust_periodic(cop400->serial_timer, attotime_zero, | |
| 218 | timer_adjust_periodic(cop400->serial_timer, attotime_zero, 0 | |
| 219 | 219 | |
| 220 | 220 | /* allocate counter timer */ |
| 221 | 221 | |
| 222 | 222 | cop400->counter_timer = timer_alloc(device->machine, cop400_counter_tick, cop400); |
| 223 | timer_adjust_periodic(cop400->counter_timer, attotime_zero, | |
| 223 | timer_adjust_periodic(cop400->counter_timer, attotime_zero, 0 | |
| 224 | 224 | |
| 225 | 225 | /* allocate IN latch timer */ |
| 226 | 226 | |
| 227 | 227 | cop400->inil_timer = timer_alloc(device->machine, cop400_inil_tick, cop400); |
| 228 | timer_adjust_periodic(cop400->inil_timer, attotime_zero, | |
| 228 | timer_adjust_periodic(cop400->inil_timer, attotime_zero, 0 | |
| 229 | 229 | |
| 230 | 230 | /* allocate Microbus timer */ |
| 231 | 231 | |
| 232 | 232 | if (cop400->intf->microbus == COP400_MICROBUS_ENABLED) |
| 233 | 233 | { |
| 234 | 234 | cop400->microbus_timer = timer_alloc(device->machine, cop400_microbus_tick, cop400); |
| 235 | timer_adjust_periodic(cop400->microbus_timer, attotime_zero, | |
| 235 | timer_adjust_periodic(cop400->microbus_timer, attotime_zero, 0 | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | /* initialize instruction length array */ |
| r3957 | r3958 | |
| 519 | 519 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 520 | 520 | case CPUINFO_INT_MAX_CYCLES: info->i = 2; break; |
| 521 | 521 | |
| 522 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 523 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 10; break; | |
| 524 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 525 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 526 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 527 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 528 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 529 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 530 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 522 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 523 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10; break; | |
| 524 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 525 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 526 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 527 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 528 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 529 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 530 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 531 | 531 | |
| 532 | 532 | case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; break; |
| 533 | 533 | |
| r3957 | r3958 | |
| 548 | 548 | case CPUINFO_INT_REGISTER + COP400_SKL: info->i = SKL; break; |
| 549 | 549 | |
| 550 | 550 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 551 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cop444); break; | |
| 552 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cop444); break; | |
| 553 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cop444); break; | |
| 554 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop444); break; | |
| 555 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 556 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop444); break; | |
| 551 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cop444); break; | |
| 552 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop444); break; | |
| 553 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cop444); break; | |
| 554 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop444); break; | |
| 555 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 556 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop444); break; | |
| 557 | 557 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cop400->icount; break; |
| 558 | case CPUINFO_ | |
| 558 | case CPUINFO_FCT | |
| 559 | 559 | |
| 560 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 560 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 561 | 561 | info->internal_map8 = ADDRESS_MAP_NAME(cop444_internal_rom); break; |
| 562 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 562 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 563 | 563 | info->internal_map8 = ADDRESS_MAP_NAME(cop444_internal_ram); break; |
| 564 | 564 | |
| 565 | 565 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 595 | 595 | switch (state) |
| 596 | 596 | { |
| 597 | 597 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 598 | case CPUINFO_ | |
| 598 | case CPUINFO_FCT | |
| 599 | 599 | |
| 600 | 600 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 601 | 601 | case CPUINFO_STR_NAME: strcpy(info->s, "COP445"); break; |
| r3957 | r3958 | |
| 612 | 612 | switch (state) |
| 613 | 613 | { |
| 614 | 614 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 615 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 615 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 616 | 616 | |
| 617 | 617 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 618 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 618 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 619 | 619 | info->internal_map8 = ADDRESS_MAP_NAME(cop424_internal_rom); break; |
| 620 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 620 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 621 | 621 | info->internal_map8 = ADDRESS_MAP_NAME(cop424_internal_ram); break; |
| 622 | 622 | |
| 623 | 623 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 635 | 635 | switch (state) |
| 636 | 636 | { |
| 637 | 637 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 638 | case CPUINFO_ | |
| 638 | case CPUINFO_FCT | |
| 639 | 639 | |
| 640 | 640 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 641 | 641 | case CPUINFO_STR_NAME: strcpy(info->s, "COP425"); break; |
| r3957 | r3958 | |
| 652 | 652 | switch (state) |
| 653 | 653 | { |
| 654 | 654 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 655 | case CPUINFO_ | |
| 655 | case CPUINFO_FCT | |
| 656 | 656 | |
| 657 | 657 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 658 | 658 | case CPUINFO_STR_NAME: strcpy(info->s, "COP426"); break; |
| r3957 | r3958 | |
| 669 | 669 | switch (state) |
| 670 | 670 | { |
| 671 | 671 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 672 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 672 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 673 | 673 | info->internal_map8 = NULL; break; |
| 674 | 674 | |
| 675 | 675 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 94 | 94 | extern CPU_GET_INFO( cop410 ); |
| 95 | 95 | extern CPU_GET_INFO( cop411 ); |
| 96 | 96 | |
| 97 | #define CPU_COP401 CPU_GET_INFO_NAME( cop401 ) | |
| 98 | #define CPU_COP410 CPU_GET_INFO_NAME( cop410 ) | |
| 99 | #define CPU_COP411 CPU_GET_INFO_NAME( cop411 ) | |
| 100 | ||
| 97 | 101 | /* COP 42x */ |
| 98 | 102 | extern CPU_GET_INFO( cop402 ); |
| 99 | 103 | extern CPU_GET_INFO( cop420 ); |
| 100 | 104 | extern CPU_GET_INFO( cop421 ); |
| 101 | 105 | extern CPU_GET_INFO( cop422 ); |
| 102 | 106 | |
| 107 | #define CPU_COP402 CPU_GET_INFO_NAME( cop402 ) | |
| 108 | #define CPU_COP420 CPU_GET_INFO_NAME( cop420 ) | |
| 109 | #define CPU_COP421 CPU_GET_INFO_NAME( cop421 ) | |
| 110 | #define CPU_COP422 CPU_GET_INFO_NAME( cop422 ) | |
| 111 | ||
| 103 | 112 | /* COP 44x */ |
| 104 | 113 | extern CPU_GET_INFO( cop404 ); |
| 105 | 114 | extern CPU_GET_INFO( cop424 ); |
| r3957 | r3958 | |
| 108 | 117 | extern CPU_GET_INFO( cop444 ); |
| 109 | 118 | extern CPU_GET_INFO( cop445 ); |
| 110 | 119 | |
| 120 | #define CPU_COP404 CPU_GET_INFO_NAME( cop404 ) | |
| 121 | #define CPU_COP424 CPU_GET_INFO_NAME( cop424 ) | |
| 122 | #define CPU_COP425 CPU_GET_INFO_NAME( cop425 ) | |
| 123 | #define CPU_COP426 CPU_GET_INFO_NAME( cop426 ) | |
| 124 | #define CPU_COP444 CPU_GET_INFO_NAME( cop444 ) | |
| 125 | #define CPU_COP445 CPU_GET_INFO_NAME( cop445 ) | |
| 126 | ||
| 111 | 127 | CPU_DISASSEMBLE( cop410 ); |
| 112 | 128 | CPU_DISASSEMBLE( cop420 ); |
| 113 | 129 | CPU_DISASSEMBLE( cop444 ); |
| r3957 | r3958 | |
|---|---|---|
| 450 | 450 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 451 | 451 | case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; |
| 452 | 452 | |
| 453 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 454 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 455 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 456 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 457 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 13; break; | |
| 458 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 459 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 460 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 461 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 462 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 463 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 453 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 454 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 455 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 456 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 16; break; | |
| 457 | case CPUINFO_INT_PAGE_SHIFT_PROGRAM: info->i = 13; break; | |
| 458 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 459 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 460 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 461 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 462 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 463 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 464 | 464 | |
| 465 | 465 | case CPUINFO_INT_INPUT_STATE + M4510_IRQ_LINE: info->i = cpustate->irq_state; break; |
| 466 | 466 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; |
| r3957 | r3958 | |
| 492 | 492 | case CPUINFO_INT_M6510_PORT: info->i = m4510_get_port(cpustate); break; |
| 493 | 493 | |
| 494 | 494 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 495 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m4510); break; | |
| 496 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m4510); break; | |
| 497 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m4510); break; | |
| 498 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m4510); break; | |
| 499 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m4510); break; | |
| 500 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 501 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m4510); break; | |
| 495 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m4510); break; | |
| 496 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m4510); break; | |
| 497 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m4510); break; | |
| 498 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m4510); break; | |
| 499 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m4510); break; | |
| 500 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 501 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m4510); break; | |
| 502 | 502 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 503 | 503 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP: info->internal_map8 = ADDRESS_MAP_NAME(m4510_mem); break; |
| 504 | case CPUINFO_ | |
| 504 | case CPUINFO_FCT | |
| 505 | 505 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: info->f = (genf *) cpustate->rdmem_id; break; |
| 506 | 506 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: info->f = (genf *) cpustate->wrmem_id; break; |
| 507 | 507 | case CPUINFO_PTR_M6510_PORTREAD: info->f = (genf *) cpustate->port_read; break; |
| r3957 | r3958 | |
|---|---|---|
| 130 | 130 | * |
| 131 | 131 | *****************************************************************************/ |
| 132 | 132 | |
| 133 | static void m6502_common_init(const device_config *device, | |
| 133 | static void m6502_common_init(const device_config *device, | |
| 134 | 134 | { |
| 135 | 135 | m6502_Regs *cpustate = device->token; |
| 136 | 136 | |
| r3957 | r3958 | |
| 165 | 165 | |
| 166 | 166 | static CPU_INIT( m6502 ) |
| 167 | 167 | { |
| 168 | m6502_common_init(device, i | |
| 168 | m6502_common_init(device, i | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static CPU_RESET( m6502 ) |
| r3957 | r3958 | |
| 313 | 313 | |
| 314 | 314 | static CPU_INIT( n2a03 ) |
| 315 | 315 | { |
| 316 | m6502_common_init(device, i | |
| 316 | m6502_common_init(device, i | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /* The N2A03 is integrally tied to its PSG (they're on the same die). |
| r3957 | r3958 | |
| 336 | 336 | |
| 337 | 337 | static CPU_INIT( m6510 ) |
| 338 | 338 | { |
| 339 | m6502_common_init(device, i | |
| 339 | m6502_common_init(device, i | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | static CPU_RESET( m6510 ) |
| r3957 | r3958 | |
| 404 | 404 | |
| 405 | 405 | static CPU_INIT( m65c02 ) |
| 406 | 406 | { |
| 407 | m6502_common_init(device, i | |
| 407 | m6502_common_init(device, i | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | static CPU_RESET( m65c02 ) |
| r3957 | r3958 | |
| 510 | 510 | #if (HAS_M65SC02) |
| 511 | 511 | static CPU_INIT( m65sc02 ) |
| 512 | 512 | { |
| 513 | m6502_common_init(device, i | |
| 513 | m6502_common_init(device, i | |
| 514 | 514 | } |
| 515 | 515 | #endif |
| 516 | 516 | |
| r3957 | r3958 | |
| 522 | 522 | static CPU_INIT( deco16 ) |
| 523 | 523 | { |
| 524 | 524 | m6502_Regs *cpustate = device->token; |
| 525 | m6502_common_init(device, i | |
| 525 | m6502_common_init(device, i | |
| 526 | 526 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| 527 | 527 | } |
| 528 | 528 | |
| r3957 | r3958 | |
| 709 | 709 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 710 | 710 | case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; |
| 711 | 711 | |
| 712 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 713 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 714 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 715 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 716 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 717 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 718 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 719 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 720 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 712 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 713 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 714 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 715 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 716 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 717 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 718 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 719 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 720 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 721 | 721 | |
| 722 | 722 | case CPUINFO_INT_INPUT_STATE + M6502_IRQ_LINE: info->i = cpustate->irq_state; break; |
| 723 | 723 | case CPUINFO_INT_INPUT_STATE + M6502_SET_OVERFLOW: info->i = cpustate->so_state; break; |
| r3957 | r3958 | |
| 738 | 738 | case CPUINFO_INT_REGISTER + M6502_SUBTYPE: info->i = cpustate->subtype; break; |
| 739 | 739 | |
| 740 | 740 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 741 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6502); break; | |
| 742 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6502); break; | |
| 743 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m6502); break; | |
| 744 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m6502); break; | |
| 745 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6502); break; | |
| 746 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 747 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6502); break; | |
| 741 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6502); break; | |
| 742 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6502); break; | |
| 743 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m6502); break; | |
| 744 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m6502); break; | |
| 745 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6502); break; | |
| 746 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 747 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6502); break; | |
| 748 | 748 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 749 | 749 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: info->f = (genf *) cpustate->rdmem_id; break; |
| 750 | 750 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: info->f = (genf *) cpustate->wrmem_id; break; |
| r3957 | r3958 | |
| 790 | 790 | switch (state) |
| 791 | 791 | { |
| 792 | 792 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 793 | case CPUINFO_ | |
| 793 | case CPUINFO_FCT | |
| 794 | 794 | |
| 795 | 795 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 796 | 796 | case CPUINFO_STR_NAME: strcpy(info->s, "N2A03"); break; |
| r3957 | r3958 | |
| 827 | 827 | switch (state) |
| 828 | 828 | { |
| 829 | 829 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 830 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6510); break; | |
| 831 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6510); break; | |
| 832 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m6510); break; | |
| 833 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6510); break; | |
| 830 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6510); break; | |
| 831 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6510); break; | |
| 832 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m6510); break; | |
| 833 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6510); break; | |
| 834 | 834 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP: info->internal_map8 = ADDRESS_MAP_NAME(m6510_mem); break; |
| 835 | 835 | case CPUINFO_PTR_M6510_PORTREAD: info->f = (genf *) cpustate->port_read; break; |
| 836 | 836 | case CPUINFO_PTR_M6510_PORTWRITE: info->f = (genf *) cpustate->port_write; break; |
| r3957 | r3958 | |
| 924 | 924 | switch (state) |
| 925 | 925 | { |
| 926 | 926 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 927 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m65c02); break; | |
| 928 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m65c02); break; | |
| 929 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m65c02); break; | |
| 930 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m65c02); break; | |
| 931 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m65c02); break; | |
| 927 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m65c02); break; | |
| 928 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m65c02); break; | |
| 929 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m65c02); break; | |
| 930 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m65c02); break; | |
| 931 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m65c02); break; | |
| 932 | 932 | |
| 933 | 933 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 934 | 934 | case CPUINFO_STR_NAME: strcpy(info->s, "M65C02"); break; |
| r3957 | r3958 | |
| 949 | 949 | switch (state) |
| 950 | 950 | { |
| 951 | 951 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 952 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m65sc02); break; | |
| 953 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m65sc02); break; | |
| 952 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m65sc02); break; | |
| 953 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m65sc02); break; | |
| 954 | 954 | |
| 955 | 955 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 956 | 956 | case CPUINFO_STR_NAME: strcpy(info->s, "M65SC02"); break; |
| r3957 | r3958 | |
| 990 | 990 | switch (state) |
| 991 | 991 | { |
| 992 | 992 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 993 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 994 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 993 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 994 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 8; break; | |
| 995 | 995 | |
| 996 | 996 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 997 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(deco16); break; | |
| 998 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(deco16); break; | |
| 999 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(deco16); break; | |
| 1000 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(deco16); break; | |
| 1001 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(deco16); break; | |
| 997 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(deco16); break; | |
| 998 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(deco16); break; | |
| 999 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(deco16); break; | |
| 1000 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(deco16); break; | |
| 1001 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(deco16); break; | |
| 1002 | 1002 | |
| 1003 | 1003 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1004 | 1004 | case CPUINFO_STR_NAME: strcpy(info->s, "DECO CPU16"); break; |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | #define M4510_IRQ_LINE M6502_IRQ_LINE |
| 41 | 41 | |
| 42 | 42 | CPU_GET_INFO( m4510 ); |
| 43 | #define CPU_M4510 CPU_GET_INFO_NAME( m4510 ) | |
| 43 | 44 | |
| 44 | 45 | |
| 45 | 46 | extern CPU_DISASSEMBLE( m4510 ); |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | }; |
| 80 | 80 | |
| 81 | 81 | extern CPU_GET_INFO( m6502 ); |
| 82 | #define CPU_M6502 CPU_GET_INFO_NAME( m6502 ) | |
| 82 | 83 | |
| 83 | 84 | extern CPU_DISASSEMBLE( m6502 ); |
| 84 | 85 | |
| r3957 | r3958 | |
| 100 | 101 | #define M6510_IRQ_LINE M6502_IRQ_LINE |
| 101 | 102 | |
| 102 | 103 | extern CPU_GET_INFO( m6510 ); |
| 104 | #define CPU_M6510 CPU_GET_INFO_NAME( m6510 ) | |
| 103 | 105 | |
| 104 | 106 | extern CPU_DISASSEMBLE( m6510 ); |
| 105 | 107 | |
| r3957 | r3958 | |
| 120 | 122 | #define M6510T_IRQ_LINE M6502_IRQ_LINE |
| 121 | 123 | |
| 122 | 124 | extern CPU_GET_INFO( m6510t ); |
| 125 | #define CPU_M6510T CPU_GET_INFO_NAME( m6510t ) | |
| 123 | 126 | |
| 124 | 127 | #endif |
| 125 | 128 | |
| r3957 | r3958 | |
| 138 | 141 | #define M7501_IRQ_LINE M6502_IRQ_LINE |
| 139 | 142 | |
| 140 | 143 | extern CPU_GET_INFO( m7501 ); |
| 144 | #define CPU_M7501 CPU_GET_INFO_NAME( m7501 ) | |
| 141 | 145 | #endif |
| 142 | 146 | |
| 143 | 147 | #if (HAS_M8502) |
| r3957 | r3958 | |
| 155 | 159 | #define M8502_IRQ_LINE M6502_IRQ_LINE |
| 156 | 160 | |
| 157 | 161 | extern CPU_GET_INFO( m8502 ); |
| 162 | #define CPU_M8502 CPU_GET_INFO_NAME( m8502 ) | |
| 158 | 163 | #endif |
| 159 | 164 | |
| 160 | 165 | |
| r3957 | r3958 | |
| 176 | 181 | #define N2A03_IRQ_LINE M6502_IRQ_LINE |
| 177 | 182 | |
| 178 | 183 | extern CPU_GET_INFO( n2a03 ); |
| 184 | #define CPU_N2A03 CPU_GET_INFO_NAME( n2a03 ) | |
| 179 | 185 | |
| 180 | 186 | #define N2A03_DEFAULTCLOCK (21477272.724 / 12) |
| 181 | 187 | |
| r3957 | r3958 | |
| 205 | 211 | #define M65C02_IRQ_LINE M6502_IRQ_LINE |
| 206 | 212 | |
| 207 | 213 | extern CPU_GET_INFO( m65c02 ); |
| 214 | #define CPU_M65C02 CPU_GET_INFO_NAME( m65c02 ) | |
| 208 | 215 | |
| 209 | 216 | extern CPU_DISASSEMBLE( m65c02 ); |
| 210 | 217 | |
| r3957 | r3958 | |
| 228 | 235 | #define M65SC02_IRQ_LINE M6502_IRQ_LINE |
| 229 | 236 | |
| 230 | 237 | extern CPU_GET_INFO( m65sc02 ); |
| 238 | #define CPU_M65SC02 CPU_GET_INFO_NAME( m65sc02 ) | |
| 231 | 239 | |
| 232 | 240 | extern CPU_DISASSEMBLE( m65sc02 ); |
| 233 | 241 | #endif |
| r3957 | r3958 | |
| 250 | 258 | #define DECO16_IRQ_LINE M6502_IRQ_LINE |
| 251 | 259 | |
| 252 | 260 | extern CPU_GET_INFO( deco16 ); |
| 261 | #define CPU_DECO16 CPU_GET_INFO_NAME( deco16 ) | |
| 253 | 262 | #endif |
| 254 | 263 | |
| 255 | 264 | extern CPU_DISASSEMBLE( deco16 ); |
| r3957 | r3958 | |
|---|---|---|
| 332 | 332 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 333 | 333 | case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; |
| 334 | 334 | |
| 335 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 336 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 337 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 338 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 339 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 340 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 341 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 342 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 343 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 335 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 336 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 337 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 338 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 339 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 340 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 341 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 342 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 343 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 344 | 344 | |
| 345 | 345 | case CPUINFO_INT_INPUT_STATE + M6509_IRQ_LINE: info->i = cpustate->irq_state; break; |
| 346 | 346 | case CPUINFO_INT_INPUT_STATE + M6509_SET_OVERFLOW:info->i = cpustate->so_state; break; |
| r3957 | r3958 | |
| 362 | 362 | case CPUINFO_INT_REGISTER + M6509_ZP: info->i = cpustate->zp.w.l; break; |
| 363 | 363 | |
| 364 | 364 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 365 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6509); break; | |
| 366 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6509); break; | |
| 367 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m6509); break; | |
| 368 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m6509); break; | |
| 369 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6509); break; | |
| 370 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 371 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6502); break; | |
| 365 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6509); break; | |
| 366 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6509); break; | |
| 367 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m6509); break; | |
| 368 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m6509); break; | |
| 369 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6509); break; | |
| 370 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 371 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6502); break; | |
| 372 | 372 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 373 | 373 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP: info->internal_map8 = ADDRESS_MAP_NAME(m6509_mem); break; |
| 374 | 374 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: info->f = (genf *) cpustate->rdmem_id; break; |
| r3957 | r3958 | |
|---|---|---|
| 276 | 276 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 277 | 277 | case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; |
| 278 | 278 | |
| 279 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 280 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 281 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 282 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 283 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 13; break; | |
| 284 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 285 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 286 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 287 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 288 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 289 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 279 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 280 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 281 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 282 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 16; break; | |
| 283 | case CPUINFO_INT_PAGE_SHIFT_PROGRAM: info->i = 13; break; | |
| 284 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 285 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 286 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 287 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 288 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 289 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 290 | 290 | |
| 291 | 291 | case CPUINFO_INT_INPUT_STATE+M65CE02_NMI_STATE: info->i = cpustate->nmi_state; break; |
| 292 | 292 | case CPUINFO_INT_INPUT_STATE+M65CE02_IRQ_STATE: info->i = cpustate->irq_state; break; |
| r3957 | r3958 | |
| 307 | 307 | case CPUINFO_INT_REGISTER+M65CE02_ZP: info->i = cpustate->zp.w.l; break; |
| 308 | 308 | |
| 309 | 309 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 310 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m65ce02); break; | |
| 311 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m65ce02); break; | |
| 312 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m65ce02); break; | |
| 313 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m65ce02); break; | |
| 314 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m65ce02); break; | |
| 315 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 316 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m65ce02); break; | |
| 310 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m65ce02); break; | |
| 311 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m65ce02); break; | |
| 312 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m65ce02); break; | |
| 313 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m65ce02); break; | |
| 314 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m65ce02); break; | |
| 315 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 316 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m65ce02); break; | |
| 317 | 317 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 318 | 318 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: info->f = (genf *) cpustate->rdmem_id; break; |
| 319 | 319 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: info->f = (genf *) cpustate->wrmem_id; break; |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | #define M6509_SET_OVERFLOW 3 |
| 41 | 41 | |
| 42 | 42 | CPU_GET_INFO( m6509 ); |
| 43 | #define CPU_M6509 CPU_GET_INFO_NAME( m6509 ) | |
| 43 | 44 | |
| 44 | 45 | #endif /* __M6509_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | #define M65CE02_IRQ_LINE M6502_IRQ_LINE |
| 37 | 37 | |
| 38 | 38 | CPU_GET_INFO( m65ce02 ); |
| 39 | #define CPU_M65CE02 CPU_GET_INFO_NAME( m65ce02 ) | |
| 39 | 40 | |
| 40 | 41 | extern CPU_DISASSEMBLE( m65ce02 ); |
| 41 | 42 |
| r3957 | r3958 | |
|---|---|---|
| 101 | 101 | ***************************************************************************/ |
| 102 | 102 | |
| 103 | 103 | extern CPU_GET_INFO( jaguargpu ); |
| 104 | #define CPU_JAGUARGPU CPU_GET_INFO_NAME( jaguargpu ) | |
| 104 | 105 | extern void jaguargpu_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask); |
| 105 | 106 | extern UINT32 jaguargpu_ctrl_r(const device_config *device, offs_t offset); |
| 106 | 107 | |
| 107 | 108 | extern CPU_GET_INFO( jaguardsp ); |
| 109 | #define CPU_JAGUARDSP CPU_GET_INFO_NAME( jaguardsp ) | |
| 108 | 110 | extern void jaguardsp_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask); |
| 109 | 111 | extern UINT32 jaguardsp_ctrl_r(const device_config *device, offs_t offset); |
| 110 | 112 |
| r3957 | r3958 | |
|---|---|---|
| 1516 | 1516 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1517 | 1517 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 1518 | 1518 | |
| 1519 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1520 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 1521 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1519 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1520 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 1521 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1522 | 1522 | |
| 1523 | 1523 | case CPUINFO_INT_INPUT_STATE + JAGUAR_IRQ0: info->i = (jaguar->ctrl[G_CTRL] & 0x40) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1524 | 1524 | case CPUINFO_INT_INPUT_STATE + JAGUAR_IRQ1: info->i = (jaguar->ctrl[G_CTRL] & 0x80) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 1567 | 1567 | case CPUINFO_INT_SP: info->i = jaguar->b0[31]; break; |
| 1568 | 1568 | |
| 1569 | 1569 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1570 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(jaguargpu); break; | |
| 1571 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(jaguargpu); break; | |
| 1572 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(jaguar); break; | |
| 1573 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(jaguar); break; | |
| 1574 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(jaguargpu); break; | |
| 1575 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1576 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(jaguargpu);break; | |
| 1570 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(jaguargpu); break; | |
| 1571 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(jaguargpu); break; | |
| 1572 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(jaguar); break; | |
| 1573 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(jaguar); break; | |
| 1574 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(jaguargpu); break; | |
| 1575 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1576 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(jaguargpu);break; | |
| 1577 | 1577 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &jaguar->icount; break; |
| 1578 | 1578 | |
| 1579 | 1579 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1662 | 1662 | case CPUINFO_INT_INPUT_STATE + JAGUAR_IRQ5: info->i = (jaguar->ctrl[G_CTRL] & 0x10000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1663 | 1663 | |
| 1664 | 1664 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1665 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(jaguardsp); break; | |
| 1666 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(jaguardsp); break; | |
| 1667 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(jaguardsp); break; | |
| 1668 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(jaguardsp);break; | |
| 1665 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(jaguardsp); break; | |
| 1666 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(jaguardsp); break; | |
| 1667 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(jaguardsp); break; | |
| 1668 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(jaguardsp);break; | |
| 1669 | 1669 | |
| 1670 | 1670 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1671 | 1671 | case CPUINFO_STR_NAME: strcpy(info->s, "Jaguar DSP"); break; |
| r3957 | r3958 | |
|---|---|---|
| 1 | #ifndef I8085_H | |
| 2 | #define I8085_H | |
| 1 | #ifndef __I8085_H__ | |
| 2 | #define __I8085_H__ | |
| 3 | 3 | |
| 4 | 4 | #include "cpuintrf.h" |
| 5 | 5 | |
| 6 | enum | |
| 7 | { | |
| 8 | I8085_PC=1, I8085_SP, I8085_AF ,I8085_BC, I8085_DE, I8085_HL, | |
| 9 | I8085_HALT, I8085_IM, I8085_IREQ, I8085_ISRV, I8085_VECTOR, | |
| 10 | I8085_TRAP_STATE, I8085_INTR_STATE, | |
| 11 | I8085_RST55_STATE, I8085_RST65_STATE, I8085_RST75_STATE, I8085_STATUS | |
| 12 | }; | |
| 13 | 6 | |
| 7 | /*************************************************************************** | |
| 8 | CONSTANTS | |
| 9 | ***************************************************************************/ | |
| 10 | ||
| 14 | 11 | enum |
| 15 | 12 | { |
| 16 | CPUINFO_PTR_I8085_SOD_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC, | |
| 17 | CPUINFO_PTR_I8085_SID_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC + 1, | |
| 18 | CPUINFO_PTR_I8085_INTE_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC + 2, | |
| 19 | CPUINFO_PTR_I8085_STATUS_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC + 3, | |
| 20 | CPUINFO_INT_I8085_SID = CPUINFO_INT_CPU_SPECIFIC | |
| 13 | I8085_PC, I8085_SP, I8085_AF, I8085_BC, I8085_DE, I8085_HL, | |
| 14 | I8085_A, I8085_B, I8085_C, I8085_D, I8085_E, I8085_H, I8085_L, | |
| 15 | I8085_STATUS, I8085_SOD, I8085_SID, I8085_INTE, | |
| 16 | I8085_HALT, I8085_IM, | |
| 17 | ||
| 18 | I8085_GENPC = REG_GENPC, | |
| 19 | I8085_GENSP = REG_GENSP, | |
| 20 | I8085_GENPCBASE = REG_GENPCBASE | |
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | typedef void (*i8085_sod_func)(const device_config *device, int state); | |
| 24 | typedef int (*i8085_sid_func)(const device_config *device); | |
| 25 | typedef void (*i8085_inte_func)(const device_config *device, int state); | |
| 26 | typedef void (*i8085_status_func)(const device_config *device, UINT8 status); | |
| 27 | 23 | |
| 28 | ||
| 29 | 24 | #define I8085_INTR_LINE 0 |
| 30 | 25 | #define I8085_RST55_LINE 1 |
| 31 | 26 | #define I8085_RST65_LINE 2 |
| 32 | 27 | #define I8085_RST75_LINE 3 |
| 33 | 28 | |
| 34 | CPU_GET_INFO( i8085 ); | |
| 35 | 29 | |
| 36 | /************************************************************************** | |
| 37 | * I8080 section | |
| 38 | **************************************************************************/ | |
| 39 | #if (HAS_8080) | |
| 40 | #define I8080_PC I8085_PC | |
| 41 | #define I8080_SP I8085_SP | |
| 42 | #define I8080_BC I8085_BC | |
| 43 | #define I8080_DE I8085_DE | |
| 44 | #define I8080_HL I8085_HL | |
| 45 | #define I8080_AF I8085_AF | |
| 46 | #define I8080_HALT I8085_HALT | |
| 47 | #define I8080_IREQ I8085_IREQ | |
| 48 | #define I8080_ISRV I8085_ISRV | |
| 49 | #define I8080_VECTOR I8085_VECTOR | |
| 50 | #define I8080_TRAP_STATE I8085_TRAP_STATE | |
| 51 | #define I8080_INTR_STATE I8085_INTR_STATE | |
| 52 | #define I8080_STATUS I8085_STATUS | |
| 53 | #define I8080_REG_LAYOUT \ | |
| 54 | { CPU_8080, \ | |
| 55 | I8080_AF,I8080_BC,I8080_DE,I8080_HL,I8080_SP,I8080_PC, DBG_ROW, \ | |
| 56 | I8080_HALT,I8080_IREQ,I8080_ISRV,I8080_VECTOR, I8080_STATUS, \ | |
| 57 | DBG_END } | |
| 58 | 30 | |
| 59 | #define I8080_INTR_LINE I8085_INTR_LINE | |
| 31 | /*************************************************************************** | |
| 32 | TYPE DEFINITIONS | |
| 33 | ***************************************************************************/ | |
| 60 | 34 | |
| 61 | CPU_GET_INFO( i8080 ); | |
| 62 | #endif | |
| 35 | typedef void (*i8085_sod_func)(const device_config *device, int state); | |
| 36 | typedef int (*i8085_sid_func)(const device_config *device); | |
| 37 | typedef void (*i8085_inte_func)(const device_config *device, int state); | |
| 38 | typedef void (*i8085_status_func)(const device_config *device, UINT8 status); | |
| 63 | 39 | |
| 64 | CPU_DISASSEMBLE( i8085 ); | |
| 65 | ||
| 66 | INLINE void i8085_set_sod_callback(const device_config *device, i8085_sod_func callback) | |
| 40 | typedef struct _i8085_config i8085_config; | |
| 41 | struct _i8085_config | |
| 67 | 42 | { |
| 68 | cpu_set_info_fct(device, CPUINFO_PTR_I8085_SOD_CALLBACK, (genf *)callback); | |
| 69 | } | |
| 43 | i8085_inte_func inte; /* INTE changed callback */ | |
| 44 | i8085_status_func status; /* STATUS changed callback */ | |
| 45 | i8085_sod_func sod; /* SOD changed callback (8085A only) */ | |
| 46 | i8085_sid_func sid; /* SID changed callback (8085A only) */ | |
| 47 | }; | |
| 70 | 48 | |
| 71 | INLINE void i8085_set_sid_callback(const device_config *device, i8085_sid_func callback) | |
| 72 | { | |
| 73 | cpu_set_info_fct(device, CPUINFO_PTR_I8085_SID_CALLBACK, (genf *)callback); | |
| 74 | } | |
| 75 | 49 | |
| 76 | INLINE void i8085_set_inte_callback(const device_config *device, i8085_inte_func callback) | |
| 77 | { | |
| 78 | cpu_set_info_fct(device, CPUINFO_PTR_I8085_INTE_CALLBACK, (genf *)callback); | |
| 79 | } | |
| 80 | 50 | |
| 81 | INLINE void i8085_set_status_callback(const device_config *device, i8085_status_func callback) | |
| 82 | { | |
| 83 | cpu_set_info_fct(device, CPUINFO_PTR_I8085_STATUS_CALLBACK, (genf *)callback); | |
| 84 | } | |
| 51 | /*************************************************************************** | |
| 52 | FUNCTION PROTOTYPES | |
| 53 | ***************************************************************************/ | |
| 85 | 54 | |
| 86 | INLINE void i8085_set_sid(const device_config *device, int sid) | |
| 87 | { | |
| 88 | cpu_set_info_int(device, CPUINFO_INT_I8085_SID, sid); | |
| 89 | } | |
| 55 | CPU_GET_INFO( i8080 ); | |
| 56 | #define CPU_8080 CPU_GET_INFO_NAME( i8080 ) | |
| 90 | 57 | |
| 58 | CPU_GET_INFO( i8085 ); | |
| 59 | #define CPU_8085A CPU_GET_INFO_NAME( i8085 ) | |
| 60 | ||
| 61 | CPU_DISASSEMBLE( i8085 ); | |
| 62 | ||
| 63 | #define i8085_set_sid(cpu, sid) cpu_set_reg(cpu, I8085_SID, sid) | |
| 64 | ||
| 91 | 65 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | #define CF 0x01 |
| 22 | 22 | |
| 23 | 23 | #define IM_SID 0x80 |
| 24 | #define IM_SOD 0x40 | |
| 25 | //#define IM_IEN 0x20 | |
| 26 | #define IM_INTR 0x20 //AT: the 8085 ignores bit 0x20. we move IM_INTR here for compatibility. | |
| 27 | #define IM_TRAP 0x10 | |
| 28 | //#define IM_INTR 0x08 | |
| 29 | #define IM_IEN 0x08 //AT: RIM returns IEN status on this bit. SIM checks this bit to allow masking RST55-75 | |
| 30 | #define IM_RST75 0x04 | |
| 31 | #define IM_RST65 0x02 | |
| 32 | #define IM_RST55 0x01 | |
| 24 | #define IM_I75 0x40 | |
| 25 | #define IM_I65 0x20 | |
| 26 | #define IM_I55 0x10 | |
| 27 | #define IM_IE 0x08 | |
| 28 | #define IM_M75 0x04 | |
| 29 | #define IM_M65 0x02 | |
| 30 | #define IM_M55 0x01 | |
| 33 | 31 | |
| 34 | 32 | #define ADDR_TRAP 0x0024 |
| 35 | 33 | #define ADDR_RST55 0x002c |
| r3957 | r3958 | |
|---|---|---|
| 122 | 122 | * |
| 123 | 123 | *****************************************************************************/ |
| 124 | 124 | |
| 125 | /*int survival_prot = 0; */ | |
| 126 | ||
| 127 | 125 | #include "debugger.h" |
| 128 | 126 | #include "i8085.h" |
| 129 | 127 | #include "i8085cpu.h" |
| r3957 | r3958 | |
| 133 | 131 | |
| 134 | 132 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 135 | 133 | |
| 136 | #define I8085_INTR 0xff | |
| 134 | #define CPUTYPE_8080 0 | |
| 135 | #define CPUTYPE_8085 1 | |
| 137 | 136 | |
| 137 | ||
| 138 | ||
| 139 | /*************************************************************************** | |
| 140 | TYPE DEFINITIONS | |
| 141 | ***************************************************************************/ | |
| 142 | ||
| 138 | 143 | typedef struct _i8085_state i8085_state; |
| 139 | 144 | struct _i8085_state |
| 140 | 145 | { |
| 141 | int cputype; /* 0 8080, 1 8085A */ | |
| 142 | PAIR PC,SP,AF,BC,DE,HL,XX; | |
| 143 | UINT8 HALT; | |
| 144 | UINT8 IM; /* interrupt mask */ | |
| 145 | UINT8 IREQ; /* requested interrupts */ | |
| 146 | UINT8 ISRV; /* serviced interrupt */ | |
| 147 | UINT32 INTR; /* vector for INTR */ | |
| 148 | UINT32 IRQ2; /* scheduled interrupt address */ | |
| 149 | UINT32 IRQ1; /* executed interrupt address */ | |
| 150 | UINT8 STATUS; /* status word */ | |
| 151 | UINT8 after_ei; /* are we in the EI shadow? */ | |
| 152 | INT8 irq_state[4]; | |
| 153 | cpu_irq_callback irq_callback; | |
| 146 | i8085_config config; | |
| 147 | int cputype; /* 0 8080, 1 8085A */ | |
| 148 | PAIR PC,SP,AF,BC,DE,HL,XX; | |
| 149 | UINT8 HALT; | |
| 150 | UINT8 IM; /* interrupt mask (8085A only) */ | |
| 151 | UINT8 STATUS; /* status word */ | |
| 152 | ||
| 153 | UINT8 after_ei; /* post-EI processing; starts at 2, check for ints at 0 */ | |
| 154 | UINT8 nmi_state; /* raw NMI line state */ | |
| 155 | UINT8 irq_state[4]; /* raw IRQ line states */ | |
| 156 | UINT8 trap_pending; /* TRAP interrupt latched? */ | |
| 157 | UINT8 trap_im_copy; /* copy of IM register when TRAP was taken */ | |
| 158 | UINT8 sod_state; /* state of the SOD line */ | |
| 159 | ||
| 160 | UINT8 ietemp; /* import/export temp space */ | |
| 161 | ||
| 162 | cpu_irq_callback irq_callback; | |
| 154 | 163 | const device_config *device; |
| 155 | 164 | const address_space *program; |
| 156 | 165 | const address_space *io; |
| 157 | i8085_sod_func sod_callback; | |
| 158 | i8085_sid_func sid_callback; | |
| 159 | i8085_inte_func inte_callback; | |
| 160 | i8085_status_func status_callback; | |
| 161 | int icount; | |
| 162 | UINT8 rim_ien; | |
| 166 | cpu_state_table state; | |
| 167 | int icount; | |
| 163 | 168 | }; |
| 164 | 169 | |
| 170 | ||
| 171 | ||
| 172 | /*************************************************************************** | |
| 173 | CPU STATE DESCRIPTION | |
| 174 | ***************************************************************************/ | |
| 175 | ||
| 176 | #define I8085_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \ | |
| 177 | CPU_STATE_ENTRY(I8085_##_name, #_name, _format, i8085_state, _member, _datamask, ~0, _flags) | |
| 178 | ||
| 179 | static const cpu_state_entry state_array[] = | |
| 180 | { | |
| 181 | I8085_STATE_ENTRY(PC, "%04X", PC.w.l, 0xffff, 0) | |
| 182 | I8085_STATE_ENTRY(GENPC, "%04X", PC.w.l, 0xffff, CPUSTATE_NOSHOW) | |
| 183 | // I8085_STATE_ENTRY(GENPCBASE, "%04X", prvpc.w.l, 0xffff, CPUSTATE_NOSHOW) | |
| 184 | ||
| 185 | I8085_STATE_ENTRY(SP, "%04X", PC.w.l, 0xffff, 0) | |
| 186 | I8085_STATE_ENTRY(GENSP, "%04X", PC.w.l, 0xffff, CPUSTATE_NOSHOW) | |
| 187 | ||
| 188 | I8085_STATE_ENTRY(A, "%02X", AF.b.l, 0xff, CPUSTATE_NOSHOW) | |
| 189 | I8085_STATE_ENTRY(B, "%02X", BC.b.h, 0xff, CPUSTATE_NOSHOW) | |
| 190 | I8085_STATE_ENTRY(C, "%02X", BC.b.l, 0xff, CPUSTATE_NOSHOW) | |
| 191 | I8085_STATE_ENTRY(D, "%02X", DE.b.h, 0xff, CPUSTATE_NOSHOW) | |
| 192 | I8085_STATE_ENTRY(E, "%02X", DE.b.l, 0xff, CPUSTATE_NOSHOW) | |
| 193 | I8085_STATE_ENTRY(H, "%02X", HL.b.h, 0xff, CPUSTATE_NOSHOW) | |
| 194 | I8085_STATE_ENTRY(L, "%02X", HL.b.l, 0xff, CPUSTATE_NOSHOW) | |
| 195 | ||
| 196 | I8085_STATE_ENTRY(AF, "%04X", AF.w.l, 0xffff, 0) | |
| 197 | I8085_STATE_ENTRY(BC, "%04X", BC.w.l, 0xffff, 0) | |
| 198 | I8085_STATE_ENTRY(DE, "%04X", DE.w.l, 0xffff, 0) | |
| 199 | I8085_STATE_ENTRY(HL, "%04X", HL.w.l, 0xffff, 0) | |
| 200 | ||
| 201 | I8085_STATE_ENTRY(STATUS, "%02X", STATUS, 0xff, 0) | |
| 202 | I8085_STATE_ENTRY(SOD, "%1u", sod_state, 0x1, 0) | |
| 203 | I8085_STATE_ENTRY(SID, "%1u", ietemp, 0x1, CPUSTATE_EXPORT | CPUSTATE_IMPORT) | |
| 204 | I8085_STATE_ENTRY(INTE, "%1u", ietemp, 0x1, CPUSTATE_EXPORT | CPUSTATE_IMPORT) | |
| 205 | }; | |
| 206 | ||
| 207 | static const cpu_state_table state_table_template = | |
| 208 | { | |
| 209 | NULL, /* pointer to the base of state (offsets are relative to this) */ | |
| 210 | 0, /* subtype this table refers to */ | |
| 211 | ARRAY_LENGTH(state_array), /* number of entries */ | |
| 212 | state_array /* array of entries */ | |
| 213 | }; | |
| 214 | ||
| 215 | ||
| 216 | ||
| 217 | /*************************************************************************** | |
| 218 | MACROS | |
| 219 | ***************************************************************************/ | |
| 220 | ||
| 221 | #define IS_8080(c) ((c)->cputype == CPUTYPE_8080) | |
| 222 | #define IS_8085(c) ((c)->cputype == CPUTYPE_8085) | |
| 223 | ||
| 224 | ||
| 225 | ||
| 226 | /*************************************************************************** | |
| 227 | STATIC TABLES | |
| 228 | ***************************************************************************/ | |
| 229 | ||
| 165 | 230 | static UINT8 ZS[256]; |
| 166 | 231 | static UINT8 ZSP[256]; |
| 167 | 232 | |
| 168 | static UINT8 ROP(i8085_state *cpustate) | |
| 233 | ||
| 234 | ||
| 235 | /*************************************************************************** | |
| 236 | FUNCTION PROTOTYPES | |
| 237 | ***************************************************************************/ | |
| 238 | ||
| 239 | static void execute_one(i8085_state *cpustate, int opcode); | |
| 240 | ||
| 241 | ||
| 242 | ||
| 243 | /*************************************************************************** | |
| 244 | INLINE FUNCTIONS | |
| 245 | ***************************************************************************/ | |
| 246 | ||
| 247 | INLINE void set_sod(i8085_state *cpustate, int state) | |
| 169 | 248 | { |
| 170 | cpustate->STATUS = 0xa2; // instruction fetch | |
| 249 | if (state != 0 && cpustate->sod_state == 0) | |
| 250 | { | |
| 251 | cpustate->sod_state = 1; | |
| 252 | if (cpustate->config.sod != NULL) | |
| 253 | (*cpustate->config.sod)(cpustate->device, 1); | |
| 254 | } | |
| 255 | else if (state == 0 && cpustate->sod_state != 0) | |
| 256 | { | |
| 257 | cpustate->sod_state = 0; | |
| 258 | if (cpustate->config.sod != NULL) | |
| 259 | (*cpustate->config.sod)(cpustate->device, 0); | |
| 260 | } | |
| 261 | } | |
| 262 | ||
| 263 | ||
| 264 | INLINE void set_inte(i8085_state *cpustate, int state) | |
| 265 | { | |
| 266 | if (state != 0 && (cpustate->IM & IM_IE) == 0) | |
| 267 | { | |
| 268 | cpustate->IM |= IM_IE; | |
| 269 | if (cpustate->config.inte != NULL) | |
| 270 | (*cpustate->config.inte)(cpustate->device, 1); | |
| 271 | } | |
| 272 | else if (state == 0 && (cpustate->IM & IM_IE) != 0) | |
| 273 | { | |
| 274 | cpustate->IM &= ~IM_IE; | |
| 275 | if (cpustate->config.inte != NULL) | |
| 276 | (*cpustate->config.inte)(cpustate->device, 0); | |
| 277 | } | |
| 278 | } | |
| 279 | ||
| 280 | ||
| 281 | INLINE void set_status(i8085_state *cpustate, UINT8 status) | |
| 282 | { | |
| 283 | if (status != cpustate->STATUS && cpustate->config.status != NULL) | |
| 284 | (*cpustate->config.status)(cpustate->device, status); | |
| 285 | cpustate->STATUS = status; | |
| 286 | } | |
| 287 | ||
| 288 | ||
| 289 | INLINE UINT8 get_rim_value(i8085_state *cpustate) | |
| 290 | { | |
| 291 | UINT8 result = cpustate->IM; | |
| 292 | ||
| 293 | /* copy live RST5.5 and RST6.5 states */ | |
| 294 | result &= ~(IM_I65 | IM_I55); | |
| 295 | if (cpustate->irq_state[I8085_RST65_LINE] && !(cpustate->IM & IM_M65)) | |
| 296 | result |= IM_I65; | |
| 297 | if (cpustate->irq_state[I8085_RST55_LINE] && !(cpustate->IM & IM_M55)) | |
| 298 | result |= IM_I55; | |
| 299 | ||
| 300 | /* fetch the SID bit if we have a callback */ | |
| 301 | if (cpustate->config.sid != NULL) | |
| 302 | result = (result & 0x7f) | ((*cpustate->config.sid)(cpustate->device) ? 0x80 : 0); | |
| 303 | return result; | |
| 304 | } | |
| 305 | ||
| 306 | ||
| 307 | INLINE void break_halt_for_interrupt(i8085_state *cpustate) | |
| 308 | { | |
| 309 | /* de-halt if necessary */ | |
| 310 | if (cpustate->HALT) | |
| 311 | { | |
| 312 | cpustate->PC.w.l++; | |
| 313 | cpustate->HALT = 0; | |
| 314 | set_status(cpustate, 0x26); /* int ack while halt */ | |
| 315 | } | |
| 316 | else | |
| 317 | set_status(cpustate, 0x23); /* int ack */ | |
| 318 | } | |
| 319 | ||
| 320 | ||
| 321 | INLINE UINT8 ROP(i8085_state *cpustate) | |
| 322 | { | |
| 323 | set_status(cpustate, 0xa2); // instruction fetch | |
| 171 | 324 | return memory_decrypted_read_byte(cpustate->program, cpustate->PC.w.l++); |
| 172 | 325 | } |
| 173 | 326 | |
| 174 | ||
| 327 | INLINE UINT8 ARG(i8085_state *cpustate) | |
| 175 | 328 | { |
| 176 | 329 | return memory_raw_read_byte(cpustate->program, cpustate->PC.w.l++); |
| 177 | 330 | } |
| 178 | 331 | |
| 179 | ||
| 332 | INLINE UINT16 ARG16(i8085_state *cpustate) | |
| 180 | 333 | { |
| 181 | 334 | UINT16 w; |
| 182 | 335 | w = memory_raw_read_byte(cpustate->program, cpustate->PC.d); |
| r3957 | r3958 | |
| 186 | 339 | return w; |
| 187 | 340 | } |
| 188 | 341 | |
| 189 | ||
| 342 | INLINE UINT8 RM(i8085_state *cpustate, UINT32 a) | |
| 190 | 343 | { |
| 191 | cpustate | |
| 344 | set_status(cpustate, | |
| 192 | 345 | return memory_read_byte_8le(cpustate->program, a); |
| 193 | 346 | } |
| 194 | 347 | |
| 195 | ||
| 348 | INLINE void WM(i8085_state *cpustate, UINT32 a, UINT8 v) | |
| 196 | 349 | { |
| 197 | cpustate | |
| 350 | set_status(cpustate, | |
| 198 | 351 | memory_write_byte_8le(cpustate->program, a, v); |
| 199 | 352 | } |
| 200 | 353 | |
| 201 | INLINE void execute_one(i8085_state *cpustate, int opcode) | |
| 354 | ||
| 355 | static void check_for_interrupts(i8085_state *cpustate) | |
| 202 | 356 | { |
| 203 | /* output state word */ | |
| 204 | if (cpustate->status_callback) (*cpustate->status_callback)(cpustate->device, cpustate->STATUS); | |
| 357 | /* TRAP is the highest priority */ | |
| 358 | if (cpustate->trap_pending) | |
| 359 | { | |
| 360 | /* the first RIM after a TRAP reflects the original IE state; remember it here, | |
| 361 | setting the high bit to indicate it is valid */ | |
| 362 | cpustate->trap_im_copy = cpustate->IM | 0x80; | |
| 205 | 363 | |
| 364 | /* reset the pending state */ | |
| 365 | cpustate->trap_pending = FALSE; | |
| 366 | ||
| 367 | /* break out of HALT state and call the IRQ ack callback */ | |
| 368 | break_halt_for_interrupt(cpustate); | |
| 369 | if (cpustate->irq_callback != NULL) | |
| 370 | (*cpustate->irq_callback)(cpustate->device, INPUT_LINE_NMI); | |
| 371 | ||
| 372 | /* push the PC and jump to $0024 */ | |
| 373 | M_PUSH(PC); | |
| 374 | cpustate->IM &= ~IM_IE; | |
| 375 | cpustate->PC.w.l = ADDR_TRAP; | |
| 376 | cpustate->icount -= 11; | |
| 377 | } | |
| 378 | ||
| 379 | /* followed by RST7.5 */ | |
| 380 | else if ((cpustate->IM & IM_I75) && !(cpustate->IM & IM_M75) && (cpustate->IM & IM_IE)) | |
| 381 | { | |
| 382 | /* reset the pending state (which is CPU-visible via the RIM instruction) */ | |
| 383 | cpustate->IM &= ~IM_I75; | |
| 384 | ||
| 385 | /* break out of HALT state and call the IRQ ack callback */ | |
| 386 | break_halt_for_interrupt(cpustate); | |
| 387 | if (cpustate->irq_callback != NULL) | |
| 388 | (*cpustate->irq_callback)(cpustate->device, I8085_RST75_LINE); | |
| 389 | ||
| 390 | /* push the PC and jump to $003C */ | |
| 391 | M_PUSH(PC); | |
| 392 | cpustate->IM &= ~IM_IE; | |
| 393 | cpustate->PC.w.l = ADDR_RST75; | |
| 394 | cpustate->icount -= 11; | |
| 395 | } | |
| 396 | ||
| 397 | /* followed by RST6.5 */ | |
| 398 | else if (cpustate->irq_state[I8085_RST65_LINE] && !(cpustate->IM & IM_M65) && (cpustate->IM & IM_IE)) | |
| 399 | { | |
| 400 | /* break out of HALT state and call the IRQ ack callback */ | |
| 401 | break_halt_for_interrupt(cpustate); | |
| 402 | if (cpustate->irq_callback != NULL) | |
| 403 | (*cpustate->irq_callback)(cpustate->device, I8085_RST65_LINE); | |
| 404 | ||
| 405 | /* push the PC and jump to $0034 */ | |
| 406 | M_PUSH(PC); | |
| 407 | cpustate->IM &= ~IM_IE; | |
| 408 | cpustate->PC.w.l = ADDR_RST65; | |
| 409 | cpustate->icount -= 11; | |
| 410 | } | |
| 411 | ||
| 412 | /* followed by RST5.5 */ | |
| 413 | else if (cpustate->irq_state[I8085_RST55_LINE] && !(cpustate->IM & IM_M55) && (cpustate->IM & IM_IE)) | |
| 414 | { | |
| 415 | /* break out of HALT state and call the IRQ ack callback */ | |
| 416 | break_halt_for_interrupt(cpustate); | |
| 417 | if (cpustate->irq_callback != NULL) | |
| 418 | (*cpustate->irq_callback)(cpustate->device, I8085_RST55_LINE); | |
| 419 | ||
| 420 | /* push the PC and jump to $002C */ | |
| 421 | M_PUSH(PC); | |
| 422 | cpustate->IM &= ~IM_IE; | |
| 423 | cpustate->PC.w.l = ADDR_RST55; | |
| 424 | cpustate->icount -= 11; | |
| 425 | } | |
| 426 | ||
| 427 | /* followed by classic INTR */ | |
| 428 | else if (cpustate->irq_state[I8085_INTR_LINE] && (cpustate->IM & IM_IE)) | |
| 429 | { | |
| 430 | UINT32 vector = 0; | |
| 431 | ||
| 432 | /* break out of HALT state and call the IRQ ack callback */ | |
| 433 | break_halt_for_interrupt(cpustate); | |
| 434 | if (cpustate->irq_callback != NULL) | |
| 435 | vector = (*cpustate->irq_callback)(cpustate->device, I8085_INTR_LINE); | |
| 436 | ||
| 437 | /* use the resulting vector as an opcode to execute */ | |
| 438 | cpustate->IM &= ~IM_IE; | |
| 439 | switch (vector & 0xff0000) | |
| 440 | { | |
| 441 | case 0xcd0000: /* CALL nnnn */ | |
| 442 | cpustate->icount -= 7; | |
| 443 | M_PUSH(PC); | |
| 444 | ||
| 445 | case 0xc30000: /* JMP nnnn */ | |
| 446 | cpustate->icount -= 10; | |
| 447 | cpustate->PC.d = vector & 0xffff; | |
| 448 | break; | |
| 449 | ||
| 450 | default: | |
| 451 | LOG(("i8085 take int $%02x\n", vector)); | |
| 452 | execute_one(cpustate, vector & 0xff); | |
| 453 | break; | |
| 454 | } | |
| 455 | } | |
| 456 | } | |
| 457 | ||
| 458 | ||
| 459 | static void execute_one(i8085_state *cpustate, int opcode) | |
| 460 | { | |
| 206 | 461 | switch (opcode) |
| 207 | 462 | { |
| 208 | 463 | case 0x00: cpustate->icount -= 4; /* NOP */ |
| r3957 | r3958 | |
| 214 | 469 | case 0x02: cpustate->icount -= 7; /* STAX B */ |
| 215 | 470 | WM(cpustate, cpustate->BC.d, cpustate->AF.b.h); |
| 216 | 471 | break; |
| 217 | case 0x03: cpustate->icount -= (cpustat | |
| 472 | case 0x03: cpustate->icount -= IS_8085(cpustat | |
| 218 | 473 | cpustate->BC.w.l++; |
| 219 | if | |
| 474 | if | |
| 220 | 475 | { |
| 221 | 476 | if (cpustate->BC.b.l == 0x00) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 222 | 477 | } |
| 223 | 478 | break; |
| 224 | case 0x04: cpustate->icount -= (cpustat | |
| 479 | case 0x04: cpustate->icount -= IS_8085(cpustat | |
| 225 | 480 | M_INR(cpustate->BC.b.h); |
| 226 | 481 | break; |
| 227 | case 0x05: cpustate->icount -= (cpustat | |
| 482 | case 0x05: cpustate->icount -= IS_8085(cpustat | |
| 228 | 483 | M_DCR(cpustate->BC.b.h); |
| 229 | 484 | break; |
| 230 | 485 | case 0x06: cpustate->icount -= 7; /* MVI B,nn */ |
| r3957 | r3958 | |
| 235 | 490 | break; |
| 236 | 491 | |
| 237 | 492 | case 0x08: |
| 238 | if | |
| 493 | if | |
| 239 | 494 | cpustate->icount -= 10; /* DSUB */ |
| 240 | 495 | M_DSUB(cpustate); |
| 241 | 496 | } else { |
| r3957 | r3958 | |
| 248 | 503 | case 0x0a: cpustate->icount -= 7; /* LDAX B */ |
| 249 | 504 | cpustate->AF.b.h = RM(cpustate, cpustate->BC.d); |
| 250 | 505 | break; |
| 251 | case 0x0b: cpustate->icount -= (cpustat | |
| 506 | case 0x0b: cpustate->icount -= IS_8085(cpustat | |
| 252 | 507 | cpustate->BC.w.l--; |
| 253 | if | |
| 508 | if | |
| 254 | 509 | { |
| 255 | 510 | if (cpustate->BC.b.l == 0xff) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 256 | 511 | } |
| 257 | 512 | break; |
| 258 | case 0x0c: cpustate->icount -= (cpustat | |
| 513 | case 0x0c: cpustate->icount -= IS_8085(cpustat | |
| 259 | 514 | M_INR(cpustate->BC.b.l); |
| 260 | 515 | break; |
| 261 | case 0x0d: cpustate->icount -= (cpustat | |
| 516 | case 0x0d: cpustate->icount -= IS_8085(cpustat | |
| 262 | 517 | M_DCR(cpustate->BC.b.l); |
| 263 | 518 | break; |
| 264 | 519 | case 0x0e: cpustate->icount -= 7; /* MVI C,nn */ |
| r3957 | r3958 | |
| 269 | 524 | break; |
| 270 | 525 | |
| 271 | 526 | case 0x10: |
| 272 | if | |
| 527 | if | |
| 273 | 528 | cpustate->icount -= 7; /* ASRH */ |
| 274 | 529 | cpustate->AF.b.l = (cpustate->AF.b.l & ~CF) | (cpustate->HL.b.l & CF); |
| 275 | 530 | cpustate->HL.w.l = (cpustate->HL.w.l >> 1); |
| r3957 | r3958 | |
| 283 | 538 | case 0x12: cpustate->icount -= 7; /* STAX D */ |
| 284 | 539 | WM(cpustate, cpustate->DE.d, cpustate->AF.b.h); |
| 285 | 540 | break; |
| 286 | case 0x13: cpustate->icount -= (cpustat | |
| 541 | case 0x13: cpustate->icount -= IS_8085(cpustat | |
| 287 | 542 | cpustate->DE.w.l++; |
| 288 | if | |
| 543 | if | |
| 289 | 544 | { |
| 290 | 545 | if (cpustate->DE.b.l == 0x00) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 291 | 546 | } |
| 292 | 547 | break; |
| 293 | case 0x14: cpustate->icount -= (cpustat | |
| 548 | case 0x14: cpustate->icount -= IS_8085(cpustat | |
| 294 | 549 | M_INR(cpustate->DE.b.h); |
| 295 | 550 | break; |
| 296 | case 0x15: cpustate->icount -= (cpustat | |
| 551 | case 0x15: cpustate->icount -= IS_8085(cpustat | |
| 297 | 552 | M_DCR(cpustate->DE.b.h); |
| 298 | 553 | break; |
| 299 | 554 | case 0x16: cpustate->icount -= 7; /* MVI D,nn */ |
| r3957 | r3958 | |
| 304 | 559 | break; |
| 305 | 560 | |
| 306 | 561 | case 0x18: |
| 307 | if | |
| 562 | if | |
| 308 | 563 | cpustate->icount -= 10; /* RLDE */ |
| 309 | 564 | cpustate->AF.b.l = (cpustate->AF.b.l & ~(CF | VF)) | (cpustate->DE.b.h >> 7); |
| 310 | 565 | cpustate->DE.w.l = (cpustate->DE.w.l << 1) | (cpustate->DE.w.l >> 15); |
| r3957 | r3958 | |
| 320 | 575 | case 0x1a: cpustate->icount -= 7; /* LDAX D */ |
| 321 | 576 | cpustate->AF.b.h = RM(cpustate, cpustate->DE.d); |
| 322 | 577 | break; |
| 323 | case 0x1b: cpustate->icount -= (cpustat | |
| 578 | case 0x1b: cpustate->icount -= IS_8085(cpustat | |
| 324 | 579 | cpustate->DE.w.l--; |
| 325 | if | |
| 580 | if | |
| 326 | 581 | { |
| 327 | 582 | if (cpustate->DE.b.l == 0xff) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 328 | 583 | } |
| 329 | 584 | break; |
| 330 | case 0x1c: cpustate->icount -= (cpustat | |
| 585 | case 0x1c: cpustate->icount -= IS_8085(cpustat | |
| 331 | 586 | M_INR(cpustate->DE.b.l); |
| 332 | 587 | break; |
| 333 | case 0x1d: cpustate->icount -= (cpustat | |
| 588 | case 0x1d: cpustate->icount -= IS_8085(cpustat | |
| 334 | 589 | M_DCR(cpustate->DE.b.l); |
| 335 | 590 | break; |
| 336 | 591 | case 0x1e: cpustate->icount -= 7; /* MVI E,nn */ |
| r3957 | r3958 | |
| 341 | 596 | break; |
| 342 | 597 | |
| 343 | 598 | case 0x20: |
| 344 | if | |
| 599 | if | |
| 345 | 600 | cpustate->icount -= 7; /* RIM */ |
| 346 | cpustate->AF.b.h = cpustate->IM; | |
| 347 | if (cpustate->sid_callback) | |
| 348 | cpustate->AF.b.h = (cpustate->AF.b.h & 0x7f) | ((*cpustate->sid_callback)(cpustate->device) ? 0x80 : 0); | |
| 349 | cpustate->AF.b.h |= cpustate->rim_ien; cpustate->rim_ien = 0; //AT: read and clear IEN status latch | |
| 601 | cpustate->AF.b.h = get_rim_value(cpustate); | |
| 602 | ||
| 603 | /* if we have remembered state from taking a TRAP, fix up the IE flag here */ | |
| 604 | if (cpustate->trap_im_copy & 0x80) | |
| 605 | cpustate->AF.b.h = (cpustate->AF.b.h & ~IM_IE) | (cpustate->trap_im_copy & IM_IE); | |
| 606 | cpustate->trap_im_copy = 0; | |
| 350 | 607 | } else { |
| 351 | 608 | cpustate->icount -= 4; /* NOP undocumented */ |
| 352 | 609 | } |
| r3957 | r3958 | |
| 360 | 617 | cpustate->XX.w.l++; |
| 361 | 618 | WM(cpustate, cpustate->XX.d, cpustate->HL.b.h); |
| 362 | 619 | break; |
| 363 | case 0x23: cpustate->icount -= (cpustat | |
| 620 | case 0x23: cpustate->icount -= IS_8085(cpustat | |
| 364 | 621 | cpustate->HL.w.l++; |
| 365 | if | |
| 622 | if | |
| 366 | 623 | { |
| 367 | 624 | if (cpustate->HL.b.l == 0x00) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 368 | 625 | } |
| 369 | 626 | break; |
| 370 | case 0x24: cpustate->icount -= (cpustat | |
| 627 | case 0x24: cpustate->icount -= IS_8085(cpustat | |
| 371 | 628 | M_INR(cpustate->HL.b.h); |
| 372 | 629 | break; |
| 373 | case 0x25: cpustate->icount -= (cpustat | |
| 630 | case 0x25: cpustate->icount -= IS_8085(cpustat | |
| 374 | 631 | M_DCR(cpustate->HL.b.h); |
| 375 | 632 | break; |
| 376 | 633 | case 0x26: cpustate->icount -= 7; /* MVI H,nn */ |
| r3957 | r3958 | |
| 382 | 639 | if (cpustate->AF.b.l & HF) cpustate->XX.d |= 0x200; |
| 383 | 640 | if (cpustate->AF.b.l & NF) cpustate->XX.d |= 0x400; |
| 384 | 641 | cpustate->AF.w.l = DAA[cpustate->XX.d]; |
| 385 | if | |
| 642 | if | |
| 386 | 643 | { |
| 387 | 644 | cpustate->AF.b.l &= 0xd5; // Ignore not used flags |
| 388 | 645 | } |
| 389 | 646 | break; |
| 390 | 647 | |
| 391 | 648 | case 0x28: |
| 392 | if | |
| 649 | if | |
| 393 | 650 | cpustate->icount -= 10; /* LDEH nn */ |
| 394 | 651 | cpustate->XX.d = ARG(cpustate); |
| 395 | 652 | cpustate->DE.d = (cpustate->HL.d + cpustate->XX.d) & 0xffff; |
| r3957 | r3958 | |
| 406 | 663 | cpustate->XX.w.l++; |
| 407 | 664 | cpustate->HL.b.h = RM(cpustate, cpustate->XX.d); |
| 408 | 665 | break; |
| 409 | case 0x2b: cpustate->icount -= (cpustat | |
| 666 | case 0x2b: cpustate->icount -= IS_8085(cpustat | |
| 410 | 667 | cpustate->HL.w.l--; |
| 411 | if | |
| 668 | if | |
| 412 | 669 | { |
| 413 | 670 | if (cpustate->HL.b.l == 0xff) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 414 | 671 | } |
| 415 | 672 | break; |
| 416 | case 0x2c: cpustate->icount -= (cpustat | |
| 673 | case 0x2c: cpustate->icount -= IS_8085(cpustat | |
| 417 | 674 | M_INR(cpustate->HL.b.l); |
| 418 | 675 | break; |
| 419 | case 0x2d: cpustate->icount -= (cpustat | |
| 676 | case 0x2d: cpustate->icount -= IS_8085(cpustat | |
| 420 | 677 | M_DCR(cpustate->HL.b.l); |
| 421 | 678 | break; |
| 422 | 679 | case 0x2e: cpustate->icount -= 7; /* MVI L,nn */ |
| 423 | 680 | M_MVI(cpustate->HL.b.l); |
| 424 | 681 | break; |
| 425 | 682 | case 0x2f: cpustate->icount -= 4; /* CMA */ |
| 426 | if | |
| 683 | if | |
| 427 | 684 | { |
| 428 | 685 | cpustate->AF.b.h ^= 0xff; |
| 429 | 686 | cpustate->AF.b.l |= HF + NF; |
| r3957 | r3958 | |
| 435 | 692 | break; |
| 436 | 693 | |
| 437 | 694 | case 0x30: |
| 438 | if | |
| 695 | if | |
| 439 | 696 | { |
| 440 | 697 | cpustate->icount -= 7; /* SIM */ |
| 441 | 698 | |
| 442 | if (cpustate->AF.b.h & 0x40) //SOE - only when bit 0x40 is set! | |
| 699 | /* if bit 3 is set, bits 0-2 become the new masks */ | |
| 700 | if (cpustate->AF.b.h & 0x08) | |
| 443 | 701 | { |
| 444 | cpustate->IM &=~IM_SOD; | |
| 445 | if (cpustate->AF.b.h & 0x80) cpustate->IM |= IM_SOD; //is it needed ? | |
| 446 | if (cpustate->sod_callback) (*cpustate->sod_callback)(cpustate->device, cpustate->AF.b.h >> 7); //SOD - data = bit 0x80 | |
| 702 | cpustate->IM &= ~(IM_M55 | IM_M65 | IM_M75 | IM_I55 | IM_I65); | |
| 703 | cpustate->IM |= cpustate->AF.b.h & (IM_M55 | IM_M65 | IM_M75); | |
| 704 | ||
| 705 | /* update live state based on the new masks */ | |
| 706 | if ((cpustate->IM & IM_M55) == 0 && cpustate->irq_state[I8085_RST55_LINE]) | |
| 707 | cpustate->IM |= IM_I55; | |
| 708 | if ((cpustate->IM & IM_M65) == 0 && cpustate->irq_state[I8085_RST65_LINE]) | |
| 709 | cpustate->IM |= IM_I65; | |
| 447 | 710 | } |
| 448 | //AT | |
| 449 | //cpustate->IM &= (IM_SID + IM_IEN + IM_TRAP); | |
| 450 | //cpustate->IM |= (cpustate->AF.b.h & ~(IM_SID + IM_SOD + IM_IEN + IM_TRAP)); | |
| 451 | 711 | |
| 452 | // overwrite RST5.5-7.5 interrupt masks only when bit 0x08 of the accumulator is set | |
| 453 | if (cpustate->AF.b.h & 0x08) | |
| 454 | cpustate->IM = (cpustate->IM & ~(IM_RST55+IM_RST65+IM_RST75)) | (cpustate->AF.b.h & (IM_RST55+IM_RST65+IM_RST75)); | |
| 712 | /* bit if 4 is set, the 7.5 flip-flop is cleared */ | |
| 713 | if (cpustate->AF.b.h & 0x10) | |
| 714 | cpustate->IM &= ~IM_I75; | |
| 455 | 715 | |
| 716 | /* if bit 6 is set, then bit 7 is the new SOD state */ | |
| 717 | if (cpustate->AF.b.h & 0x40) | |
| 718 | set_sod(cpustate, cpustate->AF.b.h >> 7); | |
| 719 | ||
| 720 | /* check for revealed interrupts */ | |
| 721 | check_for_interrupts(cpustate); | |
| 456 | 722 | } else { |
| 457 | 723 | cpustate->icount -= 4; /* NOP undocumented */ |
| 458 | 724 | } |
| r3957 | r3958 | |
| 465 | 731 | cpustate->XX.d = ARG16(cpustate); |
| 466 | 732 | WM(cpustate, cpustate->XX.d, cpustate->AF.b.h); |
| 467 | 733 | break; |
| 468 | case 0x33: cpustate->icount -= (cpustat | |
| 734 | case 0x33: cpustate->icount -= IS_8085(cpustat | |
| 469 | 735 | cpustate->SP.w.l++; |
| 470 | if | |
| 736 | if | |
| 471 | 737 | { |
| 472 | 738 | if (cpustate->SP.b.l == 0x00) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 473 | 739 | } |
| r3957 | r3958 | |
| 491 | 757 | break; |
| 492 | 758 | |
| 493 | 759 | case 0x38: |
| 494 | if | |
| 760 | if | |
| 495 | 761 | cpustate->icount -= 10; /* LDES nn */ |
| 496 | 762 | cpustate->XX.d = ARG(cpustate); |
| 497 | 763 | cpustate->DE.d = (cpustate->SP.d + cpustate->XX.d) & 0xffff; |
| r3957 | r3958 | |
| 506 | 772 | cpustate->XX.d = ARG16(cpustate); |
| 507 | 773 | cpustate->AF.b.h = RM(cpustate, cpustate->XX.d); |
| 508 | 774 | break; |
| 509 | case 0x3b: cpustate->icount -= (cpustat | |
| 775 | case 0x3b: cpustate->icount -= IS_8085(cpustat | |
| 510 | 776 | cpustate->SP.w.l--; |
| 511 | if | |
| 777 | if | |
| 512 | 778 | { |
| 513 | 779 | if (cpustate->SP.b.l == 0xff) cpustate->AF.b.l |= XF; else cpustate->AF.b.l &= ~XF; |
| 514 | 780 | } |
| 515 | 781 | break; |
| 516 | case 0x3c: cpustate->icount -= (cpustat | |
| 782 | case 0x3c: cpustate->icount -= IS_8085(cpustat | |
| 517 | 783 | M_INR(cpustate->AF.b.h); |
| 518 | 784 | break; |
| 519 | case 0x3d: cpustate->icount -= (cpustat | |
| 785 | case 0x3d: cpustate->icount -= IS_8085(cpustat | |
| 520 | 786 | M_DCR(cpustate->AF.b.h); |
| 521 | 787 | break; |
| 522 | 788 | case 0x3e: cpustate->icount -= 7; /* MVI A,nn */ |
| r3957 | r3958 | |
| 526 | 792 | cpustate->AF.b.l = (cpustate->AF.b.l & 0xfe) | ((cpustate->AF.b.l & CF)==1 ? 0 : 1); |
| 527 | 793 | break; |
| 528 | 794 | |
| 529 | case 0x40: cpustate->icount -= (cpustat | |
| 795 | case 0x40: cpustate->icount -= IS_8085(cpustat | |
| 530 | 796 | /* no op */ |
| 531 | 797 | break; |
| 532 | case 0x41: cpustate->icount -= (cpustat | |
| 798 | case 0x41: cpustate->icount -= IS_8085(cpustat | |
| 533 | 799 | cpustate->BC.b.h = cpustate->BC.b.l; |
| 534 | 800 | break; |
| 535 | case 0x42: cpustate->icount -= (cpustat | |
| 801 | case 0x42: cpustate->icount -= IS_8085(cpustat | |
| 536 | 802 | cpustate->BC.b.h = cpustate->DE.b.h; |
| 537 | 803 | break; |
| 538 | case 0x43: cpustate->icount -= (cpustat | |
| 804 | case 0x43: cpustate->icount -= IS_8085(cpustat | |
| 539 | 805 | cpustate->BC.b.h = cpustate->DE.b.l; |
| 540 | 806 | break; |
| 541 | case 0x44: cpustate->icount -= (cpustat | |
| 807 | case 0x44: cpustate->icount -= IS_8085(cpustat | |
| 542 | 808 | cpustate->BC.b.h = cpustate->HL.b.h; |
| 543 | 809 | break; |
| 544 | case 0x45: cpustate->icount -= (cpustat | |
| 810 | case 0x45: cpustate->icount -= IS_8085(cpustat | |
| 545 | 811 | cpustate->BC.b.h = cpustate->HL.b.l; |
| 546 | 812 | break; |
| 547 | 813 | case 0x46: cpustate->icount -= 7; /* MOV B,M */ |
| 548 | 814 | cpustate->BC.b.h = RM(cpustate, cpustate->HL.d); |
| 549 | 815 | break; |
| 550 | case 0x47: cpustate->icount -= (cpustat | |
| 816 | case 0x47: cpustate->icount -= IS_8085(cpustat | |
| 551 | 817 | cpustate->BC.b.h = cpustate->AF.b.h; |
| 552 | 818 | break; |
| 553 | 819 | |
| 554 | case 0x48: cpustate->icount -= (cpustat | |
| 820 | case 0x48: cpustate->icount -= IS_8085(cpustat | |
| 555 | 821 | cpustate->BC.b.l = cpustate->BC.b.h; |
| 556 | 822 | break; |
| 557 | case 0x49: cpustate->icount -= (cpustat | |
| 823 | case 0x49: cpustate->icount -= IS_8085(cpustat | |
| 558 | 824 | /* no op */ |
| 559 | 825 | break; |
| 560 | case 0x4a: cpustate->icount -= (cpustat | |
| 826 | case 0x4a: cpustate->icount -= IS_8085(cpustat | |
| 561 | 827 | cpustate->BC.b.l = cpustate->DE.b.h; |
| 562 | 828 | break; |
| 563 | case 0x4b: cpustate->icount -= (cpustat | |
| 829 | case 0x4b: cpustate->icount -= IS_8085(cpustat | |
| 564 | 830 | cpustate->BC.b.l = cpustate->DE.b.l; |
| 565 | 831 | break; |
| 566 | case 0x4c: cpustate->icount -= (cpustat | |
| 832 | case 0x4c: cpustate->icount -= IS_8085(cpustat | |
| 567 | 833 | cpustate->BC.b.l = cpustate->HL.b.h; |
| 568 | 834 | break; |
| 569 | case 0x4d: cpustate->icount -= (cpustat | |
| 835 | case 0x4d: cpustate->icount -= IS_8085(cpustat | |
| 570 | 836 | cpustate->BC.b.l = cpustate->HL.b.l; |
| 571 | 837 | break; |
| 572 | 838 | case 0x4e: cpustate->icount -= 7; /* MOV C,M */ |
| 573 | 839 | cpustate->BC.b.l = RM(cpustate, cpustate->HL.d); |
| 574 | 840 | break; |
| 575 | case 0x4f: cpustate->icount -= (cpustat | |
| 841 | case 0x4f: cpustate->icount -= IS_8085(cpustat | |
| 576 | 842 | cpustate->BC.b.l = cpustate->AF.b.h; |
| 577 | 843 | break; |
| 578 | 844 | |
| 579 | case 0x50: cpustate->icount -= (cpustat | |
| 845 | case 0x50: cpustate->icount -= IS_8085(cpustat | |
| 580 | 846 | cpustate->DE.b.h = cpustate->BC.b.h; |
| 581 | 847 | break; |
| 582 | case 0x51: cpustate->icount -= (cpustat | |
| 848 | case 0x51: cpustate->icount -= IS_8085(cpustat | |
| 583 | 849 | cpustate->DE.b.h = cpustate->BC.b.l; |
| 584 | 850 | break; |
| 585 | case 0x52: cpustate->icount -= (cpustat | |
| 851 | case 0x52: cpustate->icount -= IS_8085(cpustat | |
| 586 | 852 | /* no op */ |
| 587 | 853 | break; |
| 588 | case 0x53: cpustate->icount -= (cpustat | |
| 854 | case 0x53: cpustate->icount -= IS_8085(cpustat | |
| 589 | 855 | cpustate->DE.b.h = cpustate->DE.b.l; |
| 590 | 856 | break; |
| 591 | case 0x54: cpustate->icount -= (cpustat | |
| 857 | case 0x54: cpustate->icount -= IS_8085(cpustat | |
| 592 | 858 | cpustate->DE.b.h = cpustate->HL.b.h; |
| 593 | 859 | break; |
| 594 | case 0x55: cpustate->icount -= (cpustat | |
| 860 | case 0x55: cpustate->icount -= IS_8085(cpustat | |
| 595 | 861 | cpustate->DE.b.h = cpustate->HL.b.l; |
| 596 | 862 | break; |
| 597 | 863 | case 0x56: cpustate->icount -= 7; /* MOV D,M */ |
| 598 | 864 | cpustate->DE.b.h = RM(cpustate, cpustate->HL.d); |
| 599 | 865 | break; |
| 600 | case 0x57: cpustate->icount -= (cpustat | |
| 866 | case 0x57: cpustate->icount -= IS_8085(cpustat | |
| 601 | 867 | cpustate->DE.b.h = cpustate->AF.b.h; |
| 602 | 868 | break; |
| 603 | 869 | |
| 604 | case 0x58: cpustate->icount -= (cpustat | |
| 870 | case 0x58: cpustate->icount -= IS_8085(cpustat | |
| 605 | 871 | cpustate->DE.b.l = cpustate->BC.b.h; |
| 606 | 872 | break; |
| 607 | case 0x59: cpustate->icount -= (cpustat | |
| 873 | case 0x59: cpustate->icount -= IS_8085(cpustat | |
| 608 | 874 | cpustate->DE.b.l = cpustate->BC.b.l; |
| 609 | 875 | break; |
| 610 | case 0x5a: cpustate->icount -= (cpustat | |
| 876 | case 0x5a: cpustate->icount -= IS_8085(cpustat | |
| 611 | 877 | cpustate->DE.b.l = cpustate->DE.b.h; |
| 612 | 878 | break; |
| 613 | case 0x5b: cpustate->icount -= (cpustat | |
| 879 | case 0x5b: cpustate->icount -= IS_8085(cpustat | |
| 614 | 880 | /* no op */ |
| 615 | 881 | break; |
| 616 | case 0x5c: cpustate->icount -= (cpustat | |
| 882 | case 0x5c: cpustate->icount -= IS_8085(cpustat | |
| 617 | 883 | cpustate->DE.b.l = cpustate->HL.b.h; |
| 618 | 884 | break; |
| 619 | case 0x5d: cpustate->icount -= (cpustat | |
| 885 | case 0x5d: cpustate->icount -= IS_8085(cpustat | |
| 620 | 886 | cpustate->DE.b.l = cpustate->HL.b.l; |
| 621 | 887 | break; |
| 622 | 888 | case 0x5e: cpustate->icount -= 7; /* MOV E,M */ |
| 623 | 889 | cpustate->DE.b.l = RM(cpustate, cpustate->HL.d); |
| 624 | 890 | break; |
| 625 | case 0x5f: cpustate->icount -= (cpustat | |
| 891 | case 0x5f: cpustate->icount -= IS_8085(cpustat | |
| 626 | 892 | cpustate->DE.b.l = cpustate->AF.b.h; |
| 627 | 893 | break; |
| 628 | 894 | |
| 629 | case 0x60: cpustate->icount -= (cpustat | |
| 895 | case 0x60: cpustate->icount -= IS_8085(cpustat | |
| 630 | 896 | cpustate->HL.b.h = cpustate->BC.b.h; |
| 631 | 897 | break; |
| 632 | case 0x61: cpustate->icount -= (cpustat | |
| 898 | case 0x61: cpustate->icount -= IS_8085(cpustat | |
| 633 | 899 | cpustate->HL.b.h = cpustate->BC.b.l; |
| 634 | 900 | break; |
| 635 | case 0x62: cpustate->icount -= (cpustat | |
| 901 | case 0x62: cpustate->icount -= IS_8085(cpustat | |
| 636 | 902 | cpustate->HL.b.h = cpustate->DE.b.h; |
| 637 | 903 | break; |
| 638 | case 0x63: cpustate->icount -= (cpustat | |
| 904 | case 0x63: cpustate->icount -= IS_8085(cpustat | |
| 639 | 905 | cpustate->HL.b.h = cpustate->DE.b.l; |
| 640 | 906 | break; |
| 641 | case 0x64: cpustate->icount -= (cpustat | |
| 907 | case 0x64: cpustate->icount -= IS_8085(cpustat | |
| 642 | 908 | /* no op */ |
| 643 | 909 | break; |
| 644 | case 0x65: cpustate->icount -= (cpustat | |
| 910 | case 0x65: cpustate->icount -= IS_8085(cpustat | |
| 645 | 911 | cpustate->HL.b.h = cpustate->HL.b.l; |
| 646 | 912 | break; |
| 647 | 913 | case 0x66: cpustate->icount -= 7; /* MOV H,M */ |
| 648 | 914 | cpustate->HL.b.h = RM(cpustate, cpustate->HL.d); |
| 649 | 915 | break; |
| 650 | case 0x67: cpustate->icount -= (cpustat | |
| 916 | case 0x67: cpustate->icount -= IS_8085(cpustat | |
| 651 | 917 | cpustate->HL.b.h = cpustate->AF.b.h; |
| 652 | 918 | break; |
| 653 | 919 | |
| 654 | case 0x68: cpustate->icount -= (cpustat | |
| 920 | case 0x68: cpustate->icount -= IS_8085(cpustat | |
| 655 | 921 | cpustate->HL.b.l = cpustate->BC.b.h; |
| 656 | 922 | break; |
| 657 | case 0x69: cpustate->icount -= (cpustat | |
| 923 | case 0x69: cpustate->icount -= IS_8085(cpustat | |
| 658 | 924 | cpustate->HL.b.l = cpustate->BC.b.l; |
| 659 | 925 | break; |
| 660 | case 0x6a: cpustate->icount -= (cpustat | |
| 926 | case 0x6a: cpustate->icount -= IS_8085(cpustat | |
| 661 | 927 | cpustate->HL.b.l = cpustate->DE.b.h; |
| 662 | 928 | break; |
| 663 | case 0x6b: cpustate->icount -= (cpustat | |
| 929 | case 0x6b: cpustate->icount -= IS_8085(cpustat | |
| 664 | 930 | cpustate->HL.b.l = cpustate->DE.b.l; |
| 665 | 931 | break; |
| 666 | case 0x6c: cpustate->icount -= (cpustat | |
| 932 | case 0x6c: cpustate->icount -= IS_8085(cpustat | |
| 667 | 933 | cpustate->HL.b.l = cpustate->HL.b.h; |
| 668 | 934 | break; |
| 669 | case 0x6d: cpustate->icount -= (cpustat | |
| 935 | case 0x6d: cpustate->icount -= IS_8085(cpustat | |
| 670 | 936 | /* no op */ |
| 671 | 937 | break; |
| 672 | 938 | case 0x6e: cpustate->icount -= 7; /* MOV L,M */ |
| 673 | 939 | cpustate->HL.b.l = RM(cpustate, cpustate->HL.d); |
| 674 | 940 | break; |
| 675 | case 0x6f: cpustate->icount -= (cpustat | |
| 941 | case 0x6f: cpustate->icount -= IS_8085(cpustat | |
| 676 | 942 | cpustate->HL.b.l = cpustate->AF.b.h; |
| 677 | 943 | break; |
| 678 | 944 | |
| r3957 | r3958 | |
| 694 | 960 | case 0x75: cpustate->icount -= 7; /* MOV M,L */ |
| 695 | 961 | WM(cpustate, cpustate->HL.d, cpustate->HL.b.l); |
| 696 | 962 | break; |
| 697 | case 0x76: cpustate->icount -= (cpustat | |
| 963 | case 0x76: cpustate->icount -= IS_8085(cpustat | |
| 698 | 964 | cpustate->PC.w.l--; |
| 699 | 965 | cpustate->HALT = 1; |
| 700 | cpustate | |
| 966 | set_status(cpustate, | |
| 701 | 967 | if (cpustate->icount > 0) cpustate->icount = 0; |
| 702 | 968 | break; |
| 703 | 969 | case 0x77: cpustate->icount -= 7; /* MOV M,A */ |
| 704 | 970 | WM(cpustate, cpustate->HL.d, cpustate->AF.b.h); |
| 705 | 971 | break; |
| 706 | 972 | |
| 707 | case 0x78: cpustate->icount -= (cpustat | |
| 973 | case 0x78: cpustate->icount -= IS_8085(cpustat | |
| 708 | 974 | cpustate->AF.b.h = cpustate->BC.b.h; |
| 709 | 975 | break; |
| 710 | case 0x79: cpustate->icount -= (cpustat | |
| 976 | case 0x79: cpustate->icount -= IS_8085(cpustat | |
| 711 | 977 | cpustate->AF.b.h = cpustate->BC.b.l; |
| 712 | 978 | break; |
| 713 | case 0x7a: cpustate->icount -= (cpustat | |
| 979 | case 0x7a: cpustate->icount -= IS_8085(cpustat | |
| 714 | 980 | cpustate->AF.b.h = cpustate->DE.b.h; |
| 715 | 981 | break; |
| 716 | case 0x7b: cpustate->icount -= (cpustat | |
| 982 | case 0x7b: cpustate->icount -= IS_8085(cpustat | |
| 717 | 983 | cpustate->AF.b.h = cpustate->DE.b.l; |
| 718 | 984 | break; |
| 719 | case 0x7c: cpustate->icount -= (cpustat | |
| 985 | case 0x7c: cpustate->icount -= IS_8085(cpustat | |
| 720 | 986 | cpustate->AF.b.h = cpustate->HL.b.h; |
| 721 | 987 | break; |
| 722 | case 0x7d: cpustate->icount -= (cpustat | |
| 988 | case 0x7d: cpustate->icount -= IS_8085(cpustat | |
| 723 | 989 | cpustate->AF.b.h = cpustate->HL.b.l; |
| 724 | 990 | break; |
| 725 | 991 | case 0x7e: cpustate->icount -= 7; /* MOV A,M */ |
| 726 | 992 | cpustate->AF.b.h = RM(cpustate, cpustate->HL.d); |
| 727 | 993 | break; |
| 728 | case 0x7f: cpustate->icount -= (cpustat | |
| 994 | case 0x7f: cpustate->icount -= IS_8085(cpustat | |
| 729 | 995 | /* no op */ |
| 730 | 996 | break; |
| 731 | 997 | |
| r3957 | r3958 | |
| 929 | 1195 | M_CMP(cpustate->AF.b.h); |
| 930 | 1196 | break; |
| 931 | 1197 | |
| 932 | case 0xc0: cpustate->icount -= (cpustat | |
| 1198 | case 0xc0: cpustate->icount -= IS_8085(cpustat | |
| 933 | 1199 | M_RET( !(cpustate->AF.b.l & ZF) ); |
| 934 | 1200 | break; |
| 935 | 1201 | case 0xc1: cpustate->icount -= 10; /* POP B */ |
| r3957 | r3958 | |
| 944 | 1210 | case 0xc4: cpustate->icount -= 11; /* CNZ nnnn */ |
| 945 | 1211 | M_CALL( !(cpustate->AF.b.l & ZF) ); |
| 946 | 1212 | break; |
| 947 | case 0xc5: cpustate->icount -= (cpustat | |
| 1213 | case 0xc5: cpustate->icount -= IS_8085(cpustat | |
| 948 | 1214 | M_PUSH(BC); |
| 949 | 1215 | break; |
| 950 | 1216 | case 0xc6: cpustate->icount -= 7; /* ADI nn */ |
| 951 | 1217 | cpustate->XX.b.l = ARG(cpustate); |
| 952 | 1218 | M_ADD(cpustate->XX.b.l); |
| 953 | 1219 | break; |
| 954 | case 0xc7: cpustate->icount -= (cpustat | |
| 1220 | case 0xc7: cpustate->icount -= IS_8085(cpustat | |
| 955 | 1221 | M_RST(0); |
| 956 | 1222 | break; |
| 957 | 1223 | |
| 958 | case 0xc8: cpustate->icount -= (cpustat | |
| 1224 | case 0xc8: cpustate->icount -= IS_8085(cpustat | |
| 959 | 1225 | M_RET( cpustate->AF.b.l & ZF ); |
| 960 | 1226 | break; |
| 961 | 1227 | case 0xc9: cpustate->icount -= 10; /* RET */ |
| r3957 | r3958 | |
| 965 | 1231 | M_JMP( cpustate->AF.b.l & ZF ); |
| 966 | 1232 | break; |
| 967 | 1233 | case 0xcb: |
| 968 | if | |
| 1234 | if | |
| 969 | 1235 | if (cpustate->AF.b.l & VF) { |
| 970 | 1236 | cpustate->icount -= 12; |
| 971 | 1237 | M_RST(8); /* call 0x40 */ |
| r3957 | r3958 | |
| 987 | 1253 | cpustate->XX.b.l = ARG(cpustate); |
| 988 | 1254 | M_ADC(cpustate->XX.b.l); |
| 989 | 1255 | break; |
| 990 | case 0xcf: cpustate->icount -= (cpustat | |
| 1256 | case 0xcf: cpustate->icount -= IS_8085(cpustat | |
| 991 | 1257 | M_RST(1); |
| 992 | 1258 | break; |
| 993 | 1259 | |
| 994 | case 0xd0: cpustate->icount -= (cpustat | |
| 1260 | case 0xd0: cpustate->icount -= IS_8085(cpustat | |
| 995 | 1261 | M_RET( !(cpustate->AF.b.l & CF) ); |
| 996 | 1262 | break; |
| 997 | 1263 | case 0xd1: cpustate->icount -= 10; /* POP D */ |
| r3957 | r3958 | |
| 1006 | 1272 | case 0xd4: cpustate->icount -= 11; /* CNC nnnn */ |
| 1007 | 1273 | M_CALL( !(cpustate->AF.b.l & CF) ); |
| 1008 | 1274 | break; |
| 1009 | case 0xd5: cpustate->icount -= (cpustat | |
| 1275 | case 0xd5: cpustate->icount -= IS_8085(cpustat | |
| 1010 | 1276 | M_PUSH(DE); |
| 1011 | 1277 | break; |
| 1012 | 1278 | case 0xd6: cpustate->icount -= 7; /* SUI nn */ |
| 1013 | 1279 | cpustate->XX.b.l = ARG(cpustate); |
| 1014 | 1280 | M_SUB(cpustate->XX.b.l); |
| 1015 | 1281 | break; |
| 1016 | case 0xd7: cpustate->icount -= (cpustat | |
| 1282 | case 0xd7: cpustate->icount -= IS_8085(cpustat | |
| 1017 | 1283 | M_RST(2); |
| 1018 | 1284 | break; |
| 1019 | 1285 | |
| 1020 | case 0xd8: cpustate->icount -= (cpustat | |
| 1286 | case 0xd8: cpustate->icount -= IS_8085(cpustat | |
| 1021 | 1287 | M_RET( cpustate->AF.b.l & CF ); |
| 1022 | 1288 | break; |
| 1023 | 1289 | case 0xd9: |
| 1024 | if | |
| 1290 | if | |
| 1025 | 1291 | cpustate->icount -= 10; /* SHLX */ |
| 1026 | 1292 | cpustate->XX.w.l = cpustate->DE.w.l; |
| 1027 | 1293 | WM(cpustate, cpustate->XX.d, cpustate->HL.b.l); |
| r3957 | r3958 | |
| 1042 | 1308 | M_CALL( cpustate->AF.b.l & CF ); |
| 1043 | 1309 | break; |
| 1044 | 1310 | case 0xdd: |
| 1045 | if | |
| 1311 | if | |
| 1046 | 1312 | cpustate->icount -= 7; /* JNX nnnn */ |
| 1047 | 1313 | M_JMP( !(cpustate->AF.b.l & XF) ); |
| 1048 | 1314 | } else { |
| r3957 | r3958 | |
| 1054 | 1320 | cpustate->XX.b.l = ARG(cpustate); |
| 1055 | 1321 | M_SBB(cpustate->XX.b.l); |
| 1056 | 1322 | break; |
| 1057 | case 0xdf: cpustate->icount -= (cpustat | |
| 1323 | case 0xdf: cpustate->icount -= IS_8085(cpustat | |
| 1058 | 1324 | M_RST(3); |
| 1059 | 1325 | break; |
| 1060 | 1326 | |
| 1061 | case 0xe0: cpustate->icount -= (cpustat | |
| 1327 | case 0xe0: cpustate->icount -= IS_8085(cpustat | |
| 1062 | 1328 | M_RET( !(cpustate->AF.b.l & VF) ); |
| 1063 | 1329 | break; |
| 1064 | 1330 | case 0xe1: cpustate->icount -= 10; /* POP H */ |
| r3957 | r3958 | |
| 1067 | 1333 | case 0xe2: cpustate->icount -= 10; /* JPO nnnn */ |
| 1068 | 1334 | M_JMP( !(cpustate->AF.b.l & VF) ); |
| 1069 | 1335 | break; |
| 1070 | case 0xe3: cpustate->icount -= (cpustat | |
| 1336 | case 0xe3: cpustate->icount -= IS_8085(cpustat | |
| 1071 | 1337 | M_POP(XX); |
| 1072 | 1338 | M_PUSH(HL); |
| 1073 | 1339 | cpustate->HL.d = cpustate->XX.d; |
| r3957 | r3958 | |
| 1075 | 1341 | case 0xe4: cpustate->icount -= 11; /* CPO nnnn */ |
| 1076 | 1342 | M_CALL( !(cpustate->AF.b.l & VF) ); |
| 1077 | 1343 | break; |
| 1078 | case 0xe5: cpustate->icount -= (cpustat | |
| 1344 | case 0xe5: cpustate->icount -= IS_8085(cpustat | |
| 1079 | 1345 | M_PUSH(HL); |
| 1080 | 1346 | break; |
| 1081 | 1347 | case 0xe6: cpustate->icount -= 7; /* ANI nn */ |
| 1082 | 1348 | cpustate->XX.b.l = ARG(cpustate); |
| 1083 | 1349 | M_ANA(cpustate->XX.b.l); |
| 1084 | 1350 | break; |
| 1085 | case 0xe7: cpustate->icount -= (cpustat | |
| 1351 | case 0xe7: cpustate->icount -= IS_8085(cpustat | |
| 1086 | 1352 | M_RST(4); |
| 1087 | 1353 | break; |
| 1088 | 1354 | |
| 1089 | case 0xe8: cpustate->icount -= (cpustat | |
| 1355 | case 0xe8: cpustate->icount -= IS_8085(cpustat | |
| 1090 | 1356 | M_RET( cpustate->AF.b.l & VF ); |
| 1091 | 1357 | break; |
| 1092 | case 0xe9: cpustate->icount -= (cpustat | |
| 1358 | case 0xe9: cpustate->icount -= IS_8085(cpustat | |
| 1093 | 1359 | cpustate->PC.d = cpustate->HL.w.l; |
| 1094 | 1360 | break; |
| 1095 | 1361 | case 0xea: cpustate->icount -= 10; /* JPE nnnn */ |
| r3957 | r3958 | |
| 1104 | 1370 | M_CALL( cpustate->AF.b.l & VF ); |
| 1105 | 1371 | break; |
| 1106 | 1372 | case 0xed: |
| 1107 | if | |
| 1373 | if | |
| 1108 | 1374 | cpustate->icount -= 10; /* LHLX */ |
| 1109 | 1375 | cpustate->XX.w.l = cpustate->DE.w.l; |
| 1110 | 1376 | cpustate->HL.b.l = RM(cpustate, cpustate->XX.d); |
| r3957 | r3958 | |
| 1119 | 1385 | cpustate->XX.b.l = ARG(cpustate); |
| 1120 | 1386 | M_XRA(cpustate->XX.b.l); |
| 1121 | 1387 | break; |
| 1122 | case 0xef: cpustate->icount -= (cpustat | |
| 1388 | case 0xef: cpustate->icount -= IS_8085(cpustat | |
| 1123 | 1389 | M_RST(5); |
| 1124 | 1390 | break; |
| 1125 | 1391 | |
| 1126 | case 0xf0: cpustate->icount -= (cpustat | |
| 1392 | case 0xf0: cpustate->icount -= IS_8085(cpustat | |
| 1127 | 1393 | M_RET( !(cpustate->AF.b.l&SF) ); |
| 1128 | 1394 | break; |
| 1129 | 1395 | case 0xf1: cpustate->icount -= 10; /* POP A */ |
| r3957 | r3958 | |
| 1134 | 1400 | break; |
| 1135 | 1401 | case 0xf3: cpustate->icount -= 4; /* DI */ |
| 1136 | 1402 | /* remove interrupt enable */ |
| 1137 | cpustate->IM &= ~IM_IEN; | |
| 1138 | if (cpustate->inte_callback) (*cpustate->inte_callback)(cpustate->device, (cpustate->IM & IM_IEN) ? 1 : 0); | |
| 1403 | set_inte(cpustate, 0); | |
| 1139 | 1404 | break; |
| 1140 | 1405 | case 0xf4: cpustate->icount -= 11; /* CP nnnn */ |
| 1141 | 1406 | M_CALL( !(cpustate->AF.b.l & SF) ); |
| 1142 | 1407 | break; |
| 1143 | case 0xf5: cpustate->icount -= (cpustat | |
| 1408 | case 0xf5: cpustate->icount -= IS_8085(cpustat | |
| 1144 | 1409 | M_PUSH(AF); |
| 1145 | 1410 | break; |
| 1146 | 1411 | case 0xf6: cpustate->icount -= 7; /* ORI nn */ |
| 1147 | 1412 | cpustate->XX.b.l = ARG(cpustate); |
| 1148 | 1413 | M_ORA(cpustate->XX.b.l); |
| 1149 | 1414 | break; |
| 1150 | case 0xf7: cpustate->icount -= (cpustat | |
| 1415 | case 0xf7: cpustate->icount -= IS_8085(cpustat | |
| 1151 | 1416 | M_RST(6); |
| 1152 | 1417 | break; |
| 1153 | 1418 | |
| 1154 | case 0xf8: cpustate->icount -= (cpustat | |
| 1419 | case 0xf8: cpustate->icount -= IS_8085(cpustat | |
| 1155 | 1420 | M_RET( cpustate->AF.b.l & SF ); |
| 1156 | 1421 | break; |
| 1157 | case 0xf9: cpustate->icount -= (cpustat | |
| 1422 | case 0xf9: cpustate->icount -= IS_8085(cpustat | |
| 1158 | 1423 | cpustate->SP.d = cpustate->HL.d; |
| 1159 | 1424 | break; |
| 1160 | 1425 | case 0xfa: cpustate->icount -= 10; /* JM nnnn */ |
| r3957 | r3958 | |
| 1162 | 1427 | break; |
| 1163 | 1428 | case 0xfb: cpustate->icount -= 4; /* EI */ |
| 1164 | 1429 | /* set interrupt enable */ |
| 1165 | cpustate->IM |= IM_IEN; | |
| 1166 | if (cpustate->inte_callback) (*cpustate->inte_callback)(cpustate->device, (cpustate->IM & IM_IEN) ? 1 : 0); | |
| 1167 | cpustate->after_ei = TRUE; | |
| 1430 | set_inte(cpustate, 1); | |
| 1431 | cpustate->after_ei = 2; | |
| 1168 | 1432 | break; |
| 1169 | 1433 | case 0xfc: cpustate->icount -= 11; /* CM nnnn */ |
| 1170 | 1434 | M_CALL( cpustate->AF.b.l & SF ); |
| 1171 | 1435 | break; |
| 1172 | 1436 | case 0xfd: |
| 1173 | if | |
| 1437 | if | |
| 1174 | 1438 | cpustate->icount -= 7; /* JX nnnn */ |
| 1175 | 1439 | M_JMP( cpustate->AF.b.l & XF ); |
| 1176 | 1440 | } else { |
| r3957 | r3958 | |
| 1182 | 1446 | cpustate->XX.b.l = ARG(cpustate); |
| 1183 | 1447 | M_CMP(cpustate->XX.b.l); |
| 1184 | 1448 | break; |
| 1185 | case 0xff: cpustate->icount -= (cpustat | |
| 1449 | case 0xff: cpustate->icount -= IS_8085(cpustat | |
| 1186 | 1450 | M_RST(7); |
| 1187 | 1451 | break; |
| 1188 | 1452 | } |
| 1189 | 1453 | } |
| 1190 | 1454 | |
| 1191 | static void Interrupt(i8085_state *cpustate) | |
| 1192 | { | |
| 1193 | 1455 | |
| 1194 | if( cpustate->HALT ) /* if the CPU was halted */ | |
| 1195 | { | |
| 1196 | cpustate->PC.w.l++; /* skip HALT instr */ | |
| 1197 | cpustate->HALT = 0; | |
| 1198 | cpustate->STATUS = 0x26; // int ack while halt | |
| 1199 | } else { | |
| 1200 | cpustate->STATUS = 0x23; // int ack | |
| 1201 | } | |
| 1202 | //AT | |
| 1203 | cpustate->IREQ &= ~cpustate->ISRV; // remove serviced IRQ flag | |
| 1204 | cpustate->rim_ien = (cpustate->ISRV==IM_TRAP) ? cpustate->IM & IM_IEN : 0; // latch general interrupt enable bit on TRAP or NMI | |
| 1205 | //ZT | |
| 1206 | cpustate->IM &= ~IM_IEN; /* remove general interrupt enable bit */ | |
| 1456 | /*************************************************************************** | |
| 1457 | COMMON EXECUTION | |
| 1458 | ***************************************************************************/ | |
| 1207 | 1459 | |
| 1208 | if( cpustate->ISRV == IM_INTR ) | |
| 1209 | { | |
| 1210 | LOG(("Interrupt get INTR vector\n")); | |
| 1211 | cpustate->IRQ1 = (cpustate->irq_callback)(cpustate->device, 0); | |
| 1212 | } | |
| 1213 | ||
| 1214 | if( cpustate->cputype ) | |
| 1215 | { | |
| 1216 | if( cpustate->ISRV == IM_RST55 ) | |
| 1217 | { | |
| 1218 | LOG(("Interrupt get RST5.5 vector\n")); | |
| 1219 | //cpustate->IRQ1 = (cpustate->irq_callback)(cpustate->device, 1); | |
| 1220 | cpustate->irq_state[I8085_RST55_LINE] = CLEAR_LINE; //AT: processing RST5.5, reset interrupt line | |
| 1221 | } | |
| 1222 | ||
| 1223 | if( cpustate->ISRV == IM_RST65 ) | |
| 1224 | { | |
| 1225 | LOG(("Interrupt get RST6.5 vector\n")); | |
| 1226 | //cpustate->IRQ1 = (cpustate->irq_callback)(cpustate->device, 2); | |
| 1227 | cpustate->irq_state[I8085_RST65_LINE] = CLEAR_LINE; //AT: processing RST6.5, reset interrupt line | |
| 1228 | } | |
| 1229 | ||
| 1230 | if( cpustate->ISRV == IM_RST75 ) | |
| 1231 | { | |
| 1232 | LOG(("Interrupt get RST7.5 vector\n")); | |
| 1233 | //cpustate->IRQ1 = (cpustate->irq_callback)(cpustate->device, 3); | |
| 1234 | cpustate->irq_state[I8085_RST75_LINE] = CLEAR_LINE; //AT: processing RST7.5, reset interrupt line | |
| 1235 | } | |
| 1236 | } | |
| 1237 | ||
| 1238 | switch( cpustate->IRQ1 & 0xff0000 ) | |
| 1239 | { | |
| 1240 | case 0xcd0000: /* CALL nnnn */ | |
| 1241 | cpustate->icount -= 7; | |
| 1242 | M_PUSH(PC); | |
| 1243 | case 0xc30000: /* JMP nnnn */ | |
| 1244 | cpustate->icount -= 10; | |
| 1245 | cpustate->PC.d = cpustate->IRQ1 & 0xffff; | |
| 1246 | break; | |
| 1247 | default: | |
| 1248 | switch( cpustate->ISRV ) | |
| 1249 | { | |
| 1250 | case IM_TRAP: | |
| 1251 | case IM_RST75: | |
| 1252 | case IM_RST65: | |
| 1253 | case IM_RST55: | |
| 1254 | M_PUSH(PC); | |
| 1255 | if (cpustate->IRQ1 != (1 << I8085_RST75_LINE)) | |
| 1256 | cpustate->PC.d = cpustate->IRQ1; | |
| 1257 | else | |
| 1258 | cpustate->PC.d = 0x3c; | |
| 1259 | break; | |
| 1260 | default: | |
| 1261 | LOG(("i8085 take int $%02x\n", cpustate->IRQ1)); | |
| 1262 | execute_one(cpustate, cpustate->IRQ1 & 0xff); | |
| 1263 | } | |
| 1264 | } | |
| 1265 | cpustate->ISRV = 0; | |
| 1266 | } | |
| 1267 | ||
| 1268 | static CPU_EXECUTE( i8085 ) | |
| 1460 | static CPU_EXECUTE( i808x ) | |
| 1269 | 1461 | { |
| 1270 | 1462 | i8085_state *cpustate = device->token; |
| 1271 | 1463 | |
| 1272 | 1464 | cpustate->icount = cycles; |
| 1465 | ||
| 1466 | /* check for TRAPs before diving in (can't do others because of after_ei) */ | |
| 1467 | if (cpustate->trap_pending || cpustate->after_ei == 0) | |
| 1468 | check_for_interrupts(cpustate); | |
| 1469 | ||
| 1273 | 1470 | do |
| 1274 | 1471 | { |
| 1275 | 1472 | debugger_instruction_hook(device, cpustate->PC.d); |
| 1276 | 1473 | |
| 1277 | /* interrupts enabled or TRAP pending ? */ | |
| 1278 | if ( ((cpustate->IM & IM_IEN) && (!cpustate->after_ei)) || (cpustate->IREQ & IM_TRAP) ) | |
| 1279 | { | |
| 1280 | /* copy scheduled to executed interrupt request */ | |
| 1281 | cpustate->IRQ1 = cpustate->IRQ2; | |
| 1282 | /* reset scheduled interrupt request */ | |
| 1283 | cpustate->IRQ2 = 0; | |
| 1284 | /* interrupt now ? */ | |
| 1285 | if (cpustate->IRQ1) Interrupt(cpustate); | |
| 1286 | } | |
| 1474 | /* the instruction after an EI does not take an interrupt, so | |
| 1475 | we cannot check immediately; handle post-EI behavior here */ | |
| 1476 | if (cpustate->after_ei != 0 && --cpustate->after_ei == 0) | |
| 1477 | check_for_interrupts(cpustate); | |
| 1287 | 1478 | |
| 1288 | cpustate->after_ei = FALSE; | |
| 1289 | 1479 | /* here we go... */ |
| 1290 | 1480 | execute_one(cpustate, ROP(cpustate)); |
| 1291 | 1481 | |
| r3957 | r3958 | |
| 1294 | 1484 | return cycles - cpustate->icount; |
| 1295 | 1485 | } |
| 1296 | 1486 | |
| 1297 | /**************************************************************************** | |
| 1298 | * Initialise the various lookup tables used by the emulation code | |
| 1299 | ****************************************************************************/ | |
| 1487 | ||
| 1488 | ||
| 1489 | /*************************************************************************** | |
| 1490 | CORE INITIALIZATION | |
| 1491 | ***************************************************************************/ | |
| 1492 | ||
| 1300 | 1493 | static void init_tables (void) |
| 1301 | 1494 | { |
| 1302 | 1495 | UINT8 zs; |
| r3957 | r3958 | |
| 1320 | 1513 | } |
| 1321 | 1514 | } |
| 1322 | 1515 | |
| 1323 | /**************************************************************************** | |
| 1324 | * Init the 8085 emulation | |
| 1325 | ****************************************************************************/ | |
| 1326 | static CPU_INIT( i8085 ) | |
| 1516 | ||
| 1517 | static void init_808x_common(const device_config *device, cpu_irq_callback irqcallback, int type) | |
| 1327 | 1518 | { |
| 1328 | 1519 | i8085_state *cpustate = device->token; |
| 1329 | 1520 | |
| 1330 | 1521 | init_tables(); |
| 1331 | cpustate->cputype = 1; | |
| 1522 | ||
| 1523 | /* set up the state table */ | |
| 1524 | cpustate->state = state_table_template; | |
| 1525 | cpustate->state.baseptr = cpustate; | |
| 1526 | cpustate->state.subtypemask = 1 << type; | |
| 1527 | ||
| 1528 | if (device->static_config != NULL) | |
| 1529 | cpustate->config = *(i8085_config *)device->static_config; | |
| 1530 | cpustate->cputype = type; | |
| 1332 | 1531 | cpustate->irq_callback = irqcallback; |
| 1333 | 1532 | cpustate->device = device; |
| 1533 | ||
| 1334 | 1534 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 1335 | 1535 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); |
| 1336 | 1536 | |
| 1537 | state_save_register_device_item(device, 0, cpustate->PC.w.l); | |
| 1538 | state_save_register_device_item(device, 0, cpustate->SP.w.l); | |
| 1337 | 1539 | state_save_register_device_item(device, 0, cpustate->AF.w.l); |
| 1338 | 1540 | state_save_register_device_item(device, 0, cpustate->BC.w.l); |
| 1339 | 1541 | state_save_register_device_item(device, 0, cpustate->DE.w.l); |
| 1340 | 1542 | state_save_register_device_item(device, 0, cpustate->HL.w.l); |
| 1341 | state_save_register_device_item(device, 0, cpustate->SP.w.l); | |
| 1342 | state_save_register_device_item(device, 0, cpustate->PC.w.l); | |
| 1343 | 1543 | state_save_register_device_item(device, 0, cpustate->HALT); |
| 1344 | 1544 | state_save_register_device_item(device, 0, cpustate->IM); |
| 1345 | state_save_register_device_item(device, 0, cpustate->IREQ); | |
| 1346 | state_save_register_device_item(device, 0, cpustate->ISRV); | |
| 1347 | state_save_register_device_item(device, 0, cpustate->INTR); | |
| 1348 | state_save_register_device_item(device, 0, cpustate->IRQ2); | |
| 1349 | state_save_register_device_item(device, 0, cpustate->IRQ1); | |
| 1350 | 1545 | state_save_register_device_item(device, 0, cpustate->STATUS); |
| 1351 | 1546 | state_save_register_device_item(device, 0, cpustate->after_ei); |
| 1547 | state_save_register_device_item(device, 0, cpustate->nmi_state); | |
| 1352 | 1548 | state_save_register_device_item_array(device, 0, cpustate->irq_state); |
| 1549 | state_save_register_device_item(device, 0, cpustate->trap_pending); | |
| 1550 | state_save_register_device_item(device, 0, cpustate->trap_im_copy); | |
| 1551 | state_save_register_device_item(device, 0, cpustate->sod_state); | |
| 1353 | 1552 | } |
| 1354 | 1553 | |
| 1355 | /**************************************************************************** | |
| 1356 | * Reset the 8085 emulation | |
| 1357 | ****************************************************************************/ | |
| 1358 | static CPU_RESET( i8085 ) | |
| 1554 | static CPU_INIT( i8080 ) | |
| 1359 | 1555 | { |
| 1360 | i8085_state *cpustate = device->token; | |
| 1361 | cpu_irq_callback save_irqcallback; | |
| 1362 | i8085_sod_func save_sodcallback; | |
| 1363 | i8085_sid_func save_sidcallback; | |
| 1364 | i8085_inte_func save_intecallback; | |
| 1365 | i8085_status_func save_statuscallback; | |
| 1366 | int cputype_bak = cpustate->cputype; | |
| 1367 | ||
| 1368 | init_tables(); | |
| 1369 | save_irqcallback = cpustate->irq_callback; | |
| 1370 | save_sodcallback = cpustate->sod_callback; | |
| 1371 | save_sidcallback = cpustate->sid_callback; | |
| 1372 | save_intecallback = cpustate->inte_callback; | |
| 1373 | save_statuscallback = cpustate->status_callback; | |
| 1374 | memset(cpustate, 0, sizeof(*cpustate)); | |
| 1375 | cpustate->irq_callback = save_irqcallback; | |
| 1376 | cpustate->sod_callback = save_sodcallback; | |
| 1377 | cpustate->sid_callback = save_sidcallback; | |
| 1378 | cpustate->inte_callback = save_intecallback; | |
| 1379 | cpustate->status_callback = save_statuscallback; | |
| 1380 | cpustate->device = device; | |
| 1381 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); | |
| 1382 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); | |
| 1383 | ||
| 1384 | cpustate->cputype = cputype_bak; | |
| 1385 | cpustate->after_ei = FALSE; | |
| 1386 | ||
| 1387 | if (cpustate->inte_callback) (*cpustate->inte_callback)(cpustate->device, (cpustate->IM & IM_IEN) ? 1 : 0); | |
| 1556 | init_808x_common(device, irqcallback, CPUTYPE_8080); | |
| 1388 | 1557 | } |
| 1389 | 1558 | |
| 1390 | /**************************************************************************** | |
| 1391 | * Shut down the CPU emulation | |
| 1392 | ****************************************************************************/ | |
| 1393 | static CPU_EXIT( i8085 ) | |
| 1559 | static CPU_INIT( i8085 ) | |
| 1394 | 1560 | { |
| 1395 | | |
| 1561 | | |
| 1396 | 1562 | } |
| 1397 | 1563 | |
| 1398 | /****************************************************************************/ | |
| 1399 | /* Set TRAP signal state */ | |
| 1400 | /****************************************************************************/ | |
| 1401 | static void i8085_set_TRAP(i8085_state *cpustate, int state) | |
| 1402 | { | |
| 1403 | LOG(("i8085: TRAP %d\n", state)); | |
| 1404 | if (state) | |
| 1405 | { | |
| 1406 | cpustate->IREQ |= IM_TRAP; | |
| 1407 | if( cpustate->ISRV & IM_TRAP ) return; /* already servicing TRAP ? */ | |
| 1408 | cpustate->ISRV = IM_TRAP; /* service TRAP */ | |
| 1409 | cpustate->IRQ2 = ADDR_TRAP; | |
| 1410 | } | |
| 1411 | else | |
| 1412 | { | |
| 1413 | cpustate->IREQ &= ~IM_TRAP; /* remove request for TRAP */ | |
| 1414 | } | |
| 1415 | } | |
| 1416 | 1564 | |
| 1417 | /****************************************************************************/ | |
| 1418 | /* Set RST7.5 signal state */ | |
| 1419 | /****************************************************************************/ | |
| 1420 | static void i8085_set_RST75(i8085_state *cpustate, int state) | |
| 1421 | { | |
| 1422 | LOG(("i8085: RST7.5 %d\n", state)); | |
| 1423 | if( state ) | |
| 1424 | { | |
| 1425 | 1565 | |
| 1426 | cpustate->IREQ |= IM_RST75; /* request RST7.5 */ | |
| 1427 | cpustate->irq_state[I8085_RST75_LINE] = CLEAR_LINE; /* clear latch */ | |
| 1428 | if( cpustate->IM & IM_RST75 ) return; /* if masked, ignore it for now */ | |
| 1429 | if( !cpustate->ISRV ) /* if no higher priority IREQ is serviced */ | |
| 1430 | { | |
| 1431 | cpustate->ISRV = IM_RST75; /* service RST7.5 */ | |
| 1432 | cpustate->IRQ2 = ADDR_RST75; | |
| 1433 | } | |
| 1434 | } | |
| 1435 | /* RST7.5 is reset only by SIM or end of service routine ! */ | |
| 1436 | } | |
| 1566 | /*************************************************************************** | |
| 1567 | COMMON RESET | |
| 1568 | ***************************************************************************/ | |
| 1437 | 1569 | |
| 1438 | /****************************************************************************/ | |
| 1439 | /* Set RST6.5 signal state */ | |
| 1440 | /****************************************************************************/ | |
| 1441 | static void i8085_set_RST65(i8085_state *cpustate, int state) | |
| 1570 | static CPU_RESET( i808x ) | |
| 1442 | 1571 | { |
| 1443 | LOG(("i8085: RST6.5 %d\n", state)); | |
| 1444 | if( state ) | |
| 1445 | { | |
| 1446 | cpustate->IREQ |= IM_RST65; /* request RST6.5 */ | |
| 1447 | if( cpustate->IM & IM_RST65 ) return; /* if masked, ignore it for now */ | |
| 1448 | if( !cpustate->ISRV ) /* if no higher priority IREQ is serviced */ | |
| 1449 | { | |
| 1450 | cpustate->ISRV = IM_RST65; /* service RST6.5 */ | |
| 1451 | cpustate->IRQ2 = ADDR_RST65; | |
| 1452 | } | |
| 1453 | } | |
| 1454 | else | |
| 1455 | { | |
| 1456 | cpustate->IREQ &= ~IM_RST65; /* remove request for RST6.5 */ | |
| 1457 | } | |
| 1458 | } | |
| 1572 | i8085_state *cpustate = device->token; | |
| 1459 | 1573 | |
| 1460 | /****************************************************************************/ | |
| 1461 | /* Set RST5.5 signal state */ | |
| 1462 | /****************************************************************************/ | |
| 1463 | static void i8085_set_RST55(i8085_state *cpustate, int state) | |
| 1464 | { | |
| 1465 | LOG(("i8085: RST5.5 %d\n", state)); | |
| 1466 | if( state ) | |
| 1467 | { | |
| 1468 | cpustate->IREQ |= IM_RST55; /* request RST5.5 */ | |
| 1469 | if( cpustate->IM & IM_RST55 ) return; /* if masked, ignore it for now */ | |
| 1470 | if( !cpustate->ISRV ) /* if no higher priority IREQ is serviced */ | |
| 1471 | { | |
| 1472 | cpustate->ISRV = IM_RST55; /* service RST5.5 */ | |
| 1473 | cpustate->IRQ2 = ADDR_RST55; | |
| 1474 | } | |
| 1475 | } | |
| 1476 | else | |
| 1477 | { | |
| 1478 | cpustate->IREQ &= ~IM_RST55; /* remove request for RST5.5 */ | |
| 1479 | } | |
| 1574 | cpustate->PC.d = 0; | |
| 1575 | cpustate->HALT = 0; | |
| 1576 | cpustate->IM &= ~IM_I75; | |
| 1577 | cpustate->IM |= IM_M55 | IM_M65 | IM_M75; | |
| 1578 | cpustate->after_ei = FALSE; | |
| 1579 | cpustate->trap_pending = FALSE; | |
| 1580 | cpustate->trap_im_copy = 0; | |
| 1581 | set_inte(cpustate, 0); | |
| 1582 | set_sod(cpustate, 0); | |
| 1480 | 1583 | } |
| 1481 | 1584 | |
| 1482 | /****************************************************************************/ | |
| 1483 | /* Set INTR signal */ | |
| 1484 | /****************************************************************************/ | |
| 1485 | static void i8085_set_INTR(i8085_state *cpustate, int state) | |
| 1486 | { | |
| 1487 | LOG(("i8085: INTR %d\n", state)); | |
| 1488 | if( state ) | |
| 1489 | { | |
| 1490 | cpustate->IREQ |= IM_INTR; /* request INTR */ | |
| 1491 | //cpustate->INTR = state; | |
| 1492 | cpustate->INTR = I8085_INTR; //AT: cpustate->INTR is supposed to hold IRQ0 vector(0x38) (0xff in this implementation) | |
| 1493 | if( cpustate->IM & IM_INTR ) return; /* if masked, ignore it for now */ | |
| 1494 | if( !cpustate->ISRV ) /* if no higher priority IREQ is serviced */ | |
| 1495 | { | |
| 1496 | cpustate->ISRV = IM_INTR; /* service INTR */ | |
| 1497 | cpustate->IRQ2 = cpustate->INTR; | |
| 1498 | } | |
| 1499 | } | |
| 1500 | else | |
| 1501 | { | |
| 1502 | cpustate->IREQ &= ~IM_INTR; /* remove request for INTR */ | |
| 1503 | } | |
| 1504 | } | |
| 1505 | 1585 | |
| 1506 | static void i8085_set_irq_line(i8085_state *cpustate, int irqline, int state) | |
| 1586 | ||
| 1587 | /*************************************************************************** | |
| 1588 | COMMON STATE IMPORT/EXPORT | |
| 1589 | ***************************************************************************/ | |
| 1590 | ||
| 1591 | static CPU_IMPORT_STATE( i808x ) | |
| 1507 | 1592 | { |
| 1508 | if (irqline == INPUT_LINE_NMI) | |
| 1593 | i8085_state *cpustate = device->token; | |
| 1594 | ||
| 1595 | switch (entry->index) | |
| 1509 | 1596 | { |
| 1510 | if( state != CLEAR_LINE ) | |
| 1511 | i8085_set_TRAP(cpustate, 1); | |
| 1512 | } | |
| 1513 | else if (irqline < 4) | |
| 1514 | { | |
| 1515 | if (irqline == I8085_RST75_LINE) /* RST7.5 is latched on rising edge, the others are sampled */ | |
| 1516 | { | |
| 1517 | if( state != CLEAR_LINE ) | |
| 1518 | cpustate->irq_state[irqline] = state; | |
| 1519 | } | |
| 1520 | else | |
| 1521 | cpustate->irq_state[irqline] = state; | |
| 1597 | case I8085_SID: | |
| 1598 | if (cpustate->ietemp) | |
| 1599 | cpustate->IM |= IM_SID; | |
| 1600 | else | |
| 1601 | cpustate->IM &= ~IM_SID; | |
| 1602 | break; | |
| 1522 | 1603 | |
| 1523 | if (state == CLEAR_LINE) | |
| 1524 | { | |
| 1525 | if( !(cpustate->IM & IM_IEN) ) | |
| 1526 | { | |
| 1527 | switch (irqline) | |
| 1528 | { | |
| 1529 | case I8085_INTR_LINE: i8085_set_INTR(cpustate, 0); break; | |
| 1530 | case I8085_RST55_LINE: i8085_set_RST55(cpustate, 0); break; | |
| 1531 | case I8085_RST65_LINE: i8085_set_RST65(cpustate, 0); break; | |
| 1532 | case I8085_RST75_LINE: i8085_set_RST75(cpustate, 0); break; | |
| 1533 | } | |
| 1534 | } | |
| 1535 | } | |
| 1536 | else | |
| 1537 | { | |
| 1538 | if( cpustate->IM & IM_IEN ) | |
| 1539 | { | |
| 1540 | switch( irqline ) | |
| 1541 | { | |
| 1542 | case I8085_INTR_LINE: i8085_set_INTR(cpustate, 1); break; | |
| 1543 | case I8085_RST55_LINE: i8085_set_RST55(cpustate, 1); break; | |
| 1544 | case I8085_RST65_LINE: i8085_set_RST65(cpustate, 1); break; | |
| 1545 | case I8085_RST75_LINE: i8085_set_RST75(cpustate, 1); break; | |
| 1546 | } | |
| 1547 | } | |
| 1548 | } | |
| 1604 | case I8085_INTE: | |
| 1605 | if (cpustate->ietemp) | |
| 1606 | cpustate->IM |= IM_IE; | |
| 1607 | else | |
| 1608 | cpustate->IM &= ~IM_IE; | |
| 1609 | break; | |
| 1610 | ||
| 1611 | default: | |
| 1612 | fatalerror("CPU_IMPORT_STATE(i808x) called for unexpected value\n"); | |
| 1613 | break; | |
| 1549 | 1614 | } |
| 1550 | 1615 | } |
| 1551 | 1616 | |
| 1552 | 1617 | |
| 1553 | /************************************************************************** | |
| 1554 | * 8080 section | |
| 1555 | **************************************************************************/ | |
| 1556 | #if (HAS_8080) | |
| 1557 | ||
| 1558 | static CPU_INIT( i8080 ) | |
| 1618 | static CPU_EXPORT_STATE( i808x ) | |
| 1559 | 1619 | { |
| 1560 | 1620 | i8085_state *cpustate = device->token; |
| 1561 | 1621 | |
| 1562 | init_tables(); | |
| 1563 | cpustate->cputype = 0; | |
| 1564 | cpustate->irq_callback = irqcallback; | |
| 1565 | cpustate->device = device; | |
| 1622 | switch (entry->index) | |
| 1623 | { | |
| 1624 | case I8085_SID: | |
| 1625 | cpustate->ietemp = ((cpustate->IM & IM_SID) != 0); | |
| 1626 | if (cpustate->config.sid != NULL) | |
| 1627 | cpustate->ietemp = ((*cpustate->config.sid)(cpustate->device) != 0); | |
| 1628 | break; | |
| 1566 | 1629 | |
| 1567 | state_save_register_device_item(device, 0, cpustate->AF.w.l); | |
| 1568 | state_save_register_device_item(device, 0, cpustate->BC.w.l); | |
| 1569 | state_save_register_device_item(device, 0, cpustate->DE.w.l); | |
| 1570 | state_save_register_device_item(device, 0, cpustate->HL.w.l); | |
| 1571 | state_save_register_device_item(device, 0, cpustate->SP.w.l); | |
| 1572 | state_save_register_device_item(device, 0, cpustate->PC.w.l); | |
| 1573 | state_save_register_device_item(device, 0, cpustate->HALT); | |
| 1574 | state_save_register_device_item(device, 0, cpustate->IM); | |
| 1575 | state_save_register_device_item(device, 0, cpustate->IREQ); | |
| 1576 | state_save_register_device_item(device, 0, cpustate->ISRV); | |
| 1577 | state_save_register_device_item(device, 0, cpustate->INTR); | |
| 1578 | state_save_register_device_item(device, 0, cpustate->IRQ2); | |
| 1579 | state_save_register_device_item(device, 0, cpustate->IRQ1); | |
| 1580 | state_save_register_device_item(device, 0, cpustate->STATUS); | |
| 1581 | state_save_register_device_item_array(device, 0, cpustate->irq_state); | |
| 1630 | case I8085_INTE: | |
| 1631 | cpustate->ietemp = ((cpustate->IM & IM_IE) != 0); | |
| 1632 | break; | |
| 1633 | ||
| 1634 | default: | |
| 1635 | fatalerror("CPU_EXPORT_STATE(i808x) called for unexpected value\n"); | |
| 1636 | break; | |
| 1637 | } | |
| 1582 | 1638 | } |
| 1583 | 1639 | |
| 1584 | static void i8080_set_irq_line(i8085_state *cpustate, int irqline, int state) | |
| 1640 | ||
| 1641 | ||
| 1642 | /*************************************************************************** | |
| 1643 | COMMON SET INFO | |
| 1644 | ***************************************************************************/ | |
| 1645 | ||
| 1646 | static void i808x_set_irq_line(i8085_state *cpustate, int irqline, int state) | |
| 1585 | 1647 | { |
| 1648 | int newstate = (state != CLEAR_LINE); | |
| 1649 | ||
| 1650 | /* NMI is edge-triggered */ | |
| 1586 | 1651 | if (irqline == INPUT_LINE_NMI) |
| 1587 | 1652 | { |
| 1588 | if( state != CLEAR_LINE ) | |
| 1589 | i8085_set_TRAP(cpustate, 1); | |
| 1653 | if (!cpustate->nmi_state && newstate) | |
| 1654 | cpustate->trap_pending = TRUE; | |
| 1655 | cpustate->nmi_state = newstate; | |
| 1590 | 1656 | } |
| 1591 | else | |
| 1657 | ||
| 1658 | /* RST7.5 is edge-triggered */ | |
| 1659 | else if (irqline == I8085_RST75_LINE) | |
| 1592 | 1660 | { |
| 1593 | cpustate->irq_state[irqline] = state; | |
| 1594 | if (state == CLEAR_LINE) | |
| 1595 | { | |
| 1596 | if (!(cpustate->IM & IM_IEN)) | |
| 1597 | i8085_set_INTR(cpustate, 0); | |
| 1598 | } | |
| 1599 | else | |
| 1600 | { | |
| 1601 | if (cpustate->IM & IM_IEN) | |
| 1602 | i8085_set_INTR(cpustate, 1); | |
| 1603 | } | |
| 1661 | if (!cpustate->irq_state[I8085_RST75_LINE] && newstate) | |
| 1662 | cpustate->IM |= IM_I75; | |
| 1663 | cpustate->irq_state[I8085_RST75_LINE] = newstate; | |
| 1604 | 1664 | } |
| 1665 | ||
| 1666 | /* remaining sources are level triggered */ | |
| 1667 | else if (irqline < ARRAY_LENGTH(cpustate->irq_state)) | |
| 1668 | cpustate->irq_state[irqline] = state; | |
| 1605 | 1669 | } |
| 1606 | #endif | |
| 1607 | 1670 | |
| 1608 | 1671 | |
| 1609 | /************************************************************************** | |
| 1610 | * Generic set_info | |
| 1611 | **************************************************************************/ | |
| 1612 | ||
| 1613 | static CPU_SET_INFO( i8085 ) | |
| 1672 | static CPU_SET_INFO( i808x ) | |
| 1614 | 1673 | { |
| 1615 | 1674 | i8085_state *cpustate = device->token; |
| 1616 | 1675 | switch (state) |
| 1617 | 1676 | { |
| 1618 | 1677 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 1619 | case CPUINFO_INT_INPUT_STATE + I8085_INTR_LINE: i8085_set_irq_line(cpustate, I8085_INTR_LINE, info->i); break; | |
| 1620 | case CPUINFO_INT_INPUT_STATE + I8085_RST55_LINE:i8085_set_irq_line(cpustate, I8085_RST55_LINE, info->i); break; | |
| 1621 | case CPUINFO_INT_INPUT_STATE + I8085_RST65_LINE:i8085_set_irq_line(cpustate, I8085_RST65_LINE, info->i); break; | |
| 1622 | case CPUINFO_INT_INPUT_STATE + I8085_RST75_LINE:i8085_set_irq_line(cpustate, I8085_RST75_LINE, info->i); break; | |
| 1623 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: i8085_set_irq_line(cpustate, INPUT_LINE_NMI, info->i); break; | |
| 1624 | ||
| 1625 | case CPUINFO_INT_PC: cpustate->PC.w.l = info->i; break; | |
| 1626 | case CPUINFO_INT_REGISTER + I8085_PC: cpustate->PC.w.l = info->i; break; | |
| 1627 | case CPUINFO_INT_SP: cpustate->SP.w.l = info->i; break; | |
| 1628 | case CPUINFO_INT_REGISTER + I8085_SP: cpustate->SP.w.l = info->i; break; | |
| 1629 | case CPUINFO_INT_REGISTER + I8085_AF: cpustate->AF.w.l = info->i; break; | |
| 1630 | case CPUINFO_INT_REGISTER + I8085_BC: cpustate->BC.w.l = info->i; break; | |
| 1631 | case CPUINFO_INT_REGISTER + I8085_DE: cpustate->DE.w.l = info->i; break; | |
| 1632 | case CPUINFO_INT_REGISTER + I8085_HL: cpustate->HL.w.l = info->i; break; | |
| 1633 | case CPUINFO_INT_REGISTER + I8085_IM: cpustate->IM = info->i; break; | |
| 1634 | case CPUINFO_INT_REGISTER + I8085_HALT: cpustate->HALT = info->i; break; | |
| 1635 | case CPUINFO_INT_REGISTER + I8085_IREQ: cpustate->IREQ = info->i; break; | |
| 1636 | case CPUINFO_INT_REGISTER + I8085_ISRV: cpustate->ISRV = info->i; break; | |
| 1637 | case CPUINFO_INT_REGISTER + I8085_VECTOR: cpustate->INTR = info->i; break; | |
| 1638 | case CPUINFO_INT_REGISTER + I8085_STATUS: cpustate->STATUS = info->i; break; | |
| 1639 | ||
| 1640 | case CPUINFO_INT_I8085_SID: if (info->i) cpustate->IM |= IM_SID; else cpustate->IM &= ~IM_SID; break; | |
| 1641 | ||
| 1642 | /* --- the following bits of info are set as pointers to data or functions --- */ | |
| 1643 | case CPUINFO_PTR_I8085_SOD_CALLBACK: cpustate->sod_callback = (i8085_sod_func)info->f; break; | |
| 1644 | case CPUINFO_PTR_I8085_SID_CALLBACK: cpustate->sid_callback = (i8085_sid_func)info->f; break; | |
| 1645 | case CPUINFO_PTR_I8085_INTE_CALLBACK: cpustate->inte_callback = (i8085_inte_func)info->f; break; | |
| 1646 | case CPUINFO_PTR_I8085_STATUS_CALLBACK: cpustate->status_callback = (i8085_status_func)info->f; break; | |
| 1678 | case CPUINFO_INT_INPUT_STATE + I8085_INTR_LINE: | |
| 1679 | case CPUINFO_INT_INPUT_STATE + I8085_RST55_LINE: | |
| 1680 | case CPUINFO_INT_INPUT_STATE + I8085_RST65_LINE: | |
| 1681 | case CPUINFO_INT_INPUT_STATE + I8085_RST75_LINE: | |
| 1682 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: | |
| 1683 | i808x_set_irq_line(cpustate, state - CPUINFO_INT_INPUT_STATE, info->i); | |
| 1684 | break; | |
| 1647 | 1685 | } |
| 1648 | 1686 | } |
| 1649 | 1687 | |
| 1650 | 1688 | |
| 1651 | 1689 | |
| 1652 | /************************************************************************** | |
| 1653 | * Generic get_info | |
| 1654 | **************************************************************************/ | |
| 1690 | /*************************************************************************** | |
| 1691 | 8085/COMMON GET INFO | |
| 1692 | ***************************************************************************/ | |
| 1655 | 1693 | |
| 1656 | 1694 | CPU_GET_INFO( i8085 ) |
| 1657 | 1695 | { |
| r3957 | r3958 | |
| 1670 | 1708 | case CPUINFO_INT_MIN_CYCLES: info->i = 4; break; |
| 1671 | 1709 | case CPUINFO_INT_MAX_CYCLES: info->i = 16; break; |
| 1672 | 1710 | |
| 1673 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1674 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1675 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1676 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1677 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1678 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1679 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1680 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1681 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1711 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1712 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1713 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1714 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1715 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 8; break; | |
| 1716 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1682 | 1717 | |
| 1683 | case CPUINFO_INT_INPUT_STATE + I8085_INTR_LINE: info->i = (cpustate->IREQ & IM_INTR) ? ASSERT_LINE : CLEAR_LINE; break; | |
| 1684 | case CPUINFO_INT_INPUT_STATE + I8085_RST55_LINE:info->i = (cpustate->IREQ & IM_RST55) ? ASSERT_LINE : CLEAR_LINE; break; | |
| 1685 | case CPUINFO_INT_INPUT_STATE + I8085_RST65_LINE:info->i = (cpustate->IREQ & IM_RST65) ? ASSERT_LINE : CLEAR_LINE; break; | |
| 1686 | case CPUINFO_INT_INPUT_STATE + I8085_RST75_LINE:info->i = (cpustate->IREQ & IM_RST75) ? ASSERT_LINE : CLEAR_LINE; break; | |
| 1687 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = (cpustate->IREQ & IM_TRAP) ? ASSERT_LINE : CLEAR_LINE; break; | |
| 1718 | /* --- the following bits of info are returned as pointers to functions --- */ | |
| 1719 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i808x); break; | |
| 1720 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8085); break; | |
| 1721 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(i808x); break; | |
| 1722 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i808x); break; | |
| 1723 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8085); break; | |
| 1724 | case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(i808x); break; | |
| 1725 | case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(i808x); break; | |
| 1688 | 1726 | |
| 1689 | case CPUINFO_INT_PREVIOUSPC: /* not supported */ break; | |
| 1727 | /* --- the following bits of info are returned as pointers --- */ | |
| 1728 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 1729 | case CPUINFO_PTR_STATE_TABLE: info->state_table = &cpustate->state; break; | |
| 1690 | 1730 | |
| 1691 | case CPUINFO_INT_PC: info->i = cpustate->PC.d; break; | |
| 1692 | case CPUINFO_INT_REGISTER + I8085_PC: info->i = cpustate->PC.w.l; break; | |
| 1693 | case CPUINFO_INT_SP: info->i = cpustate->SP.d; break; | |
| 1694 | case CPUINFO_INT_REGISTER + I8085_SP: info->i = cpustate->SP.w.l; break; | |
| 1695 | case CPUINFO_INT_REGISTER + I8085_AF: info->i = cpustate->AF.w.l; break; | |
| 1696 | case CPUINFO_INT_REGISTER + I8085_BC: info->i = cpustate->BC.w.l; break; | |
| 1697 | case CPUINFO_INT_REGISTER + I8085_DE: info->i = cpustate->DE.w.l; break; | |
| 1698 | case CPUINFO_INT_REGISTER + I8085_HL: info->i = cpustate->HL.w.l; break; | |
| 1699 | case CPUINFO_INT_REGISTER + I8085_IM: info->i = cpustate->IM; break; | |
| 1700 | case CPUINFO_INT_REGISTER + I8085_HALT: info->i = cpustate->HALT; break; | |
| 1701 | case CPUINFO_INT_REGISTER + I8085_IREQ: info->i = cpustate->IREQ; break; | |
| 1702 | case CPUINFO_INT_REGISTER + I8085_ISRV: info->i = cpustate->ISRV; break; | |
| 1703 | case CPUINFO_INT_REGISTER + I8085_VECTOR: info->i = cpustate->INTR; break; | |
| 1704 | case CPUINFO_INT_REGISTER + I8085_STATUS: info->i = cpustate->STATUS; break; | |
| 1705 | ||
| 1706 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 1707 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i8085); break; | |
| 1708 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8085); break; | |
| 1709 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(i8085); break; | |
| 1710 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(i8085); break; | |
| 1711 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(i8085); break; | |
| 1712 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1713 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8085); break; | |
| 1714 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 1715 | ||
| 1716 | 1731 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1717 | 1732 | case CPUINFO_STR_NAME: strcpy(info->s, "8085A"); break; |
| 1718 | 1733 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Intel 8080"); break; |
| r3957 | r3958 | |
| 1731 | 1746 | cpustate->AF.b.l & 0x02 ? 'N':'.', |
| 1732 | 1747 | cpustate->AF.b.l & 0x01 ? 'C':'.'); |
| 1733 | 1748 | break; |
| 1734 | ||
| 1735 | case CPUINFO_STR_REGISTER + I8085_AF: sprintf(info->s, "AF:%04X", cpustate->AF.w.l); break; | |
| 1736 | case CPUINFO_STR_REGISTER + I8085_BC: sprintf(info->s, "BC:%04X", cpustate->BC.w.l); break; | |
| 1737 | case CPUINFO_STR_REGISTER + I8085_DE: sprintf(info->s, "DE:%04X", cpustate->DE.w.l); break; | |
| 1738 | case CPUINFO_STR_REGISTER + I8085_HL: sprintf(info->s, "HL:%04X", cpustate->HL.w.l); break; | |
| 1739 | case CPUINFO_STR_REGISTER + I8085_SP: sprintf(info->s, "SP:%04X", cpustate->SP.w.l); break; | |
| 1740 | case CPUINFO_STR_REGISTER + I8085_PC: sprintf(info->s, "PC:%04X", cpustate->PC.w.l); break; | |
| 1741 | case CPUINFO_STR_REGISTER + I8085_IM: sprintf(info->s, "IM:%02X", cpustate->IM); break; | |
| 1742 | case CPUINFO_STR_REGISTER + I8085_HALT: sprintf(info->s, "HALT:%d", cpustate->HALT); break; | |
| 1743 | case CPUINFO_STR_REGISTER + I8085_IREQ: sprintf(info->s, "IREQ:%02X", cpustate->IREQ); break; | |
| 1744 | case CPUINFO_STR_REGISTER + I8085_ISRV: sprintf(info->s, "ISRV:%02X", cpustate->ISRV); break; | |
| 1745 | case CPUINFO_STR_REGISTER + I8085_VECTOR: sprintf(info->s, "VEC:%02X", cpustate->INTR); break; | |
| 1746 | case CPUINFO_STR_REGISTER + I8085_STATUS: sprintf(info->s, "SW:%02X", cpustate->STATUS); break; | |
| 1747 | 1749 | } |
| 1748 | 1750 | } |
| 1749 | 1751 | |
| 1750 | 1752 | |
| 1751 | #if (HAS_8080) | |
| 1752 | /************************************************************************** | |
| 1753 | * CPU-specific get_info/set_info | |
| 1754 | **************************************************************************/ | |
| 1753 | /*************************************************************************** | |
| 1754 | 8080-SPECIFIC GET INFO | |
| 1755 | ***************************************************************************/ | |
| 1755 | 1756 | |
| 1756 | static CPU_SET_INFO( i8080 ) | |
| 1757 | { | |
| 1758 | i8085_state *cpustate = device->token; | |
| 1759 | switch (state) | |
| 1760 | { | |
| 1761 | /* --- the following bits of info are set as 64-bit signed integers --- */ | |
| 1762 | case CPUINFO_INT_INPUT_STATE + I8080_INTR_LINE: i8080_set_irq_line(cpustate, I8080_INTR_LINE, info->i); break; | |
| 1763 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: i8080_set_irq_line(cpustate, INPUT_LINE_NMI, info->i); break; | |
| 1764 | ||
| 1765 | default: CPU_SET_INFO_CALL(i8085); break; | |
| 1766 | } | |
| 1767 | } | |
| 1768 | ||
| 1769 | 1757 | CPU_GET_INFO( i8080 ) |
| 1770 | 1758 | { |
| 1771 | i8085_state *cpustate = (device != NULL) ? device->token : NULL; | |
| 1772 | 1759 | switch (state) |
| 1773 | 1760 | { |
| 1774 | 1761 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1775 | 1762 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |
| 1776 | 1763 | case CPUINFO_INT_INPUT_LINES: info->i = 1; break; |
| 1777 | case CPUINFO_INT_INPUT_STATE + I8085_INTR_LINE: info->i = (cpustate->IREQ & IM_INTR) ? ASSERT_LINE : CLEAR_LINE; break; | |
| 1778 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = (cpustate->IREQ & IM_TRAP) ? ASSERT_LINE : CLEAR_LINE; break; | |
| 1779 | 1764 | |
| 1780 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 1781 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i8080); break; | |
| 1782 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8080); break; | |
| 1765 | /* --- the following bits of info are returned as pointers to functions --- */ | |
| 1766 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8080); break; | |
| 1783 | 1767 | |
| 1784 | 1768 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1785 | 1769 | case CPUINFO_STR_NAME: strcpy(info->s, "8080"); break; |
| r3957 | r3958 | |
| 1787 | 1771 | default: CPU_GET_INFO_CALL(i8085); break; |
| 1788 | 1772 | } |
| 1789 | 1773 | } |
| 1790 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 531 | 531 | ppcdrc_init - initialize the processor |
| 532 | 532 | -------------------------------------------------*/ |
| 533 | 533 | |
| 534 | static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, | |
| 534 | static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, | |
| 535 | 535 | { |
| 536 | 536 | drcfe_config feconfig = |
| 537 | 537 | { |
| r3957 | r3958 | |
| 556 | 556 | memset(ppc, 0, sizeof(*ppc)); |
| 557 | 557 | |
| 558 | 558 | /* initialize the core */ |
| 559 | ppccom_init(ppc, flavor, cap, tb_divisor, device, i | |
| 559 | ppccom_init(ppc, flavor, cap, tb_divisor, device, i | |
| 560 | 560 | |
| 561 | 561 | /* allocate the implementation-specific state from the full cache */ |
| 562 | 562 | ppc->impstate = drccache_memory_alloc_near(cache, sizeof(*ppc->impstate)); |
| r3957 | r3958 | |
| 795 | 795 | |
| 796 | 796 | static CPU_GET_INFO( ppcdrc ) |
| 797 | 797 | { |
| 798 | powerpc_state *ppc = (device != NULL) ? *(powerpc_state **)device->token : NULL; | |
| 798 | powerpc_state *ppc = (device != NULL && device->token != NULL) ? *(powerpc_state **)device->token : NULL; | |
| 799 | 799 | switch (state) |
| 800 | 800 | { |
| 801 | 801 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| r3957 | r3958 | |
| 803 | 803 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ break; |
| 804 | 804 | |
| 805 | 805 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 806 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppcdrc); break; | |
| 807 | case CPUINFO_PTR_INIT: /* provided per-CPU */ break; | |
| 808 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ppcdrc); break; | |
| 809 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(ppcdrc); break; | |
| 810 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppcdrc); break; | |
| 811 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ppcdrc);break; | |
| 812 | case CPUINFO_PTR_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(ppcdrc); break; | |
| 813 | case CPUINFO_PTR_CONTEXT: info->p = ppc; break; | |
| 806 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppcdrc); break; | |
| 807 | case CPUINFO_FCT_INIT: /* provided per-CPU */ break; | |
| 808 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ppcdrc); break; | |
| 809 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(ppcdrc); break; | |
| 810 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppcdrc); break; | |
| 811 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ppcdrc);break; | |
| 812 | case CPUINFO_FCT_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(ppcdrc); break; | |
| 814 | 813 | |
| 815 | 814 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 816 | 815 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; |
| r3957 | r3958 | |
| 4199 | 4198 | |
| 4200 | 4199 | static CPU_GET_INFO( ppcdrc4xx ) |
| 4201 | 4200 | { |
| 4202 | powerpc_state *ppc = (device != NULL) ? *(powerpc_state **)device->token : NULL; | |
| 4201 | powerpc_state *ppc = (device != NULL && device->token != NULL) ? *(powerpc_state **)device->token : NULL; | |
| 4203 | 4202 | CPU_GET_INFO_CALL(ppcdrc); |
| 4204 | 4203 | ppc4xx_get_info(ppc, state, info); |
| 4205 | 4204 | } |
| r3957 | r3958 | |
| 4229 | 4228 | |
| 4230 | 4229 | static CPU_INIT( ppc403ga ) |
| 4231 | 4230 | { |
| 4232 | ppcdrc_init(PPC_MODEL_403GA, PPCCAP_4XX, 1, device, i | |
| 4231 | ppcdrc_init(PPC_MODEL_403GA, PPCCAP_4XX, 1, device, i | |
| 4233 | 4232 | } |
| 4234 | 4233 | |
| 4235 | 4234 | |
| r3957 | r3958 | |
| 4245 | 4244 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4246 | 4245 | |
| 4247 | 4246 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4248 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ppc403ga); break; | |
| 4249 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppcdrc4xx); break; | |
| 4247 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ppc403ga); break; | |
| 4248 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppcdrc4xx); break; | |
| 4250 | 4249 | |
| 4251 | 4250 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4252 | 4251 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 403GA"); break; |
| r3957 | r3958 | |
| 4268 | 4267 | |
| 4269 | 4268 | static CPU_INIT( ppc403gcx ) |
| 4270 | 4269 | { |
| 4271 | ppcdrc_init(PPC_MODEL_403GCX, PPCCAP_4XX, 1, device, i | |
| 4270 | ppcdrc_init(PPC_MODEL_403GCX, PPCCAP_4XX, 1, device, i | |
| 4272 | 4271 | } |
| 4273 | 4272 | |
| 4274 | 4273 | |
| r3957 | r3958 | |
| 4284 | 4283 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4285 | 4284 | |
| 4286 | 4285 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4287 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ppc403gcx); break; | |
| 4288 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppcdrc4xx); break; | |
| 4286 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ppc403gcx); break; | |
| 4287 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppcdrc4xx); break; | |
| 4289 | 4288 | |
| 4290 | 4289 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4291 | 4290 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 403GCX"); break; |
| r3957 | r3958 | |
| 4312 | 4311 | |
| 4313 | 4312 | static CPU_INIT( ppc601 ) |
| 4314 | 4313 | { |
| 4315 | ppcdrc_init(PPC_MODEL_601, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED, 0/* no TB */, device, i | |
| 4314 | ppcdrc_init(PPC_MODEL_601, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED, 0/* no TB */, device, i | |
| 4316 | 4315 | } |
| 4317 | 4316 | |
| 4318 | 4317 | |
| r3957 | r3958 | |
| 4328 | 4327 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4329 | 4328 | |
| 4330 | 4329 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4331 | case CPUINFO_ | |
| 4330 | case CPUINFO_FCT | |
| 4332 | 4331 | |
| 4333 | 4332 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4334 | 4333 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 601"); break; |
| r3957 | r3958 | |
| 4350 | 4349 | |
| 4351 | 4350 | static CPU_INIT( ppc602 ) |
| 4352 | 4351 | { |
| 4353 | ppcdrc_init(PPC_MODEL_602, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4352 | ppcdrc_init(PPC_MODEL_602, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4354 | 4353 | } |
| 4355 | 4354 | |
| 4356 | 4355 | |
| r3957 | r3958 | |
| 4366 | 4365 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4367 | 4366 | |
| 4368 | 4367 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4369 | case CPUINFO_ | |
| 4368 | case CPUINFO_FCT | |
| 4370 | 4369 | |
| 4371 | 4370 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4372 | 4371 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 602"); break; |
| r3957 | r3958 | |
| 4388 | 4387 | |
| 4389 | 4388 | static CPU_INIT( ppc603 ) |
| 4390 | 4389 | { |
| 4391 | ppcdrc_init(PPC_MODEL_603, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4390 | ppcdrc_init(PPC_MODEL_603, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4392 | 4391 | } |
| 4393 | 4392 | |
| 4394 | 4393 | |
| r3957 | r3958 | |
| 4404 | 4403 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4405 | 4404 | |
| 4406 | 4405 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4407 | case CPUINFO_ | |
| 4406 | case CPUINFO_FCT | |
| 4408 | 4407 | |
| 4409 | 4408 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4410 | 4409 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 603"); break; |
| r3957 | r3958 | |
| 4426 | 4425 | |
| 4427 | 4426 | static CPU_INIT( ppc603e ) |
| 4428 | 4427 | { |
| 4429 | ppcdrc_init(PPC_MODEL_603E, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4428 | ppcdrc_init(PPC_MODEL_603E, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4430 | 4429 | } |
| 4431 | 4430 | |
| 4432 | 4431 | |
| r3957 | r3958 | |
| 4442 | 4441 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4443 | 4442 | |
| 4444 | 4443 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4445 | case CPUINFO_ | |
| 4444 | case CPUINFO_FCT | |
| 4446 | 4445 | |
| 4447 | 4446 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4448 | 4447 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 603e"); break; |
| r3957 | r3958 | |
| 4464 | 4463 | |
| 4465 | 4464 | static CPU_INIT( ppc603r ) |
| 4466 | 4465 | { |
| 4467 | ppcdrc_init(PPC_MODEL_603R, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4466 | ppcdrc_init(PPC_MODEL_603R, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, device, i | |
| 4468 | 4467 | } |
| 4469 | 4468 | |
| 4470 | 4469 | |
| r3957 | r3958 | |
| 4480 | 4479 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4481 | 4480 | |
| 4482 | 4481 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4483 | case CPUINFO_ | |
| 4482 | case CPUINFO_FCT | |
| 4484 | 4483 | |
| 4485 | 4484 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4486 | 4485 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 603R"); break; |
| r3957 | r3958 | |
| 4502 | 4501 | |
| 4503 | 4502 | static CPU_INIT( ppc604 ) |
| 4504 | 4503 | { |
| 4505 | ppcdrc_init(PPC_MODEL_604, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED, 4, device, i | |
| 4504 | ppcdrc_init(PPC_MODEL_604, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED, 4, device, i | |
| 4506 | 4505 | } |
| 4507 | 4506 | |
| 4508 | 4507 | |
| r3957 | r3958 | |
| 4518 | 4517 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4519 | 4518 | |
| 4520 | 4519 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4521 | case CPUINFO_ | |
| 4520 | case CPUINFO_FCT | |
| 4522 | 4521 | |
| 4523 | 4522 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4524 | 4523 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC 604"); break; |
| r3957 | r3958 | |
| 4545 | 4544 | |
| 4546 | 4545 | static CPU_INIT( mpc8240 ) |
| 4547 | 4546 | { |
| 4548 | ppcdrc_init(PPC_MODEL_MPC8240, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED, 4/* unknown */, device, i | |
| 4547 | ppcdrc_init(PPC_MODEL_MPC8240, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED, 4/* unknown */, device, i | |
| 4549 | 4548 | } |
| 4550 | 4549 | |
| 4551 | 4550 | |
| r3957 | r3958 | |
| 4561 | 4560 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 4562 | 4561 | |
| 4563 | 4562 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4564 | case CPUINFO_ | |
| 4563 | case CPUINFO_FCT | |
| 4565 | 4564 | |
| 4566 | 4565 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4567 | 4566 | case CPUINFO_STR_NAME: strcpy(info->s, "PowerPC MPC8240"); break; |
| r3957 | r3958 | |
|---|---|---|
| 184 | 184 | structure based on the configured type |
| 185 | 185 | -------------------------------------------------*/ |
| 186 | 186 | |
| 187 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, | |
| 187 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, | |
| 188 | 188 | { |
| 189 | 189 | const powerpc_config *config = device->static_config; |
| 190 | 190 | |
| r3957 | r3958 | |
| 194 | 194 | ppc->cap = cap; |
| 195 | 195 | ppc->cache_line_size = 32; |
| 196 | 196 | ppc->tb_divisor = tb_divisor; |
| 197 | ppc->cpu_clock = clock; | |
| 197 | ppc->cpu_clock = device->clock; | |
| 198 | 198 | ppc->irq_callback = irqcallback; |
| 199 | 199 | ppc->device = device; |
| 200 | 200 | ppc->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 201 | ppc->system_clock = (config != NULL) ? config->bus_frequency : clock; | |
| 202 | ppc->tb_divisor = (ppc->tb_divisor * clock + ppc->system_clock / 2 - 1) / ppc->system_clock; | |
| 201 | ppc->system_clock = (config != NULL) ? config->bus_frequency : device->clock; | |
| 202 | ppc->tb_divisor = (ppc->tb_divisor * device->clock + ppc->system_clock / 2 - 1) / ppc->system_clock; | |
| 203 | 203 | |
| 204 | 204 | /* allocate the virtual TLB */ |
| 205 | 205 | ppc->vtlb = vtlb_alloc(device, ADDRESS_SPACE_PROGRAM, (cap & PPCCAP_603_MMU) ? PPC603_FIXED_TLB_ENTRIES : 0, POWERPC_TLB_ENTRIES); |
| r3957 | r3958 | |
| 1089 | 1089 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1090 | 1090 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 1091 | 1091 | |
| 1092 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 1093 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1094 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1095 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1096 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = POWERPC_MIN_PAGE_SHIFT;break; | |
| 1092 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 1093 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1094 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1095 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 32; break; | |
| 1096 | case CPUINFO_INT_PAGE_SHIFT_PROGRAM: info->i = POWERPC_MIN_PAGE_SHIFT;break; | |
| 1097 | 1097 | |
| 1098 | 1098 | case CPUINFO_INT_INPUT_STATE + PPC_IRQ: info->i = ppc->irq_pending ? ASSERT_LINE : CLEAR_LINE; break; |
| 1099 | 1099 | |
| r3957 | r3958 | |
| 1156 | 1156 | case CPUINFO_INT_REGISTER + PPC_R31: info->i = ppc->r[31]; break; |
| 1157 | 1157 | |
| 1158 | 1158 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1159 | case CPUINFO_PTR_SET_INFO: /* provided by core */ break; | |
| 1160 | case CPUINFO_PTR_INIT: /* provided by core */ break; | |
| 1161 | case CPUINFO_PTR_RESET: /* provided by core */ break; | |
| 1162 | case CPUINFO_PTR_EXIT: /* provided by core */ break; | |
| 1163 | case CPUINFO_PTR_EXECUTE: /* provided by core */ break; | |
| 1164 | case CPUINFO_PTR_TRANSLATE: /* provided by core */ break; | |
| 1165 | case CPUINFO_PTR_DISASSEMBLE: /* provided by core */ break; | |
| 1159 | case CPUINFO_FCT_SET_INFO: /* provided by core */ break; | |
| 1160 | case CPUINFO_FCT_INIT: /* provided by core */ break; | |
| 1161 | case CPUINFO_FCT_RESET: /* provided by core */ break; | |
| 1162 | case CPUINFO_FCT_EXIT: /* provided by core */ break; | |
| 1163 | case CPUINFO_FCT_EXECUTE: /* provided by core */ break; | |
| 1164 | case CPUINFO_FCT_TRANSLATE: /* provided by core */ break; | |
| 1165 | case CPUINFO_FCT_DISASSEMBLE: /* provided by core */ break; | |
| 1166 | 1166 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &ppc->icount; break; |
| 1167 | 1167 | |
| 1168 | 1168 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1656 | 1656 | { |
| 1657 | 1657 | /* if we have a transmit handler, send it that way */ |
| 1658 | 1658 | if (ppc->spu.tx_handler != NULL) |
| 1659 | (*ppc->spu.tx_handler)(ppc->spu.txbuf); | |
| 1659 | (*ppc->spu.tx_handler)(ppc->device, ppc->spu.txbuf); | |
| 1660 | 1660 | |
| 1661 | 1661 | /* indicate that we have moved it to the shift register */ |
| 1662 | 1662 | ppc->spu.regs[SPU4XX_LINE_STATUS] |= 0x04; |
| r3957 | r3958 | |
| 1714 | 1714 | |
| 1715 | 1715 | static READ8_HANDLER( ppc4xx_spu_r ) |
| 1716 | 1716 | { |
| 1717 | powerpc_state *ppc = | |
| 1717 | powerpc_state *ppc = *(p | |
| 1718 | 1718 | UINT8 result = 0xff; |
| 1719 | 1719 | |
| 1720 | 1720 | switch (offset) |
| r3957 | r3958 | |
| 1741 | 1741 | |
| 1742 | 1742 | static WRITE8_HANDLER( ppc4xx_spu_w ) |
| 1743 | 1743 | { |
| 1744 | powerpc_state *ppc = | |
| 1744 | powerpc_state *ppc = *(p | |
| 1745 | 1745 | UINT8 oldstate, newstate; |
| 1746 | 1746 | |
| 1747 | 1747 | if (PRINTF_SPU) |
| r3957 | r3958 | |
| 1829 | 1829 | case CPUINFO_INT_PPC_RX_DATA: ppc4xx_spu_rx_data(ppc, info->i); break; |
| 1830 | 1830 | |
| 1831 | 1831 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1832 | case CPUINFO_ | |
| 1832 | case CPUINFO_FCT | |
| 1833 | 1833 | |
| 1834 | 1834 | /* --- everything else is handled generically --- */ |
| 1835 | 1835 | default: ppccom_set_info(ppc, state, info); break; |
| r3957 | r3958 | |
| 1854 | 1854 | case CPUINFO_INT_INPUT_STATE + PPC_IRQ_LINE_3: info->i = ppc4xx_get_irq_line(ppc, PPC4XX_IRQ_BIT_EXT3); break; |
| 1855 | 1855 | case CPUINFO_INT_INPUT_STATE + PPC_IRQ_LINE_4: info->i = ppc4xx_get_irq_line(ppc, PPC4XX_IRQ_BIT_EXT4); break; |
| 1856 | 1856 | |
| 1857 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1858 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 31; break; | |
| 1859 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1860 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = POWERPC_MIN_PAGE_SHIFT;break; | |
| 1857 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1858 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 31; break; | |
| 1859 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 32; break; | |
| 1860 | case CPUINFO_INT_PAGE_SHIFT_PROGRAM: info->i = POWERPC_MIN_PAGE_SHIFT;break; | |
| 1861 | 1861 | |
| 1862 | 1862 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1863 | case CPUINFO_PTR_INIT: /* provided per-CPU */ break; | |
| 1864 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(internal_ppc4xx); break; | |
| 1863 | case CPUINFO_FCT_INIT: /* provided per-CPU */ break; | |
| 1864 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(internal_ppc4xx); break; | |
| 1865 | 1865 | |
| 1866 | 1866 | /* --- everything else is handled generically --- */ |
| 1867 | 1867 | default: ppccom_get_info(ppc, state, info); break; |
| r3957 | r3958 | |
|---|---|---|
| 1816 | 1816 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1817 | 1817 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 1818 | 1818 | |
| 1819 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1820 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1821 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1822 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1823 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1824 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1825 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1826 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1827 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1819 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1820 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1821 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1822 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1823 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1824 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1825 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1826 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1827 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1828 | 1828 | |
| 1829 | 1829 | case CPUINFO_INT_INPUT_STATE: info->i = CLEAR_LINE; break; |
| 1830 | 1830 | |
| r3957 | r3958 | |
| 1876 | 1876 | |
| 1877 | 1877 | |
| 1878 | 1878 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1879 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1880 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ppc); break; | |
| 1879 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1880 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(ppc); break; | |
| 1881 | 1881 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &ppc_icount; break; |
| 1882 | 1882 | |
| 1883 | 1883 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1945 | 1945 | case CPUINFO_INT_REGISTER + PPC_EXISR: info->i = EXISR; break; |
| 1946 | 1946 | |
| 1947 | 1947 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1948 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc403); break; | |
| 1949 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ppc403); break; | |
| 1950 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ppc403); break; | |
| 1951 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(ppc403); break; | |
| 1952 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc403); break; | |
| 1948 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc403); break; | |
| 1949 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ppc403); break; | |
| 1950 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ppc403); break; | |
| 1951 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(ppc403); break; | |
| 1952 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc403); break; | |
| 1953 | 1953 | |
| 1954 | 1954 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1955 | 1955 | case CPUINFO_STR_NAME: strcpy(info->s, "PPC403"); break; |
| 1956 | 1956 | case CPUINFO_STR_REGISTER + PPC_EXIER: sprintf(info->s, "EXIER: %08X", EXIER); break; |
| 1957 | 1957 | case CPUINFO_STR_REGISTER + PPC_EXISR: sprintf(info->s, "EXISR: %08X", EXISR); break; |
| 1958 | 1958 | |
| 1959 | default: | |
| 1959 | default: CPU_GET_INFO_CALL(ppc | |
| 1960 | 1960 | } |
| 1961 | 1961 | } |
| 1962 | 1962 | #endif |
| r3957 | r3958 | |
| 1970 | 1970 | case CPUINFO_INT_INPUT_LINES: info->i = 5; break; |
| 1971 | 1971 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 1972 | 1972 | |
| 1973 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 1974 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1975 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1976 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 17; break; | |
| 1973 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 1974 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1975 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 32; break; | |
| 1976 | case CPUINFO_INT_PAGE_SHIFT_PROGRAM: info->i = 17; break; | |
| 1977 | 1977 | case CPUINFO_INT_REGISTER + PPC_DEC: info->i = read_decrementer(); break; |
| 1978 | 1978 | |
| 1979 | 1979 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1980 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc603); break; | |
| 1981 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ppc603); break; | |
| 1982 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 1983 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(ppc603); break; | |
| 1984 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 1985 | case CPUINFO_PTR_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 1986 | case CPUINFO_PTR_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 1987 | case CPUINFO_PTR_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 1988 | case CPUINFO_PTR_TRANSLATE: info->translate = ppc_translate_address_cb; break; | |
| 1980 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc603); break; | |
| 1981 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ppc603); break; | |
| 1982 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 1983 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(ppc603); break; | |
| 1984 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 1985 | case CPUINFO_FCT_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 1986 | case CPUINFO_FCT_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 1987 | case CPUINFO_FCT_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 1988 | case CPUINFO_FCT_TRANSLATE: info->translate = ppc_translate_address_cb; break; | |
| 1989 | 1989 | |
| 1990 | 1990 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1991 | 1991 | case CPUINFO_STR_NAME: strcpy(info->s, "PPC603"); break; |
| 1992 | 1992 | case CPUINFO_STR_REGISTER + PPC_DEC: sprintf(info->s, "DEC: %08X", read_decrementer()); break; |
| 1993 | 1993 | |
| 1994 | default: | |
| 1994 | default: CPU_GET_INFO_CALL(ppc | |
| 1995 | 1995 | } |
| 1996 | 1996 | } |
| 1997 | 1997 | #endif |
| r3957 | r3958 | |
| 2022 | 2022 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2023 | 2023 | case CPUINFO_INT_REGISTER + PPC_IBR: info->i = ppc.ibr; break; |
| 2024 | 2024 | |
| 2025 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 2026 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2025 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 2026 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2027 | 2027 | |
| 2028 | 2028 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2029 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc602); break; | |
| 2030 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ppc602); break; | |
| 2031 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ppc602); break; | |
| 2032 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(ppc602); break; | |
| 2033 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc602); break; | |
| 2034 | case CPUINFO_PTR_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2035 | case CPUINFO_PTR_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2036 | case CPUINFO_PTR_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2037 | case CPUINFO_PTR_TRANSLATE: info->translate = ppc_translate_address_cb; break; | |
| 2029 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc602); break; | |
| 2030 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ppc602); break; | |
| 2031 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ppc602); break; | |
| 2032 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(ppc602); break; | |
| 2033 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc602); break; | |
| 2034 | case CPUINFO_FCT_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2035 | case CPUINFO_FCT_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2036 | case CPUINFO_FCT_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2037 | case CPUINFO_FCT_TRANSLATE: info->translate = ppc_translate_address_cb; break; | |
| 2038 | 2038 | |
| 2039 | 2039 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2040 | 2040 | case CPUINFO_STR_NAME: strcpy(info->s, "PPC602"); break; |
| 2041 | 2041 | case CPUINFO_STR_REGISTER + PPC_IBR: sprintf(info->s, "IBR: %08X", ppc.ibr); break; |
| 2042 | 2042 | |
| 2043 | default: | |
| 2043 | default: CPU_GET_INFO_CALL(ppc | |
| 2044 | 2044 | } |
| 2045 | 2045 | } |
| 2046 | 2046 | #endif |
| r3957 | r3958 | |
| 2069 | 2069 | case CPUINFO_INT_INPUT_LINES: info->i = 5; break; |
| 2070 | 2070 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2071 | 2071 | |
| 2072 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 2073 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2072 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 2073 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2074 | 2074 | |
| 2075 | 2075 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2076 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mpc8240); break; | |
| 2077 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(mpc8240); break; | |
| 2078 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 2079 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(mpc8240); break; | |
| 2080 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 2081 | case CPUINFO_PTR_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2082 | case CPUINFO_PTR_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2083 | case CPUINFO_PTR_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2076 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mpc8240); break; | |
| 2077 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(mpc8240); break; | |
| 2078 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 2079 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(mpc8240); break; | |
| 2080 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 2081 | case CPUINFO_FCT_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2082 | case CPUINFO_FCT_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2083 | case CPUINFO_FCT_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2084 | 2084 | |
| 2085 | 2085 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2086 | 2086 | case CPUINFO_STR_NAME: strcpy(info->s, "MPC8240"); break; |
| 2087 | 2087 | |
| 2088 | default: | |
| 2088 | default: CPU_GET_INFO_CALL(ppc | |
| 2089 | 2089 | } |
| 2090 | 2090 | } |
| 2091 | 2091 | #endif |
| r3957 | r3958 | |
| 2114 | 2114 | case CPUINFO_INT_INPUT_LINES: info->i = 5; break; |
| 2115 | 2115 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2116 | 2116 | |
| 2117 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 2118 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2117 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 2118 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2119 | 2119 | |
| 2120 | 2120 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2121 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc601); break; | |
| 2122 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ppc601); break; | |
| 2123 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 2124 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(ppc601); break; | |
| 2125 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 2126 | case CPUINFO_PTR_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2127 | case CPUINFO_PTR_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2128 | case CPUINFO_PTR_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2121 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc601); break; | |
| 2122 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ppc601); break; | |
| 2123 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 2124 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(ppc601); break; | |
| 2125 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 2126 | case CPUINFO_FCT_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2127 | case CPUINFO_FCT_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2128 | case CPUINFO_FCT_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2129 | 2129 | |
| 2130 | 2130 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2131 | 2131 | case CPUINFO_STR_NAME: strcpy(info->s, "PPC601"); break; |
| 2132 | 2132 | |
| 2133 | default: | |
| 2133 | default: CPU_GET_INFO_CALL(ppc | |
| 2134 | 2134 | } |
| 2135 | 2135 | } |
| 2136 | 2136 | #endif |
| r3957 | r3958 | |
| 2159 | 2159 | case CPUINFO_INT_INPUT_LINES: info->i = 5; break; |
| 2160 | 2160 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2161 | 2161 | |
| 2162 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 2163 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2162 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 2163 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2164 | 2164 | |
| 2165 | 2165 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2166 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc604); break; | |
| 2167 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(ppc604); break; | |
| 2168 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 2169 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(ppc604); break; | |
| 2170 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 2171 | case CPUINFO_PTR_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2172 | case CPUINFO_PTR_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2173 | case CPUINFO_PTR_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2166 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(ppc604); break; | |
| 2167 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(ppc604); break; | |
| 2168 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(ppc603); break; | |
| 2169 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(ppc604); break; | |
| 2170 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(ppc603); break; | |
| 2171 | case CPUINFO_FCT_READ: info->read = CPU_GET_READ_NAME(ppc); break; | |
| 2172 | case CPUINFO_FCT_WRITE: info->write = CPU_GET_WRITE_NAME(ppc); break; | |
| 2173 | case CPUINFO_FCT_READOP: info->readop = CPU_GET_READOP_NAME(ppc); break; | |
| 2174 | 2174 | |
| 2175 | 2175 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2176 | 2176 | case CPUINFO_STR_NAME: strcpy(info->s, "PPC604"); break; |
| 2177 | 2177 | |
| 2178 | default: | |
| 2178 | default: CPU_GET_INFO_CALL(ppc | |
| 2179 | 2179 | } |
| 2180 | 2180 | } |
| 2181 | 2181 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 572 | 572 | FUNCTION PROTOTYPES |
| 573 | 573 | ***************************************************************************/ |
| 574 | 574 | |
| 575 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, | |
| 575 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, | |
| 576 | 576 | void ppccom_exit(powerpc_state *ppc); |
| 577 | 577 | |
| 578 | 578 | void ppccom_reset(powerpc_state *ppc); |
| r3957 | r3958 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | CPUINFO_PTR_PPC_FASTRAM_BASE = CPUINFO_PTR_CPU_SPECIFIC, |
| 116 | 116 | |
| 117 | CPUINFO_PTR_SPU_TX_HANDLER, | |
| 118 | ||
| 119 | CPUINFO_PTR_CONTEXT /* temporary */ | |
| 117 | CPUINFO_FCT_SPU_TX_HANDLER = CPUINFO_FCT_CPU_SPECIFIC | |
| 120 | 118 | }; |
| 121 | 119 | |
| 122 | 120 | |
| r3957 | r3958 | |
| 136 | 134 | STRUCTURES AND TYPEDEFS |
| 137 | 135 | ***************************************************************************/ |
| 138 | 136 | |
| 139 | typedef void (*ppc4xx_spu_tx_handler)(UINT8 data); | |
| 137 | typedef void (*ppc4xx_spu_tx_handler)(const device_config *device, UINT8 data); | |
| 140 | 138 | |
| 141 | 139 | typedef struct _powerpc_config powerpc_config; |
| 142 | 140 | struct _powerpc_config |
| r3957 | r3958 | |
| 152 | 150 | |
| 153 | 151 | #if (HAS_PPC403GA) |
| 154 | 152 | CPU_GET_INFO( ppc403ga ); |
| 153 | #define CPU_PPC403GA CPU_GET_INFO_NAME( ppc403ga ) | |
| 155 | 154 | #endif |
| 156 | 155 | |
| 157 | 156 | #if (HAS_PPC403GCX) |
| 158 | 157 | CPU_GET_INFO( ppc403gcx ); |
| 158 | #define CPU_PPC403GCX CPU_GET_INFO_NAME( ppc403gcx ) | |
| 159 | 159 | #endif |
| 160 | 160 | |
| 161 | 161 | #if (HAS_PPC601) |
| 162 | 162 | CPU_GET_INFO( ppc601 ); |
| 163 | #define CPU_PPC601 CPU_GET_INFO_NAME( ppc601 ) | |
| 163 | 164 | #endif |
| 164 | 165 | |
| 165 | 166 | #if (HAS_PPC602) |
| 166 | 167 | CPU_GET_INFO( ppc602 ); |
| 168 | #define CPU_PPC602 CPU_GET_INFO_NAME( ppc602 ) | |
| 167 | 169 | #endif |
| 168 | 170 | |
| 169 | 171 | #if (HAS_PPC603) |
| 170 | 172 | CPU_GET_INFO( ppc603 ); |
| 173 | #define CPU_PPC603 CPU_GET_INFO_NAME( ppc603 ) | |
| 171 | 174 | #endif |
| 172 | 175 | |
| 173 | 176 | #if (HAS_PPC603E) |
| 174 | 177 | CPU_GET_INFO( ppc603e ); |
| 178 | #define CPU_PPC603E CPU_GET_INFO_NAME( ppc603e ) | |
| 175 | 179 | #endif |
| 176 | 180 | |
| 177 | 181 | #if (HAS_PPC603R) |
| 178 | 182 | CPU_GET_INFO( ppc603r ); |
| 183 | #define CPU_PPC603R CPU_GET_INFO_NAME( ppc603r ) | |
| 179 | 184 | #endif |
| 180 | 185 | |
| 181 | 186 | #if (HAS_PPC604) |
| 182 | 187 | CPU_GET_INFO( ppc604 ); |
| 188 | #define CPU_PPC604 CPU_GET_INFO_NAME( ppc604 ) | |
| 183 | 189 | #endif |
| 184 | 190 | |
| 185 | 191 | #if (HAS_MPC8240) |
| 186 | 192 | CPU_GET_INFO( mpc8240 ); |
| 193 | #define CPU_MPC8240 CPU_GET_INFO_NAME( mpc8240 ) | |
| 187 | 194 | #endif |
| 188 | 195 | |
| 189 | 196 | |
| r3957 | r3958 | |
| 194 | 201 | |
| 195 | 202 | INLINE void ppc4xx_spu_set_tx_handler(const device_config *cpu, ppc4xx_spu_tx_handler handler) |
| 196 | 203 | { |
| 197 | c | |
| 204 | device | |
| 198 | 205 | } |
| 199 | 206 | |
| 200 | 207 | |
| 201 | 208 | INLINE void ppc4xx_spu_receive_byte(const device_config *cpu, UINT8 byteval) |
| 202 | 209 | { |
| 203 | c | |
| 210 | device | |
| 204 | 211 | } |
| 205 | 212 | |
| 206 | 213 |
| r3957 | r3958 | |
|---|---|---|
| 1459 | 1459 | case CPUINFO_INT_MIN_CYCLES: info->i = 3; break; |
| 1460 | 1460 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 1461 | 1461 | |
| 1462 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1463 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 26; break; | |
| 1464 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1465 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1466 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1467 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1468 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1469 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1470 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1462 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1463 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 26; break; | |
| 1464 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1465 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1466 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1467 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1468 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1469 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1470 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1471 | 1471 | |
| 1472 | 1472 | case CPUINFO_INT_INPUT_STATE + ARM_IRQ_LINE: info->i = cpustate->pendingIrq; break; |
| 1473 | 1473 | case CPUINFO_INT_INPUT_STATE + ARM_FIRQ_LINE: info->i = cpustate->pendingFiq; break; |
| r3957 | r3958 | |
| 1507 | 1507 | case CPUINFO_INT_REGISTER + ARM32_SR14: info->i = cpustate->sArmRegister[eR14_SVC]; break; |
| 1508 | 1508 | |
| 1509 | 1509 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1510 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(arm); break; | |
| 1511 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(arm); break; | |
| 1512 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(arm); break; | |
| 1513 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(arm); break; | |
| 1514 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(arm); break; | |
| 1515 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1516 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(arm); break; | |
| 1510 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(arm); break; | |
| 1511 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(arm); break; | |
| 1512 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(arm); break; | |
| 1513 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(arm); break; | |
| 1514 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(arm); break; | |
| 1515 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1516 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(arm); break; | |
| 1517 | 1517 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1518 | 1518 | |
| 1519 | 1519 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | ***************************************************************************************************/ |
| 18 | 18 | |
| 19 | 19 | extern CPU_GET_INFO( arm ); |
| 20 | #define CPU_ARM CPU_GET_INFO_NAME( arm ) | |
| 20 | 21 | |
| 21 | 22 | extern UINT32 arm_disasm(char *pBuf, UINT32 pc, UINT32 opcode); |
| 22 | 23 |
| r3957 | r3958 | |
|---|---|---|
| 422 | 422 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; /* right? */ break; |
| 423 | 423 | case CPUINFO_INT_MAX_CYCLES: info->i = 16; /* right? */ break; |
| 424 | 424 | |
| 425 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 426 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 427 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 428 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 429 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 430 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 431 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 432 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 433 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 425 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 426 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 427 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 428 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 429 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 430 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 431 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 432 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 433 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 434 | 434 | |
| 435 | 435 | case CPUINFO_INT_SP: info->i = cpustate->w.SP; break; |
| 436 | 436 | case CPUINFO_INT_PC: info->i = cpustate->w.PC; break; |
| r3957 | r3958 | |
| 453 | 453 | case CPUINFO_INT_REGISTER + LR35902_SPEED: info->i = 0x7E | ( ( cpustate->w.gb_speed - 1 ) << 7 ) | cpustate->w.gb_speed_change_pending; break; |
| 454 | 454 | |
| 455 | 455 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 456 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(lr35902); break; | |
| 457 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(lr35902); break; | |
| 458 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(lr35902); break; | |
| 459 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(lr35902); break; | |
| 460 | case CPUINFO_PTR_BURN: info->burn = CPU_BURN_NAME(lr35902); break; | |
| 461 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(lr35902); break; | |
| 456 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(lr35902); break; | |
| 457 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(lr35902); break; | |
| 458 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(lr35902); break; | |
| 459 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(lr35902); break; | |
| 460 | case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(lr35902); break; | |
| 461 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(lr35902); break; | |
| 462 | 462 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->w.icount; break; |
| 463 | 463 | |
| 464 | 464 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | /* Return register contents */ |
| 32 | 32 | /****************************************************************************/ |
| 33 | 33 | extern CPU_GET_INFO( lr35902 ); |
| 34 | #define CPU_LR35902 CPU_GET_INFO_NAME( lr35902 ) | |
| 34 | 35 | |
| 35 | 36 | extern CPU_DISASSEMBLE( lr35902 ); |
| 36 | 37 |
| r3957 | r3958 | |
|---|---|---|
| 523 | 523 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 524 | 524 | case CPUINFO_INT_MAX_CYCLES: info->i = 744; break; |
| 525 | 525 | |
| 526 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 527 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 528 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 529 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 530 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 531 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 532 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 533 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 534 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 526 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 527 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 528 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 529 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 530 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 531 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 532 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 533 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 534 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 535 | 535 | |
| 536 | 536 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_state; break; |
| 537 | 537 | case CPUINFO_INT_INPUT_STATE + 0: info->i = cpustate->irq_state[0]; break; |
| r3957 | r3958 | |
| 567 | 567 | case CPUINFO_INT_REGISTER + Z8000_R15: info->i = cpustate->RW(15); break; |
| 568 | 568 | |
| 569 | 569 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 570 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(z8000); break; | |
| 571 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(z8000); break; | |
| 572 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(z8000); break; | |
| 573 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(z8000); break; | |
| 574 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(z8000); break; | |
| 575 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 576 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(z8000);break; | |
| 570 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(z8000); break; | |
| 571 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(z8000); break; | |
| 572 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(z8000); break; | |
| 573 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(z8000); break; | |
| 574 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(z8000); break; | |
| 575 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 576 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(z8000);break; | |
| 577 | 577 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 578 | 578 | |
| 579 | 579 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | /* PUBLIC FUNCTIONS */ |
| 28 | 28 | extern CPU_GET_INFO( z8000 ); |
| 29 | #define CPU_Z8000 CPU_GET_INFO_NAME( z8000 ) | |
| 29 | 30 | |
| 30 | 31 | CPU_DISASSEMBLE( z8000 ); |
| 31 | 32 |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | vtlb->fixed = fixed_entries; |
| 71 | 71 | vtlb->pageshift = cpu_get_page_shift(cpu, space); |
| 72 | 72 | vtlb->addrwidth = cpu_get_logaddr_width(cpu, space); |
| 73 | vtlb->translate = (cpu_translate_func)c | |
| 73 | vtlb->translate = (cpu_translate_func)device | |
| 74 | 74 | |
| 75 | 75 | /* validate CPU information */ |
| 76 | 76 | assert((1 << vtlb->pageshift) > VTLB_FLAGS_MASK); |
| r3957 | r3958 | |
|---|---|---|
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | 54 | CPU_GET_INFO( tms32010 ); |
| 55 | #define CPU_TMS32010 CPU_GET_INFO_NAME( tms32010 ) | |
| 55 | 56 | |
| 56 | 57 | |
| 57 | ||
| 58 | /**************************************************************************** | |
| 59 | * Read the state of the BIO pin | |
| 60 | */ | |
| 61 | ||
| 62 | #define TMS32010_BIO_In (memory_read_word_16be(cpustate->io, TMS32010_BIO<<1)) | |
| 63 | ||
| 64 | ||
| 65 | /**************************************************************************** | |
| 66 | * Input a word from given I/O port | |
| 67 | */ | |
| 68 | ||
| 69 | #define TMS32010_In(Port) (memory_read_word_16be(cpustate->io, (Port)<<1)) | |
| 70 | ||
| 71 | ||
| 72 | /**************************************************************************** | |
| 73 | * Output a word to given I/O port | |
| 74 | */ | |
| 75 | ||
| 76 | #define TMS32010_Out(Port,Value) (memory_write_word_16be(cpustate->io, (Port)<<1,Value)) | |
| 77 | ||
| 78 | ||
| 79 | ||
| 80 | /**************************************************************************** | |
| 81 | * Read a word from given ROM memory location | |
| 82 | */ | |
| 83 | ||
| 84 | #define TMS32010_ROM_RDMEM(A) (memory_read_word_16be(cpustate->program, (A)<<1)) | |
| 85 | ||
| 86 | ||
| 87 | /**************************************************************************** | |
| 88 | * Write a word to given ROM memory location | |
| 89 | */ | |
| 90 | ||
| 91 | #define TMS32010_ROM_WRMEM(A,V) (memory_write_word_16be(cpustate->program, (A)<<1,V)) | |
| 92 | ||
| 93 | ||
| 94 | ||
| 95 | /**************************************************************************** | |
| 96 | * Read a word from given RAM memory location | |
| 97 | */ | |
| 98 | ||
| 99 | #define TMS32010_RAM_RDMEM(A) (memory_read_word_16be(cpustate->data, (A)<<1)) | |
| 100 | ||
| 101 | ||
| 102 | /**************************************************************************** | |
| 103 | * Write a word to given RAM memory location | |
| 104 | */ | |
| 105 | ||
| 106 | #define TMS32010_RAM_WRMEM(A,V) (memory_write_word_16be(cpustate->data, (A)<<1,V)) | |
| 107 | ||
| 108 | ||
| 109 | ||
| 110 | /**************************************************************************** | |
| 111 | * TMS32010_RDOP() is identical to TMS32010_RDMEM() except it is used for reading | |
| 112 | * opcodes. In case of system with memory mapped I/O, this function can be | |
| 113 | * used to greatly speed up emulation | |
| 114 | */ | |
| 115 | ||
| 116 | #define TMS32010_RDOP(A) (memory_decrypted_read_word(cpustate->program, (A)<<1)) | |
| 117 | ||
| 118 | ||
| 119 | /**************************************************************************** | |
| 120 | * TMS32010_RDOP_ARG() is identical to TMS32010_RDOP() except it is used | |
| 121 | * for reading opcode arguments. This difference can be used to support systems | |
| 122 | * that use different encoding mechanisms for opcodes and opcode arguments | |
| 123 | */ | |
| 124 | ||
| 125 | #define TMS32010_RDOP_ARG(A) (memory_raw_read_word(cpustate->program, (A)<<1)) | |
| 126 | ||
| 127 | ||
| 128 | ||
| 129 | 58 | CPU_DISASSEMBLE( tms32010 ); |
| 130 | 59 | |
| 131 | 60 | #endif /* __TMS32010_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | |
| 141 | /**************************************************************************** | |
| 142 | * Read the state of the BIO pin | |
| 143 | */ | |
| 141 | 144 | |
| 145 | #define TMS32010_BIO_In (memory_read_word_16be(cpustate->io, TMS32010_BIO<<1)) | |
| 146 | ||
| 147 | ||
| 148 | /**************************************************************************** | |
| 149 | * Input a word from given I/O port | |
| 150 | */ | |
| 151 | ||
| 152 | #define TMS32010_In(Port) (memory_read_word_16be(cpustate->io, (Port)<<1)) | |
| 153 | ||
| 154 | ||
| 155 | /**************************************************************************** | |
| 156 | * Output a word to given I/O port | |
| 157 | */ | |
| 158 | ||
| 159 | #define TMS32010_Out(Port,Value) (memory_write_word_16be(cpustate->io, (Port)<<1,Value)) | |
| 160 | ||
| 161 | ||
| 162 | ||
| 163 | /**************************************************************************** | |
| 164 | * Read a word from given ROM memory location | |
| 165 | */ | |
| 166 | ||
| 167 | #define TMS32010_ROM_RDMEM(A) (memory_read_word_16be(cpustate->program, (A)<<1)) | |
| 168 | ||
| 169 | ||
| 170 | /**************************************************************************** | |
| 171 | * Write a word to given ROM memory location | |
| 172 | */ | |
| 173 | ||
| 174 | #define TMS32010_ROM_WRMEM(A,V) (memory_write_word_16be(cpustate->program, (A)<<1,V)) | |
| 175 | ||
| 176 | ||
| 177 | ||
| 178 | /**************************************************************************** | |
| 179 | * Read a word from given RAM memory location | |
| 180 | */ | |
| 181 | ||
| 182 | #define TMS32010_RAM_RDMEM(A) (memory_read_word_16be(cpustate->data, (A)<<1)) | |
| 183 | ||
| 184 | ||
| 185 | /**************************************************************************** | |
| 186 | * Write a word to given RAM memory location | |
| 187 | */ | |
| 188 | ||
| 189 | #define TMS32010_RAM_WRMEM(A,V) (memory_write_word_16be(cpustate->data, (A)<<1,V)) | |
| 190 | ||
| 191 | ||
| 192 | ||
| 193 | /**************************************************************************** | |
| 194 | * TMS32010_RDOP() is identical to TMS32010_RDMEM() except it is used for reading | |
| 195 | * opcodes. In case of system with memory mapped I/O, this function can be | |
| 196 | * used to greatly speed up emulation | |
| 197 | */ | |
| 198 | ||
| 199 | #define TMS32010_RDOP(A) (memory_decrypted_read_word(cpustate->program, (A)<<1)) | |
| 200 | ||
| 201 | ||
| 202 | /**************************************************************************** | |
| 203 | * TMS32010_RDOP_ARG() is identical to TMS32010_RDOP() except it is used | |
| 204 | * for reading opcode arguments. This difference can be used to support systems | |
| 205 | * that use different encoding mechanisms for opcodes and opcode arguments | |
| 206 | */ | |
| 207 | ||
| 208 | #define TMS32010_RDOP_ARG(A) (memory_raw_read_word(cpustate->program, (A)<<1)) | |
| 209 | ||
| 210 | ||
| 142 | 211 | /************************************************************************ |
| 143 | 212 | * Shortcuts |
| 144 | 213 | ************************************************************************/ |
| r3957 | r3958 | |
| 886 | 955 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 887 | 956 | case CPUINFO_INT_MAX_CYCLES: info->i = 3; break; |
| 888 | 957 | |
| 889 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 890 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 12; break; | |
| 891 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; | |
| 892 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 893 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 894 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -1; break; | |
| 895 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 896 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 5; break; | |
| 897 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = -1; break; | |
| 958 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 959 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 12; break; | |
| 960 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 961 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 16; break; | |
| 962 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 8; break; | |
| 963 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -1; break; | |
| 964 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 965 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 5; break; | |
| 966 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = -1; break; | |
| 898 | 967 | |
| 899 | 968 | case CPUINFO_INT_INPUT_STATE + 0: info->i = (cpustate->INTF & TMS32010_INT_PENDING) ? ASSERT_LINE : CLEAR_LINE; break; |
| 900 | 969 | |
| r3957 | r3958 | |
| 913 | 982 | case CPUINFO_INT_REGISTER + TMS32010_AR1: info->i = cpustate->AR[1]; break; |
| 914 | 983 | |
| 915 | 984 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 916 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms32010); break; | |
| 917 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tms32010); break; | |
| 918 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms32010); break; | |
| 919 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(tms32010); break; | |
| 920 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms32010); break; | |
| 921 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 922 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32010); break; | |
| 985 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms32010); break; | |
| 986 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tms32010); break; | |
| 987 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms32010); break; | |
| 988 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(tms32010); break; | |
| 989 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms32010); break; | |
| 990 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 991 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32010); break; | |
| 923 | 992 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 924 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 993 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 925 | 994 | |
| 926 | 995 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 927 | 996 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS32010"); break; |
| r3957 | r3958 | |
|---|---|---|
| 174 | 174 | TIMER_CALLBACK( sh2_timer_callback ); |
| 175 | 175 | TIMER_CALLBACK( sh2_dmac_callback ); |
| 176 | 176 | |
| 177 | void sh2_common_init(SH2 *sh2, const device_config *device, | |
| 177 | void sh2_common_init(SH2 *sh2, const device_config *device, | |
| 178 | 178 | void sh2_recalc_irq(SH2 *sh2); |
| 179 | 179 | void sh2_set_irq_line(SH2 *sh2, int irqline, int state); |
| 180 | 180 | void sh2_set_frt_input(const device_config *device, int state); |
| r3957 | r3958 | |
|---|---|---|
| 92 | 92 | int (*dma_callback_kludge)(UINT32 src, UINT32 dst, UINT32 data, int size); |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | extern CPU_GET_INFO( sh1 ); | |
| 95 | 96 | extern CPU_GET_INFO( sh2 ); |
| 96 | 97 | |
| 98 | #define CPU_SH1 CPU_GET_INFO_NAME( sh1 ) | |
| 99 | #define CPU_SH2 CPU_GET_INFO_NAME( sh2 ) | |
| 100 | ||
| 97 | 101 | WRITE32_HANDLER( sh2_internal_w ); |
| 98 | 102 | READ32_HANDLER( sh2_internal_r ); |
| 99 | 103 |
| r3957 | r3958 | |
|---|---|---|
| 685 | 685 | memset(sh2, 0, sizeof(SH2)); |
| 686 | 686 | |
| 687 | 687 | /* initialize the common core parts */ |
| 688 | sh2_common_init(sh2, device, i | |
| 688 | sh2_common_init(sh2, device, i | |
| 689 | 689 | |
| 690 | 690 | /* allocate the implementation-specific state from the full cache */ |
| 691 | 691 | sh2->cache = cache; |
| r3957 | r3958 | |
| 3401 | 3401 | |
| 3402 | 3402 | CPU_GET_INFO( sh2 ) |
| 3403 | 3403 | { |
| 3404 | SH2 *sh2 = (device != NULL) ? *(SH2 **)device->token : NULL; | |
| 3404 | SH2 *sh2 = (device != NULL && device->token != NULL) ? *(SH2 **)device->token : NULL; | |
| 3405 | 3405 | switch (state) |
| 3406 | 3406 | { |
| 3407 | 3407 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| r3957 | r3958 | |
| 3416 | 3416 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 3417 | 3417 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 3418 | 3418 | |
| 3419 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 3420 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 3421 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 3422 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3423 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3424 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3425 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3426 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3427 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3419 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 3420 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 3421 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 3422 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 3423 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 3424 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 3425 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 3426 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 3427 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 3428 | 3428 | |
| 3429 | 3429 | // Internal maps |
| 3430 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(sh2_internal_map); break; | |
| 3431 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map32 = NULL; break; | |
| 3432 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map32 = NULL; break; | |
| 3430 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(sh2_internal_map); break; | |
| 3431 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map32 = NULL; break; | |
| 3432 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map32 = NULL; break; | |
| 3433 | 3433 | |
| 3434 | 3434 | case CPUINFO_INT_INPUT_STATE + SH2_INT_VBLIN: info->i = sh2->irq_line_state[SH2_INT_VBLIN]; break; |
| 3435 | 3435 | case CPUINFO_INT_INPUT_STATE + SH2_INT_VBLOUT: info->i = sh2->irq_line_state[SH2_INT_VBLOUT]; break; |
| r3957 | r3958 | |
| 3480 | 3480 | case CPUINFO_INT_REGISTER + SH2_EA: info->i = sh2->ea; break; |
| 3481 | 3481 | |
| 3482 | 3482 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3483 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sh2); break; | |
| 3484 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(sh2); break; | |
| 3485 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(sh2); break; | |
| 3486 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(sh2); break; | |
| 3487 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(sh2); break; | |
| 3488 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 3489 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sh2); break; | |
| 3483 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sh2); break; | |
| 3484 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(sh2); break; | |
| 3485 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(sh2); break; | |
| 3486 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(sh2); break; | |
| 3487 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sh2); break; | |
| 3488 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 3489 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sh2); break; | |
| 3490 | 3490 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &sh2->icount; break; |
| 3491 | 3491 | |
| 3492 | 3492 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 3545 | 3545 | switch (state) |
| 3546 | 3546 | { |
| 3547 | 3547 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3548 | case CPUINFO_ | |
| 3548 | case CPUINFO_FCT | |
| 3549 | 3549 | |
| 3550 | 3550 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3551 | 3551 | case CPUINFO_STR_NAME: strcpy(info->s, "SH-1"); break; |
| r3957 | r3958 | |
|---|---|---|
| 104 | 104 | sh2->frc_base = cpu_get_total_cycles(sh2->device); |
| 105 | 105 | timer_adjust_oneshot(sh2->timer, cpu_clocks_to_attotime(sh2->device, max_delta), 0); |
| 106 | 106 | } else { |
| 107 | logerror("SH2.% | |
| 107 | logerror("SH2.%s: Timer event in %d cycles of external clock", | |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | } |
| r3957 | r3958 | |
| 141 | 141 | int dma = param & 1; |
| 142 | 142 | SH2 *sh2 = ptr; |
| 143 | 143 | |
| 144 | LOG(("SH2.% | |
| 144 | LOG(("SH2.%s: DMA %d complete\n", | |
| 145 | 145 | sh2->m[0x63+4*dma] |= 2; |
| 146 | 146 | sh2->dma_timer_active[dma] = 0; |
| 147 | 147 | sh2_recalc_irq(sh2); |
| r3957 | r3958 | |
| 309 | 309 | case 0x04: // TIER, FTCSR, FRC |
| 310 | 310 | if((mem_mask & 0x00ffffff) != 0) |
| 311 | 311 | sh2_timer_resync(sh2); |
| 312 | // printf("SH2.% | |
| 312 | // printf("SH2.%s: TIER write %04x @ %04x\n", | |
| 313 | 313 | sh2->m[4] = (sh2->m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2->m[4] & (ICF|OCFA|OCFB|OVF)); |
| 314 | 314 | COMBINE_DATA(&sh2->frc); |
| 315 | 315 | if((mem_mask & 0x00ffffff) != 0) |
| r3957 | r3958 | |
| 317 | 317 | sh2_recalc_irq(sh2); |
| 318 | 318 | break; |
| 319 | 319 | case 0x05: // OCRx, TCR, TOCR |
| 320 | // printf("SH2.% | |
| 320 | // printf("SH2.%s: TCR write %08x @ %08x\n", | |
| 321 | 321 | sh2_timer_resync(sh2); |
| 322 | 322 | if(sh2->m[5] & 0x10) |
| 323 | 323 | sh2->ocrb = (sh2->ocrb & (~mem_mask >> 16)) | ((data & mem_mask) >> 16); |
| r3957 | r3958 | |
| 533 | 533 | sh2_timer_resync(sh2); |
| 534 | 534 | sh2->icr = sh2->frc; |
| 535 | 535 | sh2->m[4] |= ICF; |
| 536 | logerror("SH2.% | |
| 536 | logerror("SH2.%s: ICF activated (%x)\n", | |
| 537 | 537 | sh2_recalc_irq(sh2); |
| 538 | 538 | } |
| 539 | 539 | |
| r3957 | r3958 | |
| 696 | 696 | #endif |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | void sh2_common_init(SH2 *sh2, const device_config *device, | |
| 699 | void sh2_common_init(SH2 *sh2, const device_config *device, | |
| 700 | 700 | { |
| 701 | 701 | const sh2_cpu_core *conf = device->static_config; |
| 702 | 702 |
| r3957 | r3958 | |
|---|---|---|
| 2251 | 2251 | memset(sh2, 0, sizeof(SH2)); |
| 2252 | 2252 | |
| 2253 | 2253 | /* initialize the common core parts */ |
| 2254 | sh2_common_init(sh2, device, i | |
| 2254 | sh2_common_init(sh2, device, i | |
| 2255 | 2255 | } |
| 2256 | 2256 | |
| 2257 | 2257 | /************************************************************************** |
| r3957 | r3958 | |
| 2338 | 2338 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2339 | 2339 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 2340 | 2340 | |
| 2341 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2342 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2343 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2344 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2345 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2346 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2347 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2348 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2349 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2341 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2342 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2343 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2344 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2345 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2346 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2347 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 2348 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 2349 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2350 | 2350 | |
| 2351 | 2351 | case CPUINFO_INT_INPUT_STATE + SH2_INT_VBLIN: info->i = sh2->irq_line_state[SH2_INT_VBLIN]; break; |
| 2352 | 2352 | case CPUINFO_INT_INPUT_STATE + SH2_INT_VBLOUT: info->i = sh2->irq_line_state[SH2_INT_VBLOUT]; break; |
| r3957 | r3958 | |
| 2397 | 2397 | case CPUINFO_INT_REGISTER + SH2_EA: info->i = sh2->ea; break; |
| 2398 | 2398 | |
| 2399 | 2399 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2400 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sh2); break; | |
| 2401 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(sh2); break; | |
| 2402 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(sh2); break; | |
| 2403 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(sh2); break; | |
| 2404 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2405 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sh2); break; | |
| 2400 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sh2); break; | |
| 2401 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(sh2); break; | |
| 2402 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(sh2); break; | |
| 2403 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sh2); break; | |
| 2404 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2405 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sh2); break; | |
| 2406 | 2406 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &sh2_icount; break; |
| 2407 | 2407 | |
| 2408 | 2408 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 2456 | 2456 | switch (state) |
| 2457 | 2457 | { |
| 2458 | 2458 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2459 | case CPUINFO_ | |
| 2459 | case CPUINFO_FCT | |
| 2460 | 2460 | |
| 2461 | 2461 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2462 | 2462 | case CPUINFO_STR_NAME: strcpy(info->s, "SH-1"); break; |
| 2463 | 2463 | |
| 2464 | default: | |
| 2464 | default: CPU_GET_INFO_CALL(sh2 | |
| 2465 | 2465 | } |
| 2466 | 2466 | } |
| 2467 | 2467 |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | #include "cpuintrf.h" |
| 7 | 7 | |
| 8 | 8 | typedef struct { |
| 9 | void (*handle_dma)(int cycles); | |
| 10 | void (*handle_timers)(int cycles); | |
| 9 | void (*handle_dma)(const device_config *device, int cycles); | |
| 10 | void (*handle_timers)(const device_config *device, int cycles); | |
| 11 | 11 | } SM8500_CONFIG; |
| 12 | 12 | |
| 13 | 13 | /* interrupts */ |
| r3957 | r3958 | |
| 25 | 25 | |
| 26 | 26 | enum |
| 27 | 27 | { |
| 28 | CPUINFO_PTR_SM8500_INTERNAL_RAM = CPUINFO_PTR_CPU_SPECIFIC | |
| 29 | }; | |
| 30 | ||
| 31 | ||
| 32 | enum | |
| 33 | { | |
| 28 | 34 | /* "main" 16 bit register */ |
| 29 | 35 | SM8500_PC=1, SM8500_SP, SM8500_PS, SM8500_SYS16, SM8500_RR0, SM8500_RR2, SM8500_RR4, SM8500_RR6, SM8500_RR8, SM8500_RR10, |
| 30 | 36 | SM8500_RR12, SM8500_RR14, |
| r3957 | r3958 | |
| 33 | 39 | SM8500_SPH, SM8500_SPL, SM8500_PS0, SM8500_PS1, SM8500_P0C, SM8500_P1C, SM8500_P2C, SM8500_P3C, |
| 34 | 40 | }; |
| 35 | 41 | |
| 36 | extern UINT8* sm8500_internal_ram( void ) ; | |
| 37 | extern unsigned sm8500_get_reg( int regnum ); | |
| 38 | 42 | extern CPU_GET_INFO( sm8500 ); |
| 43 | #define CPU_SM8500 CPU_GET_INFO_NAME( sm8500 ) | |
| 39 | 44 | |
| 40 | UINT8 sm85cpu_mem_readbyte( UINT32 offset ); | |
| 41 | void sm85cpu_mem_writebyte( UINT32 offset, UINT8 data ); | |
| 42 | ||
| 43 | INLINE UINT16 sm85cpu_mem_readword( UINT32 address ) | |
| 44 | { | |
| 45 | UINT16 value = (UINT16) sm85cpu_mem_readbyte( address ) << 8; | |
| 46 | value |= sm85cpu_mem_readbyte( ( address + 1 ) & 0xffff ); | |
| 47 | return value; | |
| 48 | } | |
| 49 | ||
| 50 | INLINE void sm85cpu_mem_writeword( UINT32 address, UINT16 value ) | |
| 51 | { | |
| 52 | sm85cpu_mem_writebyte( address, value >> 8 ); | |
| 53 | sm85cpu_mem_writebyte( ( address + 1 ) & 0xffff, value & 0xff ); | |
| 54 | } | |
| 55 | ||
| 56 | 45 | extern CPU_DISASSEMBLE( sm8500 ); |
| 57 | 46 | |
| 58 | 47 | #endif /* __SM8500_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | |
| 2 | #define ARG_R r1 = sm85cpu_mem_readbyte( | |
| 2 | #define ARG_R r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 3 | 3 | |
| 4 | #define ARG_RR r2 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 5 | r1 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 4 | #define ARG_RR r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 5 | r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 6 | 6 | |
| 7 | 7 | #define ARG_rR r1 = op & 0x07; \ |
| 8 | r2 = sm85cpu_mem_readbyte( | |
| 8 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 9 | 9 | |
| 10 | #define ARG_iR r2 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 11 | r1 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 10 | #define ARG_iR r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 11 | r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 12 | 12 | |
| 13 | #define ARG_Sw r1 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 14 | s2 = sm85cpu_mem_readword( regs.PC ); regs.PC += 2; | |
| 13 | #define ARG_Sw r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 14 | s2 = sm85cpu_mem_readword( cpustate, cpustate->PC ); cpustate->PC += 2; | |
| 15 | 15 | |
| 16 | 16 | #define ARG_rrw r1 = sm8500_b2w[op & 0x07]; \ |
| 17 | s2 = sm85cpu_mem_readword( | |
| 17 | s2 = sm85cpu_mem_readword( cpustate, cpustate->PC ); cpustate->PC += 2; | |
| 18 | 18 | |
| 19 | 19 | #define ARG_ri r1 = op & 0x07; \ |
| 20 | r2 = sm85cpu_mem_readbyte( | |
| 20 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 21 | 21 | |
| 22 | 22 | #define ARG_pi r1 = 0x10 + ( op & 0x07 ); \ |
| 23 | r2 = sm85cpu_mem_readbyte( | |
| 23 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 24 | 24 | |
| 25 | #define ARG_rmb r1 = sm85cpu_mem_readbyte( | |
| 25 | #define ARG_rmb r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 26 | 26 | s2 = 0; \ |
| 27 | 27 | switch( r1 & 0xC0 ) { \ |
| 28 | 28 | case 0x00: \ |
| 29 | s2 = sm85cpu_mem_readbyte( r1 & 0x07 ); \ | |
| 29 | s2 = sm85cpu_mem_readbyte( cpustate, r1 & 0x07 ); \ | |
| 30 | 30 | break; \ |
| 31 | 31 | case 0x40: \ |
| 32 | s2 = sm85cpu_mem_readbyte( r1 & 0x07 ); \ | |
| 33 | sm85cpu_mem_writebyte( r1 & 0x07, s2 + 1 ); \ | |
| 32 | s2 = sm85cpu_mem_readbyte( cpustate, r1 & 0x07 ); \ | |
| 33 | sm85cpu_mem_writebyte( cpustate, r1 & 0x07, s2 + 1 ); \ | |
| 34 | 34 | break; \ |
| 35 | 35 | case 0x80: \ |
| 36 | s2 = sm85cpu_mem_readbyte( | |
| 36 | s2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 37 | 37 | if ( r1 & 0x07 ) { \ |
| 38 | s2 = s2 + sm85cpu_mem_readbyte( r1 & 0x07 ); \ | |
| 38 | s2 = s2 + sm85cpu_mem_readbyte( cpustate, r1 & 0x07 ); \ | |
| 39 | 39 | } \ |
| 40 | 40 | break; \ |
| 41 | 41 | case 0xC0: \ |
| 42 | s2 = sm85cpu_mem_readbyte( r1 & 0x07 ); \ | |
| 43 | sm85cpu_mem_writebyte( r1 & 0x07, s2 - 1 ); \ | |
| 42 | s2 = sm85cpu_mem_readbyte( cpustate, r1 & 0x07 ); \ | |
| 43 | sm85cpu_mem_writebyte( cpustate, r1 & 0x07, s2 - 1 ); \ | |
| 44 | 44 | break; \ |
| 45 | 45 | } \ |
| 46 | 46 | r2 = r1; \ |
| 47 | 47 | r1 = ( r1 >> 3 ) & 0x07; |
| 48 | 48 | |
| 49 | #define ARG_rmw r1 = sm85cpu_mem_readbyte( | |
| 49 | #define ARG_rmw r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 50 | 50 | s2 = 0; \ |
| 51 | 51 | switch( r1 & 0xC0 ) { \ |
| 52 | 52 | case 0x00: \ |
| 53 | s2 = sm85cpu_mem_readword( sm8500_b2w[r1 & 0x07] ); \ | |
| 53 | s2 = sm85cpu_mem_readword( cpustate, sm8500_b2w[r1 & 0x07] ); \ | |
| 54 | 54 | break; \ |
| 55 | 55 | case 0x40: \ |
| 56 | s2 = sm85cpu_mem_readword( sm8500_b2w[r1 & 0x07] ); \ | |
| 57 | sm85cpu_mem_writeword( sm8500_b2w[r1 & 0x07], s2 + 1 ); \ | |
| 56 | s2 = sm85cpu_mem_readword( cpustate, sm8500_b2w[r1 & 0x07] ); \ | |
| 57 | sm85cpu_mem_writeword( cpustate, sm8500_b2w[r1 & 0x07], s2 + 1 ); \ | |
| 58 | 58 | break; \ |
| 59 | 59 | case 0x80: \ |
| 60 | s2 = sm85cpu_mem_readword( | |
| 60 | s2 = sm85cpu_mem_readword( cpustate, cpustate->PC ); cpustate->PC += 2; \ | |
| 61 | 61 | if ( r1 & 0x07 ) { \ |
| 62 | s2 = s2 + sm85cpu_mem_readword( sm8500_b2w[r1 & 0x07] ); \ | |
| 62 | s2 = s2 + sm85cpu_mem_readword( cpustate, sm8500_b2w[r1 & 0x07] ); \ | |
| 63 | 63 | } \ |
| 64 | 64 | break; \ |
| 65 | 65 | case 0xC0: \ |
| 66 | s2 = sm85cpu_mem_readword( sm8500_b2w[r1 & 0x07] ); \ | |
| 67 | sm85cpu_mem_writeword( sm8500_b2w[r1 & 0x07], s2 - 1 ); \ | |
| 66 | s2 = sm85cpu_mem_readword( cpustate, sm8500_b2w[r1 & 0x07] ); \ | |
| 67 | sm85cpu_mem_writeword( cpustate, sm8500_b2w[r1 & 0x07], s2 - 1 ); \ | |
| 68 | 68 | break; \ |
| 69 | 69 | } \ |
| 70 | 70 | r2 = r1; \ |
| 71 | 71 | r1 = ( r1 >> 3 ) & 0x07; |
| 72 | 72 | |
| 73 | #define ARG_smw r1 = sm85cpu_mem_readbyte( | |
| 73 | #define ARG_smw r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 74 | 74 | s2 = 0; \ |
| 75 | 75 | switch( r1 & 0xC0 ) { \ |
| 76 | 76 | case 0x00: \ |
| 77 | s2 = sm85cpu_mem_readword( sm8500_b2w[r1 & 0x07] ); \ | |
| 77 | s2 = sm85cpu_mem_readword( cpustate, sm8500_b2w[r1 & 0x07] ); \ | |
| 78 | 78 | break; \ |
| 79 | 79 | case 0x40: \ |
| 80 | s2 = sm85cpu_mem_readword( sm8500_b2w[r1 & 0x07] ); \ | |
| 81 | sm85cpu_mem_writeword( sm8500_b2w[r1 & 0x07], s2 + 1 ); \ | |
| 80 | s2 = sm85cpu_mem_readword( cpustate, sm8500_b2w[r1 & 0x07] ); \ | |
| 81 | sm85cpu_mem_writeword( cpustate, sm8500_b2w[r1 & 0x07], s2 + 1 ); \ | |
| 82 | 82 | break; \ |
| 83 | 83 | case 0x80: \ |
| 84 | s2 = sm85cpu_mem_readword( | |
| 84 | s2 = sm85cpu_mem_readword( cpustate, cpustate->PC ); cpustate->PC += 2; \ | |
| 85 | 85 | if ( r1 & 0x07 ) { \ |
| 86 | s2 = s2 + sm85cpu_mem_readword( sm8500_b2w[r1 & 0x07] ); \ | |
| 86 | s2 = s2 + sm85cpu_mem_readword( cpustate, sm8500_b2w[r1 & 0x07] ); \ | |
| 87 | 87 | } \ |
| 88 | 88 | break; \ |
| 89 | 89 | case 0xC0: \ |
| 90 | s2 = sm85cpu_mem_readword( sm8500_b2w[ r1 & 0x07] ); \ | |
| 91 | sm85cpu_mem_writeword( sm8500_b2w[r1 & 0x07], s2 - 1 ); \ | |
| 90 | s2 = sm85cpu_mem_readword( cpustate, sm8500_b2w[ r1 & 0x07] ); \ | |
| 91 | sm85cpu_mem_writeword( cpustate, sm8500_b2w[r1 & 0x07], s2 - 1 ); \ | |
| 92 | 92 | break; \ |
| 93 | 93 | } \ |
| 94 | 94 | r2 = r1; \ |
| 95 | 95 | r1 = sm8500_b2w[ ( r1 >> 3 ) & 0x07 ]; |
| 96 | 96 | |
| 97 | #define ARG_d8 r1 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 98 | s2 = regs.PC + ((INT8)r1); | |
| 97 | #define ARG_d8 r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 98 | s2 = cpustate->PC + ((INT8)r1); | |
| 99 | 99 | |
| 100 | #define ARG_Rbr r1 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 101 | r2 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 102 | s2 = regs.PC + ((INT8)r2); | |
| 100 | #define ARG_Rbr r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 101 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 102 | s2 = cpustate->PC + ((INT8)r2); | |
| 103 | 103 | |
| 104 | #define ARG_ad16 s2 = sm85cpu_mem_readword( regs.PC ); \ | |
| 105 | regs.PC += 2; | |
| 104 | #define ARG_ad16 s2 = sm85cpu_mem_readword( cpustate, cpustate->PC ); \ | |
| 105 | cpustate->PC += 2; | |
| 106 | 106 | |
| 107 | #define ARG_rr r1 = sm85cpu_mem_readbyte( | |
| 107 | #define ARG_rr r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 108 | 108 | r2 = 0x00; \ |
| 109 | 109 | switch( r1 & 0xC0 ) { \ |
| 110 | 110 | case 0x00: \ |
| r3957 | r3958 | |
| 117 | 117 | break; \ |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | #define ARG_ss r1 = sm85cpu_mem_readbyte( | |
| 120 | #define ARG_ss r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 121 | 121 | r2 = 0x00; \ |
| 122 | 122 | switch( r1 & 0xC0 ) { \ |
| 123 | 123 | case 0x00: \ |
| r3957 | r3958 | |
| 130 | 130 | break; \ |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | #define ARG_2 r1 = sm85cpu_mem_readbyte( | |
| 133 | #define ARG_2 r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 134 | 134 | s2 = 0; \ |
| 135 | 135 | switch( r1 & 0xC0 ) { \ |
| 136 | 136 | case 0x00: \ |
| 137 | s2 = sm85cpu_mem_readword( sm8500_b2w[ r1 & 0x07 ] ); \ | |
| 137 | s2 = sm85cpu_mem_readword( cpustate, sm8500_b2w[ r1 & 0x07 ] ); \ | |
| 138 | 138 | break; \ |
| 139 | 139 | case 0x40: \ |
| 140 | s2 = sm85cpu_mem_readword( | |
| 140 | s2 = sm85cpu_mem_readword( cpustate, cpustate->PC ); cpustate->PC += 2; \ | |
| 141 | 141 | if ( r1 & 0x38 ) { \ |
| 142 | s2 = s2 + sm85cpu_mem_readbyte( ( r1 >> 3 ) & 0x07 ); \ | |
| 142 | s2 = s2 + sm85cpu_mem_readbyte( cpustate, ( r1 >> 3 ) & 0x07 ); \ | |
| 143 | 143 | } \ |
| 144 | s2 = sm85cpu_mem_readword( s2 ); \ | |
| 144 | s2 = sm85cpu_mem_readword( cpustate, s2 ); \ | |
| 145 | 145 | case 0x80: \ |
| 146 | 146 | case 0xC0: \ |
| 147 | 147 | break; \ |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | #define ARG_RiR r1 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 151 | d1 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 152 | r2 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 150 | #define ARG_RiR r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 151 | d1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 152 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 153 | 153 | |
| 154 | #define ARG_Rii r1 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 155 | d1 = sm85cpu_mem_readbyte( regs.PC++ ); \ | |
| 156 | r2 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 154 | #define ARG_Rii r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 155 | d1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 156 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 157 | 157 | |
| 158 | #define ARG_riB r1 = sm85cpu_mem_readbyte( | |
| 158 | #define ARG_riB r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 159 | 159 | s2 = 1 << ( r1 & 0x07 ); \ |
| 160 | d1 = sm85cpu_mem_readbyte( | |
| 160 | d1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 161 | 161 | if ( r1 & 0x38 ) { \ |
| 162 | s1 = d1 + sm85cpu_mem_readbyte( ( r1 >> 3 ) & 0x07 ); \ | |
| 162 | s1 = d1 + sm85cpu_mem_readbyte( cpustate, ( r1 >> 3 ) & 0x07 ); \ | |
| 163 | 163 | } else { \ |
| 164 | 164 | s1 = 0xFF00 + d1; \ |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | #define ARG_riBd r1 = sm85cpu_mem_readbyte( | |
| 167 | #define ARG_riBd r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 168 | 168 | s2 = 1 << ( r1 & 0x07 ); \ |
| 169 | d1 = sm85cpu_mem_readbyte( | |
| 169 | d1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); \ | |
| 170 | 170 | if ( r1 & 0x38 ) { \ |
| 171 | s1 = d1 + sm85cpu_mem_readbyte( ( r1 >> 3 ) & 0x07 ); \ | |
| 171 | s1 = d1 + sm85cpu_mem_readbyte( cpustate, ( r1 >> 3 ) & 0x07 ); \ | |
| 172 | 172 | } else { \ |
| 173 | 173 | s1 = 0xFF00 + d1; \ |
| 174 | 174 | } \ |
| 175 | d1 = sm85cpu_mem_readbyte( | |
| 175 | d1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 176 | 176 | |
| 177 | 177 | #define OP_INTSUB8(X,Y,MASK) d1 = X; \ |
| 178 | 178 | d2 = Y; \ |
| 179 | 179 | res = d1 - d2; \ |
| 180 | regs.PS1 = regs.PS1 & ( MASK ); \ | |
| 181 | regs.PS1 = regs.PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 182 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 183 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 184 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1 ) ) & 0x80 ) ? FLAG_V : 0 ); | |
| 180 | cpustate->PS1 = cpustate->PS1 & ( MASK ); \ | |
| 181 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 182 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 183 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 184 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1 ) ) & 0x80 ) ? FLAG_V : 0 ); | |
| 185 | 185 | |
| 186 | 186 | #define OP_CMP8(X,Y) OP_INTSUB8( X, Y, (FLAG_B | FLAG_I | FLAG_H | FLAG_D ) ); |
| 187 | 187 | |
| 188 | 188 | #define OP_SUB8(X,Y) OP_INTSUB8( X, Y, (FLAG_B | FLAG_I ) ); \ |
| 189 | regs.PS1 = regs.PS1 | FLAG_D; \ | |
| 190 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 189 | cpustate->PS1 = cpustate->PS1 | FLAG_D; \ | |
| 190 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 191 | 191 | |
| 192 | 192 | #define OP_INTSUB16(X,Y,MASK) d1 = X; \ |
| 193 | 193 | d2 = Y; \ |
| 194 | 194 | res = d1 - d2; \ |
| 195 | regs.PS1 = regs.PS1 & ( MASK ); \ | |
| 196 | regs.PS1 = regs.PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 197 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 198 | regs.PS1 = regs.PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 199 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ) & (res ^ d1) ) & 0x8000 ) ? FLAG_V : 0 ); | |
| 195 | cpustate->PS1 = cpustate->PS1 & ( MASK ); \ | |
| 196 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 197 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 198 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 199 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ) & (res ^ d1) ) & 0x8000 ) ? FLAG_V : 0 ); | |
| 200 | 200 | |
| 201 | 201 | #define OP_CMP16(X,Y) OP_INTSUB16( X, Y, ( FLAG_B | FLAG_I | FLAG_H | FLAG_D ) ); |
| 202 | 202 | |
| 203 | 203 | #define OP_SUB16(X,Y) OP_INTSUB16( X, Y, ( FLAG_B | FLAG_I ) ); \ |
| 204 | regs.PS1 = regs.PS1 | FLAG_D; \ | |
| 205 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x0010 ) ? FLAG_H : 0 ); | |
| 204 | cpustate->PS1 = cpustate->PS1 | FLAG_D; \ | |
| 205 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x0010 ) ? FLAG_H : 0 ); | |
| 206 | 206 | |
| 207 | 207 | #define OP_SBC8(X,Y) d1 = X; \ |
| 208 | 208 | d2 = Y; \ |
| 209 | res = d1 - d2 - ((regs.PS1 & FLAG_C) ? 1 : 0); \ | |
| 210 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I ); \ | |
| 211 | regs.PS1 = regs.PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 212 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 213 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0); \ | |
| 214 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ) & (res ^ d1) ) & 0x80 ) ? FLAG_V : 0 ); \ | |
| 215 | regs.PS1 = regs.PS1 | FLAG_D; \ | |
| 216 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 209 | res = d1 - d2 - ((cpustate->PS1 & FLAG_C) ? 1 : 0); \ | |
| 210 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I ); \ | |
| 211 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 212 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 213 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0); \ | |
| 214 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ) & (res ^ d1) ) & 0x80 ) ? FLAG_V : 0 ); \ | |
| 215 | cpustate->PS1 = cpustate->PS1 | FLAG_D; \ | |
| 216 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 217 | 217 | |
| 218 | 218 | #define OP_SBC16(X,Y) d1 = X; \ |
| 219 | 219 | d2 = Y; \ |
| 220 | res = d1 - d2 - ((regs.PS1 & FLAG_C) ? 1 : 0); \ | |
| 221 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I ); \ | |
| 222 | regs.PS1 = regs.PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 223 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 224 | regs.PS1 = regs.PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 225 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1 ) ) & 0x8000 ) ? FLAG_V : 0 ); \ | |
| 226 | regs.PS1 = regs.PS1 | FLAG_D; \ | |
| 227 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 220 | res = d1 - d2 - ((cpustate->PS1 & FLAG_C) ? 1 : 0); \ | |
| 221 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I ); \ | |
| 222 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 223 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 224 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 225 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1 ) ) & 0x8000 ) ? FLAG_V : 0 ); \ | |
| 226 | cpustate->PS1 = cpustate->PS1 | FLAG_D; \ | |
| 227 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 228 | 228 | |
| 229 | 229 | #define OP_ADD8(X,Y) d1 = X; \ |
| 230 | 230 | d2 = Y; \ |
| 231 | 231 | res = d1 + d2; \ |
| 232 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I ); \ | |
| 233 | regs.PS1 = regs.PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 234 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 235 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0); \ | |
| 236 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ^ 0x80 ) & (res ^ d1) ) & 0x80 ) ? FLAG_V : 0 ); \ | |
| 237 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 232 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I ); \ | |
| 233 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 234 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 235 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0); \ | |
| 236 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ^ 0x80 ) & (res ^ d1) ) & 0x80 ) ? FLAG_V : 0 ); \ | |
| 237 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 238 | 238 | |
| 239 | 239 | #define OP_ADD16(X,Y) d1 = X; \ |
| 240 | 240 | d2 = Y; \ |
| 241 | 241 | res = d1 + d2; \ |
| 242 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I ); \ | |
| 243 | regs.PS1 = regs.PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 244 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 245 | regs.PS1 = regs.PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 246 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1 ) ) & 0x8000 ) ? FLAG_V : 0 ); \ | |
| 247 | regs.PS1 = regs.PS1 | ( ( ( d2 ^ d1 ^ res ) & 0x0010 ) ? FLAG_H : 0 ); | |
| 242 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I ); \ | |
| 243 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 244 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 245 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 246 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1 ) ) & 0x8000 ) ? FLAG_V : 0 ); \ | |
| 247 | cpustate->PS1 = cpustate->PS1 | ( ( ( d2 ^ d1 ^ res ) & 0x0010 ) ? FLAG_H : 0 ); | |
| 248 | 248 | |
| 249 | 249 | #define OP_ADC8(X,Y) d1 = X; \ |
| 250 | 250 | d2 = Y; \ |
| 251 | res = d1 + d2 + ((regs.PS1 & FLAG_C) ? 1 : 0); \ | |
| 252 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I ); \ | |
| 253 | regs.PS1 = regs.PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 254 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 255 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0); \ | |
| 256 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ) & (res ^ d1) ) & 0x80 ) ? FLAG_V : 0 ); \ | |
| 257 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 251 | res = d1 + d2 + ((cpustate->PS1 & FLAG_C) ? 1 : 0); \ | |
| 252 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I ); \ | |
| 253 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFF ) ? FLAG_C : 0 ); \ | |
| 254 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 255 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0); \ | |
| 256 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ) & (res ^ d1) ) & 0x80 ) ? FLAG_V : 0 ); \ | |
| 257 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 258 | 258 | |
| 259 | 259 | #define OP_ADC16(X,Y) d1 = X; \ |
| 260 | 260 | d2 = Y; \ |
| 261 | res = d1 + d2 + ((regs.PS1 & FLAG_C) ? 1 : 0); \ | |
| 262 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I ); \ | |
| 263 | regs.PS1 = regs.PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 264 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 265 | regs.PS1 = regs.PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 266 | regs.PS1 = regs.PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1) ) & 0x8000 ) ? FLAG_V : 0 ); \ | |
| 267 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 261 | res = d1 + d2 + ((cpustate->PS1 & FLAG_C) ? 1 : 0); \ | |
| 262 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I ); \ | |
| 263 | cpustate->PS1 = cpustate->PS1 | ( ( res > 0xFFFF ) ? FLAG_C : 0 ); \ | |
| 264 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 265 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 266 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d2 ^ d1 ) & ( res ^ d1) ) & 0x8000 ) ? FLAG_V : 0 ); \ | |
| 267 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ d2 ^ res ) & 0x10 ) ? FLAG_H : 0 ); | |
| 268 | 268 | |
| 269 | 269 | #define OP_NEG8(X) res = -X; \ |
| 270 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 271 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_C | FLAG_Z : 0 ); \ | |
| 272 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 273 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0x80 ) ? FLAG_V : 0 ); | |
| 270 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 271 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_C | FLAG_Z : 0 ); \ | |
| 272 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 273 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0x80 ) ? FLAG_V : 0 ); | |
| 274 | 274 | |
| 275 | 275 | #define OP_COM8(X) res = ~X; \ |
| 276 | regs.PS1 = regs.PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 277 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 278 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 276 | cpustate->PS1 = cpustate->PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 277 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 278 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 279 | 279 | |
| 280 | 280 | #define OP_RR8(X) d1 = X; \ |
| 281 | 281 | res = d1 >> 1; \ |
| 282 | 282 | if ( d1 & 0x01 ) { \ |
| 283 | 283 | res |= 0x80; \ |
| 284 | 284 | } \ |
| 285 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 286 | regs.PS1 = regs.PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 287 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 288 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 289 | regs.PS1 = regs.PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ! ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 285 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 286 | cpustate->PS1 = cpustate->PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 287 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 288 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 289 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ! ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 290 | 290 | |
| 291 | 291 | #define OP_RL8(X) d1 = X; \ |
| 292 | 292 | res = d1 << 1; \ |
| 293 | 293 | if ( d1 & 0x80 ) { \ |
| 294 | 294 | res |= 0x01; \ |
| 295 | 295 | } \ |
| 296 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 297 | regs.PS1 = regs.PS1 | ( ( d1 & 0x80 ) ? FLAG_C : 0 ); \ | |
| 298 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 299 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 300 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ res ) & 0x80 ) ? FLAG_V : 0 ); | |
| 296 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 297 | cpustate->PS1 = cpustate->PS1 | ( ( d1 & 0x80 ) ? FLAG_C : 0 ); \ | |
| 298 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 299 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 300 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ res ) & 0x80 ) ? FLAG_V : 0 ); | |
| 301 | 301 | |
| 302 | 302 | #define OP_RRC8(X) d1 = X; \ |
| 303 | 303 | res = d1 >> 1; \ |
| 304 | if ( | |
| 304 | if ( cpustate->PS1 & FLAG_C ) { \ | |
| 305 | 305 | res |= 0x80; \ |
| 306 | 306 | } \ |
| 307 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 308 | regs.PS1 = regs.PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 309 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 310 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 311 | regs.PS1 = regs.PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ! ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 307 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 308 | cpustate->PS1 = cpustate->PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 309 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 310 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 311 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ! ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 312 | 312 | |
| 313 | 313 | #define OP_RLC8(X) d1 = X; \ |
| 314 | 314 | res = d1 << 1; \ |
| 315 | if ( | |
| 315 | if ( cpustate->PS1 & FLAG_C ) { \ | |
| 316 | 316 | res |= 0x01; \ |
| 317 | 317 | } \ |
| 318 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 319 | regs.PS1 = regs.PS1 | ( ( d1 & 0x80 ) ? FLAG_C : 0 ); \ | |
| 320 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 321 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 322 | regs.PS1 = regs.PS1 | ( ( ( d1 ^ res ) & 0x80 ) ? FLAG_V : 0 ); | |
| 318 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 319 | cpustate->PS1 = cpustate->PS1 | ( ( d1 & 0x80 ) ? FLAG_C : 0 ); \ | |
| 320 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 321 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 322 | cpustate->PS1 = cpustate->PS1 | ( ( ( d1 ^ res ) & 0x80 ) ? FLAG_V : 0 ); | |
| 323 | 323 | |
| 324 | 324 | #define OP_SRL8(X) d1 = X; \ |
| 325 | 325 | res = d1 >> 1; \ |
| 326 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 327 | regs.PS1 = regs.PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 328 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 326 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 327 | cpustate->PS1 = cpustate->PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 328 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 329 | 329 | |
| 330 | 330 | #define OP_SRA8(X) d1 = X; \ |
| 331 | 331 | res = d1 >> 1; \ |
| 332 | 332 | if ( d1 & 0x80 ) { \ |
| 333 | 333 | res |= 0x80; \ |
| 334 | 334 | } \ |
| 335 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 336 | regs.PS1 = regs.PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 337 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 338 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 335 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 336 | cpustate->PS1 = cpustate->PS1 | ( ( d1 & 0x01 ) ? FLAG_C : 0 ); \ | |
| 337 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 338 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 339 | 339 | |
| 340 | 340 | #define OP_SLL8(X) d1 = X; \ |
| 341 | 341 | res = d1 << 1; \ |
| 342 | regs.PS1 = regs.PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 343 | regs.PS1 = regs.PS1 | ( ( d1 & 0x80 ) ? FLAG_C : 0 ); \ | |
| 344 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 345 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 342 | cpustate->PS1 = cpustate->PS1 & ( FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 343 | cpustate->PS1 = cpustate->PS1 | ( ( d1 & 0x80 ) ? FLAG_C : 0 ); \ | |
| 344 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 345 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 346 | 346 | |
| 347 | 347 | #define OP_INC8(X) d1 = X; \ |
| 348 | 348 | res = d1 + 1; \ |
| 349 | regs.PS1 = regs.PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 350 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 351 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 352 | regs.PS1 = regs.PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ! ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 349 | cpustate->PS1 = cpustate->PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 350 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 351 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 352 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ! ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 353 | 353 | |
| 354 | 354 | #define OP_INC16(X) d1 = X; \ |
| 355 | 355 | res = d1 + 1; \ |
| 356 | regs.PS1 = regs.PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 357 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 358 | regs.PS1 = regs.PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 359 | regs.PS1 = regs.PS1 | ( ( ( ( d1 ^ res ) & 0x8000 ) && ! ( res & 0x8000 ) ) ? FLAG_V : 0 ); | |
| 356 | cpustate->PS1 = cpustate->PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 357 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 358 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 359 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d1 ^ res ) & 0x8000 ) && ! ( res & 0x8000 ) ) ? FLAG_V : 0 ); | |
| 360 | 360 | |
| 361 | 361 | #define OP_DEC8(X) d1 = X; \ |
| 362 | 362 | res = d1 - 1; \ |
| 363 | regs.PS1 = regs.PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 364 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 365 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 366 | regs.PS1 = regs.PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 363 | cpustate->PS1 = cpustate->PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 364 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 365 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); \ | |
| 366 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d1 ^ res ) & 0x80 ) && ( res & 0x80 ) ) ? FLAG_V : 0 ); | |
| 367 | 367 | |
| 368 | 368 | #define OP_DEC16(X) d1 = X; \ |
| 369 | 369 | res = d1 - 1; \ |
| 370 | regs.PS1 = regs.PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 371 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 372 | regs.PS1 = regs.PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 373 | regs.PS1 = regs.PS1 | ( ( ( ( d1 ^ res ) & 0x8000 ) && ( res & 0x8000 ) ) ? FLAG_V : 0 ); | |
| 370 | cpustate->PS1 = cpustate->PS1 & ( FLAG_C | FLAG_D | FLAG_H | FLAG_B | FLAG_I ); \ | |
| 371 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 372 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x8000 ) ? FLAG_S : 0 ); \ | |
| 373 | cpustate->PS1 = cpustate->PS1 | ( ( ( ( d1 ^ res ) & 0x8000 ) && ( res & 0x8000 ) ) ? FLAG_V : 0 ); | |
| 374 | 374 | |
| 375 | 375 | #define OP_AND8(X,Y) d1 = X; \ |
| 376 | 376 | d2 = Y; \ |
| 377 | 377 | res = d1 & d2; \ |
| 378 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 379 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 380 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 378 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 379 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 380 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 381 | 381 | |
| 382 | 382 | #define OP_AND16(X,Y) d1 = X; \ |
| 383 | 383 | d2 = Y; \ |
| 384 | 384 | res = d1 & d2; \ |
| 385 | regs.PS1 = regs.PS1 & ( FLAG_C | FLAG_S | FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 386 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 385 | cpustate->PS1 = cpustate->PS1 & ( FLAG_C | FLAG_S | FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 386 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 387 | 387 | |
| 388 | 388 | #define OP_OR8(X,Y) d1 = X; \ |
| 389 | 389 | d2 = Y; \ |
| 390 | 390 | res = d1 | d2; \ |
| 391 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 392 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 393 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 391 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 392 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 393 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 394 | 394 | |
| 395 | 395 | #define OP_OR16(X,Y) d1 = X; \ |
| 396 | 396 | d2 = Y; \ |
| 397 | 397 | res = d1 | d2; \ |
| 398 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D | FLAG_C | FLAG_S ); \ | |
| 399 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 398 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D | FLAG_C | FLAG_S ); \ | |
| 399 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 400 | 400 | |
| 401 | 401 | #define OP_XOR8(X,Y) d1 = X; \ |
| 402 | 402 | d2 = Y; \ |
| 403 | 403 | res = d1 ^ d2; \ |
| 404 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 405 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 406 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 404 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D ); \ | |
| 405 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0 ) ? FLAG_Z : 0 ); \ | |
| 406 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 407 | 407 | |
| 408 | 408 | #define OP_XOR16(X,Y) d1 = X; \ |
| 409 | 409 | d2 = Y; \ |
| 410 | 410 | res = d1 ^ d2; \ |
| 411 | regs.PS1 = regs.PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D | FLAG_C | FLAG_S ); \ | |
| 412 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 411 | cpustate->PS1 = cpustate->PS1 & ( FLAG_B | FLAG_I | FLAG_H | FLAG_D | FLAG_C | FLAG_S ); \ | |
| 412 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFFFF ) == 0 ) ? FLAG_Z : 0 ); | |
| 413 | 413 | |
| 414 | 414 | #define OP_DA8(X) d1 = X; \ |
| 415 | 415 | res = d1; \ |
| 416 | if ( regs.PS1 & FLAG_D ) { \ | |
| 417 | if ( regs.PS1 & FLAG_C ) { \ | |
| 418 | if ( regs.PS1 & FLAG_H ) { \ | |
| 416 | if ( cpustate->PS1 & FLAG_D ) { \ | |
| 417 | if ( cpustate->PS1 & FLAG_C ) { \ | |
| 418 | if ( cpustate->PS1 & FLAG_H ) { \ | |
| 419 | 419 | res += 0x9A; \ |
| 420 | 420 | } else { \ |
| 421 | 421 | res += 0xA0; \ |
| 422 | 422 | } \ |
| 423 | 423 | } else { \ |
| 424 | if ( | |
| 424 | if ( cpustate->PS1 & FLAG_H ) { \ | |
| 425 | 425 | res += 0xFA; \ |
| 426 | 426 | } \ |
| 427 | 427 | } \ |
| 428 | 428 | } else { \ |
| 429 | if ( regs.PS1 & FLAG_C ) { \ | |
| 430 | if ( regs.PS1 & FLAG_H ) { \ | |
| 429 | if ( cpustate->PS1 & FLAG_C ) { \ | |
| 430 | if ( cpustate->PS1 & FLAG_H ) { \ | |
| 431 | 431 | res += 0x66; \ |
| 432 | 432 | } else { \ |
| 433 | 433 | if ( ( res & 0x0F ) < 10 ) { \ |
| r3957 | r3958 | |
| 437 | 437 | } \ |
| 438 | 438 | } \ |
| 439 | 439 | } else { \ |
| 440 | if ( | |
| 440 | if ( cpustate->PS1 & FLAG_H ) { \ | |
| 441 | 441 | if ( ( res & 0xF0 ) < 0xA0 ) { \ |
| 442 | 442 | res += 0x06; \ |
| 443 | 443 | } else { \ |
| 444 | 444 | res += 0x66; \ |
| 445 | | |
| 445 | cpustate->PS1 = cpustate->PS1 | FLAG_C; \ | |
| 446 | 446 | } \ |
| 447 | 447 | } else { \ |
| 448 | 448 | if ( ( res & 0x0F ) < 10 ) { \ |
| 449 | 449 | if ( ( res & 0xF0 ) >= 0xA0 ) { \ |
| 450 | 450 | res += 0x60; \ |
| 451 | | |
| 451 | cpustate->PS1 = cpustate->PS1 | FLAG_C; \ | |
| 452 | 452 | } \ |
| 453 | 453 | } else { \ |
| 454 | 454 | if ( ( res & 0xF0 ) < 0x90 ) { \ |
| 455 | 455 | res += 0x06; \ |
| 456 | 456 | } else { \ |
| 457 | 457 | res += 0x66; \ |
| 458 | | |
| 458 | cpustate->PS1 = cpustate->PS1 | FLAG_C; \ | |
| 459 | 459 | } \ |
| 460 | 460 | } \ |
| 461 | 461 | } \ |
| 462 | 462 | } \ |
| 463 | 463 | } \ |
| 464 | regs.PS1 = regs.PS1 & ~ ( FLAG_Z | FLAG_S ); \ | |
| 465 | regs.PS1 = regs.PS1 | ( ( ( res & 0xFF ) == 0x00 ) ? FLAG_Z : 0 ); \ | |
| 466 | regs.PS1 = regs.PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 464 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_S ); \ | |
| 465 | cpustate->PS1 = cpustate->PS1 | ( ( ( res & 0xFF ) == 0x00 ) ? FLAG_Z : 0 ); \ | |
| 466 | cpustate->PS1 = cpustate->PS1 | ( ( res & 0x80 ) ? FLAG_S : 0 ); | |
| 467 | 467 | |
| 468 | 468 | #define OP_SWAP8(X) d1 = X; \ |
| 469 | 469 | res = ( d1 << 4 ) | ( d1 >> 4 ); |
| r3957 | r3958 | |
| 471 | 471 | #define CHECK_CC res = 0; \ |
| 472 | 472 | switch( op & 0x0F ) { \ |
| 473 | 473 | case 0x00: /* F */ res = 0; break; \ |
| 474 | case 0x01: /* LT */ if ( ( regs.PS1 & FLAG_S ) ^ ( ( regs.PS1 & FLAG_V ) << 1 ) ) res = 1; break; \ | |
| 475 | case 0x02: /* LE */ if ( ( ( regs.PS1 & FLAG_S ) && ! ( regs.PS1 & FLAG_V ) ) || ( ( regs.PS1 & FLAG_S ) && ( regs.PS1 & FLAG_V ) && ( regs.PS1 & FLAG_Z ) ) || ( ! ( regs.PS1 & FLAG_S ) && ( ( regs.PS1 & FLAG_Z ) || (regs.PS1 & FLAG_V ) ) ) ) res = 1; break; \ | |
| 476 | case 0x03: /* ULE */ if ( regs.PS1 & FLAG_Z || regs.PS1 & FLAG_C ) res = 1; break; \ | |
| 477 | case 0x04: /* OV */ if ( regs.PS1 & FLAG_V ) res = 1; break; \ | |
| 478 | case 0x05: /* MI */ if ( regs.PS1 & FLAG_S ) res = 1; break; \ | |
| 479 | case 0x06: /* Z */ if ( regs.PS1 & FLAG_Z ) res = 1; break; \ | |
| 480 | case 0x07: /* C */ if ( regs.PS1 & FLAG_C ) res = 1; break; \ | |
| 474 | case 0x01: /* LT */ if ( ( cpustate->PS1 & FLAG_S ) ^ ( ( cpustate->PS1 & FLAG_V ) << 1 ) ) res = 1; break; \ | |
| 475 | case 0x02: /* LE */ if ( ( ( cpustate->PS1 & FLAG_S ) && ! ( cpustate->PS1 & FLAG_V ) ) || ( ( cpustate->PS1 & FLAG_S ) && ( cpustate->PS1 & FLAG_V ) && ( cpustate->PS1 & FLAG_Z ) ) || ( ! ( cpustate->PS1 & FLAG_S ) && ( ( cpustate->PS1 & FLAG_Z ) || (cpustate->PS1 & FLAG_V ) ) ) ) res = 1; break; \ | |
| 476 | case 0x03: /* ULE */ if ( cpustate->PS1 & FLAG_Z || cpustate->PS1 & FLAG_C ) res = 1; break; \ | |
| 477 | case 0x04: /* OV */ if ( cpustate->PS1 & FLAG_V ) res = 1; break; \ | |
| 478 | case 0x05: /* MI */ if ( cpustate->PS1 & FLAG_S ) res = 1; break; \ | |
| 479 | case 0x06: /* Z */ if ( cpustate->PS1 & FLAG_Z ) res = 1; break; \ | |
| 480 | case 0x07: /* C */ if ( cpustate->PS1 & FLAG_C ) res = 1; break; \ | |
| 481 | 481 | case 0x08: /* T */ res = 1; break; \ |
| 482 | case 0x09: /* GE */ if ( ! ( ( regs.PS1 & FLAG_S ) ^ ( ( regs.PS1 & FLAG_V ) << 1 ) ) ) res = 1; break; \ | |
| 483 | case 0x0A: /* GT */ if ( ( ! ( regs.PS1 & FLAG_Z ) && ( regs.PS1 & FLAG_S ) && ( regs.PS1 & FLAG_V ) ) || ( ! ( regs.PS1 & FLAG_Z ) && ! ( regs.PS1 & FLAG_V ) && ! ( regs.PS1 & FLAG_S ) ) ) res = 1; break; \ | |
| 484 | case 0x0B: /* UGT */ if ( ! ( regs.PS1 & FLAG_Z || regs.PS1 & FLAG_C ) ) res = 1; break; \ | |
| 485 | case 0x0C: /* NOV */ if ( ! (regs.PS1 & FLAG_V) ) res = 1; break; \ | |
| 486 | case 0x0D: /* PL */ if ( ! (regs.PS1 & FLAG_S) ) res = 1; break; \ | |
| 487 | case 0x0E: /* NZ */ if ( ! (regs.PS1 & FLAG_Z) ) res = 1; break; \ | |
| 488 | case 0x0F: /* NC */ if ( ! (regs.PS1 & FLAG_C) ) res = 1; break; \ | |
| 482 | case 0x09: /* GE */ if ( ! ( ( cpustate->PS1 & FLAG_S ) ^ ( ( cpustate->PS1 & FLAG_V ) << 1 ) ) ) res = 1; break; \ | |
| 483 | case 0x0A: /* GT */ if ( ( ! ( cpustate->PS1 & FLAG_Z ) && ( cpustate->PS1 & FLAG_S ) && ( cpustate->PS1 & FLAG_V ) ) || ( ! ( cpustate->PS1 & FLAG_Z ) && ! ( cpustate->PS1 & FLAG_V ) && ! ( cpustate->PS1 & FLAG_S ) ) ) res = 1; break; \ | |
| 484 | case 0x0B: /* UGT */ if ( ! ( cpustate->PS1 & FLAG_Z || cpustate->PS1 & FLAG_C ) ) res = 1; break; \ | |
| 485 | case 0x0C: /* NOV */ if ( ! (cpustate->PS1 & FLAG_V) ) res = 1; break; \ | |
| 486 | case 0x0D: /* PL */ if ( ! (cpustate->PS1 & FLAG_S) ) res = 1; break; \ | |
| 487 | case 0x0E: /* NZ */ if ( ! (cpustate->PS1 & FLAG_Z) ) res = 1; break; \ | |
| 488 | case 0x0F: /* NC */ if ( ! (cpustate->PS1 & FLAG_C) ) res = 1; break; \ | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | #define PUSH8(X) regs.SP = regs.SP - 1; \ | |
| 492 | if ( ( regs.SYS & 0x40 ) == 0 ) { \ | |
| 493 | regs.SP = regs.SP & 0xFF; \ | |
| 491 | #define PUSH8(X) cpustate->SP = cpustate->SP - 1; \ | |
| 492 | if ( ( cpustate->SYS & 0x40 ) == 0 ) { \ | |
| 493 | cpustate->SP = cpustate->SP & 0xFF; \ | |
| 494 | 494 | } \ |
| 495 | sm85cpu_mem_writebyte( | |
| 495 | sm85cpu_mem_writebyte( cpustate, cpustate->SP, X ); | |
| 496 | 496 | |
| 497 | #define POP8(X) X = sm85cpu_mem_readbyte( regs.SP ); \ | |
| 498 | regs.SP = regs.SP + 1; \ | |
| 499 | if ( ( regs.SYS & 0x40 ) == 0 ) { \ | |
| 500 | regs.SP = regs.SP & 0xFF; \ | |
| 497 | #define POP8(X) X = sm85cpu_mem_readbyte( cpustate, cpustate->SP ); \ | |
| 498 | cpustate->SP = cpustate->SP + 1; \ | |
| 499 | if ( ( cpustate->SYS & 0x40 ) == 0 ) { \ | |
| 500 | cpustate->SP = cpustate->SP & 0xFF; \ | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | case 0x00: /* CLR R - 4 cycles - Flags affected: -------- */ |
| 504 | 504 | ARG_R; |
| 505 | sm85cpu_mem_writebyte( r1, 0 ); | |
| 505 | sm85cpu_mem_writebyte( cpustate, r1, 0 ); | |
| 506 | 506 | mycycles += 4; |
| 507 | 507 | break; |
| 508 | 508 | case 0x01: /* NEG R - 5 cycles - Flags affected: CZSV---- */ |
| 509 | 509 | ARG_R; |
| 510 | OP_NEG8( sm85cpu_mem_readbyte( r1 ) ); | |
| 511 | sm85cpu_mem_writebyte( r1 , res & 0xFF ); | |
| 510 | OP_NEG8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 511 | sm85cpu_mem_writebyte( cpustate, r1 , res & 0xFF ); | |
| 512 | 512 | mycycles += 5; |
| 513 | 513 | break; |
| 514 | 514 | case 0x02: /* COM R - 4 cycles - Flags affected: -ZS0---- */ |
| 515 | 515 | ARG_R; |
| 516 | OP_COM8( sm85cpu_mem_readbyte( r1 ) ); | |
| 517 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 516 | OP_COM8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 517 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 518 | 518 | mycycles += 4; |
| 519 | 519 | break; |
| 520 | 520 | case 0x03: /* RR R - 4 cycles - Flags affected: CZSV---- */ |
| 521 | 521 | ARG_R; |
| 522 | OP_RR8( sm85cpu_mem_readbyte( r1 ) ); | |
| 523 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 522 | OP_RR8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 523 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 524 | 524 | mycycles += 4; |
| 525 | 525 | break; |
| 526 | 526 | case 0x04: /* RL R - 4 cycles - Flags affected: CZSV---- */ |
| 527 | 527 | ARG_R; |
| 528 | OP_RL8( sm85cpu_mem_readbyte( r1 ) ); | |
| 529 | sm85cpu_mem_writebyte( r1 , res & 0xFF ); | |
| 528 | OP_RL8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 529 | sm85cpu_mem_writebyte( cpustate, r1 , res & 0xFF ); | |
| 530 | 530 | mycycles += 4; |
| 531 | 531 | break; |
| 532 | 532 | case 0x05: /* RRC R - 4 cycles - Flags affected: CZSV---- */ |
| 533 | 533 | ARG_R; |
| 534 | OP_RRC8( sm85cpu_mem_readbyte( r1 ) ); | |
| 535 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 534 | OP_RRC8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 535 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 536 | 536 | mycycles += 4; |
| 537 | 537 | break; |
| 538 | 538 | case 0x06: /* RLC R - 4 cycles - Flags affected: CZSV---- */ |
| 539 | 539 | ARG_R; |
| 540 | OP_RLC8( sm85cpu_mem_readbyte( r1 ) ); | |
| 541 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 540 | OP_RLC8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 541 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 542 | 542 | mycycles += 4; |
| 543 | 543 | break; |
| 544 | 544 | case 0x07: /* SRL R - 4 cycles - Flags affected: CZ00---- */ |
| 545 | 545 | ARG_R; |
| 546 | OP_SRL8( sm85cpu_mem_readbyte( r1 ) ); | |
| 547 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 546 | OP_SRL8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 547 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 548 | 548 | mycycles += 4; |
| 549 | 549 | break; |
| 550 | 550 | case 0x08: /* INC R - 4 cycles - Flags affected: -ZSV---- */ |
| 551 | 551 | ARG_R; |
| 552 | OP_INC8( sm85cpu_mem_readbyte( r1 ) ); | |
| 553 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 552 | OP_INC8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 553 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 554 | 554 | mycycles += 4; |
| 555 | 555 | break; |
| 556 | 556 | case 0x09: /* DEC R - 4 cycles - Flags affected: -ZSV---- */ |
| 557 | 557 | ARG_R; |
| 558 | OP_DEC8( sm85cpu_mem_readbyte( r1 ) ); | |
| 559 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 558 | OP_DEC8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 559 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 560 | 560 | mycycles += 4; |
| 561 | 561 | break; |
| 562 | 562 | case 0x0A: /* SRA R - 4 cycles - Flags affected: CZS0---- */ |
| 563 | 563 | ARG_R; |
| 564 | OP_SRA8( sm85cpu_mem_readbyte( r1 ) ); | |
| 565 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 564 | OP_SRA8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 565 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 566 | 566 | mycycles += 4; |
| 567 | 567 | break; |
| 568 | 568 | case 0x0B: /* SLL R - 4 cycles - Flags affected: CZS0---- */ |
| 569 | 569 | ARG_R; |
| 570 | OP_SLL8( sm85cpu_mem_readbyte( r1 ) ); | |
| 571 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 570 | OP_SLL8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 571 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 572 | 572 | mycycles += 4; |
| 573 | 573 | break; |
| 574 | 574 | case 0x0C: /* DA R - 4 cycles - Flags affected: CZS----- */ |
| 575 | 575 | ARG_R; |
| 576 | OP_DA8( sm85cpu_mem_readbyte( r1 ) ); | |
| 577 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 576 | OP_DA8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 577 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 578 | 578 | mycycles += 4; |
| 579 | 579 | break; |
| 580 | 580 | case 0x0D: /* SWAP R - 7 cycles - Flags affected: -------- */ |
| 581 | 581 | ARG_R; |
| 582 | OP_SWAP8( sm85cpu_mem_readbyte( r1 ) ); | |
| 583 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 582 | OP_SWAP8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 583 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 584 | 584 | mycycles += 7; |
| 585 | 585 | break; |
| 586 | 586 | case 0x0E: /* PUSH R - 5?/12? (8bit SP),10 (16bit SP) cycles */ |
| 587 | 587 | ARG_R; |
| 588 | PUSH8( sm85cpu_mem_readbyte( r1 ) ); | |
| 589 | mycycles += ( ( regs.SYS & 0x40 ) ? 12 : 10 ); | |
| 588 | PUSH8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 589 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 12 : 10 ); | |
| 590 | 590 | break; |
| 591 | 591 | case 0x0F: /* POP R - 9,8 cycles */ |
| 592 | 592 | ARG_R; |
| 593 | 593 | POP8( r2 ); |
| 594 | sm85cpu_mem_writebyte( r1, r2 ); | |
| 595 | mycycles += ( ( regs.SYS & 0x40 ) ? 9 : 8 ); | |
| 594 | sm85cpu_mem_writebyte( cpustate, r1, r2 ); | |
| 595 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 9 : 8 ); | |
| 596 | 596 | break; |
| 597 | 597 | case 0x10: /* CMP Rr,Rs - 5 cycles - Flags affected: CZSV---- */ |
| 598 | 598 | ARG_rr; |
| 599 | OP_CMP8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 599 | OP_CMP8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 600 | 600 | mycycles += 5; |
| 601 | 601 | break; |
| 602 | 602 | case 0x11: /* ADD Rr,Rs - 5 cycles - Flags affected: CZSV0H-- */ |
| 603 | 603 | ARG_rr; |
| 604 | OP_ADD8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 605 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 604 | OP_ADD8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 605 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 606 | 606 | mycycles += 5; |
| 607 | 607 | break; |
| 608 | 608 | case 0x12: /* SUB Rr,Rs - 5 cycles - Flags affected: CZSV1H-- */ |
| 609 | 609 | ARG_rr; |
| 610 | OP_SUB8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 611 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 610 | OP_SUB8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 611 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 612 | 612 | mycycles += 5; |
| 613 | 613 | break; |
| 614 | 614 | case 0x13: /* ADC Rr,Rs - 5 cycles - Flags affected: CZSV0H-- */ |
| 615 | 615 | ARG_rr; |
| 616 | OP_ADC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 617 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 616 | OP_ADC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 617 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 618 | 618 | mycycles += 5; |
| 619 | 619 | break; |
| 620 | 620 | case 0x14: /* SBC Rr,Rs - 5 cycles - Flags affected: CZSV1H-- */ |
| 621 | 621 | ARG_rr; |
| 622 | OP_SBC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 623 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 622 | OP_SBC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 623 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 624 | 624 | mycycles += 5; |
| 625 | 625 | break; |
| 626 | 626 | case 0x15: /* AND Rr,Rs - 5 cycles - Flags affected: -ZS0---- */ |
| 627 | 627 | ARG_rr; |
| 628 | OP_AND8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 629 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 628 | OP_AND8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 629 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 630 | 630 | mycycles += 5; |
| 631 | 631 | break; |
| 632 | 632 | case 0x16: /* OR Rr,Rs - 5 cycles - Flags affected: -ZS0---- */ |
| 633 | 633 | ARG_rr; |
| 634 | OP_OR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 635 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 634 | OP_OR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 635 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 636 | 636 | mycycles += 5; |
| 637 | 637 | break; |
| 638 | 638 | case 0x17: /* XOR Rr,Rs - 5 cycles - Flags affected: -ZS0---- */ |
| 639 | 639 | ARG_rr; |
| 640 | OP_XOR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 641 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 640 | OP_XOR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 641 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 642 | 642 | mycycles += 5; |
| 643 | 643 | break; |
| 644 | 644 | case 0x18: /* INCW S - 8 cycles - Flags affected: -ZSV---- */ |
| 645 | 645 | ARG_R; |
| 646 | OP_INC16( sm85cpu_mem_readword( r1 ) ); | |
| 647 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 646 | OP_INC16( sm85cpu_mem_readword( cpustate, r1 ) ); | |
| 647 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 648 | 648 | mycycles += 8; |
| 649 | 649 | break; |
| 650 | 650 | case 0x19: /* DECW S - 8 cycles - Flags affected: -ZSV---- */ |
| 651 | 651 | ARG_R; |
| 652 | OP_DEC16( sm85cpu_mem_readword( r1 ) ); | |
| 653 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 652 | OP_DEC16( sm85cpu_mem_readword( cpustate, r1 ) ); | |
| 653 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 654 | 654 | mycycles += 8; |
| 655 | 655 | break; |
| 656 | 656 | case 0x1A: /* CLR/NEG/COM/RR/RL/RRC/RLC/SRL @Rr - 7/8/7/7/7/7/7/6 cycles */ |
| 657 | 657 | ARG_rr; |
| 658 | 658 | res = 0; |
| 659 | s1 = sm85cpu_mem_readbyte( r1 ); | |
| 659 | s1 = sm85cpu_mem_readbyte( cpustate, r1 ); | |
| 660 | 660 | switch( r2 ) { |
| 661 | 661 | case 0x00: /* Flags affected: -------- */ |
| 662 | 662 | res = 0; |
| 663 | 663 | mycycles += 7; |
| 664 | 664 | break; |
| 665 | 665 | case 0x01: /* Flags affected: CZSV---- */ |
| 666 | OP_NEG8( sm85cpu_mem_readbyte( s1 ) ); | |
| 666 | OP_NEG8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 667 | 667 | mycycles += 8; |
| 668 | 668 | break; |
| 669 | 669 | case 0x02: /* Flags affected: -ZS0---- */ |
| 670 | OP_COM8( sm85cpu_mem_readbyte( s1 ) ); | |
| 670 | OP_COM8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 671 | 671 | mycycles += 7; |
| 672 | 672 | break; |
| 673 | 673 | case 0x03: /* Flags affected: CZSV---- */ |
| 674 | OP_RR8( sm85cpu_mem_readbyte( s1 ) ); | |
| 674 | OP_RR8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 675 | 675 | mycycles += 7; |
| 676 | 676 | break; |
| 677 | 677 | case 0x04: /* Flags affected: CZSV---- */ |
| 678 | OP_RL8( sm85cpu_mem_readbyte( s1 ) ); | |
| 678 | OP_RL8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 679 | 679 | mycycles += 7; |
| 680 | 680 | break; |
| 681 | 681 | case 0x05: /* Flags affected: CZSV---- */ |
| 682 | OP_RRC8( sm85cpu_mem_readbyte( s1 ) ); | |
| 682 | OP_RRC8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 683 | 683 | mycycles += 7; |
| 684 | 684 | break; |
| 685 | 685 | case 0x06: /* Flags affected: CZSV---- */ |
| 686 | OP_RLC8( sm85cpu_mem_readbyte( s1 ) ); | |
| 686 | OP_RLC8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 687 | 687 | mycycles += 7; |
| 688 | 688 | break; |
| 689 | 689 | case 0x07: /* Flags affected: CZ00---- */ |
| 690 | OP_SRL8( sm85cpu_mem_readbyte( s1 ) ); | |
| 690 | OP_SRL8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 691 | 691 | mycycles += 6; |
| 692 | 692 | break; |
| 693 | 693 | } |
| 694 | sm85cpu_mem_writebyte( s1, res & 0xFF ); | |
| 694 | sm85cpu_mem_writebyte( cpustate, s1, res & 0xFF ); | |
| 695 | 695 | break; |
| 696 | 696 | case 0x1B: /* INC/DEC/SRA/SLL/DA/SWAP/PUSH/POP @Rr - 7,7,6,7,9,13,8,12,11 cycles */ |
| 697 | 697 | ARG_rr; |
| 698 | s1 = sm85cpu_mem_readbyte( r1 ); | |
| 698 | s1 = sm85cpu_mem_readbyte( cpustate, r1 ); | |
| 699 | 699 | switch( r2 ) { |
| 700 | 700 | case 0x00: /* Flags affected: -ZSV---- */ |
| 701 | OP_INC8( sm85cpu_mem_readbyte( s1 ) ); | |
| 702 | sm85cpu_mem_writebyte( s1, res & 0xFF ); | |
| 701 | OP_INC8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 702 | sm85cpu_mem_writebyte( cpustate, s1, res & 0xFF ); | |
| 703 | 703 | mycycles += 7; |
| 704 | 704 | break; |
| 705 | 705 | case 0x01: /* Flags affected: -ZSV---- */ |
| 706 | OP_DEC8( sm85cpu_mem_readbyte( s1 ) ); | |
| 707 | sm85cpu_mem_writebyte( s1, res & 0xFF ); | |
| 706 | OP_DEC8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 707 | sm85cpu_mem_writebyte( cpustate, s1, res & 0xFF ); | |
| 708 | 708 | mycycles += 7; |
| 709 | 709 | break; |
| 710 | 710 | case 0x02: /* Flags affected: CZS0---- */ |
| 711 | OP_SRA8( sm85cpu_mem_readbyte( s1 ) ); | |
| 712 | sm85cpu_mem_writebyte( s1, res & 0xFF ); | |
| 711 | OP_SRA8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 712 | sm85cpu_mem_writebyte( cpustate, s1, res & 0xFF ); | |
| 713 | 713 | mycycles += 6; |
| 714 | 714 | break; |
| 715 | 715 | case 0x03: /* Flags affected: CZS0---- */ |
| 716 | OP_SLL8( sm85cpu_mem_readbyte( s1 ) ); | |
| 717 | sm85cpu_mem_writebyte( s1, res & 0xFF ); | |
| 716 | OP_SLL8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 717 | sm85cpu_mem_writebyte( cpustate, s1, res & 0xFF ); | |
| 718 | 718 | mycycles += 6; |
| 719 | 719 | break; |
| 720 | 720 | case 0x04: /* Flags affected: CZS----- */ |
| 721 | OP_DA8( sm85cpu_mem_readbyte( s1 ) ); | |
| 722 | sm85cpu_mem_writebyte( s1, res & 0xFF ); | |
| 721 | OP_DA8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 722 | sm85cpu_mem_writebyte( cpustate, s1, res & 0xFF ); | |
| 723 | 723 | mycycles += 7; |
| 724 | 724 | break; |
| 725 | 725 | case 0x05: /* Flags affected: -------- */ |
| 726 | OP_SWAP8( sm85cpu_mem_readbyte( s1 ) ); | |
| 727 | sm85cpu_mem_writebyte( s1, res & 0xFF ); | |
| 726 | OP_SWAP8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 727 | sm85cpu_mem_writebyte( cpustate, s1, res & 0xFF ); | |
| 728 | 728 | mycycles += 9; |
| 729 | 729 | break; |
| 730 | 730 | case 0x06: /* Flags affected: -------- */ |
| 731 | PUSH8( sm85cpu_mem_readbyte( s1 ) ); | |
| 732 | mycycles += ( ( regs.SYS & 0x40 ) ? 13 : 8 ); | |
| 731 | PUSH8( sm85cpu_mem_readbyte( cpustate, s1 ) ); | |
| 732 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 13 : 8 ); | |
| 733 | 733 | break; |
| 734 | 734 | case 0x07: /* Flags affected: -------- */ |
| 735 | 735 | POP8( res ); |
| 736 | sm85cpu_mem_writebyte( s1, res ); | |
| 737 | mycycles += ( ( regs.SYS & 0x40 ) ? 12 : 11 ); | |
| 736 | sm85cpu_mem_writebyte( cpustate, s1, res ); | |
| 737 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 12 : 11 ); | |
| 738 | 738 | break; |
| 739 | 739 | } |
| 740 | 740 | break; |
| 741 | 741 | case 0x1C: /* BCLR 0xFFdd/d8(r),#b - 12,8 cycles - Flags affected: -------- */ |
| 742 | 742 | ARG_riB; |
| 743 | sm85cpu_mem_writebyte( s1, sm85cpu_mem_readbyte( s1 ) & ~s2 ); | |
| 743 | sm85cpu_mem_writebyte( cpustate, s1, sm85cpu_mem_readbyte( cpustate, s1 ) & ~s2 ); | |
| 744 | 744 | mycycles += ( ( r1 & 0x38 ) ? 8 : 12 ); |
| 745 | 745 | break; |
| 746 | 746 | case 0x1D: /* BSET 0xFFdd/d8(r),#b - 12,8 cycles - Flags affected: -------- */ |
| 747 | 747 | ARG_riB; |
| 748 | sm85cpu_mem_writebyte( s1, sm85cpu_mem_readbyte( s1 ) | s2 ); | |
| 748 | sm85cpu_mem_writebyte( cpustate, s1, sm85cpu_mem_readbyte( cpustate, s1 ) | s2 ); | |
| 749 | 749 | mycycles += ( ( r1 & 0x38 ) ? 8 : 12 ); |
| 750 | 750 | break; |
| 751 | 751 | case 0x1E: /* PUSHW S - 12,9 cycles - Flags affected: -------- */ |
| 752 | 752 | ARG_R; |
| 753 | PUSH8( sm85cpu_mem_readbyte( r1 + 1 ) ); | |
| 754 | PUSH8( sm85cpu_mem_readbyte( r1 ) ); | |
| 755 | mycycles += ( ( regs.SYS & 0x40 ) ? 12 : 9 ); | |
| 753 | PUSH8( sm85cpu_mem_readbyte( cpustate, r1 + 1 ) ); | |
| 754 | PUSH8( sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 755 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 12 : 9 ); | |
| 756 | 756 | break; |
| 757 | 757 | case 0x1F: /* POPW S - 12,13 cycles - Flags affected: -------- */ |
| 758 | 758 | ARG_R; |
| 759 | 759 | POP8( r2 ); |
| 760 | sm85cpu_mem_writebyte( r1, r2 ); | |
| 760 | sm85cpu_mem_writebyte( cpustate, r1, r2 ); | |
| 761 | 761 | POP8( r2 ); |
| 762 | sm85cpu_mem_writebyte( r1 + 1, r2 ); | |
| 763 | mycycles += ( ( regs.SYS & 0x40 ) ? 12 : 13 ); | |
| 762 | sm85cpu_mem_writebyte( cpustate, r1 + 1, r2 ); | |
| 763 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 12 : 13 ); | |
| 764 | 764 | break; |
| 765 | 765 | case 0x20: /* CMP r,@r / CMP r,(r)+ / CMP r,@w / CMP r,w(r) / CMP r,-(r) - 7,8,10,8,9 cycles - Flags affected: CZSV---- */ |
| 766 | 766 | ARG_rmb; |
| 767 | OP_CMP8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 767 | OP_CMP8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 768 | 768 | switch( r2 & 0xC0 ) { |
| 769 | 769 | case 0x00: mycycles += 7; break; |
| 770 | 770 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 774 | 774 | break; |
| 775 | 775 | case 0x21: /* ADD r,@r / ADD r,(r)+ / ADD r,@w / ADD r,w(r) / ADD r,-(r) - 7,8,10,8,9 cycles - Flags affected: CZSV0H-- */ |
| 776 | 776 | ARG_rmb; |
| 777 | OP_ADD8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 778 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 777 | OP_ADD8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 778 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 779 | 779 | switch( r2 & 0xC0 ) { |
| 780 | 780 | case 0x00: mycycles += 7; break; |
| 781 | 781 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 785 | 785 | break; |
| 786 | 786 | case 0x22: /* SUB r,@r / SUB r,(r)+ / SUB r,@w / SUB r,w(r) / SUB r,-(r) - 7,8,10,8,9 cycles - Flags affected: CZSV1H-- */ |
| 787 | 787 | ARG_rmb; |
| 788 | OP_SUB8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 789 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 788 | OP_SUB8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 789 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 790 | 790 | switch( r2 & 0xC0 ) { |
| 791 | 791 | case 0x00: mycycles += 7; break; |
| 792 | 792 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 796 | 796 | break; |
| 797 | 797 | case 0x23: /* ADC r,@r / ADC r,(r)+ / ADC r,@w / ADC r,w(r) / ADC r,-(r) - 7,8,10,8,9 cycles - Flags affected: CZSV0H-- */ |
| 798 | 798 | ARG_rmb; |
| 799 | OP_ADC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 800 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 799 | OP_ADC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 800 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 801 | 801 | switch( r2 & 0xC0 ) { |
| 802 | 802 | case 0x00: mycycles += 7; break; |
| 803 | 803 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 807 | 807 | break; |
| 808 | 808 | case 0x24: /* SBC r,@r / SBC r,(r)+ / SBC r,@w / SBC r,w(r) / SBC r,-(r) - 7,8,10,8,9 cycles - Flags affected: CZSV1H-- */ |
| 809 | 809 | ARG_rmb; |
| 810 | OP_SBC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 811 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 810 | OP_SBC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 811 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 812 | 812 | switch( r2 & 0xC0 ) { |
| 813 | 813 | case 0x00: mycycles += 7; break; |
| 814 | 814 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 818 | 818 | break; |
| 819 | 819 | case 0x25: /* AND r,@r / AND r,(r)+ / AND r,@w / AND r,w(r) / AND r,-(r) - 7,8,10,8,9 cycles - Flags affected: -ZS0---- */ |
| 820 | 820 | ARG_rmb; |
| 821 | OP_AND8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 822 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 821 | OP_AND8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 822 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 823 | 823 | switch( r2 & 0xC0 ) { |
| 824 | 824 | case 0x00: mycycles += 7; break; |
| 825 | 825 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 829 | 829 | break; |
| 830 | 830 | case 0x26: /* OR r,@r / OR r,(r)+ / OR r,@w / OR r,w(r) / OR r,-(r) - 7,8,10,8,9 cycles - Flags affected: -ZS0---- */ |
| 831 | 831 | ARG_rmb; |
| 832 | OP_OR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 833 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 832 | OP_OR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 833 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 834 | 834 | switch( r2 & 0xC0 ) { |
| 835 | 835 | case 0x00: mycycles += 7; break; |
| 836 | 836 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 840 | 840 | break; |
| 841 | 841 | case 0x27: /* XOR r,@r / XOR r,(r)+ / XOR r,@w / XOR r,w(r) / XOR r,-(r) - 7,8,10,8,9 cycles - Flags affected: -ZS0---- */ |
| 842 | 842 | ARG_rmb; |
| 843 | OP_XOR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 844 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 843 | OP_XOR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 844 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 845 | 845 | switch( r2 & 0xC0 ) { |
| 846 | 846 | case 0x00: mycycles += 7; break; |
| 847 | 847 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 851 | 851 | break; |
| 852 | 852 | case 0x28: /* MOV r,@r / MOV r,(r)+ / MOV r,@w / MOV r,w(r) / MOV r,-(r) - 6,7,10,7,8 cycles - Flags affected: -------- */ |
| 853 | 853 | ARG_rmb; |
| 854 | sm85cpu_mem_writebyte( r1, sm85cpu_mem_readbyte( s2 ) ); | |
| 854 | sm85cpu_mem_writebyte( cpustate, r1, sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 855 | 855 | switch( r2 & 0xC0 ) { |
| 856 | 856 | case 0x00: mycycles += 6; break; |
| 857 | 857 | case 0x40: mycycles += 7; break; |
| r3957 | r3958 | |
| 861 | 861 | break; |
| 862 | 862 | case 0x29: /* MOV @r,r / MOV (r)+,r / MOV @w,r / MOV w(r),r / MOV -(r),r - 8,8,10,9,9 cycles - Flags affected: -------- */ |
| 863 | 863 | ARG_rmb; |
| 864 | sm85cpu_mem_writebyte( s2, sm85cpu_mem_readbyte( r1 ) ); | |
| 864 | sm85cpu_mem_writebyte( cpustate, s2, sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 865 | 865 | switch( r2 & 0xC0 ) { |
| 866 | 866 | case 0x00: mycycles += 8; break; |
| 867 | 867 | case 0x40: mycycles += 8; break; |
| r3957 | r3958 | |
| 871 | 871 | break; |
| 872 | 872 | case 0x2A: /* BBC FFii/i(Rr),#b,d8 - 16,12/14,10 cycles - Flags affected: -------- */ |
| 873 | 873 | ARG_riBd; |
| 874 | if ( sm85cpu_mem_readbyte( s1 ) & s2 ) { | |
| 874 | if ( sm85cpu_mem_readbyte( cpustate, s1 ) & s2 ) { | |
| 875 | 875 | mycycles += 10; |
| 876 | 876 | } else { |
| 877 | | |
| 877 | cpustate->PC = cpustate->PC + ((INT8)d1); | |
| 878 | 878 | mycycles += 14; |
| 879 | 879 | } |
| 880 | 880 | if ( ( r1 & 0x38 ) == 0 ) { |
| r3957 | r3958 | |
| 883 | 883 | break; |
| 884 | 884 | case 0x2B: /* BBS FFii/i(Rr),#b,d8 - 16,12/14,10 cycles - Flags affected: -------- */ |
| 885 | 885 | ARG_riBd; |
| 886 | if ( sm85cpu_mem_readbyte( s1 ) & s2 ) { | |
| 887 | regs.PC = regs.PC + ((INT8)d1); | |
| 886 | if ( sm85cpu_mem_readbyte( cpustate, s1 ) & s2 ) { | |
| 887 | cpustate->PC = cpustate->PC + ((INT8)d1); | |
| 888 | 888 | mycycles += 14; |
| 889 | 889 | } else { |
| 890 | 890 | mycycles += 10; |
| r3957 | r3958 | |
| 895 | 895 | break; |
| 896 | 896 | case 0x2C: /* EXTS Rr - 6 cycles - Flags affected: -------- */ |
| 897 | 897 | ARG_R; |
| 898 | res = sm85cpu_mem_readword( r1 ); | |
| 898 | res = sm85cpu_mem_readword( cpustate, r1 ); | |
| 899 | 899 | if ( res & 0x80 ) { |
| 900 | 900 | res = res | 0xFF00; |
| 901 | 901 | } else { |
| 902 | 902 | res = res & 0x00FF; |
| 903 | 903 | } |
| 904 | sm85cpu_mem_writeword( r1, res ); | |
| 904 | sm85cpu_mem_writeword( cpustate, r1, res ); | |
| 905 | 905 | mycycles += 6; |
| 906 | 906 | break; |
| 907 | 907 | case 0x2D: /* unk2D - 4 cycles */ |
| 908 | logerror( "%04X: unk%02x\n", | |
| 908 | logerror( "%04X: unk%02x\n", cpustate->PC-1,op ); | |
| 909 | 909 | mycycles += 4; |
| 910 | 910 | break; |
| 911 | 911 | case 0x2E: /* MOV PS0,#00 - 4 cycles - Flags affected: -------- */ |
| 912 | 912 | ARG_R; |
| 913 | | |
| 913 | cpustate->PS0 = r1; cpustate->register_base = cpustate->internal_ram + ( r1 & 0xF8 ); | |
| 914 | 914 | mycycles += 4; |
| 915 | 915 | break; |
| 916 | 916 | case 0x2F: /* BTST R,i - 6 cycles - Flags affected: -Z-0---- */ |
| 917 | 917 | ARG_RR; |
| 918 | regs.PS1 = regs.PS1 & ~ FLAG_V; | |
| 919 | if ( ( sm85cpu_mem_readbyte( r2 ) & r1 ) == 0x00 ) { | |
| 920 | regs.PS1 = regs.PS1 | FLAG_Z; | |
| 918 | cpustate->PS1 = cpustate->PS1 & ~ FLAG_V; | |
| 919 | if ( ( sm85cpu_mem_readbyte( cpustate, r2 ) & r1 ) == 0x00 ) { | |
| 920 | cpustate->PS1 = cpustate->PS1 | FLAG_Z; | |
| 921 | 921 | } else { |
| 922 | | |
| 922 | cpustate->PS1 = cpustate->PS1 & ( ~ FLAG_Z ); | |
| 923 | 923 | } |
| 924 | 924 | mycycles += 6; |
| 925 | 925 | break; |
| 926 | 926 | case 0x30: /* CMP r,@rr / CMP r,(rr)+ / CMP r,@ww / CMP r,ww(rr) / CMP r,-(rr) - 8,13,11,15,13 cycles - Flags affected: CZSV---- */ |
| 927 | 927 | ARG_rmw; |
| 928 | OP_CMP8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 928 | OP_CMP8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 929 | 929 | switch( r2 & 0xC0 ) { |
| 930 | 930 | case 0x00: mycycles += 8; break; |
| 931 | 931 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 935 | 935 | break; |
| 936 | 936 | case 0x31: /* ADD r,@rr / ADD r,(rr)+ / ADD r,@ww / ADD r,ww(rr) / ADD r,-(rr) - 8,13,11,15,13 cycles - Flags affected: CZSV0H-- */ |
| 937 | 937 | ARG_rmw; |
| 938 | OP_ADD8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 939 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 938 | OP_ADD8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 939 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 940 | 940 | switch( r2 & 0xC0 ) { |
| 941 | 941 | case 0x00: mycycles += 8; break; |
| 942 | 942 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 946 | 946 | break; |
| 947 | 947 | case 0x32: /* SUB r,@rr / SUB r,(rr)+ / SUB r,@ww / SUB r,ww(rr) / SUB r,-(rr) - 8,13,11,15,13 cycles - Flags affected: CZSV1H-- */ |
| 948 | 948 | ARG_rmw; |
| 949 | OP_SUB8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 949 | OP_SUB8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 950 | 950 | switch( r2 & 0xC0 ) { |
| 951 | 951 | case 0x00: mycycles += 8; break; |
| 952 | 952 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 956 | 956 | break; |
| 957 | 957 | case 0x33: /* ADC r,@rr / ADC r,(rr)+ / ADC r,@ww / ADC r,ww(rr) / ADC r,-(rr) - 8,13,11,15,13 cycles - Flags affected: CZSV0H-- */ |
| 958 | 958 | ARG_rmw; |
| 959 | OP_ADC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 960 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 959 | OP_ADC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 960 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 961 | 961 | switch( r2 & 0xC0 ) { |
| 962 | 962 | case 0x00: mycycles += 8; break; |
| 963 | 963 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 967 | 967 | break; |
| 968 | 968 | case 0x34: /* SBC r,@rr / SBC r,(rr)+ / SBC r,@ww / SBC r,ww(rr) / SBC r,-(rr) - 8,13,11,15,13 cycles - Flags affected: CZSV1H-- */ |
| 969 | 969 | ARG_rmw; |
| 970 | OP_SBC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 971 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 970 | OP_SBC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 971 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 972 | 972 | switch( r2 & 0xC0 ) { |
| 973 | 973 | case 0x00: mycycles += 8; break; |
| 974 | 974 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 978 | 978 | break; |
| 979 | 979 | case 0x35: /* AND r,@rr / AND r,(rr)+ / AND r,@ww / AND r,ww(rr) / AND r,-(rr) - 8,13,11,15,13 cycles - Flags affected: -ZS0---- */ |
| 980 | 980 | ARG_rmw; |
| 981 | OP_AND8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 982 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 981 | OP_AND8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 982 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 983 | 983 | switch( r2 & 0xC0 ) { |
| 984 | 984 | case 0x00: mycycles += 8; break; |
| 985 | 985 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 989 | 989 | break; |
| 990 | 990 | case 0x36: /* OR r,@rr / OR r,(rr)+ / OR r,@ww / OR r,ww(rr) / OR r,-(rr) - 8,13,11,15,13 cycles - Flags affected: -ZS0---- */ |
| 991 | 991 | ARG_rmw; |
| 992 | OP_OR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 993 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 992 | OP_OR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 993 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 994 | 994 | switch( r2 & 0xC0 ) { |
| 995 | 995 | case 0x00: mycycles += 8; break; |
| 996 | 996 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 1000 | 1000 | break; |
| 1001 | 1001 | case 0x37: /* XOR? r,@rr / XOR r,(rr)+ / XOR r,@ww / XOR r,ww(rr) / XOR r,-(rr) - 8,13,11,15,13 cycles - Flagsaffected: -ZS0---- */ |
| 1002 | 1002 | ARG_rmw; |
| 1003 | OP_XOR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( s2 ) ); | |
| 1004 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1003 | OP_XOR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 1004 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1005 | 1005 | switch( r2 & 0xC0 ) { |
| 1006 | 1006 | case 0x00: mycycles += 8; break; |
| 1007 | 1007 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 1011 | 1011 | break; |
| 1012 | 1012 | case 0x38: /* MOV r,@rr / MOV r,(rr)+ / MOV r,@ww / MOV r,ww(rr) / MOV r,-(rr) - 8,13,11,15,13 cycles - Flags affected: -------- */ |
| 1013 | 1013 | ARG_rmw; |
| 1014 | sm85cpu_mem_writebyte( r1, sm85cpu_mem_readbyte( s2 ) ); | |
| 1014 | sm85cpu_mem_writebyte( cpustate, r1, sm85cpu_mem_readbyte( cpustate, s2 ) ); | |
| 1015 | 1015 | switch( r2 & 0xC0 ) { |
| 1016 | 1016 | case 0x00: mycycles += 8; break; |
| 1017 | 1017 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 1021 | 1021 | break; |
| 1022 | 1022 | case 0x39: /* MOV @rr,r / MOV (rr)+,r / MOV @ww,r / MOV ww(rr),r / MOV -(rr),r - 8,13,11,15,13 cycles - Flags affected: -------- */ |
| 1023 | 1023 | ARG_rmw; |
| 1024 | sm85cpu_mem_writebyte( s2, sm85cpu_mem_readbyte( r1 ) ); | |
| 1024 | sm85cpu_mem_writebyte( cpustate, s2, sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 1025 | 1025 | switch( r2 & 0xC0 ) { |
| 1026 | 1026 | case 0x00: mycycles += 8; break; |
| 1027 | 1027 | case 0x40: mycycles += 13; break; |
| r3957 | r3958 | |
| 1031 | 1031 | break; |
| 1032 | 1032 | case 0x3A: /* MOVW rr,@rr / MOV rr,(rr)+ / MOV rr,@ww / MOV rr,ww(rr) / MOV rr,-(rr) - 11,16,14,18,16 cycles - Flags affected: -------- */ |
| 1033 | 1033 | ARG_smw; |
| 1034 | sm85cpu_mem_writeword( r1, sm85cpu_mem_readword( s2 ) ); | |
| 1034 | sm85cpu_mem_writeword( cpustate, r1, sm85cpu_mem_readword( cpustate, s2 ) ); | |
| 1035 | 1035 | switch( r2 & 0xC0 ) { |
| 1036 | 1036 | case 0x00: mycycles += 11; break; |
| 1037 | 1037 | case 0x40: mycycles += 16; break; |
| r3957 | r3958 | |
| 1041 | 1041 | break; |
| 1042 | 1042 | case 0x3B: /* MOVW @rr,rr / MOV (rr)+,rr / MOV @ww,rr / MOV ww(rr),rr / MOV -(rr),rr - 11,16,14,18,16 cycles - Flags affected: -------- */ |
| 1043 | 1043 | ARG_smw; |
| 1044 | sm85cpu_mem_writeword( s2, sm85cpu_mem_readword( r1 ) ); | |
| 1044 | sm85cpu_mem_writeword( cpustate, s2, sm85cpu_mem_readword( cpustate, r1 ) ); | |
| 1045 | 1045 | switch( r2 & 0xC0 ) { |
| 1046 | 1046 | case 0x00: mycycles += 11; break; |
| 1047 | 1047 | case 0x40: mycycles += 16; break; |
| r3957 | r3958 | |
| 1051 | 1051 | break; |
| 1052 | 1052 | case 0x3C: /* MOVW RRr,RRs - 7 cycles - Flags affected: -------- */ |
| 1053 | 1053 | ARG_ss; |
| 1054 | sm85cpu_mem_writeword( r1, sm85cpu_mem_readword( r2 ) ); | |
| 1054 | sm85cpu_mem_writeword( cpustate, r1, sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1055 | 1055 | mycycles += 7; |
| 1056 | 1056 | break; |
| 1057 | 1057 | case 0x3D: /* unk3D DM??? 3D 0E -> DM R0Eh ?? - 4,4 cycles */ |
| 1058 | logerror( "%04X: unk%02x\n", | |
| 1058 | logerror( "%04X: unk%02x\n", cpustate->PC-1,op ); | |
| 1059 | 1059 | mycycles += 4; |
| 1060 | 1060 | break; |
| 1061 | 1061 | case 0x3E: /* JMP RRr/@ww/ww(RRr) - 7/15/19 cycles - Flags affected: -------- */ |
| 1062 | 1062 | ARG_2; |
| 1063 | | |
| 1063 | cpustate->PC = s2; | |
| 1064 | 1064 | switch( r1 & 0xc0 ) { |
| 1065 | 1065 | case 0x00: mycycles += 7; break; |
| 1066 | 1066 | case 0x40: mycycles += ( ( r1 & 0x38 ) ? 19 : 15 ); break; |
| r3957 | r3958 | |
| 1069 | 1069 | break; |
| 1070 | 1070 | case 0x3F: /* CALL RRr/@ww/ww(RRr) - 11,14/22,19/26,23 cycles - Flags affected: -------- */ |
| 1071 | 1071 | ARG_2; |
| 1072 | PUSH8( regs.PC & 0xFF ); | |
| 1073 | PUSH8( regs.PC >> 8 ); | |
| 1074 | regs.PC = s2; | |
| 1072 | PUSH8( cpustate->PC & 0xFF ); | |
| 1073 | PUSH8( cpustate->PC >> 8 ); | |
| 1074 | cpustate->PC = s2; | |
| 1075 | 1075 | switch( r1 & 0xc0 ) { |
| 1076 | case 0x00: mycycles += ( ( regs.SYS & 0x40 ) ? 14 : 11 ); break; | |
| 1077 | case 0x40: mycycles += ( ( r1 & 0x38 ) ? ( ( regs.SYS & 0x40 ) ? 26 : 23 ) : ( ( regs.SYS & 0x40 ) ? 22 : 19 ) );break; | |
| 1076 | case 0x00: mycycles += ( ( cpustate->SYS & 0x40 ) ? 14 : 11 ); break; | |
| 1077 | case 0x40: mycycles += ( ( r1 & 0x38 ) ? ( ( cpustate->SYS & 0x40 ) ? 26 : 23 ) : ( ( cpustate->SYS & 0x40 ) ? 22 : 19 ) );break; | |
| 1078 | 1078 | default: mycycles += 4; |
| 1079 | 1079 | } |
| 1080 | 1080 | break; |
| 1081 | 1081 | case 0x40: /* CMP Rr,Rs - 6 cycles - Flags affected: CZSV---- */ |
| 1082 | 1082 | ARG_RR; |
| 1083 | OP_CMP8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1083 | OP_CMP8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1084 | 1084 | mycycles += 6; |
| 1085 | 1085 | break; |
| 1086 | 1086 | case 0x41: /* ADD Rr,Rs - 6 cycles - Flags affected: CZSV0H-- */ |
| 1087 | 1087 | ARG_RR; |
| 1088 | OP_ADD8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1089 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1088 | OP_ADD8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1089 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1090 | 1090 | mycycles += 6; |
| 1091 | 1091 | break; |
| 1092 | 1092 | case 0x42: /* SUB Rr,Rs - 6 cycles - Flags affected: CZSV1H-- */ |
| 1093 | 1093 | ARG_RR; |
| 1094 | OP_SUB8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1095 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1094 | OP_SUB8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1095 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1096 | 1096 | mycycles += 6; |
| 1097 | 1097 | break; |
| 1098 | 1098 | case 0x43: /* ADC Rr,Rs - 6 cycles - Flags affected: CZSV0H-- */ |
| 1099 | 1099 | ARG_RR; |
| 1100 | OP_ADC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1101 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1100 | OP_ADC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1101 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1102 | 1102 | mycycles += 6; |
| 1103 | 1103 | break; |
| 1104 | 1104 | case 0x44: /* SBC Rr,Rs - 6 cycles - Flags affected: CZSV1H-- */ |
| 1105 | 1105 | ARG_RR; |
| 1106 | OP_SBC8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1107 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1106 | OP_SBC8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1107 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1108 | 1108 | mycycles += 6; |
| 1109 | 1109 | break; |
| 1110 | 1110 | case 0x45: /* AND Rr,Rs - 6 cycles - Flags affected: -ZS0---- */ |
| 1111 | 1111 | ARG_RR; |
| 1112 | OP_AND8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1113 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1112 | OP_AND8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1113 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1114 | 1114 | mycycles += 6; |
| 1115 | 1115 | break; |
| 1116 | 1116 | case 0x46: /* OR Rr,Rs - 6 cycles - Flags affected: -ZS0---- */ |
| 1117 | 1117 | ARG_RR; |
| 1118 | OP_OR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1119 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1118 | OP_OR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1119 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1120 | 1120 | mycycles += 6; |
| 1121 | 1121 | break; |
| 1122 | 1122 | case 0x47: /* XOR Rr,Rs - 6 cycles - Flags affected: -ZS0---- */ |
| 1123 | 1123 | ARG_RR; |
| 1124 | OP_XOR8( sm85cpu_mem_readbyte( r1 ), sm85cpu_mem_readbyte( r2 ) ); | |
| 1125 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1124 | OP_XOR8( sm85cpu_mem_readbyte( cpustate, r1 ), sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1125 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1126 | 1126 | mycycles += 6; |
| 1127 | 1127 | break; |
| 1128 | 1128 | case 0x48: /* MOV Rr,Rs - 6 cycles - Flags affected: -------- */ |
| 1129 | 1129 | ARG_RR; |
| 1130 | sm85cpu_mem_writebyte( r1, sm85cpu_mem_readbyte( r2 ) ); | |
| 1130 | sm85cpu_mem_writebyte( cpustate, r1, sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1131 | 1131 | mycycles += 6; |
| 1132 | 1132 | break; |
| 1133 | 1133 | case 0x49: /* CALL ad16 - 12,10 - Flags affected: -------- */ |
| 1134 | 1134 | ARG_ad16; |
| 1135 | PUSH8( regs.PC & 0xFF ); | |
| 1136 | PUSH8( regs.PC >> 8 ); | |
| 1137 | regs.PC = s2; | |
| 1138 | mycycles += ( ( regs.SYS & 0x40 ) ? 12 : 10 ); | |
| 1135 | PUSH8( cpustate->PC & 0xFF ); | |
| 1136 | PUSH8( cpustate->PC >> 8 ); | |
| 1137 | cpustate->PC = s2; | |
| 1138 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 12 : 10 ); | |
| 1139 | 1139 | break; |
| 1140 | 1140 | case 0x4A: /* MOVW RRr,RRs - 8 cycles - Flags affected: -------- */ |
| 1141 | 1141 | ARG_RR; |
| 1142 | sm85cpu_mem_writeword( r1, sm85cpu_mem_readword( r2 ) ); | |
| 1142 | sm85cpu_mem_writeword( cpustate, r1, sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1143 | 1143 | mycycles += 8; |
| 1144 | 1144 | break; |
| 1145 | 1145 | case 0x4B: /* MOVW RRr,ww - 9 cycles - Flags affected: -------- */ |
| 1146 | 1146 | ARG_Sw; |
| 1147 | sm85cpu_mem_writeword( r1, s2 ); | |
| 1147 | sm85cpu_mem_writeword( cpustate, r1, s2 ); | |
| 1148 | 1148 | mycycles += 9; |
| 1149 | 1149 | break; |
| 1150 | 1150 | case 0x4C: /* MULT Rrr,Rs - 24 cycles - Flags affected: -Z-0---- */ |
| 1151 | 1151 | ARG_RR; |
| 1152 | res = sm85cpu_mem_readword( r1 ) * sm85cpu_mem_readbyte( r2 ); | |
| 1153 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1154 | regs.PS1 = regs.PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1155 | regs.PS1 |= ( ( res & 0xFFFF ) == 0x00 ? FLAG_Z : 0 ); | |
| 1152 | res = sm85cpu_mem_readword( cpustate, r1 ) * sm85cpu_mem_readbyte( cpustate, r2 ); | |
| 1153 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1154 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1155 | cpustate->PS1 |= ( ( res & 0xFFFF ) == 0x00 ? FLAG_Z : 0 ); | |
| 1156 | 1156 | mycycles += 24; |
| 1157 | 1157 | break; |
| 1158 | 1158 | case 0x4D: /* MULT RRr,i - 24 cycles - Flags affected: -Z-0---- */ |
| 1159 | 1159 | ARG_iR; |
| 1160 | res = sm85cpu_mem_readbyte( r1 + 1 ) * r2; | |
| 1161 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1162 | regs.PS1 = regs.PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1163 | regs.PS1 |= ( ( res & 0xFFFF ) == 0x00 ? FLAG_Z : 0 ); | |
| 1160 | res = sm85cpu_mem_readbyte( cpustate, r1 + 1 ) * r2; | |
| 1161 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1162 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1163 | cpustate->PS1 |= ( ( res & 0xFFFF ) == 0x00 ? FLAG_Z : 0 ); | |
| 1164 | 1164 | mycycles += 24; |
| 1165 | 1165 | break; |
| 1166 | 1166 | case 0x4E: /* BMOV Rr,#b,BF/BF,Rr,#b - 6 cycles - Flags affected: --------/-Z-0--B- */ |
| 1167 | r2 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 1168 | r1 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 1167 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 1168 | r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 1169 | 1169 | switch( r2 & 0xC0 ) { |
| 1170 | 1170 | case 0x00: |
| 1171 | res = sm85cpu_mem_readbyte( r1 ); | |
| 1172 | if ( regs.PS1 & FLAG_B ) { | |
| 1171 | res = sm85cpu_mem_readbyte( cpustate, r1 ); | |
| 1172 | if ( cpustate->PS1 & FLAG_B ) { | |
| 1173 | 1173 | res = res | ( 1 << ( r2 & 0x07 ) ); |
| 1174 | 1174 | } else { |
| 1175 | 1175 | res = res & ~( 1 << ( r2 & 0x07 ) ); |
| 1176 | 1176 | } |
| 1177 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1177 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1178 | 1178 | break; |
| 1179 | 1179 | case 0x40: |
| 1180 | regs.PS1 = regs.PS1 & ( FLAG_C | FLAG_S | FLAG_D | FLAG_H | FLAG_I ); | |
| 1181 | if ( sm85cpu_mem_readbyte( r1 ) & ( 1 << ( r2 & 0x07 ) ) ) { | |
| 1182 | regs.PS1 = regs.PS1 | FLAG_B; | |
| 1180 | cpustate->PS1 = cpustate->PS1 & ( FLAG_C | FLAG_S | FLAG_D | FLAG_H | FLAG_I ); | |
| 1181 | if ( sm85cpu_mem_readbyte( cpustate, r1 ) & ( 1 << ( r2 & 0x07 ) ) ) { | |
| 1182 | cpustate->PS1 = cpustate->PS1 | FLAG_B; | |
| 1183 | 1183 | } else { |
| 1184 | | |
| 1184 | cpustate->PS1 = cpustate->PS1 | FLAG_Z; | |
| 1185 | 1185 | } |
| 1186 | 1186 | break; |
| 1187 | 1187 | case 0x80: |
| r3957 | r3958 | |
| 1191 | 1191 | mycycles += 6; |
| 1192 | 1192 | break; |
| 1193 | 1193 | case 0x4F: /* BCMP/BAND/BOR/BXOR BF,Rr,#b - 6 cycles - Flags affected: -Z-0---- / -Z-0--B- */ |
| 1194 | r2 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 1195 | r1 = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 1196 | s1 = sm85cpu_mem_readbyte( r1 ) & ( 1 << ( r2 & 0x07 ) ); | |
| 1197 | s2 = ( ( regs.PS1 & FLAG_B ) >> 1 ) << ( r2 & 0x07 ); | |
| 1194 | r2 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 1195 | r1 = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 1196 | s1 = sm85cpu_mem_readbyte( cpustate, r1 ) & ( 1 << ( r2 & 0x07 ) ); | |
| 1197 | s2 = ( ( cpustate->PS1 & FLAG_B ) >> 1 ) << ( r2 & 0x07 ); | |
| 1198 | 1198 | switch( r2 & 0xC0 ) { |
| 1199 | 1199 | case 0x00: |
| 1200 | | |
| 1200 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1201 | 1201 | if ( s1 == s2 ) { |
| 1202 | | |
| 1202 | cpustate->PS1 = cpustate->PS1 | FLAG_Z; | |
| 1203 | 1203 | } |
| 1204 | 1204 | break; |
| 1205 | 1205 | case 0x40: |
| 1206 | regs.PS1 = regs.PS1 & ~ ( FLAG_Z | FLAG_V | FLAG_B ); | |
| 1207 | regs.PS1 = regs.PS1 | ( ( s1 & s2 ) ? FLAG_B : FLAG_Z ); | |
| 1206 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V | FLAG_B ); | |
| 1207 | cpustate->PS1 = cpustate->PS1 | ( ( s1 & s2 ) ? FLAG_B : FLAG_Z ); | |
| 1208 | 1208 | break; |
| 1209 | 1209 | case 0x80: |
| 1210 | regs.PS1 = regs.PS1 & ~ ( FLAG_Z | FLAG_V | FLAG_B ); | |
| 1211 | regs.PS1 = regs.PS1 | ( ( s1 | s2 ) ? FLAG_B : FLAG_Z ); | |
| 1210 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V | FLAG_B ); | |
| 1211 | cpustate->PS1 = cpustate->PS1 | ( ( s1 | s2 ) ? FLAG_B : FLAG_Z ); | |
| 1212 | 1212 | break; |
| 1213 | 1213 | case 0xC0: |
| 1214 | regs.PS1 = regs.PS1 & ~ ( FLAG_Z | FLAG_V | FLAG_B ); | |
| 1215 | regs.PS1 = regs.PS1 | ( ( s1 ^ s2 ) ? FLAG_B : FLAG_Z ); | |
| 1214 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V | FLAG_B ); | |
| 1215 | cpustate->PS1 = cpustate->PS1 | ( ( s1 ^ s2 ) ? FLAG_B : FLAG_Z ); | |
| 1216 | 1216 | break; |
| 1217 | 1217 | } |
| 1218 | 1218 | mycycles += 6; |
| 1219 | 1219 | break; |
| 1220 | 1220 | case 0x50: /* CMP Rr,i - 6 cycles - Flags affected: CZSV---- */ |
| 1221 | 1221 | ARG_iR; |
| 1222 | OP_CMP8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1222 | OP_CMP8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1223 | 1223 | mycycles += 6; |
| 1224 | 1224 | break; |
| 1225 | 1225 | case 0x51: /* ADD Rr,i - 6 cycles - Flags affected: CZSV0H-- */ |
| 1226 | 1226 | ARG_iR; |
| 1227 | OP_ADD8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1228 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1227 | OP_ADD8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1228 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1229 | 1229 | mycycles += 6; |
| 1230 | 1230 | break; |
| 1231 | 1231 | case 0x52: /* SUB Rr,i - 6 cycles - Flags affected: CZSV1H-- */ |
| 1232 | 1232 | ARG_iR; |
| 1233 | OP_SUB8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1234 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1233 | OP_SUB8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1234 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1235 | 1235 | mycycles += 6; |
| 1236 | 1236 | break; |
| 1237 | 1237 | case 0x53: /* ADC Rr,i - 6 cycles - Flags affected: CZSV0H-- */ |
| 1238 | 1238 | ARG_iR; |
| 1239 | OP_ADC8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1240 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1239 | OP_ADC8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1240 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1241 | 1241 | mycycles += 6; |
| 1242 | 1242 | break; |
| 1243 | 1243 | case 0x54: /* SBC Rr,i - 6 cycles - Flags affected: CZSV1H-- */ |
| 1244 | 1244 | ARG_iR; |
| 1245 | OP_SBC8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1246 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1245 | OP_SBC8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1246 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1247 | 1247 | mycycles += 6; |
| 1248 | 1248 | break; |
| 1249 | 1249 | case 0x55: /* AND Rr,i - 6 cycles - Flags affected: -ZS0---- */ |
| 1250 | 1250 | ARG_iR; |
| 1251 | OP_AND8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1252 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1251 | OP_AND8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1252 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1253 | 1253 | mycycles += 6; |
| 1254 | 1254 | break; |
| 1255 | 1255 | case 0x56: /* OR Rr,i - 6 cycles - Flags affected: -ZS0---- */ |
| 1256 | 1256 | ARG_iR; |
| 1257 | OP_OR8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1258 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1257 | OP_OR8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1258 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1259 | 1259 | mycycles += 6; |
| 1260 | 1260 | break; |
| 1261 | 1261 | case 0x57: /* XOR Rr,i - 6 cycles - Flags affected: -ZS0---- */ |
| 1262 | 1262 | ARG_iR; |
| 1263 | OP_XOR8( sm85cpu_mem_readbyte( r1 ), r2 ); | |
| 1264 | sm85cpu_mem_writebyte( r1, res & 0xFF ); | |
| 1263 | OP_XOR8( sm85cpu_mem_readbyte( cpustate, r1 ), r2 ); | |
| 1264 | sm85cpu_mem_writebyte( cpustate, r1, res & 0xFF ); | |
| 1265 | 1265 | mycycles += 6; |
| 1266 | 1266 | break; |
| 1267 | 1267 | case 0x58: /* MOV Rr,i - 6 cycles - Flags affected: -------- */ |
| 1268 | 1268 | ARG_iR; |
| 1269 | sm85cpu_mem_writebyte( r1, r2 ); | |
| 1269 | sm85cpu_mem_writebyte( cpustate, r1, r2 ); | |
| 1270 | 1270 | mycycles += 6; |
| 1271 | 1271 | break; |
| 1272 | 1272 | case 0x59: /* Invalid - 2? cycles - Flags affected: --------? */ |
| 1273 | logerror( "%04X: 59h: Invalid instruction\n", | |
| 1273 | logerror( "%04X: 59h: Invalid instruction\n", cpustate->PC-1 ); | |
| 1274 | 1274 | mycycles += 2; |
| 1275 | 1275 | break; |
| 1276 | 1276 | case 0x5A: /* unk5A - 7,8,12,9,8 cycles */ |
| 1277 | logerror( "%04X: unk%02x\n", | |
| 1277 | logerror( "%04X: unk%02x\n", cpustate->PC-1,op ); | |
| 1278 | 1278 | ARG_ad16; |
| 1279 | 1279 | mycycles += 7; |
| 1280 | 1280 | break; |
| 1281 | 1281 | case 0x5B: /* unk5B - 6,7,11,8,7 cycles */ |
| 1282 | logerror( "%04X: unk%02x\n", | |
| 1282 | logerror( "%04X: unk%02x\n", cpustate->PC-1,op ); | |
| 1283 | 1283 | ARG_ad16; |
| 1284 | 1284 | mycycles += 6; |
| 1285 | 1285 | break; |
| 1286 | 1286 | case 0x5C: /* DIV RRr,RRs - 47 cycles - Flags affected: -Z-V---- */ |
| 1287 | 1287 | /* lower 8 bits of RRs is used to divide */ |
| 1288 | 1288 | /* remainder in stored upper 8 bits of RRs */ |
| 1289 | logerror( "%04X: DIV RRr,Rs!\n", | |
| 1289 | logerror( "%04X: DIV RRr,Rs!\n", cpustate->PC-1 ); | |
| 1290 | 1290 | ARG_RR; |
| 1291 | regs.PS1 = regs.PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1292 | s1 = sm85cpu_mem_readbyte( r2 + 1 ); | |
| 1291 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1292 | s1 = sm85cpu_mem_readbyte( cpustate, r2 + 1 ); | |
| 1293 | 1293 | if ( s1 ) { |
| 1294 | UINT16 div = sm85cpu_mem_readword( r1 ); | |
| 1294 | UINT16 div = sm85cpu_mem_readword( cpustate, r1 ); | |
| 1295 | 1295 | res = div / s1; |
| 1296 | sm85cpu_mem_writebyte( r2, div % s1 ); | |
| 1297 | sm85cpu_mem_writeword( r1, res ); | |
| 1298 | regs.PS1 = regs.PS1 | ( ( res == 0 ) ? FLAG_Z : 0 ); | |
| 1296 | sm85cpu_mem_writebyte( cpustate, r2, div % s1 ); | |
| 1297 | sm85cpu_mem_writeword( cpustate, r1, res ); | |
| 1298 | cpustate->PS1 = cpustate->PS1 | ( ( res == 0 ) ? FLAG_Z : 0 ); | |
| 1299 | 1299 | } else { |
| 1300 | | |
| 1300 | cpustate->PS1 = cpustate->PS1 | FLAG_V; | |
| 1301 | 1301 | } |
| 1302 | 1302 | mycycles += 47; |
| 1303 | 1303 | break; |
| 1304 | 1304 | case 0x5D: /* DIV RRr,i - 44 cycles - Flags affected: -Z-V---- */ |
| 1305 | logerror( "%04X: DIV RRr,i!\n", | |
| 1305 | logerror( "%04X: DIV RRr,i!\n", cpustate->PC-1 ); | |
| 1306 | 1306 | ARG_iR; |
| 1307 | | |
| 1307 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_Z | FLAG_V ); | |
| 1308 | 1308 | if ( r2 ) { |
| 1309 | res = sm85cpu_mem_readword( r1 ) / r2; | |
| 1310 | sm85cpu_mem_writeword( r1, res ); | |
| 1311 | regs.PS1 = regs.PS1 | ( ( res == 0 ) ? FLAG_Z : 0 ); | |
| 1309 | res = sm85cpu_mem_readword( cpustate, r1 ) / r2; | |
| 1310 | sm85cpu_mem_writeword( cpustate, r1, res ); | |
| 1311 | cpustate->PS1 = cpustate->PS1 | ( ( res == 0 ) ? FLAG_Z : 0 ); | |
| 1312 | 1312 | } else { |
| 1313 | | |
| 1313 | cpustate->PS1 = cpustate->PS1 | FLAG_V; | |
| 1314 | 1314 | } |
| 1315 | 1315 | mycycles += 44; |
| 1316 | 1316 | break; |
| 1317 | 1317 | case 0x5E: /* MOVM Rr,i,Rs - 9 cycles - Flags affected: -------- */ |
| 1318 | 1318 | ARG_RiR; |
| 1319 | sm85cpu_mem_writebyte( r1, ( sm85cpu_mem_readbyte( r1 ) & d1 ) | sm85cpu_mem_readbyte( r2 ) ); | |
| 1319 | sm85cpu_mem_writebyte( cpustate, r1, ( sm85cpu_mem_readbyte( cpustate, r1 ) & d1 ) | sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1320 | 1320 | mycycles += 9; |
| 1321 | 1321 | break; |
| 1322 | 1322 | case 0x5F: /* MOVM Rr,i,j - 8 cycles - Flags affected: -------- */ |
| 1323 | 1323 | ARG_Rii; |
| 1324 | sm85cpu_mem_writebyte( r1, ( sm85cpu_mem_readbyte( r1 ) & d1 ) | r2 ); | |
| 1324 | sm85cpu_mem_writebyte( cpustate, r1, ( sm85cpu_mem_readbyte( cpustate, r1 ) & d1 ) | r2 ); | |
| 1325 | 1325 | mycycles += 8; |
| 1326 | 1326 | break; |
| 1327 | 1327 | case 0x60: /* CMPW RRr,RRs - 9 cycles - Flags affected: CZSV---- */ |
| 1328 | 1328 | ARG_RR; |
| 1329 | OP_CMP16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1329 | OP_CMP16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1330 | 1330 | mycycles += 9; |
| 1331 | 1331 | break; |
| 1332 | 1332 | case 0x61: /* ADDW RRr,RRs - 10 cycles - Flags affected: CZSV0H-- */ |
| 1333 | 1333 | ARG_RR; |
| 1334 | OP_ADD16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1335 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1334 | OP_ADD16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1335 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1336 | 1336 | mycycles += 10; |
| 1337 | 1337 | break; |
| 1338 | 1338 | case 0x62: /* SUBW RRr,RRs - 10 cycles - Flags affected: CZSV1H-- */ |
| 1339 | 1339 | ARG_RR; |
| 1340 | OP_SUB16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1341 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1340 | OP_SUB16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1341 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1342 | 1342 | mycycles += 10; |
| 1343 | 1343 | break; |
| 1344 | 1344 | case 0x63: /* ADCW RRr,RRs - 10 cycles - Flags affected: CZSV0H-- */ |
| 1345 | 1345 | ARG_RR; |
| 1346 | OP_ADC16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1347 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1346 | OP_ADC16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1347 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1348 | 1348 | mycycles += 10; |
| 1349 | 1349 | break; |
| 1350 | 1350 | case 0x64: /* SBCW RRr,RRs - 10 cycles - Flags affected: CZSV1H-- */ |
| 1351 | 1351 | ARG_RR; |
| 1352 | OP_SBC16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1353 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1352 | OP_SBC16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1353 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1354 | 1354 | mycycles += 10; |
| 1355 | 1355 | break; |
| 1356 | 1356 | case 0x65: /* ANDW RRr,RRs - 14 cycles - Flags affected: -Z-0---- */ |
| 1357 | 1357 | ARG_RR; |
| 1358 | OP_AND16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1359 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1358 | OP_AND16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1359 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1360 | 1360 | mycycles += 14; |
| 1361 | 1361 | break; |
| 1362 | 1362 | case 0x66: /* ORW RRr,RRs - 14 cycles - Flags affected: -Z-0---- */ |
| 1363 | 1363 | ARG_RR; |
| 1364 | OP_OR16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1365 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1364 | OP_OR16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1365 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1366 | 1366 | mycycles += 14; |
| 1367 | 1367 | break; |
| 1368 | 1368 | case 0x67: /* XORW RRr,RRs - 14 cycles - Flags affected: -Z-0---- */ |
| 1369 | 1369 | ARG_RR; |
| 1370 | OP_XOR16( sm85cpu_mem_readword( r1 ), sm85cpu_mem_readword( r2 ) ); | |
| 1371 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1370 | OP_XOR16( sm85cpu_mem_readword( cpustate, r1 ), sm85cpu_mem_readword( cpustate, r2 ) ); | |
| 1371 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1372 | 1372 | mycycles += 14; |
| 1373 | 1373 | break; |
| 1374 | 1374 | case 0x68: /* CMPW RRr,w - 9 cycles - Flags affected: CZSV---- */ |
| 1375 | 1375 | ARG_Sw; |
| 1376 | OP_CMP16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1376 | OP_CMP16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1377 | 1377 | mycycles += 9; |
| 1378 | 1378 | break; |
| 1379 | 1379 | case 0x69: /* ADDW RRr,w - 10 cycles - Flags affected: CZSV0H-- */ |
| 1380 | 1380 | ARG_Sw; |
| 1381 | OP_ADD16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1382 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1381 | OP_ADD16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1382 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1383 | 1383 | mycycles += 10; |
| 1384 | 1384 | break; |
| 1385 | 1385 | case 0x6A: /* SUBW RRr,w - 10 cycles - Flags affected: CZSV1H-- */ |
| 1386 | 1386 | ARG_Sw; |
| 1387 | OP_SUB16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1388 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1387 | OP_SUB16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1388 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1389 | 1389 | mycycles += 10; |
| 1390 | 1390 | break; |
| 1391 | 1391 | case 0x6B: /* ADCW RRr,w - 10 cycles - Flags affected: CZSV0H-- */ |
| 1392 | 1392 | ARG_Sw; |
| 1393 | OP_ADC16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1394 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1393 | OP_ADC16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1394 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1395 | 1395 | mycycles += 10; |
| 1396 | 1396 | break; |
| 1397 | 1397 | case 0x6C: /* SBCW RRr,w - 10 cycles - Flags affected: CZSV1H-- */ |
| 1398 | 1398 | ARG_Sw; |
| 1399 | OP_SBC16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1400 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1399 | OP_SBC16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1400 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1401 | 1401 | mycycles += 10; |
| 1402 | 1402 | break; |
| 1403 | 1403 | case 0x6D: /* ANDW RRr,w - 13 cycles - Flags affected: -Z-0---- */ |
| 1404 | 1404 | ARG_Sw; |
| 1405 | OP_AND16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1406 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1405 | OP_AND16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1406 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1407 | 1407 | mycycles += 13; |
| 1408 | 1408 | break; |
| 1409 | 1409 | case 0x6E: /* ORW RRr,w - 13 cycles - Flags affected: -Z-0---- */ |
| 1410 | 1410 | ARG_Sw; |
| 1411 | OP_OR16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1412 | sm85cpu_mem_writeword( r1, res & 0xFFFF ); | |
| 1411 | OP_OR16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1412 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF ); | |
| 1413 | 1413 | mycycles += 13; |
| 1414 | 1414 | break; |
| 1415 | 1415 | case 0x6F: /* XORW RRr,w - 13 cycles - Flags affected: -Z-0---- */ |
| 1416 | 1416 | ARG_Sw; |
| 1417 | OP_XOR16( sm85cpu_mem_readword( r1 ), s2 ); | |
| 1418 | sm85cpu_mem_writeword( r1, res & 0xFFFF); | |
| 1417 | OP_XOR16( sm85cpu_mem_readword( cpustate, r1 ), s2 ); | |
| 1418 | sm85cpu_mem_writeword( cpustate, r1, res & 0xFFFF); | |
| 1419 | 1419 | mycycles += 13; |
| 1420 | 1420 | break; |
| 1421 | 1421 | case 0x70: /* DBNZ r,rel8 - 10,6 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1427 | 1427 | case 0x76: |
| 1428 | 1428 | case 0x77: |
| 1429 | 1429 | ARG_d8; |
| 1430 | r1 = sm85cpu_mem_readbyte( op & 0x07 ); | |
| 1430 | r1 = sm85cpu_mem_readbyte( cpustate, op & 0x07 ); | |
| 1431 | 1431 | r1--; |
| 1432 | sm85cpu_mem_writebyte( op & 0x07, r1 ); | |
| 1432 | sm85cpu_mem_writebyte( cpustate, op & 0x07, r1 ); | |
| 1433 | 1433 | if ( r1 != 0 ) { |
| 1434 | | |
| 1434 | cpustate->PC = s2; | |
| 1435 | 1435 | mycycles += 10; |
| 1436 | 1436 | } else { |
| 1437 | 1437 | mycycles += 6; |
| r3957 | r3958 | |
| 1446 | 1446 | case 0x7E: |
| 1447 | 1447 | case 0x7F: |
| 1448 | 1448 | ARG_rrw; |
| 1449 | sm85cpu_mem_writeword( r1, s2 ); | |
| 1449 | sm85cpu_mem_writeword( cpustate, r1, s2 ); | |
| 1450 | 1450 | mycycles += 6; |
| 1451 | 1451 | break; |
| 1452 | 1452 | case 0x80: /* BBC R,#b,d8 - 10,6 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1458 | 1458 | case 0x86: |
| 1459 | 1459 | case 0x87: |
| 1460 | 1460 | ARG_Rbr; |
| 1461 | if ( ( sm85cpu_mem_readbyte( r1 ) & ( 1 << (op & 0x07) ) ) == 0 ) { | |
| 1462 | regs.PC = s2; | |
| 1461 | if ( ( sm85cpu_mem_readbyte( cpustate, r1 ) & ( 1 << (op & 0x07) ) ) == 0 ) { | |
| 1462 | cpustate->PC = s2; | |
| 1463 | 1463 | mycycles += 10; |
| 1464 | 1464 | } else { |
| 1465 | 1465 | mycycles += 6; |
| r3957 | r3958 | |
| 1474 | 1474 | case 0x8E: |
| 1475 | 1475 | case 0x8F: |
| 1476 | 1476 | ARG_Rbr; |
| 1477 | if ( ( sm85cpu_mem_readbyte( r1 ) & ( 1 << (op & 0x07) ) ) ) { | |
| 1478 | regs.PC = s2; | |
| 1477 | if ( ( sm85cpu_mem_readbyte( cpustate, r1 ) & ( 1 << (op & 0x07) ) ) ) { | |
| 1478 | cpustate->PC = s2; | |
| 1479 | 1479 | mycycles += 10; |
| 1480 | 1480 | } else { |
| 1481 | 1481 | mycycles += 6; |
| r3957 | r3958 | |
| 1500 | 1500 | ARG_ad16; |
| 1501 | 1501 | CHECK_CC; |
| 1502 | 1502 | if ( res ) { |
| 1503 | | |
| 1503 | cpustate->PC = s2; | |
| 1504 | 1504 | } |
| 1505 | 1505 | mycycles += 6; |
| 1506 | 1506 | break; |
| r3957 | r3958 | |
| 1513 | 1513 | case 0xA6: |
| 1514 | 1514 | case 0xA7: |
| 1515 | 1515 | ARG_R; |
| 1516 | sm85cpu_mem_writebyte( r1, sm85cpu_mem_readbyte( r1 ) & ~ ( 1 << (op & 0x07) ) ); | |
| 1516 | sm85cpu_mem_writebyte( cpustate, r1, sm85cpu_mem_readbyte( cpustate, r1 ) & ~ ( 1 << (op & 0x07) ) ); | |
| 1517 | 1517 | mycycles += 4; |
| 1518 | 1518 | break; |
| 1519 | 1519 | case 0xA8: /* BSET R,#b - 4 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1525 | 1525 | case 0xAE: |
| 1526 | 1526 | case 0xAF: |
| 1527 | 1527 | ARG_R; |
| 1528 | sm85cpu_mem_writebyte( r1, sm85cpu_mem_readbyte( r1 ) | ( 1 << (op & 0x07) ) ); | |
| 1528 | sm85cpu_mem_writebyte( cpustate, r1, sm85cpu_mem_readbyte( cpustate, r1 ) | ( 1 << (op & 0x07) ) ); | |
| 1529 | 1529 | mycycles += 4; |
| 1530 | 1530 | break; |
| 1531 | 1531 | case 0xB0: /* MOV Rx,Rr - 4 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1537 | 1537 | case 0xB6: |
| 1538 | 1538 | case 0xB7: |
| 1539 | 1539 | ARG_rR; |
| 1540 | sm85cpu_mem_writebyte( r1, sm85cpu_mem_readbyte( r2 ) ); | |
| 1540 | sm85cpu_mem_writebyte( cpustate, r1, sm85cpu_mem_readbyte( cpustate, r2 ) ); | |
| 1541 | 1541 | mycycles += 4; |
| 1542 | 1542 | break; |
| 1543 | 1543 | case 0xB8: /* MOV Rr,Rx - 4 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1549 | 1549 | case 0xBE: |
| 1550 | 1550 | case 0xBF: |
| 1551 | 1551 | ARG_rR; |
| 1552 | sm85cpu_mem_writebyte( r2, sm85cpu_mem_readbyte( r1 ) ); | |
| 1552 | sm85cpu_mem_writebyte( cpustate, r2, sm85cpu_mem_readbyte( cpustate, r1 ) ); | |
| 1553 | 1553 | mycycles += 4; |
| 1554 | 1554 | break; |
| 1555 | 1555 | case 0xC0: /* MOV Rx,i - 4 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1561 | 1561 | case 0xC6: |
| 1562 | 1562 | case 0xC7: |
| 1563 | 1563 | ARG_ri; |
| 1564 | sm85cpu_mem_writebyte( r1, r2 ); | |
| 1564 | sm85cpu_mem_writebyte( cpustate, r1, r2 ); | |
| 1565 | 1565 | mycycles += 4; |
| 1566 | 1566 | break; |
| 1567 | 1567 | case 0xC8: /* MOV IE0/IE1/IR0/IR1/P0/P1/P2/P3,i - 4 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1573 | 1573 | case 0xCE: |
| 1574 | 1574 | case 0xCF: |
| 1575 | 1575 | ARG_pi; |
| 1576 | sm85cpu_mem_writebyte( r1, r2 ); | |
| 1576 | sm85cpu_mem_writebyte( cpustate, r1, r2 ); | |
| 1577 | 1577 | mycycles += 4; |
| 1578 | 1578 | break; |
| 1579 | 1579 | case 0xD0: /* BR cc,rel8 - 8,4 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
| 1595 | 1595 | ARG_d8; |
| 1596 | 1596 | CHECK_CC; |
| 1597 | 1597 | if ( res ) { |
| 1598 | | |
| 1598 | cpustate->PC = s2; | |
| 1599 | 1599 | mycycles += 8; |
| 1600 | 1600 | } else { |
| 1601 | 1601 | mycycles += 4; |
| r3957 | r3958 | |
| 1619 | 1619 | case 0xEF: /* CALS 1xWW - 12,9 cycles - Flags affected: -------- */ |
| 1620 | 1620 | ARG_R; |
| 1621 | 1621 | s2 = 0x1000 + ( ( op & 0x0F ) << 8 ) + r1; |
| 1622 | PUSH8( regs.PC & 0xFF ); | |
| 1623 | PUSH8( regs.PC >> 8 ); | |
| 1624 | regs.PC = s2; | |
| 1625 | mycycles += ( ( regs.SYS & 0x40 ) ? 12 : 9 ); | |
| 1622 | PUSH8( cpustate->PC & 0xFF ); | |
| 1623 | PUSH8( cpustate->PC >> 8 ); | |
| 1624 | cpustate->PC = s2; | |
| 1625 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 12 : 9 ); | |
| 1626 | 1626 | break; |
| 1627 | 1627 | case 0xF0: /* STOP - 2 cycles - Flags affected: -------- */ |
| 1628 | 1628 | mycycles += 2; |
| 1629 | if ( | |
| 1629 | if ( cpustate->clock_changed ) { | |
| 1630 | 1630 | /* TODO: Set system clock divider */ |
| 1631 | 1631 | /* TODO: Add a bunch of additional cycles */ |
| 1632 | | |
| 1632 | cpustate->clock_changed = 0; | |
| 1633 | 1633 | } |
| 1634 | 1634 | break; |
| 1635 | 1635 | case 0xF1: /* HALT - 2 cycles - Flags affected: -------- */ |
| 1636 | | |
| 1636 | cpustate->halted = 1; | |
| 1637 | 1637 | mycycles += 2; |
| 1638 | 1638 | break; |
| 1639 | 1639 | case 0xF2: /* Invalid - 2? cycles - Flags affected: --------? */ |
| r3957 | r3958 | |
| 1647 | 1647 | case 0xF8: /* RET - 10,8 cycles - Flags affected: -------- */ |
| 1648 | 1648 | POP8( r1 ); |
| 1649 | 1649 | POP8( r2 ); |
| 1650 | regs.PC = ( r1 << 8 ) | r2; | |
| 1651 | mycycles += ( ( regs.SYS & 0x40 ) ? 10 : 8 ); | |
| 1650 | cpustate->PC = ( r1 << 8 ) | r2; | |
| 1651 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 10 : 8 ); | |
| 1652 | 1652 | break; |
| 1653 | 1653 | case 0xF9: /* IRET - 12,10 cycles - Flags affected: CZSVDHBI */ |
| 1654 | POP8( | |
| 1654 | POP8( cpustate->PS1 ); | |
| 1655 | 1655 | POP8( r1 ); |
| 1656 | 1656 | POP8( r2 ); |
| 1657 | regs.PC = ( r1 << 8 ) | r2; | |
| 1658 | mycycles += ( ( regs.SYS & 0x40 ) ? 12 : 10 ); | |
| 1657 | cpustate->PC = ( r1 << 8 ) | r2; | |
| 1658 | mycycles += ( ( cpustate->SYS & 0x40 ) ? 12 : 10 ); | |
| 1659 | 1659 | break; |
| 1660 | 1660 | case 0xFA: /* CLRC - 2 cycles - Flags affected: C------- */ |
| 1661 | | |
| 1661 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_C ); | |
| 1662 | 1662 | mycycles += 2; |
| 1663 | 1663 | break; |
| 1664 | 1664 | case 0xFB: /* COMC - 2 cycles - Flags affected: C------- */ |
| 1665 | | |
| 1665 | cpustate->PS1 = cpustate->PS1 ^ FLAG_C; | |
| 1666 | 1666 | mycycles += 2; |
| 1667 | 1667 | break; |
| 1668 | 1668 | case 0xFC: /* SETC - 2 cycles - Flags affected: C------- */ |
| 1669 | | |
| 1669 | cpustate->PS1 = cpustate->PS1 | FLAG_C; | |
| 1670 | 1670 | mycycles += 2; |
| 1671 | 1671 | break; |
| 1672 | 1672 | case 0xFD: /* EI - 2 cycles - Flags affected: -------I */ |
| 1673 | | |
| 1673 | cpustate->PS1 = cpustate->PS1 | FLAG_I; | |
| 1674 | 1674 | mycycles += 2; |
| 1675 | 1675 | break; |
| 1676 | 1676 | case 0xFE: /* DI - 2 cycles - Flags affected: -------I */ |
| 1677 | | |
| 1677 | cpustate->PS1 = cpustate->PS1 & ~ ( FLAG_I ); | |
| 1678 | 1678 | mycycles += 2; |
| 1679 | 1679 | break; |
| 1680 | 1680 | case 0xFF: /* NOP - 2 cycles - Flags affected: -------- */ |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | #define FLAG_B 0x02 |
| 22 | 22 | #define FLAG_I 0x01 |
| 23 | 23 | |
| 24 | typedef struct { | |
| 24 | typedef struct _sm8500_state sm8500_state; | |
| 25 | struct _sm8500_state | |
| 26 | { | |
| 25 | 27 | SM8500_CONFIG config; |
| 26 | 28 | UINT16 PC; |
| 27 | 29 | UINT8 *register_base; |
| r3957 | r3958 | |
| 46 | 48 | UINT8 IFLAGS; |
| 47 | 49 | UINT8 CheckInterrupts; |
| 48 | 50 | int halted; |
| 51 | int icount; | |
| 49 | 52 | cpu_irq_callback irq_callback; |
| 50 | 53 | const device_config *device; |
| 51 | 54 | const address_space *program; |
| 52 | 55 | UINT8 internal_ram[0x500]; |
| 53 | } | |
| 56 | } | |
| 54 | 57 | |
| 55 | static sm8500_regs regs; | |
| 56 | ||
| 57 | /* nr of cycles to run */ | |
| 58 | static int sm8500_icount; | |
| 59 | ||
| 60 | 58 | static const UINT8 sm8500_b2w[8] = { |
| 61 | 59 | 0, 8, 2, 10, 4, 12, 6, 14 |
| 62 | 60 | }; |
| 63 | 61 | |
| 64 | UINT8 sm85cpu_mem_readbyte( UINT32 offset ) { | |
| 65 | return ( offset < 0x10 ) ? regs.register_base[offset] : memory_read_byte_8be( regs.program, offset ); | |
| 62 | UINT8 sm85cpu_mem_readbyte( sm8500_state *cpustate, UINT32 offset ) { | |
| 63 | return ( offset < 0x10 ) ? cpustate->register_base[offset] : memory_read_byte_8be( cpustate->program, offset ); | |
| 66 | 64 | } |
| 67 | 65 | |
| 68 | void sm85cpu_mem_writebyte( UINT32 offset, UINT8 data ) { | |
| 66 | void sm85cpu_mem_writebyte( sm8500_state *cpustate, UINT32 offset, UINT8 data ) { | |
| 69 | 67 | if ( offset < 0x10 ) { |
| 70 | | |
| 68 | cpustate->register_base[offset] = data; | |
| 71 | 69 | } else { |
| 72 | memory_write_byte_8be( | |
| 70 | memory_write_byte_8be( cpustate->program, offset, data ); | |
| 73 | 71 | } |
| 74 | 72 | } |
| 75 | 73 | |
| 76 | UINT8 | |
| 74 | INLINE UINT16 sm85cpu_mem_readword( sm8500_s | |
| 77 | 75 | { |
| 78 | return regs.internal_ram; | |
| 76 | UINT16 value = (UINT16) sm85cpu_mem_readbyte( cpustate, address ) << 8; | |
| 77 | value |= sm85cpu_mem_readbyte( cpustate, ( address + 1 ) & 0xffff ); | |
| 78 | return value; | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | static CPU_INIT( sm8500 ) { | |
| 82 | regs.irq_callback = irqcallback; | |
| 83 | regs.device = device; | |
| 84 | regs.program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); | |
| 81 | INLINE void sm85cpu_mem_writeword( sm8500_state *cpustate, UINT32 address, UINT16 value ) | |
| 82 | { | |
| 83 | sm85cpu_mem_writebyte( cpustate, address, value >> 8 ); | |
| 84 | sm85cpu_mem_writebyte( cpustate, ( address + 1 ) & 0xffff, value & 0xff ); | |
| 85 | } | |
| 86 | ||
| 87 | static CPU_INIT( sm8500 ) | |
| 88 | { | |
| 89 | sm8500_state *cpustate = device->token; | |
| 90 | ||
| 91 | cpustate->irq_callback = irqcallback; | |
| 92 | cpustate->device = device; | |
| 93 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); | |
| 85 | 94 | if ( device->static_config != NULL ) { |
| 86 | regs.config.handle_dma = ((SM8500_CONFIG *)device->static_config)->handle_dma; | |
| 87 | regs.config.handle_timers = ((SM8500_CONFIG *)device->static_config)->handle_timers; | |
| 95 | cpustate->config.handle_dma = ((SM8500_CONFIG *)device->static_config)->handle_dma; | |
| 96 | cpustate->config.handle_timers = ((SM8500_CONFIG *)device->static_config)->handle_timers; | |
| 88 | 97 | } else { |
| 89 | regs.config.handle_dma = NULL; | |
| 90 | regs.config.handle_timers = NULL; | |
| 98 | cpustate->config.handle_dma = NULL; | |
| 99 | cpustate->config.handle_timers = NULL; | |
| 91 | 100 | } |
| 92 | | |
| 101 | cpustate->register_base = cpustate->internal_ram; | |
| 93 | 102 | } |
| 94 | 103 | |
| 95 | 104 | static CPU_RESET( sm8500 ) |
| 96 | 105 | { |
| 97 | regs.PC = 0x1020; | |
| 98 | regs.IE0 = 0; | |
| 99 | regs.IE1 = 0; | |
| 100 | regs.IR0 = 0; | |
| 101 | regs.IR1 = 0; | |
| 102 | regs.P0 = 0xFF; | |
| 103 | regs.P1 = 0xFF; | |
| 104 | regs.P2 = 0xFF; | |
| 105 | regs.P3 = 0; | |
| 106 | regs.SYS = 0; | |
| 107 | regs.CKC = 0; regs.clock_changed = 0; | |
| 108 | regs.PS1 = 0; | |
| 109 | regs.register_base = regs.internal_ram; | |
| 110 | regs.halted = 0; | |
| 106 | sm8500_state *cpustate = device->token; | |
| 107 | ||
| 108 | cpustate->PC = 0x1020; | |
| 109 | cpustate->IE0 = 0; | |
| 110 | cpustate->IE1 = 0; | |
| 111 | cpustate->IR0 = 0; | |
| 112 | cpustate->IR1 = 0; | |
| 113 | cpustate->P0 = 0xFF; | |
| 114 | cpustate->P1 = 0xFF; | |
| 115 | cpustate->P2 = 0xFF; | |
| 116 | cpustate->P3 = 0; | |
| 117 | cpustate->SYS = 0; | |
| 118 | cpustate->CKC = 0; cpustate->clock_changed = 0; | |
| 119 | cpustate->PS1 = 0; | |
| 120 | cpustate->register_base = cpustate->internal_ram; | |
| 121 | cpustate->halted = 0; | |
| 111 | 122 | } |
| 112 | 123 | |
| 113 | 124 | static CPU_EXIT( sm8500 ) |
| 114 | 125 | { |
| 115 | 126 | } |
| 116 | 127 | |
| 117 | #define PUSH_BYTE(X) regs.SP = regs.SP - 1; \ | |
| 118 | if ( ( regs.SYS & 0x40 ) == 0 ) { \ | |
| 119 | regs.SP = regs.SP & 0xFF; \ | |
| 128 | #define PUSH_BYTE(X) cpustate->SP = cpustate->SP - 1; \ | |
| 129 | if ( ( cpustate->SYS & 0x40 ) == 0 ) { \ | |
| 130 | cpustate->SP = cpustate->SP & 0xFF; \ | |
| 120 | 131 | } \ |
| 121 | sm85cpu_mem_writebyte( | |
| 132 | sm85cpu_mem_writebyte( cpustate, cpustate->SP, X ); | |
| 122 | 133 | |
| 123 | INLINE void sm8500_do_interrupt(UINT16 vector) { | |
| 134 | INLINE void sm8500_do_interrupt(sm8500_state *cpustate, UINT16 vector) { | |
| 124 | 135 | /* Push PC */ |
| 125 | PUSH_BYTE( regs.PC & 0xFF ); | |
| 126 | PUSH_BYTE( regs.PC >> 8 ); | |
| 136 | PUSH_BYTE( cpustate->PC & 0xFF ); | |
| 137 | PUSH_BYTE( cpustate->PC >> 8 ); | |
| 127 | 138 | /* Push PS1 */ |
| 128 | PUSH_BYTE( | |
| 139 | PUSH_BYTE( cpustate->PS1 ); | |
| 129 | 140 | /* Clear I flag */ |
| 130 | | |
| 141 | cpustate->PS1 &= ~ 0x01; | |
| 131 | 142 | /* Change PC to address stored at "vector" */ |
| 132 | | |
| 143 | cpustate->PC = sm85cpu_mem_readword( cpustate, vector ); | |
| 133 | 144 | } |
| 134 | 145 | |
| 135 | INLINE void sm8500_process_interrupts(void) { | |
| 136 | if ( regs.CheckInterrupts ) { | |
| 146 | INLINE void sm8500_process_interrupts(sm8500_state *cpustate) { | |
| 147 | if ( cpustate->CheckInterrupts ) { | |
| 137 | 148 | int irqline = 0; |
| 138 | 149 | while( irqline < 11 ) { |
| 139 | if ( regs.IFLAGS & ( 1 << irqline ) ) { | |
| 140 | regs.halted = 0; | |
| 150 | if ( cpustate->IFLAGS & ( 1 << irqline ) ) { | |
| 151 | cpustate->halted = 0; | |
| 141 | 152 | switch( irqline ) { |
| 142 | 153 | case ILL_INT: |
| 143 | sm8500_do_interrupt( 0x101C ); | |
| 154 | sm8500_do_interrupt( cpustate, 0x101C ); | |
| 144 | 155 | break; |
| 145 | 156 | case WDT_INT: |
| 146 | sm8500_do_interrupt( 0x101E ); | |
| 157 | sm8500_do_interrupt( cpustate, 0x101E ); | |
| 147 | 158 | break; |
| 148 | 159 | case NMI_INT: |
| 149 | sm8500_do_interrupt( 0x101E ); | |
| 160 | sm8500_do_interrupt( cpustate, 0x101E ); | |
| 150 | 161 | break; |
| 151 | 162 | case DMA_INT: |
| 152 | regs.IR0 |= 0x80; | |
| 153 | if ( ( regs.IE0 & 0x80 ) && ( ( regs.PS0 & 0x07 ) < 8 ) && ( regs.PS1 & 0x01 ) ) { | |
| 154 | sm8500_do_interrupt( 0x1000 ); | |
| 163 | cpustate->IR0 |= 0x80; | |
| 164 | if ( ( cpustate->IE0 & 0x80 ) && ( ( cpustate->PS0 & 0x07 ) < 8 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 165 | sm8500_do_interrupt( cpustate, 0x1000 ); | |
| 155 | 166 | } |
| 156 | 167 | break; |
| 157 | 168 | case TIM0_INT: |
| 158 | regs.IR0 |= 0x40; | |
| 159 | if ( ( regs.IE0 & 0x40 ) && ( ( regs.PS0 & 0x07 ) < 8 ) && ( regs.PS1 & 0x01 ) ) { | |
| 160 | sm8500_do_interrupt( 0x1002 ); | |
| 169 | cpustate->IR0 |= 0x40; | |
| 170 | if ( ( cpustate->IE0 & 0x40 ) && ( ( cpustate->PS0 & 0x07 ) < 8 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 171 | sm8500_do_interrupt( cpustate, 0x1002 ); | |
| 161 | 172 | } |
| 162 | 173 | break; |
| 163 | 174 | case EXT_INT: |
| 164 | regs.IR0 |= 0x10; | |
| 165 | if ( ( regs.IE0 & 0x10 ) && ( ( regs.PS0 & 0x07 ) < 7 ) && ( regs.PS1 & 0x01 ) ) { | |
| 166 | sm8500_do_interrupt( 0x1006 ); | |
| 175 | cpustate->IR0 |= 0x10; | |
| 176 | if ( ( cpustate->IE0 & 0x10 ) && ( ( cpustate->PS0 & 0x07 ) < 7 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 177 | sm8500_do_interrupt( cpustate, 0x1006 ); | |
| 167 | 178 | } |
| 168 | 179 | break; |
| 169 | 180 | case UART_INT: |
| 170 | regs.IR0 |= 0x08; | |
| 171 | if ( ( regs.IE0 & 0x08 ) && ( ( regs.PS0 & 0x07 ) < 6 ) && ( regs.PS1 & 0x01 ) ) { | |
| 172 | sm8500_do_interrupt( 0x1008 ); | |
| 181 | cpustate->IR0 |= 0x08; | |
| 182 | if ( ( cpustate->IE0 & 0x08 ) && ( ( cpustate->PS0 & 0x07 ) < 6 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 183 | sm8500_do_interrupt( cpustate, 0x1008 ); | |
| 173 | 184 | } |
| 174 | 185 | break; |
| 175 | 186 | case LCDC_INT: |
| 176 | regs.IR0 |= 0x01; | |
| 177 | if ( ( regs.IE0 & 0x01 ) && ( ( regs.PS0 & 0x07 ) < 5 ) && ( regs.PS1 & 0x01 ) ) { | |
| 178 | sm8500_do_interrupt( 0x100E ); | |
| 187 | cpustate->IR0 |= 0x01; | |
| 188 | if ( ( cpustate->IE0 & 0x01 ) && ( ( cpustate->PS0 & 0x07 ) < 5 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 189 | sm8500_do_interrupt( cpustate, 0x100E ); | |
| 179 | 190 | } |
| 180 | 191 | break; |
| 181 | 192 | case TIM1_INT: |
| 182 | regs.IR1 |= 0x40; | |
| 183 | if ( ( regs.IE1 & 0x40 ) && ( ( regs.PS0 & 0x07 ) < 4 ) && ( regs.PS1 & 0x01 ) ) { | |
| 184 | sm8500_do_interrupt( 0x1012 ); | |
| 193 | cpustate->IR1 |= 0x40; | |
| 194 | if ( ( cpustate->IE1 & 0x40 ) && ( ( cpustate->PS0 & 0x07 ) < 4 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 195 | sm8500_do_interrupt( cpustate, 0x1012 ); | |
| 185 | 196 | } |
| 186 | 197 | break; |
| 187 | 198 | case CK_INT: |
| 188 | regs.IR1 |= 0x10; | |
| 189 | if ( ( regs.IE1 & 0x10 ) && ( ( regs.PS0 & 0x07 ) < 3 ) && ( regs.PS1 & 0x01 ) ) { | |
| 190 | sm8500_do_interrupt( 0x1016 ); | |
| 199 | cpustate->IR1 |= 0x10; | |
| 200 | if ( ( cpustate->IE1 & 0x10 ) && ( ( cpustate->PS0 & 0x07 ) < 3 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 201 | sm8500_do_interrupt( cpustate, 0x1016 ); | |
| 191 | 202 | } |
| 192 | 203 | break; |
| 193 | 204 | case PIO_INT: |
| 194 | regs.IR1 |= 0x04; | |
| 195 | if ( ( regs.IE1 & 0x04 ) && ( ( regs.PS0 & 0x07 ) < 2 ) && ( regs.PS1 & 0x01 ) ) { | |
| 196 | sm8500_do_interrupt( 0x101A ); | |
| 205 | cpustate->IR1 |= 0x04; | |
| 206 | if ( ( cpustate->IE1 & 0x04 ) && ( ( cpustate->PS0 & 0x07 ) < 2 ) && ( cpustate->PS1 & 0x01 ) ) { | |
| 207 | sm8500_do_interrupt( cpustate, 0x101A ); | |
| 197 | 208 | } |
| 198 | 209 | break; |
| 199 | 210 | } |
| 200 | | |
| 211 | cpustate->IFLAGS &= ~ ( 1 << irqline ); | |
| 201 | 212 | } |
| 202 | 213 | irqline++; |
| 203 | 214 | } |
| r3957 | r3958 | |
| 206 | 217 | |
| 207 | 218 | static CPU_EXECUTE( sm8500 ) |
| 208 | 219 | { |
| 220 | sm8500_state *cpustate = device->token; | |
| 209 | 221 | UINT8 op; |
| 210 | 222 | UINT16 oldpc; |
| 211 | 223 | int mycycles; |
| 212 | 224 | |
| 213 | s | |
| 225 | cpustate->icount = cycles; | |
| 214 | 226 | |
| 215 | 227 | do |
| 216 | 228 | { |
| r3957 | r3958 | |
| 219 | 231 | UINT32 d1,d2; |
| 220 | 232 | UINT32 res; |
| 221 | 233 | |
| 222 | debugger_instruction_hook(device, regs.PC); | |
| 223 | oldpc = regs.PC; | |
| 234 | debugger_instruction_hook(device, cpustate->PC); | |
| 235 | oldpc = cpustate->PC; | |
| 224 | 236 | mycycles = 0; |
| 225 | sm8500_process_interrupts(); | |
| 226 | if ( !regs.halted ) { | |
| 227 | op = sm85cpu_mem_readbyte( regs.PC++ ); | |
| 237 | sm8500_process_interrupts(cpustate); | |
| 238 | if ( !cpustate->halted ) { | |
| 239 | op = sm85cpu_mem_readbyte( cpustate, cpustate->PC++ ); | |
| 228 | 240 | switch( op ) |
| 229 | 241 | { |
| 230 | 242 | #include "sm85ops.h" |
| 231 | 243 | } |
| 232 | 244 | } else { |
| 233 | 245 | mycycles = 4; |
| 234 | if ( regs.config.handle_dma ) { | |
| 235 | regs.config.handle_dma( mycycles ); | |
| 246 | if ( cpustate->config.handle_dma ) { | |
| 247 | cpustate->config.handle_dma( device, mycycles ); | |
| 236 | 248 | } |
| 237 | 249 | } |
| 238 | if ( regs.config.handle_timers ) { | |
| 239 | regs.config.handle_timers( mycycles ); | |
| 250 | if ( cpustate->config.handle_timers ) { | |
| 251 | cpustate->config.handle_timers( device, mycycles ); | |
| 240 | 252 | } |
| 241 | sm8500_icount -= mycycles; | |
| 242 | } while ( sm8500_icount > 0 ); | |
| 253 | cpustate->icount -= mycycles; | |
| 254 | } while ( cpustate->icount > 0 ); | |
| 243 | 255 | |
| 244 | return cycles - s | |
| 256 | return cycles - cpustate->icount; | |
| 245 | 257 | } |
| 246 | 258 | |
| 247 | 259 | static CPU_BURN( sm8500 ) |
| 248 | 260 | { |
| 261 | sm8500_state *cpustate = device->token; | |
| 262 | ||
| 249 | 263 | if ( cycles > 0 ) { |
| 250 | 264 | /* burn a number of 4 cycles */ |
| 251 | 265 | int n = ( cycles + 3 ) / 4; |
| 252 | s | |
| 266 | cpustate->icount -= 4 * n; | |
| 253 | 267 | } |
| 254 | 268 | } |
| 255 | 269 | |
| 256 | unsigned sm8500_get_reg( int regnum ) | |
| 270 | unsigned sm8500_get_reg( sm8500_state *cpustate, int regnum ) | |
| 257 | 271 | { |
| 258 | 272 | switch( regnum ) |
| 259 | 273 | { |
| 260 | case REG_PC: | |
| 261 | case SM8500_PC: return regs.PC; | |
| 262 | case REG_SP: | |
| 263 | case SM8500_SP: return ( regs.SYS & 0x40 ) ? regs.SP : regs.SP & 0xFF ; | |
| 264 | case SM8500_PS: return ( regs.PS0 << 8 ) | regs.PS1; | |
| 265 | case SM8500_SYS16: return regs.SYS; | |
| 266 | case SM8500_RR0: return sm85cpu_mem_readword( 0x00 ); | |
| 267 | case SM8500_RR2: return sm85cpu_mem_readword( 0x02 ); | |
| 268 | case SM8500_RR4: return sm85cpu_mem_readword( 0x04 ); | |
| 269 | case SM8500_RR6: return sm85cpu_mem_readword( 0x06 ); | |
| 270 | case SM8500_RR8: return sm85cpu_mem_readword( 0x08 ); | |
| 271 | case SM8500_RR10: return sm85cpu_mem_readword( 0x0A ); | |
| 272 | case SM8500_RR12: return sm85cpu_mem_readword( 0x0C ); | |
| 273 | case SM8500_RR14: return sm85cpu_mem_readword( 0x0E ); | |
| 274 | case SM8500_IE0: return regs.IE0; | |
| 275 | case SM8500_IE1: return regs.IE1; | |
| 276 | case SM8500_IR0: return regs.IR0; | |
| 277 | case SM8500_IR1: return regs.IR1; | |
| 278 | case SM8500_P0: return regs.P0; | |
| 279 | case SM8500_P1: return regs.P1; | |
| 280 | case SM8500_P2: return regs.P2; | |
| 281 | case SM8500_P3: return regs.P3; | |
| 282 | case SM8500_SYS: return regs.SYS; | |
| 283 | case SM8500_CKC: return regs.CKC; | |
| 284 | case SM8500_SPH: return (regs.SP >> 8); | |
| 285 | case SM8500_SPL: return regs.SP & 0xFF; | |
| 286 | case SM8500_PS0: return regs.PS0; | |
| 287 | case SM8500_PS1: return regs.PS1; | |
| 288 | case SM8500_P0C: return regs.P0C; | |
| 289 | case SM8500_P1C: return regs.P1C; | |
| 290 | case SM8500_P2C: return regs.P2C; | |
| 291 | case SM8500_P3C: return regs.P3C; | |
| 274 | case REG_GENPC: | |
| 275 | case SM8500_PC: return cpustate->PC; | |
| 276 | case REG_GENSP: | |
| 277 | case SM8500_SP: return ( cpustate->SYS & 0x40 ) ? cpustate->SP : cpustate->SP & 0xFF ; | |
| 278 | case SM8500_PS: return ( cpustate->PS0 << 8 ) | cpustate->PS1; | |
| 279 | case SM8500_SYS16: return cpustate->SYS; | |
| 280 | case SM8500_RR0: return sm85cpu_mem_readword( cpustate, 0x00 ); | |
| 281 | case SM8500_RR2: return sm85cpu_mem_readword( cpustate, 0x02 ); | |
| 282 | case SM8500_RR4: return sm85cpu_mem_readword( cpustate, 0x04 ); | |
| 283 | case SM8500_RR6: return sm85cpu_mem_readword( cpustate, 0x06 ); | |
| 284 | case SM8500_RR8: return sm85cpu_mem_readword( cpustate, 0x08 ); | |
| 285 | case SM8500_RR10: return sm85cpu_mem_readword( cpustate, 0x0A ); | |
| 286 | case SM8500_RR12: return sm85cpu_mem_readword( cpustate, 0x0C ); | |
| 287 | case SM8500_RR14: return sm85cpu_mem_readword( cpustate, 0x0E ); | |
| 288 | case SM8500_IE0: return cpustate->IE0; | |
| 289 | case SM8500_IE1: return cpustate->IE1; | |
| 290 | case SM8500_IR0: return cpustate->IR0; | |
| 291 | case SM8500_IR1: return cpustate->IR1; | |
| 292 | case SM8500_P0: return cpustate->P0; | |
| 293 | case SM8500_P1: return cpustate->P1; | |
| 294 | case SM8500_P2: return cpustate->P2; | |
| 295 | case SM8500_P3: return cpustate->P3; | |
| 296 | case SM8500_SYS: return cpustate->SYS; | |
| 297 | case SM8500_CKC: return cpustate->CKC; | |
| 298 | case SM8500_SPH: return (cpustate->SP >> 8); | |
| 299 | case SM8500_SPL: return cpustate->SP & 0xFF; | |
| 300 | case SM8500_PS0: return cpustate->PS0; | |
| 301 | case SM8500_PS1: return cpustate->PS1; | |
| 302 | case SM8500_P0C: return cpustate->P0C; | |
| 303 | case SM8500_P1C: return cpustate->P1C; | |
| 304 | case SM8500_P2C: return cpustate->P2C; | |
| 305 | case SM8500_P3C: return cpustate->P3C; | |
| 292 | 306 | } |
| 293 | 307 | return 0; |
| 294 | 308 | } |
| 295 | 309 | |
| 296 | static void sm8500_set_reg( int regnum, unsigned val ) | |
| 310 | static void sm8500_set_reg( sm8500_state *cpustate, int regnum, unsigned val ) | |
| 297 | 311 | { |
| 298 | 312 | switch( regnum ) |
| 299 | 313 | { |
| 300 | case REG_PC: | |
| 301 | case SM8500_PC: regs.PC = val; break; | |
| 302 | case REG_SP: | |
| 303 | case SM8500_SP: regs.SP = val; break; | |
| 304 | case SM8500_PS: sm8500_set_reg( SM8500_PS0, ( val >> 8 ) & 0xFF ); sm8500_set_reg( SM8500_PS1, val & 0xFF ); break; | |
| 305 | case SM8500_SYS16: regs.SYS = val; break; | |
| 306 | case SM8500_RR0: sm85cpu_mem_writeword( 0x00, val); break; | |
| 307 | case SM8500_RR2: sm85cpu_mem_writeword( 0x02, val); break; | |
| 308 | case SM8500_RR4: sm85cpu_mem_writeword( 0x04, val); break; | |
| 309 | case SM8500_RR6: sm85cpu_mem_writeword( 0x06, val); break; | |
| 310 | case SM8500_RR8: sm85cpu_mem_writeword( 0x08, val); break; | |
| 311 | case SM8500_RR10: sm85cpu_mem_writeword( 0x0A, val); break; | |
| 312 | case SM8500_RR12: sm85cpu_mem_writeword( 0x0C, val); break; | |
| 313 | case SM8500_RR14: sm85cpu_mem_writeword( 0x0E, val); break; | |
| 314 | case SM8500_IE0: regs.IE0 = val; break; | |
| 315 | case SM8500_IE1: regs.IE1 = val; break; | |
| 316 | case SM8500_IR0: regs.IR0 = val; break; | |
| 317 | case SM8500_IR1: regs.IR1 = val; break; | |
| 318 | case SM8500_P0: regs.P0 = val; break; | |
| 319 | case SM8500_P1: regs.P1 = val; break; | |
| 320 | case SM8500_P2: regs.P2 = val; break; | |
| 321 | case SM8500_P3: regs.P3 = val; break; | |
| 322 | case SM8500_SYS: regs.SYS = val; break; | |
| 323 | case SM8500_CKC: regs.CKC = val; if ( val & 0x80 ) { regs.clock_changed = 1; }; break; | |
| 324 | case SM8500_SPH: regs.SP = ( ( val & 0xFF ) << 8 ) | ( regs.SP & 0xFF ); break; | |
| 325 | case SM8500_SPL: regs.SP = ( regs.SP & 0xFF00 ) | ( val & 0xFF ); break; | |
| 326 | case SM8500_PS0: regs.PS0 = val; regs.register_base = regs.internal_ram + ( val & 0xF8 ); break; | |
| 327 | case SM8500_PS1: regs.PS1 = val; break; | |
| 328 | case SM8500_P0C: regs.P0C = val; break; | |
| 329 | case SM8500_P1C: regs.P1C = val; break; | |
| 330 | case SM8500_P2C: regs.P2C = val; break; | |
| 331 | case SM8500_P3C: regs.P3C = val; break; | |
| 314 | case REG_GENPC: | |
| 315 | case SM8500_PC: cpustate->PC = val; break; | |
| 316 | case REG_GENSP: | |
| 317 | case SM8500_SP: cpustate->SP = val; break; | |
| 318 | case SM8500_PS: sm8500_set_reg( cpustate, SM8500_PS0, ( val >> 8 ) & 0xFF ); sm8500_set_reg( cpustate, SM8500_PS1, val & 0xFF ); break; | |
| 319 | case SM8500_SYS16: cpustate->SYS = val; break; | |
| 320 | case SM8500_RR0: sm85cpu_mem_writeword( cpustate, 0x00, val); break; | |
| 321 | case SM8500_RR2: sm85cpu_mem_writeword( cpustate, 0x02, val); break; | |
| 322 | case SM8500_RR4: sm85cpu_mem_writeword( cpustate, 0x04, val); break; | |
| 323 | case SM8500_RR6: sm85cpu_mem_writeword( cpustate, 0x06, val); break; | |
| 324 | case SM8500_RR8: sm85cpu_mem_writeword( cpustate, 0x08, val); break; | |
| 325 | case SM8500_RR10: sm85cpu_mem_writeword( cpustate, 0x0A, val); break; | |
| 326 | case SM8500_RR12: sm85cpu_mem_writeword( cpustate, 0x0C, val); break; | |
| 327 | case SM8500_RR14: sm85cpu_mem_writeword( cpustate, 0x0E, val); break; | |
| 328 | case SM8500_IE0: cpustate->IE0 = val; break; | |
| 329 | case SM8500_IE1: cpustate->IE1 = val; break; | |
| 330 | case SM8500_IR0: cpustate->IR0 = val; break; | |
| 331 | case SM8500_IR1: cpustate->IR1 = val; break; | |
| 332 | case SM8500_P0: cpustate->P0 = val; break; | |
| 333 | case SM8500_P1: cpustate->P1 = val; break; | |
| 334 | case SM8500_P2: cpustate->P2 = val; break; | |
| 335 | case SM8500_P3: cpustate->P3 = val; break; | |
| 336 | case SM8500_SYS: cpustate->SYS = val; break; | |
| 337 | case SM8500_CKC: cpustate->CKC = val; if ( val & 0x80 ) { cpustate->clock_changed = 1; }; break; | |
| 338 | case SM8500_SPH: cpustate->SP = ( ( val & 0xFF ) << 8 ) | ( cpustate->SP & 0xFF ); break; | |
| 339 | case SM8500_SPL: cpustate->SP = ( cpustate->SP & 0xFF00 ) | ( val & 0xFF ); break; | |
| 340 | case SM8500_PS0: cpustate->PS0 = val; cpustate->register_base = cpustate->internal_ram + ( val & 0xF8 ); break; | |
| 341 | case SM8500_PS1: cpustate->PS1 = val; break; | |
| 342 | case SM8500_P0C: cpustate->P0C = val; break; | |
| 343 | case SM8500_P1C: cpustate->P1C = val; break; | |
| 344 | case SM8500_P2C: cpustate->P2C = val; break; | |
| 345 | case SM8500_P3C: cpustate->P3C = val; break; | |
| 332 | 346 | } |
| 333 | 347 | } |
| 334 | 348 | |
| 335 | static void sm8500_set_irq_line( int irqline, int state ) | |
| 349 | static void sm8500_set_irq_line( sm8500_state *cpustate, int irqline, int state ) | |
| 336 | 350 | { |
| 337 | 351 | if ( state == ASSERT_LINE ) { |
| 338 | regs.IFLAGS |= ( 0x01 << irqline ); | |
| 339 | regs.CheckInterrupts = 1; | |
| 352 | cpustate->IFLAGS |= ( 0x01 << irqline ); | |
| 353 | cpustate->CheckInterrupts = 1; | |
| 340 | 354 | switch( irqline ) { |
| 341 | case DMA_INT: regs.IR0 |= 0x80; break; | |
| 342 | case TIM0_INT: regs.IR0 |= 0x40; break; | |
| 343 | case EXT_INT: regs.IR0 |= 0x10; break; | |
| 344 | case UART_INT: regs.IR0 |= 0x08; break; | |
| 345 | case LCDC_INT: regs.IR0 |= 0x01; break; | |
| 346 | case TIM1_INT: regs.IR1 |= 0x40; break; | |
| 347 | case CK_INT: regs.IR1 |= 0x10; break; | |
| 348 | case PIO_INT: regs.IR1 |= 0x04; break; | |
| 355 | case DMA_INT: cpustate->IR0 |= 0x80; break; | |
| 356 | case TIM0_INT: cpustate->IR0 |= 0x40; break; | |
| 357 | case EXT_INT: cpustate->IR0 |= 0x10; break; | |
| 358 | case UART_INT: cpustate->IR0 |= 0x08; break; | |
| 359 | case LCDC_INT: cpustate->IR0 |= 0x01; break; | |
| 360 | case TIM1_INT: cpustate->IR1 |= 0x40; break; | |
| 361 | case CK_INT: cpustate->IR1 |= 0x10; break; | |
| 362 | case PIO_INT: cpustate->IR1 |= 0x04; break; | |
| 349 | 363 | } |
| 350 | 364 | } else { |
| 351 | | |
| 365 | cpustate->IFLAGS &= ~( 0x01 << irqline ); | |
| 352 | 366 | switch( irqline ) { |
| 353 | case DMA_INT: regs.IR0 &= ~0x80; break; | |
| 354 | case TIM0_INT: regs.IR0 &= ~0x40; break; | |
| 355 | case EXT_INT: regs.IR0 &= ~0x10; break; | |
| 356 | case UART_INT: regs.IR0 &= ~0x08; break; | |
| 357 | case LCDC_INT: regs.IR0 &= ~0x01; break; | |
| 358 | case TIM1_INT: regs.IR1 &= ~0x40; break; | |
| 359 | case CK_INT: regs.IR1 &= ~0x10; break; | |
| 360 | case PIO_INT: regs.IR1 &= ~0x04; break; | |
| 367 | case DMA_INT: cpustate->IR0 &= ~0x80; break; | |
| 368 | case TIM0_INT: cpustate->IR0 &= ~0x40; break; | |
| 369 | case EXT_INT: cpustate->IR0 &= ~0x10; break; | |
| 370 | case UART_INT: cpustate->IR0 &= ~0x08; break; | |
| 371 | case LCDC_INT: cpustate->IR0 &= ~0x01; break; | |
| 372 | case TIM1_INT: cpustate->IR1 &= ~0x40; break; | |
| 373 | case CK_INT: cpustate->IR1 &= ~0x10; break; | |
| 374 | case PIO_INT: cpustate->IR1 &= ~0x04; break; | |
| 361 | 375 | } |
| 362 | if ( 0 == regs.IFLAGS ) { | |
| 363 | regs.CheckInterrupts = 0; | |
| 376 | if ( 0 == cpustate->IFLAGS ) { | |
| 377 | cpustate->CheckInterrupts = 0; | |
| 364 | 378 | } |
| 365 | 379 | } |
| 366 | 380 | } |
| 367 | 381 | |
| 368 | 382 | static CPU_SET_INFO( sm8500 ) |
| 369 | 383 | { |
| 384 | sm8500_state *cpustate = device->token; | |
| 385 | ||
| 370 | 386 | switch(state) |
| 371 | 387 | { |
| 372 | 388 | case CPUINFO_INT_INPUT_STATE + 0: |
| r3957 | r3958 | |
| 380 | 396 | case CPUINFO_INT_INPUT_STATE + 8: |
| 381 | 397 | case CPUINFO_INT_INPUT_STATE + 9: |
| 382 | 398 | case CPUINFO_INT_INPUT_STATE + 10: |
| 383 | sm8500_set_irq_line( state - CPUINFO_INT_INPUT_STATE, info->i ); break; | |
| 399 | sm8500_set_irq_line( cpustate, state - CPUINFO_INT_INPUT_STATE, info->i ); break; | |
| 384 | 400 | |
| 385 | 401 | case CPUINFO_INT_REGISTER + SM8500_RR0: |
| 386 | 402 | case CPUINFO_INT_REGISTER + SM8500_RR2: |
| r3957 | r3958 | |
| 412 | 428 | case CPUINFO_INT_REGISTER + SM8500_P1C: |
| 413 | 429 | case CPUINFO_INT_REGISTER + SM8500_P2C: |
| 414 | 430 | case CPUINFO_INT_REGISTER + SM8500_P3C: |
| 415 | sm8500_set_reg( state - CPUINFO_INT_REGISTER, info->i ); break; | |
| 431 | sm8500_set_reg( cpustate, state - CPUINFO_INT_REGISTER, info->i ); break; | |
| 416 | 432 | |
| 417 | 433 | } |
| 418 | 434 | } |
| 419 | 435 | |
| 420 | 436 | CPU_GET_INFO( sm8500 ) |
| 421 | 437 | { |
| 438 | sm8500_state *cpustate = (device != NULL) ? device->token : NULL; | |
| 439 | ||
| 422 | 440 | switch(state) |
| 423 | 441 | { |
| 424 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(sm8500_ | |
| 442 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(sm8500_ | |
| 425 | 443 | case CPUINFO_INT_INPUT_LINES: info->i = 8; break; |
| 426 | 444 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; |
| 427 | 445 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| r3957 | r3958 | |
| 431 | 449 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 5; break; |
| 432 | 450 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 433 | 451 | case CPUINFO_INT_MAX_CYCLES: info->i = 16; break; |
| 434 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 435 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 436 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 437 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 438 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 439 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 440 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 441 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 442 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 452 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 453 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 454 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 455 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 456 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 457 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 458 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 459 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 460 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 443 | 461 | case CPUINFO_INT_INPUT_STATE + 0: |
| 444 | 462 | case CPUINFO_INT_INPUT_STATE + 1: |
| 445 | 463 | case CPUINFO_INT_INPUT_STATE + 2: |
| r3957 | r3958 | |
| 447 | 465 | case CPUINFO_INT_INPUT_STATE + 4: |
| 448 | 466 | case CPUINFO_INT_INPUT_STATE + 5: |
| 449 | 467 | case CPUINFO_INT_INPUT_STATE + 6: |
| 450 | case CPUINFO_INT_INPUT_STATE + 7: info->i = | |
| 468 | case CPUINFO_INT_INPUT_STATE + 7: info->i = cpustate->IFLAGS & ( 1 << (state - CPUINFO_INT_INPUT_STATE)); break; | |
| 451 | 469 | case CPUINFO_INT_REGISTER + SM8500_RR0: |
| 452 | 470 | case CPUINFO_INT_REGISTER + SM8500_RR2: |
| 453 | 471 | case CPUINFO_INT_REGISTER + SM8500_RR4: |
| r3957 | r3958 | |
| 478 | 496 | case CPUINFO_INT_REGISTER + SM8500_P1C: |
| 479 | 497 | case CPUINFO_INT_REGISTER + SM8500_P2C: |
| 480 | 498 | case CPUINFO_INT_REGISTER + SM8500_P3C: |
| 481 | info->i = sm8500_get_reg( state - CPUINFO_INT_REGISTER ); break; | |
| 482 | case CPUINFO_INT_REGISTER + REG_PC: info->i = sm8500_get_reg( SM8500_PC ); break; | |
| 483 | case CPUINFO_INT_REGISTER + REG_SP: info->i = sm8500_get_reg( SM8500_SP ); break; | |
| 499 | info->i = sm8500_get_reg( cpustate, state - CPUINFO_INT_REGISTER ); break; | |
| 500 | case CPUINFO_INT_REGISTER + REG_GENPC: info->i = sm8500_get_reg( cpustate, SM8500_PC ); break; | |
| 501 | case CPUINFO_INT_REGISTER + REG_GENSP: info->i = sm8500_get_reg( cpustate, SM8500_SP ); break; | |
| 484 | 502 | case CPUINFO_INT_PREVIOUSPC: info->i = 0x0000; break; |
| 485 | 503 | |
| 486 | 504 | |
| 487 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sm8500); break; | |
| 488 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(sm8500); break; | |
| 489 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(sm8500); break; | |
| 490 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(sm8500); break; | |
| 491 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(sm8500); break; | |
| 492 | case CPUINFO_PTR_BURN: info->burn = CPU_BURN_NAME(sm8500); break; | |
| 493 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sm8500); break; | |
| 494 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &sm8500_icount; break; | |
| 505 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sm8500); break; | |
| 506 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(sm8500); break; | |
| 507 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(sm8500); break; | |
| 508 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(sm8500); break; | |
| 509 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sm8500); break; | |
| 510 | case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(sm8500); break; | |
| 511 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sm8500); break; | |
| 512 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 513 | case CPUINFO_PTR_SM8500_INTERNAL_RAM: info->p = cpustate->internal_ram; break; | |
| 495 | 514 | |
| 496 | 515 | case CPUINFO_STR_NAME: strcpy( info->s, "sm8500" ); break; |
| 497 | 516 | case CPUINFO_STR_CORE_FAMILY: strcpy( info->s, "Sharp SM8500" ); break; |
| r3957 | r3958 | |
| 500 | 519 | case CPUINFO_STR_CORE_CREDITS: strcpy( info->s, "Copyright The MESS Team." ); break; |
| 501 | 520 | case CPUINFO_STR_FLAGS: |
| 502 | 521 | sprintf( info->s, "%c%c%c%c%c%c%c%c", |
| 503 | regs.PS1 & FLAG_C ? 'C' : '.', | |
| 504 | regs.PS1 & FLAG_Z ? 'Z' : '.', | |
| 505 | regs.PS1 & FLAG_S ? 'S' : '.', | |
| 506 | regs.PS1 & FLAG_V ? 'V' : '.', | |
| 507 | regs.PS1 & FLAG_D ? 'D' : '.', | |
| 508 | regs.PS1 & FLAG_H ? 'H' : '.', | |
| 509 | regs.PS1 & FLAG_B ? 'B' : '.', | |
| 510 | regs.PS1 & FLAG_I ? 'I' : '.' ); | |
| 522 | cpustate->PS1 & FLAG_C ? 'C' : '.', | |
| 523 | cpustate->PS1 & FLAG_Z ? 'Z' : '.', | |
| 524 | cpustate->PS1 & FLAG_S ? 'S' : '.', | |
| 525 | cpustate->PS1 & FLAG_V ? 'V' : '.', | |
| 526 | cpustate->PS1 & FLAG_D ? 'D' : '.', | |
| 527 | cpustate->PS1 & FLAG_H ? 'H' : '.', | |
| 528 | cpustate->PS1 & FLAG_B ? 'B' : '.', | |
| 529 | cpustate->PS1 & FLAG_I ? 'I' : '.' ); | |
| 511 | 530 | break; |
| 512 | case CPUINFO_STR_REGISTER + SM8500_RR0: sprintf(info->s, "RR0:%04X", sm85cpu_mem_readword( 0x00 ) ); break; | |
| 513 | case CPUINFO_STR_REGISTER + SM8500_RR2: sprintf(info->s, "RR2:%04X", sm85cpu_mem_readword( 0x02 ) ); break; | |
| 514 | case CPUINFO_STR_REGISTER + SM8500_RR4: sprintf(info->s, "RR4:%04X", sm85cpu_mem_readword( 0x04 ) ); break; | |
| 515 | case CPUINFO_STR_REGISTER + SM8500_RR6: sprintf(info->s, "RR6:%04X", sm85cpu_mem_readword( 0x06 ) ); break; | |
| 516 | case CPUINFO_STR_REGISTER + SM8500_RR8: sprintf(info->s, "RR8:%04X", sm85cpu_mem_readword( 0x08 ) ); break; | |
| 517 | case CPUINFO_STR_REGISTER + SM8500_RR10: sprintf(info->s, "RR10:%04X", sm85cpu_mem_readword( 0x0A ) ); break; | |
| 518 | case CPUINFO_STR_REGISTER + SM8500_RR12: sprintf(info->s, "RR12:%04X", sm85cpu_mem_readword( 0x0C ) ); break; | |
| 519 | case CPUINFO_STR_REGISTER + SM8500_RR14: sprintf(info->s, "RR14:%04X", sm85cpu_mem_readword( 0x0E ) ); break; | |
| 520 | case CPUINFO_STR_REGISTER + SM8500_PC: sprintf(info->s, "PC:%04X", regs.PC); break; | |
| 521 | case CPUINFO_STR_REGISTER + SM8500_SP: sprintf(info->s, "SP:%04X", regs.SP); break; | |
| 522 | case CPUINFO_STR_REGISTER + SM8500_PS: sprintf(info->s, "PS:%04X", ( regs.PS0 << 8 ) | regs.PS1 ); break; | |
| 523 | case CPUINFO_STR_REGISTER + SM8500_SYS16: sprintf(info->s, "SYS:%04X", regs.SYS ); break; | |
| 531 | case CPUINFO_STR_REGISTER + SM8500_RR0: sprintf(info->s, "RR0:%04X", sm85cpu_mem_readword( cpustate, 0x00 ) ); break; | |
| 532 | case CPUINFO_STR_REGISTER + SM8500_RR2: sprintf(info->s, "RR2:%04X", sm85cpu_mem_readword( cpustate, 0x02 ) ); break; | |
| 533 | case CPUINFO_STR_REGISTER + SM8500_RR4: sprintf(info->s, "RR4:%04X", sm85cpu_mem_readword( cpustate, 0x04 ) ); break; | |
| 534 | case CPUINFO_STR_REGISTER + SM8500_RR6: sprintf(info->s, "RR6:%04X", sm85cpu_mem_readword( cpustate, 0x06 ) ); break; | |
| 535 | case CPUINFO_STR_REGISTER + SM8500_RR8: sprintf(info->s, "RR8:%04X", sm85cpu_mem_readword( cpustate, 0x08 ) ); break; | |
| 536 | case CPUINFO_STR_REGISTER + SM8500_RR10: sprintf(info->s, "RR10:%04X", sm85cpu_mem_readword( cpustate, 0x0A ) ); break; | |
| 537 | case CPUINFO_STR_REGISTER + SM8500_RR12: sprintf(info->s, "RR12:%04X", sm85cpu_mem_readword( cpustate, 0x0C ) ); break; | |
| 538 | case CPUINFO_STR_REGISTER + SM8500_RR14: sprintf(info->s, "RR14:%04X", sm85cpu_mem_readword( cpustate, 0x0E ) ); break; | |
| 539 | case CPUINFO_STR_REGISTER + SM8500_PC: sprintf(info->s, "PC:%04X", cpustate->PC); break; | |
| 540 | case CPUINFO_STR_REGISTER + SM8500_SP: sprintf(info->s, "SP:%04X", cpustate->SP); break; | |
| 541 | case CPUINFO_STR_REGISTER + SM8500_PS: sprintf(info->s, "PS:%04X", ( cpustate->PS0 << 8 ) | cpustate->PS1 ); break; | |
| 542 | case CPUINFO_STR_REGISTER + SM8500_SYS16: sprintf(info->s, "SYS:%04X", cpustate->SYS ); break; | |
| 524 | 543 | } |
| 525 | 544 | } |
| 526 | 545 |
| r3957 | r3958 | |
|---|---|---|
| 792 | 792 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 793 | 793 | case CPUINFO_INT_MAX_CYCLES: info->i = 3; break; |
| 794 | 794 | |
| 795 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 796 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 11; break; | |
| 797 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 798 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 799 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 800 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 801 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 802 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 3; break; | |
| 803 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 795 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 796 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 797 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 798 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 799 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 800 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 801 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 802 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 3; break; | |
| 803 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 804 | 804 | |
| 805 | 805 | case CPUINFO_INT_INPUT_STATE + MB88_IRQ_LINE: info->i = cpustate->pending_interrupt ? ASSERT_LINE : CLEAR_LINE; break; |
| 806 | 806 | |
| r3957 | r3958 | |
| 828 | 828 | case CPUINFO_INT_REGISTER + MB88_SB: info->i = cpustate->SB; break; |
| 829 | 829 | |
| 830 | 830 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 831 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mb88); break; | |
| 832 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(mb88); break; | |
| 833 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(mb88); break; | |
| 834 | case CPUINFO_PTR_EXIT: info->exit = NULL; break; | |
| 835 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(mb88); break; | |
| 836 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 837 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mb88); break; | |
| 831 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mb88); break; | |
| 832 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(mb88); break; | |
| 833 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mb88); break; | |
| 834 | case CPUINFO_FCT_EXIT: info->exit = NULL; break; | |
| 835 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(mb88); break; | |
| 836 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 837 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mb88); break; | |
| 838 | 838 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 839 | 839 | |
| 840 | 840 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 882 | 882 | switch (state) |
| 883 | 883 | { |
| 884 | 884 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 885 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 11; break; | |
| 886 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 885 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 886 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 887 | 887 | |
| 888 | 888 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 889 | 889 | case CPUINFO_STR_NAME: strcpy(info->s, "MB8841"); break; |
| r3957 | r3958 | |
| 897 | 897 | switch (state) |
| 898 | 898 | { |
| 899 | 899 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 900 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 11; break; | |
| 901 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 900 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 901 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 902 | 902 | |
| 903 | 903 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 904 | 904 | case CPUINFO_STR_NAME: strcpy(info->s, "MB8842"); break; |
| r3957 | r3958 | |
| 912 | 912 | switch (state) |
| 913 | 913 | { |
| 914 | 914 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 915 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 10; break; | |
| 916 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 915 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10; break; | |
| 916 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 917 | 917 | |
| 918 | 918 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 919 | 919 | case CPUINFO_STR_NAME: strcpy(info->s, "MB8843"); break; |
| r3957 | r3958 | |
| 927 | 927 | switch (state) |
| 928 | 928 | { |
| 929 | 929 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 930 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 10; break; | |
| 931 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 6; break; | |
| 930 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10; break; | |
| 931 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 6; break; | |
| 932 | 932 | |
| 933 | 933 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 934 | 934 | case CPUINFO_STR_NAME: strcpy(info->s, "MB8844"); break; |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | CPU_GET_INFO( mb8843 ); |
| 75 | 75 | CPU_GET_INFO( mb8844 ); |
| 76 | 76 | |
| 77 | #define CPU_MB88 CPU_GET_INFO_NAME( mb88 ) | |
| 78 | #define CPU_MB8841 CPU_GET_INFO_NAME( mb8841 ) | |
| 79 | #define CPU_MB8842 CPU_GET_INFO_NAME( mb8842 ) | |
| 80 | #define CPU_MB8843 CPU_GET_INFO_NAME( mb8843 ) | |
| 81 | #define CPU_MB8844 CPU_GET_INFO_NAME( mb8844 ) | |
| 82 | ||
| 77 | 83 | CPU_DISASSEMBLE( mb88 ); |
| 78 | 84 | |
| 79 | 85 | #endif /* __MB88XX_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 3643 | 3643 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 3644 | 3644 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 3645 | 3645 | |
| 3646 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 64; break; | |
| 3647 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 3648 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 3649 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3650 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3651 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3652 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 64; break; | |
| 3653 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 3654 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3646 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 64; break; | |
| 3647 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 3648 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 3649 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 3650 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 3651 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 3652 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 64; break; | |
| 3653 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 8; break; | |
| 3654 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 3655 | 3655 | |
| 3656 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 3656 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 3657 | 3657 | |
| 3658 | 3658 | case CPUINFO_INT_INPUT_STATE + SH4_IRL0: info->i = sh4->irq_line_state[SH4_IRL0]; break; |
| 3659 | 3659 | case CPUINFO_INT_INPUT_STATE + SH4_IRL1: info->i = sh4->irq_line_state[SH4_IRL1]; break; |
| r3957 | r3958 | |
| 3692 | 3692 | case CPUINFO_INT_REGISTER + SH4_EA: info->i = sh4->ea; break; |
| 3693 | 3693 | |
| 3694 | 3694 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3695 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sh4); break; | |
| 3696 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(sh4); break; | |
| 3697 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(sh4); break; | |
| 3698 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(sh4); break; | |
| 3699 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 3700 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sh4); break; | |
| 3695 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(sh4); break; | |
| 3696 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(sh4); break; | |
| 3697 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(sh4); break; | |
| 3698 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sh4); break; | |
| 3699 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 3700 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sh4); break; | |
| 3701 | 3701 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &sh4->sh4_icount; break; |
| 3702 | 3702 | |
| 3703 | 3703 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 102 | 102 | }; |
| 103 | 103 | |
| 104 | 104 | extern CPU_GET_INFO( sh4 ); |
| 105 | #define CPU_SH4 CPU_GET_INFO_NAME( sh4 ) | |
| 105 | 106 | |
| 106 | 107 | WRITE32_HANDLER( sh4_internal_w ); |
| 107 | 108 | READ32_HANDLER( sh4_internal_r ); |
| r3957 | r3958 | |
|---|---|---|
| 583 | 583 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 584 | 584 | case CPUINFO_INT_MAX_CYCLES: info->i = 5; break; |
| 585 | 585 | |
| 586 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 587 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 588 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; | |
| 589 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 590 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 591 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -1; break; | |
| 592 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 593 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 594 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 586 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 587 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 588 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 589 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 16; break; | |
| 590 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 16; break; | |
| 591 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -1; break; | |
| 592 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 593 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 594 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 595 | 595 | |
| 596 | 596 | case CPUINFO_INT_INPUT_STATE: info->i = CLEAR_LINE; break; |
| 597 | 597 | |
| r3957 | r3958 | |
| 624 | 624 | case CPUINFO_INT_REGISTER + TMS32051_AR7: info->i = cpustate->ar[7]; break; |
| 625 | 625 | |
| 626 | 626 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 627 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tms); break; | |
| 628 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms); break; | |
| 629 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(tms); break; | |
| 630 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms); break; | |
| 631 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 632 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32051); break; | |
| 633 | case CPUINFO_PTR_READ: info->read = CPU_READ_NAME(tms); break; | |
| 627 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tms); break; | |
| 628 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms); break; | |
| 629 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(tms); break; | |
| 630 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms); break; | |
| 631 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 632 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32051); break; | |
| 633 | case CPUINFO_FCT_READ: info->read = CPU_READ_NAME(tms); break; | |
| 634 | 634 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 635 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(internal_pgm); break; | |
| 636 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map16 = ADDRESS_MAP_NAME(internal_data); break; | |
| 635 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(internal_pgm); break; | |
| 636 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map16 = ADDRESS_MAP_NAME(internal_data); break; | |
| 637 | 637 | |
| 638 | 638 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 639 | 639 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "TMS3205x"); break; |
| r3957 | r3958 | |
| 715 | 715 | switch(state) |
| 716 | 716 | { |
| 717 | 717 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 718 | case CPUINFO_ | |
| 718 | case CPUINFO_FCT | |
| 719 | 719 | |
| 720 | 720 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 721 | 721 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS32051"); break; |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | #if (HAS_TMS32051) |
| 7 | 7 | CPU_GET_INFO( tms32051 ); |
| 8 | #define CPU_TMS32051 CPU_GET_INFO_NAME( tms32051 ) | |
| 8 | 9 | #endif |
| 9 | 10 | |
| 10 | 11 | CPU_DISASSEMBLE( tms32051 ); |
| r3957 | r3958 | |
|---|---|---|
| 891 | 891 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 892 | 892 | case CPUINFO_INT_MAX_CYCLES: info->i = 16; break; |
| 893 | 893 | |
| 894 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 895 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 10; break; | |
| 896 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 897 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 898 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 899 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 900 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 901 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 6; break; | |
| 902 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 894 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 895 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10; break; | |
| 896 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 897 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 898 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 899 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 900 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 901 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 6; break; | |
| 902 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 903 | 903 | #if HANDLE_HALT_LINE |
| 904 | 904 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_HALT: info->i = cpustate->halt ? ASSERT_LINE : CLEAR_LINE; break; |
| 905 | 905 | #endif |
| r3957 | r3958 | |
| 930 | 930 | case CPUINFO_INT_REGISTER + ALPHA8201_R7: info->i = RD_REG(7); break; |
| 931 | 931 | |
| 932 | 932 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 933 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(alpha8201); break; | |
| 934 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(alpha8201); break; | |
| 935 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(alpha8201); break; | |
| 936 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(alpha8201); break; | |
| 937 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 938 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(alpha8201); break; | |
| 933 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(alpha8201); break; | |
| 934 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(alpha8201); break; | |
| 935 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(alpha8201); break; | |
| 936 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(alpha8201); break; | |
| 937 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 938 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(alpha8201); break; | |
| 939 | 939 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 940 | 940 | |
| 941 | 941 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 976 | 976 | switch (state) |
| 977 | 977 | { |
| 978 | 978 | case CPUINFO_STR_NAME: strcpy(info->s, "ALPHA-8201"); break; |
| 979 | case CPUINFO_ | |
| 979 | case CPUINFO_FCT | |
| 980 | 980 | default: |
| 981 | 981 | /* 8201 / 8301 */ |
| 982 | 982 | CPU_GET_INFO_CALL(alpha8xxx); |
| r3957 | r3958 | |
| 990 | 990 | switch (state) |
| 991 | 991 | { |
| 992 | 992 | case CPUINFO_STR_NAME: strcpy(info->s, "ALPHA-8301"); break; |
| 993 | case CPUINFO_ | |
| 993 | case CPUINFO_FCT | |
| 994 | 994 | default: |
| 995 | 995 | /* 8201 / 8301 */ |
| 996 | 996 | CPU_GET_INFO_CALL(alpha8xxx); |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | extern CPU_GET_INFO( alpha8201 ); |
| 45 | 45 | extern CPU_GET_INFO( alpha8301 ); |
| 46 | 46 | |
| 47 | #define CPU_ALPHA8201 CPU_GET_INFO_NAME( alpha8201 ) | |
| 48 | #define CPU_ALPHA8301 CPU_GET_INFO_NAME( alpha8301 ) | |
| 49 | ||
| 47 | 50 | CPU_DISASSEMBLE( alpha8201 ); |
| 48 | 51 | |
| 49 | 52 | #endif /* __ALPH8201_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 882 | 882 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; /* IIRC */ break; |
| 883 | 883 | case CPUINFO_INT_MAX_CYCLES: info->i = 75; /* IIRC */ break; |
| 884 | 884 | |
| 885 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 886 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 15; /*13+2 ignored bits to make double word address*/ break; | |
| 887 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 888 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 889 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 890 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 891 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = /*5*/8; /* no I/O bus, but we use address 0 for punchtape I/O */ break; | |
| 892 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = /*0*/1; /*0 is quite enough but the MAME core does not understand*/ break; | |
| 893 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 885 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 886 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 15; /*13+2 ignored bits to make double word address*/ break; | |
| 887 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 888 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 889 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 890 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 891 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = /*5*/8; /* no I/O bus, but we use address 0 for punchtape I/O */ break; | |
| 892 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = /*0*/1; /*0 is quite enough but the MAME core does not understand*/ break; | |
| 893 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 894 | 894 | |
| 895 | 895 | case CPUINFO_INT_SP: info->i = 0; /* no SP */ break; |
| 896 | 896 | case CPUINFO_INT_PC: |
| r3957 | r3958 | |
| 910 | 910 | case CPUINFO_INT_REGISTER + APEXC_STATE: info->i = cpustate->running; break; |
| 911 | 911 | case CPUINFO_INT_REGISTER + APEXC_ML_FULL: info->i = effective_address(cpustate, cpustate->ml); break; |
| 912 | 912 | |
| 913 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(apexc); break; | |
| 914 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(apexc); break; | |
| 915 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(apexc); break; | |
| 916 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(apexc); break; | |
| 917 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 918 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(apexc); break; | |
| 913 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(apexc); break; | |
| 914 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(apexc); break; | |
| 915 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(apexc); break; | |
| 916 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(apexc); break; | |
| 917 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 918 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(apexc); break; | |
| 919 | 919 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 920 | 920 | |
| 921 | 921 | case CPUINFO_STR_NAME: strcpy(info->s, "APEXC"); break; |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | 21 | CPU_GET_INFO( apexc ); |
| 22 | #define CPU_APEXC CPU_GET_INFO_NAME( apexc ) | |
| 22 | 23 | |
| 23 | 24 | CPU_DISASSEMBLE( apexc ); |
| 24 | 25 |
| r3957 | r3958 | |
|---|---|---|
| 417 | 417 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 418 | 418 | case CPUINFO_INT_MAX_CYCLES: info->i = 20; /* rough guess */ break; |
| 419 | 419 | |
| 420 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 421 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24; break; | |
| 422 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 423 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 424 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 425 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 426 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 427 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 428 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 420 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 421 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24; break; | |
| 422 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 423 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 424 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 425 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 426 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 427 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 428 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 429 | 429 | |
| 430 | 430 | case CPUINFO_INT_INPUT_STATE + G65816_LINE_IRQ: info->i = LINE_IRQ; break; |
| 431 | 431 | case CPUINFO_INT_INPUT_STATE + G65816_LINE_NMI: info->i = LINE_NMI; break; |
| r3957 | r3958 | |
| 453 | 453 | case CPUINFO_INT_REGISTER + G65816_IRQ_STATE: info->i = g65816_get_reg(cpustate, G65816_IRQ_STATE); break; |
| 454 | 454 | |
| 455 | 455 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 456 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(g65816); break; | |
| 457 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(g65816); break; | |
| 458 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(g65816); break; | |
| 459 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(g65816); break; | |
| 460 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(g65816); break; | |
| 461 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 462 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(g65816); break; | |
| 456 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(g65816); break; | |
| 457 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(g65816); break; | |
| 458 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(g65816); break; | |
| 459 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(g65816); break; | |
| 460 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(g65816); break; | |
| 461 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 462 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(g65816); break; | |
| 463 | 463 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->ICount; break; |
| 464 | 464 | case CPUINFO_PTR_G65816_READVECTOR_CALLBACK: info->f = (genf *) READ_VECTOR; break; |
| 465 | 465 | |
| 466 | case CPUINFO_ | |
| 466 | case CPUINFO_FCT | |
| 467 | 467 | |
| 468 | 468 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 469 | 469 | case CPUINFO_STR_NAME: strcpy(info->s, "G65C816"); break; |
| r3957 | r3958 | |
|---|---|---|
| 2351 | 2351 | case G65816_A: return REGISTER_B | REGISTER_A; |
| 2352 | 2352 | case G65816_X: return REGISTER_X; |
| 2353 | 2353 | case G65816_Y: return REGISTER_Y; |
| 2354 | case REG_SP: return REGISTER_S; | |
| 2354 | case REG_GENSP: return REGISTER_S; | |
| 2355 | 2355 | case G65816_S: return REGISTER_S; |
| 2356 | case REG_PC: return REGISTER_PC; | |
| 2356 | case REG_GENPC: return REGISTER_PC; | |
| 2357 | 2357 | case G65816_PC: return REGISTER_PC; |
| 2358 | 2358 | case G65816_PB: return REGISTER_PB >> 16; |
| 2359 | 2359 | case G65816_DB: return REGISTER_DB >> 16; |
| r3957 | r3958 | |
| 2361 | 2361 | case G65816_P: return g65816i_get_reg_p(cpustate); |
| 2362 | 2362 | case G65816_NMI_STATE: return LINE_NMI; |
| 2363 | 2363 | case G65816_IRQ_STATE: return LINE_IRQ; |
| 2364 | case REG_ | |
| 2364 | case REG_G | |
| 2365 | 2365 | } |
| 2366 | 2366 | return 0; |
| 2367 | 2367 | } |
| r3957 | r3958 | |
| 2372 | 2372 | { |
| 2373 | 2373 | switch(regnum) |
| 2374 | 2374 | { |
| 2375 | case REG_PC: case G65816_PC: REGISTER_PC = MAKE_UINT_16(val); break; | |
| 2375 | case REG_GENPC: case G65816_PC: REGISTER_PC = MAKE_UINT_16(val); break; | |
| 2376 | 2376 | #if FLAG_SET_E |
| 2377 | case REG_SP: case G65816_S: REGISTER_S = MAKE_UINT_8(val) | 0x100; break; | |
| 2377 | case REG_GENSP: case G65816_S: REGISTER_S = MAKE_UINT_8(val) | 0x100; break; | |
| 2378 | 2378 | #else |
| 2379 | case REG_SP: case G65816_S: REGISTER_S = MAKE_UINT_16(val); break; | |
| 2379 | case REG_GENSP: case G65816_S: REGISTER_S = MAKE_UINT_16(val); break; | |
| 2380 | 2380 | #endif |
| 2381 | 2381 | case G65816_P: g65816i_set_reg_p(cpustate, val); break; |
| 2382 | 2382 | #if FLAG_SET_M |
| r3957 | r3958 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | /* Main interface function */ |
| 67 | 67 | CPU_GET_INFO( g65816 ); |
| 68 | #define CPU_G65816 CPU_GET_INFO_NAME( g65816 ) | |
| 68 | 69 | |
| 69 | #undef G65816_CALL_DEBUGGER | |
| 70 | #define G65816_CALL_DEBUGGER(x) debugger_instruction_hook(cpustate->device, x) | |
| 71 | 70 | |
| 72 | #define g65816_read_8(addr) memory_read_byte_8be(cpustate->program, addr) | |
| 73 | #define g65816_write_8(addr,data) memory_write_byte_8be(cpustate->program, addr,data) | |
| 74 | #define g65816_read_8_immediate(A) memory_read_byte_8be(cpustate->program, A) | |
| 75 | #define g65816_jumping(A) | |
| 76 | #define g65816_branching(A) | |
| 77 | 71 | |
| 78 | ||
| 79 | ||
| 80 | 72 | /* ======================================================================== */ |
| 81 | 73 | /* ============================== END OF FILE ============================= */ |
| 82 | 74 | /* ======================================================================== */ |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | #define g65816i_jumping(A) |
| 10 | 10 | |
| 11 | 11 | |
| 12 | #undef G65816_CALL_DEBUGGER | |
| 13 | #define G65816_CALL_DEBUGGER(x) debugger_instruction_hook(cpustate->device, x) | |
| 14 | ||
| 15 | #define g65816_read_8(addr) memory_read_byte_8be(cpustate->program, addr) | |
| 16 | #define g65816_write_8(addr,data) memory_write_byte_8be(cpustate->program, addr,data) | |
| 17 | #define g65816_read_8_immediate(A) memory_read_byte_8be(cpustate->program, A) | |
| 18 | #define g65816_jumping(A) | |
| 19 | #define g65816_branching(A) | |
| 20 | ||
| 21 | ||
| 12 | 22 | /* ======================================================================== */ |
| 13 | 23 | /* ================================ INCLUDES ============================== */ |
| 14 | 24 | /* ======================================================================== */ |
| r3957 | r3958 | |
|---|---|---|
| 110 | 110 | typedef UINT16 WORD; |
| 111 | 111 | typedef UINT32 DWORD; |
| 112 | 112 | |
| 113 | #include "necpriv.h" | |
| 113 | 114 | #include "nec.h" |
| 114 | #include "necintrf.h" | |
| 115 | 115 | |
| 116 | 116 | #define PC(n) (((n)->sregs[PS]<<4)+(n)->ip) |
| 117 | 117 | |
| r3957 | r3958 | |
| 1087 | 1087 | return necv_dasm_one(buffer, pc, oprom, nec_state->config); |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | static void nec_init(const device_config *device, | |
| 1090 | static void nec_init(const device_config *device, | |
| 1091 | 1091 | { |
| 1092 | 1092 | const nec_config *config = device->static_config ? device->static_config : &default_config; |
| 1093 | 1093 | nec_state_t *nec_state = device->token; |
| r3957 | r3958 | |
| 1212 | 1212 | { |
| 1213 | 1213 | nec_state_t *nec_state = device->token; |
| 1214 | 1214 | |
| 1215 | nec_init(device, i | |
| 1215 | nec_init(device, i | |
| 1216 | 1216 | configure_memory_8bit(nec_state); |
| 1217 | 1217 | nec_state->chip_type=V20; |
| 1218 | 1218 | nec_state->prefetch_size = 4; /* 3 words */ |
| r3957 | r3958 | |
| 1225 | 1225 | { |
| 1226 | 1226 | nec_state_t *nec_state = device->token; |
| 1227 | 1227 | |
| 1228 | nec_init(device, i | |
| 1228 | nec_init(device, i | |
| 1229 | 1229 | configure_memory_16bit(nec_state); |
| 1230 | 1230 | nec_state->chip_type=V30; |
| 1231 | 1231 | nec_state->prefetch_size = 6; /* 3 words */ |
| r3957 | r3958 | |
| 1239 | 1239 | { |
| 1240 | 1240 | nec_state_t *nec_state = device->token; |
| 1241 | 1241 | |
| 1242 | nec_init(device, i | |
| 1242 | nec_init(device, i | |
| 1243 | 1243 | nec_state->chip_type=V33; |
| 1244 | 1244 | nec_state->prefetch_size = 6; |
| 1245 | 1245 | /* FIXME: Need information about prefetch size and cycles for V33. |
| r3957 | r3958 | |
| 1334 | 1334 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1335 | 1335 | case CPUINFO_INT_MAX_CYCLES: info->i = 80; break; |
| 1336 | 1336 | |
| 1337 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1338 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 1339 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1340 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1341 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1342 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1343 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 1344 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 1345 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1337 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1338 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 1339 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1340 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1341 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1342 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1343 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 1344 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 1345 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1346 | 1346 | |
| 1347 | 1347 | case CPUINFO_INT_INPUT_STATE + 0: info->i = (nec_state->pending_irq & INT_IRQ) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1348 | 1348 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = nec_state->nmi_state; break; |
| r3957 | r3958 | |
| 1371 | 1371 | case CPUINFO_INT_REGISTER + NEC_PENDING: info->i = nec_state->pending_irq; break; |
| 1372 | 1372 | |
| 1373 | 1373 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1374 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(nec); break; | |
| 1375 | case CPUINFO_PTR_INIT: /* set per-CPU */ break; | |
| 1376 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(nec); break; | |
| 1377 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(nec); break; | |
| 1378 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(necv); break; | |
| 1379 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1380 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(nec); break; | |
| 1374 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(nec); break; | |
| 1375 | case CPUINFO_FCT_INIT: /* set per-CPU */ break; | |
| 1376 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(nec); break; | |
| 1377 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(nec); break; | |
| 1378 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(necv); break; | |
| 1379 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1380 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(nec); break; | |
| 1381 | 1381 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &nec_state->icount; break; |
| 1382 | 1382 | |
| 1383 | 1383 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1438 | 1438 | switch (state) |
| 1439 | 1439 | { |
| 1440 | 1440 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1441 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1442 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1441 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1442 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1443 | 1443 | |
| 1444 | 1444 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1445 | case CPUINFO_ | |
| 1445 | case CPUINFO_FCT | |
| 1446 | 1446 | |
| 1447 | 1447 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1448 | 1448 | case CPUINFO_STR_NAME: strcpy(info->s, "V20"); break; |
| r3957 | r3958 | |
| 1463 | 1463 | switch (state) |
| 1464 | 1464 | { |
| 1465 | 1465 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1466 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1467 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1466 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1467 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1468 | 1468 | |
| 1469 | 1469 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1470 | case CPUINFO_ | |
| 1470 | case CPUINFO_FCT | |
| 1471 | 1471 | |
| 1472 | 1472 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1473 | 1473 | case CPUINFO_STR_NAME: strcpy(info->s, "V25"); break; |
| r3957 | r3958 | |
| 1488 | 1488 | switch (state) |
| 1489 | 1489 | { |
| 1490 | 1490 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1491 | case CPUINFO_ | |
| 1491 | case CPUINFO_FCT | |
| 1492 | 1492 | |
| 1493 | 1493 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1494 | 1494 | case CPUINFO_STR_NAME: strcpy(info->s, "V30"); break; |
| r3957 | r3958 | |
| 1509 | 1509 | switch (state) |
| 1510 | 1510 | { |
| 1511 | 1511 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1512 | case CPUINFO_ | |
| 1512 | case CPUINFO_FCT | |
| 1513 | 1513 | |
| 1514 | 1514 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1515 | 1515 | case CPUINFO_STR_NAME: strcpy(info->s, "V33"); break; |
| r3957 | r3958 | |
| 1530 | 1530 | switch (state) |
| 1531 | 1531 | { |
| 1532 | 1532 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1533 | case CPUINFO_ | |
| 1533 | case CPUINFO_FCT | |
| 1534 | 1534 | |
| 1535 | 1535 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1536 | 1536 | case CPUINFO_STR_NAME: strcpy(info->s, "V35"); break; |
| r3957 | r3958 | |
|---|---|---|
| 1 | /* ASG 971222 -- rewrote this interface */ | |
| 2 | #ifndef __NEC_H_ | |
| 3 | #define __NEC_H_ | |
| 4 | ||
| 1 | 5 | #include "cpuintrf.h" |
| 2 | 6 | |
| 3 | 7 | typedef struct _nec_config nec_config; |
| r3957 | r3958 | |
| 6 | 10 | const UINT8* v25v35_decryptiontable; // internal decryption table |
| 7 | 11 | }; |
| 8 | 12 | |
| 9 | ||
| 10 | typedef enum { DS1, PS, SS, DS0 } SREGS; | |
| 11 | typedef enum { AW, CW, DW, BW, SP, BP, IX, IY } WREGS; | |
| 12 | ||
| 13 | #define NEC_NMI_INT_VECTOR 2 | |
| 14 | 13 | #define NEC_INPUT_LINE_POLL 20 |
| 15 | 14 | |
| 16 | /* Cpu types, steps of 8 to help the cycle count calculation */ | |
| 17 | #define V33 0 | |
| 18 | #define V30 8 | |
| 19 | #define V20 16 | |
| 15 | enum | |
| 16 | { | |
| 17 | NEC_PC=0, | |
| 18 | NEC_IP, NEC_AW, NEC_CW, NEC_DW, NEC_BW, NEC_SP, NEC_BP, NEC_IX, NEC_IY, | |
| 19 | NEC_FLAGS, NEC_ES, NEC_CS, NEC_SS, NEC_DS, | |
| 20 | NEC_VECTOR, NEC_PENDING | |
| 21 | }; | |
| 20 | 22 | |
| 21 | #ifndef FALSE | |
| 22 | #define FALSE 0 | |
| 23 | #define TRUE 1 | |
| 24 | #endif | |
| 23 | /* Public functions */ | |
| 24 | extern CPU_GET_INFO( v20 ); | |
| 25 | extern CPU_GET_INFO( v25 ); | |
| 26 | extern CPU_GET_INFO( v30 ); | |
| 27 | extern CPU_GET_INFO( v33 ); | |
| 28 | extern CPU_GET_INFO( v35 ); | |
| 25 | 29 | |
| 26 | #ifdef LSB_FIRST | |
| 27 | typedef enum { AL,AH,CL,CH,DL,DH,BL,BH,SPL,SPH,BPL,BPH,IXL,IXH,IYL,IYH } BREGS; | |
| 28 | #else | |
| 29 | typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; | |
| 30 | #endif | |
| 30 | #define CPU_V20 CPU_GET_INFO_NAME( v20 ) | |
| 31 | #define CPU_V25 CPU_GET_INFO_NAME( v25 ) | |
| 32 | #define CPU_V30 CPU_GET_INFO_NAME( v30 ) | |
| 33 | #define CPU_V33 CPU_GET_INFO_NAME( v33 ) | |
| 34 | #define CPU_V35 CPU_GET_INFO_NAME( v35 ) | |
| 31 | 35 | |
| 32 | /* parameter x = result, y = source 1, z = source 2 */ | |
| 33 | ||
| 34 | #define SetTF(x) (nec_state->TF = (x)) | |
| 35 | #define SetIF(x) (nec_state->IF = (x)) | |
| 36 | #define SetDF(x) (nec_state->DF = (x)) | |
| 37 | #define SetMD(x) (nec_state->MF = (x)) /* OB [19.07.99] Mode Flag V30 */ | |
| 38 | ||
| 39 | #define SetCFB(x) (nec_state->CarryVal = (x) & 0x100) | |
| 40 | #define SetCFW(x) (nec_state->CarryVal = (x) & 0x10000) | |
| 41 | #define SetAF(x,y,z) (nec_state->AuxVal = ((x) ^ ((y) ^ (z))) & 0x10) | |
| 42 | #define SetSF(x) (nec_state->SignVal = (x)) | |
| 43 | #define SetZF(x) (nec_state->ZeroVal = (x)) | |
| 44 | #define SetPF(x) (nec_state->ParityVal = (x)) | |
| 45 | ||
| 46 | #define SetSZPF_Byte(x) (nec_state->SignVal=nec_state->ZeroVal=nec_state->ParityVal=(INT8)(x)) | |
| 47 | #define SetSZPF_Word(x) (nec_state->SignVal=nec_state->ZeroVal=nec_state->ParityVal=(INT16)(x)) | |
| 48 | ||
| 49 | #define SetOFW_Add(x,y,z) (nec_state->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x8000) | |
| 50 | #define SetOFB_Add(x,y,z) (nec_state->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x80) | |
| 51 | #define SetOFW_Sub(x,y,z) (nec_state->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x8000) | |
| 52 | #define SetOFB_Sub(x,y,z) (nec_state->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x80) | |
| 53 | ||
| 54 | #define ADDB { UINT32 res=dst+src; SetCFB(res); SetOFB_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 55 | #define ADDW { UINT32 res=dst+src; SetCFW(res); SetOFW_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 56 | ||
| 57 | #define SUBB { UINT32 res=dst-src; SetCFB(res); SetOFB_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 58 | #define SUBW { UINT32 res=dst-src; SetCFW(res); SetOFW_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 59 | ||
| 60 | #define ORB dst|=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) | |
| 61 | #define ORW dst|=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) | |
| 62 | ||
| 63 | #define ANDB dst&=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) | |
| 64 | #define ANDW dst&=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) | |
| 65 | ||
| 66 | #define XORB dst^=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) | |
| 67 | #define XORW dst^=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) | |
| 68 | ||
| 69 | #define CF (nec_state->CarryVal!=0) | |
| 70 | #define SF (nec_state->SignVal<0) | |
| 71 | #define ZF (nec_state->ZeroVal==0) | |
| 72 | #define PF parity_table[(BYTE)nec_state->ParityVal] | |
| 73 | #define AF (nec_state->AuxVal!=0) | |
| 74 | #define OF (nec_state->OverVal!=0) | |
| 75 | #define MD (nec_state->MF!=0) | |
| 76 | ||
| 77 | /************************************************************************/ | |
| 78 | ||
| 79 | #define read_byte(a) (*nec_state->mem.rbyte)(nec_state->program, a) | |
| 80 | #define read_word(a) (*nec_state->mem.rword)(nec_state->program, a) | |
| 81 | #define write_byte(a,d) (*nec_state->mem.wbyte)(nec_state->program, (a),(d)) | |
| 82 | #define write_word(a,d) (*nec_state->mem.wword)(nec_state->program, (a),(d)) | |
| 83 | ||
| 84 | #define read_port_byte(a) (*nec_state->mem.rbyte)(nec_state->io, a) | |
| 85 | #define read_port_word(a) (*nec_state->mem.rword)(nec_state->io, a) | |
| 86 | #define write_port_byte(a,d) (*nec_state->mem.wbyte)(nec_state->io, (a),(d)) | |
| 87 | #define write_port_word(a,d) (*nec_state->mem.wword)(nec_state->io, (a),(d)) | |
| 88 | ||
| 89 | /************************************************************************/ | |
| 90 | ||
| 91 | #define CHANGE_PC do { EMPTY_PREFETCH(); } while (0) | |
| 92 | ||
| 93 | #define SegBase(Seg) (nec_state->sregs[Seg] << 4) | |
| 94 | ||
| 95 | #define DefaultBase(Seg) ((nec_state->seg_prefix && (Seg==DS0 || Seg==SS)) ? nec_state->prefix_base : nec_state->sregs[Seg] << 4) | |
| 96 | ||
| 97 | #define GetMemB(Seg,Off) (read_byte(DefaultBase(Seg) + (Off))) | |
| 98 | #define GetMemW(Seg,Off) (read_word(DefaultBase(Seg) + (Off))) | |
| 99 | ||
| 100 | #define PutMemB(Seg,Off,x) { write_byte(DefaultBase(Seg) + (Off), (x)); } | |
| 101 | #define PutMemW(Seg,Off,x) { write_word(DefaultBase(Seg) + (Off), (x)); } | |
| 102 | ||
| 103 | /* prefetch timing */ | |
| 104 | ||
| 105 | #define FETCH() fetch(nec_state) | |
| 106 | #define FETCH_XOR(a) ((a) ^ nec_state->mem.fetch_xor) | |
| 107 | #define FETCHWORD() fetchword(nec_state) | |
| 108 | #define EMPTY_PREFETCH() nec_state->prefetch_reset = 1 | |
| 109 | ||
| 110 | ||
| 111 | #define PUSH(val) { nec_state->regs.w[SP]-=2; write_word((((nec_state->sregs[SS]<<4)+nec_state->regs.w[SP])),val); } | |
| 112 | #define POP(var) { var = read_word((((nec_state->sregs[SS]<<4)+nec_state->regs.w[SP]))); nec_state->regs.w[SP]+=2; } | |
| 113 | ||
| 114 | #define GetModRM UINT32 ModRM=FETCH() | |
| 115 | ||
| 116 | /* Cycle count macros: | |
| 117 | CLK - cycle count is the same on all processors | |
| 118 | CLKS - cycle count differs between processors, list all counts | |
| 119 | CLKW - cycle count for word read/write differs for odd/even source/destination address | |
| 120 | CLKM - cycle count for reg/mem instructions | |
| 121 | CLKR - cycle count for reg/mem instructions with different counts for odd/even addresses | |
| 122 | ||
| 123 | ||
| 124 | Prefetch & buswait time is not emulated. | |
| 125 | Extra cycles for PUSH'ing or POP'ing registers to odd addresses is not emulated. | |
| 126 | */ | |
| 127 | ||
| 128 | #define CLK(all) nec_state->icount-=all | |
| 129 | #define CLKS(v20,v30,v33) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33; nec_state->icount-=(ccount>>nec_state->chip_type)&0x7f; } | |
| 130 | #define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } | |
| 131 | #define CLKM(v20,v30,v33,v20m,v30m,v33m) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; nec_state->icount-=( ModRM >=0xc0 )?((ccount>>nec_state->chip_type)&0x7f):((mcount>>nec_state->chip_type)&0x7f); } | |
| 132 | #define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) nec_state->icount-=vall; else nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } | |
| 133 | ||
| 134 | /************************************************************************/ | |
| 135 | #define CompressFlags() (WORD)(CF | (PF << 2) | (AF << 4) | (ZF << 6) \ | |
| 136 | | (SF << 7) | (nec_state->TF << 8) | (nec_state->IF << 9) \ | |
| 137 | | (nec_state->DF << 10) | (OF << 11)| (MD << 15)) | |
| 138 | ||
| 139 | #define ExpandFlags(f) \ | |
| 140 | { \ | |
| 141 | nec_state->CarryVal = (f) & 1; \ | |
| 142 | nec_state->ParityVal = !((f) & 4); \ | |
| 143 | nec_state->AuxVal = (f) & 16; \ | |
| 144 | nec_state->ZeroVal = !((f) & 64); \ | |
| 145 | nec_state->SignVal = (f) & 128 ? -1 : 0; \ | |
| 146 | nec_state->TF = ((f) & 256) == 256; \ | |
| 147 | nec_state->IF = ((f) & 512) == 512; \ | |
| 148 | nec_state->DF = ((f) & 1024) == 1024; \ | |
| 149 | nec_state->OverVal = (f) & 2048; \ | |
| 150 | nec_state->MF = ((f) & 0x8000) == 0x8000; \ | |
| 151 | } | |
| 152 | ||
| 153 | #define IncWordReg(Reg) \ | |
| 154 | unsigned tmp = (unsigned)nec_state->regs.w[Reg]; \ | |
| 155 | unsigned tmp1 = tmp+1; \ | |
| 156 | nec_state->OverVal = (tmp == 0x7fff); \ | |
| 157 | SetAF(tmp1,tmp,1); \ | |
| 158 | SetSZPF_Word(tmp1); \ | |
| 159 | nec_state->regs.w[Reg]=tmp1 | |
| 160 | ||
| 161 | #define DecWordReg(Reg) \ | |
| 162 | unsigned tmp = (unsigned)nec_state->regs.w[Reg]; \ | |
| 163 | unsigned tmp1 = tmp-1; \ | |
| 164 | nec_state->OverVal = (tmp == 0x8000); \ | |
| 165 | SetAF(tmp1,tmp,1); \ | |
| 166 | SetSZPF_Word(tmp1); \ | |
| 167 | nec_state->regs.w[Reg]=tmp1 | |
| 168 | ||
| 169 | #define JMP(flag) \ | |
| 170 | int tmp; \ | |
| 171 | EMPTY_PREFETCH(); \ | |
| 172 | tmp = (int)((INT8)FETCH()); \ | |
| 173 | if (flag) \ | |
| 174 | { \ | |
| 175 | static const UINT8 table[3]={3,10,10}; \ | |
| 176 | nec_state->ip = (WORD)(nec_state->ip+tmp); \ | |
| 177 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 178 | CHANGE_PC; \ | |
| 179 | return; \ | |
| 180 | } | |
| 181 | ||
| 182 | #define ADJ4(param1,param2) \ | |
| 183 | if (AF || ((nec_state->regs.b[AL] & 0xf) > 9)) \ | |
| 184 | { \ | |
| 185 | UINT16 tmp; \ | |
| 186 | tmp = nec_state->regs.b[AL] + param1; \ | |
| 187 | nec_state->regs.b[AL] = tmp; \ | |
| 188 | nec_state->AuxVal = 1; \ | |
| 189 | nec_state->CarryVal |= tmp & 0x100; \ | |
| 190 | } \ | |
| 191 | if (CF || (nec_state->regs.b[AL]>0x9f)) \ | |
| 192 | { \ | |
| 193 | nec_state->regs.b[AL] += param2; \ | |
| 194 | nec_state->CarryVal = 1; \ | |
| 195 | } \ | |
| 196 | SetSZPF_Byte(nec_state->regs.b[AL]) | |
| 197 | ||
| 198 | #define ADJB(param1,param2) \ | |
| 199 | if (AF || ((nec_state->regs.b[AL] & 0xf) > 9)) \ | |
| 200 | { \ | |
| 201 | nec_state->regs.b[AL] += param1; \ | |
| 202 | nec_state->regs.b[AH] += param2; \ | |
| 203 | nec_state->AuxVal = 1; \ | |
| 204 | nec_state->CarryVal = 1; \ | |
| 205 | } \ | |
| 206 | else \ | |
| 207 | { \ | |
| 208 | nec_state->AuxVal = 0; \ | |
| 209 | nec_state->CarryVal = 0; \ | |
| 210 | } \ | |
| 211 | nec_state->regs.b[AL] &= 0x0F | |
| 212 | ||
| 213 | #define BITOP_BYTE \ | |
| 214 | ModRM = FETCH(); \ | |
| 215 | if (ModRM >= 0xc0) { \ | |
| 216 | tmp=nec_state->regs.b[Mod_RM.RM.b[ModRM]]; \ | |
| 217 | } \ | |
| 218 | else { \ | |
| 219 | (*GetEA[ModRM])(nec_state); \ | |
| 220 | tmp=read_byte(EA); \ | |
| 221 | } | |
| 222 | ||
| 223 | #define BITOP_WORD \ | |
| 224 | ModRM = FETCH(); \ | |
| 225 | if (ModRM >= 0xc0) { \ | |
| 226 | tmp=nec_state->regs.w[Mod_RM.RM.w[ModRM]]; \ | |
| 227 | } \ | |
| 228 | else { \ | |
| 229 | (*GetEA[ModRM])(nec_state); \ | |
| 230 | tmp=read_word(EA); \ | |
| 231 | } | |
| 232 | ||
| 233 | #define BIT_NOT \ | |
| 234 | if (tmp & (1<<tmp2)) \ | |
| 235 | tmp &= ~(1<<tmp2); \ | |
| 236 | else \ | |
| 237 | tmp |= (1<<tmp2) | |
| 238 | ||
| 239 | #define XchgAWReg(Reg) \ | |
| 240 | WORD tmp; \ | |
| 241 | tmp = nec_state->regs.w[Reg]; \ | |
| 242 | nec_state->regs.w[Reg] = nec_state->regs.w[AW]; \ | |
| 243 | nec_state->regs.w[AW] = tmp | |
| 244 | ||
| 245 | #define ROL_BYTE nec_state->CarryVal = dst & 0x80; dst = (dst << 1)+CF | |
| 246 | #define ROL_WORD nec_state->CarryVal = dst & 0x8000; dst = (dst << 1)+CF | |
| 247 | #define ROR_BYTE nec_state->CarryVal = dst & 0x1; dst = (dst >> 1)+(CF<<7) | |
| 248 | #define ROR_WORD nec_state->CarryVal = dst & 0x1; dst = (dst >> 1)+(CF<<15) | |
| 249 | #define ROLC_BYTE dst = (dst << 1) + CF; SetCFB(dst) | |
| 250 | #define ROLC_WORD dst = (dst << 1) + CF; SetCFW(dst) | |
| 251 | #define RORC_BYTE dst = (CF<<8)+dst; nec_state->CarryVal = dst & 0x01; dst >>= 1 | |
| 252 | #define RORC_WORD dst = (CF<<16)+dst; nec_state->CarryVal = dst & 0x01; dst >>= 1 | |
| 253 | #define SHL_BYTE(c) nec_state->icount-=c; dst <<= c; SetCFB(dst); SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) | |
| 254 | #define SHL_WORD(c) nec_state->icount-=c; dst <<= c; SetCFW(dst); SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) | |
| 255 | #define SHR_BYTE(c) nec_state->icount-=c; dst >>= c-1; nec_state->CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) | |
| 256 | #define SHR_WORD(c) nec_state->icount-=c; dst >>= c-1; nec_state->CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) | |
| 257 | #define SHRA_BYTE(c) nec_state->icount-=c; dst = ((INT8)dst) >> (c-1); nec_state->CarryVal = dst & 0x1; dst = ((INT8)((BYTE)dst)) >> 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) | |
| 258 | #define SHRA_WORD(c) nec_state->icount-=c; dst = ((INT16)dst) >> (c-1); nec_state->CarryVal = dst & 0x1; dst = ((INT16)((WORD)dst)) >> 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) | |
| 259 | ||
| 260 | #define DIVUB \ | |
| 261 | uresult = nec_state->regs.w[AW]; \ | |
| 262 | uresult2 = uresult % tmp; \ | |
| 263 | if ((uresult /= tmp) > 0xff) { \ | |
| 264 | nec_interrupt(nec_state, 0,0); break; \ | |
| 265 | } else { \ | |
| 266 | nec_state->regs.b[AL] = uresult; \ | |
| 267 | nec_state->regs.b[AH] = uresult2; \ | |
| 268 | } | |
| 269 | ||
| 270 | #define DIVB \ | |
| 271 | result = (INT16)nec_state->regs.w[AW]; \ | |
| 272 | result2 = result % (INT16)((INT8)tmp); \ | |
| 273 | if ((result /= (INT16)((INT8)tmp)) > 0xff) { \ | |
| 274 | nec_interrupt(nec_state, 0,0); break; \ | |
| 275 | } else { \ | |
| 276 | nec_state->regs.b[AL] = result; \ | |
| 277 | nec_state->regs.b[AH] = result2; \ | |
| 278 | } | |
| 279 | ||
| 280 | #define DIVUW \ | |
| 281 | uresult = (((UINT32)nec_state->regs.w[DW]) << 16) | nec_state->regs.w[AW];\ | |
| 282 | uresult2 = uresult % tmp; \ | |
| 283 | if ((uresult /= tmp) > 0xffff) { \ | |
| 284 | nec_interrupt(nec_state, 0,0); break; \ | |
| 285 | } else { \ | |
| 286 | nec_state->regs.w[AW]=uresult; \ | |
| 287 | nec_state->regs.w[DW]=uresult2; \ | |
| 288 | } | |
| 289 | ||
| 290 | #define DIVW \ | |
| 291 | result = ((UINT32)nec_state->regs.w[DW] << 16) + nec_state->regs.w[AW]; \ | |
| 292 | result2 = result % (INT32)((INT16)tmp); \ | |
| 293 | if ((result /= (INT32)((INT16)tmp)) > 0xffff) { \ | |
| 294 | nec_interrupt(nec_state, 0,0); break; \ | |
| 295 | } else { \ | |
| 296 | nec_state->regs.w[AW]=result; \ | |
| 297 | nec_state->regs.w[DW]=result2; \ | |
| 298 | } | |
| 299 | ||
| 300 | #define ADD4S { \ | |
| 301 | int i,v1,v2,result; \ | |
| 302 | int count = (nec_state->regs.b[CL]+1)/2; \ | |
| 303 | unsigned di = nec_state->regs.w[IY]; \ | |
| 304 | unsigned si = nec_state->regs.w[IX]; \ | |
| 305 | static const UINT8 table[3]={18,19,19}; \ | |
| 306 | if (nec_state->seg_prefix) logerror("%06x: Warning: seg_prefix defined for add4s\n",PC(nec_state)); \ | |
| 307 | nec_state->ZeroVal = nec_state->CarryVal = 0; \ | |
| 308 | for (i=0;i<count;i++) { \ | |
| 309 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 310 | tmp = GetMemB(DS0, si); \ | |
| 311 | tmp2 = GetMemB(DS1, di); \ | |
| 312 | v1 = (tmp>>4)*10 + (tmp&0xf); \ | |
| 313 | v2 = (tmp2>>4)*10 + (tmp2&0xf); \ | |
| 314 | result = v1+v2+nec_state->CarryVal; \ | |
| 315 | nec_state->CarryVal = result > 99 ? 1 : 0; \ | |
| 316 | result = result % 100; \ | |
| 317 | v1 = ((result/10)<<4) | (result % 10); \ | |
| 318 | PutMemB(DS1, di,v1); \ | |
| 319 | if (v1) nec_state->ZeroVal = 1; \ | |
| 320 | si++; \ | |
| 321 | di++; \ | |
| 322 | } \ | |
| 323 | } | |
| 324 | ||
| 325 | #define SUB4S { \ | |
| 326 | int count = (nec_state->regs.b[CL]+1)/2; \ | |
| 327 | int i,v1,v2,result; \ | |
| 328 | unsigned di = nec_state->regs.w[IY]; \ | |
| 329 | unsigned si = nec_state->regs.w[IX]; \ | |
| 330 | static const UINT8 table[3]={18,19,19}; \ | |
| 331 | if (nec_state->seg_prefix) logerror("%06x: Warning: seg_prefix defined for sub4s\n",PC(nec_state)); \ | |
| 332 | nec_state->ZeroVal = nec_state->CarryVal = 0; \ | |
| 333 | for (i=0;i<count;i++) { \ | |
| 334 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 335 | tmp = GetMemB(DS1, di); \ | |
| 336 | tmp2 = GetMemB(DS0, si); \ | |
| 337 | v1 = (tmp>>4)*10 + (tmp&0xf); \ | |
| 338 | v2 = (tmp2>>4)*10 + (tmp2&0xf); \ | |
| 339 | if (v1 < (v2+nec_state->CarryVal)) { \ | |
| 340 | v1+=100; \ | |
| 341 | result = v1-(v2+nec_state->CarryVal); \ | |
| 342 | nec_state->CarryVal = 1; \ | |
| 343 | } else { \ | |
| 344 | result = v1-(v2+nec_state->CarryVal); \ | |
| 345 | nec_state->CarryVal = 0; \ | |
| 346 | } \ | |
| 347 | v1 = ((result/10)<<4) | (result % 10); \ | |
| 348 | PutMemB(DS1, di,v1); \ | |
| 349 | if (v1) nec_state->ZeroVal = 1; \ | |
| 350 | si++; \ | |
| 351 | di++; \ | |
| 352 | } \ | |
| 353 | } | |
| 354 | ||
| 355 | #define CMP4S { \ | |
| 356 | int count = (nec_state->regs.b[CL]+1)/2; \ | |
| 357 | int i,v1,v2,result; \ | |
| 358 | unsigned di = nec_state->regs.w[IY]; \ | |
| 359 | unsigned si = nec_state->regs.w[IX]; \ | |
| 360 | static const UINT8 table[3]={14,19,19}; \ | |
| 361 | if (nec_state->seg_prefix) logerror("%06x: Warning: seg_prefix defined for cmp4s\n",PC(nec_state)); \ | |
| 362 | nec_state->ZeroVal = nec_state->CarryVal = 0; \ | |
| 363 | for (i=0;i<count;i++) { \ | |
| 364 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 365 | tmp = GetMemB(DS1, di); \ | |
| 366 | tmp2 = GetMemB(DS0, si); \ | |
| 367 | v1 = (tmp>>4)*10 + (tmp&0xf); \ | |
| 368 | v2 = (tmp2>>4)*10 + (tmp2&0xf); \ | |
| 369 | if (v1 < (v2+nec_state->CarryVal)) { \ | |
| 370 | v1+=100; \ | |
| 371 | result = v1-(v2+nec_state->CarryVal); \ | |
| 372 | nec_state->CarryVal = 1; \ | |
| 373 | } else { \ | |
| 374 | result = v1-(v2+nec_state->CarryVal); \ | |
| 375 | nec_state->CarryVal = 0; \ | |
| 376 | } \ | |
| 377 | v1 = ((result/10)<<4) | (result % 10); \ | |
| 378 | if (v1) nec_state->ZeroVal = 1; \ | |
| 379 | si++; \ | |
| 380 | di++; \ | |
| 381 | } \ | |
| 382 | } | |
| 36 | #endif |
| r0 | r3958 | |
|---|---|---|
| 1 | #include "cpuintrf.h" | |
| 2 | ||
| 3 | typedef enum { DS1, PS, SS, DS0 } SREGS; | |
| 4 | typedef enum { AW, CW, DW, BW, SP, BP, IX, IY } WREGS; | |
| 5 | ||
| 6 | #define NEC_NMI_INT_VECTOR 2 | |
| 7 | ||
| 8 | /* Cpu types, steps of 8 to help the cycle count calculation */ | |
| 9 | #define V33 0 | |
| 10 | #define V30 8 | |
| 11 | #define V20 16 | |
| 12 | ||
| 13 | #ifndef FALSE | |
| 14 | #define FALSE 0 | |
| 15 | #define TRUE 1 | |
| 16 | #endif | |
| 17 | ||
| 18 | #ifdef LSB_FIRST | |
| 19 | typedef enum { AL,AH,CL,CH,DL,DH,BL,BH,SPL,SPH,BPL,BPH,IXL,IXH,IYL,IYH } BREGS; | |
| 20 | #else | |
| 21 | typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; | |
| 22 | #endif | |
| 23 | ||
| 24 | /* parameter x = result, y = source 1, z = source 2 */ | |
| 25 | ||
| 26 | #define SetTF(x) (nec_state->TF = (x)) | |
| 27 | #define SetIF(x) (nec_state->IF = (x)) | |
| 28 | #define SetDF(x) (nec_state->DF = (x)) | |
| 29 | #define SetMD(x) (nec_state->MF = (x)) /* OB [19.07.99] Mode Flag V30 */ | |
| 30 | ||
| 31 | #define SetCFB(x) (nec_state->CarryVal = (x) & 0x100) | |
| 32 | #define SetCFW(x) (nec_state->CarryVal = (x) & 0x10000) | |
| 33 | #define SetAF(x,y,z) (nec_state->AuxVal = ((x) ^ ((y) ^ (z))) & 0x10) | |
| 34 | #define SetSF(x) (nec_state->SignVal = (x)) | |
| 35 | #define SetZF(x) (nec_state->ZeroVal = (x)) | |
| 36 | #define SetPF(x) (nec_state->ParityVal = (x)) | |
| 37 | ||
| 38 | #define SetSZPF_Byte(x) (nec_state->SignVal=nec_state->ZeroVal=nec_state->ParityVal=(INT8)(x)) | |
| 39 | #define SetSZPF_Word(x) (nec_state->SignVal=nec_state->ZeroVal=nec_state->ParityVal=(INT16)(x)) | |
| 40 | ||
| 41 | #define SetOFW_Add(x,y,z) (nec_state->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x8000) | |
| 42 | #define SetOFB_Add(x,y,z) (nec_state->OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x80) | |
| 43 | #define SetOFW_Sub(x,y,z) (nec_state->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x8000) | |
| 44 | #define SetOFB_Sub(x,y,z) (nec_state->OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x80) | |
| 45 | ||
| 46 | #define ADDB { UINT32 res=dst+src; SetCFB(res); SetOFB_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 47 | #define ADDW { UINT32 res=dst+src; SetCFW(res); SetOFW_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 48 | ||
| 49 | #define SUBB { UINT32 res=dst-src; SetCFB(res); SetOFB_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } | |
| 50 | #define SUBW { UINT32 res=dst-src; SetCFW(res); SetOFW_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } | |
| 51 | ||
| 52 | #define ORB dst|=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) | |
| 53 | #define ORW dst|=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) | |
| 54 | ||
| 55 | #define ANDB dst&=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) | |
| 56 | #define ANDW dst&=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) | |
| 57 | ||
| 58 | #define XORB dst^=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Byte(dst) | |
| 59 | #define XORW dst^=src; nec_state->CarryVal=nec_state->OverVal=nec_state->AuxVal=0; SetSZPF_Word(dst) | |
| 60 | ||
| 61 | #define CF (nec_state->CarryVal!=0) | |
| 62 | #define SF (nec_state->SignVal<0) | |
| 63 | #define ZF (nec_state->ZeroVal==0) | |
| 64 | #define PF parity_table[(BYTE)nec_state->ParityVal] | |
| 65 | #define AF (nec_state->AuxVal!=0) | |
| 66 | #define OF (nec_state->OverVal!=0) | |
| 67 | #define MD (nec_state->MF!=0) | |
| 68 | ||
| 69 | /************************************************************************/ | |
| 70 | ||
| 71 | #define read_byte(a) (*nec_state->mem.rbyte)(nec_state->program, a) | |
| 72 | #define read_word(a) (*nec_state->mem.rword)(nec_state->program, a) | |
| 73 | #define write_byte(a,d) (*nec_state->mem.wbyte)(nec_state->program, (a),(d)) | |
| 74 | #define write_word(a,d) (*nec_state->mem.wword)(nec_state->program, (a),(d)) | |
| 75 | ||
| 76 | #define read_port_byte(a) (*nec_state->mem.rbyte)(nec_state->io, a) | |
| 77 | #define read_port_word(a) (*nec_state->mem.rword)(nec_state->io, a) | |
| 78 | #define write_port_byte(a,d) (*nec_state->mem.wbyte)(nec_state->io, (a),(d)) | |
| 79 | #define write_port_word(a,d) (*nec_state->mem.wword)(nec_state->io, (a),(d)) | |
| 80 | ||
| 81 | /************************************************************************/ | |
| 82 | ||
| 83 | #define CHANGE_PC do { EMPTY_PREFETCH(); } while (0) | |
| 84 | ||
| 85 | #define SegBase(Seg) (nec_state->sregs[Seg] << 4) | |
| 86 | ||
| 87 | #define DefaultBase(Seg) ((nec_state->seg_prefix && (Seg==DS0 || Seg==SS)) ? nec_state->prefix_base : nec_state->sregs[Seg] << 4) | |
| 88 | ||
| 89 | #define GetMemB(Seg,Off) (read_byte(DefaultBase(Seg) + (Off))) | |
| 90 | #define GetMemW(Seg,Off) (read_word(DefaultBase(Seg) + (Off))) | |
| 91 | ||
| 92 | #define PutMemB(Seg,Off,x) { write_byte(DefaultBase(Seg) + (Off), (x)); } | |
| 93 | #define PutMemW(Seg,Off,x) { write_word(DefaultBase(Seg) + (Off), (x)); } | |
| 94 | ||
| 95 | /* prefetch timing */ | |
| 96 | ||
| 97 | #define FETCH() fetch(nec_state) | |
| 98 | #define FETCH_XOR(a) ((a) ^ nec_state->mem.fetch_xor) | |
| 99 | #define FETCHWORD() fetchword(nec_state) | |
| 100 | #define EMPTY_PREFETCH() nec_state->prefetch_reset = 1 | |
| 101 | ||
| 102 | ||
| 103 | #define PUSH(val) { nec_state->regs.w[SP]-=2; write_word((((nec_state->sregs[SS]<<4)+nec_state->regs.w[SP])),val); } | |
| 104 | #define POP(var) { var = read_word((((nec_state->sregs[SS]<<4)+nec_state->regs.w[SP]))); nec_state->regs.w[SP]+=2; } | |
| 105 | ||
| 106 | #define GetModRM UINT32 ModRM=FETCH() | |
| 107 | ||
| 108 | /* Cycle count macros: | |
| 109 | CLK - cycle count is the same on all processors | |
| 110 | CLKS - cycle count differs between processors, list all counts | |
| 111 | CLKW - cycle count for word read/write differs for odd/even source/destination address | |
| 112 | CLKM - cycle count for reg/mem instructions | |
| 113 | CLKR - cycle count for reg/mem instructions with different counts for odd/even addresses | |
| 114 | ||
| 115 | ||
| 116 | Prefetch & buswait time is not emulated. | |
| 117 | Extra cycles for PUSH'ing or POP'ing registers to odd addresses is not emulated. | |
| 118 | */ | |
| 119 | ||
| 120 | #define CLK(all) nec_state->icount-=all | |
| 121 | #define CLKS(v20,v30,v33) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33; nec_state->icount-=(ccount>>nec_state->chip_type)&0x7f; } | |
| 122 | #define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } | |
| 123 | #define CLKM(v20,v30,v33,v20m,v30m,v33m) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; nec_state->icount-=( ModRM >=0xc0 )?((ccount>>nec_state->chip_type)&0x7f):((mcount>>nec_state->chip_type)&0x7f); } | |
| 124 | #define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) nec_state->icount-=vall; else nec_state->icount-=(addr&1)?((ocount>>nec_state->chip_type)&0x7f):((ecount>>nec_state->chip_type)&0x7f); } | |
| 125 | ||
| 126 | /************************************************************************/ | |
| 127 | #define CompressFlags() (WORD)(CF | (PF << 2) | (AF << 4) | (ZF << 6) \ | |
| 128 | | (SF << 7) | (nec_state->TF << 8) | (nec_state->IF << 9) \ | |
| 129 | | (nec_state->DF << 10) | (OF << 11)| (MD << 15)) | |
| 130 | ||
| 131 | #define ExpandFlags(f) \ | |
| 132 | { \ | |
| 133 | nec_state->CarryVal = (f) & 1; \ | |
| 134 | nec_state->ParityVal = !((f) & 4); \ | |
| 135 | nec_state->AuxVal = (f) & 16; \ | |
| 136 | nec_state->ZeroVal = !((f) & 64); \ | |
| 137 | nec_state->SignVal = (f) & 128 ? -1 : 0; \ | |
| 138 | nec_state->TF = ((f) & 256) == 256; \ | |
| 139 | nec_state->IF = ((f) & 512) == 512; \ | |
| 140 | nec_state->DF = ((f) & 1024) == 1024; \ | |
| 141 | nec_state->OverVal = (f) & 2048; \ | |
| 142 | nec_state->MF = ((f) & 0x8000) == 0x8000; \ | |
| 143 | } | |
| 144 | ||
| 145 | #define IncWordReg(Reg) \ | |
| 146 | unsigned tmp = (unsigned)nec_state->regs.w[Reg]; \ | |
| 147 | unsigned tmp1 = tmp+1; \ | |
| 148 | nec_state->OverVal = (tmp == 0x7fff); \ | |
| 149 | SetAF(tmp1,tmp,1); \ | |
| 150 | SetSZPF_Word(tmp1); \ | |
| 151 | nec_state->regs.w[Reg]=tmp1 | |
| 152 | ||
| 153 | #define DecWordReg(Reg) \ | |
| 154 | unsigned tmp = (unsigned)nec_state->regs.w[Reg]; \ | |
| 155 | unsigned tmp1 = tmp-1; \ | |
| 156 | nec_state->OverVal = (tmp == 0x8000); \ | |
| 157 | SetAF(tmp1,tmp,1); \ | |
| 158 | SetSZPF_Word(tmp1); \ | |
| 159 | nec_state->regs.w[Reg]=tmp1 | |
| 160 | ||
| 161 | #define JMP(flag) \ | |
| 162 | int tmp; \ | |
| 163 | EMPTY_PREFETCH(); \ | |
| 164 | tmp = (int)((INT8)FETCH()); \ | |
| 165 | if (flag) \ | |
| 166 | { \ | |
| 167 | static const UINT8 table[3]={3,10,10}; \ | |
| 168 | nec_state->ip = (WORD)(nec_state->ip+tmp); \ | |
| 169 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 170 | CHANGE_PC; \ | |
| 171 | return; \ | |
| 172 | } | |
| 173 | ||
| 174 | #define ADJ4(param1,param2) \ | |
| 175 | if (AF || ((nec_state->regs.b[AL] & 0xf) > 9)) \ | |
| 176 | { \ | |
| 177 | UINT16 tmp; \ | |
| 178 | tmp = nec_state->regs.b[AL] + param1; \ | |
| 179 | nec_state->regs.b[AL] = tmp; \ | |
| 180 | nec_state->AuxVal = 1; \ | |
| 181 | nec_state->CarryVal |= tmp & 0x100; \ | |
| 182 | } \ | |
| 183 | if (CF || (nec_state->regs.b[AL]>0x9f)) \ | |
| 184 | { \ | |
| 185 | nec_state->regs.b[AL] += param2; \ | |
| 186 | nec_state->CarryVal = 1; \ | |
| 187 | } \ | |
| 188 | SetSZPF_Byte(nec_state->regs.b[AL]) | |
| 189 | ||
| 190 | #define ADJB(param1,param2) \ | |
| 191 | if (AF || ((nec_state->regs.b[AL] & 0xf) > 9)) \ | |
| 192 | { \ | |
| 193 | nec_state->regs.b[AL] += param1; \ | |
| 194 | nec_state->regs.b[AH] += param2; \ | |
| 195 | nec_state->AuxVal = 1; \ | |
| 196 | nec_state->CarryVal = 1; \ | |
| 197 | } \ | |
| 198 | else \ | |
| 199 | { \ | |
| 200 | nec_state->AuxVal = 0; \ | |
| 201 | nec_state->CarryVal = 0; \ | |
| 202 | } \ | |
| 203 | nec_state->regs.b[AL] &= 0x0F | |
| 204 | ||
| 205 | #define BITOP_BYTE \ | |
| 206 | ModRM = FETCH(); \ | |
| 207 | if (ModRM >= 0xc0) { \ | |
| 208 | tmp=nec_state->regs.b[Mod_RM.RM.b[ModRM]]; \ | |
| 209 | } \ | |
| 210 | else { \ | |
| 211 | (*GetEA[ModRM])(nec_state); \ | |
| 212 | tmp=read_byte(EA); \ | |
| 213 | } | |
| 214 | ||
| 215 | #define BITOP_WORD \ | |
| 216 | ModRM = FETCH(); \ | |
| 217 | if (ModRM >= 0xc0) { \ | |
| 218 | tmp=nec_state->regs.w[Mod_RM.RM.w[ModRM]]; \ | |
| 219 | } \ | |
| 220 | else { \ | |
| 221 | (*GetEA[ModRM])(nec_state); \ | |
| 222 | tmp=read_word(EA); \ | |
| 223 | } | |
| 224 | ||
| 225 | #define BIT_NOT \ | |
| 226 | if (tmp & (1<<tmp2)) \ | |
| 227 | tmp &= ~(1<<tmp2); \ | |
| 228 | else \ | |
| 229 | tmp |= (1<<tmp2) | |
| 230 | ||
| 231 | #define XchgAWReg(Reg) \ | |
| 232 | WORD tmp; \ | |
| 233 | tmp = nec_state->regs.w[Reg]; \ | |
| 234 | nec_state->regs.w[Reg] = nec_state->regs.w[AW]; \ | |
| 235 | nec_state->regs.w[AW] = tmp | |
| 236 | ||
| 237 | #define ROL_BYTE nec_state->CarryVal = dst & 0x80; dst = (dst << 1)+CF | |
| 238 | #define ROL_WORD nec_state->CarryVal = dst & 0x8000; dst = (dst << 1)+CF | |
| 239 | #define ROR_BYTE nec_state->CarryVal = dst & 0x1; dst = (dst >> 1)+(CF<<7) | |
| 240 | #define ROR_WORD nec_state->CarryVal = dst & 0x1; dst = (dst >> 1)+(CF<<15) | |
| 241 | #define ROLC_BYTE dst = (dst << 1) + CF; SetCFB(dst) | |
| 242 | #define ROLC_WORD dst = (dst << 1) + CF; SetCFW(dst) | |
| 243 | #define RORC_BYTE dst = (CF<<8)+dst; nec_state->CarryVal = dst & 0x01; dst >>= 1 | |
| 244 | #define RORC_WORD dst = (CF<<16)+dst; nec_state->CarryVal = dst & 0x01; dst >>= 1 | |
| 245 | #define SHL_BYTE(c) nec_state->icount-=c; dst <<= c; SetCFB(dst); SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) | |
| 246 | #define SHL_WORD(c) nec_state->icount-=c; dst <<= c; SetCFW(dst); SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) | |
| 247 | #define SHR_BYTE(c) nec_state->icount-=c; dst >>= c-1; nec_state->CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) | |
| 248 | #define SHR_WORD(c) nec_state->icount-=c; dst >>= c-1; nec_state->CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) | |
| 249 | #define SHRA_BYTE(c) nec_state->icount-=c; dst = ((INT8)dst) >> (c-1); nec_state->CarryVal = dst & 0x1; dst = ((INT8)((BYTE)dst)) >> 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) | |
| 250 | #define SHRA_WORD(c) nec_state->icount-=c; dst = ((INT16)dst) >> (c-1); nec_state->CarryVal = dst & 0x1; dst = ((INT16)((WORD)dst)) >> 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) | |
| 251 | ||
| 252 | #define DIVUB \ | |
| 253 | uresult = nec_state->regs.w[AW]; \ | |
| 254 | uresult2 = uresult % tmp; \ | |
| 255 | if ((uresult /= tmp) > 0xff) { \ | |
| 256 | nec_interrupt(nec_state, 0,0); break; \ | |
| 257 | } else { \ | |
| 258 | nec_state->regs.b[AL] = uresult; \ | |
| 259 | nec_state->regs.b[AH] = uresult2; \ | |
| 260 | } | |
| 261 | ||
| 262 | #define DIVB \ | |
| 263 | result = (INT16)nec_state->regs.w[AW]; \ | |
| 264 | result2 = result % (INT16)((INT8)tmp); \ | |
| 265 | if ((result /= (INT16)((INT8)tmp)) > 0xff) { \ | |
| 266 | nec_interrupt(nec_state, 0,0); break; \ | |
| 267 | } else { \ | |
| 268 | nec_state->regs.b[AL] = result; \ | |
| 269 | nec_state->regs.b[AH] = result2; \ | |
| 270 | } | |
| 271 | ||
| 272 | #define DIVUW \ | |
| 273 | uresult = (((UINT32)nec_state->regs.w[DW]) << 16) | nec_state->regs.w[AW];\ | |
| 274 | uresult2 = uresult % tmp; \ | |
| 275 | if ((uresult /= tmp) > 0xffff) { \ | |
| 276 | nec_interrupt(nec_state, 0,0); break; \ | |
| 277 | } else { \ | |
| 278 | nec_state->regs.w[AW]=uresult; \ | |
| 279 | nec_state->regs.w[DW]=uresult2; \ | |
| 280 | } | |
| 281 | ||
| 282 | #define DIVW \ | |
| 283 | result = ((UINT32)nec_state->regs.w[DW] << 16) + nec_state->regs.w[AW]; \ | |
| 284 | result2 = result % (INT32)((INT16)tmp); \ | |
| 285 | if ((result /= (INT32)((INT16)tmp)) > 0xffff) { \ | |
| 286 | nec_interrupt(nec_state, 0,0); break; \ | |
| 287 | } else { \ | |
| 288 | nec_state->regs.w[AW]=result; \ | |
| 289 | nec_state->regs.w[DW]=result2; \ | |
| 290 | } | |
| 291 | ||
| 292 | #define ADD4S { \ | |
| 293 | int i,v1,v2,result; \ | |
| 294 | int count = (nec_state->regs.b[CL]+1)/2; \ | |
| 295 | unsigned di = nec_state->regs.w[IY]; \ | |
| 296 | unsigned si = nec_state->regs.w[IX]; \ | |
| 297 | static const UINT8 table[3]={18,19,19}; \ | |
| 298 | if (nec_state->seg_prefix) logerror("%06x: Warning: seg_prefix defined for add4s\n",PC(nec_state)); \ | |
| 299 | nec_state->ZeroVal = nec_state->CarryVal = 0; \ | |
| 300 | for (i=0;i<count;i++) { \ | |
| 301 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 302 | tmp = GetMemB(DS0, si); \ | |
| 303 | tmp2 = GetMemB(DS1, di); \ | |
| 304 | v1 = (tmp>>4)*10 + (tmp&0xf); \ | |
| 305 | v2 = (tmp2>>4)*10 + (tmp2&0xf); \ | |
| 306 | result = v1+v2+nec_state->CarryVal; \ | |
| 307 | nec_state->CarryVal = result > 99 ? 1 : 0; \ | |
| 308 | result = result % 100; \ | |
| 309 | v1 = ((result/10)<<4) | (result % 10); \ | |
| 310 | PutMemB(DS1, di,v1); \ | |
| 311 | if (v1) nec_state->ZeroVal = 1; \ | |
| 312 | si++; \ | |
| 313 | di++; \ | |
| 314 | } \ | |
| 315 | } | |
| 316 | ||
| 317 | #define SUB4S { \ | |
| 318 | int count = (nec_state->regs.b[CL]+1)/2; \ | |
| 319 | int i,v1,v2,result; \ | |
| 320 | unsigned di = nec_state->regs.w[IY]; \ | |
| 321 | unsigned si = nec_state->regs.w[IX]; \ | |
| 322 | static const UINT8 table[3]={18,19,19}; \ | |
| 323 | if (nec_state->seg_prefix) logerror("%06x: Warning: seg_prefix defined for sub4s\n",PC(nec_state)); \ | |
| 324 | nec_state->ZeroVal = nec_state->CarryVal = 0; \ | |
| 325 | for (i=0;i<count;i++) { \ | |
| 326 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 327 | tmp = GetMemB(DS1, di); \ | |
| 328 | tmp2 = GetMemB(DS0, si); \ | |
| 329 | v1 = (tmp>>4)*10 + (tmp&0xf); \ | |
| 330 | v2 = (tmp2>>4)*10 + (tmp2&0xf); \ | |
| 331 | if (v1 < (v2+nec_state->CarryVal)) { \ | |
| 332 | v1+=100; \ | |
| 333 | result = v1-(v2+nec_state->CarryVal); \ | |
| 334 | nec_state->CarryVal = 1; \ | |
| 335 | } else { \ | |
| 336 | result = v1-(v2+nec_state->CarryVal); \ | |
| 337 | nec_state->CarryVal = 0; \ | |
| 338 | } \ | |
| 339 | v1 = ((result/10)<<4) | (result % 10); \ | |
| 340 | PutMemB(DS1, di,v1); \ | |
| 341 | if (v1) nec_state->ZeroVal = 1; \ | |
| 342 | si++; \ | |
| 343 | di++; \ | |
| 344 | } \ | |
| 345 | } | |
| 346 | ||
| 347 | #define CMP4S { \ | |
| 348 | int count = (nec_state->regs.b[CL]+1)/2; \ | |
| 349 | int i,v1,v2,result; \ | |
| 350 | unsigned di = nec_state->regs.w[IY]; \ | |
| 351 | unsigned si = nec_state->regs.w[IX]; \ | |
| 352 | static const UINT8 table[3]={14,19,19}; \ | |
| 353 | if (nec_state->seg_prefix) logerror("%06x: Warning: seg_prefix defined for cmp4s\n",PC(nec_state)); \ | |
| 354 | nec_state->ZeroVal = nec_state->CarryVal = 0; \ | |
| 355 | for (i=0;i<count;i++) { \ | |
| 356 | nec_state->icount-=table[nec_state->chip_type/8]; \ | |
| 357 | tmp = GetMemB(DS1, di); \ | |
| 358 | tmp2 = GetMemB(DS0, si); \ | |
| 359 | v1 = (tmp>>4)*10 + (tmp&0xf); \ | |
| 360 | v2 = (tmp2>>4)*10 + (tmp2&0xf); \ | |
| 361 | if (v1 < (v2+nec_state->CarryVal)) { \ | |
| 362 | v1+=100; \ | |
| 363 | result = v1-(v2+nec_state->CarryVal); \ | |
| 364 | nec_state->CarryVal = 1; \ | |
| 365 | } else { \ | |
| 366 | result = v1-(v2+nec_state->CarryVal); \ | |
| 367 | nec_state->CarryVal = 0; \ | |
| 368 | } \ | |
| 369 | v1 = ((result/10)<<4) | (result % 10); \ | |
| 370 | if (v1) nec_state->ZeroVal = 1; \ | |
| 371 | si++; \ | |
| 372 | di++; \ | |
| 373 | } \ | |
| 374 | } |
| r3957 | r3958 | |
|---|---|---|
| 225 | 225 | FUNCTION PROTOTYPES |
| 226 | 226 | ***************************************************************************/ |
| 227 | 227 | |
| 228 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, const device_config *device, | |
| 228 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, const device_config *device, | |
| 229 | 229 | void mips3com_exit(mips3_state *mips); |
| 230 | 230 | |
| 231 | 231 | void mips3com_reset(mips3_state *mips); |
| r3957 | r3958 | |
|---|---|---|
| 227 | 227 | |
| 228 | 228 | #if (HAS_R4600) |
| 229 | 229 | CPU_GET_INFO( r4600be ); |
| 230 | #define CPU_R4600BE CPU_GET_INFO_NAME( r4600be ) | |
| 230 | 231 | CPU_GET_INFO( r4600le ); |
| 232 | #define CPU_R4600LE CPU_GET_INFO_NAME( r4600le ) | |
| 231 | 233 | #endif |
| 232 | 234 | |
| 235 | #if (HAS_R4650) | |
| 236 | CPU_GET_INFO( r4650be); | |
| 237 | #define CPU_R4650BE CPU_GET_INFO_NAME( r4650be ) | |
| 238 | CPU_GET_INFO( r4650le); | |
| 239 | #define CPU_R4650LE CPU_GET_INFO_NAME( r4650le ) | |
| 240 | #endif | |
| 241 | ||
| 233 | 242 | #if (HAS_R4700) |
| 234 | 243 | CPU_GET_INFO( r4700be ); |
| 244 | #define CPU_R4700BE CPU_GET_INFO_NAME( r4700be ) | |
| 235 | 245 | CPU_GET_INFO( r4700le ); |
| 246 | #define CPU_R4700LE CPU_GET_INFO_NAME( r4700le ) | |
| 236 | 247 | #endif |
| 237 | 248 | |
| 238 | 249 | #if (HAS_R5000) |
| 239 | 250 | CPU_GET_INFO( r5000be ); |
| 251 | #define CPU_R5000BE CPU_GET_INFO_NAME( r5000be ) | |
| 240 | 252 | CPU_GET_INFO( r5000le ); |
| 253 | #define CPU_R5000LE CPU_GET_INFO_NAME( r5000le ) | |
| 241 | 254 | #endif |
| 242 | 255 | |
| 243 | 256 | #if (HAS_QED5271) |
| 244 | 257 | CPU_GET_INFO( qed5271be ); |
| 258 | #define CPU_QED5271BE CPU_GET_INFO_NAME( qed5271be ) | |
| 245 | 259 | CPU_GET_INFO( qed5271le ); |
| 260 | #define CPU_QED5271LE CPU_GET_INFO_NAME( qed5271le ) | |
| 246 | 261 | #endif |
| 247 | 262 | |
| 248 | 263 | #if (HAS_RM7000) |
| 249 | 264 | CPU_GET_INFO( rm7000be ); |
| 265 | #define CPU_RM7000BE CPU_GET_INFO_NAME( rm7000be ) | |
| 250 | 266 | CPU_GET_INFO( rm7000le ); |
| 267 | #define CPU_RM7000LE CPU_GET_INFO_NAME( rm7000le ) | |
| 251 | 268 | #endif |
| 252 | 269 | |
| 253 | 270 |
| r3957 | r3958 | |
|---|---|---|
| 1183 | 1183 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1184 | 1184 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 1185 | 1185 | |
| 1186 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1187 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 29; break; | |
| 1188 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1189 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1190 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1191 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1192 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1193 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1194 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1186 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1187 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 29; break; | |
| 1188 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1189 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1190 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1191 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1192 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1193 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1194 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1195 | 1195 | |
| 1196 | 1196 | case CPUINFO_INT_INPUT_STATE + R3000_IRQ0: info->i = (r3000->cpr[0][COP0_Cause] & 0x400) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1197 | 1197 | case CPUINFO_INT_INPUT_STATE + R3000_IRQ1: info->i = (r3000->cpr[0][COP0_Cause] & 0x800) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 1241 | 1241 | case CPUINFO_INT_REGISTER + R3000_R31: info->i = r3000->r[31]; break; |
| 1242 | 1242 | |
| 1243 | 1243 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1244 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(r3000); break; | |
| 1245 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(r3000); break; | |
| 1246 | case CPUINFO_PTR_RESET: /* provided per-CPU */ break; | |
| 1247 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(r3000); break; | |
| 1248 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(r3000); break; | |
| 1249 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1250 | case CPUINFO_PTR_DISASSEMBLE: /* provided per-CPU */ break; | |
| 1244 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(r3000); break; | |
| 1245 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(r3000); break; | |
| 1246 | case CPUINFO_FCT_RESET: /* provided per-CPU */ break; | |
| 1247 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(r3000); break; | |
| 1248 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(r3000); break; | |
| 1249 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1250 | case CPUINFO_FCT_DISASSEMBLE: /* provided per-CPU */ break; | |
| 1251 | 1251 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &r3000->icount; break; |
| 1252 | 1252 | |
| 1253 | 1253 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1310 | 1310 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 1311 | 1311 | |
| 1312 | 1312 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1313 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(r3000be); break; | |
| 1314 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000be); break; | |
| 1313 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(r3000be); break; | |
| 1314 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000be); break; | |
| 1315 | 1315 | |
| 1316 | 1316 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1317 | 1317 | case CPUINFO_STR_NAME: strcpy(info->s, "R3000 (big)"); break; |
| r3957 | r3958 | |
| 1329 | 1329 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 1330 | 1330 | |
| 1331 | 1331 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1332 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(r3000le); break; | |
| 1333 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000le); break; | |
| 1332 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(r3000le); break; | |
| 1333 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000le); break; | |
| 1334 | 1334 | |
| 1335 | 1335 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1336 | 1336 | case CPUINFO_STR_NAME: strcpy(info->s, "R3000 (little)"); break; |
| r3957 | r3958 | |
| 1348 | 1348 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 1349 | 1349 | |
| 1350 | 1350 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1351 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(r3000be); break; | |
| 1352 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000be); break; | |
| 1351 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(r3000be); break; | |
| 1352 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000be); break; | |
| 1353 | 1353 | |
| 1354 | 1354 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1355 | 1355 | case CPUINFO_STR_NAME: strcpy(info->s, "R3041 (big)"); break; |
| r3957 | r3958 | |
| 1367 | 1367 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 1368 | 1368 | |
| 1369 | 1369 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1370 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(r3000le); break; | |
| 1371 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000le); break; | |
| 1370 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(r3000le); break; | |
| 1371 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(r3000le); break; | |
| 1372 | 1372 | |
| 1373 | 1373 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1374 | 1374 | case CPUINFO_STR_NAME: strcpy(info->s, "R3041 (little)"); break; |
| r3957 | r3958 | |
|---|---|---|
| 63 | 63 | extern CPU_GET_INFO( r3000be ); |
| 64 | 64 | extern CPU_GET_INFO( r3000le ); |
| 65 | 65 | |
| 66 | #define CPU_R3000BE CPU_GET_INFO_NAME( r3000be ) | |
| 67 | #define CPU_R3000LE CPU_GET_INFO_NAME( r3000le ) | |
| 68 | ||
| 66 | 69 | extern CPU_GET_INFO( r3041be ); |
| 67 | 70 | extern CPU_GET_INFO( r3041le ); |
| 68 | 71 | |
| 72 | #define CPU_R3041BE CPU_GET_INFO_NAME( r3041be ) | |
| 73 | #define CPU_R3041LE CPU_GET_INFO_NAME( r3041le ) | |
| 74 | ||
| 69 | 75 | #endif /* __R3000_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 4042 | 4042 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 4043 | 4043 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 4044 | 4044 | |
| 4045 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 4046 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 4047 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 4048 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4049 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4050 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4051 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 4052 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 4053 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 4045 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 4046 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 4047 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 4048 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 4049 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 4050 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 4051 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 4052 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 4053 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 4054 | 4054 | |
| 4055 | 4055 | case CPUINFO_INT_INPUT_STATE + PSXCPU_IRQ0: info->i = (psxcpu->cp0r[ CP0_CAUSE ] & 0x400) ? ASSERT_LINE : CLEAR_LINE; break; |
| 4056 | 4056 | case CPUINFO_INT_INPUT_STATE + PSXCPU_IRQ1: info->i = (psxcpu->cp0r[ CP0_CAUSE ] & 0x800) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 4187 | 4187 | case CPUINFO_INT_REGISTER + PSXCPU_CP2CR31: info->i = psxcpu->cp2cr[ 31 ].d; break; |
| 4188 | 4188 | |
| 4189 | 4189 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4190 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(psxcpu); break; | |
| 4191 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(psxcpu); break; | |
| 4192 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(psxcpu); break; | |
| 4193 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(psxcpu); break; | |
| 4194 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(psxcpu); break; | |
| 4195 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 4196 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(psxcpu); break; | |
| 4190 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(psxcpu); break; | |
| 4191 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(psxcpu); break; | |
| 4192 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(psxcpu); break; | |
| 4193 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(psxcpu); break; | |
| 4194 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(psxcpu); break; | |
| 4195 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 4196 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(psxcpu); break; | |
| 4197 | 4197 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &psxcpu->icount; break; |
| 4198 | 4198 | |
| 4199 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(psxcpu_internal_map); break; | |
| 4200 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map32 = 0; break; | |
| 4201 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map32 = 0; break; | |
| 4199 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(psxcpu_internal_map); break; | |
| 4200 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map32 = 0; break; | |
| 4201 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map32 = 0; break; | |
| 4202 | 4202 | |
| 4203 | 4203 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4204 | 4204 | case CPUINFO_STR_NAME: strcpy(info->s, "PSX CPU"); break; |
| r3957 | r3958 | |
| 4337 | 4337 | { |
| 4338 | 4338 | switch (state) |
| 4339 | 4339 | { |
| 4340 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 4340 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 4341 | 4341 | |
| 4342 | 4342 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 4343 | 4343 | case CPUINFO_STR_NAME: strcpy(info->s, "CXD8661R"); break; |
| r3957 | r3958 | |
|---|---|---|
| 215 | 215 | |
| 216 | 216 | extern unsigned DasmPSXCPU( DasmPSXCPU_state *state, char *buffer, UINT32 pc, const UINT8 *opram ); |
| 217 | 217 | |
| 218 | CPU_GET_INFO( psxcpu ); | |
| 219 | #define CPU_PSXCPU CPU_GET_INFO_NAME( psxcpu ) | |
| 220 | ||
| 221 | CPU_GET_INFO( cxd8661r ); | |
| 222 | #define CPU_CXD8661R CPU_GET_INFO_NAME( cxd8661r ) | |
| 223 | ||
| 218 | 224 | #endif /* __PSX_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 340 | 340 | mips3_init - initialize the processor |
| 341 | 341 | -------------------------------------------------*/ |
| 342 | 342 | |
| 343 | static void mips3_init(mips3_flavor flavor, int bigendian, const device_config *device, | |
| 343 | static void mips3_init(mips3_flavor flavor, int bigendian, const device_config *device, | |
| 344 | 344 | { |
| 345 | 345 | drcfe_config feconfig = |
| 346 | 346 | { |
| r3957 | r3958 | |
| 365 | 365 | memset(mips3, 0, sizeof(*mips3)); |
| 366 | 366 | |
| 367 | 367 | /* initialize the core */ |
| 368 | mips3com_init(mips3, flavor, bigendian, device, i | |
| 368 | mips3com_init(mips3, flavor, bigendian, device, i | |
| 369 | 369 | |
| 370 | 370 | /* allocate the implementation-specific state from the full cache */ |
| 371 | 371 | mips3->impstate = drccache_memory_alloc_near(cache, sizeof(*mips3->impstate)); |
| r3957 | r3958 | |
| 600 | 600 | |
| 601 | 601 | static CPU_GET_INFO( mips3 ) |
| 602 | 602 | { |
| 603 | mips3_state *mips3 = (device != NULL) ? *(mips3_state **)device->token : NULL; | |
| 603 | mips3_state *mips3 = (device != NULL && device->token != NULL) ? *(mips3_state **)device->token : NULL; | |
| 604 | 604 | switch (state) |
| 605 | 605 | { |
| 606 | 606 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| r3957 | r3958 | |
| 608 | 608 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ break; |
| 609 | 609 | |
| 610 | 610 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 611 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mips3); break; | |
| 612 | case CPUINFO_PTR_INIT: /* provided per-CPU */ break; | |
| 613 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(mips3); break; | |
| 614 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(mips3); break; | |
| 615 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(mips3); break; | |
| 616 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mips3);break; | |
| 617 | case CPUINFO_PTR_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(mips3); break; | |
| 611 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mips3); break; | |
| 612 | case CPUINFO_FCT_INIT: /* provided per-CPU */ break; | |
| 613 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mips3); break; | |
| 614 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(mips3); break; | |
| 615 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(mips3); break; | |
| 616 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mips3);break; | |
| 617 | case CPUINFO_FCT_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(mips3); break; | |
| 618 | 618 | |
| 619 | 619 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 620 | 620 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; |
| r3957 | r3958 | |
| 3625 | 3625 | #if (HAS_R4600) |
| 3626 | 3626 | static CPU_INIT( r4600be ) |
| 3627 | 3627 | { |
| 3628 | mips3_init(MIPS3_TYPE_R4600, TRUE, device, i | |
| 3628 | mips3_init(MIPS3_TYPE_R4600, TRUE, device, i | |
| 3629 | 3629 | } |
| 3630 | 3630 | |
| 3631 | 3631 | static CPU_INIT( r4600le ) |
| 3632 | 3632 | { |
| 3633 | mips3_init(MIPS3_TYPE_R4600, FALSE, device, i | |
| 3633 | mips3_init(MIPS3_TYPE_R4600, FALSE, device, i | |
| 3634 | 3634 | } |
| 3635 | 3635 | |
| 3636 | 3636 | CPU_GET_INFO( r4600be ) |
| r3957 | r3958 | |
| 3641 | 3641 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 3642 | 3642 | |
| 3643 | 3643 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3644 | case CPUINFO_ | |
| 3644 | case CPUINFO_FCT | |
| 3645 | 3645 | |
| 3646 | 3646 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3647 | 3647 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (big)"); break; |
| r3957 | r3958 | |
| 3659 | 3659 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 3660 | 3660 | |
| 3661 | 3661 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3662 | case CPUINFO_ | |
| 3662 | case CPUINFO_FCT | |
| 3663 | 3663 | |
| 3664 | 3664 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3665 | 3665 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (little)"); break; |
| r3957 | r3958 | |
| 3679 | 3679 | #if (HAS_R4650) |
| 3680 | 3680 | static CPU_INIT( r4650be ) |
| 3681 | 3681 | { |
| 3682 | mips3_init(MIPS3_TYPE_R4650, TRUE, device, i | |
| 3682 | mips3_init(MIPS3_TYPE_R4650, TRUE, device, i | |
| 3683 | 3683 | } |
| 3684 | 3684 | |
| 3685 | 3685 | static CPU_INIT( r4650le ) |
| 3686 | 3686 | { |
| 3687 | mips3_init(MIPS3_TYPE_R4650, FALSE, device, i | |
| 3687 | mips3_init(MIPS3_TYPE_R4650, FALSE, device, i | |
| 3688 | 3688 | } |
| 3689 | 3689 | |
| 3690 | 3690 | CPU_GET_INFO( r4650be ) |
| r3957 | r3958 | |
| 3695 | 3695 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 3696 | 3696 | |
| 3697 | 3697 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3698 | case CPUINFO_ | |
| 3698 | case CPUINFO_FCT | |
| 3699 | 3699 | |
| 3700 | 3700 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3701 | 3701 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (big)"); break; |
| r3957 | r3958 | |
| 3713 | 3713 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 3714 | 3714 | |
| 3715 | 3715 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3716 | case CPUINFO_ | |
| 3716 | case CPUINFO_FCT | |
| 3717 | 3717 | |
| 3718 | 3718 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3719 | 3719 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (little)"); break; |
| r3957 | r3958 | |
| 3733 | 3733 | #if (HAS_R4700) |
| 3734 | 3734 | static CPU_INIT( r4700be ) |
| 3735 | 3735 | { |
| 3736 | mips3_init(MIPS3_TYPE_R4700, TRUE, device, i | |
| 3736 | mips3_init(MIPS3_TYPE_R4700, TRUE, device, i | |
| 3737 | 3737 | } |
| 3738 | 3738 | |
| 3739 | 3739 | static CPU_INIT( r4700le ) |
| 3740 | 3740 | { |
| 3741 | mips3_init(MIPS3_TYPE_R4700, FALSE, device, i | |
| 3741 | mips3_init(MIPS3_TYPE_R4700, FALSE, device, i | |
| 3742 | 3742 | } |
| 3743 | 3743 | |
| 3744 | 3744 | CPU_GET_INFO( r4700be ) |
| r3957 | r3958 | |
| 3749 | 3749 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 3750 | 3750 | |
| 3751 | 3751 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3752 | case CPUINFO_ | |
| 3752 | case CPUINFO_FCT | |
| 3753 | 3753 | |
| 3754 | 3754 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3755 | 3755 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (big)"); break; |
| r3957 | r3958 | |
| 3767 | 3767 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 3768 | 3768 | |
| 3769 | 3769 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3770 | case CPUINFO_ | |
| 3770 | case CPUINFO_FCT | |
| 3771 | 3771 | |
| 3772 | 3772 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3773 | 3773 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (little)"); break; |
| r3957 | r3958 | |
| 3787 | 3787 | #if (HAS_R5000) |
| 3788 | 3788 | static CPU_INIT( r5000be ) |
| 3789 | 3789 | { |
| 3790 | mips3_init(MIPS3_TYPE_R5000, TRUE, device, i | |
| 3790 | mips3_init(MIPS3_TYPE_R5000, TRUE, device, i | |
| 3791 | 3791 | } |
| 3792 | 3792 | |
| 3793 | 3793 | static CPU_INIT( r5000le ) |
| 3794 | 3794 | { |
| 3795 | mips3_init(MIPS3_TYPE_R5000, FALSE, device, i | |
| 3795 | mips3_init(MIPS3_TYPE_R5000, FALSE, device, i | |
| 3796 | 3796 | } |
| 3797 | 3797 | |
| 3798 | 3798 | CPU_GET_INFO( r5000be ) |
| r3957 | r3958 | |
| 3803 | 3803 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 3804 | 3804 | |
| 3805 | 3805 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3806 | case CPUINFO_ | |
| 3806 | case CPUINFO_FCT | |
| 3807 | 3807 | |
| 3808 | 3808 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3809 | 3809 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (big)"); break; |
| r3957 | r3958 | |
| 3821 | 3821 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 3822 | 3822 | |
| 3823 | 3823 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3824 | case CPUINFO_ | |
| 3824 | case CPUINFO_FCT | |
| 3825 | 3825 | |
| 3826 | 3826 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3827 | 3827 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (little)"); break; |
| r3957 | r3958 | |
| 3841 | 3841 | #if (HAS_QED5271) |
| 3842 | 3842 | static CPU_INIT( qed5271be ) |
| 3843 | 3843 | { |
| 3844 | mips3_init(MIPS3_TYPE_QED5271, TRUE, device, i | |
| 3844 | mips3_init(MIPS3_TYPE_QED5271, TRUE, device, i | |
| 3845 | 3845 | } |
| 3846 | 3846 | |
| 3847 | 3847 | static CPU_INIT( qed5271le ) |
| 3848 | 3848 | { |
| 3849 | mips3_init(MIPS3_TYPE_QED5271, FALSE, device, i | |
| 3849 | mips3_init(MIPS3_TYPE_QED5271, FALSE, device, i | |
| 3850 | 3850 | } |
| 3851 | 3851 | |
| 3852 | 3852 | CPU_GET_INFO( qed5271be ) |
| r3957 | r3958 | |
| 3857 | 3857 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 3858 | 3858 | |
| 3859 | 3859 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3860 | case CPUINFO_ | |
| 3860 | case CPUINFO_FCT | |
| 3861 | 3861 | |
| 3862 | 3862 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3863 | 3863 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (big)"); break; |
| r3957 | r3958 | |
| 3875 | 3875 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 3876 | 3876 | |
| 3877 | 3877 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3878 | case CPUINFO_ | |
| 3878 | case CPUINFO_FCT | |
| 3879 | 3879 | |
| 3880 | 3880 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3881 | 3881 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (little)"); break; |
| r3957 | r3958 | |
| 3895 | 3895 | #if (HAS_RM7000) |
| 3896 | 3896 | static CPU_INIT( rm7000be ) |
| 3897 | 3897 | { |
| 3898 | mips3_init(MIPS3_TYPE_RM7000, TRUE, device, i | |
| 3898 | mips3_init(MIPS3_TYPE_RM7000, TRUE, device, i | |
| 3899 | 3899 | } |
| 3900 | 3900 | |
| 3901 | 3901 | static CPU_INIT( rm7000le ) |
| 3902 | 3902 | { |
| 3903 | mips3_init(MIPS3_TYPE_RM7000, FALSE, device, i | |
| 3903 | mips3_init(MIPS3_TYPE_RM7000, FALSE, device, i | |
| 3904 | 3904 | } |
| 3905 | 3905 | |
| 3906 | 3906 | CPU_GET_INFO( rm7000be ) |
| r3957 | r3958 | |
| 3911 | 3911 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 3912 | 3912 | |
| 3913 | 3913 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3914 | case CPUINFO_ | |
| 3914 | case CPUINFO_FCT | |
| 3915 | 3915 | |
| 3916 | 3916 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3917 | 3917 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (big)"); break; |
| r3957 | r3958 | |
| 3929 | 3929 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 3930 | 3930 | |
| 3931 | 3931 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3932 | case CPUINFO_ | |
| 3932 | case CPUINFO_FCT | |
| 3933 | 3933 | |
| 3934 | 3934 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3935 | 3935 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (little)"); break; |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | structure based on the configured type |
| 71 | 71 | -------------------------------------------------*/ |
| 72 | 72 | |
| 73 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, const device_config *device, | |
| 73 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, const device_config *device, | |
| 74 | 74 | { |
| 75 | 75 | const mips3_config *config = device->static_config; |
| 76 | 76 | int tlbindex; |
| r3957 | r3958 | |
| 79 | 79 | memset(mips, 0, sizeof(*mips)); |
| 80 | 80 | mips->flavor = flavor; |
| 81 | 81 | mips->bigendian = bigendian; |
| 82 | mips->cpu_clock = clock; | |
| 82 | mips->cpu_clock = device->clock; | |
| 83 | 83 | mips->irq_callback = irqcallback; |
| 84 | 84 | mips->device = device; |
| 85 | 85 | mips->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); |
| r3957 | r3958 | |
| 457 | 457 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 458 | 458 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 459 | 459 | |
| 460 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = MIPS3_MAX_PADDR_SHIFT;break; | |
| 461 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 462 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 463 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 464 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = MIPS3_MIN_PAGE_SHIFT; break; | |
| 460 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = MIPS3_MAX_PADDR_SHIFT;break; | |
| 461 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 462 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 463 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 32; break; | |
| 464 | case CPUINFO_INT_PAGE_SHIFT_PROGRAM: info->i = MIPS3_MIN_PAGE_SHIFT; break; | |
| 465 | 465 | |
| 466 | 466 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ0: info->i = (mips->cpr[0][COP0_Cause] & 0x400) ? ASSERT_LINE : CLEAR_LINE; break; |
| 467 | 467 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ1: info->i = (mips->cpr[0][COP0_Cause] & 0x800) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 525 | 525 | case CPUINFO_INT_REGISTER + MIPS3_LO: info->i = mips->r[REG_LO]; break; |
| 526 | 526 | |
| 527 | 527 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 528 | case CPUINFO_PTR_SET_INFO: /* provided by core */ break; | |
| 529 | case CPUINFO_PTR_INIT: /* provided by core */ break; | |
| 530 | case CPUINFO_PTR_RESET: /* provided by core */ break; | |
| 531 | case CPUINFO_PTR_EXIT: /* provided by core */ break; | |
| 532 | case CPUINFO_PTR_EXECUTE: /* provided by core */ break; | |
| 533 | case CPUINFO_PTR_TRANSLATE: /* provided by core */ break; | |
| 534 | case CPUINFO_PTR_DISASSEMBLE: /* provided by core */ break; | |
| 528 | case CPUINFO_FCT_SET_INFO: /* provided by core */ break; | |
| 529 | case CPUINFO_FCT_INIT: /* provided by core */ break; | |
| 530 | case CPUINFO_FCT_RESET: /* provided by core */ break; | |
| 531 | case CPUINFO_FCT_EXIT: /* provided by core */ break; | |
| 532 | case CPUINFO_FCT_EXECUTE: /* provided by core */ break; | |
| 533 | case CPUINFO_FCT_TRANSLATE: /* provided by core */ break; | |
| 534 | case CPUINFO_FCT_DISASSEMBLE: /* provided by core */ break; | |
| 535 | 535 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &mips->icount; break; |
| 536 | 536 | |
| 537 | 537 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 2106 | 2106 | |
| 2107 | CPU_GET_INFO( mips3 ) | |
| 2107 | static CPU_GET_INFO( mips3 ) | |
| 2108 | 2108 | { |
| 2109 | 2109 | switch (state) |
| 2110 | 2110 | { |
| r3957 | r3958 | |
| 2113 | 2113 | case CPUINFO_INT_PREVIOUSPC: info->i = mips3.ppc; break; |
| 2114 | 2114 | |
| 2115 | 2115 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2116 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mips3); break; | |
| 2117 | case CPUINFO_PTR_INIT: /* provided per-CPU */ break; | |
| 2118 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(mips3); break; | |
| 2119 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(mips3); break; | |
| 2120 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mips3); break; | |
| 2121 | case CPUINFO_PTR_TRANSLATE: info->translate = CPU_GET_TRANSLATE_NAME(mips3); break; | |
| 2116 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mips3); break; | |
| 2117 | case CPUINFO_FCT_INIT: /* provided per-CPU */ break; | |
| 2118 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mips3); break; | |
| 2119 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(mips3); break; | |
| 2120 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mips3); break; | |
| 2121 | case CPUINFO_FCT_TRANSLATE: info->translate = CPU_GET_TRANSLATE_NAME(mips3); break; | |
| 2122 | 2122 | |
| 2123 | 2123 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2124 | 2124 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; |
| r3957 | r3958 | |
| 2157 | 2157 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2158 | 2158 | |
| 2159 | 2159 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2160 | case CPUINFO_ | |
| 2160 | case CPUINFO_FCT | |
| 2161 | 2161 | |
| 2162 | 2162 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2163 | 2163 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (big)"); break; |
| 2164 | 2164 | |
| 2165 | 2165 | /* --- everything else is handled generically --- */ |
| 2166 | default: mips3 | |
| 2166 | default: CPU_GET_INFO_CALL(mips3 | |
| 2167 | 2167 | } |
| 2168 | 2168 | } |
| 2169 | 2169 | |
| r3957 | r3958 | |
| 2175 | 2175 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 2176 | 2176 | |
| 2177 | 2177 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2178 | case CPUINFO_ | |
| 2178 | case CPUINFO_FCT | |
| 2179 | 2179 | |
| 2180 | 2180 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2181 | 2181 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (little)"); break; |
| 2182 | 2182 | |
| 2183 | 2183 | /* --- everything else is handled generically --- */ |
| 2184 | default: mips3 | |
| 2184 | default: CPU_GET_INFO_CALL(mips3 | |
| 2185 | 2185 | } |
| 2186 | 2186 | } |
| 2187 | 2187 | #endif |
| r3957 | r3958 | |
| 2215 | 2215 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2216 | 2216 | |
| 2217 | 2217 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2218 | case CPUINFO_ | |
| 2218 | case CPUINFO_FCT | |
| 2219 | 2219 | |
| 2220 | 2220 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2221 | 2221 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (big)"); break; |
| 2222 | 2222 | |
| 2223 | 2223 | /* --- everything else is handled generically --- */ |
| 2224 | default: mips3 | |
| 2224 | default: CPU_GET_INFO_CALL(mips3 | |
| 2225 | 2225 | } |
| 2226 | 2226 | } |
| 2227 | 2227 | |
| r3957 | r3958 | |
| 2233 | 2233 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 2234 | 2234 | |
| 2235 | 2235 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2236 | case CPUINFO_ | |
| 2236 | case CPUINFO_FCT | |
| 2237 | 2237 | |
| 2238 | 2238 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2239 | 2239 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (little)"); break; |
| 2240 | 2240 | |
| 2241 | 2241 | /* --- everything else is handled generically --- */ |
| 2242 | default: mips3 | |
| 2242 | default: CPU_GET_INFO_CALL(mips3 | |
| 2243 | 2243 | } |
| 2244 | 2244 | } |
| 2245 | 2245 | #endif |
| r3957 | r3958 | |
| 2273 | 2273 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2274 | 2274 | |
| 2275 | 2275 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2276 | case CPUINFO_ | |
| 2276 | case CPUINFO_FCT | |
| 2277 | 2277 | |
| 2278 | 2278 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2279 | 2279 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (big)"); break; |
| 2280 | 2280 | |
| 2281 | 2281 | /* --- everything else is handled generically --- */ |
| 2282 | default: mips3 | |
| 2282 | default: CPU_GET_INFO_CALL(mips3 | |
| 2283 | 2283 | } |
| 2284 | 2284 | } |
| 2285 | 2285 | |
| r3957 | r3958 | |
| 2292 | 2292 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 2293 | 2293 | |
| 2294 | 2294 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2295 | case CPUINFO_ | |
| 2295 | case CPUINFO_FCT | |
| 2296 | 2296 | |
| 2297 | 2297 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2298 | 2298 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (little)"); break; |
| 2299 | 2299 | |
| 2300 | 2300 | /* --- everything else is handled generically --- */ |
| 2301 | default: mips3 | |
| 2301 | default: CPU_GET_INFO_CALL(mips3 | |
| 2302 | 2302 | } |
| 2303 | 2303 | } |
| 2304 | 2304 | #endif |
| r3957 | r3958 | |
| 2332 | 2332 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2333 | 2333 | |
| 2334 | 2334 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2335 | case CPUINFO_ | |
| 2335 | case CPUINFO_FCT | |
| 2336 | 2336 | |
| 2337 | 2337 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2338 | 2338 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (big)"); break; |
| 2339 | 2339 | |
| 2340 | 2340 | /* --- everything else is handled generically --- */ |
| 2341 | default: mips3 | |
| 2341 | default: CPU_GET_INFO_CALL(mips3 | |
| 2342 | 2342 | } |
| 2343 | 2343 | } |
| 2344 | 2344 | |
| r3957 | r3958 | |
| 2350 | 2350 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 2351 | 2351 | |
| 2352 | 2352 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2353 | case CPUINFO_ | |
| 2353 | case CPUINFO_FCT | |
| 2354 | 2354 | |
| 2355 | 2355 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2356 | 2356 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (little)"); break; |
| 2357 | 2357 | |
| 2358 | 2358 | /* --- everything else is handled generically --- */ |
| 2359 | default: mips3 | |
| 2359 | default: CPU_GET_INFO_CALL(mips3 | |
| 2360 | 2360 | } |
| 2361 | 2361 | } |
| 2362 | 2362 | #endif |
| r3957 | r3958 | |
| 2390 | 2390 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2391 | 2391 | |
| 2392 | 2392 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2393 | case CPUINFO_ | |
| 2393 | case CPUINFO_FCT | |
| 2394 | 2394 | |
| 2395 | 2395 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2396 | 2396 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (big)"); break; |
| 2397 | 2397 | |
| 2398 | 2398 | /* --- everything else is handled generically --- */ |
| 2399 | default: mips3 | |
| 2399 | default: CPU_GET_INFO_CALL(mips3 | |
| 2400 | 2400 | } |
| 2401 | 2401 | } |
| 2402 | 2402 | |
| r3957 | r3958 | |
| 2408 | 2408 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 2409 | 2409 | |
| 2410 | 2410 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2411 | case CPUINFO_ | |
| 2411 | case CPUINFO_FCT | |
| 2412 | 2412 | |
| 2413 | 2413 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2414 | 2414 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (little)"); break; |
| 2415 | 2415 | |
| 2416 | 2416 | /* --- everything else is handled generically --- */ |
| 2417 | default: mips3 | |
| 2417 | default: CPU_GET_INFO_CALL(mips3 | |
| 2418 | 2418 | } |
| 2419 | 2419 | } |
| 2420 | 2420 | #endif |
| r3957 | r3958 | |
| 2448 | 2448 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; |
| 2449 | 2449 | |
| 2450 | 2450 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2451 | case CPUINFO_ | |
| 2451 | case CPUINFO_FCT | |
| 2452 | 2452 | |
| 2453 | 2453 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2454 | 2454 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (big)"); break; |
| 2455 | 2455 | |
| 2456 | 2456 | /* --- everything else is handled generically --- */ |
| 2457 | default: mips3 | |
| 2457 | default: CPU_GET_INFO_CALL(mips3 | |
| 2458 | 2458 | } |
| 2459 | 2459 | } |
| 2460 | 2460 | |
| r3957 | r3958 | |
| 2466 | 2466 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| 2467 | 2467 | |
| 2468 | 2468 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2469 | case CPUINFO_ | |
| 2469 | case CPUINFO_FCT | |
| 2470 | 2470 | |
| 2471 | 2471 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2472 | 2472 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (little)"); break; |
| 2473 | 2473 | |
| 2474 | 2474 | /* --- everything else is handled generically --- */ |
| 2475 | default: mips3 | |
| 2475 | default: CPU_GET_INFO_CALL(mips3 | |
| 2476 | 2476 | } |
| 2477 | 2477 | } |
| 2478 | 2478 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 51 | 51 | extern CPU_GET_INFO( tms7000 ); |
| 52 | 52 | extern CPU_GET_INFO( tms7000_exl ); |
| 53 | 53 | |
| 54 | #define CPU_TMS7000 CPU_GET_INFO_NAME( tms7000 ) | |
| 55 | #define CPU_TMS7000_EXL CPU_GET_INFO_NAME( tms7000_exl ) | |
| 56 | ||
| 54 | 57 | extern CPU_DISASSEMBLE( tms7000 ); |
| 55 | 58 | |
| 56 | 59 | #endif /* __TMS7000_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 272 | 272 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 273 | 273 | case CPUINFO_INT_MAX_CYCLES: info->i = 48; break; /* 48 represents the multiply instruction, the next highest is 17 */ |
| 274 | 274 | |
| 275 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 276 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 277 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 278 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 279 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 280 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 281 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 282 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 283 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 275 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 276 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 277 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 278 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 279 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 280 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 281 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 282 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 8; break; | |
| 283 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 284 | 284 | |
| 285 | 285 | case CPUINFO_INT_INPUT_STATE + TMS7000_IRQ1_LINE: info->i = cpustate->irq_state[TMS7000_IRQ1_LINE]; break; |
| 286 | 286 | case CPUINFO_INT_INPUT_STATE + TMS7000_IRQ2_LINE: info->i = cpustate->irq_state[TMS7000_IRQ2_LINE]; break; |
| r3957 | r3958 | |
| 299 | 299 | case CPUINFO_INT_REGISTER + TMS7000_T1_DEC: info->i = cpustate->t1_decrementer; break; |
| 300 | 300 | |
| 301 | 301 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 302 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms7000); break; | |
| 303 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tms7000); break; | |
| 304 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms7000); break; | |
| 305 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms7000); break; | |
| 306 | case CPUINFO_PTR_BURN: info->burn = NULL; /* Not supported */break; | |
| 307 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms7000); break; | |
| 302 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms7000); break; | |
| 303 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tms7000); break; | |
| 304 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms7000); break; | |
| 305 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms7000); break; | |
| 306 | case CPUINFO_FCT_BURN: info->burn = NULL; /* Not supported */break; | |
| 307 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms7000); break; | |
| 308 | 308 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 309 | 309 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP: info->internal_map8 = ADDRESS_MAP_NAME(tms7000_mem); break; |
| 310 | 310 | |
| r3957 | r3958 | |
| 342 | 342 | { |
| 343 | 343 | switch( state ) |
| 344 | 344 | { |
| 345 | case CPUINFO_ | |
| 345 | case CPUINFO_FCT | |
| 346 | 346 | info->execute = CPU_EXECUTE_NAME(tms7000_exl); |
| 347 | 347 | break; |
| 348 | 348 | default: |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | #define F8_INT_INTR 1 |
| 49 | 49 | |
| 50 | 50 | CPU_GET_INFO( f8 ); |
| 51 | #define CPU_F8 CPU_GET_INFO_NAME( f8 ) | |
| 51 | 52 | |
| 52 | 53 | #ifdef __cplusplus |
| 53 | 54 | } |
| r3957 | r3958 | |
|---|---|---|
| 2013 | 2013 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2014 | 2014 | case CPUINFO_INT_MAX_CYCLES: info->i = 7; break; |
| 2015 | 2015 | |
| 2016 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 2017 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 2018 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2019 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2020 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2021 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2022 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2023 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2024 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2016 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 2017 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 2018 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2019 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2020 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2021 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2022 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2023 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 8; break; | |
| 2024 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2025 | 2025 | |
| 2026 | 2026 | case CPUINFO_INT_SP: info->i = cpustate->pc1; break; |
| 2027 | 2027 | case CPUINFO_INT_PC: info->i = (cpustate->pc0 - 1) & 0xffff; break; |
| r3957 | r3958 | |
| 2107 | 2107 | info->i = cpustate->r[state - (CPUINFO_INT_REGISTER + F8_R16) + 16]; break; |
| 2108 | 2108 | |
| 2109 | 2109 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2110 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(f8); break; | |
| 2111 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(f8); break; | |
| 2112 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(f8); break; | |
| 2113 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(f8); break; | |
| 2114 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2110 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(f8); break; | |
| 2111 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(f8); break; | |
| 2112 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(f8); break; | |
| 2113 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(f8); break; | |
| 2114 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2115 | 2115 | |
| 2116 | case CPUINFO_ | |
| 2116 | case CPUINFO_FCT | |
| 2117 | 2117 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2118 | 2118 | |
| 2119 | 2119 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 134 | 134 | const address_space *io; |
| 135 | 135 | int icount; |
| 136 | 136 | z80_daisy_state *daisy; |
| 137 | cpu_state_table state; | |
| 138 | UINT8 rtemp; | |
| 137 | 139 | }; |
| 138 | 140 | |
| 139 | 141 | #define CF 0x01 |
| r3957 | r3958 | |
| 192 | 194 | #define MEMPTR_L memptr.b.l |
| 193 | 195 | |
| 194 | 196 | |
| 197 | /*************************************************************************** | |
| 198 | CPU STATE DESCRIPTION | |
| 199 | ***************************************************************************/ | |
| 200 | ||
| 201 | #define Z80_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \ | |
| 202 | CPU_STATE_ENTRY(Z80_##_name, #_name, _format, z80_state, _member, _datamask, ~0, _flags) | |
| 203 | ||
| 204 | static const cpu_state_entry state_array[] = | |
| 205 | { | |
| 206 | Z80_STATE_ENTRY(PC, "%04X", PCD, 0xffff, 0) | |
| 207 | Z80_STATE_ENTRY(GENPC, "%04X", PCD, 0xffff, CPUSTATE_NOSHOW) | |
| 208 | Z80_STATE_ENTRY(GENPCBASE, "%04X", prvpc.w.l, 0xffff, CPUSTATE_NOSHOW) | |
| 209 | ||
| 210 | Z80_STATE_ENTRY(SP, "%04X", SP, 0xffff, 0) | |
| 211 | Z80_STATE_ENTRY(GENSP, "%04X", SPD, 0xffff, CPUSTATE_NOSHOW) | |
| 212 | ||
| 213 | Z80_STATE_ENTRY(A, "%02X", A, 0xff, CPUSTATE_NOSHOW) | |
| 214 | Z80_STATE_ENTRY(B, "%02X", B, 0xff, CPUSTATE_NOSHOW) | |
| 215 | Z80_STATE_ENTRY(C, "%02X", C, 0xff, CPUSTATE_NOSHOW) | |
| 216 | Z80_STATE_ENTRY(D, "%02X", D, 0xff, CPUSTATE_NOSHOW) | |
| 217 | Z80_STATE_ENTRY(E, "%02X", E, 0xff, CPUSTATE_NOSHOW) | |
| 218 | Z80_STATE_ENTRY(H, "%02X", H, 0xff, CPUSTATE_NOSHOW) | |
| 219 | Z80_STATE_ENTRY(L, "%02X", L, 0xff, CPUSTATE_NOSHOW) | |
| 220 | ||
| 221 | Z80_STATE_ENTRY(AF, "%04X", AF, 0xffff, 0) | |
| 222 | Z80_STATE_ENTRY(BC, "%04X", BC, 0xffff, 0) | |
| 223 | Z80_STATE_ENTRY(DE, "%04X", DE, 0xffff, 0) | |
| 224 | Z80_STATE_ENTRY(HL, "%04X", HL, 0xffff, 0) | |
| 225 | Z80_STATE_ENTRY(IX, "%04X", IX, 0xffff, 0) | |
| 226 | Z80_STATE_ENTRY(IY, "%04X", IY, 0xffff, 0) | |
| 227 | ||
| 228 | Z80_STATE_ENTRY(AF2, "%04X", af2.w.l, 0xffff, 0) | |
| 229 | Z80_STATE_ENTRY(BC2, "%04X", bc2.w.l, 0xffff, 0) | |
| 230 | Z80_STATE_ENTRY(DE2, "%04X", de2.w.l, 0xffff, 0) | |
| 231 | Z80_STATE_ENTRY(HL2, "%04X", hl2.w.l, 0xffff, 0) | |
| 232 | ||
| 233 | Z80_STATE_ENTRY(MEMPTR, "%04X", MEMPTR, 0xffff, 0) | |
| 234 | Z80_STATE_ENTRY(R, "%02X", rtemp, 0xff, CPUSTATE_EXPORT | CPUSTATE_IMPORT) | |
| 235 | Z80_STATE_ENTRY(I, "%02X", i, 0xff, 0) | |
| 236 | Z80_STATE_ENTRY(IM, "%1u", im, 0x3, 0) | |
| 237 | Z80_STATE_ENTRY(IFF1, "%1u", iff1, 0x1, 0) | |
| 238 | Z80_STATE_ENTRY(IFF2, "%1u", iff2, 0x1, 0) | |
| 239 | Z80_STATE_ENTRY(HALT, "%1u", halt, 0x1, 0) | |
| 240 | }; | |
| 241 | ||
| 242 | static const cpu_state_table state_table_template = | |
| 243 | { | |
| 244 | NULL, /* pointer to the base of state (offsets are relative to this) */ | |
| 245 | 0, /* subtype this table refers to */ | |
| 246 | ARRAY_LENGTH(state_array), /* number of entries */ | |
| 247 | state_array /* array of entries */ | |
| 248 | }; | |
| 249 | ||
| 250 | ||
| 251 | ||
| 195 | 252 | static UINT8 SZ[256]; /* zero and sign flags */ |
| 196 | 253 | static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ |
| 197 | 254 | static UINT8 SZP[256]; /* zero, sign and parity flags */ |
| r3957 | r3958 | |
| 3394 | 3451 | z80->io = cpu_get_address_space(device, ADDRESS_SPACE_IO); |
| 3395 | 3452 | z80->IX = z80->IY = 0xffff; /* IX and IY are FFFF after a reset! */ |
| 3396 | 3453 | z80->F = ZF; /* Zero flag is set */ |
| 3454 | ||
| 3455 | /* set up the state table */ | |
| 3456 | z80->state = state_table_template; | |
| 3457 | z80->state.baseptr = z80; | |
| 3458 | z80->state.subtypemask = 1; | |
| 3397 | 3459 | } |
| 3398 | 3460 | |
| 3399 | 3461 | /**************************************************************************** |
| r3957 | r3958 | |
| 3510 | 3572 | |
| 3511 | 3573 | |
| 3512 | 3574 | /************************************************************************** |
| 3575 | * STATE IMPORT/EXPORT | |
| 3576 | **************************************************************************/ | |
| 3577 | ||
| 3578 | static CPU_IMPORT_STATE( z80 ) | |
| 3579 | { | |
| 3580 | z80_state *cpustate = device->token; | |
| 3581 | ||
| 3582 | switch (entry->index) | |
| 3583 | { | |
| 3584 | case Z80_R: | |
| 3585 | cpustate->r = cpustate->rtemp & 0x7f; | |
| 3586 | cpustate->r2 = cpustate->rtemp & 0x80; | |
| 3587 | break; | |
| 3588 | ||
| 3589 | default: | |
| 3590 | fatalerror("CPU_IMPORT_STATE(z80) called for unexpected value\n"); | |
| 3591 | break; | |
| 3592 | } | |
| 3593 | } | |
| 3594 | ||
| 3595 | ||
| 3596 | static CPU_EXPORT_STATE( z80 ) | |
| 3597 | { | |
| 3598 | z80_state *cpustate = device->token; | |
| 3599 | ||
| 3600 | switch (entry->index) | |
| 3601 | { | |
| 3602 | case Z80_R: | |
| 3603 | cpustate->rtemp = (cpustate->r & 0x7f) | (cpustate->r2 & 0x80); | |
| 3604 | break; | |
| 3605 | ||
| 3606 | default: | |
| 3607 | fatalerror("CPU_EXPORT_STATE(z80) called for unexpected value\n"); | |
| 3608 | break; | |
| 3609 | } | |
| 3610 | } | |
| 3611 | ||
| 3612 | ||
| 3613 | /************************************************************************** | |
| 3513 | 3614 | * Generic set_info |
| 3514 | 3615 | **************************************************************************/ |
| 3515 | 3616 | |
| r3957 | r3958 | |
| 3520 | 3621 | { |
| 3521 | 3622 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 3522 | 3623 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(z80, INPUT_LINE_NMI, info->i); break; |
| 3523 | case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(z80, 0, info->i); | |
| 3624 | case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(z80, 0, info->i); | |
| 3524 | 3625 | |
| 3525 | case CPUINFO_INT_PC: z80->PC = info->i; break; | |
| 3526 | case CPUINFO_INT_REGISTER + Z80_PC: z80->PC = info->i; break; | |
| 3527 | case CPUINFO_INT_SP: z80->SP = info->i; break; | |
| 3528 | case CPUINFO_INT_REGISTER + Z80_SP: z80->SP = info->i; break; | |
| 3529 | case CPUINFO_INT_REGISTER + Z80_A: z80->A = info->i; break; | |
| 3530 | case CPUINFO_INT_REGISTER + Z80_B: z80->B = info->i; break; | |
| 3531 | case CPUINFO_INT_REGISTER + Z80_C: z80->C = info->i; break; | |
| 3532 | case CPUINFO_INT_REGISTER + Z80_D: z80->D = info->i; break; | |
| 3533 | case CPUINFO_INT_REGISTER + Z80_E: z80->E = info->i; break; | |
| 3534 | case CPUINFO_INT_REGISTER + Z80_H: z80->H = info->i; break; | |
| 3535 | case CPUINFO_INT_REGISTER + Z80_L: z80->L = info->i; break; | |
| 3536 | case CPUINFO_INT_REGISTER + Z80_AF: z80->AF = info->i; break; | |
| 3537 | case CPUINFO_INT_REGISTER + Z80_BC: z80->BC = info->i; break; | |
| 3538 | case CPUINFO_INT_REGISTER + Z80_DE: z80->DE = info->i; break; | |
| 3539 | case CPUINFO_INT_REGISTER + Z80_HL: z80->HL = info->i; break; | |
| 3540 | case CPUINFO_INT_REGISTER + Z80_IX: z80->IX = info->i; break; | |
| 3541 | case CPUINFO_INT_REGISTER + Z80_IY: z80->IY = info->i; break; | |
| 3542 | case CPUINFO_INT_REGISTER + Z80_MEMPTR: z80->MEMPTR = info->i; break; | |
| 3543 | case CPUINFO_INT_REGISTER + Z80_R: z80->r = info->i; z80->r2 = info->i & 0x80; break; | |
| 3544 | case CPUINFO_INT_REGISTER + Z80_I: z80->i = info->i; break; | |
| 3545 | case CPUINFO_INT_REGISTER + Z80_AF2: z80->af2.w.l = info->i; break; | |
| 3546 | case CPUINFO_INT_REGISTER + Z80_BC2: z80->bc2.w.l = info->i; break; | |
| 3547 | case CPUINFO_INT_REGISTER + Z80_DE2: z80->de2.w.l = info->i; break; | |
| 3548 | case CPUINFO_INT_REGISTER + Z80_HL2: z80->hl2.w.l = info->i; break; | |
| 3549 | case CPUINFO_INT_REGISTER + Z80_IM: z80->im = info->i; break; | |
| 3550 | case CPUINFO_INT_REGISTER + Z80_IFF1: z80->iff1 = info->i; break; | |
| 3551 | case CPUINFO_INT_REGISTER + Z80_IFF2: z80->iff2 = info->i; break; | |
| 3552 | case CPUINFO_INT_REGISTER + Z80_HALT: z80->halt = info->i; break; | |
| 3553 | ||
| 3554 | 3626 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 3555 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_op: cc[Z80_TABLE_op] = info->p; break; | |
| 3556 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_cb: cc[Z80_TABLE_cb] = info->p; break; | |
| 3557 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ed: cc[Z80_TABLE_ed] = info->p; break; | |
| 3558 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xy: cc[Z80_TABLE_xy] = info->p; break; | |
| 3559 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xycb: cc[Z80_TABLE_xycb] = info->p; break; | |
| 3560 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex: cc[Z80_TABLE_ex] = info->p; break; | |
| 3627 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_op: cc[Z80_TABLE_op] = info->p; break; | |
| 3628 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_cb: cc[Z80_TABLE_cb] = info->p; break; | |
| 3629 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ed: cc[Z80_TABLE_ed] = info->p; break; | |
| 3630 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xy: cc[Z80_TABLE_xy] = info->p; break; | |
| 3631 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xycb: cc[Z80_TABLE_xycb] = info->p; break; | |
| 3632 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex: cc[Z80_TABLE_ex] = info->p; break; | |
| 3561 | 3633 | } |
| 3562 | 3634 | } |
| 3563 | 3635 | |
| r3957 | r3958 | |
| 3573 | 3645 | switch (state) |
| 3574 | 3646 | { |
| 3575 | 3647 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 3576 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(z80_state); break; | |
| 3577 | case CPUINFO_INT_INPUT_LINES: info->i = 1; break; | |
| 3578 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; | |
| 3579 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; | |
| 3580 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; | |
| 3581 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; | |
| 3582 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; | |
| 3583 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; | |
| 3584 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; | |
| 3585 | case CPUINFO_INT_MAX_CYCLES: info->i = 16; break; | |
| 3648 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(z80_state); break; | |
| 3649 | case CPUINFO_INT_INPUT_LINES: info->i = 1; break; | |
| 3650 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; | |
| 3651 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; | |
| 3652 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; | |
| 3653 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; | |
| 3654 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; | |
| 3655 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; | |
| 3656 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; | |
| 3657 | case CPUINFO_INT_MAX_CYCLES: info->i = 16; break; | |
| 3586 | 3658 | |
| 3587 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 3588 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 3589 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 3590 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3591 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3592 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3593 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 3594 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 3595 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3659 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 3660 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 3661 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 3662 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 3663 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 3664 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 3596 | 3665 | |
| 3597 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = z80->nmi_state; break; | |
| 3598 | case CPUINFO_INT_INPUT_STATE + 0: info->i = z80->irq_state; break; | |
| 3666 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = z80->nmi_state; break; | |
| 3667 | case CPUINFO_INT_INPUT_STATE + 0: info->i = z80->irq_state; break; | |
| 3599 | 3668 | |
| 3600 | case CPUINFO_INT_PREVIOUSPC: info->i = z80->prvpc.w.l; break; | |
| 3669 | /* --- the following bits of info are returned as pointers to functions --- */ | |
| 3670 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(z80); break; | |
| 3671 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(z80); break; | |
| 3672 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(z80); break; | |
| 3673 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(z80); break; | |
| 3674 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(z80); break; | |
| 3675 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(z80); break; | |
| 3676 | case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(z80); break; | |
| 3677 | case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(z80); break; | |
| 3601 | 3678 | |
| 3602 | case CPUINFO_INT_PC: info->i = z80->PCD; break; | |
| 3603 | case CPUINFO_INT_REGISTER + Z80_PC: info->i = z80->PC; break; | |
| 3604 | case CPUINFO_INT_SP: info->i = z80->SPD; break; | |
| 3605 | case CPUINFO_INT_REGISTER + Z80_SP: info->i = z80->SP; break; | |
| 3606 | case CPUINFO_INT_REGISTER + Z80_A: info->i = z80->A; break; | |
| 3607 | case CPUINFO_INT_REGISTER + Z80_B: info->i = z80->B; break; | |
| 3608 | case CPUINFO_INT_REGISTER + Z80_C: info->i = z80->C; break; | |
| 3609 | case CPUINFO_INT_REGISTER + Z80_D: info->i = z80->D; break; | |
| 3610 | case CPUINFO_INT_REGISTER + Z80_E: info->i = z80->E; break; | |
| 3611 | case CPUINFO_INT_REGISTER + Z80_H: info->i = z80->H; break; | |
| 3612 | case CPUINFO_INT_REGISTER + Z80_L: info->i = z80->L; break; | |
| 3613 | case CPUINFO_INT_REGISTER + Z80_AF: info->i = z80->AF; break; | |
| 3614 | case CPUINFO_INT_REGISTER + Z80_BC: info->i = z80->BC; break; | |
| 3615 | case CPUINFO_INT_REGISTER + Z80_DE: info->i = z80->DE; break; | |
| 3616 | case CPUINFO_INT_REGISTER + Z80_HL: info->i = z80->HL; break; | |
| 3617 | case CPUINFO_INT_REGISTER + Z80_IX: info->i = z80->IX; break; | |
| 3618 | case CPUINFO_INT_REGISTER + Z80_IY: info->i = z80->IY; break; | |
| 3619 | case CPUINFO_INT_REGISTER + Z80_MEMPTR: info->i = z80->MEMPTR; break; | |
| 3620 | case CPUINFO_INT_REGISTER + Z80_R: info->i = (z80->r & 0x7f) | (z80->r2 & 0x80); break; | |
| 3621 | case CPUINFO_INT_REGISTER + Z80_I: info->i = z80->i; break; | |
| 3622 | case CPUINFO_INT_REGISTER + Z80_AF2: info->i = z80->af2.w.l; break; | |
| 3623 | case CPUINFO_INT_REGISTER + Z80_BC2: info->i = z80->bc2.w.l; break; | |
| 3624 | case CPUINFO_INT_REGISTER + Z80_DE2: info->i = z80->de2.w.l; break; | |
| 3625 | case CPUINFO_INT_REGISTER + Z80_HL2: info->i = z80->hl2.w.l; break; | |
| 3626 | case CPUINFO_INT_REGISTER + Z80_IM: info->i = z80->im; break; | |
| 3627 | case CPUINFO_INT_REGISTER + Z80_IFF1: info->i = z80->iff1; break; | |
| 3628 | case CPUINFO_INT_REGISTER + Z80_IFF2: info->i = z80->iff2; break; | |
| 3629 | case CPUINFO_INT_REGISTER + Z80_HALT: info->i = z80->halt; break; | |
| 3679 | /* --- the following bits of info are returned as pointers --- */ | |
| 3680 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &z80->icount; break; | |
| 3681 | case CPUINFO_PTR_STATE_TABLE: info->state_table = &z80->state; break; | |
| 3630 | 3682 | |
| 3631 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 3632 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(z80); break; | |
| 3633 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(z80); break; | |
| 3634 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(z80); break; | |
| 3635 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(z80); break; | |
| 3636 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(z80); break; | |
| 3637 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 3638 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(z80); break; | |
| 3639 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &z80->icount; break; | |
| 3640 | 3683 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_op: info->p = (void *)cc[Z80_TABLE_op]; break; |
| 3641 | 3684 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_cb: info->p = (void *)cc[Z80_TABLE_cb]; break; |
| 3642 | 3685 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ed: info->p = (void *)cc[Z80_TABLE_ed]; break; |
| r3957 | r3958 | |
| 3645 | 3688 | case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex: info->p = (void *)cc[Z80_TABLE_ex]; break; |
| 3646 | 3689 | |
| 3647 | 3690 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3648 | case CPUINFO_STR_NAME: strcpy(info->s, "Z80"); break; | |
| 3649 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Zilog Z80"); break; | |
| 3650 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "3.8"); break; | |
| 3651 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 3652 | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break; | |
| 3691 | case CPUINFO_STR_NAME: strcpy(info->s, "Z80"); break; | |
| 3692 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Zilog Z80"); break; | |
| 3693 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "3.8"); break; | |
| 3694 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 3695 | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break; | |
| 3653 | 3696 | |
| 3654 | 3697 | case CPUINFO_STR_FLAGS: |
| 3655 | 3698 | sprintf(info->s, "%c%c%c%c%c%c%c%c", |
| r3957 | r3958 | |
| 3662 | 3705 | z80->F & 0x02 ? 'N':'.', |
| 3663 | 3706 | z80->F & 0x01 ? 'C':'.'); |
| 3664 | 3707 | break; |
| 3665 | ||
| 3666 | case CPUINFO_STR_REGISTER + Z80_PC: sprintf(info->s, "PC:%04X", z80->PC); break; | |
| 3667 | case CPUINFO_STR_REGISTER + Z80_SP: sprintf(info->s, "SP:%04X", z80->SP); break; | |
| 3668 | case CPUINFO_STR_REGISTER + Z80_A: sprintf(info->s, "~A:%02X", z80->A); break; | |
| 3669 | case CPUINFO_STR_REGISTER + Z80_B: sprintf(info->s, "~B:%02X", z80->B); break; | |
| 3670 | case CPUINFO_STR_REGISTER + Z80_C: sprintf(info->s, "~C:%02X", z80->C); break; | |
| 3671 | case CPUINFO_STR_REGISTER + Z80_D: sprintf(info->s, "~D:%02X", z80->D); break; | |
| 3672 | case CPUINFO_STR_REGISTER + Z80_E: sprintf(info->s, "~E:%02X", z80->E); break; | |
| 3673 | case CPUINFO_STR_REGISTER + Z80_H: sprintf(info->s, "~H:%02X", z80->H); break; | |
| 3674 | case CPUINFO_STR_REGISTER + Z80_L: sprintf(info->s, "~L:%02X", z80->L); break; | |
| 3675 | case CPUINFO_STR_REGISTER + Z80_AF: sprintf(info->s, "AF:%04X", z80->AF); break; | |
| 3676 | case CPUINFO_STR_REGISTER + Z80_BC: sprintf(info->s, "BC:%04X", z80->BC); break; | |
| 3677 | case CPUINFO_STR_REGISTER + Z80_DE: sprintf(info->s, "DE:%04X", z80->DE); break; | |
| 3678 | case CPUINFO_STR_REGISTER + Z80_HL: sprintf(info->s, "HL:%04X", z80->HL); break; | |
| 3679 | case CPUINFO_STR_REGISTER + Z80_IX: sprintf(info->s, "IX:%04X", z80->IX); break; | |
| 3680 | case CPUINFO_STR_REGISTER + Z80_IY: sprintf(info->s, "IY:%04X", z80->IY); break; | |
| 3681 | case CPUINFO_STR_REGISTER + Z80_MEMPTR: sprintf(info->s, "MEMPTR:%04X", z80->MEMPTR); break; | |
| 3682 | case CPUINFO_STR_REGISTER + Z80_R: sprintf(info->s, "R:%02X", (z80->r & 0x7f) | (z80->r2 & 0x80)); break; | |
| 3683 | case CPUINFO_STR_REGISTER + Z80_I: sprintf(info->s, "I:%02X", z80->i); break; | |
| 3684 | case CPUINFO_STR_REGISTER + Z80_AF2: sprintf(info->s, "AF2:%04X", z80->af2.w.l); break; | |
| 3685 | case CPUINFO_STR_REGISTER + Z80_BC2: sprintf(info->s, "BC2:%04X", z80->bc2.w.l); break; | |
| 3686 | case CPUINFO_STR_REGISTER + Z80_DE2: sprintf(info->s, "DE2:%04X", z80->de2.w.l); break; | |
| 3687 | case CPUINFO_STR_REGISTER + Z80_HL2: sprintf(info->s, "HL2:%04X", z80->hl2.w.l); break; | |
| 3688 | case CPUINFO_STR_REGISTER + Z80_IM: sprintf(info->s, "IM:%X", z80->im); break; | |
| 3689 | case CPUINFO_STR_REGISTER + Z80_IFF1: sprintf(info->s, "IFF1:%X", z80->iff1); break; | |
| 3690 | case CPUINFO_STR_REGISTER + Z80_IFF2: sprintf(info->s, "IFF2:%X", z80->iff2); break; | |
| 3691 | case CPUINFO_STR_REGISTER + Z80_HALT: sprintf(info->s, "HALT:%X", z80->halt); break; | |
| 3692 | 3708 | } |
| 3693 | 3709 | } |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | enum |
| 9 | 9 | { |
| 10 | Z80_PC | |
| 10 | Z80_PC | |
| 11 | 11 | Z80_A, Z80_B, Z80_C, Z80_D, Z80_E, Z80_H, Z80_L, |
| 12 | 12 | Z80_AF, Z80_BC, Z80_DE, Z80_HL, |
| 13 | 13 | Z80_IX, Z80_IY, Z80_AF2, Z80_BC2, Z80_DE2, Z80_HL2, |
| 14 | 14 | Z80_R, Z80_I, Z80_IM, Z80_IFF1, Z80_IFF2, Z80_HALT, |
| 15 | Z80_DC0, Z80_DC1, Z80_DC2, Z80_DC3, Z80_MEMPTR | |
| 15 | Z80_DC0, Z80_DC1, Z80_DC2, Z80_DC3, Z80_MEMPTR, | |
| 16 | ||
| 17 | Z80_GENPC = REG_GENPC, | |
| 18 | Z80_GENSP = REG_GENSP, | |
| 19 | Z80_GENPCBASE = REG_GENPCBASE | |
| 16 | 20 | }; |
| 17 | 21 | |
| 18 | 22 | enum |
| r3957 | r3958 | |
| 32 | 36 | }; |
| 33 | 37 | |
| 34 | 38 | extern CPU_GET_INFO( z80 ); |
| 39 | #define CPU_Z80 CPU_GET_INFO_NAME( z80 ) | |
| 35 | 40 | |
| 36 | 41 | extern CPU_DISASSEMBLE( z80 ); |
| 37 | 42 |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | #include "cpuintrf.h" | |
| 10 | #include "mame.h" | |
| 9 | #include "driver.h" | |
| 11 | 10 | #include "z80daisy.h" |
| 12 | 11 | |
| 13 | 12 |
| r3957 | r3958 | |
|---|---|---|
| 1714 | 1714 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1715 | 1715 | case CPUINFO_INT_MAX_CYCLES: info->i = 2; break; |
| 1716 | 1716 | |
| 1717 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1718 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1719 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1720 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1721 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1722 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1723 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1724 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1725 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1717 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1718 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1719 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1720 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1721 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1722 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1723 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1724 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1725 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1726 | 1726 | |
| 1727 | 1727 | case CPUINFO_INT_INPUT_STATE + ASAP_IRQ0: info->i = asap->irq_state; break; |
| 1728 | 1728 | |
| r3957 | r3958 | |
| 1766 | 1766 | case CPUINFO_INT_REGISTER + ASAP_R31: info->i = asap->src2val[REGBASE + 31]; break; |
| 1767 | 1767 | |
| 1768 | 1768 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1769 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(asap); break; | |
| 1770 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(asap); break; | |
| 1771 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(asap); break; | |
| 1772 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(asap); break; | |
| 1773 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(asap); break; | |
| 1774 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1775 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(asap); break; | |
| 1769 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(asap); break; | |
| 1770 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(asap); break; | |
| 1771 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(asap); break; | |
| 1772 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(asap); break; | |
| 1773 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(asap); break; | |
| 1774 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1775 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(asap); break; | |
| 1776 | 1776 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &asap->icount; break; |
| 1777 | 1777 | |
| 1778 | 1778 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | 42 | extern CPU_GET_INFO( asap ); |
| 43 | #define CPU_ASAP CPU_GET_INFO_NAME( asap ) | |
| 43 | 44 | |
| 44 | 45 | #endif /* __ASAP_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 4674 | 4674 | case CPUINFO_INT_MAX_CYCLES: info->i = 10;/*TODO: compute this value*/break; |
| 4675 | 4675 | |
| 4676 | 4676 | #if (USE_16_BIT_ACCESSORS) |
| 4677 | case CPUINFO_INT_DATABUS_WIDTH | |
| 4677 | case CPUINFO_INT_DATABUS_WIDTH | |
| 4678 | 4678 | #else |
| 4679 | case CPUINFO_INT_DATABUS_WIDTH | |
| 4679 | case CPUINFO_INT_DATABUS_WIDTH | |
| 4680 | 4680 | #endif |
| 4681 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 4681 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 4682 | 4682 | #if (TMS99XX_MODEL == TI990_10_ID) |
| 4683 | 4683 | /* this CPU has a mapper to expand the address space */ |
| 4684 | 4684 | info->i = 21; |
| r3957 | r3958 | |
| 4693 | 4693 | info->i = 16; |
| 4694 | 4694 | #endif |
| 4695 | 4695 | break; |
| 4696 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 4697 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4698 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4699 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 4700 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 4701 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: | |
| 4696 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 4697 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 4698 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 4699 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 4700 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 4701 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: | |
| 4702 | 4702 | #if (TMS99XX_MODEL == TI990_10_ID) |
| 4703 | 4703 | /* 3 MSBs do exist, although they are not connected (don't ask...) */ |
| 4704 | 4704 | info->i = 15; |
| r3957 | r3958 | |
| 4719 | 4719 | info->i = 15; |
| 4720 | 4720 | #endif |
| 4721 | 4721 | break; |
| 4722 | case CPUINFO_INT_ADDRBUS_SHIFT | |
| 4722 | case CPUINFO_INT_ADDRBUS_SHIFT | |
| 4723 | 4723 | |
| 4724 | 4724 | /* not implemented */ |
| 4725 | 4725 | /* case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = get_irq_line(INPUT_LINE_NMI); break; |
| r3957 | r3958 | |
| 4781 | 4781 | case CPUINFO_INT_REGISTER + TMS9900_R15: info->i = READREG_DEBUG(cpustate, R15); break; |
| 4782 | 4782 | |
| 4783 | 4783 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 4784 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms99xx); break; | |
| 4785 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tms99xx); break; | |
| 4786 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms99xx); break; | |
| 4787 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(tms99xx); break; | |
| 4788 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms99xx); break; | |
| 4789 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 4790 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms99xx); break; | |
| 4784 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms99xx); break; | |
| 4785 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tms99xx); break; | |
| 4786 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms99xx); break; | |
| 4787 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(tms99xx); break; | |
| 4788 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms99xx); break; | |
| 4789 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 4790 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms99xx); break; | |
| 4791 | 4791 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 4792 | 4792 | |
| 4793 | 4793 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | #if (HAS_TI990_10) |
| 56 | 56 | |
| 57 | 57 | extern CPU_GET_INFO( ti990_10 ); |
| 58 | #define CPU_TI990_10 CPU_GET_INFO_NAME( ti990_10 ) | |
| 58 | 59 | |
| 59 | 60 | /* |
| 60 | 61 | structure with the parameters ti990_10_reset wants. |
| r3957 | r3958 | |
| 84 | 85 | #if (HAS_TMS9900) |
| 85 | 86 | |
| 86 | 87 | extern CPU_GET_INFO( tms9900 ); |
| 88 | #define CPU_TMS9900 CPU_GET_INFO_NAME( tms9900 ) | |
| 87 | 89 | |
| 88 | 90 | /* |
| 89 | 91 | structure with optional parameters for tms9900_reset. |
| r3957 | r3958 | |
| 98 | 100 | #if (HAS_TMS9940) |
| 99 | 101 | |
| 100 | 102 | extern CPU_GET_INFO( tms9940 ); |
| 103 | #define CPU_TMS9940 CPU_GET_INFO_NAME( tms9940 ) | |
| 101 | 104 | |
| 102 | 105 | /* |
| 103 | 106 | structure with optional parameters for tms9940_reset. |
| r3957 | r3958 | |
| 112 | 115 | #if (HAS_TMS9980) |
| 113 | 116 | |
| 114 | 117 | extern CPU_GET_INFO( tms9980a ); |
| 118 | #define CPU_TMS9980 CPU_GET_INFO_NAME( tms9980a ) | |
| 115 | 119 | |
| 116 | 120 | /* |
| 117 | 121 | structure with optional parameters for tms9980a_reset. |
| r3957 | r3958 | |
| 126 | 130 | #if (HAS_TMS9985) |
| 127 | 131 | |
| 128 | 132 | extern CPU_GET_INFO( tms9985 ); |
| 133 | #define CPU_TMS9986 CPU_GET_INFO_NAME( tms9985 ) | |
| 129 | 134 | |
| 130 | 135 | /* |
| 131 | 136 | structure with optional parameters for tms9985_reset. |
| r3957 | r3958 | |
| 140 | 145 | #if (HAS_TMS9989) |
| 141 | 146 | |
| 142 | 147 | extern CPU_GET_INFO( tms9989 ); |
| 148 | #define CPU_TMS9989 CPU_GET_INFO_NAME( tms9989 ) | |
| 143 | 149 | |
| 144 | 150 | /* |
| 145 | 151 | structure with optional parameters for tms9989_reset. |
| r3957 | r3958 | |
| 154 | 160 | #if (HAS_TMS9995) |
| 155 | 161 | |
| 156 | 162 | extern CPU_GET_INFO( tms9995 ); |
| 163 | #define CPU_TMS9995 CPU_GET_INFO_NAME( tms9995 ) | |
| 157 | 164 | |
| 158 | 165 | /* |
| 159 | 166 | structure with the parameters tms9995_reset wants. |
| r3957 | r3958 | |
| 184 | 191 | #if (HAS_TMS99000) |
| 185 | 192 | |
| 186 | 193 | extern CPU_GET_INFO( tms99000 ); |
| 194 | #define CPU_TMS99000 CPU_GET_INFO_NAME( tms99000 ) | |
| 187 | 195 | |
| 188 | 196 | /* |
| 189 | 197 | structure with optional parameters for tms99000_reset. |
| r3957 | r3958 | |
| 198 | 206 | #if (HAS_TMS99105A) |
| 199 | 207 | |
| 200 | 208 | extern CPU_GET_INFO( tms99105a ); |
| 209 | #define CPU_TMS99105A CPU_GET_INFO_NAME( tms99105a ) | |
| 201 | 210 | |
| 202 | 211 | /* |
| 203 | 212 | structure with optional parameters for tms99105a_reset. |
| r3957 | r3958 | |
| 212 | 221 | #if (HAS_TMS99110A) |
| 213 | 222 | |
| 214 | 223 | extern CPU_GET_INFO( tms99110a ); |
| 224 | #define CPU_TMS99110A CPU_GET_INFO_NAME( tms99110a ) | |
| 215 | 225 | |
| 216 | 226 | /* |
| 217 | 227 | structure with optional parameters for tms99110a_reset. |
| r3957 | r3958 | |
|---|---|---|
| 2120 | 2120 | |
| 2121 | 2121 | switch(state) { |
| 2122 | 2122 | // Interface functions and variables |
| 2123 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i960); break; | |
| 2124 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i960); break; | |
| 2125 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(i960); break; | |
| 2126 | case CPUINFO_PTR_EXIT: info->exit = 0; break; | |
| 2127 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(i960); break; | |
| 2128 | case CPUINFO_PTR_BURN: info->burn = 0; break; | |
| 2129 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i960); break; | |
| 2123 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i960); break; | |
| 2124 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i960); break; | |
| 2125 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(i960); break; | |
| 2126 | case CPUINFO_FCT_EXIT: info->exit = 0; break; | |
| 2127 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i960); break; | |
| 2128 | case CPUINFO_FCT_BURN: info->burn = 0; break; | |
| 2129 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i960); break; | |
| 2130 | 2130 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &i960->icount; break; |
| 2131 | 2131 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(i960_state_t); break; |
| 2132 | 2132 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 4; break; |
| 2133 | 2133 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 8; break; |
| 2134 | 2134 | |
| 2135 | 2135 | // Bus sizes |
| 2136 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2137 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 2138 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2139 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2140 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2141 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2142 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2143 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2144 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2145 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2146 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2147 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2136 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2137 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 2138 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2139 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 0; break; | |
| 2140 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2141 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2142 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2143 | case CPUINFO_INT_LOGADDR_WIDTH_DATA: info->i = 0; break; | |
| 2144 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 2145 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 2146 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2147 | case CPUINFO_INT_LOGADDR_WIDTH_IO: info->i = 0; break; | |
| 2148 | 2148 | |
| 2149 | 2149 | // Internal maps |
| 2150 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map32 = NULL;break; | |
| 2151 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map32 = NULL;break; | |
| 2152 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO: info->internal_map32 = NULL;break; | |
| 2150 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map32 = NULL;break; | |
| 2151 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map32 = NULL;break; | |
| 2152 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO: info->internal_map32 = NULL;break; | |
| 2153 | 2153 | |
| 2154 | 2154 | // CPU misc parameters |
| 2155 | 2155 | case CPUINFO_STR_NAME: strcpy(info->s, "i960KB"); break; |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | }; |
| 63 | 63 | |
| 64 | 64 | CPU_GET_INFO( i960 ); |
| 65 | #define CPU_I960 CPU_GET_INFO_NAME( i960 ) | |
| 66 | ||
| 65 | 67 | void i960_noburst(const device_config *device); |
| 66 | 68 | void i960_stall(const device_config *device); |
| 67 | 69 |
| r3957 | r3958 | |
|---|---|---|
| 1154 | 1154 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1155 | 1155 | case CPUINFO_INT_MAX_CYCLES: info->i = 1; break; |
| 1156 | 1156 | |
| 1157 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1158 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1159 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1160 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1161 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1162 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1163 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 1164 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 32; break; | |
| 1165 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1157 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1158 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1159 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1160 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 1161 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 1162 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1163 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 32; break; | |
| 1164 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 32; break; | |
| 1165 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1166 | 1166 | |
| 1167 | 1167 | case CPUINFO_INT_INPUT_STATE + 0: info->i = cpustate->irq_line; break; |
| 1168 | 1168 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = cpustate->nmi_line; break; |
| r3957 | r3958 | |
| 1217 | 1217 | case CPUINFO_INT_REGISTER + V810_ADTRE: info->i = cpustate->ADTRE; break; |
| 1218 | 1218 | |
| 1219 | 1219 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1220 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(v810); break; | |
| 1221 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(v810); break; | |
| 1222 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(v810); break; | |
| 1223 | case CPUINFO_PTR_EXIT: info->exit = NULL; break; | |
| 1224 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(v810); break; | |
| 1225 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1226 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(v810); break; | |
| 1220 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(v810); break; | |
| 1221 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(v810); break; | |
| 1222 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(v810); break; | |
| 1223 | case CPUINFO_FCT_EXIT: info->exit = NULL; break; | |
| 1224 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(v810); break; | |
| 1225 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1226 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(v810); break; | |
| 1227 | 1227 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1228 | 1228 | |
| 1229 | 1229 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | #include "cpuintrf.h" |
| 7 | 7 | |
| 8 | void v810_get_info(UINT32, cpuinfo*); | |
| 8 | CPU_GET_INFO( v810 ); | |
| 9 | #define CPU_V810 CPU_GET_INFO_NAME( v810 ) | |
| 9 | 10 | |
| 10 | 11 | CPU_DISASSEMBLE( v810 ); |
| 11 | 12 |
| r3957 | r3958 | |
|---|---|---|
| 2300 | 2300 | case CPUINFO_INT_MIN_CYCLES: info->i = 1*CLK; break; |
| 2301 | 2301 | case CPUINFO_INT_MAX_CYCLES: info->i = 5*CLK; break; |
| 2302 | 2302 | |
| 2303 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 2304 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 2305 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; | |
| 2306 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 2307 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 16; break; | |
| 2308 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = -1; break; | |
| 2309 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 2310 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 17; break; | |
| 2311 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = -1; break; | |
| 2303 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 2304 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 2305 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 2306 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 16; break; | |
| 2307 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 16; break; | |
| 2308 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = -1; break; | |
| 2309 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 16; break; | |
| 2310 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 17; break; | |
| 2311 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = -1; break; | |
| 2312 | 2312 | |
| 2313 | 2313 | case CPUINFO_INT_INPUT_STATE + TMS32025_INT0: info->i = (cpustate->IFR & 0x01) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2314 | 2314 | case CPUINFO_INT_INPUT_STATE + TMS32025_INT1: info->i = (cpustate->IFR & 0x02) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 2354 | 2354 | case CPUINFO_INT_REGISTER + TMS32025_GREG: info->i = M_RDRAM(cpustate, 5); break; |
| 2355 | 2355 | |
| 2356 | 2356 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2357 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms32025); break; | |
| 2358 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tms32025); break; | |
| 2359 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tms32025); break; | |
| 2360 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(tms32025); break; | |
| 2361 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms32025); break; | |
| 2362 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2363 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32025); break; | |
| 2364 | case CPUINFO_PTR_READ: info->read = CPU_READ_NAME(tms32025); break; | |
| 2365 | case CPUINFO_PTR_WRITE: info->write = CPU_WRITE_NAME(tms32025); break; | |
| 2366 | case CPUINFO_PTR_READOP: info->readop = CPU_READOP_NAME(tms32025); break; | |
| 2357 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tms32025); break; | |
| 2358 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tms32025); break; | |
| 2359 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tms32025); break; | |
| 2360 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(tms32025); break; | |
| 2361 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tms32025); break; | |
| 2362 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2363 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tms32025); break; | |
| 2364 | case CPUINFO_FCT_READ: info->read = CPU_READ_NAME(tms32025); break; | |
| 2365 | case CPUINFO_FCT_WRITE: info->write = CPU_WRITE_NAME(tms32025); break; | |
| 2366 | case CPUINFO_FCT_READOP: info->readop = CPU_READOP_NAME(tms32025); break; | |
| 2367 | 2367 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2368 | 2368 | |
| 2369 | 2369 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 2441 | 2441 | switch (state) |
| 2442 | 2442 | { |
| 2443 | 2443 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2444 | case CPUINFO_ | |
| 2444 | case CPUINFO_FCT | |
| 2445 | 2445 | |
| 2446 | 2446 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2447 | 2447 | case CPUINFO_STR_NAME: strcpy(info->s, "TMS32026"); break; |
| r3957 | r3958 | |
|---|---|---|
| 73 | 73 | extern CPU_GET_INFO( tms32025 ); |
| 74 | 74 | extern CPU_GET_INFO( tms32026 ); |
| 75 | 75 | |
| 76 | #define CPU_TMS32025 CPU_GET_INFO_NAME( tms32025 ) | |
| 77 | #define CPU_TMS32026 CPU_GET_INFO_NAME( tms32026 ) | |
| 76 | 78 | |
| 77 | 79 | CPU_DISASSEMBLE( tms32025 ); |
| 78 | 80 |
| r3957 | r3958 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | |
| 129 | /**************************************************************************** | |
| 130 | * Read the state of the T0 Clock input signal | |
| 131 | */ | |
| 129 | 132 | |
| 133 | #define PIC16C5x_T0_In (memory_read_byte_8le(cpustate->io, PIC16C5x_T0)) | |
| 134 | ||
| 135 | ||
| 136 | /**************************************************************************** | |
| 137 | * Input a word from given I/O port | |
| 138 | */ | |
| 139 | ||
| 140 | #define PIC16C5x_In(Port) ((UINT8)memory_read_byte_8le(cpustate->io, (Port))) | |
| 141 | ||
| 142 | ||
| 143 | /**************************************************************************** | |
| 144 | * Output a word to given I/O port | |
| 145 | */ | |
| 146 | ||
| 147 | #define PIC16C5x_Out(Port,Value) (memory_write_byte_8le(cpustate->io, (Port),Value)) | |
| 148 | ||
| 149 | ||
| 150 | ||
| 151 | /**************************************************************************** | |
| 152 | * Read a word from given RAM memory location | |
| 153 | */ | |
| 154 | ||
| 155 | #define PIC16C5x_RAM_RDMEM(A) ((UINT8)memory_read_byte_8le(cpustate->data, A)) | |
| 156 | ||
| 157 | ||
| 158 | /**************************************************************************** | |
| 159 | * Write a word to given RAM memory location | |
| 160 | */ | |
| 161 | ||
| 162 | #define PIC16C5x_RAM_WRMEM(A,V) (memory_write_byte_8le(cpustate->data, A,V)) | |
| 163 | ||
| 164 | ||
| 165 | ||
| 166 | /**************************************************************************** | |
| 167 | * PIC16C5X_RDOP() is identical to PIC16C5X_RDMEM() except it is used for | |
| 168 | * reading opcodes. In case of system with memory mapped I/O, this function | |
| 169 | * can be used to greatly speed up emulation | |
| 170 | */ | |
| 171 | ||
| 172 | #define PIC16C5x_RDOP(A) (memory_decrypted_read_word(cpustate->program, (A)<<1)) | |
| 173 | ||
| 174 | ||
| 175 | /**************************************************************************** | |
| 176 | * PIC16C5X_RDOP_ARG() is identical to PIC16C5X_RDOP() except it is used | |
| 177 | * for reading opcode arguments. This difference can be used to support systems | |
| 178 | * that use different encoding mechanisms for opcodes and opcode arguments | |
| 179 | */ | |
| 180 | ||
| 181 | #define PIC16C5x_RDOP_ARG(A) (memory_raw_read_word(cpustate->program, (A)<<1)) | |
| 182 | ||
| 183 | ||
| 130 | 184 | #define TMR0 internalram[1] |
| 131 | 185 | #define PCL internalram[2] |
| 132 | 186 | #define STATUS internalram[3] |
| r3957 | r3958 | |
| 682 | 736 | * Inits CPU emulation |
| 683 | 737 | ****************************************************************************/ |
| 684 | 738 | |
| 685 | static CPU_INIT( pic16 | |
| 739 | static CPU_INIT( pic16c5x ) | |
| 686 | 740 | { |
| 687 | 741 | pic16c5x_state *cpustate = device->token; |
| 688 | 742 | |
| r3957 | r3958 | |
| 730 | 784 | * Reset registers to their initial values |
| 731 | 785 | ****************************************************************************/ |
| 732 | 786 | |
| 733 | static void pic16 | |
| 787 | static void pic16c5x_reset_regs(pic16c5x_state *cpustate) | |
| 734 | 788 | { |
| 735 | 789 | cpustate->PC = cpustate->reset_vector; |
| 736 | 790 | cpustate->CONFIG = cpustate->temp_config; |
| r3957 | r3958 | |
| 747 | 801 | cpustate->inst_cycles = 0; |
| 748 | 802 | } |
| 749 | 803 | |
| 750 | static void pic16 | |
| 804 | static void pic16c5x_soft_reset(pic16c5x_state *cpustate) | |
| 751 | 805 | { |
| 752 | 806 | cpustate->STATUS &= 0x1f; |
| 753 | pic16 | |
| 807 | pic16c5x_reset_regs(cpustate); | |
| 754 | 808 | } |
| 755 | 809 | |
| 756 | 810 | void pic16c5x_set_config(const device_config *cpu, int data) |
| r3957 | r3958 | |
| 766 | 820 | * Shut down CPU emulation |
| 767 | 821 | ****************************************************************************/ |
| 768 | 822 | |
| 769 | static CPU_EXIT( pic16 | |
| 823 | static CPU_EXIT( pic16c5x ) | |
| 770 | 824 | { |
| 771 | 825 | /* nothing to do */ |
| 772 | 826 | } |
| r3957 | r3958 | |
| 776 | 830 | * WatchDog |
| 777 | 831 | ****************************************************************************/ |
| 778 | 832 | |
| 779 | static void pic16 | |
| 833 | static void pic16c5x_update_watchdog(pic16c5x_state *cpustate, int counts) | |
| 780 | 834 | { |
| 781 | 835 | /* WatchDog is set up to count 18,000 (0x464f hex) ticks to provide */ |
| 782 | 836 | /* the timeout period of 0.018ms based on a 4MHz input clock. */ |
| r3957 | r3958 | |
| 802 | 856 | if (cpustate->prescaler >= (1 << PS)) { /* Prescale values from 1 to 128 */ |
| 803 | 857 | cpustate->prescaler = 0; |
| 804 | 858 | CLR(cpustate, TO_FLAG); |
| 805 | pic16 | |
| 859 | pic16c5x_soft_reset(cpustate); | |
| 806 | 860 | } |
| 807 | 861 | } |
| 808 | 862 | else { |
| 809 | 863 | CLR(cpustate, TO_FLAG); |
| 810 | pic16 | |
| 864 | pic16c5x_soft_reset(cpustate); | |
| 811 | 865 | } |
| 812 | 866 | } |
| 813 | 867 | } |
| r3957 | r3958 | |
| 818 | 872 | * Update Timer |
| 819 | 873 | ****************************************************************************/ |
| 820 | 874 | |
| 821 | static void pic16 | |
| 875 | static void pic16c5x_update_timer(pic16c5x_state *cpustate, int counts) | |
| 822 | 876 | { |
| 823 | 877 | if (PSA == 0) { |
| 824 | 878 | cpustate->prescaler += counts; |
| r3957 | r3958 | |
| 837 | 891 | * Execute IPeriod. Return 0 if emulation should be stopped |
| 838 | 892 | ****************************************************************************/ |
| 839 | 893 | |
| 840 | static CPU_EXECUTE( pic16 | |
| 894 | static CPU_EXECUTE( pic16c5x ) | |
| 841 | 895 | { |
| 842 | 896 | pic16c5x_state *cpustate = device->token; |
| 843 | 897 | int T0_in; |
| r3957 | r3958 | |
| 850 | 904 | cpustate->inst_cycles = 1; |
| 851 | 905 | debugger_instruction_hook(device, cpustate->PC); |
| 852 | 906 | if (WDTE) { |
| 853 | pic16 | |
| 907 | pic16c5x_update_watchdog(cpustate, 1); | |
| 854 | 908 | } |
| 855 | 909 | } |
| 856 | 910 | else |
| r3957 | r3958 | |
| 876 | 930 | T0_in = S_T0_IN; |
| 877 | 931 | if (T0SE) { /* Count rising edge */ |
| 878 | 932 | if (POSITIVE_EDGE_T0) { |
| 879 | pic16 | |
| 933 | pic16c5x_update_timer(cpustate, 1); | |
| 880 | 934 | } |
| 881 | 935 | } |
| 882 | 936 | else { /* Count falling edge */ |
| 883 | 937 | if (NEGATIVE_EDGE_T0) { |
| 884 | pic16 | |
| 938 | pic16c5x_update_timer(cpustate, 1); | |
| 885 | 939 | } |
| 886 | 940 | } |
| 887 | 941 | cpustate->old_T0 = T0_in; |
| r3957 | r3958 | |
| 891 | 945 | cpustate->delay_timer--; |
| 892 | 946 | } |
| 893 | 947 | else { |
| 894 | pic16 | |
| 948 | pic16c5x_update_timer(cpustate, cpustate->inst_cycles); | |
| 895 | 949 | } |
| 896 | 950 | } |
| 897 | 951 | if (WDTE) { |
| 898 | pic16 | |
| 952 | pic16c5x_update_watchdog(cpustate, cpustate->inst_cycles); | |
| 899 | 953 | } |
| 900 | 954 | } |
| 901 | 955 | |
| r3957 | r3958 | |
| 912 | 966 | * Generic set_info |
| 913 | 967 | **************************************************************************/ |
| 914 | 968 | |
| 915 | static CPU_SET_INFO( pic16 | |
| 969 | static CPU_SET_INFO( pic16c5x ) | |
| 916 | 970 | { |
| 917 | 971 | pic16c5x_state *cpustate = device->token; |
| 918 | 972 | |
| r3957 | r3958 | |
| 946 | 1000 | * Generic get_info |
| 947 | 1001 | **************************************************************************/ |
| 948 | 1002 | |
| 949 | static CPU_GET_INFO( pic16 | |
| 1003 | static CPU_GET_INFO( pic16c5x ) | |
| 950 | 1004 | { |
| 951 | 1005 | pic16c5x_state *cpustate = (device != NULL) ? device->token : NULL; |
| 952 | 1006 | |
| r3957 | r3958 | |
| 964 | 1018 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 965 | 1019 | case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; |
| 966 | 1020 | |
| 967 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 968 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 9; break; | |
| 969 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; | |
| 970 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 971 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 5; break; | |
| 972 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 973 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 974 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 5; break; | |
| 975 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1021 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1022 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 9; break; | |
| 1023 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 1024 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 1025 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 5; break; | |
| 1026 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1027 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1028 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 5; break; | |
| 1029 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 976 | 1030 | |
| 977 | 1031 | case CPUINFO_INT_PREVIOUSPC: info->i = cpustate->PREVPC; break; |
| 978 | 1032 | |
| r3957 | r3958 | |
| 995 | 1049 | case CPUINFO_INT_REGISTER + PIC16C5x_FSR: info->i = (cpustate->FSR & cpustate->picRAMmask); break; |
| 996 | 1050 | |
| 997 | 1051 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 998 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pic16C5x); break; | |
| 999 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(pic16C5x); break; | |
| 1000 | case CPUINFO_PTR_RESET: /* set per-CPU */ break; | |
| 1001 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(pic16C5x); break; | |
| 1002 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(pic16C5x); break; | |
| 1003 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1004 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(pic16C5x); break; | |
| 1052 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pic16c5x); break; | |
| 1053 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(pic16c5x); break; | |
| 1054 | case CPUINFO_FCT_RESET: /* set per-CPU */ break; | |
| 1055 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(pic16c5x); break; | |
| 1056 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(pic16c5x); break; | |
| 1057 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1058 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(pic16c5x); break; | |
| 1005 | 1059 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1006 | 1060 | |
| 1007 | 1061 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1066 | 1120 | * PIC16C54 Reset |
| 1067 | 1121 | ****************************************************************************/ |
| 1068 | 1122 | |
| 1069 | static CPU_RESET( pic16 | |
| 1123 | static CPU_RESET( pic16c54 ) | |
| 1070 | 1124 | { |
| 1071 | 1125 | pic16c5x_state *cpustate = device->token; |
| 1072 | 1126 | |
| 1073 | 1127 | cpustate->picmodel = 0x16C54; |
| 1074 | 1128 | cpustate->picRAMmask = 0x1f; |
| 1075 | 1129 | cpustate->reset_vector = 0x1ff; |
| 1076 | pic16 | |
| 1130 | pic16c5x_reset_regs(cpustate); | |
| 1077 | 1131 | cpustate->STATUS = 0x00; |
| 1078 | 1132 | SET(cpustate, TO_FLAG); |
| 1079 | 1133 | SET(cpustate, PD_FLAG); |
| r3957 | r3958 | |
| 1084 | 1138 | * CPU-specific get_info |
| 1085 | 1139 | **************************************************************************/ |
| 1086 | 1140 | |
| 1087 | CPU_GET_INFO( pic16 | |
| 1141 | CPU_GET_INFO( pic16c54 ) | |
| 1088 | 1142 | { |
| 1089 | 1143 | switch (state) |
| 1090 | 1144 | { |
| 1091 | 1145 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1092 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(pic16C54); break; | |
| 1093 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c54_rom); break; | |
| 1094 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c54_ram); break; | |
| 1146 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c54); break; | |
| 1147 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c54_rom); break; | |
| 1148 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c54_ram); break; | |
| 1095 | 1149 | |
| 1096 | 1150 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1097 | 1151 | case CPUINFO_STR_NAME: strcpy(info->s, "PIC16C54"); break; |
| 1098 | 1152 | |
| 1099 | default: CPU_GET_INFO_CALL(pic16 | |
| 1153 | default: CPU_GET_INFO_CALL(pic16c5x); break; | |
| 1100 | 1154 | } |
| 1101 | 1155 | } |
| 1102 | 1156 | #endif |
| r3957 | r3958 | |
| 1120 | 1174 | * PIC16C55 Reset |
| 1121 | 1175 | ****************************************************************************/ |
| 1122 | 1176 | |
| 1123 | static CPU_RESET( pic16 | |
| 1177 | static CPU_RESET( pic16c55 ) | |
| 1124 | 1178 | { |
| 1125 | 1179 | pic16c5x_state *cpustate = device->token; |
| 1126 | 1180 | |
| 1127 | 1181 | cpustate->picmodel = 0x16C55; |
| 1128 | 1182 | cpustate->picRAMmask = 0x1f; |
| 1129 | 1183 | cpustate->reset_vector = 0x1ff; |
| 1130 | pic16 | |
| 1184 | pic16c5x_reset_regs(cpustate); | |
| 1131 | 1185 | cpustate->STATUS = 0x00; |
| 1132 | 1186 | SET(cpustate, TO_FLAG); |
| 1133 | 1187 | SET(cpustate, PD_FLAG); |
| r3957 | r3958 | |
| 1138 | 1192 | * CPU-specific get_info |
| 1139 | 1193 | **************************************************************************/ |
| 1140 | 1194 | |
| 1141 | CPU_GET_INFO( pic16 | |
| 1195 | CPU_GET_INFO( pic16c55 ) | |
| 1142 | 1196 | { |
| 1143 | 1197 | switch (state) |
| 1144 | 1198 | { |
| 1145 | 1199 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1146 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(pic16C55); break; | |
| 1147 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c55_rom); break; | |
| 1148 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c55_ram); break; | |
| 1200 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c55); break; | |
| 1201 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c55_rom); break; | |
| 1202 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c55_ram); break; | |
| 1149 | 1203 | |
| 1150 | 1204 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1151 | 1205 | case CPUINFO_STR_NAME: strcpy(info->s, "PIC16C55"); break; |
| 1152 | 1206 | |
| 1153 | default: CPU_GET_INFO_CALL(pic16 | |
| 1207 | default: CPU_GET_INFO_CALL(pic16c5x); break; | |
| 1154 | 1208 | } |
| 1155 | 1209 | } |
| 1156 | 1210 | #endif |
| r3957 | r3958 | |
| 1174 | 1228 | * PIC16C56 Reset |
| 1175 | 1229 | ****************************************************************************/ |
| 1176 | 1230 | |
| 1177 | static CPU_RESET( pic16 | |
| 1231 | static CPU_RESET( pic16c56 ) | |
| 1178 | 1232 | { |
| 1179 | 1233 | pic16c5x_state *cpustate = device->token; |
| 1180 | 1234 | |
| 1181 | 1235 | cpustate->picmodel = 0x16C56; |
| 1182 | 1236 | cpustate->picRAMmask = 0x1f; |
| 1183 | 1237 | cpustate->reset_vector = 0x3ff; |
| 1184 | pic16 | |
| 1238 | pic16c5x_reset_regs(cpustate); | |
| 1185 | 1239 | cpustate->STATUS = 0x00; |
| 1186 | 1240 | SET(cpustate, TO_FLAG); |
| 1187 | 1241 | SET(cpustate, PD_FLAG); |
| r3957 | r3958 | |
| 1192 | 1246 | * CPU-specific get_info |
| 1193 | 1247 | **************************************************************************/ |
| 1194 | 1248 | |
| 1195 | CPU_GET_INFO( pic16 | |
| 1249 | CPU_GET_INFO( pic16c56 ) | |
| 1196 | 1250 | { |
| 1197 | 1251 | switch (state) |
| 1198 | 1252 | { |
| 1199 | 1253 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1200 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(pic16C56); break; | |
| 1201 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c56_rom); break; | |
| 1202 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c56_ram); break; | |
| 1254 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c56); break; | |
| 1255 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c56_rom); break; | |
| 1256 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c56_ram); break; | |
| 1203 | 1257 | |
| 1204 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 1258 | case CPUINFO_INT_ADDRBUS_WIDTH | |
| 1205 | 1259 | |
| 1206 | 1260 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1207 | 1261 | case CPUINFO_STR_NAME: strcpy(info->s, "PIC16C56"); break; |
| 1208 | 1262 | |
| 1209 | default: CPU_GET_INFO_CALL(pic16 | |
| 1263 | default: CPU_GET_INFO_CALL(pic16c5x); break; | |
| 1210 | 1264 | } |
| 1211 | 1265 | } |
| 1212 | 1266 | #endif |
| r3957 | r3958 | |
| 1233 | 1287 | * PIC16C57 Reset |
| 1234 | 1288 | ****************************************************************************/ |
| 1235 | 1289 | |
| 1236 | static CPU_RESET( pic16 | |
| 1290 | static CPU_RESET( pic16c57 ) | |
| 1237 | 1291 | { |
| 1238 | 1292 | pic16c5x_state *cpustate = device->token; |
| 1239 | 1293 | |
| 1240 | 1294 | cpustate->picmodel = 0x16C57; |
| 1241 | 1295 | cpustate->picRAMmask = 0x7f; |
| 1242 | 1296 | cpustate->reset_vector = 0x7ff; |
| 1243 | pic16 | |
| 1297 | pic16c5x_reset_regs(cpustate); | |
| 1244 | 1298 | cpustate->STATUS = 0x00; |
| 1245 | 1299 | SET(cpustate, TO_FLAG); |
| 1246 | 1300 | SET(cpustate, PD_FLAG); |
| r3957 | r3958 | |
| 1251 | 1305 | * CPU-specific get_info |
| 1252 | 1306 | **************************************************************************/ |
| 1253 | 1307 | |
| 1254 | CPU_GET_INFO( pic16 | |
| 1308 | CPU_GET_INFO( pic16c57 ) | |
| 1255 | 1309 | { |
| 1256 | 1310 | switch (state) |
| 1257 | 1311 | { |
| 1258 | 1312 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1259 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(pic16C57); break; | |
| 1260 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c57_rom); break; | |
| 1261 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c57_ram); break; | |
| 1313 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c57); break; | |
| 1314 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c57_rom); break; | |
| 1315 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c57_ram); break; | |
| 1262 | 1316 | |
| 1263 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 11; break; | |
| 1264 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 1317 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 1318 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1265 | 1319 | |
| 1266 | 1320 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1267 | 1321 | case CPUINFO_STR_NAME: strcpy(info->s, "PIC16C57"); break; |
| 1268 | 1322 | |
| 1269 | default: CPU_GET_INFO_CALL(pic16 | |
| 1323 | default: CPU_GET_INFO_CALL(pic16c5x); break; | |
| 1270 | 1324 | } |
| 1271 | 1325 | } |
| 1272 | 1326 | #endif |
| r3957 | r3958 | |
| 1293 | 1347 | * PIC16C58 Reset |
| 1294 | 1348 | ****************************************************************************/ |
| 1295 | 1349 | |
| 1296 | static CPU_RESET( pic16 | |
| 1350 | static CPU_RESET( pic16c58 ) | |
| 1297 | 1351 | { |
| 1298 | 1352 | pic16c5x_state *cpustate = device->token; |
| 1299 | 1353 | |
| 1300 | 1354 | cpustate->picmodel = 0x16C58; |
| 1301 | 1355 | cpustate->picRAMmask = 0x7f; |
| 1302 | 1356 | cpustate->reset_vector = 0x7ff; |
| 1303 | pic16 | |
| 1357 | pic16c5x_reset_regs(cpustate); | |
| 1304 | 1358 | cpustate->STATUS = 0x00; |
| 1305 | 1359 | SET(cpustate, TO_FLAG); |
| 1306 | 1360 | SET(cpustate, PD_FLAG); |
| r3957 | r3958 | |
| 1311 | 1365 | * CPU-specific get_info |
| 1312 | 1366 | **************************************************************************/ |
| 1313 | 1367 | |
| 1314 | CPU_GET_INFO( pic16 | |
| 1368 | CPU_GET_INFO( pic16c58 ) | |
| 1315 | 1369 | { |
| 1316 | 1370 | switch (state) |
| 1317 | 1371 | { |
| 1318 | 1372 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1319 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(pic16C58); break; | |
| 1320 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c58_rom); break; | |
| 1321 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c58_ram); break; | |
| 1373 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c58); break; | |
| 1374 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c58_rom); break; | |
| 1375 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c58_ram); break; | |
| 1322 | 1376 | |
| 1323 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 11; break; | |
| 1324 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 7; break; | |
| 1377 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 1378 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1325 | 1379 | |
| 1326 | 1380 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1327 | 1381 | case CPUINFO_STR_NAME: strcpy(info->s, "PIC16C58"); break; |
| 1328 | 1382 | |
| 1329 | default: CPU_GET_INFO_CALL(pic16 | |
| 1383 | default: CPU_GET_INFO_CALL(pic16c5x); break; | |
| 1330 | 1384 | } |
| 1331 | 1385 | } |
| 1332 | 1386 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | PIC16C5x_PSCL |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | #define PIC16C5x_T0 0x10 | |
| 38 | 39 | |
| 40 | ||
| 39 | 41 | /**************************************************************************** |
| 40 | 42 | * Function to configure the CONFIG register. This is actually hard-wired |
| 41 | 43 | * during ROM programming, so should be called in the driver INIT, with |
| r3957 | r3958 | |
| 45 | 47 | void pic16c5x_set_config(const device_config *cpu, int data); |
| 46 | 48 | |
| 47 | 49 | |
| 48 | /**************************************************************************** | |
| 49 | * Read the state of the T0 Clock input signal | |
| 50 | */ | |
| 51 | 50 | |
| 52 | #define PIC16C5x_T0 0x10 | |
| 53 | #define PIC16C5x_T0_In (memory_read_byte_8le(cpustate->io, PIC16C5x_T0)) | |
| 54 | ||
| 55 | ||
| 56 | /**************************************************************************** | |
| 57 | * Input a word from given I/O port | |
| 58 | */ | |
| 59 | ||
| 60 | #define PIC16C5x_In(Port) ((UINT8)memory_read_byte_8le(cpustate->io, (Port))) | |
| 61 | ||
| 62 | ||
| 63 | /**************************************************************************** | |
| 64 | * Output a word to given I/O port | |
| 65 | */ | |
| 66 | ||
| 67 | #define PIC16C5x_Out(Port,Value) (memory_write_byte_8le(cpustate->io, (Port),Value)) | |
| 68 | ||
| 69 | ||
| 70 | ||
| 71 | /**************************************************************************** | |
| 72 | * Read a word from given RAM memory location | |
| 73 | */ | |
| 74 | ||
| 75 | #define PIC16C5x_RAM_RDMEM(A) ((UINT8)memory_read_byte_8le(cpustate->data, A)) | |
| 76 | ||
| 77 | ||
| 78 | /**************************************************************************** | |
| 79 | * Write a word to given RAM memory location | |
| 80 | */ | |
| 81 | ||
| 82 | #define PIC16C5x_RAM_WRMEM(A,V) (memory_write_byte_8le(cpustate->data, A,V)) | |
| 83 | ||
| 84 | ||
| 85 | ||
| 86 | /**************************************************************************** | |
| 87 | * PIC16C5X_RDOP() is identical to PIC16C5X_RDMEM() except it is used for | |
| 88 | * reading opcodes. In case of system with memory mapped I/O, this function | |
| 89 | * can be used to greatly speed up emulation | |
| 90 | */ | |
| 91 | ||
| 92 | #define PIC16C5x_RDOP(A) (memory_decrypted_read_word(cpustate->program, (A)<<1)) | |
| 93 | ||
| 94 | ||
| 95 | /**************************************************************************** | |
| 96 | * PIC16C5X_RDOP_ARG() is identical to PIC16C5X_RDOP() except it is used | |
| 97 | * for reading opcode arguments. This difference can be used to support systems | |
| 98 | * that use different encoding mechanisms for opcodes and opcode arguments | |
| 99 | */ | |
| 100 | ||
| 101 | #define PIC16C5x_RDOP_ARG(A) (memory_raw_read_word(cpustate->program, (A)<<1)) | |
| 102 | ||
| 103 | ||
| 104 | ||
| 105 | ||
| 106 | 51 | #if (HAS_PIC16C54) |
| 107 | CPU_GET_INFO( pic16C54 ); | |
| 52 | CPU_GET_INFO( pic16c54 ); | |
| 53 | #define CPU_PIC16C54 CPU_GET_INFO_NAME( pic16c54 ) | |
| 108 | 54 | #endif |
| 109 | 55 | |
| 110 | 56 | |
| 111 | 57 | #if (HAS_PIC16C55) |
| 112 | CPU_GET_INFO( pic16C55 ); | |
| 58 | CPU_GET_INFO( pic16c55 ); | |
| 59 | #define CPU_PIC16C55 CPU_GET_INFO_NAME( pic16c55 ) | |
| 113 | 60 | #endif |
| 114 | 61 | |
| 115 | 62 | |
| 116 | 63 | #if (HAS_PIC16C56) |
| 117 | CPU_GET_INFO( pic16C56 ); | |
| 64 | CPU_GET_INFO( pic16c56 ); | |
| 65 | #define CPU_PIC16C56 CPU_GET_INFO_NAME( pic16c56 ) | |
| 118 | 66 | #endif |
| 119 | 67 | |
| 120 | 68 | |
| 121 | 69 | #if (HAS_PIC16C57) |
| 122 | CPU_GET_INFO( pic16C57 ); | |
| 70 | CPU_GET_INFO( pic16c57 ); | |
| 71 | #define CPU_PIC16C57 CPU_GET_INFO_NAME( pic16c57 ) | |
| 123 | 72 | #endif |
| 124 | 73 | |
| 125 | 74 | |
| 126 | 75 | #if (HAS_PIC16C58) |
| 127 | CPU_GET_INFO( pic16C58 ); | |
| 76 | CPU_GET_INFO( pic16c58 ); | |
| 77 | #define CPU_PIC16C58 CPU_GET_INFO_NAME( pic16c58 ) | |
| 128 | 78 | #endif |
| 129 | 79 | |
| 130 | 80 | |
| 131 | 81 | #if (HAS_PIC16C54) || (HAS_PIC16C55) || (HAS_PIC16C56) || (HAS_PIC16C57) || (HAS_PIC16C58) |
| 132 | CPU_DISASSEMBLE( pic16 | |
| 82 | CPU_DISASSEMBLE( pic16c5x ); | |
| 133 | 83 | #endif |
| 134 | 84 | |
| 135 | 85 |
| r3957 | r3958 | |
|---|---|---|
| 151 | 151 | OpInizialized = 1; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | CPU_DISASSEMBLE( pic16 | |
| 154 | CPU_DISASSEMBLE( pic16c5x ) | |
| 155 | 155 | { |
| 156 | 156 | int a, b, d, f, k; /* these can all be filled in by parsing an instruction */ |
| 157 | 157 | int i; |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | CPU_GET_INFO( tx0_64kw ); |
| 48 | 48 | CPU_GET_INFO( tx0_8kw ); |
| 49 | 49 | |
| 50 | #define CPU_TX0_64KW CPU_GET_INFO_NAME( tx0_64kw ) | |
| 51 | #define CPU_TX0_8KW CPU_GET_INFO_NAME( tx0_8kw ) | |
| 52 | ||
| 50 | 53 | CPU_DISASSEMBLE( tx0_64kw ); |
| 51 | 54 | CPU_DISASSEMBLE( tx0_8kw ); |
| 52 | 55 |
| r3957 | r3958 | |
|---|---|---|
| 943 | 943 | case CPUINFO_INT_MIN_CYCLES: info->i = 5; /* 5us cycle time */ break; |
| 944 | 944 | case CPUINFO_INT_MAX_CYCLES: info->i = 31; /* we emulate individual 5us cycle, but MUL/DIV have longer timings */ break; |
| 945 | 945 | |
| 946 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 947 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 18; /*16+2 ignored bits to make double word address*/ break; | |
| 948 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 949 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 950 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 951 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 952 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 953 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 954 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 946 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 947 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 18; /*16+2 ignored bits to make double word address*/ break; | |
| 948 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 949 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 950 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 951 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 952 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 953 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 954 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 955 | 955 | |
| 956 | 956 | case CPUINFO_INT_SP: info->i = 0; /* no SP */ break; |
| 957 | 957 | case CPUINFO_INT_PC: info->i = PC; break; |
| r3957 | r3958 | |
| 1012 | 1012 | case CPUINFO_INT_REGISTER + PDP1_IOS: info->i = cpustate->ios; break; |
| 1013 | 1013 | |
| 1014 | 1014 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1015 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pdp1); break; | |
| 1016 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(pdp1); break; | |
| 1017 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(pdp1); break; | |
| 1018 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(pdp1); break; | |
| 1019 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1015 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pdp1); break; | |
| 1016 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(pdp1); break; | |
| 1017 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pdp1); break; | |
| 1018 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(pdp1); break; | |
| 1019 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1020 | 1020 | |
| 1021 | case CPUINFO_ | |
| 1021 | case CPUINFO_FCT | |
| 1022 | 1022 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1023 | 1023 | |
| 1024 | 1024 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | /* PUBLIC FUNCTIONS */ |
| 52 | 52 | CPU_GET_INFO( pdp1 ); |
| 53 | #define CPU_PDP1 CPU_GET_INFO_NAME( pdp1 ) | |
| 53 | 54 | |
| 54 | 55 | #define AND 001 |
| 55 | 56 | #define IOR 002 |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | ; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | static void tx0_init_common(int is_64kw, const device_config *device, | |
| 121 | static void tx0_init_common(int is_64kw, const device_config *device, | |
| 122 | 122 | { |
| 123 | 123 | tx0_state *cpustate = device->token; |
| 124 | 124 | |
| r3957 | r3958 | |
| 134 | 134 | |
| 135 | 135 | static CPU_INIT( tx0_64kw ) |
| 136 | 136 | { |
| 137 | tx0_init_common(1, device, i | |
| 137 | tx0_init_common(1, device, i | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | static CPU_INIT( tx0_8kw) |
| 141 | 141 | { |
| 142 | tx0_init_common(0, device, i | |
| 142 | tx0_init_common(0, device, i | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | static CPU_RESET( tx0 ) |
| r3957 | r3958 | |
| 442 | 442 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 443 | 443 | case CPUINFO_INT_MAX_CYCLES: info->i = 3; break; |
| 444 | 444 | |
| 445 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 446 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 447 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -2; break; | |
| 448 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 449 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 450 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 451 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 452 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 453 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 445 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 446 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 447 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -2; break; | |
| 448 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 449 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 450 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 451 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 452 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 453 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 454 | 454 | |
| 455 | 455 | case CPUINFO_INT_SP: info->i = 0; /* no SP */ break; |
| 456 | 456 | case CPUINFO_INT_PC: info->i = PC; break; |
| r3957 | r3958 | |
| 494 | 494 | case CPUINFO_INT_REGISTER + TX0_IOS: info->i = cpustate->ios; break; |
| 495 | 495 | |
| 496 | 496 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 497 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tx0); break; | |
| 498 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tx0_64kw); break; | |
| 499 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tx0); break; | |
| 500 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tx0_64kw); break; | |
| 501 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 502 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tx0_64kw); break; | |
| 497 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tx0); break; | |
| 498 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tx0_64kw); break; | |
| 499 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tx0); break; | |
| 500 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tx0_64kw); break; | |
| 501 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 502 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tx0_64kw); break; | |
| 503 | 503 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 504 | 504 | |
| 505 | 505 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 568 | 568 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 569 | 569 | case CPUINFO_INT_MAX_CYCLES: info->i = 3; break; |
| 570 | 570 | |
| 571 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 572 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 13; break; | |
| 573 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -2; break; | |
| 574 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 575 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 576 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 577 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 578 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 579 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 571 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 572 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 13; break; | |
| 573 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -2; break; | |
| 574 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 575 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 576 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 577 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 578 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 579 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 580 | 580 | |
| 581 | 581 | case CPUINFO_INT_SP: info->i = 0; /* no SP */ break; |
| 582 | 582 | case CPUINFO_INT_PC: info->i = PC; break; |
| r3957 | r3958 | |
| 620 | 620 | case CPUINFO_INT_REGISTER + TX0_IOS: info->i = cpustate->ios; break; |
| 621 | 621 | |
| 622 | 622 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 623 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tx0); break; | |
| 624 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(tx0_8kw); break; | |
| 625 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(tx0); break; | |
| 626 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(tx0_8kw); break; | |
| 627 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 628 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tx0_8kw); break; | |
| 623 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(tx0); break; | |
| 624 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(tx0_8kw); break; | |
| 625 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(tx0); break; | |
| 626 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(tx0_8kw); break; | |
| 627 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 628 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(tx0_8kw); break; | |
| 629 | 629 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 630 | 630 | |
| 631 | 631 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 97 | 97 | { |
| 98 | 98 | mb86233_state *cpustate = device->token; |
| 99 | 99 | mb86233_cpu_core * _config = (mb86233_cpu_core *)device->static_config; |
| 100 | (void)index; | |
| 101 | (void)clock; | |
| 102 | 100 | (void)irqcallback; |
| 103 | 101 | |
| 104 | 102 | memset(cpustate, 0, sizeof( *cpustate ) ); |
| r3957 | r3958 | |
| 1646 | 1644 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1647 | 1645 | case CPUINFO_INT_MAX_CYCLES: info->i = 2; break; |
| 1648 | 1646 | |
| 1649 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1650 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 1651 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -2; break; | |
| 1652 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 32; break; | |
| 1653 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 32; break; | |
| 1654 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1655 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1656 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1657 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1647 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1648 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 1649 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -2; break; | |
| 1650 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 32; break; | |
| 1651 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 32; break; | |
| 1652 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1653 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 1654 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 1655 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1658 | 1656 | |
| 1659 | 1657 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ break; |
| 1660 | 1658 | |
| r3957 | r3958 | |
| 1688 | 1686 | case CPUINFO_INT_REGISTER + MB86233_R15: info->i = GETGPR(15); break; |
| 1689 | 1687 | |
| 1690 | 1688 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1691 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mb86233); break; | |
| 1692 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(mb86233); break; | |
| 1693 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(mb86233); break; | |
| 1694 | case CPUINFO_PTR_EXIT: info->exit = NULL; break; | |
| 1695 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(mb86233); break; | |
| 1696 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1697 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mb86233); break; | |
| 1689 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mb86233); break; | |
| 1690 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(mb86233); break; | |
| 1691 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(mb86233); break; | |
| 1692 | case CPUINFO_FCT_EXIT: info->exit = NULL; break; | |
| 1693 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(mb86233); break; | |
| 1694 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1695 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(mb86233); break; | |
| 1698 | 1696 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1699 | 1697 | |
| 1700 | 1698 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | }; |
| 56 | 56 | |
| 57 | 57 | extern CPU_GET_INFO( mb86233 ); |
| 58 | #define CPU_MB86233 CPU_GET_INFO_NAME( mb86233 ) | |
| 58 | 59 | |
| 59 | 60 | #endif /* __MB86233_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | #define PSW psw.b.l |
| 58 | 58 | |
| 59 | 59 | |
| 60 | ||
| 61 | 60 | /************************************* |
| 62 | 61 | * |
| 63 | 62 | * Low-level memory operations |
| r3957 | r3958 | |
| 74 | 73 | |
| 75 | 74 | INLINE int RBYTE(t11_state *cpustate, int addr) |
| 76 | 75 | { |
| 77 | return | |
| 76 | return memory_read_byte_16le(cpustate->program, addr); | |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | |
| 81 | 80 | INLINE void WBYTE(t11_state *cpustate, int addr, int data) |
| 82 | 81 | { |
| 83 | | |
| 82 | memory_write_byte_16le(cpustate->program, addr, data); | |
| 84 | 83 | } |
| 85 | 84 | |
| 86 | 85 | |
| 87 | 86 | INLINE int RWORD(t11_state *cpustate, int addr) |
| 88 | 87 | { |
| 89 | return | |
| 88 | return memory_read | |
| 90 | 89 | } |
| 91 | 90 | |
| 92 | 91 | |
| 93 | 92 | INLINE void WWORD(t11_state *cpustate, int addr, int data) |
| 94 | 93 | { |
| 95 | | |
| 94 | memory_write_word_16le(cpustate->program, addr & 0xfffe, data); | |
| 96 | 95 | } |
| 97 | 96 | |
| 98 | 97 | |
| r3957 | r3958 | |
| 419 | 418 | case CPUINFO_INT_MIN_CYCLES: info->i = 12; break; |
| 420 | 419 | case CPUINFO_INT_MAX_CYCLES: info->i = 110; break; |
| 421 | 420 | |
| 422 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 423 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 424 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 425 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 426 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 427 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 428 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 429 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 430 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 421 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 422 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 423 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 424 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 425 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 426 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 427 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 428 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 429 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 431 | 430 | |
| 432 | 431 | case CPUINFO_INT_INPUT_STATE + T11_IRQ0: info->i = (cpustate->irq_state & 1) ? ASSERT_LINE : CLEAR_LINE; break; |
| 433 | 432 | case CPUINFO_INT_INPUT_STATE + T11_IRQ1: info->i = (cpustate->irq_state & 2) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 449 | 448 | case CPUINFO_INT_REGISTER + T11_R5: info->i = cpustate->REGD(5); break; |
| 450 | 449 | |
| 451 | 450 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 452 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(t11); break; | |
| 453 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(t11); break; | |
| 454 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(t11); break; | |
| 455 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(t11); break; | |
| 456 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(t11); break; | |
| 451 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(t11); break; | |
| 452 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(t11); break; | |
| 453 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(t11); break; | |
| 454 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(t11); break; | |
| 455 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(t11); break; | |
| 457 | 456 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 458 | 457 | |
| 459 | 458 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | extern CPU_GET_INFO( t11 ); |
| 37 | #define CPU_T11 CPU_GET_INFO_NAME( t11 ) | |
| 37 | 38 | |
| 38 | /****************************************************************************/ | |
| 39 | /* Read a byte from given memory location */ | |
| 40 | /****************************************************************************/ | |
| 41 | #define T11_RDMEM(T,A) ((unsigned)memory_read_byte_16le((T)->program, A)) | |
| 42 | #define T11_RDMEM_WORD(T,A) ((unsigned)memory_read_word_16le((T)->program, A)) | |
| 43 | ||
| 44 | /****************************************************************************/ | |
| 45 | /* Write a byte to given memory location */ | |
| 46 | /****************************************************************************/ | |
| 47 | #define T11_WRMEM(T,A,V) (memory_write_byte_16le((T)->program, A,V)) | |
| 48 | #define T11_WRMEM_WORD(T,A,V) (memory_write_word_16le((T)->program, A,V)) | |
| 49 | ||
| 50 | 39 | CPU_DISASSEMBLE( t11 ); |
| 51 | 40 | |
| 52 | 41 | #endif /* __T11_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 232 | 232 | case CPUINFO_INT_MIN_CYCLES: info->i = 3; break; |
| 233 | 233 | case CPUINFO_INT_MAX_CYCLES: info->i = 4; break; |
| 234 | 234 | |
| 235 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 236 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; | |
| 237 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 238 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 239 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 240 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 241 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 242 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 243 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 235 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 236 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32; break; | |
| 237 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 238 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 239 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 240 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 241 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 242 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 243 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 244 | 244 | |
| 245 | 245 | /* interrupt lines/exceptions */ |
| 246 | 246 | case CPUINFO_INT_INPUT_STATE + ARM7_IRQ_LINE: info->i = cpustate->pendingIrq; break; |
| r3957 | r3958 | |
| 303 | 303 | case CPUINFO_INT_REGISTER + ARM7_USPSR: info->i = ARM7REG(eSPSR_UND); break; |
| 304 | 304 | |
| 305 | 305 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 306 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(arm7); break; | |
| 307 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(arm7); break; | |
| 308 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(arm7); break; | |
| 309 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(arm7); break; | |
| 310 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(arm7); break; | |
| 311 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 312 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(arm7); break; | |
| 306 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(arm7); break; | |
| 307 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(arm7); break; | |
| 308 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(arm7); break; | |
| 309 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(arm7); break; | |
| 310 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(arm7); break; | |
| 311 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 312 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(arm7); break; | |
| 313 | 313 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &ARM7_ICOUNT; break; |
| 314 | 314 | |
| 315 | 315 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | * PUBLIC FUNCTIONS |
| 40 | 40 | ***************************************************************************************************/ |
| 41 | 41 | extern CPU_GET_INFO( arm7 ); |
| 42 | #define CPU_ARM7 CPU_GET_INFO_NAME( arm7 ) | |
| 42 | 43 | |
| 43 | 44 | #endif /* __ARM7_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 91 | 91 | #include "debugger.h" |
| 92 | 92 | #include "x86emit.h" |
| 93 | 93 | #include "eminline.h" |
| 94 | #undef REG_SP | |
| 95 | 94 | #include "x86log.h" |
| 96 | 95 | #include <math.h> |
| 97 | 96 | #include <stddef.h> |
| r3957 | r3958 | |
|---|---|---|
| 435 | 435 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 436 | 436 | case CPUINFO_INT_MAX_CYCLES: info->i = 17 + 6*65536; break; |
| 437 | 437 | |
| 438 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 439 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 21; break; | |
| 440 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 441 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 442 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 443 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 444 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 445 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 446 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 2; break; | |
| 447 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 438 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 439 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 21; break; | |
| 440 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 441 | case CPUINFO_INT_LOGADDR_WIDTH_PROGRAM: info->i = 16; break; | |
| 442 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 443 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 444 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 445 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 446 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 2; break; | |
| 447 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 448 | 448 | |
| 449 | 449 | case CPUINFO_INT_INPUT_STATE + 0: info->i = cpustate->irq_state[0]; break; |
| 450 | 450 | case CPUINFO_INT_INPUT_STATE + 1: info->i = cpustate->irq_state[1]; break; |
| r3957 | r3958 | |
| 477 | 477 | case CPUINFO_INT_REGISTER + H6280_M8: info->i = cpustate->mmr[7]; break; |
| 478 | 478 | |
| 479 | 479 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 480 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(h6280); break; | |
| 481 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(h6280); break; | |
| 482 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(h6280); break; | |
| 483 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(h6280); break; | |
| 484 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(h6280); break; | |
| 485 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 486 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h6280);break; | |
| 480 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(h6280); break; | |
| 481 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(h6280); break; | |
| 482 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(h6280); break; | |
| 483 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(h6280); break; | |
| 484 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(h6280); break; | |
| 485 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 486 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(h6280);break; | |
| 487 | 487 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->ICount; break; |
| 488 | case CPUINFO_ | |
| 488 | case CPUINFO_FCT | |
| 489 | 489 | |
| 490 | 490 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 491 | 491 | case CPUINFO_STR_NAME: strcpy(info->s, "HuC6280"); break; |
| r3957 | r3958 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | CPU_GET_INFO( h6280 ); |
| 78 | #define CPU_H6280 CPU_GET_INFO_NAME( h6280 ) | |
| 78 | 79 | |
| 79 | 80 | READ8_HANDLER( h6280_irq_status_r ); |
| 80 | 81 | WRITE8_HANDLER( h6280_irq_status_w ); |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | #endif |
| 47 | 47 | |
| 48 | 48 | CPU_GET_INFO( m6800 ); |
| 49 | #define CPU_M6800 CPU_GET_INFO_NAME( m6800 ) | |
| 49 | 50 | |
| 50 | 51 | #if (HAS_M6801) |
| 51 | 52 | CPU_GET_INFO( m6801 ); |
| 53 | #define CPU_M6801 CPU_GET_INFO_NAME( m6801 ) | |
| 52 | 54 | #endif |
| 53 | 55 | |
| 54 | 56 | #if (HAS_M6802) |
| 55 | 57 | CPU_GET_INFO( m6802 ); |
| 58 | #define CPU_M6802 CPU_GET_INFO_NAME( m6802 ) | |
| 56 | 59 | #endif |
| 57 | 60 | |
| 58 | 61 | #if (HAS_M6803) |
| 59 | 62 | CPU_GET_INFO( m6803 ); |
| 63 | #define CPU_M6803 CPU_GET_INFO_NAME( m6803 ) | |
| 60 | 64 | #endif |
| 61 | 65 | |
| 62 | 66 | #if (HAS_M6808) |
| 63 | 67 | CPU_GET_INFO( m6808 ); |
| 68 | #define CPU_M6808 CPU_GET_INFO_NAME( m6808 ) | |
| 64 | 69 | #endif |
| 65 | 70 | |
| 66 | 71 | #if (HAS_HD63701) |
| 67 | 72 | CPU_GET_INFO( hd63701 ); |
| 73 | #define CPU_HD63701 CPU_GET_INFO_NAME( hd63701 ) | |
| 68 | 74 | |
| 69 | 75 | /* FIMXE: these should be replaced to use m6803 ones */ |
| 70 | 76 | #define HD63701_DDR1 M6803_DDR1 |
| r3957 | r3958 | |
| 84 | 90 | |
| 85 | 91 | #if (HAS_NSC8105) |
| 86 | 92 | CPU_GET_INFO( nsc8105 ); |
| 93 | #define CPU_NSC8105 CPU_GET_INFO_NAME( nsc8105 ) | |
| 87 | 94 | #endif |
| 88 | 95 | |
| 89 | 96 | |
| r3957 | r3958 | |
| 252 | 259 | extern CPU_GET_INFO( nsc8105 ); |
| 253 | 260 | #endif |
| 254 | 261 | |
| 255 | ||
| 256 | 262 | #endif |
| 257 | 263 | #endif /* __M6800_H__ */ |
| 264 |
| r3957 | r3958 | |
|---|---|---|
| 1287 | 1287 | cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA); |
| 1288 | 1288 | cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO); |
| 1289 | 1289 | |
| 1290 | cpustate->clock = clock; | |
| 1290 | cpustate->clock = device->clock / 4; | |
| 1291 | 1291 | cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate); |
| 1292 | 1292 | cpustate->m6800_tx_timer = timer_alloc(device->machine, m6800_tx_tick, cpustate); |
| 1293 | 1293 | |
| r3957 | r3958 | |
| 1333 | 1333 | cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA); |
| 1334 | 1334 | cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO); |
| 1335 | 1335 | |
| 1336 | cpustate->clock = clock; | |
| 1336 | cpustate->clock = device->clock / 4; | |
| 1337 | 1337 | cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate); |
| 1338 | 1338 | cpustate->m6800_tx_timer = timer_alloc(device->machine, m6800_tx_tick, cpustate); |
| 1339 | 1339 | |
| r3957 | r3958 | |
| 1695 | 1695 | cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA); |
| 1696 | 1696 | cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO); |
| 1697 | 1697 | |
| 1698 | cpustate->clock = clock; | |
| 1698 | cpustate->clock = device->clock / 4; | |
| 1699 | 1699 | cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate); |
| 1700 | 1700 | cpustate->m6800_tx_timer = timer_alloc(device->machine, m6800_tx_tick, cpustate); |
| 1701 | 1701 | |
| r3957 | r3958 | |
| 2693 | 2693 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2694 | 2694 | case CPUINFO_INT_MAX_CYCLES: info->i = 12; break; |
| 2695 | 2695 | |
| 2696 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 2697 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 2698 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 2699 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2700 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2701 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 2702 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 2703 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2704 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 2696 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 2697 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 2698 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 2699 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 2700 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 2701 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 2702 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 9; break; | |
| 2703 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 2704 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 2705 | 2705 | |
| 2706 | 2706 | case CPUINFO_INT_INPUT_STATE + M6800_IRQ_LINE: info->i = cpustate->irq_state[M6800_IRQ_LINE]; break; |
| 2707 | 2707 | case CPUINFO_INT_INPUT_STATE + M6800_TIN_LINE: info->i = cpustate->irq_state[M6800_TIN_LINE]; break; |
| r3957 | r3958 | |
| 2720 | 2720 | case CPUINFO_INT_REGISTER + M6800_WAI_STATE: info->i = cpustate->wai_state; break; |
| 2721 | 2721 | |
| 2722 | 2722 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2723 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6800); break; | |
| 2724 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6800); break; | |
| 2725 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(m6800); break; | |
| 2726 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(m6800); break; | |
| 2727 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6800); break; | |
| 2728 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 2729 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6800); break; | |
| 2723 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(m6800); break; | |
| 2724 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6800); break; | |
| 2725 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(m6800); break; | |
| 2726 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(m6800); break; | |
| 2727 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6800); break; | |
| 2728 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 2729 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6800); break; | |
| 2730 | 2730 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 2731 | 2731 | |
| 2732 | 2732 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 2770 | 2770 | { |
| 2771 | 2771 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2772 | 2772 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; |
| 2773 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2774 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 2773 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2774 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 2775 | 2775 | |
| 2776 | 2776 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2777 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6801); break; | |
| 2778 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6803); break; | |
| 2779 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6801); break; | |
| 2777 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6801); break; | |
| 2778 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6803); break; | |
| 2779 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6801); break; | |
| 2780 | 2780 | |
| 2781 | 2781 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2782 | 2782 | case CPUINFO_STR_NAME: strcpy(info->s, "M6801"); break; |
| r3957 | r3958 | |
| 2800 | 2800 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; |
| 2801 | 2801 | |
| 2802 | 2802 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2803 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6802); break; | |
| 2804 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6802); break; | |
| 2803 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6802); break; | |
| 2804 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6802); break; | |
| 2805 | 2805 | |
| 2806 | 2806 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2807 | 2807 | case CPUINFO_STR_NAME: strcpy(info->s, "M6802"); break; |
| r3957 | r3958 | |
| 2823 | 2823 | { |
| 2824 | 2824 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2825 | 2825 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; |
| 2826 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2827 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 2826 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2827 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 2828 | 2828 | |
| 2829 | 2829 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2830 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6803); break; | |
| 2831 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6803); break; | |
| 2832 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6803); break; | |
| 2830 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6803); break; | |
| 2831 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(m6803); break; | |
| 2832 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6803); break; | |
| 2833 | 2833 | |
| 2834 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2834 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP | |
| 2835 | 2835 | |
| 2836 | 2836 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2837 | 2837 | case CPUINFO_STR_NAME: strcpy(info->s, "M6803"); break; |
| r3957 | r3958 | |
| 2855 | 2855 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; |
| 2856 | 2856 | |
| 2857 | 2857 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2858 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(m6808); break; | |
| 2859 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6808); break; | |
| 2858 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(m6808); break; | |
| 2859 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(m6808); break; | |
| 2860 | 2860 | |
| 2861 | 2861 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2862 | 2862 | case CPUINFO_STR_NAME: strcpy(info->s, "M6808"); break; |
| r3957 | r3958 | |
| 2878 | 2878 | { |
| 2879 | 2879 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2880 | 2880 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; |
| 2881 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 2882 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; | |
| 2881 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 2882 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 9; break; | |
| 2883 | 2883 | |
| 2884 | 2884 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2885 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(hd63701); break; | |
| 2886 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(hd63701); break; | |
| 2887 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hd63701); break; | |
| 2885 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(hd63701); break; | |
| 2886 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(hd63701); break; | |
| 2887 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hd63701); break; | |
| 2888 | 2888 | |
| 2889 | 2889 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2890 | 2890 | case CPUINFO_STR_NAME: strcpy(info->s, "HD63701"); break; |
| r3957 | r3958 | |
| 2908 | 2908 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; |
| 2909 | 2909 | |
| 2910 | 2910 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2911 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(nsc8105); break; | |
| 2912 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(nsc8105); break; | |
| 2913 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(nsc8105); break; | |
| 2911 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(nsc8105); break; | |
| 2912 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(nsc8105); break; | |
| 2913 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(nsc8105); break; | |
| 2914 | 2914 | |
| 2915 | 2915 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2916 | 2916 | case CPUINFO_STR_NAME: strcpy(info->s, "NSC8105"); break; |
| r3957 | r3958 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | CPU_GET_INFO( cp1610 ); |
| 40 | #define CPU_CP1610 CPU_GET_INFO_NAME( cp1610 ) | |
| 40 | 41 | |
| 41 | 42 | CPU_DISASSEMBLE( cp1610 ); |
| 42 | 43 |
| r3957 | r3958 | |
|---|---|---|
| 3454 | 3454 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 3455 | 3455 | case CPUINFO_INT_MAX_CYCLES: info->i = 7; break; |
| 3456 | 3456 | |
| 3457 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 3458 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 3459 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -1; break; | |
| 3460 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3461 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3462 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 3463 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3464 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3465 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 3457 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 3458 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 3459 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 3460 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 3461 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 3462 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 3463 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 3464 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 3465 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 3466 | 3466 | |
| 3467 | 3467 | case CPUINFO_INT_PREVIOUSPC: info->i = 0; /* TODO??? */ break; |
| 3468 | 3468 | |
| r3957 | r3958 | |
| 3482 | 3482 | case CPUINFO_INT_REGISTER + CP1610_R7: info->i = cpustate->r[7]; break; |
| 3483 | 3483 | |
| 3484 | 3484 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3485 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cp1610); break; | |
| 3486 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(cp1610); break; | |
| 3487 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(cp1610); break; | |
| 3488 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(cp1610); break; | |
| 3489 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 3485 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(cp1610); break; | |
| 3486 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cp1610); break; | |
| 3487 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cp1610); break; | |
| 3488 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cp1610); break; | |
| 3489 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 3490 | 3490 | |
| 3491 | case CPUINFO_ | |
| 3491 | case CPUINFO_FCT | |
| 3492 | 3492 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 3493 | 3493 | |
| 3494 | 3494 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 89 | 89 | CPU_DISASSEMBLE( saturn ); |
| 90 | 90 | |
| 91 | 91 | CPU_GET_INFO( saturn ); |
| 92 | #define CPU_SATURN CPU_GET_INFO_NAME( saturn ) | |
| 92 | 93 | |
| 93 | 94 | #endif /* __SATURN_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 311 | 311 | case CPUINFO_INT_MIN_CYCLES: info->i = 2; break; |
| 312 | 312 | case CPUINFO_INT_MAX_CYCLES: info->i = 21; break; |
| 313 | 313 | |
| 314 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 315 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; | |
| 316 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 317 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 318 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 319 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 320 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 321 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 322 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 314 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 315 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20; break; | |
| 316 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 317 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 318 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 319 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 320 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 321 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 322 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 323 | 323 | |
| 324 | 324 | case CPUINFO_INT_INPUT_STATE + SATURN_NMI_LINE: info->i = cpustate->nmi_state; break; |
| 325 | 325 | case CPUINFO_INT_INPUT_STATE + SATURN_IRQ_LINE: info->i = cpustate->irq_state; break; |
| r3957 | r3958 | |
| 357 | 357 | case CPUINFO_INT_REGISTER + SATURN_SLEEPING: info->i = cpustate->sleeping; |
| 358 | 358 | |
| 359 | 359 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 360 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(saturn); break; | |
| 361 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(saturn); break; | |
| 362 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(saturn); break; | |
| 363 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(saturn); break; | |
| 364 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 365 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(saturn); break; | |
| 360 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(saturn); break; | |
| 361 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(saturn); break; | |
| 362 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(saturn); break; | |
| 363 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(saturn); break; | |
| 364 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 365 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(saturn); break; | |
| 366 | 366 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 367 | 367 | |
| 368 | 368 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
|---|---|---|
| 89 | 89 | extern CPU_GET_INFO( i8242 ); |
| 90 | 90 | extern CPU_GET_INFO( i8742 ); |
| 91 | 91 | |
| 92 | #define CPU_I8041 CPU_GET_INFO_NAME( i8041 ) | |
| 93 | #define CPU_I8741 CPU_GET_INFO_NAME( i8741 ) | |
| 94 | #define CPU_I8042 CPU_GET_INFO_NAME( i8042 ) | |
| 95 | #define CPU_I8242 CPU_GET_INFO_NAME( i8242 ) | |
| 96 | #define CPU_I8742 CPU_GET_INFO_NAME( i8742 ) | |
| 97 | ||
| 92 | 98 | extern CPU_DISASSEMBLE( i8x41 ); |
| 93 | 99 | |
| 94 | 100 | #endif /* __I8X41_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 1193 | 1193 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1194 | 1194 | case CPUINFO_INT_MAX_CYCLES: info->i = 2; break; |
| 1195 | 1195 | |
| 1196 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 1197 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 1198 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 1199 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 1200 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 8; break; | |
| 1201 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 1202 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; | |
| 1203 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; | |
| 1204 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 1196 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 1197 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1198 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 1199 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 1200 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 8; break; | |
| 1201 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1202 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1203 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 16; break; | |
| 1204 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1205 | 1205 | |
| 1206 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1207 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1206 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break; | |
| 1207 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break; | |
| 1208 | 1208 | |
| 1209 | 1209 | case CPUINFO_INT_INPUT_STATE + I8X41_INT_IBF: info->i = (STATE & IBF) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1210 | 1210 | case CPUINFO_INT_INPUT_STATE + I8X41_INT_TEST1: info->i = (STATE & TEST1) ? ASSERT_LINE : CLEAR_LINE; break; |
| r3957 | r3958 | |
| 1253 | 1253 | break; |
| 1254 | 1254 | |
| 1255 | 1255 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1256 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i8x41); break; | |
| 1257 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8x41); break; | |
| 1258 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(i8x41); break; | |
| 1259 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(i8x41); break; | |
| 1260 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(i8x41); break; | |
| 1261 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1262 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8x41); break; | |
| 1256 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i8x41); break; | |
| 1257 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8x41); break; | |
| 1258 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(i8x41); break; | |
| 1259 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(i8x41); break; | |
| 1260 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i8x41); break; | |
| 1261 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 1262 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(i8x41); break; | |
| 1263 | 1263 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &upi41_state->icount ; break; |
| 1264 | 1264 | |
| 1265 | 1265 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 1319 | 1319 | { |
| 1320 | 1320 | switch (state) |
| 1321 | 1321 | { |
| 1322 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1323 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 1324 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(i8042); break; | |
| 1322 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break; | |
| 1323 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(data_8bit); break; | |
| 1324 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i8042); break; | |
| 1325 | 1325 | case CPUINFO_STR_NAME: strcpy(info->s, "I8042"); break; |
| 1326 | 1326 | default: CPU_GET_INFO_CALL(i8041); break; |
| 1327 | 1327 | } |
| r3957 | r3958 | |
|---|---|---|
| 522 | 522 | case CPUINFO_INT_REGISTER + KONAMI_DP: DP = info->i; break; |
| 523 | 523 | |
| 524 | 524 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 525 | case CPUINFO_ | |
| 525 | case CPUINFO_FCT | |
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | 528 | |
| r3957 | r3958 | |
| 549 | 549 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 550 | 550 | case CPUINFO_INT_MAX_CYCLES: info->i = 13; break; |
| 551 | 551 | |
| 552 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; | |
| 553 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; | |
| 554 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; | |
| 555 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 556 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 557 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; | |
| 558 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 559 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 560 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; | |
| 552 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 8; break; | |
| 553 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 554 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0; break; | |
| 555 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 0; break; | |
| 556 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 0; break; | |
| 557 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 558 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 0; break; | |
| 559 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 0; break; | |
| 560 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 561 | 561 | |
| 562 | 562 | case CPUINFO_INT_INPUT_STATE + KONAMI_IRQ_LINE: info->i = cpustate->irq_state[KONAMI_IRQ_LINE]; break; |
| 563 | 563 | case CPUINFO_INT_INPUT_STATE + KONAMI_FIRQ_LINE:info->i = cpustate->irq_state[KONAMI_FIRQ_LINE]; break; |
| r3957 | r3958 | |
| 578 | 578 | case CPUINFO_INT_REGISTER + KONAMI_DP: info->i = DP; break; |
| 579 | 579 | |
| 580 | 580 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 581 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(konami); break; | |
| 582 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(konami); break; | |
| 583 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(konami); break; | |
| 584 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(konami); break; | |
| 585 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(konami); break; | |
| 586 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 587 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(konami);break; | |
| 581 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(konami); break; | |
| 582 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(konami); break; | |
| 583 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(konami); break; | |
| 584 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(konami); break; | |
| 585 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(konami); break; | |
| 586 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 587 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(konami);break; | |
| 588 | 588 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 589 | case CPUINFO_ | |
| 589 | case CPUINFO_FCT | |
| 590 | 590 | |
| 591 | 591 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 592 | 592 | case CPUINFO_STR_NAME: strcpy(info->s, "KONAMI"); break; |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | enum |
| 19 | 19 | { |
| 20 | CPUINFO_ | |
| 20 | CPUINFO_FCT | |
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | 23 | #define KONAMI_SETLINES_CALLBACK(name) void name(const device_config *device, int lines) |
| r3957 | r3958 | |
| 27 | 27 | |
| 28 | 28 | /* PUBLIC FUNCTIONS */ |
| 29 | 29 | CPU_GET_INFO( konami ); |
| 30 | #define CPU_KONAMI CPU_GET_INFO_NAME( konami ) | |
| 30 | 31 | |
| 31 | 32 | CPU_DISASSEMBLE( konami ); |
| 32 | 33 | |
| 33 | 34 | |
| 34 | 35 | INLINE void konami_configure_set_lines(const device_config *device, konami_set_lines_func func) |
| 35 | 36 | { |
| 36 | c | |
| 37 | device | |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | #endif /* __KONAMI_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 111 | 111 | struct _sound_stream |
| 112 | 112 | { |
| 113 | 113 | /* linking information */ |
| 114 | | |
| 114 | const device_ | |
| 115 | 115 | sound_stream * next; /* next stream in the chain */ |
| 116 | 116 | void * tag; /* tag (used for identification) */ |
| 117 | 117 | int index; /* index for save states */ |
| r3957 | r3958 | |
| 362 | 362 | VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream)); |
| 363 | 363 | |
| 364 | 364 | /* fill in the data */ |
| 365 | stream-> | |
| 365 | stream->dev | |
| 366 | 366 | stream->tag = strdata->current_tag; |
| 367 | 367 | stream->index = strdata->stream_index++; |
| 368 | 368 | stream->sample_rate = sample_rate; |
| r3957 | r3958 | |
| 457 | 457 | input->source->dependents++; |
| 458 | 458 | |
| 459 | 459 | /* update sample rates now that we know the input */ |
| 460 | recompute_sample_rate_data(stream->machine->streams_data, stream); | |
| 460 | recompute_sample_rate_data(stream->device->machine->streams_data, stream); | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | |
| r3957 | r3958 | |
| 468 | 468 | |
| 469 | 469 | void stream_update(sound_stream *stream) |
| 470 | 470 | { |
| 471 | streams_private *strdata = stream->machine->streams_data; | |
| 472 | INT32 update_sampindex = time_to_sampindex(strdata, stream, timer_get_time(stream->machine)); | |
| 471 | running_machine *machine = stream->device->machine; | |
| 472 | streams_private *strdata = machine->streams_data; | |
| 473 | INT32 update_sampindex = time_to_sampindex(strdata, stream, timer_get_time(machine)); | |
| 473 | 474 | |
| 474 | 475 | /* generate samples to get us up to the appropriate time */ |
| 475 | 476 | assert(stream->output_sampindex - stream->output_base_sampindex >= 0); |
| r3957 | r3958 | |
| 538 | 539 | |
| 539 | 540 | attotime stream_get_time(sound_stream *stream) |
| 540 | 541 | { |
| 541 | streams_private *strdata = stream->machine->streams_data; | |
| 542 | streams_private *strdata = stream->device->machine->streams_data; | |
| 542 | 543 | attotime base = attotime_make(strdata->last_update.seconds, 0); |
| 543 | 544 | return attotime_add_attoseconds(base, stream->output_sampindex * stream->attoseconds_per_sample); |
| 544 | 545 | } |
| r3957 | r3958 | |
| 808 | 809 | |
| 809 | 810 | /* run the callback */ |
| 810 | 811 | VPRINTF((" callback(%p, %d)\n", stream, samples)); |
| 811 | (*stream->callback)(stream->param, stream->input_array, stream->output_array, samples); | |
| 812 | (*stream->callback)(stream->device, stream->param, stream->input_array, stream->output_array, samples); | |
| 812 | 813 | VPRINTF((" callback done\n")); |
| 813 | 814 | } |
| 814 | 815 |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | typedef struct _sound_stream sound_stream; |
| 23 | 23 | |
| 24 | typedef void (*stream_update_func)(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 24 | typedef void (*stream_update_func)(const device_config *device, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 25 | 25 | |
| 26 | #define STREAM_UPDATE(name) void name(const device_config *device, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 26 | 27 | |
| 27 | 28 | |
| 29 | ||
| 28 | 30 | /*************************************************************************** |
| 29 | 31 | FUNCTION PROTOTYPES |
| 30 | 32 | ***************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | const device_config *screen; /* screen */ |
| 46 | 46 | const device_config *cpu; /* CPU */ |
| 47 | 47 | sound_stream *stream; /* sound output */ |
| 48 | int color_clock; | |
| 48 | 49 | |
| 49 | 50 | /* video state */ |
| 50 | 51 | int dispoff; /* display off */ |
| r3957 | r3958 | |
| 728 | 729 | |
| 729 | 730 | if (!cdp1869->toneoff && cdp1869->toneamp) |
| 730 | 731 | { |
| 731 | double frequency = ( | |
| 732 | double frequency = ( | |
| 732 | 733 | |
| 733 | 734 | int rate = device->machine->sample_rate / 2; |
| 734 | 735 | |
| r3957 | r3958 | |
| 767 | 768 | |
| 768 | 769 | for (wndiv = 0; wndiv < 128; wndiv++) |
| 769 | 770 | { |
| 770 | double frequency = ( | |
| 771 | double frequency = ( | |
| 771 | 772 | |
| 772 | 773 | cdp1869_sum_square_wave(buffer, frequency, amplitude); |
| 773 | 774 | } |
| r3957 | r3958 | |
| 779 | 780 | |
| 780 | 781 | static DEVICE_START( cdp1869 ) |
| 781 | 782 | { |
| 783 | const cdp1869_inline *inline_config = device->inline_config; | |
| 782 | 784 | cdp1869_t *cdp1869 = get_safe_token(device); |
| 783 | 785 | |
| 784 | 786 | // validate arguments |
| r3957 | r3958 | |
| 786 | 788 | assert(device != NULL); |
| 787 | 789 | assert(device->tag != NULL); |
| 788 | 790 | assert(device->static_config != NULL); |
| 791 | assert(inline_config != NULL); | |
| 789 | 792 | |
| 790 | 793 | cdp1869->intf = device->static_config; |
| 791 | 794 | |
| r3957 | r3958 | |
| 800 | 803 | |
| 801 | 804 | // get the screen device |
| 802 | 805 | |
| 803 | cdp1869->screen = devtag_get_device(device->machine, VIDEO_SCREEN, | |
| 806 | cdp1869->screen = devtag_get_device(device->machine, VIDEO_SCREEN, | |
| 804 | 807 | assert(cdp1869->screen != NULL); |
| 805 | 808 | |
| 806 | 809 | // get the CPU device |
| 807 | 810 | |
| 808 | cdp1869->cpu = cputag_get_cpu(device->machine, | |
| 811 | cdp1869->cpu = cputag_get_cpu(device->machine, | |
| 809 | 812 | assert(cdp1869->cpu != NULL); |
| 810 | 813 | |
| 811 | 814 | // allocate timers |
| r3957 | r3958 | |
| 859 | 862 | { |
| 860 | 863 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 861 | 864 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(cdp1869_t); break; |
| 862 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = | |
| 865 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(cdp1869_inline); | |
| 863 | 866 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 864 | 867 | |
| 865 | 868 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r3957 | r3958 | |
| 869 | 872 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 870 | 873 | |
| 871 | 874 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 872 | case DEVINFO_STR_NAME: info->s = "RCA CDP1869"; break; | |
| 873 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break; | |
| 874 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 875 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 876 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 875 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1869"); break; | |
| 876 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; | |
| 877 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 878 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 879 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 877 | 880 | } |
| 878 | 881 | } |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "deprecat.h" | |
| 19 | 18 | #include "v9938.h" |
| 20 | 19 | |
| 21 | 20 | #define VERBOSE 0 |
| r3957 | r3958 | |
| 94 | 93 | "GRAPHIC 4", "GRAPHIC 5", "GRAPHIC 6", "GRAPHIC 7", "TEXT 2", |
| 95 | 94 | "UNKNOWN" }; |
| 96 | 95 | |
| 97 | static void v9938_register_write (int reg, int data); | |
| 96 | static void v9938_register_write (running_machine *machine, int reg, int data); | |
| 98 | 97 | static void v9938_update_command (void); |
| 99 | 98 | static void v9938_cpu_to_vdp (UINT8 V); |
| 100 | 99 | static UINT8 v9938_command_unit_w (UINT8 Op); |
| 101 | 100 | static UINT8 v9938_vdp_to_cpu (void); |
| 102 | 101 | static void v9938_set_mode (void); |
| 103 | static void v9938_refresh_line (bitmap_t *bmp, int line); | |
| 102 | static void v9938_refresh_line (running_machine *machine, bitmap_t *bmp, int line); | |
| 104 | 103 | |
| 105 | 104 | /*************************************************************************** |
| 106 | 105 | |
| r3957 | r3958 | |
| 435 | 434 | return v9938_vram_r(); |
| 436 | 435 | } |
| 437 | 436 | |
| 438 | static void v9938_command_w(UINT8 data) | |
| 437 | static void v9938_command_w(running_machine *machine, UINT8 data) | |
| 439 | 438 | { |
| 440 | 439 | if (vdp->cmd_write_first) |
| 441 | 440 | { |
| 442 | 441 | if (data & 0x80) |
| 443 | 442 | { |
| 444 | 443 | if (!(data & 0x40)) |
| 445 | v9938_register_write (data & 0x3f, vdp->cmd_write); | |
| 444 | v9938_register_write (machine, data & 0x3f, vdp->cmd_write); | |
| 446 | 445 | } |
| 447 | 446 | else |
| 448 | 447 | { |
| r3957 | r3958 | |
| 463 | 462 | WRITE8_HANDLER (v9938_0_command_w) |
| 464 | 463 | { |
| 465 | 464 | vdp = &vdps[0]; |
| 466 | v9938_command_w(data); | |
| 465 | v9938_command_w(space->machine, data); | |
| 467 | 466 | } |
| 468 | 467 | |
| 469 | 468 | WRITE8_HANDLER (v9938_1_command_w) |
| 470 | 469 | { |
| 471 | 470 | vdp = &vdps[1]; |
| 472 | v9938_command_w(data); | |
| 471 | v9938_command_w(space->machine, data); | |
| 473 | 472 | } |
| 474 | 473 | |
| 475 | 474 | /*************************************************************************** |
| r3957 | r3958 | |
| 582 | 581 | vdp->scanline = 0; |
| 583 | 582 | } |
| 584 | 583 | |
| 585 | static void v9938_check_int ( | |
| 584 | static void v9938_check_int (running_machine *machine) | |
| 586 | 585 | { |
| 587 | 586 | UINT8 n; |
| 588 | 587 | |
| r3957 | r3958 | |
| 605 | 604 | ** called; because of this Mr. Ghost, Xevious and SD Snatcher don't |
| 606 | 605 | ** run. As a patch it's called every scanline |
| 607 | 606 | */ |
| 608 | vdp->INTCallback ( | |
| 607 | vdp->INTCallback (machine, n); | |
| 609 | 608 | } |
| 610 | 609 | |
| 611 | 610 | void v9938_set_sprite_limit (int which, int i) |
| r3957 | r3958 | |
| 634 | 633 | |
| 635 | 634 | ***************************************************************************/ |
| 636 | 635 | |
| 637 | static void v9938_register_w(UINT8 data) | |
| 636 | static void v9938_register_w(running_machine *machine, UINT8 data) | |
| 638 | 637 | { |
| 639 | 638 | int reg; |
| 640 | 639 | |
| 641 | 640 | reg = vdp->contReg[17] & 0x3f; |
| 642 | 641 | if (reg != 17) |
| 643 | v9938_register_write (reg, data); /* true ? */ | |
| 642 | v9938_register_write (machine, reg, data); /* true ? */ | |
| 644 | 643 | |
| 645 | 644 | if (!(vdp->contReg[17] & 0x80)) |
| 646 | 645 | vdp->contReg[17] = (vdp->contReg[17] + 1) & 0x3f; |
| r3957 | r3958 | |
| 649 | 648 | WRITE8_HANDLER (v9938_0_register_w) |
| 650 | 649 | { |
| 651 | 650 | vdp = &vdps[0]; |
| 652 | v9938_register_w(data); | |
| 651 | v9938_register_w(space->machine, data); | |
| 653 | 652 | } |
| 654 | 653 | |
| 655 | 654 | WRITE8_HANDLER (v9938_1_register_w) |
| 656 | 655 | { |
| 657 | 656 | vdp = &vdps[1]; |
| 658 | v9938_register_w(data); | |
| 657 | v9938_register_w(space->machine, data); | |
| 659 | 658 | } |
| 660 | 659 | |
| 661 | static void v9938_register_write (int reg, int data) | |
| 660 | static void v9938_register_write (running_machine *machine, int reg, int data) | |
| 662 | 661 | { |
| 663 | 662 | static UINT8 const reg_mask[] = |
| 664 | 663 | { |
| r3957 | r3958 | |
| 689 | 688 | case 1: |
| 690 | 689 | vdp->contReg[reg] = data; |
| 691 | 690 | v9938_set_mode (); |
| 692 | v9938_check_int (); | |
| 691 | v9938_check_int (machine); | |
| 693 | 692 | LOG(("V9938: mode = %s\n", v9938_modes[vdp->mode])); |
| 694 | 693 | break; |
| 695 | 694 | |
| r3957 | r3958 | |
| 812 | 811 | } |
| 813 | 812 | |
| 814 | 813 | LOG(("V9938: Read %02x from S#%d\n", ret, reg)); |
| 815 | v9938_check_int (); | |
| 814 | v9938_check_int (machine); | |
| 816 | 815 | |
| 817 | 816 | return ret; |
| 818 | 817 | } |
| r3957 | r3958 | |
| 1212 | 1211 | vdp->mode = i; |
| 1213 | 1212 | } |
| 1214 | 1213 | |
| 1215 | static void v9938_refresh_16 (bitmap_t *bmp, int line) | |
| 1214 | static void v9938_refresh_16 (running_machine *machine, bitmap_t *bmp, int line) | |
| 1216 | 1215 | { |
| 1217 | const pen_t *pens = | |
| 1216 | const pen_t *pens = machine->pens; | |
| 1218 | 1217 | int i, double_lines; |
| 1219 | 1218 | UINT8 col[256]; |
| 1220 | 1219 | UINT16 *ln, *ln2 = NULL; |
| r3957 | r3958 | |
| 1272 | 1271 | memcpy (ln2, ln, (512 + 32) * 2); |
| 1273 | 1272 | } |
| 1274 | 1273 | |
| 1275 | static void v9938_refresh_line (bitmap_t *bmp, int line) | |
| 1274 | static void v9938_refresh_line (running_machine *machine, bitmap_t *bmp, int line) | |
| 1276 | 1275 | { |
| 1277 | 1276 | int ind16, ind256; |
| 1278 | 1277 | |
| r3957 | r3958 | |
| 1285 | 1284 | vdp->pal_ind256[0] = vdp->pal_ind256[vdp->contReg[7]]; |
| 1286 | 1285 | } |
| 1287 | 1286 | |
| 1288 | v9938_refresh_16 (bmp, line); | |
| 1287 | v9938_refresh_16 (machine, bmp, line); | |
| 1289 | 1288 | |
| 1290 | 1289 | if ( !(vdp->contReg[8] & 0x20) && (vdp->mode != V9938_MODE_GRAPHIC5) ) |
| 1291 | 1290 | { |
| r3957 | r3958 | |
| 1459 | 1458 | vdp->size_now = -1; |
| 1460 | 1459 | } |
| 1461 | 1460 | |
| 1462 | int v9938_interrupt (int which) | |
| 1461 | int v9938_interrupt (running_machine *machine, int which) | |
| 1463 | 1462 | { |
| 1464 | 1463 | int scanline, max, pal, scanline_start; |
| 1465 | 1464 | |
| r3957 | r3958 | |
| 1492 | 1491 | else |
| 1493 | 1492 | if ( !(vdp->contReg[0] & 0x10) ) vdp->statReg[1] &= 0xfe; |
| 1494 | 1493 | |
| 1495 | v9938_check_int (); | |
| 1494 | v9938_check_int (machine); | |
| 1496 | 1495 | |
| 1497 | 1496 | /* check for start of vblank */ |
| 1498 | 1497 | if ((pal && (vdp->scanline == 310)) || |
| r3957 | r3958 | |
| 1504 | 1503 | { |
| 1505 | 1504 | scanline = (vdp->scanline - scanline_start) & 255; |
| 1506 | 1505 | |
| 1507 | v9938_refresh_line (vdp->bitmap, scanline); | |
| 1506 | v9938_refresh_line (machine, vdp->bitmap, scanline); | |
| 1508 | 1507 | } |
| 1509 | 1508 | |
| 1510 | 1509 | max = (vdp->contReg[9] & 2) ? 313 : 262; |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | **************************************************************************** */ |
| 32 | 32 | |
| 33 | 33 | #include "rendutil.h" |
| 34 | #include "deprecat.h" | |
| 35 | 34 | #include "vector.h" |
| 36 | 35 | |
| 37 | 36 | |
| r3957 | r3958 | |
| 193 | 192 | * Adds a line end point to the vertices list. The vector processor emulation |
| 194 | 193 | * needs to call this. |
| 195 | 194 | */ |
| 196 | void vector_add_point (int x, int y, rgb_t color, int intensity) | |
| 195 | void vector_add_point (running_machine *machine, int x, int y, rgb_t color, int intensity) | |
| 197 | 196 | { |
| 198 | 197 | point *newpoint; |
| 199 | 198 | |
| r3957 | r3958 | |
| 202 | 201 | |
| 203 | 202 | if (flicker && (intensity > 0)) |
| 204 | 203 | { |
| 205 | intensity += (intensity * (0x80-(mame_rand( | |
| 204 | intensity += (intensity * (0x80-(mame_rand(machine)&0xff)) * flicker)>>16; | |
| 206 | 205 | if (intensity < 0) |
| 207 | 206 | intensity = 0; |
| 208 | 207 | if (intensity > 0xff) |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | #define CDP1869_VIDEO DEVICE_GET_INFO_NAME(cdp1869_video) |
| 82 | 82 | |
| 83 | #define MDRV_CDP1869_ADD(_tag, _screen, _pixclock, _chrclock, _cpu, _config) \ | |
| 84 | MDRV_DEVICE_ADD(_tag, CDP1869_VIDEO, _pixclock) \ | |
| 85 | MDRV_DEVICE_CONFIG_DATA32(cdp1869_inline, color_clock, _chrclock) \ | |
| 86 | MDRV_DEVICE_CONFIG_DATAPTR(cdp1869_inline, screen_tag, _screen) \ | |
| 87 | MDRV_DEVICE_CONFIG_DATAPTR(cdp1869_inline, cpu_tag, _cpu) \ | |
| 88 | MDRV_DEVICE_CONFIG(_config) | |
| 89 | ||
| 90 | #define MDRV_CDP1869_REMOVE(_tag) \ | |
| 91 | MDRV_DEVICE_REMOVE(_tag, CDP1869_VIDEO) | |
| 92 | ||
| 93 | ||
| 83 | 94 | typedef UINT8 (*cdp1869_char_ram_read_func)(const device_config *device, UINT16 pma, UINT8 cma); |
| 84 | 95 | #define CDP1869_CHAR_RAM_READ(name) UINT8 name(const device_config *device, UINT16 pma, UINT8 cma) |
| 85 | 96 | |
| r3957 | r3958 | |
| 104 | 115 | CDP1869_PAL |
| 105 | 116 | }; |
| 106 | 117 | |
| 107 | /* interface */ | |
| 108 | typedef struct _cdp1869_interface cdp1869_interface; | |
| 109 | struct _cdp1869_interface | |
| 118 | typedef struct _cdp1869_inline cdp1869_inline; | |
| 119 | struct _cdp1869_inline | |
| 110 | 120 | { |
| 111 | 121 | const char *screen_tag; /* screen we are acting on */ |
| 112 | 122 | const char *cpu_tag; /* CPU we work together with */ |
| 113 | int pixel_clock; /* the dot clock of the chip */ | |
| 123 | ||
| 124 | /* pixel clock of the chip is the device clock */ | |
| 114 | 125 | int color_clock; /* the chroma clock of the chip */ |
| 126 | }; | |
| 115 | 127 | |
| 128 | /* interface */ | |
| 129 | typedef struct _cdp1869_interface cdp1869_interface; | |
| 130 | struct _cdp1869_interface | |
| 131 | { | |
| 116 | 132 | cdp1869_format pal_ntsc; /* screen format */ |
| 117 | 133 | |
| 118 | 134 | /* page memory read function */ |
| r3957 | r3958 | |
|---|---|---|
| 4465 | 4465 | v->device = device; |
| 4466 | 4466 | |
| 4467 | 4467 | /* copy config data */ |
| 4468 | v->freq = | |
| 4468 | v->freq = dev | |
| 4469 | 4469 | v->fbi.vblank_client = config->vblank; |
| 4470 | 4470 | v->pci.stall_callback = config->stall; |
| 4471 | 4471 | |
| 4472 | 4472 | /* create a multiprocessor work queue */ |
| 4473 | v->poly = poly_alloc(64, sizeof(poly_extra_data), 0); | |
| 4473 | v->poly = poly_alloc(device->machine, 64, sizeof(poly_extra_data), 0); | |
| 4474 | 4474 | v->thread_stats = auto_malloc(sizeof(v->thread_stats[0]) * WORK_MAX_THREADS); |
| 4475 | 4475 | |
| 4476 | 4476 | /* create a table of precomputed 1/n and log2(n) values */ |
| r3957 | r3958 | |
| 4682 | 4682 | switch (config->type) |
| 4683 | 4683 | { |
| 4684 | 4684 | default: |
| 4685 | case VOODOO_1: info->s = "3dfx Voodoo Graphics"; break; | |
| 4686 | case VOODOO_2: info->s = "3dfx Voodoo 2"; break; | |
| 4687 | case VOODOO_BANSHEE: info->s = "3dfx Voodoo Banshee"; break; | |
| 4688 | case VOODOO_3: info->s = "3dfx Voodoo 3"; break; | |
| 4685 | case VOODOO_1: strcpy(info->s, "3dfx Voodoo Graphics");break; | |
| 4686 | case VOODOO_2: strcpy(info->s, "3dfx Voodoo 2"); break; | |
| 4687 | case VOODOO_BANSHEE: strcpy(info->s, "3dfx Voodoo Banshee"); break; | |
| 4688 | case VOODOO_3: strcpy(info->s, "3dfx Voodoo 3"); break; | |
| 4689 | 4689 | } |
| 4690 | 4690 | break; |
| 4691 | case DEVINFO_STR_FAMILY: info->s = "3dfx Voodoo Graphics"; break; | |
| 4692 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 4693 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 4694 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 4691 | case DEVINFO_STR_FAMILY: strcpy(info->s, "3dfx Voodoo Graphics");break; | |
| 4692 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 4693 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 4694 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 4695 | 4695 | } |
| 4696 | 4696 | } |
| 4697 | 4697 |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | void v9938_init (running_machine *machine, int which, const device_config *screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) ); |
| 18 | 18 | void v9938_reset (int which); |
| 19 | int v9938_interrupt (int which); | |
| 19 | int v9938_interrupt (running_machine *machine, int which); | |
| 20 | 20 | void v9938_set_sprite_limit (int which, int); |
| 21 | 21 | void v9938_set_resolution (int which, int); |
| 22 | 22 | int v9938_get_transpen(int which); |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | VIDEO_UPDATE( vector ); |
| 18 | 18 | |
| 19 | 19 | void vector_clear_list(void); |
| 20 | void vector_add_point(int x, int y, rgb_t color, int intensity); | |
| 20 | void vector_add_point(running_machine *machine, int x, int y, rgb_t color, int intensity); | |
| 21 | 21 | void vector_add_clip(int minx, int miny, int maxx, int maxy); |
| 22 | 22 | |
| 23 | 23 | void vector_set_flicker(float _flicker); |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | struct _voodoo_config |
| 41 | 41 | { |
| 42 | 42 | int type; |
| 43 | UINT32 clock; | |
| 44 | 43 | UINT8 fbmem; |
| 45 | 44 | UINT8 tmumem0; |
| 46 | 45 | UINT8 tmumem1; |
| r3957 | r3958 | |
| 57 | 56 | ***************************************************************************/ |
| 58 | 57 | |
| 59 | 58 | #define MDRV_3DFX_VOODOO_ADD(_tag, _type, _clock, _fbmem, _screen) \ |
| 60 | MDRV_DEVICE_ADD(_tag, VOODOO_GRAPHICS) \ | |
| 59 | MDRV_DEVICE_ADD(_tag, VOODOO_GRAPHICS, _clock) \ | |
| 61 | 60 | MDRV_DEVICE_CONFIG_DATA32(voodoo_config, type, _type) \ |
| 62 | MDRV_DEVICE_CONFIG_DATA32(voodoo_config, clock, _clock) \ | |
| 63 | 61 | MDRV_DEVICE_CONFIG_DATA32(voodoo_config, fbmem, _fbmem) \ |
| 64 | 62 | MDRV_DEVICE_CONFIG_DATAPTR(voodoo_config, screen, _screen) |
| 65 | 63 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | *********************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | #include "generic.h" |
| 15 | 14 | |
| 16 | 15 | |
| r3957 | r3958 | |
| 482 | 481 | flip_screen_set - set global flip |
| 483 | 482 | -------------------------------------------------*/ |
| 484 | 483 | |
| 485 | void flip_screen_set(int on) | |
| 484 | void flip_screen_set(running_machine *machine, int on) | |
| 486 | 485 | { |
| 487 | flip_screen_x_set(on); | |
| 488 | flip_screen_y_set(on); | |
| 486 | flip_screen_x_set(machine, on); | |
| 487 | flip_screen_y_set(machine, on); | |
| 489 | 488 | } |
| 490 | 489 | |
| 491 | 490 | |
| r3957 | r3958 | |
| 494 | 493 | do not call update_flip. |
| 495 | 494 | -------------------------------------------------*/ |
| 496 | 495 | |
| 497 | void flip_screen_set_no_update(int on) | |
| 496 | void flip_screen_set_no_update(running_machine *machine, int on) | |
| 498 | 497 | { |
| 499 | 498 | /* flip_screen_y is not updated on purpose |
| 500 | 499 | * this function is for drivers which |
| r3957 | r3958 | |
| 509 | 508 | flip_screen_x_set - set global horizontal flip |
| 510 | 509 | -------------------------------------------------*/ |
| 511 | 510 | |
| 512 | void flip_screen_x_set(int on) | |
| 511 | void flip_screen_x_set(running_machine *machine, int on) | |
| 513 | 512 | { |
| 514 | 513 | if (on) on = ~0; |
| 515 | 514 | if (flip_screen_x != on) |
| 516 | 515 | { |
| 517 | 516 | flip_screen_x = on; |
| 518 | updateflip( | |
| 517 | updateflip(machine); | |
| 519 | 518 | } |
| 520 | 519 | } |
| 521 | 520 | |
| r3957 | r3958 | |
| 524 | 523 | flip_screen_y_set - set global vertical flip |
| 525 | 524 | -------------------------------------------------*/ |
| 526 | 525 | |
| 527 | void flip_screen_y_set(int on) | |
| 526 | void flip_screen_y_set(running_machine *machine, int on) | |
| 528 | 527 | { |
| 529 | 528 | if (on) on = ~0; |
| 530 | 529 | if (flip_screen_y != on) |
| 531 | 530 | { |
| 532 | 531 | flip_screen_y = on; |
| 533 | updateflip( | |
| 532 | updateflip(machine); | |
| 534 | 533 | } |
| 535 | 534 | } |
| 536 | 535 | |
| r3957 | r3958 | |
| 539 | 538 | flip_screen_get - get global flip |
| 540 | 539 | -------------------------------------------------*/ |
| 541 | 540 | |
| 542 | int flip_screen_get( | |
| 541 | int flip_screen_get(running_machine *machine) | |
| 543 | 542 | { |
| 544 | 543 | return flip_screen_x; |
| 545 | 544 | } |
| r3957 | r3958 | |
| 549 | 548 | flip_screen_x_get - get global x flip |
| 550 | 549 | -------------------------------------------------*/ |
| 551 | 550 | |
| 552 | int flip_screen_x_get( | |
| 551 | int flip_screen_x_get(running_machine *machine) | |
| 553 | 552 | { |
| 554 | 553 | return flip_screen_x; |
| 555 | 554 | } |
| r3957 | r3958 | |
| 559 | 558 | flip_screen_get - get global y flip |
| 560 | 559 | -------------------------------------------------*/ |
| 561 | 560 | |
| 562 | int flip_screen_y_get( | |
| 561 | int flip_screen_y_get(running_machine *machine) | |
| 563 | 562 | { |
| 564 | 563 | return flip_screen_y; |
| 565 | 564 | } |
| 566 | 565 | |
| 567 | 566 | |
| 567 | ||
| 568 | 568 | /*************************************************************************** |
| 569 | 569 | COMMON PALETTE INITIALIZATION |
| 570 | 570 | ***************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 117 | 117 | /* ----- global attributes ----- */ |
| 118 | 118 | |
| 119 | 119 | /* set global attributes */ |
| 120 | void flip_screen_set(int on); | |
| 121 | void flip_screen_set_no_update(int on); /* will not call update_flip */ | |
| 122 | void flip_screen_x_set(int on); | |
| 123 | void flip_screen_y_set(int on); | |
| 124 | int flip_screen_get(void); | |
| 125 | int flip_screen_x_get(void); | |
| 126 | int flip_screen_y_get(void); | |
| 120 | void flip_screen_set(running_machine *machine, int on); | |
| 121 | void flip_screen_set_no_update(running_machine *machine, int on); /* will not call update_flip */ | |
| 122 | void flip_screen_x_set(running_machine *machine, int on); | |
| 123 | void flip_screen_y_set(running_machine *machine, int on); | |
| 124 | int flip_screen_get(running_machine *machine); | |
| 125 | int flip_screen_x_get(running_machine *machine); | |
| 126 | int flip_screen_y_get(running_machine *machine); | |
| 127 | 127 | |
| 128 | //#define flip_screen flip_screen_get() | |
| 128 | //#define flip_screen flip_screen_get(machine) | |
| 129 | 129 | |
| 130 | 130 | |
| 131 | 131 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "poly.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "eminline.h" |
| 12 | 11 | #include "mame.h" |
| 13 | 12 | #include "state.h" |
| r3957 | r3958 | |
| 329 | 328 | manager |
| 330 | 329 | -------------------------------------------------*/ |
| 331 | 330 | |
| 332 | poly_manager *poly_alloc(int max_polys, size_t extra_data_size, UINT8 flags) | |
| 331 | poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_data_size, UINT8 flags) | |
| 333 | 332 | { |
| 334 | 333 | poly_manager *poly; |
| 335 | 334 | |
| r3957 | r3958 | |
| 361 | 360 | poly->queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI | WORK_QUEUE_FLAG_HIGH_FREQ); |
| 362 | 361 | |
| 363 | 362 | /* request a pre-save callback for synchronization */ |
| 364 | state_save_register_presave( | |
| 363 | state_save_register_presave(machine, poly_state_presave, poly); | |
| 365 | 364 | return poly; |
| 366 | 365 | } |
| 367 | 366 |
| r3957 | r3958 | |
|---|---|---|
| 126 | 126 | static void update_vsync_changed_timers(mc6845_t *mc6845); |
| 127 | 127 | |
| 128 | 128 | |
| 129 | mc6845_interface mc6845_null_interface = { 0 }; | |
| 130 | ||
| 131 | ||
| 129 | 132 | /* makes sure that the passed in device is the right type */ |
| 130 | 133 | INLINE mc6845_t *get_safe_token(const device_config *device) |
| 131 | 134 | { |
| r3957 | r3958 | |
| 748 | 751 | |
| 749 | 752 | if (mc6845->intf != NULL) |
| 750 | 753 | { |
| 751 | assert( | |
| 754 | assert(dev | |
| 752 | 755 | assert(mc6845->intf->hpixels_per_column > 0); |
| 753 | 756 | |
| 754 | 757 | /* copy the initial parameters */ |
| 755 | mc6845->clock = | |
| 758 | mc6845->clock = dev | |
| 756 | 759 | mc6845->hpixels_per_column = mc6845->intf->hpixels_per_column; |
| 757 | 760 | |
| 758 | 761 | /* get the screen device */ |
| r3957 | r3958 | |
| 868 | 871 | int error = FALSE; |
| 869 | 872 | const mc6845_interface *intf = (const mc6845_interface *) device->static_config; |
| 870 | 873 | |
| 871 | if (intf != NULL) | |
| 874 | if (intf != NULL && intf->screen_tag != NULL) | |
| 872 | 875 | { |
| 873 | if (i | |
| 876 | if (device | |
| 874 | 877 | { |
| 875 | 878 | mame_printf_error("%s: %s has an mc6845 with an invalid clock\n", driver->source_file, driver->name); |
| 876 | 879 | error = TRUE; |
| r3957 | r3958 | |
| 913 | 916 | case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME(mc6845); break; |
| 914 | 917 | |
| 915 | 918 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 916 | case DEVINFO_STR_NAME: info->s = "Motorola 6845"; break; | |
| 917 | case DEVINFO_STR_FAMILY: info->s = "MC6845 CRTC"; break; | |
| 918 | case DEVINFO_STR_VERSION: info->s = "1.61"; break; | |
| 919 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 920 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 919 | case DEVINFO_STR_NAME: strcpy(info->s, "Motorola 6845"); break; | |
| 920 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MC6845 CRTC"); break; | |
| 921 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.61"); break; | |
| 922 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 923 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 921 | 924 | } |
| 922 | 925 | } |
| 923 | 926 | |
| r3957 | r3958 | |
| 927 | 930 | switch (state) |
| 928 | 931 | { |
| 929 | 932 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 930 | case DEVINFO_STR_NAME: info->s | |
| 933 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 931 | 934 | |
| 932 | 935 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 933 | 936 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mc6845_1); break; |
| r3957 | r3958 | |
| 942 | 945 | switch (state) |
| 943 | 946 | { |
| 944 | 947 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 945 | case DEVINFO_STR_NAME: info->s | |
| 948 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 946 | 949 | |
| 947 | 950 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 948 | 951 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(c6545_1); break; |
| r3957 | r3958 | |
| 957 | 960 | switch (state) |
| 958 | 961 | { |
| 959 | 962 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 960 | case DEVINFO_STR_NAME: info->s | |
| 963 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 961 | 964 | |
| 962 | 965 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 963 | 966 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(r6545_1); break; |
| r3957 | r3958 | |
| 972 | 975 | switch (state) |
| 973 | 976 | { |
| 974 | 977 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 975 | case DEVINFO_STR_NAME: info->s | |
| 978 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 976 | 979 | |
| 977 | 980 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 978 | 981 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(h46505); break; |
| r3957 | r3958 | |
| 987 | 990 | switch (state) |
| 988 | 991 | { |
| 989 | 992 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 990 | case DEVINFO_STR_NAME: info->s | |
| 993 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 991 | 994 | |
| 992 | 995 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 993 | 996 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(hd6845); break; |
| r3957 | r3958 | |
| 1002 | 1005 | switch (state) |
| 1003 | 1006 | { |
| 1004 | 1007 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1005 | case DEVINFO_STR_NAME: info->s | |
| 1008 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1006 | 1009 | |
| 1007 | 1010 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1008 | 1011 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(sy6545_1); break; |
| r3957 | r3958 | |
|---|---|---|
| 102 | 102 | /* ----- initialization/teardown ----- */ |
| 103 | 103 | |
| 104 | 104 | /* allocate a new poly manager that can render triangles */ |
| 105 | poly_manager *poly_alloc(int max_polys, size_t extra_data_size, UINT8 flags); | |
| 105 | poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_data_size, UINT8 flags); | |
| 106 | 106 | |
| 107 | 107 | /* free a poly manager */ |
| 108 | 108 | void poly_free(poly_manager *poly); |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | #define SY6545_1 DEVICE_GET_INFO_NAME(sy6545_1) |
| 21 | 21 | |
| 22 | 22 | |
| 23 | #define MDRV_MC6845_ADD(_tag, _variant, _clock, _config) \ | |
| 24 | MDRV_DEVICE_ADD(_tag, _variant, _clock) \ | |
| 25 | MDRV_DEVICE_CONFIG(_config) | |
| 26 | ||
| 27 | #define MDRV_MC6845_REMOVE(_tag, _variant) \ | |
| 28 | MDRV_DEVICE_REMOVE(_tag, _variant) | |
| 29 | ||
| 30 | ||
| 31 | ||
| 23 | 32 | /* callback definitions */ |
| 24 | 33 | typedef void * (*mc6845_begin_update_func)(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); |
| 25 | 34 | #define MC6845_BEGIN_UPDATE(name) void *name(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) |
| r3957 | r3958 | |
| 51 | 60 | struct _mc6845_interface |
| 52 | 61 | { |
| 53 | 62 | const char *screen_tag; /* screen we are acting on */ |
| 54 | int clock; /* the clock (pin 21) of the chip */ | |
| 55 | 63 | int hpixels_per_column; /* number of pixels per video memory address */ |
| 56 | 64 | |
| 57 | 65 | /* if specified, this gets called before any pixel update, |
| r3957 | r3958 | |
| 84 | 92 | mc6845_on_update_addr_changed_func on_update_addr_changed; |
| 85 | 93 | }; |
| 86 | 94 | |
| 95 | extern mc6845_interface mc6845_null_interface; | |
| 87 | 96 | |
| 97 | ||
| 88 | 98 | /* device interface */ |
| 89 | 99 | DEVICE_GET_INFO( mc6845 ); |
| 90 | 100 | DEVICE_GET_INFO( mc6845_1 ); |
| r3957 | r3958 | |
|---|---|---|
| 569 | 569 | |
| 570 | 570 | static void print_game_chips(FILE *out, const game_driver *game, const machine_config *config) |
| 571 | 571 | { |
| 572 | const device_config *device; | |
| 572 | 573 | int chipnum; |
| 573 | 574 | |
| 574 | 575 | /* iterate over CPUs */ |
| 575 | for (chipnum = 0; chipnum < ARRAY_LENGTH(config->cpu); chipnum++) | |
| 576 | if (config->cpu[chipnum].type != CPU_DUMMY) | |
| 577 | { | |
| 578 | fprintf(out, "\t\t<chip"); | |
| 579 | fprintf(out, " type=\"cpu\""); | |
| 580 | fprintf(out, " tag=\"%s\"", xml_normalize_string(config->cpu[chipnum].tag)); | |
| 581 | fprintf(out, " name=\"%s\"", xml_normalize_string(cputype_get_name(config->cpu[chipnum].type))); | |
| 582 | fprintf(out, " clock=\"%d\"", config->cpu[chipnum].clock); | |
| 583 | fprintf(out, "/>\n"); | |
| 584 | } | |
| 576 | for (device = cpu_first(config); device != NULL; device = cpu_next(device)) | |
| 577 | { | |
| 578 | fprintf(out, "\t\t<chip"); | |
| 579 | fprintf(out, " type=\"cpu\""); | |
| 580 | fprintf(out, " tag=\"%s\"", xml_normalize_string(device->tag)); | |
| 581 | fprintf(out, " name=\"%s\"", xml_normalize_string(device_get_name(device))); | |
| 582 | fprintf(out, " clock=\"%d\"", device->clock); | |
| 583 | fprintf(out, "/>\n"); | |
| 584 | } | |
| 585 | 585 | |
| 586 | 586 | /* iterate over sound chips */ |
| 587 | 587 | for (chipnum = 0; chipnum < ARRAY_LENGTH(config->sound); chipnum++) |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | /************************************* |
| 23 | 23 | * |
| 24 | * Global access to the currently | |
| 25 | * executing machine. | |
| 26 | * | |
| 27 | * Please investigate if it is | |
| 28 | * possible to use a passed in | |
| 29 | * 'machine' argument. | |
| 30 | * | |
| 31 | *************************************/ | |
| 32 | ||
| 33 | extern running_machine *Machine; | |
| 34 | ||
| 35 | ||
| 36 | ||
| 37 | /************************************* | |
| 38 | * | |
| 39 | 24 | * Old way of allowing "VBLANK" |
| 40 | 25 | * interrupts to fire more than once |
| 41 | 26 | * a frame. |
| r3957 | r3958 | |
| 49 | 34 | *************************************/ |
| 50 | 35 | |
| 51 | 36 | #define MDRV_CPU_VBLANK_INT_HACK(_func, _rate) \ |
| 52 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_VBLANK_INT_HACK, 8, _rate, 24), \ | |
| 53 | TOKEN_PTR(interrupt, _func), | |
| 37 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, vblank_interrupt, _func) \ | |
| 38 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, vblank_interrupt_screen, NULL) \ | |
| 39 | MDRV_DEVICE_CONFIG_DATA32(cpu_config, vblank_interrupts_per_frame, _rate) | |
| 54 | 40 | |
| 55 | 41 | |
| 56 | 42 |
| r3957 | r3958 | |
|---|---|---|
| 326 | 326 | global.frameskip_level = options_get_int(mame_options(), OPTION_FRAMESKIP); |
| 327 | 327 | global.seconds_to_run = options_get_int(mame_options(), OPTION_SECONDS_TO_RUN); |
| 328 | 328 | |
| 329 | /* set the first screen device as the primary - this will set NULL if screenless */ | |
| 330 | machine->primary_screen = video_screen_first(machine->config); | |
| 331 | ||
| 332 | 329 | /* create spriteram buffers if necessary */ |
| 333 | 330 | if (machine->config->video_attributes & VIDEO_BUFFERS_SPRITERAM) |
| 334 | 331 | init_buffered_spriteram(machine); |
| r3957 | r3958 | |
| 1110 | 1107 | |
| 1111 | 1108 | /* a lot of modules want to the period of the primary screen, so |
| 1112 | 1109 | if we are screenless, return something reasonable so that we don't fall over */ |
| 1113 | if (screen == NULL || video_screen_count(screen->machine->config) == 0) | |
| 1110 | if (screen == NULL || !screen->started || video_screen_count(screen->machine->config) == 0) | |
| 1114 | 1111 | { |
| 1115 | 1112 | ret = DEFAULT_FRAME_PERIOD; |
| 1116 | 1113 | } |
| r3957 | r3958 | |
| 1337 | 1334 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 1338 | 1335 | |
| 1339 | 1336 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1340 | case DEVINFO_STR_NAME: info->s = "Raster"; break; | |
| 1341 | case DEVINFO_STR_FAMILY: info->s = "Video Screen"; break; | |
| 1342 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1343 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1344 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1337 | case DEVINFO_STR_NAME: strcpy(info->s, "Raster"); break; | |
| 1338 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Video Screen"); break; | |
| 1339 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1340 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1341 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1345 | 1342 | } |
| 1346 | 1343 | } |
| 1347 | 1344 |
| r3957 | r3958 | |
|---|---|---|
| 750 | 750 | address map for a CPU's address space |
| 751 | 751 | -------------------------------------------------*/ |
| 752 | 752 | |
| 753 | address_map *address_map_alloc(const | |
| 753 | address_map *address_map_alloc(const dev | |
| 754 | 754 | { |
| 755 | const char *cputag = config->cpu[cpunum].tag; | |
| 756 | int cputype = config->cpu[cpunum].type; | |
| 757 | const addrmap_token *internal_map = (const addrmap_token *)cputype_get_info_ptr(cputype, CPUINFO_PTR_INTERNAL_MEMORY_MAP + spacenum); | |
| 755 | const cpu_config *cpuconfig = device->inline_config; | |
| 756 | const addrmap_token *internal_map; | |
| 758 | 757 | address_map *map; |
| 759 | 758 | |
| 760 | 759 | map = malloc_or_die(sizeof(*map)); |
| 761 | 760 | memset(map, 0, sizeof(*map)); |
| 762 | 761 | |
| 763 | 762 | /* append the internal CPU map (first so it takes priority) */ |
| 763 | internal_map = (const addrmap_token *)device_get_info_ptr(device, CPUINFO_PTR_INTERNAL_MEMORY_MAP + spacenum); | |
| 764 | 764 | if (internal_map != NULL) |
| 765 | map_detokenize(map, driver, c | |
| 765 | map_detokenize(map, driver, device->tag, internal_map); | |
| 766 | 766 | |
| 767 | 767 | /* construct the standard map */ |
| 768 | if (config->cpu[cpunum].address_map[spacenum][0] != NULL) | |
| 769 | map_detokenize(map, driver, cputag, config->cpu[cpunum].address_map[spacenum][0]); | |
| 770 | if (config->cpu[cpunum].address_map[spacenum][1] != NULL) | |
| 771 | map_detokenize(map, driver, cputag, config->cpu[cpunum].address_map[spacenum][1]); | |
| 768 | if (cpuconfig->address_map[spacenum] != NULL) | |
| 769 | map_detokenize(map, driver, device->tag, cpuconfig->address_map[spacenum]); | |
| 770 | if (cpuconfig->address_map2[spacenum] != NULL) | |
| 771 | map_detokenize(map, driver, device->tag, cpuconfig->address_map2[spacenum]); | |
| 772 | 772 | |
| 773 | 773 | return map; |
| 774 | 774 | } |
| r3957 | r3958 | |
| 1328 | 1328 | |
| 1329 | 1329 | int memory_address_physical(const address_space *space, int intention, offs_t *address) |
| 1330 | 1330 | { |
| 1331 | cpu_class_header *classheader = space->cpu | |
| 1331 | cpu_class_header *classheader = cpu_get_class_header(space->cpu) | |
| 1332 | 1332 | if (classheader->translate != NULL) |
| 1333 | 1333 | return (*classheader->translate)(space->cpu, space->spacenum, intention, address); |
| 1334 | 1334 | else |
| r3957 | r3958 | |
| 1474 | 1474 | |
| 1475 | 1475 | static void memory_init_spaces(running_machine *machine) |
| 1476 | 1476 | { |
| 1477 | const machine_config *config = machine->config; | |
| 1478 | 1477 | memory_private *memdata = machine->memory_data; |
| 1479 | 1478 | address_space **nextptr = (address_space **)&memdata->spacelist; |
| 1480 | int cpunum, spacenum; | |
| 1479 | const device_config *device; | |
| 1480 | int spacenum; | |
| 1481 | 1481 | |
| 1482 | 1482 | /* create a global watchpoint-filled table */ |
| 1483 | 1483 | memdata->wptable = auto_malloc(1 << LEVEL1_BITS); |
| 1484 | 1484 | memset(memdata->wptable, STATIC_WATCHPOINT, 1 << LEVEL1_BITS); |
| 1485 | 1485 | |
| 1486 | 1486 | /* loop over CPUs */ |
| 1487 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1488 | if (machine->cpu[cpunum] != NULL) | |
| 1489 | { | |
| 1490 | cpu_type cputype = config->cpu[cpunum].type; | |
| 1487 | for (device = machine->cpu[0]; device != NULL; device = device->typenext) | |
| 1488 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1489 | if (cpu_get_addrbus_width(device, spacenum) > 0) | |
| 1490 | { | |
| 1491 | address_space *space = malloc_or_die(sizeof(*space)); | |
| 1492 | int logbits = cpu_get_logaddr_width(device, spacenum); | |
| 1493 | int ashift = cpu_get_addrbus_shift(device, spacenum); | |
| 1494 | int abits = cpu_get_addrbus_width(device, spacenum); | |
| 1495 | int dbits = cpu_get_databus_width(device, spacenum); | |
| 1496 | int endianness = cpu_get_endianness(device); | |
| 1497 | int accessorindex = (dbits == 8) ? 0 : (dbits == 16) ? 1 : (dbits == 32) ? 2 : 3; | |
| 1498 | int entrynum; | |
| 1491 | 1499 | |
| 1492 | /* initialize each address space with an actual address bus */ | |
| 1493 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 1494 | if (cputype_get_addrbus_width(cputype, spacenum) > 0) | |
| 1495 | { | |
| 1496 | address_space *space = malloc_or_die(sizeof(*space)); | |
| 1497 | int logbits = cputype_get_logaddr_width(cputype, spacenum); | |
| 1498 | int ashift = cputype_get_addrbus_shift(cputype, spacenum); | |
| 1499 | int abits = cputype_get_addrbus_width(cputype, spacenum); | |
| 1500 | int dbits = cputype_get_databus_width(cputype, spacenum); | |
| 1501 | int endianness = cputype_get_endianness(cputype); | |
| 1502 | int accessorindex = (dbits == 8) ? 0 : (dbits == 16) ? 1 : (dbits == 32) ? 2 : 3; | |
| 1503 | int entrynum; | |
| 1500 | /* if logbits is 0, revert to abits */ | |
| 1501 | if (logbits == 0) | |
| 1502 | logbits = abits; | |
| 1504 | 1503 | |
| 1505 | /* if logbits is 0, revert to abits */ | |
| 1506 | if (logbits == 0) | |
| 1507 | logbits = abits; | |
| 1504 | /* determine the address and data bits */ | |
| 1505 | memset(space, 0, sizeof(*space)); | |
| 1506 | space->machine = machine; | |
| 1507 | space->cpu = device; | |
| 1508 | space->name = address_space_names[spacenum]; | |
| 1509 | space->accessors = memory_accessors[accessorindex][(endianness == ENDIANNESS_LITTLE) ? 0 : 1]; | |
| 1510 | space->addrmask = 0xffffffffUL >> (32 - abits); | |
| 1511 | space->bytemask = (ashift < 0) ? ((space->addrmask << -ashift) | ((1 << -ashift) - 1)) : (space->addrmask >> ashift); | |
| 1512 | space->logaddrmask = 0xffffffffUL >> (32 - logbits); | |
| 1513 | space->logbytemask = (ashift < 0) ? ((space->logaddrmask << -ashift) | ((1 << -ashift) - 1)) : (space->logaddrmask >> ashift); | |
| 1514 | space->spacenum = spacenum; | |
| 1515 | space->endianness = endianness; | |
| 1516 | space->ashift = ashift; | |
| 1517 | space->pageshift = cpu_get_page_shift(device, spacenum); | |
| 1518 | space->abits = abits; | |
| 1519 | space->dbits = dbits; | |
| 1520 | space->addrchars = (abits + 3) / 4; | |
| 1521 | space->logaddrchars = (logbits + 3) / 4; | |
| 1522 | space->log_unmap = TRUE; | |
| 1508 | 1523 | |
| 1509 | /* determine the address and data bits */ | |
| 1510 | memset(space, 0, sizeof(*space)); | |
| 1511 | space->machine = machine; | |
| 1512 | space->cpu = machine->cpu[cpunum]; | |
| 1513 | space->name = address_space_names[spacenum]; | |
| 1514 | space->accessors = memory_accessors[accessorindex][(endianness == ENDIANNESS_LITTLE) ? 0 : 1]; | |
| 1515 | space->addrmask = 0xffffffffUL >> (32 - abits); | |
| 1516 | space->bytemask = (ashift < 0) ? ((space->addrmask << -ashift) | ((1 << -ashift) - 1)) : (space->addrmask >> ashift); | |
| 1517 | space->logaddrmask = 0xffffffffUL >> (32 - logbits); | |
| 1518 | space->logbytemask = (ashift < 0) ? ((space->logaddrmask << -ashift) | ((1 << -ashift) - 1)) : (space->logaddrmask >> ashift); | |
| 1519 | space->spacenum = spacenum; | |
| 1520 | space->endianness = endianness; | |
| 1521 | space->ashift = ashift; | |
| 1522 | space->pageshift = cputype_get_page_shift(cputype, spacenum); | |
| 1523 | space->abits = abits; | |
| 1524 | space->dbits = dbits; | |
| 1525 | space->addrchars = (abits + 3) / 4; | |
| 1526 | space->logaddrchars = (logbits + 3) / 4; | |
| 1527 | space->log_unmap = TRUE; | |
| 1524 | /* allocate subtable information; we malloc this manually because it will be realloc'ed */ | |
| 1525 | space->read.subtable = auto_malloc(sizeof(*space->read.subtable) * SUBTABLE_COUNT); | |
| 1526 | memset(space->read.subtable, 0, sizeof(*space->read.subtable) * SUBTABLE_COUNT); | |
| 1527 | space->write.subtable = auto_malloc(sizeof(*space->write.subtable) * SUBTABLE_COUNT); | |
| 1528 | memset(space->write.subtable, 0, sizeof(*space->write.subtable) * SUBTABLE_COUNT); | |
| 1528 | 1529 | |
| 1529 | /* allocate subtable information; we malloc this manually because it will be realloc'ed */ | |
| 1530 | space->read.subtable = auto_malloc(sizeof(*space->read.subtable) * SUBTABLE_COUNT); | |
| 1531 | memset(space->read.subtable, 0, sizeof(*space->read.subtable) * SUBTABLE_COUNT); | |
| 1532 | space->write.subtable = auto_malloc(sizeof(*space->write.subtable) * SUBTABLE_COUNT); | |
| 1533 | memset(space->write.subtable, 0, sizeof(*space->write.subtable) * SUBTABLE_COUNT); | |
| 1530 | /* allocate the handler table */ | |
| 1531 | space->read.handlers[0] = auto_malloc(sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers)); | |
| 1532 | memset(space->read.handlers[0], 0, sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers)); | |
| 1533 | space->write.handlers[0] = auto_malloc(sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers)); | |
| 1534 | memset(space->write.handlers[0], 0, sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers)); | |
| 1535 | for (entrynum = 1; entrynum < ARRAY_LENGTH(space->read.handlers); entrynum++) | |
| 1536 | { | |
| 1537 | space->read.handlers[entrynum] = space->read.handlers[0] + entrynum; | |
| 1538 | space->write.handlers[entrynum] = space->write.handlers[0] + entrynum; | |
| 1539 | } | |
| 1534 | 1540 | |
| 1535 | /* allocate the handler table */ | |
| 1536 | space->read.handlers[0] = auto_malloc(sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers)); | |
| 1537 | memset(space->read.handlers[0], 0, sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers)); | |
| 1538 | space->write.handlers[0] = auto_malloc(sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers)); | |
| 1539 | memset(space->write.handlers[0], 0, sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers)); | |
| 1540 | for (entrynum = 1; entrynum < ARRAY_LENGTH(space->read.handlers); entrynum++) | |
| 1541 | { | |
| 1542 | space->read.handlers[entrynum] = space->read.handlers[0] + entrynum; | |
| 1543 | space->write.handlers[entrynum] = space->write.handlers[0] + entrynum; | |
| 1544 | } | |
| 1541 | /* init the static handlers */ | |
| 1542 | for (entrynum = 0; entrynum < ENTRY_COUNT; entrynum++) | |
| 1543 | { | |
| 1544 | space->read.handlers[entrynum]->handler.generic = get_static_handler(space->dbits, 0, entrynum); | |
| 1545 | space->read.handlers[entrynum]->object = space; | |
| 1546 | space->write.handlers[entrynum]->handler.generic = get_static_handler(space->dbits, 1, entrynum); | |
| 1547 | space->write.handlers[entrynum]->object = space; | |
| 1548 | } | |
| 1545 | 1549 | |
| 1546 | /* init the static handlers */ | |
| 1547 | for (entrynum = 0; entrynum < ENTRY_COUNT; entrynum++) | |
| 1548 | { | |
| 1549 | space->read.handlers[entrynum]->handler.generic = get_static_handler(space->dbits, 0, entrynum); | |
| 1550 | space->read.handlers[entrynum]->object = space; | |
| 1551 | space->write.handlers[entrynum]->handler.generic = get_static_handler(space->dbits, 1, entrynum); | |
| 1552 | space->write.handlers[entrynum]->object = space; | |
| 1553 | } | |
| 1550 | /* make sure we fix up the mask for the unmap and watchpoint handlers */ | |
| 1551 | space->read.handlers[STATIC_UNMAP]->bytemask = ~0; | |
| 1552 | space->write.handlers[STATIC_UNMAP]->bytemask = ~0; | |
| 1553 | space->read.handlers[STATIC_WATCHPOINT]->bytemask = ~0; | |
| 1554 | space->write.handlers[STATIC_WATCHPOINT]->bytemask = ~0; | |
| 1554 | 1555 | |
| 1555 | /* make sure we fix up the mask for the unmap and watchpoint handlers */ | |
| 1556 | space->read.handlers[STATIC_UNMAP]->bytemask = ~0; | |
| 1557 | space->write.handlers[STATIC_UNMAP]->bytemask = ~0; | |
| 1558 | space->read.handlers[STATIC_WATCHPOINT]->bytemask = ~0; | |
| 1559 | space->write.handlers[STATIC_WATCHPOINT]->bytemask = ~0; | |
| 1556 | /* allocate memory; these aren't auto-malloc'ed as we need to expand them */ | |
| 1557 | space->read.table = malloc_or_die(1 << LEVEL1_BITS); | |
| 1558 | space->write.table = malloc_or_die(1 << LEVEL1_BITS); | |
| 1560 | 1559 | |
| 1561 | /* allocate memory; these aren't auto-malloc'ed as we need to expand them */ | |
| 1562 | space->read.table = malloc_or_die(1 << LEVEL1_BITS); | |
| 1563 | space->write.table = malloc_or_die(1 << LEVEL1_BITS); | |
| 1560 | /* initialize everything to unmapped */ | |
| 1561 | memset(space->read.table, STATIC_UNMAP, 1 << LEVEL1_BITS); | |
| 1562 | memset(space->write.table, STATIC_UNMAP, 1 << LEVEL1_BITS); | |
| 1564 | 1563 | |
| 1565 | /* initialize everything to unmapped */ | |
| 1566 | memset(space->read.table, STATIC_UNMAP, 1 << LEVEL1_BITS); | |
| 1567 | memset(space->write.table, STATIC_UNMAP, 1 << LEVEL1_BITS); | |
| 1564 | /* initialize the lookups */ | |
| 1565 | space->readlookup = space->read.table; | |
| 1566 | space->writelookup = space->write.table; | |
| 1568 | 1567 | |
| 1569 | /* initialize the lookups */ | |
| 1570 | space->readlookup = space->read.table; | |
| 1571 | space->writelookup = space->write.table; | |
| 1568 | /* set the direct access information base */ | |
| 1569 | space->direct.raw = space->direct.decrypted = NULL; | |
| 1570 | space->direct.mask = space->bytemask; | |
| 1571 | space->direct.min = 1; | |
| 1572 | space->direct.max = 0; | |
| 1573 | space->direct.entry = STATIC_UNMAP; | |
| 1574 | space->directupdate = NULL; | |
| 1572 | 1575 | |
| 1573 | /* set the direct access information base */ | |
| 1574 | space->direct.raw = space->direct.decrypted = NULL; | |
| 1575 | space->direct.mask = space->bytemask; | |
| 1576 | space->direct.min = 1; | |
| 1577 | space->direct.max = 0; | |
| 1578 | space->direct.entry = STATIC_UNMAP; | |
| 1579 | space->directupdate = NULL; | |
| 1580 | ||
| 1581 | /* link us in */ | |
| 1582 | *nextptr = space; | |
| 1583 | nextptr = (address_space **)&space->next; | |
| 1584 | } | |
| 1585 | } | |
| 1576 | /* link us in */ | |
| 1577 | *nextptr = space; | |
| 1578 | nextptr = (address_space **)&space->next; | |
| 1579 | } | |
| 1586 | 1580 | } |
| 1587 | 1581 | |
| 1588 | 1582 | |
| r3957 | r3958 | |
| 1607 | 1601 | int entrynum; |
| 1608 | 1602 | |
| 1609 | 1603 | /* allocate the address map */ |
| 1610 | space->map = address_map_alloc( | |
| 1604 | space->map = address_map_alloc(spac | |
| 1611 | 1605 | |
| 1612 | 1606 | /* extract global parameters specified by the map */ |
| 1613 | 1607 | space->unmap = (space->map->unmapval == 0) ? 0 : ~0; |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | ***************************************************************************/ |
| 97 | 97 | |
| 98 | 98 | #define MDRV_SCREEN_ADD(_tag, _type) \ |
| 99 | MDRV_DEVICE_ADD(_tag, VIDEO_SCREEN) \ | |
| 99 | MDRV_DEVICE_ADD(_tag, VIDEO_SCREEN, 0) \ | |
| 100 | 100 | MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type) |
| 101 | 101 | |
| 102 | 102 | #define MDRV_SCREEN_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 861 | 861 | /* ----- address maps ----- */ |
| 862 | 862 | |
| 863 | 863 | /* build and allocate an address map for a CPU's address space */ |
| 864 | address_map *address_map_alloc(const | |
| 864 | address_map *address_map_alloc(const dev | |
| 865 | 865 | |
| 866 | 866 | /* release allocated memory for an address map */ |
| 867 | 867 | void address_map_free(address_map *map); |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | - calls init_machine() [mame.c] |
| 26 | 26 | |
| 27 | 27 | init_machine() [mame.c] |
| 28 | - calls cpuintrf_init() [cpuintrf.c] to determine which CPUs are available | |
| 29 | 28 | - calls sndintrf_init() [sndintrf.c] to determine which sound chips are available |
| 30 | 29 | - calls fileio_init() [fileio.c] to initialize file I/O info |
| 31 | 30 | - calls config_init() [config.c] to initialize configuration system |
| r3957 | r3958 | |
| 182 | 181 | ***************************************************************************/ |
| 183 | 182 | |
| 184 | 183 | /* the active machine */ |
| 185 | running_machine *Machine; | |
| 184 | static running_machine *Machine; | |
| 186 | 185 | |
| 187 | 186 | /* the current options */ |
| 188 | 187 | static core_options *mame_opts; |
| r3957 | r3958 | |
| 216 | 215 | static int parse_ini_file(core_options *options, const char *name); |
| 217 | 216 | |
| 218 | 217 | static running_machine *create_machine(const game_driver *driver); |
| 219 | static void prepare_machine(running_machine *machine); | |
| 220 | 218 | static void destroy_machine(running_machine *machine); |
| 221 | 219 | static void init_machine(running_machine *machine); |
| 222 | 220 | static TIMER_CALLBACK( soft_reset ); |
| r3957 | r3958 | |
| 241 | 239 | |
| 242 | 240 | INLINE void eat_all_cpu_cycles(running_machine *machine) |
| 243 | 241 | { |
| 244 | | |
| 242 | const device_config *cpu | |
| 245 | 243 | |
| 246 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 247 | if (machine->cpu[cpunum] != NULL) | |
| 248 | cpu_eat_cycles(machine->cpu[cpunum], 1000000000); | |
| 244 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 245 | cpu_eat_cycles(cpu, 1000000000); | |
| 249 | 246 | } |
| 250 | 247 | |
| 251 | 248 | |
| r3957 | r3958 | |
| 301 | 298 | |
| 302 | 299 | /* create the machine structure and driver */ |
| 303 | 300 | machine = create_machine(driver); |
| 304 | prepare_machine(machine); | |
| 305 | 301 | mame = machine->mame_data; |
| 306 | 302 | |
| 307 | 303 | /* start in the "pre-init phase" */ |
| r3957 | r3958 | |
| 1148 | 1144 | |
| 1149 | 1145 | void CLIB_DECL fatalerror(const char *text, ...) |
| 1150 | 1146 | { |
| 1147 | extern running_machine *Machine; | |
| 1151 | 1148 | running_machine *machine = Machine; |
| 1152 | 1149 | va_list arg; |
| 1153 | 1150 | |
| r3957 | r3958 | |
| 1206 | 1203 | |
| 1207 | 1204 | void CLIB_DECL logerror(const char *format, ...) |
| 1208 | 1205 | { |
| 1206 | extern running_machine *Machine; | |
| 1209 | 1207 | running_machine *machine = Machine; |
| 1210 | 1208 | |
| 1211 | 1209 | /* currently, we need a machine to do this */ |
| r3957 | r3958 | |
| 1404 | 1402 | machine->basename = mame_strdup(driver->name); |
| 1405 | 1403 | machine->config = machine_config_alloc(driver->machine_config); |
| 1406 | 1404 | |
| 1407 | /* temporary: create fake CPU devices */ | |
| 1408 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1409 | if (machine->config->cpu[cpunum].type != CPU_DUMMY) | |
| 1410 | machine->cpu[cpunum] = cpuexec_create_cpu_device(&machine->config->cpu[cpunum]); | |
| 1411 | ||
| 1412 | 1405 | /* allocate the driver data */ |
| 1413 | 1406 | if (machine->config->driver_data_size != 0) |
| 1414 | 1407 | { |
| 1415 | 1408 | machine->driver_data = malloc(machine->config->driver_data_size); |
| 1416 | 1409 | if (machine->driver_data == NULL) |
| 1417 | 1410 | goto error; |
| 1411 | memset(machine->driver_data, 0, machine->config->driver_data_size); | |
| 1418 | 1412 | } |
| 1413 | ||
| 1414 | /* find devices */ | |
| 1415 | machine->cpu[0] = cpu_first(machine->config); | |
| 1416 | for (cpunum = 1; cpunum < ARRAY_LENGTH(machine->cpu) && machine->cpu[cpunum - 1] != NULL; cpunum++) | |
| 1417 | machine->cpu[cpunum] = machine->cpu[cpunum - 1]->typenext; | |
| 1418 | machine->primary_screen = video_screen_first(machine->config); | |
| 1419 | ||
| 1420 | /* attach this machine to all the devices in the configuration */ | |
| 1421 | device_list_attach_machine(machine); | |
| 1422 | ||
| 1423 | /* fetch core options */ | |
| 1424 | machine->sample_rate = options_get_int(mame_options(), OPTION_SAMPLERATE); | |
| 1425 | machine->debug_flags = options_get_bool(mame_options(), OPTION_DEBUG) ? (DEBUG_FLAG_ENABLED | DEBUG_FLAG_CALL_HOOK) : 0; | |
| 1426 | ||
| 1419 | 1427 | return machine; |
| 1420 | 1428 | |
| 1421 | 1429 | error: |
| r3957 | r3958 | |
| 1432 | 1440 | |
| 1433 | 1441 | |
| 1434 | 1442 | /*------------------------------------------------- |
| 1435 | prepare_machine - reset the state of the | |
| 1436 | machine object | |
| 1437 | -------------------------------------------------*/ | |
| 1438 | ||
| 1439 | static void prepare_machine(running_machine *machine) | |
| 1440 | { | |
| 1441 | /* reset most portions of the machine */ | |
| 1442 | ||
| 1443 | /* graphics layout */ | |
| 1444 | memset(machine->gfx, 0, sizeof(machine->gfx)); | |
| 1445 | ||
| 1446 | /* palette-related information */ | |
| 1447 | machine->pens = NULL; | |
| 1448 | machine->shadow_table = NULL; | |
| 1449 | ||
| 1450 | /* audio-related information */ | |
| 1451 | machine->sample_rate = options_get_int(mame_options(), OPTION_SAMPLERATE); | |
| 1452 | ||
| 1453 | /* input-related information */ | |
| 1454 | machine->portconfig = NULL; | |
| 1455 | ||
| 1456 | /* debugger-related information */ | |
| 1457 | machine->debug_flags = options_get_bool(mame_options(), OPTION_DEBUG) ? (DEBUG_FLAG_ENABLED | DEBUG_FLAG_CALL_HOOK) : 0; | |
| 1458 | ||
| 1459 | /* reset the global MAME data and clear the other privates */ | |
| 1460 | memset(machine->mame_data, 0, sizeof(*machine->mame_data)); | |
| 1461 | machine->palette_data = NULL; | |
| 1462 | machine->streams_data = NULL; | |
| 1463 | ||
| 1464 | /* reset the driver data */ | |
| 1465 | if (machine->config->driver_data_size != 0) | |
| 1466 | memset(machine->driver_data, 0, machine->config->driver_data_size); | |
| 1467 | } | |
| 1468 | ||
| 1469 | ||
| 1470 | ||
| 1471 | /*------------------------------------------------- | |
| 1472 | 1443 | destroy_machine - free the machine data |
| 1473 | 1444 | -------------------------------------------------*/ |
| 1474 | 1445 | |
| 1475 | 1446 | static void destroy_machine(running_machine *machine) |
| 1476 | 1447 | { |
| 1477 | int cpunum; | |
| 1478 | ||
| 1479 | 1448 | assert(machine == Machine); |
| 1480 | 1449 | |
| 1481 | /* temporary: free the fake CPU devices */ | |
| 1482 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1483 | if (machine->cpu[cpunum] != NULL) | |
| 1484 | free((void *)machine->cpu[cpunum]); | |
| 1485 | ||
| 1486 | 1450 | if (machine->driver_data != NULL) |
| 1487 | 1451 | free(machine->driver_data); |
| 1488 | 1452 | if (machine->config != NULL) |
| r3957 | r3958 | |
| 1507 | 1471 | time_t newbase; |
| 1508 | 1472 | |
| 1509 | 1473 | /* initialize basic can't-fail systems here */ |
| 1510 | cpuintrf_init(machine); | |
| 1511 | 1474 | sndintrf_init(machine); |
| 1512 | 1475 | fileio_init(machine); |
| 1513 | 1476 | config_init(machine); |
| r3957 | r3958 | |
| 1560 | 1523 | mess_predevice_init(machine); |
| 1561 | 1524 | #endif /* MESS */ |
| 1562 | 1525 | |
| 1526 | /* start up the devices */ | |
| 1527 | device_list_start(machine); | |
| 1528 | ||
| 1563 | 1529 | /* call the game driver's init function */ |
| 1564 | 1530 | /* this is where decryption is done and memory maps are altered */ |
| 1565 | 1531 | /* so this location in the init order is important */ |
| r3957 | r3958 | |
| 1567 | 1533 | if (machine->gamedrv->driver_init != NULL) |
| 1568 | 1534 | (*machine->gamedrv->driver_init)(machine); |
| 1569 | 1535 | |
| 1570 | /* start up the devices */ | |
| 1571 | device_list_start(machine); | |
| 1572 | ||
| 1573 | 1536 | #ifdef MESS |
| 1574 | 1537 | /* second MESS initialization */ |
| 1575 | 1538 | mess_postdevice_init(machine); |
| r3957 | r3958 | |
|---|---|---|
| 628 | 628 | buffer |
| 629 | 629 | -------------------------------------------------*/ |
| 630 | 630 | |
| 631 | INLINE void | |
| 631 | INLINE void | |
| 632 | 632 | { |
| 633 | 633 | int curlen = (errorbuf != NULL) ? strlen(errorbuf) : 0; |
| 634 | 634 | int bytesleft = errorbuflen - curlen; |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | a temporary string buffer |
| 51 | 51 | -------------------------------------------------*/ |
| 52 | 52 | |
| 53 | ||
| 53 | ||
| 54 | 54 | { |
| 55 | 55 | char *string = &temp_string_pool[temp_string_pool_index++ % TEMP_STRING_POOL_ENTRIES][0]; |
| 56 | 56 | string[0] = 0; |
| r3957 | r3958 | |
| 80 | 80 | end of a device list |
| 81 | 81 | -------------------------------------------------*/ |
| 82 | 82 | |
| 83 | device_config *device_list_add(device_config **listheadptr, device_type type, const char *tag) | |
| 83 | device_config *device_list_add(device_config **listheadptr, const device_config *owner, device_type type, const char *tag, UINT32 clock) | |
| 84 | 84 | { |
| 85 | device_config **devptr; | |
| 86 | device_config *device; | |
| 85 | device_config **devptr, **tempdevptr; | |
| 86 | device_config *device, *tempdevice; | |
| 87 | 87 | UINT32 configlen; |
| 88 | deviceinfo info; | |
| 89 | 88 | |
| 90 | 89 | assert(listheadptr != NULL); |
| 91 | 90 | assert(type != NULL); |
| r3957 | r3958 | |
| 94 | 93 | /* find the end of the list, and ensure no duplicates along the way */ |
| 95 | 94 | for (devptr = listheadptr; *devptr != NULL; devptr = &(*devptr)->next) |
| 96 | 95 | if (type == (*devptr)->type && strcmp(tag, (*devptr)->tag) == 0) |
| 97 | fatalerror("Attempted to add duplicate device: type=%s tag=%s\n", dev | |
| 96 | fatalerror("Attempted to add duplicate device: type=%s tag=%s\n", devic | |
| 98 | 97 | |
| 99 | 98 | /* get the size of the inline config */ |
| 100 | 99 | configlen = (UINT32)devtype_get_info_int(type, DEVINFO_INT_INLINE_CONFIG_BYTES); |
| r3957 | r3958 | |
| 102 | 101 | /* allocate a new device */ |
| 103 | 102 | device = malloc_or_die(sizeof(*device) + strlen(tag) + configlen); |
| 104 | 103 | |
| 105 | /* populate | |
| 104 | /* populate dev | |
| 106 | 105 | device->next = NULL; |
| 106 | device->owner = (device_config *)owner; | |
| 107 | device->typenext = NULL; | |
| 108 | device->classnext = NULL; | |
| 109 | ||
| 110 | /* populate device properties */ | |
| 107 | 111 | device->type = type; |
| 108 | 112 | device->class = devtype_get_info_int(type, DEVINFO_INT_CLASS); |
| 113 | device->set_info = (device_set_info_func)devtype_get_info_fct(type, DEVINFO_FCT_SET_INFO); | |
| 114 | device->execute = NULL; | |
| 115 | ||
| 116 | /* populate device configuration */ | |
| 117 | device->clock = clock; | |
| 109 | 118 | device->static_config = NULL; |
| 110 | 119 | device->inline_config = (configlen == 0) ? NULL : (device->tag + strlen(tag) + 1); |
| 120 | ||
| 121 | /* ensure live fields are all cleared */ | |
| 122 | device->machine = NULL; | |
| 111 | 123 | device->started = FALSE; |
| 112 | 124 | device->token = NULL; |
| 113 | device-> | |
| 125 | device->toke | |
| 114 | 126 | device->region = NULL; |
| 115 | 127 | device->regionbytes = 0; |
| 128 | ||
| 129 | /* append the tag */ | |
| 116 | 130 | strcpy(device->tag, tag); |
| 117 | 131 | |
| 118 | 132 | /* reset the inline_config to 0 */ |
| r3957 | r3958 | |
| 120 | 134 | memset(device->inline_config, 0, configlen); |
| 121 | 135 | |
| 122 | 136 | /* fetch function pointers to the core functions */ |
| 123 | info.set_info = NULL; | |
| 124 | (*type)(NULL, DEVINFO_FCT_SET_INFO, &info); | |
| 125 | device->set_info = info.set_info; | |
| 126 | 137 | |
| 127 | info.start = NULL; | |
| 128 | (*type)(NULL, DEVINFO_FCT_START, &info); | |
| 129 | device->start = info.start; | |
| 138 | /* before adding us to the global list, add us to the end of the type list */ | |
| 139 | tempdevice = (device_config *)device_list_first(*listheadptr, type); | |
| 140 | for (tempdevptr = &tempdevice; *tempdevptr != NULL; tempdevptr = &(*tempdevptr)->typenext) ; | |
| 141 | *tempdevptr = device; | |
| 130 | 142 | |
| 131 | info.stop = NULL; | |
| 132 | (*type)(NULL, DEVINFO_FCT_STOP, &info); | |
| 133 | device->stop = info.stop; | |
| 143 | /* and to the end of the class list */ | |
| 144 | tempdevice = (device_config *)device_list_class_first(*listheadptr, device->class); | |
| 145 | for (tempdevptr = &tempdevice; *tempdevptr != NULL; tempdevptr = &(*tempdevptr)->classnext) ; | |
| 146 | *tempdevptr = device; | |
| 134 | 147 | |
| 135 | info.reset = NULL; | |
| 136 | (*type)(NULL, DEVINFO_FCT_RESET, &info); | |
| 137 | device->reset = info.reset; | |
| 138 | ||
| 139 | info.nvram = NULL; | |
| 140 | (*type)(NULL, DEVINFO_FCT_NVRAM, &info); | |
| 141 | device->nvram = info.nvram; | |
| 142 | ||
| 143 | /* link us to the end and return */ | |
| 148 | /* link us to the end of the master list and return */ | |
| 144 | 149 | *devptr = device; |
| 145 | 150 | return device; |
| 146 | 151 | } |
| r3957 | r3958 | |
| 153 | 158 | |
| 154 | 159 | void device_list_remove(device_config **listheadptr, device_type type, const char *tag) |
| 155 | 160 | { |
| 156 | device_config **devptr; | |
| 157 | device_config *device; | |
| 161 | device_config **devptr, **tempdevptr; | |
| 162 | device_config *device, *tempdevice; | |
| 158 | 163 | |
| 159 | 164 | assert(listheadptr != NULL); |
| 160 | 165 | assert(type != NULL); |
| r3957 | r3958 | |
| 164 | 169 | for (devptr = listheadptr; *devptr != NULL; devptr = &(*devptr)->next) |
| 165 | 170 | if (type == (*devptr)->type && strcmp(tag, (*devptr)->tag) == 0) |
| 166 | 171 | break; |
| 167 | if (*devptr == NULL) | |
| 172 | device = *devptr; | |
| 173 | if (device == NULL) | |
| 168 | 174 | fatalerror("Attempted to remove non-existant device: type=%s tag=%s\n", devtype_get_name(type), tag); |
| 169 | 175 | |
| 176 | /* before removing us from the global list, remove us from the type list */ | |
| 177 | tempdevice = (device_config *)device_list_first(*listheadptr, type); | |
| 178 | for (tempdevptr = &tempdevice; *tempdevptr != device; tempdevptr = &(*tempdevptr)->typenext) ; | |
| 179 | assert(*tempdevptr == device); | |
| 180 | *tempdevptr = device->typenext; | |
| 181 | ||
| 182 | /* and from the class list */ | |
| 183 | tempdevice = (device_config *)device_list_class_first(*listheadptr, device->class); | |
| 184 | for (tempdevptr = &tempdevice; *tempdevptr != device; tempdevptr = &(*tempdevptr)->classnext) ; | |
| 185 | assert(*tempdevptr == device); | |
| 186 | *tempdevptr = device->classnext; | |
| 187 | ||
| 170 | 188 | /* remove the device from the list */ |
| 171 | device = *devptr; | |
| 172 | 189 | *devptr = device->next; |
| 173 | 190 | |
| 174 | 191 | /* free the device object */ |
| r3957 | r3958 | |
| 181 | 198 | the device's name and the given tag |
| 182 | 199 | -------------------------------------------------*/ |
| 183 | 200 | |
| 184 | const char *device_build_tag(astring *dest, const c | |
| 201 | const char *device_build_tag(astring *dest, const device_config *device | |
| 185 | 202 | { |
| 186 | if (device | |
| 203 | if (device | |
| 187 | 204 | { |
| 188 | astring_cpyc(dest, devicetag); | |
| 205 | astring_cpyc(dest, device->tag); | |
| 189 | 206 | astring_catc(dest, ":"); |
| 190 | 207 | astring_catc(dest, tag); |
| 191 | 208 | } |
| r3957 | r3958 | |
| 230 | 247 | const device_config *curdev; |
| 231 | 248 | int count = 0; |
| 232 | 249 | |
| 233 | assert(type != NULL); | |
| 234 | ||
| 235 | 250 | /* locate all devices */ |
| 236 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 237 | count += device_matches_type(curdev, type); | |
| 251 | if (type == DEVICE_TYPE_WILDCARD) | |
| 252 | { | |
| 253 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 254 | count++; | |
| 255 | } | |
| 238 | 256 | |
| 257 | /* locate all devices of a given type */ | |
| 258 | else | |
| 259 | { | |
| 260 | for (curdev = listhead; curdev != NULL && curdev->type != type; curdev = curdev->next) ; | |
| 261 | for ( ; curdev != NULL; curdev = curdev->typenext) | |
| 262 | count++; | |
| 263 | } | |
| 264 | ||
| 239 | 265 | return count; |
| 240 | 266 | } |
| 241 | 267 | |
| r3957 | r3958 | |
| 250 | 276 | { |
| 251 | 277 | const device_config *curdev; |
| 252 | 278 | |
| 253 | /* scan forward starting with the list head */ | |
| 254 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 255 | if (device_matches_type(curdev, type)) | |
| 256 | return curdev; | |
| 279 | /* first of any device type */ | |
| 280 | if (type == DEVICE_TYPE_WILDCARD) | |
| 281 | return listhead; | |
| 257 | 282 | |
| 258 | return NULL; | |
| 283 | /* first of a given type */ | |
| 284 | for (curdev = listhead; curdev != NULL && curdev->type != type; curdev = curdev->next) ; | |
| 285 | return curdev; | |
| 259 | 286 | } |
| 260 | 287 | |
| 261 | 288 | |
| r3957 | r3958 | |
| 267 | 294 | |
| 268 | 295 | const device_config *device_list_next(const device_config *prevdevice, device_type type) |
| 269 | 296 | { |
| 270 | const device_config *curdev; | |
| 271 | ||
| 272 | 297 | assert(prevdevice != NULL); |
| 273 | ||
| 274 | /* scan forward starting with the item after the previous one */ | |
| 275 | for (curdev = prevdevice->next; curdev != NULL; curdev = curdev->next) | |
| 276 | if (device_matches_type(curdev, type)) | |
| 277 | return curdev; | |
| 278 | ||
| 279 | return NULL; | |
| 298 | return (type == DEVICE_TYPE_WILDCARD) ? prevdevice->next : prevdevice->typenext; | |
| 280 | 299 | } |
| 281 | 300 | |
| 282 | 301 | |
| 283 | 302 | /*------------------------------------------------- |
| 284 | 303 | device_list_find_by_tag - retrieve a device |
| 285 | configuration based on a type and tag | |
| 304 | configuration based on a type and tag; | |
| 305 | DEVICE_TYPE_WILDCARD is allowed | |
| 286 | 306 | -------------------------------------------------*/ |
| 287 | 307 | |
| 288 | 308 | const device_config *device_list_find_by_tag(const device_config *listhead, device_type type, const char *tag) |
| r3957 | r3958 | |
| 291 | 311 | |
| 292 | 312 | assert(tag != NULL); |
| 293 | 313 | |
| 294 | /* find the device in the list */ | |
| 295 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 296 | if (device_matches_type(curdev, type) && strcmp(tag, curdev->tag) == 0) | |
| 297 | return curdev; | |
| 314 | /* locate among all devices */ | |
| 315 | if (type == DEVICE_TYPE_WILDCARD) | |
| 316 | { | |
| 317 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 318 | if (strcmp(tag, curdev->tag) == 0) | |
| 319 | return curdev; | |
| 320 | } | |
| 298 | 321 | |
| 322 | /* locate among all devices of a given type */ | |
| 323 | else | |
| 324 | { | |
| 325 | for (curdev = listhead; curdev != NULL && curdev->type != type; curdev = curdev->next) ; | |
| 326 | for ( ; curdev != NULL; curdev = curdev->typenext) | |
| 327 | if (strcmp(tag, curdev->tag) == 0) | |
| 328 | return curdev; | |
| 329 | } | |
| 330 | ||
| 299 | 331 | /* fail */ |
| 300 | 332 | return NULL; |
| 301 | 333 | } |
| r3957 | r3958 | |
| 312 | 344 | const device_config *curdev; |
| 313 | 345 | int index = 0; |
| 314 | 346 | |
| 315 | assert(type != NULL); | |
| 316 | 347 | assert(tag != NULL); |
| 317 | 348 | |
| 318 | /* locate all devices */ | |
| 319 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 320 | if (device_matches_type(curdev, type)) | |
| 349 | /* locate among all devices */ | |
| 350 | if (type == DEVICE_TYPE_WILDCARD) | |
| 351 | { | |
| 352 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 321 | 353 | { |
| 322 | 354 | if (strcmp(tag, curdev->tag) == 0) |
| 323 | 355 | return index; |
| 324 | 356 | index++; |
| 325 | 357 | } |
| 358 | } | |
| 326 | 359 | |
| 360 | /* locate among all devices of a given type */ | |
| 361 | else | |
| 362 | { | |
| 363 | for (curdev = listhead; curdev != NULL && curdev->type != type; curdev = curdev->next) ; | |
| 364 | for ( ; curdev != NULL; curdev = curdev->typenext) | |
| 365 | { | |
| 366 | if (strcmp(tag, curdev->tag) == 0) | |
| 367 | return index; | |
| 368 | index++; | |
| 369 | } | |
| 370 | } | |
| 371 | ||
| 327 | 372 | return -1; |
| 328 | 373 | } |
| 329 | 374 | |
| r3957 | r3958 | |
| 337 | 382 | { |
| 338 | 383 | const device_config *curdev; |
| 339 | 384 | |
| 340 | assert(type != NULL); | |
| 341 | assert(index >= 0); | |
| 385 | /* locate among all devices */ | |
| 386 | if (type == DEVICE_TYPE_WILDCARD) | |
| 387 | { | |
| 388 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 389 | if (index-- == 0) | |
| 390 | return curdev; | |
| 391 | } | |
| 342 | 392 | |
| 343 | /* find the device in the list */ | |
| 344 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 345 | if (device_matches_type(curdev, type) && index-- == 0) | |
| 346 | return curdev; | |
| 393 | /* locate among all devices of a given type */ | |
| 394 | else | |
| 395 | { | |
| 396 | for (curdev = listhead; curdev != NULL && curdev->type != type; curdev = curdev->next) ; | |
| 397 | for ( ; curdev != NULL; curdev = curdev->typenext) | |
| 398 | if (index-- == 0) | |
| 399 | return curdev; | |
| 400 | } | |
| 347 | 401 | |
| 348 | 402 | /* fail */ |
| 349 | 403 | return NULL; |
| r3957 | r3958 | |
| 365 | 419 | const device_config *curdev; |
| 366 | 420 | int count = 0; |
| 367 | 421 | |
| 368 | /* locate all devices */ | |
| 369 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 370 | count += (curdev->class == class); | |
| 422 | /* locate all devices of a given class */ | |
| 423 | for (curdev = listhead; curdev != NULL && curdev->class != class; curdev = curdev->next) ; | |
| 424 | for ( ; curdev != NULL; curdev = curdev->classnext) | |
| 425 | count++; | |
| 371 | 426 | |
| 372 | 427 | return count; |
| 373 | 428 | } |
| r3957 | r3958 | |
| 382 | 437 | { |
| 383 | 438 | const device_config *curdev; |
| 384 | 439 | |
| 385 | /* scan forward starting with the list head */ | |
| 386 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 387 | if (curdev->class == class) | |
| 388 | return curdev; | |
| 389 | ||
| 390 | return NULL; | |
| 440 | /* first of a given class */ | |
| 441 | for (curdev = listhead; curdev != NULL && curdev->class != class; curdev = curdev->next) ; | |
| 442 | return curdev; | |
| 391 | 443 | } |
| 392 | 444 | |
| 393 | 445 | |
| r3957 | r3958 | |
| 398 | 450 | |
| 399 | 451 | const device_config *device_list_class_next(const device_config *prevdevice, device_class class) |
| 400 | 452 | { |
| 401 | const device_config *curdev; | |
| 402 | ||
| 403 | 453 | assert(prevdevice != NULL); |
| 404 | ||
| 405 | /* scan forward starting with the item after the previous one */ | |
| 406 | for (curdev = prevdevice->next; curdev != NULL; curdev = curdev->next) | |
| 407 | if (curdev->class == class) | |
| 408 | return curdev; | |
| 409 | ||
| 410 | return NULL; | |
| 454 | return prevdevice->classnext; | |
| 411 | 455 | } |
| 412 | 456 | |
| 413 | 457 | |
| r3957 | r3958 | |
| 422 | 466 | |
| 423 | 467 | assert(tag != NULL); |
| 424 | 468 | |
| 425 | /* find the device in the list */ | |
| 426 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 427 | if (curdev->class == class && strcmp(tag, curdev->tag) == 0) | |
| 469 | /* locate among all devices of a given class */ | |
| 470 | for (curdev = listhead; curdev != NULL && curdev->class != class; curdev = curdev->next) ; | |
| 471 | for ( ; curdev != NULL; curdev = curdev->classnext) | |
| 472 | if (strcmp(tag, curdev->tag) == 0) | |
| 428 | 473 | return curdev; |
| 429 | 474 | |
| 430 | 475 | /* fail */ |
| r3957 | r3958 | |
| 444 | 489 | |
| 445 | 490 | assert(tag != NULL); |
| 446 | 491 | |
| 447 | /* locate all devices */ | |
| 448 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 449 | if (curdev->class == class) | |
| 450 | { | |
| 451 | if (strcmp(tag, curdev->tag) == 0) | |
| 452 | return index; | |
| 453 | index++; | |
| 454 | } | |
| 492 | /* locate among all devices of a given class */ | |
| 493 | for (curdev = listhead; curdev != NULL && curdev->class != class; curdev = curdev->next) ; | |
| 494 | for ( ; curdev != NULL; curdev = curdev->classnext) | |
| 495 | { | |
| 496 | if (strcmp(tag, curdev->tag) == 0) | |
| 497 | return index; | |
| 498 | index++; | |
| 499 | } | |
| 455 | 500 | |
| 456 | 501 | return -1; |
| 457 | 502 | } |
| r3957 | r3958 | |
| 467 | 512 | { |
| 468 | 513 | const device_config *curdev; |
| 469 | 514 | |
| 470 | assert(index >= 0); | |
| 471 | ||
| 472 | /* find the device in the list */ | |
| 473 | for (curdev = listhead; curdev != NULL; curdev = curdev->next) | |
| 474 | if (curdev->class == class && index-- == 0) | |
| 515 | /* locate among all devices of a given class */ | |
| 516 | for (curdev = listhead; curdev != NULL && curdev->class != class; curdev = curdev->next) ; | |
| 517 | for ( ; curdev != NULL; curdev = curdev->classnext) | |
| 518 | if (index-- == 0) | |
| 475 | 519 | return curdev; |
| 476 | 520 | |
| 477 | 521 | /* fail */ |
| r3957 | r3958 | |
| 485 | 529 | ***************************************************************************/ |
| 486 | 530 | |
| 487 | 531 | /*------------------------------------------------- |
| 532 | device_list_attach_machine - "attach" a | |
| 533 | running_machine to its list of devices | |
| 534 | -------------------------------------------------*/ | |
| 535 | ||
| 536 | void device_list_attach_machine(running_machine *machine) | |
| 537 | { | |
| 538 | device_config *device; | |
| 539 | ||
| 540 | assert(machine != NULL); | |
| 541 | ||
| 542 | /* iterate over devices and assign the machine to them */ | |
| 543 | for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next) | |
| 544 | device->machine = machine; | |
| 545 | } | |
| 546 | ||
| 547 | ||
| 548 | /*------------------------------------------------- | |
| 488 | 549 | device_list_start - start the configured list |
| 489 | 550 | of devices for a machine |
| 490 | 551 | -------------------------------------------------*/ |
| r3957 | r3958 | |
| 504 | 565 | /* iterate over devices and allocate memory for them */ |
| 505 | 566 | for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next) |
| 506 | 567 | { |
| 507 | UINT32 tokenlen; | |
| 508 | ||
| 509 | 568 | assert(!device->started); |
| 569 | assert(device->machine == machine); | |
| 510 | 570 | assert(device->token == NULL); |
| 511 | 571 | assert(device->type != NULL); |
| 512 | assert(device->start != NULL); | |
| 513 | 572 | |
| 514 | 573 | devcount++; |
| 515 | 574 | |
| 516 | /* get the size of the token data */ | |
| 517 | tokenlen = (UINT32)devtype_get_info_int(device->type, DEVINFO_INT_TOKEN_BYTES); | |
| 518 | if (tokenlen == 0) | |
| 519 | fatalerror("Device %s specifies a 0 token length!\n", devtype_get_name(device->type)); | |
| 575 | /* get the size of the token data; we do it directly because we can't call device_get_info_* with no token */ | |
| 576 | device->tokenbytes = device_get_info_int(device, DEVINFO_INT_TOKEN_BYTES); | |
| 577 | if (device->tokenbytes == 0) | |
| 578 | fatalerror("Device %s specifies a 0 token length!\n", device_get_name(device)); | |
| 520 | 579 | |
| 521 | 580 | /* allocate memory for the token */ |
| 522 | device->token = malloc_or_die(tokenlen); | |
| 523 | memset(device->token, 0, tokenlen); | |
| 581 | device->token = malloc_or_die(device->tokenbytes); | |
| 582 | memset(device->token, 0, device->tokenbytes); | |
| 524 | 583 | |
| 525 | 584 | /* fill in the remaining runtime fields */ |
| 585 | device->execute = (device_execute_func)device_get_info_fct(device, DEVINFO_FCT_EXECUTE); | |
| 526 | 586 | device->machine = machine; |
| 527 | 587 | device->region = memory_region(machine, device->tag); |
| 528 | 588 | device->regionbytes = memory_region_length(machine, device->tag); |
| r3957 | r3958 | |
| 537 | 597 | /* iterate over devices and start them */ |
| 538 | 598 | for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next) |
| 539 | 599 | { |
| 540 | if (!device->started && (*device->start)(device) == DEVICE_START_OK) | |
| 600 | device_start_func start = (device_start_func)device_get_info_fct(device, DEVINFO_FCT_START); | |
| 601 | ||
| 602 | assert(start != NULL); | |
| 603 | if (!device->started && (*start)(device) == DEVICE_START_OK) | |
| 541 | 604 | device->started = TRUE; |
| 542 | 605 | numstarted += device->started; |
| 543 | 606 | } |
| r3957 | r3958 | |
| 563 | 626 | /* iterate over devices and stop them */ |
| 564 | 627 | for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next) |
| 565 | 628 | { |
| 629 | device_stop_func stop = (device_stop_func)device_get_info_fct(device, DEVINFO_FCT_STOP); | |
| 630 | ||
| 566 | 631 | assert(device->token != NULL); |
| 567 | 632 | assert(device->type != NULL); |
| 568 | 633 | |
| 569 | 634 | /* if we have a stop function, call it */ |
| 570 | if (device->stop != NULL) | |
| 571 | (*device->stop)(device); | |
| 635 | if (stop != NULL) | |
| 636 | (*stop)(device); | |
| 572 | 637 | |
| 573 | 638 | /* free allocated memory for the token */ |
| 574 | 639 | if (device->token != NULL) |
| r3957 | r3958 | |
| 576 | 641 | |
| 577 | 642 | /* reset all runtime fields */ |
| 578 | 643 | device->token = NULL; |
| 644 | device->tokenbytes = 0; | |
| 579 | 645 | device->machine = NULL; |
| 580 | 646 | device->region = NULL; |
| 581 | 647 | device->regionbytes = 0; |
| r3957 | r3958 | |
| 607 | 673 | |
| 608 | 674 | void device_reset(const device_config *device) |
| 609 | 675 | { |
| 676 | device_reset_func reset; | |
| 677 | ||
| 610 | 678 | assert(device != NULL); |
| 611 | 679 | assert(device->token != NULL); |
| 612 | 680 | assert(device->type != NULL); |
| 613 | 681 | |
| 614 | 682 | /* if we have a reset function, call it */ |
| 615 | if (device->reset != NULL) | |
| 616 | (*device->reset)(device); | |
| 683 | reset = (device_reset_func)device_get_info_fct(device, DEVINFO_FCT_RESET); | |
| 684 | if (reset != NULL) | |
| 685 | (*reset)(device); | |
| 617 | 686 | } |
| 618 | 687 | |
| 619 | 688 | |
| 620 | void devtag_reset(running_machine *machine, device_type type, const char *tag) | |
| 689 | /*------------------------------------------------- | |
| 690 | device_set_clock - change the clock on a | |
| 691 | device | |
| 692 | -------------------------------------------------*/ | |
| 693 | ||
| 694 | void device_set_clock(const device_config *device, UINT32 clock) | |
| 621 | 695 | { |
| 622 | con | |
| 696 | device_config *devicerw = (device_config *)device; | |
| 623 | 697 | |
| 624 | assert(machine != NULL); | |
| 625 | assert(type != NULL); | |
| 626 | assert(tag != NULL); | |
| 627 | ||
| 628 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 629 | if (device == NULL) | |
| 630 | fatalerror("devtag_reset failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 631 | device_reset(device); | |
| 698 | /* not much for now */ | |
| 699 | devicerw->clock = clock; | |
| 632 | 700 | } |
| 633 | 701 | |
| 634 | 702 | |
| r3957 | r3958 | |
| 638 | 706 | ***************************************************************************/ |
| 639 | 707 | |
| 640 | 708 | /*------------------------------------------------- |
| 641 | devtag_get_token - return the token associated | |
| 642 | with an allocated device | |
| 643 | -------------------------------------------------*/ | |
| 644 | ||
| 645 | void *devtag_get_token(running_machine *machine, device_type type, const char *tag) | |
| 646 | { | |
| 647 | const device_config *device; | |
| 648 | ||
| 649 | assert(machine != NULL); | |
| 650 | assert(type != NULL); | |
| 651 | assert(tag != NULL); | |
| 652 | ||
| 653 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 654 | if (device == NULL) | |
| 655 | fatalerror("devtag_get_token failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 656 | return device->token; | |
| 657 | } | |
| 658 | ||
| 659 | ||
| 660 | /*------------------------------------------------- | |
| 661 | devtag_get_device - return the device associated | |
| 662 | with a tag | |
| 663 | -------------------------------------------------*/ | |
| 664 | ||
| 665 | const device_config *devtag_get_device(running_machine *machine, device_type type, const char *tag) | |
| 666 | { | |
| 667 | const device_config *device; | |
| 668 | ||
| 669 | assert(machine != NULL); | |
| 670 | assert(type != NULL); | |
| 671 | assert(tag != NULL); | |
| 672 | ||
| 673 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 674 | if (device == NULL) | |
| 675 | fatalerror("devtag_get_device failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 676 | return device; | |
| 677 | } | |
| 678 | ||
| 679 | ||
| 680 | /*------------------------------------------------- | |
| 681 | devtag_get_static_config - return a pointer to | |
| 682 | the static configuration for a device based on | |
| 683 | type and tag | |
| 684 | -------------------------------------------------*/ | |
| 685 | ||
| 686 | const void *devtag_get_static_config(running_machine *machine, device_type type, const char *tag) | |
| 687 | { | |
| 688 | const device_config *device; | |
| 689 | ||
| 690 | assert(machine != NULL); | |
| 691 | assert(type != NULL); | |
| 692 | assert(tag != NULL); | |
| 693 | ||
| 694 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 695 | if (device == NULL) | |
| 696 | fatalerror("devtag_get_static_config failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 697 | return device->static_config; | |
| 698 | } | |
| 699 | ||
| 700 | ||
| 701 | /*------------------------------------------------- | |
| 702 | devtag_get_inline_config - return a pointer to | |
| 703 | the inline configuration for a device based on | |
| 704 | type and tag | |
| 705 | -------------------------------------------------*/ | |
| 706 | ||
| 707 | const void *devtag_get_inline_config(running_machine *machine, device_type type, const char *tag) | |
| 708 | { | |
| 709 | const device_config *device; | |
| 710 | ||
| 711 | assert(machine != NULL); | |
| 712 | assert(type != NULL); | |
| 713 | assert(tag != NULL); | |
| 714 | ||
| 715 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 716 | if (device == NULL) | |
| 717 | fatalerror("devtag_get_inline_config failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 718 | return device->inline_config; | |
| 719 | } | |
| 720 | ||
| 721 | ||
| 722 | /*------------------------------------------------- | |
| 723 | 709 | device_get_info_int - return an integer state |
| 724 | 710 | value from an allocated device |
| 725 | 711 | -------------------------------------------------*/ |
| r3957 | r3958 | |
| 729 | 715 | deviceinfo info; |
| 730 | 716 | |
| 731 | 717 | assert(device != NULL); |
| 732 | assert(device->token != NULL); | |
| 733 | 718 | assert(device->type != NULL); |
| 734 | 719 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); |
| 735 | 720 | |
| r3957 | r3958 | |
| 740 | 725 | } |
| 741 | 726 | |
| 742 | 727 | |
| 743 | INT64 devtag_get_info_int(running_machine *machine, device_type type, const char *tag, UINT32 state) | |
| 744 | { | |
| 745 | const device_config *device; | |
| 746 | ||
| 747 | assert(machine != NULL); | |
| 748 | assert(type != NULL); | |
| 749 | assert(tag != NULL); | |
| 750 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); | |
| 751 | ||
| 752 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 753 | if (device == NULL) | |
| 754 | fatalerror("devtag_get_info_int failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 755 | return device_get_info_int(device, state); | |
| 756 | } | |
| 757 | ||
| 758 | ||
| 759 | 728 | /*------------------------------------------------- |
| 760 | 729 | device_get_info_ptr - return a pointer state |
| 761 | 730 | value from an allocated device |
| r3957 | r3958 | |
| 776 | 745 | } |
| 777 | 746 | |
| 778 | 747 | |
| 779 | void *devtag_get_info_ptr(running_machine *machine, device_type type, const char *tag, UINT32 state) | |
| 780 | { | |
| 781 | const device_config *device; | |
| 782 | ||
| 783 | assert(machine != NULL); | |
| 784 | assert(type != NULL); | |
| 785 | assert(tag != NULL); | |
| 786 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); | |
| 787 | ||
| 788 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 789 | if (device == NULL) | |
| 790 | fatalerror("devtag_get_info_ptr failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 791 | return device_get_info_ptr(device, state); | |
| 792 | } | |
| 793 | ||
| 794 | ||
| 795 | 748 | /*------------------------------------------------- |
| 796 | 749 | device_get_info_fct - return a function |
| 797 | 750 | pointer state value from an allocated device |
| r3957 | r3958 | |
| 812 | 765 | } |
| 813 | 766 | |
| 814 | 767 | |
| 815 | genf *devtag_get_info_fct(running_machine *machine, device_type type, const char *tag, UINT32 state) | |
| 816 | { | |
| 817 | const device_config *device; | |
| 818 | ||
| 819 | assert(machine != NULL); | |
| 820 | assert(type != NULL); | |
| 821 | assert(tag != NULL); | |
| 822 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); | |
| 823 | ||
| 824 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 825 | if (device == NULL) | |
| 826 | fatalerror("device_get_info_fct failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 827 | return device_get_info_fct(device, state); | |
| 828 | } | |
| 829 | ||
| 830 | ||
| 831 | 768 | /*------------------------------------------------- |
| 832 | 769 | device_get_info_string - return a string value |
| 833 | 770 | from an allocated device |
| r3957 | r3958 | |
| 848 | 785 | } |
| 849 | 786 | |
| 850 | 787 | |
| 851 | const char *devtag_get_info_string(running_machine *machine, device_type type, const char *tag, UINT32 state) | |
| 852 | { | |
| 853 | const device_config *device; | |
| 854 | 788 | |
| 855 | assert(machine != NULL); | |
| 856 | assert(type != NULL); | |
| 857 | assert(tag != NULL); | |
| 858 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); | |
| 859 | ||
| 860 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 861 | if (device == NULL) | |
| 862 | fatalerror("device_get_info_string failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 863 | return device_get_info_string(device, state); | |
| 864 | } | |
| 865 | ||
| 866 | ||
| 867 | ||
| 868 | 789 | /*************************************************************************** |
| 869 | 790 | DEVICE TYPE INFORMATION SETTERS |
| 870 | 791 | ***************************************************************************/ |
| r3957 | r3958 | |
| 890 | 811 | |
| 891 | 812 | |
| 892 | 813 | /*------------------------------------------------- |
| 814 | devtype_get_info_int - return a function | |
| 815 | pointer from a device type (does not need to | |
| 816 | be allocated) | |
| 817 | -------------------------------------------------*/ | |
| 818 | ||
| 819 | genf *devtype_get_info_fct(device_type type, UINT32 state) | |
| 820 | { | |
| 821 | deviceinfo info; | |
| 822 | ||
| 823 | assert(type != NULL); | |
| 824 | assert(state >= DEVINFO_FCT_FIRST && state <= DEVINFO_FCT_LAST); | |
| 825 | ||
| 826 | /* retrieve the value */ | |
| 827 | info.f = 0; | |
| 828 | (*type)(NULL, state, &info); | |
| 829 | return info.f; | |
| 830 | } | |
| 831 | ||
| 832 | ||
| 833 | /*------------------------------------------------- | |
| 893 | 834 | devtype_get_info_string - return a string value |
| 894 | 835 | from a device type (does not need to be |
| 895 | 836 | allocated) |
| r3957 | r3958 | |
| 934 | 875 | } |
| 935 | 876 | |
| 936 | 877 | |
| 937 | void devtag_set_info_int(running_machine *machine, device_type type, const char *tag, UINT32 state, INT64 data) | |
| 938 | { | |
| 939 | const device_config *device; | |
| 940 | ||
| 941 | assert(machine != NULL); | |
| 942 | assert(type != NULL); | |
| 943 | assert(tag != NULL); | |
| 944 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); | |
| 945 | ||
| 946 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 947 | if (device == NULL) | |
| 948 | fatalerror("devtag_set_info_int failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 949 | device_set_info_int(device, state, data); | |
| 950 | } | |
| 951 | ||
| 952 | ||
| 953 | 878 | /*------------------------------------------------- |
| 954 | 879 | device_set_info_ptr - set a pointer state |
| 955 | 880 | value for an allocated device |
| r3957 | r3958 | |
| 970 | 895 | } |
| 971 | 896 | |
| 972 | 897 | |
| 973 | void devtag_set_info_ptr(running_machine *machine, device_type type, const char *tag, UINT32 state, void *data) | |
| 974 | { | |
| 975 | const device_config *device; | |
| 976 | ||
| 977 | assert(machine != NULL); | |
| 978 | assert(type != NULL); | |
| 979 | assert(tag != NULL); | |
| 980 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); | |
| 981 | ||
| 982 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 983 | if (device == NULL) | |
| 984 | fatalerror("devtag_set_info_ptr failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 985 | device_set_info_ptr(device, state, data); | |
| 986 | } | |
| 987 | ||
| 988 | ||
| 989 | 898 | /*------------------------------------------------- |
| 990 | 899 | device_set_info_fct - set a function pointer |
| 991 | 900 | state value for an allocated device |
| r3957 | r3958 | |
| 1004 | 913 | info.f = data; |
| 1005 | 914 | (*device->set_info)(device, state, &info); |
| 1006 | 915 | } |
| 1007 | ||
| 1008 | ||
| 1009 | void devtag_set_info_fct(running_machine *machine, device_type type, const char *tag, UINT32 state, genf *data) | |
| 1010 | { | |
| 1011 | const device_config *device; | |
| 1012 | ||
| 1013 | assert(machine != NULL); | |
| 1014 | assert(type != NULL); | |
| 1015 | assert(tag != NULL); | |
| 1016 | assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); | |
| 1017 | ||
| 1018 | device = device_list_find_by_tag(machine->config->devicelist, type, tag); | |
| 1019 | if (device == NULL) | |
| 1020 | fatalerror("devtag_set_info_fct failed to find device: type=%s tag=%s\n", devtype_get_name(type), tag); | |
| 1021 | device_set_info_fct(device, state, data); | |
| 1022 | } |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | extern int rtc65271_file_load(running_machine *machine, mame_file *file); |
| 6 | 6 | extern int rtc65271_file_save(mame_file *file); |
| 7 | extern void rtc65271_init(running_machine *machine, UINT8 *xram, void (*interrupt_callback)(int state)); | |
| 7 | extern void rtc65271_init(running_machine *machine, UINT8 *xram, void (*interrupt_callback)(running_machine *machine, int state)); | |
| 8 | 8 | extern UINT8 rtc65271_r(int xramsel, offs_t offset); |
| 9 | 9 | extern void rtc65271_w(int xramsel, offs_t offset, UINT8 data); |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | #include "driver.h" |
| 7 | #include "deprecat.h" | |
| 8 | 7 | #include "cr589.h" |
| 9 | 8 | |
| 10 | 9 | typedef struct |
| r3957 | r3958 | |
| 111 | 110 | |
| 112 | 111 | static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) |
| 113 | 112 | { |
| 114 | running_machine *machine = | |
| 113 | running_machine *machine = scsiInstance->machine; | |
| 115 | 114 | SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance ); |
| 116 | 115 | |
| 117 | 116 | our_this->download = 0; |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | #include "machine/x76f100.h" |
| 15 | 14 | |
| 16 | 15 | #define VERBOSE_LEVEL ( 0 ) |
| r3957 | r3958 | |
| 127 | 126 | state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->data, SIZE_DATA ); |
| 128 | 127 | } |
| 129 | 128 | |
| 130 | void x76f100_cs_write( int chip, int cs ) | |
| 129 | void x76f100_cs_write( running_machine *machine, int chip, int cs ) | |
| 131 | 130 | { |
| 132 | running_machine *machine = Machine; | |
| 133 | 131 | struct x76f100_chip *c; |
| 134 | 132 | |
| 135 | 133 | if( chip >= X76F100_MAXCHIP ) |
| r3957 | r3958 | |
| 159 | 157 | c->cs = cs; |
| 160 | 158 | } |
| 161 | 159 | |
| 162 | void x76f100_rst_write( int chip, int rst ) | |
| 160 | void x76f100_rst_write( running_machine *machine, int chip, int rst ) | |
| 163 | 161 | { |
| 164 | running_machine *machine = Machine; | |
| 165 | 162 | struct x76f100_chip *c; |
| 166 | 163 | |
| 167 | 164 | if( chip >= X76F100_MAXCHIP ) |
| r3957 | r3958 | |
| 219 | 216 | return ( block_offset * SIZE_WRITE_BUFFER ) + c->byte; |
| 220 | 217 | } |
| 221 | 218 | |
| 222 | void x76f100_scl_write( int chip, int scl ) | |
| 219 | void x76f100_scl_write( running_machine *machine, int chip, int scl ) | |
| 223 | 220 | { |
| 224 | running_machine *machine = Machine; | |
| 225 | 221 | struct x76f100_chip *c; |
| 226 | 222 | |
| 227 | 223 | if( chip >= X76F100_MAXCHIP ) |
| r3957 | r3958 | |
| 385 | 381 | c->scl = scl; |
| 386 | 382 | } |
| 387 | 383 | |
| 388 | void x76f100_sda_write( int chip, int sda ) | |
| 384 | void x76f100_sda_write( running_machine *machine, int chip, int sda ) | |
| 389 | 385 | { |
| 390 | running_machine *machine = Machine; | |
| 391 | 386 | struct x76f100_chip *c; |
| 392 | 387 | |
| 393 | 388 | if( chip >= X76F100_MAXCHIP ) |
| r3957 | r3958 | |
| 444 | 439 | c->sdaw = sda; |
| 445 | 440 | } |
| 446 | 441 | |
| 447 | int x76f100_sda_read( int chip ) | |
| 442 | int x76f100_sda_read( running_machine *machine, int chip ) | |
| 448 | 443 | { |
| 449 | running_machine *machine = Machine; | |
| 450 | 444 | struct x76f100_chip *c; |
| 451 | 445 | |
| 452 | 446 | if( chip >= X76F100_MAXCHIP ) |
| r3957 | r3958 | |
| 466 | 460 | return c->sdar; |
| 467 | 461 | } |
| 468 | 462 | |
| 469 | static void nvram_handler_x76f100( | |
| 463 | static void nvram_handler_x76f100( | |
| 470 | 464 | { |
| 471 | 465 | struct x76f100_chip *c; |
| 472 | 466 | |
| r3957 | r3958 | |
| 492 | 486 | } |
| 493 | 487 | } |
| 494 | 488 | |
| 495 | NVRAM_HANDLER( x76f100_0 ) { nvram_handler_x76f100( 0, machine, file, read_or_write ); } | |
| 496 | NVRAM_HANDLER( x76f100_1 ) { nvram_handler_x76f100( 1, machine, file, read_or_write ); } | |
| 489 | NVRAM_HANDLER( x76f100_0 ) { nvram_handler_x76f100( machine, file, read_or_write, 0 ); } | |
| 490 | NVRAM_HANDLER( x76f100_1 ) { nvram_handler_x76f100( machine, file, read_or_write, 1 ); } |
| r3957 | r3958 | |
|---|---|---|
| 285 | 285 | static DEVICE_START(timekeeper) |
| 286 | 286 | { |
| 287 | 287 | timekeeper_state *c = get_safe_token(device); |
| 288 | const timekeeper_config *config; | |
| 289 | 288 | emu_timer *timer; |
| 290 | 289 | attotime duration; |
| 291 | 290 | mame_system_time systime; |
| r3957 | r3958 | |
| 311 | 310 | c->century = make_bcd( systime.local_time.year / 100 ); |
| 312 | 311 | c->data = auto_malloc( c->size ); |
| 313 | 312 | |
| 314 | config = device->static_config; | |
| 315 | if( config != NULL && config->data != NULL ) | |
| 313 | c->default_data = device->region; | |
| 314 | if (c->default_data != NULL) | |
| 316 | 315 | { |
| 317 | c->default_data = memory_region( device->machine, config->data ); | |
| 318 | if( c->default_data != NULL ) | |
| 319 | { | |
| 320 | assert( memory_region_length( device->machine, config->data ) == c->size ); | |
| 321 | } | |
| 316 | assert( device->regionbytes == c->size ); | |
| 322 | 317 | } |
| 323 | 318 | |
| 324 | 319 | state_save_register_device_item( device, 0, c->control ); |
| r3957 | r3958 | |
| 486 | 481 | case DEVINFO_FCT_NVRAM: info->nvram = DEVICE_NVRAM_NAME(timekeeper); break; |
| 487 | 482 | |
| 488 | 483 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 489 | case DEVINFO_STR_NAME: info->s = "Timekeeper"; break; | |
| 490 | case DEVINFO_STR_FAMILY: info->s = "EEPROM"; break; | |
| 491 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 492 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 493 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 484 | case DEVINFO_STR_NAME: strcpy(info->s, "Timekeeper"); break; | |
| 485 | case DEVINFO_STR_FAMILY: strcpy(info->s, "EEPROM"); break; | |
| 486 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 487 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 488 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 494 | 489 | } |
| 495 | 490 | } |
| 496 | 491 | |
| r3957 | r3958 | |
| 499 | 494 | switch (state) |
| 500 | 495 | { |
| 501 | 496 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 502 | case DEVINFO_STR_NAME: info->s | |
| 497 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 503 | 498 | |
| 504 | 499 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 505 | 500 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(m48t02); break; |
| 506 | 501 | |
| 507 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 502 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 508 | 503 | } |
| 509 | 504 | } |
| 510 | 505 | |
| r3957 | r3958 | |
| 513 | 508 | switch (state) |
| 514 | 509 | { |
| 515 | 510 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 516 | case DEVINFO_STR_NAME: info->s | |
| 511 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 517 | 512 | |
| 518 | 513 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 519 | 514 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(m48t35); break; |
| 520 | 515 | |
| 521 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 516 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 522 | 517 | } |
| 523 | 518 | } |
| 524 | 519 | |
| r3957 | r3958 | |
| 527 | 522 | switch (state) |
| 528 | 523 | { |
| 529 | 524 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 530 | case DEVINFO_STR_NAME: info->s | |
| 525 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 531 | 526 | |
| 532 | 527 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 533 | 528 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(m48t58); break; |
| 534 | 529 | |
| 535 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 530 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 536 | 531 | } |
| 537 | 532 | } |
| 538 | 533 | |
| r3957 | r3958 | |
| 541 | 536 | switch (state) |
| 542 | 537 | { |
| 543 | 538 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 544 | case DEVINFO_STR_NAME: info->s | |
| 539 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 545 | 540 | |
| 546 | 541 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 547 | 542 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mk48t08); break; |
| 548 | 543 | |
| 549 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 544 | default: DEVICE_GET_INFO_CALL(timekeeper); | |
| 550 | 545 | } |
| 551 | 546 | } |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | #ifdef MESS |
| 12 | 12 | #include "devices/harddriv.h" |
| 13 | 13 | #endif |
| 14 | #include "deprecat.h" | |
| 15 | 14 | #include "scsihd.h" |
| 16 | 15 | |
| 17 | 16 | typedef struct |
| r3957 | r3958 | |
| 225 | 224 | |
| 226 | 225 | static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) |
| 227 | 226 | { |
| 228 | running_machine *machine = | |
| 227 | running_machine *machine = scsiInstance->machine; | |
| 229 | 228 | SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); |
| 230 | 229 | |
| 231 | 230 | our_this->lba = 0; |
| r3957 | r3958 | |
| 236 | 235 | |
| 237 | 236 | #ifdef MESS |
| 238 | 237 | /* TODO: get rid of this ifdef MESS section */ |
| 239 | our_this->disk = mess_hd_get_hard_disk_file( device_list_find_by_tag( | |
| 238 | our_this->disk = mess_hd_get_hard_disk_file( device_list_find_by_tag( machine->config->devicelist, HARDDISK, diskregion ) ); | |
| 240 | 239 | #else |
| 241 | 240 | our_this->disk = hard_disk_open(get_disk_handle( diskregion )); |
| 242 | 241 |
| r3957 | r3958 | |
|---|---|---|
| 67 | 67 | { |
| 68 | 68 | const device_config *device; |
| 69 | 69 | void (*irq_func)(const device_config *device, int state); |
| 70 | int clock; | |
| 71 | 70 | |
| 72 | 71 | cia_port port[2]; |
| 73 | 72 | cia_timer timer[2]; |
| r3957 | r3958 | |
| 141 | 140 | /* clear out CIA structure, and copy the interface */ |
| 142 | 141 | memset(cia, 0, sizeof(*cia)); |
| 143 | 142 | cia->device = device; |
| 144 | cia->clock = (intf->clock != 0) ? intf->clock : cpu_get_clock(device->machine->cpu[0]); | |
| 145 | 143 | cia->irq_func = intf->irq_func; |
| 146 | 144 | |
| 147 | 145 | /* setup ports */ |
| r3957 | r3958 | |
| 309 | 307 | /* update the timer count, if necessary */ |
| 310 | 308 | if ((new_count == -1) && is_timer_active(timer->timer)) |
| 311 | 309 | { |
| 312 | UINT16 current_count = attotime_to_double(attotime_mul(timer_timeelapsed(timer->timer), timer->cia->clock)); | |
| 310 | UINT16 current_count = attotime_to_double(attotime_mul(timer_timeelapsed(timer->timer), timer->cia->device->clock)); | |
| 313 | 311 | timer->count = timer->count - MIN(timer->count, current_count); |
| 314 | 312 | } |
| 315 | 313 | |
| r3957 | r3958 | |
| 321 | 319 | if ((timer->mode & 0x01) && ((timer->mode & (which ? 0x60 : 0x20)) == 0x00)) |
| 322 | 320 | { |
| 323 | 321 | /* timer is on and is connected to clock */ |
| 324 | attotime period = attotime_mul(ATTOTIME_IN_HZ(timer->cia->clock), (timer->count ? timer->count : 0x10000)); | |
| 322 | attotime period = attotime_mul(ATTOTIME_IN_HZ(timer->cia->device->clock), (timer->count ? timer->count : 0x10000)); | |
| 325 | 323 | timer_adjust_oneshot(timer->timer, period, 0); |
| 326 | 324 | } |
| 327 | 325 | else |
| r3957 | r3958 | |
| 856 | 854 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cia); break; |
| 857 | 855 | |
| 858 | 856 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 859 | case DEVINFO_STR_NAME: info->s = "6526 CIA rev1"; break; | |
| 860 | case DEVINFO_STR_FAMILY: info->s = "6526 CIA"; break; | |
| 861 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 862 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 857 | case DEVINFO_STR_NAME: strcpy(info->s, "6526 CIA rev1"); break; | |
| 858 | case DEVINFO_STR_FAMILY: strcpy(info->s, "6526 CIA"); break; | |
| 859 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 860 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 863 | 861 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 864 | 862 | } |
| 865 | 863 | } |
| r3957 | r3958 | |
| 874 | 872 | switch (state) |
| 875 | 873 | { |
| 876 | 874 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 877 | case DEVINFO_STR_NAME: info->s | |
| 875 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 878 | 876 | default: DEVICE_GET_INFO_CALL(cia6526r1); break; |
| 879 | 877 | } |
| 880 | 878 | } |
| r3957 | r3958 | |
| 889 | 887 | switch (state) |
| 890 | 888 | { |
| 891 | 889 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 892 | case DEVINFO_STR_NAME: info->s | |
| 890 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 893 | 891 | default: DEVICE_GET_INFO_CALL(cia6526r1); break; |
| 894 | 892 | } |
| 895 | 893 | } |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | #define X76F100_MAXCHIP ( 2 ) |
| 11 | 11 | |
| 12 | 12 | extern void x76f100_init( running_machine *machine, int chip, UINT8 *data ); |
| 13 | extern void x76f100_cs_write( int chip, int cs ); | |
| 14 | extern void x76f100_rst_write( int chip, int rst ); | |
| 15 | extern void x76f100_scl_write( int chip, int scl ); | |
| 16 | extern void x76f100_sda_write( int chip, int sda ); | |
| 17 | extern int x76f100_sda_read( int chip ); | |
| 13 | extern void x76f100_cs_write( running_machine *machine, int chip, int cs ); | |
| 14 | extern void x76f100_rst_write( running_machine *machine, int chip, int rst ); | |
| 15 | extern void x76f100_scl_write( running_machine *machine, int chip, int scl ); | |
| 16 | extern void x76f100_sda_write( running_machine *machine, int chip, int sda ); | |
| 17 | extern int x76f100_sda_read( running_machine *machine, int chip ); | |
| 18 | 18 | extern NVRAM_HANDLER( x76f100_0 ); |
| 19 | 19 | extern NVRAM_HANDLER( x76f100_1 ); |
| 20 | 20 |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | #define M48T02 DEVICE_GET_INFO_NAME(m48t02) |
| 22 | 22 | DEVICE_GET_INFO(m48t02); |
| 23 | 23 | |
| 24 | #define MDRV_M48T02_ADD(_tag) \ | |
| 25 | MDRV_DEVICE_ADD(_tag, M48T02, 0) | |
| 26 | ||
| 27 | #define MDRV_M48T02_REMOVE(_tag) \ | |
| 28 | MDRV_DEVICE_REMOVE(_tag, M48T02) | |
| 29 | ||
| 30 | ||
| 24 | 31 | #define M48T35 DEVICE_GET_INFO_NAME(m48t35) |
| 25 | 32 | DEVICE_GET_INFO(m48t35); |
| 26 | 33 | |
| 34 | #define MDRV_M48T35_ADD(_tag) \ | |
| 35 | MDRV_DEVICE_ADD(_tag, M48T35, 0) | |
| 36 | ||
| 37 | #define MDRV_M48T35_REMOVE(_tag) \ | |
| 38 | MDRV_DEVICE_REMOVE(_tag, M48T35) | |
| 39 | ||
| 40 | ||
| 27 | 41 | #define M48T58 DEVICE_GET_INFO_NAME(m48t58) |
| 28 | 42 | DEVICE_GET_INFO(m48t58); |
| 29 | 43 | |
| 44 | #define MDRV_M48T58_ADD(_tag) \ | |
| 45 | MDRV_DEVICE_ADD(_tag, M48T58, 0) | |
| 46 | ||
| 47 | #define MDRV_M48T58_REMOVE(_tag) \ | |
| 48 | MDRV_DEVICE_REMOVE(_tag, M48T58) | |
| 49 | ||
| 50 | ||
| 30 | 51 | #define MK48T08 DEVICE_GET_INFO_NAME(mk48t08) |
| 31 | 52 | DEVICE_GET_INFO(mk48t08); |
| 32 | 53 | |
| 54 | #define MDRV_MK48T08_ADD(_tag) \ | |
| 55 | MDRV_DEVICE_ADD(_tag, MK48T08, 0) | |
| 56 | ||
| 57 | #define MDRV_MK48T08_REMOVE(_tag) \ | |
| 58 | MDRV_DEVICE_REMOVE(_tag, MK48T08) | |
| 59 | ||
| 60 | ||
| 33 | 61 | /* memory handlers */ |
| 34 | 62 | |
| 35 | 63 | WRITE8_DEVICE_HANDLER( timekeeper_w ); |
| r3957 | r3958 | |
|---|---|---|
| 244 | 244 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ttl74123); break; |
| 245 | 245 | |
| 246 | 246 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 247 | case DEVINFO_STR_NAME: info->s = "74123"; break; | |
| 248 | case DEVINFO_STR_FAMILY: info->s = "TTL"; break; | |
| 249 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 250 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 251 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 247 | case DEVINFO_STR_NAME: strcpy(info->s, "74123"); break; | |
| 248 | case DEVINFO_STR_FAMILY: strcpy(info->s, "TTL"); break; | |
| 249 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 250 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 251 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 252 | 252 | } |
| 253 | 253 | } |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | #define CIA6526R2 DEVICE_GET_INFO_NAME(cia6526r1) |
| 20 | 20 | #define CIA8520 DEVICE_GET_INFO_NAME(cia8520) |
| 21 | 21 | |
| 22 | #define MDRV_CIA6526_ADD(_tag, _variant, _clock, _config) \ | |
| 23 | MDRV_DEVICE_ADD(_tag, _variant, _clock) \ | |
| 24 | MDRV_DEVICE_CONFIG(_config) | |
| 22 | 25 | |
| 26 | #define MDRV_CIA6526_REMOVE(_tag, _variant) \ | |
| 27 | MDRV_DEVICE_REMOVE(_tag, _variant) | |
| 28 | ||
| 29 | #define MDRV_CIA8520_ADD(_tag, _clock, _config) \ | |
| 30 | MDRV_DEVICE_ADD(_tag, CIA8520, _clock) \ | |
| 31 | MDRV_DEVICE_CONFIG(_config) | |
| 32 | ||
| 33 | #define MDRV_CIA8520_REMOVE(_tag) \ | |
| 34 | MDRV_DEVICE_REMOVE(_tag, CIA8520) | |
| 35 | ||
| 36 | ||
| 37 | ||
| 23 | 38 | /*************************************************************************** |
| 24 | 39 | TYPE DEFINITIONS |
| 25 | 40 | ***************************************************************************/ |
| r3957 | r3958 | |
| 28 | 43 | struct _cia6526_interface |
| 29 | 44 | { |
| 30 | 45 | void (*irq_func)(const device_config *device, int state); |
| 31 | int clock; | |
| 32 | 46 | int tod_clock; |
| 33 | 47 | |
| 34 | 48 | struct |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | #define TTL74123 DEVICE_GET_INFO_NAME(ttl74123) |
| 50 | 50 | |
| 51 | #define MDRV_TTL74123_ADD(_tag, _config) \ | |
| 52 | MDRV_DEVICE_ADD(_tag, TTL74123, 0) \ | |
| 53 | MDRV_DEVICE_CONFIG(_config) | |
| 51 | 54 | |
| 55 | #define MDRV_TTL74123_REMOVE(_tag) \ | |
| 56 | MDRV_DEVICE_REMOVE(_tag, TTL74123) | |
| 57 | ||
| 58 | ||
| 52 | 59 | /* constants for the different ways the cap/res can be connected. |
| 53 | 60 | This determines the formula for calculating the pulse width */ |
| 54 | 61 | #define TTL74123_NOT_GROUNDED_NO_DIODE (1) |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | int output_shift_reg; |
| 28 | 28 | int end_conv; |
| 29 | 29 | |
| 30 | double (*input_callback)(int input); | |
| 30 | double (*input_callback)(running_machine *machine, int input); | |
| 31 | 31 | } ADC1213X; |
| 32 | 32 | |
| 33 | 33 | static ADC1213X adc1213x[MAX_ADC1213X_CHIPS]; |
| r3957 | r3958 | |
| 53 | 53 | adc1213x[chip].data_in = state & 1; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | static void adc1213x_convert(int chip, int channel, int bits16, int lsbfirst) | |
| 56 | static void adc1213x_convert(running_machine *machine, int chip, int channel, int bits16, int lsbfirst) | |
| 57 | 57 | { |
| 58 | 58 | int i; |
| 59 | 59 | int bits; |
| r3957 | r3958 | |
| 70 | 70 | { |
| 71 | 71 | case 0x8: // H L L L - CH0 (single-ended) |
| 72 | 72 | { |
| 73 | input = adc1213x[chip].input_callback(0); | |
| 73 | input = adc1213x[chip].input_callback(machine, 0); | |
| 74 | 74 | break; |
| 75 | 75 | } |
| 76 | 76 | case 0xc: // H H L L - CH1 (single-ended) |
| 77 | 77 | { |
| 78 | input = adc1213x[chip].input_callback(1); | |
| 78 | input = adc1213x[chip].input_callback(machine, 1); | |
| 79 | 79 | break; |
| 80 | 80 | } |
| 81 | 81 | case 0x9: // H L L H - CH2 (single-ended) |
| 82 | 82 | { |
| 83 | input = adc1213x[chip].input_callback(2); | |
| 83 | input = adc1213x[chip].input_callback(machine, 2); | |
| 84 | 84 | break; |
| 85 | 85 | } |
| 86 | 86 | case 0xd: // H H L H - CH3 (single-ended) |
| 87 | 87 | { |
| 88 | input = adc1213x[chip].input_callback(3); | |
| 88 | input = adc1213x[chip].input_callback(machine, 3); | |
| 89 | 89 | break; |
| 90 | 90 | } |
| 91 | 91 | case 0xa: // H L H L - CH4 (single-ended) |
| 92 | 92 | { |
| 93 | input = adc1213x[chip].input_callback(4); | |
| 93 | input = adc1213x[chip].input_callback(machine, 4); | |
| 94 | 94 | break; |
| 95 | 95 | } |
| 96 | 96 | case 0xe: // H H H L - CH5 (single-ended) |
| 97 | 97 | { |
| 98 | input = adc1213x[chip].input_callback(5); | |
| 98 | input = adc1213x[chip].input_callback(machine, 5); | |
| 99 | 99 | break; |
| 100 | 100 | } |
| 101 | 101 | case 0xb: // H L H H - CH6 (single-ended) |
| 102 | 102 | { |
| 103 | input = adc1213x[chip].input_callback(6); | |
| 103 | input = adc1213x[chip].input_callback(machine, 6); | |
| 104 | 104 | break; |
| 105 | 105 | } |
| 106 | 106 | case 0xf: // H H H H - CH7 (single-ended) |
| 107 | 107 | { |
| 108 | input = adc1213x[chip].input_callback(7); | |
| 108 | input = adc1213x[chip].input_callback(machine, 7); | |
| 109 | 109 | break; |
| 110 | 110 | } |
| 111 | 111 | default: |
| r3957 | r3958 | |
| 139 | 139 | adc1213x[chip].output_shift_reg >>= 1; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | void adc1213x_cs_w(int chip, int state) | |
| 142 | void adc1213x_cs_w(running_machine *machine, int chip, int state) | |
| 143 | 143 | { |
| 144 | 144 | if (state) |
| 145 | 145 | { |
| r3957 | r3958 | |
| 153 | 153 | { |
| 154 | 154 | case 0x0: // X X X X L L L L - 12 or 13 Bit MSB First conversion |
| 155 | 155 | { |
| 156 | adc1213x_convert(chip, (mode >> 4) & 0xf, 0, 0); | |
| 156 | adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 0, 0); | |
| 157 | 157 | break; |
| 158 | 158 | } |
| 159 | 159 | case 0x1: // X X X X L L L H - 16 or 17 Bit MSB First conversion |
| 160 | 160 | { |
| 161 | adc1213x_convert(chip, (mode >> 4) & 0xf, 1, 0); | |
| 161 | adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 1, 0); | |
| 162 | 162 | break; |
| 163 | 163 | } |
| 164 | 164 | case 0x4: // X X X X L H L L - 12 or 13 Bit LSB First conversion |
| 165 | 165 | { |
| 166 | adc1213x_convert(chip, (mode >> 4) & 0xf, 0, 1); | |
| 166 | adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 0, 1); | |
| 167 | 167 | break; |
| 168 | 168 | } |
| 169 | 169 | case 0x5: // X X X X L H L H - 16 or 17 Bit LSB First conversion |
| 170 | 170 | { |
| 171 | adc1213x_convert(chip, (mode >> 4) & 0xf, 1, 1); | |
| 171 | adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 1, 1); | |
| 172 | 172 | break; |
| 173 | 173 | } |
| 174 | 174 | |
| r3957 | r3958 | |
| 237 | 237 | return adc1213x[chip].end_conv; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | void adc1213x_init(int chip, double (*input_callback)( int input )) | |
| 240 | void adc1213x_init(int chip, double (*input_callback)( running_machine *machine, int input )) | |
| 241 | 241 | { |
| 242 | 242 | memset(&adc1213x[chip], 0, sizeof(ADC1213X)); |
| 243 | 243 |
| r3957 | r3958 | |
|---|---|---|
| 1824 | 1824 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ide_controller);break; |
| 1825 | 1825 | |
| 1826 | 1826 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1827 | case DEVINFO_STR_NAME: info->s = "IDE Controller"; break; | |
| 1828 | case DEVINFO_STR_FAMILY: info->s = "Disk Controller"; break; | |
| 1829 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1830 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1831 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1827 | case DEVINFO_STR_NAME: strcpy(info->s, "IDE Controller"); break; | |
| 1828 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Disk Controller"); break; | |
| 1829 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1830 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1831 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1832 | 1832 | } |
| 1833 | 1833 | } |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | struct TTL74148 |
| 48 | 48 | { |
| 49 | 49 | /* callback */ |
| 50 | void (*output_cb)( | |
| 50 | void (*output_cb)(running_machine *machine); | |
| 51 | 51 | |
| 52 | 52 | /* inputs */ |
| 53 | 53 | int input_lines[8]; /* pins 1-4,10-13 */ |
| r3957 | r3958 | |
| 67 | 67 | static struct TTL74148 chips[MAX_TTL74148]; |
| 68 | 68 | |
| 69 | 69 | |
| 70 | void TTL74148_update(int which) | |
| 70 | void TTL74148_update(running_machine *machine, int which) | |
| 71 | 71 | { |
| 72 | 72 | if (chips[which].enable_input) |
| 73 | 73 | { |
| r3957 | r3958 | |
| 131 | 131 | chips[which].last_output_valid = chips[which].output_valid; |
| 132 | 132 | chips[which].last_enable_output = chips[which].enable_output; |
| 133 | 133 | |
| 134 | chips[which].output_cb(); | |
| 134 | chips[which].output_cb(machine); | |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | **********************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "6821pia.h" |
| 10 | 9 | |
| 11 | 10 | |
| r3957 | r3958 | |
| 24 | 23 | typedef struct _pia6821 pia6821; |
| 25 | 24 | struct _pia6821 |
| 26 | 25 | { |
| 26 | running_machine *machine; | |
| 27 | 27 | const pia6821_interface *intf; |
| 28 | 28 | |
| 29 | 29 | UINT8 in_a; |
| r3957 | r3958 | |
| 125 | 125 | p = &pias[which]; |
| 126 | 126 | memset(p, 0, sizeof(pias[0])); |
| 127 | 127 | |
| 128 | p->machine = machine; | |
| 128 | 129 | p->intf = intf; |
| 129 | 130 | |
| 130 | 131 | state_save_register_item(machine, "6821pia", NULL, which, p->in_a); |
| r3957 | r3958 | |
| 176 | 177 | /* zap each structure, preserving the interface and swizzle */ |
| 177 | 178 | for (i = 0; i < MAX_PIA; i++) |
| 178 | 179 | { |
| 180 | running_machine *machine = pias[i].machine; | |
| 179 | 181 | const pia6821_interface *intf = pias[i].intf; |
| 180 | 182 | |
| 181 | 183 | if (intf == NULL) continue; |
| 182 | 184 | |
| 183 | 185 | memset(&pias[i], 0, sizeof(pias[i])); |
| 184 | 186 | |
| 187 | pias[i].machine = machine; | |
| 185 | 188 | pias[i].intf = intf; |
| 186 | 189 | |
| 187 | 190 | /* |
| r3957 | r3958 | |
| 195 | 198 | pias[i].in_ca2 = TRUE; |
| 196 | 199 | |
| 197 | 200 | /* clear the IRQs */ |
| 198 | if (intf->irq_a_func) (*intf->irq_a_func)(Machine, FALSE); | |
| 199 | if (intf->irq_b_func) (*intf->irq_b_func)(Machine, FALSE); | |
| 201 | if (intf->irq_a_func) (*intf->irq_a_func)(machine, FALSE); | |
| 202 | if (intf->irq_b_func) (*intf->irq_b_func)(machine, FALSE); | |
| 200 | 203 | } |
| 201 | 204 | } |
| 202 | 205 | |
| r3957 | r3958 | |
| 586 | 589 | default: /* impossible */ |
| 587 | 590 | case 0x00: |
| 588 | 591 | if (OUTPUT_SELECTED(p->ctl_a)) |
| 589 | ret = port_a_r( | |
| 592 | ret = port_a_r(p->machine, which); | |
| 590 | 593 | else |
| 591 | ret = ddr_a_r( | |
| 594 | ret = ddr_a_r(p->machine, which); | |
| 592 | 595 | break; |
| 593 | 596 | |
| 594 | 597 | case 0x01: |
| 595 | ret = control_a_r( | |
| 598 | ret = control_a_r(p->machine, which); | |
| 596 | 599 | break; |
| 597 | 600 | |
| 598 | 601 | case 0x02: |
| 599 | 602 | if (OUTPUT_SELECTED(p->ctl_b)) |
| 600 | ret = port_b_r( | |
| 603 | ret = port_b_r(p->machine, which); | |
| 601 | 604 | else |
| 602 | ret = ddr_b_r( | |
| 605 | ret = ddr_b_r(p->machine, which); | |
| 603 | 606 | break; |
| 604 | 607 | |
| 605 | 608 | case 0x03: |
| 606 | ret = control_b_r( | |
| 609 | ret = control_b_r(p->machine, which); | |
| 607 | 610 | break; |
| 608 | 611 | } |
| 609 | 612 | |
| r3957 | r3958 | |
| 821 | 824 | default: /* impossible */ |
| 822 | 825 | case 0x00: |
| 823 | 826 | if (OUTPUT_SELECTED(p->ctl_a)) |
| 824 | port_a_w( | |
| 827 | port_a_w(p->machine, which, data); | |
| 825 | 828 | else |
| 826 | ddr_a_w( | |
| 829 | ddr_a_w(p->machine, which, data); | |
| 827 | 830 | break; |
| 828 | 831 | |
| 829 | 832 | case 0x01: |
| 830 | control_a_w( | |
| 833 | control_a_w(p->machine, which, data); | |
| 831 | 834 | break; |
| 832 | 835 | |
| 833 | 836 | case 0x02: |
| 834 | 837 | if (OUTPUT_SELECTED(p->ctl_b)) |
| 835 | port_b_w( | |
| 838 | port_b_w(p->machine, which, data); | |
| 836 | 839 | else |
| 837 | ddr_b_w( | |
| 840 | ddr_b_w(p->machine, which, data); | |
| 838 | 841 | break; |
| 839 | 842 | |
| 840 | 843 | case 0x03: |
| 841 | control_b_w( | |
| 844 | control_b_w(p->machine, which, data); | |
| 842 | 845 | break; |
| 843 | 846 | } |
| 844 | 847 | } |
| r3957 | r3958 | |
| 893 | 896 | |
| 894 | 897 | p->out_a_needs_pulled = FALSE; |
| 895 | 898 | |
| 896 | return get_out_a_value( | |
| 899 | return get_out_a_value(p->machine, which); | |
| 897 | 900 | } |
| 898 | 901 | |
| 899 | 902 | |
| r3957 | r3958 | |
| 931 | 934 | p->irq_a1 = TRUE; |
| 932 | 935 | |
| 933 | 936 | /* update externals */ |
| 934 | update_interrupts( | |
| 937 | update_interrupts(p->machine, p); | |
| 935 | 938 | |
| 936 | 939 | /* CA2 is configured as output and in read strobe mode and cleared by a CA1 transition */ |
| 937 | 940 | if (C2_OUTPUT(p->ctl_a) && C2_STROBE_MODE(p->ctl_a) && STROBE_C1_RESET(p->ctl_a)) |
| 938 | set_out_ca2( | |
| 941 | set_out_ca2(p->machine, which, TRUE); | |
| 939 | 942 | } |
| 940 | 943 | |
| 941 | 944 | /* set the new value for CA1 */ |
| r3957 | r3958 | |
| 979 | 982 | p->irq_a2 = TRUE; |
| 980 | 983 | |
| 981 | 984 | /* update externals */ |
| 982 | update_interrupts( | |
| 985 | update_interrupts(p->machine, p); | |
| 983 | 986 | } |
| 984 | 987 | |
| 985 | 988 | /* set the new value for CA2 */ |
| r3957 | r3958 | |
| 1084 | 1087 | p->irq_b1 = 1; |
| 1085 | 1088 | |
| 1086 | 1089 | /* update externals */ |
| 1087 | update_interrupts( | |
| 1090 | update_interrupts(p->machine, p); | |
| 1088 | 1091 | |
| 1089 | 1092 | /* If CB2 is configured as a write-strobe output which is reset by a CB1 |
| 1090 | 1093 | transition, this reset will only happen when a read from port B implicitly |
| r3957 | r3958 | |
| 1133 | 1136 | p->irq_b2 = 1; |
| 1134 | 1137 | |
| 1135 | 1138 | /* update externals */ |
| 1136 | update_interrupts( | |
| 1139 | update_interrupts(p->machine, p); | |
| 1137 | 1140 | } |
| 1138 | 1141 | |
| 1139 | 1142 | /* set the new value for CA2 */ |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | int adc1213x_do_r(int chip); |
| 11 | 11 | void adc1213x_di_w(int chip, int state); |
| 12 | void adc1213x_cs_w(int chip, int state); | |
| 12 | void adc1213x_cs_w(running_machine *machine, int chip, int state); | |
| 13 | 13 | void adc1213x_sclk_w(int chip, int state); |
| 14 | 14 | void adc1213x_conv_w(int chip, int state); |
| 15 | 15 | int adc1213x_eoc_r(int chip); |
| 16 | void adc1213x_init(int chip, double (*input_callback)( int input )); | |
| 16 | void adc1213x_init(int chip, double (*input_callback)( running_machine *machine, int input )); | |
| 17 | 17 | |
| 18 | 18 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | ***************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | #define MDRV_IDE_CONTROLLER_ADD(_tag, _callback) \ |
| 41 | MDRV_DEVICE_ADD(_tag, IDE_CONTROLLER) \ | |
| 41 | MDRV_DEVICE_ADD(_tag, IDE_CONTROLLER, 0) \ | |
| 42 | 42 | MDRV_DEVICE_CONFIG_DATAPTR(ide_config, interrupt, _callback) |
| 43 | 43 | |
| 44 | 44 | #define MDRV_IDE_CONTROLLER_REGIONS(_master, _slave) \ |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | /* The interface structure */ |
| 46 | 46 | struct TTL74148_interface |
| 47 | 47 | { |
| 48 | void (*output_cb)( | |
| 48 | void (*output_cb)(running_machine *machine); | |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | void TTL74148_config(int which, const struct TTL74148_interface *intf); |
| 53 | 53 | |
| 54 | 54 | /* must call TTL74148_update() after setting the inputs */ |
| 55 | void TTL74148_update(int which); | |
| 55 | void TTL74148_update(running_machine *machine, int which); | |
| 56 | 56 | |
| 57 | 57 | void TTL74148_input_line_w(int which, int input_line, int data); |
| 58 | 58 | void TTL74148_enable_input_w(int which, int data); |
| r3957 | r3958 | |
|---|---|---|
| 400 | 400 | case 0x07: /* Timer, CLK/16 */ |
| 401 | 401 | { |
| 402 | 402 | double hz; |
| 403 | //attotime rate = attotime_mul(ATTOTIME_IN_HZ(duart68681->duart_config->frequency), 16*duart68681->CTR.w.l); | |
| 404 | attotime rate = ATTOTIME_IN_HZ(2*duart68681->duart_config->frequency/(2*16*16*duart68681->CTR.w.l)); | |
| 403 | //attotime rate = attotime_mul(ATTOTIME_IN_HZ(duart68681->clock), 16*duart68681->CTR.w.l); | |
| 404 | attotime rate = ATTOTIME_IN_HZ(2*device->clock/(2*16*16*duart68681->CTR.w.l)); | |
| 405 | 405 | hz = ATTOSECONDS_TO_HZ(rate.attoseconds); |
| 406 | 406 | timer_adjust_periodic(duart68681->duart_timer, rate, 0, rate); |
| 407 | 407 | } |
| r3957 | r3958 | |
| 640 | 640 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(duart68681);break; |
| 641 | 641 | |
| 642 | 642 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 643 | case DEVINFO_STR_NAME: info->s = "DUART 68681"; break; | |
| 644 | case DEVINFO_STR_FAMILY: info->s = "DUART"; break; | |
| 645 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 646 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 647 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 643 | case DEVINFO_STR_NAME: strcpy(info->s, "DUART 68681"); break; | |
| 644 | case DEVINFO_STR_FAMILY: strcpy(info->s, "DUART"); break; | |
| 645 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 646 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 647 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 648 | 648 | } |
| 649 | 649 | } |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | typedef struct _riot6532_state riot6532_state; |
| 50 | 50 | struct _riot6532_state |
| 51 | 51 | { |
| 52 | const device_config *device; | |
| 52 | 53 | const riot6532_interface *intf; |
| 53 | 54 | int index; |
| 54 | 55 | |
| r3957 | r3958 | |
| 63 | 64 | UINT8 timershift; |
| 64 | 65 | UINT8 timerstate; |
| 65 | 66 | emu_timer * timer; |
| 66 | ||
| 67 | UINT32 clock; | |
| 68 | 67 | }; |
| 69 | 68 | |
| 70 | 69 | |
| r3957 | r3958 | |
| 147 | 146 | |
| 148 | 147 | /* if counting, return the number of ticks remaining */ |
| 149 | 148 | else if (riot->timerstate == TIMER_COUNTING) |
| 150 | return attotime_to_ticks(timer_timeleft(riot->timer), riot->clock) >> riot->timershift; | |
| 149 | return attotime_to_ticks(timer_timeleft(riot->timer), riot->device->clock) >> riot->timershift; | |
| 151 | 150 | |
| 152 | 151 | /* if finishing, return the number of ticks without the shift */ |
| 153 | 152 | else |
| 154 | return attotime_to_ticks(timer_timeleft(riot->timer), riot->clock); | |
| 153 | return attotime_to_ticks(timer_timeleft(riot->timer), riot->device->clock); | |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | 156 | |
| r3957 | r3958 | |
| 176 | 175 | if (riot->timerstate == TIMER_COUNTING) |
| 177 | 176 | { |
| 178 | 177 | riot->timerstate = TIMER_FINISHING; |
| 179 | timer_adjust_oneshot(riot->timer, ticks_to_attotime(256, | |
| 178 | timer_adjust_oneshot(riot->timer, ticks_to_attotime(256, device->clock), 0); | |
| 180 | 179 | |
| 181 | 180 | /* signal timer IRQ as well */ |
| 182 | 181 | riot->irqstate |= TIMER_FLAG; |
| r3957 | r3958 | |
| 228 | 227 | |
| 229 | 228 | /* update the timer */ |
| 230 | 229 | riot->timerstate = TIMER_COUNTING; |
| 231 | target = attotime_to_ticks(curtime, riot->clock) + 1 + (data << riot->timershift); | |
| 232 | timer_adjust_oneshot(riot->timer, attotime_sub(ticks_to_attotime(target, riot->clock), curtime), 0); | |
| 230 | target = attotime_to_ticks(curtime, device->clock) + 1 + (data << riot->timershift); | |
| 231 | timer_adjust_oneshot(riot->timer, attotime_sub(ticks_to_attotime(target, device->clock), curtime), 0); | |
| 233 | 232 | } |
| 234 | 233 | |
| 235 | 234 | /* if A4 == 0 and A2 == 1, we are writing to the edge detect control */ |
| r3957 | r3958 | |
| 426 | 425 | |
| 427 | 426 | static DEVICE_START( riot6532 ) |
| 428 | 427 | { |
| 429 | const riot6532_config *config = device->inline_config; | |
| 430 | 428 | riot6532_state *riot = get_safe_token(device); |
| 431 | 429 | |
| 432 | 430 | /* validate arguments */ |
| r3957 | r3958 | |
| 435 | 433 | assert(strlen(device->tag) < 20); |
| 436 | 434 | |
| 437 | 435 | /* set static values */ |
| 436 | riot->device = device; | |
| 438 | 437 | riot->intf = device->static_config; |
| 439 | 438 | riot->index = device_list_index(device->machine->config->devicelist, RIOT6532, device->tag); |
| 440 | riot->clock = config->clock; | |
| 441 | 439 | |
| 442 | 440 | /* configure the ports */ |
| 443 | 441 | riot->port[0].in_func = riot->intf->in_a_func; |
| r3957 | r3958 | |
| 510 | 508 | { |
| 511 | 509 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 512 | 510 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(riot6532_state); break; |
| 513 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = | |
| 511 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0 | |
| 514 | 512 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 515 | 513 | |
| 516 | 514 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r3957 | r3958 | |
| 520 | 518 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(riot6532);break; |
| 521 | 519 | |
| 522 | 520 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 523 | case DEVINFO_STR_NAME: info->s = "6532 (RIOT)"; break; | |
| 524 | case DEVINFO_STR_FAMILY: info->s = "I/O devices"; break; | |
| 525 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 526 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 527 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 521 | case DEVINFO_STR_NAME: strcpy(info->s, "6532 (RIOT)"); break; | |
| 522 | case DEVINFO_STR_FAMILY: strcpy(info->s, "I/O devices"); break; | |
| 523 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 524 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 525 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 528 | 526 | } |
| 529 | 527 | } |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | emu_timer *shift_timer; |
| 82 | 82 | UINT8 shift_counter; |
| 83 | ||
| 84 | int clock; | |
| 85 | 83 | }; |
| 86 | 84 | |
| 87 | 85 | |
| r3957 | r3958 | |
| 184 | 182 | } |
| 185 | 183 | |
| 186 | 184 | |
| 187 | INLINE const via6522_inline_config *get_inline_config(const device_config *device) | |
| 188 | { | |
| 189 | assert(device != NULL); | |
| 190 | assert((device->type == VIA6522)); | |
| 191 | return (const via6522_inline_config *) device->inline_config; | |
| 192 | } | |
| 193 | ||
| 194 | ||
| 195 | 185 | INLINE attotime v_cycles_to_time(const device_config *device, int c) |
| 196 | 186 | { |
| 197 | via6522_t *v = get_token(device); | |
| 198 | return attotime_mul(ATTOTIME_IN_HZ(v->clock), c); | |
| 187 | return attotime_mul(ATTOTIME_IN_HZ(device->clock), c); | |
| 199 | 188 | } |
| 200 | 189 | |
| 201 | 190 | |
| 202 | 191 | INLINE UINT32 v_time_to_cycles(const device_config *device, attotime t) |
| 203 | 192 | { |
| 204 | via6522_t *v = get_token(device); | |
| 205 | return attotime_to_double(attotime_mul(t, v->clock)); | |
| 193 | return attotime_to_double(attotime_mul(t, device->clock)); | |
| 206 | 194 | } |
| 207 | 195 | |
| 208 | 196 | |
| r3957 | r3958 | |
| 231 | 219 | static DEVICE_START( via6522 ) |
| 232 | 220 | { |
| 233 | 221 | via6522_t *v = get_token(device); |
| 234 | const via6522_inline_config *inline_config = get_inline_config(device); | |
| 235 | 222 | |
| 236 | 223 | memset(v, 0, sizeof(*v)); |
| 237 | 224 | v->t1ll = 0xf3; /* via at 0x9110 in vic20 show these values */ |
| r3957 | r3958 | |
| 244 | 231 | v->shift_timer = timer_alloc(device->machine, via_shift_callback, (void *) device); |
| 245 | 232 | |
| 246 | 233 | /* Default clock is from CPU1 */ |
| 247 | v->clock = (inline_config != NULL) && (inline_config->clck != 0) | |
| 248 | ? inline_config->clck | |
| 249 | : cpu_get_clock(device->machine->cpu[0]); | |
| 234 | if (device->clock == 0) | |
| 235 | device_set_clock(device, device->machine->cpu[0]->clock); | |
| 236 | ||
| 250 | 237 | return DEVICE_START_OK; |
| 251 | 238 | } |
| 252 | 239 | |
| r3957 | r3958 | |
| 1222 | 1209 | { |
| 1223 | 1210 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1224 | 1211 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(via6522_t); break; |
| 1225 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = | |
| 1212 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0 | |
| 1226 | 1213 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 1227 | 1214 | |
| 1228 | 1215 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r3957 | r3958 | |
| 1232 | 1219 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(via6522); break; |
| 1233 | 1220 | |
| 1234 | 1221 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1235 | case DEVINFO_STR_NAME: info->s = "6522 VIA"; break; | |
| 1236 | case DEVINFO_STR_FAMILY: info->s = "6522 VIA"; break; | |
| 1237 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1238 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1222 | case DEVINFO_STR_NAME: strcpy(info->s, "6522 VIA"); break; | |
| 1223 | case DEVINFO_STR_FAMILY: strcpy(info->s, "6522 VIA"); break; | |
| 1224 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1225 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1239 | 1226 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 1240 | 1227 | } |
| 1241 | 1228 | } |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "scsidev.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | |
| 10 | 9 | typedef struct |
| 11 | 10 | { |
| r3957 | r3958 | |
| 28 | 27 | return 0; |
| 29 | 28 | |
| 30 | 29 | default: |
| 31 | logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context( | |
| 30 | logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] ); | |
| 32 | 31 | return 0; |
| 33 | 32 | } |
| 34 | 33 | } |
| r3957 | r3958 | |
| 43 | 42 | switch( command[ 0 ] ) |
| 44 | 43 | { |
| 45 | 44 | default: |
| 46 | logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context( | |
| 45 | logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] ); | |
| 47 | 46 | break; |
| 48 | 47 | } |
| 49 | 48 | } |
| r3957 | r3958 | |
| 58 | 57 | switch( command[ 0 ] ) |
| 59 | 58 | { |
| 60 | 59 | default: |
| 61 | logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context( | |
| 60 | logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] ); | |
| 62 | 61 | break; |
| 63 | 62 | } |
| 64 | 63 | } |
| r3957 | r3958 | |
| 100 | 99 | |
| 101 | 100 | static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) |
| 102 | 101 | { |
| 103 | running_machine *machine = | |
| 102 | running_machine *machine = scsiInstance->machine; | |
| 104 | 103 | SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); |
| 105 | 104 | |
| 106 | 105 | state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command ); |
| r3957 | r3958 | |
| 141 | 140 | |
| 142 | 141 | case SCSIOP_ALLOC_INSTANCE: |
| 143 | 142 | params = ptrparm; |
| 144 | params->instance = SCSIMalloc( file ); | |
| 143 | params->instance = SCSIMalloc( params->machine, file ); | |
| 145 | 144 | scsidev_alloc_instance( params->instance, params->diskregion ); |
| 146 | 145 | return 0; |
| 147 | 146 |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | typedef struct _duart68681_config duart68681_config; |
| 5 | 5 | struct _duart68681_config |
| 6 | 6 | { |
| 7 | int frequency; | |
| 8 | 7 | void (*irq_handler)(const device_config *device, UINT8 vector); |
| 9 | 8 | void (*tx_callback)(const device_config *device, int channel, UINT8 data); |
| 10 | 9 | UINT8 (*input_port_read)(const device_config *device); |
| r3957 | r3958 | |
| 14 | 13 | #define DUART68681 DEVICE_GET_INFO_NAME(duart68681) |
| 15 | 14 | DEVICE_GET_INFO(duart68681); |
| 16 | 15 | |
| 16 | #define MDRV_DUART68681_ADD(_tag, _clock, _config) \ | |
| 17 | MDRV_DEVICE_ADD(_tag, DUART68681, _clock) \ | |
| 18 | MDRV_DEVICE_CONFIG(_config) | |
| 19 | ||
| 20 | #define MDRV_DUART_68681_REMOVE(_tag) \ | |
| 21 | MDRV_DEVICE_REMOVE(_tag, DUART68681) | |
| 22 | ||
| 23 | ||
| 17 | 24 | READ8_DEVICE_HANDLER(duart68681_r); |
| 18 | 25 | WRITE8_DEVICE_HANDLER(duart68681_w); |
| 19 | 26 |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | TYPE DEFINITIONS |
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | typedef struct _riot6532_config riot6532_config; | |
| 16 | struct _riot6532_config | |
| 17 | { | |
| 18 | UINT32 clock; | |
| 19 | }; | |
| 20 | ||
| 21 | ||
| 22 | 15 | typedef UINT8 (*riot_read_func)(const device_config *device, UINT8 olddata); |
| 23 | 16 | typedef void (*riot_write_func)(const device_config *device, UINT8 newdata, UINT8 olddata); |
| 24 | 17 | typedef void (*riot_irq_func)(const device_config *device, int state); |
| r3957 | r3958 | |
| 41 | 34 | ***************************************************************************/ |
| 42 | 35 | |
| 43 | 36 | #define MDRV_RIOT6532_ADD(_tag, _clock, _intrf) \ |
| 44 | MDRV_DEVICE_ADD(_tag, RIOT6532) \ | |
| 45 | MDRV_DEVICE_CONFIG_DATA32(riot6532_config, clock, _clock) \ | |
| 37 | MDRV_DEVICE_ADD(_tag, RIOT6532, _clock) \ | |
| 46 | 38 | MDRV_DEVICE_CONFIG(_intrf) |
| 47 | 39 | |
| 48 | 40 | #define MDRV_RIOT6532_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | #define VIA6522 DEVICE_GET_INFO_NAME(via6522) |
| 23 | 23 | |
| 24 | 24 | #define MDRV_VIA6522_ADD(_tag, _clock, _intrf) \ |
| 25 | MDRV_DEVICE_ADD(_tag, VIA6522) \ | |
| 26 | MDRV_DEVICE_CONFIG_DATA32(via6522_inline_config, clck, _clock) \ | |
| 25 | MDRV_DEVICE_ADD(_tag, VIA6522, _clock) \ | |
| 27 | 26 | MDRV_DEVICE_CONFIG(_intrf) |
| 28 | 27 | |
| 29 | 28 | #define MDRV_VIA6522_REMOVE(_tag) \ |
| r3957 | r3958 | |
| 69 | 68 | void (*irq_func)(const device_config *device, int state); |
| 70 | 69 | }; |
| 71 | 70 | |
| 72 | typedef struct _via6522_inline_config via6522_inline_config; | |
| 73 | struct _via6522_inline_config | |
| 74 | { | |
| 75 | int clck; | |
| 76 | }; | |
| 77 | 71 | |
| 78 | ||
| 79 | 72 | /*************************************************************************** |
| 80 | 73 | PROTOTYPES |
| 81 | 74 | ***************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | struct TTL7474 |
| 47 | 47 | { |
| 48 | 48 | /* callback */ |
| 49 | void (*output_cb)( | |
| 49 | void (*output_cb)(running_machine *); | |
| 50 | 50 | |
| 51 | 51 | /* inputs */ |
| 52 | 52 | UINT8 clear; /* pin 1/13 */ |
| r3957 | r3958 | |
| 67 | 67 | static struct TTL7474 chips[MAX_TTL7474]; |
| 68 | 68 | |
| 69 | 69 | |
| 70 | void TTL7474_update(int which) | |
| 70 | void TTL7474_update(running_machine *machine, int which) | |
| 71 | 71 | { |
| 72 | 72 | if (!chips[which].preset && chips[which].clear) /* line 1 in truth table */ |
| 73 | 73 | { |
| r3957 | r3958 | |
| 101 | 101 | chips[which].last_output = chips[which].output; |
| 102 | 102 | chips[which].last_output_comp = chips[which].output_comp; |
| 103 | 103 | |
| 104 | chips[which].output_cb(); | |
| 104 | chips[which].output_cb(machine); | |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | #ifdef MESS |
| 12 | 12 | #include "devices/chd_cd.h" |
| 13 | 13 | #endif |
| 14 | #include "deprecat.h" | |
| 15 | 14 | #include "scsicd.h" |
| 16 | 15 | |
| 17 | 16 | typedef struct |
| r3957 | r3958 | |
| 673 | 672 | |
| 674 | 673 | static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) |
| 675 | 674 | { |
| 676 | running_machine *machine = | |
| 675 | running_machine *machine = scsiInstance->machine; | |
| 677 | 676 | SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); |
| 678 | 677 | |
| 679 | 678 | our_this->lba = 0; |
| r3957 | r3958 | |
| 694 | 693 | |
| 695 | 694 | #ifdef MESS |
| 696 | 695 | /* TODO: get rid of this ifdef MESS section */ |
| 697 | our_this->cdrom = mess_cd_get_cdrom_file( device_list_find_by_tag( | |
| 696 | our_this->cdrom = mess_cd_get_cdrom_file( device_list_find_by_tag( machine->config->devicelist, CDROM, diskregion ) ); | |
| 698 | 697 | #else |
| 699 | 698 | our_this->cdrom = cdrom_open(get_disk_handle( diskregion )); |
| 700 | 699 |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | /* The interface structure */ |
| 45 | 45 | struct TTL7474_interface |
| 46 | 46 | { |
| 47 | void (*output_cb)( | |
| 47 | void (*output_cb)(running_machine *machine); | |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | void TTL7474_config(running_machine *machine, int which, const struct TTL7474_interface *intf); |
| 52 | 52 | |
| 53 | 53 | /* must call TTL7474_update() after setting the inputs */ |
| 54 | void TTL7474_update(int which); | |
| 54 | void TTL7474_update(running_machine *machine, int which); | |
| 55 | 55 | |
| 56 | 56 | void TTL7474_clear_w(int which, int data); |
| 57 | 57 | void TTL7474_preset_w(int which, int data); |
| r3957 | r3958 | |
|---|---|---|
| 242 | 242 | ***************************************************************************/ |
| 243 | 243 | |
| 244 | 244 | /*------------------------------------------------- |
| 245 | find_pr8210 - find our device; assumes there | |
| 246 | is only one | |
| 247 | -------------------------------------------------*/ | |
| 248 | ||
| 249 | INLINE laserdisc_state *find_pr8210(running_machine *machine) | |
| 250 | { | |
| 251 | return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC)); | |
| 252 | } | |
| 253 | ||
| 254 | ||
| 255 | /*------------------------------------------------- | |
| 256 | 245 | update_video_squelch - update the state of |
| 257 | 246 | the video squelch |
| 258 | 247 | -------------------------------------------------*/ |
| r3957 | r3958 | |
| 360 | 349 | player->slowtrg = curtime; |
| 361 | 350 | |
| 362 | 351 | /* find our CPU */ |
| 363 | player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device | |
| 352 | player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device | |
| 364 | 353 | astring_free(tempstring); |
| 365 | 354 | |
| 366 | 355 | /* we don't have the Simutrek player overrides */ |
| r3957 | r3958 | |
| 600 | 589 | |
| 601 | 590 | static READ8_HANDLER( pr8210_pia_r ) |
| 602 | 591 | { |
| 603 | laserdisc_state *ld = | |
| 592 | laserdisc_state *ld = l | |
| 604 | 593 | ldplayer_data *player = ld->player; |
| 605 | 594 | UINT8 result = 0xff; |
| 606 | 595 | |
| r3957 | r3958 | |
| 651 | 640 | |
| 652 | 641 | static WRITE8_HANDLER( pr8210_pia_w ) |
| 653 | 642 | { |
| 654 | laserdisc_state *ld = | |
| 643 | laserdisc_state *ld = l | |
| 655 | 644 | ldplayer_data *player = ld->player; |
| 656 | 645 | UINT8 value; |
| 657 | 646 | |
| r3957 | r3958 | |
| 735 | 724 | $02 = (in) FG via op-amp (spindle motor stop detector) |
| 736 | 725 | $01 = (in) SLOW TIMER OUT |
| 737 | 726 | */ |
| 738 | laserdisc_state *ld = | |
| 727 | laserdisc_state *ld = l | |
| 739 | 728 | ldplayer_data *player = ld->player; |
| 740 | 729 | slider_position sliderpos = ldcore_get_slider_position(ld); |
| 741 | 730 | UINT8 focus_on = !(player->port1 & 0x08); |
| r3957 | r3958 | |
| 783 | 772 | $02 = (out) SCAN A (/SCAN) |
| 784 | 773 | $01 = (out) JUMP TRG (jump back trigger, clock on high->low) |
| 785 | 774 | */ |
| 786 | laserdisc_state *ld = | |
| 775 | laserdisc_state *ld = l | |
| 787 | 776 | ldplayer_data *player = ld->player; |
| 788 | 777 | UINT8 prev = player->port1; |
| 789 | 778 | int direction; |
| r3957 | r3958 | |
| 845 | 834 | $02 = (out) ??? |
| 846 | 835 | $01 = (out) LASER ON |
| 847 | 836 | */ |
| 848 | laserdisc_state *ld = | |
| 837 | laserdisc_state *ld = l | |
| 849 | 838 | ldplayer_data *player = ld->player; |
| 850 | 839 | UINT8 prev = player->port2; |
| 851 | 840 | |
| r3957 | r3958 | |
| 873 | 862 | static READ8_HANDLER( pr8210_t0_r ) |
| 874 | 863 | { |
| 875 | 864 | /* returns VSYNC state */ |
| 876 | laserdisc_state *ld = | |
| 865 | laserdisc_state *ld = l | |
| 877 | 866 | return !ld->player->vsync; |
| 878 | 867 | } |
| 879 | 868 | |
| r3957 | r3958 | |
| 1096 | 1085 | player->simutrek.data_ready = 1; |
| 1097 | 1086 | |
| 1098 | 1087 | /* find the Simutrek CPU */ |
| 1099 | player->simutrek.cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device | |
| 1088 | player->simutrek.cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device | |
| 1100 | 1089 | astring_free(tempstring); |
| 1101 | 1090 | } |
| 1102 | 1091 | |
| r3957 | r3958 | |
| 1208 | 1197 | |
| 1209 | 1198 | static READ8_HANDLER( simutrek_port2_r ) |
| 1210 | 1199 | { |
| 1211 | laserdisc_state *ld = | |
| 1200 | laserdisc_state *ld = l | |
| 1212 | 1201 | ldplayer_data *player = ld->player; |
| 1213 | 1202 | |
| 1214 | 1203 | /* bit $80 is the pr8210 video squelch */ |
| r3957 | r3958 | |
| 1223 | 1212 | |
| 1224 | 1213 | static WRITE8_HANDLER( simutrek_port2_w ) |
| 1225 | 1214 | { |
| 1226 | laserdisc_state *ld = | |
| 1215 | laserdisc_state *ld = l | |
| 1227 | 1216 | ldplayer_data *player = ld->player; |
| 1228 | 1217 | UINT8 prev = player->simutrek.port2; |
| 1229 | 1218 | |
| r3957 | r3958 | |
| 1262 | 1251 | |
| 1263 | 1252 | static READ8_HANDLER( simutrek_data_r ) |
| 1264 | 1253 | { |
| 1265 | laserdisc_state *ld = | |
| 1254 | laserdisc_state *ld = l | |
| 1266 | 1255 | ldplayer_data *player = ld->player; |
| 1267 | 1256 | |
| 1268 | 1257 | /* acknowledge the read and clear the data ready flag */ |
| r3957 | r3958 | |
| 1279 | 1268 | static READ8_HANDLER( simutrek_t0_r ) |
| 1280 | 1269 | { |
| 1281 | 1270 | /* return 1 if data is waiting from main CPU */ |
| 1282 | laserdisc_state *ld = | |
| 1271 | laserdisc_state *ld = l | |
| 1283 | 1272 | return ld->player->simutrek.data_ready; |
| 1284 | 1273 | } |
| r3957 | r3958 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include <stdarg.h> |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | #include "state.h" |
| 13 | 12 | #include "machine/ds2401.h" |
| 14 | 13 | |
| r3957 | r3958 | |
| 160 | 159 | c->reset_timer = timer_alloc(machine, ds2401_reset , NULL); |
| 161 | 160 | } |
| 162 | 161 | |
| 163 | void ds2401_write( int which, int data ) | |
| 162 | void ds2401_write( running_machine *machine, int which, int data ) | |
| 164 | 163 | { |
| 165 | running_machine *machine = Machine; | |
| 166 | 164 | struct ds2401_chip *c = &ds2401[ which ]; |
| 167 | 165 | |
| 168 | 166 | verboselog( machine, 1, "ds2401_write( %d, %d )\n", which, data ); |
| r3957 | r3958 | |
| 214 | 212 | c->rx = data; |
| 215 | 213 | } |
| 216 | 214 | |
| 217 | int ds2401_read( int which ) | |
| 215 | int ds2401_read( running_machine *machine, int which ) | |
| 218 | 216 | { |
| 219 | 217 | struct ds2401_chip *c = &ds2401[ which ]; |
| 220 | 218 | |
| 221 | verboselog( | |
| 219 | verboselog( machine, 2, "ds2401_read( %d ) %d\n", which, c->tx & c->rx ); | |
| 222 | 220 | return c->tx & c->rx; |
| 223 | 221 | } |
| 224 | 222 |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | #define DS2401_MAXCHIP ( 3 ) |
| 13 | 13 | |
| 14 | 14 | extern void ds2401_init( running_machine *machine, int which, const UINT8 *data ); |
| 15 | extern void ds2401_write( int which, int data ); | |
| 16 | extern int ds2401_read( int which ); | |
| 15 | extern void ds2401_write( running_machine *machine, int which, int data ); | |
| 16 | extern int ds2401_read( running_machine *machine, int which ); | |
| 17 | 17 | |
| 18 | 18 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | struct TTL74153 |
| 43 | 43 | { |
| 44 | running_machine *machine; | |
| 45 | ||
| 44 | 46 | /* callback */ |
| 45 | void (*output_cb)( | |
| 47 | void (*output_cb)(running_machine *machine); | |
| 46 | 48 | |
| 47 | 49 | /* inputs */ |
| 48 | 50 | int a; /* pin 14 */ |
| r3957 | r3958 | |
| 87 | 89 | chips[which].last_output[0] = chips[which].output[0]; |
| 88 | 90 | chips[which].last_output[1] = chips[which].output[1]; |
| 89 | 91 | |
| 90 | chips[which].output_cb(); | |
| 92 | chips[which].output_cb(chips[which].machine); | |
| 91 | 93 | } |
| 92 | 94 | } |
| 93 | 95 | |
| r3957 | r3958 | |
| 123 | 125 | |
| 124 | 126 | |
| 125 | 127 | |
| 126 | void TTL74153_config(int which, const struct TTL74153_interface *intf) | |
| 128 | void TTL74153_config(running_machine *machine, int which, const struct TTL74153_interface *intf) | |
| 127 | 129 | { |
| 128 | 130 | if (which >= MAX_TTL74153) |
| 129 | 131 | { |
| r3957 | r3958 | |
| 132 | 134 | } |
| 133 | 135 | |
| 134 | 136 | |
| 137 | chips[which].machine = machine; | |
| 135 | 138 | chips[which].output_cb = (intf ? intf->output_cb : 0); |
| 136 | 139 | chips[which].a = 1; |
| 137 | 140 | chips[which].b = 1; |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | /* The interface structure */ |
| 41 | 41 | struct TTL74153_interface |
| 42 | 42 | { |
| 43 | void (*output_cb)( | |
| 43 | void (*output_cb)(running_machine *machine); | |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | 46 | |
| 47 | void TTL74153_config(int which, const struct TTL74153_interface *intf); | |
| 47 | void TTL74153_config(running_machine *machine, int which, const struct TTL74153_interface *intf); | |
| 48 | 48 | |
| 49 | 49 | /* must call TTL74153_update() after setting the inputs */ |
| 50 | 50 | void TTL74153_update(int which); |
| r3957 | r3958 | |
|---|---|---|
| 221 | 221 | // try to open the devices |
| 222 | 222 | for (i = 0; i < interface->scsidevs->devs_present; i++) |
| 223 | 223 | { |
| 224 | SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 224 | SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | state_save_register_global_array(machine, scsi_regs); |
| r3957 | r3958 | |
|---|---|---|
| 242 | 242 | { |
| 243 | 243 | z80dma->is_read = 1; |
| 244 | 244 | z80dma->cur_cycle = (PORTA_IS_SOURCE(z80dma) ? PORTA_CYCLE_LEN(z80dma) : PORTB_CYCLE_LEN(z80dma)); |
| 245 | next = ATTOTIME_IN_HZ( | |
| 245 | next = ATTOTIME_IN_HZ( | |
| 246 | 246 | timer_adjust_periodic(z80dma->timer, |
| 247 | 247 | attotime_zero, |
| 248 | 248 | 0, |
| r3957 | r3958 | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /* set the halt line */ |
| 259 | if (z80dma->intf && z80dma->intf->cpu | |
| 259 | if (z80dma->intf && z80dma->intf->cputag != NULL) | |
| 260 | 260 | { |
| 261 | 261 | //FIXME: Synchronization is done by BUSREQ! |
| 262 | cpu_set_input_line(device->machine | |
| 262 | cputag_set_input_line(device->machine, | |
| 263 | 263 | pending_transfer ? ASSERT_LINE : CLEAR_LINE); |
| 264 | 264 | } |
| 265 | 265 | } |
| r3957 | r3958 | |
| 511 | 511 | case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)z80dma_irq_reti; break; |
| 512 | 512 | |
| 513 | 513 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 514 | case DEVINFO_STR_NAME: info->s = "Z80DMA"; break; | |
| 515 | case DEVINFO_STR_FAMILY: info->s = "DMA controllers"; break; | |
| 516 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 517 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 518 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 514 | case DEVINFO_STR_NAME: strcpy(info->s, "Z80DMA"); break; | |
| 515 | case DEVINFO_STR_FAMILY: strcpy(info->s, "DMA controllers"); break; | |
| 516 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 517 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 518 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #define Z80DMA DEVICE_GET_INFO_NAME(z80dma) |
| 11 | 11 | |
| 12 | #define MDRV_Z80DMA_ADD(_tag, _clock, _config) \ | |
| 13 | MDRV_DEVICE_ADD(_tag, Z80DMA, _clock) \ | |
| 14 | MDRV_DEVICE_CONFIG(_config) | |
| 15 | ||
| 16 | #define MDRV_Z80DMA_REMOVE(_tag) \ | |
| 17 | MDRV_DEVICE_REMOVE(_tag, Z80DMA) | |
| 18 | ||
| 12 | 19 | typedef struct _z80dma_interface z80dma_interface; |
| 13 | 20 | struct _z80dma_interface |
| 14 | 21 | { |
| 15 | 22 | /* CPU to halt when DMA is active */ |
| 16 | | |
| 23 | const char *cputag; | |
| 17 | 24 | |
| 18 | /* clock */ | |
| 19 | int clockhz; | |
| 20 | ||
| 21 | 25 | /* accessors to main memory */ |
| 22 | 26 | read8_device_func memory_read; |
| 23 | 27 | write8_device_func memory_write; |
| r3957 | r3958 | |
|---|---|---|
| 581 | 581 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ppi8255); break; |
| 582 | 582 | |
| 583 | 583 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 584 | case DEVINFO_STR_NAME: info->s = "Intel PPI8255"; break; | |
| 585 | case DEVINFO_STR_FAMILY: info->s = "PPI8255"; break; | |
| 586 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 587 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 588 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 584 | case DEVINFO_STR_NAME: strcpy(info->s, "Intel PPI8255"); break; | |
| 585 | case DEVINFO_STR_FAMILY: strcpy(info->s, "PPI8255"); break; | |
| 586 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 587 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 588 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 589 | 589 | } |
| 590 | 590 | } |
| 591 | 591 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | *********************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | #include "config.h" |
| 15 | 14 | #include "generic.h" |
| 16 | 15 | |
| r3957 | r3958 | |
| 272 | 271 | void nvram_load(running_machine *machine) |
| 273 | 272 | { |
| 274 | 273 | mame_file *nvram_file = NULL; |
| 275 | device_config *device; | |
| 274 | const device_config *device; | |
| 276 | 275 | |
| 277 | 276 | if (machine->config->nvram_handler != NULL) |
| 278 | 277 | { |
| r3957 | r3958 | |
| 280 | 279 | (*machine->config->nvram_handler)(machine, nvram_file, 0); |
| 281 | 280 | } |
| 282 | 281 | |
| 283 | for (device = | |
| 282 | for (device = | |
| 284 | 283 | { |
| 285 | if (device->nvram != NULL) | |
| 284 | device_nvram_func nvram = (device_nvram_func)device_get_info_fct(device, DEVINFO_FCT_NVRAM); | |
| 285 | if (nvram != NULL) | |
| 286 | 286 | { |
| 287 | 287 | if (nvram_file == NULL) |
| 288 | { | |
| 289 | 288 | nvram_file = nvram_fopen(machine, OPEN_FLAG_READ); |
| 290 | } | |
| 291 | ||
| 292 | (*device->nvram)(device, nvram_file, 0); | |
| 289 | (*nvram)(device, nvram_file, 0); | |
| 293 | 290 | } |
| 294 | 291 | } |
| 295 | 292 | |
| 296 | 293 | if (nvram_file != NULL) |
| 297 | { | |
| 298 | 294 | mame_fclose(nvram_file); |
| 299 | } | |
| 300 | 295 | } |
| 301 | 296 | |
| 302 | 297 | |
| r3957 | r3958 | |
| 307 | 302 | void nvram_save(running_machine *machine) |
| 308 | 303 | { |
| 309 | 304 | mame_file *nvram_file = NULL; |
| 310 | device_config *device; | |
| 305 | const device_config *device; | |
| 311 | 306 | |
| 312 | 307 | if (machine->config->nvram_handler != NULL) |
| 313 | 308 | { |
| r3957 | r3958 | |
| 315 | 310 | (*machine->config->nvram_handler)(machine, nvram_file, 1); |
| 316 | 311 | } |
| 317 | 312 | |
| 318 | for (device = | |
| 313 | for (device = | |
| 319 | 314 | { |
| 320 | if (device->nvram != NULL) | |
| 315 | device_nvram_func nvram = (device_nvram_func)device_get_info_fct(device, DEVINFO_FCT_NVRAM); | |
| 316 | if (nvram != NULL) | |
| 321 | 317 | { |
| 322 | 318 | if (nvram_file == NULL) |
| 323 | { | |
| 324 | 319 | nvram_file = nvram_fopen(machine, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); |
| 325 | } | |
| 326 | ||
| 327 | (*device->nvram)(device, nvram_file, 1); | |
| 320 | (*nvram)(device, nvram_file, 1); | |
| 328 | 321 | } |
| 329 | 322 | } |
| 330 | 323 | |
| 331 | 324 | if (nvram_file != NULL) |
| 332 | { | |
| 333 | 325 | mame_fclose(nvram_file); |
| 334 | } | |
| 335 | 326 | } |
| 336 | 327 | |
| 337 | 328 | |
| r3957 | r3958 | |
| 579 | 570 | |
| 580 | 571 | static TIMER_CALLBACK( clear_all_lines ) |
| 581 | 572 | { |
| 582 | int cpunum = param; | |
| 583 | int inputcount = cpu_get_input_lines(machine->cpu[cpunum]); | |
| 573 | const device_config *device = ptr; | |
| 574 | int inputcount = cpu_get_input_lines(device); | |
| 584 | 575 | int line; |
| 585 | 576 | |
| 586 | 577 | /* clear NMI and all inputs */ |
| 587 | cpu_set_input_line( | |
| 578 | cpu_set_input_line(d | |
| 588 | 579 | for (line = 0; line < inputcount; line++) |
| 589 | cpu_set_input_line( | |
| 580 | cpu_set_input_line(d | |
| 590 | 581 | } |
| 591 | 582 | |
| 592 | 583 | |
| r3957 | r3958 | |
| 637 | 628 | disable value for global interrupts |
| 638 | 629 | -------------------------------------------------*/ |
| 639 | 630 | |
| 640 | void cpu_interrupt_enable( | |
| 631 | void cpu_interrupt_enable(const device_config *device, int enabled) | |
| 641 | 632 | { |
| 642 | | |
| 633 | | |
| 643 | 634 | |
| 635 | assert_always(device != NULL, "cpu_interrupt_enable() called for invalid cpu!"); | |
| 636 | ||
| 644 | 637 | /* set the new state */ |
| 645 | 638 | interrupt_enable[cpunum] = enabled; |
| 646 | 639 | |
| 647 | 640 | /* make sure there are no queued interrupts */ |
| 648 | 641 | if (enabled == 0) |
| 649 | timer_call_after_resynch( | |
| 642 | timer_call_after_resynch(device->machine, (void *)device, 0 | |
| 650 | 643 | } |
| 651 | 644 | |
| 652 | 645 | |
| r3957 | r3958 | |
| 657 | 650 | |
| 658 | 651 | WRITE8_HANDLER( interrupt_enable_w ) |
| 659 | 652 | { |
| 660 | cpu_interrupt_enable( | |
| 653 | cpu_interrupt_enable( | |
| 661 | 654 | } |
| 662 | 655 | |
| 663 | 656 |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "deprecat.h" | |
| 16 | 15 | #include "machine/x76f041.h" |
| 17 | 16 | |
| 18 | 17 | #define VERBOSE_LEVEL ( 0 ) |
| r3957 | r3958 | |
| 166 | 165 | state_save_register_item_pointer( machine, "x76f041", NULL, chip, c->data, SIZE_DATA ); |
| 167 | 166 | } |
| 168 | 167 | |
| 169 | void x76f041_cs_write( int chip, int cs ) | |
| 168 | void x76f041_cs_write( running_machine *machine, int chip, int cs ) | |
| 170 | 169 | { |
| 171 | running_machine *machine = Machine; | |
| 172 | 170 | struct x76f041_chip *c; |
| 173 | 171 | |
| 174 | 172 | if( chip >= X76F041_MAXCHIP ) |
| r3957 | r3958 | |
| 198 | 196 | c->cs = cs; |
| 199 | 197 | } |
| 200 | 198 | |
| 201 | void x76f041_rst_write( int chip, int rst ) | |
| 199 | void x76f041_rst_write( running_machine *machine, int chip, int rst ) | |
| 202 | 200 | { |
| 203 | running_machine *machine = Machine; | |
| 204 | 201 | struct x76f041_chip *c; |
| 205 | 202 | |
| 206 | 203 | if( chip >= X76F041_MAXCHIP ) |
| r3957 | r3958 | |
| 285 | 282 | } |
| 286 | 283 | } |
| 287 | 284 | |
| 288 | static void x76f041_load_address( int chip ) | |
| 285 | static void x76f041_load_address( running_machine *machine, int chip ) | |
| 289 | 286 | { |
| 290 | running_machine *machine = Machine; | |
| 291 | 287 | /* todo: handle other bcr bits */ |
| 292 | 288 | struct x76f041_chip *c = &x76f041[ chip ]; |
| 293 | 289 | int bcr; |
| r3957 | r3958 | |
| 340 | 336 | return ( block_offset & 0x180 ) | ( ( block_offset + c->byte ) & 0x7f ); |
| 341 | 337 | } |
| 342 | 338 | |
| 343 | void x76f041_scl_write( int chip, int scl ) | |
| 339 | void x76f041_scl_write( running_machine *machine, int chip, int scl ) | |
| 344 | 340 | { |
| 345 | running_machine *machine = Machine; | |
| 346 | 341 | struct x76f041_chip *c; |
| 347 | 342 | |
| 348 | 343 | if( chip >= X76F041_MAXCHIP ) |
| r3957 | r3958 | |
| 411 | 406 | c->state = STATE_LOAD_ADDRESS; |
| 412 | 407 | break; |
| 413 | 408 | case STATE_LOAD_ADDRESS: |
| 414 | x76f041_load_address( chip ); | |
| 409 | x76f041_load_address( machine, chip ); | |
| 415 | 410 | break; |
| 416 | 411 | case STATE_LOAD_PASSWORD: |
| 417 | 412 | verboselog( machine, 1, "x76f041(%d) -> password: %02x\n", chip, c->shift ); |
| r3957 | r3958 | |
| 512 | 507 | c->scl = scl; |
| 513 | 508 | } |
| 514 | 509 | |
| 515 | void x76f041_sda_write( int chip, int sda ) | |
| 510 | void x76f041_sda_write( running_machine *machine, int chip, int sda ) | |
| 516 | 511 | { |
| 517 | running_machine *machine = Machine; | |
| 518 | 512 | struct x76f041_chip *c; |
| 519 | 513 | |
| 520 | 514 | if( chip >= X76F041_MAXCHIP ) |
| r3957 | r3958 | |
| 567 | 561 | c->sdaw = sda; |
| 568 | 562 | } |
| 569 | 563 | |
| 570 | int x76f041_sda_read( int chip ) | |
| 564 | int x76f041_sda_read( running_machine *machine, int chip ) | |
| 571 | 565 | { |
| 572 | running_machine *machine = Machine; | |
| 573 | 566 | struct x76f041_chip *c; |
| 574 | 567 | |
| 575 | 568 | if( chip >= X76F041_MAXCHIP ) |
| r3957 | r3958 | |
| 589 | 582 | return c->sdar; |
| 590 | 583 | } |
| 591 | 584 | |
| 592 | static void nvram_handler_x76f041( | |
| 585 | static void nvram_handler_x76f041( | |
| 593 | 586 | { |
| 594 | 587 | struct x76f041_chip *c; |
| 595 | 588 | |
| r3957 | r3958 | |
| 619 | 612 | } |
| 620 | 613 | } |
| 621 | 614 | |
| 622 | NVRAM_HANDLER( x76f041_0 ) { nvram_handler_x76f041( 0, machine, file, read_or_write ); } | |
| 623 | NVRAM_HANDLER( x76f041_1 ) { nvram_handler_x76f041( 1, machine, file, read_or_write ); } | |
| 615 | NVRAM_HANDLER( x76f041_0 ) { nvram_handler_x76f041( machine, file, read_or_write, 0 ); } | |
| 616 | NVRAM_HANDLER( x76f041_1 ) { nvram_handler_x76f041( machine, file, read_or_write, 1 ); } |
| r3957 | r3958 | |
|---|---|---|
| 624 | 624 | |
| 625 | 625 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 626 | 626 | case DEVINFO_STR_NAME: /* provided by subclasses */ break; |
| 627 | case DEVINFO_STR_FAMILY: info->s = "SMC91C9X Ethernet Controller";break; | |
| 628 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 629 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 630 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 627 | case DEVINFO_STR_FAMILY: strcpy(info->s, "SMC91C9X Ethernet Controller");break; | |
| 628 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 629 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 630 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 631 | 631 | } |
| 632 | 632 | } |
| 633 | 633 | |
| r3957 | r3958 | |
| 636 | 636 | switch (state) |
| 637 | 637 | { |
| 638 | 638 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 639 | case DEVINFO_STR_NAME: info->s | |
| 639 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 640 | 640 | default: DEVICE_GET_INFO_CALL(smc91c9x); break; |
| 641 | 641 | } |
| 642 | 642 | } |
| r3957 | r3958 | |
| 646 | 646 | switch (state) |
| 647 | 647 | { |
| 648 | 648 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 649 | case DEVINFO_STR_NAME: info->s | |
| 649 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 650 | 650 | default: DEVICE_GET_INFO_CALL(smc91c9x); break; |
| 651 | 651 | } |
| 652 | 652 | } |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | ***************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #define MDRV_PPI8255_ADD(_tag, _intrf) \ |
| 36 | MDRV_DEVICE_ADD(_tag, PPI8255) \ | |
| 36 | MDRV_DEVICE_ADD(_tag, PPI8255, 0) \ | |
| 37 | 37 | MDRV_DEVICE_CONFIG(_intrf) |
| 38 | 38 | |
| 39 | 39 | #define MDRV_PPI8255_RECONFIG(_tag, _intrf) \ |
| r3957 | r3958 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | void generic_pulse_irq_line(const device_config *device, int irqline); |
| 123 | 123 | void generic_pulse_irq_line_and_vector(const device_config *device, int irqline, int vector); |
| 124 | void cpu_interrupt_enable( | |
| 124 | void cpu_interrupt_enable(const device_config *device, int enabled); | |
| 125 | 125 | READ8_HANDLER( interrupt_enable_r ); |
| 126 | 126 | WRITE8_HANDLER( interrupt_enable_w ); |
| 127 | 127 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | #define X76F041_MAXCHIP ( 2 ) |
| 11 | 11 | |
| 12 | 12 | extern void x76f041_init( running_machine *machine, int chip, UINT8 *data ); |
| 13 | extern void x76f041_cs_write( int chip, int cs ); | |
| 14 | extern void x76f041_rst_write( int chip, int rst ); | |
| 15 | extern void x76f041_scl_write( int chip, int scl ); | |
| 16 | extern void x76f041_sda_write( int chip, int sda ); | |
| 17 | extern int x76f041_sda_read( int chip ); | |
| 13 | extern void x76f041_cs_write( running_machine *machine, int chip, int cs ); | |
| 14 | extern void x76f041_rst_write( running_machine *machine, int chip, int rst ); | |
| 15 | extern void x76f041_scl_write( running_machine *machine, int chip, int scl ); | |
| 16 | extern void x76f041_sda_write( running_machine *machine, int chip, int sda ); | |
| 17 | extern int x76f041_sda_read( running_machine *machine, int chip ); | |
| 18 | 18 | extern NVRAM_HANDLER( x76f041_0 ); |
| 19 | 19 | extern NVRAM_HANDLER( x76f041_1 ); |
| 20 | 20 |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | 32 | #define MDRV_SMC91C94_ADD(_tag, _callback) \ |
| 33 | MDRV_DEVICE_ADD(_tag, SMC91C94) \ | |
| 33 | MDRV_DEVICE_ADD(_tag, SMC91C94, 0) \ | |
| 34 | 34 | MDRV_DEVICE_CONFIG_DATAPTR(smc91c9x_config, interrupt, _callback) |
| 35 | 35 | |
| 36 | 36 | #define MDRV_SMC91C96_ADD(_tag, _callback) \ |
| 37 | MDRV_DEVICE_ADD(_tag, SMC91C96) \ | |
| 37 | MDRV_DEVICE_ADD(_tag, SMC91C96, 0) \ | |
| 38 | 38 | MDRV_DEVICE_CONFIG_DATAPTR(smc91c9x_config, interrupt, _callback) |
| 39 | 39 | |
| 40 | 40 | #define MDRV_SMC91C94_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 204 | 204 | |
| 205 | 205 | if (pending_transfer) |
| 206 | 206 | { |
| 207 | next = ATTOTIME_IN_HZ(d | |
| 207 | next = ATTOTIME_IN_HZ(dev | |
| 208 | 208 | timer_adjust_periodic(dma8257->timer, |
| 209 | 209 | attotime_zero, |
| 210 | 210 | 0, |
| r3957 | r3958 | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /* set the halt line */ |
| 221 | if (dma8257->intf && dma8257->intf->cpu | |
| 221 | if (dma8257->intf && dma8257->intf->cputag != NULL) | |
| 222 | 222 | { |
| 223 | cpu_set_input_line(device->machine | |
| 223 | cputag_set_input_line(device->machine, | |
| 224 | 224 | pending_transfer ? ASSERT_LINE : CLEAR_LINE); |
| 225 | 225 | } |
| 226 | 226 | |
| r3957 | r3958 | |
| 413 | 413 | switch (state) |
| 414 | 414 | { |
| 415 | 415 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 416 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(dma8257_t); | |
| 416 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(dma8257_t); | |
| 417 | 417 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 418 | 418 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 419 | 419 | |
| r3957 | r3958 | |
| 424 | 424 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(dma8257);break; |
| 425 | 425 | |
| 426 | 426 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 427 | case DEVINFO_STR_NAME: info->s = "DMA8257"; break; | |
| 428 | case DEVINFO_STR_FAMILY: info->s = "DMA controllers"; break; | |
| 429 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 430 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 431 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 427 | case DEVINFO_STR_NAME: strcpy(info->s, "DMA8257"); break; | |
| 428 | case DEVINFO_STR_FAMILY: strcpy(info->s, "DMA controllers"); break; | |
| 429 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 430 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 431 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 432 | 432 | } |
| 433 | 433 | } |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Z80 PIO | |
| 3 | Z80 PIO im | |
| 4 | 4 | |
| 5 | based on original version (c) 1997, Tatsuyuki Satoh | |
| 6 | ||
| 5 | 7 | Copyright Nicola Salmoria and the MAME Team. |
| 6 | 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | 9 | |
| r3957 | r3958 | |
| 12 | 14 | #include "cpu/z80/z80.h" |
| 13 | 15 | #include "cpu/z80/z80daisy.h" |
| 14 | 16 | |
| 17 | ||
| 18 | ||
| 15 | 19 | /*************************************************************************** |
| 16 | 20 | DEBUGGING |
| 17 | 21 | ***************************************************************************/ |
| 18 | 22 | |
| 19 | #define VERBOSE | |
| 23 | #define VERBOSE | |
| 20 | 24 | |
| 21 | #define | |
| 25 | #define VP | |
| 22 | 26 | |
| 27 | ||
| 28 | ||
| 23 | 29 | /*************************************************************************** |
| 24 | 30 | CONSTANTS |
| 25 | 31 | ***************************************************************************/ |
| 26 | 32 | |
| 27 | enum | |
| 28 | { | |
| 29 | PIO_MODE_OUTPUT = 0, | |
| 30 | PIO_MODE_INPUT, | |
| 31 | PIO_MODE_BIDIRECTIONAL, | |
| 32 | PIO_MODE_CONTROL | |
| 33 | }; | |
| 33 | #define PIO_MODE0 0x00 /* output mode */ | |
| 34 | #define PIO_MODE1 0x01 /* input mode */ | |
| 35 | #define PIO_MODE2 0x02 /* i/o mode */ | |
| 36 | #define PIO_MODE3 0x03 /* bit mode */ | |
| 34 | 37 | |
| 35 | enum | |
| 36 | { | |
| 37 | PIO_STATE_NORMAL = 0, | |
| 38 | PIO_STATE_DDR, | |
| 39 | PIO_STATE_MASK | |
| 40 | }; | |
| 38 | /* pio controll port operation (bit 0-3) */ | |
| 39 | #define PIO_OP_MODE 0x0f /* mode select */ | |
| 40 | #define PIO_OP_INTC 0x07 /* interrupt controll */ | |
| 41 | #define PIO_OP_INTE 0x03 /* interrupt enable */ | |
| 41 | 42 | |
| 42 | enum | |
| 43 | { | |
| 44 | PIO_PORT_A = 0, | |
| 45 | PIO_PORT_B, | |
| 46 | PIO_PORT_COUNT | |
| 47 | }; | |
| 43 | /* pio interrupt controll nit */ | |
| 44 | #define PIO_INT_ENABLE 0x80 /* ENABLE : 0=disable , 1=enable */ | |
| 45 | #define PIO_INT_AND 0x40 /* LOGIC : 0=OR , 1=AND */ | |
| 46 | #define PIO_INT_HIGH 0x20 /* LEVEL : 0=low , 1=high */ | |
| 47 | #define PIO_INT_MASK 0x10 /* MASK : 0=off , 1=on */ | |
| 48 | 48 | |
| 49 | #define PIO_MODE_CONTROL_WORD 0x0f | |
| 50 | #define PIO_IRQ_CONTROL_WORD 0x07 | |
| 51 | #define PIO_IRQ_DISABLE_WORD 0x03 | |
| 52 | 49 | |
| 53 | #define PIO_IRQ_MASK_FOLLOWS 0x10 | |
| 54 | #define PIO_IRQ_ACTIVE_HIGH 0x20 | |
| 55 | #define PIO_IRQ_AND 0x40 | |
| 56 | #define PIO_IRQ_ENABLE 0x80 | |
| 57 | 50 | |
| 58 | 51 | /*************************************************************************** |
| 59 | 52 | TYPE DEFINITIONS |
| r3957 | r3958 | |
| 62 | 55 | typedef struct _z80pio z80pio_t; |
| 63 | 56 | struct _z80pio |
| 64 | 57 | { |
| 65 | const z80pio_interface *intf; /* interface */ | |
| 58 | UINT8 vector[2]; /* interrupt vector */ | |
| 59 | void (*intr)(const device_config *, int which); /* interrupt callbacks */ | |
| 60 | void (*rdyr[2])(const device_config *, int data); /* RDY active callback */ | |
| 61 | read8_device_func port_read[2]; /* port read callbacks */ | |
| 62 | write8_device_func port_write[2]; /* port write callbacks */ | |
| 63 | UINT8 mode[2]; /* mode 00=in,01=out,02=i/o,03=bit*/ | |
| 64 | UINT8 enable[2]; /* interrupt enable */ | |
| 65 | UINT8 mask[2]; /* mask folowers */ | |
| 66 | UINT8 dir[2]; /* direction (bit mode) */ | |
| 67 | UINT8 rdy[2]; /* ready pin level */ | |
| 68 | UINT8 in[2]; /* input port data */ | |
| 69 | UINT8 out[2]; /* output port */ | |
| 70 | UINT8 strobe[2]; /* strobe inputs */ | |
| 71 | UINT8 int_state[2]; /* interrupt status (daisy chain) */ | |
| 72 | }; | |
| 66 | 73 | |
| 67 | int clock; /* clock frequency */ | |
| 68 | 74 | |
| 69 | int state[PIO_PORT_COUNT]; /* control register state */ | |
| 70 | int mode[PIO_PORT_COUNT]; /* mode control register */ | |
| 71 | int irq_enable[PIO_PORT_COUNT]; /* interrupt enable flag */ | |
| 72 | int irq_pending[PIO_PORT_COUNT]; /* interrupt pending flag */ | |
| 73 | int int_state[PIO_PORT_COUNT]; /* interrupt status */ | |
| 74 | UINT8 enable[PIO_PORT_COUNT]; /* interrupt control word */ | |
| 75 | UINT8 input[PIO_PORT_COUNT]; /* data input register */ | |
| 76 | UINT8 output[PIO_PORT_COUNT]; /* data output register */ | |
| 77 | UINT8 vector[PIO_PORT_COUNT]; /* interrupt vector */ | |
| 78 | UINT8 mask[PIO_PORT_COUNT]; /* mask register */ | |
| 79 | UINT8 ddr[PIO_PORT_COUNT]; /* input/output select register */ | |
| 80 | int strobe[PIO_PORT_COUNT]; /* strobe pulse */ | |
| 81 | int match[PIO_PORT_COUNT]; /* control mode bit logic equation match */ | |
| 82 | 75 | |
| 83 | /* timers */ | |
| 84 | emu_timer *poll_timer; /* mode 3 poll timer */ | |
| 85 | emu_timer *irq_timer; /* interrupt enable timer */ | |
| 86 | }; | |
| 87 | ||
| 88 | 76 | /*************************************************************************** |
| 89 | 77 | FUNCTION PROTOTYPES |
| 90 | 78 | ***************************************************************************/ |
| r3957 | r3958 | |
| 93 | 81 | static int z80pio_irq_ack(const device_config *device); |
| 94 | 82 | static void z80pio_irq_reti(const device_config *device); |
| 95 | 83 | |
| 84 | ||
| 85 | ||
| 96 | 86 | /*************************************************************************** |
| 97 | 87 | INLINE FUNCTIONS |
| 98 | 88 | ***************************************************************************/ |
| r3957 | r3958 | |
| 102 | 92 | assert(device != NULL); |
| 103 | 93 | assert(device->token != NULL); |
| 104 | 94 | assert(device->type == Z80PIO); |
| 105 | ||
| 106 | 95 | return (z80pio_t *)device->token; |
| 107 | 96 | } |
| 108 | 97 | |
| 98 | ||
| 109 | 99 | /*************************************************************************** |
| 110 | 100 | INTERNAL STATE MANAGEMENT |
| 111 | 101 | ***************************************************************************/ |
| 112 | 102 | |
| 113 | ||
| 103 | INLINE void s | |
| 114 | 104 | { |
| 115 | z80pio_t *z80pio = get_safe_token(device); | |
| 116 | int channel; | |
| 105 | z80pio_t *z80pio = get_safe_token( device ); | |
| 106 | /* set state */ | |
| 107 | z80pio->rdy[ch] = state; | |
| 117 | 108 | |
| 118 | for (channel = PIO_PORT_A; channel < PIO_PORT_COUNT; channel++) | |
| 119 | { | |
| 120 | if (z80pio->irq_enable[channel]) | |
| 121 | { | |
| 122 | if (z80pio->irq_pending[channel]) | |
| 123 | { | |
| 124 | /* trigger interrupt request */ | |
| 125 | z80pio->int_state[channel] |= Z80_DAISY_INT; | |
| 126 | ||
| 127 | /* reset interrupt pending */ | |
| 128 | z80pio->irq_pending[channel] = 0; | |
| 129 | ||
| 130 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Request\n", device->tag, 'A' + channel); | |
| 131 | } | |
| 132 | } | |
| 133 | else | |
| 134 | { | |
| 135 | /* clear interrupt request */ | |
| 136 | z80pio->int_state[channel] &= ~Z80_DAISY_INT; | |
| 137 | } | |
| 138 | } | |
| 139 | ||
| 140 | if (z80pio->intf->on_int_changed) | |
| 141 | { | |
| 142 | z80pio->intf->on_int_changed(device, (z80pio_irq_state(device) & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE); | |
| 143 | } | |
| 109 | /* call callback with state */ | |
| 110 | if (z80pio->rdyr[ch]) | |
| 111 | z80pio->rdyr[ch](device, z80pio->rdy[ch]); | |
| 144 | 112 | } |
| 145 | 113 | |
| 146 | static void z80pio_trigger_interrupt(const device_config *device, int channel) | |
| 147 | { | |
| 148 | z80pio_t *z80pio = get_safe_token(device); | |
| 149 | 114 | |
| 150 | if (z80pio->irq_enable[channel]) | |
| 151 | { | |
| 152 | z80pio->int_state[channel] |= Z80_DAISY_INT; | |
| 153 | z80pio_check_interrupt(device); | |
| 154 | ||
| 155 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Request\n", device->tag, 'A' + channel); | |
| 156 | } | |
| 157 | else | |
| 158 | { | |
| 159 | /* set interrupt pending */ | |
| 160 | z80pio->irq_pending[channel] = 1; | |
| 161 | z80pio_check_interrupt(device); | |
| 162 | ||
| 163 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Pending\n", device->tag, 'A' + channel); | |
| 164 | } | |
| 165 | } | |
| 166 | ||
| 167 | static TIMER_CALLBACK( z80pio_irq_tick ) | |
| 115 | INLINE void interrupt_check(const device_config *device) | |
| 168 | 116 | { |
| 169 | const device_config *device = (device_config *) ptr; | |
| 170 | z80pio_t *z80pio = get_safe_token(device); | |
| 117 | z80pio_t *z80pio = get_safe_token( device ); | |
| 171 | 118 | |
| 172 | int channel = BIT(param, 1); | |
| 173 | int state = BIT(param, 0); | |
| 174 | ||
| 175 | /* set interrupt enable */ | |
| 176 | z80pio->irq_enable[channel] = state; | |
| 177 | ||
| 178 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Enable %u\n", device->tag, 'A' + channel, state); | |
| 179 | ||
| 180 | /* check interrupt status */ | |
| 181 | z80pio_check_interrupt(device); | |
| 119 | /* if we have a callback, update it with the current state */ | |
| 120 | if (z80pio->intr) | |
| 121 | z80pio->intr(device, (z80pio_irq_state(device) & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE); | |
| 182 | 122 | } |
| 183 | 123 | |
| 184 | static void z80pio_set_irq_enable(const device_config *device, int channel, int state) | |
| 185 | { | |
| 186 | z80pio_t *z80pio = get_safe_token(device); | |
| 187 | 124 | |
| 188 | if (state) | |
| 189 | { | |
| 190 | /* enable interrupt on next _M1 */ | |
| 191 | int param = (channel << 1) | state; | |
| 192 | ||
| 193 | timer_adjust_oneshot(z80pio->irq_timer, ATTOTIME_IN_HZ(z80pio->clock * 4), param); | |
| 194 | } | |
| 195 | else | |
| 196 | { | |
| 197 | /* disable interrupt immediately */ | |
| 198 | z80pio->irq_enable[channel] = state; | |
| 199 | ||
| 200 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Enable %u\n", device->tag, 'A' + channel, state); | |
| 201 | } | |
| 202 | } | |
| 203 | ||
| 204 | static void z80pio_ready_w(const device_config *device, int channel, int state) | |
| 125 | static void update_irq_state(const device_config *device, int ch) | |
| 205 | 126 | { |
| 206 | z80pio_t *z80pio = get_safe_token(device); | |
| 127 | z80pio_t *z80pio = get_safe_token( device ); | |
| 128 | int old_state = z80pio->int_state[ch]; | |
| 129 | int irq = 0; | |
| 130 | int data; | |
| 131 | if (z80pio->mode[ch] == 0x13 || (z80pio->enable[ch] & PIO_INT_MASK)) return; | |
| 207 | 132 | |
| 208 | LOGERROR("Z80PIO \"%s\" Port %c : Ready %u\n", device->tag, 'A' + channel, state); | |
| 209 | ||
| 210 | if (channel == PIO_PORT_A) | |
| 133 | /* only check if interrupts are enabled */ | |
| 134 | if (z80pio->enable[ch] & PIO_INT_ENABLE) | |
| 211 | 135 | { |
| 212 | if (z80pio->intf->on_ardy_changed) | |
| 136 | /* in mode 3, interrupts are tricky */ | |
| 137 | if (z80pio->mode[ch] == PIO_MODE3) | |
| 213 | 138 | { |
| 214 | z80pio->intf->on_ardy_changed(device, state); | |
| 215 | } | |
| 216 | } | |
| 217 | else | |
| 218 | { | |
| 219 | if (z80pio->intf->on_brdy_changed) | |
| 220 | { | |
| 221 | z80pio->intf->on_brdy_changed(device, state); | |
| 222 | } | |
| 223 | } | |
| 224 | } | |
| 139 | /* fetch input data (ignore output lines) */ | |
| 140 | data = z80pio->in[ch] & z80pio->dir[ch]; | |
| 225 | 141 | |
| 226 | static UINT8 z80pio_port_r(const device_config *device, int channel) | |
| 227 | { | |
| 228 | z80pio_t *z80pio = get_safe_token(device); | |
| 229 | UINT8 data = 0; | |
| 142 | /* keep only relevant bits */ | |
| 143 | data &= ~z80pio->mask[ch]; | |
| 230 | 144 | |
| 231 | if (channel == PIO_PORT_A) | |
| 232 | { | |
| 233 | if (z80pio->intf->port_a_r) | |
| 234 | { | |
| 235 | data = z80pio->intf->port_a_r(device, 0); | |
| 236 | } | |
| 237 | } | |
| 238 | else | |
| 239 | { | |
| 240 | if (z80pio->intf->port_b_r) | |
| 241 | { | |
| 242 | data = z80pio->intf->port_b_r(device, 0); | |
| 243 | } | |
| 244 | } | |
| 145 | /* if active low, invert the bits */ | |
| 146 | if (!(z80pio->enable[ch] & PIO_INT_HIGH)) | |
| 147 | data ^= z80pio->mask[ch]; | |
| 245 | 148 | |
| 246 | //LOGERROR("Z80PIO \"%s\" Port %c : Input Data '%02x'\n", device->tag, 'A' + channel, data); | |
| 149 | /* if AND logic, interrupt if all bits are set */ | |
| 150 | if (z80pio->enable[ch] & PIO_INT_AND) | |
| 151 | irq = (data == z80pio->mask[ch]); | |
| 247 | 152 | |
| 248 | return data; | |
| 249 | } | |
| 153 | /* otherwise, interrupt if at least one bit is set */ | |
| 154 | else | |
| 155 | irq = (data != 0); | |
| 250 | 156 | |
| 251 | static void z80pio_port_w(const device_config *device, int channel) | |
| 252 | { | |
| 253 | z80pio_t *z80pio = get_safe_token(device); | |
| 254 | UINT8 data = z80pio->output[channel]; | |
| 157 | /* if portB, portA mode 2 check */ | |
| 158 | if (ch && (z80pio->mode[0] == PIO_MODE2)) | |
| 159 | { | |
| 160 | if (z80pio->rdy[ch] == 0) | |
| 161 | irq = 1; | |
| 162 | } | |
| 163 | } | |
| 255 | 164 | |
| 256 | if (z80pio->mode[channel] == PIO_MODE_CONTROL) | |
| 257 | { | |
| 258 | /* mask input pins */ | |
| 259 | data &= ~z80pio->ddr[channel]; | |
| 165 | /* otherwise, just interrupt when ready is cleared */ | |
| 166 | else | |
| 167 | irq = (z80pio->rdy[ch] == 0); | |
| 260 | 168 | } |
| 261 | 169 | |
| 262 | if (channel == PIO_PORT_A) | |
| 263 | { | |
| 264 | if (z80pio->intf->port_a_w) | |
| 265 | { | |
| 266 | z80pio->intf->port_a_w(device, 0, data); | |
| 267 | } | |
| 268 | } | |
| 170 | if (irq) | |
| 171 | z80pio->int_state[ch] |= Z80_DAISY_INT; | |
| 269 | 172 | else |
| 270 | { | |
| 271 | if (z80pio->intf->port_b_w) | |
| 272 | { | |
| 273 | z80pio->intf->port_b_w(device, 0, data); | |
| 274 | } | |
| 275 | } | |
| 173 | z80pio->int_state[ch] &= ~Z80_DAISY_INT; | |
| 276 | 174 | |
| 277 | //LOGERROR("Z80PIO \"%s\" Port %c : Output Data '%02x'\n", device->tag, 'A' + channel, data); | |
| 175 | if (old_state != z80pio->int_state[ch]) | |
| 176 | interrupt_check(device); | |
| 278 | 177 | } |
| 279 | 178 | |
| 280 | static void z80pio_set_mode(const device_config *device, int channel, UINT8 data) | |
| 281 | { | |
| 282 | z80pio_t *z80pio = get_safe_token(device); | |
| 283 | 179 | |
| 284 | int mode = data >> 6; | |
| 285 | 180 | |
| 286 | switch (mode) | |
| 287 | { | |
| 288 | case PIO_MODE_OUTPUT: | |
| 289 | LOGERROR("Z80PIO \"%s\" Port %c : Mode %u (Byte Output)\n", device->tag, 'A' + channel, mode); | |
| 290 | ||
| 291 | /* set mode */ | |
| 292 | z80pio->mode[channel] = mode; | |
| 293 | ||
| 294 | /* enable data output */ | |
| 295 | z80pio_port_w(device, channel); | |
| 296 | ||
| 297 | /* assert ready line */ | |
| 298 | z80pio_ready_w(device, channel, 1); | |
| 299 | break; | |
| 300 | ||
| 301 | case PIO_MODE_INPUT: | |
| 302 | LOGERROR("Z80PIO \"%s\" Port %c : Mode %u (Byte Input)\n", device->tag, 'A' + channel, mode); | |
| 303 | ||
| 304 | /* set mode */ | |
| 305 | z80pio->mode[channel] = mode; | |
| 306 | break; | |
| 307 | ||
| 308 | case PIO_MODE_BIDIRECTIONAL: | |
| 309 | if (channel == PIO_PORT_A) | |
| 310 | { | |
| 311 | LOGERROR("Z80PIO \"%s\" Port %c : Mode %u (Bidirectional)\n", device->tag, 'A' + channel, mode); | |
| 312 | ||
| 313 | /* set mode */ | |
| 314 | z80pio->mode[channel] = mode; | |
| 315 | } | |
| 316 | break; | |
| 317 | ||
| 318 | case PIO_MODE_CONTROL: | |
| 319 | LOGERROR("Z80PIO \"%s\" Port %c : Mode %u (Bit Control)\n", device->tag, 'A' + channel, mode); | |
| 320 | ||
| 321 | /* set mode */ | |
| 322 | z80pio->mode[channel] = mode; | |
| 323 | ||
| 324 | if ((channel == PIO_PORT_A) || (z80pio->mode[PIO_PORT_A] != PIO_MODE_BIDIRECTIONAL)) | |
| 325 | { | |
| 326 | /* clear ready line */ | |
| 327 | z80pio_ready_w(device, channel, 0); | |
| 328 | } | |
| 329 | ||
| 330 | /* disable interrupts until DDR is written */ | |
| 331 | z80pio_set_irq_enable(device, channel, 0); | |
| 332 | ||
| 333 | /* set logic equation to false */ | |
| 334 | z80pio->match[channel] = 0; | |
| 335 | ||
| 336 | /* next word is I/O control */ | |
| 337 | z80pio->state[channel] = PIO_STATE_DDR; | |
| 338 | break; | |
| 339 | } | |
| 340 | } | |
| 341 | ||
| 342 | 181 | /*************************************************************************** |
| 343 | 182 | CONTROL REGISTER READ/WRITE |
| 344 | 183 | ***************************************************************************/ |
| 345 | 184 | |
| 346 | RE | |
| 185 | WRITE | |
| 347 | 186 | { |
| 348 | z80pio_t *z80pio = get_safe_token(device); | |
| 187 | z80pio_t *z80pio = get_safe_token( device ); | |
| 349 | 188 | |
| 350 | return (z80pio->enable[PIO_PORT_A] & 0xc0) | (z80pio->enable[PIO_PORT_B] >> 4); | |
| 351 | } | |
| 189 | /* There are only 2 channels */ | |
| 190 | offset &= 0x01; | |
| 352 | 191 | |
| 353 | READ8_DEVICE_HANDLER( z80pio_c_r ) | |
| 354 | { | |
| 355 | return 0; | |
| 356 | } | |
| 192 | /* load direction phase ? */ | |
| 193 | if (z80pio->mode[offset] == 0x13) | |
| 194 | { | |
| 195 | VPRINTF(("PIO-%c Bits %02x\n", 'A' + offset, data)); | |
| 196 | z80pio->dir[offset] = data; | |
| 197 | z80pio->mode[offset] = 0x03; | |
| 198 | return; | |
| 199 | } | |
| 357 | 200 | |
| 358 | WRITE8_DEVICE_HANDLER( z80pio_c_w ) | |
| 359 | { | |
| 360 | z80pio_t *z80pio = get_safe_token(device); | |
| 361 | int channel = offset & 0x01; | |
| 201 | /* load mask folows phase ? */ | |
| 202 | if (z80pio->enable[offset] & PIO_INT_MASK) | |
| 203 | { | |
| 204 | /* load mask folows */ | |
| 205 | z80pio->mask[offset] = data; | |
| 206 | z80pio->enable[offset] &= ~PIO_INT_MASK; | |
| 207 | VPRINTF(("PIO-%c interrupt mask %02x\n",'A'+offset,data )); | |
| 208 | return; | |
| 209 | } | |
| 362 | 210 | |
| 363 | switch ( | |
| 211 | switch (d | |
| 364 | 212 | { |
| 365 | case PIO_STATE_NORMAL: | |
| 366 | if (!BIT(data, 0)) | |
| 367 | { | |
| 368 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Vector Word '%02x'\n", device->tag, 'A' + channel, z80pio->vector[channel]); | |
| 213 | case PIO_OP_MODE: /* mode select 0=out,1=in,2=i/o,3=bit */ | |
| 214 | z80pio->mode[offset] = (data >> 6); | |
| 215 | VPRINTF(("PIO-%c Mode %x\n", 'A' + offset, z80pio->mode[offset])); | |
| 216 | if (z80pio->mode[offset] == 0x03) | |
| 217 | z80pio->mode[offset] = 0x13; | |
| 218 | return; | |
| 369 | 219 | |
| 370 | /* load interrupt vector */ | |
| 371 | z80pio->vector[channel] = data & 0xfe; | |
| 372 | } | |
| 373 | else if ((data & 0x0f) == PIO_IRQ_DISABLE_WORD) | |
| 374 | { | |
| 375 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Disable Word '%02x'\n", device->tag, 'A' + channel, data); | |
| 220 | case PIO_OP_INTC: /* interrupt control */ | |
| 221 | z80pio->enable[offset] = data & 0xf0; | |
| 222 | z80pio->mask[offset] = 0x00; | |
| 223 | /* when interrupt enable , set vector request flag */ | |
| 224 | VPRINTF(("PIO-%c Controll %02x\n", 'A' + offset, data)); | |
| 225 | break; | |
| 376 | 226 | |
| 377 | /* set interrupt enable */ | |
| 378 | z80pio->enable[channel] = (data & 0x80) | (z80pio->enable[channel] & 0x7f); | |
| 379 | z80pio_set_irq_enable(device, channel, BIT(data, 7)); | |
| 380 | } | |
| 381 | else if ((data & 0x0f) == PIO_MODE_CONTROL_WORD) | |
| 382 | { | |
| 383 | LOGERROR("Z80PIO \"%s\" Port %c : Mode Control Word '%02x'\n", device->tag, 'A' + channel, data); | |
| 227 | case PIO_OP_INTE: /* interrupt enable controll */ | |
| 228 | z80pio->enable[offset] &= ~PIO_INT_ENABLE; | |
| 229 | z80pio->enable[offset] |= (data & PIO_INT_ENABLE); | |
| 230 | VPRINTF(("PIO-%c enable %02x\n", 'A' + offset, data & 0x80)); | |
| 231 | break; | |
| 384 | 232 | |
| 385 | /* set operating mode */ | |
| 386 | z80pio_set_mode(device, channel, data); | |
| 387 | } | |
| 388 | else if ((data & 0x0f) == PIO_IRQ_CONTROL_WORD) | |
| 389 | { | |
| 390 | LOGERROR("Z80PIO \"%s\" Port %c : Interrupt Control Word '%02x'\n", device->tag, 'A' + channel, data); | |
| 391 | ||
| 392 | /* set interrupt control word */ | |
| 393 | z80pio->enable[channel] = data & 0xf0; | |
| 394 | ||
| 395 | if (data & PIO_IRQ_MASK_FOLLOWS) | |
| 233 | default: | |
| 234 | if (!(data & 1)) | |
| 396 | 235 | { |
| 397 | /* disable interrupts until mask is written */ | |
| 398 | z80pio_set_irq_enable(device, channel, 0); | |
| 399 | ||
| 400 | /* reset pending interrupt */ | |
| 401 | z80pio->irq_pending[channel] = 0; | |
| 402 | ||
| 403 | /* set logic equation to false */ | |
| 404 | z80pio->match[channel] = 0; | |
| 405 | ||
| 406 | /* next word is mask control */ | |
| 407 | z80pio->state[channel] = PIO_STATE_MASK; | |
| 236 | z80pio->vector[offset] = data; | |
| 237 | VPRINTF(("PIO-%c vector %02x\n", 'A' + offset, data)); | |
| 408 | 238 | } |
| 409 | 239 | else |
| 410 | { | |
| 411 | /* set interrupt enable */ | |
| 412 | z80pio_set_irq_enable(device, channel, BIT(data, 7)); | |
| 413 | } | |
| 414 | } | |
| 415 | break; | |
| 240 | VPRINTF(("PIO-%c illegal command %02x\n", 'A' + offset, data)); | |
| 241 | break; | |
| 242 | } | |
| 416 | 243 | |
| 417 | case PIO_STATE_DDR: | |
| 418 | LOGERROR("Z80PIO \"%s\" Port %c : I/O Control Word '%02x'\n", device->tag, 'A' + channel, data); | |
| 244 | /* interrupt check */ | |
| 245 | update_irq_state(device, offset); | |
| 246 | } | |
| 419 | 247 | |
| 420 | /* set data direction */ | |
| 421 | z80pio->ddr[channel] = data; | |
| 422 | 248 | |
| 423 | /* set interrupt enable */ | |
| 424 | z80pio_set_irq_enable(device, channel, BIT(z80pio->enable[channel], 7)); | |
| 249 | READ8_DEVICE_HANDLER( z80pio_c_r ) | |
| 250 | { | |
| 251 | /* There are only 2 channels */ | |
| 252 | offset &= 0x01; | |
| 425 | 253 | |
| 426 | /* next word is indeterminate */ | |
| 427 | z80pio->state[channel] = PIO_STATE_NORMAL; | |
| 428 | break; | |
| 254 | VPRINTF(("PIO-%c controll read\n", 'A' + offset )); | |
| 255 | return 0; | |
| 256 | } | |
| 429 | 257 | |
| 430 | case PIO_STATE_MASK: | |
| 431 | LOGERROR("Z80PIO \"%s\" Port %c : Mask Control Word '%02x'\n", device->tag, 'A' + channel, data); | |
| 432 | 258 | |
| 433 | /* set interrupt mask */ | |
| 434 | z80pio->mask[channel] = data; | |
| 435 | 259 | |
| 436 | /* set interrupt enable */ | |
| 437 | z80pio_set_irq_enable(device, channel, BIT(z80pio->enable[channel], 7)); | |
| 438 | ||
| 439 | /* next word is indeterminate */ | |
| 440 | z80pio->state[channel] = PIO_STATE_NORMAL; | |
| 441 | break; | |
| 442 | } | |
| 443 | } | |
| 444 | ||
| 445 | 260 | /*************************************************************************** |
| 446 | 261 | DATA REGISTER READ/WRITE |
| 447 | 262 | ***************************************************************************/ |
| 448 | 263 | |
| 449 | RE | |
| 264 | WRITE | |
| 450 | 265 | { |
| 451 | 266 | z80pio_t *z80pio = get_safe_token( device ); |
| 452 | int channel = offset & 0x01; | |
| 453 | UINT8 data = 0; | |
| 454 | 267 | |
| 455 | switch (z80pio->mode[channel]) | |
| 456 | { | |
| 457 | case PIO_MODE_OUTPUT: | |
| 458 | data = z80pio->output[channel]; | |
| 459 | break; | |
| 268 | /* There are only 2 channels */ | |
| 269 | offset &= 0x01; | |
| 460 | 270 | |
| 461 | case PIO_MODE_INPUT: | |
| 462 | data = z80pio->input[channel]; | |
| 271 | z80pio->out[offset] = data; /* latch out data */ | |
| 272 | if(z80pio->port_write[offset]) | |
| 273 | z80pio->port_write[offset](device, 0, data); | |
| 463 | 274 | |
| 464 | /* clear ready line */ | |
| 465 | z80pio_ready_w(device, channel, 0); | |
| 275 | switch (z80pio->mode[offset]) | |
| 276 | { | |
| 277 | case PIO_MODE0: /* mode 0 output */ | |
| 278 | case PIO_MODE2: /* mode 2 i/o */ | |
| 279 | set_rdy(device, offset, 1); /* ready = H */ | |
| 280 | update_irq_state(device, offset); | |
| 281 | return; | |
| 466 | 282 | |
| 467 | /* assert ready line */ | |
| 468 | z80pio_ready_w(device, channel, 1); | |
| 469 | break; | |
| 283 | case PIO_MODE1: /* mode 1 input */ | |
| 284 | case PIO_MODE3: /* mode 0 bit */ | |
| 285 | return; | |
| 470 | 286 | |
| 471 | case PIO_MODE_BIDIRECTIONAL: | |
| 472 | data = z80pio->input[PIO_PORT_A] | (z80pio->output[PIO_PORT_A] & (~z80pio->ddr[PIO_PORT_A])); | |
| 473 | ||
| 474 | /* clear ready line */ | |
| 475 | z80pio_ready_w(device, 1, 0); | |
| 476 | ||
| 477 | /* assert ready line */ | |
| 478 | z80pio_ready_w(device, 1, 1); | |
| 479 | break; | |
| 480 | ||
| 481 | case PIO_MODE_CONTROL: | |
| 482 | z80pio->input[channel] = z80pio_port_r(device, channel); | |
| 483 | ||
| 484 | data = (z80pio->input[channel] & z80pio->ddr[channel]) | (z80pio->output[channel] & (~z80pio->ddr[channel])); | |
| 485 | break; | |
| 287 | default: | |
| 288 | VPRINTF(("PIO-%c data write,bad mode\n",'A'+offset )); | |
| 486 | 289 | } |
| 487 | ||
| 488 | LOGERROR("Z80PIO \"%s\" Port %c : Data Register Read '%02x'\n", device->tag, 'A' + channel, data); | |
| 489 | ||
| 490 | return data; | |
| 491 | 290 | } |
| 492 | 291 | |
| 493 | WRITE8_DEVICE_HANDLER( z80pio_d_w ) | |
| 292 | ||
| 293 | READ8_DEVICE_HANDLER( z80pio_d_r ) | |
| 494 | 294 | { |
| 495 | 295 | z80pio_t *z80pio = get_safe_token( device ); |
| 496 | int channel = offset & 0x01; | |
| 497 | 296 | |
| 498 | LOGERROR("Z80PIO \"%s\" Port %c : Data Register Write '%02x'\n", device->tag, 'A' + channel, data); | |
| 297 | /* There are only 2 channels */ | |
| 298 | offset &= 0x01; | |
| 499 | 299 | |
| 500 | switch (z80pio->mode[ | |
| 300 | switch (z80pio->mode[offs | |
| 501 | 301 | { |
| 502 | case PIO_MODE_OUTPUT: | |
| 503 | /* clear ready line */ | |
| 504 | z80pio_ready_w(device, channel, 0); | |
| 302 | case PIO_MODE0: /* mode 0 output */ | |
| 303 | return z80pio->out[offset]; | |
| 505 | 304 | |
| 506 | /* output data */ | |
| 507 | z80pio->output[channel] = data; | |
| 508 | z80pio_port_w(device, channel); | |
| 305 | case PIO_MODE1: /* mode 1 input */ | |
| 306 | set_rdy(device, offset, 1); /* ready = H */ | |
| 307 | if(z80pio->port_read[offset]) | |
| 308 | z80pio->in[offset] = z80pio->port_read[offset](device, 0); | |
| 309 | update_irq_state(device, offset); | |
| 310 | return z80pio->in[offset]; | |
| 509 | 311 | |
| 510 | /* assert ready line */ | |
| 511 | z80pio_ready_w(device, channel, 1); | |
| 512 | break; | |
| 312 | case PIO_MODE2: /* mode 2 i/o */ | |
| 313 | if (offset) VPRINTF(("PIO-B mode 2 \n")); | |
| 314 | set_rdy(device, 1, 1); /* brdy = H */ | |
| 315 | if(z80pio->port_read[offset]) | |
| 316 | z80pio->in[offset] = z80pio->port_read[offset](device, 0); | |
| 317 | update_irq_state(device, offset); | |
| 318 | return z80pio->in[offset]; | |
| 513 | 319 | |
| 514 | case PIO_MODE_INPUT: | |
| 515 | /* do nothing */ | |
| 516 | break; | |
| 517 | ||
| 518 | case PIO_MODE_BIDIRECTIONAL: | |
| 519 | /* clear ready line */ | |
| 520 | z80pio_ready_w(device, channel, 0); | |
| 521 | ||
| 522 | /* latch output data */ | |
| 523 | z80pio->output[channel] = data; | |
| 524 | ||
| 525 | if (!z80pio->strobe[channel]) | |
| 526 | { | |
| 527 | /* output data if ASTB active */ | |
| 528 | z80pio_port_w(device, channel); | |
| 529 | } | |
| 530 | ||
| 531 | /* assert ready line */ | |
| 532 | z80pio_ready_w(device, channel, 1); | |
| 533 | break; | |
| 534 | ||
| 535 | case PIO_MODE_CONTROL: | |
| 536 | /* output data */ | |
| 537 | z80pio->output[channel] = data; | |
| 538 | z80pio_port_w(device, channel); | |
| 539 | break; | |
| 320 | case PIO_MODE3: /* mode 3 bit */ | |
| 321 | if(z80pio->port_read[offset]) | |
| 322 | z80pio->in[offset] = z80pio->port_read[offset](device, 0); | |
| 323 | return (z80pio->in[offset] & z80pio->dir[offset]) | (z80pio->out[offset] & ~z80pio->dir[offset]); | |
| 540 | 324 | } |
| 325 | VPRINTF(("PIO-%c data read,bad mode\n",'A'+offset )); | |
| 326 | return 0; | |
| 541 | 327 | } |
| 542 | 328 | |
| 329 | ||
| 330 | ||
| 543 | 331 | /*************************************************************************** |
| 544 | | |
| 332 | P | |
| 545 | 333 | ***************************************************************************/ |
| 546 | 334 | |
| 547 | ||
| 335 | WR | |
| 548 | 336 | { |
| 549 | const device_config *device = (device_config *) ptr; | |
| 550 | z80pio_t *z80pio = get_safe_token(device); | |
| 551 | int channel; | |
| 337 | z80pio_t *z80pio = get_safe_token( device ); | |
| 552 | 338 | |
| 553 | for (channel = PIO_PORT_A; channel < PIO_PORT_COUNT; channel++) | |
| 339 | /* There are only 2 channels */ | |
| 340 | offset &= 0x01; | |
| 341 | ||
| 342 | z80pio->in[offset] = data; | |
| 343 | switch (z80pio->mode[offset]) | |
| 554 | 344 | { |
| 555 | if ((z80pio->mode[channel] == PIO_MODE_CONTROL) && (z80pio->mask[channel] != 0xff)) | |
| 556 | { | |
| 557 | int bit; | |
| 558 | int match = 0; | |
| 345 | case PIO_MODE0: | |
| 346 | VPRINTF(("PIO-%c OUTPUT mode and data write\n",'A'+offset )); | |
| 347 | break; | |
| 559 | 348 | |
| 560 | int edge = (z80pio->enable[channel] & PIO_IRQ_ACTIVE_HIGH) ? 1 : 0; | |
| 349 | case PIO_MODE2: /* only port A */ | |
| 350 | offset = 1; /* handshake and IRQ is use portB */ | |
| 561 | 351 | |
| 562 | UINT8 mask = z80pio->mask[channel]; | |
| 563 | UINT8 ddr = z80pio->ddr[channel]; | |
| 564 | UINT8 old_data = z80pio->input[channel] & ddr; | |
| 565 | UINT8 data = z80pio_port_r(device, channel) & ddr; | |
| 352 | case PIO_MODE1: | |
| 353 | set_rdy(device, offset, 0); | |
| 354 | update_irq_state(device, offset); | |
| 355 | break; | |
| 566 | 356 | |
| 567 | if (old_data == data) continue; | |
| 357 | case PIO_MODE3: | |
| 358 | /* irq check */ | |
| 359 | update_irq_state(device, offset); | |
| 360 | break; | |
| 361 | } | |
| 362 | } | |
| 568 | 363 | |
| 569 | for (bit = 0; bit < 8; bit++) | |
| 570 | { | |
| 571 | if (BIT(mask, bit)) continue; /* masked out */ | |
| 572 | if (!BIT(ddr, bit)) continue; /* output bit */ | |
| 573 | 364 | |
| 574 | if ((BIT(old_data, bit) ^ edge) && !(BIT(data, bit) ^ edge)) /* falling edge */ | |
| 575 | { | |
| 576 | /* logic equation is true, until proven otherwise */ | |
| 577 | match = 1; | |
| 365 | READ8_DEVICE_HANDLER( z80pio_p_r ) | |
| 366 | { | |
| 367 | z80pio_t *z80pio = get_safe_token( device ); | |
| 578 | 368 | |
| 579 | LOGERROR("Z80PIO \"%s\" Port %c : Edge Transition detected on bit %u, data %02x %02x\n", device->tag, 'A' + channel, bit, old_data, data); | |
| 580 | } | |
| 581 | else if (z80pio->enable[channel] & PIO_IRQ_AND) | |
| 582 | { | |
| 583 | /* all bits must match in AND mode, so logic equation is false */ | |
| 584 | match = 0; | |
| 585 | break; | |
| 586 | } | |
| 587 | } | |
| 369 | /* There are only 2 channels */ | |
| 370 | offset &= 0x01; | |
| 588 | 371 | |
| 589 | if (!z80pio->match[channel] && match) /* rising edge */ | |
| 590 | { | |
| 591 | /* trigger interrupt only once */ | |
| 592 | z80pio_trigger_interrupt(device, channel); | |
| 593 | z80pio->input[channel] = data; | |
| 594 | } | |
| 372 | switch (z80pio->mode[offset]) | |
| 373 | { | |
| 374 | case PIO_MODE2: /* port A only */ | |
| 375 | case PIO_MODE0: | |
| 376 | set_rdy(device, offset, 0); | |
| 377 | update_irq_state(device, offset); | |
| 378 | break; | |
| 595 | 379 | |
| 596 | z80pio->match[channel] = match; | |
| 597 | } | |
| 380 | case PIO_MODE1: | |
| 381 | VPRINTF(("PIO-%c INPUT mode and data read\n",'A'+offset )); | |
| 382 | break; | |
| 383 | ||
| 384 | case PIO_MODE3: | |
| 385 | return (z80pio->in[offset] & z80pio->dir[offset]) | (z80pio->out[offset] & ~z80pio->dir[offset]); | |
| 598 | 386 | } |
| 387 | return z80pio->out[offset]; | |
| 599 | 388 | } |
| 600 | 389 | |
| 390 | ||
| 601 | 391 | /*************************************************************************** |
| 602 | 392 | STROBE STATE MANAGEMENT |
| 603 | 393 | ***************************************************************************/ |
| 604 | 394 | |
| 605 | static void z80pio_strobe | |
| 395 | static void z80pio_update_strobe | |
| 606 | 396 | { |
| 607 | z80pio_t *z80pio = get_safe_token(device); | |
| 397 | z80pio_t *z80pio = get_safe_token( device ); | |
| 608 | 398 | |
| 609 | switch (ch | |
| 399 | switch (z80pio->mode[ch] | |
| 610 | 400 | { |
| 611 | case PIO_PORT_A: | |
| 612 | if (!state) /* low level */ | |
| 401 | /* output mode: a positive edge is used by peripheral to acknowledge | |
| 402 | the receipt of data */ | |
| 403 | case PIO_MODE0: | |
| 613 | 404 | { |
| 614 | /* output data */ | |
| 615 | z80pio_port_w(device, PIO_PORT_A); | |
| 616 | } | |
| 617 | else if (!z80pio->strobe[channel] && state) /* rising edge */ | |
| 618 | { | |
| 619 | /* trigger interrupt */ | |
| 620 | z80pio_trigger_interrupt(device, channel); | |
| 405 | /* ensure valid */ | |
| 406 | state = state & 0x01; | |
| 621 | 407 | |
| 622 | /* clear ready line */ | |
| 623 | z80pio_ready_w(device, channel, 0); | |
| 624 | } | |
| 625 | break; | |
| 408 | /* strobe changed state? */ | |
| 409 | if ((z80pio->strobe[ch] ^ state) != 0) | |
| 410 | { | |
| 411 | /* yes */ | |
| 412 | if (state != 0) | |
| 413 | { | |
| 414 | /* positive edge */ | |
| 415 | VPRINTF(("PIO-%c positive strobe\n",'A' + ch)); | |
| 626 | 416 | |
| 627 | case PIO_PORT_B: | |
| 628 | if (!state) /* low level */ | |
| 629 | { | |
| 630 | /* input data */ | |
| 631 | z80pio->input[channel] = z80pio_port_r(device, PIO_PORT_A); | |
| 632 | } | |
| 633 | else if (!z80pio->strobe[channel] && state) /* rising edge */ | |
| 634 | { | |
| 635 | /* trigger interrupt */ | |
| 636 | z80pio_trigger_interrupt(device, channel); | |
| 417 | /* ready is now inactive */ | |
| 418 | set_rdy(device, ch, 0); | |
| 637 | 419 | |
| 638 | /* clear ready line */ | |
| 639 | z80pio_ready_w(device, channel, 0); | |
| 640 | } | |
| 641 | break; | |
| 642 | } | |
| 420 | /* int enabled? */ | |
| 421 | if (z80pio->enable[ch] & PIO_INT_ENABLE) | |
| 422 | { | |
| 423 | /* trigger an int request */ | |
| 424 | z80pio->int_state[ch] |= Z80_DAISY_INT; | |
| 425 | } | |
| 426 | } | |
| 427 | } | |
| 643 | 428 | |
| 644 | /* latch strobe state */ | |
| 645 | z80pio->strobe[channel] = state; | |
| 646 | } | |
| 429 | /* store strobe state */ | |
| 430 | z80pio->strobe[ch] = state; | |
| 647 | 431 | |
| 648 | static void z80pio_strobe(const device_config *device, int channel, int state) | |
| 649 | { | |
| 650 | z80pio_t *z80pio = get_safe_token(device); | |
| 651 | ||
| 652 | switch (z80pio->mode[channel]) | |
| 653 | { | |
| 654 | case PIO_MODE_OUTPUT: | |
| 655 | if (!z80pio->strobe[channel] && state) /* rising edge */ | |
| 656 | { | |
| 657 | /* trigger interrupt */ | |
| 658 | z80pio_trigger_interrupt(device, channel); | |
| 659 | ||
| 660 | /* clear ready line */ | |
| 661 | z80pio_ready_w(device, channel, 0); | |
| 432 | /* check interrupt */ | |
| 433 | interrupt_check(device); | |
| 662 | 434 | } |
| 663 | 435 | break; |
| 664 | 436 | |
| 665 | case PIO_MODE_INPUT: | |
| 666 | if (!state) /* low level */ | |
| 667 | { | |
| 668 | /* strobe data in */ | |
| 669 | z80pio->input[channel] = z80pio_port_r(device, channel); | |
| 670 | } | |
| 671 | else if (!z80pio->strobe[channel] && state) /* rising edge */ | |
| 672 | { | |
| 673 | /* trigger interrupt */ | |
| 674 | z80pio_trigger_interrupt(device, channel); | |
| 437 | /* input mode: strobe is used by peripheral to load data from the peripheral | |
| 438 | into port a input register, data loaded into pio when signal is active */ | |
| 675 | 439 | |
| 676 | /* clear ready line */ | |
| 677 | z80pio_ready_w(device, channel, 0); | |
| 678 | } | |
| 679 | break; | |
| 680 | ||
| 681 | case PIO_MODE_CONTROL: | |
| 682 | /* ignore strobes */ | |
| 683 | break; | |
| 440 | default: | |
| 441 | break; | |
| 684 | 442 | } |
| 685 | ||
| 686 | /* latch strobe state */ | |
| 687 | z80pio->strobe[channel] = state; | |
| 688 | 443 | } |
| 689 | 444 | |
| 690 | static void z80pio_strobe_w(const device_config *device, int channel, int state) | |
| 691 | { | |
| 692 | z80pio_t *z80pio = get_safe_token(device); | |
| 693 | 445 | |
| 694 | LOGERROR("Z80PIO \"%s\" Port %c : Strobe %u\n", device->tag, 'A' + channel, state); | |
| 446 | void z80pio_astb_w(const device_config *device, int state) { z80pio_update_strobe(device, 0, state); } | |
| 447 | void z80pio_bstb_w(const device_config *device, int state) { z80pio_update_strobe(device, 1, state); } | |
| 695 | 448 | |
| 696 | if (z80pio->mode[PIO_PORT_A] == PIO_MODE_BIDIRECTIONAL) | |
| 697 | { | |
| 698 | /* port A bidirectional mode */ | |
| 699 | z80pio_strobe_bidirectional(device, channel, state); | |
| 700 | } | |
| 701 | else | |
| 702 | { | |
| 703 | z80pio_strobe(device, channel, state); | |
| 704 | } | |
| 705 | } | |
| 706 | 449 | |
| 707 | void z80pio_astb_w(const device_config *device, int state) | |
| 708 | { | |
| 709 | z80pio_strobe_w(device, PIO_PORT_A, state); | |
| 710 | } | |
| 711 | 450 | |
| 712 | void z80pio_bstb_w(const device_config *device, int state) | |
| 713 | { | |
| 714 | z80pio_strobe_w(device, PIO_PORT_B, state); | |
| 715 | } | |
| 716 | ||
| 717 | 451 | /*************************************************************************** |
| 718 | 452 | DAISY CHAIN INTERFACE |
| 719 | 453 | ***************************************************************************/ |
| r3957 | r3958 | |
| 722 | 456 | { |
| 723 | 457 | z80pio_t *z80pio = get_safe_token( device ); |
| 724 | 458 | int state = 0; |
| 725 | int ch | |
| 459 | int ch | |
| 726 | 460 | |
| 727 | 461 | /* loop over all channels */ |
| 728 | for (ch | |
| 462 | for (ch | |
| 729 | 463 | { |
| 730 | 464 | /* if we're servicing a request, don't indicate more interrupts */ |
| 731 | if (z80pio->int_state[ch | |
| 465 | if (z80pio->int_state[ch | |
| 732 | 466 | { |
| 733 | 467 | state |= Z80_DAISY_IEO; |
| 734 | 468 | break; |
| 735 | 469 | } |
| 736 | ||
| 737 | state |= z80pio->int_state[channel]; | |
| 470 | state |= z80pio->int_state[ch]; | |
| 738 | 471 | } |
| 739 | ||
| 740 | LOGERROR("Z80PIO \"%s\" : Interrupt State %u\n", device->tag, state); | |
| 741 | ||
| 742 | 472 | return state; |
| 743 | 473 | } |
| 744 | 474 | |
| 475 | ||
| 745 | 476 | static int z80pio_irq_ack(const device_config *device) |
| 746 | 477 | { |
| 747 | 478 | z80pio_t *z80pio = get_safe_token( device ); |
| 748 | int ch | |
| 479 | int ch | |
| 749 | 480 | |
| 750 | LOGERROR("Z80PIO \"%s\" Interrupt Acknowledge\n", device->tag); | |
| 751 | ||
| 752 | 481 | /* loop over all channels */ |
| 753 | for (channel = PIO_PORT_A; channel < PIO_PORT_COUNT; channel++) | |
| 754 | { | |
| 482 | for (ch = 0; ch < 2; ch++) | |
| 483 | ||
| 755 | 484 | /* find the first channel with an interrupt requested */ |
| 756 | if (z80pio->int_state[ch | |
| 485 | if (z80pio->int_state[ch | |
| 757 | 486 | { |
| 758 | 487 | /* clear interrupt, switch to the IEO state, and update the IRQs */ |
| 759 | z80pio->int_state[channel] = Z80_DAISY_IEO; | |
| 760 | z80pio_check_interrupt(device); | |
| 761 | ||
| 762 | return z80pio->vector[channel]; | |
| 488 | z80pio->int_state[ch] = Z80_DAISY_IEO; | |
| 489 | interrupt_check(device); | |
| 490 | return z80pio->vector[ch]; | |
| 763 | 491 | } |
| 764 | } | |
| 765 | 492 | |
| 766 | LOGERROR("z80pio_irq_ack: failed to find an interrupt to ack!"); | |
| 767 | ||
| 493 | VPRINTF(("z80pio_irq_ack: failed to find an interrupt to ack!")); | |
| 768 | 494 | return z80pio->vector[0]; |
| 769 | 495 | } |
| 770 | 496 | |
| 497 | ||
| 771 | 498 | static void z80pio_irq_reti(const device_config *device) |
| 772 | 499 | { |
| 773 | 500 | z80pio_t *z80pio = get_safe_token( device ); |
| 774 | int ch | |
| 501 | int ch | |
| 775 | 502 | |
| 776 | LOGERROR("Z80PIO \"%s\" Return from Interrupt\n", device->tag); | |
| 777 | ||
| 778 | 503 | /* loop over all channels */ |
| 779 | for (channel = PIO_PORT_A; channel < PIO_PORT_COUNT; channel++) | |
| 780 | { | |
| 504 | for (ch = 0; ch < 2; ch++) | |
| 505 | ||
| 781 | 506 | /* find the first channel with an IEO pending */ |
| 782 | if (z80pio->int_state[ch | |
| 507 | if (z80pio->int_state[ch | |
| 783 | 508 | { |
| 784 | 509 | /* clear the IEO state and update the IRQs */ |
| 785 | z80pio->int_state[channel] &= ~Z80_DAISY_IEO; | |
| 786 | z80pio_check_interrupt(device); | |
| 787 | ||
| 510 | z80pio->int_state[ch] &= ~Z80_DAISY_IEO; | |
| 511 | interrupt_check(device); | |
| 788 | 512 | return; |
| 789 | 513 | } |
| 790 | } | |
| 791 | 514 | |
| 792 | | |
| 515 | VP | |
| 793 | 516 | } |
| 794 | 517 | |
| 518 | ||
| 795 | 519 | /*************************************************************************** |
| 796 | 520 | READ/WRITE HANDLERS |
| 797 | 521 | ***************************************************************************/ |
| 798 | ||
| 799 | 522 | READ8_DEVICE_HANDLER(z80pio_r) |
| 800 | 523 | { |
| 801 | 524 | return (offset & 2) ? z80pio_c_r(device, offset & 1) : z80pio_d_r(device, offset & 1); |
| r3957 | r3958 | |
| 809 | 532 | z80pio_d_w(device, offset & 1, data); |
| 810 | 533 | } |
| 811 | 534 | |
| 812 | READ8_DEVICE_HANDLER(z80pio_alt_r) | |
| 813 | { | |
| 814 | int channel = BIT(offset, 1); | |
| 815 | 535 | |
| 816 | return (offset & 1) ? z80pio_c_r(device, channel) : z80pio_d_r(device, channel); | |
| 817 | } | |
| 818 | ||
| 819 | WRITE8_DEVICE_HANDLER(z80pio_alt_w) | |
| 820 | { | |
| 821 | int channel = BIT(offset, 1); | |
| 822 | ||
| 823 | if (offset & 1) | |
| 824 | z80pio_c_w(device, channel, data); | |
| 825 | else | |
| 826 | z80pio_d_w(device, channel, data); | |
| 827 | } | |
| 828 | ||
| 829 | /*************************************************************************** | |
| 830 | DEVICE INTERFACE | |
| 831 | ***************************************************************************/ | |
| 832 | ||
| 833 | 536 | static DEVICE_START( z80pio ) |
| 834 | 537 | { |
| 835 | 538 | const z80pio_interface *intf = device->static_config; |
| 836 | 539 | z80pio_t *z80pio = get_safe_token( device ); |
| 837 | const device_config *cpu = NULL; | |
| 838 | 540 | |
| 839 | assert(intf != NULL); | |
| 840 | z80pio->intf = intf; | |
| 541 | z80pio->intr = intf->intr; | |
| 542 | z80pio->port_read[0] = intf->portAread; | |
| 543 | z80pio->port_read[1] = intf->portBread; | |
| 544 | z80pio->port_write[0] = intf->portAwrite; | |
| 545 | z80pio->port_write[1] = intf->portBwrite; | |
| 546 | z80pio->rdyr[0] = intf->rdyA; | |
| 547 | z80pio->rdyr[1] = intf->rdyB; | |
| 841 | 548 | |
| 842 | /* get clock */ | |
| 843 | ||
| 844 | if (intf->cpu != NULL) | |
| 845 | { | |
| 846 | cpu = cputag_get_cpu(device->machine, intf->cpu); | |
| 847 | } | |
| 848 | ||
| 849 | if (cpu != NULL) | |
| 850 | { | |
| 851 | z80pio->clock = cpu_get_clock(cpu); | |
| 852 | } | |
| 853 | else | |
| 854 | { | |
| 855 | assert(intf->clock > 0); | |
| 856 | z80pio->clock = intf->clock; | |
| 857 | } | |
| 858 | ||
| 859 | /* allocate poll timer */ | |
| 860 | ||
| 861 | z80pio->poll_timer = timer_alloc(device->machine, z80pio_poll_tick, (void *)device); | |
| 862 | timer_adjust_periodic(z80pio->poll_timer, attotime_zero, 0, ATTOTIME_IN_HZ(z80pio->clock / 16)); | |
| 863 | ||
| 864 | /* allocate interrupt enable timer */ | |
| 865 | ||
| 866 | z80pio->irq_timer = timer_alloc(device->machine, z80pio_irq_tick, (void *)device); | |
| 867 | ||
| 868 | /* register for state saving */ | |
| 869 | ||
| 870 | state_save_register_device_item_array(device, 0, z80pio->state); | |
| 549 | /* register for save states */ | |
| 550 | state_save_register_device_item_array(device, 0, z80pio->vector); | |
| 871 | 551 | state_save_register_device_item_array(device, 0, z80pio->mode); |
| 872 | state_save_register_device_item_array(device, 0, z80pio->irq_enable); | |
| 873 | state_save_register_device_item_array(device, 0, z80pio->irq_pending); | |
| 874 | state_save_register_device_item_array(device, 0, z80pio->int_state); | |
| 875 | 552 | state_save_register_device_item_array(device, 0, z80pio->enable); |
| 876 | state_save_register_device_item_array(device, 0, z80pio->input); | |
| 877 | state_save_register_device_item_array(device, 0, z80pio->output); | |
| 878 | state_save_register_device_item_array(device, 0, z80pio->vector); | |
| 879 | 553 | state_save_register_device_item_array(device, 0, z80pio->mask); |
| 880 | state_save_register_device_item_array(device, 0, z80pio->ddr); | |
| 554 | state_save_register_device_item_array(device, 0, z80pio->dir); | |
| 555 | state_save_register_device_item_array(device, 0, z80pio->rdy); | |
| 556 | state_save_register_device_item_array(device, 0, z80pio->in); | |
| 557 | state_save_register_device_item_array(device, 0, z80pio->out); | |
| 881 | 558 | state_save_register_device_item_array(device, 0, z80pio->strobe); |
| 882 | state_save_register_device_item_array(device, 0, z80pio-> | |
| 559 | state_save_register_device_item_array(device, 0, z80pio->int_state | |
| 883 | 560 | |
| 884 | 561 | return DEVICE_START_OK; |
| 885 | 562 | } |
| 886 | 563 | |
| 564 | ||
| 887 | 565 | static DEVICE_RESET( z80pio ) |
| 888 | 566 | { |
| 889 | z80pio_t *z80pio = get_safe_token(device); | |
| 890 | int channel; | |
| 567 | z80pio_t *z80pio = get_safe_token( device ); | |
| 568 | int i; | |
| 891 | 569 | |
| 892 | LOGERROR("Z80PIO \"%s\" : Reset\n", device->tag); | |
| 893 | ||
| 894 | for (channel = 0; channel < 2; channel++) | |
| 570 | for (i = 0; i < 2; i++) | |
| 895 | 571 | { |
| 896 | /* set mode 1 */ | |
| 897 | z80pio->mode[channel] = PIO_MODE_INPUT; | |
| 898 | ||
| 899 | /* disable interrupt */ | |
| 900 | z80pio->enable[channel] &= 0x7f; | |
| 901 | z80pio->irq_enable[channel] = 0; | |
| 902 | z80pio->irq_pending[channel] = 0; | |
| 903 | z80pio->int_state[channel] = 0; | |
| 904 | z80pio->match[channel] = 0; | |
| 905 | ||
| 906 | /* reset all bits of the data I/O register */ | |
| 907 | z80pio->ddr[channel] = 0; | |
| 908 | ||
| 909 | /* set all bits of the mask control register */ | |
| 910 | z80pio->mask[channel] = 0xff; | |
| 911 | ||
| 912 | /* reset output register */ | |
| 913 | z80pio->output[channel] = 0; | |
| 914 | ||
| 915 | /* clear ready line */ | |
| 916 | z80pio_ready_w(device, channel, 0); | |
| 572 | z80pio->mask[i] = 0xff; /* mask all on */ | |
| 573 | z80pio->enable[i] = 0x00; /* disable */ | |
| 574 | z80pio->mode[i] = 0x01; /* mode input */ | |
| 575 | z80pio->dir[i] = 0x01; /* dir input */ | |
| 576 | set_rdy(device, i, 0); /* RDY = low */ | |
| 577 | z80pio->out[i] = 0x00; /* outdata = 0 */ | |
| 578 | z80pio->int_state[i] = 0; | |
| 579 | z80pio->strobe[i] = 0; | |
| 917 | 580 | } |
| 918 | ||
| 919 | z80pio_check_interrupt(device); | |
| 581 | interrupt_check(device); | |
| 920 | 582 | } |
| 921 | 583 | |
| 584 | ||
| 922 | 585 | static DEVICE_SET_INFO( z80pio ) |
| 923 | 586 | { |
| 924 | 587 | switch (state) |
| r3957 | r3958 | |
| 927 | 590 | } |
| 928 | 591 | } |
| 929 | 592 | |
| 593 | ||
| 930 | 594 | DEVICE_GET_INFO( z80pio ) |
| 931 | 595 | { |
| 932 | 596 | switch (state) |
| r3957 | r3958 | |
| 946 | 610 | case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)z80pio_irq_reti; break; |
| 947 | 611 | |
| 948 | 612 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 949 | case DEVINFO_STR_NAME: info->s = "Zilog Z80 PIO"; break; | |
| 950 | case DEVINFO_STR_FAMILY: info->s = "Z80"; break; | |
| 951 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 952 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 953 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 613 | case DEVINFO_STR_NAME: strcpy(info->s, "Zilog Z80 PIO"); break; | |
| 614 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Z80"); break; | |
| 615 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 616 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 617 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 954 | 618 | } |
| 955 | 619 | } |
| 956 | 620 | |
| 957 | DEVICE_GET_INFO( z8420 ) | |
| 958 | { | |
| 959 | switch (state) | |
| 960 | { | |
| 961 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 962 | case DEVINFO_STR_NAME: info->s = "Zilog Z8420"; break; | |
| 963 | case DEVINFO_STR_FAMILY: info->s = "Z80 PIO"; break; | |
| 964 | ||
| 965 | default: DEVICE_GET_INFO_CALL(z80pio); | |
| 966 | } | |
| 967 | } | |
| 968 | ||
| 969 | DEVICE_GET_INFO( lh0081 ) | |
| 970 | { | |
| 971 | switch (state) | |
| 972 | { | |
| 973 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 974 | case DEVINFO_STR_NAME: info->s = "Sharp LH0081"; break; | |
| 975 | case DEVINFO_STR_FAMILY: info->s = "Z80 PIO"; break; | |
| 976 | ||
| 977 | default: DEVICE_GET_INFO_CALL(z80pio); | |
| 978 | } | |
| 979 | } | |
| 980 | ||
| 981 | DEVICE_GET_INFO( mk3881 ) | |
| 982 | { | |
| 983 | switch (state) | |
| 984 | { | |
| 985 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 986 | case DEVINFO_STR_NAME: info->s = "Mostek MK3881"; break; | |
| 987 | case DEVINFO_STR_FAMILY: info->s = "Z80 PIO"; break; | |
| 988 | ||
| 989 | default: DEVICE_GET_INFO_CALL(z80pio); | |
| 990 | } | |
| 991 | } |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #define DMA8257 DEVICE_GET_INFO_NAME(dma8257) |
| 11 | 11 | |
| 12 | #define MDRV_DMA8257_ADD(_tag, _clock, _config) \ | |
| 13 | MDRV_DEVICE_ADD(_tag, DMA8257, _clock) \ | |
| 14 | MDRV_DEVICE_CONFIG(_config) | |
| 15 | ||
| 16 | #define MDRV_DMA8257_REMOVE(_tag) \ | |
| 17 | MDRV_DEVICE_REMOVE(_tag, DMA8257) | |
| 18 | ||
| 19 | ||
| 12 | 20 | #define DMA8257_STATUS_UPDATE 0x10 |
| 13 | 21 | #define DMA8257_STATUS_TC_CH3 0x08 |
| 14 | 22 | #define DMA8257_STATUS_TC_CH2 0x04 |
| r3957 | r3958 | |
| 22 | 30 | struct _dma8257_interface |
| 23 | 31 | { |
| 24 | 32 | /* CPU to halt when DMA is active */ |
| 25 | | |
| 33 | const char *cputag; | |
| 26 | 34 | |
| 27 | /* clock */ | |
| 28 | int clockhz; | |
| 29 | ||
| 30 | 35 | /* accessors to main memory */ |
| 31 | 36 | read8_device_func memory_read; |
| 32 | 37 | write8_device_func memory_write; |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Z80 PIO | |
| 3 | Z80 PIO (Z8420) | |
| 4 | 4 | |
| 5 | 5 | Copyright Nicola Salmoria and the MAME Team. |
| 6 | 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | 7 | |
| 8 | *************************************************************************** | |
| 8 | *************************************************************************** | |
| 9 | 9 | _____ _____ |
| 10 | 10 | D2 1 |* \_/ | 40 D3 |
| 11 | 11 | D7 2 | | 39 D4 |
| r3957 | r3958 | |
| 33 | 33 | #ifndef __Z80PIO_H__ |
| 34 | 34 | #define __Z80PIO_H__ |
| 35 | 35 | |
| 36 | /*************************************************************************** | |
| 37 | CALLBACK FUNCTION PROTOTYPES | |
| 38 | ***************************************************************************/ | |
| 39 | 36 | |
| 40 | typedef void (*z80pio_on_int_changed_func) (const device_config *device, int state); | |
| 41 | #define Z80PIO_ON_INT_CHANGED(name) void name(const device_config *device, int state) | |
| 42 | ||
| 43 | typedef void (*z80pio_on_ardy_changed_func) (const device_config *device, int state); | |
| 44 | #define Z80PIO_ON_ARDY_CHANGED(name) void name(const device_config *device, int state) | |
| 45 | ||
| 46 | typedef void (*z80pio_on_brdy_changed_func) (const device_config *device, int state); | |
| 47 | #define Z80PIO_ON_BRDY_CHANGED(name) void name(const device_config *device, int state) | |
| 48 | ||
| 49 | 37 | /*************************************************************************** |
| 50 | 38 | TYPE DEFINITIONS |
| 51 | 39 | ***************************************************************************/ |
| r3957 | r3958 | |
| 53 | 41 | typedef struct _z80pio_interface z80pio_interface; |
| 54 | 42 | struct _z80pio_interface |
| 55 | 43 | { |
| 56 | const char *cpu; /* CPU whose clock we use for our base */ | |
| 57 | int clock; /* clock (pin 25) of the chip */ | |
| 44 | void (*intr)(const device_config *device, int which); /* callback when change interrupt status */ | |
| 45 | read8_device_func portAread; /* port A read callback */ | |
| 46 | read8_device_func portBread; /* port B read callback */ | |
| 47 | write8_device_func portAwrite; /* port A write callback */ | |
| 48 | write8_device_func portBwrite; /* port B write callback */ | |
| 49 | void (*rdyA)(const device_config *device, int data); /* portA ready active callback (do not support yet)*/ | |
| 50 | void (*rdyB)(const device_config *device, int data); /* portB ready active callback (do not support yet)*/ | |
| 51 | }; | |
| 58 | 52 | |
| 59 | /* this gets called for every change of the _INT pin (pin 23) */ | |
| 60 | z80pio_on_int_changed_func on_int_changed; | |
| 61 | 53 | |
| 62 | /* this gets called for every read from port A */ | |
| 63 | read8_device_func port_a_r; | |
| 64 | 54 | |
| 65 | /* this gets called for every read from port B */ | |
| 66 | read8_device_func port_b_r; | |
| 67 | ||
| 68 | /* this gets called for every write to port A */ | |
| 69 | write8_device_func port_a_w; | |
| 70 | ||
| 71 | /* this gets called for every write to port B */ | |
| 72 | write8_device_func port_b_w; | |
| 73 | ||
| 74 | /* this gets called for every change of the ARDY pin (pin 18) */ | |
| 75 | z80pio_on_ardy_changed_func on_ardy_changed; | |
| 76 | ||
| 77 | /* this gets called for every change of the BRDY pin (pin 21) */ | |
| 78 | z80pio_on_brdy_changed_func on_brdy_changed; | |
| 79 | }; | |
| 80 | #define Z80PIO_INTERFACE(name) const z80pio_interface (name)= | |
| 81 | ||
| 82 | 55 | /*************************************************************************** |
| 83 | 56 | DEVICE CONFIGURATION MACROS |
| 84 | 57 | ***************************************************************************/ |
| 85 | 58 | |
| 86 | 59 | #define MDRV_Z80PIO_ADD(_tag, _intrf) \ |
| 87 | MDRV_DEVICE_ADD(_tag, Z80PIO) \ | |
| 60 | MDRV_DEVICE_ADD(_tag, Z80PIO, 0) \ | |
| 88 | 61 | MDRV_DEVICE_CONFIG(_intrf) |
| 89 | 62 | |
| 90 | 63 | #define MDRV_Z80PIO_REMOVE(_tag) \ |
| 91 | 64 | MDRV_DEVICE_REMOVE(_tag, Z80PIO) |
| 92 | 65 | |
| 66 | ||
| 67 | ||
| 93 | 68 | /*************************************************************************** |
| 94 | 69 | CONTROL REGISTER READ/WRITE |
| 95 | 70 | ***************************************************************************/ |
| 96 | 71 | |
| 97 | READ8_DEVICE_HANDLER( z80pio_c_r ); | |
| 98 | 72 | WRITE8_DEVICE_HANDLER( z80pio_c_w ); |
| 73 | READ8_DEVICE_HANDLER( z80pio_c_r ); | |
| 99 | 74 | |
| 100 | READ8_DEVICE_HANDLER( lh0081_c_r ); | |
| 101 | 75 | |
| 102 | 76 | /*************************************************************************** |
| 103 | 77 | DATA REGISTER READ/WRITE |
| 104 | 78 | ***************************************************************************/ |
| 105 | 79 | |
| 106 | READ8_DEVICE_HANDLER( z80pio_d_r ); | |
| 107 | 80 | WRITE8_DEVICE_HANDLER( z80pio_d_w ); |
| 81 | READ8_DEVICE_HANDLER( z80pio_d_r ); | |
| 108 | 82 | |
| 83 | ||
| 109 | 84 | /*************************************************************************** |
| 85 | PORT I/O | |
| 86 | ***************************************************************************/ | |
| 87 | ||
| 88 | WRITE8_DEVICE_HANDLER( z80pio_p_w ); | |
| 89 | READ8_DEVICE_HANDLER( z80pio_p_r ); | |
| 90 | ||
| 91 | ||
| 92 | /*************************************************************************** | |
| 110 | 93 | STROBE STATE MANAGEMENT |
| 111 | 94 | ***************************************************************************/ |
| 112 | 95 | |
| 113 | 96 | void z80pio_astb_w(const device_config *device, int state); |
| 114 | 97 | void z80pio_bstb_w(const device_config *device, int state); |
| 115 | 98 | |
| 99 | ||
| 116 | 100 | /*************************************************************************** |
| 117 | 101 | READ/WRITE HANDLERS |
| 118 | 102 | ***************************************************************************/ |
| 119 | ||
| 120 | /* A0 = B/A | |
| 121 | A1 = C/D */ | |
| 122 | 103 | READ8_DEVICE_HANDLER(z80pio_r); |
| 123 | 104 | WRITE8_DEVICE_HANDLER(z80pio_w); |
| 124 | 105 | |
| 125 | /* A0 = C/D | |
| 126 | A1 = B/A */ | |
| 127 | READ8_DEVICE_HANDLER(z80pio_alt_r); | |
| 128 | WRITE8_DEVICE_HANDLER(z80pio_alt_w); | |
| 129 | 106 | |
| 130 | /*************************************************************************** | |
| 131 | DEVICE INTERFACE | |
| 132 | ***************************************************************************/ | |
| 107 | /* ----- device interface ----- */ | |
| 133 | 108 | |
| 134 | 109 | #define Z80PIO DEVICE_GET_INFO_NAME(z80pio) |
| 135 | 110 | DEVICE_GET_INFO( z80pio ); |
| 136 | 111 | |
| 137 | #define Z8420 DEVICE_GET_INFO_NAME(z8420) | |
| 138 | DEVICE_GET_INFO( z8420 ); | |
| 139 | ||
| 140 | #define LH0081 DEVICE_GET_INFO_NAME(lh0081) | |
| 141 | DEVICE_GET_INFO( lh0081 ); | |
| 142 | ||
| 143 | #define MK3881 DEVICE_GET_INFO_NAME(mk3881) | |
| 144 | DEVICE_GET_INFO( mk3881 ); | |
| 145 | ||
| 146 | 112 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | #include <stdarg.h> |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "machine/adc083x.h" |
| 12 | 11 | |
| 13 | 12 | #define VERBOSE_LEVEL ( 0 ) |
| r3957 | r3958 | |
| 28 | 27 | struct adc083x_chip |
| 29 | 28 | { |
| 30 | 29 | int type; |
| 31 | double (*input_callback)(int input); | |
| 30 | double (*input_callback)(running_machine *machine, int input); | |
| 32 | 31 | INT32 CS; |
| 33 | 32 | INT32 CLK; |
| 34 | 33 | INT32 DI; |
| r3957 | r3958 | |
| 56 | 55 | |
| 57 | 56 | static struct adc083x_chip adc083x[ MAX_ADC083X_CHIPS ]; |
| 58 | 57 | |
| 59 | void adc083x_init( running_machine *machine, int chip, int type, double (*input_callback)(int input) ) | |
| 58 | void adc083x_init( running_machine *machine, int chip, int type, double (*input_callback)(running_machine *machine, int input) ) | |
| 60 | 59 | { |
| 61 | 60 | struct adc083x_chip *c; |
| 62 | 61 | |
| r3957 | r3958 | |
| 122 | 121 | state_save_register_item( machine, "adc083x", NULL, chip, c->output ); |
| 123 | 122 | } |
| 124 | 123 | |
| 125 | void adc083x_cs_write( int chip, int cs ) | |
| 124 | void adc083x_cs_write( running_machine *machine, int chip, int cs ) | |
| 126 | 125 | { |
| 127 | running_machine *machine = Machine; | |
| 128 | 126 | struct adc083x_chip *c; |
| 129 | 127 | |
| 130 | 128 | if( chip >= MAX_ADC083X_CHIPS ) |
| r3957 | r3958 | |
| 169 | 167 | c->CS = cs; |
| 170 | 168 | } |
| 171 | 169 | |
| 172 | static int adc083x_conversion( int chip ) | |
| 170 | static int adc083x_conversion( running_machine *machine, int chip ) | |
| 173 | 171 | { |
| 174 | 172 | struct adc083x_chip *c = &adc083x[ chip ]; |
| 175 | 173 | int result; |
| r3957 | r3958 | |
| 177 | 175 | int negative_channel = ADC083X_AGND; |
| 178 | 176 | double positive = 0; |
| 179 | 177 | double negative = 0; |
| 180 | double gnd = c->input_callback( ADC083X_AGND ); | |
| 181 | double vref = c->input_callback( ADC083X_VREF ); | |
| 178 | double gnd = c->input_callback( machine, ADC083X_AGND ); | |
| 179 | double vref = c->input_callback( machine, ADC083X_VREF ); | |
| 182 | 180 | |
| 183 | 181 | switch( c->type ) |
| 184 | 182 | { |
| r3957 | r3958 | |
| 223 | 221 | |
| 224 | 222 | if( positive_channel != ADC083X_AGND ) |
| 225 | 223 | { |
| 226 | positive = c->input_callback( positive_channel ) - gnd; | |
| 224 | positive = c->input_callback( machine, positive_channel ) - gnd; | |
| 227 | 225 | } |
| 228 | 226 | if( negative_channel != ADC083X_AGND ) |
| 229 | 227 | { |
| 230 | negative = c->input_callback( negative_channel ) - gnd; | |
| 228 | negative = c->input_callback( machine, negative_channel ) - gnd; | |
| 231 | 229 | } |
| 232 | 230 | |
| 233 | 231 | result = (int)( ( ( positive - negative ) * 255 ) / vref ); |
| r3957 | r3958 | |
| 243 | 241 | return result; |
| 244 | 242 | } |
| 245 | 243 | |
| 246 | void adc083x_clk_write( int chip, int clk ) | |
| 244 | void adc083x_clk_write( running_machine *machine, int chip, int clk ) | |
| 247 | 245 | { |
| 248 | running_machine *machine = Machine; | |
| 249 | 246 | struct adc083x_chip *c; |
| 250 | 247 | |
| 251 | 248 | if( chip >= MAX_ADC083X_CHIPS ) |
| r3957 | r3958 | |
| 343 | 340 | { |
| 344 | 341 | case STATE_MUX_SETTLE: |
| 345 | 342 | verboselog( machine, 1, "adc083x %d mux settle\n", chip ); |
| 346 | c->output = adc083x_conversion( chip ); | |
| 343 | c->output = adc083x_conversion( machine, chip ); | |
| 347 | 344 | c->state = STATE_OUTPUT_MSB_FIRST; |
| 348 | 345 | c->bit = 7; |
| 349 | 346 | if( c->type == ADC0834 || c->type == ADC0838 ) |
| r3957 | r3958 | |
| 388 | 385 | c->CLK = clk; |
| 389 | 386 | } |
| 390 | 387 | |
| 391 | void adc083x_di_write( int chip, int di ) | |
| 388 | void adc083x_di_write( running_machine *machine, int chip, int di ) | |
| 392 | 389 | { |
| 393 | running_machine *machine = Machine; | |
| 394 | 390 | struct adc083x_chip *c; |
| 395 | 391 | |
| 396 | 392 | if( chip >= MAX_ADC083X_CHIPS ) |
| r3957 | r3958 | |
| 409 | 405 | c->DI = di; |
| 410 | 406 | } |
| 411 | 407 | |
| 412 | void adc083x_se_write( int chip, int se ) | |
| 408 | void adc083x_se_write( running_machine *machine, int chip, int se ) | |
| 413 | 409 | { |
| 414 | running_machine *machine = Machine; | |
| 415 | 410 | struct adc083x_chip *c; |
| 416 | 411 | |
| 417 | 412 | if( chip >= MAX_ADC083X_CHIPS ) |
| r3957 | r3958 | |
| 430 | 425 | c->SE = se; |
| 431 | 426 | } |
| 432 | 427 | |
| 433 | int adc083x_sars_read( int chip ) | |
| 428 | int adc083x_sars_read( running_machine *machine, int chip ) | |
| 434 | 429 | { |
| 435 | running_machine *machine = Machine; | |
| 436 | 430 | struct adc083x_chip *c; |
| 437 | 431 | |
| 438 | 432 | if( chip >= MAX_ADC083X_CHIPS ) |
| r3957 | r3958 | |
| 447 | 441 | return c->SARS; |
| 448 | 442 | } |
| 449 | 443 | |
| 450 | int adc083x_do_read( int chip ) | |
| 444 | int adc083x_do_read( running_machine *machine, int chip ) | |
| 451 | 445 | { |
| 452 | running_machine *machine = Machine; | |
| 453 | 446 | struct adc083x_chip *c; |
| 454 | 447 | |
| 455 | 448 | if( chip >= MAX_ADC083X_CHIPS ) |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "deprecat.h" | |
| 25 | 24 | #include "machine/i2cmem.h" |
| 26 | 25 | |
| 27 | 26 | #define VERBOSE_LEVEL ( 0 ) |
| r3957 | r3958 | |
| 147 | 146 | return ( ( ( c->devsel << 7 ) & 0xff00 ) | ( c->byteaddr & 0xff ) ) & ( c->data_size - 1 ); |
| 148 | 147 | } |
| 149 | 148 | |
| 150 | void i2cmem_write( int chip, int line, int data ) | |
| 149 | void i2cmem_write( running_machine *machine, int chip, int line, int data ) | |
| 151 | 150 | { |
| 152 | running_machine *machine = Machine; | |
| 153 | 151 | struct i2cmem_chip *c; |
| 154 | 152 | |
| 155 | 153 | if( chip >= I2CMEM_MAXCHIP ) |
| r3957 | r3958 | |
| 382 | 380 | } |
| 383 | 381 | } |
| 384 | 382 | |
| 385 | int i2cmem_read( int chip, int line ) | |
| 383 | int i2cmem_read( running_machine *machine, int chip, int line ) | |
| 386 | 384 | { |
| 387 | running_machine *machine = Machine; | |
| 388 | 385 | struct i2cmem_chip *c; |
| 389 | 386 | |
| 390 | 387 | if( chip >= I2CMEM_MAXCHIP ) |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | #define ADC0834 ( 2 ) |
| 28 | 28 | #define ADC0838 ( 3 ) |
| 29 | 29 | |
| 30 | void adc083x_init( running_machine *machine, int chip, int type, double (*input_callback)( int input ) ); | |
| 31 | extern void adc083x_cs_write( int chip, int cs ); | |
| 32 | extern void adc083x_clk_write( int chip, int clk ); | |
| 33 | extern void adc083x_di_write( int chip, int di ); | |
| 34 | extern void adc083x_se_write( int chip, int se ); | |
| 35 | extern int adc083x_sars_read( int chip ); | |
| 36 | extern int adc083x_do_read( int chip ); | |
| 30 | void adc083x_init( running_machine *machine, int chip, int type, double (*input_callback)( running_machine *machine, int input ) ); | |
| 31 | extern void adc083x_cs_write( running_machine *machine, int chip, int cs ); | |
| 32 | extern void adc083x_clk_write( running_machine *machine, int chip, int clk ); | |
| 33 | extern void adc083x_di_write( running_machine *machine, int chip, int di ); | |
| 34 | extern void adc083x_se_write( running_machine *machine, int chip, int se ); | |
| 35 | extern int adc083x_sars_read( running_machine *machine, int chip ); | |
| 36 | extern int adc083x_do_read( running_machine *machine, int chip ); | |
| 37 | 37 | |
| 38 | 38 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | #define I2CMEM_SLAVE_ADDRESS_ALT ( 0xb0 ) |
| 21 | 21 | |
| 22 | 22 | extern void i2cmem_init( running_machine *machine, int chip, int slave_address, int page_size, int data_size, unsigned char *data ); |
| 23 | extern void i2cmem_write( int chip, int line, int data ); | |
| 24 | extern int i2cmem_read( int chip, int line ); | |
| 23 | extern void i2cmem_write( running_machine *machine, int chip, int line, int data ); | |
| 24 | extern int i2cmem_read( running_machine *machine, int chip, int line ); | |
| 25 | 25 | extern NVRAM_HANDLER( i2cmem_0 ); |
| 26 | 26 | |
| 27 | 27 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | /*************************************************************************** |
| 120 | INLINE FUNCTIONS | |
| 121 | ***************************************************************************/ | |
| 122 | ||
| 123 | /*------------------------------------------------- | |
| 124 | find_vp931 - find our device; assumes there | |
| 125 | is only one | |
| 126 | -------------------------------------------------*/ | |
| 127 | ||
| 128 | INLINE laserdisc_state *find_vp931(running_machine *machine) | |
| 129 | { | |
| 130 | return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC)); | |
| 131 | } | |
| 132 | ||
| 133 | ||
| 134 | ||
| 135 | /*************************************************************************** | |
| 136 | 120 | 22VP931 ROM AND MACHINE INTERFACES |
| 137 | 121 | ***************************************************************************/ |
| 138 | 122 | |
| r3957 | r3958 | |
| 230 | 214 | player->data_ready_cb = cbsave; |
| 231 | 215 | |
| 232 | 216 | /* find our devices */ |
| 233 | player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device->tag, "vp931")); | |
| 234 | player->tracktimer = devtag_get_device(ld->device->machine, TIMER, device_build_tag(tempstring, ld->device->tag, "tracktimer")); | |
| 217 | player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "vp931")); | |
| 218 | player->tracktimer = devtag_get_device(ld->device->machine, TIMER, device_build_tag(tempstring, ld->device, "tracktimer")); | |
| 235 | 219 | timer_device_set_ptr(player->tracktimer, ld); |
| 236 | 220 | astring_free(tempstring); |
| 237 | 221 | } |
| r3957 | r3958 | |
| 459 | 443 | |
| 460 | 444 | static WRITE8_HANDLER( output0_w ) |
| 461 | 445 | { |
| 462 | laserdisc_state *ld = | |
| 446 | laserdisc_state *ld = l | |
| 463 | 447 | ldplayer_data *player = ld->player; |
| 464 | 448 | |
| 465 | 449 | /* |
| r3957 | r3958 | |
| 500 | 484 | |
| 501 | 485 | static WRITE8_HANDLER( output1_w ) |
| 502 | 486 | { |
| 503 | laserdisc_state *ld = | |
| 487 | laserdisc_state *ld = l | |
| 504 | 488 | ldplayer_data *player = ld->player; |
| 505 | 489 | INT32 speed = 0; |
| 506 | 490 | |
| r3957 | r3958 | |
| 592 | 576 | |
| 593 | 577 | static READ8_HANDLER( datic_r ) |
| 594 | 578 | { |
| 595 | laserdisc_state *ld = | |
| 579 | laserdisc_state *ld = l | |
| 596 | 580 | return ld->player->daticval; |
| 597 | 581 | } |
| 598 | 582 | |
| r3957 | r3958 | |
| 604 | 588 | |
| 605 | 589 | static READ8_HANDLER( from_controller_r ) |
| 606 | 590 | { |
| 607 | laserdisc_state *ld = | |
| 591 | laserdisc_state *ld = l | |
| 608 | 592 | ldplayer_data *player = ld->player; |
| 609 | 593 | |
| 610 | 594 | /* clear the pending flag and return the data */ |
| r3957 | r3958 | |
| 620 | 604 | |
| 621 | 605 | static WRITE8_HANDLER( to_controller_w ) |
| 622 | 606 | { |
| 623 | laserdisc_state *ld = | |
| 607 | laserdisc_state *ld = l | |
| 624 | 608 | ldplayer_data *player = ld->player; |
| 625 | 609 | |
| 626 | 610 | /* set the pending flag and stash the data */ |
| r3957 | r3958 | |
| 642 | 626 | |
| 643 | 627 | static READ8_HANDLER( port1_r ) |
| 644 | 628 | { |
| 645 | laserdisc_state *ld = | |
| 629 | laserdisc_state *ld = l | |
| 646 | 630 | ldplayer_data *player = ld->player; |
| 647 | 631 | UINT8 result = 0x00; |
| 648 | 632 | |
| r3957 | r3958 | |
| 665 | 649 | |
| 666 | 650 | static WRITE8_HANDLER( port1_w ) |
| 667 | 651 | { |
| 668 | laserdisc_state *ld = | |
| 652 | laserdisc_state *ld = l | |
| 669 | 653 | ldplayer_data *player = ld->player; |
| 670 | 654 | |
| 671 | 655 | /* |
| r3957 | r3958 | |
| 739 | 723 | |
| 740 | 724 | static READ8_HANDLER( port2_r ) |
| 741 | 725 | { |
| 742 | laserdisc_state *ld = | |
| 726 | laserdisc_state *ld = l | |
| 743 | 727 | ldplayer_data *player = ld->player; |
| 744 | 728 | UINT8 result = 0x00; |
| 745 | 729 | |
| r3957 | r3958 | |
| 778 | 762 | |
| 779 | 763 | static READ8_HANDLER( t0_r ) |
| 780 | 764 | { |
| 781 | laserdisc_state *ld = | |
| 765 | laserdisc_state *ld = l | |
| 782 | 766 | return ld->player->datastrobe; |
| 783 | 767 | } |
| 784 | 768 | |
| r3957 | r3958 | |
| 791 | 775 | |
| 792 | 776 | static READ8_HANDLER( t1_r ) |
| 793 | 777 | { |
| 794 | laserdisc_state *ld = | |
| 778 | laserdisc_state *ld = l | |
| 795 | 779 | return ld->player->trackstate; |
| 796 | 780 | } |
| r3957 | r3958 | |
|---|---|---|
| 183 | 183 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 184 | 184 | |
| 185 | 185 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 186 | case DEVINFO_STR_NAME: info->s = "OKI MSM6242"; break; | |
| 187 | case DEVINFO_STR_FAMILY: info->s = "MSM6242 RTC"; break; | |
| 188 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 189 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 190 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 186 | case DEVINFO_STR_NAME: strcpy(info->s, "OKI MSM6242"); break; | |
| 187 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MSM6242 RTC"); break; | |
| 188 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 189 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 190 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | #define MSM6242 DEVICE_GET_INFO_NAME(msm6242) |
| 17 | 17 | |
| 18 | #define MDRV_MSM6242_ADD(_tag) \ | |
| 19 | MDRV_DEVICE_ADD(_tag, MSM6242, 0) | |
| 18 | 20 | |
| 21 | #define MDRV_MSM6242_REMOVE(_tag) \ | |
| 22 | MDRV_DEVICE_REMOVE(_tag, MSM6242) | |
| 23 | ||
| 24 | ||
| 19 | 25 | /* device interface */ |
| 20 | 26 | DEVICE_GET_INFO( msm6242 ); |
| 21 | 27 |
| r3957 | r3958 | |
|---|---|---|
| 215 | 215 | acia6850_t *acia_p = get_token(device); |
| 216 | 216 | acia6850_interface *intf = get_interface(device); |
| 217 | 217 | |
| 218 | acia_p->rx_clock = intf->rx_clock; | |
| 219 | acia_p->tx_clock = intf->tx_clock; | |
| 218 | acia_p->tx_clock = device->clock; | |
| 219 | acia_p->rx_clock = (intf->rx_clock == 0) ? device->clock : intf->rx_clock; | |
| 220 | 220 | acia_p->tx_counter = 0; |
| 221 | 221 | acia_p->rx_counter = 0; |
| 222 | 222 | acia_p->rx_pin = intf->rx_pin; |
| r3957 | r3958 | |
| 862 | 862 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(acia6850); break; |
| 863 | 863 | |
| 864 | 864 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 865 | case DEVINFO_STR_NAME: info->s = "6850 ACIA"; break; | |
| 866 | case DEVINFO_STR_FAMILY: info->s = "6850 ACIA"; break; | |
| 867 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 868 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 865 | case DEVINFO_STR_NAME: strcpy(info->s, "6850 ACIA"); break; | |
| 866 | case DEVINFO_STR_FAMILY: strcpy(info->s, "6850 ACIA"); break; | |
| 867 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 868 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 869 | 869 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 870 | 870 | } |
| 871 | 871 | } |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | /* LSI Logic LSI53C810A PCI to SCSI I/O Processor */ |
| 2 | 2 | |
| 3 | 3 | #include "driver.h" |
| 4 | #include "deprecat.h" | |
| 5 | 4 | #include "53c810.h" |
| 6 | 5 | |
| 7 | 6 | #define DMA_MAX_ICOUNT 512 /* Maximum number of DMA Scripts opcodes to run */ |
| r3957 | r3958 | |
| 46 | 45 | void (* dma_callback)(UINT32, UINT32, int, int); |
| 47 | 46 | } lsi810; |
| 48 | 47 | |
| 49 | static void (* dma_opcode[256])(void); | |
| 48 | typedef void (*opcode_handler)(running_machine *machine); | |
| 49 | #define OPCODE_HANDLER(name) void name(running_machine *machine) | |
| 50 | static opcode_handler dma_opcode[256]; | |
| 50 | 51 | |
| 51 | ||
| 52 | INLINE UINT32 FETCH(void) | |
| 52 | INLINE UINT32 FETCH(running_machine *machine) | |
| 53 | 53 | { |
| 54 | UINT32 r = intf->fetch(lsi810.dsp); | |
| 54 | UINT32 r = intf->fetch(machine, lsi810.dsp); | |
| 55 | 55 | lsi810.dsp += 4; |
| 56 | 56 | return r; |
| 57 | 57 | } |
| r3957 | r3958 | |
| 67 | 67 | } |
| 68 | 68 | #endif |
| 69 | 69 | |
| 70 | static | |
| 70 | static OPCODE_HANDLER( dmaop_invalid | |
| 71 | 71 | { |
| 72 | 72 | fatalerror("LSI53C810: Invalid SCRIPTS DMA opcode %08X at %08X", lsi810.dcmd, lsi810.dsp); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | static | |
| 75 | static OPCODE_HANDLER( dmaop_move_memory | |
| 76 | 76 | { |
| 77 | UINT32 src = FETCH(); | |
| 78 | UINT32 dst = FETCH(); | |
| 77 | UINT32 src = FETCH(machine); | |
| 78 | UINT32 dst = FETCH(machine); | |
| 79 | 79 | int count; |
| 80 | 80 | |
| 81 | 81 | count = lsi810.dcmd & 0xffffff; |
| 82 | 82 | if(intf->dma_callback != NULL) { |
| 83 | intf->dma_callback(src, dst, count, 1); | |
| 83 | intf->dma_callback(machine, src, dst, count, 1); | |
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | static | |
| 87 | static OPCODE_HANDLER( dmaop_interrupt | |
| 88 | 88 | { |
| 89 | 89 | if(lsi810.dcmd & 0x100000) { |
| 90 | 90 | fatalerror("LSI53C810: INTFLY opcode not implemented"); |
| 91 | 91 | } |
| 92 | lsi810.dsps = FETCH(); | |
| 92 | lsi810.dsps = FETCH(machine); | |
| 93 | 93 | |
| 94 | 94 | lsi810.istat |= 0x1; /* DMA interrupt pending */ |
| 95 | 95 | lsi810.dstat |= 0x4; /* SIR (SCRIPTS Interrupt Instruction Received) */ |
| 96 | 96 | |
| 97 | 97 | if(intf->irq_callback != NULL) { |
| 98 | intf->irq_callback( | |
| 98 | intf->irq_callback(machine, 1); | |
| 99 | 99 | } |
| 100 | 100 | lsi810.dma_icount = 0; |
| 101 | 101 | lsi810.halted = 1; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | static | |
| 104 | static OPCODE_HANDLER( dmaop_block_move | |
| 105 | 105 | { |
| 106 | 106 | UINT32 address; |
| 107 | 107 | UINT32 count; |
| 108 | 108 | INT32 dsps; |
| 109 | 109 | |
| 110 | address = FETCH(); | |
| 110 | address = FETCH(machine); | |
| 111 | 111 | count = lsi810.dcmd & 0x00ffffff; |
| 112 | 112 | |
| 113 | 113 | // normal indirect |
| 114 | 114 | if (lsi810.dcmd & 0x20000000) |
| 115 | address = intf->fetch(address); | |
| 115 | address = intf->fetch(machine, address); | |
| 116 | 116 | |
| 117 | 117 | // table indirect |
| 118 | 118 | if (lsi810.dcmd & 0x10000000) |
| r3957 | r3958 | |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | static | |
| 148 | static OPCODE_HANDLER( dmaop_select | |
| 149 | 149 | { |
| 150 | 150 | UINT32 operand; |
| 151 | 151 | |
| 152 | operand = FETCH(); | |
| 152 | operand = FETCH(machine); | |
| 153 | 153 | |
| 154 | 154 | if (lsi810.scntl0 & 0x01) |
| 155 | 155 | { |
| r3957 | r3958 | |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | static | |
| 173 | static OPCODE_HANDLER( dmaop_wait_disconnect | |
| 174 | 174 | { |
| 175 | 175 | UINT32 operand; |
| 176 | 176 | |
| 177 | operand = FETCH(); | |
| 177 | operand = FETCH(machine); | |
| 178 | 178 | |
| 179 | 179 | if (lsi810.scntl0 & 0x01) |
| 180 | 180 | { |
| r3957 | r3958 | |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | static | |
| 191 | static OPCODE_HANDLER( dmaop_wait_reselect | |
| 192 | 192 | { |
| 193 | 193 | UINT32 operand; |
| 194 | 194 | |
| 195 | operand = FETCH(); | |
| 195 | operand = FETCH(machine); | |
| 196 | 196 | |
| 197 | 197 | if (lsi810.scntl0 & 0x01) |
| 198 | 198 | { |
| r3957 | r3958 | |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | static | |
| 209 | static OPCODE_HANDLER( dmaop_set | |
| 210 | 210 | { |
| 211 | 211 | UINT32 operand; |
| 212 | 212 | |
| 213 | operand = FETCH(); | |
| 213 | operand = FETCH(machine); | |
| 214 | 214 | |
| 215 | 215 | /* initiator mode */ |
| 216 | 216 | if (lsi810.dcmd & 0x8) |
| r3957 | r3958 | |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | static | |
| 238 | static OPCODE_HANDLER( dmaop_clear | |
| 239 | 239 | { |
| 240 | 240 | UINT32 operand; |
| 241 | 241 | |
| 242 | operand = FETCH(); | |
| 242 | operand = FETCH(machine); | |
| 243 | 243 | |
| 244 | 244 | /* initiator mode */ |
| 245 | 245 | if (lsi810.dcmd & 0x8) |
| r3957 | r3958 | |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | static | |
| 267 | static OPCODE_HANDLER( dmaop_move_from_sfbr | |
| 268 | 268 | { |
| 269 | 269 | fatalerror("LSI53C810: dmaop_move_from_sfbr not implemented in target mode"); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | static | |
| 272 | static OPCODE_HANDLER( dmaop_move_to_sfbr | |
| 273 | 273 | { |
| 274 | 274 | fatalerror("LSI53C810: dmaop_move_to_sfbr not implemented"); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | static | |
| 277 | static OPCODE_HANDLER( dmaop_read_modify_write | |
| 278 | 278 | { |
| 279 | 279 | fatalerror("LSI53C810: dmaop_read_modify_write not implemented"); |
| 280 | 280 | } |
| r3957 | r3958 | |
| 339 | 339 | return passed; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | static UINT32 scripts_get_jump_dest( | |
| 342 | static UINT32 scripts_get_jump_dest(running_machine *machine) | |
| 343 | 343 | { |
| 344 | 344 | INT32 dsps; |
| 345 | 345 | UINT32 dest; |
| 346 | 346 | |
| 347 | dsps = FETCH(); | |
| 347 | dsps = FETCH(machine); | |
| 348 | 348 | |
| 349 | 349 | /* relative or absolute addressing? */ |
| 350 | 350 | if (lsi810.dcmd & 0x00800000) |
| r3957 | r3958 | |
| 357 | 357 | |
| 358 | 358 | logerror("dsps = %x, dsp = %x\n", dsps, lsi810.dsp); |
| 359 | 359 | dsps += lsi810.dsp; |
| 360 | } | |
| 360 | } | |
| 361 | 361 | |
| 362 | 362 | dest = (UINT32)dsps; |
| 363 | 363 | |
| r3957 | r3958 | |
| 366 | 366 | return dest; |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | static | |
| 369 | static OPCODE_HANDLER( dmaop_jump | |
| 370 | 370 | { |
| 371 | 371 | if (scripts_compute_branch()) |
| 372 | 372 | { |
| 373 | lsi810.dsp = scripts_get_jump_dest(); | |
| 373 | lsi810.dsp = scripts_get_jump_dest(machine); | |
| 374 | 374 | } |
| 375 | 375 | else |
| 376 | 376 | { |
| 377 | FETCH(); // skip operand to continue on | |
| 377 | FETCH(machine); // skip operand to continue on | |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | static | |
| 381 | static OPCODE_HANDLER( dmaop_call | |
| 382 | 382 | { |
| 383 | 383 | if (scripts_compute_branch()) |
| 384 | 384 | { |
| r3957 | r3958 | |
| 386 | 386 | lsi810.temp = lsi810.dsp; |
| 387 | 387 | |
| 388 | 388 | // and go |
| 389 | lsi810.dsp = scripts_get_jump_dest(); | |
| 389 | lsi810.dsp = scripts_get_jump_dest(machine); | |
| 390 | 390 | } |
| 391 | 391 | else |
| 392 | 392 | { |
| 393 | FETCH(); // skip operand to continue on | |
| 393 | FETCH(machine); // skip operand to continue on | |
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | static | |
| 397 | static OPCODE_HANDLER( dmaop_return | |
| 398 | 398 | { |
| 399 | 399 | // is this correct? return only happens if the condition is true? |
| 400 | 400 | if (scripts_compute_branch()) |
| r3957 | r3958 | |
| 404 | 404 | } |
| 405 | 405 | else |
| 406 | 406 | { |
| 407 | FETCH(); // skip operand to continue on | |
| 407 | FETCH(machine); // skip operand to continue on | |
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | static | |
| 411 | static OPCODE_HANDLER( dmaop_store | |
| 412 | 412 | { |
| 413 | 413 | fatalerror("LSI53C810: dmaop_store not implemented"); |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | static | |
| 416 | static OPCODE_HANDLER( dmaop_load | |
| 417 | 417 | { |
| 418 | 418 | fatalerror("LSI53C810: dmaop_load not implemented"); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | |
| 422 | 422 | |
| 423 | static void dma_exec( | |
| 423 | static void dma_exec(running_machine *machine) | |
| 424 | 424 | { |
| 425 | 425 | lsi810.dma_icount = DMA_MAX_ICOUNT; |
| 426 | 426 | |
| r3957 | r3958 | |
| 431 | 431 | if (DASM_OPCODES) |
| 432 | 432 | { |
| 433 | 433 | char buf[256]; |
| 434 | lsi53c810_dasm(buf, lsi810.dsp); | |
| 434 | lsi53c810_dasm(machine, buf, lsi810.dsp); | |
| 435 | 435 | logerror("0x%08X: %s\n", lsi810.dsp, buf); |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | lsi810.dcmd = FETCH(); | |
| 438 | lsi810.dcmd = FETCH(machine); | |
| 439 | 439 | |
| 440 | 440 | op = (lsi810.dcmd >> 24) & 0xff; |
| 441 | dma_opcode[op](); | |
| 441 | dma_opcode[op](machine); | |
| 442 | 442 | |
| 443 | 443 | lsi810.dma_icount--; |
| 444 | 444 | } |
| r3957 | r3958 | |
| 593 | 593 | lsi810.dsp |= data << 24; |
| 594 | 594 | lsi810.halted = 0; |
| 595 | 595 | if((lsi810.dmode & 0x1) == 0 && !lsi810.halted) { |
| 596 | dma_exec(); | |
| 596 | dma_exec(space->machine); | |
| 597 | 597 | } |
| 598 | 598 | break; |
| 599 | 599 | case 0x34: /* SCRATCH A */ |
| r3957 | r3958 | |
| 614 | 614 | if(lsi810.dcntl & 0x14 && !lsi810.halted) /* single-step & start DMA */ |
| 615 | 615 | { |
| 616 | 616 | int op; |
| 617 | lsi810.dcmd = FETCH(); | |
| 617 | lsi810.dcmd = FETCH(space->machine); | |
| 618 | 618 | op = (lsi810.dcmd >> 24) & 0xff; |
| 619 | dma_opcode[op](); | |
| 619 | dma_opcode[op](space->machine); | |
| 620 | 620 | |
| 621 | 621 | lsi810.istat |= 0x3; /* DMA interrupt pending */ |
| 622 | 622 | lsi810.dstat |= 0x8; /* SSI (Single Step Interrupt) */ |
| r3957 | r3958 | |
| 626 | 626 | } |
| 627 | 627 | else if(lsi810.dcntl & 0x04 && !lsi810.halted) /* manual start DMA */ |
| 628 | 628 | { |
| 629 | dma_exec(); | |
| 629 | dma_exec(space->machine); | |
| 630 | 630 | } |
| 631 | 631 | break; |
| 632 | 632 | case 0x40: /* SIEN0 */ |
| r3957 | r3958 | |
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | static void add_opcode(UINT8 op, UINT8 mask, | |
| 659 | static void add_opcode(UINT8 op, UINT8 mask, | |
| 660 | 660 | { |
| 661 | 661 | int i; |
| 662 | 662 | for(i=0; i < 256; i++) { |
| r3957 | r3958 | |
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | ||
| 669 | ||
| 670 | 670 | { |
| 671 | 671 | int i; |
| 672 | 672 | |
| r3957 | r3958 | |
| 701 | 701 | // try to open the devices |
| 702 | 702 | for (i = 0; i < interface->scsidevs->devs_present; i++) |
| 703 | 703 | { |
| 704 | SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 704 | SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 705 | 705 | } |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | ||
| 708 | ||
| 709 | 709 | { |
| 710 | 710 | int i; |
| 711 | 711 | |
| r3957 | r3958 | |
| 760 | 760 | * |
| 761 | 761 | *************************************/ |
| 762 | 762 | |
| 763 | static UINT32 lsi53c810_dasm_fetch(UINT32 pc) | |
| 763 | static UINT32 lsi53c810_dasm_fetch(running_machine *machine, UINT32 pc) | |
| 764 | 764 | { |
| 765 | return intf->fetch(pc); | |
| 765 | return intf->fetch(machine, pc); | |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | unsigned lsi53c810_dasm(char *buf, UINT32 pc) | |
| 768 | unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc) | |
| 769 | 769 | { |
| 770 | 770 | unsigned result = 0; |
| 771 | 771 | const char *op_mnemonic = NULL; |
| 772 | UINT32 op = lsi53c810_dasm_fetch(pc); | |
| 772 | UINT32 op = lsi53c810_dasm_fetch(machine, pc); | |
| 773 | 773 | UINT32 dest; |
| 774 | 774 | int i; |
| 775 | 775 | |
| r3957 | r3958 | |
| 782 | 782 | if ((op & 0xF8000000) == 0x40000000) |
| 783 | 783 | { |
| 784 | 784 | /* SELECT */ |
| 785 | dest = lsi53c810_dasm_fetch(pc + 4); | |
| 785 | dest = lsi53c810_dasm_fetch(machine, pc + 4); | |
| 786 | 786 | |
| 787 | 787 | buf += sprintf(buf, "SELECT%s %d, 0x%08X", |
| 788 | 788 | (op & 0x01000000) ? " ATN" : "", |
| r3957 | r3958 | |
| 841 | 841 | case 0x98000000: op_mnemonic = "INT"; break; |
| 842 | 842 | } |
| 843 | 843 | |
| 844 | dest = lsi53c810_dasm_fetch(pc + 4); | |
| 844 | dest = lsi53c810_dasm_fetch(machine, pc + 4); | |
| 845 | 845 | |
| 846 | 846 | if (op & 0x00800000) |
| 847 | 847 | { |
| r3957 | r3958 | |
| 887 | 887 | else if ((op & 0xE0000000) == 0x00000000) |
| 888 | 888 | { |
| 889 | 889 | /* MOVE FROM */ |
| 890 | dest = lsi53c810_dasm_fetch(pc + 4); | |
| 890 | dest = lsi53c810_dasm_fetch(machine, pc + 4); | |
| 891 | 891 | |
| 892 | 892 | buf += sprintf(buf, "MOVE FROM 0x%08X, WHEN %s", |
| 893 | 893 | dest, phases[(op >> 24) & 0x07]); |
| r3957 | r3958 | |
| 897 | 897 | else if ((op & 0xE0000000) == 0x20000000) |
| 898 | 898 | { |
| 899 | 899 | /* MOVE PTR */ |
| 900 | dest = lsi53c810_dasm_fetch(pc + 4); | |
| 900 | dest = lsi53c810_dasm_fetch(machine, pc + 4); | |
| 901 | 901 | |
| 902 | 902 | buf += sprintf(buf, "MOVE 0x%08X, PTR 0x%08X, WHEN %s", |
| 903 | 903 | (op & 0x00FFFFFF), dest, phases[(op >> 24) & 0x07]); |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | #define ACIA6850_STATUS_PE 0x40 |
| 26 | 26 | #define ACIA6850_STATUS_IRQ 0x80 |
| 27 | 27 | |
| 28 | #define MDRV_ACIA6850_ADD(_tag, _config) \ | |
| 29 | MDRV_DEVICE_ADD(_tag, ACIA6850, 0) \ | |
| 30 | MDRV_DEVICE_CONFIG(_config) | |
| 28 | 31 | |
| 32 | #define MDRV_ACIA6850_REMOVE(_tag) \ | |
| 33 | MDRV_DEVICE_REMOVE(_tag, ACIA6850) | |
| 29 | 34 | |
| 35 | ||
| 36 | ||
| 30 | 37 | /*************************************************************************** |
| 31 | 38 | TYPE DEFINITIONS |
| 32 | 39 | ***************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | { |
| 8 | 8 | const SCSIConfigTable *scsidevs; /* SCSI devices */ |
| 9 | 9 | void (*irq_callback)(running_machine *machine, int); /* IRQ callback */ |
| 10 | void (*dma_callback)(UINT32, UINT32, int, int); /* DMA callback */ | |
| 11 | UINT32 (*fetch)(UINT32 dsp); | |
| 10 | void (*dma_callback)(running_machine *machine, UINT32, UINT32, int, int); /* DMA callback */ | |
| 11 | UINT32 (*fetch)(running_machine *machine, UINT32 dsp); | |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | extern void lsi53c810_init(const struct LSI53C810interface *interface); | |
| 14 | extern void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface); | |
| 15 | 15 | extern void lsi53c810_exit(const struct LSI53C810interface *interface); |
| 16 | 16 | |
| 17 | 17 | extern void lsi53c810_read_data(int bytes, UINT8 *pData); |
| r3957 | r3958 | |
| 22 | 22 | READ8_HANDLER( lsi53c810_reg_r ); |
| 23 | 23 | WRITE8_HANDLER( lsi53c810_reg_w ); |
| 24 | 24 | |
| 25 | unsigned lsi53c810_dasm(char *buf, UINT32 pc); | |
| 25 | unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc); | |
| 26 | 26 | |
| 27 | 27 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | #define PCCOMMON_KEYBOARD_PC 0 |
| 5 | 5 | #define PCCOMMON_KEYBOARD_AT 1 |
| 6 | 6 | |
| 7 | void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(int)); | |
| 7 | void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int)); | |
| 8 | 8 | |
| 9 | 9 | void pc_keyboard(void); |
| 10 | 10 | UINT8 pc_keyb_read(void); |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | #include "deprecat.h" | |
| 16 | 15 | #include "state.h" |
| 17 | 16 | #include "wd33c93.h" |
| 18 | 17 | |
| r3957 | r3958 | |
| 170 | 169 | #define SRCID_ER 0x80 |
| 171 | 170 | |
| 172 | 171 | /* command handler definition */ |
| 173 | typedef void (*cmd_handler)(void); | |
| 172 | typedef void (*cmd_handler)(running_machine *machine); | |
| 173 | #define CMD_HANDLER(name) void name(running_machine *machine) | |
| 174 | 174 | |
| 175 | 175 | #define TEMP_INPUT_LEN 65536 |
| 176 | 176 | #define FIFO_SIZE 12 |
| r3957 | r3958 | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /* command handlers */ |
| 295 | static | |
| 295 | static CMD_HANDLER( wd33c93_invalid_cm | |
| 296 | 296 | { |
| 297 | logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", cpuexec_describe_context( | |
| 297 | logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", cpuexec_describe_context(machine), scsi_data.regs[WD_COMMAND] ); | |
| 298 | 298 | |
| 299 | 299 | /* complete the command */ |
| 300 | 300 | wd33c93_complete_cmd( CSR_INVALID ); |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | static | |
| 303 | static CMD_HANDLER( wd33c93_reset_cm | |
| 304 | 304 | { |
| 305 | 305 | int advanced = 0; |
| 306 | 306 | |
| r3957 | r3958 | |
| 317 | 317 | wd33c93_complete_cmd(advanced ? CSR_RESET_AF : CSR_RESET); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | static | |
| 320 | static CMD_HANDLER( wd33c93_abort_cm | |
| 321 | 321 | { |
| 322 | 322 | /* complete the command */ |
| 323 | 323 | wd33c93_complete_cmd(CSR_ABORT); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | static | |
| 326 | static CMD_HANDLER( wd33c93_disconnect_cm | |
| 327 | 327 | { |
| 328 | 328 | /* complete the command */ |
| 329 | 329 | scsi_data.regs[WD_AUXILIARY_STATUS] &= ~(ASR_CIP | ASR_BSY); |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | static | |
| 332 | static CMD_HANDLER( wd33c93_select_cm | |
| 333 | 333 | { |
| 334 | 334 | UINT8 unit = wd33c93_getunit(); |
| 335 | 335 | UINT8 newstatus; |
| r3957 | r3958 | |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /* queue up a service request out in the future */ |
| 356 | timer_set( | |
| 356 | timer_set( machine, ATTOTIME_IN_USEC(50), NULL, 0, wd33c93_service_request ); | |
| 357 | 357 | } |
| 358 | 358 | else |
| 359 | 359 | { |
| r3957 | r3958 | |
| 365 | 365 | wd33c93_complete_cmd(newstatus); |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | static | |
| 368 | static CMD_HANDLER( wd33c93_selectxfer_cm | |
| 369 | 369 | { |
| 370 | 370 | UINT8 unit = wd33c93_getunit(); |
| 371 | 371 | UINT8 newstatus; |
| r3957 | r3958 | |
| 425 | 425 | scsi_data.busphase = PHS_MESS_IN; |
| 426 | 426 | |
| 427 | 427 | /* queue up a service request out in the future */ |
| 428 | timer_set( | |
| 428 | timer_set( machine, ATTOTIME_IN_MSEC(50), NULL, 0, wd33c93_service_request ); | |
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | else |
| r3957 | r3958 | |
| 440 | 440 | wd33c93_complete_cmd(newstatus); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | static | |
| 443 | static CMD_HANDLER( wd33c93_negate_ack | |
| 444 | 444 | { |
| 445 | 445 | logerror( "WD33C93: ACK Negated\n" ); |
| 446 | 446 | |
| r3957 | r3958 | |
| 448 | 448 | scsi_data.regs[WD_AUXILIARY_STATUS] &= ~(ASR_CIP | ASR_BSY); |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | static | |
| 451 | static CMD_HANDLER( wd33c93_xferinfo_cm | |
| 452 | 452 | { |
| 453 | 453 | /* make the buffer available right away */ |
| 454 | 454 | scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_DBR; |
| 455 | 455 | scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP; |
| 456 | 456 | |
| 457 | 457 | /* the command will be completed once the data is transferred */ |
| 458 | timer_set( | |
| 458 | timer_set( machine, ATTOTIME_IN_MSEC(1), NULL, 0, wd33c93_deassert_cip ); | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | /* Command handlers */ |
| r3957 | r3958 | |
| 498 | 498 | }; |
| 499 | 499 | |
| 500 | 500 | /* Handle pending commands */ |
| 501 | static void wd33c93_command( | |
| 501 | static void wd33c93_command( running_machine *machine ) | |
| 502 | 502 | { |
| 503 | 503 | /* get the command */ |
| 504 | 504 | UINT8 cmd = scsi_data.regs[WD_COMMAND]; |
| r3957 | r3958 | |
| 506 | 506 | /* check if its within valid bounds */ |
| 507 | 507 | if ( (cmd & 0x7F) > WD_CMD_TRANSFER_PAD ) |
| 508 | 508 | { |
| 509 | wd33c93_invalid_cmd(); | |
| 509 | wd33c93_invalid_cmd(machine); | |
| 510 | 510 | return; |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /* call the command handler */ |
| 514 | (*wd33c93_cmds[cmd & 0x7F])(); | |
| 514 | (*wd33c93_cmds[cmd & 0x7F])(machine); | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | WRITE8_HANDLER(wd33c93_w) |
| r3957 | r3958 | |
| 541 | 541 | scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP; |
| 542 | 542 | |
| 543 | 543 | /* process the command */ |
| 544 | wd33c93_command(); | |
| 544 | wd33c93_command(space->machine); | |
| 545 | 545 | } |
| 546 | 546 | else if ( scsi_data.sasr == WD_CDB_1 ) |
| 547 | 547 | { |
| r3957 | r3958 | |
| 792 | 792 | // try to open the devices |
| 793 | 793 | for (i = 0; i < interface->scsidevs->devs_present; i++) |
| 794 | 794 | { |
| 795 | SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 795 | SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 796 | 796 | } |
| 797 | 797 | |
| 798 | 798 | /* allocate a timer for commands */ |
| r3957 | r3958 | |
|---|---|---|
| 450 | 450 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(pic8259); break; |
| 451 | 451 | |
| 452 | 452 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 453 | case DEVINFO_STR_NAME: info->s = "Intel PIC8259"; break; | |
| 454 | case DEVINFO_STR_FAMILY: info->s = "PIC8259"; break; | |
| 455 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 456 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 457 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 453 | case DEVINFO_STR_NAME: strcpy(info->s, "Intel PIC8259"); break; | |
| 454 | case DEVINFO_STR_FAMILY: strcpy(info->s, "PIC8259"); break; | |
| 455 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 456 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 457 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 |
| r3957 | r3958 | |
|---|---|---|
| 93 | 93 | ***************************************************************************/ |
| 94 | 94 | |
| 95 | 95 | #define MDRV_LASERDISC_ADD(_tag, _type, _screen, _sound) \ |
| 96 | MDRV_DEVICE_ADD(_tag, LASERDISC) \ | |
| 96 | MDRV_DEVICE_ADD(_tag, LASERDISC, 0) \ | |
| 97 | 97 | MDRV_DEVICE_CONFIG_DATA32(laserdisc_config, type, LASERDISC_TYPE_##_type) \ |
| 98 | 98 | MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, screen, _screen) \ |
| 99 | 99 | MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, sound, _sound) \ |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #define MDRV_PIC8259_ADD(_tag, _intrf) \ |
| 31 | MDRV_DEVICE_ADD(_tag, PIC8259) \ | |
| 31 | MDRV_DEVICE_ADD(_tag, PIC8259, 0) \ | |
| 32 | 32 | MDRV_DEVICE_CONFIG(_intrf) |
| 33 | 33 | |
| 34 | 34 |
| r3957 | r3958 | |
|---|---|---|
| 146 | 146 | static void read_track_data(laserdisc_state *ld); |
| 147 | 147 | static void process_track_data(const device_config *device); |
| 148 | 148 | static CUSTOM_START( custom_start ); |
| 149 | static | |
| 149 | static STREAM_UPDATE( custom_stream_callback | |
| 150 | 150 | static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode); |
| 151 | 151 | static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode); |
| 152 | 152 | |
| r3957 | r3958 | |
| 957 | 957 | for laserdiscs |
| 958 | 958 | -------------------------------------------------*/ |
| 959 | 959 | |
| 960 | static | |
| 960 | static STREAM_UPDATE( custom_stream_callback | |
| 961 | 961 | { |
| 962 | 962 | sound_token *token = param; |
| 963 | 963 | laserdisc_state *ld = token->ld; |
| r3957 | r3958 | |
| 1634 | 1634 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(laserdisc); break; |
| 1635 | 1635 | |
| 1636 | 1636 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1637 | case DEVINFO_STR_NAME: info->s = (intf != NULL) ? intf->name : "Unknown Laserdisc Player"; break; | |
| 1638 | case DEVINFO_STR_FAMILY: info->s = "Laserdisc Player"; break; | |
| 1639 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1640 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1641 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1637 | case DEVINFO_STR_NAME: strcpy(info->s, (intf != NULL) ? intf->name : "Unknown Laserdisc Player"); break; | |
| 1638 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Laserdisc Player"); break; | |
| 1639 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1640 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1641 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1642 | 1642 | } |
| 1643 | 1643 | } |
| r3957 | r3958 | |
|---|---|---|
| 178 | 178 | case DEVINFO_FCT_NVRAM: info->nvram = DEVICE_NVRAM_NAME(x2212); break; |
| 179 | 179 | |
| 180 | 180 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 181 | case DEVINFO_STR_NAME: info->s = "X2212"; break; | |
| 182 | case DEVINFO_STR_FAMILY: info->s = "EEPROM"; break; | |
| 183 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 184 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 185 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 181 | case DEVINFO_STR_NAME: strcpy(info->s, "X2212"); break; | |
| 182 | case DEVINFO_STR_FAMILY: strcpy(info->s, "EEPROM"); break; | |
| 183 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 184 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 185 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 186 | 186 | } |
| 187 | 187 | } |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | #define X2212 DEVICE_GET_INFO_NAME(x2212) |
| 18 | 18 | DEVICE_GET_INFO(x2212); |
| 19 | 19 | |
| 20 | #define MDRV_X2212_ADD(_tag) \ | |
| 21 | MDRV_DEVICE_ADD(_tag, X2212, 0) | |
| 22 | ||
| 23 | #define MDRV_X2212_REMOVE(_tag) \ | |
| 24 | MDRV_DEVICE_REMOVE(_tag, X2212) | |
| 25 | ||
| 26 | ||
| 20 | 27 | extern void x2212_write( const device_config *device, int offset, int data ); |
| 21 | 28 | extern int x2212_read( const device_config *device, int offset ); |
| 22 | 29 | extern void x2212_store( const device_config *device, int store ); |
| r3957 | r3958 | |
|---|---|---|
| 124 | 124 | /* validate some basic stuff */ |
| 125 | 125 | assert(device != NULL); |
| 126 | 126 | // assert(device->static_config != NULL); |
| 127 | ||
| 127 | // assert(device->inline_config == NULL); | |
| 128 | 128 | assert(device->machine != NULL); |
| 129 | 129 | assert(device->machine->config != NULL); |
| 130 | 130 | |
| r3957 | r3958 | |
| 134 | 134 | c->oe_12v = 0; |
| 135 | 135 | c->last_write = -1; |
| 136 | 136 | c->write_timer = timer_alloc(device->machine, write_finished, c ); |
| 137 | c->default_data = device->region; | |
| 137 | 138 | |
| 138 | config = device->static_config; | |
| 139 | if( config != NULL && config->data != NULL ) | |
| 140 | { | |
| 141 | c->default_data = memory_region( device->machine, config->data ); | |
| 142 | } | |
| 143 | ||
| 144 | if( config != NULL && config->id != NULL ) | |
| 145 | { | |
| 139 | config = device->inline_config; | |
| 140 | if (config->id != NULL) | |
| 146 | 141 | c->default_id = memory_region( device->machine, config->id ); |
| 147 | } | |
| 148 | 142 | |
| 149 | 143 | /* create the name for save states */ |
| 150 | 144 | state_save_register_device_item_pointer( device, 0, c->data, SIZE_DATA ); |
| r3957 | r3958 | |
| 225 | 219 | { |
| 226 | 220 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 227 | 221 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(at28c16_state); break; |
| 228 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = | |
| 222 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = | |
| 229 | 223 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 230 | 224 | |
| 231 | 225 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r3957 | r3958 | |
| 236 | 230 | case DEVINFO_FCT_NVRAM: info->nvram = DEVICE_NVRAM_NAME(at28c16); break; |
| 237 | 231 | |
| 238 | 232 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 239 | case DEVINFO_STR_NAME: info->s = "AT28C16"; break; | |
| 240 | case DEVINFO_STR_FAMILY: info->s = "EEPROM"; break; | |
| 241 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 242 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 243 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 233 | case DEVINFO_STR_NAME: strcpy(info->s, "AT28C16"); break; | |
| 234 | case DEVINFO_STR_FAMILY: strcpy(info->s, "EEPROM"); break; | |
| 235 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 236 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 237 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 244 | 238 | } |
| 245 | 239 | } |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | typedef struct _at28c16_config at28c16_config; |
| 12 | 12 | struct _at28c16_config |
| 13 | 13 | { |
| 14 | const char *data; | |
| 15 | 14 | const char *id; |
| 16 | 15 | }; |
| 17 | 16 | |
| 18 | 17 | #define AT28C16 DEVICE_GET_INFO_NAME(at28c16) |
| 19 | 18 | DEVICE_GET_INFO(at28c16); |
| 20 | 19 | |
| 20 | #define MDRV_AT28C16_ADD(_tag, _id) \ | |
| 21 | MDRV_DEVICE_ADD(_tag, AT28C16, 0) \ | |
| 22 | MDRV_DEVICE_CONFIG_DATAPTR(at28c16_config, id, _id) | |
| 23 | ||
| 24 | #define MDRV_AT28C16_REMOVE(_tag) \ | |
| 25 | MDRV_DEVICE_REMOVE(_tag, AT28C16) | |
| 26 | ||
| 27 | ||
| 21 | 28 | extern void at28c16_a9_12v( const device_config *device, int a9_12v ); |
| 22 | 29 | extern void at28c16_oe_12v( const device_config *device, int a9_12v ); |
| 23 | 30 |
| r3957 | r3958 | |
|---|---|---|
| 1 | 1 | #include "scsi.h" |
| 2 | 2 | |
| 3 | void SCSIAllocInstance( const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion ) | |
| 3 | void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion ) | |
| 4 | 4 | { |
| 5 | 5 | SCSIAllocInstanceParams params; |
| 6 | 6 | params.instance = NULL; |
| 7 | 7 | params.diskregion = diskregion; |
| 8 | params.machine = machine; | |
| 8 | 9 | scsiClass->dispatch( SCSIOP_ALLOC_INSTANCE, (void *)scsiClass, 0, ¶ms ); |
| 9 | 10 | *instance = params.instance; |
| 10 | 11 | } |
| r3957 | r3958 | |
| 102 | 103 | return scsiClass->baseClass->dispatch( operation, file, intparm, ptrparm ); |
| 103 | 104 | } |
| 104 | 105 | |
| 105 | SCSIInstance *SCSIMalloc( const SCSIClass *scsiClass ) | |
| 106 | SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass ) | |
| 106 | 107 | { |
| 107 | 108 | SCSIInstance *scsiInstance = (SCSIInstance *) malloc_or_die( SCSISizeof( scsiClass ) ); |
| 108 | 109 | scsiInstance->scsiClass = scsiClass; |
| 110 | scsiInstance->machine = machine; | |
| 109 | 111 | return scsiInstance; |
| 110 | 112 | } |
| 111 | 113 |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | typedef struct |
| 23 | 23 | { |
| 24 | 24 | const SCSIClass *scsiClass; |
| 25 | running_machine *machine; | |
| 25 | 26 | } SCSIInstance; |
| 26 | 27 | |
| 27 | 28 | typedef struct |
| 28 | 29 | { |
| 29 | 30 | SCSIInstance *instance; |
| 30 | 31 | const char *diskregion; |
| 32 | running_machine *machine; | |
| 31 | 33 | } SCSIAllocInstanceParams; |
| 32 | 34 | |
| 33 | 35 | // commands accepted by a SCSI device's dispatch handler |
| r3957 | r3958 | |
| 83 | 85 | #define SCSI_PHASE_MESSAGE_OUT ( 6 ) |
| 84 | 86 | #define SCSI_PHASE_MESSAGE_IN ( 7 ) |
| 85 | 87 | |
| 86 | extern void SCSIAllocInstance( const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion ); | |
| 88 | extern void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion ); | |
| 87 | 89 | extern void SCSIDeleteInstance( SCSIInstance *instance ); |
| 88 | 90 | extern void SCSISetDevice( SCSIInstance *instance, void *device ); |
| 89 | 91 | extern void SCSIGetDevice( SCSIInstance *instance, void **device ); |
| r3957 | r3958 | |
| 96 | 98 | extern void SCSISetPhase( SCSIInstance *instance, int phase ); |
| 97 | 99 | extern void SCSIGetPhase( SCSIInstance *instance, int *phase ); |
| 98 | 100 | |
| 99 | extern SCSIInstance *SCSIMalloc( const SCSIClass *scsiClass ); | |
| 101 | extern SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass ); | |
| 100 | 102 | extern int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm ); |
| 101 | 103 | extern void *SCSIThis( const SCSIClass *scsiClass, SCSIInstance *instance ); |
| 102 | 104 | extern int SCSISizeof( const SCSIClass *scsiClass ); |
| r3957 | r3958 | |
|---|---|---|
| 430 | 430 | |
| 431 | 431 | |
| 432 | 432 | |
| 433 | static TIMER_CALLBACK(at_8042_receive_timer) | |
| 434 | { | |
| 435 | at_8042_receive(machine, param); | |
| 436 | } | |
| 437 | ||
| 438 | ||
| 439 | ||
| 440 | 433 | WRITE8_HANDLER(kbdc8042_8_w) |
| 441 | 434 | { |
| 442 | 435 | switch (offset) { |
| r3957 | r3958 | |
| 516 | 509 | at_8042_receive(space->machine, PS2_MOUSE_ON ? 0x00 : 0xff); |
| 517 | 510 | break; |
| 518 | 511 | case 0xaa: /* selftest */ |
| 519 | if (space->machine->config->cpu[0].type == CPU_I486) | |
| 520 | timer_set(space->machine, ATTOTIME_IN_MSEC(10), NULL, 0x55, at_8042_receive_timer); /* HACK */ | |
| 521 | else | |
| 522 | at_8042_receive(space->machine, 0x55); | |
| 512 | at_8042_receive(space->machine, 0x55); | |
| 523 | 513 | break; |
| 524 | 514 | case 0xab: /* test keyboard */ |
| 525 | 515 | at_8042_receive(space->machine, KEYBOARD_ON ? 0x00 : 0xff); |
| r3957 | r3958 | |
|---|---|---|
| 260 | 260 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(latch8);break; |
| 261 | 261 | |
| 262 | 262 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 263 | case DEVINFO_STR_NAME: info->s = "8 bit latch"; break; | |
| 264 | case DEVINFO_STR_FAMILY: info->s = "Latches"; break; | |
| 265 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 266 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 267 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 263 | case DEVINFO_STR_NAME: strcpy(info->s, "8 bit latch"); break; | |
| 264 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Latches"); break; | |
| 265 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 266 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 267 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 268 | 268 | } |
| 269 | 269 | } |
| r3957 | r3958 | |
|---|---|---|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /* set the halt line */ |
| 177 | if (dma8237->intf && dma8237->intf->cpu | |
| 177 | if (dma8237->intf && dma8237->intf->cputag != NULL) | |
| 178 | 178 | { |
| 179 | cpu_set_input_line(device->machine | |
| 179 | cputag_set_input_line(device->machine, | |
| 180 | 180 | pending_transfer ? ASSERT_LINE : CLEAR_LINE); |
| 181 | 181 | } |
| 182 | 182 | |
| r3957 | r3958 | |
| 440 | 440 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(dma8237); break; |
| 441 | 441 | |
| 442 | 442 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 443 | case DEVINFO_STR_NAME: info->s = "Intel DMA8237"; break; | |
| 444 | case DEVINFO_STR_FAMILY: info->s = "DMA8237"; break; | |
| 445 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 446 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 447 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 443 | case DEVINFO_STR_NAME: strcpy(info->s, "Intel DMA8237"); break; | |
| 444 | case DEVINFO_STR_FAMILY: strcpy(info->s, "DMA8237"); break; | |
| 445 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 446 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 447 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 |
| r3957 | r3958 | |
|---|---|---|
| 93 | 93 | { |
| 94 | 94 | cdp1852_t *cdp1852 = get_safe_token(device); |
| 95 | 95 | |
| 96 | if (cdp1852->intf->mode == CDP1852_MODE_INPUT && | |
| 96 | if (cdp1852->intf->mode == CDP1852_MODE_INPUT && | |
| 97 | 97 | { |
| 98 | 98 | // input data into register |
| 99 | 99 | cdp1852->data = cdp1852->intf->data_r(device); |
| r3957 | r3958 | |
| 135 | 135 | } |
| 136 | 136 | else |
| 137 | 137 | { |
| 138 | assert( | |
| 138 | assert( | |
| 139 | 139 | assert(cdp1852->intf->data_w != NULL); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /* create the timers */ |
| 143 | if ( | |
| 143 | if ( | |
| 144 | 144 | { |
| 145 | 145 | cdp1852->scan_timer = timer_alloc(device->machine, cdp1852_scan_tick, (void *)device); |
| 146 | timer_adjust_periodic(cdp1852->scan_timer, attotime_zero, 0, ATTOTIME_IN_HZ( | |
| 146 | timer_adjust_periodic(cdp1852->scan_timer, attotime_zero, 0, ATTOTIME_IN_HZ( | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /* register for state saving */ |
| r3957 | r3958 | |
| 202 | 202 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1852); break; |
| 203 | 203 | |
| 204 | 204 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 205 | case DEVINFO_STR_NAME: info->s = "RCA CDP1852"; break; | |
| 206 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break; | |
| 207 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 208 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 209 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 205 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1852"); break; | |
| 206 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; | |
| 207 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 208 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 209 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 210 | 210 | } |
| 211 | 211 | } |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | /* add device */ |
| 51 | 51 | #define MDRV_LATCH8_ADD(_tag) \ |
| 52 | MDRV_DEVICE_ADD(_tag, LATCH8) | |
| 52 | MDRV_DEVICE_ADD(_tag, LATCH8, 0) | |
| 53 | 53 | |
| 54 | 54 | /* Bit mask specifying bits to be masked *out* */ |
| 55 | 55 | #define MDRV_LATCH8_MASKOUT(_maskout) \ |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | struct dma8237_interface |
| 25 | 25 | { |
| 26 | 26 | /* CPU to halt when DMA is active */ |
| 27 | | |
| 27 | const char *cputag; | |
| 28 | 28 | |
| 29 | 29 | /* speed of DMA accesses (per byte) */ |
| 30 | 30 | double bus_speed; |
| r3957 | r3958 | |
| 47 | 47 | ***************************************************************************/ |
| 48 | 48 | |
| 49 | 49 | #define MDRV_DMA8237_ADD(_tag, _intrf) \ |
| 50 | MDRV_DEVICE_ADD(_tag, DMA8237) \ | |
| 50 | MDRV_DEVICE_ADD(_tag, DMA8237, 0) \ | |
| 51 | 51 | MDRV_DEVICE_CONFIG(_intrf) |
| 52 | 52 | |
| 53 | 53 |
| r3957 | r3958 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | #define CDP1852 DEVICE_GET_INFO_NAME(cdp1852) |
| 40 | 40 | |
| 41 | #define MDRV_CDP1852_ADD(_tag, _clock, _config) \ | |
| 42 | MDRV_DEVICE_ADD(_tag, CDP1852, _clock) \ | |
| 43 | MDRV_DEVICE_CONFIG(_config) | |
| 44 | ||
| 45 | #define MDRV_CDP1852_REMOVE(_tag) \ | |
| 46 | MDRV_DEVICE_REMOVE(_tag, CDP1852) | |
| 47 | ||
| 48 | ||
| 41 | 49 | typedef enum _cdp1852_mode cdp1852_mode; |
| 42 | 50 | enum _cdp1852_mode { |
| 43 | 51 | CDP1852_MODE_INPUT = 0, |
| r3957 | r3958 | |
| 48 | 56 | typedef struct _cdp1852_interface cdp1852_interface; |
| 49 | 57 | struct _cdp1852_interface |
| 50 | 58 | { |
| 51 | int clock; /* the clock (pin 1) of the chip */ | |
| 52 | ||
| 53 | 59 | int mode; /* operation mode */ |
| 54 | 60 | |
| 55 | 61 | /* this gets called for every external data read */ |
| r3957 | r3958 | |
|---|---|---|
| 178 | 178 | { |
| 179 | 179 | sio_channel chan[2]; /* 2 channels */ |
| 180 | 180 | UINT8 int_state[8]; /* interrupt states */ |
| 181 | UINT32 clock; /* clock value */ | |
| 182 | 181 | |
| 183 | 182 | void (*irq_cb)(const device_config *device, int state); |
| 184 | 183 | write8_device_func dtr_changed_cb; |
| r3957 | r3958 | |
| 786 | 785 | const z80sio_interface *intf = device->static_config; |
| 787 | 786 | astring *tempstring = astring_alloc(); |
| 788 | 787 | z80sio *sio = get_safe_token(device); |
| 789 | const device_config *cpu = NULL; | |
| 790 | 788 | void *ptr = (void *)device; |
| 791 | 789 | |
| 792 | if (intf->cpu != NULL) | |
| 793 | { | |
| 794 | cpu = cputag_get_cpu(device->machine, device_inherit_tag(tempstring, device->tag, intf->cpu)); | |
| 795 | if (cpu == NULL) | |
| 796 | fatalerror("Z80SIO:Unable to find CPU %s\n", device_inherit_tag(tempstring, device->tag, intf->cpu)); | |
| 797 | } | |
| 798 | if (cpu != NULL) | |
| 799 | sio->clock = cpu_get_clock(cpu); | |
| 800 | else | |
| 801 | sio->clock = intf->baseclock; | |
| 802 | ||
| 803 | 790 | sio->chan[0].receive_timer = timer_alloc(device->machine, serial_callback, ptr); |
| 804 | 791 | sio->chan[1].receive_timer = timer_alloc(device->machine, serial_callback, ptr); |
| 805 | 792 | |
| r3957 | r3958 | |
| 853 | 840 | case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)z80sio_irq_reti; break; |
| 854 | 841 | |
| 855 | 842 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 856 | case DEVINFO_STR_NAME: info->s = "Zilog Z80 SIO"; break; | |
| 857 | case DEVINFO_STR_FAMILY: info->s = "Z80"; break; | |
| 858 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 859 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 860 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 843 | case DEVINFO_STR_NAME: strcpy(info->s, "Zilog Z80 SIO"); break; | |
| 844 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Z80"); break; | |
| 845 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 846 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 847 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 861 | 848 | } |
| 862 | 849 | } |
| 863 | 850 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | typedef struct _z80sio_interface z80sio_interface; |
| 19 | 19 | struct _z80sio_interface |
| 20 | 20 | { |
| 21 | const char *cpu; /* CPU whose clock we use for our base */ | |
| 22 | int baseclock; | |
| 23 | 21 | void (*irq_cb)(const device_config *device, int state); |
| 24 | 22 | write8_device_func dtr_changed_cb; |
| 25 | 23 | write8_device_func rts_changed_cb; |
| r3957 | r3958 | |
| 34 | 32 | DEVICE CONFIGURATION MACROS |
| 35 | 33 | ***************************************************************************/ |
| 36 | 34 | |
| 37 | #define MDRV_Z80SIO_ADD(_tag, _intrf) \ | |
| 38 | MDRV_DEVICE_ADD(_tag, Z80SIO) \ | |
| 35 | #define MDRV_Z80SIO_ADD(_tag, _clock, _intrf) \ | |
| 36 | MDRV_DEVICE_ADD(_tag, Z80SIO, _clock) \ | |
| 39 | 37 | MDRV_DEVICE_CONFIG(_intrf) |
| 40 | 38 | |
| 41 | 39 | #define MDRV_Z80SIO_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | int last_touch_state; |
| 28 | 28 | int last_x; |
| 29 | 29 | int last_y; |
| 30 | void (*tx_callback)(UINT8 data); | |
| 31 | int (*touch_callback)(int *touch_x, int *touch_y); | |
| 30 | microtouch_tx_func tx_callback; | |
| 31 | microtouch_touch_func touch_callback; | |
| 32 | 32 | } microtouch; |
| 33 | 33 | |
| 34 | 34 | |
| r3957 | r3958 | |
| 64 | 64 | { |
| 65 | 65 | if ( microtouch.tx_buffer_ptr < microtouch.tx_buffer_num ) |
| 66 | 66 | { |
| 67 | microtouch.tx_callback( microtouch.tx_buffer[microtouch.tx_buffer_ptr++] ); | |
| 67 | microtouch.tx_callback( machine, microtouch.tx_buffer[microtouch.tx_buffer_ptr++] ); | |
| 68 | 68 | if ( microtouch.tx_buffer_ptr == microtouch.tx_buffer_num ) |
| 69 | 69 | { |
| 70 | 70 | microtouch.tx_buffer_ptr = microtouch.tx_buffer_num = 0; |
| r3957 | r3958 | |
| 87 | 87 | int ty = input_port_read(machine, "TOUCH_Y"); |
| 88 | 88 | |
| 89 | 89 | if ( microtouch.touch_callback == NULL || |
| 90 | microtouch.touch_callback( &tx, &ty ) != 0 ) | |
| 90 | microtouch.touch_callback( machine, &tx, &ty ) != 0 ) | |
| 91 | 91 | { |
| 92 | 92 | ty = 0x4000 - ty; |
| 93 | 93 | |
| r3957 | r3958 | |
| 107 | 107 | } |
| 108 | 108 | }; |
| 109 | 109 | |
| 110 | void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data), | |
| 111 | int (*touch_cb)(int *touch_x, int *touch_y)) | |
| 110 | void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb) | |
| 112 | 111 | { |
| 113 | 112 | memset(µtouch, 0, sizeof(microtouch)); |
| 114 | 113 |
| r3957 | r3958 | |
|---|---|---|
| 90 | 90 | struct _z80ctc |
| 91 | 91 | { |
| 92 | 92 | UINT8 vector; /* interrupt vector */ |
| 93 | UINT32 clock; /* system clock */ | |
| 94 | 93 | attotime period16; /* 16/system clock */ |
| 95 | 94 | attotime period256; /* 256/system clock */ |
| 96 | 95 | void (*intr)(const device_config *device, int which); /* interrupt callback */ |
| r3957 | r3958 | |
| 465 | 464 | const z80ctc_interface *intf = device->static_config; |
| 466 | 465 | astring *tempstring = astring_alloc(); |
| 467 | 466 | z80ctc *ctc = get_safe_token(device); |
| 468 | const device_config *cpu = NULL; | |
| 469 | 467 | int ch; |
| 470 | 468 | |
| 471 | if (intf->cpu != NULL) | |
| 472 | { | |
| 473 | cpu = cputag_get_cpu(device->machine, device_inherit_tag(tempstring, device->tag, intf->cpu)); | |
| 474 | if (cpu == NULL) | |
| 475 | fatalerror("Z80CTC:Unable to find CPU %s\n", device_inherit_tag(tempstring, device->tag, intf->cpu)); | |
| 476 | } | |
| 477 | if (cpu != NULL) | |
| 478 | ctc->clock = cpu_get_clock(cpu); | |
| 479 | else | |
| 480 | ctc->clock = intf->baseclock; | |
| 481 | ctc->period16 = attotime_mul(ATTOTIME_IN_HZ(ctc->clock), 16); | |
| 482 | ctc->period256 = attotime_mul(ATTOTIME_IN_HZ(ctc->clock), 256); | |
| 469 | ctc->period16 = attotime_mul(ATTOTIME_IN_HZ(device->clock), 16); | |
| 470 | ctc->period256 = attotime_mul(ATTOTIME_IN_HZ(device->clock), 256); | |
| 483 | 471 | for (ch = 0; ch < 4; ch++) |
| 484 | 472 | { |
| 485 | 473 | ctc_channel *channel = &ctc->channel[ch]; |
| r3957 | r3958 | |
| 557 | 545 | case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)z80ctc_irq_reti; break; |
| 558 | 546 | |
| 559 | 547 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 560 | case DEVINFO_STR_NAME: info->s = "Zilog Z80 CTC"; break; | |
| 561 | case DEVINFO_STR_FAMILY: info->s = "Z80"; break; | |
| 562 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 563 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 564 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 548 | case DEVINFO_STR_NAME: strcpy(info->s, "Zilog Z80 CTC"); break; | |
| 549 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Z80"); break; | |
| 550 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 551 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 552 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 565 | 553 | } |
| 566 | 554 | } |
| 567 | 555 |
| r3957 | r3958 | |
|---|---|---|
| 274 | 274 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(pci_bus);break; |
| 275 | 275 | |
| 276 | 276 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 277 | case DEVINFO_STR_NAME: info->s = "PCI Bus"; break; | |
| 278 | case DEVINFO_STR_FAMILY: info->s = "Peripherial Bus"; break; | |
| 279 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 280 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 281 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 277 | case DEVINFO_STR_NAME: strcpy(info->s, "PCI Bus"); break; | |
| 278 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Peripherial Bus"); break; | |
| 279 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 280 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 281 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 282 | 282 | } |
| 283 | 283 | } |
| r3957 | r3958 | |
|---|---|---|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | static void gain_recalc(int which) | |
| 82 | static void gain_recalc(running_machine *machine, int which) | |
| 83 | 83 | { |
| 84 | 84 | struct MB87078 *c = chip + which; |
| 85 | 85 | int i; |
| r3957 | r3958 | |
| 90 | 90 | c->gain[i] = calc_gain_index(c->latch[i], c->latch[4+i]); |
| 91 | 91 | if (old_index != c->gain[i]) |
| 92 | 92 | { |
| 93 | (*c->intf->gain_changed_cb)(i, MB87078_gain_percent[c->gain[i]] ); | |
| 93 | (*c->intf->gain_changed_cb)(machine, i, MB87078_gain_percent[c->gain[i]] ); | |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | void MB87078_start(int which, const struct MB87078interface *intf) | |
| 99 | void MB87078_start(running_machine *machine, int which, const struct MB87078interface *intf) | |
| 100 | 100 | { |
| 101 | 101 | if (which >= MAX_MB87078) return; |
| 102 | 102 | |
| 103 | 103 | chip[which].intf = intf; |
| 104 | 104 | |
| 105 | 105 | /* reset chip */ |
| 106 | MB87078_reset_comp_w(which,0); | |
| 107 | MB87078_reset_comp_w(which,1); | |
| 106 | MB87078_reset_comp_w(machine,which,0); | |
| 107 | MB87078_reset_comp_w(machine,which,1); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| r3957 | r3958 | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | void MB87078_reset_comp_w(int which, int level) | |
| 118 | void MB87078_reset_comp_w(running_machine *machine, int which, int level) | |
| 119 | 119 | { |
| 120 | 120 | struct MB87078 *c = chip + which; |
| 121 | 121 | |
| r3957 | r3958 | |
| 133 | 133 | c->latch[6] = 0x2 | 0x4; |
| 134 | 134 | c->latch[7] = 0x3 | 0x4; |
| 135 | 135 | } |
| 136 | gain_recalc(which); | |
| 136 | gain_recalc(machine, which); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | void MB87078_data_w(int which, int data, int dsel) | |
| 140 | void MB87078_data_w(running_machine *machine, int which, int data, int dsel) | |
| 141 | 141 | { |
| 142 | 142 | struct MB87078 *c = chip + which; |
| 143 | 143 | |
| r3957 | r3958 | |
| 152 | 152 | c->channel_latch = data & 3; |
| 153 | 153 | c->latch[4+c->channel_latch] = data & 0x1f; //always zero bit 5 |
| 154 | 154 | } |
| 155 | gain_recalc(which); | |
| 155 | gain_recalc(machine, which); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | INPUT_PORTS_EXTERN(microtouch); |
| 5 | 5 | |
| 6 | void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y)); | |
| 6 | typedef void (*microtouch_tx_func)(running_machine *machine, UINT8 data); | |
| 7 | typedef int (*microtouch_touch_func)(running_machine *machine, int *touch_x, int *touch_y); | |
| 8 | ||
| 9 | void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb); | |
| 7 | 10 | void microtouch_rx(int count, UINT8* data); |
| 8 | 11 | |
| 9 | 12 | #endif //_MICROTOUCH_H |
| r3957 | r3958 | |
|---|---|---|
| 1142 | 1142 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(pit8253); break; |
| 1143 | 1143 | |
| 1144 | 1144 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1145 | case DEVINFO_STR_NAME: info->s = "Intel PIT8253"; break; | |
| 1146 | case DEVINFO_STR_FAMILY: info->s = "PIT8253"; break; | |
| 1147 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 1148 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1149 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 1145 | case DEVINFO_STR_NAME: strcpy(info->s, "Intel PIT8253"); break; | |
| 1146 | case DEVINFO_STR_FAMILY: strcpy(info->s, "PIT8253"); break; | |
| 1147 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 1148 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1149 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 1150 | 1150 | } |
| 1151 | 1151 | } |
| 1152 | 1152 | |
| r3957 | r3958 | |
| 1154 | 1154 | DEVICE_GET_INFO( pit8254 ) { |
| 1155 | 1155 | switch ( state ) { |
| 1156 | 1156 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1157 | case DEVINFO_STR_NAME: info->s | |
| 1157 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1158 | 1158 | |
| 1159 | 1159 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1160 | 1160 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(pit8254); break; |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | typedef struct _z80ctc_interface z80ctc_interface; |
| 30 | 30 | struct _z80ctc_interface |
| 31 | 31 | { |
| 32 | const char *cpu; /* CPU whose clock we use for our base */ | |
| 33 | int baseclock; /* timer clock */ | |
| 34 | 32 | int notimer; /* timer disablers */ |
| 35 | 33 | void (*intr)(const device_config *device, int which); /* callback when change interrupt status */ |
| 36 | 34 | write8_device_func zc0; /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 44 | 42 | DEVICE CONFIGURATION MACROS |
| 45 | 43 | ***************************************************************************/ |
| 46 | 44 | |
| 47 | #define MDRV_Z80CTC_ADD(_tag, _intrf) \ | |
| 48 | MDRV_DEVICE_ADD(_tag, Z80CTC) \ | |
| 45 | #define MDRV_Z80CTC_ADD(_tag, _clock, _intrf) \ | |
| 46 | MDRV_DEVICE_ADD(_tag, Z80CTC, _clock) \ | |
| 49 | 47 | MDRV_DEVICE_CONFIG(_intrf) |
| 50 | 48 | |
| 51 | 49 | #define MDRV_Z80CTC_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | 42 | #define MDRV_PCI_BUS_ADD(_tag, _busnum) \ |
| 43 | MDRV_DEVICE_ADD(_tag, PCI_BUS) \ | |
| 43 | MDRV_DEVICE_ADD(_tag, PCI_BUS, 0) \ | |
| 44 | 44 | MDRV_DEVICE_CONFIG_DATA32(pci_bus_config, busnum, _busnum) |
| 45 | 45 | |
| 46 | 46 | #define MDRV_PCI_BUS_DEVICE(_devnum, _devtype, _devtag, _configread, _configwrite) \ |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | /* The interface structure */ |
| 76 | 76 | struct MB87078interface { |
| 77 | void (*gain_changed_cb)(int channel, int percent /*, float decibels*/); | |
| 77 | void (*gain_changed_cb)(running_machine *machine, int channel, int percent /*, float decibels*/); | |
| 78 | 78 | }; |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | void MB87078_stop(void); |
| 82 | void MB87078_start(int which, const struct MB87078interface *intf); | |
| 82 | void MB87078_start(running_machine *machine, int which, const struct MB87078interface *intf); | |
| 83 | 83 | |
| 84 | void MB87078_data_w(int which, int data, int dsel); | |
| 85 | void MB87078_reset_comp_w(int which, int level); | |
| 84 | void MB87078_data_w(running_machine *machine, int which, int data, int dsel); | |
| 85 | void MB87078_reset_comp_w(running_machine *machine, int which, int level); | |
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | /* MB87078_gain_decibel_r will return 'channel' gain on chip 'which'. |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | ***************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #define MDRV_PIT8253_ADD(_tag, _intrf) \ |
| 37 | MDRV_DEVICE_ADD(_tag, PIT8253) \ | |
| 37 | MDRV_DEVICE_ADD(_tag, PIT8253, 0) \ | |
| 38 | 38 | MDRV_DEVICE_CONFIG(_intrf) |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | #define MDRV_PIT8254_ADD(_tag, _intrf) \ |
| 42 | MDRV_DEVICE_ADD(_tag, PIT8254) \ | |
| 42 | MDRV_DEVICE_ADD(_tag, PIT8254, 0) \ | |
| 43 | 43 | MDRV_DEVICE_CONFIG(_intrf) |
| 44 | 44 | |
| 45 | 45 |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | #include "ldcore.h" |
| 20 | 20 | #include "machine/8255ppi.h" |
| 21 | 21 | #include "machine/z80ctc.h" |
| 22 | #include "cpu/z80/z80.h" | |
| 22 | 23 | #include "cpu/z80/z80daisy.h" |
| 23 | 24 | |
| 24 | 25 | |
| r3957 | r3958 | |
| 113 | 114 | |
| 114 | 115 | |
| 115 | 116 | /*************************************************************************** |
| 116 | INLINE FUNCTIONS | |
| 117 | ***************************************************************************/ | |
| 118 | ||
| 119 | /*------------------------------------------------- | |
| 120 | find_ldv1000 - find our device; assumes there | |
| 121 | is only one | |
| 122 | -------------------------------------------------*/ | |
| 123 | ||
| 124 | INLINE laserdisc_state *find_ldv1000(running_machine *machine) | |
| 125 | { | |
| 126 | return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC)); | |
| 127 | } | |
| 128 | ||
| 129 | ||
| 130 | ||
| 131 | /*************************************************************************** | |
| 132 | 117 | LD-V1000 ROM AND MACHINE INTERFACES |
| 133 | 118 | ***************************************************************************/ |
| 134 | 119 | |
| r3957 | r3958 | |
| 165 | 150 | |
| 166 | 151 | static const z80ctc_interface ctcintf = |
| 167 | 152 | { |
| 168 | "ldv1000", | |
| 169 | 153 | 0, |
| 170 | 0, | |
| 171 | 154 | ctc_interrupt |
| 172 | 155 | }; |
| 173 | 156 | |
| r3957 | r3958 | |
| 185 | 168 | MDRV_CPU_PROGRAM_MAP(ldv1000_map,0) |
| 186 | 169 | MDRV_CPU_IO_MAP(ldv1000_portmap,0) |
| 187 | 170 | |
| 188 | MDRV_Z80CTC_ADD("ldvctc", ctcintf) | |
| 171 | MDRV_Z80CTC_ADD("ldvctc", XTAL_5MHz/2 /* same as "ldv1000" */, ctcintf) | |
| 189 | 172 | MDRV_PPI8255_ADD("ldvppi0", ppi0intf) |
| 190 | 173 | MDRV_PPI8255_ADD("ldvppi1", ppi1intf) |
| 191 | 174 | MDRV_TIMER_ADD("multitimer", multijump_timer) |
| r3957 | r3958 | |
| 247 | 230 | memset(player, 0, sizeof(*player)); |
| 248 | 231 | |
| 249 | 232 | /* find our devices */ |
| 250 | player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device->tag, "ldv1000")); | |
| 251 | player->ctc = devtag_get_device(ld->device->machine, Z80CTC, device_build_tag(tempstring, ld->device->tag, "ldvctc")); | |
| 252 | player->multitimer = devtag_get_device(ld->device->machine, TIMER, device_build_tag(tempstring, ld->device->tag, "multitimer")); | |
| 233 | player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "ldv1000")); | |
| 234 | player->ctc = devtag_get_device(ld->device->machine, Z80CTC, device_build_tag(tempstring, ld->device, "ldvctc")); | |
| 235 | player->multitimer = devtag_get_device(ld->device->machine, TIMER, device_build_tag(tempstring, ld->device, "multitimer")); | |
| 253 | 236 | timer_device_set_ptr(player->multitimer, ld); |
| 254 | 237 | astring_free(tempstring); |
| 255 | 238 | } |
| r3957 | r3958 | |
| 436 | 419 | |
| 437 | 420 | static void ctc_interrupt(const device_config *device, int state) |
| 438 | 421 | { |
| 439 | laserdisc_state *ld = | |
| 422 | laserdisc_state *ld = | |
| 440 | 423 | cpu_set_input_line(ld->player->cpu, 0, state ? ASSERT_LINE : CLEAR_LINE); |
| 441 | 424 | } |
| 442 | 425 | |
| r3957 | r3958 | |
| 454 | 437 | Display is 6-bit |
| 455 | 438 | Decoder is 4-bit |
| 456 | 439 | */ |
| 457 | laserdisc_state *ld = | |
| 440 | laserdisc_state *ld = | |
| 458 | 441 | ldplayer_data *player = ld->player; |
| 459 | 442 | |
| 460 | 443 | /* writes to offset 0 select the target for reads/writes of actual data */ |
| r3957 | r3958 | |
| 481 | 464 | |
| 482 | 465 | static READ8_HANDLER( decoder_display_port_r ) |
| 483 | 466 | { |
| 484 | laserdisc_state *ld = | |
| 467 | laserdisc_state *ld = | |
| 485 | 468 | ldplayer_data *player = ld->player; |
| 486 | 469 | UINT8 result = 0; |
| 487 | 470 | |
| r3957 | r3958 | |
| 506 | 489 | |
| 507 | 490 | static READ8_HANDLER( controller_r ) |
| 508 | 491 | { |
| 509 | laserdisc_state *ld = | |
| 492 | laserdisc_state *ld = | |
| 510 | 493 | |
| 511 | 494 | /* note that this is a cheesy implementation; the real thing relies on exquisite timing */ |
| 512 | 495 | UINT8 result = ld->player->command ^ 0xff; |
| r3957 | r3958 | |
| 521 | 504 | |
| 522 | 505 | static WRITE8_HANDLER( controller_w ) |
| 523 | 506 | { |
| 524 | laserdisc_state *ld = | |
| 507 | laserdisc_state *ld = | |
| 525 | 508 | if (LOG_STATUS_CHANGES && data != ld->player->status) |
| 526 | 509 | printf("%04X:CONTROLLER.W=%02X\n", cpu_get_pc(space->cpu), data); |
| 527 | 510 | ld->player->status = data; |
| r3957 | r3958 | |
| 535 | 518 | |
| 536 | 519 | static WRITE8_DEVICE_HANDLER( ppi0_porta_w ) |
| 537 | 520 | { |
| 538 | laserdisc_state *ld = | |
| 521 | laserdisc_state *ld = | |
| 539 | 522 | ld->player->counter_start = data; |
| 540 | 523 | if (LOG_PORT_IO) |
| 541 | 524 | printf("%s:PORTA.0=%02X\n", cpuexec_describe_context(device->machine), data); |
| r3957 | r3958 | |
| 549 | 532 | |
| 550 | 533 | static READ8_DEVICE_HANDLER( ppi0_portb_r ) |
| 551 | 534 | { |
| 552 | laserdisc_state *ld = | |
| 535 | laserdisc_state *ld = | |
| 553 | 536 | return ld->player->counter; |
| 554 | 537 | } |
| 555 | 538 | |
| r3957 | r3958 | |
| 567 | 550 | $40 = TRKG LOOP (N24-1) |
| 568 | 551 | $80 = DUMP (N20-1) -- code reads the state and waits for it to change |
| 569 | 552 | */ |
| 570 | laserdisc_state *ld = | |
| 553 | laserdisc_state *ld = | |
| 571 | 554 | ldplayer_data *player = ld->player; |
| 572 | 555 | UINT8 result = 0x00; |
| 573 | 556 | |
| r3957 | r3958 | |
| 593 | 576 | $04 = SCAN MODE |
| 594 | 577 | $08 = n/c |
| 595 | 578 | */ |
| 596 | laserdisc_state *ld = | |
| 579 | laserdisc_state *ld = | |
| 597 | 580 | ldplayer_data *player = ld->player; |
| 598 | 581 | UINT8 prev = player->portc0; |
| 599 | 582 | |
| r3957 | r3958 | |
| 635 | 618 | $40 = /INT LOCK |
| 636 | 619 | $80 = 8 INCH CHK |
| 637 | 620 | */ |
| 638 | laserdisc_state *ld = | |
| 621 | laserdisc_state *ld = | |
| 639 | 622 | ldplayer_data *player = ld->player; |
| 640 | 623 | slider_position sliderpos = ldcore_get_slider_position(ld); |
| 641 | 624 | UINT8 focus_on = !(player->portb1 & 0x01); |
| r3957 | r3958 | |
| 688 | 671 | $40 = /LASER ON |
| 689 | 672 | $80 = /SYNC ST0 |
| 690 | 673 | */ |
| 691 | laserdisc_state *ld = | |
| 674 | laserdisc_state *ld = | |
| 692 | 675 | ldplayer_data *player = ld->player; |
| 693 | 676 | UINT8 prev = player->portb1; |
| 694 | 677 | int direction; |
| r3957 | r3958 | |
| 745 | 728 | $40 = SIZE 8/12 |
| 746 | 729 | $80 = /LED CAV |
| 747 | 730 | */ |
| 748 | laserdisc_state *ld = | |
| 731 | laserdisc_state *ld = | |
| 749 | 732 | ldplayer_data *player = ld->player; |
| 750 | 733 | UINT8 prev = player->portc1; |
| 751 | 734 |
| r3957 | r3958 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | static struct |
| 34 | 34 | { |
| 35 | running_machine *machine; | |
| 36 | ||
| 35 | 37 | /* 64 8-bit registers (10 clock registers, 4 control/status registers, and |
| 36 | 38 | 50 bytes of user RAM) */ |
| 37 | 39 | UINT8 regs[64]; |
| r3957 | r3958 | |
| 49 | 51 | int SQW_internal_state; |
| 50 | 52 | |
| 51 | 53 | /* callback called when interrupt pin state changes (may be NULL) */ |
| 52 | void (*interrupt_callback)(int state); | |
| 54 | void (*interrupt_callback)(running_machine *machine, int state); | |
| 53 | 55 | } rtc; |
| 54 | 56 | |
| 55 | 57 | enum |
| r3957 | r3958 | |
| 310 | 312 | interrupt_callback: callback called when interrupt pin state changes (may |
| 311 | 313 | be NULL) |
| 312 | 314 | */ |
| 313 | void rtc65271_init(running_machine *machine, UINT8 *xram, void (*interrupt_callback)(int state)) | |
| 315 | void rtc65271_init(running_machine *machine, UINT8 *xram, void (*interrupt_callback)(running_machine *machine, int state)) | |
| 314 | 316 | { |
| 315 | 317 | memset(&rtc, 0, sizeof(rtc)); |
| 316 | 318 | |
| 319 | rtc.machine = machine; | |
| 317 | 320 | rtc.xram = xram; |
| 318 | 321 | |
| 319 | 322 | rtc.update_timer = timer_alloc(machine, rtc_begin_update_callback, NULL); |
| r3957 | r3958 | |
| 456 | 459 | { |
| 457 | 460 | rtc.regs[reg_C] |= reg_C_IRQF; |
| 458 | 461 | if (rtc.interrupt_callback) |
| 459 | rtc.interrupt_callback(1); | |
| 462 | rtc.interrupt_callback(rtc.machine, 1); | |
| 460 | 463 | } |
| 461 | 464 | else |
| 462 | 465 | { |
| 463 | 466 | rtc.regs[reg_C] &= ~reg_C_IRQF; |
| 464 | 467 | if (rtc.interrupt_callback) |
| 465 | rtc.interrupt_callback(0); | |
| 468 | rtc.interrupt_callback(rtc.machine, 0); | |
| 466 | 469 | } |
| 467 | 470 | } |
| 468 | 471 |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | DEVINFO_FCT_START, /* R/O: device_start_func */ |
| 82 | 82 | DEVINFO_FCT_STOP, /* R/O: device_stop_func */ |
| 83 | 83 | DEVINFO_FCT_RESET, /* R/O: device_reset_func */ |
| 84 | DEVINFO_FCT_EXECUTE, /* R/O: device_execute_func */ | |
| 84 | 85 | DEVINFO_FCT_VALIDITY_CHECK, /* R/O: device_validity_check_func */ |
| 85 | 86 | DEVINFO_FCT_NVRAM, /* R/O: device_nvram_func */ |
| 86 | 87 | |
| r3957 | r3958 | |
| 128 | 129 | #define DEVICE_RESET(name) void DEVICE_RESET_NAME(name)(const device_config *device) |
| 129 | 130 | #define DEVICE_RESET_CALL(name) DEVICE_RESET_NAME(name)(device) |
| 130 | 131 | |
| 132 | #define DEVICE_EXECUTE_NAME(name) device_execute_##name | |
| 133 | #define DEVICE_EXECUTE(name) INT32 DEVICE_EXECUTE_NAME(name)(const device_config *device, INT32 clocks) | |
| 134 | #define DEVICE_EXECUTE_CALL(name) DEVICE_EXECUTE_NAME(name)(device, clocks) | |
| 135 | ||
| 131 | 136 | #define DEVICE_NVRAM_NAME(name) device_NVRAM_##name |
| 132 | 137 | #define DEVICE_NVRAM(name) void DEVICE_NVRAM_NAME(name)(const device_config *device, mame_file *file, int read_or_write) |
| 133 | 138 | #define DEVICE_NVRAM_CALL(name) DEVICE_NVRAM_NAME(name)(device, file, read_or_write) |
| r3957 | r3958 | |
| 137 | 142 | #define DEVICE_VALIDITY_CHECK_CALL(name) DEVICE_VALIDITY_CHECK(name)(driver, device) |
| 138 | 143 | |
| 139 | 144 | |
| 145 | /* shorthand for accessing devices by machine/type/tag */ | |
| 146 | #define devtag_get_device(mach,type,tag) device_list_find_by_tag((mach)->config->devicelist, type, tag) | |
| 140 | 147 | |
| 148 | #define devtag_reset(mach,type,tag) device_reset(devtag_get_device(mach, type, tag)) | |
| 149 | ||
| 150 | #define devtag_get_info_int(mach,type,tag,state) device_get_info_int(devtag_get_device(mach, type, tag), state) | |
| 151 | #define devtag_get_info_ptr(mach,type,tag,state) device_get_info_ptr(devtag_get_device(mach, type, tag), state) | |
| 152 | #define devtag_get_info_fct(mach,type,tag,state) device_get_info_fct(devtag_get_device(mach, type, tag), state) | |
| 153 | #define devtag_get_info_string(mach,type,tag,state) device_get_info_string(devtag_get_device(mach, type, tag), state) | |
| 154 | ||
| 155 | #define devtag_set_info_int(mach,type,tag,state,data) device_set_info_int(devtag_get_device(mach, type, tag), state, data) | |
| 156 | #define devtag_set_info_ptr(mach,type,tag,state,data) device_set_info_ptr(devtag_get_device(mach, type, tag), state, data) | |
| 157 | #define devtag_set_info_fct(mach,type,tag,state,data) device_set_info_fct(devtag_get_device(mach, type, tag), state, data) | |
| 158 | ||
| 159 | ||
| 160 | /* shorthand for getting standard data about device types */ | |
| 161 | #define devtype_get_name(type) devtype_get_info_string(type, DEVINFO_STR_NAME) | |
| 162 | #define devtype_get_family(type) devtype_get_info_string(type, DEVINFO_STR_FAMILY) | |
| 163 | #define devtype_get_version(type) devtype_get_info_string(type, DEVINFO_STR_VERSION) | |
| 164 | #define devtype_get_source_file(type) devtype_get_info_string(type, DEVINFO_STR_SOURCE_FILE) | |
| 165 | #define devtype_get_credits(type) devtype_get_info_string(type, DEVINFO_STR_CREDITS) | |
| 166 | ||
| 167 | ||
| 168 | /* shorthand for getting standard data about devices */ | |
| 169 | #define device_get_name(dev) device_get_info_string(dev, DEVINFO_STR_NAME) | |
| 170 | #define device_get_family(dev) device_get_info_string(dev, DEVINFO_STR_FAMILY) | |
| 171 | #define device_get_version(dev) device_get_info_string(dev, DEVINFO_STR_VERSION) | |
| 172 | #define device_get_source_file(dev) device_get_info_string(dev, DEVINFO_STR_SOURCE_FILE) | |
| 173 | #define device_get_credits(dev) device_get_info_string(dev, DEVINFO_STR_CREDITS) | |
| 174 | ||
| 175 | ||
| 176 | /* shorthand for getting standard data about devices by machine/type/tag */ | |
| 177 | #define devtag_get_name(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_NAME) | |
| 178 | #define devtag_get_family(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_FAMILY) | |
| 179 | #define devtag_get_version(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_VERSION) | |
| 180 | #define devtag_get_source_file(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_SOURCE_FILE) | |
| 181 | #define devtag_get_credits(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_CREDITS) | |
| 182 | ||
| 183 | ||
| 184 | ||
| 141 | 185 | /*************************************************************************** |
| 142 | 186 | TYPE DEFINITIONS |
| 143 | 187 | ***************************************************************************/ |
| r3957 | r3958 | |
| 152 | 196 | typedef void (*device_set_info_func)(const device_config *device, UINT32 state, const deviceinfo *info); |
| 153 | 197 | typedef device_start_err (*device_start_func)(const device_config *device); |
| 154 | 198 | typedef void (*device_stop_func)(const device_config *device); |
| 199 | typedef INT32 (*device_execute_func)(const device_config *device, INT32 clocks); | |
| 155 | 200 | typedef void (*device_reset_func)(const device_config *device); |
| 156 | 201 | typedef void (*device_nvram_func)(const device_config *device, mame_file *file, int read_or_write); |
| 157 | 202 | typedef int (*device_validity_check_func)(const game_driver *driver, const device_config *device); |
| r3957 | r3958 | |
| 167 | 212 | INT64 i; /* generic integers */ |
| 168 | 213 | void * p; /* generic pointers */ |
| 169 | 214 | genf * f; /* generic function pointers */ |
| 170 | c | |
| 215 | c | |
| 171 | 216 | |
| 172 | 217 | device_set_info_func set_info; /* DEVINFO_FCT_SET_INFO */ |
| 173 | 218 | device_start_func start; /* DEVINFO_FCT_START */ |
| 174 | 219 | device_stop_func stop; /* DEVINFO_FCT_STOP */ |
| 175 | 220 | device_reset_func reset; /* DEVINFO_FCT_RESET */ |
| 221 | device_execute_func execute; /* DEVINFO_FCT_EXECUTE */ | |
| 176 | 222 | device_validity_check_func validity_check; /* DEVINFO_FCT_VALIDITY_CHECK */ |
| 177 | 223 | device_nvram_func nvram; /* DEVINFO_FCT_NVRAM */ |
| 178 | 224 | const rom_entry * romregion; /* DEVINFO_PTR_ROM_REGION */ |
| r3957 | r3958 | |
| 183 | 229 | /* the configuration for a general device */ |
| 184 | 230 | struct _device_config |
| 185 | 231 | { |
| 186 | device_config * next; /* next device */ | |
| 232 | /* device relationships (always valid) */ | |
| 233 | device_config * next; /* next device (of any type/class) */ | |
| 234 | device_config * owner; /* device that owns us, or NULL if nobody */ | |
| 235 | device_config * typenext; /* next device of the same type */ | |
| 236 | device_config * classnext; /* next device of the same class */ | |
| 237 | ||
| 238 | /* device properties (always valid) */ | |
| 187 | 239 | device_type type; /* device type */ |
| 188 | 240 | device_class class; /* device class */ |
| 189 | 241 | device_set_info_func set_info; /* quick pointer to set_info callback */ |
| 190 | device_start_func start; /* quick pointer to start callback */ | |
| 191 | device_stop_func stop; /* quick pointer to stop callback */ | |
| 192 | device_reset_func reset; /* quick pointer to reset callback */ | |
| 193 | device_nvram_func nvram; /* quick pointer to nvram callback */ | |
| 242 | ||
| 243 | /* device configuration (always valid) */ | |
| 244 | UINT32 clock; /* device clock */ | |
| 194 | 245 | const void * static_config; /* static device configuration */ |
| 195 | 246 | void * inline_config; /* inline device configuration */ |
| 196 | 247 | |
| 248 | /* these fields are only valid once the device is attached to a machine */ | |
| 249 | running_machine * machine; /* machine if device is live */ | |
| 250 | ||
| 197 | 251 | /* these fields are only valid if the device is live */ |
| 198 | 252 | UINT8 started; /* TRUE if the start function has succeeded */ |
| 199 | 253 | void * token; /* token if device is live */ |
| 200 | void * classtoken; /* class token if device is live */ | |
| 201 | running_machine * machine; /* machine if device is live */ | |
| 254 | UINT32 tokenbytes; /* size of the token data allocated */ | |
| 202 | 255 | UINT8 * region; /* pointer to region with the device's tag, or NULL */ |
| 203 | 256 | UINT32 regionbytes; /* size of the region, in bytes */ |
| 257 | device_execute_func execute; /* quick pointer to execute callback */ | |
| 204 | 258 | |
| 259 | /* tag (always valid; at end because it is variable-length) */ | |
| 205 | 260 | char tag[1]; /* tag for this instance */ |
| 206 | 261 | }; |
| 207 | 262 | |
| r3957 | r3958 | |
| 215 | 270 | /* ----- device configuration ----- */ |
| 216 | 271 | |
| 217 | 272 | /* add a new device to the end of a device list */ |
| 218 | device_config *device_list_add(device_config **listheadptr, device_type type, const char *tag); | |
| 273 | device_config *device_list_add(device_config **listheadptr, const device_config *owner, device_type type, const char *tag, UINT32 clock); | |
| 219 | 274 | |
| 220 | 275 | /* remove a device from a device list */ |
| 221 | 276 | void device_list_remove(device_config **listheadptr, device_type type, const char *tag); |
| 222 | 277 | |
| 223 | 278 | /* build a tag that combines the device's name and the given tag */ |
| 224 | const char *device_build_tag(astring *dest, const c | |
| 279 | const char *device_build_tag(astring *dest, const device_config *device | |
| 225 | 280 | |
| 226 | 281 | /* build a tag with the same device prefix as the source tag*/ |
| 227 | 282 | const char *device_inherit_tag(astring *dest, const char *sourcetag, const char *tag); |
| r3957 | r3958 | |
| 274 | 329 | |
| 275 | 330 | /* ----- live device management ----- */ |
| 276 | 331 | |
| 332 | /* "attach" a running_machine to its list of devices */ | |
| 333 | void device_list_attach_machine(running_machine *machine); | |
| 334 | ||
| 277 | 335 | /* start the configured list of devices for a machine */ |
| 278 | 336 | void device_list_start(running_machine *machine); |
| 279 | 337 | |
| 280 | 338 | /* reset a device based on an allocated device_config */ |
| 281 | 339 | void device_reset(const device_config *device); |
| 282 | void devtag_reset(running_machine *machine, device_type type, const char *tag); | |
| 283 | 340 | |
| 341 | /* change the clock on a device */ | |
| 342 | void device_set_clock(const device_config *device, UINT32 clock); | |
| 284 | 343 | |
| 285 | 344 | |
| 345 | ||
| 286 | 346 | /* ----- device information getters ----- */ |
| 287 | 347 | |
| 288 | /* return the device associated with a tag */ | |
| 289 | const device_config *devtag_get_device(running_machine *machine, device_type type, const char *tag); | |
| 290 | ||
| 291 | /* return the token associated with an allocated device */ | |
| 292 | void *devtag_get_token(running_machine *machine, device_type type, const char *tag); | |
| 293 | ||
| 294 | /* return a pointer to the static configuration for a device based on type and tag */ | |
| 295 | const void *devtag_get_static_config(running_machine *machine, device_type type, const char *tag); | |
| 296 | ||
| 297 | /* return a pointer to the inline configuration for a device based on type and tag */ | |
| 298 | const void *devtag_get_inline_config(running_machine *machine, device_type type, const char *tag); | |
| 299 | ||
| 300 | 348 | /* return an integer state value from an allocated device */ |
| 301 | 349 | INT64 device_get_info_int(const device_config *device, UINT32 state); |
| 302 | INT64 devtag_get_info_int(running_machine *machine, device_type type, const char *tag, UINT32 state); | |
| 303 | 350 | |
| 304 | 351 | /* return a pointer state value from an allocated device */ |
| 305 | 352 | void *device_get_info_ptr(const device_config *device, UINT32 state); |
| 306 | void *devtag_get_info_ptr(running_machine *machine, device_type type, const char *tag, UINT32 state); | |
| 307 | 353 | |
| 308 | 354 | /* return a function pointer state value from an allocated device */ |
| 309 | 355 | genf *device_get_info_fct(const device_config *device, UINT32 state); |
| 310 | genf *devtag_get_info_fct(running_machine *machine, device_type type, const char *tag, UINT32 state); | |
| 311 | 356 | |
| 312 | 357 | /* return a string value from an allocated device */ |
| 313 | 358 | const char *device_get_info_string(const device_config *device, UINT32 state); |
| 314 | const char *devtag_get_info_string(running_machine *machine, device_type type, const char *tag, UINT32 state); | |
| 315 | 359 | |
| 316 | 360 | |
| 317 | 361 | |
| r3957 | r3958 | |
| 320 | 364 | /* return an integer value from a device type (does not need to be allocated) */ |
| 321 | 365 | INT64 devtype_get_info_int(device_type type, UINT32 state); |
| 322 | 366 | |
| 367 | /* return a function pointer from a device type (does not need to be allocated) */ | |
| 368 | genf *devtype_get_info_fct(device_type type, UINT32 state); | |
| 369 | ||
| 323 | 370 | /* return a string value from a device type (does not need to be allocated) */ |
| 324 | 371 | const char *devtype_get_info_string(device_type type, UINT32 state); |
| 325 | 372 | |
| r3957 | r3958 | |
| 329 | 376 | |
| 330 | 377 | /* set an integer state value for an allocated device */ |
| 331 | 378 | void device_set_info_int(const device_config *device, UINT32 state, INT64 data); |
| 332 | void devtag_set_info_int(running_machine *machine, device_type type, const char *tag, UINT32 state, INT64 data); | |
| 333 | 379 | |
| 334 | 380 | /* set a pointer state value for an allocated device */ |
| 335 | 381 | void device_set_info_ptr(const device_config *device, UINT32 state, void *data); |
| 336 | void devtag_set_info_ptr(running_machine *machine, device_type type, const char *tag, UINT32 state, void *data); | |
| 337 | 382 | |
| 338 | 383 | /* set a function pointer state value for an allocated device */ |
| 339 | 384 | void device_set_info_fct(const device_config *device, UINT32 state, genf *data); |
| 340 | void devtag_set_info_fct(running_machine *machine, device_type type, const char *tag, UINT32 state, genf *data); | |
| 341 | 385 | |
| 342 | 386 | |
| 343 | ||
| 344 | /*************************************************************************** | |
| 345 | INLINE FUNCTIONS | |
| 346 | ***************************************************************************/ | |
| 347 | ||
| 348 | /* return common strings based on device instances */ | |
| 349 | INLINE const char *device_get_name(const device_config *device) { return device_get_info_string(device, DEVINFO_STR_NAME); } | |
| 350 | INLINE const char *device_get_family(const device_config *device) { return device_get_info_string(device, DEVINFO_STR_FAMILY); } | |
| 351 | INLINE const char *device_get_version(const device_config *device) { return device_get_info_string(device, DEVINFO_STR_VERSION); } | |
| 352 | INLINE const char *device_get_source_file(const device_config *device) { return device_get_info_string(device, DEVINFO_STR_SOURCE_FILE); } | |
| 353 | INLINE const char *device_get_credits(const device_config *device) { return device_get_info_string(device, DEVINFO_STR_CREDITS); } | |
| 354 | ||
| 355 | /* return common strings based on device types */ | |
| 356 | INLINE const char *devtype_get_name(device_type devtype) { return devtype_get_info_string(devtype, DEVINFO_STR_NAME); } | |
| 357 | INLINE const char *devtype_get_family(device_type devtype) { return devtype_get_info_string(devtype, DEVINFO_STR_FAMILY); } | |
| 358 | INLINE const char *devtype_get_version(device_type devtype) { return devtype_get_info_string(devtype, DEVINFO_STR_VERSION); } | |
| 359 | INLINE const char *devtype_get_source_file(device_type devtype) { return devtype_get_info_string(devtype, DEVINFO_STR_SOURCE_FILE); } | |
| 360 | INLINE const char *devtype_get_credits(device_type devtype) { return devtype_get_info_string(devtype, DEVINFO_STR_CREDITS); } | |
| 361 | ||
| 362 | ||
| 363 | 387 | #endif /* __DEVINTRF_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | |
| 15 | 14 | /* mingw-gcc defines this */ |
| 16 | 15 | #undef i386 |
| r3957 | r3958 | |
| 36 | 35 | |
| 37 | 36 | |
| 38 | 37 | /*************************************************************************** |
| 39 | PROTOTYPES FOR ALL CPU ENTRY POINTS | |
| 40 | ***************************************************************************/ | |
| 41 | ||
| 42 | CPU_GET_INFO( dummy ); | |
| 43 | CPU_GET_INFO( z80 ); | |
| 44 | CPU_GET_INFO( z180 ); | |
| 45 | CPU_GET_INFO( i8080 ); | |
| 46 | CPU_GET_INFO( i8085 ); | |
| 47 | CPU_GET_INFO( m6502 ); | |
| 48 | CPU_GET_INFO( m65c02 ); | |
| 49 | CPU_GET_INFO( m65sc02 ); | |
| 50 | CPU_GET_INFO( m65ce02 ); | |
| 51 | CPU_GET_INFO( m6509 ); | |
| 52 | CPU_GET_INFO( m6510 ); | |
| 53 | CPU_GET_INFO( m6510t ); | |
| 54 | CPU_GET_INFO( m7501 ); | |
| 55 | CPU_GET_INFO( m8502 ); | |
| 56 | CPU_GET_INFO( n2a03 ); | |
| 57 | CPU_GET_INFO( deco16 ); | |
| 58 | CPU_GET_INFO( m4510 ); | |
| 59 | CPU_GET_INFO( h6280 ); | |
| 60 | CPU_GET_INFO( i8086 ); | |
| 61 | CPU_GET_INFO( i8088 ); | |
| 62 | CPU_GET_INFO( i80186 ); | |
| 63 | CPU_GET_INFO( i80188 ); | |
| 64 | CPU_GET_INFO( i80286 ); | |
| 65 | CPU_GET_INFO( v20 ); | |
| 66 | CPU_GET_INFO( v25 ); | |
| 67 | CPU_GET_INFO( v30 ); | |
| 68 | CPU_GET_INFO( v33 ); | |
| 69 | CPU_GET_INFO( v35 ); | |
| 70 | CPU_GET_INFO( v60 ); | |
| 71 | CPU_GET_INFO( v70 ); | |
| 72 | CPU_GET_INFO( i8035 ); | |
| 73 | CPU_GET_INFO( i8048 ); | |
| 74 | CPU_GET_INFO( i8648 ); | |
| 75 | CPU_GET_INFO( i8748 ); | |
| 76 | CPU_GET_INFO( mb8884 ); | |
| 77 | CPU_GET_INFO( i8039 ); | |
| 78 | CPU_GET_INFO( i8049 ); | |
| 79 | CPU_GET_INFO( i8749 ); | |
| 80 | CPU_GET_INFO( n7751 ); | |
| 81 | CPU_GET_INFO( m58715 ); | |
| 82 | CPU_GET_INFO( i8041 ); | |
| 83 | CPU_GET_INFO( i8741 ); | |
| 84 | CPU_GET_INFO( i8042 ); | |
| 85 | CPU_GET_INFO( i8242 ); | |
| 86 | CPU_GET_INFO( i8742 ); | |
| 87 | CPU_GET_INFO( i8031 ); | |
| 88 | CPU_GET_INFO( i8032 ); | |
| 89 | CPU_GET_INFO( i8051 ); | |
| 90 | CPU_GET_INFO( i8052 ); | |
| 91 | CPU_GET_INFO( i8751 ); | |
| 92 | CPU_GET_INFO( i8752 ); | |
| 93 | CPU_GET_INFO( i80c31 ); | |
| 94 | CPU_GET_INFO( i80c32 ); | |
| 95 | CPU_GET_INFO( i80c51 ); | |
| 96 | CPU_GET_INFO( i80c52 ); | |
| 97 | CPU_GET_INFO( i87c51 ); | |
| 98 | CPU_GET_INFO( i87c52 ); | |
| 99 | CPU_GET_INFO( at89c4051 ); | |
| 100 | CPU_GET_INFO( ds5002fp ); | |
| 101 | CPU_GET_INFO( m6800 ); | |
| 102 | CPU_GET_INFO( m6801 ); | |
| 103 | CPU_GET_INFO( m6802 ); | |
| 104 | CPU_GET_INFO( m6803 ); | |
| 105 | CPU_GET_INFO( m6808 ); | |
| 106 | CPU_GET_INFO( hd63701 ); | |
| 107 | CPU_GET_INFO( nsc8105 ); | |
| 108 | CPU_GET_INFO( m6805 ); | |
| 109 | CPU_GET_INFO( m68705 ); | |
| 110 | CPU_GET_INFO( hd63705 ); | |
| 111 | CPU_GET_INFO( hd6309 ); | |
| 112 | CPU_GET_INFO( m6809 ); | |
| 113 | CPU_GET_INFO( m6809e ); | |
| 114 | CPU_GET_INFO( konami ); | |
| 115 | CPU_GET_INFO( m68000 ); | |
| 116 | CPU_GET_INFO( m68008 ); | |
| 117 | CPU_GET_INFO( m68010 ); | |
| 118 | CPU_GET_INFO( m68ec020 ); | |
| 119 | CPU_GET_INFO( m68020 ); | |
| 120 | CPU_GET_INFO( m68040 ); | |
| 121 | CPU_GET_INFO( t11 ); | |
| 122 | CPU_GET_INFO( s2650 ); | |
| 123 | CPU_GET_INFO( tms34010 ); | |
| 124 | CPU_GET_INFO( tms34020 ); | |
| 125 | CPU_GET_INFO( ti990_10 ); | |
| 126 | CPU_GET_INFO( tms9900 ); | |
| 127 | CPU_GET_INFO( tms9980a ); | |
| 128 | CPU_GET_INFO( tms9995 ); | |
| 129 | CPU_GET_INFO( z8000 ); | |
| 130 | CPU_GET_INFO( tms32010 ); | |
| 131 | CPU_GET_INFO( tms32025 ); | |
| 132 | CPU_GET_INFO( tms32026 ); | |
| 133 | CPU_GET_INFO( tms32031 ); | |
| 134 | CPU_GET_INFO( tms32032 ); | |
| 135 | CPU_GET_INFO( tms32051 ); | |
| 136 | CPU_GET_INFO( ccpu ); | |
| 137 | CPU_GET_INFO( adsp2100 ); | |
| 138 | CPU_GET_INFO( adsp2101 ); | |
| 139 | CPU_GET_INFO( adsp2104 ); | |
| 140 | CPU_GET_INFO( adsp2105 ); | |
| 141 | CPU_GET_INFO( adsp2115 ); | |
| 142 | CPU_GET_INFO( adsp2181 ); | |
| 143 | CPU_GET_INFO( psxcpu ); | |
| 144 | CPU_GET_INFO( asap ); | |
| 145 | CPU_GET_INFO( upd7810 ); | |
| 146 | CPU_GET_INFO( upd7807 ); | |
| 147 | CPU_GET_INFO( upd7801 ); | |
| 148 | CPU_GET_INFO( upd78c05 ); | |
| 149 | CPU_GET_INFO( upd78c06 ); | |
| 150 | CPU_GET_INFO( jaguargpu ); | |
| 151 | CPU_GET_INFO( jaguardsp ); | |
| 152 | CPU_GET_INFO( cquestsnd ); | |
| 153 | CPU_GET_INFO( cquestrot ); | |
| 154 | CPU_GET_INFO( cquestlin ); | |
| 155 | CPU_GET_INFO( r3000be ); | |
| 156 | CPU_GET_INFO( r3000le ); | |
| 157 | CPU_GET_INFO( r3041be ); | |
| 158 | CPU_GET_INFO( r3041le ); | |
| 159 | CPU_GET_INFO( r4600be ); | |
| 160 | CPU_GET_INFO( r4600le ); | |
| 161 | CPU_GET_INFO( r4650be ); | |
| 162 | CPU_GET_INFO( r4650le ); | |
| 163 | CPU_GET_INFO( r4700be ); | |
| 164 | CPU_GET_INFO( r4700le ); | |
| 165 | CPU_GET_INFO( r5000be ); | |
| 166 | CPU_GET_INFO( r5000le ); | |
| 167 | CPU_GET_INFO( qed5271be ); | |
| 168 | CPU_GET_INFO( qed5271le ); | |
| 169 | CPU_GET_INFO( rm7000be ); | |
| 170 | CPU_GET_INFO( rm7000le ); | |
| 171 | CPU_GET_INFO( arm ); | |
| 172 | CPU_GET_INFO( arm7 ); | |
| 173 | CPU_GET_INFO( sh1 ); | |
| 174 | CPU_GET_INFO( sh2 ); | |
| 175 | CPU_GET_INFO( sh4 ); | |
| 176 | CPU_GET_INFO( dsp32c ); | |
| 177 | CPU_GET_INFO( pic16C54 ); | |
| 178 | CPU_GET_INFO( pic16C55 ); | |
| 179 | CPU_GET_INFO( pic16C56 ); | |
| 180 | CPU_GET_INFO( pic16C57 ); | |
| 181 | CPU_GET_INFO( pic16C58 ); | |
| 182 | CPU_GET_INFO( g65816 ); | |
| 183 | CPU_GET_INFO( spc700 ); | |
| 184 | CPU_GET_INFO( e116t ); | |
| 185 | CPU_GET_INFO( e116xt ); | |
| 186 | CPU_GET_INFO( e116xs ); | |
| 187 | CPU_GET_INFO( e116xsr ); | |
| 188 | CPU_GET_INFO( e132n ); | |
| 189 | CPU_GET_INFO( e132t ); | |
| 190 | CPU_GET_INFO( e132xn ); | |
| 191 | CPU_GET_INFO( e132xt ); | |
| 192 | CPU_GET_INFO( e132xs ); | |
| 193 | CPU_GET_INFO( e132xsr ); | |
| 194 | CPU_GET_INFO( gms30c2116 ); | |
| 195 | CPU_GET_INFO( gms30c2132 ); | |
| 196 | CPU_GET_INFO( gms30c2216 ); | |
| 197 | CPU_GET_INFO( gms30c2232 ); | |
| 198 | CPU_GET_INFO( i386 ); | |
| 199 | CPU_GET_INFO( i486 ); | |
| 200 | CPU_GET_INFO( pentium ); | |
| 201 | CPU_GET_INFO( mediagx ); | |
| 202 | CPU_GET_INFO( i960 ); | |
| 203 | CPU_GET_INFO( h8_3002 ); | |
| 204 | CPU_GET_INFO( h8_3007 ); | |
| 205 | CPU_GET_INFO( h8_3044 ); | |
| 206 | CPU_GET_INFO( h8_3334 ); | |
| 207 | CPU_GET_INFO( v810 ); | |
| 208 | CPU_GET_INFO( m37702 ); | |
| 209 | CPU_GET_INFO( m37710 ); | |
| 210 | CPU_GET_INFO( ppc403ga ); | |
| 211 | CPU_GET_INFO( ppc403gcx ); | |
| 212 | CPU_GET_INFO( ppc601 ); | |
| 213 | CPU_GET_INFO( ppc602 ); | |
| 214 | CPU_GET_INFO( ppc603 ); | |
| 215 | CPU_GET_INFO( ppc603e ); | |
| 216 | CPU_GET_INFO( ppc603r ); | |
| 217 | CPU_GET_INFO( ppc604 ); | |
| 218 | CPU_GET_INFO( mpc8240 ); | |
| 219 | CPU_GET_INFO( SE3208 ); | |
| 220 | CPU_GET_INFO( mc68hc11 ); | |
| 221 | CPU_GET_INFO( adsp21062 ); | |
| 222 | CPU_GET_INFO( dsp56k ); | |
| 223 | CPU_GET_INFO( rsp ); | |
| 224 | CPU_GET_INFO( alpha8201 ); | |
| 225 | CPU_GET_INFO( alpha8301 ); | |
| 226 | CPU_GET_INFO( cdp1802 ); | |
| 227 | CPU_GET_INFO( cop401 ); | |
| 228 | CPU_GET_INFO( cop410 ); | |
| 229 | CPU_GET_INFO( cop411 ); | |
| 230 | CPU_GET_INFO( cop402 ); | |
| 231 | CPU_GET_INFO( cop420 ); | |
| 232 | CPU_GET_INFO( cop421 ); | |
| 233 | CPU_GET_INFO( cop422 ); | |
| 234 | CPU_GET_INFO( cop404 ); | |
| 235 | CPU_GET_INFO( cop424 ); | |
| 236 | CPU_GET_INFO( cop425 ); | |
| 237 | CPU_GET_INFO( cop426 ); | |
| 238 | CPU_GET_INFO( cop444 ); | |
| 239 | CPU_GET_INFO( cop445 ); | |
| 240 | CPU_GET_INFO( tmp90840 ); | |
| 241 | CPU_GET_INFO( tmp90841 ); | |
| 242 | CPU_GET_INFO( tmp91640 ); | |
| 243 | CPU_GET_INFO( tmp91641 ); | |
| 244 | CPU_GET_INFO( apexc ); | |
| 245 | CPU_GET_INFO( cp1610 ); | |
| 246 | CPU_GET_INFO( f8 ); | |
| 247 | CPU_GET_INFO( lh5801 ); | |
| 248 | CPU_GET_INFO( pdp1 ); | |
| 249 | CPU_GET_INFO( saturn ); | |
| 250 | CPU_GET_INFO( sc61860 ); | |
| 251 | CPU_GET_INFO( tx0_64kw ); | |
| 252 | CPU_GET_INFO( tx0_8kw ); | |
| 253 | CPU_GET_INFO( lr35902 ); | |
| 254 | CPU_GET_INFO( tms7000 ); | |
| 255 | CPU_GET_INFO( tms7000_exl ); | |
| 256 | CPU_GET_INFO( sm8500 ); | |
| 257 | CPU_GET_INFO( v30mz ); | |
| 258 | CPU_GET_INFO( mb8841 ); | |
| 259 | CPU_GET_INFO( mb8842 ); | |
| 260 | CPU_GET_INFO( mb8843 ); | |
| 261 | CPU_GET_INFO( mb8844 ); | |
| 262 | CPU_GET_INFO( mb86233 ); | |
| 263 | CPU_GET_INFO( ssp1601 ); | |
| 264 | CPU_GET_INFO( minx ); | |
| 265 | CPU_GET_INFO( cxd8661r ); | |
| 266 | ||
| 267 | ||
| 268 | ||
| 269 | /*************************************************************************** | |
| 270 | MASTER CPU LIST | |
| 271 | ***************************************************************************/ | |
| 272 | ||
| 273 | static const struct | |
| 274 | { | |
| 275 | int cputype; | |
| 276 | cpu_get_info_func get_info; | |
| 277 | } cpuintrf_map[] = | |
| 278 | { | |
| 279 | { CPU_DUMMY, CPU_GET_INFO_NAME(dummy) }, | |
| 280 | #if (HAS_Z80) | |
| 281 | { CPU_Z80, CPU_GET_INFO_NAME(z80) }, | |
| 282 | #endif | |
| 283 | #if (HAS_Z180) | |
| 284 | { CPU_Z180, CPU_GET_INFO_NAME(z180) }, | |
| 285 | #endif | |
| 286 | #if (HAS_8080) | |
| 287 | { CPU_8080, CPU_GET_INFO_NAME(i8080) }, | |
| 288 | #endif | |
| 289 | #if (HAS_8085A) | |
| 290 | { CPU_8085A, CPU_GET_INFO_NAME(i8085) }, | |
| 291 | #endif | |
| 292 | #if (HAS_M6502) | |
| 293 | { CPU_M6502, CPU_GET_INFO_NAME(m6502) }, | |
| 294 | #endif | |
| 295 | #if (HAS_M65C02) | |
| 296 | { CPU_M65C02, CPU_GET_INFO_NAME(m65c02) }, | |
| 297 | #endif | |
| 298 | #if (HAS_M65SC02) | |
| 299 | { CPU_M65SC02, CPU_GET_INFO_NAME(m65sc02) }, | |
| 300 | #endif | |
| 301 | #if (HAS_M65CE02) | |
| 302 | { CPU_M65CE02, CPU_GET_INFO_NAME(m65ce02) }, | |
| 303 | #endif | |
| 304 | #if (HAS_M6509) | |
| 305 | { CPU_M6509, CPU_GET_INFO_NAME(m6509) }, | |
| 306 | #endif | |
| 307 | #if (HAS_M6510) | |
| 308 | { CPU_M6510, CPU_GET_INFO_NAME(m6510) }, | |
| 309 | #endif | |
| 310 | #if (HAS_M6510T) | |
| 311 | { CPU_M6510T, CPU_GET_INFO_NAME(m6510t) }, | |
| 312 | #endif | |
| 313 | #if (HAS_M7501) | |
| 314 | { CPU_M7501, CPU_GET_INFO_NAME(m7501) }, | |
| 315 | #endif | |
| 316 | #if (HAS_M8502) | |
| 317 | { CPU_M8502, CPU_GET_INFO_NAME(m8502) }, | |
| 318 | #endif | |
| 319 | #if (HAS_N2A03) | |
| 320 | { CPU_N2A03, CPU_GET_INFO_NAME(n2a03) }, | |
| 321 | #endif | |
| 322 | #if (HAS_DECO16) | |
| 323 | { CPU_DECO16, CPU_GET_INFO_NAME(deco16) }, | |
| 324 | #endif | |
| 325 | #if (HAS_M4510) | |
| 326 | { CPU_M4510, CPU_GET_INFO_NAME(m4510) }, | |
| 327 | #endif | |
| 328 | #if (HAS_H6280) | |
| 329 | { CPU_H6280, CPU_GET_INFO_NAME(h6280) }, | |
| 330 | #endif | |
| 331 | #if (HAS_I8086) | |
| 332 | { CPU_I8086, CPU_GET_INFO_NAME(i8086) }, | |
| 333 | #endif | |
| 334 | #if (HAS_I8088) | |
| 335 | { CPU_I8088, CPU_GET_INFO_NAME(i8088) }, | |
| 336 | #endif | |
| 337 | #if (HAS_I80186) | |
| 338 | { CPU_I80186, CPU_GET_INFO_NAME(i80186) }, | |
| 339 | #endif | |
| 340 | #if (HAS_I80188) | |
| 341 | { CPU_I80188, CPU_GET_INFO_NAME(i80188) }, | |
| 342 | #endif | |
| 343 | #if (HAS_I80286) | |
| 344 | { CPU_I80286, CPU_GET_INFO_NAME(i80286) }, | |
| 345 | #endif | |
| 346 | #if (HAS_V20) | |
| 347 | { CPU_V20, CPU_GET_INFO_NAME(v20) }, | |
| 348 | #endif | |
| 349 | #if (HAS_V25) | |
| 350 | { CPU_V25, CPU_GET_INFO_NAME(v25) }, | |
| 351 | #endif | |
| 352 | #if (HAS_V30) | |
| 353 | { CPU_V30, CPU_GET_INFO_NAME(v30) }, | |
| 354 | #endif | |
| 355 | #if (HAS_V33) | |
| 356 | { CPU_V33, CPU_GET_INFO_NAME(v33) }, | |
| 357 | #endif | |
| 358 | #if (HAS_V35) | |
| 359 | { CPU_V35, CPU_GET_INFO_NAME(v35) }, | |
| 360 | #endif | |
| 361 | #if (HAS_V60) | |
| 362 | { CPU_V60, CPU_GET_INFO_NAME(v60) }, | |
| 363 | #endif | |
| 364 | #if (HAS_V70) | |
| 365 | { CPU_V70, CPU_GET_INFO_NAME(v70) }, | |
| 366 | #endif | |
| 367 | #if (HAS_I8035) | |
| 368 | { CPU_I8035, CPU_GET_INFO_NAME(i8035) }, | |
| 369 | #endif | |
| 370 | #if (HAS_I8041) | |
| 371 | { CPU_I8041, CPU_GET_INFO_NAME(i8041) }, | |
| 372 | #endif | |
| 373 | #if (HAS_I8048) | |
| 374 | { CPU_I8048, CPU_GET_INFO_NAME(i8048) }, | |
| 375 | #endif | |
| 376 | #if (HAS_I8648) | |
| 377 | { CPU_I8648, CPU_GET_INFO_NAME(i8648) }, | |
| 378 | #endif | |
| 379 | #if (HAS_I8748) | |
| 380 | { CPU_I8748, CPU_GET_INFO_NAME(i8748) }, | |
| 381 | #endif | |
| 382 | #if (HAS_MB8884) | |
| 383 | { CPU_MB8884, CPU_GET_INFO_NAME(mb8884) }, | |
| 384 | #endif | |
| 385 | #if (HAS_N7751) | |
| 386 | { CPU_N7751, CPU_GET_INFO_NAME(n7751) }, | |
| 387 | #endif | |
| 388 | #if (HAS_I8039) | |
| 389 | { CPU_I8039, CPU_GET_INFO_NAME(i8039) }, | |
| 390 | #endif | |
| 391 | #if (HAS_I8049) | |
| 392 | { CPU_I8049, CPU_GET_INFO_NAME(i8049) }, | |
| 393 | #endif | |
| 394 | #if (HAS_I8749) | |
| 395 | { CPU_I8749, CPU_GET_INFO_NAME(i8749) }, | |
| 396 | #endif | |
| 397 | #if (HAS_M58715) | |
| 398 | { CPU_M58715, CPU_GET_INFO_NAME(m58715) }, | |
| 399 | #endif | |
| 400 | #if (HAS_I8041) | |
| 401 | { CPU_I8041, CPU_GET_INFO_NAME(i8041) }, | |
| 402 | #endif | |
| 403 | #if (HAS_I8741) | |
| 404 | { CPU_I8741, CPU_GET_INFO_NAME(i8741) }, | |
| 405 | #endif | |
| 406 | #if (HAS_I8042) | |
| 407 | { CPU_I8042, CPU_GET_INFO_NAME(i8042) }, | |
| 408 | #endif | |
| 409 | #if (HAS_I8242) | |
| 410 | { CPU_I8242, CPU_GET_INFO_NAME(i8242) }, | |
| 411 | #endif | |
| 412 | #if (HAS_I8742) | |
| 413 | { CPU_I8742, CPU_GET_INFO_NAME(i8742) }, | |
| 414 | #endif | |
| 415 | #if (HAS_I8031) | |
| 416 | { CPU_I8031, CPU_GET_INFO_NAME(i8031) }, | |
| 417 | #endif | |
| 418 | #if (HAS_I8032) | |
| 419 | { CPU_I8032, CPU_GET_INFO_NAME(i8032) }, | |
| 420 | #endif | |
| 421 | #if (HAS_I8051) | |
| 422 | { CPU_I8051, CPU_GET_INFO_NAME(i8051) }, | |
| 423 | #endif | |
| 424 | #if (HAS_I8052) | |
| 425 | { CPU_I8052, CPU_GET_INFO_NAME(i8052) }, | |
| 426 | #endif | |
| 427 | #if (HAS_I8751) | |
| 428 | { CPU_I8751, CPU_GET_INFO_NAME(i8751) }, | |
| 429 | #endif | |
| 430 | #if (HAS_I8752) | |
| 431 | { CPU_I8752, CPU_GET_INFO_NAME(i8752) }, | |
| 432 | #endif | |
| 433 | #if (HAS_I80C31) | |
| 434 | { CPU_I80C31, CPU_GET_INFO_NAME(i80c31) }, | |
| 435 | #endif | |
| 436 | #if (HAS_I80C32) | |
| 437 | { CPU_I80C32, CPU_GET_INFO_NAME(i80c32) }, | |
| 438 | #endif | |
| 439 | #if (HAS_I80C51) | |
| 440 | { CPU_I80C51, CPU_GET_INFO_NAME(i80c51) }, | |
| 441 | #endif | |
| 442 | #if (HAS_I80C52) | |
| 443 | { CPU_I80C52, CPU_GET_INFO_NAME(i80c52) }, | |
| 444 | #endif | |
| 445 | #if (HAS_I87C51) | |
| 446 | { CPU_I87C51, CPU_GET_INFO_NAME(i87c51) }, | |
| 447 | #endif | |
| 448 | #if (HAS_I87C52) | |
| 449 | { CPU_I87C52, CPU_GET_INFO_NAME(i87c52) }, | |
| 450 | #endif | |
| 451 | #if (HAS_AT89C4051) | |
| 452 | { CPU_AT89C4051, CPU_GET_INFO_NAME(at89c4051) }, | |
| 453 | #endif | |
| 454 | #if (HAS_DS5002FP) | |
| 455 | { CPU_DS5002FP, CPU_GET_INFO_NAME(ds5002fp) }, | |
| 456 | #endif | |
| 457 | #if (HAS_M6800) | |
| 458 | { CPU_M6800, CPU_GET_INFO_NAME(m6800) }, | |
| 459 | #endif | |
| 460 | #if (HAS_M6801) | |
| 461 | { CPU_M6801, CPU_GET_INFO_NAME(m6801) }, | |
| 462 | #endif | |
| 463 | #if (HAS_M6802) | |
| 464 | { CPU_M6802, CPU_GET_INFO_NAME(m6802) }, | |
| 465 | #endif | |
| 466 | #if (HAS_M6803) | |
| 467 | { CPU_M6803, CPU_GET_INFO_NAME(m6803) }, | |
| 468 | #endif | |
| 469 | #if (HAS_M6808) | |
| 470 | { CPU_M6808, CPU_GET_INFO_NAME(m6808) }, | |
| 471 | #endif | |
| 472 | #if (HAS_HD63701) | |
| 473 | { CPU_HD63701, CPU_GET_INFO_NAME(hd63701) }, | |
| 474 | #endif | |
| 475 | #if (HAS_NSC8105) | |
| 476 | { CPU_NSC8105, CPU_GET_INFO_NAME(nsc8105) }, | |
| 477 | #endif | |
| 478 | #if (HAS_M6805) | |
| 479 | { CPU_M6805, CPU_GET_INFO_NAME(m6805) }, | |
| 480 | #endif | |
| 481 | #if (HAS_M68705) | |
| 482 | { CPU_M68705, CPU_GET_INFO_NAME(m68705) }, | |
| 483 | #endif | |
| 484 | #if (HAS_HD63705) | |
| 485 | { CPU_HD63705, CPU_GET_INFO_NAME(hd63705) }, | |
| 486 | #endif | |
| 487 | #if (HAS_HD6309) | |
| 488 | { CPU_HD6309, CPU_GET_INFO_NAME(hd6309) }, | |
| 489 | #endif | |
| 490 | #if (HAS_M6809) | |
| 491 | { CPU_M6809, CPU_GET_INFO_NAME(m6809) }, | |
| 492 | #endif | |
| 493 | #if (HAS_M6809E) | |
| 494 | { CPU_M6809E, CPU_GET_INFO_NAME(m6809e) }, | |
| 495 | #endif | |
| 496 | #if (HAS_KONAMI) | |
| 497 | { CPU_KONAMI, CPU_GET_INFO_NAME(konami) }, | |
| 498 | #endif | |
| 499 | #if (HAS_M680X0) | |
| 500 | { CPU_M68000, CPU_GET_INFO_NAME(m68000) }, | |
| 501 | { CPU_M68008, CPU_GET_INFO_NAME(m68008) }, | |
| 502 | { CPU_M68010, CPU_GET_INFO_NAME(m68010) }, | |
| 503 | { CPU_M68EC020, CPU_GET_INFO_NAME(m68ec020) }, | |
| 504 | { CPU_M68020, CPU_GET_INFO_NAME(m68020) }, | |
| 505 | { CPU_M68040, CPU_GET_INFO_NAME(m68040) }, | |
| 506 | #endif | |
| 507 | #if (HAS_T11) | |
| 508 | { CPU_T11, CPU_GET_INFO_NAME(t11) }, | |
| 509 | #endif | |
| 510 | #if (HAS_S2650) | |
| 511 | { CPU_S2650, CPU_GET_INFO_NAME(s2650) }, | |
| 512 | #endif | |
| 513 | #if (HAS_TMS340X0) | |
| 514 | { CPU_TMS34010, CPU_GET_INFO_NAME(tms34010) }, | |
| 515 | { CPU_TMS34020, CPU_GET_INFO_NAME(tms34020) }, | |
| 516 | #endif | |
| 517 | #if (HAS_TI990_10) | |
| 518 | { CPU_TI990_10, CPU_GET_INFO_NAME(ti990_10) }, | |
| 519 | #endif | |
| 520 | #if (HAS_TMS9900) | |
| 521 | { CPU_TMS9900, CPU_GET_INFO_NAME(tms9900) }, | |
| 522 | #endif | |
| 523 | #if (HAS_TMS9980) | |
| 524 | { CPU_TMS9980, CPU_GET_INFO_NAME(tms9980a) }, | |
| 525 | #endif | |
| 526 | #if (HAS_TMS9995) | |
| 527 | { CPU_TMS9995, CPU_GET_INFO_NAME(tms9995) }, | |
| 528 | #endif | |
| 529 | #if (HAS_Z8000) | |
| 530 | { CPU_Z8000, CPU_GET_INFO_NAME(z8000) }, | |
| 531 | #endif | |
| 532 | #if (HAS_TMS32010) | |
| 533 | { CPU_TMS32010, CPU_GET_INFO_NAME(tms32010) }, | |
| 534 | #endif | |
| 535 | #if (HAS_TMS32025) | |
| 536 | { CPU_TMS32025, CPU_GET_INFO_NAME(tms32025) }, | |
| 537 | #endif | |
| 538 | #if (HAS_TMS32026) | |
| 539 | { CPU_TMS32026, CPU_GET_INFO_NAME(tms32026) }, | |
| 540 | #endif | |
| 541 | #if (HAS_TMS32031) | |
| 542 | { CPU_TMS32031, CPU_GET_INFO_NAME(tms32031) }, | |
| 543 | #endif | |
| 544 | #if (HAS_TMS32032) | |
| 545 | { CPU_TMS32032, CPU_GET_INFO_NAME(tms32032) }, | |
| 546 | #endif | |
| 547 | #if (HAS_TMS32051) | |
| 548 | { CPU_TMS32051, CPU_GET_INFO_NAME(tms32051) }, | |
| 549 | #endif | |
| 550 | #if (HAS_CCPU) | |
| 551 | { CPU_CCPU, CPU_GET_INFO_NAME(ccpu) }, | |
| 552 | #endif | |
| 553 | #if (HAS_ADSP2100) | |
| 554 | { CPU_ADSP2100, CPU_GET_INFO_NAME(adsp2100) }, | |
| 555 | #endif | |
| 556 | #if (HAS_ADSP2101) | |
| 557 | { CPU_ADSP2101, CPU_GET_INFO_NAME(adsp2101) }, | |
| 558 | #endif | |
| 559 | #if (HAS_ADSP2104) | |
| 560 | { CPU_ADSP2104, CPU_GET_INFO_NAME(adsp2104) }, | |
| 561 | #endif | |
| 562 | #if (HAS_ADSP2105) | |
| 563 | { CPU_ADSP2105, CPU_GET_INFO_NAME(adsp2105) }, | |
| 564 | #endif | |
| 565 | #if (HAS_ADSP2115) | |
| 566 | { CPU_ADSP2115, CPU_GET_INFO_NAME(adsp2115) }, | |
| 567 | #endif | |
| 568 | #if (HAS_ADSP2181) | |
| 569 | { CPU_ADSP2181, CPU_GET_INFO_NAME(adsp2181) }, | |
| 570 | #endif | |
| 571 | #if (HAS_PSXCPU) | |
| 572 | { CPU_PSXCPU, CPU_GET_INFO_NAME(psxcpu) }, | |
| 573 | #endif | |
| 574 | #if (HAS_ASAP) | |
| 575 | { CPU_ASAP, CPU_GET_INFO_NAME(asap) }, | |
| 576 | #endif | |
| 577 | #if (HAS_UPD7810) | |
| 578 | { CPU_UPD7810, CPU_GET_INFO_NAME(upd7810) }, | |
| 579 | #endif | |
| 580 | #if (HAS_UPD7807) | |
| 581 | { CPU_UPD7807, CPU_GET_INFO_NAME(upd7807) }, | |
| 582 | #endif | |
| 583 | #if (HAS_UPD7801) | |
| 584 | { CPU_UPD7801, CPU_GET_INFO_NAME(upd7801) }, | |
| 585 | { CPU_UPD78C05, CPU_GET_INFO_NAME(upd78c05) }, | |
| 586 | { CPU_UPD78C06, CPU_GET_INFO_NAME(upd78c06) }, | |
| 587 | #endif | |
| 588 | #if (HAS_JAGUAR) | |
| 589 | { CPU_JAGUARGPU, CPU_GET_INFO_NAME(jaguargpu) }, | |
| 590 | { CPU_JAGUARDSP, CPU_GET_INFO_NAME(jaguardsp) }, | |
| 591 | #endif | |
| 592 | #if (HAS_CUBEQCPU) | |
| 593 | { CPU_CQUESTSND, CPU_GET_INFO_NAME(cquestsnd) }, | |
| 594 | { CPU_CQUESTROT, CPU_GET_INFO_NAME(cquestrot) }, | |
| 595 | { CPU_CQUESTLIN, CPU_GET_INFO_NAME(cquestlin) }, | |
| 596 | #endif | |
| 597 | #if (HAS_R3000) | |
| 598 | { CPU_R3000BE, CPU_GET_INFO_NAME(r3000be) }, | |
| 599 | { CPU_R3000LE, CPU_GET_INFO_NAME(r3000le) }, | |
| 600 | #endif | |
| 601 | #if (HAS_R3041) | |
| 602 | { CPU_R3041BE, CPU_GET_INFO_NAME(r3041be) }, | |
| 603 | { CPU_R3041LE, CPU_GET_INFO_NAME(r3041le) }, | |
| 604 | #endif | |
| 605 | #if (HAS_R4600) | |
| 606 | { CPU_R4600BE, CPU_GET_INFO_NAME(r4600be) }, | |
| 607 | { CPU_R4600LE, CPU_GET_INFO_NAME(r4600le) }, | |
| 608 | #endif | |
| 609 | #if (HAS_R4650) | |
| 610 | { CPU_R4650BE, CPU_GET_INFO_NAME(r4650be) }, | |
| 611 | { CPU_R4650LE, CPU_GET_INFO_NAME(r4650le) }, | |
| 612 | #endif | |
| 613 | #if (HAS_R4700) | |
| 614 | { CPU_R4700BE, CPU_GET_INFO_NAME(r4700be) }, | |
| 615 | { CPU_R4700LE, CPU_GET_INFO_NAME(r4700le) }, | |
| 616 | #endif | |
| 617 | #if (HAS_R5000) | |
| 618 | { CPU_R5000BE, CPU_GET_INFO_NAME(r5000be) }, | |
| 619 | { CPU_R5000LE, CPU_GET_INFO_NAME(r5000le) }, | |
| 620 | #endif | |
| 621 | #if (HAS_QED5271) | |
| 622 | { CPU_QED5271BE, CPU_GET_INFO_NAME(qed5271be) }, | |
| 623 | { CPU_QED5271LE, CPU_GET_INFO_NAME(qed5271le) }, | |
| 624 | #endif | |
| 625 | #if (HAS_RM7000) | |
| 626 | { CPU_RM7000BE, CPU_GET_INFO_NAME(rm7000be) }, | |
| 627 | { CPU_RM7000LE, CPU_GET_INFO_NAME(rm7000le) }, | |
| 628 | #endif | |
| 629 | #if (HAS_ARM) | |
| 630 | { CPU_ARM, CPU_GET_INFO_NAME(arm) }, | |
| 631 | #endif | |
| 632 | #if (HAS_ARM7) | |
| 633 | { CPU_ARM7, CPU_GET_INFO_NAME(arm7) }, | |
| 634 | #endif | |
| 635 | #if (HAS_SH1) | |
| 636 | { CPU_SH1, CPU_GET_INFO_NAME(sh1) }, | |
| 637 | #endif | |
| 638 | #if (HAS_SH2) | |
| 639 | { CPU_SH2, CPU_GET_INFO_NAME(sh2) }, | |
| 640 | #endif | |
| 641 | #if (HAS_SH4) | |
| 642 | { CPU_SH4, CPU_GET_INFO_NAME(sh4) }, | |
| 643 | #endif | |
| 644 | #if (HAS_DSP32C) | |
| 645 | { CPU_DSP32C, CPU_GET_INFO_NAME(dsp32c) }, | |
| 646 | #endif | |
| 647 | #if (HAS_PIC16C54) | |
| 648 | { CPU_PIC16C54, CPU_GET_INFO_NAME(pic16C54) }, | |
| 649 | #endif | |
| 650 | #if (HAS_PIC16C55) | |
| 651 | { CPU_PIC16C55, CPU_GET_INFO_NAME(pic16C55) }, | |
| 652 | #endif | |
| 653 | #if (HAS_PIC16C56) | |
| 654 | { CPU_PIC16C56, CPU_GET_INFO_NAME(pic16C56) }, | |
| 655 | #endif | |
| 656 | #if (HAS_PIC16C57) | |
| 657 | { CPU_PIC16C57, CPU_GET_INFO_NAME(pic16C57) }, | |
| 658 | #endif | |
| 659 | #if (HAS_PIC16C58) | |
| 660 | { CPU_PIC16C58, CPU_GET_INFO_NAME(pic16C58) }, | |
| 661 | #endif | |
| 662 | #if (HAS_G65816) | |
| 663 | { CPU_G65816, CPU_GET_INFO_NAME(g65816) }, | |
| 664 | #endif | |
| 665 | #if (HAS_SPC700) | |
| 666 | { CPU_SPC700, CPU_GET_INFO_NAME(spc700) }, | |
| 667 | #endif | |
| 668 | #if (HAS_E116T) | |
| 669 | { CPU_E116T, CPU_GET_INFO_NAME(e116t) }, | |
| 670 | #endif | |
| 671 | #if (HAS_E116XT) | |
| 672 | { CPU_E116XT, CPU_GET_INFO_NAME(e116xt) }, | |
| 673 | #endif | |
| 674 | #if (HAS_E116XS) | |
| 675 | { CPU_E116XS, CPU_GET_INFO_NAME(e116xs) }, | |
| 676 | #endif | |
| 677 | #if (HAS_E116XSR) | |
| 678 | { CPU_E116XSR, CPU_GET_INFO_NAME(e116xsr) }, | |
| 679 | #endif | |
| 680 | #if (HAS_E132N) | |
| 681 | { CPU_E132N, CPU_GET_INFO_NAME(e132n) }, | |
| 682 | #endif | |
| 683 | #if (HAS_E132T) | |
| 684 | { CPU_E132T, CPU_GET_INFO_NAME(e132t) }, | |
| 685 | #endif | |
| 686 | #if (HAS_E132XN) | |
| 687 | { CPU_E132XN, CPU_GET_INFO_NAME(e132xn) }, | |
| 688 | #endif | |
| 689 | #if (HAS_E132XT) | |
| 690 | { CPU_E132XT, CPU_GET_INFO_NAME(e132xt) }, | |
| 691 | #endif | |
| 692 | #if (HAS_E132XS) | |
| 693 | { CPU_E132XS, CPU_GET_INFO_NAME(e132xs) }, | |
| 694 | #endif | |
| 695 | #if (HAS_E132XSR) | |
| 696 | { CPU_E132XSR, CPU_GET_INFO_NAME(e132xsr) }, | |
| 697 | #endif | |
| 698 | #if (HAS_GMS30C2116) | |
| 699 | { CPU_GMS30C2116, CPU_GET_INFO_NAME(gms30c2116) }, | |
| 700 | #endif | |
| 701 | #if (HAS_GMS30C2132) | |
| 702 | { CPU_GMS30C2132, CPU_GET_INFO_NAME(gms30c2132) }, | |
| 703 | #endif | |
| 704 | #if (HAS_GMS30C2216) | |
| 705 | { CPU_GMS30C2216, CPU_GET_INFO_NAME(gms30c2216) }, | |
| 706 | #endif | |
| 707 | #if (HAS_GMS30C2232) | |
| 708 | { CPU_GMS30C2232, CPU_GET_INFO_NAME(gms30c2232) }, | |
| 709 | #endif | |
| 710 | #if (HAS_I386) | |
| 711 | { CPU_I386, CPU_GET_INFO_NAME(i386) }, | |
| 712 | #endif | |
| 713 | #if (HAS_I486) | |
| 714 | { CPU_I486, CPU_GET_INFO_NAME(i486) }, | |
| 715 | #endif | |
| 716 | #if (HAS_PENTIUM) | |
| 717 | { CPU_PENTIUM, CPU_GET_INFO_NAME(pentium) }, | |
| 718 | #endif | |
| 719 | #if (HAS_MEDIAGX) | |
| 720 | { CPU_MEDIAGX, CPU_GET_INFO_NAME(mediagx) }, | |
| 721 | #endif | |
| 722 | #if (HAS_I960) | |
| 723 | { CPU_I960, CPU_GET_INFO_NAME(i960) }, | |
| 724 | #endif | |
| 725 | #if (HAS_H83334) | |
| 726 | { CPU_H83334, CPU_GET_INFO_NAME(h8_3334) }, | |
| 727 | #endif | |
| 728 | #if (HAS_H83002) | |
| 729 | { CPU_H83002, CPU_GET_INFO_NAME(h8_3002) }, | |
| 730 | { CPU_H83007, CPU_GET_INFO_NAME(h8_3007) }, | |
| 731 | { CPU_H83044, CPU_GET_INFO_NAME(h8_3044) }, | |
| 732 | #endif | |
| 733 | #if (HAS_V810) | |
| 734 | { CPU_V810, CPU_GET_INFO_NAME(v810) }, | |
| 735 | #endif | |
| 736 | #if (HAS_M37702) | |
| 737 | { CPU_M37702, CPU_GET_INFO_NAME(m37702) }, | |
| 738 | #endif | |
| 739 | #if (HAS_M37710) | |
| 740 | { CPU_M37710, CPU_GET_INFO_NAME(m37710) }, | |
| 741 | #endif | |
| 742 | #if (HAS_PPC403GA) | |
| 743 | { CPU_PPC403GA, CPU_GET_INFO_NAME(ppc403ga) }, | |
| 744 | #endif | |
| 745 | #if (HAS_PPC403GCX) | |
| 746 | { CPU_PPC403GCX, CPU_GET_INFO_NAME(ppc403gcx) }, | |
| 747 | #endif | |
| 748 | #if (HAS_PPC601) | |
| 749 | { CPU_PPC601, CPU_GET_INFO_NAME(ppc601) }, | |
| 750 | #endif | |
| 751 | #if (HAS_PPC602) | |
| 752 | { CPU_PPC602, CPU_GET_INFO_NAME(ppc602) }, | |
| 753 | #endif | |
| 754 | #if (HAS_PPC603) | |
| 755 | { CPU_PPC603, CPU_GET_INFO_NAME(ppc603) }, | |
| 756 | #endif | |
| 757 | #if (HAS_PPC603E) | |
| 758 | { CPU_PPC603E, CPU_GET_INFO_NAME(ppc603e) }, | |
| 759 | #endif | |
| 760 | #if (HAS_PPC603R) | |
| 761 | { CPU_PPC603R, CPU_GET_INFO_NAME(ppc603r) }, | |
| 762 | #endif | |
| 763 | #if (HAS_PPC604) | |
| 764 | { CPU_PPC604, CPU_GET_INFO_NAME(ppc604) }, | |
| 765 | #endif | |
| 766 | #if (HAS_MPC8240) | |
| 767 | { CPU_MPC8240, CPU_GET_INFO_NAME(mpc8240) }, | |
| 768 | #endif | |
| 769 | #if (HAS_SE3208) | |
| 770 | { CPU_SE3208, CPU_GET_INFO_NAME(SE3208) }, | |
| 771 | #endif | |
| 772 | #if (HAS_MC68HC11) | |
| 773 | { CPU_MC68HC11, CPU_GET_INFO_NAME(mc68hc11) }, | |
| 774 | #endif | |
| 775 | #if (HAS_ADSP21062) | |
| 776 | { CPU_ADSP21062, CPU_GET_INFO_NAME(adsp21062) }, | |
| 777 | #endif | |
| 778 | #if (HAS_DSP56156) | |
| 779 | { CPU_DSP56156, CPU_GET_INFO_NAME(dsp56k) }, | |
| 780 | #endif | |
| 781 | #if (HAS_RSP) | |
| 782 | { CPU_RSP, CPU_GET_INFO_NAME(rsp) }, | |
| 783 | #endif | |
| 784 | #if (HAS_ALPHA8201) | |
| 785 | { CPU_ALPHA8201, CPU_GET_INFO_NAME(alpha8201) }, | |
| 786 | #endif | |
| 787 | #if (HAS_ALPHA8301) | |
| 788 | { CPU_ALPHA8301, CPU_GET_INFO_NAME(alpha8301) }, | |
| 789 | #endif | |
| 790 | #if (HAS_CDP1802) | |
| 791 | { CPU_CDP1802, CPU_GET_INFO_NAME(cdp1802) }, | |
| 792 | #endif | |
| 793 | #if (HAS_COP401) | |
| 794 | { CPU_COP401, CPU_GET_INFO_NAME(cop401) }, | |
| 795 | #endif | |
| 796 | #if (HAS_COP410) | |
| 797 | { CPU_COP410, CPU_GET_INFO_NAME(cop410) }, | |
| 798 | #endif | |
| 799 | #if (HAS_COP411) | |
| 800 | { CPU_COP411, CPU_GET_INFO_NAME(cop411) }, | |
| 801 | #endif | |
| 802 | #if (HAS_COP402) | |
| 803 | { CPU_COP402, CPU_GET_INFO_NAME(cop402) }, | |
| 804 | #endif | |
| 805 | #if (HAS_COP420) | |
| 806 | { CPU_COP420, CPU_GET_INFO_NAME(cop420) }, | |
| 807 | #endif | |
| 808 | #if (HAS_COP421) | |
| 809 | { CPU_COP421, CPU_GET_INFO_NAME(cop421) }, | |
| 810 | #endif | |
| 811 | #if (HAS_COP422) | |
| 812 | { CPU_COP422, CPU_GET_INFO_NAME(cop422) }, | |
| 813 | #endif | |
| 814 | #if (HAS_COP404) | |
| 815 | { CPU_COP404, CPU_GET_INFO_NAME(cop404) }, | |
| 816 | #endif | |
| 817 | #if (HAS_COP424) | |
| 818 | { CPU_COP424, CPU_GET_INFO_NAME(cop424) }, | |
| 819 | #endif | |
| 820 | #if (HAS_COP425) | |
| 821 | { CPU_COP425, CPU_GET_INFO_NAME(cop425) }, | |
| 822 | #endif | |
| 823 | #if (HAS_COP426) | |
| 824 | { CPU_COP426, CPU_GET_INFO_NAME(cop426) }, | |
| 825 | #endif | |
| 826 | #if (HAS_COP444) | |
| 827 | { CPU_COP444, CPU_GET_INFO_NAME(cop444) }, | |
| 828 | #endif | |
| 829 | #if (HAS_COP445) | |
| 830 | { CPU_COP445, CPU_GET_INFO_NAME(cop445) }, | |
| 831 | #endif | |
| 832 | #if (HAS_TLCS90) | |
| 833 | { CPU_TMP90840, CPU_GET_INFO_NAME(tmp90840) }, | |
| 834 | { CPU_TMP90841, CPU_GET_INFO_NAME(tmp90841) }, | |
| 835 | { CPU_TMP91640, CPU_GET_INFO_NAME(tmp91640) }, | |
| 836 | { CPU_TMP91641, CPU_GET_INFO_NAME(tmp91641) }, | |
| 837 | #endif | |
| 838 | #if (HAS_APEXC) | |
| 839 | { CPU_APEXC, CPU_GET_INFO_NAME(apexc) }, | |
| 840 | #endif | |
| 841 | #if (HAS_CP1610) | |
| 842 | { CPU_CP1610, CPU_GET_INFO_NAME(cp1610) }, | |
| 843 | #endif | |
| 844 | #if (HAS_F8) | |
| 845 | { CPU_F8, CPU_GET_INFO_NAME(f8) }, | |
| 846 | #endif | |
| 847 | #if (HAS_LH5801) | |
| 848 | { CPU_LH5801, CPU_GET_INFO_NAME(lh5801) }, | |
| 849 | #endif | |
| 850 | #if (HAS_PDP1) | |
| 851 | { CPU_PDP1, CPU_GET_INFO_NAME(pdp1) }, | |
| 852 | #endif | |
| 853 | #if (HAS_SATURN) | |
| 854 | { CPU_SATURN, CPU_GET_INFO_NAME(saturn) }, | |
| 855 | #endif | |
| 856 | #if (HAS_SC61860) | |
| 857 | { CPU_SC61860, CPU_GET_INFO_NAME(sc61860) }, | |
| 858 | #endif | |
| 859 | #if (HAS_TX0_64KW) | |
| 860 | { CPU_TX0_64KW, CPU_GET_INFO_NAME(tx0_64kw) }, | |
| 861 | #endif | |
| 862 | #if (HAS_TX0_8KW) | |
| 863 | { CPU_TX0_8KW, CPU_GET_INFO_NAME(tx0_8kw) }, | |
| 864 | #endif | |
| 865 | #if (HAS_LR35902) | |
| 866 | { CPU_LR35902, CPU_GET_INFO_NAME(lr35902) }, | |
| 867 | #endif | |
| 868 | #if (HAS_TMS7000) | |
| 869 | { CPU_TMS7000, CPU_GET_INFO_NAME(tms7000) }, | |
| 870 | #endif | |
| 871 | #if (HAS_TMS7000_EXL) | |
| 872 | { CPU_TMS7000_EXL, CPU_GET_INFO_NAME(tms7000_exl) }, | |
| 873 | #endif | |
| 874 | #if (HAS_SM8500) | |
| 875 | { CPU_SM8500, CPU_GET_INFO_NAME(sm8500) }, | |
| 876 | #endif | |
| 877 | #if (HAS_V30MZ) | |
| 878 | { CPU_V30MZ, CPU_GET_INFO_NAME(v30mz) }, | |
| 879 | #endif | |
| 880 | #if (HAS_MB8841) | |
| 881 | { CPU_MB8841, CPU_GET_INFO_NAME(mb8841) }, | |
| 882 | #endif | |
| 883 | #if (HAS_MB8842) | |
| 884 | { CPU_MB8842, CPU_GET_INFO_NAME(mb8842) }, | |
| 885 | #endif | |
| 886 | #if (HAS_MB8843) | |
| 887 | { CPU_MB8843, CPU_GET_INFO_NAME(mb8843) }, | |
| 888 | #endif | |
| 889 | #if (HAS_MB8844) | |
| 890 | { CPU_MB8844, CPU_GET_INFO_NAME(mb8844) }, | |
| 891 | #endif | |
| 892 | #if (HAS_MB86233) | |
| 893 | { CPU_MB86233, CPU_GET_INFO_NAME(mb86233) }, | |
| 894 | #endif | |
| 895 | #if (HAS_SSP1601) | |
| 896 | { CPU_SSP1601, CPU_GET_INFO_NAME(ssp1601) }, | |
| 897 | #endif | |
| 898 | #if (HAS_MINX) | |
| 899 | { CPU_MINX, CPU_GET_INFO_NAME(minx) }, | |
| 900 | #endif | |
| 901 | #if (HAS_CXD8661R) | |
| 902 | { CPU_CXD8661R, CPU_GET_INFO_NAME(cxd8661r) }, | |
| 903 | #endif | |
| 904 | }; | |
| 905 | ||
| 906 | ||
| 907 | ||
| 908 | /*************************************************************************** | |
| 909 | GLOBAL VARIABLES | |
| 910 | ***************************************************************************/ | |
| 911 | ||
| 912 | static cpu_class_header cpu_type_header[CPU_COUNT]; | |
| 913 | ||
| 914 | static char temp_string_pool[TEMP_STRING_POOL_ENTRIES][MAX_STRING_LENGTH]; | |
| 915 | static int temp_string_pool_index; | |
| 916 | ||
| 917 | ||
| 918 | ||
| 919 | /*************************************************************************** | |
| 920 | INLINE FUNCTIONS | |
| 921 | ***************************************************************************/ | |
| 922 | ||
| 923 | /*------------------------------------------------- | |
| 924 | get_temp_string_buffer - return a pointer to | |
| 925 | a temporary string buffer | |
| 926 | -------------------------------------------------*/ | |
| 927 | ||
| 928 | INLINE char *get_temp_string_buffer(void) | |
| 929 | { | |
| 930 | char *string = &temp_string_pool[temp_string_pool_index++ % TEMP_STRING_POOL_ENTRIES][0]; | |
| 931 | string[0] = 0; | |
| 932 | return string; | |
| 933 | } | |
| 934 | ||
| 935 | ||
| 936 | /*------------------------------------------------- | |
| 937 | get_safe_classheader - makes sure that the | |
| 938 | passed in device is, in fact, a CPU, and | |
| 939 | return the class token | |
| 940 | -------------------------------------------------*/ | |
| 941 | ||
| 942 | INLINE cpu_class_header *get_safe_classheader(const device_config *device) | |
| 943 | { | |
| 944 | assert(device != NULL); | |
| 945 | assert(device->classtoken != NULL); | |
| 946 | assert(device->class == DEVICE_CLASS_CPU_CHIP); | |
| 947 | ||
| 948 | return (cpu_class_header *)device->classtoken; | |
| 949 | } | |
| 950 | ||
| 951 | ||
| 952 | ||
| 953 | /*************************************************************************** | |
| 954 | GLOBAL MANAGEMENT | |
| 955 | ***************************************************************************/ | |
| 956 | ||
| 957 | /*------------------------------------------------- | |
| 958 | cpuintrf_init - initialize global structures | |
| 959 | -------------------------------------------------*/ | |
| 960 | ||
| 961 | void cpuintrf_init(running_machine *machine) | |
| 962 | { | |
| 963 | int mapindex; | |
| 964 | ||
| 965 | /* reset the cpuintrf array */ | |
| 966 | memset(cpu_type_header, 0, sizeof(cpu_type_header)); | |
| 967 | ||
| 968 | /* build the cpuintrf array */ | |
| 969 | for (mapindex = 0; mapindex < ARRAY_LENGTH(cpuintrf_map); mapindex++) | |
| 970 | { | |
| 971 | cpu_type cputype = cpuintrf_map[mapindex].cputype; | |
| 972 | cpu_class_header *header = &cpu_type_header[cputype]; | |
| 973 | cpuinfo info; | |
| 974 | int spacenum; | |
| 975 | ||
| 976 | /* start with the get_info routine */ | |
| 977 | header->cputype = cputype; | |
| 978 | header->get_info = cpuintrf_map[mapindex].get_info; | |
| 979 | ||
| 980 | /* bootstrap the rest of the function pointers */ | |
| 981 | info.setinfo = NULL; | |
| 982 | (*header->get_info)(NULL, CPUINFO_PTR_SET_INFO, &info); | |
| 983 | header->set_info = info.setinfo; | |
| 984 | ||
| 985 | info.init = NULL; | |
| 986 | (*header->get_info)(NULL, CPUINFO_PTR_INIT, &info); | |
| 987 | header->init = info.init; | |
| 988 | ||
| 989 | info.reset = NULL; | |
| 990 | (*header->get_info)(NULL, CPUINFO_PTR_RESET, &info); | |
| 991 | header->reset = info.reset; | |
| 992 | ||
| 993 | info.exit = NULL; | |
| 994 | (*header->get_info)(NULL, CPUINFO_PTR_EXIT, &info); | |
| 995 | header->exit = info.exit; | |
| 996 | ||
| 997 | info.execute = NULL; | |
| 998 | (*header->get_info)(NULL, CPUINFO_PTR_EXECUTE, &info); | |
| 999 | header->execute = info.execute; | |
| 1000 | ||
| 1001 | info.burn = NULL; | |
| 1002 | (*header->get_info)(NULL, CPUINFO_PTR_BURN, &info); | |
| 1003 | header->burn = info.burn; | |
| 1004 | ||
| 1005 | info.disassemble = NULL; | |
| 1006 | (*header->get_info)(NULL, CPUINFO_PTR_DISASSEMBLE, &info); | |
| 1007 | header->disassemble = info.disassemble; | |
| 1008 | ||
| 1009 | info.translate = NULL; | |
| 1010 | (*header->get_info)(NULL, CPUINFO_PTR_TRANSLATE, &info); | |
| 1011 | header->translate = info.translate; | |
| 1012 | ||
| 1013 | /* get other miscellaneous stuff */ | |
| 1014 | for (spacenum = 0; spacenum < ARRAY_LENGTH(header->address_shift); spacenum++) | |
| 1015 | header->address_shift[spacenum] = cputype_get_addrbus_shift(cputype, spacenum); | |
| 1016 | header->clock_divider = cputype_get_clock_divider(cputype); | |
| 1017 | header->clock_multiplier = cputype_get_clock_multiplier(cputype); | |
| 1018 | } | |
| 1019 | ||
| 1020 | /* fill in any empty entries with the dummy CPU */ | |
| 1021 | for (mapindex = 0; mapindex < CPU_COUNT; mapindex++) | |
| 1022 | if (cpu_type_header[mapindex].get_info == NULL) | |
| 1023 | cpu_type_header[mapindex] = cpu_type_header[CPU_DUMMY]; | |
| 1024 | } | |
| 1025 | ||
| 1026 | ||
| 1027 | ||
| 1028 | /*************************************************************************** | |
| 1029 | LIVE CONTEXT CONTROL | |
| 1030 | ***************************************************************************/ | |
| 1031 | ||
| 1032 | /*------------------------------------------------- | |
| 1033 | cpu_get_index_slow - find a CPU in the machine | |
| 1034 | by searching | |
| 1035 | -------------------------------------------------*/ | |
| 1036 | ||
| 1037 | int cpu_get_index_slow(const device_config *cpu) | |
| 1038 | { | |
| 1039 | int cpunum; | |
| 1040 | ||
| 1041 | for (cpunum = 0; cpunum < ARRAY_LENGTH(Machine->cpu); cpunum++) | |
| 1042 | if (Machine->cpu[cpunum] == cpu) | |
| 1043 | return cpunum; | |
| 1044 | return -1; | |
| 1045 | } | |
| 1046 | ||
| 1047 | ||
| 1048 | ||
| 1049 | /*************************************************************************** | |
| 1050 | 38 | LIVE CPU ACCESSORS |
| 1051 | 39 | ***************************************************************************/ |
| 1052 | 40 | |
| 1053 | 41 | /*------------------------------------------------- |
| 1054 | cpu_init - initialize a live CPU | |
| 1055 | -------------------------------------------------*/ | |
| 1056 | ||
| 1057 | void cpu_init(const device_config *device, int index, int clock, cpu_irq_callback irqcallback) | |
| 1058 | { | |
| 1059 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1060 | ||
| 1061 | classheader->index = index; | |
| 1062 | classheader->space[ADDRESS_SPACE_PROGRAM] = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); | |
| 1063 | classheader->space[ADDRESS_SPACE_DATA] = memory_find_address_space(device, ADDRESS_SPACE_DATA); | |
| 1064 | classheader->space[ADDRESS_SPACE_IO] = memory_find_address_space(device, ADDRESS_SPACE_IO); | |
| 1065 | ||
| 1066 | (*classheader->init)(device, index, clock, irqcallback); | |
| 1067 | } | |
| 1068 | ||
| 1069 | ||
| 1070 | /*------------------------------------------------- | |
| 1071 | cpu_exit - free a live CPU | |
| 1072 | -------------------------------------------------*/ | |
| 1073 | ||
| 1074 | void cpu_exit(const device_config *device) | |
| 1075 | { | |
| 1076 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1077 | ||
| 1078 | if (classheader->exit != NULL) | |
| 1079 | (*classheader->exit)(device); | |
| 1080 | } | |
| 1081 | ||
| 1082 | ||
| 1083 | /*------------------------------------------------- | |
| 1084 | cpu_get_info_* - return information about a | |
| 1085 | live CPU | |
| 1086 | -------------------------------------------------*/ | |
| 1087 | ||
| 1088 | INT64 cpu_get_info_int(const device_config *device, UINT32 state) | |
| 1089 | { | |
| 1090 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1091 | cpuinfo info; | |
| 1092 | ||
| 1093 | info.i = 0; | |
| 1094 | (*classheader->get_info)(device, state, &info); | |
| 1095 | return info.i; | |
| 1096 | } | |
| 1097 | ||
| 1098 | void *cpu_get_info_ptr(const device_config *device, UINT32 state) | |
| 1099 | { | |
| 1100 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1101 | cpuinfo info; | |
| 1102 | ||
| 1103 | info.p = NULL; | |
| 1104 | (*classheader->get_info)(device, state, &info); | |
| 1105 | return info.p; | |
| 1106 | } | |
| 1107 | ||
| 1108 | genf *cpu_get_info_fct(const device_config *device, UINT32 state) | |
| 1109 | { | |
| 1110 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1111 | cpuinfo info; | |
| 1112 | ||
| 1113 | info.f = NULL; | |
| 1114 | (*classheader->get_info)(device, state, &info); | |
| 1115 | return info.f; | |
| 1116 | } | |
| 1117 | ||
| 1118 | const char *cpu_get_info_string(const device_config *device, UINT32 state) | |
| 1119 | { | |
| 1120 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1121 | cpuinfo info; | |
| 1122 | ||
| 1123 | info.s = get_temp_string_buffer(); | |
| 1124 | (*classheader->get_info)(device, state, &info); | |
| 1125 | return info.s; | |
| 1126 | } | |
| 1127 | ||
| 1128 | ||
| 1129 | /*------------------------------------------------- | |
| 1130 | cpu_set_info_* - set information about a | |
| 1131 | live CPU | |
| 1132 | -------------------------------------------------*/ | |
| 1133 | ||
| 1134 | void cpu_set_info_int(const device_config *device, UINT32 state, INT64 data) | |
| 1135 | { | |
| 1136 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1137 | cpuinfo info; | |
| 1138 | ||
| 1139 | info.i = data; | |
| 1140 | (*classheader->set_info)(device, state, &info); | |
| 1141 | } | |
| 1142 | ||
| 1143 | void cpu_set_info_ptr(const device_config *device, UINT32 state, void *data) | |
| 1144 | { | |
| 1145 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1146 | cpuinfo info; | |
| 1147 | ||
| 1148 | info.p = data; | |
| 1149 | (*classheader->set_info)(device, state, &info); | |
| 1150 | } | |
| 1151 | ||
| 1152 | void cpu_set_info_fct(const device_config *device, UINT32 state, genf *data) | |
| 1153 | { | |
| 1154 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1155 | cpuinfo info; | |
| 1156 | ||
| 1157 | info.f = data; | |
| 1158 | (*classheader->set_info)(device, state, &info); | |
| 1159 | } | |
| 1160 | ||
| 1161 | ||
| 1162 | ||
| 1163 | /*------------------------------------------------- | |
| 1164 | cpu_reset - signal a reset for a given CPU | |
| 1165 | -------------------------------------------------*/ | |
| 1166 | ||
| 1167 | void cpu_reset(const device_config *device) | |
| 1168 | { | |
| 1169 | cpu_class_header *classheader = get_safe_classheader(device); | |
| 1170 | ||
| 1171 | (*classheader->reset)(device); | |
| 1172 | } | |
| 1173 | ||
| 1174 | ||
| 1175 | /*------------------------------------------------- | |
| 1176 | 42 | cpu_get_physical_pc_byte - return the PC, |
| 1177 | 43 | corrected to a byte offset and translated to |
| 1178 | 44 | physical space, on a given CPU |
| r3957 | r3958 | |
| 1183 | 49 | const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 1184 | 50 | offs_t pc; |
| 1185 | 51 | |
| 1186 | pc = memory_address_to_byte(space, c | |
| 52 | pc = memory_address_to_byte(space, device | |
| 1187 | 53 | memory_address_physical(space, TRANSLATE_FETCH, &pc); |
| 1188 | 54 | return pc; |
| 1189 | 55 | } |
| r3957 | r3958 | |
| 1196 | 62 | |
| 1197 | 63 | offs_t cpu_dasm(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) |
| 1198 | 64 | { |
| 1199 | cpu_class_header *classheader = get_ | |
| 65 | cpu_class_header *classheader = cpu_get_ | |
| 1200 | 66 | offs_t result = 0; |
| 1201 | 67 | |
| 1202 | 68 | /* check for disassembler override */ |
| r3957 | r3958 | |
| 1255 | 121 | |
| 1256 | 122 | void cpu_set_dasm_override(const device_config *device, cpu_disassemble_func dasm_override) |
| 1257 | 123 | { |
| 1258 | cpu_class_header *classheader = get_ | |
| 124 | cpu_class_header *classheader = cpu_get_ | |
| 1259 | 125 | classheader->dasm_override = dasm_override; |
| 1260 | 126 | } |
| 1261 | 127 | |
| 1262 | 128 | |
| 1263 | 129 | |
| 1264 | 130 | /*************************************************************************** |
| 1265 | CPU TYPE ACCESSORS | |
| 1266 | ***************************************************************************/ | |
| 1267 | ||
| 1268 | /*------------------------------------------------- | |
| 1269 | cputype_get_header_template - return a header | |
| 1270 | template for a given CPU type | |
| 1271 | -------------------------------------------------*/ | |
| 1272 | ||
| 1273 | const cpu_class_header *cputype_get_header_template(cpu_type cputype) | |
| 1274 | { | |
| 1275 | assert(cputype >= 0 && cputype < CPU_COUNT); | |
| 1276 | return &cpu_type_header[cputype]; | |
| 1277 | } | |
| 1278 | ||
| 1279 | ||
| 1280 | /*------------------------------------------------- | |
| 1281 | cputype_get_info_* - return information about a | |
| 1282 | given CPU type | |
| 1283 | -------------------------------------------------*/ | |
| 1284 | ||
| 1285 | INT64 cputype_get_info_int(cpu_type cputype, UINT32 state) | |
| 1286 | { | |
| 1287 | cpu_class_header *classheader = &cpu_type_header[cputype]; | |
| 1288 | cpuinfo info; | |
| 1289 | ||
| 1290 | assert(cputype >= 0 && cputype < CPU_COUNT); | |
| 1291 | info.i = 0; | |
| 1292 | (*classheader->get_info)(NULL, state, &info); | |
| 1293 | return info.i; | |
| 1294 | } | |
| 1295 | ||
| 1296 | void *cputype_get_info_ptr(cpu_type cputype, UINT32 state) | |
| 1297 | { | |
| 1298 | cpu_class_header *classheader = &cpu_type_header[cputype]; | |
| 1299 | cpuinfo info; | |
| 1300 | ||
| 1301 | assert(cputype >= 0 && cputype < CPU_COUNT); | |
| 1302 | info.p = NULL; | |
| 1303 | (*classheader->get_info)(NULL, state, &info); | |
| 1304 | return info.p; | |
| 1305 | } | |
| 1306 | ||
| 1307 | genf *cputype_get_info_fct(cpu_type cputype, UINT32 state) | |
| 1308 | { | |
| 1309 | cpu_class_header *classheader = &cpu_type_header[cputype]; | |
| 1310 | cpuinfo info; | |
| 1311 | ||
| 1312 | assert(cputype >= 0 && cputype < CPU_COUNT); | |
| 1313 | info.f = NULL; | |
| 1314 | (*classheader->get_info)(NULL, state, &info); | |
| 1315 | return info.f; | |
| 1316 | } | |
| 1317 | ||
| 1318 | const char *cputype_get_info_string(cpu_type cputype, UINT32 state) | |
| 1319 | { | |
| 1320 | cpu_class_header *classheader = &cpu_type_header[cputype]; | |
| 1321 | cpuinfo info; | |
| 1322 | ||
| 1323 | assert(cputype >= 0 && cputype < CPU_COUNT); | |
| 1324 | info.s = get_temp_string_buffer(); | |
| 1325 | (*classheader->get_info)(NULL, state, &info); | |
| 1326 | return info.s; | |
| 1327 | } | |
| 1328 | ||
| 1329 | ||
| 1330 | ||
| 1331 | /*************************************************************************** | |
| 1332 | 131 | DUMMY CPU DEFINITION |
| 1333 | 132 | ***************************************************************************/ |
| 1334 | 133 | |
| 1335 | struct dummy_context | |
| 134 | typedef struct _dummy_context dummy_context; | |
| 135 | struct _dummy_context | |
| 1336 | 136 | { |
| 1337 | | |
| 137 | int | |
| 1338 | 138 | }; |
| 1339 | 139 | |
| 1340 | static struct dummy_context dummy_state; | |
| 1341 | static int dummy_icount; | |
| 1342 | ||
| 1343 | 140 | static CPU_INIT( dummy ) { } |
| 1344 | 141 | static CPU_RESET( dummy ) { } |
| 1345 | 142 | static CPU_EXIT( dummy ) { } |
| r3957 | r3958 | |
| 1357 | 154 | |
| 1358 | 155 | CPU_GET_INFO( dummy ) |
| 1359 | 156 | { |
| 157 | dummy_context *cpustate = (device != NULL) ? device->token : NULL; | |
| 1360 | 158 | switch (state) |
| 1361 | 159 | { |
| 1362 | 160 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1363 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(dummy_ | |
| 161 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(dummy_cont | |
| 1364 | 162 | case CPUINFO_INT_INPUT_LINES: info->i = 1; break; |
| 1365 | 163 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; |
| 1366 | 164 | case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; |
| r3957 | r3958 | |
| 1388 | 186 | case CPUINFO_INT_SP: info->i = 0; break; |
| 1389 | 187 | |
| 1390 | 188 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1391 | case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(dummy); break; | |
| 1392 | case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(dummy); break; | |
| 1393 | case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(dummy); break; | |
| 1394 | case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(dummy); break; | |
| 1395 | case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(dummy);break; | |
| 1396 | case CPUINFO_PTR_BURN: info->burn = NULL; break; | |
| 1397 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(dummy); break; | |
| 1398 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &dummy_icount; break; | |
| 189 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(dummy); break; | |
| 190 | case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(dummy); break; | |
| 191 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(dummy); break; | |
| 192 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(dummy); break; | |
| 193 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(dummy);break; | |
| 194 | case CPUINFO_FCT_BURN: info->burn = NULL; break; | |
| 195 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(dummy); break; | |
| 196 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; | |
| 1399 | 197 | |
| 1400 | 198 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1401 | 199 | case CPUINFO_STR_NAME: strcpy(info->s, ""); break; |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | typedef struct _cpu_class_data cpu_class_data; |
| 60 | 60 | struct _cpu_class_data |
| 61 | 61 | { |
| 62 | /* this item must remain first */ | |
| 63 | cpu_class_header header; /* header containing public data */ | |
| 64 | ||
| 65 | 62 | /* cycle counting and executing */ |
| 63 | int profiler; /* profiler tag */ | |
| 66 | 64 | int * icount; /* pointer to the icount */ |
| 67 | 65 | int cycles_running; /* number of cycles we are executing */ |
| 68 | 66 | int cycles_stolen; /* number of cycles we artificially stole */ |
| r3957 | r3958 | |
| 90 | 88 | UINT32 cycles_per_second; /* cycles per second, adjusted for multipliers */ |
| 91 | 89 | attoseconds_t attoseconds_per_cycle; /* attoseconds per adjusted clock cycle */ |
| 92 | 90 | |
| 91 | /* internal state reflection */ | |
| 92 | const cpu_state_table *state; /* pointer to the base table */ | |
| 93 | const cpu_state_entry *regstate[MAX_REGS];/* pointer to the state entry for each register */ | |
| 94 | ||
| 93 | 95 | /* these below are hacks to support multiple interrupts per frame */ |
| 94 | 96 | INT32 iloops; /* number of interrupts remaining this frame */ |
| 95 | 97 | emu_timer * partial_frame_timer; /* the timer that triggers partial frame interrupts */ |
| r3957 | r3958 | |
| 111 | 113 | FUNCTION PROTOTYPES |
| 112 | 114 | ***************************************************************************/ |
| 113 | 115 | |
| 114 | static void cpuexec_exit(running_machine *machine); | |
| 115 | static void cpuexec_reset(running_machine *machine); | |
| 116 | ||
| 117 | static void cpu_timers_init(running_machine *machine); | |
| 118 | 116 | static void update_clock_information(const device_config *device); |
| 119 | 117 | static void compute_perfect_interleave(running_machine *machine); |
| 120 | 118 | static void on_vblank(const device_config *device, void *param, int vblank_state); |
| r3957 | r3958 | |
| 124 | 122 | static TIMER_CALLBACK( empty_event_queue ); |
| 125 | 123 | static IRQ_CALLBACK( standard_irq_callback ); |
| 126 | 124 | static void register_save_states(const device_config *device); |
| 125 | static UINT64 get_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry); | |
| 126 | static void set_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, UINT64 value); | |
| 127 | static void get_register_string_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *dest); | |
| 128 | #ifdef UNUSED_FUNCTION | |
| 129 | static int get_register_string_max_width(const device_config *device, void *baseptr, const cpu_state_entry *entry); | |
| 130 | #endif | |
| 127 | 131 | |
| 128 | 132 | |
| 129 | ||
| 130 | 133 | /*************************************************************************** |
| 131 | 134 | INLINE FUNCTIONS |
| 132 | 135 | ***************************************************************************/ |
| 133 | 136 | |
| 134 | 137 | /*------------------------------------------------- |
| 135 | get_safe_classtoken - makes sure that the | |
| 136 | passed in device is, in fact, a CPU, and | |
| 137 | return the class token | |
| 138 | get_class_data - return a pointer to the | |
| 139 | class data | |
| 138 | 140 | -------------------------------------------------*/ |
| 139 | 141 | |
| 140 | INLINE cpu_class_data *get_ | |
| 142 | INLINE cpu_class_data *get_ | |
| 141 | 143 | { |
| 142 | 144 | assert(device != NULL); |
| 143 | assert(device->classtoken != NULL); | |
| 144 | 145 | assert(device->class == DEVICE_CLASS_CPU_CHIP); |
| 146 | assert(device->token != NULL); | |
| 147 | return (cpu_class_data *)cpu_get_class_header(device) - 1; | |
| 148 | } | |
| 145 | 149 | |
| 146 | return (cpu_class_data *)device->classtoken; | |
| 150 | ||
| 151 | /*------------------------------------------------- | |
| 152 | get_minimum_quantum - return the minimum | |
| 153 | quantum required for a given CPU device | |
| 154 | -------------------------------------------------*/ | |
| 155 | ||
| 156 | INLINE attoseconds_t get_minimum_quantum(const device_config *device) | |
| 157 | { | |
| 158 | attoseconds_t basetick = 0; | |
| 159 | ||
| 160 | /* fetch the base clock from the classdata if present */ | |
| 161 | if (device->token != NULL) | |
| 162 | basetick = get_class_data(device)->attoseconds_per_cycle; | |
| 163 | ||
| 164 | /* otherwise compute it from the raw data */ | |
| 165 | if (basetick == 0) | |
| 166 | { | |
| 167 | UINT32 baseclock = (UINT64)device->clock * cpu_get_clock_multiplier(device) / cpu_get_clock_divider(device); | |
| 168 | basetick = HZ_TO_ATTOSECONDS(baseclock); | |
| 169 | } | |
| 170 | ||
| 171 | /* apply the minimum cycle count */ | |
| 172 | return basetick * cpu_get_min_cycles(device); | |
| 147 | 173 | } |
| 148 | 174 | |
| 149 | 175 | |
| r3957 | r3958 | |
| 154 | 180 | |
| 155 | 181 | INLINE void suspend_until_trigger(const device_config *device, int trigger, int eatcycles) |
| 156 | 182 | { |
| 157 | cpu_class_data *classdata = get_ | |
| 183 | cpu_class_data *classdata = get_ | |
| 158 | 184 | |
| 159 | 185 | /* suspend the CPU immediately if it's not already */ |
| 160 | 186 | cpu_suspend(device, SUSPEND_REASON_TRIGGER, eatcycles); |
| r3957 | r3958 | |
| 170 | 196 | ***************************************************************************/ |
| 171 | 197 | |
| 172 | 198 | /*------------------------------------------------- |
| 173 | cpuexec_create_cpu_device - temporary | |
| 174 | function to allocate a fake CPU device for | |
| 175 | each CPU | |
| 176 | -------------------------------------------------*/ | |
| 177 | ||
| 178 | static DEVICE_GET_INFO( cpuclass ) | |
| 179 | { | |
| 180 | cpu_class_data *classdata = device->classtoken; | |
| 181 | (*classdata->header.get_info)(device, state, (cpuinfo *)info); | |
| 182 | } | |
| 183 | ||
| 184 | const device_config *cpuexec_create_cpu_device(const cpu_config *config) | |
| 185 | { | |
| 186 | device_config *device; | |
| 187 | ||
| 188 | /* create a fake device for the CPU -- this will be done automatically in the future */ | |
| 189 | device = malloc_or_die(sizeof(*device) + strlen(config->tag)); | |
| 190 | memset(device, 0, sizeof(*device)); | |
| 191 | strcpy(device->tag, config->tag); | |
| 192 | device->type = DEVICE_GET_INFO_NAME(cpuclass); | |
| 193 | device->class = DEVICE_CLASS_CPU_CHIP; | |
| 194 | device->inline_config = (void *)config; | |
| 195 | device->static_config = config->reset_param; | |
| 196 | ||
| 197 | return device; | |
| 198 | } | |
| 199 | ||
| 200 | ||
| 201 | /*------------------------------------------------- | |
| 202 | 199 | cpuexec_init - initialize internal states of |
| 203 | 200 | all CPUs |
| 204 | 201 | -------------------------------------------------*/ |
| 205 | 202 | |
| 206 | 203 | void cpuexec_init(running_machine *machine) |
| 207 | 204 | { |
| 208 | | |
| 205 | a | |
| 209 | 206 | |
| 210 | 207 | /* allocate global state */ |
| 211 | 208 | machine->cpuexec_data = auto_malloc(sizeof(*machine->cpuexec_data)); |
| 212 | 209 | memset(machine->cpuexec_data, 0, sizeof(*machine->cpuexec_data)); |
| 213 | 210 | |
| 214 | /* loop over all our CPUs */ | |
| 215 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->config->cpu); cpunum++) | |
| 216 | if (machine->cpu[cpunum] != NULL) | |
| 217 | { | |
| 218 | device_config *device = (device_config *)machine->cpu[cpunum]; | |
| 219 | const cpu_config *config = device->inline_config; | |
| 220 | cpu_type cputype = config->type; | |
| 221 | cpu_class_data *classdata; | |
| 222 | int num_regs; | |
| 223 | int line; | |
| 211 | /* set the core scheduling quantum */ | |
| 212 | min_quantum = machine->config->minimum_quantum; | |
| 213 | if (attotime_compare(min_quantum, attotime_zero) == 0) | |
| 214 | min_quantum = ATTOTIME_IN_HZ(60); | |
| 215 | if (machine->config->perfect_cpu_quantum != NULL) | |
| 216 | { | |
| 217 | const device_config *cpu = cputag_get_cpu(machine, machine->config->perfect_cpu_quantum); | |
| 218 | attotime cpu_quantum; | |
| 224 | 219 | |
| 225 | /* allocate memory for our class state */ | |
| 226 | classdata = auto_malloc(sizeof(*classdata)); | |
| 227 | memset(classdata, 0, sizeof(*classdata)); | |
| 228 | ||
| 229 | /* fill in the header */ | |
| 230 | classdata->header = *cputype_get_header_template(cputype); | |
| 231 | ||
| 232 | /* make the device run */ | |
| 233 | device->started = FALSE; | |
| 234 | device->machine = machine; | |
| 235 | device->region = memory_region(machine, device->tag); | |
| 236 | device->regionbytes = memory_region_length(machine, device->tag); | |
| 237 | device->token = auto_malloc(cputype_get_context_size(cputype)); | |
| 238 | memset(device->token, 0, cputype_get_context_size(cputype)); | |
| 239 | device->classtoken = classdata; | |
| 240 | ||
| 241 | /* fill in the input states and IRQ callback information */ | |
| 242 | for (line = 0; line < ARRAY_LENGTH(classdata->input); line++) | |
| 243 | { | |
| 244 | cpu_input_data *inputline = &classdata->input[line]; | |
| 245 | /* vector and curvector are initialized later */ | |
| 246 | inputline->curstate = CLEAR_LINE; | |
| 247 | inputline->qindex = 0; | |
| 248 | } | |
| 249 | ||
| 250 | /* fill in the suspend states */ | |
| 251 | classdata->suspend = SUSPEND_REASON_RESET; | |
| 252 | classdata->inttrigger = cpunum + TRIGGER_INT; | |
| 253 | ||
| 254 | /* fill in the clock and timing information */ | |
| 255 | classdata->clock = (UINT64)config->clock * classdata->header.clock_multiplier / classdata->header.clock_divider; | |
| 256 | classdata->clockscale = 1.0; | |
| 257 | ||
| 258 | /* allocate timers if we need them */ | |
| 259 | if (config->vblank_interrupts_per_frame > 1) | |
| 260 | classdata->partial_frame_timer = timer_alloc(machine, trigger_partial_frame_interrupt, device); | |
| 261 | if (config->timed_interrupt_period != 0) | |
| 262 | classdata->timedint_timer = timer_alloc(machine, trigger_periodic_interrupt, device); | |
| 263 | ||
| 264 | /* initialize this CPU */ | |
| 265 | num_regs = state_save_get_reg_count(machine); | |
| 266 | cpu_init(device, cpunum, classdata->clock, standard_irq_callback); | |
| 267 | num_regs = state_save_get_reg_count(machine) - num_regs; | |
| 268 | ||
| 269 | /* fetch post-initialization data */ | |
| 270 | classdata->icount = cpu_get_icount_ptr(device); | |
| 271 | for (line = 0; line < ARRAY_LENGTH(classdata->input); line++) | |
| 272 | { | |
| 273 | cpu_input_data *inputline = &classdata->input[line]; | |
| 274 | inputline->vector = cpu_get_default_irq_vector(device); | |
| 275 | inputline->curvector = inputline->vector; | |
| 276 | } | |
| 277 | update_clock_information(device); | |
| 278 | ||
| 279 | /* if no state registered for saving, we can't save */ | |
| 280 | if (num_regs == 0) | |
| 281 | { | |
| 282 | logerror("CPU #%d (%s) did not register any state to save!\n", cpunum, cputype_get_name(cputype)); | |
| 283 | if (machine->gamedrv->flags & GAME_SUPPORTS_SAVE) | |
| 284 | fatalerror("CPU #%d (%s) did not register any state to save!", cpunum, cputype_get_name(cputype)); | |
| 285 | } | |
| 286 | ||
| 287 | /* register some internal states as well */ | |
| 288 | register_save_states(device); | |
| 289 | } | |
| 290 | ||
| 291 | add_reset_callback(machine, cpuexec_reset); | |
| 292 | add_exit_callback(machine, cpuexec_exit); | |
| 220 | if (cpu == NULL) | |
| 221 | fatalerror("CPU '%s' specified for perfect interleave is not present!", machine->config->perfect_cpu_quantum); | |
| 222 | cpu_quantum = attotime_make(0, get_minimum_quantum(cpu)); | |
| 223 | min_quantum = attotime_min(cpu_quantum, min_quantum); | |
| 224 | } | |
| 225 | assert(min_quantum.seconds == 0); | |
| 226 | timer_add_scheduling_quantum(machine, min_quantum.attoseconds, attotime_never); | |
| 293 | 227 | } |
| 294 | 228 | |
| 295 | 229 | |
| 296 | 230 | /*------------------------------------------------- |
| 297 | cpuexec_reset - reset CPU states on a soft | |
| 298 | reset | |
| 299 | -------------------------------------------------*/ | |
| 300 | ||
| 301 | static void cpuexec_reset(running_machine *machine) | |
| 302 | { | |
| 303 | int cpunum; | |
| 304 | ||
| 305 | /* initialize the various timers */ | |
| 306 | cpu_timers_init(machine); | |
| 307 | ||
| 308 | /* first pass over CPUs */ | |
| 309 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 310 | if (machine->cpu[cpunum] != NULL) | |
| 311 | { | |
| 312 | const device_config *device = machine->cpu[cpunum]; | |
| 313 | const cpu_config *config = device->inline_config; | |
| 314 | cpu_class_data *classdata = device->classtoken; | |
| 315 | int line; | |
| 316 | ||
| 317 | /* enable all CPUs (except for disabled CPUs) */ | |
| 318 | if (!(config->flags & CPU_DISABLE)) | |
| 319 | cpu_resume(device, SUSPEND_ANY_REASON); | |
| 320 | else | |
| 321 | cpu_suspend(device, SUSPEND_REASON_DISABLE, 1); | |
| 322 | ||
| 323 | /* reset the total number of cycles */ | |
| 324 | classdata->totalcycles = 0; | |
| 325 | ||
| 326 | /* then reset the CPU directly */ | |
| 327 | cpu_reset(device); | |
| 328 | ||
| 329 | /* reset the interrupt vectors and queues */ | |
| 330 | for (line = 0; line < ARRAY_LENGTH(classdata->input); line++) | |
| 331 | { | |
| 332 | cpu_input_data *inputline = &classdata->input[line]; | |
| 333 | inputline->vector = cpu_get_default_irq_vector(device); | |
| 334 | inputline->qindex = 0; | |
| 335 | } | |
| 336 | } | |
| 337 | } | |
| 338 | ||
| 339 | ||
| 340 | /*------------------------------------------------- | |
| 341 | cpuexec_exit - cleanup all CPUs on exit | |
| 342 | -------------------------------------------------*/ | |
| 343 | ||
| 344 | static void cpuexec_exit(running_machine *machine) | |
| 345 | { | |
| 346 | int cpunum; | |
| 347 | ||
| 348 | /* shut down the CPU cores */ | |
| 349 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 350 | if (machine->cpu[cpunum] != NULL) | |
| 351 | cpu_exit(machine->cpu[cpunum]); | |
| 352 | } | |
| 353 | ||
| 354 | ||
| 355 | /*------------------------------------------------- | |
| 356 | 231 | cpuexec_timeslice - execute all CPUs for a |
| 357 | 232 | single timeslice |
| 358 | 233 | -------------------------------------------------*/ |
| r3957 | r3958 | |
| 363 | 238 | cpuexec_private *global = machine->cpuexec_data; |
| 364 | 239 | attotime target = timer_next_fire_time(machine); |
| 365 | 240 | attotime base = timer_get_time(machine); |
| 366 | int cpunum, ran; | |
| 241 | const device_config *cpu; | |
| 242 | int ran; | |
| 367 | 243 | |
| 368 | 244 | LOG(("------------------\n")); |
| 369 | 245 | LOG(("cpu_timeslice: target = %s\n", attotime_string(target, 9))); |
| 370 | 246 | |
| 371 | 247 | /* apply pending suspension changes */ |
| 372 | for (cpu | |
| 248 | for (cpu | |
| 373 | 249 | { |
| 374 | cpu_class_data *classdata = | |
| 250 | cpu_class_data *classdata = g | |
| 375 | 251 | classdata->suspend = classdata->nextsuspend; |
| 376 | 252 | classdata->nextsuspend &= ~SUSPEND_REASON_TIMESLICE; |
| 377 | 253 | classdata->eatcycles = classdata->nexteatcycles; |
| 378 | 254 | } |
| 379 | 255 | |
| 380 | 256 | /* loop over non-suspended CPUs */ |
| 381 | for (cpu | |
| 257 | for (cpu | |
| 382 | 258 | { |
| 383 | const device_config *cpu = machine->cpu[cpunum]; | |
| 384 | cpu_class_data *classdata = cpu->classtoken; | |
| 259 | cpu_class_data *classdata = get_class_data(cpu); | |
| 385 | 260 | if (classdata->suspend == 0) |
| 386 | 261 | { |
| 387 | 262 | attotime delta = attotime_sub(target, classdata->localtime); |
| r3957 | r3958 | |
| 389 | 264 | { |
| 390 | 265 | /* compute how long to run */ |
| 391 | 266 | classdata->cycles_running = div_64x32(delta.attoseconds >> classdata->divshift, classdata->divisor); |
| 392 | LOG((" cpu % | |
| 267 | LOG((" cpu '%s': %d cycles\n", cpu->tag, classdata->cycles_running)); | |
| 393 | 268 | |
| 394 | profiler_mark( | |
| 269 | profiler_mark( | |
| 395 | 270 | |
| 396 | 271 | /* note that this global variable cycles_stolen can be modified */ |
| 397 | /* via the call to | |
| 272 | /* via the call to | |
| 398 | 273 | classdata->cycles_stolen = 0; |
| 399 | 274 | global->executingcpu = cpu; |
| 400 | 275 | if (!call_debugger) |
| r3957 | r3958 | |
| 431 | 306 | global->executingcpu = NULL; |
| 432 | 307 | |
| 433 | 308 | /* update the local times of all CPUs */ |
| 434 | for (cpu | |
| 309 | for (cpu | |
| 435 | 310 | { |
| 436 | cpu_class_data *classdata = | |
| 311 | cpu_class_data *classdata = g | |
| 437 | 312 | |
| 438 | 313 | /* if we're suspended and counting, process */ |
| 439 | 314 | if (classdata->suspend != 0 && classdata->eatcycles && attotime_compare(classdata->localtime, target) < 0) |
| r3957 | r3958 | |
| 442 | 317 | |
| 443 | 318 | /* compute how long to run */ |
| 444 | 319 | classdata->cycles_running = div_64x32(delta.attoseconds >> classdata->divshift, classdata->divisor); |
| 445 | LOG((" cpu % | |
| 320 | LOG((" cpu '%s': %d cycles (suspended)\n", cpu->tag, classdata->cycles_running)); | |
| 446 | 321 | |
| 447 | 322 | classdata->totalcycles += classdata->cycles_running; |
| 448 | 323 | classdata->localtime = attotime_add_attoseconds(classdata->localtime, classdata->cycles_running * classdata->attoseconds_per_cycle); |
| r3957 | r3958 | |
| 459 | 334 | } |
| 460 | 335 | |
| 461 | 336 | |
| 462 | ||
| 463 | /*************************************************************************** | |
| 464 | GLOBAL HELPERS | |
| 465 | ***************************************************************************/ | |
| 466 | ||
| 467 | 337 | /*------------------------------------------------- |
| 468 | cputag_get_cpu - return a pointer to the given | |
| 469 | CPU by tag | |
| 338 | cpuexec_boost_interleave - temporarily boosts | |
| 339 | the interleave factor | |
| 470 | 340 | -------------------------------------------------*/ |
| 471 | 341 | |
| 472 | ||
| 342 | ||
| 473 | 343 | { |
| 474 | int cpunum; | |
| 344 | /* ignore timeslices > 1 second */ | |
| 345 | if (timeslice_time.seconds > 0) | |
| 346 | return; | |
| 347 | timer_add_scheduling_quantum(machine, timeslice_time.attoseconds, boost_duration); | |
| 348 | } | |
| 475 | 349 | |
| 476 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 477 | if (machine->cpu[cpunum] != NULL && strcmp(tag, machine->cpu[cpunum]->tag) == 0) | |
| 478 | return machine->cpu[cpunum]; | |
| 479 | 350 | |
| 480 | return NULL; | |
| 481 | } | |
| 482 | 351 | |
| 352 | /*************************************************************************** | |
| 353 | GLOBAL HELPERS | |
| 354 | ***************************************************************************/ | |
| 483 | 355 | |
| 484 | 356 | /*------------------------------------------------- |
| 485 | cpuexec_boost_interleave - temporarily boosts | |
| 486 | the interleave factor | |
| 357 | cpuexec_abort_timeslice - abort execution | |
| 358 | for the current timeslice | |
| 487 | 359 | -------------------------------------------------*/ |
| 488 | 360 | |
| 489 | void cpuexec_bo | |
| 361 | void cpuexec_abor | |
| 490 | 362 | { |
| 491 | /* ignore timeslices > 1 second */ | |
| 492 | if (timeslice_time.seconds > 0) | |
| 493 | return; | |
| 494 | timer_add_scheduling_quantum(machine, timeslice_time.attoseconds, boost_duration); | |
| 363 | const device_config *executingcpu = machine->cpuexec_data->executingcpu; | |
| 364 | if (executingcpu != NULL) | |
| 365 | cpu_abort_timeslice(executingcpu); | |
| 495 | 366 | } |
| 496 | 367 | |
| 497 | 368 | |
| r3957 | r3958 | |
| 518 | 389 | |
| 519 | 390 | |
| 520 | 391 | /*************************************************************************** |
| 392 | VIDEO SCREEN DEVICE INTERFACE | |
| 393 | ***************************************************************************/ | |
| 394 | ||
| 395 | /*------------------------------------------------- | |
| 396 | device_start_cpu - device start callback | |
| 397 | -------------------------------------------------*/ | |
| 398 | ||
| 399 | static DEVICE_START( cpu ) | |
| 400 | { | |
| 401 | int index = cpu_get_index(device); | |
| 402 | cpu_class_header *header; | |
| 403 | cpu_class_data *classdata; | |
| 404 | const cpu_config *config; | |
| 405 | cpu_init_func init; | |
| 406 | int spacenum, line; | |
| 407 | int num_regs; | |
| 408 | ||
| 409 | /* validate some basic stuff */ | |
| 410 | assert(device != NULL); | |
| 411 | assert(device->inline_config != NULL); | |
| 412 | assert(device->machine != NULL); | |
| 413 | assert(device->machine->config != NULL); | |
| 414 | ||
| 415 | /* get pointers to our data */ | |
| 416 | config = device->inline_config; | |
| 417 | header = cpu_get_class_header(device); | |
| 418 | classdata = get_class_data(device); | |
| 419 | ||
| 420 | /* add ourself to the global array */ | |
| 421 | if (index < ARRAY_LENGTH(device->machine->cpu)) | |
| 422 | device->machine->cpu[index] = device; | |
| 423 | ||
| 424 | /* build the header */ | |
| 425 | header->debug = NULL; | |
| 426 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) | |
| 427 | header->space[spacenum] = memory_find_address_space(device, spacenum); | |
| 428 | ||
| 429 | header->set_info = (cpu_set_info_func)device_get_info_fct(device, CPUINFO_FCT_SET_INFO); | |
| 430 | header->execute = (cpu_execute_func)device_get_info_fct(device, CPUINFO_FCT_EXECUTE); | |
| 431 | header->burn = (cpu_burn_func)device_get_info_fct(device, CPUINFO_FCT_BURN); | |
| 432 | header->translate = (cpu_translate_func)device_get_info_fct(device, CPUINFO_FCT_TRANSLATE); | |
| 433 | header->disassemble = (cpu_disassemble_func)device_get_info_fct(device, CPUINFO_FCT_DISASSEMBLE); | |
| 434 | header->dasm_override = NULL; | |
| 435 | ||
| 436 | /* fill in the input states and IRQ callback information */ | |
| 437 | for (line = 0; line < ARRAY_LENGTH(classdata->input); line++) | |
| 438 | { | |
| 439 | cpu_input_data *inputline = &classdata->input[line]; | |
| 440 | /* vector and curvector are initialized later */ | |
| 441 | inputline->curstate = CLEAR_LINE; | |
| 442 | inputline->qindex = 0; | |
| 443 | } | |
| 444 | ||
| 445 | /* fill in the suspend states */ | |
| 446 | classdata->profiler = index + PROFILER_CPU1; | |
| 447 | classdata->suspend = SUSPEND_REASON_RESET; | |
| 448 | classdata->inttrigger = index + TRIGGER_INT; | |
| 449 | ||
| 450 | /* fill in the clock and timing information */ | |
| 451 | classdata->clock = (UINT64)device->clock * cpu_get_clock_multiplier(device) / cpu_get_clock_divider(device); | |
| 452 | classdata->clockscale = 1.0; | |
| 453 | ||
| 454 | /* allocate timers if we need them */ | |
| 455 | if (config->vblank_interrupts_per_frame > 1) | |
| 456 | classdata->partial_frame_timer = timer_alloc(device->machine, trigger_partial_frame_interrupt, (void *)device); | |
| 457 | if (config->timed_interrupt_period != 0) | |
| 458 | classdata->timedint_timer = timer_alloc(device->machine, trigger_periodic_interrupt, (void *)device); | |
| 459 | ||
| 460 | /* initialize this CPU */ | |
| 461 | num_regs = state_save_get_reg_count(device->machine); | |
| 462 | init = (cpu_init_func)device_get_info_fct(device, CPUINFO_FCT_INIT); | |
| 463 | (*init)(device, standard_irq_callback); | |
| 464 | num_regs = state_save_get_reg_count(device->machine) - num_regs; | |
| 465 | ||
| 466 | /* fetch post-initialization data */ | |
| 467 | classdata->icount = cpu_get_icount_ptr(device); | |
| 468 | for (line = 0; line < ARRAY_LENGTH(classdata->input); line++) | |
| 469 | { | |
| 470 | cpu_input_data *inputline = &classdata->input[line]; | |
| 471 | inputline->vector = cpu_get_default_irq_vector(device); | |
| 472 | inputline->curvector = inputline->vector; | |
| 473 | } | |
| 474 | update_clock_information(device); | |
| 475 | ||
| 476 | /* fetch information about the CPU states */ | |
| 477 | classdata->state = cpu_get_state_table(device); | |
| 478 | if (classdata->state != NULL) | |
| 479 | { | |
| 480 | int stateindex; | |
| 481 | ||
| 482 | /* loop over all states specified, and work with any that apply */ | |
| 483 | for (stateindex = 0; stateindex < classdata->state->entrycount; stateindex++) | |
| 484 | { | |
| 485 | const cpu_state_entry *entry = &classdata->state->entrylist[stateindex]; | |
| 486 | if (entry->validmask == 0 || (entry->validmask & classdata->state->subtypemask) != 0) | |
| 487 | { | |
| 488 | assert(entry->index < MAX_REGS); | |
| 489 | assert(classdata->regstate[entry->index] == NULL); | |
| 490 | classdata->regstate[entry->index] = entry; | |
| 491 | } | |
| 492 | } | |
| 493 | } | |
| 494 | ||
| 495 | /* if no state registered for saving, we can't save */ | |
| 496 | if (num_regs == 0) | |
| 497 | { | |
| 498 | logerror("CPU '%s' did not register any state to save!\n", cpu_get_name(device)); | |
| 499 | if (device->machine->gamedrv->flags & GAME_SUPPORTS_SAVE) | |
| 500 | fatalerror("CPU '%s' did not register any state to save!", cpu_get_name(device)); | |
| 501 | } | |
| 502 | ||
| 503 | /* register some internal states as well */ | |
| 504 | register_save_states(device); | |
| 505 | ||
| 506 | return DEVICE_START_OK; | |
| 507 | } | |
| 508 | ||
| 509 | ||
| 510 | /*------------------------------------------------- | |
| 511 | device_reset_cpu - device reset callback | |
| 512 | -------------------------------------------------*/ | |
| 513 | ||
| 514 | static DEVICE_RESET( cpu ) | |
| 515 | { | |
| 516 | cpu_class_data *classdata = get_class_data(device); | |
| 517 | const cpu_config *config = device->inline_config; | |
| 518 | cpu_reset_func reset; | |
| 519 | int line; | |
| 520 | ||
| 521 | /* enable all CPUs (except for disabled CPUs) */ | |
| 522 | if (!(config->flags & CPU_DISABLE)) | |
| 523 | cpu_resume(device, SUSPEND_ANY_REASON); | |
| 524 | else | |
| 525 | cpu_suspend(device, SUSPEND_REASON_DISABLE, 1); | |
| 526 | ||
| 527 | /* reset the total number of cycles */ | |
| 528 | classdata->totalcycles = 0; | |
| 529 | ||
| 530 | /* then reset the CPU directly */ | |
| 531 | reset = (cpu_reset_func)device_get_info_fct(device, CPUINFO_FCT_RESET); | |
| 532 | if (reset != NULL) | |
| 533 | (*reset)(device); | |
| 534 | ||
| 535 | /* reset the interrupt vectors and queues */ | |
| 536 | for (line = 0; line < ARRAY_LENGTH(classdata->input); line++) | |
| 537 | { | |
| 538 | cpu_input_data *inputline = &classdata->input[line]; | |
| 539 | inputline->vector = cpu_get_default_irq_vector(device); | |
| 540 | inputline->qindex = 0; | |
| 541 | } | |
| 542 | ||
| 543 | /* reconfingure VBLANK interrupts */ | |
| 544 | if (config->vblank_interrupts_per_frame > 0 || config->vblank_interrupt_screen != NULL) | |
| 545 | { | |
| 546 | const device_config *screen; | |
| 547 | ||
| 548 | /* get the screen that will trigger the VBLANK */ | |
| 549 | ||
| 550 | /* new style - use screen tag directly */ | |
| 551 | if (config->vblank_interrupt_screen != NULL) | |
| 552 | screen = devtag_get_device(device->machine, VIDEO_SCREEN, config->vblank_interrupt_screen); | |
| 553 | ||
| 554 | /* old style 'hack' setup - use screen #0 */ | |
| 555 | else | |
| 556 | screen = video_screen_first(device->machine->config); | |
| 557 | ||
| 558 | assert(screen != NULL); | |
| 559 | video_screen_register_vblank_callback(screen, on_vblank, NULL); | |
| 560 | } | |
| 561 | ||
| 562 | /* reconfigure periodic interrupts */ | |
| 563 | if (config->timed_interrupt_period != 0) | |
| 564 | { | |
| 565 | attotime timedint_period = UINT64_ATTOTIME_TO_ATTOTIME(config->timed_interrupt_period); | |
| 566 | assert(classdata->timedint_timer != NULL); | |
| 567 | timer_adjust_periodic(classdata->timedint_timer, timedint_period, 0, timedint_period); | |
| 568 | } | |
| 569 | } | |
| 570 | ||
| 571 | ||
| 572 | /*------------------------------------------------- | |
| 573 | device_stop_cpu - device stop callback | |
| 574 | -------------------------------------------------*/ | |
| 575 | ||
| 576 | static DEVICE_STOP( cpu ) | |
| 577 | { | |
| 578 | cpu_exit_func exit; | |
| 579 | ||
| 580 | /* call the CPU's exit function if present */ | |
| 581 | exit = (cpu_exit_func)device_get_info_fct(device, CPUINFO_FCT_EXIT); | |
| 582 | if (exit != NULL) | |
| 583 | (*exit)(device); | |
| 584 | } | |
| 585 | ||
| 586 | ||
| 587 | /*------------------------------------------------- | |
| 588 | cpu_set_info - device set info callback | |
| 589 | -------------------------------------------------*/ | |
| 590 | ||
| 591 | static DEVICE_SET_INFO( cpu ) | |
| 592 | { | |
| 593 | cpu_class_header *header = cpu_get_class_header(device); | |
| 594 | cpu_set_info_func set_info; | |
| 595 | cpuinfo cinfo; | |
| 596 | ||
| 597 | /* if we are live and have a header, save ourself a call */ | |
| 598 | if (header != NULL) | |
| 599 | set_info = header->set_info; | |
| 600 | else | |
| 601 | set_info = (cpu_set_info_func)device_get_info_fct(device, CPUINFO_FCT_SET_INFO); | |
| 602 | ||
| 603 | switch (state) | |
| 604 | { | |
| 605 | /* no parameters to set */ | |
| 606 | ||
| 607 | default: | |
| 608 | /* if we have a state pointer, we can handle some stuff for free */ | |
| 609 | if (device->token != NULL) | |
| 610 | { | |
| 611 | const cpu_class_data *classdata = get_class_data(device); | |
| 612 | if (classdata->state != NULL) | |
| 613 | { | |
| 614 | if (state >= CPUINFO_INT_REGISTER && state <= CPUINFO_INT_REGISTER_LAST) | |
| 615 | { | |
| 616 | set_register_value(device, classdata->state->baseptr, classdata->regstate[state - CPUINFO_INT_REGISTER], info->i); | |
| 617 | return; | |
| 618 | } | |
| 619 | } | |
| 620 | } | |
| 621 | ||
| 622 | /* integer data */ | |
| 623 | if (state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST) | |
| 624 | { | |
| 625 | cinfo.i = info->i; | |
| 626 | (*set_info)(device, state, &cinfo); | |
| 627 | } | |
| 628 | ||
| 629 | /* pointer data */ | |
| 630 | else if ((state >= DEVINFO_PTR_FIRST && state <= DEVINFO_PTR_LAST) || | |
| 631 | (state >= DEVINFO_FCT_FIRST && state <= DEVINFO_FCT_LAST) || | |
| 632 | (state >= DEVINFO_STR_FIRST && state <= DEVINFO_STR_LAST)) | |
| 633 | { | |
| 634 | cinfo.p = info->p; | |
| 635 | (*set_info)(device, state, &cinfo); | |
| 636 | } | |
| 637 | break; | |
| 638 | } | |
| 639 | } | |
| 640 | ||
| 641 | ||
| 642 | /*------------------------------------------------- | |
| 643 | cpu_get_info - device get info | |
| 644 | callback | |
| 645 | -------------------------------------------------*/ | |
| 646 | ||
| 647 | DEVICE_GET_INFO( cpu ) | |
| 648 | { | |
| 649 | const cpu_config *config = (device != NULL) ? device->inline_config : NULL; | |
| 650 | cpuinfo cinfo = { 0 }; | |
| 651 | ||
| 652 | switch (state) | |
| 653 | { | |
| 654 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 655 | case DEVINFO_INT_TOKEN_BYTES: | |
| 656 | cinfo.i = 0; | |
| 657 | (*config->type)(device, CPUINFO_INT_CONTEXT_SIZE, &cinfo); | |
| 658 | info->i = cinfo.i + sizeof(cpu_class_data) + sizeof(cpu_class_header); | |
| 659 | break; | |
| 660 | ||
| 661 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(cpu_config); break; | |
| 662 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_CPU_CHIP; break; | |
| 663 | ||
| 664 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 665 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(cpu); break; | |
| 666 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cpu); break; | |
| 667 | case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME(cpu); break; | |
| 668 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cpu); break; | |
| 669 | ||
| 670 | default: | |
| 671 | /* if we have a state pointer, we can handle some stuff for free */ | |
| 672 | if (device->token != NULL) | |
| 673 | { | |
| 674 | const cpu_class_data *classdata = get_class_data(device); | |
| 675 | if (classdata->state != NULL) | |
| 676 | { | |
| 677 | if (state >= CPUINFO_INT_REGISTER && state <= CPUINFO_INT_REGISTER_LAST) | |
| 678 | { | |
| 679 | info->i = get_register_value(device, classdata->state->baseptr, classdata->regstate[state - CPUINFO_INT_REGISTER]); | |
| 680 | return; | |
| 681 | } | |
| 682 | else if (state >= CPUINFO_STR_REGISTER && state <= CPUINFO_STR_REGISTER_LAST) | |
| 683 | { | |
| 684 | cinfo.s = info->s; | |
| 685 | get_register_string_value(device, classdata->state->baseptr, classdata->regstate[state - CPUINFO_STR_REGISTER], cinfo.s); | |
| 686 | info->s = cinfo.s; | |
| 687 | return; | |
| 688 | } | |
| 689 | } | |
| 690 | } | |
| 691 | ||
| 692 | /* integer data */ | |
| 693 | if (state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST) | |
| 694 | { | |
| 695 | cinfo.i = info->i; | |
| 696 | (*config->type)(device, state, &cinfo); | |
| 697 | info->i = cinfo.i; | |
| 698 | } | |
| 699 | ||
| 700 | /* pointer data */ | |
| 701 | else if ((state >= DEVINFO_PTR_FIRST && state <= DEVINFO_PTR_LAST) || | |
| 702 | (state >= DEVINFO_FCT_FIRST && state <= DEVINFO_FCT_LAST) || | |
| 703 | (state >= DEVINFO_STR_FIRST && state <= DEVINFO_STR_LAST)) | |
| 704 | { | |
| 705 | cinfo.p = info->p; | |
| 706 | (*config->type)(device, state, &cinfo); | |
| 707 | info->p = cinfo.p; | |
| 708 | } | |
| 709 | break; | |
| 710 | } | |
| 711 | } | |
| 712 | ||
| 713 | ||
| 714 | ||
| 715 | /*************************************************************************** | |
| 521 | 716 | CPU SCHEDULING |
| 522 | 717 | ***************************************************************************/ |
| 523 | 718 | |
| r3957 | r3958 | |
| 528 | 723 | |
| 529 | 724 | void cpu_suspend(const device_config *device, int reason, int eatcycles) |
| 530 | 725 | { |
| 531 | cpu_class_data *classdata = get_ | |
| 726 | cpu_class_data *classdata = get_ | |
| 532 | 727 | |
| 533 | 728 | /* set the suspend reason and eat cycles flag */ |
| 534 | 729 | classdata->nextsuspend |= reason; |
| r3957 | r3958 | |
| 546 | 741 | |
| 547 | 742 | void cpu_resume(const device_config *device, int reason) |
| 548 | 743 | { |
| 549 | cpu_class_data *classdata = get_ | |
| 744 | cpu_class_data *classdata = get_ | |
| 550 | 745 | |
| 551 | 746 | /* clear the suspend reason and eat cycles flag */ |
| 552 | 747 | classdata->nextsuspend &= ~reason; |
| r3957 | r3958 | |
| 575 | 770 | |
| 576 | 771 | int cpu_is_suspended(const device_config *device, int reason) |
| 577 | 772 | { |
| 578 | cpu_class_data *classdata = get_ | |
| 773 | cpu_class_data *classdata = get_ | |
| 579 | 774 | |
| 580 | 775 | /* return true if the given reason is indicated */ |
| 581 | 776 | return ((classdata->nextsuspend & reason) != 0); |
| r3957 | r3958 | |
| 594 | 789 | |
| 595 | 790 | int cpu_get_clock(const device_config *device) |
| 596 | 791 | { |
| 597 | cpu_class_data *classdata | |
| 792 | cpu_class_data *classdata | |
| 598 | 793 | |
| 794 | /* if we haven't been started yet, compute it manually */ | |
| 795 | if (device->token == NULL) | |
| 796 | return (UINT64)device->clock * cpu_get_clock_multiplier(device) / cpu_get_clock_divider(device); | |
| 797 | ||
| 599 | 798 | /* return the current clock value */ |
| 799 | classdata = get_class_data(device); | |
| 600 | 800 | return classdata->clock; |
| 601 | 801 | } |
| 602 | 802 | |
| r3957 | r3958 | |
| 608 | 808 | |
| 609 | 809 | void cpu_set_clock(const device_config *device, int clock) |
| 610 | 810 | { |
| 611 | cpu_class_data *classdata = get_ | |
| 811 | cpu_class_data *classdata = get_ | |
| 612 | 812 | |
| 613 | 813 | /* set the clock and update the information */ |
| 614 | 814 | classdata->clock = clock; |
| r3957 | r3958 | |
| 623 | 823 | |
| 624 | 824 | double cpu_get_clockscale(const device_config *device) |
| 625 | 825 | { |
| 626 | cpu_class_data *classdata = get_ | |
| 826 | cpu_class_data *classdata = get_ | |
| 627 | 827 | |
| 628 | 828 | /* return the current clock scale factor */ |
| 629 | 829 | return classdata->clockscale; |
| r3957 | r3958 | |
| 637 | 837 | |
| 638 | 838 | void cpu_set_clockscale(const device_config *device, double clockscale) |
| 639 | 839 | { |
| 640 | cpu_class_data *classdata = get_ | |
| 840 | cpu_class_data *classdata = get_ | |
| 641 | 841 | |
| 642 | 842 | /* set the scale factor and update the information */ |
| 643 | 843 | classdata->clockscale = clockscale; |
| r3957 | r3958 | |
| 652 | 852 | |
| 653 | 853 | attotime cpu_clocks_to_attotime(const device_config *device, UINT64 clocks) |
| 654 | 854 | { |
| 655 | cpu_class_data *classdata = get_ | |
| 855 | cpu_class_data *classdata = get_ | |
| 656 | 856 | if (clocks < classdata->cycles_per_second) |
| 657 | 857 | return attotime_make(0, clocks * classdata->attoseconds_per_cycle); |
| 658 | 858 | else |
| r3957 | r3958 | |
| 671 | 871 | |
| 672 | 872 | UINT64 cpu_attotime_to_clocks(const device_config *device, attotime duration) |
| 673 | 873 | { |
| 674 | cpu_class_data *classdata = get_ | |
| 874 | cpu_class_data *classdata = get_ | |
| 675 | 875 | return mulu_32x32(duration.seconds, classdata->cycles_per_second) + (UINT64)duration.attoseconds * (UINT64)classdata->attoseconds_per_cycle; |
| 676 | 876 | } |
| 677 | 877 | |
| r3957 | r3958 | |
| 688 | 888 | |
| 689 | 889 | attotime cpu_get_local_time(const device_config *device) |
| 690 | 890 | { |
| 691 | cpu_class_data *classdata = get_ | |
| 891 | cpu_class_data *classdata = get_ | |
| 692 | 892 | attotime result; |
| 693 | 893 | |
| 694 | 894 | /* if we're active, add in the time from the current slice */ |
| r3957 | r3958 | |
| 725 | 925 | |
| 726 | 926 | UINT64 cpu_get_total_cycles(const device_config *device) |
| 727 | 927 | { |
| 728 | cpu_class_data *classdata = get_ | |
| 928 | cpu_class_data *classdata = get_ | |
| 729 | 929 | |
| 730 | 930 | if (device == device->machine->cpuexec_data->executingcpu) |
| 731 | 931 | return classdata->totalcycles + classdata->cycles_running - *classdata->icount; |
| r3957 | r3958 | |
| 741 | 941 | |
| 742 | 942 | void cpu_eat_cycles(const device_config *device, int cycles) |
| 743 | 943 | { |
| 744 | cpu_class_data *classdata = get_ | |
| 944 | cpu_class_data *classdata = get_ | |
| 745 | 945 | |
| 746 | 946 | /* ignore if not the executing CPU */ |
| 747 | 947 | if (device != device->machine->cpuexec_data->executingcpu) |
| r3957 | r3958 | |
| 760 | 960 | |
| 761 | 961 | void cpu_adjust_icount(const device_config *device, int delta) |
| 762 | 962 | { |
| 763 | cpu_class_data *classdata = get_ | |
| 963 | cpu_class_data *classdata = get_ | |
| 764 | 964 | |
| 765 | 965 | /* ignore if not the executing CPU */ |
| 766 | 966 | if (device != device->machine->cpuexec_data->executingcpu) |
| r3957 | r3958 | |
| 778 | 978 | |
| 779 | 979 | void cpu_abort_timeslice(const device_config *device) |
| 780 | 980 | { |
| 781 | cpu_class_data *classdata = get_ | |
| 981 | cpu_class_data *classdata = get_ | |
| 782 | 982 | int delta; |
| 783 | 983 | |
| 784 | 984 | /* ignore if not the executing CPU */ |
| r3957 | r3958 | |
| 796 | 996 | } |
| 797 | 997 | |
| 798 | 998 | |
| 799 | /*------------------------------------------------- | |
| 800 | cpuexec_abort_timeslice - abort execution | |
| 801 | for the current timeslice | |
| 802 | -------------------------------------------------*/ | |
| 803 | 999 | |
| 804 | void cpuexec_abort_timeslice(running_machine *machine) | |
| 805 | { | |
| 806 | const device_config *executingcpu = machine->cpuexec_data->executingcpu; | |
| 807 | if (executingcpu != NULL) | |
| 808 | cpu_abort_timeslice(executingcpu); | |
| 809 | } | |
| 810 | ||
| 811 | ||
| 812 | ||
| 813 | 1000 | /*************************************************************************** |
| 814 | 1001 | SYNCHRONIZATION HELPERS |
| 815 | 1002 | ***************************************************************************/ |
| r3957 | r3958 | |
| 857 | 1044 | |
| 858 | 1045 | void cpu_spinuntil_int(const device_config *device) |
| 859 | 1046 | { |
| 860 | cpu_class_data *classdata = get_ | |
| 1047 | cpu_class_data *classdata = get_ | |
| 861 | 1048 | |
| 862 | 1049 | /* suspend until the given trigger fires */ |
| 863 | 1050 | suspend_until_trigger(device, classdata->inttrigger, TRUE); |
| r3957 | r3958 | |
| 893 | 1080 | |
| 894 | 1081 | void cpuexec_trigger(running_machine *machine, int trigger) |
| 895 | 1082 | { |
| 896 | | |
| 1083 | const device_config *cpu | |
| 897 | 1084 | |
| 898 | 1085 | /* look for suspended CPUs waiting for this trigger and unsuspend them */ |
| 899 | for (cpu | |
| 1086 | for (cpu | |
| 900 | 1087 | { |
| 901 | cpu_class_data *classdata = | |
| 1088 | cpu_class_data *classdata = g | |
| 902 | 1089 | |
| 903 | 1090 | /* if we're executing, for an immediate abort */ |
| 904 | cpu_abort_timeslice( | |
| 1091 | cpu_abort_timeslice( | |
| 905 | 1092 | |
| 906 | 1093 | /* see if this is a matching trigger */ |
| 907 | 1094 | if (classdata->suspend != 0 && classdata->trigger == trigger) |
| 908 | 1095 | { |
| 909 | cpu_resume( | |
| 1096 | cpu_resume( | |
| 910 | 1097 | classdata->trigger = 0; |
| 911 | 1098 | } |
| 912 | 1099 | } |
| r3957 | r3958 | |
| 931 | 1118 | |
| 932 | 1119 | void cpu_triggerint(const device_config *device) |
| 933 | 1120 | { |
| 934 | cpu_class_data *classdata = get_ | |
| 1121 | cpu_class_data *classdata = get_ | |
| 935 | 1122 | |
| 936 | 1123 | /* signal this CPU's interrupt trigger */ |
| 937 | 1124 | cpuexec_trigger(device->machine, classdata->inttrigger); |
| r3957 | r3958 | |
| 951 | 1138 | |
| 952 | 1139 | void cpu_set_input_line(const device_config *device, int line, int state) |
| 953 | 1140 | { |
| 954 | cpu_class_data *classdata = get_ | |
| 1141 | cpu_class_data *classdata = get_ | |
| 955 | 1142 | int vector = (line >= 0 && line < MAX_INPUT_LINES) ? classdata->input[line].vector : 0xff; |
| 956 | 1143 | cpu_set_input_line_and_vector(device, line, state, vector); |
| 957 | 1144 | } |
| r3957 | r3958 | |
| 965 | 1152 | |
| 966 | 1153 | void cpu_set_input_line_vector(const device_config *device, int line, int vector) |
| 967 | 1154 | { |
| 968 | cpu_class_data *classdata = get_ | |
| 1155 | cpu_class_data *classdata = get_ | |
| 969 | 1156 | if (line >= 0 && line < MAX_INPUT_LINES) |
| 970 | 1157 | { |
| 971 | 1158 | classdata->input[line].vector = vector; |
| 972 | 1159 | return; |
| 973 | 1160 | } |
| 974 | LOG(("cpu | |
| 1161 | LOG(("cpu | |
| 975 | 1162 | } |
| 976 | 1163 | |
| 977 | 1164 | |
| r3957 | r3958 | |
| 983 | 1170 | |
| 984 | 1171 | void cpu_set_input_line_and_vector(const device_config *device, int line, int state, int vector) |
| 985 | 1172 | { |
| 986 | cpu_class_data *classdata = get_ | |
| 1173 | cpu_class_data *classdata = get_ | |
| 987 | 1174 | |
| 988 | 1175 | /* catch errors where people use PULSE_LINE for CPUs that don't support it */ |
| 989 | 1176 | if (state == PULSE_LINE && line != INPUT_LINE_NMI && line != INPUT_LINE_RESET) |
| r3957 | r3958 | |
| 995 | 1182 | INT32 input_event = (state & 0xff) | (vector << 8); |
| 996 | 1183 | int event_index = inputline->qindex++; |
| 997 | 1184 | |
| 998 | LOG(("cpu | |
| 1185 | LOG(("cpu | |
| 999 | 1186 | |
| 1000 | 1187 | /* if we're full of events, flush the queue and log a message */ |
| 1001 | 1188 | if (event_index >= ARRAY_LENGTH(inputline->queue)) |
| r3957 | r3958 | |
| 1026 | 1213 | |
| 1027 | 1214 | void cpu_set_irq_callback(const device_config *device, cpu_irq_callback callback) |
| 1028 | 1215 | { |
| 1029 | cpu_class_data *classdata = get_ | |
| 1216 | cpu_class_data *classdata = get_ | |
| 1030 | 1217 | classdata->driver_irq = callback; |
| 1031 | 1218 | } |
| 1032 | 1219 | |
| r3957 | r3958 | |
| 1043 | 1230 | |
| 1044 | 1231 | int cpu_getiloops(const device_config *device) |
| 1045 | 1232 | { |
| 1046 | cpu_class_data *classdata = get_ | |
| 1233 | cpu_class_data *classdata = get_ | |
| 1047 | 1234 | return classdata->iloops; |
| 1048 | 1235 | } |
| 1049 | 1236 | |
| r3957 | r3958 | |
| 1054 | 1241 | ***************************************************************************/ |
| 1055 | 1242 | |
| 1056 | 1243 | /*------------------------------------------------- |
| 1057 | cpu_timers_init - set up all the core timers | |
| 1058 | -------------------------------------------------*/ | |
| 1059 | ||
| 1060 | static void cpu_timers_init(running_machine *machine) | |
| 1061 | { | |
| 1062 | int numscreens = video_screen_count(machine->config); | |
| 1063 | attoseconds_t refresh_attosecs; | |
| 1064 | int cpunum, ipf; | |
| 1065 | ||
| 1066 | /* set the core scheduling quantum */ | |
| 1067 | ipf = machine->config->cpu_slices_per_frame; | |
| 1068 | if (ipf <= 0) | |
| 1069 | ipf = 1; | |
| 1070 | refresh_attosecs = (numscreens == 0) ? HZ_TO_ATTOSECONDS(60) : video_screen_get_frame_period(machine->primary_screen).attoseconds; | |
| 1071 | timer_add_scheduling_quantum(machine, refresh_attosecs / ipf, attotime_never); | |
| 1072 | ||
| 1073 | /* register the interrupt handler callbacks */ | |
| 1074 | for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++) | |
| 1075 | if (machine->cpu[cpunum] != NULL) | |
| 1076 | { | |
| 1077 | const device_config *device = machine->cpu[cpunum]; | |
| 1078 | const cpu_config *config = device->inline_config; | |
| 1079 | cpu_class_data *classdata = device->classtoken; | |
| 1080 | ||
| 1081 | /* VBLANK interrupts */ | |
| 1082 | if (config->vblank_interrupts_per_frame > 0) | |
| 1083 | { | |
| 1084 | const device_config *screen; | |
| 1085 | ||
| 1086 | /* get the screen that will trigger the VBLANK */ | |
| 1087 | ||
| 1088 | /* new style - use screen tag directly */ | |
| 1089 | if (config->vblank_interrupts_per_frame == 1) | |
| 1090 | screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, config->vblank_interrupt_screen); | |
| 1091 | ||
| 1092 | /* old style 'hack' setup - use screen #0 */ | |
| 1093 | else | |
| 1094 | screen = device_list_first(machine->config->devicelist, VIDEO_SCREEN); | |
| 1095 | ||
| 1096 | assert(screen != NULL); | |
| 1097 | video_screen_register_vblank_callback(screen, on_vblank, NULL); | |
| 1098 | } | |
| 1099 | ||
| 1100 | /* periodic interrupts */ | |
| 1101 | if (config->timed_interrupt_period != 0) | |
| 1102 | { | |
| 1103 | attotime timedint_period = attotime_make(0, config->timed_interrupt_period); | |
| 1104 | assert(classdata->timedint_timer != NULL); | |
| 1105 | timer_adjust_periodic(classdata->timedint_timer, timedint_period, cpunum, timedint_period); | |
| 1106 | } | |
| 1107 | } | |
| 1108 | } | |
| 1109 | ||
| 1110 | ||
| 1111 | /*------------------------------------------------- | |
| 1112 | 1244 | update_clock_information - recomputes clock |
| 1113 | 1245 | information for the specified CPU |
| 1114 | 1246 | -------------------------------------------------*/ |
| 1115 | 1247 | |
| 1116 | 1248 | static void update_clock_information(const device_config *device) |
| 1117 | 1249 | { |
| 1118 | cpu_class_data *classdata = | |
| 1250 | cpu_class_data *classdata = get_c | |
| 1119 | 1251 | INT64 attos; |
| 1120 | 1252 | |
| 1121 | 1253 | /* recompute cps and spc */ |
| 1122 | 1254 | classdata->cycles_per_second = (double)classdata->clock * classdata->clockscale; |
| 1123 | classdata->attoseconds_per_cycle = ATTOSECONDS | |
| 1255 | classdata->attoseconds_per_cycle = HZ_TO_ATTOSECONDS | |
| 1124 | 1256 | |
| 1125 | 1257 | /* update the CPU's divisor */ |
| 1126 | 1258 | attos = classdata->attoseconds_per_cycle; |
| r3957 | r3958 | |
| 1144 | 1276 | |
| 1145 | 1277 | static void compute_perfect_interleave(running_machine *machine) |
| 1146 | 1278 | { |
| 1147 | if (machine->cpu[0] != NULL | |
| 1279 | if (machine->cpu[0] != NULL | |
| 1148 | 1280 | { |
| 1149 | cpu_class_data *classdata = machine->cpu[0]->classtoken; | |
| 1150 | attoseconds_t smallest = classdata->attoseconds_per_cycle * cputype_get_min_cycles(machine->config->cpu[0].type); | |
| 1281 | attoseconds_t smallest = get_minimum_quantum(machine->cpu[0]); | |
| 1151 | 1282 | attoseconds_t perfect = ATTOSECONDS_PER_SECOND - 1; |
| 1152 | | |
| 1283 | const device_config *cpu | |
| 1153 | 1284 | |
| 1154 | 1285 | /* start with a huge time factor and find the 2nd smallest cycle time */ |
| 1155 | for (cpunum = 1; cpunum < ARRAY_LENGTH(machine->cpu) && machine->cpu[cpunum] != NULL; cpunum++) | |
| 1156 | if (machine->cpu[cpunum] != NULL && machine->cpu[cpunum]->classtoken != NULL) | |
| 1286 | for (cpu = machine->cpu[0]->typenext; cpu != NULL; cpu = cpu->typenext) | |
| 1287 | { | |
| 1288 | attoseconds_t curquantum = get_minimum_quantum(cpu); | |
| 1289 | ||
| 1290 | /* find the 2nd smallest cycle interval */ | |
| 1291 | if (curquantum < smallest) | |
| 1157 | 1292 | { |
| 1158 | cpu_class_data *classdata = machine->cpu[cpunum]->classtoken; | |
| 1159 | attoseconds_t curtime = classdata->attoseconds_per_cycle * cputype_get_min_cycles(machine->config->cpu[cpunum].type); | |
| 1160 | ||
| 1161 | /* find the 2nd smallest cycle interval */ | |
| 1162 | if (curtime < smallest) | |
| 1163 | { | |
| 1164 | perfect = smallest; | |
| 1165 | smallest = curtime; | |
| 1166 | } | |
| 1167 | else if (curtime < perfect) | |
| 1168 | perfect = classdata->attoseconds_per_cycle; | |
| 1293 | perfect = smallest; | |
| 1294 | smallest = curquantum; | |
| 1169 | 1295 | } |
| 1296 | else if (curquantum < perfect) | |
| 1297 | perfect = curquantum; | |
| 1298 | } | |
| 1170 | 1299 | |
| 1171 | 1300 | /* adjust the final value */ |
| 1172 | 1301 | timer_set_minimum_quantum(machine, perfect); |
| r3957 | r3958 | |
| 1186 | 1315 | /* VBLANK starting */ |
| 1187 | 1316 | if (vblank_state) |
| 1188 | 1317 | { |
| 1189 | | |
| 1318 | const device_config *cpu | |
| 1190 | 1319 | |
| 1191 | 1320 | /* find any CPUs that have this screen as their VBLANK interrupt source */ |
| 1192 | for (cpunum = 0; cpunum < ARRAY_LENGTH(device->machine->cpu); cpunum++) | |
| 1193 | if (device->machine->cpu[cpunum] != NULL) | |
| 1194 | { | |
| 1195 | const device_config *cpudevice = device->machine->cpu[cpunum]; | |
| 1196 | const cpu_config *config = cpudevice->inline_config; | |
| 1197 | cpu_class_data *classdata = cpudevice->classtoken; | |
| 1198 | int cpu_interested; | |
| 1321 | for (cpu = device->machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) | |
| 1322 | { | |
| 1323 | const cpu_config *config = cpu->inline_config; | |
| 1324 | cpu_class_data *classdata = get_class_data(cpu); | |
| 1325 | int cpu_interested; | |
| 1199 | 1326 | |
| 1200 | /* start the interrupt counter */ | |
| 1201 | if (!(classdata->suspend & SUSPEND_REASON_DISABLE)) | |
| 1202 | classdata->iloops = 0; | |
| 1203 | else | |
| 1204 | classdata->iloops = -1; | |
| 1327 | /* start the interrupt counter */ | |
| 1328 | if (!(classdata->suspend & SUSPEND_REASON_DISABLE)) | |
| 1329 | classdata->iloops = 0; | |
| 1330 | else | |
| 1331 | classdata->iloops = -1; | |
| 1205 | 1332 | |
| 1206 | /* the hack style VBLANK decleration always uses the first screen */ | |
| 1207 | if (config->vblank_interrupts_per_frame > 1) | |
| 1208 | cpu_interested = TRUE; | |
| 1333 | /* the hack style VBLANK decleration always uses the first screen */ | |
| 1334 | if (config->vblank_interrupts_per_frame > 1) | |
| 1335 | cpu_interested = TRUE; | |
| 1209 | 1336 | |
| 1210 | /* for new style decleration, we need to compare the tags */ | |
| 1211 | else if (config->vblank_interrupts_per_frame == 1) | |
| 1212 | cpu_interested = (strcmp(config->vblank_interrupt_screen, device->tag) == 0); | |
| 1337 | /* for new style declaration, we need to compare the tags */ | |
| 1338 | else if (config->vblank_interrupt_screen != NULL) | |
| 1339 | cpu_interested = (strcmp(config->vblank_interrupt_screen, device->tag) == 0); | |
| 1213 | 1340 | |
| 1214 | /* no VBLANK interrupt, not interested */ | |
| 1215 | else | |
| 1216 | cpu_interested = FALSE; | |
| 1341 | /* no VBLANK interrupt, not interested */ | |
| 1342 | else | |
| 1343 | cpu_interested = FALSE; | |
| 1217 | 1344 | |
| 1218 | /* if interested, call the interrupt handler */ | |
| 1219 | if (cpu_interested) | |
| 1345 | /* if interested, call the interrupt handler */ | |
| 1346 | if (cpu_interested) | |
| 1347 | { | |
| 1348 | if (!(classdata->suspend & (SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) | |
| 1349 | (*config->vblank_interrupt)(cpu); | |
| 1350 | ||
| 1351 | /* if we have more than one interrupt per frame, start the timer now to trigger the rest of them */ | |
| 1352 | if (config->vblank_interrupts_per_frame > 1 && !(classdata->suspend & SUSPEND_REASON_DISABLE)) | |
| 1220 | 1353 | { |
| 1221 | if (!(classdata->suspend & (SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))) | |
| 1222 | (*config->vblank_interrupt)(cpudevice); | |
| 1223 | ||
| 1224 | /* if we have more than one interrupt per frame, start the timer now to trigger the rest of them */ | |
| 1225 | if (config->vblank_interrupts_per_frame > 1 && !(classdata->suspend & SUSPEND_REASON_DISABLE)) | |
| 1226 | { | |
| 1227 | classdata->partial_frame_period = attotime_div(video_screen_get_frame_period(device->machine->primary_screen), config->vblank_interrupts_per_frame); | |
| 1228 | timer_adjust_oneshot(classdata->partial_frame_timer, classdata->partial_frame_period, cpunum); | |
| 1229 | } | |
| 1354 | classdata->partial_frame_period = attotime_div(video_screen_get_frame_period(device->machine->primary_screen), config->vblank_interrupts_per_frame); | |
| 1355 | timer_adjust_oneshot(classdata->partial_frame_timer, classdata->partial_frame_period, 0); | |
| 1230 | 1356 | } |
| 1231 | 1357 | } |
| 1358 | } | |
| 1232 | 1359 | } |
| 1233 | 1360 | } |
| 1234 | 1361 | |
| r3957 | r3958 | |
| 1242 | 1369 | { |
| 1243 | 1370 | const device_config *device = ptr; |
| 1244 | 1371 | const cpu_config *config = device->inline_config; |
| 1245 | cpu_class_data *classdata = | |
| 1372 | cpu_class_data *classdata = get_c | |
| 1246 | 1373 | |
| 1247 | 1374 | if (classdata->iloops == 0) |
| 1248 | 1375 | classdata->iloops = config->vblank_interrupts_per_frame; |
| r3957 | r3958 | |
| 1294 | 1421 | static TIMER_CALLBACK( empty_event_queue ) |
| 1295 | 1422 | { |
| 1296 | 1423 | const device_config *device = ptr; |
| 1297 | cpu_class_data *classdata = | |
| 1424 | cpu_class_data *classdata = get_c | |
| 1298 | 1425 | cpu_input_data *inputline = &classdata->input[param]; |
| 1299 | 1426 | int curevent; |
| 1300 | 1427 | |
| r3957 | r3958 | |
| 1320 | 1447 | /* if we're clearing the line that was previously asserted, or if we're just */ |
| 1321 | 1448 | /* pulsing the line, reset the CPU */ |
| 1322 | 1449 | if ((state == CLEAR_LINE && cpu_is_suspended(device, SUSPEND_REASON_RESET)) || state == PULSE_LINE) |
| 1323 | c | |
| 1450 | device | |
| 1324 | 1451 | |
| 1325 | 1452 | /* if we're clearing the line, make sure the CPU is not halted */ |
| 1326 | 1453 | cpu_resume(device, SUSPEND_REASON_RESET); |
| r3957 | r3958 | |
| 1346 | 1473 | switch (state) |
| 1347 | 1474 | { |
| 1348 | 1475 | case PULSE_LINE: |
| 1349 | /* temporary: PULSE_LINE only makes sense for NMI lines on Z80 */ | |
| 1350 | assert(classdata->header.cputype != CPU_Z80 || param == INPUT_LINE_NMI); | |
| 1351 | cpu_set_info_int(device, CPUINFO_INT_INPUT_STATE + param, ASSERT_LINE); | |
| 1352 | cpu_set_info_int(device, CPUINFO_INT_INPUT_STATE + param, CLEAR_LINE); | |
| 1476 | device_set_info_int(device, CPUINFO_INT_INPUT_STATE + param, ASSERT_LINE); | |
| 1477 | device_set_info_int(device, CPUINFO_INT_INPUT_STATE + param, CLEAR_LINE); | |
| 1353 | 1478 | break; |
| 1354 | 1479 | |
| 1355 | 1480 | case HOLD_LINE: |
| 1356 | 1481 | case ASSERT_LINE: |
| 1357 | c | |
| 1482 | device | |
| 1358 | 1483 | break; |
| 1359 | 1484 | |
| 1360 | 1485 | case CLEAR_LINE: |
| 1361 | c | |
| 1486 | device | |
| 1362 | 1487 | break; |
| 1363 | 1488 | |
| 1364 | 1489 | default: |
| r3957 | r3958 | |
| 1385 | 1510 | |
| 1386 | 1511 | static IRQ_CALLBACK( standard_irq_callback ) |
| 1387 | 1512 | { |
| 1388 | cpu_class_data *classdata = | |
| 1513 | cpu_class_data *classdata = get_c | |
| 1389 | 1514 | cpu_input_data *inputline = &classdata->input[irqline]; |
| 1390 | 1515 | int vector = inputline->curvector; |
| 1391 | 1516 | |
| r3957 | r3958 | |
| 1395 | 1520 | if (inputline->curstate == HOLD_LINE) |
| 1396 | 1521 | { |
| 1397 | 1522 | LOG(("->set_irq_line('%s',%d,%d)\n", device->tag, irqline, CLEAR_LINE)); |
| 1398 | c | |
| 1523 | device | |
| 1399 | 1524 | inputline->curstate = CLEAR_LINE; |
| 1400 | 1525 | } |
| 1401 | 1526 | |
| r3957 | r3958 | |
| 1418 | 1543 | |
| 1419 | 1544 | static void register_save_states(const device_config *device) |
| 1420 | 1545 | { |
| 1421 | cpu_class_data *classdata = | |
| 1546 | cpu_class_data *classdata = get_c | |
| 1422 | 1547 | int line; |
| 1423 | 1548 | |
| 1424 | 1549 | state_save_register_device_item(device, 0, classdata->suspend); |
| r3957 | r3958 | |
| 1444 | 1569 | } |
| 1445 | 1570 | } |
| 1446 | 1571 | |
| 1572 | ||
| 1573 | /*------------------------------------------------- | |
| 1574 | get_register_value - return a register value | |
| 1575 | of a CPU using the state table | |
| 1576 | -------------------------------------------------*/ | |
| 1577 | ||
| 1578 | static UINT64 get_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry) | |
| 1579 | { | |
| 1580 | void *dataptr; | |
| 1581 | UINT64 result; | |
| 1582 | ||
| 1583 | /* NULL entry returns 0 */ | |
| 1584 | if (entry == NULL || baseptr == NULL) | |
| 1585 | return 0; | |
| 1586 | ||
| 1587 | /* if we have an exporter, call it now */ | |
| 1588 | if ((entry->flags & CPUSTATE_EXPORT) != 0) | |
| 1589 | { | |
| 1590 | cpu_state_io_func exportcb = (cpu_state_io_func)device_get_info_fct(device, CPUINFO_FCT_EXPORT_STATE); | |
| 1591 | assert(exportcb != NULL); | |
| 1592 | (*exportcb)(device, baseptr, entry); | |
| 1593 | } | |
| 1594 | ||
| 1595 | /* pick up the value */ | |
| 1596 | dataptr = (UINT8 *)baseptr + entry->dataoffs; | |
| 1597 | switch (entry->datasize) | |
| 1598 | { | |
| 1599 | default: | |
| 1600 | case 1: result = *(UINT8 *)dataptr; break; | |
| 1601 | case 2: result = *(UINT16 *)dataptr; break; | |
| 1602 | case 4: result = *(UINT32 *)dataptr; break; | |
| 1603 | case 8: result = *(UINT64 *)dataptr; break; | |
| 1604 | } | |
| 1605 | return result & entry->mask; | |
| 1606 | } | |
| 1607 | ||
| 1608 | ||
| 1609 | /*------------------------------------------------- | |
| 1610 | set_register_value - set the value of a | |
| 1611 | CPU register using the state table | |
| 1612 | -------------------------------------------------*/ | |
| 1613 | ||
| 1614 | static void set_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, UINT64 value) | |
| 1615 | { | |
| 1616 | void *dataptr; | |
| 1617 | ||
| 1618 | /* NULL entry is a no-op */ | |
| 1619 | if (entry == NULL || baseptr == NULL) | |
| 1620 | return; | |
| 1621 | ||
| 1622 | /* apply the mask */ | |
| 1623 | value &= entry->mask; | |
| 1624 | ||
| 1625 | /* sign-extend if necessary */ | |
| 1626 | if ((entry->flags & CPUSTATE_IMPORT_SEXT) != 0 && value > (entry->mask >> 1)) | |
| 1627 | value |= ~entry->mask; | |
| 1628 | ||
| 1629 | /* store the value */ | |
| 1630 | dataptr = (UINT8 *)baseptr + entry->dataoffs; | |
| 1631 | switch (entry->datasize) | |
| 1632 | { | |
| 1633 | default: | |
| 1634 | case 1: *(UINT8 *)dataptr = value; break; | |
| 1635 | case 2: *(UINT16 *)dataptr = value; break; | |
| 1636 | case 4: *(UINT32 *)dataptr = value; break; | |
| 1637 | case 8: *(UINT64 *)dataptr = value; break; | |
| 1638 | } | |
| 1639 | ||
| 1640 | /* if we have an importer, call it now */ | |
| 1641 | if ((entry->flags & CPUSTATE_IMPORT) != 0) | |
| 1642 | { | |
| 1643 | cpu_state_io_func importcb = (cpu_state_io_func)device_get_info_fct(device, CPUINFO_FCT_IMPORT_STATE); | |
| 1644 | assert(importcb != NULL); | |
| 1645 | (*importcb)(device, baseptr, entry); | |
| 1646 | } | |
| 1647 | } | |
| 1648 | ||
| 1649 | ||
| 1650 | /*------------------------------------------------- | |
| 1651 | get_register_string_value - return a string | |
| 1652 | representation of a CPU register using the | |
| 1653 | state table | |
| 1654 | -------------------------------------------------*/ | |
| 1655 | ||
| 1656 | static void get_register_string_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *dest) | |
| 1657 | { | |
| 1658 | static const UINT64 decdivisor[] = { | |
| 1659 | 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, | |
| 1660 | U64(10000000000), U64(100000000000), U64(1000000000000), | |
| 1661 | U64(10000000000000), U64(100000000000000), U64(1000000000000000), | |
| 1662 | U64(10000000000000000), U64(100000000000000000), U64(1000000000000000000), | |
| 1663 | U64(10000000000000000000) | |
| 1664 | }; | |
| 1665 | static const char hexchars[] = "0123456789ABCDEF"; | |
| 1666 | int leadzero = 0, width = 0, percent = 0, explicitsign = 0, hitnonzero = 0, reset; | |
| 1667 | const char *fptr; | |
| 1668 | UINT64 result; | |
| 1669 | ||
| 1670 | /* NULL entry does nothing */ | |
| 1671 | if (entry == NULL || entry->symbol == NULL || entry->format == NULL) | |
| 1672 | return; | |
| 1673 | ||
| 1674 | /* fetch the data */ | |
| 1675 | result = get_register_value(device, baseptr, entry); | |
| 1676 | ||
| 1677 | /* start with the basics */ | |
| 1678 | dest += sprintf(dest, "%s%s:", (entry->flags & CPUSTATE_NOSHOW) ? "~" : "", entry->symbol); | |
| 1679 | ||
| 1680 | /* parse the format */ | |
| 1681 | reset = TRUE; | |
| 1682 | for (fptr = entry->format; *fptr != 0; fptr++) | |
| 1683 | { | |
| 1684 | int digitnum; | |
| 1685 | ||
| 1686 | /* reset any accumulated state */ | |
| 1687 | if (reset) | |
| 1688 | leadzero = width = percent = explicitsign = reset = 0; | |
| 1689 | ||
| 1690 | /* if we're not within a format, then anything other than a % outputs directly */ | |
| 1691 | if (!percent && *fptr != '%') | |
| 1692 | { | |
| 1693 | *dest++ = *fptr; | |
| 1694 | continue; | |
| 1695 | } | |
| 1696 | ||
| 1697 | /* handle each character in turn */ | |
| 1698 | switch (*fptr) | |
| 1699 | { | |
| 1700 | /* % starts a format; %% outputs a single % */ | |
| 1701 | case '%': | |
| 1702 | if (!percent) | |
| 1703 | percent = TRUE; | |
| 1704 | else | |
| 1705 | { | |
| 1706 | *dest++ = *fptr; | |
| 1707 | percent = FALSE; | |
| 1708 | } | |
| 1709 | break; | |
| 1710 | ||
| 1711 | /* 0 means insert leading 0s, unless it follows another width digit */ | |
| 1712 | case '0': | |
| 1713 | if (width == 0) | |
| 1714 | leadzero = TRUE; | |
| 1715 | else | |
| 1716 | width *= 10; | |
| 1717 | break; | |
| 1718 | ||
| 1719 | /* 1-9 accumulate into the width */ | |
| 1720 | case '1': case '2': case '3': case '4': case '5': | |
| 1721 | case '6': case '7': case '8': case '9': | |
| 1722 | width = width * 10 + (*fptr - '0'); | |
| 1723 | break; | |
| 1724 | ||
| 1725 | /* + means explicit sign */ | |
| 1726 | case '+': | |
| 1727 | explicitsign = TRUE; | |
| 1728 | break; | |
| 1729 | ||
| 1730 | /* X outputs as hexadecimal */ | |
| 1731 | case 'X': | |
| 1732 | if (width == 0) | |
| 1733 | fatalerror("Width required for %%X formats\n"); | |
| 1734 | hitnonzero = FALSE; | |
| 1735 | while (leadzero && width > 16) | |
| 1736 | { | |
| 1737 | *dest++ = ' '; | |
| 1738 | width--; | |
| 1739 | } | |
| 1740 | for (digitnum = 15; digitnum >= 0; digitnum--) | |
| 1741 | { | |
| 1742 | int digit = (result >> (4 * digitnum)) & 0x0f; | |
| 1743 | if (digit != 0) | |
| 1744 | *dest++ = hexchars[digit]; | |
| 1745 | else if (hitnonzero || (leadzero && digitnum < width) || digitnum == 0) | |
| 1746 | *dest++ = '0'; | |
| 1747 | hitnonzero |= digit; | |
| 1748 | } | |
| 1749 | reset = TRUE; | |
| 1750 | break; | |
| 1751 | ||
| 1752 | /* d outputs as signed decimal */ | |
| 1753 | case 'd': | |
| 1754 | if (width == 0) | |
| 1755 | fatalerror("Width required for %%d formats\n"); | |
| 1756 | if ((result & entry->mask) > (entry->mask >> 1)) | |
| 1757 | { | |
| 1758 | result = -result & entry->mask; | |
| 1759 | *dest++ = '-'; | |
| 1760 | width--; | |
| 1761 | } | |
| 1762 | else if (explicitsign) | |
| 1763 | { | |
| 1764 | *dest++ = '+'; | |
| 1765 | width--; | |
| 1766 | } | |
| 1767 | /* fall through to unsigned case */ | |
| 1768 | ||
| 1769 | /* u outputs as unsigned decimal */ | |
| 1770 | case 'u': | |
| 1771 | if (width == 0) | |
| 1772 | fatalerror("Width required for %%u formats\n"); | |
| 1773 | hitnonzero = FALSE; | |
| 1774 | while (leadzero && width > ARRAY_LENGTH(decdivisor)) | |
| 1775 | { | |
| 1776 | *dest++ = ' '; | |
| 1777 | width--; | |
| 1778 | } | |
| 1779 | for (digitnum = ARRAY_LENGTH(decdivisor); digitnum >= 0; digitnum--) | |
| 1780 | { | |
| 1781 | int digit = (result >= decdivisor[digitnum]) ? (result / decdivisor[digitnum]) % 10 : 0; | |
| 1782 | if (digit != 0) | |
| 1783 | *dest++ = '0' + digit; | |
| 1784 | else if (hitnonzero || (leadzero && digitnum < width) || digitnum == 0) | |
| 1785 | *dest++ = '0'; | |
| 1786 | hitnonzero |= digit; | |
| 1787 | } | |
| 1788 | reset = TRUE; | |
| 1789 | break; | |
| 1790 | ||
| 1791 | /* s is a custom format */ | |
| 1792 | case 's': | |
| 1793 | { | |
| 1794 | cpu_string_io_func exportstring = (cpu_string_io_func)device_get_info_fct(device, CPUINFO_FCT_EXPORT_STRING); | |
| 1795 | assert(exportstring != NULL); | |
| 1796 | (*exportstring)(device, baseptr, entry, dest); | |
| 1797 | dest += strlen(dest); | |
| 1798 | break; | |
| 1799 | } | |
| 1800 | ||
| 1801 | /* other formats unknown */ | |
| 1802 | default: | |
| 1803 | fatalerror("Unknown format character '%c'\n", *fptr); | |
| 1804 | break; | |
| 1805 | } | |
| 1806 | } | |
| 1807 | *dest = 0; | |
| 1808 | } | |
| 1809 | ||
| 1810 | ||
| 1811 | /*------------------------------------------------- | |
| 1812 | get_register_string_max_width - return the | |
| 1813 | maximum width of a string described by a | |
| 1814 | format | |
| 1815 | -------------------------------------------------*/ | |
| 1816 | ||
| 1817 | #ifdef UNUSED_FUNCTION | |
| 1818 | static int get_register_string_max_width(const device_config *device, void *baseptr, const cpu_state_entry *entry) | |
| 1819 | { | |
| 1820 | int leadzero = 0, width = 0, percent = 0, explicitsign = 0, reset; | |
| 1821 | int totalwidth = 0; | |
| 1822 | const char *fptr; | |
| 1823 | ||
| 1824 | /* NULL entry does nothing */ | |
| 1825 | if (entry == NULL || entry->symbol == NULL || entry->format == NULL) | |
| 1826 | return 0; | |
| 1827 | ||
| 1828 | /* parse the format */ | |
| 1829 | reset = TRUE; | |
| 1830 | for (fptr = entry->format; *fptr != 0; fptr++) | |
| 1831 | { | |
| 1832 | /* reset any accumulated state */ | |
| 1833 | if (reset) | |
| 1834 | leadzero = width = percent = explicitsign = reset = 0; | |
| 1835 | ||
| 1836 | /* if we're not within a format, then anything other than a % outputs directly */ | |
| 1837 | if (!percent && *fptr != '%') | |
| 1838 | { | |
| 1839 | totalwidth++; | |
| 1840 | continue; | |
| 1841 | } | |
| 1842 | ||
| 1843 | /* handle each character in turn */ | |
| 1844 | switch (*fptr) | |
| 1845 | { | |
| 1846 | /* % starts a format; %% outputs a single % */ | |
| 1847 | case '%': | |
| 1848 | if (!percent) | |
| 1849 | percent = TRUE; | |
| 1850 | else | |
| 1851 | { | |
| 1852 | totalwidth++; | |
| 1853 | percent = FALSE; | |
| 1854 | } | |
| 1855 | break; | |
| 1856 | ||
| 1857 | /* 0 means insert leading 0s, unless it follows another width digit */ | |
| 1858 | case '0': | |
| 1859 | if (width == 0) | |
| 1860 | leadzero = TRUE; | |
| 1861 | else | |
| 1862 | width *= 10; | |
| 1863 | break; | |
| 1864 | ||
| 1865 | /* 1-9 accumulate into the width */ | |
| 1866 | case '1': case '2': case '3': case '4': case '5': | |
| 1867 | case '6': case '7': case '8': case '9': | |
| 1868 | width = width * 10 + (*fptr - '0'); | |
| 1869 | break; | |
| 1870 | ||
| 1871 | /* + means explicit sign */ | |
| 1872 | case '+': | |
| 1873 | explicitsign = TRUE; | |
| 1874 | break; | |
| 1875 | ||
| 1876 | /* X outputs as hexadecimal */ | |
| 1877 | /* d outputs as signed decimal */ | |
| 1878 | /* u outputs as unsigned decimal */ | |
| 1879 | /* s outputs as custom format */ | |
| 1880 | case 'X': | |
| 1881 | case 'd': | |
| 1882 | case 'u': | |
| 1883 | case 's': | |
| 1884 | totalwidth += width; | |
| 1885 | reset = TRUE; | |
| 1886 | break; | |
| 1887 | ||
| 1888 | if (width == 0) | |
| 1889 | fatalerror("Width required for %%d formats\n"); | |
| 1890 | totalwidth += width; | |
| 1891 | break; | |
| 1892 | ||
| 1893 | /* other formats unknown */ | |
| 1894 | default: | |
| 1895 | fatalerror("Unknown format character '%c'\n", *fptr); | |
| 1896 | break; | |
| 1897 | } | |
| 1898 | } | |
| 1899 | return totalwidth; | |
| 1900 | } | |
| 1901 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | #include "memory.h" |
| 19 | 19 | #include "watchdog.h" |
| 20 | 20 | #include "state.h" |
| 21 | #include <stddef.h> | |
| 21 | 22 | |
| 22 | 23 | |
| 23 | 24 | /*************************************************************************** |
| 24 | 25 | CONSTANTS |
| 25 | 26 | ***************************************************************************/ |
| 26 | 27 | |
| 27 | #define MAX_CPU 8 | |
| 28 | #define MAX_CPU 8 | |
| 28 | 29 | #define MAX_INPUT_EVENTS 32 |
| 29 | 30 | |
| 30 | 31 | |
| 31 | /* I | |
| 32 | /* I/O | |
| 32 | 33 | enum |
| 33 | 34 | { |
| 34 | /* line states */ | |
| 35 | CLEAR_LINE = 0, /* clear (a fired, held or pulsed) line */ | |
| 35 | CLEAR_LINE = 0, /* clear (a fired or held) line */ | |
| 36 | 36 | ASSERT_LINE, /* assert an interrupt immediately */ |
| 37 | 37 | HOLD_LINE, /* hold interrupt line until acknowledged */ |
| 38 | PULSE_LINE, /* pulse interrupt line for one instruction */ | |
| 38 | PULSE_LINE /* pulse interrupt line instantaneously (only for NMI, RESET) */ | |
| 39 | }; | |
| 39 | 40 | |
| 41 | ||
| 42 | /* I/O line definitions */ | |
| 43 | enum | |
| 44 | { | |
| 40 | 45 | /* input lines */ |
| 41 | 46 | MAX_INPUT_LINES = 32+3, |
| 42 | 47 | INPUT_LINE_IRQ0 = 0, |
| r3957 | r3958 | |
| 60 | 65 | }; |
| 61 | 66 | |
| 62 | 67 | |
| 63 | /* | |
| 68 | /* | |
| 64 | 69 | enum |
| 65 | 70 | { |
| 66 | MAX_REGS = 256 | |
| 71 | MAX_REGS = 256, | |
| 72 | ||
| 73 | REG_GENPCBASE = MAX_REGS - 1, /* generic "base" PC, should point to start of current opcode */ | |
| 74 | REG_GENPC = MAX_REGS - 2, /* generic PC, may point within an opcode */ | |
| 75 | REG_GENSP = MAX_REGS - 3 /* generic SP, or closest equivalent */ | |
| 67 | 76 | }; |
| 68 | 77 | |
| 69 | 78 | |
| r3957 | r3958 | |
| 73 | 82 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 74 | 83 | CPUINFO_INT_FIRST = DEVINFO_INT_FIRST, |
| 75 | 84 | |
| 76 | /* direct map to device data */ | |
| 77 | CPUINFO_INT_CONTEXT_SIZE = DEVINFO_INT_TOKEN_BYTES, /* R/O: size of CPU context in bytes */ | |
| 78 | ||
| 79 | 85 | /* CPU-specific additions */ |
| 80 | CPUINFO_INT_INPUT_LINES = DEVINFO_INT_CLASS_SPECIFIC, /* R/O: number of input lines */ | |
| 86 | CPUINFO_INT_CONTEXT_SIZE = DEVINFO_INT_CLASS_SPECIFIC, /* R/O: size of CPU context in bytes */ | |
| 87 | CPUINFO_INT_INPUT_LINES, /* R/O: number of input lines */ | |
| 81 | 88 | CPUINFO_INT_OUTPUT_LINES, /* R/O: number of output lines */ |
| 82 | 89 | CPUINFO_INT_DEFAULT_IRQ_VECTOR, /* R/O: default IRQ vector */ |
| 83 | 90 | CPUINFO_INT_ENDIANNESS, /* R/O: either ENDIANNESS_BIG or ENDIANNESS_LITTLE */ |
| r3957 | r3958 | |
| 89 | 96 | CPUINFO_INT_MAX_CYCLES, /* R/O: maximum cycles for a single instruction */ |
| 90 | 97 | |
| 91 | 98 | CPUINFO_INT_DATABUS_WIDTH, /* R/O: data bus size for each address space (8,16,32,64) */ |
| 99 | CPUINFO_INT_DATABUS_WIDTH_PROGRAM = CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM, | |
| 100 | CPUINFO_INT_DATABUS_WIDTH_DATA = CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA, | |
| 101 | CPUINFO_INT_DATABUS_WIDTH_IO = CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO, | |
| 92 | 102 | CPUINFO_INT_DATABUS_WIDTH_LAST = CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACES - 1, |
| 93 | 103 | CPUINFO_INT_ADDRBUS_WIDTH, /* R/O: address bus size for each address space (12-32) */ |
| 104 | CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM = CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM, | |
| 105 | CPUINFO_INT_ADDRBUS_WIDTH_DATA = CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA, | |
| 106 | CPUINFO_INT_ADDRBUS_WIDTH_IO = CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO, | |
| 94 | 107 | CPUINFO_INT_ADDRBUS_WIDTH_LAST = CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACES - 1, |
| 95 | 108 | CPUINFO_INT_ADDRBUS_SHIFT, /* R/O: shift applied to addresses each address space (+3 means >>3, -1 means <<1) */ |
| 109 | CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM = CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM, | |
| 110 | CPUINFO_INT_ADDRBUS_SHIFT_DATA = CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA, | |
| 111 | CPUINFO_INT_ADDRBUS_SHIFT_IO = CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO, | |
| 96 | 112 | CPUINFO_INT_ADDRBUS_SHIFT_LAST = CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACES - 1, |
| 97 | 113 | CPUINFO_INT_LOGADDR_WIDTH, /* R/O: address bus size for logical accesses in each space (0=same as physical) */ |
| 114 | CPUINFO_INT_LOGADDR_WIDTH_PROGRAM = CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM, | |
| 115 | CPUINFO_INT_LOGADDR_WIDTH_DATA = CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_DATA, | |
| 116 | CPUINFO_INT_LOGADDR_WIDTH_IO = CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_IO, | |
| 98 | 117 | CPUINFO_INT_LOGADDR_WIDTH_LAST = CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACES - 1, |
| 99 | 118 | CPUINFO_INT_PAGE_SHIFT, /* R/O: size of a page log 2 (i.e., 12=4096), or 0 if paging not supported */ |
| 119 | CPUINFO_INT_PAGE_SHIFT_PROGRAM = CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM, | |
| 120 | CPUINFO_INT_PAGE_SHIFT_DATA = CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_DATA, | |
| 121 | CPUINFO_INT_PAGE_SHIFT_IO = CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_IO, | |
| 100 | 122 | CPUINFO_INT_PAGE_SHIFT_LAST = CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACES - 1, |
| 101 | 123 | |
| 102 | CPUINFO_INT_SP, /* R/W: the current stack pointer value */ | |
| 103 | CPUINFO_INT_PC, /* R/W: the current PC value */ | |
| 104 | CPUINFO_INT_PREVIOUSPC, /* R/W: the previous PC value */ | |
| 105 | 124 | CPUINFO_INT_INPUT_STATE, /* R/W: states for each input line */ |
| 106 | 125 | CPUINFO_INT_INPUT_STATE_LAST = CPUINFO_INT_INPUT_STATE + MAX_INPUT_LINES - 1, |
| 107 | 126 | CPUINFO_INT_OUTPUT_STATE, /* R/W: states for each output line */ |
| 108 | 127 | CPUINFO_INT_OUTPUT_STATE_LAST = CPUINFO_INT_OUTPUT_STATE + MAX_OUTPUT_LINES - 1, |
| 109 | 128 | CPUINFO_INT_REGISTER, /* R/W: values of up to MAX_REGs registers */ |
| 129 | CPUINFO_INT_SP = CPUINFO_INT_REGISTER + REG_GENSP, /* R/W: the current stack pointer value */ | |
| 130 | CPUINFO_INT_PC = CPUINFO_INT_REGISTER + REG_GENPC, /* R/W: the current PC value */ | |
| 131 | CPUINFO_INT_PREVIOUSPC = CPUINFO_INT_REGISTER + REG_GENPCBASE, /* R/W: the previous PC value */ | |
| 110 | 132 | CPUINFO_INT_REGISTER_LAST = CPUINFO_INT_REGISTER + MAX_REGS - 1, |
| 111 | 133 | |
| 112 | 134 | CPUINFO_INT_CPU_SPECIFIC = 0x08000, /* R/W: CPU-specific values start here */ |
| r3957 | r3958 | |
| 118 | 140 | CPUINFO_PTR_INSTRUCTION_COUNTER = DEVINFO_PTR_CLASS_SPECIFIC, |
| 119 | 141 | /* R/O: int *icount */ |
| 120 | 142 | CPUINFO_PTR_INTERNAL_MEMORY_MAP, /* R/O: const addrmap_token *map */ |
| 143 | CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM = CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM, | |
| 144 | CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA = CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA, | |
| 145 | CPUINFO_PTR_INTERNAL_MEMORY_MAP_IO = CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_IO, | |
| 121 | 146 | CPUINFO_PTR_INTERNAL_MEMORY_MAP_LAST = CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACES - 1, |
| 122 | CPUINFO_PTR_ | |
| 147 | CPUINFO_PTR_ | |
| 123 | 148 | |
| 124 | 149 | CPUINFO_PTR_CPU_SPECIFIC = DEVINFO_PTR_DEVICE_SPECIFIC, /* R/W: CPU-specific values start here */ |
| 125 | 150 | |
| r3957 | r3958 | |
| 127 | 152 | CPUINFO_FCT_FIRST = DEVINFO_FCT_FIRST, |
| 128 | 153 | |
| 129 | 154 | /* CPU-specific additions */ |
| 130 | CPUINFO_PTR_RESET = DEVINFO_FCT_RESET, /* R/O: void (*reset)(const device_config *device) */ | |
| 131 | CPUINFO_PTR_EXIT = DEVINFO_FCT_STOP, /* R/O: void (*exit)(const device_config *device) */ | |
| 155 | CPUINFO_FCT_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, /* R/O: void (*set_info)(const device_config *device, UINT32 state, INT64 data, void *ptr) */ | |
| 156 | CPUINFO_FCT_INIT, /* R/O: void (*init)(const device_config *device, int index, int clock, int (*irqcallback)(const device_config *device, int)) */ | |
| 157 | CPUINFO_FCT_RESET, /* R/O: void (*reset)(const device_config *device) */ | |
| 158 | CPUINFO_FCT_EXIT, /* R/O: void (*exit)(const device_config *device) */ | |
| 159 | CPUINFO_FCT_EXECUTE, /* R/O: int (*execute)(const device_config *device, int cycles) */ | |
| 160 | CPUINFO_FCT_BURN, /* R/O: void (*burn)(const device_config *device, int cycles) */ | |
| 161 | CPUINFO_FCT_DISASSEMBLE, /* R/O: offs_t (*disassemble)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) */ | |
| 162 | CPUINFO_FCT_TRANSLATE, /* R/O: int (*translate)(const device_config *device, int space, int intention, offs_t *address) */ | |
| 163 | CPUINFO_FCT_READ, /* R/O: int (*read)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value) */ | |
| 164 | CPUINFO_FCT_WRITE, /* R/O: int (*write)(const device_config *device, int space, UINT32 offset, int size, UINT64 value) */ | |
| 165 | CPUINFO_FCT_READOP, /* R/O: int (*readop)(const device_config *device, UINT32 offset, int size, UINT64 *value) */ | |
| 166 | CPUINFO_FCT_DEBUG_INIT, /* R/O: void (*debug_init)(const device_config *device) */ | |
| 167 | CPUINFO_FCT_VALIDITY_CHECK, /* R/O: int (*validity_check)(const game_driver *driver, const void *config) */ | |
| 168 | CPUINFO_FCT_IMPORT_STATE, /* R/O: void (*import_state)(const device_config *device, void *baseptr, const cpu_state_entry *entry) */ | |
| 169 | CPUINFO_FCT_EXPORT_STATE, /* R/O: void (*export_state)(const device_config *device, void *baseptr, const cpu_state_entry *entry) */ | |
| 170 | CPUINFO_FCT_IMPORT_STRING, /* R/O: void (*import_string)(const device_config *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) */ | |
| 171 | CPUINFO_FCT_EXPORT_STRING, /* R/O: void (*export_string)(const device_config *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) */ | |
| 132 | 172 | |
| 133 | CPUINFO_PTR_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, /* R/O: void (*set_info)(const device_config *device, UINT32 state, INT64 data, void *ptr) */ | |
| 134 | CPUINFO_PTR_INIT, /* R/O: void (*init)(const device_config *device, int index, int clock, int (*irqcallback)(const device_config *device, int)) */ | |
| 135 | CPUINFO_PTR_EXECUTE, /* R/O: int (*execute)(const device_config *device, int cycles) */ | |
| 136 | CPUINFO_PTR_BURN, /* R/O: void (*burn)(const device_config *device, int cycles) */ | |
| 137 | CPUINFO_PTR_DISASSEMBLE, /* R/O: offs_t (*disassemble)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) */ | |
| 138 | CPUINFO_PTR_TRANSLATE, /* R/O: int (*translate)(const device_config *device, int space, int intention, offs_t *address) */ | |
| 139 | CPUINFO_PTR_READ, /* R/O: int (*read)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value) */ | |
| 140 | CPUINFO_PTR_WRITE, /* R/O: int (*write)(const device_config *device, int space, UINT32 offset, int size, UINT64 value) */ | |
| 141 | CPUINFO_PTR_READOP, /* R/O: int (*readop)(const device_config *device, UINT32 offset, int size, UINT64 *value) */ | |
| 142 | CPUINFO_PTR_DEBUG_INIT, /* R/O: void (*debug_init)(const device_config *device) */ | |
| 143 | CPUINFO_PTR_VALIDITY_CHECK, /* R/O: int (*validity_check)(const game_driver *driver, const void *config) */ | |
| 144 | ||
| 145 | 173 | CPUINFO_FCT_CPU_SPECIFIC = DEVINFO_FCT_DEVICE_SPECIFIC, /* R/W: CPU-specific values start here */ |
| 146 | 174 | |
| 147 | 175 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r3957 | r3958 | |
| 163 | 191 | }; |
| 164 | 192 | |
| 165 | 193 | |
| 166 | /* get_reg/set_reg constants */ | |
| 167 | enum | |
| 168 | { | |
| 169 | /* This value is passed to cpu_get_reg to retrieve the previous | |
| 170 | * program counter value, ie. before a CPU emulation started | |
| 171 | * to fetch opcodes and arguments for the current instrution. */ | |
| 172 | REG_PREVIOUSPC = CPUINFO_INT_PREVIOUSPC - CPUINFO_INT_REGISTER, | |
| 173 | ||
| 174 | /* This value is passed to cpu_get_reg to retrieve the current | |
| 175 | * program counter value. */ | |
| 176 | REG_PC = CPUINFO_INT_PC - CPUINFO_INT_REGISTER, | |
| 177 | ||
| 178 | /* This value is passed to cpu_get_reg to retrieve the current | |
| 179 | * stack pointer value. */ | |
| 180 | REG_SP = CPUINFO_INT_SP - CPUINFO_INT_REGISTER | |
| 181 | }; | |
| 182 | ||
| 183 | ||
| 184 | 194 | /* Translation intentions */ |
| 185 | 195 | #define TRANSLATE_TYPE_MASK 0x03 /* read write or fetch */ |
| 186 | 196 | #define TRANSLATE_USER_MASK 0x04 /* user mode or fully privileged */ |
| r3957 | r3958 | |
| 207 | 217 | #define DASMFLAG_STEP_OVER_EXTRA(x) ((x) << DASMFLAG_OVERINSTSHIFT) |
| 208 | 218 | |
| 209 | 219 | |
| 210 | /* list of all possible CPUs we might be compiled with */ | |
| 211 | enum _cpu_type | |
| 212 | { | |
| 213 | CPU_DUMMY, | |
| 214 | CPU_Z80, | |
| 215 | CPU_Z180, | |
| 216 | CPU_8080, | |
| 217 | CPU_8085A, | |
| 218 | CPU_M6502, | |
| 219 | CPU_M65C02, | |
| 220 | CPU_M65SC02, | |
| 221 | CPU_M65CE02, | |
| 222 | CPU_M6509, | |
| 223 | CPU_M6510, | |
| 224 | CPU_M6510T, | |
| 225 | CPU_M7501, | |
| 226 | CPU_M8502, | |
| 227 | CPU_N2A03, | |
| 228 | CPU_DECO16, | |
| 229 | CPU_M4510, | |
| 230 | CPU_H6280, | |
| 231 | CPU_I8086, | |
| 232 | CPU_I8088, | |
| 233 | CPU_I80186, | |
| 234 | CPU_I80188, | |
| 235 | CPU_I80286, | |
| 236 | CPU_V20, | |
| 237 | CPU_V25, | |
| 238 | CPU_V30, | |
| 239 | CPU_V33, | |
| 240 | CPU_V35, | |
| 241 | CPU_V60, | |
| 242 | CPU_V70, | |
| 243 | CPU_I8035, | |
| 244 | CPU_I8048, | |
| 245 | CPU_I8648, | |
| 246 | CPU_I8748, | |
| 247 | CPU_MB8884, | |
| 248 | CPU_N7751, | |
| 249 | CPU_I8039, | |
| 250 | CPU_I8049, | |
| 251 | CPU_I8749, | |
| 252 | CPU_M58715, | |
| 253 | CPU_I8041, | |
| 254 | CPU_I8741, | |
| 255 | CPU_I8042, | |
| 256 | CPU_I8242, | |
| 257 | CPU_I8742, | |
| 258 | CPU_I8031, | |
| 259 | CPU_I8032, | |
| 260 | CPU_I8051, | |
| 261 | CPU_I8052, | |
| 262 | CPU_I8751, | |
| 263 | CPU_I8752, | |
| 264 | CPU_I80C31, | |
| 265 | CPU_I80C32, | |
| 266 | CPU_I80C51, | |
| 267 | CPU_I80C52, | |
| 268 | CPU_I87C51, | |
| 269 | CPU_I87C52, | |
| 270 | CPU_AT89C4051, | |
| 271 | CPU_DS5002FP, | |
| 272 | CPU_M6800, | |
| 273 | CPU_M6801, | |
| 274 | CPU_M6802, | |
| 275 | CPU_M6803, | |
| 276 | CPU_M6808, | |
| 277 | CPU_HD63701, | |
| 278 | CPU_NSC8105, | |
| 279 | CPU_M6805, | |
| 280 | CPU_M68705, | |
| 281 | CPU_HD63705, | |
| 282 | CPU_HD6309, | |
| 283 | CPU_M6809, | |
| 284 | CPU_M6809E, | |
| 285 | CPU_KONAMI, | |
| 286 | CPU_M68000, | |
| 287 | CPU_M68008, | |
| 288 | CPU_M68010, | |
| 289 | CPU_M68EC020, | |
| 290 | CPU_M68020, | |
| 291 | CPU_M68040, | |
| 292 | CPU_T11, | |
| 293 | CPU_S2650, | |
| 294 | CPU_TMS34010, | |
| 295 | CPU_TMS34020, | |
| 296 | CPU_TI990_10, | |
| 297 | CPU_TMS9900, | |
| 298 | CPU_TMS9980, | |
| 299 | CPU_TMS9995, | |
| 300 | CPU_Z8000, | |
| 301 | CPU_TMS32010, | |
| 302 | CPU_TMS32025, | |
| 303 | CPU_TMS32026, | |
| 304 | CPU_TMS32031, | |
| 305 | CPU_TMS32032, | |
| 306 | CPU_TMS32051, | |
| 307 | CPU_CCPU, | |
| 308 | CPU_ADSP2100, | |
| 309 | CPU_ADSP2101, | |
| 310 | CPU_ADSP2104, | |
| 311 | CPU_ADSP2105, | |
| 312 | CPU_ADSP2115, | |
| 313 | CPU_ADSP2181, | |
| 314 | CPU_PSXCPU, | |
| 315 | CPU_ASAP, | |
| 316 | CPU_UPD7810, | |
| 317 | CPU_UPD7807, | |
| 318 | CPU_UPD7801, | |
| 319 | CPU_UPD78C05, | |
| 320 | CPU_UPD78C06, | |
| 321 | CPU_JAGUARGPU, | |
| 322 | CPU_JAGUARDSP, | |
| 323 | CPU_CQUESTSND, | |
| 324 | CPU_CQUESTROT, | |
| 325 | CPU_CQUESTLIN, | |
| 326 | CPU_R3000BE, | |
| 327 | CPU_R3000LE, | |
| 328 | CPU_R3041BE, | |
| 329 | CPU_R3041LE, | |
| 330 | CPU_R4600BE, | |
| 331 | CPU_R4600LE, | |
| 332 | CPU_R4650BE, | |
| 333 | CPU_R4650LE, | |
| 334 | CPU_R4700BE, | |
| 335 | CPU_R4700LE, | |
| 336 | CPU_R5000BE, | |
| 337 | CPU_R5000LE, | |
| 338 | CPU_QED5271BE, | |
| 339 | CPU_QED5271LE, | |
| 340 | CPU_RM7000BE, | |
| 341 | CPU_RM7000LE, | |
| 342 | CPU_ARM, | |
| 343 | CPU_ARM7, | |
| 344 | CPU_SH1, | |
| 345 | CPU_SH2, | |
| 346 | CPU_SH4, | |
| 347 | CPU_DSP32C, | |
| 348 | CPU_PIC16C54, | |
| 349 | CPU_PIC16C55, | |
| 350 | CPU_PIC16C56, | |
| 351 | CPU_PIC16C57, | |
| 352 | CPU_PIC16C58, | |
| 353 | CPU_G65816, | |
| 354 | CPU_SPC700, | |
| 355 | CPU_E116T, | |
| 356 | CPU_E116XT, | |
| 357 | CPU_E116XS, | |
| 358 | CPU_E116XSR, | |
| 359 | CPU_E132N, | |
| 360 | CPU_E132T, | |
| 361 | CPU_E132XN, | |
| 362 | CPU_E132XT, | |
| 363 | CPU_E132XS, | |
| 364 | CPU_E132XSR, | |
| 365 | CPU_GMS30C2116, | |
| 366 | CPU_GMS30C2132, | |
| 367 | CPU_GMS30C2216, | |
| 368 | CPU_GMS30C2232, | |
| 369 | CPU_I386, | |
| 370 | CPU_I486, | |
| 371 | CPU_PENTIUM, | |
| 372 | CPU_MEDIAGX, | |
| 373 | CPU_I960, | |
| 374 | CPU_H83002, | |
| 375 | CPU_H83007, | |
| 376 | CPU_H83044, | |
| 377 | CPU_H83334, | |
| 378 | CPU_V810, | |
| 379 | CPU_M37702, | |
| 380 | CPU_M37710, | |
| 381 | CPU_PPC403GA, | |
| 382 | CPU_PPC403GCX, | |
| 383 | CPU_PPC601, | |
| 384 | CPU_PPC602, | |
| 385 | CPU_PPC603, | |
| 386 | CPU_PPC603E, | |
| 387 | CPU_PPC603R, | |
| 388 | CPU_PPC604, | |
| 389 | CPU_MPC8240, | |
| 390 | CPU_SE3208, | |
| 391 | CPU_MC68HC11, | |
| 392 | CPU_ADSP21062, | |
| 393 | CPU_DSP56156, | |
| 394 | CPU_RSP, | |
| 395 | CPU_ALPHA8201, | |
| 396 | CPU_ALPHA8301, | |
| 397 | CPU_CDP1802, | |
| 398 | CPU_COP401, | |
| 399 | CPU_COP410, | |
| 400 | CPU_COP411, | |
| 401 | CPU_COP402, | |
| 402 | CPU_COP420, | |
| 403 | CPU_COP421, | |
| 404 | CPU_COP422, | |
| 405 | CPU_COP404, | |
| 406 | CPU_COP424, | |
| 407 | CPU_COP425, | |
| 408 | CPU_COP426, | |
| 409 | CPU_COP444, | |
| 410 | CPU_COP445, | |
| 411 | CPU_TMP90840, | |
| 412 | CPU_TMP90841, | |
| 413 | CPU_TMP91640, | |
| 414 | CPU_TMP91641, | |
| 415 | CPU_APEXC, | |
| 416 | CPU_CP1610, | |
| 417 | CPU_F8, | |
| 418 | CPU_LH5801, | |
| 419 | CPU_PDP1, | |
| 420 | CPU_SATURN, | |
| 421 | CPU_SC61860, | |
| 422 | CPU_TX0_64KW, | |
| 423 | CPU_TX0_8KW, | |
| 424 | CPU_LR35902, | |
| 425 | CPU_TMS7000, | |
| 426 | CPU_TMS7000_EXL, | |
| 427 | CPU_SM8500, | |
| 428 | CPU_V30MZ, | |
| 429 | CPU_MB8841, | |
| 430 | CPU_MB8842, | |
| 431 | CPU_MB8843, | |
| 432 | CPU_MB8844, | |
| 433 | CPU_MB86233, | |
| 434 | CPU_SSP1601, | |
| 435 | CPU_MINX, | |
| 436 | CPU_CXD8661R, | |
| 437 | CPU_COUNT | |
| 438 | }; | |
| 439 | typedef enum _cpu_type cpu_type; | |
| 220 | /* state table flags */ | |
| 221 | #define CPUSTATE_NOSHOW 0x01 /* don't display this entry in the registers view */ | |
| 222 | #define CPUSTATE_IMPORT 0x02 /* call the import function after writing new data */ | |
| 223 | #define CPUSTATE_IMPORT_SEXT 0x04 /* sign-extend the data when writing new data */ | |
| 224 | #define CPUSTATE_EXPORT 0x08 /* call the export function prior to fetching the data */ | |
| 440 | 225 | |
| 441 | 226 | |
| 442 | 227 | |
| r3957 | r3958 | |
| 446 | 231 | |
| 447 | 232 | #define IRQ_CALLBACK(func) int func(const device_config *device, int irqline) |
| 448 | 233 | |
| 449 | #define CPU_GET_INFO_NAME(name) cpu_get_info_##name | |
| 450 | #define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *device, UINT32 state, cpuinfo *info) | |
| 451 | #define CPU_GET_INFO_CALL(name) CPU_GET_INFO_NAME(name)(device, state, info) | |
| 234 | #define CPU_GET_INFO_NAME(name) cpu_get_info_##name | |
| 235 | #define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *device, UINT32 state, cpuinfo *info) | |
| 236 | #define CPU_GET_INFO_CALL(name) CPU_GET_INFO_NAME(name)(device, state, info) | |
| 452 | 237 | |
| 453 | #define CPU_SET_INFO_NAME(name) cpu_set_info_##name | |
| 454 | #define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(const device_config *device, UINT32 state, cpuinfo *info) | |
| 455 | #define CPU_SET_INFO_CALL(name) CPU_SET_INFO_NAME(name)(device, state, info) | |
| 238 | #define CPU_SET_INFO_NAME(name) cpu_set_info_##name | |
| 239 | #define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(const device_config *device, UINT32 state, cpuinfo *info) | |
| 240 | #define CPU_SET_INFO_CALL(name) CPU_SET_INFO_NAME(name)(device, state, info) | |
| 456 | 241 | |
| 457 | #define CPU_INIT_NAME(name) cpu_init_##name | |
| 458 | #define CPU_INIT(name) void CPU_INIT_NAME(name)(const device_config *device, int index, int clock, cpu_irq_callback irqcallback) | |
| 459 | #define CPU_INIT_CALL(name) CPU_INIT_NAME(name)(device, index, clock, irqcallback) | |
| 242 | #define CPU_INIT_NAME(name) cpu_init_##name | |
| 243 | #define CPU_INIT(name) void CPU_INIT_NAME(name)(const device_config *device, cpu_irq_callback irqcallback) | |
| 244 | #define CPU_INIT_CALL(name) CPU_INIT_NAME(name)(device, irqcallback) | |
| 460 | 245 | |
| 461 | #define CPU_RESET_NAME(name) cpu_reset_##name | |
| 462 | #define CPU_RESET(name) void CPU_RESET_NAME(name)(const device_config *device) | |
| 463 | #define CPU_RESET_CALL(name) CPU_RESET_NAME(name)(device) | |
| 246 | #define CPU_RESET_NAME(name) cpu_reset_##name | |
| 247 | #define CPU_RESET(name) void CPU_RESET_NAME(name)(const device_config *device) | |
| 248 | #define CPU_RESET_CALL(name) CPU_RESET_NAME(name)(device) | |
| 464 | 249 | |
| 465 | #define CPU_EXIT_NAME(name) cpu_exit_##name | |
| 466 | #define CPU_EXIT(name) void CPU_EXIT_NAME(name)(const device_config *device) | |
| 467 | #define CPU_EXIT_CALL(name) CPU_EXIT_NAME(name)(device) | |
| 250 | #define CPU_EXIT_NAME(name) cpu_exit_##name | |
| 251 | #define CPU_EXIT(name) void CPU_EXIT_NAME(name)(const device_config *device) | |
| 252 | #define CPU_EXIT_CALL(name) CPU_EXIT_NAME(name)(device) | |
| 468 | 253 | |
| 469 | #define CPU_EXECUTE_NAME(name) cpu_execute_##name | |
| 470 | #define CPU_EXECUTE(name) int CPU_EXECUTE_NAME(name)(const device_config *device, int cycles) | |
| 471 | #define CPU_EXECUTE_CALL(name) CPU_EXECUTE_NAME(name)(device, cycles) | |
| 254 | #define CPU_EXECUTE_NAME(name) cpu_execute_##name | |
| 255 | #define CPU_EXECUTE(name) int CPU_EXECUTE_NAME(name)(const device_config *device, int cycles) | |
| 256 | #define CPU_EXECUTE_CALL(name) CPU_EXECUTE_NAME(name)(device, cycles) | |
| 472 | 257 | |
| 473 | #define CPU_BURN_NAME(name) cpu_burn_##name | |
| 474 | #define CPU_BURN(name) void CPU_BURN_NAME(name)(const device_config *device, int cycles) | |
| 475 | #define CPU_BURN_CALL(name) CPU_BURN_NAME(name)(device, cycles) | |
| 258 | #define CPU_BURN_NAME(name) cpu_burn_##name | |
| 259 | #define CPU_BURN(name) void CPU_BURN_NAME(name)(const device_config *device, int cycles) | |
| 260 | #define CPU_BURN_CALL(name) CPU_BURN_NAME(name)(device, cycles) | |
| 476 | 261 | |
| 477 | #define CPU_TRANSLATE_NAME(name) cpu_translate_##name | |
| 478 | #define CPU_TRANSLATE(name) int CPU_TRANSLATE_NAME(name)(const device_config *device, int space, int intention, offs_t *address) | |
| 479 | #define CPU_TRANSLATE_CALL(name) CPU_TRANSLATE_NAME(name)(device, space, intention, address) | |
| 262 | #define CPU_TRANSLATE_NAME(name) cpu_translate_##name | |
| 263 | #define CPU_TRANSLATE(name) int CPU_TRANSLATE_NAME(name)(const device_config *device, int space, int intention, offs_t *address) | |
| 264 | #define CPU_TRANSLATE_CALL(name) CPU_TRANSLATE_NAME(name)(device, space, intention, address) | |
| 480 | 265 | |
| 481 | #define CPU_READ_NAME(name) cpu_read_##name | |
| 482 | #define CPU_READ(name) int CPU_READ_NAME(name)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value) | |
| 483 | #define CPU_READ_CALL(name) CPU_READ_NAME(name)(device, space, offset, size, value) | |
| 266 | #define CPU_READ_NAME(name) cpu_read_##name | |
| 267 | #define CPU_READ(name) int CPU_READ_NAME(name)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value) | |
| 268 | #define CPU_READ_CALL(name) CPU_READ_NAME(name)(device, space, offset, size, value) | |
| 484 | 269 | |
| 485 | #define CPU_WRITE_NAME(name) cpu_write_##name | |
| 486 | #define CPU_WRITE(name) int CPU_WRITE_NAME(name)(const device_config *device, int space, UINT32 offset, int size, UINT64 value) | |
| 487 | #define CPU_WRITE_CALL(name) CPU_WRITE_NAME(name)(device, space, offset, size, value) | |
| 270 | #define CPU_WRITE_NAME(name) cpu_write_##name | |
| 271 | #define CPU_WRITE(name) int CPU_WRITE_NAME(name)(const device_config *device, int space, UINT32 offset, int size, UINT64 value) | |
| 272 | #define CPU_WRITE_CALL(name) CPU_WRITE_NAME(name)(device, space, offset, size, value) | |
| 488 | 273 | |
| 489 | #define CPU_READOP_NAME(name) cpu_readop_##name | |
| 490 | #define CPU_READOP(name) int CPU_READOP_NAME(name)(const device_config *device, UINT32 offset, int size, UINT64 *value) | |
| 491 | #define CPU_READOP_CALL(name) CPU_READOP_NAME(name)(device, offset, size, value) | |
| 274 | #define CPU_READOP_NAME(name) cpu_readop_##name | |
| 275 | #define CPU_READOP(name) int CPU_READOP_NAME(name)(const device_config *device, UINT32 offset, int size, UINT64 *value) | |
| 276 | #define CPU_READOP_CALL(name) CPU_READOP_NAME(name)(device, offset, size, value) | |
| 492 | 277 | |
| 493 | #define CPU_DEBUG_INIT_NAME(name) cpu_debug_init_##name | |
| 494 | #define CPU_DEBUG_INIT(name) void CPU_DEBUG_INIT_NAME(name)(const device_config *device) | |
| 495 | #define CPU_DEBUG_INIT_CALL(name) CPU_DEBUG_INIT_NAME(name)(device) | |
| 278 | #define CPU_DEBUG_INIT_NAME(name) cpu_debug_init_##name | |
| 279 | #define CPU_DEBUG_INIT(name) void CPU_DEBUG_INIT_NAME(name)(const device_config *device) | |
| 280 | #define CPU_DEBUG_INIT_CALL(name) CPU_DEBUG_INIT_NAME(name)(device) | |
| 496 | 281 | |
| 497 | #define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name | |
| 498 | #define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) | |
| 499 | #define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram) | |
| 282 | #define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name | |
| 283 | #define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) | |
| 284 | #define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram) | |
| 500 | 285 | |
| 501 | 286 | #define CPU_VALIDITY_CHECK_NAME(name) cpu_validity_check_##name |
| 502 | 287 | #define CPU_VALIDITY_CHECK(name) int CPU_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const void *config) |
| 503 | 288 | #define CPU_VALIDITY_CHECK_CALL(name) CPU_VALIDITY_CHECK_NAME(name)(driver, config) |
| 504 | 289 | |
| 290 | #define CPU_IMPORT_STATE_NAME(name) cpu_state_import_##name | |
| 291 | #define CPU_IMPORT_STATE(name) void CPU_IMPORT_STATE_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry) | |
| 292 | #define CPU_IMPORT_STATE_CALL(name) CPU_IMPORT_STATE_NAME(name)(device, baseptr, entry) | |
| 505 | 293 | |
| 506 | /* helpers for accessing common CPU state */ | |
| 507 | #define cpu_get_context_size(cpu) cpu_get_info_int(cpu, CPUINFO_INT_CONTEXT_SIZE) | |
| 508 | #define cpu_get_input_lines(cpu) cpu_get_info_int(cpu, CPUINFO_INT_INPUT_LINES) | |
| 509 | #define cpu_get_output_lines(cpu) cpu_get_info_int(cpu, CPUINFO_INT_OUTPUT_LINES) | |
| 510 | #define cpu_get_default_irq_vector(cpu) cpu_get_info_int(cpu, CPUINFO_INT_DEFAULT_IRQ_VECTOR) | |
| 511 | #define cpu_get_endianness(cpu) cpu_get_info_int(cpu, CPUINFO_INT_ENDIANNESS) | |
| 512 | #define cpu_get_clock_multiplier(cpu) cpu_get_info_int(cpu, CPUINFO_INT_CLOCK_MULTIPLIER) | |
| 513 | #define cpu_get_clock_divider(cpu) cpu_get_info_int(cpu, CPUINFO_INT_CLOCK_DIVIDER) | |
| 514 | #define cpu_get_min_opcode_bytes(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MIN_INSTRUCTION_BYTES) | |
| 515 | #define cpu_get_max_opcode_bytes(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MAX_INSTRUCTION_BYTES) | |
| 516 | #define cpu_get_min_cycles(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MIN_CYCLES) | |
| 517 | #define cpu_get_max_cycles(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MAX_CYCLES) | |
| 518 | #define cpu_get_databus_width(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_DATABUS_WIDTH + (space)) | |
| 519 | #define cpu_get_addrbus_width(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_ADDRBUS_WIDTH + (space)) | |
| 520 | #define cpu_get_addrbus_shift(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_ADDRBUS_SHIFT + (space)) | |
| 521 | #define cpu_get_logaddr_width(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_LOGADDR_WIDTH + (space)) | |
| 522 | #define cpu_get_page_shift(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_PAGE_SHIFT + (space)) | |
| 523 | #define cpu_get_reg(cpu, reg) cpu_get_info_int(cpu, CPUINFO_INT_REGISTER + (reg)) | |
| 524 | #define cpu_get_previouspc(cpu) ((offs_t)cpu_get_reg(cpu, REG_PREVIOUSPC)) | |
| 525 | #define cpu_get_pc(cpu) ((offs_t)cpu_get_reg(cpu, REG_PC)) | |
| 526 | #define cpu_get_sp(cpu) cpu_get_reg(cpu, REG_SP) | |
| 527 | #define cpu_get_icount_ptr(cpu) (int *)cpu_get_info_ptr(cpu, CPUINFO_PTR_INSTRUCTION_COUNTER) | |
| 528 | #define cpu_get_debug_register_list(cpu) cpu_get_info_ptr(cpu, CPUINFO_PTR_DEBUG_REGISTER_LIST) | |
| 529 | #define cpu_get_name(cpu) cpu_get_info_string(cpu, CPUINFO_STR_NAME) | |
| 530 | #define cpu_get_core_family(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_FAMILY) | |
| 531 | #define cpu_get_core_version(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_VERSION) | |
| 532 | #define cpu_get_core_file(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_FILE) | |
| 533 | #define cpu_get_core_credits(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_CREDITS) | |
| 534 | #define cpu_get_flags_string(cpu) cpu_get_info_string(cpu, CPUINFO_STR_FLAGS) | |
| 535 | #define cpu_get_irq_string(cpu, irq) cpu_get_info_string(cpu, CPUINFO_STR_IRQ_STATE + (irq)) | |
| 536 | #define cpu_get_reg_string(cpu, reg) cpu_get_info_string(cpu, CPUINFO_STR_REGISTER + (reg)) | |
| 537 | #define cpu_set_reg(cpu, reg, val) cpu_set_info_int(cpu, CPUINFO_INT_REGISTER + (reg), (val)) | |
| 294 | #define CPU_EXPORT_STATE_NAME(name) cpu_state_export_##name | |
| 295 | #define CPU_EXPORT_STATE(name) void CPU_EXPORT_STATE_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry) | |
| 296 | #define CPU_EXPORT_STATE_CALL(name) CPU_EXPORT_STATE_NAME(name)(device, baseptr, entry) | |
| 538 | 297 | |
| 298 | #define CPU_IMPORT_STRING_NAME(name) cpu_string_import_##name | |
| 299 | #define CPU_IMPORT_STRING(name) void CPU_IMPORT_STRING_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string) | |
| 300 | #define CPU_IMPORT_STRING_CALL(name) CPU_IMPORT_STRING_NAME(name)(device, baseptr, entry, string) | |
| 539 | 301 | |
| 540 | /* helpers for accessing common CPU type state */ | |
| 541 | #define cputype_get_context_size(cputype) cputype_get_info_int(cputype, CPUINFO_INT_CONTEXT_SIZE) | |
| 542 | #define cputype_get_input_lines(cputype) cputype_get_info_int(cputype, CPUINFO_INT_INPUT_LINES) | |
| 543 | #define cputype_get_output_lines(cputype) cputype_get_info_int(cputype, CPUINFO_INT_OUTPUT_LINES) | |
| 544 | #define cputype_get_default_irq_vector(cputype) cputype_get_info_int(cputype, CPUINFO_INT_DEFAULT_IRQ_VECTOR) | |
| 545 | #define cputype_get_endianness(cputype) cputype_get_info_int(cputype, CPUINFO_INT_ENDIANNESS) | |
| 546 | #define cputype_get_clock_multiplier(cputype) cputype_get_info_int(cputype, CPUINFO_INT_CLOCK_MULTIPLIER) | |
| 547 | #define cputype_get_clock_divider(cputype) cputype_get_info_int(cputype, CPUINFO_INT_CLOCK_DIVIDER) | |
| 548 | #define cputype_get_min_instruction_bytes(cputype) cputype_get_info_int(cputype, CPUINFO_INT_MIN_INSTRUCTION_BYTES) | |
| 549 | #define cputype_get_max_instruction_bytes(cputype) cputype_get_info_int(cputype, CPUINFO_INT_MAX_INSTRUCTION_BYTES) | |
| 550 | #define cputype_get_min_cycles(cputype) cputype_get_info_int(cputype, CPUINFO_INT_MIN_CYCLES) | |
| 551 | #define cputype_get_max_cycles(cputype) cputype_get_info_int(cputype, CPUINFO_INT_MAX_CYCLES) | |
| 552 | #define cputype_get_databus_width(cputype, space) cputype_get_info_int(cputype, CPUINFO_INT_DATABUS_WIDTH + (space)) | |
| 553 | #define cputype_get_addrbus_width(cputype, space) cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_WIDTH + (space)) | |
| 554 | #define cputype_get_addrbus_shift(cputype, space) cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_SHIFT + (space)) | |
| 555 | #define cputype_get_logaddr_width(cputype, space) cputype_get_info_int(cputype, CPUINFO_INT_LOGADDR_WIDTH + (space)) | |
| 556 | #define cputype_get_page_shift(cputype, space) cputype_get_info_int(cputype, CPUINFO_INT_PAGE_SHIFT + (space)) | |
| 557 | #define cputype_get_debug_register_list(cputype) cputype_get_info_ptr(cputype, CPUINFO_PTR_DEBUG_REGISTER_LIST) | |
| 558 | #define cputype_get_name(cputype) cputype_get_info_string(cputype, CPUINFO_STR_NAME) | |
| 559 | #define cputype_get_core_family(cputype) cputype_get_info_string(cputype, CPUINFO_STR_CORE_FAMILY) | |
| 560 | #define cputype_get_core_version(cputype) cputype_get_info_string(cputype, CPUINFO_STR_CORE_VERSION) | |
| 561 | #define cputype_get_core_file(cputype) cputype_get_info_string(cputype, CPUINFO_STR_CORE_FILE) | |
| 562 | #define cputype_get_core_credits(cputype) cputype_get_info_string(cputype, CPUINFO_STR_CORE_CREDITS) | |
| 302 | #define CPU_EXPORT_STRING_NAME(name) cpu_string_export_##name | |
| 303 | #define CPU_EXPORT_STRING(name) void CPU_EXPORT_STRING_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string) | |
| 304 | #define CPU_EXPORT_STRING_CALL(name) CPU_EXPORT_STRING_NAME(name)(device, baseptr, entry, string) | |
| 563 | 305 | |
| 564 | 306 | |
| 307 | ||
| 308 | #define cpu_get_index(cpu) device_list_index((cpu)->machine->config->devicelist, CPU, (cpu)->tag) | |
| 309 | ||
| 310 | ||
| 311 | /* helpers for accessing common CPU state */ | |
| 312 | #define cpu_get_context_size(cpu) device_get_info_int(cpu, CPUINFO_INT_CONTEXT_SIZE) | |
| 313 | #define cpu_get_input_lines(cpu) device_get_info_int(cpu, CPUINFO_INT_INPUT_LINES) | |
| 314 | #define cpu_get_output_lines(cpu) device_get_info_int(cpu, CPUINFO_INT_OUTPUT_LINES) | |
| 315 | #define cpu_get_default_irq_vector(cpu) device_get_info_int(cpu, CPUINFO_INT_DEFAULT_IRQ_VECTOR) | |
| 316 | #define cpu_get_endianness(cpu) device_get_info_int(cpu, CPUINFO_INT_ENDIANNESS) | |
| 317 | #define cpu_get_clock_multiplier(cpu) device_get_info_int(cpu, CPUINFO_INT_CLOCK_MULTIPLIER) | |
| 318 | #define cpu_get_clock_divider(cpu) device_get_info_int(cpu, CPUINFO_INT_CLOCK_DIVIDER) | |
| 319 | #define cpu_get_min_opcode_bytes(cpu) device_get_info_int(cpu, CPUINFO_INT_MIN_INSTRUCTION_BYTES) | |
| 320 | #define cpu_get_max_opcode_bytes(cpu) device_get_info_int(cpu, CPUINFO_INT_MAX_INSTRUCTION_BYTES) | |
| 321 | #define cpu_get_min_cycles(cpu) device_get_info_int(cpu, CPUINFO_INT_MIN_CYCLES) | |
| 322 | #define cpu_get_max_cycles(cpu) device_get_info_int(cpu, CPUINFO_INT_MAX_CYCLES) | |
| 323 | #define cpu_get_databus_width(cpu, space) device_get_info_int(cpu, CPUINFO_INT_DATABUS_WIDTH + (space)) | |
| 324 | #define cpu_get_addrbus_width(cpu, space) device_get_info_int(cpu, CPUINFO_INT_ADDRBUS_WIDTH + (space)) | |
| 325 | #define cpu_get_addrbus_shift(cpu, space) device_get_info_int(cpu, CPUINFO_INT_ADDRBUS_SHIFT + (space)) | |
| 326 | #define cpu_get_logaddr_width(cpu, space) device_get_info_int(cpu, CPUINFO_INT_LOGADDR_WIDTH + (space)) | |
| 327 | #define cpu_get_page_shift(cpu, space) device_get_info_int(cpu, CPUINFO_INT_PAGE_SHIFT + (space)) | |
| 328 | #define cpu_get_reg(cpu, reg) device_get_info_int(cpu, CPUINFO_INT_REGISTER + (reg)) | |
| 329 | #define cpu_get_previouspc(cpu) ((offs_t)cpu_get_reg(cpu, REG_GENPCBASE)) | |
| 330 | #define cpu_get_pc(cpu) ((offs_t)cpu_get_reg(cpu, REG_GENPC)) | |
| 331 | #define cpu_get_sp(cpu) cpu_get_reg(cpu, REG_GENSP) | |
| 332 | #define cpu_get_icount_ptr(cpu) (int *)device_get_info_ptr(cpu, CPUINFO_PTR_INSTRUCTION_COUNTER) | |
| 333 | #define cpu_get_state_table(cpu) (const cpu_state_table *)device_get_info_ptr(cpu, CPUINFO_PTR_STATE_TABLE) | |
| 334 | #define cpu_get_name(cpu) device_get_info_string(cpu, CPUINFO_STR_NAME) | |
| 335 | #define cpu_get_core_family(cpu) device_get_info_string(cpu, CPUINFO_STR_CORE_FAMILY) | |
| 336 | #define cpu_get_core_version(cpu) device_get_info_string(cpu, CPUINFO_STR_CORE_VERSION) | |
| 337 | #define cpu_get_core_file(cpu) device_get_info_string(cpu, CPUINFO_STR_CORE_FILE) | |
| 338 | #define cpu_get_core_credits(cpu) device_get_info_string(cpu, CPUINFO_STR_CORE_CREDITS) | |
| 339 | #define cpu_get_flags_string(cpu) device_get_info_string(cpu, CPUINFO_STR_FLAGS) | |
| 340 | #define cpu_get_irq_string(cpu, irq) device_get_info_string(cpu, CPUINFO_STR_IRQ_STATE + (irq)) | |
| 341 | #define cpu_get_reg_string(cpu, reg) device_get_info_string(cpu, CPUINFO_STR_REGISTER + (reg)) | |
| 342 | #define cpu_set_reg(cpu, reg, val) device_set_info_int(cpu, CPUINFO_INT_REGISTER + (reg), (val)) | |
| 343 | ||
| 344 | ||
| 565 | 345 | /* helpers for using machine/cputag instead of cpu objects */ |
| 566 | #define cputag_reset(mach, tag) c | |
| 346 | #define cputag_reset(mach, tag) device | |
| 567 | 347 | #define cputag_get_index(mach, tag) cpu_get_index(cputag_get_cpu(mach, tag)) |
| 568 | 348 | #define cputag_get_address_space(mach, tag, space) cpu_get_address_space(cputag_get_cpu(mach, tag), space) |
| 569 | 349 | |
| 570 | 350 | |
| 351 | #define CPU_STATE_ENTRY(_index, _symbol, _format, _struct, _member, _datamask, _validmask, _flags) \ | |
| 352 | { _index, _validmask, offsetof(_struct, _member), _datamask, sizeof(((_struct *)0)->_member), _flags, _symbol, _format }, | |
| 571 | 353 | |
| 354 | ||
| 355 | ||
| 572 | 356 | /*************************************************************************** |
| 573 | 357 | TYPE DEFINITIONS |
| 574 | 358 | ***************************************************************************/ |
| 575 | 359 | |
| 576 | /* opaque definition of CPU debugging info */ | |
| 360 | /* opaque definition of CPU internal and debugging info */ | |
| 577 | 361 | typedef struct _cpu_debug_data cpu_debug_data; |
| 578 | 362 | |
| 579 | 363 | |
| 580 | /* forward declaration of t | |
| 364 | /* forward declaration of types | |
| 581 | 365 | typedef union _cpuinfo cpuinfo; |
| 366 | typedef struct _cpu_state_entry cpu_state_entry; | |
| 582 | 367 | |
| 583 | 368 | |
| 584 | 369 | /* define the various callback functions */ |
| r3957 | r3958 | |
| 586 | 371 | |
| 587 | 372 | typedef void (*cpu_get_info_func)(const device_config *device, UINT32 state, cpuinfo *info); |
| 588 | 373 | typedef void (*cpu_set_info_func)(const device_config *device, UINT32 state, cpuinfo *info); |
| 589 | typedef void (*cpu_init_func)(const device_config *device, | |
| 374 | typedef void (*cpu_init_func)(const device_config *device, | |
| 590 | 375 | typedef void (*cpu_reset_func)(const device_config *device); |
| 591 | 376 | typedef void (*cpu_exit_func)(const device_config *device); |
| 592 | 377 | typedef int (*cpu_execute_func)(const device_config *device, int cycles); |
| r3957 | r3958 | |
| 597 | 382 | typedef int (*cpu_readop_func)(const device_config *device, UINT32 offset, int size, UINT64 *value); |
| 598 | 383 | typedef void (*cpu_debug_init_func)(const device_config *device); |
| 599 | 384 | typedef offs_t (*cpu_disassemble_func)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); |
| 600 | ||
| 601 | 385 | typedef int (*cpu_validity_check_func)(const game_driver *driver, const void *config); |
| 386 | typedef void (*cpu_state_io_func)(const device_config *device, void *baseptr, const cpu_state_entry *entry); | |
| 387 | typedef void (*cpu_string_io_func)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string); | |
| 602 | 388 | |
| 603 | 389 | |
| 390 | /* structure describing a single item of exposed CPU state */ | |
| 391 | struct _cpu_state_entry | |
| 392 | { | |
| 393 | UINT32 index; /* state index this entry applies to */ | |
| 394 | UINT32 validmask; /* mask for which CPU subtypes this entry is valid */ | |
| 395 | FPTR dataoffs; /* offset to the data, relative to the baseptr */ | |
| 396 | UINT64 mask; /* mask applied to the data */ | |
| 397 | UINT8 datasize; /* size of the data item in memory */ | |
| 398 | UINT8 flags; /* flags */ | |
| 399 | const char * symbol; /* symbol for display; all lower-case version for expressions */ | |
| 400 | const char * format; /* supported formats */ | |
| 401 | }; | |
| 402 | ||
| 403 | ||
| 404 | /* structure describing a table of exposed CPU state */ | |
| 405 | typedef struct _cpu_state_table cpu_state_table; | |
| 406 | struct _cpu_state_table | |
| 407 | { | |
| 408 | void * baseptr; /* pointer to the base of state (offsets are relative to this) */ | |
| 409 | UINT32 subtypemask; /* mask of subtypes that apply to this CPU */ | |
| 410 | UINT32 entrycount; /* number of entries */ | |
| 411 | const cpu_state_entry * entrylist; /* array of entries */ | |
| 412 | }; | |
| 413 | ||
| 414 | ||
| 415 | /* a cpu_type is just a pointer to the CPU's get_info function */ | |
| 416 | typedef cpu_get_info_func cpu_type; | |
| 417 | ||
| 418 | ||
| 604 | 419 | /* cpuinfo union used to pass data to/from the get_info/set_info functions */ |
| 605 | 420 | union _cpuinfo |
| 606 | 421 | { |
| r3957 | r3958 | |
| 609 | 424 | genf * f; /* generic function pointers */ |
| 610 | 425 | char * s; /* generic strings */ |
| 611 | 426 | |
| 612 | cpu_set_info_func setinfo; /* CPUINFO_PTR_SET_INFO */ | |
| 613 | cpu_init_func init; /* CPUINFO_PTR_INIT */ | |
| 614 | cpu_reset_func reset; /* CPUINFO_PTR_RESET */ | |
| 615 | cpu_exit_func exit; /* CPUINFO_PTR_EXIT */ | |
| 616 | cpu_execute_func execute; /* CPUINFO_PTR_EXECUTE */ | |
| 617 | cpu_burn_func burn; /* CPUINFO_PTR_BURN */ | |
| 618 | cpu_translate_func translate; /* CPUINFO_PTR_TRANSLATE */ | |
| 619 | cpu_read_func read; /* CPUINFO_PTR_READ */ | |
| 620 | cpu_write_func write; /* CPUINFO_PTR_WRITE */ | |
| 621 | cpu_readop_func readop; /* CPUINFO_PTR_READOP */ | |
| 622 | cpu_debug_init_func debug_init; /* CPUINFO_PTR_DEBUG_INIT */ | |
| 623 | cpu_disassemble_func disassemble; /* CPUINFO_PTR_DISASSEMBLE */ | |
| 624 | cpu_validity_check_func validity_check; /* CPUINFO_PTR_VALIDITY_CHECK */ | |
| 427 | cpu_set_info_func setinfo; /* CPUINFO_FCT_SET_INFO */ | |
| 428 | cpu_init_func init; /* CPUINFO_FCT_INIT */ | |
| 429 | cpu_reset_func reset; /* CPUINFO_FCT_RESET */ | |
| 430 | cpu_exit_func exit; /* CPUINFO_FCT_EXIT */ | |
| 431 | cpu_execute_func execute; /* CPUINFO_FCT_EXECUTE */ | |
| 432 | cpu_burn_func burn; /* CPUINFO_FCT_BURN */ | |
| 433 | cpu_translate_func translate; /* CPUINFO_FCT_TRANSLATE */ | |
| 434 | cpu_read_func read; /* CPUINFO_FCT_READ */ | |
| 435 | cpu_write_func write; /* CPUINFO_FCT_WRITE */ | |
| 436 | cpu_readop_func readop; /* CPUINFO_FCT_READOP */ | |
| 437 | cpu_debug_init_func debug_init; /* CPUINFO_FCT_DEBUG_INIT */ | |
| 438 | cpu_disassemble_func disassemble; /* CPUINFO_FCT_DISASSEMBLE */ | |
| 439 | cpu_validity_check_func validity_check; /* CPUINFO_FCT_VALIDITY_CHECK */ | |
| 440 | cpu_state_io_func import_state; /* CPUINFO_FCT_IMPORT_STATE */ | |
| 441 | cpu_state_io_func export_state; /* CPUINFO_FCT_EXPORT_STATE */ | |
| 442 | cpu_string_io_func import_string; /* CPUINFO_FCT_IMPORT_STRING */ | |
| 443 | cpu_string_io_func export_string; /* CPUINFO_FCT_EXPORT_STRING */ | |
| 625 | 444 | int * icount; /* CPUINFO_PTR_INSTRUCTION_COUNTER */ |
| 445 | const cpu_state_table * state_table; /* CPUINFO_PTR_STATE_TABLE */ | |
| 626 | 446 | const addrmap8_token * internal_map8; /* CPUINFO_PTR_INTERNAL_MEMORY_MAP */ |
| 627 | 447 | const addrmap16_token * internal_map16; /* CPUINFO_PTR_INTERNAL_MEMORY_MAP */ |
| 628 | 448 | const addrmap32_token * internal_map32; /* CPUINFO_PTR_INTERNAL_MEMORY_MAP */ |
| r3957 | r3958 | |
| 634 | 454 | typedef struct _cpu_class_header cpu_class_header; |
| 635 | 455 | struct _cpu_class_header |
| 636 | 456 | { |
| 637 | int index; /* index of this CPU */ | |
| 638 | cpu_type cputype; /* type index of this CPU */ | |
| 639 | cpu_debug_data * debug; /* debugging data */ | |
| 640 | const address_space * space[ADDRESS_SPACES]; /* address spaces */ | |
| 457 | cpu_debug_data * debug; /* debugging data */ | |
| 458 | const address_space * space[ADDRESS_SPACES]; /* address spaces */ | |
| 641 | 459 | |
| 642 | 460 | /* table of core functions */ |
| 643 | cpu_get_info_func get_info; | |
| 644 | 461 | cpu_set_info_func set_info; |
| 645 | cpu_init_func init; | |
| 646 | cpu_reset_func reset; | |
| 647 | cpu_exit_func exit; | |
| 648 | 462 | cpu_execute_func execute; |
| 649 | 463 | cpu_burn_func burn; |
| 650 | 464 | cpu_translate_func translate; |
| 651 | 465 | cpu_disassemble_func disassemble; |
| 652 | 466 | cpu_disassemble_func dasm_override; |
| 653 | ||
| 654 | /* other frequently-needed information */ | |
| 655 | INT8 address_shift[ADDRESS_SPACES]; | |
| 656 | UINT32 clock_divider; | |
| 657 | UINT32 clock_multiplier; | |
| 658 | 467 | }; |
| 659 | 468 | |
| 660 | 469 | |
| 661 | 470 | |
| 662 | 471 | /*************************************************************************** |
| 663 | | |
| 472 | CPU DEFINITION | |
| 664 | 473 | ***************************************************************************/ |
| 665 | 474 | |
| 475 | #define cpu_count(config) device_list_items((config)->devicelist, CPU) | |
| 476 | #define cpu_first(config) device_list_first((config)->devicelist, CPU) | |
| 477 | #define cpu_next(previous) device_list_next((previous), CPU) | |
| 666 | 478 | |
| 667 | /* ----- global management ----- */ | |
| 668 | 479 | |
| 669 | /* reset the internal CPU tracking */ | |
| 670 | void cpuintrf_init(running_machine *machine); | |
| 480 | CPU_GET_INFO( dummy ); | |
| 481 | #define CPU_DUMMY CPU_GET_INFO_NAME( dummy ) | |
| 671 | 482 | |
| 672 | /* circular string buffer */ | |
| 673 | char *cpuintrf_temp_str(void); | |
| 674 | 483 | |
| 675 | 484 | |
| 485 | /*************************************************************************** | |
| 486 | FUNCTION PROTOTYPES | |
| 487 | ***************************************************************************/ | |
| 676 | 488 | |
| 677 | /* ----- live context control ----- */ | |
| 678 | 489 | |
| 679 | /* find a CPU in the machine by searching */ | |
| 680 | int cpu_get_index_slow(const device_config *cpu); | |
| 681 | ||
| 682 | ||
| 683 | ||
| 684 | 490 | /* ----- live CPU accessors ----- */ |
| 685 | 491 | |
| 686 | /* initialize a live CPU */ | |
| 687 | void cpu_init(const device_config *cpu, int index, int clock, cpu_irq_callback irqcallback); | |
| 688 | ||
| 689 | /* free a live CPU */ | |
| 690 | void cpu_exit(const device_config *cpu); | |
| 691 | ||
| 692 | /* return information about a live CPU */ | |
| 693 | INT64 cpu_get_info_int(const device_config *cpu, UINT32 state); | |
| 694 | void *cpu_get_info_ptr(const device_config *cpu, UINT32 state); | |
| 695 | genf *cpu_get_info_fct(const device_config *cpu, UINT32 state); | |
| 696 | const char *cpu_get_info_string(const device_config *cpu, UINT32 state); | |
| 697 | ||
| 698 | /* set information about a live CPU */ | |
| 699 | void cpu_set_info_int(const device_config *cpu, UINT32 state, INT64 data); | |
| 700 | void cpu_set_info_ptr(const device_config *cpu, UINT32 state, void *data); | |
| 701 | void cpu_set_info_fct(const device_config *cpu, UINT32 state, genf *data); | |
| 702 | ||
| 703 | /* signal a reset for a given CPU */ | |
| 704 | void cpu_reset(const device_config *cpu); | |
| 705 | ||
| 706 | 492 | /* return the PC, corrected to a byte offset and translated to physical space, on a given CPU */ |
| 707 | 493 | offs_t cpu_get_physical_pc_byte(const device_config *cpu); |
| 708 | 494 | |
| r3957 | r3958 | |
| 714 | 500 | |
| 715 | 501 | |
| 716 | 502 | |
| 717 | /* ----- CPU type accessors ----- */ | |
| 718 | ||
| 719 | /* return a header template for a given CPU type */ | |
| 720 | const cpu_class_header *cputype_get_header_template(cpu_type cputype); | |
| 721 | ||
| 722 | /* return information about a given CPU type */ | |
| 723 | INT64 cputype_get_info_int(cpu_type cputype, UINT32 state); | |
| 724 | void *cputype_get_info_ptr(cpu_type cputype, UINT32 state); | |
| 725 | genf *cputype_get_info_fct(cpu_type cputype, UINT32 state); | |
| 726 | const char *cputype_get_info_string(cpu_type cputype, UINT32 state); | |
| 727 | ||
| 728 | ||
| 729 | ||
| 730 | 503 | /*************************************************************************** |
| 731 | 504 | INLINE FUNCTIONS |
| 732 | 505 | ***************************************************************************/ |
| 733 | 506 | |
| 734 | 507 | /*------------------------------------------------- |
| 735 | cpu_get_index - return the index of the | |
| 736 | specified CPU (deprecated soon) | |
| 508 | cpu_get_class_header - return a pointer to | |
| 509 | the class header | |
| 737 | 510 | -------------------------------------------------*/ |
| 738 | 511 | |
| 739 | INLINE | |
| 512 | INLINE cpu_class_header *cpu_get_class_header(const device_config *device | |
| 740 | 513 | { |
| 741 | cpu_class_header *classheader = cpu->classtoken; | |
| 742 | return (classheader != NULL) ? classheader->index : cpu_get_index_slow(cpu); | |
| 514 | if (device->token != NULL) | |
| 515 | return (cpu_class_header *)((UINT8 *)device->token + device->tokenbytes) - 1; | |
| 516 | return NULL; | |
| 743 | 517 | } |
| 744 | 518 | |
| 745 | 519 | |
| r3957 | r3958 | |
| 748 | 522 | the given CPU's debugger data |
| 749 | 523 | -------------------------------------------------*/ |
| 750 | 524 | |
| 751 | INLINE cpu_debug_data *cpu_get_debug_data(const device_config *c | |
| 525 | INLINE cpu_debug_data *cpu_get_debug_data(const device_config *device | |
| 752 | 526 | { |
| 753 | cpu_class_header *classheader = cpu | |
| 527 | cpu_class_header *classheader = cpu_get_class_h | |
| 754 | 528 | return classheader->debug; |
| 755 | 529 | } |
| 756 | 530 | |
| r3957 | r3958 | |
| 760 | 534 | the given CPU's address space |
| 761 | 535 | -------------------------------------------------*/ |
| 762 | 536 | |
| 763 | INLINE const address_space *cpu_get_address_space(const device_config *c | |
| 537 | INLINE const address_space *cpu_get_address_space(const device_config *device | |
| 764 | 538 | { |
| 765 | cpu_class_header *classheader = cpu->classtoken; | |
| 766 | return classheader->space[spacenum]; | |
| 539 | /* it is faster to pull this from the class header, but only after we've started */ | |
| 540 | if (device->token != NULL) | |
| 541 | { | |
| 542 | cpu_class_header *classheader = cpu_get_class_header(device); | |
| 543 | return classheader->space[spacenum]; | |
| 544 | } | |
| 545 | return memory_find_address_space(device, spacenum); | |
| 767 | 546 | } |
| 768 | 547 | |
| 769 | 548 | |
| r3957 | r3958 | |
| 774 | 553 | |
| 775 | 554 | INLINE int cpu_execute(const device_config *device, int cycles) |
| 776 | 555 | { |
| 777 | cpu_class_header *classheader = | |
| 556 | cpu_class_header *classheader = | |
| 778 | 557 | return (*classheader->execute)(device, cycles); |
| 779 | 558 | } |
| 780 | 559 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | TYPE DEFINITIONS |
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | typedef void (*cpu_interrupt_func)(const device_config *device); | |
| 53 | ||
| 54 | ||
| 52 | 55 | /* CPU description for drivers */ |
| 53 | 56 | typedef struct _cpu_config cpu_config; |
| 54 | 57 | struct _cpu_config |
| 55 | 58 | { |
| 56 | cpu_type type; /* index for the CPU type */ | |
| 57 | int flags; /* flags; see #defines below */ | |
| 58 | int clock; /* in Hertz */ | |
| 59 | const addrmap_token *address_map[ADDRESS_SPACES][2]; /* 2 memory maps per address space */ | |
| 60 | void (*vblank_interrupt)(const device_config *device); /* for interrupts tied to VBLANK */ | |
| 61 | int vblank_interrupts_per_frame;/* usually 1 */ | |
| 62 | const char * vblank_interrupt_screen; /* the screen that causes the VBLANK interrupt */ | |
| 63 | void (*timed_interrupt)(const device_config *device); /* for interrupts not tied to VBLANK */ | |
| 64 | attoseconds_t timed_interrupt_period; /* period for periodic interrupts */ | |
| 65 | const void * reset_param; /* parameter for cpu_reset */ | |
| 66 | const char * tag; | |
| 59 | cpu_type type; /* index for the CPU type */ | |
| 60 | UINT32 flags; /* flags; see #defines below */ | |
| 61 | const addrmap_token *address_map[ADDRESS_SPACES]; /* 2 memory maps per address space */ | |
| 62 | const addrmap_token *address_map2[ADDRESS_SPACES]; /* 2 memory maps per address space */ | |
| 63 | cpu_interrupt_func vblank_interrupt; /* for interrupts tied to VBLANK */ | |
| 64 | int vblank_interrupts_per_frame;/* usually 1 */ | |
| 65 | const char * vblank_interrupt_screen; /* the screen that causes the VBLANK interrupt */ | |
| 66 | cpu_interrupt_func timed_interrupt; /* for interrupts not tied to VBLANK */ | |
| 67 | UINT64 timed_interrupt_period; /* period for periodic interrupts */ | |
| 67 | 68 | }; |
| 68 | 69 | |
| 69 | 70 | |
| 70 | 71 | |
| 71 | 72 | /*************************************************************************** |
| 73 | CPU DEVICE CONFIGURATION MACROS | |
| 74 | ***************************************************************************/ | |
| 75 | ||
| 76 | #define MDRV_CPU_ADD(_tag, _type, _clock) \ | |
| 77 | MDRV_DEVICE_ADD(_tag, CPU, _clock) \ | |
| 78 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) | |
| 79 | ||
| 80 | #define MDRV_CPU_REMOVE(_tag) \ | |
| 81 | MDRV_DEVICE_REMOVE(_tag, CPU) | |
| 82 | ||
| 83 | #define MDRV_CPU_MODIFY(_tag) \ | |
| 84 | MDRV_DEVICE_MODIFY(_tag, CPU) | |
| 85 | ||
| 86 | #define MDRV_CPU_TYPE(_type) \ | |
| 87 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) | |
| 88 | ||
| 89 | #define MDRV_CPU_CLOCK(_clock) \ | |
| 90 | MDRV_DEVICE_CLOCK(_clock) | |
| 91 | ||
| 92 | #define MDRV_CPU_REPLACE(_tag, _type, _clock) \ | |
| 93 | MDRV_DEVICE_MODIFY(_tag, CPU) \ | |
| 94 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) \ | |
| 95 | MDRV_DEVICE_CLOCK(_clock) | |
| 96 | ||
| 97 | #define MDRV_CPU_FLAGS(_flags) \ | |
| 98 | MDRV_DEVICE_CONFIG_DATA32(cpu_config, flags, _flags) | |
| 99 | ||
| 100 | #define MDRV_CPU_CONFIG(_config) \ | |
| 101 | MDRV_DEVICE_CONFIG(_config) | |
| 102 | ||
| 103 | #define MDRV_CPU_PROGRAM_MAP(_map1, _map2) \ | |
| 104 | MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(cpu_config, address_map, ADDRESS_SPACE_PROGRAM, ADDRESS_MAP_NAME(_map1)) \ | |
| 105 | MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(cpu_config, address_map2, ADDRESS_SPACE_PROGRAM, ADDRESS_MAP_NAME(_map2)) | |
| 106 | ||
| 107 | #define MDRV_CPU_DATA_MAP(_map1, _map2) \ | |
| 108 | MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(cpu_config, address_map, ADDRESS_SPACE_DATA, ADDRESS_MAP_NAME(_map1)) \ | |
| 109 | MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(cpu_config, address_map2, ADDRESS_SPACE_DATA, ADDRESS_MAP_NAME(_map2)) | |
| 110 | ||
| 111 | #define MDRV_CPU_IO_MAP(_map1, _map2) \ | |
| 112 | MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(cpu_config, address_map, ADDRESS_SPACE_IO, ADDRESS_MAP_NAME(_map1)) \ | |
| 113 | MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(cpu_config, address_map2, ADDRESS_SPACE_IO, ADDRESS_MAP_NAME(_map2)) | |
| 114 | ||
| 115 | #define MDRV_CPU_VBLANK_INT(_tag, _func) \ | |
| 116 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, vblank_interrupt, _func) \ | |
| 117 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, vblank_interrupt_screen, _tag) \ | |
| 118 | MDRV_DEVICE_CONFIG_DATA32(cpu_config, vblank_interrupts_per_frame, 0) | |
| 119 | ||
| 120 | #define MDRV_CPU_PERIODIC_INT(_func, _rate) \ | |
| 121 | MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, timed_interrupt, _func) \ | |
| 122 | MDRV_DEVICE_CONFIG_DATA64(cpu_config, timed_interrupt_period, UINT64_ATTOTIME_IN_HZ(_rate)) | |
| 123 | ||
| 124 | ||
| 125 | ||
| 126 | /*************************************************************************** | |
| 72 | 127 | MACROS |
| 73 | 128 | ***************************************************************************/ |
| 74 | 129 | |
| 75 | 130 | #define INTERRUPT_GEN(func) void func(const device_config *device) |
| 76 | 131 | |
| 132 | /* return a pointer to the given CPU by tag */ | |
| 133 | #define cputag_get_cpu(mach, tag) devtag_get_device(mach, CPU, tag) | |
| 134 | ||
| 77 | 135 | /* helpers for using machine/cputag instead of cpu objects */ |
| 78 | 136 | #define cputag_suspend(mach, tag, reason, eat) cpu_suspend(cputag_get_cpu(mach, tag), reason, eat) |
| 79 | 137 | #define cputag_resume(mach, tag, reason) cpu_resume(cputag_get_cpu(mach, tag), reason) |
| r3957 | r3958 | |
| 96 | 154 | |
| 97 | 155 | /* ----- core CPU execution ----- */ |
| 98 | 156 | |
| 99 | /* temporary function to allocate a fake CPU device for each CPU */ | |
| 100 | const device_config *cpuexec_create_cpu_device(const cpu_config *config); | |
| 101 | ||
| 102 | 157 | /* prepare CPUs for execution */ |
| 103 | 158 | void cpuexec_init(running_machine *machine); |
| 104 | 159 | |
| r3957 | r3958 | |
| 110 | 165 | |
| 111 | 166 | |
| 112 | 167 | |
| 168 | /* ----- CPU device interface ----- */ | |
| 169 | ||
| 170 | /* device get info callback */ | |
| 171 | #define CPU DEVICE_GET_INFO_NAME(cpu) | |
| 172 | DEVICE_GET_INFO( cpu ); | |
| 173 | ||
| 174 | ||
| 175 | ||
| 113 | 176 | /* ----- global helpers ----- */ |
| 114 | 177 | |
| 115 | /* return a pointer to the given CPU by tag */ | |
| 116 | const device_config *cputag_get_cpu(running_machine *machine, const char *tag); | |
| 117 | ||
| 118 | 178 | /* abort execution for the current timeslice */ |
| 119 | 179 | void cpuexec_abort_timeslice(running_machine *machine); |
| 120 | 180 | |
| r3957 | r3958 | |
| 227 | 287 | void cpu_set_irq_callback(const device_config *cpu, cpu_irq_callback callback); |
| 228 | 288 | |
| 229 | 289 | |
| 290 | ||
| 291 | /*************************************************************************** | |
| 292 | INLINE FUNCTIONS | |
| 293 | ***************************************************************************/ | |
| 294 | ||
| 295 | ||
| 296 | /*------------------------------------------------- | |
| 297 | cpu_get_type - return the type of the | |
| 298 | specified CPU | |
| 299 | -------------------------------------------------*/ | |
| 300 | ||
| 301 | INLINE cpu_type cpu_get_type(const device_config *device) | |
| 302 | { | |
| 303 | const cpu_config *config = device->inline_config; | |
| 304 | return config->type; | |
| 305 | } | |
| 306 | ||
| 307 | ||
| 308 | ||
| 230 | 309 | #endif /* __CPUEXEC_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | * |
| 41 | 41 | *************************************/ |
| 42 | 42 | |
| 43 | static | |
| 43 | static STREAM_UPDATE( cdp1869_update | |
| 44 | 44 | { |
| 45 | 45 | struct CDP1869 *info = param; |
| 46 | 46 | INT16 signal = info->signal; |
| 47 | stream_sample_t *buffer = | |
| 47 | stream_sample_t *buffer = o | |
| 48 | 48 | |
| 49 | memset( buffer, 0, le | |
| 49 | memset( buffer, 0, samples | |
| 50 | 50 | |
| 51 | 51 | if (!info->toneoff && info->toneamp) |
| 52 | 52 | { |
| r3957 | r3958 | |
| 67 | 67 | signal = info->toneamp * (0x07fff / 15); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | while( le | |
| 70 | while( samples | |
| 71 | 71 | { |
| 72 | 72 | *buffer++ = signal; |
| 73 | 73 | incr -= frequency; |
| r3957 | r3958 | |
| 188 | 188 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 189 | 189 | |
| 190 | 190 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 191 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cdp1869 ); break; | |
| 192 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cdp1869 ); break; | |
| 193 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 194 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 191 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cdp1869 ); break; | |
| 192 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cdp1869 ); break; | |
| 193 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 194 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 195 | 195 | |
| 196 | 196 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 197 | case SNDINFO_STR_NAME: info->s = "CDP1869"; break; | |
| 198 | case SNDINFO_STR_CORE_FAMILY: info->s = "RCA CDP1869"; break; | |
| 199 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 200 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 201 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 197 | case SNDINFO_STR_NAME: strcpy(info->s, "CDP1869"); break; | |
| 198 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "RCA CDP1869"); break; | |
| 199 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 200 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 201 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 202 | 202 | } |
| 203 | 203 | } |
| r3957 | r3958 | |
|---|---|---|
| 58 | 58 | if( sp->sby_line != line_state ) \ |
| 59 | 59 | { \ |
| 60 | 60 | sp->sby_line = line_state; \ |
| 61 | if( sp->sby ) sp->sby(sp->sby_line); \ | |
| 61 | if( sp->sby ) sp->sby(sp->device, sp->sby_line); \ | |
| 62 | 62 | } \ |
| 63 | 63 | } |
| 64 | 64 | |
| r3957 | r3958 | |
| 77 | 77 | |
| 78 | 78 | struct sp0256 |
| 79 | 79 | { |
| 80 | const device_config *device; | |
| 80 | 81 | sound_stream *stream; /* MAME core sound stream */ |
| 81 | void (*drq)(int state); /* Data request callback */ | |
| 82 | void (*sby)(int state); /* Standby callback */ | |
| 82 | void (*drq)(const device_config *device, int state); /* Data request callback */ | |
| 83 | void (*sby)(const device_config *device, int state); /* Standby callback */ | |
| 83 | 84 | int sby_line; /* Standby line state */ |
| 84 | 85 | INT16 *cur_buf; /* Current sound buffer. */ |
| 85 | 86 | int cur_len; /* Fullness of current sound buffer. */ |
| r3957 | r3958 | |
| 766 | 767 | sp->ald = 0; |
| 767 | 768 | for (i = 0; i < 16; i++) |
| 768 | 769 | sp->filt.r[i] = 0; |
| 769 | if( sp->drq) sp->drq(ASSERT_LINE); | |
| 770 | if( sp->drq) sp->drq(sp->device, ASSERT_LINE); | |
| 770 | 771 | } |
| 771 | 772 | |
| 772 | 773 | /* ---------------------------------------------------------------- */ |
| r3957 | r3958 | |
| 1091 | 1092 | } |
| 1092 | 1093 | } |
| 1093 | 1094 | |
| 1094 | static | |
| 1095 | static STREAM_UPDATE( sp0256_update | |
| 1095 | 1096 | { |
| 1096 | 1097 | struct sp0256 *sp = param; |
| 1097 | stream_sample_t *output = | |
| 1098 | stream_sample_t *output = outputs[0]; | |
| 1098 | 1099 | int output_index = 0; |
| 1099 | ||
| 1100 | | |
| 1100 | 1101 | |
| 1101 | while( output_index < le | |
| 1102 | while( output_index < samples | |
| 1102 | 1103 | { |
| 1103 | 1104 | /* ---------------------------------------------------------------- */ |
| 1104 | 1105 | /* First, drain as much of our scratch buffer as we can into the */ |
| r3957 | r3958 | |
| 1110 | 1111 | output[output_index++] = sp->scratch[sp->sc_tail++ & SCBUF_MASK]; |
| 1111 | 1112 | sp->sc_tail &= SCBUF_MASK; |
| 1112 | 1113 | |
| 1113 | if( output_index > le | |
| 1114 | if( output_index > samples | |
| 1114 | 1115 | break; |
| 1115 | 1116 | } |
| 1116 | 1117 | |
| 1117 | 1118 | /* ---------------------------------------------------------------- */ |
| 1118 | /* If output | |
| 1119 | /* If output outputs is full, then we're done. */ | |
| 1119 | 1120 | /* ---------------------------------------------------------------- */ |
| 1120 | if( output_index > le | |
| 1121 | if( output_index > samples | |
| 1121 | 1122 | break; |
| 1122 | 1123 | |
| 1123 | | |
| 1124 | | |
| 1124 | 1125 | |
| 1125 | 1126 | /* ---------------------------------------------------------------- */ |
| 1126 | 1127 | /* Process the current set of filter coefficients as long as the */ |
| r3957 | r3958 | |
| 1128 | 1129 | /* ---------------------------------------------------------------- */ |
| 1129 | 1130 | did_samp = 0; |
| 1130 | 1131 | old_idx = sp->sc_head; |
| 1131 | if ( | |
| 1132 | if ( | |
| 1132 | 1133 | { |
| 1133 | 1134 | int do_samp; |
| 1134 | 1135 | |
| r3957 | r3958 | |
| 1141 | 1142 | /* ------------------------------------------------------------ */ |
| 1142 | 1143 | /* Do as many samples as we can. */ |
| 1143 | 1144 | /* ------------------------------------------------------------ */ |
| 1144 | do_samp = | |
| 1145 | do_samp = | |
| 1145 | 1146 | if (sp->sc_head + do_samp - sp->sc_tail > SCBUF_SIZE) |
| 1146 | 1147 | do_samp = sp->sc_tail + SCBUF_SIZE - sp->sc_head; |
| 1147 | 1148 | |
| r3957 | r3958 | |
| 1164 | 1165 | |
| 1165 | 1166 | sp->sc_head &= SCBUF_MASK; |
| 1166 | 1167 | |
| 1167 | } while (sp->filt.rpt >= 0 && | |
| 1168 | } while (sp->filt.rpt >= 0 && | |
| 1168 | 1169 | } |
| 1169 | 1170 | } |
| 1170 | 1171 | |
| r3957 | r3958 | |
| 1175 | 1176 | |
| 1176 | 1177 | sp = auto_malloc(sizeof(*sp)); |
| 1177 | 1178 | memset(sp, 0, sizeof(*sp)); |
| 1179 | sp->device = device; | |
| 1178 | 1180 | sp->drq = intf->lrq_callback; |
| 1179 | 1181 | sp->sby = intf->sby_callback; |
| 1180 | if( sp->drq ) sp->drq(ASSERT_LINE); | |
| 1181 | if( sp->sby ) sp->sby(sp->sby_line = ASSERT_LINE); | |
| 1182 | if( sp->drq ) sp->drq(device, ASSERT_LINE); | |
| 1183 | if( sp->sby ) sp->sby(device, sp->sby_line = ASSERT_LINE); | |
| 1182 | 1184 | |
| 1183 | 1185 | sp->stream = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, sp, sp0256_update); |
| 1184 | 1186 | |
| r3957 | r3958 | |
| 1236 | 1238 | sp->mode = 0; |
| 1237 | 1239 | sp->page = 0x1000 << 3; |
| 1238 | 1240 | sp->silent = 1; |
| 1239 | if( sp->drq ) sp->drq(ASSERT_LINE); | |
| 1241 | if( sp->drq ) sp->drq(sp->device, ASSERT_LINE); | |
| 1240 | 1242 | SET_SBY(ASSERT_LINE) |
| 1241 | 1243 | } |
| 1242 | 1244 | |
| r3957 | r3958 | |
| 1265 | 1267 | /* ---------------------------------------------------------------- */ |
| 1266 | 1268 | sp->lrq = 0; |
| 1267 | 1269 | sp->ald = (0xFF & data) << 4; |
| 1268 | if( sp->drq ) sp->drq(CLEAR_LINE); | |
| 1270 | if( sp->drq ) sp->drq(sp->device, CLEAR_LINE); | |
| 1269 | 1271 | SET_SBY(CLEAR_LINE) |
| 1270 | 1272 | |
| 1271 | 1273 | return; |
| r3957 | r3958 | |
| 1362 | 1364 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1363 | 1365 | |
| 1364 | 1366 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1365 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sp0256 ); break; | |
| 1366 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sp0256 ); break; | |
| 1367 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( sp0256 ); break; | |
| 1368 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( sp0256 ); break; | |
| 1367 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sp0256 ); break; | |
| 1368 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sp0256 ); break; | |
| 1369 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( sp0256 ); break; | |
| 1370 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( sp0256 ); break; | |
| 1369 | 1371 | |
| 1370 | 1372 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1371 | case SNDINFO_STR_NAME: info->s = "SP0256"; break; | |
| 1372 | case SNDINFO_STR_CORE_FAMILY: info->s = "GI"; break; | |
| 1373 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 1374 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 1375 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Joseph Zbiciak, tim lindner"; break; | |
| 1373 | case SNDINFO_STR_NAME: strcpy(info->s, "SP0256"); break; | |
| 1374 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "GI"); break; | |
| 1375 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 1376 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1377 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Joseph Zbiciak, tim lindner"); break; | |
| 1376 | 1378 | } |
| 1377 | 1379 | } |
| 1378 | 1380 |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | static double charge, decay, leak; |
| 49 | 49 | |
| 50 | 50 | |
| 51 | static | |
| 51 | static STREAM_UPDATE( hc55516_update | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | |
| r3957 | r3958 | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | |
| 185 | static | |
| 185 | static STREAM_UPDATE( hc55516_update | |
| 186 | 186 | { |
| 187 | 187 | struct hc55516_data *chip = param; |
| 188 | stream_sample_t *buffer = | |
| 188 | stream_sample_t *buffer = o | |
| 189 | 189 | int i; |
| 190 | 190 | INT32 sample, slope; |
| 191 | 191 | |
| 192 | 192 | /* zero-length? bail */ |
| 193 | if (le | |
| 193 | if (samples | |
| 194 | 194 | return; |
| 195 | 195 | |
| 196 | 196 | if (!is_external_osciallator(chip)) |
| 197 | 197 | { |
| 198 | 198 | /* track how many samples we've updated without a clock */ |
| 199 | chip->update_count += le | |
| 199 | chip->update_count += samples | |
| 200 | 200 | if (chip->update_count > SAMPLE_RATE / 32) |
| 201 | 201 | { |
| 202 | 202 | chip->update_count = SAMPLE_RATE; |
| r3957 | r3958 | |
| 206 | 206 | |
| 207 | 207 | /* compute the interpolation slope */ |
| 208 | 208 | sample = chip->curr_sample; |
| 209 | slope = ((INT32)chip->next_sample - sample) / le | |
| 209 | slope = ((INT32)chip->next_sample - sample) / samples | |
| 210 | 210 | chip->curr_sample = chip->next_sample; |
| 211 | 211 | |
| 212 | 212 | if (is_external_osciallator(chip)) |
| 213 | 213 | { |
| 214 | 214 | /* external oscillator */ |
| 215 | for (i = 0; i < le | |
| 215 | for (i = 0; i < samples | |
| 216 | 216 | { |
| 217 | 217 | UINT8 clock_state; |
| 218 | 218 | |
| r3957 | r3958 | |
| 236 | 236 | |
| 237 | 237 | /* software driven clock */ |
| 238 | 238 | else |
| 239 | for (i = 0; i < le | |
| 239 | for (i = 0; i < samples | |
| 240 | 240 | *buffer++ = sample; |
| 241 | 241 | } |
| 242 | 242 | |
| r3957 | r3958 | |
| 339 | 339 | switch (state) |
| 340 | 340 | { |
| 341 | 341 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 342 | case SNDINFO_INT_ALIAS: info->i = SOUND_HC55516; break; | |
| 342 | case SNDINFO_INT_ALIAS: info->i = SOUND_HC55516; break; | |
| 343 | 343 | |
| 344 | 344 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 345 | case SNDINFO_PTR_START: info->start = SND_START_NAME( hc55516 ); break; | |
| 346 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( hc55516 ); break; | |
| 345 | case SNDINFO_PTR_START: info->start = SND_START_NAME( hc55516 ); break; | |
| 346 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( hc55516 ); break; | |
| 347 | 347 | |
| 348 | 348 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 349 | case SNDINFO_STR_NAME: info->s = "HC-55516"; break; | |
| 350 | case SNDINFO_STR_CORE_FAMILY: info->s = "CVSD"; break; | |
| 351 | case SNDINFO_STR_CORE_VERSION: info->s = "2.1"; break; | |
| 352 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 353 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 349 | case SNDINFO_STR_NAME: strcpy(info->s, "HC-55516"); break; | |
| 350 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "CVSD"); break; | |
| 351 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "2.1"); break; | |
| 352 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 353 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
| r3957 | r3958 | |
| 359 | 359 | { |
| 360 | 360 | switch (state) |
| 361 | 361 | { |
| 362 | case SNDINFO_PTR_START: info->start = SND_START_NAME( mc3417 ); break; | |
| 363 | case SNDINFO_PTR_RESET: /* chip has no reset pin */ break; | |
| 364 | case SNDINFO_STR_NAME: info->s = "MC3417"; break; | |
| 365 | default: SND_GET_INFO_CALL(hc55516); break; | |
| 362 | case SNDINFO_PTR_START: info->start = SND_START_NAME( mc3417 ); break; | |
| 363 | case SNDINFO_PTR_RESET: /* chip has no reset pin */ break; | |
| 364 | case SNDINFO_STR_NAME: strcpy(info->s, "MC3417"); break; | |
| 365 | default: SND_GET_INFO_CALL(hc55516); break; | |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | |
| r3957 | r3958 | |
| 371 | 371 | { |
| 372 | 372 | switch (state) |
| 373 | 373 | { |
| 374 | case SNDINFO_PTR_START: info->start = SND_START_NAME( mc3418 ); break; | |
| 375 | case SNDINFO_PTR_RESET: /* chip has no reset pin */ break; | |
| 376 | case SNDINFO_STR_NAME: info->s = "MC3418"; break; | |
| 377 | default: SND_GET_INFO_CALL(hc55516); break; | |
| 374 | case SNDINFO_PTR_START: info->start = SND_START_NAME( mc3418 ); break; | |
| 375 | case SNDINFO_PTR_RESET: /* chip has no reset pin */ break; | |
| 376 | case SNDINFO_STR_NAME: strcpy(info->s, "MC3418"); break; | |
| 377 | default: SND_GET_INFO_CALL(hc55516); break; | |
| 378 | 378 | } |
| 379 | 379 | } |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | typedef struct _sp0256_interface sp0256_interface; |
| 27 | 27 | struct _sp0256_interface { |
| 28 | void (*lrq_callback)(int state); | |
| 29 | void (*sby_callback)(int state); | |
| 28 | void (*lrq_callback)(const device_config *device, int state); | |
| 29 | void (*sby_callback)(const device_config *device, int state); | |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | 32 | void sp0256_bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int length); |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | struct IremGA20_channel_def channel[4]; |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | static | |
| 58 | static STREAM_UPDATE( IremGA20_update | |
| 59 | 59 | { |
| 60 | 60 | struct IremGA20_chip_def *chip = param; |
| 61 | 61 | UINT32 rate[4], pos[4], frac[4], end[4], vol[4], play[4]; |
| r3957 | r3958 | |
| 74 | 74 | play[i] = chip->channel[i].play; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | i = le | |
| 77 | i = samples | |
| 78 | 78 | pSamples = chip->rom; |
| 79 | outL = buffer[0]; | |
| 80 | outR = buffer[1]; | |
| 79 | outL = outputs[0]; | |
| 80 | outR = outputs[1]; | |
| 81 | 81 | |
| 82 | for (i = 0; i < le | |
| 82 | for (i = 0; i < samples | |
| 83 | 83 | { |
| 84 | 84 | sampleout = 0; |
| 85 | 85 | |
| r3957 | r3958 | |
| 288 | 288 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 289 | 289 | |
| 290 | 290 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 291 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( iremga20 ); break; | |
| 292 | case SNDINFO_PTR_START: info->start = SND_START_NAME( iremga20 ); break; | |
| 293 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 294 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( iremga20 ); break; | |
| 291 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( iremga20 ); break; | |
| 292 | case SNDINFO_PTR_START: info->start = SND_START_NAME( iremga20 ); break; | |
| 293 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 294 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( iremga20 ); break; | |
| 295 | 295 | |
| 296 | 296 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 297 | case SNDINFO_STR_NAME: info->s = "Irem GA20"; break; | |
| 298 | case SNDINFO_STR_CORE_FAMILY: info->s = "Irem custom"; break; | |
| 299 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 300 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 301 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 297 | case SNDINFO_STR_NAME: strcpy(info->s, "Irem GA20"); break; | |
| 298 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Irem custom"); break; | |
| 299 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 300 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 301 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | { |
| 35 | 35 | struct custom_info *info = device->token; |
| 36 | 36 | if (info->intf->stop) |
| 37 | (*info->intf->stop)(info->token); | |
| 37 | (*info->intf->stop)(device, info->token); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| r3957 | r3958 | |
| 42 | 42 | { |
| 43 | 43 | struct custom_info *info = device->token; |
| 44 | 44 | if (info->intf->reset) |
| 45 | (*info->intf->reset)(info->token); | |
| 45 | (*info->intf->reset)(device, info->token); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| r3957 | r3958 | |
| 74 | 74 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 75 | 75 | |
| 76 | 76 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 77 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( custom ); break; | |
| 78 | case SNDINFO_PTR_START: info->start = SND_START_NAME( custom ); break; | |
| 79 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( custom ); break; | |
| 80 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( custom ); break; | |
| 77 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( custom ); break; | |
| 78 | case SNDINFO_PTR_START: info->start = SND_START_NAME( custom ); break; | |
| 79 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( custom ); break; | |
| 80 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( custom ); break; | |
| 81 | 81 | |
| 82 | 82 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 83 | case SNDINFO_STR_NAME: info->s = "Custom"; break; | |
| 84 | case SNDINFO_STR_CORE_FAMILY: info->s = "None"; break; | |
| 85 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 86 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 87 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 83 | case SNDINFO_STR_NAME: strcpy(info->s, "Custom"); break; | |
| 84 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "None"); break; | |
| 85 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 86 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 87 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 |
| r3957 | r3958 | |
|---|---|---|
| 111 | 111 | UINT8 addr_bit; |
| 112 | 112 | |
| 113 | 113 | /* external callback */ |
| 114 | int (*M0_callback)(voi | |
| 114 | int (*M0_callback)(const device_config *); | |
| 115 | 115 | void (*set_load_address)(int); |
| 116 | const device_config *device; | |
| 116 | 117 | |
| 117 | 118 | /* these contain data describing the current and previous voice frames */ |
| 118 | 119 | UINT16 old_energy; |
| r3957 | r3958 | |
| 183 | 184 | tms = malloc_or_die(sizeof(*tms)); |
| 184 | 185 | memset(tms, 0, sizeof(*tms)); |
| 185 | 186 | |
| 187 | tms->device = device; | |
| 186 | 188 | tms5110_set_variant(tms, variant); |
| 187 | 189 | |
| 188 | 190 | state_save_register_device_item_array(device, 0, tms->fifo); |
| r3957 | r3958 | |
| 280 | 282 | |
| 281 | 283 | ******************************************************************************************/ |
| 282 | 284 | |
| 283 | void tms5110_set_M0_callback(void *chip, int (*func)(voi | |
| 285 | void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *)) | |
| 284 | 286 | { |
| 285 | 287 | struct tms5110 *tms = chip; |
| 286 | 288 | tms->M0_callback = func; |
| r3957 | r3958 | |
| 347 | 349 | { |
| 348 | 350 | if (tms->M0_callback) |
| 349 | 351 | { |
| 350 | int data = (*tms->M0_callback)(); | |
| 352 | int data = (*tms->M0_callback)(tms->device); | |
| 351 | 353 | FIFO_data_write(tms, data); |
| 352 | 354 | } |
| 353 | 355 | else |
| r3957 | r3958 | |
| 361 | 363 | { |
| 362 | 364 | if (tms->M0_callback) |
| 363 | 365 | { |
| 364 | int data = (*tms->M0_callback)(); | |
| 366 | int data = (*tms->M0_callback)(tms->device); | |
| 365 | 367 | if (DEBUG_5110) logerror("TMS5110 performing dummy read; value read = %1i\n", data&1); |
| 366 | 368 | } |
| 367 | 369 | else |
| r3957 | r3958 | |
|---|---|---|
| 73 | 73 | /* YM2612 */ |
| 74 | 74 | /***********************************************************/ |
| 75 | 75 | |
| 76 | static | |
| 76 | static STREAM_UPDATE( ym2612_stream_update | |
| 77 | 77 | { |
| 78 | 78 | struct ym2612_info *info = param; |
| 79 | ym2612_update_one(info->chip, | |
| 79 | ym2612_update_one(info->chip, outputs, samples | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| r3957 | r3958 | |
| 370 | 370 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2612 ); break; |
| 371 | 371 | |
| 372 | 372 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 373 | case SNDINFO_STR_NAME: info->s = "YM2612"; break; | |
| 374 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 375 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 376 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 377 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 373 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2612"); break; | |
| 374 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 375 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 376 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 377 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
| r3957 | r3958 | |
| 406 | 406 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2612 ); break; |
| 407 | 407 | |
| 408 | 408 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 409 | case SNDINFO_STR_NAME: info->s = "YM3438"; break; | |
| 410 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 411 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 412 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 413 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 409 | case SNDINFO_STR_NAME: strcpy(info->s, "YM3438"); break; | |
| 410 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 411 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 412 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 413 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 |
| r3957 | r3958 | |
|---|---|---|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | |
| 328 | static | |
| 328 | static STREAM_UPDATE( c352_update | |
| 329 | 329 | { |
| 330 | 330 | struct c352_info *info = param; |
| 331 | 331 | int i, j; |
| 332 | stream_sample_t *bufferl = buf[0]; | |
| 333 | stream_sample_t *bufferr = buf[1]; | |
| 334 | stream_sample_t *bufferl2 = buf[2]; | |
| 335 | stream_sample_t *bufferr2 = buf[3]; | |
| 332 | stream_sample_t *bufferl = outputs[0]; | |
| 333 | stream_sample_t *bufferr = outputs[1]; | |
| 334 | stream_sample_t *bufferl2 = outputs[2]; | |
| 335 | stream_sample_t *bufferr2 = outputs[3]; | |
| 336 | 336 | |
| 337 | for(i = 0 ; i < sample | |
| 337 | for(i = 0 ; i < samples | |
| 338 | 338 | { |
| 339 | 339 | info->channel_l[i] = info->channel_r[i] = info->channel_l2[i] = info->channel_r2[i] = 0; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | for (j = 0 ; j < 32 ; j++) |
| 343 | 343 | { |
| 344 | c352_mix_one_channel(info, j, sample | |
| 344 | c352_mix_one_channel(info, j, samples | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | for(i = 0 ; i < sample | |
| 347 | for(i = 0 ; i < samples | |
| 348 | 348 | { |
| 349 | 349 | *bufferl++ = (short) (info->channel_l[i] >>3); |
| 350 | 350 | *bufferr++ = (short) (info->channel_r[i] >>3); |
| r3957 | r3958 | |
| 593 | 593 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 594 | 594 | |
| 595 | 595 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 596 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c352 ); break; | |
| 597 | case SNDINFO_PTR_START: info->start = SND_START_NAME( c352 ); break; | |
| 598 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 599 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 596 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c352 ); break; | |
| 597 | case SNDINFO_PTR_START: info->start = SND_START_NAME( c352 ); break; | |
| 598 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 599 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 600 | 600 | |
| 601 | 601 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 602 | case SNDINFO_STR_NAME: info->s = "C352"; break; | |
| 603 | case SNDINFO_STR_CORE_FAMILY: info->s = "Namco PCM"; break; | |
| 604 | case SNDINFO_STR_CORE_VERSION: info->s = "1.1"; break; | |
| 605 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 606 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 602 | case SNDINFO_STR_NAME: strcpy(info->s, "C352"); break; | |
| 603 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Namco PCM"); break; | |
| 604 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; | |
| 605 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 606 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 |
| r3957 | r3958 | |
|---|---|---|
| 7 | 7 | struct _custom_sound_interface |
| 8 | 8 | { |
| 9 | 9 | void *(*start)(const device_config *device, int clock, const custom_sound_interface *config); |
| 10 | void (*stop)(void *token); | |
| 11 | void (*reset)(void *token); | |
| 10 | void (*stop)(const device_config *device, void *token); | |
| 11 | void (*reset)(const device_config *device, void *token); | |
| 12 | 12 | void *extra_data; |
| 13 | 13 | }; |
| 14 | 14 | |
| 15 | 15 | void *custom_get_token(int index); |
| 16 | 16 | |
| 17 | 17 | #define CUSTOM_START(name) void *name(const device_config *device, int clock, const custom_sound_interface *config) |
| 18 | #define CUSTOM_STOP(name) void name(void *token) | |
| 19 | #define CUSTOM_RESET(name) void name(void *token) | |
| 18 | #define CUSTOM_STOP(name) void name(const device_config *device, void *token) | |
| 19 | #define CUSTOM_RESET(name) void name(const device_config *device, void *token) | |
| 20 | 20 | |
| 21 | 21 | #endif /* __CUSTOM_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | void tms5110_set_variant(void *chip, int variant); |
| 34 | 34 | |
| 35 | 35 | void tms5110_reset_chip(void *chip); |
| 36 | void tms5110_set_M0_callback(void *chip, int (*func)(voi | |
| 36 | void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *)); | |
| 37 | 37 | void tms5110_set_load_address(void *chip, void (*func)(int)); |
| 38 | 38 | |
| 39 | 39 | void tms5110_CTL_set(void *chip, int data); |
| r3957 | r3958 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | /* generate sound to the mix buffer */ |
| 84 | static | |
| 84 | static STREAM_UPDATE( k051649_update | |
| 85 | 85 | { |
| 86 | 86 | struct k051649_info *info = param; |
| 87 | 87 | k051649_sound_channel *voice=info->channel_list; |
| 88 | stream_sample_t *buffer = | |
| 88 | stream_sample_t *buffer = o | |
| 89 | 89 | short *mix; |
| 90 | 90 | int i,v,f,j,k; |
| 91 | 91 | |
| 92 | 92 | /* zap the contents of the mixer buffer */ |
| 93 | memset(info->mixer_buffer, 0, le | |
| 93 | memset(info->mixer_buffer, 0, samples | |
| 94 | 94 | |
| 95 | 95 | for (j=0; j<5; j++) { |
| 96 | 96 | v=voice[j].volume; |
| r3957 | r3958 | |
| 105 | 105 | mix = info->mixer_buffer; |
| 106 | 106 | |
| 107 | 107 | /* add our contribution */ |
| 108 | for (i = 0; i < le | |
| 108 | for (i = 0; i < samples | |
| 109 | 109 | { |
| 110 | 110 | int offs; |
| 111 | 111 | |
| r3957 | r3958 | |
| 123 | 123 | |
| 124 | 124 | /* mix it down */ |
| 125 | 125 | mix = info->mixer_buffer; |
| 126 | for (i = 0; i < le | |
| 126 | for (i = 0; i < samples | |
| 127 | 127 | *buffer++ = info->mixer_lookup[*mix++]; |
| 128 | 128 | } |
| 129 | 129 | |
| r3957 | r3958 | |
| 239 | 239 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 240 | 240 | |
| 241 | 241 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 242 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k051649 ); break; | |
| 243 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k051649 ); break; | |
| 244 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 245 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( k051649 ); break; | |
| 242 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k051649 ); break; | |
| 243 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k051649 ); break; | |
| 244 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 245 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( k051649 ); break; | |
| 246 | 246 | |
| 247 | 247 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 248 | case SNDINFO_STR_NAME: info->s = "K051649"; break; | |
| 249 | case SNDINFO_STR_CORE_FAMILY: info->s = "Konami custom"; break; | |
| 250 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 251 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 252 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 248 | case SNDINFO_STR_NAME: strcpy(info->s, "K051649"); break; | |
| 249 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Konami custom"); break; | |
| 250 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 251 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 252 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | info->regs[0x22c] &= ~(1 << channel); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | static | |
| 122 | static STREAM_UPDATE( k054539_update | |
| 123 | 123 | { |
| 124 | 124 | struct k054539_info *info = param; |
| 125 | 125 | #define VOL_CAP 1.80 |
| r3957 | r3958 | |
| 131 | 131 | |
| 132 | 132 | int ch, reverb_pos; |
| 133 | 133 | short *rbase; |
| 134 | unsigned char * | |
| 134 | unsigned char *rom | |
| 135 | 135 | UINT32 rom_mask; |
| 136 | 136 | |
| 137 | 137 | unsigned char *base1, *base2; |
| r3957 | r3958 | |
| 146 | 146 | reverb_pos = info->reverb_pos; |
| 147 | 147 | rbase = (short *)(info->ram); |
| 148 | 148 | |
| 149 | memset(buffer[0], 0, length*sizeof(*buffer[0])); | |
| 150 | memset(buffer[1], 0, length*sizeof(*buffer[1])); | |
| 149 | memset(outputs[0], 0, samples*sizeof(*outputs[0])); | |
| 150 | memset(outputs[1], 0, samples*sizeof(*outputs[1])); | |
| 151 | 151 | |
| 152 | | |
| 152 | rom | |
| 153 | 153 | rom_mask = info->rom_mask; |
| 154 | 154 | |
| 155 | 155 | if(!(info->regs[0x22f] & 1)) return; |
| 156 | 156 | |
| 157 | info->reverb_pos = (reverb_pos + le | |
| 157 | info->reverb_pos = (reverb_pos + samples | |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | for(ch=0; ch<8; ch++) |
| r3957 | r3958 | |
| 199 | 199 | |
| 200 | 200 | cur_pos = (base1[0x0c] | (base1[0x0d] << 8) | (base1[0x0e] << 16)) & rom_mask; |
| 201 | 201 | |
| 202 | bufl = buffer[0]; | |
| 203 | bufr = buffer[1]; | |
| 202 | bufl = outputs[0]; | |
| 203 | bufr = outputs[1]; | |
| 204 | 204 | //* |
| 205 | 205 | |
| 206 | 206 | if(base2[0] & 0x20) { |
| r3957 | r3958 | |
| 233 | 233 | |
| 234 | 234 | switch(base2[0] & 0xc) { |
| 235 | 235 | case 0x0: { // 8bit pcm |
| 236 | for(i=0; i<le | |
| 236 | for(i=0; i<samples | |
| 237 | 237 | cur_pfrac += delta; |
| 238 | 238 | while(cur_pfrac & ~0xffff) { |
| 239 | 239 | cur_pfrac += fdelta; |
| 240 | 240 | cur_pos += pdelta; |
| 241 | 241 | |
| 242 | 242 | cur_pval = cur_val; |
| 243 | cur_val = (INT16)( | |
| 243 | cur_val = (INT16)(rom | |
| 244 | 244 | if(cur_val == (INT16)0x8000) { |
| 245 | 245 | if(base2[1] & 1) { |
| 246 | 246 | cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; |
| 247 | cur_val = (INT16)( | |
| 247 | cur_val = (INT16)(rom | |
| 248 | 248 | if(cur_val != (INT16)0x8000) |
| 249 | 249 | continue; |
| 250 | 250 | } |
| r3957 | r3958 | |
| 261 | 261 | case 0x4: { // 16bit pcm lsb first |
| 262 | 262 | pdelta <<= 1; |
| 263 | 263 | |
| 264 | for(i=0; i<le | |
| 264 | for(i=0; i<samples | |
| 265 | 265 | cur_pfrac += delta; |
| 266 | 266 | while(cur_pfrac & ~0xffff) { |
| 267 | 267 | cur_pfrac += fdelta; |
| 268 | 268 | cur_pos += pdelta; |
| 269 | 269 | |
| 270 | 270 | cur_pval = cur_val; |
| 271 | cur_val = (INT16)( | |
| 271 | cur_val = (INT16)(rom | |
| 272 | 272 | if(cur_val == (INT16)0x8000) { |
| 273 | 273 | if(base2[1] & 1) { |
| 274 | 274 | cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; |
| 275 | cur_val = (INT16)( | |
| 275 | cur_val = (INT16)(rom | |
| 276 | 276 | if(cur_val != (INT16)0x8000) |
| 277 | 277 | continue; |
| 278 | 278 | } |
| r3957 | r3958 | |
| 294 | 294 | cur_pos |= 1; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | for(i=0; i<le | |
| 297 | for(i=0; i<samples | |
| 298 | 298 | cur_pfrac += delta; |
| 299 | 299 | while(cur_pfrac & ~0xffff) { |
| 300 | 300 | cur_pfrac += fdelta; |
| 301 | 301 | cur_pos += pdelta; |
| 302 | 302 | |
| 303 | 303 | cur_pval = cur_val; |
| 304 | cur_val = | |
| 304 | cur_val = rom | |
| 305 | 305 | if(cur_val == 0x88) { |
| 306 | 306 | if(base2[1] & 1) { |
| 307 | 307 | cur_pos = ((base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask) << 1; |
| 308 | cur_val = | |
| 308 | cur_val = rom | |
| 309 | 309 | if(cur_val != 0x88) |
| 310 | 310 | goto next_iter; |
| 311 | 311 | } |
| r3957 | r3958 | |
| 351 | 351 | //* drivers should be given the option to disable reverb when things go terribly wrong |
| 352 | 352 | if(!(info->k054539_flags & K054539_DISABLE_REVERB)) |
| 353 | 353 | { |
| 354 | for(i=0; i<le | |
| 354 | for(i=0; i<samples | |
| 355 | 355 | short val = rbase[(i+reverb_pos) & 0x3fff]; |
| 356 | buffer[0][i] += val; | |
| 357 | buffer[1][i] += val; | |
| 356 | outputs[0][i] += val; | |
| 357 | outputs[1][i] += val; | |
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | if(reverb_pos + le | |
| 361 | if(reverb_pos + samples | |
| 362 | 362 | i = 0x4000 - reverb_pos; |
| 363 | 363 | memset(rbase + reverb_pos, 0, i*2); |
| 364 | memset(rbase, 0, (le | |
| 364 | memset(rbase, 0, (samples | |
| 365 | 365 | } else |
| 366 | memset(rbase + reverb_pos, 0, le | |
| 366 | memset(rbase + reverb_pos, 0, samples | |
| 367 | 367 | |
| 368 | 368 | #if CHANNEL_DEBUG |
| 369 | 369 | { |
| r3957 | r3958 | |
| 715 | 715 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 716 | 716 | |
| 717 | 717 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 718 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k054539 ); break; | |
| 719 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k054539 ); break; | |
| 720 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 721 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 718 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k054539 ); break; | |
| 719 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k054539 ); break; | |
| 720 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 721 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 722 | 722 | |
| 723 | 723 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 724 | case SNDINFO_STR_NAME: info->s = "K054539"; break; | |
| 725 | case SNDINFO_STR_CORE_FAMILY: info->s = "Konami custom"; break; | |
| 726 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 727 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 728 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 724 | case SNDINFO_STR_NAME: strcpy(info->s, "K054539"); break; | |
| 725 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Konami custom"); break; | |
| 726 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 727 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 728 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 729 | 729 | } |
| 730 | 730 | } |
| 731 | 731 |
| r3957 | r3958 | |
|---|---|---|
| 72 | 72 | static void namco_52xx_reset(struct namco_52xx *chip); |
| 73 | 73 | |
| 74 | 74 | |
| 75 | static | |
| 75 | static STREAM_UPDATE( namco_52xx_stream_update_one | |
| 76 | 76 | { |
| 77 | 77 | struct namco_52xx *chip = param; |
| 78 | 78 | int i, rom_pos, whole_pb_cycles, buf; |
| 79 | stream_sample_t *buffer = | |
| 79 | stream_sample_t *buffer = o | |
| 80 | 80 | |
| 81 | 81 | if (chip->n52_start >= chip->n52_end) |
| 82 | 82 | { |
| 83 | memset(buffer, 0, le | |
| 83 | memset(buffer, 0, samples | |
| 84 | 84 | return; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | for (i = 0; i < le | |
| 87 | for (i = 0; i < samples | |
| 88 | 88 | { |
| 89 | 89 | chip->n52_pb_cycle += chip->n52_step; |
| 90 | 90 | if (chip->n52_pb_cycle >= 1) |
| r3957 | r3958 | |
| 97 | 97 | if (chip->n52_pos > chip->n52_length) |
| 98 | 98 | { |
| 99 | 99 | /* sample done */ |
| 100 | memset(&buffer[i], 0, (length - i) * sizeof(INT16)); | |
| 101 | i = length; | |
| 100 | memset(&buffer[i], 0, (samples - i) * sizeof(INT16)); | |
| 101 | i = samples; | |
| 102 | 102 | namco_52xx_reset(chip); |
| 103 | 103 | } |
| 104 | 104 | else |
| r3957 | r3958 | |
| 217 | 217 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 218 | 218 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_52xx ); break; |
| 219 | 219 | case SNDINFO_PTR_START: info->start = SND_START_NAME( namco_52xx ); break; |
| 220 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 220 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 221 | 221 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( namco_52xx ); break; |
| 222 | 222 | |
| 223 | 223 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 224 | case SNDINFO_STR_NAME: info->s = "Namco 52XX"; break; | |
| 225 | case SNDINFO_STR_CORE_FAMILY: info->s = "Namco custom"; break; | |
| 226 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 227 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 228 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 224 | case SNDINFO_STR_NAME: strcpy(info->s, "Namco 52XX"); break; | |
| 225 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Namco custom"); break; | |
| 226 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 227 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 228 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 |
| r3957 | r3958 | |
|---|---|---|
| 259 | 259 | return in; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | static | |
| 262 | static STREAM_UPDATE( update_stereo | |
| 263 | 263 | { |
| 264 | 264 | struct c140_info *info = param; |
| 265 | 265 | int i,j; |
| r3957 | r3958 | |
| 277 | 277 | |
| 278 | 278 | INT16 *lmix, *rmix; |
| 279 | 279 | |
| 280 | if(le | |
| 280 | if(samples | |
| 281 | 281 | |
| 282 | 282 | /* zap the contents of the mixer buffer */ |
| 283 | memset(info->mixer_buffer_left, 0, length * sizeof(INT16)); | |
| 284 | memset(info->mixer_buffer_right, 0, length * sizeof(INT16)); | |
| 283 | memset(info->mixer_buffer_left, 0, samples * sizeof(INT16)); | |
| 284 | memset(info->mixer_buffer_right, 0, samples * sizeof(INT16)); | |
| 285 | 285 | |
| 286 | 286 | /* get the number of voices to update */ |
| 287 | 287 | voicecnt = (info->banking_type == C140_TYPE_ASIC219) ? 16 : 24; |
| r3957 | r3958 | |
| 306 | 306 | lvol=(vreg->volume_left*32)/MAX_VOICE; //32ch -> 24ch |
| 307 | 307 | rvol=(vreg->volume_right*32)/MAX_VOICE; |
| 308 | 308 | |
| 309 | /* Set mixer | |
| 309 | /* Set mixer outputs base pointers */ | |
| 310 | 310 | lmix = info->mixer_buffer_left; |
| 311 | 311 | rmix = info->mixer_buffer_right; |
| 312 | 312 | |
| r3957 | r3958 | |
| 330 | 330 | { |
| 331 | 331 | //compressed PCM (maybe correct...) |
| 332 | 332 | /* Loop for enough to fill sample buffer as requested */ |
| 333 | for(j=0;j<le | |
| 333 | for(j=0;j<samples | |
| 334 | 334 | { |
| 335 | 335 | offset += delta; |
| 336 | 336 | cnt = (offset>>16)&0x7fff; |
| r3957 | r3958 | |
| 377 | 377 | else |
| 378 | 378 | { |
| 379 | 379 | /* linear 8bit signed PCM */ |
| 380 | for(j=0;j<le | |
| 380 | for(j=0;j<samples | |
| 381 | 381 | { |
| 382 | 382 | offset += delta; |
| 383 | 383 | cnt = (offset>>16)&0x7fff; |
| r3957 | r3958 | |
| 444 | 444 | lmix = info->mixer_buffer_left; |
| 445 | 445 | rmix = info->mixer_buffer_right; |
| 446 | 446 | { |
| 447 | stream_sample_t *dest1 = buffer[0]; | |
| 448 | stream_sample_t *dest2 = buffer[1]; | |
| 449 | for (i = 0; i < length; i++) | |
| 447 | stream_sample_t *dest1 = outputs[0]; | |
| 448 | stream_sample_t *dest2 = outputs[1]; | |
| 449 | for (i = 0; i < samples; i++) | |
| 450 | 450 | { |
| 451 | 451 | *dest1++ = limit(8*(*lmix++)); |
| 452 | 452 | *dest2++ = limit(8*(*rmix++)); |
| r3957 | r3958 | |
| 516 | 516 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 517 | 517 | |
| 518 | 518 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 519 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c140 ); break; | |
| 520 | case SNDINFO_PTR_START: info->start = SND_START_NAME( c140 ); break; | |
| 521 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 522 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 519 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c140 ); break; | |
| 520 | case SNDINFO_PTR_START: info->start = SND_START_NAME( c140 ); break; | |
| 521 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 522 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 523 | 523 | |
| 524 | 524 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 525 | case SNDINFO_STR_NAME: info->s = "C140"; break; | |
| 526 | case SNDINFO_STR_CORE_FAMILY: info->s = "Namco PCM"; break; | |
| 527 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 528 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 529 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 525 | case SNDINFO_STR_NAME: strcpy(info->s, "C140"); break; | |
| 526 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Namco PCM"); break; | |
| 527 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 528 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 529 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 530 | 530 | } |
| 531 | 531 | } |
| 532 | 532 |
| r3957 | r3958 | |
|---|---|---|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /* stream update callbacks */ |
| 93 | static | |
| 93 | static STREAM_UPDATE( MSM5205_update | |
| 94 | 94 | { |
| 95 | 95 | struct MSM5205Voice *voice = param; |
| 96 | stream_sample_t *buffer = | |
| 96 | stream_sample_t *buffer = o | |
| 97 | 97 | |
| 98 | 98 | /* if this voice is active */ |
| 99 | 99 | if(voice->signal) |
| 100 | 100 | { |
| 101 | 101 | short val = voice->signal * 16; |
| 102 | while (le | |
| 102 | while (samples | |
| 103 | 103 | { |
| 104 | 104 | *buffer++ = val; |
| 105 | le | |
| 105 | samples | |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | else |
| 109 | memset (buffer,0,le | |
| 109 | memset (buffer,0,samples | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /* timer callback at VCLK low eddge */ |
| r3957 | r3958 | |
| 318 | 318 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 319 | 319 | |
| 320 | 320 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 321 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( msm5205 ); break; | |
| 322 | case SNDINFO_PTR_START: info->start = SND_START_NAME( msm5205 );break; | |
| 323 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 324 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( msm5205 );break; | |
| 321 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( msm5205 ); break; | |
| 322 | case SNDINFO_PTR_START: info->start = SND_START_NAME( msm5205 ); break; | |
| 323 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 324 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( msm5205 ); break; | |
| 325 | 325 | |
| 326 | 326 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 327 | case SNDINFO_STR_NAME: info->s = "MSM5205"; break; | |
| 328 | case SNDINFO_STR_CORE_FAMILY: info->s = "ADPCM"; break; | |
| 329 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 330 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 331 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 327 | case SNDINFO_STR_NAME: strcpy(info->s, "MSM5205"); break; | |
| 328 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "ADPCM"); break; | |
| 329 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 330 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 331 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 |
| r3957 | r3958 | |
|---|---|---|
| 89 | 89 | }; |
| 90 | 90 | |
| 91 | 91 | /* Function prototypes */ |
| 92 | static | |
| 92 | static STREAM_UPDATE( qsound_update | |
| 93 | 93 | static void qsound_set_command(struct qsound_info *chip, int data, int value); |
| 94 | 94 | |
| 95 | 95 | static SND_START( qsound ) |
| r3957 | r3958 | |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | |
| 307 | static | |
| 307 | static STREAM_UPDATE( qsound_update | |
| 308 | 308 | { |
| 309 | 309 | struct qsound_info *chip = param; |
| 310 | 310 | int i,j; |
| r3957 | r3958 | |
| 312 | 312 | struct QSOUND_CHANNEL *pC=&chip->channel[0]; |
| 313 | 313 | stream_sample_t *datap[2]; |
| 314 | 314 | |
| 315 | datap[0] = buffer[0]; | |
| 316 | datap[1] = buffer[1]; | |
| 317 | memset( datap[0], 0x00, length * sizeof(*datap[0]) ); | |
| 318 | memset( datap[1], 0x00, length * sizeof(*datap[1]) ); | |
| 315 | datap[0] = outputs[0]; | |
| 316 | datap[1] = outputs[1]; | |
| 317 | memset( datap[0], 0x00, samples * sizeof(*datap[0]) ); | |
| 318 | memset( datap[1], 0x00, samples * sizeof(*datap[1]) ); | |
| 319 | 319 | |
| 320 | 320 | for (i=0; i<QSOUND_CHANNELS; i++) |
| 321 | 321 | { |
| r3957 | r3958 | |
| 326 | 326 | rvol=(pC->rvol*pC->vol)>>8; |
| 327 | 327 | lvol=(pC->lvol*pC->vol)>>8; |
| 328 | 328 | |
| 329 | for (j=le | |
| 329 | for (j=samples | |
| 330 | 330 | { |
| 331 | 331 | count=(pC->offset)>>16; |
| 332 | 332 | pC->offset &= 0xffff; |
| r3957 | r3958 | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | if (chip->fpRawDataL) |
| 361 | fwrite(datap[0], le | |
| 361 | fwrite(datap[0], samples | |
| 362 | 362 | if (chip->fpRawDataR) |
| 363 | fwrite(datap[1], le | |
| 363 | fwrite(datap[1], samples | |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | |
| r3957 | r3958 | |
| 385 | 385 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 386 | 386 | |
| 387 | 387 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 388 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( qsound ); break; | |
| 389 | case SNDINFO_PTR_START: info->start = SND_START_NAME( qsound ); break; | |
| 390 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( qsound ); break; | |
| 391 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 388 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( qsound ); break; | |
| 389 | case SNDINFO_PTR_START: info->start = SND_START_NAME( qsound ); break; | |
| 390 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( qsound ); break; | |
| 391 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 392 | 392 | |
| 393 | 393 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 394 | case SNDINFO_STR_NAME: info->s = "Q-Sound"; break; | |
| 395 | case SNDINFO_STR_CORE_FAMILY: info->s = "Capcom custom"; break; | |
| 396 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 397 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 398 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 394 | case SNDINFO_STR_NAME: strcpy(info->s, "Q-Sound"); break; | |
| 395 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Capcom custom"); break; | |
| 396 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 397 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 398 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | static | |
| 69 | static STREAM_UPDATE( ym3812_stream_update | |
| 70 | 70 | { |
| 71 | 71 | struct ym3812_info *info = param; |
| 72 | ym3812_update_one(info->chip, | |
| 72 | ym3812_update_one(info->chip, outputs[0], samples | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static void _stream_update_3812(void * param, int interval) |
| r3957 | r3958 | |
| 182 | 182 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym3812 ); break; |
| 183 | 183 | |
| 184 | 184 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 185 | case SNDINFO_STR_NAME: info->s = "YM3812"; break; | |
| 186 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 187 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 188 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 189 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 185 | case SNDINFO_STR_NAME: strcpy(info->s, "YM3812"); break; | |
| 186 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 187 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 188 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 189 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
| r3957 | r3958 | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| 240 | static | |
| 240 | static STREAM_UPDATE( ym3526_stream_update | |
| 241 | 241 | { |
| 242 | 242 | struct ym3526_info *info = param; |
| 243 | ym3526_update_one(info->chip, | |
| 243 | ym3526_update_one(info->chip, outputs[0], samples | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | static void _stream_update_3526(void *param, int interval) |
| r3957 | r3958 | |
| 352 | 352 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym3526 ); break; |
| 353 | 353 | |
| 354 | 354 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 355 | case SNDINFO_STR_NAME: info->s = "YM3526"; break; | |
| 356 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 357 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 358 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 359 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 355 | case SNDINFO_STR_NAME: strcpy(info->s, "YM3526"); break; | |
| 356 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 357 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 358 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 359 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | |
| r3957 | r3958 | |
| 442 | 442 | info->intf->keyboardwrite(space,info->index,data); |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | static | |
| 445 | static STREAM_UPDATE( y8950_stream_update | |
| 446 | 446 | { |
| 447 | 447 | struct y8950_info *info = param; |
| 448 | y8950_update_one(info->chip, | |
| 448 | y8950_update_one(info->chip, outputs[0], samples | |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | static void _stream_update_8950(void *param, int interval) |
| r3957 | r3958 | |
| 566 | 566 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( y8950 ); break; |
| 567 | 567 | |
| 568 | 568 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 569 | case SNDINFO_STR_NAME: info->s = "Y8950"; break; | |
| 570 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 571 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 572 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 573 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 569 | case SNDINFO_STR_NAME: strcpy(info->s, "Y8950"); break; | |
| 570 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 571 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 572 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 573 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 574 | 574 | } |
| 575 | 575 | } |
| 576 | 576 |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | /* generate sound to the mix buffer */ |
| 56 | static | |
| 56 | static STREAM_UPDATE( snkwave_update | |
| 57 | 57 | { |
| 58 | 58 | struct snkwave_sound *chip = param; |
| 59 | stream_sample_t *buffer = | |
| 59 | stream_sample_t *buffer = o | |
| 60 | 60 | |
| 61 | 61 | /* zap the contents of the buffer */ |
| 62 | memset(buffer, 0, le | |
| 62 | memset(buffer, 0, samples | |
| 63 | 63 | |
| 64 | 64 | assert(chip->counter < 0x1000); |
| 65 | 65 | assert(chip->frequency < 0x1000); |
| r3957 | r3958 | |
| 69 | 69 | return; |
| 70 | 70 | |
| 71 | 71 | /* generate sound into buffer while updating the counter */ |
| 72 | while (le | |
| 72 | while (samples | |
| 73 | 73 | { |
| 74 | 74 | int loops; |
| 75 | 75 | INT16 out = 0; |
| r3957 | r3958 | |
| 179 | 179 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 180 | 180 | |
| 181 | 181 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 182 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( snkwave ); break; | |
| 183 | case SNDINFO_PTR_START: info->start = SND_START_NAME( snkwave ); break; | |
| 184 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 185 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 182 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( snkwave ); break; | |
| 183 | case SNDINFO_PTR_START: info->start = SND_START_NAME( snkwave ); break; | |
| 184 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 185 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 186 | 186 | |
| 187 | 187 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 188 | case SNDINFO_STR_NAME: info->s = "SNK Wave"; break; | |
| 189 | case SNDINFO_STR_CORE_FAMILY: info->s = "SNK Wave"; break; | |
| 190 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 191 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 192 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 188 | case SNDINFO_STR_NAME: strcpy(info->s, "SNK Wave"); break; | |
| 189 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "SNK Wave"); break; | |
| 190 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 191 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 192 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 193 | 193 | } |
| 194 | 194 | } |
| r3957 | r3958 | |
|---|---|---|
| 102 | 102 | return val; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | static | |
| 105 | static STREAM_UPDATE( rf5c400_update | |
| 106 | 106 | { |
| 107 | 107 | int i, ch; |
| 108 | 108 | struct rf5c400_info *info = param; |
| r3957 | r3958 | |
| 113 | 113 | UINT8 env_phase; |
| 114 | 114 | double env_level, env_step, env_rstep; |
| 115 | 115 | |
| 116 | memset(buffer[0], 0, length * sizeof(*buffer[0])); | |
| 117 | memset(buffer[1], 0, length * sizeof(*buffer[1])); | |
| 116 | memset(outputs[0], 0, samples * sizeof(*outputs[0])); | |
| 117 | memset(outputs[1], 0, samples * sizeof(*outputs[1])); | |
| 118 | 118 | |
| 119 | 119 | for (ch=0; ch < 32; ch++) |
| 120 | 120 | { |
| 121 | 121 | struct RF5C400_CHANNEL *channel = &info->channels[ch]; |
| 122 | stream_sample_t *buf0 = buffer[0]; | |
| 123 | stream_sample_t *buf1 = buffer[1]; | |
| 122 | stream_sample_t *buf0 = outputs[0]; | |
| 123 | stream_sample_t *buf1 = outputs[1]; | |
| 124 | 124 | |
| 125 | 125 | start = ((channel->startH & 0xFF00) << 8) | channel->startL; |
| 126 | 126 | end = ((channel->endHloopH & 0xFF) << 16) | channel->endL; |
| r3957 | r3958 | |
| 136 | 136 | env_step = channel->env_step; |
| 137 | 137 | env_rstep = env_step * channel->env_scale; |
| 138 | 138 | |
| 139 | for (i=0; i < le | |
| 139 | for (i=0; i < samples | |
| 140 | 140 | { |
| 141 | 141 | INT16 tmp; |
| 142 | 142 | INT32 sample; |
| r3957 | r3958 | |
| 582 | 582 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 583 | 583 | |
| 584 | 584 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 585 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( rf5c400 ); break; | |
| 586 | case SNDINFO_PTR_START: info->start = SND_START_NAME( rf5c400 ); break; | |
| 587 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 588 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 585 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( rf5c400 ); break; | |
| 586 | case SNDINFO_PTR_START: info->start = SND_START_NAME( rf5c400 ); break; | |
| 587 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 588 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 589 | 589 | |
| 590 | 590 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 591 | case SNDINFO_STR_NAME: info->s = "RF5C400"; break; | |
| 592 | case SNDINFO_STR_CORE_FAMILY: info->s = "Ricoh PCM"; break; | |
| 593 | case SNDINFO_STR_CORE_VERSION: info->s = "1.1"; break; | |
| 594 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 595 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team & hoot development team"; break; | |
| 591 | case SNDINFO_STR_NAME: strcpy(info->s, "RF5C400"); break; | |
| 592 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Ricoh PCM"); break; | |
| 593 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; | |
| 594 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 595 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team & hoot development team"); break; | |
| 596 | 596 | } |
| 597 | 597 | } |
| r3957 | r3958 | |
|---|---|---|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| 215 | static | |
| 215 | static STREAM_UPDATE( saa1099_update | |
| 216 | 216 | { |
| 217 | 217 | struct SAA1099 *saa = param; |
| 218 | 218 | int j, ch; |
| r3957 | r3958 | |
| 221 | 221 | if (!saa->all_ch_enable) |
| 222 | 222 | { |
| 223 | 223 | /* init output data */ |
| 224 | memset(buffer[LEFT],0,length*sizeof(*buffer[LEFT])); | |
| 225 | memset(buffer[RIGHT],0,length*sizeof(*buffer[RIGHT])); | |
| 224 | memset(outputs[LEFT],0,samples*sizeof(*outputs[LEFT])); | |
| 225 | memset(outputs[RIGHT],0,samples*sizeof(*outputs[RIGHT])); | |
| 226 | 226 | return; |
| 227 | 227 | } |
| 228 | 228 | |
| r3957 | r3958 | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /* fill all data needed */ |
| 241 | for( j = 0; j < le | |
| 241 | for( j = 0; j < samples | |
| 242 | 242 | { |
| 243 | 243 | int output_l = 0, output_r = 0; |
| 244 | 244 | |
| r3957 | r3958 | |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | /* write sound data to the buffer */ |
| 308 | buffer[LEFT][j] = output_l / 6; | |
| 309 | buffer[RIGHT][j] = output_r / 6; | |
| 308 | outputs[LEFT][j] = output_l / 6; | |
| 309 | outputs[RIGHT][j] = output_r / 6; | |
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | |
| r3957 | r3958 | |
| 506 | 506 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 507 | 507 | |
| 508 | 508 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 509 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( saa1099 ); break; | |
| 510 | case SNDINFO_PTR_START: info->start = SND_START_NAME( saa1099 ); break; | |
| 511 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 512 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 509 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( saa1099 ); break; | |
| 510 | case SNDINFO_PTR_START: info->start = SND_START_NAME( saa1099 ); break; | |
| 511 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 512 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 513 | 513 | |
| 514 | 514 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 515 | case SNDINFO_STR_NAME: info->s = "SAA1099"; break; | |
| 516 | case SNDINFO_STR_CORE_FAMILY: info->s = "Philips"; break; | |
| 517 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 518 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 519 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 515 | case SNDINFO_STR_NAME: strcpy(info->s, "SAA1099"); break; | |
| 516 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Philips"); break; | |
| 517 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 518 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 519 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 |
| r3957 | r3958 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | /* generate sound to the mix buffer in mono */ |
| 142 | static | |
| 142 | static STREAM_UPDATE( cem3394_update | |
| 143 | 143 | { |
| 144 | 144 | sound_chip *chip = param; |
| 145 | 145 | int int_volume = (chip->volume * chip->mixer_internal) / 256; |
| 146 | 146 | int ext_volume = (chip->volume * chip->mixer_external) / 256; |
| 147 | 147 | UINT32 step = chip->step, position, end_position = 0; |
| 148 | stream_sample_t *buffer = | |
| 148 | stream_sample_t *buffer = o | |
| 149 | 149 | INT16 *mix, *ext; |
| 150 | 150 | int i; |
| 151 | 151 | |
| r3957 | r3958 | |
| 160 | 160 | /* bail if nothing's going on */ |
| 161 | 161 | if (int_volume == 0 && ext_volume == 0) |
| 162 | 162 | { |
| 163 | memset(buffer, 0, sizeof(*buffer) * le | |
| 163 | memset(buffer, 0, sizeof(*buffer) * samples | |
| 164 | 164 | return; |
| 165 | 165 | } |
| 166 | 166 | |
| r3957 | r3958 | |
| 171 | 171 | INT16 last_ext = chip->last_ext; |
| 172 | 172 | |
| 173 | 173 | /* fetch the external data */ |
| 174 | (*chip->external)(chip->index, le | |
| 174 | (*chip->external)(chip->index, samples | |
| 175 | 175 | |
| 176 | 176 | /* compute the modulation depth, and adjust fstep to the maximum frequency */ |
| 177 | 177 | /* we lop off 13 bits of depth so that we can multiply by stepadjust, below, */ |
| r3957 | r3958 | |
| 182 | 182 | |
| 183 | 183 | /* "apply" the filter: note this is pretty cheesy; it basically just downsamples the |
| 184 | 184 | external sample to filter_freq by allowing only 2 transitions for every cycle */ |
| 185 | for (i = 0, ext = chip->external_buffer, position = chip->position; i < le | |
| 185 | for (i = 0, ext = chip->external_buffer, position = chip->position; i < samples | |
| 186 | 186 | { |
| 187 | 187 | UINT32 newposition; |
| 188 | 188 | INT32 stepadjust; |
| r3957 | r3958 | |
| 224 | 224 | /* if the width is wider than the step, we're guaranteed to hit it once per cycle */ |
| 225 | 225 | if (pulse_width >= step) |
| 226 | 226 | { |
| 227 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < le | |
| 227 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < samples | |
| 228 | 228 | { |
| 229 | 229 | if (position < pulse_width) |
| 230 | 230 | *mix = 0x1932; |
| r3957 | r3958 | |
| 238 | 238 | else |
| 239 | 239 | { |
| 240 | 240 | INT16 volume = 0x1932 * pulse_width / step; |
| 241 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < le | |
| 241 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < samples | |
| 242 | 242 | { |
| 243 | 243 | UINT32 newposition = position + step; |
| 244 | 244 | if ((newposition ^ position) & ~FRACTION_MASK) |
| r3957 | r3958 | |
| 253 | 253 | |
| 254 | 254 | /* otherwise, clear the mixing buffer */ |
| 255 | 255 | else |
| 256 | memset(chip->mixer_buffer, 0, sizeof(INT16) * le | |
| 256 | memset(chip->mixer_buffer, 0, sizeof(INT16) * samples | |
| 257 | 257 | |
| 258 | 258 | /* handle the sawtooth component; it maxes out at 0x2000, which is 27% larger */ |
| 259 | 259 | /* than the pulse */ |
| 260 | 260 | if (ENABLE_SAWTOOTH && (chip->wave_select & WAVE_SAWTOOTH)) |
| 261 | 261 | { |
| 262 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < le | |
| 262 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < samples | |
| 263 | 263 | { |
| 264 | 264 | *mix += ((position >> (FRACTION_BITS - 14)) & 0x3fff) - 0x2000; |
| 265 | 265 | position += step; |
| r3957 | r3958 | |
| 272 | 272 | /* a multiplication) */ |
| 273 | 273 | if (ENABLE_TRIANGLE && (chip->wave_select & WAVE_TRIANGLE)) |
| 274 | 274 | { |
| 275 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < le | |
| 275 | for (i = 0, mix = chip->mixer_buffer, position = chip->position; i < samples | |
| 276 | 276 | { |
| 277 | 277 | INT16 value; |
| 278 | 278 | if (position & (1 << (FRACTION_BITS - 1))) |
| r3957 | r3958 | |
| 296 | 296 | /* internal + external */ |
| 297 | 297 | if (ext_volume != 0 && int_volume != 0) |
| 298 | 298 | { |
| 299 | for (i = 0; i < le | |
| 299 | for (i = 0; i < samples | |
| 300 | 300 | *buffer++ = (*mix * int_volume + *ext * ext_volume) / 128; |
| 301 | 301 | } |
| 302 | 302 | /* internal only */ |
| 303 | 303 | else if (int_volume != 0) |
| 304 | 304 | { |
| 305 | for (i = 0; i < le | |
| 305 | for (i = 0; i < samples | |
| 306 | 306 | *buffer++ = *mix * int_volume / 128; |
| 307 | 307 | } |
| 308 | 308 | /* external only */ |
| 309 | 309 | else |
| 310 | 310 | { |
| 311 | for (i = 0; i < le | |
| 311 | for (i = 0; i < samples | |
| 312 | 312 | *buffer++ = *ext * ext_volume / 128; |
| 313 | 313 | } |
| 314 | 314 | } |
| r3957 | r3958 | |
| 577 | 577 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 578 | 578 | |
| 579 | 579 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 580 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cem3394 ); break; | |
| 581 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cem3394 ); break; | |
| 582 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 583 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 580 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cem3394 ); break; | |
| 581 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cem3394 ); break; | |
| 582 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 583 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 584 | 584 | |
| 585 | 585 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 586 | case SNDINFO_STR_NAME: info->s = "CEM3394"; break; | |
| 587 | case SNDINFO_STR_CORE_FAMILY: info->s = "Analog Synth"; break; | |
| 588 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 589 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 590 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 586 | case SNDINFO_STR_NAME: strcpy(info->s, "CEM3394"); break; | |
| 587 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Analog Synth"); break; | |
| 588 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 589 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 590 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 591 | 591 | } |
| 592 | 592 | } |
| 593 | 593 |
| r3957 | r3958 | |
|---|---|---|
| 488 | 488 | |
| 489 | 489 | ***********************************************************************************************/ |
| 490 | 490 | |
| 491 | static | |
| 491 | static STREAM_UPDATE( ymz280b_update | |
| 492 | 492 | { |
| 493 | 493 | struct YMZ280BChip *chip = param; |
| 494 | stream_sample_t *lacc = buffer[0]; | |
| 495 | stream_sample_t *racc = buffer[1]; | |
| 494 | stream_sample_t *lacc = outputs[0]; | |
| 495 | stream_sample_t *racc = outputs[1]; | |
| 496 | 496 | int v; |
| 497 | 497 | |
| 498 | 498 | /* clear out the accumulator */ |
| 499 | memset(lacc, 0, length * sizeof(lacc[0])); | |
| 500 | memset(racc, 0, length * sizeof(racc[0])); | |
| 499 | memset(lacc, 0, samples * sizeof(lacc[0])); | |
| 500 | memset(racc, 0, samples * sizeof(racc[0])); | |
| 501 | 501 | |
| 502 | 502 | /* loop over voices */ |
| 503 | 503 | for (v = 0; v < 8; v++) |
| r3957 | r3958 | |
| 510 | 510 | INT32 *rdest = racc; |
| 511 | 511 | UINT32 new_samples, samples_left; |
| 512 | 512 | UINT32 final_pos; |
| 513 | int remaining = le | |
| 513 | int remaining = samples | |
| 514 | 514 | int lvol = voice->output_left; |
| 515 | 515 | int rvol = voice->output_right; |
| 516 | 516 | |
| r3957 | r3958 | |
| 612 | 612 | voice->curr_sample = curr; |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | for (v = 0; v < le | |
| 615 | for (v = 0; v < samples | |
| 616 | 616 | { |
| 617 | buffer[0][v] /= 256; | |
| 618 | buffer[1][v] /= 256; | |
| 617 | outputs[0][v] /= 256; | |
| 618 | outputs[1][v] /= 256; | |
| 619 | 619 | } |
| 620 | 620 | } |
| 621 | 621 | |
| r3957 | r3958 | |
| 1118 | 1118 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1119 | 1119 | |
| 1120 | 1120 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1121 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymz280b ); break; | |
| 1122 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ymz280b ); break; | |
| 1123 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1124 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1121 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymz280b ); break; | |
| 1122 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ymz280b ); break; | |
| 1123 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1124 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1125 | 1125 | |
| 1126 | 1126 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1127 | case SNDINFO_STR_NAME: info->s = "YMZ280B"; break; | |
| 1128 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha Wavetable"; break; | |
| 1129 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 1130 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 1131 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1127 | case SNDINFO_STR_NAME: strcpy(info->s, "YMZ280B"); break; | |
| 1128 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha Wavetable"); break; | |
| 1129 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 1130 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1131 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1132 | 1132 | } |
| 1133 | 1133 | } |
| 1134 | 1134 |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | /* RF5C68 stream update */ |
| 40 | 40 | /************************************************/ |
| 41 | 41 | |
| 42 | static | |
| 42 | static STREAM_UPDATE( rf5c68_update | |
| 43 | 43 | { |
| 44 | 44 | struct rf5c68pcm *chip = param; |
| 45 | stream_sample_t *left = buffer[0]; | |
| 46 | stream_sample_t *right = buffer[1]; | |
| 45 | stream_sample_t *left = outputs[0]; | |
| 46 | stream_sample_t *right = outputs[1]; | |
| 47 | 47 | int i, j; |
| 48 | 48 | |
| 49 | 49 | /* start with clean buffers */ |
| 50 | memset(left, 0, length * sizeof(*left)); | |
| 51 | memset(right, 0, length * sizeof(*right)); | |
| 50 | memset(left, 0, samples * sizeof(*left)); | |
| 51 | memset(right, 0, samples * sizeof(*right)); | |
| 52 | 52 | |
| 53 | 53 | /* bail if not enabled */ |
| 54 | 54 | if (!chip->enable) |
| r3957 | r3958 | |
| 66 | 66 | int rv = ((chan->pan >> 4) & 0x0f) * chan->env; |
| 67 | 67 | |
| 68 | 68 | /* loop over the sample buffer */ |
| 69 | for (j = 0; j < le | |
| 69 | for (j = 0; j < samples | |
| 70 | 70 | { |
| 71 | 71 | int sample; |
| 72 | 72 | |
| r3957 | r3958 | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /* now clamp and shift the result (output is only 10 bits) */ |
| 103 | for (j = 0; j < le | |
| 103 | for (j = 0; j < samples | |
| 104 | 104 | { |
| 105 | 105 | stream_sample_t temp; |
| 106 | 106 | |
| r3957 | r3958 | |
| 126 | 126 | /* allocate memory for the chip */ |
| 127 | 127 | struct rf5c68pcm *chip = auto_malloc(sizeof(*chip)); |
| 128 | 128 | memset(chip, 0, sizeof(*chip)); |
| 129 | memset(chip->data, 0xff, sizeof(chip->data)); | |
| 130 | 129 | |
| 131 | 130 | /* allocate the stream */ |
| 132 | 131 | chip->stream = stream_create(device, 0, 2, clock / 384, chip, rf5c68_update); |
| r3957 | r3958 | |
| 243 | 242 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 244 | 243 | |
| 245 | 244 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 246 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( rf5c68 ); break; | |
| 247 | case SNDINFO_PTR_START: info->start = SND_START_NAME( rf5c68 ); break; | |
| 248 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 249 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 245 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( rf5c68 ); break; | |
| 246 | case SNDINFO_PTR_START: info->start = SND_START_NAME( rf5c68 ); break; | |
| 247 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 248 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 250 | 249 | |
| 251 | 250 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 252 | case SNDINFO_STR_NAME: info->s = "RF5C68"; break; | |
| 253 | case SNDINFO_STR_CORE_FAMILY: info->s = "Ricoh PCM"; break; | |
| 254 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 255 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 256 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 251 | case SNDINFO_STR_NAME: strcpy(info->s, "RF5C68"); break; | |
| 252 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Ricoh PCM"); break; | |
| 253 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 254 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 255 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 257 | 256 | } |
| 258 | 257 | } |
| 259 | 258 |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | /* generate sound to the mix buffer */ |
| 90 | static | |
| 90 | static STREAM_UPDATE( K005289_update | |
| 91 | 91 | { |
| 92 | 92 | struct k005289_info *info = param; |
| 93 | 93 | k005289_sound_channel *voice=info->channel_list; |
| 94 | stream_sample_t *buffer = | |
| 94 | stream_sample_t *buffer = o | |
| 95 | 95 | short *mix; |
| 96 | 96 | int i,v,f; |
| 97 | 97 | |
| 98 | 98 | /* zap the contents of the mixer buffer */ |
| 99 | memset(info->mixer_buffer, 0, le | |
| 99 | memset(info->mixer_buffer, 0, samples | |
| 100 | 100 | |
| 101 | 101 | v=voice[0].volume; |
| 102 | 102 | f=voice[0].frequency; |
| r3957 | r3958 | |
| 108 | 108 | mix = info->mixer_buffer; |
| 109 | 109 | |
| 110 | 110 | /* add our contribution */ |
| 111 | for (i = 0; i < le | |
| 111 | for (i = 0; i < samples | |
| 112 | 112 | { |
| 113 | 113 | int offs; |
| 114 | 114 | |
| r3957 | r3958 | |
| 131 | 131 | mix = info->mixer_buffer; |
| 132 | 132 | |
| 133 | 133 | /* add our contribution */ |
| 134 | for (i = 0; i < le | |
| 134 | for (i = 0; i < samples | |
| 135 | 135 | { |
| 136 | 136 | int offs; |
| 137 | 137 | |
| r3957 | r3958 | |
| 146 | 146 | |
| 147 | 147 | /* mix it down */ |
| 148 | 148 | mix = info->mixer_buffer; |
| 149 | for (i = 0; i < le | |
| 149 | for (i = 0; i < samples | |
| 150 | 150 | *buffer++ = info->mixer_lookup[*mix++]; |
| 151 | 151 | } |
| 152 | 152 | |
| r3957 | r3958 | |
| 268 | 268 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 269 | 269 | |
| 270 | 270 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 271 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k005289 ); break; | |
| 272 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k005289 ); break; | |
| 273 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 274 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 271 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k005289 ); break; | |
| 272 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k005289 ); break; | |
| 273 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 274 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 275 | 275 | |
| 276 | 276 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 277 | case SNDINFO_STR_NAME: info->s = "K005289"; break; | |
| 278 | case SNDINFO_STR_CORE_FAMILY: info->s = "Konami custom"; break; | |
| 279 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 280 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 281 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 277 | case SNDINFO_STR_NAME: strcpy(info->s, "K005289"); break; | |
| 278 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Konami custom"); break; | |
| 279 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 280 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 281 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 |
| r3957 | r3958 | |
|---|---|---|
| 58 | 58 | 0 |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | static | |
| 61 | static STREAM_UPDATE( votrax_update_sound | |
| 62 | 62 | { |
| 63 | 63 | struct votrax_info *info = param; |
| 64 | stream_sample_t *buffer = | |
| 64 | stream_sample_t *buffer = o | |
| 65 | 65 | |
| 66 | 66 | if (info->sample) |
| 67 | 67 | { |
| r3957 | r3958 | |
| 175 | 175 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 176 | 176 | |
| 177 | 177 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 178 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( votrax ); break; | |
| 179 | case SNDINFO_PTR_START: info->start = SND_START_NAME( votrax ); break; | |
| 180 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 181 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 178 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( votrax ); break; | |
| 179 | case SNDINFO_PTR_START: info->start = SND_START_NAME( votrax ); break; | |
| 180 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 181 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 182 | 182 | |
| 183 | 183 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 184 | case SNDINFO_STR_NAME: info->s = "Votrax SC-01"; break; | |
| 185 | case SNDINFO_STR_CORE_FAMILY: info->s = "Votrax speech"; break; | |
| 186 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 187 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 188 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 184 | case SNDINFO_STR_NAME: strcpy(info->s, "Votrax SC-01"); break; | |
| 185 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Votrax speech"); break; | |
| 186 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 187 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 188 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 |
| r3957 | r3958 | |
|---|---|---|
| 1276 | 1276 | } |
| 1277 | 1277 | #endif |
| 1278 | 1278 | |
| 1279 | static | |
| 1279 | static STREAM_UPDATE( AICA_Update | |
| 1280 | 1280 | { |
| 1281 | 1281 | struct _AICA *AICA = param; |
| 1282 | bufferl = buf[0]; | |
| 1283 | bufferr = buf[1]; | |
| 1282 | bufferl = outputs[0]; | |
| 1283 | bufferr = outputs[1]; | |
| 1284 | 1284 | length = samples; |
| 1285 | 1285 | AICA_DoMasterSamples(AICA, samples); |
| 1286 | 1286 | } |
| r3957 | r3958 | |
| 1384 | 1384 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1385 | 1385 | |
| 1386 | 1386 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1387 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( aica ); break; | |
| 1388 | case SNDINFO_PTR_START: info->start = SND_START_NAME( aica ); break; | |
| 1389 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1390 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1387 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( aica ); break; | |
| 1388 | case SNDINFO_PTR_START: info->start = SND_START_NAME( aica ); break; | |
| 1389 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1390 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1391 | 1391 | |
| 1392 | 1392 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1393 | case SNDINFO_STR_NAME: info->s = "AICA"; break; | |
| 1394 | case SNDINFO_STR_CORE_FAMILY: info->s = "Sega/Yamaha custom"; break; | |
| 1395 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0.1"; break; | |
| 1396 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 1397 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1393 | case SNDINFO_STR_NAME: strcpy(info->s, "AICA"); break; | |
| 1394 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Sega/Yamaha custom"); break; | |
| 1395 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0.1"); break; | |
| 1396 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1397 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1398 | 1398 | } |
| 1399 | 1399 | } |
| 1400 | 1400 |
| r3957 | r3958 | |
|---|---|---|
| 134 | 134 | WRITE8_HANDLER( sn76496_4_w ) { SN76496Write(4,data); } |
| 135 | 135 | |
| 136 | 136 | |
| 137 | static | |
| 137 | static STREAM_UPDATE( SN76496Update | |
| 138 | 138 | { |
| 139 | 139 | int i; |
| 140 | 140 | struct SN76496 *R = param; |
| 141 | stream_sample_t *buffer = | |
| 141 | stream_sample_t *buffer = o | |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | /* If the volume is 0, increase the counter */ |
| r3957 | r3958 | |
| 146 | 146 | { |
| 147 | 147 | if (R->Volume[i] == 0) |
| 148 | 148 | { |
| 149 | /* note that I do count += le | |
| 149 | /* note that I do count += samples | |
| 150 | 150 | /* it's the same since the volume is 0, but doing the latter could cause */ |
| 151 | 151 | /* interferencies when the program is rapidly modulating the volume. */ |
| 152 | if (R->Count[i] <= le | |
| 152 | if (R->Count[i] <= samples | |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | while (le | |
| 156 | while (samples | |
| 157 | 157 | { |
| 158 | 158 | int vol[4]; |
| 159 | 159 | unsigned int out; |
| r3957 | r3958 | |
| 245 | 245 | |
| 246 | 246 | *(buffer++) = out / STEP; |
| 247 | 247 | |
| 248 | le | |
| 248 | samples | |
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
| r3957 | r3958 | |
| 392 | 392 | switch (state) |
| 393 | 393 | { |
| 394 | 394 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 395 | case SNDINFO_INT_ALIAS: info->i = SOUND_SN76496; break; | |
| 395 | case SNDINFO_INT_ALIAS: info->i = SOUND_SN76496; break; | |
| 396 | 396 | |
| 397 | 397 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 398 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sn76496 ); break; | |
| 399 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76496 ); break; | |
| 400 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 401 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 398 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sn76496 ); break; | |
| 399 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76496 ); break; | |
| 400 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 401 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 402 | 402 | |
| 403 | 403 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 404 | case SNDINFO_STR_NAME: info->s = "SN76496"; break; | |
| 405 | case SNDINFO_STR_CORE_FAMILY: info->s = "TI PSG"; break; | |
| 406 | case SNDINFO_STR_CORE_VERSION: info->s = "1.1"; break; | |
| 407 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 408 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 404 | case SNDINFO_STR_NAME: strcpy(info->s, "SN76496"); break; | |
| 405 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "TI PSG"); break; | |
| 406 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; | |
| 407 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 408 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | |
| r3957 | r3958 | |
| 413 | 413 | { |
| 414 | 414 | switch (state) |
| 415 | 415 | { |
| 416 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76489 ); break; | |
| 417 | case SNDINFO_STR_NAME: info->s = "SN76489"; break; | |
| 418 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 416 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76489 ); break; | |
| 417 | case SNDINFO_STR_NAME: strcpy(info->s, "SN76489"); break; | |
| 418 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | 421 | |
| r3957 | r3958 | |
| 423 | 423 | { |
| 424 | 424 | switch (state) |
| 425 | 425 | { |
| 426 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76489a ); break; | |
| 427 | case SNDINFO_STR_NAME: info->s = "SN76489A"; break; | |
| 428 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 426 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76489a ); break; | |
| 427 | case SNDINFO_STR_NAME: strcpy(info->s, "SN76489A"); break; | |
| 428 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | |
| r3957 | r3958 | |
| 433 | 433 | { |
| 434 | 434 | switch (state) |
| 435 | 435 | { |
| 436 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76494 ); break; | |
| 437 | case SNDINFO_STR_NAME: info->s = "SN76494"; break; | |
| 438 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 436 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76494 ); break; | |
| 437 | case SNDINFO_STR_NAME: strcpy(info->s, "SN76494"); break; | |
| 438 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | |
| r3957 | r3958 | |
| 443 | 443 | { |
| 444 | 444 | switch (state) |
| 445 | 445 | { |
| 446 | case SNDINFO_PTR_START: info->start = SND_START_NAME( gamegear ); break; | |
| 447 | case SNDINFO_STR_NAME: info->s = "Game Gear PSG"; break; | |
| 448 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 446 | case SNDINFO_PTR_START: info->start = SND_START_NAME( gamegear ); break; | |
| 447 | case SNDINFO_STR_NAME: strcpy(info->s, "Game Gear PSG"); break; | |
| 448 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
| r3957 | r3958 | |
| 453 | 453 | { |
| 454 | 454 | switch (state) |
| 455 | 455 | { |
| 456 | case SNDINFO_PTR_START: info->start = SND_START_NAME( smsiii ); break; | |
| 457 | case SNDINFO_STR_NAME: info->s = "SMSIII PSG"; break; | |
| 458 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 456 | case SNDINFO_PTR_START: info->start = SND_START_NAME( smsiii ); break; | |
| 457 | case SNDINFO_STR_NAME: strcpy(info->s, "SMSIII PSG"); break; | |
| 458 | default: SND_GET_INFO_CALL(sn76496); break; | |
| 459 | 459 | } |
| 460 | 460 | } |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | static | |
| 25 | static STREAM_UPDATE( wave_sound_update | |
| 26 | 26 | { |
| 27 | 27 | #ifdef MESS |
| 28 | 28 | const device_config *image = param; |
| r3957 | r3958 | |
| 30 | 30 | cassette_state state; |
| 31 | 31 | double time_index; |
| 32 | 32 | double duration; |
| 33 | stream_sample_t *buffer = | |
| 33 | stream_sample_t *buffer = o | |
| 34 | 34 | int i; |
| 35 | 35 | |
| 36 | 36 | state = cassette_get_state(image); |
| r3957 | r3958 | |
| 40 | 40 | { |
| 41 | 41 | cassette = cassette_get_image(image); |
| 42 | 42 | time_index = cassette_get_position(image); |
| 43 | duration = ((double) le | |
| 43 | duration = ((double) samples | |
| 44 | 44 | |
| 45 | cassette_get_samples(cassette, 0, time_index, duration, le | |
| 45 | cassette_get_samples(cassette, 0, time_index, duration, samples | |
| 46 | 46 | |
| 47 | for (i = le | |
| 47 | for (i = samples | |
| 48 | 48 | buffer[i] = ((INT16 *) buffer)[i]; |
| 49 | 49 | } |
| 50 | 50 | else |
| 51 | 51 | { |
| 52 | memset(buffer, 0, sizeof(*buffer) * le | |
| 52 | memset(buffer, 0, sizeof(*buffer) * samples | |
| 53 | 53 | } |
| 54 | 54 | #endif |
| 55 | 55 | } |
| r3957 | r3958 | |
| 89 | 89 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 90 | 90 | |
| 91 | 91 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 92 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( wave ); break; | |
| 93 | case SNDINFO_PTR_START: info->start = SND_START_NAME( wave ); break; | |
| 94 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 95 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 92 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( wave ); break; | |
| 93 | case SNDINFO_PTR_START: info->start = SND_START_NAME( wave ); break; | |
| 94 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 95 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 96 | 96 | |
| 97 | 97 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 98 | case SNDINFO_STR_NAME: info->s = "Cassette"; break; | |
| 99 | case SNDINFO_STR_CORE_FAMILY: info->s = "Cassette"; break; | |
| 100 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 101 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 102 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright The MESS Team"; break; | |
| 98 | case SNDINFO_STR_NAME: strcpy(info->s, "Cassette"); break; | |
| 99 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Cassette"); break; | |
| 100 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 101 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 102 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright The MESS Team"); break; | |
| 103 | 103 | } |
| 104 | 104 | } |
| r3957 | r3958 | |
|---|---|---|
| 76 | 76 | * |
| 77 | 77 | *************************************/ |
| 78 | 78 | |
| 79 | static | |
| 79 | static STREAM_UPDATE( astrocade_update | |
| 80 | 80 | { |
| 81 | 81 | struct astrocade_info *chip = param; |
| 82 | stream_sample_t *dest = | |
| 82 | stream_sample_t *dest = outputs[0]; | |
| 83 | 83 | UINT16 noise_state; |
| 84 | 84 | UINT8 master_count; |
| 85 | 85 | UINT8 noise_clock; |
| r3957 | r3958 | |
| 342 | 342 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 343 | 343 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( astrocade ); break; |
| 344 | 344 | case SNDINFO_PTR_START: info->start = SND_START_NAME( astrocade ); break; |
| 345 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 345 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 346 | 346 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( astrocade ); break; |
| 347 | 347 | |
| 348 | 348 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 349 | case SNDINFO_STR_NAME: info->s = "Astrocade"; break; | |
| 350 | case SNDINFO_STR_CORE_FAMILY: info->s = "Bally"; break; | |
| 351 | case SNDINFO_STR_CORE_VERSION: info->s = "2.0"; break; | |
| 352 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 353 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 349 | case SNDINFO_STR_NAME: strcpy(info->s, "Astrocade"); break; | |
| 350 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Bally"); break; | |
| 351 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "2.0"); break; | |
| 352 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 353 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 354 | 354 | } |
| 355 | 355 | } |
| r3957 | r3958 | |
|---|---|---|
| 102 | 102 | /*-------------------------------------------------------------- |
| 103 | 103 | generate sound to the mix buffer |
| 104 | 104 | --------------------------------------------------------------*/ |
| 105 | static | |
| 105 | static STREAM_UPDATE( seta_update | |
| 106 | 106 | { |
| 107 | 107 | struct x1_010_info *info = param; |
| 108 | 108 | X1_010_CHANNEL *reg; |
| r3957 | r3958 | |
| 113 | 113 | const UINT8 *snd1 = info->region; |
| 114 | 114 | |
| 115 | 115 | // mixer buffer zero clear |
| 116 | memset( buffer[0], 0, length*sizeof(*buffer[0]) ); | |
| 117 | memset( buffer[1], 0, length*sizeof(*buffer[1]) ); | |
| 116 | memset( outputs[0], 0, samples*sizeof(*outputs[0]) ); | |
| 117 | memset( outputs[1], 0, samples*sizeof(*outputs[1]) ); | |
| 118 | 118 | |
| 119 | 119 | // if( info->sound_enable == 0 ) return; |
| 120 | 120 | |
| 121 | 121 | for( ch = 0; ch < SETA_NUM_CHANNELS; ch++ ) { |
| 122 | 122 | reg = (X1_010_CHANNEL *)&(info->reg[ch*sizeof(X1_010_CHANNEL)]); |
| 123 | 123 | if( (reg->status&1) != 0 ) { // Key On |
| 124 | stream_sample_t *bufL = buffer[0]; | |
| 125 | stream_sample_t *bufR = buffer[1]; | |
| 124 | stream_sample_t *bufL = outputs[0]; | |
| 125 | stream_sample_t *bufR = outputs[1]; | |
| 126 | 126 | if( (reg->status&2) == 0 ) { // PCM sampling |
| 127 | 127 | start = (INT8 *)(reg->start *0x1000+snd1); |
| 128 | 128 | end = (INT8 *)((0x100-reg->end)*0x1000+snd1); |
| r3957 | r3958 | |
| 138 | 138 | LOG_SOUND(( "Play sample %p - %p, channel %X volume %d:%d freq %X step %X offset %X\n", |
| 139 | 139 | start, end, ch, volL, volR, freq, smp_step, smp_offs )); |
| 140 | 140 | } |
| 141 | for( i = 0; i < le | |
| 141 | for( i = 0; i < samples | |
| 142 | 142 | delta = smp_offs>>FREQ_BASE_BITS; |
| 143 | 143 | // sample ended? |
| 144 | 144 | if( start+delta >= end ) { |
| r3957 | r3958 | |
| 165 | 165 | LOG_SOUND(( "Play waveform %X, channel %X volume %X freq %4X step %X offset %X\n", |
| 166 | 166 | reg->volume, ch, reg->end, freq, smp_step, smp_offs )); |
| 167 | 167 | } |
| 168 | for( i = 0; i < le | |
| 168 | for( i = 0; i < samples | |
| 169 | 169 | int vol; |
| 170 | 170 | delta = env_offs>>ENV_BASE_BITS; |
| 171 | 171 | // Envelope one shot mode |
| r3957 | r3958 | |
| 304 | 304 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 305 | 305 | |
| 306 | 306 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 307 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( x1_010 ); break; | |
| 308 | case SNDINFO_PTR_START: info->start = SND_START_NAME( x1_010 ); break; | |
| 309 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 310 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 307 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( x1_010 ); break; | |
| 308 | case SNDINFO_PTR_START: info->start = SND_START_NAME( x1_010 ); break; | |
| 309 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 310 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 311 | 311 | |
| 312 | 312 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 313 | case SNDINFO_STR_NAME: info->s = "X1-010"; break; | |
| 314 | case SNDINFO_STR_CORE_FAMILY: info->s = "Seta custom"; break; | |
| 315 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 316 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 317 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 313 | case SNDINFO_STR_NAME: strcpy(info->s, "X1-010"); break; | |
| 314 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Seta custom"); break; | |
| 315 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 316 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 317 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 |
| r3957 | r3958 | |
|---|---|---|
| 148 | 148 | |
| 149 | 149 | struct upd7759_chip |
| 150 | 150 | { |
| 151 | const device_config *device; | |
| 151 | 152 | sound_stream *channel; /* stream channel for playback */ |
| 152 | 153 | |
| 153 | 154 | /* internal clock to output sample rate mapping */ |
| r3957 | r3958 | |
| 161 | 162 | UINT8 reset; /* current state of the RESET line */ |
| 162 | 163 | UINT8 start; /* current state of the START line */ |
| 163 | 164 | UINT8 drq; /* current state of the DRQ line */ |
| 164 | void (*drqcallback)(int param); /* drq callback */ | |
| 165 | void (*drqcallback)(const device_config *device, int param); /* drq callback */ | |
| 165 | 166 | |
| 166 | 167 | /* internal state machine */ |
| 167 | 168 | INT8 state; /* current overall chip state */ |
| r3957 | r3958 | |
| 459 | 460 | |
| 460 | 461 | *************************************************************/ |
| 461 | 462 | |
| 462 | static | |
| 463 | static STREAM_UPDATE( upd7759_update | |
| 463 | 464 | { |
| 464 | 465 | struct upd7759_chip *chip = param; |
| 465 | 466 | INT32 clocks_left = chip->clocks_left; |
| 466 | 467 | INT16 sample = chip->sample; |
| 467 | 468 | UINT32 step = chip->step; |
| 468 | 469 | UINT32 pos = chip->pos; |
| 469 | stream_sample_t *buffer = | |
| 470 | stream_sample_t *buffer = o | |
| 470 | 471 | |
| 471 | 472 | /* loop until done */ |
| 472 | 473 | if (chip->state != STATE_IDLE) |
| r3957 | r3958 | |
| 536 | 537 | /* if the DRQ changed, update it */ |
| 537 | 538 | logerror("slave_update: DRQ %d->%d\n", olddrq, chip->drq); |
| 538 | 539 | if (olddrq != chip->drq && chip->drqcallback) |
| 539 | (*chip->drqcallback)(chip->drq); | |
| 540 | (*chip->drqcallback)(chip->device, chip->drq); | |
| 540 | 541 | |
| 541 | 542 | /* set a timer to go off when that is done */ |
| 542 | 543 | if (chip->state != STATE_IDLE) |
| r3957 | r3958 | |
| 634 | 635 | chip = auto_malloc(sizeof(*chip)); |
| 635 | 636 | memset(chip, 0, sizeof(*chip)); |
| 636 | 637 | |
| 638 | chip->device = device; | |
| 639 | ||
| 637 | 640 | /* allocate a stream channel */ |
| 638 | 641 | chip->channel = stream_create(device, 0, 1, clock/4, chip, upd7759_update); |
| 639 | 642 | |
| r3957 | r3958 | |
| 791 | 794 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 792 | 795 | |
| 793 | 796 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 794 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( upd7759 ); break; | |
| 795 | case SNDINFO_PTR_START: info->start = SND_START_NAME( upd7759 ); break; | |
| 796 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 797 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( upd7759 ); break; | |
| 797 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( upd7759 ); break; | |
| 798 | case SNDINFO_PTR_START: info->start = SND_START_NAME( upd7759 ); break; | |
| 799 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 800 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( upd7759 ); break; | |
| 798 | 801 | |
| 799 | 802 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 800 | case SNDINFO_STR_NAME: info->s = "UPD7759"; break; | |
| 801 | case SNDINFO_STR_CORE_FAMILY: info->s = "NEC ADPCM"; break; | |
| 802 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 803 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 804 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 803 | case SNDINFO_STR_NAME: strcpy(info->s, "UPD7759"); break; | |
| 804 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "NEC ADPCM"); break; | |
| 805 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 806 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 807 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 805 | 808 | } |
| 806 | 809 | } |
| 807 | 810 |
| r3957 | r3958 | |
|---|---|---|
| 675 | 675 | return slot_output; |
| 676 | 676 | } |
| 677 | 677 | |
| 678 | static | |
| 678 | static STREAM_UPDATE( ymf271_update | |
| 679 | 679 | { |
| 680 | 680 | int i, j; |
| 681 | 681 | int op; |
| 682 | 682 | INT32 *mixp; |
| 683 | 683 | YMF271Chip *chip = param; |
| 684 | 684 | |
| 685 | memset(mix, 0, sizeof(mix[0])*le | |
| 685 | memset(mix, 0, sizeof(mix[0])*samples | |
| 686 | 686 | |
| 687 | 687 | for (j = 0; j < 12; j++) |
| 688 | 688 | { |
| r3957 | r3958 | |
| 707 | 707 | |
| 708 | 708 | if (chip->slots[slot1].active) |
| 709 | 709 | { |
| 710 | for (i = 0; i < le | |
| 710 | for (i = 0; i < samples | |
| 711 | 711 | { |
| 712 | 712 | INT64 output1 = 0, output2 = 0, output3 = 0, output4 = 0, phase_mod1 = 0, phase_mod2 = 0; |
| 713 | 713 | switch (chip->slots[slot1].algorithm) |
| r3957 | r3958 | |
| 893 | 893 | mixp = &mix[0]; |
| 894 | 894 | if (chip->slots[slot1].active) |
| 895 | 895 | { |
| 896 | for (i = 0; i < le | |
| 896 | for (i = 0; i < samples | |
| 897 | 897 | { |
| 898 | 898 | INT64 output1 = 0, output2 = 0, phase_mod = 0; |
| 899 | 899 | switch (chip->slots[slot1].algorithm & 3) |
| r3957 | r3958 | |
| 946 | 946 | |
| 947 | 947 | if (chip->slots[slot1].active) |
| 948 | 948 | { |
| 949 | for (i = 0; i < le | |
| 949 | for (i = 0; i < samples | |
| 950 | 950 | { |
| 951 | 951 | INT64 output1 = 0, output2 = 0, output3 = 0, phase_mod = 0; |
| 952 | 952 | switch (chip->slots[slot1].algorithm & 7) |
| r3957 | r3958 | |
| 1028 | 1028 | } |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | update_pcm(chip, j + (3*12), mixp, le | |
| 1031 | update_pcm(chip, j + (3*12), mixp, samples | |
| 1032 | 1032 | break; |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | case 3: // PCM |
| 1036 | 1036 | { |
| 1037 | update_pcm(chip, j + (0*12), mixp, length); | |
| 1038 | update_pcm(chip, j + (1*12), mixp, length); | |
| 1039 | update_pcm(chip, j + (2*12), mixp, length); | |
| 1040 | update_pcm(chip, j + (3*12), mixp, length); | |
| 1037 | update_pcm(chip, j + (0*12), mixp, samples); | |
| 1038 | update_pcm(chip, j + (1*12), mixp, samples); | |
| 1039 | update_pcm(chip, j + (2*12), mixp, samples); | |
| 1040 | update_pcm(chip, j + (3*12), mixp, samples); | |
| 1041 | 1041 | break; |
| 1042 | 1042 | } |
| 1043 | 1043 | |
| r3957 | r3958 | |
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | mixp = &mix[0]; |
| 1049 | for (i = 0; i < le | |
| 1049 | for (i = 0; i < samples | |
| 1050 | 1050 | { |
| 1051 | 1051 | outputs[0][i] = (*mixp++)>>2; |
| 1052 | 1052 | outputs[1][i] = (*mixp++)>>2; |
| r3957 | r3958 | |
| 1829 | 1829 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1830 | 1830 | |
| 1831 | 1831 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1832 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymf271 ); break; | |
| 1833 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ymf271 ); break; | |
| 1834 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1835 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ymf271 ); break; | |
| 1832 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymf271 ); break; | |
| 1833 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ymf271 ); break; | |
| 1834 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1835 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ymf271 ); break; | |
| 1836 | 1836 | |
| 1837 | 1837 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1838 | case SNDINFO_STR_NAME: info->s = "YMF271"; break; | |
| 1839 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 1840 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 1841 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 1842 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1838 | case SNDINFO_STR_NAME: strcpy(info->s, "YMF271"); break; | |
| 1839 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 1840 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 1841 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1842 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1843 | 1843 | } |
| 1844 | 1844 | } |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | static const int vol_table[4] = { 26, 84, 200, 258 }; |
| 46 | 46 | |
| 47 | 47 | |
| 48 | static | |
| 48 | static STREAM_UPDATE( namco_63701x_update | |
| 49 | 49 | { |
| 50 | 50 | struct namco_63701x *chip = param; |
| 51 | 51 | int ch; |
| 52 | 52 | |
| 53 | 53 | for (ch = 0;ch < 2;ch++) |
| 54 | 54 | { |
| 55 | stream_sample_t *buf = | |
| 55 | stream_sample_t *buf = outputs[ch]; | |
| 56 | 56 | voice *v = &chip->voices[ch]; |
| 57 | 57 | |
| 58 | 58 | if (v->playing) |
| r3957 | r3958 | |
| 62 | 62 | int vol = vol_table[v->volume]; |
| 63 | 63 | int p; |
| 64 | 64 | |
| 65 | for (p = 0;p < le | |
| 65 | for (p = 0;p < samples | |
| 66 | 66 | { |
| 67 | 67 | if (v->silence_counter) |
| 68 | 68 | { |
| r3957 | r3958 | |
| 94 | 94 | v->position = pos; |
| 95 | 95 | } |
| 96 | 96 | else |
| 97 | memset(buf, 0, le | |
| 97 | memset(buf, 0, samples | |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| r3957 | r3958 | |
| 177 | 177 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 178 | 178 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_63701x ); break; |
| 179 | 179 | case SNDINFO_PTR_START: info->start = SND_START_NAME( namco_63701x ); break; |
| 180 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 181 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 180 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 181 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 182 | 182 | |
| 183 | 183 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 184 | case SNDINFO_STR_NAME: info->s = "Namco 63701X"; break; | |
| 185 | case SNDINFO_STR_CORE_FAMILY: info->s = "Namco custom"; break; | |
| 186 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 187 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 188 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 184 | case SNDINFO_STR_NAME: strcpy(info->s, "Namco 63701X"); break; | |
| 185 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Namco custom"); break; | |
| 186 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 187 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 188 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 |
| r3957 | r3958 | |
|---|---|---|
| 336 | 336 | chip->samplepos_whole++; \ |
| 337 | 337 | /* store sum of output signals into the buffer */ \ |
| 338 | 338 | *buffer++ = (sum > 0x7fff) ? 0x7fff : sum; \ |
| 339 | le | |
| 339 | samples | |
| 340 | 340 | |
| 341 | 341 | #if HEAVY_MACRO_USAGE |
| 342 | 342 | |
| r3957 | r3958 | |
| 357 | 357 | sum += chip->volume[CHAN3]; \ |
| 358 | 358 | if( chip->output[CHAN4] ) \ |
| 359 | 359 | sum += chip->volume[CHAN4]; \ |
| 360 | while( le | |
| 360 | while( samples | |
| 361 | 361 | { \ |
| 362 | 362 | if( chip->counter[CHAN1] < chip->samplepos_whole ) \ |
| 363 | 363 | { \ |
| r3957 | r3958 | |
| 486 | 486 | sum += chip->volume[CHAN3]; \ |
| 487 | 487 | if( chip->output[CHAN4] ) \ |
| 488 | 488 | sum += chip->volume[CHAN4]; \ |
| 489 | while( le | |
| 489 | while( samples | |
| 490 | 490 | { \ |
| 491 | 491 | UINT32 event = chip->samplepos_whole; \ |
| 492 | 492 | UINT32 channel = SAMPLE; \ |
| r3957 | r3958 | |
| 524 | 524 | #endif |
| 525 | 525 | |
| 526 | 526 | |
| 527 | static | |
| 527 | static STREAM_UPDATE( pokey_update | |
| 528 | 528 | { |
| 529 | 529 | struct POKEYregisters *chip = param; |
| 530 | stream_sample_t *buffer = | |
| 530 | stream_sample_t *buffer = o | |
| 531 | 531 | PROCESS_POKEY(chip); |
| 532 | 532 | } |
| 533 | 533 | |
| r3957 | r3958 | |
| 1529 | 1529 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1530 | 1530 | |
| 1531 | 1531 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1532 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( pokey ); break; | |
| 1533 | case SNDINFO_PTR_START: info->start = SND_START_NAME( pokey ); break; | |
| 1534 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1535 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1532 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( pokey ); break; | |
| 1533 | case SNDINFO_PTR_START: info->start = SND_START_NAME( pokey ); break; | |
| 1534 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1535 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1536 | 1536 | |
| 1537 | 1537 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1538 | case SNDINFO_STR_NAME: info->s = "POKEY"; break; | |
| 1539 | case SNDINFO_STR_CORE_FAMILY: info->s = "Atari custom"; break; | |
| 1540 | case SNDINFO_STR_CORE_VERSION: info->s = "4.51"; break; | |
| 1541 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 1542 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1538 | case SNDINFO_STR_NAME: strcpy(info->s, "POKEY"); break; | |
| 1539 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Atari custom"); break; | |
| 1540 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "4.51"); break; | |
| 1541 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1542 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1543 | 1543 | } |
| 1544 | 1544 | } |
| 1545 | 1545 |
| r3957 | r3958 | |
|---|---|---|
| 123 | 123 | stream_update(sp->stream); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | static | |
| 126 | static STREAM_UPDATE( sp0250_update | |
| 127 | 127 | { |
| 128 | 128 | struct sp0250 *sp = param; |
| 129 | stream_sample_t *output = | |
| 129 | stream_sample_t *output = outputs[0]; | |
| 130 | 130 | int i; |
| 131 | for (i = 0; i < le | |
| 131 | for (i = 0; i < samples | |
| 132 | 132 | { |
| 133 | 133 | if (sp->playing) |
| 134 | 134 | { |
| r3957 | r3958 | |
| 241 | 241 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 242 | 242 | |
| 243 | 243 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 244 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sp0250 ); break; | |
| 245 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sp0250 ); break; | |
| 246 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 247 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 244 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sp0250 ); break; | |
| 245 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sp0250 ); break; | |
| 246 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 247 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 248 | 248 | |
| 249 | 249 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 250 | case SNDINFO_STR_NAME: info->s = "SP0250"; break; | |
| 251 | case SNDINFO_STR_CORE_FAMILY: info->s = "GI speech"; break; | |
| 252 | case SNDINFO_STR_CORE_VERSION: info->s = "1.1"; break; | |
| 253 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 254 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 250 | case SNDINFO_STR_NAME: strcpy(info->s, "SP0250"); break; | |
| 251 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "GI speech"); break; | |
| 252 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; | |
| 253 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 254 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | typedef struct _upd7759_interface upd7759_interface; |
| 14 | 14 | struct _upd7759_interface |
| 15 | 15 | { |
| 16 | void (*drqcallback)(int param); /* drq callback (per chip, slave mode only) */ | |
| 16 | void (*drqcallback)(const device_config *device, int param); /* drq callback (per chip, slave mode only) */ | |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | void upd7759_set_bank_base(int which, offs_t base); |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | static | |
| 26 | static STREAM_UPDATE( speaker_sound_update | |
| 27 | 27 | { |
| 28 | 28 | struct speaker *sp = (struct speaker *) param; |
| 29 | stream_sample_t *buffer = | |
| 29 | stream_sample_t *buffer = o | |
| 30 | 30 | int volume = sp->levels[sp->level]; |
| 31 | 31 | |
| 32 | while( le | |
| 32 | while( samples | |
| 33 | 33 | *buffer++ = volume; |
| 34 | 34 | } |
| 35 | 35 | |
| r3957 | r3958 | |
| 89 | 89 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 90 | 90 | |
| 91 | 91 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 92 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( speaker ); break; | |
| 93 | case SNDINFO_PTR_START: info->start = SND_START_NAME( speaker ); break; | |
| 94 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 95 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 92 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( speaker ); break; | |
| 93 | case SNDINFO_PTR_START: info->start = SND_START_NAME( speaker ); break; | |
| 94 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 95 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 96 | 96 | |
| 97 | 97 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 98 | case SNDINFO_STR_NAME: info->s = "Speaker"; break; | |
| 99 | case SNDINFO_STR_CORE_FAMILY: info->s = "Speaker"; break; | |
| 100 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 101 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 102 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright The MESS Team"; break; | |
| 98 | case SNDINFO_STR_NAME: strcpy(info->s, "Speaker"); break; | |
| 99 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Speaker"); break; | |
| 100 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 101 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 102 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright The MESS Team"); break; | |
| 103 | 103 | } |
| 104 | 104 | } |
| r3957 | r3958 | |
|---|---|---|
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | static | |
| 476 | static STREAM_UPDATE( ay8910_update | |
| 477 | 477 | { |
| 478 | 478 | ay8910_context *psg = param; |
| 479 | 479 | stream_sample_t *buf[NUM_CHANNELS]; |
| 480 | 480 | int chan; |
| 481 | 481 | |
| 482 | buf[0] = | |
| 482 | buf[0] = outputs[0]; | |
| 483 | 483 | buf[1] = NULL; |
| 484 | 484 | buf[2] = NULL; |
| 485 | 485 | if (psg->streams == NUM_CHANNELS) |
| 486 | 486 | { |
| 487 | buf[1] = buffer[1]; | |
| 488 | buf[2] = buffer[2]; | |
| 487 | buf[1] = outputs[1]; | |
| 488 | buf[2] = outputs[2]; | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | /* hack to prevent us from hanging when starting filtered outputs */ |
| r3957 | r3958 | |
| 493 | 493 | { |
| 494 | 494 | for (chan = 0; chan < NUM_CHANNELS; chan++) |
| 495 | 495 | if (buf[chan] != NULL) |
| 496 | memset(buf[chan], 0, le | |
| 496 | memset(buf[chan], 0, samples | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | /* The 8910 has three outputs, each output is the mix of one of the three */ |
| r3957 | r3958 | |
| 504 | 504 | /* is 1, not 0, and can be modulated changing the volume. */ |
| 505 | 505 | |
| 506 | 506 | /* buffering loop */ |
| 507 | while (le | |
| 507 | while (samples | |
| 508 | 508 | { |
| 509 | 509 | for (chan = 0; chan < NUM_CHANNELS; chan++) |
| 510 | 510 | { |
| r3957 | r3958 | |
| 601 | 601 | + vol_enabled[2] * psg->vol_table[psg->Vol[2]]) / psg->step; |
| 602 | 602 | #endif |
| 603 | 603 | } |
| 604 | le | |
| 604 | samples | |
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | |
| r3957 | r3958 | |
| 867 | 867 | switch (state) |
| 868 | 868 | { |
| 869 | 869 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 870 | case SNDINFO_INT_ALIAS: info->i = SOUND_AY8910; break; | |
| 870 | case SNDINFO_INT_ALIAS: info->i = SOUND_AY8910; break; | |
| 871 | 871 | |
| 872 | 872 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 873 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ay8910 ); break; | |
| 874 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 875 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( ay8910 ); break; | |
| 873 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ay8910 ); break; | |
| 874 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 875 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( ay8910 ); break; | |
| 876 | 876 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ay8910 ); break; |
| 877 | 877 | |
| 878 | 878 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 879 | case SNDINFO_STR_NAME: info->s = "AY-3-8910A"; break; | |
| 880 | case SNDINFO_STR_CORE_FAMILY: info->s = "PSG"; break; | |
| 881 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 882 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 883 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 879 | case SNDINFO_STR_NAME: strcpy(info->s, "AY-3-8910A"); break; | |
| 880 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "PSG"); break; | |
| 881 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 882 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 883 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 884 | 884 | } |
| 885 | 885 | } |
| 886 | 886 | |
| r3957 | r3958 | |
| 888 | 888 | { |
| 889 | 889 | switch (state) |
| 890 | 890 | { |
| 891 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 892 | case SNDINFO_STR_NAME: info->s = "AY-3-8912A"; break; | |
| 893 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 891 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 892 | case SNDINFO_STR_NAME: strcpy(info->s, "AY-3-8912A"); break; | |
| 893 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 894 | 894 | } |
| 895 | 895 | } |
| 896 | 896 | |
| r3957 | r3958 | |
| 898 | 898 | { |
| 899 | 899 | switch (state) |
| 900 | 900 | { |
| 901 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 902 | case SNDINFO_STR_NAME: info->s = "AY-3-8913A"; break; | |
| 903 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 901 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 902 | case SNDINFO_STR_NAME: strcpy(info->s, "AY-3-8913A"); break; | |
| 903 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 904 | 904 | } |
| 905 | 905 | } |
| 906 | 906 | |
| r3957 | r3958 | |
| 908 | 908 | { |
| 909 | 909 | switch (state) |
| 910 | 910 | { |
| 911 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 912 | case SNDINFO_STR_NAME: info->s = "AY8930"; break; | |
| 913 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 911 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ay8910 ); break; | |
| 912 | case SNDINFO_STR_NAME: strcpy(info->s, "AY8930"); break; | |
| 913 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 914 | 914 | } |
| 915 | 915 | } |
| 916 | 916 | |
| r3957 | r3958 | |
| 918 | 918 | { |
| 919 | 919 | switch (state) |
| 920 | 920 | { |
| 921 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 922 | case SNDINFO_STR_NAME: info->s = "YM2149"; break; | |
| 923 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 921 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 922 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2149"); break; | |
| 923 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 924 | 924 | } |
| 925 | 925 | } |
| 926 | 926 | |
| r3957 | r3958 | |
| 928 | 928 | { |
| 929 | 929 | switch (state) |
| 930 | 930 | { |
| 931 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 932 | case SNDINFO_STR_NAME: info->s = "YM3439"; break; | |
| 933 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 931 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 932 | case SNDINFO_STR_NAME: strcpy(info->s, "YM3439"); break; | |
| 933 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 934 | 934 | } |
| 935 | 935 | } |
| 936 | 936 | |
| r3957 | r3958 | |
| 938 | 938 | { |
| 939 | 939 | switch (state) |
| 940 | 940 | { |
| 941 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 942 | case SNDINFO_STR_NAME: info->s = "YMZ284"; break; | |
| 943 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 941 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 942 | case SNDINFO_STR_NAME: strcpy(info->s, "YMZ284"); break; | |
| 943 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 944 | 944 | } |
| 945 | 945 | } |
| 946 | 946 | |
| r3957 | r3958 | |
| 948 | 948 | { |
| 949 | 949 | switch (state) |
| 950 | 950 | { |
| 951 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 952 | case SNDINFO_STR_NAME: info->s = "YMZ294"; break; | |
| 953 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 951 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ym2149 ); break; | |
| 952 | case SNDINFO_STR_NAME: strcpy(info->s, "YMZ294"); break; | |
| 953 | default: SND_GET_INFO_CALL(ay8910); break; | |
| 954 | 954 | } |
| 955 | 955 | } |
| 956 | 956 |
| r3957 | r3958 | |
|---|---|---|
| 32 | 32 | cdda_update - stream update callback |
| 33 | 33 | -------------------------------------------------*/ |
| 34 | 34 | |
| 35 | static | |
| 35 | static STREAM_UPDATE( cdda_update | |
| 36 | 36 | { |
| 37 | 37 | cdda_info *info = param; |
| 38 | get_audio_data(info, &outputs[0][0], &outputs[1][0], le | |
| 38 | get_audio_data(info, &outputs[0][0], &outputs[1][0], samples | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r3957 | r3958 | |
| 316 | 316 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 317 | 317 | |
| 318 | 318 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 319 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cdda ); break; | |
| 320 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cdda ); break; | |
| 321 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 322 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 319 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cdda ); break; | |
| 320 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cdda ); break; | |
| 321 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 322 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 323 | 323 | |
| 324 | 324 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 325 | case SNDINFO_STR_NAME: info->s = "CD/DA"; break; | |
| 326 | case SNDINFO_STR_CORE_FAMILY: info->s = "CD Audio"; break; | |
| 327 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 328 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 329 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 325 | case SNDINFO_STR_NAME: strcpy(info->s, "CD/DA"); break; | |
| 326 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "CD Audio"); break; | |
| 327 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 328 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 329 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 |
| r3957 | r3958 | |
|---|---|---|
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | |
| 344 | static | |
| 344 | static STREAM_UPDATE( tms36xx_sound_update | |
| 345 | 345 | { |
| 346 | 346 | struct TMS36XX *tms = param; |
| 347 | 347 | int samplerate = tms->samplerate; |
| 348 | stream_sample_t *buffer = | |
| 348 | stream_sample_t *buffer = o | |
| 349 | 349 | |
| 350 | 350 | /* no tune played? */ |
| 351 | 351 | if( !tunes[tms->tune_num] || tms->voices == 0 ) |
| 352 | 352 | { |
| 353 | while (--length >= 0) | |
| 354 | buffer[length] = 0; | |
| 353 | while (--samples >= 0) | |
| 354 | buffer[samples] = 0; | |
| 355 | 355 | return; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | while( le | |
| 358 | while( samples | |
| 359 | 359 | { |
| 360 | 360 | int sum = 0; |
| 361 | 361 | |
| r3957 | r3958 | |
| 544 | 544 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 545 | 545 | |
| 546 | 546 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 547 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms36xx ); break; | |
| 548 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms36xx ); break; | |
| 549 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 550 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 547 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms36xx ); break; | |
| 548 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms36xx ); break; | |
| 549 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 550 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 551 | 551 | |
| 552 | 552 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 553 | case SNDINFO_STR_NAME: info->s = "TMS36XX"; break; | |
| 554 | case SNDINFO_STR_CORE_FAMILY: info->s = "TI PSG"; break; | |
| 555 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 556 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 557 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 553 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS36XX"); break; | |
| 554 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "TI PSG"); break; | |
| 555 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 556 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 557 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 560 |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | static | |
| 51 | static STREAM_UPDATE( st0016_update | |
| 52 | 52 | { |
| 53 | 53 | struct st0016_info *info = param; |
| 54 | 54 | UINT8 *sound_ram = *info->sound_ram; |
| r3957 | r3958 | |
| 59 | 59 | INT16 sample; |
| 60 | 60 | int sptr, eptr, freq, lsptr, leptr; |
| 61 | 61 | |
| 62 | memset(mix, 0, sizeof(mix[0])*le | |
| 62 | memset(mix, 0, sizeof(mix[0])*samples | |
| 63 | 63 | |
| 64 | 64 | for (v = 0; v < 8; v++) |
| 65 | 65 | { |
| r3957 | r3958 | |
| 75 | 75 | lsptr = slot[0x06]<<16 | slot[0x05]<<8 | slot[0x04]; |
| 76 | 76 | leptr = slot[0x0a]<<16 | slot[0x09]<<8 | slot[0x08]; |
| 77 | 77 | |
| 78 | for (snum = 0; snum < le | |
| 78 | for (snum = 0; snum < samples | |
| 79 | 79 | { |
| 80 | 80 | sample = sound_ram[(sptr + info->vpos[v])&0x1fffff]<<8; |
| 81 | 81 | |
| r3957 | r3958 | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | mixp = &mix[0]; |
| 120 | for (i = 0; i < le | |
| 120 | for (i = 0; i < samples | |
| 121 | 121 | { |
| 122 | 122 | outputs[0][i] = (*mixp++)>>4; |
| 123 | 123 | outputs[1][i] = (*mixp++)>>4; |
| r3957 | r3958 | |
| 161 | 161 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 162 | 162 | |
| 163 | 163 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 164 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( st0016 ); break; | |
| 165 | case SNDINFO_PTR_START: info->start = SND_START_NAME( st0016 ); break; | |
| 166 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 167 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 164 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( st0016 ); break; | |
| 165 | case SNDINFO_PTR_START: info->start = SND_START_NAME( st0016 ); break; | |
| 166 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 167 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 168 | 168 | |
| 169 | 169 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 170 | case SNDINFO_STR_NAME: info->s = "ST0016"; break; | |
| 171 | case SNDINFO_STR_CORE_FAMILY: info->s = "Seta custom"; break; | |
| 172 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 173 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 174 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 170 | case SNDINFO_STR_NAME: strcpy(info->s, "ST0016"); break; | |
| 171 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Seta custom"); break; | |
| 172 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 173 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 174 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | }; |
| 11 | 11 | |
| 12 | 12 | |
| 13 | static | |
| 13 | static STREAM_UPDATE( tia_update | |
| 14 | 14 | { |
| 15 | 15 | struct tia_info *info = param; |
| 16 | tia_process(info->chip, | |
| 16 | tia_process(info->chip, outputs[0], samples | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
| r3957 | r3958 | |
| 69 | 69 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 70 | 70 | |
| 71 | 71 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 72 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tia ); break; | |
| 73 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tia ); break; | |
| 74 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( tia ); break; | |
| 75 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 72 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tia ); break; | |
| 73 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tia ); break; | |
| 74 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( tia ); break; | |
| 75 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 76 | 76 | |
| 77 | 77 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 78 | case SNDINFO_STR_NAME: info->s = "TIA"; break; | |
| 79 | case SNDINFO_STR_CORE_FAMILY: info->s = "Atari custom"; break; | |
| 80 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 81 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 82 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 78 | case SNDINFO_STR_NAME: strcpy(info->s, "TIA"); break; | |
| 79 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Atari custom"); break; | |
| 80 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 81 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 82 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 |
| r3957 | r3958 | |
|---|---|---|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
| 211 | static | |
| 211 | static STREAM_UPDATE( c6280_update | |
| 212 | 212 | { |
| 213 | 213 | static const int scale_tab[] = { |
| 214 | 214 | 0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| r3957 | r3958 | |
| 226 | 226 | rmal = scale_tab[rmal]; |
| 227 | 227 | |
| 228 | 228 | /* Clear buffer */ |
| 229 | for(i = 0; i < le | |
| 229 | for(i = 0; i < samples | |
| 230 | 230 | { |
| 231 | buffer[0][i] = 0; | |
| 232 | buffer[1][i] = 0; | |
| 231 | outputs[0][i] = 0; | |
| 232 | outputs[1][i] = 0; | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | for(ch = 0; ch < 6; ch++) |
| r3957 | r3958 | |
| 259 | 259 | { |
| 260 | 260 | /* Noise mode */ |
| 261 | 261 | UINT32 step = p->noise_freq_tab[(p->channel[ch].noise_control & 0x1F) ^ 0x1F]; |
| 262 | for(i = 0; i < le | |
| 262 | for(i = 0; i < samples | |
| 263 | 263 | { |
| 264 | 264 | static int data = 0; |
| 265 | 265 | p->channel[ch].noise_counter += step; |
| r3957 | r3958 | |
| 268 | 268 | data = (mame_rand(p->device->machine) & 1) ? 0x1F : 0; |
| 269 | 269 | } |
| 270 | 270 | p->channel[ch].noise_counter &= 0x7FF; |
| 271 | buffer[0][i] += (INT16)(vll * (data - 16)); | |
| 272 | buffer[1][i] += (INT16)(vlr * (data - 16)); | |
| 271 | outputs[0][i] += (INT16)(vll * (data - 16)); | |
| 272 | outputs[1][i] += (INT16)(vlr * (data - 16)); | |
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | else |
| 276 | 276 | if(p->channel[ch].control & 0x40) |
| 277 | 277 | { |
| 278 | 278 | /* DDA mode */ |
| 279 | for(i = 0; i < le | |
| 279 | for(i = 0; i < samples | |
| 280 | 280 | { |
| 281 | buffer[0][i] += (INT16)(vll * (p->channel[ch].dda - 16)); | |
| 282 | buffer[1][i] += (INT16)(vlr * (p->channel[ch].dda - 16)); | |
| 281 | outputs[0][i] += (INT16)(vll * (p->channel[ch].dda - 16)); | |
| 282 | outputs[1][i] += (INT16)(vlr * (p->channel[ch].dda - 16)); | |
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | else |
| 286 | 286 | { |
| 287 | 287 | /* Waveform mode */ |
| 288 | 288 | UINT32 step = p->wave_freq_tab[p->channel[ch].frequency]; |
| 289 | for(i = 0; i < le | |
| 289 | for(i = 0; i < samples | |
| 290 | 290 | { |
| 291 | 291 | int offset; |
| 292 | 292 | INT16 data; |
| r3957 | r3958 | |
| 294 | 294 | p->channel[ch].counter += step; |
| 295 | 295 | p->channel[ch].counter &= 0x1FFFF; |
| 296 | 296 | data = p->channel[ch].waveform[offset]; |
| 297 | buffer[0][i] += (INT16)(vll * (data - 16)); | |
| 298 | buffer[1][i] += (INT16)(vlr * (data - 16)); | |
| 297 | outputs[0][i] += (INT16)(vll * (data - 16)); | |
| 298 | outputs[1][i] += (INT16)(vlr * (data - 16)); | |
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | } |
| r3957 | r3958 | |
| 350 | 350 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 351 | 351 | |
| 352 | 352 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 353 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c6280 ); break; | |
| 354 | case SNDINFO_PTR_START: info->start = SND_START_NAME( c6280 ); break; | |
| 355 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 356 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 353 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c6280 ); break; | |
| 354 | case SNDINFO_PTR_START: info->start = SND_START_NAME( c6280 ); break; | |
| 355 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 356 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 357 | 357 | |
| 358 | 358 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 359 | case SNDINFO_STR_NAME: info->s = "HuC6280"; break; | |
| 360 | case SNDINFO_STR_CORE_FAMILY: info->s = "????"; break; | |
| 361 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 362 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 363 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 359 | case SNDINFO_STR_NAME: strcpy(info->s, "HuC6280"); break; | |
| 360 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "????"); break; | |
| 361 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 362 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 363 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 |
| r3957 | r3958 | |
|---|---|---|
| 424 | 424 | * |
| 425 | 425 | *************************************/ |
| 426 | 426 | |
| 427 | static | |
| 427 | static STREAM_UPDATE( discrete_stream_update | |
| 428 | 428 | { |
| 429 | 429 | discrete_info *info = param; |
| 430 | 430 | int samplenum, nodenum, outputnum; |
| r3957 | r3958 | |
| 439 | 439 | info->input_stream_data[nodenum] = inputs[nodenum]; |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | /* Now we must do length iterations of the node list, one output for each step */ | |
| 443 | for (samplenum = 0; samplenum < length; samplenum++) | |
| 442 | /* Now we must do samples iterations of the node list, one output for each step */ | |
| 443 | for (samplenum = 0; samplenum < samples; samplenum++) | |
| 444 | 444 | { |
| 445 | 445 | /* loop over all nodes */ |
| 446 | 446 | for (nodenum = 0; nodenum < info->node_count; nodenum++) |
| r3957 | r3958 | |
| 463 | 463 | for (outputnum = 0; outputnum < info->discrete_outputs; outputnum++) |
| 464 | 464 | { |
| 465 | 465 | val = (*info->output_node[outputnum]->input[0]) * (*info->output_node[outputnum]->input[1]); |
| 466 | | |
| 466 | outputs[outputnum][samplenum] = val; | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /* Dump any csv logs */ |
| r3957 | r3958 | |
| 764 | 764 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( discrete ); break; |
| 765 | 765 | |
| 766 | 766 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 767 | case SNDINFO_STR_NAME: info->s = "Discrete"; break; | |
| 768 | case SNDINFO_STR_CORE_FAMILY: info->s = "Analog"; break; | |
| 769 | case SNDINFO_STR_CORE_VERSION: info->s = "1.1"; break; | |
| 770 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 771 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 767 | case SNDINFO_STR_NAME: strcpy(info->s, "Discrete"); break; | |
| 768 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Analog"); break; | |
| 769 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; | |
| 770 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 771 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | 774 |
| r3957 | r3958 | |
|---|---|---|
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | |
| 445 | static | |
| 445 | static STREAM_UPDATE( sample_update_sound | |
| 446 | 446 | { |
| 447 | 447 | struct sample_channel *chan = param; |
| 448 | stream_sample_t *buffer = | |
| 448 | stream_sample_t *buffer = o | |
| 449 | 449 | |
| 450 | 450 | if (chan->source && !chan->paused) |
| 451 | 451 | { |
| r3957 | r3958 | |
| 456 | 456 | const INT16 *sample = chan->source; |
| 457 | 457 | UINT32 sample_length = chan->source_length; |
| 458 | 458 | |
| 459 | while (le | |
| 459 | while (samples | |
| 460 | 460 | { |
| 461 | 461 | /* do a linear interp on the sample */ |
| 462 | 462 | INT32 sample1 = sample[pos]; |
| r3957 | r3958 | |
| 478 | 478 | { |
| 479 | 479 | chan->source = NULL; |
| 480 | 480 | chan->source_num = -1; |
| 481 | if (length > 0) | |
| 482 | memset(buffer, 0, length * sizeof(*buffer)); | |
| 481 | if (samples > 0) | |
| 482 | memset(buffer, 0, samples * sizeof(*buffer)); | |
| 483 | 483 | break; |
| 484 | 484 | } |
| 485 | 485 | } |
| r3957 | r3958 | |
| 490 | 490 | chan->frac = frac; |
| 491 | 491 | } |
| 492 | 492 | else |
| 493 | memset(buffer, 0, le | |
| 493 | memset(buffer, 0, samples | |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | |
| r3957 | r3958 | |
| 598 | 598 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 599 | 599 | |
| 600 | 600 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 601 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( samples ); break; | |
| 602 | case SNDINFO_PTR_START: info->start = SND_START_NAME( samples ); break; | |
| 603 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 604 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 601 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( samples ); break; | |
| 602 | case SNDINFO_PTR_START: info->start = SND_START_NAME( samples ); break; | |
| 603 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 604 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 605 | 605 | |
| 606 | 606 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 607 | case SNDINFO_STR_NAME: info->s = "Samples"; break; | |
| 608 | case SNDINFO_STR_CORE_FAMILY: info->s = "Big Hack"; break; | |
| 609 | case SNDINFO_STR_CORE_VERSION: info->s = "1.1"; break; | |
| 610 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 611 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 607 | case SNDINFO_STR_NAME: strcpy(info->s, "Samples"); break; | |
| 608 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Big Hack"); break; | |
| 609 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; | |
| 610 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 611 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 |
| r3957 | r3958 | |
|---|---|---|
| 703 | 703 | #endif |
| 704 | 704 | |
| 705 | 705 | |
| 706 | static | |
| 706 | static STREAM_UPDATE( MSM5232_update_one | |
| 707 | 707 | { |
| 708 | 708 | MSM5232 * chip = param; |
| 709 | stream_sample_t *buf1 = buffer[0]; | |
| 710 | stream_sample_t *buf2 = buffer[1]; | |
| 711 | stream_sample_t *buf3 = buffer[2]; | |
| 712 | stream_sample_t *buf4 = buffer[3]; | |
| 713 | stream_sample_t *buf5 = buffer[4]; | |
| 714 | stream_sample_t *buf6 = buffer[5]; | |
| 715 | stream_sample_t *buf7 = buffer[6]; | |
| 716 | stream_sample_t *buf8 = buffer[7]; | |
| 717 | stream_sample_t *bufsolo1 = buffer[8]; | |
| 718 | stream_sample_t *bufsolo2 = buffer[9]; | |
| 719 | stream_sample_t *bufnoise = buffer[10]; | |
| 709 | stream_sample_t *buf1 = outputs[0]; | |
| 710 | stream_sample_t *buf2 = outputs[1]; | |
| 711 | stream_sample_t *buf3 = outputs[2]; | |
| 712 | stream_sample_t *buf4 = outputs[3]; | |
| 713 | stream_sample_t *buf5 = outputs[4]; | |
| 714 | stream_sample_t *buf6 = outputs[5]; | |
| 715 | stream_sample_t *buf7 = outputs[6]; | |
| 716 | stream_sample_t *buf8 = outputs[7]; | |
| 717 | stream_sample_t *bufsolo1 = outputs[8]; | |
| 718 | stream_sample_t *bufsolo2 = outputs[9]; | |
| 719 | stream_sample_t *bufnoise = outputs[10]; | |
| 720 | 720 | int i; |
| 721 | 721 | |
| 722 | 722 | for (i=0; i<samples; i++) |
| r3957 | r3958 | |
| 848 | 848 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 849 | 849 | |
| 850 | 850 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 851 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( msm5232 ); break; | |
| 852 | case SNDINFO_PTR_START: info->start = SND_START_NAME( msm5232 ); break; | |
| 853 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( msm5232 ); break; | |
| 851 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( msm5232 ); break; | |
| 852 | case SNDINFO_PTR_START: info->start = SND_START_NAME( msm5232 ); break; | |
| 853 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( msm5232 ); break; | |
| 854 | 854 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( msm5232 ); break; |
| 855 | 855 | |
| 856 | 856 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 857 | case SNDINFO_STR_NAME: info->s = "MSM5232"; break; | |
| 858 | case SNDINFO_STR_CORE_FAMILY: info->s = "Oki Tone"; break; | |
| 859 | case SNDINFO_STR_CORE_VERSION: info->s = "1.1"; break; | |
| 860 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 861 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 857 | case SNDINFO_STR_NAME: strcpy(info->s, "MSM5232"); break; | |
| 858 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Oki Tone"); break; | |
| 859 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.1"); break; | |
| 860 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 861 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 862 | 862 | } |
| 863 | 863 | } |
| 864 | 864 |
| r3957 | r3958 | |
|---|---|---|
| 1212 | 1212 | } |
| 1213 | 1213 | #endif |
| 1214 | 1214 | |
| 1215 | static | |
| 1215 | static STREAM_UPDATE( SCSP_Update | |
| 1216 | 1216 | { |
| 1217 | 1217 | struct _SCSP *SCSP = param; |
| 1218 | bufferl = buf[0]; | |
| 1219 | bufferr = buf[1]; | |
| 1218 | bufferl = outputs[0]; | |
| 1219 | bufferr = outputs[1]; | |
| 1220 | 1220 | length = samples; |
| 1221 | 1221 | SCSP_DoMasterSamples(SCSP, samples); |
| 1222 | 1222 | } |
| r3957 | r3958 | |
| 1387 | 1387 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1388 | 1388 | |
| 1389 | 1389 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1390 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( scsp ); break; | |
| 1391 | case SNDINFO_PTR_START: info->start = SND_START_NAME( scsp ); break; | |
| 1392 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1393 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1390 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( scsp ); break; | |
| 1391 | case SNDINFO_PTR_START: info->start = SND_START_NAME( scsp ); break; | |
| 1392 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 1393 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 1394 | 1394 | |
| 1395 | 1395 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1396 | case SNDINFO_STR_NAME: info->s = "SCSP"; break; | |
| 1397 | case SNDINFO_STR_CORE_FAMILY: info->s = "Sega/Yamaha custom"; break; | |
| 1398 | case SNDINFO_STR_CORE_VERSION: info->s = "2.1.1"; break; | |
| 1399 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 1400 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1396 | case SNDINFO_STR_NAME: strcpy(info->s, "SCSP"); break; | |
| 1397 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Sega/Yamaha custom"); break; | |
| 1398 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "2.1.1"); break; | |
| 1399 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1400 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1401 | 1401 | } |
| 1402 | 1402 | } |
| 1403 | 1403 |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)}; |
| 15 | 15 | |
| 16 | 16 | |
| 17 | static | |
| 17 | static STREAM_UPDATE( filter_rc_update | |
| 18 | 18 | { |
| 19 | 19 | stream_sample_t *src = inputs[0]; |
| 20 | 20 | stream_sample_t *dst = outputs[0]; |
| r3957 | r3958 | |
| 134 | 134 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 135 | 135 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( filter_rc ); break; |
| 136 | 136 | case SNDINFO_PTR_START: info->start = SND_START_NAME( filter_rc ); break; |
| 137 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 138 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 137 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 138 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 139 | 139 | |
| 140 | 140 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 141 | case SNDINFO_STR_NAME: info->s = "RC Filter"; break; | |
| 142 | case SNDINFO_STR_CORE_FAMILY: info->s = "Filters"; break; | |
| 143 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 144 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 145 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 141 | case SNDINFO_STR_NAME: strcpy(info->s, "RC Filter"); break; | |
| 142 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Filters"); break; | |
| 143 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 144 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 145 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 |
| r3957 | r3958 | |
|---|---|---|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | #if BUILD_YM2610 |
| 109 | static | |
| 109 | static STREAM_UPDATE( ym2610_stream_update | |
| 110 | 110 | { |
| 111 | 111 | struct ym2610_info *info = param; |
| 112 | ym2610_update_one(info->chip, | |
| 112 | ym2610_update_one(info->chip, outputs, samples | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| r3957 | r3958 | |
| 181 | 181 | #endif |
| 182 | 182 | |
| 183 | 183 | #if BUILD_YM2610B |
| 184 | static | |
| 184 | static STREAM_UPDATE( ym2610b_stream_update | |
| 185 | 185 | { |
| 186 | 186 | struct ym2610_info *info = param; |
| 187 | ym2610b_update_one(info->chip, | |
| 187 | ym2610b_update_one(info->chip, outputs, samples | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | static SND_START( ym2610b ) |
| r3957 | r3958 | |
| 503 | 503 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2610 ); break; |
| 504 | 504 | |
| 505 | 505 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 506 | case SNDINFO_STR_NAME: info->s = "YM2610"; break; | |
| 507 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 508 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 509 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 510 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 506 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2610"); break; | |
| 507 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 508 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 509 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 510 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | #endif |
| r3957 | r3958 | |
| 540 | 540 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2610 ); break; |
| 541 | 541 | |
| 542 | 542 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 543 | case SNDINFO_STR_NAME: info->s = "YM2610B"; break; | |
| 544 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 545 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 546 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 547 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 543 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2610B"); break; | |
| 544 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 545 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 546 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 547 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | * |
| 37 | 37 | *************************************/ |
| 38 | 38 | |
| 39 | static | |
| 39 | static STREAM_UPDATE( beep_sound_update | |
| 40 | 40 | { |
| 41 | 41 | struct beep_sound *bs = (struct beep_sound *) param; |
| 42 | stream_sample_t *buffer = | |
| 42 | stream_sample_t *buffer = o | |
| 43 | 43 | INT16 signal = bs->signal; |
| 44 | 44 | int clock = 0, rate = BEEP_RATE / 2; |
| 45 | 45 | |
| r3957 | r3958 | |
| 52 | 52 | /* if we're not enabled, just fill with 0 */ |
| 53 | 53 | if ( !bs->enable || clock == 0 ) |
| 54 | 54 | { |
| 55 | memset( buffer, 0, le | |
| 55 | memset( buffer, 0, samples | |
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /* fill in the sample */ |
| 60 | while( le | |
| 60 | while( samples | |
| 61 | 61 | { |
| 62 | 62 | *buffer++ = signal; |
| 63 | 63 | incr -= clock; |
| r3957 | r3958 | |
| 182 | 182 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 183 | 183 | |
| 184 | 184 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 185 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( beep ); break; | |
| 186 | case SNDINFO_PTR_START: info->start = SND_START_NAME( beep ); break; | |
| 187 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 188 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 185 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( beep ); break; | |
| 186 | case SNDINFO_PTR_START: info->start = SND_START_NAME( beep ); break; | |
| 187 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 188 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 189 | 189 | |
| 190 | 190 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 191 | case SNDINFO_STR_NAME: info->s = "Beep"; break; | |
| 192 | case SNDINFO_STR_CORE_FAMILY: info->s = "Beep"; break; | |
| 193 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 194 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 195 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright The MESS Team"; break; | |
| 191 | case SNDINFO_STR_NAME: strcpy(info->s, "Beep"); break; | |
| 192 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Beep"); break; | |
| 193 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 194 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 195 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright The MESS Team"); break; | |
| 196 | 196 | } |
| 197 | 197 | } |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | int enable; /* mask which tones to play */ |
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | static | |
| 23 | static STREAM_UPDATE( tms3615_sound_update | |
| 24 | 24 | { |
| 25 | 25 | struct TMS3615 *tms = param; |
| 26 | 26 | int samplerate = tms->samplerate; |
| 27 | stream_sample_t *buffer8 = _buffer[TMS3615_FOOTAGE_8]; | |
| 28 | stream_sample_t *buffer16 = _buffer[TMS3615_FOOTAGE_16]; | |
| 27 | stream_sample_t *buffer8 = outputs[TMS3615_FOOTAGE_8]; | |
| 28 | stream_sample_t *buffer16 = outputs[TMS3615_FOOTAGE_16]; | |
| 29 | 29 | |
| 30 | while( le | |
| 30 | while( samples | |
| 31 | 31 | { |
| 32 | 32 | int sum8 = 0, sum16 = 0, tone = 0; |
| 33 | 33 | |
| r3957 | r3958 | |
| 110 | 110 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 111 | 111 | |
| 112 | 112 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 113 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms3615 ); break; | |
| 114 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms3615 ); break; | |
| 115 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 116 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 113 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms3615 ); break; | |
| 114 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms3615 ); break; | |
| 115 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 116 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 117 | 117 | |
| 118 | 118 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 119 | case SNDINFO_STR_NAME: info->s = "TMS3615"; break; | |
| 120 | case SNDINFO_STR_CORE_FAMILY: info->s = "TI PSG"; break; | |
| 121 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 122 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 123 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 119 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS3615"); break; | |
| 120 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "TI PSG"); break; | |
| 121 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 122 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 123 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 124 | 124 | } |
| 125 | 125 | } |
| r3957 | r3958 | |
|---|---|---|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| 88 | static | |
| 88 | static STREAM_UPDATE( update | |
| 89 | 89 | { |
| 90 | 90 | struct ics2115 *chip = param; |
| 91 | 91 | int osc, i; |
| 92 | 92 | int rec_irq = 0; |
| 93 | 93 | |
| 94 | memset(buffer[0], 0, length*sizeof(*buffer[0])); | |
| 95 | memset(buffer[1], 0, length*sizeof(*buffer[0])); | |
| 94 | memset(outputs[0], 0, samples*sizeof(*outputs[0])); | |
| 95 | memset(outputs[1], 0, samples*sizeof(*outputs[0])); | |
| 96 | 96 | |
| 97 | 97 | for(osc = 0; osc < 32; osc++) |
| 98 | 98 | if(chip->voice[osc].state & V_ON) { |
| r3957 | r3958 | |
| 108 | 108 | if (ICS2115LOGERROR) logerror("ICS2115: KEYRUN %02d adr=%08x end=%08x delta=%08x\n", |
| 109 | 109 | osc, adr, end, delta); |
| 110 | 110 | |
| 111 | for(i=0; i<le | |
| 111 | for(i=0; i<samples | |
| 112 | 112 | INT32 v = chip->rom[badr|(adr >> 12)]; |
| 113 | 113 | if(conf & 1) |
| 114 | 114 | v = chip->ulaw[v]; |
| r3957 | r3958 | |
| 116 | 116 | v = ((INT8)v) << 6; |
| 117 | 117 | |
| 118 | 118 | v = (v*vol)>>(16+5); |
| 119 | buffer[0][i] += v; | |
| 120 | buffer[1][i] += v; | |
| 119 | outputs[0][i] += v; | |
| 120 | outputs[1][i] += v; | |
| 121 | 121 | adr += delta; |
| 122 | 122 | if(adr >= end) { |
| 123 | 123 | if (ICS2115LOGERROR) logerror("ICS2115: KEYDONE %2d\n", osc); |
| r3957 | r3958 | |
| 556 | 556 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 557 | 557 | |
| 558 | 558 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 559 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ics2115 ); break; | |
| 560 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ics2115 ); break; | |
| 561 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 562 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ics2115 ); break; | |
| 559 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ics2115 ); break; | |
| 560 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ics2115 ); break; | |
| 561 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 562 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ics2115 ); break; | |
| 563 | 563 | |
| 564 | 564 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 565 | case SNDINFO_STR_NAME: info->s = "ICS2115"; break; | |
| 566 | case SNDINFO_STR_CORE_FAMILY: info->s = "ICS"; break; | |
| 567 | case SNDINFO_STR_CORE_VERSION: info->s = "1.01"; break; | |
| 568 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 569 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 565 | case SNDINFO_STR_NAME: strcpy(info->s, "ICS2115"); break; | |
| 566 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "ICS"); break; | |
| 567 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.01"); break; | |
| 568 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 569 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | 572 |
| r3957 | r3958 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | static | |
| 21 | static STREAM_UPDATE( DAC_update | |
| 22 | 22 | { |
| 23 | 23 | struct dac_info *info = param; |
| 24 | stream_sample_t *buffer = | |
| 24 | stream_sample_t *buffer = o | |
| 25 | 25 | INT16 out = info->output; |
| 26 | 26 | |
| 27 | while (le | |
| 27 | while (samples | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| r3957 | r3958 | |
| 171 | 171 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 172 | 172 | |
| 173 | 173 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 174 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( dac ); break; | |
| 175 | case SNDINFO_PTR_START: info->start = SND_START_NAME( dac ); break; | |
| 176 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 177 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 174 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( dac ); break; | |
| 175 | case SNDINFO_PTR_START: info->start = SND_START_NAME( dac ); break; | |
| 176 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 177 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 178 | 178 | |
| 179 | 179 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 180 | case SNDINFO_STR_NAME: info->s = "DAC"; break; | |
| 181 | case SNDINFO_STR_CORE_FAMILY: info->s = "TI Speech"; break; | |
| 182 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 183 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 184 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 180 | case SNDINFO_STR_NAME: strcpy(info->s, "DAC"); break; | |
| 181 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "DAC"); break; | |
| 182 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 183 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 184 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 |
| r3957 | r3958 | |
|---|---|---|
| 532 | 532 | MAME glue code |
| 533 | 533 | **************************************************************************/ |
| 534 | 534 | |
| 535 | static | |
| 535 | static STREAM_UPDATE( s14001a_pcm_update | |
| 536 | 536 | { |
| 537 | 537 | INT32 mix[48000]; |
| 538 | 538 | INT32 *mixp; |
| r3957 | r3958 | |
| 542 | 542 | memset(mix, 0, sizeof(mix)); |
| 543 | 543 | |
| 544 | 544 | mixp = &mix[0]; |
| 545 | for (i = 0; i < le | |
| 545 | for (i = 0; i < samples | |
| 546 | 546 | { |
| 547 | 547 | s14001a_clock(chip); |
| 548 | 548 | if (chip->audioout == ALTFLAG) // input from test pins -> output |
| r3957 | r3958 | |
| 639 | 639 | case SNDINFO_PTR_START: info->start = SND_START_NAME( s14001a ); break; |
| 640 | 640 | |
| 641 | 641 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 642 | case SNDINFO_STR_NAME: info->s = "S14001A"; break; | |
| 643 | case SNDINFO_STR_CORE_FAMILY: info->s = "TSI S14001A"; break; | |
| 644 | case SNDINFO_STR_CORE_VERSION: info->s = "1.31"; break; | |
| 645 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 646 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Jonathan Gevaryahu"; break; | |
| 642 | case SNDINFO_STR_NAME: strcpy(info->s, "S14001A"); break; | |
| 643 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "TSI S14001A"); break; | |
| 644 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.31"); break; | |
| 645 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 646 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Jonathan Gevaryahu"); break; | |
| 647 | 647 | } |
| 648 | 648 | } |
| r3957 | r3958 | |
|---|---|---|
| 83 | 83 | Writes length bytes to the sound buffer |
| 84 | 84 | ============================================================================*/ |
| 85 | 85 | |
| 86 | static | |
| 86 | static STREAM_UPDATE( gaelco_update | |
| 87 | 87 | { |
| 88 | 88 | struct GAELCOSND *info = param; |
| 89 | 89 | int j, ch; |
| 90 | 90 | |
| 91 | 91 | /* fill all data needed */ |
| 92 | for(j = 0; j < le | |
| 92 | for(j = 0; j < samples | |
| 93 | 93 | int output_l = 0, output_r = 0; |
| 94 | 94 | |
| 95 | 95 | /* for each channel */ |
| r3957 | r3958 | |
| 175 | 175 | #endif |
| 176 | 176 | |
| 177 | 177 | /* now that we have computed all channels, save current data to the output buffer */ |
| 178 | buffer[0][j] = output_l; | |
| 179 | buffer[1][j] = output_r; | |
| 178 | outputs[0][j] = output_l; | |
| 179 | outputs[1][j] = output_r; | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | if (wavraw) |
| 183 | wav_add_data_32lr(wavraw, | |
| 183 | wav_add_data_32lr(wavraw, outputs[0], outputs[1], samples | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /*============================================================================ |
| r3957 | r3958 | |
| 319 | 319 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( gaelco_gae1 ); break; |
| 320 | 320 | case SNDINFO_PTR_START: info->start = SND_START_NAME( gaelco_gae1 ); break; |
| 321 | 321 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( gaelco ); break; |
| 322 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 322 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 323 | 323 | |
| 324 | 324 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 325 | case SNDINFO_STR_NAME: info->s = "Gaelco GAE1"; break; | |
| 326 | case SNDINFO_STR_CORE_FAMILY: info->s = "Gaelco custom"; break; | |
| 327 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 328 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 329 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 325 | case SNDINFO_STR_NAME: strcpy(info->s, "Gaelco GAE1"); break; | |
| 326 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Gaelco custom"); break; | |
| 327 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 328 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 329 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
| r3957 | r3958 | |
| 355 | 355 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( gaelco_cg1v ); break; |
| 356 | 356 | case SNDINFO_PTR_START: info->start = SND_START_NAME( gaelco_cg1v ); break; |
| 357 | 357 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( gaelco ); break; |
| 358 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 358 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 359 | 359 | |
| 360 | 360 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 361 | case SNDINFO_STR_NAME: info->s = "Gaelco CG1V"; break; | |
| 362 | case SNDINFO_STR_CORE_FAMILY: info->s = "Gaelco custom"; break; | |
| 363 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 364 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 365 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 361 | case SNDINFO_STR_NAME: strcpy(info->s, "Gaelco CG1V"); break; | |
| 362 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Gaelco custom"); break; | |
| 363 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 364 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 365 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 |
| r3957 | r3958 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | /* core implementation */ |
| 88 | 88 | static void bsmt2000_reset(bsmt2000_chip *chip); |
| 89 | static | |
| 89 | static STREAM_UPDATE( bsmt2000_update | |
| 90 | 90 | |
| 91 | 91 | /* read/write access */ |
| 92 | 92 | static void bsmt2000_reg_write(bsmt2000_chip *chip, offs_t offset, UINT16 data); |
| r3957 | r3958 | |
| 183 | 183 | sample generation |
| 184 | 184 | -------------------------------------------------*/ |
| 185 | 185 | |
| 186 | static | |
| 186 | static STREAM_UPDATE( bsmt2000_update | |
| 187 | 187 | { |
| 188 | stream_sample_t *left = buffer[0]; | |
| 189 | stream_sample_t *right = buffer[1]; | |
| 188 | stream_sample_t *left = outputs[0]; | |
| 189 | stream_sample_t *right = outputs[1]; | |
| 190 | 190 | bsmt2000_chip *chip = param; |
| 191 | 191 | bsmt2000_voice *voice; |
| 192 | 192 | int samp, voicenum; |
| 193 | 193 | |
| 194 | 194 | /* clear out the accumulator */ |
| 195 | memset(left, 0, length * sizeof(left[0])); | |
| 196 | memset(right, 0, length * sizeof(right[0])); | |
| 195 | memset(left, 0, samples * sizeof(left[0])); | |
| 196 | memset(right, 0, samples * sizeof(right[0])); | |
| 197 | 197 | |
| 198 | 198 | /* loop over voices */ |
| 199 | 199 | for (voicenum = 0; voicenum < chip->voices; voicenum++) |
| r3957 | r3958 | |
| 211 | 211 | UINT16 frac = voice->fraction; |
| 212 | 212 | |
| 213 | 213 | /* loop while we still have samples to generate */ |
| 214 | for (samp = 0; samp < le | |
| 214 | for (samp = 0; samp < samples | |
| 215 | 215 | { |
| 216 | 216 | #if ENABLE_INTERPOLATION |
| 217 | 217 | INT32 sample = (base[pos] * (0x800 - frac) + (base[pos + 1] * frac)) >> 11; |
| r3957 | r3958 | |
| 249 | 249 | UINT32 frac = voice->fraction; |
| 250 | 250 | |
| 251 | 251 | /* loop while we still have samples to generate */ |
| 252 | for (samp = 0; samp < le | |
| 252 | for (samp = 0; samp < samples | |
| 253 | 253 | { |
| 254 | 254 | /* apply volumes and add */ |
| 255 | 255 | left[samp] += (chip->adpcm_current * lvol) >> 8; |
| r3957 | r3958 | |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /* reduce the overall gain */ |
| 307 | for (samp = 0; samp < le | |
| 307 | for (samp = 0; samp < samples | |
| 308 | 308 | { |
| 309 | 309 | left[samp] >>= 9; |
| 310 | 310 | right[samp] >>= 9; |
| r3957 | r3958 | |
| 504 | 504 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 505 | 505 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( bsmt2000 ); break; |
| 506 | 506 | case SNDINFO_PTR_START: info->start = SND_START_NAME( bsmt2000 ); break; |
| 507 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 507 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 508 | 508 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( bsmt2000 ); break; |
| 509 | 509 | |
| 510 | 510 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 511 | case SNDINFO_STR_NAME: info->s = "BSMT2000"; break; | |
| 512 | case SNDINFO_STR_CORE_FAMILY: info->s = "Data East Wavetable"; break; | |
| 513 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 514 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 515 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 511 | case SNDINFO_STR_NAME: strcpy(info->s, "BSMT2000"); break; | |
| 512 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Data East Wavetable"); break; | |
| 513 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 514 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 515 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 516 | 516 | } |
| 517 | 517 | } |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | * |
| 63 | 63 | *************************************/ |
| 64 | 64 | |
| 65 | static | |
| 65 | static STREAM_UPDATE( dmadac_update | |
| 66 | 66 | { |
| 67 | 67 | struct dmadac_channel_data *ch = param; |
| 68 | stream_sample_t *output = | |
| 68 | stream_sample_t *output = o | |
| 69 | 69 | INT16 *source = ch->buffer; |
| 70 | 70 | UINT32 curout = ch->bufout; |
| 71 | 71 | UINT32 curin = ch->bufin; |
| 72 | 72 | int volume = ch->volume; |
| 73 | 73 | |
| 74 | 74 | /* feed as much as we can */ |
| 75 | while (curout != curin && le | |
| 75 | while (curout != curin && samples | |
| 76 | 76 | *output++ = (source[curout++ % BUFFER_SIZE] * volume) >> 8; |
| 77 | 77 | |
| 78 | 78 | /* fill the rest with silence */ |
| 79 | while (le | |
| 79 | while (samples | |
| 80 | 80 | *output++ = 0; |
| 81 | 81 | |
| 82 | 82 | /* save the new output pointer */ |
| r3957 | r3958 | |
| 251 | 251 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 252 | 252 | |
| 253 | 253 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 254 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( dmadac ); break; | |
| 255 | case SNDINFO_PTR_START: info->start = SND_START_NAME( dmadac ); break; | |
| 256 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 257 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 254 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( dmadac ); break; | |
| 255 | case SNDINFO_PTR_START: info->start = SND_START_NAME( dmadac ); break; | |
| 256 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 257 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 258 | 258 | |
| 259 | 259 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 260 | case SNDINFO_STR_NAME: info->s = "DMA-driven DAC"; break; | |
| 261 | case SNDINFO_STR_CORE_FAMILY: info->s = "DAC"; break; | |
| 262 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 263 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 264 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 260 | case SNDINFO_STR_NAME: strcpy(info->s, "DMA-driven DAC"); break; | |
| 261 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "DAC"); break; | |
| 262 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 263 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 264 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 |
| r3957 | r3958 | |
|---|---|---|
| 104 | 104 | stream_update(info->stream); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | static | |
| 107 | static STREAM_UPDATE( ym2608_stream_update | |
| 108 | 108 | { |
| 109 | 109 | struct ym2608_info *info = param; |
| 110 | ym2608_update_one(info->chip, | |
| 110 | ym2608_update_one(info->chip, outputs, samples | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r3957 | r3958 | |
| 317 | 317 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2608 ); break; |
| 318 | 318 | |
| 319 | 319 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 320 | case SNDINFO_STR_NAME: info->s = "YM2608"; break; | |
| 321 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 322 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 323 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 324 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 320 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2608"); break; | |
| 321 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 322 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 323 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 324 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 325 | 325 | } |
| 326 | 326 | } |
| r3957 | r3958 | |
|---|---|---|
| 251 | 251 | |
| 252 | 252 | ***********************************************************************************************/ |
| 253 | 253 | |
| 254 | static | |
| 254 | static STREAM_UPDATE( okim6295_update | |
| 255 | 255 | { |
| 256 | 256 | struct okim6295 *chip = param; |
| 257 | 257 | int i; |
| r3957 | r3958 | |
| 670 | 670 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 671 | 671 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( okim6295 ); break; |
| 672 | 672 | case SNDINFO_PTR_START: info->start = SND_START_NAME( okim6295 ); break; |
| 673 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 673 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 674 | 674 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( okim6295 ); break; |
| 675 | 675 | |
| 676 | 676 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 677 | case SNDINFO_STR_NAME: info->s = "OKI6295"; break; | |
| 678 | case SNDINFO_STR_CORE_FAMILY: info->s = "OKI ADPCM"; break; | |
| 679 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 680 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 681 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 677 | case SNDINFO_STR_NAME: strcpy(info->s, "OKI6295"); break; | |
| 678 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "OKI ADPCM"); break; | |
| 679 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 680 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 681 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 682 | 682 | } |
| 683 | 683 | } |
| 684 | 684 |
| r3957 | r3958 | |
|---|---|---|
| 769 | 769 | |
| 770 | 770 | ***********************************************************************************************/ |
| 771 | 771 | |
| 772 | static | |
| 772 | static STREAM_UPDATE( es5506_update | |
| 773 | 773 | { |
| 774 | 774 | struct ES5506Chip *chip = param; |
| 775 | 775 | INT32 *lsrc = chip->scratch, *rsrc = chip->scratch; |
| 776 | stream_sample_t *ldest = buffer[0]; | |
| 777 | stream_sample_t *rdest = buffer[1]; | |
| 776 | stream_sample_t *ldest = outputs[0]; | |
| 777 | stream_sample_t *rdest = outputs[1]; | |
| 778 | 778 | |
| 779 | 779 | #if MAKE_WAVS |
| 780 | 780 | /* start the logging once we have a sample rate */ |
| r3957 | r3958 | |
| 786 | 786 | #endif |
| 787 | 787 | |
| 788 | 788 | /* loop until all samples are output */ |
| 789 | while (le | |
| 789 | while (samples | |
| 790 | 790 | { |
| 791 | int | |
| 791 | int | |
| 792 | 792 | int samp; |
| 793 | 793 | |
| 794 | 794 | /* determine left/right source data */ |
| 795 | 795 | lsrc = chip->scratch; |
| 796 | rsrc = chip->scratch + samples; | |
| 797 | generate_samples(chip, lsrc, rsrc, samples); | |
| 796 | rsrc = chip->scratch + length; | |
| 797 | generate_samples(chip, lsrc, rsrc, length); | |
| 798 | 798 | |
| 799 | 799 | /* copy the data */ |
| 800 | for (samp = 0; samp < | |
| 800 | for (samp = 0; samp < | |
| 801 | 801 | { |
| 802 | 802 | *ldest++ = lsrc[samp] >> 4; |
| 803 | 803 | *rdest++ = rsrc[samp] >> 4; |
| r3957 | r3958 | |
| 806 | 806 | #if MAKE_WAVS |
| 807 | 807 | /* log the raw data */ |
| 808 | 808 | if (chip->wavraw) |
| 809 | wav_add_data_32lr(chip->wavraw, lsrc, rsrc, | |
| 809 | wav_add_data_32lr(chip->wavraw, lsrc, rsrc, | |
| 810 | 810 | #endif |
| 811 | 811 | |
| 812 | 812 | /* account for these samples */ |
| 813 | le | |
| 813 | samples | |
| 814 | 814 | } |
| 815 | 815 | } |
| 816 | 816 | |
| r3957 | r3958 | |
| 2167 | 2167 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( es5505 ); break; |
| 2168 | 2168 | |
| 2169 | 2169 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2170 | case SNDINFO_STR_NAME: info->s = "ES5505"; break; | |
| 2171 | case SNDINFO_STR_CORE_FAMILY: info->s = "Ensoniq Wavetable"; break; | |
| 2172 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 2173 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 2174 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 2170 | case SNDINFO_STR_NAME: strcpy(info->s, "ES5505"); break; | |
| 2171 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Ensoniq Wavetable"); break; | |
| 2172 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 2173 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 2174 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 2175 | 2175 | } |
| 2176 | 2176 | } |
| 2177 | 2177 | |
| r3957 | r3958 | |
| 2202 | 2202 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( es5506 ); break; |
| 2203 | 2203 | |
| 2204 | 2204 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2205 | case SNDINFO_STR_NAME: info->s = "ES5506"; break; | |
| 2206 | case SNDINFO_STR_CORE_FAMILY: info->s = "Ensoniq Wavetable"; break; | |
| 2207 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 2208 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 2209 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 2205 | case SNDINFO_STR_NAME: strcpy(info->s, "ES5506"); break; | |
| 2206 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Ensoniq Wavetable"); break; | |
| 2207 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 2208 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 2209 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 2210 | 2210 | } |
| 2211 | 2211 | } |
| 2212 | 2212 |
| r3957 | r3958 | |
|---|---|---|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | static | |
| 258 | static STREAM_UPDATE( ymf278b_pcm_update | |
| 259 | 259 | { |
| 260 | 260 | YMF278BChip *chip = param; |
| 261 | 261 | int i, j; |
| r3957 | r3958 | |
| 265 | 265 | INT32 *mixp; |
| 266 | 266 | INT32 vl, vr; |
| 267 | 267 | |
| 268 | memset(mix, 0, sizeof(mix[0])*le | |
| 268 | memset(mix, 0, sizeof(mix[0])*samples | |
| 269 | 269 | |
| 270 | 270 | rombase = chip->rom; |
| 271 | 271 | |
| r3957 | r3958 | |
| 277 | 277 | { |
| 278 | 278 | mixp = mix; |
| 279 | 279 | |
| 280 | for (j = 0; j < le | |
| 280 | for (j = 0; j < samples | |
| 281 | 281 | { |
| 282 | 282 | switch (slot->bits) |
| 283 | 283 | { |
| r3957 | r3958 | |
| 329 | 329 | mixp = mix; |
| 330 | 330 | vl = chip->mix_level[chip->pcm_l]; |
| 331 | 331 | vr = chip->mix_level[chip->pcm_r]; |
| 332 | for (i = 0; i < le | |
| 332 | for (i = 0; i < samples | |
| 333 | 333 | { |
| 334 | 334 | outputs[0][i] = (*mixp++ * vl) >> 16; |
| 335 | 335 | outputs[1][i] = (*mixp++ * vr) >> 16; |
| r3957 | r3958 | |
| 808 | 808 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 809 | 809 | |
| 810 | 810 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 811 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymf278b ); break; | |
| 812 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ymf278b ); break; | |
| 813 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 814 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 811 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymf278b ); break; | |
| 812 | case SNDINFO_PTR_START: info->start = SND_START_NAME( ymf278b ); break; | |
| 813 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 814 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 815 | 815 | |
| 816 | 816 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 817 | case SNDINFO_STR_NAME: info->s = "YMF278B"; break; | |
| 818 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 819 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 820 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 821 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 817 | case SNDINFO_STR_NAME: strcpy(info->s, "YMF278B"); break; | |
| 818 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 819 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 820 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 821 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 822 | 822 | } |
| 823 | 823 | } |
| 824 | 824 |
| r3957 | r3958 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | static | |
| 24 | static STREAM_UPDATE( sid_update | |
| 25 | 25 | { |
| 26 | SID6581 *sid = (SID6581 *) token; | |
| 27 | sidEmuFillBuffer(sid, _buffer[0], length); | |
| 26 | SID6581 *sid = (SID6581 *) param; | |
| 27 | sidEmuFillBuffer(sid, outputs[0], samples); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| r3957 | r3958 | |
| 115 | 115 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 116 | 116 | |
| 117 | 117 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 118 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sid6581 ); break; | |
| 119 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sid6581 ); break; | |
| 120 | case SNDINFO_PTR_STOP: info->stop = NULL; break; | |
| 121 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( sid ); break; | |
| 118 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sid6581 ); break; | |
| 119 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sid6581 ); break; | |
| 120 | case SNDINFO_PTR_STOP: info->stop = NULL; break; | |
| 121 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( sid ); break; | |
| 122 | 122 | |
| 123 | 123 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 124 | case SNDINFO_STR_NAME: info->s = "SID6581"; break; | |
| 125 | case SNDINFO_STR_CORE_FAMILY: info->s = "SID"; break; | |
| 126 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 127 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 128 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright The MESS Team"; break; | |
| 124 | case SNDINFO_STR_NAME: strcpy(info->s, "SID6581"); break; | |
| 125 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "SID"); break; | |
| 126 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 127 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 128 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright The MESS Team"); break; | |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| r3957 | r3958 | |
| 135 | 135 | switch (state) |
| 136 | 136 | { |
| 137 | 137 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 138 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sid8580 ); | |
| 138 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sid8580 ); | |
| 139 | 139 | |
| 140 | 140 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 141 | case SNDINFO_STR_NAME: info->s = "SID8580"; break; | |
| 142 | default: SND_GET_INFO_CALL(sid6581); break; | |
| 141 | case SNDINFO_STR_NAME: strcpy(info->s, "SID8580"); break; | |
| 142 | default: SND_GET_INFO_CALL(sid6581); break; | |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static | |
| 14 | static STREAM_UPDATE( filter_volume_update | |
| 15 | 15 | { |
| 16 | 16 | stream_sample_t *src = inputs[0]; |
| 17 | 17 | stream_sample_t *dst = outputs[0]; |
| r3957 | r3958 | |
| 65 | 65 | |
| 66 | 66 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 67 | 67 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( filter_volume ); break; |
| 68 | case SNDINFO_PTR_START: info->start = SND_START_NAME( filter_volume ); break; | |
| 69 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 70 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 68 | case SNDINFO_PTR_START: info->start = SND_START_NAME( filter_volume ); break; | |
| 69 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 70 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 71 | 71 | |
| 72 | 72 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 73 | case SNDINFO_STR_NAME: info->s = "Volume Filter"; break; | |
| 74 | case SNDINFO_STR_CORE_FAMILY: info->s = "Filters"; break; | |
| 75 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 76 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 77 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 73 | case SNDINFO_STR_NAME: strcpy(info->s, "Volume Filter"); break; | |
| 74 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Filters"); break; | |
| 75 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 76 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 77 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | /* static function prototypes */ |
| 34 | static | |
| 34 | static STREAM_UPDATE( tms5220_update | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | |
| r3957 | r3958 | |
| 195 | 195 | |
| 196 | 196 | ***********************************************************************************************/ |
| 197 | 197 | |
| 198 | static | |
| 198 | static STREAM_UPDATE( tms5220_update | |
| 199 | 199 | { |
| 200 | 200 | struct tms5220_info *info = param; |
| 201 | 201 | INT16 sample_data[MAX_SAMPLE_CHUNK]; |
| 202 | stream_sample_t *buffer = | |
| 202 | stream_sample_t *buffer = o | |
| 203 | 203 | |
| 204 | 204 | /* loop while we still have samples to generate */ |
| 205 | while (le | |
| 205 | while (samples | |
| 206 | 206 | { |
| 207 | int | |
| 207 | int | |
| 208 | 208 | int index; |
| 209 | 209 | |
| 210 | 210 | /* generate the samples and copy to the target buffer */ |
| 211 | tms5220_process(info->chip, sample_data, samples); | |
| 212 | for (index = 0; index < samples; index++) | |
| 211 | tms5220_process(info->chip, sample_data, length); | |
| 212 | for (index = 0; index < length; index++) | |
| 213 | 213 | *buffer++ = sample_data[index]; |
| 214 | 214 | |
| 215 | 215 | /* account for the samples */ |
| 216 | le | |
| 216 | samples | |
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |
| r3957 | r3958 | |
| 254 | 254 | switch (state) |
| 255 | 255 | { |
| 256 | 256 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 257 | case SNDINFO_INT_ALIAS: info->i = SOUND_TMS5220; break; | |
| 257 | case SNDINFO_INT_ALIAS: info->i = SOUND_TMS5220; break; | |
| 258 | 258 | |
| 259 | 259 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 260 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms5220 ); break; | |
| 261 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5220 ); break; | |
| 262 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( tms5220 ); break; | |
| 263 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( tms5220 ); break; | |
| 260 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms5220 ); break; | |
| 261 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5220 ); break; | |
| 262 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( tms5220 ); break; | |
| 263 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( tms5220 ); break; | |
| 264 | 264 | |
| 265 | 265 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 266 | case SNDINFO_STR_NAME: info->s = "TMS5220"; break; | |
| 267 | case SNDINFO_STR_CORE_FAMILY: info->s = "TI Speech"; break; | |
| 268 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 269 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 270 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 266 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS5220"); break; | |
| 267 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "TI Speech"); break; | |
| 268 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 269 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 270 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
| r3957 | r3958 | |
| 276 | 276 | { |
| 277 | 277 | switch (state) |
| 278 | 278 | { |
| 279 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5200 ); break; | |
| 280 | case SNDINFO_STR_NAME: info->s = "TMC0285"; break; | |
| 281 | default: SND_GET_INFO_CALL( tms5220 ); break; | |
| 279 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5200 ); break; | |
| 280 | case SNDINFO_STR_NAME: strcpy(info->s, "TMC0285"); break; | |
| 281 | default: SND_GET_INFO_CALL( tms5220 ); break; | |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | #endif |
| r3957 | r3958 | |
| 288 | 288 | { |
| 289 | 289 | switch (state) |
| 290 | 290 | { |
| 291 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5200 ); break; | |
| 292 | case SNDINFO_STR_NAME: info->s = "TMS5200"; break; | |
| 293 | default: SND_GET_INFO_CALL( tms5220 ); break; | |
| 291 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5200 ); break; | |
| 292 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS5200"); break; | |
| 293 | default: SND_GET_INFO_CALL( tms5220 ); break; | |
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | 24 | |
| 25 | static | |
| 25 | static STREAM_UPDATE( ym2151_update | |
| 26 | 26 | { |
| 27 | 27 | struct ym2151_info *info = param; |
| 28 | ym2151_update_one(info->chip, | |
| 28 | ym2151_update_one(info->chip, outputs, samples | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
| r3957 | r3958 | |
| 230 | 230 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2151 ); break; |
| 231 | 231 | |
| 232 | 232 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 233 | case SNDINFO_STR_NAME: info->s = "YM2151"; break; | |
| 234 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 235 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 236 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 237 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 233 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2151"); break; | |
| 234 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 235 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 236 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 237 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 238 | 238 | } |
| 239 | 239 | } |
| r3957 | r3958 | |
|---|---|---|
| 111 | 111 | return v; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | static | |
| 114 | static STREAM_UPDATE( PSXSPU_update | |
| 115 | 115 | { |
| 116 | 116 | struct psxinfo *chip = param; |
| 117 | 117 | int v; |
| r3957 | r3958 | |
| 136 | 136 | { 122, -60 } |
| 137 | 137 | }; |
| 138 | 138 | |
| 139 | memset( buffer[ 0 ], 0, length * sizeof( *buffer[ 0 ] )); | |
| 140 | memset( buffer[ 1 ], 0, length * sizeof( *buffer[ 1 ] )); | |
| 139 | memset( outputs[ 0 ], 0, samples * sizeof( *outputs[ 0 ] )); | |
| 140 | memset( outputs[ 1 ], 0, samples * sizeof( *outputs[ 1 ] )); | |
| 141 | 141 | |
| 142 | 142 | for( n_channel = 0; n_channel < MAX_CHANNEL; n_channel++ ) |
| 143 | 143 | { |
| 144 | 144 | voll = volume( chip->m_p_n_volumeleft[ n_channel ] ); |
| 145 | 145 | volr = volume( chip->m_p_n_volumeright[ n_channel ] ); |
| 146 | 146 | |
| 147 | for( n_sample = 0; n_sample < le | |
| 147 | for( n_sample = 0; n_sample < samples | |
| 148 | 148 | { |
| 149 | 149 | if( chip->m_p_n_blockoffset[ n_channel ] >= ( SAMPLES_PER_BLOCK << PITCH_SHIFT ) ) |
| 150 | 150 | { |
| r3957 | r3958 | |
| 207 | 207 | } |
| 208 | 208 | v = chip->m_p_n_blockbuffer[ ( n_channel * SAMPLES_PER_BLOCK ) + ( chip->m_p_n_blockoffset[ n_channel ] >> PITCH_SHIFT ) ]; |
| 209 | 209 | chip->m_p_n_blockoffset[ n_channel ] += chip->m_p_n_pitch[ n_channel ]; |
| 210 | buffer[ 0 ][ n_sample ] = limit( buffer[ 0 ][ n_sample ] + ( ( v * voll ) / 0x4000 ) ); | |
| 211 | buffer[ 1 ][ n_sample ] = limit( buffer[ 1 ][ n_sample ] + ( ( v * volr ) / 0x4000 ) ); | |
| 210 | outputs[ 0 ][ n_sample ] = limit( outputs[ 0 ][ n_sample ] + ( ( v * voll ) / 0x4000 ) ); | |
| 211 | outputs[ 1 ][ n_sample ] = limit( outputs[ 1 ][ n_sample ] + ( ( v * volr ) / 0x4000 ) ); | |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | static void spu_read( UINT32 n_address, INT32 n_size ) | |
| 216 | static void spu_read( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 217 | 217 | { |
| 218 | 218 | struct psxinfo *chip = sndti_token(SOUND_PSXSPU, 0); |
| 219 | running_machine *machine = chip->device->machine; | |
| 220 | 219 | verboselog( machine, 1, "spu_read( %08x, %08x )\n", n_address, n_size ); |
| 221 | 220 | |
| 222 | 221 | while( n_size > 0 ) |
| r3957 | r3958 | |
| 233 | 232 | } |
| 234 | 233 | } |
| 235 | 234 | |
| 236 | static void spu_write( UINT32 n_address, INT32 n_size ) | |
| 235 | static void spu_write( running_machine *machine, UINT32 n_address, INT32 n_size ) | |
| 237 | 236 | { |
| 238 | 237 | struct psxinfo *chip = sndti_token(SOUND_PSXSPU, 0); |
| 239 | running_machine *machine = chip->device->machine; | |
| 240 | 238 | verboselog( machine, 1, "spu_write( %08x, %08x )\n", n_address, n_size ); |
| 241 | 239 | |
| 242 | 240 | while( n_size > 0 ) |
| r3957 | r3958 | |
| 686 | 684 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 687 | 685 | |
| 688 | 686 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 689 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( psxspu ); break; | |
| 690 | case SNDINFO_PTR_START: info->start = SND_START_NAME( psxspu ); break; | |
| 691 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 692 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 687 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( psxspu ); break; | |
| 688 | case SNDINFO_PTR_START: info->start = SND_START_NAME( psxspu ); break; | |
| 689 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 690 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 693 | 691 | |
| 694 | 692 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 695 | case SNDINFO_STR_NAME: info->s = "SPU"; break; | |
| 696 | case SNDINFO_STR_CORE_FAMILY: info->s = "Sony custom"; break; | |
| 697 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 698 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 699 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 693 | case SNDINFO_STR_NAME: strcpy(info->s, "SPU"); break; | |
| 694 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Sony custom"); break; | |
| 695 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 696 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 697 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 700 | 698 | } |
| 701 | 699 | } |
| 702 | 700 |
| r3957 | r3958 | |
|---|---|---|
| 100 | 100 | #define MAXOUT 0x7fff |
| 101 | 101 | #define MINOUT -0x8000 |
| 102 | 102 | |
| 103 | static | |
| 103 | static STREAM_UPDATE( k053260_update | |
| 104 | 104 | static const long dpcmcnv[] = { 0,1,2,4,8,16,32,64, -128, -64, -32, -16, -8, -4, -2, -1}; |
| 105 | 105 | |
| 106 | 106 | int i, j, lvol[4], rvol[4], play[4], loop[4], ppcm_data[4], ppcm[4]; |
| r3957 | r3958 | |
| 126 | 126 | delta[i] /= 2; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | for ( j = 0; j < le | |
| 129 | for ( j = 0; j < samples | |
| 130 | 130 | |
| 131 | 131 | dataL = dataR = 0; |
| 132 | 132 | |
| r3957 | r3958 | |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | buffer[1][j] = limit( dataL, MAXOUT, MINOUT ); | |
| 191 | buffer[0][j] = limit( dataR, MAXOUT, MINOUT ); | |
| 190 | outputs[1][j] = limit( dataL, MAXOUT, MINOUT ); | |
| 191 | outputs[0][j] = limit( dataR, MAXOUT, MINOUT ); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /* update the regs now */ |
| r3957 | r3958 | |
| 482 | 482 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 483 | 483 | |
| 484 | 484 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 485 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k053260 ); break; | |
| 486 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k053260 ); break; | |
| 487 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 488 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( k053260); break; | |
| 485 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k053260 ); break; | |
| 486 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k053260 ); break; | |
| 487 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 488 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( k053260); break; | |
| 489 | 489 | |
| 490 | 490 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 491 | case SNDINFO_STR_NAME: info->s = "K053260"; break; | |
| 492 | case SNDINFO_STR_CORE_FAMILY: info->s = "Konami custom"; break; | |
| 493 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 494 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 495 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 491 | case SNDINFO_STR_NAME: strcpy(info->s, "K053260"); break; | |
| 492 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Konami custom"); break; | |
| 493 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 494 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 495 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 496 | 496 | } |
| 497 | 497 | } |
| 498 | 498 |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | } |
| 37 | 37 | #endif |
| 38 | 38 | |
| 39 | static | |
| 39 | static STREAM_UPDATE( ym2413_stream_update | |
| 40 | 40 | { |
| 41 | 41 | struct ym2413_info *info = param; |
| 42 | ym2413_update_one(info->chip, | |
| 42 | ym2413_update_one(info->chip, outputs, samples | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | static void _stream_update(void *param, int interval) |
| r3957 | r3958 | |
| 177 | 177 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2413 ); break; |
| 178 | 178 | |
| 179 | 179 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 180 | case SNDINFO_STR_NAME: info->s = "YM2413"; break; | |
| 181 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 182 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 183 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 184 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 180 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2413"); break; | |
| 181 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 182 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 183 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 184 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 185 | 185 | } |
| 186 | 186 | } |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | WRITE32_HANDLER( psx_spu_delay_w ); |
| 17 | 17 | READ32_HANDLER( psx_spu_delay_r ); |
| 18 | 18 | |
| 19 | typedef void ( *spu_handler )( UINT32, INT32 ); | |
| 19 | typedef void ( *spu_handler )( running_machine *, UINT32, INT32 ); | |
| 20 | 20 | |
| 21 | 21 | typedef struct _psx_spu_interface psx_spu_interface; |
| 22 | 22 | struct _psx_spu_interface |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | sound_stream * stream; |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | static | |
| 19 | static STREAM_UPDATE( SEGAPCM_update | |
| 20 | 20 | { |
| 21 | 21 | struct segapcm *spcm = param; |
| 22 | 22 | int ch; |
| 23 | 23 | |
| 24 | 24 | /* clear the buffers */ |
| 25 | memset(buffer[0], 0, length*sizeof(*buffer[0])); | |
| 26 | memset(buffer[1], 0, length*sizeof(*buffer[1])); | |
| 25 | memset(outputs[0], 0, samples*sizeof(*outputs[0])); | |
| 26 | memset(outputs[1], 0, samples*sizeof(*outputs[1])); | |
| 27 | 27 | |
| 28 | 28 | /* loop over channels */ |
| 29 | 29 | for (ch = 0; ch < 16; ch++) |
| r3957 | r3958 | |
| 43 | 43 | int i; |
| 44 | 44 | |
| 45 | 45 | /* loop over samples on this channel */ |
| 46 | for (i = 0; i < le | |
| 46 | for (i = 0; i < samples | |
| 47 | 47 | { |
| 48 | 48 | INT8 v = 0; |
| 49 | 49 | |
| r3957 | r3958 | |
| 63 | 63 | v = rom[addr >> 8] - 0x80; |
| 64 | 64 | |
| 65 | 65 | /* apply panning and advance */ |
| 66 | buffer[0][i] += v * voll; | |
| 67 | buffer[1][i] += v * volr; | |
| 66 | outputs[0][i] += v * voll; | |
| 67 | outputs[1][i] += v * volr; | |
| 68 | 68 | addr += delta; |
| 69 | 69 | } |
| 70 | 70 | |
| r3957 | r3958 | |
| 146 | 146 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 147 | 147 | |
| 148 | 148 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 149 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( segapcm ); break; | |
| 150 | case SNDINFO_PTR_START: info->start = SND_START_NAME( segapcm ); break; | |
| 151 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 152 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 149 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( segapcm ); break; | |
| 150 | case SNDINFO_PTR_START: info->start = SND_START_NAME( segapcm ); break; | |
| 151 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 152 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 153 | 153 | |
| 154 | 154 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 155 | case SNDINFO_STR_NAME: info->s = "Sega PCM"; break; | |
| 156 | case SNDINFO_STR_CORE_FAMILY: info->s = "Sega custom"; break; | |
| 157 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 158 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 159 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 155 | case SNDINFO_STR_NAME: strcpy(info->s, "Sega PCM"); break; | |
| 156 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Sega custom"); break; | |
| 157 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 158 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 159 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 160 | 160 | } |
| 161 | 161 | } |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | static void VR0_RenderAudio(struct _VR0Chip *VR0, int nsamples,stream_sample_t *l,stream_sample_t *r); |
| 27 | 27 | |
| 28 | static | |
| 28 | static STREAM_UPDATE( VR0_Update | |
| 29 | 29 | { |
| 30 | 30 | struct _VR0Chip *VR0 = param; |
| 31 | VR0_RenderAudio(VR0, samples, | |
| 31 | VR0_RenderAudio(VR0, samples,outputs[0],outputs[1]); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | //Correct table thanks to Evoga |
| r3957 | r3958 | |
| 258 | 258 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 259 | 259 | |
| 260 | 260 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 261 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( vrender0 ); break; | |
| 262 | case SNDINFO_PTR_START: info->start = SND_START_NAME( vrender0 ); break; | |
| 263 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 264 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 261 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( vrender0 ); break; | |
| 262 | case SNDINFO_PTR_START: info->start = SND_START_NAME( vrender0 ); break; | |
| 263 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 264 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 265 | 265 | |
| 266 | 266 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 267 | case SNDINFO_STR_NAME: info->s = "VRender0"; break; | |
| 268 | case SNDINFO_STR_CORE_FAMILY: info->s = "???"; break; | |
| 269 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 270 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 271 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 267 | case SNDINFO_STR_NAME: strcpy(info->s, "VRender0"); break; | |
| 268 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "???"); break; | |
| 269 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 270 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 271 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 |
| r3957 | r3958 | |
|---|---|---|
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | static | |
| 416 | static STREAM_UPDATE( MultiPCM_update | |
| 417 | 417 | { |
| 418 | 418 | struct _MultiPCM *ptChip = param; |
| 419 | 419 | stream_sample_t *datap[2]; |
| 420 | 420 | int i,sl; |
| 421 | 421 | |
| 422 | datap[0] = buffer[0]; | |
| 423 | datap[1] = buffer[1]; | |
| 422 | datap[0] = outputs[0]; | |
| 423 | datap[1] = outputs[1]; | |
| 424 | 424 | |
| 425 | memset(datap[0], 0, sizeof(*datap[0])*length); | |
| 426 | memset(datap[1], 0, sizeof(*datap[1])*length); | |
| 425 | memset(datap[0], 0, sizeof(*datap[0])*samples); | |
| 426 | memset(datap[1], 0, sizeof(*datap[1])*samples); | |
| 427 | 427 | |
| 428 | 428 | |
| 429 | for(i=0;i<le | |
| 429 | for(i=0;i<samples | |
| 430 | 430 | { |
| 431 | 431 | signed int smpl=0; |
| 432 | 432 | signed int smpr=0; |
| r3957 | r3958 | |
| 709 | 709 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 710 | 710 | |
| 711 | 711 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 712 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( multipcm ); break; | |
| 713 | case SNDINFO_PTR_START: info->start = SND_START_NAME( multipcm ); break; | |
| 714 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 715 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 712 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( multipcm ); break; | |
| 713 | case SNDINFO_PTR_START: info->start = SND_START_NAME( multipcm ); break; | |
| 714 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 715 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 716 | 716 | |
| 717 | 717 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 718 | case SNDINFO_STR_NAME: info->s = "Sega/Yamaha 315-5560"; break; | |
| 719 | case SNDINFO_STR_CORE_FAMILY: info->s = "Sega custom"; break; | |
| 720 | case SNDINFO_STR_CORE_VERSION: info->s = "2.0"; break; | |
| 721 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 722 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 718 | case SNDINFO_STR_NAME: strcpy(info->s, "Sega/Yamaha 315-5560"); break; | |
| 719 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Sega custom"); break; | |
| 720 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "2.0"); break; | |
| 721 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 722 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 |
| r3957 | r3958 | |
|---|---|---|
| 160 | 160 | |
| 161 | 161 | |
| 162 | 162 | /* generate sound to the mix buffer in mono */ |
| 163 | static | |
| 163 | static STREAM_UPDATE( namco_update_mono | |
| 164 | 164 | { |
| 165 | 165 | struct namco_sound *chip = param; |
| 166 | stream_sample_t *buffer = | |
| 166 | stream_sample_t *buffer = o | |
| 167 | 167 | sound_channel *voice; |
| 168 | 168 | |
| 169 | 169 | /* zap the contents of the buffer */ |
| 170 | memset(buffer, 0, le | |
| 170 | memset(buffer, 0, samples | |
| 171 | 171 | |
| 172 | 172 | /* if no sound, we're done */ |
| 173 | 173 | if (chip->sound_enable == 0) |
| r3957 | r3958 | |
| 194 | 194 | int i; |
| 195 | 195 | |
| 196 | 196 | /* add our contribution */ |
| 197 | for (i = 0; i < le | |
| 197 | for (i = 0; i < samples | |
| 198 | 198 | { |
| 199 | 199 | int cnt; |
| 200 | 200 | |
| r3957 | r3958 | |
| 235 | 235 | const INT16 *w = &chip->waveform[v][voice->waveform_select * 32]; |
| 236 | 236 | |
| 237 | 237 | /* generate sound into buffer and update the counter for this voice */ |
| 238 | voice->counter = namco_update_one(chip, mix, le | |
| 238 | voice->counter = namco_update_one(chip, mix, samples | |
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | } |
| r3957 | r3958 | |
| 243 | 243 | |
| 244 | 244 | |
| 245 | 245 | /* generate sound to the mix buffer in stereo */ |
| 246 | static | |
| 246 | static STREAM_UPDATE( namco_update_stereo | |
| 247 | 247 | { |
| 248 | 248 | struct namco_sound *chip = param; |
| 249 | 249 | sound_channel *voice; |
| 250 | 250 | |
| 251 | 251 | /* zap the contents of the buffers */ |
| 252 | memset(buffer[0], 0, length * sizeof(*buffer[0])); | |
| 253 | memset(buffer[1], 0, length * sizeof(*buffer[1])); | |
| 252 | memset(outputs[0], 0, samples * sizeof(*outputs[0])); | |
| 253 | memset(outputs[1], 0, samples * sizeof(*outputs[1])); | |
| 254 | 254 | |
| 255 | 255 | /* if no sound, we're done */ |
| 256 | 256 | if (chip->sound_enable == 0) |
| r3957 | r3958 | |
| 259 | 259 | /* loop over each voice and add its contribution */ |
| 260 | 260 | for (voice = chip->channel_list; voice < chip->last_channel; voice++) |
| 261 | 261 | { |
| 262 | stream_sample_t *lmix = buffer[0]; | |
| 263 | stream_sample_t *rmix = buffer[1]; | |
| 262 | stream_sample_t *lmix = outputs[0]; | |
| 263 | stream_sample_t *rmix = outputs[1]; | |
| 264 | 264 | int lv = voice->volume[0]; |
| 265 | 265 | int rv = voice->volume[1]; |
| 266 | 266 | |
| r3957 | r3958 | |
| 280 | 280 | int i; |
| 281 | 281 | |
| 282 | 282 | /* add our contribution */ |
| 283 | for (i = 0; i < le | |
| 283 | for (i = 0; i < samples | |
| 284 | 284 | { |
| 285 | 285 | int cnt; |
| 286 | 286 | |
| r3957 | r3958 | |
| 333 | 333 | const INT16 *lw = &chip->waveform[lv][voice->waveform_select * 32]; |
| 334 | 334 | |
| 335 | 335 | /* generate sound into the buffer */ |
| 336 | c = namco_update_one(chip, lmix, le | |
| 336 | c = namco_update_one(chip, lmix, samples | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /* only update if we have non-zero right volume */ |
| r3957 | r3958 | |
| 342 | 342 | const INT16 *rw = &chip->waveform[rv][voice->waveform_select * 32]; |
| 343 | 343 | |
| 344 | 344 | /* generate sound into the buffer */ |
| 345 | c = namco_update_one(chip, rmix, le | |
| 345 | c = namco_update_one(chip, rmix, samples | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /* update the counter for this voice */ |
| r3957 | r3958 | |
| 820 | 820 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 821 | 821 | |
| 822 | 822 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 823 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco ); break; | |
| 824 | case SNDINFO_PTR_START: info->start = SND_START_NAME( namco ); break; | |
| 825 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 826 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 823 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco ); break; | |
| 824 | case SNDINFO_PTR_START: info->start = SND_START_NAME( namco ); break; | |
| 825 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 826 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 827 | 827 | |
| 828 | 828 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 829 | case SNDINFO_STR_NAME: info->s = "Namco"; break; | |
| 830 | case SNDINFO_STR_CORE_FAMILY: info->s = "Namco custom"; break; | |
| 831 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 832 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 833 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 829 | case SNDINFO_STR_NAME: strcpy(info->s, "Namco"); break; | |
| 830 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Namco custom"); break; | |
| 831 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 832 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 833 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 834 | 834 | } |
| 835 | 835 | } |
| 836 | 836 | |
| r3957 | r3958 | |
| 856 | 856 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 857 | 857 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_15xx ); break; |
| 858 | 858 | case SNDINFO_PTR_START: info->start = SND_START_NAME( namco ); break; |
| 859 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 860 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 859 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 860 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 861 | 861 | |
| 862 | 862 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 863 | case SNDINFO_STR_NAME: info->s = "Namco 15XX"; break; | |
| 864 | case SNDINFO_STR_CORE_FAMILY: info->s = "Namco custom"; break; | |
| 865 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 866 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 867 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 863 | case SNDINFO_STR_NAME: strcpy(info->s, "Namco 15XX"); break; | |
| 864 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Namco custom"); break; | |
| 865 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 866 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 867 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 868 | 868 | } |
| 869 | 869 | } |
| 870 | 870 | |
| r3957 | r3958 | |
| 890 | 890 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 891 | 891 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_cus30 ); break; |
| 892 | 892 | case SNDINFO_PTR_START: info->start = SND_START_NAME( namco ); break; |
| 893 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 894 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 893 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 894 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 895 | 895 | |
| 896 | 896 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 897 | case SNDINFO_STR_NAME: info->s = "Namco CUS30"; break; | |
| 898 | case SNDINFO_STR_CORE_FAMILY: info->s = "Namco custom"; break; | |
| 899 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 900 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 901 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 897 | case SNDINFO_STR_NAME: strcpy(info->s, "Namco CUS30"); break; | |
| 898 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Namco custom"); break; | |
| 899 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 900 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 901 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 902 | 902 | } |
| 903 | 903 | } |
| 904 | 904 |
| r3957 | r3958 | |
|---|---|---|
| 1959 | 1959 | * |
| 1960 | 1960 | *****************************************************************************/ |
| 1961 | 1961 | |
| 1962 | static | |
| 1962 | static STREAM_UPDATE( SN76477_update | |
| 1963 | 1963 | { |
| 1964 | 1964 | double one_shot_cap_charging_step; |
| 1965 | 1965 | double one_shot_cap_discharging_step; |
| r3957 | r3958 | |
| 1979 | 1979 | double center_to_peak_voltage_out; |
| 1980 | 1980 | |
| 1981 | 1981 | struct SN76477 *sn = param; |
| 1982 | stream_sample_t *buffer = | |
| 1982 | stream_sample_t *buffer = o | |
| 1983 | 1983 | |
| 1984 | 1984 | |
| 1985 | 1985 | #if TEST_MODE |
| r3957 | r3958 | |
| 2017 | 2017 | center_to_peak_voltage_out = compute_center_to_peak_voltage_out(sn); |
| 2018 | 2018 | |
| 2019 | 2019 | |
| 2020 | /* process 'length' number of samples */ | |
| 2021 | while (length--) | |
| 2020 | /* process 'samples' number of samples */ | |
| 2021 | while (samples--) | |
| 2022 | 2022 | { |
| 2023 | 2023 | /* update the one-shot cap voltage */ |
| 2024 | 2024 | if (!sn->one_shot_cap_voltage_ext) |
| r3957 | r3958 | |
| 2476 | 2476 | { |
| 2477 | 2477 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76477 ); break; |
| 2478 | 2478 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( sn76477 ); break; |
| 2479 | case SNDINFO_STR_NAME: info->s = "SN76477"; break; | |
| 2480 | case SNDINFO_STR_CORE_FAMILY: info->s = "Analog"; break; | |
| 2481 | case SNDINFO_STR_CORE_VERSION: info->s = "2.1"; break; | |
| 2482 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 2483 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 2479 | case SNDINFO_STR_NAME: strcpy(info->s, "SN76477"); break; | |
| 2480 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Analog"); break; | |
| 2481 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "2.1"); break; | |
| 2482 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 2483 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 2484 | 2484 | } |
| 2485 | 2485 | } |
| 2486 | 2486 |
| r3957 | r3958 | |
|---|---|---|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /* decode and buffering data */ |
| 290 | static | |
| 290 | static STREAM_UPDATE( vlm5030_update_callback | |
| 291 | 291 | { |
| 292 | 292 | struct vlm5030_info *chip = param; |
| 293 | 293 | int buf_count=0; |
| 294 | 294 | int interp_effect; |
| 295 | 295 | int i; |
| 296 | 296 | int u[11]; |
| 297 | stream_sample_t *buffer = | |
| 297 | stream_sample_t *buffer = o | |
| 298 | 298 | |
| 299 | 299 | /* running */ |
| 300 | 300 | if( chip->phase == PH_RUN || chip->phase == PH_STOP ) |
| 301 | 301 | { |
| 302 | 302 | /* playing speech */ |
| 303 | while (le | |
| 303 | while (samples | |
| 304 | 304 | { |
| 305 | 305 | int current_val; |
| 306 | 306 | |
| r3957 | r3958 | |
| 401 | 401 | if (chip->pitch_count >= chip->current_pitch ) |
| 402 | 402 | chip->pitch_count = 0; |
| 403 | 403 | /* size */ |
| 404 | le | |
| 404 | samples | |
| 405 | 405 | } |
| 406 | 406 | /* return;*/ |
| 407 | 407 | } |
| r3957 | r3958 | |
| 410 | 410 | switch( chip->phase ) |
| 411 | 411 | { |
| 412 | 412 | case PH_SETUP: |
| 413 | if( chip->sample_count <= le | |
| 413 | if( chip->sample_count <= samples | |
| 414 | 414 | { |
| 415 | 415 | chip->sample_count = 0; |
| 416 | 416 | /* logerror("VLM5030 BSY=H\n" ); */ |
| r3957 | r3958 | |
| 419 | 419 | } |
| 420 | 420 | else |
| 421 | 421 | { |
| 422 | chip->sample_count -= le | |
| 422 | chip->sample_count -= samples | |
| 423 | 423 | } |
| 424 | 424 | break; |
| 425 | 425 | case PH_END: |
| 426 | if( chip->sample_count <= le | |
| 426 | if( chip->sample_count <= samples | |
| 427 | 427 | { |
| 428 | 428 | chip->sample_count = 0; |
| 429 | 429 | /* logerror("VLM5030 BSY=L\n" ); */ |
| r3957 | r3958 | |
| 432 | 432 | } |
| 433 | 433 | else |
| 434 | 434 | { |
| 435 | chip->sample_count -= le | |
| 435 | chip->sample_count -= samples | |
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | 438 | /* silent buffering */ |
| 439 | while (le | |
| 439 | while (samples | |
| 440 | 440 | { |
| 441 | 441 | buffer[buf_count++] = 0x00; |
| 442 | le | |
| 442 | samples | |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | |
| r3957 | r3958 | |
| 714 | 714 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 715 | 715 | |
| 716 | 716 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 717 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( vlm5030 ); break; | |
| 718 | case SNDINFO_PTR_START: info->start = SND_START_NAME( vlm5030 ); break; | |
| 719 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 720 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( vlm5030 );break; | |
| 717 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( vlm5030 ); break; | |
| 718 | case SNDINFO_PTR_START: info->start = SND_START_NAME( vlm5030 ); break; | |
| 719 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 720 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( vlm5030 ); break; | |
| 721 | 721 | |
| 722 | 722 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 723 | case SNDINFO_STR_NAME: info->s = "VLM5030"; break; | |
| 724 | case SNDINFO_STR_CORE_FAMILY: info->s = "VLM speech"; break; | |
| 725 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 726 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 727 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 723 | case SNDINFO_STR_NAME: strcpy(info->s, "VLM5030"); break; | |
| 724 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "VLM speech"); break; | |
| 725 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 726 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 727 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 728 | 728 | } |
| 729 | 729 | } |
| 730 | 730 |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | /* static function prototypes */ |
| 36 | static | |
| 36 | static STREAM_UPDATE( tms5110_update | |
| 37 | 37 | |
| 38 | static int speech_rom_read_bit(void) | |
| 38 | static int speech_rom_read_bit(const device_config *device) | |
| 39 | 39 | { |
| 40 | 40 | struct tms5110_info *info = sndti_token(SOUND_TMS5110, 0); |
| 41 | 41 | |
| r3957 | r3958 | |
| 242 | 242 | |
| 243 | 243 | ******************************************************************************/ |
| 244 | 244 | |
| 245 | static | |
| 245 | static STREAM_UPDATE( tms5110_update | |
| 246 | 246 | { |
| 247 | 247 | struct tms5110_info *info = param; |
| 248 | 248 | INT16 sample_data[MAX_SAMPLE_CHUNK]; |
| 249 | stream_sample_t *buffer = | |
| 249 | stream_sample_t *buffer = o | |
| 250 | 250 | |
| 251 | 251 | /* loop while we still have samples to generate */ |
| 252 | while (le | |
| 252 | while (samples | |
| 253 | 253 | { |
| 254 | int | |
| 254 | int | |
| 255 | 255 | int index; |
| 256 | 256 | |
| 257 | 257 | /* generate the samples and copy to the target buffer */ |
| 258 | tms5110_process(info->chip, sample_data, samples); | |
| 259 | for (index = 0; index < samples; index++) | |
| 258 | tms5110_process(info->chip, sample_data, length); | |
| 259 | for (index = 0; index < length; index++) | |
| 260 | 260 | *buffer++ = sample_data[index]; |
| 261 | 261 | |
| 262 | 262 | /* account for the samples */ |
| 263 | le | |
| 263 | samples | |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| r3957 | r3958 | |
| 298 | 298 | switch (state) |
| 299 | 299 | { |
| 300 | 300 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 301 | case SNDINFO_INT_ALIAS: info->i = SOUND_TMS5110; break; | |
| 301 | case SNDINFO_INT_ALIAS: info->i = SOUND_TMS5110; break; | |
| 302 | 302 | |
| 303 | 303 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 304 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms5110 ); break; | |
| 305 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5110 ); break; | |
| 306 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( tms5110 ); break; | |
| 307 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( tms5110 ); break; | |
| 304 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms5110 ); break; | |
| 305 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5110 ); break; | |
| 306 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( tms5110 ); break; | |
| 307 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( tms5110 ); break; | |
| 308 | 308 | |
| 309 | 309 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 310 | case SNDINFO_STR_NAME: info->s = "TMS5110"; break; | |
| 311 | case SNDINFO_STR_CORE_FAMILY: info->s = "TI Speech"; break; | |
| 312 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 313 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 314 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 310 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS5110"); break; | |
| 311 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "TI Speech"); break; | |
| 312 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 313 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 314 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| r3957 | r3958 | |
| 319 | 319 | { |
| 320 | 320 | switch (state) |
| 321 | 321 | { |
| 322 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5100 ); break; | |
| 323 | case SNDINFO_STR_NAME: info->s = "TMS5100"; break; | |
| 324 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 322 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5100 ); break; | |
| 323 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS5100"); break; | |
| 324 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 325 | 325 | } |
| 326 | 326 | } |
| 327 | 327 | |
| r3957 | r3958 | |
| 329 | 329 | { |
| 330 | 330 | switch (state) |
| 331 | 331 | { |
| 332 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5110a ); break; | |
| 333 | case SNDINFO_STR_NAME: info->s = "TMS5100A"; break; | |
| 334 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 332 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tms5110a ); break; | |
| 333 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS5100A"); break; | |
| 334 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | |
| r3957 | r3958 | |
| 339 | 339 | { |
| 340 | 340 | switch (state) |
| 341 | 341 | { |
| 342 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cd2801 ); break; | |
| 343 | case SNDINFO_STR_NAME: info->s = "CD2801"; break; | |
| 344 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 342 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cd2801 ); break; | |
| 343 | case SNDINFO_STR_NAME: strcpy(info->s, "CD2801"); break; | |
| 344 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | |
| r3957 | r3958 | |
| 349 | 349 | { |
| 350 | 350 | switch (state) |
| 351 | 351 | { |
| 352 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tmc0281 ); break; | |
| 353 | case SNDINFO_STR_NAME: info->s = "TMS5100"; break; | |
| 354 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 352 | case SNDINFO_PTR_START: info->start = SND_START_NAME( tmc0281 ); break; | |
| 353 | case SNDINFO_STR_NAME: strcpy(info->s, "TMS5100"); break; | |
| 354 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
| r3957 | r3958 | |
| 359 | 359 | { |
| 360 | 360 | switch (state) |
| 361 | 361 | { |
| 362 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cd2802 ); break; | |
| 363 | case SNDINFO_STR_NAME: info->s = "CD2802"; break; | |
| 364 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 362 | case SNDINFO_PTR_START: info->start = SND_START_NAME( cd2802 ); break; | |
| 363 | case SNDINFO_STR_NAME: strcpy(info->s, "CD2802"); break; | |
| 364 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
| r3957 | r3958 | |
| 369 | 369 | { |
| 370 | 370 | switch (state) |
| 371 | 371 | { |
| 372 | case SNDINFO_PTR_START: info->start = SND_START_NAME( m58817 ); break; | |
| 373 | case SNDINFO_STR_NAME: info->s = "M58817"; break; | |
| 374 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 372 | case SNDINFO_PTR_START: info->start = SND_START_NAME( m58817 ); break; | |
| 373 | case SNDINFO_STR_NAME: strcpy(info->s, "M58817"); break; | |
| 374 | default: SND_GET_INFO_CALL(tms5110); break; | |
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 |
| r3957 | r3958 | |
|---|---|---|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | static | |
| 94 | static STREAM_UPDATE( ym2203_stream_update | |
| 95 | 95 | { |
| 96 | 96 | struct ym2203_info *info = param; |
| 97 | ym2203_update_one(info->chip, | |
| 97 | ym2203_update_one(info->chip, outputs[0], samples | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| r3957 | r3958 | |
| 349 | 349 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ym2203 ); break; |
| 350 | 350 | |
| 351 | 351 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 352 | case SNDINFO_STR_NAME: info->s = "YM2203"; break; | |
| 353 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 354 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 355 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 356 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 352 | case SNDINFO_STR_NAME: strcpy(info->s, "YM2203"); break; | |
| 353 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 354 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 355 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 356 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 357 | 357 | } |
| 358 | 358 | } |
| r3957 | r3958 | |
|---|---|---|
| 216 | 216 | /* Konami PCM update */ |
| 217 | 217 | /************************************************/ |
| 218 | 218 | |
| 219 | static | |
| 219 | static STREAM_UPDATE( KDAC_A_update | |
| 220 | 220 | { |
| 221 | 221 | struct kdacApcm *info = param; |
| 222 | 222 | int i; |
| 223 | 223 | |
| 224 | memset(buffer[0],0,buffer_len * sizeof(*buffer[0])); | |
| 225 | memset(buffer[1],0,buffer_len * sizeof(*buffer[1])); | |
| 224 | memset(outputs[0],0,samples * sizeof(*outputs[0])); | |
| 225 | memset(outputs[1],0,samples * sizeof(*outputs[1])); | |
| 226 | 226 | |
| 227 | 227 | for( i = 0; i < KDAC_A_PCM_MAX; i++ ) |
| 228 | 228 | { |
| r3957 | r3958 | |
| 242 | 242 | volB = (volB + cen) < 0x1fe ? (volB + cen) : 0x1fe; |
| 243 | 243 | #endif |
| 244 | 244 | |
| 245 | for( j = 0; j < | |
| 245 | for( j = 0; j < samp | |
| 246 | 246 | { |
| 247 | 247 | old_addr = addr; |
| 248 | 248 | addr = info->start[i] + ((info->addr[i]>>BASE_SHIFT)&0x000fffff); |
| r3957 | r3958 | |
| 282 | 282 | |
| 283 | 283 | out = (info->pcmbuf[i][addr] & 0x7f) - 0x40; |
| 284 | 284 | |
| 285 | buffer[0][j] += out * volA; | |
| 286 | buffer[1][j] += out * volB; | |
| 285 | outputs[0][j] += out * volA; | |
| 286 | outputs[1][j] += out * volB; | |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | } |
| r3957 | r3958 | |
| 494 | 494 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 495 | 495 | |
| 496 | 496 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 497 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k007232 ); break; | |
| 498 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k007232 ); break; | |
| 499 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 500 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 497 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k007232 ); break; | |
| 498 | case SNDINFO_PTR_START: info->start = SND_START_NAME( k007232 ); break; | |
| 499 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 500 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 501 | 501 | |
| 502 | 502 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 503 | case SNDINFO_STR_NAME: info->s = "K007232"; break; | |
| 504 | case SNDINFO_STR_CORE_FAMILY: info->s = "Konami custom"; break; | |
| 505 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 506 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 507 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 503 | case SNDINFO_STR_NAME: strcpy(info->s, "K007232"); break; | |
| 504 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Konami custom"); break; | |
| 505 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 506 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 507 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | typedef struct _tms5110_interface tms5110_interface; |
| 11 | 11 | struct _tms5110_interface |
| 12 | 12 | { |
| 13 | int (*M0_callback)(void); /* function to be called when chip requests another bit */ | |
| 13 | int (*M0_callback)(const device_config *device); /* function to be called when chip requests another bit */ | |
| 14 | 14 | void (*load_address)(int addr); /* speech ROM load address callback */ |
| 15 | 15 | }; |
| 16 | 16 |
| r3957 | r3958 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | ***********************************************************************************************/ |
| 122 | 122 | |
| 123 | static | |
| 123 | static STREAM_UPDATE( okim6258_update | |
| 124 | 124 | { |
| 125 | 125 | struct okim6258 *chip = param; |
| 126 | 126 | stream_sample_t *buffer = outputs[0]; |
| r3957 | r3958 | |
| 478 | 478 | |
| 479 | 479 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 480 | 480 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME(okim6258); break; |
| 481 | case SNDINFO_PTR_START: info->start = SND_START_NAME(okim6258); break; | |
| 482 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 483 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME(okim6258); break; | |
| 481 | case SNDINFO_PTR_START: info->start = SND_START_NAME(okim6258); break; | |
| 482 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 483 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME(okim6258); break; | |
| 484 | 484 | |
| 485 | 485 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 486 | case SNDINFO_STR_NAME: info->s = "OKI6258"; break; | |
| 487 | case SNDINFO_STR_CORE_FAMILY: info->s = "OKI ADPCM"; break; | |
| 488 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 489 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 490 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 486 | case SNDINFO_STR_NAME: strcpy(info->s, "OKI6258"); break; | |
| 487 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "OKI ADPCM"); break; | |
| 488 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 489 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 490 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 491 | 491 | } |
| 492 | 492 | } |
| 493 | 493 |
| r3957 | r3958 | |
|---|---|---|
| 141 | 141 | stream_update(chip->stream); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | static | |
| 144 | static STREAM_UPDATE( es5503_pcm_update | |
| 145 | 145 | { |
| 146 | 146 | INT32 mix[48000*2]; |
| 147 | 147 | INT32 *mixp; |
| r3957 | r3958 | |
| 169 | 169 | int resshift = resshifts[pOsc->resolution] - pOsc->wavetblsize; |
| 170 | 170 | UINT32 sizemask = accmasks[pOsc->wavetblsize]; |
| 171 | 171 | |
| 172 | for (snum = 0; snum < le | |
| 172 | for (snum = 0; snum < samples | |
| 173 | 173 | { |
| 174 | 174 | ramptr = (acc >> resshift) & sizemask; |
| 175 | 175 | altram = acc >> resshift; |
| r3957 | r3958 | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | mixp = &mix[0]; |
| 219 | for (i = 0; i < le | |
| 219 | for (i = 0; i < samples | |
| 220 | 220 | { |
| 221 | 221 | outputs[0][i] = (*mixp++)>>1; |
| 222 | 222 | outputs[1][i] = (*mixp++)>>1; |
| r3957 | r3958 | |
| 534 | 534 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 535 | 535 | |
| 536 | 536 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 537 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es5503 ); break; | |
| 538 | case SNDINFO_PTR_START: info->start = SND_START_NAME( es5503 ); break; | |
| 539 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 540 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 537 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es5503 ); break; | |
| 538 | case SNDINFO_PTR_START: info->start = SND_START_NAME( es5503 ); break; | |
| 539 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 540 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 541 | 541 | |
| 542 | 542 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 543 | case SNDINFO_STR_NAME: info->s = "ES5503"; break; | |
| 544 | case SNDINFO_STR_CORE_FAMILY: info->s = "Ensoniq ES550x"; break; | |
| 545 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 546 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 547 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright R. Belmont"; break; | |
| 543 | case SNDINFO_STR_NAME: strcpy(info->s, "ES5503"); break; | |
| 544 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Ensoniq ES550x"); break; | |
| 545 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 546 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 547 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright R. Belmont"); break; | |
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 |
| r3957 | r3958 | |
|---|---|---|
| 131 | 131 | // printf("v%02d: %04x to reg %02d (PC=%x)\n", v, nile_sound_regs[offset], r, cpu_get_pc(space->cpu)); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | static | |
| 134 | static STREAM_UPDATE( nile_update | |
| 135 | 135 | { |
| 136 | 136 | struct nile_info *info = param; |
| 137 | 137 | UINT8 *sound_ram = info->sound_ram; |
| r3957 | r3958 | |
| 144 | 144 | |
| 145 | 145 | lsptr=leptr=0; |
| 146 | 146 | |
| 147 | memset(mix, 0, sizeof(mix[0])*le | |
| 147 | memset(mix, 0, sizeof(mix[0])*samples | |
| 148 | 148 | |
| 149 | 149 | for (v = 0; v < NILE_VOICES; v++) |
| 150 | 150 | { |
| r3957 | r3958 | |
| 161 | 161 | lsptr = slot[NILE_REG_LSPTR_HI]<<16 | slot[NILE_REG_LSPTR_LO]; |
| 162 | 162 | leptr = slot[NILE_REG_LEPTR_HI]<<16 | slot[NILE_REG_LEPTR_LO]; |
| 163 | 163 | |
| 164 | for (snum = 0; snum < le | |
| 164 | for (snum = 0; snum < samples | |
| 165 | 165 | { |
| 166 | 166 | sample = sound_ram[sptr + info->vpos[v]]<<8; |
| 167 | 167 | |
| r3957 | r3958 | |
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | mixp = &mix[0]; |
| 212 | for (i = 0; i < le | |
| 212 | for (i = 0; i < samples | |
| 213 | 213 | { |
| 214 | 214 | outputs[0][i] = (*mixp++)>>4; |
| 215 | 215 | outputs[1][i] = (*mixp++)>>4; |
| r3957 | r3958 | |
| 252 | 252 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 253 | 253 | |
| 254 | 254 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 255 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( nile ); break; | |
| 256 | case SNDINFO_PTR_START: info->start = SND_START_NAME( nile ); break; | |
| 257 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 258 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 255 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( nile ); break; | |
| 256 | case SNDINFO_PTR_START: info->start = SND_START_NAME( nile ); break; | |
| 257 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 258 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 259 | 259 | |
| 260 | 260 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 261 | case SNDINFO_STR_NAME: info->s = "NiLe"; break; | |
| 262 | case SNDINFO_STR_CORE_FAMILY: info->s = "Seta custom"; break; | |
| 263 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 264 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 265 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 261 | case SNDINFO_STR_NAME: strcpy(info->s, "NiLe"); break; | |
| 262 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Seta custom"); break; | |
| 263 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 264 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 265 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 |
| r3957 | r3958 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | ***********************************************************************************************/ |
| 167 | 167 | |
| 168 | static | |
| 168 | static STREAM_UPDATE( es8712_update | |
| 169 | 169 | { |
| 170 | 170 | stream_sample_t *buffer = outputs[0]; |
| 171 | 171 | struct es8712 *chip = param; |
| r3957 | r3958 | |
| 452 | 452 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 453 | 453 | |
| 454 | 454 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 455 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es8712 ); break; | |
| 456 | case SNDINFO_PTR_START: info->start = SND_START_NAME( es8712 ); break; | |
| 457 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 458 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( es8712 ); break; | |
| 455 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es8712 ); break; | |
| 456 | case SNDINFO_PTR_START: info->start = SND_START_NAME( es8712 ); break; | |
| 457 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 458 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( es8712 ); break; | |
| 459 | 459 | |
| 460 | 460 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 461 | case SNDINFO_STR_NAME: info->s = "ES8712"; break; | |
| 462 | case SNDINFO_STR_CORE_FAMILY: info->s = "Excellent Systems ADPCM"; break; | |
| 463 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 464 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 465 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 461 | case SNDINFO_STR_NAME: strcpy(info->s, "ES8712"); break; | |
| 462 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Excellent Systems ADPCM"); break; | |
| 463 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 464 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 465 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 466 | 466 | } |
| 467 | 467 | } |
| 468 | 468 |
| r3957 | r3958 | |
|---|---|---|
| 48 | 48 | #include "cpuexec.h" |
| 49 | 49 | #include "streams.h" |
| 50 | 50 | #include "nes_apu.h" |
| 51 | #include "driver.h" | |
| 51 | 52 | #include "cpu/m6502/m6502.h" |
| 52 | 53 | |
| 53 | 54 | #include "nes_defs.h" |
| r3957 | r3958 | |
| 659 | 660 | WRITE8_HANDLER( nes_psg_1_w ) {apu_write(1,offset,data);} |
| 660 | 661 | |
| 661 | 662 | /* UPDATE APU SYSTEM */ |
| 662 | static | |
| 663 | static STREAM_UPDATE( nes_psg_update_sound | |
| 663 | 664 | { |
| 664 | 665 | struct nesapu_info *info = param; |
| 665 | apu_update(info, | |
| 666 | apu_update(info, outputs[0], samples | |
| 666 | 667 | } |
| 667 | 668 | |
| 668 | 669 | |
| r3957 | r3958 | |
| 775 | 776 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 776 | 777 | |
| 777 | 778 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 778 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( nesapu ); break; | |
| 779 | case SNDINFO_PTR_START: info->start = SND_START_NAME( nesapu ); break; | |
| 780 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 781 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 779 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( nesapu ); break; | |
| 780 | case SNDINFO_PTR_START: info->start = SND_START_NAME( nesapu ); break; | |
| 781 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 782 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 782 | 783 | |
| 783 | 784 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 784 | case SNDINFO_STR_NAME: info->s = "N2A03"; break; | |
| 785 | case SNDINFO_STR_CORE_FAMILY: info->s = "Nintendo custom"; break; | |
| 786 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 787 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 788 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 785 | case SNDINFO_STR_NAME: strcpy(info->s, "N2A03"); break; | |
| 786 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Nintendo custom"); break; | |
| 787 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 788 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 789 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 789 | 790 | } |
| 790 | 791 | } |
| 791 | 792 |
| r3957 | r3958 | |
|---|---|---|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | static | |
| 57 | static STREAM_UPDATE( ymf262_stream_update | |
| 58 | 58 | { |
| 59 | 59 | struct ymf262_info *info = param; |
| 60 | ymf262_update_one(info->chip, | |
| 60 | ymf262_update_one(info->chip, outputs, samples | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static void _stream_update(void *param, int interval) |
| r3957 | r3958 | |
| 181 | 181 | case SNDINFO_PTR_RESET: info->reset = SND_RESET_NAME( ymf262 ); break; |
| 182 | 182 | |
| 183 | 183 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 184 | case SNDINFO_STR_NAME: info->s = "YMF262"; break; | |
| 185 | case SNDINFO_STR_CORE_FAMILY: info->s = "Yamaha FM"; break; | |
| 186 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 187 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 188 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 184 | case SNDINFO_STR_NAME: strcpy(info->s, "YMF262"); break; | |
| 185 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Yamaha FM"); break; | |
| 186 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 187 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 188 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 |
| r3957 | r3958 | |
|---|---|---|
| 983 | 983 | astring *game_info_astring(running_machine *machine, astring *string) |
| 984 | 984 | { |
| 985 | 985 | int scrcount = video_screen_count(machine->config); |
| 986 | int cpunum, sndnum; | |
| 986 | const device_config *scandevice; | |
| 987 | const device_config *device; | |
| 988 | int sndnum; | |
| 987 | 989 | int count; |
| 988 | 990 | |
| 989 | 991 | /* print description, manufacturer, and CPU: */ |
| 990 | 992 | astring_printf(string, "%s\n%s %s\n\nCPU:\n", machine->gamedrv->description, machine->gamedrv->year, machine->gamedrv->manufacturer); |
| 991 | 993 | |
| 992 | 994 | /* loop over all CPUs */ |
| 993 | for (c | |
| 995 | for (device | |
| 994 | 996 | { |
| 995 | cpu_type type = machine->config->cpu[cpunum].type; | |
| 996 | int clock = machine->config->cpu[cpunum].clock; | |
| 997 | ||
| 998 | 997 | /* count how many identical CPUs we have */ |
| 999 | for (count = 1; cpunum + count < MAX_CPU; count++) | |
| 1000 | if (machine->config->cpu[cpunum + count].type != type || | |
| 1001 | machine->config->cpu[cpunum + count].clock != clock) | |
| 1002 | break; | |
| 998 | count = 1; | |
| 999 | for (scandevice = device->typenext; scandevice != NULL; scandevice = scandevice->typenext) | |
| 1000 | { | |
| 1001 | if (cpu_get_type(device) != cpu_get_type(scandevice) || device->clock != scandevice->clock) | |
| 1002 | break; | |
| 1003 | count++; | |
| 1004 | } | |
| 1003 | 1005 | |
| 1004 | 1006 | /* if more than one, prepend a #x in front of the CPU name */ |
| 1005 | 1007 | if (count > 1) |
| 1006 | 1008 | astring_catprintf(string, "%d" UTF8_MULTIPLY, count); |
| 1007 | astring_catc(string, cpu | |
| 1009 | astring_catc(string, cpu | |
| 1008 | 1010 | |
| 1009 | 1011 | /* display clock in kHz or MHz */ |
| 1010 | if (clock >= 1000000) | |
| 1011 | astring_catprintf(string, " %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000); | |
| 1012 | if (device->clock >= 1000000) | |
| 1013 | astring_catprintf(string, " %d.%06d" UTF8_NBSP "MHz\n", device->clock / 1000000, device->clock % 1000000); | |
| 1012 | 1014 | else |
| 1013 | astring_catprintf(string, " %d.%03d" UTF8_NBSP "kHz\n", clock / 1000, clock % 1000); | |
| 1015 | astring_catprintf(string, " %d.%03d" UTF8_NBSP "kHz\n", device->clock / 1000, device->clock % 1000); | |
| 1014 | 1016 | } |
| 1015 | 1017 | |
| 1016 | 1018 | /* loop over all sound chips */ |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /*************************************************************************** |
| 25 | TYPE DEFINITIONS | |
| 26 | ***************************************************************************/ | |
| 27 | ||
| 28 | typedef struct _machine_entry machine_entry; | |
| 29 | struct _machine_entry | |
| 30 | { | |
| 31 | machine_entry * next; | |
| 32 | running_machine * machine; | |
| 33 | }; | |
| 34 | ||
| 35 | ||
| 36 | ||
| 37 | /*************************************************************************** | |
| 38 | GLOBAL VARIABLES | |
| 39 | ***************************************************************************/ | |
| 40 | ||
| 41 | static machine_entry *machine_list; | |
| 42 | static int atexit_registered; | |
| 43 | ||
| 44 | ||
| 45 | ||
| 46 | /*************************************************************************** | |
| 25 | 47 | FUNCTION PROTOTYPES |
| 26 | 48 | ***************************************************************************/ |
| 27 | 49 | |
| 28 | static void debugger_ | |
| 50 | static void debugger_exi | |
| 29 | 51 | |
| 30 | 52 | |
| 31 | 53 | |
| r3957 | r3958 | |
| 42 | 64 | /* only if debugging is enabled */ |
| 43 | 65 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| 44 | 66 | { |
| 67 | machine_entry *entry; | |
| 68 | ||
| 69 | /* initialize the submodules */ | |
| 45 | 70 | debug_cpu_init(machine); |
| 46 | 71 | debug_command_init(machine); |
| 47 | 72 | debug_console_init(machine); |
| 48 | 73 | debug_view_init(machine); |
| 49 | 74 | debug_comment_init(machine); |
| 50 | atexit(debugger_flush_traces); | |
| 75 | ||
| 76 | /* allocate a new entry for our global list */ | |
| 77 | add_exit_callback(machine, debugger_exit); | |
| 78 | entry = malloc_or_die(sizeof(*entry)); | |
| 79 | entry->next = machine_list; | |
| 80 | entry->machine = machine; | |
| 81 | machine_list = entry; | |
| 82 | ||
| 83 | /* register an atexit handler if we haven't yet */ | |
| 84 | if (!atexit_registered) | |
| 85 | atexit(debugger_flush_all_traces_on_abnormal_exit); | |
| 86 | atexit_registered = TRUE; | |
| 87 | ||
| 88 | /* listen in on the errorlog */ | |
| 51 | 89 | add_logerror_callback(machine, debug_errorlog_write_line); |
| 52 | 90 | } |
| 53 | 91 | } |
| r3957 | r3958 | |
| 65 | 103 | |
| 66 | 104 | |
| 67 | 105 | /*------------------------------------------------- |
| 68 | debugger_flush_traces - flush any traces in | |
| 69 | the event of an aborted execution | |
| 106 | debugger_exit - remove ourself from the | |
| 107 | global list of active machines for cleanup | |
| 70 | 108 | -------------------------------------------------*/ |
| 71 | 109 | |
| 72 | static void debugger_ | |
| 110 | static void debugger_exi | |
| 73 | 111 | { |
| 74 | extern running_machine *Machine; | |
| 75 | if (Machine != NULL) | |
| 76 | debug_cpu_flush_traces(Machine); | |
| 112 | machine_entry **entryptr; | |
| 113 | ||
| 114 | /* remove this machine from the list; it came down cleanly */ | |
| 115 | for (entryptr = &machine_list; *entryptr != NULL; entryptr = &(*entryptr)->next) | |
| 116 | if ((*entryptr)->machine == machine) | |
| 117 | { | |
| 118 | machine_entry *deleteme = *entryptr; | |
| 119 | *entryptr = deleteme->next; | |
| 120 | free(deleteme); | |
| 121 | break; | |
| 122 | } | |
| 77 | 123 | } |
| 124 | ||
| 125 | ||
| 126 | /*------------------------------------------------- | |
| 127 | debugger_flush_all_traces_on_abnormal_exit - | |
| 128 | flush any traces in the event of an aborted | |
| 129 | execution | |
| 130 | -------------------------------------------------*/ | |
| 131 | ||
| 132 | void debugger_flush_all_traces_on_abnormal_exit(void) | |
| 133 | { | |
| 134 | /* clear out the machine list and flush traces on each one */ | |
| 135 | while (machine_list != NULL) | |
| 136 | { | |
| 137 | machine_entry *deleteme = machine_list; | |
| 138 | debug_cpu_flush_traces(deleteme->machine); | |
| 139 | machine_list = deleteme->next; | |
| 140 | free(deleteme); | |
| 141 | } | |
| 142 | } |
| r3957 | r3958 | |
|---|---|---|
| 578 | 578 | |
| 579 | 579 | static DEVICE_GET_INFO( sndclass ) |
| 580 | 580 | { |
| 581 | sndintrf_data *snddata = device-> | |
| 581 | sndintrf_data *snddata = device->inlin | |
| 582 | 582 | (*snddata->intf.get_info)(device, state, (sndinfo *)info); |
| 583 | 583 | } |
| 584 | 584 | |
| r3957 | r3958 | |
| 595 | 595 | info->device->static_config = config; |
| 596 | 596 | info->device->region = memory_region(info->device->machine, info->device->tag); |
| 597 | 597 | info->device->regionbytes = memory_region_length(info->device->machine, info->device->tag); |
| 598 | info->device->classtoken = info; | |
| 599 | 598 | |
| 599 | /* hack: stash the info pointer in the inline_config */ | |
| 600 | info->device->inline_config = info; | |
| 601 | ||
| 600 | 602 | /* fill in the type and interface */ |
| 601 | 603 | info->intf = snd_type_header[sndtype]; |
| 602 | 604 | info->tag = tag; |
| r3957 | r3958 | |
| 754 | 756 | |
| 755 | 757 | const char *sndnum_get_info_string(int sndnum, UINT32 state) |
| 756 | 758 | { |
| 759 | extern char *get_temp_string_buffer(void); | |
| 757 | 760 | sndinfo info; |
| 758 | 761 | |
| 759 | 762 | VERIFY_SNDNUM(sndnum_get_info_string); |
| 760 | info.s = | |
| 763 | info.s = get_temp_string_buffer(); | |
| 761 | 764 | (*sound[sndnum].intf.get_info)(sound[sndnum].device, state, &info); |
| 762 | 765 | return info.s; |
| 763 | 766 | } |
| r3957 | r3958 | |
| 863 | 866 | |
| 864 | 867 | const char *sndti_get_info_string(sound_type sndtype, int sndindex, UINT32 state) |
| 865 | 868 | { |
| 869 | extern char *get_temp_string_buffer(void); | |
| 866 | 870 | sndinfo info; |
| 867 | 871 | int sndnum; |
| 868 | 872 | |
| 869 | 873 | VERIFY_SNDTI(sndti_get_info_string); |
| 870 | 874 | sndnum = sound_matrix[sndtype][sndindex] - 1; |
| 871 | info.s = | |
| 875 | info.s = get_temp_string_buffer(); | |
| 872 | 876 | (*sound[sndnum].intf.get_info)(sound[sndnum].device, state, &info); |
| 873 | 877 | return info.s; |
| 874 | 878 | } |
| r3957 | r3958 | |
| 987 | 991 | |
| 988 | 992 | const char *sndtype_get_info_string(sound_type sndtype, UINT32 state) |
| 989 | 993 | { |
| 994 | extern char *get_temp_string_buffer(void); | |
| 990 | 995 | snd_class_header *classheader = &snd_type_header[sndtype]; |
| 991 | 996 | sndinfo info; |
| 992 | 997 | |
| 993 | 998 | VERIFY_SNDTYPE(sndtype_get_info_string); |
| 994 | info.s = | |
| 999 | info.s = get_temp_string_buffer(); | |
| 995 | 1000 | (*classheader->get_info)(NULL, state, &info); |
| 996 | 1001 | return info.s; |
| 997 | 1002 | } |
| r3957 | r3958 | |
| 1031 | 1036 | case SNDINFO_PTR_RESET: /* Nothing */ break; |
| 1032 | 1037 | |
| 1033 | 1038 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1034 | case SNDINFO_STR_NAME: info->s = "Dummy"; break; | |
| 1035 | case SNDINFO_STR_CORE_FAMILY: info->s = "Dummy"; break; | |
| 1036 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 1037 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; | |
| 1038 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1039 | case SNDINFO_STR_NAME: strcpy(info->s, "Dummy"); break; | |
| 1040 | case SNDINFO_STR_CORE_FAMILY: strcpy(info->s, "Dummy"); break; | |
| 1041 | case SNDINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; | |
| 1042 | case SNDINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; | |
| 1043 | case SNDINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1039 | 1044 | } |
| 1040 | 1045 | } |
| r3957 | r3958 | |
|---|---|---|
| 118 | 118 | static TIMER_CALLBACK( sound_update ); |
| 119 | 119 | static void start_sound_chips(running_machine *machine); |
| 120 | 120 | static void route_sound(running_machine *machine); |
| 121 | static | |
| 121 | static STREAM_UPDATE( mixer_update | |
| 122 | 122 | static STATE_POSTLOAD( mixer_postload ); |
| 123 | 123 | |
| 124 | 124 | |
| r3957 | r3958 | |
| 770 | 770 | mixer_update - mix all inputs to one output |
| 771 | 771 | -------------------------------------------------*/ |
| 772 | 772 | |
| 773 | static | |
| 773 | static STREAM_UPDATE( mixer_update | |
| 774 | 774 | { |
| 775 | 775 | speaker_info *speaker = param; |
| 776 | 776 | int numinputs = speaker->inputs; |
| 777 | 777 | int pos; |
| 778 | 778 | |
| 779 | VPRINTF(("Mixer_update(%d)\n", le | |
| 779 | VPRINTF(("Mixer_update(%d)\n", samples | |
| 780 | 780 | |
| 781 | 781 | /* loop over samples */ |
| 782 | for (pos = 0; pos < le | |
| 782 | for (pos = 0; pos < samples | |
| 783 | 783 | { |
| 784 | 784 | INT32 sample = inputs[0][pos]; |
| 785 | 785 | int inp; |
| r3957 | r3958 | |
| 787 | 787 | /* add up all the inputs */ |
| 788 | 788 | for (inp = 1; inp < numinputs; inp++) |
| 789 | 789 | sample += inputs[inp][pos]; |
| 790 | | |
| 790 | outputs[0][pos] = sample; | |
| 791 | 791 | } |
| 792 | 792 | } |
| 793 | 793 | |
| r3957 | r3958 | |
| 878 | 878 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 879 | 879 | |
| 880 | 880 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 881 | case DEVINFO_STR_NAME: info->s = "Speaker"; break; | |
| 882 | case DEVINFO_STR_FAMILY: info->s = "Sound"; break; | |
| 883 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 884 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 885 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 881 | case DEVINFO_STR_NAME: strcpy(info->s, "Speaker"); break; | |
| 882 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Sound"); break; | |
| 883 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 884 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 885 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 886 | 886 | } |
| 887 | 887 | } |
| 888 | 888 |
| r3957 | r3958 | |
|---|---|---|
| 30 | 30 | /* redraw the current video display */ |
| 31 | 31 | void debugger_refresh_display(running_machine *machine); |
| 32 | 32 | |
| 33 | /* OSD can call this to safely flush all traces in the event of a crash */ | |
| 34 | void debugger_flush_all_traces_on_abnormal_exit(void); | |
| 33 | 35 | |
| 34 | 36 | |
| 37 | ||
| 35 | 38 | /*************************************************************************** |
| 36 | 39 | CPU CORE INLINE FUNCTIONS |
| 37 | 40 | ***************************************************************************/ |
| r3957 | r3958 | |
|---|---|---|
| 235 | 235 | INT64 i; /* generic integers */ |
| 236 | 236 | void * p; /* generic pointers */ |
| 237 | 237 | genf * f; /* generic function pointers */ |
| 238 | c | |
| 238 | c | |
| 239 | 239 | |
| 240 | 240 | snd_set_info_func set_info; /* SNDINFO_PTR_SET_INFO */ |
| 241 | 241 | snd_start_func start; /* SNDINFO_PTR_START */ |
| r3957 | r3958 | |
|---|---|---|
| 337 | 337 | { |
| 338 | 338 | /* since print_mame_xml expands the machine driver, we need to set things up */ |
| 339 | 339 | init_resource_tracking(); |
| 340 | cpuintrf_init(NULL); | |
| 341 | 340 | sndintrf_init(NULL); |
| 342 | 341 | |
| 343 | 342 | print_mame_xml(stdout, drivers, gamename); |
| r3957 | r3958 | |
| 559 | 558 | |
| 560 | 559 | /* since we expand the machine driver, we need to set things up */ |
| 561 | 560 | init_resource_tracking(); |
| 562 | cpuintrf_init(NULL); | |
| 563 | 561 | sndintrf_init(NULL); |
| 564 | 562 | |
| 565 | 563 | /* iterate over drivers */ |
| r3957 | r3958 | |
|---|---|---|
| 1290 | 1290 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 1291 | 1291 | |
| 1292 | 1292 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1293 | case DEVINFO_STR_NAME: info->s = "Generic"; break; | |
| 1294 | case DEVINFO_STR_FAMILY: info->s = "Timer"; break; | |
| 1295 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1296 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1297 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1293 | case DEVINFO_STR_NAME: strcpy(info->s, "Generic"); break; | |
| 1294 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Timer"); break; | |
| 1295 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1296 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1297 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 1298 | 1298 | } |
| 1299 | 1299 | } |
| r3957 | r3958 | |
|---|---|---|
| 23 | 23 | FUNCTION PROTOTYPES |
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens, const c | |
| 26 | static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens, const devic | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | |
| r3957 | r3958 | |
| 58 | 58 | |
| 59 | 59 | void machine_config_free(machine_config *config) |
| 60 | 60 | { |
| 61 | int | |
| 61 | int | |
| 62 | 62 | |
| 63 | 63 | /* release the device list */ |
| 64 | 64 | while (config->devicelist != NULL) |
| 65 | 65 | device_list_remove(&config->devicelist, config->devicelist->type, config->devicelist->tag); |
| 66 | 66 | |
| 67 | 67 | /* release the strings */ |
| 68 | for (cpunum = 0; cpunum < ARRAY_LENGTH(config->cputag); cpunum++) | |
| 69 | if (config->cputag[cpunum] != NULL) | |
| 70 | astring_free(config->cputag[cpunum]); | |
| 71 | 68 | for (soundnum = 0; soundnum < ARRAY_LENGTH(config->soundtag); soundnum++) |
| 72 | 69 | if (config->soundtag[soundnum] != NULL) |
| 73 | 70 | astring_free(config->soundtag[soundnum]); |
| r3957 | r3958 | |
| 78 | 75 | |
| 79 | 76 | |
| 80 | 77 | /*------------------------------------------------- |
| 81 | cpu_add - add a CPU during machine driver | |
| 82 | expansion | |
| 83 | -------------------------------------------------*/ | |
| 84 | ||
| 85 | static cpu_config *cpu_add(machine_config *machine, const char *tag, cpu_type type, int cpuclock) | |
| 86 | { | |
| 87 | int cpunum; | |
| 88 | ||
| 89 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) | |
| 90 | if (machine->cpu[cpunum].type == CPU_DUMMY) | |
| 91 | { | |
| 92 | if (machine->cputag[cpunum] == NULL) | |
| 93 | machine->cputag[cpunum] = astring_alloc(); | |
| 94 | astring_cpyc(machine->cputag[cpunum], tag); | |
| 95 | machine->cpu[cpunum].tag = astring_c(machine->cputag[cpunum]); | |
| 96 | machine->cpu[cpunum].type = type; | |
| 97 | machine->cpu[cpunum].clock = cpuclock; | |
| 98 | return &machine->cpu[cpunum]; | |
| 99 | } | |
| 100 | ||
| 101 | fatalerror("Out of CPU's!\n"); | |
| 102 | return NULL; | |
| 103 | } | |
| 104 | ||
| 105 | ||
| 106 | /*------------------------------------------------- | |
| 107 | cpu_find - find a tagged CPU during machine | |
| 108 | driver expansion | |
| 109 | -------------------------------------------------*/ | |
| 110 | ||
| 111 | static cpu_config *cpu_find(machine_config *machine, const char *tag) | |
| 112 | { | |
| 113 | int cpunum; | |
| 114 | ||
| 115 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) | |
| 116 | if (machine->cpu[cpunum].tag && strcmp(machine->cpu[cpunum].tag, tag) == 0) | |
| 117 | return &machine->cpu[cpunum]; | |
| 118 | ||
| 119 | fatalerror("Can't find CPU '%s'!\n", tag); | |
| 120 | return NULL; | |
| 121 | } | |
| 122 | ||
| 123 | ||
| 124 | /*------------------------------------------------- | |
| 125 | cpu_remove - remove a tagged CPU during | |
| 126 | machine driver expansion | |
| 127 | -------------------------------------------------*/ | |
| 128 | ||
| 129 | static void cpu_remove(machine_config *machine, const char *tag) | |
| 130 | { | |
| 131 | int cpunum; | |
| 132 | ||
| 133 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) | |
| 134 | if (machine->cpu[cpunum].tag && strcmp(machine->cpu[cpunum].tag, tag) == 0) | |
| 135 | { | |
| 136 | if (machine->cputag[cpunum] != NULL) | |
| 137 | astring_free(machine->cputag[cpunum]); | |
| 138 | memmove(&machine->cpu[cpunum], &machine->cpu[cpunum + 1], sizeof(machine->cpu[0]) * (MAX_CPU - cpunum - 1)); | |
| 139 | memmove(&machine->cputag[cpunum], &machine->cputag[cpunum + 1], sizeof(machine->cputag[0]) * (MAX_CPU - cpunum - 1)); | |
| 140 | memset(&machine->cpu[MAX_CPU - 1], 0, sizeof(machine->cpu[0])); | |
| 141 | memset(&machine->cputag[MAX_CPU - 1], 0, sizeof(machine->cputag[0])); | |
| 142 | return; | |
| 143 | } | |
| 144 | ||
| 145 | fatalerror("Can't find CPU '%s'!\n", tag); | |
| 146 | } | |
| 147 | ||
| 148 | ||
| 149 | /*------------------------------------------------- | |
| 150 | 78 | sound_add - add a sound system during |
| 151 | 79 | machine driver expansion |
| 152 | 80 | -------------------------------------------------*/ |
| r3957 | r3958 | |
| 222 | 150 | machine config |
| 223 | 151 | -------------------------------------------------*/ |
| 224 | 152 | |
| 225 | static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens, const c | |
| 153 | static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens, const devic | |
| 226 | 154 | { |
| 227 | 155 | UINT32 entrytype = MCONFIG_TOKEN_INVALID; |
| 228 | 156 | astring *tempstring = astring_alloc(); |
| 229 | 157 | device_config *device = NULL; |
| 230 | 158 | sound_config *sound = NULL; |
| 231 | cpu_config *cpu = NULL; | |
| 232 | 159 | |
| 233 | 160 | /* loop over tokens until we hit the end */ |
| 234 | 161 | while (entrytype != MCONFIG_TOKEN_END) |
| r3957 | r3958 | |
| 249 | 176 | |
| 250 | 177 | /* including */ |
| 251 | 178 | case MCONFIG_TOKEN_INCLUDE: |
| 252 | machine_config_detokenize(config, TOKEN_GET_PTR(tokens, tokenptr), | |
| 179 | machine_config_detokenize(config, TOKEN_GET_PTR(tokens, tokenptr), own | |
| 253 | 180 | break; |
| 254 | 181 | |
| 255 | 182 | /* device management */ |
| 256 | 183 | case MCONFIG_TOKEN_DEVICE_ADD: |
| 184 | TOKEN_UNGET_UINT32(tokens); | |
| 185 | TOKEN_GET_UINT64_UNPACK2(tokens, entrytype, 8, clock, 32); | |
| 257 | 186 | devtype = TOKEN_GET_PTR(tokens, devtype); |
| 258 | 187 | tag = TOKEN_GET_STRING(tokens); |
| 259 | device = device_list_add(&config->devicelist, devtype, device_build_tag(tempstring, | |
| 188 | device = device_list_add(&config->devicelist, owner, devtype, device_build_tag(tempstring, own | |
| 260 | 189 | break; |
| 261 | 190 | |
| 262 | 191 | case MCONFIG_TOKEN_DEVICE_REMOVE: |
| 263 | 192 | devtype = TOKEN_GET_PTR(tokens, devtype); |
| 264 | 193 | tag = TOKEN_GET_STRING(tokens); |
| 265 | device_list_remove(&config->devicelist, devtype, device_build_tag(tempstring, | |
| 194 | device_list_remove(&config->devicelist, devtype, device_build_tag(tempstring, own | |
| 266 | 195 | device = NULL; |
| 267 | 196 | break; |
| 268 | 197 | |
| 269 | 198 | case MCONFIG_TOKEN_DEVICE_MODIFY: |
| 270 | 199 | devtype = TOKEN_GET_PTR(tokens, devtype); |
| 271 | 200 | tag = TOKEN_GET_STRING(tokens); |
| 272 | device = (device_config *)device_list_find_by_tag(config->devicelist, devtype, device_build_tag(tempstring, | |
| 201 | device = (device_config *)device_list_find_by_tag(config->devicelist, devtype, device_build_tag(tempstring, own | |
| 273 | 202 | if (device == NULL) |
| 274 | 203 | fatalerror("Unable to find device: type=%s tag=%s\n", devtype_get_name(devtype), astring_c(tempstring)); |
| 275 | 204 | break; |
| 276 | 205 | |
| 206 | case MCONFIG_TOKEN_DEVICE_CLOCK: | |
| 207 | assert(device != NULL); | |
| 208 | TOKEN_UNGET_UINT32(tokens); | |
| 209 | TOKEN_GET_UINT64_UNPACK2(tokens, entrytype, 8, device->clock, 32); | |
| 210 | break; | |
| 211 | ||
| 277 | 212 | case MCONFIG_TOKEN_DEVICE_CONFIG: |
| 278 | 213 | assert(device != NULL); |
| 279 | 214 | device->static_config = TOKEN_GET_PTR(tokens, voidptr); |
| r3957 | r3958 | |
| 331 | 266 | break; |
| 332 | 267 | |
| 333 | 268 | |
| 334 | /* add/modify/remove/replace CPUs */ | |
| 335 | case MCONFIG_TOKEN_CPU_ADD: | |
| 336 | TOKEN_UNGET_UINT32(tokens); | |
| 337 | TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32); | |
| 338 | tag = TOKEN_GET_STRING(tokens); | |
| 339 | cpu = cpu_add(config, device_build_tag(tempstring, tagprefix, tag), type, clock); | |
| 340 | break; | |
| 341 | ||
| 342 | case MCONFIG_TOKEN_CPU_MODIFY: | |
| 343 | tag = TOKEN_GET_STRING(tokens); | |
| 344 | cpu = cpu_find(config, device_build_tag(tempstring, tagprefix, tag)); | |
| 345 | break; | |
| 346 | ||
| 347 | case MCONFIG_TOKEN_CPU_REMOVE: | |
| 348 | tag = TOKEN_GET_STRING(tokens); | |
| 349 | cpu_remove(config, device_build_tag(tempstring, tagprefix, tag)); | |
| 350 | cpu = NULL; | |
| 351 | break; | |
| 352 | ||
| 353 | case MCONFIG_TOKEN_CPU_REPLACE: | |
| 354 | TOKEN_UNGET_UINT32(tokens); | |
| 355 | TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32); | |
| 356 | tag = TOKEN_GET_STRING(tokens); | |
| 357 | cpu = cpu_find(config, device_build_tag(tempstring, tagprefix, tag)); | |
| 358 | if (cpu == NULL) | |
| 359 | fatalerror("Unable to find CPU: tag=%s\n", astring_c(tempstring)); | |
| 360 | cpu->type = type; | |
| 361 | cpu->clock = clock; | |
| 362 | break; | |
| 363 | ||
| 364 | /* CPU parameters */ | |
| 365 | case MCONFIG_TOKEN_cpu_get_flags: | |
| 366 | assert(cpu != NULL); | |
| 367 | TOKEN_UNGET_UINT32(tokens); | |
| 368 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, cpu->flags, 24); | |
| 369 | break; | |
| 370 | ||
| 371 | case MCONFIG_TOKEN_CPU_CONFIG: | |
| 372 | assert(cpu != NULL); | |
| 373 | cpu->reset_param = TOKEN_GET_PTR(tokens, voidptr); | |
| 374 | break; | |
| 375 | ||
| 376 | case MCONFIG_TOKEN_CPU_PROGRAM_MAP: | |
| 377 | assert(cpu != NULL); | |
| 378 | cpu->address_map[ADDRESS_SPACE_PROGRAM][0] = TOKEN_GET_PTR(tokens, addrmap); | |
| 379 | cpu->address_map[ADDRESS_SPACE_PROGRAM][1] = TOKEN_GET_PTR(tokens, addrmap); | |
| 380 | break; | |
| 381 | ||
| 382 | case MCONFIG_TOKEN_CPU_DATA_MAP: | |
| 383 | assert(cpu != NULL); | |
| 384 | cpu->address_map[ADDRESS_SPACE_DATA][0] = TOKEN_GET_PTR(tokens, addrmap); | |
| 385 | cpu->address_map[ADDRESS_SPACE_DATA][1] = TOKEN_GET_PTR(tokens, addrmap); | |
| 386 | break; | |
| 387 | ||
| 388 | case MCONFIG_TOKEN_CPU_IO_MAP: | |
| 389 | assert(cpu != NULL); | |
| 390 | cpu->address_map[ADDRESS_SPACE_IO][0] = TOKEN_GET_PTR(tokens, addrmap); | |
| 391 | cpu->address_map[ADDRESS_SPACE_IO][1] = TOKEN_GET_PTR(tokens, addrmap); | |
| 392 | break; | |
| 393 | ||
| 394 | case MCONFIG_TOKEN_CPU_VBLANK_INT: | |
| 395 | assert(cpu != NULL); | |
| 396 | TOKEN_UNGET_UINT32(tokens); | |
| 397 | TOKEN_GET_UINT32_UNPACK1(tokens, entrytype, 8); | |
| 398 | cpu->vblank_interrupt_screen = TOKEN_GET_STRING(tokens); | |
| 399 | cpu->vblank_interrupt = TOKEN_GET_PTR(tokens, interrupt); | |
| 400 | cpu->vblank_interrupts_per_frame = 1; | |
| 401 | break; | |
| 402 | ||
| 403 | case MCONFIG_TOKEN_CPU_VBLANK_INT_HACK: | |
| 404 | assert(cpu != NULL); | |
| 405 | TOKEN_UNGET_UINT32(tokens); | |
| 406 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, cpu->vblank_interrupts_per_frame, 24); | |
| 407 | cpu->vblank_interrupt = TOKEN_GET_PTR(tokens, interrupt); | |
| 408 | break; | |
| 409 | ||
| 410 | case MCONFIG_TOKEN_CPU_PERIODIC_INT: | |
| 411 | assert(cpu != NULL); | |
| 412 | TOKEN_UNGET_UINT32(tokens); | |
| 413 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, data32, 24); | |
| 414 | cpu->timed_interrupt_period = HZ_TO_ATTOSECONDS(data32); | |
| 415 | cpu->timed_interrupt = TOKEN_GET_PTR(tokens, interrupt); | |
| 416 | break; | |
| 417 | ||
| 418 | 269 | /* core parameters */ |
| 419 | 270 | case MCONFIG_TOKEN_DRIVER_DATA: |
| 420 | 271 | TOKEN_UNGET_UINT32(tokens); |
| 421 | 272 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->driver_data_size, 24); |
| 422 | 273 | break; |
| 423 | 274 | |
| 424 | case MCONFIG_TOKEN_INTERLEAVE: | |
| 425 | TOKEN_UNGET_UINT32(tokens); | |
| 426 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->cpu_slices_per_frame, 24); | |
| 275 | case MCONFIG_TOKEN_QUANTUM_TIME: | |
| 276 | TOKEN_EXTRACT_UINT64(tokens, data64); | |
| 277 | config->minimum_quantum = UINT64_ATTOTIME_TO_ATTOTIME(data64); | |
| 427 | 278 | break; |
| 428 | 279 | |
| 280 | case MCONFIG_TOKEN_QUANTUM_PERFECT_CPU: | |
| 281 | config->perfect_cpu_quantum = TOKEN_GET_STRING(tokens); | |
| 282 | break; | |
| 283 | ||
| 429 | 284 | case MCONFIG_TOKEN_WATCHDOG_VBLANK: |
| 430 | 285 | TOKEN_UNGET_UINT32(tokens); |
| 431 | 286 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->watchdog_vblank_count, 24); |
| r3957 | r3958 | |
| 507 | 362 | TOKEN_UNGET_UINT32(tokens); |
| 508 | 363 | TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32); |
| 509 | 364 | tag = TOKEN_GET_STRING(tokens); |
| 510 | sound = sound_add(config, device_build_tag(tempstring, | |
| 365 | sound = sound_add(config, device_build_tag(tempstring, own | |
| 511 | 366 | break; |
| 512 | 367 | |
| 513 | 368 | case MCONFIG_TOKEN_SOUND_REMOVE: |
| r3957 | r3958 | |
| 516 | 371 | |
| 517 | 372 | case MCONFIG_TOKEN_SOUND_MODIFY: |
| 518 | 373 | tag = TOKEN_GET_STRING(tokens); |
| 519 | sound = sound_find(config, device_build_tag(tempstring, | |
| 374 | sound = sound_find(config, device_build_tag(tempstring, own | |
| 520 | 375 | if (sound == NULL) |
| 521 | 376 | fatalerror("Unable to find sound: tag=%s\n", astring_c(tempstring)); |
| 522 | 377 | sound->routes = 0; |
| r3957 | r3958 | |
| 531 | 386 | TOKEN_UNGET_UINT32(tokens); |
| 532 | 387 | TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32); |
| 533 | 388 | tag = TOKEN_GET_STRING(tokens); |
| 534 | sound = sound_find(config, device_build_tag(tempstring, | |
| 389 | sound = sound_find(config, device_build_tag(tempstring, own | |
| 535 | 390 | if (sound == NULL) |
| 536 | 391 | fatalerror("Unable to find sound: tag=%s\n", astring_c(tempstring)); |
| 537 | 392 | sound->type = type; |
| r3957 | r3958 | |
| 563 | 418 | { |
| 564 | 419 | tokens = device_get_info_ptr(device, DEVINFO_PTR_MACHINE_CONFIG); |
| 565 | 420 | if (tokens != NULL) |
| 566 | machine_config_detokenize(config, tokens, device | |
| 421 | machine_config_detokenize(config, tokens, device | |
| 567 | 422 | } |
| 568 | 423 | |
| 569 | 424 | astring_free(tempstring); |
| r3957 | r3958 | |
|---|---|---|
| 104 | 104 | ***************************************************************************/ |
| 105 | 105 | |
| 106 | 106 | #define MDRV_TIMER_ADD(_tag, _callback) \ |
| 107 | MDRV_DEVICE_ADD(_tag, TIMER) \ | |
| 107 | MDRV_DEVICE_ADD(_tag, TIMER, 0) \ | |
| 108 | 108 | MDRV_DEVICE_CONFIG_DATA32(timer_config, type, TIMER_TYPE_GENERIC) \ |
| 109 | 109 | MDRV_DEVICE_CONFIG_DATAPTR(timer_config, callback, _callback) \ |
| 110 | 110 | |
| 111 | 111 | #define MDRV_TIMER_ADD_PERIODIC(_tag, _callback, _period) \ |
| 112 | MDRV_DEVICE_ADD(_tag, TIMER) \ | |
| 112 | MDRV_DEVICE_ADD(_tag, TIMER, 0) \ | |
| 113 | 113 | MDRV_DEVICE_CONFIG_DATA32(timer_config, type, TIMER_TYPE_PERIODIC) \ |
| 114 | 114 | MDRV_DEVICE_CONFIG_DATAPTR(timer_config, callback, _callback) \ |
| 115 | 115 | MDRV_DEVICE_CONFIG_DATA64(timer_config, period, UINT64_ATTOTIME_IN_##_period) |
| 116 | 116 | |
| 117 | 117 | #define MDRV_TIMER_ADD_SCANLINE(_tag, _callback, _screen, _first_vpos, _increment) \ |
| 118 | MDRV_DEVICE_ADD(_tag, TIMER) \ | |
| 118 | MDRV_DEVICE_ADD(_tag, TIMER, 0) \ | |
| 119 | 119 | MDRV_DEVICE_CONFIG_DATA32(timer_config, type, TIMER_TYPE_SCANLINE) \ |
| 120 | 120 | MDRV_DEVICE_CONFIG_DATAPTR(timer_config, callback, _callback) \ |
| 121 | 121 | MDRV_DEVICE_CONFIG_DATAPTR(timer_config, screen, _screen) \ |
| r3957 | r3958 | |
|---|---|---|
| 714 | 714 | { |
| 715 | 715 | const game_driver *driver = drivers[drivnum]; |
| 716 | 716 | cpu_validity_check_func cpu_validity_check; |
| 717 | const device_config *device; | |
| 717 | 718 | int error = FALSE; |
| 718 | int cpunum; | |
| 719 | 719 | |
| 720 | 720 | /* loop over all the CPUs */ |
| 721 | for (c | |
| 721 | for (device | |
| 722 | 722 | { |
| 723 | const cpu_config *cpu = &config->cpu[cpunum]; | |
| 724 | int spacenum, checknum; | |
| 723 | const cpu_config *cpuconfig = device->inline_config; | |
| 724 | int spacenum; | |
| 725 | 725 | |
| 726 | /* skip empty entries */ | |
| 727 | if (cpu->type == CPU_DUMMY) | |
| 728 | continue; | |
| 729 | ||
| 730 | /* check for valid tag */ | |
| 731 | if (cpu->tag == NULL) | |
| 732 | { | |
| 733 | mame_printf_error("%s: %s has NULL CPU tag\n", driver->source_file, driver->name); | |
| 734 | error = TRUE; | |
| 735 | } | |
| 736 | ||
| 737 | /* check for duplicate tags */ | |
| 738 | else | |
| 739 | { | |
| 740 | for (checknum = 0; checknum < cpunum; checknum++) | |
| 741 | if (config->cpu[checknum].tag != NULL && strcmp(cpu->tag, config->cpu[checknum].tag) == 0) | |
| 742 | { | |
| 743 | mame_printf_error("%s: %s has multiple CPUs tagged as '%s'\n", driver->source_file, driver->name, cpu->tag); | |
| 744 | error = TRUE; | |
| 745 | } | |
| 746 | } | |
| 747 | ||
| 748 | /* validate the CPU tag */ | |
| 749 | error |= validate_tag(driver, "CPU", cpu->tag); | |
| 750 | ||
| 751 | /* checks to see if this driver is using a dummy CPU */ | |
| 752 | if (cpu->type == CPU_DUMMY) | |
| 753 | { | |
| 754 | mame_printf_error("%s: %s uses non-present CPU\n", driver->source_file, driver->name); | |
| 755 | error = TRUE; | |
| 756 | continue; | |
| 757 | } | |
| 758 | ||
| 759 | 726 | /* check the CPU for incompleteness */ |
| 760 | if (cputype_get_info_fct(cpu->type, CPUINFO_PTR_RESET) == NULL || | |
| 761 | cputype_get_info_fct(cpu->type, CPUINFO_PTR_EXECUTE) == NULL) | |
| 727 | if (device_get_info_fct(device, CPUINFO_FCT_RESET) == NULL || | |
| 728 | device_get_info_fct(device, CPUINFO_FCT_EXECUTE) == NULL) | |
| 762 | 729 | { |
| 763 | 730 | mame_printf_error("%s: %s uses an incomplete CPU\n", driver->source_file, driver->name); |
| 764 | 731 | error = TRUE; |
| r3957 | r3958 | |
| 766 | 733 | } |
| 767 | 734 | |
| 768 | 735 | /* check for CPU-specific validity check */ |
| 769 | cpu_validity_check = (cpu_validity_check_func) cputype_get_info_fct(cpu->type, CPUINFO_PTR_VALIDITY_CHECK); | |
| 770 | if (cpu_validity_check != NULL) | |
| 771 | { | |
| 772 | if ((*cpu_validity_check)(driver, config->cpu[cpunum].reset_param)) | |
| 773 | error = TRUE; | |
| 774 | } | |
| 736 | cpu_validity_check = (cpu_validity_check_func) device_get_info_fct(device, CPUINFO_FCT_VALIDITY_CHECK); | |
| 737 | if (cpu_validity_check != NULL && (*cpu_validity_check)(driver, device->static_config)) | |
| 738 | error = TRUE; | |
| 775 | 739 | |
| 776 | 740 | /* loop over all address spaces */ |
| 777 | 741 | for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) |
| 778 | 742 | { |
| 779 | 743 | #define SPACE_SHIFT(a) ((addr_shift < 0) ? ((a) << -addr_shift) : ((a) >> addr_shift)) |
| 780 | 744 | #define SPACE_SHIFT_END(a) ((addr_shift < 0) ? (((a) << -addr_shift) | ((1 << -addr_shift) - 1)) : ((a) >> addr_shift)) |
| 781 | int databus_width = cputype_get_databus_width(cpu->type, spacenum); | |
| 782 | int addr_shift = cputype_get_addrbus_shift(cpu->type, spacenum); | |
| 745 | int databus_width = cpu_get_databus_width(device, spacenum); | |
| 746 | int addr_shift = cpu_get_addrbus_shift(device, spacenum); | |
| 783 | 747 | int alignunit = databus_width/8; |
| 784 | 748 | address_map_entry *entry; |
| 785 | 749 | address_map *map; |
| 786 | 750 | |
| 787 | 751 | /* check to see that the same map is not used twice */ |
| 788 | if (cpu->address_map[spacenum] | |
| 752 | if (cpuconfig->address_map[spacenum] | |
| 789 | 753 | { |
| 790 | mame_printf_error("%s: %s uses identical memory maps for CPU | |
| 754 | mame_printf_error("%s: %s uses identical memory maps for CPU '%s' spacenum %d\n", driver->source_file, driver->name, device->tag, spacenum); | |
| 791 | 755 | error = TRUE; |
| 792 | 756 | } |
| 793 | 757 | |
| 794 | 758 | /* construct the maps */ |
| 795 | map = address_map_alloc( | |
| 759 | map = address_map_alloc(dev | |
| 796 | 760 | |
| 797 | 761 | /* if this is an empty map, just skip it */ |
| 798 | 762 | if (map->entrylist == NULL) |
| r3957 | r3958 | |
| 804 | 768 | /* validate the global map parameters */ |
| 805 | 769 | if (map->spacenum != spacenum) |
| 806 | 770 | { |
| 807 | mame_printf_error("%s: %s CPU | |
| 771 | mame_printf_error("%s: %s CPU '%s' space %d has address space %d handlers!\n", driver->source_file, driver->name, device->tag, spacenum, map->spacenum); | |
| 808 | 772 | error = TRUE; |
| 809 | 773 | } |
| 810 | 774 | if (map->databits != databus_width) |
| 811 | 775 | { |
| 812 | mame_printf_error("%s: %s cpu | |
| 776 | mame_printf_error("%s: %s cpu '%s' uses wrong memory handlers for %s space! (width = %d, memory = %08x)\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], databus_width, map->databits); | |
| 813 | 777 | error = TRUE; |
| 814 | 778 | } |
| 815 | 779 | |
| r3957 | r3958 | |
| 836 | 800 | /* if this is a program space, auto-assign implicit ROM entries */ |
| 837 | 801 | if ((FPTR)entry->read.generic == STATIC_ROM && entry->region == NULL) |
| 838 | 802 | { |
| 839 | entry->region = | |
| 803 | entry->region = dev | |
| 840 | 804 | entry->rgnoffs = entry->addrstart; |
| 841 | 805 | } |
| 842 | 806 | |
| r3957 | r3958 | |
| 851 | 815 | /* stop if we hit an empty */ |
| 852 | 816 | if (rgninfo->entries[rgnnum].tag == NULL) |
| 853 | 817 | { |
| 854 | mame_printf_error("%s: %s CPU % | |
| 818 | mame_printf_error("%s: %s CPU '%s' %s space | |
| 855 | 819 | error = TRUE; |
| 856 | 820 | break; |
| 857 | 821 | } |
| r3957 | r3958 | |
| 862 | 826 | offs_t length = rgninfo->entries[rgnnum].length; |
| 863 | 827 | if (entry->rgnoffs + (byteend - bytestart + 1) > length) |
| 864 | 828 | { |
| 865 | mame_printf_error("%s: %s CPU % | |
| 829 | mame_printf_error("%s: %s CPU '%s' %s space | |
| 866 | 830 | error = TRUE; |
| 867 | 831 | } |
| 868 | 832 | break; |
| r3957 | r3958 | |
| 873 | 837 | /* make sure all devices exist */ |
| 874 | 838 | if (entry->read_devtype != NULL && device_list_find_by_tag(config->devicelist, entry->read_devtype, entry->read_devtag) == NULL) |
| 875 | 839 | { |
| 876 | mame_printf_error("%s: %s CPU % | |
| 840 | mame_printf_error("%s: %s CPU '%s' %s space | |
| 877 | 841 | error = TRUE; |
| 878 | 842 | } |
| 879 | 843 | if (entry->write_devtype != NULL && device_list_find_by_tag(config->devicelist, entry->write_devtype, entry->write_devtag) == NULL) |
| 880 | 844 | { |
| 881 | mame_printf_error("%s: %s CPU % | |
| 845 | mame_printf_error("%s: %s CPU '%s' %s space | |
| 882 | 846 | error = TRUE; |
| 883 | 847 | } |
| 884 | 848 | |
| 885 | 849 | /* make sure ports exist */ |
| 886 | 850 | if (entry->read_porttag != NULL && input_port_by_tag(portlist, entry->read_porttag) == NULL) |
| 887 | 851 | { |
| 888 | mame_printf_error("%s: %s CPU % | |
| 852 | mame_printf_error("%s: %s CPU '%s' %s space | |
| 889 | 853 | error = TRUE; |
| 890 | 854 | } |
| 891 | 855 | } |
| r3957 | r3958 | |
| 894 | 858 | address_map_free(map); |
| 895 | 859 | |
| 896 | 860 | /* validate the interrupts */ |
| 897 | if (cpu->vblank_interrupt != NULL) | |
| 861 | if (cpuconfig->vblank_interrupt != NULL) | |
| 898 | 862 | { |
| 899 | 863 | if (video_screen_count(config) == 0) |
| 900 | 864 | { |
| 901 | mame_printf_error("%s: %s cpu | |
| 865 | mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, device->tag); | |
| 902 | 866 | error = TRUE; |
| 903 | 867 | } |
| 904 | else if (cpu->vblank_interrupts_per_frame | |
| 868 | else if (cpuconfig->vblank_interrupt_screen != NULL && cpuconfig->vblank_interrupts_per_frame != 0) | |
| 905 | 869 | { |
| 906 | mame_printf_error("%s: %s cpu | |
| 870 | mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, device->tag); | |
| 907 | 871 | error = TRUE; |
| 908 | 872 | } |
| 909 | else if (cpu->vblank_interrupts_per_ | |
| 873 | else if (cpuconfig->vblank_interrupt_screen != NULL && device_list_find_by_tag(config->devicelist, VIDEO_SCREEN, cpuconfig->vblank_interrupt_scr | |
| 910 | 874 | { |
| 911 | if (cpu->vblank_interrupt_screen == NULL) | |
| 912 | { | |
| 913 | mame_printf_error("%s: %s cpu #%d has a valid VBLANK interrupt handler with no screen tag supplied!\n", driver->source_file, driver->name, cpunum); | |
| 914 | error = TRUE; | |
| 915 | } | |
| 916 | else if (device_list_index(config->devicelist, VIDEO_SCREEN, cpu->vblank_interrupt_screen) == -1) | |
| 917 | { | |
| 918 | mame_printf_error("%s: %s cpu #%d VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, cpunum, cpu->vblank_interrupt_screen); | |
| 919 | error = TRUE; | |
| 920 | } | |
| 875 | mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, device->tag, cpuconfig->vblank_interrupt_screen); | |
| 876 | error = TRUE; | |
| 921 | 877 | } |
| 878 | else if (cpuconfig->vblank_interrupt_screen == NULL && cpuconfig->vblank_interrupts_per_frame == 0) | |
| 879 | { | |
| 880 | mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, device->tag); | |
| 881 | error = TRUE; | |
| 882 | } | |
| 922 | 883 | } |
| 923 | else if (cpu->vblank_interrupts_per_frame != 0) | |
| 884 | else if (cpuconfig->vblank_interrupts_per_frame != 0) | |
| 924 | 885 | { |
| 925 | mame_printf_error("%s: %s cpu | |
| 886 | mame_printf_error("%s: %s cpu '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, device->tag); | |
| 926 | 887 | error = TRUE; |
| 927 | 888 | } |
| 928 | 889 | |
| 929 | if ( | |
| 890 | if ( | |
| 930 | 891 | { |
| 931 | mame_printf_error("%s: %s cpu | |
| 892 | mame_printf_error("%s: %s cpu '%s' has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, device->tag); | |
| 932 | 893 | error = TRUE; |
| 933 | 894 | } |
| 934 | else if ( | |
| 895 | else if ( | |
| 935 | 896 | { |
| 936 | mame_printf_error("%s: %s cpu | |
| 897 | mame_printf_error("%s: %s cpu '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, device->tag); | |
| 937 | 898 | error = TRUE; |
| 938 | 899 | } |
| 939 | 900 | } |
| r3957 | r3958 | |
| 1659 | 1620 | error = validate_inlines() || error; |
| 1660 | 1621 | |
| 1661 | 1622 | /* make sure the CPU and sound interfaces are up and running */ |
| 1662 | cpuintrf_init(NULL); | |
| 1663 | 1623 | sndintrf_init(NULL); |
| 1664 | 1624 | |
| 1665 | 1625 | init_resource_tracking(); |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | MCONFIG_TOKEN_DEVICE_ADD, |
| 38 | 38 | MCONFIG_TOKEN_DEVICE_REMOVE, |
| 39 | MCONFIG_TOKEN_DEVICE_REPLACE, | |
| 39 | 40 | MCONFIG_TOKEN_DEVICE_MODIFY, |
| 41 | MCONFIG_TOKEN_DEVICE_CLOCK, | |
| 40 | 42 | MCONFIG_TOKEN_DEVICE_CONFIG, |
| 41 | 43 | MCONFIG_TOKEN_DEVICE_CONFIG_DATA32, |
| 42 | 44 | MCONFIG_TOKEN_DEVICE_CONFIG_DATA64, |
| 43 | 45 | MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP32, |
| 44 | 46 | MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP64, |
| 45 | 47 | |
| 46 | MCONFIG_TOKEN_CPU_ADD, | |
| 47 | MCONFIG_TOKEN_CPU_MODIFY, | |
| 48 | MCONFIG_TOKEN_CPU_REMOVE, | |
| 49 | MCONFIG_TOKEN_CPU_REPLACE, | |
| 50 | MCONFIG_TOKEN_cpu_get_flags, | |
| 51 | MCONFIG_TOKEN_CPU_CONFIG, | |
| 52 | MCONFIG_TOKEN_CPU_PROGRAM_MAP, | |
| 53 | MCONFIG_TOKEN_CPU_DATA_MAP, | |
| 54 | MCONFIG_TOKEN_CPU_IO_MAP, | |
| 55 | MCONFIG_TOKEN_CPU_VBLANK_INT, | |
| 56 | MCONFIG_TOKEN_CPU_VBLANK_INT_HACK, | |
| 57 | MCONFIG_TOKEN_CPU_PERIODIC_INT, | |
| 58 | ||
| 59 | 48 | MCONFIG_TOKEN_DRIVER_DATA, |
| 60 | MCONFIG_TOKEN_INTERLEAVE, | |
| 49 | MCONFIG_TOKEN_QUANTUM_TIME, | |
| 50 | MCONFIG_TOKEN_QUANTUM_PERFECT_CPU, | |
| 61 | 51 | MCONFIG_TOKEN_WATCHDOG_VBLANK, |
| 62 | 52 | MCONFIG_TOKEN_WATCHDOG_TIME, |
| 63 | 53 | |
| r3957 | r3958 | |
| 124 | 114 | { |
| 125 | 115 | UINT32 driver_data_size; /* amount of memory needed for driver_data */ |
| 126 | 116 | |
| 127 | cpu_config cpu[MAX_CPU]; /* array of CPUs in the system */ | |
| 128 | astring * cputag[MAX_CPU]; /* allocated strings for each CPU tag */ | |
| 129 | UINT32 cpu_slices_per_frame; /* number of times to interleave execution per frame */ | |
| 117 | attotime minimum_quantum; /* minimum scheduling quantum */ | |
| 118 | const char * perfect_cpu_quantum; /* tag of CPU to use for "perfect" scheduling */ | |
| 130 | 119 | INT32 watchdog_vblank_count; /* number of VBLANKs until the watchdog kills us */ |
| 131 | 120 | attotime watchdog_time; /* length of time until the watchdog kills us */ |
| 132 | 121 | |
| r3957 | r3958 | |
| 171 | 160 | const gfx_decode_entry *gfxdecode; |
| 172 | 161 | const addrmap_token *addrmap; |
| 173 | 162 | device_type devtype; |
| 174 | void (*interrupt)(const device_config *device); | |
| 175 | 163 | driver_init_func driver_init; |
| 176 | 164 | nvram_handler_func nvram_handler; |
| 177 | 165 | memcard_handler_func memcard_handler; |
| r3957 | r3958 | |
| 210 | 198 | |
| 211 | 199 | |
| 212 | 200 | /* add/remove/config devices */ |
| 213 | #define MDRV_DEVICE_ADD(_tag, _type) \ | |
| 214 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_ADD, 8), \ | |
| 201 | #define MDRV_DEVICE_ADD(_tag, _type, _clock) \ | |
| 202 | TOKEN_UINT64_PACK2(MCONFIG_TOKEN_DEVICE_ADD, 8, _clock, 32), \ | |
| 215 | 203 | TOKEN_PTR(devtype, _type), \ |
| 216 | 204 | TOKEN_STRING(_tag), |
| 217 | 205 | |
| r3957 | r3958 | |
| 229 | 217 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_CONFIG, 8), \ |
| 230 | 218 | TOKEN_PTR(voidptr, &(_config)), |
| 231 | 219 | |
| 220 | #define MDRV_DEVICE_CLOCK(_clock) \ | |
| 221 | TOKEN_UINT64_PACK2(MCONFIG_TOKEN_DEVICE_CLOCK, 8, _clock, 32), | |
| 222 | ||
| 232 | 223 | #define structsizeof(_struct, _field) sizeof(((_struct *)NULL)->_field) |
| 233 | 224 | |
| 234 | 225 | #define MDRV_DEVICE_CONFIG_DATA32_EXPLICIT(_size, _offset, _val) \ |
| r3957 | r3958 | |
| 278 | 269 | #endif |
| 279 | 270 | |
| 280 | 271 | |
| 281 | /* add/modify/remove/replace CPUs */ | |
| 282 | #define MDRV_CPU_ADD(_tag, _type, _clock) \ | |
| 283 | TOKEN_UINT64_PACK3(MCONFIG_TOKEN_CPU_ADD, 8, CPU_##_type, 24, _clock, 32), \ | |
| 284 | TOKEN_STRING(_tag), | |
| 285 | ||
| 286 | #define MDRV_CPU_MODIFY(_tag) \ | |
| 287 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_MODIFY, 8), \ | |
| 288 | TOKEN_STRING(_tag), | |
| 289 | ||
| 290 | #define MDRV_CPU_REMOVE(_tag) \ | |
| 291 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_REMOVE, 8), \ | |
| 292 | TOKEN_STRING(_tag), | |
| 293 | ||
| 294 | #define MDRV_CPU_REPLACE(_tag, _type, _clock) \ | |
| 295 | TOKEN_UINT64_PACK3(MCONFIG_TOKEN_CPU_REPLACE, 8, CPU_##_type, 24, _clock, 32), \ | |
| 296 | TOKEN_STRING(_tag), | |
| 297 | ||
| 298 | ||
| 299 | /* CPU parameters */ | |
| 300 | #define MDRV_CPU_FLAGS(_flags) \ | |
| 301 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_cpu_get_flags, 8, _flags, 24), | |
| 302 | ||
| 303 | #define MDRV_CPU_CONFIG(_config) \ | |
| 304 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_CONFIG, 8), \ | |
| 305 | TOKEN_PTR(voidptr, &(_config)), | |
| 306 | ||
| 307 | #define MDRV_CPU_PROGRAM_MAP(_map1, _map2) \ | |
| 308 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_PROGRAM_MAP, 8), \ | |
| 309 | TOKEN_PTR(voidptr, ADDRESS_MAP_NAME(_map1)), \ | |
| 310 | TOKEN_PTR(voidptr, ADDRESS_MAP_NAME(_map2)), \ | |
| 311 | ||
| 312 | #define MDRV_CPU_DATA_MAP(_map1, _map2) \ | |
| 313 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_DATA_MAP, 8), \ | |
| 314 | TOKEN_PTR(voidptr, ADDRESS_MAP_NAME(_map1)), \ | |
| 315 | TOKEN_PTR(voidptr, ADDRESS_MAP_NAME(_map2)), \ | |
| 316 | ||
| 317 | #define MDRV_CPU_IO_MAP(_map1, _map2) \ | |
| 318 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_IO_MAP, 8), \ | |
| 319 | TOKEN_PTR(voidptr, ADDRESS_MAP_NAME(_map1)), \ | |
| 320 | TOKEN_PTR(voidptr, ADDRESS_MAP_NAME(_map2)), \ | |
| 321 | ||
| 322 | #define MDRV_CPU_VBLANK_INT(_tag, _func) \ | |
| 323 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_VBLANK_INT, 8), \ | |
| 324 | TOKEN_STRING(_tag), \ | |
| 325 | TOKEN_PTR(interrupt, _func), | |
| 326 | ||
| 327 | #define MDRV_CPU_PERIODIC_INT(_func, _rate) \ | |
| 328 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_PERIODIC_INT, 8, _rate, 24), \ | |
| 329 | TOKEN_PTR(interrupt, _func), | |
| 330 | ||
| 331 | ||
| 332 | 272 | /* core parameters */ |
| 333 | 273 | #define MDRV_DRIVER_DATA(_struct) \ |
| 334 | 274 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_DRIVER_DATA, 8, sizeof(_struct), 24), |
| 335 | 275 | |
| 336 | #define MDRV_INTERLEAVE(_interleave) \ | |
| 337 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_INTERLEAVE, 8, _interleave, 24), | |
| 276 | #define MDRV_QUANTUM_TIME(_time) \ | |
| 277 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_QUANTUM_TIME, 8), \ | |
| 278 | TOKEN_UINT64(UINT64_ATTOTIME_IN_##_time), | |
| 338 | 279 | |
| 280 | #define MDRV_QUANTUM_PERFECT_CPU(_cputag) \ | |
| 281 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_QUANTUM_PERFECT_CPU, 8), \ | |
| 282 | TOKEN_STRING(_cputag), | |
| 283 | ||
| 339 | 284 | #define MDRV_WATCHDOG_VBLANK_INIT(_count) \ |
| 340 | 285 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_WATCHDOG_VBLANK, 8, _count, 24), |
| 341 | 286 | |
| 342 | 287 | #define MDRV_WATCHDOG_TIME_INIT(_time) \ |
| 343 | 288 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_WATCHDOG_TIME, 8), \ |
| 344 | TOKEN_UINT64(_time), | |
| 289 | TOKEN_UINT64(UINT64_ATTOTIME_IN_##_time), | |
| 345 | 290 | |
| 346 | 291 | |
| 347 | 292 | /* core functions */ |
| r3957 | r3958 | |
| 402 | 347 | |
| 403 | 348 | /* add/remove speakers */ |
| 404 | 349 | #define MDRV_SPEAKER_ADD(_tag, _x, _y, _z) \ |
| 405 | MDRV_DEVICE_ADD(_tag, SPEAKER_OUTPUT) \ | |
| 350 | MDRV_DEVICE_ADD(_tag, SPEAKER_OUTPUT, 0) \ | |
| 406 | 351 | MDRV_DEVICE_CONFIG_DATAFP32(speaker_config, x, _x, 24) \ |
| 407 | 352 | MDRV_DEVICE_CONFIG_DATAFP32(speaker_config, y, _y, 24) \ |
| 408 | 353 | MDRV_DEVICE_CONFIG_DATAFP32(speaker_config, z, _z, 24) |
| r3957 | r3958 | |
|---|---|---|
| 1173 | 1173 | const device_config *device = cputag_get_cpu(machine, rgntag); |
| 1174 | 1174 | if (device != NULL) |
| 1175 | 1175 | { |
| 1176 | int cputype = ((const cpu_config *)device->inline_config)->type; | |
| 1177 | 1176 | int buswidth; |
| 1178 | 1177 | |
| 1179 | 1178 | /* set the endianness */ |
| 1180 | 1179 | startflags &= ~ROMREGION_ENDIANMASK; |
| 1181 | if (cpu | |
| 1180 | if (cpu | |
| 1182 | 1181 | startflags |= ROMREGION_LE; |
| 1183 | 1182 | else |
| 1184 | 1183 | startflags |= ROMREGION_BE; |
| 1185 | 1184 | |
| 1186 | 1185 | /* set the width */ |
| 1187 | 1186 | startflags &= ~ROMREGION_WIDTHMASK; |
| 1188 | buswidth = cpu | |
| 1187 | buswidth = cpu | |
| 1189 | 1188 | if (buswidth <= 8) |
| 1190 | 1189 | startflags |= ROMREGION_8BIT; |
| 1191 | 1190 | else if (buswidth <= 16) |
| r3957 | r3958 | |
|---|---|---|
| 287 | 287 | file->zdata = malloc(sizeof(*file->zdata)); |
| 288 | 288 | if (file->zdata == NULL) |
| 289 | 289 | return FILERR_OUT_OF_MEMORY; |
| 290 | memset(file->zdata, 0, sizeof(file->zdata)); | |
| 290 | memset(file->zdata, 0, sizeof(*file->zdata)); | |
| 291 | 291 | |
| 292 | 292 | /* initialize the stream and compressor */ |
| 293 | 293 | if ((file->openflags & OPEN_FLAG_WRITE) != 0) |
| r3957 | r3958 | |
|---|---|---|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /* determine if we should disable the rest of the UI */ |
| 180 | ui_disabled = ui_mess_use_new_ui( | |
| 180 | ui_disabled = ui_mess_use_new_ui( | |
| 181 | 181 | || ((machine->gamedrv->flags & GAME_COMPUTER) && !machine->ui_mess_data->active); |
| 182 | 182 | |
| 183 | 183 | |
| 184 | 184 | /* is ScrLk UI toggling applicable here? */ |
| 185 | if (!ui_mess_use_new_ui( | |
| 185 | if (!ui_mess_use_new_ui( | |
| 186 | 186 | { |
| 187 | 187 | /* are we toggling the UI with ScrLk? */ |
| 188 | 188 | if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI)) |
| r3957 | r3958 | |
| 323 | 323 | is in use |
| 324 | 324 | -------------------------------------------------*/ |
| 325 | 325 | |
| 326 | int ui_mess_use_new_ui( | |
| 326 | int ui_mess_use_new_ui(vo | |
| 327 | 327 | { |
| 328 | 328 | #if (defined(WIN32) || defined(_MSC_VER)) && !defined(SDLMAME_WIN32) |
| 329 | 329 | if (options_get_bool(mame_options(), "newui")) |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | int ui_mess_handler_ingame(running_machine *machine); |
| 34 | 34 | |
| 35 | 35 | /* returns whether the "new UI" is active or not */ |
| 36 | int ui_mess_use_new_ui( | |
| 36 | int ui_mess_use_new_ui(vo | |
| 37 | 37 | |
| 38 | 38 | /* image info screen */ |
| 39 | 39 | void ui_mess_menu_image_info(running_machine *machine, ui_menu *menu, void *parameter, void *state); |
| r3957 | r3958 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | /* since the cpuintrf and sndintrf structures are filled dynamically now, we |
| 96 | 96 | * have to init first */ |
| 97 | cpuintrf_init(NULL); | |
| 98 | 97 | sndintrf_init(NULL); |
| 99 | 98 | |
| 100 | 99 | /* register options */ |
| r3957 | r3958 | |
|---|---|---|
| 720 | 720 | else |
| 721 | 721 | { |
| 722 | 722 | /* perform a legacy lookup by device type */ |
| 723 | device = image_from_devtype_and_index(ident->type, ident->slot); | |
| 723 | device = image_from_devtype_and_index(machine, ident->type, ident->slot); | |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | /* did the image slot lookup fail? */ |
| r3957 | r3958 | |
| 1070 | 1070 | for (cpunum = 0; (cpunum < ARRAY_LENGTH(machine->cpu)) && (machine->cpu[cpunum] != NULL); cpunum++) |
| 1071 | 1071 | { |
| 1072 | 1072 | runtime_hash *= 57; |
| 1073 | runtime_hash ^= cpu_get_reg(machine->cpu[cpunum], REG_PC); /* TODO - Add more registers? */ | |
| 1073 | runtime_hash ^= cpu_get_reg(machine->cpu[cpunum], REG_GENPC); /* TODO - Add more registers? */ | |
| 1074 | 1074 | } |
| 1075 | 1075 | } |
| 1076 | 1076 |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | **************************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" | |
| 13 | 12 | #include "includes/wswan.h" |
| 14 | 13 | #include "streams.h" |
| 15 | 14 | |
| r3957 | r3958 | |
| 141 | 140 | } |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | static | |
| 143 | static STREAM_UPDATE( wswan_sh_update | |
| 145 | 144 | { |
| 146 | 145 | stream_sample_t sample, left, right; |
| 147 | 146 | |
| r3957 | r3958 | |
| 189 | 188 | if ( snd.sweep_count >= snd.sweep_time ) { |
| 190 | 189 | snd.sweep_count = 0; |
| 191 | 190 | snd.audio3.freq += snd.sweep_step; |
| 192 | snd.audio3.period = | |
| 191 | snd.audio3.period = device->machine->sample_rate / ( 3072000 / ( ( 2048 - snd.audio3.freq ) << 5 ) ); | |
| 193 | 192 | } |
| 194 | 193 | } |
| 195 | 194 | left += snd.audio3.vol_left * sample; |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "includes/mac.h" |
| 11 | 11 | #include "streams.h" |
| 12 | #include "deprecat.h" | |
| 13 | 12 | |
| 14 | 13 | |
| 15 | 14 | static sound_stream *mac_stream; |
| r3957 | r3958 | |
| 36 | 35 | /* Stream updater */ |
| 37 | 36 | /************************************/ |
| 38 | 37 | |
| 39 | static | |
| 38 | static STREAM_UPDATE( mac_sound_update | |
| 40 | 39 | { |
| 41 | 40 | INT16 last_val = 0; |
| 42 | 41 | stream_sample_t *buffer = outputs[0]; |
| 43 | 42 | |
| 44 | 43 | /* if we're not enabled, just fill with 0 */ |
| 45 | if ( | |
| 44 | if (device->machine->sample_rate == 0) | |
| 46 | 45 | { |
| 47 | 46 | memset(buffer, 0, samples * sizeof(*buffer)); |
| 48 | 47 | return; |
| r3957 | r3958 | |
|---|---|---|
| 187 | 187 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 188 | 188 | |
| 189 | 189 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 190 | case DEVINFO_STR_NAME: info->s = "LMC1992"; break; | |
| 191 | case DEVINFO_STR_FAMILY: info->s = "LMC1992"; break; | |
| 192 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 193 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 194 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 190 | case DEVINFO_STR_NAME: strcpy(info->s, "LMC1992"); break; | |
| 191 | case DEVINFO_STR_FAMILY: strcpy(info->s, "LMC1992"); break; | |
| 192 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 193 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 194 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 195 | 195 | } |
| 196 | 196 | } |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | static /*bool*/int level; |
| 17 | 17 | static sound_stream *mixer_channel; |
| 18 | 18 | |
| 19 | int gmaster_io_callback(int ioline, int state) | |
| 19 | int gmaster_io_callback(const device_config *device, int ioline, int state) | |
| 20 | 20 | { |
| 21 | 21 | switch (ioline) { |
| 22 | 22 | case UPD7810_TO: |
| r3957 | r3958 | |
| 33 | 33 | /************************************/ |
| 34 | 34 | /* Sound handler update */ |
| 35 | 35 | /************************************/ |
| 36 | static | |
| 36 | static STREAM_UPDATE( gmaster_update | |
| 37 | 37 | { |
| 38 | 38 | int i; |
| 39 | 39 | stream_sample_t *buffer=outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "streams.h" |
| 12 | #include "deprecat.h" | |
| 13 | 12 | |
| 14 | 13 | #include "video/vic6560.h" |
| 15 | 14 | |
| r3957 | r3958 | |
| 146 | 145 | /************************************/ |
| 147 | 146 | /* Sound handler update */ |
| 148 | 147 | /************************************/ |
| 149 | static | |
| 148 | static STREAM_UPDATE( vic6560_update | |
| 150 | 149 | { |
| 151 | 150 | int i, v; |
| 152 | 151 | stream_sample_t *buffer = outputs[0]; |
| r3957 | r3958 | |
| 164 | 163 | if (tone1pos >= tone1samples) |
| 165 | 164 | { |
| 166 | 165 | tone1pos = 0; |
| 167 | tone1samples = | |
| 166 | tone1samples = device->machine->sample_rate / TONE1_FREQUENCY; | |
| 168 | 167 | if (tone1samples == 0) |
| 169 | 168 | tone1samples = 1; |
| 170 | 169 | } |
| r3957 | r3958 | |
| 180 | 179 | if (tone2pos >= tone2samples) |
| 181 | 180 | { |
| 182 | 181 | tone2pos = 0; |
| 183 | tone2samples = | |
| 182 | tone2samples = device->machine->sample_rate / TONE2_FREQUENCY; | |
| 184 | 183 | if (tone2samples == 0) |
| 185 | 184 | tone2samples = 1; |
| 186 | 185 | } |
| r3957 | r3958 | |
| 196 | 195 | if (tone3pos >= tone3samples) |
| 197 | 196 | { |
| 198 | 197 | tone3pos = 0; |
| 199 | tone3samples = | |
| 198 | tone3samples = device->machine->sample_rate / TONE3_FREQUENCY; | |
| 200 | 199 | if (tone3samples == 0) |
| 201 | 200 | tone3samples = 1; |
| 202 | 201 | } |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | #define LMC1992 DEVICE_GET_INFO_NAME(lmc1992) |
| 30 | 30 | |
| 31 | 31 | #define MDRV_LMC1992_ADD(_tag) \ |
| 32 | MDRV_DEVICE_ADD(_tag, LMC1992) | |
| 32 | MDRV_DEVICE_ADD(_tag, LMC1992, 0) | |
| 33 | 33 | |
| 34 | 34 | /* interface */ |
| 35 | 35 | typedef struct _lmc1992_interface lmc1992_interface; |
| r3957 | r3958 | |
|---|---|---|
| 9 | 9 | #include "includes/kaypro.h" |
| 10 | 10 | #include "sound/custom.h" |
| 11 | 11 | #include "streams.h" |
| 12 | #include "deprecat.h" | |
| 13 | 12 | |
| 14 | 13 | #ifdef UNUSED_FUNCTION |
| 15 | 14 | static sound_stream *channel; |
| r3957 | r3958 | |
| 27 | 26 | #endif |
| 28 | 27 | |
| 29 | 28 | #ifdef UNUSED_FUNCTION |
| 30 | static | |
| 29 | static STREAM_UPDATE( kaypro_sound_update | |
| 31 | 30 | { |
| 32 | 31 | stream_sample_t *buffer = outputs[0]; |
| 33 | 32 | |
| r3957 | r3958 | |
| 35 | 34 | { |
| 36 | 35 | if ((bell_counter -= BELL_FREQ) < 0) |
| 37 | 36 | { |
| 38 | bell_counter += | |
| 37 | bell_counter += device->machine->sample_rate; | |
| 39 | 38 | bell_signal = -(bell_signal * 127) / 128; |
| 40 | 39 | } |
| 41 | 40 | if ((click_counter -= CLICK_FREQ) < 0) |
| 42 | 41 | { |
| 43 | click_counter += | |
| 42 | click_counter += device->machine->sample_rate; | |
| 44 | 43 | click_signal = -(click_signal * 3) / 4; |
| 45 | 44 | } |
| 46 | 45 | *buffer++ = bell_signal + click_signal; |
| r3957 | r3958 | |
|---|---|---|
| 726 | 726 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mea8000); break; |
| 727 | 727 | |
| 728 | 728 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 729 | case DEVINFO_STR_NAME: info->s = "Philips / Signetics MEA 8000 speech synthesizer"; break; | |
| 730 | case DEVINFO_STR_FAMILY: info->s = "MEA8000"; break; | |
| 731 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 732 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 733 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 729 | case DEVINFO_STR_NAME: strcpy(info->s, "Philips / Signetics MEA 8000 speech synthesizer"); break; | |
| 730 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MEA8000"); break; | |
| 731 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 732 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 733 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 734 | 734 | } |
| 735 | 735 | } |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | /* Sound handler update */ |
| 42 | 42 | /************************************/ |
| 43 | 43 | |
| 44 | static | |
| 44 | static STREAM_UPDATE( vc4000_update | |
| 45 | 45 | { |
| 46 | 46 | int i; |
| 47 | 47 | stream_sample_t *buffer = outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | |
| 39 | static | |
| 39 | static STREAM_UPDATE( channelf_sh_update | |
| 40 | 40 | { |
| 41 | 41 | UINT32 mask = 0, target = 0; |
| 42 | 42 | stream_sample_t *buffer = outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | static | |
| 180 | static STREAM_UPDATE( dave_update_sound | |
| 181 | 181 | { |
| 182 | 182 | stream_sample_t *buffer1, *buffer2; |
| 183 | 183 | /* 0 = channel 0 left volume, 1 = channel 0 right volume, |
| r3957 | r3958 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | #define MDRV_MEA8000_ADD(_tag, _intrf) \ |
| 28 | MDRV_DEVICE_ADD(_tag, MEA8000) \ | |
| 28 | MDRV_DEVICE_ADD(_tag, MEA8000, 0) \ | |
| 29 | 29 | MDRV_DEVICE_CONFIG(_intrf) |
| 30 | 30 | |
| 31 | 31 | #define MDRV_MEA8000_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | #include "includes/special.h" |
| 16 | 16 | |
| 17 | 17 | static CUSTOM_START( specimx_sh_start ); |
| 18 | static | |
| 18 | static STREAM_UPDATE( specimx_sh_update | |
| 19 | 19 | |
| 20 | 20 | static sound_stream *mixer_channel; |
| 21 | 21 | static int specimx_input[3]; |
| r3957 | r3958 | |
| 34 | 34 | return (void *) ~0; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | static | |
| 37 | static STREAM_UPDATE( specimx_sh_update | |
| 38 | 38 | { |
| 39 | 39 | INT16 channel_0_signal; |
| 40 | 40 | INT16 channel_1_signal; |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | /* Sound handler update */ |
| 45 | 45 | /************************************/ |
| 46 | 46 | |
| 47 | static | |
| 47 | static STREAM_UPDATE( arcadia_update | |
| 48 | 48 | { |
| 49 | 49 | int i; |
| 50 | 50 | stream_sample_t *buffer = outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | static UINT8 snd_regs[0x30]; |
| 157 | 157 | |
| 158 | static | |
| 158 | static STREAM_UPDATE( gameboy_update | |
| 159 | 159 | |
| 160 | 160 | |
| 161 | 161 | READ8_HANDLER( gb_wave_r ) |
| r3957 | r3958 | |
| 388 | 388 | |
| 389 | 389 | |
| 390 | 390 | |
| 391 | static | |
| 391 | static STREAM_UPDATE( gameboy_update | |
| 392 | 392 | { |
| 393 | 393 | stream_sample_t sample, left, right, mode4_mask; |
| 394 | 394 |
| r3957 | r3958 | |
|---|---|---|
| 185 | 185 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1863); break; |
| 186 | 186 | |
| 187 | 187 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 188 | case DEVINFO_STR_NAME: info->s = "RCA CDP1863"; break; | |
| 189 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break; | |
| 190 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 191 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 192 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 188 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1863"); break; | |
| 189 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; | |
| 190 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 191 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 192 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 193 | 193 | } |
| 194 | 194 | } |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | ******************************************************************************/ |
| 4 | 4 | |
| 5 | 5 | #include "driver.h" |
| 6 | #include "deprecat.h" | |
| 7 | 6 | #include "streams.h" |
| 8 | 7 | #include "includes/lynx.h" |
| 9 | 8 | |
| r3957 | r3958 | |
| 258 | 257 | /************************************/ |
| 259 | 258 | /* Sound handler update */ |
| 260 | 259 | /************************************/ |
| 261 | static | |
| 260 | static STREAM_UPDATE( lynx_update | |
| 262 | 261 | { |
| 263 | 262 | int i, j; |
| 264 | 263 | LYNX_AUDIO *channel; |
| r3957 | r3958 | |
| 270 | 269 | *buffer = 0; |
| 271 | 270 | for (channel=lynx_audio, j=0; j<ARRAY_LENGTH(lynx_audio); j++, channel++) |
| 272 | 271 | { |
| 273 | lynx_audio_execute( | |
| 272 | lynx_audio_execute(device->machine, channel); | |
| 274 | 273 | v=channel->reg.n.output; |
| 275 | 274 | *buffer+=v*15; |
| 276 | 275 | } |
| 277 | 276 | } |
| 278 | 277 | } |
| 279 | 278 | |
| 280 | static | |
| 279 | static STREAM_UPDATE( lynx2_update | |
| 281 | 280 | { |
| 282 | 281 | stream_sample_t *left=outputs[0], *right=outputs[1]; |
| 283 | 282 | int i, j; |
| r3957 | r3958 | |
| 290 | 289 | *right= 0; |
| 291 | 290 | for (channel=lynx_audio, j=0; j<ARRAY_LENGTH(lynx_audio); j++, channel++) |
| 292 | 291 | { |
| 293 | lynx_audio_execute( | |
| 292 | lynx_audio_execute(device->machine, channel); | |
| 294 | 293 | v=channel->reg.n.output; |
| 295 | 294 | if (!(master_enable&(0x10<<j))) |
| 296 | 295 | { |
| r3957 | r3958 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "streams.h" |
| 9 | #include "deprecat.h" | |
| 10 | 9 | #include "includes/svision.h" |
| 11 | 10 | |
| 12 | 11 | |
| r3957 | r3958 | |
| 109 | 108 | /************************************/ |
| 110 | 109 | /* Sound handler update */ |
| 111 | 110 | /************************************/ |
| 112 | static | |
| 111 | static STREAM_UPDATE( svision_update | |
| 113 | 112 | { |
| 114 | 113 | stream_sample_t *left=outputs[0], *right=outputs[1]; |
| 115 | 114 | int i, j; |
| r3957 | r3958 | |
| 191 | 190 | UINT16 addr = svision_dma.start + (unsigned) svision_dma.pos / 2; |
| 192 | 191 | if (addr >= 0x8000 && addr < 0xc000) |
| 193 | 192 | { |
| 194 | sample = memory_region( | |
| 193 | sample = memory_region(device->machine, "user1")[(addr & 0x3fff) | svision_dma.ca14to16]; | |
| 195 | 194 | } |
| 196 | 195 | else |
| 197 | 196 | { |
| 198 | sample = memory_read_byte(cpu_get_address_space( | |
| 197 | sample = memory_read_byte(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), addr); | |
| 199 | 198 | } |
| 200 | 199 | if (((unsigned)svision_dma.pos) & 1) |
| 201 | 200 | s = (sample & 0xf); |
| r3957 | r3958 | |
| 211 | 210 | { |
| 212 | 211 | svision_dma.finished = TRUE; |
| 213 | 212 | svision_dma.on = FALSE; |
| 214 | svision_irq( | |
| 213 | svision_irq( device->machine ); | |
| 215 | 214 | } |
| 216 | 215 | } |
| 217 | 216 | } |
| r3957 | r3958 | |
|---|---|---|
| 104 | 104 | /************************************/ |
| 105 | 105 | /* Sound handler update */ |
| 106 | 106 | /************************************/ |
| 107 | static | |
| 107 | static STREAM_UPDATE( ted7360_update | |
| 108 | 108 | { |
| 109 | 109 | int i, v, a; |
| 110 | 110 | stream_sample_t *buffer = outputs[0]; |
| r3957 | r3958 | |
|---|---|---|
| 14 | 14 | #include "machine/8255ppi.h" |
| 15 | 15 | #include "includes/dai.h" |
| 16 | 16 | #include "streams.h" |
| 17 | #include "deprecat.h" | |
| 18 | 17 | |
| 19 | 18 | static CUSTOM_START( dai_sh_start ); |
| 20 | static | |
| 19 | static STREAM_UPDATE( dai_sh_update | |
| 21 | 20 | |
| 22 | 21 | static sound_stream *mixer_channel; |
| 23 | 22 | |
| r3957 | r3958 | |
| 62 | 61 | return (void *) ~0; |
| 63 | 62 | } |
| 64 | 63 | |
| 65 | static | |
| 64 | static STREAM_UPDATE( dai_sh_update | |
| 66 | 65 | { |
| 67 | 66 | INT16 channel_0_signal; |
| 68 | 67 | INT16 channel_1_signal; |
| r3957 | r3958 | |
| 94 | 93 | |
| 95 | 94 | /* noise channel */ |
| 96 | 95 | |
| 97 | *sample_left += mame_rand( | |
| 96 | *sample_left += mame_rand(device->machine)&0x01 ? dai_noise_volume_table[dai_noise_volume] : -dai_noise_volume_table[dai_noise_volume]; | |
| 98 | 97 | |
| 99 | 98 | sample_left++; |
| 100 | 99 | sample_right++; |
| r3957 | r3958 | |
|---|---|---|
| 608 | 608 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(i8275); break; |
| 609 | 609 | |
| 610 | 610 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 611 | case DEVINFO_STR_NAME: info->s = "Intel 8275"; break; | |
| 612 | case DEVINFO_STR_FAMILY: info->s = "Intel 8275"; break; | |
| 613 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 614 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 615 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 611 | case DEVINFO_STR_NAME: strcpy(info->s, "Intel 8275"); break; | |
| 612 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Intel 8275"); break; | |
| 613 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 614 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 615 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 616 | 616 | } |
| 617 | 617 | } |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | ***************************************************************************/ |
| 67 | 67 | |
| 68 | 68 | #define MDRV_I8275_ADD(_tag, _intrf) \ |
| 69 | MDRV_DEVICE_ADD(_tag, I8275) \ | |
| 69 | MDRV_DEVICE_ADD(_tag, I8275, 0) \ | |
| 70 | 70 | MDRV_DEVICE_CONFIG(_intrf) |
| 71 | 71 | |
| 72 | 72 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 188 | 188 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1862); break; |
| 189 | 189 | |
| 190 | 190 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 191 | case DEVINFO_STR_NAME: info->s = "RCA CDP1862"; break; | |
| 192 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break; | |
| 193 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 194 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 195 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 191 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1862"); break; | |
| 192 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; | |
| 193 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 194 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 195 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 196 | 196 | } |
| 197 | 197 | } |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | struct _cdp1862_interface |
| 34 | 34 | { |
| 35 | 35 | const char *screen_tag; /* screen we are acting on */ |
| 36 | int clock; /* the clock (pin 14) of the chip */ | |
| 37 | 36 | |
| 38 | 37 | double res_r; /* red output resistor value */ |
| 39 | 38 | double res_g; /* green output resistor value */ |
| r3957 | r3958 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | static CDP1869_INTERFACE( tmc600_cdp1869_intf ) |
| 113 | 113 | { |
| 114 | SCREEN_TAG, | |
| 115 | "main", | |
| 116 | CDP1869_DOT_CLK_PAL, | |
| 117 | CDP1869_COLOR_CLK_PAL, | |
| 118 | 114 | CDP1869_PAL, |
| 119 | 115 | tmc600_page_ram_r, |
| 120 | 116 | tmc600_page_ram_w, |
| r3957 | r3958 | |
| 172 | 168 | MDRV_VIDEO_UPDATE(tmc600) |
| 173 | 169 | MDRV_SCREEN_RAW_PARAMS(CDP1869_DOT_CLK_PAL, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) |
| 174 | 170 | |
| 175 | MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO) | |
| 176 | MDRV_DEVICE_CONFIG(tmc600_cdp1869_intf) | |
| 171 | MDRV_CDP1869_ADD(CDP1869_TAG, SCREEN_TAG, CDP1869_DOT_CLK_PAL, CDP1869_COLOR_CLK_PAL, "main", tmc600_cdp1869_intf) | |
| 177 | 172 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | static const mc6845_interface abc800m_mc6845_interface = { |
| 123 | 123 | SCREEN_TAG, |
| 124 | ABC800_CCLK, | |
| 125 | 124 | ABC800_CHAR_WIDTH, |
| 126 | 125 | NULL, |
| 127 | 126 | abc800m_update_row, |
| r3957 | r3958 | |
| 292 | 291 | /* Machine Drivers */ |
| 293 | 292 | |
| 294 | 293 | MACHINE_DRIVER_START( abc800m_video ) |
| 295 | MDRV_DEVICE_ADD(MC6845_TAG, MC6845) | |
| 296 | MDRV_DEVICE_CONFIG(abc800m_mc6845_interface) | |
| 294 | MDRV_MC6845_ADD(MC6845_TAG, MC6845, ABC800_CCLK, abc800m_mc6845_interface) | |
| 297 | 295 | |
| 298 | 296 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 299 | 297 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| r3957 | r3958 | |
|---|---|---|
| 186 | 186 | vectrex_configuration(screen->machine); |
| 187 | 187 | |
| 188 | 188 | /* start black */ |
| 189 | vector_add_point(vectrex_points[display_start].x, | |
| 189 | vector_add_point(screen->machine, | |
| 190 | vectrex_points[display_start].x, | |
| 190 | 191 | vectrex_points[display_start].y, |
| 191 | 192 | vectrex_points[display_start].col, |
| 192 | 193 | 0); |
| 193 | 194 | |
| 194 | 195 | for (i = display_start; i != display_end; i = (i + 1) % NVECT) |
| 195 | 196 | { |
| 196 | vector_add_point(vectrex_points[i].x, | |
| 197 | vector_add_point(screen->machine, | |
| 198 | vectrex_points[i].x, | |
| 197 | 199 | vectrex_points[i].y, |
| 198 | 200 | vectrex_points[i].col, |
| 199 | 201 | vectrex_points[i].intensity); |
| r3957 | r3958 | |
|---|---|---|
| 734 | 734 | assert(crtc_ega->intf->hpixels_per_column > 0); |
| 735 | 735 | |
| 736 | 736 | /* copy the initial parameters */ |
| 737 | crtc_ega->clock = crtc_ega-> | |
| 737 | crtc_ega->clock = crtc_ega-> | |
| 738 | 738 | crtc_ega->hpixels_per_column = crtc_ega->intf->hpixels_per_column; |
| 739 | 739 | |
| 740 | 740 | /* get the screen device */ |
| r3957 | r3958 | |
| 864 | 864 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(crtc_ega); break; |
| 865 | 865 | |
| 866 | 866 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 867 | case DEVINFO_STR_NAME: info->s = "IBM EGA CRTC"; break; | |
| 868 | case DEVINFO_STR_FAMILY: info->s = "EGA CRTC"; break; | |
| 869 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 870 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 871 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 867 | case DEVINFO_STR_NAME: strcpy(info->s, "IBM EGA CRTC"); break; | |
| 868 | case DEVINFO_STR_FAMILY: strcpy(info->s, "EGA CRTC"); break; | |
| 869 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 870 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 871 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | 874 |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | #define CRTC_EGA DEVICE_GET_INFO_NAME(crtc_ega) |
| 12 | 12 | |
| 13 | #define MDRV_CRTC_EGA_ADD(_tag, _clock, _intrf) \ | |
| 14 | MDRV_DEVICE_ADD(_tag, CRTC_EGA, _clock) \ | |
| 15 | MDRV_DEVICE_CONFIG(_intrf) | |
| 13 | 16 | |
| 14 | 17 | /* callback definitions */ |
| 15 | 18 | typedef void * (*crtc_ega_begin_update_func)(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); |
| r3957 | r3958 | |
| 43 | 46 | struct _crtc_ega_interface |
| 44 | 47 | { |
| 45 | 48 | const char *screen_tag; /* screen we are acting on */ |
| 46 | int clock; /* the clock of the chip */ | |
| 47 | 49 | int hpixels_per_column; /* number of pixels per video memory address */ |
| 48 | 50 | |
| 49 | 51 | /* if specified, this gets called before any pixel update, |
| r3957 | r3958 | |
|---|---|---|
| 299 | 299 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(zx8301); break; |
| 300 | 300 | |
| 301 | 301 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 302 | case DEVINFO_STR_NAME: info->s = "Sinclair ZX8301"; break; | |
| 303 | case DEVINFO_STR_FAMILY: info->s = "Sinclair ZX83"; break; | |
| 304 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 305 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 306 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 302 | case DEVINFO_STR_NAME: strcpy(info->s, "Sinclair ZX8301"); break; | |
| 303 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Sinclair ZX83"); break; | |
| 304 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 305 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 306 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 307 | 307 | } |
| 308 | 308 | } |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | #define ZX8301 DEVICE_GET_INFO_NAME( zx8301 ) |
| 48 | 48 | |
| 49 | #define MDRV_ZX8301_ADD(_tag, _clock, _config) \ | |
| 50 | MDRV_DEVICE_ADD(_tag, ZX8301, _clock) \ | |
| 51 | MDRV_DEVICE_CONFIG(_config) | |
| 52 | ||
| 49 | 53 | /* interface */ |
| 50 | 54 | typedef struct _zx8301_interface zx8301_interface; |
| 51 | 55 | struct _zx8301_interface |
| 52 | 56 | { |
| 53 | 57 | const char *screen_tag; /* screen we are acting on */ |
| 54 | int clock; /* the clock (pin 7) of the chip */ | |
| 55 | 58 | |
| 56 | 59 | /* this gets called for every change of the VSYNC pin (pin 11) */ |
| 57 | 60 | zx8301_on_vsync_changed_func on_vsync_changed; |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | static const mc6845_interface mc6845_mda_intf = |
| 67 | 67 | { |
| 68 | 68 | MDA_SCREEN_NAME, /* screen number */ |
| 69 | MDA_CLOCK/9 /*?*/, /* clock */ | |
| 70 | 69 | 9, /* number of pixels per video memory address */ |
| 71 | 70 | NULL, /* begin_update */ |
| 72 | 71 | mda_update_row, /* update_row */ |
| r3957 | r3958 | |
| 84 | 83 | |
| 85 | 84 | MDRV_PALETTE_INIT(pc_mda) |
| 86 | 85 | |
| 87 | MDRV_DEVICE_ADD( MDA_MC6845_NAME, MC6845) | |
| 88 | MDRV_DEVICE_CONFIG( mc6845_mda_intf ) | |
| 86 | MDRV_MC6845_ADD( MDA_MC6845_NAME, MC6845, MDA_CLOCK/9, mc6845_mda_intf) | |
| 89 | 87 | |
| 90 | 88 | MDRV_VIDEO_START( pc_mda ) |
| 91 | 89 | MDRV_VIDEO_UPDATE( mc6845_mda) |
| r3957 | r3958 | |
| 424 | 422 | static const mc6845_interface mc6845_hercules_intf = |
| 425 | 423 | { |
| 426 | 424 | HERCULES_SCREEN_NAME, /* screen number */ |
| 427 | MDA_CLOCK/9 /*?*/, /* clock */ | |
| 428 | 425 | 9, /* number of pixels per video memory address */ |
| 429 | 426 | NULL, /* begin_update */ |
| 430 | 427 | mda_update_row, /* update_row */ |
| r3957 | r3958 | |
| 442 | 439 | |
| 443 | 440 | MDRV_PALETTE_INIT(pc_mda) |
| 444 | 441 | |
| 445 | MDRV_DEVICE_ADD( HERCULES_MC6845_NAME, MC6845) | |
| 446 | MDRV_DEVICE_CONFIG( mc6845_hercules_intf ) | |
| 442 | MDRV_MC6845_ADD( HERCULES_MC6845_NAME, MC6845, MDA_CLOCK/9, mc6845_hercules_intf) | |
| 447 | 443 | |
| 448 | 444 | MDRV_VIDEO_START( pc_hercules ) |
| 449 | 445 | MDRV_VIDEO_UPDATE( mc6845_hercules ) |
| r3957 | r3958 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | static const mc6845_interface mc6845_t1000_intf = { |
| 34 | 34 | T1000_SCREEN_NAME, /* screen number */ |
| 35 | XTAL_14_31818MHz/8, /* clock, needs verification */ | |
| 36 | 35 | 8, /* numbers of pixels per video memory address */ |
| 37 | 36 | NULL, /* begin_update */ |
| 38 | 37 | t1000_update_row, /* update_row */ |
| r3957 | r3958 | |
| 50 | 49 | MDRV_PALETTE_LENGTH( 16 ) |
| 51 | 50 | MDRV_PALETTE_INIT(pcjr) |
| 52 | 51 | |
| 53 | MDRV_DEVICE_ADD(T1000_MC6845_NAME, MC6845) | |
| 54 | MDRV_DEVICE_CONFIG( mc6845_t1000_intf ) | |
| 52 | MDRV_MC6845_ADD(T1000_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_t1000_intf) | |
| 55 | 53 | |
| 56 | 54 | MDRV_VIDEO_START(pc_t1t) |
| 57 | 55 | MDRV_VIDEO_UPDATE( mc6845_t1000 ) |
| r3957 | r3958 | |
| 60 | 58 | |
| 61 | 59 | static const mc6845_interface mc6845_pcjr_intf = { |
| 62 | 60 | T1000_SCREEN_NAME, /* screen number */ |
| 63 | XTAL_14_31818MHz/16, /* clock, needs verification */ | |
| 64 | 61 | 8, /* numbers of pixels per video memory address */ |
| 65 | 62 | NULL, /* begin_update */ |
| 66 | 63 | t1000_update_row, /* update_row */ |
| r3957 | r3958 | |
| 78 | 75 | MDRV_PALETTE_LENGTH( 16 ) |
| 79 | 76 | MDRV_PALETTE_INIT(pcjr) |
| 80 | 77 | |
| 81 | MDRV_DEVICE_ADD(T1000_MC6845_NAME, MC6845) | |
| 82 | MDRV_DEVICE_CONFIG( mc6845_pcjr_intf ) | |
| 78 | MDRV_MC6845_ADD(T1000_MC6845_NAME, MC6845, XTAL_14_31818MHz/16, mc6845_pcjr_intf) | |
| 83 | 79 | |
| 84 | 80 | MDRV_VIDEO_START(pc_pcjr) |
| 85 | 81 | MDRV_VIDEO_UPDATE( mc6845_t1000 ) |
| r3957 | r3958 | |
|---|---|---|
| 27 | 27 | static CDP1861_INTERFACE( tmc1800_cdp1861_intf ) |
| 28 | 28 | { |
| 29 | 29 | SCREEN_TAG, |
| 30 | XTAL_1_75MHz, | |
| 31 | 30 | tmc1800_int_w, |
| 32 | 31 | tmc1800_dmao_w, |
| 33 | 32 | tmc1800_efx_w |
| r3957 | r3958 | |
| 64 | 63 | static CDP1864_INTERFACE( tmc2000_cdp1864_intf ) |
| 65 | 64 | { |
| 66 | 65 | SCREEN_TAG, |
| 67 | XTAL_1_75MHz, | |
| 68 | 66 | CDP1864_INTERLACED, |
| 69 | 67 | tmc2000_int_w, |
| 70 | 68 | tmc2000_dmao_w, |
| r3957 | r3958 | |
| 106 | 104 | static CDP1864_INTERFACE( oscnano_cdp1864_intf ) |
| 107 | 105 | { |
| 108 | 106 | SCREEN_TAG, |
| 109 | XTAL_1_75MHz, | |
| 110 | 107 | CDP1864_INTERLACED, |
| 111 | 108 | oscnano_int_w, |
| 112 | 109 | oscnano_dmao_w, |
| r3957 | r3958 | |
| 148 | 145 | MDRV_PALETTE_INIT(black_and_white) |
| 149 | 146 | MDRV_VIDEO_UPDATE(tmc1800) |
| 150 | 147 | |
| 151 | MDRV_DEVICE_ADD(CDP1861_TAG, CDP1861) | |
| 152 | MDRV_DEVICE_CONFIG(tmc1800_cdp1861_intf) | |
| 148 | MDRV_CDP1861_ADD(CDP1861_TAG, XTAL_1_75MHz, tmc1800_cdp1861_intf) | |
| 153 | 149 | MACHINE_DRIVER_END |
| 154 | 150 | |
| 155 | 151 | MACHINE_DRIVER_START( osc1000b_video ) |
| r3957 | r3958 | |
| 173 | 169 | MDRV_PALETTE_LENGTH(8+8) |
| 174 | 170 | MDRV_VIDEO_UPDATE(tmc2000) |
| 175 | 171 | |
| 176 | MDRV_DEVICE_ADD(CDP1864_TAG, CDP1864) | |
| 177 | MDRV_DEVICE_CONFIG(tmc2000_cdp1864_intf) | |
| 172 | MDRV_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, tmc2000_cdp1864_intf) | |
| 178 | 173 | MACHINE_DRIVER_END |
| 179 | 174 | |
| 180 | 175 | MACHINE_DRIVER_START( oscnano_video ) |
| r3957 | r3958 | |
| 185 | 180 | MDRV_PALETTE_LENGTH(8+8) |
| 186 | 181 | MDRV_VIDEO_UPDATE(oscnano) |
| 187 | 182 | |
| 188 | MDRV_DEVICE_ADD(CDP1864_TAG, CDP1864) | |
| 189 | MDRV_DEVICE_CONFIG(oscnano_cdp1864_intf) | |
| 183 | MDRV_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, oscnano_cdp1864_intf) | |
| 190 | 184 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | static const mc6845_interface mc6845_aga_intf = { |
| 36 | 36 | AGA_SCREEN_NAME, /* screen number */ |
| 37 | XTAL_14_31818MHz/8, /* clock */ | |
| 38 | 37 | 8, /* numbers of pixels per video memory address */ |
| 39 | 38 | NULL, /* begin_update */ |
| 40 | 39 | aga_update_row, /* update_row */ |
| r3957 | r3958 | |
| 73 | 72 | |
| 74 | 73 | MDRV_PALETTE_INIT( pc_aga ) |
| 75 | 74 | |
| 76 | MDRV_DEVICE_ADD( AGA_MC6845_NAME, MC6845 ) | |
| 77 | MDRV_DEVICE_CONFIG( mc6845_aga_intf ) | |
| 75 | MDRV_MC6845_ADD( AGA_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_aga_intf ) | |
| 78 | 76 | |
| 79 | 77 | MDRV_VIDEO_START( pc_aga ) |
| 80 | 78 | MDRV_VIDEO_UPDATE( mc6845_aga ) |
| r3957 | r3958 | |
|---|---|---|
| 194 | 194 | static const mc6845_interface mc6845_cga_intf = |
| 195 | 195 | { |
| 196 | 196 | CGA_SCREEN_NAME, /* screen number */ |
| 197 | XTAL_14_31818MHz/8, /* clock */ | |
| 198 | 197 | 8, /* numbers of pixels per video memory address */ |
| 199 | 198 | NULL, /* begin_update */ |
| 200 | 199 | cga_update_row, /* update_row */ |
| r3957 | r3958 | |
| 213 | 212 | |
| 214 | 213 | MDRV_PALETTE_INIT(pc_cga) |
| 215 | 214 | |
| 216 | MDRV_DEVICE_ADD(CGA_MC6845_NAME, MC6845) | |
| 217 | MDRV_DEVICE_CONFIG( mc6845_cga_intf ) | |
| 215 | MDRV_MC6845_ADD(CGA_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_cga_intf) | |
| 218 | 216 | |
| 219 | 217 | MDRV_VIDEO_START( pc_cga ) |
| 220 | 218 | MDRV_VIDEO_UPDATE( mc6845_cga ) |
| r3957 | r3958 | |
|---|---|---|
| 534 | 534 | static const crtc_ega_interface crtc_ega_ega_intf = |
| 535 | 535 | { |
| 536 | 536 | EGA_SCREEN_NAME, /* screen number */ |
| 537 | 16257000/8, /* clock */ | |
| 538 | 537 | 8, /* numbers of pixels per video memory address */ |
| 539 | 538 | NULL, /* begin_update */ |
| 540 | 539 | ega_update_row, /* update_row */ |
| r3957 | r3958 | |
| 554 | 553 | |
| 555 | 554 | MDRV_PALETTE_INIT(pc_ega) |
| 556 | 555 | |
| 557 | MDRV_DEVICE_ADD(EGA_CRTC_NAME, CRTC_EGA) | |
| 558 | MDRV_DEVICE_CONFIG( crtc_ega_ega_intf ) | |
| 556 | MDRV_CRTC_EGA_ADD(EGA_CRTC_NAME, 16257000/8, crtc_ega_ega_intf) | |
| 559 | 557 | |
| 560 | 558 | MDRV_VIDEO_START( pc_ega ) |
| 561 | 559 | MDRV_VIDEO_UPDATE( pc_ega ) |
| r3957 | r3958 | |
|---|---|---|
| 409 | 409 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(msm6255); break; |
| 410 | 410 | |
| 411 | 411 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 412 | case DEVINFO_STR_NAME: info->s = "OKI MSM6255"; break; | |
| 413 | case DEVINFO_STR_FAMILY: info->s = "OKI MSM6255"; break; | |
| 414 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 415 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 416 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 412 | case DEVINFO_STR_NAME: strcpy(info->s, "OKI MSM6255"); break; | |
| 413 | case DEVINFO_STR_FAMILY: strcpy(info->s, "OKI MSM6255"); break; | |
| 414 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 415 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 416 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 417 | 417 | } |
| 418 | 418 | } |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | #define MSM6255 DEVICE_GET_INFO_NAME(msm6255) |
| 17 | 17 | |
| 18 | 18 | #define MDRV_MSM6255_ADD(_tag, _intrf) \ |
| 19 | MDRV_DEVICE_ADD(_tag, MSM6255) \ | |
| 19 | MDRV_DEVICE_ADD(_tag, MSM6255, 0) \ | |
| 20 | 20 | MDRV_DEVICE_CONFIG(_intrf) |
| 21 | 21 | |
| 22 | 22 | #define MDRV_MSM6255_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 442 | 442 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1864); break; |
| 443 | 443 | |
| 444 | 444 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 445 | case DEVINFO_STR_NAME: info->s = "RCA CDP1861"; break; | |
| 446 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break; | |
| 447 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 448 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 449 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 445 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1861"); break; | |
| 446 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; | |
| 447 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 448 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 449 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 450 | 450 | } |
| 451 | 451 | } |
| r3957 | r3958 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | #define CDP1864 DEVICE_GET_INFO_NAME(cdp1864) |
| 73 | 73 | |
| 74 | #define MDRV_CDP1864_ADD(_tag, _clock, _config) \ | |
| 75 | MDRV_DEVICE_ADD(_tag, CDP1864, _clock) \ | |
| 76 | MDRV_DEVICE_CONFIG(_config) | |
| 77 | ||
| 74 | 78 | typedef enum _cdp1864_format cdp1864_format; |
| 75 | 79 | enum _cdp1864_format { |
| 76 | 80 | CDP1864_NON_INTERLACED = 0, |
| r3957 | r3958 | |
| 82 | 86 | struct _cdp1864_interface |
| 83 | 87 | { |
| 84 | 88 | const char *screen_tag; /* screen we are acting on */ |
| 85 | int clock; /* the clock (pin 2) of the chip */ | |
| 86 | 89 | |
| 87 | 90 | cdp1864_format interlace; /* interlace */ |
| 88 | 91 |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | static CDP1869_INTERFACE( comx35p_cdp1869_intf ) |
| 72 | 72 | { |
| 73 | SCREEN_TAG, | |
| 74 | CDP1802_TAG, | |
| 75 | CDP1869_DOT_CLK_PAL, | |
| 76 | CDP1869_COLOR_CLK_PAL, | |
| 77 | 73 | CDP1869_PAL, |
| 78 | 74 | comx35_pageram_r, |
| 79 | 75 | comx35_pageram_w, |
| r3957 | r3958 | |
| 85 | 81 | |
| 86 | 82 | static CDP1869_INTERFACE( comx35n_cdp1869_intf ) |
| 87 | 83 | { |
| 88 | SCREEN_TAG, | |
| 89 | CDP1802_TAG, | |
| 90 | CDP1869_DOT_CLK_NTSC, | |
| 91 | CDP1869_COLOR_CLK_NTSC, | |
| 92 | 84 | CDP1869_NTSC, |
| 93 | 85 | comx35_pageram_r, |
| 94 | 86 | comx35_pageram_w, |
| r3957 | r3958 | |
| 195 | 187 | static const mc6845_interface comx35_mc6845_interface = |
| 196 | 188 | { |
| 197 | 189 | MC6845_SCREEN_TAG, |
| 198 | XTAL_14_31818MHz, | |
| 199 | 190 | 8, |
| 200 | 191 | NULL, |
| 201 | 192 | comx35_update_row, |
| r3957 | r3958 | |
| 215 | 206 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 216 | 207 | MDRV_SCREEN_REFRESH_RATE(50) |
| 217 | 208 | |
| 218 | MDRV_DEVICE_ADD(MC6845_TAG, MC6845) | |
| 219 | MDRV_DEVICE_CONFIG(comx35_mc6845_interface) | |
| 209 | MDRV_MC6845_ADD(MC6845_TAG, MC6845, XTAL_14_31818MHz, comx35_mc6845_interface) | |
| 220 | 210 | MACHINE_DRIVER_END |
| 221 | 211 | |
| 222 | 212 | MACHINE_DRIVER_START( comx35p_video ) |
| r3957 | r3958 | |
| 232 | 222 | MDRV_VIDEO_START(comx35) |
| 233 | 223 | MDRV_VIDEO_UPDATE(comx35) |
| 234 | 224 | |
| 235 | MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO) | |
| 236 | MDRV_DEVICE_CONFIG(comx35p_cdp1869_intf) | |
| 225 | MDRV_CDP1869_ADD(CDP1869_TAG, SCREEN_TAG, CDP1869_DOT_CLK_PAL, CDP1869_COLOR_CLK_PAL, CDP1802_TAG, comx35p_cdp1869_intf) | |
| 237 | 226 | |
| 238 | 227 | MDRV_IMPORT_FROM(comx35_80_video) |
| 239 | 228 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 251 | 240 | MDRV_VIDEO_START(comx35) |
| 252 | 241 | MDRV_VIDEO_UPDATE(comx35) |
| 253 | 242 | |
| 254 | MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO) | |
| 255 | MDRV_DEVICE_CONFIG(comx35n_cdp1869_intf) | |
| 243 | MDRV_CDP1869_ADD(CDP1869_TAG, SCREEN_TAG, CDP1869_DOT_CLK_NTSC, CDP1869_COLOR_CLK_NTSC, CDP1802_TAG, comx35n_cdp1869_intf) | |
| 256 | 244 | |
| 257 | 245 | MDRV_IMPORT_FROM(comx35_80_video) |
| 258 | 246 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 202 | 202 | |
| 203 | 203 | static const mc6845_interface abc802_mc6845_interface = { |
| 204 | 204 | SCREEN_TAG, |
| 205 | ABC800_CCLK, | |
| 206 | 205 | ABC800_CHAR_WIDTH, |
| 207 | 206 | NULL, |
| 208 | 207 | abc802_update_row, |
| r3957 | r3958 | |
| 258 | 257 | |
| 259 | 258 | MACHINE_DRIVER_START( abc802_video ) |
| 260 | 259 | // device interface |
| 261 | MDRV_DEVICE_ADD(MC6845_TAG, MC6845) | |
| 262 | MDRV_DEVICE_CONFIG(abc802_mc6845_interface) | |
| 260 | MDRV_MC6845_ADD(MC6845_TAG, MC6845, ABC800_CCLK, abc802_mc6845_interface) | |
| 263 | 261 | |
| 264 | 262 | // video hardware |
| 265 | 263 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 578 | 578 | odyssey2_sh_start |
| 579 | 579 | }; |
| 580 | 580 | |
| 581 | ||
| 581 | STREAM_UPDATE( odyssey2_sh_update | |
| 582 | 582 | { |
| 583 | 583 | static UINT32 signal; |
| 584 | 584 | static UINT16 count = 0; |
| r3957 | r3958 | |
| 622 | 622 | /* Throw an interrupt if enabled */ |
| 623 | 623 | if( o2_vdc.s.control & 0x4 ) |
| 624 | 624 | { |
| 625 | cpu_set_input_line( | |
| 625 | cpu_set_input_line(device->machine->cpu[0], 1, HOLD_LINE); /* Is this right? */ | |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | /* Adjust volume */ |
| r3957 | r3958 | |
|---|---|---|
| 378 | 378 | |
| 379 | 379 | static const mc6845_interface abc806_mc6845_interface = { |
| 380 | 380 | SCREEN_TAG, |
| 381 | ABC800_CCLK, | |
| 382 | 381 | ABC800_CHAR_WIDTH, |
| 383 | 382 | NULL, |
| 384 | 383 | abc806_update_row, |
| r3957 | r3958 | |
| 503 | 502 | |
| 504 | 503 | MACHINE_DRIVER_START( abc806_video ) |
| 505 | 504 | /* device interface */ |
| 506 | MDRV_DEVICE_ADD(MC6845_TAG, MC6845) | |
| 507 | MDRV_DEVICE_CONFIG(abc806_mc6845_interface) | |
| 505 | MDRV_MC6845_ADD(MC6845_TAG, MC6845, ABC800_CCLK, abc806_mc6845_interface) | |
| 508 | 506 | |
| 509 | 507 | /* video hardware */ |
| 510 | 508 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | static CDP1869_INTERFACE( pecom_cdp1869_intf ) |
| 82 | 82 | { |
| 83 | SCREEN_TAG, | |
| 84 | "main", | |
| 85 | CDP1869_DOT_CLK_PAL, | |
| 86 | CDP1869_COLOR_CLK_PAL, | |
| 87 | 83 | CDP1869_PAL, |
| 88 | 84 | pecom_page_ram_r, |
| 89 | 85 | pecom_page_ram_w, |
| r3957 | r3958 | |
| 132 | 128 | MDRV_VIDEO_UPDATE(pecom) |
| 133 | 129 | MDRV_SCREEN_RAW_PARAMS(CDP1869_DOT_CLK_PAL, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) |
| 134 | 130 | |
| 135 | MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO) | |
| 136 | MDRV_DEVICE_CONFIG(pecom_cdp1869_intf) | |
| 131 | MDRV_CDP1869_ADD(CDP1869_TAG, SCREEN_TAG, CDP1869_DOT_CLK_PAL, CDP1869_COLOR_CLK_PAL, "main", pecom_cdp1869_intf) | |
| 137 | 132 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 179 | 179 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( dl1416 ); break; |
| 180 | 180 | |
| 181 | 181 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 182 | case DEVINFO_STR_NAME: info->s = "DL1416"; break; | |
| 183 | case DEVINFO_STR_FAMILY: info->s = "DL1416"; break; | |
| 184 | case DEVINFO_STR_VERSION: info->s = "1.1"; break; | |
| 185 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 186 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 182 | case DEVINFO_STR_NAME: strcpy(info->s, "DL1416"); break; | |
| 183 | case DEVINFO_STR_FAMILY: strcpy(info->s, "DL1416"); break; | |
| 184 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.1"); break; | |
| 185 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 186 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 |
| r3957 | r3958 | |
|---|---|---|
| 249 | 249 | MDRV_SCREEN_ADD("main", RASTER) |
| 250 | 250 | MDRV_SCREEN_REFRESH_RATE(50) |
| 251 | 251 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(SAA5050_VBLANK)) |
| 252 | MDRV_ | |
| 252 | MDRV_QUANTUM_TIME | |
| 253 | 253 | |
| 254 | 254 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 255 | 255 | MDRV_SCREEN_SIZE(40 * 6, 24 * 10) |
| r3957 | r3958 | |
|---|---|---|
| 46 | 46 | ***************************************************************************/ |
| 47 | 47 | |
| 48 | 48 | #define MDRV_DL1416_ADD(_tag, _type, _update) \ |
| 49 | MDRV_DEVICE_ADD(_tag, DL1416) \ | |
| 49 | MDRV_DEVICE_ADD(_tag, DL1416, 0) \ | |
| 50 | 50 | MDRV_DEVICE_CONFIG_DATA32(dl1416_interface, type, _type) \ |
| 51 | 51 | MDRV_DEVICE_CONFIG_DATAPTR(dl1416_interface, update, _update) |
| 52 | 52 |
| r3957 | r3958 | |
|---|---|---|
| 261 | 261 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1861); break; |
| 262 | 262 | |
| 263 | 263 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 264 | case DEVINFO_STR_NAME: info->s = "RCA CDP1861"; break; | |
| 265 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break; | |
| 266 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 267 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 268 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 264 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1861"); break; | |
| 265 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; | |
| 266 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 267 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 268 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 269 | 269 | } |
| 270 | 270 | } |
| r3957 | r3958 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | #define CDP1861 DEVICE_GET_INFO_NAME(cdp1861) |
| 61 | 61 | |
| 62 | #define MDRV_CDP1861_ADD(_tag, _clock, _config) \ | |
| 63 | MDRV_DEVICE_ADD(_tag, CDP1861, _clock) \ | |
| 64 | MDRV_DEVICE_CONFIG(_config) | |
| 65 | ||
| 62 | 66 | /* interface */ |
| 63 | 67 | typedef struct _cdp1861_interface cdp1861_interface; |
| 64 | 68 | struct _cdp1861_interface |
| 65 | 69 | { |
| 66 | 70 | const char *screen_tag; /* screen we are acting on */ |
| 67 | int clock; /* the clock (pin 1) of the chip */ | |
| 68 | 71 | |
| 69 | 72 | /* this gets called for every change of the INT pin (pin 3) */ |
| 70 | 73 | cdp1861_on_int_changed_func on_int_changed; |
| r3957 | r3958 | |
|---|---|---|
| 72 | 72 | #define HP48_PORT DEVICE_GET_INFO_NAME( hp48_port ) |
| 73 | 73 | |
| 74 | 74 | #define MDRV_HP48_PORT_ADD(_tag, _intrf) \ |
| 75 | MDRV_DEVICE_ADD(_tag, HP48_PORT) \ | |
| 75 | MDRV_DEVICE_ADD(_tag, HP48_PORT, 0) \ | |
| 76 | 76 | MDRV_DEVICE_CONFIG(_intrf) |
| 77 | 77 | |
| 78 | 78 | /****************************** machine ******************************/ |
| r3957 | r3958 | |
|---|---|---|
| 158 | 158 | extern WRITE8_HANDLER( gamecom_vram_w ); |
| 159 | 159 | extern READ8_HANDLER( gamecom_vram_r ); |
| 160 | 160 | |
| 161 | extern void gamecom_handle_dma( int cycles ); | |
| 162 | extern void gamecom_update_timers( int cycles ); | |
| 161 | extern void gamecom_handle_dma( const device_config *device, int cycles ); | |
| 162 | extern void gamecom_update_timers( const device_config *device, int cycles ); | |
| 163 | 163 | |
| 164 | 164 | extern UINT8 internal_registers[]; |
| 165 | 165 | extern UINT8 gamecom_vram[]; |
| r3957 | r3958 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | /*----------- defined in audio/gmaster.c -----------*/ |
| 7 | 7 | |
| 8 | int gmaster_io_callback(int ioline, int state); | |
| 8 | int gmaster_io_callback(const device_config *device, int ioline, int state); | |
| 9 | 9 | CUSTOM_START( gmaster_custom_start ); |
| 10 | //extern void gmaster_custom_stop (void); | |
| 11 | //extern void gmaster_custom_update (void); | |
| 12 | 10 | |
| 13 | 11 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 40 | 40 | WRITE8_HANDLER ( odyssey2_video_w ); |
| 41 | 41 | WRITE8_HANDLER ( odyssey2_lum_w ); |
| 42 | 42 | |
| 43 | ||
| 43 | STREAM_UPDATE( odyssey2_sh_update | |
| 44 | 44 | |
| 45 | 45 | extern const custom_sound_interface odyssey2_sound_interface; |
| 46 | 46 | |
| r3957 | r3958 | |
| 66 | 66 | WRITE8_HANDLER ( odyssey2_putbus ); |
| 67 | 67 | |
| 68 | 68 | READ8_HANDLER( odyssey2_t0_r ); |
| 69 | void the_voice_lrq_callback( int state ); | |
| 69 | void the_voice_lrq_callback( const device_config *device, int state ); | |
| 70 | 70 | |
| 71 | 71 | READ8_HANDLER ( g7400_bus_r ); |
| 72 | 72 | WRITE8_HANDLER ( g7400_bus_w ); |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | void pc_speaker_set_spkrdata(UINT8 data); |
| 29 | 29 | void pc_speaker_set_input(UINT8 data); |
| 30 | 30 | |
| 31 | void mess_init_pc_common( running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(int), void (*set_hdc_int_func)(int,int)); | |
| 31 | void mess_init_pc_common( running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int), void (*set_hdc_int_func)(int,int)); | |
| 32 | 32 | |
| 33 | 33 | WRITE8_HANDLER( pc_nmi_enable_w ); |
| 34 | 34 | READ8_HANDLER( pcjr_nmi_enable_r ); |
| r3957 | r3958 | |
|---|---|---|
| 13 | 13 | READ8_HANDLER( gamepock_port_b_r ); |
| 14 | 14 | READ8_HANDLER( gamepock_port_c_r ); |
| 15 | 15 | |
| 16 | int gamepock_io_callback( int ioline, int state ); | |
| 16 | int gamepock_io_callback( const device_config *device, int ioline, int state ); | |
| 17 | 17 | |
| 18 | 18 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 517 | 517 | DRIVER( ip244415 ) |
| 518 | 518 | |
| 519 | 519 | /* TEXAS INSTRUMENTS */ |
| 520 | DRIVER( ti990_10 ) /* 1975 TI 990/10 */ | |
| 521 | DRIVER( ti990_4 ) /* 1976 TI 990/4 */ | |
| 522 | DRIVER( 990189 ) /* 1978 TM 990/189 */ | |
| 523 | DRIVER( 990189v ) /* 1980 TM 990/189 with Color Video Board */ | |
| 520 | //0128u7 DRIVER( ti990_10 ) /* 1975 TI 990/10 */ | |
| 521 | //0128u7 DRIVER( ti990_4 ) /* 1976 TI 990/4 */ | |
| 522 | //0128u7 DRIVER( 990189 ) /* 1978 TM 990/189 */ | |
| 523 | //0128u7 DRIVER( 990189v ) /* 1980 TM 990/189 with Color Video Board */ | |
| 524 | 524 | |
| 525 | DRIVER( ti99_224 ) /* 1983 TI 99/2 (24kb ROMs) */ | |
| 526 | DRIVER( ti99_232 ) /* 1983 TI 99/2 (32kb ROMs) */ | |
| 527 | DRIVER( ti99_4 ) /* 1979 TI-99/4 */ | |
| 528 | DRIVER( ti99_4e ) /* 1980 TI-99/4 with 50Hz video */ | |
| 529 | DRIVER( ti99_4a ) /* 1981 TI-99/4A */ | |
| 530 | DRIVER( ti99_4ae ) /* 1981 TI-99/4A with 50Hz video */ | |
| 531 | DRIVER( ti99_4ev) /* 1994 TI-99/4A with EVPC video card */ | |
| 532 | DRIVER( ti99_8 ) /* 1983 TI-99/8 */ | |
| 533 | DRIVER( ti99_8e ) /* 1983 TI-99/8 with 50Hz video */ | |
| 525 | //0128u7 DRIVER( ti99_224 ) /* 1983 TI 99/2 (24kb ROMs) */ | |
| 526 | //0128u7 DRIVER( ti99_232 ) /* 1983 TI 99/2 (32kb ROMs) */ | |
| 527 | //0128u7 DRIVER( ti99_4 ) /* 1979 TI-99/4 */ | |
| 528 | //0128u7 DRIVER( ti99_4e ) /* 1980 TI-99/4 with 50Hz video */ | |
| 529 | //0128u7 DRIVER( ti99_4a ) /* 1981 TI-99/4A */ | |
| 530 | //0128u7 DRIVER( ti99_4ae ) /* 1981 TI-99/4A with 50Hz video */ | |
| 531 | //0128u7 DRIVER( ti99_4ev) /* 1994 TI-99/4A with EVPC video card */ | |
| 532 | //0128u7 DRIVER( ti99_8 ) /* 1983 TI-99/8 */ | |
| 533 | //0128u7 DRIVER( ti99_8e ) /* 1983 TI-99/8 with 50Hz video */ | |
| 534 | 534 | |
| 535 | 535 | /* TI 99 clones */ |
| 536 | DRIVER( tutor) /* 1983? Tomy Tutor */ | |
| 537 | DRIVER( geneve ) /* 1987? Myarc Geneve 9640 */ | |
| 538 | DRIVER( genmod ) /* 199?? Myarc Geneve 9640 */ | |
| 539 | DRIVER( ti99_4p ) /* 1996 SNUG 99/4P (a.k.a. SGCPU) */ | |
| 536 | //0128u7 DRIVER( tutor) /* 1983? Tomy Tutor */ | |
| 537 | //0128u7 DRIVER( geneve ) /* 1987? Myarc Geneve 9640 */ | |
| 538 | //0128u7 DRIVER( genmod ) /* 199?? Myarc Geneve 9640 */ | |
| 539 | //0128u7 DRIVER( ti99_4p ) /* 1996 SNUG 99/4P (a.k.a. SGCPU) */ | |
| 540 | 540 | |
| 541 | 541 | DRIVER( avigo ) /* */ |
| 542 | 542 | |
| r3957 | r3958 | |
| 559 | 559 | DRIVER( jupiter ) /* Jupiter Ace */ |
| 560 | 560 | |
| 561 | 561 | /* SORD */ |
| 562 | DRIVER( sordm5 ) | |
| 563 | DRIVER( srdm5fd5 ) | |
| 562 | //0128u7 DRIVER( sordm5 ) | |
| 563 | //0128u7 DRIVER( srdm5fd5 ) | |
| 564 | 564 | |
| 565 | 565 | /* APF Electronics Inc. */ |
| 566 | 566 | DRIVER( apfm1000 ) |
| 567 | 567 | DRIVER( apfimag ) |
| 568 | 568 | |
| 569 | 569 | /* Tatung */ |
| 570 | DRIVER( einstein ) | |
| 571 | DRIVER( einstei2 ) | |
| 570 | //0128u7 DRIVER( einstein ) | |
| 571 | //0128u7 DRIVER( einstei2 ) | |
| 572 | 572 | |
| 573 | 573 | /* INTELLIGENT SOFTWARE */ |
| 574 | 574 | DRIVER( ep128 ) /* Enterprise 128 k */ |
| r3957 | r3958 | |
| 578 | 578 | |
| 579 | 579 | /* VEB MIKROELEKTRONIK */ |
| 580 | 580 | /* KC compact is partial CPC compatible */ |
| 581 | DRIVER( kc85_4 ) /* VEB KC 85/4 */ | |
| 582 | DRIVER( kc85_3 ) /* VEB KC 85/3 */ | |
| 583 | DRIVER( kc85_4d ) /* VEB KC 85/4 with disk interface */ | |
| 581 | //0128u7 DRIVER( kc85_4 ) /* VEB KC 85/4 */ | |
| 582 | //0128u7 DRIVER( kc85_3 ) /* VEB KC 85/3 */ | |
| 583 | //0128u7 DRIVER( kc85_4d ) /* VEB KC 85/4 with disk interface */ | |
| 584 | 584 | |
| 585 | 585 | /* MICROBEE SYSTEMS */ |
| 586 | DRIVER( mbee ) /* Microbee 16 Standard or Plus */ | |
| 587 | DRIVER( mbeeic ) /* Microbee 32 IC */ | |
| 588 | DRIVER( mbeepc ) /* Microbee 32 PC */ | |
| 589 | DRIVER( mbeepc85 ) /* Microbee 32 PC85 */ | |
| 590 | DRIVER( mbee56 ) /* Microbee 56K (CP/M) */ | |
| 586 | //0128u7 DRIVER( mbee ) /* Microbee 16 Standard or Plus */ | |
| 587 | //0128u7 DRIVER( mbeeic ) /* Microbee 32 IC */ | |
| 588 | //0128u7 DRIVER( mbeepc ) /* Microbee 32 PC */ | |
| 589 | //0128u7 DRIVER( mbeepc85 ) /* Microbee 32 PC85 */ | |
| 590 | //0128u7 DRIVER( mbee56 ) /* Microbee 56K (CP/M) */ | |
| 591 | 591 | |
| 592 | 592 | /* TANDY RADIO SHACK */ |
| 593 | 593 | DRIVER( trs80 ) /* TRS-80 Model I - Level I BASIC */ |
| r3957 | r3958 | |
| 622 | 622 | /* system 80 trs80 compatible */ |
| 623 | 623 | |
| 624 | 624 | /* VIDEO TECHNOLOGY */ |
| 625 | DRIVER( crvision ) /* 1981 creatiVision */ | |
| 626 | DRIVER( fnvision ) /* 1983 FunVision */ | |
| 627 | DRIVER( laser110 ) /* 1983 Laser 110 */ | |
| 628 | DRIVER( las110de ) /* 1983 Sanyo Laser 110 (Germany) */ | |
| 629 | DRIVER( laser200 ) /* 1983 Laser 200 (color version of 110) */ | |
| 625 | //0128u7 DRIVER( crvision ) /* 1981 creatiVision */ | |
| 626 | //0128u7 DRIVER( fnvision ) /* 1983 FunVision */ | |
| 627 | //0128u7 DRIVER( laser110 ) /* 1983 Laser 110 */ | |
| 628 | //0128u7 DRIVER( las110de ) /* 1983 Sanyo Laser 110 (Germany) */ | |
| 629 | //0128u7 DRIVER( laser200 ) /* 1983 Laser 200 (color version of 110) */ | |
| 630 | 630 | // DRIVER( vz200de ) /* 1983 VZ-200 (Germany) */ |
| 631 | DRIVER( fellow ) /* 1983 Salora Fellow (Finland) */ | |
| 632 | DRIVER( tx8000 ) /* 1983 Texet TX-8000 (U.K.) */ | |
| 633 | DRIVER( laser210 ) /* 1984 Laser 210 (200 with more memory) */ | |
| 634 | DRIVER( las210de ) /* 1984 Sanyo Laser 210 (Germany) */ | |
| 635 | DRIVER( vz200 ) /* 1984 Dick Smith Electronics VZ-200 */ | |
| 636 | DRIVER( laser310 ) /* 1984 Laser 310 (210 with diff. keyboard and RAM) */ | |
| 637 | DRIVER( vz300 ) /* 1984 Dick Smith Electronics VZ-300 */ | |
| 638 | DRIVER( laser350 ) /* 1984? Laser 350 */ | |
| 639 | DRIVER( laser500 ) /* 1984? Laser 500 */ | |
| 640 | DRIVER( laser700 ) /* 1984? Laser 700 */ | |
| 631 | //0128u7 DRIVER( fellow ) /* 1983 Salora Fellow (Finland) */ | |
| 632 | //0128u7 DRIVER( tx8000 ) /* 1983 Texet TX-8000 (U.K.) */ | |
| 633 | //0128u7 DRIVER( laser210 ) /* 1984 Laser 210 (200 with more memory) */ | |
| 634 | //0128u7 DRIVER( las210de ) /* 1984 Sanyo Laser 210 (Germany) */ | |
| 635 | //0128u7 DRIVER( vz200 ) /* 1984 Dick Smith Electronics VZ-200 */ | |
| 636 | //0128u7 DRIVER( laser310 ) /* 1984 Laser 310 (210 with diff. keyboard and RAM) */ | |
| 637 | //0128u7 DRIVER( vz300 ) /* 1984 Dick Smith Electronics VZ-300 */ | |
| 638 | //0128u7 DRIVER( laser350 ) /* 1984? Laser 350 */ | |
| 639 | //0128u7 DRIVER( laser500 ) /* 1984? Laser 500 */ | |
| 640 | //0128u7 DRIVER( laser700 ) /* 1984? Laser 700 */ | |
| 641 | 641 | |
| 642 | 642 | /* TANGERINE */ |
| 643 | 643 | DRIVER( microtan ) /* 1979 Microtan 65 */ |
| r3957 | r3958 | |
| 787 | 787 | |
| 788 | 788 | |
| 789 | 789 | /* NASCOM MICROCOMPUTERS */ |
| 790 | DRIVER( nascom1 ) /* 1978 Nascom 1 */ | |
| 791 | DRIVER( nascom2 ) /* 1979 Nascom 2 */ | |
| 790 | //0128u7 DRIVER( nascom1 ) /* 1978 Nascom 1 */ | |
| 791 | //0128u7 DRIVER( nascom2 ) /* 1979 Nascom 2 */ | |
| 792 | 792 | |
| 793 | 793 | /* MILES GORDON TECHNOLOGY */ |
| 794 | 794 | DRIVER( samcoupe ) /* 1989 Sam Coupe */ |
| r3957 | r3958 | |
| 884 | 884 | DRIVER(compis) /* 1985 Telenova Compis */ |
| 885 | 885 | |
| 886 | 886 | /* Multitech */ |
| 887 | DRIVER(mpf1) /* 1979 Multitech Micro Professor 1 */ | |
| 888 | DRIVER(mpf1b) /* 1979 Multitech Micro Professor 1B */ | |
| 887 | //0128u7 DRIVER(mpf1) /* 1979 Multitech Micro Professor 1 */ | |
| 888 | //0128u7 DRIVER(mpf1b) /* 1979 Multitech Micro Professor 1B */ | |
| 889 | 889 | |
| 890 | 890 | /* Telercas Oy */ |
| 891 | 891 | // DRIVER(tmc1800) |
| r3957 | r3958 | |
| 903 | 903 | DRIVER( tx0_8kw ) /* 1962 MIT TX-0 (8kw RAM) */ |
| 904 | 904 | |
| 905 | 905 | /* Luxor Datorer AB */ |
| 906 | DRIVER( abc80 ) | |
| 907 | DRIVER( abc802 ) | |
| 908 | DRIVER( abc800m ) | |
| 909 | DRIVER( abc800c ) | |
| 910 | DRIVER( abc806 ) | |
| 906 | //0128u7 DRIVER( abc80 ) | |
| 907 | //0128u7 DRIVER( abc802 ) | |
| 908 | //0128u7 DRIVER( abc800m ) | |
| 909 | //0128u7 DRIVER( abc800c ) | |
| 910 | //0128u7 DRIVER( abc806 ) | |
| 911 | 911 | |
| 912 | 912 | /* Be Incorporated */ |
| 913 | 913 | DRIVER( bebox ) /* BeBox Dual603-66 */ |
| r3957 | r3958 | |
| 917 | 917 | DRIVER( gamecom ) /* Tiger Game.com */ |
| 918 | 918 | |
| 919 | 919 | /* Thomson */ |
| 920 | DRIVER( t9000 ) /* 1980 Thomson T9000 (TO7 prototype) */ | |
| 921 | DRIVER( to7 ) /* 1982 Thomson TO7 */ | |
| 922 | DRIVER( to770 ) /* 1984 Thomson TO7/70 */ | |
| 923 | DRIVER( to770a ) /* 198? Thomson TO7/70 arabic version */ | |
| 924 | DRIVER( mo5 ) /* 1984 Thomson MO5 */ | |
| 925 | DRIVER( mo5e ) /* 1986 Thomson MO5E (export version) */ | |
| 926 | DRIVER( to9 ) /* 1985 Thomson T09 */ | |
| 927 | DRIVER( to8 ) /* 1986 Thomson T08 */ | |
| 928 | DRIVER( to8d ) /* 1987 Thomson T08D */ | |
| 929 | DRIVER( to9p ) /* 1986 Thomson T09+ */ | |
| 930 | DRIVER( mo6 ) /* 1986 Thomson MO6 */ | |
| 931 | DRIVER( mo5nr ) /* 1986 Thomson MO5 NR */ | |
| 932 | DRIVER( pro128 ) /* 1986 Olivetti Prodest PC 128 */ | |
| 920 | //0128u7 DRIVER( t9000 ) /* 1980 Thomson T9000 (TO7 prototype) */ | |
| 921 | //0128u7 DRIVER( to7 ) /* 1982 Thomson TO7 */ | |
| 922 | //0128u7 DRIVER( to770 ) /* 1984 Thomson TO7/70 */ | |
| 923 | //0128u7 DRIVER( to770a ) /* 198? Thomson TO7/70 arabic version */ | |
| 924 | //0128u7 DRIVER( mo5 ) /* 1984 Thomson MO5 */ | |
| 925 | //0128u7 DRIVER( mo5e ) /* 1986 Thomson MO5E (export version) */ | |
| 926 | //0128u7 DRIVER( to9 ) /* 1985 Thomson T09 */ | |
| 927 | //0128u7 DRIVER( to8 ) /* 1986 Thomson T08 */ | |
| 928 | //0128u7 DRIVER( to8d ) /* 1987 Thomson T08D */ | |
| 929 | //0128u7 DRIVER( to9p ) /* 1986 Thomson T09+ */ | |
| 930 | //0128u7 DRIVER( mo6 ) /* 1986 Thomson MO6 */ | |
| 931 | //0128u7 DRIVER( mo5nr ) /* 1986 Thomson MO5 NR */ | |
| 932 | //0128u7 DRIVER( pro128 ) /* 1986 Olivetti Prodest PC 128 */ | |
| 933 | 933 | |
| 934 | 934 | /* Cybiko, Inc. */ |
| 935 | 935 | // DRIVER( cybikov1 ) /* Cybiko Wireless Intertainment System - Classic V1 */ |
| r3957 | r3958 | |
| 937 | 937 | // DRIVER( cybikoxt ) /* Cybiko Wireless Intertainment System - Xtreme */ |
| 938 | 938 | |
| 939 | 939 | /* Dick Smith */ |
| 940 | DRIVER( super80 ) | |
| 941 | DRIVER( super80d ) | |
| 942 | DRIVER( super80e ) | |
| 943 | DRIVER( super80m ) | |
| 944 | DRIVER( super80r ) | |
| 945 | DRIVER( super80v ) | |
| 940 | //0128u7 DRIVER( super80 ) | |
| 941 | //0128u7 DRIVER( super80d ) | |
| 942 | //0128u7 DRIVER( super80e ) | |
| 943 | //0128u7 DRIVER( super80m ) | |
| 944 | //0128u7 DRIVER( super80r ) | |
| 945 | //0128u7 DRIVER( super80v ) | |
| 946 | 946 | |
| 947 | 947 | /* Galeb */ |
| 948 | 948 | DRIVER( galeb ) |
| r3957 | r3958 | |
|---|---|---|
| 294 | 294 | case DEVINFO_FCT_GET_NAME: info->f = (genf *) DEVICE_GET_NAME_NAME(mess_device); break; |
| 295 | 295 | |
| 296 | 296 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 297 | case DEVINFO_STR_NAME: info->s = "Legacy MESS Device"; break; | |
| 298 | case DEVINFO_STR_FAMILY: info->s = "Legacy MESS Device"; break; | |
| 299 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 300 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 301 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 302 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = mess_device_get_info_string(&mess_device->io_device.devclass, MESS_DEVINFO_STR_FILE_EXTENSIONS); break; | |
| 303 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: info->s = mess_device_get_info_string(&mess_device->io_device.devclass, MESS_DEVINFO_STR_NAME + mess_device->io_device.index_in_device); break; | |
| 304 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: info->s = mess_device_get_info_string(&mess_device->io_device.devclass, MESS_DEVINFO_STR_SHORT_NAME + mess_device->io_device.index_in_device); break; | |
| 297 | case DEVINFO_STR_NAME: strcpy(info->s, "Legacy MESS Device"); break; | |
| 298 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Legacy MESS Device"); break; | |
| 299 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 300 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 301 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 302 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, mess_device_get_info_string(&mess_device->io_device.devclass, MESS_DEVINFO_STR_FILE_EXTENSIONS)); break; | |
| 303 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: strcpy(info->s, mess_device_get_info_string(&mess_device->io_device.devclass, MESS_DEVINFO_STR_NAME + mess_device->io_device.index_in_device)); break; | |
| 304 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: strcpy(info->s, mess_device_get_info_string(&mess_device->io_device.devclass, MESS_DEVINFO_STR_SHORT_NAME + mess_device->io_device.index_in_device)); break; | |
| 305 | 305 | |
| 306 | 306 | default: |
| 307 | 307 | if ((state >= DEVINFO_PTR_IMAGE_CREATE_OPTSPEC) && (state < DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + DEVINFO_CREATE_OPTMAX)) |
| r3957 | r3958 | |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | /* create a bonafide MAME device */ |
| 409 | device = device_list_add(listheadptr, MESS_DEVICE, mame_tag); | |
| 409 | device = device_list_add(listheadptr, NULL, MESS_DEVICE, mame_tag, 0); | |
| 410 | 410 | mess_device = (mess_device_config *) device->inline_config; |
| 411 | 411 | |
| 412 | 412 | /* we need to copy the mess_tag into the structure */ |
| r3957 | r3958 | |
| 656 | 656 | |
| 657 | 657 | |
| 658 | 658 | |
| 659 | const device_config *image_from_devtype_and_index(iodevice_t type, int id) | |
| 659 | const device_config *image_from_devtype_and_index(running_machine *machine, iodevice_t type, int id) | |
| 660 | 660 | { |
| 661 | 661 | const device_config *image = NULL; |
| 662 | 662 | const device_config *dev; |
| 663 | 663 | const legacy_mess_device *iodev; |
| 664 | 664 | |
| 665 | for (dev = device_list_first( | |
| 665 | for (dev = device_list_first(machine->config->devicelist, MESS_DEVICE); dev != NULL; dev = device_list_next(dev, MESS_DEVICE)) | |
| 666 | 666 | { |
| 667 | 667 | iodev = mess_device_from_core_device(dev); |
| 668 | 668 | if ((type == iodev->type) && (iodev->index_in_device == id)) |
| r3957 | r3958 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | /* deprecated device access functions that assume one device of any given type */ |
| 211 | 211 | iodevice_t image_devtype(const device_config *device); |
| 212 | const device_config *image_from_devtype_and_index(iodevice_t type, int id); | |
| 212 | const device_config *image_from_devtype_and_index(running_machine *machine, iodevice_t type, int id); | |
| 213 | 213 | |
| 214 | 214 | /* diagnostics */ |
| 215 | 215 | int device_valididtychecks(void); |
| r3957 | r3958 | |
|---|---|---|
| 627 | 627 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(applefdc); break; |
| 628 | 628 | |
| 629 | 629 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 630 | case DEVINFO_STR_FAMILY: info->s = "Apple FDC"; break; | |
| 631 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 632 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 630 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Apple FDC"); break; | |
| 631 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 632 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 633 | 633 | } |
| 634 | 634 | } |
| 635 | 635 | |
| r3957 | r3958 | |
| 658 | 658 | switch (state) |
| 659 | 659 | { |
| 660 | 660 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 661 | case DEVINFO_STR_NAME: info->s | |
| 661 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 662 | 662 | |
| 663 | 663 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 664 | 664 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(oldfdc); break; |
| r3957 | r3958 | |
| 692 | 692 | switch (state) |
| 693 | 693 | { |
| 694 | 694 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 695 | case DEVINFO_STR_NAME: info->s | |
| 695 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 696 | 696 | |
| 697 | 697 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 698 | 698 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(iwm); break; |
| r3957 | r3958 | |
| 726 | 726 | switch (state) |
| 727 | 727 | { |
| 728 | 728 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 729 | case DEVINFO_STR_NAME: info->s | |
| 729 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 730 | 730 | |
| 731 | 731 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 732 | 732 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(swim); break; |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | static const device_config *get_floppy_image(int drive) |
| 155 | 155 | { |
| 156 | return image_from_devtype_and_index(IO_FLOPPY, drive); | |
| 156 | return image_from_devtype_and_index(machine, IO_FLOPPY, drive); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /* Slow Controller */ |
| r3957 | r3958 | |
| 662 | 662 | |
| 663 | 663 | static const z80dma_interface dma_intf = |
| 664 | 664 | { |
| 665 | Z80DMA_CPUNUM, /* cpunum to HALT */ | |
| 666 | XTAL_16MHz/4, /* chip clock */ | |
| 665 | CONKORT_Z80_TAG, /* cpunum to HALT */ | |
| 667 | 666 | dma_port_a_r, /* memory read */ |
| 668 | 667 | dma_port_a_w, /* memory write */ |
| 669 | 668 | dma_port_a_r, /* port A read */ |
| r3957 | r3958 | |
| 743 | 742 | MDRV_CPU_IO_MAP(fast_io_map, 0) |
| 744 | 743 | MDRV_CPU_CONFIG(fast_daisy_chain) |
| 745 | 744 | |
| 746 | MDRV_DEVICE_ADD(CONKORT_Z80DMA_TAG, Z80DMA) | |
| 747 | MDRV_DEVICE_CONFIG(dma_intf) | |
| 745 | MDRV_Z80DMA_ADD(CONKORT_Z80DMA_TAG, XTAL_16MHz/4, dma_intf) | |
| 748 | 746 | |
| 749 | 747 | MDRV_WD1793_ADD("wd1793", fast_wd17xx_interface ) |
| 750 | 748 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 861 | 859 | case DEVINFO_FCT_ABCBUS_CARD_SELECT: info->f = (genf *)ABCBUS_CARD_SELECT_NAME(luxor_55_10828); break; |
| 862 | 860 | |
| 863 | 861 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 864 | case DEVINFO_STR_NAME: info->s = "Luxor 55 10828-01"; break; | |
| 865 | case DEVINFO_STR_FAMILY: info->s = "Luxor ABC"; break; | |
| 866 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 867 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 868 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 862 | case DEVINFO_STR_NAME: strcpy(info->s, "Luxor 55 10828-01"); break; | |
| 863 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Luxor ABC"); break; | |
| 864 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 865 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 866 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 869 | 867 | } |
| 870 | 868 | } |
| 871 | 869 | |
| r3957 | r3958 | |
| 930 | 928 | case DEVINFO_FCT_ABCBUS_CARD_SELECT: info->f = (genf *)ABCBUS_CARD_SELECT_NAME(luxor_55_21046); break; |
| 931 | 929 | |
| 932 | 930 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 933 | case DEVINFO_STR_NAME: info->s = "Luxor Conkort 55 21046-xx"; break; | |
| 934 | case DEVINFO_STR_FAMILY: info->s = "Luxor ABC"; break; | |
| 935 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 936 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 937 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 931 | case DEVINFO_STR_NAME: strcpy(info->s, "Luxor Conkort 55 21046-xx"); break; | |
| 932 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Luxor ABC"); break; | |
| 933 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 934 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 935 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 938 | 936 | } |
| 939 | 937 | } |
| r3957 | r3958 | |
|---|---|---|
| 1100 | 1100 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( hp48_port ); break; |
| 1101 | 1101 | case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME( hp48_port ); break; |
| 1102 | 1102 | case DEVINFO_FCT_IMAGE_CREATE: info->f = (genf *) DEVICE_IMAGE_CREATE_NAME( hp48_port ); break; |
| 1103 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: info->s = conf ? conf->brief_name : ""; break; | |
| 1104 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: info->s = conf ? conf->name : ""; break; | |
| 1105 | case DEVINFO_STR_NAME: info->s = "HP48 memory card"; break; | |
| 1106 | case DEVINFO_STR_FAMILY: info->s = "HP48 memory card"; break; | |
| 1107 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1108 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "crd"; break; | |
| 1103 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: strcpy(info->s, conf ? conf->brief_name : ""); break; | |
| 1104 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: strcpy(info->s, conf ? conf->name : ""); break; | |
| 1105 | case DEVINFO_STR_NAME: strcpy( info->s, "HP48 memory card"); break; | |
| 1106 | case DEVINFO_STR_FAMILY: strcpy(info->s, "HP48 memory card"); break; | |
| 1107 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1108 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "crd"); break; | |
| 1109 | 1109 | } |
| 1110 | 1110 | } |
| 1111 | 1111 |
| r3957 | r3958 | |
|---|---|---|
| 75 | 75 | ***************************************************************************/ |
| 76 | 76 | |
| 77 | 77 | #define MDRV_APPLEFDC_ADD(_tag, _intrf) \ |
| 78 | MDRV_DEVICE_ADD(_tag, APPLEFDC) \ | |
| 78 | MDRV_DEVICE_ADD(_tag, APPLEFDC, 0) \ | |
| 79 | 79 | MDRV_DEVICE_CONFIG(_intrf) |
| 80 | 80 | |
| 81 | 81 | #define MDRV_APPLEFDC_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
| 86 | 86 | MDRV_DEVICE_REMOVE(_tag, APPLEFDC) |
| 87 | 87 | |
| 88 | 88 | #define MDRV_IWM_ADD(_tag, _intrf) \ |
| 89 | MDRV_DEVICE_ADD(_tag, IWM) \ | |
| 89 | MDRV_DEVICE_ADD(_tag, IWM, 0) \ | |
| 90 | 90 | MDRV_DEVICE_CONFIG(_intrf) |
| 91 | 91 | |
| 92 | 92 | #define MDRV_IWM_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
| 97 | 97 | MDRV_DEVICE_REMOVE(_tag, IWM) |
| 98 | 98 | |
| 99 | 99 | #define MDRV_SWIM_ADD(_tag, _intrf) \ |
| 100 | MDRV_DEVICE_ADD(_tag, SWIM) \ | |
| 100 | MDRV_DEVICE_ADD(_tag, SWIM, 0) \ | |
| 101 | 101 | MDRV_DEVICE_CONFIG(_intrf) |
| 102 | 102 | |
| 103 | 103 | #define MDRV_SWIM_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
|---|---|---|
| 161 | 161 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 162 | 162 | |
| 163 | 163 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 164 | case DEVINFO_STR_NAME: info->s = "Apple II Slot"; break; | |
| 165 | case DEVINFO_STR_FAMILY: info->s = "Apple II Slot"; break; | |
| 166 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 167 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 164 | case DEVINFO_STR_NAME: strcpy(info->s, "Apple II Slot"); break; | |
| 165 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Apple II Slot"); break; | |
| 166 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 167 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 168 | 168 | } |
| 169 | 169 | } |
| r3957 | r3958 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | default: |
| 133 | 133 | if (LOG_MOCKINGBOARD) |
| 134 | logerror("mockingboard_r unmapped, offset: %02x, pc: % | |
| 134 | logerror("mockingboard_r unmapped, offset: %02x, pc: %s | |
| 135 | 135 | break; |
| 136 | 136 | } |
| 137 | 137 | return 0x00; |
| r3957 | r3958 | |
| 229 | 229 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mockingboard); break; |
| 230 | 230 | |
| 231 | 231 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 232 | case DEVINFO_STR_NAME: info->s = "Apple II Mockingboard"; break; | |
| 233 | case DEVINFO_STR_FAMILY: info->s = "Apple II Mockingboard"; break; | |
| 234 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 235 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 232 | case DEVINFO_STR_NAME: strcpy(info->s, "Apple II Mockingboard"); break; | |
| 233 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Apple II Mockingboard"); break; | |
| 234 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 235 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 236 | 236 | } |
| 237 | 237 | } |
| r3957 | r3958 | |
|---|---|---|
| 739 | 739 | /* the Apple /// does some weird tricks whereby it monitors the SYNC pin |
| 740 | 740 | * on the CPU to check for indexed instructions and directs them to |
| 741 | 741 | * different memory locations */ |
| 742 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_READINDEXED_CALLBACK, (genf *) apple3_indexed_read); | |
| 743 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK, (genf *) apple3_indexed_write); | |
| 742 | device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_READINDEXED_CALLBACK, (genf *) apple3_indexed_read); | |
| 743 | device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK, (genf *) apple3_indexed_write); | |
| 744 | 744 | } |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | ***************************************************************************/ |
| 40 | 40 | |
| 41 | 41 | #define MDRV_APPLE2_SLOT_ADD(_slot_number, _slot_device_tag, _rh, _wh) \ |
| 42 | MDRV_DEVICE_ADD("slot_" #_slot_number, APPLE2_SLOT) \ | |
| 42 | MDRV_DEVICE_ADD("slot_" #_slot_number, APPLE2_SLOT, 0) \ | |
| 43 | 43 | MDRV_DEVICE_CONFIG_DATAPTR(apple2_slot_config, tag, _slot_device_tag) \ |
| 44 | 44 | MDRV_DEVICE_CONFIG_DATAPTR(apple2_slot_config, rh, _rh) \ |
| 45 | 45 | MDRV_DEVICE_CONFIG_DATAPTR(apple2_slot_config, wh, _wh) \ |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | #define MOCKINGBOARD DEVICE_GET_INFO_NAME(mockingboard) |
| 20 | 20 | |
| 21 | 21 | #define MDRV_MOCKINGBOARD_ADD(_tag) \ |
| 22 | MDRV_DEVICE_ADD((_tag), MOCKINGBOARD) | |
| 22 | MDRV_DEVICE_ADD((_tag), MOCKINGBOARD, 0) | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 658 | 658 | read8_space_func rh4, rh8; |
| 659 | 659 | write8_space_func wh5, wh9; |
| 660 | 660 | |
| 661 | data = (UINT8) c | |
| 661 | data = (UINT8) device | |
| 662 | 662 | if (data == old) |
| 663 | 663 | return; |
| 664 | 664 |
| r3957 | r3958 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | static TIMER_CALLBACK(dai_bootstrap_callback) |
| 55 | 55 | { |
| 56 | cpu_set_reg(machine->cpu[0], | |
| 56 | cpu_set_reg(machine->cpu[0], REG | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static UINT8 dai_keyboard_scan_mask = 0; |
| r3957 | r3958 | |
|---|---|---|
| 372 | 372 | // try to open the devices |
| 373 | 373 | for (i = 0; i < interface->scsidevs->devs_present; i++) |
| 374 | 374 | { |
| 375 | SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 375 | SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | state_save_register_item_array(machine, "ncr5380", NULL, 0, n5380_Registers); |
| r3957 | r3958 | |
| 472 | 472 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ncr5380); break; |
| 473 | 473 | |
| 474 | 474 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 475 | case DEVINFO_STR_NAME: info->s = "NCR 5380"; break; | |
| 476 | case DEVINFO_STR_FAMILY: info->s = "NCR53xx"; break; | |
| 477 | case DEVINFO_STR_VERSION: info->s = "1.1"; break; | |
| 478 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 479 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 475 | case DEVINFO_STR_NAME: strcpy(info->s, "NCR 5380"); break; | |
| 476 | case DEVINFO_STR_FAMILY: strcpy(info->s, "NCR53xx"); break; | |
| 477 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.1"); break; | |
| 478 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 479 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 560 | 560 | |
| 561 | 561 | if (deviceNum>=4 && deviceNum<=7) |
| 562 | 562 | { |
| 563 | image = image_from_devtype_and_index(IO_FLOPPY, deviceNum - 4); | |
| 563 | image = image_from_devtype_and_index(machine, IO_FLOPPY, deviceNum - 4); | |
| 564 | 564 | if (image_exists(image)) |
| 565 | 565 | ram[statusDCB+20] = (ram[statusDCB+20]&0xF0); /* Inserted Media */ |
| 566 | 566 | else |
| r3957 | r3958 | |
| 582 | 582 | } |
| 583 | 583 | else if (deviceNum>=4 && deviceNum<=7) |
| 584 | 584 | { |
| 585 | image = image_from_devtype_and_index(IO_FLOPPY, deviceNum - 4); | |
| 585 | image = image_from_devtype_and_index(machine, IO_FLOPPY, deviceNum - 4); | |
| 586 | 586 | if (image_exists(image)) |
| 587 | 587 | { |
| 588 | 588 | ram[statusDCB] = 0x80; |
| r3957 | r3958 | |
| 643 | 643 | } |
| 644 | 644 | else if (deviceNum>=4 && deviceNum<=7) |
| 645 | 645 | { |
| 646 | image = image_from_devtype_and_index(IO_FLOPPY, deviceNum - 4); | |
| 646 | image = image_from_devtype_and_index(machine, IO_FLOPPY, deviceNum - 4); | |
| 647 | 647 | if (image_exists(image)) |
| 648 | 648 | { |
| 649 | 649 | sectorNmbr = ((ram[statusDCB+5])+(ram[statusDCB+6]<<8)+(ram[statusDCB+7]<<16)+(ram[statusDCB+8]<<24))<<1; |
| r3957 | r3958 | |
|---|---|---|
| 252 | 252 | const cia6526_interface cbmb_cia = |
| 253 | 253 | { |
| 254 | 254 | cbmb_tpi6525_0_irq2_level, |
| 255 | | |
| 255 | | |
| 256 | 256 | |
| 257 | 257 | { |
| 258 | 258 | { cbmb_cia_port_a_r, cbmb_cia_port_a_w }, |
| r3957 | r3958 | |
|---|---|---|
| 1220 | 1220 | Bit 7 R/W IR received bit (mirror, if device not selected: 0) |
| 1221 | 1221 | */ |
| 1222 | 1222 | if ( pm_reg[0x60] & 0x04 ) |
| 1223 | i2cmem_write( 0, I2CMEM_SDA, ( data & 0x04 ) ? 1 : 0 ); | |
| 1223 | i2cmem_write( space->machine, 0, I2CMEM_SDA, ( data & 0x04 ) ? 1 : 0 ); | |
| 1224 | 1224 | |
| 1225 | 1225 | if ( pm_reg[0x60] & 0x08 ) |
| 1226 | i2cmem_write( 0, I2CMEM_SCL, ( data & 0x08 ) ? 1 : 0 ); | |
| 1226 | i2cmem_write( space->machine, 0, I2CMEM_SCL, ( data & 0x08 ) ? 1 : 0 ); | |
| 1227 | 1227 | break; |
| 1228 | 1228 | case 0x70: /* Sound related */ |
| 1229 | 1229 | pm_reg[0x70] = data; |
| r3957 | r3958 | |
| 1384 | 1384 | case 0x61: |
| 1385 | 1385 | if ( ! ( pm_reg[0x60] & 0x04 ) ) |
| 1386 | 1386 | { |
| 1387 | data = ( data & ~ 0x04 ) | ( i2cmem_read( 0, I2CMEM_SDA ) ? 0x04 : 0x00 ); | |
| 1387 | data = ( data & ~ 0x04 ) | ( i2cmem_read( space->machine, 0, I2CMEM_SDA ) ? 0x04 : 0x00 ); | |
| 1388 | 1388 | } |
| 1389 | 1389 | |
| 1390 | 1390 | if ( ! ( pm_reg[0x60] & 0x08 ) ) |
| r3957 | r3958 | |
|---|---|---|
| 629 | 629 | if (preamble != 0) |
| 630 | 630 | { |
| 631 | 631 | /* start address - just set the address and return */ |
| 632 | cpu_set_reg(image->machine->cpu[0], REG_PC, block_address); | |
| 632 | cpu_set_reg(image->machine->cpu[0], REG_GENPC, block_address); | |
| 633 | 633 | done = TRUE; |
| 634 | 634 | } |
| 635 | 635 | else |
| r3957 | r3958 | |
| 1133 | 1133 | #define SOUNDMUX_STATUS_SEL2 2 |
| 1134 | 1134 | #define SOUNDMUX_STATUS_SEL1 1 |
| 1135 | 1135 | |
| 1136 | static const device_config *cartslot_image( | |
| 1136 | static const device_config *cartslot_image(running_machine *machine) | |
| 1137 | 1137 | { |
| 1138 | return image_from_devtype_and_index(IO_CARTSLOT, 0); | |
| 1138 | return image_from_devtype_and_index(machine, IO_CARTSLOT, 0); | |
| 1139 | 1139 | } |
| 1140 | 1140 | |
| 1141 | 1141 | static const device_config *cassette_device_image(running_machine *machine) |
| r3957 | r3958 | |
| 2749 | 2749 | generic_mapmemory |
| 2750 | 2750 | -------------------------------------------------*/ |
| 2751 | 2751 | |
| 2752 | static void generic_mapmemory(coco_cartridge *cartridge, UINT32 offset, UINT32 mask, UINT8 *cartmem, UINT32 cartmem_size) | |
| 2752 | static void generic_mapmemory(running_machine *machine, coco_cartridge *cartridge, UINT32 offset, UINT32 mask, UINT8 *cartmem, UINT32 cartmem_size) | |
| 2753 | 2753 | { |
| 2754 | const device_config *image = cartslot_image(); | |
| 2754 | const device_config *image = cartslot_image(machine); | |
| 2755 | 2755 | const UINT8 *cart_ptr; |
| 2756 | 2756 | UINT32 cart_size, i; |
| 2757 | 2757 | |
| r3957 | r3958 | |
| 2773 | 2773 | |
| 2774 | 2774 | static void coco_mapmemory(running_machine *machine, coco_cartridge *cartridge, UINT32 offset, UINT32 mask) |
| 2775 | 2775 | { |
| 2776 | generic_mapmemory(cartridge, offset, mask, &coco_rom[0x4000], 0x3FFF); | |
| 2776 | generic_mapmemory(machine, cartridge, offset, mask, &coco_rom[0x4000], 0x3FFF); | |
| 2777 | 2777 | } |
| 2778 | 2778 | |
| 2779 | 2779 | |
| r3957 | r3958 | |
| 2784 | 2784 | |
| 2785 | 2785 | static void coco3_mapmemory(running_machine *machine, coco_cartridge *cartridge, UINT32 offset, UINT32 mask) |
| 2786 | 2786 | { |
| 2787 | generic_mapmemory(cartridge, offset, mask, &coco_rom[0xC000], 0x3FFF); | |
| 2787 | generic_mapmemory(machine, cartridge, offset, mask, &coco_rom[0xC000], 0x3FFF); | |
| 2788 | 2788 | } |
| 2789 | 2789 | |
| 2790 | 2790 | |
| r3957 | r3958 | |
| 2886 | 2886 | halt_timer = timer_alloc(machine, halt_timer_proc, NULL); |
| 2887 | 2887 | |
| 2888 | 2888 | /* determine which cartridge hardware we should be using */ |
| 2889 | cart_image = cartslot_image(); | |
| 2889 | cart_image = cartslot_image(machine); | |
| 2890 | 2890 | if (image_exists(cart_image)) |
| 2891 | 2891 | { |
| 2892 | 2892 | /* we have a mounted cartridge; check the extra info */ |
| r3957 | r3958 | |
|---|---|---|
| 560 | 560 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 561 | 561 | |
| 562 | 562 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 563 | case DEVINFO_STR_NAME: info->s = "Toshiba 8521 RTC"; break; | |
| 564 | case DEVINFO_STR_FAMILY: info->s = "Toshiba 8521 RTC"; break; | |
| 565 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 566 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 563 | case DEVINFO_STR_NAME: strcpy(info->s, "Toshiba 8521 RTC"); break; | |
| 564 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Toshiba 8521 RTC"); break; | |
| 565 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 566 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 567 | 567 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 568 | 568 | } |
| 569 | 569 | } |
| r3957 | r3958 | |
|---|---|---|
| 1049 | 1049 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc6854); break; |
| 1050 | 1050 | |
| 1051 | 1051 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1052 | case DEVINFO_STR_NAME: info->s = "Motorola MC6854 ADLC"; break; | |
| 1053 | case DEVINFO_STR_FAMILY: info->s = "MC6854"; break; | |
| 1054 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 1055 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1056 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 1052 | case DEVINFO_STR_NAME: strcpy(info->s, "Motorola MC6854 ADLC"); break; | |
| 1053 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MC6854"); break; | |
| 1054 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 1055 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1056 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 1057 | 1057 | } |
| 1058 | 1058 | } |
| r3957 | r3958 | |
|---|---|---|
| 402 | 402 | /* NOTE: The reason we save the carts RAM this way instead of using MAME's |
| 403 | 403 | built in macros is because they force the filename to be the name of |
| 404 | 404 | the machine. We need to have a separate name for each game. */ |
| 405 | image_battery_save(image_from_devtype_and_index(IO_CARTSLOT, 0), gb_cart_ram, RAMBanks * 0x2000 ); | |
| 405 | image_battery_save(image_from_devtype_and_index(machine, IO_CARTSLOT, 0), gb_cart_ram, RAMBanks * 0x2000 ); | |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | static void gb_set_mbc1_banks( running_machine *machine ) { |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | #define TC8521 DEVICE_GET_INFO_NAME(tc8521) |
| 18 | 18 | |
| 19 | 19 | #define MDRV_TC8521_ADD(_tag, _intrf) \ |
| 20 | MDRV_DEVICE_ADD(_tag, TC8521) \ | |
| 20 | MDRV_DEVICE_ADD(_tag, TC8521, 0) \ | |
| 21 | 21 | MDRV_DEVICE_CONFIG(_intrf) |
| 22 | 22 | |
| 23 | 23 | #define MDRV_TC8521_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | #define MDRV_MC6854_ADD(_tag, _intrf) \ |
| 53 | MDRV_DEVICE_ADD(_tag, MC6854) \ | |
| 53 | MDRV_DEVICE_ADD(_tag, MC6854, 0) \ | |
| 54 | 54 | MDRV_DEVICE_CONFIG(_intrf) |
| 55 | 55 | |
| 56 | 56 | #define MDRV_MC6854_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 1033 | 1033 | }; |
| 1034 | 1034 | |
| 1035 | 1035 | MACHINE_DRIVER_START( ti990_hdc ) |
| 1036 | MDRV_DEVICE_ADD( "harddisk1", HARDDISK ) | |
| 1036 | MDRV_DEVICE_ADD( "harddisk1", HARDDISK, 0 ) | |
| 1037 | 1037 | MDRV_DEVICE_CONFIG( ti990_harddisk_config ) |
| 1038 | MDRV_DEVICE_ADD( "harddisk2", HARDDISK ) | |
| 1038 | MDRV_DEVICE_ADD( "harddisk2", HARDDISK, 0 ) | |
| 1039 | 1039 | MDRV_DEVICE_CONFIG( ti990_harddisk_config ) |
| 1040 | MDRV_DEVICE_ADD( "harddisk3", HARDDISK ) | |
| 1040 | MDRV_DEVICE_ADD( "harddisk3", HARDDISK, 0 ) | |
| 1041 | 1041 | MDRV_DEVICE_CONFIG( ti990_harddisk_config ) |
| 1042 | MDRV_DEVICE_ADD( "harddisk4", HARDDISK ) | |
| 1042 | MDRV_DEVICE_ADD( "harddisk4", HARDDISK, 0 ) | |
| 1043 | 1043 | MDRV_DEVICE_CONFIG( ti990_harddisk_config ) |
| 1044 | 1044 | MACHINE_DRIVER_END |
| 1045 | 1045 |
| r3957 | r3958 | |
|---|---|---|
| 359 | 359 | |
| 360 | 360 | for (id=0; id<MAX_FLOPPIES; id++) |
| 361 | 361 | { |
| 362 | image = image_from_devtype_and_index(IO_FLOPPY, id); | |
| 362 | image = image_from_devtype_and_index(machine, IO_FLOPPY, id); | |
| 363 | 363 | floppy_install_tracktranslate_proc(image, ti99_tracktranslate); |
| 364 | 364 | } |
| 365 | 365 | } |
| r3957 | r3958 | |
|---|---|---|
| 384 | 384 | |
| 385 | 385 | READ8_HANDLER( gamecom_internal_r ) |
| 386 | 386 | { |
| 387 | /* NPW 22-Dec-2008 - Shouldn't this entire function be moved to an internal memory map of the CPU core? */ | |
| 387 | 388 | if ( offset >= 0x80 ) |
| 388 | 389 | { |
| 389 | 390 | return internal_ram[offset]; |
| r3957 | r3958 | |
| 395 | 396 | case SM8521_R4: case SM8521_R5: case SM8521_R6: case SM8521_R7: |
| 396 | 397 | case SM8521_R8: case SM8521_R9: case SM8521_R10: case SM8521_R11: |
| 397 | 398 | case SM8521_R12: case SM8521_R13: case SM8521_R14: case SM8521_R15: |
| 398 | return sm85cpu_mem_readbyte( offset ); | |
| 399 | return 0; /* NPW 22-Dec-2008 - Not sure what to do here */ | |
| 400 | /*return sm85cpu_mem_readbyte( state, offset );*/ | |
| 399 | 401 | case SM8521_IE0: return cpu_get_reg( space->machine->cpu[0], SM8500_IE0 ); |
| 400 | 402 | case SM8521_IE1: return cpu_get_reg( space->machine->cpu[0], SM8500_IE1 ); |
| 401 | 403 | case SM8521_IR0: return cpu_get_reg( space->machine->cpu[0], SM8500_IR0 ); |
| r3957 | r3958 | |
| 512 | 514 | Their usage is also not explained properly in the manuals. Guess we'll have to wait |
| 513 | 515 | for them to show up in some rom images... |
| 514 | 516 | */ |
| 515 | void gamecom_handle_dma( int cycles ) | |
| 517 | void gamecom_handle_dma( const device_config *device, int cycles ) | |
| 516 | 518 | { |
| 517 | 519 | unsigned y_count, x_count; |
| 518 | 520 | /* If not enabled, ignore */ |
| r3957 | r3958 | |
| 603 | 605 | gamecom_dma.dest_current = gamecom_dma.dest_line; |
| 604 | 606 | } |
| 605 | 607 | gamecom_dma.enabled = 0; |
| 606 | cpu_set_input_line( | |
| 608 | cpu_set_input_line(device->machine->cpu[0], DMA_INT, HOLD_LINE ); | |
| 607 | 609 | } |
| 608 | 610 | |
| 609 | void gamecom_update_timers( int cycles ) | |
| 611 | void gamecom_update_timers( const device_config *device, int cycles ) | |
| 610 | 612 | { |
| 611 | 613 | if ( gamecom_timer[0].enabled ) |
| 612 | 614 | { |
| r3957 | r3958 | |
| 618 | 620 | if ( gamecom_timer[0].counter == gamecom_timer[0].check_value ) |
| 619 | 621 | { |
| 620 | 622 | gamecom_timer[0].counter = 0; |
| 621 | cpu_set_input_line( | |
| 623 | cpu_set_input_line(device->machine->cpu[0], TIM0_INT, HOLD_LINE ); | |
| 622 | 624 | } |
| 623 | 625 | } |
| 624 | 626 | } |
| r3957 | r3958 | |
| 632 | 634 | if ( gamecom_timer[1].counter == gamecom_timer[1].check_value ) |
| 633 | 635 | { |
| 634 | 636 | gamecom_timer[1].counter = 0; |
| 635 | cpu_set_input_line( | |
| 637 | cpu_set_input_line(device->machine->cpu[0], TIM1_INT, HOLD_LINE ); | |
| 636 | 638 | } |
| 637 | 639 | } |
| 638 | 640 | } |
| r3957 | r3958 | |
| 650 | 652 | |
| 651 | 653 | DEVICE_START( gamecom_cart ) |
| 652 | 654 | { |
| 653 | internal_ram = | |
| 655 | internal_ram = device_get_info_pt | |
| 654 | 656 | return DEVICE_START_OK; |
| 655 | 657 | } |
| 656 | 658 |
| r3957 | r3958 | |
|---|---|---|
| 256 | 256 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ins8154); break; |
| 257 | 257 | |
| 258 | 258 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 259 | case DEVINFO_STR_NAME: info->s = "National Semiconductor INS8154"; break; | |
| 260 | case DEVINFO_STR_FAMILY: info->s = "INS8154"; break; | |
| 261 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 262 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 263 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 259 | case DEVINFO_STR_NAME: strcpy(info->s, "National Semiconductor INS8154"); break; | |
| 260 | case DEVINFO_STR_FAMILY: strcpy(info->s, "INS8154"); break; | |
| 261 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 262 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 263 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 264 | 264 | } |
| 265 | 265 | } |
| r3957 | r3958 | |
|---|---|---|
| 149 | 149 | const dma8257_interface radio86_dma = |
| 150 | 150 | { |
| 151 | 151 | 0, |
| 152 | XTAL_16MHz / 9, | |
| 153 | 152 | |
| 154 | 153 | radio86_dma_read_byte, |
| 155 | 154 | 0, |
| r3957 | r3958 | |
| 168 | 167 | |
| 169 | 168 | READ8_HANDLER (radio_cpu_state_r ) |
| 170 | 169 | { |
| 171 | return cpu_get_reg(space->cpu, I808 | |
| 170 | return cpu_get_reg(space->cpu, I8085_STATUS); | |
| 172 | 171 | } |
| 173 | 172 | |
| 174 | 173 | READ8_HANDLER (radio_io_r ) |
| r3957 | r3958 | |
|---|---|---|
| 54 | 54 | ***************************************************************************/ |
| 55 | 55 | |
| 56 | 56 | #define MDRV_INS8154_ADD(_tag, _intrf) \ |
| 57 | MDRV_DEVICE_ADD(_tag, INS8154) \ | |
| 57 | MDRV_DEVICE_ADD(_tag, INS8154, 0) \ | |
| 58 | 58 | MDRV_DEVICE_CONFIG(_intrf) |
| 59 | 59 | |
| 60 | 60 | #endif /* INS8154_H_ */ |
| r3957 | r3958 | |
|---|---|---|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | |
| 391 | static | |
| 391 | static STREAM_UPDATE( b2m_sh_update | |
| 392 | 392 | { |
| 393 | 393 | INT16 channel_1_signal; |
| 394 | 394 |
| r3957 | r3958 | |
|---|---|---|
| 155 | 155 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ttl74145); break; |
| 156 | 156 | |
| 157 | 157 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 158 | case DEVINFO_STR_NAME: info->s = "TTL74145"; break; | |
| 159 | case DEVINFO_STR_FAMILY: info->s = "TTL74145"; break; | |
| 160 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 161 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 162 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 158 | case DEVINFO_STR_NAME: strcpy(info->s, "TTL74145"); break; | |
| 159 | case DEVINFO_STR_FAMILY: strcpy(info->s, "TTL74145"); break; | |
| 160 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 161 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 162 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 163 | 163 | } |
| 164 | 164 | } |
| r3957 | r3958 | |
|---|---|---|
| 636 | 636 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc6846); break; |
| 637 | 637 | |
| 638 | 638 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 639 | case DEVINFO_STR_NAME: info->s = "Motorola MC6846 programmable timer"; break; | |
| 640 | case DEVINFO_STR_FAMILY: info->s = "MC6846"; break; | |
| 641 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 642 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 643 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 639 | case DEVINFO_STR_NAME: strcpy(info->s, "Motorola MC6846 programmable timer"); break; | |
| 640 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MC6846"); break; | |
| 641 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 642 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 643 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 644 | 644 | } |
| 645 | 645 | } |
| r3957 | r3958 | |
|---|---|---|
| 348 | 348 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 349 | 349 | |
| 350 | 350 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 351 | case DEVINFO_STR_NAME: info->s = "RCA CDP1871"; break; | |
| 352 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break; | |
| 353 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 354 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 355 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 351 | case DEVINFO_STR_NAME: strcpy(info->s, "RCA CDP1871"); break; | |
| 352 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RCA CDP1800"); break; | |
| 353 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 354 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 355 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 356 | 356 | } |
| 357 | 357 | } |
| r3957 | r3958 | |
|---|---|---|
| 369 | 369 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 370 | 370 | |
| 371 | 371 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 372 | case DEVINFO_STR_NAME: info->s = "Zilog 8530 SCC"; break; | |
| 373 | case DEVINFO_STR_FAMILY: info->s = "Zilog 8530 SCC"; break; | |
| 374 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 375 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 372 | case DEVINFO_STR_NAME: strcpy(info->s, "Zilog 8530 SCC"); break; | |
| 373 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Zilog 8530 SCC"); break; | |
| 374 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 375 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 376 | 376 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 377 | 377 | } |
| 378 | 378 | } |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | ***************************************************************************/ |
| 56 | 56 | |
| 57 | 57 | #define MDRV_TTL74145_ADD(_tag, _intrf) \ |
| 58 | MDRV_DEVICE_ADD(_tag, TTL74145) \ | |
| 58 | MDRV_DEVICE_ADD(_tag, TTL74145, 0) \ | |
| 59 | 59 | MDRV_DEVICE_CONFIG(_intrf) |
| 60 | 60 | |
| 61 | 61 |
| r3957 | r3958 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | #define MDRV_MC6846_ADD(_tag, _intrf) \ |
| 36 | MDRV_DEVICE_ADD(_tag, MC6846) \ | |
| 36 | MDRV_DEVICE_ADD(_tag, MC6846, 0) \ | |
| 37 | 37 | MDRV_DEVICE_CONFIG(_intrf) |
| 38 | 38 | |
| 39 | 39 | #define MDRV_MC6846_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | #define CDP1871 DEVICE_GET_INFO_NAME(cdp1871) |
| 43 | 43 | |
| 44 | 44 | #define MDRV_CDP1871_ADD(_tag, _intrf) \ |
| 45 | MDRV_DEVICE_ADD(_tag, CDP1871) \ | |
| 45 | MDRV_DEVICE_ADD(_tag, CDP1871, 0) \ | |
| 46 | 46 | MDRV_DEVICE_CONFIG(_intrf) |
| 47 | 47 | |
| 48 | 48 | #define MDRV_CDP1871_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | ***************************************************************************/ |
| 36 | 36 | |
| 37 | 37 | #define MDRV_SCC8530_ADD(_tag, _intrf) \ |
| 38 | MDRV_DEVICE_ADD(_tag, SCC8530) \ | |
| 38 | MDRV_DEVICE_ADD(_tag, SCC8530, 0) \ | |
| 39 | 39 | MDRV_DEVICE_CONFIG(_intrf) |
| 40 | 40 | |
| 41 | 41 |
| r3957 | r3958 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | const z80pio_interface kramermc_z80pio_intf = |
| 34 | 34 | { |
| 35 | "main", | |
| 36 | 0, | |
| 37 | 35 | NULL, /* callback when change interrupt status */ |
| 38 | 36 | kramermc_port_a_r, |
| 39 | 37 | kramermc_port_b_r, |
| r3957 | r3958 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | /* Hack for correct handling 0xffff interrupt vector */ |
| 59 | 59 | if (address == 0x0001) |
| 60 | if (cpu_get_reg(space->machine->cpu[0], REG_ | |
| 60 | if (cpu_get_reg(space->machine->cpu[0], REG_G | |
| 61 | 61 | { |
| 62 | 62 | cpu_set_reg(space->machine->cpu[0], Z80_PC, 0xfff4); |
| 63 | 63 | return 0xfff4; |
| r3957 | r3958 | |
|---|---|---|
| 299 | 299 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(sam6883); break; |
| 300 | 300 | |
| 301 | 301 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 302 | case DEVINFO_STR_NAME: info->s = "6883 SAM"; break; | |
| 303 | case DEVINFO_STR_FAMILY: info->s = "6883 SAM"; break; | |
| 304 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 305 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 306 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 302 | case DEVINFO_STR_NAME: strcpy(info->s, "6883 SAM"); break; | |
| 303 | case DEVINFO_STR_FAMILY: strcpy(info->s, "6883 SAM"); break; | |
| 304 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 305 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 306 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | |
| r3957 | r3958 | |
| 312 | 312 | switch (state) |
| 313 | 313 | { |
| 314 | 314 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 315 | case DEVINFO_STR_NAME: info->s | |
| 315 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 316 | 316 | |
| 317 | 317 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 318 | 318 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(sam6883_gime); break; |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | const device_config *cia_0 = device_list_find_by_tag(space->machine->config->devicelist, CIA6526R1, "cia_0"); |
| 97 | 97 | const device_config *cia_1 = device_list_find_by_tag(space->machine->config->devicelist, CIA6526R1, "cia_1"); |
| 98 | 98 | |
| 99 | UINT8 c64_port6510 = (UINT8) c | |
| 99 | UINT8 c64_port6510 = (UINT8) device | |
| 100 | 100 | |
| 101 | 101 | if (!c128_write_io) |
| 102 | 102 | { |
| r3957 | r3958 | |
| 190 | 190 | if (!c64mode) |
| 191 | 191 | return; |
| 192 | 192 | |
| 193 | data = (UINT8) c | |
| 193 | data = (UINT8) device | |
| 194 | 194 | if ((data == old)&&(exrom==c64_exrom)&&(game==c64_game)&&!reset) |
| 195 | 195 | return; |
| 196 | 196 | |
| r3957 | r3958 | |
| 586 | 586 | * driver used to work with this behavior, so I am doing this hack |
| 587 | 587 | * where I set CPU #1's PC to 0x1100 on reset. |
| 588 | 588 | */ |
| 589 | if (cpu_get_reg(machine->cpu[1], REG_PC) == 0x0000) | |
| 590 | cpu_set_reg(machine->cpu[1], REG_PC, 0x1100); | |
| 589 | if (cpu_get_reg(machine->cpu[1], REG_GENPC) == 0x0000) | |
| 590 | cpu_set_reg(machine->cpu[1], REG_GENPC, 0x1100); | |
| 591 | 591 | } |
| 592 | 592 | mmu_cpu = MMU_CPU8502; |
| 593 | 593 | return; |
| r3957 | r3958 | |
| 780 | 780 | */ |
| 781 | 781 | static int c128_dma_read(running_machine *machine, int offset) |
| 782 | 782 | { |
| 783 | UINT8 c64_port6510 = (UINT8) c | |
| 783 | UINT8 c64_port6510 = (UINT8) device | |
| 784 | 784 | |
| 785 | 785 | /* main memory configuration to include */ |
| 786 | 786 | if (c64mode) |
| r3957 | r3958 | |
| 803 | 803 | |
| 804 | 804 | static int c128_dma_read_color(running_machine *machine, int offset) |
| 805 | 805 | { |
| 806 | UINT8 c64_port6510 = (UINT8) c | |
| 806 | UINT8 c64_port6510 = (UINT8) device | |
| 807 | 807 | |
| 808 | 808 | if (c64mode) |
| 809 | 809 | return c64_colorram[offset & 0x3ff] & 0xf; |
| r3957 | r3958 | |
| 890 | 890 | int i; |
| 891 | 891 | |
| 892 | 892 | /* configure the M6510 port */ |
| 893 | cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_M6510_PORTREAD, (genf *) c128_m6510_port_read); | |
| 894 | cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c128_m6510_port_write); | |
| 893 | device_set_info_fct(machine->cpu[1], CPUINFO_PTR_M6510_PORTREAD, (genf *) c128_m6510_port_read); | |
| 894 | device_set_info_fct(machine->cpu[1], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c128_m6510_port_write); | |
| 895 | 895 | |
| 896 | 896 | c64_memory = ram; |
| 897 | 897 |
| r3957 | r3958 | |
|---|---|---|
| 86 | 86 | ***************************************************************************/ |
| 87 | 87 | |
| 88 | 88 | #define MDRV_SAM6883_ADD(_tag, _intrf) \ |
| 89 | MDRV_DEVICE_ADD(_tag, SAM6883) \ | |
| 89 | MDRV_DEVICE_ADD(_tag, SAM6883, 0) \ | |
| 90 | 90 | MDRV_DEVICE_CONFIG(_intrf) |
| 91 | 91 | |
| 92 | 92 | #define MDRV_SAM6883_GIME_ADD(_tag, _intrf) \ |
| 93 | MDRV_DEVICE_ADD(_tag, SAM6883_GIME) \ | |
| 93 | MDRV_DEVICE_ADD(_tag, SAM6883_GIME, 0) \ | |
| 94 | 94 | MDRV_DEVICE_CONFIG(_intrf) |
| 95 | 95 | |
| 96 | 96 |
| r3957 | r3958 | |
|---|---|---|
| 115 | 115 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 116 | 116 | |
| 117 | 117 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 118 | case DEVINFO_STR_NAME: info->s = "Apple II Language Card"; break; | |
| 119 | case DEVINFO_STR_FAMILY: info->s = "Apple II Language Card"; break; | |
| 120 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 121 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 118 | case DEVINFO_STR_NAME: strcpy(info->s, "Apple II Language Card"); break; | |
| 119 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Apple II Language Card"); break; | |
| 120 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 121 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 122 | 122 | } |
| 123 | 123 | } |
| r3957 | r3958 | |
|---|---|---|
| 377 | 377 | |
| 378 | 378 | static DEVICE_START( miot6530 ) |
| 379 | 379 | { |
| 380 | const miot6530_config *config = device->inline_config; | |
| 381 | 380 | miot6530_state *miot = get_safe_token(device); |
| 382 | 381 | |
| 383 | 382 | /* validate arguments */ |
| r3957 | r3958 | |
| 387 | 386 | |
| 388 | 387 | /* set static values */ |
| 389 | 388 | miot->intf = device->static_config; |
| 390 | miot->clock = | |
| 389 | miot->clock = dev | |
| 391 | 390 | |
| 392 | 391 | /* configure the ports */ |
| 393 | 392 | miot->port[0].in_func = miot->intf->in_a_func; |
| r3957 | r3958 | |
| 453 | 452 | { |
| 454 | 453 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 455 | 454 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(miot6530_state); break; |
| 456 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = | |
| 455 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = | |
| 457 | 456 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 458 | 457 | |
| 459 | 458 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r3957 | r3958 | |
| 463 | 462 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(miot6530);break; |
| 464 | 463 | |
| 465 | 464 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 466 | case DEVINFO_STR_NAME: info->s = "6530 (MIOT)"; break; | |
| 467 | case DEVINFO_STR_FAMILY: info->s = "I/O devices"; break; | |
| 468 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 469 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 470 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 465 | case DEVINFO_STR_NAME: strcpy(info->s, "6530 (MIOT)"); break; | |
| 466 | case DEVINFO_STR_FAMILY: strcpy(info->s, "I/O devices"); break; | |
| 467 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 468 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 469 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; | |
| 471 | 470 | } |
| 472 | 471 | } |
| r3957 | r3958 | |
|---|---|---|
| 636 | 636 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(tms9901); break; |
| 637 | 637 | |
| 638 | 638 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 639 | case DEVINFO_STR_NAME: info->s = "TMS9901"; break; | |
| 640 | case DEVINFO_STR_FAMILY: info->s = "TMS9901"; break; | |
| 641 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 642 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 639 | case DEVINFO_STR_NAME: strcpy(info->s, "TMS9901"); break; | |
| 640 | case DEVINFO_STR_FAMILY: strcpy(info->s, "TMS9901"); break; | |
| 641 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 642 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 643 | 643 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 644 | 644 | } |
| 645 | 645 | } |
| r3957 | r3958 | |
|---|---|---|
| 708 | 708 | |
| 709 | 709 | cbm_drive_0_config (input_port_read(machine, "CFG") & 2 ? IEEE : 0, 8); |
| 710 | 710 | cbm_drive_1_config (input_port_read(machine, "CFG") & 1 ? IEEE : 0, 9); |
| 711 | c | |
| 711 | device | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | #define APPLE2_LANGCARD DEVICE_GET_INFO_NAME(apple2_langcard) |
| 20 | 20 | |
| 21 | 21 | #define MDRV_APPLE2_LANGCARD_ADD(_tag) \ |
| 22 | MDRV_DEVICE_ADD((_tag), APPLE2_LANGCARD) | |
| 22 | MDRV_DEVICE_ADD((_tag), APPLE2_LANGCARD, 0) | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 |
| r3957 | r3958 | |
|---|---|---|
| 125 | 125 | UINT8 c16_m7501_port_read(const device_config *device, UINT8 direction) |
| 126 | 126 | { |
| 127 | 127 | UINT8 data = 0xff; |
| 128 | UINT8 c16_port7501 = (UINT8) c | |
| 128 | UINT8 c16_port7501 = (UINT8) device | |
| 129 | 129 | |
| 130 | 130 | if ((c16_port7501 & 0x01) || !cbm_serial_data_read(device->machine)) |
| 131 | 131 | data &= ~0x80; |
| r3957 | r3958 | |
| 432 | 432 | UINT8 *rom; |
| 433 | 433 | |
| 434 | 434 | /* configure the M7501 port */ |
| 435 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c16_m7501_port_read); | |
| 436 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c16_m7501_port_write); | |
| 435 | device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c16_m7501_port_read); | |
| 436 | device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c16_m7501_port_write); | |
| 437 | 437 | |
| 438 | 438 | c16_select_roms (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| 439 | 439 | c16_switch_to_rom (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| r3957 | r3958 | |
|---|---|---|
| 12 | 12 | TYPE DEFINITIONS |
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | typedef struct _miot6530_config miot6530_config; | |
| 16 | struct _miot6530_config | |
| 17 | { | |
| 18 | UINT32 clock; | |
| 19 | }; | |
| 20 | ||
| 21 | ||
| 22 | 15 | typedef UINT8 (*miot_read_func)(const device_config *device, UINT8 olddata); |
| 23 | 16 | typedef void (*miot_write_func)(const device_config *device, UINT8 newdata, UINT8 olddata); |
| 24 | 17 | |
| r3957 | r3958 | |
| 39 | 32 | ***************************************************************************/ |
| 40 | 33 | |
| 41 | 34 | #define MDRV_MIOT6530_ADD(_tag, _clock, _intrf) \ |
| 42 | MDRV_DEVICE_ADD(_tag, MIOT6530) \ | |
| 43 | MDRV_DEVICE_CONFIG_DATA32(miot6530_config, clock, _clock) \ | |
| 35 | MDRV_DEVICE_ADD(_tag, MIOT6530, _clock) \ | |
| 44 | 36 | MDRV_DEVICE_CONFIG(_intrf) |
| 45 | 37 | |
| 46 | 38 | #define MDRV_MIOT6530_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 63 | 63 | ***************************************************************************/ |
| 64 | 64 | |
| 65 | 65 | #define MDRV_TMS9901_ADD(_tag, _intrf) \ |
| 66 | MDRV_DEVICE_ADD(_tag, TMS9901) \ | |
| 66 | MDRV_DEVICE_ADD(_tag, TMS9901, 0) \ | |
| 67 | 67 | MDRV_DEVICE_CONFIG(_intrf) |
| 68 | 68 | |
| 69 | 69 | #endif /* __TMS9901_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 1220 | 1220 | } |
| 1221 | 1221 | break; |
| 1222 | 1222 | } |
| 1223 | c | |
| 1223 | device | |
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | 1226 | |
| r3957 | r3958 | |
| 1257 | 1257 | { |
| 1258 | 1258 | if ((offset & 0x0f)!=0x0d) |
| 1259 | 1259 | { |
| 1260 | logerror("via 0 r: %04x %04x\n",offset, (unsigned) cpu_get_reg(space->machine->cpu[0], REG_PC)); | |
| 1260 | logerror("via 0 r: %04x %04x\n",offset, (unsigned) cpu_get_reg(space->machine->cpu[0], REG_GENPC)); | |
| 1261 | 1261 | } |
| 1262 | 1262 | } |
| 1263 | 1263 | /* it is repeated */ |
| r3957 | r3958 | |
| 1298 | 1298 | #endif |
| 1299 | 1299 | if (enable_logging) |
| 1300 | 1300 | { |
| 1301 | logerror("via 0 w: %04x %02x %04x\n",offset,data,(unsigned) cpu_get_reg(space->machine->cpu[0], REG_PC)); | |
| 1301 | logerror("via 0 w: %04x %02x %04x\n",offset,data,(unsigned) cpu_get_reg(space->machine->cpu[0], REG_GENPC)); | |
| 1302 | 1302 | } |
| 1303 | 1303 | |
| 1304 | 1304 | via_w(via_0, offset & 0x0f,data); |
| r3957 | r3958 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | for (i=0; i<MAX_FLOPPIES; i++) |
| 116 | 116 | { |
| 117 | fd800.drv[i].img = image_from_devtype_and_index(IO_FLOPPY, i); | |
| 117 | fd800.drv[i].img = image_from_devtype_and_index(machine, IO_FLOPPY, i); | |
| 118 | 118 | fd800.drv[i].phys_cylinder = -1; |
| 119 | 119 | fd800.drv[i].log_cylinder[0] = fd800.drv[i].log_cylinder[1] = -1; |
| 120 | 120 | fd800.drv[i].seclen = 64; |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| 156 | static void at_set_keyb_int(int state) { | |
| 156 | static void at_set_keyb_int(running_machine *machine, int state) { | |
| 157 | 157 | pic8259_set_irq_line(at_devices.pic8259_master, 1, state); |
| 158 | 158 | } |
| 159 | 159 | |
| r3957 | r3958 | |
| 222 | 222 | |
| 223 | 223 | if (LOG_PORT80 && (offset == 0)) |
| 224 | 224 | { |
| 225 | logerror(" at_page8_w(): Port 80h <== 0x%02x (PC=0x%08x)\n", data, (unsigned) cpu_get_reg(space->machine->cpu[0],REG_PC)); | |
| 225 | logerror(" at_page8_w(): Port 80h <== 0x%02x (PC=0x%08x)\n", data, (unsigned) cpu_get_reg(space->machine->cpu[0],REG_GENPC)); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | switch(offset % 8) { |
| r3957 | r3958 | |
|---|---|---|
| 161 | 161 | UINT8 val = input_port_read(machine, "RESET"); |
| 162 | 162 | if ((val & 1)==1) { |
| 163 | 163 | memory_set_bankptr(machine, 1, memory_region(machine, "main") + 0x10000); |
| 164 | c | |
| 164 | device | |
| 165 | 165 | } |
| 166 | 166 | if ((val & 2)==2) { |
| 167 | 167 | memory_set_bankptr(machine, 1, mess_ram + 0x0000); |
| 168 | c | |
| 168 | device | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 |
| r3957 | r3958 | |
|---|---|---|
| 511 | 511 | { |
| 512 | 512 | command_name = hdc_command_names[cmd] ? hdc_command_names[cmd] : "Unknown"; |
| 513 | 513 | logerror("pc_hdc_command(): Executing command; pc=0x%08x cmd=0x%02x (%s) drv=%d\n", |
| 514 | (unsigned) cpu_get_reg(machine->cpu[0], REG_PC), cmd, command_name, drv); | |
| 514 | (unsigned) cpu_get_reg(machine->cpu[0], REG_GENPC), cmd, command_name, drv); | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | switch (cmd) |
| r3957 | r3958 | |
| 549 | 549 | if (LOG_HDC_STATUS) |
| 550 | 550 | { |
| 551 | 551 | logerror("hdc read pc=0x%08x INDEX #%d D:%d C:%d H:%d S:%d N:%d CTL:$%02x\n", |
| 552 | (unsigned) cpu_get_reg(machine->cpu[0], REG_PC), idx, drv, cylinder[idx], head[idx], sector[idx], sector_cnt[idx], control[idx]); | |
| 552 | (unsigned) cpu_get_reg(machine->cpu[0], REG_GENPC), idx, drv, cylinder[idx], head[idx], sector[idx], sector_cnt[idx], control[idx]); | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | if (test_ready(machine, n)) |
| r3957 | r3958 | |
| 564 | 564 | if (LOG_HDC_STATUS) |
| 565 | 565 | { |
| 566 | 566 | logerror("hdc write pc=0x%08x INDEX #%d D:%d C:%d H:%d S:%d N:%d CTL:$%02x\n", |
| 567 | (unsigned) cpu_get_reg(machine->cpu[0], REG_PC), idx, drv, cylinder[idx], head[idx], sector[idx], sector_cnt[idx], control[idx]); | |
| 567 | (unsigned) cpu_get_reg(machine->cpu[0], REG_GENPC), idx, drv, cylinder[idx], head[idx], sector[idx], sector_cnt[idx], control[idx]); | |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | if (test_ready(machine, n)) |
| r3957 | r3958 | |
| 673 | 673 | if (--data_cnt == 0) |
| 674 | 674 | { |
| 675 | 675 | if (LOG_HDC_STATUS) |
| 676 | logerror("pc_hdc_data_w(): Launching command; pc=0x%08x\n", (unsigned) cpu_get_reg(machine->cpu[0], REG_PC)); | |
| 676 | logerror("pc_hdc_data_w(): Launching command; pc=0x%08x\n", (unsigned) cpu_get_reg(machine->cpu[0], REG_GENPC)); | |
| 677 | 677 | |
| 678 | 678 | status[n] &= ~STA_COMMAND; |
| 679 | 679 | status[n] &= ~STA_REQUEST; |
| r3957 | r3958 | |
| 715 | 715 | int irq = irq = (dip[n] & 0x40) ? 5 : 2; |
| 716 | 716 | |
| 717 | 717 | if (LOG_HDC_STATUS) |
| 718 | logerror("pc_hdc_control_w(): Control write pc=0x%08x data=%d\n", (unsigned) cpu_get_reg(machine->cpu[0], REG_PC), data); | |
| 718 | logerror("pc_hdc_control_w(): Control write pc=0x%08x data=%d\n", (unsigned) cpu_get_reg(machine->cpu[0], REG_GENPC), data); | |
| 719 | 719 | |
| 720 | 720 | hdc_control = data; |
| 721 | 721 | |
| r3957 | r3958 | |
| 843 | 843 | |
| 844 | 844 | MACHINE_DRIVER_START( pc_hdc ) |
| 845 | 845 | /* harddisk */ |
| 846 | MDRV_DEVICE_ADD("harddisk1", HARDDISK) | |
| 847 | MDRV_DEVICE_ADD("harddisk2", HARDDISK) | |
| 848 | MDRV_DEVICE_ADD("harddisk3", HARDDISK) | |
| 849 | MDRV_DEVICE_ADD("harddisk4", HARDDISK) | |
| 846 | MDRV_HARDDISK_ADD("harddisk1") | |
| 847 | MDRV_HARDDISK_ADD("harddisk2") | |
| 848 | MDRV_HARDDISK_ADD("harddisk3") | |
| 849 | MDRV_HARDDISK_ADD("harddisk4") | |
| 850 | 850 | MACHINE_DRIVER_END |
| 851 | 851 | |
| 852 | 852 |
| r3957 | r3958 | |
|---|---|---|
| 1494 | 1494 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc68901); break; |
| 1495 | 1495 | |
| 1496 | 1496 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1497 | case DEVINFO_STR_NAME: info->s = "Motorola MC68901"; break; | |
| 1498 | case DEVINFO_STR_FAMILY: info->s = "MC68901 MFP"; break; | |
| 1499 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1500 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1501 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 1497 | case DEVINFO_STR_NAME: strcpy(info->s, "Motorola MC68901"); break; | |
| 1498 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MC68901 MFP"); break; | |
| 1499 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1500 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1501 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 1502 | 1502 | } |
| 1503 | 1503 | } |
| 1504 | 1504 | |
| r3957 | r3958 | |
| 1519 | 1519 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc68901); break; |
| 1520 | 1520 | |
| 1521 | 1521 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1522 | case DEVINFO_STR_NAME: info->s = "Mostek MK68901"; break; | |
| 1523 | case DEVINFO_STR_FAMILY: info->s = "MK68901 MFP"; break; | |
| 1524 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1525 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1526 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 1522 | case DEVINFO_STR_NAME: strcpy(info->s, "Mostek MK68901"); break; | |
| 1523 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MK68901 MFP"); break; | |
| 1524 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1525 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1526 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 1527 | 1527 | } |
| 1528 | 1528 | } |
| 1529 | 1529 | #endif |
| r3957 | r3958 | |
|---|---|---|
| 1394 | 1394 | case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)z80dart_irq_reti; break; |
| 1395 | 1395 | |
| 1396 | 1396 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1397 | case DEVINFO_STR_NAME: info->s = "Zilog Z80 DART"; break; | |
| 1398 | case DEVINFO_STR_FAMILY: info->s = "Z80"; break; | |
| 1399 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1400 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1401 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 1397 | case DEVINFO_STR_NAME: strcpy(info->s, "Zilog Z80 DART"); break; | |
| 1398 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Z80"); break; | |
| 1399 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1400 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1401 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 1402 | 1402 | } |
| 1403 | 1403 | } |
| r3957 | r3958 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | if ( amiga_intf != NULL && amiga_intf->nmi_callback ) |
| 71 | 71 | { |
| 72 | (*amiga_intf->nmi_callback)(); | |
| 72 | (*amiga_intf->nmi_callback)(field->port->machine); | |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | else |
| r3957 | r3958 | |
|---|---|---|
| 62 | 62 | #define MK68901 DEVICE_GET_INFO_NAME( mk68901 ) |
| 63 | 63 | |
| 64 | 64 | #define MDRV_MC68901_ADD(_tag, _config) \ |
| 65 | MDRV_DEVICE_ADD((_tag), MC68901) \ | |
| 65 | MDRV_DEVICE_ADD((_tag), MC68901, 0) \ | |
| 66 | 66 | MDRV_DEVICE_CONFIG(_config) |
| 67 | 67 | |
| 68 | 68 | #define MDRV_MK68901_ADD(_tag, _config) \ |
| 69 | MDRV_DEVICE_ADD((_tag), MK68901) \ | |
| 69 | MDRV_DEVICE_ADD((_tag), MK68901, 0) \ | |
| 70 | 70 | MDRV_DEVICE_CONFIG(_config) |
| 71 | 71 | |
| 72 | 72 |
| r3957 | r3958 | |
|---|---|---|
| 100 | 100 | ***************************************************************************/ |
| 101 | 101 | |
| 102 | 102 | #define MDRV_Z80DART_ADD(_tag, _intrf) \ |
| 103 | MDRV_DEVICE_ADD(_tag, Z80DART) \ | |
| 103 | MDRV_DEVICE_ADD(_tag, Z80DART, 0) \ | |
| 104 | 104 | MDRV_DEVICE_CONFIG(_intrf) |
| 105 | 105 | |
| 106 | 106 | #define MDRV_Z80DART_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "deprecat.h" | |
| 15 | 14 | #include "amiga.h" |
| 16 | 15 | #include "cpu/m68000/m68000.h" |
| 17 | 16 | #include "machine/6526cia.h" |
| r3957 | r3958 | |
| 439 | 438 | } |
| 440 | 439 | } |
| 441 | 440 | |
| 442 | void amiga_cart_nmi( | |
| 441 | void amiga_cart_nmi( running_machine *machine ) | |
| 443 | 442 | { |
| 444 | running_machine *machine = Machine; | |
| 445 | 443 | if ( amiga_cart_type < 0 ) |
| 446 | 444 | return; |
| 447 | 445 |
| r3957 | r3958 | |
|---|---|---|
| 682 | 682 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(tms9902); break; |
| 683 | 683 | |
| 684 | 684 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 685 | case DEVINFO_STR_NAME: info->s = "TMS9902"; break; | |
| 686 | case DEVINFO_STR_FAMILY: info->s = "TMS9902"; break; | |
| 687 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 688 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 685 | case DEVINFO_STR_NAME: strcpy(info->s, "TMS9902"); break; | |
| 686 | case DEVINFO_STR_FAMILY: strcpy(info->s, "TMS9902"); break; | |
| 687 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 688 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 689 | 689 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 690 | 690 | } |
| 691 | 691 | } |
| r3957 | r3958 | |
|---|---|---|
| 580 | 580 | case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)osborne1_daisy_irq_reti; break; |
| 581 | 581 | |
| 582 | 582 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 583 | case DEVINFO_STR_NAME: info->s = "Osborne1 daisy"; break; | |
| 584 | case DEVINFO_STR_FAMILY: info->s = "Z80"; break; | |
| 585 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 586 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 587 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 583 | case DEVINFO_STR_NAME: strcpy(info->s, "Osborne1 daisy"); break; | |
| 584 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Z80"); break; | |
| 585 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 586 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 587 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 |
| r3957 | r3958 | |
|---|---|---|
| 222 | 222 | memory_write_byte(space, 0x788e, start % 256); /* usr subroutine address */ |
| 223 | 223 | memory_write_byte(space, 0x788f, start / 256); |
| 224 | 224 | image_message(image, " %s (M)\nsize=%04X : start=%04X : end=%04X",pgmname,size,start,end); |
| 225 | cpu_set_reg(cputag_get_cpu(image->machine, "main"), REG_PC, start); /* start program */ | |
| 225 | cpu_set_reg(cputag_get_cpu(image->machine, "main"), REG_GENPC, start); /* start program */ | |
| 226 | 226 | break; |
| 227 | 227 | |
| 228 | 228 | default: |
| r3957 | r3958 | |
| 239 | 239 | Floppy Handling |
| 240 | 240 | ******************************************************************************/ |
| 241 | 241 | |
| 242 | static const device_config *vtech1_file( | |
| 242 | static const device_config *vtech1_file(running_machine *machine) | |
| 243 | 243 | { |
| 244 | 244 | if (vtech1_drive < 0) |
| 245 | 245 | return NULL; |
| 246 | 246 | |
| 247 | return image_from_devtype_and_index(IO_FLOPPY, vtech1_drive); | |
| 247 | return image_from_devtype_and_index(machine, IO_FLOPPY, vtech1_drive); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /* |
| r3957 | r3958 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | RegData = (pSnapshot[0x021] & 0x0ff) | ((pSnapshot[0x022] & 0x0ff)<<8); |
| 89 | 89 | cpu_set_reg(machine->cpu[0],Z80_SP, RegData); |
| 90 | cpu_set_reg(machine->cpu[0],REG_SP,RegData); | |
| 90 | cpu_set_reg(machine->cpu[0],REG_GENSP,RegData); | |
| 91 | 91 | |
| 92 | 92 | RegData = (pSnapshot[0x023] & 0x0ff) | ((pSnapshot[0x024] & 0x0ff)<<8); |
| 93 | 93 |
| r3957 | r3958 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | void amiga_cart_init( running_machine *machine ); |
| 5 | 5 | void amiga_cart_check_overlay( running_machine *machine ); |
| 6 | void amiga_cart_nmi( | |
| 6 | void amiga_cart_nmi( running_machine *machine ); | |
| 7 | 7 | |
| 8 | 8 | #endif /* AMIGACRT_H */ |
| r3957 | r3958 | |
|---|---|---|
| 54 | 54 | ***************************************************************************/ |
| 55 | 55 | |
| 56 | 56 | #define MDRV_TMS9902_ADD(_tag, _intrf) \ |
| 57 | MDRV_DEVICE_ADD(_tag, TMS9902) \ | |
| 57 | MDRV_DEVICE_ADD(_tag, TMS9902, 0) \ | |
| 58 | 58 | MDRV_DEVICE_CONFIG(_intrf) |
| 59 | 59 | |
| 60 | 60 | #endif /* __TMS9902_H__ */ |
| r3957 | r3958 | |
|---|---|---|
| 581 | 581 | static void sms_machine_stop(running_machine *machine) { |
| 582 | 582 | /* Does the cartridge have SRAM that should be saved? */ |
| 583 | 583 | if ( sms_cartridge[sms_current_cartridge].sram_save ) { |
| 584 | image_battery_save( image_from_devtype_and_index(IO_CARTSLOT, 0), sms_cartridge[sms_current_cartridge].cartSRAM, sizeof(UINT8) * NVRAM_SIZE ); | |
| 584 | image_battery_save( image_from_devtype_and_index(machine, IO_CARTSLOT, 0), sms_cartridge[sms_current_cartridge].cartSRAM, sizeof(UINT8) * NVRAM_SIZE ); | |
| 585 | 585 | } |
| 586 | 586 | } |
| 587 | 587 | |
| r3957 | r3958 | |
| 1005 | 1005 | } else { |
| 1006 | 1006 | /* Pull reset line of CPU #0 low */ |
| 1007 | 1007 | cpu_suspend( space->machine->cpu[0], SUSPEND_REASON_HALT, 1 ); |
| 1008 | c | |
| 1008 | device | |
| 1009 | 1009 | } |
| 1010 | 1010 | sms_store_control = data; |
| 1011 | 1011 | } |
| r3957 | r3958 | |
|---|---|---|
| 284 | 284 | static const device_config *wd17xx_current_image(const device_config *device) |
| 285 | 285 | { |
| 286 | 286 | wd17xx_t *w = get_safe_token(device); |
| 287 | return image_from_devtype_and_index(IO_FLOPPY, w->current_drive); | |
| 287 | return image_from_devtype_and_index(device->machine, IO_FLOPPY, w->current_drive); | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | |
| r3957 | r3958 | |
| 1666 | 1666 | |
| 1667 | 1667 | for (i = 0; i < device_count(device->machine, IO_FLOPPY); i++) |
| 1668 | 1668 | { |
| 1669 | const device_config *img = image_from_devtype_and_index(IO_FLOPPY, i); | |
| 1669 | const device_config *img = image_from_devtype_and_index(device->machine, IO_FLOPPY, i); | |
| 1670 | 1670 | floppy_drive_set_controller(img,device); |
| 1671 | 1671 | floppy_drive_set_index_pulse_callback(img, wd17xx_index_pulse_callback); |
| 1672 | 1672 | floppy_drive_set_rpm( img, 300.); |
| r3957 | r3958 | |
| 1740 | 1740 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(wd17xx); break; |
| 1741 | 1741 | |
| 1742 | 1742 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1743 | case DEVINFO_STR_NAME: info->s = "WD1770"; break; | |
| 1744 | case DEVINFO_STR_FAMILY: info->s = "WD17xx"; break; | |
| 1745 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1746 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1747 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 1743 | case DEVINFO_STR_NAME: strcpy(info->s, "WD1770"); break; | |
| 1744 | case DEVINFO_STR_FAMILY: strcpy(info->s, "WD17xx"); break; | |
| 1745 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1746 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1747 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 1748 | 1748 | } |
| 1749 | 1749 | } |
| 1750 | 1750 | |
| r3957 | r3958 | |
| 1754 | 1754 | switch (state) |
| 1755 | 1755 | { |
| 1756 | 1756 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1757 | case DEVINFO_STR_NAME: info->s | |
| 1757 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1758 | 1758 | |
| 1759 | 1759 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1760 | 1760 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(wd1772); break; |
| r3957 | r3958 | |
| 1767 | 1767 | switch (state) |
| 1768 | 1768 | { |
| 1769 | 1769 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1770 | case DEVINFO_STR_NAME: info->s | |
| 1770 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1771 | 1771 | |
| 1772 | 1772 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1773 | 1773 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(wd1773); break; |
| r3957 | r3958 | |
| 1780 | 1780 | switch (state) |
| 1781 | 1781 | { |
| 1782 | 1782 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1783 | case DEVINFO_STR_NAME: info->s | |
| 1783 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1784 | 1784 | |
| 1785 | 1785 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1786 | 1786 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(wd179x); break; |
| r3957 | r3958 | |
| 1793 | 1793 | switch (state) |
| 1794 | 1794 | { |
| 1795 | 1795 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1796 | case DEVINFO_STR_NAME: info->s | |
| 1796 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1797 | 1797 | |
| 1798 | 1798 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1799 | 1799 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(wd1793); break; |
| r3957 | r3958 | |
| 1806 | 1806 | switch (state) |
| 1807 | 1807 | { |
| 1808 | 1808 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1809 | case DEVINFO_STR_NAME: info->s | |
| 1809 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1810 | 1810 | |
| 1811 | 1811 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1812 | 1812 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(wd2793); break; |
| r3957 | r3958 | |
| 1819 | 1819 | switch (state) |
| 1820 | 1820 | { |
| 1821 | 1821 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1822 | case DEVINFO_STR_NAME: info->s | |
| 1822 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1823 | 1823 | |
| 1824 | 1824 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1825 | 1825 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(wd177x); break; |
| r3957 | r3958 | |
| 1832 | 1832 | switch (state) |
| 1833 | 1833 | { |
| 1834 | 1834 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1835 | case DEVINFO_STR_NAME: info->s | |
| 1835 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 1836 | 1836 | |
| 1837 | 1837 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1838 | 1838 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mb8877); break; |
| r3957 | r3958 | |
|---|---|---|
| 96 | 96 | ***************************************************************************/ |
| 97 | 97 | |
| 98 | 98 | #define MDRV_WD1770_ADD(_tag, _intrf) \ |
| 99 | MDRV_DEVICE_ADD(_tag, WD1770) \ | |
| 99 | MDRV_DEVICE_ADD(_tag, WD1770, 0) \ | |
| 100 | 100 | MDRV_DEVICE_CONFIG(_intrf) |
| 101 | 101 | |
| 102 | 102 | #define MDRV_WD1772_ADD(_tag, _intrf) \ |
| 103 | MDRV_DEVICE_ADD(_tag, WD1772) \ | |
| 103 | MDRV_DEVICE_ADD(_tag, WD1772, 0) \ | |
| 104 | 104 | MDRV_DEVICE_CONFIG(_intrf) |
| 105 | 105 | |
| 106 | 106 | #define MDRV_WD1773_ADD(_tag, _intrf) \ |
| 107 | MDRV_DEVICE_ADD(_tag, WD1773) \ | |
| 107 | MDRV_DEVICE_ADD(_tag, WD1773, 0) \ | |
| 108 | 108 | MDRV_DEVICE_CONFIG(_intrf) |
| 109 | 109 | |
| 110 | 110 | #define MDRV_WD179X_ADD(_tag, _intrf) \ |
| 111 | MDRV_DEVICE_ADD(_tag, WD179X) \ | |
| 111 | MDRV_DEVICE_ADD(_tag, WD179X, 0) \ | |
| 112 | 112 | MDRV_DEVICE_CONFIG(_intrf) |
| 113 | 113 | |
| 114 | 114 | #define MDRV_WD1793_ADD(_tag, _intrf) \ |
| 115 | MDRV_DEVICE_ADD(_tag, WD1793) \ | |
| 115 | MDRV_DEVICE_ADD(_tag, WD1793, 0) \ | |
| 116 | 116 | MDRV_DEVICE_CONFIG(_intrf) |
| 117 | 117 | |
| 118 | 118 | #define MDRV_WD2793_ADD(_tag, _intrf) \ |
| 119 | MDRV_DEVICE_ADD(_tag, WD2793) \ | |
| 119 | MDRV_DEVICE_ADD(_tag, WD2793, 0) \ | |
| 120 | 120 | MDRV_DEVICE_CONFIG(_intrf) |
| 121 | 121 | |
| 122 | 122 | #define MDRV_WD177X_ADD(_tag, _intrf) \ |
| 123 | MDRV_DEVICE_ADD(_tag, WD177X) \ | |
| 123 | MDRV_DEVICE_ADD(_tag, WD177X, 0) \ | |
| 124 | 124 | MDRV_DEVICE_CONFIG(_intrf) |
| 125 | 125 | |
| 126 | 126 | #define MDRV_MB8877_ADD(_tag, _intrf) \ |
| 127 | MDRV_DEVICE_ADD(_tag, MB8877) \ | |
| 127 | MDRV_DEVICE_ADD(_tag, MB8877, 0) \ | |
| 128 | 128 | MDRV_DEVICE_CONFIG(_intrf) |
| 129 | 129 | |
| 130 | 130 |
| r3957 | r3958 | |
|---|---|---|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | void the_voice_lrq_callback(int state) { | |
| 40 | void the_voice_lrq_callback(const device_config *device, int state) { | |
| 41 | 41 | the_voice_lrq_state = state; |
| 42 | 42 | } |
| 43 | 43 |
| r3957 | r3958 | |
|---|---|---|
| 384 | 384 | |
| 385 | 385 | wd17xx_set_side(fdc, data & 0x02 ? 1:0); |
| 386 | 386 | |
| 387 | image = image_from_devtype_and_index(IO_FLOPPY, svi318_fdc.driveselect); | |
| 387 | image = image_from_devtype_and_index(space->machine, IO_FLOPPY, svi318_fdc.driveselect); | |
| 388 | 388 | if (image_exists(image)) |
| 389 | 389 | { |
| 390 | 390 | UINT8 sectors; |
| r3957 | r3958 | |
| 566 | 566 | UINT8 *table = auto_malloc (0x100); |
| 567 | 567 | const UINT8 *old_table; |
| 568 | 568 | |
| 569 | old_table = c | |
| 569 | old_table = device | |
| 570 | 570 | memcpy (table, old_table, 0x100); |
| 571 | 571 | |
| 572 | 572 | if (z80_cycle_table[i] == Z80_TABLE_ex) |
| r3957 | r3958 | |
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | c | |
| 590 | device | |
| 591 | 591 | } |
| 592 | 592 | } |
| 593 | 593 |
| r3957 | r3958 | |
|---|---|---|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /* This is called whenever the T0 pin switches state */ |
| 219 | int gamepock_io_callback( int ioline, int state ) | |
| 219 | int gamepock_io_callback( const device_config *device, int ioline, int state ) | |
| 220 | 220 | { |
| 221 | 221 | if ( ioline == UPD7810_TO ) |
| 222 | 222 | { |
| r3957 | r3958 | |
|---|---|---|
| 374 | 374 | |
| 375 | 375 | static const device_config *laser_file(void) |
| 376 | 376 | { |
| 377 | return image_from_devtype_and_index(IO_FLOPPY, laser_drive); | |
| 377 | return image_from_devtype_and_index(machine, IO_FLOPPY, laser_drive); | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | static void laser_get_track(void) |
| r3957 | r3958 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | static void wswan_machine_stop( running_machine *machine ) { |
| 201 | 201 | if ( eeprom.size ) { |
| 202 | image_battery_save( image_from_devtype_and_index(IO_CARTSLOT,0), eeprom.data, eeprom.size ); | |
| 202 | image_battery_save( image_from_devtype_and_index(machine, IO_CARTSLOT,0), eeprom.data, eeprom.size ); | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 |
| r3957 | r3958 | |
|---|---|---|
| 164 | 164 | if (!fdc->intf->get_image) |
| 165 | 165 | { |
| 166 | 166 | if (fdc->drive < device_count(device->machine, IO_FLOPPY)) |
| 167 | image = image_from_devtype_and_index(IO_FLOPPY, fdc->drive); | |
| 167 | image = image_from_devtype_and_index(device->machine, IO_FLOPPY, fdc->drive); | |
| 168 | 168 | } |
| 169 | 169 | else |
| 170 | 170 | { |
| r3957 | r3958 | |
| 2177 | 2177 | a_drive_is_ready = 0; |
| 2178 | 2178 | for (i = 0; i < device_count(device->machine, IO_FLOPPY); i++) |
| 2179 | 2179 | { |
| 2180 | if (image_exists(image_from_devtype_and_index(IO_FLOPPY, i))) | |
| 2180 | if (image_exists(image_from_devtype_and_index(device->machine, IO_FLOPPY, i))) | |
| 2181 | 2181 | { |
| 2182 | 2182 | a_drive_is_ready = 1; |
| 2183 | 2183 | break; |
| r3957 | r3958 | |
| 2297 | 2297 | int i; |
| 2298 | 2298 | |
| 2299 | 2299 | for (i = 0; i < device_count(device->machine, IO_FLOPPY); i++) { |
| 2300 | const device_config *img = image_from_devtype_and_index(IO_FLOPPY, i); | |
| 2300 | const device_config *img = image_from_devtype_and_index(device->machine, IO_FLOPPY, i); | |
| 2301 | 2301 | floppy_drive_set_controller(img, device); |
| 2302 | 2302 | floppy_drive_set_ready_state_change_callback(img, nec765_set_ready_change_callback); |
| 2303 | 2303 | } |
| r3957 | r3958 | |
| 2329 | 2329 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(nec765); break; |
| 2330 | 2330 | |
| 2331 | 2331 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2332 | case DEVINFO_STR_NAME: info->s = "NEC765A"; break; | |
| 2333 | case DEVINFO_STR_FAMILY: info->s = "NEC765A"; break; | |
| 2334 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 2335 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 2336 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 2332 | case DEVINFO_STR_NAME: strcpy(info->s, "NEC765A"); break; | |
| 2333 | case DEVINFO_STR_FAMILY: strcpy(info->s, "NEC765A"); break; | |
| 2334 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 2335 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 2336 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 2337 | 2337 | } |
| 2338 | 2338 | } |
| 2339 | 2339 | |
| r3957 | r3958 | |
| 2343 | 2343 | switch (state) |
| 2344 | 2344 | { |
| 2345 | 2345 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2346 | case DEVINFO_STR_NAME: info->s | |
| 2346 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 2347 | 2347 | |
| 2348 | 2348 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2349 | 2349 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(nec765b); break; |
| r3957 | r3958 | |
| 2357 | 2357 | switch (state) |
| 2358 | 2358 | { |
| 2359 | 2359 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2360 | case DEVINFO_STR_NAME: info->s | |
| 2360 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 2361 | 2361 | |
| 2362 | 2362 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2363 | 2363 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(smc37c78); break; |
| r3957 | r3958 | |
| 2371 | 2371 | switch (state) |
| 2372 | 2372 | { |
| 2373 | 2373 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2374 | case DEVINFO_STR_NAME: info->s | |
| 2374 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 2375 | 2375 | |
| 2376 | 2376 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2377 | 2377 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(nec72065); break; |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 40 | 40 | |
| 41 | 41 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 42 | case DEVINFO_STR_NAME: info->s = "Luxor ABC-99"; break; | |
| 43 | case DEVINFO_STR_FAMILY: info->s = "Luxor ABC"; break; | |
| 44 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 45 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 46 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 42 | case DEVINFO_STR_NAME: strcpy(info->s, "Luxor ABC-99"); break; | |
| 43 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Luxor ABC"); break; | |
| 44 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 45 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 46 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 47 | 47 | } |
| 48 | 48 | } |
| r3957 | r3958 | |
|---|---|---|
| 120 | 120 | ***************************************************************************/ |
| 121 | 121 | |
| 122 | 122 | #define MDRV_NEC765A_ADD(_tag, _intrf) \ |
| 123 | MDRV_DEVICE_ADD(_tag, NEC765A) \ | |
| 123 | MDRV_DEVICE_ADD(_tag, NEC765A, 0) \ | |
| 124 | 124 | MDRV_DEVICE_CONFIG(_intrf) |
| 125 | 125 | |
| 126 | 126 | #define MDRV_NEC765A_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
| 131 | 131 | MDRV_DEVICE_REMOVE(_tag, NEC765A) |
| 132 | 132 | |
| 133 | 133 | #define MDRV_NEC765B_ADD(_tag, _intrf) \ |
| 134 | MDRV_DEVICE_ADD(_tag, NEC765B) \ | |
| 134 | MDRV_DEVICE_ADD(_tag, NEC765B, 0) \ | |
| 135 | 135 | MDRV_DEVICE_CONFIG(_intrf) |
| 136 | 136 | |
| 137 | 137 | #define MDRV_NEC765B_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
| 142 | 142 | MDRV_DEVICE_REMOVE(_tag, NEC765B) |
| 143 | 143 | |
| 144 | 144 | #define MDRV_SMC37C78_ADD(_tag, _intrf) \ |
| 145 | MDRV_DEVICE_ADD(_tag, SMC37C78) \ | |
| 145 | MDRV_DEVICE_ADD(_tag, SMC37C78, 0) \ | |
| 146 | 146 | MDRV_DEVICE_CONFIG(_intrf) |
| 147 | 147 | |
| 148 | 148 | #define MDRV_SMC37C78_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
| 153 | 153 | MDRV_DEVICE_REMOVE(_tag, SMC37C78) |
| 154 | 154 | |
| 155 | 155 | #define MDRV_NEC72065_ADD(_tag, _intrf) \ |
| 156 | MDRV_DEVICE_ADD(_tag, NEC72065) \ | |
| 156 | MDRV_DEVICE_ADD(_tag, NEC72065, 0) \ | |
| 157 | 157 | MDRV_DEVICE_CONFIG(_intrf) |
| 158 | 158 | |
| 159 | 159 | #define MDRV_NEC72065_MODIFY(_tag, _intrf) \ |
| r3957 | r3958 | |
|---|---|---|
| 1737 | 1737 | apple2_init_common(machine); |
| 1738 | 1738 | |
| 1739 | 1739 | /* set up Apple IIgs vectoring */ |
| 1740 | c | |
| 1740 | device | |
| 1741 | 1741 | |
| 1742 | 1742 | /* setup globals */ |
| 1743 | 1743 | apple2gs_cur_slot6_image = NULL; |
| r3957 | r3958 | |
|---|---|---|
| 469 | 469 | case DEVINFO_FCT_IMAGE_CREATE: info->f = (genf *)DEVICE_IMAGE_CREATE_NAME(sasihd); break; |
| 470 | 470 | |
| 471 | 471 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 472 | case DEVINFO_STR_NAME: info->s = "SASI Hard Disk"; break; | |
| 473 | case DEVINFO_STR_FAMILY: info->s = "SASI Hard Disk Controller"; break; | |
| 474 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 475 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 476 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 477 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: info->s = "sasihd"; break; | |
| 478 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: info->s = "sasi"; break; | |
| 479 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "hdf"; break; | |
| 472 | case DEVINFO_STR_NAME: strcpy(info->s, "SASI Hard Disk"); break; | |
| 473 | case DEVINFO_STR_FAMILY: strcpy(info->s, "SASI Hard Disk Controller"); break; | |
| 474 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 475 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 476 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 477 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: strcpy(info->s, "sasihd"); break; | |
| 478 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: strcpy(info->s, "sasi"); break; | |
| 479 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "hdf"); break; | |
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 |
| r3957 | r3958 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | #define X68KHDC DEVICE_GET_INFO_NAME(x68k_hdc) |
| 113 | 113 | |
| 114 | #define MDRV_X68KHDC_ADD(_tag) \ | |
| 115 | MDRV_DEVICE_ADD(_tag, X68KHDC, 0) | |
| 116 | ||
| 114 | 117 | WRITE16_DEVICE_HANDLER( x68k_hdc_w ); |
| 115 | 118 | READ16_DEVICE_HANDLER( x68k_hdc_r ); |
| r3957 | r3958 | |
|---|---|---|
| 478 | 478 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(pcf8593); break; |
| 479 | 479 | |
| 480 | 480 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 481 | case DEVINFO_STR_NAME: info->s = "PCF8593 RTC"; break; | |
| 482 | case DEVINFO_STR_FAMILY: info->s = "PCF8593 RTC"; break; | |
| 483 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 484 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 481 | case DEVINFO_STR_NAME: strcpy(info->s, "PCF8593 RTC"); break; | |
| 482 | case DEVINFO_STR_FAMILY: strcpy(info->s, "PCF8593 RTC"); break; | |
| 483 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 484 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 485 | 485 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 486 | 486 | } |
| 487 | 487 | } |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | #define PCF8593 DEVICE_GET_INFO_NAME(pcf8593) |
| 20 | 20 | |
| 21 | 21 | #define MDRV_PCF8593_ADD(_tag) \ |
| 22 | MDRV_DEVICE_ADD(_tag, PCF8593) \ | |
| 22 | MDRV_DEVICE_ADD(_tag, PCF8593, 0) \ | |
| 23 | 23 | |
| 24 | 24 | #define MDRV_PCF8593_REMOVE(_tag) \ |
| 25 | 25 | MDRV_DEVICE_REMOVE(_tag, PCF8593) |
| r3957 | r3958 | |
|---|---|---|
| 190 | 190 | static const device_config *current_image(const device_config *device) |
| 191 | 191 | { |
| 192 | 192 | i8271_t *i8271 = get_safe_token(device); |
| 193 | return image_from_devtype_and_index(IO_FLOPPY, i8271->drive); | |
| 193 | return image_from_devtype_and_index(device->machine, IO_FLOPPY, i8271->drive); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| r3957 | r3958 | |
| 1074 | 1074 | status |= (1<<2) | (1<<6); |
| 1075 | 1075 | |
| 1076 | 1076 | /* these two do not appear to be set at all! ?? */ |
| 1077 | if (floppy_drive_get_flag_state(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_READY)) | |
| 1077 | if (floppy_drive_get_flag_state(image_from_devtype_and_index(img->machine, IO_FLOPPY, 0), FLOPPY_DRIVE_READY)) | |
| 1078 | 1078 | { |
| 1079 | 1079 | status |= (1<<2); |
| 1080 | 1080 | } |
| 1081 | 1081 | |
| 1082 | if (floppy_drive_get_flag_state(image_from_devtype_and_index(IO_FLOPPY, 1), FLOPPY_DRIVE_READY)) | |
| 1082 | if (floppy_drive_get_flag_state(image_from_devtype_and_index(img->machine, IO_FLOPPY, 1), FLOPPY_DRIVE_READY)) | |
| 1083 | 1083 | { |
| 1084 | 1084 | status |= (1<<6); |
| 1085 | 1085 | } |
| r3957 | r3958 | |
| 1613 | 1613 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(i8271); break; |
| 1614 | 1614 | |
| 1615 | 1615 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1616 | case DEVINFO_STR_NAME: info->s = "Intel 8271"; break; | |
| 1617 | case DEVINFO_STR_FAMILY: info->s = "Intel 8271"; break; | |
| 1618 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1619 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1620 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 1616 | case DEVINFO_STR_NAME: strcpy(info->s, "Intel 8271"); break; | |
| 1617 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Intel 8271"); break; | |
| 1618 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 1619 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1620 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 1621 | 1621 | } |
| 1622 | 1622 | } |
| 1623 | 1623 |
| r3957 | r3958 | |
|---|---|---|
| 45 | 45 | ***************************************************************************/ |
| 46 | 46 | |
| 47 | 47 | #define MDRV_I8271_ADD(_tag, _intrf) \ |
| 48 | MDRV_DEVICE_ADD(_tag, I8271) \ | |
| 48 | MDRV_DEVICE_ADD(_tag, I8271, 0) \ | |
| 49 | 49 | MDRV_DEVICE_CONFIG(_intrf) |
| 50 | 50 | |
| 51 | 51 | #endif /* I8271_H_ */ |
| r3957 | r3958 | |
|---|---|---|
| 63 | 63 | FUNCTIONS |
| 64 | 64 | ***************************************************************************/ |
| 65 | 65 | |
| 66 | static const device_config *cartslot_image( | |
| 66 | static const device_config *cartslot_image(running_machine *machine) | |
| 67 | 67 | { |
| 68 | return image_from_devtype_and_index(IO_CARTSLOT, 0); | |
| 68 | return image_from_devtype_and_index(machine, IO_CARTSLOT, 0); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static void init_nes_core (running_machine *machine) |
| r3957 | r3958 | |
| 197 | 197 | { |
| 198 | 198 | /* Write out the battery file if necessary */ |
| 199 | 199 | if (nes.battery) |
| 200 | image_battery_save(cartslot_image(), battery_ram, BATTERY_SIZE); | |
| 200 | image_battery_save(cartslot_image(machine), battery_ram, BATTERY_SIZE); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | #include "machine/tpi6525.h" |
| 18 | 18 | #include "devices/chd_cd.h" |
| 19 | 19 | #include "matsucd.h" |
| 20 | #include "deprecat.h" | |
| 21 | 20 | |
| 22 | 21 | |
| 23 | 22 | #define VERBOSE_DMAC 0 |
| r3957 | r3958 | |
| 385 | 384 | |
| 386 | 385 | ***************************************************************************/ |
| 387 | 386 | |
| 388 | static void dmac_install(offs_t base) | |
| 387 | static void dmac_install(running_machine *machine, offs_t base) | |
| 389 | 388 | { |
| 390 | const address_space *space = cpu_get_address_space( | |
| 389 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 391 | 390 | memory_install_read16_handler(space, base, base + 0xFFFF, 0, 0, amiga_dmac_r); |
| 392 | 391 | memory_install_write16_handler(space, base, base + 0xFFFF, 0, 0, amiga_dmac_w); |
| 393 | 392 | } |
| 394 | 393 | |
| 395 | static void dmac_uninstall(offs_t base) | |
| 394 | static void dmac_uninstall(running_machine *machine, offs_t base) | |
| 396 | 395 | { |
| 397 | const address_space *space = cpu_get_address_space( | |
| 396 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 398 | 397 | memory_install_read16_handler(space, base, base + 0xFFFF, 0, 0, SMH_UNMAP); |
| 399 | 398 | memory_install_write16_handler(space, base, base + 0xFFFF, 0, 0, SMH_UNMAP); |
| 400 | 399 | } |
| r3957 | r3958 | |
| 526 | 525 | tpi6525[0].cb.output = NULL; |
| 527 | 526 | |
| 528 | 527 | /* set up DMAC with autoconfig */ |
| 529 | amiga_add_autoconfig( &dmac_device ); | |
| 528 | amiga_add_autoconfig( machine, &dmac_device ); | |
| 530 | 529 | } |
| 531 | 530 | |
| 532 | 531 | MACHINE_RESET( amigacd ) |
| r3957 | r3958 | |
|---|---|---|
| 648 | 648 | current_drive = ((data >> LC_DE0_bit) & 1) | ((data >> (LC_DE1_bit-1)) & 2); |
| 649 | 649 | wd17xx_set_drive(fdc, current_drive); |
| 650 | 650 | /*motor_on = (data & LC_MOTOROF_mask) == 0;*/ |
| 651 | // floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, current_drive), (data & LC_MOTOROF_mask) == 0 ? 1 : 0); | |
| 651 | // floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, current_drive), (data & LC_MOTOROF_mask) == 0 ? 1 : 0); | |
| 652 | 652 | /*flp_8in = (data & LC_FLP8IN_mask) != 0;*/ |
| 653 | 653 | wd17xx_set_density(fdc, (data & LC_FMMFM_mask) ? DEN_FM_LO : DEN_MFM_LO); |
| 654 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, current_drive), 1, 0); | |
| 654 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, current_drive), 1, 0); | |
| 655 | 655 | break; |
| 656 | 656 | |
| 657 | 657 | case 8: |
| r3957 | r3958 | |
|---|---|---|
| 238 | 238 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(uPD7002); break; |
| 239 | 239 | |
| 240 | 240 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 241 | case DEVINFO_STR_NAME: info->s = "uPD7002"; break; | |
| 242 | case DEVINFO_STR_FAMILY: info->s = "uPD7002"; break; | |
| 243 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 244 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 245 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 241 | case DEVINFO_STR_NAME: strcpy(info->s, "uPD7002"); break; | |
| 242 | case DEVINFO_STR_FAMILY: strcpy(info->s, "uPD7002"); break; | |
| 243 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 244 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 245 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 246 | 246 | } |
| 247 | 247 | } |
| r3957 | r3958 | |
|---|---|---|
| 54 | 54 | ***************************************************************************/ |
| 55 | 55 | |
| 56 | 56 | #define MDRV_UPD7002_ADD(_tag, _intrf) \ |
| 57 | MDRV_DEVICE_ADD(_tag, UPD7002) \ | |
| 57 | MDRV_DEVICE_ADD(_tag, UPD7002, 0) \ | |
| 58 | 58 | MDRV_DEVICE_CONFIG(_intrf) |
| 59 | 59 | |
| 60 | 60 |
| r3957 | r3958 | |
|---|---|---|
| 362 | 362 | UINT8 *table = auto_malloc (0x100); |
| 363 | 363 | const UINT8 *old_table; |
| 364 | 364 | |
| 365 | old_table = c | |
| 365 | old_table = device | |
| 366 | 366 | CPUINFO_PTR_Z80_CYCLE_TABLE + z80_cycle_table[i]); |
| 367 | 367 | memcpy (table, old_table, 0x100); |
| 368 | 368 | |
| r3957 | r3958 | |
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | c | |
| 383 | device | |
| 384 | 384 | CPUINFO_PTR_Z80_CYCLE_TABLE + z80_cycle_table[i], |
| 385 | 385 | (void*)table); |
| 386 | 386 | } |
| r3957 | r3958 | |
| 390 | 390 | { |
| 391 | 391 | v9938_set_sprite_limit(0, input_port_read(device->machine, "DSW") & 0x20); |
| 392 | 392 | v9938_set_resolution(0, input_port_read(device->machine, "DSW") & 0x03); |
| 393 | v9938_interrupt(0); | |
| 393 | v9938_interrupt(device->machine, 0); | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | INTERRUPT_GEN( msx_interrupt ) |
| r3957 | r3958 | |
|---|---|---|
| 144 | 144 | adc080x->intf = device->static_config; |
| 145 | 145 | |
| 146 | 146 | assert(adc080x->intf != NULL); |
| 147 | assert( | |
| 147 | assert( | |
| 148 | 148 | |
| 149 | 149 | /* set initial values */ |
| 150 | 150 | adc080x->eoc = 1; |
| 151 | 151 | |
| 152 | 152 | /* allocate cycle timer */ |
| 153 | 153 | adc080x->cycle_timer = timer_alloc(device->machine, cycle_tick, (void *)device); |
| 154 | timer_adjust_periodic(adc080x->cycle_timer, attotime_zero, 0, ATTOTIME_IN_HZ( | |
| 154 | timer_adjust_periodic(adc080x->cycle_timer, attotime_zero, 0, ATTOTIME_IN_HZ( | |
| 155 | 155 | |
| 156 | 156 | /* register for state saving */ |
| 157 | 157 | state_save_register_item(device->machine, "adc080x", device->tag, 0, adc080x->address); |
| r3957 | r3958 | |
| 189 | 189 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 190 | 190 | |
| 191 | 191 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 192 | case DEVINFO_STR_NAME: info->s = "National Semiconductor ADC0808"; break; | |
| 193 | case DEVINFO_STR_FAMILY: info->s = "National Semiconductor ADC080"; break; | |
| 194 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 195 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 196 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 192 | case DEVINFO_STR_NAME: strcpy(info->s, "National Semiconductor ADC0808"); break; | |
| 193 | case DEVINFO_STR_FAMILY: strcpy(info->s, "National Semiconductor ADC080"); break; | |
| 194 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 195 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 196 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
| r3957 | r3958 | |
| 202 | 202 | switch (state) |
| 203 | 203 | { |
| 204 | 204 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 205 | case DEVINFO_STR_NAME: info->s | |
| 205 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 206 | 206 | |
| 207 | 207 | default: DEVICE_GET_INFO_CALL(adc0808); break; |
| 208 | 208 | } |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | #define ADC0808 DEVICE_GET_INFO_NAME(adc0808) |
| 43 | 43 | #define ADC0809 DEVICE_GET_INFO_NAME(adc0809) |
| 44 | 44 | |
| 45 | #define MDRV_ADC0808_ADD(_tag, _intrf) \ | |
| 46 | MDRV_DEVICE_ADD(_tag, ADC0808) \ | |
| 45 | #define MDRV_ADC0808_ADD(_tag, _clock, _intrf) \ | |
| 46 | MDRV_DEVICE_ADD(_tag, ADC0808, _clock) \ | |
| 47 | 47 | MDRV_DEVICE_CONFIG(_intrf) |
| 48 | 48 | |
| 49 | 49 | #define MDRV_ADC0808_REMOVE(_tag) \ |
| 50 | 50 | MDRV_DEVICE_REMOVE(_tag, ADC0808) |
| 51 | 51 | |
| 52 | #define MDRV_ADC0809_ADD(_tag, _intrf) \ | |
| 53 | MDRV_DEVICE_ADD(_tag, ADC0809) \ | |
| 52 | #define MDRV_ADC0809_ADD(_tag, _clock, _intrf) \ | |
| 53 | MDRV_DEVICE_ADD(_tag, ADC0809, _clock) \ | |
| 54 | 54 | MDRV_DEVICE_CONFIG(_intrf) |
| 55 | 55 | |
| 56 | 56 | #define MDRV_ADC0809_REMOVE(_tag) \ |
| r3957 | r3958 | |
| 61 | 61 | typedef struct _adc080x_interface adc080x_interface; |
| 62 | 62 | struct _adc080x_interface |
| 63 | 63 | { |
| 64 | int clock; /* the clock (pin 10) of the chip */ | |
| 65 | ||
| 66 | 64 | /* this gets called for every change of the EOC pin (pin 7) */ |
| 67 | 65 | adc080x_on_eoc_changed_func on_eoc_changed; |
| 68 | 66 |
| r3957 | r3958 | |
|---|---|---|
| 1141 | 1141 | memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), lisa_OPbaseoverride); |
| 1142 | 1142 | memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[1],ADDRESS_SPACE_PROGRAM), lisa_fdc_OPbaseoverride); |
| 1143 | 1143 | |
| 1144 | c | |
| 1144 | device | |
| 1145 | 1145 | |
| 1146 | 1146 | /* init MMU */ |
| 1147 | 1147 |
| r3957 | r3958 | |
|---|---|---|
| 294 | 294 | memory_install_readwrite8_handler(cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ), |
| 295 | 295 | 0xf800, 0xffff, 0, 0, SMH_BANK1, SMH_NOP); |
| 296 | 296 | memory_set_bankptr(machine, 1, sym1_monitor + 0x800); |
| 297 | c | |
| 297 | device | |
| 298 | 298 | } |
| r3957 | r3958 | |
|---|---|---|
| 276 | 276 | INTERRUPT_GEN( geneve_hblank_interrupt ) |
| 277 | 277 | { |
| 278 | 278 | static int line_count; |
| 279 | v9938_interrupt(0); | |
| 279 | v9938_interrupt(device->machine, 0); | |
| 280 | 280 | if (++line_count == 262) |
| 281 | 281 | { |
| 282 | 282 | line_count = 0; |
| r3957 | r3958 | |
|---|---|---|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /* hack to compensate for weird issue (maybe the Pentium core needs to support caching? */ |
| 202 | if ((cpu_get_reg(machine->cpu[0], REG_PC) == 0xFCB01) && !strcmp(machine->gamedrv->name, "at586")) | |
| 202 | if ((cpu_get_reg(machine->cpu[0], REG_GENPC) == 0xFCB01) && !strcmp(machine->gamedrv->name, "at586")) | |
| 203 | 203 | { |
| 204 | 204 | memory_region(machine, "user1")[0x3CB01] = 0xF3; |
| 205 | 205 | memory_region(machine, "user1")[0x3CB02] = 0xA4; |
| r3957 | r3958 | |
|---|---|---|
| 267 | 267 | /* Set registers */ |
| 268 | 268 | lo = data[0x14112] & 0x0ff; |
| 269 | 269 | hi = data[0x14111] & 0x0ff; |
| 270 | cpu_set_reg(machine->cpu[0], I808 | |
| 270 | cpu_set_reg(machine->cpu[0], I8085_BC, (hi << 8) | lo); | |
| 271 | 271 | lo = data[0x14114] & 0x0ff; |
| 272 | 272 | hi = data[0x14113] & 0x0ff; |
| 273 | cpu_set_reg(machine->cpu[0], I808 | |
| 273 | cpu_set_reg(machine->cpu[0], I8085_DE, (hi << 8) | lo); | |
| 274 | 274 | lo = data[0x14116] & 0x0ff; |
| 275 | 275 | hi = data[0x14115] & 0x0ff; |
| 276 | cpu_set_reg(machine->cpu[0], I808 | |
| 276 | cpu_set_reg(machine->cpu[0], I8085_HL, (hi << 8) | lo); | |
| 277 | 277 | lo = data[0x14118] & 0x0ff; |
| 278 | 278 | hi = data[0x14117] & 0x0ff; |
| 279 | cpu_set_reg(machine->cpu[0], I808 | |
| 279 | cpu_set_reg(machine->cpu[0], I8085_AF, (hi << 8) | lo); | |
| 280 | 280 | lo = data[0x14119] & 0x0ff; |
| 281 | 281 | hi = data[0x1411a] & 0x0ff; |
| 282 | cpu_set_reg(machine->cpu[0], I808 | |
| 282 | cpu_set_reg(machine->cpu[0], I8085_SP, (hi << 8) | lo); | |
| 283 | 283 | lo = data[0x1411b] & 0x0ff; |
| 284 | 284 | hi = data[0x1411c] & 0x0ff; |
| 285 | cpu_set_reg(machine->cpu[0], I808 | |
| 285 | cpu_set_reg(machine->cpu[0], I8085_PC, (hi << 8) | lo); | |
| 286 | 286 | |
| 287 | 287 | /* Memory dump */ |
| 288 | 288 | memcpy (mess_ram, data+0x0011, 0xc000); |
| r3957 | r3958 | |
| 298 | 298 | |
| 299 | 299 | static void dump_registers(running_machine *machine) |
| 300 | 300 | { |
| 301 | logerror("PC = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8080_PC)); | |
| 302 | logerror("SP = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8080_SP)); | |
| 303 | logerror("AF = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8080_AF)); | |
| 304 | logerror("BC = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8080_BC)); | |
| 305 | logerror("DE = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8080_DE)); | |
| 306 | logerror("HL = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8080_HL)); | |
| 301 | logerror("PC = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8085_PC)); | |
| 302 | logerror("SP = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8085_SP)); | |
| 303 | logerror("AF = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8085_AF)); | |
| 304 | logerror("BC = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8085_BC)); | |
| 305 | logerror("DE = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8085_DE)); | |
| 306 | logerror("HL = %04x\n", (unsigned) cpu_get_reg(machine->cpu[0], I8085_HL)); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | static int lviv_verify_snapshot (UINT8 * data, UINT32 size) |
| r3957 | r3958 | |
|---|---|---|
| 828 | 828 | else |
| 829 | 829 | cpu_resume(machine->cpu[1], SUSPEND_REASON_DISABLE); |
| 830 | 830 | cpu_set_input_line_vector(machine->cpu[1],0,0); |
| 831 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1); | |
| 832 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 1), 1); | |
| 833 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1,0); | |
| 834 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 1), 1,0); | |
| 831 | floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 0), 1); | |
| 832 | floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 1), 1); | |
| 833 | floppy_drive_set_ready_state(image_from_devtype_and_index(machine, IO_FLOPPY, 0), 1,0); | |
| 834 | floppy_drive_set_ready_state(image_from_devtype_and_index(machine, IO_FLOPPY, 1), 1,0); | |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | /* |
| r3957 | r3958 | |
|---|---|---|
| 618 | 618 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 619 | 619 | |
| 620 | 620 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 621 | case DEVINFO_STR_NAME: info->s = "MOS Technology 6551 ACIA"; break; | |
| 622 | case DEVINFO_STR_FAMILY: info->s = "MOS Technology 6551 ACIA"; break; | |
| 623 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 624 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 621 | case DEVINFO_STR_NAME: strcpy(info->s, "MOS Technology 6551 ACIA"); break; | |
| 622 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MOS Technology 6551 ACIA"); break; | |
| 623 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 624 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 625 | 625 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 626 | 626 | } |
| 627 | 627 | } |
| r3957 | r3958 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | |
| 318 | 318 | /* set new pc address */ |
| 319 | cpu_set_reg( image->machine->cpu[0], REG_PC, exec); | |
| 319 | cpu_set_reg( image->machine->cpu[0], REG_GENPC, exec); | |
| 320 | 320 | |
| 321 | 321 | /* free the data */ |
| 322 | 322 | free(quickload_data); |
| r3957 | r3958 | |
|---|---|---|
| 767 | 767 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( ay31015 ); break; |
| 768 | 768 | |
| 769 | 769 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 770 | case DEVINFO_STR_NAME: info->s = "AY-3-1015"; break; | |
| 771 | case DEVINFO_STR_FAMILY: info->s = "AY-3-1015/AY-5-1013 UARTs"; break; | |
| 772 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 773 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 774 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 770 | case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-1015"); break; | |
| 771 | case DEVINFO_STR_FAMILY: strcpy(info->s, "AY-3-1015/AY-5-1013 UARTs"); break; | |
| 772 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 773 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 774 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 775 | 775 | } |
| 776 | 776 | } |
| 777 | 777 |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | #define ACIA6551 DEVICE_GET_INFO_NAME(acia6551) |
| 18 | 18 | |
| 19 | 19 | #define MDRV_ACIA6551_ADD(_tag) \ |
| 20 | MDRV_DEVICE_ADD((_tag), ACIA6551) | |
| 20 | MDRV_DEVICE_ADD((_tag), ACIA6551, 0) | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | ***************************************************************************/ |
| 67 | 67 | |
| 68 | 68 | #define MDRV_AY31015_ADD(_tag, _config) \ |
| 69 | MDRV_DEVICE_ADD(_tag, AY31015) \ | |
| 69 | MDRV_DEVICE_ADD(_tag, AY31015, 0) \ | |
| 70 | 70 | MDRV_DEVICE_CONFIG(_config) |
| 71 | 71 | |
| 72 | 72 | #define MDRV_AY31015_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 396 | 396 | const dma8257_interface partner_dma = |
| 397 | 397 | { |
| 398 | 398 | 0, |
| 399 | XTAL_16MHz / 9, | |
| 400 | 399 | |
| 401 | 400 | radio86_dma_read_byte, |
| 402 | 401 | partner_dma_write_byte, |
| r3957 | r3958 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | for (i = 0; i < device_count(machine, IO_FLOPPY); i++) |
| 122 | 122 | { |
| 123 | img = image_from_devtype_and_index(IO_FLOPPY, i); | |
| 123 | img = image_from_devtype_and_index(machine, IO_FLOPPY, i); | |
| 124 | 124 | floppy_drive_set_geometry(img, FLOPPY_DRIVE_DS_80); |
| 125 | 125 | } |
| 126 | 126 | } |
| r3957 | r3958 | |
| 134 | 134 | if (!fdc->fdc_interface.get_image) |
| 135 | 135 | { |
| 136 | 136 | if (floppy_index < device_count(device->machine, IO_FLOPPY)) |
| 137 | image = image_from_devtype_and_index(IO_FLOPPY, floppy_index); | |
| 137 | image = image_from_devtype_and_index(device->machine, IO_FLOPPY, floppy_index); | |
| 138 | 138 | } |
| 139 | 139 | else |
| 140 | 140 | { |
| 141 | image = fdc->fdc_interface.get_image(floppy_index); | |
| 141 | image = fdc->fdc_interface.get_image(device->machine, floppy_index); | |
| 142 | 142 | } |
| 143 | 143 | return image; |
| 144 | 144 | } |
| r3957 | r3958 | |
| 259 | 259 | floppy_count = device_count(machine, IO_FLOPPY); |
| 260 | 260 | |
| 261 | 261 | if (floppy_count > (fdc->digital_output_register & 0x03)) |
| 262 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, fdc->digital_output_register & 0x03), 1, 0); | |
| 262 | floppy_drive_set_ready_state(image_from_devtype_and_index(machine, IO_FLOPPY, fdc->digital_output_register & 0x03), 1, 0); | |
| 263 | 263 | |
| 264 | 264 | fdc->digital_output_register = data; |
| 265 | 265 | |
| r3957 | r3958 | |
| 267 | 267 | |
| 268 | 268 | /* set floppy drive motor state */ |
| 269 | 269 | if (floppy_count > 0) |
| 270 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), (data>>4) & 0x0f); | |
| 270 | floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 0), (data>>4) & 0x0f); | |
| 271 | 271 | if (floppy_count > 1) |
| 272 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 1), (data>>5) & 0x01); | |
| 272 | floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 1), (data>>5) & 0x01); | |
| 273 | 273 | if (floppy_count > 2) |
| 274 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 2), (data>>6) & 0x01); | |
| 274 | floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 2), (data>>6) & 0x01); | |
| 275 | 275 | if (floppy_count > 3) |
| 276 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 3), (data>>7) & 0x01); | |
| 276 | floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 3), (data>>7) & 0x01); | |
| 277 | 277 | |
| 278 | 278 | if ((data>>4) & (1<<selected_drive)) |
| 279 | 279 | { |
| 280 | 280 | if (floppy_count > selected_drive) |
| 281 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, selected_drive), 1, 0); | |
| 281 | floppy_drive_set_ready_state(image_from_devtype_and_index(machine, IO_FLOPPY, selected_drive), 1, 0); | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /* changing the DMA enable bit, will affect the terminal count state |
| r3957 | r3958 | |
| 364 | 364 | |
| 365 | 365 | /* set floppy drive motor state */ |
| 366 | 366 | if (floppy_count > 0) |
| 367 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), data & 0x01); | |
| 367 | floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 0), data & 0x01); | |
| 368 | 368 | |
| 369 | 369 | if ( data & 0x01 ) |
| 370 | 370 | { |
| 371 | 371 | if ( floppy_count ) |
| 372 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0); | |
| 372 | floppy_drive_set_ready_state(image_from_devtype_and_index(machine, IO_FLOPPY, 0), 1, 0); | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | /* Is the watchdog timer disabled */ |
| r3957 | r3958 | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | if (LOG_FDC) |
| 456 | logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) cpu_get_reg(space->machine->cpu[0],REG_PC), offset, data); | |
| 456 | logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) cpu_get_reg(space->machine->cpu[0],REG_GENPC), offset, data); | |
| 457 | 457 | return data; |
| 458 | 458 | } |
| 459 | 459 | |
| r3957 | r3958 | |
| 462 | 462 | WRITE8_HANDLER ( pc_fdc_w ) |
| 463 | 463 | { |
| 464 | 464 | if (LOG_FDC) |
| 465 | logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) cpu_get_reg(space->machine->cpu[0],REG_PC), offset, data); | |
| 465 | logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) cpu_get_reg(space->machine->cpu[0],REG_GENPC), offset, data); | |
| 466 | 466 | |
| 467 | 467 | switch(offset) |
| 468 | 468 | { |
| r3957 | r3958 | |
| 501 | 501 | WRITE8_HANDLER ( pcjr_fdc_w ) |
| 502 | 502 | { |
| 503 | 503 | if (LOG_FDC) |
| 504 | logerror("pcjr_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) cpu_get_reg(space->machine->cpu[0],REG_PC), offset, data); | |
| 504 | logerror("pcjr_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) cpu_get_reg(space->machine->cpu[0],REG_GENPC), offset, data); | |
| 505 | 505 | |
| 506 | 506 | switch(offset) |
| 507 | 507 | { |
| r3957 | r3958 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | clock interrupt callback |
| 90 | 90 | */ |
| 91 | static void clk_interrupt_callback(int state) | |
| 91 | static void clk_interrupt_callback(running_machine *machine, int state) | |
| 92 | 92 | { |
| 93 | 93 | clk_irq = state; |
| 94 | ti99_peb_set_ila_bit( | |
| 94 | ti99_peb_set_ila_bit(machine, inta_ide_clk_bit, state); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /* |
| r3957 | r3958 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | void (*pc_fdc_interrupt)(running_machine*,int); |
| 30 | 30 | void (*pc_fdc_dma_drq)(running_machine*,int,int); |
| 31 | const device_config *(*get_image)(int floppy_index); | |
| 31 | const device_config *(*get_image)(running_machine*, int floppy_index); | |
| 32 | 32 | device_config *(*get_device)(running_machine*); |
| 33 | 33 | }; |
| 34 | 34 |
| r3957 | r3958 | |
|---|---|---|
| 859 | 859 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc6843); break; |
| 860 | 860 | |
| 861 | 861 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 862 | case DEVINFO_STR_NAME: info->s = "Motorola MC6843 floppy controller"; break; | |
| 863 | case DEVINFO_STR_FAMILY: info->s = "MC6843"; break; | |
| 864 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 865 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 866 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MAME and MESS Teams"; break; | |
| 862 | case DEVINFO_STR_NAME: strcpy(info->s, "Motorola MC6843 floppy controller"); break; | |
| 863 | case DEVINFO_STR_FAMILY: strcpy(info->s, "MC6843"); break; | |
| 864 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 865 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 866 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break; | |
| 867 | 867 | } |
| 868 | 868 | } |
| r3957 | r3958 | |
|---|---|---|
| 544 | 544 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mm58274c); break; |
| 545 | 545 | |
| 546 | 546 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 547 | case DEVINFO_STR_NAME: info->s = "National Semiconductor MM58274C";break; | |
| 548 | case DEVINFO_STR_FAMILY: info->s = "National Semiconductor MM58274C";break; | |
| 549 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 550 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 551 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 547 | case DEVINFO_STR_NAME: strcpy(info->s, "National Semiconductor MM58274C");break; | |
| 548 | case DEVINFO_STR_FAMILY: strcpy(info->s, "National Semiconductor MM58274C");break; | |
| 549 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 550 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 551 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 552 | 552 | } |
| 553 | 553 | } |
| r3957 | r3958 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | #define MDRV_MC6843_ADD(_tag, _intrf) \ |
| 25 | MDRV_DEVICE_ADD(_tag, MC6843) \ | |
| 25 | MDRV_DEVICE_ADD(_tag, MC6843, 0) \ | |
| 26 | 26 | MDRV_DEVICE_CONFIG(_intrf) |
| 27 | 27 | |
| 28 | 28 | #define MDRV_MC6843_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #define MDRV_MM58274C_ADD(_tag, _intrf) \ |
| 39 | MDRV_DEVICE_ADD(_tag, MM58274C) \ | |
| 39 | MDRV_DEVICE_ADD(_tag, MM58274C, 0) \ | |
| 40 | 40 | MDRV_DEVICE_CONFIG(_intrf) |
| 41 | 41 | |
| 42 | 42 | #endif /* MM58274C_H */ |
| r3957 | r3958 | |
|---|---|---|
| 323 | 323 | assert_always((interrupt_bit < ARRAY_LENGTH(interrupt_names)) && (interrupt_names[interrupt_bit] != NULL), "Raising invalid interrupt"); |
| 324 | 324 | |
| 325 | 325 | logerror("bebox_set_irq_bit(): pc[0]=0x%08x pc[1]=0x%08x %s interrupt #%u (%s)\n", |
| 326 | (unsigned) cpu_get_reg( machine->cpu[0], REG_PC), | |
| 327 | (unsigned) cpu_get_reg( machine->cpu[1], REG_PC), | |
| 326 | (unsigned) cpu_get_reg( machine->cpu[0], REG_GENPC), | |
| 327 | (unsigned) cpu_get_reg( machine->cpu[1], REG_GENPC), | |
| 328 | 328 | val ? "Asserting" : "Clearing", |
| 329 | 329 | interrupt_bit, interrupt_names[interrupt_bit]); |
| 330 | 330 | } |
| r3957 | r3958 | |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | |
| 426 | static const device_config *bebox_fdc_get_image(int floppy_index) | |
| 426 | static const device_config *bebox_fdc_get_image(running_machine *machine, int floppy_index) | |
| 427 | 427 | { |
| 428 | 428 | /* the BeBox boot ROM seems to query for floppy #1 when it should be |
| 429 | 429 | * querying for floppy #0 */ |
| 430 | return image_from_devtype_and_index(IO_FLOPPY, 0); | |
| 430 | return image_from_devtype_and_index(machine, IO_FLOPPY, 0); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | static device_config * bebox_get_device(running_machine *machine ) |
| r3957 | r3958 | |
| 953 | 953 | ((x << 8) & 0xff0000) | \ |
| 954 | 954 | ((x << 24) & 0xff000000)) |
| 955 | 955 | |
| 956 | static UINT32 scsi53c810_fetch(UINT32 dsp) | |
| 956 | static UINT32 scsi53c810_fetch(running_machine *machine, UINT32 dsp) | |
| 957 | 957 | { |
| 958 | 958 | UINT32 result; |
| 959 | result = memory_read_dword_64be( cpu_get_address_space( | |
| 959 | result = memory_read_dword_64be( cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ), dsp & 0x7FFFFFFF); | |
| 960 | 960 | return BYTE_REVERSE32(result); |
| 961 | 961 | } |
| 962 | 962 | |
| r3957 | r3958 | |
| 967 | 967 | } |
| 968 | 968 | |
| 969 | 969 | |
| 970 | static void scsi53c810_dma_callback(UINT32 src, UINT32 dst, int length, int byteswap) | |
| 970 | static void scsi53c810_dma_callback(running_machine *machine, UINT32 src, UINT32 dst, int length, int byteswap) | |
| 971 | 971 | { |
| 972 | 972 | } |
| 973 | 973 | |
| r3957 | r3958 | |
| 1022 | 1022 | /* brutal ugly hack; at some point the PCI code should be handling this stuff */ |
| 1023 | 1023 | if (scsi53c810_data[5] != 0xFFFFFFF0) |
| 1024 | 1024 | { |
| 1025 | const address_space *space = cpu_get_address_space( | |
| 1025 | const address_space *space = cpu_get_address_space( device->machine->cpu[0], ADDRESS_SPACE_PROGRAM ); | |
| 1026 | 1026 | |
| 1027 | 1027 | addr = (scsi53c810_data[5] | 0xC0000000) & ~0xFF; |
| 1028 | 1028 | memory_install_read64_handler(space, addr, addr + 0xFF, 0, 0, scsi53c810_r); |
| r3957 | r3958 | |
| 1094 | 1094 | { |
| 1095 | 1095 | pc_fdc_init(machine, &bebox_fdc_interface); |
| 1096 | 1096 | /* SCSI */ |
| 1097 | lsi53c810_init(&scsi53c810_intf); | |
| 1097 | lsi53c810_init(machine, &scsi53c810_intf); | |
| 1098 | 1098 | add_exit_callback(machine, bebox_exit); |
| 1099 | 1099 | } |
| 1100 | 1100 |
| r3957 | r3958 | |
|---|---|---|
| 240 | 240 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 241 | 241 | |
| 242 | 242 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 243 | case DEVINFO_STR_NAME: info->s = "E05-16"; break; | |
| 244 | case DEVINFO_STR_FAMILY: info->s = "E05-16"; break; | |
| 245 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 246 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 247 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 243 | case DEVINFO_STR_NAME: strcpy(info->s, "E05-16"); break; | |
| 244 | case DEVINFO_STR_FAMILY: strcpy(info->s, "E05-16"); break; | |
| 245 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 246 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 247 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 248 | 248 | } |
| 249 | 249 | } |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | #define E0516 DEVICE_GET_INFO_NAME(e0516) |
| 5 | 5 | |
| 6 | 6 | #define MDRV_E0516_ADD(_tag, _config) \ |
| 7 | MDRV_DEVICE_ADD(_tag, E0516) \ | |
| 7 | MDRV_DEVICE_ADD(_tag, E0516, 0) \ | |
| 8 | 8 | MDRV_DEVICE_CONFIG(_config) |
| 9 | 9 | |
| 10 | 10 | /* interface */ |
| r3957 | r3958 | |
|---|---|---|
| 228 | 228 | |
| 229 | 229 | const z80ctc_interface mtx_ctc_intf = |
| 230 | 230 | { |
| 231 | "main", | |
| 232 | MTX_SYSTEM_CLOCK, | |
| 233 | 231 | 0, |
| 234 | 232 | mtx_ctc_interrupt, |
| 235 | 233 | 0, |
| r3957 | r3958 | |
|---|---|---|
| 293 | 293 | MDRV_CPU_IO_MAP(abc77_io_map, 0) |
| 294 | 294 | |
| 295 | 295 | /* watchdog */ |
| 296 | MDRV_WATCHDOG_TIME_INIT( | |
| 296 | MDRV_WATCHDOG_TIME_INIT( | |
| 297 | 297 | |
| 298 | 298 | /* serial clock timer */ |
| 299 | 299 | MDRV_TIMER_ADD_PERIODIC("serial", clock_tick, HZ(XTAL_4_608MHz/(3*5)/16)) |
| r3957 | r3958 | |
| 378 | 378 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 379 | 379 | |
| 380 | 380 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 381 | case DEVINFO_STR_NAME: info->s = "Luxor ABC-77"; break; | |
| 382 | case DEVINFO_STR_FAMILY: info->s = "Luxor ABC"; break; | |
| 383 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 384 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 385 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 381 | case DEVINFO_STR_NAME: strcpy(info->s, "Luxor ABC-77"); break; | |
| 382 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Luxor ABC"); break; | |
| 383 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 384 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 385 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 386 | 386 | } |
| 387 | 387 | } |
| r3957 | r3958 | |
|---|---|---|
| 633 | 633 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ins8250); break; |
| 634 | 634 | |
| 635 | 635 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 636 | case DEVINFO_STR_NAME: info->s = "National Semiconductor INS8250/INS8250B"; break; | |
| 637 | case DEVINFO_STR_FAMILY: info->s = "INS8250"; break; | |
| 638 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; | |
| 639 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 640 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 636 | case DEVINFO_STR_NAME: strcpy(info->s, "National Semiconductor INS8250/INS8250B"); break; | |
| 637 | case DEVINFO_STR_FAMILY: strcpy(info->s, "INS8250"); break; | |
| 638 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 639 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 640 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 641 | 641 | } |
| 642 | 642 | } |
| 643 | 643 | |
| r3957 | r3958 | |
| 647 | 647 | switch ( state ) |
| 648 | 648 | { |
| 649 | 649 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 650 | case DEVINFO_STR_NAME: info->s | |
| 650 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 651 | 651 | |
| 652 | 652 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 653 | 653 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ins8250a); break; |
| r3957 | r3958 | |
| 662 | 662 | switch ( state ) |
| 663 | 663 | { |
| 664 | 664 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 665 | case DEVINFO_STR_NAME: info->s | |
| 665 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 666 | 666 | |
| 667 | 667 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 668 | 668 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ns16450); break; |
| r3957 | r3958 | |
| 677 | 677 | switch ( state ) |
| 678 | 678 | { |
| 679 | 679 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 680 | case DEVINFO_STR_NAME: info->s | |
| 680 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 681 | 681 | |
| 682 | 682 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 683 | 683 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ns16550); break; |
| r3957 | r3958 | |
| 692 | 692 | switch ( state ) |
| 693 | 693 | { |
| 694 | 694 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 695 | case DEVINFO_STR_NAME: info->s | |
| 695 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 696 | 696 | |
| 697 | 697 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 698 | 698 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ns16550a); break; |
| r3957 | r3958 | |
| 707 | 707 | switch ( state ) |
| 708 | 708 | { |
| 709 | 709 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 710 | case DEVINFO_STR_NAME: info->s | |
| 710 | case DEVINFO_STR_NAME: strcpy(info->s, | |
| 711 | 711 | |
| 712 | 712 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 713 | 713 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(pc16550d); break; |
| r3957 | r3958 | |
|---|---|---|
| 51 | 51 | /* inline configuration */ |
| 52 | 52 | #define MDRV_ABC77_ADD(config) \ |
| 53 | 53 | MDRV_SPEAKER_STANDARD_MONO("mono")\ |
| 54 | MDRV_DEVICE_ADD(ABC77_TAG, ABC77)\ | |
| 54 | MDRV_DEVICE_ADD(ABC77_TAG, ABC77, 0)\ | |
| 55 | 55 | MDRV_DEVICE_CONFIG(config) |
| 56 | 56 | |
| 57 | 57 | /* device interface */ |
| r3957 | r3958 | |
|---|---|---|
| 55 | 55 | ***************************************************************************/ |
| 56 | 56 | |
| 57 | 57 | #define MDRV_INS8250_ADD(_tag, _intrf) \ |
| 58 | MDRV_DEVICE_ADD(_tag, INS8250) \ | |
| 58 | MDRV_DEVICE_ADD(_tag, INS8250, 0) \ | |
| 59 | 59 | MDRV_DEVICE_CONFIG(_intrf) |
| 60 | 60 | |
| 61 | 61 | #define MDRV_INS8250_REMOVE(_tag) \ |
| r3957 | r3958 | |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | #define MDRV_NS16450_ADD(_tag, _intrf) \ |
| 66 | MDRV_DEVICE_ADD(_tag, NS16450) \ | |
| 66 | MDRV_DEVICE_ADD(_tag, NS16450, 0) \ | |
| 67 | 67 | MDRV_DEVICE_CONFIG(_intrf) |
| 68 | 68 | |
| 69 | 69 | #define MDRV_NS16450_REMOVE(_tag) \ |
| r3957 | r3958 | |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | #define MDRV_NS16550_ADD(_tag, _intrf) \ |
| 74 | MDRV_DEVICE_ADD(_tag, NS16550) \ | |
| 74 | MDRV_DEVICE_ADD(_tag, NS16550, 0) \ | |
| 75 | 75 | MDRV_DEVICE_CONFIG(_intrf) |
| 76 | 76 | |
| 77 | 77 | #define MDRV_NS16550_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 668 | 668 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(zx8302); break; |
| 669 | 669 | |
| 670 | 670 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 671 | case DEVINFO_STR_NAME: info->s = "Sinclair ZX8302"; break; | |
| 672 | case DEVINFO_STR_FAMILY: info->s = "Sinclair ZX83"; break; | |
| 673 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 674 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 675 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; | |
| 671 | case DEVINFO_STR_NAME: strcpy(info->s, "Sinclair ZX8302"); break; | |
| 672 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Sinclair ZX83"); break; | |
| 673 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 674 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 675 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 676 | 676 | } |
| 677 | 677 | } |
| r3957 | r3958 | |
|---|---|---|
| 119 | 119 | ***************************************************************************/ |
| 120 | 120 | |
| 121 | 121 | /* Loads the battery backed RAM into the appropriate memory area */ |
| 122 | static void snes_load_sram( | |
| 122 | static void snes_load_sram(running_machine *machine) | |
| 123 | 123 | { |
| 124 | 124 | UINT8 ii; |
| 125 | 125 | UINT8 *battery_ram, *ptr; |
| 126 | 126 | |
| 127 | 127 | battery_ram = malloc_or_die(snes_cart.sram_max); |
| 128 | 128 | ptr = battery_ram; |
| 129 | image_battery_load(image_from_devtype_and_index(IO_CARTSLOT,0), battery_ram, snes_cart.sram_max); | |
| 129 | image_battery_load(image_from_devtype_and_index(machine, IO_CARTSLOT,0), battery_ram, snes_cart.sram_max); | |
| 130 | 130 | |
| 131 | 131 | if (snes_cart.mode == SNES_MODE_20) |
| 132 | 132 | { |
| r3957 | r3958 | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /* Saves the battery backed RAM from the appropriate memory area */ |
| 168 | static void snes_save_sram( | |
| 168 | static void snes_save_sram(running_machine *machine) | |
| 169 | 169 | { |
| 170 | 170 | UINT8 ii; |
| 171 | 171 | UINT8 *battery_ram, *ptr; |
| r3957 | r3958 | |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | image_battery_save(image_from_devtype_and_index(IO_CARTSLOT,0), battery_ram, snes_cart.sram_max); | |
| 201 | image_battery_save(image_from_devtype_and_index(machine, IO_CARTSLOT,0), battery_ram, snes_cart.sram_max); | |
| 202 | 202 | |
| 203 | 203 | free(battery_ram); |
| 204 | 204 | } |
| r3957 | r3958 | |
| 207 | 207 | { |
| 208 | 208 | /* Save SRAM */ |
| 209 | 209 | if( snes_cart.sram > 0 ) |
| 210 | snes_save_sram(); | |
| 210 | snes_save_sram(machine); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | MACHINE_START( snes_mess ) |
| r3957 | r3958 | |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | /* Load SRAM */ |
| 764 | snes_load_sram(); | |
| 764 | snes_load_sram(space->machine); | |
| 765 | 765 | |
| 766 | 766 | /* All done */ |
| 767 | 767 | return INIT_PASS; |
| r3957 | r3958 | |
|---|---|---|
| 569 | 569 | |
| 570 | 570 | void apple2_setvar(running_machine *machine, UINT32 val, UINT32 mask) |
| 571 | 571 | { |
| 572 | LOG(("apple2_setvar(): val=0x%06x mask=0x%06x pc=0x%04x\n", val, mask, (unsigned int) cpu_get_reg(machine->cpu[0], REG_PC))); | |
| 572 | LOG(("apple2_setvar(): val=0x%06x mask=0x%06x pc=0x%04x\n", val, mask, (unsigned int) cpu_get_reg(machine->cpu[0], REG_GENPC))); | |
| 573 | 573 | |
| 574 | 574 | assert((val & mask) == val); |
| 575 | 575 |
| r3957 | r3958 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | #define ZX8302 DEVICE_GET_INFO_NAME( zx8302 ) |
| 46 | 46 | |
| 47 | #define MDRV_ZX8302_ADD(_tag, _clock, _config) \ | |
| 48 | MDRV_DEVICE_ADD(_tag, ZX8302, _clock) \ | |
| 49 | MDRV_DEVICE_CONFIG(_config) | |
| 50 | ||
| 47 | 51 | /* interface */ |
| 48 | 52 | typedef struct _zx8302_interface zx8302_interface; |
| 49 | 53 | struct _zx8302_interface |
| 50 | 54 | { |
| 51 | int clock; /* the CPU clock (pin 25) of the chip */ | |
| 52 | 55 | int rtc_clock; /* the RTC clock (pin 30) of the chip */ |
| 53 | 56 | |
| 54 | 57 | const char *mdv1_tag; /* microdrive 1 */ |
| r3957 | r3958 | |
|---|---|---|
| 421 | 421 | const cia6526_interface c64_ntsc_cia0 = |
| 422 | 422 | { |
| 423 | 423 | c64_cia0_interrupt, |
| 424 | 0.0, | |
| 425 | 424 | 60, |
| 426 | 425 | |
| 427 | 426 | { |
| r3957 | r3958 | |
| 433 | 432 | const cia6526_interface c64_pal_cia0 = |
| 434 | 433 | { |
| 435 | 434 | c64_cia0_interrupt, |
| 436 | 0.0, | |
| 437 | 435 | 50, |
| 438 | 436 | |
| 439 | 437 | { |
| r3957 | r3958 | |
| 445 | 443 | const cia6526_interface c64_ntsc_cia1 = |
| 446 | 444 | { |
| 447 | 445 | c64_cia1_interrupt, |
| 448 | 0.0, | |
| 449 | 446 | 60, |
| 450 | 447 | |
| 451 | 448 | { |
| r3957 | r3958 | |
| 457 | 454 | const cia6526_interface c64_pal_cia1 = |
| 458 | 455 | { |
| 459 | 456 | c64_cia1_interrupt, |
| 460 | 0.0, | |
| 461 | 457 | 50, |
| 462 | 458 | |
| 463 | 459 | { |
| r3957 | r3958 | |
| 676 | 672 | static int old = -1, exrom, game; |
| 677 | 673 | int loram, hiram, charen; |
| 678 | 674 | int ultimax_mode = 0; |
| 679 | int data = (UINT8) c | |
| 675 | int data = (UINT8) device | |
| 680 | 676 | |
| 681 | 677 | /* If nothing has changed or reset = 0, don't do anything */ |
| 682 | 678 | if ((data == old) && (exrom == c64_exrom) && (game == c64_game) && !reset) |
| r3957 | r3958 | |
| 1021 | 1017 | static void c64_common_driver_init (running_machine *machine) |
| 1022 | 1018 | { |
| 1023 | 1019 | /* configure the M6510 port */ |
| 1024 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c64_m6510_port_read); | |
| 1025 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c64_m6510_port_write); | |
| 1020 | device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c64_m6510_port_read); | |
| 1021 | device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c64_m6510_port_write); | |
| 1026 | 1022 | |
| 1027 | 1023 | if (!ultimax) |
| 1028 | 1024 | { |
| r3957 | r3958 | |
|---|---|---|
| 1205 | 1205 | genesis_sram_end += 1; |
| 1206 | 1206 | |
| 1207 | 1207 | genesis_sram = malloc_or_die(genesis_sram_end - genesis_sram_start); |
| 1208 | image_battery_load(image_from_devtype_and_index(IO_CARTSLOT, 0), genesis_sram, genesis_sram_end - genesis_sram_start); | |
| 1208 | image_battery_load(image_from_devtype_and_index(image->machine, IO_CARTSLOT, 0), genesis_sram, genesis_sram_end - genesis_sram_start); | |
| 1209 | 1209 | |
| 1210 | 1210 | megadriv_backupram = (UINT16*)ROM + ((genesis_sram_start & 0x3fffff) / 2); |
| 1211 | 1211 | memmove(&megadriv_backupram[0], genesis_sram, genesis_sram_end - genesis_sram_start); |
| r3957 | r3958 | |
| 1229 | 1229 | /* Write out the battery file if necessary */ |
| 1230 | 1230 | if (has_sram && (genesis_sram != NULL) && (genesis_sram_end - genesis_sram_start > 0)) |
| 1231 | 1231 | { |
| 1232 | image_battery_save(image_from_devtype_and_index(IO_CARTSLOT, 0), genesis_sram, genesis_sram_end - genesis_sram_start); | |
| 1232 | image_battery_save(image_from_devtype_and_index(image->machine, IO_CARTSLOT, 0), genesis_sram, genesis_sram_end - genesis_sram_start); | |
| 1233 | 1233 | } |
| 1234 | 1234 | } |
| 1235 | 1235 |
| r3957 | r3958 | |
|---|---|---|
| 436 | 436 | case DEVINFO_FCT_RESET: /*info->reset = DEVICE_RESET_NAME(hd63450);*/ break; |
| 437 | 437 | |
| 438 | 438 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 439 | case DEVINFO_STR_NAME: info->s = "Hitachi HD63450"; break; | |
| 440 | case DEVINFO_STR_FAMILY: info->s = "DMA Controller"; break; | |
| 441 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 442 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 443 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 439 | case DEVINFO_STR_NAME: strcpy(info->s, "Hitachi HD63450"); break; | |
| 440 | case DEVINFO_STR_FAMILY: strcpy(info->s, "DMA Controller"); break; | |
| 441 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 442 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 443 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 444 | 444 | } |
| 445 | 445 | } |
| 446 | 446 |
| r3957 | r3958 | |
|---|---|---|
| 220 | 220 | |
| 221 | 221 | static PIC8259_SET_INT_LINE( pcjr_pic8259_master_set_int_line ) |
| 222 | 222 | { |
| 223 | if ( cpu_get_reg( device->machine->cpu[0], REG_PC ) == 0xF0454 ) | |
| 223 | if ( cpu_get_reg( device->machine->cpu[0], REG_GENPC ) == 0xF0454 ) | |
| 224 | 224 | { |
| 225 | 225 | timer_adjust_oneshot( pc_int_delay_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 1), interrupt ); |
| 226 | 226 | } |
| r3957 | r3958 | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | |
| 524 | static void pcjr_set_keyb_int(int state) | |
| 524 | static void pcjr_set_keyb_int(running_machine *machine, int state) | |
| 525 | 525 | { |
| 526 | 526 | if ( state ) |
| 527 | 527 | { |
| r3957 | r3958 | |
| 1147 | 1147 | pic8259_set_irq_line(pc_devices.pic8259_master, irq, state); |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | static void pc_set_keyb_int(int state) { | |
| 1150 | static void pc_set_keyb_int(running_machine *machine, int state) | |
| 1151 | { | |
| 1151 | 1152 | pc_set_irq_line( 1, state ); |
| 1152 | 1153 | } |
| 1153 | 1154 | |
| r3957 | r3958 | |
| 1158 | 1159 | * |
| 1159 | 1160 | **********************************************************/ |
| 1160 | 1161 | |
| 1161 | void mess_init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(int), void (*set_hdc_int_func)(int,int)) | |
| 1162 | void mess_init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int), void (*set_hdc_int_func)(int,int)) | |
| 1162 | 1163 | { |
| 1163 | 1164 | if ( set_keyb_int_func != NULL ) |
| 1164 | 1165 | init_pc_common(machine, flags, set_keyb_int_func); |
| r3957 | r3958 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | #define HD63450 DEVICE_GET_INFO_NAME(hd63450) |
| 69 | 69 | |
| 70 | #define MDRV_HD63450_ADD(_tag, _config) \ | |
| 71 | MDRV_DEVICE_ADD(_tag, HD63450, 0) \ | |
| 72 | MDRV_DEVICE_CONFIG(_config) | |
| 73 | ||
| 70 | 74 | READ16_DEVICE_HANDLER( hd63450_r ); |
| 71 | 75 | WRITE16_DEVICE_HANDLER( hd63450_w ); |
| r3957 | r3958 | |
|---|---|---|
| 889 | 889 | INTERRUPT_GEN( ti99_4ev_hblank_interrupt ) |
| 890 | 890 | { |
| 891 | 891 | static int line_count; |
| 892 | v9938_interrupt(0); | |
| 892 | v9938_interrupt(device->machine, 0); | |
| 893 | 893 | if (++line_count == 262) |
| 894 | 894 | { |
| 895 | 895 | line_count = 0; |
| r3957 | r3958 | |
|---|---|---|
| 1258 | 1258 | |
| 1259 | 1259 | |
| 1260 | 1260 | MACHINE_DRIVER_START( smc92x4_hd ) |
| 1261 | MDRV_DEVICE_ADD( "harddisk1", HARDDISK ) | |
| 1261 | MDRV_DEVICE_ADD( "harddisk1", HARDDISK, 0 ) | |
| 1262 | 1262 | MDRV_DEVICE_CONFIG( smc92x4_harddisk_config ) |
| 1263 | MDRV_DEVICE_ADD( "harddisk2", HARDDISK ) | |
| 1263 | MDRV_DEVICE_ADD( "harddisk2", HARDDISK, 0 ) | |
| 1264 | 1264 | MDRV_DEVICE_CONFIG( smc92x4_harddisk_config ) |
| 1265 | MDRV_DEVICE_ADD( "harddisk3", HARDDISK ) | |
| 1265 | MDRV_DEVICE_ADD( "harddisk3", HARDDISK, 0 ) | |
| 1266 | 1266 | MDRV_DEVICE_CONFIG( smc92x4_harddisk_config ) |
| 1267 | 1267 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 820 | 820 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(msm8251); break; |
| 821 | 821 | |
| 822 | 822 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 823 | case DEVINFO_STR_NAME: info->s = "Intel 8251 UART"; break; | |
| 824 | case DEVINFO_STR_FAMILY: info->s = "Intel 8251 UART"; break; | |
| 825 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 826 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 823 | case DEVINFO_STR_NAME: strcpy(info->s, "Intel 8251 UART"); break; | |
| 824 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Intel 8251 UART"); break; | |
| 825 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 826 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 827 | 827 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 828 | 828 | } |
| 829 | 829 | } |
| r3957 | r3958 | |
|---|---|---|
| 520 | 520 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(tms5501); break; |
| 521 | 521 | |
| 522 | 522 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 523 | case DEVINFO_STR_NAME: info->s = "TMS5501"; break; | |
| 524 | case DEVINFO_STR_FAMILY: info->s = "TMS5501"; break; | |
| 525 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 526 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 523 | case DEVINFO_STR_NAME: strcpy(info->s, "TMS5501"); break; | |
| 524 | case DEVINFO_STR_FAMILY: strcpy(info->s, "TMS5501"); break; | |
| 525 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 526 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 527 | 527 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 528 | 528 | } |
| 529 | 529 | } |
| r3957 | r3958 | |
|---|---|---|
| 29 | 29 | #define MSM8251_STATUS_TX_READY 0x01 |
| 30 | 30 | |
| 31 | 31 | #define MDRV_MSM8251_ADD(_tag, _intrf) \ |
| 32 | MDRV_DEVICE_ADD(_tag, MSM8251) \ | |
| 32 | MDRV_DEVICE_ADD(_tag, MSM8251, 0) \ | |
| 33 | 33 | MDRV_DEVICE_CONFIG(_intrf) |
| 34 | 34 | |
| 35 | 35 | #define MDRV_MSM8251_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 39 | 39 | ***************************************************************************/ |
| 40 | 40 | |
| 41 | 41 | #define MDRV_TMS5501_ADD(_tag, _intrf) \ |
| 42 | MDRV_DEVICE_ADD(_tag, TMS5501) \ | |
| 42 | MDRV_DEVICE_ADD(_tag, TMS5501, 0) \ | |
| 43 | 43 | MDRV_DEVICE_CONFIG(_intrf) |
| 44 | 44 | |
| 45 | 45 |
| r3957 | r3958 | |
|---|---|---|
| 235 | 235 | |
| 236 | 236 | static TIMER_CALLBACK(kc85_disk_reset_timer_callback) |
| 237 | 237 | { |
| 238 | cpu_set_reg(machine->cpu[1], REG_PC, 0x0f000); | |
| 239 | cpu_set_reg(machine->cpu[0], REG_PC, 0x0f000); | |
| 238 | cpu_set_reg(machine->cpu[1], REG_GENPC, 0x0f000); | |
| 239 | cpu_set_reg(machine->cpu[0], REG_GENPC, 0x0f000); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | static void kc_disc_interface_init(running_machine *machine) |
| r3957 | r3958 | |
| 1680 | 1680 | |
| 1681 | 1681 | kc85_3_update_0x00000(machine); |
| 1682 | 1682 | |
| 1683 | return (cpunum_get_reg(0, REG_PC) & 0x0ffff); | |
| 1683 | return (cpunum_get_reg(0, REG_GENPC) & 0x0ffff); | |
| 1684 | 1684 | } |
| 1685 | 1685 | |
| 1686 | 1686 | |
| r3957 | r3958 | |
| 1690 | 1690 | |
| 1691 | 1691 | kc85_4_update_0x00000(machine); |
| 1692 | 1692 | |
| 1693 | return (cpunum_get_reg(0, REG_PC) & 0x0ffff); | |
| 1693 | return (cpunum_get_reg(0, REG_GENPC) & 0x0ffff); | |
| 1694 | 1694 | } |
| 1695 | 1695 | #endif |
| 1696 | 1696 | |
| 1697 | 1697 | |
| 1698 | 1698 | static TIMER_CALLBACK(kc85_reset_timer_callback) |
| 1699 | 1699 | { |
| 1700 | cpu_set_reg(machine->cpu[0], REG_PC, 0x0f000); | |
| 1700 | cpu_set_reg(machine->cpu[0], REG_GENPC, 0x0f000); | |
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | READ8_HANDLER ( kc85_pio_data_r ) |
| r3957 | r3958 | |
| 1836 | 1836 | |
| 1837 | 1837 | const z80ctc_interface kc85_ctc_intf = |
| 1838 | 1838 | { |
| 1839 | "main", | |
| 1840 | 1379310.344828, | |
| 1841 | 1839 | 0, |
| 1842 | 1840 | kc85_ctc_interrupt, |
| 1843 | 1841 | kc85_zc0_callback, |
| r3957 | r3958 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | CPUS += Z80 |
| 44 | 44 | #CPUS += Z180 |
| 45 | CPUS += 8080 | |
| 46 | #CPUS += 8085A | |
| 45 | CPUS += I8085 | |
| 47 | 46 | CPUS += M6502 |
| 48 | 47 | CPUS += M65C02 |
| 49 | 48 | CPUS += M65SC02 |
| r3957 | r3958 | |
| 78 | 77 | #CPUS += I8041 |
| 79 | 78 | CPUS += I8048 |
| 80 | 79 | #CPUS += I8648 |
| 81 | ||
| 80 | ||
| 82 | 81 | #CPUS += MB8884 |
| 83 | 82 | CPUS += I8039 |
| 84 | ||
| 83 | ||
| 85 | 84 | CPUS += I8749 |
| 86 | 85 | #CPUS += N7751 |
| 87 | 86 | #CPUS += M58715 |
| r3957 | r3958 | |
| 140 | 139 | #CPUS += TMS32032 |
| 141 | 140 | #CPUS += TMS32051 |
| 142 | 141 | #CPUS += CCPU |
| 143 | #CPUS += ADSP2100 | |
| 144 | #CPUS += ADSP2101 | |
| 145 | #CPUS += ADSP2104 | |
| 146 | #CPUS += ADSP2105 | |
| 147 | #CPUS += ADSP2115 | |
| 148 | #CPUS += ADSP2181 | |
| 142 | #CPUS += ADSP21XX | |
| 149 | 143 | CPUS += PSXCPU |
| 150 | 144 | #CPUS += CXD8661R |
| 151 | 145 | #CPUS += ASAP |
| r3957 | r3958 | |
| 245 | 239 | CPUS += TMS7000_EXL |
| 246 | 240 | CPUS += SM8500 |
| 247 | 241 | CPUS += MINX |
| 242 | CPUS += 8080 | |
| 243 | CPUS += 8085A | |
| 244 | #CPUS += ADSP2100 | |
| 245 | #CPUS += ADSP2101 | |
| 246 | #CPUS += ADSP2104 | |
| 247 | #CPUS += ADSP2105 | |
| 248 | #CPUS += ADSP2115 | |
| 249 | #CPUS += ADSP2181 | |
| 248 | 250 | CPUS += I8X41 |
| 249 | 251 | #CPUS += M68000 |
| 250 | 252 | #CPUS += M68008 |
| r3957 | r3958 | |
| 419 | 421 | $(MESSOBJ)/kaypro.a \ |
| 420 | 422 | $(MESSOBJ)/kim1.a \ |
| 421 | 423 | $(MESSOBJ)/kramermc.a \ |
| 422 | $(MESSOBJ)/luxor.a \ | |
| 423 | 424 | $(MESSOBJ)/lviv.a \ |
| 424 | 425 | $(MESSOBJ)/lynx.a \ |
| 425 | 426 | $(MESSOBJ)/magnavox.a \ |
| 426 | $(MESSOBJ)/mbee.a \ | |
| 427 | 427 | $(MESSOBJ)/mc10.a \ |
| 428 | 428 | $(MESSOBJ)/memotech.a \ |
| 429 | 429 | $(MESSOBJ)/mephisto.a \ |
| r3957 | r3958 | |
| 431 | 431 | $(MESSOBJ)/mk1.a \ |
| 432 | 432 | $(MESSOBJ)/mk2.a \ |
| 433 | 433 | $(MESSOBJ)/motorola.a \ |
| 434 | $(MESSOBJ)/multitch.a \ | |
| 435 | $(MESSOBJ)/nascom1.a \ | |
| 436 | 434 | $(MESSOBJ)/nec.a \ |
| 437 | 435 | $(MESSOBJ)/necpc.a \ |
| 438 | 436 | $(MESSOBJ)/nintendo.a \ |
| r3957 | r3958 | |
| 461 | 459 | $(MESSOBJ)/sharp.a \ |
| 462 | 460 | $(MESSOBJ)/sinclair.a \ |
| 463 | 461 | $(MESSOBJ)/sony.a \ |
| 464 | $(MESSOBJ)/sord.a \ | |
| 465 | 462 | $(MESSOBJ)/special.a \ |
| 466 | 463 | $(MESSOBJ)/ssystem3.a \ |
| 467 | $(MESSOBJ)/super80.a \ | |
| 468 | 464 | $(MESSOBJ)/svi.a \ |
| 469 | 465 | $(MESSOBJ)/svision.a \ |
| 470 | 466 | $(MESSOBJ)/synertec.a \ |
| 471 | 467 | $(MESSOBJ)/tangerin.a \ |
| 472 | $(MESSOBJ)/tatung.a \ | |
| 473 | 468 | $(MESSOBJ)/teamconc.a \ |
| 474 | 469 | $(MESSOBJ)/telmac.a \ |
| 475 | $(MESSOBJ)/thomson.a \ | |
| 476 | 470 | $(MESSOBJ)/ti85.a \ |
| 477 | $(MESSOBJ)/ti99.a \ | |
| 478 | 471 | $(MESSOBJ)/tiger.a \ |
| 479 | 472 | $(MESSOBJ)/trs80.a \ |
| 480 | 473 | $(MESSOBJ)/tutor.a \ |
| 481 | 474 | $(MESSOBJ)/tx0.a \ |
| 482 | 475 | $(MESSOBJ)/ut88.a \ |
| 483 | 476 | $(MESSOBJ)/vc4000.a \ |
| 484 | $(MESSOBJ)/veb.a \ | |
| 485 | 477 | $(MESSOBJ)/vector06.a \ |
| 486 | 478 | $(MESSOBJ)/votrax.a \ |
| 487 | $(MESSOBJ)/vtech.a \ | |
| 488 | 479 | $(MESSOBJ)/shared.a \ |
| 489 | 480 | |
| 481 | # $(MESSOBJ)/luxor.a \ | |
| 482 | # $(MESSOBJ)/mbee.a \ | |
| 483 | # $(MESSOBJ)/multitch.a \ | |
| 484 | # $(MESSOBJ)/nascom1.a \ | |
| 485 | # $(MESSOBJ)/sord.a \ | |
| 486 | # $(MESSOBJ)/super80.a \ | |
| 487 | # $(MESSOBJ)/tatung.a \ | |
| 488 | # $(MESSOBJ)/ti99.a \ | |
| 489 | # $(MESSOBJ)/thomson.a \ | |
| 490 | # $(MESSOBJ)/veb.a \ | |
| 491 | # $(MESSOBJ)/vtech.a \ | |
| 490 | 492 | |
| 493 | ||
| 491 | 494 | #------------------------------------------------- |
| 492 | 495 | # the following files are general components and |
| 493 | 496 | # shared across a number of drivers |
| r3957 | r3958 | |
|---|---|---|
| 64 | 64 | ***************************************************************************/ |
| 65 | 65 | |
| 66 | 66 | #define MDRV_SNAPSHOT_ADD(_load, _file_extensions, _delay) \ |
| 67 | MDRV_DEVICE_ADD(TAG_SNAPSHOT, SNAPSHOT) \ | |
| 67 | MDRV_DEVICE_ADD(TAG_SNAPSHOT, SNAPSHOT, 0) \ | |
| 68 | 68 | MDRV_DEVICE_CONFIG_DATAPTR(snapquick_config, load, SNAPSHOT_LOAD_NAME(_load)) \ |
| 69 | 69 | MDRV_DEVICE_CONFIG_DATAPTR(snapquick_config, file_extensions, _file_extensions) \ |
| 70 | 70 | MDRV_DEVICE_CONFIG_DATA64(snapquick_config, delay_seconds, (seconds_t) (_delay)) \ |
| r3957 | r3958 | |
| 77 | 77 | ***************************************************************************/ |
| 78 | 78 | |
| 79 | 79 | #define MDRV_QUICKLOAD_ADD(_load, _file_extensions, _delay) \ |
| 80 | MDRV_DEVICE_ADD(TAG_QUICKLOAD, QUICKLOAD) \ | |
| 80 | MDRV_DEVICE_ADD(TAG_QUICKLOAD, QUICKLOAD, 0) \ | |
| 81 | 81 | MDRV_DEVICE_CONFIG_DATAPTR(snapquick_config, load, QUICKLOAD_LOAD_NAME(_load)) \ |
| 82 | 82 | MDRV_DEVICE_CONFIG_DATAPTR(snapquick_config, file_extensions, _file_extensions) \ |
| 83 | 83 | MDRV_DEVICE_CONFIG_DATA64(snapquick_config, delay_seconds, (seconds_t) (_delay)) \ |
| r3957 | r3958 | |
|---|---|---|
| 304 | 304 | case DEVINFO_PTR_IMAGE_CREATE_OPTSPEC+0: info->p = (void *) mess_hd_option_spec; break; |
| 305 | 305 | |
| 306 | 306 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 307 | case DEVINFO_STR_NAME: info->s = "Harddisk"; break; | |
| 308 | case DEVINFO_STR_FAMILY: info->s = "Harddisk"; break; | |
| 309 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 310 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "chd,hd"; break; | |
| 311 | case DEVINFO_STR_IMAGE_CREATE_OPTNAME+0: info->s = "chd"; break; | |
| 312 | case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0: info->s = "MAME/MESS CHD Hard drive"; break; | |
| 313 | case DEVINFO_STR_IMAGE_CREATE_OPTEXTS+0: info->s = "chd,hd"; break; | |
| 307 | case DEVINFO_STR_NAME: strcpy(info->s, "Harddisk"); break; | |
| 308 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Harddisk"); break; | |
| 309 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 310 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "chd,hd"); break; | |
| 311 | case DEVINFO_STR_IMAGE_CREATE_OPTNAME+0: strcpy(info->s, "chd"); break; | |
| 312 | case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0: strcpy(info->s, "MAME/MESS CHD Hard drive"); break; | |
| 313 | case DEVINFO_STR_IMAGE_CREATE_OPTEXTS+0: strcpy(info->s, "chd,hd"); break; | |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | |
| r3957 | r3958 | |
| 431 | 431 | // case DEVINFO_FCT_IMAGE_VERIFY: info->f = (genf *) ide_hd_validity_check; break; |
| 432 | 432 | |
| 433 | 433 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 434 | case DEVINFO_STR_NAME: info->s = "IDE harddisk"; break; | |
| 435 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: info->s = "ideharddrive"; break; | |
| 436 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: info->s = "idehd"; break; | |
| 434 | case DEVINFO_STR_NAME: strcpy(info->s, "IDE harddisk"); break; | |
| 435 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: strcpy(info->s, "ideharddrive"); break; | |
| 436 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: strcpy(info->s, "idehd"); break; | |
| 437 | 437 | |
| 438 | 438 | default: DEVICE_GET_INFO_CALL( mess_hd ); break; |
| 439 | 439 | } |
| r3957 | r3958 | |
|---|---|---|
| 17 | 17 | #define IDE_HARDDISK DEVICE_GET_INFO_NAME(mess_ide) |
| 18 | 18 | |
| 19 | 19 | #define MDRV_HARDDISK_ADD(_tag) \ |
| 20 | MDRV_DEVICE_ADD(_tag, HARDDISK) \ | |
| 20 | MDRV_DEVICE_ADD(_tag, HARDDISK, 0) \ | |
| 21 | 21 | |
| 22 | 22 | #define MDRV_IDE_HARDDISK_ADD(_tag) \ |
| 23 | MDRV_DEVICE_ADD(_tag, IDE_HARDDISK) \ | |
| 23 | MDRV_DEVICE_ADD(_tag, IDE_HARDDISK, 0) \ | |
| 24 | 24 | |
| 25 | 25 | DEVICE_GET_INFO( mess_hd ); |
| 26 | 26 | DEVICE_GET_INFO( mess_ide ); |
| r3957 | r3958 | |
|---|---|---|
| 122 | 122 | else |
| 123 | 123 | { |
| 124 | 124 | if (autorun) |
| 125 | cpu_set_reg(cputag_get_cpu(image->machine, "main"), REG_PC, exec_addr); | |
| 125 | cpu_set_reg(cputag_get_cpu(image->machine, "main"), REG_GENPC, exec_addr); | |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| r3957 | r3958 | |
| 144 | 144 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(z80bin_config); break; |
| 145 | 145 | |
| 146 | 146 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 147 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 148 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "bin"; break; | |
| 147 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 148 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "bin"); break; | |
| 149 | 149 | |
| 150 | 150 | /* --- the following bits of info are returned as pointers to functions --- */ |
| 151 | 151 | case DEVINFO_FCT_SNAPSHOT_QUICKLOAD_LOAD: info->f = (genf *) quickload_load_z80bin; break; |
| r3957 | r3958 | |
|---|---|---|
| 393 | 393 | case DEVINFO_FCT_DISPLAY: info->f = (genf *) device_display_cassette; break; |
| 394 | 394 | |
| 395 | 395 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 396 | case DEVINFO_STR_NAME: info->s = "Cassette"; break; | |
| 397 | case DEVINFO_STR_FAMILY: info->s = "Cassette"; break; | |
| 398 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 396 | case DEVINFO_STR_NAME: strcpy(info->s, "Cassette"); break; | |
| 397 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Cassette"); break; | |
| 398 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 399 | 399 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: |
| 400 | 400 | if ( device && device->static_config ) |
| 401 | 401 | { |
| 402 | 402 | const struct CassetteFormat * const *formats = ((cassette_config *)device->static_config)->formats; |
| 403 | char *s; | |
| 404 | 403 | int i; |
| 405 | 404 | |
| 406 | 405 | /* set up a temporary string */ |
| 407 | s = device_temp_str(); | |
| 408 | info->s = s; | |
| 409 | s[0] = '\0'; | |
| 406 | info->s[0] = '\0'; | |
| 410 | 407 | |
| 411 | 408 | for ( i = 0; formats[i]; i++ ) |
| 412 | specify_extension( s, 256, formats[i]->extensions ); | |
| 409 | specify_extension( info->s, 256, formats[i]->extensions ); | |
| 413 | 410 | } |
| 414 | 411 | break; |
| 415 | 412 | } |
| r3957 | r3958 | |
|---|---|---|
| 47 | 47 | ***************************************************************************/ |
| 48 | 48 | |
| 49 | 49 | #define MDRV_Z80BIN_QUICKLOAD_ADD(_execute, _delay) \ |
| 50 | MDRV_DEVICE_ADD(TAG_QUICKLOAD, Z80BIN) \ | |
| 50 | MDRV_DEVICE_ADD(TAG_QUICKLOAD, Z80BIN, 0) \ | |
| 51 | 51 | MDRV_DEVICE_CONFIG_DATA64(snapquick_config, delay_seconds, (seconds_t) (_delay)) \ |
| 52 | 52 | MDRV_DEVICE_CONFIG_DATA64(snapquick_config, delay_attoseconds, (attoseconds_t) (((_delay) - (int)(_delay)) * ATTOSECONDS_PER_SECOND)) \ |
| 53 | 53 | MDRV_DEVICE_CONFIG_DATAPTR(z80bin_config, execute, Z80BIN_EXECUTE_NAME(_execute)) |
| r3957 | r3958 | |
|---|---|---|
| 72 | 72 | ***************************************************************************/ |
| 73 | 73 | |
| 74 | 74 | #define MDRV_CASSETTE_ADD(_tag, _config) \ |
| 75 | MDRV_DEVICE_ADD(_tag, CASSETTE) \ | |
| 75 | MDRV_DEVICE_ADD(_tag, CASSETTE, 0) \ | |
| 76 | 76 | MDRV_DEVICE_CONFIG(_config) |
| 77 | 77 | |
| 78 | 78 | #define MDRV_CASSETTE_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(microdrv); break; |
| 32 | 32 | |
| 33 | 33 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 34 | case DEVINFO_STR_NAME: info->s = "Microdrive"; break; | |
| 35 | case DEVINFO_STR_FAMILY: info->s = "Microdrive"; break; | |
| 36 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 37 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "mdv"; break; | |
| 34 | case DEVINFO_STR_NAME: strcpy(info->s, "Microdrive"); break; | |
| 35 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Microdrive"); break; | |
| 36 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 37 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "mdv"); break; | |
| 38 | 38 | } |
| 39 | 39 | } |
| r3957 | r3958 | |
|---|---|---|
| 352 | 352 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( xmodem ); break; |
| 353 | 353 | case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME( xmodem ); break; |
| 354 | 354 | case DEVINFO_FCT_IMAGE_CREATE: info->f = (genf *) DEVICE_IMAGE_CREATE_NAME( xmodem ); break; |
| 355 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: info->s | |
| 355 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: strcpy(info->s, | |
| 356 | 356 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: |
| 357 | case DEVINFO_STR_NAME: info->s = "xmodem"; break; | |
| 358 | case DEVINFO_STR_FAMILY: info->s = "serial protocol"; break; | |
| 359 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 360 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = ""; break; | |
| 357 | case DEVINFO_STR_NAME: strcpy(info->s, "xmodem"); break; | |
| 358 | case DEVINFO_STR_FAMILY: strcpy(info->s, "serial protocol"); break; | |
| 359 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 360 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, ""); break; | |
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 |
| r3957 | r3958 | |
|---|---|---|
| 688 | 688 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( kermit ); break; |
| 689 | 689 | case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME( kermit ); break; |
| 690 | 690 | case DEVINFO_FCT_IMAGE_CREATE: info->f = (genf *) DEVICE_IMAGE_CREATE_NAME( kermit ); break; |
| 691 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: info->s | |
| 691 | case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME: strcpy(info->s, | |
| 692 | 692 | case DEVINFO_STR_IMAGE_INSTANCE_NAME: |
| 693 | case DEVINFO_STR_NAME: info->s = "kermit"; break; | |
| 694 | case DEVINFO_STR_FAMILY: info->s = "serial protocol"; break; | |
| 695 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 696 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = ""; break; | |
| 693 | case DEVINFO_STR_NAME: strcpy(info->s, "kermit"); break; | |
| 694 | case DEVINFO_STR_FAMILY: strcpy(info->s, "serial protocol"); break; | |
| 695 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 696 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, ""); break; | |
| 697 | 697 | } |
| 698 | 698 | } |
| 699 | 699 |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | #define MDRV_XMODEM_ADD(_tag, _intrf) \ |
| 27 | MDRV_DEVICE_ADD(_tag, XMODEM) \ | |
| 27 | MDRV_DEVICE_ADD(_tag, XMODEM, 0) \ | |
| 28 | 28 | MDRV_DEVICE_CONFIG(_intrf) |
| 29 | 29 | |
| 30 | 30 | #define MDRV_XMODEM_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | #define MDRV_KERMIT_ADD(_tag, _intrf) \ |
| 27 | MDRV_DEVICE_ADD(_tag, KERMIT) \ | |
| 27 | MDRV_DEVICE_ADD(_tag, KERMIT, 0) \ | |
| 28 | 28 | MDRV_DEVICE_CONFIG(_intrf) |
| 29 | 29 | |
| 30 | 30 | #define MDRV_KERMIT_REMOVE(_tag) \ |
| r3957 | r3958 | |
|---|---|---|
| 159 | 159 | case DEVINFO_PTR_IMAGE_CREATE_OPTSPEC+0: info->p = (void *) mess_cd_option_spec; break; |
| 160 | 160 | |
| 161 | 161 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 162 | case DEVINFO_STR_NAME: info->s = "Cdrom"; break; | |
| 163 | case DEVINFO_STR_FAMILY: info->s = "Cdrom"; break; | |
| 164 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 165 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "chd"; break; | |
| 166 | case DEVINFO_STR_IMAGE_CREATE_OPTNAME+0: info->s = "chdcd"; break; | |
| 167 | case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0: info->s = "MAME/MESS CHD CD-ROM drive"; break; | |
| 168 | case DEVINFO_STR_IMAGE_CREATE_OPTEXTS+0: info->s = "chd"; break; | |
| 162 | case DEVINFO_STR_NAME: strcpy(info->s, "Cdrom"); break; | |
| 163 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Cdrom"); break; | |
| 164 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 165 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "chd"); break; | |
| 166 | case DEVINFO_STR_IMAGE_CREATE_OPTNAME+0: strcpy(info->s, "chdcd"); break; | |
| 167 | case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0: strcpy(info->s, "MAME/MESS CHD CD-ROM drive"); break; | |
| 168 | case DEVINFO_STR_IMAGE_CREATE_OPTEXTS+0: strcpy(info->s, "chd"); break; | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | #define MDRV_CDROM_ADD(_tag) \ |
| 18 | MDRV_DEVICE_ADD(_tag, CDROM) \ | |
| 18 | MDRV_DEVICE_ADD(_tag, CDROM, 0) \ | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | DEVICE_GET_INFO(cdrom); |
| r3957 | r3958 | |
|---|---|---|
| 74 | 74 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(printer); break; |
| 75 | 75 | |
| 76 | 76 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 77 | case DEVINFO_STR_NAME: info->s = "Printer"; break; | |
| 78 | case DEVINFO_STR_FAMILY: info->s = "Printer"; break; | |
| 79 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 80 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "prn"; break; | |
| 77 | case DEVINFO_STR_NAME: strcpy(info->s, "Printer"); break; | |
| 78 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Printer"); break; | |
| 79 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 80 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "prn"); break; | |
| 81 | 81 | } |
| 82 | 82 | } |
| r3957 | r3958 | |
|---|---|---|
| 281 | 281 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(coco_vhd); break; |
| 282 | 282 | |
| 283 | 283 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 284 | case DEVINFO_STR_NAME: info->s = "Virtual Hard Disk"; break; | |
| 285 | case DEVINFO_STR_FAMILY: info->s = "Virtual Hard Disk"; break; | |
| 286 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 287 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "vhd"; break; | |
| 284 | case DEVINFO_STR_NAME: strcpy(info->s, "Virtual Hard Disk"); break; | |
| 285 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Virtual Hard Disk"); break; | |
| 286 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 287 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "vhd"); break; | |
| 288 | 288 | } |
| 289 | 289 | } |
| r3957 | r3958 | |
|---|---|---|
| 246 | 246 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(bitbanger); break; |
| 247 | 247 | |
| 248 | 248 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 249 | case DEVINFO_STR_NAME: info->s = "Bitbanger"; break; | |
| 250 | case DEVINFO_STR_FAMILY: info->s = "Bitbanger"; break; | |
| 251 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 252 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = "prn"; break; | |
| 249 | case DEVINFO_STR_NAME: strcpy(info->s, "Bitbanger"); break; | |
| 250 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Bitbanger"); break; | |
| 251 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 252 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "prn"); break; | |
| 253 | 253 | } |
| 254 | 254 | } |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | #define MDRV_PRINTER_ADD(_tag) \ |
| 23 | MDRV_DEVICE_ADD(_tag, PRINTER) \ | |
| 23 | MDRV_DEVICE_ADD(_tag, PRINTER, 0) \ | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | /*************************************************************************** |
| r3957 | r3958 | |
|---|---|---|
| 337 | 337 | wd17xx_reset(fdc); |
| 338 | 338 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 339 | 339 | { |
| 340 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); | |
| 340 | const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i ); | |
| 341 | 341 | floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 ); |
| 342 | 342 | floppy_drive_set_rpm( img, 300. ); |
| 343 | 343 | floppy_drive_seek( img, - floppy_drive_get_current_track( img ) ); |
| r3957 | r3958 | |
| 439 | 439 | thom_floppy_set_density( DEN_FM_LO ); |
| 440 | 440 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 441 | 441 | { |
| 442 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); | |
| 442 | const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i ); | |
| 443 | 443 | floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 ); |
| 444 | 444 | floppy_drive_set_rpm( img, 300. ); |
| 445 | 445 | floppy_drive_seek( img, - floppy_drive_get_current_track( img ) ); |
| r3957 | r3958 | |
| 545 | 545 | |
| 546 | 546 | |
| 547 | 547 | |
| 548 | static const device_config * to7_qdd_image ( | |
| 548 | static const device_config * to7_qdd_image ( running_machine *machine ) | |
| 549 | 549 | { |
| 550 | return image_from_devtype_and_index( IO_FLOPPY, 0 ); | |
| 550 | return image_from_devtype_and_index( machine, IO_FLOPPY, 0 ); | |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | |
| 554 | 554 | |
| 555 | 555 | /* update MC6852 status register */ |
| 556 | static void to7_qdd_stat_update( | |
| 556 | static void to7_qdd_stat_update( running_machine *machine ) | |
| 557 | 557 | { |
| 558 | int flags = floppy_drive_get_flag_state( to7_qdd_image(), -1 ); | |
| 558 | int flags = floppy_drive_get_flag_state( to7_qdd_image(machine), -1 ); | |
| 559 | 559 | |
| 560 | 560 | /* byte-ready */ |
| 561 | 561 | to7qdd->status |= QDD_S_RDA | QDD_S_TDRA; |
| r3957 | r3958 | |
| 594 | 594 | /* rebuild disk if needed */ |
| 595 | 595 | if ( !to7qdd->data_size ) |
| 596 | 596 | { |
| 597 | to7qdd->data_size = thom_qdd_make_disk( to7_qdd_image(), to7qdd->data ); | |
| 597 | to7qdd->data_size = thom_qdd_make_disk( to7_qdd_image(machine), to7qdd->data ); | |
| 598 | 598 | assert( to7qdd->data_idx < sizeof( to7qdd->data ) ); |
| 599 | 599 | } |
| 600 | 600 | |
| r3957 | r3958 | |
| 627 | 627 | /* rebuild disk if needed */ |
| 628 | 628 | if ( !to7qdd->data_size ) |
| 629 | 629 | { |
| 630 | to7qdd->data_size = thom_qdd_make_disk( to7_qdd_image(), to7qdd->data ); | |
| 630 | to7qdd->data_size = thom_qdd_make_disk( to7_qdd_image(machine), to7qdd->data ); | |
| 631 | 631 | assert( to7qdd->data_idx < sizeof( to7qdd->data ) ); |
| 632 | 632 | } |
| 633 | 633 | |
| r3957 | r3958 | |
| 661 | 661 | LOG(( "%f $%04x to7_qdd_write_byte: got id field for sector=%i\n", |
| 662 | 662 | attotime_to_double(timer_get_time(machine)), cpu_get_previouspc( machine->cpu[0] ), sector )); |
| 663 | 663 | |
| 664 | floppy_drive_format_sector( to7_qdd_image(), | |
| 664 | floppy_drive_format_sector( to7_qdd_image(machine), | |
| 665 | 665 | 0, sector, 0, 0, sector, 128, filler ); |
| 666 | 666 | to7qdd->start_idx = to7qdd->data_idx; |
| 667 | 667 | } |
| r3957 | r3958 | |
| 690 | 690 | LOG(( "%f $%04x to7_qdd_write_byte: goto data field for sector=%i\n", |
| 691 | 691 | attotime_to_double(timer_get_time(machine)), cpu_get_previouspc( machine->cpu[0] ), sector )); |
| 692 | 692 | |
| 693 | floppy_drive_write_sector_data( to7_qdd_image(), 0, sector, to7qdd->data + to7qdd->start_idx + 1, 128, 0 ); | |
| 693 | floppy_drive_write_sector_data( to7_qdd_image(machine), 0, sector, to7qdd->data + to7qdd->start_idx + 1, 128, 0 ); | |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | to7qdd->start_idx = to7qdd->data_idx; |
| r3957 | r3958 | |
| 708 | 708 | { |
| 709 | 709 | |
| 710 | 710 | case 0: /* MC6852 status */ |
| 711 | to7_qdd_stat_update(); | |
| 711 | to7_qdd_stat_update(space->machine); | |
| 712 | 712 | VLOG(( "%f $%04x to7_qdd_r: STAT=$%02X irq=%i pe=%i ovr=%i und=%i tr=%i rd=%i ncts=%i\n", |
| 713 | 713 | attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc( space->machine->cpu[0] ), to7qdd->status, |
| 714 | 714 | to7qdd->status & QDD_S_IRQ ? 1 : 0, |
| r3957 | r3958 | |
| 722 | 722 | |
| 723 | 723 | case 1: /* MC6852 data input => read byte from disk */ |
| 724 | 724 | to7qdd->status &= ~(QDD_S_RDA | QDD_S_PE | QDD_S_OVR); |
| 725 | to7_qdd_stat_update(); | |
| 725 | to7_qdd_stat_update(space->machine); | |
| 726 | 726 | return to7_qdd_read_byte( space->machine ); |
| 727 | 727 | |
| 728 | 728 | case 8: /* floppy status */ |
| 729 | 729 | { |
| 730 | 730 | UINT8 data = 0; |
| 731 | const device_config* img = to7_qdd_image(); | |
| 731 | const device_config* img = to7_qdd_image(space->machine); | |
| 732 | 732 | if ( ! image_exists( img ) ) |
| 733 | 733 | data |= 0x40; /* disk present */ |
| 734 | 734 | if ( to7qdd->index_pulse ) |
| r3957 | r3958 | |
| 758 | 758 | to7qdd->status &= ~(QDD_S_TDRA | QDD_S_TUF); |
| 759 | 759 | |
| 760 | 760 | to7qdd->ctrl1 = ( data & ~(QDD_C1_RRESET | QDD_C1_TRESET) ) |( data & (QDD_C1_RRESET | QDD_C1_TRESET) & to7qdd->ctrl1 ); |
| 761 | to7_qdd_stat_update(); | |
| 761 | to7_qdd_stat_update(space->machine); | |
| 762 | 762 | VLOG(( "%f $%04x to7_qdd_w: CTRL1=$%02X reset=%c%c %s%sirq=%c%c\n", |
| 763 | 763 | attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc( space->machine->cpu[0] ), data, |
| 764 | 764 | data & QDD_C1_RRESET ? 'r' : '-', data & QDD_C1_TRESET ? 't' : '-', |
| r3957 | r3958 | |
| 782 | 782 | int bits, parity; |
| 783 | 783 | bits = bit[ (data >> 3) & 7 ]; |
| 784 | 784 | parity = par[ (data >> 3) & 7 ]; |
| 785 | to7_qdd_stat_update(); | |
| 785 | to7_qdd_stat_update(space->machine); | |
| 786 | 786 | VLOG(( "%f $%04x to7_qdd_w: CTRL2=$%02X bits=%i par=%s blen=%i under=%s%s\n", |
| 787 | 787 | attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc( space->machine->cpu[0] ), data, |
| 788 | 788 | bits, parname[ parity ], data & QDD_C2_BLEN ? 1 : 2, |
| r3957 | r3958 | |
| 800 | 800 | to7qdd->status &= ~QDD_S_TUF; |
| 801 | 801 | if ( data & QDD_C3_CLRCTS ) |
| 802 | 802 | to7qdd->status &= ~QDD_S_NCTS; |
| 803 | to7_qdd_stat_update(); | |
| 803 | to7_qdd_stat_update(space->machine); | |
| 804 | 804 | VLOG(( "%f $%04x to7_qdd_w: CTRL3=$%02X %s%ssync-len=%i sync-mode=%s\n", |
| 805 | 805 | attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc( space->machine->cpu[0] ), data, |
| 806 | 806 | data & QDD_C3_CLRTUF ? "clr-tuf " : "", |
| r3957 | r3958 | |
| 846 | 846 | |
| 847 | 847 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 848 | 848 | { |
| 849 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); | |
| 849 | const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i ); | |
| 850 | 850 | floppy_drive_set_index_pulse_callback( img, to7_qdd_index_pulse_cb ); |
| 851 | 851 | floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 ); |
| 852 | 852 | floppy_drive_set_motor_state( img, 1 ); |
| r3957 | r3958 | |
| 859 | 859 | to7qdd->ctrl2 &= 0x7c; /* clear EIE, PC2-PC1 */ |
| 860 | 860 | to7qdd->ctrl3 &= 0xfe; /* internal sync */ |
| 861 | 861 | to7qdd->drive = 0; |
| 862 | to7_qdd_stat_update(); | |
| 862 | to7_qdd_stat_update(machine); | |
| 863 | 863 | } |
| 864 | 864 | |
| 865 | 865 | |
| r3957 | r3958 | |
| 943 | 943 | |
| 944 | 944 | |
| 945 | 945 | |
| 946 | static const device_config * thmfc_floppy_image ( | |
| 946 | static const device_config * thmfc_floppy_image ( running_machine *machine ) | |
| 947 | 947 | { |
| 948 | return image_from_devtype_and_index( IO_FLOPPY, thmfc1->drive ); | |
| 948 | return image_from_devtype_and_index( machine, IO_FLOPPY, thmfc1->drive ); | |
| 949 | 949 | } |
| 950 | 950 | |
| 951 | 951 | |
| r3957 | r3958 | |
| 959 | 959 | |
| 960 | 960 | static void thmfc_floppy_index_pulse_cb ( const device_config *controller,const device_config *image, int state ) |
| 961 | 961 | { |
| 962 | if ( image != thmfc_floppy_image() ) | |
| 962 | if ( image != thmfc_floppy_image(image->machine) ) | |
| 963 | 963 | return; |
| 964 | 964 | |
| 965 | 965 | if ( thmfc_floppy_is_qdd() ) |
| r3957 | r3958 | |
| 1527 | 1527 | |
| 1528 | 1528 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 1529 | 1529 | { |
| 1530 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); | |
| 1530 | const device_config * img = image_from_devtype_and_index( machine, IO_FLOPPY, i ); | |
| 1531 | 1531 | floppy_drive_set_index_pulse_callback( img, thmfc_floppy_index_pulse_cb ); |
| 1532 | 1532 | floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 ); |
| 1533 | 1533 | floppy_drive_seek( img, - floppy_drive_get_current_track( img ) ); |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | #define COCO_VHD DEVICE_GET_INFO_NAME(coco_vhd) |
| 20 | 20 | |
| 21 | 21 | #define MDRV_COCO_VHD_ADD(_tag) \ |
| 22 | MDRV_DEVICE_ADD(_tag, COCO_VHD) \ | |
| 22 | MDRV_DEVICE_ADD(_tag, COCO_VHD, 0) \ | |
| 23 | 23 | |
| 24 | 24 | #endif /* COCOVHD_H */ |
| r3957 | r3958 | |
|---|---|---|
| 153 | 153 | case DEVINFO_FCT_SNAPSHOT_QUICKLOAD_LOAD: info->f = (genf *) get_config(device)->load; break; |
| 154 | 154 | |
| 155 | 155 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 156 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 157 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: info->s = get_config(device)->file_extensions; break; | |
| 156 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 157 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, get_config(device)->file_extensions); break; | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
| r3957 | r3958 | |
| 173 | 173 | case DEVINFO_INT_IMAGE_TYPE: info->i = IO_SNAPSHOT; break; |
| 174 | 174 | |
| 175 | 175 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 176 | case DEVINFO_STR_NAME: info->s = "Snapshot"; break; | |
| 177 | case DEVINFO_STR_FAMILY: info->s = "Snapshot"; break; | |
| 176 | case DEVINFO_STR_NAME: strcpy(info->s, "Snapshot"); break; | |
| 177 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Snapshot"); break; | |
| 178 | 178 | |
| 179 | 179 | default: DEVICE_GET_INFO_CALL(snapquick); break; |
| 180 | 180 | } |
| r3957 | r3958 | |
| 195 | 195 | case DEVINFO_INT_IMAGE_TYPE: info->i = IO_QUICKLOAD; break; |
| 196 | 196 | |
| 197 | 197 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 198 | case DEVINFO_STR_NAME: info->s = "Quickload"; break; | |
| 199 | case DEVINFO_STR_FAMILY: info->s = "Quickload"; break; | |
| 198 | case DEVINFO_STR_NAME: strcpy(info->s, "Quickload"); break; | |
| 199 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Quickload"); break; | |
| 200 | 200 | |
| 201 | 201 | default: DEVICE_GET_INFO_CALL(snapquick); break; |
| 202 | 202 | } |
| r3957 | r3958 | |
|---|---|---|
| 20 | 20 | #define BITBANGER DEVICE_GET_INFO_NAME(bitbanger) |
| 21 | 21 | |
| 22 | 22 | #define MDRV_BITBANGER_ADD(_tag, _intrf) \ |
| 23 | MDRV_DEVICE_ADD(_tag, BITBANGER) \ | |
| 23 | MDRV_DEVICE_ADD(_tag, BITBANGER, 0) \ | |
| 24 | 24 | MDRV_DEVICE_CONFIG(_intrf) |
| 25 | 25 | |
| 26 | 26 |
| r3957 | r3958 | |
|---|---|---|
| 151 | 151 | // LOCAL VARIABLES |
| 152 | 152 | //============================================================ |
| 153 | 153 | |
| 154 | static running_machine *Machine; // HACK - please fix | |
| 155 | ||
| 154 | 156 | static double pixels_to_xdlgunits; |
| 155 | 157 | static double pixels_to_ydlgunits; |
| 156 | 158 | |
| r3957 | r3958 | |
| 1629 | 1631 | |
| 1630 | 1632 | static void before_display_dialog(running_machine *machine) |
| 1631 | 1633 | { |
| 1634 | Machine = machine; | |
| 1635 | ||
| 1632 | 1636 | #ifdef UNDER_CE |
| 1633 | 1637 | // on WinCE, suspend GAPI |
| 1634 | 1638 | gx_suspend(); |
| r3957 | r3958 | |
| 1651 | 1655 | #endif |
| 1652 | 1656 | |
| 1653 | 1657 | winwindow_ui_pause_from_window_thread(machine, FALSE); |
| 1658 | ||
| 1659 | Machine = NULL; | |
| 1654 | 1660 | } |
| 1655 | 1661 | |
| 1656 | 1662 |
| r3957 | r3958 | |
|---|---|---|
| 2112 | 2112 | HMENU menu_bar = NULL; |
| 2113 | 2113 | HMODULE module; |
| 2114 | 2114 | |
| 2115 | if (ui_mess_use_new_ui( | |
| 2115 | if (ui_mess_use_new_ui( | |
| 2116 | 2116 | { |
| 2117 | 2117 | module = win_resource_module(); |
| 2118 | 2118 | menu_bar = LoadMenu(module, MAKEINTRESOURCE(IDR_RUNTIME_MENU)); |
| r3957 | r3958 | |
| 2148 | 2148 | break; |
| 2149 | 2149 | |
| 2150 | 2150 | case WM_PASTE: |
| 2151 | ui_mess_paste(Machine); | |
| 2151 | // FIXME 0.128u7 | |
| 2152 | ui_mess_paste(NULL /*Machine*/); | |
| 2152 | 2153 | break; |
| 2153 | 2154 | |
| 2154 | 2155 | case WM_COMMAND: |
| r3957 | r3958 | |
|---|---|---|
| 399 | 399 | static CDP1861_INTERFACE( vip_cdp1861_intf ) |
| 400 | 400 | { |
| 401 | 401 | SCREEN_TAG, |
| 402 | XTAL_3_52128MHz, | |
| 403 | 402 | vip_int_w, |
| 404 | 403 | vip_dmao_w, |
| 405 | 404 | vip_efx_w |
| r3957 | r3958 | |
| 408 | 407 | static CDP1862_INTERFACE( vip_cdp1862_intf ) |
| 409 | 408 | { |
| 410 | 409 | SCREEN_TAG, |
| 411 | CPD1862_CLOCK, | |
| 412 | 410 | RES_K(1.21), // ??? |
| 413 | 411 | RES_K(2.05), // ??? |
| 414 | 412 | RES_K(2.26), // ??? |
| r3957 | r3958 | |
| 622 | 620 | |
| 623 | 621 | /* reset auxiliary chips */ |
| 624 | 622 | |
| 625 | state->cdp1861->reset(state->cdp1861); | |
| 626 | state->cdp1862->reset(state->cdp1862); | |
| 627 | state->cdp1863->reset(state->cdp1863); | |
| 623 | device_reset(state->cdp1861); | |
| 624 | device_reset(state->cdp1862); | |
| 625 | device_reset(state->cdp1863); | |
| 628 | 626 | |
| 629 | 627 | state->colorram_mwr = CLEAR_LINE; |
| 630 | 628 | |
| r3957 | r3958 | |
| 692 | 690 | MDRV_PALETTE_INIT(black_and_white) |
| 693 | 691 | MDRV_VIDEO_UPDATE(vip) |
| 694 | 692 | |
| 695 | MDRV_DEVICE_ADD(CDP1861_TAG, CDP1861) | |
| 696 | MDRV_DEVICE_CONFIG(vip_cdp1861_intf) | |
| 693 | MDRV_CDP1861_ADD(CDP1861_TAG, XTAL_3_52128MHz, vip_cdp1861_intf) | |
| 697 | 694 | |
| 698 | MDRV_DEVICE_ADD(CDP1862_TAG, CDP1862) | |
| 695 | MDRV_DEVICE_ADD(CDP1862_TAG, CDP1862, CPD1862_CLOCK) | |
| 699 | 696 | MDRV_DEVICE_CONFIG(vip_cdp1862_intf) |
| 700 | 697 | |
| 701 | 698 | /* sound hardware */ |
| 702 | MDRV_DEVICE_ADD(CDP1863_TAG, CDP1863) | |
| 699 | MDRV_DEVICE_ADD(CDP1863_TAG, CDP1863, 0) | |
| 703 | 700 | MDRV_DEVICE_CONFIG(vip_cdp1863_intf) |
| 704 | 701 | |
| 705 | 702 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 31 | 31 | ***************************************************************************/ |
| 32 | 32 | |
| 33 | 33 | #include "driver.h" |
| 34 | ||
| 34 | ||
| 35 | 35 | #include "includes/wswan.h" |
| 36 | 36 | #include "devices/cartslot.h" |
| 37 | 37 | #include "sound/custom.h" |
| r3957 | r3958 | |
| 136 | 136 | MDRV_SCREEN_ADD("main", LCD) |
| 137 | 137 | MDRV_SCREEN_REFRESH_RATE(75) |
| 138 | 138 | MDRV_SCREEN_VBLANK_TIME(0) |
| 139 | MDRV_ | |
| 139 | MDRV_QUANTUM_TIME | |
| 140 | 140 | |
| 141 | 141 | MDRV_NVRAM_HANDLER( wswan ) |
| 142 | 142 |
| r3957 | r3958 | |
|---|---|---|
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "cpu/m68000/m68000.h" | |
| 19 | #include "cpu/z80/z80.h" | |
| 18 | 20 | |
| 19 | 21 | #ifdef GAME |
| 20 | 22 | #undef GAME |
| r3957 | r3958 | |
|---|---|---|
| 132 | 132 | jaguardsp_ctrl_w(machine->cpu[2], D_CTRL, 0, 0); |
| 133 | 133 | |
| 134 | 134 | /* init the sound system */ |
| 135 | cojag_sound_reset(); | |
| 135 | cojag_sound_reset(machine); | |
| 136 | 136 | |
| 137 | 137 | joystick_data = 0xffffffff; |
| 138 | 138 | } |
| r3957 | r3958 | |
| 525 | 525 | offs_t quickload_begin = 0x4000; |
| 526 | 526 | quickload_size = MIN(quickload_size, 0x200000 - quickload_begin); |
| 527 | 527 | image_fread(image, &memory_region(image->machine, "main")[quickload_begin], quickload_size); |
| 528 | cpu_set_reg(image->machine->cpu[0], REG_PC, quickload_begin); | |
| 528 | cpu_set_reg(image->machine->cpu[0], REG_GENPC, quickload_begin); | |
| 529 | 529 | return INIT_PASS; |
| 530 | 530 | } |
| 531 | 531 |
| r3957 | r3958 | |
|---|---|---|
| 35 | 35 | MDRV_CPU_ADD("main", M6502, 2000000) /* 2 MHz */ |
| 36 | 36 | MDRV_CPU_PROGRAM_MAP(apple3_map, 0) |
| 37 | 37 | MDRV_CPU_PERIODIC_INT(apple3_interrupt, 192) |
| 38 | MDRV_ | |
| 38 | MDRV_QUANTUM_TIME | |
| 39 | 39 | |
| 40 | 40 | MDRV_MACHINE_RESET( apple3 ) |
| 41 | 41 |
| r3957 | r3958 | |
|---|---|---|
| 94 | 94 | #include "driver.h" |
| 95 | 95 | #include "includes/3do.h" |
| 96 | 96 | #include "devices/chd_cd.h" |
| 97 | #include "cpu/arm7/arm7.h" | |
| 97 | 98 | |
| 98 | 99 | |
| 99 | 100 | /* The 3DO has an ARM6 core which is a bit different from the current |
| r3957 | r3958 | |
|---|---|---|
| 240 | 240 | MDRV_QUICKLOAD_ADD(cbm_c65, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 241 | 241 | |
| 242 | 242 | /* cia */ |
| 243 | MDRV_DEVICE_ADD("cia_0", CIA6526R1) | |
| 244 | MDRV_DEVICE_CONFIG(c64_ntsc_cia0) | |
| 245 | MDRV_DEVICE_ADD("cia_1", CIA6526R1) | |
| 246 | MDRV_DEVICE_CONFIG(c64_ntsc_cia1) | |
| 243 | MDRV_CIA6526_ADD("cia_0", CIA6526R1, 0, c64_ntsc_cia0) | |
| 244 | MDRV_CIA6526_ADD("cia_1", CIA6526R1, 0, c64_ntsc_cia1) | |
| 247 | 245 | MACHINE_DRIVER_END |
| 248 | 246 | |
| 249 | 247 | static MACHINE_DRIVER_START( c65pal ) |
| r3957 | r3958 | |
|---|---|---|
| 186 | 186 | MDRV_CPU_ADD("main", 8080, 2000000) |
| 187 | 187 | MDRV_CPU_PROGRAM_MAP(dai_mem, 0) |
| 188 | 188 | MDRV_CPU_IO_MAP(dai_io, 0) |
| 189 | MDRV_ | |
| 189 | MDRV_QUANTUM_TIME | |
| 190 | 190 | |
| 191 | 191 | MDRV_MACHINE_START( dai ) |
| 192 | 192 |
| r3957 | r3958 | |
|---|---|---|
| 94 | 94 | ******************************************************************************/ |
| 95 | 95 | |
| 96 | 96 | #include "driver.h" |
| 97 | #include "cpu/z80/z80.h" | |
| 97 | 98 | #include "includes/nc.h" |
| 98 | 99 | #include "includes/serial.h" /* for serial data transfers */ |
| 99 | 100 | #include "machine/msm8251.h" /* for NC100 uart */ |
| r3957 | r3958 | |
| 1371 | 1372 | nc_common_init_machine(machine); |
| 1372 | 1373 | |
| 1373 | 1374 | /* double sided, 80 track drive */ |
| 1374 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 1375 | //floppy_drive_set_index_pulse_callback(image_from_devtype_and_index(IO_FLOPPY, 0), nc200_floppy_drive_index_callback); | |
| 1375 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 1376 | //floppy_drive_set_index_pulse_callback(image_from_devtype_and_index(machine, IO_FLOPPY, 0), nc200_floppy_drive_index_callback); | |
| 1376 | 1377 | |
| 1377 | 1378 | mc146818_init(machine, MC146818_STANDARD); |
| 1378 | 1379 | |
| r3957 | r3958 | |
| 1679 | 1680 | MDRV_CPU_ADD("main", Z80, /*6000000*/ 4606000) /* Russell Marks says this is more accurate */ |
| 1680 | 1681 | MDRV_CPU_PROGRAM_MAP(nc_map, 0) |
| 1681 | 1682 | MDRV_CPU_IO_MAP(nc100_io, 0) |
| 1682 | MDRV_ | |
| 1683 | MDRV_QUANTUM_TIME | |
| 1683 | 1684 | |
| 1684 | 1685 | MDRV_MACHINE_START( nc100 ) |
| 1685 | 1686 | MDRV_MACHINE_RESET( nc100 ) |
| r3957 | r3958 | |
|---|---|---|
| 149 | 149 | MDRV_SCREEN_ADD("main", RASTER) |
| 150 | 150 | MDRV_SCREEN_REFRESH_RATE(60.15) |
| 151 | 151 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260)) |
| 152 | MDRV_ | |
| 152 | MDRV_QUANTUM_TIME | |
| 153 | 153 | |
| 154 | 154 | MDRV_MACHINE_RESET( mac ) |
| 155 | 155 |
| r3957 | r3958 | |
|---|---|---|
| 598 | 598 | |
| 599 | 599 | static MACHINE_RESET( adam ) |
| 600 | 600 | { |
| 601 | if (image_exists(image_from_devtype_and_index(IO_CARTSLOT, 0))) | |
| 601 | if (image_exists(image_from_devtype_and_index(machine, IO_CARTSLOT, 0))) | |
| 602 | 602 | { |
| 603 | 603 | /* ColecoVision Mode Reset (Cartridge Mounted) */ |
| 604 | 604 | adam_lower_memory = 3; /* OS7 + 24k RAM */ |
| r3957 | r3958 | |
|---|---|---|
| 326 | 326 | |
| 327 | 327 | static const mc6845_interface cbm600_crtc = { |
| 328 | 328 | "main", |
| 329 | XTAL_18MHz / 8 /*?*/, /* I do not know if this is correct, please verify */ | |
| 330 | 329 | 8 /*?*/, |
| 331 | 330 | NULL, |
| 332 | 331 | cbm600_update_row, |
| r3957 | r3958 | |
| 337 | 336 | }; |
| 338 | 337 | |
| 339 | 338 | static const mc6845_interface cbm700_crtc = { |
| 340 | "main", | |
| 341 | XTAL_18MHz / 8 /*?*/, /* I do not know if this is correct, please verify */ | |
| 339 | "main", | |
| 342 | 340 | 9 /*?*/, |
| 343 | 341 | NULL, |
| 344 | 342 | cbm700_update_row, |
| r3957 | r3958 | |
| 374 | 372 | MDRV_PALETTE_LENGTH(sizeof (cbm700_palette) / sizeof (cbm700_palette[0]) / 3) |
| 375 | 373 | MDRV_PALETTE_INIT( cbm700 ) |
| 376 | 374 | |
| 377 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 378 | MDRV_DEVICE_CONFIG( cbm600_crtc ) | |
| 375 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_18MHz / 8 /*?*/ /* I do not know if this is correct, please verify */, cbm600_crtc) | |
| 379 | 376 | |
| 380 | 377 | MDRV_VIDEO_START( cbmb_crtc ) |
| 381 | 378 | MDRV_VIDEO_UPDATE( cbmb_crtc ) |
| r3957 | r3958 | |
| 389 | 386 | MDRV_QUICKLOAD_ADD(cbmb, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 390 | 387 | |
| 391 | 388 | /* cia */ |
| 392 | MDRV_DEVICE_ADD("cia", CIA6526R1) | |
| 393 | MDRV_DEVICE_CONFIG(cbmb_cia) | |
| 389 | MDRV_CIA6526_ADD("cia", CIA6526R1, 0, cbmb_cia) | |
| 394 | 390 | MACHINE_DRIVER_END |
| 395 | 391 | |
| 396 | 392 | |
| r3957 | r3958 | |
| 408 | 404 | MDRV_SCREEN_VISIBLE_AREA(0, 720 - 1, 0, 350 - 1) |
| 409 | 405 | MDRV_GFXDECODE( cbm700 ) |
| 410 | 406 | |
| 411 | MDRV_DEVICE_MODIFY("crtc", MC6845) | |
| 412 | MDRV_DEVICE_CONFIG( cbm700_crtc ) | |
| 407 | MDRV_MC6845_REMOVE("crtc", MC6845) | |
| 408 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_18MHz / 8 /*? I do not know if this is correct, please verify */, cbm700_crtc) | |
| 413 | 409 | |
| 414 | 410 | MDRV_VIDEO_START( cbm700 ) |
| 415 | 411 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 452 | 448 | MDRV_QUICKLOAD_ADD(p500, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
| 453 | 449 | |
| 454 | 450 | /* cia */ |
| 455 | MDRV_DEVICE_ADD("cia", CIA6526R1) | |
| 456 | MDRV_DEVICE_CONFIG(cbmb_cia) | |
| 451 | MDRV_CIA6526_ADD("cia", CIA6526R1, 0, cbmb_cia) | |
| 457 | 452 | MACHINE_DRIVER_END |
| 458 | 453 | |
| 459 | 454 |
| r3957 | r3958 | |
|---|---|---|
| 296 | 296 | |
| 297 | 297 | static const z80ctc_interface sord_m5_ctc_intf = |
| 298 | 298 | { |
| 299 | "main", | |
| 300 | 3800000, | |
| 301 | 299 | 0, |
| 302 | 300 | sord_m5_ctc_interrupt, |
| 303 | 301 | 0, |
| r3957 | r3958 | |
| 625 | 623 | MDRV_CPU_IO_MAP(sord_m5_io, 0) |
| 626 | 624 | MDRV_CPU_VBLANK_INT("main", sord_interrupt) |
| 627 | 625 | MDRV_CPU_CONFIG( sord_m5_daisy_chain ) |
| 628 | MDRV_ | |
| 626 | MDRV_QUANTUM_TIME | |
| 629 | 627 | |
| 630 | 628 | MDRV_MACHINE_START( sord_m5 ) |
| 631 | 629 | MDRV_MACHINE_RESET( sord_m5 ) |
| 632 | 630 | |
| 633 | 631 | MDRV_PPI8255_ADD( "ppi8255", sord_ppi8255_interface ) |
| 634 | 632 | |
| 635 | MDRV_Z80CTC_ADD( "z80ctc", sord_m5_ctc_intf ) | |
| 633 | MDRV_Z80CTC_ADD( "z80ctc", 3800000, sord_m5_ctc_intf ) | |
| 636 | 634 | |
| 637 | 635 | /* video hardware */ |
| 638 | 636 | MDRV_IMPORT_FROM(tms9928a) |
| r3957 | r3958 | |
| 663 | 661 | MDRV_CPU_PROGRAM_MAP(sord_fd5_mem, 0) |
| 664 | 662 | MDRV_CPU_IO_MAP(sord_fd5_io, 0) |
| 665 | 663 | |
| 666 | MDRV_ | |
| 664 | MDRV_QUANTUM_TIME | |
| 667 | 665 | MDRV_MACHINE_RESET( sord_m5_fd5 ) |
| 668 | 666 | |
| 669 | 667 | MDRV_NEC765A_ADD("nec765", sord_fd5_nec765_interface) |
| r3957 | r3958 | |
|---|---|---|
| 554 | 554 | if (autorun) |
| 555 | 555 | { |
| 556 | 556 | memory_write_word_16le(space, 0xa2, execute_address); /* fix warm-start vector to get around some copy-protections */ |
| 557 | cpu_set_reg(cpu, REG_PC, execute_address); | |
| 557 | cpu_set_reg(cpu, REG_GENPC, execute_address); | |
| 558 | 558 | } |
| 559 | 559 | else |
| 560 | 560 | { |
| r3957 | r3958 | |
| 587 | 587 | if (sw) |
| 588 | 588 | { |
| 589 | 589 | memory_write_word_16le(space, 0xa2,0x801e); /* fix warm-start vector to get around some copy-protections */ |
| 590 | cpu_set_reg(cpu, REG_PC, 0x801e); | |
| 590 | cpu_set_reg(cpu, REG_GENPC, 0x801e); | |
| 591 | 591 | } |
| 592 | 592 | else |
| 593 | 593 | memory_write_word_16le(space, 0xa2,0x8517); |
| r3957 | r3958 | |
| 607 | 607 | return INIT_FAIL; |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | if (sw) cpu_set_reg(cpu, REG_PC, 0x100); | |
| 610 | if (sw) cpu_set_reg(cpu, REG_GENPC, 0x100); | |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | return INIT_PASS; |
| r3957 | r3958 | |
|---|---|---|
| 66 | 66 | MDRV_CPU_ADD( "main", MINX, 4000000 ) |
| 67 | 67 | MDRV_CPU_PROGRAM_MAP( pokemini_mem_map, 0 ) |
| 68 | 68 | |
| 69 | MDRV_ | |
| 69 | MDRV_QUANTUM_TIME | |
| 70 | 70 | |
| 71 | 71 | MDRV_MACHINE_RESET( pokemini ) |
| 72 | 72 |
| r3957 | r3958 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | static DIRECT_UPDATE_HANDLER( pentagon_direct ) |
| 18 | 18 | { |
| 19 | UINT16 pc = cpu_get_reg(space->machine->cpu[0], REG_ | |
| 19 | UINT16 pc = cpu_get_reg(space->machine->cpu[0], REG_G | |
| 20 | 20 | if (betadisk_is_active()) { |
| 21 | 21 | if (pc >= 0x4000) { |
| 22 | 22 | ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ? 1 : 0; |
| r3957 | r3958 | |
|---|---|---|
| 736 | 736 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 737 | 737 | |
| 738 | 738 | /* acia */ |
| 739 | MDRV_ | |
| 739 | MDRV_A | |
| 740 | 740 | |
| 741 | 741 | MDRV_WD179X_ADD("wd179x", dragon_wd17xx_interface ) |
| 742 | 742 | |
| r3957 | r3958 | |
| 775 | 775 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 776 | 776 | |
| 777 | 777 | /* acia */ |
| 778 | MDRV_ | |
| 778 | MDRV_A | |
| 779 | 779 | |
| 780 | 780 | MDRV_WD179X_ADD("wd179x", dgnalpha_wd17xx_interface ) |
| 781 | 781 | |
| r3957 | r3958 | |
| 811 | 811 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 812 | 812 | |
| 813 | 813 | /* acia */ |
| 814 | MDRV_ | |
| 814 | MDRV_A | |
| 815 | 815 | |
| 816 | 816 | MDRV_WD1773_ADD("wd1773", coco_wd17xx_interface ) |
| 817 | 817 | |
| r3957 | r3958 | |
| 845 | 845 | MDRV_QUICKLOAD_ADD(coco, "bin", 0.5) |
| 846 | 846 | |
| 847 | 847 | /* devices */ |
| 848 | MDRV_ | |
| 848 | MDRV_MSM6242_ADD("disto" | |
| 849 | 849 | |
| 850 | 850 | /* cassette */ |
| 851 | 851 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| r3957 | r3958 | |
| 882 | 882 | MDRV_QUICKLOAD_ADD(coco, "bin", 0.5) |
| 883 | 883 | |
| 884 | 884 | /* devices */ |
| 885 | MDRV_ | |
| 885 | MDRV_MSM6242_ADD("disto" | |
| 886 | 886 | |
| 887 | 887 | /* cassette */ |
| 888 | 888 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| r3957 | r3958 | |
| 919 | 919 | MDRV_QUICKLOAD_ADD(coco, "bin", 0.5) |
| 920 | 920 | |
| 921 | 921 | /* devices */ |
| 922 | MDRV_ | |
| 922 | MDRV_MSM6242_ADD("disto" | |
| 923 | 923 | |
| 924 | 924 | /* cassette */ |
| 925 | 925 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| r3957 | r3958 | |
| 966 | 966 | |
| 967 | 967 | /* devices */ |
| 968 | 968 | MDRV_COCO_VHD_ADD("vhd") |
| 969 | MDRV_ | |
| 969 | MDRV_MSM6242_ADD("disto" | |
| 970 | 970 | |
| 971 | 971 | /* cassette */ |
| 972 | 972 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| r3957 | r3958 | |
|---|---|---|
| 725 | 725 | MDRV_CPU_PROGRAM_MAP(pc1401_mem, 0) |
| 726 | 726 | MDRV_CPU_CONFIG(config) |
| 727 | 727 | |
| 728 | MDRV_ | |
| 728 | MDRV_QUANTUM_TIME | |
| 729 | 729 | |
| 730 | 730 | MDRV_NVRAM_HANDLER( pc1401 ) |
| 731 | 731 |
| r3957 | r3958 | |
|---|---|---|
| 166 | 166 | MDRV_CPU_ADD( "main", F8, MAIN_CLOCK ) /* MK3850 */ |
| 167 | 167 | MDRV_CPU_PROGRAM_MAP( mk1_mem, 0 ) |
| 168 | 168 | MDRV_CPU_IO_MAP( mk1_io, 0 ) |
| 169 | MDRV_ | |
| 169 | MDRV_QUANTUM_TIME | |
| 170 | 170 | |
| 171 | 171 | MDRV_MACHINE_START( mk1 ) |
| 172 | 172 | MDRV_MACHINE_RESET( mk1 ) |
| r3957 | r3958 | |
|---|---|---|
| 563 | 563 | MDRV_SCREEN_ADD("main", LCD) |
| 564 | 564 | MDRV_SCREEN_REFRESH_RATE(DMG_FRAMES_PER_SECOND) |
| 565 | 565 | MDRV_SCREEN_VBLANK_TIME(0) |
| 566 | MDRV_ | |
| 566 | MDRV_QUANTUM_TIME | |
| 567 | 567 | |
| 568 | 568 | MDRV_MACHINE_START( gb ) |
| 569 | 569 | MDRV_MACHINE_RESET( gb ) |
| r3957 | r3958 | |
| 681 | 681 | MDRV_SCREEN_ADD("main", LCD) |
| 682 | 682 | MDRV_SCREEN_REFRESH_RATE(DMG_FRAMES_PER_SECOND) |
| 683 | 683 | MDRV_SCREEN_VBLANK_TIME(0) |
| 684 | MDRV_ | |
| 684 | MDRV_QUANTUM_TIME | |
| 685 | 685 | |
| 686 | 686 | MDRV_MACHINE_RESET( megaduck ) |
| 687 | 687 |
| r3957 | r3958 | |
|---|---|---|
| 728 | 728 | MDRV_CPU_ADD("main", Z80, 3276800) |
| 729 | 729 | MDRV_CPU_PROGRAM_MAP(z88_mem, 0) |
| 730 | 730 | MDRV_CPU_IO_MAP(z88_io, 0) |
| 731 | MDRV_ | |
| 731 | MDRV_QUANTUM_TIME | |
| 732 | 732 | |
| 733 | 733 | MDRV_MACHINE_RESET( z88 ) |
| 734 | 734 |
| r3957 | r3958 | |
|---|---|---|
| 68 | 68 | MDRV_CPU_PROGRAM_MAP(concept_memmap, 0) |
| 69 | 69 | MDRV_CPU_VBLANK_INT("main", concept_interrupt) |
| 70 | 70 | |
| 71 | MDRV_ | |
| 71 | MDRV_QUANTUM_TIME | |
| 72 | 72 | MDRV_MACHINE_START(concept) |
| 73 | 73 | |
| 74 | 74 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 1400 | 1400 | MDRV_CPU_ADD("main", Z80, 16000000) |
| 1401 | 1401 | MDRV_CPU_PROGRAM_MAP(pcw16_map, 0) |
| 1402 | 1402 | MDRV_CPU_IO_MAP(pcw16_io, 0) |
| 1403 | MDRV_ | |
| 1403 | MDRV_QUANTUM_TIME | |
| 1404 | 1404 | |
| 1405 | 1405 | MDRV_MACHINE_RESET( pcw16 ) |
| 1406 | 1406 | MDRV_NVRAM_HANDLER( pcw16 ) |
| r3957 | r3958 | |
|---|---|---|
| 107 | 107 | static INPUT_CHANGED( kim1_reset ) |
| 108 | 108 | { |
| 109 | 109 | if (newval == 0) |
| 110 | c | |
| 110 | device | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r3957 | r3958 | |
| 325 | 325 | /* basic machine hardware */ |
| 326 | 326 | MDRV_CPU_ADD("main", M6502, 1000000) /* 1 MHz */ |
| 327 | 327 | MDRV_CPU_PROGRAM_MAP(kim1_map, 0) |
| 328 | MDRV_ | |
| 328 | MDRV_QUANTUM_TIME | |
| 329 | 329 | |
| 330 | 330 | MDRV_MACHINE_START( kim1 ) |
| 331 | 331 | MDRV_MACHINE_RESET( kim1 ) |
| r3957 | r3958 | |
|---|---|---|
| 1034 | 1034 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1035 | 1035 | MDRV_CPU_IO_MAP(readport,writeport) |
| 1036 | 1036 | MDRV_CPU_VBLANK_INT("main", msx_interrupt) |
| 1037 | MDRV_ | |
| 1037 | MDRV_QUANTUM_TIME | |
| 1038 | 1038 | |
| 1039 | 1039 | MDRV_MACHINE_START( msx ) |
| 1040 | 1040 | MDRV_MACHINE_RESET( msx ) |
| r3957 | r3958 | |
| 1091 | 1091 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 1092 | 1092 | MDRV_CPU_IO_MAP(readport2,writeport2) |
| 1093 | 1093 | MDRV_CPU_VBLANK_INT_HACK(msx2_interrupt, 262) |
| 1094 | MDRV_ | |
| 1094 | MDRV_QUANTUM_TIME | |
| 1095 | 1095 | |
| 1096 | 1096 | MDRV_MACHINE_START( msx2 ) |
| 1097 | 1097 | MDRV_MACHINE_RESET( msx2 ) |
| r3957 | r3958 | |
|---|---|---|
| 97 | 97 | MDRV_SCREEN_ADD("main", LCD) |
| 98 | 98 | MDRV_SCREEN_REFRESH_RATE( 59.732155 ) |
| 99 | 99 | MDRV_SCREEN_VBLANK_TIME(0) |
| 100 | MDRV_ | |
| 100 | MDRV_QUANTUM_TIME | |
| 101 | 101 | |
| 102 | 102 | MDRV_MACHINE_RESET( gamecom ) |
| 103 | 103 |
| r3957 | r3958 | |
|---|---|---|
| 306 | 306 | MDRV_SOUND_ADD("cassette", WAVE, 0) |
| 307 | 307 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 308 | 308 | |
| 309 | MDRV_DEVICE_ADD("dma8257", DMA8257) | |
| 310 | MDRV_DEVICE_CONFIG(radio86_dma) | |
| 309 | MDRV_DMA8257_ADD("dma8257", XTAL_16MHz / 9, radio86_dma) | |
| 311 | 310 | |
| 312 | 311 | MDRV_CASSETTE_ADD( "cassette", radio86_cassette_config ) |
| 313 | 312 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 322 | 321 | direct->decrypted = radio16_io_mirror; |
| 323 | 322 | direct->min = 0x4000; |
| 324 | 323 | direct->max = 0x7fff; |
| 325 | radio16_io_mirror[address] = cpu_get_reg(space->machine->cpu[0], I808 | |
| 324 | radio16_io_mirror[address] = cpu_get_reg(space->machine->cpu[0], I8085_STATUS); | |
| 326 | 325 | } |
| 327 | 326 | return address; |
| 328 | 327 | } |
| r3957 | r3958 | |
|---|---|---|
| 447 | 447 | MDRV_CPU_PROGRAM_MAP(arcadia_mem, 0) |
| 448 | 448 | MDRV_CPU_IO_MAP(arcadia_io, 0) |
| 449 | 449 | MDRV_CPU_PERIODIC_INT(arcadia_video_line, 262*60) |
| 450 | MDRV_ | |
| 450 | MDRV_QUANTUM_TIME | |
| 451 | 451 | |
| 452 | 452 | /* video hardware */ |
| 453 | 453 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 757 | 757 | MDRV_ACIA6551_ADD("acia") |
| 758 | 758 | |
| 759 | 759 | /* modem */ |
| 760 | MDRV_DEVICE_ADD( "acia6850", ACIA6850 ) | |
| 761 | MDRV_DEVICE_CONFIG( to7_modem ) | |
| 760 | MDRV_ACIA6850_ADD( "acia6850", to7_modem ) | |
| 762 | 761 | |
| 763 | 762 | MDRV_WD2793_ADD("wd2793", default_wd17xx_interface ) |
| 764 | 763 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 10 | 10 | ******************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | ||
| 13 | ||
| 14 | 14 | #include "devices/cartslot.h" |
| 15 | 15 | #include "machine/pic8259.h" |
| 16 | 16 | #include "machine/pit8253.h" |
| r3957 | r3958 | |
|---|---|---|
| 97 | 97 | MDRV_CPU_ADD("fdc", M6502, 2000000) /* 16.000 MHz / 8 in when DIS asserted, 16.000 MHz / 9 otherwise (?) */ |
| 98 | 98 | MDRV_CPU_PROGRAM_MAP(lisa_fdc_map, 0) |
| 99 | 99 | |
| 100 | MDRV_ | |
| 100 | MDRV_QUANTUM_TIME | |
| 101 | 101 | MDRV_MACHINE_RESET( lisa ) |
| 102 | 102 | |
| 103 | 103 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r3957 | r3958 | |
|---|---|---|
| 76 | 76 | MDRV_CPU_ADD("main", M65SC02, 4000000) /* vti core, integrated in vlsi, stz, but not bbr bbs */ |
| 77 | 77 | MDRV_CPU_PROGRAM_MAP(lynx_mem, 0) |
| 78 | 78 | MDRV_CPU_VBLANK_INT("main", lynx_frame_int) |
| 79 | MDRV_ | |
| 79 | MDRV_QUANTUM_TIME | |
| 80 | 80 | |
| 81 | 81 | MDRV_MACHINE_START( lynx ) |
| 82 | 82 |
| r3957 | r3958 | |
|---|---|---|
| 405 | 405 | MDRV_CPU_IO_MAP(cgenie_io, 0) |
| 406 | 406 | MDRV_CPU_VBLANK_INT("main", cgenie_frame_interrupt) |
| 407 | 407 | MDRV_CPU_PERIODIC_INT(cgenie_timer_interrupt, 40) |
| 408 | MDRV_ | |
| 408 | MDRV_QUANTUM_TIME | |
| 409 | 409 | |
| 410 | 410 | MDRV_MACHINE_START( cgenie ) |
| 411 | 411 | MDRV_MACHINE_RESET( cgenie ) |
| r3957 | r3958 | |
|---|---|---|
| 221 | 221 | |
| 222 | 222 | static DIRECT_UPDATE_HANDLER( scorpion_direct ) |
| 223 | 223 | { |
| 224 | UINT16 pc = cpu_get_reg(space->machine->cpu[0], REG_ | |
| 224 | UINT16 pc = cpu_get_reg(space->machine->cpu[0], REG_G | |
| 225 | 225 | if (betadisk_is_active()) { |
| 226 | 226 | if (pc >= 0x4000) { |
| 227 | 227 | ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ? 1 : 0; |
| r3957 | r3958 | |
|---|---|---|
| 312 | 312 | |
| 313 | 313 | static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w) |
| 314 | 314 | { |
| 315 | /* D0-D1: ROM/RAM paging */ | |
| 316 | /* D2: Affects if d0-d1 work on ram/rom */ | |
| 317 | /* D3 - Disk motor on/off */ | |
| 318 | /* D4 - parallel port strobe */ | |
| 315 | 319 | |
| 316 | /* D0-D1: ROM/RAM paging */ | |
| 317 | /* D2: Affects if d0-d1 work on ram/rom */ | |
| 318 | /* D3 - Disk motor on/off */ | |
| 319 | /* D4 - parallel port strobe */ | |
| 320 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), data & (1<<3)); | |
| 321 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), data & (1<<3)); | |
| 322 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 1, 1); | |
| 323 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), 1, 1); | |
| 320 | 324 | |
| 321 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), data & (1<<3)); | |
| 322 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 1), data & (1<<3)); | |
| 323 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 1); | |
| 324 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 1), 1, 1); | |
| 325 | spectrum_plus3_port_1ffd_data = data; | |
| 325 | 326 | |
| 326 | spectrum_plus3_port_1ffd_data = data; | |
| 327 | ||
| 328 | /* disable paging? */ | |
| 329 | if ((spectrum_128_port_7ffd_data & 0x20)==0) | |
| 330 | { | |
| 331 | /* no */ | |
| 332 | spectrum_plus3_update_memory(space->machine); | |
| 333 | } | |
| 327 | /* disable paging? */ | |
| 328 | if ((spectrum_128_port_7ffd_data & 0x20)==0) | |
| 329 | { | |
| 330 | /* no */ | |
| 331 | spectrum_plus3_update_memory(space->machine); | |
| 332 | } | |
| 334 | 333 | } |
| 335 | 334 | |
| 336 | 335 | /* ports are not decoded full. |
| r3957 | r3958 | |
| 351 | 350 | { |
| 352 | 351 | memset(mess_ram,0,128*1024); |
| 353 | 352 | |
| 354 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); | |
| 355 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 1), FLOPPY_DRIVE_SS_40); | |
| 353 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); | |
| 354 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 1), FLOPPY_DRIVE_SS_40); | |
| 356 | 355 | |
| 357 | 356 | /* Initial configuration */ |
| 358 | 357 | spectrum_128_port_7ffd_data = 0; |
| r3957 | r3958 | |
|---|---|---|
| 545 | 545 | MDRV_CPU_ADD("main", 8080, 2000000) /* 2.048MHz ??? */ |
| 546 | 546 | MDRV_CPU_PROGRAM_MAP(pmd85_mem, 0) |
| 547 | 547 | MDRV_CPU_IO_MAP(pmd85_io_map, 0) |
| 548 | MDRV_ | |
| 548 | MDRV_QUANTUM_TIME | |
| 549 | 549 | |
| 550 | 550 | MDRV_MACHINE_RESET( pmd85 ) |
| 551 | 551 |
| r3957 | r3958 | |
|---|---|---|
| 216 | 216 | abc80_keyboard_scan(timer->machine); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | static READ8_DEVICE_HANDLER(z80pio_alt_r) | |
| 220 | { | |
| 221 | int channel = BIT(offset, 1); | |
| 222 | return (offset & 1) ? z80pio_c_r(device, channel) : z80pio_d_r(device, channel); | |
| 223 | } | |
| 224 | ||
| 225 | static WRITE8_DEVICE_HANDLER(z80pio_alt_w) | |
| 226 | { | |
| 227 | int channel = BIT(offset, 1); | |
| 228 | if (offset & 1) | |
| 229 | z80pio_c_w(device, channel, data); | |
| 230 | else | |
| 231 | z80pio_d_w(device, channel, data); | |
| 232 | } | |
| 233 | ||
| 219 | 234 | /* Memory Maps */ |
| 220 | 235 | |
| 221 | 236 | static ADDRESS_MAP_START( abc80_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r3957 | r3958 | |
| 364 | 379 | z80pio_astb_w(state->z80pio, state->z80pio_astb); |
| 365 | 380 | } |
| 366 | 381 | |
| 367 | static | |
| 382 | static void | |
| 368 | 383 | { |
| 369 | 384 | cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_IRQ0, state); |
| 370 | 385 | } |
| r3957 | r3958 | |
| 440 | 455 | cassette_output(cassette_device_image(device->machine), BIT(data, 6) ? -1.0 : +1.0); |
| 441 | 456 | }; |
| 442 | 457 | |
| 443 | static | |
| 458 | static const z80pio_interface | |
| 444 | 459 | { |
| 445 | Z80_TAG, /* CPU */ | |
| 446 | 0, /* clock (get from main CPU) */ | |
| 447 | 460 | abc80_pio_interrupt, /* callback when change interrupt status */ |
| 448 | 461 | abc80_pio_port_a_r, /* port A read callback */ |
| 449 | 462 | abc80_pio_port_b_r, /* port B read callback */ |
| r3957 | r3958 | |
|---|---|---|
| 746 | 746 | output_set_indexed_value("eject_drv",drive,(data & 0x40) ? 1 : 0); |
| 747 | 747 | if(data & 0x20) // ejects disk |
| 748 | 748 | { |
| 749 | image_unload(image_from_devtype_and_index(IO_FLOPPY, drive)); | |
| 750 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, drive), 0); // I'll presume ejecting the disk stops the drive motor :) | |
| 749 | image_unload(image_from_devtype_and_index(space->machine, IO_FLOPPY, drive)); | |
| 750 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, drive), 0); // I'll presume ejecting the disk stops the drive motor :) | |
| 751 | 751 | } |
| 752 | 752 | } |
| 753 | 753 | } |
| r3957 | r3958 | |
| 757 | 757 | case 0x03: |
| 758 | 758 | sys.fdc.media_density[data & 0x03] = data & 0x10; |
| 759 | 759 | sys.fdc.motor[data & 0x03] = data & 0x80; |
| 760 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, data & 0x03), (data & 0x80)); | |
| 760 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, data & 0x03), (data & 0x80)); | |
| 761 | 761 | if(data & 0x80) |
| 762 | 762 | { |
| 763 | 763 | for(drive=0;drive<4;drive++) // enable motor for this drive |
| 764 | 764 | { |
| 765 | 765 | if(drive == (data & 0x03)) |
| 766 | 766 | { |
| 767 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, drive), 1); | |
| 767 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, drive), 1); | |
| 768 | 768 | output_set_indexed_value("access_drv",drive,0); |
| 769 | 769 | } |
| 770 | 770 | else |
| r3957 | r3958 | |
| 775 | 775 | { |
| 776 | 776 | for(drive=0;drive<4;drive++) |
| 777 | 777 | { |
| 778 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, drive), 0); | |
| 778 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, drive), 0); | |
| 779 | 779 | output_set_indexed_value("access_drv",drive,1); |
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0),1,1); | |
| 783 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 1),1,1); | |
| 784 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 2),1,1); | |
| 785 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 3),1,1); | |
| 782 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0),1,1); | |
| 783 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1),1,1); | |
| 784 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 2),1,1); | |
| 785 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 3),1,1); | |
| 786 | 786 | // for(drive=0;drive<4;drive++) |
| 787 | 787 | // { |
| 788 | // if(floppy_drive_get_flag_state(image_from_devtype_and_index(IO_FLOPPY, drive),FLOPPY_DRIVE_MOTOR_ON)) | |
| 788 | // if(floppy_drive_get_flag_state(image_from_devtype_and_index(machine, IO_FLOPPY, drive),FLOPPY_DRIVE_MOTOR_ON)) | |
| 789 | 789 | // output_set_indexed_value("access_drv",drive,0); |
| 790 | 790 | // else |
| 791 | 791 | // output_set_indexed_value("access_drv",drive,1); |
| r3957 | r3958 | |
| 1391 | 1391 | if(mess_ram[0x09] != 0x02) // normal vector for bus errors points to 02FF0540 |
| 1392 | 1392 | { |
| 1393 | 1393 | int addr = (mess_ram[0x09] << 24) | (mess_ram[0x08] << 16) |(mess_ram[0x0b] << 8) | mess_ram[0x0a]; |
| 1394 | int sp = cpu_get_reg(machine->cpu[0],REG_SP); | |
| 1395 | int pc = cpu_get_reg(machine->cpu[0],REG_PC); | |
| 1394 | int sp = cpu_get_reg(machine->cpu[0],REG_GENSP); | |
| 1395 | int pc = cpu_get_reg(machine->cpu[0],REG_GENPC); | |
| 1396 | 1396 | int sr = cpu_get_reg(machine->cpu[0],M68K_SR); |
| 1397 | 1397 | //int pda = cpu_get_reg(machine->cpu[0],M68K_PREF_DATA); |
| 1398 | cpu_set_reg(machine->cpu[0],REG_SP,sp-14); | |
| 1398 | cpu_set_reg(machine->cpu[0],REG_GENSP,sp-14); | |
| 1399 | 1399 | mess_ram[sp-11] = (val & 0xff000000) >> 24; |
| 1400 | 1400 | mess_ram[sp-12] = (val & 0x00ff0000) >> 16; |
| 1401 | 1401 | mess_ram[sp-9] = (val & 0x0000ff00) >> 8; |
| r3957 | r3958 | |
| 1406 | 1406 | mess_ram[sp-2] = (pc & 0x000000ff); // place PC onto the stack |
| 1407 | 1407 | mess_ram[sp-5] = (sr & 0xff00) >> 8; |
| 1408 | 1408 | mess_ram[sp-6] = (sr & 0x00ff); // place SR onto the stack |
| 1409 | cpu_set_reg(machine->cpu[0],REG_PC,addr); // real exceptions seem to take too long to be acknowledged | |
| 1409 | cpu_set_reg(machine->cpu[0],REG_GENPC,addr); // real exceptions seem to take too long to be acknowledged | |
| 1410 | 1410 | popmessage("Expansion access [%08x]: PC jump to %08x",val,addr); |
| 1411 | 1411 | } |
| 1412 | 1412 | } |
| r3957 | r3958 | |
| 1999 | 1999 | // check for disks |
| 2000 | 2000 | for(drive=0;drive<4;drive++) |
| 2001 | 2001 | { |
| 2002 | if(image_exists(image_from_devtype_and_index(IO_FLOPPY,drive))) | |
| 2002 | if(image_exists(image_from_devtype_and_index(machine, IO_FLOPPY,drive))) | |
| 2003 | 2003 | sys.fdc.disk_inserted[drive] = 1; |
| 2004 | 2004 | else |
| 2005 | 2005 | sys.fdc.disk_inserted[drive] = 0; |
| r3957 | r3958 | |
| 2046 | 2046 | } |
| 2047 | 2047 | |
| 2048 | 2048 | // reset CPU |
| 2049 | c | |
| 2049 | device | |
| 2050 | 2050 | } |
| 2051 | 2051 | |
| 2052 | 2052 | static MACHINE_START( x68000 ) |
| r3957 | r3958 | |
| 2130 | 2130 | MDRV_CPU_ADD("main", M68000, 10000000) /* 10 MHz */ |
| 2131 | 2131 | MDRV_CPU_PROGRAM_MAP(x68k_map, 0) |
| 2132 | 2132 | MDRV_CPU_VBLANK_INT("main", x68k_vsync_irq) |
| 2133 | MDRV_ | |
| 2133 | MDRV_QUANTUM_TIME | |
| 2134 | 2134 | |
| 2135 | 2135 | MDRV_MACHINE_START( x68000 ) |
| 2136 | 2136 | MDRV_MACHINE_RESET( x68000 ) |
| r3957 | r3958 | |
| 2140 | 2140 | |
| 2141 | 2141 | MDRV_PPI8255_ADD( "ppi8255", ppi_interface ) |
| 2142 | 2142 | |
| 2143 | MDRV_DEVICE_ADD( "hd63450", HD63450 ) | |
| 2144 | MDRV_DEVICE_CONFIG( dmac_interface ) | |
| 2143 | MDRV_HD63450_ADD( "hd63450", dmac_interface ) | |
| 2145 | 2144 | |
| 2146 | MDRV_D | |
| 2145 | MDRV_X68KHD | |
| 2147 | 2146 | |
| 2148 | 2147 | MDRV_SCC8530_ADD( "scc", x68000_scc8530_interface ) |
| 2149 | 2148 |
| r3957 | r3958 | |
|---|---|---|
| 460 | 460 | MDRV_CPU_PROGRAM_MAP(spectrum_mem, 0) |
| 461 | 461 | MDRV_CPU_IO_MAP(spectrum_io, 0) |
| 462 | 462 | MDRV_CPU_VBLANK_INT("main", spec_interrupt) |
| 463 | MDRV_ | |
| 463 | MDRV_QUANTUM_TIME | |
| 464 | 464 | |
| 465 | 465 | MDRV_MACHINE_RESET( spectrum ) |
| 466 | 466 |
| r3957 | r3958 | |
|---|---|---|
| 63 | 63 | { |
| 64 | 64 | // halt-LED; the red one, is turned on when the processor is halted |
| 65 | 65 | // TODO: processor seems to halt, but restarts(?) at 0x0000 after a while -> fix |
| 66 | led_halt = (UINT8) c | |
| 66 | led_halt = (UINT8) device | |
| 67 | 67 | set_led_status(1, led_tone); |
| 68 | 68 | } |
| 69 | 69 |
| r3957 | r3958 | |
|---|---|---|
| 241 | 241 | MDRV_CPU_PROGRAM_MAP(kaypro_mem, 0) |
| 242 | 242 | MDRV_CPU_IO_MAP(kaypro_io, 0) |
| 243 | 243 | MDRV_CPU_VBLANK_INT("main", kaypro_interrupt) |
| 244 | MDRV_ | |
| 244 | MDRV_QUANTUM_TIME | |
| 245 | 245 | |
| 246 | 246 | MDRV_MACHINE_RESET( kaypro ) |
| 247 | 247 |
| r3957 | r3958 | |
|---|---|---|
| 91 | 91 | MDRV_CPU_PROGRAM_MAP(rsp_map, 0) |
| 92 | 92 | |
| 93 | 93 | MDRV_MACHINE_RESET( n64 ) |
| 94 | MDRV_ | |
| 94 | MDRV_QUANTUM_TIME | |
| 95 | 95 | |
| 96 | 96 | /* video hardware */ |
| 97 | 97 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 1804 | 1804 | MDRV_PRINTER_ADD("printer") |
| 1805 | 1805 | |
| 1806 | 1806 | /* acia */ |
| 1807 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 1808 | MDRV_DEVICE_CONFIG(acia_ikbd_intf) | |
| 1809 | MDRV_DEVICE_ADD("acia_1", ACIA6850) | |
| 1810 | MDRV_DEVICE_CONFIG(acia_midi_intf) | |
| 1807 | MDRV_ACIA6850_ADD("acia_0", acia_ikbd_intf) | |
| 1808 | MDRV_ACIA6850_ADD("acia_1", acia_midi_intf) | |
| 1811 | 1809 | |
| 1812 | 1810 | MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface ) |
| 1813 | 1811 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 1865 | 1863 | MDRV_PRINTER_ADD("printer") |
| 1866 | 1864 | |
| 1867 | 1865 | /* acia */ |
| 1868 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 1869 | MDRV_DEVICE_CONFIG(acia_ikbd_intf) | |
| 1870 | MDRV_DEVICE_ADD("acia_1", ACIA6850) | |
| 1871 | MDRV_DEVICE_CONFIG(acia_midi_intf) | |
| 1866 | MDRV_ACIA6850_ADD("acia_0", acia_ikbd_intf) | |
| 1867 | MDRV_ACIA6850_ADD("acia_1", acia_midi_intf) | |
| 1872 | 1868 | |
| 1873 | 1869 | MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface ) |
| 1874 | 1870 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 1919 | 1915 | MDRV_PRINTER_ADD("printer") |
| 1920 | 1916 | |
| 1921 | 1917 | /* acia */ |
| 1922 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 1923 | MDRV_DEVICE_CONFIG(stbook_acia_ikbd_intf) | |
| 1924 | MDRV_DEVICE_ADD("acia_1", ACIA6850) | |
| 1925 | MDRV_DEVICE_CONFIG(acia_midi_intf) | |
| 1918 | MDRV_ACIA6850_ADD("acia_0", stbook_acia_ikbd_intf) | |
| 1919 | MDRV_ACIA6850_ADD("acia_1", acia_midi_intf) | |
| 1926 | 1920 | |
| 1927 | 1921 | MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface ) |
| 1928 | 1922 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 657 | 657 | */ |
| 658 | 658 | |
| 659 | 659 | /* floppy motor */ |
| 660 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), (data & 0x02) ? 0 : 1); | |
| 661 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0); | |
| 660 | floppy_drive_set_motor_state(image_from_devtype_and_index(device->machine, IO_FLOPPY, 0), (data & 0x02) ? 0 : 1); | |
| 661 | floppy_drive_set_ready_state(image_from_devtype_and_index(device->machine, IO_FLOPPY, 0), 1, 0); | |
| 662 | 662 | |
| 663 | 663 | /* FDC terminal count */ |
| 664 | 664 | nec765_set_tc_state(fdc, data & 0x04); |
| r3957 | r3958 | |
| 734 | 734 | TMS9928A_configure(&tms9928a_interface); |
| 735 | 735 | |
| 736 | 736 | /* configure FDC */ |
| 737 | floppy_drive_set_index_pulse_callback(image_from_devtype_and_index(IO_FLOPPY, 0), sf7000_fdc_index_callback); | |
| 737 | floppy_drive_set_index_pulse_callback(image_from_devtype_and_index(machine, IO_FLOPPY, 0), sf7000_fdc_index_callback); | |
| 738 | 738 | |
| 739 | 739 | /* configure PPI */ |
| 740 | 740 | centronics_config(machine, 1, sf7000_centronics_config); |
| r3957 | r3958 | |
|---|---|---|
| 621 | 621 | MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config ) |
| 622 | 622 | |
| 623 | 623 | /* cia */ |
| 624 | MDRV_DEVICE_ADD("cia_0", CIA6526R1) | |
| 625 | MDRV_DEVICE_CONFIG(c64_ntsc_cia0) | |
| 626 | MDRV_DEVICE_ADD("cia_1", CIA6526R1) | |
| 627 | MDRV_DEVICE_CONFIG(c64_ntsc_cia1) | |
| 624 | MDRV_CIA6526_ADD("cia_0", CIA6526R1, 0, c64_ntsc_cia0) | |
| 625 | MDRV_CIA6526_ADD("cia_1", CIA6526R1, 0, c64_ntsc_cia1) | |
| 628 | 626 | MACHINE_DRIVER_END |
| 629 | 627 | |
| 630 | 628 |
| r3957 | r3958 | |
|---|---|---|
| 426 | 426 | MDRV_CPU_ADD("main", 8080, 2500000) |
| 427 | 427 | MDRV_CPU_PROGRAM_MAP(lviv_mem, 0) |
| 428 | 428 | MDRV_CPU_IO_MAP(io_map, 0) |
| 429 | MDRV_ | |
| 429 | MDRV_QUANTUM_TIME | |
| 430 | 430 | |
| 431 | 431 | MDRV_MACHINE_RESET( lviv ) |
| 432 | 432 |
| r3957 | r3958 | |
|---|---|---|
| 367 | 367 | |
| 368 | 368 | static MACHINE_RESET( exidy ) |
| 369 | 369 | { |
| 370 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 370 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 371 | 371 | MACHINE_RESET_CALL( exidyd ); |
| 372 | 372 | } |
| 373 | 373 | |
| r3957 | r3958 | |
| 911 | 911 | if ((execute_address != 0xc858) && autorun) |
| 912 | 912 | memory_write_word_16le(space, 0xf028, execute_address); |
| 913 | 913 | |
| 914 | cpu_set_reg(cputag_get_cpu(machine, "main"), REG_PC, 0xf01f); | |
| 914 | cpu_set_reg(cputag_get_cpu(machine, "main"), REG_GENPC, 0xf01f); | |
| 915 | 915 | } |
| 916 | 916 | else |
| 917 | 917 | { |
| 918 | 918 | if (autorun) |
| 919 | cpu_set_reg(cputag_get_cpu(machine, "main"), REG_PC, execute_address); | |
| 919 | cpu_set_reg(cputag_get_cpu(machine, "main"), REG_GENPC, execute_address); | |
| 920 | 920 | } |
| 921 | 921 | } |
| 922 | 922 |
| r3957 | r3958 | |
|---|---|---|
| 529 | 529 | MDRV_CPU_IO_MAP(pc8801fd_io, 0) |
| 530 | 530 | MDRV_CPU_VBLANK_INT("main", pc8801fd_interrupt) |
| 531 | 531 | |
| 532 | MDRV_ | |
| 532 | MDRV_QUANTUM_TIME | |
| 533 | 533 | |
| 534 | 534 | MDRV_MACHINE_RESET( pc88srl ) |
| 535 | 535 | |
| r3957 | r3958 | |
| 566 | 566 | |
| 567 | 567 | static MACHINE_DRIVER_START( pc88srh ) |
| 568 | 568 | MDRV_IMPORT_FROM( pc88srl ) |
| 569 | MDRV_ | |
| 569 | MDRV_QUANTUM_TIME | |
| 570 | 570 | |
| 571 | 571 | MDRV_MACHINE_RESET( pc88srh ) |
| 572 | 572 |
| r3957 | r3958 | |
|---|---|---|
| 236 | 236 | MDRV_CPU_PROGRAM_MAP(p2000m_mem, 0) |
| 237 | 237 | MDRV_CPU_IO_MAP(p2000t_io, 0) |
| 238 | 238 | MDRV_CPU_VBLANK_INT("main", p2000_interrupt) |
| 239 | MDRV_ | |
| 239 | MDRV_QUANTUM_TIME | |
| 240 | 240 | |
| 241 | 241 | /* video hardware */ |
| 242 | 242 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 601 | 601 | |
| 602 | 602 | static const mc6845_interface crtc_pet40 = { |
| 603 | 603 | "main", |
| 604 | XTAL_17_73447MHz/3, /* This is a wild guess and mostly likely incorrect */ | |
| 605 | 604 | 8, |
| 606 | 605 | NULL, |
| 607 | 606 | pet40_update_row, |
| r3957 | r3958 | |
| 613 | 612 | |
| 614 | 613 | static const mc6845_interface crtc_pet80 = { |
| 615 | 614 | "main", |
| 616 | XTAL_12MHz / 2, /* This is a wild guess and mostly likely incorrect */ | |
| 617 | 615 | 16, |
| 618 | 616 | NULL, |
| 619 | 617 | pet80_update_row, |
| r3957 | r3958 | |
| 697 | 695 | MDRV_CPU_MODIFY( "main" ) |
| 698 | 696 | MDRV_CPU_PROGRAM_MAP( pet40_mem, 0 ) |
| 699 | 697 | |
| 700 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 701 | MDRV_DEVICE_CONFIG( crtc_pet40 ) | |
| 698 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_17_73447MHz/3 /* This is a wild guess and mostly likely incorrect */, crtc_pet40) | |
| 702 | 699 | |
| 703 | 700 | MDRV_VIDEO_START( pet_crtc ) |
| 704 | 701 | MDRV_VIDEO_UPDATE( pet_crtc ) |
| r3957 | r3958 | |
| 724 | 721 | MDRV_SCREEN_SIZE(640, 250) |
| 725 | 722 | MDRV_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 250 - 1) |
| 726 | 723 | |
| 727 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 728 | MDRV_DEVICE_CONFIG( crtc_pet80 ) | |
| 724 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_12MHz / 2 /* This is a wild guess and mostly likely incorrect */, crtc_pet80) | |
| 729 | 725 | |
| 730 | 726 | MDRV_GFXDECODE( pet80 ) |
| 731 | 727 | MDRV_VIDEO_START( pet_crtc ) |
| r3957 | r3958 | |
|---|---|---|
| 549 | 549 | /* disc motor on */ |
| 550 | 550 | case 9: |
| 551 | 551 | { |
| 552 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1); | |
| 553 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 1), 1); | |
| 554 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1,1); | |
| 555 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 1), 1,1); | |
| 552 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 1); | |
| 553 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), 1); | |
| 554 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 1,1); | |
| 555 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), 1,1); | |
| 556 | 556 | } |
| 557 | 557 | break; |
| 558 | 558 | |
| 559 | 559 | /* disc motor off */ |
| 560 | 560 | case 10: |
| 561 | 561 | { |
| 562 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), 0); | |
| 563 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 1), 0); | |
| 564 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1,1); | |
| 565 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 1), 1,1); | |
| 562 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 0); | |
| 563 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), 0); | |
| 564 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 1,1); | |
| 565 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), 1,1); | |
| 566 | 566 | } |
| 567 | 567 | break; |
| 568 | 568 | |
| r3957 | r3958 | |
| 751 | 751 | static MACHINE_START( pcw ) |
| 752 | 752 | { |
| 753 | 753 | fdc_interrupt_code = 0; |
| 754 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 754 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | |
| r3957 | r3958 | |
| 987 | 987 | MDRV_CPU_ADD("main", Z80, 4000000) /* clock supplied to chip, but in reality it is 3.4 MHz */ |
| 988 | 988 | MDRV_CPU_PROGRAM_MAP(pcw_map, 0) |
| 989 | 989 | MDRV_CPU_IO_MAP(pcw_io, 0) |
| 990 | MDRV_ | |
| 990 | MDRV_QUANTUM_TIME | |
| 991 | 991 | |
| 992 | 992 | MDRV_MACHINE_START(pcw) |
| 993 | 993 |
| r3957 | r3958 | |
|---|---|---|
| 170 | 170 | /* basic machine hardware */ |
| 171 | 171 | MDRV_CPU_ADD("main", M6502, 1000000) /* 6504 */ |
| 172 | 172 | MDRV_CPU_PROGRAM_MAP(mk2_mem, 0) |
| 173 | MDRV_ | |
| 173 | MDRV_QUANTUM_TIME | |
| 174 | 174 | |
| 175 | 175 | MDRV_MACHINE_START( mk2 ) |
| 176 | 176 |
| r3957 | r3958 | |
|---|---|---|
| 369 | 369 | MDRV_CPU_PROGRAM_MAP(c16_map, 0) |
| 370 | 370 | MDRV_CPU_VBLANK_INT("main", c16_frame_interrupt) |
| 371 | 371 | MDRV_CPU_PERIODIC_INT(ted7360_raster_interrupt, TED7360_HRETRACERATE) |
| 372 | MDRV_ | |
| 372 | MDRV_QUANTUM_TIME | |
| 373 | 373 | |
| 374 | 374 | MDRV_MACHINE_RESET( c16 ) |
| 375 | 375 | |
| r3957 | r3958 | |
| 410 | 410 | MDRV_IMPORT_FROM( c16 ) |
| 411 | 411 | MDRV_IMPORT_FROM( cpu_c1551 ) |
| 412 | 412 | #ifdef CPU_SYNC |
| 413 | MDRV_ | |
| 413 | MDRV_QUANTUM_TIME | |
| 414 | 414 | #else |
| 415 | MDRV_ | |
| 415 | MDRV_QUANTUM_TIME | |
| 416 | 416 | #endif |
| 417 | 417 | MACHINE_DRIVER_END |
| 418 | 418 | |
| r3957 | r3958 | |
| 421 | 421 | MDRV_IMPORT_FROM( c16 ) |
| 422 | 422 | MDRV_IMPORT_FROM( cpu_vc1541 ) |
| 423 | 423 | #ifdef CPU_SYNC |
| 424 | MDRV_ | |
| 424 | MDRV_QUANTUM_TIME | |
| 425 | 425 | #else |
| 426 | MDRV_ | |
| 426 | MDRV_QUANTUM_TIME | |
| 427 | 427 | #endif |
| 428 | 428 | MACHINE_DRIVER_END |
| 429 | 429 | |
| r3957 | r3958 | |
| 445 | 445 | MDRV_SCREEN_MODIFY("main") |
| 446 | 446 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 447 | 447 | #ifdef CPU_SYNC |
| 448 | MDRV_ | |
| 448 | MDRV_QUANTUM_TIME | |
| 449 | 449 | #else |
| 450 | MDRV_ | |
| 450 | MDRV_QUANTUM_TIME | |
| 451 | 451 | #endif |
| 452 | 452 | MACHINE_DRIVER_END |
| 453 | 453 | |
| r3957 | r3958 | |
| 459 | 459 | MDRV_SCREEN_MODIFY("main") |
| 460 | 460 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 461 | 461 | #ifdef CPU_SYNC |
| 462 | MDRV_ | |
| 462 | MDRV_QUANTUM_TIME | |
| 463 | 463 | #else |
| 464 | MDRV_ | |
| 464 | MDRV_QUANTUM_TIME | |
| 465 | 465 | #endif |
| 466 | 466 | MACHINE_DRIVER_END |
| 467 | 467 |
| r3957 | r3958 | |
|---|---|---|
| 237 | 237 | static CDP1861_INTERFACE( studio2_cdp1861_intf ) |
| 238 | 238 | { |
| 239 | 239 | SCREEN_TAG, |
| 240 | XTAL_3_52128MHz, | |
| 241 | 240 | studio2_int_w, |
| 242 | 241 | studio2_dmao_w, |
| 243 | 242 | studio2_efx_w |
| r3957 | r3958 | |
| 272 | 271 | static CDP1864_INTERFACE( mpt02_cdp1864_intf ) |
| 273 | 272 | { |
| 274 | 273 | SCREEN_TAG, |
| 275 | CDP1864_CLOCK, | |
| 276 | 274 | CDP1864_INTERLACED, |
| 277 | 275 | mpt02_int_w, |
| 278 | 276 | mpt02_dmao_w, |
| r3957 | r3958 | |
| 458 | 456 | MDRV_PALETTE_INIT(black_and_white) |
| 459 | 457 | MDRV_VIDEO_UPDATE(studio2) |
| 460 | 458 | |
| 461 | MDRV_DEVICE_ADD(CDP1861_TAG, CDP1861) | |
| 462 | MDRV_DEVICE_CONFIG(studio2_cdp1861_intf) | |
| 459 | MDRV_CDP1861_ADD(CDP1861_TAG, XTAL_3_52128MHz, studio2_cdp1861_intf) | |
| 463 | 460 | |
| 464 | 461 | // sound hardware |
| 465 | 462 | |
| r3957 | r3958 | |
| 491 | 488 | MDRV_PALETTE_INIT(black_and_white) |
| 492 | 489 | MDRV_VIDEO_UPDATE(studio2) |
| 493 | 490 | |
| 494 | MDRV_DEVICE_ADD(CDP1861_TAG, CDP1861) | |
| 495 | MDRV_DEVICE_CONFIG(studio2_cdp1861_intf) | |
| 491 | MDRV_CDP1861_ADD(CDP1861_TAG, XTAL_3_52128MHz, studio2_cdp1861_intf) | |
| 496 | 492 | |
| 497 | 493 | // sound hardware |
| 498 | 494 | |
| r3957 | r3958 | |
| 523 | 519 | MDRV_PALETTE_LENGTH(8+8) |
| 524 | 520 | MDRV_VIDEO_UPDATE(mpt02) |
| 525 | 521 | |
| 526 | MDRV_DEVICE_ADD(CDP1864_TAG, CDP1864) | |
| 527 | MDRV_DEVICE_CONFIG(mpt02_cdp1864_intf) | |
| 522 | MDRV_CDP1864_ADD(CDP1864_TAG, CDP1864_CLOCK, mpt02_cdp1864_intf) | |
| 528 | 523 | |
| 529 | 524 | // sound hardware |
| 530 | 525 |
| r3957 | r3958 | |
|---|---|---|
| 708 | 708 | pia_config(machine, 0, &osi470_pia_intf); |
| 709 | 709 | |
| 710 | 710 | /* set floppy index hole callback */ |
| 711 | floppy_drive_set_index_pulse_callback(image_from_devtype_and_index(IO_FLOPPY, 0), osi470_index_callback); | |
| 711 | floppy_drive_set_index_pulse_callback(image_from_devtype_and_index(machine, IO_FLOPPY, 0), osi470_index_callback); | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | /* Machine Drivers */ |
| r3957 | r3958 | |
| 732 | 732 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 733 | 733 | |
| 734 | 734 | /* cassette ACIA */ |
| 735 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 736 | MDRV_DEVICE_CONFIG(osi600_acia_intf) | |
| 735 | MDRV_ACIA6850_ADD("acia_0", osi600_acia_intf) | |
| 737 | 736 | |
| 738 | 737 | /* cassette */ |
| 739 | 738 | MDRV_TIMER_ADD_PERIODIC("cassette", cassette_tick, HZ(4800)) |
| r3957 | r3958 | |
| 753 | 752 | MDRV_IMPORT_FROM(uk101_video) |
| 754 | 753 | |
| 755 | 754 | /* cassette ACIA */ |
| 756 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 757 | MDRV_DEVICE_CONFIG(uk101_acia_intf) | |
| 755 | MDRV_ACIA6850_ADD("acia_0", uk101_acia_intf) | |
| 758 | 756 | |
| 759 | 757 | /* cassette */ |
| 760 | 758 | MDRV_TIMER_ADD_PERIODIC("cassette", cassette_tick, HZ(4800)) |
| r3957 | r3958 | |
| 782 | 780 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 783 | 781 | |
| 784 | 782 | /* cassette ACIA */ |
| 785 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 786 | MDRV_DEVICE_CONFIG(osi600_acia_intf) | |
| 783 | MDRV_ACIA6850_ADD("acia_0", osi600_acia_intf) | |
| 787 | 784 | |
| 788 | 785 | /* cassette */ |
| 789 | 786 | MDRV_TIMER_ADD_PERIODIC("cassette", cassette_tick, HZ(4800)) |
| r3957 | r3958 | |
| 799 | 796 | MDRV_MACHINE_START(c1pmf) |
| 800 | 797 | |
| 801 | 798 | /* floppy ACIA */ |
| 802 | MDRV_DEVICE_ADD("acia_1", ACIA6850) | |
| 803 | MDRV_DEVICE_CONFIG(osi470_acia_intf) | |
| 799 | MDRV_ACIA6850_ADD("acia_1", osi470_acia_intf) | |
| 804 | 800 | MACHINE_DRIVER_END |
| 805 | 801 | |
| 806 | 802 | /* ROMs */ |
| r3957 | r3958 | |
|---|---|---|
| 41 | 41 | #include "video/msm6255.h" |
| 42 | 42 | #include "bw2.lh" |
| 43 | 43 | |
| 44 | static const device_config *get_floppy_image(int drive) | |
| 44 | static const device_config *get_floppy_image(running_machine *machine, int drive) | |
| 45 | 45 | { |
| 46 | return image_from_devtype_and_index(IO_FLOPPY, drive); | |
| 46 | return image_from_devtype_and_index(machine, IO_FLOPPY, drive); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static int get_ramdisk_size(running_machine *machine) |
| r3957 | r3958 | |
| 478 | 478 | |
| 479 | 479 | data |= state->mfdbk << 5; |
| 480 | 480 | |
| 481 | data |= floppy_drive_get_flag_state(get_floppy_image(state->selected_drive), FLOPPY_DRIVE_DISK_WRITE_PROTECTED) ? 0x00 : 0x80; | |
| 481 | data |= floppy_drive_get_flag_state(get_floppy_image(device->machine, state->selected_drive), FLOPPY_DRIVE_DISK_WRITE_PROTECTED) ? 0x00 : 0x80; | |
| 482 | 482 | |
| 483 | 483 | return data; |
| 484 | 484 | } |
| r3957 | r3958 | |
| 515 | 515 | driver_state->mtron = state; |
| 516 | 516 | driver_state->mfdbk = !state; |
| 517 | 517 | |
| 518 | floppy_drive_set_motor_state(get_floppy_image(0), !driver_state->mtron); | |
| 519 | floppy_drive_set_motor_state(get_floppy_image(1), !driver_state->mtron); | |
| 518 | floppy_drive_set_motor_state(get_floppy_image(device->machine, 0), !driver_state->mtron); | |
| 519 | floppy_drive_set_motor_state(get_floppy_image(device->machine, 1), !driver_state->mtron); | |
| 520 | 520 | |
| 521 | floppy_drive_set_ready_state(get_floppy_image(0), 1, 1); | |
| 522 | floppy_drive_set_ready_state(get_floppy_image(1), 1, 1); | |
| 521 | floppy_drive_set_ready_state(get_floppy_image(device->machine, 0), 1, 1); | |
| 522 | floppy_drive_set_ready_state(get_floppy_image(device->machine, 1), 1, 1); | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | static const struct pit8253_config bw2_pit8253_interface = |
| r3957 | r3958 | |
| 841 | 841 | MDRV_MACHINE_START( bw2 ) |
| 842 | 842 | MDRV_MACHINE_RESET( bw2 ) |
| 843 | 843 | |
| 844 | MDRV_DEVICE_ADD( PIT8253_TAG, PIT8253 ) | |
| 845 | MDRV_DEVICE_CONFIG( bw2_pit8253_interface ) | |
| 846 | ||
| 844 | MDRV_PIT8253_ADD( PIT8253_TAG, bw2_pit8253_interface ) | |
| 847 | 845 | MDRV_PPI8255_ADD( PPI8255_TAG, bw2_ppi8255_interface ) |
| 848 | 846 | |
| 849 | 847 | /* video hardware */ |
| r3957 | r3958 | |
|---|---|---|
| 355 | 355 | /* basic machine hardware */ |
| 356 | 356 | MDRV_CPU_ADD("main", M6502, 1000000) |
| 357 | 357 | MDRV_CPU_PROGRAM_MAP(oric_mem, 0) |
| 358 | MDRV_ | |
| 358 | MDRV_QUANTUM_TIME | |
| 359 | 359 | |
| 360 | 360 | MDRV_MACHINE_START( oric ) |
| 361 | 361 | MDRV_MACHINE_RESET( oric ) |
| r3957 | r3958 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | cpu_set_input_line_vector(machine->cpu[0],0,0x0ff); |
| 232 | 232 | |
| 233 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 233 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | static MACHINE_START(enterprise) |
| r3957 | r3958 | |
| 541 | 541 | MDRV_CPU_ADD("main", Z80, 4000000) |
| 542 | 542 | MDRV_CPU_PROGRAM_MAP(enterprise_mem, 0) |
| 543 | 543 | MDRV_CPU_IO_MAP(enterprise_io, 0) |
| 544 | MDRV_ | |
| 544 | MDRV_QUANTUM_TIME | |
| 545 | 545 | |
| 546 | 546 | MDRV_MACHINE_START( enterprise ) |
| 547 | 547 |
| r3957 | r3958 | |
|---|---|---|
| 201 | 201 | /* basic machine hardware */ |
| 202 | 202 | MDRV_CPU_ADD("main", M6800, 614400) /* 614.4 kHz */ |
| 203 | 203 | MDRV_CPU_PROGRAM_MAP(mekd2_mem, 0) |
| 204 | MDRV_ | |
| 204 | MDRV_QUANTUM_TIME | |
| 205 | 205 | |
| 206 | 206 | /* video hardware */ |
| 207 | 207 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | /* mingw-gcc defines this */ | |
| 8 | #ifdef i386 | |
| 9 | #undef i386 | |
| 10 | #endif /* i386 */ | |
| 11 | ||
| 7 | 12 | #include "driver.h" |
| 8 | //#include "cpu/i86/i286.h" | |
| 13 | #include "cpu/i86/i86.h" | |
| 14 | #include "cpu/i86/i286.h" | |
| 9 | 15 | #include "cpu/i386/i386.h" |
| 10 | 16 | #include "sound/3812intf.h" |
| 11 | 17 | #include "machine/8255ppi.h" |
| r3957 | r3958 | |
| 412 | 418 | #endif |
| 413 | 419 | |
| 414 | 420 | |
| 415 | #define MDRV_CPU_ATPC(mem, port, type, clock) \ | |
| 416 | MDRV_CPU_ADD("main", type, clock) \ | |
| 417 | MDRV_CPU_PROGRAM_MAP(mem##_map, 0) \ | |
| 418 | MDRV_CPU_IO_MAP(port##_io, 0) \ | |
| 419 | MDRV_CPU_CONFIG(i286_address_mask) | |
| 420 | ||
| 421 | 421 | static MACHINE_DRIVER_START( ibm5170 ) |
| 422 | 422 | /* basic machine hardware */ |
| 423 | MDRV_CPU_ATPC(at16, at16, I80286, 6000000 /*6000000*/) | |
| 423 | MDRV_CPU_ADD("main", I80286, 6000000 /*6000000*/) | |
| 424 | MDRV_CPU_PROGRAM_MAP(at16_map, 0) | |
| 425 | MDRV_CPU_IO_MAP(at16_io, 0) | |
| 426 | MDRV_CPU_CONFIG(i286_address_mask) | |
| 424 | 427 | |
| 425 | MDRV_ | |
| 428 | MDRV_QUANTUM_TIME | |
| 426 | 429 | |
| 427 | 430 | MDRV_PIT8254_ADD( "pit8254", at_pit8254_config ) |
| 428 | 431 | |
| r3957 | r3958 | |
| 485 | 488 | |
| 486 | 489 | static MACHINE_DRIVER_START( ibm5162 ) |
| 487 | 490 | /* basic machine hardware */ |
| 488 | MDRV_CPU_ATPC(at16, at16, I80286, 6000000 /*6000000*/) | |
| 491 | MDRV_CPU_ADD("main", I80286, 6000000 /*6000000*/) | |
| 492 | MDRV_CPU_PROGRAM_MAP(at16_map, 0) | |
| 493 | MDRV_CPU_IO_MAP(at16_io, 0) | |
| 494 | MDRV_CPU_CONFIG(i286_address_mask) | |
| 489 | 495 | |
| 490 | MDRV_ | |
| 496 | MDRV_QUANTUM_TIME | |
| 491 | 497 | |
| 492 | 498 | MDRV_PIT8254_ADD( "pit8254", at_pit8254_config ) |
| 493 | 499 | |
| r3957 | r3958 | |
| 534 | 540 | |
| 535 | 541 | static MACHINE_DRIVER_START( ps2m30286 ) |
| 536 | 542 | /* basic machine hardware */ |
| 537 | MDRV_CPU_ATPC(at16, at16, I80286, 12000000) | |
| 543 | MDRV_CPU_ADD("main", I80286, 12000000) | |
| 544 | MDRV_CPU_PROGRAM_MAP(at16_map, 0) | |
| 545 | MDRV_CPU_IO_MAP(at16_io, 0) | |
| 546 | MDRV_CPU_CONFIG(i286_address_mask) | |
| 538 | 547 | |
| 539 | 548 | MDRV_PIT8254_ADD( "pit8254", at_pit8254_config ) |
| 540 | 549 | |
| r3957 | r3958 | |
| 596 | 605 | |
| 597 | 606 | static MACHINE_DRIVER_START( atvga ) |
| 598 | 607 | /* basic machine hardware */ |
| 599 | MDRV_CPU_ATPC(at16, at16, I80286, 12000000) | |
| 608 | MDRV_CPU_ADD("main", I80286, 12000000) | |
| 609 | MDRV_CPU_PROGRAM_MAP(at16_map, 0) | |
| 610 | MDRV_CPU_IO_MAP(at16_io, 0) | |
| 611 | MDRV_CPU_CONFIG(i286_address_mask) | |
| 600 | 612 | |
| 601 | 613 | MDRV_PIT8254_ADD( "pit8254", at_pit8254_config ) |
| 602 | 614 | |
| r3957 | r3958 | |
| 661 | 673 | static MACHINE_DRIVER_START( at386 ) |
| 662 | 674 | /* basic machine hardware */ |
| 663 | 675 | /* original at 6 MHz, at03 8 megahertz */ |
| 664 | MDRV_CPU_ATPC(at386, at386, I386, 12000000) | |
| 676 | MDRV_CPU_ADD("main", I386, 12000000) | |
| 677 | MDRV_CPU_PROGRAM_MAP(at386_map, 0) | |
| 678 | MDRV_CPU_IO_MAP(at386_io, 0) | |
| 679 | MDRV_CPU_CONFIG(i286_address_mask) | |
| 665 | 680 | |
| 666 | 681 | MDRV_MACHINE_START( at ) |
| 667 | 682 | MDRV_MACHINE_RESET( at ) |
| r3957 | r3958 | |
|---|---|---|
| 202 | 202 | MDRV_CPU_ADD("sound", SPC700, 1024000) /* 1.024 MHz */ |
| 203 | 203 | MDRV_CPU_PROGRAM_MAP(spc_map, 0) |
| 204 | 204 | |
| 205 | MDRV_ | |
| 205 | MDRV_QUANTUM_TIME | |
| 206 | 206 | |
| 207 | 207 | MDRV_MACHINE_START( snes_mess ) |
| 208 | 208 | MDRV_MACHINE_RESET( snes ) |
| r3957 | r3958 | |
|---|---|---|
| 301 | 301 | MDRV_IMPORT_FROM( vic20 ) |
| 302 | 302 | MDRV_IMPORT_FROM( cpu_vc1540 ) |
| 303 | 303 | #ifdef CPU_SYNC |
| 304 | MDRV_ | |
| 304 | MDRV_QUANTUM_TIME | |
| 305 | 305 | #else |
| 306 | MDRV_ | |
| 306 | MDRV_QUANTUM_TIME | |
| 307 | 307 | #endif |
| 308 | 308 | MACHINE_DRIVER_END |
| 309 | 309 | |
| r3957 | r3958 | |
| 312 | 312 | MDRV_IMPORT_FROM( vic20 ) |
| 313 | 313 | /*MDRV_IMPORT_FROM( cpu_c2031 )*/ |
| 314 | 314 | #if 1 || CPU_SYNC |
| 315 | MDRV_ | |
| 315 | MDRV_QUANTUM_TIME | |
| 316 | 316 | #else |
| 317 | MDRV_ | |
| 317 | MDRV_QUANTUM_TIME | |
| 318 | 318 | #endif |
| 319 | 319 | |
| 320 | 320 | MDRV_CPU_MODIFY( "main" ) |
| r3957 | r3958 | |
| 339 | 339 | MDRV_IMPORT_FROM( vc20 ) |
| 340 | 340 | MDRV_IMPORT_FROM( cpu_vc1540 ) |
| 341 | 341 | #ifdef CPU_SYNC |
| 342 | MDRV_ | |
| 342 | MDRV_QUANTUM_TIME | |
| 343 | 343 | #else |
| 344 | MDRV_ | |
| 344 | MDRV_QUANTUM_TIME | |
| 345 | 345 | #endif |
| 346 | 346 | MACHINE_DRIVER_END |
| 347 | 347 |
| r3957 | r3958 | |
|---|---|---|
| 163 | 163 | MDRV_SOUND_ADD("cassette", WAVE, 0) |
| 164 | 164 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 165 | 165 | |
| 166 | MDRV_DEVICE_ADD("dma8257", DMA8257) | |
| 167 | MDRV_DEVICE_CONFIG(partner_dma) | |
| 166 | MDRV_DMA8257_ADD("dma8257", XTAL_16MHz / 9, partner_dma) | |
| 168 | 167 | |
| 169 | 168 | MDRV_CASSETTE_ADD( "cassette", partner_cassette_config ) |
| 170 | 169 |
| r3957 | r3958 | |
|---|---|---|
| 488 | 488 | static ZX8301_INTERFACE( ql_zx8301_intf ) |
| 489 | 489 | { |
| 490 | 490 | SCREEN_TAG, |
| 491 | X1, | |
| 492 | 491 | ql_vsync_w, |
| 493 | 492 | ql_ram_r, |
| 494 | 493 | ql_ram_w |
| r3957 | r3958 | |
| 517 | 516 | |
| 518 | 517 | static ZX8302_INTERFACE( ql_zx8302_intf ) |
| 519 | 518 | { |
| 520 | X1, | |
| 521 | 519 | X2, |
| 522 | 520 | MDV1_TAG, |
| 523 | 521 | MDV2_TAG, |
| r3957 | r3958 | |
| 616 | 614 | |
| 617 | 615 | MDRV_MACHINE_START(ql) |
| 618 | 616 | |
| 619 | MDRV_DEVICE_ADD(ZX8302_TAG, ZX8302) | |
| 620 | MDRV_DEVICE_CONFIG(ql_zx8302_intf) | |
| 617 | MDRV_ZX8302_ADD(ZX8302_TAG, X1, ql_zx8302_intf) | |
| 621 | 618 | |
| 622 | MDRV_DEVICE_ADD(MDV1_TAG, MICRODRIVE) | |
| 623 | MDRV_DEVICE_ADD(MDV2_TAG, MICRODRIVE) | |
| 619 | MDRV_DEVICE_ADD(MDV1_TAG, MICRODRIVE, 0) | |
| 620 | MDRV_DEVICE_ADD(MDV2_TAG, MICRODRIVE, 0) | |
| 624 | 621 | |
| 625 | 622 | // video hardware |
| 626 | 623 | |
| r3957 | r3958 | |
| 635 | 632 | MDRV_PALETTE_INIT(zx8301) |
| 636 | 633 | MDRV_VIDEO_UPDATE(ql) |
| 637 | 634 | |
| 638 | MDRV_DEVICE_ADD(ZX8301_TAG, ZX8301) | |
| 639 | MDRV_DEVICE_CONFIG(ql_zx8301_intf) | |
| 635 | MDRV_ZX8301_ADD(ZX8301_TAG, X1, ql_zx8301_intf) | |
| 640 | 636 | |
| 641 | 637 | // sound hardware |
| 642 | 638 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 1863 | 1863 | logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),data); |
| 1864 | 1864 | cpuexec_boost_interleave(space->machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost)); |
| 1865 | 1865 | cpuexec_trigger(space->machine, 1000); |
| 1866 | c | |
| 1866 | device | |
| 1867 | 1867 | } |
| 1868 | 1868 | |
| 1869 | 1869 | static WRITE32_HANDLER( sinit_w ) |
| 1870 | 1870 | { |
| 1871 | 1871 | logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),data); |
| 1872 | 1872 | cpuexec_boost_interleave(space->machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost)); |
| 1873 | c | |
| 1873 | device | |
| 1874 | 1874 | } |
| 1875 | 1875 | |
| 1876 | 1876 | static UINT32 backup[64*1024/4]; |
| r3957 | r3958 | |
| 2186 | 2186 | saturn_region = rgn; |
| 2187 | 2187 | |
| 2188 | 2188 | // set compatible options |
| 2189 | cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2190 | cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2189 | device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2190 | device_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); | |
| 2191 | 2191 | |
| 2192 | 2192 | /* get the current date/time from the core */ |
| 2193 | 2193 | mame_get_current_datetime(machine, &systime); |
| r3957 | r3958 | |
|---|---|---|
| 141 | 141 | direct->decrypted = mikrosha_io_mirror; |
| 142 | 142 | direct->min = 0x8000; |
| 143 | 143 | direct->max = 0xffff; |
| 144 | mikrosha_io_mirror[address] = cpu_get_reg(space->machine->cpu[0], I808 | |
| 144 | mikrosha_io_mirror[address] = cpu_get_reg(space->machine->cpu[0], I8085_STATUS); | |
| 145 | 145 | } |
| 146 | 146 | return address; |
| 147 | 147 | } |
| r3957 | r3958 | |
| 208 | 208 | MDRV_SOUND_ADD("cassette", WAVE, 0) |
| 209 | 209 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 210 | 210 | |
| 211 | MDRV_DEVICE_ADD("dma8257", DMA8257) | |
| 212 | MDRV_DEVICE_CONFIG(radio86_dma) | |
| 211 | MDRV_DMA8257_ADD("dma8257", XTAL_16MHz / 9, radio86_dma) | |
| 213 | 212 | |
| 214 | 213 | MDRV_CASSETTE_ADD( "cassette", mikrosha_cassette_config ) |
| 215 | 214 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 19 | 19 | /* Core includes */ |
| 20 | 20 | #include "driver.h" |
| 21 | 21 | #include "cpu/m68000/m68000.h" |
| 22 | #include "deprecat.h" | |
| 23 | 22 | #include "includes/amiga.h" |
| 24 | 23 | |
| 25 | 24 | /* Components */ |
| r3957 | r3958 | |
| 224 | 223 | static const cia6526_interface cia_0_ntsc_intf = |
| 225 | 224 | { |
| 226 | 225 | amiga_cia_0_irq, /* irq_func */ |
| 227 | AMIGA_68000_NTSC_CLOCK / 10, /* clock */ | |
| 228 | 226 | 60, /* tod_clock */ |
| 229 | 227 | { |
| 230 | 228 | { amiga_cia_0_portA_r, amiga_cia_0_portA_w }, /* port A */ |
| r3957 | r3958 | |
| 235 | 233 | static const cia6526_interface cia_0_pal_intf = |
| 236 | 234 | { |
| 237 | 235 | amiga_cia_0_irq, /* irq_func */ |
| 238 | AMIGA_68000_PAL_CLOCK / 10, /* clock */ | |
| 239 | 236 | 50, /* tod_clock */ |
| 240 | 237 | { |
| 241 | 238 | { amiga_cia_0_portA_r, amiga_cia_0_portA_w }, /* port A */ |
| r3957 | r3958 | |
| 246 | 243 | static const cia6526_interface cia_1_intf = |
| 247 | 244 | { |
| 248 | 245 | amiga_cia_1_irq, /* irq_func */ |
| 249 | 0, /* clock */ | |
| 250 | 246 | 0, /* tod_clock */ |
| 251 | 247 | { |
| 252 | 248 | { NULL, NULL, }, /* port A */ |
| r3957 | r3958 | |
| 257 | 253 | static const cia6526_interface cia_0_cdtv_intf = |
| 258 | 254 | { |
| 259 | 255 | amiga_cia_0_irq, /* irq_func */ |
| 260 | CDTV_CLOCK_X1 / 40, /* clock */ | |
| 261 | 256 | 0, /* tod_clock */ |
| 262 | 257 | { |
| 263 | 258 | { amiga_cia_0_portA_r, amiga_cia_0_portA_w }, /* port A */ |
| r3957 | r3958 | |
| 268 | 263 | static const cia6526_interface cia_1_cdtv_intf = |
| 269 | 264 | { |
| 270 | 265 | amiga_cia_1_irq, /* irq_func */ |
| 271 | 0, /* clock */ | |
| 272 | 266 | 0, /* tod_clock */ |
| 273 | 267 | { |
| 274 | 268 | { NULL, NULL, }, /* port A */ |
| r3957 | r3958 | |
| 299 | 293 | MDRV_VIDEO_UPDATE(amiga) |
| 300 | 294 | |
| 301 | 295 | /* devices */ |
| 302 | MDRV_ | |
| 296 | MDRV_MSM6242_ADD("rtc" | |
| 303 | 297 | |
| 304 | 298 | /* sound hardware */ |
| 305 | 299 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| r3957 | r3958 | |
| 312 | 306 | MDRV_SOUND_ROUTE(3, "left", 0.50) |
| 313 | 307 | |
| 314 | 308 | /* cia */ |
| 315 | MDRV_DEVICE_ADD("cia_0", CIA8520) | |
| 316 | MDRV_DEVICE_CONFIG(cia_0_ntsc_intf) | |
| 317 | MDRV_DEVICE_ADD("cia_1", CIA8520) | |
| 318 | MDRV_DEVICE_CONFIG(cia_1_intf) | |
| 309 | MDRV_CIA8520_ADD("cia_0", AMIGA_68000_NTSC_CLOCK / 10, cia_0_ntsc_intf) | |
| 310 | MDRV_CIA8520_ADD("cia_1", 0, cia_1_intf) | |
| 319 | 311 | MACHINE_DRIVER_END |
| 320 | 312 | |
| 321 | 313 | static MACHINE_DRIVER_START( cdtv ) |
| r3957 | r3958 | |
| 336 | 328 | MDRV_CDROM_ADD( "cdrom" ) |
| 337 | 329 | |
| 338 | 330 | /* cia */ |
| 339 | MDRV_DEVICE_MODIFY("cia_0", CIA8520) | |
| 340 | MDRV_DEVICE_CONFIG(cia_0_cdtv_intf) | |
| 341 | MDRV_DEVICE_MODIFY("cia_1", CIA8520) | |
| 342 | MDRV_DEVICE_CONFIG(cia_1_cdtv_intf) | |
| 331 | MDRV_CIA8520_REMOVE("cia_0") | |
| 332 | MDRV_CIA8520_REMOVE("cia_1") | |
| 333 | MDRV_CIA8520_ADD("cia_0", CDTV_CLOCK_X1 / 40, cia_0_cdtv_intf) | |
| 334 | MDRV_CIA8520_ADD("cia_1", 0, cia_1_cdtv_intf) | |
| 343 | 335 | MACHINE_DRIVER_END |
| 344 | 336 | |
| 345 | 337 | static MACHINE_DRIVER_START( a1000n ) |
| r3957 | r3958 | |
| 360 | 352 | MDRV_SCREEN_VISIBLE_AREA(214, (228*4)-1, 34, 312-1) |
| 361 | 353 | |
| 362 | 354 | /* cia */ |
| 363 | MDRV_DEVICE_MODIFY("cia_0", CIA8520) | |
| 364 | MDRV_DEVICE_CONFIG(cia_0_pal_intf) | |
| 355 | MDRV_CIA8520_REMOVE("cia_0") | |
| 356 | MDRV_CIA8520_ADD("cia_0", AMIGA_68000_PAL_CLOCK / 10, cia_0_pal_intf) | |
| 365 | 357 | MACHINE_DRIVER_END |
| 366 | 358 | |
| 367 | 359 | static MACHINE_DRIVER_START( a1000p ) |
| r3957 | r3958 | |
| 410 | 402 | output_set_value("power_led", ( data & 2 ) ? 0 : 1); |
| 411 | 403 | } |
| 412 | 404 | |
| 413 | static UINT16 amiga_read_joy0dat( | |
| 405 | static UINT16 amiga_read_joy0dat(running_machine *machine) | |
| 414 | 406 | { |
| 415 | running_machine *machine = Machine; | |
| 416 | 407 | if ( input_port_read(machine, "input") & 0x20 ) { |
| 417 | 408 | /* Joystick */ |
| 418 | 409 | return input_port_read_safe(machine, "JOY0DAT", 0xffff); |
| r3957 | r3958 | |
| 425 | 416 | } |
| 426 | 417 | } |
| 427 | 418 | |
| 428 | static UINT16 amiga_read_joy1dat( | |
| 419 | static UINT16 amiga_read_joy1dat(running_machine *machine) | |
| 429 | 420 | { |
| 430 | running_machine *machine = Machine; | |
| 431 | 421 | if ( input_port_read(machine, "input") & 0x10 ) { |
| 432 | 422 | /* Joystick */ |
| 433 | 423 | return input_port_read_safe(machine, "JOY1DAT", 0xffff); |
| r3957 | r3958 | |
| 440 | 430 | } |
| 441 | 431 | } |
| 442 | 432 | |
| 443 | static UINT16 amiga_read_dskbytr( | |
| 433 | static UINT16 amiga_read_dskbytr(running_machine *machine) | |
| 444 | 434 | { |
| 445 | 435 | return amiga_fdc_get_byte(); |
| 446 | 436 | } |
| 447 | 437 | |
| 448 | static void amiga_write_dsklen(UINT16 data) | |
| 438 | static void amiga_write_dsklen(running_machine *machine, UINT16 data) | |
| 449 | 439 | { |
| 450 | 440 | if ( data & 0x8000 ) { |
| 451 | 441 | if ( CUSTOM_REG(REG_DSKLEN) & 0x8000 ) |
| 452 | amiga_fdc_setup_dma( | |
| 442 | amiga_fdc_setup_dma(machine); | |
| 453 | 443 | } |
| 454 | 444 | } |
| 455 | 445 | |
| 456 | 446 | |
| 457 | static void amiga_reset( | |
| 447 | static void amiga_reset(running_machine *machine) | |
| 458 | 448 | { |
| 459 | running_machine *machine = Machine; | |
| 460 | 449 | if (input_port_read(machine, "hardware") & 0x08) |
| 461 | 450 | { |
| 462 | 451 | /* Install RTC */ |
| r3957 | r3958 | |
|---|---|---|
| 237 | 237 | MDRV_CPU_ADD("main", F8, 3579545/2) /* Colorburst/2 */ |
| 238 | 238 | MDRV_CPU_PROGRAM_MAP(channelf_map, 0) |
| 239 | 239 | MDRV_CPU_IO_MAP(channelf_io, 0) |
| 240 | MDRV_ | |
| 240 | MDRV_QUANTUM_TIME | |
| 241 | 241 | |
| 242 | 242 | /* video hardware */ |
| 243 | 243 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 231 | 231 | is 2 cycles of the fundamental 14.31818 MHz oscillator. The |
| 232 | 232 | total blanking time is about 4450 microseconds. */ |
| 233 | 233 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((int) (70 * 65 * 7 * 2 / 14.31818))) |
| 234 | MDRV_ | |
| 234 | MDRV_QUANTUM_TIME | |
| 235 | 235 | |
| 236 | 236 | MDRV_MACHINE_RESET( apple1 ) |
| 237 | 237 |
| r3957 | r3958 | |
|---|---|---|
| 842 | 842 | |
| 843 | 843 | static const z80ctc_interface ctc_intf = |
| 844 | 844 | { |
| 845 | Z80_TAG, /* cpu */ | |
| 846 | ABC800_X01/2/2, /* clock */ | |
| 847 | 845 | 0, /* timer disables */ |
| 848 | 846 | ctc_interrupt, /* interrupt handler */ |
| 849 | 847 | ctc_z0_w, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 887 | 885 | |
| 888 | 886 | static const z80sio_interface sio_intf = |
| 889 | 887 | { |
| 890 | Z80_TAG, /* cpu */ | |
| 891 | ABC800_X01/2/2, /* clock */ | |
| 892 | 888 | sio_interrupt, /* interrupt handler */ |
| 893 | 889 | sio_dtr_w, /* DTR changed handler */ |
| 894 | 890 | 0, /* RTS changed handler */ |
| r3957 | r3958 | |
| 1266 | 1262 | MDRV_IMPORT_FROM(abc800m_video) |
| 1267 | 1263 | |
| 1268 | 1264 | /* Z80 CTC */ |
| 1269 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf) | |
| 1265 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ABC800_X01/2/2, ctc_intf) | |
| 1270 | 1266 | MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2)) |
| 1271 | 1267 | |
| 1272 | 1268 | /* Z80 SIO/2 */ |
| 1273 | MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf) | |
| 1269 | MDRV_Z80SIO_ADD(Z80SIO_TAG, ABC800_X01/2/2, sio_intf) | |
| 1274 | 1270 | |
| 1275 | 1271 | /* Z80 DART */ |
| 1276 | 1272 | MDRV_Z80DART_ADD(Z80DART_TAG, abc800_dart_intf) |
| r3957 | r3958 | |
| 1313 | 1309 | MDRV_IMPORT_FROM(abc800c_video) |
| 1314 | 1310 | |
| 1315 | 1311 | /* Z80 CTC */ |
| 1316 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf) | |
| 1312 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ABC800_X01/2/2, ctc_intf) | |
| 1317 | 1313 | MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2)) |
| 1318 | 1314 | |
| 1319 | 1315 | /* Z80 SIO/2 */ |
| 1320 | MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf) | |
| 1316 | MDRV_Z80SIO_ADD(Z80SIO_TAG, ABC800_X01/2/2, sio_intf) | |
| 1321 | 1317 | |
| 1322 | 1318 | /* Z80 DART */ |
| 1323 | 1319 | MDRV_Z80DART_ADD(Z80DART_TAG, abc800_dart_intf) |
| r3957 | r3958 | |
| 1360 | 1356 | MDRV_IMPORT_FROM(abc802_video) |
| 1361 | 1357 | |
| 1362 | 1358 | /* Z80 CTC */ |
| 1363 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf) | |
| 1359 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ABC800_X01/2/2, ctc_intf) | |
| 1364 | 1360 | MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2)) |
| 1365 | 1361 | |
| 1366 | 1362 | /* Z80 SIO/2 */ |
| 1367 | MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf) | |
| 1363 | MDRV_Z80SIO_ADD(Z80SIO_TAG, ABC800_X01/2/2, sio_intf) | |
| 1368 | 1364 | |
| 1369 | 1365 | /* Z80 DART */ |
| 1370 | 1366 | MDRV_Z80DART_ADD(Z80DART_TAG, abc802_dart_intf) |
| r3957 | r3958 | |
| 1407 | 1403 | MDRV_IMPORT_FROM(abc806_video) |
| 1408 | 1404 | |
| 1409 | 1405 | /* Z80 CTC */ |
| 1410 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf) | |
| 1406 | MDRV_Z80CTC_ADD(Z80CTC_TAG, ABC800_X01/2/2, ctc_intf) | |
| 1411 | 1407 | MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2)) |
| 1412 | 1408 | |
| 1413 | 1409 | /* Z80 SIO/2 */ |
| 1414 | MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf) | |
| 1410 | MDRV_Z80SIO_ADD(Z80SIO_TAG, ABC800_X01/2/2, sio_intf) | |
| 1415 | 1411 | |
| 1416 | 1412 | /* Z80 DART */ |
| 1417 | 1413 | MDRV_Z80DART_ADD(Z80DART_TAG, abc806_dart_intf) |
| r3957 | r3958 | |
|---|---|---|
| 150 | 150 | static CDP1864_INTERFACE( tmc2000e_cdp1864_intf ) |
| 151 | 151 | { |
| 152 | 152 | SCREEN_TAG, |
| 153 | XTAL_1_75MHz, | |
| 154 | 153 | CDP1864_INTERLACED, |
| 155 | 154 | tmc2000e_int_w, |
| 156 | 155 | tmc2000e_dmao_w, |
| r3957 | r3958 | |
| 318 | 317 | MDRV_PALETTE_LENGTH(8) |
| 319 | 318 | MDRV_VIDEO_UPDATE(tmc2000e) |
| 320 | 319 | |
| 321 | MDRV_DEVICE_ADD(CDP1864_TAG, CDP1864) | |
| 322 | MDRV_DEVICE_CONFIG(tmc2000e_cdp1864_intf) | |
| 320 | MDRV_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, tmc2000e_cdp1864_intf) | |
| 323 | 321 | |
| 324 | 322 | // sound hardware |
| 325 | 323 |
| r3957 | r3958 | |
|---|---|---|
| 89 | 89 | MDRV_CPU_ADD("ppc2", PPC603, 66000000) /* 66 MHz */ |
| 90 | 90 | MDRV_CPU_PROGRAM_MAP(bebox_mem, 0) |
| 91 | 91 | |
| 92 | MDRV_ | |
| 92 | MDRV_QUANTUM_TIME | |
| 93 | 93 | |
| 94 | 94 | MDRV_PIT8254_ADD( "pit8254", bebox_pit8254_config ) |
| 95 | 95 |
| r3957 | r3958 | |
|---|---|---|
| 267 | 267 | MDRV_CPU_PROGRAM_MAP(a7800_mem, 0) |
| 268 | 268 | MDRV_CPU_VBLANK_INT_HACK(a7800_interrupt, 262) |
| 269 | 269 | |
| 270 | MDRV_ | |
| 270 | MDRV_QUANTUM_TIME | |
| 271 | 271 | |
| 272 | 272 | MDRV_MACHINE_RESET( a7800 ) |
| 273 | 273 |
| r3957 | r3958 | |
|---|---|---|
| 150 | 150 | MDRV_SOUND_ADD("cassette", WAVE, 0) |
| 151 | 151 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 152 | 152 | |
| 153 | MDRV_DEVICE_ADD("dma8257", DMA8257) | |
| 154 | MDRV_DEVICE_CONFIG(radio86_dma) | |
| 153 | MDRV_DMA8257_ADD("dma8257", XTAL_16MHz / 9, radio86_dma) | |
| 155 | 154 | |
| 156 | 155 | MDRV_CASSETTE_ADD( "cassette", apogee_cassette_config ) |
| 157 | 156 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 559 | 559 | |
| 560 | 560 | */ |
| 561 | 561 | |
| 562 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), BIT(data, 0)); | |
| 563 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0); | |
| 562 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), BIT(data, 0)); | |
| 563 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 1, 0); | |
| 564 | 564 | |
| 565 | 565 | nec765_set_reset_state(fdc, BIT(data, 1)); |
| 566 | 566 | |
| r3957 | r3958 | |
| 864 | 864 | |
| 865 | 865 | static ADC080X_INTERFACE( newbrain_adc0809_intf ) |
| 866 | 866 | { |
| 867 | 500000, | |
| 868 | 867 | newbrain_adc_on_eoc_changed, |
| 869 | 868 | newbrain_adc_vref_pos_r, |
| 870 | 869 | newbrain_adc_vref_neg_r, |
| r3957 | r3958 | |
| 1117 | 1116 | |
| 1118 | 1117 | static const z80ctc_interface newbrain_ctc_intf = |
| 1119 | 1118 | { |
| 1120 | Z80_TAG, /* cpu */ | |
| 1121 | 0, /* clock */ | |
| 1122 | 1119 | 0, /* timer disables */ |
| 1123 | 1120 | NULL, /* interrupt handler */ |
| 1124 | 1121 | NULL, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 1253 | 1250 | MDRV_MACHINE_START(newbrain) |
| 1254 | 1251 | MDRV_MACHINE_RESET(newbrain) |
| 1255 | 1252 | |
| 1256 | MDRV_Z80CTC_ADD( "z80ctc", newbrain_ctc_intf ) | |
| 1253 | MDRV_Z80CTC_ADD( "z80ctc", 0, newbrain_ctc_intf ) | |
| 1257 | 1254 | |
| 1258 | 1255 | // A/D converter |
| 1259 | MDRV_ADC0809_ADD(ADC0809_TAG, newbrain_adc0809_intf) | |
| 1256 | MDRV_ADC0809_ADD(ADC0809_TAG, 500000, newbrain_adc0809_intf) | |
| 1260 | 1257 | |
| 1261 | 1258 | // video hardware |
| 1262 | 1259 | |
| r3957 | r3958 | |
| 1266 | 1263 | MDRV_CASSETTE_ADD( "cassette2", newbrain_cassette_config ) |
| 1267 | 1264 | |
| 1268 | 1265 | /* acia */ |
| 1269 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 1270 | MDRV_DEVICE_CONFIG(newbrain_acia_intf) | |
| 1266 | MDRV_ACIA6850_ADD("acia_0", newbrain_acia_intf) | |
| 1271 | 1267 | |
| 1272 | 1268 | MDRV_NEC765A_ADD("nec765", newbrain_nec765_interface) |
| 1273 | 1269 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 1289 | 1285 | MDRV_MACHINE_START(newbrain) |
| 1290 | 1286 | MDRV_MACHINE_RESET(newbrain) |
| 1291 | 1287 | |
| 1292 | MDRV_Z80CTC_ADD( "z80ctc", newbrain_ctc_intf ) | |
| 1288 | MDRV_Z80CTC_ADD( "z80ctc", 0, newbrain_ctc_intf ) | |
| 1293 | 1289 | |
| 1294 | 1290 | // video hardware |
| 1295 | 1291 | |
| r3957 | r3958 | |
| 1299 | 1295 | MDRV_CASSETTE_ADD( "cassette2", newbrain_cassette_config ) |
| 1300 | 1296 | |
| 1301 | 1297 | /* acia */ |
| 1302 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 1303 | MDRV_DEVICE_CONFIG(newbrain_acia_intf) | |
| 1298 | MDRV_ACIA6850_ADD("acia_0", newbrain_acia_intf) | |
| 1304 | 1299 | MACHINE_DRIVER_END |
| 1305 | 1300 | |
| 1306 | 1301 | static MACHINE_DRIVER_START( newbraia ) |
| r3957 | r3958 | |
| 1328 | 1323 | MDRV_CASSETTE_ADD( "cassette2", newbrain_cassette_config ) |
| 1329 | 1324 | |
| 1330 | 1325 | /* acia */ |
| 1331 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 1332 | MDRV_DEVICE_CONFIG(newbrain_acia_intf) | |
| 1326 | MDRV_ACIA6850_ADD("acia_0", newbrain_acia_intf) | |
| 1333 | 1327 | MACHINE_DRIVER_END |
| 1334 | 1328 | |
| 1335 | 1329 | static MACHINE_DRIVER_START( newbraiv ) |
| r3957 | r3958 | |
| 1349 | 1343 | MDRV_MACHINE_START(newbrain) |
| 1350 | 1344 | MDRV_MACHINE_RESET(newbrain) |
| 1351 | 1345 | |
| 1352 | MDRV_Z80CTC_ADD( "z80ctc", newbrain_ctc_intf ) | |
| 1346 | MDRV_Z80CTC_ADD( "z80ctc", 0, newbrain_ctc_intf ) | |
| 1353 | 1347 | |
| 1354 | 1348 | // video hardware |
| 1355 | 1349 | |
| r3957 | r3958 | |
| 1359 | 1353 | MDRV_CASSETTE_ADD( "cassette2", newbrain_cassette_config ) |
| 1360 | 1354 | |
| 1361 | 1355 | /* acia */ |
| 1362 | MDRV_DEVICE_ADD("acia_0", ACIA6850) | |
| 1363 | MDRV_DEVICE_CONFIG(newbrain_acia_intf) | |
| 1356 | MDRV_ACIA6850_ADD("acia_0", newbrain_acia_intf) | |
| 1364 | 1357 | MACHINE_DRIVER_END |
| 1365 | 1358 | |
| 1366 | 1359 | /* ROMs */ |
| r3957 | r3958 | |
|---|---|---|
| 250 | 250 | MDRV_SOUND_ADD("sn76489a", SN76489A, MTX_SYSTEM_CLOCK) |
| 251 | 251 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 252 | 252 | |
| 253 | MDRV_Z80CTC_ADD( "z80ctc", mtx_ctc_intf ) | |
| 253 | MDRV_Z80CTC_ADD( "z80ctc", MTX_SYSTEM_CLOCK, mtx_ctc_intf ) | |
| 254 | 254 | |
| 255 | 255 | /* printer */ |
| 256 | 256 | MDRV_PRINTER_ADD("printer") |
| r3957 | r3958 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | static const mc6845_interface einstein_crtc6845_interface = { |
| 260 | 260 | "main", |
| 261 | EINSTEIN_SYSTEM_CLOCK /*?*/, | |
| 262 | 261 | 8 /*?*/, |
| 263 | 262 | NULL, |
| 264 | 263 | einstein_6845_update_row, |
| r3957 | r3958 | |
| 525 | 524 | case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)einstein_daisy_irq_reti; break; |
| 526 | 525 | |
| 527 | 526 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 528 | case DEVINFO_STR_NAME: info->s = "Einstein daisy"; break; | |
| 529 | case DEVINFO_STR_FAMILY: info->s = "Z80"; break; | |
| 530 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 531 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 532 | case DEVINFO_STR_CREDITS: info->s = "Copyright the MESS Team"; break; | |
| 527 | case DEVINFO_STR_NAME: strcpy(info->s, "Einstein daisy"); break; | |
| 528 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Z80"); break; | |
| 529 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; | |
| 530 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 531 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; | |
| 533 | 532 | } |
| 534 | 533 | } |
| 535 | 534 | |
| r3957 | r3958 | |
| 1451 | 1450 | /* a reset causes the fire int, adc int, keyboard int mask |
| 1452 | 1451 | to be set to 1, which causes all these to be DISABLED */ |
| 1453 | 1452 | einstein_int_mask = 0; |
| 1454 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); | |
| 1453 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); | |
| 1455 | 1454 | |
| 1456 | 1455 | cpu_set_irq_callback(machine->cpu[0], einstein_cpu_acknowledge_int); |
| 1457 | 1456 | |
| r3957 | r3958 | |
| 1722 | 1721 | MDRV_CPU_PROGRAM_MAP(einstein_mem, 0) |
| 1723 | 1722 | MDRV_CPU_IO_MAP(einstein_io, 0) |
| 1724 | 1723 | MDRV_CPU_CONFIG(einstein_daisy_chain) |
| 1725 | MDRV_ | |
| 1724 | MDRV_QUANTUM_TIME | |
| 1726 | 1725 | |
| 1727 | 1726 | MDRV_MACHINE_START( einstein ) |
| 1728 | 1727 | MDRV_MACHINE_RESET( einstein ) |
| r3957 | r3958 | |
| 1766 | 1765 | MDRV_SCREEN_SIZE(640, 400) |
| 1767 | 1766 | MDRV_SCREEN_VISIBLE_AREA(0,640-1, 0, 400-1) |
| 1768 | 1767 | |
| 1769 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 1770 | MDRV_DEVICE_CONFIG( einstein_crtc6845_interface ) | |
| 1768 | MDRV_MC6845_ADD("crtc", MC6845, EINSTEIN_SYSTEM_CLOCK /*?*/, einstein_crtc6845_interface) | |
| 1771 | 1769 | |
| 1772 | 1770 | MDRV_VIDEO_UPDATE( einstein2 ) |
| 1773 | 1771 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
|---|---|---|
| 384 | 384 | MDRV_CPU_ADD("main", CP1610, XTAL_3_579545MHz/4) /* Colorburst/4 */ |
| 385 | 385 | MDRV_CPU_PROGRAM_MAP(intv_mem, 0) |
| 386 | 386 | MDRV_CPU_VBLANK_INT("main", intv_interrupt) |
| 387 | MDRV_ | |
| 387 | MDRV_QUANTUM_TIME | |
| 388 | 388 | |
| 389 | 389 | MDRV_MACHINE_RESET( intv ) |
| 390 | 390 | |
| r3957 | r3958 | |
| 419 | 419 | MDRV_CPU_PROGRAM_MAP(intv2_mem, 0) |
| 420 | 420 | MDRV_CPU_VBLANK_INT("main", intv_interrupt2) |
| 421 | 421 | |
| 422 | MDRV_ | |
| 422 | MDRV_QUANTUM_TIME | |
| 423 | 423 | |
| 424 | 424 | /* video hardware */ |
| 425 | 425 | MDRV_GFXDECODE(intvkbd) |
| r3957 | r3958 | |
|---|---|---|
| 139 | 139 | MDRV_CPU_ADD("main", Z80, XTAL_8MHz/2) /* 4.000 MHz, verified */ |
| 140 | 140 | MDRV_CPU_PROGRAM_MAP(z80_mem, 0) |
| 141 | 141 | MDRV_CPU_IO_MAP(z80_io, 0) |
| 142 | MDRV_ | |
| 142 | MDRV_QUANTUM_TIME | |
| 143 | 143 | |
| 144 | 144 | /* video hardware */ |
| 145 | 145 | MDRV_DEFAULT_LAYOUT(layout_votrpss) |
| r3957 | r3958 | |
|---|---|---|
| 306 | 306 | MDRV_CPU_ADD("main", Z80, XTAL_6_5MHz/2) /* 3.25 MHz */ |
| 307 | 307 | MDRV_CPU_PROGRAM_MAP(jupiter_mem, 0) |
| 308 | 308 | MDRV_CPU_IO_MAP(jupiter_io, 0) |
| 309 | MDRV_ | |
| 309 | MDRV_QUANTUM_TIME | |
| 310 | 310 | |
| 311 | 311 | MDRV_MACHINE_START( jupiter ) |
| 312 | 312 |
| r3957 | r3958 | |
|---|---|---|
| 563 | 563 | MDRV_CPU_PROGRAM_MAP(exelv_tms7040_map, 0) |
| 564 | 564 | MDRV_CPU_IO_MAP(exelv_tms7040_port, 0) |
| 565 | 565 | |
| 566 | MDRV_ | |
| 566 | MDRV_QUANTUM_TIME | |
| 567 | 567 | |
| 568 | 568 | MDRV_MACHINE_RESET( exelv ) |
| 569 | 569 |
| r3957 | r3958 | |
|---|---|---|
| 171 | 171 | |
| 172 | 172 | MDRV_MACHINE_RESET( osborne1 ) |
| 173 | 173 | |
| 174 | MDRV_DEVICE_ADD( "osborne1_daisy", OSBORNE1_DAISY ) | |
| 174 | MDRV_DEVICE_ADD( "osborne1_daisy", OSBORNE1_DAISY, 0 ) | |
| 175 | 175 | |
| 176 | 176 | MDRV_SCREEN_ADD("main", RASTER) |
| 177 | 177 | MDRV_SCREEN_FORMAT( BITMAP_FORMAT_INDEXED16 ) |
| r3957 | r3958 | |
|---|---|---|
| 201 | 201 | /* basic machine hardware */ |
| 202 | 202 | MDRV_CPU_ADD("main",M65C02,4915200) /* 65C02 */ |
| 203 | 203 | MDRV_CPU_PROGRAM_MAP(mephisto_mem, 0) |
| 204 | MDRV_ | |
| 204 | MDRV_QUANTUM_TIME | |
| 205 | 205 | MDRV_MACHINE_START( mephisto ) |
| 206 | 206 | MDRV_MACHINE_RESET( mephisto ) |
| 207 | 207 |
| r3957 | r3958 | |
|---|---|---|
| 320 | 320 | /* basic machine hardware */ |
| 321 | 321 | MDRV_CPU_ADD("main", M6502, 1000000) |
| 322 | 322 | MDRV_CPU_PROGRAM_MAP(ssystem3_map, 0) |
| 323 | MDRV_ | |
| 323 | MDRV_QUANTUM_TIME | |
| 324 | 324 | |
| 325 | 325 | /* video hardware */ |
| 326 | 326 | MDRV_SCREEN_ADD("main", LCD) |
| r3957 | r3958 | |
|---|---|---|
| 315 | 315 | MDRV_CPU_IO_MAP(vtech1_io, 0) |
| 316 | 316 | MDRV_SCREEN_ADD("main", RASTER) |
| 317 | 317 | MDRV_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 318 | MDRV_ | |
| 318 | MDRV_QUANTUM_TIME | |
| 319 | 319 | |
| 320 | 320 | MDRV_MACHINE_START(laser110) |
| 321 | 321 | |
| r3957 | r3958 | |
| 453 | 453 | if (!autorun) |
| 454 | 454 | memory_write_byte(space, 0x7929, 0xb6); /* turn off autorun */ |
| 455 | 455 | |
| 456 | cpu_set_reg(cpu, REG_PC, 0x791e); | |
| 456 | cpu_set_reg(cpu, REG_GENPC, 0x791e); | |
| 457 | 457 | } |
| 458 | 458 | else |
| 459 | 459 | { |
| 460 | 460 | if (autorun) |
| 461 | cpu_set_reg(cpu, REG_PC, execute_address); | |
| 461 | cpu_set_reg(cpu, REG_GENPC, execute_address); | |
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 |
| r3957 | r3958 | |
|---|---|---|
| 1455 | 1455 | /* FDC Motor Control - Bit 0 defines the state of the FDD motor: |
| 1456 | 1456 | * "1" the FDD motor will be active. |
| 1457 | 1457 | * "0" the FDD motor will be in-active.*/ |
| 1458 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), (data & 0x01)); | |
| 1459 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 1), (data & 0x01)); | |
| 1460 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1,1); | |
| 1461 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 1), 1,1); | |
| 1458 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), (data & 0x01)); | |
| 1459 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), (data & 0x01)); | |
| 1460 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 1,1); | |
| 1461 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 1), 1,1); | |
| 1462 | 1462 | break; |
| 1463 | 1463 | |
| 1464 | 1464 | case 0x03: /* Write Data register of FDC */ |
| r3957 | r3958 | |
| 2042 | 2042 | memory_install_write8_handler(space, 0xc000, 0xdfff, 0, 0, SMH_BANK15); |
| 2043 | 2043 | memory_install_write8_handler(space, 0xe000, 0xffff, 0, 0, SMH_BANK16); |
| 2044 | 2044 | |
| 2045 | c | |
| 2045 | device | |
| 2046 | 2046 | if(amstrad_system_type == SYSTEM_CPC) |
| 2047 | 2047 | cpu_set_input_line_vector(machine->cpu[0], 0,0xff); |
| 2048 | 2048 | else |
| r3957 | r3958 | |
| 2050 | 2050 | |
| 2051 | 2051 | if(amstrad_system_type != SYSTEM_GX4000) |
| 2052 | 2052 | { |
| 2053 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); | |
| 2054 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 1), FLOPPY_DRIVE_SS_40); | |
| 2053 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); | |
| 2054 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 1), FLOPPY_DRIVE_SS_40); | |
| 2055 | 2055 | } |
| 2056 | 2056 | /* Every microsecond: |
| 2057 | 2057 | |
| r3957 | r3958 | |
| 2070 | 2070 | |
| 2071 | 2071 | /* Using the cool code Juergen has provided, I will override |
| 2072 | 2072 | the timing tables with the values for the amstrad */ |
| 2073 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_op, (void*)amstrad_cycle_table_op); | |
| 2074 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_cb, (void*)amstrad_cycle_table_cb); | |
| 2075 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ed, (void*)amstrad_cycle_table_ed); | |
| 2076 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xy, (void*)amstrad_cycle_table_xy); | |
| 2077 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xycb, (void*)amstrad_cycle_table_xycb); | |
| 2078 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ex, (void*)amstrad_cycle_table_ex); | |
| 2073 | device_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_op, (void*)amstrad_cycle_table_op); | |
| 2074 | device_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_cb, (void*)amstrad_cycle_table_cb); | |
| 2075 | device_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ed, (void*)amstrad_cycle_table_ed); | |
| 2076 | device_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xy, (void*)amstrad_cycle_table_xy); | |
| 2077 | device_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xycb, (void*)amstrad_cycle_table_xycb); | |
| 2078 | device_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ex, (void*)amstrad_cycle_table_ex); | |
| 2079 | 2079 | |
| 2080 | 2080 | /* Juergen is a cool dude! */ |
| 2081 | 2081 | cpu_set_irq_callback(machine->cpu[0], amstrad_cpu_acknowledge_int); |
| r3957 | r3958 | |
| 2246 | 2246 | amstrad_common_init(machine); |
| 2247 | 2247 | amstrad_reset_machine(machine); |
| 2248 | 2248 | |
| 2249 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 2250 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 1), FLOPPY_DRIVE_DS_80); | |
| 2249 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); | |
| 2250 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 1), FLOPPY_DRIVE_DS_80); | |
| 2251 | 2251 | } |
| 2252 | 2252 | |
| 2253 | 2253 | /* Memory is banked in 16k blocks. However, the multiface |
| r3957 | r3958 | |
| 2951 | 2951 | MDRV_CPU_PROGRAM_MAP(amstrad_mem, 0) |
| 2952 | 2952 | MDRV_CPU_IO_MAP(amstrad_io, 0) |
| 2953 | 2953 | |
| 2954 | MDRV_ | |
| 2954 | MDRV_QUANTUM_TIME | |
| 2955 | 2955 | |
| 2956 | 2956 | MDRV_MACHINE_RESET( amstrad ) |
| 2957 | 2957 |
| r3957 | r3958 | |
|---|---|---|
| 308 | 308 | MDRV_CPU_PROGRAM_MAP(sms_mem, 0) |
| 309 | 309 | MDRV_CPU_IO_MAP(sms_io, 0) |
| 310 | 310 | |
| 311 | MDRV_ | |
| 311 | MDRV_QUANTUM_TIME | |
| 312 | 312 | |
| 313 | 313 | MDRV_MACHINE_START(sms) |
| 314 | 314 | MDRV_MACHINE_RESET(sms) |
| r3957 | r3958 | |
| 353 | 353 | MDRV_CPU_PROGRAM_MAP(sms_mem, 0) |
| 354 | 354 | MDRV_CPU_IO_MAP(sms_io, 0) |
| 355 | 355 | |
| 356 | MDRV_ | |
| 356 | MDRV_QUANTUM_TIME | |
| 357 | 357 | |
| 358 | 358 | MDRV_MACHINE_START(sms) |
| 359 | 359 | MDRV_MACHINE_RESET(sms) |
| r3957 | r3958 | |
| 400 | 400 | MDRV_CPU_PROGRAM_MAP(sms_mem, 0) |
| 401 | 401 | MDRV_CPU_IO_MAP(gg_io, 0) |
| 402 | 402 | |
| 403 | MDRV_ | |
| 403 | MDRV_QUANTUM_TIME | |
| 404 | 404 | |
| 405 | 405 | MDRV_MACHINE_START(sms) |
| 406 | 406 | MDRV_MACHINE_RESET(sms) |
| r3957 | r3958 | |
|---|---|---|
| 860 | 860 | MDRV_CPU_ADD("main", Z80, 4000000) |
| 861 | 861 | MDRV_CPU_PROGRAM_MAP(avigo_mem, 0) |
| 862 | 862 | MDRV_CPU_IO_MAP(avigo_io, 0) |
| 863 | MDRV_ | |
| 863 | MDRV_QUANTUM_TIME | |
| 864 | 864 | |
| 865 | 865 | MDRV_MACHINE_START( avigo ) |
| 866 | 866 | MDRV_MACHINE_RESET( avigo ) |
| r3957 | r3958 | |
|---|---|---|
| 309 | 309 | /* todo */ |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | static void psx_sio0( int n_data ) | |
| 312 | static void psx_sio0( running_machine *machine, int n_data ) | |
| 313 | 313 | { |
| 314 | 314 | /* todo: raise data & ack when nothing is driving it low */ |
| 315 | psx_pad( | |
| 315 | psx_pad( machine, 0, n_data ); | |
| 316 | 316 | psx_mcd( 0, n_data ); |
| 317 | psx_pad( | |
| 317 | psx_pad( machine, 1, n_data ^ PSX_SIO_OUT_DTR ); | |
| 318 | 318 | psx_mcd( 1, n_data ^ PSX_SIO_OUT_DTR ); |
| 319 | 319 | } |
| 320 | 320 |
| r3957 | r3958 | |
|---|---|---|
| 536 | 536 | |
| 537 | 537 | /* devices */ |
| 538 | 538 | MDRV_DRIVER_DATA(coupe_asic) |
| 539 | MDRV_ | |
| 539 | MDRV_MSM6242_ADD("sambus_clock" | |
| 540 | 540 | |
| 541 | 541 | /* sound hardware */ |
| 542 | 542 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r3957 | r3958 | |
|---|---|---|
| 138 | 138 | TMS9928A_interrupt(device->machine); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | static const device_config *printer_fp( | |
| 141 | static const device_config *printer_fp(running_machine *machine) | |
| 142 | 142 | { |
| 143 | return image_from_devtype_and_index(IO_PARALLEL, 0); | |
| 143 | return image_from_devtype_and_index(machine, IO_PARALLEL, 0); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| r3957 | r3958 | |
| 331 | 331 | { |
| 332 | 332 | case 0x20: |
| 333 | 333 | /* busy */ |
| 334 | reply = printer_fp() ? 0xff : 0x00; | |
| 334 | reply = printer_fp(space->machine) ? 0xff : 0x00; | |
| 335 | 335 | break; |
| 336 | 336 | |
| 337 | 337 | default: |
| r3957 | r3958 | |
| 358 | 358 | if (data && ! printer_strobe) |
| 359 | 359 | { |
| 360 | 360 | /* strobe is asserted: output data */ |
| 361 | if (printer_fp()) | |
| 362 | image_fwrite(printer_fp(), & printer_data, 1); | |
| 361 | if (printer_fp(space->machine)) | |
| 362 | image_fwrite(printer_fp(space->machine), & printer_data, 1); | |
| 363 | 363 | } |
| 364 | 364 | printer_strobe = data != 0; |
| 365 | 365 | break; |
| r3957 | r3958 | |
|---|---|---|
| 385 | 385 | MDRV_CPU_IO_MAP(io_level1, 0) |
| 386 | 386 | MDRV_CPU_VBLANK_INT("main", trs80_frame_interrupt) |
| 387 | 387 | MDRV_CPU_PERIODIC_INT(trs80_timer_interrupt, 40) |
| 388 | MDRV_ | |
| 388 | MDRV_QUANTUM_TIME | |
| 389 | 389 | |
| 390 | 390 | MDRV_MACHINE_RESET( trs80 ) |
| 391 | 391 |
| r3957 | r3958 | |
|---|---|---|
| 170 | 170 | MDRV_CPU_ADD("main", I8048, ( ( XTAL_7_15909MHz * 3 ) / 4 ) ) |
| 171 | 171 | MDRV_CPU_PROGRAM_MAP(odyssey2_mem, 0) |
| 172 | 172 | MDRV_CPU_IO_MAP(odyssey2_io, 0) |
| 173 | MDRV_ | |
| 173 | MDRV_QUANTUM_TIME | |
| 174 | 174 | |
| 175 | 175 | MDRV_MACHINE_RESET( odyssey2 ) |
| 176 | 176 | |
| r3957 | r3958 | |
| 203 | 203 | MDRV_CPU_ADD("main", I8048, ( XTAL_17_73447MHz / 3 ) ) |
| 204 | 204 | MDRV_CPU_PROGRAM_MAP(odyssey2_mem, 0) |
| 205 | 205 | MDRV_CPU_IO_MAP(odyssey2_io, 0) |
| 206 | MDRV_ | |
| 206 | MDRV_QUANTUM_TIME | |
| 207 | 207 | |
| 208 | 208 | MDRV_MACHINE_RESET( odyssey2 ) |
| 209 | 209 | |
| r3957 | r3958 | |
| 235 | 235 | MDRV_CPU_ADD("main", I8048, 5911000 ) |
| 236 | 236 | MDRV_CPU_PROGRAM_MAP(odyssey2_mem, 0) |
| 237 | 237 | MDRV_CPU_IO_MAP(g7400_io, 0) |
| 238 | MDRV_ | |
| 238 | MDRV_QUANTUM_TIME | |
| 239 | 239 | |
| 240 | 240 | MDRV_MACHINE_RESET( odyssey2 ) |
| 241 | 241 |
| r3957 | r3958 | |
|---|---|---|
| 563 | 563 | MDRV_CPU_ADD("main", M6502, 1021800) /* close to actual CPU frequency of 1.020484 MHz */ |
| 564 | 564 | MDRV_CPU_PROGRAM_MAP(apple2_map, 0) |
| 565 | 565 | MDRV_CPU_VBLANK_INT_HACK(apple2_interrupt, 192/8) |
| 566 | MDRV_ | |
| 566 | MDRV_QUANTUM_TIME | |
| 567 | 567 | |
| 568 | 568 | MDRV_MACHINE_START( apple2 ) |
| 569 | 569 |
| r3957 | r3958 | |
|---|---|---|
| 335 | 335 | MDRV_SCREEN_ADD("main", LCD) |
| 336 | 336 | MDRV_SCREEN_REFRESH_RATE(50) |
| 337 | 337 | MDRV_SCREEN_VBLANK_TIME(0) |
| 338 | MDRV_ | |
| 338 | MDRV_QUANTUM_TIME | |
| 339 | 339 | |
| 340 | 340 | MDRV_MACHINE_START( ti81 ) |
| 341 | 341 |
| r3957 | r3958 | |
|---|---|---|
| 480 | 480 | MDRV_CPU_PROGRAM_MAP(c64_mem, 0) |
| 481 | 481 | MDRV_CPU_VBLANK_INT("main", c64_frame_interrupt) |
| 482 | 482 | MDRV_CPU_PERIODIC_INT(vic2_raster_irq, VIC6567_HRETRACERATE) |
| 483 | MDRV_ | |
| 483 | MDRV_QUANTUM_TIME | |
| 484 | 484 | |
| 485 | 485 | MDRV_MACHINE_START( c64 ) |
| 486 | 486 | |
| r3957 | r3958 | |
| 505 | 505 | MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config ) |
| 506 | 506 | |
| 507 | 507 | /* cia */ |
| 508 | MDRV_DEVICE_ADD("cia_0", CIA6526R1) | |
| 509 | MDRV_DEVICE_CONFIG(c64_ntsc_cia0) | |
| 510 | MDRV_DEVICE_ADD("cia_1", CIA6526R1) | |
| 511 | MDRV_DEVICE_CONFIG(c64_ntsc_cia1) | |
| 508 | MDRV_CIA6526_ADD("cia_0", CIA6526R1, 0, c64_ntsc_cia0) | |
| 509 | MDRV_CIA6526_ADD("cia_1", CIA6526R1, 0, c64_ntsc_cia1) | |
| 512 | 510 | |
| 513 | 511 | /* via */ |
| 514 | 512 | MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2) |
| r3957 | r3958 | |
| 520 | 518 | MDRV_CPU_PROGRAM_MAP(c64_mem, 0) |
| 521 | 519 | MDRV_CPU_VBLANK_INT("main", c64_frame_interrupt) |
| 522 | 520 | MDRV_CPU_PERIODIC_INT(vic2_raster_irq, VIC6569_HRETRACERATE) |
| 523 | MDRV_ | |
| 521 | MDRV_QUANTUM_TIME | |
| 524 | 522 | |
| 525 | 523 | MDRV_MACHINE_START( c64 ) |
| 526 | 524 | |
| r3957 | r3958 | |
| 545 | 543 | MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config ) |
| 546 | 544 | |
| 547 | 545 | /* cia */ |
| 548 | MDRV_DEVICE_ADD("cia_0", CIA6526R1) | |
| 549 | MDRV_DEVICE_CONFIG(c64_pal_cia0) | |
| 550 | MDRV_DEVICE_ADD("cia_1", CIA6526R1) | |
| 551 | MDRV_DEVICE_CONFIG(c64_pal_cia1) | |
| 546 | MDRV_CIA6526_ADD("cia_0", CIA6526R1, 0, c64_pal_cia0) | |
| 547 | MDRV_CIA6526_ADD("cia_1", CIA6526R1, 0, c64_pal_cia1) | |
| 552 | 548 | MACHINE_DRIVER_END |
| 553 | 549 | |
| 554 | 550 | static MACHINE_DRIVER_START( ultimax ) |
| r3957 | r3958 | |
| 581 | 577 | MDRV_SOUND_REMOVE( "dac" ) |
| 582 | 578 | MDRV_CASSETTE_REMOVE( "cassette" ) |
| 583 | 579 | #ifdef CPU_SYNC |
| 584 | MDRV_ | |
| 580 | MDRV_QUANTUM_TIME | |
| 585 | 581 | #else |
| 586 | MDRV_ | |
| 582 | MDRV_QUANTUM_TIME | |
| 587 | 583 | #endif |
| 588 | 584 | MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2) |
| 589 | 585 | MDRV_VIA6522_ADD("via6522_3", 0, vc1541_via3) |
| r3957 | r3958 | |
|---|---|---|
| 275 | 275 | MDRV_CPU_PROGRAM_MAP( svi318_mem, 0 ) |
| 276 | 276 | MDRV_CPU_IO_MAP( svi318_io, 0 ) |
| 277 | 277 | MDRV_CPU_VBLANK_INT("main", svi318_interrupt) |
| 278 | MDRV_ | |
| 278 | MDRV_QUANTUM_TIME | |
| 279 | 279 | |
| 280 | 280 | MDRV_MACHINE_START( svi318_pal ) |
| 281 | 281 | MDRV_MACHINE_RESET( svi318 ) |
| r3957 | r3958 | |
| 322 | 322 | static const mc6845_interface svi806_crtc6845_interface = |
| 323 | 323 | { |
| 324 | 324 | "svi806", |
| 325 | XTAL_12MHz / 8, | |
| 326 | 325 | 8 /*?*/, |
| 327 | 326 | NULL, |
| 328 | 327 | svi806_crtc6845_update_row, |
| r3957 | r3958 | |
| 338 | 337 | MDRV_CPU_PROGRAM_MAP( svi328_806_mem, 0 ) |
| 339 | 338 | MDRV_CPU_IO_MAP( svi328_806_io, 0 ) |
| 340 | 339 | MDRV_CPU_VBLANK_INT("main", svi318_interrupt) |
| 341 | MDRV_ | |
| 340 | MDRV_QUANTUM_TIME | |
| 342 | 341 | |
| 343 | 342 | MDRV_MACHINE_START( svi318_pal ) |
| 344 | 343 | MDRV_MACHINE_RESET( svi328_806 ) |
| r3957 | r3958 | |
| 364 | 363 | MDRV_SCREEN_SIZE(640, 400) |
| 365 | 364 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1) |
| 366 | 365 | |
| 367 | MDRV_DEVICE_ADD("crtc", MC6845) | |
| 368 | MDRV_DEVICE_CONFIG( svi806_crtc6845_interface ) | |
| 366 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_12MHz / 8, svi806_crtc6845_interface) | |
| 369 | 367 | |
| 370 | 368 | MDRV_VIDEO_START( svi328_806 ) |
| 371 | 369 | MDRV_VIDEO_UPDATE( svi328_806 ) |
| r3957 | r3958 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | #include "driver.h" |
| 106 | //#include "cpu/nec/nec.h" | |
| 107 | //#include "cpu/i86/i86.h" | |
| 106 | #include "cpu/nec/nec.h" | |
| 107 | #include "cpu/i86/i86.h" | |
| 108 | 108 | #include "deprecat.h" |
| 109 | 109 | |
| 110 | 110 | #include "machine/8255ppi.h" |
| r3957 | r3958 | |
| 1331 | 1331 | MDRV_CPU_IO_MAP(pc8_io, 0) |
| 1332 | 1332 | MDRV_CPU_VBLANK_INT_HACK(pc_frame_interrupt, 4) |
| 1333 | 1333 | |
| 1334 | MDRV_ | |
| 1334 | MDRV_QUANTUM_TIME | |
| 1335 | 1335 | |
| 1336 | 1336 | MDRV_MACHINE_START(pc) |
| 1337 | 1337 | MDRV_MACHINE_RESET(pc) |
| r3957 | r3958 | |
| 1459 | 1459 | MDRV_CPU_IO_MAP(pc8_io, 0) |
| 1460 | 1460 | MDRV_CPU_CONFIG(i86_address_mask) |
| 1461 | 1461 | |
| 1462 | MDRV_ | |
| 1462 | MDRV_QUANTUM_TIME | |
| 1463 | 1463 | |
| 1464 | 1464 | MDRV_MACHINE_START(pc) |
| 1465 | 1465 | MDRV_MACHINE_RESET(pc) |
| r3957 | r3958 | |
| 1519 | 1519 | /* basic machine hardware */ |
| 1520 | 1520 | MDRV_CPU_PC(pc8, pc8, I8088, 4772720, pc_frame_interrupt) /* 4,77 MHz */ |
| 1521 | 1521 | |
| 1522 | MDRV_ | |
| 1522 | MDRV_QUANTUM_TIME | |
| 1523 | 1523 | |
| 1524 | 1524 | MDRV_MACHINE_START(pc) |
| 1525 | 1525 | MDRV_MACHINE_RESET(pc) |
| r3957 | r3958 | |
|---|---|---|
| 146 | 146 | MDRV_CPU_PROGRAM_MAP(pce_mem, 0) |
| 147 | 147 | MDRV_CPU_IO_MAP(pce_io, 0) |
| 148 | 148 | MDRV_CPU_VBLANK_INT_HACK(pce_interrupt, VDC_LPF) |
| 149 | MDRV_ | |
| 149 | MDRV_QUANTUM_TIME | |
| 150 | 150 | |
| 151 | 151 | MDRV_MACHINE_RESET( pce ) |
| 152 | 152 | |
| r3957 | r3958 | |
| 187 | 187 | MDRV_CPU_PROGRAM_MAP(sgx_mem, 0) |
| 188 | 188 | MDRV_CPU_IO_MAP(sgx_io, 0) |
| 189 | 189 | MDRV_CPU_VBLANK_INT_HACK(sgx_interrupt, VDC_LPF) |
| 190 | MDRV_ | |
| 190 | MDRV_QUANTUM_TIME | |
| 191 | 191 | |
| 192 | 192 | MDRV_MACHINE_RESET( pce ) |
| 193 | 193 |
| r3957 | r3958 | |
|---|---|---|
| 193 | 193 | MDRV_CPU_PROGRAM_MAP(vc4000_mem, 0) |
| 194 | 194 | MDRV_CPU_IO_MAP(vc4000_io, 0) |
| 195 | 195 | MDRV_CPU_PERIODIC_INT(vc4000_video_line, 312*50) |
| 196 | MDRV_ | |
| 196 | MDRV_QUANTUM_TIME | |
| 197 | 197 | |
| 198 | 198 | /* video hardware */ |
| 199 | 199 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
|---|---|---|
| 727 | 727 | MDRV_SCREEN_ADD("main", RASTER) |
| 728 | 728 | MDRV_SCREEN_REFRESH_RATE(50) |
| 729 | 729 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(128)) |
| 730 | MDRV_ | |
| 730 | MDRV_QUANTUM_TIME | |
| 731 | 731 | |
| 732 | 732 | MDRV_MACHINE_START( bbca ) |
| 733 | 733 | MDRV_MACHINE_RESET( bbca ) |
| r3957 | r3958 | |
| 752 | 752 | MDRV_CASSETTE_ADD( "cassette", bbc_cassette_config ) |
| 753 | 753 | |
| 754 | 754 | /* acia */ |
| 755 | MDRV_DEVICE_ADD("acia6850", ACIA6850) | |
| 756 | MDRV_DEVICE_CONFIG(bbc_acia6850_interface) | |
| 755 | MDRV_ACIA6850_ADD("acia6850", bbc_acia6850_interface) | |
| 757 | 756 | |
| 758 | 757 | /* devices */ |
| 759 | 758 | MDRV_UPD7002_ADD("upd7002",BBC_uPD7002) |
| r3957 | r3958 | |
| 806 | 805 | MDRV_CPU_PROGRAM_MAP( bbcm_mem, 0 ) |
| 807 | 806 | MDRV_CPU_VBLANK_INT("main", bbcb_vsync) /* screen refresh interrupts */ |
| 808 | 807 | MDRV_CPU_PERIODIC_INT(bbcm_keyscan, 1000) /* scan keyboard */ |
| 809 | MDRV_ | |
| 808 | MDRV_QUANTUM_TIME | |
| 810 | 809 | |
| 811 | 810 | MDRV_MACHINE_START( bbcm ) |
| 812 | 811 | MDRV_MACHINE_RESET( bbcm ) |
| r3957 | r3958 | |
| 838 | 837 | MDRV_CASSETTE_ADD( "cassette", bbc_cassette_config ) |
| 839 | 838 | |
| 840 | 839 | /* acia */ |
| 841 | MDRV_DEVICE_ADD("acia6850", ACIA6850) | |
| 842 | MDRV_DEVICE_CONFIG(bbc_acia6850_interface) | |
| 840 | MDRV_ACIA6850_ADD("acia6850", bbc_acia6850_interface) | |
| 843 | 841 | |
| 844 | 842 | /* devices */ |
| 845 | 843 | MDRV_UPD7002_ADD("upd7002",BBC_uPD7002) |
| r3957 | r3958 | |
|---|---|---|
| 32 | 32 | ******************************************************************************/ |
| 33 | 33 | |
| 34 | 34 | #include "driver.h" |
| 35 | ||
| 35 | ||
| 36 | 36 | #include "machine/8255ppi.h" |
| 37 | 37 | #include "includes/compis.h" |
| 38 | 38 | #include "video/i82720.h" |
| r3957 | r3958 | |
| 240 | 240 | MDRV_CPU_VBLANK_INT("main", compis_vblank_int) |
| 241 | 241 | MDRV_CPU_CONFIG(i86_address_mask) |
| 242 | 242 | |
| 243 | MDRV_ | |
| 243 | MDRV_QUANTUM_TIME | |
| 244 | 244 | |
| 245 | 245 | MDRV_MACHINE_RESET(compis) |
| 246 | 246 |
| r3957 | r3958 | |
|---|---|---|
| 49 | 49 | /* TODO */ |
| 50 | 50 | static const z80pio_interface bbcbc_z80pio_intf = |
| 51 | 51 | { |
| 52 | "main", | |
| 53 | 0, | |
| 54 | 52 | NULL, /* int callback */ |
| 55 | 53 | NULL, /* port a read */ |
| 56 | 54 | NULL, /* port b read */ |
| r3957 | r3958 | |
|---|---|---|
| 415 | 415 | MDRV_SCREEN_ADD("main", RASTER) |
| 416 | 416 | MDRV_SCREEN_REFRESH_RATE(50) |
| 417 | 417 | MDRV_SCREEN_VBLANK_TIME(0) |
| 418 | MDRV_ | |
| 418 | MDRV_QUANTUM_TIME | |
| 419 | 419 | |
| 420 | 420 | MDRV_MACHINE_RESET( laser350 ) |
| 421 | 421 |
| r3957 | r3958 | |
|---|---|---|
| 318 | 318 | |
| 319 | 319 | static const z80ctc_interface kc85_disc_ctc_intf = |
| 320 | 320 | { |
| 321 | "main", /* cpu */ | |
| 322 | 0, /* timer clock */ | |
| 323 | 321 | 0, /* timer disablers */ |
| 324 | 322 | NULL, /* interrupt callback */ |
| 325 | 323 | NULL, /* ZC/TO0 callback */ |
| r3957 | r3958 | |
| 347 | 345 | MDRV_CPU_PROGRAM_MAP(kc85_disc_hw_mem, 0) |
| 348 | 346 | MDRV_CPU_IO_MAP(kc85_disc_hw_io, 0) |
| 349 | 347 | |
| 350 | MDRV_Z80CTC_ADD( "z80ctc_1", kc85_disc_ctc_intf ) | |
| 348 | MDRV_Z80CTC_ADD( "z80ctc_1", 0, kc85_disc_ctc_intf ) | |
| 351 | 349 | |
| 352 | 350 | MDRV_NEC765A_ADD("nec765", kc_fdc_interface) |
| 353 | 351 | MACHINE_DRIVER_END |
| r3957 | r3958 | |
| 360 | 358 | MDRV_CPU_PROGRAM_MAP(kc85_3_mem, 0) |
| 361 | 359 | MDRV_CPU_IO_MAP(kc85_3_io, 0) |
| 362 | 360 | MDRV_CPU_CONFIG(kc85_daisy_chain) |
| 363 | MDRV_ | |
| 361 | MDRV_QUANTUM_TIME | |
| 364 | 362 | |
| 365 | 363 | MDRV_MACHINE_RESET( kc85_3 ) |
| 366 | 364 | |
| 367 | 365 | MDRV_Z80PIO_ADD( "z80pio", kc85_pio_intf ) |
| 368 | MDRV_Z80CTC_ADD( "z80ctc", kc85_ctc_intf ) | |
| 366 | MDRV_Z80CTC_ADD( "z80ctc", 1379310.344828, kc85_ctc_intf ) | |
| 369 | 367 | |
| 370 | 368 | /* video hardware */ |
| 371 | 369 | MDRV_SCREEN_ADD("main", RASTER) |
| r3957 | r3958 | |
| 410 | 408 | static MACHINE_DRIVER_START( kc85_4d ) |
| 411 | 409 | MDRV_IMPORT_FROM( kc85_4 ) |
| 412 | 410 | MDRV_IMPORT_FROM( cpu_kc_disc ) |
| 413 | MDRV_ | |
| 411 | MDRV_QUANTUM_TIME | |
| 414 | 412 | MDRV_MACHINE_RESET( kc85_4d ) |
| 415 | 413 | MACHINE_DRIVER_END |
| 416 | 414 |
| r3957 | r3958 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | Source Changes: |
| 72 | 72 | ---------------- |
| 73 | - The core is based on MAME 0.128u | |
| 73 | - The core is based on MAME 0.128u7. This incorporates all features of the | |
| 74 | 74 | update to this core. [MAME team] |
| 75 | 75 | |
| 76 | 76 | - Changed the 8251 UART implementation to be a device. [Nathan Woods] |
| Previous | 15994 Revisions | Next |