| Previous | 15994 Revisions | Next |
| r1592 Friday 25th January, 2008 at 13:59:42 UTC by Nathan Woods |
|---|
| Updated to MAME 0.122u7 core |
| [docs] | messnew.txt |
| [src/emu] | cheat.c cheat.h config.c config.h cpuexec.c cpuexec.h cpuint.c cpuint.h driver.h emupal.c mame.c memory.c memory.h rendlay.c romload.c sndintrf.c sndintrf.h sound.c sound.h tilemap.c tilemap.h ui.c ui.h uigfx.c uigfx.h uimenu.c uimenu.h video.c video.h |
| [src/emu/cpu/arm7] | arm7dasm.c arm7exec.c |
| [src/emu/cpu/ccpu] | ccpu.c |
| [src/emu/cpu/cp1610] | cp1610.c |
| [src/emu/cpu/hd6309] | hd6309.c |
| [src/emu/cpu/i8051] | i8051.c |
| [src/emu/cpu/i8085] | i8085.c i8085.h |
| [src/emu/cpu/jaguar] | jaguar.c |
| [src/emu/cpu/m37710] | m37710.c |
| [src/emu/cpu/m6502] | m6502.h m6509.h |
| [src/emu/cpu/m6800] | m6800.c |
| [src/emu/cpu/m68000] | m68kcpu.c |
| [src/emu/cpu/mips] | mips3com.c |
| [src/emu/cpu/rsp] | rsp.c rsp.h |
| [src/emu/cpu/sh4] | sh4.c |
| [src/emu/cpu/sm8500] | sm8500d.c |
| [src/emu/cpu/tms34010] | 34010ops.c tms34010.c |
| [src/emu/cpu/tms7000] | tms7000.c |
| [src/emu/cpu/z80gb] | z80gb.c |
| [src/emu/debug] | debugcpu.c debugvw.c |
| [src/emu/drivers] | xtal.h |
| [src/emu/machine] | 8042kbdc.c 8237dma.c 8257dma.c generic.c tmp68301.c z80dma.c |
| [src/emu/sound] | 5110intf.c 5110intf.h disc_inp.c discrete.c discrete.h hc55516.c hc55516.h msm5232.c s14001a.c s14001a.h scsp.c scsplfo.c sid.c sidenvel.c sidenvel.h sidvoice.c sound.mak tms5110.c tms5110.h |
| [src/emu/video] | generic.c generic.h resnet.c v9938.c voodoo.c |
| [src/lib/util] | pool.c |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/audio] | 8080bw.c aztarac.c cage.c carnival.c cchasm.c cinemat.c cyberbal.c dcs.c dkong.c exidy.c exidy440.c galaxian.c gottlieb.c gyruss.c harddriv.c irem.c jaguar.c leland.c m72.c mario.c mcr.c n8080.c namco54.c namcoc7x.c phoenix.c redalert.c scramble.c segag80r.c segasnd.c seibu.c senjyo.c spacefb.c starwars.c system16.c t5182.c taito_en.c taitosnd.c timeplt.c trackfld.c williams.c |
| [src/mame/drivers] | 1942.c 20pacgal.c 2mindril.c 40love.c 88games.c acefruit.c acommand.c actfancr.c aeroboto.c aerofgt.c airbustr.c aladbl.c alg.c aliens.c alpha68k.c ambush.c amspdwy.c angelkds.c aquarium.c arcadecl.c arcadia.c argus.c artmagic.c ashnojoe.c asterix.c astinvad.c astrocde.c astrof.c asuka.c atarifb.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c ataxx.c atetris.c avalnche.c backfire.c badlands.c bagman.c balsente.c baraduke.c batman.c battlane.c battlera.c battlnts.c bbusters.c beaminv.c beathead.c berzerk.c bfcobra.c bfm_sc2.c bigevglf.c bionicc.c bishi.c bishjan.c bking2.c bladestl.c blktiger.c blockade.c blockhl.c blockout.c blstroid.c blueprnt.c bmcbowl.c bnstars.c boogwing.c bottom9.c boxer.c brkthru.c btime.c btoads.c bublbobl.c buggychl.c bwidow.c bwing.c bzone.c cabal.c capbowl.c cave.c cball.c cbasebal.c cbuster.c ccastles.c cchasm.c cclimber.c centiped.c cham24.c champbas.c changela.c chinagat.c chqflag.c cidelsa.c circusc.c cischeat.c cliffhgr.c cloak.c cloud9.c cninja.c cntsteer.c combatsc.c commando.c compgolf.c contra.c coolpool.c coolridr.c cop01.c cosmic.c cowrace.c cps1.c cps2.c cps3.c crgolf.c crimfght.c crospang.c crshrace.c crystal.c cshooter.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 dbz.c dcheese.c ddayjlc.c ddealer.c ddenlovr.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco156.c deco32.c deco_mlc.c decocass.c deniam.c destroyr.c dietgo.c discoboy.c diverboy.c djboy.c djmain.c dkong.c dlair.c dmndrby.c dogfgt.c dooyong.c dragrace.c dribling.c drmicro.c dwarfd.c dynax.c dynduke.c egghunt.c enigma2.c eolithsp.c eprom.c equites.c ertictac.c esd16.c esh.c espial.c ettrivia.c exctsccr.c exedexes.c exerion.c exidy440.c expro02.c exprraid.c exterm.c exzisus.c f1gp.c fantland.c fastlane.c fcombat.c fgoal.c filetto.c finalizr.c findout.c firebeat.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c freekick.c fromanc2.c fromance.c funkyjet.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaelco3d.c gaiden.c galaga.c galaxian.c galpani2.c galpani3.c galpanic.c galspnbl.c gamecstl.c gameplan.c gaplus.c gauntlet.c gberet.c gbusters.c gcpinbal.c genesis.c ghosteo.c gijoe.c ginganin.c gladiatr.c glass.c goal92.c goodejan.c gotcha.c gottlieb.c gpworld.c gradius3.c grchamp.c gridlee.c groundfx.c gstriker.c gsword.c gticlub.c gunbustr.c gundealr.c gunpey.c hal21.c halleys.c hcastle.c hexion.c higemaru.c hnayayoi.c hng64.c homedata.c hornet.c hotblock.c hshavoc.c hyprduel.c igs_180.c igs_blit.c igs_m027.c imolagp.c inufuku.c iqblock.c irobot.c ironhors.c istellar.c itech32.c itech8.c jack.c jackal.c jackpool.c jailbrek.c jalmah.c jchan.c jcross.c jedi.c jollyjgr.c jpmimpct.c jrpacman.c junofrst.c kaneko16.c kangaroo.c karnov.c kchamp.c kingobox.c kingpin.c kinst.c kinstb.c klax.c konamigq.c konamigv.c konamigx.c konamim2.c kopunch.c ksys573.c kyugo.c labyrunr.c ladybug.c ladyfrog.c laserbas.c laserbat.c lasso.c lastduel.c lastfght.c lazercmd.c legionna.c lemmings.c lethal.c lgp.c liberate.c littlerb.c lkage.c lockon.c looping.c lordgun.c lsasquad.c lwings.c m107.c m72.c m79amb.c m90.c m92.c macrossp.c madalien.c madmotor.c magmax.c mainevt.c mainsnk.c mappy.c marineb.c mario.c marvins.c mastboy.c matmania.c maxaflex.c mayumi.c mazerbla.c mcatadv.c meadows.c mediagx.c megadriv.c megaplay.c megasys1.c megatech.c megazone.c meijinsn.c metlclsh.c metro.c mgolf.c micro3d.c midvunit.c midzeus.c mikie.c mirax.c missb2.c missile.c mitchell.c mlanding.c model1.c model2.c model3.c momoko.c moo.c mouser.c mpatrol.c mpu4.c mpu4drvr.c mquake.c mrflea.c ms32.c msisaac.c mugsmash.c multigam.c munchmo.c murogem.c mustache.c mw8080bw.c mystston.c mystwarr.c n8080.c namcofl.c namcona1.c namconb1.c namcond1.c namcos1.c namcos11.c namcos12.c namcos21.c namcos22.c namcos23.c namcos86.c naomi.c naughtyb.c nbmj8991.c nbmj9195.c nemesis.c neodrvr.c neogeo.c ninjakd2.c ninjakun.c* ninjaw.c niyanpai.c nmg5.c nmk16.c nss.c nwk-tr.c nycaptor.c nyny.c offtwall.c ojankohs.c olibochu.c omegrace.c oneshot.c onetwo.c opwolf.c orbit.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c panicr.c paradise.c paranoia.c parodius.c pbaction.c pcktgal.c peplus.c pgm.c phoenix.c pingpong.c pipedrm.c pipeline.c pitnrun.c pkscram.c playch10.c plygonet.c pntnpuzl.c pokechmp.c polepos.c policetr.c polyplay.c poolshrk.c popeye.c popper.c powerins.c prehisle.c progolf.c psikyo.c psikyo4.c psikyosh.c psychic5.c pturn.c punchout.c pushman.c qdrmfgp.c qix.c quasar.c r2dtank.c rabbit.c raiden.c raiden2.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c realbrk.c redalert.c redclash.c relief.c renegade.c retofinv.c rockola.c rockrage.c rohga.c rollerg.c rollrace.c rotaryf.c royalmah.c rpunch.c runaway.c rungun.c sandscrp.c sangho.c sauro.c sbasketb.c sbowling.c sbrkout.c sbugger.c scotrsht.c scramble.c seattle.c segac2.c segae.c segag80r.c segag80v.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c seta2.c sf.c sg1000a.c sgladiat.c shadfrce.c shangha3.c shanghai.c shangkid.c shaolins.c shootout.c shougi.c shuuz.c sidearms.c sidepckt.c simpl156.c simpsons.c skullxbo.c skyarmy.c skychut.c skydiver.c skyfox.c skykid.c skylncr.c slapshot.c sliver.c snk.c snk68.c snowbros.c solomon.c sonson.c spacefb.c spaceg.c spbactn.c spcforce.c spdodgeb.c speedspn.c speglsht.c spiders.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c spy.c srmp2.c srmp6.c srumbler.c ssf2md.c ssfindo.c sshangha.c sslam.c ssozumo.c sspeedr.c ssv.c st0016.c stadhero.c starshp1.c starwars.c statriv2.c stfight.c stv.c stvinit.c subs.c suna16.c suna8.c supbtime.c superchs.c superdq.c superqix.c supertnk.c suprgolf.c suprloco.c suprnova.c suprridr.c suprslam.c surpratk.c system1.c system16.c system18.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_x.c taito_z.c taitoair.c taitojc.c taitosj.c taitowlf.c talbot.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c tbowl.c tceptor.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c tempest.c tetrisp2.c thayers.c thedeep.c thief.c thunderj.c thunderx.c tickee.c tigeroad.c timelimt.c tmaster.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c toobin.c topspeed.c toratora.c toypop.c tp84.c triplhnt.c truco.c trucocl.c trvmadns.c trvquest.c tryout.c tsamurai.c ttchamp.c tubep.c tugboat.c tumbleb.c tumblep.c 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 vaportra.c vastar.c vball.c vegas.c vendetta.c vicdual.c videopin.c vindictr.c viper.c volfied.c vulgus.c wardner.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c wheelfir.c williams.c wilytowr.c wink.c wiping.c witch.c wolfpack.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c xorworld.c xxmissio.c xybots.c xyonix.c yiear.c yunsun16.c yunsung8.c zaccaria.c zaxxon.c zerozone.c zn.c zodiack.c zr107.c |
| [src/mame/includes] | astrocde.h atarifb.h dkong.h exidy.h mario.h ninjakd2.h* phoenix.h redalert.h* system16.h williams.h |
| [src/mame/machine] | ajax.c amiga.c asic65.c asteroid.c atari.c atarifb.c atarigen.c atarigen.h balsente.c beezer.c bigevglf.c bsktball.c bublbobl.c buggychl.c carpolo.c cps2crpt.c cubocd32.c dc.c dec0.c decocass.c decoprot.c docastle.c equites.c flstory.c galaxian.c harddriv.c irem_cpu.c irobot.c konppc.c leland.c lkage.c lsasquad.c mcr.c mexico86.c mhavoc.c midtunit.c midwunit.c midyunit.c mw8080bw.c n64.c namco50.c namcoio.c namcond1.c namcos1.c namcos2.c nb1413m3.c nycaptor.c pcshare.c pitnrun.c playch10.c psx.c qix.c retofinv.c scramble.c scudsp.c segaic16.c simpsons.c slapfght.c slikshot.c snes.c stactics.c stfight.c subs.c system16.c tait8741.c taitosj.c tatsumi.c tnzs.c toaplan1.c twincobr.c tx1.c vertigo.c vsnes.c williams.c xevious.c |
| [src/mame/video] | 1942.c 4enraya.c amiga.c arkanoid.c asterix.c astrocde.c atari.c atarifb.c atarirle.c atarisy1.c avgdvg.c aztarac.c battlera.c beathead.c beezer.c bfm_adr2.c blktiger.c btime.c btoads.c bwing.c canyon.c capbowl.c carpolo.c cchasm.c cinemat.c circus.c cischeat.c combatsc.c commando.c cps1.c csk.c ddragon.c dec0.c dec8.c decocass.c dkong.c dynax.c exctsccr.c exerion.c exidy.c exidy440.c fcombat.c flstory.c fromance.c galaxian.c galpani2.c genesis.c ginganin.c goldstar.c gticlub.c hng64.c homedata.c jaguar.c jailbrek.c jpmimpct.c kaneko16.c lasso.c leland.c lethalj.c liberate.c lwings.c m72.c m92.c mario.c megasys1.c metro.c midtunit.c midvunit.c midyunit.c midzeus.c midzeus2.c mitchell.c mpatrol.c mrdo.c n64.c n8080.c namcos22.c nbmj8688.c nemesis.c ninjakd2.c ninjakun.c* ninjaw.c nmk16.c nycaptor.c phoenix.c pitnrun.c playch10.c policetr.c quasar.c redalert.c rpunch.c segag80r.c segag80v.c segasyse.c seta.c seta2.c sidearms.c simpsons.c skychut.c slapshot.c snk.c spdodgeb.c ssv.c stadhero.c stvvdp1.c system16.c taito_b.c taito_z.c tmnt.c toaplan1.c toaplan2.c tubep.c tx1.c vball.c vdc.c vicdual.c victory.c vsnes.c wiz.c wwfwfest.c |
| [src/mess] | mess.mak |
| [src/mess/drivers] | a310.c abc80.c adam.c amstrad.c apf.c aquarius.c atarist.c avigo.c bbcbc.c coleco.c coupe.c crvision.c einstein.c enterp.c ex800.c exelv.c glasgow.c intv.c ip22.c jupiter.c mephisto.c mk1.c mk2.c nascom1.c nc.c p2000t.c pcw.c pcw16.c ql.c saturn.c sg1000.c sord.c spectrum.c studio2.c super80.c svision.c ti99_2.c tm990189.c tmc1800.c tmc2000e.c tmc600.c tutor.c vtech2.c x68k.c z88.c |
| [src/mess/machine] | 99_dsk.c advision.c aim65.c amigacrt.c apple1.c apple2.c apple2gs.c apple3.c astrocde.c at.c atom.c ay3600.c bbc.c bebox.c c128.c c16.c c64.c cbmb.c cgenie.c coco.c compis.c concept.c dai.c dgn_beta.c electron.c europc.c galaxy.c gamecom.c gb.c genesis.c geneve.c hd63450.c intv.c kc.c kim1.c lisa.c lynx.c mac.c mbee.c microtan.c msx.c mtx.c mz700.c nes_mmc.c oric.c osborne1.c pc8801.c pc_turbo.c pce.c pdp1.c pet.c primo.c sms.c spectrum.c svi318.c sym1.c tandy1t.c thomson.c ti85.c ti990.c ti99_4x.c trs80.c vc1541.c vc20.c vectrex.c wswan.c |
| [src/mess/video] | a7800.c amstrad.c atarist.c cdp1861.c cdp1864.c gb.c m6847.c nes.c odyssey2.c trs80.c vc4000.c vectrex.c vic4567.c vtech1.c x68k.c zx.c |
| [src/osd/windows] | debugwin.c drawd3d.c drawdd.c eivc.h vconv.c |
| r1591 | r1592 | |
|---|---|---|
| 71 | 71 | case 0x41: |
| 72 | 72 | sound_flags |= 0x40; |
| 73 | 73 | soundlatch4_w (offset, data); |
| 74 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 74 | cpunum_set_input_line(Machine, 0, 1, HOLD_LINE); | |
| 75 | 75 | break; |
| 76 | 76 | |
| 77 | 77 | case 0x61: |
| r1591 | r1592 | |
| 99 | 99 | sound_flags |= 0x80; |
| 100 | 100 | soundlatch2_w (offset, data); |
| 101 | 101 | z80ctc_0_trg2_w (0, 1); |
| 102 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 102 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 103 | 103 | break; |
| 104 | 104 | case 2: |
| 105 | 105 | led = data; |
| r1591 | r1592 | |
| 133 | 133 | |
| 134 | 134 | static void ctc_interrupt (int state) |
| 135 | 135 | { |
| 136 | cpunum_set_input_line(1, 0, state); | |
| 136 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | static WRITE8_HANDLER( ctc_timer_1_w ) |
| r1591 | r1592 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | WRITE8_HANDLER( spacefb_port_1_w ) |
| 38 | 38 | { |
| 39 | cpunum_set_input_line(1, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 39 | cpunum_set_input_line(Machine, 1, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 40 | 40 | |
| 41 | 41 | /* enemy killed */ |
| 42 | 42 | if (!(data & 0x01) && (spacefb_sound_latch & 0x01)) sample_start(0,0,0); |
| r1591 | r1592 | |
|---|---|---|
| 212 | 212 | { |
| 213 | 213 | if (gpu_irq_state & dsp_regs[JINTCTRL] & 0x1f) |
| 214 | 214 | { |
| 215 | cpunum_set_input_line(1, 1, ASSERT_LINE); | |
| 215 | cpunum_set_input_line(Machine, 1, 1, ASSERT_LINE); | |
| 216 | 216 | jaguar_gpu_resume(); |
| 217 | 217 | } |
| 218 | 218 | else |
| 219 | cpunum_set_input_line(1, 1, CLEAR_LINE); | |
| 219 | cpunum_set_input_line(Machine, 1, 1, CLEAR_LINE); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
| r1591 | r1592 | |
| 396 | 396 | static TIMER_CALLBACK( serial_chunky_callback ) |
| 397 | 397 | { |
| 398 | 398 | /* assert the A2S IRQ on CPU #2 (DSP) */ |
| 399 | cpunum_set_input_line(2, 1, ASSERT_LINE); | |
| 399 | cpunum_set_input_line(machine, 2, 1, ASSERT_LINE); | |
| 400 | 400 | jaguar_dsp_resume(); |
| 401 | 401 | |
| 402 | 402 | /* fix flaky code in interrupt handler which thwarts our speedup */ |
| r1591 | r1592 | |
| 415 | 415 | static TIMER_CALLBACK( serial_callback ) |
| 416 | 416 | { |
| 417 | 417 | /* assert the A2S IRQ on CPU #2 (DSP) */ |
| 418 | cpunum_set_input_line(2, 1, ASSERT_LINE); | |
| 418 | cpunum_set_input_line(machine, 2, 1, ASSERT_LINE); | |
| 419 | 419 | jaguar_dsp_resume(); |
| 420 | 420 | } |
| 421 | 421 |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | #define VMIN 0 |
| 49 | 49 | #define VMAX 32767 |
| 50 | 50 | |
| 51 | static UINT8 sound_latch_a; | |
| 51 | struct c_state | |
| 52 | { | |
| 53 | INT32 counter; | |
| 54 | INT32 level; | |
| 55 | }; | |
| 52 | 56 | |
| 53 | static sound_stream * channel; | |
| 57 | struct n_state | |
| 58 | { | |
| 59 | INT32 counter; | |
| 60 | INT32 polyoffs; | |
| 61 | INT32 polybit; | |
| 62 | INT32 lowpass_counter; | |
| 63 | INT32 lowpass_polybit; | |
| 64 | }; | |
| 54 | 65 | |
| 55 | static UINT32 *poly18 = NULL; | |
| 66 | static struct c_state c24_state; | |
| 67 | static struct c_state c25_state; | |
| 68 | static struct n_state noise_state; | |
| 69 | static UINT8 sound_latch_a; | |
| 70 | static sound_stream * channel; | |
| 71 | static UINT32 * poly18; | |
| 56 | 72 | |
| 57 | 73 | INLINE int update_c24(int samplerate) |
| 58 | 74 | { |
| 59 | static int counter, level; | |
| 60 | 75 | /* |
| 61 | 76 | * Noise frequency control (Port B): |
| 62 | 77 | * Bit 6 lo charges C24 (6.8u) via R51 (330) and when |
| r1591 | r1592 | |
| 69 | 84 | #define R52 20000 |
| 70 | 85 | if( sound_latch_a & 0x40 ) |
| 71 | 86 | { |
| 72 | if (level > VMIN) | |
| 87 | if (c24_state.level > VMIN) | |
| 73 | 88 | { |
| 74 | counter -= (int)((level - VMIN) / (R52 * C24)); | |
| 75 | if( counter <= 0 ) | |
| 89 | c24_state.counter -= (int)((c24_state.level - VMIN) / (R52 * C24)); | |
| 90 | if( c24_state.counter <= 0 ) | |
| 76 | 91 | { |
| 77 | int n = -counter / samplerate + 1; | |
| 78 | counter += n * samplerate; | |
| 79 | if( (level -= n) < VMIN) | |
| 80 | level = VMIN; | |
| 92 | int n = -c24_state.counter / samplerate + 1; | |
| 93 | c24_state.counter += n * samplerate; | |
| 94 | if( (c24_state.level -= n) < VMIN) | |
| 95 | c24_state.level = VMIN; | |
| 81 | 96 | } |
| 82 | 97 | } |
| 83 | 98 | } |
| 84 | 99 | else |
| 85 | 100 | { |
| 86 | if (level < VMAX) | |
| 101 | if (c24_state.level < VMAX) | |
| 87 | 102 | { |
| 88 | counter -= (int)((VMAX - level) / ((R51+R49) * C24)); | |
| 89 | if( counter <= 0 ) | |
| 103 | c24_state.counter -= (int)((VMAX - c24_state.level) / ((R51+R49) * C24)); | |
| 104 | if( c24_state.counter <= 0 ) | |
| 90 | 105 | { |
| 91 | int n = -counter / samplerate + 1; | |
| 92 | counter += n * samplerate; | |
| 93 | if( (level += n) > VMAX) | |
| 94 | level = VMAX; | |
| 106 | int n = -c24_state.counter / samplerate + 1; | |
| 107 | c24_state.counter += n * samplerate; | |
| 108 | if( (c24_state.level += n) > VMAX) | |
| 109 | c24_state.level = VMAX; | |
| 95 | 110 | } |
| 96 | 111 | } |
| 97 | 112 | } |
| 98 | return VMAX - level; | |
| 113 | return VMAX - c24_state.level; | |
| 99 | 114 | } |
| 100 | 115 | |
| 101 | 116 | INLINE int update_c25(int samplerate) |
| 102 | 117 | { |
| 103 | static int counter, level; | |
| 104 | 118 | /* |
| 105 | 119 | * Bit 7 hi charges C25 (6.8u) over a R50 (1k) and R53 (330) and when |
| 106 | 120 | * bit 7 is lo, C25 is discharged through R54 (47k) |
| r1591 | r1592 | |
| 113 | 127 | |
| 114 | 128 | if( sound_latch_a & 0x80 ) |
| 115 | 129 | { |
| 116 | if (level < VMAX) | |
| 130 | if (c25_state.level < VMAX) | |
| 117 | 131 | { |
| 118 | counter -= (int)((VMAX - level) / ((R50+R53) * C25)); | |
| 119 | if( counter <= 0 ) | |
| 132 | c25_state.counter -= (int)((VMAX - c25_state.level) / ((R50+R53) * C25)); | |
| 133 | if( c25_state.counter <= 0 ) | |
| 120 | 134 | { |
| 121 | int n = -counter / samplerate + 1; | |
| 122 | counter += n * samplerate; | |
| 123 | if( (level += n) > VMAX ) | |
| 124 | level = VMAX; | |
| 135 | int n = -c25_state.counter / samplerate + 1; | |
| 136 | c25_state.counter += n * samplerate; | |
| 137 | if( (c25_state.level += n) > VMAX ) | |
| 138 | c25_state.level = VMAX; | |
| 125 | 139 | } |
| 126 | 140 | } |
| 127 | 141 | } |
| 128 | 142 | else |
| 129 | 143 | { |
| 130 | if (level > VMIN) | |
| 144 | if (c25_state.level > VMIN) | |
| 131 | 145 | { |
| 132 | counter -= (int)((level - VMIN) / (R54 * C25)); | |
| 133 | if( counter <= 0 ) | |
| 146 | c25_state.counter -= (int)((c25_state.level - VMIN) / (R54 * C25)); | |
| 147 | if( c25_state.counter <= 0 ) | |
| 134 | 148 | { |
| 135 | int n = -counter / samplerate + 1; | |
| 136 | counter += n * samplerate; | |
| 137 | if( (level -= n) < VMIN ) | |
| 138 | level = VMIN; | |
| 149 | int n = -c25_state.counter / samplerate + 1; | |
| 150 | c25_state.counter += n * samplerate; | |
| 151 | if( (c25_state.level -= n) < VMIN ) | |
| 152 | c25_state.level = VMIN; | |
| 139 | 153 | } |
| 140 | 154 | } |
| 141 | 155 | } |
| 142 | return level; | |
| 156 | return c25_state.level; | |
| 143 | 157 | } |
| 144 | 158 | |
| 145 | 159 | |
| 146 | 160 | INLINE int noise(int samplerate) |
| 147 | 161 | { |
| 148 | static int counter, polyoffs, polybit, lowpass_counter, lowpass_polybit; | |
| 149 | 162 | int vc24 = update_c24(samplerate); |
| 150 | 163 | int vc25 = update_c25(samplerate); |
| 151 | 164 | int sum = 0, level, frequency; |
| r1591 | r1592 | |
| 168 | 181 | * R71 (2700 Ohms) parallel to R73 (47k Ohms) = approx. 2553 Ohms |
| 169 | 182 | * maxfreq = 1.44 / ((2553+2*1000) * 0.05e-6) = approx. 6325 Hz |
| 170 | 183 | */ |
| 171 | counter -= frequency; | |
| 172 | if( counter <= 0 ) | |
| 184 | noise_state.counter -= frequency; | |
| 185 | if( noise_state.counter <= 0 ) | |
| 173 | 186 | { |
| 174 | int n = (-counter / samplerate) + 1; | |
| 175 | counter += n * samplerate; | |
| 176 | polyoffs = (polyoffs + n) & 0x3ffff; | |
| 177 | polybit = (poly18[polyoffs>>5] >> (polyoffs & 31)) & 1; | |
| 187 | int n = (-noise_state.counter / samplerate) + 1; | |
| 188 | noise_state.counter += n * samplerate; | |
| 189 | noise_state.polyoffs = (noise_state.polyoffs + n) & 0x3ffff; | |
| 190 | noise_state.polybit = (poly18[noise_state.polyoffs>>5] >> (noise_state.polyoffs & 31)) & 1; | |
| 178 | 191 | } |
| 179 | if (!polybit) | |
| 192 | if (!noise_state.polybit) | |
| 180 | 193 | sum += vc24; |
| 181 | 194 | |
| 182 | 195 | /* 400Hz crude low pass filter: this is only a guess!! */ |
| 183 | lowpass_counter -= 400; | |
| 184 | if( lowpass_counter <= 0 ) | |
| 196 | noise_state.lowpass_counter -= 400; | |
| 197 | if( noise_state.lowpass_counter <= 0 ) | |
| 185 | 198 | { |
| 186 | lowpass_counter += samplerate; | |
| 187 | lowpass_polybit = polybit; | |
| 199 | noise_state.lowpass_counter += samplerate; | |
| 200 | noise_state.lowpass_polybit = noise_state.polybit; | |
| 188 | 201 | } |
| 189 | if (!lowpass_polybit) | |
| 202 | if (!noise_state.lowpass_polybit) | |
| 190 | 203 | sum += vc25; |
| 191 | 204 | |
| 192 | 205 | return sum; |
| r1591 | r1592 | |
| 374 | 387 | |
| 375 | 388 | WRITE8_HANDLER( phoenix_sound_control_a_w ) |
| 376 | 389 | { |
| 377 | if( data == sound_latch_a ) | |
| 378 | return; | |
| 379 | ||
| 380 | 390 | discrete_sound_w(PHOENIX_EFFECT_2_DATA, data & 0x0f); |
| 381 | 391 | discrete_sound_w(PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4); |
| 382 | 392 | // discrete_sound_w(PHOENIX_EFFECT_3_EN , data & 0x40); |
| r1591 | r1592 | |
| 388 | 398 | |
| 389 | 399 | SOUND_START( phoenix) |
| 390 | 400 | { |
| 401 | sound_latch_a = 0; | |
| 402 | memset(&c24_state, 0, sizeof(c24_state)); | |
| 403 | memset(&c25_state, 0, sizeof(c25_state)); | |
| 404 | memset(&noise_state, 0, sizeof(noise_state)); | |
| 405 | ||
| 391 | 406 | state_save_register_global(sound_latch_a); |
| 407 | state_save_register_global(c24_state.counter); | |
| 408 | state_save_register_global(c24_state.level); | |
| 409 | state_save_register_global(c25_state.counter); | |
| 410 | state_save_register_global(c25_state.level); | |
| 411 | state_save_register_global(noise_state.counter); | |
| 412 | state_save_register_global(noise_state.polybit); | |
| 413 | state_save_register_global(noise_state.polyoffs); | |
| 414 | state_save_register_global(noise_state.lowpass_counter); | |
| 415 | state_save_register_global(noise_state.lowpass_polybit); | |
| 416 | ||
| 392 | 417 | } |
| 393 | 418 | |
| 394 | 419 | WRITE8_HANDLER( phoenix_sound_control_b_w ) |
| r1591 | r1592 | |
|---|---|---|
| 201 | 201 | } |
| 202 | 202 | if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5))) |
| 203 | 203 | { |
| 204 | cpunum_set_input_line(1, 0, PULSE_LINE); | |
| 204 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE); | |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| r1591 | r1592 | |
| 224 | 224 | } |
| 225 | 225 | if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5))) |
| 226 | 226 | { |
| 227 | cpunum_set_input_line(1, 0, PULSE_LINE); | |
| 227 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE); | |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
| r1591 | r1592 | |
| 239 | 239 | |
| 240 | 240 | if (changes & (1 << 6)) |
| 241 | 241 | { |
| 242 | cpunum_set_input_line(1, 0, PULSE_LINE); | |
| 242 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE); | |
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 |
| r1591 | r1592 | |
|---|---|---|
| 130 | 130 | if (last == 0 && data) |
| 131 | 131 | { |
| 132 | 132 | /* setting bit 0 low then high triggers IRQ on the sound CPU */ |
| 133 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 133 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | last = data; |
| r1591 | r1592 | |
|---|---|---|
| 96 | 96 | static void generic_init(running_machine *machine, void (*callback)(UINT8, UINT8)) |
| 97 | 97 | { |
| 98 | 98 | /* call the standard init */ |
| 99 | | |
| 99 | MACHINE_RESET_CALL(cinemat | |
| 100 | 100 | |
| 101 | 101 | /* set the sound handler */ |
| 102 | 102 | sound_handler = callback; |
| r1591 | r1592 | |
| 976 | 976 | if (sample_playing(2) && cpu_getcurrentframe() > last_frame) |
| 977 | 977 | { |
| 978 | 978 | if (current_volume > target_volume) |
| 979 | current_volume -= 0.078; | |
| 979 | current_volume -= 0.078f; | |
| 980 | 980 | if (current_volume < target_volume) |
| 981 | current_volume += 0.078; | |
| 981 | current_volume += 0.078f; | |
| 982 | 982 | if (current_volume > 0) |
| 983 | 983 | sample_set_volume(2, current_volume); |
| 984 | 984 | else |
| r1591 | r1592 | |
| 1487 | 1487 | |
| 1488 | 1488 | static void ctc_interrupt(int state) |
| 1489 | 1489 | { |
| 1490 | cpunum_set_input_line(1, 0, state); | |
| 1490 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 1491 | 1491 | } |
| 1492 | 1492 | |
| 1493 | 1493 | |
| r1591 | r1592 | |
| 1593 | 1593 | |
| 1594 | 1594 | static MACHINE_RESET( qb3_sound ) |
| 1595 | 1595 | { |
| 1596 | | |
| 1596 | MACHINE_RESET_CALL(demon_sound | |
| 1597 | 1597 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, qb3_sound_w); |
| 1598 | 1598 | |
| 1599 | 1599 | /* this patch prevents the sound ROM from eating itself when command $0A is sent */ |
| r1591 | r1592 | |
|---|---|---|
| 17 | 17 | static UINT8 sound_data_from_68k_ready, sound_data_from_6502_ready; |
| 18 | 18 | |
| 19 | 19 | |
| 20 | static void update_sound_68k_interrupts( | |
| 20 | static void update_sound_68k_interrupts(running_machine *machine); | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | |
| r1591 | r1592 | |
| 63 | 63 | memory_set_bankptr(8, &bank_base[0x1000 * ((data >> 6) & 3)]); |
| 64 | 64 | coin_counter_w(1, (data >> 5) & 1); |
| 65 | 65 | coin_counter_w(0, (data >> 4) & 1); |
| 66 | cpunum_set_input_line(3, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 66 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 67 | 67 | if (!(data & 0x01)) sndti_reset(SOUND_YM2151, 0); |
| 68 | 68 | |
| 69 | 69 | } |
| r1591 | r1592 | |
| 84 | 84 | if (!io_68k_int) |
| 85 | 85 | { |
| 86 | 86 | io_68k_int = 1; |
| 87 | update_sound_68k_interrupts(); | |
| 87 | update_sound_68k_interrupts(Machine); | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| r1591 | r1592 | |
| 96 | 96 | * |
| 97 | 97 | *************************************/ |
| 98 | 98 | |
| 99 | static void update_sound_68k_interrupts( | |
| 99 | static void update_sound_68k_interrupts(running_machine *machine) | |
| 100 | 100 | { |
| 101 | 101 | int newstate = 0; |
| 102 | 102 | |
| r1591 | r1592 | |
| 106 | 106 | newstate |= 2; |
| 107 | 107 | |
| 108 | 108 | if (newstate) |
| 109 | cpunum_set_input_line(3, newstate, ASSERT_LINE); | |
| 109 | cpunum_set_input_line(machine, 3, newstate, ASSERT_LINE); | |
| 110 | 110 | else |
| 111 | cpunum_set_input_line(3, 7, CLEAR_LINE); | |
| 111 | cpunum_set_input_line(machine, 3, 7, CLEAR_LINE); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| r1591 | r1592 | |
| 117 | 117 | if (!fast_68k_int) |
| 118 | 118 | { |
| 119 | 119 | fast_68k_int = 1; |
| 120 | update_sound_68k_interrupts(); | |
| 120 | update_sound_68k_interrupts(machine); | |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| r1591 | r1592 | |
| 127 | 127 | if (io_68k_int) |
| 128 | 128 | { |
| 129 | 129 | io_68k_int = 0; |
| 130 | update_sound_68k_interrupts(); | |
| 130 | update_sound_68k_interrupts(Machine); | |
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| r1591 | r1592 | |
| 161 | 161 | if (fast_68k_int) |
| 162 | 162 | { |
| 163 | 163 | fast_68k_int = 0; |
| 164 | update_sound_68k_interrupts(); | |
| 164 | update_sound_68k_interrupts(Machine); | |
| 165 | 165 | } |
| 166 | 166 | } |
| r1591 | r1592 | |
|---|---|---|
| 19 | 19 | #define SHOOT_LENGTH 13000 |
| 20 | 20 | |
| 21 | 21 | #define TOOTHSAW_LENGTH 16 |
| 22 | #define TOOTHSAW_VOLUME 36 | |
| 22 | #define TOOTHSAW_VOLUME 0.36f | |
| 23 | 23 | #define STEPS 16 |
| 24 | #define LFO_VOLUME 0.06 | |
| 25 | #define SHOOT_VOLUME 0.50 | |
| 26 | #define NOISE_VOLUME 0.50 | |
| 24 | #define LFO_VOLUME 0.06f | |
| 25 | #define SHOOT_VOLUME 0.50f | |
| 26 | #define NOISE_VOLUME 0.50f | |
| 27 | 27 | #define NOISE_AMPLITUDE (70*256) |
| 28 | 28 | #define TOOTHSAW_AMPLITUDE (64*256) |
| 29 | 29 | |
| r1591 | r1592 | |
| 344 | 344 | vol = 0; |
| 345 | 345 | |
| 346 | 346 | tone_stream = stream_create(0,1,SOUND_CLOCK/STEPS,NULL,tone_update); |
| 347 | stream_set_output_gain(tone_stream, 0, TOOTHSAW_VOLUME | |
| 347 | stream_set_output_gain(tone_stream, 0, TOOTHSAW_VOLUME | |
| 348 | 348 | |
| 349 | 349 | sample_set_volume(CHANNEL_NOISE,0); |
| 350 | 350 | sample_start_raw(CHANNEL_NOISE,noisewave,NOISE_LENGTH,NOISE_RATE,1); |
| r1591 | r1592 | |
|---|---|---|
| 89 | 89 | if (last == 0 && data) |
| 90 | 90 | { |
| 91 | 91 | /* setting bit 0 low then high triggers IRQ on the sound CPU */ |
| 92 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 92 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | last = data; |
| r1591 | r1592 | |
|---|---|---|
| 183 | 183 | { |
| 184 | 184 | if (state) |
| 185 | 185 | cage_control_w(0); |
| 186 | cpunum_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 186 | cpunum_set_input_line(Machine, cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
| r1591 | r1592 | |
| 212 | 212 | tms32031_io_regs[DMA_SOURCE_ADDR] = param; |
| 213 | 213 | |
| 214 | 214 | /* set the interrupt */ |
| 215 | cpunum_set_input_line(cage_cpu, TMS32031_DINT, ASSERT_LINE); | |
| 215 | cpunum_set_input_line(machine, cage_cpu, TMS32031_DINT, ASSERT_LINE); | |
| 216 | 216 | dma_enabled = 0; |
| 217 | 217 | } |
| 218 | 218 | |
| r1591 | r1592 | |
| 281 | 281 | int which = param; |
| 282 | 282 | |
| 283 | 283 | /* set the interrupt */ |
| 284 | cpunum_set_input_line(cage_cpu, TMS32031_TINT0 + which, ASSERT_LINE); | |
| 284 | cpunum_set_input_line(machine, cage_cpu, TMS32031_TINT0 + which, ASSERT_LINE); | |
| 285 | 285 | cage_timer_enabled[which] = 0; |
| 286 | 286 | update_timer(which); |
| 287 | 287 | } |
| r1591 | r1592 | |
| 466 | 466 | logerror("%06X:CAGE read command = %04X\n", activecpu_get_pc(), cage_from_main); |
| 467 | 467 | cpu_to_cage_ready = 0; |
| 468 | 468 | update_control_lines(); |
| 469 | cpunum_set_input_line(cage_cpu, TMS32031_IRQ0, CLEAR_LINE); | |
| 469 | cpunum_set_input_line(Machine, cage_cpu, TMS32031_IRQ0, CLEAR_LINE); | |
| 470 | 470 | return cage_from_main; |
| 471 | 471 | } |
| 472 | 472 | |
| r1591 | r1592 | |
| 514 | 514 | cage_from_main = param; |
| 515 | 515 | cpu_to_cage_ready = 1; |
| 516 | 516 | update_control_lines(); |
| 517 | cpunum_set_input_line(cage_cpu, TMS32031_IRQ0, ASSERT_LINE); | |
| 517 | cpunum_set_input_line(machine, cage_cpu, TMS32031_IRQ0, ASSERT_LINE); | |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | |
| r1591 | r1592 | |
| 546 | 546 | /* CPU is reset if both control lines are 0 */ |
| 547 | 547 | if (!(cage_control & 3)) |
| 548 | 548 | { |
| 549 | cpunum_set_input_line(cage_cpu, INPUT_LINE_RESET, ASSERT_LINE); | |
| 549 | cpunum_set_input_line(Machine, cage_cpu, INPUT_LINE_RESET, ASSERT_LINE); | |
| 550 | 550 | |
| 551 | 551 | dma_enabled = 0; |
| 552 | 552 | dma_timer_enabled = 0; |
| r1591 | r1592 | |
| 563 | 563 | cage_to_cpu_ready = 0; |
| 564 | 564 | } |
| 565 | 565 | else |
| 566 | cpunum_set_input_line(cage_cpu, INPUT_LINE_RESET, CLEAR_LINE); | |
| 566 | cpunum_set_input_line(Machine, cage_cpu, INPUT_LINE_RESET, CLEAR_LINE); | |
| 567 | 567 | |
| 568 | 568 | /* update the control state */ |
| 569 | 569 | update_control_lines(); |
| r1591 | r1592 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | static TIMER_CALLBACK( namco_54xx_irq_clear ) |
| 111 | 111 | { |
| 112 | cpunum_set_input_line(param, 0, CLEAR_LINE); | |
| 112 | cpunum_set_input_line(machine, param, 0, CLEAR_LINE); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | void namco_54xx_write(UINT8 data) |
| r1591 | r1592 | |
| 121 | 121 | |
| 122 | 122 | timer_call_after_resynch(NULL, data, namco_54xx_latch_callback); |
| 123 | 123 | |
| 124 | cpunum_set_input_line(cpunum, 0, ASSERT_LINE); | |
| 124 | cpunum_set_input_line(Machine, cpunum, 0, ASSERT_LINE); | |
| 125 | 125 | |
| 126 | 126 | // The execution time of one instruction is ~4us, so we must make sure to |
| 127 | 127 | // give the cpu time to poll the /IRQ input before we clear it. |
| r1591 | r1592 | |
|---|---|---|
| 8 | 8 | /* z80 pio */ |
| 9 | 9 | static void pio_interrupt(int state) |
| 10 | 10 | { |
| 11 | cpunum_set_input_line(1, 0, state); | |
| 11 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | static const z80pio_interface pio_intf = |
| r1591 | r1592 | |
| 21 | 21 | /* z80 ctc */ |
| 22 | 22 | static void ctc_interrupt (int state) |
| 23 | 23 | { |
| 24 | cpunum_set_input_line(1, 0, state); | |
| 24 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | static z80ctc_interface ctc_intf = |
| r1591 | r1592 | |
|---|---|---|
| 357 | 357 | READ8_HANDLER( exidy440_sound_command_r ) |
| 358 | 358 | { |
| 359 | 359 | /* clear the FIRQ that got us here and acknowledge the read to the main CPU */ |
| 360 | cpunum_set_input_line(1, 1, CLEAR_LINE); | |
| 360 | cpunum_set_input_line(Machine, 1, 1, CLEAR_LINE); | |
| 361 | 361 | exidy440_sound_command_ack = 1; |
| 362 | 362 | |
| 363 | 363 | return exidy440_sound_command; |
| r1591 | r1592 | |
| 393 | 393 | |
| 394 | 394 | WRITE8_HANDLER( exidy440_sound_interrupt_clear_w ) |
| 395 | 395 | { |
| 396 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 396 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 |
| r1591 | r1592 | |
|---|---|---|
| 314 | 314 | |
| 315 | 315 | /* if the low 5 bits clocked to 0, bit 6 has changed state */ |
| 316 | 316 | if ((ssio_14024_count & 0x3f) == 0) |
| 317 | cpunum_set_input_line(ssio_sound_cpu, 0, (ssio_14024_count & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 317 | cpunum_set_input_line(machine, ssio_sound_cpu, 0, (ssio_14024_count & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | static READ8_HANDLER( ssio_irq_clear ) |
| 321 | 321 | { |
| 322 | 322 | /* a read here asynchronously resets the 14024 count, clearing /SINT */ |
| 323 | 323 | ssio_14024_count = 0; |
| 324 | cpunum_set_input_line(ssio_sound_cpu, 0, CLEAR_LINE); | |
| 324 | cpunum_set_input_line(Machine, ssio_sound_cpu, 0, CLEAR_LINE); | |
| 325 | 325 | return 0xff; |
| 326 | 326 | } |
| 327 | 327 | |
| r1591 | r1592 | |
| 397 | 397 | { |
| 398 | 398 | int i; |
| 399 | 399 | |
| 400 | cpunum_set_input_line(ssio_sound_cpu, INPUT_LINE_RESET, ASSERT_LINE); | |
| 400 | cpunum_set_input_line(Machine, ssio_sound_cpu, INPUT_LINE_RESET, ASSERT_LINE); | |
| 401 | 401 | |
| 402 | 402 | /* latches also get reset */ |
| 403 | 403 | for (i = 0; i < 4; i++) |
| r1591 | r1592 | |
| 407 | 407 | } |
| 408 | 408 | /* going low resets and reactivates the CPU */ |
| 409 | 409 | else |
| 410 | cpunum_set_input_line(ssio_sound_cpu, INPUT_LINE_RESET, CLEAR_LINE); | |
| 410 | cpunum_set_input_line(Machine, ssio_sound_cpu, INPUT_LINE_RESET, CLEAR_LINE); | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | READ8_HANDLER( ssio_input_port_r ) |
| r1591 | r1592 | |
| 527 | 527 | |
| 528 | 528 | static void csdeluxe_irq(int state) |
| 529 | 529 | { |
| 530 | cpunum_set_input_line(csdeluxe_sound_cpu, 4, state ? ASSERT_LINE : CLEAR_LINE); | |
| 530 | int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0); | |
| 531 | ||
| 532 | cpunum_set_input_line(Machine, csdeluxe_sound_cpu, 4, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 531 | 533 | } |
| 532 | 534 | |
| 533 | 535 | static TIMER_CALLBACK( csdeluxe_delayed_data_w ) |
| r1591 | r1592 | |
| 574 | 576 | |
| 575 | 577 | void csdeluxe_reset_w(int state) |
| 576 | 578 | { |
| 577 | cpunum_set_input_line(csdeluxe_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 579 | cpunum_set_input_line(Machine, csdeluxe_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 578 | 580 | } |
| 579 | 581 | |
| 580 | 582 | |
| r1591 | r1592 | |
| 647 | 649 | |
| 648 | 650 | static void soundsgood_irq(int state) |
| 649 | 651 | { |
| 650 | cpunum_set_input_line(soundsgood_sound_cpu, 4, state ? ASSERT_LINE : CLEAR_LINE); | |
| 652 | int combined_state = pia_get_irq_a(1) | pia_get_irq_b(1); | |
| 653 | ||
| 654 | cpunum_set_input_line(Machine, soundsgood_sound_cpu, 4, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 651 | 655 | } |
| 652 | 656 | |
| 653 | 657 | static TIMER_CALLBACK( soundsgood_delayed_data_w ) |
| r1591 | r1592 | |
| 675 | 679 | void soundsgood_reset_w(int state) |
| 676 | 680 | { |
| 677 | 681 | //if (state) mame_printf_debug("SG Reset\n"); |
| 678 | cpunum_set_input_line(soundsgood_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 682 | cpunum_set_input_line(Machine, soundsgood_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 679 | 683 | } |
| 680 | 684 | |
| 681 | 685 | |
| r1591 | r1592 | |
| 738 | 742 | |
| 739 | 743 | static void turbocs_irq(int state) |
| 740 | 744 | { |
| 741 | cpunum_set_input_line(turbocs_sound_cpu, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 745 | int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0); | |
| 746 | ||
| 747 | cpunum_set_input_line(Machine, turbocs_sound_cpu, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 742 | 748 | } |
| 743 | 749 | |
| 744 | 750 | static TIMER_CALLBACK( turbocs_delayed_data_w ) |
| r1591 | r1592 | |
| 765 | 771 | |
| 766 | 772 | void turbocs_reset_w(int state) |
| 767 | 773 | { |
| 768 | cpunum_set_input_line(turbocs_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 774 | cpunum_set_input_line(Machine, turbocs_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 769 | 775 | } |
| 770 | 776 | |
| 771 | 777 | |
| r1591 | r1592 | |
| 869 | 875 | |
| 870 | 876 | static void squawkntalk_irq(int state) |
| 871 | 877 | { |
| 872 | cpunum_set_input_line(squawkntalk_sound_cpu, M6808_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 878 | int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0) | pia_get_irq_a(1) | pia_get_irq_b(1); | |
| 879 | ||
| 880 | cpunum_set_input_line(Machine, squawkntalk_sound_cpu, M6808_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 873 | 881 | } |
| 874 | 882 | |
| 875 | 883 | static TIMER_CALLBACK( squawkntalk_delayed_data_w ) |
| r1591 | r1592 | |
| 887 | 895 | |
| 888 | 896 | void squawkntalk_reset_w(int state) |
| 889 | 897 | { |
| 890 | cpunum_set_input_line(squawkntalk_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 898 | cpunum_set_input_line(Machine, squawkntalk_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 891 | 899 | } |
| 892 | 900 | |
| 893 | 901 | |
| r1591 | r1592 | |
| 937 | 945 | |
| 938 | 946 | /********* machine driver ***********/ |
| 939 | 947 | MACHINE_DRIVER_START(squawk_n_talk) |
| 940 | MDRV_CPU_ADD_TAG("snt", M6802, SQUAWKTALK_CLOCK | |
| 948 | MDRV_CPU_ADD_TAG("snt", M6802, SQUAWKTALK_CLOCK | |
| 941 | 949 | MDRV_CPU_PROGRAM_MAP(squawkntalk_map,0) |
| 942 | 950 | |
| 943 | 951 | /* only used on Discs of Tron, which is stereo */ |
| r1591 | r1592 | |
|---|---|---|
| 168 | 168 | return; |
| 169 | 169 | |
| 170 | 170 | if (irqstate == 0) /* no IRQs pending */ |
| 171 | cpunum_set_input_line(cpunum,0,CLEAR_LINE); | |
| 171 | cpunum_set_input_line(machine, cpunum,0,CLEAR_LINE); | |
| 172 | 172 | else /* IRQ pending */ |
| 173 | cpunum_set_input_line(cpunum,0,ASSERT_LINE); | |
| 173 | cpunum_set_input_line(machine, cpunum,0,ASSERT_LINE); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 |
| r1591 | r1592 | |
|---|---|---|
| 215 | 215 | speech_latch = data; |
| 216 | 216 | |
| 217 | 217 | /* the high bit goes directly to the INT line */ |
| 218 | cpunum_set_input_line(1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 218 | cpunum_set_input_line(machine, 1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 219 | 219 | |
| 220 | 220 | /* a clock on the high bit clocks a 1 into T0 */ |
| 221 | 221 | if (!(old & 0x80) && (data & 0x80)) |
| r1591 | r1592 | |
| 314 | 314 | void sega_usb_reset(UINT8 t1_clock_mask) |
| 315 | 315 | { |
| 316 | 316 | /* halt the USB CPU at reset time */ |
| 317 | cpunum_set_input_line(usb.cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 317 | cpunum_set_input_line(Machine, usb.cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 318 | 318 | |
| 319 | 319 | /* start the clock timer */ |
| 320 | 320 | timer_pulse(attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock); |
| r1591 | r1592 | |
| 346 | 346 | int data = param; |
| 347 | 347 | |
| 348 | 348 | /* look for rising/falling edges of bit 7 to control the RESET line */ |
| 349 | cpunum_set_input_line(usb.cpunum, INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 349 | cpunum_set_input_line(machine, usb.cpunum, INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 350 | 350 | |
| 351 | 351 | /* if the CLEAR line is set, the low 7 bits of the input are ignored */ |
| 352 | 352 | if ((usb.last_p2_value & 0x40) == 0) |
| r1591 | r1592 | |
|---|---|---|
| 23 | 23 | soundlatch_w(offset, data); |
| 24 | 24 | sound_status ^= 0x21; |
| 25 | 25 | if (sound_status & 0x20) |
| 26 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 26 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| r1591 | r1592 | |
| 49 | 49 | sound_status ^= 0x10; |
| 50 | 50 | |
| 51 | 51 | if (sound_status & 0x10) |
| 52 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 52 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | { |
| 45 | 45 | if ( tc0140syt.nmi_req && tc0140syt.nmi_enabled ) |
| 46 | 46 | { |
| 47 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 47 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 48 | 48 | tc0140syt.nmi_req = 0; |
| 49 | 49 | } |
| 50 | 50 | } |
| r1591 | r1592 | |
| 98 | 98 | //#endif |
| 99 | 99 | /* this does a hi-lo transition to reset the sound cpu */ |
| 100 | 100 | if (data) |
| 101 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 101 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 102 | 102 | else |
| 103 | 103 | { |
| 104 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 104 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 105 | 105 | cpu_spin(); /* otherwise no sound in driftout */ |
| 106 | 106 | } |
| 107 | 107 | break; |
| r1591 | r1592 | |
|---|---|---|
| 4 | 4 | #include "sound/ay8910.h" |
| 5 | 5 | #include "sound/msm5205.h" |
| 6 | 6 | |
| 7 | static UINT8 port1,port2; | |
| 7 | 8 | |
| 9 | ||
| 10 | static SOUND_START( irem_audio ) | |
| 11 | { | |
| 12 | state_save_register_global(port1); | |
| 13 | state_save_register_global(port2); | |
| 14 | } | |
| 15 | ||
| 16 | ||
| 8 | 17 | WRITE8_HANDLER( irem_sound_cmd_w ) |
| 9 | 18 | { |
| 10 | 19 | if ((data & 0x80) == 0) |
| 11 | soundlatch_w(0,data & 0x7f); | |
| 20 | soundlatch_w(0, data & 0x7f); | |
| 12 | 21 | else |
| 13 | cpunum_set_input_line(1,0, | |
| 22 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 14 | 23 | } |
| 15 | 24 | |
| 16 | 25 | |
| 17 | static int port1,port2; | |
| 26 | static WRITE8_HANDLER( irem_sound_irq_ack_w ) | |
| 27 | { | |
| 28 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 29 | } | |
| 18 | 30 | |
| 31 | ||
| 19 | 32 | static WRITE8_HANDLER( irem_port1_w ) |
| 20 | 33 | { |
| 21 | 34 | port1 = data; |
| r1591 | r1592 | |
| 83 | 96 | |
| 84 | 97 | static void irem_adpcm_int(int data) |
| 85 | 98 | { |
| 86 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 99 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | 100 | |
| 88 | 101 | /* the first MSM5205 clocks the second */ |
| 89 | 102 | MSM5205_vclk_w(1,1); |
| r1591 | r1592 | |
| 128 | 141 | |
| 129 | 142 | |
| 130 | 143 | |
| 131 | static ADDRESS_MAP_START( irem_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 132 | AM_RANGE(0x4000, 0xffff) AM_READ(MRA8_ROM) | |
| 133 | ADDRESS_MAP_END | |
| 134 | ||
| 135 | static ADDRESS_MAP_START( irem_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 136 | AM_RANGE(0x0800, 0x0800) AM_WRITE(MWA8_NOP) /* IACK */ | |
| 144 | static ADDRESS_MAP_START( irem_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 145 | AM_RANGE(0x0800, 0x0800) AM_WRITENOP | |
| 137 | 146 | AM_RANGE(0x0801, 0x0802) AM_WRITE(irem_adpcm_w) |
| 138 | AM_RANGE(0x9000, 0x9000) AM_WRITE(MWA8_NOP) /* IACK */ | |
| 139 | AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 147 | AM_RANGE(0x9000, 0x9000) AM_WRITE(irem_sound_irq_ack_w) | |
| 148 | AM_RANGE(0x4000, 0xffff) AM_ROM | |
| 140 | 149 | ADDRESS_MAP_END |
| 141 | 150 | |
| 142 | static ADDRESS_MAP_START( irem_sound_readport, ADDRESS_SPACE_IO, 8 ) | |
| 143 | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_READ(irem_port1_r) | |
| 144 | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READ(irem_port2_r) | |
| 151 | static ADDRESS_MAP_START( irem_sound_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 152 | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_READWRITE(irem_port1_r, irem_port1_w) | |
| 153 | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_READWRITE(irem_port2_r, irem_port2_w) | |
| 145 | 154 | ADDRESS_MAP_END |
| 146 | 155 | |
| 147 | static ADDRESS_MAP_START( irem_sound_writeport, ADDRESS_SPACE_IO, 8 ) | |
| 148 | AM_RANGE(M6803_PORT1, M6803_PORT1) AM_WRITE(irem_port1_w) | |
| 149 | AM_RANGE(M6803_PORT2, M6803_PORT2) AM_WRITE(irem_port2_w) | |
| 150 | ADDRESS_MAP_END | |
| 151 | 156 | |
| 152 | ||
| 153 | 157 | MACHINE_DRIVER_START( irem_audio ) |
| 154 | 158 | |
| 159 | MDRV_SOUND_START(irem_audio) | |
| 160 | ||
| 155 | 161 | /* basic machine hardware */ |
| 156 | MDRV_CPU_ADD(M6803, XTAL_3_579545MHz/4) /* verified on pcb */ | |
| 157 | /* audio CPU */ | |
| 158 | MDRV_CPU_PROGRAM_MAP(irem_sound_readmem,irem_sound_writemem) | |
| 159 | MDRV_CPU_IO_MAP(irem_sound_readport,irem_sound_writeport) | |
| 162 | MDRV_CPU_ADD(M6803, XTAL_3_579545MHz) /* verified on pcb */ | |
| 163 | MDRV_CPU_PROGRAM_MAP(irem_sound_map,0) | |
| 164 | MDRV_CPU_IO_MAP(irem_sound_portmap,0) | |
| 160 | 165 | |
| 161 | 166 | /* sound hardware */ |
| 162 | 167 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r1591 | r1592 | |
|---|---|---|
| 723 | 723 | /* generate the appropriate interrupt */ |
| 724 | 724 | i80186.intr.poll_status = 0x8000 | new_vector; |
| 725 | 725 | if (!i80186.intr.pending) |
| 726 | cpunum_set_input_line(2, 0, ASSERT_LINE); | |
| 726 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); | |
| 727 | 727 | i80186.intr.pending = 1; |
| 728 | 728 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", attotime_to_double(timer_get_time()), new_vector); |
| 729 | 729 | } |
| r1591 | r1592 | |
| 1667 | 1667 | } |
| 1668 | 1668 | |
| 1669 | 1669 | /* /RESET */ |
| 1670 | cpunum_set_input_line(2, INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE); | |
| 1670 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE); | |
| 1671 | 1671 | |
| 1672 | 1672 | /* /NMI */ |
| 1673 | 1673 | /* If the master CPU doesn't get a response by the time it's ready to send |
| 1674 | 1674 | the next command, it uses an NMI to force the issue; unfortunately, this |
| 1675 | 1675 | seems to really screw up the sound system. It turns out it's better to |
| 1676 | 1676 | just wait for the original interrupt to occur naturally */ |
| 1677 | /* cpunum_set_input_line(2, INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/ | |
| 1677 | /* cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/ | |
| 1678 | 1678 | |
| 1679 | 1679 | /* INT0 */ |
| 1680 | 1680 | if (data & 0x20) |
| r1591 | r1592 | |
|---|---|---|
| 228 | 228 | port2State = data; |
| 229 | 229 | |
| 230 | 230 | if ( bitsGoneLow & OUT_PORT_2_BEAR ) |
| 231 | { | |
| 232 | 231 | PLAY( SND_BEAR, 0 ); |
| 233 | } | |
| 234 | 232 | |
| 235 | 233 | if ( bitsGoneLow & OUT_PORT_2_RANKING ) |
| 236 | { | |
| 237 | 234 | PLAY( SND_RANKING, 0 ); |
| 238 | } | |
| 239 | 235 | |
| 240 | 236 | if ( bitsGoneHigh & OUT_PORT_2_MUSIC_RESET ) |
| 241 | { | |
| 242 | 237 | /* reset output is no longer asserted active low */ |
| 243 | cpunum_set_input_line(CPU_MUSIC_ID, INPUT_LINE_RESET, PULSE_LINE ); | |
| 244 | } | |
| 238 | cpunum_set_input_line(Machine, CPU_MUSIC_ID, INPUT_LINE_RESET, PULSE_LINE ); | |
| 245 | 239 | } |
| 246 | 240 | |
| 247 | 241 |
| r1591 | r1592 | |
|---|---|---|
| 166 | 166 | #define DK_C30 CAP_U(10) |
| 167 | 167 | #define DK_C32 CAP_U(10) |
| 168 | 168 | #define DK_C34 CAP_N(10) |
| 169 | #define DK_C159 CAP_N( | |
| 169 | #define DK_C159 CAP_N( | |
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | /* |
| r1591 | r1592 | |
| 367 | 367 | #if DK_NO_FILTERS |
| 368 | 368 | DISCRETE_OUTPUT(NODE_288, 32767.0/5.0 * 10) |
| 369 | 369 | #else |
| 370 | DISCRETE_OUTPUT(NODE_296, 32767.0/5.0 * | |
| 370 | DISCRETE_OUTPUT(NODE_296, 32767.0/5.0 * 2) | |
| 371 | 371 | #endif |
| 372 | 372 | |
| 373 | 373 | DISCRETE_SOUND_END |
| r1591 | r1592 | |
| 889 | 889 | |
| 890 | 890 | static SOUND_RESET( dkongjr ) |
| 891 | 891 | { |
| 892 | | |
| 892 | SOUND_RESET_CALL(dkong | |
| 893 | 893 | soundlatch_w(0,0x00); |
| 894 | 894 | } |
| 895 | 895 | |
| r1591 | r1592 | |
| 1117 | 1117 | WRITE8_HANDLER( dkong_audio_irq_w ) |
| 1118 | 1118 | { |
| 1119 | 1119 | if (data) |
| 1120 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 1120 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 1121 | 1121 | else |
| 1122 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 1122 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | WRITE8_HANDLER( dkong_snd_disc_w ) |
| r1591 | r1592 | |
| 1273 | 1273 | |
| 1274 | 1274 | static struct TMS5110interface tms5110_interface = |
| 1275 | 1275 | { |
| 1276 | TMS5110_IS_M58817, | |
| 1277 | 1276 | REGION_SOUND1, /* Sample Rom */ |
| 1278 | 1277 | NULL, |
| 1279 | 1278 | NULL |
| r1591 | r1592 | |
| 1317 | 1316 | MDRV_CPU_MODIFY("sound") |
| 1318 | 1317 | MDRV_CPU_IO_MAP(radarsc1_sound_io_map, 0) |
| 1319 | 1318 | |
| 1320 | MDRV_SOUND_ADD( | |
| 1319 | MDRV_SOUND_ADD( | |
| 1321 | 1320 | MDRV_SOUND_CONFIG(tms5110_interface) |
| 1322 | 1321 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1323 | 1322 |
| r1591 | r1592 | |
|---|---|---|
| 73 | 73 | /* Only cause IRQ if the mask is set to allow it */ |
| 74 | 74 | if (m68681_imr&8) { |
| 75 | 75 | cpunum_set_input_line_vector(1, 6, vector_reg); |
| 76 | cpunum_set_input_line(1, 6, ASSERT_LINE); | |
| 76 | cpunum_set_input_line(machine, 1, 6, ASSERT_LINE); | |
| 77 | 77 | imr_status|=0x8; |
| 78 | 78 | } |
| 79 | 79 | } |
| r1591 | r1592 | |
| 96 | 96 | |
| 97 | 97 | /* IRQ ack */ |
| 98 | 98 | if (offset==0xf) { |
| 99 | cpunum_set_input_line(1, 6, CLEAR_LINE); | |
| 99 | cpunum_set_input_line(Machine, 1, 6, CLEAR_LINE); | |
| 100 | 100 | return 0; |
| 101 | 101 | } |
| 102 | 102 | |
| r1591 | r1592 | |
| 257 | 257 | sound_ram[2]=ROM[0x80002]; |
| 258 | 258 | sound_ram[3]=ROM[0x80003]; |
| 259 | 259 | |
| 260 | //cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 260 | //cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | const struct ES5505interface es5505_interface = |
| r1591 | r1592 | |
|---|---|---|
| 65 | 65 | * |
| 66 | 66 | *************************************/ |
| 67 | 67 | |
| 68 | static void update_68k_interrupts( | |
| 68 | static void update_68k_interrupts(running_machine *machine) | |
| 69 | 69 | { |
| 70 | 70 | int irqline = 0; |
| 71 | 71 | |
| r1591 | r1592 | |
| 73 | 73 | if (irq68k) irqline = 3; |
| 74 | 74 | |
| 75 | 75 | if (irqline) |
| 76 | cpunum_set_input_line(hdcpu_sound, irqline, ASSERT_LINE); | |
| 76 | cpunum_set_input_line(machine, hdcpu_sound, irqline, ASSERT_LINE); | |
| 77 | 77 | else |
| 78 | cpunum_set_input_line(hdcpu_sound, 7, CLEAR_LINE); | |
| 78 | cpunum_set_input_line(machine, hdcpu_sound, 7, CLEAR_LINE); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| r1591 | r1592 | |
| 104 | 104 | { |
| 105 | 105 | maindata = param; |
| 106 | 106 | mainflag = 1; |
| 107 | update_68k_interrupts(); | |
| 107 | update_68k_interrupts(machine); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| r1591 | r1592 | |
| 117 | 117 | |
| 118 | 118 | WRITE16_HANDLER( hd68k_snd_reset_w ) |
| 119 | 119 | { |
| 120 | cpunum_set_input_line(hdcpu_sound, INPUT_LINE_RESET, ASSERT_LINE); | |
| 121 | cpunum_set_input_line(hdcpu_sound, INPUT_LINE_RESET, CLEAR_LINE); | |
| 120 | cpunum_set_input_line(Machine, hdcpu_sound, INPUT_LINE_RESET, ASSERT_LINE); | |
| 121 | cpunum_set_input_line(Machine, hdcpu_sound, INPUT_LINE_RESET, CLEAR_LINE); | |
| 122 | 122 | mainflag = soundflag = 0; |
| 123 | update_68k_interrupts(); | |
| 123 | update_68k_interrupts(Machine); | |
| 124 | 124 | logerror("%06X:Reset sound\n", activecpu_get_previouspc()); |
| 125 | 125 | } |
| 126 | 126 | |
| r1591 | r1592 | |
| 135 | 135 | READ16_HANDLER( hdsnd68k_data_r ) |
| 136 | 136 | { |
| 137 | 137 | mainflag = 0; |
| 138 | update_68k_interrupts(); | |
| 138 | update_68k_interrupts(Machine); | |
| 139 | 139 | logerror("%06X:sound read from main=%04X\n", activecpu_get_previouspc(), maindata); |
| 140 | 140 | return maindata; |
| 141 | 141 | } |
| r1591 | r1592 | |
| 221 | 221 | case 4: /* RES320 */ |
| 222 | 222 | logerror("%06X:RES320=%d\n", activecpu_get_previouspc(), data); |
| 223 | 223 | if (hdcpu_sounddsp != -1) |
| 224 | cpunum_set_input_line(hdcpu_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE); | |
| 224 | cpunum_set_input_line(Machine, hdcpu_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE); | |
| 225 | 225 | break; |
| 226 | 226 | |
| 227 | 227 | case 7: /* LED */ |
| r1591 | r1592 | |
| 239 | 239 | WRITE16_HANDLER( hdsnd68k_irqclr_w ) |
| 240 | 240 | { |
| 241 | 241 | irq68k = 0; |
| 242 | update_68k_interrupts(); | |
| 242 | update_68k_interrupts(Machine); | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
| r1591 | r1592 | |
| 357 | 357 | { |
| 358 | 358 | /* generate 68k IRQ */ |
| 359 | 359 | irq68k = 1; |
| 360 | update_68k_interrupts(); | |
| 360 | update_68k_interrupts(Machine); | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 |
| r1591 | r1592 | |
|---|---|---|
| 100 | 100 | |
| 101 | 101 | cpunum_set_input_line_vector(1,0,irqvector); |
| 102 | 102 | if (irqvector == 0xff) /* no IRQs pending */ |
| 103 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 103 | cpunum_set_input_line(machine, 1,0,CLEAR_LINE); | |
| 104 | 104 | else /* IRQ pending */ |
| 105 | cpunum_set_input_line(1,0,ASSERT_LINE); | |
| 105 | cpunum_set_input_line(machine, 1,0,ASSERT_LINE); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | MACHINE_RESET( m72_sound ) |
| r1591 | r1592 | |
|---|---|---|
| 287 | 287 | RST18_CLEAR |
| 288 | 288 | }; |
| 289 | 289 | |
| 290 | static void update_irq_lines(int param) | |
| 290 | static void update_irq_lines(running_machine *machine, int param) | |
| 291 | 291 | { |
| 292 | 292 | static int irq1,irq2; |
| 293 | 293 | |
| r1591 | r1592 | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | if ((irq1 & irq2) == 0xff) /* no IRQs pending */ |
| 318 | cpunum_set_input_line(sound_cpu,0,CLEAR_LINE); | |
| 318 | cpunum_set_input_line(machine, sound_cpu,0,CLEAR_LINE); | |
| 319 | 319 | else /* IRQ pending */ |
| 320 | cpunum_set_input_line_and_vector(sound_cpu,0,ASSERT_LINE,irq1 & irq2); | |
| 320 | cpunum_set_input_line_and_vector(machine, sound_cpu,0,ASSERT_LINE,irq1 & irq2); | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | WRITE8_HANDLER( seibu_irq_clear_w ) |
| 324 | 324 | { |
| 325 | update_irq_lines(VECTOR_INIT); | |
| 325 | update_irq_lines(Machine, VECTOR_INIT); | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | WRITE8_HANDLER( seibu_rst10_ack_w ) |
| r1591 | r1592 | |
| 332 | 332 | |
| 333 | 333 | WRITE8_HANDLER( seibu_rst18_ack_w ) |
| 334 | 334 | { |
| 335 | update_irq_lines(RST18_CLEAR); | |
| 335 | update_irq_lines(Machine, RST18_CLEAR); | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | void seibu_ym3812_irqhandler(int linestate) |
| 339 | 339 | { |
| 340 | update_irq_lines(linestate ? RST10_ASSERT : RST10_CLEAR); | |
| 340 | update_irq_lines(Machine, linestate ? RST10_ASSERT : RST10_CLEAR); | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | void seibu_ym2151_irqhandler(int linestate) |
| 344 | 344 | { |
| 345 | update_irq_lines(linestate ? RST10_ASSERT : RST10_CLEAR); | |
| 345 | update_irq_lines(Machine, linestate ? RST10_ASSERT : RST10_CLEAR); | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | void seibu_ym2203_irqhandler(int linestate) |
| 349 | 349 | { |
| 350 | update_irq_lines(linestate ? RST10_ASSERT : RST10_CLEAR); | |
| 350 | update_irq_lines(Machine, linestate ? RST10_ASSERT : RST10_CLEAR); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /***************************************************************************/ |
| r1591 | r1592 | |
| 359 | 359 | UINT8 *rom = memory_region(REGION_CPU2); |
| 360 | 360 | |
| 361 | 361 | sound_cpu=1; |
| 362 | update_irq_lines(VECTOR_INIT); | |
| 362 | update_irq_lines(machine, VECTOR_INIT); | |
| 363 | 363 | if (romlength > 0x10000) |
| 364 | 364 | memory_configure_bank(1, 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000); |
| 365 | 365 | } |
| r1591 | r1592 | |
| 371 | 371 | UINT8 *rom = memory_region(REGION_CPU3); |
| 372 | 372 | |
| 373 | 373 | sound_cpu=2; |
| 374 | update_irq_lines(VECTOR_INIT); | |
| 374 | update_irq_lines(machine, VECTOR_INIT); | |
| 375 | 375 | if (romlength > 0x10000) |
| 376 | 376 | memory_configure_bank(1, 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000); |
| 377 | 377 | } |
| r1591 | r1592 | |
| 442 | 442 | main2sub[offset] = data; |
| 443 | 443 | break; |
| 444 | 444 | case 4: |
| 445 | update_irq_lines(RST18_ASSERT); | |
| 445 | update_irq_lines(Machine, RST18_ASSERT); | |
| 446 | 446 | break; |
| 447 | 447 | case 6: |
| 448 | 448 | /* just a guess */ |
| r1591 | r1592 | |
| 473 | 473 | |
| 474 | 474 | // logerror("seibu_main_mustb_w: %x -> %x %x\n", data, main2sub[0], main2sub[1]); |
| 475 | 475 | |
| 476 | update_irq_lines(RST18_ASSERT); | |
| 476 | update_irq_lines(Machine, RST18_ASSERT); | |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | /***************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 168 | 168 | INTERRUPT_GEN( namcoc7x_interrupt ) |
| 169 | 169 | { |
| 170 | 170 | if (cpu_getiloops() == 0) |
| 171 | cpunum_set_input_line(1, M37710_LINE_IRQ0, HOLD_LINE); | |
| 171 | cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE); | |
| 172 | 172 | else |
| 173 | cpunum_set_input_line(1, M37710_LINE_IRQ2, HOLD_LINE); | |
| 173 | cpunum_set_input_line(machine, 1, M37710_LINE_IRQ2, HOLD_LINE); | |
| 174 | 174 | } |
| 175 | 175 |
| r1591 | r1592 | |
|---|---|---|
| 933 | 933 | D3 = /INT line |
| 934 | 934 | */ |
| 935 | 935 | n7751_command = data & 0x07; |
| 936 | cpunum_set_input_line(1, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 936 | cpunum_set_input_line(Machine, 1, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 937 | 937 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 938 | 938 | } |
| 939 | 939 |
| r1591 | r1592 | |
|---|---|---|
| 62 | 62 | FUNCTION PROTOTYPES |
| 63 | 63 | ****************************************************************************/ |
| 64 | 64 | |
| 65 | static void init_audio_state( | |
| 65 | static void init_audio_state(running_machine *machine); | |
| 66 | 66 | |
| 67 | 67 | static void cvsd_ym2151_irq(int state); |
| 68 | 68 | static void adpcm_ym2151_irq(int state); |
| r1591 | r1592 | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| 379 | static void init_audio_state( | |
| 379 | static void init_audio_state(running_machine *machine) | |
| 380 | 380 | { |
| 381 | 381 | /* reset the YM2151 state */ |
| 382 | 382 | sndti_reset(SOUND_YM2151, 0); |
| r1591 | r1592 | |
| 385 | 385 | williams_sound_int_state = 0; |
| 386 | 386 | if (sound_cpunum != -1) |
| 387 | 387 | { |
| 388 | cpunum_set_input_line(sound_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 389 | cpunum_set_input_line(sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 390 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_NMI, CLEAR_LINE); | |
| 388 | cpunum_set_input_line(machine, sound_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 389 | cpunum_set_input_line(machine, sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 390 | cpunum_set_input_line(machine, sound_cpunum, INPUT_LINE_NMI, CLEAR_LINE); | |
| 391 | 391 | } |
| 392 | 392 | if (soundalt_cpunum != -1) |
| 393 | 393 | { |
| 394 | cpunum_set_input_line(soundalt_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 395 | cpunum_set_input_line(soundalt_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 396 | cpunum_set_input_line(soundalt_cpunum, INPUT_LINE_NMI, CLEAR_LINE); | |
| 394 | cpunum_set_input_line(machine, soundalt_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 395 | cpunum_set_input_line(machine, soundalt_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 396 | cpunum_set_input_line(machine, soundalt_cpunum, INPUT_LINE_NMI, CLEAR_LINE); | |
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | |
| r1591 | r1592 | |
| 411 | 411 | |
| 412 | 412 | static void cvsd_irqa(int state) |
| 413 | 413 | { |
| 414 | cpunum_set_input_line(sound_cpunum, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 414 | cpunum_set_input_line(Machine, sound_cpunum, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | |
| 418 | 418 | static void cvsd_irqb(int state) |
| 419 | 419 | { |
| 420 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); | |
| 420 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | |
| r1591 | r1592 | |
| 428 | 428 | |
| 429 | 429 | static void adpcm_ym2151_irq(int state) |
| 430 | 430 | { |
| 431 | cpunum_set_input_line(sound_cpunum, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 431 | cpunum_set_input_line(Machine, sound_cpunum, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | |
| r1591 | r1592 | |
| 487 | 487 | if (state) |
| 488 | 488 | { |
| 489 | 489 | cvsd_bank_select_w(0, 0); |
| 490 | init_audio_state(); | |
| 491 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 490 | init_audio_state(Machine); | |
| 491 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 492 | 492 | } |
| 493 | 493 | /* going low resets and reactivates the CPU */ |
| 494 | 494 | else |
| 495 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 495 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | |
| r1591 | r1592 | |
| 515 | 515 | |
| 516 | 516 | static READ8_HANDLER( narc_command_r ) |
| 517 | 517 | { |
| 518 | cpunum_set_input_line(sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 518 | cpunum_set_input_line(Machine, sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 519 | 519 | williams_sound_int_state = 0; |
| 520 | 520 | return soundlatch_r(0); |
| 521 | 521 | } |
| r1591 | r1592 | |
| 524 | 524 | static WRITE8_HANDLER( narc_command2_w ) |
| 525 | 525 | { |
| 526 | 526 | soundlatch2_w(0, data & 0xff); |
| 527 | cpunum_set_input_line(soundalt_cpunum, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 527 | cpunum_set_input_line(Machine, soundalt_cpunum, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | |
| 531 | 531 | static READ8_HANDLER( narc_command2_r ) |
| 532 | 532 | { |
| 533 | cpunum_set_input_line(soundalt_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 533 | cpunum_set_input_line(Machine, soundalt_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 534 | 534 | return soundlatch2_r(0); |
| 535 | 535 | } |
| 536 | 536 | |
| r1591 | r1592 | |
| 577 | 577 | void williams_narc_data_w(int data) |
| 578 | 578 | { |
| 579 | 579 | soundlatch_w(0, data & 0xff); |
| 580 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_NMI, (data & 0x100) ? CLEAR_LINE : ASSERT_LINE); | |
| 580 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_NMI, (data & 0x100) ? CLEAR_LINE : ASSERT_LINE); | |
| 581 | 581 | if (!(data & 0x200)) |
| 582 | 582 | { |
| 583 | cpunum_set_input_line(sound_cpunum, M6809_IRQ_LINE, ASSERT_LINE); | |
| 583 | cpunum_set_input_line(Machine, sound_cpunum, M6809_IRQ_LINE, ASSERT_LINE); | |
| 584 | 584 | williams_sound_int_state = 1; |
| 585 | 585 | } |
| 586 | 586 | } |
| r1591 | r1592 | |
| 593 | 593 | { |
| 594 | 594 | narc_master_bank_select_w(0, 0); |
| 595 | 595 | narc_slave_bank_select_w(0, 0); |
| 596 | init_audio_state(); | |
| 597 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 598 | cpunum_set_input_line(soundalt_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 596 | init_audio_state(Machine); | |
| 597 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 598 | cpunum_set_input_line(Machine, soundalt_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 599 | 599 | } |
| 600 | 600 | /* going low resets and reactivates the CPU */ |
| 601 | 601 | else |
| 602 | 602 | { |
| 603 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 604 | cpunum_set_input_line(soundalt_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 603 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 604 | cpunum_set_input_line(Machine, soundalt_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | |
| r1591 | r1592 | |
| 637 | 637 | |
| 638 | 638 | static READ8_HANDLER( adpcm_command_r ) |
| 639 | 639 | { |
| 640 | cpunum_set_input_line(sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 640 | cpunum_set_input_line(Machine, sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 641 | 641 | |
| 642 | 642 | /* don't clear the external IRQ state for a short while; this allows the |
| 643 | 643 | self-tests to pass */ |
| r1591 | r1592 | |
| 663 | 663 | soundlatch_w(0, data & 0xff); |
| 664 | 664 | if (!(data & 0x200)) |
| 665 | 665 | { |
| 666 | cpunum_set_input_line(sound_cpunum, M6809_IRQ_LINE, ASSERT_LINE); | |
| 666 | cpunum_set_input_line(Machine, sound_cpunum, M6809_IRQ_LINE, ASSERT_LINE); | |
| 667 | 667 | williams_sound_int_state = 1; |
| 668 | 668 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 669 | 669 | } |
| r1591 | r1592 | |
| 676 | 676 | if (state) |
| 677 | 677 | { |
| 678 | 678 | adpcm_bank_select_w(0, 0); |
| 679 | init_audio_state(); | |
| 680 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 679 | init_audio_state(Machine); | |
| 680 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 681 | 681 | } |
| 682 | 682 | /* going low resets and reactivates the CPU */ |
| 683 | 683 | else |
| 684 | cpunum_set_input_line(sound_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 684 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 |
| r1591 | r1592 | |
|---|---|---|
| 170 | 170 | { |
| 171 | 171 | /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ |
| 172 | 172 | /* we need to complement Q bar */ |
| 173 | cpunum_set_input_line(1, 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE); | |
| 173 | cpunum_set_input_line(Machine, 1, 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static void sfx_sh_7474_callback(void) |
| 177 | 177 | { |
| 178 | 178 | /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ |
| 179 | 179 | /* we need to complement Q bar */ |
| 180 | cpunum_set_input_line(2, 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE); | |
| 180 | cpunum_set_input_line(Machine, 2, 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | WRITE8_HANDLER( hotshock_sh_irqtrigger_w ) |
| 184 | 184 | { |
| 185 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 185 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | READ8_HANDLER( hotshock_soundlatch_r ) |
| 189 | 189 | { |
| 190 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 190 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 191 | 191 | return soundlatch_r(0); |
| 192 | 192 | } |
| 193 | 193 | |
| r1591 | r1592 | |
| 395 | 395 | |
| 396 | 396 | static const struct TMS5110interface ad2083_tms5110_interface = |
| 397 | 397 | { |
| 398 | TMS5110_IS_5110A, | |
| 399 | 398 | -1, /* rom_region */ |
| 400 | 399 | ad2083_speech_rom_read_bit /* M0 callback function. Called whenever chip requests a single bit of data */ |
| 401 | 400 | }; |
| r1591 | r1592 | |
| 455 | 454 | MDRV_SOUND_CONFIG(ad2083_ay8910_interface_2) |
| 456 | 455 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) |
| 457 | 456 | |
| 458 | MDRV_SOUND_ADD(TMS5110, AD2083_TMS5110_CLOCK) | |
| 457 | MDRV_SOUND_ADD(TMS5110A, AD2083_TMS5110_CLOCK) | |
| 459 | 458 | MDRV_SOUND_CONFIG(ad2083_tms5110_interface) |
| 460 | 459 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 461 | 460 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | port_8255_c03 = (data>>5); |
| 30 | 30 | |
| 31 | cpunum_set_input_line(2, 0, PULSE_LINE); | |
| 31 | cpunum_set_input_line(machine, 2, 0, PULSE_LINE); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // I'm sure this must be wrong, but it seems to work for quartet music. |
| r1591 | r1592 | |
| 38 | 38 | |
| 39 | 39 | if ((data & 0x0f) != 8) |
| 40 | 40 | { |
| 41 | cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE); | |
| 41 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE); | |
| 42 | 42 | timer_set(ATTOTIME_IN_USEC(300), NULL, data, trigger_7751_sound); |
| 43 | 43 | } |
| 44 | 44 | } |
| r1591 | r1592 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Irem Red Alert | |
| 3 | Irem Red Alert | |
| 4 | 4 | |
| 5 | The manual lists two sets of sounds. | |
| 5 | If you have any questions about how this driver works, don't hesitate to | |
| 6 | ask. - Mike Balfour (mab22@po.cwru.edu) | |
| 6 | 7 | |
| 7 | Analogue: | |
| 8 | - Formation Aircraft | |
| 9 | - Dive bombers | |
| 10 | - Helicopters | |
| 11 | - Launcher firing | |
| 12 | - Explosion #1 | |
| 13 | - Explosion #2 | |
| 14 | - Explosion #3 | |
| 8 | ****************************************************************************/ | |
| 15 | 9 | |
| 16 | Digital: | |
| 17 | - Melody #1. Starting sound. | |
| 18 | - Melody #2. Ending sound | |
| 19 | - Time signal | |
| 20 | - Chirping birds | |
| 21 | - Alarm | |
| 22 | - Excellent | |
| 23 | - Coin insertion | |
| 24 | - MIRV division | |
| 25 | - Megaton bomb - long | |
| 26 | - Megaton bomb - short | |
| 27 | - Megaton bomb landing | |
| 28 | ||
| 29 | If you have any questions about how this driver works, don't hesitate to | |
| 30 | ask. - Mike Balfour (mab22@po.cwru.edu) | |
| 31 | ***************************************************************************/ | |
| 32 | ||
| 33 | 10 | #include "driver.h" |
| 34 | #include "cp | |
| 11 | #include "rescap | |
| 35 | 12 | #include "cpu/i8085/i8085.h" |
| 13 | #include "machine/6821pia.h" | |
| 36 | 14 | #include "sound/ay8910.h" |
| 15 | #include "sound/hc55516.h" | |
| 37 | 16 | |
| 38 | static int AY8910_A_input_data = 0; | |
| 39 | static int c030_data = 0; | |
| 40 | static int sound_register_IC1 = 0; | |
| 41 | static int sound_register_IC2 = 0; | |
| 42 | 17 | |
| 43 | WRITE8_HANDLER( redalert_c030_w ) | |
| 18 | ||
| 19 | #define REDALERT_AUDIO_PCB_CLOCK (XTAL_12_5MHz) | |
| 20 | #define REDALERT_AUDIO_CPU_CLOCK (REDALERT_AUDIO_PCB_CLOCK / 12) | |
| 21 | #define REDALERT_AY8910_CLOCK (REDALERT_AUDIO_PCB_CLOCK / 6) | |
| 22 | #define REDALERT_AUDIO_CPU_IRQ_FREQ (1.0 / attotime_to_double(PERIOD_OF_555_ASTABLE(RES_K(120), RES_K(2.7), CAP_U(0.01)))) | |
| 23 | ||
| 24 | #define REDALERT_VOICE_PCB_CLOCK (XTAL_6MHz) | |
| 25 | #define REDALERT_VOICE_CPU_CLOCK (REDALERT_VOICE_PCB_CLOCK) | |
| 26 | #define REDALERT_HC55516_CLOCK (REDALERT_VOICE_PCB_CLOCK / 256) | |
| 27 | ||
| 28 | #define DEMONEYE_AUDIO_PCB_CLOCK (XTAL_3_579545MHz) | |
| 29 | #define DEMONEYE_AUDIO_CPU_CLOCK (DEMONEYE_AUDIO_PCB_CLOCK / 4) /* what's the real divisor? */ | |
| 30 | #define DEMONEYE_AY8910_CLOCK (DEMONEYE_AUDIO_PCB_CLOCK / 2) /* what's the real divisor? */ | |
| 31 | ||
| 32 | ||
| 33 | ||
| 34 | /************************************* | |
| 35 | * | |
| 36 | * Statics | |
| 37 | * | |
| 38 | *************************************/ | |
| 39 | ||
| 40 | static UINT8 ay8910_latch_1; | |
| 41 | static UINT8 ay8910_latch_2; | |
| 42 | ||
| 43 | static UINT8 ay8910_latch_1; | |
| 44 | ||
| 45 | ||
| 46 | ||
| 47 | /************************************* | |
| 48 | * | |
| 49 | * Read Alert analog sounds | |
| 50 | * | |
| 51 | *************************************/ | |
| 52 | ||
| 53 | static WRITE8_HANDLER( redalert_analog_w ) | |
| 44 | 54 | { |
| 45 | c030_data = data & 0x3F; | |
| 55 | /* this port triggers analog sounds | |
| 56 | D0 = Formation Aircraft? | |
| 57 | D1 = Dive bombers? | |
| 58 | D2 = Helicopters? | |
| 59 | D3 = Launcher firing? | |
| 60 | D4 = Explosion #1? | |
| 61 | D5 = Explosion #2? | |
| 62 | D6 = Explosion #3? */ | |
| 46 | 63 | |
| 47 | /* Is this some type of sound command? */ | |
| 48 | if (data & 0x80) | |
| 49 | /* Cause an NMI on the voice CPU here? */ | |
| 50 | cpunum_set_input_line(2,I8085_RST75_LINE,HOLD_LINE); | |
| 64 | logerror("Analog: %02X\n",data); | |
| 51 | 65 | } |
| 52 | 66 | |
| 53 | READ8_HANDLER( redalert_voicecommand_r ) | |
| 67 | ||
| 68 | ||
| 69 | /************************************* | |
| 70 | * | |
| 71 | * Red Alert audio board | |
| 72 | * | |
| 73 | *************************************/ | |
| 74 | ||
| 75 | WRITE8_HANDLER( redalert_audio_command_w ) | |
| 54 | 76 | { |
| 55 | return c030_data; | |
| 77 | /* the byte is connected to port A of the AY8910 */ | |
| 78 | soundlatch_w(0, data); | |
| 79 | ||
| 80 | /* D7 is also connected to the NMI input of the CPU - | |
| 81 | the NMI is actually toggled by a 74121 */ | |
| 82 | if ((data & 0x80) == 0x00) | |
| 83 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 56 | 84 | } |
| 57 | 85 | |
| 58 | WRITE8_HANDLER( redalert_soundlatch_w ) | |
| 86 | ||
| 87 | static WRITE8_HANDLER( redalert_AY8910_w ) | |
| 59 | 88 | { |
| 60 | /* The byte is connected to Port A of the AY8910 */ | |
| 61 | AY8910_A_input_data = data; | |
| 89 | /* BC2 is connected to a pull-up resistor, so BC2=1 always */ | |
| 90 | switch (data & 0x03) | |
| 91 | { | |
| 92 | /* BC1=0, BDIR=0 : inactive */ | |
| 93 | case 0x00: | |
| 94 | break; | |
| 62 | 95 | |
| 63 | /* Bit D7 is also connected to the NMI input of the CPU */ | |
| 64 | if ((data & 0x80)!=0x80) | |
| 65 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 96 | /* BC1=1, BDIR=0 : read from PSG */ | |
| 97 | case 0x01: | |
| 98 | ay8910_latch_1 = AY8910_read_port_0_r(0); | |
| 99 | break; | |
| 100 | ||
| 101 | /* BC1=0, BDIR=1 : write to PSG */ | |
| 102 | case 0x02: | |
| 103 | AY8910_write_port_0_w(0, ay8910_latch_2); | |
| 104 | break; | |
| 105 | ||
| 106 | /* BC1=1, BDIR=1 : latch address */ | |
| 107 | default: | |
| 108 | case 0x03: | |
| 109 | AY8910_control_port_0_w(0, ay8910_latch_2); | |
| 110 | break; | |
| 111 | } | |
| 66 | 112 | } |
| 67 | 113 | |
| 68 | READ8_HANDLER( redalert_AY8910_A_r ) | |
| 114 | ||
| 115 | static READ8_HANDLER( redalert_ay8910_latch_1_r ) | |
| 69 | 116 | { |
| 70 | return | |
| 117 | return ay8910_l | |
| 71 | 118 | } |
| 72 | 119 | |
| 73 | WRITE8_HANDLER( redalert_AY8910_w ) | |
| 120 | ||
| 121 | static WRITE8_HANDLER( redalert_ay8910_latch_2_w ) | |
| 74 | 122 | { |
| 75 | /* BC2 is connected to a pull-up resistor, so BC2=1 always */ | |
| 76 | switch (data) | |
| 123 | ay8910_latch_2 = data; | |
| 124 | } | |
| 125 | ||
| 126 | ||
| 127 | static const struct AY8910interface redalert_ay8910_interface = | |
| 128 | { | |
| 129 | soundlatch_r, 0, /* port A/B read */ | |
| 130 | 0, redalert_analog_w /* port A/B write */ | |
| 131 | }; | |
| 132 | ||
| 133 | ||
| 134 | static ADDRESS_MAP_START( redalert_audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 135 | ADDRESS_MAP_FLAGS( AMEF_ABITS(15) ) | |
| 136 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x0c00) AM_RAM | |
| 137 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0ffe) AM_READWRITE(MRA8_NOP, redalert_AY8910_w) | |
| 138 | AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x0ffe) AM_READWRITE(redalert_ay8910_latch_1_r, redalert_ay8910_latch_2_w) | |
| 139 | AM_RANGE(0x2000, 0x6fff) AM_NOP | |
| 140 | AM_RANGE(0x7000, 0x77ff) AM_MIRROR(0x0800) AM_ROM | |
| 141 | ADDRESS_MAP_END | |
| 142 | ||
| 143 | ||
| 144 | static SOUND_START( redalert_audio ) | |
| 145 | { | |
| 146 | state_save_register_global(ay8910_latch_1); | |
| 147 | state_save_register_global(ay8910_latch_2); | |
| 148 | } | |
| 149 | ||
| 150 | ||
| 151 | ||
| 152 | /************************************* | |
| 153 | * | |
| 154 | * Red Alert voice board | |
| 155 | * | |
| 156 | *************************************/ | |
| 157 | ||
| 158 | WRITE8_HANDLER( redalert_voice_command_w ) | |
| 159 | { | |
| 160 | soundlatch2_w(0, (data & 0x78) >> 3); | |
| 161 | ||
| 162 | cpunum_set_input_line(Machine, 2, I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 163 | } | |
| 164 | ||
| 165 | ||
| 166 | static void sod_callback(int data) | |
| 167 | { | |
| 168 | hc55516_digit_w(0, data); | |
| 169 | } | |
| 170 | ||
| 171 | ||
| 172 | static int sid_callback(void) | |
| 173 | { | |
| 174 | return hc55516_clock_state_r(0); | |
| 175 | } | |
| 176 | ||
| 177 | ||
| 178 | static SOUND_START( redalert_voice ) | |
| 179 | { | |
| 180 | cpunum_set_info_fct(2, CPUINFO_PTR_I8085_SOD_CALLBACK, (void *)sod_callback); | |
| 181 | cpunum_set_info_fct(2, CPUINFO_PTR_I8085_SID_CALLBACK, (void *)sid_callback); | |
| 182 | } | |
| 183 | ||
| 184 | ||
| 185 | static ADDRESS_MAP_START( redalert_voice_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 186 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 187 | AM_RANGE(0x4000, 0x7fff) AM_NOP | |
| 188 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x3c00) AM_RAM | |
| 189 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x3fff) AM_READWRITE(soundlatch2_r, MWA8_NOP) | |
| 190 | ADDRESS_MAP_END | |
| 191 | ||
| 192 | ||
| 193 | ||
| 194 | /************************************* | |
| 195 | * | |
| 196 | * Red Alert audio start | |
| 197 | * | |
| 198 | *************************************/ | |
| 199 | ||
| 200 | static SOUND_START( redalert ) | |
| 201 | { | |
| 202 | SOUND_START_CALL(redalert_audio); | |
| 203 | SOUND_START_CALL(redalert_voice); | |
| 204 | } | |
| 205 | ||
| 206 | ||
| 207 | ||
| 208 | /************************************* | |
| 209 | * | |
| 210 | * Red Alert machine driver | |
| 211 | * | |
| 212 | *************************************/ | |
| 213 | ||
| 214 | MACHINE_DRIVER_START( redalert_audio ) | |
| 215 | ||
| 216 | MDRV_CPU_ADD(M6502, REDALERT_AUDIO_CPU_CLOCK) | |
| 217 | MDRV_CPU_PROGRAM_MAP(redalert_audio_map,0) | |
| 218 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, REDALERT_AUDIO_CPU_IRQ_FREQ) | |
| 219 | ||
| 220 | MDRV_CPU_ADD(8085A, REDALERT_VOICE_CPU_CLOCK) | |
| 221 | MDRV_CPU_PROGRAM_MAP(redalert_voice_map,0) | |
| 222 | ||
| 223 | MDRV_SOUND_START( redalert ) | |
| 224 | ||
| 225 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 226 | ||
| 227 | MDRV_SOUND_ADD(AY8910, REDALERT_AY8910_CLOCK) | |
| 228 | MDRV_SOUND_CONFIG(redalert_ay8910_interface) | |
| 229 | MDRV_SOUND_ROUTE(0, "mono", 0.50) | |
| 230 | MDRV_SOUND_ROUTE(1, "mono", 0.50) | |
| 231 | /* channel C is used a noise source and is not connected to a speaker */ | |
| 232 | ||
| 233 | MDRV_SOUND_ADD(HC55516, REDALERT_HC55516_CLOCK) | |
| 234 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 235 | MACHINE_DRIVER_END | |
| 236 | ||
| 237 | ||
| 238 | ||
| 239 | /************************************* | |
| 240 | * | |
| 241 | * Demoneye-X audio board | |
| 242 | * | |
| 243 | *************************************/ | |
| 244 | ||
| 245 | ||
| 246 | WRITE8_HANDLER( demoneye_audio_command_w ) | |
| 247 | { | |
| 248 | /* the byte is connected to port A of the AY8910 */ | |
| 249 | soundlatch_w(0, data); | |
| 250 | ||
| 251 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 252 | } | |
| 253 | ||
| 254 | ||
| 255 | static WRITE8_HANDLER( demoneye_ay8910_latch_1_w ) | |
| 256 | { | |
| 257 | ay8910_latch_1 = data; | |
| 258 | } | |
| 259 | ||
| 260 | ||
| 261 | static READ8_HANDLER( demoneye_ay8910_latch_2_r ) | |
| 262 | { | |
| 263 | return ay8910_latch_2; | |
| 264 | } | |
| 265 | ||
| 266 | ||
| 267 | static WRITE8_HANDLER( demoneye_ay8910_data_w ) | |
| 268 | { | |
| 269 | switch (ay8910_latch_1 & 0x03) | |
| 77 | 270 | { |
| 78 | 271 | case 0x00: |
| 79 | /* BC1=0, BDIR=0 : INACTIVE */ | |
| 272 | if (ay8910_latch_1 & 0x10) | |
| 273 | AY8910_write_port_0_w(0, data); | |
| 274 | ||
| 275 | if (ay8910_latch_1 & 0x20) | |
| 276 | AY8910_write_port_1_w(0, data); | |
| 277 | ||
| 80 | 278 | break; |
| 279 | ||
| 81 | 280 | case 0x01: |
| 82 | /* BC1=1, BDIR=0 : READ FROM PSG */ | |
| 83 | sound_register_IC1 = AY8910_read_port_0_r(offset); | |
| 281 | if (ay8910_latch_1 & 0x10) | |
| 282 | ay8910_latch_2 = AY8910_read_port_0_r(0); | |
| 283 | ||
| 284 | if (ay8910_latch_1 & 0x20) | |
| 285 | ay8910_latch_2 = AY8910_read_port_1_r(0); | |
| 286 | ||
| 84 | 287 | break; |
| 85 | case 0x02: | |
| 86 | /* BC1=0, BDIR=1 : WRITE TO PSG */ | |
| 87 | AY8910_write_port_0_w(offset,sound_register_IC2); | |
| 88 | break; | |
| 288 | ||
| 89 | 289 | case 0x03: |
| 90 | /* BC1=1, BDIR=1 : LATCH ADDRESS */ | |
| 91 | AY8910_control_port_0_w(offset,sound_register_IC2); | |
| 290 | if (ay8910_latch_1 & 0x10) | |
| 291 | AY8910_control_port_0_w(0, data); | |
| 292 | ||
| 293 | if (ay8910_latch_1 & 0x20) | |
| 294 | AY8910_control_port_1_w(0, data); | |
| 295 | ||
| 92 | 296 | break; |
| 297 | ||
| 93 | 298 | default: |
| 94 | logerror(" | |
| 299 | logerror("demoneye_ay8910_data_w called with latch %02X data %02X\n", ay8910_latch_1, data); | |
| 95 | 300 | break; |
| 96 | 301 | } |
| 97 | 302 | } |
| 98 | 303 | |
| 99 | READ8_HANDLER( redalert_sound_register_IC1_r ) | |
| 304 | ||
| 305 | static ADDRESS_MAP_START( demoneye_audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 306 | ADDRESS_MAP_FLAGS( AMEF_ABITS(14) ) | |
| 307 | AM_RANGE(0x0000, 0x007f) AM_RAM | |
| 308 | AM_RANGE(0x0500, 0x0503) AM_READWRITE(pia_0_r, pia_0_w) | |
| 309 | AM_RANGE(0x2000, 0x3fff) AM_ROM | |
| 310 | ADDRESS_MAP_END | |
| 311 | ||
| 312 | ||
| 313 | static const struct AY8910interface demoneye_ay8910_interface = | |
| 100 | 314 | { |
| 101 | return sound_register_IC1; | |
| 102 | } | |
| 315 | soundlatch_r, 0, /* port A/B read */ | |
| 316 | 0, 0 /* port A/B write */ | |
| 317 | }; | |
| 103 | 318 | |
| 104 | WRITE8_HANDLER( redalert_sound_register_IC2_w ) | |
| 319 | ||
| 320 | static const pia6821_interface demoneye_pia_intf = | |
| 105 | 321 | { |
| 106 | sound_register_IC2 = data; | |
| 322 | /*inputs : A/B,CA/B1,CA/B2 */ demoneye_ay8910_latch_2_r, 0, 0, 0, 0, 0, | |
| 323 | /*outputs: A/B,CA/B2 */ demoneye_ay8910_data_w, demoneye_ay8910_latch_1_w, 0, 0, | |
| 324 | /*irqs : A/B */ 0, 0 | |
| 325 | }; | |
| 326 | ||
| 327 | ||
| 328 | ||
| 329 | /************************************* | |
| 330 | * | |
| 331 | * Demoneye-X audio start | |
| 332 | * | |
| 333 | *************************************/ | |
| 334 | ||
| 335 | static SOUND_START( demoneye ) | |
| 336 | { | |
| 337 | pia_config(0, &demoneye_pia_intf); | |
| 338 | ||
| 339 | state_save_register_global(ay8910_latch_1); | |
| 340 | state_save_register_global(ay8910_latch_2); | |
| 107 | 341 | } |
| 108 | 342 | |
| 109 | WRITE8_HANDLER( redalert_AY8910_B_w ) | |
| 343 | ||
| 344 | ||
| 345 | /************************************* | |
| 346 | * | |
| 347 | * Demoneye-X audio reset | |
| 348 | * | |
| 349 | *************************************/ | |
| 350 | ||
| 351 | static SOUND_RESET( demoneye ) | |
| 110 | 352 | { |
| 111 | /* I'm fairly certain this port triggers analog sounds */ | |
| 112 | logerror("Port B Trigger: %02X\n",data); | |
| 113 | /* D0 = Formation Aircraft? */ | |
| 114 | /* D1 = Dive bombers? */ | |
| 115 | /* D2 = Helicopters? */ | |
| 116 | /* D3 = Launcher firing? */ | |
| 117 | /* D4 = Explosion #1? */ | |
| 118 | /* D5 = Explosion #2? */ | |
| 119 | /* D6 = Explosion #3? */ | |
| 353 | pia_reset(); | |
| 120 | 354 | } |
| 121 | 355 | |
| 356 | ||
| 357 | ||
| 358 | /************************************* | |
| 359 | * | |
| 360 | * Demoneye-X machine driver | |
| 361 | * | |
| 362 | *************************************/ | |
| 363 | ||
| 364 | MACHINE_DRIVER_START( demoneye_audio ) | |
| 365 | ||
| 366 | MDRV_CPU_ADD(M6802, DEMONEYE_AUDIO_CPU_CLOCK) | |
| 367 | MDRV_CPU_PROGRAM_MAP(demoneye_audio_map,0) | |
| 368 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, REDALERT_AUDIO_CPU_IRQ_FREQ) /* guess */ | |
| 369 | ||
| 370 | MDRV_SOUND_START( demoneye ) | |
| 371 | MDRV_SOUND_RESET( demoneye ) | |
| 372 | ||
| 373 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 374 | ||
| 375 | MDRV_SOUND_ADD(AY8910, DEMONEYE_AY8910_CLOCK) | |
| 376 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 377 | ||
| 378 | MDRV_SOUND_ADD(AY8910, DEMONEYE_AY8910_CLOCK) | |
| 379 | MDRV_SOUND_CONFIG(demoneye_ay8910_interface) | |
| 380 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 381 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | static TIMER_CALLBACK( snd_interrupt ) |
| 54 | 54 | { |
| 55 | 55 | irq_flag |= 0x80; /* set timer interrupt flag */ |
| 56 | cpunum_set_input_line(1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 56 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| r1591 | r1592 | |
| 87 | 87 | |
| 88 | 88 | case 5: /* 0x85 - Read Interrupt Flag Register */ |
| 89 | 89 | if (irq_flag) |
| 90 | cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 90 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 91 | 91 | temp = irq_flag; |
| 92 | 92 | irq_flag = 0; /* Clear int flags */ |
| 93 | 93 | return temp; |
| r1591 | r1592 | |
| 188 | 188 | { |
| 189 | 189 | port_A &= 0x7f; /* ready to receive new commands from main */ |
| 190 | 190 | if (PA7_irq) |
| 191 | cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 191 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 192 | 192 | return sound_data; |
| 193 | 193 | } |
| 194 | 194 | |
| r1591 | r1592 | |
| 228 | 228 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 229 | 229 | |
| 230 | 230 | if (PA7_irq) |
| 231 | cpunum_set_input_line(1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 231 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | WRITE8_HANDLER( starwars_main_wr_w ) |
| r1591 | r1592 | |
| 242 | 242 | port_A &= 0x3f; |
| 243 | 243 | |
| 244 | 244 | /* reset sound CPU here */ |
| 245 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 245 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 246 | 246 | } |
| 247 | 247 |
| r1591 | r1592 | |
|---|---|---|
| 75 | 75 | * |
| 76 | 76 | * Mario Discrete Sound Interface |
| 77 | 77 | * |
| 78 | * verified against picture of a TMA1-04-CPU Board. Some | |
| 79 | * of the values were hard to read, though. | |
| 80 | * | |
| 78 | 81 | ****************************************************************/ |
| 79 | 82 | |
| 80 | #define MR_R6 RES_K(4.7) | |
| 81 | #define MR_R7 RES_K(4.7) | |
| 82 | #define MR_R17 RES_K(30) | |
| 83 | #define MR_R18 RES_K(30) | |
| 84 | #define MR_R61 RES_K(47) | |
| 85 | #define MR_R64 RES_K(20) | |
| 86 | #define MR_R65 RES_K(10) | |
| 83 | #define MR_R6 RES_K(4.7) /* verified */ | |
| 84 | #define MR_R7 RES_K(4.7) /* verified */ | |
| 85 | #define MR_R17 RES_K(27) /* verified, 30K in schematics */ | |
| 86 | #define MR_R18 RES_K(27) /* verified, 30K in schematics */ | |
| 87 | #define MR_R19 RES_K(22) /* verified */ | |
| 88 | #define MR_R20 RES_K(22) /* verified */ | |
| 89 | #define MR_R40 RES_K(22) /* verified */ | |
| 90 | #define MR_R41 RES_K(100) /* verified, hard to read */ | |
| 91 | #define MR_R61 RES_K(47) /* verified, hard to read */ | |
| 92 | #define MR_R64 RES_K(20) /* verified */ | |
| 93 | #define MR_R65 RES_K(10) /* verified */ | |
| 87 | 94 | |
| 88 | #define MR_C3 CAP_U(10) | |
| 89 | #define MR_C4 CAP_U(47) | |
| 90 | #define MR_C5 CAP_N(39) | |
| 91 | #define MR_C6 CAP_N(3.9) | |
| 92 | #define MR_C14 CAP_U(4.7) | |
| 93 | #define MR_C15 CAP_U(4.7) | |
| 94 | #define MR_C16 CAP_N(6.8) | |
| 95 | #define MR_C17 CAP_N(22) | |
| 96 | #define MR_C39 CAP_N(4.7) | |
| 97 | #define MR_C40 CAP_N(22) | |
| 98 | #define MR_C41 CAP_U(4.7) | |
| 99 | #define MR_C43 CAP_U(3.3) | |
| 100 | #define MR_C44 CAP_U(3.3) | |
| 95 | #define MR_C3 CAP_U(10) /* verified */ | |
| 96 | #define MR_C4 CAP_U(47) /* illegible, 4.7 or 47 pcb/schematics */ | |
| 97 | #define MR_C5 CAP_N(39) /* illegible on pcb */ | |
| 98 | #define MR_C6 CAP_N(3.9) /* illegible on pcb */ | |
| 99 | #define MR_C14 CAP_U(4.7) /* verified */ | |
| 100 | #define MR_C15 CAP_U(4.7) /* verified */ | |
| 101 | #define MR_C16 CAP_N(6.8) /* verified */ | |
| 102 | #define MR_C17 CAP_N(22) /* illegible on pcb */ | |
| 103 | #define MR_C31 CAP_U(0.022) /* not found */ | |
| 104 | #define MR_C32 CAP_U(1) /* illegible on pcb */ | |
| 105 | #define MR_C39 CAP_N(4.7) /* not found */ | |
| 106 | #define MR_C40 CAP_N(22) /* verified */ | |
| 107 | #define MR_C41 CAP_U(4.7) /* verified, hard to read */ | |
| 108 | #define MR_C43 CAP_U(3.3) /* verified */ | |
| 109 | #define MR_C44 CAP_U(3.3) /* verified */ | |
| 101 | 110 | |
| 111 | ||
| 112 | ||
| 102 | 113 | /* KT = 0.25 for diode circuit, 0.33 else */ |
| 103 | 114 | |
| 104 | 115 | #define DISCRETE_LS123(_N, _T, _R, _C) \ |
| r1591 | r1592 | |
| 109 | 120 | #define DISCRETE_BITSET(_N, _N1, _B) DISCRETE_TRANSFORM3(_N, 1, _N1, 1 << ((_B)-1), 0, "01&2>") |
| 110 | 121 | #define DISCRETE_ENERGY_NAND(_N, _E, _N1, _N2) DISCRETE_TRANSFORM3(_N, _E, _N1, _N2, 1, "201*-") |
| 111 | 122 | |
| 112 | #define MR_R20 RES_K(22) | |
| 113 | #define MR_R19 RES_K(22) | |
| 114 | 123 | |
| 115 | #define MR_R41 RES_K(100) | |
| 116 | #define MR_R40 RES_K(22) | |
| 117 | ||
| 118 | #define MR_C32 CAP_U(1) | |
| 119 | #define MR_C31 CAP_U(0.022) | |
| 120 | ||
| 121 | 124 | static const discrete_mixer_desc mario_mixer_desc = |
| 122 | 125 | {DISC_MIXER_IS_RESISTOR, |
| 123 | 126 | {MR_R20, MR_R19, MR_R41, MR_R40}, |
| 124 | 127 | {0,0,0,0,0}, // no variable resistors |
| 125 | 128 | {0,0,0,0,0}, // no node capacitors |
| 126 | 0, | |
| 129 | 0, 0 | |
| 127 | 130 | MR_C31, |
| 128 | 131 | MR_C32, |
| 129 | 132 | 0, 1}; |
| r1591 | r1592 | |
| 175 | 178 | DISCRETE_MULTIPLY(DS_OUT_SOUND1, 1, NODE_25, TTL_HIGH) |
| 176 | 179 | |
| 177 | 180 | /************************************************/ |
| 178 | /* SOUND7 */ | |
| 181 | /* SOUND7 */ | |
| 179 | 182 | /************************************************/ |
| 180 | 183 | |
| 181 | 184 | DISCRETE_COUNTER(NODE_100,1,0,NODE_118,0xFFFF,DISC_COUNT_UP,0,DISC_CLK_BY_COUNT) |
| r1591 | r1592 | |
| 217 | 220 | /* Amplifier: internal amplifier |
| 218 | 221 | * Just a 1:n amplifier without filters and no output capacitor |
| 219 | 222 | */ |
| 220 | DISCRETE_OUTPUT(NODE_295, 32767.0/5.0 * 3 ) | |
| 223 | // EZV20 equivalent filter circuit ... | |
| 224 | DISCRETE_CRFILTER(NODE_296,1,NODE_295, RES_K(1), CAP_U(4.7)) | |
| 225 | DISCRETE_OUTPUT(NODE_296, 32767.0/5.0 * 3 ) | |
| 226 | //DISCRETE_WAVELOG1(DS_OUT_DAC, 32767/5.0) | |
| 221 | 227 | |
| 222 | 228 | DISCRETE_SOUND_END |
| 223 | 229 | |
| r1591 | r1592 | |
| 330 | 336 | if (state->last == 1 && data == 0) |
| 331 | 337 | { |
| 332 | 338 | /* setting bit 0 high then low triggers IRQ on the sound CPU */ |
| 333 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 339 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 334 | 340 | } |
| 335 | 341 | |
| 336 | 342 | state->last = data; |
| r1591 | r1592 | |
| 362 | 368 | { |
| 363 | 369 | case 0: /* death */ |
| 364 | 370 | if (data) |
| 365 | cpunum_set_input_line(1,0,ASSERT_LINE); | |
| 371 | cpunum_set_input_line(Machine, 1,0,ASSERT_LINE); | |
| 366 | 372 | else |
| 367 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 373 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 368 | 374 | break; |
| 369 | 375 | case 1: /* get coin */ |
| 370 | 376 | I8035_T_W_AH(0,data & 1); |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | { |
| 82 | 82 | case 2: |
| 83 | 83 | /* Revision 1 sound board */ |
| 84 | cpunum_set_input_line(1,M6502_IRQ_LINE,HOLD_LINE); | |
| 84 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 85 | 85 | break; |
| 86 | 86 | case 3: |
| 87 | 87 | case 4: |
| 88 | 88 | /* Revision 2 & 3 sound board */ |
| 89 | cpunum_set_input_line(cpu_gettotalcpu()-1,M6502_IRQ_LINE,HOLD_LINE); | |
| 90 | cpunum_set_input_line(cpu_gettotalcpu()-2,M6502_IRQ_LINE,HOLD_LINE); | |
| 89 | cpunum_set_input_line(Machine, cpu_gettotalcpu()-1,M6502_IRQ_LINE,HOLD_LINE); | |
| 90 | cpunum_set_input_line(Machine, cpu_gettotalcpu()-2,M6502_IRQ_LINE,HOLD_LINE); | |
| 91 | 91 | break; |
| 92 | 92 | } |
| 93 | 93 | } |
| r1591 | r1592 | |
| 108 | 108 | /* callback for the timer */ |
| 109 | 109 | static TIMER_CALLBACK( gottlieb_nmi_generate ) |
| 110 | 110 | { |
| 111 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 111 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | static const char *const PhonemeTable[0x40] = |
| r1591 | r1592 | |
| 225 | 225 | /* callback for the timer */ |
| 226 | 226 | static TIMER_CALLBACK( nmi_callback ) |
| 227 | 227 | { |
| 228 | cpunum_set_input_line(cpu_gettotalcpu()-1, INPUT_LINE_NMI, PULSE_LINE); | |
| 228 | cpunum_set_input_line(machine, cpu_gettotalcpu()-1, INPUT_LINE_NMI, PULSE_LINE); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | static WRITE8_HANDLER( common_sound_control_w ) |
| r1591 | r1592 | |
| 296 | 296 | |
| 297 | 297 | WRITE8_HANDLER( gottlieb_cause_dac_nmi_w ) |
| 298 | 298 | { |
| 299 | cpunum_set_input_line(cpu_gettotalcpu()-2, INPUT_LINE_NMI, PULSE_LINE); | |
| 299 | cpunum_set_input_line(Machine, cpu_gettotalcpu()-2, INPUT_LINE_NMI, PULSE_LINE); | |
| 300 | 300 | } |
| r1591 | r1592 | |
|---|---|---|
| 758 | 758 | /* rev 3/4: HALT the ADSP-2181 until program is downloaded via IDMA */ |
| 759 | 759 | case 3: |
| 760 | 760 | case 4: |
| 761 | cpunum_set_input_line(dcs.cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 761 | cpunum_set_input_line(Machine, dcs.cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 762 | 762 | dsio.start_on_next_write = 0; |
| 763 | 763 | break; |
| 764 | 764 | } |
| r1591 | r1592 | |
| 815 | 815 | memset(dcs.control_regs, 0, sizeof(dcs.control_regs)); |
| 816 | 816 | |
| 817 | 817 | /* clear all interrupts */ |
| 818 | cpunum_set_input_line(dcs.cpunum, ADSP2105_IRQ0, CLEAR_LINE); | |
| 819 | cpunum_set_input_line(dcs.cpunum, ADSP2105_IRQ1, CLEAR_LINE); | |
| 820 | cpunum_set_input_line(dcs.cpunum, ADSP2105_IRQ2, CLEAR_LINE); | |
| 818 | cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_IRQ0, CLEAR_LINE); | |
| 819 | cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_IRQ1, CLEAR_LINE); | |
| 820 | cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_IRQ2, CLEAR_LINE); | |
| 821 | 821 | |
| 822 | 822 | /* initialize the comm bits */ |
| 823 | 823 | SET_INPUT_EMPTY(); |
| r1591 | r1592 | |
| 1428 | 1428 | if (dsio.start_on_next_write && --dsio.start_on_next_write == 0) |
| 1429 | 1429 | { |
| 1430 | 1430 | logerror("Starting DSIO CPU\n"); |
| 1431 | cpunum_set_input_line(dcs.cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1431 | cpunum_set_input_line(Machine, dcs.cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1432 | 1432 | } |
| 1433 | 1433 | } |
| 1434 | 1434 | |
| r1591 | r1592 | |
| 1482 | 1482 | |
| 1483 | 1483 | /* just run through the init code again */ |
| 1484 | 1484 | timer_call_after_resynch(NULL, 0, dcs_reset); |
| 1485 | cpunum_set_input_line(dcs.cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1485 | cpunum_set_input_line(Machine, dcs.cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1486 | 1486 | } |
| 1487 | 1487 | |
| 1488 | 1488 | /* going low resets and reactivates the CPU */ |
| 1489 | 1489 | else |
| 1490 | cpunum_set_input_line(dcs.cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1490 | cpunum_set_input_line(Machine, dcs.cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1491 | 1491 | } |
| 1492 | 1492 | |
| 1493 | 1493 | |
| r1591 | r1592 | |
| 1520 | 1520 | INPUT LATCH (data from host to DCS) |
| 1521 | 1521 | ****************************************************************************/ |
| 1522 | 1522 | |
| 1523 | static void dcs_delayed_data_w(int data) | |
| 1523 | static void dcs_delayed_data_w(running_machine *machine, int data) | |
| 1524 | 1524 | { |
| 1525 | 1525 | if (LOG_DCS_IO) |
| 1526 | 1526 | logerror("%08X:dcs_data_w(%04X)\n", activecpu_get_pc(), data); |
| r1591 | r1592 | |
| 1529 | 1529 | cpu_boost_interleave(ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5)); |
| 1530 | 1530 | |
| 1531 | 1531 | /* set the IRQ line on the ADSP */ |
| 1532 | cpunum_set_input_line(dcs.cpunum, ADSP2105_IRQ2, ASSERT_LINE); | |
| 1532 | cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_IRQ2, ASSERT_LINE); | |
| 1533 | 1533 | |
| 1534 | 1534 | /* indicate we are no longer empty */ |
| 1535 | 1535 | if (dcs.last_input_empty && dcs.input_empty_cb) |
| r1591 | r1592 | |
| 1543 | 1543 | |
| 1544 | 1544 | static TIMER_CALLBACK( dcs_delayed_data_w_callback ) |
| 1545 | 1545 | { |
| 1546 | dcs_delayed_data_w(param); | |
| 1546 | dcs_delayed_data_w(machine, param); | |
| 1547 | 1547 | } |
| 1548 | 1548 | |
| 1549 | 1549 | |
| r1591 | r1592 | |
| 1557 | 1557 | if (!dcs.sport_timer) |
| 1558 | 1558 | timer_call_after_resynch(NULL, data, dcs_delayed_data_w_callback); |
| 1559 | 1559 | else |
| 1560 | dcs_delayed_data_w(data); | |
| 1560 | dcs_delayed_data_w(Machine, data); | |
| 1561 | 1561 | } |
| 1562 | 1562 | |
| 1563 | 1563 | |
| r1591 | r1592 | |
| 1566 | 1566 | if (!dcs.last_input_empty && dcs.input_empty_cb) |
| 1567 | 1567 | (*dcs.input_empty_cb)(dcs.last_input_empty = 1); |
| 1568 | 1568 | SET_INPUT_EMPTY(); |
| 1569 | cpunum_set_input_line(dcs.cpunum, ADSP2105_IRQ2, CLEAR_LINE); | |
| 1569 | cpunum_set_input_line(Machine, dcs.cpunum, ADSP2105_IRQ2, CLEAR_LINE); | |
| 1570 | 1570 | } |
| 1571 | 1571 | |
| 1572 | 1572 | |
| r1591 | r1592 | |
| 1718 | 1718 | /* set the next timer, but only if it's for a reasonable number */ |
| 1719 | 1719 | if (!dcs.timer_ignore && (dcs.timer_period > 10 || dcs.timer_scale > 1)) |
| 1720 | 1720 | timer_adjust(dcs.internal_timer, ATTOTIME_IN_CYCLES(target_cycles, dcs.cpunum), 0, attotime_zero); |
| 1721 | cpunum_set_input_line(dcs.cpunum, ADSP2105_TIMER, PULSE_LINE); | |
| 1721 | cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_TIMER, PULSE_LINE); | |
| 1722 | 1722 | } |
| 1723 | 1723 | |
| 1724 | 1724 | |
| r1591 | r1592 | |
| 1838 | 1838 | if (data & 0x0200) |
| 1839 | 1839 | { |
| 1840 | 1840 | logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", activecpu_get_pc()); |
| 1841 | cpunum_set_input_line(dcs.cpunum, INPUT_LINE_RESET, PULSE_LINE); | |
| 1841 | cpunum_set_input_line(Machine, dcs.cpunum, INPUT_LINE_RESET, PULSE_LINE); | |
| 1842 | 1842 | dcs_boot(); |
| 1843 | 1843 | dcs.control_regs[SYSCONTROL_REG] = 0; |
| 1844 | 1844 | } |
| r1591 | r1592 | |
| 1932 | 1932 | reg = dcs.ireg_base; |
| 1933 | 1933 | |
| 1934 | 1934 | /* generate the (internal, thats why the pulse) irq */ |
| 1935 | cpunum_set_input_line(dcs.cpunum, ADSP2105_IRQ1, PULSE_LINE); | |
| 1935 | cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_IRQ1, PULSE_LINE); | |
| 1936 | 1936 | } |
| 1937 | 1937 | |
| 1938 | 1938 | /* store it */ |
| r1591 | r1592 | |
| 1947 | 1947 | /* register; if we don't interlock it, we will eventually lose sound (see CarnEvil) */ |
| 1948 | 1948 | /* so we skip the SPORT interrupt if we read with output_control within the last 5 cycles */ |
| 1949 | 1949 | if ((cpunum_gettotalcycles(dcs.cpunum) - dcs.output_control_cycles) > 5) |
| 1950 | cpunum_set_input_line(dcs.cpunum, ADSP2115_SPORT0_RX, PULSE_LINE); | |
| 1950 | cpunum_set_input_line(machine, dcs.cpunum, ADSP2115_SPORT0_RX, PULSE_LINE); | |
| 1951 | 1951 | } |
| 1952 | 1952 | |
| 1953 | 1953 |
| r1591 | r1592 | |
|---|---|---|
| 11 | 11 | #include "machine/6821pia.h" |
| 12 | 12 | #include "sound/hc55516.h" |
| 13 | 13 | #include "sound/5220intf.h" |
| 14 | #include "sound/s14001a.h" | |
| 15 | 14 | #include "sound/custom.h" |
| 16 | #include "berzerk.h" | |
| 17 | 15 | |
| 18 | 16 | |
| 19 | 17 | |
| r1591 | r1592 | |
| 24 | 22 | *************************************/ |
| 25 | 23 | |
| 26 | 24 | #define CRYSTAL_OSC (XTAL_3_579545MHz) |
| 27 | #define SH8253_CLOCK (CRYSTAL_OSC/2) | |
| 28 | #define SH6840_CLOCK (CRYSTAL_OSC/4) | |
| 29 | #define SH6532_CLOCK (CRYSTAL_OSC/4) | |
| 30 | #define CVSD_CLOCK_FREQ (1.0 / (0.693 * (RES_K(2.4) + 2.0 * RES_K(20)) * CAP_P(2200))) | |
| 25 | #define SH8253_CLOCK (CRYSTAL_OSC / 2) | |
| 26 | #define SH6840_CLOCK (CRYSTAL_OSC / 4) | |
| 27 | #define SH6532_CLOCK (CRYSTAL_OSC / 4) | |
| 28 | #define CVSD_CLOCK (1.0 / (0.693 * (RES_K(2.4) + 2.0 * RES_K(20)) * CAP_P(2200))) | |
| 29 | #define CVSD_Z80_CLOCK (CRYSTAL_OSC / 2) | |
| 31 | 30 | #define BASE_VOLUME (32767 / 6) |
| 32 | 31 | |
| 33 | 32 | enum |
| r1591 | r1592 | |
| 101 | 100 | UINT32 fraction; |
| 102 | 101 | }; |
| 103 | 102 | static struct sh8253_timer_channel sh8253_timer[3]; |
| 104 | static | |
| 103 | static int | |
| 105 | 104 | |
| 106 | 105 | /* 5220/CVSD variables */ |
| 107 | static UINT8 has_hc55516; | |
| 108 | static UINT8 has_tms5220; | |
| 106 | static int has_mc3417; | |
| 107 | static int has_tms5220; | |
| 109 | 108 | |
| 110 | 109 | /* sound streaming variables */ |
| 111 | 110 | static sound_stream *exidy_stream; |
| r1591 | r1592 | |
| 115 | 114 | |
| 116 | 115 | /************************************* |
| 117 | 116 | * |
| 117 | * Prototypes | |
| 118 | * | |
| 119 | *************************************/ | |
| 120 | ||
| 121 | static TIMER_CALLBACK( riot_interrupt ); | |
| 122 | ||
| 123 | ||
| 124 | ||
| 125 | /************************************* | |
| 126 | * | |
| 118 | 127 | * Interrupt generation helper |
| 119 | 128 | * |
| 120 | 129 | *************************************/ |
| 121 | 130 | |
| 122 | 131 | static void update_irq_state(/* unused */ int state) |
| 123 | 132 | { |
| 124 | cpunum_set_input_line(1, M6502_IRQ_LINE, (pia_get_irq_b(1) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE); | |
| 133 | cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, (pia_get_irq_b(1) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE); | |
| 125 | 134 | } |
| 126 | 135 | |
| 127 | 136 | |
| r1591 | r1592 | |
| 341 | 350 | |
| 342 | 351 | /************************************* |
| 343 | 352 | * |
| 344 | * | |
| 353 | * A | |
| 345 | 354 | * |
| 346 | 355 | *************************************/ |
| 347 | 356 | |
| 348 | static TIMER_CALLBACK( riot_interrupt ); | |
| 349 | ||
| 350 | static void *common_sh_start(int _has_sh8253, int _has_tms5220) | |
| 357 | void *exidy_sh6840_sh_start(int clock, const struct CustomSound_interface *config) | |
| 351 | 358 | { |
| 352 | 359 | int sample_rate = SH8253_CLOCK; |
| 353 | int i; | |
| 354 | 360 | |
| 355 | has_sh8253 = _has_sh8253; | |
| 356 | has_tms5220 = _has_tms5220; | |
| 361 | sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24)); | |
| 357 | 362 | |
| 358 | /* determine which sound hardware is installed */ | |
| 359 | has_hc55516 = FALSE; | |
| 360 | for (i = 0; i < MAX_SOUND; i++) | |
| 361 | { | |
| 362 | if (Machine->drv->sound[i].type == SOUND_HC55516) | |
| 363 | has_hc55516 = TRUE; | |
| 364 | } | |
| 365 | ||
| 366 | 363 | /* allocate the stream */ |
| 367 | 364 | exidy_stream = stream_create(0, 1, sample_rate, NULL, exidy_stream_update); |
| 368 | 365 | |
| 369 | /* 6532 */ | |
| 370 | riot_timer = timer_alloc(riot_interrupt, NULL); | |
| 366 | /* indicate no additional hardware */ | |
| 367 | has_sh8253 = FALSE; | |
| 368 | has_tms5220 = FALSE; | |
| 369 | has_mc3417 = FALSE; | |
| 371 | 370 | |
| 372 | /* 6840 */ | |
| 373 | sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24)); | |
| 374 | ||
| 375 | /* 8253 */ | |
| 376 | freq_to_step = (double)(1 << 24) / (double)sample_rate; | |
| 377 | ||
| 378 | 371 | return auto_malloc(1); |
| 379 | 372 | } |
| 380 | 373 | |
| r1591 | r1592 | |
| 382 | 375 | |
| 383 | 376 | /************************************* |
| 384 | 377 | * |
| 385 | * | |
| 378 | * A | |
| 386 | 379 | * |
| 387 | 380 | *************************************/ |
| 388 | 381 | |
| 389 | ||
| 382 | ||
| 390 | 383 | { |
| 391 | /* PIA */ | |
| 392 | pia_reset(); | |
| 393 | ||
| 394 | /* LFSR */ | |
| 395 | sh6840_LFSR_oldxor = 0; | |
| 396 | sh6840_LFSR_0 = 0xffffffff; | |
| 397 | sh6840_LFSR_1 = 0xffffffff; | |
| 398 | sh6840_LFSR_2 = 0xffffffff; | |
| 399 | sh6840_LFSR_3 = 0xffffffff; | |
| 400 | ||
| 401 | /* 6532 */ | |
| 402 | riot_irq_flag = 0; | |
| 403 | riot_timer_irq_enable = 0; | |
| 404 | riot_porta_data = 0xff; | |
| 405 | riot_portb_data = 0xff; | |
| 406 | riot_clock_divisor = 1; | |
| 407 | riot_state = RIOT_IDLE; | |
| 408 | ||
| 409 | 384 | /* 6840 */ |
| 410 | 385 | memset(sh6840_timer, 0, sizeof(sh6840_timer)); |
| 411 | 386 | sh6840_MSB = 0; |
| r1591 | r1592 | |
| 414 | 389 | sh6840_volume[2] = 0; |
| 415 | 390 | exidy_sfxctrl = 0; |
| 416 | 391 | |
| 417 | /* 8253 */ | |
| 418 | memset(sh8253_timer, 0, sizeof(sh8253_timer)); | |
| 392 | /* LFSR */ | |
| 393 | sh6840_LFSR_oldxor = 0; | |
| 394 | sh6840_LFSR_0 = 0xffffffff; | |
| 395 | sh6840_LFSR_1 = 0xffffffff; | |
| 396 | sh6840_LFSR_2 = 0xffffffff; | |
| 397 | sh6840_LFSR_3 = 0xffffffff; | |
| 419 | 398 | } |
| 420 | 399 | |
| 421 | 400 | |
| r1591 | r1592 | |
| 465 | 444 | switch (offset & 0x03) |
| 466 | 445 | { |
| 467 | 446 | case 0: /* port A */ |
| 468 | if (has_hc55516) | |
| 469 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 447 | if (has_mc3417) | |
| 448 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 470 | 449 | riot_porta_data = (riot_porta_data & ~riot_porta_ddr) | (data & riot_porta_ddr); |
| 471 | 450 | break; |
| 472 | 451 | |
| r1591 | r1592 | |
| 660 | 639 | } |
| 661 | 640 | |
| 662 | 641 | |
| 663 | ||
| 642 | ||
| 664 | 643 | { |
| 665 | 644 | /* force an update of the stream */ |
| 666 | 645 | stream_update(exidy_stream); |
| r1591 | r1592 | |
| 720 | 699 | * |
| 721 | 700 | *************************************/ |
| 722 | 701 | |
| 723 | ||
| 702 | ||
| 724 | 703 | { |
| 725 | 704 | stream_update(exidy_stream); |
| 726 | 705 | |
| r1591 | r1592 | |
| 775 | 754 | }; |
| 776 | 755 | |
| 777 | 756 | |
| 757 | static void *venture_common_sh_start(int clock, const struct CustomSound_interface *config, int _has_tms5220) | |
| 758 | { | |
| 759 | int i; | |
| 760 | ||
| 761 | void *ret = exidy_sh6840_sh_start(clock, config); | |
| 762 | ||
| 763 | has_sh8253 = TRUE; | |
| 764 | has_tms5220 = _has_tms5220; | |
| 765 | ||
| 766 | /* determine which sound hardware is installed */ | |
| 767 | has_mc3417 = FALSE; | |
| 768 | for (i = 0; i < MAX_SOUND; i++) | |
| 769 | { | |
| 770 | if (Machine->drv->sound[i].type == SOUND_MC3417) | |
| 771 | has_mc3417 = TRUE; | |
| 772 | } | |
| 773 | ||
| 774 | /* 6532 */ | |
| 775 | riot_timer = timer_alloc(riot_interrupt, NULL); | |
| 776 | ||
| 777 | /* 8253 */ | |
| 778 | freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK; | |
| 779 | ||
| 780 | return ret; | |
| 781 | } | |
| 782 | ||
| 783 | ||
| 778 | 784 | static void *venture_sh_start(int clock, const struct CustomSound_interface *config) |
| 779 | 785 | { |
| 780 | 786 | pia_config(0, &venture_pia_0_intf); |
| 781 | 787 | pia_config(1, &venture_pia_1_intf); |
| 782 | 788 | |
| 783 | return common_sh_start( | |
| 789 | return venture_common_sh_start(clock, config, FALSE); | |
| 784 | 790 | } |
| 785 | 791 | |
| 786 | 792 | |
| 787 | 793 | static void venture_sh_reset(void *token) |
| 788 | 794 | { |
| 789 | common_sh_reset(); | |
| 795 | exidy_sh6840_sh_reset(token); | |
| 796 | ||
| 797 | /* PIA */ | |
| 798 | pia_reset(); | |
| 799 | ||
| 800 | /* 6532 */ | |
| 801 | riot_irq_flag = 0; | |
| 802 | riot_timer_irq_enable = 0; | |
| 803 | riot_porta_data = 0xff; | |
| 804 | riot_portb_data = 0xff; | |
| 805 | riot_clock_divisor = 1; | |
| 806 | riot_state = RIOT_IDLE; | |
| 807 | ||
| 808 | /* 8253 */ | |
| 809 | memset(sh8253_timer, 0, sizeof(sh8253_timer)); | |
| 790 | 810 | } |
| 791 | 811 | |
| 792 | 812 | |
| r1591 | r1592 | |
| 834 | 854 | static WRITE8_HANDLER( mtrap_voiceio_w ) |
| 835 | 855 | { |
| 836 | 856 | if (!(offset & 0x10)) |
| 837 | { | |
| 838 | hc55516_digit_clock_clear_w(0,data); | |
| 839 | hc55516_clock_set_w(0,data); | |
| 840 | } | |
| 857 | hc55516_digit_w(0, data & 1); | |
| 841 | 858 | |
| 842 | 859 | if (!(offset & 0x20)) |
| 843 | 860 | riot_portb_data = data & 1; |
| r1591 | r1592 | |
| 856 | 873 | } |
| 857 | 874 | |
| 858 | 875 | if (!(offset & 0x40)) |
| 859 | { | |
| 860 | attotime curtime = timer_get_time(); | |
| 861 | int clock_pulse = curtime.attoseconds / HZ_TO_ATTOSECONDS(2 * CVSD_CLOCK_FREQ); | |
| 876 | return hc55516_clock_state_r(0) << 7; | |
| 862 | 877 | |
| 863 | return (clock_pulse & 1) << 7; | |
| 864 | } | |
| 865 | 878 | return 0; |
| 866 | 879 | } |
| 867 | 880 | |
| r1591 | r1592 | |
| 880 | 893 | |
| 881 | 894 | MACHINE_DRIVER_START( mtrap_cvsd_audio ) |
| 882 | 895 | |
| 883 | MDRV_CPU_ADD(Z80, | |
| 896 | MDRV_CPU_ADD(Z80, CVSD_Z80_CLOCK) | |
| 884 | 897 | MDRV_CPU_PROGRAM_MAP(cvsd_map,0) |
| 885 | 898 | MDRV_CPU_IO_MAP(cvsd_iomap,0) |
| 886 | 899 | |
| 887 | 900 | /* audio hardware */ |
| 888 | MDRV_SOUND_ADD( | |
| 901 | MDRV_SOUND_ADD(MC34 | |
| 889 | 902 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 890 | 903 | MACHINE_DRIVER_END |
| 891 | 904 | |
| r1591 | r1592 | |
| 973 | 986 | |
| 974 | 987 | state_save_register_global(victory_sound_response_ack_clk); |
| 975 | 988 | |
| 976 | return common_sh_start( | |
| 989 | return venture_common_sh_start(clock, config, TRUE); | |
| 977 | 990 | } |
| 978 | 991 | |
| 979 | 992 | |
| 980 | 993 | static void victory_sh_reset(void *token) |
| 981 | 994 | { |
| 982 | | |
| 995 | ve | |
| 983 | 996 | |
| 984 | 997 | /* the flip-flop @ F4 is reset */ |
| 985 | 998 | victory_sound_response_ack_clk = 0; |
| r1591 | r1592 | |
| 1027 | 1040 | MDRV_SOUND_ADD(TMS5220, 640000) |
| 1028 | 1041 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1029 | 1042 | MACHINE_DRIVER_END |
| 1030 | ||
| 1031 | ||
| 1032 | ||
| 1033 | /************************************* | |
| 1034 | * | |
| 1035 | * Berzerk | |
| 1036 | * | |
| 1037 | * Copyright Alex Judd 1997/98 | |
| 1038 | * V1.1 for Mame 0.31 13March98 | |
| 1039 | * | |
| 1040 | *************************************/ | |
| 1041 | ||
| 1042 | #define BERZERK_S14001A_CLOCK (BERZERK_MASTER_CLOCK / 2) | |
| 1043 | ||
| 1044 | ||
| 1045 | static void *berzerk_sh_start(int clock, const struct CustomSound_interface *config) | |
| 1046 | { | |
| 1047 | return common_sh_start(FALSE, FALSE); | |
| 1048 | } | |
| 1049 | ||
| 1050 | ||
| 1051 | static void berzerk_sh_reset(void *token) | |
| 1052 | { | |
| 1053 | common_sh_reset(); | |
| 1054 | } | |
| 1055 | ||
| 1056 | ||
| 1057 | static const struct S14001A_interface berzerk_s14001a_interface = | |
| 1058 | { | |
| 1059 | REGION_SOUND1 /* voice data region */ | |
| 1060 | }; | |
| 1061 | ||
| 1062 | ||
| 1063 | static const struct CustomSound_interface berzerk_custom_interface = | |
| 1064 | { | |
| 1065 | berzerk_sh_start, | |
| 1066 | 0, | |
| 1067 | berzerk_sh_reset, | |
| 1068 | }; | |
| 1069 | ||
| 1070 | ||
| 1071 | MACHINE_DRIVER_START( berzerk_audio ) | |
| 1072 | ||
| 1073 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1074 | ||
| 1075 | MDRV_SOUND_ADD(S14001A, BERZERK_S14001A_CLOCK) /* CPU clock divided by 16 divided by a programmable TTL setup */ | |
| 1076 | MDRV_SOUND_CONFIG(berzerk_s14001a_interface) | |
| 1077 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1078 | ||
| 1079 | MDRV_SOUND_ADD(CUSTOM, 0) | |
| 1080 | MDRV_SOUND_CONFIG(berzerk_custom_interface) | |
| 1081 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1082 | MACHINE_DRIVER_END | |
| 1083 | ||
| 1084 | ||
| 1085 | WRITE8_HANDLER( berzerk_audio_w ) | |
| 1086 | { | |
| 1087 | switch (offset) | |
| 1088 | { | |
| 1089 | /* offsets 0-3, 5 and 7 write to the 6840 */ | |
| 1090 | case 0: | |
| 1091 | case 1: | |
| 1092 | case 2: | |
| 1093 | case 3: | |
| 1094 | case 5: | |
| 1095 | case 7: | |
| 1096 | exidy_sh6840_w(offset, data); | |
| 1097 | break; | |
| 1098 | ||
| 1099 | /* offset 6 writes to the sfxcontrol latch */ | |
| 1100 | case 6: | |
| 1101 | exidy_sfxctrl_w(data >> 6, data); | |
| 1102 | break; | |
| 1103 | ||
| 1104 | /* offset 4 writes to the S14001A */ | |
| 1105 | case 4: | |
| 1106 | if ((data & 0xc0) == 0x40) /* VSU-1000 control write */ | |
| 1107 | { | |
| 1108 | /* volume and frequency control goes here */ | |
| 1109 | /* mame_printf_debug("TODO: VSU-1000 Control write (ignored for now)\n");*/ | |
| 1110 | S14001A_set_volume(((data&0x38)>>3)+1); | |
| 1111 | S14001A_set_rate((16-(data&0x07))*16); /* second LS161 has load triggered by its own TC(when it equals 16) long before the first ls161 will TC and fire again, so effectively it only divides by 15 and not 16. If the clock, as opposed to the E enable, had been tied to the first LS161's TC instead, it would divide by 16 as expected */ | |
| 1112 | } | |
| 1113 | else if ((data & 0xc0) != 0x00) | |
| 1114 | { | |
| 1115 | /* vsu-1000 ignores these writes entirely */ | |
| 1116 | mame_printf_debug("bogus write ignored\n"); | |
| 1117 | } | |
| 1118 | else | |
| 1119 | { | |
| 1120 | /* select word input */ | |
| 1121 | if (S14001A_bsy_0_r()) /* skip if busy... */ | |
| 1122 | { | |
| 1123 | mame_printf_debug("S14001A busy, ignoring write\n"); | |
| 1124 | break; | |
| 1125 | } | |
| 1126 | ||
| 1127 | /* write to the register */ | |
| 1128 | S14001A_reg_0_w(data & 0x3f); | |
| 1129 | S14001A_rst_0_w(1); | |
| 1130 | S14001A_rst_0_w(0); | |
| 1131 | } | |
| 1132 | break; | |
| 1133 | } | |
| 1134 | } | |
| 1135 | ||
| 1136 | ||
| 1137 | READ8_HANDLER( berzerk_audio_r ) | |
| 1138 | { | |
| 1139 | return ((offset == 4) && !S14001A_bsy_0_r()) ? 0x40 : 0x00; | |
| 1140 | } |
| r1591 | r1592 | |
|---|---|---|
| 884 | 884 | { |
| 885 | 885 | schaser_effect_555_timer = timer_alloc(schaser_effect_555_cb, NULL); |
| 886 | 886 | |
| 887 | | |
| 887 | MACHINE_START_CALL(mw8080bw | |
| 888 | 888 | } |
| 889 | 889 | |
| 890 | 890 | |
| r1591 | r1592 | |
| 896 | 896 | schaser_sh_port_2_w(0, 0); |
| 897 | 897 | schaser_effect_555_time_remain = attotime_zero; |
| 898 | 898 | |
| 899 | | |
| 899 | MACHINE_RESET_CALL(mw8080bw | |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 |
| r1591 | r1592 | |
|---|---|---|
| 78 | 78 | WRITE8_HANDLER( gyruss_sh_irqtrigger_w ) |
| 79 | 79 | { |
| 80 | 80 | /* writing to this register triggers IRQ on the sound CPU */ |
| 81 | cpunum_set_input_line_and_vector(2,0,HOLD_LINE,0xff); | |
| 81 | cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | WRITE8_HANDLER( gyruss_i8039_irq_w ) |
| 85 | 85 | { |
| 86 | cpunum_set_input_line(3, 0, PULSE_LINE); | |
| 86 | cpunum_set_input_line(Machine, 3, 0, PULSE_LINE); | |
| 87 | 87 | } |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) |
| 56 | 56 | { |
| 57 | 57 | portA_in = from_main; |
| 58 | if (main_sent) cpunum_set_input_line(3,0,CLEAR_LINE); | |
| 58 | if (main_sent) cpunum_set_input_line(Machine, 3,0,CLEAR_LINE); | |
| 59 | 59 | main_sent = 0; |
| 60 | 60 | |
| 61 | 61 | } |
| r1591 | r1592 | |
| 102 | 102 | |
| 103 | 103 | from_main = data; |
| 104 | 104 | main_sent = 1; |
| 105 | cpunum_set_input_line(3,0,ASSERT_LINE); | |
| 105 | cpunum_set_input_line(Machine, 3,0,ASSERT_LINE); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | READ8_HANDLER( nycaptor_mcu_r ) |
| r1591 | r1592 | |
|---|---|---|
| 319 | 319 | if(LEF) dsp_reg.pc = (data & 0xff); |
| 320 | 320 | if(EXF) dsp_execute_program(); |
| 321 | 321 | if(EF && (!(stv_scu[40] & 0x0020))) |
| 322 | cpunum_set_input_line_and_vector(0, 0xa, HOLD_LINE , 0x45); | |
| 322 | cpunum_set_input_line_and_vector(Machine, 0, 0xa, HOLD_LINE , 0x45); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | void dsp_prg_data(UINT32 data) |
| r1591 | r1592 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | if( battles_customio_command & 0x10 ){ |
| 49 | 49 | if( battles_customio_command_count == 0 ){ |
| 50 | cpunum_set_input_line(3, INPUT_LINE_NMI, PULSE_LINE); | |
| 50 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, PULSE_LINE); | |
| 51 | 51 | }else{ |
| 52 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 53 | cpunum_set_input_line(3, INPUT_LINE_NMI, PULSE_LINE); | |
| 52 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 53 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, PULSE_LINE); | |
| 54 | 54 | } |
| 55 | 55 | }else{ |
| 56 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 57 | cpunum_set_input_line(3, INPUT_LINE_NMI, PULSE_LINE); | |
| 56 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 57 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | 58 | } |
| 59 | 59 | battles_customio_command_count++; |
| 60 | 60 | } |
| r1591 | r1592 | |
| 180 | 180 | |
| 181 | 181 | INTERRUPT_GEN( battles_interrupt_4 ) |
| 182 | 182 | { |
| 183 | cpunum_set_input_line(3, 0, HOLD_LINE); | |
| 183 | cpunum_set_input_line(machine, 3, 0, HOLD_LINE); | |
| 184 | 184 | } |
| 185 | 185 |
| r1591 | r1592 | |
|---|---|---|
| 300 | 300 | |
| 301 | 301 | |
| 302 | 302 | const UINT8 gussun_decryption_table[256] = { |
| 303 | 0xcd,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0xa8,xxxx,xxxx, /* 00 */ | |
| 304 | // !!!! ^^^^ !!!! !!!! | |
| 305 | xxxx,xxxx,0x75,0x24,0x01,0x83,0x32,0xe9, xxxx,0x78,xxxx,0x19,0x22,xxxx,0xac,xxxx, /* 10 */ | |
| 306 | // !!!! ???? ^^^^ ???? ???? !!!! ^^^^ | |
| 307 | 0x5d,0xa5,0x10,0x51,0x0a,xxxx,0x19,xxxx ,0xf8,0x90,0x91,0x40,0x28,0x22,0x03,0x5f, /* 20 */ | |
| 308 | // ???? !!!! ???? ^^^^ ???? ^^^^ gggg gggg ???? | |
| 303 | 0xcd,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0x20,xxxx,xxxx, /* 00 */ | |
| 304 | // !!!! ^^^^ !!!! !!!! | |
| 305 | xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x79,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */ | |
| 306 | // !!!! ???? ^^^^ pppp gggg !!!! ^^^^ | |
| 307 | 0x5d,0xa5,0x11,0x51,0x0a,xxxx,0x19,xxxx ,0xf8,0x98,0x91,0x40,0x28,0x10,0x03,0x5f, /* 20 */ | |
| 308 | // pppp !!!! ???? ^^^^ pppp ^^^^ gggg gggg pppp | |
| 309 | 309 | 0x26,xxxx,xxxx,0x8b,xxxx,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0xf1,0xb3,xxxx, /* 30 */ |
| 310 | 310 | // |
| 311 | xxxx,0x19,0xc6,xxxx,xxxx,0x3a,0x10,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,0x19,xxxx, /* 40 */ | |
| 312 | // ???? ???? !!!! ???? | |
| 313 | xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x7f,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */ | |
| 314 | // !!!! ^^^^ ^^^^ gggg ???? !!!! !!!! | |
| 315 | 0xb0,xxxx,0x28,0x7e,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */ | |
| 316 | // ???? gggg !!!! ^^^^ | |
| 311 | xxxx,0x01,0xc6,xxxx,xxxx,0x3a,0x29,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,0x29,xxxx, /* 40 */ | |
| 312 | // ???? ???? !!!! ???? | |
| 313 | xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x76,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */ | |
| 314 | // !!!! ^^^^ ^^^^ gggg ???? !!!! !!!! | |
| 315 | 0xb0,xxxx,0x28,0x7d,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */ | |
| 316 | // ???? gggg !!!! ^^^^ | |
| 317 | 317 | xxxx,0xea,0x72,0x73,0xad,0xd1,0x3b,0x5e, 0xe5,0x57,xxxx,0x0d,xxxx,xxxx,xxxx,0x3c, /* 70 */ |
| 318 | // ^^^^ | |
| 319 | xxxx,0x86,xxxx,0xb7,0x30,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */ | |
| 320 | // ???? ???? ^^^^ !!!! !!!! | |
| 321 | xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,0x19, /* 90 */ | |
| 322 | // ^^^^ ^^^^ !!!! ^^^^ !!!! ???? | |
| 323 | xxxx,0xa3,xxxx,xxxx,xxxx,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,0x42,0x80,0x8c,0xd4,xxxx, /* a0 */ | |
| 324 | // gggg ???? gggg !!!! | |
| 325 | xxxx,0x11,0x11,0x11,0x77,0x3d,0x3e,xxxx, xxxx,xxxx,0x4b,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */ | |
| 326 | // ???? ???? ???? gggg ???? | |
| 327 | xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x11,0xb2, /* c0 */ | |
| 328 | // ^^^^ ^^^^ ^^^^ ???? | |
| 318 | // ^^^^ | |
| 319 | xxxx,0x86,xxxx,0xb5,0x30,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */ | |
| 320 | // ???? ???? ^^^^ !!!! !!!! | |
| 321 | xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,0x01, /* 90 */ | |
| 322 | // !!!! ^^^^ !!!! ^^^^ !!!! ???? | |
| 323 | xxxx,0xa3,xxxx,xxxx,xxxx,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,0x41,0x80,0x8c,0xd4,xxxx, /* a0 */ | |
| 324 | // gggg ???? gggg !!!! | |
| 325 | xxxx,0x19,0x20,0x19,0x77,0x3d,0x3e,xxxx, xxxx,xxxx,0x4b,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */ | |
| 326 | // ???? ???? ???? gggg pppp | |
| 327 | xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x01,0xb2, /* c0 */ | |
| 328 | // ^^^^ ^^^^ ^^^^ ???? | |
| 329 | 329 | xxxx,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,xxxx,xxxx,0x1f,0x23,xxxx, /* d0 */ |
| 330 | // | |
| 330 | // | |
| 331 | 331 | 0xe8,xxxx,0x89,0xa1,0xd0,xxxx,0x19,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */ |
| 332 | // ???? ^^^^ !!!! | |
| 333 | 0xfb,xxxx,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x70,0xf7,0xbd,0x39,0x7f,0xbf,xxxx, /* f0 */ | |
| 334 | // !!!! ???? !!!! gggg | |
| 332 | // ???? !!!! !!!! | |
| 333 | 0xfb,xxxx,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x7c,0xf7,0xbd,0x39,0x7f,0xbf,xxxx, /* f0 */ | |
| 334 | // !!!! ???? !!!! gggg | |
| 335 | 335 | }; |
| 336 | 336 | |
| 337 | 337 | |
| 338 | 338 | /* |
| 339 | 339 | missing opcode: |
| 340 | ||
| 341 | 1**14 -> 09? (2097b - 20980 (01 09 11 31 | |
| 342 | +++19 -> 79? (2282f - routine from 2281f to 22871) (78, 79, 7a, 7b) | |
| 343 | 0++1b -> 19? (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (09,11,21,29,31 - 01,19) | |
| 344 | 01+22 -> 00? (1deff - routine from 1dee8 to 1df26) no 08,18,20,30 - ok 00,10 | |
| 345 | 0++26 -> 29? (14ed_ , 198e_ | |
| 346 | 01*29 -> 48? (1df22 - routine from 1df1d to | |
| 347 | 01+2d -> 1a? (1df1d - routine from 1dee8 to 1df26) (00,01,10,11,12,13,20,21,28,29,30,31 - 08,09,18,19 | |
| 348 | ---41 -> 19? | |
| 349 | ///46 -> 10? (1461b | |
| 350 | ---4e -> 19? (208ac - | |
| 351 | 1//5a -> 76? (222fc - routine from 222ed to ) (7x j...) 70 76 78 7a 7c | |
| 340 | N**14 -> 08? (2097b 20980 - routine from 2097a) (00 01 08 09 30 31) probably 08 - after the start and before the menu | |
| 341 | - to handle the player number | |
| 342 | N++26 -> 29? (14ed_ , 198e_ | |
| 343 | N--41 -> 19? | |
| 344 | N//46 -> 10? (1461b | |
| 345 | N--4e -> 19? (208ac - | |
| 346 | Y//5a -> 76? (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,71,77,79,7a,7b,7d,7f - ok 76 78 7c 7e | |
| 352 | 347 | 1//62 -> 28? (1cf86 1cfa3 - routine from 1cf61 to 1cff4) (water in level 1) |
| 353 | 1--83 -> b7? (194cd - routine from | |
| 354 | 0**84 -> 18? (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,10,18,20,28,30) | |
| 348 | 1--83 -> b7? (194cd - routine from) no b7,b3,b4 ok b6,b5 | |
| 349 | 0**84 -> 18? (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,18,20,28,30) | |
| 355 | 350 | ---9f -> 19? ( |
| 356 | 351 | ///ab -> 42? |
| 357 | 352 | ---b1 -> 19? |
| 358 | ---b2 -> | |
| 353 | ---b2 -> 20. (20a8b - 20acc probably 20 - after the start and before the menu - to handle the player number | |
| 359 | 354 | ///b3 -> 19? (216b6 - 216cf |
| 360 | ///ba -> 4b? (1094d, 10b28 - routine from 10948 to 10b73) one byte (4b | |
| 361 | 01+ce -> 11? (10236 - routine from 1017e to 10254) (01, 09, 11, 19, 21, 29, 31) | |
| 355 | 01+ce -> 01? (10236 - routine from 1017e to 10254) (01, 09, 19, 21, 29, 31) -> probably 01 | |
| 362 | 356 | ///db -> (16992 |
| 363 | ///f9 -> 71? (16598 - 165a1 - 18de7 - routine from 18dc4 to ) 70,71 | |
| 357 | ///eb -> | |
| 358 | ///f9 -> 7c? (16598 - 165a1 - 18de7 - routine from 18dc4 to ) no 71,72,76,78 ok 70,73,77,79,7a | |
| 364 | 359 | |
| 360 | rz probably: | |
| 361 | 19 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) ok 79,7d,7f -> 79 | |
| 362 | 22 -> 11 (1deff - routine from 1dee8 to 1df26) -> 11 - to handle sprite animation | |
| 363 | 2d -> 10 (1df1d - routine from 1dee8 to 1df26) -> 10 - to handle sprite animation | |
| 364 | 29 -> 98 (1df22 - routine from 1dee8 to 1df26) -> 98 - to handle sprite animation | |
| 365 | ba -> 4b (1094d, 10b28 - routine from 10948 to 10b73) one byte -> probably 4b | |
| 365 | 366 | |
| 366 | 367 | rz guess: |
| 367 | 368 | 2b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) (ok 40,48,96) -> 40 |
| r1591 | r1592 | |
| 369 | 370 | 2c -> 28 (20333 - routine from 2032a to 20366) |
| 370 | 371 | 59 -> 2c (220cf - 2037f - routine from 2202f to ) 2bytes (2c, |
| 371 | 372 | 63 -> 7d (1df7f, 1df8c, 1df95,21f08 - routine from 1df1d to ) - two bytes j.. |
| 373 | 1b -> 8f (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (pop instruction for the push in 1d8e6) | |
| 372 | 374 | a7 -> b4 (2029a - routine from 20290 to |
| 373 | 375 | ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc) |
| 374 | 376 | b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) 7f,7d,7b - 79 - "77" |
| r1591 | r1592 | |
| 779 | 781 | for (A = 0;A < size; A++) |
| 780 | 782 | irem_cpu_decrypted[A] = decryption_table[rom[A]]; |
| 781 | 783 | |
| 782 | // RZ note: | |
| 783 | // for "gussun" and "riskchal" an hack to not decrypt a not encrypted routine | |
| 784 | // Roberto Zandon? note: | |
| 785 | // for "gussun" and "riskchal" is necessary an hack to not decrypt not encrypted routines | |
| 784 | 786 | // we need a real nec v25+/35+ core to support 0x63 (brkn for "break native") instruction |
| 785 | // for now we use "cd" (int) instruction + hack | |
| 787 | // for now we use "cd" (int) instruction + hack | |
| 786 | 788 | |
| 787 | if (m90_game_kludge==1) // for gussun and riskchal | |
| 788 | for (A = 0xa8fd;A < 0xa90c; A++) | |
| 789 | irem_cpu_decrypted[A] = rom[A]; | |
| 789 | if (m90_game_kludge==1) // for riskchal | |
| 790 | { | |
| 791 | for (A = 0xa8fd;A < 0xa90c; A++) | |
| 792 | irem_cpu_decrypted[A] = rom[A]; | |
| 793 | for (A = 0x12b3a;A < 0x12b4b; A++) | |
| 794 | irem_cpu_decrypted[A] = rom[A]; | |
| 795 | for (A = 0x13500;A < 0x13510; A++) | |
| 796 | irem_cpu_decrypted[A] = rom[A]; | |
| 797 | for (A = 0x14be5;A < 0x14bf5; A++) | |
| 798 | irem_cpu_decrypted[A] = rom[A]; | |
| 799 | for (A = 0x130de;A < 0x130eb; A++) | |
| 800 | irem_cpu_decrypted[A] = rom[A]; | |
| 801 | for (A = 0x147a4;A < 0x147bf; A++) | |
| 802 | irem_cpu_decrypted[A] = rom[A]; | |
| 790 | 803 | |
| 804 | } | |
| 805 | if (m90_game_kludge==2) // for gussun | |
| 806 | { | |
| 807 | for (A = 0xa8fd;A < 0xa90c; A++) | |
| 808 | irem_cpu_decrypted[A] = rom[A]; | |
| 809 | for (A = 0x1369c;A < 0x136ac; A++) | |
| 810 | irem_cpu_decrypted[A] = rom[A]; | |
| 811 | for (A = 0x14ec8;A < 0x14ed8; A++) | |
| 812 | irem_cpu_decrypted[A] = rom[A]; | |
| 813 | for (A = 0x13246;A < 0x13253; A++) | |
| 814 | irem_cpu_decrypted[A] = rom[A]; | |
| 815 | for (A = 0x14a7d;A < 0x14a98; A++) | |
| 816 | irem_cpu_decrypted[A] = rom[A]; | |
| 817 | } | |
| 818 | ||
| 791 | 819 | /* |
| 792 | 820 | for (A=0; A<256; A++) { |
| 793 | 821 | t[A]=0; |
| r1591 | r1592 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | NVRAM_HANDLER( cd32 ) |
| 202 | 202 | { |
| 203 | | |
| 203 | NVRAM_HANDLER_CALL(i2cmem_0 | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /************************************* |
| r1591 | r1592 | |
|---|---|---|
| 84 | 84 | stactics_vert_pos++; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 87 | cpunum_set_input_line(machine, 0,0,HOLD_LINE); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | WRITE8_HANDLER( stactics_coin_lockout_w ) |
| r1591 | r1592 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | WRITE8_HANDLER( pc10_GAMERES_w ) |
| 103 | 103 | { |
| 104 | cpunum_set_input_line(1, INPUT_LINE_RESET, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 104 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | WRITE8_HANDLER( pc10_GAMESTOP_w ) |
| 108 | 108 | { |
| 109 | cpunum_set_input_line(1, INPUT_LINE_HALT, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 109 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | WRITE8_HANDLER( pc10_PPURES_w ) |
| r1591 | r1592 | |
| 292 | 292 | DRIVER_INIT( pc_gun ) |
| 293 | 293 | { |
| 294 | 294 | /* common init */ |
| 295 | | |
| 295 | DRIVER_INIT_CALL(playch10 | |
| 296 | 296 | |
| 297 | 297 | /* set the control type */ |
| 298 | 298 | pc10_gun_controller = 1; |
| r1591 | r1592 | |
| 304 | 304 | DRIVER_INIT( pc_hrz ) |
| 305 | 305 | { |
| 306 | 306 | /* common init */ |
| 307 | | |
| 307 | DRIVER_INIT_CALL(playch10 | |
| 308 | 308 | |
| 309 | 309 | /* setup mirroring */ |
| 310 | 310 | mirroring = PPU_MIRROR_HORZ; |
| r1591 | r1592 | |
| 438 | 438 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, aboard_vrom_switch_w ); |
| 439 | 439 | |
| 440 | 440 | /* common init */ |
| 441 | | |
| 441 | DRIVER_INIT_CALL(playch10 | |
| 442 | 442 | |
| 443 | 443 | /* set the mirroring here */ |
| 444 | 444 | mirroring = PPU_MIRROR_VERT; |
| r1591 | r1592 | |
| 465 | 465 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, bboard_rom_switch_w ); |
| 466 | 466 | |
| 467 | 467 | /* common init */ |
| 468 | | |
| 468 | DRIVER_INIT_CALL(playch10 | |
| 469 | 469 | |
| 470 | 470 | /* set the mirroring here */ |
| 471 | 471 | mirroring = PPU_MIRROR_VERT; |
| r1591 | r1592 | |
| 486 | 486 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, cboard_vrom_switch_w ); |
| 487 | 487 | |
| 488 | 488 | /* common init */ |
| 489 | | |
| 489 | DRIVER_INIT_CALL(playch10 | |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | /**********************************************************************************/ |
| r1591 | r1592 | |
| 505 | 505 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); |
| 506 | 506 | |
| 507 | 507 | /* common init */ |
| 508 | | |
| 508 | DRIVER_INIT_CALL(playch10 | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | /* D Board games with extra ram (Metroid) */ |
| r1591 | r1592 | |
| 513 | 513 | DRIVER_INIT( pcdboard_2 ) |
| 514 | 514 | { |
| 515 | 515 | /* extra ram at $6000-$7fff */ |
| 516 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 517 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 516 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 517 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 518 | 518 | |
| 519 | 519 | /* common init */ |
| 520 | | |
| 520 | DRIVER_INIT_CALL(pcdboard | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | /**********************************************************************************/ |
| r1591 | r1592 | |
| 605 | 605 | ppu_latch = mapper9_latch; |
| 606 | 606 | |
| 607 | 607 | /* nvram at $6000-$6fff */ |
| 608 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_RAM ); | |
| 609 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MWA8_RAM ); | |
| 608 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 609 | memory_set_bankptr(1, auto_malloc(0x1000)); | |
| 610 | 610 | |
| 611 | 611 | /* common init */ |
| 612 | | |
| 612 | DRIVER_INIT_CALL(playch10 | |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | /**********************************************************************************/ |
| r1591 | r1592 | |
| 628 | 628 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); |
| 629 | 629 | |
| 630 | 630 | /* common init */ |
| 631 | | |
| 631 | DRIVER_INIT_CALL(playch10 | |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | /* F Board games with extra ram (Baseball Stars) */ |
| r1591 | r1592 | |
| 636 | 636 | DRIVER_INIT( pcfboard_2 ) |
| 637 | 637 | { |
| 638 | 638 | /* extra ram at $6000-$6fff */ |
| 639 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_RAM ); | |
| 640 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MWA8_RAM ); | |
| 639 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 640 | memory_set_bankptr(1, auto_malloc(0x1000)); | |
| 641 | 641 | |
| 642 | 642 | /* common init */ |
| 643 | | |
| 643 | DRIVER_INIT_CALL(pcfboard | |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | /**********************************************************************************/ |
| r1591 | r1592 | |
| 659 | 659 | if ( --gboard_scanline_counter == -1 ) |
| 660 | 660 | { |
| 661 | 661 | gboard_scanline_counter = gboard_scanline_latch; |
| 662 | cpunum_set_input_line( 1, 0, PULSE_LINE ); | |
| 662 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE ); | |
| 663 | 663 | } |
| 664 | 664 | } |
| 665 | 665 | } |
| r1591 | r1592 | |
| 805 | 805 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w ); |
| 806 | 806 | |
| 807 | 807 | /* extra ram at $6000-$7fff */ |
| 808 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 809 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 808 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 809 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 810 | 810 | |
| 811 | 811 | gboard_banks[0] = 0x1e; |
| 812 | 812 | gboard_banks[1] = 0x1f; |
| r1591 | r1592 | |
| 815 | 815 | gboard_4screen = 0; |
| 816 | 816 | |
| 817 | 817 | /* common init */ |
| 818 | | |
| 818 | DRIVER_INIT_CALL(playch10 | |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | DRIVER_INIT( pcgboard_type2 ) |
| 822 | 822 | { |
| 823 | 823 | /* common init */ |
| 824 | | |
| 824 | DRIVER_INIT_CALL(pcgboard | |
| 825 | 825 | |
| 826 | 826 | /* enable 4 screen mirror */ |
| 827 | 827 | gboard_4screen = 1; |
| r1591 | r1592 | |
| 853 | 853 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, iboard_rom_switch_w ); |
| 854 | 854 | |
| 855 | 855 | /* common init */ |
| 856 | | |
| 856 | DRIVER_INIT_CALL(playch10 | |
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | /**********************************************************************************/ |
| r1591 | r1592 | |
| 869 | 869 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w ); |
| 870 | 870 | |
| 871 | 871 | /* extra ram at $6000-$7fff */ |
| 872 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 873 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 872 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 873 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 874 | 874 | |
| 875 | 875 | gboard_banks[0] = 0x1e; |
| 876 | 876 | gboard_banks[1] = 0x1f; |
| r1591 | r1592 | |
| 878 | 878 | gboard_scanline_latch = 0; |
| 879 | 879 | |
| 880 | 880 | /* common init */ |
| 881 | | |
| 881 | DRIVER_INIT_CALL(playch10 | |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | 884 | /**********************************************************************************/ |
| r1591 | r1592 | |
| 894 | 894 | mmc1_rom_mask = 0x0f; |
| 895 | 895 | |
| 896 | 896 | /* extra ram at $6000-$7fff */ |
| 897 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 898 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 897 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 898 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 899 | 899 | |
| 900 | 900 | /* Roms are banked at $8000 to $bfff */ |
| 901 | 901 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); |
| 902 | 902 | |
| 903 | 903 | /* common init */ |
| 904 | | |
| 904 | DRIVER_INIT_CALL(playch10 | |
| 905 | 905 | } |
| r1591 | r1592 | |
|---|---|---|
| 26 | 26 | /* bit 3 n.c. */ |
| 27 | 27 | |
| 28 | 28 | /* bit 4 resets second Z80 */ |
| 29 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 29 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 30 | 30 | |
| 31 | 31 | /* bit 5 resets mcu */ |
| 32 | 32 | if (Machine->drv->cpu[3].type != CPU_DUMMY) // only if we have a MCU |
| 33 | cpunum_set_input_line(3, INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 33 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 34 | 34 | |
| 35 | 35 | /* bit 6 enables display */ |
| 36 | 36 | bublbobl_video_enable = data & 0x40; |
| r1591 | r1592 | |
| 59 | 59 | |
| 60 | 60 | WRITE8_HANDLER( bublbobl_nmitrigger_w ) |
| 61 | 61 | { |
| 62 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 62 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| r1591 | r1592 | |
| 98 | 98 | |
| 99 | 99 | static TIMER_CALLBACK( nmi_callback ) |
| 100 | 100 | { |
| 101 | if (sound_nmi_enable) cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 101 | if (sound_nmi_enable) cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 102 | 102 | else pending_nmi = 1; |
| 103 | 103 | } |
| 104 | 104 | |
| r1591 | r1592 | |
| 118 | 118 | sound_nmi_enable = 1; |
| 119 | 119 | if (pending_nmi) |
| 120 | 120 | { |
| 121 | cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 121 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 122 | 122 | pending_nmi = 0; |
| 123 | 123 | } |
| 124 | 124 | } |
| r1591 | r1592 | |
| 199 | 199 | { |
| 200 | 200 | // logerror("triggering IRQ on main CPU\n"); |
| 201 | 201 | cpunum_set_input_line_vector(0,0,bublbobl_mcu_sharedram[0]); |
| 202 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 202 | cpunum_set_input_line(Machine, 0,0,HOLD_LINE); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | // bit 7: select read or write shared RAM |
| r1591 | r1592 | |
| 370 | 370 | { |
| 371 | 371 | /* I don't know how to handle the interrupt line so I just toggle it every time. */ |
| 372 | 372 | if (cpu_getiloops() & 1) |
| 373 | cpunum_set_input_line(3,0,CLEAR_LINE); | |
| 373 | cpunum_set_input_line(machine, 3,0,CLEAR_LINE); | |
| 374 | 374 | else |
| 375 | cpunum_set_input_line(3,0,ASSERT_LINE); | |
| 375 | cpunum_set_input_line(machine, 3,0,ASSERT_LINE); | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| r1591 | r1592 | |
| 477 | 477 | bublbobl_mcu_sharedram[0x7c] = mame_rand(Machine)%6; |
| 478 | 478 | |
| 479 | 479 | cpunum_set_input_line_vector(0,0,bublbobl_mcu_sharedram[0]); |
| 480 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 480 | cpunum_set_input_line(Machine, 0,0,HOLD_LINE); | |
| 481 | 481 | } |
| 482 | 482 | if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40)) |
| 483 | 483 | { |
| r1591 | r1592 | |
|---|---|---|
| 32 | 32 | static void galaxian_7474_9M_1_callback(void) |
| 33 | 33 | { |
| 34 | 34 | /* Q goes to the NMI line */ |
| 35 | cpunum_set_input_line(0, irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE); | |
| 35 | cpunum_set_input_line(Machine, 0, irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | static const struct TTL7474_interface galaxian_7474_9M_2_intf = |
| r1591 | r1592 | |
| 406 | 406 | for (i = 0;i < memory_region_length(REGION_CPU1);i++) |
| 407 | 407 | rom[i] = decode_mooncrst(rom[i],i); |
| 408 | 408 | |
| 409 | | |
| 409 | DRIVER_INIT_CALL(mooncrsu | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | DRIVER_INIT( mooncrgx ) |
| r1591 | r1592 | |
| 493 | 493 | |
| 494 | 494 | DRIVER_INIT( gteikob2 ) |
| 495 | 495 | { |
| 496 | | |
| 496 | DRIVER_INIT_CALL(pisces | |
| 497 | 497 | |
| 498 | 498 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7006, 0x7006, 0, 0, gteikob2_flip_screen_x_w); |
| 499 | 499 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7007, 0x7007, 0, 0, gteikob2_flip_screen_y_w); |
| r1591 | r1592 | |
| 501 | 501 | |
| 502 | 502 | DRIVER_INIT( azurian ) |
| 503 | 503 | { |
| 504 | | |
| 504 | DRIVER_INIT_CALL(pisces | |
| 505 | 505 | |
| 506 | 506 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6800, 0x6800, 0, 0, azurian_IN1_r); |
| 507 | 507 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0, azurian_IN2_r); |
| r1591 | r1592 | |
| 526 | 526 | |
| 527 | 527 | INTERRUPT_GEN( hunchbks_vh_interrupt ) |
| 528 | 528 | { |
| 529 | cpunum_set_input_line_and_vector(0,0,PULSE_LINE,0x03); | |
| 529 | cpunum_set_input_line_and_vector(machine, 0,0,PULSE_LINE,0x03); | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | DRIVER_INIT( ladybugg ) |
| r1591 | r1592 | |
| 558 | 558 | /* Ghost Muncher never clears this */ |
| 559 | 559 | galaxian_stars_enable_w(0, 0); |
| 560 | 560 | |
| 561 | cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 561 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 562 | 562 | } |
| 563 | 563 | } |
| r1591 | r1592 | |
|---|---|---|
| 143 | 143 | { |
| 144 | 144 | /* rom-based means reset and clear states */ |
| 145 | 145 | if (asic65_type == ASIC65_ROMBASED) |
| 146 | cpunum_set_input_line(asic65_cpunum, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 146 | cpunum_set_input_line(Machine, asic65_cpunum, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); | |
| 147 | 147 | |
| 148 | 148 | /* otherwise, do it manually */ |
| 149 | 149 | else |
| r1591 | r1592 | |
| 179 | 179 | asic65_tfull = 1; |
| 180 | 180 | asic65_cmd = param >> 16; |
| 181 | 181 | asic65_tdata = param; |
| 182 | cpunum_set_input_line(asic65_cpunum, 0, ASSERT_LINE); | |
| 182 | cpunum_set_input_line(machine, asic65_cpunum, 0, ASSERT_LINE); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r1591 | r1592 | |
| 480 | 480 | static READ16_HANDLER( asic65_68k_r ) |
| 481 | 481 | { |
| 482 | 482 | asic65_tfull = 0; |
| 483 | cpunum_set_input_line(asic65_cpunum, 0, CLEAR_LINE); | |
| 483 | cpunum_set_input_line(Machine, asic65_cpunum, 0, CLEAR_LINE); | |
| 484 | 484 | return asic65_tdata; |
| 485 | 485 | } |
| 486 | 486 |
| r1591 | r1592 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | if (offset == 8) |
| 58 | 58 | /* awake the master CPU */ |
| 59 | cpu_trigger(500); | |
| 59 | cpu_trigger(Machine, 500); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| r1591 | r1592 | |
| 78 | 78 | |
| 79 | 79 | WRITE8_HANDLER( docastle_nmitrigger_w ) |
| 80 | 80 | { |
| 81 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 81 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 82 | 82 | } |
| r1591 | r1592 | |
|---|---|---|
| 670 | 670 | break; |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 673 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | MACHINE_RESET( tnzs ) |
| r1591 | r1592 | |
| 721 | 721 | |
| 722 | 722 | /* bit 4 resets the second CPU */ |
| 723 | 723 | if (data & 0x10) |
| 724 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 724 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 725 | 725 | else |
| 726 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 726 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 727 | 727 | |
| 728 | 728 | /* bits 0-2 select RAM/ROM bank */ |
| 729 | 729 | memory_set_bankptr (1, &RAM[0x10000 + 0x4000 * (data & 0x07)]); |
| r1591 | r1592 | |
| 743 | 743 | if (data & 0x04) |
| 744 | 744 | { |
| 745 | 745 | if (Machine->drv->cpu[2].type == CPU_I8X41) |
| 746 | cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE); | |
| 746 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE); | |
| 747 | 747 | } |
| 748 | 748 | /* Coin count and lockout is handled by the i8742 */ |
| 749 | 749 | break; |
| r1591 | r1592 | |
|---|---|---|
| 68 | 68 | logerror("atari interrupt_cb TIMR1\n"); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 71 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /************************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 295 | 295 | |
| 296 | 296 | case SOUND_CVSD: |
| 297 | 297 | williams_cvsd_init(0); |
| 298 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, MWA8_RAM); | |
| 298 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, MRA8_BANK9, MWA8_BANK9); | |
| 299 | memory_set_bankptr(9, auto_malloc(0x80)); | |
| 299 | 300 | break; |
| 300 | 301 | |
| 301 | 302 | case SOUND_ADPCM: |
| 302 | 303 | williams_adpcm_init(); |
| 303 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, MWA8_RAM); | |
| 304 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, MRA8_BANK9, MWA8_BANK9); | |
| 305 | memory_set_bankptr(9, auto_malloc(0x80)); | |
| 304 | 306 | break; |
| 305 | 307 | |
| 306 | 308 | case SOUND_NARC: |
| 307 | 309 | williams_narc_init(); |
| 308 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, MWA8_RAM); | |
| 310 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, prot_start, prot_end, 0, 0, MRA8_BANK9, MWA8_BANK9); | |
| 311 | memory_set_bankptr(9, auto_malloc(0x80)); | |
| 309 | 312 | break; |
| 310 | 313 | |
| 311 | 314 | case SOUND_YAWDIM: |
| r1591 | r1592 | |
| 576 | 579 | |
| 577 | 580 | case SOUND_YAWDIM: |
| 578 | 581 | soundlatch_w(0, data); |
| 579 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 582 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 580 | 583 | break; |
| 581 | 584 | } |
| 582 | 585 | } |
| r1591 | r1592 | |
|---|---|---|
| 70 | 70 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) |
| 71 | 71 | { |
| 72 | 72 | portA_in = from_main; |
| 73 | if (main_sent) cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 73 | if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 74 | 74 | main_sent = 0; |
| 75 | 75 | logerror("read command %02x from main cpu\n",portA_in); |
| 76 | 76 | } |
| r1591 | r1592 | |
| 117 | 117 | logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); |
| 118 | 118 | from_main = data; |
| 119 | 119 | main_sent = 1; |
| 120 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 120 | cpunum_set_input_line(Machine, 2,0,ASSERT_LINE); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | READ8_HANDLER( flstory_mcu_r ) |
| r1591 | r1592 | |
|---|---|---|
| 34 | 34 | getstar_sh_intenabled = 0; /* disable sound cpu interrupts */ |
| 35 | 35 | |
| 36 | 36 | /* SOUND CPU */ |
| 37 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 37 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 38 | 38 | |
| 39 | 39 | /* MCU */ |
| 40 | 40 | mcu_val = 0; |
| r1591 | r1592 | |
| 63 | 63 | /* Reset and hold sound CPU */ |
| 64 | 64 | WRITE8_HANDLER( slapfight_port_00_w ) |
| 65 | 65 | { |
| 66 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 66 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 67 | 67 | getstar_sh_intenabled = 0; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /* Release reset on sound CPU */ |
| 71 | 71 | WRITE8_HANDLER( slapfight_port_01_w ) |
| 72 | 72 | { |
| 73 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 73 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /* Disable and clear hardware interrupt */ |
| r1591 | r1592 | |
| 144 | 144 | INTERRUPT_GEN( getstar_interrupt ) |
| 145 | 145 | { |
| 146 | 146 | if (getstar_sh_intenabled) |
| 147 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 147 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | #ifdef UNUSED_FUNCTION |
| r1591 | r1592 | |
| 191 | 191 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) |
| 192 | 192 | { |
| 193 | 193 | portA_in = from_main; |
| 194 | if (main_sent) cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 194 | if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 195 | 195 | main_sent = 0; |
| 196 | 196 | } |
| 197 | 197 | if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04)) |
| r1591 | r1592 | |
| 232 | 232 | from_main = data; |
| 233 | 233 | main_sent = 1; |
| 234 | 234 | mcu_sent=0; |
| 235 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 235 | cpunum_set_input_line(Machine, 2,0,ASSERT_LINE); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | READ8_HANDLER( tigerh_mcu_r ) |
| r1591 | r1592 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | /* Turn off interrupts if self-test is enabled */ |
| 20 | 20 | if (!(readinputport(0) & 0x80)) |
| 21 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 21 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | INTERRUPT_GEN( asterock_interrupt ) |
| 25 | 25 | { |
| 26 | 26 | /* Turn off interrupts if self-test is enabled */ |
| 27 | 27 | if ((readinputport(0) & 0x80)) |
| 28 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 28 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | INTERRUPT_GEN( llander_interrupt ) |
| 32 | 32 | { |
| 33 | 33 | /* Turn off interrupts if self-test is enabled */ |
| 34 | 34 | if (readinputport(0) & 0x02) |
| 35 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 35 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | alpha_irq_clock++; |
| 45 | 45 | if ((alpha_irq_clock & 0x0c) == 0x0c) |
| 46 | 46 | { |
| 47 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 47 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 48 | 48 | alpha_irq_clock_enable = 0; |
| 49 | 49 | } |
| 50 | 50 | } |
| r1591 | r1592 | |
| 53 | 53 | if (has_gamma_cpu) |
| 54 | 54 | { |
| 55 | 55 | gamma_irq_clock++; |
| 56 | cpunum_set_input_line(1, 0, (gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 56 | cpunum_set_input_line(machine, 1, 0, (gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| r1591 | r1592 | |
| 61 | 61 | WRITE8_HANDLER( mhavoc_alpha_irq_ack_w ) |
| 62 | 62 | { |
| 63 | 63 | /* clear the line and reset the clock */ |
| 64 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 64 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 65 | 65 | alpha_irq_clock = 0; |
| 66 | 66 | alpha_irq_clock_enable = 1; |
| 67 | 67 | } |
| r1591 | r1592 | |
| 70 | 70 | WRITE8_HANDLER( mhavoc_gamma_irq_ack_w ) |
| 71 | 71 | { |
| 72 | 72 | /* clear the line and reset the clock */ |
| 73 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 73 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 74 | 74 | gamma_irq_clock = 0; |
| 75 | 75 | } |
| 76 | 76 | |
| r1591 | r1592 | |
| 143 | 143 | alpha_data = param; |
| 144 | 144 | |
| 145 | 145 | /* signal with an NMI pulse */ |
| 146 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 146 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 147 | 147 | |
| 148 | 148 | /* the sound CPU needs to reply in 250microseconds (according to Neil Bradley) */ |
| 149 | 149 | timer_set(ATTOTIME_IN_USEC(250), NULL, 0, 0); |
| r1591 | r1592 | |
| 319 | 319 | player_1 = (data >> 5) & 1; |
| 320 | 320 | |
| 321 | 321 | /* Bit 3 = Gamma reset */ |
| 322 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 322 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 323 | 323 | if (!(data & 0x08)) |
| 324 | 324 | { |
| 325 | 325 | logerror("\t\t\t\t*** resetting gamma processor. ***\n"); |
| r1591 | r1592 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | #define MCU_RTNMSB 0x80 |
| 21 | 21 | |
| 22 | #if 0 // ** cut-and-pasted to driver module ** | |
| 23 | ||
| 24 | // Common Hardware Start | |
| 25 | #define EQUITES_ADD_SOUNDBOARD7 \ | |
| 26 | MDRV_CPU_ADD(8085A, 5000000) \ | |
| 27 | /* audio CPU */ \ | |
| 28 | MDRV_CPU_PROGRAM_MAP(equites_s_readmem, equites_s_writemem) \ | |
| 29 | MDRV_CPU_IO_MAP(0, equites_s_writeport) \ | |
| 30 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000) \ | |
| 31 | \ | |
| 32 | MDRV_SOUND_ADD(MSM5232, 2500000) \ | |
| 33 | MDRV_SOUND_CONFIG(equites_5232intf) \ | |
| 34 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) \ | |
| 35 | \ | |
| 36 | MDRV_SOUND_ADD(AY8910, 6144444/4) \ | |
| 37 | MDRV_SOUND_CONFIG(equites_8910intf) \ | |
| 38 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) \ | |
| 39 | \ | |
| 40 | MDRV_SOUND_ADD(DAC, 0) \ | |
| 41 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) \ | |
| 42 | \ | |
| 43 | MDRV_SOUND_ADD(DAC, 0) \ | |
| 44 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) \ | |
| 45 | ||
| 46 | extern void equites_8404init(void); | |
| 47 | extern void equites_8404rule(unsigned pc, int offset, int data); | |
| 48 | ||
| 49 | extern READ16_HANDLER(equites_8404_r); | |
| 50 | extern WRITE8_HANDLER(equites_5232_w); | |
| 51 | extern WRITE8_HANDLER(equites_8910control_w); | |
| 52 | extern WRITE8_HANDLER(equites_8910data_w); | |
| 53 | extern WRITE8_HANDLER(equites_dac0_w); | |
| 54 | extern WRITE8_HANDLER(equites_dac1_w); | |
| 55 | ||
| 56 | extern UINT16 *equites_8404ram; | |
| 57 | extern struct const MSM5232interface equites_5232intf; | |
| 58 | extern struct const AY8910interface equites_8910intf; | |
| 59 | ||
| 60 | static ADDRESS_MAP_START( equites_s_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 61 | { 0x0000, 0xbfff, MRA8_ROM }, // sound program | |
| 62 | { 0xc000, 0xc000, soundlatch_r }, | |
| 63 | { 0xe000, 0xe0ff, MRA8_RAM }, // stack and variables | |
| 64 | ADDRESS_MAP_END | |
| 65 | ||
| 66 | static ADDRESS_MAP_START( equites_s_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 67 | { 0x0000, 0xbfff, MWA8_ROM }, // sound program | |
| 68 | { 0xc080, 0xc08d, equites_5232_w }, | |
| 69 | { 0xc0a0, 0xc0a0, equites_8910data_w }, | |
| 70 | { 0xc0a1, 0xc0a1, equites_8910control_w }, | |
| 71 | { 0xc0b0, 0xc0b0, MWA8_NOP }, // INTR: sync with main melody | |
| 72 | { 0xc0c0, 0xc0c0, MWA8_NOP }, // INTR: sync with specific beats | |
| 73 | { 0xc0d0, 0xc0d0, equites_dac0_w }, | |
| 74 | { 0xc0e0, 0xc0e0, equites_dac1_w }, | |
| 75 | { 0xc0f8, 0xc0fe, MWA8_NOP }, // soundboard I/O, ignored | |
| 76 | { 0xc0ff, 0xc0ff, soundlatch_clear_w }, | |
| 77 | { 0xe000, 0xe0ff, MWA8_RAM }, // stack and variables | |
| 78 | ADDRESS_MAP_END | |
| 79 | ||
| 80 | static ADDRESS_MAP_START( equites_s_writeport, ADDRESS_SPACE_IO, 8 ) | |
| 81 | { 0x00e0, 0x00e5, MWA8_NOP }, // soundboard I/O, ignored | |
| 82 | ADDRESS_MAP_END | |
| 83 | // Common Hardware End | |
| 84 | ||
| 85 | #endif | |
| 86 | ||
| 87 | 22 | /******************************************************************************/ |
| 88 | 23 | // Imports |
| 89 | 24 | |
| r1591 | r1592 | |
| 179 | 114 | { |
| 180 | 115 | static int parity = 0; |
| 181 | 116 | |
| 182 | if (parity^=1) cpunum_set_input_line(1, I8085_INTR_LINE, HOLD_LINE); | |
| 183 | cpunum_set_input_line(1, I8085_RST75_LINE, HOLD_LINE); | |
| 117 | if (parity^=1) | |
| 118 | cpunum_set_input_line(machine, 1, I8085_INTR_LINE, HOLD_LINE); | |
| 119 | cpunum_set_input_line(machine, 1, I8085_RST75_LINE, HOLD_LINE); | |
| 184 | 120 | } |
| 185 | 121 | |
| 186 | 122 | // Optimized Mersenne Twister - courtesy of Shawn J. Cokus, University of Washington |
| r1591 | r1592 | |
|---|---|---|
| 107 | 107 | decocass_sound_ack |= 0x80; |
| 108 | 108 | /* remove snd cpu data ack bit. i don't see it in the schems, but... */ |
| 109 | 109 | decocass_sound_ack &= ~0x40; |
| 110 | cpunum_set_input_line(1, M6502_IRQ_LINE, ASSERT_LINE); | |
| 110 | cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, ASSERT_LINE); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | READ8_HANDLER( decocass_sound_data_r ) |
| r1591 | r1592 | |
| 135 | 135 | { |
| 136 | 136 | UINT8 data = soundlatch_r(0); |
| 137 | 137 | LOG(4,("CPU #%d sound command <- $%02x\n", cpu_getactivecpu(), data)); |
| 138 | cpunum_set_input_line(1, M6502_IRQ_LINE, CLEAR_LINE); | |
| 138 | cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, CLEAR_LINE); | |
| 139 | 139 | decocass_sound_ack &= ~0x80; |
| 140 | 140 | return data; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static TIMER_CALLBACK( decocass_sound_nmi_pulse ) |
| 144 | 144 | { |
| 145 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 145 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | WRITE8_HANDLER( decocass_sound_nmi_enable_w ) |
| r1591 | r1592 | |
| 175 | 175 | |
| 176 | 176 | WRITE8_HANDLER( decocass_nmi_reset_w ) |
| 177 | 177 | { |
| 178 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 178 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | WRITE8_HANDLER( decocass_quadrature_decoder_reset_w ) |
| r1591 | r1592 | |
| 281 | 281 | decocass_reset = data; |
| 282 | 282 | |
| 283 | 283 | /* CPU #1 active hight reset */ |
| 284 | cpunum_set_input_line(1, INPUT_LINE_RESET, data & 0x01 ); | |
| 284 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, data & 0x01 ); | |
| 285 | 285 | |
| 286 | 286 | /* on reset also remove the sound timer */ |
| 287 | 287 | if (data & 1) |
| 288 | 288 | timer_adjust(decocass_sound_timer, attotime_never, 0, attotime_never); |
| 289 | 289 | |
| 290 | 290 | /* 8041 active low reset */ |
| 291 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 ); | |
| 291 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 ); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | static const char *dirnm(int speed) |
| r1591 | r1592 | |
|---|---|---|
| 34 | 34 | { |
| 35 | 35 | if (twincobr_intenable) { |
| 36 | 36 | twincobr_intenable = 0; |
| 37 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 37 | cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| r1591 | r1592 | |
| 42 | 42 | { |
| 43 | 43 | if (twincobr_intenable) { |
| 44 | 44 | twincobr_intenable = 0; |
| 45 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| r1591 | r1592 | |
| 158 | 158 | if (data == 0) { |
| 159 | 159 | if (dsp_execute) { |
| 160 | 160 | LOG(("Turning the main CPU on\n")); |
| 161 | cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 161 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 162 | 162 | dsp_execute = 0; |
| 163 | 163 | } |
| 164 | 164 | twincobr_dsp_BIO = ASSERT_LINE; |
| r1591 | r1592 | |
| 195 | 195 | twincobr_dsp_on = enable; |
| 196 | 196 | if (enable) { |
| 197 | 197 | LOG(("Turning DSP on and main CPU off\n")); |
| 198 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 199 | cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 200 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 198 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 199 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 200 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 201 | 201 | } |
| 202 | 202 | else { |
| 203 | 203 | LOG(("Turning DSP off\n")); |
| 204 | cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 205 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 204 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 205 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| r1591 | r1592 | |
| 281 | 281 | /****** The following apply to Flying Shark/Wardner only ******/ |
| 282 | 282 | case 0x00: /* This means assert the INT line to the DSP */ |
| 283 | 283 | LOG(("Turning DSP on and main CPU off\n")); |
| 284 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 285 | cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 286 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 284 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 285 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 286 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 287 | 287 | break; |
| 288 | 288 | case 0x01: /* This means inhibit the INT line to the DSP */ |
| 289 | 289 | LOG(("Turning DSP off\n")); |
| 290 | cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 291 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 290 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 291 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 292 | 292 | break; |
| 293 | 293 | } |
| 294 | 294 | } |
| r1591 | r1592 | |
|---|---|---|
| 141 | 141 | dsp_shared_ram_bank[cgboard_id] = (data >> 24) & 0x1; |
| 142 | 142 | |
| 143 | 143 | if (data & 0x80000000) |
| 144 | { | |
| 145 | 144 | dsp_state[cgboard_id] |= 0x10; |
| 146 | } | |
| 147 | 145 | |
| 148 | 146 | pci_bridge_enable[cgboard_id] = (data & 0x20000000) ? 1 : 0; |
| 149 | 147 | |
| 150 | 148 | if (data & 0x10000000) |
| 151 | { | |
| 152 | cpunum_set_input_line(dsp, INPUT_LINE_RESET, CLEAR_LINE); | |
| 153 | } | |
| 149 | cpunum_set_input_line(Machine, dsp, INPUT_LINE_RESET, CLEAR_LINE); | |
| 154 | 150 | else |
| 155 | { | |
| 156 | cpunum_set_input_line(dsp, INPUT_LINE_RESET, ASSERT_LINE); | |
| 157 | } | |
| 151 | cpunum_set_input_line(Machine, dsp, INPUT_LINE_RESET, ASSERT_LINE); | |
| 158 | 152 | |
| 159 | 153 | if (data & 0x02000000) |
| 160 | { | |
| 161 | cpunum_set_input_line(dsp, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 162 | } | |
| 154 | cpunum_set_input_line(Machine, dsp, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 155 | ||
| 163 | 156 | if (data & 0x04000000) |
| 164 | { | |
| 165 | cpunum_set_input_line(dsp, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 166 | } | |
| 157 | cpunum_set_input_line(Machine, dsp, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 167 | 158 | } |
| 168 | 159 | |
| 169 | 160 | if (!(mem_mask & 0x000000ff)) |
| 170 | { | |
| 171 | 161 | dsp_comm_ppc[cgboard_id][offset] = data & 0xff; |
| 172 | } | |
| 173 | 162 | } |
| 174 | 163 | else |
| 175 | { | |
| 176 | 164 | dsp_comm_ppc[cgboard_id][offset] = data; |
| 177 | } | |
| 178 | 165 | } |
| 179 | 166 | } |
| 180 | 167 | |
| r1591 | r1592 | |
| 196 | 183 | { |
| 197 | 184 | if (cgboard_id < MAX_CG_BOARDS) |
| 198 | 185 | { |
| 199 | cpu_trigger(10000); // Remove the timeout (a part of the GTI Club FIFO test workaround) | |
| 186 | cpu_trigger(Machine, 10000); // Remove the timeout (a part of the GTI Club FIFO test workaround) | |
| 200 | 187 | COMBINE_DATA(dsp_shared_ram[cgboard_id] + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD))); |
| 201 | 188 | } |
| 202 | 189 | } |
| r1591 | r1592 | |
| 222 | 209 | case CGBOARD_TYPE_ZR107: |
| 223 | 210 | case CGBOARD_TYPE_GTICLUB: |
| 224 | 211 | { |
| 225 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG0, ASSERT_LINE); | |
| 212 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG0, ASSERT_LINE); | |
| 226 | 213 | cpuintrf_push_context(2); |
| 227 | 214 | sharc_set_flag_input(0, ASSERT_LINE); |
| 228 | 215 | cpuintrf_pop_context(); |
| r1591 | r1592 | |
| 230 | 217 | if (offset == 1) |
| 231 | 218 | { |
| 232 | 219 | if (data & 0x03) |
| 233 | { | |
| 234 | cpunum_set_input_line(2, INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 235 | } | |
| 220 | cpunum_set_input_line(Machine, 2, INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 236 | 221 | } |
| 237 | 222 | break; |
| 238 | 223 | } |
| r1591 | r1592 | |
|---|---|---|
| 180 | 180 | if (scanline == 224) irvg_vblank=1; |
| 181 | 181 | logerror("SCANLINE CALLBACK %d\n",scanline); |
| 182 | 182 | /* set the IRQ line state based on the 32V line state */ |
| 183 | cpunum_set_input_line(0, M6809_IRQ_LINE, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 183 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 184 | 184 | |
| 185 | 185 | /* set a callback for the next 32-scanline increment */ |
| 186 | 186 | scanline += 32; |
| r1591 | r1592 | |
| 457 | 457 | { |
| 458 | 458 | logerror("mb done. "); |
| 459 | 459 | irmb_running = 0; |
| 460 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 460 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | |
| r1591 | r1592 | |
| 861 | 861 | timer_adjust(irmb_timer, attotime_mul(ATTOTIME_IN_NSEC(200), icount), 0, attotime_zero); |
| 862 | 862 | } |
| 863 | 863 | #else |
| 864 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 864 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 865 | 865 | #endif |
| 866 | 866 | irmb_running=1; |
| 867 | 867 | } |
| r1591 | r1592 | |
|---|---|---|
| 469 | 469 | |
| 470 | 470 | /* interrupts generated on the VA10 line, which is every */ |
| 471 | 471 | /* 16 scanlines starting with scanline #8 */ |
| 472 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 472 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 473 | 473 | |
| 474 | 474 | /* set a timer for the next one */ |
| 475 | 475 | scanline += 16; |
| r1591 | r1592 | |
| 486 | 486 | leland_last_scanline_int = scanline; |
| 487 | 487 | |
| 488 | 488 | /* interrupts generated according to the interrupt control register */ |
| 489 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 489 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 490 | 490 | |
| 491 | 491 | /* set a timer for the next one */ |
| 492 | 492 | timer_adjust(master_int_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero); |
| r1591 | r1592 | |
| 497 | 497 | { |
| 498 | 498 | /* check for coins here */ |
| 499 | 499 | if ((readinputport(1) & 0x0e) != 0x0e) |
| 500 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 500 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | |
| r1591 | r1592 | |
| 1159 | 1159 | |
| 1160 | 1160 | case 0x02: /* /GIN2 */ |
| 1161 | 1161 | case 0x12: |
| 1162 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1162 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1163 | 1163 | break; |
| 1164 | 1164 | |
| 1165 | 1165 | case 0x03: /* /IGID */ |
| r1591 | r1592 | |
| 1190 | 1190 | switch (offset) |
| 1191 | 1191 | { |
| 1192 | 1192 | case 0x09: /* /MCONT */ |
| 1193 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1193 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1194 | 1194 | wcol_enable = (data & 0x02); |
| 1195 | cpunum_set_input_line(1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1196 | cpunum_set_input_line (1, 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 1195 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1196 | cpunum_set_input_line(Machine, 1, 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 1197 | 1197 | |
| 1198 | 1198 | if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", safe_activecpu_get_pc(), |
| 1199 | 1199 | (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); |
| r1591 | r1592 | |
| 1268 | 1268 | break; |
| 1269 | 1269 | |
| 1270 | 1270 | case 0x05: /* /SLV0 */ |
| 1271 | cpunum_set_input_line(1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1272 | cpunum_set_input_line(1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1273 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 1271 | cpunum_set_input_line(Machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1272 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1273 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 1274 | 1274 | break; |
| 1275 | 1275 | |
| 1276 | 1276 | case 0x08: /* */ |
| r1591 | r1592 | |
| 1301 | 1301 | READ8_HANDLER( leland_gated_paletteram_r ) |
| 1302 | 1302 | { |
| 1303 | 1303 | if (wcol_enable) |
| 1304 | return paletteram | |
| 1304 | return paletteram[ | |
| 1305 | 1305 | return 0xff; |
| 1306 | 1306 | } |
| 1307 | 1307 | |
| r1591 | r1592 | |
| 1340 | 1340 | READ8_HANDLER( ataxx_paletteram_and_misc_r ) |
| 1341 | 1341 | { |
| 1342 | 1342 | if (wcol_enable) |
| 1343 | return paletteram | |
| 1343 | return paletteram[ | |
| 1344 | 1344 | else if (offset == 0x7fc || offset == 0x7fd) |
| 1345 | 1345 | { |
| 1346 | 1346 | int result = xrom_base[0x00000 | xrom1_addr | ((offset & 1) << 16)]; |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | INTERRUPT_GEN( toaplan1_interrupt ) |
| 31 | 31 | { |
| 32 | 32 | if (toaplan1_intenable) |
| 33 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 33 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | WRITE16_HANDLER( toaplan1_intenable_w ) |
| r1591 | r1592 | |
| 98 | 98 | if (data == 0) { |
| 99 | 99 | if (dsp_execute) { |
| 100 | 100 | logerror("Turning 68000 on\n"); |
| 101 | cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 101 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 102 | 102 | dsp_execute = 0; |
| 103 | 103 | } |
| 104 | 104 | demonwld_dsp_BIO = ASSERT_LINE; |
| r1591 | r1592 | |
| 117 | 117 | if (enable) |
| 118 | 118 | { |
| 119 | 119 | logerror("Turning DSP on and 68000 off\n"); |
| 120 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 121 | cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 122 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 120 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 121 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 122 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 123 | 123 | } |
| 124 | 124 | else |
| 125 | 125 | { |
| 126 | 126 | logerror("Turning DSP off\n"); |
| 127 | cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 128 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 127 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 128 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | static void demonwld_restore_dsp(void) |
| r1591 | r1592 | |
| 228 | 228 | if (Machine->drv->sound[0].type == SOUND_YM3812) |
| 229 | 229 | sndti_reset(SOUND_YM3812, 0); |
| 230 | 230 | if (Machine->drv->cpu[1].type == CPU_Z80) |
| 231 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 231 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | |
| r1591 | r1592 | |
| 307 | 307 | |
| 308 | 308 | MACHINE_RESET( zerozone ) /* Hack for ZeroWing and OutZone. See the video driver */ |
| 309 | 309 | { |
| 310 | | |
| 310 | MACHINE_RESET_CALL(toaplan1 | |
| 311 | 311 | toaplan1_unk_reset_port = 1; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | MACHINE_RESET( demonwld ) |
| 315 | 315 | { |
| 316 | | |
| 316 | MACHINE_RESET_CALL(toaplan1 | |
| 317 | 317 | dsp_addr_w = 0; |
| 318 | 318 | main_ram_seg = 0; |
| 319 | 319 | dsp_execute = 0; |
| r1591 | r1592 | |
| 330 | 330 | |
| 331 | 331 | MACHINE_RESET( vimana ) |
| 332 | 332 | { |
| 333 | | |
| 333 | MACHINE_RESET_CALL(toaplan1 | |
| 334 | 334 | vimana_credits = 0; |
| 335 | 335 | vimana_latch = 0; |
| 336 | 336 | } |
| r1591 | r1592 | |
|---|---|---|
| 830 | 830 | { |
| 831 | 831 | LOG(("NMI cpu %d\n",nmi_cpu[param])); |
| 832 | 832 | |
| 833 | cpunum_set_input_line(nmi_cpu[param], INPUT_LINE_NMI, PULSE_LINE); | |
| 833 | cpunum_set_input_line(machine, nmi_cpu[param], INPUT_LINE_NMI, PULSE_LINE); | |
| 834 | 834 | } |
| 835 | 835 | else |
| 836 | 836 | LOG(("NMI not generated because cpu %d is suspended\n",nmi_cpu[param])); |
| r1591 | r1592 | |
|---|---|---|
| 581 | 581 | MACHINE_RESET( dc ) |
| 582 | 582 | { |
| 583 | 583 | /* halt the ARM7 */ |
| 584 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 584 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 585 | 585 | |
| 586 | 586 | memset(sysctrl_regs, 0, sizeof(sysctrl_regs)); |
| 587 | 587 | memset(maple_regs, 0, sizeof(maple_regs)); |
| r1591 | r1592 | |
| 615 | 615 | if (dat & 1) |
| 616 | 616 | { |
| 617 | 617 | /* halt the ARM7 */ |
| 618 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 618 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 619 | 619 | } |
| 620 | 620 | else |
| 621 | 621 | { |
| 622 | 622 | /* it's alive ! */ |
| 623 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 623 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 624 | 624 | } |
| 625 | 625 | } |
| 626 | 626 | mame_printf_verbose("AICA REG: write %llx to %x, mask %llx\n", data, offset, mem_mask); |
| r1591 | r1592 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | MACHINE_RESET( scramble ) |
| 22 | 22 | { |
| 23 | | |
| 23 | MACHINE_RESET_CALL(galaxian | |
| 24 | 24 | |
| 25 | 25 | if (cpu_gettotalcpu() > 1) |
| 26 | 26 | { |
| r1591 | r1592 | |
| 32 | 32 | |
| 33 | 33 | MACHINE_RESET( sfx ) |
| 34 | 34 | { |
| 35 | | |
| 35 | MACHINE_RESET_CALL(scrambl | |
| 36 | 36 | |
| 37 | 37 | sfx_sh_init(); |
| 38 | 38 | } |
| r1591 | r1592 | |
| 49 | 49 | |
| 50 | 50 | ROM[0xc5bc] = 0xaf; |
| 51 | 51 | */ |
| 52 | | |
| 52 | MACHINE_RESET_CALL(scrambl | |
| 53 | 53 | |
| 54 | 54 | sfx_sh_init(); |
| 55 | 55 | |
| r1591 | r1592 | |
| 61 | 61 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 62 | 62 | RAM[0x47ff] = 0; /* If not set, it doesn't reset after the 1st time */ |
| 63 | 63 | |
| 64 | | |
| 64 | MACHINE_RESET_CALL(galaxian | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static READ8_HANDLER( scrambls_input_port_2_r ) |
| r1591 | r1592 | |
| 331 | 331 | |
| 332 | 332 | DRIVER_INIT( scobra ) |
| 333 | 333 | { |
| 334 | | |
| 334 | DRIVER_INIT_CALL(scramble_ppi | |
| 335 | 335 | |
| 336 | 336 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scramble_background_enable_w); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | DRIVER_INIT( atlantis ) |
| 340 | 340 | { |
| 341 | | |
| 341 | DRIVER_INIT_CALL(scramble_ppi | |
| 342 | 342 | |
| 343 | 343 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scramble_background_enable_w); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | DRIVER_INIT( scramble ) |
| 347 | 347 | { |
| 348 | | |
| 348 | DRIVER_INIT_CALL(atlantis | |
| 349 | 349 | |
| 350 | 350 | ppi8255_set_portCread (1, scramble_protection_r); |
| 351 | 351 | ppi8255_set_portCwrite(1, scramble_protection_w); |
| r1591 | r1592 | |
| 353 | 353 | |
| 354 | 354 | DRIVER_INIT( scrambls ) |
| 355 | 355 | { |
| 356 | | |
| 356 | DRIVER_INIT_CALL(atlantis | |
| 357 | 357 | |
| 358 | 358 | ppi8255_set_portCread(0, scrambls_input_port_2_r); |
| 359 | 359 | ppi8255_set_portCread(1, scrambls_protection_r); |
| r1591 | r1592 | |
| 362 | 362 | |
| 363 | 363 | DRIVER_INIT( theend ) |
| 364 | 364 | { |
| 365 | | |
| 365 | DRIVER_INIT_CALL(scramble_ppi | |
| 366 | 366 | |
| 367 | 367 | ppi8255_set_portCwrite(0, theend_coin_counter_w); |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | DRIVER_INIT( stratgyx ) |
| 371 | 371 | { |
| 372 | | |
| 372 | DRIVER_INIT_CALL(scramble_ppi | |
| 373 | 373 | |
| 374 | 374 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0, scramble_background_green_w); |
| 375 | 375 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scramble_background_blue_w); |
| r1591 | r1592 | |
| 381 | 381 | |
| 382 | 382 | DRIVER_INIT( tazmani2 ) |
| 383 | 383 | { |
| 384 | | |
| 384 | DRIVER_INIT_CALL(scramble_ppi | |
| 385 | 385 | |
| 386 | 386 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scramble_background_enable_w); |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | DRIVER_INIT( amidar ) |
| 390 | 390 | { |
| 391 | | |
| 391 | DRIVER_INIT_CALL(scramble_ppi | |
| 392 | 392 | |
| 393 | 393 | /* Amidar has a the DIP switches connected to port C of the 2nd 8255 */ |
| 394 | 394 | ppi8255_set_portCread(1, input_port_3_r); |
| r1591 | r1592 | |
| 396 | 396 | |
| 397 | 397 | DRIVER_INIT( ckongs ) |
| 398 | 398 | { |
| 399 | | |
| 399 | DRIVER_INIT_CALL(scramble_ppi | |
| 400 | 400 | |
| 401 | 401 | ppi8255_set_portBread(0, ckongs_input_port_1_r); |
| 402 | 402 | ppi8255_set_portCread(0, ckongs_input_port_2_r); |
| r1591 | r1592 | |
| 404 | 404 | |
| 405 | 405 | DRIVER_INIT( mariner ) |
| 406 | 406 | { |
| 407 | | |
| 407 | DRIVER_INIT_CALL(scramble_ppi | |
| 408 | 408 | |
| 409 | 409 | /* extra ROM */ |
| 410 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, MRA8_BANK1); | |
| 411 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, MWA8_ROM); | |
| 410 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, MRA8_BANK1, MWA8_UNMAP); | |
| 412 | 411 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800); |
| 413 | 412 | |
| 414 | 413 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9008, 0x9008, 0, 0, mariner_protection_2_r); |
| r1591 | r1592 | |
| 424 | 423 | UINT8 *ROM; |
| 425 | 424 | |
| 426 | 425 | |
| 427 | | |
| 426 | DRIVER_INIT_CALL(scramble_ppi | |
| 428 | 427 | |
| 429 | 428 | |
| 430 | 429 | /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */ |
| r1591 | r1592 | |
| 444 | 443 | UINT8 *ROM; |
| 445 | 444 | |
| 446 | 445 | |
| 447 | | |
| 446 | DRIVER_INIT_CALL(scramble_ppi | |
| 448 | 447 | |
| 449 | 448 | /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */ |
| 450 | 449 | ROM = memory_region(REGION_CPU2); |
| r1591 | r1592 | |
| 458 | 457 | UINT8 *RAM; |
| 459 | 458 | |
| 460 | 459 | |
| 461 | | |
| 460 | DRIVER_INIT_CALL(scramble_ppi | |
| 462 | 461 | |
| 463 | 462 | |
| 464 | 463 | /* Address lines are scrambled on the main CPU */ |
| r1591 | r1592 | |
| 487 | 486 | |
| 488 | 487 | DRIVER_INIT( mars ) |
| 489 | 488 | { |
| 490 | | |
| 489 | DRIVER_INIT_CALL(devilfsh | |
| 491 | 490 | |
| 492 | 491 | /* extra port */ |
| 493 | 492 | ppi8255_set_portCread(1, input_port_3_r); |
| r1591 | r1592 | |
| 504 | 503 | { |
| 505 | 504 | UINT8 *ROM = memory_region(REGION_CPU1); |
| 506 | 505 | |
| 507 | | |
| 506 | DRIVER_INIT_CALL(scramble_ppi | |
| 508 | 507 | |
| 509 | 508 | /* banked ROM */ |
| 510 | 509 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MRA8_BANK1); |
| r1591 | r1592 | |
| 523 | 522 | |
| 524 | 523 | DRIVER_INIT( moonwar ) |
| 525 | 524 | { |
| 526 | | |
| 525 | DRIVER_INIT_CALL(scramble_ppi | |
| 527 | 526 | |
| 528 | 527 | /* special handler for the spinner */ |
| 529 | 528 | ppi8255_set_portAread (0, moonwar_input_port_0_r); |
| r1591 | r1592 | |
| 534 | 533 | |
| 535 | 534 | DRIVER_INIT( darkplnt ) |
| 536 | 535 | { |
| 537 | | |
| 536 | DRIVER_INIT_CALL(scramble_ppi | |
| 538 | 537 | |
| 539 | 538 | /* special handler for the spinner */ |
| 540 | 539 | ppi8255_set_portBread(0, darkplnt_input_port_1_r); |
| r1591 | r1592 | |
| 575 | 574 | ctr++; |
| 576 | 575 | } |
| 577 | 576 | |
| 578 | | |
| 577 | DRIVER_INIT_CALL(scramble_ppi | |
| 579 | 578 | |
| 580 | 579 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scramble_background_enable_w); |
| 581 | 580 | } |
| 582 | 581 | |
| 583 | 582 | DRIVER_INIT( mimonsco ) |
| 584 | 583 | { |
| 585 | | |
| 584 | DRIVER_INIT_CALL(scramble_ppi | |
| 586 | 585 | |
| 587 | 586 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scramble_background_enable_w); |
| 588 | 587 | } |
| 589 | 588 | |
| 590 | 589 | DRIVER_INIT( mimonscr ) |
| 591 | 590 | { |
| 592 | | |
| 591 | DRIVER_INIT_CALL(scramble_ppi | |
| 593 | 592 | |
| 594 | 593 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6804, 0x6804, 0, 0, scramble_background_enable_w); |
| 595 | 594 | } |
| r1591 | r1592 | |
| 608 | 607 | UINT8 *scratch; |
| 609 | 608 | |
| 610 | 609 | |
| 611 | | |
| 610 | DRIVER_INIT_CALL(scobra | |
| 612 | 611 | |
| 613 | 612 | /* |
| 614 | 613 | * Code To Decode Lost Tomb by Mirko Buffoni |
| r1591 | r1592 | |
| 644 | 643 | UINT8 *scratch; |
| 645 | 644 | |
| 646 | 645 | |
| 647 | | |
| 646 | DRIVER_INIT_CALL(scobra | |
| 648 | 647 | |
| 649 | 648 | /* |
| 650 | 649 | * Code To Decode Lost Tomb by Mirko Buffoni |
| r1591 | r1592 | |
| 680 | 679 | UINT8 *scratch; |
| 681 | 680 | |
| 682 | 681 | |
| 683 | | |
| 682 | DRIVER_INIT_CALL(scobra | |
| 684 | 683 | |
| 685 | 684 | /* |
| 686 | 685 | * Code To Decode Minefield by Mike Balfour and Nicola Salmoria |
| r1591 | r1592 | |
| 716 | 715 | UINT8 *scratch; |
| 717 | 716 | |
| 718 | 717 | |
| 719 | | |
| 718 | DRIVER_INIT_CALL(scrambl | |
| 720 | 719 | |
| 721 | 720 | /* |
| 722 | 721 | * Code To Decode Lost Tomb by Mirko Buffoni |
| r1591 | r1592 | |
| 751 | 750 | UINT8 *RAM; |
| 752 | 751 | |
| 753 | 752 | |
| 754 | | |
| 753 | DRIVER_INIT_CALL(scrambl | |
| 755 | 754 | |
| 756 | 755 | /* Deryption worked out by hand by Chris Hardy. */ |
| 757 | 756 | |
| r1591 | r1592 | |
| 784 | 783 | offs_t A; |
| 785 | 784 | |
| 786 | 785 | |
| 787 | | |
| 786 | DRIVER_INIT_CALL(scramble_ppi | |
| 788 | 787 | |
| 789 | 788 | |
| 790 | 789 | for (A = 0;A < 0x4000;A++) |
| r1591 | r1592 | |
| 826 | 825 | offs_t A; |
| 827 | 826 | |
| 828 | 827 | |
| 829 | | |
| 828 | DRIVER_INIT_CALL(scramble_ppi | |
| 830 | 829 | |
| 831 | 830 | |
| 832 | 831 | for (A = 0;A < 0x4000;A++) |
| r1591 | r1592 | |
| 875 | 874 | |
| 876 | 875 | DRIVER_INIT( mrkougar ) |
| 877 | 876 | { |
| 878 | | |
| 877 | DRIVER_INIT_CALL(devilfsh | |
| 879 | 878 | |
| 880 | 879 | /* no sound enabled bit */ |
| 881 | 880 | ppi8255_set_portBwrite(1, mrkougar_sh_irqtrigger_w); |
| r1591 | r1592 | |
| 883 | 882 | |
| 884 | 883 | DRIVER_INIT( mrkougb ) |
| 885 | 884 | { |
| 886 | | |
| 885 | DRIVER_INIT_CALL(scramble_ppi | |
| 887 | 886 | |
| 888 | 887 | /* no sound enabled bit */ |
| 889 | 888 | ppi8255_set_portBwrite(1, mrkougar_sh_irqtrigger_w); |
| r1591 | r1592 | |
|---|---|---|
| 449 | 449 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1b6ffff, 0, 0, mk_prot_w); |
| 450 | 450 | |
| 451 | 451 | /* sound chip protection (hidden RAM) */ |
| 452 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfb9c, 0xfbc6, 0, 0, MWA8_RAM); | |
| 452 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfb9c, 0xfbc6, 0, 0, MRA8_BANK9, MWA8_BANK9); | |
| 453 | memory_set_bankptr(9, auto_malloc(0x80)); | |
| 453 | 454 | } |
| 454 | 455 | |
| 455 | 456 | static void init_nbajam_common(int te_protection) |
| r1591 | r1592 | |
| 475 | 476 | |
| 476 | 477 | /* sound chip protection (hidden RAM) */ |
| 477 | 478 | if (!te_protection) |
| 478 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbaa, 0xfbd4, 0, 0, M | |
| 479 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbaa, 0xfbd4, 0, 0, MRA8_BANK9, MWA8_BANK9); | |
| 479 | 480 | else |
| 480 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbec, 0xfc16, 0, 0, MWA8_RAM); | |
| 481 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbec, 0xfc16, 0, 0, MRA8_BANK9, MWA8_BANK9); | |
| 482 | memory_set_bankptr(9, auto_malloc(0x80)); | |
| 481 | 483 | } |
| 482 | 484 | |
| 483 | 485 | DRIVER_INIT( nbajam ) |
| r1591 | r1592 | |
| 503 | 505 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1bfffff, 0, 0, jdredd_prot_w); |
| 504 | 506 | |
| 505 | 507 | /* sound chip protection (hidden RAM) */ |
| 506 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbcf, 0xfbf9, 0, 0, MWA8_RAM); | |
| 508 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbcf, 0xfbf9, 0, 0, MRA8_BANK7, MWA8_BANK9); | |
| 509 | memory_set_bankptr(9, auto_malloc(0x80)); | |
| 507 | 510 | |
| 508 | 511 | #if ENABLE_ALL_JDREDD_LEVELS |
| 509 | 512 | /* how about the final levels? */ |
| r1591 | r1592 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | zaccept = 1; |
| 20 | 20 | zready = 0; |
| 21 | cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 21 | cpunum_set_input_line(machine, 2,0,CLEAR_LINE); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | static TIMER_CALLBACK( pitnrun_mcu_real_data_r ) |
| r1591 | r1592 | |
| 35 | 35 | static TIMER_CALLBACK( pitnrun_mcu_real_data_w ) |
| 36 | 36 | { |
| 37 | 37 | zready = 1; |
| 38 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 38 | cpunum_set_input_line(machine, 2,0,ASSERT_LINE); | |
| 39 | 39 | fromz80 = param; |
| 40 | 40 | } |
| 41 | 41 | |
| r1591 | r1592 | |
| 109 | 109 | { |
| 110 | 110 | /* 68705 is going to read data from the Z80 */ |
| 111 | 111 | timer_call_after_resynch(NULL, 0,pitnrun_mcu_data_real_r); |
| 112 | cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 112 | cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 113 | 113 | portA_in = fromz80; |
| 114 | 114 | } |
| 115 | 115 | if (~data & 0x04) |
| r1591 | r1592 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | static void TTL74148_3S_cb(void) |
| 91 | 91 | { |
| 92 | cpunum_set_input_line(0, M6502_IRQ_LINE, TTL74148_output_valid_r(TTL74148_3S) ? CLEAR_LINE : ASSERT_LINE); | |
| 92 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, TTL74148_output_valid_r(TTL74148_3S) ? CLEAR_LINE : ASSERT_LINE); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 |
| r1591 | r1592 | |
|---|---|---|
| 585 | 585 | namcos1_reset = data & 1; |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 589 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 590 | cpunum_set_input_line(3, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 588 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 589 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 590 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | |
| r1591 | r1592 | |
| 860 | 860 | namcos1_bankswitch(1, 0x0e01, 0xff); |
| 861 | 861 | |
| 862 | 862 | /* stop all CPUs */ |
| 863 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 864 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 865 | cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 863 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 864 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 865 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 866 | 866 | |
| 867 | 867 | /* mcu patch data clear */ |
| 868 | 868 | mcu_patch_data = 0; |
| r1591 | r1592 | |
|---|---|---|
| 217 | 217 | /* 03 - maybe controls halt and reset lines together? */ |
| 218 | 218 | if ((oldval ^ chip->regs[offset]) & 3) |
| 219 | 219 | { |
| 220 | cpunum_set_input_line(chip->cpunum, INPUT_LINE_RESET, (chip->regs[offset] & 3) == 3 ? ASSERT_LINE : CLEAR_LINE); | |
| 220 | cpunum_set_input_line(Machine, chip->cpunum, INPUT_LINE_RESET, (chip->regs[offset] & 3) == 3 ? ASSERT_LINE : CLEAR_LINE); | |
| 221 | 221 | if ((chip->regs[offset] & 3) == 3) |
| 222 | 222 | fd1094_machine_init(); |
| 223 | 223 | } |
| r1591 | r1592 | |
| 231 | 231 | case 0x04: |
| 232 | 232 | /* controls IRQ lines to 68000, negative logic -- write $B to signal IRQ4 */ |
| 233 | 233 | if ((chip->regs[offset] & 7) != 7) |
| 234 | cpunum_set_input_line(chip->cpunum, (~chip->regs[offset] & 7), HOLD_LINE); | |
| 234 | cpunum_set_input_line(Machine, chip->cpunum, (~chip->regs[offset] & 7), HOLD_LINE); | |
| 235 | 235 | break; |
| 236 | 236 | |
| 237 | 237 | case 0x05: |
| r1591 | r1592 | |
|---|---|---|
| 9 | 9 | { |
| 10 | 10 | mcu_sent = 0; |
| 11 | 11 | main_sent = 0; |
| 12 | cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 12 | cpunum_set_input_line(machine, 2,0,CLEAR_LINE); | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| r1591 | r1592 | |
| 74 | 74 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) |
| 75 | 75 | { |
| 76 | 76 | portA_in = from_main; |
| 77 | if (main_sent) cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 77 | if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 78 | 78 | main_sent = 0; |
| 79 | 79 | logerror("read command %02x from main cpu\n",portA_in); |
| 80 | 80 | } |
| r1591 | r1592 | |
| 131 | 131 | logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); |
| 132 | 132 | from_main = data; |
| 133 | 133 | main_sent = 1; |
| 134 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 134 | cpunum_set_input_line(Machine, 2,0,ASSERT_LINE); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | READ8_HANDLER( buggychl_mcu_r ) |
| r1591 | r1592 | |
|---|---|---|
| 34 | 34 | { |
| 35 | 35 | mi_interrupt |= interrupt; |
| 36 | 36 | |
| 37 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 37 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| r1591 | r1592 | |
| 44 | 44 | |
| 45 | 45 | //if (!mi_interrupt) |
| 46 | 46 | { |
| 47 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 47 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| r1591 | r1592 | |
| 125 | 125 | static void sp_dma(int direction) |
| 126 | 126 | { |
| 127 | 127 | UINT8 *src, *dst; |
| 128 | int i; | |
| 128 | int i, c; | |
| 129 | 129 | //int cpu = cpu_getactivecpu(); |
| 130 | 130 | |
| 131 | 131 | if (sp_dma_length == 0) |
| r1591 | r1592 | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | sp_dma_length++; |
| 137 | ||
| 138 | 137 | if ((sp_dma_length & 3) != 0) |
| 139 | 138 | { |
| 140 | 139 | //fatalerror("sp_dma (%s): sp_dma_length unaligned %08X\n", cpu ? "RSP" : "R4300i", sp_dma_length); |
| 141 | sp_dma_length = sp_dma_length & ~3; | |
| 142 | //sp_dma_length = (sp_dma_length + 3) & ~3; | |
| 140 | //sp_dma_length = sp_dma_length & ~3; | |
| 141 | sp_dma_length = (sp_dma_length + 3) & ~3; | |
| 143 | 142 | |
| 144 | 143 | //sp_dma_length &= ~3; |
| 145 | 144 | } |
| r1591 | r1592 | |
| 153 | 152 | } |
| 154 | 153 | if (sp_dram_addr & 0x3) |
| 155 | 154 | { |
| 156 | //sp_dram_addr = (sp_dram_addr + 3) & ~3; | |
| 157 | sp_dram_addr = sp_dram_addr & ~3; | |
| 158 | // sp_dram_addr &= ~0x3; | |
| 159 | // fatalerror("sp_dma (%s): sp_dram_addr unaligned: %08X\n", cpu ? "RSP" : "R4300i", sp_dram_addr); | |
| 160 | ||
| 161 | // Diddy Kong Racing does unaligned DMA? | |
| 162 | //sp_dram_addr &= ~0x3; | |
| 163 | //sp_dram_addr = (sp_dram_addr + 3) & ~0x3; | |
| 155 | sp_dram_addr = sp_dram_addr & ~7; | |
| 164 | 156 | } |
| 165 | 157 | |
| 166 | 158 | if (sp_dma_count > 0) |
| 167 | 159 | { |
| 168 | fatalerror("sp_dma: dma_count = %d\n", sp_dma_count); | |
| 160 | // fatalerror("sp_dma: dma_count = %d\n", sp_dma_count); | |
| 169 | 161 | } |
| 170 | 162 | if (sp_dma_skip > 0) |
| 171 | 163 | { |
| 172 | fatalerror("sp_dma: dma_skip = %d\n", sp_dma_skip); | |
| 164 | // fatalerror("sp_dma: dma_skip = %d\n", sp_dma_skip); | |
| 173 | 165 | } |
| 174 | 166 | |
| 175 | 167 | if ((sp_mem_addr & 0xfff) + (sp_dma_length) > 0x1000) |
| r1591 | r1592 | |
| 179 | 171 | |
| 180 | 172 | if (direction == 0) // RDRAM -> I/DMEM |
| 181 | 173 | { |
| 182 | src = (UINT8*)&rdram[sp_dram_addr / 4]; | |
| 183 | dst = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4]; | |
| 174 | for (c=0; c <= sp_dma_count; c++) | |
| 175 | { | |
| 176 | src = (UINT8*)&rdram[sp_dram_addr / 4]; | |
| 177 | dst = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4]; | |
| 184 | 178 | |
| 185 | //mame_printf_debug("sp_dma: %08X to %08X, length %08X\n", sp_dram_addr, sp_mem_addr, sp_dma_length); | |
| 179 | for (i=0; i < sp_dma_length; i++) | |
| 180 | { | |
| 181 | dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)]; | |
| 182 | } | |
| 186 | 183 | |
| 187 | for (i=0; i < sp_dma_length; i++) | |
| 188 | { | |
| 189 | dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)]; | |
| 190 | } | |
| 184 | sp_mem_addr += sp_dma_length; | |
| 185 | sp_dram_addr += sp_dma_length; | |
| 191 | 186 | |
| 192 | /*dst = (sp_mem_addr & 0x1000) ? (UINT8*)rsp_imem : (UINT8*)rsp_dmem; | |
| 193 | for (i=0; i <= sp_dma_length; i++) | |
| 194 | { | |
| 195 | dst[BYTE4_XOR_BE(sp_mem_addr+i) & 0xfff] = src[BYTE4_XOR_BE(i)]; | |
| 196 | }*/ | |
| 197 | ||
| 198 | sp_mem_addr += sp_dma_length; | |
| 199 | sp_dram_addr += sp_dma_length; | |
| 187 | sp_mem_addr += sp_dma_skip; | |
| 188 | } | |
| 200 | 189 | } |
| 201 | 190 | else // I/DMEM -> RDRAM |
| 202 | 191 | { |
| 203 | src = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4]; | |
| 204 | dst = (UINT8*)&rdram[sp_dram_addr / 4]; | |
| 192 | for (c=0; c <= sp_dma_count; c++) | |
| 193 | { | |
| 194 | src = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4]; | |
| 195 | dst = (UINT8*)&rdram[sp_dram_addr / 4]; | |
| 205 | 196 | |
| 206 | // mame_printf_debug("sp_dma: %08X to %08X, length %08X\n", sp_mem_addr, sp_dram_addr, sp_dma_length); | |
| 197 | for (i=0; i < sp_dma_length; i++) | |
| 198 | { | |
| 199 | dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)]; | |
| 200 | } | |
| 207 | 201 | |
| 208 | for (i=0; i < sp_dma_length; i++) | |
| 209 | { | |
| 210 | dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)]; | |
| 211 | } | |
| 202 | sp_mem_addr += sp_dma_length; | |
| 203 | sp_dram_addr += sp_dma_length; | |
| 212 | 204 | |
| 213 | /*src = (sp_mem_addr & 0x1000) ? (UINT8*)rsp_imem : (UINT8*)rsp_dmem; | |
| 214 | for (i=0; i <= sp_dma_length; i++) | |
| 215 | { | |
| 216 | dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(sp_mem_addr+i) & 0xfff]; | |
| 217 | }*/ | |
| 218 | ||
| 219 | sp_mem_addr += sp_dma_length; | |
| 220 | sp_dram_addr += sp_dma_length; | |
| 205 | sp_dram_addr += sp_dma_skip; | |
| 206 | } | |
| 221 | 207 | } |
| 222 | 208 | } |
| 223 | 209 | |
| r1591 | r1592 | |
| 228 | 214 | { |
| 229 | 215 | if (status & 0x1) |
| 230 | 216 | { |
| 231 | //cpu_trigger(6789); | |
| 217 | //cpu_trigger(Machine, 6789); | |
| 232 | 218 | |
| 233 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 219 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 234 | 220 | cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT); |
| 235 | 221 | //rsp_sp_status |= SP_STATUS_HALT; |
| 236 | 222 | } |
| r1591 | r1592 | |
| 282 | 268 | return 0; |
| 283 | 269 | |
| 284 | 270 | case 0x40000/4: // PC |
| 285 | return cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_PC); | |
| 271 | return cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_PC) & 0x00000fff; | |
| 286 | 272 | |
| 287 | 273 | default: |
| 288 | 274 | logerror("sp_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); |
| r1591 | r1592 | |
| 330 | 316 | // cpu_spinuntil_trigger(6789); |
| 331 | 317 | |
| 332 | 318 | // printf( "Clearing RSP_STATUS_HALT\n" ); |
| 333 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 319 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 334 | 320 | cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_HALT ); |
| 335 | 321 | // RSP_STATUS &= ~RSP_STATUS_HALT; |
| 336 | 322 | //} |
| r1591 | r1592 | |
| 342 | 328 | if (data & 0x00000002) // set halt |
| 343 | 329 | { |
| 344 | 330 | // printf( "Setting RSP_STATUS_HALT\n" ); |
| 345 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 331 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 346 | 332 | cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT ); |
| 347 | 333 | // RSP_STATUS |= RSP_STATUS_HALT; |
| 348 | 334 | } |
| r1591 | r1592 | |
| 370 | 356 | { |
| 371 | 357 | //printf( "Setting RSP_STATUS_SSTEP\n" ); |
| 372 | 358 | cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SSTEP ); |
| 359 | if( !( cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ( RSP_STATUS_BROKE | RSP_STATUS_HALT ) ) ) | |
| 360 | { | |
| 361 | cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_STEPCNT, 1 ); | |
| 362 | } | |
| 373 | 363 | // RSP_STATUS |= RSP_STATUS_SSTEP; // set single step |
| 374 | 364 | } |
| 375 | 365 | if (data & 0x00000080) |
| r1591 | r1592 | |
| 575 | 565 | |
| 576 | 566 | |
| 577 | 567 | // Video Interface |
| 578 | static UINT32 vi_width; | |
| 579 | UINT32 vi_origin; | |
| 580 | UINT32 vi_control; | |
| 581 | static UINT32 vi_burst, vi_vsync, vi_hsync, vi_leap, vi_hstart, vi_vstart; | |
| 582 | static UINT32 vi_intr, vi_vburst, vi_xscale, vi_yscale; | |
| 568 | UINT32 n64_vi_width; | |
| 569 | UINT32 n64_vi_origin; | |
| 570 | UINT32 n64_vi_control; | |
| 571 | static UINT32 n64_vi_burst, n64_vi_vsync, n64_vi_hsync, n64_vi_leap, n64_vi_hstart, n64_vi_vstart; | |
| 572 | static UINT32 n64_vi_intr, n64_vi_vburst, n64_vi_xscale, n64_vi_yscale; | |
| 583 | 573 | |
| 584 | 574 | READ32_HANDLER( n64_vi_reg_r ) |
| 585 | 575 | { |
| 586 | 576 | switch (offset) |
| 587 | 577 | { |
| 588 | 578 | case 0x04/4: // VI_ORIGIN_REG |
| 589 | ||
| 579 | return n64_vi_origin; | |
| 590 | 580 | |
| 591 | 581 | case 0x08/4: // VI_WIDTH_REG |
| 592 | ||
| 582 | return n64_vi_width; | |
| 593 | 583 | |
| 594 | 584 | case 0x0c/4: |
| 595 | ||
| 585 | return n64_vi_intr; | |
| 596 | 586 | |
| 597 | 587 | case 0x10/4: // VI_CURRENT_REG |
| 598 | 588 | return video_screen_get_vpos(0); |
| 599 | 589 | |
| 600 | 590 | case 0x14/4: // VI_BURST_REG |
| 601 | ||
| 591 | return n64_vi_burst; | |
| 602 | 592 | |
| 603 | 593 | case 0x18/4: // VI_V_SYNC_REG |
| 604 | ||
| 594 | return n64_vi_vsync; | |
| 605 | 595 | |
| 606 | 596 | case 0x1c/4: // VI_H_SYNC_REG |
| 607 | ||
| 597 | return n64_vi_hsync; | |
| 608 | 598 | |
| 609 | 599 | case 0x20/4: // VI_LEAP_REG |
| 610 | ||
| 600 | return n64_vi_leap; | |
| 611 | 601 | |
| 612 | 602 | case 0x24/4: // VI_H_START_REG |
| 613 | ||
| 603 | return n64_vi_hstart; | |
| 614 | 604 | |
| 615 | 605 | case 0x28/4: // VI_V_START_REG |
| 616 | ||
| 606 | return n64_vi_vstart; | |
| 617 | 607 | |
| 618 | 608 | case 0x2c/4: // VI_V_BURST_REG |
| 619 | ||
| 609 | return n64_vi_vburst; | |
| 620 | 610 | |
| 621 | 611 | case 0x30/4: // VI_X_SCALE_REG |
| 622 | ||
| 612 | return n64_vi_xscale; | |
| 623 | 613 | |
| 624 | 614 | case 0x34/4: // VI_Y_SCALE_REG |
| 625 | ||
| 615 | return n64_vi_yscale; | |
| 626 | 616 | |
| 627 | 617 | default: |
| 628 | 618 | logerror("vi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); |
| r1591 | r1592 | |
| 636 | 626 | switch (offset) |
| 637 | 627 | { |
| 638 | 628 | case 0x00/4: // VI_CONTROL_REG |
| 639 | ||
| 629 | if ((n64_vi_control & 0x40) != (data & 0x40)) | |
| 640 | 630 | { |
| 641 | 631 | screen_state *state = &Machine->screen[0]; |
| 642 | 632 | rectangle visarea = state->visarea; |
| 643 | 633 | visarea.max_y = (data & 0x40) ? 479 : 239; |
| 644 | 634 | video_screen_configure(0, state->width, visarea.max_y + 1, &visarea, Machine->screen[0].refresh); |
| 645 | 635 | } |
| 646 | ||
| 636 | n64_vi_control = data; | |
| 647 | 637 | break; |
| 648 | 638 | |
| 649 | 639 | case 0x04/4: // VI_ORIGIN_REG |
| 650 | ||
| 640 | n64_vi_origin = data & 0xffffff; | |
| 651 | 641 | break; |
| 652 | 642 | |
| 653 | 643 | case 0x08/4: // VI_WIDTH_REG |
| 654 | ||
| 644 | if (n64_vi_width != data && data > 0) | |
| 655 | 645 | { |
| 656 | 646 | screen_state *state = &Machine->screen[0]; |
| 657 | 647 | rectangle visarea = state->visarea; |
| 658 | 648 | visarea.max_x = data-1; |
| 659 | 649 | video_screen_configure(0, visarea.max_x + 1, state->height, &visarea, Machine->screen[0].refresh); |
| 660 | 650 | } |
| 661 | vi_width = data; | |
| 662 | fb_width = data; | |
| 651 | n64_vi_width = data; | |
| 652 | fb_width = data; | |
| 663 | 653 | break; |
| 664 | 654 | |
| 665 | 655 | case 0x0c/4: // VI_INTR_REG |
| 666 | ||
| 656 | n64_vi_intr = data; | |
| 667 | 657 | break; |
| 668 | 658 | |
| 669 | 659 | case 0x10/4: // VI_CURRENT_REG |
| r1591 | r1592 | |
| 671 | 661 | break; |
| 672 | 662 | |
| 673 | 663 | case 0x14/4: // VI_BURST_REG |
| 674 | ||
| 664 | n64_vi_burst = data; | |
| 675 | 665 | break; |
| 676 | 666 | |
| 677 | 667 | case 0x18/4: // VI_V_SYNC_REG |
| 678 | ||
| 668 | n64_vi_vsync = data; | |
| 679 | 669 | break; |
| 680 | 670 | |
| 681 | 671 | case 0x1c/4: // VI_H_SYNC_REG |
| 682 | ||
| 672 | n64_vi_hsync = data; | |
| 683 | 673 | break; |
| 684 | 674 | |
| 685 | 675 | case 0x20/4: // VI_LEAP_REG |
| 686 | ||
| 676 | n64_vi_leap = data; | |
| 687 | 677 | break; |
| 688 | 678 | |
| 689 | 679 | case 0x24/4: // VI_H_START_REG |
| 690 | ||
| 680 | n64_vi_hstart = data; | |
| 691 | 681 | break; |
| 692 | 682 | |
| 693 | 683 | case 0x28/4: // VI_V_START_REG |
| 694 | ||
| 684 | n64_vi_vstart = data; | |
| 695 | 685 | break; |
| 696 | 686 | |
| 697 | 687 | case 0x2c/4: // VI_V_BURST_REG |
| 698 | ||
| 688 | n64_vi_vburst = data; | |
| 699 | 689 | break; |
| 700 | 690 | |
| 701 | 691 | case 0x30/4: // VI_X_SCALE_REG |
| 702 | ||
| 692 | n64_vi_xscale = data; | |
| 703 | 693 | break; |
| 704 | 694 | |
| 705 | 695 | case 0x34/4: // VI_Y_SCALE_REG |
| 706 | ||
| 696 | n64_vi_yscale = data; | |
| 707 | 697 | break; |
| 708 | 698 | |
| 709 | 699 | /* |
| r1591 | r1592 | |
| 974 | 964 | int i; |
| 975 | 965 | UINT32 dma_length = (data + 1); |
| 976 | 966 | |
| 977 | | |
| 967 | | |
| 978 | 968 | { |
| 979 | 969 | dma_length = (dma_length + 3) & ~3; |
| 980 | } | |
| 970 | } | |
| 981 | 971 | |
| 982 | 972 | //mame_printf_debug("PI DMA: %08X to %08X, length %08X\n", pi_cart_addr, pi_dram_addr, dma_length); |
| 983 | 973 | |
| r1591 | r1592 | |
| 1570 | 1560 | audio_timer = timer_alloc(audio_timer_callback, NULL); |
| 1571 | 1561 | timer_adjust(audio_timer, attotime_never, 0, attotime_never); |
| 1572 | 1562 | |
| 1573 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1563 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1574 | 1564 | |
| 1575 | 1565 | // bootcode differs between CIC-chips, so we can use its checksum to detect the CIC-chip |
| 1576 | 1566 | boot_checksum = 0; |
| r1591 | r1592 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | DRIVER_INIT( stfight ) |
| 70 | 70 | { |
| 71 | | |
| 71 | DRIVER_INIT_CALL(empcity | |
| 72 | 72 | |
| 73 | 73 | /* patch out a tight loop during startup - is the code waiting */ |
| 74 | 74 | /* for NMI to wake it up? */ |
| r1591 | r1592 | |
| 101 | 101 | static TIMER_CALLBACK( stfight_interrupt_1 ) |
| 102 | 102 | { |
| 103 | 103 | // Do a RST08 |
| 104 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xcf); | |
| 104 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xcf); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | INTERRUPT_GEN( stfight_vb_interrupt ) |
| 108 | 108 | { |
| 109 | 109 | // Do a RST10 |
| 110 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xd7); | |
| 110 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xd7); | |
| 111 | 111 | timer_set(ATTOTIME_IN_HZ(120), NULL, 0, stfight_interrupt_1); |
| 112 | 112 | } |
| 113 | 113 |
| r1591 | r1592 | |
|---|---|---|
| 495 | 495 | { |
| 496 | 496 | if(josvolly_nmi_enable) |
| 497 | 497 | { |
| 498 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 498 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 499 | 499 | josvolly_nmi_enable = 0; |
| 500 | 500 | } |
| 501 | 501 | } |
| r1591 | r1592 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | static TIMER_CALLBACK( irq_off ) |
| 105 | 105 | { |
| 106 | cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 106 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| r1591 | r1592 | |
| 116 | 116 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, param + 64, 0), param + 64, attotime_zero); |
| 117 | 117 | |
| 118 | 118 | /* IRQ starts on scanline 0, 64, 128, etc. */ |
| 119 | cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 119 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 120 | 120 | |
| 121 | 121 | /* it will turn off on the next HBLANK */ |
| 122 | 122 | timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), NULL, 0, irq_off); |
| r1591 | r1592 | |
| 448 | 448 | /* apply the change */ |
| 449 | 449 | if (new_state && !(m6850_status & 0x80)) |
| 450 | 450 | { |
| 451 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 451 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 452 | 452 | m6850_status |= 0x80; |
| 453 | 453 | } |
| 454 | 454 | else if (!new_state && (m6850_status & 0x80)) |
| 455 | 455 | { |
| 456 | cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 456 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 457 | 457 | m6850_status &= ~0x80; |
| 458 | 458 | } |
| 459 | 459 | |
| r1591 | r1592 | |
| 466 | 466 | /* apply the change */ |
| 467 | 467 | if (new_state && !(m6850_sound_status & 0x80)) |
| 468 | 468 | { |
| 469 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 469 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 470 | 470 | m6850_sound_status |= 0x80; |
| 471 | 471 | } |
| 472 | 472 | else if (!new_state && (m6850_sound_status & 0x80)) |
| 473 | 473 | { |
| 474 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 474 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 475 | 475 | m6850_sound_status &= ~0x80; |
| 476 | 476 | } |
| 477 | 477 | } |
| r1591 | r1592 | |
| 756 | 756 | { |
| 757 | 757 | /* OUT on counter 2 is hooked to the /INT line on the Z80 */ |
| 758 | 758 | if (which == 2) |
| 759 | cpunum_set_input_line(1, 0, out ? ASSERT_LINE : CLEAR_LINE); | |
| 759 | cpunum_set_input_line(Machine, 1, 0, out ? ASSERT_LINE : CLEAR_LINE); | |
| 760 | 760 | |
| 761 | 761 | /* OUT on counter 0 is hooked to the GATE line on counter 1 */ |
| 762 | 762 | else if (which == 0) |
| r1591 | r1592 | |
|---|---|---|
| 314 | 314 | init_vsnes(machine); |
| 315 | 315 | |
| 316 | 316 | /* normal banking */ |
| 317 | | |
| 317 | DRIVER_INIT_CALL(vsnormal | |
| 318 | 318 | |
| 319 | 319 | /* extra ram at $6000 is enabled with bit 1 of $4016 */ |
| 320 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 321 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 320 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 321 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 322 | 322 | |
| 323 | 323 | /* now override the vidaccess callback */ |
| 324 | 324 | /* we need to remap color tables */ |
| r1591 | r1592 | |
| 466 | 466 | init_vsnes(machine); |
| 467 | 467 | |
| 468 | 468 | /* normal banking */ |
| 469 | | |
| 469 | DRIVER_INIT_CALL(vsnormal | |
| 470 | 470 | |
| 471 | 471 | /* now override the vidaccess callback */ |
| 472 | 472 | remapped_colortable = rp2c04001_colortable; |
| r1591 | r1592 | |
| 682 | 682 | init_vsnes(machine); |
| 683 | 683 | |
| 684 | 684 | /* normal banking */ |
| 685 | | |
| 685 | DRIVER_INIT_CALL(vsnormal | |
| 686 | 686 | |
| 687 | 687 | /* now override the vidaccess callback */ |
| 688 | 688 | /* we need to remap color tables */ |
| r1591 | r1592 | |
| 696 | 696 | init_vsnes(machine); |
| 697 | 697 | |
| 698 | 698 | /* normal banking */ |
| 699 | | |
| 699 | DRIVER_INIT_CALL(vsnormal | |
| 700 | 700 | |
| 701 | 701 | /* now override the vidaccess callback */ |
| 702 | 702 | /* we need to remap color tables */ |
| r1591 | r1592 | |
| 715 | 715 | init_vsnes(machine); |
| 716 | 716 | |
| 717 | 717 | /* normal banking */ |
| 718 | | |
| 718 | DRIVER_INIT_CALL(vsnormal | |
| 719 | 719 | |
| 720 | 720 | /* now override the vidaccess callback */ |
| 721 | 721 | /* we need to remap color tables */ |
| r1591 | r1592 | |
| 841 | 841 | if (IRQ_count == 0) |
| 842 | 842 | { |
| 843 | 843 | IRQ_count = IRQ_count_latch; |
| 844 | cpunum_set_input_line (0, 0, HOLD_LINE); | |
| 844 | cpunum_set_input_line (Machine, 0, 0, HOLD_LINE); | |
| 845 | 845 | } |
| 846 | 846 | IRQ_count --; |
| 847 | 847 | } |
| r1591 | r1592 | |
| 967 | 967 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mapper4_w ); |
| 968 | 968 | |
| 969 | 969 | /* extra ram at $6000-$7fff */ |
| 970 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 971 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 970 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 971 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 972 | 972 | |
| 973 | 973 | /* common init */ |
| 974 | 974 | init_vsnes(machine); |
| r1591 | r1592 | |
| 1009 | 1009 | |
| 1010 | 1010 | DRIVER_INIT( rbibb ) |
| 1011 | 1011 | { |
| 1012 | | |
| 1012 | DRIVER_INIT_CALL(MMC3 | |
| 1013 | 1013 | |
| 1014 | 1014 | /* RBI Base ball hack */ |
| 1015 | 1015 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, rbi_hack_r) ; |
| r1591 | r1592 | |
| 1059 | 1059 | |
| 1060 | 1060 | DRIVER_INIT( supxevs ) |
| 1061 | 1061 | { |
| 1062 | | |
| 1062 | DRIVER_INIT_CALL(MMC3 | |
| 1063 | 1063 | |
| 1064 | 1064 | /* Vs. Super Xevious Protection */ |
| 1065 | 1065 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x54ff, 0x54ff, 0, 0, supxevs_read_prot_1_r ); |
| r1591 | r1592 | |
| 1094 | 1094 | |
| 1095 | 1095 | DRIVER_INIT( tkoboxng ) |
| 1096 | 1096 | { |
| 1097 | | |
| 1097 | DRIVER_INIT_CALL(MMC3 | |
| 1098 | 1098 | |
| 1099 | 1099 | /* security device at $5e00-$5e01 */ |
| 1100 | 1100 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, tko_security_r ); |
| r1591 | r1592 | |
| 1109 | 1109 | |
| 1110 | 1110 | DRIVER_INIT( vsfdf ) |
| 1111 | 1111 | { |
| 1112 | | |
| 1112 | DRIVER_INIT_CALL(MMC3 | |
| 1113 | 1113 | |
| 1114 | 1114 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r ); |
| 1115 | 1115 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_w ); |
| r1591 | r1592 | |
| 1176 | 1176 | static WRITE8_HANDLER ( set_bnglngby_irq_w ) |
| 1177 | 1177 | { |
| 1178 | 1178 | ret = data; |
| 1179 | cpunum_set_input_line( 0, 0, ( data & 2 ) ? ASSERT_LINE : CLEAR_LINE ); | |
| 1179 | cpunum_set_input_line(Machine, 0, 0, ( data & 2 ) ? ASSERT_LINE : CLEAR_LINE ); | |
| 1180 | 1180 | /* other values ??? */ |
| 1181 | 1181 | /* 0, 4, 84 */ |
| 1182 | 1182 | } |
| r1591 | r1592 | |
| 1192 | 1192 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0231, 0x0231, 0, 0, set_bnglngby_irq_w ); |
| 1193 | 1193 | |
| 1194 | 1194 | /* extra ram */ |
| 1195 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 1196 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 1195 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 1196 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 1197 | 1197 | |
| 1198 | 1198 | ret = 0; |
| 1199 | 1199 | |
| r1591 | r1592 | |
| 1201 | 1201 | init_vsnes(machine); |
| 1202 | 1202 | |
| 1203 | 1203 | /* normal banking */ |
| 1204 | | |
| 1204 | DRIVER_INIT_CALL(vsnormal | |
| 1205 | 1205 | |
| 1206 | 1206 | remapped_colortable = rp2c04002_colortable; |
| 1207 | 1207 | } |
| r1591 | r1592 | |
| 1229 | 1229 | init_vsnes(machine); |
| 1230 | 1230 | |
| 1231 | 1231 | /* normal banking */ |
| 1232 | | |
| 1232 | DRIVER_INIT_CALL(vsnormal | |
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 1235 | /***********************************************************************/ |
| r1591 | r1592 | |
| 1263 | 1263 | ppu2c0x_set_videorom_bank( cpu_getactivecpu(), 0, 8, ( data & 4 ) ? 1 : 0, 512 ); |
| 1264 | 1264 | |
| 1265 | 1265 | /* bit 1 ( data & 2 ) triggers irq on the other cpu */ |
| 1266 | cpunum_set_input_line( other_cpu, 0, ( data & 2 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 1266 | cpunum_set_input_line(Machine, other_cpu, 0, ( data & 2 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 1267 | 1267 | |
| 1268 | 1268 | /* move along */ |
| 1269 | 1269 | if ( cpu_getactivecpu() == 0 ) |
| r1591 | r1592 | |
| 1294 | 1294 | { |
| 1295 | 1295 | /* only differance between this and vstennis is the colors */ |
| 1296 | 1296 | |
| 1297 | | |
| 1297 | DRIVER_INIT_CALL(vstennis | |
| 1298 | 1298 | remapped_colortable = rp2c04002_colortable; |
| 1299 | 1299 | } |
| 1300 | 1300 | |
| r1591 | r1592 | |
| 1305 | 1305 | { |
| 1306 | 1306 | /* only differance between this and vstennis is the colors */ |
| 1307 | 1307 | |
| 1308 | | |
| 1308 | DRIVER_INIT_CALL(vstennis | |
| 1309 | 1309 | |
| 1310 | 1310 | remapped_colortable = rp2c04003_colortable; |
| 1311 | 1311 | } |
| r1591 | r1592 | |
| 1318 | 1318 | { |
| 1319 | 1319 | /* only differance between this and vstennis is the colors */ |
| 1320 | 1320 | |
| 1321 | | |
| 1321 | DRIVER_INIT_CALL(vstennis | |
| 1322 | 1322 | |
| 1323 | 1323 | remapped_colortable = rp2c04001_colortable; |
| 1324 | 1324 | |
| r1591 | r1592 | |
| 1332 | 1332 | { |
| 1333 | 1333 | /* only differance between this and vstennis is the colors */ |
| 1334 | 1334 | |
| 1335 | | |
| 1335 | DRIVER_INIT_CALL(vstennis | |
| 1336 | 1336 | |
| 1337 | 1337 | remapped_colortable = rp2c05004_colortable; |
| 1338 | 1338 | |
| r1591 | r1592 | |
| 1343 | 1343 | DRIVER_INIT( btlecity ) |
| 1344 | 1344 | { |
| 1345 | 1345 | init_vsnes(machine); |
| 1346 | | |
| 1346 | DRIVER_INIT_CALL(vsnormal | |
| 1347 | 1347 | remapped_colortable = rp2c04003_colortable; |
| 1348 | 1348 | } |
| 1349 | 1349 | |
| r1591 | r1592 | |
| 1352 | 1352 | DRIVER_INIT( vstetris ) |
| 1353 | 1353 | { |
| 1354 | 1354 | /* extra ram at $6000 is enabled with bit 1 of $4016 */ |
| 1355 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_RAM ); | |
| 1356 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MWA8_RAM ); | |
| 1355 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1 ); | |
| 1356 | memory_set_bankptr(1, auto_malloc(0x2000)); | |
| 1357 | 1357 | |
| 1358 | 1358 | init_vsnes(machine); |
| 1359 | | |
| 1359 | DRIVER_INIT_CALL(vsnormal | |
| 1360 | 1360 | remapped_colortable = rp2c04003_colortable; |
| 1361 | 1361 | } |
| r1591 | r1592 | |
|---|---|---|
| 299 | 299 | |
| 300 | 300 | WRITE8_HANDLER( qix_data_firq_w ) |
| 301 | 301 | { |
| 302 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 302 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| 306 | 306 | WRITE8_HANDLER( qix_data_firq_ack_w ) |
| 307 | 307 | { |
| 308 | cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 308 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | |
| 312 | 312 | READ8_HANDLER( qix_data_firq_r ) |
| 313 | 313 | { |
| 314 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 314 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 315 | 315 | return 0xff; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | READ8_HANDLER( qix_data_firq_ack_r ) |
| 320 | 320 | { |
| 321 | cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 321 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 322 | 322 | return 0xff; |
| 323 | 323 | } |
| 324 | 324 | |
| r1591 | r1592 | |
| 332 | 332 | |
| 333 | 333 | WRITE8_HANDLER( qix_video_firq_w ) |
| 334 | 334 | { |
| 335 | cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 335 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | |
| 339 | 339 | WRITE8_HANDLER( qix_video_firq_ack_w ) |
| 340 | 340 | { |
| 341 | cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 341 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | |
| 345 | 345 | READ8_HANDLER( qix_video_firq_r ) |
| 346 | 346 | { |
| 347 | cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 347 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 348 | 348 | return 0xff; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | |
| 352 | 352 | READ8_HANDLER( qix_video_firq_ack_r ) |
| 353 | 353 | { |
| 354 | cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 354 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 355 | 355 | return 0xff; |
| 356 | 356 | } |
| 357 | 357 | |
| r1591 | r1592 | |
| 385 | 385 | |
| 386 | 386 | static void qix_pia_dint(int state) |
| 387 | 387 | { |
| 388 | int combined_state = pia_get_irq_a(3) | pia_get_irq_b(3); | |
| 389 | ||
| 388 | 390 | /* DINT is connected to the data CPU's IRQ line */ |
| 389 | cpunum_set_input_line(0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 391 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 390 | 392 | } |
| 391 | 393 | |
| 392 | 394 | |
| 393 | 395 | static void qix_pia_sint(int state) |
| 394 | 396 | { |
| 397 | int combined_state = pia_get_irq_a(4) | pia_get_irq_b(4); | |
| 398 | ||
| 395 | 399 | /* SINT is connected to the sound CPU's IRQ line */ |
| 396 | cpunum_set_input_line(2, M6802_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 400 | cpunum_set_input_line(Machine, 2, M6802_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 397 | 401 | } |
| 398 | 402 | |
| 399 | 403 | |
| r1591 | r1592 | |
| 424 | 428 | { |
| 425 | 429 | if (!(data & 0x04)) |
| 426 | 430 | { |
| 427 | cpunum_set_input_line(3, M68705_IRQ_LINE, ASSERT_LINE); | |
| 431 | cpunum_set_input_line(Machine, 3, M68705_IRQ_LINE, ASSERT_LINE); | |
| 428 | 432 | /* temporarily boost the interleave to sync things up */ |
| 429 | 433 | /* note: I'm using 50 because 30 is not enough for space dungeon at game over */ |
| 430 | 434 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); |
| 431 | 435 | } |
| 432 | 436 | else |
| 433 | cpunum_set_input_line(3, M68705_IRQ_LINE, CLEAR_LINE); | |
| 437 | cpunum_set_input_line(Machine, 3, M68705_IRQ_LINE, CLEAR_LINE); | |
| 434 | 438 | |
| 435 | 439 | /* this is a callback called by pia_0_w(), so I don't need to synchronize */ |
| 436 | 440 | /* the CPUs - they have already been synchronized by qix_pia_0_w() */ |
| r1591 | r1592 | |
|---|---|---|
| 20 | 20 | */ |
| 21 | 21 | WRITE8_HANDLER( mexico86_f008_w ) |
| 22 | 22 | { |
| 23 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); | |
| 23 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); | |
| 24 | 24 | if (Machine->drv->cpu[2].type != CPU_DUMMY) |
| 25 | 25 | { |
| 26 | 26 | // mexico 86, knight boy |
| 27 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); | |
| 27 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); | |
| 28 | 28 | } |
| 29 | 29 | else |
| 30 | 30 | { |
| r1591 | r1592 | |
| 156 | 156 | mcu_simulate(); |
| 157 | 157 | |
| 158 | 158 | cpunum_set_input_line_vector(0,0,mexico86_protection_ram[0]); |
| 159 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 159 | cpunum_set_input_line(machine, 0,0,HOLD_LINE); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| r1591 | r1592 | |
| 223 | 223 | { |
| 224 | 224 | /* I don't know how to handle the interrupt line so I just toggle it every time. */ |
| 225 | 225 | if (cpu_getiloops() & 1) |
| 226 | cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 226 | cpunum_set_input_line(machine, 2,0,CLEAR_LINE); | |
| 227 | 227 | else |
| 228 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 228 | cpunum_set_input_line(machine, 2,0,ASSERT_LINE); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| r1591 | r1592 | |
| 313 | 313 | if ((ddrB & 0x20) && (data & 0x20) && (~portB_out & 0x20)) |
| 314 | 314 | { |
| 315 | 315 | cpunum_set_input_line_vector(0,0,mexico86_protection_ram[0]); |
| 316 | //cpunum_set_input_line(0,0,PULSE_LINE); | |
| 317 | cpunum_set_input_line(0, 0, HOLD_LINE); //AT: HOLD_LINE works better in Z80 interrupt mode 1. | |
| 316 | //cpunum_set_input_line(Machine, 0,0,PULSE_LINE); | |
| 317 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); //AT: HOLD_LINE works better in Z80 interrupt mode 1. | |
| 318 | 318 | } |
| 319 | 319 | if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40)) |
| 320 | 320 | { |
| r1591 | r1592 | |
|---|---|---|
| 79 | 79 | static TIMER_CALLBACK( snes_nmi_tick ) |
| 80 | 80 | { |
| 81 | 81 | // pull NMI |
| 82 | cpunum_set_input_line( 0, G65816_LINE_NMI, HOLD_LINE ); | |
| 82 | cpunum_set_input_line(machine, 0, G65816_LINE_NMI, HOLD_LINE ); | |
| 83 | 83 | |
| 84 | 84 | // don't happen again |
| 85 | 85 | timer_adjust(snes_nmi_timer, attotime_never, 0, attotime_never); |
| r1591 | r1592 | |
| 91 | 91 | // (don't need to switch to the 65816 context, we don't do anything dependant on it) |
| 92 | 92 | snes_latch_counters(); |
| 93 | 93 | snes_ram[TIMEUP] = 0x80; /* Indicate that irq occured */ |
| 94 | cpunum_set_input_line( 0, G65816_LINE_IRQ, HOLD_LINE ); | |
| 94 | cpunum_set_input_line(Machine, 0, G65816_LINE_IRQ, HOLD_LINE ); | |
| 95 | 95 | |
| 96 | 96 | // don't happen again |
| 97 | 97 | timer_adjust(snes_hirq_timer, attotime_never, 0, attotime_never); |
| r1591 | r1592 | |
| 121 | 121 | snes_ram[TIMEUP] = 0x80; /* Indicate that irq occured */ |
| 122 | 122 | // IRQ latches the counters, do it now |
| 123 | 123 | snes_latch_counters(); |
| 124 | cpunum_set_input_line( 0, G65816_LINE_IRQ, HOLD_LINE ); | |
| 124 | cpunum_set_input_line(machine, 0, G65816_LINE_IRQ, HOLD_LINE ); | |
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | /* Horizontal IRQ timer */ |
| r1591 | r1592 | |
| 224 | 224 | snes_ram[STAT77] &= 0x3f; /* Clear Time Over and Range Over bits */ |
| 225 | 225 | snes_ram[STAT78] ^= 0x80; /* Toggle field flag */ |
| 226 | 226 | |
| 227 | cpunum_set_input_line( 0, G65816_LINE_NMI, CLEAR_LINE ); | |
| 227 | cpunum_set_input_line(machine, 0, G65816_LINE_NMI, CLEAR_LINE ); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | cpuintrf_pop_context(); |
| r1591 | r1592 | |
| 1452 | 1452 | case MEMSEL: /* Access cycle designation in memory (2) area */ |
| 1453 | 1453 | /* FIXME: Need to adjust the speed only during access of banks 0x80+ |
| 1454 | 1454 | * Currently we are just increasing it no matter what */ |
| 1455 | // cpunum_set_clockscale( 0, (data & 0x1) ? 1.335820896 : 1.0 ); | |
| 1455 | // cpunum_set_clockscale(Machine, 0, (data & 0x1) ? 1.335820896 : 1.0 ); | |
| 1456 | 1456 | #ifdef SNES_DBG_REG_W |
| 1457 | 1457 | if( (data & 0x1) != (snes_ram[MEMSEL] & 0x1) ) |
| 1458 | 1458 | mame_printf_debug( "CPU speed: %f Mhz\n", (data & 0x1) ? 3.58 : 2.68 ); |
| r1591 | r1592 | |
|---|---|---|
| 57 | 57 | zready = 0; |
| 58 | 58 | busreq = 0; |
| 59 | 59 | if (machine->drv->cpu[2].type != CPU_DUMMY) |
| 60 | cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 60 | cpunum_set_input_line(machine, 2,0,CLEAR_LINE); | |
| 61 | 61 | |
| 62 | 62 | spacecr_prot_value = 0; |
| 63 | 63 | } |
| r1591 | r1592 | |
| 116 | 116 | static TIMER_CALLBACK( taitosj_mcu_real_data_w ) |
| 117 | 117 | { |
| 118 | 118 | zready = 1; |
| 119 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 119 | cpunum_set_input_line(machine, 2,0,ASSERT_LINE); | |
| 120 | 120 | fromz80 = param; |
| 121 | 121 | } |
| 122 | 122 | |
| r1591 | r1592 | |
| 202 | 202 | { |
| 203 | 203 | /* 68705 is going to read data from the Z80 */ |
| 204 | 204 | timer_call_after_resynch(NULL, 0,taitosj_mcu_data_real_r); |
| 205 | cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 205 | cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 206 | 206 | portA_in = fromz80; |
| 207 | 207 | LOG(("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in)); |
| 208 | 208 | } |
| r1591 | r1592 | |
|---|---|---|
| 426 | 426 | |
| 427 | 427 | /* set the highest IRQ line */ |
| 428 | 428 | if (irq >= 0) |
| 429 | cpunum_set_input_line(0, irq, ASSERT_LINE); | |
| 429 | cpunum_set_input_line(Machine, 0, irq, ASSERT_LINE); | |
| 430 | 430 | else |
| 431 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 431 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | static TIMER_CALLBACK( amiga_irq_proc ) |
| r1591 | r1592 | |
|---|---|---|
| 76 | 76 | static void update_irq(void) |
| 77 | 77 | { |
| 78 | 78 | if (irq_state < 7) |
| 79 | cpunum_set_input_line(0, irq_state ^ 7, CLEAR_LINE); | |
| 79 | cpunum_set_input_line(Machine, 0, irq_state ^ 7, CLEAR_LINE); | |
| 80 | 80 | |
| 81 | 81 | irq_state = TTL74148_output_r(0); |
| 82 | 82 | |
| 83 | 83 | if (irq_state < 7) |
| 84 | cpunum_set_input_line(0, irq_state ^ 7, ASSERT_LINE); | |
| 84 | cpunum_set_input_line(Machine, 0, irq_state ^ 7, ASSERT_LINE); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static void update_irq_encoder(int line, int state) |
| r1591 | r1592 | |
| 100 | 100 | static void v_irq3_w(int level) |
| 101 | 101 | { |
| 102 | 102 | if (level) |
| 103 | cpunum_set_input_line(1, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 103 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 104 | 104 | |
| 105 | 105 | update_irq_encoder(INPUT_LINE_IRQ3, level); |
| 106 | 106 | } |
| r1591 | r1592 | |
| 153 | 153 | { |
| 154 | 154 | /* Reset sound cpu */ |
| 155 | 155 | if ((data & 2) == 0) |
| 156 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 156 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 157 | 157 | else |
| 158 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 158 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static TIMER_CALLBACK( sound_command_w ) |
| 162 | 162 | { |
| 163 | 163 | exidy440_sound_command = param; |
| 164 | 164 | exidy440_sound_command_ack = 0; |
| 165 | cpunum_set_input_line(1, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 165 | cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 166 | 166 | |
| 167 | 167 | /* It is important that the sound cpu ACKs the sound command |
| 168 | 168 | quickly. Otherwise the main CPU gives up with sound. Boosting |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) |
| 68 | 68 | { |
| 69 | 69 | portA_in = from_main; |
| 70 | if (main_sent) cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 70 | if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 71 | 71 | main_sent = 0; |
| 72 | 72 | logerror("read command %02x from main cpu\n",portA_in); |
| 73 | 73 | } |
| r1591 | r1592 | |
| 115 | 115 | logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); |
| 116 | 116 | from_main = data; |
| 117 | 117 | main_sent = 1; |
| 118 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 118 | cpunum_set_input_line(Machine, 2,0,ASSERT_LINE); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | READ8_HANDLER( lkage_mcu_r ) |
| r1591 | r1592 | |
|---|---|---|
| 413 | 413 | { |
| 414 | 414 | case 0: |
| 415 | 415 | /* Master */ |
| 416 | cpunum_set_input_line(0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); | |
| 416 | cpunum_set_input_line(Machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); | |
| 417 | 417 | break; |
| 418 | 418 | |
| 419 | 419 | case 1: |
| r1591 | r1592 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | void atarigen_update_interrupts(void) |
| 160 | 160 | { |
| 161 | (*update_int_callback)(); | |
| 161 | (*update_int_callback)(Machine); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| r1591 | r1592 | |
| 182 | 182 | INTERRUPT_GEN( atarigen_scanline_int_gen ) |
| 183 | 183 | { |
| 184 | 184 | atarigen_scanline_int_state = 1; |
| 185 | (*update_int_callback)(); | |
| 185 | (*update_int_callback)(machine); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | |
| r1591 | r1592 | |
| 194 | 194 | WRITE16_HANDLER( atarigen_scanline_int_ack_w ) |
| 195 | 195 | { |
| 196 | 196 | atarigen_scanline_int_state = 0; |
| 197 | (*update_int_callback)(); | |
| 197 | (*update_int_callback)(Machine); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | WRITE32_HANDLER( atarigen_scanline_int_ack32_w ) |
| 201 | 201 | { |
| 202 | 202 | atarigen_scanline_int_state = 0; |
| 203 | (*update_int_callback)(); | |
| 203 | (*update_int_callback)(Machine); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | |
| r1591 | r1592 | |
| 212 | 212 | INTERRUPT_GEN( atarigen_sound_int_gen ) |
| 213 | 213 | { |
| 214 | 214 | atarigen_sound_int_state = 1; |
| 215 | (*update_int_callback)(); | |
| 215 | (*update_int_callback)(machine); | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
| r1591 | r1592 | |
| 224 | 224 | WRITE16_HANDLER( atarigen_sound_int_ack_w ) |
| 225 | 225 | { |
| 226 | 226 | atarigen_sound_int_state = 0; |
| 227 | (*update_int_callback)(); | |
| 227 | (*update_int_callback)(Machine); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | WRITE32_HANDLER( atarigen_sound_int_ack32_w ) |
| 231 | 231 | { |
| 232 | 232 | atarigen_sound_int_state = 0; |
| 233 | (*update_int_callback)(); | |
| 233 | (*update_int_callback)(Machine); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| r1591 | r1592 | |
| 242 | 242 | INTERRUPT_GEN( atarigen_video_int_gen ) |
| 243 | 243 | { |
| 244 | 244 | atarigen_video_int_state = 1; |
| 245 | (*update_int_callback)(); | |
| 245 | (*update_int_callback)(machine); | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
| r1591 | r1592 | |
| 254 | 254 | WRITE16_HANDLER( atarigen_video_int_ack_w ) |
| 255 | 255 | { |
| 256 | 256 | atarigen_video_int_state = 0; |
| 257 | (*update_int_callback)(); | |
| 257 | (*update_int_callback)(Machine); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | WRITE32_HANDLER( atarigen_video_int_ack32_w ) |
| 261 | 261 | { |
| 262 | 262 | atarigen_video_int_state = 0; |
| 263 | (*update_int_callback)(); | |
| 263 | (*update_int_callback)(Machine); | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
| r1591 | r1592 | |
| 362 | 362 | |
| 363 | 363 | |
| 364 | 364 | /*--------------------------------------------------------------- |
| 365 | | |
| 365 | NVRAM_HANDLER( a | |
| 366 | 366 | ---------------------------------------------------------------*/ |
| 367 | 367 | |
| 368 | 368 | NVRAM_HANDLER( atarigen ) |
| r1591 | r1592 | |
| 693 | 693 | READ8_HANDLER( atarigen_6502_sound_r ) |
| 694 | 694 | { |
| 695 | 695 | atarigen_cpu_to_sound_ready = 0; |
| 696 | cpunum_set_input_line(sound_cpu_num, INPUT_LINE_NMI, CLEAR_LINE); | |
| 696 | cpunum_set_input_line(Machine, sound_cpu_num, INPUT_LINE_NMI, CLEAR_LINE); | |
| 697 | 697 | return atarigen_cpu_to_sound; |
| 698 | 698 | } |
| 699 | 699 | |
| r1591 | r1592 | |
| 708 | 708 | void update_6502_irq(void) |
| 709 | 709 | { |
| 710 | 710 | if (timed_int || ym2151_int) |
| 711 | cpunum_set_input_line(sound_cpu_num, M6502_IRQ_LINE, ASSERT_LINE); | |
| 711 | cpunum_set_input_line(Machine, sound_cpu_num, M6502_IRQ_LINE, ASSERT_LINE); | |
| 712 | 712 | else |
| 713 | cpunum_set_input_line(sound_cpu_num, M6502_IRQ_LINE, CLEAR_LINE); | |
| 713 | cpunum_set_input_line(Machine, sound_cpu_num, M6502_IRQ_LINE, CLEAR_LINE); | |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | |
| r1591 | r1592 | |
| 724 | 724 | /* unhalt and reset the sound CPU */ |
| 725 | 725 | if (param == 0) |
| 726 | 726 | { |
| 727 | cpunum_set_input_line(sound_cpu_num, INPUT_LINE_HALT, CLEAR_LINE); | |
| 728 | cpunum_set_input_line(sound_cpu_num, INPUT_LINE_RESET, PULSE_LINE); | |
| 727 | cpunum_set_input_line(machine, sound_cpu_num, INPUT_LINE_HALT, CLEAR_LINE); | |
| 728 | cpunum_set_input_line(machine, sound_cpu_num, INPUT_LINE_RESET, PULSE_LINE); | |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | /* reset the sound write state */ |
| r1591 | r1592 | |
| 752 | 752 | /* set up the states and signal an NMI to the sound CPU */ |
| 753 | 753 | atarigen_cpu_to_sound = param; |
| 754 | 754 | atarigen_cpu_to_sound_ready = 1; |
| 755 | cpunum_set_input_line(sound_cpu_num, INPUT_LINE_NMI, ASSERT_LINE); | |
| 755 | cpunum_set_input_line(machine, sound_cpu_num, INPUT_LINE_NMI, ASSERT_LINE); | |
| 756 | 756 | |
| 757 | 757 | /* allocate a high frequency timer until a response is generated */ |
| 758 | 758 | /* the main CPU is *very* sensistive to the timing of the response */ |
| r1591 | r1592 | |
| 1311 | 1311 | /* halt and set a timer to wake up */ |
| 1312 | 1312 | fraction = (double)(hblank - hpos) / (double)Machine->screen[0].width; |
| 1313 | 1313 | timer_set(double_to_attotime(attotime_to_double(video_screen_get_scan_period(0)) * fraction), NULL, 0, unhalt_cpu); |
| 1314 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1314 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1315 | 1315 | } |
| 1316 | 1316 | |
| 1317 | 1317 | |
| r1591 | r1592 | |
| 1399 | 1399 | |
| 1400 | 1400 | static TIMER_CALLBACK( unhalt_cpu ) |
| 1401 | 1401 | { |
| 1402 | cpunum_set_input_line(param, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1402 | cpunum_set_input_line(machine, param, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1403 | 1403 | } |
| 1404 | 1404 | |
| 1405 | 1405 |
| r1591 | r1592 | |
|---|---|---|
| 28 | 28 | TYPES & STRUCTURES |
| 29 | 29 | ***************************************************************************/ |
| 30 | 30 | |
| 31 | typedef void (*atarigen_int_callback)( | |
| 31 | typedef void (*atarigen_int_callback)(running_machine *machine); | |
| 32 | 32 | |
| 33 | 33 | typedef void (*atarigen_scanline_callback)(running_machine *machine, int scrnum, int scanline); |
| 34 | 34 |
| r1591 | r1592 | |
|---|---|---|
| 251 | 251 | { |
| 252 | 252 | /* only signal if not in loopback state */ |
| 253 | 253 | if (uart[1] != 0x66) |
| 254 | cpunum_set_input_line(0, 1, state ? ASSERT_LINE : CLEAR_LINE); | |
| 254 | cpunum_set_input_line(Machine, 0, 1, state ? ASSERT_LINE : CLEAR_LINE); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | |
| r1591 | r1592 | |
| 624 | 624 | |
| 625 | 625 | MACHINE_RESET( midxunit ) |
| 626 | 626 | { |
| 627 | | |
| 627 | MACHINE_RESET_CALL(midwunit | |
| 628 | 628 | dcs_set_io_callbacks(midxunit_dcs_output_full, NULL); |
| 629 | 629 | } |
| 630 | 630 |
| r1591 | r1592 | |
|---|---|---|
| 74 | 74 | static void |
| 75 | 75 | ResetAllSubCPUs( int state ) |
| 76 | 76 | { |
| 77 | cpunum_set_input_line(CPU_SLAVE, INPUT_LINE_RESET, state); | |
| 78 | cpunum_set_input_line(CPU_MCU, INPUT_LINE_RESET, state); | |
| 77 | cpunum_set_input_line(Machine, CPU_SLAVE, INPUT_LINE_RESET, state); | |
| 78 | cpunum_set_input_line(Machine, CPU_MCU, INPUT_LINE_RESET, state); | |
| 79 | 79 | switch( namcos2_gametype ) |
| 80 | 80 | { |
| 81 | 81 | case NAMCOS21_SOLVALOU: |
| 82 | 82 | case NAMCOS21_STARBLADE: |
| 83 | 83 | case NAMCOS21_AIRCOMBAT: |
| 84 | 84 | case NAMCOS21_CYBERSLED: |
| 85 | cpunum_set_input_line(4,INPUT_LINE_RESET,state); /* MASTER DSP */ | |
| 86 | cpunum_set_input_line(5,INPUT_LINE_RESET,state); /* SLAVE DSP */ | |
| 85 | cpunum_set_input_line(Machine, 4,INPUT_LINE_RESET,state); /* MASTER DSP */ | |
| 86 | cpunum_set_input_line(Machine, 5,INPUT_LINE_RESET,state); /* SLAVE DSP */ | |
| 87 | 87 | break; |
| 88 | 88 | |
| 89 | 89 | // case NAMCOS21_WINRUN91: |
| r1591 | r1592 | |
| 100 | 100 | /* Initialise the bank select in the sound CPU */ |
| 101 | 101 | namcos2_sound_bankselect_w(0,0); /* Page in bank 0 */ |
| 102 | 102 | |
| 103 | cpunum_set_input_line(CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 103 | cpunum_set_input_line(machine, CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 104 | 104 | |
| 105 | 105 | /* Place CPU2 & CPU3 into the reset condition */ |
| 106 | 106 | ResetAllSubCPUs( ASSERT_LINE ); |
| r1591 | r1592 | |
| 510 | 510 | case 0x1d0000: |
| 511 | 511 | if( bWrite ) |
| 512 | 512 | { |
| 513 | cpunum_set_input_line(altCPU, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE); | |
| 514 | } cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_0], CLEAR_LINE); | |
| 513 | cpunum_set_input_line(Machine, altCPU, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE); | |
| 514 | } cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_0], CLEAR_LINE); | |
| 515 | 515 | break; |
| 516 | 516 | |
| 517 | 517 | case 0x1d2000: |
| 518 | cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_1], CLEAR_LINE); | |
| 518 | cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_1], CLEAR_LINE); | |
| 519 | 519 | break; |
| 520 | 520 | |
| 521 | 521 | case 0x1d4000: |
| 522 | 522 | if( bWrite ) |
| 523 | 523 | { |
| 524 | cpunum_set_input_line(altCPU, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE); | |
| 524 | cpunum_set_input_line(Machine, altCPU, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE); | |
| 525 | 525 | } |
| 526 | cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_2], CLEAR_LINE); | |
| 526 | cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_2], CLEAR_LINE); | |
| 527 | 527 | break; |
| 528 | 528 | |
| 529 | 529 | case 0x1d6000: |
| r1591 | r1592 | |
| 531 | 531 | { |
| 532 | 532 | // mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data ); |
| 533 | 533 | } |
| 534 | cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_CPUIRQ], CLEAR_LINE); | |
| 534 | cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_CPUIRQ], CLEAR_LINE); | |
| 535 | 535 | break; |
| 536 | 536 | |
| 537 | 537 | case 0x1d8000: /* ack EXIRQ */ |
| r1591 | r1592 | |
| 539 | 539 | { |
| 540 | 540 | // mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data ); |
| 541 | 541 | } |
| 542 | cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_EXIRQ], CLEAR_LINE); | |
| 542 | cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_EXIRQ], CLEAR_LINE); | |
| 543 | 543 | break; |
| 544 | 544 | |
| 545 | 545 | case 0x1da000: /* ack POSIRQ */ |
| r1591 | r1592 | |
| 547 | 547 | { |
| 548 | 548 | // mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data ); |
| 549 | 549 | } |
| 550 | cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_POSIRQ], CLEAR_LINE); | |
| 550 | cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_POSIRQ], CLEAR_LINE); | |
| 551 | 551 | break; |
| 552 | 552 | |
| 553 | 553 | case 0x1dc000: /* ack SCIRQ */ |
| r1591 | r1592 | |
| 555 | 555 | { |
| 556 | 556 | // mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data ); |
| 557 | 557 | } |
| 558 | cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_SERIRQ], CLEAR_LINE); | |
| 558 | cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_SERIRQ], CLEAR_LINE); | |
| 559 | 559 | break; |
| 560 | 560 | |
| 561 | 561 | case 0x1de000: /* ack VBLANK */ |
| 562 | cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_VBLANKIRQ], CLEAR_LINE); | |
| 562 | cpunum_set_input_line(Machine, cpu, pC148Reg[NAMCOS2_C148_VBLANKIRQ], CLEAR_LINE); | |
| 563 | 563 | break; |
| 564 | 564 | |
| 565 | 565 | case 0x1e0000: /* EEPROM Status Register */ |
| r1591 | r1592 | |
| 572 | 572 | if( data&0x01 ) |
| 573 | 573 | { |
| 574 | 574 | /* Resume execution */ |
| 575 | cpunum_set_input_line(CPU_SOUND, INPUT_LINE_RESET, CLEAR_LINE); | |
| 575 | cpunum_set_input_line(Machine, CPU_SOUND, INPUT_LINE_RESET, CLEAR_LINE); | |
| 576 | 576 | cpu_yield(); |
| 577 | 577 | } |
| 578 | 578 | else |
| 579 | 579 | { |
| 580 | 580 | /* Suspend execution */ |
| 581 | cpunum_set_input_line(CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE); | |
| 581 | cpunum_set_input_line(Machine, CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE); | |
| 582 | 582 | } |
| 583 | 583 | if( IsSystem21() ) |
| 584 | 584 | { |
| r1591 | r1592 | |
| 650 | 650 | static TIMER_CALLBACK( namcos2_68k_master_posirq ) |
| 651 | 651 | { |
| 652 | 652 | video_screen_update_partial(0, param); |
| 653 | cpunum_set_input_line(CPU_MASTER , namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 653 | cpunum_set_input_line(machine, CPU_MASTER , namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | static int |
| r1591 | r1592 | |
| 667 | 667 | int scanline = GetPosIRQScanline(); |
| 668 | 668 | timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_master_posirq ); |
| 669 | 669 | } |
| 670 | cpunum_set_input_line( CPU_MASTER, namcos2_68k_master_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); | |
| 670 | cpunum_set_input_line(machine, CPU_MASTER, namcos2_68k_master_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); | |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | static TIMER_CALLBACK( namcos2_68k_slave_posirq ) |
| 674 | 674 | { |
| 675 | 675 | video_screen_update_partial(0, param); |
| 676 | cpunum_set_input_line(CPU_SLAVE , namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 676 | cpunum_set_input_line(machine, CPU_SLAVE , namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | INTERRUPT_GEN( namcos2_68k_slave_vblank ) |
| r1591 | r1592 | |
| 683 | 683 | int scanline = GetPosIRQScanline(); |
| 684 | 684 | timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_slave_posirq ); |
| 685 | 685 | } |
| 686 | cpunum_set_input_line( CPU_SLAVE, namcos2_68k_slave_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); | |
| 686 | cpunum_set_input_line(machine, CPU_SLAVE, namcos2_68k_slave_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); | |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | static TIMER_CALLBACK( namcos2_68k_gpu_posirq ) |
| 690 | 690 | { |
| 691 | 691 | //printf( "namcos2_68k_gpu_posirq(%d)\n", param ); |
| 692 | 692 | video_screen_update_partial(0, param); |
| 693 | cpunum_set_input_line(CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 693 | cpunum_set_input_line(machine, CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | INTERRUPT_GEN( namcos2_68k_gpu_vblank ) |
| r1591 | r1592 | |
| 701 | 701 | int scanline = 0x50+0x89; /* HACK for Winning Run */ |
| 702 | 702 | timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_gpu_posirq ); |
| 703 | 703 | } |
| 704 | cpunum_set_input_line( CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); | |
| 704 | cpunum_set_input_line(machine, CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); | |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | /**************************************************************/ |
| r1591 | r1592 | |
| 776 | 776 | /* If the interrupt enable bit is set trigger an A/D IRQ */ |
| 777 | 777 | if(data&0x20) |
| 778 | 778 | { |
| 779 | cpunum_set_input_line( CPU_MCU, HD63705_INT_ADCONV , PULSE_LINE); | |
| 779 | cpunum_set_input_line(Machine, CPU_MCU, HD63705_INT_ADCONV , PULSE_LINE); | |
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | 782 | } |
| r1591 | r1592 | |
|---|---|---|
| 254 | 254 | |
| 255 | 255 | static TIMER_CALLBACK( namco_50xx_irq_clear ) |
| 256 | 256 | { |
| 257 | cpunum_set_input_line(param, 0, CLEAR_LINE); | |
| 257 | cpunum_set_input_line(machine, param, 0, CLEAR_LINE); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | static void namco_50xx_irq_set(int cpunum) |
| 261 | 261 | { |
| 262 | cpunum_set_input_line(cpunum, 0, ASSERT_LINE); | |
| 262 | cpunum_set_input_line(Machine, cpunum, 0, ASSERT_LINE); | |
| 263 | 263 | |
| 264 | 264 | // The execution time of one instruction is ~4us, so we must make sure to |
| 265 | 265 | // give the cpu time to poll the /IRQ input before we clear it. |
| r1591 | r1592 | |
|---|---|---|
| 63 | 63 | */ |
| 64 | 64 | static TIMER_CALLBACK( interrupt_callback ) |
| 65 | 65 | { |
| 66 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xff); | |
| 66 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xff); | |
| 67 | 67 | timer_set(video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), NULL, 0, interrupt_callback); |
| 68 | 68 | } |
| 69 | 69 |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | { |
| 111 | 111 | if (offset==(0x150/2)) { |
| 112 | 112 | soundlatch_w(0,data&0xff); |
| 113 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 113 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 114 | 114 | return; |
| 115 | 115 | } |
| 116 | 116 | |
| r1591 | r1592 | |
| 228 | 228 | { |
| 229 | 229 | if (offset==(0x64/2)) { |
| 230 | 230 | soundlatch_w(0,data&0xff); |
| 231 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 231 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | COMBINE_DATA(&deco16_prot_ram[offset]); |
| r1591 | r1592 | |
| 417 | 417 | { |
| 418 | 418 | if (offset==(0x64/2)) { |
| 419 | 419 | soundlatch_w(0,data&0xff); |
| 420 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 420 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 421 | 421 | return; |
| 422 | 422 | } |
| 423 | 423 | |
| r1591 | r1592 | |
| 603 | 603 | { |
| 604 | 604 | if (offset==(0xa8/2)) { |
| 605 | 605 | soundlatch_w(0,data&0xff); |
| 606 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 606 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 607 | 607 | return; |
| 608 | 608 | } |
| 609 | 609 | |
| r1591 | r1592 | |
| 665 | 665 | |
| 666 | 666 | if (offset == (0x10a >> 1)) { |
| 667 | 667 | soundlatch_w(0,data&0xff); |
| 668 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 668 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 669 | 669 | return; |
| 670 | 670 | } |
| 671 | 671 | } |
| r1591 | r1592 | |
| 785 | 785 | |
| 786 | 786 | if (offset==(0xa8/2)) { |
| 787 | 787 | soundlatch_w(0,data&0xff); |
| 788 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 788 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 789 | 789 | return; |
| 790 | 790 | } |
| 791 | 791 | |
| r1591 | r1592 | |
| 1216 | 1216 | |
| 1217 | 1217 | if (writeport==sndport) { |
| 1218 | 1218 | soundlatch_w(0,data&0xff); |
| 1219 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 1219 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 1220 | 1220 | return; |
| 1221 | 1221 | } |
| 1222 | 1222 | |
| r1591 | r1592 | |
| 1746 | 1746 | { |
| 1747 | 1747 | if (offset==(0x380/2)) { |
| 1748 | 1748 | soundlatch_w(0,data&0xff); |
| 1749 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 1749 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 1750 | 1750 | return; |
| 1751 | 1751 | } |
| 1752 | 1752 | logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",activecpu_get_pc(),offset<<1,data); |
| r1591 | r1592 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | static void ctc_interrupt(int state) |
| 191 | 191 | { |
| 192 | cpunum_set_input_line(0, 0, state); | |
| 192 | cpunum_set_input_line(Machine, 0, 0, state); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
| 196 | 196 | static void ipu_ctc_interrupt(int state) |
| 197 | 197 | { |
| 198 | cpunum_set_input_line(3, 0, state); | |
| 198 | cpunum_set_input_line(Machine, 3, 0, state); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
| r1591 | r1592 | |
| 393 | 393 | pia_config(3, &zwackery_pia_3_intf); |
| 394 | 394 | pia_config(4, &zwackery_pia_4_intf); |
| 395 | 395 | |
| 396 | | |
| 396 | MACHINE_START_CALL(mcr68 | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | |
| r1591 | r1592 | |
| 482 | 482 | |
| 483 | 483 | /* set the new state of the IRQ lines */ |
| 484 | 484 | if (newstate) |
| 485 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 485 | cpunum_set_input_line(Machine, 0, newstate, ASSERT_LINE); | |
| 486 | 486 | else |
| 487 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 487 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | |
| r1591 | r1592 | |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | |
| 607 | void zwackery_pia_irq(int state) | |
| 607 | static void zwackery_pia_irq(int state) | |
| 608 | 608 | { |
| 609 | v493_irq_state = | |
| 609 | v493_irq_state = pia_get_irq_a(2) | pia_get_irq_b(2); | |
| 610 | 610 | update_mcr68_interrupts(); |
| 611 | 611 | } |
| 612 | 612 | |
| r1591 | r1592 | |
| 1003 | 1003 | static TIMER_CALLBACK( ipu_watchdog_reset ) |
| 1004 | 1004 | { |
| 1005 | 1005 | logerror("ipu_watchdog_reset\n"); |
| 1006 | cpunum_set_input_line(3, INPUT_LINE_RESET, PULSE_LINE); | |
| 1006 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, PULSE_LINE); | |
| 1007 | 1007 | z80ctc_reset(1); |
| 1008 | 1008 | z80pio_reset(0); |
| 1009 | 1009 | z80pio_reset(1); |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | if (tatsumi_control_word&0x7f00) |
| 49 | 49 | { |
| 50 | 50 | logerror("Unknown control Word: %04x\n",tatsumi_control_word); |
| 51 | cpunum_set_input_line(3, INPUT_LINE_HALT, CLEAR_LINE); // ? | |
| 51 | cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE); // ? | |
| 52 | 52 | } |
| 53 | 53 | if ((tatsumi_control_word&0x8)==0 && !(tatsumi_last_control&0x8)) |
| 54 | cpunum_set_input_line(1, INPUT_LINE_IRQ4, ASSERT_LINE); | |
| 54 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, ASSERT_LINE); | |
| 55 | 55 | |
| 56 | 56 | if (tatsumi_control_word&0x10) |
| 57 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 57 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 58 | 58 | else |
| 59 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 59 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 60 | 60 | |
| 61 | 61 | if (tatsumi_control_word&0x80) |
| 62 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 62 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 63 | 63 | else |
| 64 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 64 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 65 | 65 | |
| 66 | 66 | tatsumi_last_control=tatsumi_control_word; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | WRITE16_HANDLER( apache3_irq_ack_w ) |
| 70 | 70 | { |
| 71 | cpunum_set_input_line(1, INPUT_LINE_IRQ4, CLEAR_LINE); | |
| 71 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE); | |
| 72 | 72 | |
| 73 | 73 | if ((data&2) && (tatsumi_last_irq&2)==0) |
| 74 | 74 | { |
| 75 | cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE); | |
| 75 | cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, ASSERT_LINE); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | if ((tatsumi_last_irq&2) && (data&2)==0) |
| 79 | 79 | { |
| 80 | cpunum_set_input_line(3, INPUT_LINE_HALT, CLEAR_LINE); | |
| 81 | cpunum_set_input_line_and_vector(3, 0, HOLD_LINE, 0xc7 | 0x10); | |
| 80 | cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE); | |
| 81 | cpunum_set_input_line_and_vector(Machine, 3, 0, HOLD_LINE, 0xc7 | 0x10); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | tatsumi_last_irq=data; |
| r1591 | r1592 | |
| 186 | 186 | COMBINE_DATA(&tatsumi_control_word); |
| 187 | 187 | |
| 188 | 188 | if (tatsumi_control_word&0x10) |
| 189 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 189 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 190 | 190 | else |
| 191 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 191 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 192 | 192 | |
| 193 | 193 | if (tatsumi_control_word&0x4) |
| 194 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 194 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 195 | 195 | else |
| 196 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 196 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 197 | 197 | |
| 198 | 198 | // if (offset==1 && (tatsumi_control_w&0xfeff)!=(last_bank&0xfeff)) |
| 199 | 199 | // logerror("%08x: Changed bank to %04x (%d)\n",activecpu_get_pc(),tatsumi_control_w,offset); |
| r1591 | r1592 | |
| 219 | 219 | */ |
| 220 | 220 | |
| 221 | 221 | if ((tatsumi_control_word&0x8)==0 && !(tatsumi_last_control&0x8)) |
| 222 | cpunum_set_input_line(1, INPUT_LINE_IRQ4, ASSERT_LINE); | |
| 222 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, ASSERT_LINE); | |
| 223 | 223 | // if (tatsumi_control_w&0x200) |
| 224 | 224 | // cpu_set_reset_line(1, CLEAR_LINE); |
| 225 | 225 | // else |
| r1591 | r1592 | |
| 252 | 252 | */ |
| 253 | 253 | |
| 254 | 254 | COMBINE_DATA(&roundup5_e0000_ram[offset]); |
| 255 | cpunum_set_input_line(1, INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong | |
| 255 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong | |
| 256 | 256 | |
| 257 | 257 | // logerror("d_68k_e0000_w %06x %04x\n",activecpu_get_pc(),data); |
| 258 | 258 | } |
| r1591 | r1592 | |
| 283 | 283 | |
| 284 | 284 | if ((tatsumi_control_word&4)==4 && (tatsumi_last_control&4)==0) { |
| 285 | 285 | // logerror("68k 2 halt\n"); |
| 286 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 286 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | if ((tatsumi_control_word&4)==0 && (tatsumi_last_control&4)==4) { |
| 290 | 290 | // logerror("68k 2 irq go\n"); |
| 291 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 291 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 |
| r1591 | r1592 | |
|---|---|---|
| 56 | 56 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) |
| 57 | 57 | { |
| 58 | 58 | portA_in = from_main; |
| 59 | if (main_sent) cpunum_set_input_line(3,0,CLEAR_LINE); | |
| 59 | if (main_sent) cpunum_set_input_line(Machine, 3,0,CLEAR_LINE); | |
| 60 | 60 | main_sent = 0; |
| 61 | 61 | //logerror("read command %02x from main cpu\n",portA_in); |
| 62 | 62 | } |
| r1591 | r1592 | |
| 113 | 113 | logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); |
| 114 | 114 | from_main = data; |
| 115 | 115 | main_sent = 1; |
| 116 | cpunum_set_input_line(3,0,ASSERT_LINE); | |
| 116 | cpunum_set_input_line(Machine, 3,0,ASSERT_LINE); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | READ8_HANDLER( retofinv_mcu_r ) |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | i256V=(i256V+1) % 8; |
| 32 | 32 | |
| 33 | 33 | if (i256V==0) |
| 34 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 34 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 35 | 35 | else if (NMION) |
| 36 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 36 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /*************************************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 508 | 508 | /* at its endpoint; otherwise, we never get a result from the Z80 */ |
| 509 | 509 | if ((data & 0x10) || cpunum_get_reg(2, Z80_PC) == 0x13a) |
| 510 | 510 | { |
| 511 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 511 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 512 | 512 | |
| 513 | 513 | /* on the rising edge, make the crosshair visible again */ |
| 514 | 514 | if ((data & 0x10) && !(z80_ctrl & 0x10)) |
| r1591 | r1592 | |
| 532 | 532 | |
| 533 | 533 | /************************************* |
| 534 | 534 | * |
| 535 | * | |
| 535 | * VIDEO_UPDATE( sli | |
| 536 | 536 | * |
| 537 | 537 | *************************************/ |
| 538 | 538 | |
| r1591 | r1592 | |
| 542 | 542 | int temp, i; |
| 543 | 543 | |
| 544 | 544 | /* draw the normal video first */ |
| 545 | | |
| 545 | VIDEO_UPDATE_CALL(itech8_2page | |
| 546 | 546 | |
| 547 | 547 | /* add the current X,Y positions to the list */ |
| 548 | 548 | xbuffer[ybuffer_next % YBUFFER_COUNT] = readinputportbytag_safe("FAKEX", 0); |
| r1591 | r1592 | |
|---|---|---|
| 147 | 147 | static UINT32 dataval[MAX_MSP_SYNC]; |
| 148 | 148 | static int next_msp_sync; |
| 149 | 149 | |
| 150 | static void hd68k_update_interrupts( | |
| 150 | static void hd68k_update_interrupts(running_machine *machine); | |
| 151 | 151 | static TIMER_CALLBACK( duart_callback ); |
| 152 | 152 | |
| 153 | 153 | |
| r1591 | r1592 | |
| 181 | 181 | atarigen_interrupt_reset(hd68k_update_interrupts); |
| 182 | 182 | |
| 183 | 183 | /* halt several of the DSPs to start */ |
| 184 | if (hdcpu_adsp != -1) cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 185 | if (hdcpu_dsp32 != -1) cpunum_set_input_line(hdcpu_dsp32, INPUT_LINE_HALT, ASSERT_LINE); | |
| 186 | if (hdcpu_sounddsp != -1) cpunum_set_input_line(hdcpu_sounddsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 184 | if (hdcpu_adsp != -1) cpunum_set_input_line(machine, hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 185 | if (hdcpu_dsp32 != -1) cpunum_set_input_line(machine, hdcpu_dsp32, INPUT_LINE_HALT, ASSERT_LINE); | |
| 186 | if (hdcpu_sounddsp != -1) cpunum_set_input_line(machine, hdcpu_sounddsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 187 | 187 | |
| 188 | 188 | /* if we found a 6502, reset the JSA board */ |
| 189 | 189 | if (hdcpu_jsa != -1) |
| r1591 | r1592 | |
| 216 | 216 | * |
| 217 | 217 | *************************************/ |
| 218 | 218 | |
| 219 | static void hd68k_update_interrupts( | |
| 219 | static void hd68k_update_interrupts(running_machine *machine) | |
| 220 | 220 | { |
| 221 | 221 | int newstate = 0; |
| 222 | 222 | |
| r1591 | r1592 | |
| 234 | 234 | newstate = 6; |
| 235 | 235 | |
| 236 | 236 | if (newstate) |
| 237 | cpunum_set_input_line(hdcpu_main, newstate, ASSERT_LINE); | |
| 237 | cpunum_set_input_line(machine, hdcpu_main, newstate, ASSERT_LINE); | |
| 238 | 238 | else |
| 239 | cpunum_set_input_line(hdcpu_main, 7, CLEAR_LINE); | |
| 239 | cpunum_set_input_line(machine, hdcpu_main, 7, CLEAR_LINE); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| r1591 | r1592 | |
| 532 | 532 | case 6: /* /GSPRES */ |
| 533 | 533 | logerror("Write to /GSPRES(%d)\n", data); |
| 534 | 534 | if (hdcpu_gsp != -1) |
| 535 | cpunum_set_input_line(hdcpu_gsp, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 535 | cpunum_set_input_line(Machine, hdcpu_gsp, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 536 | 536 | break; |
| 537 | 537 | case 7: /* /MSPRES */ |
| 538 | 538 | logerror("Write to /MSPRES(%d)\n", data); |
| 539 | 539 | if (hdcpu_msp != -1) |
| 540 | cpunum_set_input_line(hdcpu_msp, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 540 | cpunum_set_input_line(Machine, hdcpu_msp, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 541 | 541 | break; |
| 542 | 542 | } |
| 543 | 543 | } |
| r1591 | r1592 | |
| 772 | 772 | offs_t offset = (param >> 16) & 0xfff; |
| 773 | 773 | UINT16 data = param; |
| 774 | 774 | stmsp_sync[which][offset] = data; |
| 775 | cpu_triggerint(hdcpu_msp); | |
| 775 | cpu_triggerint(machine, hdcpu_msp); | |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | 778 | |
| r1591 | r1592 | |
| 872 | 872 | { |
| 873 | 873 | logerror("%06X:ADSP sync address written (%04X)\n", activecpu_get_previouspc(), data); |
| 874 | 874 | timer_call_after_resynch(NULL, 0, 0); |
| 875 | cpu_triggerint(hdcpu_adsp); | |
| 875 | cpu_triggerint(Machine, hdcpu_adsp); | |
| 876 | 876 | } |
| 877 | 877 | else |
| 878 | 878 | logerror("%06X:ADSP W@%04X (%04X)\n", activecpu_get_previouspc(), offset, data); |
| r1591 | r1592 | |
| 983 | 983 | adsp_br = !val; |
| 984 | 984 | logerror("ADSP /BR = %d\n", !adsp_br); |
| 985 | 985 | if (adsp_br || adsp_halt) |
| 986 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 986 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 987 | 987 | else |
| 988 | 988 | { |
| 989 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_HALT, CLEAR_LINE); | |
| 989 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_HALT, CLEAR_LINE); | |
| 990 | 990 | /* a yield in this case is not enough */ |
| 991 | 991 | /* we would need to increase the interleaving otherwise */ |
| 992 | 992 | /* note that this only affects the test mode */ |
| r1591 | r1592 | |
| 1000 | 1000 | adsp_halt = !val; |
| 1001 | 1001 | logerror("ADSP /HALT = %d\n", !adsp_halt); |
| 1002 | 1002 | if (adsp_br || adsp_halt) |
| 1003 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1003 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1004 | 1004 | else |
| 1005 | 1005 | { |
| 1006 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1006 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1007 | 1007 | /* a yield in this case is not enough */ |
| 1008 | 1008 | /* we would need to increase the interleaving otherwise */ |
| 1009 | 1009 | /* note that this only affects the test mode */ |
| r1591 | r1592 | |
| 1013 | 1013 | |
| 1014 | 1014 | case 7: |
| 1015 | 1015 | logerror("ADSP reset = %d\n", val); |
| 1016 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_RESET, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1016 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_RESET, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1017 | 1017 | cpu_yield(); |
| 1018 | 1018 | break; |
| 1019 | 1019 | |
| r1591 | r1592 | |
| 1129 | 1129 | { |
| 1130 | 1130 | /* update the IRQ2 signal to the ADSP2101 */ |
| 1131 | 1131 | if (!(!ds3_g68flag && ds3_g68irqs) && !(ds3_gflag && ds3_gfirqs)) |
| 1132 | cpunum_set_input_line(hdcpu_adsp, ADSP2100_IRQ2, ASSERT_LINE); | |
| 1132 | cpunum_set_input_line(Machine, hdcpu_adsp, ADSP2100_IRQ2, ASSERT_LINE); | |
| 1133 | 1133 | else |
| 1134 | cpunum_set_input_line(hdcpu_adsp, ADSP2100_IRQ2, CLEAR_LINE); | |
| 1134 | cpunum_set_input_line(Machine, hdcpu_adsp, ADSP2100_IRQ2, CLEAR_LINE); | |
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | 1137 | |
| r1591 | r1592 | |
| 1154 | 1154 | /* the ADSP at the next instruction boundary */ |
| 1155 | 1155 | adsp_br = !val; |
| 1156 | 1156 | if (adsp_br) |
| 1157 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1157 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1158 | 1158 | else |
| 1159 | 1159 | { |
| 1160 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1160 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1161 | 1161 | /* a yield in this case is not enough */ |
| 1162 | 1162 | /* we would need to increase the interleaving otherwise */ |
| 1163 | 1163 | /* note that this only affects the test mode */ |
| r1591 | r1592 | |
| 1166 | 1166 | break; |
| 1167 | 1167 | |
| 1168 | 1168 | case 3: |
| 1169 | cpunum_set_input_line(hdcpu_adsp, INPUT_LINE_RESET, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1169 | cpunum_set_input_line(Machine, hdcpu_adsp, INPUT_LINE_RESET, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1170 | 1170 | if (val && !ds3_reset) |
| 1171 | 1171 | { |
| 1172 | 1172 | ds3_gflag = 0; |
| r1591 | r1592 | |
| 1264 | 1264 | COMBINE_DATA(&ds3_g68data); |
| 1265 | 1265 | ds3_g68flag = 1; |
| 1266 | 1266 | ds3_gcmd = offset & 1; |
| 1267 | cpu_triggerint(hdcpu_adsp); | |
| 1267 | cpu_triggerint(Machine, hdcpu_adsp); | |
| 1268 | 1268 | update_ds3_irq(); |
| 1269 | 1269 | } |
| 1270 | 1270 | |
| r1591 | r1592 | |
| 1342 | 1342 | update_ds3_irq(); |
| 1343 | 1343 | |
| 1344 | 1344 | /* once we've written data, trigger the main CPU to wake up again */ |
| 1345 | cpu_trigger(DS3_TRIGGER); | |
| 1345 | cpu_trigger(Machine, DS3_TRIGGER); | |
| 1346 | 1346 | break; |
| 1347 | 1347 | |
| 1348 | 1348 | case 1: |
| 1349 | 1349 | logerror("%04X:ADSP sets interrupt = %d\n", activecpu_get_previouspc(), (data >> 1) & 1); |
| 1350 | 1350 | adsp_irq_state = (data >> 1) & 1; |
| 1351 | hd68k_update_interrupts(); | |
| 1351 | hd68k_update_interrupts(Machine); | |
| 1352 | 1352 | break; |
| 1353 | 1353 | |
| 1354 | 1354 | case 2: |
| r1591 | r1592 | |
| 1438 | 1438 | void hddsk_update_pif(UINT32 pins) |
| 1439 | 1439 | { |
| 1440 | 1440 | atarigen_sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0); |
| 1441 | hd68k_update_interrupts(); | |
| 1441 | hd68k_update_interrupts(Machine); | |
| 1442 | 1442 | } |
| 1443 | 1443 | |
| 1444 | 1444 | |
| r1591 | r1592 | |
| 1455 | 1455 | switch (offset & 7) |
| 1456 | 1456 | { |
| 1457 | 1457 | case 0: /* DSPRESTN */ |
| 1458 | cpunum_set_input_line(hdcpu_dsp32, INPUT_LINE_RESET, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1458 | cpunum_set_input_line(Machine, hdcpu_dsp32, INPUT_LINE_RESET, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1459 | 1459 | break; |
| 1460 | 1460 | |
| 1461 | 1461 | case 1: /* DSPZN */ |
| 1462 | cpunum_set_input_line(hdcpu_dsp32, INPUT_LINE_HALT, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1462 | cpunum_set_input_line(Machine, hdcpu_dsp32, INPUT_LINE_HALT, val ? CLEAR_LINE : ASSERT_LINE); | |
| 1463 | 1463 | break; |
| 1464 | 1464 | |
| 1465 | 1465 | case 2: /* ZW1 */ |
| r1591 | r1592 | |
| 1797 | 1797 | |
| 1798 | 1798 | /* if $ffff is written, send an "interrupt" trigger to break us out of the spin loop */ |
| 1799 | 1799 | if (hdgsp_speedup_addr[0][offset] == 0xffff) |
| 1800 | cpu_triggerint(hdcpu_gsp); | |
| 1800 | cpu_triggerint(Machine, hdcpu_gsp); | |
| 1801 | 1801 | } |
| 1802 | 1802 | |
| 1803 | 1803 | |
| r1591 | r1592 | |
| 1807 | 1807 | |
| 1808 | 1808 | /* if $ffff is written, send an "interrupt" trigger to break us out of the spin loop */ |
| 1809 | 1809 | if (hdgsp_speedup_addr[1][offset] == 0xffff) |
| 1810 | cpu_triggerint(hdcpu_gsp); | |
| 1810 | cpu_triggerint(Machine, hdcpu_gsp); | |
| 1811 | 1811 | } |
| 1812 | 1812 | |
| 1813 | 1813 | |
| r1591 | r1592 | |
| 1840 | 1840 | { |
| 1841 | 1841 | COMBINE_DATA(&hdgsp_speedup_addr[0][offset]); |
| 1842 | 1842 | if (cpu_getactivecpu() != hdcpu_gsp) |
| 1843 | cpu_triggerint(hdcpu_gsp); | |
| 1843 | cpu_triggerint(Machine, hdcpu_gsp); | |
| 1844 | 1844 | } |
| 1845 | 1845 | |
| 1846 | 1846 | |
| r1591 | r1592 | |
| 1874 | 1874 | { |
| 1875 | 1875 | COMBINE_DATA(&hdmsp_speedup_addr[offset]); |
| 1876 | 1876 | if (offset == 0 && hdmsp_speedup_addr[offset] != 0) |
| 1877 | cpu_triggerint(hdcpu_msp); | |
| 1877 | cpu_triggerint(Machine, hdcpu_msp); | |
| 1878 | 1878 | } |
| 1879 | 1879 | |
| 1880 | 1880 |
| r1591 | r1592 | |
|---|---|---|
| 70 | 70 | if( ( m_n_irqdata & m_n_irqmask ) != 0 ) |
| 71 | 71 | { |
| 72 | 72 | verboselog( 2, "psx irq assert\n" ); |
| 73 | cpunum_set_input_line( 0, MIPS_IRQ0, ASSERT_LINE ); | |
| 73 | cpunum_set_input_line(Machine, 0, MIPS_IRQ0, ASSERT_LINE ); | |
| 74 | 74 | } |
| 75 | 75 | else |
| 76 | 76 | { |
| 77 | 77 | verboselog( 2, "psx irq clear\n" ); |
| 78 | cpunum_set_input_line( 0, MIPS_IRQ0, CLEAR_LINE ); | |
| 78 | cpunum_set_input_line(Machine, 0, MIPS_IRQ0, CLEAR_LINE ); | |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 |
| r1591 | r1592 | |
|---|---|---|
| 463 | 463 | static TIMER_CALLBACK( i8751_callback ) |
| 464 | 464 | { |
| 465 | 465 | /* Signal main cpu microcontroller task is complete */ |
| 466 | cpunum_set_input_line(0,5,HOLD_LINE); | |
| 466 | cpunum_set_input_line(machine, 0,5,HOLD_LINE); | |
| 467 | 467 | i8751_timer=NULL; |
| 468 | 468 | |
| 469 | 469 | logerror("i8751: Timer called!!!\n"); |
| r1591 | r1592 | |
| 477 | 477 | if (GAME==2) baddudes_i8751_write(data); |
| 478 | 478 | if (GAME==3) birdtry_i8751_write(data); |
| 479 | 479 | |
| 480 | cpunum_set_input_line(0,5,HOLD_LINE); | |
| 480 | cpunum_set_input_line(Machine, 0,5,HOLD_LINE); | |
| 481 | 481 | |
| 482 | 482 | /* Simulate the processing time of the i8751, time value is guessed |
| 483 | 483 | if (i8751_timer) |
| r1591 | r1592 | |
| 526 | 526 | robocop_shared_ram[offset]=data&0xff; |
| 527 | 527 | |
| 528 | 528 | if (offset==0x7ff) /* A control address - not standard ram */ |
| 529 | cpunum_set_input_line(2,0,HOLD_LINE); | |
| 529 | cpunum_set_input_line(Machine, 2,0,HOLD_LINE); | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | /******************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | static void b_via_0_irq (int level) |
| 51 | 51 | { |
| 52 | cpunum_set_input_line(0, M6809_IRQ_LINE, level); | |
| 52 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, level); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static READ8_HANDLER( b_via_0_pb_r ) |
| r1591 | r1592 | |
| 60 | 60 | static WRITE8_HANDLER( b_via_0_pa_w ) |
| 61 | 61 | { |
| 62 | 62 | if ((data & 0x08) == 0) |
| 63 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 63 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 64 | 64 | else |
| 65 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 65 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 66 | 66 | |
| 67 | 67 | if ((data & 0x04) == 0) |
| 68 | 68 | { |
| r1591 | r1592 | |
| 91 | 91 | |
| 92 | 92 | static void b_via_1_irq (int level) |
| 93 | 93 | { |
| 94 | cpunum_set_input_line(1, M6809_IRQ_LINE, level); | |
| 94 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, level); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static READ8_HANDLER( b_via_1_pa_r ) |
| r1591 | r1592 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | static TIMER_CALLBACK( nmi_callback ) |
| 19 | 19 | { |
| 20 | if (sound_nmi_enable) cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 20 | if (sound_nmi_enable) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 21 | 21 | else pending_nmi = 1; |
| 22 | 22 | } |
| 23 | 23 | |
| r1591 | r1592 | |
| 31 | 31 | sound_nmi_enable = 1; |
| 32 | 32 | if (pending_nmi) |
| 33 | 33 | { |
| 34 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 34 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 35 | 35 | pending_nmi = 0; |
| 36 | 36 | } |
| 37 | 37 | } |
| r1591 | r1592 | |
| 144 | 144 | if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) |
| 145 | 145 | { |
| 146 | 146 | portA_in = from_main; |
| 147 | if (main_sent) cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 147 | if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 148 | 148 | main_sent = 0; |
| 149 | 149 | //logerror("read command %02x from main cpu\n",portA_in); |
| 150 | 150 | } |
| r1591 | r1592 | |
| 168 | 168 | //logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); |
| 169 | 169 | from_main = data; |
| 170 | 170 | main_sent = 1; |
| 171 | cpunum_set_input_line(2,0,ASSERT_LINE); | |
| 171 | cpunum_set_input_line(Machine, 2,0,ASSERT_LINE); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | READ8_HANDLER( lsasquad_mcu_r ) |
| r1591 | r1592 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | /* newer-Williams routines */ |
| 49 | 49 | static WRITE8_HANDLER( williams2_snd_cmd_w ); |
| 50 | static void mysticm_main_irq(int state); | |
| 51 | static void tshoot_main_irq(int state); | |
| 50 | 52 | |
| 51 | 53 | /* Lotto Fun-specific code */ |
| 52 | 54 | static READ8_HANDLER( lottofun_input_port_0_r ); |
| r1591 | r1592 | |
| 209 | 211 | { |
| 210 | 212 | /*inputs : A/B,CA/B1,CA/B2 */ input_port_0_r, input_port_1_r, 0, 0, 0, 0, |
| 211 | 213 | /*outputs: A/B,CA/B2 */ 0, 0, 0, 0, |
| 212 | /*irqs : A/B */ williams_main_firq, | |
| 214 | /*irqs : A/B */ williams_main_firq, | |
| 213 | 215 | }; |
| 214 | 216 | |
| 217 | /* Mystic Marathon PIA 1 */ | |
| 218 | const pia6821_interface mysticm_pia_1_intf = | |
| 219 | { | |
| 220 | /*inputs : A/B,CA/B1,CA/B2 */ input_port_2_r, 0, 0, 0, 0, 0, | |
| 221 | /*outputs: A/B,CA/B2 */ 0, williams2_snd_cmd_w, 0, pia_2_ca1_w, | |
| 222 | /*irqs : A/B */ mysticm_main_irq, mysticm_main_irq | |
| 223 | }; | |
| 224 | ||
| 215 | 225 | /* Turkey Shoot PIA 0 */ |
| 216 | 226 | const pia6821_interface tshoot_pia_0_intf = |
| 217 | 227 | { |
| 218 | 228 | /*inputs : A/B,CA/B1,CA/B2 */ tshoot_input_port_0_3_r, input_port_1_r, 0, 0, 0, 0, |
| 219 | 229 | /*outputs: A/B,CA/B2 */ 0, tshoot_lamp_w, williams_port_select_w, 0, |
| 220 | /*irqs : A/B */ | |
| 230 | /*irqs : A/B */ t | |
| 221 | 231 | }; |
| 222 | 232 | |
| 233 | /* Turkey Shoot PIA 1 */ | |
| 234 | const pia6821_interface tshoot_pia_1_intf = | |
| 235 | { | |
| 236 | /*inputs : A/B,CA/B1,CA/B2 */ input_port_2_r, 0, 0, 0, 0, 0, | |
| 237 | /*outputs: A/B,CA/B2 */ 0, williams2_snd_cmd_w, 0, pia_2_ca1_w, | |
| 238 | /*irqs : A/B */ tshoot_main_irq, tshoot_main_irq | |
| 239 | }; | |
| 240 | ||
| 223 | 241 | /* Turkey Shoot PIA 2 */ |
| 224 | 242 | const pia6821_interface tshoot_snd_pia_intf = |
| 225 | 243 | { |
| r1591 | r1592 | |
| 283 | 301 | |
| 284 | 302 | static void williams_main_irq(int state) |
| 285 | 303 | { |
| 304 | int combined_state = pia_get_irq_a(1) | pia_get_irq_b(1); | |
| 305 | ||
| 286 | 306 | /* IRQ to the main CPU */ |
| 287 | cpunum_set_input_line(0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 307 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 288 | 308 | } |
| 289 | 309 | |
| 290 | 310 | |
| 291 | 311 | static void williams_main_firq(int state) |
| 292 | 312 | { |
| 293 | 313 | /* FIRQ to the main CPU */ |
| 294 | cpunum_set_input_line(0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 314 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 295 | 315 | } |
| 296 | 316 | |
| 297 | 317 | |
| 298 | 318 | static void williams_snd_irq(int state) |
| 299 | 319 | { |
| 320 | int combined_state = pia_get_irq_a(2) | pia_get_irq_b(2); | |
| 321 | ||
| 300 | 322 | /* IRQ to the sound CPU */ |
| 301 | cpunum_set_input_line(1, M6800_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 323 | cpunum_set_input_line(Machine, 1, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 302 | 324 | } |
| 303 | 325 | |
| 304 | 326 | |
| 305 | 327 | |
| 306 | 328 | /************************************* |
| 307 | 329 | * |
| 330 | * Newer Williams interrupts | |
| 331 | * | |
| 332 | *************************************/ | |
| 333 | ||
| 334 | static void mysticm_main_irq(int state) | |
| 335 | { | |
| 336 | int combined_state = pia_get_irq_b(0) | pia_get_irq_a(1) | pia_get_irq_b(1); | |
| 337 | ||
| 338 | /* IRQ to the main CPU */ | |
| 339 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 340 | } | |
| 341 | ||
| 342 | ||
| 343 | static void tshoot_main_irq(int state) | |
| 344 | { | |
| 345 | int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0) | pia_get_irq_a(1) | pia_get_irq_b(1); | |
| 346 | ||
| 347 | /* IRQ to the main CPU */ | |
| 348 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 349 | } | |
| 350 | ||
| 351 | ||
| 352 | ||
| 353 | /************************************* | |
| 354 | * | |
| 308 | 355 | * Older Williams initialization |
| 309 | 356 | * |
| 310 | 357 | *************************************/ |
| r1591 | r1592 | |
| 892 | 939 | MACHINE_RESET( joust2 ) |
| 893 | 940 | { |
| 894 | 941 | /* standard init */ |
| 895 | | |
| 942 | MACHINE_RESET_CALL(williams2 | |
| 896 | 943 | pia_set_input_ca1(3, 1); |
| 897 | 944 | state_save_register_global(joust2_current_sound_data); |
| 898 | 945 | } |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static void sound_cause_nmi( int chip ){ |
| 57 | 57 | /* upd7759 callback */ |
| 58 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | namcond1_h8_irq5_enabled = 0; |
| 49 | 49 | |
| 50 | 50 | // halt the MCU |
| 51 | cpunum_set_input_line(1,INPUT_LINE_RESET,ASSERT_LINE); | |
| 51 | cpunum_set_input_line(machine, 1,INPUT_LINE_RESET,ASSERT_LINE); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // instance of the shared ram pointer |
| r1591 | r1592 | |
| 97 | 97 | // this is a kludge until we emulate the h8 |
| 98 | 98 | if ((namcond1_h8_irq5_enabled == 0) && (data != 0x0000)) |
| 99 | 99 | { |
| 100 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 100 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 101 | 101 | } |
| 102 | 102 | namcond1_h8_irq5_enabled = ( data != 0x0000 ); |
| 103 | 103 | break; |
| r1591 | r1592 | |
|---|---|---|
| 673 | 673 | { |
| 674 | 674 | char loadingMessage[256]; // for displaying with UI |
| 675 | 675 | sprintf(loadingMessage, "Decrypting %d%%", i*100/0x10000); |
| 676 | ui_set_startup_text(loadingMessage,FALSE); | |
| 676 | ui_set_startup_text(Machine, loadingMessage,FALSE); | |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | |
| r1591 | r1592 | |
| 974 | 974 | ++k; |
| 975 | 975 | } |
| 976 | 976 | |
| 977 | | |
| 977 | DRIVER_INIT_CALL(cps2_video | |
| 978 | 978 | } |
| r1591 | r1592 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | if (nb1413m3_nmi_enable) |
| 56 | 56 | { |
| 57 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 57 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | 58 | nb1413m3_nmi_count++; |
| 59 | 59 | } |
| 60 | 60 | |
| r1591 | r1592 | |
| 198 | 198 | { |
| 199 | 199 | // nb1413m3_busyflag = 1; |
| 200 | 200 | // nb1413m3_busyctr = 0; |
| 201 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 201 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 202 | 202 | } |
| 203 | 203 | if (nb1413m3_nmi_enable) |
| 204 | 204 | { |
| 205 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 205 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | #if NB1413M3_CHEAT |
| r1591 | r1592 | |
| 211 | 211 | #else |
| 212 | 212 | // nb1413m3_busyflag = 1; |
| 213 | 213 | // nb1413m3_busyctr = 0; |
| 214 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 214 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 215 | 215 | |
| 216 | 216 | #if NB1413M3_DEBUG |
| 217 | 217 | popmessage("NMI SW:%01X CLOCK:%02X COUNT:%02X", nb1413m3_nmi_enable, nb1413m3_nmi_clock, nb1413m3_nmi_count); |
| r1591 | r1592 | |
|---|---|---|
| 23 | 23 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit |
| 24 | 24 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract |
| 25 | 25 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker |
| 26 | } | |
| 26 | 27 | |
| 27 | if (GAME_IS_SOCCER) | |
| 28 | { | |
| 29 | /* bit 0 = whistle */ | |
| 30 | /* bit 1 = hit */ | |
| 31 | /* bit 2 = kicker */ | |
| 32 | /* bit 3 = unused */ | |
| 33 | /* bit 4 = 2/4 Player LED */ // Say what? | |
| 34 | /* bit 5-6 = trackball CTRL bits */ | |
| 35 | /* bit 7 = Rule LED */ | |
| 36 | // set_led_status(0,data & 0x10); // !!!!!!!!!! Is this correct???? | |
| 37 | set_led_status(1,data & 0x80); | |
| 38 | } | |
| 39 | 28 | |
| 40 | if (GAME_IS_FOOTBALL4) | |
| 41 | coin_counter_w (1, data & 0x80); | |
| 29 | WRITE8_HANDLER( atarifb4_out1_w ) | |
| 30 | { | |
| 31 | CTRLD = data; | |
| 42 | 32 | |
| 43 | if (GAME_IS_BASEBALL) | |
| 33 | discrete_sound_w(ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 34 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 35 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 36 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 37 | ||
| 38 | coin_counter_w (1, data & 0x80); | |
| 39 | } | |
| 40 | ||
| 41 | ||
| 42 | WRITE8_HANDLER( abaseb_out1_w ) | |
| 43 | { | |
| 44 | CTRLD = data; | |
| 45 | ||
| 46 | discrete_sound_w(ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 47 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 48 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 49 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 50 | ||
| 51 | if (data & 0x80) | |
| 44 | 52 | { |
| 45 | if (data & 0x80) | |
| 46 | { | |
| 47 | /* Invert video */ | |
| 48 | palette_set_color(Machine,1,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 49 | palette_set_color(Machine,0,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 50 | } | |
| 51 | else | |
| 52 | { | |
| 53 | /* Regular video */ | |
| 54 | palette_set_color(Machine,0,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 55 | palette_set_color(Machine,1,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 56 | } | |
| 53 | /* Invert video */ | |
| 54 | palette_set_color(Machine,1,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 55 | palette_set_color(Machine,0,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 57 | 56 | } |
| 57 | else | |
| 58 | { | |
| 59 | /* Regular video */ | |
| 60 | palette_set_color(Machine,0,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 61 | palette_set_color(Machine,1,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 62 | } | |
| 58 | 63 | } |
| 59 | 64 | |
| 60 | 65 | |
| 66 | WRITE8_HANDLER( soccer_out1_w ) | |
| 67 | { | |
| 68 | CTRLD = data; | |
| 69 | ||
| 70 | /* bit 0 = whistle */ | |
| 71 | /* bit 1 = hit */ | |
| 72 | /* bit 2 = kicker */ | |
| 73 | /* bit 3 = unused */ | |
| 74 | /* bit 4 = 2/4 Player LED */ // Say what? | |
| 75 | /* bit 5-6 = trackball CTRL bits */ | |
| 76 | /* bit 7 = Rule LED */ | |
| 77 | ||
| 78 | discrete_sound_w(ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 79 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 80 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 81 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 82 | ||
| 83 | // set_led_status(0,data & 0x10); // !!!!!!!!!! Is this correct???? | |
| 84 | set_led_status(1,data & 0x80); | |
| 85 | } | |
| 86 | ||
| 87 | ||
| 61 | 88 | WRITE8_HANDLER( atarifb_out2_w ) |
| 62 | 89 | { |
| 63 | 90 | discrete_sound_w(ATARIFB_CROWD_DATA, data & 0x0f); // Crowd |
| 64 | 91 | |
| 65 | 92 | coin_counter_w (0, data & 0x10); |
| 93 | } | |
| 66 | 94 | |
| 67 | if (GAME_IS_SOCCER) | |
| 68 | { | |
| 69 | coin_counter_w (1, data & 0x20); | |
| 70 | coin_counter_w (2, data & 0x40); | |
| 71 | } | |
| 95 | ||
| 96 | WRITE8_HANDLER( soccer_out2_w ) | |
| 97 | { | |
| 98 | discrete_sound_w(ATARIFB_CROWD_DATA, data & 0x0f); // Crowd | |
| 99 | ||
| 100 | coin_counter_w (0, data & 0x10); | |
| 101 | coin_counter_w (1, data & 0x20); | |
| 102 | coin_counter_w (2, data & 0x40); | |
| 72 | 103 | } |
| 73 | 104 | |
| 74 | 105 | |
| 106 | ||
| 75 | 107 | /************************************* |
| 76 | 108 | * |
| 77 | 109 | * LED control |
| r1591 | r1592 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | READ8_HANDLER( simpsons_sound_interrupt_r ) |
| 103 | 103 | { |
| 104 | cpunum_set_input_line_and_vector( 1, 0, HOLD_LINE, 0xff ); | |
| 104 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff ); | |
| 105 | 105 | return 0x00; |
| 106 | 106 | } |
| 107 | 107 |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | { |
| 31 | 31 | /* only do NMI interrupt if not in TEST mode */ |
| 32 | 32 | if ((input_port_2_r(0) & 0x40)==0x40) |
| 33 | cpunum_set_input_line(0,INPUT_LINE_NMI,PULSE_LINE); | |
| 33 | cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /*************************************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 143 | 143 | watchdog_reset_w(0, data); |
| 144 | 144 | else{ |
| 145 | 145 | if (firq_enable) /* Cause interrupt on slave CPU */ |
| 146 | cpunum_set_input_line(1, M6809_FIRQ_LINE, HOLD_LINE); | |
| 146 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, HOLD_LINE); | |
| 147 | 147 | } |
| 148 | 148 | break; |
| 149 | 149 | case 0x01: /* Cause interrupt on audio CPU */ |
| 150 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 150 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 151 | 151 | break; |
| 152 | 152 | case 0x02: /* Sound command number */ |
| 153 | 153 | soundlatch_w(offset,data); |
| r1591 | r1592 | |
| 218 | 218 | INTERRUPT_GEN( ajax_interrupt ) |
| 219 | 219 | { |
| 220 | 220 | if (K051960_is_IRQ_enabled()) |
| 221 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 221 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 222 | 222 | } |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | if ((ddrB & 0x02) && (~portB_out & 0x02) && (data & 0x02)) /* positive going transition of the clock */ |
| 46 | 46 | { |
| 47 | cpunum_set_input_line(3,0,CLEAR_LINE); | |
| 47 | cpunum_set_input_line(Machine, 3,0,CLEAR_LINE); | |
| 48 | 48 | main_sent = 0; |
| 49 | 49 | |
| 50 | 50 | } |
| r1591 | r1592 | |
| 85 | 85 | { |
| 86 | 86 | portA_in = data; |
| 87 | 87 | main_sent = 1; |
| 88 | cpunum_set_input_line(3,0,ASSERT_LINE); | |
| 88 | cpunum_set_input_line(Machine, 3,0,ASSERT_LINE); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 |
| r1591 | r1592 | |
|---|---|---|
| 66 | 66 | int vpos = video_screen_get_vpos(0); |
| 67 | 67 | UINT8 counter = vpos_to_vysnc_chain_counter(vpos); |
| 68 | 68 | UINT8 vector = 0xc7 | ((counter & 0x40) >> 2) | ((~counter & 0x40) >> 3); |
| 69 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, vector); | |
| 69 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, vector); | |
| 70 | 70 | |
| 71 | 71 | /* set up for next interrupt */ |
| 72 | 72 | if (counter == MW8080BW_INT_TRIGGER_COUNT_1) |
| r1591 | r1592 | |
|---|---|---|
| 1303 | 1303 | DRIVER( snakjack ) /* (c) 1984 */ |
| 1304 | 1304 | DRIVER( stocker ) /* (c) 1984 */ |
| 1305 | 1305 | DRIVER( triviag1 ) /* (c) 1984 */ |
| 1306 | DRIVER( trivia12 ) /* (c) 1984 */ | |
| 1306 | 1307 | DRIVER( triviag2 ) /* (c) 1984 */ |
| 1307 | 1308 | DRIVER( triviasp ) /* (c) 1984 */ |
| 1308 | 1309 | DRIVER( triviayp ) /* (c) 1984 */ |
| r1591 | r1592 | |
| 1314 | 1315 | DRIVER( toggle ) /* (c) 1985 */ |
| 1315 | 1316 | DRIVER( nametune ) /* (c) 1986 */ |
| 1316 | 1317 | DRIVER( nstocker ) /* (c) 1986 */ |
| 1318 | DRIVER( nstockr2 ) /* (c) 1986 */ | |
| 1317 | 1319 | DRIVER( sfootbal ) /* (c) 1986 */ |
| 1318 | 1320 | DRIVER( spiker ) /* (c) 1986 */ |
| 1319 | 1321 | DRIVER( stompin ) /* (c) 1986 */ |
| r1591 | r1592 | |
| 4078 | 4080 | DRIVER( acombat ) /* bootleg */ |
| 4079 | 4081 | DRIVER( acombato ) /* bootleg */ |
| 4080 | 4082 | DRIVER( sstarbtl ) /* bootleg */ |
| 4081 | DRIVER( spfghmk2 ) /* (c) [1980] Data East Corporation */ | |
| 4082 | DRIVER( spfgmk22 ) /* (c) [1980] Data East Corporation */ | |
| 4083 | DRIVER( spfghmk2 ) /* (c) [1979] Data East Corporation */ | |
| 4084 | DRIVER( spfgmk22 ) /* (c) [1979] Data East Corporation */ | |
| 4083 | 4085 | DRIVER( tomahawk ) /* (c) 1980 Data East, Inc. */ |
| 4084 | 4086 | DRIVER( tomahaw1 ) /* (c) 1980 Data East, Inc. */ |
| 4085 | 4087 | DRIVER( progolf ) /* (c) 1981 */ |
| r1591 | r1592 | |
| 5871 | 5873 | DRIVER( ninjak2b ) /* UPL-????? (c) 1987 */ |
| 5872 | 5874 | DRIVER( rdaction ) /* UPL-87003?(c) 1987 + World Games license */ |
| 5873 | 5875 | DRIVER( mnight ) /* UPL-????? (c) 1987 distributed by Kawakus */ |
| 5874 | DRIVER( arkarea ) /* UPL-87007 (c) [198 | |
| 5876 | DRIVER( arkarea ) /* UPL-87007 (c) [1987 | |
| 5875 | 5877 | DRIVER( robokid ) /* UPL-88013 (c) 1988 */ |
| 5876 | 5878 | DRIVER( robokidj ) /* UPL-88013 (c) 1988 */ |
| 5877 | 5879 | DRIVER( robokdj2 ) /* UPL-88013 (c) 1988 */ |
| r1591 | r1592 | |
| 6264 | 6266 | DRIVER( heatbrl ) /* (c) 1992 Tad (World) */ |
| 6265 | 6267 | DRIVER( heatbrlo ) /* (c) 1992 Tad (World) */ |
| 6266 | 6268 | DRIVER( heatbrlu ) /* (c) 1992 Tad (US) */ |
| 6267 | DRIVER( hetbrlu2 ) /* (c) 1992 Tad (US) */ | |
| 6268 | 6269 | DRIVER( godzilla ) /* (c) 1993 Banpresto */ |
| 6269 | 6270 | DRIVER( denjinmk ) /* (c) 199? Banpresto */ |
| 6270 | 6271 | DRIVER( sdgndmrb ) /* (c) 1993 Banpresto */ |
| r1591 | r1592 | |
| 7896 | 7897 | DRIVER( eshb ) /* (c) 1984 Funai / Gakken */ |
| 7897 | 7898 | DRIVER( comebaby ) /* (c) 2000 ExPotato */ |
| 7898 | 7899 | DRIVER( peset038 ) /* (c) 1987 IGT - International Gaming Technology */ |
| 7900 | DRIVER( pepp0065 ) /* (c) 1987 IGT - International Gaming Technology */ | |
| 7899 | 7901 | DRIVER( pepp0158 ) /* (c) 1987 IGT - International Gaming Technology */ |
| 7900 | 7902 | DRIVER( pepp0188 ) /* (c) 1987 IGT - International Gaming Technology */ |
| 7903 | DRIVER( pepp0250 ) /* (c) 1987 IGT - International Gaming Technology */ | |
| 7904 | DRIVER( pepp0447 ) /* (c) 1987 IGT - International Gaming Technology */ | |
| 7901 | 7905 | DRIVER( pepp0516 ) /* (c) 1987 IGT - International Gaming Technology */ |
| 7902 | 7906 | DRIVER( pebe0014 ) /* (c) 1994 IGT - International Gaming Technology */ |
| 7903 | 7907 | DRIVER( peke1012 ) /* (c) 1994 IGT - International Gaming Technology */ |
| r0 | r1592 | |
|---|---|---|
| 1 | extern WRITE8_HANDLER( ninjakd2_bgvideoram_w ); | |
| 2 | extern WRITE8_HANDLER( ninjakd2_fgvideoram_w ); | |
| 3 | extern WRITE8_HANDLER( ninjakd2_bg_ctrl_w ); | |
| 4 | extern WRITE8_HANDLER( ninjakd2_sprite_overdraw_w ); | |
| 5 | ||
| 6 | extern READ8_HANDLER( robokid_bg0_videoram_r ); | |
| 7 | extern READ8_HANDLER( robokid_bg1_videoram_r ); | |
| 8 | extern READ8_HANDLER( robokid_bg2_videoram_r ); | |
| 9 | extern WRITE8_HANDLER( robokid_bg0_videoram_w ); | |
| 10 | extern WRITE8_HANDLER( robokid_bg1_videoram_w ); | |
| 11 | extern WRITE8_HANDLER( robokid_bg2_videoram_w ); | |
| 12 | extern WRITE8_HANDLER( robokid_bg0_ctrl_w ); | |
| 13 | extern WRITE8_HANDLER( robokid_bg1_ctrl_w ); | |
| 14 | extern WRITE8_HANDLER( robokid_bg2_ctrl_w ); | |
| 15 | extern WRITE8_HANDLER( robokid_bg0_bank_w ); | |
| 16 | extern WRITE8_HANDLER( robokid_bg1_bank_w ); | |
| 17 | extern WRITE8_HANDLER( robokid_bg2_bank_w ); | |
| 18 | ||
| 19 | extern VIDEO_START( ninjakd2 ); | |
| 20 | extern VIDEO_START( mnight ); | |
| 21 | extern VIDEO_START( robokid ); | |
| 22 | extern VIDEO_START( omegaf ); | |
| 23 | extern VIDEO_UPDATE( ninjakd2 ); | |
| 24 | extern VIDEO_UPDATE( robokid ); | |
| 25 | extern VIDEO_UPDATE( omegaf ); | |
| 26 | extern VIDEO_EOF( ninjakd2 ); | |
| 27 | ||
| 28 | extern UINT8* ninjakd2_bg_videoram; | |
| 29 | extern UINT8* ninjakd2_fg_videoram; |
| r1591 | r1592 | |
|---|---|---|
| 7 | 7 | #define MASTER_CLOCK XTAL_11MHz |
| 8 | 8 | |
| 9 | 9 | #define PIXEL_CLOCK (MASTER_CLOCK/2) |
| 10 | #define CPU_CLOCK (PIXEL_CLOCK | |
| 10 | #define CPU_CLOCK (PIXEL_CLOCK | |
| 11 | 11 | #define HTOTAL (512-160) |
| 12 | 12 | #define HBSTART (256) |
| 13 | 13 | #define HBEND (0) |
| r1591 | r1592 | |
| 53 | 53 | /*----------- defined in video/phoenix.c -----------*/ |
| 54 | 54 | |
| 55 | 55 | PALETTE_INIT( phoenix ); |
| 56 | PALETTE_INIT( survival ); | |
| 56 | 57 | PALETTE_INIT( pleiads ); |
| 57 | 58 | VIDEO_START( phoenix ); |
| 58 | VIDEO_START( pleiads ); | |
| 59 | 59 | VIDEO_UPDATE( phoenix ); |
| 60 | 60 | |
| 61 | 61 | WRITE8_HANDLER( phoenix_videoram_w ); |
| r1591 | r1592 | |
|---|---|---|
| 27 | 27 | VIDEO_UPDATE( astrocde ); |
| 28 | 28 | VIDEO_UPDATE( profpac ); |
| 29 | 29 | |
| 30 | void astrocade_trigger_lightpen(UINT8 vfeedback, UINT8 hfeedback); | |
| 31 | ||
| 32 | 30 | WRITE8_HANDLER( astrocade_pattern_board_w ); |
| 33 | 31 | READ8_HANDLER( astrocade_data_chip_register_r ); |
| 34 | 32 | WRITE8_HANDLER( astrocade_data_chip_register_w ); |
| r1591 | r1592 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | /*----------- defined in audio/exidy.c -----------*/ |
| 26 | 26 | |
| 27 | void *exidy_sh6840_sh_start(int clock, const struct CustomSound_interface *config); | |
| 28 | void exidy_sh6840_sh_reset(void *token); | |
| 29 | ||
| 30 | WRITE8_HANDLER( exidy_sh6840_w ); | |
| 31 | WRITE8_HANDLER( exidy_sfxctrl_w ); | |
| 32 | ||
| 27 | 33 | MACHINE_DRIVER_EXTERN( venture_audio ); |
| 28 | 34 | |
| 29 | 35 | MACHINE_DRIVER_EXTERN( mtrap_cvsd_audio ); |
| r1591 | r1592 | |
| 33 | 39 | READ8_HANDLER( victory_sound_status_r ); |
| 34 | 40 | WRITE8_HANDLER( victory_sound_command_w ); |
| 35 | 41 | |
| 36 | MACHINE_DRIVER_EXTERN( berzerk_audio ); | |
| 37 | WRITE8_HANDLER( berzerk_audio_w ); | |
| 38 | READ8_HANDLER( berzerk_audio_r ); | |
| 39 | 42 | |
| 40 | 43 | |
| 41 | 44 | /*----------- defined in video/exidy.c -----------*/ |
| r1591 | r1592 | |
|---|---|---|
| 25 | 25 | * 256VF is not being used, so counting is from 248...255, 0...255, .... |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | #define MASTER_CLOCK 6144 | |
| 28 | #define MASTER_CLOCK XTAL_61_44MHz | |
| 29 | 29 | #define CLOCK_1H (MASTER_CLOCK / 5 / 4) |
| 30 | 30 | #define CLOCK_16H (CLOCK_1H / 16) |
| 31 | 31 | #define CLOCK_1VF ((CLOCK_16H) / 12 / 2) |
| r1591 | r1592 | |
| 39 | 39 | #define VBSTART (240) |
| 40 | 40 | #define VBEND (16) |
| 41 | 41 | |
| 42 | #define I8035_MASTER_CLOCK (6000000) | |
| 43 | #define I8035_DIVIDER (15) | |
| 44 | #define I8035_CLOCK (I8035_MASTER_CLOCK/I8035_DIVIDER) | |
| 42 | #define I8035_CLOCK (XTAL_6MHz) | |
| 45 | 43 | |
| 46 | 44 | #define HARDWARE_TYPE_TAG "HARDWARE_TYPE" |
| 47 | 45 | #define HARDWARE_TKG04 0 |
| r1591 | r1592 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | /* Game-specific later-Williams PIA interfaces */ |
| 38 | 38 | extern const pia6821_interface mysticm_pia_0_intf; |
| 39 | extern const pia6821_interface mysticm_pia_1_intf; | |
| 39 | 40 | extern const pia6821_interface tshoot_pia_0_intf; |
| 41 | extern const pia6821_interface tshoot_pia_1_intf; | |
| 40 | 42 | extern const pia6821_interface tshoot_snd_pia_intf; |
| 41 | 43 | extern const pia6821_interface joust2_pia_1_intf; |
| 42 | 44 |
| r1591 | r1592 | |
|---|---|---|
| 97 | 97 | extern void sys16_patch_code( int offset, int data ); |
| 98 | 98 | |
| 99 | 99 | #define SYS16_MWA16_PALETTERAM sys16_paletteram_w |
| 100 | #define SYS16_MRA16_PALETTERAM | |
| 100 | #define SYS16_MRA16_PALETTERAM MRA | |
| 101 | 101 | |
| 102 | 102 | #define SYS16_MRA16_WORKINGRAM MRA16_RAM |
| 103 | 103 | #define SYS16_MWA16_WORKINGRAM MWA16_RAM |
| r0 | r1592 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Irem Red Alert hardware | |
| 4 | ||
| 5 | If you have any questions about how this driver works, don't hesitate to | |
| 6 | ask. - Mike Balfour (mab22@po.cwru.edu) | |
| 7 | ||
| 8 | ****************************************************************************/ | |
| 9 | ||
| 10 | /*----------- defined in audio/redalert.c -----------*/ | |
| 11 | ||
| 12 | WRITE8_HANDLER( redalert_audio_command_w ); | |
| 13 | WRITE8_HANDLER( redalert_voice_command_w ); | |
| 14 | ||
| 15 | WRITE8_HANDLER( demoneye_audio_command_w ); | |
| 16 | ||
| 17 | MACHINE_DRIVER_EXTERN( redalert_audio ); | |
| 18 | MACHINE_DRIVER_EXTERN( demoneye_audio ); | |
| 19 | ||
| 20 | ||
| 21 | /*----------- defined in video/redalert.c -----------*/ | |
| 22 | ||
| 23 | extern UINT8 *redalert_bitmap_videoram; | |
| 24 | extern UINT8 *redalert_bitmap_color; | |
| 25 | extern UINT8 *redalert_charmap_videoram; | |
| 26 | extern UINT8 *redalert_video_control; | |
| 27 | WRITE8_HANDLER( redalert_bitmap_videoram_w ); | |
| 28 | ||
| 29 | MACHINE_DRIVER_EXTERN( redalert_video ); | |
| 30 | MACHINE_DRIVER_EXTERN( demoneye_video ); |
| r1591 | r1592 | |
|---|---|---|
| 45 | 45 | UINT8 gfx_bank; |
| 46 | 46 | UINT8 palette_bank; |
| 47 | 47 | UINT16 gfx_scroll; |
| 48 | UINT8 flip; | |
| 48 | 49 | |
| 50 | /* driver general */ | |
| 51 | ||
| 52 | UINT8 *spriteram; | |
| 53 | UINT8 *videoram; | |
| 54 | size_t spriteram_size; | |
| 49 | 55 | tilemap *bg_tilemap; |
| 50 | 56 | int monitor; |
| 51 | 57 | }; |
| r1591 | r1592 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "sound/discrete.h" |
| 8 | 8 | |
| 9 | #define GAME_IS_FOOTBALL (atarifb_game == 1) | |
| 10 | #define GAME_IS_FOOTBALL4 (atarifb_game == 2) | |
| 11 | #define GAME_IS_BASEBALL (atarifb_game == 3) | |
| 12 | #define GAME_IS_SOCCER (atarifb_game == 4) | |
| 13 | 9 | |
| 14 | 10 | /* Discrete Sound Input Nodes */ |
| 15 | 11 | #define ATARIFB_WHISTLE_EN NODE_01 |
| r1591 | r1592 | |
| 19 | 15 | #define ATARIFB_HIT_EN NODE_05 |
| 20 | 16 | |
| 21 | 17 | |
| 22 | /*----------- defined in drivers/atarifb.c -----------*/ | |
| 23 | ||
| 24 | extern int atarifb_game; | |
| 25 | ||
| 26 | ||
| 27 | 18 | /*----------- defined in machine/atarifb.c -----------*/ |
| 28 | 19 | |
| 29 | 20 | WRITE8_HANDLER( atarifb_out1_w ); |
| 21 | WRITE8_HANDLER( atarifb4_out1_w ); | |
| 22 | WRITE8_HANDLER( abaseb_out1_w ); | |
| 23 | WRITE8_HANDLER( soccer_out1_w ); | |
| 24 | ||
| 30 | 25 | WRITE8_HANDLER( atarifb_out2_w ); |
| 26 | WRITE8_HANDLER( soccer_out2_w ); | |
| 27 | ||
| 31 | 28 | WRITE8_HANDLER( atarifb_out3_w ); |
| 29 | ||
| 32 | 30 | READ8_HANDLER( atarifb_in0_r ); |
| 33 | 31 | READ8_HANDLER( atarifb_in2_r ); |
| 34 | 32 | READ8_HANDLER( atarifb4_in0_r ); |
| r1591 | r1592 | |
| 43 | 41 | |
| 44 | 42 | /*----------- defined in video/atarifb.c -----------*/ |
| 45 | 43 | |
| 46 | extern size_t atarifb_alphap1_vram_size; | |
| 47 | extern size_t atarifb_alphap2_vram_size; | |
| 48 | extern UINT8 *atarifb_alphap1_vram; | |
| 49 | extern UINT8 *atarifb_alphap2_vram; | |
| 44 | extern UINT8 *atarifb_alphap1_videoram; | |
| 45 | extern UINT8 *atarifb_alphap2_videoram; | |
| 46 | extern UINT8 *atarifb_field_videoram; | |
| 50 | 47 | extern UINT8 *atarifb_scroll_register; |
| 51 | 48 | |
| 49 | VIDEO_START( atarifb ); | |
| 52 | 50 | VIDEO_UPDATE( atarifb ); |
| 51 | VIDEO_UPDATE( abaseb ); | |
| 52 | VIDEO_UPDATE( soccer ); | |
| 53 | ||
| 54 | WRITE8_HANDLER( atarifb_alpha1_videoram_w ); | |
| 55 | WRITE8_HANDLER( atarifb_alpha2_videoram_w ); | |
| 56 | WRITE8_HANDLER( atarifb_field_videoram_w ); |
| r1591 | r1592 | |
|---|---|---|
| 243 | 243 | SOUNDS += NAMCONA |
| 244 | 244 | SOUNDS += TMS36XX |
| 245 | 245 | SOUNDS += TMS3615 |
| 246 | SOUNDS += TMS5100 | |
| 246 | 247 | SOUNDS += TMS5110 |
| 248 | SOUNDS += TMS5110A | |
| 249 | SOUNDS += CD2801 | |
| 250 | SOUNDS += TMC0281 | |
| 251 | SOUNDS += CD2802 | |
| 252 | SOUNDS += M58817 | |
| 247 | 253 | SOUNDS += TMC0285 |
| 248 | 254 | SOUNDS += TMS5200 |
| 249 | 255 | SOUNDS += TMS5220 |
| r1591 | r1592 | |
| 359 | 365 | $(MAMEOBJ)/orca.a \ |
| 360 | 366 | $(MAMEOBJ)/pacific.a \ |
| 361 | 367 | $(MAMEOBJ)/pacman.a \ |
| 368 | $(MAMEOBJ)/pce.a \ | |
| 362 | 369 | $(MAMEOBJ)/phoenix.a \ |
| 363 | 370 | $(MAMEOBJ)/playmark.a \ |
| 364 | 371 | $(MAMEOBJ)/psikyo.a \ |
| r1591 | r1592 | |
| 1085 | 1092 | $(MACHINE)/pacplus.o \ |
| 1086 | 1093 | $(MACHINE)/theglobp.o \ |
| 1087 | 1094 | |
| 1095 | $(MAMEOBJ)/pce.a: \ | |
| 1096 | $(DRIVERS)/uapce.o \ | |
| 1097 | $(DRIVERS)/paranoia.o \ | |
| 1098 | $(MACHINE)/pcecommn.o $(VIDEO)/vdc.o \ | |
| 1099 | ||
| 1088 | 1100 | $(MAMEOBJ)/phoenix.a: \ |
| 1089 | 1101 | $(DRIVERS)/naughtyb.o $(VIDEO)/naughtyb.o \ |
| 1090 | 1102 | $(DRIVERS)/phoenix.o $(AUDIO)/phoenix.o $(VIDEO)/phoenix.o \ |
| r1591 | r1592 | |
| 1428 | 1440 | $(DRIVERS)/superdq.o |
| 1429 | 1441 | |
| 1430 | 1442 | $(MAMEOBJ)/upl.a: \ |
| 1431 | $(DRIVERS)/mnight.o $(VIDEO)/mnight.o \ | |
| 1432 | 1443 | $(DRIVERS)/mouser.o $(VIDEO)/mouser.o \ |
| 1433 | $(DRIVERS)/ninjak | |
| 1444 | $(DRIVERS)/ninjakun.o $(VIDEO)/ninjakun.o \ | |
| 1434 | 1445 | $(DRIVERS)/ninjakd2.o $(VIDEO)/ninjakd2.o \ |
| 1435 | 1446 | $(DRIVERS)/nova2001.o $(VIDEO)/nova2001.o \ |
| 1436 | $(DRIVERS)/omegaf.o $(VIDEO)/omegaf.o \ | |
| 1437 | 1447 | $(DRIVERS)/pkunwar.o $(VIDEO)/pkunwar.o \ |
| 1438 | 1448 | $(DRIVERS)/raiders5.o $(VIDEO)/raiders5.o \ |
| 1439 | 1449 | $(DRIVERS)/xxmissio.o $(VIDEO)/xxmissio.o \ |
| r1591 | r1592 | |
| 1621 | 1631 | $(DRIVERS)/vroulet.o \ |
| 1622 | 1632 | $(DRIVERS)/wldarrow.o \ |
| 1623 | 1633 | $(DRIVERS)/xyonix.o $(VIDEO)/xyonix.o \ |
| 1624 | $(DRIVERS)/uapce.o $(DRIVERS)/paranoia.o $(VIDEO)/vdc.o $(MACHINE)/pcecommn.o \ | |
| 1625 | 1634 | |
| 1626 | 1635 | |
| 1627 | 1636 | #------------------------------------------------- |
| r1591 | r1592 | |
|---|---|---|
| 82 | 82 | paletteram = auto_malloc(0x200); |
| 83 | 83 | paletteram_2 = auto_malloc(0x200); |
| 84 | 84 | tilemap_set_scroll_cols(bg_tilemap,32); |
| 85 | video_start_generic(machine); | |
| 86 | 85 | } |
| 87 | 86 | |
| 88 | 87 | WRITE8_HANDLER( nycaptor_videoram_w ) |
| r1591 | r1592 | |
|---|---|---|
| 229 | 229 | |
| 230 | 230 | READ8_HANDLER( pang_paletteram_r ) |
| 231 | 231 | { |
| 232 | if (paletteram_bank) return paletteram_r(offset + 0x800); | |
| 233 | return paletteram_r(offset); | |
| 232 | if (paletteram_bank) return paletteram[offset + 0x800]; | |
| 233 | return paletteram[offset]; | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | WRITE8_HANDLER( mgakuen_paletteram_w ) |
| r1591 | r1592 | |
| 240 | 240 | |
| 241 | 241 | READ8_HANDLER( mgakuen_paletteram_r ) |
| 242 | 242 | { |
| 243 | return paletteram | |
| 243 | return paletteram[ | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 |
| r1591 | r1592 | |
|---|---|---|
| 160 | 160 | coin_counter_w(1,data & 2); |
| 161 | 161 | |
| 162 | 162 | /* bit 5 resets the sound CPU */ |
| 163 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 163 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 164 | 164 | |
| 165 | 165 | /* bit 6 flips screen */ |
| 166 | 166 | flip_screen_set(data & 0x40); |
| r1591 | r1592 | |
|---|---|---|
| 100 | 100 | { |
| 101 | 101 | int i; |
| 102 | 102 | |
| 103 | | |
| 103 | VIDEO_START_CALL(common | |
| 104 | 104 | |
| 105 | 105 | /* init for 4-bit */ |
| 106 | 106 | for (i = 0; i < 65536; i++) |
| r1591 | r1592 | |
| 113 | 113 | { |
| 114 | 114 | int i; |
| 115 | 115 | |
| 116 | | |
| 116 | VIDEO_START_CALL(common | |
| 117 | 117 | |
| 118 | 118 | /* init for 6-bit */ |
| 119 | 119 | for (i = 0; i < 65536; i++) |
| r1591 | r1592 | |
| 124 | 124 | |
| 125 | 125 | VIDEO_START( mkyawdim ) |
| 126 | 126 | { |
| 127 | | |
| 127 | VIDEO_START_CALL(midyunit_6bit | |
| 128 | 128 | yawdim_dma = 1; |
| 129 | 129 | } |
| 130 | 130 | |
| r1591 | r1592 | |
| 133 | 133 | { |
| 134 | 134 | int i; |
| 135 | 135 | |
| 136 | | |
| 136 | VIDEO_START_CALL(common | |
| 137 | 137 | |
| 138 | 138 | /* init for 8-bit */ |
| 139 | 139 | for (i = 0; i < 65536; i++) |
| r1591 | r1592 | |
| 390 | 390 | static TIMER_CALLBACK( dma_callback ) |
| 391 | 391 | { |
| 392 | 392 | dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */ |
| 393 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 393 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | |
| r1591 | r1592 | |
| 453 | 453 | |
| 454 | 454 | /* high bit triggers action */ |
| 455 | 455 | command = dma_register[DMA_COMMAND]; |
| 456 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 456 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 457 | 457 | if (!(command & 0x8000)) |
| 458 | 458 | return; |
| 459 | 459 |
| r1591 | r1592 | |
|---|---|---|
| 318 | 318 | if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/ |
| 319 | 319 | { |
| 320 | 320 | logerror( "Interrupt: Sprite draw end, Vector 0x4d, Level 0x02\n" ); |
| 321 | cpunum_set_input_line_and_vector(0, 2, HOLD_LINE , 0x4d); | |
| 321 | cpunum_set_input_line_and_vector(Machine, 0, 2, HOLD_LINE , 0x4d); | |
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | } |
| r1591 | r1592 | |
| 1996 | 1996 | |
| 1997 | 1997 | /* not here! this is done every frame drawn even if the cpu isn't running eg in the debugger */ |
| 1998 | 1998 | // if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/ |
| 1999 | // cpunum_set_input_line_and_vector(0, 2, HOLD_LINE , 0x4d); | |
| 1999 | // cpunum_set_input_line_and_vector(Machine, 0, 2, HOLD_LINE , 0x4d); | |
| 2000 | 2000 | |
| 2001 | 2001 | if (vdp1_sprite_log) logerror ("End of list processing!\n"); |
| 2002 | 2002 | } |
| r1591 | r1592 | |
|---|---|---|
| 135 | 135 | galpani2_bg8_bitmap_0 = auto_bitmap_alloc(512, 256, BITMAP_FORMAT_INDEXED16); |
| 136 | 136 | galpani2_bg8_bitmap_1 = auto_bitmap_alloc(512, 256, BITMAP_FORMAT_INDEXED16); |
| 137 | 137 | |
| 138 | | |
| 138 | VIDEO_START_CALL(kaneko16_sprites | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 |
| r1591 | r1592 | |
|---|---|---|
| 245 | 245 | |
| 246 | 246 | /* latch 0x50 clears IRQ4 */ |
| 247 | 247 | case 0x50: |
| 248 | cpunum_set_input_line(0, R3000_IRQ4, CLEAR_LINE); | |
| 248 | cpunum_set_input_line(Machine, 0, R3000_IRQ4, CLEAR_LINE); | |
| 249 | 249 | break; |
| 250 | 250 | |
| 251 | 251 | /* latch 0x60 clears IRQ5 */ |
| 252 | 252 | case 0x60: |
| 253 | cpunum_set_input_line(0, R3000_IRQ5, CLEAR_LINE); | |
| 253 | cpunum_set_input_line(Machine, 0, R3000_IRQ5, CLEAR_LINE); | |
| 254 | 254 | break; |
| 255 | 255 | |
| 256 | 256 | /* log anything else */ |
| r1591 | r1592 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | VIDEO_START( midwunit ) |
| 109 | 109 | { |
| 110 | | |
| 110 | VIDEO_START_CALL(midtunit | |
| 111 | 111 | midtunit_gfx_rom_large = 1; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | VIDEO_START( midxunit ) |
| 116 | 116 | { |
| 117 | | |
| 117 | VIDEO_START_CALL(midtunit | |
| 118 | 118 | midtunit_gfx_rom_large = 1; |
| 119 | 119 | videobank_select = 1; |
| 120 | 120 | } |
| r1591 | r1592 | |
| 311 | 311 | |
| 312 | 312 | READ16_HANDLER( midxunit_paletteram_r ) |
| 313 | 313 | { |
| 314 | return paletteram16 | |
| 314 | return paletteram16[ | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | |
| r1591 | r1592 | |
| 594 | 594 | static TIMER_CALLBACK( dma_callback ) |
| 595 | 595 | { |
| 596 | 596 | dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */ |
| 597 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 597 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | |
| r1591 | r1592 | |
| 684 | 684 | |
| 685 | 685 | /* high bit triggers action */ |
| 686 | 686 | command = dma_register[DMA_COMMAND]; |
| 687 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 687 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 688 | 688 | if (!(command & 0x8000)) |
| 689 | 689 | return; |
| 690 | 690 |
| r1591 | r1592 | |
|---|---|---|
| 76 | 76 | PALETTE_INIT( carpolo ) |
| 77 | 77 | { |
| 78 | 78 | /* thanks to Jarek Burczynski for analyzing the circuit */ |
| 79 | // const static float MAX_VOLTAGE = 6.9620; | |
| 80 | const static float MIN_VOLTAGE = 1.7434; | |
| 81 | const static float MAX_VOLTAGE = 5.5266; | |
| 79 | //static const float MAX_VOLTAGE = 6.9620f; | |
| 80 | static const float MIN_VOLTAGE = 1.7434f; | |
| 81 | static const float MAX_VOLTAGE = 5.5266f; | |
| 82 | 82 | |
| 83 | const static float r_voltage[] = { 1.7434, 2.1693, 2.5823, 3.0585, | |
| 84 | 3.4811, 4.0707, 4.7415, 5.4251 }; | |
| 83 | static const float r_voltage[] = | |
| 84 | { | |
| 85 | 1.7434f, 2.1693f, 2.5823f, 3.0585f, 3.4811f, 4.0707f, 4.7415f, 5.4251f | |
| 86 | }; | |
| 85 | 87 | |
| 86 | const static float g_voltage[] = { 1.7434, 2.1693, 2.5823, 3.0585, | |
| 87 | 3.4811, 4.0707, 4.7415, 5.4251 }; | |
| 88 | // const static float g_voltage[] = { 4.7871, 5.0613, 5.3079, 5.6114, | |
| 89 | // 5.7940, 6.1608, 6.5436, 6.9620 }; | |
| 88 | static const float g_voltage[] = | |
| 89 | { | |
| 90 | 1.7434f, 2.1693f, 2.5823f, 3.0585f, 3.4811f, 4.0707f, 4.7415f, 5.4251f | |
| 91 | //4.7871f, 5.0613f, 5.3079f, 5.6114f, 5.7940f, 6.1608f, 6.5436f, 6.9620f | |
| 92 | }; | |
| 90 | 93 | |
| 91 | const static float b_voltage[] = { 1.9176, 2.8757, 3.9825, 5.5266 }; | |
| 94 | static const float b_voltage[] = | |
| 95 | { | |
| 96 | 1.9176f, 2.8757f, 3.9825f, 5.5266f | |
| 97 | }; | |
| 92 | 98 | |
| 93 | 99 | |
| 94 | 100 | int i; |
| r1591 | r1592 | |
|---|---|---|
| 367 | 367 | |
| 368 | 368 | VIDEO_START( seta2_offset ) |
| 369 | 369 | { |
| 370 | | |
| 370 | VIDEO_START_CALL(seta2 | |
| 371 | 371 | |
| 372 | 372 | yoffset = 0x10; |
| 373 | 373 | } |
| r1591 | r1592 | |
|---|---|---|
| 771 | 771 | |
| 772 | 772 | VIDEO_START( mcnpshnt ) |
| 773 | 773 | { |
| 774 | | |
| 774 | VIDEO_START_CALL(hnoridur | |
| 775 | 775 | priority_table = priority_mcnpshnt; |
| 776 | 776 | } |
| 777 | 777 | |
| r1591 | r1592 | |
| 826 | 826 | |
| 827 | 827 | VIDEO_START( mjelctrn ) |
| 828 | 828 | { |
| 829 | | |
| 829 | VIDEO_START_CALL(hnoridur | |
| 830 | 830 | |
| 831 | 831 | priority_table = priority_mjelctrn; |
| 832 | 832 | update_irq_func = mjelctrn_update_irq; |
| r1591 | r1592 | |
| 834 | 834 | |
| 835 | 835 | VIDEO_START( neruton ) |
| 836 | 836 | { |
| 837 | | |
| 837 | VIDEO_START_CALL(hnoridur | |
| 838 | 838 | |
| 839 | 839 | // priority_table = priority_mjelctrn; |
| 840 | 840 | update_irq_func = neruton_update_irq; |
| r1591 | r1592 | |
| 1256 | 1256 | |
| 1257 | 1257 | VIDEO_START(htengoku) |
| 1258 | 1258 | { |
| 1259 | video_start_ddenlovr(machine); | |
| 1260 | video_start_hnoridur(machine); | |
| 1259 | VIDEO_START_CALL(ddenlovr); | |
| 1260 | VIDEO_START_CALL(hnoridur); | |
| 1261 | 1261 | framebuffer = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 1262 | 1262 | } |
| 1263 | 1263 | |
| r1591 | r1592 | |
| 1266 | 1266 | int layer,x,y; |
| 1267 | 1267 | |
| 1268 | 1268 | // render the layers, one by one, "dynax.c" style. Then convert the pixmaps to "ddenlovr.c" |
| 1269 | // format and let | |
| 1269 | // format and let VIDEO_EOF(ddenlovr) do the final compositing (priorities + palettes) | |
| 1270 | 1270 | for (layer = 0; layer < 4; layer++) |
| 1271 | 1271 | { |
| 1272 | 1272 | fillbitmap(framebuffer,0,&machine->screen[0].visarea); |
| r1591 | r1592 | |
| 1276 | 1276 | for (x=0; x < 512; x++) |
| 1277 | 1277 | ddenlovr_pixmap[3-layer][y*512+x] = (UINT8)(*BITMAP_ADDR16(framebuffer, y,x)); |
| 1278 | 1278 | } |
| 1279 | | |
| 1279 | VIDEO_EOF_CALL(ddenlovr | |
| 1280 | 1280 | } |
| r1591 | r1592 | |
|---|---|---|
| 156 | 156 | /* reset the genlock color */ |
| 157 | 157 | genlock_color = 0xffff; |
| 158 | 158 | |
| 159 | | |
| 159 | VIDEO_START_CALL(generic_bitmapped | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 |
| r1591 | r1592 | |
|---|---|---|
| 654 | 654 | we simply assert immediately if this is enabled. invasn needs this for proper |
| 655 | 655 | operations */ |
| 656 | 656 | if (zeusbase[0x80] & 0x02000000) |
| 657 | cpunum_set_input_line(0, 2, ASSERT_LINE); | |
| 657 | cpunum_set_input_line(Machine, 0, 2, ASSERT_LINE); | |
| 658 | 658 | else |
| 659 | cpunum_set_input_line(0, 2, CLEAR_LINE); | |
| 659 | cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE); | |
| 660 | 660 | break; |
| 661 | 661 | |
| 662 | 662 | case 0x84: |
| r1591 | r1592 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | VIDEO_START( avengers ) |
| 114 | 114 | { |
| 115 | | |
| 115 | VIDEO_START_CALL(trojan | |
| 116 | 116 | bAvengersHardware = 1; |
| 117 | 117 | } |
| 118 | 118 |
| r1591 | r1592 | |
|---|---|---|
| 275 | 275 | { |
| 276 | 276 | if (K001005_fifo_read_ptr < 0x3ff) |
| 277 | 277 | { |
| 278 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 278 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 279 | 279 | cpuintrf_push_context(2); |
| 280 | 280 | sharc_set_flag_input(1, CLEAR_LINE); |
| 281 | 281 | cpuintrf_pop_context(); |
| 282 | 282 | } |
| 283 | 283 | else |
| 284 | 284 | { |
| 285 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 285 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 286 | 286 | cpuintrf_push_context(2); |
| 287 | 287 | sharc_set_flag_input(1, ASSERT_LINE); |
| 288 | 288 | cpuintrf_pop_context(); |
| r1591 | r1592 | |
| 290 | 290 | } |
| 291 | 291 | else |
| 292 | 292 | { |
| 293 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 293 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 294 | 294 | cpuintrf_push_context(2); |
| 295 | 295 | sharc_set_flag_input(1, ASSERT_LINE); |
| 296 | 296 | cpuintrf_pop_context(); |
| r1591 | r1592 | |
| 334 | 334 | { |
| 335 | 335 | if (K001005_fifo_write_ptr < 0x400) |
| 336 | 336 | { |
| 337 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 337 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 338 | 338 | cpuintrf_push_context(2); |
| 339 | 339 | sharc_set_flag_input(1, ASSERT_LINE); |
| 340 | 340 | cpuintrf_pop_context(); |
| 341 | 341 | } |
| 342 | 342 | else |
| 343 | 343 | { |
| 344 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 344 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 345 | 345 | cpuintrf_push_context(2); |
| 346 | 346 | sharc_set_flag_input(1, CLEAR_LINE); |
| 347 | 347 | cpuintrf_pop_context(); |
| r1591 | r1592 | |
| 349 | 349 | } |
| 350 | 350 | else |
| 351 | 351 | { |
| 352 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 352 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 353 | 353 | cpuintrf_push_context(2); |
| 354 | 354 | sharc_set_flag_input(1, ASSERT_LINE); |
| 355 | 355 | cpuintrf_pop_context(); |
| r1591 | r1592 | |
| 1024 | 1024 | draw_7segment_led(bitmap, 3, 3, gticlub_led_reg0); |
| 1025 | 1025 | draw_7segment_led(bitmap, 9, 3, gticlub_led_reg1); |
| 1026 | 1026 | |
| 1027 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 1027 | //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 1028 | 1028 | cpuintrf_push_context(2); |
| 1029 | 1029 | sharc_set_flag_input(1, ASSERT_LINE); |
| 1030 | 1030 | cpuintrf_pop_context(); |
| r1591 | r1592 | |
|---|---|---|
| 668 | 668 | #define RC32 ((18e3 + 68e3) * 33e-6) |
| 669 | 669 | #define RC4 (90e3 * 0.47e-6) |
| 670 | 670 | #define dt (1./60./(double) VTOTAL) |
| 671 | #define period2 ((( | |
| 671 | #define period2 (((INT64 | |
| 672 | 672 | |
| 673 | 673 | static void radarscp_step(running_machine *machine, int line_cnt) |
| 674 | 674 | { |
| r1591 | r1592 | |
| 886 | 886 | { |
| 887 | 887 | dkong_state *state = machine->driver_data; |
| 888 | 888 | |
| 889 | | |
| 889 | VIDEO_START_CALL(dkong_bas | |
| 890 | 890 | |
| 891 | 891 | switch (state->hardware_type) |
| 892 | 892 | { |
| r1591 | r1592 | |
|---|---|---|
| 9 | 9 | scanline = (scanline + 1) % 0x80; |
| 10 | 10 | via_0_ca2_w (0, scanline & 0x10); |
| 11 | 11 | if ((scanline & 0x78) == 0x78) |
| 12 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 12 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 13 | 13 | else |
| 14 | cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 14 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | VIDEO_UPDATE( beezer ) |
| r1591 | r1592 | |
|---|---|---|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | if (ret) |
| 344 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 344 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | VIDEO_START( pce ) |
| r1591 | r1592 | |
| 540 | 540 | case 0x00: |
| 541 | 541 | temp = vdc[which].status; |
| 542 | 542 | vdc[which].status &= ~(VDC_VD | VDC_RR | VDC_CR | VDC_OR | VDC_DS); |
| 543 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 543 | cpunum_set_input_line(Machine, 0,0,CLEAR_LINE); | |
| 544 | 544 | break; |
| 545 | 545 | |
| 546 | 546 | case 0x02: |
| r1591 | r1592 | |
| 806 | 806 | if(sprites_drawn > 16) { |
| 807 | 807 | vdc[which].status |= VDC_OR; |
| 808 | 808 | if(vdc[which].vdc_data[CR].w&CR_OV) |
| 809 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 809 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 810 | 810 | continue; /* Should cause an interrupt */ |
| 811 | 811 | } |
| 812 | 812 | |
| r1591 | r1592 | |
| 843 | 843 | else if (drawn[pixel_x]==2) |
| 844 | 844 | { |
| 845 | 845 | if(vdc[which].vdc_data[CR].w&CR_CC) |
| 846 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 846 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 847 | 847 | vdc[which].status|=VDC_CR; |
| 848 | 848 | } |
| 849 | 849 | } |
| r1591 | r1592 | |
| 884 | 884 | /* Check for sprite #0 collision */ |
| 885 | 885 | else if ( drawn[pixel_x] == 2 ) { |
| 886 | 886 | if(vdc[which].vdc_data[CR].w&CR_CC) |
| 887 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 887 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 888 | 888 | vdc[which].status|=VDC_CR; |
| 889 | 889 | } |
| 890 | 890 | } |
| r1591 | r1592 | |
| 903 | 903 | if( sprites_drawn > 16 ) { |
| 904 | 904 | vdc[which].status |= VDC_OR; |
| 905 | 905 | if(vdc[which].vdc_data[CR].w&CR_OV) |
| 906 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 906 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 907 | 907 | } else { |
| 908 | 908 | conv_obj(which, obj_i + (cgypos << 2) + (hf ? 0 : 2), obj_l, hf, vf, buf); |
| 909 | 909 | for(x=0;x<16;x++) |
| r1591 | r1592 | |
| 928 | 928 | /* Check for sprite #0 collision */ |
| 929 | 929 | else if ( drawn[pixel_x]==2 ) { |
| 930 | 930 | if(vdc[which].vdc_data[CR].w&CR_CC) |
| 931 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 931 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 932 | 932 | vdc[which].status|=VDC_CR; |
| 933 | 933 | } |
| 934 | 934 | } |
| r1591 | r1592 | |
| 980 | 980 | vdc[which].vdc_data[LENR].w = len; |
| 981 | 981 | if(dvc) |
| 982 | 982 | { |
| 983 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 983 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | } |
| r1591 | r1592 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | VIDEO_START( kaneko16_1xVIEW2 ) |
| 132 | 132 | { |
| 133 | | |
| 133 | VIDEO_START_CALL(kaneko16_sprites | |
| 134 | 134 | |
| 135 | 135 | kaneko16_tmap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, |
| 136 | 136 | TILEMAP_TYPE_PEN, 16,16, 0x20,0x20 ); |
| r1591 | r1592 | |
| 176 | 176 | |
| 177 | 177 | VIDEO_START( kaneko16_2xVIEW2 ) |
| 178 | 178 | { |
| 179 | | |
| 179 | VIDEO_START_CALL(kaneko16_1xVIEW2 | |
| 180 | 180 | |
| 181 | 181 | kaneko16_tmap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, |
| 182 | 182 | TILEMAP_TYPE_PEN, 16,16, 0x20,0x20 ); |
| r1591 | r1592 | |
| 216 | 216 | |
| 217 | 217 | VIDEO_START( sandscrp_1xVIEW2 ) |
| 218 | 218 | { |
| 219 | | |
| 219 | VIDEO_START_CALL(kaneko16_1xVIEW2 | |
| 220 | 220 | pandora_start(0,0,0); |
| 221 | 221 | |
| 222 | 222 | tilemap_set_scrolldy( kaneko16_tmap_0, 0, 256 - 1 ); |
| r1591 | r1592 | |
| 281 | 281 | *BITMAP_ADDR16(kaneko16_bg15_bitmap, y, sx * 256 + x) = machine->pens[2048 + ((g << 10) | (r << 5) | b)]; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | | |
| 284 | VIDEO_START_CALL(kaneko16_1xVIEW2 | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | VIDEO_START( galsnew ) |
| 288 | 288 | { |
| 289 | | |
| 289 | VIDEO_START_CALL(kaneko16_1xVIEW2 | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /*************************************************************************** |
| r1591 | r1592 | |
| 948 | 948 | fillbitmap(bitmap,machine->pens[0],cliprect); |
| 949 | 949 | } |
| 950 | 950 | |
| 951 | static | |
| 951 | static VIDEO | |
| 952 | 952 | { |
| 953 | 953 | int i; |
| 954 | 954 | |
| r1591 | r1592 | |
| 962 | 962 | kaneko16_render_first_tilemap_chip(machine,bitmap,cliprect,i); |
| 963 | 963 | kaneko16_render_second_tilemap_chip(machine,bitmap,cliprect,i); |
| 964 | 964 | } |
| 965 | ||
| 966 | return 0; | |
| 965 | 967 | } |
| 966 | 968 | |
| 967 | 969 | VIDEO_UPDATE(berlwall) |
| r1591 | r1592 | |
| 972 | 974 | // if the display is disabled, do nothing? |
| 973 | 975 | if (!kaneko16_disp_enable) return 0; |
| 974 | 976 | |
| 975 | | |
| 977 | VIDEO | |
| 976 | 978 | kaneko16_render_sprites(machine,bitmap,cliprect); |
| 977 | 979 | return 0; |
| 978 | 980 | } |
| r1591 | r1592 | |
| 986 | 988 | // if the display is disabled, do nothing? |
| 987 | 989 | if (!kaneko16_disp_enable) return 0; |
| 988 | 990 | |
| 989 | | |
| 991 | VIDEO | |
| 990 | 992 | kaneko16_render_sprites(machine,bitmap,cliprect); |
| 991 | 993 | return 0; |
| 992 | 994 | } |
| r1591 | r1592 | |
| 1033 | 1035 | // if the display is disabled, do nothing? |
| 1034 | 1036 | if (!kaneko16_disp_enable) return 0; |
| 1035 | 1037 | |
| 1036 | | |
| 1038 | VIDEO | |
| 1037 | 1039 | |
| 1038 | 1040 | kaneko16_render_sprites(machine,bitmap,cliprect); |
| 1039 | 1041 | return 0; |
| r1591 | r1592 | |
| 1047 | 1049 | // if the display is disabled, do nothing? |
| 1048 | 1050 | if (!kaneko16_disp_enable) return 0; |
| 1049 | 1051 | |
| 1050 | | |
| 1052 | VIDEO | |
| 1051 | 1053 | |
| 1052 | 1054 | // copy sprite bitmap to screen |
| 1053 | 1055 | pandora_update(machine,bitmap,cliprect); |
| r1591 | r1592 | |
|---|---|---|
| 14 | 14 | size_t goldstar_video_size; |
| 15 | 15 | UINT8 *goldstar_scroll1, *goldstar_scroll2, *goldstar_scroll3; |
| 16 | 16 | |
| 17 | static mame_bitmap *tmpbitmap1, *tmpbitmap2, *tmpbitmap3; | |
| 17 | static mame_bitmap *tmpbitmap1, *tmpbitmap2, *tmpbitmap3, *tmpbitmap4; | |
| 18 | 18 | static int bgcolor; |
| 19 | 19 | |
| 20 | 20 | |
| r1591 | r1592 | |
| 28 | 28 | { |
| 29 | 29 | // int i; |
| 30 | 30 | |
| 31 | video_start_generic(machine); | |
| 32 | ||
| 33 | 31 | /* the background area is half as high as the screen */ |
| 34 | 32 | tmpbitmap1 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 35 | 33 | tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 36 | 34 | tmpbitmap3 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 35 | tmpbitmap4 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); | |
| 37 | 36 | |
| 38 | 37 | /* leave everything at the default, but map all foreground 0 pens as transparent */ |
| 39 | 38 | // for (i = 0;i < 16;i++) palette_used_colors[8 * i] = PALETTE_COLOR_TRANSPARENT; |
| r1591 | r1592 | |
| 70 | 69 | sx = offs % 64; |
| 71 | 70 | sy = offs / 64; |
| 72 | 71 | |
| 73 | drawgfx(tmpbitmap,machine->gfx[0], | |
| 72 | drawgfx(tmpbitmap4,machine->gfx[0], | |
| 74 | 73 | videoram[offs] + ((colorram[offs] & 0xf0) << 4), |
| 75 | 74 | colorram[offs] & 0x0f, |
| 76 | 75 | 0,0, |
| r1591 | r1592 | |
| 78 | 77 | 0,TRANSPARENCY_NONE,0); |
| 79 | 78 | } |
| 80 | 79 | |
| 81 | copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0); | |
| 80 | copybitmap(bitmap,tmpbitmap4,0,0,0,0,cliprect,TRANSPARENCY_NONE,0); | |
| 82 | 81 | |
| 83 | 82 | |
| 84 | 83 | for (offs = goldstar_video_size - 1;offs >= 0;offs--) |
| r1591 | r1592 | |
| 116 | 115 | scrolly[i] = -goldstar_scroll1[i]; |
| 117 | 116 | |
| 118 | 117 | copyscrollbitmap(bitmap,tmpbitmap1,0,0,64,scrolly,&visible1,TRANSPARENCY_NONE,0); |
| 119 | ||
| 118 | | |
| 120 | 119 | |
| 121 | 120 | for (i= 0;i < 64;i++) |
| 122 | 121 | scrolly[i] = -goldstar_scroll2[i]; |
| 123 | 122 | |
| 124 | 123 | copyscrollbitmap(bitmap,tmpbitmap2,0,0,64,scrolly,&visible2,TRANSPARENCY_NONE,0); |
| 125 | ||
| 124 | | |
| 126 | 125 | |
| 127 | 126 | for (i= 0;i < 64;i++) |
| 128 | 127 | scrolly[i] = -goldstar_scroll3[i]; |
| 129 | 128 | |
| 130 | 129 | copyscrollbitmap(bitmap,tmpbitmap3,0,0,64,scrolly,&visible3,TRANSPARENCY_NONE,0); |
| 131 | ||
| 130 | | |
| 132 | 131 | } |
| 133 | 132 | return 0; |
| 134 | 133 | } |
| r1591 | r1592 | |
|---|---|---|
| 885 | 885 | 8,8, |
| 886 | 886 | 64*2,32*2 ); |
| 887 | 887 | |
| 888 | | |
| 888 | VIDEO_START_CALL(system16 | |
| 889 | 889 | |
| 890 | | |
| 890 | | |
| 891 | 891 | |
| 892 | if(sys18_splittab_fg_x){ | |
| 893 | tilemap_set_scroll_rows( foreground , 64 ); | |
| 894 | tilemap_set_scroll_rows( foreground2 , 64 ); | |
| 895 | } | |
| 896 | if(sys18_splittab_bg_x){ | |
| 897 | tilemap_set_scroll_rows( background , 64 ); | |
| 898 | tilemap_set_scroll_rows( background2 , 64 ); | |
| 899 | } | |
| 892 | if(sys18_splittab_fg_x){ | |
| 893 | tilemap_set_scroll_rows( foreground , 64 ); | |
| 894 | tilemap_set_scroll_rows( foreground2 , 64 ); | |
| 895 | } | |
| 896 | if(sys18_splittab_bg_x){ | |
| 897 | tilemap_set_scroll_rows( background , 64 ); | |
| 898 | tilemap_set_scroll_rows( background2 , 64 ); | |
| 899 | } | |
| 900 | 900 | |
| 901 | sys16_textlayer_lo_min=0; | |
| 902 | sys16_textlayer_lo_max=0x1f; | |
| 903 | sys16_textlayer_hi_min=0x20; | |
| 904 | sys16_textlayer_hi_max=0xff; | |
| 901 | sys16_textlayer_lo_min=0; | |
| 902 | sys16_textlayer_lo_max=0x1f; | |
| 903 | sys16_textlayer_hi_min=0x20; | |
| 904 | sys16_textlayer_hi_max=0xff; | |
| 905 | 905 | |
| 906 | sys16_18_mode=1; | |
| 907 | sys16_bg_priority_mode=3; | |
| 908 | sys16_fg_priority_mode=3; | |
| 909 | sys16_bg_priority_value=0x1800; | |
| 910 | sys16_fg_priority_value=0x2000; | |
| 906 | sys16_18_mode=1; | |
| 907 | sys16_bg_priority_mode=3; | |
| 908 | sys16_fg_priority_mode=3; | |
| 909 | sys16_bg_priority_value=0x1800; | |
| 910 | sys16_fg_priority_value=0x2000; | |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | /***************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | |
| 3 | Irem Red Alert hardware | |
| 4 | 4 | |
| 5 | Functions to emulate the video hardware of the machine. | |
| 5 | If you have any questions about how this driver works, don't hesitate to | |
| 6 | ask. - Mike Balfour (mab22@po.cwru.edu) | |
| 6 | 7 | |
| 7 | ***************************************************************************/ | |
| 8 | ****************************************************************************/ | |
| 8 | 9 | |
| 9 | 10 | #include "driver.h" |
| 11 | #include "video/resnet.h" | |
| 10 | 12 | |
| 11 | UINT8 *redalert_backram; | |
| 12 | UINT8 *redalert_spriteram1; | |
| 13 | UINT8 *redalert_spriteram2; | |
| 14 | UINT8 *redalert_spriteram3; | |
| 15 | UINT8 *redalert_characterram; | |
| 16 | UINT8 *redalert_characterram2; | |
| 17 | 13 | |
| 18 | static UINT8 redalert_dirtyback[0x400]; | |
| 19 | static UINT8 redalert_dirtycharacter[0x100]; | |
| 20 | static UINT8 redalert_dirtycharacter2[0x100]; | |
| 21 | static UINT8 redalert_backcolor[0x400]; | |
| 14 | #define NUM_CHARMAP_PENS 0x200 | |
| 15 | #define NUM_BITMAP_PENS 8 | |
| 22 | 16 | |
| 23 | 17 | |
| 24 | /* There might be a color PROM that dictates this? */ | |
| 25 | /* These guesses are based on comparing the color bars on the test | |
| 26 | screen with the picture in the manual */ | |
| 27 | static const UINT8 color_lookup[] = { | |
| 28 | 1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3, | |
| 29 | 1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3, | |
| 30 | 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, | |
| 31 | 1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3, | |
| 32 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | |
| 33 | 1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3, | |
| 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
| 35 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
| 36 | 18 | |
| 37 | 1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2, | |
| 38 | 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, | |
| 39 | 2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1, | |
| 40 | 1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3, | |
| 41 | 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, | |
| 42 | 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, | |
| 43 | 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, | |
| 44 | 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 | |
| 45 | }; | |
| 19 | /************************************* | |
| 20 | * | |
| 21 | * Global variables | |
| 22 | * | |
| 23 | *************************************/ | |
| 46 | 24 | |
| 47 | static int backcolor, flip=0; | |
| 25 | UINT8 *redalert_bitmap_videoram; | |
| 26 | UINT8 *redalert_bitmap_color; | |
| 27 | UINT8 *redalert_charmap_videoram; | |
| 48 | 28 | |
| 49 | WRITE8_HANDLER( redalert_c040_w ) | |
| 50 | { | |
| 51 | /* Only seems to load D0-D3 into a flip-flop. */ | |
| 52 | /* D0/D1 seem to head off to unconnected circuits */ | |
| 53 | /* D2 connects to a "NL" line, and NOTted to a "NH" line */ | |
| 54 | /* D3 connects to a "YI" line */ | |
| 29 | UINT8 *redalert_video_control; | |
| 55 | 30 | |
| 56 | /* | |
| 57 | D0 == 1 -> 1 player | |
| 58 | D1 == 1 and D0 == 1 -> 2 players | |
| 59 | */ | |
| 60 | flip = !(data & 0x04); | |
| 61 | } | |
| 62 | 31 | |
| 63 | WRITE8_HANDLER( redalert_backcolor_w ) | |
| 64 | { | |
| 65 | /* Only seems to load D0-D2 into a flip-flop. */ | |
| 66 | /* Outputs feed into RAM which seems to feed to RGB lines. */ | |
| 67 | backcolor = data & 0x07; | |
| 68 | } | |
| 69 | 32 | |
| 70 | WRITE8_HANDLER( demoneye_c040_w ) | |
| 71 | { | |
| 72 | /* | |
| 73 | D0 == 1 -> 1 player | |
| 74 | D1 == 1 and D0 == 1 -> 2 players | |
| 75 | */ | |
| 76 | flip = data & 0x04; | |
| 77 | } | |
| 33 | /************************************* | |
| 34 | * | |
| 35 | * Local variable | |
| 36 | * | |
| 37 | *************************************/ | |
| 78 | 38 | |
| 79 | /*************************************************************************** | |
| 80 | redalert_backram_w | |
| 81 | ***************************************************************************/ | |
| 39 | static UINT8 *redalert_bitmap_colorram; | |
| 82 | 40 | |
| 83 | WRITE8_HANDLER( redalert_backram_w ) | |
| 84 | { | |
| 85 | int charnum; | |
| 86 | 41 | |
| 87 | charnum = offset / 8 % 0x400; | |
| 88 | 42 | |
| 89 | if ((redalert_backram[offset] != data) || | |
| 90 | (redalert_backcolor[charnum] != backcolor)) | |
| 91 | { | |
| 92 | redalert_dirtyback[charnum] = 1; | |
| 93 | redalert_backcolor[charnum] = backcolor; | |
| 43 | /************************************* | |
| 44 | * | |
| 45 | * Bitmap videoram write handler | |
| 46 | * | |
| 47 | *************************************/ | |
| 94 | 48 | |
| 95 | redalert_backram[offset] = data; | |
| 96 | } | |
| 49 | WRITE8_HANDLER( redalert_bitmap_videoram_w ) | |
| 50 | { | |
| 51 | redalert_bitmap_videoram[offset ] = data; | |
| 52 | redalert_bitmap_colorram[offset >> 3] = *redalert_bitmap_color & 0x07; | |
| 97 | 53 | } |
| 98 | 54 | |
| 99 | /*************************************************************************** | |
| 100 | redalert_spriteram1_w | |
| 101 | ***************************************************************************/ | |
| 102 | 55 | |
| 103 | WRITE8_HANDLER( redalert_spriteram1_w ) | |
| 56 | ||
| 57 | /************************************* | |
| 58 | * | |
| 59 | * Color generation | |
| 60 | * | |
| 61 | *************************************/ | |
| 62 | ||
| 63 | static void get_pens(pen_t *pens) | |
| 104 | 64 | { |
| 105 | if (redalert_spriteram1[offset] != data) | |
| 106 | { | |
| 107 | redalert_dirtycharacter[((offset / 8) % 0x80) + 0x80] = 1; | |
| 65 | static const int resistances_bitmap[] = { 100 }; | |
| 66 | static const int resistances_charmap_rg[] = { 390, 220, 180 }; | |
| 67 | static const int resistances_charmap_b[] = { 220, 100 }; | |
| 68 | static const int resistances_back_r[] = { 1000 + 100 }; | |
| 69 | static const int resistances_back_gb[] = { 100 + 470 }; | |
| 108 | 70 | |
| 109 | redalert_spriteram1[offset] = data; | |
| 110 | } | |
| 111 | } | |
| 71 | offs_t offs; | |
| 72 | double scaler; | |
| 73 | double bitmap_weight[1]; | |
| 74 | double charmap_rg_weights[3]; | |
| 75 | double charmap_b_weights[2]; | |
| 76 | double back_r_weight[1]; | |
| 77 | double back_gb_weight[1]; | |
| 112 | 78 | |
| 113 | /*************************************************************************** | |
| 114 | redalert_spriteram2_w | |
| 115 | ***************************************************************************/ | |
| 79 | scaler = compute_resistor_weights(0, 0xff, -1, | |
| 80 | 1, resistances_bitmap, bitmap_weight, 470, 0, | |
| 81 | 3, resistances_charmap_rg, charmap_rg_weights, 470, 0, | |
| 82 | 2, resistances_charmap_b, charmap_b_weights, 470, 0); | |
| 116 | 83 | |
| 117 | WRITE8_HANDLER( redalert_spriteram2_w ) | |
| 118 | { | |
| 119 | if (redalert_spriteram2[offset] != data) | |
| 84 | compute_resistor_weights(0, 0xff, scaler, | |
| 85 | 1, resistances_back_r, back_r_weight, 470, 0, | |
| 86 | 1, resistances_back_gb, back_gb_weight, 470, 0, | |
| 87 | 0, 0, 0, 0, 0); | |
| 88 | ||
| 89 | /* the character layer colors come from the PROM */ | |
| 90 | for (offs = 0; offs < NUM_CHARMAP_PENS; offs++) | |
| 120 | 91 | { |
| 92 | UINT8 data = memory_region(REGION_PROMS)[offs]; | |
| 121 | 93 | |
| 122 | redalert_dirtycharacter[((offset / 8) % 0x80) + 0x80] = 1; | |
| 94 | /* very strange mapping */ | |
| 95 | UINT8 r0_bit = (data >> 2) & 0x01; | |
| 96 | UINT8 r1_bit = (data >> 6) & 0x01; | |
| 97 | UINT8 r2_bit = (data >> 4) & 0x01; | |
| 98 | UINT8 g0_bit = (data >> 1) & 0x01; | |
| 99 | UINT8 g1_bit = (data >> 3) & 0x01; | |
| 100 | UINT8 g2_bit = (data >> 5) & 0x01; | |
| 101 | UINT8 b0_bit = (data >> 0) & 0x01; | |
| 102 | UINT8 b1_bit = (data >> 7) & 0x01; | |
| 123 | 103 | |
| 124 | redalert_spriteram2[offset] = data; | |
| 104 | UINT8 r = combine_3_weights(charmap_rg_weights, r0_bit, r1_bit, r2_bit); | |
| 105 | UINT8 g = combine_3_weights(charmap_rg_weights, g0_bit, g1_bit, g2_bit); | |
| 106 | UINT8 b = combine_2_weights(charmap_b_weights, b0_bit, b1_bit); | |
| 107 | ||
| 108 | pens[offs] = MAKE_RGB(r, g, b); | |
| 125 | 109 | } |
| 126 | } | |
| 127 | 110 | |
| 128 | /*************************************************************************** | |
| 129 | redalert_characterram_w | |
| 130 | ***************************************************************************/ | |
| 131 | ||
| 132 | WRITE8_HANDLER( redalert_characterram_w ) | |
| 133 | { | |
| 134 | if (redalert_characterram[offset] != data) | |
| 111 | /* the bitmap layer colors are directly mapped */ | |
| 112 | for (offs = 0; offs < NUM_BITMAP_PENS; offs++) | |
| 135 | 113 | { |
| 136 | redalert_dirtycharacter[((offset / 8) % 0x80)] = 1; | |
| 114 | UINT8 r_bit = (offs >> 2) & 0x01; | |
| 115 | UINT8 g_bit = (offs >> 1) & 0x01; | |
| 116 | UINT8 b_bit = (offs >> 0) & 0x01; | |
| 137 | 117 | |
| 138 | redalert_characterram[offset] = data; | |
| 118 | UINT8 r = bitmap_weight[r_bit]; | |
| 119 | UINT8 g = bitmap_weight[g_bit]; | |
| 120 | UINT8 b = bitmap_weight[b_bit]; | |
| 121 | ||
| 122 | pens[NUM_CHARMAP_PENS + offs] = MAKE_RGB(r, g, b); | |
| 139 | 123 | } |
| 124 | ||
| 125 | /* background color */ | |
| 126 | pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS] = MAKE_RGB(back_r_weight[0], back_gb_weight[0], back_gb_weight[0]); | |
| 140 | 127 | } |
| 141 | 128 | |
| 142 | WRITE8_HANDLER( redalert_characterram2_w ) | |
| 129 | ||
| 130 | ||
| 131 | /************************************* | |
| 132 | * | |
| 133 | * Video hardware start | |
| 134 | * | |
| 135 | *************************************/ | |
| 136 | ||
| 137 | static VIDEO_START( redalert ) | |
| 143 | 138 | { |
| 144 | if (redalert_characterram2[offset] != data) | |
| 145 | { | |
| 146 | redalert_dirtycharacter[((offset / 8) % 0x80)] = 1; | |
| 139 | redalert_bitmap_colorram = auto_malloc(0x0400); | |
| 147 | 140 | |
| 148 | redalert_characterram2[offset] = data; | |
| 149 | } | |
| 141 | state_save_register_global_pointer(redalert_bitmap_colorram, 0x0400); | |
| 150 | 142 | } |
| 151 | 143 | |
| 152 | WRITE8_HANDLER( redalert_spriteram3_w ) | |
| 153 | { | |
| 154 | if (redalert_spriteram3[offset] != data) | |
| 155 | { | |
| 156 | redalert_dirtycharacter2[((offset / 8) % 0x80) + 0x80] = 1; | |
| 157 | 144 | |
| 158 | redalert_spriteram3[offset] = data; | |
| 159 | } | |
| 160 | 145 | |
| 161 | } | |
| 146 | /************************************* | |
| 147 | * | |
| 148 | * Red Alert video update | |
| 149 | * | |
| 150 | *************************************/ | |
| 162 | 151 | |
| 163 | ||
| 164 | VIDEO_UPDATE( redalert ) | |
| 152 | static VIDEO_UPDATE( redalert ) | |
| 165 | 153 | { |
| 166 | int offs,i; | |
| 154 | pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1]; | |
| 155 | offs_t offs; | |
| 167 | 156 | |
| 168 | /* for every character in the Video RAM */ | |
| 169 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 157 | get_pens(pens); | |
| 158 | ||
| 159 | for (offs = 0; offs < 0x2000; offs++) | |
| 170 | 160 | { |
| 171 | int charcode; | |
| 172 | int stat_transparent; | |
| 173 | int sx,sy,color; | |
| 161 | int i; | |
| 162 | UINT8 charmap_data_1; | |
| 163 | UINT8 charmap_data_2; | |
| 174 | 164 | |
| 175 | charcode = videoram[offs]; | |
| 165 | UINT8 y = offs & 0xff; | |
| 166 | UINT8 x = (~offs >> 8) << 3; | |
| 176 | 167 | |
| 177 | /* decode modified background */ | |
| 178 | if (redalert_dirtyback[offs] == 1) | |
| 168 | UINT8 bitmap_data = redalert_bitmap_videoram[offs]; | |
| 169 | UINT8 bitmap_color = redalert_bitmap_colorram[offs >> 3]; | |
| 170 | ||
| 171 | UINT8 charmap_code = redalert_charmap_videoram[0x0000 | (offs >> 3)]; | |
| 172 | offs_t charmap_data_base = ((charmap_code & 0x7f) << 3) | (offs & 0x07); | |
| 173 | ||
| 174 | /* D7 of the char code selects the char set to use */ | |
| 175 | if (charmap_code & 0x80) | |
| 179 | 176 | { |
| 180 | decodechar(machine->gfx[0],offs,redalert_backram); | |
| 181 | redalert_dirtyback[offs] = 2; | |
| 177 | charmap_data_1 = redalert_charmap_videoram[0x0400 | charmap_data_base]; | |
| 178 | charmap_data_2 = redalert_charmap_videoram[0x0c00 | charmap_data_base]; | |
| 182 | 179 | } |
| 180 | else | |
| 181 | { | |
| 182 | charmap_data_1 = 0; /* effectively disables A0 of the color PROM */ | |
| 183 | charmap_data_2 = redalert_charmap_videoram[0x0800 | charmap_data_base]; | |
| 184 | } | |
| 183 | 185 | |
| 184 | /* decode modified characters */ | |
| 185 | if (redalert_dirtycharacter[charcode] == 1) | |
| 186 | for (i = 0; i < 8; i++) | |
| 186 | 187 | { |
| 187 | if (charcode < 0x80) | |
| 188 | decodechar(machine->gfx[1],charcode,redalert_characterram); | |
| 188 | pen_t pen; | |
| 189 | ||
| 190 | int bitmap_bit = bitmap_data & 0x80; | |
| 191 | UINT8 color_prom_a0_a1 = ((charmap_data_2 & 0x80) >> 6) | ((charmap_data_1 & 0x80) >> 7); | |
| 192 | ||
| 193 | /* determine priority */ | |
| 194 | if ((color_prom_a0_a1 == 0) || (bitmap_bit && ((charmap_code & 0xc0) == 0xc0))) | |
| 195 | pen = bitmap_bit ? pens[NUM_CHARMAP_PENS + bitmap_color] : pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS]; | |
| 189 | 196 | else |
| 190 | decodechar(machine->gfx[2],charcode-0x80,redalert_spriteram1); | |
| 191 | redalert_dirtycharacter[charcode] = 2; | |
| 192 | } | |
| 197 | pen = pens[((charmap_code & 0xfe) << 1) | color_prom_a0_a1]; | |
| 193 | 198 | |
| 194 | if (redalert_dirtycharacter2[charcode] == 1) | |
| 195 | { | |
| 196 | decodechar(machine->gfx[3],charcode-0x80,redalert_spriteram3); | |
| 197 | redalert_dirtycharacter2[charcode] = 2; | |
| 199 | if (*redalert_video_control & 0x04) | |
| 200 | *BITMAP_ADDR32(bitmap, y, x) = pen; | |
| 201 | else | |
| 202 | *BITMAP_ADDR32(bitmap, y ^ 0xff, x ^ 0xff) = pen; | |
| 203 | ||
| 204 | /* next pixel */ | |
| 205 | x = x + 1; | |
| 206 | ||
| 207 | bitmap_data = bitmap_data << 1; | |
| 208 | charmap_data_1 = charmap_data_1 << 1; | |
| 209 | charmap_data_2 = charmap_data_2 << 1; | |
| 198 | 210 | } |
| 211 | } | |
| 199 | 212 | |
| 200 | sx = 31 - offs / 32; | |
| 201 | sy = offs % 32; | |
| 213 | return 0; | |
| 214 | } | |
| 202 | 215 | |
| 203 | stat_transparent = TRANSPARENCY_NONE; | |
| 204 | 216 | |
| 205 | /* First layer of color */ | |
| 206 | if (charcode >= 0xC0) | |
| 207 | { | |
| 208 | stat_transparent = TRANSPARENCY_COLOR; | |
| 209 | 217 | |
| 210 | color = color_lookup[charcode]; | |
| 218 | /************************************* | |
| 219 | * | |
| 220 | * Demoneye-X video update | |
| 221 | * | |
| 222 | *************************************/ | |
| 211 | 223 | |
| 212 | drawgfx(tmpbitmap,machine->gfx[2], | |
| 213 | charcode-0x80, | |
| 214 | color, | |
| 215 | 0,0, | |
| 216 | 8*sx,8*sy, | |
| 217 | &machine->screen[0].visarea,TRANSPARENCY_NONE,0); | |
| 224 | static VIDEO_UPDATE( demoneye ) | |
| 225 | { | |
| 226 | pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1]; | |
| 227 | offs_t offs; | |
| 218 | 228 | |
| 219 | if( redalert_dirtycharacter2[charcode] != 0 ) | |
| 220 | drawgfx(tmpbitmap,machine->gfx[3], | |
| 221 | charcode-0x80, | |
| 222 | color, | |
| 223 | 0,0, | |
| 224 | 8*sx,8*sy, | |
| 225 | &machine->screen[0].visarea,TRANSPARENCY_COLOR,0); | |
| 229 | get_pens(pens); | |
| 226 | 230 | |
| 227 | } | |
| 231 | for (offs = 0; offs < 0x2000; offs++) | |
| 232 | { | |
| 233 | int i; | |
| 234 | UINT8 charmap_data_1; | |
| 235 | UINT8 charmap_data_2; | |
| 228 | 236 | |
| 229 | /* Second layer - background */ | |
| 230 | color = redalert_backcolor[offs]; | |
| 231 | drawgfx(tmpbitmap,machine->gfx[0], | |
| 232 | offs, | |
| 233 | color, | |
| 234 | 0,0, | |
| 235 | 8*sx,8*sy, | |
| 236 | &machine->screen[0].visarea,stat_transparent,0); | |
| 237 | UINT8 y = offs & 0xff; | |
| 238 | UINT8 x = (~offs >> 8) << 3; | |
| 237 | 239 | |
| 238 | /* Third layer - alphanumerics & sprites */ | |
| 239 | if (charcode < 0x80) | |
| 240 | UINT8 bitmap_data = redalert_bitmap_videoram[offs]; | |
| 241 | UINT8 bitmap_color = redalert_bitmap_colorram[offs >> 3]; | |
| 242 | ||
| 243 | UINT8 charmap_code = redalert_charmap_videoram[0x1000 | (offs >> 3)]; | |
| 244 | offs_t charmap_data_base = ((charmap_code & 0x7f) << 3) | (offs & 0x07); | |
| 245 | ||
| 246 | /* D7 of the char code selects the char set to use */ | |
| 247 | if (charmap_code & 0x80) | |
| 240 | 248 | { |
| 241 | color = color_lookup[charcode]; | |
| 242 | drawgfx(tmpbitmap,machine->gfx[1], | |
| 243 | charcode, | |
| 244 | color, | |
| 245 | 0,0, | |
| 246 | 8*sx,8*sy, | |
| 247 | &machine->screen[0].visarea,TRANSPARENCY_COLOR,0); | |
| 249 | charmap_data_1 = redalert_charmap_videoram[0x0400 | charmap_data_base]; | |
| 250 | charmap_data_2 = redalert_charmap_videoram[0x0c00 | charmap_data_base]; | |
| 248 | 251 | } |
| 249 | else | |
| 252 | else | |
| 250 | 253 | { |
| 251 | color = color_lookup[charcode]; | |
| 252 | drawgfx(tmpbitmap,machine->gfx[2], | |
| 253 | charcode-0x80, | |
| 254 | color, | |
| 255 | 0,0, | |
| 256 | 8*sx,8*sy, | |
| 257 | &machine->screen[0].visarea,TRANSPARENCY_COLOR,0); | |
| 254 | charmap_data_1 = redalert_charmap_videoram[0x0000 | charmap_data_base]; | |
| 255 | charmap_data_2 = redalert_charmap_videoram[0x0800 | charmap_data_base]; | |
| 256 | } | |
| 258 | 257 | |
| 259 | if( redalert_dirtycharacter2[charcode] != 0 ) | |
| 260 | drawgfx(tmpbitmap,machine->gfx[3], | |
| 261 | charcode-0x80, | |
| 262 | color, | |
| 263 | 0,0, | |
| 264 | 8*sx,8*sy, | |
| 265 | &machine->screen[0].visarea,TRANSPARENCY_COLOR,0); | |
| 258 | /* this is the mapping of the 3rd char set */ | |
| 259 | //charmap_data_1 = redalert_charmap_videoram[0x1400 | charmap_data_base]; | |
| 260 | //charmap_data_2 = redalert_charmap_videoram[0x1c00 | charmap_data_base]; | |
| 266 | 261 | |
| 262 | for (i = 0; i < 8; i++) | |
| 263 | { | |
| 264 | pen_t pen; | |
| 265 | ||
| 266 | int bitmap_bit = bitmap_data & 0x80; | |
| 267 | UINT8 color_prom_a0_a1 = ((charmap_data_2 & 0x80) >> 6) | ((charmap_data_1 & 0x80) >> 7); | |
| 268 | ||
| 269 | /* determine priority */ | |
| 270 | if ((color_prom_a0_a1 == 0) || (bitmap_bit && ((charmap_code & 0xc0) == 0xc0))) | |
| 271 | pen = bitmap_bit ? pens[NUM_CHARMAP_PENS + bitmap_color] : pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS]; | |
| 272 | else | |
| 273 | pen = pens[((charmap_code & 0xfe) << 1) | color_prom_a0_a1]; | |
| 274 | ||
| 275 | if (*redalert_video_control & 0x04) | |
| 276 | *BITMAP_ADDR32(bitmap, y ^ 0xff, x ^ 0xff) = pen; | |
| 277 | else | |
| 278 | *BITMAP_ADDR32(bitmap, y, x) = pen; | |
| 279 | ||
| 280 | /* next pixel */ | |
| 281 | x = x + 1; | |
| 282 | ||
| 283 | bitmap_data = bitmap_data << 1; | |
| 284 | charmap_data_1 = charmap_data_1 << 1; | |
| 285 | charmap_data_2 = charmap_data_2 << 1; | |
| 267 | 286 | } |
| 268 | 287 | } |
| 269 | 288 | |
| 270 | for (i = 0;i < 256;i++) | |
| 271 | { | |
| 272 | if (redalert_dirtycharacter[i] == 2) | |
| 273 | redalert_dirtycharacter[i] = 0; | |
| 289 | return 0; | |
| 290 | } | |
| 274 | 291 | |
| 275 | if (redalert_dirtycharacter2[i] == 2) | |
| 276 | redalert_dirtycharacter2[i] = 0; | |
| 277 | } | |
| 278 | 292 | |
| 279 | for (i = 0;i < 0x400;i++) | |
| 280 | { | |
| 281 | if (redalert_dirtyback[i] == 2) | |
| 282 | redalert_dirtyback[i] = 0; | |
| 283 | } | |
| 284 | 293 | |
| 285 | /* copy the character mapped graphics */ | |
| 286 | copybitmap(bitmap,tmpbitmap,flip,flip,0,0,cliprect,TRANSPARENCY_NONE,0); | |
| 294 | /************************************* | |
| 295 | * | |
| 296 | * Red Alert machine driver | |
| 297 | * | |
| 298 | *************************************/ | |
| 287 | 299 | |
| 288 | return 0; | |
| 289 | } | |
| 300 | MACHINE_DRIVER_START( redalert_video ) | |
| 301 | ||
| 302 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 303 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 304 | ||
| 305 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 306 | MDRV_VIDEO_START(redalert) | |
| 307 | MDRV_VIDEO_UPDATE(redalert) | |
| 308 | ||
| 309 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) | |
| 310 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 311 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
| 312 | ||
| 313 | MACHINE_DRIVER_END | |
| 314 | ||
| 315 | ||
| 316 | ||
| 317 | /************************************* | |
| 318 | * | |
| 319 | * Demoneye-X machine driver | |
| 320 | * | |
| 321 | *************************************/ | |
| 322 | ||
| 323 | MACHINE_DRIVER_START( demoneye_video ) | |
| 324 | ||
| 325 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 326 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 327 | ||
| 328 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 329 | MDRV_VIDEO_START(redalert) | |
| 330 | MDRV_VIDEO_UPDATE(demoneye) | |
| 331 | ||
| 332 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) | |
| 333 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 334 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
| 335 | ||
| 336 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | 13 | |
| 14 | UINT16 *stadhero_pf1_data,*stadhero_pf2_data; | |
| 14 | UINT16 *stadhero_pf1_data; | |
| 15 | static UINT16 *stadhero_pf2_data; | |
| 16 | UINT16 *stadhero_pf2_control_0; | |
| 17 | UINT16 *stadhero_pf2_control_1; | |
| 15 | 18 | static tilemap *pf1_tilemap,*pf2_tilemap; |
| 16 | 19 | static int flipscreen; |
| 17 | 20 | |
| 18 | static UINT16 stadhero_pf2_control_0[8]; | |
| 19 | static UINT16 stadhero_pf2_control_1[8]; | |
| 20 | ||
| 21 | 21 | /******************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int pri_mask,int pri_val) |
| r1591 | r1592 | |
| 61 | 61 | inc = 1; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | if (flip | |
| 64 | if (flip | |
| 65 | 65 | y=240-y; |
| 66 | 66 | x=240-x; |
| 67 | 67 | if (fx) fx=0; else fx=1; |
| r1591 | r1592 | |
| 106 | 106 | tilemap_mark_tile_dirty(pf1_tilemap,offset); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | ||
| 109 | ||
| 110 | 110 | { |
| 111 | COMBINE_DATA(&stadhero_pf2_data[offset]); | |
| 112 | tilemap_mark_tile_dirty(pf2_tilemap,offset); | |
| 111 | return stadhero_pf2_data[((stadhero_pf2_control_0[2] & 0x01) ? 0x1000 : 0) | offset]; | |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | WRITE16_HANDLER( stadhero_pf2_ | |
| 114 | WRITE16_HANDLER( stadhero_pf2_da | |
| 116 | 115 | { |
| 117 | COMBINE_DATA(&stadhero_pf2_control_0[offset]); | |
| 116 | COMBINE_DATA(&stadhero_pf2_data[((stadhero_pf2_control_0[2] & 0x01) ? 0x1000 : 0) | offset]); | |
| 117 | tilemap_mark_tile_dirty(pf2_tilemap,offset); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | WRITE16_HANDLER( stadhero_pf2_control_1_w ) | |
| 121 | { | |
| 122 | COMBINE_DATA(&stadhero_pf2_control_1[offset]); | |
| 123 | } | |
| 124 | 120 | |
| 125 | 121 | /******************************************************************************/ |
| 126 | 122 | |
| r1591 | r1592 | |
| 134 | 130 | { |
| 135 | 131 | int tile,color; |
| 136 | 132 | |
| 137 | tile=stadhero_pf2_data[tile_index]; | |
| 133 | tile=stadhero_pf2_data[((stadhero_pf2_control_0[2] & 0x01) ? 0x1000 : 0) | tile_index]; | |
| 138 | 134 | color=tile >> 12; |
| 139 | 135 | tile=tile&0xfff; |
| 140 | 136 | |
| r1591 | r1592 | |
| 163 | 159 | pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32); |
| 164 | 160 | pf2_tilemap = tilemap_create(get_pf2_tile_info,stadhero_scan,TILEMAP_TYPE_PEN, 16,16,64,64); |
| 165 | 161 | |
| 162 | stadhero_pf2_data = auto_malloc(0x2000 * 2); | |
| 163 | ||
| 166 | 164 | tilemap_set_transparent_pen(pf1_tilemap,0); |
| 167 | 165 | } |
| 168 | 166 |
| r1591 | r1592 | |
|---|---|---|
| 103 | 103 | { |
| 104 | 104 | if (bank & 1) |
| 105 | 105 | { |
| 106 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, paletteram_r); | |
| 107 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 106 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, MRA8_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 107 | memory_set_bankptr(5, paletteram); | |
| 108 | 108 | } |
| 109 | 109 | else |
| 110 | { | |
| 111 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_r); | |
| 112 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_w); | |
| 113 | } | |
| 110 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_r, K052109_w); | |
| 114 | 111 | |
| 115 | 112 | if (bank & 2) |
| 116 | { | |
| 117 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_r); | |
| 118 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_w); | |
| 119 | } | |
| 113 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_r, simpsons_K053247_w); | |
| 120 | 114 | else |
| 121 | { | |
| 122 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_r); | |
| 123 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_w); | |
| 124 | } | |
| 115 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_r, simpsons_K052109_w); | |
| 125 | 116 | } |
| 126 | 117 | |
| 127 | 118 |
| r1591 | r1592 | |
|---|---|---|
| 247 | 247 | b_sp_color_base = 0x40*16; /*sprites */ |
| 248 | 248 | b_tx_color_base = 0x00; /*text */ |
| 249 | 249 | |
| 250 | | |
| 250 | VIDEO_START_CALL(taitob_cor | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | VIDEO_START( taitob_color_order1 ) |
| r1591 | r1592 | |
| 258 | 258 | b_sp_color_base = 0x80*16; |
| 259 | 259 | b_tx_color_base = 0xc0; |
| 260 | 260 | |
| 261 | | |
| 261 | VIDEO_START_CALL(taitob_cor | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | VIDEO_START( taitob_color_order2 ) |
| r1591 | r1592 | |
| 269 | 269 | b_sp_color_base = 0x10*16; |
| 270 | 270 | b_tx_color_base = 0x00; |
| 271 | 271 | |
| 272 | | |
| 272 | VIDEO_START_CALL(taitob_cor | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
| 276 | 276 | VIDEO_START( hitice ) |
| 277 | 277 | { |
| 278 | | |
| 278 | VIDEO_START_CALL(taitob_color_order0 | |
| 279 | 279 | |
| 280 | 280 | pixel_bitmap = auto_bitmap_alloc(1024,512,machine->screen[0].format); |
| 281 | 281 |
| r1591 | r1592 | |
|---|---|---|
| 149 | 149 | /* the background area is twice as wide as the screen */ |
| 150 | 150 | background_bitmap = auto_bitmap_alloc(2*machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 151 | 151 | |
| 152 | | |
| 152 | VIDEO_START_CALL(btim | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| r1591 | r1592 | |
| 316 | 316 | INTERRUPT_GEN( lnc_sound_interrupt ) |
| 317 | 317 | { |
| 318 | 318 | if (lnc_sound_interrupt_enabled) |
| 319 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 319 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 |
| r1591 | r1592 | |
|---|---|---|
| 1139 | 1139 | { |
| 1140 | 1140 | int i; |
| 1141 | 1141 | |
| 1142 | | |
| 1142 | MACHINE_RESET_CALL(cps | |
| 1143 | 1143 | |
| 1144 | 1144 | cps1_bg_tilemap[0] = tilemap_create(get_tile0_info,tilemap0_scan,TILEMAP_TYPE_PEN, 8, 8,64,64); |
| 1145 | 1145 | cps1_bg_tilemap[1] = tilemap_create(get_tile1_info,tilemap1_scan,TILEMAP_TYPE_PEN,16,16,64,64); |
| r1591 | r1592 | |
| 1201 | 1201 | VIDEO_START( cps1 ) |
| 1202 | 1202 | { |
| 1203 | 1203 | cps_version=1; |
| 1204 | | |
| 1204 | VIDEO_START_CALL(cps | |
| 1205 | 1205 | } |
| 1206 | 1206 | |
| 1207 | 1207 | VIDEO_START( cps2 ) |
| r1591 | r1592 | |
| 1210 | 1210 | { |
| 1211 | 1211 | cps_version=2; |
| 1212 | 1212 | } |
| 1213 | | |
| 1213 | VIDEO_START_CALL(cps | |
| 1214 | 1214 | } |
| 1215 | 1215 | |
| 1216 | 1216 | /*************************************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | VIDEO_START( wiz ) |
| 39 | 39 | { |
| 40 | video_start_generic(machine); | |
| 41 | ||
| 42 | 40 | state_save_register_global_array(char_bank); |
| 43 | 41 | state_save_register_global_array(palbank); |
| 44 | 42 | state_save_register_global(flipx); |
| r1591 | r1592 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static TIMER_CALLBACK( gen_ext1_int ) |
| 107 | 107 | { |
| 108 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 108 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| r1591 | r1592 | |
| 167 | 167 | |
| 168 | 168 | /* clear the IRQ on offset 0 */ |
| 169 | 169 | else if (offset == 0) |
| 170 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 170 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 |
| r1591 | r1592 | |
|---|---|---|
| 224 | 224 | |
| 225 | 225 | PALETTE_INIT( scramble ) |
| 226 | 226 | { |
| 227 | | |
| 227 | PALETTE_INIT_CALL(galaxian | |
| 228 | 228 | |
| 229 | 229 | |
| 230 | 230 | /* blue background - 390 ohm resistor */ |
| r1591 | r1592 | |
| 233 | 233 | |
| 234 | 234 | PALETTE_INIT( moonwar ) |
| 235 | 235 | { |
| 236 | | |
| 236 | PALETTE_INIT_CALL(scramble | |
| 237 | 237 | |
| 238 | 238 | |
| 239 | 239 | /* wire mod to connect the bullet blue output to the 220 ohm resistor */ |
| r1591 | r1592 | |
| 245 | 245 | int i; |
| 246 | 246 | |
| 247 | 247 | |
| 248 | | |
| 248 | PALETTE_INIT_CALL(galaxian | |
| 249 | 249 | |
| 250 | 250 | |
| 251 | 251 | /* The background color generator is connected this way: |
| r1591 | r1592 | |
| 269 | 269 | int i; |
| 270 | 270 | |
| 271 | 271 | |
| 272 | | |
| 272 | PALETTE_INIT_CALL(galaxian | |
| 273 | 273 | |
| 274 | 274 | |
| 275 | 275 | /* The background color generator is connected this way: |
| r1591 | r1592 | |
| 290 | 290 | |
| 291 | 291 | PALETTE_INIT( frogger ) |
| 292 | 292 | { |
| 293 | | |
| 293 | PALETTE_INIT_CALL(galaxian | |
| 294 | 294 | |
| 295 | 295 | |
| 296 | 296 | /* blue background - 470 ohm resistor */ |
| r1591 | r1592 | |
| 384 | 384 | int i; |
| 385 | 385 | |
| 386 | 386 | |
| 387 | | |
| 387 | PALETTE_INIT_CALL(galaxian | |
| 388 | 388 | |
| 389 | 389 | |
| 390 | 390 | /* set up background colors */ |
| r1591 | r1592 | |
| 415 | 415 | int i; |
| 416 | 416 | |
| 417 | 417 | |
| 418 | | |
| 418 | PALETTE_INIT_CALL(galaxian | |
| 419 | 419 | |
| 420 | 420 | |
| 421 | 421 | /* set up background colors */ |
| r1591 | r1592 | |
| 436 | 436 | int i; |
| 437 | 437 | |
| 438 | 438 | |
| 439 | | |
| 439 | PALETTE_INIT_CALL(galaxian | |
| 440 | 440 | |
| 441 | 441 | |
| 442 | 442 | /* set up background colors */ |
| r1591 | r1592 | |
| 465 | 465 | { |
| 466 | 466 | int i; |
| 467 | 467 | |
| 468 | | |
| 468 | PALETTE_INIT_CALL(galaxian | |
| 469 | 469 | |
| 470 | 470 | |
| 471 | 471 | /* |
| r1591 | r1592 | |
| 559 | 559 | |
| 560 | 560 | VIDEO_START( galaxian ) |
| 561 | 561 | { |
| 562 | | |
| 562 | VIDEO_START_CALL(galaxian_plain | |
| 563 | 563 | |
| 564 | 564 | draw_stars = galaxian_draw_stars; |
| 565 | 565 | |
| r1591 | r1592 | |
| 568 | 568 | |
| 569 | 569 | VIDEO_START( gmgalax ) |
| 570 | 570 | { |
| 571 | | |
| 571 | VIDEO_START_CALL(galaxian | |
| 572 | 572 | |
| 573 | 573 | modify_charcode = gmgalax_modify_charcode; |
| 574 | 574 | modify_spritecode = gmgalax_modify_spritecode; |
| r1591 | r1592 | |
| 577 | 577 | |
| 578 | 578 | VIDEO_START( mooncrst ) |
| 579 | 579 | { |
| 580 | | |
| 580 | VIDEO_START_CALL(galaxian | |
| 581 | 581 | |
| 582 | 582 | modify_charcode = mooncrst_modify_charcode; |
| 583 | 583 | modify_spritecode = mooncrst_modify_spritecode; |
| r1591 | r1592 | |
| 585 | 585 | |
| 586 | 586 | VIDEO_START( mooncrgx ) |
| 587 | 587 | { |
| 588 | | |
| 588 | VIDEO_START_CALL(galaxian | |
| 589 | 589 | |
| 590 | 590 | modify_charcode = mooncrgx_modify_charcode; |
| 591 | 591 | modify_spritecode = mooncrgx_modify_spritecode; |
| r1591 | r1592 | |
| 593 | 593 | |
| 594 | 594 | VIDEO_START( moonqsr ) |
| 595 | 595 | { |
| 596 | | |
| 596 | VIDEO_START_CALL(galaxian | |
| 597 | 597 | |
| 598 | 598 | modify_charcode = moonqsr_modify_charcode; |
| 599 | 599 | modify_spritecode = moonqsr_modify_spritecode; |
| r1591 | r1592 | |
| 601 | 601 | |
| 602 | 602 | VIDEO_START( mshuttle ) |
| 603 | 603 | { |
| 604 | | |
| 604 | VIDEO_START_CALL(galaxian | |
| 605 | 605 | |
| 606 | 606 | modify_charcode = mshuttle_modify_charcode; |
| 607 | 607 | modify_spritecode = mshuttle_modify_spritecode; |
| r1591 | r1592 | |
| 609 | 609 | |
| 610 | 610 | VIDEO_START( pisces ) |
| 611 | 611 | { |
| 612 | | |
| 612 | VIDEO_START_CALL(galaxian | |
| 613 | 613 | |
| 614 | 614 | modify_charcode = pisces_modify_charcode; |
| 615 | 615 | modify_spritecode = pisces_modify_spritecode; |
| r1591 | r1592 | |
| 617 | 617 | |
| 618 | 618 | VIDEO_START( gteikob2 ) |
| 619 | 619 | { |
| 620 | | |
| 620 | VIDEO_START_CALL(pisces | |
| 621 | 621 | |
| 622 | 622 | draw_bullets = gteikob2_draw_bullets; |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | VIDEO_START( batman2 ) |
| 626 | 626 | { |
| 627 | | |
| 627 | VIDEO_START_CALL(galaxian | |
| 628 | 628 | |
| 629 | 629 | modify_charcode = batman2_modify_charcode; |
| 630 | 630 | modify_spritecode = batman2_modify_spritecode; |
| r1591 | r1592 | |
| 633 | 633 | |
| 634 | 634 | VIDEO_START( scramble ) |
| 635 | 635 | { |
| 636 | | |
| 636 | VIDEO_START_CALL(galaxian_plain | |
| 637 | 637 | |
| 638 | 638 | /* FIXME: This most probably needs to be adjusted |
| 639 | 639 | * again when RAW video params are added to scramble |
| r1591 | r1592 | |
| 663 | 663 | |
| 664 | 664 | VIDEO_START( turtles ) |
| 665 | 665 | { |
| 666 | | |
| 666 | VIDEO_START_CALL(galaxian_plain | |
| 667 | 667 | |
| 668 | 668 | draw_background = turtles_draw_background; |
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | VIDEO_START( theend ) |
| 672 | 672 | { |
| 673 | | |
| 673 | VIDEO_START_CALL(galaxian | |
| 674 | 674 | |
| 675 | 675 | draw_bullets = theend_draw_bullets; |
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | VIDEO_START( darkplnt ) |
| 679 | 679 | { |
| 680 | | |
| 680 | VIDEO_START_CALL(galaxian_plain | |
| 681 | 681 | |
| 682 | 682 | tilemap_set_scrolldx(bg_tilemap, 0, 0); |
| 683 | 683 | draw_bullets = darkplnt_draw_bullets; |
| r1591 | r1592 | |
| 685 | 685 | |
| 686 | 686 | VIDEO_START( rescue ) |
| 687 | 687 | { |
| 688 | | |
| 688 | VIDEO_START_CALL(scrambl | |
| 689 | 689 | |
| 690 | 690 | draw_stars = rescue_draw_stars; |
| 691 | 691 | |
| r1591 | r1592 | |
| 694 | 694 | |
| 695 | 695 | VIDEO_START( minefld ) |
| 696 | 696 | { |
| 697 | | |
| 697 | VIDEO_START_CALL(scrambl | |
| 698 | 698 | |
| 699 | 699 | draw_stars = rescue_draw_stars; |
| 700 | 700 | |
| r1591 | r1592 | |
| 703 | 703 | |
| 704 | 704 | VIDEO_START( stratgyx ) |
| 705 | 705 | { |
| 706 | | |
| 706 | VIDEO_START_CALL(galaxian_plain | |
| 707 | 707 | |
| 708 | 708 | draw_background = stratgyx_draw_background; |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | VIDEO_START( ckongs ) |
| 712 | 712 | { |
| 713 | | |
| 713 | VIDEO_START_CALL(scrambl | |
| 714 | 714 | |
| 715 | 715 | modify_spritecode = mshuttle_modify_spritecode; |
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | VIDEO_START( calipso ) |
| 719 | 719 | { |
| 720 | | |
| 720 | VIDEO_START_CALL(galaxian_plain | |
| 721 | 721 | |
| 722 | 722 | draw_bullets = scramble_draw_bullets; |
| 723 | 723 | |
| r1591 | r1592 | |
| 728 | 728 | |
| 729 | 729 | VIDEO_START( mariner ) |
| 730 | 730 | { |
| 731 | | |
| 731 | VIDEO_START_CALL(galaxian_plain | |
| 732 | 732 | |
| 733 | 733 | draw_stars = mariner_draw_stars; |
| 734 | 734 | |
| r1591 | r1592 | |
| 741 | 741 | |
| 742 | 742 | VIDEO_START( froggers ) |
| 743 | 743 | { |
| 744 | | |
| 744 | VIDEO_START_CALL(galaxian_plain | |
| 745 | 745 | |
| 746 | 746 | draw_background = frogger_draw_background; |
| 747 | 747 | modify_color = frogger_modify_color; |
| r1591 | r1592 | |
| 749 | 749 | |
| 750 | 750 | VIDEO_START( frogger ) |
| 751 | 751 | { |
| 752 | | |
| 752 | VIDEO_START_CALL(froggers | |
| 753 | 753 | |
| 754 | 754 | modify_ypos = frogger_modify_ypos; |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | VIDEO_START( jumpbug ) |
| 758 | 758 | { |
| 759 | | |
| 759 | VIDEO_START_CALL(scrambl | |
| 760 | 760 | |
| 761 | 761 | draw_stars = jumpbug_draw_stars; |
| 762 | 762 | |
| r1591 | r1592 | |
| 766 | 766 | |
| 767 | 767 | VIDEO_START( azurian ) |
| 768 | 768 | { |
| 769 | | |
| 769 | VIDEO_START_CALL(galaxian_plain | |
| 770 | 770 | |
| 771 | 771 | draw_stars = galaxian_draw_stars; |
| 772 | 772 | draw_bullets = scramble_draw_bullets; /* Shots are yellow like in Scramble */ |
| r1591 | r1592 | |
| 774 | 774 | |
| 775 | 775 | VIDEO_START( mimonkey ) |
| 776 | 776 | { |
| 777 | | |
| 777 | VIDEO_START_CALL(scrambl | |
| 778 | 778 | |
| 779 | 779 | modify_charcode = mimonkey_modify_charcode; |
| 780 | 780 | modify_spritecode = mimonkey_modify_spritecode; |
| r1591 | r1592 | |
| 782 | 782 | |
| 783 | 783 | VIDEO_START( dkongjrm ) |
| 784 | 784 | { |
| 785 | | |
| 785 | VIDEO_START_CALL(galaxian_plain | |
| 786 | 786 | |
| 787 | 787 | modify_charcode = pisces_modify_charcode; |
| 788 | 788 | modify_spritecode = dkongjrm_modify_spritecode; |
| r1591 | r1592 | |
| 792 | 792 | |
| 793 | 793 | VIDEO_START( newsin7 ) |
| 794 | 794 | { |
| 795 | | |
| 795 | VIDEO_START_CALL(scrambl | |
| 796 | 796 | |
| 797 | 797 | spritevisiblearea = &_spritevisibleareaflipx; |
| 798 | 798 | spritevisibleareaflipx = &_spritevisiblearea; |
| r1591 | r1592 | |
| 800 | 800 | |
| 801 | 801 | VIDEO_START( scorpion ) |
| 802 | 802 | { |
| 803 | | |
| 803 | VIDEO_START_CALL(scrambl | |
| 804 | 804 | |
| 805 | 805 | modify_spritecode = batman2_modify_spritecode; |
| 806 | 806 | } |
| r1591 | r1592 | |
| 817 | 817 | |
| 818 | 818 | VIDEO_START( rockclim ) |
| 819 | 819 | { |
| 820 | | |
| 820 | VIDEO_START_CALL(galaxian | |
| 821 | 821 | rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32); |
| 822 | 822 | draw_background = rockclim_draw_background; |
| 823 | 823 | modify_charcode = mooncrst_modify_charcode; |
| r1591 | r1592 | |
| 976 | 976 | |
| 977 | 977 | VIDEO_START( bongo ) |
| 978 | 978 | { |
| 979 | | |
| 979 | VIDEO_START_CALL(galaxian_plain | |
| 980 | 980 | |
| 981 | 981 | modify_spritecode = batman2_modify_spritecode; |
| 982 | 982 | } |
| r1591 | r1592 | |
| 1003 | 1003 | |
| 1004 | 1004 | VIDEO_START( dambustr ) |
| 1005 | 1005 | { |
| 1006 | | |
| 1006 | VIDEO_START_CALL(galaxian | |
| 1007 | 1007 | |
| 1008 | 1008 | dambustr_bg_split_line = 0; |
| 1009 | 1009 | dambustr_bg_color_1 = 0; |
| r1591 | r1592 | |
|---|---|---|
| 36 | 36 | PALETTE_INIT( snk_3bpp_shadow ) |
| 37 | 37 | { |
| 38 | 38 | int i; |
| 39 | | |
| 39 | PALETTE_INIT_CALL(RRRR_GGGG_BBBB | |
| 40 | 40 | |
| 41 | 41 | if(!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) |
| 42 | 42 | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| r1591 | r1592 | |
| 51 | 51 | PALETTE_INIT( snk_4bpp_shadow ) |
| 52 | 52 | { |
| 53 | 53 | int i; |
| 54 | | |
| 54 | PALETTE_INIT_CALL(RRRR_GGGG_BBBB | |
| 55 | 55 | |
| 56 | 56 | if(!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) |
| 57 | 57 | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| r1591 | r1592 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | paletteram = auto_malloc(0x200); |
| 56 | 56 | paletteram_2 = auto_malloc(0x200); |
| 57 | video_start_generic(machine); | |
| 58 | 57 | } |
| 59 | 58 | |
| 60 | 59 | VIDEO_START( victnine ) |
| r1591 | r1592 | |
| 64 | 63 | |
| 65 | 64 | paletteram = auto_malloc(0x200); |
| 66 | 65 | paletteram_2 = auto_malloc(0x200); |
| 67 | video_start_generic(machine); | |
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | WRITE8_HANDLER( flstory_videoram_w ) |
| r1591 | r1592 | |
|---|---|---|
| 71 | 71 | VIDEO_START( ataxx ) |
| 72 | 72 | { |
| 73 | 73 | /* first do the standard stuff */ |
| 74 | | |
| 74 | VIDEO_START_CALL(leland | |
| 75 | 75 | |
| 76 | 76 | /* allocate memory */ |
| 77 | 77 | ataxx_qram = auto_malloc(QRAM_SIZE); |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | VIDEO_START( 4enraya ) |
| 31 | 31 | { |
| 32 | 32 | bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 ); |
| 33 | video_start_generic(machine); | |
| 34 | 33 | } |
| 35 | 34 | |
| 36 | 35 | VIDEO_UPDATE( 4enraya) |
| r1591 | r1592 | |
|---|---|---|
| 1242 | 1242 | { |
| 1243 | 1243 | buffer_spriteram16_w(0, 0, 0); |
| 1244 | 1244 | memcpy(toaplan1_buffered_spritesizeram16, toaplan1_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); |
| 1245 | cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE); /* Frame done */ | |
| 1245 | cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE); /* Frame done */ | |
| 1246 | 1246 | } |
| r1591 | r1592 | |
|---|---|---|
| 611 | 611 | { |
| 612 | 612 | /* port 0: irq ack */ |
| 613 | 613 | case 0: |
| 614 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 614 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 615 | 615 | break; |
| 616 | 616 | |
| 617 | 617 | /* port 1: background control |
| r1591 | r1592 | |
|---|---|---|
| 339 | 339 | |
| 340 | 340 | /* bit 3 high then low triggers irq on sound CPU */ |
| 341 | 341 | if (last == 0x08 && (data & 0x08) == 0) |
| 342 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 342 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 343 | 343 | |
| 344 | 344 | last = data & 0x08; |
| 345 | 345 | |
| r1591 | r1592 | |
| 365 | 365 | |
| 366 | 366 | /* bit 2 = trigger irq on sound CPU */ |
| 367 | 367 | if (last == 0x04 && (data & 0x04) == 0) |
| 368 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 368 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 369 | 369 | |
| 370 | 370 | last = data & 0x04; |
| 371 | 371 | |
| r1591 | r1592 | |
| 387 | 387 | |
| 388 | 388 | /* bit 2 = trigger irq on sound CPU */ |
| 389 | 389 | if (last == 0x00 && (data & 0x04) == 0x04) |
| 390 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 390 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 391 | 391 | |
| 392 | 392 | last = data & 0x04; |
| 393 | 393 | |
| r1591 | r1592 | |
| 767 | 767 | palette_set_shadow_mode(machine, 0); |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | | |
| 770 | VIDEO_UPDATE_CALL(lgtnfgh | |
| 771 | 771 | return 0; |
| 772 | 772 | } |
| 773 | 773 |
| r1591 | r1592 | |
|---|---|---|
| 146 | 146 | state_save_register_global(bt477.pixmask); |
| 147 | 147 | state_save_register_global(bt477.command); |
| 148 | 148 | state_save_register_global(bt477.color); |
| 149 | ||
| 150 | video_start_generic_bitmapped(machine); | |
| 151 | 149 | } |
| r1591 | r1592 | |
|---|---|---|
| 185 | 185 | tmp_bitmap[2] = auto_bitmap_alloc(128,128,machine->screen[0].format); |
| 186 | 186 | tmp_bitmap[3] = auto_bitmap_alloc(128,128,machine->screen[0].format); |
| 187 | 187 | pitnrun_spotlights(); |
| 188 | video_start_generic(machine); | |
| 189 | 188 | } |
| 190 | 189 | |
| 191 | 190 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r1591 | r1592 | |
|---|---|---|
| 252 | 252 | |
| 253 | 253 | static TIMER_CALLBACK( int_timer_callback ) |
| 254 | 254 | { |
| 255 | cpunum_set_input_line(0, 2, ASSERT_LINE); | |
| 255 | cpunum_set_input_line(machine, 0, 2, ASSERT_LINE); | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 |
| r1591 | r1592 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | static void generate_interrupt(running_machine *machine, int state) |
| 25 | 25 | { |
| 26 | cpunum_set_input_line(0, M6809_FIRQ_LINE, state); | |
| 26 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, state); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | static const struct tms34061_interface tms34061intf = |
| r1591 | r1592 | |
|---|---|---|
| 118 | 118 | if ((oldword & 8) && !(newword & 8) && current_scanline != 0) |
| 119 | 119 | { |
| 120 | 120 | logerror("Suspending time! (scanline = %d)\n", current_scanline); |
| 121 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 121 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 |
| r1591 | r1592 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | static TIMER_CALLBACK( cchasm_refresh_end ) |
| 25 | 25 | { |
| 26 | cpunum_set_input_line (0, 2, ASSERT_LINE); | |
| 26 | cpunum_set_input_line (machine, 0, 2, ASSERT_LINE); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | static void cchasm_refresh (void) |
| r1591 | r1592 | |
| 114 | 114 | cchasm_refresh(); |
| 115 | 115 | break; |
| 116 | 116 | case 0xf7: |
| 117 | cpunum_set_input_line (0, 2, CLEAR_LINE); | |
| 117 | cpunum_set_input_line (Machine, 0, 2, CLEAR_LINE); | |
| 118 | 118 | break; |
| 119 | 119 | } |
| 120 | 120 | } |
| r1591 | r1592 | |
| 132 | 132 | xcenter=((xmax+xmin)/2) << 16; |
| 133 | 133 | ycenter=((ymax+ymin)/2) << 16; |
| 134 | 134 | |
| 135 | | |
| 135 | VIDEO_START_CALL(vector | |
| 136 | 136 | } |
| r1591 | r1592 | |
|---|---|---|
| 441 | 441 | |
| 442 | 442 | |
| 443 | 443 | /*--------------------------------------------------------------- |
| 444 | | |
| 444 | VIDEO_EOF(atarirle): Flush remaining changes. | |
| 445 | 445 | ---------------------------------------------------------------*/ |
| 446 | 446 | |
| 447 | 447 | VIDEO_EOF( atarirle ) |
| 448 | 448 | { |
| 449 | 449 | int i; |
| 450 | 450 | |
| 451 | //logerror(" | |
| 451 | //logerror("VIDEO_EOF(atarirle)\n"); | |
| 452 | 452 | |
| 453 | 453 | /* loop over all RLE handlers */ |
| 454 | 454 | for (i = 0; i < ATARIRLE_MAX; i++) |
| r1591 | r1592 | |
|---|---|---|
| 180 | 180 | VIDEO_START( cinemat_bilevel ) |
| 181 | 181 | { |
| 182 | 182 | color_mode = COLOR_BILEVEL; |
| 183 | | |
| 183 | VIDEO_START_CALL(vector | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
| 187 | 187 | VIDEO_START( cinemat_16level ) |
| 188 | 188 | { |
| 189 | 189 | color_mode = COLOR_16LEVEL; |
| 190 | | |
| 190 | VIDEO_START_CALL(vector | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | |
| 194 | 194 | VIDEO_START( cinemat_64level ) |
| 195 | 195 | { |
| 196 | 196 | color_mode = COLOR_64LEVEL; |
| 197 | | |
| 197 | VIDEO_START_CALL(vector | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | |
| 201 | 201 | VIDEO_START( cinemat_color ) |
| 202 | 202 | { |
| 203 | 203 | color_mode = COLOR_RGB; |
| 204 | | |
| 204 | VIDEO_START_CALL(vector | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | |
| 208 | 208 | VIDEO_START( cinemat_qb3color ) |
| 209 | 209 | { |
| 210 | 210 | color_mode = COLOR_QB3; |
| 211 | | |
| 211 | VIDEO_START_CALL(vector | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| r1591 | r1592 | |
| 236 | 236 | { |
| 237 | 237 | int sw_option = readinputportbytag("INPUTS"); |
| 238 | 238 | |
| 239 | | |
| 239 | VIDEO_UPDATE_CALL(vector | |
| 240 | 240 | |
| 241 | 241 | /* set the state of the artwork */ |
| 242 | 242 | output_set_value("pressed3", (~sw_option >> 0) & 1); |
| r1591 | r1592 | |
|---|---|---|
| 952 | 952 | /* HACK! When tilted, sound CPU needs to be reset. */ |
| 953 | 953 | if (Machine->drv->sound[0].type == SOUND_YM3812) |
| 954 | 954 | { |
| 955 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 955 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 956 | 956 | sndti_reset(SOUND_YM3812, 0); |
| 957 | 957 | } |
| 958 | 958 | } |
| r1591 | r1592 | |
| 1517 | 1517 | |
| 1518 | 1518 | VIDEO_UPDATE( truxton2_0 ) |
| 1519 | 1519 | { |
| 1520 | | |
| 1520 | VIDEO_UPDATE_CALL(toaplan2_0 | |
| 1521 | 1521 | tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); |
| 1522 | 1522 | return 0; |
| 1523 | 1523 | } |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | { |
| 73 | 73 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 74 | 74 | TILEMAP_TYPE_PEN, 8, 8, 64, 32); |
| 75 | tilemap_set_scrolldx(bg_tilemap, 0, 396 - 256); | |
| 75 | 76 | } |
| 76 | 77 | |
| 77 | 78 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ) |
| r1591 | r1592 | |
|---|---|---|
| 77 | 77 | COMBINE_DATA(&misc_control); |
| 78 | 78 | |
| 79 | 79 | /* bit 3 controls sound reset line */ |
| 80 | cpunum_set_input_line(1, INPUT_LINE_RESET, (misc_control & 8) ? CLEAR_LINE : ASSERT_LINE); | |
| 80 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (misc_control & 8) ? CLEAR_LINE : ASSERT_LINE); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r1591 | r1592 | |
|---|---|---|
| 141 | 141 | /* 32 colour codes for the tiles */ |
| 142 | 142 | VIDEO_START( cischeat ) |
| 143 | 143 | { |
| 144 | | |
| 144 | VIDEO_START_CALL(megasys1 | |
| 145 | 145 | |
| 146 | 146 | megasys1_bits_per_color_code = 5; |
| 147 | 147 | |
| r1591 | r1592 | |
| 155 | 155 | /* 16 colour codes for the tiles */ |
| 156 | 156 | VIDEO_START( f1gpstar ) |
| 157 | 157 | { |
| 158 | | |
| 158 | VIDEO_START_CALL(cischeat | |
| 159 | 159 | |
| 160 | 160 | megasys1_bits_per_color_code = 4; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | VIDEO_START( bigrun ) |
| 164 | 164 | { |
| 165 | | |
| 165 | VIDEO_START_CALL(f1gpstar | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| r1591 | r1592 | |
| 297 | 297 | case 0x2208/2 : break; // watchdog reset |
| 298 | 298 | |
| 299 | 299 | /* Not sure about this one.. */ |
| 300 | case 0x2308/2 : cpunum_set_input_line(1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 301 | cpunum_set_input_line(2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 302 | cpunum_set_input_line(3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 300 | case 0x2308/2 : cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 301 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 302 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 303 | 303 | break; |
| 304 | 304 | |
| 305 | 305 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1591 | r1592 | |
| 386 | 386 | |
| 387 | 387 | case 0x2300/2 : /* Sound CPU: reads latch during int 4, and stores command */ |
| 388 | 388 | soundlatch_word_w(0,new_data,0); |
| 389 | cpunum_set_input_line(3,4,HOLD_LINE); | |
| 389 | cpunum_set_input_line(Machine, 3,4,HOLD_LINE); | |
| 390 | 390 | break; |
| 391 | 391 | |
| 392 | 392 | /* Not sure about this one.. */ |
| 393 | case 0x2308/2 : cpunum_set_input_line(1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 394 | cpunum_set_input_line(2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 395 | cpunum_set_input_line(3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 393 | case 0x2308/2 : cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 394 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 395 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 396 | 396 | break; |
| 397 | 397 | |
| 398 | 398 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1591 | r1592 | |
| 505 | 505 | |
| 506 | 506 | /* Usually written in sequence, but not always */ |
| 507 | 507 | case 0x0008/2 : soundlatch_word_w(0,new_data,0); break; |
| 508 | case 0x0018/2 : cpunum_set_input_line(3,4,HOLD_LINE); break; | |
| 508 | case 0x0018/2 : cpunum_set_input_line(Machine, 3,4,HOLD_LINE); break; | |
| 509 | 509 | |
| 510 | 510 | case 0x0010/2 : break; |
| 511 | 511 | |
| r1591 | r1592 | |
| 525 | 525 | case 0x2208/2 : break; // watchdog reset |
| 526 | 526 | |
| 527 | 527 | /* Not sure about this one. Values: $10 then 0, $7 then 0 */ |
| 528 | case 0x2308/2 : cpunum_set_input_line(1, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 529 | cpunum_set_input_line(2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 530 | cpunum_set_input_line(3, INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE ); | |
| 528 | case 0x2308/2 : cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 529 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 530 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE ); | |
| 531 | 531 | break; |
| 532 | 532 | |
| 533 | 533 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1591 | r1592 | |
| 547 | 547 | case 0x0000/2 : |
| 548 | 548 | if (ACCESSING_LSB) |
| 549 | 549 | { |
| 550 | cpunum_set_input_line(4,4,(new_data & 4)?ASSERT_LINE:CLEAR_LINE); | |
| 551 | cpunum_set_input_line(4,2,(new_data & 2)?ASSERT_LINE:CLEAR_LINE); | |
| 550 | cpunum_set_input_line(Machine, 4,4,(new_data & 4)?ASSERT_LINE:CLEAR_LINE); | |
| 551 | cpunum_set_input_line(Machine, 4,2,(new_data & 2)?ASSERT_LINE:CLEAR_LINE); | |
| 552 | 552 | } |
| 553 | 553 | break; |
| 554 | 554 |
| r1591 | r1592 | |
|---|---|---|
| 706 | 706 | { |
| 707 | 707 | for(col=0;col<4;col++) |
| 708 | 708 | { |
| 709 | float sum = 0.0; | |
| 709 | float sum = 0.0f; | |
| 710 | 710 | int i; |
| 711 | 711 | for( i=0; i<4; i++ ) |
| 712 | 712 | { |
| r1591 | r1592 | |
| 2222 | 2222 | poly_free(poly); |
| 2223 | 2223 | } |
| 2224 | 2224 | |
| 2225 | static | |
| 2225 | static VIDEO | |
| 2226 | 2226 | { |
| 2227 | 2227 | bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64 ); |
| 2228 | 2228 | tilemap_set_transparent_pen( bgtilemap, 0xf ); |
| r1591 | r1592 | |
| 2249 | 2249 | VIDEO_START( namcos22 ) |
| 2250 | 2250 | { |
| 2251 | 2251 | mbSuperSystem22 = 0; |
| 2252 | | |
| 2252 | VIDEO_START_CALL(common | |
| 2253 | 2253 | } |
| 2254 | 2254 | |
| 2255 | 2255 | VIDEO_START( namcos22s ) |
| r1591 | r1592 | |
| 2259 | 2259 | namcos22_czram[1] = auto_malloc( 0x200 ); |
| 2260 | 2260 | namcos22_czram[2] = auto_malloc( 0x200 ); |
| 2261 | 2261 | namcos22_czram[3] = auto_malloc( 0x200 ); |
| 2262 | | |
| 2262 | VIDEO_START_CALL(common | |
| 2263 | 2263 | } |
| 2264 | 2264 | |
| 2265 | 2265 | VIDEO_UPDATE( namcos22s ) |
| r1591 | r1592 | |
|---|---|---|
| 143 | 143 | VIDEO_UPDATE( vicdual_bw_or_color ) |
| 144 | 144 | { |
| 145 | 145 | if (vicdual_is_cabinet_color()) |
| 146 | | |
| 146 | VIDEO_UPDATE_CALL(vicdual_color | |
| 147 | 147 | else |
| 148 | | |
| 148 | VIDEO_UPDATE_CALL(vicdual_bw | |
| 149 | 149 | |
| 150 | 150 | return 0; |
| 151 | 151 | } |
| r1591 | r1592 | |
|---|---|---|
| 248 | 248 | /* sound CPU reset */ |
| 249 | 249 | if (diff & 0x0080) |
| 250 | 250 | { |
| 251 | cpunum_set_input_line(1, INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE); | |
| 251 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE); | |
| 252 | 252 | if (!(newselect & 0x0080)) atarigen_sound_reset(); |
| 253 | 253 | } |
| 254 | 254 |
| r1591 | r1592 | |
|---|---|---|
| 58 | 58 | bit 7 (0x80) set in playfield 1 is reverse screen (set via dip-switch) |
| 59 | 59 | bit 7 (0x80) in other playfields unknown |
| 60 | 60 | 2: unknown (00 in bg, 03 in fg+text - maybe controls pf transparency?) |
| 61 | 4: unknown (always 00) | |
| 61 | 4: unknown (always 00) [Used to access 2nd bank of tiles in Stadium Hero) | |
| 62 | 62 | 6: playfield shape: 00 = 4x1, 01 = 2x2, 02 = 1x4 (low 4 bits only) |
| 63 | 63 | |
| 64 | 64 | bank 1: |
| r1591 | r1592 | |
| 713 | 713 | |
| 714 | 714 | VIDEO_START( dec0 ) |
| 715 | 715 | { |
| 716 | | |
| 716 | VIDEO_START_CALL(dec0_nodma | |
| 717 | 717 | dec0_spriteram=auto_malloc(0x800); |
| 718 | 718 | } |
| 719 | 719 |
| r1591 | r1592 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | VIDEO_START( eaglshot ) |
| 201 | 201 | { |
| 202 | | |
| 202 | VIDEO_START_CALL(ssv | |
| 203 | 203 | |
| 204 | 204 | eaglshot_gfxram = (UINT16*)auto_malloc(16 * 0x40000); |
| 205 | 205 | eaglshot_dirty_tile = (char*)auto_malloc(16 * 0x40000 / (16*8)); |
| r1591 | r1592 | |
| 221 | 221 | |
| 222 | 222 | VIDEO_START( gdfs ) |
| 223 | 223 | { |
| 224 | | |
| 224 | VIDEO_START_CALL(ssv | |
| 225 | 225 | |
| 226 | 226 | machine->gfx[2]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */ |
| 227 | 227 | |
| r1591 | r1592 | |
| 936 | 936 | } |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | | |
| 939 | VIDEO_UPDATE_CALL(ssv | |
| 940 | 940 | return 0; |
| 941 | 941 | } |
| 942 | 942 | |
| r1591 | r1592 | |
| 1107 | 1107 | { |
| 1108 | 1108 | int tile, pri; |
| 1109 | 1109 | |
| 1110 | | |
| 1110 | VIDEO_UPDATE_CALL(ssv | |
| 1111 | 1111 | |
| 1112 | 1112 | // Decode zooming sprites tiles from ram |
| 1113 | 1113 | if (eaglshot_dirty) |
| r1591 | r1592 | |
|---|---|---|
| 459 | 459 | |
| 460 | 460 | VIDEO_START( blzntrnd ) |
| 461 | 461 | { |
| 462 | | |
| 462 | VIDEO_START_CALL(metro_14220 | |
| 463 | 463 | |
| 464 | 464 | has_zoom = 1; |
| 465 | 465 | |
| r1591 | r1592 | |
| 476 | 476 | |
| 477 | 477 | VIDEO_START( gstrik2 ) |
| 478 | 478 | { |
| 479 | | |
| 479 | VIDEO_START_CALL(metro_14220 | |
| 480 | 480 | |
| 481 | 481 | has_zoom = 1; |
| 482 | 482 |
| r1591 | r1592 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | if (scanline != -1) |
| 61 | 61 | { |
| 62 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 62 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 63 | 63 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline + 1, 0), scanline, attotime_zero); |
| 64 | 64 | timer_set(ATTOTIME_IN_HZ(25000000), NULL, -1, scanline_timer_cb); |
| 65 | 65 | } |
| 66 | 66 | else |
| 67 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 67 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 |
| r1591 | r1592 | |
|---|---|---|
| 59 | 59 | coin_counter_w(1, data & 0x02); |
| 60 | 60 | |
| 61 | 61 | // bit 4 resets the sound CPU |
| 62 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); | |
| 62 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); | |
| 63 | 63 | |
| 64 | 64 | // bit 7 flips screen |
| 65 | 65 | flip_screen_set(data & 0x80); |
| r1591 | r1592 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "ninjakd2.h" | |
| 2 | 3 | |
| 3 | UINT8 *ninjakd2_bg_videoram, *ninjakd2_fg_videoram; | |
| 4 | UINT8* ninjakd2_bg_videoram; | |
| 5 | UINT8* ninjakd2_fg_videoram; | |
| 4 | 6 | |
| 5 | static UINT8 ninjakd2_bg_enable = 1, sprite_overdraw_enabled = 0; | |
| 6 | static UINT16 ninjakd2_scrollx, ninjakd2_scrolly; | |
| 7 | static tilemap *fg_tilemap, *bg_tilemap; | |
| 8 | static mame_bitmap *bitmap_sp; /* for sprite overdraw */ | |
| 7 | static int sprite_overdraw_enabled; | |
| 8 | static int next_sprite_overdraw_enabled; | |
| 9 | static mame_bitmap *sp_bitmap; | |
| 10 | // in robokid and omegaf big sprites are laid out differently in ROM | |
| 11 | static int robokid_sprites; | |
| 9 | 12 | |
| 10 | static TILE_GET_INFO( get_bg_tile_info ) | |
| 13 | static tilemap* fg_tilemap; | |
| 14 | static tilemap* bg_tilemap; | |
| 15 | static tilemap* bg0_tilemap; | |
| 16 | static tilemap* bg1_tilemap; | |
| 17 | static tilemap* bg2_tilemap; | |
| 18 | ||
| 19 | static int bank_mask = 1; | |
| 20 | static int robokid_bg0_bank = 0; | |
| 21 | static int robokid_bg1_bank = 0; | |
| 22 | static int robokid_bg2_bank = 0; | |
| 23 | static UINT8* robokid_bg0_videoram; | |
| 24 | static UINT8* robokid_bg1_videoram; | |
| 25 | static UINT8* robokid_bg2_videoram; | |
| 26 | ||
| 27 | ||
| 28 | static TILE_GET_INFO( get_fg_tile_info ) | |
| 11 | 29 | { |
| 12 | int code = ((ninjakd2_bg_videoram[tile_index*2 + 1] & 0xc0) << 2) | ninjakd2_bg_videoram[tile_index*2]; | |
| 13 | int color = ninjakd2_bg_videoram[tile_index*2 + 1] & 0xf; | |
| 14 | SET_TILE_INFO(0, code, color, TILE_FLIPYX((ninjakd2_bg_videoram[tile_index*2 + 1] & 0x30) >> 4)); | |
| 30 | int const lo = ninjakd2_fg_videoram[(tile_index << 1)]; | |
| 31 | int const hi = ninjakd2_fg_videoram[(tile_index << 1) | 1]; | |
| 32 | int const tile = ((hi & 0xc0) << 2) | lo; | |
| 33 | int const flipyx = (hi & 0x30) >> 4; | |
| 34 | int const color = hi & 0x0f; | |
| 35 | ||
| 36 | SET_TILE_INFO( | |
| 37 | 0, | |
| 38 | tile, | |
| 39 | color, | |
| 40 | TILE_FLIPYX(flipyx)); | |
| 15 | 41 | } |
| 16 | 42 | |
| 17 | static TILE_GET_INFO( get_ | |
| 43 | static TILE_GET_INFO( ninjakd2_get_bg_tile_info ) | |
| 18 | 44 | { |
| 19 | int code = ((ninjakd2_fg_videoram[tile_index*2 + 1] & 0xc0) << 2) | ninjakd2_fg_videoram[tile_index*2]; | |
| 20 | int color = ninjakd2_fg_videoram[tile_index*2 + 1] & 0xf; | |
| 21 | SET_TILE_INFO(2, code, color, TILE_FLIPYX((ninjakd2_fg_videoram[tile_index*2 + 1] & 0x30) >> 4)); | |
| 45 | int const lo = ninjakd2_bg_videoram[(tile_index << 1)]; | |
| 46 | int const hi = ninjakd2_bg_videoram[(tile_index << 1) | 1]; | |
| 47 | int const tile = ((hi & 0xc0) << 2) | lo; | |
| 48 | int const flipyx = (hi & 0x30) >> 4; | |
| 49 | int const color = hi & 0x0f; | |
| 50 | ||
| 51 | SET_TILE_INFO( | |
| 52 | 2, | |
| 53 | tile, | |
| 54 | color, | |
| 55 | TILE_FLIPYX(flipyx)); | |
| 22 | 56 | } |
| 23 | 57 | |
| 58 | static TILE_GET_INFO( mnight_get_bg_tile_info ) | |
| 59 | { | |
| 60 | int const lo = ninjakd2_bg_videoram[(tile_index << 1)]; | |
| 61 | int const hi = ninjakd2_bg_videoram[(tile_index << 1) | 1]; | |
| 62 | int const tile = ((hi & 0x10) << 6) | ((hi & 0xc0) << 2) | lo; | |
| 63 | int const flipy = (hi & 0x20) >> 5; | |
| 64 | int const color = hi & 0x0f; | |
| 65 | ||
| 66 | SET_TILE_INFO( | |
| 67 | 2, | |
| 68 | tile, | |
| 69 | color, | |
| 70 | flipy ? TILE_FLIPY : 0); | |
| 71 | } | |
| 72 | ||
| 73 | static TILEMAP_MAPPER( robokid_bg_scan ) | |
| 74 | { | |
| 75 | /* logical (col,row) -> memory offset */ | |
| 76 | return (col & 0x0f) | ((row & 0x1f) << 4) | ((col & 0x10) << 5); | |
| 77 | } | |
| 78 | ||
| 79 | static TILEMAP_MAPPER( omegaf_bg_scan ) | |
| 80 | { | |
| 81 | /* logical (col,row) -> memory offset */ | |
| 82 | return (col & 0x0f) | ((row & 0x1f) << 4) | ((col & 0x70) << 5); | |
| 83 | } | |
| 84 | ||
| 85 | void robokid_get_bg_tile_info(running_machine* const machine, tile_data* const tileinfo, tilemap_memory_index const tile_index, int const gfxnum, const UINT8* const videoram) | |
| 86 | { | |
| 87 | int const lo = videoram[(tile_index << 1)]; | |
| 88 | int const hi = videoram[(tile_index << 1) | 1]; | |
| 89 | int const tile = ((hi & 0x10) << 7) | ((hi & 0x20) << 5) | ((hi & 0xc0) << 2) | lo; | |
| 90 | int const color = hi & 0x0f; | |
| 91 | ||
| 92 | SET_TILE_INFO( | |
| 93 | gfxnum, | |
| 94 | tile, | |
| 95 | color, | |
| 96 | 0); | |
| 97 | } | |
| 98 | ||
| 99 | static TILE_GET_INFO( robokid_get_bg0_tile_info ) | |
| 100 | { | |
| 101 | robokid_get_bg_tile_info(machine, tileinfo, tile_index, 2, robokid_bg0_videoram); | |
| 102 | } | |
| 103 | ||
| 104 | static TILE_GET_INFO( robokid_get_bg1_tile_info ) | |
| 105 | { | |
| 106 | robokid_get_bg_tile_info(machine, tileinfo, tile_index, 3, robokid_bg1_videoram); | |
| 107 | } | |
| 108 | ||
| 109 | static TILE_GET_INFO( robokid_get_bg2_tile_info ) | |
| 110 | { | |
| 111 | robokid_get_bg_tile_info(machine, tileinfo, tile_index, 4, robokid_bg2_videoram); | |
| 112 | } | |
| 113 | ||
| 114 | ||
| 115 | ||
| 116 | static void videoram_alloc(const running_machine* const machine, int const size) | |
| 117 | { | |
| 118 | if (size) | |
| 119 | { | |
| 120 | /* create video ram */ | |
| 121 | robokid_bg0_videoram = auto_malloc(size); | |
| 122 | memset(robokid_bg0_videoram, 0x00, size); | |
| 123 | ||
| 124 | robokid_bg1_videoram = auto_malloc(size); | |
| 125 | memset(robokid_bg1_videoram, 0x00, size); | |
| 126 | ||
| 127 | robokid_bg2_videoram = auto_malloc(size); | |
| 128 | memset(robokid_bg2_videoram, 0x00, size); | |
| 129 | } | |
| 130 | ||
| 131 | sp_bitmap = auto_bitmap_alloc (machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); | |
| 132 | } | |
| 133 | ||
| 24 | 134 | VIDEO_START( ninjakd2 ) |
| 25 | 135 | { |
| 26 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32); | |
| 27 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32); | |
| 136 | videoram_alloc(machine, 0); | |
| 28 | 137 | |
| 138 | fg_tilemap = tilemap_create( get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32); | |
| 139 | bg_tilemap = tilemap_create(ninjakd2_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32); | |
| 140 | ||
| 29 | 141 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| 30 | 142 | |
| 31 | | |
| 143 | r | |
| 32 | 144 | } |
| 33 | 145 | |
| 146 | VIDEO_START( mnight ) | |
| 147 | { | |
| 148 | videoram_alloc(machine, 0); | |
| 149 | ||
| 150 | fg_tilemap = tilemap_create( get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32); | |
| 151 | bg_tilemap = tilemap_create(mnight_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32); | |
| 152 | ||
| 153 | tilemap_set_transparent_pen(fg_tilemap, 15); | |
| 154 | ||
| 155 | robokid_sprites = 0; | |
| 156 | } | |
| 157 | ||
| 158 | VIDEO_START( robokid ) | |
| 159 | { | |
| 160 | bank_mask = 1; | |
| 161 | ||
| 162 | videoram_alloc(machine, 0x0800); | |
| 163 | ||
| 164 | fg_tilemap = tilemap_create( get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32); | |
| 165 | bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, robokid_bg_scan, TILEMAP_TYPE_PEN, 16, 16, 32, 32); | |
| 166 | bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, robokid_bg_scan, TILEMAP_TYPE_PEN, 16, 16, 32, 32); | |
| 167 | bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, robokid_bg_scan, TILEMAP_TYPE_PEN, 16, 16, 32, 32); | |
| 168 | ||
| 169 | tilemap_set_transparent_pen(fg_tilemap, 15); | |
| 170 | tilemap_set_transparent_pen(bg1_tilemap, 15); | |
| 171 | tilemap_set_transparent_pen(bg2_tilemap, 15); | |
| 172 | ||
| 173 | robokid_sprites = 1; | |
| 174 | } | |
| 175 | ||
| 176 | VIDEO_START( omegaf ) | |
| 177 | { | |
| 178 | bank_mask = 7; | |
| 179 | ||
| 180 | videoram_alloc(machine, 0x2000); | |
| 181 | ||
| 182 | fg_tilemap = tilemap_create( get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32); | |
| 183 | bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, omegaf_bg_scan, TILEMAP_TYPE_PEN, 16, 16, 128, 32); | |
| 184 | bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, omegaf_bg_scan, TILEMAP_TYPE_PEN, 16, 16, 128, 32); | |
| 185 | bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, omegaf_bg_scan, TILEMAP_TYPE_PEN, 16, 16, 128, 32); | |
| 186 | ||
| 187 | tilemap_set_transparent_pen(fg_tilemap, 15); | |
| 188 | tilemap_set_transparent_pen(bg0_tilemap, 15); | |
| 189 | tilemap_set_transparent_pen(bg1_tilemap, 15); | |
| 190 | tilemap_set_transparent_pen(bg2_tilemap, 15); | |
| 191 | ||
| 192 | robokid_sprites = 1; | |
| 193 | } | |
| 194 | ||
| 195 | ||
| 196 | ||
| 34 | 197 | WRITE8_HANDLER( ninjakd2_bgvideoram_w ) |
| 35 | 198 | { |
| 36 | 199 | ninjakd2_bg_videoram[offset] = data; |
| r1591 | r1592 | |
| 43 | 206 | tilemap_mark_tile_dirty(fg_tilemap, offset >> 1); |
| 44 | 207 | } |
| 45 | 208 | |
| 46 | WRITE8_HANDLER( ninjakd2_scrollx_w ) | |
| 209 | ||
| 210 | ||
| 211 | WRITE8_HANDLER( robokid_bg0_bank_w ) | |
| 47 | 212 | { |
| 48 | if(offset) | |
| 49 | ninjakd2_scrollx = ((ninjakd2_scrollx & 0x0ff) | data*256) & 0x1ff; | |
| 50 | else | |
| 51 | ninjakd2_scrollx = ((ninjakd2_scrollx & 0x100) | data) & 0x1ff; | |
| 213 | robokid_bg0_bank = data & bank_mask; | |
| 52 | 214 | } |
| 53 | 215 | |
| 54 | WRITE8_HANDLER( | |
| 216 | WRITE8_HANDLER( robo | |
| 55 | 217 | { |
| 56 | if(offset) | |
| 57 | ninjakd2_scrolly = ((ninjakd2_scrolly & 0x0ff) | data*256) & 0x1ff; | |
| 58 | else | |
| 59 | ninjakd2_scrolly = ((ninjakd2_scrolly & 0x100) | data) & 0x1ff; | |
| 218 | robokid_bg1_bank = data & bank_mask; | |
| 60 | 219 | } |
| 61 | 220 | |
| 62 | WRITE8_HANDLER( | |
| 221 | WRITE8_HANDLER( robo | |
| 63 | 222 | { |
| 64 | | |
| 223 | robo | |
| 65 | 224 | } |
| 66 | 225 | |
| 67 | ||
| 226 | ||
| 68 | 227 | { |
| 69 | sprite_overdraw_enabled = data & 1; | |
| 228 | return robokid_bg0_videoram[(robokid_bg0_bank << 10) | offset]; | |
| 229 | } | |
| 70 | 230 | |
| 71 | if(sprite_overdraw_enabled) | |
| 72 | fillbitmap(bitmap_sp, 15, &Machine->screen[0].visarea); | |
| 231 | READ8_HANDLER( robokid_bg1_videoram_r ) | |
| 232 | { | |
| 233 | return robokid_bg1_videoram[(robokid_bg1_bank << 10) | offset]; | |
| 73 | 234 | } |
| 74 | 235 | |
| 75 | ||
| 236 | READ8_HANDLER( robokid | |
| 76 | 237 | { |
| 77 | int offs; | |
| 238 | return robokid_bg2_videoram[(robokid_bg2_bank << 10) | offset]; | |
| 239 | } | |
| 78 | 240 | |
| 79 | /* Draw the sprites */ | |
| 241 | WRITE8_HANDLER( robokid_bg0_videoram_w ) | |
| 242 | { | |
| 243 | int const address = (robokid_bg0_bank << 10 ) | offset; | |
| 80 | 244 | |
| 81 | for (offs = 11 ;offs < spriteram_size; offs+=16) | |
| 245 | robokid_bg0_videoram[address] = data; | |
| 246 | tilemap_mark_tile_dirty(bg0_tilemap, address >> 1); | |
| 247 | } | |
| 248 | ||
| 249 | WRITE8_HANDLER( robokid_bg1_videoram_w ) | |
| 250 | { | |
| 251 | int const address = (robokid_bg1_bank << 10 ) | offset; | |
| 252 | ||
| 253 | robokid_bg1_videoram[address] = data; | |
| 254 | tilemap_mark_tile_dirty(bg1_tilemap, address >> 1); | |
| 255 | } | |
| 256 | ||
| 257 | WRITE8_HANDLER( robokid_bg2_videoram_w ) | |
| 258 | { | |
| 259 | int const address = (robokid_bg2_bank << 10 ) | offset; | |
| 260 | ||
| 261 | robokid_bg2_videoram[address] = data; | |
| 262 | tilemap_mark_tile_dirty(bg2_tilemap, address >> 1); | |
| 263 | } | |
| 264 | ||
| 265 | ||
| 266 | ||
| 267 | void bg_ctrl(int offset, int data, tilemap* tilemap) | |
| 268 | { | |
| 269 | int scrollx = tilemap_get_scrollx(tilemap, 0); | |
| 270 | int scrolly = tilemap_get_scrolly(tilemap, 0); | |
| 271 | ||
| 272 | switch (offset) | |
| 82 | 273 | { |
| 83 | int sx,sy,tile,color,flipx,flipy; | |
| 274 | case 0: scrollx = ((scrollx & 0x100) | data); break; | |
| 275 | case 1: scrollx = ((scrollx & 0x0ff) | (data << 8)); break; | |
| 276 | case 2: scrolly = ((scrolly & 0x100) | data); break; | |
| 277 | case 3: scrolly = ((scrolly & 0x0ff) | (data << 8)); break; | |
| 278 | case 4: tilemap_set_enable(tilemap, data & 1); break; | |
| 279 | } | |
| 84 | 280 | |
| 85 | if (spriteram[offs+2] & 2) | |
| 281 | tilemap_set_scrollx(tilemap, 0, scrollx); | |
| 282 | tilemap_set_scrolly(tilemap, 0, scrolly); | |
| 283 | } | |
| 284 | ||
| 285 | WRITE8_HANDLER( ninjakd2_bg_ctrl_w ) | |
| 286 | { | |
| 287 | bg_ctrl(offset, data, bg_tilemap); | |
| 288 | } | |
| 289 | ||
| 290 | WRITE8_HANDLER( robokid_bg0_ctrl_w ) | |
| 291 | { | |
| 292 | bg_ctrl(offset, data, bg0_tilemap); | |
| 293 | } | |
| 294 | ||
| 295 | WRITE8_HANDLER( robokid_bg1_ctrl_w ) | |
| 296 | { | |
| 297 | bg_ctrl(offset, data, bg1_tilemap); | |
| 298 | } | |
| 299 | ||
| 300 | WRITE8_HANDLER( robokid_bg2_ctrl_w ) | |
| 301 | { | |
| 302 | bg_ctrl(offset, data, bg2_tilemap); | |
| 303 | } | |
| 304 | ||
| 305 | ||
| 306 | ||
| 307 | WRITE8_HANDLER( ninjakd2_sprite_overdraw_w ) | |
| 308 | { | |
| 309 | next_sprite_overdraw_enabled = data & 1; | |
| 310 | } | |
| 311 | ||
| 312 | ||
| 313 | static void draw_sprites(running_machine* const machine, mame_bitmap* const bitmap, const rectangle* const cliprect) | |
| 314 | { | |
| 315 | const gfx_element* const gfx = machine->gfx[1]; | |
| 316 | int const big_xshift = robokid_sprites ? 1 : 0; | |
| 317 | int const big_yshift = robokid_sprites ? 0 : 1; | |
| 318 | ||
| 319 | UINT8* sprptr = &spriteram[11]; | |
| 320 | int sprites_drawn = 0; | |
| 321 | ||
| 322 | // the sprite generator draws exactly 96 16x16 sprites per frame. When big | |
| 323 | // (32x32) sprites are drawn, this counts for 4 sprites drawn, so the sprite | |
| 324 | // list is reduced accordingly (i.e. three slots at the end of the list will | |
| 325 | // be ignored). Note that a disabled sprite, even if it is not draw, still | |
| 326 | // counts as one sprite drawn. | |
| 327 | // This is proven by Mutant Night, which doesn't work correctly (leaves shots | |
| 328 | // on screen) if we don't take this into account. | |
| 329 | ||
| 330 | for (;;) | |
| 331 | { | |
| 332 | if (sprptr[2] & 0x02) | |
| 86 | 333 | { |
| 87 | sx = spriteram[offs+1]; | |
| 88 | sy = spriteram[offs]; | |
| 89 | if (spriteram[offs+2] & 1) sx-=256; | |
| 90 | tile = spriteram[offs+3]+((spriteram[offs+2] & 0xc0)<<2); | |
| 91 | flipx = spriteram[offs+2] & 0x10; | |
| 92 | flipy = spriteram[offs+2] & 0x20; | |
| 93 | color = spriteram[offs+4] & 0x0f; | |
| 334 | int sx = sprptr[1] - ((sprptr[2] & 0x01) << 8); | |
| 335 | int sy = sprptr[0]; | |
| 336 | // Ninja Kid II doesn't use the topmost bit (it has smaller ROMs) so it might not be connected on the board | |
| 337 | int code = sprptr[3] + ((sprptr[2] & 0xc0) << 2) + ((sprptr[2] & 0x08) << 7); | |
| 338 | int flipx = (sprptr[2] & 0x10) >> 4; | |
| 339 | int flipy = (sprptr[2] & 0x20) >> 5; | |
| 340 | int const color = sprptr[4] & 0x0f; | |
| 341 | // Ninja Kid II doesn't use the 'big' feature so it might not be available on the board | |
| 342 | int const big = (sprptr[2] & 0x04) >> 2; | |
| 343 | int x,y; | |
| 94 | 344 | |
| 95 | if( | |
| 345 | if (fl | |
| 96 | 346 | { |
| 97 | /* "static" sprites */ | |
| 98 | drawgfx(bitmap_sp,machine->gfx[1], | |
| 99 | tile, | |
| 100 | color, | |
| 101 | flipx,flipy, | |
| 102 | sx,sy, | |
| 103 | cliprect, | |
| 104 | TRANSPARENCY_PEN, 15); | |
| 347 | sx = 240 - 16*big - sx; | |
| 348 | sy = 240 - 16*big - sy; | |
| 349 | flipx ^= 1; | |
| 350 | flipy ^= 1; | |
| 105 | 351 | } |
| 106 | else | |
| 352 | ||
| 353 | if (big) | |
| 107 | 354 | { |
| 108 | drawgfx(bitmap,machine->gfx[1], | |
| 109 | tile, | |
| 110 | color, | |
| 111 | flipx,flipy, | |
| 112 | sx,sy, | |
| 113 | cliprect, | |
| 114 | TRANSPARENCY_PEN, 15); | |
| 355 | code &= ~3; | |
| 356 | code ^= flipx << big_xshift; | |
| 357 | code ^= flipy << big_yshift; | |
| 358 | } | |
| 115 | 359 | |
| 116 | /* "normal" sprites with color = 0x0f clear the "static" ones */ | |
| 117 | if(sprite_overdraw_enabled && color == 0x0f) | |
| 360 | for (y = 0; y <= big; ++y) | |
| 361 | { | |
| 362 | for (x = 0; x <= big; ++x) | |
| 118 | 363 | { |
| 119 | int x,y,offset = 0; | |
| 120 | const gfx_element *gfx = machine->gfx[1]; | |
| 121 | UINT8 *srcgfx = gfx->gfxdata + tile * gfx->char_modulo; | |
| 364 | int const tile = code ^ (x << big_xshift) ^ (y << big_yshift); | |
| 122 | 365 | |
| 123 | for(y = 0; y < gfx->height; y++) | |
| 366 | // sprites with color = 0x0f erase pixels that use palettes C-F | |
| 367 | if (sprite_overdraw_enabled && color == 0x0f) | |
| 124 | 368 | { |
| 125 | for(x = 0; x < gfx->width; x++) | |
| 369 | const UINT8* const srcgfx = gfx->gfxdata + tile * gfx->char_modulo; | |
| 370 | int xx,yy; | |
| 371 | ||
| 372 | for (yy = 0; yy < 16; ++yy) | |
| 126 | 373 | { |
| 127 | | |
| 374 | | |
| 128 | 375 | { |
| 129 | *BITMAP_ADDR16(bitmap_sp, sy + y, sx + x) = 15; | |
| 376 | UINT16* const ptr = BITMAP_ADDR16(bitmap, sy + yy, sx + xx); | |
| 377 | int const offset = (flipx ? (16 - xx) : xx) + (flipy ? (16 - yy) : yy ) * gfx->line_modulo;; | |
| 378 | ||
| 379 | if (srcgfx[offset] != 15 && (*ptr & 0xf0) >= 0xc0) | |
| 380 | { | |
| 381 | *ptr = 15; | |
| 382 | } | |
| 130 | 383 | } |
| 131 | ||
| 132 | offset++; | |
| 133 | 384 | } |
| 134 | 385 | } |
| 386 | else | |
| 387 | { | |
| 388 | drawgfx(bitmap, gfx, | |
| 389 | tile, | |
| 390 | color, | |
| 391 | flipx,flipy, | |
| 392 | sx + 16*x, sy + 16*y, | |
| 393 | cliprect, | |
| 394 | TRANSPARENCY_PEN, 15); | |
| 395 | } | |
| 396 | ||
| 397 | ++sprites_drawn; | |
| 398 | if (sprites_drawn >= 96) | |
| 399 | return; | |
| 135 | 400 | } |
| 136 | 401 | } |
| 137 | 402 | } |
| 403 | else | |
| 404 | { | |
| 405 | ++sprites_drawn; | |
| 406 | if (sprites_drawn >= 96) | |
| 407 | return; | |
| 408 | } | |
| 409 | ||
| 410 | sprptr += 16; | |
| 138 | 411 | } |
| 412 | } | |
| 139 | 413 | |
| 140 | if(sprite_overdraw_enabled) | |
| 141 | copybitmap(bitmap, bitmap_sp, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15); | |
| 414 | ||
| 415 | static void erase_sprites(running_machine* const machine, mame_bitmap* const bitmap, const rectangle* const cliprect) | |
| 416 | { | |
| 417 | // if sprite overdraw is disabled, clear the sprite framebuffer | |
| 418 | // if sprite overdraw is enabled, only clear palettes 0-B, and leave C-F on screen | |
| 419 | if (!sprite_overdraw_enabled) | |
| 420 | fillbitmap(sp_bitmap, 15, cliprect); | |
| 421 | else | |
| 422 | { | |
| 423 | int x,y; | |
| 424 | ||
| 425 | for (y = 0; y < sp_bitmap->height; ++y) | |
| 426 | { | |
| 427 | for (x = 0; x < sp_bitmap->width; ++x) | |
| 428 | { | |
| 429 | UINT16* const ptr = BITMAP_ADDR16(sp_bitmap, y, x); | |
| 430 | if ((*ptr & 0xf0) < 0xc0) | |
| 431 | { | |
| 432 | *ptr = 15; | |
| 433 | } | |
| 434 | } | |
| 435 | } | |
| 436 | } | |
| 142 | 437 | } |
| 143 | 438 | |
| 439 | ||
| 144 | 440 | VIDEO_UPDATE( ninjakd2 ) |
| 145 | 441 | { |
| 146 | fillbitmap(bitmap, machine->pens[0], | |
| 442 | fillbitmap(bitmap, machine->pens[0], cliprect); | |
| 147 | 443 | |
| 148 | tilemap_set_scrollx(bg_tilemap, 0, ninjakd2_scrollx); | |
| 149 | tilemap_set_scrolly(bg_tilemap, 0, ninjakd2_scrolly); | |
| 444 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 150 | 445 | |
| 151 | if (ninjakd2_bg_enable) | |
| 152 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 446 | copybitmap(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15); | |
| 153 | 447 | |
| 154 | draw_sprites(machine, bitmap, cliprect); | |
| 155 | 448 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 156 | 449 | |
| 157 | 450 | return 0; |
| 158 | 451 | } |
| 452 | ||
| 453 | VIDEO_UPDATE( robokid ) | |
| 454 | { | |
| 455 | fillbitmap(bitmap, machine->pens[0], cliprect); | |
| 456 | ||
| 457 | tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); | |
| 458 | ||
| 459 | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); | |
| 460 | ||
| 461 | copybitmap(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15); | |
| 462 | ||
| 463 | tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0); | |
| 464 | ||
| 465 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 466 | ||
| 467 | return 0; | |
| 468 | } | |
| 469 | ||
| 470 | VIDEO_UPDATE( omegaf ) | |
| 471 | { | |
| 472 | fillbitmap(bitmap, machine->pens[0], cliprect); | |
| 473 | ||
| 474 | tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); | |
| 475 | ||
| 476 | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); | |
| 477 | ||
| 478 | tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0); | |
| 479 | ||
| 480 | copybitmap(bitmap, sp_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15); | |
| 481 | ||
| 482 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 483 | ||
| 484 | return 0; | |
| 485 | } | |
| 486 | ||
| 487 | ||
| 488 | VIDEO_EOF( ninjakd2 ) | |
| 489 | { | |
| 490 | erase_sprites(machine, sp_bitmap, 0); | |
| 491 | ||
| 492 | // we want to erase the sprites with the old setting and draw them with the | |
| 493 | // new one. Not doing this causes a glitch in Ninja Kid II when taking the top | |
| 494 | // exit from stage 3. | |
| 495 | sprite_overdraw_enabled = next_sprite_overdraw_enabled; | |
| 496 | ||
| 497 | draw_sprites(machine, sp_bitmap, 0); | |
| 498 | } |
| r1591 | r1592 | |
|---|---|---|
| 324 | 324 | static void update_cpu_irq(void) |
| 325 | 325 | { |
| 326 | 326 | if (cpu_irq_state & gpu_regs[INT1] & 0x1f) |
| 327 | cpunum_set_input_line(0, cojag_is_r3000 ? R3000_IRQ4 : MC68000_IRQ_6, ASSERT_LINE); | |
| 327 | cpunum_set_input_line(Machine, 0, cojag_is_r3000 ? R3000_IRQ4 : MC68000_IRQ_6, ASSERT_LINE); | |
| 328 | 328 | else |
| 329 | cpunum_set_input_line(0, cojag_is_r3000 ? R3000_IRQ4 : MC68000_IRQ_6, CLEAR_LINE); | |
| 329 | cpunum_set_input_line(Machine, 0, cojag_is_r3000 ? R3000_IRQ4 : MC68000_IRQ_6, CLEAR_LINE); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 |
| r1591 | r1592 | |
|---|---|---|
| 262 | 262 | if ( adder2_c101 & 0x01 ) |
| 263 | 263 | { |
| 264 | 264 | adder_vbl_triggered = 1; |
| 265 | cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE ); | |
| 265 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE ); | |
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 |
| r1591 | r1592 | |
|---|---|---|
| 46 | 46 | { |
| 47 | 47 | int i; |
| 48 | 48 | |
| 49 | | |
| 49 | PALETTE_INIT_CALL(n8080 | |
| 50 | 50 | |
| 51 | 51 | for (i = 0; i < 0x100; i++) |
| 52 | 52 | { |
| r1591 | r1592 | |
|---|---|---|
| 99 | 99 | /* Todo */ |
| 100 | 100 | break; |
| 101 | 101 | case 8: /* Irq ack */ |
| 102 | cpunum_set_input_line(0,DECO16_IRQ_LINE,CLEAR_LINE); | |
| 102 | cpunum_set_input_line(Machine, 0,DECO16_IRQ_LINE,CLEAR_LINE); | |
| 103 | 103 | break; |
| 104 | 104 | case 9: /* Sound */ |
| 105 | 105 | soundlatch_w(0,data); |
| 106 | cpunum_set_input_line(1,M6502_IRQ_LINE,HOLD_LINE); | |
| 106 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 107 | 107 | break; |
| 108 | 108 | } |
| 109 | 109 | } |
| r1591 | r1592 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | if (iloop > 1 && iloop < 32) |
| 99 | 99 | { |
| 100 | cpunum_set_input_line(0, M6502_IRQ_LINE, HOLD_LINE); | |
| 100 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, HOLD_LINE); | |
| 101 | 101 | video_screen_update_partial(0, scanline+7); |
| 102 | 102 | } |
| 103 | 103 | else if (!iloop) |
| 104 | 104 | { |
| 105 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 105 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 106 | 106 | video_screen_update_partial(0, 256); |
| 107 | 107 | } |
| 108 | 108 | } |
| r1591 | r1592 | |
|---|---|---|
| 537 | 537 | |
| 538 | 538 | VIDEO_START( oisipuzl_2_layers ) |
| 539 | 539 | { |
| 540 | | |
| 540 | VIDEO_START_CALL(seta_2_layers | |
| 541 | 541 | tilemaps_flip = 1; |
| 542 | 542 | } |
| 543 | 543 |
| r1591 | r1592 | |
|---|---|---|
| 183 | 183 | { |
| 184 | 184 | int line = 31 - cpu_getiloops(); |
| 185 | 185 | if (line < 13) |
| 186 | cpunum_set_input_line(0, M6502_IRQ_LINE, HOLD_LINE); | |
| 186 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, HOLD_LINE); | |
| 187 | 187 | else if (line == 13) |
| 188 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 188 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 189 | 189 | //save the scroll x register value |
| 190 | 190 | if(line<32) scrollx[31-line] = (vb_scrollx_hi + vb_scrollx_lo+4); |
| 191 | 191 | } |
| r1591 | r1592 | |
|---|---|---|
| 94 | 94 | else |
| 95 | 95 | { |
| 96 | 96 | if (data & 0x100) |
| 97 | { | |
| 98 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0xff); | |
| 99 | } | |
| 97 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff); | |
| 100 | 98 | } |
| 101 | 99 | } |
| 102 | 100 |
| r1591 | r1592 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | coin_counter_w(0,data & 0x01); |
| 187 | 187 | |
| 188 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); | |
| 188 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); | |
| 189 | 189 | |
| 190 | 190 | flip_screen_set(data & 0x80); |
| 191 | 191 | } |
| r1591 | r1592 | |
|---|---|---|
| 331 | 331 | min_x =machine->screen[0].visarea.min_x; |
| 332 | 332 | min_y =machine->screen[0].visarea.min_y; |
| 333 | 333 | |
| 334 | | |
| 334 | VIDEO_START_CALL(vector | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | |
| 338 | 338 | VIDEO_UPDATE( sega ) |
| 339 | 339 | { |
| 340 | 340 | sega_generate_vector_list(); |
| 341 | | |
| 341 | VIDEO_UPDATE_CALL(vector | |
| 342 | 342 | return 0; |
| 343 | 343 | } |
| r1591 | r1592 | |
|---|---|---|
| 395 | 395 | /* If raster interrupt occurs, refresh screen _up_ to this point */ |
| 396 | 396 | if (rcr_enable && (current_scanline+56)==HuC6270_registers[6]) { |
| 397 | 397 | video_screen_update_partial(0, current_scanline); |
| 398 | cpunum_set_input_line(0, 0, HOLD_LINE); /* RCR interrupt */ | |
| 398 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); /* RCR interrupt */ | |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /* Start of vblank */ |
| r1591 | r1592 | |
| 403 | 403 | bldwolf_vblank=1; |
| 404 | 404 | video_screen_update_partial(0, 240); |
| 405 | 405 | if (irq_enable) |
| 406 | cpunum_set_input_line(0, 0, HOLD_LINE); /* VBL */ | |
| 406 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); /* VBL */ | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /* End of vblank */ |
| r1591 | r1592 | |
|---|---|---|
| 59 | 59 | const int pull = 200; |
| 60 | 60 | float pot[16]; |
| 61 | 61 | int weight[16]; |
| 62 | const float potadjust = 0.2; /* diode voltage drop */ | |
| 62 | const float potadjust = 0.2f; /* diode voltage drop */ | |
| 63 | 63 | |
| 64 | 64 | for (i = 15;i >= 0;i--) |
| 65 | 65 | { |
| r1591 | r1592 | |
|---|---|---|
| 426 | 426 | |
| 427 | 427 | static TIMER_CALLBACK( interrupt_off ) |
| 428 | 428 | { |
| 429 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 429 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | |
| 433 | void astrocade_trigger_lightpen(UINT8 vfeedback, UINT8 hfeedback) | |
| 433 | static void astrocade_trigger_lightpen(running_machine *machine, UINT8 vfeedback, UINT8 hfeedback) | |
| 434 | 434 | { |
| 435 | 435 | /* both bits 1 and 4 enable lightpen interrupts; bit 4 enables them even in horizontal */ |
| 436 | 436 | /* blanking regions; we treat them both the same here */ |
| r1591 | r1592 | |
| 438 | 438 | { |
| 439 | 439 | /* bit 0 controls the interrupt mode: mode 0 means assert until acknowledged */ |
| 440 | 440 | if ((interrupt_enable & 0x01) == 0) |
| 441 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, interrupt_vector & 0xf0); | |
| 441 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, interrupt_vector & 0xf0); | |
| 442 | 442 | |
| 443 | 443 | /* mode 1 means assert for 1 instruction */ |
| 444 | 444 | else |
| 445 | 445 | { |
| 446 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, interrupt_vector & 0xf0); | |
| 446 | cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, interrupt_vector & 0xf0); | |
| 447 | 447 | timer_set(ATTOTIME_IN_CYCLES(1, 0), NULL, 0, interrupt_off); |
| 448 | 448 | } |
| 449 | 449 | |
| r1591 | r1592 | |
| 474 | 474 | { |
| 475 | 475 | /* bit 2 controls the interrupt mode: mode 0 means assert until acknowledged */ |
| 476 | 476 | if ((interrupt_enable & 0x04) == 0) |
| 477 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, interrupt_vector); | |
| 477 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, interrupt_vector); | |
| 478 | 478 | |
| 479 | 479 | /* mode 1 means assert for 1 instruction */ |
| 480 | 480 | else |
| 481 | 481 | { |
| 482 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, interrupt_vector); | |
| 482 | cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, interrupt_vector); | |
| 483 | 483 | timer_set(ATTOTIME_IN_CYCLES(1, 0), NULL, 0, interrupt_off); |
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | /* on some games, the horizontal drive line is conected to the lightpen interrupt */ |
| 488 | 488 | else if (astrocade_video_config & AC_LIGHTPEN_INTS) |
| 489 | astrocade_trigger_lightpen(astrocade_scanline, 8); | |
| 489 | astrocade_trigger_lightpen(machine, astrocade_scanline, 8); | |
| 490 | 490 | |
| 491 | 491 | /* advance to the next scanline */ |
| 492 | 492 | scanline++; |
| r1591 | r1592 | |
|---|---|---|
| 95 | 95 | { |
| 96 | 96 | int color, pen; |
| 97 | 97 | |
| 98 | | |
| 98 | PALETTE_INIT_CALL(lasso | |
| 99 | 99 | |
| 100 | 100 | for( color = 0; color < 0x10; color++ ) |
| 101 | 101 | for( pen = 0; pen < 0x10; pen++ ) |
| r1591 | r1592 | |
|---|---|---|
| 713 | 713 | { |
| 714 | 714 | int x, y, b; |
| 715 | 715 | |
| 716 | if(screen==0) | |
| 716 | if(screen==0) VIDEO_UPDATE_CALL(mbmj8688 | |
| 717 | 717 | |
| 718 | 718 | if (screen==1) |
| 719 | 719 | { |
| r1591 | r1592 | |
|---|---|---|
| 181 | 181 | break; |
| 182 | 182 | case 7: |
| 183 | 183 | soundlatch_w(0,data); |
| 184 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 184 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 185 | 185 | break; |
| 186 | 186 | default: |
| 187 | 187 | logerror("CPU #0 PC %06X : Warning, videoreg %04X <- %04X\n",activecpu_get_pc(),offset,data); |
| r1591 | r1592 | |
|---|---|---|
| 126 | 126 | effect_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 127 | 127 | background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 128 | 128 | |
| 129 | | |
| 129 | VIDEO_START_CALL(cvs | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | VIDEO_UPDATE( quasar ) |
| r1591 | r1592 | |
|---|---|---|
| 66 | 66 | { |
| 67 | 67 | taito_hide_pixels = 3; |
| 68 | 68 | taito_sprite_type = 2; |
| 69 | | |
| 69 | VIDEO_START_CALL(slapshot_cor | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 |
| r1591 | r1592 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | static void ppu_irq( int num, int *ppu_regs ) |
| 20 | 20 | { |
| 21 | cpunum_set_input_line(num, INPUT_LINE_NMI, PULSE_LINE ); | |
| 21 | cpunum_set_input_line(Machine, num, INPUT_LINE_NMI, PULSE_LINE ); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /* our ppu interface */ |
| r1591 | r1592 | |
|---|---|---|
| 103 | 103 | static void victory_update_irq(void) |
| 104 | 104 | { |
| 105 | 105 | if (vblank_irq || fgcoll || (bgcoll && (video_control & 0x20))) |
| 106 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 106 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 107 | 107 | else |
| 108 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 108 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 |
| r1591 | r1592 | |
|---|---|---|
| 52 | 52 | /* bit 4 resets the sound CPU */ |
| 53 | 53 | if (data & 0x10) |
| 54 | 54 | { |
| 55 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 55 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /* bit 5 enables starfield */ |
| r1591 | r1592 | |
|---|---|---|
| 1466 | 1466 | vg->ydac_xor = 0x200; |
| 1467 | 1467 | |
| 1468 | 1468 | register_state (); |
| 1469 | | |
| 1469 | VIDEO_START_CALL(vector | |
| 1470 | 1470 | } |
| 1471 | 1471 | |
| 1472 | 1472 | VIDEO_START( dvg ) |
| r1591 | r1592 | |
| 1481 | 1481 | vg_run_timer = timer_alloc(run_state_machine, NULL); |
| 1482 | 1482 | |
| 1483 | 1483 | register_state (); |
| 1484 | | |
| 1484 | VIDEO_START_CALL(vector | |
| 1485 | 1485 | } |
| 1486 | 1486 | |
| 1487 | 1487 | VIDEO_START( avg ) |
| 1488 | 1488 | { |
| 1489 | 1489 | vgc = &avg_default; |
| 1490 | 1490 | vg = &vgd; |
| 1491 | | |
| 1491 | VIDEO_START_CALL(avg_common | |
| 1492 | 1492 | } |
| 1493 | 1493 | |
| 1494 | 1494 | VIDEO_START( avg_starwars ) |
| 1495 | 1495 | { |
| 1496 | 1496 | vgc = &avg_starwars; |
| 1497 | 1497 | vg = &vgd; |
| 1498 | | |
| 1498 | VIDEO_START_CALL(avg_common | |
| 1499 | 1499 | } |
| 1500 | 1500 | |
| 1501 | 1501 | VIDEO_START( avg_tempest ) |
| 1502 | 1502 | { |
| 1503 | 1503 | vgc = &avg_tempest; |
| 1504 | 1504 | vg = &vgd; |
| 1505 | | |
| 1505 | VIDEO_START_CALL(avg_common | |
| 1506 | 1506 | } |
| 1507 | 1507 | |
| 1508 | 1508 | VIDEO_START( avg_mhavoc ) |
| 1509 | 1509 | { |
| 1510 | 1510 | vgc = &avg_mhavoc; |
| 1511 | 1511 | vg = &vgd; |
| 1512 | | |
| 1512 | VIDEO_START_CALL(avg_common | |
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | VIDEO_START( avg_bzone ) |
| 1516 | 1516 | { |
| 1517 | 1517 | vgc = &avg_bzone; |
| 1518 | 1518 | vg = &vgd; |
| 1519 | | |
| 1519 | VIDEO_START_CALL(avg_common | |
| 1520 | 1520 | } |
| 1521 | 1521 | |
| 1522 | 1522 | VIDEO_START( avg_quantum ) |
| 1523 | 1523 | { |
| 1524 | 1524 | vgc = &avg_quantum; |
| 1525 | 1525 | vg = &vgd; |
| 1526 | | |
| 1526 | VIDEO_START_CALL(avg_common | |
| 1527 | 1527 | } |
| 1528 | 1528 |
| r1591 | r1592 | |
|---|---|---|
| 91 | 91 | draw_bombs(bitmap, cliprect); |
| 92 | 92 | |
| 93 | 93 | /* watchdog is disabled during service mode */ |
| 94 | watchdog_enable(!(readinputport(2) & 0x10)); | |
| 94 | watchdog_enable(machine, !(readinputport(2) & 0x10)); | |
| 95 | 95 | |
| 96 | 96 | return 0; |
| 97 | 97 | } |
| r1591 | r1592 | |
|---|---|---|
| 223 | 223 | static void exidy440_update_firq(void) |
| 224 | 224 | { |
| 225 | 225 | if (exidy440_firq_vblank || (firq_enable && exidy440_firq_beam)) |
| 226 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 226 | cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE); | |
| 227 | 227 | else |
| 228 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 228 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 |
| r1591 | r1592 | |
|---|---|---|
| 1532 | 1532 | } |
| 1533 | 1533 | case 0xe0: |
| 1534 | 1534 | { |
| 1535 | cpunum_set_input_line(1, INPUT_LINE_TEST, CLEAR_LINE); | |
| 1535 | cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, CLEAR_LINE); | |
| 1536 | 1536 | vregs.flags = data; |
| 1537 | 1537 | break; |
| 1538 | 1538 | } |
| r1591 | r1592 | |
|---|---|---|
| 91 | 91 | xcenter=((xmax + xmin) / 2) << 16; |
| 92 | 92 | ycenter=((ymax + ymin) / 2) << 16; |
| 93 | 93 | |
| 94 | | |
| 94 | VIDEO_START_CALL(vector | |
| 95 | 95 | } |
| r1591 | r1592 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | VIDEO_START( poundfor ) |
| 175 | 175 | { |
| 176 | | |
| 176 | VIDEO_START_CALL(rtype2 | |
| 177 | 177 | |
| 178 | 178 | tilemap_set_scrolldx(fg_tilemap,6,0); |
| 179 | 179 | tilemap_set_scrolldx(bg_tilemap,6,0); |
| r1591 | r1592 | |
| 352 | 352 | |
| 353 | 353 | /* bit 4 resets sound CPU (active low) */ |
| 354 | 354 | if (data & 0x10) |
| 355 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 355 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 356 | 356 | else |
| 357 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 357 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 358 | 358 | |
| 359 | 359 | /* bit 5 = "bank"? */ |
| 360 | 360 | } |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | { |
| 82 | 82 | mario_state *state = Machine->driver_data; |
| 83 | 83 | |
| 84 | videoram[offset] = data; | |
| 84 | state->videoram[offset] = data; | |
| 85 | 85 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); |
| 86 | 86 | } |
| 87 | 87 | |
| r1591 | r1592 | |
| 116 | 116 | |
| 117 | 117 | WRITE8_HANDLER( mario_flip_w ) |
| 118 | 118 | { |
| 119 | flip_screen_set(data & 0x01); | |
| 119 | mario_state *state = Machine->driver_data; | |
| 120 | ||
| 121 | if (state->flip != (data & 0x01)) | |
| 122 | { | |
| 123 | state->flip = data & 0x01; | |
| 124 | if (state->flip) | |
| 125 | tilemap_set_flip(ALL_TILEMAPS, TILEMAP_FLIPX | TILEMAP_FLIPY); | |
| 126 | else | |
| 127 | tilemap_set_flip(ALL_TILEMAPS, 0); | |
| 128 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 129 | } | |
| 120 | 130 | } |
| 121 | 131 | |
| 122 | 132 | static TILE_GET_INFO( get_bg_tile_info ) |
| 123 | 133 | { |
| 124 | 134 | mario_state *state = Machine->driver_data; |
| 125 | int code = videoram[tile_index] + 256 * state->gfx_bank; | |
| 135 | int code = state->videoram[tile_index] + 256 * state->gfx_bank; | |
| 126 | 136 | int color; |
| 127 | 137 | |
| 128 | color = ((videoram[tile_index] >> 2) & 0x38) | 0x40 | (state->palette_bank<<7) | (state->monitor<<8); | |
| 138 | color = ((state->videoram[tile_index] >> 2) & 0x38) | 0x40 | (state->palette_bank<<7) | (state->monitor<<8); | |
| 129 | 139 | color = color >> 2; |
| 130 | 140 | SET_TILE_INFO(0, code, color, 0); |
| 131 | 141 | } |
| r1591 | r1592 | |
| 143 | 153 | state_save_register_global(state->gfx_bank); |
| 144 | 154 | state_save_register_global(state->palette_bank); |
| 145 | 155 | state_save_register_global(state->gfx_scroll); |
| 146 | state_save_register_global(flip | |
| 156 | state_save_register_global(state->flip | |
| 147 | 157 | } |
| 148 | 158 | |
| 149 | 159 | /* |
| r1591 | r1592 | |
| 156 | 166 | mario_state *state = Machine->driver_data; |
| 157 | 167 | int offs; |
| 158 | 168 | |
| 159 | for (offs = 0;offs < spriteram_size;offs += 4) | |
| 169 | for (offs = 0;offs < state->spriteram_size;offs += 4) | |
| 160 | 170 | { |
| 161 | if (spriteram[offs]) | |
| 171 | if (state->spriteram[offs]) | |
| 162 | 172 | { |
| 163 | 173 | int x, y; |
| 164 | 174 | |
| 165 | 175 | // from schematics .... |
| 166 | y = (spriteram[offs] + (flip_screen ? 0xF7 : 0xF9) + 1) & 0xFF; | |
| 167 | x = spriteram[offs+3]; | |
| 176 | y = (state->spriteram[offs] + (state->flip ? 0xF7 : 0xF9) + 1) & 0xFF; | |
| 177 | x = state->spriteram[offs+3]; | |
| 168 | 178 | // sprite will be drawn if (y + scanline) & 0xF0 = 0xF0 |
| 169 | 179 | y = 240 - y; /* logical screen position */ |
| 170 | 180 | |
| 171 | y = y ^ (flip_screen ? 0xFF : 0x00); /* physical screen location */ | |
| 172 | x = x ^ (flip_screen ? 0xFF : 0x00); /* physical screen location */ | |
| 181 | y = y ^ (state->flip ? 0xFF : 0x00); /* physical screen location */ | |
| 182 | x = x ^ (state->flip ? 0xFF : 0x00); /* physical screen location */ | |
| 173 | 183 | |
| 174 | if (flip | |
| 184 | if (state->flip | |
| 175 | 185 | { |
| 176 | y -= | |
| 186 | y -= 14; | |
| 177 | 187 | x -= 7; |
| 178 | 188 | drawgfx(bitmap,machine->gfx[1], |
| 179 | spriteram[offs + 2], | |
| 180 | (spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor, | |
| 181 | !(spriteram[offs + 1] & 0x80),!(spriteram[offs + 1] & 0x40), | |
| 189 | state->spriteram[offs + 2], | |
| 190 | (state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor, | |
| 191 | !(state->spriteram[offs + 1] & 0x80),!(state->spriteram[offs + 1] & 0x40), | |
| 182 | 192 | x, y, |
| 183 | 193 | cliprect,TRANSPARENCY_PEN,0); |
| 184 | 194 | } |
| r1591 | r1592 | |
| 187 | 197 | y += 1; |
| 188 | 198 | x -= 8; |
| 189 | 199 | drawgfx(bitmap,machine->gfx[1], |
| 190 | spriteram[offs + 2], | |
| 191 | (spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor, | |
| 192 | (spriteram[offs + 1] & 0x80),(spriteram[offs + 1] & 0x40), | |
| 200 | state->spriteram[offs + 2], | |
| 201 | (state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor, | |
| 202 | (state->spriteram[offs + 1] & 0x80),(state->spriteram[offs + 1] & 0x40), | |
| 193 | 203 | x, y, |
| 194 | 204 | cliprect,TRANSPARENCY_PEN,0); |
| 195 | 205 | } |
| r1591 | r1592 | |
| 208 | 218 | state->monitor = t; |
| 209 | 219 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 210 | 220 | } |
| 211 | tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen ? (HTOTAL-HBSTART) : 0); | |
| 212 | tilemap_set_scrolly(state->bg_tilemap, 0, state->gfx_scroll); | |
| 221 | ||
| 222 | tilemap_set_scrollx(state->bg_tilemap, 0, state->flip ? (HTOTAL-HBSTART) : 0); | |
| 223 | tilemap_set_scrolly(state->bg_tilemap, 0, state->gfx_scroll - (state->flip ? 8 : 0)); | |
| 224 | ||
| 213 | 225 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); |
| 214 | 226 | draw_sprites(machine, bitmap, cliprect); |
| 227 | ||
| 215 | 228 | return 0; |
| 216 | 229 | } |
| r1591 | r1592 | |
|---|---|---|
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "atarifb.h" | |
| 9 | #include "ui.h" | |
| 10 | 8 | |
| 9 | ||
| 11 | 10 | /* local */ |
| 12 | size_t atarifb_alphap1_vram_size; | |
| 13 | size_t atarifb_alphap2_vram_size; | |
| 14 | UINT8 *atarifb_alphap1_vram; | |
| 15 | UINT8 *atarifb_alphap2_vram; | |
| 11 | UINT8 *atarifb_alphap1_videoram; | |
| 12 | UINT8 *atarifb_alphap2_videoram; | |
| 13 | UINT8 *atarifb_field_videoram; | |
| 16 | 14 | UINT8 *atarifb_scroll_register; |
| 17 | 15 | |
| 16 | static tilemap *alpha1_tilemap; | |
| 17 | static tilemap *alpha2_tilemap; | |
| 18 | static tilemap *field_tilemap; | |
| 18 | 19 | |
| 19 | static const rectangle bigfield_area = { 4*8, 34*8-1, 0*8, 32*8-1 }; | |
| 20 | static const rectangle left_area = { 0*8, 3*8-1, 0*8, 32*8-1 }; | |
| 21 | static const rectangle right_area = { 34*8, 38*8-1, 0*8, 32*8-1 }; | |
| 22 | 20 | |
| 23 | 21 | |
| 24 | VIDEO_UPDATE( atarifb ) | |
| 22 | /************************************* | |
| 23 | * | |
| 24 | * Tilemap callbacks | |
| 25 | * | |
| 26 | *************************************/ | |
| 27 | ||
| 28 | static void get_tile_info_common(running_machine *machine, tile_data *tileinfo, | |
| 29 | tilemap_memory_index tile_index, UINT8 *alpha_videoram) | |
| 25 | 30 | { |
| 26 | int offs,obj; | |
| 27 | int sprite_bank; | |
| 31 | int code = alpha_videoram[tile_index] & 0x3f; | |
| 32 | int flip = alpha_videoram[tile_index] & 0x40; | |
| 33 | int disable = alpha_videoram[tile_index] & 0x80; | |
| 28 | 34 | |
| 29 | /* Soccer uses a different graphics set for sprites */ | |
| 30 | if (atarifb_game == 4) | |
| 31 | sprite_bank = 2; | |
| 32 | else | |
| 33 | sprite_bank = 1; | |
| 35 | if (disable) | |
| 36 | code = 0; /* I *know* this is a space */ | |
| 34 | 37 | |
| 35 | for (offs = atarifb_alphap1_vram_size - 1;offs >= 0;offs--) | |
| 36 | { | |
| 37 | int charcode; | |
| 38 | int flipbit; | |
| 39 | int disable; | |
| 40 | int sx,sy; | |
| 38 | SET_TILE_INFO(0, code, 0, (flip ? TILE_FLIPX | TILE_FLIPY : 0)); | |
| 39 | } | |
| 41 | 40 | |
| 42 | sx = 8 * (offs / 32) + 35*8; | |
| 43 | sy = 8 * (offs % 32) + 8; | |
| 44 | 41 | |
| 45 | charcode = atarifb_alphap1_vram[offs] & 0x3f; | |
| 46 | flipbit = (atarifb_alphap1_vram[offs] & 0x40) >> 6; | |
| 47 | disable = (atarifb_alphap1_vram[offs] & 0x80) >> 7; | |
| 42 | static TILE_GET_INFO( alpha1_get_tile_info ) | |
| 43 | { | |
| 44 | get_tile_info_common(machine, tileinfo, tile_index, atarifb_alphap1_videoram); | |
| 45 | } | |
| 48 | 46 | |
| 49 | if (!disable) | |
| 50 | { | |
| 51 | drawgfx(bitmap,machine->gfx[0], | |
| 52 | charcode, 0, | |
| 53 | flipbit,flipbit,sx,sy, | |
| 54 | &right_area,TRANSPARENCY_NONE,0); | |
| 55 | } | |
| 56 | } | |
| 57 | 47 | |
| 58 | for (offs = atarifb_alphap2_vram_size - 1;offs >= 0;offs--) | |
| 59 | { | |
| 60 | int charcode; | |
| 61 | int flipbit; | |
| 62 | int disable; | |
| 63 | int sx,sy; | |
| 48 | static TILE_GET_INFO( alpha2_get_tile_info ) | |
| 49 | { | |
| 50 | get_tile_info_common(machine, tileinfo, tile_index, atarifb_alphap2_videoram); | |
| 51 | } | |
| 64 | 52 | |
| 65 | sx = 8 * (offs / 32); | |
| 66 | sy = 8 * (offs % 32) + 8; | |
| 67 | 53 | |
| 68 | charcode = atarifb_alphap2_vram[offs] & 0x3f; | |
| 69 | flipbit = (atarifb_alphap2_vram[offs] & 0x40) >> 6; | |
| 70 | disable = (atarifb_alphap2_vram[offs] & 0x80) >> 7; | |
| 54 | static TILE_GET_INFO( field_get_tile_info ) | |
| 55 | { | |
| 56 | int code = atarifb_field_videoram[tile_index] & 0x3f; | |
| 57 | int flipyx = atarifb_field_videoram[tile_index] >> 6; | |
| 71 | 58 | |
| 72 | if (!disable) | |
| 73 | { | |
| 74 | drawgfx(bitmap,machine->gfx[0], | |
| 75 | charcode, 0, | |
| 76 | flipbit,flipbit,sx,sy, | |
| 77 | &left_area,TRANSPARENCY_NONE,0); | |
| 78 | } | |
| 79 | } | |
| 59 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX(flipyx)); | |
| 60 | } | |
| 80 | 61 | |
| 81 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 82 | { | |
| 83 | int charcode; | |
| 84 | int flipx,flipy; | |
| 85 | int sx,sy; | |
| 86 | 62 | |
| 87 | charcode = videoram[offs] & 0x3f; | |
| 88 | flipx = (videoram[offs] & 0x40) >> 6; | |
| 89 | flipy = (videoram[offs] & 0x80) >> 7; | |
| 90 | 63 | |
| 91 | sx = 8 * (offs % 32) - *atarifb_scroll_register + 8; | |
| 92 | sy = 8 * (offs / 32) + 8; | |
| 93 | 64 | |
| 94 | /* Soccer hack */ | |
| 95 | if (atarifb_game == 4) | |
| 96 | { | |
| 97 | sy += 8; | |
| 98 | } | |
| 65 | /************************************* | |
| 66 | * | |
| 67 | * Video RAM writes | |
| 68 | * | |
| 69 | *************************************/ | |
| 99 | 70 | |
| 100 | /* Baseball hack */ | |
| 101 | if (atarifb_game == 0x03) sx -= 8; | |
| 71 | WRITE8_HANDLER( atarifb_alpha1_videoram_w ) | |
| 72 | { | |
| 73 | atarifb_alphap1_videoram[offset] = data; | |
| 74 | tilemap_mark_tile_dirty(alpha1_tilemap, offset); | |
| 75 | } | |
| 102 | 76 | |
| 103 | if (sx < 0) sx += 256; | |
| 104 | if (sx > 255) sx -= 256; | |
| 105 | 77 | |
| 106 | drawgfx(tmpbitmap,machine->gfx[1], | |
| 107 | charcode, 0, | |
| 108 | flipx,flipy,sx,sy, | |
| 109 | 0,TRANSPARENCY_NONE,0); | |
| 110 | } | |
| 78 | WRITE8_HANDLER( atarifb_alpha2_videoram_w ) | |
| 79 | { | |
| 80 | atarifb_alphap2_videoram[offset] = data; | |
| 81 | tilemap_mark_tile_dirty(alpha2_tilemap, offset); | |
| 82 | } | |
| 111 | 83 | |
| 112 | /* copy the character mapped graphics */ | |
| 113 | copybitmap(bitmap,tmpbitmap,0,0,8*3,0,&bigfield_area,TRANSPARENCY_NONE,0); | |
| 114 | 84 | |
| 115 | /* Draw our motion objects */ | |
| 85 | WRITE8_HANDLER( atarifb_field_videoram_w ) | |
| 86 | { | |
| 87 | atarifb_field_videoram[offset] = data; | |
| 88 | tilemap_mark_tile_dirty(field_tilemap, offset); | |
| 89 | } | |
| 90 | ||
| 91 | ||
| 92 | ||
| 93 | /************************************* | |
| 94 | * | |
| 95 | * Video system start | |
| 96 | * | |
| 97 | *************************************/ | |
| 98 | ||
| 99 | VIDEO_START( atarifb ) | |
| 100 | { | |
| 101 | alpha1_tilemap = tilemap_create(alpha1_get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 3,32); | |
| 102 | alpha2_tilemap = tilemap_create(alpha2_get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 3,32); | |
| 103 | field_tilemap = tilemap_create(field_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32); | |
| 104 | } | |
| 105 | ||
| 106 | ||
| 107 | ||
| 108 | static void draw_playfield_and_alpha(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, | |
| 109 | int playfield_x_offset, int playfield_y_offset) | |
| 110 | { | |
| 111 | static const rectangle bigfield_area = { 4*8, 34*8-1, 0*8, 32*8-1 }; | |
| 112 | ||
| 113 | int scroll_x[1]; | |
| 114 | int scroll_y[1]; | |
| 115 | ||
| 116 | scroll_x[0] = - *atarifb_scroll_register + 32 + playfield_x_offset; | |
| 117 | scroll_y[0] = 8 + playfield_y_offset; | |
| 118 | ||
| 119 | copybitmap(bitmap, tilemap_get_pixmap(alpha1_tilemap), 0, 0, 35*8, 1*8, NULL, TRANSPARENCY_NONE, 0); | |
| 120 | copybitmap(bitmap, tilemap_get_pixmap(alpha2_tilemap), 0, 0, 0*8, 1*8, NULL, TRANSPARENCY_NONE, 0); | |
| 121 | copyscrollbitmap(bitmap, tilemap_get_pixmap(field_tilemap), 1, scroll_x, 1, scroll_y, &bigfield_area, TRANSPARENCY_NONE, 0); | |
| 122 | } | |
| 123 | ||
| 124 | ||
| 125 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, | |
| 126 | int gfx, int is_soccer) | |
| 127 | { | |
| 128 | static const rectangle bigfield_area = { 4*8, 34*8-1, 0*8, 32*8-1 }; | |
| 129 | ||
| 130 | int obj; | |
| 131 | ||
| 116 | 132 | for (obj=0;obj<16;obj++) |
| 117 | 133 | { |
| 118 | 134 | int charcode; |
| r1591 | r1592 | |
| 132 | 148 | /* There are 3 sets of 2 bits each, where the 2 bits represent */ |
| 133 | 149 | /* black, dk grey, grey and white. I think the 3 sets determine the */ |
| 134 | 150 | /* color of each bit in the sprite, but I haven't implemented it that way. */ |
| 135 | if ( | |
| 151 | if ( | |
| 136 | 152 | { |
| 137 | 153 | shade = ((spriteram[obj*2+1 + 0x20]) & 0x07); |
| 138 | 154 | |
| 139 | drawgfx(bitmap,machine->gfx[ | |
| 155 | drawgfx(bitmap,machine->gfx[gfx | |
| 140 | 156 | charcode, shade, |
| 141 | 157 | flipx,flipy,sx,sy, |
| 142 | 158 | &bigfield_area,TRANSPARENCY_PEN,0); |
| r1591 | r1592 | |
| 144 | 160 | shade = ((spriteram[obj*2+1 + 0x20]) & 0x08) >> 3; |
| 145 | 161 | } |
| 146 | 162 | |
| 147 | drawgfx(bitmap,machine->gfx[ | |
| 163 | drawgfx(bitmap,machine->gfx[gfx | |
| 148 | 164 | charcode, shade, |
| 149 | 165 | flipx,flipy,sx,sy, |
| 150 | 166 | &bigfield_area,TRANSPARENCY_PEN,0); |
| 151 | 167 | |
| 152 | 168 | /* If this isn't soccer, handle the multiplexed sprites */ |
| 153 | if ( | |
| 169 | if (! | |
| 154 | 170 | { |
| 155 | 171 | /* The down markers are multiplexed by altering the y location during */ |
| 156 | 172 | /* mid-screen. We'll fake it by essentially doing the same thing here. */ |
| 157 | 173 | if ((charcode == 0x11) && (sy == 0x07)) |
| 158 | 174 | { |
| 159 | 175 | sy = 0xf1; /* When multiplexed, it's 0x10...why? */ |
| 160 | drawgfx(bitmap,machine->gfx[ | |
| 176 | drawgfx(bitmap,machine->gfx[gfx | |
| 161 | 177 | charcode, 0, |
| 162 | 178 | flipx,flipy,sx,sy, |
| 163 | 179 | &bigfield_area,TRANSPARENCY_PEN,0); |
| 164 | 180 | } |
| 165 | 181 | } |
| 166 | 182 | } |
| 183 | } | |
| 167 | 184 | |
| 185 | ||
| 186 | VIDEO_UPDATE( atarifb ) | |
| 187 | { | |
| 188 | draw_playfield_and_alpha(machine, bitmap, cliprect, 0, 0); | |
| 189 | ||
| 190 | draw_sprites(machine, bitmap, cliprect, 1, 0); | |
| 191 | ||
| 168 | 192 | return 0; |
| 169 | 193 | } |
| 194 | ||
| 195 | ||
| 196 | VIDEO_UPDATE( abaseb ) | |
| 197 | { | |
| 198 | draw_playfield_and_alpha(machine, bitmap, cliprect, -8, 0); | |
| 199 | ||
| 200 | draw_sprites(machine, bitmap, cliprect, 1, 0); | |
| 201 | ||
| 202 | return 0; | |
| 203 | } | |
| 204 | ||
| 205 | ||
| 206 | VIDEO_UPDATE( soccer ) | |
| 207 | { | |
| 208 | draw_playfield_and_alpha(machine, bitmap, cliprect, 0, 8); | |
| 209 | ||
| 210 | draw_sprites(machine, bitmap, cliprect, 2, 1); | |
| 211 | ||
| 212 | return 0; | |
| 213 | } |
| r1591 | r1592 | |
|---|---|---|
| 125 | 125 | abilityflag = (oldstate == 5 || (RAM[ intstate1 ] == 1 && RAM[ intstate2 ] == 5)) ? 1 : 0; |
| 126 | 126 | |
| 127 | 127 | if (cpu_getiloops() % 2) |
| 128 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 128 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 129 | 129 | else |
| 130 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 130 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 131 | 131 | |
| 132 | 132 | } |
| 133 | 133 |
| r1591 | r1592 | |
|---|---|---|
| 830 | 830 | if (ACCESSING_LSB) |
| 831 | 831 | { |
| 832 | 832 | /* bit 0 = reset sub CPU */ |
| 833 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 833 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 834 | 834 | |
| 835 | 835 | /* bits 1-3 n.c. */ |
| 836 | 836 |
| r1591 | r1592 | |
|---|---|---|
| 62 | 62 | } |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | static const res_net_info pleiades_net_info = | |
| 66 | { | |
| 67 | RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_OPEN_COL, | |
| 68 | { | |
| 69 | { RES_NET_AMP_NONE, 150, 270, 2, { 270, 1 } }, | |
| 70 | { RES_NET_AMP_NONE, 150, 270, 2, { 270, 1 } }, | |
| 71 | { RES_NET_AMP_NONE, 150, 270, 2, { 270, 1 } } | |
| 72 | } | |
| 73 | }; | |
| 74 | ||
| 75 | static const res_net_info survival_net_info = | |
| 76 | { | |
| 77 | RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_OPEN_COL, | |
| 78 | { | |
| 79 | { RES_NET_AMP_NONE, 270, 270, 2, { 180, 1 } }, | |
| 80 | { RES_NET_AMP_NONE, 270, 270, 2, { 180, 1 } }, | |
| 81 | { RES_NET_AMP_NONE, 270, 270, 2, { 180, 1 } } | |
| 82 | } | |
| 83 | }; | |
| 84 | ||
| 65 | 85 | PALETTE_INIT( phoenix ) |
| 66 | 86 | { |
| 67 | 87 | int i; |
| 68 | int t[4]= {0,1,2,3}; | |
| 69 | 88 | rgb_t *rgb; |
| 70 | #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) | |
| 71 | 89 | |
| 72 | 90 | rgb = compute_res_net_all(color_prom, &phoenix_decode_info, &phoenix_net_info); |
| 73 | 91 | /* native order */ |
| 74 | 92 | for (i=0;i<256;i++) |
| 75 | 93 | { |
| 76 | 94 | int col; |
| 77 | col = (( | |
| 95 | col = (( | |
| 78 | 96 | palette_set_color(machine,i,rgb[col]); |
| 79 | 97 | } |
| 80 | 98 | palette_normalize_range(machine->palette, 0, 255, 0, 255); |
| 81 | 99 | free(rgb); |
| 82 | ||
| 83 | /* first bank of characters use colors 0x00-0x1f and 0x40-0x5f */ | |
| 84 | /* second bank of characters use colors 0x20-0x3f and 0x60-0x7f */ | |
| 85 | 100 | } |
| 86 | 101 | |
| 87 | PALETTE_INIT( | |
| 102 | PALETTE_INIT( survival | |
| 88 | 103 | { |
| 89 | 104 | int i; |
| 90 | | |
| 105 | | |
| 91 | 106 | |
| 92 | ||
| 93 | for (i = 0;i < machine->drv->total_colors;i++) | |
| 107 | rgb = compute_res_net_all(color_prom, &phoenix_decode_info, &survival_net_info); | |
| 108 | /* native order */ | |
| 109 | for (i=0;i<256;i++) | |
| 94 | 110 | { |
| 95 | int bit0,bit1,r,g,b; | |
| 96 | ||
| 97 | ||
| 98 | bit0 = (color_prom[0] >> 0) & 0x01; | |
| 99 | bit1 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; | |
| 100 | r = 0x55 * bit0 + 0xaa * bit1; | |
| 101 | bit0 = (color_prom[0] >> 2) & 0x01; | |
| 102 | bit1 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; | |
| 103 | g = 0x55 * bit0 + 0xaa * bit1; | |
| 104 | bit0 = (color_prom[0] >> 1) & 0x01; | |
| 105 | bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; | |
| 106 | b = 0x55 * bit0 + 0xaa * bit1; | |
| 107 | ||
| 108 | palette_set_color(machine,i,MAKE_RGB(r,g,b)); | |
| 109 | color_prom++; | |
| 111 | int col; | |
| 112 | col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60); | |
| 113 | palette_set_color(machine,i,rgb[col]); | |
| 110 | 114 | } |
| 115 | palette_normalize_range(machine->palette, 0, 255, 0, 255); | |
| 116 | free(rgb); | |
| 117 | } | |
| 111 | 118 | |
| 112 | /* first bank of characters use colors 0x00-0x1f, 0x40-0x5f, 0x80-0x9f and 0xc0-0xdf */ | |
| 113 | /* second bank of characters use colors 0x20-0x3f, 0x60-0x7f, 0xa0-0xbf and 0xe0-0xff */ | |
| 114 | for (i = 0;i < 0x80;i++) | |
| 119 | PALETTE_INIT( pleiads ) | |
| 120 | { | |
| 121 | int i; | |
| 122 | rgb_t *rgb; | |
| 123 | ||
| 124 | rgb = compute_res_net_all(color_prom, &phoenix_decode_info, &pleiades_net_info); | |
| 125 | /* native order */ | |
| 126 | for (i=0;i<256;i++) | |
| 115 | 127 | { |
| 116 | 128 | int col; |
| 117 | ||
| 118 | ||
| 119 | col = ((i & 0x1c) >> 2) | ((i & 0x03) << 3) | ((i & 0x60) << 1); | |
| 120 | ||
| 121 | COLOR(0,i) = col; | |
| 122 | COLOR(1,i) = col | 0x20; | |
| 129 | col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0xE0); | |
| 130 | palette_set_color(machine,i,rgb[col]); | |
| 123 | 131 | } |
| 132 | palette_normalize_range(machine->palette, 0, 255, 0, 255); | |
| 133 | free(rgb); | |
| 124 | 134 | } |
| 125 | 135 | |
| 126 | 136 | /*************************************************************************** |
| r1591 | r1592 | |
| 157 | 167 | 0); |
| 158 | 168 | } |
| 159 | 169 | |
| 160 | static TILE_GET_INFO( pleiads_get_fg_tile_info ) | |
| 161 | { | |
| 162 | int code; | |
| 163 | ||
| 164 | code = videoram_pg[videoram_pg_index][tile_index]; | |
| 165 | SET_TILE_INFO( | |
| 166 | 1, | |
| 167 | code, | |
| 168 | (code >> 5) | (palette_bank << 3), | |
| 169 | (tile_index & 0x1f) ? 0 : TILE_FORCE_LAYER0); /* first row (column) is opaque */ | |
| 170 | } | |
| 171 | ||
| 172 | static TILE_GET_INFO( pleiads_get_bg_tile_info ) | |
| 173 | { | |
| 174 | int code; | |
| 175 | ||
| 176 | code = videoram_pg[videoram_pg_index][tile_index + 0x800]; | |
| 177 | SET_TILE_INFO( | |
| 178 | 0, | |
| 179 | code, | |
| 180 | (code >> 5) | (palette_bank << 3), | |
| 181 | 0); | |
| 182 | } | |
| 183 | ||
| 184 | 170 | /*************************************************************************** |
| 185 | 171 | |
| 186 | 172 | Start the video hardware emulation. |
| r1591 | r1592 | |
| 215 | 201 | state_save_register_global(cocktail_mode); |
| 216 | 202 | } |
| 217 | 203 | |
| 218 | VIDEO_START( pleiads ) | |
| 219 | { | |
| 220 | videoram_pg[0] = auto_malloc(0x1000); | |
| 221 | videoram_pg[1] = auto_malloc(0x1000); | |
| 222 | ||
| 223 | memory_configure_bank(1, 0, 1, videoram_pg[0], 0); | |
| 224 | memory_configure_bank(1, 1, 1, videoram_pg[1], 0); | |
| 225 | memory_set_bank(1, 0); | |
| 226 | ||
| 227 | videoram_pg_index = 0; | |
| 228 | ||
| 229 | fg_tilemap = tilemap_create(pleiads_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32); | |
| 230 | bg_tilemap = tilemap_create(pleiads_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,32,32); | |
| 231 | ||
| 232 | tilemap_set_transparent_pen(fg_tilemap,0); | |
| 233 | ||
| 234 | tilemap_set_scrolldx(fg_tilemap, 0, (HTOTAL - HBSTART)); | |
| 235 | tilemap_set_scrolldx(bg_tilemap, 0, (HTOTAL - HBSTART)); | |
| 236 | tilemap_set_scrolldy(fg_tilemap, 0, (VTOTAL - VBSTART)); | |
| 237 | tilemap_set_scrolldy(bg_tilemap, 0, (VTOTAL - VBSTART)); | |
| 238 | } | |
| 239 | ||
| 240 | 204 | /*************************************************************************** |
| 241 | 205 | |
| 242 | 206 | Memory handlers |
| r1591 | r1592 | |
| 287 | 251 | |
| 288 | 252 | WRITE8_HANDLER( pleiads_videoreg_w ) |
| 289 | 253 | { |
| 290 | ||
| 254 | | |
| 291 | 255 | { |
| 292 | 256 | /* set memory bank */ |
| 293 | 257 | videoram_pg_index = data & 1; |
| r1591 | r1592 | |
| 306 | 270 | |
| 307 | 271 | if (palette_bank != ((data >> 1) & 3)) |
| 308 | 272 | { |
| 309 | palette_bank = ((data >> 1) & 3); | |
| 273 | palette_bank = ((data >> 1) & 3); | |
| 310 | 274 | |
| 311 | 275 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 312 | 276 | |
| r1591 | r1592 | |
| 329 | 293 | READ8_HANDLER( phoenix_input_port_0_r ) |
| 330 | 294 | { |
| 331 | 295 | if (cocktail_mode) |
| 332 | return (input | |
| 296 | return (readinput | |
| 333 | 297 | else |
| 334 | return input | |
| 298 | return readinput | |
| 335 | 299 | } |
| 336 | 300 | |
| 337 | 301 | READ8_HANDLER( pleiads_input_port_0_r ) |
| 338 | 302 | { |
| 339 | int ret = | |
| 303 | int ret = r | |
| 340 | 304 | |
| 341 | 305 | /* handle Pleiads protection */ |
| 342 | 306 | switch (pleiads_protection_question) |
| r1591 | r1592 | |
| 359 | 323 | |
| 360 | 324 | READ8_HANDLER( survival_input_port_0_r ) |
| 361 | 325 | { |
| 362 | int ret = | |
| 326 | int ret = r | |
| 363 | 327 | |
| 364 | 328 | if (survival_protection_value) |
| 365 | 329 | { |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | static void ppu_irq( int num, int *ppu_regs ) |
| 69 | 69 | { |
| 70 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 70 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 71 | 71 | pc10_int_detect = 1; |
| 72 | 72 | } |
| 73 | 73 |
| r1591 | r1592 | |
|---|---|---|
| 766 | 766 | memset(antic.video[i], 0, sizeof(VIDEO)); |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | | |
| 769 | VIDEO_START_CALL(generic_bitmapped | |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | /************************************************************************ |
| r1591 | r1592 | |
| 778 | 778 | { |
| 779 | 779 | UINT32 new_tv_artifacts; |
| 780 | 780 | |
| 781 | | |
| 781 | VIDEO_UPDATE_CALL(generic_bitmapped | |
| 782 | 782 | |
| 783 | 783 | new_tv_artifacts = readinputportbytag_safe("artifacts", 0); |
| 784 | 784 | if( tv_artifacts != new_tv_artifacts ) |
| r1591 | r1592 | |
| 1073 | 1073 | { |
| 1074 | 1074 | LOG((" @cycle #%3d issue DLI\n", cycle())); |
| 1075 | 1075 | antic.r.nmist |= DLI_NMI; |
| 1076 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1076 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1077 | 1077 | } |
| 1078 | 1078 | else |
| 1079 | 1079 | { |
| r1591 | r1592 | |
| 1142 | 1142 | { |
| 1143 | 1143 | LOG((" @cycle #%3d release WSYNC\n", cycle())); |
| 1144 | 1144 | /* release the CPU if it was actually waiting for HSYNC */ |
| 1145 | cpu_trigger(TRIGGER_HSYNC); | |
| 1145 | cpu_trigger(machine, TRIGGER_HSYNC); | |
| 1146 | 1146 | /* and turn off the 'wait for hsync' flag */ |
| 1147 | 1147 | antic.w.wsync = 0; |
| 1148 | 1148 | } |
| 1149 | 1149 | LOG((" @cycle #%3d release CPU\n", cycle())); |
| 1150 | 1150 | /* release the CPU (held for emulating cycles stolen by ANTIC DMA) */ |
| 1151 | cpu_trigger(TRIGGER_STEAL); | |
| 1151 | cpu_trigger(machine, TRIGGER_STEAL); | |
| 1152 | 1152 | |
| 1153 | 1153 | /* refresh the display (translate color clocks to pixels) */ |
| 1154 | 1154 | antic_linerefresh(); |
| r1591 | r1592 | |
| 1531 | 1531 | LOG((" cause VBL NMI\n")); |
| 1532 | 1532 | /* set the VBL NMI status bit */ |
| 1533 | 1533 | antic.r.nmist |= VBL_NMI; |
| 1534 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1534 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1535 | 1535 | } |
| 1536 | 1536 | } |
| 1537 | 1537 |
| r1591 | r1592 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | VIDEO_START( mpatrol ) |
| 200 | 200 | { |
| 201 | int y; | |
| 202 | ||
| 203 | 201 | bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32); |
| 204 | 202 | |
| 205 | 203 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 206 | ||
| 204 | tilemap_set_scrolldx(bg_tilemap, 128 - 1, -1); | |
| 205 | tilemap_set_scrolldy(bg_tilemap, 16, 16); | |
| 207 | 206 | tilemap_set_scroll_rows(bg_tilemap, 4); /* only lines 192-256 scroll */ |
| 208 | 207 | |
| 209 | /* Set the first 3 quarters of the screen to 255 */ | |
| 210 | for (y=0;y<3;y++) | |
| 211 | { | |
| 212 | tilemap_set_scrollx(bg_tilemap, y, 255); | |
| 213 | } | |
| 208 | state_save_register_global(bg1xpos); | |
| 209 | state_save_register_global(bg1ypos); | |
| 210 | state_save_register_global(bg2xpos); | |
| 211 | state_save_register_global(bg2ypos); | |
| 212 | state_save_register_global(bgcontrol); | |
| 214 | 213 | } |
| 215 | 214 | |
| 216 | 215 | |
| r1591 | r1592 | |
| 223 | 222 | with a NAND gate on the V64 and V128 lines to control when it's read, and when |
| 224 | 223 | 255 (via 8 pull up resistors) is used. |
| 225 | 224 | |
| 226 | So we set the first 3 quarters to 255 | |
| 225 | So we set the first 3 quarters to 255 | |
| 227 | 226 | */ |
| 227 | tilemap_set_scrollx(bg_tilemap, 0, 255); | |
| 228 | tilemap_set_scrollx(bg_tilemap, 1, 255); | |
| 229 | tilemap_set_scrollx(bg_tilemap, 2, 255); | |
| 228 | 230 | tilemap_set_scrollx(bg_tilemap, 3, -data); |
| 229 | 231 | } |
| 230 | 232 | |
| r1591 | r1592 | |
| 245 | 247 | } |
| 246 | 248 | |
| 247 | 249 | |
| 250 | /* This looks like some kind of protection implemented by a custom chip on the | |
| 251 | scroll board. It mangles the value written to the port mpatrol_bg1xpos_w, as | |
| 252 | follows: result = popcount(value & 0x7f) ^ (value >> 7) */ | |
| 253 | READ8_HANDLER( mpatrol_protection_r ) | |
| 254 | { | |
| 255 | int popcount = 0; | |
| 256 | int temp; | |
| 248 | 257 | |
| 258 | for (temp = bg1xpos & 0x7f; temp != 0; temp >>= 1) | |
| 259 | popcount += temp & 1; | |
| 260 | return popcount ^ (bg1xpos >> 7); | |
| 261 | } | |
| 262 | ||
| 263 | ||
| 249 | 264 | WRITE8_HANDLER( mpatrol_bg1ypos_w ) |
| 250 | 265 | { |
| 251 | 266 | bg1ypos = data; |
| r1591 | r1592 | |
| 291 | 306 | ypos = 255 - ypos - BGHEIGHT; |
| 292 | 307 | } |
| 293 | 308 | |
| 309 | xpos += 128; | |
| 310 | ||
| 294 | 311 | drawgfx(bitmap, machine->gfx[image], |
| 295 | 312 | 0, 0, |
| 296 | 313 | flip_screen, |
| r1591 | r1592 | |
| 337 | 354 | if (!(bgcontrol & 0x20)) |
| 338 | 355 | { |
| 339 | 356 | if (!(bgcontrol & 0x10)) |
| 340 | { | |
| 341 | 357 | draw_background(machine, bitmap, cliprect, bg2xpos, bg2ypos, 2); /* distant mountains */ |
| 342 | ||
| 358 | ||
| 343 | 359 | if (!(bgcontrol & 0x02)) |
| 344 | { | |
| 345 | 360 | draw_background(machine, bitmap, cliprect, bg1xpos, bg1ypos, 3); /* hills */ |
| 346 | ||
| 361 | ||
| 347 | 362 | if (!(bgcontrol & 0x04)) |
| 348 | { | |
| 349 | 363 | draw_background(machine, bitmap, cliprect, bg1xpos, bg1ypos, 4); /* cityscape */ |
| 350 | } | |
| 351 | 364 | } |
| 352 | 365 | |
| 353 | 366 | tilemap_set_flip(bg_tilemap, flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| r1591 | r1592 | |
| 355 | 368 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 356 | 369 | |
| 357 | 370 | /* draw the sprites */ |
| 358 | ||
| 359 | for (offs = spriteram_size - 4; offs >= 0; offs -= 4) | |
| 371 | for (offs = 0xfc; offs >= 0; offs -= 4) | |
| 360 | 372 | { |
| 361 | int sx,sy,flipx,flipy; | |
| 373 | int sy = 257 - spriteram[offs]; | |
| 374 | int color = spriteram[offs + 1] & 0x3f; | |
| 375 | int flipx = spriteram[offs + 1] & 0x40; | |
| 376 | int flipy = spriteram[offs + 1] & 0x80; | |
| 377 | int code = spriteram[offs + 2]; | |
| 378 | int sx = spriteram[offs + 3]; | |
| 379 | rectangle clip; | |
| 362 | 380 | |
| 363 | if (!(offs & 0x60)) | |
| 364 | { | |
| 365 | continue; /* some addresses in sprite RAM are skipped? */ | |
| 366 | } | |
| 381 | /* sprites from offsets $00-$7F are processed in the upper half of the frame */ | |
| 382 | /* sprites from offsets $80-$FF are processed in the lower half of the frame */ | |
| 383 | clip = *cliprect; | |
| 384 | if (!(offs & 0x80)) | |
| 385 | clip.min_y = 0, clip.max_y = 127; | |
| 386 | else | |
| 387 | clip.min_y = 128, clip.max_y = 255; | |
| 367 | 388 | |
| 368 | sx = spriteram[offs + 3]; | |
| 369 | sy = 240 - spriteram[offs]; | |
| 370 | flipx = spriteram[offs + 1] & 0x40; | |
| 371 | flipy = spriteram[offs + 1] & 0x80; | |
| 372 | ||
| 389 | /* adjust for flipping */ | |
| 373 | 390 | if (flip_screen) |
| 374 | 391 | { |
| 392 | int temp = clip.min_y; | |
| 393 | clip.min_y = 255 - clip.max_y; | |
| 394 | clip.max_y = 255 - temp; | |
| 375 | 395 | flipx = !flipx; |
| 376 | 396 | flipy = !flipy; |
| 377 | 397 | sx = 240 - sx; |
| 378 | sy = 2 | |
| 398 | sy = 257 + 11 - sy; | |
| 379 | 399 | } |
| 380 | 400 | |
| 381 | s | |
| 401 | sx += | |
| 382 | 402 | |
| 403 | /* in theory anyways; in practice, some of the molecule-looking guys get clipped */ | |
| 404 | #ifdef SPLIT_SPRITES | |
| 405 | sect_rect(&clip, cliprect); | |
| 406 | #else | |
| 407 | clip = *cliprect; | |
| 408 | #endif | |
| 409 | ||
| 383 | 410 | drawgfx(bitmap, machine->gfx[1], |
| 384 | spriteram[offs + 2], | |
| 385 | spriteram[offs + 1] & 0x3f, | |
| 386 | flipx, flipy, | |
| 387 | sx, sy, | |
| 388 | cliprect, TRANSPARENCY_COLOR, 512+32); | |
| 411 | code, color, flipx, flipy, sx, sy, | |
| 412 | &clip, TRANSPARENCY_COLOR, 512+32); | |
| 389 | 413 | } |
| 390 | 414 | return 0; |
| 391 | 415 | } |
| r1591 | r1592 | |
|---|---|---|
| 608 | 608 | rectangle clip; |
| 609 | 609 | |
| 610 | 610 | if (0xc0 != (input_port_2_r(0) & 0xc0)) /* coin slots assert an NMI */ |
| 611 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 611 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 612 | 612 | |
| 613 | 613 | if (0 == (watchdog_flip & 0x04)) |
| 614 | 614 | watchdog_reset_w (0,0); |
| r1591 | r1592 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | VIDEO_START( pipedrm ) |
| 155 | 155 | { |
| 156 | | |
| 156 | VIDEO_START_CALL(fromanc | |
| 157 | 157 | scrolly_ofs = 0x00; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | VIDEO_START( hatris ) |
| 161 | 161 | { |
| 162 | | |
| 162 | VIDEO_START_CALL(fromanc | |
| 163 | 163 | scrollx_ofs = 0xB9; |
| 164 | 164 | scrolly_ofs = 0x00; |
| 165 | 165 | } |
| r1591 | r1592 | |
| 292 | 292 | |
| 293 | 293 | static TIMER_CALLBACK( crtc_interrupt_gen ) |
| 294 | 294 | { |
| 295 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 295 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 296 | 296 | if (param != 0) |
| 297 | 297 | timer_adjust(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param)); |
| 298 | 298 | } |
| r1591 | r1592 | |
|---|---|---|
| 304 | 304 | static WRITE8_HANDLER( combascb_sh_irqtrigger_w ) |
| 305 | 305 | { |
| 306 | 306 | soundlatch_w(offset,data); |
| 307 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 307 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | static READ8_HANDLER( combascb_io_r ) |
| r1591 | r1592 | |
| 384 | 384 | } |
| 385 | 385 | else |
| 386 | 386 | { |
| 387 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MRA8_BANK1); /* banked ROM */ | |
| 388 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MWA8_ROM); | |
| 387 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_UNMAP); /* banked ROM */ | |
| 389 | 388 | } |
| 390 | 389 | } |
| 391 | 390 | } |
| r1591 | r1592 | |
|---|---|---|
| 17 | 17 | extern UINT32 *rsp_dmem; |
| 18 | 18 | extern void dp_full_sync(void); |
| 19 | 19 | |
| 20 | extern UINT32 vi_origin; | |
| 21 | extern UINT32 vi_width; | |
| 22 | extern UINT32 vi_control; | |
| 20 | extern UINT32 n64_vi_origin; | |
| 21 | extern UINT32 n64_vi_width; | |
| 22 | extern UINT32 n64_vi_control; | |
| 23 | 23 | |
| 24 | 24 | extern UINT32 dp_start; |
| 25 | 25 | extern UINT32 dp_end; |
| r1591 | r1592 | |
| 313 | 313 | VIDEO_UPDATE(n64) |
| 314 | 314 | { |
| 315 | 315 | int i, j; |
| 316 | ||
| 316 | int height = (n64_vi_control & 0x40) ? 479 : 239; | |
| 317 | 317 | |
| 318 | ||
| 318 | switch (n64_vi_control & 0x3) | |
| 319 | 319 | { |
| 320 | 320 | case 0: // blank/no signal |
| 321 | 321 | { |
| r1591 | r1592 | |
| 324 | 324 | |
| 325 | 325 | case 2: // RGBA5551 |
| 326 | 326 | { |
| 327 | ||
| 327 | UINT16 *frame_buffer = (UINT16*)&rdram[n64_vi_origin / 4]; | |
| 328 | 328 | if (frame_buffer) |
| 329 | 329 | { |
| 330 | 330 | for (j=0; j <height; j++) |
| r1591 | r1592 | |
| 345 | 345 | |
| 346 | 346 | case 3: // RGBA8888 |
| 347 | 347 | { |
| 348 | ||
| 348 | UINT32 *frame_buffer = (UINT32*)&rdram[n64_vi_origin / 4]; | |
| 349 | 349 | if (frame_buffer) |
| 350 | 350 | { |
| 351 | 351 | for (j=0; j < height; j++) |
| r1591 | r1592 | |
| 361 | 361 | break; |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | ||
| 364 | default: fatalerror("Unknown framebuffer format %d\n", n64_vi_control & 0x3); | |
| 365 | 365 | } |
| 366 | 366 | return 0; |
| 367 | 367 | } |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | UINT8 *ddragon_bgvideoram,*ddragon_fgvideoram; |
| 47 | ||
| 47 | UINT16 ddragon_scrollx_hi, ddragon_scrolly_hi; | |
| 48 | 48 | UINT8 *ddragon_scrollx_lo; |
| 49 | 49 | UINT8 *ddragon_scrolly_lo; |
| 50 | 50 | UINT8 *ddragon_spriteram; |
| 51 | ||
| 51 | UINT8 technos_video_hw; | |
| 52 | 52 | |
| 53 | 53 | static tilemap *fg_tilemap,*bg_tilemap; |
| 54 | 54 | |
| r1591 | r1592 | |
| 109 | 109 | fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32); |
| 110 | 110 | |
| 111 | 111 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 112 | tilemap_set_scrolldx(fg_tilemap, 0, 384 - 256); | |
| 113 | tilemap_set_scrolldx(bg_tilemap, 0, 384 - 256); | |
| 114 | tilemap_set_scrolldy(fg_tilemap, -8, -8); | |
| 115 | tilemap_set_scrolldy(bg_tilemap, -8, -8); | |
| 116 | ||
| 117 | state_save_register_global(ddragon_scrollx_hi); | |
| 118 | state_save_register_global(ddragon_scrolly_hi); | |
| 112 | 119 | } |
| 113 | 120 | |
| 114 | 121 | VIDEO_START( chinagat ) |
| r1591 | r1592 | |
| 117 | 124 | fg_tilemap = tilemap_create(get_fg_16color_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32); |
| 118 | 125 | |
| 119 | 126 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 127 | ||
| 128 | state_save_register_global(ddragon_scrollx_hi); | |
| 129 | state_save_register_global(ddragon_scrolly_hi); | |
| 120 | 130 | } |
| 121 | 131 | |
| 122 | 132 | |
| r1591 | r1592 | |
| 166 | 176 | int attr = src[i+1]; |
| 167 | 177 | if ( attr & 0x80 ) { /* visible */ |
| 168 | 178 | int sx = 240 - src[i+4] + ( ( attr & 2 ) << 7 ); |
| 169 | int sy = 2 | |
| 179 | int sy = 232 - src[i+0] + ( ( attr & 1 ) << 8 ); | |
| 170 | 180 | int size = ( attr & 0x30 ) >> 4; |
| 171 | 181 | int flipx = ( attr & 8 ); |
| 172 | 182 | int flipy = ( attr & 4 ); |
| r1591 | r1592 | |
| 194 | 204 | if (flip_screen) |
| 195 | 205 | { |
| 196 | 206 | sx = 240 - sx; |
| 197 | sy = 2 | |
| 207 | sy = 256 - sy; | |
| 198 | 208 | flipx = !flipx; |
| 199 | 209 | flipy = !flipy; |
| 200 | 210 | dx = -dx; |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | K056832_vh_start(machine, REGION_GFX1, K056832_BPP_4, 1, NULL, asterix_tile_callback, 1); |
| 49 | 49 | K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER, asterix_sprite_callback); |
| 50 | 50 | |
| 51 | K056832_set_LayerOffset(0, 89, 0); | |
| 52 | K056832_set_LayerOffset(1, 91, 0); | |
| 53 | K056832_set_LayerOffset(2, 89, 0); | |
| 54 | K056832_set_LayerOffset(3, 95, 0); | |
| 55 | ||
| 56 | 51 | K053245_set_SpriteOffset(0,-3,-1); |
| 57 | 52 | } |
| 58 | 53 | |
| r1591 | r1592 | |
| 77 | 72 | static const int K053251_CI[4] = { K053251_CI0, K053251_CI2, K053251_CI3, K053251_CI4 }; |
| 78 | 73 | int layer[3], plane, new_colorbase; |
| 79 | 74 | |
| 75 | /* Layer offsets are different if horizontally flipped */ | |
| 76 | if (K056832_read_register(0x0) & 0x10) | |
| 77 | { | |
| 78 | K056832_set_LayerOffset(0, 89-176, 0); | |
| 79 | K056832_set_LayerOffset(1, 91-176, 0); | |
| 80 | K056832_set_LayerOffset(2, 89-176, 0); | |
| 81 | K056832_set_LayerOffset(3, 95-176, 0); | |
| 82 | } | |
| 83 | else | |
| 84 | { | |
| 85 | K056832_set_LayerOffset(0, 89, 0); | |
| 86 | K056832_set_LayerOffset(1, 91, 0); | |
| 87 | K056832_set_LayerOffset(2, 89, 0); | |
| 88 | K056832_set_LayerOffset(3, 95, 0); | |
| 89 | } | |
| 90 | ||
| 91 | ||
| 80 | 92 | tilebanks[0] = (K056832_get_lookup(0) << 10); |
| 81 | 93 | tilebanks[1] = (K056832_get_lookup(1) << 10); |
| 82 | 94 | tilebanks[2] = (K056832_get_lookup(2) << 10); |
| r1591 | r1592 | |
|---|---|---|
| 437 | 437 | |
| 438 | 438 | static TIMER_CALLBACK( sprite_timer_callback ) |
| 439 | 439 | { |
| 440 | cpunum_set_input_line(3,0,ASSERT_LINE); | |
| 440 | cpunum_set_input_line(machine, 3,0,ASSERT_LINE); | |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | |
| r1591 | r1592 | |
| 566 | 566 | /SINT line will be reasserted in XSize * YSize cycles (RH0 signal cycles) |
| 567 | 567 | */ |
| 568 | 568 | /* 1.clear the /SINT interrupt line */ |
| 569 | cpunum_set_input_line(3,0,CLEAR_LINE); | |
| 569 | cpunum_set_input_line(Machine, 3,0,CLEAR_LINE); | |
| 570 | 570 | |
| 571 | 571 | /* 2.assert /SINT again after this time */ |
| 572 | 572 | timer_set( attotime_mul(ATTOTIME_IN_HZ(19968000/8), (XSize+1)*(YSize+1)), NULL, 0, sprite_timer_callback); |
| r1591 | r1592 | |
|---|---|---|
| 132 | 132 | } /* for(;;) */ |
| 133 | 133 | |
| 134 | 134 | finish: |
| 135 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 135 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static void reikaids_handleblit( int rom_base ) |
| r1591 | r1592 | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | finish: |
| 235 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 235 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | static void pteacher_handleblit( int rom_base ) |
| r1591 | r1592 | |
| 320 | 320 | } /* for(;;) */ |
| 321 | 321 | |
| 322 | 322 | finish: |
| 323 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 323 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 |
| r1591 | r1592 | |
|---|---|---|
| 80 | 80 | int_condition &= ~0x80; |
| 81 | 81 | |
| 82 | 82 | /* set the IRQ line */ |
| 83 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 83 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| r1591 | r1592 | |
| 91 | 91 | exidy_vblank_interrupt(machine, cpunum); |
| 92 | 92 | |
| 93 | 93 | /* plus a pulse on the NMI line */ |
| 94 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 94 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | READ8_HANDLER( exidy_interrupt_r ) |
| 99 | 99 | { |
| 100 | 100 | /* clear any interrupts */ |
| 101 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 101 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 102 | 102 | |
| 103 | 103 | /* return the latched condition */ |
| 104 | 104 | return int_condition; |
| r1591 | r1592 | |
| 282 | 282 | latch_condition(param); |
| 283 | 283 | |
| 284 | 284 | /* set the IRQ line */ |
| 285 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 285 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 |
| r1591 | r1592 | |
|---|---|---|
| 1278 | 1278 | /* hack to enable 2nd cpu when key is pressed */ |
| 1279 | 1279 | // if ( input_code_pressed_once(KEYCODE_L) ) |
| 1280 | 1280 | // { |
| 1281 | // cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1282 | // cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1281 | // cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1282 | // cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1283 | 1283 | // } |
| 1284 | 1284 | |
| 1285 | 1285 | /* AJG */ |
| r1591 | r1592 | |
|---|---|---|
| 97 | 97 | for (i=0;i<32*8;i++) |
| 98 | 98 | extyoffs[i] = i*8; |
| 99 | 99 | |
| 100 | video_start_generic(machine); | |
| 101 | ||
| 102 | 100 | tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,32,32); |
| 103 | 101 | tilemap_set_transparent_pen(tx_tilemap, 0x07); |
| 104 | 102 | tilemap_set_scrolldx(tx_tilemap, 0, 62); |
| r1591 | r1592 | |
| 120 | 118 | |
| 121 | 119 | decodegfx(machine->gfx[0], state->chargen,0,256); |
| 122 | 120 | |
| 123 | video_start_generic(machine); | |
| 124 | ||
| 125 | 121 | tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,32,32); |
| 126 | 122 | tilemap_set_scrolldx(tx_tilemap, 0, 116); |
| 127 | 123 | tilemap_set_scrolldy(tx_tilemap, 0, 0); |
| r1591 | r1592 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | READ16_HANDLER( m92_paletteram_r ) |
| 131 | 131 | { |
| 132 | return paletteram16 | |
| 132 | return paletteram16[ | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | WRITE16_HANDLER( m92_paletteram_w ) |
| r1591 | r1592 | |
|---|---|---|
| 116 | 116 | VIDEO_START( fcombat ) |
| 117 | 117 | { |
| 118 | 118 | bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32*8*2,32); |
| 119 | video_start_generic(machine); | |
| 120 | 119 | } |
| 121 | 120 | |
| 122 | 121 |
| r1591 | r1592 | |
|---|---|---|
| 237 | 237 | |
| 238 | 238 | VIDEO_START( wwfwfstb ) |
| 239 | 239 | { |
| 240 | | |
| 240 | VIDEO_START_CALL(wwfwfest | |
| 241 | 241 | |
| 242 | 242 | sprite_xoff = 2; |
| 243 | 243 | bg0_dx = bg1_dx[0] = -4; |
| r1591 | r1592 | |
|---|---|---|
| 259 | 259 | // report collision only when the character is not blank and within display area |
| 260 | 260 | if (collision && code!=0xf && clown_x>0 && clown_x<240 && clown_y>-12 && clown_y<240) |
| 261 | 261 | { |
| 262 | cpunum_set_input_line(0, 0, ASSERT_LINE); // interrupt accuracy is critical in Ripcord | |
| 263 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 262 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); // interrupt accuracy is critical in Ripcord | |
| 263 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 |
| r0 | r1592 | |
|---|---|---|
| 1 | #include "driver.h" | |
| 2 | #include "sound/ay8910.h" | |
| 3 | ||
| 4 | ||
| 5 | UINT8 *ninjakun_fg_videoram; | |
| 6 | UINT8 *ninjakun_bg_videoram; | |
| 7 | static tilemap *bg_tilemap, *fg_tilemap; | |
| 8 | static UINT8 flipscreen; | |
| 9 | static UINT8 ninjakun_xscroll,ninjakun_yscroll; | |
| 10 | ||
| 11 | static UINT8 ninjakun_io_8000_ctrl[4]; | |
| 12 | // static UINT8 old_scroll; | |
| 13 | ||
| 14 | /******************************************************************************* | |
| 15 | Tilemap Callbacks | |
| 16 | *******************************************************************************/ | |
| 17 | ||
| 18 | static TILE_GET_INFO( get_fg_tile_info ){ | |
| 19 | UINT32 tile_number = ninjakun_fg_videoram[tile_index] & 0xFF; | |
| 20 | UINT8 attr = ninjakun_fg_videoram[tile_index+0x400]; | |
| 21 | tile_number += (attr & 0x20) << 3; /* bank */ | |
| 22 | SET_TILE_INFO( | |
| 23 | 0, | |
| 24 | tile_number, | |
| 25 | (attr&0xf), | |
| 26 | 0); | |
| 27 | } | |
| 28 | ||
| 29 | static TILE_GET_INFO( get_bg_tile_info ){ | |
| 30 | UINT32 tile_number = ninjakun_bg_videoram[tile_index] & 0xFF; | |
| 31 | UINT8 attr = ninjakun_bg_videoram[tile_index+0x400]; | |
| 32 | tile_number += (attr & 0xC0) << 2; /* bank */ | |
| 33 | SET_TILE_INFO( | |
| 34 | 1, | |
| 35 | tile_number, | |
| 36 | (attr&0xf), | |
| 37 | 0); | |
| 38 | } | |
| 39 | ||
| 40 | WRITE8_HANDLER( ninjakun_fg_videoram_w ){ | |
| 41 | ninjakun_fg_videoram[offset] = data; | |
| 42 | tilemap_mark_tile_dirty(fg_tilemap,offset&0x3ff); | |
| 43 | } | |
| 44 | ||
| 45 | WRITE8_HANDLER( ninjakun_bg_videoram_w ){ | |
| 46 | ||
| 47 | int y = (offset + ((ninjakun_yscroll & 0xf8) << 2) ) & 0x3e0; | |
| 48 | int x = (offset + (ninjakun_xscroll >> 3) ) & 0x1f; | |
| 49 | int offs = x+y+(offset & 0x400); | |
| 50 | ||
| 51 | ninjakun_bg_videoram[offs] = data; | |
| 52 | tilemap_mark_tile_dirty(bg_tilemap,x+y); | |
| 53 | } | |
| 54 | ||
| 55 | READ8_HANDLER( ninjakun_bg_videoram_r ) | |
| 56 | { | |
| 57 | int y = (offset + ((ninjakun_yscroll & 0xf8) << 2) ) & 0x3e0; | |
| 58 | int x = (offset + (ninjakun_xscroll >> 3) ) & 0x1f; | |
| 59 | int offs = x+y+(offset & 0x400); | |
| 60 | ||
| 61 | return ninjakun_bg_videoram[offs]; | |
| 62 | } | |
| 63 | ||
| 64 | /******************************************************************************/ | |
| 65 | ||
| 66 | WRITE8_HANDLER( ninjakun_flipscreen_w ){ | |
| 67 | flipscreen = data?(TILEMAP_FLIPX|TILEMAP_FLIPY):0; | |
| 68 | tilemap_set_flip( ALL_TILEMAPS,flipscreen ); | |
| 69 | } | |
| 70 | ||
| 71 | READ8_HANDLER( ninjakun_io_8000_r ){ | |
| 72 | switch( offset ){ | |
| 73 | case 0: /* control */ | |
| 74 | return AY8910_read_port_0_r( 0 ); | |
| 75 | ||
| 76 | case 1: /* input read */ | |
| 77 | switch( ninjakun_io_8000_ctrl[0] ){ | |
| 78 | case 0xf: | |
| 79 | return readinputport(4); | |
| 80 | case 0xe: | |
| 81 | return readinputport(3); | |
| 82 | default: | |
| 83 | return ninjakun_io_8000_ctrl[1]; | |
| 84 | } | |
| 85 | break; | |
| 86 | ||
| 87 | case 2: /* control */ | |
| 88 | return AY8910_read_port_1_r( 0 ); | |
| 89 | ||
| 90 | case 3: /* data */ | |
| 91 | return ninjakun_io_8000_ctrl[3]; | |
| 92 | } | |
| 93 | ||
| 94 | // logerror("PC=%04x; RAM[0x800%d]\n",activecpu_get_pc(),offset); | |
| 95 | return 0xFF; | |
| 96 | } | |
| 97 | ||
| 98 | /* static void handle_scrolly( UINT8 new_scroll ){ */ | |
| 99 | ||
| 100 | /* HACK!!! | |
| 101 | ** | |
| 102 | ** New rows are always written at fixed locations above and below the background | |
| 103 | ** tilemaps, rather than at the logical screen boundaries with respect to scrolling. | |
| 104 | ** | |
| 105 | ** I don't know how this is handled by the actual NinjaKun hardware, but the | |
| 106 | ** following is a crude approximation, yielding a playable game. | |
| 107 | */ | |
| 108 | ||
| 109 | /* | |
| 110 | int old_row = old_scroll/8; | |
| 111 | int new_row = new_scroll/8; | |
| 112 | int i; | |
| 113 | if( new_scroll!=old_scroll ){ | |
| 114 | tilemap_set_scrolly( bg_tilemap, 0, new_scroll&7 ); | |
| 115 | ||
| 116 | if ((new_row == ((old_row - 1) & 0xff)) || ((!old_row) && (new_row == 0x1f))) | |
| 117 | { | |
| 118 | for( i=0x400-0x21; i>=0; i-- ){ | |
| 119 | ninjakun_bg_videoram_w( i+0x20, ninjakun_bg_videoram[i] ); | |
| 120 | } | |
| 121 | } | |
| 122 | else if ((new_row == ((old_row + 1) & 0xff)) || ((old_row == 0x1f) && (!new_row))) | |
| 123 | { | |
| 124 | for( i=0x20; i<0x400; i++ ){ | |
| 125 | ninjakun_bg_videoram_w( i-0x20, ninjakun_bg_videoram[i] ); | |
| 126 | } | |
| 127 | } | |
| 128 | ||
| 129 | old_scroll = new_scroll; | |
| 130 | } | |
| 131 | } | |
| 132 | */ | |
| 133 | ||
| 134 | ||
| 135 | WRITE8_HANDLER( ninjakun_io_8000_w ){ | |
| 136 | switch( offset ){ | |
| 137 | case 0x0: /* control#1 */ | |
| 138 | ninjakun_io_8000_ctrl[0] = data; | |
| 139 | AY8910_control_port_0_w( 0, data ); | |
| 140 | break; | |
| 141 | ||
| 142 | case 0x1: /* data#1 */ | |
| 143 | ninjakun_io_8000_ctrl[1] = data; | |
| 144 | switch( ninjakun_io_8000_ctrl[0] ){ | |
| 145 | default: | |
| 146 | AY8910_write_port_0_w( 0,data ); | |
| 147 | break; | |
| 148 | } | |
| 149 | break; | |
| 150 | ||
| 151 | case 0x2: /* control#2 */ | |
| 152 | ninjakun_io_8000_ctrl[2] = data; | |
| 153 | AY8910_control_port_1_w( 0, data ); | |
| 154 | break; | |
| 155 | ||
| 156 | case 0x3: /* data#2 */ | |
| 157 | ninjakun_io_8000_ctrl[3] = data; | |
| 158 | switch( ninjakun_io_8000_ctrl[2] ){ | |
| 159 | case 0xf: | |
| 160 | tilemap_set_scrolly( bg_tilemap, 0, data ); | |
| 161 | ninjakun_yscroll = data; | |
| 162 | break; | |
| 163 | case 0xe: | |
| 164 | if (flipscreen == 0) | |
| 165 | tilemap_set_scrollx( bg_tilemap, 0, data-7 ); | |
| 166 | else | |
| 167 | tilemap_set_scrollx( bg_tilemap, 0, data ); | |
| 168 | ninjakun_xscroll = data; | |
| 169 | break; | |
| 170 | default: | |
| 171 | AY8910_write_port_1_w( 0,data ); | |
| 172 | } | |
| 173 | break; | |
| 174 | } | |
| 175 | } | |
| 176 | ||
| 177 | WRITE8_HANDLER( ninjakun_paletteram_w ) | |
| 178 | { | |
| 179 | int i; | |
| 180 | ||
| 181 | paletteram_BBGGRRII_w(offset,data); | |
| 182 | ||
| 183 | if (offset > 15) | |
| 184 | return; | |
| 185 | ||
| 186 | if (offset != 1) | |
| 187 | { | |
| 188 | for (i=0; i<16; i++) | |
| 189 | { | |
| 190 | paletteram_BBGGRRII_w(0x200+offset+i*16,data); | |
| 191 | } | |
| 192 | } | |
| 193 | paletteram_BBGGRRII_w(0x200+offset*16+1,data); | |
| 194 | } | |
| 195 | ||
| 196 | /******************************************************************************* | |
| 197 | Video Hardware Functions | |
| 198 | ******************************************************************************** | |
| 199 | vh_start / vh_refresh | |
| 200 | *******************************************************************************/ | |
| 201 | ||
| 202 | VIDEO_START( ninjakun ){ | |
| 203 | fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 ); | |
| 204 | bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 ); | |
| 205 | tilemap_set_transparent_pen( fg_tilemap,0 ); | |
| 206 | ||
| 207 | /* Save State Support */ | |
| 208 | ||
| 209 | state_save_register_global_array(ninjakun_io_8000_ctrl); | |
| 210 | state_save_register_global(flipscreen); | |
| 211 | // state_save_register_global(old_scroll); | |
| 212 | } | |
| 213 | ||
| 214 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ){ | |
| 215 | const UINT8 *source = spriteram; | |
| 216 | const UINT8 *finish = source+0x800; | |
| 217 | ||
| 218 | const gfx_element *gfx = machine->gfx[2]; | |
| 219 | ||
| 220 | while( source<finish ){ | |
| 221 | int tile_number = source[0]; | |
| 222 | int sx = source[1]; | |
| 223 | int sy = source[2]; | |
| 224 | int attr = source[3]; | |
| 225 | int flipx = attr&0x10; | |
| 226 | int flipy = attr&0x20; | |
| 227 | int color = attr&0x0f; | |
| 228 | ||
| 229 | if( flipscreen ){ | |
| 230 | sx = 240-sx; | |
| 231 | sy = 240-sy; | |
| 232 | flipx = !flipx; | |
| 233 | flipy = !flipy; | |
| 234 | } | |
| 235 | ||
| 236 | drawgfx( | |
| 237 | bitmap, | |
| 238 | gfx, | |
| 239 | tile_number, | |
| 240 | color, | |
| 241 | flipx,flipy, | |
| 242 | sx,sy, | |
| 243 | cliprect, | |
| 244 | TRANSPARENCY_PEN,0 | |
| 245 | ); | |
| 246 | if (sx>240) | |
| 247 | drawgfx( | |
| 248 | bitmap, | |
| 249 | gfx, | |
| 250 | tile_number, | |
| 251 | color, | |
| 252 | flipx,flipy, | |
| 253 | sx-256,sy, | |
| 254 | cliprect, | |
| 255 | TRANSPARENCY_PEN,0 | |
| 256 | ); | |
| 257 | ||
| 258 | source+=0x20; | |
| 259 | } | |
| 260 | } | |
| 261 | ||
| 262 | VIDEO_UPDATE( ninjakun ) | |
| 263 | { | |
| 264 | int offs,chr,col,px,py,x,y; | |
| 265 | ||
| 266 | tilemap_draw( bitmap,cliprect,bg_tilemap,0,0 ); | |
| 267 | tilemap_draw( bitmap,cliprect,fg_tilemap,0,0 ); | |
| 268 | draw_sprites( machine, bitmap,cliprect ); | |
| 269 | ||
| 270 | for (y=4; y<28; y++) | |
| 271 | { | |
| 272 | for (x=0; x<32; x++) | |
| 273 | { | |
| 274 | offs = y*32+x; | |
| 275 | chr = ninjakun_fg_videoram[offs]; | |
| 276 | col = ninjakun_fg_videoram[offs + 0x400]; | |
| 277 | chr += (col & 0x20) << 3; | |
| 278 | ||
| 279 | if ((col & 0x10) == 0) | |
| 280 | { | |
| 281 | ||
| 282 | if (flipscreen==0) | |
| 283 | { | |
| 284 | px = 8*x; | |
| 285 | py = 8*y; | |
| 286 | } | |
| 287 | else | |
| 288 | { | |
| 289 | px = 248-8*x; | |
| 290 | py = 248-8*y; | |
| 291 | } | |
| 292 | ||
| 293 | drawgfx(bitmap,machine->gfx[0], | |
| 294 | chr, | |
| 295 | col & 0x0f, | |
| 296 | flipscreen,flipscreen, | |
| 297 | px,py, | |
| 298 | cliprect,TRANSPARENCY_PEN,0); | |
| 299 | } | |
| 300 | } | |
| 301 | } | |
| 302 | ||
| 303 | ||
| 304 | return 0; | |
| 305 | } |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | *******************************************************************************/ |
| 54 | 54 | |
| 55 | 55 | /* starts vdp for bios screen only */ |
| 56 | ||
| 56 | VIDEO_START( megaplay_ | |
| 57 | 57 | { |
| 58 | 58 | palette_base = 0x40; |
| 59 | 59 | |
| r1591 | r1592 | |
| 62 | 62 | cache_bitmap = auto_malloc( (16+256+16) * 192); /* 16 pixels either side to simplify drawing */ |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | ||
| 65 | VIDEO_UPDATE( megaplay_ | |
| 66 | 66 | { |
| 67 | 67 | int miny = (cliprect->min_y < 16) ? 16 : cliprect->min_y; |
| 68 | 68 | int maxy = (cliprect->max_y > 16+192-1) ? 16+192-1 : cliprect->max_y; |
| r1591 | r1592 | |
| 76 | 76 | for (i = miny;i <= maxy;i++) |
| 77 | 77 | draw_scanline8(bitmap,32,i,256,&cache_bitmap[(i-16) * (16+256+16) +24],&machine->pens[palette_base],0); |
| 78 | 78 | |
| 79 | return 0; | |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 82 | /******************************************************************************* |
| r1591 | r1592 | |
| 464 | 465 | |
| 465 | 466 | if ( (line >= ypos) && (line < ypos+sheight) ) { |
| 466 | 467 | int xpos; |
| 467 | UINT | |
| 468 | UINT16 sprnum; | |
| 468 | 469 | UINT8 spline; |
| 469 | 470 | |
| 470 | 471 | spline = line - ypos; |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | VIDEO_START( ninjaw ) |
| 49 | 49 | { |
| 50 | 50 | taito_hide_pixels = 22; |
| 51 | | |
| 51 | VIDEO_START_CALL(ninjaw_cor | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /************************************************************ |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | which resets itself). This bit is the likely candidate as it is flipped |
| 68 | 68 | early in bootup just prior to accessing the MCU for the first time. */ |
| 69 | 69 | if (cpu_gettotalcpu()>1) // Bootlegs don't have the MCU but still set this bit |
| 70 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 70 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | static TILE_GET_INFO( get_bg_tile_info ) |
| r1591 | r1592 | |
|---|---|---|
| 449 | 449 | |
| 450 | 450 | case 0x300/2 : megasys1_screen_flag = new_data; |
| 451 | 451 | if (new_data & 0x10) |
| 452 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 452 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 453 | 453 | else |
| 454 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 454 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 455 | 455 | break; |
| 456 | 456 | |
| 457 | 457 | case 0x308/2 : soundlatch_word_w(0,new_data,0); |
| 458 | cpunum_set_input_line(1,4,HOLD_LINE); | |
| 458 | cpunum_set_input_line(Machine, 1,4,HOLD_LINE); | |
| 459 | 459 | break; |
| 460 | 460 | |
| 461 | 461 | default : SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1591 | r1592 | |
| 500 | 500 | |
| 501 | 501 | case 0x2308/2 : megasys1_screen_flag = new_data; |
| 502 | 502 | if (new_data & 0x10) |
| 503 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 503 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 504 | 504 | else |
| 505 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 505 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 506 | 506 | break; |
| 507 | 507 | |
| 508 | 508 | case 0x8000/2 : /* Cybattler reads sound latch on irq 2 */ |
| 509 | 509 | soundlatch_word_w(0,new_data,0); |
| 510 | cpunum_set_input_line(1,2,HOLD_LINE); | |
| 510 | cpunum_set_input_line(Machine, 1,2,HOLD_LINE); | |
| 511 | 511 | break; |
| 512 | 512 | |
| 513 | 513 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1591 | r1592 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | WRITE8_HANDLER( bwing_paletteram_w ) |
| 132 | 132 | { |
| 133 | static const float rgb[4][3]={{0.85,0.95,1.00},{0.90,1.00,1.00},{0.80,1.00,1.00},{0.75,0.90,1.10}}; | |
| 133 | static const float rgb[4][3]={{0.85f,0.95f,1.00f},{0.90f,1.00f,1.00f},{0.80f,1.00f,1.00f},{0.75f,0.90f,1.10f}}; | |
| 134 | 134 | int r, g, b, i; |
| 135 | 135 | |
| 136 | 136 | paletteram[offset] = data; |
| r1591 | r1592 | |
|---|---|---|
| 195 | 195 | scroll2[2]=(data>>6)&1; |
| 196 | 196 | |
| 197 | 197 | if (data&0x80) |
| 198 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 198 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 199 | 199 | else |
| 200 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 200 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | WRITE8_HANDLER( shackled_control_w ) |
| r1591 | r1592 | |
|---|---|---|
| 11 | 11 | #include "genesis.h" |
| 12 | 12 | |
| 13 | 13 | /* in video/segasyse.c */ |
| 14 | void megaplay_start_video_normal(running_machine *machine); | |
| 15 | void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ); | |
| 14 | VIDEO_START( megaplay_normal ); | |
| 15 | VIDEO_UPDATE( megaplay_normal ); | |
| 16 | 16 | |
| 17 | 17 | static int genesis_screen_number; |
| 18 | 18 | |
| r1591 | r1592 | |
| 272 | 272 | if (!display_enable) |
| 273 | 273 | fillbitmap(bitmap, get_black_pen(machine), cliprect); |
| 274 | 274 | else |
| 275 | | |
| 275 | VIDEO_UPDATE_CALL(genesis | |
| 276 | 276 | return 0; |
| 277 | 277 | } |
| 278 | 278 | |
| r1591 | r1592 | |
| 290 | 290 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 291 | 291 | drawline(BITMAP_ADDR16(bitmap, y, 0), y, 0); |
| 292 | 292 | |
| 293 | megaplay_ | |
| 293 | VIDEO_UPDATE_CALL(megaplay_ | |
| 294 | 294 | |
| 295 | 295 | return 0; |
| 296 | 296 | } |
| r1591 | r1592 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | static TIMER_CALLBACK( crtc_interrupt_gen ) |
| 78 | 78 | { |
| 79 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 79 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 80 | 80 | if (param != 0) |
| 81 | 81 | timer_adjust(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param)); |
| 82 | 82 | } |
| r1591 | r1592 | |
|---|---|---|
| 162 | 162 | *dst++ = 0; |
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | ||
| 166 | video_start_generic(machine); | |
| 167 | 165 | } |
| 168 | 166 | |
| 169 | 167 |
| r1591 | r1592 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | static TIMER_CALLBACK( exctsccr_fm_callback ) |
| 99 | 99 | { |
| 100 | cpunum_set_input_line_and_vector( 1, 0, HOLD_LINE, 0xff ); | |
| 100 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff ); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | WRITE8_HANDLER( exctsccr_videoram_w ) |
| r1591 | r1592 | |
|---|---|---|
| 754 | 754 | } |
| 755 | 755 | tilemap_set_scrolly(bg_tilemap,0,gunnail_scrolly); |
| 756 | 756 | |
| 757 | | |
| 757 | VIDEO_UPDATE_CALL(macross | |
| 758 | 758 | return 0; |
| 759 | 759 | } |
| 760 | 760 |
| r1591 | r1592 | |
|---|---|---|
| 122 | 122 | INLINE void z80_bank(int num, int data); |
| 123 | 123 | |
| 124 | 124 | |
| 125 | static void update_irqs( | |
| 125 | static void update_irqs(running_machine *machine) | |
| 126 | 126 | { |
| 127 | 127 | int newstate = blitter_irq || vblank_irq || acia_irq; |
| 128 | 128 | |
| 129 | 129 | if (newstate != irq_state) |
| 130 | 130 | { |
| 131 | 131 | irq_state = newstate; |
| 132 | cpunum_set_input_line(0, 0, irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 132 | cpunum_set_input_line(machine, 0, 0, irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| r1591 | r1592 | |
| 647 | 647 | val = 0x1; |
| 648 | 648 | |
| 649 | 649 | /* TODO */ |
| 650 | update_irqs(); | |
| 650 | update_irqs(Machine); | |
| 651 | 651 | break; |
| 652 | 652 | } |
| 653 | 653 | case 0x1C: |
| r1591 | r1592 | |
| 1155 | 1155 | if ( changed & (1 << i) ) |
| 1156 | 1156 | { |
| 1157 | 1157 | Mechmtr_update(i, cycles, data & (1 << i) ); |
| 1158 | cpunum_set_input_line(1, M6809_FIRQ_LINE, PULSE_LINE ); | |
| 1158 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, PULSE_LINE ); | |
| 1159 | 1159 | } |
| 1160 | 1160 | } |
| 1161 | 1161 | } |
| r1591 | r1592 | |
| 1357 | 1357 | static void z80_acia_irq(int state) |
| 1358 | 1358 | { |
| 1359 | 1359 | acia_irq = state ? CLEAR_LINE : ASSERT_LINE; |
| 1360 | update_irqs(); | |
| 1360 | update_irqs(Machine); | |
| 1361 | 1361 | } |
| 1362 | 1362 | |
| 1363 | 1363 | static void m6809_data_irq(int state) |
| 1364 | 1364 | { |
| 1365 | cpunum_set_input_line(1, M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE); | |
| 1365 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE); | |
| 1366 | 1366 | } |
| 1367 | 1367 | |
| 1368 | 1368 | /* |
| r1591 | r1592 | |
| 1483 | 1483 | /* TODO */ |
| 1484 | 1484 | static INTERRUPT_GEN( timer_irq ) |
| 1485 | 1485 | { |
| 1486 | cpunum_set_input_line(1, M6809_IRQ_LINE, PULSE_LINE); | |
| 1486 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, PULSE_LINE); | |
| 1487 | 1487 | } |
| 1488 | 1488 | |
| 1489 | 1489 | /* TODO */ |
| 1490 | 1490 | static INTERRUPT_GEN( vblank_gen ) |
| 1491 | 1491 | { |
| 1492 | 1492 | vblank_irq = 1; |
| 1493 | update_irqs(); | |
| 1493 | update_irqs(machine); | |
| 1494 | 1494 | } |
| 1495 | 1495 | |
| 1496 | 1496 | static MACHINE_DRIVER_START( bfcobra ) |
| r1591 | r1592 | |
| 1524 | 1524 | MDRV_SOUND_CONFIG(upd7759_interface) |
| 1525 | 1525 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 1526 | 1526 | |
| 1527 | MDRV_VIDEO_START(generic_bitmapped) | |
| 1528 | 1527 | MDRV_VIDEO_UPDATE(bfcobra) |
| 1529 | 1528 | MACHINE_DRIVER_END |
| 1530 | 1529 |
| r1591 | r1592 | |
|---|---|---|
| 226 | 226 | /* machine driver */ |
| 227 | 227 | |
| 228 | 228 | static MACHINE_DRIVER_START( sbugger ) |
| 229 | MDRV_CPU_ADD(8085A, 6000000 | |
| 229 | MDRV_CPU_ADD(8085A, 6000000 | |
| 230 | 230 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 231 | 231 | MDRV_CPU_IO_MAP(readport,0) |
| 232 | 232 | MDRV_CPU_VBLANK_INT(irq3_line_hold,NUM_INTS_FRAME) |
| r1591 | r1592 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | switch(cpu_getiloops()){ |
| 44 | 44 | case 0: /* IRQ 2: drives the game */ |
| 45 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 46 | 46 | break; |
| 47 | 47 | case 1: /* IRQ 4: Read 1P Gun */ |
| 48 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 48 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 49 | 49 | break; |
| 50 | 50 | case 2: /* IRQ 6: Read 2P Gun */ |
| 51 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 51 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 52 | 52 | break; |
| 53 | 53 | } |
| 54 | 54 | } |
| r1591 | r1592 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | static WRITE8_HANDLER( sub_cpu_halt_w ) |
| 194 | 194 | { |
| 195 | cpunum_set_input_line(1, INPUT_LINE_HALT, (data )? ASSERT_LINE : CLEAR_LINE); | |
| 195 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, (data )? ASSERT_LINE : CLEAR_LINE); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | static UINT8 snd_data; |
| r1591 | r1592 | |
| 240 | 240 | |
| 241 | 241 | static WRITE8_HANDLER( sound_cpu_reset_w ) |
| 242 | 242 | { |
| 243 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE); | |
| 243 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | static int vol_ctrl[16]; |
| r1591 | r1592 | |
| 264 | 264 | |
| 265 | 265 | static TIMER_CALLBACK( nmi_callback ) |
| 266 | 266 | { |
| 267 | if (sound_nmi_enable) cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 267 | if (sound_nmi_enable) cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 268 | 268 | else pending_nmi = 1; |
| 269 | 269 | } |
| 270 | 270 | |
| r1591 | r1592 | |
| 284 | 284 | sound_nmi_enable = 1; |
| 285 | 285 | if (pending_nmi) |
| 286 | 286 | { |
| 287 | cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 287 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 288 | 288 | pending_nmi = 0; |
| 289 | 289 | } |
| 290 | 290 | } |
| r1591 | r1592 | |
|---|---|---|
| 483 | 483 | static WRITE8_HANDLER(mstworld_sound_w) |
| 484 | 484 | { |
| 485 | 485 | soundlatch_w(0,data); |
| 486 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 486 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | extern WRITE8_HANDLER( mstworld_gfxctrl_w ); |
| r1591 | r1592 | |
| 1418 | 1418 | sample_buffer >>= 4; |
| 1419 | 1419 | sample_select ^= 1; |
| 1420 | 1420 | if(sample_select == 0) |
| 1421 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1421 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | 1424 |
| r1591 | r1592 | |
|---|---|---|
| 267 | 267 | if (ACCESSING_LSB) |
| 268 | 268 | { |
| 269 | 269 | jumping_latch = data & 0xff; /*M68000 writes .b to $400007*/ |
| 270 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 270 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
| r1591 | r1592 | |
| 598 | 598 | |
| 599 | 599 | static void irqhandler(int irq) |
| 600 | 600 | { |
| 601 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 601 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 37 | 37 | if (ACCESSING_LSB) |
| 38 | 38 | { |
| 39 | 39 | soundlatch_w(offset,data & 0xff); |
| 40 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 40 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| r1591 | r1592 | |
| 286 | 286 | |
| 287 | 287 | static void irqhandler(int linestate) |
| 288 | 288 | { |
| 289 | cpunum_set_input_line(1,0,linestate); | |
| 289 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | static WRITE8_HANDLER( blktiger_coinlockout_w ) |
| 55 | 55 | { |
| 56 | coin_lockout_w(0,~data & 0x01); | |
| 57 | coin_lockout_w(1,~data & 0x02); | |
| 56 | if (readinputportbytag("COIN_LOCKOUT") & 0x01) | |
| 57 | { | |
| 58 | coin_lockout_w(0,~data & 0x01); | |
| 59 | coin_lockout_w(1,~data & 0x02); | |
| 60 | } | |
| 58 | 61 | } |
| 59 | 62 | |
| 60 | 63 | |
| 61 | ||
| 62 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 63 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 64 | AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK1) | |
| 65 | AM_RANGE(0xc000, 0xcfff) AM_READ(blktiger_bgvideoram_r) | |
| 66 | AM_RANGE(0xd000, 0xffff) AM_READ(MRA8_RAM) | |
| 64 | static ADDRESS_MAP_START( mem_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 65 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 66 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK1, MWA8_ROM) | |
| 67 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(blktiger_bgvideoram_r, blktiger_bgvideoram_w) | |
| 68 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(MRA8_RAM, blktiger_txvideoram_w) AM_BASE(&blktiger_txvideoram) | |
| 69 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_BASE(&paletteram) | |
| 70 | AM_RANGE(0xdc00, 0xdfff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_BASE(&paletteram_2) | |
| 71 | AM_RANGE(0xe000, 0xfdff) AM_RAM | |
| 72 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 67 | 73 | ADDRESS_MAP_END |
| 68 | 74 | |
| 69 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 70 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 71 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(blktiger_bgvideoram_w) | |
| 72 | AM_RANGE(0xd000, 0xd7ff) AM_WRITE(blktiger_txvideoram_w) AM_BASE(&blktiger_txvideoram) | |
| 73 | AM_RANGE(0xd800, 0xdbff) AM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_BASE(&paletteram) | |
| 74 | AM_RANGE(0xdc00, 0xdfff) AM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_BASE(&paletteram_2) | |
| 75 | AM_RANGE(0xe000, 0xfdff) AM_WRITE(MWA8_RAM) | |
| 76 | AM_RANGE(0xfe00, 0xffff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 77 | ADDRESS_MAP_END | |
| 78 | ||
| 79 | static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 ) | |
| 75 | static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 ) | |
| 80 | 76 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 81 | AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) | |
| 82 | AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) | |
| 83 | AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r) | |
| 84 | AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r) | |
| 85 | AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r) | |
| 86 | AM_RANGE(0x05, 0x05) AM_READ(input_port_5_r) | |
| 87 | AM_RANGE(0x07, 0x07) AM_READ(blktiger_protection_r) | |
| 88 | ADDRESS_MAP_END | |
| 89 | ||
| 90 | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) | |
| 91 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 92 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_w) | |
| 93 | AM_RANGE(0x01, 0x01) AM_WRITE(blktiger_bankswitch_w) | |
| 94 | AM_RANGE(0x03, 0x03) AM_WRITE(blktiger_coinlockout_w) | |
| 95 | AM_RANGE(0x04, 0x04) AM_WRITE(blktiger_video_control_w) | |
| 77 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w) | |
| 78 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(blktiger_bankswitch_w) | |
| 79 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") | |
| 80 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE(blktiger_coinlockout_w) | |
| 81 | AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1") AM_WRITE(blktiger_video_control_w) | |
| 82 | AM_RANGE(0x05, 0x05) AM_READ_PORT("FREEZE") | |
| 96 | 83 | AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w) |
| 97 | AM_RANGE(0x07, 0x07) AM_WRITE(MWA8_NOP) /* Software protection (7) */ | |
| 84 | AM_RANGE(0x07, 0x07) AM_READ(blktiger_protection_r) AM_WRITE(MWA8_NOP) /* Software protection (7) */ | |
| 98 | 85 | AM_RANGE(0x08, 0x09) AM_WRITE(blktiger_scrollx_w) |
| 99 | 86 | AM_RANGE(0x0a, 0x0b) AM_WRITE(blktiger_scrolly_w) |
| 100 | 87 | AM_RANGE(0x0c, 0x0c) AM_WRITE(blktiger_video_enable_w) |
| r1591 | r1592 | |
| 102 | 89 | AM_RANGE(0x0e, 0x0e) AM_WRITE(blktiger_screen_layout_w) |
| 103 | 90 | ADDRESS_MAP_END |
| 104 | 91 | |
| 105 | ||
| 106 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 107 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 108 | AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM) | |
| 92 | static ADDRESS_MAP_START( sound_mem_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 93 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 94 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 109 | 95 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) |
| 110 | AM_RANGE(0xe000, 0xe000) AM_READ(YM2203_status_port_0_r) | |
| 111 | AM_RANGE(0xe001, 0xe001) AM_READ(YM2203_read_port_0_r) | |
| 112 | AM_RANGE(0xe002, 0xe002) AM_READ(YM2203_status_port_1_r) | |
| 113 | AM_RANGE(0xe003, 0xe003) AM_READ(YM2203_read_port_1_r) | |
| 96 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w) | |
| 97 | AM_RANGE(0xe001, 0xe001) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w) | |
| 98 | AM_RANGE(0xe002, 0xe002) AM_READWRITE(YM2203_status_port_1_r, YM2203_control_port_1_w) | |
| 99 | AM_RANGE(0xe003, 0xe003) AM_READWRITE(YM2203_read_port_1_r, YM2203_write_port_1_w) | |
| 114 | 100 | ADDRESS_MAP_END |
| 115 | 101 | |
| 116 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 117 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM) | |
| 118 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM) | |
| 119 | AM_RANGE(0xe000, 0xe000) AM_WRITE(YM2203_control_port_0_w) | |
| 120 | AM_RANGE(0xe001, 0xe001) AM_WRITE(YM2203_write_port_0_w) | |
| 121 | AM_RANGE(0xe002, 0xe002) AM_WRITE(YM2203_control_port_1_w) | |
| 122 | AM_RANGE(0xe003, 0xe003) AM_WRITE(YM2203_write_port_1_w) | |
| 123 | ADDRESS_MAP_END | |
| 124 | 102 | |
| 125 | ||
| 126 | ||
| 127 | 103 | static INPUT_PORTS_START( blktiger ) |
| 128 | PORT_START /* IN0 */ | |
| 104 | PORT_START_TAG("IN0") /* IN0 */ | |
| 129 | 105 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 130 | 106 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 131 | 107 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */ |
| r1591 | r1592 | |
| 135 | 111 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 136 | 112 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 137 | 113 | |
| 138 | PORT_START /* IN1 */ | |
| 114 | PORT_START_TAG("IN1") /* IN1 */ | |
| 139 | 115 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 140 | 116 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 141 | 117 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| r1591 | r1592 | |
| 145 | 121 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */ |
| 146 | 122 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */ |
| 147 | 123 | |
| 148 | PORT_START /* IN2 */ | |
| 124 | PORT_START_TAG("IN2") /* IN2 */ | |
| 149 | 125 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL |
| 150 | 126 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL |
| 151 | 127 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL |
| r1591 | r1592 | |
| 155 | 131 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */ |
| 156 | 132 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */ |
| 157 | 133 | |
| 158 | PORT_START /* DSW0 */ | |
| 159 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) | |
| 134 | PORT_START_TAG("DSW0") /* DSW0 */ | |
| 135 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION( "SW1:1,2,3" ) | |
| 160 | 136 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) |
| 161 | 137 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| 162 | 138 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| r1591 | r1592 | |
| 165 | 141 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) |
| 166 | 142 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) |
| 167 | 143 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) |
| 168 | PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) | |
| 144 | PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_DIPLOCATION( "SW1:4,5,6" ) | |
| 169 | 145 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) |
| 170 | 146 | PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) |
| 171 | 147 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) |
| r1591 | r1592 | |
| 174 | 150 | PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) ) |
| 175 | 151 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) |
| 176 | 152 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_5C ) ) |
| 177 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) | |
| 153 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION( "SW1:7" ) | |
| 178 | 154 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 179 | 155 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 180 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 156 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Test ) ) PORT_DIPLOCATION( "SW1:8" ) | |
| 157 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 158 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 181 | 159 | |
| 182 | PORT_START /* DSW1 */ | |
| 183 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) | |
| 160 | PORT_START_TAG("DSW1") /* DSW1 */ | |
| 161 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW2:1,2" ) | |
| 184 | 162 | PORT_DIPSETTING( 0x02, "2" ) |
| 185 | 163 | PORT_DIPSETTING( 0x03, "3" ) |
| 186 | 164 | PORT_DIPSETTING( 0x01, "5" ) |
| 187 | 165 | PORT_DIPSETTING( 0x00, "7") |
| 188 | PORT_DIPNAME( 0x1c, 0x0c, DEF_STR( Difficulty ) ) | |
| 166 | PORT_DIPNAME( 0x1c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION( "SW2:3,4,5" ) | |
| 189 | 167 | PORT_DIPSETTING( 0x1c, "1 (Easiest)") |
| 190 | 168 | PORT_DIPSETTING( 0x18, "2" ) |
| 191 | 169 | PORT_DIPSETTING( 0x14, "3" ) |
| r1591 | r1592 | |
| 194 | 172 | PORT_DIPSETTING( 0x08, "6" ) |
| 195 | 173 | PORT_DIPSETTING( 0x04, "7" ) |
| 196 | 174 | PORT_DIPSETTING( 0x00, "8 (Hardest)" ) |
| 197 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) | |
| 175 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW2:6" ) | |
| 198 | 176 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 199 | 177 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 200 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) | |
| 178 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION( "SW2:7" ) | |
| 201 | 179 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 202 | 180 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) |
| 203 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) | |
| 181 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION( "SW2:8" ) | |
| 204 | 182 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 205 | 183 | PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) ) |
| 206 | 184 | |
| 207 | PORT_START | |
| 185 | PORT_START_TAG("FREEZE") | |
| 208 | 186 | PORT_DIPNAME( 0x01, 0x01, "Freeze" ) /* could be VBLANK */ |
| 209 | 187 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 210 | 188 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 189 | ||
| 190 | PORT_START_TAG("COIN_LOCKOUT") | |
| 191 | PORT_CONFNAME( 0x01, 0x01, "Coin Lockout Hardware Present" ) | |
| 192 | PORT_CONFSETTING( 0x01, DEF_STR( Yes ) ) | |
| 193 | PORT_CONFSETTING( 0x00, DEF_STR( No ) ) | |
| 211 | 194 | INPUT_PORTS_END |
| 212 | 195 | |
| 213 | 196 | |
| r1591 | r1592 | |
| 247 | 230 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 248 | 231 | static void irqhandler(int irq) |
| 249 | 232 | { |
| 250 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 233 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 251 | 234 | } |
| 252 | 235 | |
| 253 | 236 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
| 269 | 252 | |
| 270 | 253 | /* basic machine hardware */ |
| 271 | 254 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 272 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 273 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 255 | MDRV_CPU_PROGRAM_MAP(mem_map, 0) | |
| 256 | MDRV_CPU_IO_MAP(port_map, 0) | |
| 274 | 257 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 275 | 258 | |
| 276 | 259 | MDRV_CPU_ADD(Z80, 3000000) |
| 277 | 260 | /* audio CPU */ |
| 278 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 261 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 279 | 262 | |
| 280 | 263 | MDRV_SCREEN_REFRESH_RATE(60) |
| 281 | 264 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| r1591 | r1592 | |
|---|---|---|
| 261 | 261 | |
| 262 | 262 | static INTERRUPT_GEN( dynduke_interrupt ) |
| 263 | 263 | { |
| 264 | cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc8/4); // VBL | |
| 264 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc8/4); // VBL | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | /* Machine Driver */ |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | time_released = timer_get_time(); |
| 82 | 82 | |
| 83 | 83 | if (!mask) |
| 84 | { | |
| 85 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 86 | } | |
| 84 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | 85 | } |
| 88 | 86 | else |
| 89 | { | |
| 90 | 87 | time_pushed = timer_get_time(); |
| 91 | } | |
| 92 | 88 | |
| 93 | 89 | prev = val; |
| 94 | 90 | } |
| r1591 | r1592 | |
| 101 | 97 | |
| 102 | 98 | update_plunger(); |
| 103 | 99 | |
| 104 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 100 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 105 | 101 | |
| 106 | 102 | scanline = scanline + 32; |
| 107 | 103 |
| r1591 | r1592 | |
|---|---|---|
| 205 | 205 | static TIMER_CALLBACK( interrupt_gen ) |
| 206 | 206 | { |
| 207 | 207 | // logerror("hit scanline IRQ %d (%08x)\n", video_screen_get_vpos(0), info.i); |
| 208 | cpunum_set_input_line(0, mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE); | |
| 208 | cpunum_set_input_line(machine, 0, mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | static WRITE32_HANDLER( mlc_irq_w ) |
| r1591 | r1592 | |
| 217 | 217 | switch (offset*4) |
| 218 | 218 | { |
| 219 | 219 | case 0x10: /* IRQ ack. Value written doesn't matter */ |
| 220 | cpunum_set_input_line(0, mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE); | |
| 220 | cpunum_set_input_line(Machine, 0, mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE); | |
| 221 | 221 | return; |
| 222 | 222 | break; |
| 223 | 223 | case 0x14: /* Prepare scanline interrupt */ |
| r1591 | r1592 | |
| 731 | 731 | /* The timing in the ARM core isn't as accurate as it should be, so bump up the |
| 732 | 732 | effective clock rate here to compensate otherwise we have slowdowns in |
| 733 | 733 | Skull Fung where there probably shouldn't be. */ |
| 734 | cpunum_set_clockscale(0, 2.0f); | |
| 734 | cpunum_set_clockscale(machine, 0, 2.0f); | |
| 735 | 735 | mainCpuIsArm=1; |
| 736 | 736 | decrypt156(); |
| 737 | 737 | descramble_sound(); |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | static WRITE8_HANDLER( tryout_nmi_ack_w ) |
| 31 | 31 | { |
| 32 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 32 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static WRITE8_HANDLER( tryout_sound_w ) |
| 36 | 36 | { |
| 37 | 37 | soundlatch_w(0,data); |
| 38 | cpunum_set_input_line( 1, 0, PULSE_LINE ); | |
| 38 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE ); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static WRITE8_HANDLER( tryout_sound_irq_ack_w ) |
| 42 | 42 | { |
| 43 | cpunum_set_input_line( 1, 0, CLEAR_LINE ); | |
| 43 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE ); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static WRITE8_HANDLER( tryout_bankswitch_w ) |
| r1591 | r1592 | |
| 183 | 183 | static INTERRUPT_GEN( tryout_interrupt ) |
| 184 | 184 | { |
| 185 | 185 | if ((input_port_3_r(0) & 0x1c)!=0x1c) |
| 186 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 186 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | static MACHINE_DRIVER_START( tryout ) |
| r1591 | r1592 | |
|---|---|---|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (!(data & 0x40)) |
| 165 | cpunum_set_input_line(0, MC68000_IRQ_5, CLEAR_LINE); | |
| 165 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_5, CLEAR_LINE); | |
| 166 | 166 | break; |
| 167 | 167 | |
| 168 | 168 | case 0x0c/2: |
| r1591 | r1592 | |
| 192 | 192 | static WRITE16_HANDLER( sound_irq_w ) |
| 193 | 193 | { |
| 194 | 194 | if (ACCESSING_MSB) |
| 195 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 195 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | static READ16_HANDLER( sound_status_msb_r ) |
| r1591 | r1592 | |
| 206 | 206 | static INTERRUPT_GEN(rng_interrupt) |
| 207 | 207 | { |
| 208 | 208 | if (rng_sysreg[0x0c/2] & 0x09) |
| 209 | cpunum_set_input_line(0, MC68000_IRQ_5, ASSERT_LINE); | |
| 209 | cpunum_set_input_line(machine, 0, MC68000_IRQ_5, ASSERT_LINE); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | static ADDRESS_MAP_START( rngreadmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 265 | 265 | memory_set_bankptr(2, memory_region(REGION_CPU2) + 0x10000 + (data & 0x07) * 0x4000); |
| 266 | 266 | |
| 267 | 267 | if (data & 0x10) |
| 268 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 268 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | static INTERRUPT_GEN(audio_interrupt) |
| 272 | 272 | { |
| 273 | 273 | if (rng_z80_control & 0x80) return; |
| 274 | 274 | |
| 275 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 275 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /* sound (this should be split into audio/xexex.c or pregx.c or so someday) */ |
| r1591 | r1592 | |
|---|---|---|
| 147 | 147 | { |
| 148 | 148 | IntPend|=(1<<num); |
| 149 | 149 | program_write_dword_32le(0x01800c0c,IntPend); |
| 150 | cpunum_set_input_line(0,SE3208_INT,ASSERT_LINE); | |
| 150 | cpunum_set_input_line(Machine, 0,SE3208_INT,ASSERT_LINE); | |
| 151 | 151 | } |
| 152 | 152 | #ifdef IDLE_LOOP_SPEEDUP |
| 153 | 153 | FlipCntRead=0; |
| r1591 | r1592 | |
| 205 | 205 | IntPend&=~(1<<(data&0x1f)); |
| 206 | 206 | program_write_dword_32le(0x01800c0c,IntPend); |
| 207 | 207 | if(!IntPend) |
| 208 | cpunum_set_input_line(0,SE3208_INT,CLEAR_LINE); | |
| 208 | cpunum_set_input_line(Machine, 0,SE3208_INT,CLEAR_LINE); | |
| 209 | 209 | } |
| 210 | 210 | if((~mem_mask)&0xff00) |
| 211 | 211 | IntHigh=(data>>8)&7; |
| r1591 | r1592 | |
|---|---|---|
| 303 | 303 | |
| 304 | 304 | static WRITE8_HANDLER( wdclr_w ) |
| 305 | 305 | { |
| 306 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 307 | watchdog_reset(); | |
| 306 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 307 | watchdog_reset(Machine); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /************************************* |
| r1591 | r1592 | |
|---|---|---|
| 43 | 43 | if (ACCESSING_LSB) |
| 44 | 44 | { |
| 45 | 45 | soundlatch_w(0,data & 0xff); |
| 46 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 46 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
| r1591 | r1592 | |
| 273 | 273 | |
| 274 | 274 | static void sound_irq(int state) |
| 275 | 275 | { |
| 276 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 276 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 42 | 42 | * |
| 43 | 43 | *************************************/ |
| 44 | 44 | |
| 45 | static void update_interrupts( | |
| 45 | static void update_interrupts(running_machine *machine) | |
| 46 | 46 | { |
| 47 | 47 | int newstate = 0; |
| 48 | 48 | int newstate2 = 0; |
| r1591 | r1592 | |
| 53 | 53 | newstate |= 6; |
| 54 | 54 | |
| 55 | 55 | if (newstate) |
| 56 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 56 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 57 | 57 | else |
| 58 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 58 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 59 | 59 | |
| 60 | 60 | if (newstate2) |
| 61 | cpunum_set_input_line(1, newstate2, ASSERT_LINE); | |
| 61 | cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE); | |
| 62 | 62 | else |
| 63 | cpunum_set_input_line(1, 7, CLEAR_LINE); | |
| 63 | cpunum_set_input_line(machine, 1, 7, CLEAR_LINE); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r1591 | r1592 | |
| 76 | 76 | |
| 77 | 77 | static MACHINE_RESET( eprom ) |
| 78 | 78 | { |
| 79 | | |
| 79 | MACHINE_RESET_CALL(klaxp | |
| 80 | 80 | state_save_register_global_pointer(sync_data, 2); |
| 81 | 81 | } |
| 82 | 82 | |
| r1591 | r1592 | |
| 122 | 122 | if (ACCESSING_LSB) |
| 123 | 123 | { |
| 124 | 124 | if (data & 1) |
| 125 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 125 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 126 | 126 | else |
| 127 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 127 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 |
| r1591 | r1592 | |
|---|---|---|
| 324 | 324 | #if 0 // doesn't work for some reason |
| 325 | 325 | static WRITE8_HANDLER(soundcpu_reset_w) |
| 326 | 326 | { |
| 327 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 327 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 328 | 328 | } |
| 329 | 329 | #endif |
| 330 | 330 | |
| r1591 | r1592 | |
| 717 | 717 | // handler called by the 2203 emulator when the internal timers cause an IRQ |
| 718 | 718 | static void irqhandler(int irq) |
| 719 | 719 | { |
| 720 | cpunum_set_input_line(2, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 720 | cpunum_set_input_line(Machine, 2, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
| 784 | 784 | /* audio CPU */ // 3 MHz |
| 785 | 785 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) // IRQs are triggered by the YM2203 |
| 786 | 786 | |
| 787 | MDRV_CPU_ADD_TAG("mcu", M6801, 4000000 | |
| 787 | MDRV_CPU_ADD_TAG("mcu", M6801, 4000000 | |
| 788 | 788 | MDRV_CPU_PROGRAM_MAP(mcu_map, 0) |
| 789 | 789 | MDRV_CPU_VBLANK_INT(irq0_line_pulse, 1) // comes from the same clock that latches the INT pin on the second Z80 |
| 790 | 790 | |
| r1591 | r1592 | |
| 1333 | 1333 | { |
| 1334 | 1334 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r ); |
| 1335 | 1335 | |
| 1336 | | |
| 1336 | DRIVER_INIT_CALL(tokio | |
| 1337 | 1337 | } |
| 1338 | 1338 | |
| 1339 | 1339 |
| r1591 | r1592 | |
|---|---|---|
| 248 | 248 | skyfox_bg_pos += (skyfox_bg_ctrl >> 1) & 0x7; // maybe.. |
| 249 | 249 | |
| 250 | 250 | /* Check coin 1 & 2 */ |
| 251 | if ((readinputportbytag("IN4") & 3) != 3) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 251 | if ((readinputportbytag("IN4") & 3) != 3) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | static MACHINE_DRIVER_START( skyfox ) |
| r1591 | r1592 | |
|---|---|---|
| 198 | 198 | static INTERRUPT_GEN( cshooter_interrupt ) |
| 199 | 199 | { |
| 200 | 200 | if(cpu_getiloops()) |
| 201 | { | |
| 202 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x08); | |
| 203 | } | |
| 201 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x08); | |
| 204 | 202 | else |
| 205 | { | |
| 206 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x10); | |
| 207 | } | |
| 203 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x10); | |
| 208 | 204 | |
| 209 | 205 | if(mainram!=NULL) |
| 210 | { | |
| 211 | 206 | ar_coin_hack(); |
| 212 | } | |
| 213 | 207 | |
| 214 | 208 | } |
| 215 | 209 |
| r1591 | r1592 | |
|---|---|---|
| 108 | 108 | { |
| 109 | 109 | pending_command = 1; |
| 110 | 110 | soundlatch_w(offset,data & 0xff); |
| 111 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 111 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| r1591 | r1592 | |
| 118 | 118 | { |
| 119 | 119 | pending_command = 1; |
| 120 | 120 | soundlatch_w(offset,(data >> 8) & 0xff); |
| 121 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 121 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| r1591 | r1592 | |
| 127 | 127 | if(data & 0x8000) |
| 128 | 128 | { |
| 129 | 129 | soundlatch_w(0,data & 0xff); |
| 130 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 130 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| r1591 | r1592 | |
| 1377 | 1377 | |
| 1378 | 1378 | static void irqhandler(int irq) |
| 1379 | 1379 | { |
| 1380 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1380 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1381 | 1381 | } |
| 1382 | 1382 | |
| 1383 | 1383 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 83 | 83 | int scanline; |
| 84 | 84 | int coin = (readinputport(1) & 2); |
| 85 | 85 | |
| 86 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 86 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 87 | 87 | |
| 88 | 88 | if (!coin && prev_coin) |
| 89 | 89 | { |
| 90 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 90 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | prev_coin = coin; |
| r1591 | r1592 | |
| 136 | 136 | |
| 137 | 137 | static READ8_HANDLER( fgoal_nmi_reset_r ) |
| 138 | 138 | { |
| 139 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 139 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 140 | 140 | |
| 141 | 141 | return 0; |
| 142 | 142 | } |
| r1591 | r1592 | |
| 144 | 144 | |
| 145 | 145 | static READ8_HANDLER( fgoal_irq_reset_r ) |
| 146 | 146 | { |
| 147 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 147 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 148 | 148 | |
| 149 | 149 | return 0; |
| 150 | 150 | } |
| r1591 | r1592 | |
|---|---|---|
| 277 | 277 | |
| 278 | 278 | static INTERRUPT_GEN( galsnew_interrupt ) |
| 279 | 279 | { |
| 280 | cpunum_set_input_line(0, cpu_getiloops() + 3, HOLD_LINE); /* IRQs 5, 4, and 3 */ | |
| 280 | cpunum_set_input_line(machine, 0, cpu_getiloops() + 3, HOLD_LINE); /* IRQs 5, 4, and 3 */ | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | static MACHINE_RESET( galsnew ) |
| r1591 | r1592 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | static WRITE32_HANDLER(int_ack_w) |
| 109 | 109 | { |
| 110 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 110 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | static ADDRESS_MAP_START( ultrsprt_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r1591 | r1592 | |
| 259 | 259 | |
| 260 | 260 | static INTERRUPT_GEN( ultrsprt_vblank ) |
| 261 | 261 | { |
| 262 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 262 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | static MACHINE_RESET( ultrsprt ) |
| r1591 | r1592 | |
| 309 | 309 | { |
| 310 | 310 | if (irq == 0) |
| 311 | 311 | { |
| 312 | //cpunum_set_input_line(1, INPUT_LINE_IRQ5, PULSE_LINE); | |
| 312 | //cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ5, PULSE_LINE); | |
| 313 | 313 | } |
| 314 | 314 | else |
| 315 | 315 | { |
| 316 | cpunum_set_input_line(1, INPUT_LINE_IRQ6, PULSE_LINE); | |
| 316 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ6, PULSE_LINE); | |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | static DRIVER_INIT( ultrsprt ) |
| 321 | 321 | { |
| 322 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 322 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 323 | 323 | |
| 324 | 324 | K056800_init(sound_irq_callback); |
| 325 | 325 | } |
| r1591 | r1592 | |
|---|---|---|
| 99 | 99 | sound_fetched = 0; |
| 100 | 100 | sound_command = data; |
| 101 | 101 | sound_cpu_ready = 0; |
| 102 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 102 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static READ8_HANDLER( sound_command_r ) |
| r1591 | r1592 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | static WRITE8_HANDLER( mystston_irq_reset_w ) |
| 75 | 75 | { |
| 76 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 76 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| r1591 | r1592 | |
| 236 | 236 | /* IMS is triggered every time VLOC line 3 is raised, |
| 237 | 237 | as VLOC counter starts at 16, effectively every 16 scanlines */ |
| 238 | 238 | if ((scanline % 16) == 0) |
| 239 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 239 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 |
| r1591 | r1592 | |
|---|---|---|
| 38 | 38 | * |
| 39 | 39 | *************************************/ |
| 40 | 40 | |
| 41 | static void update_interrupts( | |
| 41 | static void update_interrupts(running_machine *machine) | |
| 42 | 42 | { |
| 43 | 43 | int newstate = 0; |
| 44 | 44 | |
| r1591 | r1592 | |
| 46 | 46 | newstate = 4; |
| 47 | 47 | |
| 48 | 48 | if (newstate) |
| 49 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 49 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 50 | 50 | else |
| 51 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 51 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 |
| r1591 | r1592 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | static INTERRUPT_GEN( senjyo_interrupt ) |
| 129 | 129 | { |
| 130 | if (int_delay_kludge == 0) cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 130 | if (int_delay_kludge == 0) cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 131 | 131 | else int_delay_kludge--; |
| 132 | 132 | } |
| 133 | 133 |
| r1591 | r1592 | |
|---|---|---|
| 82 | 82 | static INTERRUPT_GEN( yiear_nmi_interrupt ) |
| 83 | 83 | { |
| 84 | 84 | /* can't use nmi_line_pulse() because interrupt_enable_w() effects it */ |
| 85 | if (yiear_nmi_enable) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 85 | if (yiear_nmi_enable) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 |
| r1591 | r1592 | |
|---|---|---|
| 197 | 197 | |
| 198 | 198 | static MACHINE_DRIVER_START( murogem ) |
| 199 | 199 | /* basic machine hardware */ |
| 200 | MDRV_CPU_ADD(M6802, | |
| 200 | MDRV_CPU_ADD(M6802,8000000) /* ? MHz */ | |
| 201 | 201 | MDRV_CPU_PROGRAM_MAP(murogem_map,0) |
| 202 | 202 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 203 | 203 |
| r1591 | r1592 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static INTERRUPT_GEN( snowbros_interrupt ) |
| 107 | 107 | { |
| 108 | cpunum_set_input_line(0, cpu_getiloops() + 2, HOLD_LINE); /* IRQs 4, 3, and 2 */ | |
| 108 | cpunum_set_input_line(machine, 0, cpu_getiloops() + 2, HOLD_LINE); /* IRQs 4, 3, and 2 */ | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static INTERRUPT_GEN( snowbro3_interrupt ) |
| 112 | 112 | { |
| 113 | 113 | int status = OKIM6295_status_0_r(0); |
| 114 | 114 | |
| 115 | cpunum_set_input_line(0, cpu_getiloops() + 2, HOLD_LINE); /* IRQs 4, 3, and 2 */ | |
| 115 | cpunum_set_input_line(machine, 0, cpu_getiloops() + 2, HOLD_LINE); /* IRQs 4, 3, and 2 */ | |
| 116 | 116 | |
| 117 | 117 | if (sb3_music_is_playing) |
| 118 | 118 | { |
| r1591 | r1592 | |
| 147 | 147 | if (ACCESSING_LSB) |
| 148 | 148 | { |
| 149 | 149 | soundlatch_w(offset,data & 0xff); |
| 150 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 150 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| r1591 | r1592 | |
| 289 | 289 | if (ACCESSING_LSB) |
| 290 | 290 | { |
| 291 | 291 | soundlatch_w(offset,data & 0xff); |
| 292 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 292 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | |
| r1591 | r1592 | |
| 1516 | 1516 | /* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */ |
| 1517 | 1517 | static void irqhandler(int irq) |
| 1518 | 1518 | { |
| 1519 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1519 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1520 | 1520 | } |
| 1521 | 1521 | |
| 1522 | 1522 | /* SnowBros Sound */ |
| r1591 | r1592 | |
|---|---|---|
| 253 | 253 | static INTERRUPT_GEN( bzone_interrupt ) |
| 254 | 254 | { |
| 255 | 255 | if (readinputport(0) & 0x10) |
| 256 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 256 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| r1591 | r1592 | |
| 816 | 816 | |
| 817 | 817 | static DRIVER_INIT( bradley ) |
| 818 | 818 | { |
| 819 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, MRA8_RAM); | |
| 820 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, MWA8_RAM); | |
| 819 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, MRA8_BANK1, MWA8_BANK1); | |
| 820 | memory_set_bankptr(1, auto_malloc(0x400)); | |
| 821 | 821 | |
| 822 | 822 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1808, 0x1808, 0, 0, input_port_4_r); |
| 823 | 823 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1809, 0x1809, 0, 0, input_port_5_r); |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | /* assert the lines that are live, or clear everything if nothing is live */ |
| 111 | 111 | if (irq != 0) |
| 112 | 112 | { |
| 113 | cpunum_set_input_line(0, irq, ASSERT_LINE); | |
| 113 | cpunum_set_input_line(Machine, 0, irq, ASSERT_LINE); | |
| 114 | 114 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 115 | 115 | } |
| 116 | 116 | else |
| 117 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 117 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| r1591 | r1592 | |
| 132 | 132 | if (scanline == 223) |
| 133 | 133 | { |
| 134 | 134 | vblank_irq_state = update = 1; |
| 135 | cpunum_set_input_line(1, 4, ASSERT_LINE); | |
| 135 | cpunum_set_input_line(machine, 1, 4, ASSERT_LINE); | |
| 136 | 136 | next_scanline = scanline + 1; |
| 137 | 137 | } |
| 138 | 138 | |
| r1591 | r1592 | |
| 141 | 141 | { |
| 142 | 142 | vblank_irq_state = 0; |
| 143 | 143 | update = 1; |
| 144 | cpunum_set_input_line(1, 4, CLEAR_LINE); | |
| 144 | cpunum_set_input_line(machine, 1, 4, CLEAR_LINE); | |
| 145 | 145 | next_scanline = scanline + 1; |
| 146 | 146 | } |
| 147 | 147 | |
| r1591 | r1592 | |
| 172 | 172 | static TIMER_CALLBACK( delayed_sound_data_w ) |
| 173 | 173 | { |
| 174 | 174 | soundlatch_w(0, param); |
| 175 | cpunum_set_input_line(2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 175 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| r1591 | r1592 | |
| 184 | 184 | |
| 185 | 185 | static void sound_cpu_irq(int state) |
| 186 | 186 | { |
| 187 | cpunum_set_input_line(2, 0, state); | |
| 187 | cpunum_set_input_line(Machine, 2, 0, state); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | static READ8_HANDLER( sound_data_r ) |
| 192 | 192 | { |
| 193 | cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 193 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 194 | 194 | return soundlatch_r(offset); |
| 195 | 195 | } |
| 196 | 196 | |
| r1591 | r1592 | |
| 204 | 204 | |
| 205 | 205 | static void xboard_reset(void) |
| 206 | 206 | { |
| 207 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 207 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 208 | 208 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 209 | 209 | } |
| 210 | 210 | |
| r1591 | r1592 | |
| 351 | 351 | */ |
| 352 | 352 | if (((oldval ^ data) & 0x40) && !(data & 0x40)) watchdog_reset_w(0,0); |
| 353 | 353 | segaic16_set_display_enable(data & 0x20); |
| 354 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 354 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 355 | 355 | return; |
| 356 | 356 | |
| 357 | 357 | case 3: |
| r1591 | r1592 | |
|---|---|---|
| 488 | 488 | |
| 489 | 489 | static void ctc0_interrupt(int state) |
| 490 | 490 | { |
| 491 | cpunum_set_input_line(0, 0, state); | |
| 491 | cpunum_set_input_line(Machine, 0, 0, state); | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | static void ctc1_interrupt(int state) |
| 495 | 495 | { |
| 496 | cpunum_set_input_line(1, 0, state); | |
| 496 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | /* CTC of main cpu, ch0 trigger is vblank */ |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | if (last == 0 && data == 1) |
| 68 | 68 | { |
| 69 | 69 | /* setting bit 0 low then high triggers IRQ on the sound CPU */ |
| 70 | cpunum_set_input_line(1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 70 | cpunum_set_input_line(Machine, 1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | last = data; |
| r1591 | r1592 | |
|---|---|---|
| 395 | 395 | static WRITE16_HANDLER( powerbls_sound_w ) |
| 396 | 396 | { |
| 397 | 397 | soundlatch_w(0,data & 0xff); |
| 398 | cpunum_set_input_line(1,I8051_INT1_LINE,PULSE_LINE); | |
| 398 | cpunum_set_input_line(Machine, 1,I8051_INT1_LINE,PULSE_LINE); | |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /* Memory Maps */ |
| r1591 | r1592 | |
|---|---|---|
| 474 | 474 | |
| 475 | 475 | static INTERRUPT_GEN( simpl156_vbl_interrupt ) |
| 476 | 476 | { |
| 477 | cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE); | |
| 477 | cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE); | |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | |
| r1591 | r1592 | |
| 1162 | 1162 | static DRIVER_INIT (joemacr) |
| 1163 | 1163 | { |
| 1164 | 1164 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, joemacr_speedup_r ); |
| 1165 | | |
| 1165 | DRIVER_INIT_CALL(simpl156 | |
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | static READ32_HANDLER( chainrec_speedup_r ) |
| r1591 | r1592 | |
| 1174 | 1174 | static DRIVER_INIT (chainrec) |
| 1175 | 1175 | { |
| 1176 | 1176 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r ); |
| 1177 | | |
| 1177 | DRIVER_INIT_CALL(simpl156 | |
| 1178 | 1178 | simpl156_default_eeprom = chainrec_eeprom; |
| 1179 | 1179 | } |
| 1180 | 1180 | |
| r1591 | r1592 | |
| 1187 | 1187 | static DRIVER_INIT (prtytime) |
| 1188 | 1188 | { |
| 1189 | 1189 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r ); |
| 1190 | | |
| 1190 | DRIVER_INIT_CALL(simpl156 | |
| 1191 | 1191 | simpl156_default_eeprom = prtytime_eeprom; |
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | 1194 | static DRIVER_INIT (gangonta) |
| 1195 | 1195 | { |
| 1196 | 1196 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r ); |
| 1197 | | |
| 1197 | DRIVER_INIT_CALL(simpl156 | |
| 1198 | 1198 | simpl156_default_eeprom = gangonta_eeprom; |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| r1591 | r1592 | |
| 1208 | 1208 | static DRIVER_INIT (charlien) |
| 1209 | 1209 | { |
| 1210 | 1210 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, charlien_speedup_r ); |
| 1211 | | |
| 1211 | DRIVER_INIT_CALL(simpl156 | |
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | 1214 | static READ32_HANDLER( osman_speedup_r ) |
| r1591 | r1592 | |
| 1220 | 1220 | static DRIVER_INIT (osman) |
| 1221 | 1221 | { |
| 1222 | 1222 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r ); |
| 1223 | | |
| 1223 | DRIVER_INIT_CALL(simpl156 | |
| 1224 | 1224 | simpl156_default_eeprom = osman_eeprom; |
| 1225 | 1225 | |
| 1226 | 1226 | } |
| r1591 | r1592 | |
| 1228 | 1228 | static DRIVER_INIT (candance) |
| 1229 | 1229 | { |
| 1230 | 1230 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r ); |
| 1231 | | |
| 1231 | DRIVER_INIT_CALL(simpl156 | |
| 1232 | 1232 | simpl156_default_eeprom = candance_eeprom; |
| 1233 | 1233 | } |
| 1234 | 1234 |
| r1591 | r1592 | |
|---|---|---|
| 323 | 323 | |
| 324 | 324 | static TIMER_CALLBACK( irq_stop ) |
| 325 | 325 | { |
| 326 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 326 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | static INTERRUPT_GEN( vblank_callback_lgp ) |
| 330 | 330 | { |
| 331 | 331 | // NMI |
| 332 | //cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 332 | //cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 333 | 333 | |
| 334 | 334 | // IRQ |
| 335 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 335 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 336 | 336 | timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop); |
| 337 | 337 | |
| 338 | 338 | laserdisc_vsync(discinfo); |
| r1591 | r1592 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | static WRITE8_HANDLER( hcastle_soundirq_w ) |
| 39 | 39 | { |
| 40 | cpunum_set_input_line( 1, 0, HOLD_LINE ); | |
| 40 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static WRITE8_HANDLER( hcastle_coin_w ) |
| r1591 | r1592 | |
| 58 | 58 | AM_RANGE(0x0414, 0x0414) AM_READ(input_port_4_r) /* Dip 2 */ |
| 59 | 59 | AM_RANGE(0x0415, 0x0415) AM_READ(input_port_3_r) /* Dip 1 */ |
| 60 | 60 | AM_RANGE(0x0418, 0x0418) AM_READ(hcastle_gfxbank_r) |
| 61 | AM_RANGE(0x0600, 0x06ff) AM_READ( | |
| 61 | AM_RANGE(0x0600, 0x06ff) AM_READ(MRA8 | |
| 62 | 62 | AM_RANGE(0x0700, 0x5fff) AM_READ(MRA8_RAM) |
| 63 | 63 | AM_RANGE(0x6000, 0x7fff) AM_READ(MRA8_BANK1) |
| 64 | 64 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) |
| r1591 | r1592 | |
| 243 | 243 | |
| 244 | 244 | static void irqhandler(int linestate) |
| 245 | 245 | { |
| 246 | // cpunum_set_input_line(1,0,linestate); | |
| 246 | // cpunum_set_input_line(Machine, 1,0,linestate); | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | static void volume_callback(int v) |
| r1591 | r1592 | |
|---|---|---|
| 268 | 268 | static INTERRUPT_GEN( deadang_interrupt ) |
| 269 | 269 | { |
| 270 | 270 | if (cpu_getiloops()) |
| 271 | cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc8/4); /* VBL */ | |
| 271 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc8/4); /* VBL */ | |
| 272 | 272 | else |
| 273 | cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc4/4); /* VBL */ | |
| 273 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc4/4); /* VBL */ | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /* Machine Drivers */ |
| r1591 | r1592 | |
|---|---|---|
| 107 | 107 | static VIDEO_UPDATE( cliff ) |
| 108 | 108 | { |
| 109 | 109 | /* update the TMS9928A video */ |
| 110 | | |
| 110 | VIDEO_UPDATE_CALL(tms9928a | |
| 111 | 111 | |
| 112 | 112 | if (discinfo != NULL) |
| 113 | 113 | { |
| r1591 | r1592 | |
| 189 | 189 | static READ8_HANDLER( cliff_irq_ack_r ) |
| 190 | 190 | { |
| 191 | 191 | /* deassert IRQ on the CPU */ |
| 192 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 192 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 193 | 193 | |
| 194 | 194 | return 0x00; |
| 195 | 195 | } |
| r1591 | r1592 | |
| 249 | 249 | |
| 250 | 250 | /* if we have a valid code, trigger an IRQ */ |
| 251 | 251 | if ( phillips_code & 0x800000 ) |
| 252 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 252 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 253 | 253 | |
| 254 | 254 | timer_adjust(irq_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_zero); |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | static void vdp_interrupt (int state) |
| 258 | 258 | { |
| 259 | cpunum_set_input_line(0, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE ); | |
| 259 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE ); | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | * |
| 49 | 49 | *************************************/ |
| 50 | 50 | |
| 51 | static void update_irq_state( | |
| 51 | static void update_irq_state(running_machine *machine) | |
| 52 | 52 | { |
| 53 | 53 | int irq_lines = 0; |
| 54 | 54 | |
| r1591 | r1592 | |
| 58 | 58 | irq_lines |= 5; |
| 59 | 59 | |
| 60 | 60 | if (irq_lines) |
| 61 | cpunum_set_input_line(0, irq_lines, ASSERT_LINE); | |
| 61 | cpunum_set_input_line(machine, 0, irq_lines, ASSERT_LINE); | |
| 62 | 62 | else |
| 63 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 63 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | static void m68k_gen_int(int state) |
| 68 | 68 | { |
| 69 | 69 | tms_irq = state; |
| 70 | update_irq_state(); | |
| 70 | update_irq_state(Machine); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| r1591 | r1592 | |
| 81 | 81 | static MACHINE_RESET( artmagic ) |
| 82 | 82 | { |
| 83 | 83 | tms_irq = hack_irq = 0; |
| 84 | update_irq_state(); | |
| 84 | update_irq_state(machine); | |
| 85 | 85 | tlc34076_reset(6); |
| 86 | 86 | } |
| 87 | 87 | |
| r1591 | r1592 | |
| 137 | 137 | if (activecpu_get_pc() == 0x18c2) |
| 138 | 138 | { |
| 139 | 139 | hack_irq = 1; |
| 140 | update_irq_state(); | |
| 140 | update_irq_state(Machine); | |
| 141 | 141 | hack_irq = 0; |
| 142 | update_irq_state(); | |
| 142 | update_irq_state(Machine); | |
| 143 | 143 | } |
| 144 | 144 | return readinputport(0); |
| 145 | 145 | } |
| r1591 | r1592 | |
|---|---|---|
| 281 | 281 | static WRITE8_HANDLER( gekitsui_int_w ) |
| 282 | 282 | { |
| 283 | 283 | // if (errorlog) fprintf(errorlog,"%04x: CPU 2 causes NMI\n",cpu_get_pc()); |
| 284 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 284 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 285 | 285 | } |
| 286 | 286 | static WRITE8_HANDLER( gekitsui_int2_w ) // not used.. |
| 287 | 287 | { |
| 288 | 288 | // if (errorlog) fprintf(errorlog,"%04x: CPU 1 causes IRQ\n",cpu_get_pc()); |
| 289 | cpunum_set_input_line(1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 289 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 290 | 290 | } |
| 291 | 291 | #endif |
| 292 | 292 | |
| 293 | 293 | static WRITE8_HANDLER( gekitsui_sub_irq_ack ) |
| 294 | 294 | { |
| 295 | cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 295 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | #if 0 |
| 299 | 299 | static WRITE8_HANDLER( cntsteer_int_w ) |
| 300 | 300 | { |
| 301 | cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 301 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 302 | 302 | } |
| 303 | 303 | #endif |
| 304 | 304 | |
| r1591 | r1592 | |
| 310 | 310 | static WRITE8_HANDLER( zerotrgt_ctrl_w ) |
| 311 | 311 | { |
| 312 | 312 | logerror("CTRL: %04x: %04x: %04x\n",activecpu_get_pc(),offset,data); |
| 313 | // if (offset==0) cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 313 | // if (offset==0) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 314 | 314 | |
| 315 | 315 | // Wrong - bits 0 & 1 used on this |
| 316 | if (offset==1) cpunum_set_input_line(1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 317 | // if (offset==2) cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 316 | if (offset==1) cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 317 | // if (offset==2) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | #if 0 |
| r1591 | r1592 | |
| 468 | 468 | static int nmimask; |
| 469 | 469 | static WRITE8_HANDLER( nmimask_w ) { nmimask = data & 0x80; } |
| 470 | 470 | |
| 471 | static INTERRUPT_GEN ( sound_interrupt ) { if (!nmimask) cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); } | |
| 471 | static INTERRUPT_GEN ( sound_interrupt ) { if (!nmimask) cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); } | |
| 472 | 472 | |
| 473 | 473 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 474 | 474 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| r1591 | r1592 | |
|---|---|---|
| 203 | 203 | AM_RANGE(0x000000, 0x02ffff) AM_ROM |
| 204 | 204 | AM_RANGE(0x030000, 0x033fff) AM_RAM /* 68K and DSP shared RAM */ |
| 205 | 205 | AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 206 | AM_RANGE(0x050000, 0x050dff) AM_READWRITE( | |
| 206 | AM_RANGE(0x050000, 0x050dff) AM_READWRITE(MRA | |
| 207 | 207 | AM_RANGE(0x060000, 0x060001) AM_WRITE(twincobr_crtc_reg_sel_w) /* 6845 CRT controller */ |
| 208 | 208 | AM_RANGE(0x060002, 0x060003) AM_WRITE(twincobr_crtc_data_w) /* 6845 CRT controller */ |
| 209 | 209 | AM_RANGE(0x070000, 0x070003) AM_WRITE(twincobr_txscroll_w) /* text layer scroll */ |
| r1591 | r1592 | |
| 635 | 635 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 636 | 636 | static void irqhandler(int linestate) |
| 637 | 637 | { |
| 638 | cpunum_set_input_line(1,0,linestate); | |
| 638 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 273 | 273 | { |
| 274 | 274 | /* NMI handles start and coin inputs, origin unknown */ |
| 275 | 275 | if (cpu_getiloops()) |
| 276 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 276 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 277 | 277 | else |
| 278 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 278 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | static MACHINE_DRIVER_START( hexion ) |
| r1591 | r1592 | |
|---|---|---|
| 24 | 24 | static INTERRUPT_GEN( battlnts_interrupt ) |
| 25 | 25 | { |
| 26 | 26 | if (K007342_is_INT_enabled()) |
| 27 | cpunum_set_input_line(0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 27 | cpunum_set_input_line(machine, 0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | static WRITE8_HANDLER( battlnts_sh_irqtrigger_w ) |
| 31 | 31 | { |
| 32 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0xff); | |
| 32 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static WRITE8_HANDLER( battlnts_bankswitch_w ) |
| r1591 | r1592 | |
| 52 | 52 | AM_RANGE(0x0000, 0x1fff) AM_READ(K007342_r) /* Color RAM + Video RAM */ |
| 53 | 53 | AM_RANGE(0x2000, 0x21ff) AM_READ(K007420_r) /* Sprite RAM */ |
| 54 | 54 | AM_RANGE(0x2200, 0x23ff) AM_READ(K007342_scroll_r) /* Scroll RAM */ |
| 55 | AM_RANGE(0x2400, 0x24ff) AM_READ( | |
| 55 | AM_RANGE(0x2400, 0x24ff) AM_READ(MRA8 | |
| 56 | 56 | AM_RANGE(0x2e00, 0x2e00) AM_READ(input_port_0_r) /* DIPSW #1 */ |
| 57 | 57 | AM_RANGE(0x2e01, 0x2e01) AM_READ(input_port_4_r) /* 2P controls */ |
| 58 | 58 | AM_RANGE(0x2e02, 0x2e02) AM_READ(input_port_3_r) /* 1P controls */ |
| r1591 | r1592 | |
| 333 | 333 | static MACHINE_DRIVER_START( battlnts ) |
| 334 | 334 | |
| 335 | 335 | /* basic machine hardware */ |
| 336 | MDRV_CPU_ADD(HD6309, 3000000) /* ? */ | |
| 336 | MDRV_CPU_ADD(HD6309, 3000000*4) /* ? */ | |
| 337 | 337 | MDRV_CPU_PROGRAM_MAP(battlnts_readmem,battlnts_writemem) |
| 338 | 338 | MDRV_CPU_VBLANK_INT(battlnts_interrupt,1) |
| 339 | 339 |
| r1591 | r1592 | |
|---|---|---|
| 282 | 282 | if ((offset*2)==0x104) { dblwings_104_data = data; return; } // p1 inputs select screen OK |
| 283 | 283 | if ((offset*2)==0x200) { dblwings_200_data = data; return; } |
| 284 | 284 | if ((offset*2)==0x28c) { dblwings_28c_data = data; return; } |
| 285 | if ((offset*2)==0x380) { soundlatch_w(0,data&0xff); /*cpunum_set_input_line(1,0,HOLD_LINE);*/ return; } // sound write | |
| 285 | if ((offset*2)==0x380) { soundlatch_w(0,data&0xff); /*cpunum_set_input_line(Machine, 1,0,HOLD_LINE);*/ return; } // sound write | |
| 286 | 286 | if ((offset*2)==0x38e) { dblwings_38e_data = data; return; } |
| 287 | 287 | if ((offset*2)==0x406) { dblwings_406_data = data; return; } // p2 inputs select screen OK |
| 288 | 288 | if ((offset*2)==0x408) { dblwings_408_data = data; return; } // 3rd player 1st level? |
| r1591 | r1592 | |
| 528 | 528 | |
| 529 | 529 | static void sound_irq(int irq) |
| 530 | 530 | { |
| 531 | // cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 531 | // cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 532 | 532 | // mame_printf_debug("sound irq\n"); |
| 533 | 533 | } |
| 534 | 534 |
| r1591 | r1592 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | static MACHINE_RESET( galpani2 ) |
| 73 | 73 | { |
| 74 | | |
| 74 | MACHINE_RESET_CALL(kaneko16 | |
| 75 | 75 | |
| 76 | 76 | kaneko16_sprite_type = 1; |
| 77 | 77 | |
| r1591 | r1592 | |
| 464 | 464 | { |
| 465 | 465 | switch ( cpu_getiloops() ) |
| 466 | 466 | { |
| 467 | case 3: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 468 | case 2: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 469 | case 1: cpunum_set_input_line(0, 5, HOLD_LINE); break; // vblank? | |
| 470 | case 0: cpunum_set_input_line(0, 6, HOLD_LINE); break; // hblank? | |
| 467 | case 3: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 468 | case 2: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 469 | case 1: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; // vblank? | |
| 470 | case 0: cpunum_set_input_line(machine, 0, 6, HOLD_LINE); break; // hblank? | |
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | |
| r1591 | r1592 | |
| 478 | 478 | { |
| 479 | 479 | switch ( cpu_getiloops() ) |
| 480 | 480 | { |
| 481 | case 2: cpunum_set_input_line(1, 3, HOLD_LINE); break; | |
| 482 | case 1: cpunum_set_input_line(1, 4, HOLD_LINE); break; | |
| 483 | case 0: cpunum_set_input_line(1, 5, HOLD_LINE); break; | |
| 481 | case 2: cpunum_set_input_line(machine, 1, 3, HOLD_LINE); break; | |
| 482 | case 1: cpunum_set_input_line(machine, 1, 4, HOLD_LINE); break; | |
| 483 | case 0: cpunum_set_input_line(machine, 1, 5, HOLD_LINE); break; | |
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 |
| r1591 | r1592 | |
|---|---|---|
| 27 | 27 | if (cpu_getiloops() == 0) |
| 28 | 28 | { |
| 29 | 29 | if (K007121_ctrlram[0][0x07] & 0x02) |
| 30 | cpunum_set_input_line(0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 30 | cpunum_set_input_line(machine, 0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 31 | 31 | } |
| 32 | 32 | else if (cpu_getiloops() % 2) |
| 33 | 33 | { |
| 34 | 34 | if (K007121_ctrlram[0][0x07] & 0x01) |
| 35 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 35 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| r1591 | r1592 | |
| 62 | 62 | AM_RANGE(0x0a01, 0x0a01) AM_READ(input_port_4_r) |
| 63 | 63 | AM_RANGE(0x0b00, 0x0b00) AM_READ(input_port_3_r) |
| 64 | 64 | AM_RANGE(0x0d00, 0x0d1f) AM_READ(K051733_r) /* 051733 (protection) */ |
| 65 | AM_RANGE(0x1000, 0x10ff) AM_READ( | |
| 65 | AM_RANGE(0x1000, 0x10ff) AM_READ(MRA8 | |
| 66 | 66 | AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM) |
| 67 | 67 | AM_RANGE(0x2000, 0x3fff) AM_READ(MRA8_RAM) |
| 68 | 68 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1) |
| r1591 | r1592 | |
| 238 | 238 | static MACHINE_DRIVER_START( labyrunr ) |
| 239 | 239 | |
| 240 | 240 | /* basic machine hardware */ |
| 241 | MDRV_CPU_ADD(HD6309, 3000000) /* 24MHz/8? */ | |
| 241 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 24MHz/8? */ | |
| 242 | 242 | MDRV_CPU_PROGRAM_MAP(labyrunr_readmem,labyrunr_writemem) |
| 243 | 243 | MDRV_CPU_VBLANK_INT(labyrunr_interrupt,8) /* 1 IRQ + 4 NMI (generated by 007121) */ |
| 244 | 244 |
| r1591 | r1592 | |
|---|---|---|
| 91 | 91 | #include "driver.h" |
| 92 | 92 | #include "cpu/z80/z80.h" |
| 93 | 93 | #include "sound/ay8910.h" |
| 94 | #include "video/resnet.h" | |
| 94 | 95 | |
| 95 | //VIDEO_START( shougi ) | |
| 96 | //{ | |
| 97 | // generic_vh_start(); | |
| 98 | //} | |
| 99 | 96 | |
| 100 | #include "video/resnet.h" | |
| 101 | 97 | /*************************************************************************** |
| 102 | 98 | |
| 103 | 99 | Convert the color PROMs into a more useable format. |
| r1591 | r1592 | |
| 180 | 176 | *BITMAP_ADDR16(bitmap, 255-sy, 255-(sx*4 + x)) = color*4 + data; |
| 181 | 177 | } |
| 182 | 178 | } |
| 183 | /* copy the character mapped graphics */ | |
| 184 | //copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0); | |
| 179 | ||
| 185 | 180 | return 0; |
| 186 | 181 | } |
| 187 | 182 | |
| r1591 | r1592 | |
| 232 | 227 | static WRITE8_HANDLER( shougi_mcu_halt_off_w ) |
| 233 | 228 | { |
| 234 | 229 | /* logerror("mcu HALT OFF"); */ |
| 235 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 230 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 236 | 231 | } |
| 237 | 232 | |
| 238 | 233 | static WRITE8_HANDLER( shougi_mcu_halt_on_w ) |
| 239 | 234 | { |
| 240 | 235 | /* logerror("mcu HALT ON"); */ |
| 241 | cpunum_set_input_line(2, INPUT_LINE_HALT,ASSERT_LINE); | |
| 236 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT,ASSERT_LINE); | |
| 242 | 237 | } |
| 243 | 238 | |
| 244 | 239 | |
| r1591 | r1592 | |
| 249 | 244 | nmi_enabled = 0; /* disable NMIs */ |
| 250 | 245 | |
| 251 | 246 | /* NMI lines are tied together on both CPUs and connected to the LS74 /Q output */ |
| 252 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 253 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 247 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 248 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 254 | 249 | } |
| 255 | 250 | |
| 256 | 251 | static WRITE8_HANDLER( nmi_enable_w ) |
| r1591 | r1592 | |
| 263 | 258 | if ( nmi_enabled == 1 ) |
| 264 | 259 | { |
| 265 | 260 | /* NMI lines are tied together on both CPUs and connected to the LS74 /Q output */ |
| 266 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 267 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 261 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 262 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 268 | 263 | } |
| 269 | 264 | } |
| 270 | 265 | |
| r1591 | r1592 | |
| 385 | 380 | MDRV_PALETTE_LENGTH(32) |
| 386 | 381 | |
| 387 | 382 | MDRV_PALETTE_INIT(shougi) |
| 388 | MDRV_VIDEO_START(generic) | |
| 389 | 383 | MDRV_VIDEO_UPDATE(shougi) |
| 390 | 384 | |
| 391 | 385 | /* sound hardware */ |
| r1591 | r1592 | |
|---|---|---|
| 488 | 488 | |
| 489 | 489 | static void voodoo_vblank_0(int param) |
| 490 | 490 | { |
| 491 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 491 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | static void voodoo_vblank_1(int param) |
| 495 | 495 | { |
| 496 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 496 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | static void hornet_exit(running_machine *machine) |
| r1591 | r1592 | |
| 626 | 626 | { |
| 627 | 627 | if (data & 0x80) /* CG Board 1 IRQ Ack */ |
| 628 | 628 | { |
| 629 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 629 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 630 | 630 | } |
| 631 | 631 | if (data & 0x40) /* CG Board 0 IRQ Ack */ |
| 632 | 632 | { |
| 633 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 633 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 634 | 634 | } |
| 635 | 635 | set_cgboard_id((data >> 4) & 0x3); |
| 636 | 636 | } |
| r1591 | r1592 | |
| 874 | 874 | { |
| 875 | 875 | if (memory_region(REGION_USER3)) |
| 876 | 876 | memory_set_bankptr(1, memory_region(REGION_USER3)); |
| 877 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 877 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 878 | 878 | |
| 879 | 879 | if (memory_region(REGION_USER5)) |
| 880 | 880 | memory_set_bankptr(5, memory_region(REGION_USER5)); |
| r1591 | r1592 | |
| 924 | 924 | { |
| 925 | 925 | if (memory_region(REGION_USER3)) |
| 926 | 926 | memory_set_bankptr(1, memory_region(REGION_USER3)); |
| 927 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 928 | cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 927 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 928 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 929 | 929 | |
| 930 | 930 | if (memory_region(REGION_USER5)) |
| 931 | 931 | memory_set_bankptr(5, memory_region(REGION_USER5)); |
| r1591 | r1592 | |
| 1150 | 1150 | static void sound_irq_callback(int irq) |
| 1151 | 1151 | { |
| 1152 | 1152 | if (irq == 0) |
| 1153 | { | |
| 1154 | cpunum_set_input_line(1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 1155 | } | |
| 1153 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 1156 | 1154 | else |
| 1157 | { | |
| 1158 | cpunum_set_input_line(1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 1159 | } | |
| 1155 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 1160 | 1156 | } |
| 1161 | 1157 | |
| 1162 | 1158 | static UINT8 backup_ram[0x2000]; |
| r1591 | r1592 | |
|---|---|---|
| 54 | 54 | { |
| 55 | 55 | /* SLAM switch causes an NMI if it's pressed */ |
| 56 | 56 | if( (input_port_3_r(0) & 0x10) == 0 ) |
| 57 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 57 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | 58 | else |
| 59 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 59 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /**********************************************************/ |
| r1591 | r1592 | |
| 199 | 199 | AM_RANGE(0xe0c0, 0xe0c0) AM_WRITE(thief_context_bank_w) |
| 200 | 200 | ADDRESS_MAP_END |
| 201 | 201 | |
| 202 | static ADDRESS_MAP_START( | |
| 202 | static ADDRESS_MAP_START( io_ma | |
| 203 | 203 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 204 | AM_RANGE(0x31, 0x31) AM_READ(thief_io_r) // 8255 | |
| 205 | AM_RANGE(0x41, 0x41) AM_READ(AY8910_read_port_0_r) | |
| 206 | AM_RANGE(0x43, 0x43) AM_READ(AY8910_read_port_1_r) | |
| 207 | ADDRESS_MAP_END | |
| 208 | ||
| 209 | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) | |
| 210 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 211 | 204 | AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP) /* watchdog */ |
| 212 | 205 | AM_RANGE(0x10, 0x10) AM_WRITE(thief_video_control_w) |
| 213 | 206 | AM_RANGE(0x30, 0x30) AM_WRITE(thief_input_select_w) // 8255 |
| 207 | AM_RANGE(0x31, 0x31) AM_READ(thief_io_r) // 8255 | |
| 214 | 208 | AM_RANGE(0x33, 0x33) AM_WRITE(tape_control_w) |
| 215 | 209 | AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_control_port_0_w) |
| 216 | AM_RANGE(0x41, 0x41) AM_WRITE(AY8910_write_port_0_w) | |
| 210 | AM_RANGE(0x41, 0x41) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) | |
| 217 | 211 | AM_RANGE(0x42, 0x42) AM_WRITE(AY8910_control_port_1_w) |
| 218 | AM_RANGE(0x43, 0x43) AM_WRITE(AY8910_write_port_1_w) | |
| 212 | AM_RANGE(0x43, 0x43) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w) | |
| 219 | 213 | AM_RANGE(0x50, 0x50) AM_WRITE(thief_color_plane_w) |
| 220 | 214 | AM_RANGE(0x60, 0x6f) AM_WRITE(thief_vtcsel_w) |
| 221 | 215 | AM_RANGE(0x70, 0x7f) AM_WRITE(thief_color_map_w) |
| 222 | 216 | ADDRESS_MAP_END |
| 223 | 217 | |
| 224 | 218 | |
| 225 | ||
| 226 | 219 | /**********************************************************/ |
| 227 | 220 | |
| 228 | 221 | static INPUT_PORTS_START( sharkatt ) |
| r1591 | r1592 | |
| 470 | 463 | /* basic machine hardware */ |
| 471 | 464 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 472 | 465 | MDRV_CPU_PROGRAM_MAP(sharkatt_readmem,sharkatt_writemem) |
| 473 | MDRV_CPU_IO_MAP( | |
| 466 | MDRV_CPU_IO_MAP(io_ma | |
| 474 | 467 | MDRV_CPU_VBLANK_INT(thief_interrupt,1) |
| 475 | 468 | |
| 476 | 469 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
| 506 | 499 | /* basic machine hardware */ |
| 507 | 500 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 508 | 501 | MDRV_CPU_PROGRAM_MAP(thief_readmem,thief_writemem) |
| 509 | MDRV_CPU_IO_MAP( | |
| 502 | MDRV_CPU_IO_MAP(io_ma | |
| 510 | 503 | MDRV_CPU_VBLANK_INT(thief_interrupt,1) |
| 511 | 504 | |
| 512 | 505 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
| 542 | 535 | /* basic machine hardware */ |
| 543 | 536 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 544 | 537 | MDRV_CPU_PROGRAM_MAP(thief_readmem,thief_writemem) |
| 545 | MDRV_CPU_IO_MAP( | |
| 538 | MDRV_CPU_IO_MAP(io_ma | |
| 546 | 539 | MDRV_CPU_VBLANK_INT(thief_interrupt,1) |
| 547 | 540 | |
| 548 | 541 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
|---|---|---|
| 182 | 182 | /* sound commands. It's possible the NMI isn't really hooked up on the YM2608 */ |
| 183 | 183 | /* sound board. */ |
| 184 | 184 | if (param & 0x100) |
| 185 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 185 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | |
| r1591 | r1592 | |
| 201 | 201 | static WRITE8_HANDLER( pending_command_clear_w ) |
| 202 | 202 | { |
| 203 | 203 | pending_command = 0; |
| 204 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 204 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | |
| r1591 | r1592 | |
| 527 | 527 | |
| 528 | 528 | static void irqhandler(int irq) |
| 529 | 529 | { |
| 530 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 530 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 |
| r1591 | r1592 | |
|---|---|---|
| 173 | 173 | /* assert the IRQ if not already asserted */ |
| 174 | 174 | if (!irq_state) |
| 175 | 175 | { |
| 176 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 176 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 177 | 177 | irq_state = 1; |
| 178 | 178 | } |
| 179 | 179 | |
| r1591 | r1592 | |
| 248 | 248 | |
| 249 | 249 | static MACHINE_RESET( ccastles ) |
| 250 | 250 | { |
| 251 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 251 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 252 | 252 | irq_state = 0; |
| 253 | 253 | } |
| 254 | 254 | |
| r1591 | r1592 | |
| 264 | 264 | { |
| 265 | 265 | if (irq_state) |
| 266 | 266 | { |
| 267 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 267 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 268 | 268 | irq_state = 0; |
| 269 | 269 | } |
| 270 | 270 | } |
| r1591 | r1592 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | case 1: /* soundlatch_w */ |
| 66 | 66 | soundlatch_w(1,reg[1]&0xff); |
| 67 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 67 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 68 | 68 | break; |
| 69 | 69 | |
| 70 | 70 | case 2: |
| r1591 | r1592 | |
| 477 | 477 | |
| 478 | 478 | static void dd3_ymirq_handler(int irq) |
| 479 | 479 | { |
| 480 | cpunum_set_input_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 480 | cpunum_set_input_line(Machine, 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 489 | 489 | |
| 490 | 490 | static INTERRUPT_GEN( ddragon3_cpu_interrupt ) { /* 6:0x177e - 5:0x176a */ |
| 491 | 491 | if( cpu_getiloops() == 0 ){ |
| 492 | cpunum_set_input_line(0, 6, HOLD_LINE); /* VBlank */ | |
| 492 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); /* VBlank */ | |
| 493 | 493 | } |
| 494 | 494 | else { |
| 495 | cpunum_set_input_line(0, 5, HOLD_LINE); /* Input Ports */ | |
| 495 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); /* Input Ports */ | |
| 496 | 496 | } |
| 497 | 497 | } |
| 498 | 498 |
| r1591 | r1592 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | /* interrupts and watchdog are disabled during service mode */ |
| 111 | 111 | |
| 112 | watchdog_enable(!service_mode()); | |
| 112 | watchdog_enable(machine, !service_mode()); | |
| 113 | 113 | |
| 114 | 114 | if (!service_mode()) |
| 115 | { | |
| 116 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 117 | } | |
| 115 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 118 | 116 | } |
| 119 | 117 | |
| 120 | 118 |
| r1591 | r1592 | |
|---|---|---|
| 199 | 199 | { |
| 200 | 200 | /* Bit 13 = Resets the slave CPU */ |
| 201 | 201 | if ((data & 0x2000) && !(last & 0x2000)) |
| 202 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 202 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 203 | 203 | |
| 204 | 204 | /* Bits 14-15 = Coin counters */ |
| 205 | 205 | coin_counter_w(0, data & 0x8000); |
| r1591 | r1592 | |
| 214 | 214 | { |
| 215 | 215 | /* data is latched independently for both sound CPUs */ |
| 216 | 216 | master_sound_latch = slave_sound_latch = param; |
| 217 | cpunum_set_input_line(2, M6502_IRQ_LINE, ASSERT_LINE); | |
| 218 | cpunum_set_input_line(3, M6502_IRQ_LINE, ASSERT_LINE); | |
| 217 | cpunum_set_input_line(machine, 2, M6502_IRQ_LINE, ASSERT_LINE); | |
| 218 | cpunum_set_input_line(machine, 3, M6502_IRQ_LINE, ASSERT_LINE); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
| r1591 | r1592 | |
| 237 | 237 | { |
| 238 | 238 | /* bit 0 of the sound control determines if the NMI is actually delivered */ |
| 239 | 239 | if (sound_control & 0x01) |
| 240 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 240 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | |
| r1591 | r1592 | |
| 264 | 264 | static READ8_HANDLER( sound_master_latch_r ) |
| 265 | 265 | { |
| 266 | 266 | /* read latch and clear interrupt */ |
| 267 | cpunum_set_input_line(2, M6502_IRQ_LINE, CLEAR_LINE); | |
| 267 | cpunum_set_input_line(Machine, 2, M6502_IRQ_LINE, CLEAR_LINE); | |
| 268 | 268 | return master_sound_latch; |
| 269 | 269 | } |
| 270 | 270 | |
| r1591 | r1592 | |
| 272 | 272 | static READ8_HANDLER( sound_slave_latch_r ) |
| 273 | 273 | { |
| 274 | 274 | /* read latch and clear interrupt */ |
| 275 | cpunum_set_input_line(3, M6502_IRQ_LINE, CLEAR_LINE); | |
| 275 | cpunum_set_input_line(Machine, 3, M6502_IRQ_LINE, CLEAR_LINE); | |
| 276 | 276 | return slave_sound_latch; |
| 277 | 277 | } |
| 278 | 278 | |
| r1591 | r1592 | |
| 288 | 288 | static READ8_HANDLER( sound_nmi_to_slave_r ) |
| 289 | 289 | { |
| 290 | 290 | /* a read from here triggers an NMI pulse to the slave */ |
| 291 | cpunum_set_input_line(3, INPUT_LINE_NMI, PULSE_LINE); | |
| 291 | cpunum_set_input_line(Machine, 3, INPUT_LINE_NMI, PULSE_LINE); | |
| 292 | 292 | return 0xff; |
| 293 | 293 | } |
| 294 | 294 |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /* watchdog is disabled during service mode */ |
| 33 | watchdog_enable(readinputport(0) & 0x20); | |
| 33 | watchdog_enable(machine, readinputport(0) & 0x20); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 |
| r1591 | r1592 | |
|---|---|---|
| 201 | 201 | static WRITE8_HANDLER( discoboy_port_03_w ) // sfx? (to sound cpu) |
| 202 | 202 | { |
| 203 | 203 | // printf("unk discoboy_port_03_w %02x\n",data); |
| 204 | // cpunum_set_input_line(1,INPUT_LINE_NMI,HOLD_LINE); | |
| 204 | // cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,HOLD_LINE); | |
| 205 | 205 | soundlatch_w(0,data); |
| 206 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 206 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static WRITE8_HANDLER( discoboy_port_06_w ) |
| r1591 | r1592 | |
|---|---|---|
| 901 | 901 | |
| 902 | 902 | static void set_gate_a20(int a20) |
| 903 | 903 | { |
| 904 | cpunum_set_input_line(0, INPUT_LINE_A20, a20); | |
| 904 | cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20); | |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | 907 | static void keyboard_interrupt(int state) |
| r1591 | r1592 | |
|---|---|---|
| 200 | 200 | MDRV_PALETTE_LENGTH(256) |
| 201 | 201 | |
| 202 | 202 | MDRV_PALETTE_INIT(ambush) |
| 203 | MDRV_VIDEO_START(generic_bitmapped) | |
| 204 | 203 | MDRV_VIDEO_UPDATE(ambush) |
| 205 | 204 | |
| 206 | 205 | /* sound hardware */ |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | static INTERRUPT_GEN( orbit_interrupt ) |
| 31 | 31 | { |
| 32 | 32 | if (orbit_nmi_enable) |
| 33 | { | |
| 34 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 35 | } | |
| 33 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 36 | 34 | } |
| 37 | 35 | |
| 38 | 36 |
| r1591 | r1592 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | static TIMER_CALLBACK( irq5_gen ) |
| 123 | 123 | { |
| 124 | cpunum_set_input_line(0, R3000_IRQ5, ASSERT_LINE); | |
| 124 | cpunum_set_input_line(machine, 0, R3000_IRQ5, ASSERT_LINE); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | static INTERRUPT_GEN( irq4_gen ) |
| 129 | 129 | { |
| 130 | cpunum_set_input_line(0, R3000_IRQ4, ASSERT_LINE); | |
| 130 | cpunum_set_input_line(machine, 0, R3000_IRQ4, ASSERT_LINE); | |
| 131 | 131 | timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, irq5_gen); |
| 132 | 132 | } |
| 133 | 133 |
| r1591 | r1592 | |
|---|---|---|
| 840 | 840 | |
| 841 | 841 | static READ32_HANDLER( spi_int_r ) |
| 842 | 842 | { |
| 843 | cpunum_set_input_line( 0, 0,CLEAR_LINE ); | |
| 843 | cpunum_set_input_line(Machine, 0, 0,CLEAR_LINE ); | |
| 844 | 844 | return 0xffffffff; |
| 845 | 845 | } |
| 846 | 846 | |
| r1591 | r1592 | |
| 912 | 912 | if( !(mem_mask & 0x000000ff) ) { |
| 913 | 913 | if( data & 0x1 ) { |
| 914 | 914 | z80_prg_fifo_pos = 0; |
| 915 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE ); | |
| 915 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE ); | |
| 916 | 916 | } else { |
| 917 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 917 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 918 | 918 | } |
| 919 | 919 | } |
| 920 | 920 | } |
| r1591 | r1592 | |
| 1107 | 1107 | static void irqhandler(int state) |
| 1108 | 1108 | { |
| 1109 | 1109 | if (state) |
| 1110 | { | |
| 1111 | cpunum_set_input_line_and_vector(1, 0, ASSERT_LINE, 0xd7); // IRQ is RST10 | |
| 1112 | } | |
| 1110 | cpunum_set_input_line_and_vector(Machine, 1, 0, ASSERT_LINE, 0xd7); // IRQ is RST10 | |
| 1113 | 1111 | else |
| 1114 | { | |
| 1115 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 1116 | } | |
| 1112 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 1117 | 1113 | } |
| 1118 | 1114 | |
| 1119 | 1115 | static const struct YMF271interface ymf271_interface = |
| r1591 | r1592 | |
| 1731 | 1727 | |
| 1732 | 1728 | static INTERRUPT_GEN( spi_interrupt ) |
| 1733 | 1729 | { |
| 1734 | cpunum_set_input_line( 0, 0, ASSERT_LINE ); | |
| 1730 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE ); | |
| 1735 | 1731 | } |
| 1736 | 1732 | |
| 1737 | 1733 | static int spi_irq_callback(int irq) |
| r1591 | r1592 | |
| 1749 | 1745 | UINT8 *rombase = memory_region(REGION_USER1); |
| 1750 | 1746 | UINT8 flash_data = rombase[0x1ffffc]; |
| 1751 | 1747 | |
| 1752 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 1748 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 1753 | 1749 | cpunum_set_irq_callback(0, spi_irq_callback); |
| 1754 | 1750 | |
| 1755 | 1751 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sound_fifo_r); |
| r1591 | r1592 | |
|---|---|---|
| 220 | 220 | coin_counter_w(0, ~data & 0x0001); |
| 221 | 221 | coin_counter_w(1, ~data & 0x0002); |
| 222 | 222 | |
| 223 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE); | |
| 223 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE); | |
| 224 | 224 | |
| 225 | 225 | /* bits 10-15 are counted down over time */ |
| 226 | 226 | if (data & 0x0400) amerdart_iop_echo = 1; |
| r1591 | r1592 | |
| 233 | 233 | iop_answer = iop_cmd; |
| 234 | 234 | if (amerdart_iop_echo && iop_cmd != 0x19) |
| 235 | 235 | { |
| 236 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 236 | cpunum_set_input_line(machine, 0, 1, ASSERT_LINE); | |
| 237 | 237 | return; |
| 238 | 238 | } |
| 239 | 239 | amerdart_iop_echo = 0; |
| r1591 | r1592 | |
| 271 | 271 | break; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 274 | cpunum_set_input_line(machine, 0, 1, ASSERT_LINE); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| r1591 | r1592 | |
| 297 | 297 | coin_counter_w(0, ~data & 0x0001); |
| 298 | 298 | coin_counter_w(1, ~data & 0x0002); |
| 299 | 299 | |
| 300 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE); | |
| 300 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE); | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| r1591 | r1592 | |
| 313 | 313 | { |
| 314 | 314 | iop_cmd = param; |
| 315 | 315 | cmd_pending = 1; |
| 316 | cpunum_set_input_line(1, 0, HOLD_LINE); /* ??? I have no idea who should generate this! */ | |
| 316 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); /* ??? I have no idea who should generate this! */ | |
| 317 | 317 | /* the DSP polls the status bit so it isn't strictly */ |
| 318 | 318 | /* necessary to also have an IRQ */ |
| 319 | 319 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); |
| r1591 | r1592 | |
| 330 | 330 | static READ16_HANDLER( coolpool_iop_r ) |
| 331 | 331 | { |
| 332 | 332 | logerror("%08x:IOP read %04x\n",activecpu_get_pc(),iop_answer); |
| 333 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 333 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE); | |
| 334 | 334 | |
| 335 | 335 | return iop_answer; |
| 336 | 336 | } |
| r1591 | r1592 | |
| 356 | 356 | { |
| 357 | 357 | logerror("%08x:IOP answer %04x\n",activecpu_get_pc(),data); |
| 358 | 358 | iop_answer = data; |
| 359 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 359 | cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE); | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 |
| r1591 | r1592 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | static void lrq_callback(int state) |
| 138 | 138 | { |
| 139 | //cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 140 | cpunum_set_input_line(1, INPUT_LINE_NMI, state); | |
| 139 | //cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 140 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, state); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static ADDRESS_MAP_START( sauro_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
| 356 | 356 | |
| 357 | 357 | static INTERRUPT_GEN( sauro_interrupt ) |
| 358 | 358 | { |
| 359 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 359 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | static MACHINE_DRIVER_START( tecfri ) |
| r1591 | r1592 | |
| 453 | 453 | |
| 454 | 454 | ROM_REGION( 0x10000, REGION_SOUND1, 0 ) |
| 455 | 455 | /* SP0256 mask rom */ |
| 456 | ROM_LOAD( "sp0256 | |
| 456 | ROM_LOAD( "sp0256-al2.bin", 0x1000, 0x0800, | |
| 457 | 457 | ROM_END |
| 458 | 458 | |
| 459 | 459 | ROM_START( trckydoc ) |
| r1591 | r1592 | |
|---|---|---|
| 274 | 274 | int bit = !BIT(offset,11); |
| 275 | 275 | cpu_interrupt_enable(0,bit); |
| 276 | 276 | if (!bit) |
| 277 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 277 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | static WRITE8_HANDLER( gaplus_irq_3_ctrl_w ) |
| r1591 | r1592 | |
| 282 | 282 | int bit = !BIT(offset,13); |
| 283 | 283 | cpu_interrupt_enable(2,bit); |
| 284 | 284 | if (!bit) |
| 285 | cpunum_set_input_line(2, 0, CLEAR_LINE); | |
| 285 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | static WRITE8_HANDLER( gaplus_irq_2_ctrl_w ) |
| r1591 | r1592 | |
| 290 | 290 | int bit = offset & 1; |
| 291 | 291 | cpu_interrupt_enable(1,bit); |
| 292 | 292 | if (!bit) |
| 293 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 293 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | static WRITE8_HANDLER( gaplus_sreset_w ) |
| 297 | 297 | { |
| 298 | 298 | int bit = !BIT(offset,11); |
| 299 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 300 | cpunum_set_input_line(2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 299 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 300 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 301 | 301 | mappy_sound_enable(bit); |
| 302 | 302 | } |
| 303 | 303 | |
| r1591 | r1592 | |
| 313 | 313 | { |
| 314 | 314 | /* on reset, VINTON is reset, while the other flags don't seem to be affected */ |
| 315 | 315 | cpu_interrupt_enable(1,0); |
| 316 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 316 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | static INTERRUPT_GEN( gaplus_interrupt_1 ) |
| 320 | 320 | { |
| 321 | 321 | irq0_line_assert(machine, cpunum); // this also checks if irq is enabled - IMPORTANT! |
| 322 | // so don't replace with cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 322 | // so don't replace with cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 323 | 323 | |
| 324 | 324 | namcoio_set_irq_line(0,PULSE_LINE); |
| 325 | 325 | namcoio_set_irq_line(1,PULSE_LINE); |
| r1591 | r1592 | |
|---|---|---|
| 33 | 33 | static INTERRUPT_GEN( drmicro_interrupt ) |
| 34 | 34 | { |
| 35 | 35 | if (drmicro_nmi_enable) |
| 36 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 36 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | static WRITE8_HANDLER( nmi_enable_w ) |
| r1591 | r1592 | |
|---|---|---|
| 253 | 253 | |
| 254 | 254 | static MACHINE_DRIVER_START( twinsa ) |
| 255 | 255 | /* basic machine hardware */ |
| 256 | MDRV_CPU_ADD(V30, | |
| 256 | MDRV_CPU_ADD(V30, XTAL_16MHz/2) /* verified on pcb */ | |
| 257 | 257 | MDRV_CPU_PROGRAM_MAP(twins_map, 0) |
| 258 | 258 | MDRV_CPU_IO_MAP(twinsa_io,0) |
| 259 | 259 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) |
| r1591 | r1592 | |
| 274 | 274 | /* sound hardware */ |
| 275 | 275 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 276 | 276 | |
| 277 | MDRV_SOUND_ADD(AY8910, | |
| 277 | MDRV_SOUND_ADD(AY8910, XTAL_16MHz/8) /* verified on pcb */ | |
| 278 | 278 | MDRV_SOUND_CONFIG(ay8910_interface) |
| 279 | 279 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 280 | 280 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | static MACHINE_RESET( system1_banked ) |
| 35 | 35 | { |
| 36 | | |
| 36 | MACHINE_RESET_CALL(system1 | |
| 37 | 37 | memory_configure_bank(1, 0, 4, memory_region(REGION_CPU1) + 0x10000, 0x4000); |
| 38 | 38 | } |
| 39 | 39 | |
| r1591 | r1592 | |
| 111 | 111 | static WRITE8_HANDLER( system1_soundport_w ) |
| 112 | 112 | { |
| 113 | 113 | soundlatch_w(0,data); |
| 114 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 114 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 115 | 115 | /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */ |
| 116 | 116 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); |
| 117 | 117 | } |
| r1591 | r1592 | |
|---|---|---|
| 350 | 350 | static INTERRUPT_GEN( cultures_interrupt ) |
| 351 | 351 | { |
| 352 | 352 | if (irq_enable) |
| 353 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 353 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 |
| r1591 | r1592 | |
|---|---|---|
| 333 | 333 | |
| 334 | 334 | static void irqhandler(int irq) |
| 335 | 335 | { |
| 336 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 336 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | static void ctc0_interrupt(int state) |
| 188 | 188 | { |
| 189 | cpunum_set_input_line(1, 0, state); | |
| 189 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static z80ctc_interface ctc_intf = |
| r1591 | r1592 | |
| 836 | 836 | |
| 837 | 837 | static INTERRUPT_GEN( niyanpai_interrupt ) |
| 838 | 838 | { |
| 839 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 839 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | static const struct z80_irq_daisy_chain daisy_chain_sound[] = |
| r1591 | r1592 | |
|---|---|---|
| 33 | 33 | static INTERRUPT_GEN( exedexes_interrupt ) |
| 34 | 34 | { |
| 35 | 35 | if (cpu_getiloops() != 0) |
| 36 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 36 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 37 | 37 | else |
| 38 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ | |
| 38 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r1591 | r1592 | |
|---|---|---|
| 143 | 143 | int scanline = param; |
| 144 | 144 | |
| 145 | 145 | /* IRQ is set by /32V */ |
| 146 | cpunum_set_input_line(0, M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 147 | cpunum_set_input_line(1, M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 146 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 147 | cpunum_set_input_line(machine, 1, M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 148 | 148 | |
| 149 | 149 | /* set up for the next */ |
| 150 | 150 | scanline += 32; |
| r1591 | r1592 | |
| 156 | 156 | |
| 157 | 157 | static WRITE8_HANDLER( main_irq_ack_w ) |
| 158 | 158 | { |
| 159 | cpunum_set_input_line(0, M6502_IRQ_LINE, CLEAR_LINE); | |
| 159 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, CLEAR_LINE); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| 163 | 163 | static WRITE8_HANDLER( sound_irq_ack_w ) |
| 164 | 164 | { |
| 165 | cpunum_set_input_line(1, M6502_IRQ_LINE, CLEAR_LINE); | |
| 165 | cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, CLEAR_LINE); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| r1591 | r1592 | |
| 223 | 223 | |
| 224 | 224 | static WRITE8_HANDLER( sound_reset_w ) |
| 225 | 225 | { |
| 226 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 226 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 |
| r1591 | r1592 | |
|---|---|---|
| 261 | 261 | */ |
| 262 | 262 | /////////////////////////////////////////////////////////////////////////// |
| 263 | 263 | |
| 264 | static void send_to_adder(int data) | |
| 264 | static void send_to_adder(running_machine *machine, int data) | |
| 265 | 265 | { |
| 266 | 266 | adder2_data_from_sc2 = 1; |
| 267 | 267 | adder2_sc2data = data; |
| 268 | 268 | |
| 269 | 269 | adder2_acia_triggered = 1; |
| 270 | cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE ); | |
| 270 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE ); | |
| 271 | 271 | |
| 272 | 272 | LOG_SERIAL(("sadder %02X (%c)\n",data, data )); |
| 273 | 273 | } |
| r1591 | r1592 | |
| 518 | 518 | irq_timer_stat = 0x01; |
| 519 | 519 | irq_status = 0x02; |
| 520 | 520 | |
| 521 | cpunum_set_input_line(0, M6809_IRQ_LINE, PULSE_LINE ); | |
| 521 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, PULSE_LINE ); | |
| 522 | 522 | } |
| 523 | 523 | } |
| 524 | 524 | |
| r1591 | r1592 | |
| 680 | 680 | } |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | if ( data & 0x1F ) cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE ); | |
| 683 | if ( data & 0x1F ) cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE ); | |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | /////////////////////////////////////////////////////////////////////////// |
| r1591 | r1592 | |
| 763 | 763 | |
| 764 | 764 | if ( old != volume_override ) |
| 765 | 765 | { |
| 766 | float percent = volume_override?1.0:(32-global_volume)/32.0; | |
| 766 | float percent = volume_override? 1.0f : (32-global_volume)/32.0f; | |
| 767 | 767 | |
| 768 | 768 | sndti_set_output_gain(SOUND_YM2413, 0, 0, percent); |
| 769 | 769 | sndti_set_output_gain(SOUND_YM2413, 0, 1, percent); |
| r1591 | r1592 | |
| 875 | 875 | } |
| 876 | 876 | |
| 877 | 877 | { |
| 878 | float percent = volume_override?1.0:(32-global_volume)/32.0; | |
| 878 | float percent = volume_override ? 1.0f : (32-global_volume)/32.0f; | |
| 879 | 879 | |
| 880 | 880 | sndti_set_output_gain(SOUND_YM2413, 0, 0, percent); |
| 881 | 881 | sndti_set_output_gain(SOUND_YM2413, 0, 1, percent); |
| r1591 | r1592 | |
| 1141 | 1141 | |
| 1142 | 1142 | static WRITE8_HANDLER( vid_uart_tx_w ) |
| 1143 | 1143 | { |
| 1144 | send_to_adder(data); | |
| 1144 | send_to_adder(Machine, data); | |
| 1145 | 1145 | } |
| 1146 | 1146 | |
| 1147 | 1147 | /////////////////////////////////////////////////////////////////////////// |
| r1591 | r1592 | |
| 1554 | 1554 | static MACHINE_RESET( init ) |
| 1555 | 1555 | { |
| 1556 | 1556 | // reset adder2 |
| 1557 | | |
| 1557 | MACHINE_RESET_CALL(adder2 | |
| 1558 | 1558 | |
| 1559 | 1559 | // reset the board ////////////////////////////////////////////////////// |
| 1560 | 1560 | |
| r1591 | r1592 | |
| 1571 | 1571 | output_set_value("door",( Scorpion2_GetSwitchState(sc2_door_state>>4, sc2_door_state & 0x0F) ) ); |
| 1572 | 1572 | } |
| 1573 | 1573 | |
| 1574 | return | |
| 1574 | return VIDEO_UPDATE_CALL(adder2 | |
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | // memory map for scorpion2 board video addon ///////////////////////////// |
| r1591 | r1592 | |
|---|---|---|
| 449 | 449 | |
| 450 | 450 | static TIMER_CALLBACK( interrupt_callback ) |
| 451 | 451 | { |
| 452 | cpunum_set_input_line(0,param,HOLD_LINE); | |
| 452 | cpunum_set_input_line(machine, 0,param,HOLD_LINE); | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | static MACHINE_RESET(skns) |
| r1591 | r1592 | |
| 474 | 474 | interrupt = 1; // SPC |
| 475 | 475 | break; |
| 476 | 476 | } |
| 477 | cpunum_set_input_line(0,interrupt,HOLD_LINE); | |
| 477 | cpunum_set_input_line(machine, 0,interrupt,HOLD_LINE); | |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | /********************************************************************************** |
| r1591 | r1592 | |
| 740 | 740 | if(((mem_mask & 0x0000ff00) == 0)) |
| 741 | 741 | { /* Interrupt Clear, do we need these? */ |
| 742 | 742 | /* if(data&0x01) |
| 743 | cpunum_set_input_line(0,1,CLEAR_LINE); | |
| 743 | cpunum_set_input_line(Machine, 0,1,CLEAR_LINE); | |
| 744 | 744 | if(data&0x02) |
| 745 | cpunum_set_input_line(0,3,CLEAR_LINE); | |
| 745 | cpunum_set_input_line(Machine, 0,3,CLEAR_LINE); | |
| 746 | 746 | if(data&0x04) |
| 747 | cpunum_set_input_line(0,5,CLEAR_LINE); | |
| 747 | cpunum_set_input_line(Machine, 0,5,CLEAR_LINE); | |
| 748 | 748 | if(data&0x08) |
| 749 | cpunum_set_input_line(0,7,CLEAR_LINE); | |
| 749 | cpunum_set_input_line(Machine, 0,7,CLEAR_LINE); | |
| 750 | 750 | if(data&0x10) |
| 751 | cpunum_set_input_line(0,9,CLEAR_LINE); | |
| 751 | cpunum_set_input_line(Machine, 0,9,CLEAR_LINE); | |
| 752 | 752 | if(data&0x20) |
| 753 | cpunum_set_input_line(0,0xb,CLEAR_LINE); | |
| 753 | cpunum_set_input_line(Machine, 0,0xb,CLEAR_LINE); | |
| 754 | 754 | if(data&0x40) |
| 755 | cpunum_set_input_line(0,0xd,CLEAR_LINE); | |
| 755 | cpunum_set_input_line(Machine, 0,0xd,CLEAR_LINE); | |
| 756 | 756 | if(data&0x80) |
| 757 | cpunum_set_input_line(0,0xf,CLEAR_LINE);*/ | |
| 757 | cpunum_set_input_line(Machine, 0,0xf,CLEAR_LINE);*/ | |
| 758 | 758 | |
| 759 | 759 | /* idle skip for vblokbrk/sarukani, i can't find a better place to put it :-( but i think it works ok unless its making the game too fast */ |
| 760 | 760 | if (activecpu_get_pc()==0x04013B44) |
| r1591 | r1592 | |
|---|---|---|
| 716 | 716 | |
| 717 | 717 | static INPUT_PORTS_START( gundamex ) |
| 718 | 718 | PORT_START_TAG("IN0") // $600000.w |
| 719 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Demo_Sounds ) ) | |
| 719 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") | |
| 720 | 720 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 721 | 721 | PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) |
| 722 | PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Difficulty ) ) | |
| 722 | PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:2,3") | |
| 723 | 723 | PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) |
| 724 | 724 | PORT_DIPSETTING( 0x0006, DEF_STR( Normal ) ) |
| 725 | 725 | PORT_DIPSETTING( 0x0002, DEF_STR( Hard ) ) |
| 726 | 726 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 727 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 728 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 729 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 730 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) ) | |
| 727 | PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" ) /* Listed as "Unused" */ | |
| 728 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:5") | |
| 731 | 729 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 732 | 730 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 733 | PORT_DIPNAME( 0x0020, 0x0020, "Freeze" ) /* Listed as "Unused" */ | |
| 731 | PORT_DIPNAME( 0x0020, 0x0020, "Freeze" ) PORT_DIPLOCATION("SW1:6") /* Listed as "Unused" */ | |
| 734 | 732 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 735 | 733 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 736 | PORT_DIPNAME( 0x0040, 0x0040, "Show Targets" ) /* Listed as "Unused" */ | |
| 734 | PORT_DIPNAME( 0x0040, 0x0040, "Show Targets" ) PORT_DIPLOCATION("SW1:7") /* Listed as "Unused" */ | |
| 737 | 735 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 738 | 736 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 739 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) | |
| 740 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 737 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) | |
| 738 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 741 | 739 | |
| 742 | 740 | PORT_START_TAG("IN1") // $600002.w |
| 743 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) | |
| 741 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") | |
| 744 | 742 | PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) |
| 745 | 743 | PORT_DIPSETTING( 0x0001, DEF_STR( 3C_1C ) ) |
| 746 | 744 | PORT_DIPSETTING( 0x0002, DEF_STR( 2C_1C ) ) |
| r1591 | r1592 | |
| 749 | 747 | PORT_DIPSETTING( 0x0005, DEF_STR( 1C_3C ) ) |
| 750 | 748 | PORT_DIPSETTING( 0x0003, DEF_STR( 1C_4C ) ) |
| 751 | 749 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_5C ) ) |
| 752 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) | |
| 750 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6") | |
| 753 | 751 | PORT_DIPSETTING( 0x0038, DEF_STR( 1C_1C ) ) |
| 754 | 752 | PORT_DIPSETTING( 0x0010, DEF_STR( 2C_3C ) ) |
| 755 | 753 | PORT_DIPSETTING( 0x0000, "3 Coins/5 Credits" ) |
| r1591 | r1592 | |
| 758 | 756 | PORT_DIPSETTING( 0x0028, DEF_STR( 1C_3C ) ) |
| 759 | 757 | PORT_DIPSETTING( 0x0018, DEF_STR( 1C_4C ) ) |
| 760 | 758 | PORT_DIPSETTING( 0x0020, DEF_STR( 1C_5C ) ) |
| 761 | PORT_DIPNAME( 0x0040, 0x0040, "Debug Mode" ) | |
| 759 | PORT_DIPNAME( 0x0040, 0x0040, "Debug Mode" ) PORT_DIPLOCATION("SW2:7") | |
| 762 | 760 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 763 | 761 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 764 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) | |
| 762 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8") | |
| 765 | 763 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 766 | 764 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 767 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 765 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 768 | 766 | |
| 769 | 767 | PORT_START_TAG("IN2") // $700000.w |
| 770 | 768 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| r1591 | r1592 | |
| 789 | 787 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 790 | 788 | |
| 791 | 789 | PORT_START_TAG("IN4") // $700004.w |
| 792 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 793 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 794 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 795 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 796 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //jumper pad | |
| 790 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 791 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 792 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 793 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 794 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //jumper pad | |
| 797 | 795 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Language ) ) //jumper pad |
| 798 | 796 | PORT_DIPSETTING( 0x0020, DEF_STR( English ) ) |
| 799 | 797 | PORT_DIPSETTING( 0x0000, DEF_STR( Japanese ) ) |
| 800 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 801 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 802 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 798 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 799 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 800 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 803 | 801 | |
| 804 | 802 | PORT_START_TAG("IN5") // $700008.w |
| 805 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) | |
| 806 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 807 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 808 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 809 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 810 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 811 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 812 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 813 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 803 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) | |
| 804 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 805 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 806 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 807 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 808 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 809 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 810 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 811 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 814 | 812 | |
| 815 | 813 | PORT_START_TAG("IN6") // $70000a.w |
| 816 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) | |
| 817 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 818 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 819 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 820 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 821 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 822 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 823 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 824 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 814 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) | |
| 815 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 816 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 817 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 818 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 819 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 820 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 821 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 822 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 825 | 823 | INPUT_PORTS_END |
| 826 | 824 | |
| 827 | 825 | /*************************************************************************** |
| r1591 | r1592 | |
| 830 | 828 | |
| 831 | 829 | static INPUT_PORTS_START( grdians ) |
| 832 | 830 | PORT_START_TAG("IN0") // $600000.w |
| 833 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) | |
| 831 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:1,2") | |
| 834 | 832 | PORT_DIPSETTING( 0x0002, DEF_STR( Easy ) ) // 0 |
| 835 | 833 | PORT_DIPSETTING( 0x0003, DEF_STR( Normal ) ) // 1 |
| 836 | 834 | PORT_DIPSETTING( 0x0001, DEF_STR( Hard ) ) // 2 |
| 837 | 835 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) // 3 |
| 838 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) | |
| 836 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") | |
| 839 | 837 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 840 | 838 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 841 | PORT_DIPNAME( 0x0008, 0x0008, "Title" ) | |
| 839 | PORT_DIPNAME( 0x0008, 0x0008, "Title" ) PORT_DIPLOCATION("SW1:4") | |
| 842 | 840 | PORT_DIPSETTING( 0x0008, "Guardians" ) |
| 843 | 841 | PORT_DIPSETTING( 0x0000, "Denjin Makai II" ) |
| 844 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) | |
| 842 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") | |
| 845 | 843 | PORT_DIPSETTING( 0x0020, "1" ) |
| 846 | 844 | PORT_DIPSETTING( 0x0030, "2" ) |
| 847 | 845 | PORT_DIPSETTING( 0x0010, "3" ) |
| 848 | 846 | PORT_DIPSETTING( 0x0000, "4" ) |
| 849 | PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) | |
| 850 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Demo_Sounds ) ) | |
| 847 | PORT_SERVICE_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" ) /* NOTE: Test mode shows player 3 & 4 controls, but it's a two player game */ | |
| 848 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") | |
| 851 | 849 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 852 | 850 | PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) |
| 853 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 851 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 854 | 852 | |
| 855 | 853 | PORT_START_TAG("IN1") // $600002.w |
| 856 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) | |
| 854 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3,4") | |
| 857 | 855 | PORT_DIPSETTING( 0x0002, DEF_STR( 4C_1C ) ) |
| 858 | 856 | PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) |
| 859 | 857 | PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) |
| r1591 | r1592 | |
| 870 | 868 | PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) |
| 871 | 869 | PORT_DIPSETTING( 0x0009, DEF_STR( 1C_7C ) ) |
| 872 | 870 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 873 | PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) ) | |
| 871 | PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,6,7,8") | |
| 874 | 872 | PORT_DIPSETTING( 0x0020, DEF_STR( 4C_1C ) ) |
| 875 | 873 | PORT_DIPSETTING( 0x0050, DEF_STR( 3C_1C ) ) |
| 876 | 874 | PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) |
| r1591 | r1592 | |
| 887 | 885 | PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_6C ) ) |
| 888 | 886 | PORT_DIPSETTING( 0x0090, DEF_STR( 1C_7C ) ) |
| 889 | 887 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 888 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 890 | 889 | |
| 891 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 892 | ||
| 893 | 890 | PORT_START_TAG("IN2") // $700000.w |
| 894 | 891 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| 895 | 892 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) |
| r1591 | r1592 | |
| 899 | 896 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 900 | 897 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 901 | 898 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 902 | ||
| 903 | 899 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 904 | 900 | |
| 905 | 901 | PORT_START_TAG("IN3") // $700002.w |
| r1591 | r1592 | |
| 911 | 907 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 912 | 908 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 913 | 909 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) |
| 914 | ||
| 915 | 910 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 916 | 911 | |
| 917 | 912 | PORT_START_TAG("IN4") // $700004.w |
| 918 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 919 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 920 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 921 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) | |
| 922 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 923 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 924 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 925 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 926 | ||
| 913 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 914 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 915 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 916 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) | |
| 917 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 918 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 919 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 920 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 927 | 921 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 928 | 922 | INPUT_PORTS_END |
| 929 | 923 | |
| r1591 | r1592 | |
| 934 | 928 | |
| 935 | 929 | static INPUT_PORTS_START( mj4simai ) |
| 936 | 930 | PORT_START_TAG("IN0") // $600300.w |
| 937 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) | |
| 931 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") | |
| 938 | 932 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) |
| 939 | 933 | PORT_DIPSETTING( 0x0001, DEF_STR( 4C_1C ) ) |
| 940 | 934 | PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) |
| r1591 | r1592 | |
| 943 | 937 | PORT_DIPSETTING( 0x0006, DEF_STR( 1C_2C ) ) |
| 944 | 938 | PORT_DIPSETTING( 0x0005, DEF_STR( 1C_3C ) ) |
| 945 | 939 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) |
| 946 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Demo_Sounds ) ) | |
| 940 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4") | |
| 947 | 941 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 948 | 942 | PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) |
| 949 | PORT_DIPNAME( 0x0010, 0x0010, "Tumo Pin" ) | |
| 943 | PORT_DIPNAME( 0x0010, 0x0010, "Tumo Pin" ) PORT_DIPLOCATION("SW1:5") | |
| 950 | 944 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 951 | 945 | PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) |
| 952 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) ) | |
| 946 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:6") | |
| 953 | 947 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 954 | 948 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 955 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) | |
| 949 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:7") | |
| 956 | 950 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 957 | 951 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 958 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) | |
| 952 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) | |
| 953 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 959 | 954 | |
| 960 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 961 | ||
| 962 | 955 | PORT_START_TAG("IN1") // $600302.w |
| 963 | PORT_DIPNAME( 0x0007, 0x0004, DEF_STR( Difficulty ) ) | |
| 956 | PORT_DIPNAME( 0x0007, 0x0004, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2,3") | |
| 964 | 957 | PORT_DIPSETTING( 0x0004, "0" ) |
| 965 | 958 | PORT_DIPSETTING( 0x0003, "1" ) |
| 966 | 959 | PORT_DIPSETTING( 0x0002, "2" ) |
| r1591 | r1592 | |
| 969 | 962 | PORT_DIPSETTING( 0x0007, "5" ) |
| 970 | 963 | PORT_DIPSETTING( 0x0006, "6" ) |
| 971 | 964 | PORT_DIPSETTING( 0x0005, "7" ) |
| 972 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Allow_Continue ) ) | |
| 965 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:4") | |
| 973 | 966 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 974 | 967 | PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) ) |
| 975 | PORT_DIPNAME( 0x0010, 0x0000, "Select Girl" ) | |
| 968 | PORT_DIPNAME( 0x0010, 0x0000, "Select Girl" ) PORT_DIPLOCATION("SW2:5") | |
| 976 | 969 | PORT_DIPSETTING( 0x0010, DEF_STR( No ) ) |
| 977 | 970 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 978 | PORT_DIPNAME( 0x0020, 0x0000, "Com Put" ) | |
| 971 | PORT_DIPNAME( 0x0020, 0x0000, "Com Put" ) PORT_DIPLOCATION("SW2:6") | |
| 979 | 972 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 980 | 973 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 981 | PORT_DIPNAME( 0x0040, 0x0040, | |
| 974 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7" | |
| 982 | 975 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 983 | 976 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 984 | PORT_DIPNAME( 0x0080, 0x0080, | |
| 977 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8" | |
| 985 | 978 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 986 | 979 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 980 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 987 | 981 | |
| 988 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 989 | ||
| 990 | 982 | PORT_START_TAG("IN2") // $600100.w |
| 991 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 992 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 993 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 994 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 995 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 996 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 997 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 998 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 983 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 984 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 985 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 986 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 987 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 988 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 989 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 990 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 991 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 999 | 992 | |
| 1000 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1001 | ||
| 1002 | 993 | PORT_START_TAG("IN3") // $600000(0) |
| 1003 | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) | |
| 1004 | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E ) | |
| 1005 | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) | |
| 1006 | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M ) | |
| 1007 | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) | |
| 1008 | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1009 | PORT_BIT(0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 994 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) | |
| 995 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E ) | |
| 996 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) | |
| 997 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M ) | |
| 998 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) | |
| 999 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1000 | PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1010 | 1001 | |
| 1011 | 1002 | PORT_START_TAG("IN4") // $600000(1) |
| 1012 | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) | |
| 1013 | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) | |
| 1014 | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) | |
| 1015 | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N ) | |
| 1016 | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) | |
| 1017 | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) | |
| 1018 | PORT_BIT(0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 1003 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) | |
| 1004 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) | |
| 1005 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) | |
| 1006 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N ) | |
| 1007 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) | |
| 1008 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) | |
| 1009 | PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN) | |
| 1019 | 1010 | |
| 1020 | 1011 | PORT_START_TAG("IN5") // $600000(2) |
| 1021 | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C ) | |
| 1022 | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G ) | |
| 1023 | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) | |
| 1024 | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) | |
| 1025 | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) | |
| 1012 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C ) | |
| 1013 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G ) | |
| 1014 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) | |
| 1015 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) | |
| 1016 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) | |
| 1026 | 1017 | PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1027 | 1018 | |
| 1028 | 1019 | PORT_START_TAG("IN6") // $600000(3) |
| 1029 | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D ) | |
| 1030 | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H ) | |
| 1031 | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) | |
| 1032 | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) | |
| 1020 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D ) | |
| 1021 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H ) | |
| 1022 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) | |
| 1023 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) | |
| 1033 | 1024 | PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1034 | 1025 | |
| 1035 | 1026 | PORT_START_TAG("IN7") // $600000(4) |
| r1591 | r1592 | |
| 1039 | 1030 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) |
| 1040 | 1031 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) |
| 1041 | 1032 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) |
| 1042 | PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1043 | ||
| 1044 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1033 | PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1034 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1045 | 1035 | INPUT_PORTS_END |
| 1046 | 1036 | |
| 1047 | 1037 | |
| r1591 | r1592 | |
| 1051 | 1041 | |
| 1052 | 1042 | static INPUT_PORTS_START( myangel ) |
| 1053 | 1043 | PORT_START_TAG("IN0") // $700300.w |
| 1054 | PORT_SERVICE( 0x0001, IP_ACTIVE_LOW ) | |
| 1055 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1056 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 1057 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1058 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1059 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 1060 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1061 | PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) | |
| 1044 | PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" ) | |
| 1045 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:2" ) /* Listed as "Unused" */ | |
| 1046 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:3" ) /* Listed as "Unused" */ | |
| 1047 | PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) PORT_DIPLOCATION("SW1:4") | |
| 1062 | 1048 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1063 | 1049 | PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) ) |
| 1064 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) | |
| 1050 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") | |
| 1065 | 1051 | PORT_DIPSETTING( 0x0020, "2" ) |
| 1066 | 1052 | PORT_DIPSETTING( 0x0030, "3" ) |
| 1067 | 1053 | PORT_DIPSETTING( 0x0010, "4" ) |
| 1068 | 1054 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1069 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) | |
| 1055 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") | |
| 1070 | 1056 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1071 | 1057 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) |
| 1072 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) | |
| 1058 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") | |
| 1073 | 1059 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 1074 | 1060 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1061 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1075 | 1062 | |
| 1076 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1077 | ||
| 1078 | 1063 | PORT_START_TAG("IN1") // $700302.w |
| 1079 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) | |
| 1064 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3,4") | |
| 1080 | 1065 | PORT_DIPSETTING( 0x0002, DEF_STR( 4C_1C ) ) |
| 1081 | 1066 | PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) |
| 1082 | 1067 | PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) |
| r1591 | r1592 | |
| 1093 | 1078 | PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) |
| 1094 | 1079 | PORT_DIPSETTING( 0x0009, DEF_STR( 1C_7C ) ) |
| 1095 | 1080 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1096 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1097 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 1098 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1099 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1100 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 1101 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1102 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1103 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 1104 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1105 | PORT_DIPNAME( 0x0080, 0x0080, "Push Start To Freeze (Cheat)") | |
| 1081 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */ | |
| 1082 | PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */ | |
| 1083 | PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */ | |
| 1084 | PORT_DIPNAME( 0x0080, 0x0080, "Push Start To Freeze (Cheat)") PORT_DIPLOCATION("SW2:8") | |
| 1106 | 1085 | PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) |
| 1107 | 1086 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 1087 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1108 | 1088 | |
| 1109 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1110 | ||
| 1111 | 1089 | PORT_START_TAG("IN2") //$700000.w |
| 1112 | 1090 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1113 | 1091 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r1591 | r1592 | |
| 1117 | 1095 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1118 | 1096 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1119 | 1097 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 1120 | ||
| 1121 | 1098 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1122 | 1099 | |
| 1123 | 1100 | PORT_START_TAG("IN3") //$700002.w |
| r1591 | r1592 | |
| 1129 | 1106 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1130 | 1107 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1131 | 1108 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) |
| 1132 | ||
| 1133 | 1109 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1134 | 1110 | |
| 1135 | 1111 | PORT_START_TAG("IN4") //$700004.w |
| 1136 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1137 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 1138 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1112 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1113 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 1114 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1139 | 1115 | PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW ) |
| 1140 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1141 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1142 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1143 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1144 | ||
| 1116 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1117 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1118 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1119 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1145 | 1120 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1146 | 1121 | INPUT_PORTS_END |
| 1147 | 1122 | |
| r1591 | r1592 | |
| 1152 | 1127 | |
| 1153 | 1128 | static INPUT_PORTS_START( myangel2 ) |
| 1154 | 1129 | PORT_START_TAG("IN0") //$600300.w |
| 1155 | PORT_SERVICE( 0x0001, IP_ACTIVE_LOW ) | |
| 1156 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1157 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 1158 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1159 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1160 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 1161 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1162 | PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) | |
| 1130 | PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" ) | |
| 1131 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:2" ) /* Listed as "Unused" */ | |
| 1132 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:3" ) /* Listed as "Unused" */ | |
| 1133 | PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) PORT_DIPLOCATION("SW1:4") | |
| 1163 | 1134 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1164 | 1135 | PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) ) |
| 1165 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) | |
| 1136 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") | |
| 1166 | 1137 | PORT_DIPSETTING( 0x0020, "2" ) |
| 1167 | 1138 | PORT_DIPSETTING( 0x0030, "3" ) |
| 1168 | 1139 | PORT_DIPSETTING( 0x0010, "4" ) |
| 1169 | 1140 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1170 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) | |
| 1141 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") | |
| 1171 | 1142 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1172 | 1143 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) |
| 1173 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) | |
| 1144 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") | |
| 1174 | 1145 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 1175 | 1146 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1176 | 1147 | |
| 1177 | 1148 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1178 | 1149 | |
| 1179 | 1150 | PORT_START_TAG("IN1") //$600302.w |
| 1180 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) | |
| 1151 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3,4") | |
| 1181 | 1152 | PORT_DIPSETTING( 0x0002, DEF_STR( 4C_1C ) ) |
| 1182 | 1153 | PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) |
| 1183 | 1154 | PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) |
| r1591 | r1592 | |
| 1194 | 1165 | PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) |
| 1195 | 1166 | PORT_DIPSETTING( 0x0009, DEF_STR( 1C_7C ) ) |
| 1196 | 1167 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1197 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1198 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 1199 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1200 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1201 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 1202 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1203 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1204 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 1205 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1206 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) ) /* Listed as "Unused" */ | |
| 1207 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 1208 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1168 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */ | |
| 1169 | PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */ | |
| 1170 | PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */ | |
| 1171 | PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" ) /* Listed as "Unused" */ | |
| 1172 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1209 | 1173 | |
| 1210 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1211 | ||
| 1212 | 1174 | PORT_START_TAG("IN2") //$600000.w |
| 1213 | 1175 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1214 | 1176 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r1591 | r1592 | |
| 1218 | 1180 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1219 | 1181 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1220 | 1182 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 1221 | ||
| 1222 | 1183 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1223 | 1184 | |
| 1224 | 1185 | PORT_START_TAG("IN3") //$600002.w |
| r1591 | r1592 | |
| 1230 | 1191 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1231 | 1192 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1232 | 1193 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) |
| 1233 | ||
| 1234 | 1194 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1235 | 1195 | |
| 1236 | 1196 | PORT_START_TAG("IN4") //$600004.w |
| 1237 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1238 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 1239 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1197 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1198 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) | |
| 1199 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1240 | 1200 | PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW ) |
| 1241 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1242 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1243 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1244 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1245 | ||
| 1201 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1202 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1203 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1204 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1246 | 1205 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1247 | 1206 | INPUT_PORTS_END |
| 1248 | 1207 | |
| r1591 | r1592 | |
| 1253 | 1212 | |
| 1254 | 1213 | static INPUT_PORTS_START( pzlbowl ) |
| 1255 | 1214 | PORT_START_TAG("IN0") //$400300.w |
| 1256 | PORT_SERVICE( 0x0001, IP_ACTIVE_LOW ) | |
| 1257 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) | |
| 1215 | PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" ) | |
| 1216 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:2") | |
| 1258 | 1217 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1259 | 1218 | PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) |
| 1260 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Flip_Screen ) ) | |
| 1219 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:3") | |
| 1261 | 1220 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 1262 | 1221 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1263 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Difficulty ) ) | |
| 1222 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5,6") | |
| 1264 | 1223 | PORT_DIPSETTING( 0x0030, DEF_STR( Easiest ) ) |
| 1265 | 1224 | PORT_DIPSETTING( 0x0028, DEF_STR( Easier ) ) |
| 1266 | 1225 | PORT_DIPSETTING( 0x0020, DEF_STR( Easy ) ) |
| r1591 | r1592 | |
| 1269 | 1228 | PORT_DIPSETTING( 0x0010, DEF_STR( Harder ) ) |
| 1270 | 1229 | PORT_DIPSETTING( 0x0008, DEF_STR( Very_Hard ) ) |
| 1271 | 1230 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 1272 | PORT_DIPNAME( 0x00c0, 0x00c0, "Winning Rounds (Player VS Player)" ) | |
| 1231 | PORT_DIPNAME( 0x00c0, 0x00c0, "Winning Rounds (Player VS Player)" ) PORT_DIPLOCATION("SW1:7,8") | |
| 1273 | 1232 | PORT_DIPSETTING( 0x0040, "1" ) |
| 1274 | 1233 | PORT_DIPSETTING( 0x00c0, "2" ) /* This setting is not defined in the manual */ |
| 1275 | 1234 | PORT_DIPSETTING( 0x0080, "3" ) |
| 1276 | 1235 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1236 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1277 | 1237 | |
| 1278 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1279 | ||
| 1280 | 1238 | PORT_START_TAG("IN1") //$400302.w |
| 1281 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) | |
| 1239 | PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3,4") | |
| 1282 | 1240 | PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) |
| 1283 | 1241 | PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) |
| 1284 | 1242 | PORT_DIPSETTING( 0x0004, DEF_STR( 3C_2C ) ) |
| r1591 | r1592 | |
| 1295 | 1253 | PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) |
| 1296 | 1254 | PORT_DIPSETTING( 0x0009, DEF_STR( 1C_7C ) ) |
| 1297 | 1255 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1298 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Allow_Continue ) ) | |
| 1256 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") | |
| 1299 | 1257 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1300 | 1258 | PORT_DIPSETTING( 0x0010, DEF_STR( Yes ) ) |
| 1301 | PORT_DIPNAME( 0x0020, 0x0020, "Join In" ) | |
| 1259 | PORT_DIPNAME( 0x0020, 0x0020, "Join In" ) PORT_DIPLOCATION("SW2:6") | |
| 1302 | 1260 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1303 | 1261 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 1304 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) ) | |
| 1305 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 1306 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1307 | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Language ) ) | |
| 1262 | PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) | |
| 1263 | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:8") | |
| 1308 | 1264 | PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) |
| 1309 | 1265 | PORT_DIPSETTING( 0x0080, DEF_STR( Japanese ) ) |
| 1266 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1310 | 1267 | |
| 1311 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1312 | ||
| 1313 | 1268 | PORT_START_TAG("IN2") //$500000.w |
| 1314 | 1269 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| 1315 | 1270 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) |
| r1591 | r1592 | |
| 1319 | 1274 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1320 | 1275 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 1321 | 1276 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 1322 | ||
| 1323 | 1277 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1324 | 1278 | |
| 1325 | 1279 | PORT_START_TAG("IN3") //$500002.w |
| r1591 | r1592 | |
| 1331 | 1285 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1332 | 1286 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1333 | 1287 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) |
| 1334 | ||
| 1335 | 1288 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1336 | 1289 | |
| 1337 | 1290 | PORT_START_TAG("IN4") //$500004.w |
| 1338 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1339 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // unused, test mode shows it | |
| 1340 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1341 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) | |
| 1342 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1343 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1344 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1345 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) // Protection? | |
| 1346 | ||
| 1291 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1292 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // unused, test mode shows it | |
| 1293 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1294 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) | |
| 1295 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1296 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1297 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1298 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) // Protection? | |
| 1347 | 1299 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1348 | 1300 | INPUT_PORTS_END |
| 1349 | 1301 | |
| r1591 | r1592 | |
| 1354 | 1306 | |
| 1355 | 1307 | static INPUT_PORTS_START( penbros ) |
| 1356 | 1308 | PORT_START_TAG("IN0") //$500300.w |
| 1357 | PORT_SERVICE( 0x0001, IP_ACTIVE_LOW ) | |
| 1358 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) | |
| 1309 | PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" ) | |
| 1310 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2") | |
| 1359 | 1311 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) |
| 1360 | 1312 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1361 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) | |
| 1362 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 1363 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1364 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Demo_Sounds ) ) | |
| 1313 | PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) | |
| 1314 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4") | |
| 1365 | 1315 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1366 | 1316 | PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) |
| 1367 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) | |
| 1317 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6") | |
| 1368 | 1318 | PORT_DIPSETTING( 0x0020, DEF_STR( 3C_1C ) ) |
| 1369 | 1319 | PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) |
| 1370 | 1320 | PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) |
| 1371 | 1321 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_2C ) ) |
| 1372 | PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) | |
| 1322 | PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8") | |
| 1373 | 1323 | PORT_DIPSETTING( 0x0080, DEF_STR( 3C_1C ) ) |
| 1374 | 1324 | PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) |
| 1375 | 1325 | PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) |
| 1376 | 1326 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_2C ) ) |
| 1327 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1377 | 1328 | |
| 1378 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1379 | ||
| 1380 | 1329 | PORT_START_TAG("IN1") //$500302.w |
| 1381 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) | |
| 1330 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") | |
| 1382 | 1331 | PORT_DIPSETTING( 0x0002, DEF_STR( Easy ) ) |
| 1383 | 1332 | PORT_DIPSETTING( 0x0003, DEF_STR( Normal ) ) |
| 1384 | 1333 | PORT_DIPSETTING( 0x0001, DEF_STR( Hard ) ) |
| 1385 | 1334 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 1386 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) | |
| 1335 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4") | |
| 1387 | 1336 | PORT_DIPSETTING( 0x0000, "2" ) |
| 1388 | 1337 | PORT_DIPSETTING( 0x000c, "3" ) |
| 1389 | 1338 | PORT_DIPSETTING( 0x0004, "4" ) |
| 1390 | 1339 | PORT_DIPSETTING( 0x0008, "5" ) |
| 1391 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Bonus_Life ) ) | |
| 1340 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6") | |
| 1392 | 1341 | PORT_DIPSETTING( 0x0010, "150k and 500k" ) |
| 1393 | 1342 | PORT_DIPSETTING( 0x0030, "200k and 700k" ) |
| 1394 | 1343 | PORT_DIPSETTING( 0x0000, "Every 250k" ) // no extra life after the one at 1500k |
| 1395 | 1344 | PORT_DIPSETTING( 0x0020, DEF_STR( None ) ) |
| 1396 | PORT_DIPNAME( 0x00c0, 0x00c0, "Winning Rounds (Player VS Player)" ) | |
| 1345 | PORT_DIPNAME( 0x00c0, 0x00c0, "Winning Rounds (Player VS Player)" ) PORT_DIPLOCATION("SW2:7,8") | |
| 1397 | 1346 | PORT_DIPSETTING( 0x00c0, "2" ) |
| 1398 | 1347 | PORT_DIPSETTING( 0x0040, "3" ) |
| 1399 | 1348 | PORT_DIPSETTING( 0x0080, "4" ) |
| 1400 | 1349 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1350 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1401 | 1351 | |
| 1402 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1403 | ||
| 1404 | 1352 | PORT_START_TAG("IN2") //$600000.w |
| 1405 | 1353 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| 1406 | 1354 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) |
| r1591 | r1592 | |
| 1408 | 1356 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) |
| 1409 | 1357 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1410 | 1358 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1411 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_ | |
| 1359 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_ | |
| 1412 | 1360 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 1413 | ||
| 1414 | 1361 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1415 | 1362 | |
| 1416 | 1363 | PORT_START_TAG("IN3") //$600002.w |
| r1591 | r1592 | |
| 1420 | 1367 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 1421 | 1368 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1422 | 1369 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1423 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_ | |
| 1370 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_ | |
| 1424 | 1371 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) |
| 1425 | ||
| 1426 | 1372 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1427 | 1373 | |
| 1428 | 1374 | PORT_START_TAG("IN4") //$600004.w |
| 1429 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1430 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // unused, test mode shows it | |
| 1431 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1432 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) | |
| 1433 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1434 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1435 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1436 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1437 | ||
| 1375 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 1376 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // unused, test mode shows it | |
| 1377 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1378 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) | |
| 1379 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1380 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1381 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1382 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1438 | 1383 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1439 | 1384 | INPUT_PORTS_END |
| 1440 | 1385 |
| r1591 | r1592 | |
|---|---|---|
| 365 | 365 | break; |
| 366 | 366 | |
| 367 | 367 | case 0x08: //A008 |
| 368 | cpunum_set_input_line(cpu_getactivecpu(),0,CLEAR_LINE); | |
| 368 | cpunum_set_input_line(Machine, cpu_getactivecpu(),0,CLEAR_LINE); | |
| 369 | 369 | break; |
| 370 | 370 | } |
| 371 | 371 | } |
| r1591 | r1592 | |
| 442 | 442 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(gfx1_vram_r, gfx1_vram_w) AM_BASE(&gfx1_vram) |
| 443 | 443 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(gfx1_cram_r, gfx1_cram_w) AM_BASE(&gfx1_cram) |
| 444 | 444 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&sprite_ram) |
| 445 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(paletteram_r, paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE(&paletteram) | |
| 446 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(paletteram_2_r, paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 445 | AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(MRA8_RAM, paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE(&paletteram) | |
| 446 | AM_RANGE(0xe800, 0xefff) AM_READWRITE(MRA8_RAM, paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 447 | 447 | AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE(1) |
| 448 | 448 | AM_RANGE(0xf100, 0xf17f) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 449 | 449 | AM_RANGE(0xf180, 0xffff) AM_RAM AM_SHARE(2) |
| r1591 | r1592 | |
| 757 | 757 | |
| 758 | 758 | static INTERRUPT_GEN( witch_main_interrupt ) |
| 759 | 759 | { |
| 760 | cpunum_set_input_line(0,0,ASSERT_LINE); | |
| 760 | cpunum_set_input_line(machine, 0,0,ASSERT_LINE); | |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | static INTERRUPT_GEN( witch_sub_interrupt ) |
| 764 | 764 | { |
| 765 | cpunum_set_input_line(1,0,ASSERT_LINE); | |
| 765 | cpunum_set_input_line(machine, 1,0,ASSERT_LINE); | |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | static MACHINE_DRIVER_START( witch ) |
| r1591 | r1592 | |
|---|---|---|
| 35 | 35 | static INTERRUPT_GEN( flkatck_interrupt ) |
| 36 | 36 | { |
| 37 | 37 | if (flkatck_irq_enabled) |
| 38 | cpunum_set_input_line(0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 38 | cpunum_set_input_line(machine, 0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static WRITE8_HANDLER( flkatck_bankswitch_w ) |
| r1591 | r1592 | |
| 83 | 83 | soundlatch_w(0, data); |
| 84 | 84 | break; |
| 85 | 85 | case 0x06: /* Cause interrupt on audio CPU */ |
| 86 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 86 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 87 | 87 | break; |
| 88 | 88 | case 0x07: /* watchdog reset */ |
| 89 | 89 | watchdog_reset_w(0, data); |
| r1591 | r1592 | |
| 270 | 270 | static MACHINE_DRIVER_START( flkatck ) |
| 271 | 271 | |
| 272 | 272 | /* basic machine hardware */ |
| 273 | MDRV_CPU_ADD(HD6309,3000000) /* HD63C09EP, 24/8 MHz */ | |
| 273 | MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP, 24/8 MHz */ | |
| 274 | 274 | MDRV_CPU_PROGRAM_MAP(flkatck_readmem,flkatck_writemem) |
| 275 | 275 | MDRV_CPU_VBLANK_INT(flkatck_interrupt,1) |
| 276 | 276 |
| r1591 | r1592 | |
|---|---|---|
| 313 | 313 | |
| 314 | 314 | static TIMER_CALLBACK( network_interrupt_callback ) |
| 315 | 315 | { |
| 316 | cpunum_set_input_line(0, I960_IRQ0, ASSERT_LINE); | |
| 316 | cpunum_set_input_line(machine, 0, I960_IRQ0, ASSERT_LINE); | |
| 317 | 317 | timer_set(video_screen_get_frame_period(0), NULL, 0, network_interrupt_callback); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 322 | 322 | { |
| 323 | cpunum_set_input_line(0, I960_IRQ2, ASSERT_LINE); | |
| 323 | cpunum_set_input_line(machine, 0, I960_IRQ2, ASSERT_LINE); | |
| 324 | 324 | timer_set(video_screen_get_frame_period(0), NULL, 0, vblank_interrupt_callback); |
| 325 | 325 | } |
| 326 | 326 | |
| r1591 | r1592 | |
| 328 | 328 | static TIMER_CALLBACK( raster_interrupt_callback ) |
| 329 | 329 | { |
| 330 | 330 | video_screen_update_partial(0, video_screen_get_vpos(0)); |
| 331 | cpunum_set_input_line(0, I960_IRQ1, ASSERT_LINE); | |
| 331 | cpunum_set_input_line(machine, 0, I960_IRQ1, ASSERT_LINE); | |
| 332 | 332 | timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero); |
| 333 | 333 | } |
| 334 | 334 |
| r1591 | r1592 | |
|---|---|---|
| 103 | 103 | int irq = ((dynax_sound_irq) ? 0x08 : 0) | |
| 104 | 104 | ((dynax_vblank_irq) ? 0x10 : 0) | |
| 105 | 105 | ((dynax_blitter_irq) ? 0x20 : 0) ; |
| 106 | cpunum_set_input_line_and_vector(0, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */ | |
| 106 | cpunum_set_input_line_and_vector(Machine, 0, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */ | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static WRITE8_HANDLER( dynax_vblank_ack_w ) |
| r1591 | r1592 | |
| 143 | 143 | int irq = ((dynax_blitter_irq) ? 0x08 : 0) | |
| 144 | 144 | ((dynax_blitter2_irq) ? 0x10 : 0) | |
| 145 | 145 | ((dynax_vblank_irq) ? 0x20 : 0) ; |
| 146 | cpunum_set_input_line_and_vector(0, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */ | |
| 146 | cpunum_set_input_line_and_vector(Machine, 0, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */ | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | static WRITE8_HANDLER( jantouki_vblank_ack_w ) |
| r1591 | r1592 | |
| 183 | 183 | int irq = ((dynax_sound_irq) ? 0x08 : 0) | |
| 184 | 184 | ((dynax_soundlatch_irq) ? 0x10 : 0) | |
| 185 | 185 | ((dynax_sound_vblank_irq) ? 0x20 : 0) ; |
| 186 | cpunum_set_input_line_and_vector(1, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */ | |
| 186 | cpunum_set_input_line_and_vector(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */ | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | static INTERRUPT_GEN( jantouki_sound_vblank_interrupt ) |
| r1591 | r1592 | |
| 404 | 404 | if (toggle) |
| 405 | 405 | { |
| 406 | 406 | if (resetkludge) // don't know what's wrong, but NMIs when the 5205 is reset make the game crash |
| 407 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 407 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | static void adpcm_int_cpu1(int data) |
| r1591 | r1592 | |
| 418 | 418 | if (toggle) |
| 419 | 419 | { |
| 420 | 420 | if (resetkludge) // don't know what's wrong, but NMIs when the 5205 is reset make the game crash |
| 421 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); // cpu1 | |
| 421 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); // cpu1 | |
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
| r1591 | r1592 | |
| 3945 | 3945 | void mjelctrn_update_irq(void) |
| 3946 | 3946 | { |
| 3947 | 3947 | dynax_blitter_irq = 1; |
| 3948 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xfa); | |
| 3948 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, 0xfa); | |
| 3949 | 3949 | } |
| 3950 | 3950 | |
| 3951 | 3951 | static INTERRUPT_GEN( mjelctrn_vblank_interrupt ) |
| r1591 | r1592 | |
| 3953 | 3953 | // This is a kludge to avoid losing blitter interrupts |
| 3954 | 3954 | // there should be a vblank ack mechanism |
| 3955 | 3955 | if (!dynax_blitter_irq) |
| 3956 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xf8); | |
| 3956 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xf8); | |
| 3957 | 3957 | } |
| 3958 | 3958 | |
| 3959 | 3959 | static MACHINE_DRIVER_START( mjelctrn ) |
| r1591 | r1592 | |
| 3979 | 3979 | void neruton_update_irq(void) |
| 3980 | 3980 | { |
| 3981 | 3981 | dynax_blitter_irq = 1; |
| 3982 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x42); | |
| 3982 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, 0x42); | |
| 3983 | 3983 | } |
| 3984 | 3984 | |
| 3985 | 3985 | static INTERRUPT_GEN( neruton_vblank_interrupt ) |
| r1591 | r1592 | |
| 3990 | 3990 | |
| 3991 | 3991 | switch(cpu_getiloops()) |
| 3992 | 3992 | { |
| 3993 | case 0: cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x40); break; | |
| 3994 | default: cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x46); | |
| 3993 | case 0: cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x40); break; | |
| 3994 | default: cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x46); | |
| 3995 | 3995 | } |
| 3996 | 3996 | } |
| 3997 | 3997 | |
| r1591 | r1592 | |
| 4017 | 4017 | // there should be a vblank ack mechanism |
| 4018 | 4018 | if (dynax_blitter_irq) return; |
| 4019 | 4019 | |
| 4020 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x40); | |
| 4020 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x40); | |
| 4021 | 4021 | } |
| 4022 | 4022 | |
| 4023 | 4023 | static MACHINE_DRIVER_START( majxtal7 ) |
| r1591 | r1592 | |
| 4085 | 4085 | { |
| 4086 | 4086 | switch(cpu_getiloops()) |
| 4087 | 4087 | { |
| 4088 | case 0: cpunum_set_input_line(0, INPUT_LINE_IRQ0, HOLD_LINE); break; | |
| 4089 | case 1: cpunum_set_input_line(0, INPUT_LINE_IRQ1, HOLD_LINE); break; | |
| 4090 | case 2: cpunum_set_input_line(0, INPUT_LINE_IRQ2, HOLD_LINE); break; | |
| 4088 | case 0: cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, HOLD_LINE); break; | |
| 4089 | case 1: cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, HOLD_LINE); break; | |
| 4090 | case 2: cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ2, HOLD_LINE); break; | |
| 4091 | 4091 | } |
| 4092 | 4092 | } |
| 4093 | 4093 | |
| r1591 | r1592 | |
| 5125 | 5125 | } |
| 5126 | 5126 | free(rom1); |
| 5127 | 5127 | |
| 5128 | | |
| 5128 | DRIVER_INIT_CALL(mjelct3 | |
| 5129 | 5129 | } |
| 5130 | 5130 | |
| 5131 | 5131 |
| r1591 | r1592 | |
|---|---|---|
| 61 | 61 | static WRITE8_HANDLER( sound_cpu_command_w ) |
| 62 | 62 | { |
| 63 | 63 | soundlatch_w( offset, data ); |
| 64 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 64 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static WRITE8_HANDLER( shootout_flipscreen_w ) |
| r1591 | r1592 | |
| 264 | 264 | |
| 265 | 265 | static void shootout_snd_irq(int linestate) |
| 266 | 266 | { |
| 267 | cpunum_set_input_line(1,0,linestate); | |
| 267 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | static void shootout_snd2_irq(int linestate) |
| 271 | 271 | { |
| 272 | cpunum_set_input_line(0,0,linestate); | |
| 272 | cpunum_set_input_line(Machine, 0,0,linestate); | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | static WRITE8_HANDLER( contra_sh_irqtrigger_w ) |
| 51 | 51 | { |
| 52 | cpunum_set_input_line(1,M6809_IRQ_LINE,HOLD_LINE); | |
| 52 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static WRITE8_HANDLER( contra_coin_counter_w ) |
| r1591 | r1592 | |
|---|---|---|
| 422 | 422 | psx_machine_init(); |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | static MACHINE_DRIVER_START( zn1_1mb_vram ) | |
| 426 | /* basic machine hardware */ | |
| 427 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 428 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 429 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 430 | ||
| 431 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 432 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 433 | ||
| 434 | /* video hardware */ | |
| 435 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 436 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 437 | MDRV_SCREEN_SIZE( 1024, 512 ) | |
| 438 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 439 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 440 | ||
| 441 | MDRV_PALETTE_INIT( psx ) | |
| 442 | MDRV_VIDEO_START( psx_type2 ) | |
| 443 | MDRV_VIDEO_UPDATE( psx ) | |
| 444 | ||
| 445 | /* sound hardware */ | |
| 446 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 447 | ||
| 448 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 449 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 450 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 451 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 452 | MACHINE_DRIVER_END | |
| 453 | ||
| 454 | static MACHINE_DRIVER_START( zn1_2mb_vram ) | |
| 455 | MDRV_IMPORT_FROM( zn1_1mb_vram ) | |
| 456 | ||
| 457 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 458 | MACHINE_DRIVER_END | |
| 459 | ||
| 460 | static MACHINE_DRIVER_START( zn2 ) | |
| 461 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 462 | MACHINE_DRIVER_END | |
| 463 | ||
| 425 | 464 | /* |
| 426 | 465 | Capcom ZN1 generic PCB Layout |
| 427 | 466 | ---------------------------- |
| r1591 | r1592 | |
| 554 | 593 | |
| 555 | 594 | static INTERRUPT_GEN( qsound_interrupt ) |
| 556 | 595 | { |
| 557 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 596 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 558 | 597 | } |
| 559 | 598 | |
| 560 | 599 | static WRITE32_HANDLER( zn_qsound_w ) |
| 561 | 600 | { |
| 562 | 601 | soundlatch_w(0, data); |
| 563 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 602 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 564 | 603 | } |
| 565 | 604 | |
| 566 | 605 | static DRIVER_INIT( coh1000c ) |
| r1591 | r1592 | |
| 620 | 659 | }; |
| 621 | 660 | |
| 622 | 661 | static MACHINE_DRIVER_START( coh1000c ) |
| 623 | /* basic machine hardware */ | |
| 624 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 625 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 626 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 662 | MDRV_IMPORT_FROM( zn1_1mb_vram ) | |
| 627 | 663 | |
| 628 | 664 | MDRV_CPU_ADD( Z80, 8000000 ) |
| 629 | 665 | /* audio CPU */ /* 8MHz ?? */ |
| r1591 | r1592 | |
| 631 | 667 | MDRV_CPU_IO_MAP( qsound_readport, 0 ) |
| 632 | 668 | MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ |
| 633 | 669 | |
| 634 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 635 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 636 | ||
| 637 | 670 | MDRV_MACHINE_RESET( coh1000c ) |
| 638 | 671 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 639 | 672 | |
| 640 | /* video hardware */ | |
| 641 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 642 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 643 | MDRV_SCREEN_SIZE( 1024, 512 ) | |
| 644 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 645 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 646 | ||
| 647 | MDRV_PALETTE_INIT( psx ) | |
| 648 | MDRV_VIDEO_START( psx_type2 ) | |
| 649 | MDRV_VIDEO_UPDATE( psx ) | |
| 650 | ||
| 651 | /* sound hardware */ | |
| 652 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 653 | ||
| 654 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 655 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 656 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 657 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 658 | ||
| 659 | 673 | MDRV_SOUND_ADD( QSOUND, QSOUND_CLOCK ) |
| 660 | 674 | MDRV_SOUND_CONFIG( qsound_interface ) |
| 661 | 675 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| r1591 | r1592 | |
| 663 | 677 | MACHINE_DRIVER_END |
| 664 | 678 | |
| 665 | 679 | static MACHINE_DRIVER_START( coh1002c ) |
| 666 | /* basic machine hardware */ | |
| 667 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 668 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 669 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 680 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 670 | 681 | |
| 671 | 682 | MDRV_CPU_ADD( Z80, 8000000 ) |
| 672 | 683 | /* audio CPU */ /* 8MHz ?? */ |
| r1591 | r1592 | |
| 674 | 685 | MDRV_CPU_IO_MAP( qsound_readport, 0 ) |
| 675 | 686 | MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ |
| 676 | 687 | |
| 677 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 678 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 679 | ||
| 680 | 688 | MDRV_MACHINE_RESET( coh1000c ) |
| 681 | 689 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 682 | 690 | |
| 683 | /* video hardware */ | |
| 684 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 685 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 686 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 687 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 688 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 689 | ||
| 690 | MDRV_PALETTE_INIT( psx ) | |
| 691 | MDRV_VIDEO_START( psx_type2 ) | |
| 692 | MDRV_VIDEO_UPDATE( psx ) | |
| 693 | ||
| 694 | /* sound hardware */ | |
| 695 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 696 | ||
| 697 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 698 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 699 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 700 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 701 | ||
| 702 | 691 | MDRV_SOUND_ADD( QSOUND, QSOUND_CLOCK ) |
| 703 | 692 | MDRV_SOUND_CONFIG( qsound_interface ) |
| 704 | 693 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| r1591 | r1592 | |
| 872 | 861 | } |
| 873 | 862 | |
| 874 | 863 | static MACHINE_DRIVER_START( coh3002c ) |
| 875 | /* basic machine hardware */ | |
| 876 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 877 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 878 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 864 | MDRV_IMPORT_FROM( zn2 ) | |
| 879 | 865 | |
| 880 | MDRV_CPU_ADD( Z80, 8000000 ) | |
| 881 | 866 | /* audio CPU */ /* 8MHz ?? */ |
| 867 | MDRV_CPU_ADD( Z80, 8000000 ) | |
| 882 | 868 | MDRV_CPU_PROGRAM_MAP( qsound_readmem, qsound_writemem ) |
| 883 | 869 | MDRV_CPU_IO_MAP( qsound_readport, 0 ) |
| 884 | 870 | MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ |
| 885 | 871 | |
| 886 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 887 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 888 | ||
| 889 | 872 | MDRV_MACHINE_RESET( coh3002c ) |
| 890 | 873 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 891 | 874 | |
| 892 | /* video hardware */ | |
| 893 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 894 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 895 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 896 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 897 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 898 | ||
| 899 | MDRV_PALETTE_INIT( psx ) | |
| 900 | MDRV_VIDEO_START( psx_type2 ) | |
| 901 | MDRV_VIDEO_UPDATE( psx ) | |
| 902 | ||
| 903 | /* sound hardware */ | |
| 904 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 905 | ||
| 906 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 907 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 908 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 909 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 910 | ||
| 911 | 875 | MDRV_SOUND_ADD( QSOUND, QSOUND_CLOCK ) |
| 912 | 876 | MDRV_SOUND_CONFIG( qsound_interface ) |
| 913 | 877 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| r1591 | r1592 | |
| 1257 | 1221 | |
| 1258 | 1222 | static NVRAM_HANDLER( coh1000ta ) |
| 1259 | 1223 | { |
| 1260 | | |
| 1224 | NVRAM_HANDLER_CALL(at28c16_0 | |
| 1261 | 1225 | if (read_or_write) |
| 1262 | 1226 | { |
| 1263 | 1227 | mame_fwrite(file, taitofx1_eeprom1, taitofx1_eeprom_size1); |
| r1591 | r1592 | |
| 1302 | 1266 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 1303 | 1267 | static void irq_handler(int irq) |
| 1304 | 1268 | { |
| 1305 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1269 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1306 | 1270 | } |
| 1307 | 1271 | |
| 1308 | 1272 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
| 1313 | 1277 | }; |
| 1314 | 1278 | |
| 1315 | 1279 | static MACHINE_DRIVER_START( coh1000ta ) |
| 1316 | /* basic machine hardware */ | |
| 1317 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 1318 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 1280 | MDRV_IMPORT_FROM( zn1_1mb_vram ) | |
| 1281 | ||
| 1319 | 1282 | MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 ) |
| 1320 | 1283 | |
| 1321 | 1284 | MDRV_CPU_ADD( Z80, 16000000 / 4 ) |
| 1322 | 1285 | /* audio CPU */ /* 4 MHz */ |
| 1323 | 1286 | MDRV_CPU_PROGRAM_MAP( fx1a_sound_readmem, fx1a_sound_writemem ) |
| 1324 | ||
| 1325 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 1326 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 1327 | ||
| 1328 | 1287 | MDRV_MACHINE_RESET( coh1000ta ) |
| 1329 | 1288 | MDRV_NVRAM_HANDLER( coh1000ta ) |
| 1330 | 1289 | |
| 1331 | /* video hardware */ | |
| 1332 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 1333 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1334 | MDRV_SCREEN_SIZE( 1024, 512 ) | |
| 1335 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 1336 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 1337 | ||
| 1338 | MDRV_PALETTE_INIT( psx ) | |
| 1339 | MDRV_VIDEO_START( psx_type2 ) | |
| 1340 | MDRV_VIDEO_UPDATE( psx ) | |
| 1341 | ||
| 1342 | /* sound hardware */ | |
| 1343 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 1344 | ||
| 1345 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 1346 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 1347 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 1348 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 1349 | ||
| 1350 | 1290 | MDRV_SOUND_ADD(YM2610B, 16000000/2) |
| 1351 | 1291 | MDRV_SOUND_CONFIG(ym2610_interface) |
| 1352 | 1292 | MDRV_SOUND_ROUTE(0, "left", 0.25) |
| r1591 | r1592 | |
| 1401 | 1341 | |
| 1402 | 1342 | static NVRAM_HANDLER( coh1000tb ) |
| 1403 | 1343 | { |
| 1404 | | |
| 1344 | NVRAM_HANDLER_CALL(at28c16_0 | |
| 1405 | 1345 | if (read_or_write) |
| 1406 | 1346 | { |
| 1407 | 1347 | mame_fwrite(file, taitofx1_eeprom1, taitofx1_eeprom_size1); |
| r1591 | r1592 | |
| 1420 | 1360 | } |
| 1421 | 1361 | |
| 1422 | 1362 | static MACHINE_DRIVER_START( coh1000tb ) |
| 1423 | /* basic machine hardware */ | |
| 1424 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 1425 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 1363 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 1364 | ||
| 1426 | 1365 | MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 ) |
| 1427 | 1366 | |
| 1428 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 1429 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 1430 | ||
| 1431 | 1367 | MDRV_MACHINE_RESET( coh1000tb ) |
| 1432 | 1368 | MDRV_NVRAM_HANDLER( coh1000tb ) |
| 1433 | ||
| 1434 | /* video hardware */ | |
| 1435 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 1436 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1437 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 1438 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 1439 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 1440 | ||
| 1441 | MDRV_PALETTE_INIT( psx ) | |
| 1442 | MDRV_VIDEO_START( psx_type2 ) | |
| 1443 | MDRV_VIDEO_UPDATE( psx ) | |
| 1444 | ||
| 1445 | /* sound hardware */ | |
| 1446 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 1447 | ||
| 1448 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 1449 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 1450 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 1451 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 1452 | 1369 | MACHINE_DRIVER_END |
| 1453 | 1370 | |
| 1454 | 1371 | /* |
| r1591 | r1592 | |
| 1610 | 1527 | } |
| 1611 | 1528 | |
| 1612 | 1529 | static MACHINE_DRIVER_START( coh3002t ) |
| 1613 | /* basic machine hardware */ | |
| 1614 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 1615 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 1616 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 1530 | MDRV_IMPORT_FROM( zn2 ) | |
| 1617 | 1531 | |
| 1618 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 1619 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 1620 | ||
| 1621 | 1532 | MDRV_MACHINE_RESET( coh3002t ) |
| 1622 | 1533 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 1623 | ||
| 1624 | /* video hardware */ | |
| 1625 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 1626 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1627 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 1628 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 1629 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 1630 | ||
| 1631 | MDRV_PALETTE_INIT( psx ) | |
| 1632 | MDRV_VIDEO_START( psx_type2 ) | |
| 1633 | MDRV_VIDEO_UPDATE( psx ) | |
| 1634 | ||
| 1635 | /* sound hardware */ | |
| 1636 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 1637 | ||
| 1638 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 1639 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 1640 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 1641 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 1642 | 1534 | MACHINE_DRIVER_END |
| 1643 | 1535 | |
| 1644 | 1536 | /* |
| r1591 | r1592 | |
| 1824 | 1716 | } |
| 1825 | 1717 | |
| 1826 | 1718 | static MACHINE_DRIVER_START( coh1000w ) |
| 1827 | /* basic machine hardware */ | |
| 1828 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 1829 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 1830 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 1719 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 1831 | 1720 | |
| 1832 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 1833 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 1834 | ||
| 1835 | 1721 | MDRV_MACHINE_RESET( coh1000w ) |
| 1836 | 1722 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 1837 | ||
| 1838 | /* video hardware */ | |
| 1839 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 1840 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1841 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 1842 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 1843 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 1844 | ||
| 1845 | MDRV_PALETTE_INIT( psx ) | |
| 1846 | MDRV_VIDEO_START( psx_type2 ) | |
| 1847 | MDRV_VIDEO_UPDATE( psx ) | |
| 1848 | ||
| 1849 | /* sound hardware */ | |
| 1850 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 1851 | ||
| 1852 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 1853 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 1854 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 1855 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 1856 | 1723 | MACHINE_DRIVER_END |
| 1857 | 1724 | |
| 1858 | 1725 | /* |
| r1591 | r1592 | |
| 2012 | 1879 | static WRITE32_HANDLER( coh1002e_latch_w ) |
| 2013 | 1880 | { |
| 2014 | 1881 | if (offset) |
| 2015 | { | |
| 2016 | cpunum_set_input_line(1, 2, HOLD_LINE); // irq 2 on the 68k | |
| 2017 | } | |
| 1882 | cpunum_set_input_line(Machine, 1, 2, HOLD_LINE); // irq 2 on the 68k | |
| 2018 | 1883 | else |
| 2019 | { | |
| 2020 | 1884 | soundlatch_w(0, data); |
| 2021 | } | |
| 2022 | 1885 | } |
| 2023 | 1886 | |
| 2024 | 1887 | static DRIVER_INIT( coh1002e ) |
| r1591 | r1592 | |
| 2066 | 1929 | }; |
| 2067 | 1930 | |
| 2068 | 1931 | static MACHINE_DRIVER_START( coh1002e ) |
| 2069 | /* basic machine hardware */ | |
| 2070 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 2071 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 2072 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 1932 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 2073 | 1933 | |
| 2074 | MDRV_CPU_ADD( M68000, 12000000 ) | |
| 2075 | 1934 | /* audio CPU */ |
| 1935 | MDRV_CPU_ADD( M68000, 12000000 ) | |
| 2076 | 1936 | MDRV_CPU_PROGRAM_MAP( psarc_snd_map, 0 ) |
| 2077 | 1937 | |
| 2078 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 2079 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 2080 | ||
| 2081 | 1938 | MDRV_MACHINE_RESET( coh1002e ) |
| 2082 | 1939 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 2083 | 1940 | |
| 2084 | /* video hardware */ | |
| 2085 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 2086 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 2087 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 2088 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 2089 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 2090 | ||
| 2091 | MDRV_PALETTE_INIT( psx ) | |
| 2092 | MDRV_VIDEO_START( psx_type2 ) | |
| 2093 | MDRV_VIDEO_UPDATE( psx ) | |
| 2094 | ||
| 2095 | /* sound hardware */ | |
| 2096 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 2097 | ||
| 2098 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 2099 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 2100 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 2101 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 2102 | ||
| 2103 | 1941 | MDRV_SOUND_ADD( YMF271, 16934400 ) |
| 2104 | 1942 | MDRV_SOUND_CONFIG( ymf271_interface ) |
| 2105 | 1943 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| r1591 | r1592 | |
| 2411 | 2249 | } |
| 2412 | 2250 | |
| 2413 | 2251 | static MACHINE_DRIVER_START( coh1000a ) |
| 2414 | /* basic machine hardware */ | |
| 2415 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 2416 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 2417 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 2252 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 2418 | 2253 | |
| 2419 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 2420 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 2421 | ||
| 2422 | 2254 | MDRV_MACHINE_RESET( coh1000a ) |
| 2423 | 2255 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 2424 | ||
| 2425 | /* video hardware */ | |
| 2426 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 2427 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 2428 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 2429 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 2430 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 2431 | ||
| 2432 | MDRV_PALETTE_INIT( psx ) | |
| 2433 | MDRV_VIDEO_START( psx_type2 ) | |
| 2434 | MDRV_VIDEO_UPDATE( psx ) | |
| 2435 | ||
| 2436 | /* sound hardware */ | |
| 2437 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 2438 | ||
| 2439 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 2440 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 2441 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 2442 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 2443 | 2256 | MACHINE_DRIVER_END |
| 2444 | 2257 | |
| 2445 | 2258 | /* |
| r1591 | r1592 | |
| 2578 | 2391 | } |
| 2579 | 2392 | |
| 2580 | 2393 | static MACHINE_DRIVER_START( coh1001l ) |
| 2581 | /* basic machine hardware */ | |
| 2582 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 2583 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 2584 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 2394 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 2585 | 2395 | |
| 2586 | // MDRV_CPU_ADD( M68000, 10000000 ) | |
| 2587 | 2396 | // /* audio CPU */ |
| 2397 | // MDRV_CPU_ADD( M68000, 10000000 ) | |
| 2588 | 2398 | // MDRV_CPU_PROGRAM_MAP( atlus_snd_map, 0 ) |
| 2589 | 2399 | |
| 2590 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 2591 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 2592 | ||
| 2593 | 2400 | MDRV_MACHINE_RESET( coh1001l ) |
| 2594 | 2401 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 2595 | 2402 | |
| 2596 | /* video hardware */ | |
| 2597 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 2598 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 2599 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 2600 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 2601 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 2602 | ||
| 2603 | MDRV_PALETTE_INIT( psx ) | |
| 2604 | MDRV_VIDEO_START( psx_type2 ) | |
| 2605 | MDRV_VIDEO_UPDATE( psx ) | |
| 2606 | ||
| 2607 | /* sound hardware */ | |
| 2608 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 2609 | ||
| 2610 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 2611 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 2612 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 2613 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 2614 | ||
| 2615 | 2403 | // MDRV_SOUND_ADD( YMZ280B, ymz280b_intf ) |
| 2616 | 2404 | MACHINE_DRIVER_END |
| 2617 | 2405 | |
| r1591 | r1592 | |
| 2667 | 2455 | } |
| 2668 | 2456 | |
| 2669 | 2457 | static MACHINE_DRIVER_START( coh1002v ) |
| 2670 | /* basic machine hardware */ | |
| 2671 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 2672 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 2458 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 2459 | ||
| 2673 | 2460 | MDRV_CPU_VBLANK_INT( coh1002v_vblank, 1 ) |
| 2674 | 2461 | |
| 2675 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 2676 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 2677 | ||
| 2678 | 2462 | MDRV_MACHINE_RESET( coh1002v ) |
| 2679 | 2463 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 2680 | ||
| 2681 | /* video hardware */ | |
| 2682 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 2683 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 2684 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 2685 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 2686 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 2687 | ||
| 2688 | MDRV_PALETTE_INIT( psx ) | |
| 2689 | MDRV_VIDEO_START( psx_type2 ) | |
| 2690 | MDRV_VIDEO_UPDATE( psx ) | |
| 2691 | ||
| 2692 | /* sound hardware */ | |
| 2693 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 2694 | ||
| 2695 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 2696 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 2697 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 2698 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 2699 | 2464 | MACHINE_DRIVER_END |
| 2700 | 2465 | |
| 2701 | 2466 | /* |
| r1591 | r1592 | |
| 2936 | 2701 | }; |
| 2937 | 2702 | |
| 2938 | 2703 | static MACHINE_DRIVER_START( coh1002m ) |
| 2939 | /* basic machine hardware */ | |
| 2940 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 2941 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 2942 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 2704 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 2943 | 2705 | |
| 2944 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 2945 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 2946 | ||
| 2947 | 2706 | MDRV_MACHINE_RESET( coh1002m ) |
| 2948 | 2707 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 2949 | ||
| 2950 | /* video hardware */ | |
| 2951 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 2952 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 2953 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 2954 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 2955 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 2956 | ||
| 2957 | MDRV_PALETTE_INIT( psx ) | |
| 2958 | MDRV_VIDEO_START( psx_type2 ) | |
| 2959 | MDRV_VIDEO_UPDATE( psx ) | |
| 2960 | ||
| 2961 | /* sound hardware */ | |
| 2962 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 2963 | ||
| 2964 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 2965 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 2966 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 2967 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 2968 | 2708 | MACHINE_DRIVER_END |
| 2969 | 2709 | |
| 2970 | 2710 | static MACHINE_DRIVER_START( coh1002msnd ) |
| 2971 | /* basic machine hardware */ | |
| 2972 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 2973 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 2974 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 2711 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 2975 | 2712 | |
| 2976 | MDRV_CPU_ADD( Z80, 32000000/8 ) | |
| 2977 | 2713 | /* audio CPU */ |
| 2714 | MDRV_CPU_ADD( Z80, 32000000/8 ) | |
| 2978 | 2715 | MDRV_CPU_PROGRAM_MAP( cbaj_z80_map, 0 ) |
| 2979 | 2716 | MDRV_CPU_IO_MAP( cbaj_z80_port_map, 0 ) |
| 2980 | 2717 | |
| 2981 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 2982 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 2983 | ||
| 2984 | 2718 | MDRV_MACHINE_RESET( coh1002m ) |
| 2985 | 2719 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 2986 | 2720 | |
| 2987 | /* video hardware */ | |
| 2988 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 2989 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 2990 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 2991 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 2992 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 2993 | ||
| 2994 | MDRV_PALETTE_INIT( psx ) | |
| 2995 | MDRV_VIDEO_START( psx_type2 ) | |
| 2996 | MDRV_VIDEO_UPDATE( psx ) | |
| 2997 | ||
| 2998 | /* sound hardware */ | |
| 2999 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 3000 | ||
| 3001 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 3002 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 3003 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 3004 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 3005 | ||
| 3006 | 2721 | MDRV_SOUND_ADD(YMZ280B, 16934400) |
| 3007 | 2722 | MDRV_SOUND_CONFIG(ymz280b_intf) |
| 3008 | 2723 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| r1591 | r1592 | |
| 3010 | 2725 | MACHINE_DRIVER_END |
| 3011 | 2726 | |
| 3012 | 2727 | static MACHINE_DRIVER_START( coh1002ml ) |
| 3013 | /* basic machine hardware */ | |
| 3014 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) | |
| 3015 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) | |
| 3016 | MDRV_CPU_VBLANK_INT( psx_vblank, 1 ) | |
| 2728 | MDRV_IMPORT_FROM( zn1_2mb_vram ) | |
| 3017 | 2729 | |
| 3018 | 2730 | MDRV_CPU_ADD( Z80, 8000000 ) |
| 3019 | 2731 | MDRV_CPU_PROGRAM_MAP( link_readmem, link_writemem ) |
| 3020 | 2732 | |
| 3021 | MDRV_SCREEN_REFRESH_RATE( 60 ) | |
| 3022 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 3023 | ||
| 3024 | 2733 | MDRV_MACHINE_RESET( coh1002m ) |
| 3025 | 2734 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 3026 | ||
| 3027 | /* video hardware */ | |
| 3028 | MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER ) | |
| 3029 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 3030 | MDRV_SCREEN_SIZE( 1024, 1024 ) | |
| 3031 | MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 ) | |
| 3032 | MDRV_PALETTE_LENGTH( 65536 ) | |
| 3033 | ||
| 3034 | MDRV_PALETTE_INIT( psx ) | |
| 3035 | MDRV_VIDEO_START( psx_type2 ) | |
| 3036 | MDRV_VIDEO_UPDATE( psx ) | |
| 3037 | ||
| 3038 | /* sound hardware */ | |
| 3039 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 3040 | ||
| 3041 | MDRV_SOUND_ADD( PSXSPU, 0 ) | |
| 3042 | MDRV_SOUND_CONFIG( psxspu_interface ) | |
| 3043 | MDRV_SOUND_ROUTE(0, "left", 0.35) | |
| 3044 | MDRV_SOUND_ROUTE(1, "right", 0.35) | |
| 3045 | 2735 | MACHINE_DRIVER_END |
| 3046 | 2736 | |
| 3047 | 2737 | static INPUT_PORTS_START( zn ) |
| r1591 | r1592 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | static ADDRESS_MAP_START( paradise_readport, ADDRESS_SPACE_IO, 8 ) |
| 99 | AM_RANGE(0x0000, 0x17ff) AM_READ( | |
| 99 | AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8 | |
| 100 | 100 | AM_RANGE(0x2010, 0x2010) AM_READ(OKIM6295_status_0_r ) // OKI 0 |
| 101 | 101 | AM_RANGE(0x2030, 0x2030) AM_READ(OKIM6295_status_1_r ) // OKI 1 |
| 102 | 102 | AM_RANGE(0x2020, 0x2020) AM_READ(input_port_0_r ) // DSW 1 |
| r1591 | r1592 | |
| 536 | 536 | static MACHINE_DRIVER_START( paradise ) |
| 537 | 537 | |
| 538 | 538 | /* basic machine hardware */ |
| 539 | MDRV_CPU_ADD_TAG("main", Z80, 12 | |
| 539 | MDRV_CPU_ADD_TAG("main", Z80, XTAL_12MHz | |
| 540 | 540 | MDRV_CPU_PROGRAM_MAP(paradise_map,0) |
| 541 | 541 | MDRV_CPU_IO_MAP(paradise_readport,paradise_writeport) |
| 542 | 542 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* No nmi routine */ |
| r1591 | r1592 | |
| 558 | 558 | /* sound hardware */ |
| 559 | 559 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 560 | 560 | |
| 561 | MDRV_SOUND_ADD(OKIM6295, 1000000) | |
| 562 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) | |
| 561 | MDRV_SOUND_ADD(OKIM6295, XTAL_12MHz/12) /* verified on pcb */ | |
| 562 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */ | |
| 563 | 563 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 564 | 564 | |
| 565 | MDRV_SOUND_ADD_TAG("oki2", OKIM6295, 1000000) | |
| 566 | MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7high) | |
| 565 | MDRV_SOUND_ADD_TAG("oki2", OKIM6295, XTAL_12MHz/12) /* verified on pcb */ | |
| 566 | MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7high) /* verified on pcb */ | |
| 567 | 567 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 568 | 568 | MACHINE_DRIVER_END |
| 569 | 569 |
| r1591 | r1592 | |
|---|---|---|
| 73 | 73 | AM_RANGE(0x100000, 0x103fff) AM_READ(MRA16_RAM) /* main */ |
| 74 | 74 | AM_RANGE(0x200000, 0x203fff) AM_READ(PC090OJ_word_0_r) |
| 75 | 75 | AM_RANGE(0x400000, 0x47ffff) AM_READ(volfied_video_ram_r) |
| 76 | AM_RANGE(0x500000, 0x503fff) AM_READ( | |
| 76 | AM_RANGE(0x500000, 0x503fff) AM_READ(MRA | |
| 77 | 77 | AM_RANGE(0xd00000, 0xd00001) AM_READ(volfied_video_ctrl_r) |
| 78 | 78 | AM_RANGE(0xe00002, 0xe00003) AM_READ(taitosound_comm16_lsb_r) |
| 79 | 79 | AM_RANGE(0xf00000, 0xf007ff) AM_READ(volfied_cchip_ram_r) |
| r1591 | r1592 | |
| 237 | 237 | |
| 238 | 238 | static void irqhandler(int irq) |
| 239 | 239 | { |
| 240 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 240 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | static INTERRUPT_GEN( dribling_irq_gen ) |
| 56 | 56 | { |
| 57 | 57 | if (di) |
| 58 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 58 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| r1591 | r1592 | |
| 98 | 98 | /* bit 7 = di */ |
| 99 | 99 | di = (data >> 7) & 1; |
| 100 | 100 | if (!di) |
| 101 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 101 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 102 | 102 | |
| 103 | 103 | /* bit 6 = parata */ |
| 104 | 104 |
| r1591 | r1592 | |
|---|---|---|
| 1930 | 1930 | ROM_LOAD( "tpg1-gr5.bin", 0x0a000, 0x2000, CRC(067bfd66) SHA1(32f5973f2f0aed67c8f9b5886f52b9dc516a611e) ) |
| 1931 | 1931 | ROM_END |
| 1932 | 1932 | |
| 1933 | ROM_START( trivia12 ) | |
| 1934 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 64k for code for the first CPU, plus 128k of banked ROMs */ | |
| 1935 | ROM_LOAD( "ab0.u9a", 0x10000, 0x2000, CRC(41ca9a81) SHA1(127beee924d4213de874f7def9875fd3a26c6b5f) ) | |
| 1936 | ROM_LOAD( "ab1.u8a", 0x12000, 0x2000, CRC(b3b48a3d) SHA1(e9554887430014116ff8e5e3d0ef5678d13f224c) ) | |
| 1937 | ROM_LOAD( "ab2.u7a", 0x14000, 0x2000, CRC(ab652ce9) SHA1(06f47c274b94f046a59a1dc432c55ee8f450a246) ) | |
| 1938 | ROM_LOAD( "ab3.u6a", 0x16000, 0x2000, CRC(4b382c77) SHA1(4a14166c90542ecec3677d9098a26723be6a26e2) ) | |
| 1939 | ROM_LOAD( "ab4.u5a", 0x18000, 0x2000, CRC(9b4a8c4e) SHA1(c0354862b428ad8a5b1d229cadfcfc7e688b06c1) ) | |
| 1940 | ROM_LOAD( "ab5.u4a", 0x1a000, 0x2000, CRC(499773a4) SHA1(c0c0ad2a63a9dbb7585cab7e21162bbc58fec0d8) ) | |
| 1941 | ROM_LOAD( "cd.u3a", 0x2c000, 0x2000, CRC(12d870ba) SHA1(b86a8cbf8037df78437056f5ff57e7b8b5e4c94e) ) | |
| 1942 | ROM_LOAD( "ef.u2a", 0x2e000, 0x2000, CRC(d902ee28) SHA1(18e3c96e1ac50f847d1b9f4f868f19e074d147ff) ) | |
| 1933 | 1943 | |
| 1944 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for Z80 */ | |
| 1945 | ROM_LOAD( "sentesnd", 0x00000, 0x2000, CRC(4dd0a525) SHA1(f0c447adc5b67917851a9df978df851247e75c43) ) | |
| 1946 | ||
| 1947 | ROM_REGION( 0x10000, REGION_GFX1, 0 ) /* up to 64k of sprites */ | |
| 1948 | ROM_LOAD( "gr0.u9b", 0x00000, 0x2000, CRC(20c9217a) SHA1(79ef058633149da8d2835405954ac31c661bf660) ) | |
| 1949 | ROM_LOAD( "gr1.u8b", 0x02000, 0x2000, CRC(d7f44504) SHA1(804dbc4c006b20bdb01bdf02754e0d98f6fbacbe) ) | |
| 1950 | ROM_LOAD( "gr2.u7b", 0x04000, 0x2000, CRC(4e59a15d) SHA1(c584bae32e2e5d8b5a48c44a31272b4f9dadfcd1) ) | |
| 1951 | ROM_LOAD( "gr3.u6b", 0x06000, 0x2000, CRC(323a8640) SHA1(7ec6f8f9bcfa5de442dce4f6e81e697da34dbab8) ) | |
| 1952 | ROM_LOAD( "gr4.u5b", 0x08000, 0x2000, CRC(673acf42) SHA1(7b36a86441732ba14576f9c1dd14fe0da575d4bf) ) | |
| 1953 | ROM_LOAD( "gr5.u4b", 0x0a000, 0x2000, CRC(d17d5431) SHA1(b92741f6eda01f2e360e73a9f4df728fc44d7e1b) ) | |
| 1954 | ROM_END | |
| 1955 | ||
| 1956 | ||
| 1934 | 1957 | ROM_START( triviag2 ) |
| 1935 | 1958 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 64k for code for the first CPU, plus 128k of banked ROMs */ |
| 1936 | 1959 | ROM_LOAD( "ab01.bin", 0x10000, 0x4000, CRC(4fca20c5) SHA1(595b32ff035036cafbf49d75aa170f39e9f52b38) ) |
| r1591 | r1592 | |
| 2148 | 2171 | ROM_LOAD( "gr67.u1c", 0x0c000, 0x4000, CRC(3311f9c0) SHA1(63b185c761b258113c31cc269ce0b1462bf37f40) ) |
| 2149 | 2172 | ROM_END |
| 2150 | 2173 | |
| 2174 | ROM_START( nstockr2 ) | |
| 2175 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 64k for code for the first CPU, plus 128k of banked ROMs */ | |
| 2176 | ROM_LOAD( "ab01.u8a", 0x10000, 0x4000, CRC(a635f973) SHA1(edb12469818a3114fb97d21e11c63eb37678a07b) ) | |
| 2177 | ROM_LOAD( "ab23.u7a", 0x14000, 0x4000, CRC(223acbb2) SHA1(195ebd349722cce323616c81cc4e86f0a9c6fa13) ) | |
| 2178 | ROM_LOAD( "ab45.u6a", 0x18000, 0x4000, CRC(27a728b5) SHA1(c72634112a04d58a695fb43bf30f44e3f7ba7de2) ) | |
| 2179 | ROM_LOAD( "ab67.u5a", 0x1c000, 0x4000, CRC(2999cdf2) SHA1(a64ae04f264ad286a87069cfb176e7511df08e78) ) | |
| 2180 | ROM_LOAD( "cd01.u4a", 0x20000, 0x4000, CRC(75e9b51a) SHA1(dbe575d37836245746ea85ffe85e8e6665ec37ea) ) | |
| 2181 | ROM_LOAD( "cd23.u3a", 0x24000, 0x4000, CRC(0a32e0a5) SHA1(dedbe08aed483bae27e1a607334e24cdfcb2f851) ) | |
| 2182 | ROM_LOAD( "cd45.u2a", 0x28000, 0x4000, CRC(9bb292fe) SHA1(6fc7abcc110c2cf7399d11a478cfdadb3439b6ab) ) | |
| 2183 | ROM_LOAD( "cd6ef.u1a", 0x2c000, 0x4000, CRC(c77d2302) SHA1(2b0956a7d6bdff5e4f77084149a9528fb07154dc) ) | |
| 2151 | 2184 | |
| 2185 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for Z80 */ | |
| 2186 | ROM_LOAD( "sentesnd", 0x00000, 0x2000, CRC(4dd0a525) SHA1(f0c447adc5b67917851a9df978df851247e75c43) ) | |
| 2187 | ||
| 2188 | ROM_REGION( 0x10000, REGION_GFX1, 0 ) /* up to 64k of sprites */ | |
| 2189 | ROM_LOAD( "gr01.u4c", 0x00000, 0x4000, CRC(fd0c38be) SHA1(b9e12e76f44f2b2b3ca6a57c58f0cbb019b1971f) ) | |
| 2190 | ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, CRC(35d4433e) SHA1(399d04c2a29d993f77d0d5c2d62915081d4a85dd) ) | |
| 2191 | ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, CRC(734b858a) SHA1(71763789807021938b840a88af34aad7f4751298) ) | |
| 2192 | ROM_LOAD( "gr67.u1c", 0x0c000, 0x4000, CRC(3311f9c0) SHA1(63b185c761b258113c31cc269ce0b1462bf37f40) ) | |
| 2193 | ROM_END | |
| 2194 | ||
| 2195 | ||
| 2152 | 2196 | ROM_START( sfootbal ) |
| 2153 | 2197 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 64k for code for the first CPU, plus 128k of banked ROMs */ |
| 2154 | 2198 | ROM_LOAD( "sfbab01.bin", 0x10000, 0x4000, CRC(2a69803f) SHA1(ca86c9d079fbebae4c93c889d98a8573facc05da) ) |
| r1591 | r1592 | |
| 2449 | 2493 | GAME( 1984, snakepit, 0, balsente, snakepit, snakepit, ROT0, "Bally/Sente", "Snake Pit", GAME_SUPPORTS_SAVE ) |
| 2450 | 2494 | GAME( 1984, snakjack, 0, balsente, snakjack, snakjack, ROT0, "Bally/Sente", "Snacks'n Jaxson", GAME_SUPPORTS_SAVE ) |
| 2451 | 2495 | GAME( 1984, stocker, 0, balsente, stocker, stocker, ROT0, "Bally/Sente", "Stocker", GAME_SUPPORTS_SAVE ) |
| 2452 | GAME( 1984, triviag1, 0, balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I)", GAME_SUPPORTS_SAVE ) | |
| 2496 | GAME( 1984, triviag1, 0, balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2497 | GAME( 1984, trivia12, 0, balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2453 | 2498 | GAME( 1984, triviag2, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Genus II)", GAME_SUPPORTS_SAVE ) |
| 2454 | 2499 | GAME( 1984, triviasp, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (All Star Sports Edition)", GAME_SUPPORTS_SAVE ) |
| 2455 | 2500 | GAME( 1984, triviayp, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Young Players Edition)", GAME_SUPPORTS_SAVE ) |
| r1591 | r1592 | |
| 2461 | 2506 | GAME( 1985, toggle, 0, balsente, toggle, toggle, ROT0, "Bally/Sente", "Toggle (prototype)", GAME_SUPPORTS_SAVE ) |
| 2462 | 2507 | GAME( 1986, nametune, 0, balsente, nametune, nametune, ROT0, "Bally/Sente", "Name That Tune", GAME_SUPPORTS_SAVE ) |
| 2463 | 2508 | GAME( 1986, nstocker, 0, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker", GAME_SUPPORTS_SAVE ) |
| 2509 | GAME( 1986, nstockr2, 0, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2464 | 2510 | GAME( 1986, sfootbal, 0, balsente, sfootbal, sfootbal, ROT0, "Bally/Sente", "Street Football", GAME_SUPPORTS_SAVE ) |
| 2465 | 2511 | GAME( 1986, spiker, 0, balsente, spiker, spiker, ROT0, "Bally/Sente", "Spiker", GAME_SUPPORTS_SAVE ) |
| 2466 | 2512 | GAME( 1986, stompin, 0, balsente, stompin, stompin, ROT0, "Bally/Sente", "Stompin'", GAME_SUPPORTS_SAVE ) |
| r1591 | r1592 | |
|---|---|---|
| 512 | 512 | if (megadrive_irq4_pending) |
| 513 | 513 | { |
| 514 | 514 | if (MEGADRIVE_REG0_IRQ4_ENABLE) |
| 515 | { | |
| 516 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 517 | } | |
| 515 | cpunum_set_input_line(Machine, 0,4,HOLD_LINE); | |
| 518 | 516 | else |
| 519 | { | |
| 520 | cpunum_set_input_line(0,4,CLEAR_LINE); | |
| 521 | } | |
| 517 | cpunum_set_input_line(Machine, 0,4,CLEAR_LINE); | |
| 522 | 518 | } |
| 523 | 519 | |
| 524 | 520 | /* ??? Fatal Rewind needs this but I'm not sure it's accurate behavior |
| r1591 | r1592 | |
| 533 | 529 | if (megadrive_irq6_pending) |
| 534 | 530 | { |
| 535 | 531 | if (MEGADRIVE_REG01_IRQ6_ENABLE) |
| 536 | { | |
| 537 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 538 | } | |
| 532 | cpunum_set_input_line(Machine, 0,6,HOLD_LINE); | |
| 539 | 533 | else |
| 540 | { | |
| 541 | cpunum_set_input_line(0,6,CLEAR_LINE); | |
| 542 | } | |
| 534 | cpunum_set_input_line(Machine, 0,6,CLEAR_LINE); | |
| 543 | 535 | } |
| 544 | 536 | |
| 545 | 537 | /* ??? */ |
| r1591 | r1592 | |
| 2261 | 2253 | { |
| 2262 | 2254 | //logerror("%06x: 68000 request z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2263 | 2255 | genz80.z80_has_bus=0; |
| 2264 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2256 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2265 | 2257 | } |
| 2266 | 2258 | else |
| 2267 | 2259 | { |
| 2268 | 2260 | //logerror("%06x: 68000 return z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2269 | 2261 | genz80.z80_has_bus=1; |
| 2270 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 2262 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 2271 | 2263 | |
| 2272 | 2264 | } |
| 2273 | 2265 | } |
| r1591 | r1592 | |
| 2277 | 2269 | { |
| 2278 | 2270 | //logerror("%06x: 68000 request z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2279 | 2271 | genz80.z80_has_bus=0; |
| 2280 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2272 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2281 | 2273 | } |
| 2282 | 2274 | else |
| 2283 | 2275 | { |
| 2284 | 2276 | //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2285 | 2277 | genz80.z80_has_bus=1; |
| 2286 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 2278 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 2287 | 2279 | } |
| 2288 | 2280 | } |
| 2289 | 2281 | else // word access |
| r1591 | r1592 | |
| 2292 | 2284 | { |
| 2293 | 2285 | //logerror("%06x: 68000 request z80 Bus (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2294 | 2286 | genz80.z80_has_bus=0; |
| 2295 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2287 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2296 | 2288 | } |
| 2297 | 2289 | else |
| 2298 | 2290 | { |
| 2299 | 2291 | //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2300 | 2292 | genz80.z80_has_bus=1; |
| 2301 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 2293 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 2302 | 2294 | } |
| 2303 | 2295 | } |
| 2304 | 2296 | } |
| r1591 | r1592 | |
| 2311 | 2303 | { |
| 2312 | 2304 | //logerror("%06x: 68000 clear z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2313 | 2305 | genz80.z80_is_reset=0; |
| 2314 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 2306 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 2315 | 2307 | } |
| 2316 | 2308 | else |
| 2317 | 2309 | { |
| 2318 | 2310 | //logerror("%06x: 68000 start z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2319 | 2311 | genz80.z80_is_reset=1; |
| 2320 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2312 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2321 | 2313 | sndti_reset(SOUND_YM2612, 0); |
| 2322 | 2314 | } |
| 2323 | 2315 | } |
| r1591 | r1592 | |
| 2327 | 2319 | { |
| 2328 | 2320 | //logerror("%06x: 68000 clear z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2329 | 2321 | genz80.z80_is_reset=0; |
| 2330 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 2322 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE); | |
| 2331 | 2323 | } |
| 2332 | 2324 | else |
| 2333 | 2325 | { |
| 2334 | 2326 | //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2335 | 2327 | genz80.z80_is_reset=1; |
| 2336 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2328 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2337 | 2329 | sndti_reset(SOUND_YM2612, 0); |
| 2338 | 2330 | |
| 2339 | 2331 | } |
| r1591 | r1592 | |
| 2344 | 2336 | { |
| 2345 | 2337 | //logerror("%06x: 68000 clear z80 reset (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2346 | 2338 | genz80.z80_is_reset=0; |
| 2347 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE ); | |
| 2339 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE ); | |
| 2348 | 2340 | } |
| 2349 | 2341 | else |
| 2350 | 2342 | { |
| 2351 | 2343 | //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); |
| 2352 | 2344 | genz80.z80_is_reset=1; |
| 2353 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2345 | cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2354 | 2346 | sndti_reset(SOUND_YM2612, 0); |
| 2355 | 2347 | } |
| 2356 | 2348 | } |
| r1591 | r1592 | |
| 4318 | 4310 | |
| 4319 | 4311 | if (genesis_scanline_counter==megadrive_z80irq_scanline) |
| 4320 | 4312 | { |
| 4321 | if ((genz80.z80_has_bus==1) && (genz80.z80_is_reset==0)) cpunum_set_input_line(1,0,HOLD_LINE); | |
| 4313 | if ((genz80.z80_has_bus==1) && (genz80.z80_is_reset==0)) cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 4322 | 4314 | } |
| 4323 | 4315 | if (genesis_scanline_counter==megadrive_z80irq_scanline+1) |
| 4324 | 4316 | { |
| 4325 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 4317 | cpunum_set_input_line(machine, 1,0,CLEAR_LINE); | |
| 4326 | 4318 | } |
| 4327 | 4319 | |
| 4328 | 4320 | |
| r1591 | r1592 | |
| 4340 | 4332 | |
| 4341 | 4333 | { |
| 4342 | 4334 | // megadrive_irq6_pending = 1; |
| 4343 | if (MEGADRIVE_REG01_IRQ6_ENABLE) cpunum_set_input_line(0,6,HOLD_LINE); | |
| 4335 | if (MEGADRIVE_REG01_IRQ6_ENABLE) cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 4344 | 4336 | } |
| 4345 | 4337 | } |
| 4346 | 4338 | |
| 4347 | 4339 | static TIMER_CALLBACK( irq4_on_callback ) |
| 4348 | 4340 | { |
| 4349 | 4341 | //mame_printf_debug("irq4 active on %d\n",genesis_scanline_counter); |
| 4350 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 4342 | cpunum_set_input_line(machine, 0,4,HOLD_LINE); | |
| 4351 | 4343 | } |
| 4352 | 4344 | |
| 4353 | 4345 | /*****************************************************************************************/ |
| r1591 | r1592 | |
| 4395 | 4387 | |
| 4396 | 4388 | |
| 4397 | 4389 | genz80.z80_is_reset = 1; |
| 4398 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 4390 | cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); | |
| 4399 | 4391 | genz80.z80_has_bus = 1; |
| 4400 | cpunum_set_input_line(genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 4392 | cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); | |
| 4401 | 4393 | genz80.z80_bank_pos = 0; |
| 4402 | 4394 | genz80.z80_bank_addr = 0; |
| 4403 | 4395 | genesis_scanline_counter = -1; |
| r1591 | r1592 | |
| 4417 | 4409 | timer_adjust(scanline_timer, attotime_zero, 0, attotime_zero); |
| 4418 | 4410 | |
| 4419 | 4411 | // set_refresh_rate(megadriv_framerate); |
| 4420 | cpunum_set_clockscale(0, 0.9950f); /* Fatal Rewind is very fussy... */ | |
| 4421 | // cpunum_set_clockscale(0, 0.3800f); /* Fatal Rewind is very fussy... */ | |
| 4412 | cpunum_set_clockscale(machine, 0, 0.9950f); /* Fatal Rewind is very fussy... */ | |
| 4413 | // cpunum_set_clockscale(machine, 0, 0.3800f); /* Fatal Rewind is very fussy... */ | |
| 4422 | 4414 | |
| 4423 | 4415 | memset(megadrive_ram,0x00,0x10000); |
| 4424 | 4416 | |
| r1591 | r1592 | |
| 4453 | 4445 | megadrive_sprite_collision=0;//? when to reset this .. |
| 4454 | 4446 | megadrive_imode = MEGADRIVE_REG0C_INTERLEAVE; // can't change mid-frame.. |
| 4455 | 4447 | megadrive_imode_odd_frame^=1; |
| 4456 | // cpunum_set_input_line(1,0,CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it.. | |
| 4448 | // cpunum_set_input_line(machine, 1,0,CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it.. | |
| 4457 | 4449 | |
| 4458 | if (MD_RESET_BUTTON) cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 4450 | if (MD_RESET_BUTTON) cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 4459 | 4451 | |
| 4460 | 4452 | /* |
| 4461 | 4453 | int megadrive_total_scanlines = 262; |
| r1591 | r1592 | |
|---|---|---|
| 80 | 80 | { |
| 81 | 81 | switch ( cpu_getiloops() ) |
| 82 | 82 | { |
| 83 | case 2: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 84 | case 1: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 85 | case 0: cpunum_set_input_line(0, 5, HOLD_LINE); break; | |
| 83 | case 2: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 84 | case 1: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 85 | case 0: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; | |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 |
| r1591 | r1592 | |
|---|---|---|
| 253 | 253 | static UINT32 *tms1_boot; |
| 254 | 254 | static UINT8 tms_spinning[2]; |
| 255 | 255 | |
| 256 | #define START_TMS_SPINNING(n) do { cpu_spinuntil_trigger(7351 + n); tms_spinning[n] = 1; } while (0) | |
| 257 | #define STOP_TMS_SPINNING(n) do { cpu_trigger(7351 + n); tms_spinning[n] = 0; } while (0) | |
| 256 | #define START_TMS_SPINNING(n) do { cpu_spinuntil_trigger(7351 + n); tms_spinning[n] = 1; } while (0) | |
| 257 | #define STOP_TMS_SPINNING(machine, n) do { cpu_trigger(machine, 7351 + n); tms_spinning[n] = 0; } while (0) | |
| 258 | 258 | |
| 259 | 259 | |
| 260 | 260 | |
| r1591 | r1592 | |
| 291 | 291 | |
| 292 | 292 | /* update it */ |
| 293 | 293 | if (level) |
| 294 | cpunum_set_input_line(0, level, ASSERT_LINE); | |
| 294 | cpunum_set_input_line(Machine, 0, level, ASSERT_LINE); | |
| 295 | 295 | else |
| 296 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 296 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
| r1591 | r1592 | |
| 335 | 335 | |
| 336 | 336 | static MACHINE_RESET( drivedge ) |
| 337 | 337 | { |
| 338 | | |
| 338 | MACHINE_RESET_CALL(itech32 | |
| 339 | 339 | |
| 340 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 341 | cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 342 | STOP_TMS_SPINNING(0); | |
| 343 | STOP_TMS_SPINNING(1); | |
| 340 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 341 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 342 | STOP_TMS_SPINNING(machine, 0); | |
| 343 | STOP_TMS_SPINNING(machine, 1); | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | |
| r1591 | r1592 | |
| 536 | 536 | { |
| 537 | 537 | sound_data = param; |
| 538 | 538 | sound_int_state = 1; |
| 539 | cpunum_set_input_line(1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 539 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | |
| r1591 | r1592 | |
| 562 | 562 | |
| 563 | 563 | static READ8_HANDLER( sound_data_r ) |
| 564 | 564 | { |
| 565 | cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 565 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 566 | 566 | sound_int_state = 0; |
| 567 | 567 | return sound_data; |
| 568 | 568 | } |
| r1591 | r1592 | |
| 633 | 633 | static void via_irq(int state) |
| 634 | 634 | { |
| 635 | 635 | if (state) |
| 636 | cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 636 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 637 | 637 | else |
| 638 | cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 638 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | |
| r1591 | r1592 | |
| 668 | 668 | |
| 669 | 669 | static WRITE8_HANDLER( firq_clear_w ) |
| 670 | 670 | { |
| 671 | cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 671 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | |
| r1591 | r1592 | |
| 681 | 681 | |
| 682 | 682 | static WRITE32_HANDLER( tms_reset_assert_w ) |
| 683 | 683 | { |
| 684 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 685 | cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 684 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 685 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | |
| r1591 | r1592 | |
| 691 | 691 | /* kludge to prevent crash on first boot */ |
| 692 | 692 | if ((tms1_ram[0] & 0xff000000) == 0) |
| 693 | 693 | { |
| 694 | cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 695 | STOP_TMS_SPINNING(0); | |
| 694 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 695 | STOP_TMS_SPINNING(Machine, 0); | |
| 696 | 696 | } |
| 697 | 697 | if ((tms2_ram[0] & 0xff000000) == 0) |
| 698 | 698 | { |
| 699 | cpunum_set_input_line(3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 700 | STOP_TMS_SPINNING(1); | |
| 699 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 700 | STOP_TMS_SPINNING(Machine, 1); | |
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | |
| r1591 | r1592 | |
| 706 | 706 | { |
| 707 | 707 | COMBINE_DATA(&tms1_ram[offset]); |
| 708 | 708 | if (offset == 0) COMBINE_DATA(tms1_boot); |
| 709 | if (offset == 0x382 && tms_spinning[0]) STOP_TMS_SPINNING(0); | |
| 709 | if (offset == 0x382 && tms_spinning[0]) STOP_TMS_SPINNING(Machine, 0); | |
| 710 | 710 | if (!tms_spinning[0]) |
| 711 | 711 | cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20)); |
| 712 | 712 | } |
| r1591 | r1592 | |
| 715 | 715 | static WRITE32_HANDLER( tms2_68k_ram_w ) |
| 716 | 716 | { |
| 717 | 717 | COMBINE_DATA(&tms2_ram[offset]); |
| 718 | if (offset == 0x382 && tms_spinning[1]) STOP_TMS_SPINNING(1); | |
| 718 | if (offset == 0x382 && tms_spinning[1]) STOP_TMS_SPINNING(Machine, 1); | |
| 719 | 719 | if (!tms_spinning[1]) |
| 720 | 720 | cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20)); |
| 721 | 721 | } |
| r1591 | r1592 | |
| 832 | 832 | |
| 833 | 833 | static NVRAM_HANDLER( tournament ) |
| 834 | 834 | { |
| 835 | nvram_handler_itech020( machine, file, read_or_write ); | |
| 836 | nvram_handler_timekeeper_0( machine, file, read_or_write ); | |
| 835 | NVRAM_HANDLER_CALL(itech020); | |
| 836 | NVRAM_HANDLER_CALL(timekeeper_0); | |
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | |
| r1591 | r1592 | |
| 3860 | 3860 | /* |
| 3861 | 3861 | Tournament Version |
| 3862 | 3862 | */ |
| 3863 | | |
| 3863 | DRIVER_INIT_CALL(aama | |
| 3864 | 3864 | timekeeper_init( 0, TIMEKEEPER_M48T02, NULL ); |
| 3865 | 3865 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r); |
| 3866 | 3866 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_w); |
| r1591 | r1592 | |
| 3898 | 3898 | { |
| 3899 | 3899 | /* a little extra protection */ |
| 3900 | 3900 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680003, 0, 0, gtclass_prot_result_r); |
| 3901 | | |
| 3901 | DRIVER_INIT_CALL(aama | |
| 3902 | 3902 | |
| 3903 | 3903 | /* The protection code is: |
| 3904 | 3904 |
| r1591 | r1592 | |
|---|---|---|
| 271 | 271 | |
| 272 | 272 | static INTERRUPT_GEN( snd_irq ) |
| 273 | 273 | { |
| 274 | cpunum_set_input_line(1,UPD7810_INTF2,HOLD_LINE); | |
| 274 | cpunum_set_input_line(machine, 1,UPD7810_INTF2,HOLD_LINE); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | static UPD7810_CONFIG sound_cpu_config = |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static WRITE8_HANDLER( sspeedr_int_ack_w ) |
| 57 | 57 | { |
| 58 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 58 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 |
| r1591 | r1592 | |
|---|---|---|
| 374 | 374 | static WRITE8_HANDLER( nmi_enable_w ) |
| 375 | 375 | { |
| 376 | 376 | //if(data & 0x80) |
| 377 | //cpunum_set_input_line(0, INPUT_LINE_NMI,ASSERT_LINE); | |
| 377 | //cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI,ASSERT_LINE); | |
| 378 | 378 | //if(!(data & 0x80)) |
| 379 | //cpunum_set_input_line(0, INPUT_LINE_NMI,CLEAR_LINE); | |
| 379 | //cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI,CLEAR_LINE); | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | static READ8_HANDLER( kludge_r ) |
| r1591 | r1592 | |
| 438 | 438 | } |
| 439 | 439 | else//keyboard emulation |
| 440 | 440 | { |
| 441 | cpunum_set_input_line(0,1,PULSE_LINE); | |
| 441 | cpunum_set_input_line(Machine, 0,1,PULSE_LINE); | |
| 442 | 442 | return 0x00;//Keyboard is disconnected |
| 443 | 443 | //return 0xaa;//Keyboard code |
| 444 | 444 | } |
| r1591 | r1592 | |
| 471 | 471 | |
| 472 | 472 | static WRITE8_HANDLER( sys_reset_w ) |
| 473 | 473 | { |
| 474 | cpunum_set_input_line(0,INPUT_LINE_RESET,PULSE_LINE); | |
| 474 | cpunum_set_input_line(Machine, 0,INPUT_LINE_RESET,PULSE_LINE); | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | { |
| 111 | 111 | soundlatch_w(0,data & 0xff); |
| 112 | 112 | //needed? |
| 113 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 113 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| r1591 | r1592 | |
| 310 | 310 | |
| 311 | 311 | static void irqhandler(int irq) |
| 312 | 312 | { |
| 313 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 313 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | static WRITE8_HANDLER(writeA) |
| r1591 | r1592 | |
| 327 | 327 | |
| 328 | 328 | static void ashnojoe_adpcm_int (int data) |
| 329 | 329 | { |
| 330 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 330 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | static const struct MSM5205interface msm5205_interface = |
| r1591 | r1592 | |
|---|---|---|
| 18 | 18 | #include "sound/dac.h" |
| 19 | 19 | |
| 20 | 20 | |
| 21 | static VIDEO_UPDATE( findout ) | |
| 22 | { | |
| 23 | copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0); | |
| 24 | return 0; | |
| 25 | } | |
| 26 | ||
| 27 | ||
| 28 | 21 | static UINT8 drawctrl[3]; |
| 29 | 22 | |
| 30 | 23 | static WRITE8_HANDLER( findout_drawctrl_w ) |
| r1591 | r1592 | |
| 470 | 463 | MDRV_PALETTE_LENGTH(256) |
| 471 | 464 | |
| 472 | 465 | MDRV_VIDEO_START(generic_bitmapped) |
| 473 | MDRV_VIDEO_UPDATE( | |
| 466 | MDRV_VIDEO_UPDATE(generic_bitmapped) | |
| 474 | 467 | |
| 475 | 468 | /* sound hardware */ |
| 476 | 469 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r1591 | r1592 | |
|---|---|---|
| 45 | 45 | static WRITE8_HANDLER( mouser_sound_interrupt_w ) |
| 46 | 46 | { |
| 47 | 47 | mouser_sound_byte = data; |
| 48 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 48 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static READ8_HANDLER( mouser_sound_byte_r ) |
| r1591 | r1592 | |
|---|---|---|
| 166 | 166 | |
| 167 | 167 | static TIMER_CALLBACK( undrfire_interrupt5 ) |
| 168 | 168 | { |
| 169 | cpunum_set_input_line(0,5,HOLD_LINE); | |
| 169 | cpunum_set_input_line(machine, 0,5,HOLD_LINE); | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| r1591 | r1592 | |
| 542 | 542 | static INTERRUPT_GEN( undrfire_interrupt ) |
| 543 | 543 | { |
| 544 | 544 | frame_counter^=1; |
| 545 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 545 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | static MACHINE_DRIVER_START( undrfire ) |
| r1591 | r1592 | |
|---|---|---|
| 253 | 253 | deco32_raster_display_list[deco32_raster_display_position++]=deco32_pf12_control[3]&0xffff; |
| 254 | 254 | deco32_raster_display_list[deco32_raster_display_position++]=deco32_pf12_control[4]&0xffff; |
| 255 | 255 | |
| 256 | cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE); | |
| 256 | cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | static READ32_HANDLER( deco32_irq_controller_r ) |
| r1591 | r1592 | |
| 262 | 262 | |
| 263 | 263 | switch (offset) { |
| 264 | 264 | case 2: /* Raster IRQ ACK - value read is not used */ |
| 265 | cpunum_set_input_line(0, ARM_IRQ_LINE, CLEAR_LINE); | |
| 265 | cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, CLEAR_LINE); | |
| 266 | 266 | return 0; |
| 267 | 267 | |
| 268 | 268 | case 3: /* Irq controller |
| r1591 | r1592 | |
| 316 | 316 | static WRITE32_HANDLER( deco32_sound_w ) |
| 317 | 317 | { |
| 318 | 318 | soundlatch_w(0,data & 0xff); |
| 319 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 319 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | static READ32_HANDLER( deco32_71_r ) |
| r1591 | r1592 | |
| 606 | 606 | |
| 607 | 607 | /* Sound board reset control */ |
| 608 | 608 | if (data&0x80) |
| 609 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 609 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 610 | 610 | else |
| 611 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 611 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 612 | 612 | |
| 613 | 613 | /* bit 0x4 fade cancel? */ |
| 614 | 614 | /* bit 0x8 ?? */ |
| r1591 | r1592 | |
| 655 | 655 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 656 | 656 | soundlatch_w(0,(data>>16)&0xff); |
| 657 | 657 | nslasher_sound_irq |= 0x02; |
| 658 | cpunum_set_input_line(1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 658 | cpunum_set_input_line(Machine, 1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 659 | 659 | } |
| 660 | 660 | } |
| 661 | 661 | |
| r1591 | r1592 | |
| 1133 | 1133 | static WRITE8_HANDLER(deco32_bsmt1_w) |
| 1134 | 1134 | { |
| 1135 | 1135 | BSMT2000_data_0_w(offset^ 0xff, ((bsmt_latch<<8)|data), 0); |
| 1136 | cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE); /* BSMT is ready */ | |
| 1136 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); /* BSMT is ready */ | |
| 1137 | 1137 | } |
| 1138 | 1138 | |
| 1139 | 1139 | static READ8_HANDLER(deco32_bsmt_status_r) |
| r1591 | r1592 | |
| 1179 | 1179 | { |
| 1180 | 1180 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 1181 | 1181 | nslasher_sound_irq &= ~0x02; |
| 1182 | cpunum_set_input_line(1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 1182 | cpunum_set_input_line(Machine, 1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 1183 | 1183 | return soundlatch_r(0); |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| r1591 | r1592 | |
| 1779 | 1779 | |
| 1780 | 1780 | static void sound_irq(int state) |
| 1781 | 1781 | { |
| 1782 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 1782 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 1783 | 1783 | } |
| 1784 | 1784 | |
| 1785 | 1785 | static void sound_irq_nslasher(int state) |
| r1591 | r1592 | |
| 1789 | 1789 | nslasher_sound_irq |= 0x01; |
| 1790 | 1790 | else |
| 1791 | 1791 | nslasher_sound_irq &= ~0x01; |
| 1792 | cpunum_set_input_line(1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 1792 | cpunum_set_input_line(Machine, 1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 1793 | 1793 | } |
| 1794 | 1794 | |
| 1795 | 1795 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1591 | r1592 | |
| 1864 | 1864 | |
| 1865 | 1865 | static INTERRUPT_GEN( deco32_vbl_interrupt ) |
| 1866 | 1866 | { |
| 1867 | cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE); | |
| 1867 | cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE); | |
| 1868 | 1868 | } |
| 1869 | 1869 | |
| 1870 | 1870 | static INTERRUPT_GEN( tattass_snd_interrupt ) |
| 1871 | 1871 | { |
| 1872 | cpunum_set_input_line(1, M6809_FIRQ_LINE, HOLD_LINE); | |
| 1872 | cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, HOLD_LINE); | |
| 1873 | 1873 | } |
| 1874 | 1874 | |
| 1875 | 1875 | static MACHINE_DRIVER_START( captaven ) |
| r1591 | r1592 | |
|---|---|---|
| 93 | 93 | static MACHINE_START( midzeus2 ) |
| 94 | 94 | { |
| 95 | 95 | timekeeper_init(0, TIMEKEEPER_MIDZEUS2, NULL); |
| 96 | | |
| 96 | MACHINE_START_CALL(midzeus | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| r1591 | r1592 | |
| 115 | 115 | |
| 116 | 116 | static TIMER_CALLBACK( display_irq_off ) |
| 117 | 117 | { |
| 118 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 118 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static INTERRUPT_GEN( display_irq ) |
| 122 | 122 | { |
| 123 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 123 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 124 | 124 | timer_set(ATTOTIME_IN_HZ(30000000), NULL, 0, display_irq_off); |
| 125 | 125 | } |
| 126 | 126 | |
| r1591 | r1592 | |
| 202 | 202 | |
| 203 | 203 | static NVRAM_HANDLER( midzeus2 ) |
| 204 | 204 | { |
| 205 | | |
| 205 | NVRAM_HANDLER_CALL(timekeeper_0 | |
| 206 | 206 | |
| 207 | 207 | if (read_or_write) |
| 208 | 208 | mame_fwrite(file, zpram, zpram_size); |
| r1591 | r1592 | |
| 504 | 504 | * |
| 505 | 505 | *************************************/ |
| 506 | 506 | |
| 507 | static void update_gun_irq( | |
| 507 | static void update_gun_irq(running_machine *machine) | |
| 508 | 508 | { |
| 509 | 509 | /* low 2 bits of gun_control seem to enable IRQs */ |
| 510 | 510 | if (gun_irq_state & gun_control & 0x03) |
| 511 | cpunum_set_input_line(0, 3, ASSERT_LINE); | |
| 511 | cpunum_set_input_line(machine, 0, 3, ASSERT_LINE); | |
| 512 | 512 | else |
| 513 | cpunum_set_input_line(0, 3, CLEAR_LINE); | |
| 513 | cpunum_set_input_line(machine, 0, 3, CLEAR_LINE); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | |
| r1591 | r1592 | |
| 521 | 521 | |
| 522 | 522 | /* set the appropriate IRQ in the internal gun control and update */ |
| 523 | 523 | gun_irq_state |= 0x01 << player; |
| 524 | update_gun_irq(); | |
| 524 | update_gun_irq(machine); | |
| 525 | 525 | |
| 526 | 526 | /* generate another interrupt on the next scanline while we are within the BEAM_DY */ |
| 527 | 527 | beamy++; |
| r1591 | r1592 | |
| 540 | 540 | /* bits 0-1 enable IRQs (?) */ |
| 541 | 541 | /* bits 2-3 reset IRQ states */ |
| 542 | 542 | gun_irq_state &= ~((gun_control >> 2) & 3); |
| 543 | update_gun_irq(); | |
| 543 | update_gun_irq(Machine); | |
| 544 | 544 | |
| 545 | 545 | for (player = 0; player < 2; player++) |
| 546 | 546 | { |
| r1591 | r1592 | |
|---|---|---|
| 95 | 95 | grchamp_state *state = machine->driver_data; |
| 96 | 96 | |
| 97 | 97 | if (state->cpu0_out[0] & 0x01) |
| 98 | cpunum_set_input_line(cpunum, 0, ASSERT_LINE); | |
| 98 | cpunum_set_input_line(machine, cpunum, 0, ASSERT_LINE); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| r1591 | r1592 | |
| 104 | 104 | grchamp_state *state = machine->driver_data; |
| 105 | 105 | |
| 106 | 106 | if (state->cpu1_out[4] & 0x01) |
| 107 | cpunum_set_input_line(cpunum, 0, ASSERT_LINE); | |
| 107 | cpunum_set_input_line(machine, cpunum, 0, ASSERT_LINE); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| r1591 | r1592 | |
| 132 | 132 | /* bit 6: FOG OUT */ |
| 133 | 133 | /* bit 7: RADARON */ |
| 134 | 134 | if ((diff & 0x01) && !(data & 0x01)) |
| 135 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 135 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 136 | 136 | if ((diff & 0x02) && !(data & 0x02)) |
| 137 | 137 | state->collide = state->collmode = 0; |
| 138 | 138 | break; |
| r1591 | r1592 | |
| 185 | 185 | break; |
| 186 | 186 | |
| 187 | 187 | case 0x0d: /* OUT13 */ |
| 188 | watchdog_reset(); | |
| 188 | watchdog_reset(Machine); | |
| 189 | 189 | break; |
| 190 | 190 | |
| 191 | 191 | case 0x0e: /* OUT14 */ |
| 192 | 192 | /* O-21 connector */ |
| 193 | 193 | soundlatch_w(0, data); |
| 194 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 194 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 195 | 195 | break; |
| 196 | 196 | } |
| 197 | 197 | } |
| r1591 | r1592 | |
| 271 | 271 | case 0x04: /* OUT4 */ |
| 272 | 272 | /* bit 0: interrupt enable for CPU 1 */ |
| 273 | 273 | if ((diff & 0x01) && !(data & 0x01)) |
| 274 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 274 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 275 | 275 | break; |
| 276 | 276 | |
| 277 | 277 | case 0x05: /* OUT5 - unused */ |
| r1591 | r1592 | |
|---|---|---|
| 160 | 160 | static INTERRUPT_GEN( argus_interrupt ) |
| 161 | 161 | { |
| 162 | 162 | if (cpu_getiloops() == 0) |
| 163 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 163 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 164 | 164 | else |
| 165 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 165 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /* Handler called by the YM2203 emulator when the internal timers cause an IRQ */ |
| 169 | 169 | static void irqhandler(int irq) |
| 170 | 170 | { |
| 171 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 171 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static TIMER_CALLBACK( nmi_callback ) |
| 57 | 57 | { |
| 58 | if (sound_nmi_enable) cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 58 | if (sound_nmi_enable) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 59 | 59 | else pending_nmi = 1; |
| 60 | 60 | } |
| 61 | 61 | |
| r1591 | r1592 | |
| 75 | 75 | sound_nmi_enable = 1; |
| 76 | 76 | if (pending_nmi) |
| 77 | 77 | { /* probably wrong but commands may go lost otherwise */ |
| 78 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 78 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 79 | 79 | pending_nmi = 0; |
| 80 | 80 | } |
| 81 | 81 | } |
| r1591 | r1592 | |
| 83 | 83 | static ADDRESS_MAP_START( lkage, ADDRESS_SPACE_PROGRAM, 8 ) |
| 84 | 84 | AM_RANGE(0x0000, 0xdfff) AM_READ(MRA8_ROM) AM_WRITE(MWA8_ROM) |
| 85 | 85 | AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM) AM_WRITE(MWA8_RAM) /* work ram */ |
| 86 | AM_RANGE(0xe800, 0xefff) AM_READ | |
| 86 | AM_RANGE(0xe800, 0xefff) AM_READ | |
| 87 | 87 | AM_RANGE(0xf000, 0xf003) AM_READ(MRA8_RAM) AM_WRITE(MWA8_RAM) AM_BASE(&lkage_vreg) /* video registers */ |
| 88 | 88 | AM_RANGE(0xf060, 0xf060) AM_WRITE(lkage_sound_command_w) |
| 89 | 89 | AM_RANGE(0xf061, 0xf061) AM_WRITE(MWA8_NOP) |
| r1591 | r1592 | |
| 310 | 310 | |
| 311 | 311 | static void irqhandler(int irq) |
| 312 | 312 | { |
| 313 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 313 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 163 | 163 | toggles (680usec after the vblank). We could set up a |
| 164 | 164 | timer to do that, but this works as well */ |
| 165 | 165 | laserdisc_data_w(discinfo, superdq_ld_out_latch); |
| 166 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 166 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | static WRITE8_HANDLER( superdq_videoram_w ) |
| r1591 | r1592 | |
| 178 | 178 | static const UINT8 black_color_entries[] = {7,15,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; |
| 179 | 179 | |
| 180 | 180 | if ( data & 0x40 ) /* bit 6 = irqack */ |
| 181 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 181 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 182 | 182 | |
| 183 | 183 | coin_counter_w( 0, data & 0x08 ); |
| 184 | 184 | coin_counter_w( 1, data & 0x04 ); |
| r1591 | r1592 | |
|---|---|---|
| 266 | 266 | static INTERRUPT_GEN( goodejan_interrupt ) |
| 267 | 267 | { |
| 268 | 268 | if (cpu_getiloops()) |
| 269 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0x208/4); | |
| 269 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0x208/4); | |
| 270 | 270 | else |
| 271 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0x00c/4); | |
| 271 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0x00c/4); | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | static MACHINE_DRIVER_START( goodejan ) |
| r1591 | r1592 | |
|---|---|---|
| 164 | 164 | { |
| 165 | 165 | if (ACCESSING_LSB) soundlatch_w(0,data & 0xff); /* Ninja Gaiden */ |
| 166 | 166 | if (ACCESSING_MSB) soundlatch_w(0,data >> 8); /* Tecmo Knight */ |
| 167 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 167 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | static WRITE16_HANDLER( drgnbowl_sound_command_w ) |
| r1591 | r1592 | |
| 172 | 172 | if (ACCESSING_MSB) |
| 173 | 173 | { |
| 174 | 174 | soundlatch_w(0,data >> 8); |
| 175 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 175 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| r1591 | r1592 | |
| 951 | 951 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 952 | 952 | static void irqhandler(int irq) |
| 953 | 953 | { |
| 954 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 954 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 354 | 354 | { |
| 355 | 355 | /* pressing the service switch sends an NMI */ |
| 356 | 356 | if (newval) |
| 357 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 357 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
| 361 | 361 | static INTERRUPT_GEN( vblank_int ) |
| 362 | 362 | { |
| 363 | 363 | if (int_enabled) |
| 364 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 364 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | |
| r1591 | r1592 | |
| 369 | 369 | { |
| 370 | 370 | int_enabled = data & 1; |
| 371 | 371 | if (!int_enabled) |
| 372 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 372 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | |
| r1591 | r1592 | |
| 1427 | 1427 | static DRIVER_INIT( zaxxonb ) |
| 1428 | 1428 | { |
| 1429 | 1429 | zaxxonb_decode(); |
| 1430 | | |
| 1430 | DRIVER_INIT_CALL(zaxxon | |
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | |
| 1434 | 1434 | static DRIVER_INIT( szaxxon ) |
| 1435 | 1435 | { |
| 1436 | 1436 | szaxxon_decode(); |
| 1437 | | |
| 1437 | DRIVER_INIT_CALL(zaxxon | |
| 1438 | 1438 | } |
| 1439 | 1439 | |
| 1440 | 1440 | |
| 1441 | 1441 | static DRIVER_INIT( futspy ) |
| 1442 | 1442 | { |
| 1443 | 1443 | futspy_decode(); |
| 1444 | | |
| 1444 | DRIVER_INIT_CALL(zaxxon | |
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | 1447 | |
| 1448 | 1448 | static DRIVER_INIT( razmataz ) |
| 1449 | 1449 | { |
| 1450 | 1450 | nprinces_decode(); |
| 1451 | | |
| 1451 | DRIVER_INIT_CALL(zaxxon | |
| 1452 | 1452 | |
| 1453 | 1453 | /* additional input ports are wired */ |
| 1454 | 1454 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc004, 0xc004, 0, 0x18f3, port_tag_to_handler8("SW04")); |
| r1591 | r1592 | |
| 1471 | 1471 | static DRIVER_INIT( ixion ) |
| 1472 | 1472 | { |
| 1473 | 1473 | szaxxon_decode(); |
| 1474 | | |
| 1474 | DRIVER_INIT_CALL(zaxxon | |
| 1475 | 1475 | |
| 1476 | 1476 | /* connect the universal sound board */ |
| 1477 | 1477 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r); |
| r1591 | r1592 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static WRITE8_HANDLER( shangkid_bbx_enable_w ) |
| 81 | 81 | { |
| 82 | cpunum_set_input_line(1, INPUT_LINE_HALT, data?0:1 ); | |
| 82 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, data?0:1 ); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static WRITE8_HANDLER( shangkid_cpu_reset_w ) |
| 86 | 86 | { |
| 87 | 87 | if( data == 0 ) |
| 88 | 88 | { |
| 89 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 89 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 90 | 90 | } |
| 91 | 91 | else if( data == 1 ) |
| 92 | 92 | { |
| 93 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 93 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| r1591 | r1592 | |
| 114 | 114 | { |
| 115 | 115 | if( data == 0x01 ) |
| 116 | 116 | /* 0->1 transition triggers interrupt on Sound CPU */ |
| 117 | cpunum_set_input_line( 2, 0, HOLD_LINE ); | |
| 117 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE ); | |
| 118 | 118 | } |
| 119 | 119 | break; |
| 120 | 120 | |
| r1591 | r1592 | |
| 137 | 137 | { |
| 138 | 138 | if( data == 0x01 ) |
| 139 | 139 | /* 0->1 transition triggers interrupt on Sound CPU */ |
| 140 | cpunum_set_input_line( 2, 0, HOLD_LINE ); | |
| 140 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE ); | |
| 141 | 141 | } |
| 142 | 142 | else |
| 143 | 143 | memory_set_bank(2, data ? 0 : 1); |
| r1591 | r1592 | |
| 180 | 180 | |
| 181 | 181 | static MACHINE_RESET( chinhero ) |
| 182 | 182 | { |
| 183 | cpunum_set_input_line(1, INPUT_LINE_HALT, 1 ); | |
| 183 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, 1 ); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | static MACHINE_RESET( shangkid ) |
| 187 | 187 | { |
| 188 | cpunum_set_input_line(1, INPUT_LINE_HALT, 1 ); | |
| 188 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, 1 ); | |
| 189 | 189 | |
| 190 | 190 | memory_set_bank(1, 0); |
| 191 | 191 | memory_set_bank(2, 0); |
| r1591 | r1592 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | static READ8_HANDLER( irq_ack_r ) |
| 91 | 91 | { |
| 92 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 92 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 93 | 93 | |
| 94 | 94 | return 0; |
| 95 | 95 | } |
| r1591 | r1592 | |
| 97 | 97 | |
| 98 | 98 | static TIMER_CALLBACK( irq_callback ) |
| 99 | 99 | { |
| 100 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 100 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 101 | 101 | |
| 102 | 102 | timer_adjust(irq_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0, attotime_zero); |
| 103 | 103 | } |
| r1591 | r1592 | |
| 129 | 129 | |
| 130 | 130 | /* both the coin input and the serice credit generates an NMI */ |
| 131 | 131 | if (coin || service) |
| 132 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 132 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 133 | 133 | |
| 134 | 134 | /* the coin input is also connected to the coin counter */ |
| 135 | 135 | if (coin) |
| r1591 | r1592 | |
| 435 | 435 | state_save_register_global(screen_off); |
| 436 | 436 | state_save_register_global(astrof_palette_bank); |
| 437 | 437 | |
| 438 | | |
| 438 | MACHINE_START_CALL(astrof_audio | |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | |
| r1591 | r1592 | |
| 444 | 444 | /* register for state saving */ |
| 445 | 445 | state_save_register_global(abattle_count); |
| 446 | 446 | |
| 447 | | |
| 447 | MACHINE_START_CALL(astrof | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | |
| r1591 | r1592 | |
| 494 | 494 | |
| 495 | 495 | static MACHINE_RESET( abattle ) |
| 496 | 496 | { |
| 497 | | |
| 497 | MACHINE_RESET_CALL(astrof | |
| 498 | 498 | |
| 499 | 499 | abattle_count = 0; |
| 500 | 500 | } |
| r1591 | r1592 | |
| 631 | 631 | PORT_CONFSETTING( 0x00, DEF_STR( Upright ) ) |
| 632 | 632 | PORT_CONFSETTING( 0x01, DEF_STR( Cocktail ) ) |
| 633 | 633 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 634 | ||
| 635 | // PORT_START_TAG("WIREMOD") | |
| 636 | // PORT_CONFNAME( 0x01, 0x00, "Wire Mod for Background Color" ) | |
| 637 | // PORT_CONFSETTING( 0x00, "Blue Background" ) | |
| 638 | // PORT_CONFSETTING( 0x01, "Black Background" ) | |
| 639 | // PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 640 | 634 | INPUT_PORTS_END |
| 641 | 635 | |
| 642 | 636 | |
| r1591 | r1592 | |
| 1175 | 1169 | |
| 1176 | 1170 | ROM_START( spfgmk22 ) |
| 1177 | 1171 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 1178 | ROM_LOAD( "2708.5e", 0xe400, 0x0400, CRC(27d7060d) SHA1(796c44a395e1c54769dc57050503b4b111bde7ef) ) | |
| 1179 | ROM_LOAD( "2708.5d", 0xe800, 0x0400, CRC(6ccb3b0a) SHA1(566104ca2e0fae741d4650e7159c9ddb48f59e8b) ) | |
| 1180 | ROM_LOAD( "2708.5c", 0xec00, 0x0400, CRC(68eb0ad5) SHA1(d303685ffd67898cec3e7c51b3831558a837e5a3) ) | |
| 1181 | ROM_LOAD( "2708.4h", 0xf000, 0x0400, CRC(ea8d1f2f) SHA1(35b01e76284080d5bd0270e4004a54386d9eb697) ) | |
| 1182 | ROM_LOAD( "2708.4e", 0xf400, 0x0400, CRC(6e7f00ae) SHA1(91ca17d5dc75be641c059fd84bed7cced2a2ef69) ) | |
| 1183 | ROM_LOAD( "2708.4d", 0xf800, 0x0400, CRC(29501dba) SHA1(978d7009eab8da40ccf0d026c9dabc0a3fa95d76) ) | |
| 1184 | ROM_LOAD( "2708.4c", 0xfc00, 0x0400, CRC(9bd589a6) SHA1(bce92fcab5220ff68526bc8c1c88ab0f317fe400) ) | |
| 1172 | ROM_LOAD( "2708mkii.5e", 0xe400, 0x0400, CRC(27d7060d) SHA1(796c44a395e1c54769dc57050503b4b111bde7ef) ) | |
| 1173 | ROM_LOAD( "2708mkii.5d", 0xe800, 0x0400, CRC(6ccb3b0a) SHA1(566104ca2e0fae741d4650e7159c9ddb48f59e8b) ) | |
| 1174 | ROM_LOAD( "2708mkii.5c", 0xec00, 0x0400, CRC(68eb0ad5) SHA1(d303685ffd67898cec3e7c51b3831558a837e5a3) ) | |
| 1175 | ROM_LOAD( "2708mkii.4h", 0xf000, 0x0400, CRC(ea8d1f2f) SHA1(35b01e76284080d5bd0270e4004a54386d9eb697) ) | |
| 1176 | ROM_LOAD( "2708mkii.4e", 0xf400, 0x0400, CRC(6e7f00ae) SHA1(91ca17d5dc75be641c059fd84bed7cced2a2ef69) ) | |
| 1177 | ROM_LOAD( "2708mkii.4d", 0xf800, 0x0400, CRC(29501dba) SHA1(978d7009eab8da40ccf0d026c9dabc0a3fa95d76) ) | |
| 1178 | ROM_LOAD( "2708mkii.4c", 0xfc00, 0x0400, CRC(9bd589a6) SHA1(bce92fcab5220ff68526bc8c1c88ab0f317fe400) ) | |
| 1185 | 1179 | |
| 1186 | 1180 | ROM_REGION( 0x0020, REGION_PROMS, 0 ) |
| 1187 | 1181 | ROM_LOAD( "709-5.1a", 0x0000, 0x0020, CRC(61329fd1) SHA1(15782d8757d4dda5a8b97815e94c90218f0e08dd) ) |
| r1591 | r1592 | |
| 1289 | 1283 | GAME( 1979, acombat, astrof, abattle, abattle, afire, ROT90, "bootleg", "Astro Combat (newer, CB)", GAME_SUPPORTS_SAVE ) |
| 1290 | 1284 | GAME( 1979, acombato, astrof, abattle, abattle, afire, ROT90, "bootleg", "Astro Combat (older, PZ)", GAME_SUPPORTS_SAVE ) |
| 1291 | 1285 | GAME( 1979, sstarbtl, astrof, abattle, abattle, sstarbtl,ROT90, "bootleg", "Super Star Battle", GAME_SUPPORTS_SAVE ) |
| 1292 | GAME( 1980, spfghmk2, 0, spfghmk2, spfghmk2, 0, ROT90, "Data East", "Space Fighter Mark II (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1293 | GAME( 1980, spfgmk22, spfghmk2, spfghmk2, spfgmk22, 0, ROT90, "Data East", "Space Fighter Mark II (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1286 | GAME( 1979, spfghmk2, 0, spfghmk2, spfghmk2, 0, ROT90, "Data East", "Space Fighter Mark II (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1287 | GAME( 1979, spfgmk22, spfghmk2, spfghmk2, spfgmk22, 0, ROT90, "Data East", "Space Fighter Mark II (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) | |
| 1294 | 1288 | GAME( 1980, tomahawk, 0, tomahawk, tomahawk, 0, ROT90, "Data East", "Tomahawk 777 (rev 5)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 1295 | 1289 | GAME( 1980, tomahaw1, tomahawk, tomahawk, tomahawk, 0, ROT90, "Data East", "Tomahawk 777 (rev 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r1591 | r1592 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | // if (!i8751_return && data!=0x300) logerror("CPU %04x - Unknown Write %02x intel\n",activecpu_get_pc(),data); |
| 88 | 88 | |
| 89 | cpunum_set_input_line(0,6,HOLD_LINE); /* Signal main cpu task is complete */ | |
| 89 | cpunum_set_input_line(Machine, 0,6,HOLD_LINE); /* Signal main cpu task is complete */ | |
| 90 | 90 | i8751_needs_ack=1; |
| 91 | 91 | } |
| 92 | 92 | |
| r1591 | r1592 | |
| 140 | 140 | if (data==0x501) i8751_return=0x6bf8; |
| 141 | 141 | if (data==0x500) i8751_return=0x4e75; |
| 142 | 142 | |
| 143 | cpunum_set_input_line(0,6,HOLD_LINE); /* Signal main cpu task is complete */ | |
| 143 | cpunum_set_input_line(Machine, 0,6,HOLD_LINE); /* Signal main cpu task is complete */ | |
| 144 | 144 | i8751_needs_ack=1; |
| 145 | 145 | } |
| 146 | 146 | |
| r1591 | r1592 | |
| 250 | 250 | |
| 251 | 251 | // logerror("CPU %04x - Unknown Write %02x intel\n",activecpu_get_pc(),data); |
| 252 | 252 | |
| 253 | cpunum_set_input_line(0,6,HOLD_LINE); /* Signal main cpu task is complete */ | |
| 253 | cpunum_set_input_line(Machine, 0,6,HOLD_LINE); /* Signal main cpu task is complete */ | |
| 254 | 254 | i8751_needs_ack=1; |
| 255 | 255 | } |
| 256 | 256 | |
| r1591 | r1592 | |
| 261 | 261 | /* Mnemonics filled in from the schematics, brackets are my comments */ |
| 262 | 262 | switch (offset<<1) { |
| 263 | 263 | case 0: /* SECLR (Interrupt ack for Level 6 i8751 interrupt) */ |
| 264 | cpunum_set_input_line(0,6,CLEAR_LINE); | |
| 264 | cpunum_set_input_line(Machine, 0,6,CLEAR_LINE); | |
| 265 | 265 | |
| 266 | 266 | if (i8751_needs_ack) { |
| 267 | 267 | /* If a command and coin insert happen at once, then the i8751 will queue the |
| 268 | 268 | coin command until the previous command is ACK'd */ |
| 269 | 269 | if (i8751_coin_pending) { |
| 270 | 270 | i8751_return=i8751_coin_pending; |
| 271 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 271 | cpunum_set_input_line(Machine, 0,6,HOLD_LINE); | |
| 272 | 272 | i8751_coin_pending=0; |
| 273 | 273 | } else if (i8751_command_queue) { |
| 274 | 274 | /* Pending control command - just write it back as SECREQ */ |
| r1591 | r1592 | |
| 283 | 283 | |
| 284 | 284 | case 2: /* SONREQ (Sound CPU byte) */ |
| 285 | 285 | soundlatch_w(0,data&0xff); |
| 286 | cpunum_set_input_line (1, INPUT_LINE_NMI, PULSE_LINE); | |
| 286 | cpunum_set_input_line (Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 287 | 287 | break; |
| 288 | 288 | |
| 289 | 289 | case 4: /* DM (DMA to buffer spriteram) */ |
| r1591 | r1592 | |
| 314 | 314 | break; |
| 315 | 315 | |
| 316 | 316 | case 0xe: /* INTCLR (Interrupt ack for Level 7 vbl interrupt) */ |
| 317 | cpunum_set_input_line(0,7,CLEAR_LINE); | |
| 317 | cpunum_set_input_line(Machine, 0,7,CLEAR_LINE); | |
| 318 | 318 | break; |
| 319 | 319 | } |
| 320 | 320 | } |
| r1591 | r1592 | |
| 657 | 657 | i8751_coin_pending=readinputport(3) | 0x8000; |
| 658 | 658 | } else { |
| 659 | 659 | i8751_return=readinputport(3) | 0x8000; |
| 660 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 660 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 661 | 661 | i8751_needs_ack=1; |
| 662 | 662 | } |
| 663 | 663 | latch=0; |
| 664 | 664 | } |
| 665 | 665 | |
| 666 | cpunum_set_input_line(0,7,HOLD_LINE); /* VBL */ | |
| 666 | cpunum_set_input_line(machine, 0,7,HOLD_LINE); /* VBL */ | |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | static void sound_irq(int linestate) |
| 670 | 670 | { |
| 671 | cpunum_set_input_line(1,0,linestate); /* IRQ */ | |
| 671 | cpunum_set_input_line(Machine, 1,0,linestate); /* IRQ */ | |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
|---|---|---|
| 97 | 97 | static INTERRUPT_GEN( lwings_interrupt ) |
| 98 | 98 | { |
| 99 | 99 | if (interrupt_enable_r(0)) |
| 100 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xd7); /* RST 10h */ | |
| 100 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xd7); /* RST 10h */ | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 |
| r1591 | r1592 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | /* clear coin interrupt */ |
| 81 | 81 | if (data & 0x04) |
| 82 | cpunum_set_input_line( 1, M6805_IRQ_LINE, CLEAR_LINE ); | |
| 82 | cpunum_set_input_line(Machine, 1, M6805_IRQ_LINE, CLEAR_LINE ); | |
| 83 | 83 | |
| 84 | 84 | /* AUDMUTE */ |
| 85 | 85 | sound_global_enable((data >> 5) & 1); |
| 86 | 86 | |
| 87 | 87 | /* RES600 */ |
| 88 | 88 | if (diff & 0x10) |
| 89 | cpunum_set_input_line(0, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 89 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 90 | 90 | |
| 91 | 91 | /* latch for lamps */ |
| 92 | 92 | if ((diff & 0x40) && !(data & 0x40)) |
| r1591 | r1592 | |
| 154 | 154 | if ( (tcr & 0x40) == 0 ) |
| 155 | 155 | { |
| 156 | 156 | //timer interrupt! |
| 157 | cpunum_set_input_line(1, M68705_INT_TIMER, PULSE_LINE ); | |
| 157 | cpunum_set_input_line(machine, 1, M68705_INT_TIMER, PULSE_LINE ); | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | } |
| r1591 | r1592 | |
| 227 | 227 | { |
| 228 | 228 | if ( !readinputport(4) ) |
| 229 | 229 | { |
| 230 | cpunum_set_input_line(1, M6805_IRQ_LINE, HOLD_LINE ); | |
| 230 | cpunum_set_input_line(machine, 1, M6805_IRQ_LINE, HOLD_LINE ); | |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 |
| r1591 | r1592 | |
|---|---|---|
| 160 | 160 | static WRITE8_HANDLER( punchout_2a03_reset_w ) |
| 161 | 161 | { |
| 162 | 162 | if (data & 1) |
| 163 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 163 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 164 | 164 | else |
| 165 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 165 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | static int prot_mode_sel = -1; /* Mode selector */ |
| r1591 | r1592 | |
|---|---|---|
| 940 | 940 | if (irq[i]) |
| 941 | 941 | { |
| 942 | 942 | if (LOG_NILE_IRQS) logerror(" 1"); |
| 943 | cpunum_set_input_line(0, MIPS3_IRQ0 + i, ASSERT_LINE); | |
| 943 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ0 + i, ASSERT_LINE); | |
| 944 | 944 | } |
| 945 | 945 | else |
| 946 | 946 | { |
| 947 | 947 | if (LOG_NILE_IRQS) logerror(" 0"); |
| 948 | cpunum_set_input_line(0, MIPS3_IRQ0 + i, CLEAR_LINE); | |
| 948 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ0 + i, CLEAR_LINE); | |
| 949 | 949 | } |
| 950 | 950 | } |
| 951 | 951 | if (LOG_NILE_IRQS) logerror("\n"); |
| r1591 | r1592 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | if (~input_port_1_r(0) & 0x80) /* coin 1 */ |
| 21 | 21 | { |
| 22 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xf7); /* RST 30h */ | |
| 22 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xf7); /* RST 30h */ | |
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | else if (~input_port_1_r(0) & 0x08) /* coin 2 */ |
| 26 | 26 | { |
| 27 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xef); /* RST 28h */ | |
| 27 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xef); /* RST 28h */ | |
| 28 | 28 | return; |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xff); /* RST 38h */ | |
| 32 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xff); /* RST 38h */ | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static READ8_HANDLER( kopunch_in_r ) |
| r1591 | r1592 | |
|---|---|---|
| 79 | 79 | static WRITE8_HANDLER( tecmo_sound_command_w ) |
| 80 | 80 | { |
| 81 | 81 | soundlatch_w(offset,data); |
| 82 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 82 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static int adpcm_pos,adpcm_end; |
| r1591 | r1592 | |
| 546 | 546 | |
| 547 | 547 | static void irqhandler(int linestate) |
| 548 | 548 | { |
| 549 | cpunum_set_input_line(1,0,linestate); | |
| 549 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | static const struct YM3526interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 142 | 142 | { |
| 143 | 143 | /* IRQ 3 drives the game, IRQ 5 updates the palette */ |
| 144 | 144 | if (cpu_getiloops() != 0) |
| 145 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 145 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 146 | 146 | else |
| 147 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 147 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | static INTERRUPT_GEN( galhustl_interrupt ) |
| 151 | 151 | { |
| 152 | 152 | switch ( cpu_getiloops() ) |
| 153 | 153 | { |
| 154 | case 2: cpunum_set_input_line(0, 5, HOLD_LINE); break; | |
| 155 | case 1: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 156 | case 0: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 154 | case 2: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; | |
| 155 | case 1: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 156 | case 0: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 |
| r1591 | r1592 | |
|---|---|---|
| 33 | 33 | if (cpu_getiloops() == 0) |
| 34 | 34 | { |
| 35 | 35 | if (*finalizr_interrupt_enable & 2) |
| 36 | cpunum_set_input_line(0, M6809_IRQ_LINE, HOLD_LINE); | |
| 36 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 37 | 37 | } |
| 38 | 38 | else if (cpu_getiloops() % 2) |
| 39 | 39 | { |
| 40 | 40 | if (*finalizr_interrupt_enable & 1) |
| 41 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 41 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| r1591 | r1592 | |
| 50 | 50 | |
| 51 | 51 | static WRITE8_HANDLER( finalizr_i8039_irq_w ) |
| 52 | 52 | { |
| 53 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 53 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static WRITE8_HANDLER( i8039_irqen_w ) |
| r1591 | r1592 | |
| 61 | 61 | */ |
| 62 | 62 | |
| 63 | 63 | if ((data & 0x80) == 0) |
| 64 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 64 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static READ8_HANDLER( i8039_T1_r ) |
| r1591 | r1592 | |
|---|---|---|
| 77 | 77 | /* assert the lines that are live, or clear everything if nothing is live */ |
| 78 | 78 | if (irq != 0) |
| 79 | 79 | { |
| 80 | cpunum_set_input_line(0, irq, ASSERT_LINE); | |
| 81 | cpunum_set_input_line(1, irq, ASSERT_LINE); | |
| 82 | cpunum_set_input_line(2, irq, ASSERT_LINE); | |
| 80 | cpunum_set_input_line(Machine, 0, irq, ASSERT_LINE); | |
| 81 | cpunum_set_input_line(Machine, 1, irq, ASSERT_LINE); | |
| 82 | cpunum_set_input_line(Machine, 2, irq, ASSERT_LINE); | |
| 83 | 83 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); |
| 84 | 84 | } |
| 85 | 85 | else |
| 86 | 86 | { |
| 87 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 88 | cpunum_set_input_line(1, 7, CLEAR_LINE); | |
| 89 | cpunum_set_input_line(2, 7, CLEAR_LINE); | |
| 87 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 88 | cpunum_set_input_line(Machine, 1, 7, CLEAR_LINE); | |
| 89 | cpunum_set_input_line(Machine, 2, 7, CLEAR_LINE); | |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| r1591 | r1592 | |
| 203 | 203 | |
| 204 | 204 | static void sound_cpu_irq(int state) |
| 205 | 205 | { |
| 206 | cpunum_set_input_line(3, 0, state); | |
| 206 | cpunum_set_input_line(Machine, 3, 0, state); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | static TIMER_CALLBACK( delayed_sound_data_w ) |
| 211 | 211 | { |
| 212 | 212 | soundlatch_w(0, param); |
| 213 | cpunum_set_input_line(3, INPUT_LINE_NMI, ASSERT_LINE); | |
| 213 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, ASSERT_LINE); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| r1591 | r1592 | |
| 223 | 223 | |
| 224 | 224 | static READ8_HANDLER( sound_data_r ) |
| 225 | 225 | { |
| 226 | cpunum_set_input_line(3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 226 | cpunum_set_input_line(Machine, 3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 227 | 227 | return soundlatch_r(offset); |
| 228 | 228 | } |
| 229 | 229 | |
| r1591 | r1592 | |
| 314 | 314 | */ |
| 315 | 315 | segaic16_set_display_enable(data & 0x80); |
| 316 | 316 | if (((old ^ data) & 0x20) && !(data & 0x20)) watchdog_reset_w(0,0); |
| 317 | cpunum_set_input_line(3, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 318 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 319 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE); | |
| 317 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 318 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 319 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE); | |
| 320 | 320 | break; |
| 321 | 321 | |
| 322 | 322 | /* mute */ |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | * |
| 31 | 31 | *************************************/ |
| 32 | 32 | |
| 33 | static void update_interrupts( | |
| 33 | static void update_interrupts(running_machine *machine) | |
| 34 | 34 | { |
| 35 | 35 | int newstate = 0; |
| 36 | 36 | |
| r1591 | r1592 | |
| 38 | 38 | newstate = 4; |
| 39 | 39 | |
| 40 | 40 | if (newstate) |
| 41 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 41 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 42 | 42 | else |
| 43 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 43 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 |
| r1591 | r1592 | |
|---|---|---|
| 155 | 155 | static WRITE8_HANDLER( swimmer_sh_soundlatch_w ) |
| 156 | 156 | { |
| 157 | 157 | soundlatch_w(offset,data); |
| 158 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 158 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 |
| r1591 | r1592 | |
|---|---|---|
| 195 | 195 | { |
| 196 | 196 | if (cpu_getiloops() == 0) |
| 197 | 197 | { |
| 198 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 198 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 199 | 199 | } |
| 200 | 200 | else if (cpu_getiloops() % 2) |
| 201 | 201 | { |
| 202 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 202 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 |
| r1591 | r1592 | |
|---|---|---|
| 103 | 103 | static WRITE8_HANDLER(speedspn_sound_w) |
| 104 | 104 | { |
| 105 | 105 | soundlatch_w(1,data); |
| 106 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 106 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static WRITE8_HANDLER( oki_banking_w ) |
| r1591 | r1592 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | static TIMER_CALLBACK( interrupt_clear_callback ) |
| 87 | 87 | { |
| 88 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 88 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| r1591 | r1592 | |
| 98 | 98 | int vpos = video_screen_get_vpos(0); |
| 99 | 99 | UINT16 counter = vpos_to_vysnc_chain_counter(vpos); |
| 100 | 100 | UINT8 vector = 0xc7 | ((counter & 0x80) >> 3) | ((~counter & 0x80) >> 4); |
| 101 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, vector); | |
| 101 | cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, vector); | |
| 102 | 102 | |
| 103 | 103 | /* set up for next interrupt */ |
| 104 | 104 | if (counter == INT_TRIGGER_COUNT_1) |
| r1591 | r1592 | |
| 136 | 136 | static MACHINE_RESET( enigma2 ) |
| 137 | 137 | { |
| 138 | 138 | last_sound_data = 0; |
| 139 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 139 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 140 | 140 | |
| 141 | 141 | engima2_flip_screen = 0; |
| 142 | 142 | |
| r1591 | r1592 | |
| 347 | 347 | { |
| 348 | 348 | /* clock sound latch shift register on rising edge of D2 */ |
| 349 | 349 | if (!(data & 0x04) && (last_sound_data & 0x04)) |
| 350 | { | |
| 351 | 350 | sound_latch = (sound_latch << 1) | (~data & 0x01); |
| 352 | } | |
| 353 | 351 | |
| 354 | cpunum_set_input_line(1, INPUT_LINE_NMI, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 352 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 355 | 353 | |
| 356 | 354 | last_sound_data = data; |
| 357 | 355 | } |
| r1591 | r1592 | |
|---|---|---|
| 49 | 49 | static WRITE8_HANDLER( cowrace_soundlatch_w ) |
| 50 | 50 | { |
| 51 | 51 | soundlatch_w(0, data); |
| 52 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 52 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 53 | 53 | } |
| 54 | 54 | #endif |
| 55 | 55 |
| r1591 | r1592 | |
|---|---|---|
| 100 | 100 | { 0x35/2, 0x90000, 0x10000, 0xf00000, ~0, segaic16_road_control_0_r, segaic16_road_control_0_w, NULL, "road control" }, |
| 101 | 101 | { 0x35/2, 0x80000, 0x01000, 0xf0f000, ~0, MRA16_BANK10, MWA16_BANK10, &segaic16_roadram_0, "road RAM" }, |
| 102 | 102 | { 0x35/2, 0x60000, 0x08000, 0xf18000, ~0, MRA16_BANK11, MWA16_BANK11, &cpu1ram, "CPU 1 RAM" }, |
| 103 | { 0x35/2, 0x00000, 0x60000, 0xf00000, ~0, MRA16_BANK12, MWA16_ | |
| 103 | { 0x35/2, 0x00000, 0x60000, 0xf00000, ~0, MRA16_BANK12, MWA16_UNMAP, | |
| 104 | 104 | { 0x31/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" }, |
| 105 | 105 | { 0x2d/2, 0x00000, 0x01000, 0xfff000, ~0, MRA16_BANK13, MWA16_BANK13, &segaic16_spriteram_0, "object RAM" }, |
| 106 | 106 | { 0x29/2, 0x00000, 0x02000, 0xffe000, ~0, MRA16_BANK14, segaic16_paletteram_w, &paletteram16, "color RAM" }, |
| 107 | 107 | { 0x25/2, 0x00000, 0x10000, 0xfe0000, ~0, MRA16_BANK15, segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" }, |
| 108 | 108 | { 0x25/2, 0x10000, 0x01000, 0xfef000, ~0, MRA16_BANK16, segaic16_textram_0_w, &segaic16_textram_0, "text RAM" }, |
| 109 | 109 | { 0x21/2, 0x60000, 0x08000, 0xf98000, ~0, MRA16_BANK17, MWA16_BANK17, &workram, "CPU 0 RAM" }, |
| 110 | { 0x21/2, 0x00000, 0x60000, 0xf80000, 0x00000, MRA16_BANK18, MWA16_ | |
| 110 | { 0x21/2, 0x00000, 0x60000, 0xf80000, 0x00000, MRA16_BANK18, MWA16_UNMAP, | |
| 111 | 111 | { 0 } |
| 112 | 112 | }; |
| 113 | 113 | |
| r1591 | r1592 | |
| 122 | 122 | static TIMER_CALLBACK( delayed_sound_data_w ) |
| 123 | 123 | { |
| 124 | 124 | soundlatch_w(0, param); |
| 125 | cpunum_set_input_line(2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 125 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| r1591 | r1592 | |
| 134 | 134 | |
| 135 | 135 | static READ8_HANDLER( sound_data_r ) |
| 136 | 136 | { |
| 137 | cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 137 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 138 | 138 | return soundlatch_r(offset); |
| 139 | 139 | } |
| 140 | 140 | |
| r1591 | r1592 | |
| 172 | 172 | * |
| 173 | 173 | *************************************/ |
| 174 | 174 | |
| 175 | static void update_main_irqs( | |
| 175 | static void update_main_irqs(running_machine *machine) | |
| 176 | 176 | { |
| 177 | 177 | int irq = 0; |
| 178 | 178 | |
| r1591 | r1592 | |
| 185 | 185 | /* assert the lines that are live, or clear everything if nothing is live */ |
| 186 | 186 | if (irq != 0) |
| 187 | 187 | { |
| 188 | cpunum_set_input_line(0, irq, ASSERT_LINE); | |
| 188 | cpunum_set_input_line(machine, 0, irq, ASSERT_LINE); | |
| 189 | 189 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 190 | 190 | } |
| 191 | 191 | else |
| 192 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 192 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
| r1591 | r1592 | |
| 197 | 197 | { |
| 198 | 198 | /* set the IRQ2 line */ |
| 199 | 199 | irq2_state = 1; |
| 200 | update_main_irqs(); | |
| 200 | update_main_irqs(machine); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| r1591 | r1592 | |
| 229 | 229 | case 223: |
| 230 | 230 | vblank_irq_state = 1; |
| 231 | 231 | next_scanline = scanline + 1; |
| 232 | cpunum_set_input_line(1, 4, ASSERT_LINE); | |
| 232 | cpunum_set_input_line(machine, 1, 4, ASSERT_LINE); | |
| 233 | 233 | break; |
| 234 | 234 | |
| 235 | 235 | /* VBLANK turns off at the start of scanline 224 */ |
| 236 | 236 | case 224: |
| 237 | 237 | vblank_irq_state = 0; |
| 238 | 238 | next_scanline = 65; |
| 239 | cpunum_set_input_line(1, 4, CLEAR_LINE); | |
| 239 | cpunum_set_input_line(machine, 1, 4, CLEAR_LINE); | |
| 240 | 240 | break; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /* update IRQs on the main CPU */ |
| 244 | update_main_irqs(); | |
| 244 | update_main_irqs(machine); | |
| 245 | 245 | |
| 246 | 246 | /* come back at the next targeted scanline */ |
| 247 | 247 | timer_set(video_screen_get_time_until_pos(0, next_scanline, 0), NULL, next_scanline, scanline_callback); |
| r1591 | r1592 | |
| 257 | 257 | |
| 258 | 258 | static void outrun_reset(void) |
| 259 | 259 | { |
| 260 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 260 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | |
| r1591 | r1592 | |
| 347 | 347 | */ |
| 348 | 348 | segaic16_set_display_enable(data & 0x20); |
| 349 | 349 | adc_select = (data >> 2) & 7; |
| 350 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 350 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | |
| r1591 | r1592 | |
| 481 | 481 | /* Output port: |
| 482 | 482 | D0: Sound section reset (1= normal operation, 0= reset) |
| 483 | 483 | */ |
| 484 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 484 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 485 | 485 | return; |
| 486 | 486 | |
| 487 | 487 | case 0x3000/2: |
| r1591 | r1592 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | static void voodoo_vblank_0(int param) |
| 80 | 80 | { |
| 81 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 81 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static void voodoo_vblank_1(int param) |
| 85 | 85 | { |
| 86 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 86 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static VIDEO_START( hangplt ) |
| r1591 | r1592 | |
| 330 | 330 | { |
| 331 | 331 | if (data & 0x80000000) /* CG Board 1 IRQ Ack */ |
| 332 | 332 | { |
| 333 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 333 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 334 | 334 | } |
| 335 | 335 | if (data & 0x40000000) /* CG Board 0 IRQ Ack */ |
| 336 | 336 | { |
| 337 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 337 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | adc1038_di_w((data >> 24) & 1); |
| r1591 | r1592 | |
| 377 | 377 | // Thunder Hurricane breaks otherwise... |
| 378 | 378 | if (mame_stricmp(Machine->gamedrv->name, "thunderh") != 0) |
| 379 | 379 | { |
| 380 | cpunum_set_input_line(0, INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 380 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | break; |
| r1591 | r1592 | |
| 455 | 455 | static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 456 | 456 | AM_RANGE(0x00000000, 0x000fffff) AM_MIRROR(0x80000000) AM_RAM AM_BASE(&work_ram) /* Work RAM */ |
| 457 | 457 | AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_reg_r, K001604_reg_w) |
| 458 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_READWRITE( | |
| 458 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_READWRITE(MRA | |
| 459 | 459 | AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w) |
| 460 | 460 | AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w) |
| 461 | 461 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) |
| r1591 | r1592 | |
| 724 | 724 | */ |
| 725 | 725 | static INTERRUPT_GEN( gticlub_vblank ) |
| 726 | 726 | { |
| 727 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 727 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | |
| r1591 | r1592 | |
| 745 | 745 | |
| 746 | 746 | static MACHINE_RESET( gticlub ) |
| 747 | 747 | { |
| 748 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 748 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | static MACHINE_DRIVER_START( gticlub ) |
| r1591 | r1592 | |
| 789 | 789 | |
| 790 | 790 | static MACHINE_RESET( hangplt ) |
| 791 | 791 | { |
| 792 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 793 | cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 792 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 793 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | static MACHINE_DRIVER_START( hangplt ) |
| r1591 | r1592 | |
| 985 | 985 | static void sound_irq_callback(int irq) |
| 986 | 986 | { |
| 987 | 987 | if (irq == 0) |
| 988 | { | |
| 989 | cpunum_set_input_line(1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 990 | } | |
| 988 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 991 | 989 | else |
| 992 | { | |
| 993 | cpunum_set_input_line(1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 994 | } | |
| 990 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 995 | 991 | } |
| 996 | 992 | |
| 997 | 993 | static DRIVER_INIT(gticlub) |
| r1591 | r1592 | |
| 1026 | 1022 | |
| 1027 | 1023 | static DRIVER_INIT(slrasslt) |
| 1028 | 1024 | { |
| 1029 | | |
| 1025 | DRIVER_INIT_CALL(gticlub | |
| 1030 | 1026 | |
| 1031 | 1027 | // enable self-modifying code checks |
| 1032 | 1028 | cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_OPTIONS_CHECK_SELFMOD_CODE); |
| r1591 | r1592 | |
|---|---|---|
| 145 | 145 | |
| 146 | 146 | static WRITE8_HANDLER( cloak_irq_reset_0_w ) |
| 147 | 147 | { |
| 148 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 148 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | static WRITE8_HANDLER( cloak_irq_reset_1_w ) |
| 152 | 152 | { |
| 153 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 153 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | static WRITE8_HANDLER( cloak_nvram_enable_w ) |
| r1591 | r1592 | |
|---|---|---|
| 283 | 283 | { |
| 284 | 284 | zpu_int_vector &= ~2; /* clear D1 on INTA (interrupt acknowledge) */ |
| 285 | 285 | |
| 286 | cpunum_set_input_line(0, 0, ASSERT_LINE); /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */ | |
| 286 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */ | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | static READ8_HANDLER( cfb_zpu_int_req_clr ) |
| r1591 | r1592 | |
| 292 | 292 | |
| 293 | 293 | /* clear the INT line when there are no more interrupt requests */ |
| 294 | 294 | if (zpu_int_vector==0xff) |
| 295 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 295 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 296 | 296 | |
| 297 | 297 | return 0; |
| 298 | 298 | } |
| r1591 | r1592 | |
| 1078 | 1078 | soundlatch = param; |
| 1079 | 1079 | |
| 1080 | 1080 | /* cause NMI on sound CPU */ |
| 1081 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1081 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1082 | 1082 | } |
| 1083 | 1083 | |
| 1084 | 1084 | |
| r1591 | r1592 | |
| 1108 | 1108 | /* frequency is 14.318 MHz/16/16/16/16 */ |
| 1109 | 1109 | static INTERRUPT_GEN( sound_interrupt ) |
| 1110 | 1110 | { |
| 1111 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 1111 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | static WRITE8_HANDLER( sound_int_clear_w ) |
| 1115 | 1115 | { |
| 1116 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 1116 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 1117 | 1117 | } |
| 1118 | 1118 | static WRITE8_HANDLER( sound_nmi_clear_w ) |
| 1119 | 1119 | { |
| 1120 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1120 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1121 | 1121 | } |
| 1122 | 1122 | |
| 1123 | 1123 | static WRITE8_HANDLER( gg_led_ctrl_w ) |
| r1591 | r1592 | |
|---|---|---|
| 112 | 112 | * |
| 113 | 113 | *************************************/ |
| 114 | 114 | |
| 115 | static void update_interrupts( | |
| 115 | static void update_interrupts(running_machine *machine) | |
| 116 | 116 | { |
| 117 | 117 | int newstate = 0; |
| 118 | 118 | |
| r1591 | r1592 | |
| 122 | 122 | newstate |= 2; |
| 123 | 123 | |
| 124 | 124 | if (newstate) |
| 125 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 125 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 126 | 126 | else |
| 127 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 127 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 |
| r1591 | r1592 | |
|---|---|---|
| 1075 | 1075 | { |
| 1076 | 1076 | // logerror("mailbox_w_68k: %x @ %x\n", data, offset); |
| 1077 | 1077 | |
| 1078 | if (offset == 4) cpunum_set_input_line(1, M37710_LINE_IRQ0, HOLD_LINE); | |
| 1078 | if (offset == 4) cpunum_set_input_line(Machine, 1, M37710_LINE_IRQ0, HOLD_LINE); | |
| 1079 | 1079 | |
| 1080 | 1080 | COMBINE_DATA(&mcu_mailbox[offset%8]); |
| 1081 | 1081 | } |
| r1591 | r1592 | |
| 1193 | 1193 | logerror("launching 68k, PC=%x\n", activecpu_get_pc()); |
| 1194 | 1194 | |
| 1195 | 1195 | // reset and launch the 68k |
| 1196 | cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1196 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | mcu_port4 = data; |
| r1591 | r1592 | |
| 1272 | 1272 | // for games with the MCU emulated, the MCU boots the 68000. don't allow it before that. |
| 1273 | 1273 | static MACHINE_RESET( namcona1_mcu ) |
| 1274 | 1274 | { |
| 1275 | cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1275 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1276 | 1276 | |
| 1277 | 1277 | mcu_port5 = 1; |
| 1278 | 1278 | } |
| r1591 | r1592 | |
| 1315 | 1315 | { |
| 1316 | 1316 | if( (namcona1_vreg[0x1a/2]&(1<<level))==0 ) |
| 1317 | 1317 | { |
| 1318 | cpunum_set_input_line(0, level+1, HOLD_LINE); | |
| 1318 | cpunum_set_input_line(machine, 0, level+1, HOLD_LINE); | |
| 1319 | 1319 | } |
| 1320 | 1320 | } |
| 1321 | 1321 | } |
| r1591 | r1592 | |
| 1327 | 1327 | static INTERRUPT_GEN( mcu_interrupt ) |
| 1328 | 1328 | { |
| 1329 | 1329 | if (cpu_getiloops() == 0) |
| 1330 | cpunum_set_input_line(1, M37710_LINE_IRQ1, HOLD_LINE); | |
| 1330 | cpunum_set_input_line(machine, 1, M37710_LINE_IRQ1, HOLD_LINE); | |
| 1331 | 1331 | else if (cpu_getiloops() == 1) |
| 1332 | 1332 | { |
| 1333 | cpunum_set_input_line(1, M37710_LINE_ADC, HOLD_LINE); | |
| 1333 | cpunum_set_input_line(machine, 1, M37710_LINE_ADC, HOLD_LINE); | |
| 1334 | 1334 | } |
| 1335 | 1335 | } |
| 1336 | 1336 |
| r1591 | r1592 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #include "sidewndr.lh" |
| 15 | 15 | |
| 16 | static void acefruit_update_irq( int vpos ) | |
| 16 | static void acefruit_update_irq(running_machine *machine, int vpos ) | |
| 17 | 17 | { |
| 18 | 18 | int col; |
| 19 | 19 | int row = vpos / 8; |
| r1591 | r1592 | |
| 26 | 26 | switch( color ) |
| 27 | 27 | { |
| 28 | 28 | case 0x0c: |
| 29 | cpunum_set_input_line( 0, 0, HOLD_LINE ); | |
| 29 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE ); | |
| 30 | 30 | break; |
| 31 | 31 | } |
| 32 | 32 | } |
| r1591 | r1592 | |
| 39 | 39 | int vpos = video_screen_get_vpos( 0 ); |
| 40 | 40 | |
| 41 | 41 | video_screen_update_partial( 0, vpos ); |
| 42 | acefruit_update_irq( vpos ); | |
| 42 | acefruit_update_irq(machine, vpos ); | |
| 43 | 43 | |
| 44 | 44 | vpos = ( ( vpos / 8 ) + 1 ) * 8; |
| 45 | 45 | |
| r1591 | r1592 | |
| 53 | 53 | |
| 54 | 54 | static INTERRUPT_GEN( acefruit_vblank ) |
| 55 | 55 | { |
| 56 | cpunum_set_input_line( 0, 0, HOLD_LINE ); | |
| 56 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE ); | |
| 57 | 57 | timer_adjust( acefruit_refresh_timer, attotime_zero, 0, attotime_never ); |
| 58 | 58 | } |
| 59 | 59 |
| r1591 | r1592 | |
|---|---|---|
| 329 | 329 | |
| 330 | 330 | static INTERRUPT_GEN( hunchbkd_interrupt ) |
| 331 | 331 | { |
| 332 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x03); | |
| 332 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x03); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /************************************* |
| r1591 | r1592 | |
| 359 | 359 | |
| 360 | 360 | dkong_state *state = machine->driver_data; |
| 361 | 361 | |
| 362 | | |
| 362 | MACHINE_START_CALL(dkong2b | |
| 363 | 363 | dma8257_config(0, &hb_dma); |
| 364 | 364 | |
| 365 | 365 | for (i=0;i<0x200;i++) |
| r1591 | r1592 | |
| 377 | 377 | { |
| 378 | 378 | dkong_state *state = machine->driver_data; |
| 379 | 379 | |
| 380 | | |
| 380 | MACHINE_START_CALL(dkong2b | |
| 381 | 381 | state->hardware_type = HARDWARE_TRS02; |
| 382 | 382 | } |
| 383 | 383 | |
| r1591 | r1592 | |
| 385 | 385 | { |
| 386 | 386 | dkong_state *state = machine->driver_data; |
| 387 | 387 | |
| 388 | | |
| 388 | MACHINE_START_CALL(dkong2b | |
| 389 | 389 | state->hardware_type = HARDWARE_TRS01; |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | static MACHINE_START( dkong3 ) |
| 393 | 393 | { |
| 394 | | |
| 394 | MACHINE_START_CALL(dkong2b | |
| 395 | 395 | z80dma_init(1); |
| 396 | 396 | z80dma_config(0, &dk3_dma); |
| 397 | 397 | } |
| r1591 | r1592 | |
| 415 | 415 | dkong_state *state = machine->driver_data; |
| 416 | 416 | UINT8 *ROM = memory_region(REGION_CPU1); |
| 417 | 417 | |
| 418 | | |
| 418 | MACHINE_RESET_CALL(dkong | |
| 419 | 419 | |
| 420 | 420 | /* The initial state of the counter is 0x08 */ |
| 421 | 421 | memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000); |
| r1591 | r1592 | |
| 428 | 428 | dkong_state *state = machine->driver_data; |
| 429 | 429 | UINT8 *ROM = memory_region(REGION_CPU1); |
| 430 | 430 | |
| 431 | | |
| 431 | MACHINE_RESET_CALL(dkong | |
| 432 | 432 | |
| 433 | 433 | /* The initial state of the counter is 0x09 */ |
| 434 | 434 | memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000); |
| r1591 | r1592 | |
| 697 | 697 | { |
| 698 | 698 | if (data & 1) |
| 699 | 699 | { |
| 700 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 701 | cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 700 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 701 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 702 | 702 | } |
| 703 | 703 | else |
| 704 | 704 | { |
| 705 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 706 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 705 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 706 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 707 | 707 | } |
| 708 | 708 | } |
| 709 | 709 |
| r1591 | r1592 | |
|---|---|---|
| 115 | 115 | |
| 116 | 116 | /* NMI and watchdog are disabled during service mode */ |
| 117 | 117 | |
| 118 | watchdog_enable(readinputport(0) & 0x40); | |
| 118 | watchdog_enable(machine, readinputport(0) & 0x40); | |
| 119 | 119 | |
| 120 | 120 | if (readinputport(0) & 0x40) |
| 121 | { | |
| 122 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 123 | } | |
| 121 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 124 | 122 | |
| 125 | 123 | timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, nmi_callback); |
| 126 | 124 | } |
| r1591 | r1592 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | static WRITE8_HANDLER( metlclsh_cause_irq ) |
| 65 | 65 | { |
| 66 | cpunum_set_input_line(1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 66 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static WRITE8_HANDLER( metlclsh_ack_nmi ) |
| 70 | 70 | { |
| 71 | cpunum_set_input_line(0,INPUT_LINE_NMI,CLEAR_LINE); | |
| 71 | cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,CLEAR_LINE); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static ADDRESS_MAP_START( metlclsh_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
| 114 | 114 | |
| 115 | 115 | static WRITE8_HANDLER( metlclsh_cause_nmi2 ) |
| 116 | 116 | { |
| 117 | cpunum_set_input_line(0,INPUT_LINE_NMI,ASSERT_LINE); | |
| 117 | cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,ASSERT_LINE); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | static WRITE8_HANDLER( metlclsh_ack_irq2 ) |
| 121 | 121 | { |
| 122 | cpunum_set_input_line(1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 122 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static WRITE8_HANDLER( metlclsh_ack_nmi2 ) |
| 126 | 126 | { |
| 127 | cpunum_set_input_line(1,INPUT_LINE_NMI,CLEAR_LINE); | |
| 127 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,CLEAR_LINE); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | static WRITE8_HANDLER( metlclsh_flipscreen_w ) |
| r1591 | r1592 | |
| 288 | 288 | |
| 289 | 289 | static void metlclsh_irqhandler(int linestate) |
| 290 | 290 | { |
| 291 | cpunum_set_input_line(0,M6809_IRQ_LINE,linestate); | |
| 291 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,linestate); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
| 302 | 302 | return; |
| 303 | 303 | /* generate NMI on coin insertion */ |
| 304 | 304 | if ((~readinputport(2) & 0xc0) || (~readinputport(3) & 0x40)) |
| 305 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 305 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | static MACHINE_RESET( metlclsh ) |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | static INTERRUPT_GEN( aliens_interrupt ) |
| 30 | 30 | { |
| 31 | 31 | if (K051960_is_IRQ_enabled()) |
| 32 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 32 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static READ8_HANDLER( bankedram_r ) |
| 36 | 36 | { |
| 37 | 37 | if (palette_selected) |
| 38 | return paletteram | |
| 38 | return paletteram[ | |
| 39 | 39 | else |
| 40 | 40 | return ram[offset]; |
| 41 | 41 | } |
| r1591 | r1592 | |
| 73 | 73 | static WRITE8_HANDLER( aliens_sh_irqtrigger_w ) |
| 74 | 74 | { |
| 75 | 75 | soundlatch_w(offset,data); |
| 76 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0xff); | |
| 76 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | static WRITE8_HANDLER( aliens_snd_bankswitch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | static WRITE8_HANDLER( k88games_sh_irqtrigger_w ) |
| 69 | 69 | { |
| 70 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0xff); | |
| 70 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /* handle fake button for speed cheat for players 1 and 2 */ |
| r1591 | r1592 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | static VIDEO_START(mmpanic) |
| 186 | 186 | { |
| 187 | | |
| 187 | VIDEO_START_CALL(ddenlovr | |
| 188 | 188 | |
| 189 | 189 | extra_layers = 1; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static VIDEO_START(hanakanz) |
| 193 | 193 | { |
| 194 | | |
| 194 | VIDEO_START_CALL(ddenlovr | |
| 195 | 195 | |
| 196 | 196 | ddenlovr_blit_rom_bits = 16; |
| 197 | 197 | ddenlovr_blit_commands = hanakanz_commands; |
| r1591 | r1592 | |
| 199 | 199 | |
| 200 | 200 | static VIDEO_START(mjflove) |
| 201 | 201 | { |
| 202 | | |
| 202 | VIDEO_START_CALL(ddenlovr | |
| 203 | 203 | |
| 204 | 204 | ddenlovr_blit_commands = mjflove_commands; |
| 205 | 205 | } |
| r1591 | r1592 | |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | if (irq_vector) |
| 746 | { | |
| 747 | 746 | /* quizchq */ |
| 748 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, irq_vector); | |
| 749 | } | |
| 747 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, irq_vector); | |
| 750 | 748 | else |
| 751 | 749 | { |
| 752 | 750 | /* ddenlovr */ |
| 753 | 751 | if (ddenlovr_blitter_irq_enable) |
| 754 | 752 | { |
| 755 | 753 | ddenlovr_blitter_irq_flag = 1; |
| 756 | cpunum_set_input_line(0,1,HOLD_LINE); | |
| 754 | cpunum_set_input_line(Machine, 0,1,HOLD_LINE); | |
| 757 | 755 | } |
| 758 | 756 | } |
| 759 | 757 | break; |
| r1591 | r1592 | |
| 913 | 911 | #endif |
| 914 | 912 | } |
| 915 | 913 | |
| 916 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, irq_vector); | |
| 914 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, irq_vector); | |
| 917 | 915 | break; |
| 918 | 916 | |
| 919 | 917 | default: |
| r1591 | r1592 | |
| 1967 | 1965 | static WRITE8_HANDLER( mmpanic_soundlatch_w ) |
| 1968 | 1966 | { |
| 1969 | 1967 | soundlatch_w(0,data); |
| 1970 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1968 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1971 | 1969 | } |
| 1972 | 1970 | |
| 1973 | 1971 | static WRITE8_HANDLER( mmpanic_blitter_w ) |
| r1591 | r1592 | |
| 6621 | 6619 | return; |
| 6622 | 6620 | |
| 6623 | 6621 | if ((++count % 60) == 0) |
| 6624 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xfc); | |
| 6622 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xfc); | |
| 6625 | 6623 | else |
| 6626 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xee); | |
| 6624 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xee); | |
| 6627 | 6625 | } |
| 6628 | 6626 | |
| 6629 | 6627 | /* |
| 6630 | 6628 | static INTERRUPT_GEN( rtc_irq ) |
| 6631 | 6629 | { |
| 6632 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xfc); | |
| 6630 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xfc); | |
| 6633 | 6631 | } |
| 6634 | 6632 | */ |
| 6635 | 6633 | |
| r1591 | r1592 | |
| 6699 | 6697 | return; |
| 6700 | 6698 | |
| 6701 | 6699 | if ((++count % 60) == 0) |
| 6702 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xe7); // RST 20, clock | |
| 6700 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xe7); // RST 20, clock | |
| 6703 | 6701 | else |
| 6704 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); // RST 08, vblank | |
| 6702 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); // RST 08, vblank | |
| 6705 | 6703 | } |
| 6706 | 6704 | |
| 6707 | 6705 | static MACHINE_DRIVER_START( mmpanic ) |
| r1591 | r1592 | |
| 6769 | 6767 | return; |
| 6770 | 6768 | |
| 6771 | 6769 | if ((++count % 60) == 0) |
| 6772 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xe2); | |
| 6770 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xe2); | |
| 6773 | 6771 | else |
| 6774 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xe0); | |
| 6772 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xe0); | |
| 6775 | 6773 | } |
| 6776 | 6774 | |
| 6777 | 6775 | static MACHINE_DRIVER_START( hanakanz ) |
| r1591 | r1592 | |
| 6842 | 6840 | return; |
| 6843 | 6841 | |
| 6844 | 6842 | if ((++count % 60) == 0) |
| 6845 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xfa); | |
| 6843 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xfa); | |
| 6846 | 6844 | else |
| 6847 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xf8); | |
| 6845 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xf8); | |
| 6848 | 6846 | } |
| 6849 | 6847 | |
| 6850 | 6848 | |
| r1591 | r1592 | |
| 6901 | 6899 | |
| 6902 | 6900 | switch( cpu_getiloops() ) |
| 6903 | 6901 | { |
| 6904 | case 0: cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xf8); break; | |
| 6905 | case 1: cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xfa); break; | |
| 6902 | case 0: cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xf8); break; | |
| 6903 | case 1: cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xfa); break; | |
| 6906 | 6904 | } |
| 6907 | 6905 | } |
| 6908 | 6906 | |
| 6909 | 6907 | static INTERRUPT_GEN( rtc_nmi_irq ) |
| 6910 | 6908 | { |
| 6911 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 6909 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 6912 | 6910 | } |
| 6913 | 6911 | |
| 6914 | 6912 | static const struct AY8910interface mjmyster_ay8910_interface = |
| r1591 | r1592 | |
| 6954 | 6952 | return; |
| 6955 | 6953 | |
| 6956 | 6954 | if ((++count % 60) == 0) |
| 6957 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xee); | |
| 6955 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xee); | |
| 6958 | 6956 | else |
| 6959 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xf8); | |
| 6957 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xf8); | |
| 6960 | 6958 | } |
| 6961 | 6959 | |
| 6962 | 6960 | static const struct AY8910interface hginga_ay8910_interface = |
| r1591 | r1592 | |
| 7035 | 7033 | { |
| 7036 | 7034 | case 0: |
| 7037 | 7035 | mjflove_irq_cause &= 1 << 5; |
| 7038 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 7036 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 7039 | 7037 | break; |
| 7040 | 7038 | case 1: |
| 7041 | 7039 | mjflove_irq_cause &= 1 << 6; |
| 7042 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 7040 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 7043 | 7041 | break; |
| 7044 | 7042 | } |
| 7045 | 7043 | } |
| r1591 | r1592 | |
| 7062 | 7060 | 0xee is vblank */ |
| 7063 | 7061 | static INTERRUPT_GEN( hparadis_irq ) |
| 7064 | 7062 | { |
| 7065 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xee); | |
| 7063 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xee); | |
| 7066 | 7064 | } |
| 7067 | 7065 | |
| 7068 | 7066 | static MACHINE_DRIVER_START( hparadis ) |
| r1591 | r1592 | |
|---|---|---|
| 85 | 85 | VIDEO_START( chinagat ); |
| 86 | 86 | VIDEO_UPDATE( ddragon ); |
| 87 | 87 | |
| 88 | extern int technos_video_hw; | |
| 89 | extern int ddragon_scrollx_hi, ddragon_scrolly_hi; | |
| 88 | extern UINT8 technos_video_hw; | |
| 89 | extern UINT16 ddragon_scrollx_hi, ddragon_scrolly_hi; | |
| 90 | 90 | extern UINT8 *ddragon_scrollx_lo; |
| 91 | 91 | extern UINT8 *ddragon_scrolly_lo; |
| 92 | 92 | extern UINT8 *ddragon_bgvideoram,*ddragon_fgvideoram; |
| r1591 | r1592 | |
| 141 | 141 | |
| 142 | 142 | static WRITE8_HANDLER( chinagat_sub_IRQ_w ) |
| 143 | 143 | { |
| 144 | cpunum_set_input_line( 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 144 | cpunum_set_input_line(Machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | static WRITE8_HANDLER( chinagat_cpu_sound_cmd_w ) |
| 148 | 148 | { |
| 149 | 149 | soundlatch_w( offset, data ); |
| 150 | cpunum_set_input_line( 2, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 150 | cpunum_set_input_line(Machine, 2, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | static READ8_HANDLER( saiyugb1_mcu_command_r ) |
| r1591 | r1592 | |
| 457 | 457 | GFXDECODE_END |
| 458 | 458 | |
| 459 | 459 | static void chinagat_irq_handler(int irq) { |
| 460 | cpunum_set_input_line( 2, 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 460 | cpunum_set_input_line(Machine, 2, 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 475 | 475 | |
| 476 | 476 | static INTERRUPT_GEN( chinagat_interrupt ) |
| 477 | 477 | { |
| 478 | cpunum_set_input_line(0, 1, HOLD_LINE); /* hold the FIRQ line */ | |
| 479 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); /* pulse the NMI line */ | |
| 478 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); /* hold the FIRQ line */ | |
| 479 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* pulse the NMI line */ | |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | /* This is only on the second bootleg board */ |
| r1591 | r1592 | |
| 492 | 492 | static MACHINE_DRIVER_START( chinagat ) |
| 493 | 493 | |
| 494 | 494 | /* basic machine hardware */ |
| 495 | MDRV_CPU_ADD(HD6309,12000000/ | |
| 495 | MDRV_CPU_ADD(HD6309,12000000/2) /* 1.5 MHz (12MHz oscillator ???) */ | |
| 496 | 496 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 497 | 497 | MDRV_CPU_VBLANK_INT(chinagat_interrupt,1) |
| 498 | 498 | |
| 499 | MDRV_CPU_ADD(HD6309,12000000/ | |
| 499 | MDRV_CPU_ADD(HD6309,12000000/2) /* 1.5 MHz (12MHz oscillator ???) */ | |
| 500 | 500 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 501 | 501 | |
| 502 | 502 | MDRV_CPU_ADD(Z80, 3579545) /* 3.579545 MHz */ |
| r1591 | r1592 | |
| 512 | 512 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 513 | 513 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 514 | 514 | MDRV_SCREEN_SIZE(32*8, 32*8) |
| 515 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, | |
| 515 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 29*8-1) | |
| 516 | 516 | MDRV_GFXDECODE(chinagat) |
| 517 | 517 | MDRV_PALETTE_LENGTH(384) |
| 518 | 518 |
| r1591 | r1592 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | static MACHINE_RESET( berlwall ) |
| 105 | 105 | { |
| 106 | | |
| 106 | MACHINE_RESET_CALL(kaneko16 | |
| 107 | 107 | |
| 108 | 108 | kaneko16_sprite_type = 2; // like type 0, but using 16 instead of 8 bytes |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static MACHINE_RESET( blazeon ) |
| 112 | 112 | { |
| 113 | | |
| 113 | MACHINE_RESET_CALL(kaneko16 | |
| 114 | 114 | |
| 115 | 115 | kaneko16_sprite_xoffs = 0x10000 - 0x680; |
| 116 | 116 | kaneko16_sprite_yoffs = 0x000; |
| r1591 | r1592 | |
| 162 | 162 | |
| 163 | 163 | static MACHINE_RESET( bakubrkr ) |
| 164 | 164 | { |
| 165 | | |
| 165 | MACHINE_RESET_CALL(kaneko16 | |
| 166 | 166 | |
| 167 | 167 | kaneko16_priority.sprite[0] = 8; // above all |
| 168 | 168 | kaneko16_priority.sprite[1] = 8; // above all |
| r1591 | r1592 | |
| 174 | 174 | |
| 175 | 175 | static MACHINE_RESET( gtmr ) |
| 176 | 176 | { |
| 177 | | |
| 177 | MACHINE_RESET_CALL(kaneko16 | |
| 178 | 178 | |
| 179 | 179 | kaneko16_sprite_type = 1; |
| 180 | 180 | |
| r1591 | r1592 | |
| 186 | 186 | |
| 187 | 187 | static MACHINE_RESET( mgcrystl ) |
| 188 | 188 | { |
| 189 | | |
| 189 | MACHINE_RESET_CALL(kaneko16 | |
| 190 | 190 | /* |
| 191 | 191 | Sx = Sprites with priority x, x = tiles with priority x, |
| 192 | 192 | Sprites - Tiles Order: |
| r1591 | r1592 | |
| 215 | 215 | |
| 216 | 216 | static MACHINE_RESET( shogwarr ) |
| 217 | 217 | { |
| 218 | | |
| 218 | MACHINE_RESET_CALL(kaneko16 | |
| 219 | 219 | |
| 220 | 220 | calc3_mcu_init(); |
| 221 | 221 | } |
| r1591 | r1592 | |
| 261 | 261 | if (ACCESSING_MSB) |
| 262 | 262 | { |
| 263 | 263 | soundlatch_w(0, (data & 0xff00) >> 8 ); |
| 264 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 264 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| r1591 | r1592 | |
| 1750 | 1750 | { |
| 1751 | 1751 | switch ( cpu_getiloops() ) |
| 1752 | 1752 | { |
| 1753 | case 2: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 1754 | case 1: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 1755 | case 0: cpunum_set_input_line(0, 5, HOLD_LINE); break; | |
| 1753 | case 2: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 1754 | case 1: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 1755 | case 0: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; | |
| 1756 | 1756 | } |
| 1757 | 1757 | } |
| 1758 | 1758 | |
| r1591 | r1592 | |
| 2086 | 2086 | { |
| 2087 | 2087 | switch ( cpu_getiloops() ) |
| 2088 | 2088 | { |
| 2089 | case 2: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 2090 | case 1: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 2091 | // case 0: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 2089 | case 2: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 2090 | case 1: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 2091 | // case 0: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 2092 | 2092 | } |
| 2093 | 2093 | } |
| 2094 | 2094 | |
| r1591 | r1592 | |
| 3208 | 3208 | |
| 3209 | 3209 | static DRIVER_INIT( shogwarr ) |
| 3210 | 3210 | { |
| 3211 | | |
| 3211 | DRIVER_INIT_CALL(kaneko16 | |
| 3212 | 3212 | |
| 3213 | 3213 | /* |
| 3214 | 3214 | ROM test at 2237e: |
| r1591 | r1592 | |
|---|---|---|
| 76 | 76 | switch (cpu_getiloops()) |
| 77 | 77 | { |
| 78 | 78 | case 0: |
| 79 | cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE); | |
| 79 | cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE); | |
| 80 | 80 | break; |
| 81 | 81 | |
| 82 | 82 | case 1: |
| 83 | 83 | if (K053246_is_IRQ_enabled()) |
| 84 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 84 | cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 85 | 85 | break; |
| 86 | 86 | } |
| 87 | 87 | } |
| r1591 | r1592 | |
| 134 | 134 | |
| 135 | 135 | static WRITE16_HANDLER( dbz_sound_cause_nmi ) |
| 136 | 136 | { |
| 137 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 137 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | static void dbz_sound_irq(int irq) |
| 141 | 141 | { |
| 142 | 142 | if (irq) |
| 143 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 143 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 144 | 144 | else |
| 145 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 145 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | static ADDRESS_MAP_START( dbz_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
|---|---|---|
| 301 | 301 | case 0: |
| 302 | 302 | // sound data |
| 303 | 303 | if (ACCESSING_LSB) |
| 304 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 304 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 305 | 305 | else |
| 306 | 306 | LOG_UNKNOWN_WRITE |
| 307 | 307 | break; |
| r1591 | r1592 | |
| 542 | 542 | { |
| 543 | 543 | switch(cpu_getiloops()) |
| 544 | 544 | { |
| 545 | case 0: cpunum_set_input_line(0,1,HOLD_LINE); break; | |
| 546 | case 1: cpunum_set_input_line(0,3,HOLD_LINE); break; | |
| 545 | case 0: cpunum_set_input_line(machine, 0,1,HOLD_LINE); break; | |
| 546 | case 1: cpunum_set_input_line(machine, 0,3,HOLD_LINE); break; | |
| 547 | 547 | } |
| 548 | 548 | } |
| 549 | 549 | |
| r1591 | r1592 | |
| 551 | 551 | { |
| 552 | 552 | switch(cpu_getiloops()) |
| 553 | 553 | { |
| 554 | case 0: cpunum_set_input_line(0,3,HOLD_LINE); break; | |
| 555 | case 1: cpunum_set_input_line(0,1,HOLD_LINE); break; | |
| 554 | case 0: cpunum_set_input_line(machine, 0,3,HOLD_LINE); break; | |
| 555 | case 1: cpunum_set_input_line(machine, 0,1,HOLD_LINE); break; | |
| 556 | 556 | } |
| 557 | 557 | } |
| 558 | 558 |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | static WRITE8_HANDLER( wc90_sound_command_w ) |
| 111 | 111 | { |
| 112 | 112 | soundlatch_w(offset,data); |
| 113 | cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 113 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
| r1591 | r1592 | |
| 333 | 333 | /* handler called by the 2608 emulator when the internal timers cause an IRQ */ |
| 334 | 334 | static void irqhandler(int irq) |
| 335 | 335 | { |
| 336 | cpunum_set_input_line(2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 336 | cpunum_set_input_line(Machine, 2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static const struct YM2608interface ym2608_interface = |
| r1591 | r1592 | |
|---|---|---|
| 145 | 145 | * |
| 146 | 146 | *************************************/ |
| 147 | 147 | |
| 148 | static void update_interrupts( | |
| 148 | static void update_interrupts(running_machine *machine) | |
| 149 | 149 | { |
| 150 | 150 | int newstate = 0; |
| 151 | 151 | |
| r1591 | r1592 | |
| 155 | 155 | newstate |= 6; |
| 156 | 156 | |
| 157 | 157 | if (newstate) |
| 158 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 158 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 159 | 159 | else |
| 160 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 160 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| r1591 | r1592 | |
| 216 | 216 | |
| 217 | 217 | if ((oldword ^ sound_reset_val) & 1) |
| 218 | 218 | { |
| 219 | cpunum_set_input_line(1, INPUT_LINE_RESET, (sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 219 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 220 | 220 | atarigen_sound_reset(); |
| 221 | 221 | } |
| 222 | 222 | } |
| r1591 | r1592 | |
|---|---|---|
| 272 | 272 | static WRITE32_HANDLER( ms32_sound_w ) |
| 273 | 273 | { |
| 274 | 274 | soundlatch_w(0, data & 0xff); |
| 275 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 275 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 276 | 276 | |
| 277 | 277 | // give the Z80 time to respond |
| 278 | 278 | cpu_spinuntil_time(ATTOTIME_IN_USEC(40)); |
| r1591 | r1592 | |
| 285 | 285 | |
| 286 | 286 | static WRITE32_HANDLER( reset_sub_w ) |
| 287 | 287 | { |
| 288 | if(data) cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); // 0 too ? | |
| 288 | if(data) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); // 0 too ? | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| r1591 | r1592 | |
| 1245 | 1245 | for(i=15; i>=0 && !(irqreq & (1<<i)); i--); |
| 1246 | 1246 | irqreq &= ~(1<<i); |
| 1247 | 1247 | if(!irqreq) |
| 1248 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 1248 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 1249 | 1249 | return i; |
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | 1252 | static void irq_init(void) |
| 1253 | 1253 | { |
| 1254 | 1254 | irqreq = 0; |
| 1255 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 1255 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 1256 | 1256 | cpunum_set_irq_callback(0, irq_callback); |
| 1257 | 1257 | } |
| 1258 | 1258 | |
| 1259 | 1259 | static void irq_raise(int level) |
| 1260 | 1260 | { |
| 1261 | 1261 | irqreq |= (1<<level); |
| 1262 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 1262 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | static INTERRUPT_GEN(ms32_interrupt) |
| r1591 | r1592 | |
| 1302 | 1302 | |
| 1303 | 1303 | static READ8_HANDLER( latch_r ) |
| 1304 | 1304 | { |
| 1305 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1305 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1306 | 1306 | return soundlatch_r(0)^0xff; |
| 1307 | 1307 | } |
| 1308 | 1308 | |
| r1591 | r1592 | |
| 2195 | 2195 | // { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 } |
| 2196 | 2196 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); |
| 2197 | 2197 | |
| 2198 | | |
| 2198 | DRIVER_INIT_CALL(ss92047_01 | |
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | 2201 | static DRIVER_INIT (47pie2) |
| r1591 | r1592 | |
| 2203 | 2203 | // { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 } |
| 2204 | 2204 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 ); |
| 2205 | 2205 | |
| 2206 | | |
| 2206 | DRIVER_INIT_CALL(ss92048_01 | |
| 2207 | 2207 | } |
| 2208 | 2208 | |
| 2209 | 2209 | static DRIVER_INIT (f1superb) |
| r1591 | r1592 | |
| 2212 | 2212 | UINT32 *pROM = (UINT32 *)memory_region(REGION_CPU1); |
| 2213 | 2213 | pROM[0x19d04/4]=0x167a021a; // bne->br : sprite Y offset table is always copied to RAM |
| 2214 | 2214 | #endif |
| 2215 | | |
| 2215 | DRIVER_INIT_CALL(ss92046_01 | |
| 2216 | 2216 | } |
| 2217 | 2217 | |
| 2218 | 2218 | /********** GAME DRIVERS **********/ |
| r1591 | r1592 | |
|---|---|---|
| 441 | 441 | |
| 442 | 442 | /////////////////////////////////////////////////////////////////////////// |
| 443 | 443 | |
| 444 | static void cpu0_irq(int state) | |
| 444 | static void pia_cpu0_irq(int state) | |
| 445 | 445 | { |
| 446 | int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0) | | |
| 447 | pia_get_irq_a(1) | pia_get_irq_b(1) | | |
| 448 | pia_get_irq_a(2) | pia_get_irq_b(2) | | |
| 449 | pia_get_irq_a(3) | pia_get_irq_b(3) | | |
| 450 | pia_get_irq_a(4) | pia_get_irq_b(4) | | |
| 451 | pia_get_irq_a(5) | pia_get_irq_b(5); | |
| 452 | ||
| 446 | 453 | if (!serial_card_connected) |
| 447 | 454 | { |
| 448 | cpunum_set_input_line(0, M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); | |
| 449 | LOG(("6809 int%d \n",state)); | |
| 455 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 456 | LOG(("6809 int%d \n", combined_state)); | |
| 450 | 457 | } |
| 451 | 458 | else |
| 452 | 459 | { |
| 453 | cpunum_set_input_line(0, M6809_FIRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); | |
| 454 | LOG(("6809 fint%d \n",state)); | |
| 460 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 461 | LOG(("6809 fint%d \n", combined_state)); | |
| 455 | 462 | } |
| 456 | 463 | } |
| 457 | 464 | |
| 465 | ||
| 466 | static void ptm_cpu0_irq(int state) | |
| 467 | { | |
| 468 | if (!serial_card_connected) | |
| 469 | { | |
| 470 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 471 | LOG(("6809 int%d \n", state)); | |
| 472 | } | |
| 473 | else | |
| 474 | { | |
| 475 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 476 | LOG(("6809 fint%d \n", state)); | |
| 477 | } | |
| 478 | } | |
| 479 | ||
| 480 | ||
| 458 | 481 | /////////////////////////////////////////////////////////////////////////// |
| 459 | 482 | static WRITE8_HANDLER( bankswitch_w ) |
| 460 | 483 | { |
| r1591 | r1592 | |
| 490 | 513 | MPU4_MASTER_CLOCK/4, |
| 491 | 514 | { 0,0,0 }, |
| 492 | 515 | { ic2_o1_callback, ic2_o2_callback, ic2_o3_callback }, |
| 493 | cpu0_irq | |
| 516 | ptm_cpu0_irq | |
| 494 | 517 | }; |
| 495 | 518 | |
| 496 | 519 | /*************************************************************************** |
| r1591 | r1592 | |
| 542 | 565 | { |
| 543 | 566 | /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, |
| 544 | 567 | /*outputs: A/B,CA/B2 */ pia_ic3_porta_w, pia_ic3_portb_w, pia_ic3_ca2_w, pia_ic3_cb2_w, |
| 545 | /*irqs : A/B */ cpu0_irq, cpu0_irq | |
| 568 | /*irqs : A/B */ pia_cpu0_irq, pia_cpu0_irq | |
| 546 | 569 | }; |
| 547 | 570 | |
| 548 | 571 | /*--------------------------------------- |
| r1591 | r1592 | |
| 672 | 695 | { |
| 673 | 696 | /*inputs : A/B,CA/B1,CA/B2 */ 0, pia_ic4_portb_r, 0, 0, 0, 0, |
| 674 | 697 | /*outputs: A/B,CA/B2 */ pia_ic4_porta_w, 0, pia_ic4_ca2_w, 0, |
| 675 | /*irqs : A/B */ cpu0_irq, cpu0_irq | |
| 698 | /*irqs : A/B */ pia_cpu0_irq, pia_cpu0_irq | |
| 676 | 699 | }; |
| 677 | 700 | |
| 678 | 701 | //IC5 |
| r1591 | r1592 | |
| 768 | 791 | { |
| 769 | 792 | /*inputs : A/B,CA/B1,CA/B2 */ pia_ic5_porta_r, pia_ic5_portb_r, 0, 0, 0, 0, |
| 770 | 793 | /*outputs: A/B,CA/B2 */ 0, 0, pia_ic5_ca2_w, pia_ic5_cb2_w, |
| 771 | /*irqs : A/B */ cpu0_irq, cpu0_irq | |
| 794 | /*irqs : A/B */ pia_cpu0_irq, pia_cpu0_irq | |
| 772 | 795 | }; |
| 773 | 796 | |
| 774 | 797 | //IC6 |
| r1591 | r1592 | |
| 826 | 849 | { |
| 827 | 850 | /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, |
| 828 | 851 | /*outputs: A/B,CA/B2 */ pia_ic6_porta_w, pia_ic6_portb_w, pia_ic6_ca2_w, pia_ic6_cb2_w, |
| 829 | /*irqs : A/B */ cpu0_irq, cpu0_irq | |
| 852 | /*irqs : A/B */ pia_cpu0_irq, pia_cpu0_irq | |
| 830 | 853 | }; |
| 831 | 854 | |
| 832 | 855 | //IC7 |
| r1591 | r1592 | |
| 902 | 925 | { |
| 903 | 926 | /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, |
| 904 | 927 | /*outputs: A/B,CA/B2 */ pia_ic7_porta_w, pia_ic7_portb_w, pia_ic7_ca2_w, pia_ic7_cb2_w, |
| 905 | /*irqs : A/B */ cpu0_irq, cpu0_irq | |
| 928 | /*irqs : A/B */ pia_cpu0_irq, pia_cpu0_irq | |
| 906 | 929 | }; |
| 907 | 930 | |
| 908 | 931 | static READ8_HANDLER( pia_ic8_porta_r ) |
| r1591 | r1592 | |
| 950 | 973 | { |
| 951 | 974 | /*inputs : A/B,CA/B1,CA/B2 */ pia_ic8_porta_r, 0, 0, 0, 0, 0, |
| 952 | 975 | /*outputs: A/B,CA/B2 */ 0, pia_ic8_portb_w, pia_ic8_ca2_w, pia_ic8_cb2_w, |
| 953 | /*irqs : A/B */ cpu0_irq, cpu0_irq | |
| 976 | /*irqs : A/B */ pia_cpu0_irq, pia_cpu0_irq | |
| 954 | 977 | }; |
| 955 | 978 | |
| 956 | 979 |
| r1591 | r1592 | |
|---|---|---|
| 419 | 419 | // It runs in IM 0, thus needs an opcode on the data bus |
| 420 | 420 | static INTERRUPT_GEN( skylncr_vblank_interrupt ) |
| 421 | 421 | { |
| 422 | if (skylncr_nmi_enable) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 422 | if (skylncr_nmi_enable) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | static MACHINE_DRIVER_START( skylncr ) |
| r1591 | r1592 | |
|---|---|---|
| 41 | 41 | return; |
| 42 | 42 | case 8: /* Sound CPU write */ |
| 43 | 43 | soundlatch_w(0,data & 0xff); |
| 44 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 44 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 45 | 45 | return; |
| 46 | 46 | case 0xa: /* IRQ Ack (VBL) */ |
| 47 | 47 | return; |
| r1591 | r1592 | |
| 275 | 275 | |
| 276 | 276 | static void sound_irq(int state) |
| 277 | 277 | { |
| 278 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 278 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 104 | 104 | int bit = data & 1; |
| 105 | 105 | cpu_interrupt_enable(0,bit); |
| 106 | 106 | if (!bit) |
| 107 | cpunum_set_input_line( 0, 0, CLEAR_LINE ); | |
| 107 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE ); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static WRITE8_HANDLER( flipscreen_w ) |
| r1591 | r1592 | |
|---|---|---|
| 84 | 84 | static MACHINE_RESET( friskyt ) |
| 85 | 85 | { |
| 86 | 86 | /* start with the protection mcu halted */ |
| 87 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 87 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| r1591 | r1592 | |
| 106 | 106 | if (((portb & 4) == 0) && (data & 4)) |
| 107 | 107 | { |
| 108 | 108 | /* reset and start the protection mcu */ |
| 109 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 110 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 109 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 110 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /* other bits unknown */ |
| r1591 | r1592 | |
| 405 | 405 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 406 | 406 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 407 | 407 | |
| 408 | MDRV_CPU_ADD_TAG("mcu", NSC8105, 6000000 | |
| 408 | MDRV_CPU_ADD_TAG("mcu", NSC8105, 6000000 | |
| 409 | 409 | MDRV_CPU_PROGRAM_MAP(mcu_nvram_map,0) |
| 410 | 410 | |
| 411 | 411 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
|---|---|---|
| 139 | 139 | if (ACCESSING_LSB) |
| 140 | 140 | { |
| 141 | 141 | soundlatch_w(offset,data & 0xff); |
| 142 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 142 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| r1591 | r1592 | |
| 343 | 343 | |
| 344 | 344 | static void irqhandler(int linestate) |
| 345 | 345 | { |
| 346 | cpunum_set_input_line(1,0,linestate); | |
| 346 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 212 | 212 | |
| 213 | 213 | static INTERRUPT_GEN( sys16_interrupt ) |
| 214 | 214 | { |
| 215 | cpunum_set_input_line(0, 4, HOLD_LINE); /* Interrupt vector 4, used by VBlank */ | |
| 215 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); /* Interrupt vector 4, used by VBlank */ | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
| r1591 | r1592 | |
| 261 | 261 | sample_buffer <<= 4; |
| 262 | 262 | sample_select ^= 1; |
| 263 | 263 | if(sample_select == 0) |
| 264 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 264 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | static const struct MSM5205interface tturfbl_msm5205_interface = |
| r1591 | r1592 | |
| 398 | 398 | if( ACCESSING_LSB ) |
| 399 | 399 | { |
| 400 | 400 | soundlatch_w( 0,data&0xff ); |
| 401 | cpunum_set_input_line( 1, 0, HOLD_LINE ); | |
| 401 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | |
| r1591 | r1592 | |
| 407 | 407 | if( ACCESSING_LSB ) |
| 408 | 408 | { |
| 409 | 409 | soundlatch_w( 0,data&0xff ); |
| 410 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 410 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
| r1591 | r1592 | |
| 653 | 653 | |
| 654 | 654 | static DRIVER_INIT( bayrtbl1 ) |
| 655 | 655 | { |
| 656 | | |
| 656 | MACHINE_RESET_CALL(sys16_onetim | |
| 657 | 657 | } |
| 658 | 658 | /***************************************************************************/ |
| 659 | 659 | |
| r1591 | r1592 | |
| 812 | 812 | 0,2,0,0 |
| 813 | 813 | }; |
| 814 | 814 | |
| 815 | | |
| 815 | MACHINE_RESET_CALL(sys16_onetim | |
| 816 | 816 | sys16_video_config(dduxbl_update_proc, -0x48, bank); |
| 817 | 817 | } |
| 818 | 818 | /***************************************************************************/ |
| r1591 | r1592 | |
| 939 | 939 | |
| 940 | 940 | static DRIVER_INIT( eswatbl ) |
| 941 | 941 | { |
| 942 | | |
| 942 | MACHINE_RESET_CALL(sys16_onetim | |
| 943 | 943 | sys16_rowscroll_scroll=0x8000; |
| 944 | 944 | sys18_splittab_fg_x=&sys16_textram[0x0f80]; |
| 945 | 945 | } |
| r1591 | r1592 | |
| 1063 | 1063 | |
| 1064 | 1064 | static DRIVER_INIT( fpointbl ) |
| 1065 | 1065 | { |
| 1066 | | |
| 1066 | MACHINE_RESET_CALL(sys16_onetim | |
| 1067 | 1067 | sys16_video_config(fpoint_update_proc, -0xb8, NULL); |
| 1068 | 1068 | } |
| 1069 | 1069 | /***************************************************************************/ |
| r1591 | r1592 | |
| 1232 | 1232 | if( ACCESSING_MSB ) |
| 1233 | 1233 | { |
| 1234 | 1234 | soundlatch_w( 0,data>>8 ); |
| 1235 | cpunum_set_input_line( 1, 0, HOLD_LINE ); | |
| 1235 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 1236 | 1236 | } |
| 1237 | 1237 | } |
| 1238 | 1238 | |
| r1591 | r1592 | |
| 1297 | 1297 | |
| 1298 | 1298 | static DRIVER_INIT( goldnabl ) |
| 1299 | 1299 | { |
| 1300 | | |
| 1300 | MACHINE_RESET_CALL(sys16_onetim | |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | /***************************************************************************/ |
| r1591 | r1592 | |
| 1510 | 1510 | |
| 1511 | 1511 | static DRIVER_INIT( passsht ) |
| 1512 | 1512 | { |
| 1513 | | |
| 1513 | MACHINE_RESET_CALL(sys16_onetim | |
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | static DRIVER_INIT( passht4b ) |
| 1517 | 1517 | { |
| 1518 | | |
| 1518 | MACHINE_RESET_CALL(sys16_onetim | |
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | 1521 | /***************************************************************************/ |
| r1591 | r1592 | |
| 1774 | 1774 | static DRIVER_INIT( shinobl ) |
| 1775 | 1775 | { |
| 1776 | 1776 | shinobl_kludge = 1; |
| 1777 | | |
| 1777 | MACHINE_RESET_CALL(sys16_onetim | |
| 1778 | 1778 | } |
| 1779 | 1779 | |
| 1780 | 1780 | |
| r1591 | r1592 | |
| 1857 | 1857 | |
| 1858 | 1858 | static DRIVER_INIT( tetrisbl ) |
| 1859 | 1859 | { |
| 1860 | | |
| 1860 | MACHINE_RESET_CALL(sys16_onetim | |
| 1861 | 1861 | } |
| 1862 | 1862 | |
| 1863 | 1863 | |
| r1591 | r1592 | |
| 2063 | 2063 | { |
| 2064 | 2064 | UINT8 *mem; |
| 2065 | 2065 | |
| 2066 | | |
| 2066 | MACHINE_RESET_CALL(sys16_onetim | |
| 2067 | 2067 | |
| 2068 | 2068 | mem = memory_region(REGION_CPU2); |
| 2069 | 2069 | memcpy(mem, mem+0x10000, 0x8000); |
| r1591 | r1592 | |
| 2225 | 2225 | |
| 2226 | 2226 | static DRIVER_INIT( wb3bbl ) |
| 2227 | 2227 | { |
| 2228 | | |
| 2228 | MACHINE_RESET_CALL(sys16_onetim | |
| 2229 | 2229 | } |
| 2230 | 2230 | |
| 2231 | 2231 | /***************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 56 | 56 | if (ACCESSING_MSB) |
| 57 | 57 | { |
| 58 | 58 | soundlatch_w(offset,(data >> 8) & 0xff); |
| 59 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 59 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| r1591 | r1592 | |
| 308 | 308 | { |
| 309 | 309 | /* system 16c doesn't have the sound CPU */ |
| 310 | 310 | if (Machine->drv->cpu[1].type != CPU_DUMMY) |
| 311 | cpunum_set_input_line(1,0,linestate); | |
| 311 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | |
| 76 | #define MAIN_CPU_MASTER_CLOCK (112 | |
| 76 | #define MAIN_CPU_MASTER_CLOCK (XTAL_11_2MHz | |
| 77 | 77 | #define PIXEL_CLOCK (MAIN_CPU_MASTER_CLOCK / 2) |
| 78 | 78 | #define CRTC_CLOCK (MAIN_CPU_MASTER_CLOCK / 16) |
| 79 | #define AUDIO_1_MASTER_CLOCK (4000000) | |
| 80 | #define AUDIO_CPU_1_CLOCK (AUDIO_1_MASTER_CLOCK / 4) /* internal divisor */ | |
| 81 | #define AUDIO_2_MASTER_CLOCK (4000000) | |
| 82 | #define AUDIO_CPU_2_CLOCK (AUDIO_2_MASTER_CLOCK / 4) /* internal divisor */ | |
| 79 | #define AUDIO_1_MASTER_CLOCK (XTAL_4MHz) | |
| 80 | #define AUDIO_CPU_1_CLOCK (AUDIO_1_MASTER_CLOCK) | |
| 81 | #define AUDIO_2_MASTER_CLOCK (XTAL_4MHz) | |
| 82 | #define AUDIO_CPU_2_CLOCK (AUDIO_2_MASTER_CLOCK) | |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | static UINT8 *nyny_videoram_1; |
| r1591 | r1592 | |
| 113 | 113 | |
| 114 | 114 | static void main_cpu_irq(int state) |
| 115 | 115 | { |
| 116 | cpunum_set_input_line(0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 116 | int combined_state = pia_get_irq_a(1) | pia_get_irq_b(1) | pia_get_irq_b(2); | |
| 117 | ||
| 118 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 117 | 119 | } |
| 118 | 120 | |
| 119 | 121 | |
| 120 | 122 | static void main_cpu_firq(int state) |
| 121 | 123 | { |
| 122 | cpunum_set_input_line(0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 124 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 123 | 125 | } |
| 124 | 126 | |
| 125 | 127 | |
| r1591 | r1592 | |
| 429 | 431 | static WRITE8_HANDLER( audio_1_command_w ) |
| 430 | 432 | { |
| 431 | 433 | soundlatch_w(0, data); |
| 432 | cpunum_set_input_line(1, M6802_IRQ_LINE, HOLD_LINE); | |
| 434 | cpunum_set_input_line(Machine, 1, M6802_IRQ_LINE, HOLD_LINE); | |
| 433 | 435 | } |
| 434 | 436 | |
| 435 | 437 | |
| 436 | 438 | static WRITE8_HANDLER( audio_1_answer_w ) |
| 437 | 439 | { |
| 438 | 440 | soundlatch3_w(0, data); |
| 439 | cpunum_set_input_line(0, M6809_IRQ_LINE, HOLD_LINE); | |
| 441 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 440 | 442 | } |
| 441 | 443 | |
| 442 | 444 | |
| r1591 | r1592 | |
| 480 | 482 | static WRITE8_HANDLER( audio_2_command_w ) |
| 481 | 483 | { |
| 482 | 484 | soundlatch2_w(0, (data & 0x60) >> 5); |
| 483 | cpunum_set_input_line(2, M6802_IRQ_LINE, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 485 | cpunum_set_input_line(Machine, 2, M6802_IRQ_LINE, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 484 | 486 | } |
| 485 | 487 | |
| 486 | 488 |
| r1591 | r1592 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Irem Red Alert | |
| 3 | Irem Red Alert hardware | |
| 4 | 4 | |
| 5 | Everything in this driver is guesswork and speculation. If something | |
| 6 | seems wrong, it probably is. | |
| 5 | If you have any questions about how this driver works, don't hesitate to | |
| 6 | ask. - Mike Balfour (mab22@po.cwru.edu) | |
| 7 | 7 | |
| 8 | If you have any questions about how this driver works, don't hesitate to | |
| 9 | ask. - Mike Balfour (mab22@po.cwru.edu) | |
| 10 | ***************************************************************************/ | |
| 8 | ******************************************************************** | |
| 9 | IREM 'DEMONEYE-X' proto 1981 | |
| 11 | 10 | |
| 11 | proto sound board | |
| 12 | ||
| 13 | 8910 | |
| 14 | 6821 8910 | |
| 15 | 6802 sound6 sound7 | |
| 16 | 3.579545MHz | |
| 17 | ||
| 18 | main board M-27M-C | |
| 19 | ||
| 20 | 11.73MHz 6502 x x x xx | |
| 21 | x x x on | |
| 22 | 4116 8 | |
| 23 | 4116 - | |
| 24 | 4116 9 | |
| 25 | 4116 6 | |
| 26 | 4116 A | |
| 27 | 4116 7 | |
| 28 | 4116 B | |
| 29 | 4116 | |
| 30 | ||
| 31 | sub board 1 M-27Sb | |
| 32 | ||
| 33 | 1a2 | |
| 34 | ||
| 35 | 2114 | |
| 36 | 2114 | |
| 37 | 2114 <- two parts piggy-backed | |
| 38 | 2114 <- two parts piggy-backed | |
| 39 | 2114 2114 | |
| 40 | 2114 2114 | |
| 41 | ||
| 42 | sub board 2 M-42-S | |
| 43 | ||
| 44 | 1a clr(missing) | |
| 45 | ||
| 46 | 2114 | |
| 47 | 2114 | |
| 48 | 2114 | |
| 49 | 2114 | |
| 50 | 2114 | |
| 51 | 2114 | |
| 52 | ||
| 53 | ********************************************************************* | |
| 54 | ||
| 55 | Known issues/to-do's all games: | |
| 56 | * Video timing from schematics | |
| 57 | ||
| 58 | Known issues/to-do's Red Alert: | |
| 59 | * Analog sounds | |
| 60 | * DIP switches have a different meaning in test mode (see manual) | |
| 61 | * Audio CPU NMI is generated by a 74121 multivibrator, the correct | |
| 62 | pulse length is not emulated | |
| 63 | ||
| 64 | Known issues/to-do's Demoneye-X: | |
| 65 | * Game is NOT_WORKING due to missing graphics layer | |
| 66 | * Everything needs to be verified on real PCB or schematics | |
| 67 | ||
| 68 | ****************************************************************************/ | |
| 69 | ||
| 12 | 70 | #include "driver.h" |
| 13 | #include "machine/6821pia.h" | |
| 14 | #include "sound/ay8910.h" | |
| 71 | #include "cpu/m6502/m6502.h" | |
| 72 | #include "redalert.h" | |
| 15 | 73 | |
| 16 | /* video/redalert.c */ | |
| 17 | extern UINT8 *redalert_backram; | |
| 18 | extern UINT8 *redalert_spriteram1; | |
| 19 | extern UINT8 *redalert_spriteram2; | |
| 20 | extern UINT8 *redalert_spriteram3; | |
| 21 | extern UINT8 *redalert_characterram; | |
| 22 | extern UINT8 *redalert_characterram2; | |
| 23 | WRITE8_HANDLER( redalert_backram_w ); | |
| 24 | WRITE8_HANDLER( redalert_spriteram1_w ); | |
| 25 | WRITE8_HANDLER( redalert_spriteram2_w ); | |
| 26 | WRITE8_HANDLER( redalert_spriteram3_w ); | |
| 27 | WRITE8_HANDLER( redalert_spriteram4_w ); | |
| 28 | WRITE8_HANDLER( redalert_characterram_w ); | |
| 29 | WRITE8_HANDLER( redalert_characterram2_w ); | |
| 30 | extern VIDEO_UPDATE( redalert ); | |
| 31 | WRITE8_HANDLER( redalert_c040_w ); | |
| 32 | WRITE8_HANDLER( demoneye_c040_w ); | |
| 33 | WRITE8_HANDLER( redalert_backcolor_w ); | |
| 34 | 74 | |
| 75 | #define MAIN_PCB_CLOCK (XTAL_12_5MHz) | |
| 76 | #define MAIN_CPU_CLOCK (MAIN_PCB_CLOCK / 16) | |
| 35 | 77 | |
| 36 | /* audio/redalert.c */ | |
| 37 | WRITE8_HANDLER( redalert_c030_w ); | |
| 38 | READ8_HANDLER( redalert_voicecommand_r ); | |
| 39 | WRITE8_HANDLER( redalert_soundlatch_w ); | |
| 40 | READ8_HANDLER( redalert_AY8910_A_r ); | |
| 41 | WRITE8_HANDLER( redalert_AY8910_B_w ); | |
| 42 | WRITE8_HANDLER( redalert_AY8910_w ); | |
| 43 | READ8_HANDLER( redalert_sound_register_IC1_r ); | |
| 44 | WRITE8_HANDLER( redalert_sound_register_IC2_w ); | |
| 45 | 78 | |
| 46 | 79 | |
| 47 | static ADDRESS_MAP_START( redalert_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 48 | AM_RANGE(0x0000, 0x01ff) AM_READ(MRA8_RAM) /* Zero page / stack */ | |
| 49 | AM_RANGE(0x0200, 0x0fff) AM_READ(MRA8_RAM) /* ? */ | |
| 50 | AM_RANGE(0x1000, 0x1fff) AM_READ(MRA8_RAM) /* Scratchpad video RAM */ | |
| 51 | AM_RANGE(0x2000, 0x4fff) AM_READ(MRA8_RAM) /* Video RAM */ | |
| 52 | AM_RANGE(0x5000, 0xbfff) AM_READ(MRA8_ROM) | |
| 53 | AM_RANGE(0xc100, 0xc100) AM_READ(input_port_0_r) | |
| 54 | AM_RANGE(0xc110, 0xc110) AM_READ(input_port_1_r) | |
| 55 | AM_RANGE(0xc120, 0xc120) AM_READ(input_port_2_r) | |
| 56 | AM_RANGE(0xc170, 0xc170) AM_READ(watchdog_reset_r) | |
| 57 | AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_ROM) /* remapped ROM for 6502 vectors */ | |
| 58 | ADDRESS_MAP_END | |
| 80 | /************************************* | |
| 81 | * | |
| 82 | * Interrupt generation | |
| 83 | * | |
| 84 | *************************************/ | |
| 59 | 85 | |
| 60 | static ADDRESS_MAP_START( redalert_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 61 | AM_RANGE(0x0000, 0x01ff) AM_WRITE(MWA8_RAM) | |
| 62 | AM_RANGE(0x0200, 0x0fff) AM_WRITE(MWA8_RAM) /* ? */ | |
| 63 | AM_RANGE(0x1000, 0x1fff) AM_WRITE(MWA8_RAM) /* Scratchpad video RAM */ | |
| 64 | AM_RANGE(0x2000, 0x3fff) AM_WRITE(redalert_backram_w) AM_BASE(&redalert_backram) | |
| 65 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 66 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(redalert_spriteram1_w) AM_BASE(&redalert_spriteram1) | |
| 67 | AM_RANGE(0x4800, 0x4bff) AM_WRITE(redalert_characterram_w) AM_BASE(&redalert_characterram) | |
| 68 | AM_RANGE(0x4c00, 0x4fff) AM_WRITE(redalert_spriteram2_w) AM_BASE(&redalert_spriteram2) | |
| 69 | AM_RANGE(0x5000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 70 | AM_RANGE(0xc130, 0xc130) AM_WRITE(redalert_c030_w) | |
| 71 | AM_RANGE(0xc140, 0xc140) AM_WRITE(redalert_c040_w) | |
| 72 | AM_RANGE(0xc150, 0xc150) AM_WRITE(redalert_backcolor_w) | |
| 73 | AM_RANGE(0xc160, 0xc160) AM_WRITE(redalert_soundlatch_w) | |
| 74 | AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 75 | ADDRESS_MAP_END | |
| 86 | static INTERRUPT_GEN( redalert_vblank_interrupt ) | |
| 87 | { | |
| 88 | if( readinputport(3) ) | |
| 89 | /* the service coin as conntected to the CPU's RDY pin as well */ | |
| 90 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 76 | 91 | |
| 77 | static ADDRESS_MAP_START( redalert_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 78 | AM_RANGE(0x0000, 0x03ff) AM_READ(MRA8_RAM) | |
| 79 | AM_RANGE(0x7800, 0x7fff) AM_READ(MRA8_ROM) | |
| 80 | AM_RANGE(0xf800, 0xffff) AM_READ(MRA8_ROM) | |
| 81 | AM_RANGE(0x1001, 0x1001) AM_READ(redalert_sound_register_IC1_r) | |
| 82 | ADDRESS_MAP_END | |
| 92 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, ASSERT_LINE); | |
| 93 | } | |
| 83 | 94 | |
| 84 | static ADDRESS_MAP_START( redalert_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 85 | AM_RANGE(0x0000, 0x03ff) AM_WRITE(MWA8_RAM) | |
| 86 | AM_RANGE(0x7800, 0x7fff) AM_WRITE(MWA8_ROM) | |
| 87 | AM_RANGE(0xf800, 0xffff) AM_WRITE(MWA8_ROM) | |
| 88 | AM_RANGE(0x1000, 0x1000) AM_WRITE(redalert_AY8910_w) | |
| 89 | AM_RANGE(0x1001, 0x1001) AM_WRITE(redalert_sound_register_IC2_w) | |
| 90 | ADDRESS_MAP_END | |
| 91 | 95 | |
| 92 | static ADDRESS_MAP_START( redalert_voice_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 93 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM) | |
| 94 | AM_RANGE(0x8000, 0x83ff) AM_READ(MRA8_RAM) | |
| 95 | AM_RANGE(0xc000, 0xc000) AM_READ(redalert_voicecommand_r) /* reads command from D0-D5? */ | |
| 96 | ADDRESS_MAP_END | |
| 96 | static READ8_HANDLER( redalert_interrupt_clear_r ) | |
| 97 | { | |
| 98 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, CLEAR_LINE); | |
| 97 | 99 | |
| 98 | static ADDRESS_MAP_START( redalert_voice_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 99 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 100 | AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM) | |
| 101 | ADDRESS_MAP_END | |
| 100 | /* the result never seems to be actually used */ | |
| 101 | return video_screen_get_vpos(0); | |
| 102 | } | |
| 102 | 103 | |
| 103 | 104 | |
| 104 | static ADDRESS_MAP_START( demoneye_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 105 | AM_RANGE(0x0000, 0x01ff) AM_READ(MRA8_RAM) /* Zero page / stack */ | |
| 106 | AM_RANGE(0x0200, 0x0fff) AM_READ(MRA8_RAM) /* ? */ | |
| 107 | AM_RANGE(0x1000, 0x1fff) AM_READ(MRA8_RAM) /* Scratchpad video RAM */ | |
| 108 | AM_RANGE(0x2000, 0x4fff) AM_READ(MRA8_RAM) /* Video RAM */ | |
| 109 | AM_RANGE(0x5000, 0x5fff) AM_READ(MRA8_RAM) | |
| 110 | AM_RANGE(0x6000, 0xbfff) AM_READ(MRA8_ROM) | |
| 111 | AM_RANGE(0xc100, 0xc100) AM_READ(input_port_0_r) | |
| 112 | AM_RANGE(0xc110, 0xc110) AM_READ(input_port_1_r) | |
| 113 | AM_RANGE(0xc120, 0xc120) AM_READ(input_port_2_r) | |
| 114 | AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_ROM) /* remapped ROM for 6502 vectors */ | |
| 115 | ADDRESS_MAP_END | |
| 105 | static WRITE8_HANDLER( redalert_interrupt_clear_w ) | |
| 106 | { | |
| 107 | redalert_interrupt_clear_r(0); | |
| 108 | } | |
| 116 | 109 | |
| 117 | static ADDRESS_MAP_START( demoneye_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 118 | AM_RANGE(0x0000, 0x01ff) AM_WRITE(MWA8_RAM) | |
| 119 | AM_RANGE(0x0200, 0x0fff) AM_WRITE(MWA8_RAM) /* ? */ | |
| 120 | AM_RANGE(0x1000, 0x1fff) AM_WRITE(MWA8_RAM) /* Scratchpad video RAM */ | |
| 121 | AM_RANGE(0x2000, 0x3fff) AM_WRITE(redalert_backram_w) AM_BASE(&redalert_backram) | |
| 122 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(redalert_characterram_w) AM_BASE(&redalert_characterram) | |
| 123 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(redalert_spriteram1_w) AM_BASE(&redalert_spriteram1) | |
| 124 | AM_RANGE(0x4800, 0x4bff) AM_WRITE(redalert_characterram2_w) AM_BASE(&redalert_characterram2) | |
| 125 | AM_RANGE(0x4c00, 0x4fff) AM_WRITE(redalert_spriteram2_w) AM_BASE(&redalert_spriteram2) | |
| 126 | AM_RANGE(0x5000, 0x53ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 127 | AM_RANGE(0x5400, 0x57ff) AM_WRITE(redalert_spriteram3_w) AM_BASE(&redalert_spriteram3) | |
| 128 | AM_RANGE(0x5800, 0x5bff) AM_WRITE(MWA8_RAM) //??? | |
| 129 | AM_RANGE(0x5c00, 0x5fff) AM_WRITE(MWA8_RAM) //??? | |
| 130 | AM_RANGE(0x6000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 131 | AM_RANGE(0xc130, 0xc130) AM_WRITE(MWA8_NOP) | |
| 132 | AM_RANGE(0xc140, 0xc140) AM_WRITE(demoneye_c040_w) | |
| 133 | AM_RANGE(0xc150, 0xc150) AM_WRITE(redalert_backcolor_w) | |
| 134 | AM_RANGE(0xc160, 0xc160) AM_WRITE(MWA8_NOP) | |
| 135 | AM_RANGE(0xc161, 0xc161) AM_WRITE(MWA8_NOP) | |
| 136 | AM_RANGE(0xc162, 0xc162) AM_WRITE(watchdog_reset_w) | |
| 137 | AM_RANGE(0xc163, 0xc163) AM_WRITE(MWA8_NOP) | |
| 138 | AM_RANGE(0xc170, 0xc170) AM_WRITE(MWA8_NOP) | |
| 139 | AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 140 | ADDRESS_MAP_END | |
| 141 | 110 | |
| 142 | static ADDRESS_MAP_START( demoneye_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 143 | AM_RANGE(0x0000, 0x007f) AM_READ(MRA8_RAM) | |
| 144 | AM_RANGE(0x0500, 0x0503) AM_READ(pia_0_r) | |
| 145 | AM_RANGE(0x2000, 0x2fff) AM_READ(MRA8_ROM) | |
| 146 | AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_ROM) | |
| 111 | ||
| 112 | /************************************* | |
| 113 | * | |
| 114 | * Memory handlers | |
| 115 | * | |
| 116 | *************************************/ | |
| 117 | ||
| 118 | static ADDRESS_MAP_START( redalert_main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 119 | AM_RANGE(0x0000, 0x1fff) AM_RAM | |
| 120 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(MRA8_RAM, redalert_bitmap_videoram_w) AM_BASE(&redalert_bitmap_videoram) | |
| 121 | AM_RANGE(0x4000, 0x4fff) AM_RAM AM_BASE(&redalert_charmap_videoram) | |
| 122 | AM_RANGE(0x5000, 0xbfff) AM_ROM | |
| 123 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READWRITE(port_tag_to_handler8("C000"), MWA8_NOP) | |
| 124 | AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READWRITE(port_tag_to_handler8("C010"), MWA8_NOP) | |
| 125 | AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READWRITE(port_tag_to_handler8("C020"), MWA8_NOP) | |
| 126 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READWRITE(MRA8_NOP, redalert_audio_command_w) | |
| 127 | AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READWRITE(MRA8_NOP, MWA8_RAM) AM_BASE(&redalert_video_control) | |
| 128 | AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READWRITE(MRA8_NOP, MWA8_RAM) AM_BASE(&redalert_bitmap_color) | |
| 129 | AM_RANGE(0xc060, 0xc060) AM_MIRROR(0x0f8f) AM_READWRITE(MRA8_NOP, redalert_voice_command_w) | |
| 130 | AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(redalert_interrupt_clear_r, redalert_interrupt_clear_w) | |
| 131 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x8000) | |
| 147 | 132 | ADDRESS_MAP_END |
| 148 | 133 | |
| 149 | static ADDRESS_MAP_START( demoneye_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 150 | AM_RANGE(0x0000, 0x007f) AM_WRITE(MWA8_RAM) | |
| 151 | AM_RANGE(0x0500, 0x0503) AM_WRITE(pia_0_w) | |
| 152 | AM_RANGE(0x2000, 0x2fff) AM_WRITE(MWA8_ROM) | |
| 153 | AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 134 | ||
| 135 | static ADDRESS_MAP_START( demoneye_main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 136 | AM_RANGE(0x0000, 0x1fff) AM_RAM | |
| 137 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(MRA8_RAM, redalert_bitmap_videoram_w) AM_BASE(&redalert_bitmap_videoram) | |
| 138 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(&redalert_charmap_videoram) | |
| 139 | AM_RANGE(0x6000, 0xbfff) AM_ROM | |
| 140 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READWRITE(port_tag_to_handler8("C000"), MWA8_NOP) | |
| 141 | AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READWRITE(port_tag_to_handler8("C010"), MWA8_NOP) | |
| 142 | AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READWRITE(port_tag_to_handler8("C020"), MWA8_NOP) | |
| 143 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READWRITE(MRA8_NOP, demoneye_audio_command_w) | |
| 144 | AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READWRITE(MRA8_NOP, MWA8_RAM) AM_BASE(&redalert_video_control) | |
| 145 | AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READWRITE(MRA8_NOP, MWA8_RAM) AM_BASE(&redalert_bitmap_color) | |
| 146 | AM_RANGE(0xc060, 0xc060) AM_MIRROR(0x0f80) AM_READWRITE(MRA8_NOP, MWA8_NOP) /* unknown */ | |
| 147 | AM_RANGE(0xc061, 0xc061) AM_MIRROR(0x0f80) AM_READWRITE(MRA8_NOP, MWA8_NOP) /* unknown */ | |
| 148 | AM_RANGE(0xc062, 0xc062) AM_MIRROR(0x0f80) AM_READWRITE(MRA8_NOP, MWA8_NOP) /* unknown */ | |
| 149 | AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(redalert_interrupt_clear_r, redalert_interrupt_clear_w) /* probably not correct */ | |
| 150 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x8000) | |
| 154 | 151 | ADDRESS_MAP_END |
| 155 | 152 | |
| 156 | 153 | |
| 154 | ||
| 155 | /************************************* | |
| 156 | * | |
| 157 | * Port definitions | |
| 158 | * | |
| 159 | *************************************/ | |
| 160 | ||
| 157 | 161 | static INPUT_PORTS_START( redalert ) |
| 158 | PORT_START /* DIP Switches */ | |
| 159 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 162 | PORT_START_TAG("C000") | |
| 163 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW:1,2") | |
| 160 | 164 | PORT_DIPSETTING( 0x00, "3" ) |
| 161 | 165 | PORT_DIPSETTING( 0x01, "4" ) |
| 162 | 166 | PORT_DIPSETTING( 0x02, "5" ) |
| 163 | 167 | PORT_DIPSETTING( 0x03, "6" ) |
| 164 | PORT_DIPNAME( 0x04, 0x00, "Cabinet in Service Mode" ) | |
| 168 | PORT_DIPNAME( 0x04, 0x00, "Cabinet in Service Mode" ) PORT_DIPLOCATION("SW:3") | |
| 165 | 169 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 166 | 170 | PORT_DIPSETTING( 0x04, DEF_STR( Cocktail ) ) |
| 167 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) | |
| 171 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW:4") | |
| 168 | 172 | PORT_DIPSETTING( 0x00, "5000" ) |
| 169 | 173 | PORT_DIPSETTING( 0x08, "7000" ) |
| 170 | PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) | |
| 174 | PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:5,6") | |
| 171 | 175 | PORT_DIPSETTING( 0x30, DEF_STR( 2C_1C ) ) |
| 172 | 176 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) |
| 173 | 177 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) |
| 174 | 178 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 175 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) | |
| 179 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:7") | |
| 176 | 180 | PORT_DIPSETTING( 0x40, DEF_STR( Upright ) ) |
| 177 | 181 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| 178 | PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) | |
| 182 | PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW:8" ) | |
| 179 | 183 | |
| 180 | PORT_START /* IN1 */ | |
| 181 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 182 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 183 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 184 | PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 185 | PORT_BIT ( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 186 | PORT_BIT ( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) | |
| 187 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) | |
| 188 | PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ | |
| 184 | PORT_START_TAG("C010") | |
| 185 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 186 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 187 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 188 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* pin 35 - N.C. */ | |
| 189 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* pin 36 - N.C. */ | |
| 190 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) | |
| 191 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) | |
| 192 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ | |
| 189 | 193 | |
| 190 | PORT_START /* IN2 */ | |
| 191 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 192 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ | |
| 193 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 194 | PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 195 | PORT_BIT ( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 196 | PORT_BIT ( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL | |
| 197 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL | |
| 198 | PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ | |
| 194 | PORT_START_TAG("C020") | |
| 195 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 196 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ | |
| 197 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 198 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* pin 33 - N.C. */ | |
| 199 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* pin 34 - N.C. */ | |
| 200 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL | |
| 201 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL | |
| 202 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ | |
| 199 | 203 | |
| 200 | PORT_START | |
| 204 | PORT_START_TAG("COIN") | |
| 201 | 205 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) |
| 206 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 207 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) | |
| 208 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 202 | 209 | INPUT_PORTS_END |
| 203 | 210 | |
| 204 | 211 | |
| 205 | 212 | static INPUT_PORTS_START( demoneye ) |
| 206 | PORT_START | |
| 213 | PORT_START_TAG("C000") | |
| 207 | 214 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) |
| 208 | 215 | PORT_DIPSETTING( 0x00, "3" ) |
| 209 | 216 | PORT_DIPSETTING( 0x01, "4" ) |
| r1591 | r1592 | |
| 227 | 234 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 228 | 235 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 229 | 236 | |
| 230 | PORT_START | |
| 237 | PORT_START_TAG("C0 | |
| 231 | 238 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 232 | 239 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) |
| 233 | 240 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| r1591 | r1592 | |
| 237 | 244 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) |
| 238 | 245 | PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ |
| 239 | 246 | |
| 240 | PORT_START | |
| 247 | PORT_START_TAG("C0 | |
| 241 | 248 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 242 | 249 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ |
| 243 | 250 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL |
| r1591 | r1592 | |
| 247 | 254 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL |
| 248 | 255 | PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */ |
| 249 | 256 | |
| 250 | PORT_START | |
| 257 | PORT_START_TAG("COIN") | |
| 251 | 258 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) |
| 259 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 260 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) | |
| 261 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 252 | 262 | INPUT_PORTS_END |
| 253 | 263 | |
| 254 | 264 | |
| 255 | static const gfx_layout backlayout = | |
| 256 | { | |
| 257 | 8,8, /* 8*8 characters */ | |
| 258 | 0x400, /* 1024 characters */ | |
| 259 | 1, /* 1 bits per pixel */ | |
| 260 | { 0 }, /* No info needed for bit offsets */ | |
| 261 | { 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 262 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 263 | 8*8 /* every char takes 8 consecutive bytes */ | |
| 264 | }; | |
| 265 | 265 | |
| 266 | static const gfx_layout charlayout = | |
| 267 | { | |
| 268 | 8,8, /* 8*8 characters */ | |
| 269 | 128, /* 128 characters */ | |
| 270 | 1, /* 1 bits per pixel */ | |
| 271 | { 0 }, /* No info needed for bit offsets */ | |
| 272 | { 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 273 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 274 | 8*8 /* every char takes 8 consecutive bytes */ | |
| 275 | }; | |
| 266 | /************************************* | |
| 267 | * | |
| 268 | * Machine drivers | |
| 269 | * | |
| 270 | *************************************/ | |
| 276 | 271 | |
| 277 | static const gfx_layout spritelayout = | |
| 278 | { | |
| 279 | 8,8, /* 8*8 characters */ | |
| 280 | 128, /* 128 characters */ | |
| 281 | 2, /* 2 bits per pixel */ | |
| 282 | { 0, 0x800*8 }, /* No info needed for bit offsets */ | |
| 283 | { 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 284 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 285 | 8*8 /* every char takes 8 consecutive bytes */ | |
| 286 | }; | |
| 287 | ||
| 288 | static GFXDECODE_START( redalert ) | |
| 289 | GFXDECODE_ENTRY( 0, 0x3000, backlayout, 0, 8 ) /* the game dynamically modifies this */ | |
| 290 | GFXDECODE_ENTRY( 0, 0x4800, charlayout, 0, 8 ) /* the game dynamically modifies this */ | |
| 291 | GFXDECODE_ENTRY( 0, 0x4400, spritelayout,16, 4 ) /* the game dynamically modifies this */ | |
| 292 | GFXDECODE_END | |
| 293 | ||
| 294 | static GFXDECODE_START( demoneye ) | |
| 295 | GFXDECODE_ENTRY( 0, 0x3000, backlayout, 0, 8 ) /* the game dynamically modifies this */ | |
| 296 | GFXDECODE_ENTRY( 0, 0x4800, spritelayout,16, 4 ) /* the game dynamically modifies this */ | |
| 297 | GFXDECODE_ENTRY( 0, 0x4400, spritelayout,16, 4 ) /* the game dynamically modifies this */ | |
| 298 | GFXDECODE_ENTRY( 0, 0x5400, spritelayout,16, 4 ) /* the game dynamically modifies this */ | |
| 299 | GFXDECODE_END | |
| 300 | ||
| 301 | /* Arbitrary colortable */ | |
| 302 | static const UINT16 colortable_source[] = | |
| 303 | { | |
| 304 | 0,7, | |
| 305 | 0,6, | |
| 306 | 0,2, | |
| 307 | 0,4, | |
| 308 | 0,3, | |
| 309 | 0,6, | |
| 310 | 0,1, | |
| 311 | 0,8, | |
| 312 | ||
| 313 | 0,8,8,8, | |
| 314 | 0,6,4,7, | |
| 315 | 0,6,4,1, | |
| 316 | 0,8,5,1, | |
| 317 | }; | |
| 318 | ||
| 319 | static PALETTE_INIT( redalert ) | |
| 320 | { | |
| 321 | /* Arbitrary colors */ | |
| 322 | palette_set_color(machine,0,MAKE_RGB(0x40,0x80,0xff)); /* Background */ | |
| 323 | palette_set_color(machine,1,MAKE_RGB(0x00,0x00,0xff)); /* Blue */ | |
| 324 | palette_set_color(machine,2,MAKE_RGB(0xff,0x00,0xff)); /* Magenta */ | |
| 325 | palette_set_color(machine,3,MAKE_RGB(0x00,0xff,0xff)); /* Cyan */ | |
| 326 | palette_set_color(machine,4,MAKE_RGB(0xff,0x00,0x00)); /* Red */ | |
| 327 | palette_set_color(machine,5,MAKE_RGB(0xff,0x80,0x00)); /* Orange */ | |
| 328 | palette_set_color(machine,6,MAKE_RGB(0xff,0xff,0x00)); /* Yellow */ | |
| 329 | palette_set_color(machine,7,MAKE_RGB(0xff,0xff,0xff)); /* White */ | |
| 330 | palette_set_color(machine,8,MAKE_RGB(0x00,0x00,0x00)); /* Black */ | |
| 331 | ||
| 332 | memcpy(colortable,colortable_source,sizeof(colortable_source)); | |
| 333 | } | |
| 334 | ||
| 335 | static INTERRUPT_GEN( redalert_interrupt ) | |
| 336 | { | |
| 337 | if( readinputport(3) ) | |
| 338 | { | |
| 339 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 340 | } | |
| 341 | else | |
| 342 | { | |
| 343 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 344 | } | |
| 345 | } | |
| 346 | ||
| 347 | static const struct AY8910interface redalert_ay8910_interface = | |
| 348 | { | |
| 349 | redalert_AY8910_A_r, /* Port A Read */ | |
| 350 | 0, /* Port B Read */ | |
| 351 | 0, /* Port A Write */ | |
| 352 | redalert_AY8910_B_w /* Port B Write */ | |
| 353 | }; | |
| 354 | ||
| 355 | 272 | static MACHINE_DRIVER_START( redalert ) |
| 356 | 273 | |
| 357 | 274 | /* basic machine hardware */ |
| 358 | MDRV_CPU_ADD(M6502, 1000000) /* ???? */ | |
| 359 | MDRV_CPU_PROGRAM_MAP(redalert_readmem,redalert_writemem) | |
| 360 | MDRV_CPU_VBLANK_INT(redalert_interrupt,1) | |
| 275 | MDRV_CPU_ADD(M6502, MAIN_CPU_CLOCK) | |
| 276 | MDRV_CPU_PROGRAM_MAP(redalert_main_map,0) | |
| 277 | MDRV_CPU_VBLANK_INT(redalert_vblank_interrupt,1) | |
| 361 | 278 | |
| 362 | MDRV_CPU_ADD(M6502, 1000000) | |
| 363 | /* audio CPU */ /* 1 MHz */ | |
| 364 | MDRV_CPU_PROGRAM_MAP(redalert_sound_readmem,redalert_sound_writemem) | |
| 365 | /* IRQ is hooked to a 555 timer, whose freq is 1150 Hz */ | |
| 366 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,1150) | |
| 367 | ||
| 368 | MDRV_CPU_ADD(8085A, 1000000) | |
| 369 | /* audio CPU */ /* 1 MHz? */ | |
| 370 | MDRV_CPU_PROGRAM_MAP(redalert_voice_readmem,redalert_voice_writemem) | |
| 371 | ||
| 372 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 373 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 374 | ||
| 375 | 279 | /* video hardware */ |
| 376 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 377 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 378 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 379 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
| 380 | MDRV_GFXDECODE(redalert) | |
| 381 | MDRV_PALETTE_LENGTH(9) | |
| 382 | MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0])) | |
| 280 | MDRV_IMPORT_FROM(redalert_video) | |
| 383 | 281 | |
| 384 | MDRV_PALETTE_INIT(redalert) | |
| 385 | MDRV_VIDEO_START(generic) | |
| 386 | MDRV_VIDEO_UPDATE(redalert) | |
| 387 | ||
| 388 | /* sound hardware */ | |
| 389 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 390 | MDRV_SOUND_ADD(AY8910, 2000000) | |
| 391 | MDRV_SOUND_CONFIG(redalert_ay8910_interface) | |
| 392 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 282 | /* audio hardware */ | |
| 283 | MDRV_IMPORT_FROM(redalert_audio) | |
| 393 | 284 | MACHINE_DRIVER_END |
| 394 | 285 | |
| 395 | 286 | |
| 396 | /* PIA 0, sound CPU */ | |
| 397 | static const pia6821_interface pia_0_intf = | |
| 398 | { | |
| 399 | /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, | |
| 400 | /*outputs: A/B,CA/B2 */ 0, 0, 0, 0, | |
| 401 | /*irqs : A/B */ 0, 0 | |
| 402 | }; | |
| 403 | ||
| 404 | static MACHINE_START( demoneye ) | |
| 405 | { | |
| 406 | pia_config(0, &pia_0_intf); | |
| 407 | } | |
| 408 | ||
| 409 | static MACHINE_RESET( demoneye ) | |
| 410 | { | |
| 411 | pia_reset(); | |
| 412 | } | |
| 413 | ||
| 414 | 287 | static MACHINE_DRIVER_START( demoneye ) |
| 415 | 288 | |
| 416 | 289 | /* basic machine hardware */ |
| 417 | MDRV_CPU_ADD(M6502, 11730000/2) /* 11.73MHz */ | |
| 418 | MDRV_CPU_PROGRAM_MAP(demoneye_readmem,demoneye_writemem) | |
| 419 | MDRV_CPU_VBLANK_INT(redalert_interrupt,1) | |
| 290 | MDRV_CPU_ADD(M6502, MAIN_CPU_CLOCK) | |
| 291 | MDRV_CPU_PROGRAM_MAP(demoneye_main_map,0) | |
| 292 | MDRV_CPU_VBLANK_INT(redalert_vblank_interrupt,1) | |
| 420 | 293 | |
| 421 | MDRV_CPU_ADD(M6802, 3579545) /* 3.579545 MHz */ | |
| 422 | /* audio CPU */ | |
| 423 | MDRV_CPU_PROGRAM_MAP(demoneye_sound_readmem,demoneye_sound_writemem) | |
| 424 | ||
| 425 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 426 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 427 | ||
| 428 | MDRV_MACHINE_START(demoneye) | |
| 429 | MDRV_MACHINE_RESET(demoneye) | |
| 430 | ||
| 431 | 294 | /* video hardware */ |
| 432 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 433 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 434 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 435 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
| 436 | MDRV_GFXDECODE(demoneye) | |
| 437 | MDRV_PALETTE_LENGTH(9) | |
| 438 | MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0])) | |
| 295 | MDRV_IMPORT_FROM(demoneye_video) | |
| 439 | 296 | |
| 440 | MDRV_PALETTE_INIT(redalert) | |
| 441 | MDRV_VIDEO_START(generic) | |
| 442 | MDRV_VIDEO_UPDATE(redalert) | |
| 443 | ||
| 444 | /* sound hardware */ | |
| 445 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 446 | ||
| 447 | MDRV_SOUND_ADD(AY8910, 3579545) | |
| 448 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 449 | ||
| 450 | MDRV_SOUND_ADD(AY8910, 3579545) | |
| 451 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 297 | /* audio hardware */ | |
| 298 | MDRV_IMPORT_FROM(demoneye_audio) | |
| 452 | 299 | MACHINE_DRIVER_END |
| 453 | 300 | |
| 454 | /*************************************************************************** | |
| 455 | 301 | |
| 456 | Game ROMs | |
| 457 | 302 | |
| 458 | ***************************************************************************/ | |
| 303 | /************************************* | |
| 304 | * | |
| 305 | * ROM definitions | |
| 306 | * | |
| 307 | *************************************/ | |
| 459 | 308 | |
| 460 | 309 | ROM_START( redalert ) |
| 461 | 310 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 462 | ROM_LOAD( "rag5", 0x5000, 0x1000, CRC(d7c9cdd6) SHA1(5ff5cdceaa00083b745cf5c74b096f7edfadf737) ) | |
| 463 | ROM_LOAD( "rag6", 0x6000, 0x1000, CRC(cb2a308c) SHA1(9f3bc22bad31165e080e81d4a3fb0ec2aad235fe) ) | |
| 464 | ROM_LOAD( "rag7n", 0x7000, 0x1000, CRC(82ab2dae) SHA1(f8328b048384afac245f1c16a2d0864ffe0b4741) ) | |
| 465 | ROM_LOAD( "rag8n", 0x8000, 0x1000, CRC(b80eece9) SHA1(d986449bdb1d94832187c7f953f01330391ef4c9) ) | |
| 466 | ROM_RELOAD( 0xf000, 0x1000 ) | |
| 467 | ROM_LOAD( "rag9", 0x9000, 0x1000, CRC(2b7d1295) SHA1(1498af0c55bd38fe79b91afc38921085102ebbc3) ) | |
| 468 | ROM_LOAD( "ragab", 0xa000, 0x1000, CRC(ab99f5ed) SHA1(a93713bb03d61cce64adc89b874b67adea7c53cd) ) | |
| 469 | ROM_LOAD( "ragb", 0xb000, 0x1000, CRC(8e0d1661) SHA1(bff4ddca761ddd70113490f50777e62c66813685) ) | |
| 311 | ROM_LOAD( "rag5", 0x5000, 0x1000, CRC(d7c9cdd6) SHA1(5ff5cdceaa00083b745cf5c74b096f7edfadf737) ) | |
| 312 | ROM_LOAD( "rag6", 0x6000, 0x1000, CRC(cb2a308c) SHA1(9f3bc22bad31165e080e81d4a3fb0ec2aad235fe) ) | |
| 313 | ROM_LOAD( "rag7n", 0x7000, 0x1000, CRC(82ab2dae) SHA1(f8328b048384afac245f1c16a2d0864ffe0b4741) ) | |
| 314 | ROM_LOAD( "rag8n", 0x8000, 0x1000, CRC(b80eece9) SHA1(d986449bdb1d94832187c7f953f01330391ef4c9) ) | |
| 315 | ROM_LOAD( "rag9", 0x9000, 0x1000, CRC(2b7d1295) SHA1(1498af0c55bd38fe79b91afc38921085102ebbc3) ) | |
| 316 | ROM_LOAD( "ragab", 0xa000, 0x1000, CRC(ab99f5ed) SHA1(a93713bb03d61cce64adc89b874b67adea7c53cd) ) | |
| 317 | ROM_LOAD( "ragb", 0xb000, 0x1000, CRC(8e0d1661) SHA1(bff4ddca761ddd70113490f50777e62c66813685) ) | |
| 470 | 318 | |
| 471 | 319 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) |
| 472 | ROM_LOAD( "w3s1", 0x7800, 0x0800, CRC(4af956a5) SHA1(25368a40d7ebc60316fd2d78ec4c686e701b96dc) ) | |
| 473 | ROM_RELOAD( 0xf800, 0x0800 ) | |
| 320 | ROM_LOAD( "w3s1", 0x7000, 0x0800, CRC(4af956a5) SHA1(25368a40d7ebc60316fd2d78ec4c686e701b96dc) ) | |
| 474 | 321 | |
| 475 | 322 | ROM_REGION( 0x10000, REGION_CPU3, 0 ) |
| 476 | ROM_LOAD( "ras1b", 0x0000, 0x1000, CRC(ec690845) SHA1(26a84738bd45ed21dac6c8383ebd9c3b9831024a) ) | |
| 477 | ROM_LOAD( "ras2", 0x1000, 0x1000, CRC(fae94cfc) SHA1(2fd798706bb3afda3fb55bc877e597cc4e5d0c15) ) | |
| 478 | ROM_LOAD( "ras3", 0x2000, 0x1000, CRC(20d56f3e) SHA1(5c32ee3365407e6d3f7ab5662e9ecbac437ed4cb) ) | |
| 479 | ROM_LOAD( "ras4", 0x3000, 0x1000, CRC(130e66db) SHA1(385b8f889fee08fddbb2f75a691af569109eacd1) ) | |
| 323 | ROM_LOAD( "ras1b", 0x0000, 0x1000, CRC(ec690845) SHA1(26a84738bd45ed21dac6c8383ebd9c3b9831024a) ) | |
| 324 | ROM_LOAD( "ras2", 0x1000, 0x1000, CRC(fae94cfc) SHA1(2fd798706bb3afda3fb55bc877e597cc4e5d0c15) ) | |
| 325 | ROM_LOAD( "ras3", 0x2000, 0x1000, CRC(20d56f3e) SHA1(5c32ee3365407e6d3f7ab5662e9ecbac437ed4cb) ) | |
| 326 | ROM_LOAD( "ras4", 0x3000, 0x1000, CRC(130e66db) SHA1(385b8f889fee08fddbb2f75a691af569109eacd1) ) | |
| 480 | 327 | |
| 481 | ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* unknow */ | |
| 482 | ROM_LOAD( "m-257sc.1a", 0x0000, 0x0200, CRC(b1aca792) SHA1(db37f99b9880cc3c434e2a55a0bbb017d9a72aa3) ) | |
| 328 | ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* color PROM */ | |
| 329 | ROM_LOAD( "m-257sc.1a", 0x0000, 0x0200, CRC(b1aca792) SHA1(db37f99b9880cc3c434e2a55a0bbb017d9a72aa3) ) | |
| 483 | 330 | ROM_END |
| 484 | 331 | |
| 485 | 332 | |
| 486 | /******************************************************************** | |
| 487 | IREM 'DEMONEYE-X' proto 1981 | |
| 488 | ||
| 489 | proto sound board | |
| 490 | ||
| 491 | 8910 | |
| 492 | 6821 8910 | |
| 493 | 6802 sound6 sound7 | |
| 494 | 3.579545MHz | |
| 495 | ||
| 496 | main board M-27M-C | |
| 497 | ||
| 498 | 11.73MHz 6502 x x x xx | |
| 499 | x x x on | |
| 500 | 4116 8 | |
| 501 | 4116 - | |
| 502 | 4116 9 | |
| 503 | 4116 6 | |
| 504 | 4116 A | |
| 505 | 4116 7 | |
| 506 | 4116 B | |
| 507 | 4116 | |
| 508 | ||
| 509 | sub board 1 M-27Sb | |
| 510 | ||
| 511 | 1a2 | |
| 512 | ||
| 513 | 2114 | |
| 514 | 2114 | |
| 515 | 2114 <- two parts piggy-backed | |
| 516 | 2114 <- two parts piggy-backed | |
| 517 | 2114 2114 | |
| 518 | 2114 2114 | |
| 519 | ||
| 520 | sub board 2 M-42-S | |
| 521 | ||
| 522 | 1a clr(missing) | |
| 523 | ||
| 524 | 2114 | |
| 525 | 2114 | |
| 526 | 2114 | |
| 527 | 2114 | |
| 528 | 2114 | |
| 529 | 2114 | |
| 530 | ||
| 531 | *********************************************************************/ | |
| 532 | ||
| 533 | 333 | ROM_START( demoneye ) |
| 534 | 334 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 535 | ROM_LOAD( "demoneye.6", 0x6000, 0x1000, CRC(b03ee3a9) SHA1(66b6115fbb4e8097152702022c59c464e8211e5a) ) | |
| 536 | ROM_LOAD( "demoneye.7", 0x7000, 0x1000, CRC(667a5de7) SHA1(c3ce7fbbc6c98250e9d5f85854e6887017ca5ff9) ) | |
| 537 | ROM_LOAD( "demoneye.8", 0x8000, 0x1000, CRC(257484d7) SHA1(3937cce546462a471adbdc1da63ddfc20cfc7b79) ) | |
| 538 | ROM_RELOAD( 0xf000, 0x1000 ) | |
| 539 | ROM_LOAD( "demoneye.9", 0x9000, 0x1000, CRC(bd8d79a8) SHA1(68c1443ef78b545eb9e612573b86515c3ad7f103) ) | |
| 540 | ROM_LOAD( "demoneye.a", 0xa000, 0x1000, CRC(a27d08aa) SHA1(659ad22778e852fc58f3951d62bc01151c973d36) ) | |
| 541 | ROM_LOAD( "demoneye.b", 0xb000, 0x1000, CRC(1fd3585b) SHA1(b1697b7b21b739499fda1e155530dbfab89f3358) ) | |
| 335 | ROM_LOAD( "demoneye.6", 0x6000, 0x1000, CRC(b03ee3a9) SHA1(66b6115fbb4e8097152702022c59c464e8211e5a) ) | |
| 336 | ROM_LOAD( "demoneye.7", 0x7000, 0x1000, CRC(667a5de7) SHA1(c3ce7fbbc6c98250e9d5f85854e6887017ca5ff9) ) | |
| 337 | ROM_LOAD( "demoneye.8", 0x8000, 0x1000, CRC(257484d7) SHA1(3937cce546462a471adbdc1da63ddfc20cfc7b79) ) | |
| 338 | ROM_LOAD( "demoneye.9", 0x9000, 0x1000, CRC(bd8d79a8) SHA1(68c1443ef78b545eb9e612573b86515c3ad7f103) ) | |
| 339 | ROM_LOAD( "demoneye.a", 0xa000, 0x1000, CRC(a27d08aa) SHA1(659ad22778e852fc58f3951d62bc01151c973d36) ) | |
| 340 | ROM_LOAD( "demoneye.b", 0xb000, 0x1000, CRC(1fd3585b) SHA1(b1697b7b21b739499fda1e155530dbfab89f3358) ) | |
| 542 | 341 | |
| 543 | 342 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) |
| 544 | ROM_LOAD( "demoneye.7s", 0x2000, 0x1000, CRC(8fdc9364) SHA1(3fccb5b22f08d6a0cde85863c1ce5399c84f233e) ) | |
| 545 | ROM_LOAD( "demoneye.6s", 0xf000, 0x1000, CRC(0a23def9) SHA1(b52f52be312ec7810e3c9cbd3913e887f983b1ee) ) | |
| 343 | ROM_LOAD( "demoneye.7s", 0x2000, 0x1000, CRC(8fdc9364) SHA1(3fccb5b22f08d6a0cde85863c1ce5399c84f233e) ) | |
| 344 | ROM_LOAD( "demoneye.6s", 0x3000, 0x1000, CRC(0a23def9) SHA1(b52f52be312ec7810e3c9cbd3913e887f983b1ee) ) | |
| 546 | 345 | |
| 547 | ROM_REGION( 0x0400, REGION_USER1, 0 ) /* unknow */ | |
| 346 | ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* color PROM */ | |
| 347 | ROM_LOAD( "demoneye.1a2", 0x0000, 0x0200, CRC(eaf5a66e) SHA1(d8ebe05ba5d75fbf6ad45f710e5bd27b6afad44b) ) | |
| 348 | ||
| 349 | ROM_REGION( 0x0200, REGION_USER1, 0 ) /* unknown */ | |
| 548 | 350 | ROM_LOAD( "demoneye.1a", 0x0000, 0x0200, CRC(d03488ea) SHA1(11027f502ad2a9255b2e5611ab2eee16ede1d704) ) |
| 549 | ROM_LOAD( "demoneye.1a2", 0x0200, 0x0200, CRC(eaf5a66e) SHA1(d8ebe05ba5d75fbf6ad45f710e5bd27b6afad44b) ) | |
| 550 | 351 | ROM_END |
| 551 | 352 | |
| 552 | GAME( 1981, redalert, 0, redalert, redalert, 0, ROT270, "Irem + GDI", "Red Alert", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 553 | GAME( 1981, demoneye, 0, demoneye, demoneye, 0, ROT270, "Irem", "Demoneye-X", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) | |
| 353 | ||
| 354 | ||
| 355 | /************************************* | |
| 356 | * | |
| 357 | * Game drivers | |
| 358 | * | |
| 359 | *************************************/ | |
| 360 | ||
| 361 | GAME( 1981, redalert, 0, redalert, redalert, 0, ROT270, "Irem + GDI", "Red Alert", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) | |
| 362 | GAME( 1981, demoneye, 0, demoneye, demoneye, 0, ROT270, "Irem", "Demoneye-X", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r1591 | r1592 | |
|---|---|---|
| 287 | 287 | |
| 288 | 288 | static void ctc0_interrupt(int state) |
| 289 | 289 | { |
| 290 | cpunum_set_input_line(1, 0, state); | |
| 290 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static z80ctc_interface ctc_intf = |
| r1591 | r1592 | |
|---|---|---|
| 16 | 16 | VIDEO_START( stadhero ); |
| 17 | 17 | VIDEO_UPDATE( stadhero ); |
| 18 | 18 | |
| 19 | extern UINT16 *stadhero_pf1_data,*stadhero_pf2_data; | |
| 19 | extern UINT16 *stadhero_pf1_data; | |
| 20 | extern UINT16 *stadhero_pf2_control_0; | |
| 21 | extern UINT16 *stadhero_pf2_control_1; | |
| 20 | 22 | |
| 21 | 23 | WRITE16_HANDLER( stadhero_pf1_data_w ); |
| 24 | READ16_HANDLER( stadhero_pf2_data_r ); | |
| 22 | 25 | WRITE16_HANDLER( stadhero_pf2_data_w ); |
| 23 | WRITE16_HANDLER( stadhero_pf2_control_0_w ); | |
| 24 | WRITE16_HANDLER( stadhero_pf2_control_1_w ); | |
| 25 | 26 | |
| 26 | 27 | /******************************************************************************/ |
| 27 | 28 | |
| r1591 | r1592 | |
| 51 | 52 | break; |
| 52 | 53 | case 6: /* 6502 sound cpu */ |
| 53 | 54 | soundlatch_w(0,data & 0xff); |
| 54 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 55 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 55 | 56 | break; |
| 56 | 57 | default: |
| 57 | 58 | logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",activecpu_get_pc(),data,0x30c010+offset); |
| r1591 | r1592 | |
| 59 | 60 | } |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | static WRITE16_HANDLER( spriteram_mirror_w ) | |
| 63 | { | |
| 64 | spriteram16[offset]=data; | |
| 65 | } | |
| 66 | 63 | |
| 67 | static READ16_HANDLER( stadhero_pf1_data_r ) { return stadhero_pf1_data[offset]; } | |
| 68 | static READ16_HANDLER( stadhero_pf2_data_r ) { return stadhero_pf2_data[offset]; } | |
| 69 | ||
| 70 | 64 | /******************************************************************************/ |
| 71 | 65 | |
| 72 | static ADDRESS_MAP_START( stadhero_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 73 | AM_RANGE(0x000000, 0x01ffff) AM_READ(MRA16_ROM) | |
| 74 | AM_RANGE(0x200000, 0x2007ff) AM_READ(stadhero_pf1_data_r) | |
| 75 | AM_RANGE(0x260000, 0x261fff) AM_READ(stadhero_pf2_data_r) | |
| 76 | AM_RANGE(0x30c000, 0x30c00b) AM_READ(stadhero_control_r) | |
| 77 | AM_RANGE(0x310000, 0x3107ff) AM_READ(MRA16_RAM) | |
| 78 | AM_RANGE(0xff8000, 0xffbfff) AM_READ(MRA16_RAM) /* Main ram */ | |
| 79 | AM_RANGE(0xffc000, 0xffc7ff) AM_READ(MRA16_RAM) /* Sprites */ | |
| 66 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 67 | AM_RANGE(0x000000, 0x01ffff) AM_ROM | |
| 68 | AM_RANGE(0x200000, 0x2007ff) AM_READWRITE(MRA16_RAM, stadhero_pf1_data_w) AM_BASE(&stadhero_pf1_data) | |
| 69 | AM_RANGE(0x240000, 0x240007) AM_READWRITE(MRA16_RAM, MWA16_RAM) AM_BASE(&stadhero_pf2_control_0) | |
| 70 | AM_RANGE(0x240010, 0x240017) AM_WRITE(MWA16_RAM) AM_BASE(&stadhero_pf2_control_1) | |
| 71 | AM_RANGE(0x260000, 0x261fff) AM_READWRITE(stadhero_pf2_data_r, stadhero_pf2_data_w) | |
| 72 | AM_RANGE(0x30c000, 0x30c00b) AM_READWRITE(stadhero_control_r, stadhero_control_w) | |
| 73 | AM_RANGE(0x310000, 0x3107ff) AM_READWRITE(MRA16_RAM, paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 74 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */ | |
| 75 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_BASE(&spriteram16) | |
| 80 | 76 | ADDRESS_MAP_END |
| 81 | 77 | |
| 82 | static ADDRESS_MAP_START( stadhero_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 83 | AM_RANGE(0x000000, 0x01ffff) AM_WRITE(MWA16_ROM) | |
| 84 | AM_RANGE(0x200000, 0x2007ff) AM_WRITE(stadhero_pf1_data_w) AM_BASE(&stadhero_pf1_data) | |
| 85 | AM_RANGE(0x240000, 0x240007) AM_WRITE(stadhero_pf2_control_0_w) | |
| 86 | AM_RANGE(0x240010, 0x240017) AM_WRITE(stadhero_pf2_control_1_w) | |
| 87 | AM_RANGE(0x260000, 0x261fff) AM_WRITE(stadhero_pf2_data_w) AM_BASE(&stadhero_pf2_data) | |
| 88 | AM_RANGE(0x30c000, 0x30c00b) AM_WRITE(stadhero_control_w) | |
| 89 | AM_RANGE(0x310000, 0x3107ff) AM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 90 | AM_RANGE(0xff8000, 0xffbfff) AM_WRITE(MWA16_RAM) | |
| 91 | AM_RANGE(0xffc000, 0xffc7ff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) | |
| 92 | AM_RANGE(0xffc800, 0xffcfff) AM_WRITE(spriteram_mirror_w) | |
| 93 | ADDRESS_MAP_END | |
| 94 | ||
| 95 | 78 | /******************************************************************************/ |
| 96 | 79 | |
| 97 | 80 | static WRITE8_HANDLER( YM3812_w ) |
| r1591 | r1592 | |
| 118 | 101 | } |
| 119 | 102 | } |
| 120 | 103 | |
| 121 | static ADDRESS_MAP_START( stadhero_s_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 122 | AM_RANGE(0x0000, 0x05ff) AM_READ(MRA8_RAM) | |
| 123 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 124 | AM_RANGE(0x3800, 0x3800) AM_READ(OKIM6295_status_0_r) | |
| 125 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 126 | ADDRESS_MAP_END | |
| 127 | ||
| 128 | static ADDRESS_MAP_START( stadhero_s_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 129 | AM_RANGE(0x0000, 0x05ff) AM_WRITE(MWA8_RAM) | |
| 104 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 105 | AM_RANGE(0x0000, 0x05ff) AM_RAM | |
| 130 | 106 | AM_RANGE(0x0800, 0x0801) AM_WRITE(YM2203_w) |
| 131 | 107 | AM_RANGE(0x1000, 0x1001) AM_WRITE(YM3812_w) |
| 132 | AM_RANGE(0x3800, 0x3800) AM_WRITE(OKIM6295_data_0_w) | |
| 133 | AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 108 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 109 | AM_RANGE(0x3800, 0x3800) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) | |
| 110 | AM_RANGE(0x8000, 0xffff) AM_ROM | |
| 134 | 111 | ADDRESS_MAP_END |
| 135 | 112 | |
| 136 | 113 | /******************************************************************************/ |
| r1591 | r1592 | |
| 266 | 243 | |
| 267 | 244 | static void irqhandler(int linestate) |
| 268 | 245 | { |
| 269 | cpunum_set_input_line(1,0,linestate); | |
| 246 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 270 | 247 | } |
| 271 | 248 | |
| 272 | 249 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
| 280 | 257 | |
| 281 | 258 | /* basic machine hardware */ |
| 282 | 259 | MDRV_CPU_ADD(M68000, 10000000) |
| 283 | MDRV_CPU_PROGRAM_MAP( | |
| 260 | MDRV_CPU_PROGRAM_MAP( | |
| 284 | 261 | MDRV_CPU_VBLANK_INT(irq5_line_hold,1)/* VBL */ |
| 285 | 262 | |
| 286 | 263 | MDRV_CPU_ADD(M6502, 1500000) |
| 287 | 264 | /* audio CPU */ |
| 288 | MDRV_CPU_PROGRAM_MAP( | |
| 265 | MDRV_CPU_PROGRAM_MAP( | |
| 289 | 266 | |
| 290 | 267 | MDRV_SCREEN_REFRESH_RATE(58) |
| 291 | 268 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529)) |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | static WRITE16_HANDLER( prehisle_sound16_w ) |
| 30 | 30 | { |
| 31 | 31 | soundlatch_w(0, data & 0xff); |
| 32 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 32 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /*******************************************************************************/ |
| r1591 | r1592 | |
| 216 | 216 | |
| 217 | 217 | static void irqhandler(int irq) |
| 218 | 218 | { |
| 219 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 219 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | static void sound_nmi_callback( int param ) |
| 72 | 72 | { |
| 73 | cpunum_set_input_line(1, INPUT_LINE_NMI, ( nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 73 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ( nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 74 | 74 | |
| 75 | 75 | nmi_enabled = 0; |
| 76 | 76 | } |
| r1591 | r1592 | |
| 78 | 78 | |
| 79 | 79 | static TIMER_CALLBACK( nmi_callback ) |
| 80 | 80 | { |
| 81 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 81 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static WRITE8_HANDLER( z80_arm_nmi_w ) |
| 85 | 85 | { |
| 86 | 86 | // sound_nmi_enabled = 1; |
| 87 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 87 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 88 | 88 | timer_set(ATTOTIME_IN_USEC(25), NULL,0,nmi_callback); /* kludge until the K053260 is emulated correctly */ |
| 89 | 89 | } |
| 90 | 90 | |
| r1591 | r1592 | |
| 256 | 256 | static TIMER_CALLBACK( dmaend_callback ) |
| 257 | 257 | { |
| 258 | 258 | if (simpsons_firq_enabled) |
| 259 | cpunum_set_input_line(0, KONAMI_FIRQ_LINE, HOLD_LINE); | |
| 259 | cpunum_set_input_line(machine, 0, KONAMI_FIRQ_LINE, HOLD_LINE); | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | static INTERRUPT_GEN( simpsons_irq ) |
| r1591 | r1592 | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | if (K052109_is_IRQ_enabled()) |
| 273 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 273 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | static MACHINE_DRIVER_START( simpsons ) |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | { |
| 111 | 111 | sound_cpu_busy = snk_sound_busy_bit; |
| 112 | 112 | soundlatch_w(0, data); |
| 113 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 113 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static READ8_HANDLER( sound_command_r ) |
| r1591 | r1592 | |
| 121 | 121 | |
| 122 | 122 | static READ8_HANDLER( sound_nmi_ack_r ) |
| 123 | 123 | { |
| 124 | cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 124 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 125 | 125 | return 0; |
| 126 | 126 | } |
| 127 | 127 |
| r1591 | r1592 | |
|---|---|---|
| 158 | 158 | // 220000 = writes to mcu? 330000 = reads? |
| 159 | 159 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x220000, 0x220001, 0, 0, aladbl_w); |
| 160 | 160 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x330000, 0x330001, 0, 0, aladbl_r); |
| 161 | | |
| 161 | DRIVER_INIT_CALL(megadrij | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | GAME( 1993, aladbl , 0, megadriv, aladbl, aladbl, ROT0, "bootleg / Sega", "Aladdin (bootleg of Japanese Megadrive version)", 0) |
| r1591 | r1592 | |
|---|---|---|
| 144 | 144 | static WRITE16_HANDLER ( wwfsstar_soundwrite ) |
| 145 | 145 | { |
| 146 | 146 | soundlatch_w(1,data & 0xff); |
| 147 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 147 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | static WRITE16_HANDLER( wwfsstar_flipscreen_w ) |
| r1591 | r1592 | |
| 155 | 155 | static WRITE16_HANDLER( wwfsstar_irqack_w ) |
| 156 | 156 | { |
| 157 | 157 | if(offset == 0) |
| 158 | cpunum_set_input_line(0, 6, CLEAR_LINE); | |
| 158 | cpunum_set_input_line(Machine, 0, 6, CLEAR_LINE); | |
| 159 | 159 | |
| 160 | 160 | else |
| 161 | cpunum_set_input_line(0, 5, CLEAR_LINE); | |
| 161 | cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /* |
| r1591 | r1592 | |
| 192 | 192 | else if (scanline==240) |
| 193 | 193 | { |
| 194 | 194 | video_screen_update_partial(0, scanline); |
| 195 | cpunum_set_input_line(0, 6, ASSERT_LINE); | |
| 195 | cpunum_set_input_line(machine, 0, 6, ASSERT_LINE); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /* An interrupt is generated every 16 scanlines */ |
| 199 | 199 | if (scanline%16 == 0) |
| 200 | 200 | { |
| 201 | 201 | video_screen_update_partial(0, scanline); |
| 202 | cpunum_set_input_line(0, 5, ASSERT_LINE); | |
| 202 | cpunum_set_input_line(machine, 0, 5, ASSERT_LINE); | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| r1591 | r1592 | |
| 344 | 344 | |
| 345 | 345 | static void wwfsstar_ymirq_handler(int irq) |
| 346 | 346 | { |
| 347 | cpunum_set_input_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 347 | cpunum_set_input_line(Machine, 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 710 | 710 | // logerror("irq: raising %d\n", level); |
| 711 | 711 | // irq_status |= (1 << level); |
| 712 | 712 | last_irq = level; |
| 713 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 713 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | static int irq_callback(int irqline) |
| r1591 | r1592 | |
| 733 | 733 | |
| 734 | 734 | static void irq_init(void) |
| 735 | 735 | { |
| 736 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 736 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 737 | 737 | cpunum_set_irq_callback(0, irq_callback); |
| 738 | 738 | } |
| 739 | 739 | |
| r1591 | r1592 | |
| 750 | 750 | // if the FIFO has something in it, signal the 68k too |
| 751 | 751 | if (fifo_rptr != fifo_wptr) |
| 752 | 752 | { |
| 753 | cpunum_set_input_line(1, 2, HOLD_LINE); | |
| 753 | cpunum_set_input_line(machine, 1, 2, HOLD_LINE); | |
| 754 | 754 | } |
| 755 | 755 | } |
| 756 | 756 | } |
| r1591 | r1592 | |
| 879 | 879 | if (fifo_wptr >= FIFO_SIZE) fifo_wptr = 0; |
| 880 | 880 | |
| 881 | 881 | // signal the 68000 that there's data waiting |
| 882 | cpunum_set_input_line(1, 2, HOLD_LINE); | |
| 882 | cpunum_set_input_line(Machine, 1, 2, HOLD_LINE); | |
| 883 | 883 | // give the 68k time to reply |
| 884 | 884 | cpu_spinuntil_time(ATTOTIME_IN_USEC(40)); |
| 885 | 885 | } |
| r1591 | r1592 | |
|---|---|---|
| 84 | 84 | static WRITE8_HANDLER( actfancr_sound_w ) |
| 85 | 85 | { |
| 86 | 86 | soundlatch_w(0,data & 0xff); |
| 87 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /******************************************************************************/ |
| r1591 | r1592 | |
| 96 | 96 | AM_RANGE(0x100000, 0x1007ff) AM_READ(MRA8_RAM) |
| 97 | 97 | AM_RANGE(0x130000, 0x130003) AM_READ(actfan_control_1_r) |
| 98 | 98 | AM_RANGE(0x140000, 0x140001) AM_READ(actfan_control_0_r) |
| 99 | AM_RANGE(0x120000, 0x1205ff) AM_READ( | |
| 99 | AM_RANGE(0x120000, 0x1205ff) AM_READ(MRA8 | |
| 100 | 100 | AM_RANGE(0x1f0000, 0x1f3fff) AM_READ(MRA8_RAM) |
| 101 | 101 | ADDRESS_MAP_END |
| 102 | 102 | |
| r1591 | r1592 | |
| 118 | 118 | AM_RANGE(0x044000, 0x045fff) AM_READ(actfancr_pf2_data_r) |
| 119 | 119 | AM_RANGE(0x064000, 0x0647ff) AM_READ(actfancr_pf1_data_r) |
| 120 | 120 | AM_RANGE(0x120000, 0x1207ff) AM_READ(MRA8_RAM) |
| 121 | AM_RANGE(0x130000, 0x1305ff) AM_READ( | |
| 121 | AM_RANGE(0x130000, 0x1305ff) AM_READ(MRA8 | |
| 122 | 122 | AM_RANGE(0x140000, 0x140001) AM_READ(MRA8_NOP) /* Value doesn't matter */ |
| 123 | 123 | AM_RANGE(0x1f0000, 0x1f3fff) AM_READ(MRA8_RAM) |
| 124 | 124 | AM_RANGE(0x1ff000, 0x1ff001) AM_READ(triothep_control_r) |
| r1591 | r1592 | |
| 377 | 377 | |
| 378 | 378 | static void sound_irq(int linestate) |
| 379 | 379 | { |
| 380 | cpunum_set_input_line(1,0,linestate); /* IRQ */ | |
| 380 | cpunum_set_input_line(Machine, 1,0,linestate); /* IRQ */ | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
| 433 | 433 | static MACHINE_DRIVER_START( triothep ) |
| 434 | 434 | |
| 435 | 435 | /* basic machine hardware */ |
| 436 | MDRV_CPU_ADD(H6280,214772 | |
| 436 | MDRV_CPU_ADD(H6280,XTAL_21_4772MHz/3) /* XIN=21.4772Mhz, | |
| 437 | 437 | MDRV_CPU_PROGRAM_MAP(triothep_readmem,triothep_writemem) |
| 438 | 438 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* VBL */ |
| 439 | 439 | |
| 440 | MDRV_CPU_ADD(M6502, 1 | |
| 440 | MDRV_CPU_ADD(M6502, XTAL_12MHz/8) /* verified on pcb */ | |
| 441 | 441 | /* audio CPU */ /* Should be accurate */ |
| 442 | 442 | MDRV_CPU_PROGRAM_MAP(dec0_s_readmem,dec0_s_writemem) |
| 443 | 443 | |
| r1591 | r1592 | |
| 458 | 458 | /* sound hardware */ |
| 459 | 459 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 460 | 460 | |
| 461 | MDRV_SOUND_ADD(YM2203, 1 | |
| 461 | MDRV_SOUND_ADD(YM2203, XTAL_12MHz/8) /* verified on pcb */ | |
| 462 | 462 | MDRV_SOUND_ROUTE(0, "mono", 0.90) |
| 463 | 463 | MDRV_SOUND_ROUTE(1, "mono", 0.90) |
| 464 | 464 | MDRV_SOUND_ROUTE(2, "mono", 0.90) |
| 465 | 465 | MDRV_SOUND_ROUTE(3, "mono", 0.50) |
| 466 | 466 | |
| 467 | MDRV_SOUND_ADD(YM3812, | |
| 467 | MDRV_SOUND_ADD(YM3812, XTAL_12MHz/4) /* verified on pcb */ | |
| 468 | 468 | MDRV_SOUND_CONFIG(ym3812_interface) |
| 469 | 469 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 470 | 470 | |
| 471 | MDRV_SOUND_ADD(OKIM6295, 1024188) | |
| 472 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified | |
| 471 | MDRV_SOUND_ADD(OKIM6295, XTAL_1_056MHz) /* verified on pcb */ | |
| 472 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */ | |
| 473 | 473 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85) |
| 474 | 474 | MACHINE_DRIVER_END |
| 475 | 475 |
| r1591 | r1592 | |
|---|---|---|
| 326 | 326 | case 0x00: /* IRQON */ |
| 327 | 327 | cpu_interrupt_enable(0,bit); |
| 328 | 328 | if (!bit) |
| 329 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 329 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 330 | 330 | break; |
| 331 | 331 | |
| 332 | 332 | case 0x01: /* IOSEL */ |
| r1591 | r1592 | |
| 347 | 347 | break; |
| 348 | 348 | |
| 349 | 349 | case 0x04: /* RESB */ |
| 350 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 350 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 351 | 351 | break; |
| 352 | 352 | |
| 353 | 353 | case 0x05: /* RESA */ |
| 354 | cpunum_set_input_line(2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 354 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 355 | 355 | break; |
| 356 | 356 | |
| 357 | 357 | case 0x06: /* SB0 */ |
| r1591 | r1592 | |
| 372 | 372 | |
| 373 | 373 | cpu_interrupt_enable(which,data); |
| 374 | 374 | if (!data) |
| 375 | cpunum_set_input_line(which, 0, CLEAR_LINE); | |
| 375 | cpunum_set_input_line(Machine, which, 0, CLEAR_LINE); | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| r1591 | r1592 | |
| 1695 | 1695 | /* note that the bootleg version doesn't need this custom IC; it has a hacked ROM in its place */ |
| 1696 | 1696 | memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, polepos2_ic25_r); |
| 1697 | 1697 | |
| 1698 | | |
| 1698 | DRIVER_INIT_CALL(polepos | |
| 1699 | 1699 | } |
| 1700 | 1700 | |
| 1701 | 1701 |
| r1591 | r1592 | |
|---|---|---|
| 211 | 211 | |
| 212 | 212 | static TIMER_CALLBACK( rsaga2_interrupt2 ) |
| 213 | 213 | { |
| 214 | cpunum_set_input_line(0,2,HOLD_LINE); | |
| 214 | cpunum_set_input_line(machine, 0,2,HOLD_LINE); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | static INTERRUPT_GEN( rastansaga2_interrupt ) |
| 218 | 218 | { |
| 219 | 219 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, rsaga2_interrupt2); |
| 220 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 220 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
| 224 | 224 | static TIMER_CALLBACK( crimec_interrupt3 ) |
| 225 | 225 | { |
| 226 | cpunum_set_input_line(0,3,HOLD_LINE); | |
| 226 | cpunum_set_input_line(machine, 0,3,HOLD_LINE); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | static INTERRUPT_GEN( crimec_interrupt ) |
| 230 | 230 | { |
| 231 | 231 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, crimec_interrupt3); |
| 232 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 232 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
| 236 | 236 | static TIMER_CALLBACK( hitice_interrupt6 ) |
| 237 | 237 | { |
| 238 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 238 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | static INTERRUPT_GEN( hitice_interrupt ) |
| 242 | 242 | { |
| 243 | 243 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, hitice_interrupt6); |
| 244 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 244 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | |
| 248 | 248 | static TIMER_CALLBACK( rambo3_interrupt1 ) |
| 249 | 249 | { |
| 250 | cpunum_set_input_line(0,1,HOLD_LINE); | |
| 250 | cpunum_set_input_line(machine, 0,1,HOLD_LINE); | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | static INTERRUPT_GEN( rambo3_interrupt ) |
| 254 | 254 | { |
| 255 | 255 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, rambo3_interrupt1); |
| 256 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 256 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| 260 | 260 | static TIMER_CALLBACK( pbobble_interrupt5 ) |
| 261 | 261 | { |
| 262 | cpunum_set_input_line(0,5,HOLD_LINE); | |
| 262 | cpunum_set_input_line(machine, 0,5,HOLD_LINE); | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | static INTERRUPT_GEN( pbobble_interrupt ) |
| 266 | 266 | { |
| 267 | 267 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, pbobble_interrupt5); |
| 268 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 268 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | static TIMER_CALLBACK( viofight_interrupt1 ) |
| 272 | 272 | { |
| 273 | cpunum_set_input_line(0,1,HOLD_LINE); | |
| 273 | cpunum_set_input_line(machine, 0,1,HOLD_LINE); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | static INTERRUPT_GEN( viofight_interrupt ) |
| 277 | 277 | { |
| 278 | 278 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, viofight_interrupt1); |
| 279 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 279 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | static TIMER_CALLBACK( masterw_interrupt4 ) |
| 283 | 283 | { |
| 284 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 284 | cpunum_set_input_line(machine, 0,4,HOLD_LINE); | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | static INTERRUPT_GEN( masterw_interrupt ) |
| 288 | 288 | { |
| 289 | 289 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, masterw_interrupt4); |
| 290 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 290 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static TIMER_CALLBACK( silentd_interrupt4 ) |
| 294 | 294 | { |
| 295 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 295 | cpunum_set_input_line(machine, 0,4,HOLD_LINE); | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | static INTERRUPT_GEN( silentd_interrupt ) |
| 299 | 299 | { |
| 300 | 300 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, silentd_interrupt4); |
| 301 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 301 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | static TIMER_CALLBACK( selfeena_interrupt4 ) |
| 305 | 305 | { |
| 306 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 306 | cpunum_set_input_line(machine, 0,4,HOLD_LINE); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | static INTERRUPT_GEN( selfeena_interrupt ) |
| 310 | 310 | { |
| 311 | 311 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, selfeena_interrupt4); |
| 312 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 312 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static TIMER_CALLBACK( sbm_interrupt5 )//4 |
| 316 | 316 | { |
| 317 | cpunum_set_input_line(0,5,HOLD_LINE); | |
| 317 | cpunum_set_input_line(machine, 0,5,HOLD_LINE); | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | static INTERRUPT_GEN( sbm_interrupt )//5 |
| 321 | 321 | { |
| 322 | 322 | timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, sbm_interrupt5); |
| 323 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 323 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| r1591 | r1592 | |
| 2578 | 2578 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 2579 | 2579 | static void irqhandler(int irq) |
| 2580 | 2580 | { |
| 2581 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2581 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2582 | 2582 | } |
| 2583 | 2583 | |
| 2584 | 2584 | static const struct YM2610interface ym2610_interface_rsaga2 = |
| r1591 | r1592 | |
|---|---|---|
| 25 | 25 | #include "sound/2151intf.h" |
| 26 | 26 | |
| 27 | 27 | |
| 28 | #define MASTER_CLOCK XTAL_18_432MHz | |
| 29 | #define SOUND_CLOCK XTAL_3_579545MHz | |
| 30 | ||
| 31 | ||
| 28 | 32 | extern UINT8 *jackal_videoctrl; |
| 29 | 33 | |
| 30 | 34 | extern MACHINE_RESET( jackal ); |
| r1591 | r1592 | |
| 246 | 250 | static INTERRUPT_GEN( jackal_interrupt ) |
| 247 | 251 | { |
| 248 | 252 | if (irq_enable) |
| 249 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 253 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 250 | 254 | } |
| 251 | 255 | |
| 252 | 256 | /* Machine Driver */ |
| 253 | 257 | |
| 254 | 258 | static MACHINE_DRIVER_START( jackal ) |
| 255 | 259 | // basic machine hardware |
| 256 | MDRV_CPU_ADD(M6809, | |
| 260 | MDRV_CPU_ADD(M6809, M | |
| 257 | 261 | MDRV_CPU_PROGRAM_MAP(master_map, 0) |
| 258 | 262 | MDRV_CPU_VBLANK_INT(jackal_interrupt, 1) |
| 259 | 263 | |
| 260 | MDRV_CPU_ADD(M6809, | |
| 264 | MDRV_CPU_ADD(M6809, M | |
| 261 | 265 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| 262 | 266 | |
| 263 | 267 | MDRV_SCREEN_REFRESH_RATE(60) |
| 264 | 268 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 265 | MDRV_INTERLEAVE(10 | |
| 269 | MDRV_INTERLEAVE(10 | |
| 266 | 270 | |
| 267 | 271 | MDRV_MACHINE_RESET(jackal) |
| 268 | 272 | |
| r1591 | r1592 | |
| 282 | 286 | // sound hardware |
| 283 | 287 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 284 | 288 | |
| 285 | MDRV_SOUND_ADD(YM2151, | |
| 289 | MDRV_SOUND_ADD(YM2151, SOUND_CLOCK | |
| 286 | 290 | MDRV_SOUND_ROUTE(0, "left", 0.50) |
| 287 | 291 | MDRV_SOUND_ROUTE(1, "right", 0.50) |
| 288 | 292 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | void tank8_set_collision(int index) |
| 15 | 15 | { |
| 16 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 16 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 17 | 17 | |
| 18 | 18 | collision_index = index; |
| 19 | 19 | } |
| r1591 | r1592 | |
| 95 | 95 | { |
| 96 | 96 | collision_index &= ~0x3f; |
| 97 | 97 | |
| 98 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 98 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static WRITE8_HANDLER( tank8_crash_w ) |
| r1591 | r1592 | |
|---|---|---|
| 700 | 700 | |
| 701 | 701 | static DRIVER_INIT(vipercf) |
| 702 | 702 | { |
| 703 | | |
| 703 | DRIVER_INIT_CALL(viper | |
| 704 | 704 | |
| 705 | 705 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_r ); |
| 706 | 706 | memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_w ); |
| r1591 | r1592 | |
| 710 | 710 | |
| 711 | 711 | static DRIVER_INIT(ppp2nd) |
| 712 | 712 | { |
| 713 | | |
| 713 | DRIVER_INIT_CALL(viper | |
| 714 | 714 | |
| 715 | 715 | /* |
| 716 | 716 | backup_ram[0x0000] = 0x50; // P |
| r1591 | r1592 | |
|---|---|---|
| 138 | 138 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION) |
| 139 | 139 | MDRV_INTERLEAVE(1) |
| 140 | 140 | |
| 141 | MDRV_CPU_ADD(8085A, 18000000/ | |
| 141 | MDRV_CPU_ADD(8085A, 18000000/3) | |
| 142 | 142 | MDRV_CPU_PROGRAM_MAP(paranoia_8085_map,0) |
| 143 | 143 | MDRV_CPU_IO_MAP(paranoia_8085_io_map,0) |
| 144 | 144 | |
| r1591 | r1592 | |
| 182 | 182 | |
| 183 | 183 | static DRIVER_INIT(paranoia) |
| 184 | 184 | { |
| 185 | | |
| 185 | DRIVER_INIT_CALL(pc | |
| 186 | 186 | }; |
| 187 | 187 | |
| 188 | 188 | GAME( 1990, paranoia, 0, paranoia, paranoia, paranoia, ROT0, "Naxat Soft", "Paranoia", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) |
| r1591 | r1592 | |
|---|---|---|
| 882 | 882 | state_save_register_global(maze_tone_timing_state); |
| 883 | 883 | state_save_register_func_postload(maze_update_discrete); |
| 884 | 884 | |
| 885 | | |
| 885 | MACHINE_START_CALL(mw8080bw | |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | 888 | |
| r1591 | r1592 | |
| 967 | 967 | /* setup for save states */ |
| 968 | 968 | state_save_register_global(rev_shift_res); |
| 969 | 969 | |
| 970 | | |
| 970 | MACHINE_START_CALL(mw8080bw | |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | |
| r1591 | r1592 | |
| 1167 | 1167 | /* setup for save states */ |
| 1168 | 1168 | state_save_register_global(desertgu_controller_select); |
| 1169 | 1169 | |
| 1170 | | |
| 1170 | MACHINE_START_CALL(mw8080bw | |
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | 1173 | |
| r1591 | r1592 | |
| 1493 | 1493 | /* setup for save states */ |
| 1494 | 1494 | state_save_register_global(rev_shift_res); |
| 1495 | 1495 | |
| 1496 | | |
| 1496 | MACHINE_START_CALL(mw8080bw | |
| 1497 | 1497 | } |
| 1498 | 1498 | |
| 1499 | 1499 | |
| r1591 | r1592 | |
| 1585 | 1585 | /* setup for save states */ |
| 1586 | 1586 | state_save_register_global(rev_shift_res); |
| 1587 | 1587 | |
| 1588 | | |
| 1588 | MACHINE_START_CALL(mw8080bw | |
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 1591 | 1591 | |
| r1591 | r1592 | |
| 1682 | 1682 | /* setup for save states */ |
| 1683 | 1683 | state_save_register_global(clowns_controller_select); |
| 1684 | 1684 | |
| 1685 | | |
| 1685 | MACHINE_START_CALL(mw8080bw | |
| 1686 | 1686 | } |
| 1687 | 1687 | |
| 1688 | 1688 | |
| r1591 | r1592 | |
| 2059 | 2059 | state_save_register_global_array(spcenctr_trench_slope); |
| 2060 | 2060 | state_save_register_func_postload(adjust_strobe_timers); |
| 2061 | 2061 | |
| 2062 | | |
| 2062 | MACHINE_START_CALL(mw8080bw | |
| 2063 | 2063 | } |
| 2064 | 2064 | |
| 2065 | 2065 | |
| r1591 | r1592 | |
| 2226 | 2226 | /* setup for save states */ |
| 2227 | 2227 | state_save_register_global(phantom2_cloud_counter); |
| 2228 | 2228 | |
| 2229 | | |
| 2229 | MACHINE_START_CALL(mw8080bw | |
| 2230 | 2230 | } |
| 2231 | 2231 | |
| 2232 | 2232 | |
| r1591 | r1592 | |
| 2463 | 2463 | /* setup for save states */ |
| 2464 | 2464 | state_save_register_global(invaders_flip_screen); |
| 2465 | 2465 | |
| 2466 | | |
| 2466 | MACHINE_START_CALL(mw8080bw | |
| 2467 | 2467 | } |
| 2468 | 2468 | |
| 2469 | 2469 |
| r1591 | r1592 | |
|---|---|---|
| 265 | 265 | |
| 266 | 266 | static WRITE8_HANDLER( int_ack1_w ) |
| 267 | 267 | { |
| 268 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 268 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | static WRITE8_HANDLER( int_ack2_w ) |
| 272 | 272 | { |
| 273 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 273 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| r1591 | r1592 | |
| 1071 | 1071 | MDRV_CPU_PROGRAM_MAP(hopmappy_cpu2_map,0) |
| 1072 | 1072 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| 1073 | 1073 | |
| 1074 | MDRV_CPU_ADD_TAG("mcu", HD63701, 49152000/ | |
| 1074 | MDRV_CPU_ADD_TAG("mcu", HD63701, 49152000/8 | |
| 1075 | 1075 | MDRV_CPU_PROGRAM_MAP(hopmappy_mcu_map,0) |
| 1076 | 1076 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 1077 | 1077 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* ??? */ |
| r1591 | r1592 | |
|---|---|---|
| 811 | 811 | AM_RANGE(0xc002, 0xc002) AM_READ(input_port_2_r ) // DSW 1 |
| 812 | 812 | AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r ) // DSW 2 |
| 813 | 813 | AM_RANGE(0xc080, 0xc080) AM_READ(input_port_4_r ) // vblank? |
| 814 | AM_RANGE(0xc600, 0xc7ff) AM_READ( | |
| 814 | AM_RANGE(0xc600, 0xc7ff) AM_READ(MRA8 | |
| 815 | 815 | AM_RANGE(0xc800, 0xdfff) AM_READ(MRA8_BANK2 ) // RAM (Banked?) |
| 816 | 816 | AM_RANGE(0xe000, 0xffff) AM_READ(suna8_banked_spriteram_r ) // Sprites (Banked) |
| 817 | 817 | ADDRESS_MAP_END |
| r1591 | r1592 | |
| 971 | 971 | AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r ) // DSW 2 |
| 972 | 972 | AM_RANGE(0xc080, 0xc080) AM_READ(input_port_4_r ) // Buttons |
| 973 | 973 | AM_RANGE(0xc0a3, 0xc0a3) AM_READ(sparkman_c0a3_r ) // ??? |
| 974 | AM_RANGE(0xc600, 0xc7ff) AM_READ( | |
| 974 | AM_RANGE(0xc600, 0xc7ff) AM_READ(MRA8 | |
| 975 | 975 | AM_RANGE(0xc800, 0xdfff) AM_READ(MRA8_RAM ) // RAM |
| 976 | 976 | AM_RANGE(0xe000, 0xffff) AM_READ(suna8_banked_spriteram_r ) // Sprites (Banked) |
| 977 | 977 | ADDRESS_MAP_END |
| r1591 | r1592 | |
| 1519 | 1519 | |
| 1520 | 1520 | static void soundirq(int state) |
| 1521 | 1521 | { |
| 1522 | cpunum_set_input_line(1, 0, state); | |
| 1522 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 1523 | 1523 | } |
| 1524 | 1524 | |
| 1525 | 1525 | /* In games with only 2 CPUs, port A&B of the AY8910 are used |
| r1591 | r1592 | |
| 1655 | 1655 | |
| 1656 | 1656 | static INTERRUPT_GEN( brickzn_interrupt ) |
| 1657 | 1657 | { |
| 1658 | if (cpu_getiloops()) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1659 | else cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 1658 | if (cpu_getiloops()) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1659 | else cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 1660 | 1660 | } |
| 1661 | 1661 | |
| 1662 | 1662 | static MACHINE_DRIVER_START( brickzn ) |
| r1591 | r1592 | |
| 1728 | 1728 | { |
| 1729 | 1729 | if (cpu_getiloops()) |
| 1730 | 1730 | { |
| 1731 | if (suna8_nmi_enable) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1731 | if (suna8_nmi_enable) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1732 | 1732 | } |
| 1733 | else cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 1733 | else cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | 1736 | static MACHINE_RESET( hardhea2 ) |
| r1591 | r1592 | |
| 1818 | 1818 | { |
| 1819 | 1819 | if (cpu_getiloops()) |
| 1820 | 1820 | { |
| 1821 | if (suna8_nmi_enable) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1821 | if (suna8_nmi_enable) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1822 | 1822 | } |
| 1823 | else cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 1823 | else cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 1824 | 1824 | } |
| 1825 | 1825 | |
| 1826 | 1826 | static MACHINE_DRIVER_START( sparkman ) |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | /* Force synchronisation between CPUs with fake timer */ |
| 30 | 30 | timer_call_after_resynch(NULL, 0, NULL); |
| 31 | 31 | soundlatch_w(0,data & 0xff); |
| 32 | cpunum_set_input_line(1,0,ASSERT_LINE); | |
| 32 | cpunum_set_input_line(Machine, 1,0,ASSERT_LINE); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static READ16_HANDLER( vaportra_control_r ) |
| r1591 | r1592 | |
| 92 | 92 | |
| 93 | 93 | static READ8_HANDLER( vaportra_soundlatch_r ) |
| 94 | 94 | { |
| 95 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 95 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 96 | 96 | return soundlatch_r(offset); |
| 97 | 97 | } |
| 98 | 98 | |
| r1591 | r1592 | |
| 259 | 259 | |
| 260 | 260 | static void sound_irq(int state) |
| 261 | 261 | { |
| 262 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 262 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 466 | 466 | Interrupts are still used by the game, coin insertion generates an IRQ. |
| 467 | 467 | |
| 468 | 468 | ***************************************************************************/ |
| 469 | static void btime_interrupt(int generated_interrupt, int active_high) | |
| 469 | static void btime_interrupt(running_machine *machine, int generated_interrupt, int active_high) | |
| 470 | 470 | { |
| 471 | 471 | static int coin; |
| 472 | 472 | int port; |
| r1591 | r1592 | |
| 479 | 479 | if (coin == 0) |
| 480 | 480 | { |
| 481 | 481 | coin = 1; |
| 482 | cpunum_set_input_line(0, generated_interrupt, (generated_interrupt == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 482 | cpunum_set_input_line(machine, 0, generated_interrupt, (generated_interrupt == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | else coin = 0; |
| r1591 | r1592 | |
| 487 | 487 | |
| 488 | 488 | static INTERRUPT_GEN( btime_irq_interrupt ) |
| 489 | 489 | { |
| 490 | btime_interrupt(0, 1); | |
| 490 | btime_interrupt(machine, 0, 1); | |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | static INTERRUPT_GEN( zoar_irq_interrupt ) |
| 494 | 494 | { |
| 495 | btime_interrupt(0, 0); | |
| 495 | btime_interrupt(machine, 0, 0); | |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | static INTERRUPT_GEN( btime_nmi_interrupt ) |
| 499 | 499 | { |
| 500 | btime_interrupt(INPUT_LINE_NMI, 0); | |
| 500 | btime_interrupt(machine, INPUT_LINE_NMI, 0); | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | static WRITE8_HANDLER( sound_command_w ) |
| 504 | 504 | { |
| 505 | 505 | soundlatch_w(offset,data); |
| 506 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 506 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | #define COMMON_INPUTS\ |
| r1591 | r1592 | |
|---|---|---|
| 279 | 279 | { |
| 280 | 280 | case 0: |
| 281 | 281 | if (control & 0x0001) |
| 282 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 282 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 283 | 283 | break; |
| 284 | 284 | |
| 285 | 285 | case 1: |
| 286 | 286 | /* trigger V-blank interrupt */ |
| 287 | 287 | if (control & 0x0004) |
| 288 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 288 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 289 | 289 | break; |
| 290 | 290 | } |
| 291 | 291 | } |
| r1591 | r1592 | |
| 295 | 295 | if (control & 0x0008) |
| 296 | 296 | { |
| 297 | 297 | if (state != CLEAR_LINE) |
| 298 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 298 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 299 | 299 | else |
| 300 | cpunum_set_input_line(0, 4, CLEAR_LINE); | |
| 300 | cpunum_set_input_line(Machine, 0, 4, CLEAR_LINE); | |
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | |
| r1591 | r1592 | |
| 306 | 306 | static TIMER_CALLBACK( gp2_timer_callback ) |
| 307 | 307 | { |
| 308 | 308 | if (control & 0x0004) |
| 309 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 309 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | static INTERRUPT_GEN(qdrmfgp2_interrupt) |
| 313 | 313 | { |
| 314 | 314 | /* trigger V-blank interrupt */ |
| 315 | 315 | if (control & 0x0008) |
| 316 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 316 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | static void gp2_ide_interrupt(int state) |
| r1591 | r1592 | |
| 325 | 325 | if (gp2_irq_control) |
| 326 | 326 | gp2_irq_control = 0; |
| 327 | 327 | else |
| 328 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 328 | cpunum_set_input_line(Machine, 0, 5, HOLD_LINE); | |
| 329 | 329 | } else { |
| 330 | cpunum_set_input_line(0, 5, CLEAR_LINE); | |
| 330 | cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE); | |
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | } |
| r1591 | r1592 | |
| 613 | 613 | static void sound_irq(void) |
| 614 | 614 | { |
| 615 | 615 | if (control & 0x0001) |
| 616 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 616 | cpunum_set_input_line(Machine, 0, 1, HOLD_LINE); | |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | static const struct K054539interface k054539_interface = |
| r1591 | r1592 | |
|---|---|---|
| 296 | 296 | /* Strider also has a IRQ4 handler. It is input port related, but the game */ |
| 297 | 297 | /* works without it (maybe it's used to multiplex controls). It is the */ |
| 298 | 298 | /* *only* game to have that. */ |
| 299 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 299 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /******************************************************************** |
| r1591 | r1592 | |
| 315 | 315 | |
| 316 | 316 | INTERRUPT_GEN( cps1_qsound_interrupt ) |
| 317 | 317 | { |
| 318 | cpunum_set_input_line(cpunum, 2, HOLD_LINE); | |
| 318 | cpunum_set_input_line(machine, cpunum, 2, HOLD_LINE); | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| r1591 | r1592 | |
| 3441 | 3441 | |
| 3442 | 3442 | static void cps1_irq_handler_mus(int irq) |
| 3443 | 3443 | { |
| 3444 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 3444 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 3445 | 3445 | } |
| 3446 | 3446 | |
| 3447 | 3447 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 7285 | 7285 | static DRIVER_INIT( wof ) |
| 7286 | 7286 | { |
| 7287 | 7287 | wof_decode(); |
| 7288 | | |
| 7288 | DRIVER_INIT_CALL(cps1 | |
| 7289 | 7289 | } |
| 7290 | 7290 | |
| 7291 | 7291 | static DRIVER_INIT( dino ) |
| 7292 | 7292 | { |
| 7293 | 7293 | dino_decode(); |
| 7294 | | |
| 7294 | DRIVER_INIT_CALL(cps1 | |
| 7295 | 7295 | } |
| 7296 | 7296 | |
| 7297 | 7297 | static DRIVER_INIT( punisher ) |
| 7298 | 7298 | { |
| 7299 | 7299 | punisher_decode(); |
| 7300 | | |
| 7300 | DRIVER_INIT_CALL(cps1 | |
| 7301 | 7301 | } |
| 7302 | 7302 | |
| 7303 | 7303 | static DRIVER_INIT( slammast ) |
| 7304 | 7304 | { |
| 7305 | 7305 | slammast_decode(); |
| 7306 | | |
| 7306 | DRIVER_INIT_CALL(cps1 | |
| 7307 | 7307 | } |
| 7308 | 7308 | |
| 7309 | 7309 | static DRIVER_INIT( pang3 ) |
| r1591 | r1592 | |
| 7327 | 7327 | rom[A/2] = dst; |
| 7328 | 7328 | } |
| 7329 | 7329 | |
| 7330 | | |
| 7330 | DRIVER_INIT_CALL(cps1 | |
| 7331 | 7331 | } |
| 7332 | 7332 | #endif |
| 7333 | 7333 |
| r1591 | r1592 | |
|---|---|---|
| 168 | 168 | if ((data&0xff)!=0x3a) |
| 169 | 169 | { |
| 170 | 170 | soundlatch_w(0,data & 0xff); |
| 171 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 171 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
| r1591 | r1592 | |
| 516 | 516 | |
| 517 | 517 | static void soundirq(int state) |
| 518 | 518 | { |
| 519 | cpunum_set_input_line(1, 0, state); | |
| 519 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | static const struct YM3812interface magicbub_ym3812_intf = |
| r1591 | r1592 | |
|---|---|---|
| 178 | 178 | * |
| 179 | 179 | *************************************/ |
| 180 | 180 | |
| 181 | static | |
| 181 | static MACHINE | |
| 182 | 182 | { |
| 183 | 183 | UINT16 *src; |
| 184 | 184 | int i; |
| r1591 | r1592 | |
| 203 | 203 | memory_set_bank(1, 0); |
| 204 | 204 | |
| 205 | 205 | /* keep the TMS32031 halted until the code is ready to go */ |
| 206 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 206 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 207 | 207 | |
| 208 | 208 | /* Save state support */ |
| 209 | 209 | state_save_register_global(sound_data); |
| r1591 | r1592 | |
| 219 | 219 | |
| 220 | 220 | static MACHINE_RESET( gaelco3d ) |
| 221 | 221 | { |
| 222 | | |
| 222 | MACHINE_RESET | |
| 223 | 223 | tms_offset_xor = 0; |
| 224 | 224 | state_save_register_global(tms_offset_xor); |
| 225 | 225 | } |
| r1591 | r1592 | |
| 227 | 227 | |
| 228 | 228 | static MACHINE_RESET( gaelco3d2 ) |
| 229 | 229 | { |
| 230 | | |
| 230 | MACHINE_RESET | |
| 231 | 231 | tms_offset_xor = BYTE_XOR_BE(0); |
| 232 | 232 | state_save_register_global(tms_offset_xor); |
| 233 | 233 | } |
| r1591 | r1592 | |
| 243 | 243 | static INTERRUPT_GEN( vblank_gen ) |
| 244 | 244 | { |
| 245 | 245 | gaelco3d_render(); |
| 246 | cpunum_set_input_line(0, 2, ASSERT_LINE); | |
| 246 | cpunum_set_input_line(machine, 0, 2, ASSERT_LINE); | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | |
| 250 | 250 | static WRITE16_HANDLER( irq_ack_w ) |
| 251 | 251 | { |
| 252 | cpunum_set_input_line(0, 2, CLEAR_LINE); | |
| 252 | cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE); | |
| 253 | 253 | } |
| 254 | 254 | static WRITE32_HANDLER( irq_ack_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) irq_ack_w(offset, data >> 16, mem_mask >> 16); } |
| 255 | 255 | |
| r1591 | r1592 | |
| 307 | 307 | { |
| 308 | 308 | logerror("delayed_sound_w(%02X)\n", param); |
| 309 | 309 | sound_data = param; |
| 310 | cpunum_set_input_line(2, ADSP2115_IRQ2, ASSERT_LINE); | |
| 310 | cpunum_set_input_line(machine, 2, ADSP2115_IRQ2, ASSERT_LINE); | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | |
| r1591 | r1592 | |
| 323 | 323 | static READ16_HANDLER( sound_data_r ) |
| 324 | 324 | { |
| 325 | 325 | logerror("sound_data_r(%02X)\n", sound_data); |
| 326 | cpunum_set_input_line(2, ADSP2115_IRQ2, CLEAR_LINE); | |
| 326 | cpunum_set_input_line(Machine, 2, ADSP2115_IRQ2, CLEAR_LINE); | |
| 327 | 327 | return sound_data; |
| 328 | 328 | } |
| 329 | 329 | |
| r1591 | r1592 | |
| 426 | 426 | static void iack_w(UINT8 state, offs_t addr) |
| 427 | 427 | { |
| 428 | 428 | logerror("iack_w(%d) - %06X\n", state, addr); |
| 429 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 429 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | |
| r1591 | r1592 | |
| 442 | 442 | /* this is set to 0 while data is uploaded, then set to $ffff after it is done */ |
| 443 | 443 | /* it does not ever appear to be touched after that */ |
| 444 | 444 | logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 445 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE); | |
| 445 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE); | |
| 446 | 446 | } |
| 447 | 447 | static WRITE32_HANDLER( tms_reset_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_reset_w(offset, data, mem_mask); } |
| 448 | 448 | |
| r1591 | r1592 | |
| 453 | 453 | /* done after uploading, and after modifying the comm area */ |
| 454 | 454 | logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 455 | 455 | if (!(mem_mask & 0xff)) |
| 456 | cpunum_set_input_line(1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 456 | cpunum_set_input_line(Machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 457 | 457 | } |
| 458 | 458 | static WRITE32_HANDLER( tms_irq_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_irq_w(offset, data, mem_mask); } |
| 459 | 459 | |
| r1591 | r1592 | |
| 584 | 584 | reg = adsp_ireg_base; |
| 585 | 585 | |
| 586 | 586 | /* generate the (internal, thats why the pulse) irq */ |
| 587 | cpunum_set_input_line(2, ADSP2105_IRQ1, PULSE_LINE); | |
| 587 | cpunum_set_input_line(machine, 2, ADSP2105_IRQ1, PULSE_LINE); | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /* store it */ |
| r1591 | r1592 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | static INTERRUPT_GEN( avalnche_interrupt ) |
| 45 | 45 | { |
| 46 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 46 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 |
| r1591 | r1592 | |
|---|---|---|
| 619 | 619 | |
| 620 | 620 | if( ( SHRAM( 0xbe88 ) & 0x0000ffff ) == 2 ) |
| 621 | 621 | { |
| 622 | cpunum_set_input_line( 0, INPUT_LINE_RESET, PULSE_LINE ); | |
| 622 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE ); | |
| 623 | 623 | memset( namcos11_keycus, 0, namcos11_keycus_size ); |
| 624 | 624 | |
| 625 | 625 | SHRAM( 0xbe88 ) = ( SHRAM( 0xbe88 ) & 0xffff0000 ); |
| r1591 | r1592 | |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | static UINT32 m_n_bankoffset; |
| 641 | static UINT32 m_p_n_bankoffset[ 8 ]; | |
| 642 | 641 | |
| 643 | INLINE void bankswitch_update( int n_bank ) | |
| 644 | { | |
| 645 | verboselog( 1, "bankswitch_update( %d ) = %08x\n", n_bank, m_p_n_bankoffset[ n_bank ] ); | |
| 646 | memory_set_bankptr( 1 + n_bank, memory_region( REGION_USER2 ) + m_p_n_bankoffset[ n_bank ] ); | |
| 647 | } | |
| 648 | ||
| 649 | static void bankswitch_update_all( void ) | |
| 650 | { | |
| 651 | int n_bank; | |
| 652 | ||
| 653 | for( n_bank = 0; n_bank < 8; n_bank++ ) | |
| 654 | { | |
| 655 | bankswitch_update( n_bank ); | |
| 656 | } | |
| 657 | } | |
| 658 | ||
| 659 | 642 | INLINE void bankswitch_rom8( int n_bank, int n_data ) |
| 660 | 643 | { |
| 661 | m_p_n_bankoffset[ n_bank ] = ( ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) ) * 1024 * 1024; | |
| 662 | bankswitch_update( n_bank ); | |
| 644 | memory_set_bank( n_bank + 1, ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) ); | |
| 663 | 645 | } |
| 664 | 646 | |
| 665 | 647 | static WRITE32_HANDLER( bankswitch_rom32_w ) |
| r1591 | r1592 | |
| 693 | 675 | INLINE void bankswitch_rom64( int n_bank, int n_data ) |
| 694 | 676 | { |
| 695 | 677 | /* todo: verify behaviour */ |
| 696 | m_p_n_bankoffset[ n_bank ] = ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ m_n_bankoffset ) * 1024 * 1024; | |
| 697 | bankswitch_update( n_bank ); | |
| 678 | memory_set_bank( n_bank + 1, ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ m_n_bankoffset ) ); | |
| 698 | 679 | } |
| 699 | 680 | |
| 700 | 681 | static WRITE32_HANDLER( bankswitch_rom64_w ) |
| r1591 | r1592 | |
| 752 | 733 | |
| 753 | 734 | static ADDRESS_MAP_START( namcos11_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 754 | 735 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE(1) AM_BASE(&g_p_n_psxram) AM_SIZE(&g_n_psxramsize) /* ram */ |
| 755 | AM_RANGE(0x1f000000, 0x1f0fffff) AM_ROMBANK(1) /* banked roms */ | |
| 756 | AM_RANGE(0x1f100000, 0x1f1fffff) AM_ROMBANK(2) | |
| 757 | AM_RANGE(0x1f200000, 0x1f2fffff) AM_ROMBANK(3) | |
| 758 | AM_RANGE(0x1f300000, 0x1f3fffff) AM_ROMBANK(4) | |
| 759 | AM_RANGE(0x1f400000, 0x1f4fffff) AM_ROMBANK(5) | |
| 760 | AM_RANGE(0x1f500000, 0x1f5fffff) AM_ROMBANK(6) | |
| 761 | AM_RANGE(0x1f600000, 0x1f6fffff) AM_ROMBANK(7) | |
| 762 | AM_RANGE(0x1f700000, 0x1f7fffff) AM_ROMBANK(8) | |
| 763 | 736 | AM_RANGE(0x1f800000, 0x1f8003ff) AM_RAM /* scratchpad */ |
| 764 | 737 | AM_RANGE(0x1f801000, 0x1f801007) AM_WRITENOP |
| 765 | 738 | AM_RANGE(0x1f801008, 0x1f80100b) AM_RAM /* ?? */ |
| r1591 | r1592 | |
| 842 | 815 | } |
| 843 | 816 | if( namcos11_config_table[ n_game ].n_daughterboard != 0 ) |
| 844 | 817 | { |
| 845 | int | |
| 818 | int | |
| 846 | 819 | |
| 847 | m_n_bankoffset = 0; | |
| 848 | for( n_bank = 0; n_bank < 8; n_bank++ ) | |
| 820 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f0fffff, 0, 0, MRA32_BANK1 ); | |
| 821 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f100000, 0x1f1fffff, 0, 0, MRA32_BANK2 ); | |
| 822 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f2fffff, 0, 0, MRA32_BANK3 ); | |
| 823 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f300000, 0x1f3fffff, 0, 0, MRA32_BANK4 ); | |
| 824 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f4fffff, 0, 0, MRA32_BANK5 ); | |
| 825 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f500000, 0x1f5fffff, 0, 0, MRA32_BANK6 ); | |
| 826 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6fffff, 0, 0, MRA32_BANK7 ); | |
| 827 | memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f700000, 0x1f7fffff, 0, 0, MRA32_BANK8 ); | |
| 828 | ||
| 829 | for( bank = 0; bank < 8; bank++ ) | |
| 849 | 830 | { |
| 850 | m_p_n_bankoffset[ n_bank ] = 0; | |
| 831 | memory_configure_bank( bank + 1, 0, memory_region_length( REGION_USER2 ) / ( 1024 * 1024 ), memory_region( REGION_USER2 ), 1024 * 1024 ); | |
| 832 | memory_set_bank( bank + 1, 0 ); | |
| 851 | 833 | } |
| 852 | bankswitch_update_all(); | |
| 853 | 834 | |
| 854 | 835 | if( namcos11_config_table[ n_game ].n_daughterboard == 32 ) |
| 855 | 836 | { |
| r1591 | r1592 | |
| 857 | 838 | } |
| 858 | 839 | if( namcos11_config_table[ n_game ].n_daughterboard == 64 ) |
| 859 | 840 | { |
| 841 | m_n_bankoffset = 0; | |
| 860 | 842 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f080000, 0x1f080003, 0, 0, bankswitch_rom64_upper_w ); |
| 861 | 843 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom64_w ); |
| 862 | 844 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, MRA32_NOP ); |
| 845 | state_save_register_global( m_n_bankoffset ); | |
| 863 | 846 | } |
| 864 | state_save_register_global( m_n_bankoffset ); | |
| 865 | state_save_register_global_array( m_p_n_bankoffset ); | |
| 866 | state_save_register_func_postload( bankswitch_update_all ); | |
| 867 | 847 | } |
| 868 | 848 | else |
| 869 | 849 | { |
| r1591 | r1592 | |
| 889 | 869 | { |
| 890 | 870 | memset( namcos11_keycus, 0, namcos11_keycus_size ); |
| 891 | 871 | psx_machine_init(); |
| 892 | bankswitch_update_all(); | |
| 893 | 872 | } |
| 894 | 873 | |
| 895 | 874 | NAMCO_C7X_HARDWARE |
| r1591 | r1592 | |
| 1338 | 1317 | ROM_LOAD16_BYTE( "gnb3vera.2k", 0x0200000, 0x100000, CRC(e6335e4e) SHA1(9067f05d848c1c8a88967a3c6552d2d24e80672b) ) |
| 1339 | 1318 | ROM_LOAD16_BYTE( "gnb3vera.2f", 0x0200001, 0x100000, CRC(2bb7eb6d) SHA1(d1b1e031a28443140ac8652dfd77a65a042b67fc) ) |
| 1340 | 1319 | |
| 1341 | ROM_REGION32_LE( 0x | |
| 1320 | ROM_REGION32_LE( 0x2000000, REGION_USER2, 0 ) /* main data */ | |
| 1342 | 1321 | ROM_LOAD16_BYTE( "gnb1prg0l.ic2", 0x000000, 0x800000, CRC(78746037) SHA1(d130ca1153a730e3c967945248f00662f9fab304) ) |
| 1343 | 1322 | ROM_LOAD16_BYTE( "gnb1prg0u.ic5", 0x000001, 0x800000, CRC(697d3279) SHA1(40302780f7494d9413888b2d1da38bd14a9a444f) ) |
| 1344 | 1323 |
| r1591 | r1592 | |
|---|---|---|
| 548 | 548 | if (machine->drv->cpu[0].type == CPU_M6809) |
| 549 | 549 | { |
| 550 | 550 | /* just modify lines that have changed */ |
| 551 | if (periodic != -1) cpunum_set_input_line(0, INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE); | |
| 552 | if (tms34061 != -1) cpunum_set_input_line(0, M6809_IRQ_LINE, tms34061 ? ASSERT_LINE : CLEAR_LINE); | |
| 553 | if (blitter != -1) cpunum_set_input_line(0, M6809_FIRQ_LINE, blitter ? ASSERT_LINE : CLEAR_LINE); | |
| 551 | if (periodic != -1) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE); | |
| 552 | if (tms34061 != -1) cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, tms34061 ? ASSERT_LINE : CLEAR_LINE); | |
| 553 | if (blitter != -1) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, blitter ? ASSERT_LINE : CLEAR_LINE); | |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | /* handle the 68000 case */ |
| r1591 | r1592 | |
| 564 | 564 | |
| 565 | 565 | /* update it */ |
| 566 | 566 | if (level) |
| 567 | cpunum_set_input_line(0, level, ASSERT_LINE); | |
| 567 | cpunum_set_input_line(machine, 0, level, ASSERT_LINE); | |
| 568 | 568 | else |
| 569 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 569 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | 572 | |
| r1591 | r1592 | |
| 591 | 591 | static WRITE8_HANDLER( itech8_nmi_ack_w ) |
| 592 | 592 | { |
| 593 | 593 | /* doesn't seem to hold for every game (e.g., hstennis) */ |
| 594 | /* cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);*/ | |
| 594 | /* cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);*/ | |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | |
| 598 | 598 | static void generate_sound_irq(int state) |
| 599 | 599 | { |
| 600 | cpunum_set_input_line(1, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 600 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | |
| r1591 | r1592 | |
| 618 | 618 | |
| 619 | 619 | static MACHINE_START( sstrike ) |
| 620 | 620 | { |
| 621 | | |
| 621 | MACHINE_START_CALL(itech8 | |
| 622 | 622 | |
| 623 | 623 | /* we need to update behind the beam as well */ |
| 624 | 624 | timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 32, behind_the_beam_update); |
| r1591 | r1592 | |
| 779 | 779 | static TIMER_CALLBACK( delayed_sound_data_w ) |
| 780 | 780 | { |
| 781 | 781 | sound_data = param; |
| 782 | cpunum_set_input_line(1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 782 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, ASSERT_LINE); | |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | |
| r1591 | r1592 | |
| 802 | 802 | |
| 803 | 803 | static READ8_HANDLER( sound_data_r ) |
| 804 | 804 | { |
| 805 | cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 805 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 806 | 806 | return sound_data; |
| 807 | 807 | } |
| 808 | 808 | |
| r1591 | r1592 | |
| 817 | 817 | static void via_irq(int state) |
| 818 | 818 | { |
| 819 | 819 | if (state) |
| 820 | cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 820 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 821 | 821 | else |
| 822 | cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 822 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 |
| r1591 | r1592 | |
|---|---|---|
| 390 | 390 | static WRITE8_HANDLER( checkman_sound_command_w ) |
| 391 | 391 | { |
| 392 | 392 | soundlatch_w (0,data); |
| 393 | cpunum_set_input_line (1, INPUT_LINE_NMI, PULSE_LINE); | |
| 393 | cpunum_set_input_line (Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | static READ8_HANDLER( drivfrcg_port0_r ) |
| r1591 | r1592 | |
|---|---|---|
| 99 | 99 | AM_RANGE(0x200000, 0x20000f) AM_READ(calendar_r) |
| 100 | 100 | AM_RANGE(0x300004, 0x300007) AM_READ(othldrby_videoram_r) |
| 101 | 101 | AM_RANGE(0x30000c, 0x30000d) AM_READ(pip) // vblank? |
| 102 | AM_RANGE(0x400000, 0x400fff) AM_READ( | |
| 102 | AM_RANGE(0x400000, 0x400fff) AM_READ(MRA | |
| 103 | 103 | AM_RANGE(0x600000, 0x600001) AM_READ(OKIM6295_status_0_lsb_r) |
| 104 | 104 | AM_RANGE(0x700000, 0x700001) AM_READ(pap) // scanline??? |
| 105 | 105 | AM_RANGE(0x700004, 0x700005) AM_READ(input_port_0_word_r) |
| r1591 | r1592 | |
|---|---|---|
| 268 | 268 | static WRITE16_HANDLER( sound_cpu_w ) |
| 269 | 269 | { |
| 270 | 270 | soundlatch_w(0,data&0xff); |
| 271 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 271 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | static READ16_HANDLER( mechatt_gun_r ) |
| r1591 | r1592 | |
| 639 | 639 | |
| 640 | 640 | static void sound_irq( int irq ) |
| 641 | 641 | { |
| 642 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 642 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | static const struct YM2608interface ym2608_interface = |
| r1591 | r1592 | |
| 673 | 673 | static INTERRUPT_GEN( bbuster ) |
| 674 | 674 | { |
| 675 | 675 | if (cpu_getiloops()==0) |
| 676 | cpunum_set_input_line(0, 6, HOLD_LINE); /* VBL */ | |
| 676 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); /* VBL */ | |
| 677 | 677 | else |
| 678 | cpunum_set_input_line(0, 2, HOLD_LINE); /* at least 6 interrupts per frame to read gun controls */ | |
| 678 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); /* at least 6 interrupts per frame to read gun controls */ | |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | static VIDEO_EOF( bbuster ) |
| r1591 | r1592 | |
|---|---|---|
| 172 | 172 | U17-20 ? YM2610 |
| 173 | 173 | 12 Z80 |
| 174 | 174 | |
| 175 | Frequencies: 68k is XTAL_32MHZ/2 | |
| 176 | z80 is XTAL_20MHz/4 | |
| 175 | 177 | |
| 176 | 178 | ******************************************************************************/ |
| 177 | 179 | |
| r1591 | r1592 | |
| 204 | 206 | { |
| 205 | 207 | pending_command = 1; |
| 206 | 208 | soundlatch_w(offset,data & 0xff); |
| 207 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 209 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 208 | 210 | } |
| 209 | 211 | } |
| 210 | 212 | |
| r1591 | r1592 | |
| 271 | 273 | static void gs_ym2610_irq(int irq) |
| 272 | 274 | { |
| 273 | 275 | if (irq) |
| 274 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 276 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 275 | 277 | else |
| 276 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 278 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 277 | 279 | } |
| 278 | 280 | |
| 279 | 281 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 231 | 231 | static const UINT32 dial_8_gray[8] = { 0x0a,0x08,0x0c,0x04,0x05,0x01,0x03,0x0f }; |
| 232 | 232 | |
| 233 | 233 | // see IRQ notes in drivers\marvins.c |
| 234 | static TIMER_CALLBACK( irq_trigger_callback ) { cpunum_set_input_line(param, 0, HOLD_LINE); } | |
| 234 | static TIMER_CALLBACK( irq_trigger_callback ) { cpunum_set_input_line(machine, param, 0, HOLD_LINE); } | |
| 235 | 235 | |
| 236 | 236 | INTERRUPT_GEN( snk_irq_AB ) |
| 237 | 237 | { |
| 238 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 238 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 239 | 239 | timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 1, irq_trigger_callback); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | INTERRUPT_GEN( snk_irq_BA ) |
| 243 | 243 | { |
| 244 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 244 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 245 | 245 | timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 0, irq_trigger_callback); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // NMI handshakes between CPUs are determined to be much simpler |
| 249 | READ8_HANDLER ( snk_cpuA_nmi_trigger_r ) { cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); return 0; } | |
| 250 | WRITE8_HANDLER( snk_cpuA_nmi_ack_w ) { cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); } | |
| 249 | READ8_HANDLER ( snk_cpuA_nmi_trigger_r ) { cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); return 0; } | |
| 250 | WRITE8_HANDLER( snk_cpuA_nmi_ack_w ) { cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); } | |
| 251 | 251 | |
| 252 | READ8_HANDLER ( snk_cpuB_nmi_trigger_r ) { cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); return 0; } | |
| 253 | WRITE8_HANDLER( snk_cpuB_nmi_ack_w ) { cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); } | |
| 252 | READ8_HANDLER ( snk_cpuB_nmi_trigger_r ) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); return 0; } | |
| 253 | WRITE8_HANDLER( snk_cpuB_nmi_ack_w ) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); } | |
| 254 | 254 | |
| 255 | 255 | /*********************************************************************/ |
| 256 | 256 |
| r1591 | r1592 | |
|---|---|---|
| 96 | 96 | { |
| 97 | 97 | int irq = requested_int & ~*hypr_irq_enable; |
| 98 | 98 | |
| 99 | cpunum_set_input_line(0, 3, (irq & int_num) ? ASSERT_LINE : CLEAR_LINE); | |
| 99 | cpunum_set_input_line(Machine, 0, 3, (irq & int_num) ? ASSERT_LINE : CLEAR_LINE); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | static READ16_HANDLER( hyprduel_irq_cause_r ) |
| r1591 | r1592 | |
| 127 | 127 | { |
| 128 | 128 | if (pc != 0x95f2) |
| 129 | 129 | { |
| 130 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 130 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 131 | 131 | subcpu_resetline = 1; |
| 132 | 132 | } else { |
| 133 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 133 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 134 | 134 | subcpu_resetline = -1; |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | } else { |
| 138 | 138 | if (subcpu_resetline == 1 && (data != 0x0c)) |
| 139 | 139 | { |
| 140 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 140 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 141 | 141 | subcpu_resetline = 0; |
| 142 | 142 | if (pc == 0xbb0 || pc == 0x9d30 || pc == 0xb19c) |
| 143 | 143 | cpu_spinuntil_time(ATTOTIME_IN_USEC(15000)); /* sync semaphore */ |
| 144 | 144 | } |
| 145 | 145 | else if (subcpu_resetline == -1) |
| 146 | 146 | { |
| 147 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 147 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 148 | 148 | subcpu_resetline = 0; |
| 149 | 149 | } |
| 150 | 150 | } |
| r1591 | r1592 | |
| 182 | 182 | static TIMER_CALLBACK( vblank_end_callback ) |
| 183 | 183 | { |
| 184 | 184 | requested_int &= ~param; |
| 185 | cpunum_set_input_line(1, 2, HOLD_LINE); | |
| 185 | cpunum_set_input_line(machine, 1, 2, HOLD_LINE); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | static INTERRUPT_GEN( hyprduel_interrupt ) |
| r1591 | r1592 | |
| 193 | 193 | { |
| 194 | 194 | requested_int |= 0x01; /* vblank */ |
| 195 | 195 | requested_int |= 0x20; |
| 196 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 197 | cpunum_set_input_line(1, 1, HOLD_LINE); | |
| 196 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 197 | cpunum_set_input_line(machine, 1, 1, HOLD_LINE); | |
| 198 | 198 | /* the duration is a guess */ |
| 199 | 199 | timer_set(ATTOTIME_IN_USEC(2500), NULL, 0x20, vblank_end_callback); |
| 200 | 200 | rastersplit = 0; |
| r1591 | r1592 | |
| 209 | 209 | static MACHINE_RESET( hyprduel ) |
| 210 | 210 | { |
| 211 | 211 | /* start with cpu2 halted */ |
| 212 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 212 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 213 | 213 | subcpu_resetline = 1; |
| 214 | 214 | } |
| 215 | 215 | |
| r1591 | r1592 | |
| 692 | 692 | |
| 693 | 693 | static void sound_irq(int state) |
| 694 | 694 | { |
| 695 | cpunum_set_input_line(1, 1, HOLD_LINE); | |
| 695 | cpunum_set_input_line(Machine, 1, 1, HOLD_LINE); | |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | * |
| 82 | 82 | *************************************/ |
| 83 | 83 | |
| 84 | static void update_interrupts( | |
| 84 | static void update_interrupts(running_machine *machine) | |
| 85 | 85 | { |
| 86 | 86 | int newstate = 0; |
| 87 | 87 | |
| r1591 | r1592 | |
| 89 | 89 | newstate = 4; |
| 90 | 90 | |
| 91 | 91 | if (newstate) |
| 92 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 92 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 93 | 93 | else |
| 94 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 94 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 |
| r1591 | r1592 | |
|---|---|---|
| 296 | 296 | { |
| 297 | 297 | int irqlevel = GetCPURegister(0x04)>>4; |
| 298 | 298 | video_screen_update_partial(0, param); |
| 299 | cpunum_set_input_line(0, irqlevel, PULSE_LINE); | |
| 299 | cpunum_set_input_line(machine, 0, irqlevel, PULSE_LINE); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | static TIMER_CALLBACK( namconb2_TriggerPOSIRQ ) |
| 303 | 303 | { |
| 304 | 304 | int irqlevel = GetCPURegister(0x02); |
| 305 | 305 | video_screen_update_partial(0, param); |
| 306 | cpunum_set_input_line(0, irqlevel, PULSE_LINE); | |
| 306 | cpunum_set_input_line(machine, 0, irqlevel, PULSE_LINE); | |
| 307 | 307 | } /* namconb2_TriggerPOSIRQ */ |
| 308 | 308 | |
| 309 | 309 | static INTERRUPT_GEN( namconb2_interrupt ) |
| r1591 | r1592 | |
| 339 | 339 | */ |
| 340 | 340 | int scanline = (paletteram32[0x1808/4]&0xffff)-32; |
| 341 | 341 | int irqlevel = GetCPURegister(0x00); |
| 342 | cpunum_set_input_line( 0, irqlevel, HOLD_LINE); | |
| 342 | cpunum_set_input_line(machine, 0, irqlevel, HOLD_LINE); | |
| 343 | 343 | |
| 344 | 344 | if( scanline<0 ) |
| 345 | 345 | { |
| r1591 | r1592 | |
| 388 | 388 | */ |
| 389 | 389 | int scanline = (paletteram32[0x1808/4]&0xffff)-32; |
| 390 | 390 | int irqlevel = GetCPURegister(0x04)&0xf; |
| 391 | cpunum_set_input_line( 0, irqlevel, HOLD_LINE); | |
| 391 | cpunum_set_input_line(machine, 0, irqlevel, HOLD_LINE); | |
| 392 | 392 | if( scanline<0 ) |
| 393 | 393 | { |
| 394 | 394 | scanline = 0; |
| r1591 | r1592 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | static TIMER_CALLBACK( nmi_callback ) |
| 85 | 85 | { |
| 86 | if (sound_nmi_enable) cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 86 | if (sound_nmi_enable) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 87 | 87 | else pending_nmi = 1; |
| 88 | 88 | } |
| 89 | 89 | |
| r1591 | r1592 | |
| 104 | 104 | sound_nmi_enable = 1; |
| 105 | 105 | if (pending_nmi) |
| 106 | 106 | { |
| 107 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 107 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 108 | 108 | pending_nmi = 0; |
| 109 | 109 | } |
| 110 | 110 | } |
| r1591 | r1592 | |
|---|---|---|
| 106 | 106 | { |
| 107 | 107 | pending_command = 1; |
| 108 | 108 | soundlatch_w(offset,data & 0xff); |
| 109 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 109 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
| r1591 | r1592 | |
| 313 | 313 | |
| 314 | 314 | static void irqhandler(int irq) |
| 315 | 315 | { |
| 316 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 316 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 80 | 80 | int scanline = param; |
| 81 | 81 | |
| 82 | 82 | /* assert/deassert the interrupt */ |
| 83 | cpunum_set_input_line(0, 0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 83 | cpunum_set_input_line(machine, 0, 0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 84 | 84 | |
| 85 | 85 | /* set the next timer */ |
| 86 | 86 | scanline += 32; |
| r1591 | r1592 | |
| 92 | 92 | |
| 93 | 93 | static WRITE8_HANDLER( irq_ack_w ) |
| 94 | 94 | { |
| 95 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 95 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 |
| r1591 | r1592 | |
|---|---|---|
| 191 | 191 | if ((input_port_3_r(0) & 0xc0) != 0xc0) |
| 192 | 192 | panic_sound_output_w(17,1); |
| 193 | 193 | |
| 194 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 194 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 195 | 195 | } |
| 196 | 196 | else |
| 197 | { | |
| 198 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 199 | } | |
| 197 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 200 | 198 | } |
| 201 | 199 | |
| 202 | 200 | static INTERRUPT_GEN( cosmica_interrupt ) |
| r1591 | r1592 | |
| 206 | 204 | if (pixel_clock == 0) |
| 207 | 205 | { |
| 208 | 206 | if (readinputport(3) & 1) /* Left Coin */ |
| 209 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 207 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 210 | 208 | } |
| 211 | 209 | } |
| 212 | 210 | |
| r1591 | r1592 | |
| 220 | 218 | as I have no Cosmic Guerilla console :-) . */ |
| 221 | 219 | |
| 222 | 220 | if ((readinputport(2) & 1)) /* Coin */ |
| 223 | { | |
| 224 | 221 | /* on tms9980, a 6 on the interrupt bus means level 4 interrupt */ |
| 225 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, 6); | |
| 226 | } | |
| 222 | cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 6); | |
| 227 | 223 | else |
| 228 | { | |
| 229 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 230 | } | |
| 224 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 231 | 225 | } |
| 232 | 226 | |
| 233 | 227 | static INTERRUPT_GEN( magspot2_interrupt ) |
| 234 | 228 | { |
| 235 | 229 | /* Coin 1 causes an IRQ, Coin 2 an NMI */ |
| 236 | 230 | if (input_port_4_r(0) & 0x01) |
| 237 | { | |
| 238 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 239 | } | |
| 231 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 240 | 232 | else if (input_port_4_r(0) & 0x02) |
| 241 | { | |
| 242 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 243 | } | |
| 233 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 244 | 234 | } |
| 245 | 235 | |
| 246 | 236 | static INTERRUPT_GEN( nomnlnd_interrupt ) |
| 247 | 237 | { |
| 248 | 238 | /* Coin causes an NMI */ |
| 249 | 239 | if (input_port_4_r(0) & 0x01) |
| 250 | { | |
| 251 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 252 | } | |
| 240 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 253 | 241 | } |
| 254 | 242 | |
| 255 | 243 |
| r1591 | r1592 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | static void msx_vdp_interrupt(int i) |
| 215 | 215 | { |
| 216 | cpunum_set_input_line (0, 0, (i ? HOLD_LINE : CLEAR_LINE)); | |
| 216 | cpunum_set_input_line (Machine, 0, 0, (i ? HOLD_LINE : CLEAR_LINE)); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | static INTERRUPT_GEN( sangho_interrupt ) |
| r1591 | r1592 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | static INTERRUPT_GEN( shaolins_interrupt ) |
| 27 | 27 | { |
| 28 | if (cpu_getiloops() == 0) cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 28 | if (cpu_getiloops() == 0) cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 29 | 29 | else if (cpu_getiloops() % 2) |
| 30 | 30 | { |
| 31 | if (shaolins_nmi_enable & 0x02) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 31 | if (shaolins_nmi_enable & 0x02) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | |
| r1591 | r1592 | |
| 217 | 217 | static MACHINE_DRIVER_START( shaolins ) |
| 218 | 218 | |
| 219 | 219 | /* basic machine hardware */ |
| 220 | MDRV_CPU_ADD(M6809, 12 | |
| 220 | MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) /* verified on pcb */ | |
| 221 | 221 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 222 | 222 | MDRV_CPU_VBLANK_INT(shaolins_interrupt,16) /* 1 IRQ + 8 NMI */ |
| 223 | 223 | |
| r1591 | r1592 | |
| 240 | 240 | /* sound hardware */ |
| 241 | 241 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 242 | 242 | |
| 243 | MDRV_SOUND_ADD(SN76496, 1 | |
| 243 | MDRV_SOUND_ADD(SN76496, XTAL_18_432MHz/12) /* verified on pcb */ | |
| 244 | 244 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 245 | 245 | |
| 246 | MDRV_SOUND_ADD(SN76496, 3 | |
| 246 | MDRV_SOUND_ADD(SN76496, XTAL_18_43 | |
| 247 | 247 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 248 | 248 | MACHINE_DRIVER_END |
| 249 | 249 |
| r1591 | r1592 | |
|---|---|---|
| 239 | 239 | sharc_set_flag_input(1, ASSERT_LINE); |
| 240 | 240 | cpuintrf_pop_context(); |
| 241 | 241 | |
| 242 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 242 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); | |
| 243 | 243 | } |
| 244 | 244 | else |
| 245 | 245 | { |
| r1591 | r1592 | |
| 247 | 247 | sharc_set_flag_input(1, CLEAR_LINE); |
| 248 | 248 | cpuintrf_pop_context(); |
| 249 | 249 | |
| 250 | //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 250 | //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | } |
| r1591 | r1592 | |
| 256 | 256 | |
| 257 | 257 | static NVRAM_HANDLER( model2 ) |
| 258 | 258 | { |
| 259 | | |
| 259 | NVRAM_HANDLER_CALL(93C46 | |
| 260 | 260 | |
| 261 | 261 | if (read_or_write) |
| 262 | 262 | { |
| r1591 | r1592 | |
| 313 | 313 | model2_intreq |= (1<<bit); |
| 314 | 314 | if (model2_intena & (1<<bit)) |
| 315 | 315 | { |
| 316 | cpunum_set_input_line(0, I960_IRQ2, ASSERT_LINE); | |
| 316 | cpunum_set_input_line(Machine, 0, I960_IRQ2, ASSERT_LINE); | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | model2_timervals[tnum] = 0; |
| r1591 | r1592 | |
| 355 | 355 | |
| 356 | 356 | static MACHINE_RESET(model2o) |
| 357 | 357 | { |
| 358 | | |
| 358 | MACHINE_RESET_CALL(model2_common | |
| 359 | 359 | |
| 360 | 360 | // hold TGP in halt until we have code |
| 361 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 361 | cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 362 | 362 | |
| 363 | 363 | dsp_type = DSP_TYPE_TGP; |
| 364 | 364 | } |
| r1591 | r1592 | |
| 374 | 374 | |
| 375 | 375 | static MACHINE_RESET(model2) |
| 376 | 376 | { |
| 377 | machine_reset_model2_common(machine); | |
| 378 | machine_reset_model2_scsp(machine); | |
| 377 | MACHINE_RESET_CALL(model2_common); | |
| 378 | MACHINE_RESET_CALL(model2_scsp); | |
| 379 | 379 | |
| 380 | 380 | // hold TGP in halt until we have code |
| 381 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 381 | cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 382 | 382 | |
| 383 | 383 | dsp_type = DSP_TYPE_TGP; |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | static MACHINE_RESET(model2b) |
| 387 | 387 | { |
| 388 | machine_reset_model2_common(machine); | |
| 389 | machine_reset_model2_scsp(machine); | |
| 388 | MACHINE_RESET_CALL(model2_common); | |
| 389 | MACHINE_RESET_CALL(model2_scsp); | |
| 390 | 390 | |
| 391 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 391 | cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 392 | 392 | |
| 393 | 393 | // set FIFOIN empty flag on SHARC |
| 394 | cpunum_set_input_line(2, SHARC_INPUT_FLAG0, ASSERT_LINE); | |
| 394 | cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG0, ASSERT_LINE); | |
| 395 | 395 | // clear FIFOOUT buffer full flag on SHARC |
| 396 | cpunum_set_input_line(2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 396 | cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE); | |
| 397 | 397 | |
| 398 | 398 | dsp_type = DSP_TYPE_SHARC; |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | static MACHINE_RESET(model2c) |
| 402 | 402 | { |
| 403 | machine_reset_model2_common(machine); | |
| 404 | machine_reset_model2_scsp(machine); | |
| 403 | MACHINE_RESET_CALL(model2_common); | |
| 404 | MACHINE_RESET_CALL(model2_scsp); | |
| 405 | 405 | |
| 406 | 406 | dsp_type = DSP_TYPE_TGPX4; |
| 407 | 407 | } |
| r1591 | r1592 | |
| 529 | 529 | logerror("Boot copro, %d dwords\n", model2_coprocnt); |
| 530 | 530 | if (dsp_type != DSP_TYPE_TGPX4) |
| 531 | 531 | { |
| 532 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 532 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | } |
| r1591 | r1592 | |
| 658 | 658 | else |
| 659 | 659 | { |
| 660 | 660 | logerror("Boot geo, %d dwords\n", model2_geocnt); |
| 661 | cpunum_set_input_line(3, INPUT_LINE_HALT, CLEAR_LINE); | |
| 661 | cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE); | |
| 662 | 662 | //cpu_spinuntil_time(ATTOTIME_IN_USEC(1000)); // Give the SHARC enough time to boot itself |
| 663 | 663 | } |
| 664 | 664 | } |
| r1591 | r1592 | |
| 915 | 915 | |
| 916 | 916 | to_68k = data; |
| 917 | 917 | |
| 918 | cpunum_set_input_line(1, 2, HOLD_LINE); | |
| 918 | cpunum_set_input_line(Machine, 1, 2, HOLD_LINE); | |
| 919 | 919 | |
| 920 | 920 | // give the 68k time to notice |
| 921 | 921 | cpu_spinuntil_time(ATTOTIME_IN_USEC(40)); |
| r1591 | r1592 | |
| 1527 | 1527 | model2_intreq |= (1<<10); |
| 1528 | 1528 | if (model2_intena & (1<<10)) |
| 1529 | 1529 | { |
| 1530 | cpunum_set_input_line(0, I960_IRQ3, ASSERT_LINE); | |
| 1530 | cpunum_set_input_line(machine, 0, I960_IRQ3, ASSERT_LINE); | |
| 1531 | 1531 | } |
| 1532 | 1532 | break; |
| 1533 | 1533 | case 1: |
| 1534 | 1534 | model2_intreq |= (1<<0); |
| 1535 | 1535 | if (model2_intena & (1<<0)) |
| 1536 | 1536 | { |
| 1537 | cpunum_set_input_line(0, I960_IRQ0, ASSERT_LINE); | |
| 1537 | cpunum_set_input_line(machine, 0, I960_IRQ0, ASSERT_LINE); | |
| 1538 | 1538 | } |
| 1539 | 1539 | break; |
| 1540 | 1540 | } |
| r1591 | r1592 | |
| 1547 | 1547 | case 0: |
| 1548 | 1548 | model2_intreq |= (1<<10); |
| 1549 | 1549 | if (model2_intena & (1<<10)) |
| 1550 | cpunum_set_input_line(0, I960_IRQ3, ASSERT_LINE); | |
| 1550 | cpunum_set_input_line(machine, 0, I960_IRQ3, ASSERT_LINE); | |
| 1551 | 1551 | break; |
| 1552 | 1552 | case 1: |
| 1553 | 1553 | model2_intreq |= (1<<2); |
| 1554 | 1554 | if (model2_intena & (1<<2)) |
| 1555 | cpunum_set_input_line(0, I960_IRQ2, ASSERT_LINE); | |
| 1555 | cpunum_set_input_line(machine, 0, I960_IRQ2, ASSERT_LINE); | |
| 1556 | 1556 | |
| 1557 | 1557 | break; |
| 1558 | 1558 | case 2: |
| 1559 | 1559 | model2_intreq |= (1<<0); |
| 1560 | 1560 | if (model2_intena & (1<<0)) |
| 1561 | cpunum_set_input_line(0, I960_IRQ0, ASSERT_LINE); | |
| 1561 | cpunum_set_input_line(machine, 0, I960_IRQ0, ASSERT_LINE); | |
| 1562 | 1562 | break; |
| 1563 | 1563 | } |
| 1564 | 1564 | } |
| r1591 | r1592 | |
| 1691 | 1691 | if (irq > 0) |
| 1692 | 1692 | { |
| 1693 | 1693 | scsp_last_line = irq; |
| 1694 | cpunum_set_input_line(1, irq, PULSE_LINE); | |
| 1694 | cpunum_set_input_line(Machine, 1, irq, PULSE_LINE); | |
| 1695 | 1695 | } |
| 1696 | 1696 | } |
| 1697 | 1697 |
| r1591 | r1592 | |
|---|---|---|
| 486 | 486 | static INTERRUPT_GEN( bmc_interrupt ) |
| 487 | 487 | { |
| 488 | 488 | if (cpu_getiloops()) |
| 489 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 489 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 490 | 490 | else |
| 491 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 491 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | static MACHINE_DRIVER_START( bmcbowl ) |
| r1591 | r1592 | |
|---|---|---|
| 826 | 826 | leland_rotate_memory(1); |
| 827 | 827 | |
| 828 | 828 | /* asylum appears to have some extra RAM for the slave CPU */ |
| 829 | memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, MRA8_RAM); | |
| 830 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, MWA8_RAM); | |
| 829 | memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, MRA8_BANK4, MWA8_BANK4); | |
| 830 | memory_set_bankptr(4, auto_malloc(0x1000)); | |
| 831 | 831 | |
| 832 | 832 | /* set up additional input ports */ |
| 833 | 833 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r); |
| r1591 | r1592 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | if (offset == (0x260 >> 1)) { |
| 84 | 84 | //soundlatch_w(0,data&0xff); |
| 85 | //cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 85 | //cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static WRITE16_HANDLER( sshangha_sound_w ) |
| 90 | 90 | { |
| 91 | 91 | soundlatch_w(0,data&0xff); |
| 92 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 92 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /* Protection/IO chip 146 */ |
| r1591 | r1592 | |
| 328 | 328 | |
| 329 | 329 | static void irqhandler(int state) |
| 330 | 330 | { |
| 331 | cpunum_set_input_line(1,0,state); | |
| 331 | cpunum_set_input_line(Machine, 1,0,state); | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 86 | 86 | static WRITE8_HANDLER( subcpu_reset_w ) |
| 87 | 87 | { |
| 88 | 88 | if (data & 1) |
| 89 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 89 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 90 | 90 | else |
| 91 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 91 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 |
| r1591 | r1592 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | WRITE8_HANDLER( kyugo_sub_cpu_control_w ) |
| 47 | 47 | { |
| 48 | cpunum_set_input_line(1, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE); | |
| 48 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 |
| r1591 | r1592 | |
|---|---|---|
| 248 | 248 | if( ++timer_count >= 64*128 ) { |
| 249 | 249 | timer_count = 0; |
| 250 | 250 | sense_state ^= 1; |
| 251 | cpunum_set_input_line( 0, 1, (sense_state) ? ASSERT_LINE : CLEAR_LINE ); | |
| 251 | cpunum_set_input_line(machine, 0, 1, (sense_state) ? ASSERT_LINE : CLEAR_LINE ); | |
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 |
| r1591 | r1592 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | /* NMIs are enabled by the I register?? How can that be? */ |
| 44 | 44 | if (activecpu_get_reg(Z80_I) & 1) /* skyskipr: 0/1, popeye: 2/3 but also 0/1 */ |
| 45 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 |
| r1591 | r1592 | |
|---|---|---|
| 70 | 70 | if ((input_port_0_r(0) & 0x80) == 0) |
| 71 | 71 | { |
| 72 | 72 | just_been_reset = 1; |
| 73 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 73 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 |
| r1591 | r1592 | |
|---|---|---|
| 195 | 195 | |
| 196 | 196 | static void sound_irq(int linestate) |
| 197 | 197 | { |
| 198 | cpunum_set_input_line(0,0,linestate); | |
| 198 | cpunum_set_input_line(Machine, 0,0,linestate); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 599 | 599 | if(cps1_scanline1 == scancount || (cps1_scanline1 < scancount && !cps1_scancalls)) |
| 600 | 600 | { |
| 601 | 601 | cps1_output[0x50/2] = 0; |
| 602 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 602 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 603 | 603 | cps2_set_sprite_priorities(); |
| 604 | 604 | video_screen_update_partial(0, 16 - 10 + scancount); /* visarea.min_y - [first visible line?] + scancount */ |
| 605 | 605 | cps1_scancalls++; |
| r1591 | r1592 | |
| 610 | 610 | if(cps1_scanline2 == scancount || (cps1_scanline2 < scancount && !cps1_scancalls)) |
| 611 | 611 | { |
| 612 | 612 | cps1_output[0x52/2] = 0; |
| 613 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 613 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 614 | 614 | cps2_set_sprite_priorities(); |
| 615 | 615 | video_screen_update_partial(0, 16 - 10 + scancount); /* visarea.min_y - [first visible line?] + scancount */ |
| 616 | 616 | cps1_scancalls++; |
| r1591 | r1592 | |
| 621 | 621 | { |
| 622 | 622 | cps1_output[0x50/2] = cps1_scanline1; |
| 623 | 623 | cps1_output[0x52/2] = cps1_scanline2; |
| 624 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 624 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 625 | 625 | if(cps1_scancalls) |
| 626 | 626 | { |
| 627 | 627 | cps2_set_sprite_priorities(); |
| r1591 | r1592 | |
| 692 | 692 | /* bit 7 - */ |
| 693 | 693 | |
| 694 | 694 | /* Z80 Reset */ |
| 695 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE); | |
| 695 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE); | |
| 696 | 696 | |
| 697 | 697 | coin_counter_w(0, data & 0x0001); |
| 698 | 698 | if( (strncmp(Machine->gamedrv->name,"pzloop2",8)==0) || |
| r1591 | r1592 | |
| 7189 | 7189 | static DRIVER_INIT( cps2 ) |
| 7190 | 7190 | { |
| 7191 | 7191 | /* Decrypt the game - see machine/cps2crpt.c */ |
| 7192 | | |
| 7192 | DRIVER_INIT_CALL(cps2crpt | |
| 7193 | 7193 | cps2networkpresent = 0; |
| 7194 | 7194 | } |
| 7195 | 7195 | |
| 7196 | 7196 | static DRIVER_INIT( ssf2tb ) |
| 7197 | 7197 | { |
| 7198 | | |
| 7198 | DRIVER_INIT_CALL(cps2 | |
| 7199 | 7199 | cps2networkpresent = 0; |
| 7200 | 7200 | |
| 7201 | 7201 | /* we don't emulate the network board, so don't say it's present for now, otherwise the game will |
| r1591 | r1592 | |
| 7206 | 7206 | |
| 7207 | 7207 | static DRIVER_INIT ( puzloop2 ) |
| 7208 | 7208 | { |
| 7209 | | |
| 7209 | DRIVER_INIT_CALL(cps2 | |
| 7210 | 7210 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, pl2_port_0_word_r); |
| 7211 | 7211 | } |
| 7212 | 7212 |
| r1591 | r1592 | |
|---|---|---|
| 168 | 168 | if (ACCESSING_LSB) soundlatch_w (0, (data >> 0) & 0xff); |
| 169 | 169 | if (ACCESSING_MSB) soundlatch2_w(0, (data >> 8) & 0xff); |
| 170 | 170 | |
| 171 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 171 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | static ADDRESS_MAP_START( lordgun_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 426 | 426 | |
| 427 | 427 | static void soundirq(int state) |
| 428 | 428 | { |
| 429 | cpunum_set_input_line(1, 0, state); | |
| 429 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | static const struct YM3812interface lordgun_ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 74 | 74 | static WRITE16_HANDLER( lemmings_sound_w ) |
| 75 | 75 | { |
| 76 | 76 | soundlatch_w(0,data&0xff); |
| 77 | cpunum_set_input_line(1,1,HOLD_LINE); | |
| 77 | cpunum_set_input_line(Machine, 1,1,HOLD_LINE); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static WRITE8_HANDLER( lemmings_sound_ack_w ) |
| 81 | 81 | { |
| 82 | cpunum_set_input_line(1,1,CLEAR_LINE); | |
| 82 | cpunum_set_input_line(Machine, 1,1,CLEAR_LINE); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /******************************************************************************/ |
| r1591 | r1592 | |
| 261 | 261 | |
| 262 | 262 | static void sound_irq(int state) |
| 263 | 263 | { |
| 264 | cpunum_set_input_line(1,0,state); | |
| 264 | cpunum_set_input_line(Machine, 1,0,state); | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | if (offset==1) |
| 64 | 64 | { |
| 65 | cpunum_set_input_line(2,M68705_IRQ_LINE,HOLD_LINE); | |
| 65 | cpunum_set_input_line(Machine, 2,M68705_IRQ_LINE,HOLD_LINE); | |
| 66 | 66 | cpu_spin(); |
| 67 | 67 | new_latch=0; |
| 68 | 68 | } |
| r1591 | r1592 | |
| 420 | 420 | |
| 421 | 421 | static void irqhandler(int irq) |
| 422 | 422 | { |
| 423 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 423 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 61 | 61 | if (ACCESSING_MSB) |
| 62 | 62 | { |
| 63 | 63 | soundlatch_w(offset,data >> 8); |
| 64 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 64 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 |
| r1591 | r1592 | |
|---|---|---|
| 60 | 60 | WRITE8_HANDLER( zodiac_master_soundlatch_w ) |
| 61 | 61 | { |
| 62 | 62 | soundlatch_w(offset, data); |
| 63 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 63 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 |
| r1591 | r1592 | |
|---|---|---|
| 1569 | 1569 | |
| 1570 | 1570 | static void irqhandler(int linestate) |
| 1571 | 1571 | { |
| 1572 | cpunum_set_input_line(1,0,linestate); | |
| 1572 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 1573 | 1573 | } |
| 1574 | 1574 | |
| 1575 | 1575 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 159 | 159 | { |
| 160 | 160 | /* pressing the service switch sends an NMI */ |
| 161 | 161 | if (newval) |
| 162 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 162 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| r1591 | r1592 | |
| 305 | 305 | static WRITE8_HANDLER( sindbadm_soundport_w ) |
| 306 | 306 | { |
| 307 | 307 | soundlatch_w(0,data); |
| 308 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 308 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 309 | 309 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); |
| 310 | 310 | } |
| 311 | 311 |
| r1591 | r1592 | |
|---|---|---|
| 598 | 598 | static void irqhandler(int irq) |
| 599 | 599 | { |
| 600 | 600 | popmessage("irq"); |
| 601 | // cpunum_set_input_line(2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 601 | // cpunum_set_input_line(Machine, 2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 |
| r1591 | r1592 | |
|---|---|---|
| 735 | 735 | |
| 736 | 736 | static INTERRUPT_GEN( shanghai_interrupt ) |
| 737 | 737 | { |
| 738 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0x80); | |
| 738 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0x80); | |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | 741 | static WRITE16_HANDLER( shanghai_coin_w ) |
| r1591 | r1592 | |
|---|---|---|
| 197 | 197 | switch (cpu_getiloops()) |
| 198 | 198 | { |
| 199 | 199 | case 0: |
| 200 | cpunum_set_input_line(0, MC68000_IRQ_5, HOLD_LINE); | |
| 200 | cpunum_set_input_line(machine, 0, MC68000_IRQ_5, HOLD_LINE); | |
| 201 | 201 | break; |
| 202 | 202 | |
| 203 | 203 | default: |
| 204 | 204 | if (cuebrick_snd_irqlatch) |
| 205 | cpunum_set_input_line(0, MC68000_IRQ_6, HOLD_LINE); | |
| 205 | cpunum_set_input_line(machine, 0, MC68000_IRQ_6, HOLD_LINE); | |
| 206 | 206 | break; |
| 207 | 207 | } |
| 208 | 208 | } |
| r1591 | r1592 | |
| 254 | 254 | K053260_0_w(offset, (data >> 8) & 0xff); |
| 255 | 255 | |
| 256 | 256 | if (offset) |
| 257 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 257 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | static READ16_HANDLER( prmrsocr_sound_r ) |
| r1591 | r1592 | |
| 274 | 274 | |
| 275 | 275 | static WRITE16_HANDLER( prmrsocr_sound_irq_w ) |
| 276 | 276 | { |
| 277 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 277 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | static WRITE8_HANDLER( prmrsocr_audio_bankswitch_w ) |
| r1591 | r1592 | |
| 344 | 344 | |
| 345 | 345 | static void sound_nmi_callback( int param ) |
| 346 | 346 | { |
| 347 | cpunum_set_input_line(1, INPUT_LINE_NMI, ( sound_nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 347 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ( sound_nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 348 | 348 | |
| 349 | 349 | sound_nmi_enabled = 0; |
| 350 | 350 | } |
| r1591 | r1592 | |
| 352 | 352 | |
| 353 | 353 | static TIMER_CALLBACK( nmi_callback ) |
| 354 | 354 | { |
| 355 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 355 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | static WRITE8_HANDLER( sound_arm_nmi_w ) |
| 359 | 359 | { |
| 360 | 360 | // sound_nmi_enabled = 1; |
| 361 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 361 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 362 | 362 | timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback); /* kludge until the K053260 is emulated correctly */ |
| 363 | 363 | } |
| 364 | 364 | |
| r1591 | r1592 | |
| 636 | 636 | |
| 637 | 637 | /* bit 5 triggers IRQ on sound cpu */ |
| 638 | 638 | if (last == 0 && (data & 0x20) != 0) |
| 639 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 639 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 640 | 640 | last = data & 0x20; |
| 641 | 641 | |
| 642 | 642 | /* bit 6 = enable char ROM reading through the video RAM */ |
| r1591 | r1592 | |
| 824 | 824 | static WRITE16_HANDLER( ssriders_soundkludge_w ) |
| 825 | 825 | { |
| 826 | 826 | /* I think this is more than just a trigger */ |
| 827 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 827 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | static ADDRESS_MAP_START( blswhstl_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 2612 | 2612 | |
| 2613 | 2613 | static void sound_nmi(void) |
| 2614 | 2614 | { |
| 2615 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 2615 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 2616 | 2616 | } |
| 2617 | 2617 | |
| 2618 | 2618 | static const struct K054539interface k054539_interface = |
| r1591 | r1592 | |
| 3917 | 3917 | UINT8 *temp; |
| 3918 | 3918 | |
| 3919 | 3919 | |
| 3920 | | |
| 3920 | DRIVER_INIT_CALL(gfx | |
| 3921 | 3921 | |
| 3922 | 3922 | /* |
| 3923 | 3923 | along with the normal byte reordering, TMNT also needs the bits to |
| r1591 | r1592 | |
| 4012 | 4012 | UINT8 *temp; |
| 4013 | 4013 | |
| 4014 | 4014 | |
| 4015 | | |
| 4015 | DRIVER_INIT_CALL(gfx | |
| 4016 | 4016 | |
| 4017 | 4017 | /* |
| 4018 | 4018 | along with the normal byte reordering, TMNT also needs the bits to |
| r1591 | r1592 | |
|---|---|---|
| 163 | 163 | newstate = 5; |
| 164 | 164 | |
| 165 | 165 | if (newstate) |
| 166 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 166 | cpunum_set_input_line(Machine, 0, newstate, ASSERT_LINE); | |
| 167 | 167 | else |
| 168 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 168 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 |
| r1591 | r1592 | |
|---|---|---|
| 979 | 979 | return shared16[BYTE_XOR_LE(offset)]; |
| 980 | 980 | } |
| 981 | 981 | |
| 982 | static UINT32 m_n_bankoffset | |
| 982 | static UINT32 m_n_bankoffset | |
| 983 | 983 | |
| 984 | // called after a state load to properly set things up again | |
| 985 | static void s12_resetbank(void) | |
| 986 | { | |
| 987 | if( strcmp( Machine->gamedrv->name, "golgo13" ) == 0 || | |
| 988 | strcmp( Machine->gamedrv->name, "g13knd" ) == 0 ) | |
| 989 | { | |
| 990 | memory_set_bankptr( 1, memory_region( REGION_USER2 ) + ((m_n_bankoffseth << 23) | (m_n_bankoffset << 21)) ); | |
| 991 | } | |
| 992 | else | |
| 993 | { | |
| 994 | memory_set_bankptr( 1, memory_region( REGION_USER2 ) + ( m_n_bankoffset * 0x200000 ) ); | |
| 995 | } | |
| 996 | } | |
| 997 | ||
| 998 | 984 | static WRITE32_HANDLER( bankoffset_w ) |
| 999 | 985 | { |
| 1000 | 986 | // Golgo 13 has different banking (maybe the keycus controls it?) |
| 1001 | 987 | if( strcmp( Machine->gamedrv->name, "golgo13" ) == 0 || |
| 1002 | 988 | strcmp( Machine->gamedrv->name, "g13knd" ) == 0 ) |
| 1003 | 989 | { |
| 1004 | if (data & 8) | |
| 990 | if( ( data & 8 ) != 0 ) | |
| 1005 | 991 | { |
| 1006 | m_n_bankoffseth = data & 0x6; | |
| 1007 | m_n_bankoffset = 0; | |
| 992 | m_n_bankoffset = ( data & 0x6 ) << 2; | |
| 1008 | 993 | } |
| 1009 | 994 | else |
| 1010 | 995 | { |
| 1011 | m_n_bankoffset = data & 0x7; | |
| 996 | m_n_bankoffset = ( m_n_bankoffset & ~0x7 ) | ( data & 0x7 ); | |
| 1012 | 997 | } |
| 1013 | 998 | } |
| 1014 | 999 | else |
| r1591 | r1592 | |
| 1016 | 1001 | m_n_bankoffset = data; |
| 1017 | 1002 | } |
| 1018 | 1003 | |
| 1019 | | |
| 1004 | m | |
| 1020 | 1005 | |
| 1021 | 1006 | verboselog( 1, "bankoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, m_n_bankoffset ); |
| 1022 | 1007 | } |
| r1591 | r1592 | |
| 1183 | 1168 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, system11gun_r ); |
| 1184 | 1169 | } |
| 1185 | 1170 | |
| 1186 | static MACHINE_START( namcos12 ) | |
| 1187 | { | |
| 1188 | state_save_register_global( m_n_dmaoffset ); | |
| 1189 | state_save_register_global( m_n_dmabias ); | |
| 1190 | state_save_register_global( m_n_bankoffset ); | |
| 1191 | state_save_register_global( m_n_bankoffseth ); | |
| 1192 | state_save_register_func_postload( s12_resetbank ); | |
| 1193 | } | |
| 1194 | ||
| 1195 | 1171 | static UINT8 kcram[ 12 ]; |
| 1196 | 1172 | |
| 1197 | 1173 | static WRITE32_HANDLER( kcoff_w ) |
| r1591 | r1592 | |
| 1404 | 1380 | * |
| 1405 | 1381 | * Note: The H8/3002's ADC is 10 bits wide, but |
| 1406 | 1382 | * it expects the 10-bit value to be left-justified |
| 1407 | * within the 16-bit word. Hence the odd shifting | |
| 1408 | * here. | |
| 1383 | * within the 16-bit word. | |
| 1409 | 1384 | */ |
| 1410 | 1385 | |
| 1411 | 1386 | static READ8_HANDLER( s12_mcu_gun_h_r ) |
| r1591 | r1592 | |
| 1413 | 1388 | int index = port_tag_to_index("IN3"); |
| 1414 | 1389 | if( index != -1 ) |
| 1415 | 1390 | { |
| 1416 | int rv = readinputport( index ); | |
| 1391 | int rv = readinputport( index ) << 6; | |
| 1417 | 1392 | |
| 1418 | 1393 | if( ( offset & 1 ) != 0 ) |
| 1419 | 1394 | { |
| 1420 | return | |
| 1395 | return | |
| 1421 | 1396 | } |
| 1422 | 1397 | |
| 1423 | return | |
| 1398 | return | |
| 1424 | 1399 | } |
| 1425 | 1400 | |
| 1426 | 1401 | // if game has no lightgun ports, return 0 |
| r1591 | r1592 | |
| 1432 | 1407 | int index = port_tag_to_index("IN4"); |
| 1433 | 1408 | if( index != -1 ) |
| 1434 | 1409 | { |
| 1435 | int rv = readinputport( index ); | |
| 1410 | int rv = readinputport( index ) << 6; | |
| 1436 | 1411 | |
| 1437 | 1412 | if( ( offset & 1 ) != 0 ) |
| 1438 | 1413 | { |
| 1439 | return | |
| 1414 | return | |
| 1440 | 1415 | } |
| 1441 | 1416 | |
| 1442 | return | |
| 1417 | return | |
| 1443 | 1418 | } |
| 1444 | 1419 | |
| 1445 | 1420 | // if game has no lightgun ports, return 0 |
| r1591 | r1592 | |
| 1470 | 1445 | psx_dma_install_read_handler( 5, namcos12_rom_read ); |
| 1471 | 1446 | |
| 1472 | 1447 | at28c16_init( 0, NULL, NULL ); |
| 1448 | ||
| 1449 | memory_configure_bank( 1, 0, memory_region_length( REGION_USER2 ) / 0x200000, memory_region( REGION_USER2 ), 0x200000 ); | |
| 1450 | m_n_bankoffset = 0; | |
| 1451 | memory_set_bank( 1, 0 ); | |
| 1452 | ||
| 1453 | state_save_register_global( m_n_dmaoffset ); | |
| 1454 | state_save_register_global( m_n_dmabias ); | |
| 1455 | state_save_register_global( m_n_bankoffset ); | |
| 1473 | 1456 | } |
| 1474 | 1457 | |
| 1475 | 1458 | static DRIVER_INIT( ptblank2 ) |
| 1476 | 1459 | { |
| 1477 | | |
| 1460 | DRIVER_INIT_CALL(namcos12 | |
| 1478 | 1461 | |
| 1479 | 1462 | /* patch out wait for dma 5 to complete */ |
| 1480 | 1463 | *( (UINT32 *)( memory_region( REGION_USER1 ) + 0x331c4 ) ) = 0; |
| r1591 | r1592 | |
| 1484 | 1467 | |
| 1485 | 1468 | static DRIVER_INIT( ghlpanic ) |
| 1486 | 1469 | { |
| 1487 | | |
| 1470 | DRIVER_INIT_CALL(namcos12 | |
| 1488 | 1471 | |
| 1489 | 1472 | system11gun_install(); |
| 1490 | 1473 | } |
| 1491 | 1474 | |
| 1492 | static DRIVER_INIT( golgo13 ) | |
| 1493 | { | |
| 1494 | driver_init_namcos12(machine); | |
| 1495 | } | |
| 1496 | ||
| 1497 | 1475 | static MACHINE_DRIVER_START( coh700 ) |
| 1498 | 1476 | /* basic machine hardware */ |
| 1499 | 1477 | MDRV_CPU_ADD( PSXCPU, XTAL_100MHz ) |
| r1591 | r1592 | |
| 1508 | 1486 | MDRV_SCREEN_REFRESH_RATE( 60 ) |
| 1509 | 1487 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 1510 | 1488 | |
| 1511 | MDRV_MACHINE_START( namcos12 ) | |
| 1512 | 1489 | MDRV_MACHINE_RESET( namcos12 ) |
| 1513 | 1490 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| 1514 | 1491 | |
| r1591 | r1592 | |
| 2390 | 2367 | GAME( 1998, soulclbd, soulclbr, coh700, namcos12, namcos12, ROT0, "Namco", "Soul Calibur (SOC11/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC020 */ |
| 2391 | 2368 | GAME( 1998, ehrgeiz, 0, coh700, namcos12, namcos12, ROT0, "Square/Namco", "Ehrgeiz (EG3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */ |
| 2392 | 2369 | GAME( 1998, ehrgeiza, ehrgeiz, coh700, namcos12, namcos12, ROT0, "Square/Namco", "Ehrgeiz (EG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */ |
| 2393 | GAME( 1999, kaiunqz, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Kaiun Quiz (KW1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC050 */ | |
| 2394 | 2370 | GAME( 1998, mdhorse, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Derby Quiz My Dream Horse (MDH1/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC035 */ |
| 2395 | 2371 | GAME( 1998, sws98, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Super World Stadium '98 (SS81/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC0?? */ |
| 2396 | 2372 | GAME( 1998, tenkomor, 0, coh700, namcos12, namcos12, ROT90, "Namco", "Tenkomori Shooting (TKM2/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC036 */ |
| r1591 | r1592 | |
| 2406 | 2382 | GAME( 1999, ghlpanic, 0, coh700, ghlpanic, ghlpanic, ROT0, "Namco", "Ghoul Panic (OB2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC045 */ |
| 2407 | 2383 | GAME( 1999, pacapp2, 0, coh700, namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion 2 (PKS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC046 */ |
| 2408 | 2384 | GAME( 1999, mrdrillr, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Mr Driller (DRI1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC048 */ |
| 2385 | GAME( 1999, kaiunqz, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Kaiun Quiz (KW1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC050 */ | |
| 2409 | 2386 | GAME( 1999, pacappsp, 0, coh700, namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion Special (PSP1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC052 */ |
| 2410 | 2387 | GAME( 1999, aquarush, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Aqua Rush (AQ1/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC053 */ |
| 2411 | GAME( 1999, golgo13, 0, coh700, golgo13, golgo13, ROT0, "Raizing/Namco", "Golgo 13 (GLG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC054 */ | |
| 2412 | GAME( 1999, g13knd, 0, coh700, golgo13, golgo13, ROT0, "Raizing/Namco", "Golgo 13 Kiseki no Dandou (GLS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC059 */ | |
| 2388 | GAME( 1999, golgo13, 0, coh700, golgo13, namcos12, ROT0, "Raizing/Namco", "Golgo 13 (GLG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC054 */ | |
| 2389 | GAME( 1999, g13knd, 0, coh700, golgo13, namcos12, ROT0, "Raizing/Namco", "Golgo 13 Kiseki no Dandou (GLS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC059 */ | |
| 2413 | 2390 | GAME( 2000, sws2000, 0, coh700, namcos12, namcos12, ROT0, "Namco", "Super World Stadium 2000 (SS01/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC055 */ |
| 2414 | 2391 | GAME( 2001, sws2001, sws2000, coh700, namcos12, namcos12, ROT0, "Namco", "Super World Stadium 2001 (SS11/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC061 */ |
| 2415 |
| r1591 | r1592 | |
|---|---|---|
| 485 | 485 | mainram[0x74c/2] = readinputport(4) | 0xff00; |
| 486 | 486 | mainram[0x74e/2] = 0xffff; |
| 487 | 487 | |
| 488 | cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc0/4); /* VBL */ | |
| 488 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc0/4); /* VBL */ | |
| 489 | 489 | logerror("VSYNC\n"); |
| 490 | 490 | } |
| 491 | 491 | |
| r1591 | r1592 | |
| 2223 | 2223 | |
| 2224 | 2224 | static INTERRUPT_GEN( rdx_v33_interrupt ) |
| 2225 | 2225 | { |
| 2226 | cpunum_set_input_line_and_vector(cpu_getactivecpu(), 0, HOLD_LINE, 0xc0/4); /* VBL */ | |
| 2226 | cpunum_set_input_line_and_vector(machine, cpu_getactivecpu(), 0, HOLD_LINE, 0xc0/4); /* VBL */ | |
| 2227 | 2227 | logerror("VSYNC\n"); |
| 2228 | 2228 | } |
| 2229 | 2229 |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | static MACHINE_RESET( zodiack ) |
| 30 | 30 | { |
| 31 | 31 | percuss_hardware = 0; |
| 32 | | |
| 32 | MACHINE_RESET_CALL(espial | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static MACHINE_RESET( percuss ) |
| 36 | 36 | { |
| 37 | 37 | percuss_hardware = 1; |
| 38 | | |
| 38 | MACHINE_RESET_CALL(espial | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r1591 | r1592 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | - While Atlantis has a cabinet switch, it doesn't use the 2nd player controls |
| 21 | 21 | in cocktail mode. |
| 22 | - DIP locations have been verified from manuals for: | |
| 23 | 800fath | |
| 24 | scramble | |
| 22 | 25 | |
| 23 | 26 | ***************************************************************************/ |
| 24 | 27 | |
| r1591 | r1592 | |
| 641 | 644 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 642 | 645 | |
| 643 | 646 | PORT_START_TAG("IN1") |
| 644 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 647 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") | |
| 645 | 648 | PORT_DIPSETTING( 0x00, "3" ) |
| 646 | 649 | PORT_DIPSETTING( 0x01, "4" ) |
| 647 | 650 | PORT_DIPSETTING( 0x02, "5" ) |
| 648 | PORT_DIPSETTING( 0x03, | |
| 651 | PORT_DIPSETTING( 0x03, DEF_STR( Free_Play ) ) | |
| 649 | 652 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 650 | 653 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 651 | 654 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL |
| r1591 | r1592 | |
| 655 | 658 | |
| 656 | 659 | PORT_START_TAG("IN2") |
| 657 | 660 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL |
| 658 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) | |
| 659 | PORT_DIPSETTING( 0x00, "A 1/1 B 2/1 C 1/1" ) | |
| 660 | PORT_DIPSETTING( 0x02, "A 1/2 B 1/1 C 1/2" ) | |
| 661 | PORT_DIPSETTING( 0x04, "A 1/3 B 3/1 C 1/3" ) | |
| 662 | PORT_DIPSETTING( 0x06, "A 1/4 B 4/1 C 1/4" ) | |
| 663 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) | |
| 661 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:5,4") | |
| 662 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 663 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 664 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) | |
| 665 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) | |
| 666 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3") | |
| 664 | 667 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 665 | 668 | PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) ) |
| 666 | 669 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| r1591 | r1592 | |
| 669 | 672 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* protection bit */ |
| 670 | 673 | INPUT_PORTS_END |
| 671 | 674 | |
| 675 | static INPUT_PORTS_START( 800fath ) | |
| 676 | PORT_START_TAG("IN0") | |
| 677 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL | |
| 678 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 679 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 680 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 681 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 682 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 683 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 684 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 685 | ||
| 686 | PORT_START_TAG("IN1") | |
| 687 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") | |
| 688 | PORT_DIPSETTING( 0x00, "3" ) | |
| 689 | PORT_DIPSETTING( 0x01, "4" ) | |
| 690 | PORT_DIPSETTING( 0x02, "5" ) | |
| 691 | PORT_DIPSETTING( 0x03, DEF_STR( Free_Play ) ) | |
| 692 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 693 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 694 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL | |
| 695 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL | |
| 696 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) | |
| 697 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) | |
| 698 | ||
| 699 | PORT_START_TAG("IN2") | |
| 700 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL | |
| 701 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3") | |
| 702 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 703 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 704 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) | |
| 705 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) | |
| 706 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:4") | |
| 707 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 708 | PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) ) | |
| 709 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 710 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) /* protection bit */ | |
| 711 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 712 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* protection bit */ | |
| 713 | INPUT_PORTS_END | |
| 714 | ||
| 672 | 715 | static INPUT_PORTS_START( explorer ) |
| 673 | 716 | PORT_START_TAG("IN0") |
| 674 | 717 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY |
| r1591 | r1592 | |
| 931 | 974 | PORT_DIPSETTING( 0x03, "2" ) |
| 932 | 975 | PORT_DIPSETTING( 0x02, "3" ) |
| 933 | 976 | PORT_DIPSETTING( 0x01, "4" ) |
| 934 | PORT_DIPSETTING( 0x00, | |
| 977 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) | |
| 935 | 978 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 936 | 979 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 937 | 980 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL |
| r1591 | r1592 | |
| 3323 | 3366 | GAME( 1982, triplep, 0, triplep, triplep, scramble_ppi, ROT90, "KKI", "Triple Punch", GAME_SUPPORTS_SAVE ) |
| 3324 | 3367 | GAME( 1982, knockout, triplep, triplep, triplep, scramble_ppi, ROT90, "KKK", "Knock Out!!", GAME_SUPPORTS_SAVE ) |
| 3325 | 3368 | GAME( 1981, mariner, 0, mariner, scramble, mariner, ROT90, "Amenip", "Mariner", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE) |
| 3326 | GAME( 1981, 800fath, mariner, mariner, | |
| 3369 | GAME( 1981, 800fath, mariner, mariner, 800fath | |
| 3327 | 3370 | GAME( 1981, ckongs, ckong, ckongs, ckongs, ckongs, ROT90, "bootleg", "Crazy Kong (Scramble hardware)", GAME_SUPPORTS_SAVE ) |
| 3328 | 3371 | GAME( 1981, mars, 0, mars, mars, mars, ROT90, "Artic", "Mars", GAME_SUPPORTS_SAVE ) |
| 3329 | 3372 | GAME( 1982, devilfsh, 0, devilfsh, devilfsh, devilfsh, ROT90, "Artic", "Devil Fish", GAME_SUPPORTS_SAVE ) |
| r1591 | r1592 | |
|---|---|---|
| 181 | 181 | sample_buffer >>= 4; |
| 182 | 182 | sample_select ^= 1; |
| 183 | 183 | if(sample_select == 0) |
| 184 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 184 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | static const struct MSM5205interface shdancbl_msm5205_interface = |
| r1591 | r1592 | |
| 195 | 195 | static WRITE16_HANDLER( sound_command_irq_w ){ |
| 196 | 196 | if( ACCESSING_LSB ){ |
| 197 | 197 | soundlatch_w( 0,data&0xff ); |
| 198 | cpunum_set_input_line( 1, 0, HOLD_LINE ); | |
| 198 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| r1591 | r1592 | |
| 339 | 339 | static WRITE16_HANDLER( sound_command_nmi_w ){ |
| 340 | 340 | if( ACCESSING_LSB ){ |
| 341 | 341 | soundlatch_w( 0,data&0xff ); |
| 342 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 342 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | |
| r1591 | r1592 | |
| 776 | 776 | for(i = 0; i < 0xc0000; i++) |
| 777 | 777 | mem[i] ^= 0xFF; |
| 778 | 778 | |
| 779 | | |
| 779 | MACHINE_RESET_CALL(sys16_onetim | |
| 780 | 780 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xffc000, 0xffc001, 0, 0, shdancbl_skip_r ); |
| 781 | 781 | |
| 782 | 782 | sys18_splittab_fg_x=&sys16_textram[0x0f80/2]; |
| r1591 | r1592 | |
| 919 | 919 | 0x1f, 0xA0000 // ROM #4 = 256K |
| 920 | 920 | }; |
| 921 | 921 | |
| 922 | | |
| 922 | MACHINE_RESET_CALL(sys16_onetim | |
| 923 | 923 | sys18_splittab_fg_x=&sys16_textram[0x0f80/2]; |
| 924 | 924 | sys18_splittab_bg_x=&sys16_textram[0x0fc0/2]; |
| 925 | 925 | |
| r1591 | r1592 | |
| 1100 | 1100 | 0x1f, 0xA0000 // ROM #4 = 256K |
| 1101 | 1101 | }; |
| 1102 | 1102 | |
| 1103 | | |
| 1103 | MACHINE_RESET_CALL(sys16_onetim | |
| 1104 | 1104 | sys18_splittab_fg_x=&sys16_textram[0x0f80/2]; |
| 1105 | 1105 | sys18_splittab_bg_x=&sys16_textram[0x0fc0/2]; |
| 1106 | 1106 | sys16_MaxShadowColors = 0; // doesn't seem to use transparent shadows |
| r1591 | r1592 | |
|---|---|---|
| 775 | 775 | { |
| 776 | 776 | if (!first_dsp_reset) |
| 777 | 777 | { |
| 778 | cpunum_set_input_line(3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 778 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 779 | 779 | } |
| 780 | 780 | first_dsp_reset = 0; |
| 781 | 781 | } |
| 782 | 782 | else |
| 783 | 783 | { |
| 784 | cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 784 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 785 | 785 | } |
| 786 | 786 | } |
| 787 | 787 | } |
| r1591 | r1592 | |
| 1254 | 1254 | f3_68681_reset(); |
| 1255 | 1255 | |
| 1256 | 1256 | // hold the TMS in reset until we have code |
| 1257 | cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1257 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | 1260 | static INTERRUPT_GEN( taitojc_vblank ) |
| 1261 | 1261 | { |
| 1262 | cpunum_set_input_line_and_vector(0, 2, HOLD_LINE, 130); | |
| 1262 | cpunum_set_input_line_and_vector(machine, 0, 2, HOLD_LINE, 130); | |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | static INTERRUPT_GEN( taitojc_int6 ) |
| 1266 | 1266 | { |
| 1267 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 1267 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | static MACHINE_DRIVER_START( taitojc ) |
| r1591 | r1592 | |
|---|---|---|
| 346 | 346 | static void irqhandler(int irq) |
| 347 | 347 | { |
| 348 | 348 | logerror("YM3526 firing an IRQ\n"); |
| 349 | // cpunum_set_input_line(2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 349 | // cpunum_set_input_line(Machine, 2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
| 358 | 358 | |
| 359 | 359 | static INTERRUPT_GEN( missb2_interrupt ) |
| 360 | 360 | { |
| 361 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 361 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE); | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /* Machine Driver */ |
| r1591 | r1592 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | static INTERRUPT_GEN( pitnrun_nmi_source ) |
| 103 | 103 | { |
| 104 | if(pitnrun_nmi) cpunum_set_input_line(0,INPUT_LINE_NMI, PULSE_LINE); | |
| 104 | if(pitnrun_nmi) cpunum_set_input_line(machine, 0,INPUT_LINE_NMI, PULSE_LINE); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | static WRITE8_HANDLER( nmi_enable_w ) |
| r1591 | r1592 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | static INTERRUPT_GEN( ddealer_interrupt ) |
| 182 | 182 | { |
| 183 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 183 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | } |
| r1591 | r1592 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "berzerk.h" | |
| 13 | 12 | #include "exidy.h" |
| 14 | 13 | #include "machine/74181.h" |
| 14 | #include "sound/s14001a.h" | |
| 15 | 15 | #include "video/resnet.h" |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | #define MONITOR_TYPE_PORT_TAG ("MONITOR_TYPE") |
| 19 | 19 | |
| 20 | #define MAIN_CPU_CLOCK (BERZERK_MASTER_CLOCK / 4) | |
| 21 | #define PIXEL_CLOCK (BERZERK_MASTER_CLOCK / 2) | |
| 20 | #define MASTER_CLOCK (XTAL_10MHz) | |
| 21 | #define MAIN_CPU_CLOCK (MASTER_CLOCK / 4) | |
| 22 | #define PIXEL_CLOCK (MASTER_CLOCK / 2) | |
| 23 | #define S14001_CLOCK (MASTER_CLOCK / 4) | |
| 22 | 24 | #define HTOTAL (0x140) |
| 23 | 25 | #define HBEND (0x000) |
| 24 | 26 | #define HBSTART (0x100) |
| r1591 | r1592 | |
| 157 | 159 | |
| 158 | 160 | /* set the IRQ line if enabled */ |
| 159 | 161 | if (irq_enabled) |
| 160 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xfc); | |
| 162 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xfc); | |
| 161 | 163 | |
| 162 | 164 | /* set up for next interrupt */ |
| 163 | 165 | next_irq_number = (irq_number + 1) % IRQS_PER_FRAME; |
| r1591 | r1592 | |
| 234 | 236 | |
| 235 | 237 | /* pulse the NMI line if enabled */ |
| 236 | 238 | if (nmi_enabled) |
| 237 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 239 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 238 | 240 | |
| 239 | 241 | /* set up for next interrupt */ |
| 240 | 242 | next_nmi_number = (nmi_number + 1) % NMIS_PER_FRAME; |
| r1591 | r1592 | |
| 459 | 461 | |
| 460 | 462 | /************************************* |
| 461 | 463 | * |
| 464 | * Audio system | |
| 465 | * | |
| 466 | *************************************/ | |
| 467 | ||
| 468 | static const struct S14001A_interface berzerk_s14001a_interface = | |
| 469 | { | |
| 470 | REGION_SOUND1 /* voice data region */ | |
| 471 | }; | |
| 472 | ||
| 473 | ||
| 474 | static const struct CustomSound_interface berzerk_custom_interface = | |
| 475 | { | |
| 476 | exidy_sh6840_sh_start, | |
| 477 | 0, | |
| 478 | exidy_sh6840_sh_reset | |
| 479 | }; | |
| 480 | ||
| 481 | ||
| 482 | static WRITE8_HANDLER( berzerk_audio_w ) | |
| 483 | { | |
| 484 | int clock_divisor; | |
| 485 | ||
| 486 | switch (offset) | |
| 487 | { | |
| 488 | /* offset 4 writes to the S14001A */ | |
| 489 | case 4: | |
| 490 | switch (data >> 6) | |
| 491 | { | |
| 492 | /* write data to the S14001 */ | |
| 493 | case 0: | |
| 494 | /* only if not busy */ | |
| 495 | if (!S14001A_bsy_0_r()) | |
| 496 | { | |
| 497 | S14001A_reg_0_w(data & 0x3f); | |
| 498 | ||
| 499 | /* clock the chip -- via a 555 timer */ | |
| 500 | S14001A_rst_0_w(1); | |
| 501 | S14001A_rst_0_w(0); | |
| 502 | } | |
| 503 | ||
| 504 | break; | |
| 505 | ||
| 506 | case 1: | |
| 507 | /* volume */ | |
| 508 | S14001A_set_volume(((data & 0x38) >> 3) + 1); | |
| 509 | ||
| 510 | /* clock control - the first LS161 divides the clock by 9 to 16, the 2nd by 8, | |
| 511 | giving a final clock from 19.5kHz to 34.7kHz */ | |
| 512 | clock_divisor = 16 - (data & 0x07); | |
| 513 | ||
| 514 | S14001A_set_clock(S14001_CLOCK / clock_divisor / 8); | |
| 515 | break; | |
| 516 | ||
| 517 | default: break; /* 2 and 3 are not connected */ | |
| 518 | } | |
| 519 | ||
| 520 | break; | |
| 521 | ||
| 522 | /* offset 6 writes to the sfxcontrol latch */ | |
| 523 | case 6: | |
| 524 | exidy_sfxctrl_w(data >> 6, data); | |
| 525 | break; | |
| 526 | ||
| 527 | /* everything else writes to the 6840 */ | |
| 528 | default: | |
| 529 | exidy_sh6840_w(offset, data); | |
| 530 | break; | |
| 531 | ||
| 532 | } | |
| 533 | } | |
| 534 | ||
| 535 | ||
| 536 | static READ8_HANDLER( berzerk_audio_r ) | |
| 537 | { | |
| 538 | return ((offset == 4) && !S14001A_bsy_0_r()) ? 0x40 : 0x00; | |
| 539 | } | |
| 540 | ||
| 541 | ||
| 542 | ||
| 543 | static SOUND_RESET(berzerk) | |
| 544 | { | |
| 545 | /* clears the flip-flop controlling the volume and freq on the speech chip */ | |
| 546 | berzerk_audio_w(4, 0x40); | |
| 547 | } | |
| 548 | ||
| 549 | ||
| 550 | ||
| 551 | /************************************* | |
| 552 | * | |
| 462 | 553 | * Memory handlers |
| 463 | 554 | * |
| 464 | 555 | *************************************/ |
| r1591 | r1592 | |
| 789 | 880 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) |
| 790 | 881 | |
| 791 | 882 | /* audio hardware */ |
| 792 | MDRV_ | |
| 883 | MDRV_S | |
| 793 | 884 | |
| 885 | MDRV_SOUND_RESET(berzerk) | |
| 886 | ||
| 887 | MDRV_SOUND_ADD(S14001A, 0) /* placeholder - the clock is software controllable */ | |
| 888 | MDRV_SOUND_CONFIG(berzerk_s14001a_interface) | |
| 889 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 890 | ||
| 891 | MDRV_SOUND_ADD(CUSTOM, 0) | |
| 892 | MDRV_SOUND_CONFIG(berzerk_custom_interface) | |
| 893 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 794 | 894 | MACHINE_DRIVER_END |
| 795 | 895 | |
| 796 | 896 | |
| r1591 | r1592 | |
| 800 | 900 | MDRV_IMPORT_FROM(berzerk) |
| 801 | 901 | MDRV_CPU_MODIFY("main") |
| 802 | 902 | MDRV_CPU_PROGRAM_MAP(frenzy_map,0) |
| 803 | ||
| 804 | 903 | MACHINE_DRIVER_END |
| 805 | 904 | |
| 806 | 905 |
| r1591 | r1592 | |
|---|---|---|
| 119 | 119 | static WRITE8_HANDLER( sub_cpu_halt_w ) |
| 120 | 120 | { |
| 121 | 121 | if (data) |
| 122 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 122 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 123 | 123 | else |
| 124 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 124 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| r1591 | r1592 | |
| 165 | 165 | static WRITE8_HANDLER( sound_command_w ) |
| 166 | 166 | { |
| 167 | 167 | soundlatch_w(offset,data); |
| 168 | cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 168 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static TIMER_CALLBACK( reset_callback ) |
| 172 | 172 | { |
| 173 | cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE); | |
| 173 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, PULSE_LINE); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static WRITE8_HANDLER( sound_answer_w ) |
| r1591 | r1592 | |
|---|---|---|
| 135 | 135 | static INTERRUPT_GEN( bionicc_interrupt ) |
| 136 | 136 | { |
| 137 | 137 | if (cpu_getiloops() == 0) |
| 138 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 138 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 139 | 139 | else |
| 140 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 140 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
|---|---|---|
| 103 | 103 | static INTERRUPT_GEN( main_nmi_gen ) |
| 104 | 104 | { |
| 105 | 105 | if (nmi_enable) |
| 106 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 106 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| r1591 | r1592 | |
| 117 | 117 | static TIMER_CALLBACK( delayed_sound_w ) |
| 118 | 118 | { |
| 119 | 119 | sound_data = param; |
| 120 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 120 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
| r1591 | r1592 | |
| 135 | 135 | |
| 136 | 136 | static WRITE8_HANDLER( sound_irq_ack_w ) |
| 137 | 137 | { |
| 138 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 138 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 |
| r1591 | r1592 | |
|---|---|---|
| 33 | 33 | static INTERRUPT_GEN( spy_interrupt ) |
| 34 | 34 | { |
| 35 | 35 | if (K052109_is_IRQ_enabled()) |
| 36 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 36 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| r1591 | r1592 | |
| 44 | 44 | { |
| 45 | 45 | if (rambank & 1) |
| 46 | 46 | { |
| 47 | return paletteram | |
| 47 | return paletteram[ | |
| 48 | 48 | } |
| 49 | 49 | else if (rambank & 2) |
| 50 | 50 | { |
| r1591 | r1592 | |
| 323 | 323 | */ |
| 324 | 324 | spy_collision(); |
| 325 | 325 | //ZT |
| 326 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 326 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | old = data; |
| r1591 | r1592 | |
| 332 | 332 | |
| 333 | 333 | static WRITE8_HANDLER( spy_sh_irqtrigger_w ) |
| 334 | 334 | { |
| 335 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 335 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | static WRITE8_HANDLER( sound_bank_w ) |
| r1591 | r1592 | |
| 522 | 522 | |
| 523 | 523 | static void irqhandler(int linestate) |
| 524 | 524 | { |
| 525 | cpunum_set_input_line(1, INPUT_LINE_NMI, linestate); | |
| 525 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, linestate); | |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 164 | 164 | static TIMER_CALLBACK( psikyo_soundlatch_callback ) |
| 165 | 165 | { |
| 166 | 166 | psikyo_soundlatch = param; |
| 167 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 167 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 168 | 168 | z80_nmi = 1; |
| 169 | 169 | } |
| 170 | 170 | |
| r1591 | r1592 | |
| 370 | 370 | |
| 371 | 371 | static void sound_irq( int irq ) |
| 372 | 372 | { |
| 373 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 373 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | static READ8_HANDLER( psikyo_soundlatch_r ) |
| r1591 | r1592 | |
| 380 | 380 | |
| 381 | 381 | static WRITE8_HANDLER( psikyo_clear_nmi_w ) |
| 382 | 382 | { |
| 383 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 383 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 384 | 384 | z80_nmi = 0; |
| 385 | 385 | } |
| 386 | 386 | |
| r1591 | r1592 | |
| 1664 | 1664 | static void irqhandler(int linestate) |
| 1665 | 1665 | { |
| 1666 | 1666 | if (linestate) |
| 1667 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 1667 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 1668 | 1668 | else |
| 1669 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 1669 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 1670 | 1670 | } |
| 1671 | 1671 | |
| 1672 | 1672 | static const struct YMF278B_interface ymf278b_interface = |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | static WRITE8_HANDLER( snd_irq_w ) |
| 54 | 54 | { |
| 55 | 55 | if(data == 1) |
| 56 | cpunum_set_input_line_and_vector(1, 0, ASSERT_LINE, 0x38); | |
| 56 | cpunum_set_input_line_and_vector(Machine, 1, 0, ASSERT_LINE, 0x38); | |
| 57 | 57 | else |
| 58 | cpunum_set_input_line_and_vector(1, 0, CLEAR_LINE, 0x38); | |
| 58 | cpunum_set_input_line_and_vector(Machine, 1, 0, CLEAR_LINE, 0x38); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 70 | 70 | if (ACCESSING_LSB) |
| 71 | 71 | { |
| 72 | 72 | soundlatch_w(0,data & 0xff); |
| 73 | cpunum_set_input_line(1,0,ASSERT_LINE); // Generate an IRQ | |
| 73 | cpunum_set_input_line(Machine, 1,0,ASSERT_LINE); // Generate an IRQ | |
| 74 | 74 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other CPU to reply |
| 75 | 75 | } |
| 76 | 76 | } |
| r1591 | r1592 | |
| 285 | 285 | static READ8_HANDLER( esd16_sound_command_r ) |
| 286 | 286 | { |
| 287 | 287 | /* Clear IRQ only after reading the command, or some get lost */ |
| 288 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 288 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 289 | 289 | return soundlatch_r(0); |
| 290 | 290 | } |
| 291 | 291 |
| r1591 | r1592 | |
|---|---|---|
| 789 | 789 | static void scsi_irq_callback(void) |
| 790 | 790 | { |
| 791 | 791 | model3_irq_state |= model3_irq_enable & ~0x60; /* FIXME: enable only SCSI interrupt */ |
| 792 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 792 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | /*****************************************************************************/ |
| r1591 | r1592 | |
| 951 | 951 | { |
| 952 | 952 | eeprom_handler(file, read_or_write); |
| 953 | 953 | } else { |
| 954 | | |
| 954 | NVRAM_HANDLER_CALL(93C46 | |
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | if (read_or_write) |
| r1591 | r1592 | |
| 4014 | 4014 | if (irq > 0) |
| 4015 | 4015 | { |
| 4016 | 4016 | scsp_last_line = irq; |
| 4017 | cpunum_set_input_line(1, irq, PULSE_LINE); | |
| 4017 | cpunum_set_input_line(Machine, 1, irq, PULSE_LINE); | |
| 4018 | 4018 | } |
| 4019 | 4019 | } |
| 4020 | 4020 | |
| r1591 | r1592 | |
| 4051 | 4051 | } else { |
| 4052 | 4052 | model3_irq_state = 0x0d; |
| 4053 | 4053 | } |
| 4054 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 4054 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 4055 | 4055 | |
| 4056 | 4056 | model3_vblank++; |
| 4057 | 4057 | model3_vblank &= 1; |
| r1591 | r1592 | |
| 4298 | 4298 | { |
| 4299 | 4299 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4300 | 4300 | |
| 4301 | | |
| 4301 | DRIVER_INIT_CALL(model3_15 | |
| 4302 | 4302 | /* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */ |
| 4303 | 4303 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r ); |
| 4304 | 4304 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w ); |
| r1591 | r1592 | |
| 4310 | 4310 | { |
| 4311 | 4311 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4312 | 4312 | |
| 4313 | | |
| 4313 | DRIVER_INIT_CALL(model3_15 | |
| 4314 | 4314 | /* TODO: network device at 0xC0000000 - FF */ |
| 4315 | 4315 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r ); |
| 4316 | 4316 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w ); |
| r1591 | r1592 | |
| 4323 | 4323 | { |
| 4324 | 4324 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4325 | 4325 | |
| 4326 | | |
| 4326 | DRIVER_INIT_CALL(model3_15 | |
| 4327 | 4327 | /* TODO: network device at 0xC0000000 - FF */ |
| 4328 | 4328 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r ); |
| 4329 | 4329 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w ); |
| r1591 | r1592 | |
| 4340 | 4340 | static DRIVER_INIT( lemans24 ) |
| 4341 | 4341 | { |
| 4342 | 4342 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4343 | | |
| 4343 | DRIVER_INIT_CALL(model3_15 | |
| 4344 | 4344 | |
| 4345 | 4345 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r ); |
| 4346 | 4346 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w ); |
| r1591 | r1592 | |
| 4356 | 4356 | { |
| 4357 | 4357 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4358 | 4358 | |
| 4359 | | |
| 4359 | DRIVER_INIT_CALL(model3_10 | |
| 4360 | 4360 | |
| 4361 | 4361 | rom[(0x713c7c^4)/4] = 0x60000000; |
| 4362 | 4362 | rom[(0x713e54^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4461 | 4461 | { |
| 4462 | 4462 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4463 | 4463 | |
| 4464 | | |
| 4464 | DRIVER_INIT_CALL(model3_20 | |
| 4465 | 4465 | |
| 4466 | 4466 | rom[(0x705884^4)/4] = 0x60000000; |
| 4467 | 4467 | rom[(0x7058a4^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4471 | 4471 | { |
| 4472 | 4472 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4473 | 4473 | |
| 4474 | | |
| 4474 | DRIVER_INIT_CALL(model3_20 | |
| 4475 | 4475 | |
| 4476 | 4476 | rom[(0x603868^4)/4] = 0x60000000; |
| 4477 | 4477 | rom[(0x603888^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4482 | 4482 | { |
| 4483 | 4483 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4484 | 4484 | |
| 4485 | | |
| 4485 | DRIVER_INIT_CALL(model3_20 | |
| 4486 | 4486 | |
| 4487 | 4487 | rom[(0x603868^4)/4] = 0x60000000; |
| 4488 | 4488 | rom[(0x603888^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4492 | 4492 | { |
| 4493 | 4493 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4494 | 4494 | |
| 4495 | | |
| 4495 | DRIVER_INIT_CALL(model3_20 | |
| 4496 | 4496 | |
| 4497 | 4497 | rom[(0x603868^4)/4] = 0x60000000; |
| 4498 | 4498 | rom[(0x603888^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4501 | 4501 | static DRIVER_INIT( harley ) |
| 4502 | 4502 | { |
| 4503 | 4503 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4504 | | |
| 4504 | DRIVER_INIT_CALL(model3_20 | |
| 4505 | 4505 | |
| 4506 | 4506 | memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_r ); |
| 4507 | 4507 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_w ); |
| r1591 | r1592 | |
| 4516 | 4516 | static DRIVER_INIT( srally2 ) |
| 4517 | 4517 | { |
| 4518 | 4518 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4519 | | |
| 4519 | DRIVER_INIT_CALL(model3_20 | |
| 4520 | 4520 | |
| 4521 | 4521 | rom[(0x7c0c4^4)/4] = 0x60000000; |
| 4522 | 4522 | rom[(0x7c0c8^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4526 | 4526 | static DRIVER_INIT( swtrilgy ) |
| 4527 | 4527 | { |
| 4528 | 4528 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4529 | | |
| 4529 | DRIVER_INIT_CALL(model3_20 | |
| 4530 | 4530 | |
| 4531 | 4531 | rom[(0xf0e48^4)/4] = 0x60000000; |
| 4532 | 4532 | rom[(0x043dc^4)/4] = 0x48000090; |
| r1591 | r1592 | |
| 4537 | 4537 | static DRIVER_INIT( swtrilga ) |
| 4538 | 4538 | { |
| 4539 | 4539 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4540 | | |
| 4540 | DRIVER_INIT_CALL(model3_20 | |
| 4541 | 4541 | |
| 4542 | 4542 | rom[(0xf6dd0^4)/4] = 0x60000000; |
| 4543 | 4543 | } |
| r1591 | r1592 | |
| 4545 | 4545 | static DRIVER_INIT( von2 ) |
| 4546 | 4546 | { |
| 4547 | 4547 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4548 | | |
| 4548 | DRIVER_INIT_CALL(model3_20 | |
| 4549 | 4549 | |
| 4550 | 4550 | rom[(0x189168^4)/4] = 0x60000000; |
| 4551 | 4551 | rom[(0x1890ac^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4557 | 4557 | static DRIVER_INIT( dirtdvls ) |
| 4558 | 4558 | { |
| 4559 | 4559 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4560 | | |
| 4560 | DRIVER_INIT_CALL(model3_20 | |
| 4561 | 4561 | |
| 4562 | 4562 | rom[(0x0600a0^4)/4] = 0x60000000; |
| 4563 | 4563 | rom[(0x0608a4^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4570 | 4570 | static DRIVER_INIT( daytona2 ) |
| 4571 | 4571 | { |
| 4572 | 4572 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4573 | | |
| 4573 | DRIVER_INIT_CALL(model3_20 | |
| 4574 | 4574 | |
| 4575 | 4575 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w ); |
| 4576 | 4576 | |
| r1591 | r1592 | |
| 4583 | 4583 | static DRIVER_INIT( dayto2pe ) |
| 4584 | 4584 | { |
| 4585 | 4585 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4586 | | |
| 4586 | DRIVER_INIT_CALL(model3_20 | |
| 4587 | 4587 | |
| 4588 | 4588 | memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w ); |
| 4589 | 4589 | |
| r1591 | r1592 | |
| 4597 | 4597 | static DRIVER_INIT( spikeout ) |
| 4598 | 4598 | { |
| 4599 | 4599 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4600 | | |
| 4600 | DRIVER_INIT_CALL(model3_20 | |
| 4601 | 4601 | |
| 4602 | 4602 | rom[(0x6059cc^4)/4] = 0x60000000; |
| 4603 | 4603 | rom[(0x6059ec^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4606 | 4606 | static DRIVER_INIT( spikeofe ) |
| 4607 | 4607 | { |
| 4608 | 4608 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4609 | | |
| 4609 | DRIVER_INIT_CALL(model3_20 | |
| 4610 | 4610 | |
| 4611 | 4611 | rom[(0x6059cc^4)/4] = 0x60000000; |
| 4612 | 4612 | rom[(0x6059ec^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4615 | 4615 | static DRIVER_INIT( eca ) |
| 4616 | 4616 | { |
| 4617 | 4617 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4618 | | |
| 4618 | DRIVER_INIT_CALL(model3_20 | |
| 4619 | 4619 | |
| 4620 | 4620 | rom[(0x535580^4)/4] = 0x60000000; |
| 4621 | 4621 | rom[(0x5023b4^4)/4] = 0x60000000; |
| r1591 | r1592 | |
| 4625 | 4625 | static DRIVER_INIT( skichamp ) |
| 4626 | 4626 | { |
| 4627 | 4627 | UINT32 *rom = (UINT32*)memory_region(REGION_USER1); |
| 4628 | | |
| 4628 | DRIVER_INIT_CALL(model3_20 | |
| 4629 | 4629 | |
| 4630 | 4630 | rom[(0x5263c8^4)/4] = 0x60000000; |
| 4631 | 4631 | rom[(0x5263e8^4)/4] = 0x60000000; |
| r1591 | r1592 | |
|---|---|---|
| 534 | 534 | mpDspState->slaveOutputSize = 0; |
| 535 | 535 | mpDspState->masterFinished = 0; |
| 536 | 536 | mpDspState->slaveActive = 0; |
| 537 | cpunum_set_input_line(4, 0, HOLD_LINE); /* DSP: master */ | |
| 538 | cpunum_set_input_line(5, INPUT_LINE_RESET, PULSE_LINE); /* DSP: slave */ | |
| 537 | cpunum_set_input_line(Machine, 4, 0, HOLD_LINE); /* DSP: master */ | |
| 538 | cpunum_set_input_line(Machine, 5, INPUT_LINE_RESET, PULSE_LINE); /* DSP: slave */ | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | static UINT16 |
| r1591 | r1592 | |
| 1243 | 1243 | if( data ) |
| 1244 | 1244 | { |
| 1245 | 1245 | winrun_flushpoly(); |
| 1246 | cpunum_set_input_line(4, INPUT_LINE_RESET, PULSE_LINE); | |
| 1246 | cpunum_set_input_line(Machine, 4, INPUT_LINE_RESET, PULSE_LINE); | |
| 1247 | 1247 | namcos21_ClearPolyFrameBuffer(); |
| 1248 | 1248 | } |
| 1249 | 1249 | } |
| r1591 | r1592 | |
|---|---|---|
| 331 | 331 | #ifdef PGMARM7SPEEDHACK |
| 332 | 332 | static TIMER_CALLBACK( arm_irq ) |
| 333 | 333 | { |
| 334 | cpunum_set_input_line(2, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 334 | cpunum_set_input_line(machine, 2, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 335 | 335 | } |
| 336 | 336 | #endif |
| 337 | 337 | |
| r1591 | r1592 | |
| 344 | 344 | #ifdef PGMARM7SPEEDHACK |
| 345 | 345 | // cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 346 | 346 | if (data!=0xaa) cpu_spinuntil_trigger(1000); |
| 347 | cpu_trigger(1002); | |
| 347 | cpu_trigger(Machine, 1002); | |
| 348 | 348 | #else |
| 349 | 349 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 350 | 350 | cpu_spinuntil_time(ATTOTIME_IN_CYCLES(100, 0)); |
| r1591 | r1592 | |
| 375 | 375 | COMBINE_DATA(&arm7_latch); |
| 376 | 376 | |
| 377 | 377 | #ifdef PGMARM7SPEEDHACK |
| 378 | cpu_trigger(1000); | |
| 378 | cpu_trigger(Machine, 1000); | |
| 379 | 379 | timer_set(ATTOTIME_IN_USEC(50), NULL, 0, arm_irq); // i don't know how long.. |
| 380 | 380 | cpu_spinuntil_trigger(1002); |
| 381 | 381 | #else |
| 382 | cpunum_set_input_line(2, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 382 | cpunum_set_input_line(Machine, 2, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 383 | 383 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(200)); |
| 384 | 384 | cpu_spinuntil_time(ATTOTIME_IN_CYCLES(200, 2)); // give the arm time to respond (just boosting the interleave doesn't help |
| 385 | 385 | #endif |
| r1591 | r1592 | |
| 418 | 418 | |
| 419 | 419 | if(data == 0x5050) { |
| 420 | 420 | sndti_reset(SOUND_ICS2115, 0); |
| 421 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 422 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 421 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 422 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 423 | 423 | if(0) { |
| 424 | 424 | FILE *out; |
| 425 | 425 | out = fopen("z80ram.bin", "wb"); |
| r1591 | r1592 | |
| 431 | 431 | { |
| 432 | 432 | /* this might not be 100% correct, but several of the games (ddp2, puzzli2 etc. expect the z80 to be turned |
| 433 | 433 | off during data uploads, they write here before the upload */ |
| 434 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 434 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | |
| r1591 | r1592 | |
| 445 | 445 | if(ACCESSING_LSB) { |
| 446 | 446 | if (PGMLOGERROR) logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, activecpu_get_pc()); |
| 447 | 447 | soundlatch_w(0, data); |
| 448 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 448 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
| r1591 | r1592 | |
| 457 | 457 | |
| 458 | 458 | static void sound_irq(int level) |
| 459 | 459 | { |
| 460 | cpunum_set_input_line(1, 0, level); | |
| 460 | cpunum_set_input_line(Machine, 1, 0, level); | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | static const struct ics2115_interface pgm_ics2115_interface = { |
| r1591 | r1592 | |
| 1528 | 1528 | is the source? maybe the protection device? */ |
| 1529 | 1529 | static INTERRUPT_GEN( drgw_interrupt ) { |
| 1530 | 1530 | if( cpu_getiloops() == 0 ) |
| 1531 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 1531 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 1532 | 1532 | else |
| 1533 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1533 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1534 | 1534 | } |
| 1535 | 1535 | |
| 1536 | 1536 | static MACHINE_RESET ( pgm ) |
| 1537 | 1537 | { |
| 1538 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1538 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1539 | 1539 | } |
| 1540 | 1540 | |
| 1541 | 1541 | static MACHINE_DRIVER_START( pgm ) |
| r1591 | r1592 | |
| 2057 | 2057 | { |
| 2058 | 2058 | int i; |
| 2059 | 2059 | |
| 2060 | | |
| 2060 | MACHINE_RESET_CALL(pgm | |
| 2061 | 2061 | |
| 2062 | 2062 | /* fill the protection ram with a5 */ |
| 2063 | 2063 | for (i = 0;i < 0x4000/2;i++) |
| r1591 | r1592 | |
| 2198 | 2198 | // UINT16 *mem16_a = (UINT16 *)memory_region(REGION_CPU1); |
| 2199 | 2199 | int i; |
| 2200 | 2200 | |
| 2201 | | |
| 2201 | MACHINE_RESET_CALL(pgm | |
| 2202 | 2202 | |
| 2203 | 2203 | /* populate shared protection ram with data read from pcb .. */ |
| 2204 | 2204 |
| r1591 | r1592 | |
|---|---|---|
| 75 | 75 | static INTERRUPT_GEN( iqblock_interrupt ) |
| 76 | 76 | { |
| 77 | 77 | if (cpu_getiloops() & 1) |
| 78 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); /* ???? */ | |
| 78 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* ???? */ | |
| 79 | 79 | else |
| 80 | cpunum_set_input_line(0, 0, ASSERT_LINE); /* ???? */ | |
| 80 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); /* ???? */ | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | static WRITE8_HANDLER( iqblock_irqack_w ) |
| 84 | 84 | { |
| 85 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 85 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static READ8_HANDLER( iqblock_irqack_r ) |
| 89 | 89 | { |
| 90 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 90 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 91 | 91 | return 0; |
| 92 | 92 | } |
| 93 | 93 |
| r1591 | r1592 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | static TIMER_CALLBACK( via_irq_delayed ) |
| 274 | 274 | { |
| 275 | cpunum_set_input_line(0, 0, param); | |
| 275 | cpunum_set_input_line(machine, 0, 0, param); | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
| r1591 | r1592 | |
| 387 | 387 | |
| 388 | 388 | static WRITE8_HANDLER( sound_reset_w ) |
| 389 | 389 | { |
| 390 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 390 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | |
| r1591 | r1592 | |
| 425 | 425 | |
| 426 | 426 | static void r6532_irq(int state) |
| 427 | 427 | { |
| 428 | cpunum_set_input_line(1, 0, state); | |
| 428 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 |
| r1591 | r1592 | |
|---|---|---|
| 111 | 111 | static INTERRUPT_GEN( capbowl_interrupt ) |
| 112 | 112 | { |
| 113 | 113 | if (readinputport(4) & 1) /* get status of the F2 key */ |
| 114 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */ | |
| 114 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */ | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r1591 | r1592 | |
| 191 | 191 | |
| 192 | 192 | static WRITE8_HANDLER( capbowl_sndcmd_w ) |
| 193 | 193 | { |
| 194 | cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE); | |
| 194 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 195 | 195 | soundlatch_w(offset, data); |
| 196 | 196 | } |
| 197 | 197 | |
| r1591 | r1592 | |
| 206 | 206 | |
| 207 | 207 | static void firqhandler(int irq) |
| 208 | 208 | { |
| 209 | cpunum_set_input_line(1, 1, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 209 | cpunum_set_input_line(Machine, 1, 1, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 |
| r1591 | r1592 | |
|---|---|---|
| 157 | 157 | /* bit 0 enables cpu B */ |
| 158 | 158 | /* however this fails when recovering from a save state |
| 159 | 159 | if cpu B is disabled !! */ |
| 160 | cpunum_set_input_line(2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 160 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 161 | 161 | |
| 162 | 162 | } |
| 163 | 163 | |
| r1591 | r1592 | |
| 519 | 519 | static void darius_adpcm_int (int data) |
| 520 | 520 | { |
| 521 | 521 | if (nmi_enable) |
| 522 | { | |
| 523 | cpunum_set_input_line(3, INPUT_LINE_NMI, PULSE_LINE); | |
| 524 | } | |
| 522 | cpunum_set_input_line(Machine, 3, INPUT_LINE_NMI, PULSE_LINE); | |
| 525 | 523 | } |
| 526 | 524 | |
| 527 | 525 | static const struct MSM5205interface msm5205_interface = |
| r1591 | r1592 | |
| 806 | 804 | /* handler called by the YM2203 emulator when the internal timers cause an IRQ */ |
| 807 | 805 | static void irqhandler(int irq) /* assumes Z80 sandwiched between 68Ks */ |
| 808 | 806 | { |
| 809 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 807 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 810 | 808 | } |
| 811 | 809 | |
| 812 | 810 | static const struct YM2203interface ym2203_interface_1 = |
| r1591 | r1592 | |
|---|---|---|
| 242 | 242 | |
| 243 | 243 | static TIMER_CALLBACK( irq0_stop ) |
| 244 | 244 | { |
| 245 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 245 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | static INTERRUPT_GEN( irq0_start ) |
| 250 | 250 | { |
| 251 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 251 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 252 | 252 | timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq0_stop); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | static void ide_interrupt(int state) |
| 257 | 257 | { |
| 258 | cpunum_set_input_line(0, 1, state); | |
| 258 | cpunum_set_input_line(Machine, 0, 1, state); | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | |
| r1591 | r1592 | |
| 379 | 379 | |
| 380 | 380 | static TIMER_CALLBACK( end_spin ) |
| 381 | 381 | { |
| 382 | cpu_triggerint(0); | |
| 382 | cpu_triggerint(machine, 0); | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | else if (rambank == 1) |
| 56 | 56 | { |
| 57 | 57 | if (offset < 0x800) |
| 58 | return paletteram | |
| 58 | return paletteram[ | |
| 59 | 59 | else return 0; |
| 60 | 60 | } |
| 61 | 61 | else |
| r1591 | r1592 | |
|---|---|---|
| 133 | 133 | * |
| 134 | 134 | *************************************/ |
| 135 | 135 | |
| 136 | static void update_interrupts( | |
| 136 | static void update_interrupts(running_machine *machine); | |
| 137 | 137 | |
| 138 | 138 | static TIMER_CALLBACK( scanline_callback ) |
| 139 | 139 | { |
| r1591 | r1592 | |
| 144 | 144 | |
| 145 | 145 | /* on scanline zero, clear any halt condition */ |
| 146 | 146 | if (scanline == 0) |
| 147 | cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 147 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 148 | 148 | |
| 149 | 149 | /* wrap around at 262 */ |
| 150 | 150 | scanline++; |
| r1591 | r1592 | |
| 153 | 153 | |
| 154 | 154 | /* set the scanline IRQ */ |
| 155 | 155 | irq_state[2] = 1; |
| 156 | update_interrupts(); | |
| 156 | update_interrupts(machine); | |
| 157 | 157 | |
| 158 | 158 | /* set the timer for the next one */ |
| 159 | 159 | timer_set(double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(0, scanline, 0)) - hblank_offset), NULL, scanline, scanline_callback); |
| r1591 | r1592 | |
| 189 | 189 | * |
| 190 | 190 | *************************************/ |
| 191 | 191 | |
| 192 | static void update_interrupts( | |
| 192 | static void update_interrupts(running_machine *machine) | |
| 193 | 193 | { |
| 194 | 194 | int gen_int; |
| 195 | 195 | |
| r1591 | r1592 | |
| 204 | 204 | { |
| 205 | 205 | irq_line_state = gen_int; |
| 206 | 206 | // if (irq_line_state != CLEAR_LINE) |
| 207 | cpunum_set_input_line(0, ASAP_IRQ0, irq_line_state); | |
| 207 | cpunum_set_input_line(machine, 0, ASAP_IRQ0, irq_line_state); | |
| 208 | 208 | // else |
| 209 | 209 | // asap_set_irq_line(ASAP_IRQ0, irq_line_state); |
| 210 | 210 | } |
| r1591 | r1592 | |
| 225 | 225 | irq_state[0] = irq_state[1] = irq_state[2] = 0; |
| 226 | 226 | |
| 227 | 227 | /* update the current state */ |
| 228 | update_interrupts(); | |
| 228 | update_interrupts(Machine); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| r1591 | r1592 | |
| 317 | 317 | static WRITE32_HANDLER( sound_reset_w ) |
| 318 | 318 | { |
| 319 | 319 | logerror("Sound reset = %d\n", !offset); |
| 320 | cpunum_set_input_line(1, INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE); | |
| 320 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE); | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 |
| r1591 | r1592 | |
|---|---|---|
| 395 | 395 | static INTERRUPT_GEN(st0016_int) |
| 396 | 396 | { |
| 397 | 397 | if(!cpu_getiloops()) |
| 398 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 398 | cpunum_set_input_line(machine, 0,0,HOLD_LINE); | |
| 399 | 399 | else |
| 400 | 400 | if(activecpu_get_reg(Z80_IFF1)) /* dirty hack ... */ |
| 401 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE ); | |
| 401 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE ); | |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | extern UINT8 *st0016_charram; |
| r1591 | r1592 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | static void cchasm_6840_irq(int state) |
| 86 | 86 | { |
| 87 | cpunum_set_input_line(0, 4, state?ASSERT_LINE:CLEAR_LINE); | |
| 87 | cpunum_set_input_line(Machine, 0, 4, state?ASSERT_LINE:CLEAR_LINE); | |
| 88 | 88 | } |
| 89 | 89 | static const ptm6840_interface cchasm_6840_intf = |
| 90 | 90 | { |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | static WRITE8_HANDLER( sbasketb_sh_irqtrigger_w ) |
| 46 | 46 | { |
| 47 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 47 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static WRITE8_HANDLER( sbasketb_coin_counter_w ) |
| r1591 | r1592 | |
|---|---|---|
| 354 | 354 | |
| 355 | 355 | static void sound_irq(int state) |
| 356 | 356 | { |
| 357 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 357 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | static INTERRUPT_GEN( skyarmy_nmi_source ) |
| 145 | 145 | { |
| 146 | if(skyarmy_nmi) cpunum_set_input_line(0,INPUT_LINE_NMI, PULSE_LINE) ; | |
| 146 | if(skyarmy_nmi) cpunum_set_input_line(machine, 0,INPUT_LINE_NMI, PULSE_LINE) ; | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 |
| r1591 | r1592 | |
|---|---|---|
| 618 | 618 | MDRV_CPU_ADD_TAG("video", M6809, MAIN_CLOCK_OSC/4/4) /* 1.25 MHz */ |
| 619 | 619 | MDRV_CPU_PROGRAM_MAP(video_map,0) |
| 620 | 620 | |
| 621 | MDRV_CPU_ADD_TAG("sound", M6802, SOUND_CLOCK_OSC/2 | |
| 621 | MDRV_CPU_ADD_TAG("sound", M6802, SOUND_CLOCK_OSC/2 | |
| 622 | 622 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 623 | 623 | |
| 624 | 624 | /* high interleave needed to ensure correct text in service mode */ |
| r1591 | r1592 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | static void irqhandler(int irq) |
| 260 | 260 | { |
| 261 | // cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 261 | // cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | static WRITE16_HANDLER( sound_irq_w ) |
| 274 | 274 | { |
| 275 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 275 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | static READ16_HANDLER( sound_status_r ) |
| r1591 | r1592 | |
| 304 | 304 | if (cur_control2 & 0x0040) |
| 305 | 305 | { |
| 306 | 306 | // foul-proof (CPU0 could be deactivated while we wait) |
| 307 | if (suspension_active) { suspension_active = 0; cpu_trigger(resume_trigger); } | |
| 307 | if (suspension_active) { suspension_active = 0; cpu_trigger(machine, resume_trigger); } | |
| 308 | 308 | |
| 309 | 309 | // IRQ 5 is the "object DMA end interrupt" and shouldn't be triggered |
| 310 | 310 | // if object data isn't ready for DMA within the frame. |
| 311 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 311 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static INTERRUPT_GEN( xexex_interrupt ) |
| 316 | 316 | { |
| 317 | if (suspension_active) { suspension_active = 0; cpu_trigger(resume_trigger); } | |
| 317 | if (suspension_active) { suspension_active = 0; cpu_trigger(machine, resume_trigger); } | |
| 318 | 318 | |
| 319 | 319 | switch (cpu_getiloops()) |
| 320 | 320 | { |
| 321 | 321 | case 0: |
| 322 | 322 | // IRQ 6 is for test mode only |
| 323 | 323 | if (cur_control2 & 0x0020) |
| 324 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 324 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 325 | 325 | break; |
| 326 | 326 | |
| 327 | 327 | case 1: |
| r1591 | r1592 | |
| 337 | 337 | // IRQ 4 is the V-blank interrupt. It controls color, sound and |
| 338 | 338 | // vital game logics that shouldn't be interfered by frame-drop. |
| 339 | 339 | if (cur_control2 & 0x0800) |
| 340 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 340 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 341 | 341 | break; |
| 342 | 342 | } |
| 343 | 343 | } |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | if (cpu_getiloops() == 0) |
| 32 | 32 | { |
| 33 | 33 | if (*ironhors_interrupt_enable & 4) |
| 34 | cpunum_set_input_line(0, M6809_FIRQ_LINE, HOLD_LINE); | |
| 34 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, HOLD_LINE); | |
| 35 | 35 | } |
| 36 | 36 | else if (cpu_getiloops() % 2) |
| 37 | 37 | { |
| 38 | 38 | if (*ironhors_interrupt_enable & 1) |
| 39 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 39 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static WRITE8_HANDLER( ironhors_sh_irqtrigger_w ) |
| 44 | 44 | { |
| 45 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 45 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | static WRITE8_HANDLER( ironhors_filter_w ) |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | * |
| 31 | 31 | *************************************/ |
| 32 | 32 | |
| 33 | static void update_interrupts( | |
| 33 | static void update_interrupts(running_machine *machine) | |
| 34 | 34 | { |
| 35 | 35 | int newstate = 0; |
| 36 | 36 | |
| r1591 | r1592 | |
| 42 | 42 | newstate = 4; |
| 43 | 43 | |
| 44 | 44 | if (newstate) |
| 45 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 46 | 46 | else |
| 47 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 47 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 |
| r1591 | r1592 | |
|---|---|---|
| 385 | 385 | static WRITE16_HANDLER(sound_w) |
| 386 | 386 | { |
| 387 | 387 | soundlatch_w(0,data & 0xff); |
| 388 | cpunum_set_input_line(1, I8051_INT0_LINE, HOLD_LINE); | |
| 388 | cpunum_set_input_line(Machine, 1, I8051_INT0_LINE, HOLD_LINE); | |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | static ADDRESS_MAP_START( sliver_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 526 | 526 | static INTERRUPT_GEN( sliver_int ) |
| 527 | 527 | { |
| 528 | 528 | //valid interrupts are 2,3,4 |
| 529 | cpunum_set_input_line(0, 2+cpu_getiloops(), HOLD_LINE); | |
| 529 | cpunum_set_input_line(machine, 0, 2+cpu_getiloops(), HOLD_LINE); | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | static MACHINE_DRIVER_START( sliver ) |
| r1591 | r1592 | |
|---|---|---|
| 66 | 66 | sndto000[ ( offset << 1 ) + 1 ] = data >> 16; |
| 67 | 67 | if( offset == 3 ) |
| 68 | 68 | { |
| 69 | cpunum_set_input_line( 1, 1, HOLD_LINE ); | |
| 69 | cpunum_set_input_line(Machine, 1, 1, HOLD_LINE ); | |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | if( ACCESSING_LSW32 ) |
| r1591 | r1592 | |
| 140 | 140 | EEPROM_write_bit( ( data & 0x01 ) ? 1 : 0 ); |
| 141 | 141 | EEPROM_set_clock_line( ( data & 0x04 ) ? ASSERT_LINE : CLEAR_LINE ); |
| 142 | 142 | EEPROM_set_cs_line( ( data & 0x02 ) ? CLEAR_LINE : ASSERT_LINE ); |
| 143 | cpunum_set_input_line(1, INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 143 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | static CUSTOM_INPUT( eeprom_bit_r ) |
| r1591 | r1592 | |
|---|---|---|
| 126 | 126 | static WRITE8_HANDLER( mrflea_io_w ){ |
| 127 | 127 | mrflea_status |= 0x08; // pending command to IO CPU |
| 128 | 128 | mrflea_io = data; |
| 129 | cpunum_set_input_line( 1, 0, HOLD_LINE ); | |
| 129 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static READ8_HANDLER( mrflea_main_r ){ |
| r1591 | r1592 | |
| 155 | 155 | |
| 156 | 156 | static INTERRUPT_GEN( mrflea_io_interrupt ){ |
| 157 | 157 | if( cpu_getiloops()==0 || (mrflea_status&0x08) ) |
| 158 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 158 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static READ8_HANDLER( mrflea_interrupt_type_r ){ |
| r1591 | r1592 | |
|---|---|---|
| 1206 | 1206 | |
| 1207 | 1207 | ypos2+=((ysizedraw2+1)/2); |
| 1208 | 1208 | |
| 1209 | if (!flipx) xpos2-= (xsize2+1)*((16*xinc)>>16); | |
| 1210 | else xpos2+= (xsize2)*((16*xinc)>>16); | |
| 1209 | if (!flipx) xpos2-= ((xsize2+1)*16*xinc)>>16; | |
| 1210 | else xpos2+= (xsize2*16*xinc)>>16; | |
| 1211 | 1211 | |
| 1212 | 1212 | if (flipy) ypos2-= ysize2*((16*yinc)>>16); |
| 1213 | 1213 | |
| r1591 | r1592 | |
| 1217 | 1217 | { |
| 1218 | 1218 | int current_xpos; |
| 1219 | 1219 | |
| 1220 | if (!flipx) current_xpos = (xpos+xpos2+xx* ((16*xinc)>>16) ); | |
| 1221 | else current_xpos = (xpos+xpos2-xx*((16*xinc)>>16)); | |
| 1220 | if (!flipx) current_xpos = (xpos+xpos2+((xx*16*xinc)>>16) ); | |
| 1221 | else current_xpos = (xpos+xpos2-((xx*16*xinc)>>16)); | |
| 1222 | 1222 | //current_xpos += rand()&0x3ff; |
| 1223 | 1223 | current_xpos += gscrollx; |
| 1224 | 1224 | current_xpos += 1; |
| r1591 | r1592 | |
| 2018 | 2018 | } |
| 2019 | 2019 | |
| 2020 | 2020 | |
| 2021 | cpunum_set_input_line(0,10, ASSERT_LINE); | |
| 2021 | cpunum_set_input_line(Machine, 0,10, ASSERT_LINE); | |
| 2022 | 2022 | |
| 2023 | 2023 | |
| 2024 | 2024 | } |
| r1591 | r1592 | |
| 2239 | 2239 | /* We should probably copy this, but a pointer to it is fine for our purposes as the data doesn't change */ |
| 2240 | 2240 | current_table_address = real_source; |
| 2241 | 2241 | } |
| 2242 | cpunum_set_input_line(0,10, ASSERT_LINE); | |
| 2242 | cpunum_set_input_line(Machine, 0,10, ASSERT_LINE); | |
| 2243 | 2243 | } |
| 2244 | 2244 | else if ( (dat1&0x00e00000) ==0x00400000 ) |
| 2245 | 2245 | { |
| 2246 | 2246 | /* 6bpp DMA decompression |
| 2247 | 2247 | - this is used for the majority of sprites and backgrounds */ |
| 2248 | 2248 | cps3_do_char_dma( real_source, real_destination, real_length ); |
| 2249 | cpunum_set_input_line(0,10, ASSERT_LINE); | |
| 2249 | cpunum_set_input_line(Machine, 0,10, ASSERT_LINE); | |
| 2250 | 2250 | |
| 2251 | 2251 | } |
| 2252 | 2252 | else if ( (dat1&0x00e00000) ==0x00600000 ) |
| r1591 | r1592 | |
| 2254 | 2254 | /* 8bpp DMA decompression |
| 2255 | 2255 | - this is used on SFIII NG Sean's Stage ONLY */ |
| 2256 | 2256 | cps3_do_alt_char_dma( real_source, real_destination, real_length); |
| 2257 | cpunum_set_input_line(0,10, ASSERT_LINE); | |
| 2257 | cpunum_set_input_line(Machine, 0,10, ASSERT_LINE); | |
| 2258 | 2258 | } |
| 2259 | 2259 | else |
| 2260 | 2260 | { |
| r1591 | r1592 | |
| 2311 | 2311 | |
| 2312 | 2312 | static WRITE32_HANDLER( cps3_irq10_ack_w ) |
| 2313 | 2313 | { |
| 2314 | cpunum_set_input_line(0,10, CLEAR_LINE); return; | |
| 2314 | cpunum_set_input_line(Machine, 0,10, CLEAR_LINE); return; | |
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | 2317 | static WRITE32_HANDLER( cps3_irq12_ack_w ) |
| 2318 | 2318 | { |
| 2319 | cpunum_set_input_line(0,12, CLEAR_LINE); return; | |
| 2319 | cpunum_set_input_line(Machine, 0,12, CLEAR_LINE); return; | |
| 2320 | 2320 | } |
| 2321 | 2321 | |
| 2322 | 2322 | static WRITE32_HANDLER( cps3_unk_vidregs_w ) |
| r1591 | r1592 | |
| 2458 | 2458 | |
| 2459 | 2459 | static INTERRUPT_GEN(cps3_vbl_interrupt) |
| 2460 | 2460 | { |
| 2461 | cpunum_set_input_line(0,12, ASSERT_LINE); | |
| 2461 | cpunum_set_input_line(machine, 0,12, ASSERT_LINE); | |
| 2462 | 2462 | } |
| 2463 | 2463 | |
| 2464 | 2464 | static INTERRUPT_GEN(cps3_other_interrupt) |
| r1591 | r1592 | |
| 2466 | 2466 | // this seems to need to be periodic (see the life bar portraits in sfiii2 |
| 2467 | 2467 | // but also triggered on certain dma events (or warzard locks up in attract) |
| 2468 | 2468 | // what is the REAL source of IRQ10?? |
| 2469 | cpunum_set_input_line(0,10, ASSERT_LINE); | |
| 2469 | cpunum_set_input_line(machine, 0,10, ASSERT_LINE); | |
| 2470 | 2470 | } |
| 2471 | 2471 | |
| 2472 | 2472 | |
| r1591 | r1592 | |
| 3120 | 3120 | // rom[0x1fecc/4]^=0x01000000; // nocd |
| 3121 | 3121 | |
| 3122 | 3122 | cps3_use_fastboot = 0; |
| 3123 | driver_init_cps3crpt(machine); | |
| 3124 | driver_init_cps3_speedups(machine); | |
| 3125 | driver_init_cps3_testhacks(machine); | |
| 3123 | DRIVER_INIT_CALL(cps3crpt); | |
| 3124 | DRIVER_INIT_CALL(cps3_speedups); | |
| 3125 | DRIVER_INIT_CALL(cps3_testhacks); | |
| 3126 | 3126 | |
| 3127 | 3127 | |
| 3128 | 3128 | } |
| r1591 | r1592 | |
| 3146 | 3146 | // rom[0x1fec8/4]^=0x00000070; // DEV mode |
| 3147 | 3147 | // rom[0x1fecc/4]^=0x01000000; // nocd |
| 3148 | 3148 | |
| 3149 | driver_init_cps3crpt(machine); | |
| 3150 | driver_init_cps3_speedups(machine); | |
| 3151 | driver_init_cps3_testhacks(machine); | |
| 3149 | DRIVER_INIT_CALL(cps3crpt); | |
| 3150 | DRIVER_INIT_CALL(cps3_speedups); | |
| 3151 | DRIVER_INIT_CALL(cps3_testhacks); | |
| 3152 | 3152 | |
| 3153 | 3153 | cps3_use_fastboot = 0; |
| 3154 | 3154 | } |
| r1591 | r1592 | |
| 3172 | 3172 | // any actual NCD dumps to compare (or it expects SCSI to report there being |
| 3173 | 3173 | // no cd drive?) |
| 3174 | 3174 | |
| 3175 | driver_init_cps3crpt(machine); | |
| 3176 | driver_init_cps3_speedups(machine); | |
| 3177 | driver_init_cps3_testhacks(machine); | |
| 3175 | DRIVER_INIT_CALL(cps3crpt); | |
| 3176 | DRIVER_INIT_CALL(cps3_speedups); | |
| 3177 | DRIVER_INIT_CALL(cps3_testhacks); | |
| 3178 | 3178 | |
| 3179 | 3179 | cps3_use_fastboot = 0; // required due to cd check, even with ASIA NO CD selected, not req. with CD emulation |
| 3180 | 3180 | } |
| r1591 | r1592 | |
| 3200 | 3200 | |
| 3201 | 3201 | cps3_use_fastboot = 0; |
| 3202 | 3202 | |
| 3203 | driver_init_cps3crpt(machine); | |
| 3204 | driver_init_cps3_speedups(machine); | |
| 3205 | driver_init_cps3_testhacks(machine); | |
| 3203 | DRIVER_INIT_CALL(cps3crpt); | |
| 3204 | DRIVER_INIT_CALL(cps3_speedups); | |
| 3205 | DRIVER_INIT_CALL(cps3_testhacks); | |
| 3206 | 3206 | |
| 3207 | 3207 | } |
| 3208 | 3208 | |
| r1591 | r1592 | |
| 3224 | 3224 | |
| 3225 | 3225 | cps3_use_fastboot = 0; // not required |
| 3226 | 3226 | |
| 3227 | driver_init_cps3crpt(machine); | |
| 3228 | driver_init_cps3_speedups(machine); | |
| 3229 | driver_init_cps3_testhacks(machine); | |
| 3227 | DRIVER_INIT_CALL(cps3crpt); | |
| 3228 | DRIVER_INIT_CALL(cps3_speedups); | |
| 3229 | DRIVER_INIT_CALL(cps3_testhacks); | |
| 3230 | 3230 | } |
| 3231 | 3231 | |
| 3232 | 3232 | |
| r1591 | r1592 | |
| 3246 | 3246 | // rom[0x1fec8/4]^=0x00000001; // region |
| 3247 | 3247 | // rom[0x1fecc/4]^=0x01000000; // nocd |
| 3248 | 3248 | |
| 3249 | driver_init_cps3crpt(machine); | |
| 3250 | driver_init_cps3_speedups(machine); | |
| 3251 | driver_init_cps3_testhacks(machine); | |
| 3249 | DRIVER_INIT_CALL(cps3crpt); | |
| 3250 | DRIVER_INIT_CALL(cps3_speedups); | |
| 3251 | DRIVER_INIT_CALL(cps3_testhacks); | |
| 3252 | 3252 | |
| 3253 | 3253 | cps3_use_fastboot = 0; |
| 3254 | 3254 | } |
| r1591 | r1592 | |
|---|---|---|
| 39 | 39 | static INTERRUPT_GEN( glass_interrupt ) |
| 40 | 40 | { |
| 41 | 41 | if (cause_interrupt){ |
| 42 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 42 | cpunum_set_input_line(Machine, 0, 6, HOLD_LINE); | |
| 43 | 43 | cause_interrupt = 0; |
| 44 | 44 | } |
| 45 | 45 | } |
| r1591 | r1592 | |
|---|---|---|
| 231 | 231 | |
| 232 | 232 | static void main_cpu_irq(int state) |
| 233 | 233 | { |
| 234 | cpunum_set_input_line(0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 234 | int combined_state = pia_get_irq_a(1) | pia_get_irq_b(1) | | |
| 235 | pia_get_irq_b(2) | | |
| 236 | pia_get_irq_a(3) | pia_get_irq_b(3); | |
| 237 | ||
| 238 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 235 | 239 | } |
| 236 | 240 | |
| 237 | 241 | |
| 238 | 242 | static void main_cpu_firq(int state) |
| 239 | 243 | { |
| 240 | cpunum_set_input_line(0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 244 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 241 | 245 | } |
| 242 | 246 | |
| 243 | 247 | |
| 244 | 248 | static void audio_cpu_irq(int state) |
| 245 | 249 | { |
| 246 | cpunum_set_input_line(1, M6802_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 250 | cpunum_set_input_line(Machine, 1, M6802_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 247 | 251 | } |
| 248 | 252 | |
| 249 | 253 |
| r1591 | r1592 | |
|---|---|---|
| 161 | 161 | static WRITE16_HANDLER( mcat_soundlatch_w ) |
| 162 | 162 | { |
| 163 | 163 | soundlatch_w(0, data); |
| 164 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 164 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | #if 0 // mcat only.. install read handler? |
| r1591 | r1592 | |
| 479 | 479 | /* Stolen from Psikyo.c */ |
| 480 | 480 | static void sound_irq( int irq ) |
| 481 | 481 | { |
| 482 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 482 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 483 | 483 | } |
| 484 | 484 | static const struct YM2610interface mcatadv_ym2610_interface = |
| 485 | 485 | { |
| r1591 | r1592 | |
|---|---|---|
| 300 | 300 | static UINT8 *raizing_shared_ram; /* Shared ram used in Shippumd and Mahoudai */ |
| 301 | 301 | static UINT16 *toaplan2_shared_ram16; /* Really 8bit RAM connected to Z180 */ |
| 302 | 302 | static UINT16 *V25_shared_ram; /* Really 8bit RAM connected to Z180 */ |
| 303 | static UINT16 *fixeight_sec_cpu_mem; | |
| 303 | 304 | |
| 304 | 305 | /************ Video RAM related values ************/ |
| 305 | 306 | extern UINT16 *toaplan2_txvideoram16; |
| r1591 | r1592 | |
| 387 | 388 | static void toaplan2_reset(void) |
| 388 | 389 | { |
| 389 | 390 | if ( cpu_gettotalcpu() > 1 ) |
| 390 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 391 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 391 | 392 | } |
| 392 | 393 | |
| 393 | static MACHINE_RESET( toaplan2 ) | |
| 394 | static MACHINE_RESET( toaplan2 ) | |
| 394 | 395 | { |
| 395 | 396 | mcu_data = 0x00; |
| 396 | 397 | |
| r1591 | r1592 | |
| 404 | 405 | |
| 405 | 406 | static MACHINE_RESET( ghox ) |
| 406 | 407 | { |
| 407 | | |
| 408 | MACHINE_RESET_CALL(toaplan2 | |
| 408 | 409 | old_p1_paddle_h = 0; |
| 409 | 410 | old_p2_paddle_h = 0; |
| 410 | 411 | } |
| 411 | 412 | |
| 412 | 413 | static MACHINE_RESET( dogyuun ) |
| 413 | 414 | { |
| 414 | | |
| 415 | MACHINE_RESET_CALL(toaplan2 | |
| 415 | 416 | mcu_data = 0xffaa; |
| 416 | 417 | } |
| 417 | 418 | |
| 418 | 419 | static MACHINE_RESET( vfive ) |
| 419 | 420 | { |
| 420 | | |
| 421 | MACHINE_RESET_CALL(toaplan2 | |
| 421 | 422 | mcu_data = 0xffaa; |
| 422 | 423 | } |
| 423 | 424 | |
| r1591 | r1592 | |
| 429 | 430 | current_bank = 2; |
| 430 | 431 | memory_set_bankptr(1, &Z80[0x10000]); |
| 431 | 432 | |
| 432 | | |
| 433 | MACHINE_RESET_CALL(toaplan2 | |
| 433 | 434 | } |
| 434 | 435 | |
| 435 | 436 | static DRIVER_INIT( T2_Z80 ) /* init_t2_Z80(); */ |
| r1591 | r1592 | |
| 454 | 455 | |
| 455 | 456 | static DRIVER_INIT( fixeight ) |
| 456 | 457 | { |
| 457 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, MRA16_RAM ); | |
| 458 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, MWA16_RAM ); | |
| 458 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, MRA16_BANK2, MWA16_BANK2 ); | |
| 459 | memory_set_bankptr(2, fixeight_sec_cpu_mem); | |
| 459 | 460 | |
| 460 | 461 | toaplan2_sub_cpu = CPU_2_V25; |
| 461 | 462 | } |
| r1591 | r1592 | |
| 582 | 583 | |
| 583 | 584 | static TIMER_CALLBACK( toaplan2_raise_irq ) |
| 584 | 585 | { |
| 585 | cpunum_set_input_line(0, param, HOLD_LINE); | |
| 586 | cpunum_set_input_line(machine, 0, param, HOLD_LINE); | |
| 586 | 587 | } |
| 587 | 588 | |
| 588 | 589 | static void toaplan2_vblank_irq(int irq_line) |
| r1591 | r1592 | |
| 953 | 954 | /* game keeping service mode. It writes/reads the settings to/from */ |
| 954 | 955 | /* these shared RAM locations. The secondary CPU reads/writes them */ |
| 955 | 956 | /* from/to nvram to store the settings (a 93C45 EEPROM) */ |
| 956 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28f003, 0, 0, MRA16_RAM); | |
| 957 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_5_word_r); /* Dip Switch A - Wrong !!! */ | |
| 958 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_6_word_r); /* Dip Switch B - Wrong !!! */ | |
| 959 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_7_word_r); /* Territory Jumper block - Wrong !!! */ | |
| 960 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f00a, 0x28fbff, 0, 0, MRA16_RAM); | |
| 961 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28f003, 0, 0, MWA16_RAM); | |
| 962 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f009, 0, 0, MWA16_NOP); | |
| 963 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f00a, 0x28fbff, 0, 0, MWA16_RAM); | |
| 957 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, MRA16_BANK2, MWA16_BANK2); | |
| 958 | memory_set_bankptr(2, fixeight_sec_cpu_mem); | |
| 959 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_5_word_r, MWA16_NOP); /* Dip Switch A - Wrong !!! */ | |
| 960 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_6_word_r, MWA16_NOP); /* Dip Switch B - Wrong !!! */ | |
| 961 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_7_word_r, MWA16_NOP); /* Territory Jumper block - Wrong !!! */ | |
| 964 | 962 | |
| 965 | 963 | mcu_data = data; |
| 966 | 964 | } |
| r1591 | r1592 | |
| 1051 | 1049 | if (ACCESSING_LSB) |
| 1052 | 1050 | { |
| 1053 | 1051 | soundlatch_w(offset, data & 0xff); |
| 1054 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 1052 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 1055 | 1053 | } |
| 1056 | 1054 | } |
| 1057 | 1055 | |
| r1591 | r1592 | |
| 1179 | 1177 | if (ACCESSING_LSB) |
| 1180 | 1178 | { |
| 1181 | 1179 | soundlatch_w(offset, data & 0xff); |
| 1182 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1180 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1183 | 1181 | } |
| 1184 | 1182 | } |
| 1185 | 1183 | |
| r1591 | r1592 | |
| 1189 | 1187 | if (ACCESSING_LSB) |
| 1190 | 1188 | { |
| 1191 | 1189 | soundlatch2_w(offset, data & 0xff); |
| 1192 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1190 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1193 | 1191 | } |
| 1194 | 1192 | } |
| 1195 | 1193 | |
| r1591 | r1592 | |
| 1205 | 1203 | { |
| 1206 | 1204 | // not sure whether this is correct |
| 1207 | 1205 | // the 68K writes here during the sound IRQ handler, and nowhere else... |
| 1208 | cpunum_set_input_line(0, raizing_sndirq_line, CLEAR_LINE); | |
| 1206 | cpunum_set_input_line(Machine, 0, raizing_sndirq_line, CLEAR_LINE); | |
| 1209 | 1207 | } |
| 1210 | 1208 | |
| 1211 | 1209 | |
| 1212 | 1210 | static WRITE8_HANDLER( raizing_sndirq_w ) |
| 1213 | 1211 | { |
| 1214 | 1212 | // if raizing_clear_sndirq_w() is correct, should this be ASSERT_LINE? |
| 1215 | cpunum_set_input_line(0, raizing_sndirq_line, HOLD_LINE); | |
| 1213 | cpunum_set_input_line(Machine, 0, raizing_sndirq_line, HOLD_LINE); | |
| 1216 | 1214 | } |
| 1217 | 1215 | |
| 1218 | 1216 | |
| 1219 | 1217 | static WRITE8_HANDLER( raizing_clear_nmi_w ) |
| 1220 | 1218 | { |
| 1221 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1219 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1222 | 1220 | } |
| 1223 | 1221 | |
| 1224 | 1222 | |
| r1591 | r1592 | |
| 1344 | 1342 | |
| 1345 | 1343 | static INTERRUPT_GEN( bbakraid_snd_interrupt ) |
| 1346 | 1344 | { |
| 1347 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 1345 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 1348 | 1346 | } |
| 1349 | 1347 | |
| 1350 | 1348 | |
| r1591 | r1592 | |
| 1353 | 1351 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 1354 | 1352 | AM_RANGE(0x020000, 0x03ffff) AM_ROM /* extra for Whoopee */ |
| 1355 | 1353 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1356 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE( | |
| 1354 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA | |
| 1357 | 1355 | AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w) |
| 1358 | 1356 | AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1359 | 1357 | AM_RANGE(0x140008, 0x140009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| r1591 | r1592 | |
| 1373 | 1371 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1374 | 1372 | AM_RANGE(0x040000, 0x040001) AM_READ(ghox_p2_h_analog_r) /* Paddle 2 */ |
| 1375 | 1373 | AM_RANGE(0x080000, 0x083fff) AM_RAM |
| 1376 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE( | |
| 1374 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA | |
| 1377 | 1375 | AM_RANGE(0x100000, 0x100001) AM_READ(ghox_p1_h_analog_r) /* Paddle 1 */ |
| 1378 | 1376 | AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w) |
| 1379 | 1377 | AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| r1591 | r1592 | |
| 1414 | 1412 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1415 | 1413 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1416 | 1414 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1417 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1415 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1418 | 1416 | /***** The following loctions in 0x50000x are for video controller 2 ******/ |
| 1419 | 1417 | AM_RANGE(0x500000, 0x500001) AM_WRITE(toaplan2_1_voffs_w) /* VideoRAM selector/offset */ |
| 1420 | 1418 | AM_RANGE(0x500004, 0x500007) AM_READWRITE(toaplan2_1_videoram16_r, toaplan2_1_videoram16_w) /* Tile/Sprite VideoRAM */ |
| r1591 | r1592 | |
| 1440 | 1438 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1441 | 1439 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1442 | 1440 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1443 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1441 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1444 | 1442 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) /* test bit 8 */ |
| 1445 | 1443 | ADDRESS_MAP_END |
| 1446 | 1444 | |
| r1591 | r1592 | |
| 1465 | 1463 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1466 | 1464 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1467 | 1465 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1468 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1466 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1469 | 1467 | ADDRESS_MAP_END |
| 1470 | 1468 | |
| 1471 | 1469 | |
| r1591 | r1592 | |
| 1476 | 1474 | AM_RANGE(0x200004, 0x200007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) |
| 1477 | 1475 | AM_RANGE(0x200008, 0x200009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1478 | 1476 | AM_RANGE(0x20000c, 0x20000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1479 | AM_RANGE(0x300000, 0x300fff) AM_READWRITE( | |
| 1477 | AM_RANGE(0x300000, 0x300fff) AM_READWRITE(MRA | |
| 1480 | 1478 | AM_RANGE(0x400000, 0x401fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1481 | 1479 | AM_RANGE(0x402000, 0x4021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1482 | 1480 | AM_RANGE(0x402200, 0x402fff) AM_RAM |
| r1591 | r1592 | |
| 1500 | 1498 | static ADDRESS_MAP_START( pipibibs_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1501 | 1499 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1502 | 1500 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1503 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE( | |
| 1501 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA | |
| 1504 | 1502 | AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w) |
| 1505 | 1503 | AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) |
| 1506 | 1504 | AM_RANGE(0x140008, 0x140009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| r1591 | r1592 | |
| 1521 | 1519 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1522 | 1520 | AM_RANGE(0x083000, 0x0837ff) AM_READWRITE(pipibibi_spriteram16_r, pipibibi_spriteram16_w) /* SpriteRAM */ |
| 1523 | 1521 | AM_RANGE(0x083800, 0x087fff) AM_RAM /* SpriteRAM (unused) */ |
| 1524 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE( | |
| 1522 | AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA | |
| 1525 | 1523 | AM_RANGE(0x120000, 0x120fff) AM_RAM /* Copy of SpriteRAM ? */ |
| 1526 | 1524 | // AM_RANGE(0x13f000, 0x13f001) AM_WRITENOP /* ??? */ |
| 1527 | 1525 | AM_RANGE(0x180000, 0x182fff) AM_READWRITE(pipibibi_videoram16_r, pipibibi_videoram16_w) /* TileRAM */ |
| r1591 | r1592 | |
| 1552 | 1550 | AM_RANGE(0x28fc00, 0x28ffff) AM_READWRITE(V25_sharedram_r, V25_sharedram_w) AM_BASE(&V25_shared_ram) /* 16-bit on 68000 side, 8-bit on V25+ side */ |
| 1553 | 1551 | #else |
| 1554 | 1552 | AM_RANGE(0x28e000, 0x28efff) AM_READWRITE(shared_ram_r, shared_ram_w) AM_BASE(&toaplan2_shared_ram16) |
| 1555 | AM_RANGE(0x28f000, 0x28f001) AM_READWRITE(fixeight_sec_cpu_r, fixeight_sec_cpu_w) /* V25+ Command/Status port */ | |
| 1553 | AM_RANGE(0x28f000, 0x28f001) AM_READWRITE(fixeight_sec_cpu_r, fixeight_sec_cpu_w) AM_BASE(&fixeight_sec_cpu_mem) /* V25+ Command/Status port */ | |
| 1556 | 1554 | // AM_RANGE(0x28f002, 0x28f003) AM_READ(MRA16_RAM) /* part of shared ram */ |
| 1557 | 1555 | // AM_RANGE(0x28f004, 0x28f005) AM_READ_PORT("DSWA") /* Dip Switch A - Wrong !!! */ |
| 1558 | 1556 | // AM_RANGE(0x28f006, 0x28f007) AM_READ_PORT("DSWB") /* Dip Switch B - Wrong !!! */ |
| r1591 | r1592 | |
| 1564 | 1562 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1565 | 1563 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1566 | 1564 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1567 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1565 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1568 | 1566 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1569 | 1567 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1570 | 1568 | AM_RANGE(0x503000, 0x5031ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| r1591 | r1592 | |
| 1588 | 1586 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1589 | 1587 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1590 | 1588 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1591 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1589 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1592 | 1590 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1593 | 1591 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1594 | 1592 | AM_RANGE(0x503000, 0x5031ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| r1591 | r1592 | |
| 1620 | 1618 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1621 | 1619 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1622 | 1620 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) |
| 1623 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1621 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1624 | 1622 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) |
| 1625 | 1623 | ADDRESS_MAP_END |
| 1626 | 1624 | |
| r1591 | r1592 | |
| 1649 | 1647 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1650 | 1648 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1651 | 1649 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1652 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1650 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1653 | 1651 | /***** The following in 0x50000x are for video controller 2 ******/ |
| 1654 | 1652 | AM_RANGE(0x500000, 0x500001) AM_WRITE(toaplan2_1_voffs_w) /* VideoRAM selector/offset */ |
| 1655 | 1653 | AM_RANGE(0x500004, 0x500007) AM_READWRITE(toaplan2_1_videoram16_r, toaplan2_1_videoram16_w) /* Tile/Sprite VideoRAM */ |
| r1591 | r1592 | |
| 1666 | 1664 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1667 | 1665 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1668 | 1666 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1669 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1667 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1670 | 1668 | AM_RANGE(0x500000, 0x500001) AM_WRITE(YM2151_register_port_0_lsb_w) |
| 1671 | 1669 | AM_RANGE(0x500002, 0x500003) AM_READWRITE(YM2151_status_port_0_lsb_r, YM2151_data_port_0_lsb_w) |
| 1672 | 1670 | AM_RANGE(0x600000, 0x600001) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) |
| r1591 | r1592 | |
| 1699 | 1697 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1700 | 1698 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1701 | 1699 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1702 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1700 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1703 | 1701 | AM_RANGE(0x401000, 0x4017ff) AM_RAM /* Unused PaletteRAM */ |
| 1704 | 1702 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1705 | 1703 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| r1591 | r1592 | |
| 1726 | 1724 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1727 | 1725 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1728 | 1726 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1729 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1727 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1730 | 1728 | AM_RANGE(0x401000, 0x4017ff) AM_RAM /* Unused PaletteRAM */ |
| 1731 | 1729 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1732 | 1730 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| r1591 | r1592 | |
| 1752 | 1750 | AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ |
| 1753 | 1751 | AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w) |
| 1754 | 1752 | AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) /* VBlank */ |
| 1755 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE( | |
| 1753 | AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA | |
| 1756 | 1754 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) |
| 1757 | 1755 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1758 | 1756 | AM_RANGE(0x502200, 0x502fff) AM_RAM |
| r1591 | r1592 | |
| 1765 | 1763 | static ADDRESS_MAP_START( batrider_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1766 | 1764 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 1767 | 1765 | AM_RANGE(0x200000, 0x201fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) /* Text VideoRAM */ |
| 1768 | AM_RANGE(0x202000, 0x202fff) AM_READWRITE( | |
| 1766 | AM_RANGE(0x202000, 0x202fff) AM_READWRITE(MRA | |
| 1769 | 1767 | AM_RANGE(0x203000, 0x2031ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1770 | 1768 | AM_RANGE(0x203200, 0x2033ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| 1771 | 1769 | AM_RANGE(0x203400, 0x207fff) AM_READWRITE(raizing_tx_gfxram16_r, raizing_tx_gfxram16_w) /* Main RAM actually */ |
| r1591 | r1592 | |
| 1796 | 1794 | static ADDRESS_MAP_START( bbakraid_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1797 | 1795 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 1798 | 1796 | AM_RANGE(0x200000, 0x201fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size) /* Text VideoRAM */ |
| 1799 | AM_RANGE(0x202000, 0x202fff) AM_READWRITE( | |
| 1797 | AM_RANGE(0x202000, 0x202fff) AM_READWRITE(MRA | |
| 1800 | 1798 | AM_RANGE(0x203000, 0x2031ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE(&toaplan2_txvideoram16_offs) AM_SIZE(&toaplan2_tx_offs_vram_size) |
| 1801 | 1799 | AM_RANGE(0x203200, 0x2033ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size) |
| 1802 | 1800 | AM_RANGE(0x203400, 0x207fff) AM_READWRITE(raizing_tx_gfxram16_r, raizing_tx_gfxram16_w) /* Main RAM actually */ |
| r1591 | r1592 | |
| 3275 | 3273 | |
| 3276 | 3274 | static void irqhandler(int linestate) |
| 3277 | 3275 | { |
| 3278 | cpunum_set_input_line(1,0,linestate); | |
| 3276 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 3279 | 3277 | } |
| 3280 | 3278 | |
| 3281 | 3279 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 401 | 401 | static INTERRUPT_GEN( jchan_vblank ) |
| 402 | 402 | { |
| 403 | 403 | if (!cpu_getiloops()) |
| 404 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 404 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 405 | 405 | else |
| 406 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 406 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | |
| r1591 | r1592 | |
| 480 | 480 | { |
| 481 | 481 | COMBINE_DATA(&main2sub_cmd); |
| 482 | 482 | logerror("cpu #%d (PC=%06X): write cmd %04x to subcpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), main2sub_cmd); |
| 483 | cpunum_set_input_line(1, 4, HOLD_LINE); | |
| 483 | cpunum_set_input_line(Machine, 1, 4, HOLD_LINE); | |
| 484 | 484 | } |
| 485 | 485 | static READ16_HANDLER ( main2sub_status_r ) |
| 486 | 486 | { |
| r1591 | r1592 | |
| 513 | 513 | { |
| 514 | 514 | COMBINE_DATA(&sub2main_cmd); |
| 515 | 515 | logerror("cpu #%d (PC=%06X): write cmd %04x to maincpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), sub2main_cmd); |
| 516 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 516 | cpunum_set_input_line(Machine, 0, 3, HOLD_LINE); | |
| 517 | 517 | } |
| 518 | 518 | static READ16_HANDLER ( sub2main_cmd_r ) |
| 519 | 519 | { |
| r1591 | r1592 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | ||
| 19 | #define MASTER_CLOCK XTAL_18_432MHz | |
| 20 | #define VOICE_CLOCK XTAL_3_579545MHz | |
| 21 | ||
| 22 | ||
| 18 | 23 | #include "driver.h" |
| 19 | 24 | #include "cpu/m6809/m6809.h" |
| 20 | 25 | #include "sound/sn76496.h" |
| r1591 | r1592 | |
| 47 | 52 | static INTERRUPT_GEN( jb_interrupt ) |
| 48 | 53 | { |
| 49 | 54 | if (irq_enable) |
| 50 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 55 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 51 | 56 | } |
| 52 | 57 | |
| 53 | 58 | static INTERRUPT_GEN( jb_interrupt_nmi ) |
| 54 | 59 | { |
| 55 | 60 | if (nmi_enable) |
| 56 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 61 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 57 | 62 | } |
| 58 | 63 | |
| 59 | 64 | |
| r1591 | r1592 | |
| 236 | 241 | static MACHINE_DRIVER_START( jailbrek ) |
| 237 | 242 | |
| 238 | 243 | /* basic machine hardware */ |
| 239 | MDRV_CPU_ADD(M6809, | |
| 244 | MDRV_CPU_ADD(M6809, | |
| 240 | 245 | MDRV_CPU_PROGRAM_MAP(jailbrek_map, 0) |
| 241 | 246 | MDRV_CPU_VBLANK_INT(jb_interrupt,1) |
| 242 | 247 | MDRV_CPU_PERIODIC_INT(jb_interrupt_nmi, 500) /* ? */ |
| 243 | 248 | |
| 244 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 245 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 246 | ||
| 247 | 249 | MDRV_MACHINE_START(jailbrek) |
| 248 | 250 | |
| 249 | 251 | /* video hardware */ |
| 250 | 252 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 251 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 252 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 253 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) | |
| 254 | 253 | MDRV_GFXDECODE(jailbrek) |
| 255 | 254 | MDRV_PALETTE_LENGTH(32) |
| 256 | 255 | MDRV_COLORTABLE_LENGTH(512) |
| 257 | 256 | |
| 257 | MDRV_SCREEN_ADD("main", 0) | |
| 258 | MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 396, 8, 248, 256, 16, 240) | |
| 259 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 260 | ||
| 258 | 261 | MDRV_PALETTE_INIT(jailbrek) |
| 259 | 262 | MDRV_VIDEO_START(jailbrek) |
| 260 | 263 | MDRV_VIDEO_UPDATE(jailbrek) |
| r1591 | r1592 | |
| 262 | 265 | /* sound hardware */ |
| 263 | 266 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 264 | 267 | |
| 265 | MDRV_SOUND_ADD(SN76496, 1 | |
| 268 | MDRV_SOUND_ADD(SN76496, MASTER_CLOCK/12 | |
| 266 | 269 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 267 | 270 | |
| 268 | MDRV_SOUND_ADD(VLM5030, | |
| 271 | MDRV_SOUND_ADD(VLM5030, VOICE_CLOCK) | |
| 269 | 272 | MDRV_SOUND_CONFIG(vlm5030_interface) |
| 270 | 273 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 271 | 274 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 63 | 63 | soundlatch_w( offset, data ); |
| 64 | 64 | |
| 65 | 65 | /* trigger NMI on sound CPU */ |
| 66 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); // safer because NMI can be lost in rare occations | |
| 66 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); // safer because NMI can be lost in rare occations | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static READ8_HANDLER( sgladiat_soundlatch_r ) |
| r1591 | r1592 | |
| 74 | 74 | |
| 75 | 75 | static READ8_HANDLER( sgladiat_sound_nmi_ack_r ) |
| 76 | 76 | { |
| 77 | // cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 77 | // cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 78 | 78 | return 0; |
| 79 | 79 | } |
| 80 | 80 |
| r1591 | r1592 | |
|---|---|---|
| 77 | 77 | { |
| 78 | 78 | //wrong |
| 79 | 79 | if(activecpu_get_pc()==0x822) |
| 80 | { | |
| 81 | cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE); | |
| 82 | } | |
| 80 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE); | |
| 83 | 81 | } |
| 84 | 82 | |
| 85 | 83 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1591 | r1592 | |
| 339 | 337 | |
| 340 | 338 | static void irq_handler(int irq) |
| 341 | 339 | { |
| 342 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 340 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 343 | 341 | } |
| 344 | 342 | |
| 345 | 343 | static GFXDECODE_START( mlanding ) |
| r1591 | r1592 | |
|---|---|---|
| 77 | 77 | { |
| 78 | 78 | if (ACCESSING_LSB){ |
| 79 | 79 | soundlatch_w(0,data & 0xff); |
| 80 | cpunum_set_input_line(1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 80 | cpunum_set_input_line(Machine, 1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 |
| r1591 | r1592 | |
|---|---|---|
| 70 | 70 | //logerror("sound_irq_line write = %2x (after CPUs synced) \n",param); |
| 71 | 71 | |
| 72 | 72 | if ((param&1) == 0) |
| 73 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 73 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 |
| r1591 | r1592 | |
|---|---|---|
| 371 | 371 | |
| 372 | 372 | // Bit 0 : SUBINT |
| 373 | 373 | if ( (wecleman_irqctrl & 1) && (!(data & 1)) ) // 1->0 transition |
| 374 | cpunum_set_input_line(1,4,HOLD_LINE); | |
| 374 | cpunum_set_input_line(Machine, 1,4,HOLD_LINE); | |
| 375 | 375 | |
| 376 | 376 | // Bit 1 : NSUBRST |
| 377 | if (data & 2) cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE ); | |
| 378 | else cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 377 | if (data & 2) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE ); | |
| 378 | else cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE ); | |
| 379 | 379 | |
| 380 | 380 | // Bit 2 : SOUND-ON |
| 381 | 381 | // Bit 3 : SOUNDRST |
| r1591 | r1592 | |
| 651 | 651 | if (ACCESSING_LSB) |
| 652 | 652 | { |
| 653 | 653 | soundlatch_w(0,data & 0xFF); |
| 654 | cpunum_set_input_line(2,0, HOLD_LINE); | |
| 654 | cpunum_set_input_line(Machine, 2,0, HOLD_LINE); | |
| 655 | 655 | } |
| 656 | 656 | } |
| 657 | 657 | |
| r1591 | r1592 | |
| 719 | 719 | if (ACCESSING_LSB) |
| 720 | 720 | { |
| 721 | 721 | soundlatch_w(0,data & 0xFF); |
| 722 | cpunum_set_input_line(2,M6809_IRQ_LINE, HOLD_LINE); | |
| 722 | cpunum_set_input_line(Machine, 2,M6809_IRQ_LINE, HOLD_LINE); | |
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | |
| r1591 | r1592 | |
| 1094 | 1094 | static INTERRUPT_GEN( wecleman_interrupt ) |
| 1095 | 1095 | { |
| 1096 | 1096 | if (cpu_getiloops() == 0) |
| 1097 | cpunum_set_input_line(0, 4, HOLD_LINE); /* once */ | |
| 1097 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); /* once */ | |
| 1098 | 1098 | else |
| 1099 | cpunum_set_input_line(0, 5, HOLD_LINE); /* to read input ports */ | |
| 1099 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); /* to read input ports */ | |
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | static const struct K007232_interface wecleman_k007232_interface = |
| r1591 | r1592 | |
| 1162 | 1162 | |
| 1163 | 1163 | static INTERRUPT_GEN( hotchase_sound_timer ) |
| 1164 | 1164 | { |
| 1165 | cpunum_set_input_line( 2, M6809_FIRQ_LINE, PULSE_LINE ); | |
| 1165 | cpunum_set_input_line(machine, 2, M6809_FIRQ_LINE, PULSE_LINE ); | |
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | static MACHINE_DRIVER_START( hotchase ) |
| r1591 | r1592 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | static INTERRUPT_GEN( dderby_interrupt ) |
| 169 | 169 | { |
| 170 | // cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x8); // almost certainly wrong? | |
| 171 | // cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x10); // almost certainly wrong? | |
| 172 | // cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x18); // almost certainly wrong? | |
| 173 | // cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x20); // almost certainly wrong? | |
| 170 | // cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x8); // almost certainly wrong? | |
| 171 | // cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x10); // almost certainly wrong? | |
| 172 | // cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x18); // almost certainly wrong? | |
| 173 | // cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x20); // almost certainly wrong? | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static MACHINE_DRIVER_START( dderby ) |
| r1591 | r1592 | |
|---|---|---|
| 583 | 583 | |
| 584 | 584 | static void ide_interrupt(int state) |
| 585 | 585 | { |
| 586 | cpunum_set_input_line(0, IDE_IRQ_NUM, state); | |
| 586 | cpunum_set_input_line(Machine, 0, IDE_IRQ_NUM, state); | |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | |
| r1591 | r1592 | |
| 607 | 607 | { |
| 608 | 608 | UINT8 assert = ethernet_irq_state && (*interrupt_enable & (1 << ETHERNET_IRQ_SHIFT)); |
| 609 | 609 | if (ethernet_irq_num != 0) |
| 610 | cpunum_set_input_line(0, ethernet_irq_num, assert ? ASSERT_LINE : CLEAR_LINE); | |
| 610 | cpunum_set_input_line(Machine, 0, ethernet_irq_num, assert ? ASSERT_LINE : CLEAR_LINE); | |
| 611 | 611 | } |
| 612 | 612 | else if (board_config == SEATTLE_WIDGET_CONFIG) |
| 613 | 613 | update_widget_irq(); |
| r1591 | r1592 | |
| 629 | 629 | |
| 630 | 630 | static void ioasic_irq(int state) |
| 631 | 631 | { |
| 632 | cpunum_set_input_line(0, IOASIC_IRQ_NUM, state); | |
| 632 | cpunum_set_input_line(Machine, 0, IOASIC_IRQ_NUM, state); | |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | |
| r1591 | r1592 | |
| 664 | 664 | |
| 665 | 665 | /* VBLANK: clear anything pending on the old IRQ */ |
| 666 | 666 | if (vblank_irq_num != 0) |
| 667 | cpunum_set_input_line(0, vblank_irq_num, CLEAR_LINE); | |
| 667 | cpunum_set_input_line(Machine, 0, vblank_irq_num, CLEAR_LINE); | |
| 668 | 668 | |
| 669 | 669 | /* VBLANK: compute the new IRQ vector */ |
| 670 | 670 | irq = (*interrupt_config >> (2*VBLANK_IRQ_SHIFT)) & 3; |
| r1591 | r1592 | |
| 675 | 675 | { |
| 676 | 676 | /* Widget: clear anything pending on the old IRQ */ |
| 677 | 677 | if (widget.irq_num != 0) |
| 678 | cpunum_set_input_line(0, widget.irq_num, CLEAR_LINE); | |
| 678 | cpunum_set_input_line(Machine, 0, widget.irq_num, CLEAR_LINE); | |
| 679 | 679 | |
| 680 | 680 | /* Widget: compute the new IRQ vector */ |
| 681 | 681 | irq = (*interrupt_config >> (2*WIDGET_IRQ_SHIFT)) & 3; |
| r1591 | r1592 | |
| 687 | 687 | { |
| 688 | 688 | /* Ethernet: clear anything pending on the old IRQ */ |
| 689 | 689 | if (ethernet_irq_num != 0) |
| 690 | cpunum_set_input_line(0, ethernet_irq_num, CLEAR_LINE); | |
| 690 | cpunum_set_input_line(Machine, 0, ethernet_irq_num, CLEAR_LINE); | |
| 691 | 691 | |
| 692 | 692 | /* Ethernet: compute the new IRQ vector */ |
| 693 | 693 | irq = (*interrupt_config >> (2*ETHERNET_IRQ_SHIFT)) & 3; |
| r1591 | r1592 | |
| 732 | 732 | /* if the VBLANK has been latched, and the interrupt is enabled, assert */ |
| 733 | 733 | if (vblank_latch && (*interrupt_enable & (1 << VBLANK_IRQ_SHIFT))) |
| 734 | 734 | state = ASSERT_LINE; |
| 735 | cpunum_set_input_line(0, vblank_irq_num, state); | |
| 735 | cpunum_set_input_line(Machine, 0, vblank_irq_num, state); | |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | |
| r1591 | r1592 | |
| 893 | 893 | /* if any unmasked interrupts are live, we generate */ |
| 894 | 894 | if (galileo.reg[GREG_INT_STATE] & galileo.reg[GREG_INT_MASK]) |
| 895 | 895 | state = ASSERT_LINE; |
| 896 | cpunum_set_input_line(0, GALILEO_IRQ_NUM, state); | |
| 896 | cpunum_set_input_line(Machine, 0, GALILEO_IRQ_NUM, state); | |
| 897 | 897 | |
| 898 | 898 | if (LOG_GALILEO) |
| 899 | 899 | logerror("Galileo IRQ %s\n", (state == ASSERT_LINE) ? "asserted" : "cleared"); |
| r1591 | r1592 | |
| 1376 | 1376 | |
| 1377 | 1377 | /* resume CPU execution */ |
| 1378 | 1378 | if (LOG_DMA) logerror("Resuming CPU on voodoo\n"); |
| 1379 | cpu_trigger(45678); | |
| 1379 | cpu_trigger(Machine, 45678); | |
| 1380 | 1380 | } |
| 1381 | 1381 | } |
| 1382 | 1382 | } |
| r1591 | r1592 | |
| 1511 | 1511 | |
| 1512 | 1512 | /* update the IRQ state */ |
| 1513 | 1513 | if (widget.irq_num != 0) |
| 1514 | cpunum_set_input_line(0, widget.irq_num, assert ? ASSERT_LINE : CLEAR_LINE); | |
| 1514 | cpunum_set_input_line(Machine, 0, widget.irq_num, assert ? ASSERT_LINE : CLEAR_LINE); | |
| 1515 | 1515 | } |
| 1516 | 1516 | |
| 1517 | 1517 |
| r1591 | r1592 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | static int which; |
| 53 | 53 | which = !which; |
| 54 | if( which ) cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 55 | else if( mnchmobl_nmi_enable ) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 54 | if( which ) cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 55 | else if( mnchmobl_nmi_enable ) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static WRITE8_HANDLER( mnchmobl_soundlatch_w ) |
| 59 | 59 | { |
| 60 | 60 | soundlatch_w( offset, data ); |
| 61 | cpunum_set_input_line( 1, 0, HOLD_LINE ); | |
| 61 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | static WRITE8_HANDLER( sound_nmi_ack_w ) |
| 65 | 65 | { |
| 66 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 66 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | { |
| 68 | 68 | main_to_sound_data = param; |
| 69 | 69 | main_to_sound_ready = 1; |
| 70 | cpu_triggerint(1); | |
| 70 | cpu_triggerint(machine, 1); | |
| 71 | 71 | |
| 72 | 72 | /* use a timer to make long transfers faster */ |
| 73 | 73 | timer_set(ATTOTIME_IN_USEC(50), NULL, 0, 0); |
| r1591 | r1592 | |
| 149 | 149 | sndti_reset(SOUND_BSMT2000, 0); |
| 150 | 150 | |
| 151 | 151 | /* also clears interrupts */ |
| 152 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 152 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 153 | 153 | sound_int_state = data; |
| 154 | 154 | } |
| 155 | 155 |
| r1591 | r1592 | |
|---|---|---|
| 1003 | 1003 | |
| 1004 | 1004 | static TIMER_CALLBACK( rockn_timer_level4_callback ) |
| 1005 | 1005 | { |
| 1006 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1006 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | static TIMER_CALLBACK( rockn_timer_sub_level4_callback ) |
| 1010 | 1010 | { |
| 1011 | cpunum_set_input_line(1, 4, HOLD_LINE); | |
| 1011 | cpunum_set_input_line(machine, 1, 4, HOLD_LINE); | |
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | 1014 | |
| 1015 | 1015 | static TIMER_CALLBACK( rockn_timer_level1_callback ) |
| 1016 | 1016 | { |
| 1017 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 1017 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | 1020 | static TIMER_CALLBACK( rockn_timer_sub_level1_callback ) |
| 1021 | 1021 | { |
| 1022 | cpunum_set_input_line(1, 1, HOLD_LINE); | |
| 1022 | cpunum_set_input_line(machine, 1, 1, HOLD_LINE); | |
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | 1025 | static void init_rockn_timer(running_machine *machine) |
| r1591 | r1592 | |
|---|---|---|
| 231 | 231 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 232 | 232 | static void irqhandler(int irq) |
| 233 | 233 | { |
| 234 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 234 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
| 241 | 241 | |
| 242 | 242 | static INTERRUPT_GEN( lastduel_interrupt ) |
| 243 | 243 | { |
| 244 | if (cpu_getiloops() == 0) cpunum_set_input_line(0, 2, HOLD_LINE); /* VBL */ | |
| 245 | else cpunum_set_input_line(0, 4, HOLD_LINE); /* Controls */ | |
| 244 | if (cpu_getiloops() == 0) | |
| 245 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); /* VBL */ | |
| 246 | else | |
| 247 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); /* Controls */ | |
| 246 | 248 | } |
| 247 | 249 | |
| 248 | 250 | static INTERRUPT_GEN( madgear_interrupt ) |
| 249 | 251 | { |
| 250 | if (cpu_getiloops() == 0) cpunum_set_input_line(0, 5, HOLD_LINE); /* VBL */ | |
| 251 | else cpunum_set_input_line(0, 6, HOLD_LINE); /* Controls */ | |
| 252 | if (cpu_getiloops() == 0) | |
| 253 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); /* VBL */ | |
| 254 | else | |
| 255 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); /* Controls */ | |
| 252 | 256 | } |
| 253 | 257 | |
| 254 | 258 | static MACHINE_DRIVER_START( lastduel ) |
| r1591 | r1592 | |
|---|---|---|
| 336 | 336 | if (ACCESSING_LSB) |
| 337 | 337 | { |
| 338 | 338 | soundlatch_w(0, data); |
| 339 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 339 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 340 | 340 | } |
| 341 | 341 | } |
| 342 | 342 | |
| r1591 | r1592 | |
| 345 | 345 | if (ACCESSING_LSB) |
| 346 | 346 | { |
| 347 | 347 | soundlatch_w(0, data); |
| 348 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 348 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | //ZT |
| r1591 | r1592 | |
| 2030 | 2030 | |
| 2031 | 2031 | static void YM3812_irq(int param) |
| 2032 | 2032 | { |
| 2033 | cpunum_set_input_line(1, 0, (param) ? HOLD_LINE : CLEAR_LINE); | |
| 2033 | cpunum_set_input_line(Machine, 1, 0, (param) ? HOLD_LINE : CLEAR_LINE); | |
| 2034 | 2034 | } |
| 2035 | 2035 | |
| 2036 | 2036 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
| 2041 | 2041 | static INTERRUPT_GEN( alpha68k_interrupt ) |
| 2042 | 2042 | { |
| 2043 | 2043 | if (cpu_getiloops() == 0) |
| 2044 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 2044 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 2045 | 2045 | else |
| 2046 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 2046 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 2047 | 2047 | } |
| 2048 | 2048 | //ZT |
| 2049 | 2049 |
| r1591 | r1592 | |
|---|---|---|
| 24 | 24 | int mask = param; |
| 25 | 25 | |
| 26 | 26 | if (pot_latch & mask) |
| 27 | { | |
| 28 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 29 | } | |
| 27 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 30 | 28 | |
| 31 | 29 | pot_state |= mask; |
| 32 | 30 | } |
| r1591 | r1592 | |
| 36 | 34 | { |
| 37 | 35 | int scanline = param; |
| 38 | 36 | |
| 39 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 37 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 40 | 38 | |
| 41 | 39 | if (scanline == 0) |
| 42 | 40 | { |
| r1591 | r1592 | |
| 156 | 154 | |
| 157 | 155 | pot_latch = data & 0x3f; |
| 158 | 156 | |
| 159 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 157 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 160 | 158 | } |
| 161 | 159 | |
| 162 | 160 | |
| 163 | 161 | static WRITE8_HANDLER( boxer_irq_reset_w ) |
| 164 | 162 | { |
| 165 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 163 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 166 | 164 | } |
| 167 | 165 | |
| 168 | 166 |
| r1591 | r1592 | |
|---|---|---|
| 242 | 242 | { |
| 243 | 243 | case 0x0e: |
| 244 | 244 | tmaster_draw(); |
| 245 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 245 | cpunum_set_input_line(Machine, 0, 2, HOLD_LINE); | |
| 246 | 246 | break; |
| 247 | 247 | } |
| 248 | 248 | } |
| r1591 | r1592 | |
| 344 | 344 | { |
| 345 | 345 | switch (cpu_getiloops()) |
| 346 | 346 | { |
| 347 | case 0: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 348 | case 1: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 347 | case 0: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 348 | case 1: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 349 | 349 | |
| 350 | 350 | case 2: |
| 351 | 351 | case 3: |
| 352 | 352 | case 4: |
| 353 | 353 | case 5: |
| 354 | case 6: cpunum_set_input_line_and_vector(0, 4, HOLD_LINE, 0x100/4); break; // touch screen controller | |
| 354 | case 6: cpunum_set_input_line_and_vector(machine, 0, 4, HOLD_LINE, 0x100/4); break; // touch screen controller | |
| 355 | 355 | |
| 356 | default: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 356 | default: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 357 | 357 | } |
| 358 | 358 | } |
| 359 | 359 | |
| r1591 | r1592 | |
| 389 | 389 | { |
| 390 | 390 | switch (cpu_getiloops()) |
| 391 | 391 | { |
| 392 | case 0: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 393 | case 1: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 394 | case 2: cpunum_set_input_line_and_vector(0, 4, HOLD_LINE, 0x100/4); break; // touch screen controller | |
| 395 | default: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 392 | case 0: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 393 | case 1: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 394 | case 2: cpunum_set_input_line_and_vector(machine, 0, 4, HOLD_LINE, 0x100/4); break; // touch screen controller | |
| 395 | default: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 |
| r1591 | r1592 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | static INTERRUPT_GEN( freekick_irqgen ) |
| 120 | 120 | { |
| 121 | if (nmi_en) cpunum_set_input_line(0,INPUT_LINE_NMI,PULSE_LINE); | |
| 121 | if (nmi_en) cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | static WRITE8_HANDLER(oigas_5_w) |
| r1591 | r1592 | |
|---|---|---|
| 1725 | 1725 | static INTERRUPT_GEN( cischeat_interrupt ) |
| 1726 | 1726 | { |
| 1727 | 1727 | if (cpu_getiloops()==0) |
| 1728 | cpunum_set_input_line(0, 4, HOLD_LINE); /* Once */ | |
| 1728 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); /* Once */ | |
| 1729 | 1729 | else |
| 1730 | 1730 | { |
| 1731 | if (cpu_getiloops()%2) cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 1732 | else cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 1731 | if (cpu_getiloops()%2) cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 1732 | else cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 1733 | 1733 | } |
| 1734 | 1734 | } |
| 1735 | 1735 | |
| r1591 | r1592 | |
| 1880 | 1880 | { |
| 1881 | 1881 | switch ( cpu_getiloops() ) |
| 1882 | 1882 | { |
| 1883 | case 0: cpunum_set_input_line(0, 3, PULSE_LINE); // update palette, layers etc. Not the sprites. | |
| 1884 | case 14: cpunum_set_input_line(0, 2, PULSE_LINE); // "real" vblank. It just sets a flag that | |
| 1883 | case 0: cpunum_set_input_line(machine, 0, 3, PULSE_LINE); // update palette, layers etc. Not the sprites. | |
| 1884 | case 14: cpunum_set_input_line(machine, 0, 2, PULSE_LINE); // "real" vblank. It just sets a flag that | |
| 1885 | 1885 | // the main loop polls before updating the sprites. |
| 1886 | 1886 | } |
| 1887 | 1887 | } |
| r1591 | r1592 | |
| 1931 | 1931 | { |
| 1932 | 1932 | switch ( cpu_getiloops() ) |
| 1933 | 1933 | { |
| 1934 | case 0: cpunum_set_input_line(0, 4, PULSE_LINE); | |
| 1935 | case 14: cpunum_set_input_line(0, 2, PULSE_LINE); | |
| 1934 | case 0: cpunum_set_input_line(machine, 0, 4, PULSE_LINE); | |
| 1935 | case 14: cpunum_set_input_line(machine, 0, 2, PULSE_LINE); | |
| 1936 | 1936 | } |
| 1937 | 1937 | } |
| 1938 | 1938 | |
| r1591 | r1592 | |
| 2687 | 2687 | { |
| 2688 | 2688 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087fff, 0, 0, wildplt_vregs_r ); |
| 2689 | 2689 | |
| 2690 | | |
| 2690 | DRIVER_INIT_CALL(f1gpstar | |
| 2691 | 2691 | } |
| 2692 | 2692 | |
| 2693 | 2693 |
| r1591 | r1592 | |
|---|---|---|
| 372 | 372 | InitDSP( int bSuperSystem22 ) |
| 373 | 373 | { |
| 374 | 374 | mbSuperSystem22 = bSuperSystem22; |
| 375 | cpunum_set_input_line(1,INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */ | |
| 376 | cpunum_set_input_line(2,INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */ | |
| 377 | cpunum_set_input_line(3,INPUT_LINE_RESET,ASSERT_LINE); /* MCU */ | |
| 375 | cpunum_set_input_line(Machine, 1,INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */ | |
| 376 | cpunum_set_input_line(Machine, 2,INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */ | |
| 377 | cpunum_set_input_line(Machine, 3,INPUT_LINE_RESET,ASSERT_LINE); /* MCU */ | |
| 378 | 378 | } /* InitDSP */ |
| 379 | 379 | |
| 380 | 380 | static READ16_HANDLER( pdp_status_r ) |
| r1591 | r1592 | |
| 554 | 554 | |
| 555 | 555 | static void HaltSlaveDSP( void ) |
| 556 | 556 | { |
| 557 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 557 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | static void EnableSlaveDSP( void ) |
| 561 | 561 | { |
| 562 | // cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 562 | // cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | static READ16_HANDLER( dsp_HOLD_signal_r ) |
| r1591 | r1592 | |
| 739 | 739 | |
| 740 | 740 | if( cpu_getiloops()==0 ) |
| 741 | 741 | { |
| 742 | cpunum_set_input_line(1, TMS32025_INT0, HOLD_LINE); | |
| 742 | cpunum_set_input_line(machine, 1, TMS32025_INT0, HOLD_LINE); | |
| 743 | 743 | } |
| 744 | cpunum_set_input_line(1, TMS32025_RINT, HOLD_LINE); | |
| 745 | cpunum_set_input_line(1, TMS32025_XINT, HOLD_LINE); | |
| 746 | cpunum_set_input_line(2, TMS32025_RINT, HOLD_LINE); | |
| 747 | cpunum_set_input_line(2, TMS32025_XINT, HOLD_LINE); | |
| 744 | cpunum_set_input_line(machine, 1, TMS32025_RINT, HOLD_LINE); | |
| 745 | cpunum_set_input_line(machine, 1, TMS32025_XINT, HOLD_LINE); | |
| 746 | cpunum_set_input_line(machine, 2, TMS32025_RINT, HOLD_LINE); | |
| 747 | cpunum_set_input_line(machine, 2, TMS32025_XINT, HOLD_LINE); | |
| 748 | 748 | } |
| 749 | 749 | } |
| 750 | 750 | |
| r1591 | r1592 | |
| 1132 | 1132 | */ |
| 1133 | 1133 | static TIMER_CALLBACK( start_subcpu ) |
| 1134 | 1134 | { |
| 1135 | cpunum_set_input_line(3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1135 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | static WRITE32_HANDLER( namcos22_system_controller_w ) |
| r1591 | r1592 | |
| 1169 | 1169 | { /* SUBCPU enable for Super System 22 */ |
| 1170 | 1170 | if (data) |
| 1171 | 1171 | { |
| 1172 | cpunum_set_input_line(3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1172 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1173 | 1173 | } |
| 1174 | 1174 | else |
| 1175 | 1175 | { |
| 1176 | cpunum_set_input_line(3,INPUT_LINE_RESET,ASSERT_LINE); /* M37710 MCU */ | |
| 1176 | cpunum_set_input_line(Machine, 3,INPUT_LINE_RESET,ASSERT_LINE); /* M37710 MCU */ | |
| 1177 | 1177 | } |
| 1178 | 1178 | } |
| 1179 | 1179 | } |
| r1591 | r1592 | |
| 1195 | 1195 | { |
| 1196 | 1196 | if( newReg == 0 ) |
| 1197 | 1197 | { /* disable DSPs */ |
| 1198 | cpunum_set_input_line(1,INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */ | |
| 1199 | cpunum_set_input_line(2,INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */ | |
| 1198 | cpunum_set_input_line(Machine, 1,INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */ | |
| 1199 | cpunum_set_input_line(Machine, 2,INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */ | |
| 1200 | 1200 | mbEnableDspIrqs = 0; |
| 1201 | 1201 | } |
| 1202 | 1202 | else if( newReg==1 ) |
| 1203 | 1203 | { /*enable dsp and rendering subsystem */ |
| 1204 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1204 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1205 | 1205 | namcos22_enable_slave_simulation(); |
| 1206 | 1206 | mbEnableDspIrqs = 1; |
| 1207 | 1207 | } |
| 1208 | 1208 | else if( newReg==0xff ) |
| 1209 | 1209 | { /* used to upload game-specific code to master/slave dsps */ |
| 1210 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1210 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1211 | 1211 | mbEnableDspIrqs = 0; |
| 1212 | 1212 | } |
| 1213 | 1213 | } |
| r1591 | r1592 | |
| 1230 | 1230 | if( cpu_getiloops() == 0 ) |
| 1231 | 1231 | { |
| 1232 | 1232 | int vblank_level = nthbyte(namcos22_system_controller,0x00)&0x7; /* $700004: ack */ |
| 1233 | cpunum_set_input_line(0, vblank_level, HOLD_LINE); | |
| 1233 | cpunum_set_input_line(machine, 0, vblank_level, HOLD_LINE); | |
| 1234 | 1234 | mFrameCount++; |
| 1235 | 1235 | } |
| 1236 | 1236 | else |
| r1591 | r1592 | |
| 1238 | 1238 | //int scanline_level = nthbyte(namcos22_system_controller,0x01)&0x7; /* $700005: ack */ |
| 1239 | 1239 | //int sci_level = nthbyte(namcos22_system_controller,0x02)&0x7; /* $700006: ack */ |
| 1240 | 1240 | //int unk_irq = nthbyte(namcos22_system_controller,0x03)&0x7; /* $700007: ack */ |
| 1241 | //cpunum_set_input_line(0, sci_level, HOLD_LINE); | |
| 1241 | //cpunum_set_input_line(machine, 0, sci_level, HOLD_LINE); | |
| 1242 | 1242 | } |
| 1243 | 1243 | } |
| 1244 | 1244 | |
| r1591 | r1592 | |
| 1629 | 1629 | int i; |
| 1630 | 1630 | for (i = 0; i < 16; i++) |
| 1631 | 1631 | { |
| 1632 | cpunum_set_input_line(3, M37710_LINE_TIMERA3TICK, PULSE_LINE); | |
| 1632 | cpunum_set_input_line(Machine, 3, M37710_LINE_TIMERA3TICK, PULSE_LINE); | |
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| 1635 | 1635 | |
| r1591 | r1592 | |
| 1786 | 1786 | { |
| 1787 | 1787 | if (cpu_getiloops() == 0) |
| 1788 | 1788 | { |
| 1789 | cpunum_set_input_line(3, M37710_LINE_IRQ0, HOLD_LINE); | |
| 1789 | cpunum_set_input_line(machine, 3, M37710_LINE_IRQ0, HOLD_LINE); | |
| 1790 | 1790 | } |
| 1791 | 1791 | else if (cpu_getiloops() == 1) |
| 1792 | 1792 | { |
| 1793 | cpunum_set_input_line(3, M37710_LINE_IRQ2, HOLD_LINE); | |
| 1793 | cpunum_set_input_line(machine, 3, M37710_LINE_IRQ2, HOLD_LINE); | |
| 1794 | 1794 | } |
| 1795 | 1795 | else |
| 1796 | 1796 | { |
| 1797 | cpunum_set_input_line(3, M37710_LINE_ADC, HOLD_LINE); | |
| 1797 | cpunum_set_input_line(machine, 3, M37710_LINE_ADC, HOLD_LINE); | |
| 1798 | 1798 | } |
| 1799 | 1799 | } |
| 1800 | 1800 | |
| r1591 | r1592 | |
| 2200 | 2200 | case 0: |
| 2201 | 2201 | if( irq_level1 ) |
| 2202 | 2202 | { |
| 2203 | cpunum_set_input_line(0, irq_level1, HOLD_LINE); /* vblank */ | |
| 2203 | cpunum_set_input_line(machine, 0, irq_level1, HOLD_LINE); /* vblank */ | |
| 2204 | 2204 | } |
| 2205 | 2205 | break; |
| 2206 | 2206 | case 1: |
| 2207 | 2207 | if( irq_level2 ) |
| 2208 | 2208 | { |
| 2209 | cpunum_set_input_line(0, irq_level2, HOLD_LINE); /* SCI */ | |
| 2209 | cpunum_set_input_line(machine, 0, irq_level2, HOLD_LINE); /* SCI */ | |
| 2210 | 2210 | } |
| 2211 | 2211 | break; |
| 2212 | 2212 | } |
| r1591 | r1592 | |
|---|---|---|
| 28 | 28 | int potsense = param; |
| 29 | 29 | |
| 30 | 30 | if (potsense & ~flyball_potmask) |
| 31 | { | |
| 32 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 33 | } | |
| 31 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 34 | 32 | |
| 35 | 33 | flyball_potsense |= potsense; |
| 36 | 34 | } |
| r1591 | r1592 | |
|---|---|---|
| 45 | 45 | static INTERRUPT_GEN( redclash_interrupt ) |
| 46 | 46 | { |
| 47 | 47 | if (readinputport(4) & 1) /* Left Coin */ |
| 48 | cpunum_set_input_line(0,0,ASSERT_LINE); | |
| 48 | cpunum_set_input_line(machine, 0,0,ASSERT_LINE); | |
| 49 | 49 | else if (readinputport(4) & 2) /* Right Coin */ |
| 50 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 50 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static WRITE8_HANDLER( irqack_w ) |
| 54 | 54 | { |
| 55 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 55 | cpunum_set_input_line(Machine, 0,0,CLEAR_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 |
| r1591 | r1592 | |
|---|---|---|
| 92 | 92 | coin_counter_w(0, 1); |
| 93 | 93 | coin_counter_w(0, 0); |
| 94 | 94 | |
| 95 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 95 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 96 | 96 | |
| 97 | 97 | /* simulate the coin switch being closed for a while */ |
| 98 | 98 | timer_set(double_to_attotime(4 * attotime_to_double(video_screen_get_frame_period(0))), NULL, 0, clear_coin_status); |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | * |
| 31 | 31 | *************************************/ |
| 32 | 32 | |
| 33 | static void update_interrupts( | |
| 33 | static void update_interrupts(running_machine *machine) | |
| 34 | 34 | { |
| 35 | 35 | int newstate = 0; |
| 36 | 36 | |
| r1591 | r1592 | |
| 40 | 40 | newstate = 2; |
| 41 | 41 | |
| 42 | 42 | if (newstate) |
| 43 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 43 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 44 | 44 | else |
| 45 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 |
| r1591 | r1592 | |
|---|---|---|
| 250 | 250 | |
| 251 | 251 | static INTERRUPT_GEN( irq4_gen ) |
| 252 | 252 | { |
| 253 | cpunum_set_input_line(1, R3000_IRQ4, ASSERT_LINE); | |
| 253 | cpunum_set_input_line(machine, 1, R3000_IRQ4, ASSERT_LINE); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | static const struct r3000_config config = |
| r1591 | r1592 | |
|---|---|---|
| 947 | 947 | |
| 948 | 948 | /* user asks to insert coin: generate a NMI interrupt. */ |
| 949 | 949 | if (val & 0x01) |
| 950 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 950 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 951 | 951 | } |
| 952 | 952 | else |
| 953 | cpunum_set_input_line(0, M6502_IRQ_LINE, HOLD_LINE); /* one IRQ per frame */ | |
| 953 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, HOLD_LINE); /* one IRQ per frame */ | |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | 956 | static INTERRUPT_GEN( rockola_interrupt ) |
| r1591 | r1592 | |
| 964 | 964 | |
| 965 | 965 | /* user asks to insert coin: generate a NMI interrupt. */ |
| 966 | 966 | if (val & 0x03) |
| 967 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 967 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 968 | 968 | } |
| 969 | 969 | else |
| 970 | cpunum_set_input_line(0, M6502_IRQ_LINE, HOLD_LINE); /* one IRQ per frame */ | |
| 970 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, HOLD_LINE); /* one IRQ per frame */ | |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | /* Machine Initialization */ |
| r1591 | r1592 | |
|---|---|---|
| 449 | 449 | |
| 450 | 450 | /* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */ |
| 451 | 451 | if (scanline & 16) |
| 452 | cpunum_set_input_line(0, 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 452 | cpunum_set_input_line(machine, 0, 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 453 | 453 | |
| 454 | 454 | /* do a partial update now to handle sprite multiplexing (Maze Invaders) */ |
| 455 | 455 | video_screen_update_partial(0, scanline); |
| r1591 | r1592 | |
| 475 | 475 | { |
| 476 | 476 | interrupt_timer = timer_alloc(generate_interrupt, NULL); |
| 477 | 477 | timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 478 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 478 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 479 | 479 | dsw_select = 0; |
| 480 | 480 | control_select = 0; |
| 481 | 481 | } |
| r1591 | r1592 | |
| 483 | 483 | |
| 484 | 484 | static MACHINE_RESET( magworm ) |
| 485 | 485 | { |
| 486 | | |
| 486 | MACHINE_RESET_CALL(centiped | |
| 487 | 487 | |
| 488 | 488 | /* kludge: clear RAM so that magworm can be reset cleanly */ |
| 489 | 489 | memset(rambase, 0, 0x400); |
| r1591 | r1592 | |
| 492 | 492 | |
| 493 | 493 | static WRITE8_HANDLER( irq_ack_w ) |
| 494 | 494 | { |
| 495 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 495 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 |
| r1591 | r1592 | |
|---|---|---|
| 152 | 152 | * |
| 153 | 153 | *************************************/ |
| 154 | 154 | |
| 155 | static void update_interrupts( | |
| 155 | static void update_interrupts(running_machine *machine) | |
| 156 | 156 | { |
| 157 | 157 | int newstate = 0; |
| 158 | 158 | |
| r1591 | r1592 | |
| 168 | 168 | |
| 169 | 169 | /* set the new state of the IRQ lines */ |
| 170 | 170 | if (newstate) |
| 171 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 171 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 172 | 172 | else |
| 173 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 173 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 |
| r1591 | r1592 | |
|---|---|---|
| 437 | 437 | /* bit 0 enables cpu B */ |
| 438 | 438 | /* however this fails when recovering from a save state |
| 439 | 439 | if cpu B is disabled !! */ |
| 440 | cpunum_set_input_line(2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 440 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 441 | 441 | |
| 442 | 442 | /* bit 1 is "vibration" acc. to test mode */ |
| 443 | 443 | } |
| r1591 | r1592 | |
| 463 | 463 | /* |
| 464 | 464 | static TIMER_CALLBACK( wgp_interrupt4 ) |
| 465 | 465 | { |
| 466 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 466 | cpunum_set_input_line(machine, 0,4,HOLD_LINE); | |
| 467 | 467 | } |
| 468 | 468 | */ |
| 469 | 469 | |
| 470 | 470 | static TIMER_CALLBACK( wgp_interrupt6 ) |
| 471 | 471 | { |
| 472 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 472 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | /* 68000 B */ |
| 476 | 476 | |
| 477 | 477 | static TIMER_CALLBACK( wgp_cpub_interrupt6 ) |
| 478 | 478 | { |
| 479 | cpunum_set_input_line(2,6,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 479 | cpunum_set_input_line(machine, 2,6,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | |
| r1591 | r1592 | |
| 489 | 489 | static INTERRUPT_GEN( wgp_cpub_interrupt ) |
| 490 | 490 | { |
| 491 | 491 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, wgp_cpub_interrupt6); |
| 492 | cpunum_set_input_line(2, 4, HOLD_LINE); | |
| 492 | cpunum_set_input_line(machine, 2, 4, HOLD_LINE); | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
| r1591 | r1592 | |
| 665 | 665 | AM_RANGE(0x500000, 0x501fff) AM_READ(MRA16_RAM) /* unknown/unused */ |
| 666 | 666 | AM_RANGE(0x502000, 0x517fff) AM_READ(wgp_pivram_word_r) /* piv tilemaps */ |
| 667 | 667 | AM_RANGE(0x520000, 0x52001f) AM_READ(wgp_piv_ctrl_word_r) |
| 668 | AM_RANGE(0x700000, 0x701fff) AM_READ( | |
| 668 | AM_RANGE(0x700000, 0x701fff) AM_READ(MRA | |
| 669 | 669 | ADDRESS_MAP_END |
| 670 | 670 | |
| 671 | 671 | static ADDRESS_MAP_START( wgp_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 948 | 948 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 949 | 949 | static void irqhandler(int irq) // assumes Z80 sandwiched between 68Ks |
| 950 | 950 | { |
| 951 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 951 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 125 | 125 | bankaddress = 0x10000 + (data & 0x03) * 0x10000; |
| 126 | 126 | memory_set_bankptr(1,&ROM[bankaddress]); |
| 127 | 127 | |
| 128 | cpunum_set_input_line(0, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 129 | cpunum_set_input_line(1, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 128 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 129 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /* |
| r1591 | r1592 | |
|---|---|---|
| 347 | 347 | { |
| 348 | 348 | pending_command = 1; |
| 349 | 349 | soundlatch_w(0, data & 0xff); |
| 350 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 350 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 351 | 351 | } |
| 352 | 352 | } |
| 353 | 353 | |
| r1591 | r1592 | |
| 717 | 717 | |
| 718 | 718 | static void irqhandler(int irq) |
| 719 | 719 | { |
| 720 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 720 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | if (collision_reset == 0) |
| 20 | 20 | { |
| 21 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 21 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 22 | 22 | |
| 23 | 23 | collision_index = n; |
| 24 | 24 | } |
| r1591 | r1592 | |
| 161 | 161 | collision_reset = !(data & 1); |
| 162 | 162 | |
| 163 | 163 | if (collision_reset) |
| 164 | { | |
| 165 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 166 | } | |
| 164 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 167 | 165 | } |
| 168 | 166 | |
| 169 | 167 |
| r1591 | r1592 | |
|---|---|---|
| 426 | 426 | { |
| 427 | 427 | if(nmi_sub) |
| 428 | 428 | { |
| 429 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 429 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | 432 | |
| r1591 | r1592 | |
| 434 | 434 | { |
| 435 | 435 | if (nmi_main) |
| 436 | 436 | { |
| 437 | cpunum_set_input_line(0,INPUT_LINE_NMI,PULSE_LINE); | |
| 437 | cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE); | |
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | if (ACCESSING_LSB) |
| 68 | 68 | { |
| 69 | 69 | soundlatch_w(0,data & 0xff); |
| 70 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 70 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 71 | 71 | } |
| 72 | 72 | break; |
| 73 | 73 | |
| r1591 | r1592 | |
| 103 | 103 | if (ACCESSING_LSB) |
| 104 | 104 | { |
| 105 | 105 | soundlatch_w(0,data & 0xff); |
| 106 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 106 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 107 | 107 | } |
| 108 | 108 | break; |
| 109 | 109 | case 2: |
| r1591 | r1592 | |
| 117 | 117 | if (ACCESSING_LSB) |
| 118 | 118 | { |
| 119 | 119 | soundlatch_w(0,data & 0xff); |
| 120 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 120 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| r1591 | r1592 | |
| 904 | 904 | |
| 905 | 905 | static void sound_irq(int linestate) |
| 906 | 906 | { |
| 907 | cpunum_set_input_line(1,0,linestate); /* IRQ */ | |
| 907 | cpunum_set_input_line(Machine, 1,0,linestate); /* IRQ */ | |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | static void sound_irq2(int linestate) |
| 911 | 911 | { |
| 912 | cpunum_set_input_line(1,1,linestate); /* IRQ2 */ | |
| 912 | cpunum_set_input_line(Machine, 1,1,linestate); /* IRQ2 */ | |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
| 1198 | 1198 | MDRV_CPU_VBLANK_INT(irq6_line_hold,1)/* VBL */ |
| 1199 | 1199 | |
| 1200 | 1200 | MDRV_CPU_ADD(H6280, XTAL_12MHz/2/3) |
| 1201 | /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, | |
| 1201 | /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verif | |
| 1202 | 1202 | MDRV_CPU_PROGRAM_MAP(slyspy_s_readmem,slyspy_s_writemem) |
| 1203 | 1203 | |
| 1204 | 1204 | MDRV_SCREEN_REFRESH_RATE(57.41) |
| r1591 | r1592 | |
| 1241 | 1241 | MDRV_CPU_VBLANK_INT(irq6_line_hold,1)/* VBL */ |
| 1242 | 1242 | |
| 1243 | 1243 | MDRV_CPU_ADD(H6280, XTAL_24MHz/4/3) |
| 1244 | /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, | |
| 1244 | /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verif | |
| 1245 | 1245 | MDRV_CPU_PROGRAM_MAP(midres_s_readmem,midres_s_writemem) |
| 1246 | 1246 | |
| 1247 | 1247 | MDRV_SCREEN_REFRESH_RATE(57.41) |
| r1591 | r1592 | |
|---|---|---|
| 202 | 202 | /* Update the IRQ state based on all possible causes */ |
| 203 | 203 | static void update_irq_state(void) |
| 204 | 204 | { |
| 205 | cpunum_set_input_line(0, 0, (requested_int & irq_enable)? ASSERT_LINE : CLEAR_LINE); | |
| 205 | cpunum_set_input_line(Machine, 0, 0, (requested_int & irq_enable)? ASSERT_LINE : CLEAR_LINE); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | static int ssv_irq_callback(int level) |
| r1591 | r1592 | |
|---|---|---|
| 246 | 246 | |
| 247 | 247 | dsp_HOLD_signal = (data & 4) ? CLEAR_LINE : ASSERT_LINE; |
| 248 | 248 | |
| 249 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 249 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 250 | 250 | |
| 251 | 251 | logerror("68K:%06x writing %04x to TMS32025. %s HOLD , %s RESET\n",activecpu_get_previouspc(),data,((data & 4) ? "Clear" : "Assert"),((data & 1) ? "Clear" : "Assert")); |
| 252 | 252 | } |
| r1591 | r1592 | |
| 374 | 374 | AM_RANGE(0x140000, 0x140001) AM_WRITE(system_control_w) /* Pause the TMS32025 */ |
| 375 | 375 | AM_RANGE(0x180000, 0x183fff) AM_RAM /* "gradiation ram (0)" */ |
| 376 | 376 | AM_RANGE(0x184000, 0x187fff) AM_RAM /* "gradiation ram (1)" */ |
| 377 | AM_RANGE(0x188000, 0x18bfff) AM_READWRITE( | |
| 377 | AM_RANGE(0x188000, 0x18bfff) AM_READWRITE(MRA | |
| 378 | 378 | AM_RANGE(0x800000, 0x820fff) AM_READWRITE(TC0080VCO_word_r, TC0080VCO_word_w) /* tilemaps, sprites */ |
| 379 | 379 | AM_RANGE(0x908000, 0x90ffff) AM_RAM AM_BASE(&taitoair_line_ram) /* "line ram" */ |
| 380 | 380 | AM_RANGE(0x910000, 0x91ffff) AM_RAM AM_BASE(&dsp_ram) /* "dsp common ram" (TMS320C25) */ |
| r1591 | r1592 | |
| 572 | 572 | /* Handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 573 | 573 | static void irqhandler(int irq) |
| 574 | 574 | { |
| 575 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 575 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | static const struct YM2610interface airsys_ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 49 | 49 | * |
| 50 | 50 | *************************************/ |
| 51 | 51 | |
| 52 | static void update_interrupts( | |
| 52 | static void update_interrupts(running_machine *machine) | |
| 53 | 53 | { |
| 54 | 54 | int newstate = 0; |
| 55 | 55 | |
| r1591 | r1592 | |
| 59 | 59 | newstate = 5; |
| 60 | 60 | |
| 61 | 61 | if (newstate) |
| 62 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 62 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 63 | 63 | else |
| 64 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 64 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| r1591 | r1592 | |
| 119 | 119 | if (ACCESSING_LSB) |
| 120 | 120 | { |
| 121 | 121 | /* bit 4 resets the sound CPU */ |
| 122 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 122 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 123 | 123 | if (!(data & 0x10)) atarijsa_reset(); |
| 124 | 124 | |
| 125 | 125 | /* bit 5 is /XRESET, probably related to the ASIC */ |
| r1591 | r1592 | |
|---|---|---|
| 62 | 62 | static INTERRUPT_GEN( m6809_vb_interrupt ) |
| 63 | 63 | { |
| 64 | 64 | if (m6809_irq_enable) |
| 65 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 65 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 66 | 66 | else |
| 67 | 67 | m6809_irq_enable = 1; |
| 68 | 68 | } |
| r1591 | r1592 | |
| 81 | 81 | static INTERRUPT_GEN( m68k_vb_interrupt ) |
| 82 | 82 | { |
| 83 | 83 | if (m68k_irq_enable) |
| 84 | cpunum_set_input_line(3, MC68000_IRQ_1, HOLD_LINE); | |
| 84 | cpunum_set_input_line(machine, 3, MC68000_IRQ_1, HOLD_LINE); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE16_HANDLER( m68k_irq_enable_w ) |
| r1591 | r1592 | |
| 93 | 93 | static INTERRUPT_GEN( mcu_vb_interrupt ) |
| 94 | 94 | { |
| 95 | 95 | if (mcu_irq_enable) |
| 96 | cpunum_set_input_line(4, 0, HOLD_LINE); | |
| 96 | cpunum_set_input_line(machine, 4, 0, HOLD_LINE); | |
| 97 | 97 | else |
| 98 | 98 | mcu_irq_enable = 1; |
| 99 | 99 | } |
| r1591 | r1592 | |
| 447 | 447 | MDRV_CPU_PROGRAM_MAP(m68k_map,0) |
| 448 | 448 | MDRV_CPU_VBLANK_INT(m68k_vb_interrupt,1) |
| 449 | 449 | |
| 450 | MDRV_CPU_ADD(HD63701, 49152000/ | |
| 450 | MDRV_CPU_ADD(HD63701, 49152000/8 | |
| 451 | 451 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 452 | 452 | MDRV_CPU_IO_MAP(mcu_io_map,0) |
| 453 | 453 | MDRV_CPU_VBLANK_INT(mcu_vb_interrupt,1) |
| r1591 | r1592 | |
|---|---|---|
| 69 | 69 | static WRITE8_HANDLER( cop01_sound_command_w ) |
| 70 | 70 | { |
| 71 | 71 | soundlatch_w(offset,data); |
| 72 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 72 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static READ8_HANDLER( cop01_sound_command_r ) |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | * |
| 31 | 31 | *************************************/ |
| 32 | 32 | |
| 33 | static void update_interrupts( | |
| 33 | static void update_interrupts(running_machine *machine) | |
| 34 | 34 | { |
| 35 | 35 | int newstate = 0; |
| 36 | 36 | |
| r1591 | r1592 | |
| 40 | 40 | newstate |= 6; |
| 41 | 41 | |
| 42 | 42 | if (newstate) |
| 43 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 43 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 44 | 44 | else |
| 45 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 |
| r1591 | r1592 | |
|---|---|---|
| 223 | 223 | { |
| 224 | 224 | ROC10937_reset(0); // reset display1 |
| 225 | 225 | |
| 226 | // cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 226 | // cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 227 | 227 | mpu4_stepper_reset(); |
| 228 | 228 | |
| 229 | 229 | lamp_strobe = 0; |
| r1591 | r1592 | |
| 275 | 275 | if (newstate) |
| 276 | 276 | { |
| 277 | 277 | LOGSTUFF(("68k IRQ, %x\n", newstate)); |
| 278 | cpunum_set_input_line(1, newstate, ASSERT_LINE); | |
| 278 | cpunum_set_input_line(Machine, 1, newstate, ASSERT_LINE); | |
| 279 | 279 | } |
| 280 | 280 | else |
| 281 | 281 | { |
| 282 | 282 | LOGSTUFF(("68k IRQ Clear, %x\n", newstate)); |
| 283 | cpunum_set_input_line(1, 7, CLEAR_LINE); | |
| 283 | cpunum_set_input_line(Machine, 1, 7, CLEAR_LINE); | |
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
| r1591 | r1592 | |
| 292 | 292 | static void m6809_acia_irq(int state) |
| 293 | 293 | { |
| 294 | 294 | m68k_acia_cts = state; |
| 295 | cpunum_set_input_line(0, M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); | |
| 295 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | static void m68k_acia_irq(int state) |
| r1591 | r1592 | |
|---|---|---|
| 102 | 102 | // popmessage("sound write %04x",data); |
| 103 | 103 | |
| 104 | 104 | soundlatch_w(1,data&0xff); |
| 105 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 105 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | static WRITE8_HANDLER( aquarium_z80_bank_w ) |
| r1591 | r1592 | |
| 355 | 355 | |
| 356 | 356 | static void irq_handler(int irq) |
| 357 | 357 | { |
| 358 | cpunum_set_input_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 358 | cpunum_set_input_line(Machine, 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 166 | 166 | { |
| 167 | 167 | if (irq & (1 << i)) |
| 168 | 168 | { |
| 169 | cpunum_set_input_line(0, metro_irq_levels[i]&7, ASSERT_LINE); | |
| 169 | cpunum_set_input_line(Machine, 0, metro_irq_levels[i]&7, ASSERT_LINE); | |
| 170 | 170 | return; |
| 171 | 171 | } |
| 172 | 172 | i++; |
| 173 | 173 | } |
| 174 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 174 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 175 | 175 | } |
| 176 | 176 | else |
| 177 | 177 | { |
| r1591 | r1592 | |
| 180 | 180 | source by peeking a register (metro_irq_cause_r) */ |
| 181 | 181 | |
| 182 | 182 | int state = (irq ? ASSERT_LINE : CLEAR_LINE); |
| 183 | cpunum_set_input_line(0, irq_line, state); | |
| 183 | cpunum_set_input_line(Machine, 0, irq_line, state); | |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| r1591 | r1592 | |
| 319 | 319 | |
| 320 | 320 | static void ymf278b_interrupt(int active) |
| 321 | 321 | { |
| 322 | cpunum_set_input_line(0, 2, active); | |
| 322 | cpunum_set_input_line(Machine, 0, 2, active); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /*************************************************************************** |
| r1591 | r1592 | |
| 356 | 356 | if (ACCESSING_LSB) |
| 357 | 357 | { |
| 358 | 358 | soundlatch_w(0,data & 0xff); |
| 359 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 359 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 360 | 360 | cpu_spinuntil_int(); |
| 361 | 361 | busy_sndcpu = 1; |
| 362 | 362 | } |
| r1591 | r1592 | |
| 514 | 514 | |
| 515 | 515 | static void metro_sound_irq_handler(int state) |
| 516 | 516 | { |
| 517 | cpunum_set_input_line(1, UPD7810_INTF2, state ? ASSERT_LINE : CLEAR_LINE); | |
| 517 | cpunum_set_input_line(Machine, 1, UPD7810_INTF2, state ? ASSERT_LINE : CLEAR_LINE); | |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 1925 | 1925 | static WRITE16_HANDLER( blzntrnd_sound_w ) |
| 1926 | 1926 | { |
| 1927 | 1927 | soundlatch_w(offset, data>>8); |
| 1928 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1928 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1929 | 1929 | } |
| 1930 | 1930 | |
| 1931 | 1931 | static WRITE8_HANDLER( blzntrnd_sh_bankswitch_w ) |
| r1591 | r1592 | |
| 1939 | 1939 | |
| 1940 | 1940 | static void blzntrnd_irqhandler(int irq) |
| 1941 | 1941 | { |
| 1942 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1942 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | 1945 | static const struct YM2610interface blzntrnd_ym2610_interface = |
| r1591 | r1592 | |
| 4562 | 4562 | for (i = 0;i < (0x20000*3)/2;i++) |
| 4563 | 4563 | RAM[i] = mame_rand(machine); |
| 4564 | 4564 | |
| 4565 | | |
| 4565 | DRIVER_INIT_CALL(metro | |
| 4566 | 4566 | } |
| 4567 | 4567 | |
| 4568 | 4568 | static DRIVER_INIT( daitorid ) |
| r1591 | r1592 | |
| 4618 | 4618 | src[i+3] = dat; |
| 4619 | 4619 | } |
| 4620 | 4620 | |
| 4621 | | |
| 4621 | DRIVER_INIT_CALL(metro | |
| 4622 | 4622 | } |
| 4623 | 4623 | |
| 4624 | 4624 | static DRIVER_INIT( blzntrnd ) |
| r1591 | r1592 | |
|---|---|---|
| 562 | 562 | |
| 563 | 563 | static void irqhandler(int irq) |
| 564 | 564 | { |
| 565 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 565 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 106 | 106 | static WRITE8_HANDLER( jrpacman_interrupt_vector_w ) |
| 107 | 107 | { |
| 108 | 108 | cpunum_set_input_line_vector(0, 0, data); |
| 109 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 109 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 |
| r1591 | r1592 | |
|---|---|---|
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | |
| 320 | | |
| 320 | DRIVER_INIT_CALL(genesis | |
| 321 | 321 | |
| 322 | 322 | } |
| 323 | 323 |
| r1591 | r1592 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | static WRITE8_HANDLER( circusc_sh_irqtrigger_w ) |
| 73 | 73 | { |
| 74 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 74 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static WRITE8_HANDLER( circusc_coin_counter_w ) |
| r1591 | r1592 | |
|---|---|---|
| 121 | 121 | static INTERRUPT_GEN( laserbas_interrupt ) |
| 122 | 122 | { |
| 123 | 123 | if(video_screen_get_vblank(0)) |
| 124 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 124 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 125 | 125 | else |
| 126 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 126 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | static MACHINE_DRIVER_START( laserbas ) |
| r1591 | r1592 | |
|---|---|---|
| 49 | 49 | if (last == 0 && data == 1) |
| 50 | 50 | { |
| 51 | 51 | // setting bit 0 low then high triggers IRQ on the sound CPU |
| 52 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0xff); | |
| 52 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | last = data; |
| r1591 | r1592 | |
|---|---|---|
| 146 | 146 | { |
| 147 | 147 | if (!(control_data & 0x40)) |
| 148 | 148 | { |
| 149 | cpunum_set_input_line(0, 3, CLEAR_LINE); | |
| 149 | cpunum_set_input_line(Machine, 0, 3, CLEAR_LINE); | |
| 150 | 150 | return adc_data << adc_shift; |
| 151 | 151 | } |
| 152 | 152 | else |
| r1591 | r1592 | |
| 157 | 157 | |
| 158 | 158 | static TIMER_CALLBACK( adc_ready ) |
| 159 | 159 | { |
| 160 | cpunum_set_input_line(0, 3, ASSERT_LINE); | |
| 160 | cpunum_set_input_line(machine, 0, 3, ASSERT_LINE); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 |
| r1591 | r1592 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | static void vdp_interrupt (int state) |
| 134 | 134 | { |
| 135 | cpunum_set_input_line(0,0, HOLD_LINE); | |
| 135 | cpunum_set_input_line(Machine, 0,0, HOLD_LINE); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static const TMS9928a_interface tms9928a_interface = |
| r1591 | r1592 | |
|---|---|---|
| 273 | 273 | { |
| 274 | 274 | if( namcond1_h8_irq5_enabled ) |
| 275 | 275 | { |
| 276 | cpunum_set_input_line(1, H8_IRQ5, PULSE_LINE); | |
| 276 | cpunum_set_input_line(machine, 1, H8_IRQ5, PULSE_LINE); | |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 |
| r1591 | r1592 | |
|---|---|---|
| 194 | 194 | AM_RANGE(0x0f0000, 0x0f07ff) AM_MIRROR(0xf000) AM_READ(opwolf_cchip_data_r) |
| 195 | 195 | AM_RANGE(0x0f0802, 0x0f0803) AM_MIRROR(0xf000) AM_READ(opwolf_cchip_status_r) |
| 196 | 196 | AM_RANGE(0x100000, 0x107fff) AM_READ(MRA16_RAM) /* RAM */ |
| 197 | AM_RANGE(0x200000, 0x200fff) AM_READ( | |
| 197 | AM_RANGE(0x200000, 0x200fff) AM_READ(MRA | |
| 198 | 198 | AM_RANGE(0x380000, 0x380003) AM_READ(opwolf_dsw_r) /* dip switches */ |
| 199 | 199 | AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r) /* lightgun, read at $11e0/6 */ |
| 200 | 200 | AM_RANGE(0x3e0000, 0x3e0001) AM_READ(MRA16_NOP) |
| r1591 | r1592 | |
| 228 | 228 | AM_RANGE(0x0f0008, 0x0f000b) AM_READ(opwolf_in_r) /* coins and buttons */ |
| 229 | 229 | AM_RANGE(0x0ff000, 0x0fffff) AM_READ(cchip_r) |
| 230 | 230 | AM_RANGE(0x100000, 0x107fff) AM_READ(MRA16_RAM) /* RAM */ |
| 231 | AM_RANGE(0x200000, 0x200fff) AM_READ( | |
| 231 | AM_RANGE(0x200000, 0x200fff) AM_READ(MRA | |
| 232 | 232 | AM_RANGE(0x380000, 0x380003) AM_READ(opwolf_dsw_r) /* dip switches */ |
| 233 | 233 | AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r) /* lightgun, read at $11e0/6 */ |
| 234 | 234 | AM_RANGE(0x3e0000, 0x3e0001) AM_READ(MRA16_NOP) |
| r1591 | r1592 | |
| 538 | 538 | |
| 539 | 539 | static void irq_handler(int irq) |
| 540 | 540 | { |
| 541 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 541 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 |
| r1591 | r1592 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | static INTERRUPT_GEN( surpratk_interrupt ) |
| 27 | 27 | { |
| 28 | if (K052109_is_IRQ_enabled()) cpunum_set_input_line(0,0,HOLD_LINE); | |
| 28 | if (K052109_is_IRQ_enabled()) cpunum_set_input_line(machine, 0,0,HOLD_LINE); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | static READ8_HANDLER( bankedram_r ) |
| r1591 | r1592 | |
| 33 | 33 | if (videobank & 0x02) |
| 34 | 34 | { |
| 35 | 35 | if (videobank & 0x04) |
| 36 | return paletteram | |
| 36 | return paletteram[ | |
| 37 | 37 | else |
| 38 | return paletteram | |
| 38 | return paletteram[ | |
| 39 | 39 | } |
| 40 | 40 | else if (videobank & 0x01) |
| 41 | 41 | return K053245_r(offset); |
| r1591 | r1592 | |
| 223 | 223 | |
| 224 | 224 | static void irqhandler(int linestate) |
| 225 | 225 | { |
| 226 | cpunum_set_input_line(0,KONAMI_FIRQ_LINE,linestate); | |
| 226 | cpunum_set_input_line(Machine, 0,KONAMI_FIRQ_LINE,linestate); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 837 | 837 | { |
| 838 | 838 | switch (cpu_getiloops()) |
| 839 | 839 | { |
| 840 | case 0: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 841 | case 1: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 840 | case 0: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 841 | case 1: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 842 | 842 | } |
| 843 | 843 | } |
| 844 | 844 | |
| r1591 | r1592 | |
| 1008 | 1008 | |
| 1009 | 1009 | static void bestbest_ym3526_irqhandler(int state) |
| 1010 | 1010 | { |
| 1011 | cpunum_set_input_line(1, INPUT_LINE_IRQ0, state); | |
| 1011 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, state); | |
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | 1014 | static const struct YM3526interface bestbest_ym3526_interface = |
| r1591 | r1592 | |
|---|---|---|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| 102 | static void zaccaria_irq0a(int state) { cpunum_set_input_line(1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); } | |
| 103 | static void zaccaria_irq0b(int state) { cpunum_set_input_line(1,0,state ? ASSERT_LINE : CLEAR_LINE); } | |
| 102 | static void zaccaria_irq0a(int state) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); } | |
| 103 | static void zaccaria_irq0b(int state) { cpunum_set_input_line(Machine, 1,0,state ? ASSERT_LINE : CLEAR_LINE); } | |
| 104 | 104 | |
| 105 | 105 | static int active_8910,port0a,acs; |
| 106 | 106 | |
| r1591 | r1592 | |
| 257 | 257 | static WRITE8_HANDLER( sound_command_w ) |
| 258 | 258 | { |
| 259 | 259 | soundlatch_w(0,data); |
| 260 | cpunum_set_input_line(2,0,(data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 260 | cpunum_set_input_line(Machine, 2,0,(data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | static WRITE8_HANDLER( sound1_command_w ) |
| r1591 | r1592 | |
| 663 | 663 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 664 | 664 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) |
| 665 | 665 | |
| 666 | MDRV_CPU_ADD(M6802,XTAL_3_579545MHz/4) /* verified on pcb */ | |
| 667 | /* audio CPU */ | |
| 666 | MDRV_CPU_ADD(M6802,XTAL_3_579545MHz) /* verified on pcb */ | |
| 668 | 667 | MDRV_CPU_PROGRAM_MAP(sound_readmem1,sound_writemem1) |
| 669 | 668 | MDRV_CPU_PERIODIC_INT(zaccaria_cb1_toggle,(double)3580000/4096) |
| 670 | 669 | |
| 671 | MDRV_CPU_ADD(M6802,XTAL_3_579545MHz/4) /* verified on pcb */ | |
| 672 | /* audio CPU */ | |
| 670 | MDRV_CPU_ADD(M6802,XTAL_3_579545MHz) /* verified on pcb */ | |
| 673 | 671 | MDRV_CPU_PROGRAM_MAP(sound_readmem2,sound_writemem2) |
| 674 | 672 | |
| 675 | 673 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
|---|---|---|
| 212 | 212 | if (ACCESSING_MSB) |
| 213 | 213 | { |
| 214 | 214 | soundlatch_w(1,data >> 8); |
| 215 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 215 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 216 | 216 | } |
| 217 | 217 | else |
| 218 | 218 | { |
| r1591 | r1592 | |
| 533 | 533 | |
| 534 | 534 | static void irq_handler(int irq) |
| 535 | 535 | { |
| 536 | cpunum_set_input_line( 1, 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 536 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 543 | 543 | |
| 544 | 544 | static INTERRUPT_GEN( shadfrce_interrupt ) { |
| 545 | 545 | if( cpu_getiloops() == 0 ) |
| 546 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 546 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 547 | 547 | else |
| 548 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 548 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 |
| r1591 | r1592 | |
|---|---|---|
| 374 | 374 | MDRV_PALETTE_LENGTH(256) |
| 375 | 375 | |
| 376 | 376 | // MDRV_PALETTE_INIT(littlerb) |
| 377 | MDRV_VIDEO_START(generic_bitmapped) | |
| 378 | 377 | MDRV_VIDEO_UPDATE(littlerb) |
| 379 | 378 | MACHINE_DRIVER_END |
| 380 | 379 |
| r1591 | r1592 | |
|---|---|---|
| 847 | 847 | |
| 848 | 848 | static void atapi_cause_irq(void) |
| 849 | 849 | { |
| 850 | cpunum_set_input_line(0, INPUT_LINE_IRQ4, ASSERT_LINE); | |
| 850 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ4, ASSERT_LINE); | |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | static void atapi_exit(running_machine* machine) |
| r1591 | r1592 | |
| 1260 | 1260 | static void comm_uart_irq_callback(int channel, int value) |
| 1261 | 1261 | { |
| 1262 | 1262 | // TODO |
| 1263 | //cpunum_set_input_line(0, INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 1263 | //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ2, ASSERT_LINE); | |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | /*****************************************************************************/ |
| r1591 | r1592 | |
| 1416 | 1416 | if ((extend_board_irq_enable & 0x02) == 0) |
| 1417 | 1417 | { |
| 1418 | 1418 | extend_board_irq_active |= 0x02; |
| 1419 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 1419 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 1420 | 1420 | } |
| 1421 | 1421 | } |
| 1422 | 1422 | else |
| r1591 | r1592 | |
| 1424 | 1424 | if ((extend_board_irq_enable & 0x01) == 0) |
| 1425 | 1425 | { |
| 1426 | 1426 | extend_board_irq_active |= 0x01; |
| 1427 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 1427 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE); | |
| 1428 | 1428 | } |
| 1429 | 1429 | } |
| 1430 | 1430 | } |
| r1591 | r1592 | |
| 1962 | 1962 | // IRQ 2: Main board UART |
| 1963 | 1963 | // IRQ 4: ATAPI |
| 1964 | 1964 | |
| 1965 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 1965 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 1966 | 1966 | } |
| 1967 | 1967 | |
| 1968 | 1968 | static MACHINE_RESET( firebeat ) |
| r1591 | r1592 | |
|---|---|---|
| 46 | 46 | static WRITE8_HANDLER( sound_command_w ) |
| 47 | 47 | { |
| 48 | 48 | soundlatch_w(offset,data); |
| 49 | cpunum_set_input_line(1,M6502_IRQ_LINE,HOLD_LINE); | |
| 49 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r1591 | r1592 | |
| 106 | 106 | if (coin == 0) |
| 107 | 107 | { |
| 108 | 108 | coin = 1; |
| 109 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 109 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | else coin = 0; |
| r1591 | r1592 | |
|---|---|---|
| 141 | 141 | |
| 142 | 142 | static TIMER_CALLBACK( nmi_callback ) |
| 143 | 143 | { |
| 144 | if (sound_nmi_enable) cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 144 | if (sound_nmi_enable) cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 145 | 145 | else pending_nmi = 1; |
| 146 | 146 | sound_state &= ~1; |
| 147 | 147 | } |
| r1591 | r1592 | |
| 167 | 167 | sound_nmi_enable = 1; |
| 168 | 168 | if (pending_nmi) |
| 169 | 169 | { |
| 170 | cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 170 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 171 | 171 | pending_nmi = 0; |
| 172 | 172 | } |
| 173 | 173 | } |
| r1591 | r1592 | |
|---|---|---|
| 555 | 555 | |
| 556 | 556 | static const struct TMS5110interface tms5110_interface = |
| 557 | 557 | { |
| 558 | TMS5110_IS_5110A, | |
| 559 | 558 | -1, /* ROM_REGION */ |
| 560 | 559 | bagman_speech_rom_read_bit /*M0 callback function. Called whenever chip requests a single bit of data*/ |
| 561 | 560 | }; |
| r1591 | r1592 | |
| 592 | 591 | MDRV_SOUND_CONFIG(ay8910_interface) |
| 593 | 592 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| 594 | 593 | |
| 595 | MDRV_SOUND_ADD(TMS5110, 640000) | |
| 594 | MDRV_SOUND_ADD(TMS5110A, 640000) | |
| 596 | 595 | MDRV_SOUND_CONFIG(tms5110_interface) |
| 597 | 596 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 598 | 597 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 607 | 607 | if (data) |
| 608 | 608 | { |
| 609 | 609 | logerror("S23: booting H8/3002\n"); |
| 610 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 610 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 611 | 611 | } |
| 612 | 612 | else |
| 613 | 613 | { |
| 614 | 614 | logerror("S23: stopping H8/3002\n"); |
| 615 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 615 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 | } |
| r1591 | r1592 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | pending_command = 1; |
| 111 | 111 | soundlatch_w(0, data & 0xff); |
| 112 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 112 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r1591 | r1592 | |
| 378 | 378 | |
| 379 | 379 | static void irqhandler(int irq) |
| 380 | 380 | { |
| 381 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 381 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 231 | 231 | |
| 232 | 232 | static INTERRUPT_GEN( commando_interrupt ) |
| 233 | 233 | { |
| 234 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); // RST 10h - VBLANK | |
| 234 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); // RST 10h - VBLANK | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /* Machine Driver */ |
| r1591 | r1592 | |
|---|---|---|
| 182 | 182 | * |
| 183 | 183 | *************************************/ |
| 184 | 184 | |
| 185 | static void update_interrupts( | |
| 185 | static void update_interrupts(running_machine *machine) | |
| 186 | 186 | { |
| 187 | 187 | if (atarigen_video_int_state) |
| 188 | cpunum_set_input_line(0, 3, ASSERT_LINE); | |
| 188 | cpunum_set_input_line(machine, 0, 3, ASSERT_LINE); | |
| 189 | 189 | else |
| 190 | cpunum_set_input_line(0, 3, CLEAR_LINE); | |
| 190 | cpunum_set_input_line(machine, 0, 3, CLEAR_LINE); | |
| 191 | 191 | |
| 192 | 192 | if (atarigen_scanline_int_state) |
| 193 | cpunum_set_input_line(0, 2, ASSERT_LINE); | |
| 193 | cpunum_set_input_line(machine, 0, 2, ASSERT_LINE); | |
| 194 | 194 | else |
| 195 | cpunum_set_input_line(0, 2, CLEAR_LINE); | |
| 195 | cpunum_set_input_line(machine, 0, 2, CLEAR_LINE); | |
| 196 | 196 | |
| 197 | 197 | if (p2portwr_state) |
| 198 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 198 | cpunum_set_input_line(machine, 0, 1, ASSERT_LINE); | |
| 199 | 199 | else |
| 200 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 200 | cpunum_set_input_line(machine, 0, 1, CLEAR_LINE); | |
| 201 | 201 | |
| 202 | 202 | if (p2portrd_state) |
| 203 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 203 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 204 | 204 | else |
| 205 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 205 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | |
| r1591 | r1592 | |
| 302 | 302 | { |
| 303 | 303 | /* reset sound CPU */ |
| 304 | 304 | if (ACCESSING_LSB) |
| 305 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE); | |
| 305 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 |
| r1591 | r1592 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 1 | /****************************************************************************** | |
| 2 | 2 | |
| 3 | ***************************** | |
| 4 | *** NINJA KID II hardware *** (by Roberto Ventura) | |
| 5 | ***************************** | |
| 3 | UPL "sprite framebuffer" hardware | |
| 6 | 4 | |
| 7 | Game authors: | |
| 8 | Game design: Tsutomu Fuzisawa | |
| 9 | Program design: Satoru Kinjo | |
| 10 | Char. design: Tsutomu Fizisawa | |
| 11 | Char. design: Akemi Tsunoda | |
| 12 | Sound compose: Tsutomu Fuzisawa | |
| 13 | Bgm create: Mecano Associate | |
| 14 | Data make: Takashi Hayashi | |
| 5 | driver by Roberto Ventura, Leandro Dardini, Yochizo, Nicola Salmoria | |
| 15 | 6 | |
| 16 | General aspect. | |
| 7 | The peculiar feature of this hardware is the ability to disable clearing of the | |
| 8 | sprite framebuffer, therefore overdrawing new sprites on top of the ones drawn | |
| 9 | in the previous frames. | |
| 10 | When sprite overdrawing is enabled, not all sprites leave trails: only the ones | |
| 11 | using color codes C, D, and E. Sprites using color code F have the special | |
| 12 | effect of clearing the trails which have been left by other sprites. | |
| 17 | 13 | |
| 18 | The game is driven by a fast Z80 CPU. | |
| 19 | Screen resolution is 256x192. | |
| 20 | 768 colors on screen. | |
| 21 | 96 sprites. | |
| 22 | 14 | |
| 23 | Rom Contents: | |
| 15 | Game Board | |
| 16 | ---------------- --------- | |
| 17 | Ninja Kid II UPL-87003 | |
| 18 | Mutant Night UPL-????? | |
| 19 | Ark Area UPL-87007 | |
| 20 | Atomic Robo-Kid UPL-88013 | |
| 21 | Omega Fighter UPL-89016 | |
| 24 | 22 | |
| 25 | NK2_01.ROM Main CPU program ROM | |
| 26 | NK2_02.ROM CPU banked data ROM 0 (banks 0 and 1) | |
| 27 | NK2_03.ROM CPU banked data ROM 1 (banks 2 and 3) | |
| 28 | NK2_04.ROM CPU banked data ROM 2 (banks 4 and 5) | |
| 29 | NK2_05.ROM CPU banked data ROM 3 (banks 6 and 7) | |
| 30 | NK2_06.ROM Sound CPU program ROM (encrypted) | |
| 31 | NK2_07.ROM Sprites data ROM 1 | |
| 32 | NK2_08.ROM Sprites data ROM 0 | |
| 33 | NK2_09.ROM Raw PCM samples (complete?) | |
| 34 | NK2_10.ROM Background data ROM 1 | |
| 35 | NK2_11.ROM Background data ROM 0 | |
| 36 | NK2_12.ROM Foreground data ROM | |
| 37 | 23 | |
| 38 | *** MEMORY MAP *** | |
| 24 | Hardware Overview: | |
| 25 | ------------------ | |
| 26 | 1xZ80 @ 6MHz (main CPU) | |
| 27 | 1xZ80 @ 5MHz (sound CPU) | |
| 28 | 2xYM2203 @ 1.5MHz | |
| 29 | PCM samples (Ninja Kid II only?) | |
| 39 | 30 | |
| 40 | 0000-7fff Main CPU ROM | |
| 41 | 8000-bfff Banked CPU ROM | |
| 42 | c000-c7ff I/O | |
| 43 | c800-cdff Color RAM | |
| 44 | d000-d7ff "FRONT" tile map | |
| 45 | d800-dfff "BACK" tile map | |
| 46 | e000-efff Main RAM | |
| 47 | f400-f7ff ??? screen frame ??? | |
| 48 | f800-f9ff CPU Stack | |
| 49 | fa00-ffff Sprite registers (misc RAM) | |
| 31 | Resolution: 256x192 | |
| 32 | 96 sprites | |
| 33 | Tilemaps: fg 256x256 (8x8) + bg 512x512 (16x16) | |
| 34 | Atomic Robo-Kid adds two more bg tilemaps, at the same resolution | |
| 35 | Omega Fighter further improves by increasing the bg resolution to 2048x512. | |
| 50 | 36 | |
| 37 | 768 colors on screen out of a palette of 4096 | |
| 51 | 38 | |
| 52 | 1) CPU | |
| 53 | 39 | |
| 54 | 1 OSC 12 MHz | |
| 55 | 1 OSC 5 MHz | |
| 56 | 2 YM 2203C.......CaBBe!. | |
| 40 | Designers: | |
| 41 | ---------- | |
| 42 | Ninja Kid II: | |
| 43 | * Game designer : Tsutomu Fuzisawa | |
| 44 | * Program designer : Satoru Kinjo | |
| 45 | * Character designers : Tsutomu Fuzisawa, Akemi Tsunoda | |
| 46 | * Sound composer : Tsutomu Fuzisawa | |
| 47 | * BGM creator: Mecano Associates | |
| 48 | * Data maker : Takashi Hayashi | |
| 57 | 49 | |
| 58 | The Z80 runs in IM0,the game expects execution of RST10 each | |
| 59 | frame. | |
| 50 | Mutant Night: | |
| 51 | * Game designed by : Tsutomu Fuzisawa | |
| 52 | * Characters designers : Tsutomu Fuzisawa, Takashige Shichijyo, Akemi Tsunoda, Noriko Nihei | |
| 53 | * Programmer : Takashi Hayashi | |
| 54 | * BGM & Sound composer : Yukari Shimada | |
| 55 | * Data make : Tsutomu Fuzisawa, Takashige Shichijyo | |
| 60 | 56 | |
| 61 | Game level maps,additional code and data are available to main | |
| 62 | program via CPU banking at lacations 8000-bf00 | |
| 57 | Ark Area: | |
| 58 | * Tsutomu Fuzisawa, Hiropi, Mingma, Nihei, Nozawa | |
| 63 | 59 | |
| 64 | In two of the sets, the encrypted sound program ROM is replaced with a | |
| 65 | double-sized decrypted version. I don0t know if they are bootlegs or originals. | |
| 60 | Atomic Robo-Kid: | |
| 61 | * Game designer : Tsutomu Fuzisawa | |
| 62 | * Chief programmer : Toshio Arai | |
| 63 | * Character designers : Tsutomu Fuzisawa, Tokuhisa Tazima | |
| 64 | * Background designers : Noriko Nihei, Akemi Tsunoda | |
| 65 | * Effects : Kohji Abe | |
| 66 | * Compose & Music : Mecano Associates | |
| 66 | 67 | |
| 68 | Omega Fighter: | |
| 69 | * Iwatani, Nobuyuki Narita, Abe, Akemi Tsunoda, Nikei, Shigksa, T.T, Ohnuma | |
| 67 | 70 | |
| 68 | 71 | |
| 69 | 2) I/O | |
| 72 | Notes: | |
| 73 | ------ | |
| 74 | - Press 2 to skip the settings screen on startup. | |
| 70 | 75 | |
| 71 | c000 "KEYCOIN" button | |
| 76 | - The sound CPU in Ninja Kid II is a Sega MC8123 encrypted Z80. In some sets, the | |
| 77 | ROM is replaced with a double-sized decrypted version. They are presumably | |
| 78 | bootlegs but this isn't known for sure. | |
| 72 | 79 | |
| 73 | 76543210 | |
| 74 | || | || | |
| 75 | || | |^-COIN 1 | |
| 76 | || | ^--COIN 2 | |
| 77 | || ^-----TEST MODE (on the fly,to be pressed during boot) | |
| 78 | |^-------START 1 | |
| 79 | ^--------START 2 | |
| 80 | - The Ninja Kid II sound program writes to unmapped locations 0xeff5, 0xeff6, and | |
| 81 | 0xefee due to a bug. This happens in both the encrypted and decrypted versions, | |
| 82 | so it appears to be a genuine bug with no ill effect. | |
| 80 | 83 | |
| 84 | - All the games write to the PCM sample player port used by Ninja Kid II (they | |
| 85 | all write the 0xF0 "silence" command), however since these games don't have PCM | |
| 86 | samples it seems unlikely that the boards actually have the PCM circuitry. The | |
| 87 | command written might be a leftover from the code used for Ninja Kid II. | |
| 81 | 88 | |
| 82 | c001 "PAD1" | |
| 83 | c002 "PAD2" | |
| 89 | - Ark Area has no explicit copyright year on the title screen, however it was | |
| 90 | reportedly released in December 1987. | |
| 91 | Text in the ROM says: | |
| 92 | -ARK AREA- | |
| 93 | DIRECTED BY | |
| 94 | UPL COMPANY LIMITED 1988 | |
| 95 | UPL-87007 BORD A STANDARD. | |
| 96 | This all appears in the end credits, except for "1988" | |
| 84 | 97 | |
| 85 | 76543210 | |
| 86 | |||||| | |
| 87 | |||||^-RIGHT | |
| 88 | ||||^--LEFT | |
| 89 | |||^---DOWN | |
| 90 | ||^----UP | |
| 91 | |^-----FIRE 0 | |
| 92 | ^------FIRE 1 | |
| 98 | - On levels 16 and 23 of Ark Area, sprites leave trails on screen in a very | |
| 99 | awkward way. This has been verified to happen on the real PCB. | |
| 93 | 100 | |
| 101 | - To enter the level code in Atomic Robokid, after inserting coins press 1P start | |
| 102 | while keeping pressed button 1. | |
| 103 | Codes are given on the continue screen after Act 5. | |
| 94 | 104 | |
| 95 | c003 "DIPSW1" | |
| 105 | - Omega Fighter has some unknown protection device interfacing with the player | |
| 106 | and dip switche inputs. There isn't enough evidence to determine what the | |
| 107 | device does, so it is roughly simulated just enough to get the game running. | |
| 108 | Most of the time the device just passes over the inputs. It is interrogated | |
| 109 | for protection check only on startup. | |
| 96 | 110 | |
| 97 | 76543210 | |
| 98 | |||||||| | |
| 99 | |||||||^-UNUSED? | |
| 100 | ||||||^-->EXTRA | |
| 101 | |||||^--->LIVES | |
| 102 | ||||^----CONTINUE MODE | |
| 103 | |||^-----DEMO SOUND | |
| 104 | ||^------NORMAL/HARD | |
| 105 | |^-------LIVES 3/4 | |
| 106 | ^--------ENGLISH/JAP | |
| 111 | - Omega Fighter does some very strange reads from unmapped memory location C1E7. | |
| 112 | The purpose is unclear, it seems to be related to enemies on screen. The top | |
| 113 | three bits of the returned value ar ORed with register B, and some code is | |
| 114 | executed if the result is not 0. Nothing obvious happens either way. | |
| 107 | 115 | |
| 116 | TODO: | |
| 117 | ----- | |
| 118 | - Ninja Kid II PCM sample playback frequency is not verified | |
| 108 | 119 | |
| 109 | ||
| 120 | - | |
| 110 | 121 | |
| 111 | 76543210 | |
| 112 | |||||||| | |
| 113 | |||||||^-TEST MODE | |
| 114 | ||||||^--TABLE/UPRIGHT | |
| 115 | |||||^---"CREDIT SERVICE" | |
| 116 | ||||^----> | |
| 117 | |||^----->> | |
| 118 | ||^------>>> coin/credit configurations | |
| 119 | |^------->> | |
| 120 | ^--------> | |
| 122 | ******************************************************************************/ | |
| 121 | 123 | |
| 122 | c200 Sound command | |
| 123 | This byte is written when game plays sound effects... | |
| 124 | it is set when music or sound effects (both pcm and fm) are triggered; | |
| 125 | I guess it is read by another CPU,then. | |
| 124 | #include "driver.h" | |
| 125 | #include "sound/2203intf.h" | |
| 126 | #include "sound/samples.h" | |
| 127 | #include "machine/mc8123.h" | |
| 128 | #include "ninjakd2.h" | |
| 126 | 129 | |
| 127 | c201 Unknown,but used. | |
| 130 | #define MAIN_CLOCK_12 XTAL_12MHz | |
| 131 | #define MAIN_CLOCK_5 XTAL_5MHz | |
| 128 | 132 | |
| 129 | c | |
| 133 | static | |
| 130 | 134 | |
| 131 | c203 Sprite 'overdraw' | |
| 132 | this is the most interesting feature of the game,when set | |
| 133 | the sprites drawn in the previous frame remain on the | |
| 134 | screen,so the game can perform special effects such as the | |
| 135 | 'close up' when you die or the "infinite balls" appearing | |
| 136 | when an extra weapon is collected. | |
| 137 | Appears to work like a xor mask,a sprite removes older | |
| 138 | sprite 'bitmap' when present;other memory locations connected to | |
| 139 | this function may be f400-f7ff...should be investigated more. | |
| 140 | -mmmh... I believe this is sci-fiction for a non-bitmap game... | |
| 135 | static UINT8 omegaf_io_protection[3]; | |
| 136 | static UINT8 omegaf_io_protection_input; | |
| 137 | static int omegaf_io_protection_tic; | |
| 138 | static void omegaf_io_protection_reset(void); | |
| 141 | 139 | |
| 142 | C208 Scroll X 0-7 | |
| 143 | 140 | |
| 144 | C209 Scroll X MSB | |
| 141 | static INTERRUPT_GEN( ninjakd2_interrupt ) | |
| 142 | { | |
| 143 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 144 | } | |
| 145 | 145 | |
| 146 | C20A Scroll Y 0-7 | |
| 147 | 146 | |
| 148 | C20B Scroll Y MSB | |
| 147 | static MACHINE_RESET( ninjakd2 ) | |
| 148 | { | |
| 149 | /* initialize main Z80 bank */ | |
| 150 | memory_configure_bank(1, 0, 8, memory_region(REGION_CPU1) + 0x10000, 0x4000); | |
| 151 | memory_set_bank(1, 0); | |
| 152 | } | |
| 149 | 153 | |
| 150 | C20C Background ENABLE | |
| 151 | when set to zero the background is totally black,but | |
| 152 | sprites are drawn correctly. | |
| 154 | static void robokid_init_banks(void) | |
| 155 | { | |
| 156 | /* initialize main Z80 bank */ | |
| 157 | memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1), 0x4000); | |
| 158 | memory_configure_bank(1, 2, 14, memory_region(REGION_CPU1) + 0x10000, 0x4000); | |
| 159 | memory_set_bank(1, 0); | |
| 160 | } | |
| 153 | 161 | |
| 162 | static MACHINE_RESET( robokid ) | |
| 163 | { | |
| 164 | robokid_init_banks(); | |
| 165 | } | |
| 154 | 166 | |
| 155 | 3) COLOR RAM | |
| 167 | static MACHINE_RESET( omegaf ) | |
| 168 | { | |
| 169 | robokid_init_banks(); | |
| 156 | 170 | |
| 157 | The palette system is dynamic,the game can show up to 768 different | |
| 158 | colors on screen. | |
| 171 | omegaf_io_protection_reset(); | |
| 172 | } | |
| 159 | 173 | |
| 160 | Palette depth is 12 bits as usual,two consecutive bytes are used for each | |
| 161 | color code. | |
| 162 | 174 | |
| 163 | format: RRRRGGGGBBBB0000 | |
| 175 | static WRITE8_HANDLER( ninjakd2_bankselect_w ) | |
| 176 | { | |
| 177 | memory_set_bank(1, data & 0x7); | |
| 178 | } | |
| 164 | 179 | |
| 165 | Colors are organized in palettes,since graphics is 4 bits (16 colors) | |
| 166 | each palette takes 32 bytes,the three different layers,BACK,SPRITES and | |
| 167 | FRONT don't share any color,each has its own 256 color space,hence the | |
| 168 | 768 colors on screen. | |
| 180 | static WRITE8_HANDLER( robokid_bankselect_w ) | |
| 181 | { | |
| 182 | memory_set_bank(1, data & 0xf); | |
| 183 | } | |
| 169 | 184 | |
| 170 | c800-c9ff Background palettes | |
| 171 | ca00-cbff Sprites palettes | |
| 172 | cc00-cdff Foreground palettes | |
| 173 | 185 | |
| 186 | static WRITE8_HANDLER( ninjakd2_soundreset_w ) | |
| 187 | { | |
| 188 | // bit 4 resets sound CPU | |
| 189 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); | |
| 174 | 190 | |
| 175 | 4) TILE-BASED LAYERS | |
| 191 | // bit 7 flips screen | |
| 192 | flip_screen_set(data & 0x80); | |
| 176 | 193 | |
| 177 | The tile format for background and foreground is the same,the | |
| 178 | only difference is that background tiles are 16x16 pixels while foreground | |
| 179 | tiles are only 8x8. | |
| 194 | // other bits unused | |
| 195 | } | |
| 180 | 196 | |
| 181 | Background virtual screen is 512x512 pixels scrollable. | |
| 182 | 197 | |
| 183 | Two consecutive tiles bytes identify one tile. | |
| 184 | 198 | |
| 185 | O7 O6 O5 O4 O3 O2 O1 O0 gfx Offset | |
| 186 | O9 O8 FY FX C3 C2 C1 C0 Attibute | |
| 199 | static void ninjakd2_init_samples(void) | |
| 200 | { | |
| 201 | const UINT8* const rom = memory_region(REGION_SOUND1); | |
| 187 | 202 | |
| 188 | O= GFX offset (1024 tiles) | |
| 189 | F= Flip X and Y | |
| 190 | C= Color palette selector | |
| 203 | const int length = memory_region_length(REGION_SOUND1); | |
| 191 | 204 | |
| 205 | INT16* const sampledata = auto_malloc(length * sizeof(sampledata[0])); | |
| 192 | 206 | |
| 193 | ||
| 207 | int i; | |
| 194 | 208 | |
| 195 | Five bytes identify each sprite,but the registers actually used | |
| 196 | are placed at intervals of 16. | |
| 197 | Some of the remaining bytes are used (e.g. fa00),their meaning is totally | |
| 198 | unknown to me,they seem to be related to the surprising additional sprite | |
| 199 | feature of the game,but maybe they're just random writes in RAM. | |
| 209 | // convert unsigned 8-bit PCM to signed 16-bit | |
| 210 | for (i = 0; i < length; ++i) | |
| 211 | sampledata[i] = rom[i] << 7; | |
| 200 | 212 | |
| 201 | The first sprite data is located at fa0b,then fa1b and so on. | |
| 213 | ninjakd2_sampledata = sampledata; | |
| 214 | } | |
| 202 | 215 | |
| 216 | static WRITE8_HANDLER( ninjakd2_pcm_play_w ) | |
| 217 | { | |
| 218 | const UINT8* const rom = memory_region(REGION_SOUND1); | |
| 203 | 219 | |
| 204 | 0b Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 Y coord | |
| 205 | 0c X7 X6 X5 X4 X3 X2 X1 X0 X coord | |
| 206 | 0d O9 O8 FY FX -- -- EN X8 hi gfx - FLIP - Enable - hi X | |
| 207 | 0e O7 O6 O5 O4 O3 O2 O1 O0 gfx - offset | |
| 208 | 0f -- -- -- -- C3 C2 C1 C0 color | |
| 220 | // only Ninja Kid II uses this | |
| 221 | if (rom) | |
| 222 | { | |
| 223 | const int length = memory_region_length(REGION_SOUND1); | |
| 209 | 224 | |
| 210 | Y= Y coordinate | |
| 211 | X= X coordinate (X8 is used to clip sprite on the left) | |
| 212 | O= Gfx offset (1024 sprites) | |
| 213 | F= Flip | |
| 214 | EN= Enable (this is maybe the Y8 coordinate bit,but it isn't set | |
| 215 | accordingly in the test mode | |
| 216 | C= Color palette selector | |
| 225 | const int start = data << 8; | |
| 217 | 226 | |
| 218 | ||
| 227 | int end; | |
| 219 | 228 | |
| 229 | // find end of sample | |
| 230 | end = start; | |
| 231 | while (end < length && rom[end] != 0x00) | |
| 232 | ++end; | |
| 220 | 233 | |
| 221 | #include "driver.h" | |
| 222 | #include "sound/2203intf.h" | |
| 223 | #include "sound/samples.h" | |
| 224 | #include "machine/mc8123.h" | |
| 234 | if (end - start) | |
| 235 | sample_start_raw(0, &ninjakd2_sampledata[start], end - start, MAIN_CLOCK_5 / 384, 0); // 13020kHz NOT verified | |
| 236 | else | |
| 237 | sample_stop(0); | |
| 238 | } | |
| 239 | } | |
| 225 | 240 | |
| 226 | extern WRITE8_HANDLER( ninjakd2_bgvideoram_w ); | |
| 227 | extern WRITE8_HANDLER( ninjakd2_fgvideoram_w ); | |
| 228 | extern WRITE8_HANDLER( ninjakd2_scrollx_w ); | |
| 229 | extern WRITE8_HANDLER( ninjakd2_scrolly_w ); | |
| 230 | extern WRITE8_HANDLER( ninjakd2_sprite_overdraw_w ); | |
| 231 | extern WRITE8_HANDLER( ninjakd2_background_enable_w ); | |
| 232 | extern VIDEO_START( ninjakd2 ); | |
| 233 | extern VIDEO_UPDATE( ninjakd2 ); | |
| 234 | 241 | |
| 235 | extern UINT8 *ninjakd2_bg_videoram, *ninjakd2_fg_videoram; | |
| 236 | 242 | |
| 237 | static int ninjakd2_bank_latch = 255; | |
| 238 | static INT16 *sampledata[8]; | |
| 239 | static int samplelen[8]; | |
| 243 | /************************************* | |
| 244 | * | |
| 245 | * Omega Fighter I/O protection simulation | |
| 246 | * | |
| 247 | *************************************/ | |
| 240 | 248 | |
| 241 | ||
| 249 | ||
| 242 | 250 | { |
| 243 | int i,n; | |
| 244 | UINT8 *source = memory_region(REGION_SOUND1); | |
| 245 | static const int sample_info [9][2] = { {0x0000,0x0A00},{0x0A00,0x1D00},{0x2700,0x1700}, | |
| 246 | {0x3E00,0x1500},{0x5300,0x0B00},{0x5E00,0x0A00},{0x6800,0x0E00},{0x7600,0x1E00},{0xF000,0x0400} }; | |
| 251 | // make sure protection starts in a known state | |
| 252 | omegaf_io_protection[0] = 0; | |
| 253 | omegaf_io_protection[1] = 0; | |
| 254 | omegaf_io_protection[2] = 0; | |
| 255 | omegaf_io_protection_input = 0; | |
| 256 | omegaf_io_protection_tic = 0; | |
| 257 | } | |
| 247 | 258 | |
| 248 | for (i=0;i<8;i++) | |
| 259 | static READ8_HANDLER( omegaf_io_protection_r ) | |
| 260 | { | |
| 261 | UINT8 result = 0xff; | |
| 262 | ||
| 263 | switch (omegaf_io_protection[1] & 3) | |
| 249 | 264 | { |
| 250 | sampledata[i] = auto_malloc(sample_info[i][1] * sizeof(sampledata[0])); | |
| 251 | samplelen[i] = sample_info[i][1]; | |
| 252 | for (n=0; n<sample_info[i][1]; n++) | |
| 253 | sampledata[i][n] = (INT8)(source[sample_info[i][0]+n] ^ 0x80) * 256; | |
| 254 | } | |
| 255 | } | |
| 265 | case 0: | |
| 266 | switch (offset) | |
| 267 | { | |
| 268 | case 1: | |
| 269 | switch (omegaf_io_protection[0] & 0xe0) | |
| 270 | { | |
| 271 | case 0x00: | |
| 272 | if (++omegaf_io_protection_tic & 1) | |
| 273 | { | |
| 274 | result = 0x00; | |
| 275 | } | |
| 276 | else | |
| 277 | { | |
| 278 | switch (omegaf_io_protection_input) | |
| 279 | { | |
| 280 | // first interrogation | |
| 281 | // this happens just after setting mode 0. | |
| 282 | // input is not explicitly loaded so could be anything | |
| 283 | case 0x00: | |
| 284 | result = 0x80 | 0x02; | |
| 285 | break; | |
| 256 | 286 | |
| 287 | // second interrogation | |
| 288 | case 0x8c: | |
| 289 | result = 0x80 | 0x1f; | |
| 290 | break; | |
| 257 | 291 | |
| 258 | static INTERRUPT_GEN( ninjakd2_interrupt ) | |
| 259 | { | |
| 260 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 261 | } | |
| 292 | // third interrogation | |
| 293 | case 0x89: | |
| 294 | result = 0x80 | 0x0b; | |
| 295 | break; | |
| 296 | } | |
| 297 | } | |
| 298 | break; | |
| 262 | 299 | |
| 263 | #ifdef UNUSED_FUNCTION | |
| 264 | READ8_HANDLER( ninjakd2_bankselect_r ) | |
| 265 | { | |
| 266 | return ninjakd2_bank_latch; | |
| 267 | } | |
| 268 | #endif | |
| 300 | case 0x20: | |
| 301 | result = 0xc7; | |
| 302 | break; | |
| 269 | 303 | |
| 270 | static WRITE8_HANDLER( ninjakd2_bankselect_w ) | |
| 271 | { | |
| 272 | UINT8 *ROM = memory_region(REGION_CPU1); | |
| 273 | int bankaddress; | |
| 304 | case 0x60: | |
| 305 | result = 0x00; | |
| 306 | break; | |
| 274 | 307 | |
| 275 | if (data != ninjakd2_bank_latch) | |
| 276 | { | |
| 277 | ninjakd2_bank_latch = data; | |
| 308 | case 0x80: | |
| 309 | result = 0x20 | (omegaf_io_protection_input & 0x1f); | |
| 310 | break; | |
| 278 | 311 | |
| 279 | bankaddress = 0x10000 + ((data & 0x7) * 0x4000); | |
| 280 | memory_set_bankptr(1,&ROM[bankaddress]); /* Select 8 banks of 16k */ | |
| 312 | case 0xc0: | |
| 313 | result = 0x60 | (omegaf_io_protection_input & 0x1f); | |
| 314 | break; | |
| 315 | } | |
| 316 | break; | |
| 317 | } | |
| 318 | break; | |
| 319 | ||
| 320 | case 1: // dip switches | |
| 321 | switch (offset) | |
| 322 | { | |
| 323 | case 0: result = readinputportbytag("DIPSW1"); break; | |
| 324 | case 1: result = readinputportbytag("DIPSW2"); break; | |
| 325 | case 2: result = 0x02; break; | |
| 326 | } | |
| 327 | break; | |
| 328 | ||
| 329 | case 2: // player inputs | |
| 330 | switch (offset) | |
| 331 | { | |
| 332 | case 0: result = readinputportbytag("PAD1"); break; | |
| 333 | case 1: result = readinputportbytag("PAD2"); break; | |
| 334 | case 2: result = 0x01; break; | |
| 335 | } | |
| 336 | break; | |
| 281 | 337 | } |
| 338 | ||
| 339 | return result; | |
| 282 | 340 | } |
| 283 | 341 | |
| 284 | static WRITE8_HANDLER( | |
| 342 | static WRITE8_HANDLER( omegaf | |
| 285 | 343 | { |
| 286 | int i; | |
| 287 | static const int sample_no[9] = { 0x00,0x0A,0x27,0x3E,0x53,0x5E,0x68,0x76,0xF0 }; | |
| 344 | // load parameter on c006 bit 0 rise transition | |
| 345 | if (offset == 2 && (data & 1) && !(omegaf_io_protection[2] & 1)) | |
| 346 | { | |
| 347 | logerror("loading protection input %02x\n", omegaf_io_protection[0]); | |
| 348 | omegaf_io_protection_input = omegaf_io_protection[0]; | |
| 349 | } | |
| 288 | 350 | |
| 289 | for(i=0;i<9;i++) | |
| 290 | if (sample_no[i]==data) break; | |
| 291 | ||
| 292 | if (i==8) | |
| 293 | sample_stop(0); | |
| 294 | else | |
| 295 | sample_start_raw(0,sampledata[i],samplelen[i],16000,0); | |
| 351 | omegaf_io_protection[offset] = data; | |
| 296 | 352 | } |
| 297 | 353 | |
| 354 | ||
| 355 | ||
| 356 | /************************************* | |
| 357 | * | |
| 358 | * Memory maps | |
| 359 | * | |
| 360 | *************************************/ | |
| 361 | ||
| 298 | 362 | static ADDRESS_MAP_START( ninjakd2_main_cpu, ADDRESS_SPACE_PROGRAM, 8 ) |
| 299 | 363 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 300 | 364 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) |
| 301 | AM_RANGE(0xc000, 0xc000) AM_READ(input_port_2_r) | |
| 302 | AM_RANGE(0xc001, 0xc001) AM_READ(input_port_0_r) | |
| 303 | AM_RANGE(0xc002, 0xc002) AM_READ(input_port_1_r) | |
| 304 | AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r) | |
| 305 | AM_RANGE(0xc004, 0xc004) AM_READ(input_port_4_r) | |
| 365 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("KEYCOIN") | |
| 366 | AM_RANGE(0xc001, 0xc001) AM_READ_PORT("PAD1") | |
| 367 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("PAD2") | |
| 368 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DIPSW1") | |
| 369 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DIPSW2") | |
| 306 | 370 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) |
| 307 | AM_RANGE(0xc201, 0xc201) AM_WRITE | |
| 371 | AM_RANGE(0xc201, 0xc201) AM_WRITE(ninjakd2_soundreset_w) | |
| 308 | 372 | AM_RANGE(0xc202, 0xc202) AM_WRITE(ninjakd2_bankselect_w) |
| 309 | 373 | AM_RANGE(0xc203, 0xc203) AM_WRITE(ninjakd2_sprite_overdraw_w) |
| 310 | AM_RANGE(0xc208, 0xc209) AM_WRITE(ninjakd2_scrollx_w) | |
| 311 | AM_RANGE(0xc20a, 0xc20b) AM_WRITE(ninjakd2_scrolly_w) | |
| 312 | AM_RANGE(0xc20c, 0xc20c) AM_WRITE(ninjakd2_background_enable_w) | |
| 374 | AM_RANGE(0xc208, 0xc20c) AM_WRITE(ninjakd2_bg_ctrl_w) // scroll + enable | |
| 313 | 375 | AM_RANGE(0xc800, 0xcdff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) |
| 314 | 376 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) |
| 315 | 377 | AM_RANGE(0xd800, 0xdfff) AM_RAM AM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(&ninjakd2_bg_videoram) |
| 316 | 378 | AM_RANGE(0xe000, 0xf9ff) AM_RAM |
| 317 | AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram) | |
| 379 | AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram) | |
| 318 | 380 | ADDRESS_MAP_END |
| 319 | 381 | |
| 382 | ||
| 383 | static ADDRESS_MAP_START( mnight_main_cpu, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 384 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 385 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) | |
| 386 | AM_RANGE(0xc000, 0xd9ff) AM_RAM | |
| 387 | AM_RANGE(0xda00, 0xdfff) AM_RAM AM_BASE(&spriteram) | |
| 388 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(&ninjakd2_bg_videoram) | |
| 389 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 390 | AM_RANGE(0xf000, 0xf5ff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 391 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("KEYCOIN") | |
| 392 | AM_RANGE(0xf801, 0xf801) AM_READ_PORT("PAD1") | |
| 393 | AM_RANGE(0xf802, 0xf802) AM_READ_PORT("PAD2") | |
| 394 | AM_RANGE(0xf803, 0xf803) AM_READ_PORT("DIPSW1") | |
| 395 | AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DIPSW2") | |
| 396 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(soundlatch_w) | |
| 397 | AM_RANGE(0xfa01, 0xfa01) AM_WRITE(ninjakd2_soundreset_w) | |
| 398 | AM_RANGE(0xfa02, 0xfa02) AM_WRITE(ninjakd2_bankselect_w) | |
| 399 | AM_RANGE(0xfa03, 0xfa03) AM_WRITE(ninjakd2_sprite_overdraw_w) | |
| 400 | AM_RANGE(0xfa08, 0xfa0c) AM_WRITE(ninjakd2_bg_ctrl_w) // scroll + enable | |
| 401 | ADDRESS_MAP_END | |
| 402 | ||
| 403 | ||
| 404 | static ADDRESS_MAP_START( robokid_main_cpu, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 405 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 406 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) | |
| 407 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 408 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 409 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(robokid_bg2_videoram_r, robokid_bg2_videoram_w) // banked | |
| 410 | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(robokid_bg1_videoram_r, robokid_bg1_videoram_w) // banked | |
| 411 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(robokid_bg0_videoram_r, robokid_bg0_videoram_w) // banked | |
| 412 | AM_RANGE(0xdc00, 0xdc00) AM_READ_PORT("KEYCOIN") | |
| 413 | AM_RANGE(0xdc01, 0xdc01) AM_READ_PORT("PAD1") | |
| 414 | AM_RANGE(0xdc02, 0xdc02) AM_READ_PORT("PAD2") | |
| 415 | AM_RANGE(0xdc03, 0xdc03) AM_READ_PORT("DIPSW1") | |
| 416 | AM_RANGE(0xdc04, 0xdc04) AM_READ_PORT("DIPSW2") | |
| 417 | AM_RANGE(0xdc00, 0xdc00) AM_WRITE(soundlatch_w) | |
| 418 | AM_RANGE(0xdc01, 0xdc01) AM_WRITE(ninjakd2_soundreset_w) // sound reset + flip screen | |
| 419 | AM_RANGE(0xdc02, 0xdc02) AM_WRITE(robokid_bankselect_w) | |
| 420 | AM_RANGE(0xdc03, 0xdc03) AM_WRITE(ninjakd2_sprite_overdraw_w) | |
| 421 | AM_RANGE(0xdd00, 0xdd04) AM_WRITE(robokid_bg0_ctrl_w) // scroll + enable | |
| 422 | AM_RANGE(0xdd05, 0xdd05) AM_WRITE(robokid_bg0_bank_w) | |
| 423 | AM_RANGE(0xde00, 0xde04) AM_WRITE(robokid_bg1_ctrl_w) // scroll + enable | |
| 424 | AM_RANGE(0xde05, 0xde05) AM_WRITE(robokid_bg1_bank_w) | |
| 425 | AM_RANGE(0xdf00, 0xdf04) AM_WRITE(robokid_bg2_ctrl_w) // scroll + enable | |
| 426 | AM_RANGE(0xdf05, 0xdf05) AM_WRITE(robokid_bg2_bank_w) | |
| 427 | AM_RANGE(0xe000, 0xf9ff) AM_RAM | |
| 428 | AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram) | |
| 429 | ADDRESS_MAP_END | |
| 430 | ||
| 431 | ||
| 432 | static ADDRESS_MAP_START( omegaf_main_cpu, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 433 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 434 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) | |
| 435 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("KEYCOIN") | |
| 436 | AM_RANGE(0xc001, 0xc003) AM_READ(omegaf_io_protection_r) | |
| 437 | AM_RANGE(0xc000, 0xc000) AM_WRITE(soundlatch_w) | |
| 438 | AM_RANGE(0xc001, 0xc001) AM_WRITE(ninjakd2_soundreset_w) // sound reset + flip screen | |
| 439 | AM_RANGE(0xc002, 0xc002) AM_WRITE(robokid_bankselect_w) | |
| 440 | AM_RANGE(0xc003, 0xc003) AM_WRITE(ninjakd2_sprite_overdraw_w) | |
| 441 | AM_RANGE(0xc004, 0xc006) AM_WRITE(omegaf_io_protection_w) | |
| 442 | AM_RANGE(0xc100, 0xc104) AM_WRITE(robokid_bg0_ctrl_w) // scroll + enable | |
| 443 | AM_RANGE(0xc105, 0xc105) AM_WRITE(robokid_bg0_bank_w) | |
| 444 | AM_RANGE(0xc1e7, 0xc1e7) AM_READNOP // see notes | |
| 445 | AM_RANGE(0xc200, 0xc204) AM_WRITE(robokid_bg1_ctrl_w) // scroll + enable | |
| 446 | AM_RANGE(0xc205, 0xc205) AM_WRITE(robokid_bg1_bank_w) | |
| 447 | AM_RANGE(0xc300, 0xc304) AM_WRITE(robokid_bg2_ctrl_w) // scroll + enable | |
| 448 | AM_RANGE(0xc305, 0xc305) AM_WRITE(robokid_bg2_bank_w) | |
| 449 | AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(robokid_bg0_videoram_r, robokid_bg0_videoram_w) // banked | |
| 450 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(robokid_bg1_videoram_r, robokid_bg1_videoram_w) // banked | |
| 451 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(robokid_bg2_videoram_r, robokid_bg2_videoram_w) // banked | |
| 452 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram) | |
| 453 | AM_RANGE(0xd800, 0xdfff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) | |
| 454 | AM_RANGE(0xe000, 0xf9ff) AM_RAM | |
| 455 | AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram) | |
| 456 | ADDRESS_MAP_END | |
| 457 | ||
| 458 | ||
| 320 | 459 | static ADDRESS_MAP_START( ninjakd2_sound_cpu, ADDRESS_SPACE_PROGRAM, 8 ) |
| 321 | 460 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 322 | 461 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 323 | 462 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 324 | 463 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) |
| 325 | AM_RANGE(0xefee, 0xefee) AM_NOP /* CHIP COMMAND ?? */ | |
| 326 | AM_RANGE(0xeff5, 0xeff6) AM_WRITENOP /* SAMPLE FREQUENCY ??? */ | |
| 327 | AM_RANGE(0xf000, 0xf000) AM_WRITE(ninjakd2_pcm_play_w) /* PCM SAMPLE OFFSET*256 */ | |
| 464 | AM_RANGE(0xf000, 0xf000) AM_WRITE(ninjakd2_pcm_play_w) | |
| 328 | 465 | ADDRESS_MAP_END |
| 329 | 466 | |
| 330 | 467 | static ADDRESS_MAP_START( ninjakd2_sound_io, ADDRESS_SPACE_IO, 8 ) |
| r1591 | r1592 | |
| 337 | 474 | |
| 338 | 475 | |
| 339 | 476 | |
| 477 | /************************************* | |
| 478 | * | |
| 479 | * Port definitions | |
| 480 | * | |
| 481 | *************************************/ | |
| 482 | ||
| 483 | static INPUT_PORTS_START( common ) | |
| 484 | PORT_START_TAG("KEYCOIN") | |
| 485 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 486 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 487 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 488 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 489 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) /* keep pressed during boot to enter service mode */ | |
| 490 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 491 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 492 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 493 | ||
| 494 | PORT_START_TAG("PAD1") | |
| 495 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 496 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 497 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 498 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 499 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 500 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 501 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 502 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 503 | ||
| 504 | PORT_START_TAG("PAD2") | |
| 505 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL | |
| 506 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL | |
| 507 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL | |
| 508 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL | |
| 509 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 510 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 511 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 512 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 513 | INPUT_PORTS_END | |
| 514 | ||
| 515 | static INPUT_PORTS_START( common_2p ) | |
| 516 | PORT_START_TAG("KEYCOIN") | |
| 517 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 518 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 519 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 520 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 521 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) /* keep pressed during boot to enter service mode */ | |
| 522 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 523 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 524 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 525 | ||
| 526 | PORT_START_TAG("PAD1") | |
| 527 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) | |
| 528 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) | |
| 529 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) | |
| 530 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) | |
| 531 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
| 532 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) | |
| 533 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 534 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 535 | ||
| 536 | PORT_START_TAG("PAD2") | |
| 537 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
| 538 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
| 539 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
| 540 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) | |
| 541 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 542 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 543 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 544 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 545 | INPUT_PORTS_END | |
| 546 | ||
| 547 | ||
| 340 | 548 | static INPUT_PORTS_START( ninjakd2 ) |
| 341 | PORT_START | |
| 342 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) | |
| 343 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) | |
| 344 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) | |
| 345 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) | |
| 346 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 347 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 348 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 349 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 549 | PORT_INCLUDE(common) | |
| 350 | 550 | |
| 351 | PORT_START /* player 2 controls */ | |
| 352 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL | |
| 353 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL | |
| 354 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL | |
| 355 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL | |
| 356 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 357 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 358 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 359 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 551 | PORT_START_TAG("DIPSW1") | |
| 552 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1") | |
| 553 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 554 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 555 | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2,3") | |
| 556 | PORT_DIPSETTING( 0x04, "20000 and every 50000" ) | |
| 557 | PORT_DIPSETTING( 0x06, "30000 and every 50000" ) | |
| 558 | PORT_DIPSETTING( 0x02, "50000 and every 50000" ) | |
| 559 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 560 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:4") | |
| 561 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 562 | PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) | |
| 563 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5") | |
| 564 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 565 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 566 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6") | |
| 567 | PORT_DIPSETTING( 0x20, DEF_STR( Normal ) ) | |
| 568 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) | |
| 569 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7") | |
| 570 | PORT_DIPSETTING( 0x40, "3" ) | |
| 571 | PORT_DIPSETTING( 0x00, "4" ) | |
| 572 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:8") | |
| 573 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) | |
| 574 | PORT_DIPSETTING( 0x80, DEF_STR( Japanese ) ) | |
| 360 | 575 | |
| 361 | PORT_START | |
| 362 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 363 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 364 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 365 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 366 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) /* keep pressed during boot to enter service mode */ | |
| 367 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 368 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 369 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 576 | PORT_START_TAG("DIPSW2") | |
| 577 | PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" ) | |
| 578 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2") | |
| 579 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 580 | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) | |
| 581 | PORT_DIPNAME( 0x04, 0x00, "Credit Service" ) PORT_DIPLOCATION("SW2:3") | |
| 582 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 583 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 584 | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5") | |
| 585 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) | |
| 586 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) | |
| 587 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 588 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) | |
| 589 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:6,7,8") | |
| 590 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 591 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) | |
| 592 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) | |
| 593 | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) | |
| 594 | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) | |
| 595 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 596 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) | |
| 597 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 598 | INPUT_PORTS_END | |
| 370 | 599 | |
| 371 | PORT_START /* dsw1 */ | |
| 372 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") | |
| 373 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 374 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 375 | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2,3") | |
| 376 | PORT_DIPSETTING( 0x04, "20000 50000" ) | |
| 377 | PORT_DIPSETTING( 0x06, "30000 50000" ) | |
| 378 | PORT_DIPSETTING( 0x02, "50000 100000" ) | |
| 379 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 380 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:4") | |
| 381 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 382 | PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) | |
| 383 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5") | |
| 384 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 385 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 386 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6") | |
| 387 | PORT_DIPSETTING( 0x20, DEF_STR( Normal ) ) | |
| 388 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) | |
| 389 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7") | |
| 390 | PORT_DIPSETTING( 0x40, "3" ) | |
| 391 | PORT_DIPSETTING( 0x00, "4" ) | |
| 392 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:8") | |
| 393 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) | |
| 394 | PORT_DIPSETTING( 0x80, DEF_STR( Japanese ) ) | |
| 600 | static INPUT_PORTS_START( rdaction ) | |
| 601 | PORT_INCLUDE(ninjakd2) | |
| 395 | 602 | |
| 396 | PORT_START /* dsw2 */ | |
| 397 | PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" ) | |
| 398 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2") | |
| 399 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 400 | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) | |
| 401 | PORT_DIPNAME( 0x04, 0x00, "Credit Service" ) PORT_DIPLOCATION("SW2:3") | |
| 402 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 403 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 404 | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5") | |
| 405 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) | |
| 406 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) | |
| 407 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) | |
| 408 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) | |
| 409 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:6,7,8") | |
| 410 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 411 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) | |
| 412 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) | |
| 413 | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) | |
| 414 | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) | |
| 415 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 416 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) | |
| 417 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 603 | PORT_MODIFY("DIPSW1") | |
| 604 | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2,3") | |
| 605 | PORT_DIPSETTING( 0x04, "20000 and every 50000" ) | |
| 606 | PORT_DIPSETTING( 0x06, "30000 and every 50000" ) | |
| 607 | PORT_DIPSETTING( 0x02, "50000 and every 100000" ) | |
| 418 | 608 | INPUT_PORTS_END |
| 419 | 609 | |
| 610 | static INPUT_PORTS_START( mnight ) | |
| 611 | PORT_INCLUDE(common) | |
| 420 | 612 | |
| 613 | PORT_START_TAG("DIPSW1") | |
| 614 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1") | |
| 615 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 616 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 617 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2") | |
| 618 | PORT_DIPSETTING( 0x02, "30k and every 50k" ) | |
| 619 | PORT_DIPSETTING( 0x00, "50k and every 80k" ) | |
| 620 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3") | |
| 621 | PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) | |
| 622 | PORT_DIPSETTING( 0x00, "Difficult" ) | |
| 623 | PORT_DIPNAME( 0x08, 0x08, "Infinite Lives" ) PORT_DIPLOCATION("SW1:4") | |
| 624 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 625 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 626 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet) ) PORT_DIPLOCATION("SW1:5") | |
| 627 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 628 | PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) | |
| 629 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") | |
| 630 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 631 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 632 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8") | |
| 633 | PORT_DIPSETTING( 0x80, "2" ) | |
| 634 | PORT_DIPSETTING( 0xc0, "3" ) | |
| 635 | PORT_DIPSETTING( 0x40, "4" ) | |
| 636 | PORT_DIPSETTING( 0x00, "5" ) | |
| 421 | 637 | |
| 422 | static const gfx_layout charlayout = | |
| 638 | PORT_START_TAG("DIPSW2") | |
| 639 | PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" ) | |
| 640 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") | |
| 641 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 642 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 643 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") | |
| 644 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 645 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 646 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") | |
| 647 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 648 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 649 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") | |
| 650 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 651 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 652 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:6,7,8") | |
| 653 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 654 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) | |
| 655 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) | |
| 656 | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) | |
| 657 | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) | |
| 658 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 659 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) | |
| 660 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 661 | INPUT_PORTS_END | |
| 662 | ||
| 663 | static INPUT_PORTS_START( arkarea ) | |
| 664 | PORT_INCLUDE(common_2p) | |
| 665 | ||
| 666 | PORT_START_TAG("DIPSW1") | |
| 667 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") | |
| 668 | PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) | |
| 669 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 670 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 671 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 672 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:3") | |
| 673 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 674 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 675 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") | |
| 676 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 677 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 678 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5") | |
| 679 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 680 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 681 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") // Difficulty? Stored at c01a | |
| 682 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 683 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 684 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") | |
| 685 | PORT_DIPSETTING( 0x40, "50000 and every 50000" ) | |
| 686 | PORT_DIPSETTING( 0x00, "100000 and every 100000" ) | |
| 687 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:8") | |
| 688 | PORT_DIPSETTING( 0x80, "3" ) | |
| 689 | PORT_DIPSETTING( 0x00, "4" ) | |
| 690 | ||
| 691 | PORT_START_TAG("DIPSW2") | |
| 692 | PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" ) | |
| 693 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") | |
| 694 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 695 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 696 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") | |
| 697 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 698 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 699 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") | |
| 700 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 701 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 702 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") | |
| 703 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 704 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 705 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") | |
| 706 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 707 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 708 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") | |
| 709 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 710 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 711 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") | |
| 712 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 713 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 714 | INPUT_PORTS_END | |
| 715 | ||
| 716 | static INPUT_PORTS_START( robokid ) | |
| 717 | PORT_INCLUDE(common) | |
| 718 | ||
| 719 | PORT_START_TAG("DIPSW1") | |
| 720 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") | |
| 721 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 722 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 723 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") | |
| 724 | PORT_DIPSETTING( 0x02, "50000 and every 100000" ) | |
| 725 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 726 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6") | |
| 727 | PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) | |
| 728 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) | |
| 729 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:5") | |
| 730 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 731 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 732 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:4") | |
| 733 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 734 | PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) | |
| 735 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3") | |
| 736 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 737 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 738 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") | |
| 739 | PORT_DIPSETTING( 0x80, "2" ) | |
| 740 | PORT_DIPSETTING( 0xc0, "3" ) | |
| 741 | PORT_DIPSETTING( 0x40, "4" ) | |
| 742 | PORT_DIPSETTING( 0x00, "5" ) | |
| 743 | ||
| 744 | PORT_START_TAG("DIPSW2") | |
| 745 | PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" ) | |
| 746 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") | |
| 747 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 748 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 749 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") | |
| 750 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 751 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 752 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") | |
| 753 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 754 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 755 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") | |
| 756 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 757 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 758 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") | |
| 759 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 760 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) | |
| 761 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) | |
| 762 | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) | |
| 763 | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) | |
| 764 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 765 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) | |
| 766 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 767 | INPUT_PORTS_END | |
| 768 | ||
| 769 | static INPUT_PORTS_START( robokidj ) | |
| 770 | PORT_INCLUDE(robokid) | |
| 771 | ||
| 772 | PORT_MODIFY("DIPSW1") | |
| 773 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2") | |
| 774 | PORT_DIPSETTING( 0x02, "30K 50K+" ) | |
| 775 | PORT_DIPSETTING( 0x00, "50K 80K+" ) | |
| 776 | INPUT_PORTS_END | |
| 777 | ||
| 778 | static INPUT_PORTS_START( omegaf ) | |
| 779 | PORT_INCLUDE(common_2p) | |
| 780 | ||
| 781 | PORT_MODIFY("KEYCOIN") | |
| 782 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 783 | ||
| 784 | PORT_START_TAG("DIPSW1") | |
| 785 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") | |
| 786 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 787 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 788 | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7,6") | |
| 789 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 790 | PORT_DIPSETTING( 0x06, DEF_STR( Normal ) ) | |
| 791 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) | |
| 792 | PORT_DIPSETTING( 0x04, DEF_STR( Hardest ) ) | |
| 793 | PORT_SERVICE_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW1:5" ) | |
| 794 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") | |
| 795 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 796 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 797 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3") | |
| 798 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 799 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
| 800 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") | |
| 801 | PORT_DIPSETTING( 0x00, "2" ) | |
| 802 | PORT_DIPSETTING( 0xc0, "3" ) | |
| 803 | PORT_DIPSETTING( 0x40, "4" ) | |
| 804 | PORT_DIPSETTING( 0x80, "5" ) | |
| 805 | ||
| 806 | PORT_START_TAG("DIPSW2") | |
| 807 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:8,7") | |
| 808 | PORT_DIPSETTING( 0x00, "200000" ) | |
| 809 | PORT_DIPSETTING( 0x03, "300000" ) | |
| 810 | PORT_DIPSETTING( 0x01, "500000" ) | |
| 811 | PORT_DIPSETTING( 0x02, "1000000" ) | |
| 812 | PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") | |
| 813 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 814 | PORT_DIPSETTING( 0x10, DEF_STR( 4C_1C ) ) | |
| 815 | PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) | |
| 816 | PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) | |
| 817 | PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) | |
| 818 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) | |
| 819 | PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) | |
| 820 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) | |
| 821 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") | |
| 822 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 823 | PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) ) | |
| 824 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) | |
| 825 | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) | |
| 826 | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) | |
| 827 | PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) | |
| 828 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) | |
| 829 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) | |
| 830 | INPUT_PORTS_END | |
| 831 | ||
| 832 | ||
| 833 | ||
| 834 | /************************************* | |
| 835 | * | |
| 836 | * Graphics layouts | |
| 837 | * | |
| 838 | *************************************/ | |
| 839 | ||
| 840 | static const gfx_layout layout8x8 = | |
| 423 | 841 | { |
| 424 | 8,8, /* 8*8 characters */ | |
| 425 | 1024, /* 1024 characters */ | |
| 426 | 4, /* 4 bits per pixel */ | |
| 427 | {0,1,2,3 }, /* the bitplanes are packed in one nibble */ | |
| 428 | {0, 4, 16384*8+0, 16384*8+4, 8, 12, 16384*8+8, 16384*8+12 }, | |
| 429 | {16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7 }, | |
| 430 | 8*16 | |
| 842 | 8,8, | |
| 843 | RGN_FRAC(1,1), | |
| 844 | 4, | |
| 845 | { STEP4(0,1) }, | |
| 846 | { STEP8(0,4) }, | |
| 847 | { STEP8(0,32) }, | |
| 848 | 32*8 | |
| 431 | 849 | }; |
| 432 | 850 | |
| 433 | static const gfx_layout | |
| 851 | static const gfx_layout | |
| 434 | 852 | { |
| 435 | 16,16, /* 16*16 characters */ | |
| 436 | 1024, /* 1024 sprites */ | |
| 437 | 4, /* 4 bits per pixel */ | |
| 438 | {0,1,2,3}, /* the bitplanes are packed in one nibble */ | |
| 439 | {0, 4, 65536*8+0, 65536*8+4, 8, 12, 65536*8+8, 65536*8+12, | |
| 440 | 16*8+0, 16*8+4, 16*8+65536*8+0, 16*8+65536*8+4, 16*8+8, 16*8+12, 16*8+65536*8+8, 16*8+65536*8+12}, | |
| 441 | {16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7, | |
| 442 | 32*8+16*0, 32*8+16*1, 32*8+16*2, 32*8+16*3, 32*8+16*4, 32*8+16*5, 32*8+16*6, 32*8+16*7}, | |
| 443 | 8*64 | |
| 853 | 16,16, | |
| 854 | RGN_FRAC(1,1), | |
| 855 | 4, | |
| 856 | { STEP4(0,1) }, | |
| 857 | { STEP8(0,4), STEP8(32*8,4) }, | |
| 858 | { STEP8(0,32), STEP8(64*8,32) }, | |
| 859 | 128*8 | |
| 444 | 860 | }; |
| 445 | 861 | |
| 862 | static const gfx_layout robokid_layout16x16 = | |
| 863 | { | |
| 864 | 16,16, | |
| 865 | RGN_FRAC(1,1), | |
| 866 | 4, | |
| 867 | { STEP4(0,1) }, | |
| 868 | { STEP8(0,4), STEP8(64*8,4) }, | |
| 869 | { STEP16(0,32) }, | |
| 870 | 128*8 | |
| 871 | }; | |
| 872 | ||
| 446 | 873 | static GFXDECODE_START( ninjakd2 ) |
| 447 | GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0*16, 16 ) | |
| 448 | GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 ) | |
| 449 | GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout, 32*16, 16 ) | |
| 874 | GFXDECODE_ENTRY( REGION_GFX1, 0, layout8x8, 0x200, 16) // fg | |
| 875 | GFXDECODE_ENTRY( REGION_GFX2, 0, layout16x16, 0x100, 16) // sprites | |
| 876 | GFXDECODE_ENTRY( REGION_GFX3, 0, layout16x16, 0x000, 16) // bg | |
| 450 | 877 | GFXDECODE_END |
| 451 | 878 | |
| 452 | static const struct Samplesinterface samples_interface = | |
| 453 | { | |
| 454 | 1, /* 1 channel */ | |
| 455 | NULL, | |
| 456 | ninjakd2_init_samples | |
| 457 | }; | |
| 879 | static GFXDECODE_START( robokid ) | |
| 880 | GFXDECODE_ENTRY( REGION_GFX1, 0, layout8x8, 0x300, 16) // fg | |
| 881 | GFXDECODE_ENTRY( REGION_GFX2, 0, robokid_layout16x16, 0x200, 16) // sprites | |
| 882 | GFXDECODE_ENTRY( REGION_GFX3, 0, robokid_layout16x16, 0x000, 16) // bg0 | |
| 883 | GFXDECODE_ENTRY( REGION_GFX4, 0, robokid_layout16x16, 0x000, 16) // bg1 | |
| 884 | GFXDECODE_ENTRY( REGION_GFX5, 0, robokid_layout16x16, 0x000, 16) // bg2 | |
| 885 | GFXDECODE_END | |
| 458 | 886 | |
| 459 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ | |
| 887 | ||
| 888 | ||
| 889 | /************************************* | |
| 890 | * | |
| 891 | * Sound definitions | |
| 892 | * | |
| 893 | *************************************/ | |
| 894 | ||
| 460 | 895 | static void irqhandler(int irq) |
| 461 | 896 | { |
| 462 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 897 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 463 | 898 | } |
| 464 | 899 | |
| 465 | 900 | static const struct YM2203interface ym2203_interface = |
| 466 | 901 | { |
| 467 | 0,0,0,0,irqhandler | |
| 902 | 0, 0, 0, 0, | |
| 903 | irqhandler | |
| 468 | 904 | }; |
| 469 | 905 | |
| 470 | 906 | |
| 907 | static const struct Samplesinterface samples_interface = | |
| 908 | { | |
| 909 | 1, /* 1 channel */ | |
| 910 | NULL, | |
| 911 | ninjakd2_init_samples | |
| 912 | }; | |
| 913 | ||
| 914 | ||
| 915 | ||
| 916 | /************************************* | |
| 917 | * | |
| 918 | * Machine drivers | |
| 919 | * | |
| 920 | *************************************/ | |
| 921 | ||
| 471 | 922 | static MACHINE_DRIVER_START( ninjakd2 ) |
| 472 | 923 | |
| 473 | 924 | /* basic machine hardware */ |
| 474 | MDRV_CPU_ADD(Z80, 12000000/2) /* 12000000/2 (verified on pcb) */ | |
| 475 | MDRV_CPU_PROGRAM_MAP(ninjakd2_main_cpu,0) /* very sensitive to these settings */ | |
| 925 | MDRV_CPU_ADD_TAG("main", Z80, MAIN_CLOCK_12/2) /* verified */ | |
| 926 | MDRV_CPU_PROGRAM_MAP(ninjakd2_main_cpu,0) | |
| 476 | 927 | MDRV_CPU_VBLANK_INT(ninjakd2_interrupt,1) |
| 477 | 928 | |
| 478 | MDRV_CPU_ADD(Z80, 5000000) | |
| 479 | /* audio CPU */ /* 5mhz crystal (verified on pcb) */ | |
| 929 | MDRV_CPU_ADD_TAG("sound", Z80, MAIN_CLOCK_5) /* verified */ | |
| 480 | 930 | MDRV_CPU_PROGRAM_MAP(ninjakd2_sound_cpu,0) |
| 481 | 931 | MDRV_CPU_IO_MAP(ninjakd2_sound_io,0) |
| 482 | 932 | |
| 483 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 484 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(10000)) | |
| 933 | MDRV_MACHINE_RESET(ninjakd2) | |
| 485 | 934 | |
| 486 | 935 | /* video hardware */ |
| 936 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 487 | 937 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 488 | 938 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 489 | 939 | MDRV_SCREEN_SIZE(32*8, 32*8) |
| 490 | 940 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1) |
| 491 | 941 | MDRV_GFXDECODE(ninjakd2) |
| 492 | MDRV_PALETTE_LENGTH( | |
| 942 | MDRV_PALETTE_LENGTH(0x300) | |
| 493 | 943 | |
| 494 | 944 | MDRV_VIDEO_START(ninjakd2) |
| 495 | 945 | MDRV_VIDEO_UPDATE(ninjakd2) |
| 946 | MDRV_VIDEO_EOF(ninjakd2) | |
| 496 | 947 | |
| 497 | 948 | /* sound hardware */ |
| 498 | 949 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 499 | 950 | |
| 500 | MDRV_SOUND_ADD(YM2203, 1 | |
| 951 | MDRV_SOUND_ADD_TAG("2203.1", YM2203, MAIN_CLOCK_12/8 | |
| 501 | 952 | MDRV_SOUND_CONFIG(ym2203_interface) |
| 502 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) | |
| 953 | MDRV_SOUND_ROUTE(0, "mono", 0.10) | |
| 954 | MDRV_SOUND_ROUTE(1, "mono", 0.10) | |
| 955 | MDRV_SOUND_ROUTE(2, "mono", 0.10) | |
| 956 | MDRV_SOUND_ROUTE(3, "mono", 0.50) | |
| 503 | 957 | |
| 504 | MDRV_SOUND_ADD(YM2203, 1500000) /* verified on pcb */ | |
| 505 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) | |
| 958 | MDRV_SOUND_ADD_TAG("2203.2", YM2203, MAIN_CLOCK_12/8) /* verified */ | |
| 959 | MDRV_SOUND_ROUTE(0, "mono", 0.10) | |
| 960 | MDRV_SOUND_ROUTE(1, "mono", 0.10) | |
| 961 | MDRV_SOUND_ROUTE(2, "mono", 0.10) | |
| 962 | MDRV_SOUND_ROUTE(3, "mono", 0.50) | |
| 506 | 963 | |
| 507 | MDRV_SOUND_ADD(SAMPLES, 0) | |
| 964 | MDRV_SOUND_ADD_TAG("PCM", SAMPLES, 0) | |
| 508 | 965 | MDRV_SOUND_CONFIG(samples_interface) |
| 509 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
| 966 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) | |
| 510 | 967 | MACHINE_DRIVER_END |
| 511 | 968 | |
| 969 | static MACHINE_DRIVER_START( mnight ) | |
| 512 | 970 | |
| 971 | /* basic machine hardware */ | |
| 972 | MDRV_IMPORT_FROM(ninjakd2) | |
| 513 | 973 | |
| 974 | MDRV_CPU_MODIFY("main") | |
| 975 | MDRV_CPU_PROGRAM_MAP(mnight_main_cpu,0) | |
| 976 | ||
| 977 | /* video hardware */ | |
| 978 | MDRV_VIDEO_START(mnight) | |
| 979 | ||
| 980 | /* sound hardware */ | |
| 981 | MDRV_SOUND_REMOVE("PCM") | |
| 982 | MACHINE_DRIVER_END | |
| 983 | ||
| 984 | static MACHINE_DRIVER_START( robokid ) | |
| 985 | ||
| 986 | /* basic machine hardware */ | |
| 987 | MDRV_IMPORT_FROM(mnight) | |
| 988 | ||
| 989 | MDRV_CPU_MODIFY("main") | |
| 990 | MDRV_CPU_PROGRAM_MAP(robokid_main_cpu, 0) | |
| 991 | ||
| 992 | MDRV_MACHINE_RESET(robokid) | |
| 993 | ||
| 994 | /* video hardware */ | |
| 995 | MDRV_GFXDECODE(robokid) | |
| 996 | MDRV_PALETTE_LENGTH(0x400) // RAM is this large, but still only 0x300 colors used | |
| 997 | ||
| 998 | MDRV_VIDEO_START(robokid) | |
| 999 | MDRV_VIDEO_UPDATE(robokid) | |
| 1000 | MACHINE_DRIVER_END | |
| 1001 | ||
| 1002 | static MACHINE_DRIVER_START( omegaf ) | |
| 1003 | ||
| 1004 | /* basic machine hardware */ | |
| 1005 | MDRV_IMPORT_FROM(robokid) | |
| 1006 | ||
| 1007 | MDRV_CPU_MODIFY("main") | |
| 1008 | MDRV_CPU_PROGRAM_MAP(omegaf_main_cpu, 0) | |
| 1009 | ||
| 1010 | MDRV_MACHINE_RESET(omegaf) | |
| 1011 | ||
| 1012 | /* video hardware */ | |
| 1013 | MDRV_VIDEO_START(omegaf) | |
| 1014 | MDRV_VIDEO_UPDATE(omegaf) | |
| 1015 | MACHINE_DRIVER_END | |
| 1016 | ||
| 1017 | ||
| 1018 | ||
| 1019 | /************************************* | |
| 1020 | * | |
| 1021 | * ROM definitions | |
| 1022 | * | |
| 1023 | *************************************/ | |
| 1024 | ||
| 514 | 1025 | ROM_START( ninjakd2 ) |
| 515 | 1026 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) |
| 516 | 1027 | ROM_LOAD( "nk2_01.rom", 0x00000, 0x8000, CRC(3cdbb906) SHA1(f48f82528b5fc581ee3b1ccd0ef9cdecc7249bb3) ) |
| 517 | ROM_LOAD( "nk2_02.rom", 0x10000, 0x8000, CRC(b5ce9a1a) SHA1(295a7e1d41e1a8ee45f1250086a0c9314837eded) ) | |
| 1028 | ROM_LOAD( "nk2_02.rom", 0x10000, 0x8000, CRC(b5ce9a1a) SHA1(295a7e1d41e1a8ee45f1250086a0c9314837eded) ) // banked at 8000-bfff | |
| 518 | 1029 | ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) |
| 519 | 1030 | ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) |
| 520 | 1031 | ROM_LOAD( "nk2_05.rom", 0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) ) |
| 521 | 1032 | |
| 522 | 1033 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) |
| 523 | ROM_LOAD( "nk2_06.rom", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) | |
| 1034 | ROM_LOAD( "nk2_06.rom", 0x00000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) | |
| 524 | 1035 | |
| 525 | 1036 | ROM_REGION( 0x2000, REGION_USER1, 0 ) /* MC8123 key */ |
| 526 | 1037 | ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) |
| 527 | 1038 | |
| 528 | ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 529 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x4000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) /* background tiles */ | |
| 530 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 531 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 532 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 533 | ROM_LOAD( "nk2_10.rom", 0x08000, 0x4000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) | |
| 534 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 535 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 536 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1039 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles (need lineswapping) | |
| 1040 | ROM_LOAD( "nk2_12.rom", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) | |
| 537 | 1041 | |
| 538 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) | |
| 539 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x4000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) /* sprites tiles */ | |
| 540 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 541 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 542 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 543 | ROM_LOAD( "nk2_07.rom", 0x08000, 0x4000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) | |
| 544 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 545 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 546 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1042 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) // sprites (need lineswapping) | |
| 1043 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) | |
| 1044 | ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) | |
| 547 | 1045 | |
| 548 | ROM_REGION( 0x08000, REGION_GFX3, ROMREGION_DISPOSE ) | |
| 549 | ROM_LOAD( "nk2_12.rom", 0x00000, 0x02000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) /* foreground tiles */ | |
| 550 | ROM_CONTINUE( 0x04000, 0x02000) | |
| 551 | ROM_CONTINUE( 0x02000, 0x02000) | |
| 552 | ROM_CONTINUE( 0x06000, 0x02000) | |
| 1046 | ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE ) // bg tiles (need lineswapping) | |
| 1047 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) | |
| 1048 | ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) | |
| 553 | 1049 | |
| 554 | 1050 | ROM_REGION( 0x10000, REGION_SOUND1, 0 ) |
| 555 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) / | |
| 1051 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples | |
| 556 | 1052 | ROM_END |
| 557 | 1053 | |
| 558 | 1054 | ROM_START( ninjak2a ) |
| 559 | 1055 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) |
| 560 | 1056 | ROM_LOAD( "nk2_01.bin", 0x00000, 0x8000, CRC(e6adca65) SHA1(33d483dde0853f37455cde32b461f4e919601b4b) ) |
| 561 | ROM_LOAD( "nk2_02.bin", 0x10000, 0x8000, CRC(d9284bd1) SHA1(e790fb1a718a1f7997931f2f390fe053655f231d) ) | |
| 1057 | ROM_LOAD( "nk2_02.bin", 0x10000, 0x8000, CRC(d9284bd1) SHA1(e790fb1a718a1f7997931f2f390fe053655f231d) ) // banked at 8000-bfff | |
| 562 | 1058 | ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) |
| 563 | 1059 | ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) |
| 564 | 1060 | ROM_LOAD( "nk2_05.bin", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) |
| 565 | 1061 | |
| 566 | ROM_REGION( 2*0x10000, REGION_CPU2, 0 ) /* 64k for code + 64k for decrypted opcodes */ | |
| 567 | ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) /* decrypted opcodes */ | |
| 568 | ROM_CONTINUE( 0x00000, 0x8000 ) /* decrypted data */ | |
| 1062 | ROM_REGION( 2*0x10000, REGION_CPU2, 0 ) | |
| 1063 | ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) // decrypted opcodes | |
| 1064 | ROM_CONTINUE( 0x00000, 0x8000 ) // decrypted data | |
| 569 | 1065 | |
| 570 | ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 571 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x4000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) /* background tiles */ | |
| 572 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 573 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 574 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 575 | ROM_LOAD( "nk2_10.rom", 0x08000, 0x4000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) | |
| 576 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 577 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 578 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1066 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles (need lineswapping) | |
| 1067 | ROM_LOAD( "nk2_12.rom", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) | |
| 579 | 1068 | |
| 580 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) | |
| 581 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x4000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) /* sprites tiles */ | |
| 582 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 583 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 584 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 585 | ROM_LOAD( "nk2_07.rom", 0x08000, 0x4000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) | |
| 586 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 587 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 588 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1069 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) // sprites (need lineswapping) | |
| 1070 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) | |
| 1071 | ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) | |
| 589 | 1072 | |
| 590 | ROM_REGION( 0x08000, REGION_GFX3, ROMREGION_DISPOSE ) | |
| 591 | ROM_LOAD( "nk2_12.rom", 0x00000, 0x02000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) /* foreground tiles */ | |
| 592 | ROM_CONTINUE( 0x04000, 0x02000) | |
| 593 | ROM_CONTINUE( 0x02000, 0x02000) | |
| 594 | ROM_CONTINUE( 0x06000, 0x02000) | |
| 1073 | ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE ) // bg tiles (need lineswapping) | |
| 1074 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) | |
| 1075 | ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) | |
| 595 | 1076 | |
| 596 | 1077 | ROM_REGION( 0x10000, REGION_SOUND1, 0 ) |
| 597 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) / | |
| 1078 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // unsigned 8-bit pcm samples | |
| 598 | 1079 | ROM_END |
| 599 | 1080 | |
| 600 | 1081 | ROM_START( ninjak2b ) |
| 601 | 1082 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) |
| 602 | 1083 | ROM_LOAD( "1.3s", 0x00000, 0x8000, CRC(cb4f4624) SHA1(4fc66641adc0a2c0eca332f27c5777df62fa507b) ) |
| 603 | ROM_LOAD( "2.3q", 0x10000, 0x8000, CRC(0ad0c100) SHA1(c5bbc107ba07bd6950bb4d7377e827c084b8229b) ) | |
| 604 | ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) | |
| 605 | ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) | |
| 606 | ROM_LOAD( "nk2_05.rom", 0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) ) | |
| 1084 | ROM_LOAD( "2.3q", 0x10000, 0x8000, CRC(0ad0c100) SHA1(c5bbc107ba07bd6950bb4d7377e827c084b8229b) ) // banked at 8000-bfff | |
| 1085 | ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) // 3.3p | |
| 1086 | ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) // 4.3n | |
| 1087 | ROM_LOAD( "nk2_05.rom", 0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) ) // 5.3l | |
| 607 | 1088 | |
| 608 | ROM_REGION( 2*0x10000, REGION_CPU2, 0 ) /* 64k for code + 64k for decrypted opcodes */ | |
| 609 | ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) /* decrypted opcodes */ | |
| 610 | ROM_CONTINUE( 0x00000, 0x8000 ) /* decrypted data */ | |
| 1089 | ROM_REGION( 2*0x10000, REGION_CPU2, 0 ) | |
| 1090 | ROM_LOAD( "nk2_06.bin", 0x10000, 0x8000, CRC(7bfe6c9e) SHA1(aef8cbeb0024939bf65f77113a5cf777f6613722) ) // 6.3g decrypted opcodes | |
| 1091 | ROM_CONTINUE( 0x00000, 0x8000 ) // decrypted data | |
| 611 | 1092 | |
| 612 | ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 613 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x4000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) /* background tiles */ | |
| 614 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 615 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 616 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 617 | ROM_LOAD( "nk2_10.rom", 0x08000, 0x4000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) | |
| 618 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 619 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 620 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1093 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles (need lineswapping) | |
| 1094 | ROM_LOAD( "nk2_12.rom", 0x00000, 0x08000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) // 12.5m | |
| 621 | 1095 | |
| 622 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) | |
| 623 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x4000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) /* sprites tiles */ | |
| 624 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 625 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 626 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 627 | ROM_LOAD( "nk2_07.rom", 0x08000, 0x4000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) | |
| 628 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 629 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 630 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1096 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) // sprites (need lineswapping) | |
| 1097 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) // 8.6k | |
| 1098 | ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) // 7.6m | |
| 631 | 1099 | |
| 632 | ROM_REGION( 0x08000, REGION_GFX3, ROMREGION_DISPOSE ) | |
| 633 | ROM_LOAD( "nk2_12.rom", 0x00000, 0x02000, CRC(db5657a9) SHA1(abbb033edb9a5a0c66ee5981d1e4df1ab334a82d) ) /* foreground tiles */ | |
| 634 | ROM_CONTINUE( 0x04000, 0x02000) | |
| 635 | ROM_CONTINUE( 0x02000, 0x02000) | |
| 636 | ROM_CONTINUE( 0x06000, 0x02000) | |
| 1100 | ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE ) // bg tiles (need lineswapping) | |
| 1101 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) // 11.2m | |
| 1102 | ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) // 10.2p | |
| 637 | 1103 | |
| 638 | 1104 | ROM_REGION( 0x10000, REGION_SOUND1, 0 ) |
| 639 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) / | |
| 1105 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // 9.6d unsigned 8-bit pcm samples | |
| 640 | 1106 | ROM_END |
| 641 | 1107 | |
| 642 | 1108 | ROM_START( rdaction ) |
| 643 | 1109 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) |
| 644 | ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(5c475611) SHA1(2da88a95b5d68b259c8ae48af1438a82a1d601c1) ) | |
| 645 | ROM_LOAD( "2.3s", 0x10000, 0x8000, CRC(a1e23bd2) SHA1(c3b6574dc9fa66b4f41c37754a0d20a865f8bc28) ) | |
| 646 | ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) | |
| 647 | ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) | |
| 648 | ROM_LOAD( "nk2_05.bin", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) | |
| 1110 | ROM_LOAD( "1.3u", 0x00000, 0x8000, CRC(5c475611) SHA1(2da88a95b5d68b259c8ae48af1438a82a1d601c1) ) | |
| 1111 | ROM_LOAD( "2.3s", 0x10000, 0x8000, CRC(a1e23bd2) SHA1(c3b6574dc9fa66b4f41c37754a0d20a865f8bc28) ) // banked at 8000-bfff | |
| 1112 | ROM_LOAD( "nk2_03.rom", 0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) ) // 3.3r | |
| 1113 | ROM_LOAD( "nk2_04.rom", 0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) ) // 4.3p | |
| 1114 | ROM_LOAD( "nk2_05.bin", 0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) ) // 5.3m | |
| 649 | 1115 | |
| 650 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for code + 64k for decrypted opcodes */ | |
| 651 | ROM_LOAD( "nk2_06.rom", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // sound z80 code encrypted | |
| 1116 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1117 | ROM_LOAD( "nk2_06.rom", 0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) ) // 6.3h encrypted | |
| 652 | 1118 | |
| 653 | 1119 | ROM_REGION( 0x2000, REGION_USER1, 0 ) /* MC8123 key */ |
| 654 | 1120 | ROM_LOAD( "ninjakd2.key", 0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) ) |
| 655 | 1121 | |
| 656 | ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 657 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x4000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) /* background tiles */ | |
| 658 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 659 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 660 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 661 | ROM_LOAD( "nk2_10.rom", 0x08000, 0x4000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) | |
| 662 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 663 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 664 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1122 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles (need lineswapping) | |
| 1123 | ROM_LOAD( "12.5n", 0x00000, 0x08000, CRC(0936b365) SHA1(3705f42b76ab474357e77c1a9b8e3755c7ab2c0c) ) // 12.5n | |
| 665 | 1124 | |
| 666 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) | |
| 667 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x4000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) /* sprites tiles */ | |
| 668 | ROM_CONTINUE( 0x10000, 0x4000) | |
| 669 | ROM_CONTINUE( 0x04000, 0x4000) | |
| 670 | ROM_CONTINUE( 0x14000, 0x4000) | |
| 671 | ROM_LOAD( "nk2_07.rom", 0x08000, 0x4000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) | |
| 672 | ROM_CONTINUE( 0x18000, 0x4000) | |
| 673 | ROM_CONTINUE( 0x0c000, 0x4000) | |
| 674 | ROM_CONTINUE( 0x1c000, 0x4000) | |
| 1125 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) // sprites (need lineswapping) | |
| 1126 | ROM_LOAD( "nk2_08.rom", 0x00000, 0x10000, CRC(1b79c50a) SHA1(8954bc51cb9fbbe16b09381f35c84ccc56a803f3) ) // 8.6l | |
| 1127 | ROM_LOAD( "nk2_07.rom", 0x10000, 0x10000, CRC(0be5cd13) SHA1(8f94a8fef6668aaf13329715fee81302dbd6c685) ) // 7.6n | |
| 675 | 1128 | |
| 676 | ROM_REGION( 0x08000, REGION_GFX3, ROMREGION_DISPOSE ) | |
| 677 | ROM_LOAD( "12.5n", 0x00000, 0x02000, CRC(0936b365) SHA1(3705f42b76ab474357e77c1a9b8e3755c7ab2c0c) ) /* foreground tiles */ | |
| 678 | ROM_CONTINUE( 0x04000, 0x02000) | |
| 679 | ROM_CONTINUE( 0x02000, 0x02000) | |
| 680 | ROM_CONTINUE( 0x06000, 0x02000) | |
| 1129 | ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE ) // bg tiles (need lineswapping) | |
| 1130 | ROM_LOAD( "nk2_11.rom", 0x00000, 0x10000, CRC(41a714b3) SHA1(b05f48d71a9837914c12c13e0b479c8a6dc8c25e) ) // 11.2n | |
| 1131 | ROM_LOAD( "nk2_10.rom", 0x10000, 0x10000, CRC(c913c4ab) SHA1(f822c5621b3e32c1a284f6367bdcace81c1c74b3) ) // 10.2r | |
| 681 | 1132 | |
| 682 | 1133 | ROM_REGION( 0x10000, REGION_SOUND1, 0 ) |
| 683 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) / | |
| 1134 | ROM_LOAD( "nk2_09.rom", 0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) ) // 9.6c unsigned 8-bit pcm samples | |
| 684 | 1135 | ROM_END |
| 685 | 1136 | |
| 1137 | ROM_START( mnight ) | |
| 1138 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) | |
| 1139 | ROM_LOAD( "mn6-j19.bin", 0x00000, 0x8000, CRC(56678d14) SHA1(acf3a97ca29db8ab9cad69599c5567464af3ae44) ) | |
| 1140 | ROM_LOAD( "mn5-j17.bin", 0x10000, 0x8000, CRC(2a73f88e) SHA1(0a7b769174f2b976650453d808cb23668dff0260) ) // banked at 8000-bfff | |
| 1141 | ROM_LOAD( "mn4-j16.bin", 0x18000, 0x8000, CRC(c5e42bb4) SHA1(1956e737ae393e987cb7e8eae520518f1e0f597f) ) | |
| 1142 | ROM_LOAD( "mn3-j14.bin", 0x20000, 0x8000, CRC(df6a4f7a) SHA1(ce3cb84b514220d686b12c03567289fd23da0fe1) ) | |
| 1143 | ROM_LOAD( "mn2-j12.bin", 0x28000, 0x8000, CRC(9c391d1b) SHA1(06e8c202337e3eba38c479e8b7e29a3f8ffc4ed1) ) | |
| 686 | 1144 | |
| 1145 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1146 | ROM_LOAD( "mn1-j7.bin", 0x00000, 0x10000, CRC(a0782a31) SHA1(8abd2f0b0c2c2eb876f324f7a095a5cdc773c187) ) | |
| 687 | 1147 | |
| 1148 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles (need lineswapping) | |
| 1149 | ROM_LOAD( "mn10-b10.bin", 0x00000, 0x08000, CRC(37b8221f) SHA1(ac86e0ae8039fd30a028a893d08ce099f7765615) ) | |
| 1150 | ||
| 1151 | ROM_REGION( 0x30000, REGION_GFX2, ROMREGION_DISPOSE ) // sprites (need lineswapping) | |
| 1152 | ROM_LOAD( "mn7-e11.bin", 0x00000, 0x10000, CRC(4883059c) SHA1(53d4b9b0f0725c25e302ee1549a306778ec74d85) ) | |
| 1153 | ROM_LOAD( "mn8-e12.bin", 0x10000, 0x10000, CRC(02b91445) SHA1(f0cf85f9e17c40248de16bca8df6d745e359b92d) ) | |
| 1154 | ROM_LOAD( "mn9-e14.bin", 0x20000, 0x10000, CRC(9f08d160) SHA1(1a0041ad138e7e6598d4d03d7cbd52a7244557ac) ) | |
| 1155 | ||
| 1156 | ROM_REGION( 0x30000, REGION_GFX3, ROMREGION_DISPOSE ) // bg tiles (need lineswapping) | |
| 1157 | ROM_LOAD( "mn11-b20.bin", 0x00000, 0x10000, CRC(4d37e0f4) SHA1(a6d9aaccd97769197622cda45474e223c2ee1d98) ) | |
| 1158 | ROM_LOAD( "mn12-b22.bin", 0x10000, 0x10000, CRC(b22cbbd3) SHA1(70984f1051fd236730d97011bc87dacb3ca38594) ) | |
| 1159 | ROM_LOAD( "mn13-b23.bin", 0x20000, 0x10000, CRC(65714070) SHA1(48f3c130c97d00e8f0535904dc2237277067c475) ) | |
| 1160 | ROM_END | |
| 1161 | ||
| 1162 | ROM_START( arkarea ) | |
| 1163 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) | |
| 1164 | ROM_LOAD( "arkarea.008", 0x00000, 0x8000, CRC(1ce1b5b9) SHA1(ab7755523d58736b124deb59779dedee870fd7d2) ) | |
| 1165 | ROM_LOAD( "arkarea.009", 0x10000, 0x8000, CRC(db1c81d1) SHA1(64a2f51c218d84c4eaeb8c5a5a3f0f4cdf5d174c) ) // banked at 8000-bfff | |
| 1166 | ROM_LOAD( "arkarea.010", 0x18000, 0x8000, CRC(5a460dae) SHA1(e64d3662bb074a528cd71061621c0dd3765928b6) ) | |
| 1167 | ROM_LOAD( "arkarea.011", 0x20000, 0x8000, CRC(63f022c9) SHA1(414f52d2b9584f08285b261d1dafcc9e6e5e0c74) ) | |
| 1168 | ROM_LOAD( "arkarea.012", 0x28000, 0x8000, CRC(3c4c65d5) SHA1(e11f840f8b1da0933a0a4342f5fa1a17f0d6d3e2) ) | |
| 1169 | ||
| 1170 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1171 | ROM_LOAD( "arkarea.013", 0x00000, 0x8000, CRC(2d409d58) SHA1(6344b43db5459691728c3f843b643c84ea71dd8e) ) | |
| 1172 | ||
| 1173 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles (need lineswapping) | |
| 1174 | ROM_LOAD( "arkarea.004", 0x00000, 0x08000, CRC(69e36af2) SHA1(2bccef8f396dcb5261af0140af04c95ee8ecae11) ) | |
| 1175 | ||
| 1176 | ROM_REGION( 0x30000, REGION_GFX2, ROMREGION_DISPOSE ) // sprites (need lineswapping) | |
| 1177 | ROM_LOAD( "arkarea.007", 0x00000, 0x10000, CRC(d5684a27) SHA1(4961e8a5df2510afb1ef3e937d0a5d52e91893a3) ) | |
| 1178 | ROM_LOAD( "arkarea.006", 0x10000, 0x10000, CRC(2c0567d6) SHA1(f36a2a3ff487660f89470516617482331f008da0) ) | |
| 1179 | ROM_LOAD( "arkarea.005", 0x20000, 0x10000, CRC(9886004d) SHA1(4050756af5c00ab1a368780fe091460fd9e2cb05) ) | |
| 1180 | ||
| 1181 | ROM_REGION( 0x30000, REGION_GFX3, ROMREGION_DISPOSE ) // bg tiles (need lineswapping) | |
| 1182 | ROM_LOAD( "arkarea.003", 0x00000, 0x10000, CRC(6f45a308) SHA1(b6994fe1f50d5e9cf38d3efbd69a2c5f76f33c56) ) | |
| 1183 | ROM_LOAD( "arkarea.002", 0x10000, 0x10000, CRC(051d3482) SHA1(3ebef1a7280f52df6d5ee34e3d4e7567aac0c165) ) | |
| 1184 | ROM_LOAD( "arkarea.001", 0x20000, 0x10000, CRC(09d11ab7) SHA1(14f68e93e7173069f790493eafe9e1adc1a074cc) ) | |
| 1185 | ROM_END | |
| 1186 | ||
| 1187 | ROM_START( robokid ) | |
| 1188 | ROM_REGION( 0x48000, REGION_CPU1, 0 ) | |
| 1189 | ROM_LOAD( "robokid1.18j", 0x00000, 0x08000, CRC(378c21fc) SHA1(58163bd6fbfa8385b1bd648cfde3d75bf81ac07d) ) | |
| 1190 | ROM_CONTINUE( 0x10000, 0x08000 ) // banked at 8000-bfff | |
| 1191 | ROM_LOAD( "robokid2.18k", 0x18000, 0x10000, CRC(ddef8c5a) SHA1(a1dd2f51205863c3d5d3527991d538ca8adf7587) ) | |
| 1192 | ROM_LOAD( "robokid3.15k", 0x28000, 0x10000, CRC(05295ec3) SHA1(33dd0853a2064cb4301cfbdc7856def81f6e1223) ) | |
| 1193 | ROM_LOAD( "robokid4.12k", 0x38000, 0x10000, CRC(3bc3977f) SHA1(da394e12d197b0e109b03c854da06b1267bd9d59) ) | |
| 1194 | ROM_COPY( REGION_CPU1, 0x10000, 0x8000, 0x4000 ) /* to avoid crash because of code that crosses bank boundary */ | |
| 1195 | ||
| 1196 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1197 | ROM_LOAD( "robokid.k7", 0x00000, 0x10000, CRC(f490a2e9) SHA1(861d1256c090ce3d1f45f95cc894affbbc3f1466) ) | |
| 1198 | ||
| 1199 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles | |
| 1200 | ROM_LOAD( "robokid.b9", 0x00000, 0x08000, CRC(fac59c3f) SHA1(1b202ad5c12982512129d9e097267dd31b984ae8) ) | |
| 1201 | ||
| 1202 | ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE ) // sprite tiles | |
| 1203 | ROM_LOAD( "robokid.15f", 0x00000, 0x10000, CRC(ba61f5ab) SHA1(8433ddd55f0184cd5e8bb4a94a1c2336b2f8ff05) ) | |
| 1204 | ROM_LOAD( "robokid.16f", 0x10000, 0x10000, CRC(d9b399ce) SHA1(70755c9cae27187f183ae6d61bedb95c420756f4) ) | |
| 1205 | ROM_LOAD( "robokid.17f", 0x20000, 0x10000, CRC(afe432b9) SHA1(1ec7954ccf112eddf0ffcb8b5aec6cbc5cba7a7a) ) | |
| 1206 | ROM_LOAD( "robokid.18f", 0x30000, 0x10000, CRC(a0aa2a84) SHA1(4d46c169429cd285644336c7d47e393b33bd8770) ) | |
| 1207 | ||
| 1208 | ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE ) // bg0 tiles | |
| 1209 | ROM_LOAD( "robokid.19c", 0x00000, 0x10000, CRC(02220421) SHA1(f533e9c6cea1dccbb60e0528c470f3cb5e8fc44e) ) | |
| 1210 | ROM_LOAD( "robokid.20c", 0x10000, 0x10000, CRC(02d59bc2) SHA1(031acbb14145f9f4623de8868c6207fb9f8e8207) ) | |
| 1211 | ROM_LOAD( "robokid.17d", 0x20000, 0x10000, CRC(2fa29b99) SHA1(13dce7932e2e9c03a139a4293584838aa3d9f1c3) ) | |
| 1212 | ROM_LOAD( "robokid.18d", 0x30000, 0x10000, CRC(ae15ce02) SHA1(175e4eebdf12f1f373e01a4b1c933053ddd09abf) ) | |
| 1213 | ROM_LOAD( "robokid.19d", 0x40000, 0x10000, CRC(784b089e) SHA1(1ae3346b4afa3da9484ebc59c8a530cb95f7d277) ) | |
| 1214 | ROM_LOAD( "robokid.20d", 0x50000, 0x10000, CRC(b0b395ed) SHA1(31ec07634053793a701bbfd601b029f7da66e9d7) ) | |
| 1215 | ROM_LOAD( "robokid.19f", 0x60000, 0x10000, CRC(0f9071c6) SHA1(8bf0c35189eda98a9bc150788890e136870cb5b2) ) | |
| 1216 | ||
| 1217 | ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE ) // bg1 tiles | |
| 1218 | ROM_LOAD( "robokid.12c", 0x00000, 0x10000, CRC(0ab45f94) SHA1(d8274263068d998c89a1b247dde7f814037cc15b) ) | |
| 1219 | ROM_LOAD( "robokid.14c", 0x10000, 0x10000, CRC(029bbd4a) SHA1(8e078cdafe608fc6cde827be85c5267ade4ecca6) ) | |
| 1220 | ROM_LOAD( "robokid.15c", 0x20000, 0x10000, CRC(7de67ebb) SHA1(2fe92e50e2894dd363e69b053db96bdb66a273eb) ) | |
| 1221 | ROM_LOAD( "robokid.16c", 0x30000, 0x10000, CRC(53c0e582) SHA1(763e6127532d022a707bf9ddf1a832413745f248) ) | |
| 1222 | ROM_LOAD( "robokid.17c", 0x40000, 0x10000, CRC(0cae5a1e) SHA1(a183a33516c81ea2c029b72ee6261c4519e095ab) ) | |
| 1223 | ROM_LOAD( "robokid.18c", 0x50000, 0x10000, CRC(56ac7c8a) SHA1(66ed5646a2e8563caeb4ff96fa7d34fde27e9899) ) | |
| 1224 | ROM_LOAD( "robokid.15d", 0x60000, 0x10000, CRC(cd632a4d) SHA1(a537d9ced45fdac490097e9162ac4d09a470be79) ) | |
| 1225 | ROM_LOAD( "robokid.16d", 0x70000, 0x10000, CRC(18d92b2b) SHA1(e6d20ea8f0fac8bd4824a3b279a0fd8a1d6c26f5) ) | |
| 1226 | ||
| 1227 | ROM_REGION( 0x80000, REGION_GFX5, ROMREGION_DISPOSE ) // bg2 tiles | |
| 1228 | ROM_LOAD( "robokid.12a", 0x00000, 0x10000, CRC(e64d1c10) SHA1(d1073c80c9788aba65410f88691747a37b2a9d4a) ) | |
| 1229 | ROM_LOAD( "robokid.14a", 0x10000, 0x10000, CRC(8f9371e4) SHA1(0ea06d62bf4673ebda49a849cead832a24e5b886) ) | |
| 1230 | ROM_LOAD( "robokid.15a", 0x20000, 0x10000, CRC(469204e7) SHA1(8c2e94635b2b304e7dfa2e6ad58ba526dcf02453) ) | |
| 1231 | ROM_LOAD( "robokid.16a", 0x30000, 0x10000, CRC(4e340815) SHA1(d204b830c5809f25f7dfa451bbcbeda8b81ced54) ) | |
| 1232 | ROM_LOAD( "robokid.17a", 0x40000, 0x10000, CRC(f0863106) SHA1(ff7e44d0aa5a07ec9a7eddef1a55181bd2e867b1) ) | |
| 1233 | ROM_LOAD( "robokid.18a", 0x50000, 0x10000, CRC(fdff7441) SHA1(843b2c92bbc6f7319568677d50cbd9b03475b34a) ) | |
| 1234 | ROM_END | |
| 1235 | ||
| 1236 | ROM_START( robokidj ) | |
| 1237 | ROM_REGION( 0x48000, REGION_CPU1, 0 ) | |
| 1238 | ROM_LOAD( "1.29", 0x00000, 0x08000, CRC(59a1e2ec) SHA1(71f9d28dd8d2cf77a27fab163ce9562e3e75a540) ) | |
| 1239 | ROM_CONTINUE( 0x10000, 0x08000 ) // banked at 8000-bfff | |
| 1240 | ROM_LOAD( "2.30", 0x18000, 0x10000, CRC(e3f73476) SHA1(bd1c8946d637df21432bd52ae9324255251570b9) ) | |
| 1241 | ROM_LOAD( "robokid3.15k", 0x28000, 0x10000, CRC(05295ec3) SHA1(33dd0853a2064cb4301cfbdc7856def81f6e1223) ) | |
| 1242 | ROM_LOAD( "robokid4.12k", 0x38000, 0x10000, CRC(3bc3977f) SHA1(da394e12d197b0e109b03c854da06b1267bd9d59) ) | |
| 1243 | ROM_COPY( REGION_CPU1, 0x10000, 0x8000, 0x4000 ) /* to avoid crash because of code that crosses bank boundary */ | |
| 1244 | ||
| 1245 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1246 | ROM_LOAD( "robokid.k7", 0x00000, 0x10000, CRC(f490a2e9) SHA1(861d1256c090ce3d1f45f95cc894affbbc3f1466) ) | |
| 1247 | ||
| 1248 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles | |
| 1249 | ROM_LOAD( "robokid.b9", 0x00000, 0x08000, CRC(fac59c3f) SHA1(1b202ad5c12982512129d9e097267dd31b984ae8) ) | |
| 1250 | ||
| 1251 | ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE ) // sprite tiles | |
| 1252 | ROM_LOAD( "robokid.15f", 0x00000, 0x10000, CRC(ba61f5ab) SHA1(8433ddd55f0184cd5e8bb4a94a1c2336b2f8ff05) ) | |
| 1253 | ROM_LOAD( "robokid.16f", 0x10000, 0x10000, CRC(d9b399ce) SHA1(70755c9cae27187f183ae6d61bedb95c420756f4) ) | |
| 1254 | ROM_LOAD( "robokid.17f", 0x20000, 0x10000, CRC(afe432b9) SHA1(1ec7954ccf112eddf0ffcb8b5aec6cbc5cba7a7a) ) | |
| 1255 | ROM_LOAD( "robokid.18f", 0x30000, 0x10000, CRC(a0aa2a84) SHA1(4d46c169429cd285644336c7d47e393b33bd8770) ) | |
| 1256 | ||
| 1257 | ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE ) // bg0 tiles | |
| 1258 | ROM_LOAD( "robokid.19c", 0x00000, 0x10000, CRC(02220421) SHA1(f533e9c6cea1dccbb60e0528c470f3cb5e8fc44e) ) | |
| 1259 | ROM_LOAD( "robokid.20c", 0x10000, 0x10000, CRC(02d59bc2) SHA1(031acbb14145f9f4623de8868c6207fb9f8e8207) ) | |
| 1260 | ROM_LOAD( "robokid.17d", 0x20000, 0x10000, CRC(2fa29b99) SHA1(13dce7932e2e9c03a139a4293584838aa3d9f1c3) ) | |
| 1261 | ROM_LOAD( "robokid.18d", 0x30000, 0x10000, CRC(ae15ce02) SHA1(175e4eebdf12f1f373e01a4b1c933053ddd09abf) ) | |
| 1262 | ROM_LOAD( "robokid.19d", 0x40000, 0x10000, CRC(784b089e) SHA1(1ae3346b4afa3da9484ebc59c8a530cb95f7d277) ) | |
| 1263 | ROM_LOAD( "robokid.20d", 0x50000, 0x10000, CRC(b0b395ed) SHA1(31ec07634053793a701bbfd601b029f7da66e9d7) ) | |
| 1264 | ROM_LOAD( "robokid.19f", 0x60000, 0x10000, CRC(0f9071c6) SHA1(8bf0c35189eda98a9bc150788890e136870cb5b2) ) | |
| 1265 | ||
| 1266 | ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE ) // bg1 tiles | |
| 1267 | ROM_LOAD( "robokid.12c", 0x00000, 0x10000, CRC(0ab45f94) SHA1(d8274263068d998c89a1b247dde7f814037cc15b) ) | |
| 1268 | ROM_LOAD( "robokid.14c", 0x10000, 0x10000, CRC(029bbd4a) SHA1(8e078cdafe608fc6cde827be85c5267ade4ecca6) ) | |
| 1269 | ROM_LOAD( "robokid.15c", 0x20000, 0x10000, CRC(7de67ebb) SHA1(2fe92e50e2894dd363e69b053db96bdb66a273eb) ) | |
| 1270 | ROM_LOAD( "robokid.16c", 0x30000, 0x10000, CRC(53c0e582) SHA1(763e6127532d022a707bf9ddf1a832413745f248) ) | |
| 1271 | ROM_LOAD( "robokid.17c", 0x40000, 0x10000, CRC(0cae5a1e) SHA1(a183a33516c81ea2c029b72ee6261c4519e095ab) ) | |
| 1272 | ROM_LOAD( "robokid.18c", 0x50000, 0x10000, CRC(56ac7c8a) SHA1(66ed5646a2e8563caeb4ff96fa7d34fde27e9899) ) | |
| 1273 | ROM_LOAD( "robokid.15d", 0x60000, 0x10000, CRC(cd632a4d) SHA1(a537d9ced45fdac490097e9162ac4d09a470be79) ) | |
| 1274 | ROM_LOAD( "robokid.16d", 0x70000, 0x10000, CRC(18d92b2b) SHA1(e6d20ea8f0fac8bd4824a3b279a0fd8a1d6c26f5) ) | |
| 1275 | ||
| 1276 | ROM_REGION( 0x80000, REGION_GFX5, ROMREGION_DISPOSE ) // bg2 tiles | |
| 1277 | ROM_LOAD( "robokid.12a", 0x00000, 0x10000, CRC(e64d1c10) SHA1(d1073c80c9788aba65410f88691747a37b2a9d4a) ) | |
| 1278 | ROM_LOAD( "robokid.14a", 0x10000, 0x10000, CRC(8f9371e4) SHA1(0ea06d62bf4673ebda49a849cead832a24e5b886) ) | |
| 1279 | ROM_LOAD( "robokid.15a", 0x20000, 0x10000, CRC(469204e7) SHA1(8c2e94635b2b304e7dfa2e6ad58ba526dcf02453) ) | |
| 1280 | ROM_LOAD( "robokid.16a", 0x30000, 0x10000, CRC(4e340815) SHA1(d204b830c5809f25f7dfa451bbcbeda8b81ced54) ) | |
| 1281 | ROM_LOAD( "robokid.17a", 0x40000, 0x10000, CRC(f0863106) SHA1(ff7e44d0aa5a07ec9a7eddef1a55181bd2e867b1) ) | |
| 1282 | ROM_LOAD( "robokid.18a", 0x50000, 0x10000, CRC(fdff7441) SHA1(843b2c92bbc6f7319568677d50cbd9b03475b34a) ) | |
| 1283 | ROM_END | |
| 1284 | ||
| 1285 | ROM_START( robokdj2 ) | |
| 1286 | ROM_REGION( 0x48000, REGION_CPU1, 0 ) | |
| 1287 | ROM_LOAD( "1_rom29.18j", 0x00000, 0x08000, CRC(969fb951) SHA1(aa32f0cb33ba2ccbb933dab5444a7e0dbbb84b3d) ) | |
| 1288 | ROM_CONTINUE( 0x10000, 0x08000 ) // banked at 8000-bfff | |
| 1289 | ROM_LOAD( "2_rom30.18k", 0x18000, 0x10000, CRC(c0228b63) SHA1(8f7e3a29a35723abc8b10bf511fc8611e31a2961) ) | |
| 1290 | ROM_LOAD( "robokid3.15k", 0x28000, 0x10000, CRC(05295ec3) SHA1(33dd0853a2064cb4301cfbdc7856def81f6e1223) ) | |
| 1291 | ROM_LOAD( "robokid4.12k", 0x38000, 0x10000, CRC(3bc3977f) SHA1(da394e12d197b0e109b03c854da06b1267bd9d59) ) | |
| 1292 | ROM_COPY( REGION_CPU1, 0x10000, 0x8000, 0x4000 ) /* to avoid crash because of code that crosses bank boundary */ | |
| 1293 | ||
| 1294 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1295 | ROM_LOAD( "robokid.k7", 0x00000, 0x10000, CRC(f490a2e9) SHA1(861d1256c090ce3d1f45f95cc894affbbc3f1466) ) | |
| 1296 | ||
| 1297 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles | |
| 1298 | ROM_LOAD( "robokid.b9", 0x00000, 0x08000, CRC(fac59c3f) SHA1(1b202ad5c12982512129d9e097267dd31b984ae8) ) | |
| 1299 | ||
| 1300 | ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE ) // sprite tiles | |
| 1301 | ROM_LOAD( "robokid.15f", 0x00000, 0x10000, CRC(ba61f5ab) SHA1(8433ddd55f0184cd5e8bb4a94a1c2336b2f8ff05) ) | |
| 1302 | ROM_LOAD( "robokid.16f", 0x10000, 0x10000, CRC(d9b399ce) SHA1(70755c9cae27187f183ae6d61bedb95c420756f4) ) | |
| 1303 | ROM_LOAD( "robokid.17f", 0x20000, 0x10000, CRC(afe432b9) SHA1(1ec7954ccf112eddf0ffcb8b5aec6cbc5cba7a7a) ) | |
| 1304 | ROM_LOAD( "robokid.18f", 0x30000, 0x10000, CRC(a0aa2a84) SHA1(4d46c169429cd285644336c7d47e393b33bd8770) ) | |
| 1305 | ||
| 1306 | ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE ) // bg0 tiles | |
| 1307 | ROM_LOAD( "robokid.19c", 0x00000, 0x10000, CRC(02220421) SHA1(f533e9c6cea1dccbb60e0528c470f3cb5e8fc44e) ) | |
| 1308 | ROM_LOAD( "robokid.20c", 0x10000, 0x10000, CRC(02d59bc2) SHA1(031acbb14145f9f4623de8868c6207fb9f8e8207) ) | |
| 1309 | ROM_LOAD( "robokid.17d", 0x20000, 0x10000, CRC(2fa29b99) SHA1(13dce7932e2e9c03a139a4293584838aa3d9f1c3) ) | |
| 1310 | ROM_LOAD( "robokid.18d", 0x30000, 0x10000, CRC(ae15ce02) SHA1(175e4eebdf12f1f373e01a4b1c933053ddd09abf) ) | |
| 1311 | ROM_LOAD( "robokid.19d", 0x40000, 0x10000, CRC(784b089e) SHA1(1ae3346b4afa3da9484ebc59c8a530cb95f7d277) ) | |
| 1312 | ROM_LOAD( "robokid.20d", 0x50000, 0x10000, CRC(b0b395ed) SHA1(31ec07634053793a701bbfd601b029f7da66e9d7) ) | |
| 1313 | ROM_LOAD( "robokid.19f", 0x60000, 0x10000, CRC(0f9071c6) SHA1(8bf0c35189eda98a9bc150788890e136870cb5b2) ) | |
| 1314 | ||
| 1315 | ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE ) // bg1 tiles | |
| 1316 | ROM_LOAD( "robokid.12c", 0x00000, 0x10000, CRC(0ab45f94) SHA1(d8274263068d998c89a1b247dde7f814037cc15b) ) | |
| 1317 | ROM_LOAD( "robokid.14c", 0x10000, 0x10000, CRC(029bbd4a) SHA1(8e078cdafe608fc6cde827be85c5267ade4ecca6) ) | |
| 1318 | ROM_LOAD( "robokid.15c", 0x20000, 0x10000, CRC(7de67ebb) SHA1(2fe92e50e2894dd363e69b053db96bdb66a273eb) ) | |
| 1319 | ROM_LOAD( "robokid.16c", 0x30000, 0x10000, CRC(53c0e582) SHA1(763e6127532d022a707bf9ddf1a832413745f248) ) | |
| 1320 | ROM_LOAD( "robokid.17c", 0x40000, 0x10000, CRC(0cae5a1e) SHA1(a183a33516c81ea2c029b72ee6261c4519e095ab) ) | |
| 1321 | ROM_LOAD( "robokid.18c", 0x50000, 0x10000, CRC(56ac7c8a) SHA1(66ed5646a2e8563caeb4ff96fa7d34fde27e9899) ) | |
| 1322 | ROM_LOAD( "robokid.15d", 0x60000, 0x10000, CRC(cd632a4d) SHA1(a537d9ced45fdac490097e9162ac4d09a470be79) ) | |
| 1323 | ROM_LOAD( "robokid.16d", 0x70000, 0x10000, CRC(18d92b2b) SHA1(e6d20ea8f0fac8bd4824a3b279a0fd8a1d6c26f5) ) | |
| 1324 | ||
| 1325 | ROM_REGION( 0x80000, REGION_GFX5, ROMREGION_DISPOSE ) // bg2 tiles | |
| 1326 | ROM_LOAD( "robokid.12a", 0x00000, 0x10000, CRC(e64d1c10) SHA1(d1073c80c9788aba65410f88691747a37b2a9d4a) ) | |
| 1327 | ROM_LOAD( "robokid.14a", 0x10000, 0x10000, CRC(8f9371e4) SHA1(0ea06d62bf4673ebda49a849cead832a24e5b886) ) | |
| 1328 | ROM_LOAD( "robokid.15a", 0x20000, 0x10000, CRC(469204e7) SHA1(8c2e94635b2b304e7dfa2e6ad58ba526dcf02453) ) | |
| 1329 | ROM_LOAD( "robokid.16a", 0x30000, 0x10000, CRC(4e340815) SHA1(d204b830c5809f25f7dfa451bbcbeda8b81ced54) ) | |
| 1330 | ROM_LOAD( "robokid.17a", 0x40000, 0x10000, CRC(f0863106) SHA1(ff7e44d0aa5a07ec9a7eddef1a55181bd2e867b1) ) | |
| 1331 | ROM_LOAD( "robokid.18a", 0x50000, 0x10000, CRC(fdff7441) SHA1(843b2c92bbc6f7319568677d50cbd9b03475b34a) ) | |
| 1332 | ROM_END | |
| 1333 | ||
| 1334 | ROM_START( omegaf ) | |
| 1335 | ROM_REGION( 0x48000, REGION_CPU1, 0 ) | |
| 1336 | ROM_LOAD( "1.5", 0x00000, 0x08000, CRC(57a7fd96) SHA1(65ca290b48f8579fcce00db5b3b3f8694667a136) ) | |
| 1337 | ROM_CONTINUE( 0x10000, 0x18000 ) // banked at 8000-bfff | |
| 1338 | ROM_LOAD( "6.4l", 0x28000, 0x20000, CRC(6277735c) SHA1(b0f91f0cc51d424a1a7834c126736f24c2e23c17) ) | |
| 1339 | ||
| 1340 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1341 | ROM_LOAD( "7.7m", 0x00000, 0x10000, CRC(d40fc8d5) SHA1(4f615a0fb786cafc20f82f0b5fa112a9c356378f) ) | |
| 1342 | ||
| 1343 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles | |
| 1344 | ROM_LOAD( "4.18h", 0x00000, 0x08000, CRC(9e2d8152) SHA1(4b50557d171d1b03a870db5891ae67d70858ad37) ) | |
| 1345 | ||
| 1346 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) // sprite tiles | |
| 1347 | ROM_LOAD( "8.23m", 0x00000, 0x20000, CRC(0bd2a5d1) SHA1(ef84f1a5554e891fc38d17314e3952ea5c9d2731) ) | |
| 1348 | ||
| 1349 | ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE ) // bg0 tiles | |
| 1350 | ROM_LOAD( "2back1.27b", 0x00000, 0x80000, CRC(21f8a32e) SHA1(26582e06e7381e09443fa99f24ca9edd0b4a2937) ) | |
| 1351 | ||
| 1352 | ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE ) // bg1 tiles | |
| 1353 | ROM_LOAD( "1back2.15b", 0x00000, 0x80000, CRC(6210ddcc) SHA1(89c091eeafcc92750d0ea303fcde8a8dc3eeba89) ) | |
| 1354 | ||
| 1355 | ROM_REGION( 0x80000, REGION_GFX5, ROMREGION_DISPOSE ) // bg2 tiles | |
| 1356 | ROM_LOAD( "3back3.5f", 0x00000, 0x80000, CRC(c31cae56) SHA1(4cc2d0d70990ca04b0e3abd15e5afe183e98e4ab) ) | |
| 1357 | ROM_END | |
| 1358 | ||
| 1359 | ROM_START( omegafs ) | |
| 1360 | ROM_REGION( 0x48000, REGION_CPU1, 0 ) | |
| 1361 | ROM_LOAD( "5.3l", 0x00000, 0x08000, CRC(503a3e63) SHA1(73420aecb653cd4fd3b6afe67d6f5726f01411dd) ) | |
| 1362 | ROM_CONTINUE( 0x10000, 0x18000 ) // banked at 8000-bfff | |
| 1363 | ROM_LOAD( "6.4l", 0x28000, 0x20000, CRC(6277735c) SHA1(b0f91f0cc51d424a1a7834c126736f24c2e23c17) ) | |
| 1364 | ||
| 1365 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) | |
| 1366 | ROM_LOAD( "7.7m", 0x00000, 0x10000, CRC(d40fc8d5) SHA1(4f615a0fb786cafc20f82f0b5fa112a9c356378f) ) | |
| 1367 | ||
| 1368 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) // fg tiles | |
| 1369 | ROM_LOAD( "4.18h", 0x00000, 0x08000, CRC(9e2d8152) SHA1(4b50557d171d1b03a870db5891ae67d70858ad37) ) | |
| 1370 | ||
| 1371 | ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) // sprite tiles | |
| 1372 | ROM_LOAD( "8.23m", 0x00000, 0x20000, CRC(0bd2a5d1) SHA1(ef84f1a5554e891fc38d17314e3952ea5c9d2731) ) | |
| 1373 | ||
| 1374 | ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE ) // bg0 tiles | |
| 1375 | ROM_LOAD( "2back1.27b", 0x00000, 0x80000, CRC(21f8a32e) SHA1(26582e06e7381e09443fa99f24ca9edd0b4a2937) ) | |
| 1376 | ||
| 1377 | ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE ) // bg1 tiles | |
| 1378 | ROM_LOAD( "1back2.15b", 0x00000, 0x80000, CRC(6210ddcc) SHA1(89c091eeafcc92750d0ea303fcde8a8dc3eeba89) ) | |
| 1379 | ||
| 1380 | ROM_REGION( 0x80000, REGION_GFX5, ROMREGION_DISPOSE ) // bg2 tiles | |
| 1381 | ROM_LOAD( "3back3.5f", 0x00000, 0x80000, CRC(c31cae56) SHA1(4cc2d0d70990ca04b0e3abd15e5afe183e98e4ab) ) | |
| 1382 | ROM_END | |
| 1383 | ||
| 1384 | ||
| 1385 | ||
| 1386 | /************************************* | |
| 1387 | * | |
| 1388 | * Gfx ROM swizzling | |
| 1389 | * | |
| 1390 | *************************************/ | |
| 1391 | ||
| 1392 | /****************************************************************************** | |
| 1393 | ||
| 1394 | Gfx ROMs in the older games have an unusual layout, where a high address bit | |
| 1395 | (which is no the top bit) separates parts of the same tile. To make it possible | |
| 1396 | to decode graphics without resorting to ROM_CONTINUE trickery, this function | |
| 1397 | makes an address line rotation, bringing bit "bit" to bit 0 and shifting left | |
| 1398 | by one place all the intervening bits. | |
| 1399 | ||
| 1400 | ******************************************************************************/ | |
| 1401 | ||
| 1402 | static void lineswap_gfx_roms(const int region, const int bit) | |
| 1403 | { | |
| 1404 | const int length = memory_region_length(region); | |
| 1405 | ||
| 1406 | UINT8* const src = memory_region(region); | |
| 1407 | ||
| 1408 | UINT8* const temp = malloc_or_die(length); | |
| 1409 | ||
| 1410 | const int mask = (1 << (bit + 1)) - 1; | |
| 1411 | ||
| 1412 | int sa; | |
| 1413 | ||
| 1414 | for (sa = 0; sa < length; sa++) | |
| 1415 | { | |
| 1416 | const int da = (sa & ~mask) | ((sa << 1) & mask) | ((sa >> bit) & 1); | |
| 1417 | ||
| 1418 | temp[da] = src[sa]; | |
| 1419 | } | |
| 1420 | ||
| 1421 | memcpy(src, temp, length); | |
| 1422 | ||
| 1423 | free(temp); | |
| 1424 | } | |
| 1425 | ||
| 1426 | static void gfx_unscramble(void) | |
| 1427 | { | |
| 1428 | lineswap_gfx_roms(REGION_GFX1, 13); // fg tiles | |
| 1429 | lineswap_gfx_roms(REGION_GFX2, 14); // sprites | |
| 1430 | lineswap_gfx_roms(REGION_GFX3, 14); // bg tiles | |
| 1431 | } | |
| 1432 | ||
| 1433 | ||
| 1434 | ||
| 1435 | /************************************* | |
| 1436 | * | |
| 1437 | * Driver initialization | |
| 1438 | * | |
| 1439 | *************************************/ | |
| 1440 | ||
| 688 | 1441 | static DRIVER_INIT( ninjakd2 ) |
| 689 | 1442 | { |
| 690 | 1443 | mc8123_decrypt_rom(1, memory_region(REGION_USER1), 0, 0); |
| 1444 | ||
| 1445 | gfx_unscramble(); | |
| 691 | 1446 | } |
| 692 | 1447 | |
| 693 | 1448 | static DRIVER_INIT( bootleg ) |
| 694 | 1449 | { |
| 695 | 1450 | memory_set_decrypted_region(1, 0x0000, 0x7fff, memory_region(REGION_CPU2) + 0x10000); |
| 1451 | ||
| 1452 | gfx_unscramble(); | |
| 696 | 1453 | } |
| 697 | 1454 | |
| 1455 | static DRIVER_INIT(mnight) | |
| 1456 | { | |
| 1457 | gfx_unscramble(); | |
| 1458 | } | |
| 698 | 1459 | |
| 699 | 1460 | |
| 700 | GAME( 1987, ninjakd2, 0, ninjakd2, ninjakd2, ninjakd2, ROT0, "UPL", "Ninja-Kid II (set 1)", 0 ) | |
| 701 | GAME( 1987, ninjak2a, ninjakd2, ninjakd2, ninjakd2, bootleg, ROT0, "UPL", "Ninja-Kid II (set 2)", 0 ) | |
| 702 | GAME( 1987, ninjak2b, ninjakd2, ninjakd2, ninjakd2, bootleg, ROT0, "UPL", "Ninja-Kid II (set 3)", 0 ) | |
| 703 | GAME( 1987, rdaction, ninjakd2, ninjakd2, ninjakd2, ninjakd2, ROT0, "UPL (World Games license)", "Rad Action", 0 ) | |
| 1461 | ||
| 1462 | /************************************* | |
| 1463 | * | |
| 1464 | * Game drivers | |
| 1465 | * | |
| 1466 | *************************************/ | |
| 1467 | ||
| 1468 | GAME( 1987, ninjakd2, 0, ninjakd2, ninjakd2, ninjakd2, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 1)", 0 ) | |
| 1469 | GAME( 1987, ninjak2a, ninjakd2, ninjakd2, ninjakd2, bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 2)", 0 ) | |
| 1470 | GAME( 1987, ninjak2b, ninjakd2, ninjakd2, rdaction, bootleg, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 3)", 0 ) | |
| 1471 | GAME( 1987, rdaction, ninjakd2, ninjakd2, rdaction, ninjakd2, ROT0, "UPL (World Games license)", "Rad Action / NinjaKun Ashura no Shou", 0 ) | |
| 1472 | GAME( 1987, mnight, 0, mnight, mnight, mnight, ROT0, "UPL (Kawakus license)", "Mutant Night", GAME_IMPERFECT_GRAPHICS ) | |
| 1473 | GAME( 1987, arkarea, 0, mnight, arkarea, mnight, ROT0, "UPL", "Ark Area", 0 ) | |
| 1474 | GAME( 1988, robokid, 0, robokid, robokid, 0, ROT0, "UPL", "Atomic Robo-kid", 0 ) | |
| 1475 | GAME( 1988, robokidj, robokid, robokid, robokidj, 0, ROT0, "UPL", "Atomic Robo-kid (Japan, Set 1)", 0 ) | |
| 1476 | GAME( 1988, robokdj2, robokid, robokid, robokidj, 0, ROT0, "UPL", "Atomic Robo-kid (Japan, Set 2)", 0 ) | |
| 1477 | GAME( 1989, omegaf, 0, omegaf, omegaf, 0, ROT270, "UPL", "Omega Fighter", 0 ) | |
| 1478 | GAME( 1989, omegafs, omegaf, omegaf, omegaf, 0, ROT270, "UPL", "Omega Fighter Special", 0 ) |
| r1591 | r1592 | |
|---|---|---|
| 141 | 141 | discrete_sound_w(SKYDIVER_NOISE_DATA, skydiver_videoram[0x396] & 0x0f); // NAM - Noise Amplitude |
| 142 | 142 | |
| 143 | 143 | if (skydiver_nmion) |
| 144 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 144 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 |
| r1591 | r1592 | |
|---|---|---|
| 513 | 513 | |
| 514 | 514 | toggle ^= 1; |
| 515 | 515 | if (toggle) |
| 516 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 516 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | static const struct MSM5205interface yunsung8_msm5205_interface = |
| r1591 | r1592 | |
|---|---|---|
| 127 | 127 | /* compute vector and set the interrupt line */ |
| 128 | 128 | int vpos = video_screen_get_vpos(0); |
| 129 | 129 | UINT8 vector = 0xc7 | ((vpos & 0x40) >> 2) | ((~vpos & 0x40) >> 3); |
| 130 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, vector); | |
| 130 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, vector); | |
| 131 | 131 | |
| 132 | 132 | /* set up for next interrupt */ |
| 133 | 133 | if (vpos == SPACEFB_INT_TRIGGER_COUNT_1) |
| r1591 | r1592 | |
|---|---|---|
| 288 | 288 | warpwarp_ball_on = data & 1; |
| 289 | 289 | cpu_interrupt_enable(0,data & 1); |
| 290 | 290 | if (~data & 1) |
| 291 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 291 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 292 | 292 | break; |
| 293 | 293 | case 7: |
| 294 | 294 | flip_screen_set(data & 1); |
| r1591 | r1592 | |
|---|---|---|
| 104 | 104 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, MWA32_BANK1); |
| 105 | 105 | else |
| 106 | 106 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 107 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, MWA32_ | |
| 107 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, MWA32_UNMAP); | |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 |
| r1591 | r1592 | |
|---|---|---|
| 574 | 574 | if (scanline_counter!=(total_scanlines-1)) |
| 575 | 575 | { |
| 576 | 576 | scanline_counter++; |
| 577 | cpunum_set_input_line(0, 5, HOLD_LINE); // raster IRQ, changes scroll values for road | |
| 577 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); // raster IRQ, changes scroll values for road | |
| 578 | 578 | timer_adjust(scanline_timer, attotime_div(ATTOTIME_IN_HZ(60), total_scanlines), 0, attotime_zero); |
| 579 | 579 | |
| 580 | 580 | if (scanline_counter<256) |
| r1591 | r1592 | |
| 584 | 584 | |
| 585 | 585 | if (scanline_counter==256) |
| 586 | 586 | { |
| 587 | cpunum_set_input_line(0, 3, HOLD_LINE); // vblank IRQ? | |
| 587 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); // vblank IRQ? | |
| 588 | 588 | toggle_bit = 0x8000; // must toggle.. |
| 589 | 589 | } |
| 590 | 590 | |
| r1591 | r1592 | |
| 622 | 622 | static INTERRUPT_GEN( wheelfir_irq ) |
| 623 | 623 | { |
| 624 | 624 | // we seem to need this interrupt at least once for every object drawn on the screen, otherwise things flicker + slowdown |
| 625 | cpunum_set_input_line(0, 1, HOLD_LINE); // blitter IRQ? | |
| 625 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); // blitter IRQ? | |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 |
| r1591 | r1592 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | case 2: /* Sound CPU write */ |
| 47 | 47 | soundlatch_w(0,data & 0xff); |
| 48 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 48 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 49 | 49 | return; |
| 50 | 50 | |
| 51 | 51 | case 4: /* Protection, maybe this is a PAL on the board? |
| r1591 | r1592 | |
| 332 | 332 | |
| 333 | 333 | static void sound_irq(int state) |
| 334 | 334 | { |
| 335 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 335 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 473 | 473 | static INTERRUPT_GEN( bballoon_interrupt ) |
| 474 | 474 | { |
| 475 | 475 | if(irq_en) |
| 476 | cpunum_set_input_line(0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 477 | //cpunum_set_input_line(0, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 476 | cpunum_set_input_line(machine, 0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 477 | //cpunum_set_input_line(machine, 0, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 478 | 478 | |
| 479 | 479 | irq_en = 0; |
| 480 | 480 | } |
| r1591 | r1592 | |
|---|---|---|
| 75 | 75 | static WRITE8_HANDLER( onetwo_soundlatch_w ) |
| 76 | 76 | { |
| 77 | 77 | soundlatch_w(0, data); |
| 78 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 78 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static void setColor(int offset) |
| r1591 | r1592 | |
| 252 | 252 | |
| 253 | 253 | static void irqhandler(int linestate) |
| 254 | 254 | { |
| 255 | cpunum_set_input_line(1,0,linestate); | |
| 255 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | /* generate an NMI if we're out of data */ |
| 122 | 122 | if (!ojankohs_vclk_left) |
| 123 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 123 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static WRITE8_HANDLER( ojankoc_ctrl_w ) |
| r1591 | r1592 | |
|---|---|---|
| 36 | 36 | static INTERRUPT_GEN( interrupt ) |
| 37 | 37 | { |
| 38 | 38 | if (video_screen_get_vblank(0)) |
| 39 | { | |
| 40 | cpunum_set_input_line_and_vector(0, 0, PULSE_LINE, 0xcf); /* RST $08 */ | |
| 41 | } | |
| 39 | cpunum_set_input_line_and_vector(machine, 0, 0, PULSE_LINE, 0xcf); /* RST $08 */ | |
| 42 | 40 | else |
| 43 | { | |
| 44 | cpunum_set_input_line_and_vector(0, 0, PULSE_LINE, 0xd7); /* RST $10 */ | |
| 45 | } | |
| 41 | cpunum_set_input_line_and_vector(machine, 0, 0, PULSE_LINE, 0xd7); /* RST $10 */ | |
| 46 | 42 | } |
| 47 | 43 | |
| 48 | 44 |
| r1591 | r1592 | |
|---|---|---|
| 129 | 129 | static WRITE8_HANDLER( wc90b_sound_command_w ) |
| 130 | 130 | { |
| 131 | 131 | soundlatch_w(offset,data); |
| 132 | cpunum_set_input_line(2,0,HOLD_LINE); | |
| 132 | cpunum_set_input_line(Machine, 2,0,HOLD_LINE); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static WRITE8_HANDLER( adpcm_control_w ) |
| r1591 | r1592 | |
| 360 | 360 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 361 | 361 | static void irqhandler(int irq) |
| 362 | 362 | { |
| 363 | cpunum_set_input_line(2, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 363 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
| 377 | 377 | |
| 378 | 378 | toggle ^= 1; |
| 379 | 379 | if(toggle) |
| 380 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 380 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 381 | 381 | |
| 382 | 382 | } |
| 383 | 383 |
| r1591 | r1592 | |
|---|---|---|
| 88 | 88 | *************************************/ |
| 89 | 89 | |
| 90 | 90 | static ADDRESS_MAP_START( prosport_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 91 | AM_RANGE(0x0200, 0x021f) AM_READ( | |
| 91 | AM_RANGE(0x0200, 0x021f) AM_READ(MRA8 | |
| 92 | 92 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) |
| 93 | 93 | AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_RAM) |
| 94 | 94 | AM_RANGE(0x8000, 0x800f) AM_READ(deco16_io_r) |
| r1591 | r1592 | |
| 499 | 499 | static int latch=0; |
| 500 | 500 | int p=~readinputport(3); |
| 501 | 501 | if (p&0x43 && !latch) { |
| 502 | cpunum_set_input_line(0,DECO16_IRQ_LINE,ASSERT_LINE); | |
| 502 | cpunum_set_input_line(machine, 0,DECO16_IRQ_LINE,ASSERT_LINE); | |
| 503 | 503 | latch=1; |
| 504 | 504 | } else { |
| 505 | 505 | if (!(p&0x43)) |
| r1591 | r1592 | |
| 923 | 923 | |
| 924 | 924 | static DRIVER_INIT( yellowcb ) |
| 925 | 925 | { |
| 926 | | |
| 926 | DRIVER_INIT_CALL(prosport | |
| 927 | 927 | |
| 928 | 928 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, input_port_0_r); |
| 929 | 929 | } |
| r1591 | r1592 | |
|---|---|---|
| 46 | 46 | static WRITE8_HANDLER( sound_command_w ) |
| 47 | 47 | { |
| 48 | 48 | soundlatch_w(offset,data); |
| 49 | cpunum_set_input_line(1,M6809_IRQ_LINE,HOLD_LINE); | |
| 49 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static WRITE8_HANDLER( spd_adpcm_w ) |
| r1591 | r1592 | |
| 413 | 413 | |
| 414 | 414 | static void irq_handler(int irq) |
| 415 | 415 | { |
| 416 | cpunum_set_input_line(1,M6809_FIRQ_LINE,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 416 | cpunum_set_input_line(Machine, 1,M6809_FIRQ_LINE,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 238 | 238 | static INTERRUPT_GEN( cvs_main_cpu_interrupt ) |
| 239 | 239 | { |
| 240 | 240 | cpunum_set_input_line_vector(CVS_MAIN_CPU_INDEX, 0, 0x03); |
| 241 | cpunum_set_input_line(CVS_MAIN_CPU_INDEX, 0, PULSE_LINE); | |
| 241 | cpunum_set_input_line(machine, CVS_MAIN_CPU_INDEX, 0, PULSE_LINE); | |
| 242 | 242 | |
| 243 | 243 | cvs_scroll_stars(); |
| 244 | 244 | } |
| r1591 | r1592 | |
| 247 | 247 | static void cvs_dac_cpu_interrupt(void) |
| 248 | 248 | { |
| 249 | 249 | cpunum_set_input_line_vector(CVS_DAC_CPU_INDEX, 0, 0x03); |
| 250 | cpunum_set_input_line(CVS_DAC_CPU_INDEX, 0, HOLD_LINE); | |
| 250 | cpunum_set_input_line(Machine, CVS_DAC_CPU_INDEX, 0, HOLD_LINE); | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
| r1591 | r1592 | |
| 430 | 430 | |
| 431 | 431 | static const struct TMS5110interface tms5100_interface = |
| 432 | 432 | { |
| 433 | //TMS5110_IS_5110A, | |
| 434 | TMS5110_IS_5100, | |
| 435 | 433 | -1, /* ROM region */ |
| 436 | 434 | speech_rom_read_bit, /* M0 callback function. Called whenever chip requests a single bit of data */ |
| 437 | 435 | NULL |
| r1591 | r1592 | |
| 707 | 705 | MDRV_SOUND_ADD(DAC, 0) |
| 708 | 706 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 709 | 707 | |
| 710 | MDRV_SOUND_ADD(TMS51 | |
| 708 | MDRV_SOUND_ADD(TMS5100, 640000) | |
| 711 | 709 | MDRV_SOUND_CONFIG(tms5100_interface) |
| 712 | 710 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 713 | 711 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
|---|---|---|
| 344 | 344 | /* bit 7 = /INT on the 2nd CPU */ |
| 345 | 345 | turbo_state *state = Machine->driver_data; |
| 346 | 346 | state->buckrog_fchg = data & 0x07; |
| 347 | cpunum_set_input_line(1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 347 | cpunum_set_input_line(Machine, 1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | |
| r1591 | r1592 | |
| 1542 | 1542 | static DRIVER_INIT( turbo_enc ) |
| 1543 | 1543 | { |
| 1544 | 1544 | turbo_rom_decode(); |
| 1545 | | |
| 1545 | DRIVER_INIT_CALL(turbo | |
| 1546 | 1546 | } |
| 1547 | 1547 | |
| 1548 | 1548 | |
| r1591 | r1592 | |
| 1580 | 1580 | static DRIVER_INIT( buckrog_enc ) |
| 1581 | 1581 | { |
| 1582 | 1582 | buckrog_decode(); |
| 1583 | | |
| 1583 | DRIVER_INIT_CALL(buckrog | |
| 1584 | 1584 | } |
| 1585 | 1585 | |
| 1586 | 1586 |
| r1591 | r1592 | |
|---|---|---|
| 23 | 23 | ------------------------------------------------------------------------------- |
| 24 | 24 | P0-029-A (M6100287A) 88 Thundercade / Twin Formation (1) Taito |
| 25 | 25 | ? (M6100326A) 88 Twin Eagle Taito |
| 26 | ||
| 26 | P0-045-A (M6100429A) | |
| 27 | 27 | ? (M6100430A) 89 U.S. Classic(2) Taito / RomStar |
| 28 | 28 | ? 88 Caliber 50 Taito / RomStar |
| 29 | 29 | ? 89 Arbalester Taito / RomStar |
| r1591 | r1592 | |
| 1335 | 1335 | ------------------------------*/ |
| 1336 | 1336 | static TIMER_CALLBACK( uPD71054_timer_callback ) |
| 1337 | 1337 | { |
| 1338 | cpunum_set_input_line( 0, 4, HOLD_LINE ); | |
| 1338 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE ); | |
| 1339 | 1339 | uPD71054_update_timer( param ); |
| 1340 | 1340 | } |
| 1341 | 1341 | |
| r1591 | r1592 | |
| 1418 | 1418 | |
| 1419 | 1419 | static void utoukond_ym3438_interrupt(int linestate) |
| 1420 | 1420 | { |
| 1421 | cpunum_set_input_line(1, INPUT_LINE_NMI, linestate); | |
| 1421 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, linestate); | |
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | 1424 | static const struct YM3438interface utoukond_ym3438_intf = |
| r1591 | r1592 | |
| 1492 | 1492 | if (ACCESSING_LSB) |
| 1493 | 1493 | { |
| 1494 | 1494 | if ( !(old_data&1) && (data&1) ) |
| 1495 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 1495 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 1496 | 1496 | old_data = data; |
| 1497 | 1497 | } |
| 1498 | 1498 | break; |
| r1591 | r1592 | |
| 1675 | 1675 | if (ACCESSING_LSB) |
| 1676 | 1676 | { |
| 1677 | 1677 | soundlatch_word_w(0,data,mem_mask); |
| 1678 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1678 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1679 | 1679 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other cpu to reply |
| 1680 | 1680 | } |
| 1681 | 1681 | } |
| r1591 | r1592 | |
| 2713 | 2713 | static WRITE16_HANDLER( wiggie_soundlatch_w ) |
| 2714 | 2714 | { |
| 2715 | 2715 | wiggie_soundlatch = data >> 8; |
| 2716 | cpunum_set_input_line(1,0, HOLD_LINE); | |
| 2716 | cpunum_set_input_line(Machine, 1,0, HOLD_LINE); | |
| 2717 | 2717 | } |
| 2718 | 2718 | |
| 2719 | 2719 | |
| r1591 | r1592 | |
| 2771 | 2771 | { |
| 2772 | 2772 | if (ACCESSING_LSB) |
| 2773 | 2773 | { |
| 2774 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 2774 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 2775 | 2775 | soundlatch_w(0,data & 0xff); |
| 2776 | 2776 | } |
| 2777 | 2777 | } |
| r1591 | r1592 | |
| 6822 | 6822 | { |
| 6823 | 6823 | switch (cpu_getiloops()) |
| 6824 | 6824 | { |
| 6825 | case 0: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 6826 | case 1: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 6825 | case 0: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 6826 | case 1: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 6827 | 6827 | } |
| 6828 | 6828 | } |
| 6829 | 6829 | |
| r1591 | r1592 | |
| 6831 | 6831 | { |
| 6832 | 6832 | switch (cpu_getiloops()) |
| 6833 | 6833 | { |
| 6834 | case 0: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 6835 | case 1: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 6834 | case 0: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 6835 | case 1: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 6836 | 6836 | } |
| 6837 | 6837 | } |
| 6838 | 6838 | |
| r1591 | r1592 | |
| 6843 | 6843 | { |
| 6844 | 6844 | switch (cpu_getiloops()) |
| 6845 | 6845 | { |
| 6846 | case 0: cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); break; | |
| 6847 | case 1: cpunum_set_input_line(1, 0, HOLD_LINE); break; | |
| 6846 | case 0: cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); break; | |
| 6847 | case 1: cpunum_set_input_line(machine, 1, 0, HOLD_LINE); break; | |
| 6848 | 6848 | } |
| 6849 | 6849 | } |
| 6850 | 6850 | |
| r1591 | r1592 | |
| 6864 | 6864 | static INTERRUPT_GEN( tndrcade_sub_interrupt ) |
| 6865 | 6865 | { |
| 6866 | 6866 | if (cpu_getiloops() & 1) |
| 6867 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 6867 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 6868 | 6868 | else if (cpu_getiloops() == 0) |
| 6869 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 6869 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 6870 | 6870 | } |
| 6871 | 6871 | |
| 6872 | 6872 | static MACHINE_DRIVER_START( tndrcade ) |
| r1591 | r1592 | |
| 6964 | 6964 | static MACHINE_DRIVER_START( downtown ) |
| 6965 | 6965 | |
| 6966 | 6966 | /* basic machine hardware */ |
| 6967 | MDRV_CPU_ADD(M68000, 16 | |
| 6967 | MDRV_CPU_ADD(M68000, XTAL_16MHz | |
| 6968 | 6968 | MDRV_CPU_PROGRAM_MAP(downtown_readmem,downtown_writemem) |
| 6969 | 6969 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) |
| 6970 | 6970 | |
| 6971 | MDRV_CPU_ADD(M65C02, 16 | |
| 6971 | MDRV_CPU_ADD(M65C02, XTAL_16MHz | |
| 6972 | 6972 | MDRV_CPU_PROGRAM_MAP(downtown_sub_readmem,downtown_sub_writemem) |
| 6973 | 6973 | MDRV_CPU_VBLANK_INT(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM) |
| 6974 | 6974 | |
| r1591 | r1592 | |
| 7015 | 7015 | case 0: |
| 7016 | 7016 | case 1: |
| 7017 | 7017 | case 2: |
| 7018 | case 3: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 7019 | case 4: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 7018 | case 3: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 7019 | case 4: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 7020 | 7020 | } |
| 7021 | 7021 | } |
| 7022 | 7022 | |
| r1591 | r1592 | |
| 7488 | 7488 | #if __uPD71054_TIMER |
| 7489 | 7489 | static INTERRUPT_GEN( wrofaero_interrupt ) |
| 7490 | 7490 | { |
| 7491 | cpunum_set_input_line( 0, 2, HOLD_LINE ); | |
| 7491 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE ); | |
| 7492 | 7492 | } |
| 7493 | 7493 | |
| 7494 | 7494 | static MACHINE_RESET( wrofaero ) { uPD71054_timer_init(); } |
| r1591 | r1592 | |
| 8241 | 8241 | { |
| 8242 | 8242 | switch (cpu_getiloops()) |
| 8243 | 8243 | { |
| 8244 | case 0: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 8245 | default: cpunum_set_input_line(0, 2, HOLD_LINE); break; // should this be triggered by the 3812? | |
| 8244 | case 0: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 8245 | default: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; // should this be triggered by the 3812? | |
| 8246 | 8246 | } |
| 8247 | 8247 | } |
| 8248 | 8248 | |
| r1591 | r1592 | |
| 8296 | 8296 | case 4: |
| 8297 | 8297 | case 5: |
| 8298 | 8298 | case 6: |
| 8299 | case 7: cpunum_set_input_line(0, 6, HOLD_LINE); break; | |
| 8299 | case 7: cpunum_set_input_line(machine, 0, 6, HOLD_LINE); break; | |
| 8300 | 8300 | |
| 8301 | case 8: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 8301 | case 8: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 8302 | 8302 | |
| 8303 | case 9: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 8303 | case 9: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 8304 | 8304 | |
| 8305 | case 10: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 8305 | case 10: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 8306 | 8306 | } |
| 8307 | 8307 | } |
| 8308 | 8308 | |
| r1591 | r1592 | |
| 9654 | 9654 | seta_vregs = (UINT16*)auto_malloc(sizeof(UINT16)*3); |
| 9655 | 9655 | seta_vregs[0] = seta_vregs[1] = seta_vregs[2] = 0; |
| 9656 | 9656 | |
| 9657 | | |
| 9657 | DRIVER_INIT_CALL(blandia | |
| 9658 | 9658 | } |
| 9659 | 9659 | |
| 9660 | 9660 | /*************************************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 137 | 137 | { |
| 138 | 138 | if ( trigger == 0 ) |
| 139 | 139 | { |
| 140 | cpunum_set_input_line( 0, M6809_IRQ_LINE, PULSE_LINE ); | |
| 140 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, PULSE_LINE ); | |
| 141 | 141 | trigger++; |
| 142 | 142 | } |
| 143 | 143 | } else |
| r1591 | r1592 | |
|---|---|---|
| 561 | 561 | |
| 562 | 562 | /* Cat'N Mouse sound ***********************************/ |
| 563 | 563 | |
| 564 | static void zaccaria_irq0a(int state) { cpunum_set_input_line(1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); } | |
| 565 | static void zaccaria_irq0b(int state) { cpunum_set_input_line(1,0,state ? ASSERT_LINE : CLEAR_LINE); } | |
| 564 | static void zaccaria_irq0a(int state) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); } | |
| 565 | static void zaccaria_irq0b(int state) { cpunum_set_input_line(Machine, 1,0,state ? ASSERT_LINE : CLEAR_LINE); } | |
| 566 | 566 | |
| 567 | 567 | static int active_8910,port0a; |
| 568 | 568 | |
| r1591 | r1592 | |
| 646 | 646 | |
| 647 | 647 | static INTERRUPT_GEN( laserbat_interrupt ) |
| 648 | 648 | { |
| 649 | cpunum_set_input_line_and_vector(0,0,PULSE_LINE,0x0a); | |
| 649 | cpunum_set_input_line_and_vector(machine, 0,0,PULSE_LINE,0x0a); | |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | static INTERRUPT_GEN( zaccaria_cb1_toggle ) |
| r1591 | r1592 | |
| 701 | 701 | MDRV_CPU_IO_MAP(catnmous_io_map,0) |
| 702 | 702 | MDRV_CPU_VBLANK_INT(laserbat_interrupt,1) |
| 703 | 703 | |
| 704 | MDRV_CPU_ADD(M6802,3580000 | |
| 704 | MDRV_CPU_ADD(M6802,3580000 | |
| 705 | 705 | MDRV_CPU_PROGRAM_MAP(catnmous_sound_map,0) |
| 706 | 706 | MDRV_CPU_PERIODIC_INT(zaccaria_cb1_toggle, (double)3580000/4096) |
| 707 | 707 |
| r1591 | r1592 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | static TIMER_CALLBACK( via_irq_delayed ) |
| 212 | 212 | { |
| 213 | cpunum_set_input_line(0, 0, param); | |
| 213 | cpunum_set_input_line(machine, 0, 0, param); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | static void via_irq(int state) |
| r1591 | r1592 | |
|---|---|---|
| 20 | 20 | { |
| 21 | 21 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, MWA16_NOP); // custom banking is disabled (!) |
| 22 | 22 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, MRA16_BANK5); |
| 23 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, MWA16_ | |
| 23 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, MWA16_UNMAP); | |
| 24 | 24 | |
| 25 | 25 | memory_set_bankptr( 5, memory_region( REGION_CPU1 )+0x400000 ); |
| 26 | 26 | |
| 27 | 27 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x770070, 0x770075, 0, 0, ssf2ghw_dsw_r ); |
| 28 | 28 | |
| 29 | | |
| 29 | DRIVER_INIT_CALL(megadrij | |
| 30 | 30 | |
| 31 | 31 | } |
| 32 | 32 |
| r1591 | r1592 | |
|---|---|---|
| 435 | 435 | static WRITE8_HANDLER( tnzsb_sound_command_w ) |
| 436 | 436 | { |
| 437 | 437 | soundlatch_w(offset,data); |
| 438 | cpunum_set_input_line_and_vector(2,0,HOLD_LINE,0xff); | |
| 438 | cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff); | |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | static ADDRESS_MAP_START( tnzsb_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
| 1256 | 1256 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 1257 | 1257 | static void irqhandler(int irq) |
| 1258 | 1258 | { |
| 1259 | cpunum_set_input_line(2, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1259 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1260 | 1260 | } |
| 1261 | 1261 | |
| 1262 | 1262 | static const struct YM2203interface kageki_ym2203_interface = |
| r1591 | r1592 | |
| 1293 | 1293 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1294 | 1294 | MDRV_CPU_VBLANK_INT(arknoid2_interrupt,1) |
| 1295 | 1295 | |
| 1296 | MDRV_CPU_ADD(Z80, 12 | |
| 1296 | MDRV_CPU_ADD(Z80, XTAL_12MHz | |
| 1297 | 1297 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1298 | 1298 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1299 | 1299 | |
| r1591 | r1592 | |
| 1318 | 1318 | /* sound hardware */ |
| 1319 | 1319 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1320 | 1320 | |
| 1321 | MDRV_SOUND_ADD(YM2203, 12 | |
| 1321 | MDRV_SOUND_ADD(YM2203, XTAL_12MHz | |
| 1322 | 1322 | MDRV_SOUND_CONFIG(ym2203_interface) |
| 1323 | 1323 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 1324 | 1324 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
| 1327 | 1327 | static MACHINE_DRIVER_START( drtoppel ) |
| 1328 | 1328 | |
| 1329 | 1329 | /* basic machine hardware */ |
| 1330 | MDRV_CPU_ADD(Z80,12 | |
| 1330 | MDRV_CPU_ADD(Z80,XTAL_12MHz | |
| 1331 | 1331 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1332 | 1332 | MDRV_CPU_VBLANK_INT(arknoid2_interrupt,1) |
| 1333 | 1333 | |
| 1334 | MDRV_CPU_ADD(Z80,12 | |
| 1334 | MDRV_CPU_ADD(Z80,XTAL_12MHz | |
| 1335 | 1335 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1336 | 1336 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1337 | 1337 | |
| r1591 | r1592 | |
| 1356 | 1356 | /* sound hardware */ |
| 1357 | 1357 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1358 | 1358 | |
| 1359 | MDRV_SOUND_ADD(YM2203, | |
| 1359 | MDRV_SOUND_ADD(YM2203, XTAL_12MHz/4) | |
| 1360 | 1360 | MDRV_SOUND_CONFIG(ym2203_interface) |
| 1361 | 1361 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 1362 | 1362 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
| 1365 | 1365 | static MACHINE_DRIVER_START( tnzs ) |
| 1366 | 1366 | |
| 1367 | 1367 | /* basic machine hardware */ |
| 1368 | MDRV_CPU_ADD(Z80,12 | |
| 1368 | MDRV_CPU_ADD(Z80,XTAL_12MHz | |
| 1369 | 1369 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1370 | 1370 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1371 | 1371 | |
| 1372 | MDRV_CPU_ADD(Z80,12 | |
| 1372 | MDRV_CPU_ADD(Z80,XTAL_12MHz | |
| 1373 | 1373 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1374 | 1374 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1375 | 1375 | |
| r1591 | r1592 | |
| 1397 | 1397 | /* sound hardware */ |
| 1398 | 1398 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1399 | 1399 | |
| 1400 | MDRV_SOUND_ADD(YM2203, | |
| 1400 | MDRV_SOUND_ADD(YM2203, XTAL_12MHz/4) | |
| 1401 | 1401 | MDRV_SOUND_CONFIG(ym2203_interface) |
| 1402 | 1402 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 1403 | 1403 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
| 1406 | 1406 | static MACHINE_DRIVER_START( insectx ) |
| 1407 | 1407 | |
| 1408 | 1408 | /* basic machine hardware */ |
| 1409 | MDRV_CPU_ADD(Z80, 12 | |
| 1409 | MDRV_CPU_ADD(Z80, XTAL_12MHz | |
| 1410 | 1410 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1411 | 1411 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1412 | 1412 | |
| 1413 | MDRV_CPU_ADD(Z80, 12 | |
| 1413 | MDRV_CPU_ADD(Z80, XTAL_12MHz | |
| 1414 | 1414 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1415 | 1415 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1416 | 1416 | |
| r1591 | r1592 | |
| 1434 | 1434 | /* sound hardware */ |
| 1435 | 1435 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1436 | 1436 | |
| 1437 | MDRV_SOUND_ADD(YM2203, 12 | |
| 1437 | MDRV_SOUND_ADD(YM2203, XTAL_12MHz | |
| 1438 | 1438 | MDRV_SOUND_CONFIG(ym2203_interface) |
| 1439 | 1439 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 1440 | 1440 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
| 1443 | 1443 | static MACHINE_DRIVER_START( kageki ) |
| 1444 | 1444 | |
| 1445 | 1445 | /* basic machine hardware */ |
| 1446 | MDRV_CPU_ADD(Z80, 12 | |
| 1446 | MDRV_CPU_ADD(Z80, XTAL_12MHz | |
| 1447 | 1447 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1448 | 1448 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1449 | 1449 | |
| 1450 | MDRV_CPU_ADD(Z80, 12 | |
| 1450 | MDRV_CPU_ADD(Z80, XTAL_12MHz | |
| 1451 | 1451 | MDRV_CPU_PROGRAM_MAP(kageki_sub_readmem,kageki_sub_writemem) |
| 1452 | 1452 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1453 | 1453 | |
| r1591 | r1592 | |
| 1471 | 1471 | /* sound hardware */ |
| 1472 | 1472 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1473 | 1473 | |
| 1474 | MDRV_SOUND_ADD(YM2203, 12 | |
| 1474 | MDRV_SOUND_ADD(YM2203, XTAL_12MHz | |
| 1475 | 1475 | MDRV_SOUND_CONFIG(kageki_ym2203_interface) |
| 1476 | 1476 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 1477 | 1477 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| r1591 | r1592 | |
| 1487 | 1487 | static MACHINE_DRIVER_START( tnzsb ) |
| 1488 | 1488 | |
| 1489 | 1489 | /* basic machine hardware */ |
| 1490 | MDRV_CPU_ADD_TAG("cpu0", Z80, | |
| 1490 | MDRV_CPU_ADD_TAG("cpu0", Z80, XTAL_12MHz/2) | |
| 1491 | 1491 | MDRV_CPU_PROGRAM_MAP(cpu0_type2,0) |
| 1492 | 1492 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1493 | 1493 | |
| 1494 | MDRV_CPU_ADD_TAG("cpu1", Z80, | |
| 1494 | MDRV_CPU_ADD_TAG("cpu1", Z80, XTAL_12MHz/2) | |
| 1495 | 1495 | MDRV_CPU_PROGRAM_MAP(tnzsb_cpu1_map,0) |
| 1496 | 1496 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 1497 | 1497 | |
| 1498 | MDRV_CPU_ADD_TAG("cpu2", Z80, 12 | |
| 1498 | MDRV_CPU_ADD_TAG("cpu2", Z80, XTAL_12MHz | |
| 1499 | 1499 | MDRV_CPU_PROGRAM_MAP(tnzsb_cpu2_map,0) |
| 1500 | 1500 | MDRV_CPU_IO_MAP(tnzsb_readport,tnzsb_writeport) |
| 1501 | 1501 | |
| r1591 | r1592 | |
| 1519 | 1519 | /* sound hardware */ |
| 1520 | 1520 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1521 | 1521 | |
| 1522 | MDRV_SOUND_ADD_TAG("ym2203", YM2203, | |
| 1522 | MDRV_SOUND_ADD_TAG("ym2203", YM2203, XTAL_12MHz/4) /* verified on pcb */ | |
| 1523 | 1523 | MDRV_SOUND_CONFIG(ym2203b_interface) |
| 1524 | 1524 | MDRV_SOUND_ROUTE(0, "mono", 1.0) |
| 1525 | 1525 | MDRV_SOUND_ROUTE(1, "mono", 1.0) |
| r1591 | r1592 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | static WRITE8_HANDLER( tp84_sh_irqtrigger_w ) |
| 160 | 160 | { |
| 161 | cpunum_set_input_line_and_vector(2,0,HOLD_LINE,0xff); | |
| 161 | cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 |
| r1591 | r1592 | |
|---|---|---|
| 657 | 657 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 658 | 658 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 659 | 659 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 660 | PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Demo_Sounds ) ) | |
| 661 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) | |
| 662 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 660 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) ) | |
| 661 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 662 | PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) | |
| 663 | 663 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) |
| 664 | 664 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) |
| 665 | 665 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r1591 | r1592 | |
| 676 | 676 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 677 | 677 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 678 | 678 | |
| 679 | PORT_START /* Dip switch bank 3 */ | |
| 679 | PORT_START /* Dip switch bank 3 - This bank of switches are _NOT_ shown in the test mode screen */ | |
| 680 | 680 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) |
| 681 | 681 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 682 | 682 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r1591 | r1592 | |
| 692 | 692 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) |
| 693 | 693 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 694 | 694 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 695 | PORT_DIPNAME( 0x0020, 0x0020, | |
| 695 | PORT_DIPNAME( 0x0020, 0x0020, " | |
| 696 | 696 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 697 | 697 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 698 | 698 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) |
| r1591 | r1592 | |
| 794 | 794 | |
| 795 | 795 | static void sound_irq(int state) |
| 796 | 796 | { |
| 797 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 797 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 800 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1591 | r1592 | |
| 818 | 818 | MDRV_CPU_PROGRAM_MAP(rohga_readmem,rohga_writemem) |
| 819 | 819 | MDRV_CPU_VBLANK_INT(irq6_line_hold,1) |
| 820 | 820 | |
| 821 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 | |
| 821 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 | |
| 822 | 822 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 823 | 823 | |
| 824 | 824 | MDRV_SCREEN_REFRESH_RATE(58) |
| r1591 | r1592 | |
| 861 | 861 | MDRV_CPU_PROGRAM_MAP(wizdfire_readmem,wizdfire_writemem) |
| 862 | 862 | MDRV_CPU_VBLANK_INT(irq6_line_hold,1) |
| 863 | 863 | |
| 864 | MDRV_CPU_ADD(H6280,32220000/4/3) | |
| 864 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ | |
| 865 | 865 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 866 | 866 | |
| 867 | 867 | MDRV_SCREEN_REFRESH_RATE(58) |
| r1591 | r1592 | |
| 904 | 904 | MDRV_CPU_PROGRAM_MAP(nitrobal_readmem,nitrobal_writemem) |
| 905 | 905 | MDRV_CPU_VBLANK_INT(irq6_line_hold,1) |
| 906 | 906 | |
| 907 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 | |
| 907 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 | |
| 908 | 908 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 909 | 909 | |
| 910 | 910 | MDRV_SCREEN_REFRESH_RATE(58) |
| r1591 | r1592 | |
| 947 | 947 | MDRV_CPU_PROGRAM_MAP(schmeisr_readmem,schmeisr_writemem) |
| 948 | 948 | MDRV_CPU_VBLANK_INT(irq6_line_hold,1) |
| 949 | 949 | |
| 950 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 | |
| 950 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 | |
| 951 | 951 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 952 | 952 | |
| 953 | 953 | MDRV_SCREEN_REFRESH_RATE(58) |
| r1591 | r1592 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | static WRITE8_HANDLER( cpu_sound_command_w ) { |
| 145 | 145 | soundlatch_w( offset, data ); |
| 146 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 146 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
| r1591 | r1592 | |
| 388 | 388 | |
| 389 | 389 | static void vball_irq_handler(int irq) |
| 390 | 390 | { |
| 391 | cpunum_set_input_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 391 | cpunum_set_input_line(Machine, 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 22 | 22 | static INTERRUPT_GEN( higemaru_interrupt ) |
| 23 | 23 | { |
| 24 | 24 | if (cpu_getiloops() == 0) |
| 25 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xcf); /* RST 08h */ | |
| 25 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xcf); /* RST 08h */ | |
| 26 | 26 | else |
| 27 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xd7); /* RST 10h */ | |
| 27 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xd7); /* RST 10h */ | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 |
| r1591 | r1592 | |
|---|---|---|
| 154 | 154 | static INTERRUPT_GEN(polygonet_interrupt) |
| 155 | 155 | { |
| 156 | 156 | if (cpu_getiloops()) |
| 157 | cpunum_set_input_line(0, MC68000_IRQ_5, HOLD_LINE); | |
| 157 | cpunum_set_input_line(machine, 0, MC68000_IRQ_5, HOLD_LINE); | |
| 158 | 158 | else |
| 159 | cpunum_set_input_line(0, MC68000_IRQ_3, HOLD_LINE); | |
| 159 | cpunum_set_input_line(machine, 0, MC68000_IRQ_3, HOLD_LINE); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /* sound CPU communications */ |
| r1591 | r1592 | |
| 184 | 184 | |
| 185 | 185 | static WRITE32_HANDLER( sound_irq_w ) |
| 186 | 186 | { |
| 187 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 187 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | |
| r1591 | r1592 | |
| 639 | 639 | |
| 640 | 640 | static INTERRUPT_GEN(audio_interrupt) |
| 641 | 641 | { |
| 642 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 642 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 40 | 40 | * |
| 41 | 41 | *************************************/ |
| 42 | 42 | |
| 43 | static void update_interrupts( | |
| 43 | static void update_interrupts(running_machine *machine) | |
| 44 | 44 | { |
| 45 | 45 | int newstate = 0; |
| 46 | 46 | |
| r1591 | r1592 | |
| 50 | 50 | newstate |= 6; |
| 51 | 51 | |
| 52 | 52 | if (newstate) |
| 53 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 53 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 54 | 54 | else |
| 55 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 55 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| r1591 | r1592 | |
| 92 | 92 | |
| 93 | 93 | /* bit 4 is connected to the /RESET pin on the 6502 */ |
| 94 | 94 | if (latch_data & 0x0010) |
| 95 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 95 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 96 | 96 | else |
| 97 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 97 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 98 | 98 | |
| 99 | 99 | /* alpha bank is selected by the upper 4 bits */ |
| 100 | 100 | if ((oldword ^ latch_data) & 0x7000) |
| r1591 | r1592 | |
|---|---|---|
| 698 | 698 | #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ |
| 699 | 699 | ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_BIOS(bios+1)) /* Note '+1' */ |
| 700 | 700 | |
| 701 | /* BIOS info: | |
| 701 | 702 | |
| 703 | Revisions A through C can handle game carts only | |
| 704 | Revisions D and later can also handle GD-Rom board | |
| 705 | Revisions F and later can also handle GD-Rom board and or the network GD-Rom board | |
| 702 | 706 | |
| 707 | F355 has it's own BIOS (3 screen version) and different JVS I/O Board | |
| 708 | ||
| 709 | Info from roms starting at 0x1ffd60 | |
| 710 | ||
| 711 | EPR-21576g - NAOMI BOOT ROM 2001 09/10 1.70 (Japan) | |
| 712 | EPR-21577e - NAOMI BOOT ROM 2000 08/25 1.50 (USA) | |
| 713 | EPR-21578e - NAOMI BOOT ROM 2000 08/25 1.50 (Export) | |
| 714 | EPR-21578d - NAOMI BOOT ROM 1999 06/04 1.40 (Export) | |
| 715 | EPR-21578a - NAOMI BOOT ROM 1999 02/15 1.20 (Export) | |
| 716 | EPR-21579 - No known dump (Korea) | |
| 717 | EPR-21580 - No known dump (Australia) | |
| 718 | EPR-22851 - NAOMI BOOT ROM 1999 08/30 1.35 (Multisystem 3 screen) | |
| 719 | ||
| 720 | EPR-21577e & EPR-2178e differ by 7 bytes: | |
| 721 | ||
| 722 | 0x53e20 is the region byte (only one region byte) | |
| 723 | 0x1ffffa-0x1fffff is the BIOS checksum | |
| 724 | ||
| 725 | ||
| 726 | Region byte encoding is as follows: | |
| 727 | ||
| 728 | 0x00 = Japan | |
| 729 | 0x01 = USA | |
| 730 | 0x02 = Export | |
| 731 | ???? = Korea | |
| 732 | ???? = Australia | |
| 733 | ||
| 734 | Scan ROM for the text string "LOADING TEST MODE NOW" back up four (4) bytes for the region byte. | |
| 735 | NOTE: this doesn't work for the multi screen boot rom | |
| 736 | ||
| 737 | */ | |
| 738 | ||
| 703 | 739 | #define NAOMI_BIOS \ |
| 704 | ROM_SYSTEM_BIOS( 0, "bios0", "epr-21577" ) \ | |
| 705 | ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21577.bin", 0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \ | |
| 706 | ROM_SYSTEM_BIOS( 1, "bios1", "epr-21576d" ) \ | |
| 707 | ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21576d.bin", 0x000000, 0x200000, CRC(dfd5f42a) SHA1(614a0db4743a5e5a206190d6786ade24325afbfd) ) /*also found as epr21578d */ \ | |
| 708 | ROM_SYSTEM_BIOS( 2, "bios2", "epr-21578" ) \ | |
| 709 | ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21578.bin", 0x000000, 0x200000, CRC(087f09a3) SHA1(0418eb2cf9766f0b1b874a4e92528779e22c0a4a) ) \ | |
| 710 | ROM_SYSTEM_BIOS( 3, "bios3", "epr-21576g" ) \ | |
| 711 | ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21576g.bin", 0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) /* might be naomi2 */ \ | |
| 740 | ROM_SYSTEM_BIOS( 0, "bios0", "epr-21578e" ) \ | |
| 741 | ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21578e.bin", 0x000000, 0x200000, CRC(087f09a3) SHA1(0418eb2cf9766f0b1b874a4e92528779e22c0a4a) ) \ | |
| 742 | ROM_SYSTEM_BIOS( 1, "bios1", "epr-21578d" ) \ | |
| 743 | ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21578d.bin", 0x000000, 0x200000, CRC(dfd5f42a) SHA1(614a0db4743a5e5a206190d6786ade24325afbfd) ) \ | |
| 744 | ROM_SYSTEM_BIOS( 2, "bios2", "epr-21578a" ) \ | |
| 745 | ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21578a.bin", 0x000000, 0x200000, CRC(6c9aad83) SHA1(555918de76d8dbee2a97d8a95297ef694b3e803f) ) \ | |
| 746 | ROM_SYSTEM_BIOS( 3, "bios3", "epr-21577e" ) \ | |
| 747 | ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21577e.bin", 0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \ | |
| 748 | ROM_SYSTEM_BIOS( 4, "bios4", "epr-21576g" ) \ | |
| 749 | ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21576g.bin", 0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \ | |
| 750 | ROM_SYSTEM_BIOS( 5, "bios5", "epr-22851" ) \ | |
| 751 | ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-22851.bin", 0x000000, 0x200000, CRC(62483677) SHA1(3e3bcacf5f972c376b569f45307ee7fd0b5031b7) ) \ | |
| 712 | 752 | |
| 713 | 753 | |
| 754 | /* NAOMI2 BIOS: | |
| 714 | 755 | |
| 756 | EPR-23609 - NAOMI BOOT ROM 2001 01/19 1.50 | |
| 757 | EPR-2360xB - NAOMI BOOT ROM 2001 09/10 1.70 | |
| 758 | ||
| 759 | EPR-23605B, EPR-23607B & EPR-23608B all differ by 6 bytes: | |
| 760 | ||
| 761 | 0x0553a0 is the first region byte | |
| 762 | 0x1ecf40 is a second region byte (value is the same as the first region byte ) | |
| 763 | 0x1fffc-1ffff is the BIOS rom checksum (might be 0x1ffffa-0x1fffff) | |
| 764 | ||
| 765 | EPR-23609 - Japan (region = 0x00) | |
| 766 | EPR-23605b - Japan (region = 0x00) | |
| 767 | EPR-23607b - USA (region = 0x01) | |
| 768 | EPR-23608b - Export (region = 0x02) | |
| 769 | ||
| 770 | */ | |
| 771 | ||
| 715 | 772 | #define NAOMI2_BIOS \ |
| 716 | ROM_SYSTEM_BIOS( 0, "bios0", "epr-23605b" ) \ | |
| 717 | ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-23605b.bin", 0x000000, 0x200000, CRC(3a3242d4) SHA1(aaca4df51ef91d926f8191d372f3dfe1d20d9484) ) \ | |
| 773 | ROM_SYSTEM_BIOS( 0, "bios0", "epr-23608b" ) \ | |
| 774 | ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-23608b.bin", 0x000000, 0x200000, CRC(a554b1e3) SHA1(343b727a3619d1c75a9b6d4cc156a9050447f155) ) \ | |
| 718 | 775 | ROM_SYSTEM_BIOS( 1, "bios1", "epr-23607b" ) \ |
| 719 | 776 | ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-23607b.bin", 0x000000, 0x200000, CRC(f308c5e9) SHA1(5470ab1cee6afecbd8ca8cf40f8fbe4ec2cb1471) ) \ |
| 720 | ROM_SYSTEM_BIOS( 2, "bios2", "epr-23608b" ) \ | |
| 721 | ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-23608b.bin", 0x000000, 0x200000, CRC(a554b1e3) SHA1(343b727a3619d1c75a9b6d4cc156a9050447f155) ) \ | |
| 777 | ROM_SYSTEM_BIOS( 2, "bios2", "epr-23605b" ) \ | |
| 778 | ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-23605b.bin", 0x000000, 0x200000, CRC(3a3242d4) SHA1(aaca4df51ef91d926f8191d372f3dfe1d20d9484) ) \ | |
| 722 | 779 | ROM_SYSTEM_BIOS( 3, "bios3", "epr-23609" ) \ |
| 723 | ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-23609.bin", 0x000000, 0x200000, CRC(5731e446) SHA1(787b0844fc408cf124c12405c095c59948709ea6) ) | |
| 780 | ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-23609.bin", 0x000000, 0x200000, CRC(5731e446) SHA1(787b0844fc408cf124c12405c095c59948709ea6) ) | |
| 724 | 781 | |
| 725 | 782 | /* this is one flashrom, however the second half looks like it's used for game settings, may differ between dumps, and may not be needed / could be blanked */ |
| 726 | 783 | #define AW_BIOS \ |
| r1591 | r1592 | |
|---|---|---|
| 94 | 94 | static INTERRUPT_GEN( nemesis_interrupt ) |
| 95 | 95 | { |
| 96 | 96 | if (irq_on) |
| 97 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 97 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| r1591 | r1592 | |
| 102 | 102 | { |
| 103 | 103 | if(ACCESSING_LSB) { |
| 104 | 104 | soundlatch_w(offset,data & 0xff); |
| 105 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 105 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| r1591 | r1592 | |
| 112 | 112 | { |
| 113 | 113 | if (cpu_getiloops() == 0) |
| 114 | 114 | { |
| 115 | if ( (irq_on) && (gx400_irq1_cnt++ & 1) ) cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 115 | if ( (irq_on) && (gx400_irq1_cnt++ & 1) ) cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 116 | 116 | } |
| 117 | 117 | else |
| 118 | 118 | { |
| 119 | if (irq2_on) cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 119 | if (irq2_on) cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| r1591 | r1592 | |
| 125 | 125 | switch (cpu_getiloops()) |
| 126 | 126 | { |
| 127 | 127 | case 0: |
| 128 | if (irq2_on) cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 128 | if (irq2_on) cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 129 | 129 | break; |
| 130 | 130 | |
| 131 | 131 | case 1: |
| 132 | if ( (irq1_on) && (gx400_irq1_cnt++ & 1) ) cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 132 | if ( (irq1_on) && (gx400_irq1_cnt++ & 1) ) cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 133 | 133 | break; |
| 134 | 134 | |
| 135 | 135 | case 2: |
| 136 | if (irq4_on) cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 136 | if (irq4_on) cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 137 | 137 | break; |
| 138 | 138 | } |
| 139 | 139 | } |
| r1591 | r1592 | |
| 180 | 180 | static INTERRUPT_GEN( salamand_interrupt ) |
| 181 | 181 | { |
| 182 | 182 | if (irq_on) |
| 183 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 183 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | static INTERRUPT_GEN( blkpnthr_interrupt ) |
| 187 | 187 | { |
| 188 | 188 | if (irq_on) |
| 189 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 189 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static WRITE16_HANDLER( nemesis_irq_enable_word_w ) |
| r1591 | r1592 | |
| 2109 | 2109 | static void sound_irq(int state) |
| 2110 | 2110 | { |
| 2111 | 2111 | /* Interrupts _are_ generated, I wonder where they go.. */ |
| 2112 | /*cpunum_set_input_line(1,0,HOLD_LINE);*/ | |
| 2112 | /*cpunum_set_input_line(Machine, 1,0,HOLD_LINE);*/ | |
| 2113 | 2113 | } |
| 2114 | 2114 | |
| 2115 | 2115 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 194 | 194 | static INTERRUPT_GEN( progolf_interrupt ) |
| 195 | 195 | { |
| 196 | 196 | //if (readinputport(2) & 0xc0) |
| 197 | cpunum_set_input_line(0, /*0*/INPUT_LINE_NMI, /*HOLD_LINE*/PULSE_LINE); | |
| 197 | cpunum_set_input_line(machine, 0, /*0*/INPUT_LINE_NMI, /*HOLD_LINE*/PULSE_LINE); | |
| 198 | 198 | } |
| 199 | 199 | #endif |
| 200 | 200 |
| r1591 | r1592 | |
|---|---|---|
| 33 | 33 | if (ACCESSING_LSB) |
| 34 | 34 | { |
| 35 | 35 | sound_latch = (data & 0xff) << 1; |
| 36 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 36 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static READ8_HANDLER( magmax_sound_irq_ack ) |
| 41 | 41 | { |
| 42 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 42 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 43 | 43 | return 0; |
| 44 | 44 | } |
| 45 | 45 |
| r1591 | r1592 | |
|---|---|---|
| 300 | 300 | |
| 301 | 301 | /*A-Bus IRQ checks,where they could be located these?*/ |
| 302 | 302 | #define ABUSIRQ(_irq_,_vector_,_mask_) \ |
| 303 | if(!(stv_scu[40] & _mask_)) { cpunum_set_input_line_and_vector(0, _irq_, HOLD_LINE , _vector_); } | |
| 303 | if(!(stv_scu[40] & _mask_)) { cpunum_set_input_line_and_vector(machine, 0, _irq_, HOLD_LINE , _vector_); } | |
| 304 | 304 | #if 0 |
| 305 | 305 | if(stv_scu[42] & 1)//IRQ ACK |
| 306 | 306 | { |
| r1591 | r1592 | |
| 533 | 533 | return return_data; |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | static void stv_SMPC_w8 (int offset, UINT8 data) | |
| 536 | static void stv_SMPC_w8 (running_machine *machine, int offset, UINT8 data) | |
| 537 | 537 | { |
| 538 | 538 | mame_system_time systime; |
| 539 | 539 | |
| r1591 | r1592 | |
| 569 | 569 | if(!(smpc_ram[0x77] & 0x10)) |
| 570 | 570 | { |
| 571 | 571 | if(LOG_SMPC) logerror("SMPC: M68k on\n"); |
| 572 | cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 572 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 573 | 573 | en_68k = 1; |
| 574 | 574 | } |
| 575 | 575 | else |
| 576 | 576 | { |
| 577 | 577 | if(LOG_SMPC) logerror("SMPC: M68k off\n"); |
| 578 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 578 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 579 | 579 | en_68k = 0; |
| 580 | 580 | } |
| 581 | 581 | //if(LOG_SMPC) logerror("SMPC: ram [0x77] = %02x\n",smpc_ram[0x77]); |
| r1591 | r1592 | |
| 604 | 604 | if(!(stv_scu[40] & 0x0100)) /*Pad irq*/ |
| 605 | 605 | { |
| 606 | 606 | if(LOG_SMPC) logerror ("Interrupt: PAD irq at scanline %04x, Vector 0x48 Level 0x08\n",scanline); |
| 607 | cpunum_set_input_line_and_vector(0, 8, HOLD_LINE , 0x48); | |
| 607 | cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x48); | |
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | |
| r1591 | r1592 | |
| 622 | 622 | smpc_ram[0x5f]=0x02; |
| 623 | 623 | #if USE_SLAVE |
| 624 | 624 | stv_enable_slave_sh2 = 1; |
| 625 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 625 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 626 | 626 | #endif |
| 627 | 627 | break; |
| 628 | 628 | case 0x03: |
| 629 | 629 | if(LOG_SMPC) logerror ("SMPC: Slave OFF\n"); |
| 630 | 630 | smpc_ram[0x5f]=0x03; |
| 631 | 631 | stv_enable_slave_sh2 = 0; |
| 632 | cpu_trigger(1000); | |
| 633 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 632 | cpu_trigger(Machine, 1000); | |
| 633 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 634 | 634 | break; |
| 635 | 635 | case 0x06: |
| 636 | 636 | if(LOG_SMPC) logerror ("SMPC: Sound ON\n"); |
| 637 | 637 | /* wrong? */ |
| 638 | 638 | smpc_ram[0x5f]=0x06; |
| 639 | cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 639 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 640 | 640 | break; |
| 641 | 641 | case 0x07: |
| 642 | 642 | if(LOG_SMPC) logerror ("SMPC: Sound OFF\n"); |
| r1591 | r1592 | |
| 648 | 648 | case 0x0d: |
| 649 | 649 | if(LOG_SMPC) logerror ("SMPC: System Reset\n"); |
| 650 | 650 | smpc_ram[0x5f]=0x0d; |
| 651 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 651 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 652 | 652 | system_reset(); |
| 653 | 653 | break; |
| 654 | 654 | case 0x0e: |
| 655 | 655 | if(LOG_SMPC) logerror ("SMPC: Change Clock to 352\n"); |
| 656 | 656 | smpc_ram[0x5f]=0x0e; |
| 657 | cpunum_set_clock(0, MASTER_CLOCK_352/2); | |
| 658 | cpunum_set_clock(1, MASTER_CLOCK_352/2); | |
| 659 | cpunum_set_clock(2, MASTER_CLOCK_352/5); | |
| 660 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 657 | cpunum_set_clock(machine, 0, MASTER_CLOCK_352/2); | |
| 658 | cpunum_set_clock(machine, 1, MASTER_CLOCK_352/2); | |
| 659 | cpunum_set_clock(machine, 2, MASTER_CLOCK_352/5); | |
| 660 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 661 | 661 | break; |
| 662 | 662 | case 0x0f: |
| 663 | 663 | if(LOG_SMPC) logerror ("SMPC: Change Clock to 320\n"); |
| 664 | 664 | smpc_ram[0x5f]=0x0f; |
| 665 | cpunum_set_clock(0, MASTER_CLOCK_320/2); | |
| 666 | cpunum_set_clock(1, MASTER_CLOCK_320/2); | |
| 667 | cpunum_set_clock(2, MASTER_CLOCK_320/5); | |
| 668 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 665 | cpunum_set_clock(machine, 0, MASTER_CLOCK_320/2); | |
| 666 | cpunum_set_clock(machine, 1, MASTER_CLOCK_320/2); | |
| 667 | cpunum_set_clock(machine, 2, MASTER_CLOCK_320/5); | |
| 668 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 669 | 669 | break; |
| 670 | 670 | /*"Interrupt Back"*/ |
| 671 | 671 | case 0x10: |
| r1591 | r1592 | |
| 711 | 711 | // if(!(stv_scu[40] & 0x0080)) /*System Manager(SMPC) irq*/ /* we can't check this .. breaks controls .. probably issues elsewhere? */ |
| 712 | 712 | { |
| 713 | 713 | if(LOG_SMPC) logerror ("Interrupt: System Manager (SMPC) at scanline %04x, Vector 0x47 Level 0x08\n",scanline); |
| 714 | cpunum_set_input_line_and_vector(0, 8, HOLD_LINE , 0x47); | |
| 714 | cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x47); | |
| 715 | 715 | } |
| 716 | 716 | break; |
| 717 | 717 | /* RTC write*/ |
| r1591 | r1592 | |
| 735 | 735 | if(LOG_SMPC) logerror ("SMPC: NMI request\n"); |
| 736 | 736 | smpc_ram[0x5f]=0x18; |
| 737 | 737 | /*NMI is unconditionally requested?*/ |
| 738 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 738 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 739 | 739 | break; |
| 740 | 740 | case 0x19: |
| 741 | 741 | if(LOG_SMPC) logerror ("SMPC: NMI Enable\n"); |
| r1591 | r1592 | |
| 793 | 793 | |
| 794 | 794 | offset += byte; |
| 795 | 795 | |
| 796 | stv_SMPC_w8(offset,writedata); | |
| 796 | stv_SMPC_w8(Machine, offset,writedata); | |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | 799 | |
| r1591 | r1592 | |
| 830 | 830 | if(!(stv_scu[40] & 2))/*VBLANK-OUT*/ |
| 831 | 831 | { |
| 832 | 832 | if(LOG_IRQ) logerror ("Interrupt: VBlank-OUT at scanline %04x, Vector 0x41 Level 0x0e\n",scanline); |
| 833 | cpunum_set_input_line_and_vector(0, 0xe, HOLD_LINE , 0x41); | |
| 833 | cpunum_set_input_line_and_vector(machine, 0, 0xe, HOLD_LINE , 0x41); | |
| 834 | 834 | } |
| 835 | 835 | stv_vblank = 0; |
| 836 | 836 | #if UGLY_SOUND_HACK |
| r1591 | r1592 | |
| 852 | 852 | if((!(stv_scu[40] & 0x10)) && (!(stv_scu[38] & 0x80))) |
| 853 | 853 | { |
| 854 | 854 | if(LOG_IRQ) logerror ("Interrupt: Timer 1 at scanline %04x, Vector 0x44 Level 0x0b\n",scanline); |
| 855 | cpunum_set_input_line_and_vector(0, 0xb, HOLD_LINE, 0x44 ); | |
| 855 | cpunum_set_input_line_and_vector(machine, 0, 0xb, HOLD_LINE, 0x44 ); | |
| 856 | 856 | } |
| 857 | 857 | else if((!(stv_scu[40] & 0x10)) && (stv_scu[38] & 0x80)) |
| 858 | 858 | { |
| 859 | 859 | if(timer_1 == (stv_scu[36] & 0x1ff)) |
| 860 | 860 | { |
| 861 | 861 | if(LOG_IRQ) logerror ("Interrupt: Timer 1 at scanline %04x, Vector 0x44 Level 0x0b\n",scanline); |
| 862 | cpunum_set_input_line_and_vector(0, 0xb, HOLD_LINE, 0x44 ); | |
| 862 | cpunum_set_input_line_and_vector(machine, 0, 0xb, HOLD_LINE, 0x44 ); | |
| 863 | 863 | } |
| 864 | 864 | } |
| 865 | 865 | } |
| r1591 | r1592 | |
| 868 | 868 | if(!(stv_scu[40] & 8))/*Timer 0*/ |
| 869 | 869 | { |
| 870 | 870 | if(LOG_IRQ) logerror ("Interrupt: Timer 0 at scanline %04x, Vector 0x43 Level 0x0c\n",scanline); |
| 871 | cpunum_set_input_line_and_vector(0, 0xc, HOLD_LINE, 0x43 ); | |
| 871 | cpunum_set_input_line_and_vector(machine, 0, 0xc, HOLD_LINE, 0x43 ); | |
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | 874 | |
| r1591 | r1592 | |
| 876 | 876 | if(!(stv_scu[40] & 4))/*HBLANK-IN*/ |
| 877 | 877 | { |
| 878 | 878 | if(LOG_IRQ) logerror ("Interrupt: HBlank-In at scanline %04x, Vector 0x42 Level 0x0d\n",scanline); |
| 879 | cpunum_set_input_line_and_vector(0, 0xd, HOLD_LINE , 0x42); | |
| 879 | cpunum_set_input_line_and_vector(machine, 0, 0xd, HOLD_LINE , 0x42); | |
| 880 | 880 | } |
| 881 | 881 | } |
| 882 | 882 | else if(scanline == 224) |
| r1591 | r1592 | |
| 887 | 887 | if(!(stv_scu[40] & 1))/*VBLANK-IN*/ |
| 888 | 888 | { |
| 889 | 889 | if(LOG_IRQ) logerror ("Interrupt: VBlank IN at scanline %04x, Vector 0x40 Level 0x0f\n",scanline); |
| 890 | cpunum_set_input_line_and_vector(0, 0xf, HOLD_LINE , 0x40); | |
| 890 | cpunum_set_input_line_and_vector(machine, 0, 0xf, HOLD_LINE , 0x40); | |
| 891 | 891 | } |
| 892 | 892 | stv_vblank = 1; |
| 893 | 893 | |
| r1591 | r1592 | |
| 896 | 896 | if(!(stv_scu[40] & 8))/*Timer 0*/ |
| 897 | 897 | { |
| 898 | 898 | if(LOG_IRQ) logerror ("Interrupt: Timer 0 at scanline %04x, Vector 0x43 Level 0x0c\n",scanline); |
| 899 | cpunum_set_input_line_and_vector(0, 0xc, HOLD_LINE, 0x43 ); | |
| 899 | cpunum_set_input_line_and_vector(machine, 0, 0xc, HOLD_LINE, 0x43 ); | |
| 900 | 900 | } |
| 901 | 901 | } |
| 902 | 902 | if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/ |
| 903 | cpunum_set_input_line_and_vector(0, 2, HOLD_LINE , 0x4d); | |
| 903 | cpunum_set_input_line_and_vector(machine, 0, 2, HOLD_LINE , 0x4d); | |
| 904 | 904 | } |
| 905 | 905 | } |
| 906 | 906 | |
| r1591 | r1592 | |
| 1294 | 1294 | /*Sound IRQ*/ |
| 1295 | 1295 | if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1) |
| 1296 | 1296 | { |
| 1297 | //cpunum_set_input_line_and_vector(0, 9, HOLD_LINE , 0x46); | |
| 1297 | //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46); | |
| 1298 | 1298 | logerror("SCSP: Main CPU interrupt\n"); |
| 1299 | 1299 | #if 0 |
| 1300 | 1300 | if((scu_dst_0 & 0x7ffffff) != 0x05a00000) |
| 1301 | 1301 | { |
| 1302 | 1302 | if(!(stv_scu[40] & 0x1000)) |
| 1303 | 1303 | { |
| 1304 | cpunum_set_input_line_and_vector(0, 3, HOLD_LINE, 0x4c); | |
| 1304 | cpunum_set_input_line_and_vector(Machine, 0, 3, HOLD_LINE, 0x4c); | |
| 1305 | 1305 | logerror("SCU: Illegal DMA interrupt\n"); |
| 1306 | 1306 | } |
| 1307 | 1307 | } |
| r1591 | r1592 | |
| 1355 | 1355 | /*Sound IRQ*/ |
| 1356 | 1356 | if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1) |
| 1357 | 1357 | { |
| 1358 | //cpunum_set_input_line_and_vector(0, 9, HOLD_LINE , 0x46); | |
| 1358 | //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46); | |
| 1359 | 1359 | logerror("SCSP: Main CPU interrupt\n"); |
| 1360 | 1360 | } |
| 1361 | 1361 | } |
| r1591 | r1592 | |
| 1405 | 1405 | /*Sound IRQ*/ |
| 1406 | 1406 | if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1) |
| 1407 | 1407 | { |
| 1408 | //cpunum_set_input_line_and_vector(0, 9, HOLD_LINE , 0x46); | |
| 1408 | //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46); | |
| 1409 | 1409 | logerror("SCSP: Main CPU interrupt\n"); |
| 1410 | 1410 | } |
| 1411 | 1411 | } |
| r1591 | r1592 | |
| 1584 | 1584 | |
| 1585 | 1585 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1586 | 1586 | if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/ |
| 1587 | cpunum_set_input_line_and_vector(0, 5, HOLD_LINE , 0x4b); | |
| 1587 | cpunum_set_input_line_and_vector(Machine, 0, 5, HOLD_LINE , 0x4b); | |
| 1588 | 1588 | |
| 1589 | 1589 | if(scu_add_tmp & 0x80000000) |
| 1590 | 1590 | { |
| r1591 | r1592 | |
| 1687 | 1687 | |
| 1688 | 1688 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1689 | 1689 | if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/ |
| 1690 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x4a); | |
| 1690 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x4a); | |
| 1691 | 1691 | |
| 1692 | 1692 | if(scu_add_tmp & 0x80000000) |
| 1693 | 1693 | { |
| r1591 | r1592 | |
| 1790 | 1790 | |
| 1791 | 1791 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1792 | 1792 | if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/ |
| 1793 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x49); | |
| 1793 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x49); | |
| 1794 | 1794 | |
| 1795 | 1795 | if(scu_add_tmp & 0x80000000) |
| 1796 | 1796 | { |
| r1591 | r1592 | |
| 1868 | 1868 | }while(job_done == 0); |
| 1869 | 1869 | |
| 1870 | 1870 | if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/ |
| 1871 | cpunum_set_input_line_and_vector(0, 5, HOLD_LINE , 0x4b); | |
| 1871 | cpunum_set_input_line_and_vector(Machine, 0, 5, HOLD_LINE , 0x4b); | |
| 1872 | 1872 | |
| 1873 | 1873 | D0MV_0; |
| 1874 | 1874 | } |
| r1591 | r1592 | |
| 1940 | 1940 | }while(job_done == 0); |
| 1941 | 1941 | |
| 1942 | 1942 | if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/ |
| 1943 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x4a); | |
| 1943 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x4a); | |
| 1944 | 1944 | |
| 1945 | 1945 | D1MV_0; |
| 1946 | 1946 | } |
| r1591 | r1592 | |
| 2011 | 2011 | }while(job_done == 0); |
| 2012 | 2012 | |
| 2013 | 2013 | if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/ |
| 2014 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x49); | |
| 2014 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x49); | |
| 2015 | 2015 | |
| 2016 | 2016 | D2MV_0; |
| 2017 | 2017 | } |
| r1591 | r1592 | |
| 2051 | 2051 | { |
| 2052 | 2052 | logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data); |
| 2053 | 2053 | cpu_boost_interleave(minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost)); |
| 2054 | cpu_trigger(1000); | |
| 2054 | cpu_trigger(Machine, 1000); | |
| 2055 | 2055 | cpunum_set_info_int(1, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE); |
| 2056 | 2056 | } |
| 2057 | 2057 | |
| r1591 | r1592 | |
| 2659 | 2659 | if (irq > 0) |
| 2660 | 2660 | { |
| 2661 | 2661 | scsp_last_line = irq; |
| 2662 | cpunum_set_input_line(2, irq, ASSERT_LINE); | |
| 2662 | cpunum_set_input_line(Machine, 2, irq, ASSERT_LINE); | |
| 2663 | 2663 | } |
| 2664 | 2664 | else if (irq < 0) |
| 2665 | 2665 | { |
| 2666 | cpunum_set_input_line(2, -irq, CLEAR_LINE); | |
| 2666 | cpunum_set_input_line(Machine, 2, -irq, CLEAR_LINE); | |
| 2667 | 2667 | } |
| 2668 | 2668 | else |
| 2669 | 2669 | { |
| 2670 | cpunum_set_input_line(2, scsp_last_line, CLEAR_LINE); | |
| 2670 | cpunum_set_input_line(Machine, 2, scsp_last_line, CLEAR_LINE); | |
| 2671 | 2671 | } |
| 2672 | 2672 | } |
| 2673 | 2673 | |
| r1591 | r1592 | |
| 2712 | 2712 | static MACHINE_RESET( stv ) |
| 2713 | 2713 | { |
| 2714 | 2714 | // don't let the slave cpu and the 68k go anywhere |
| 2715 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2715 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2716 | 2716 | stv_enable_slave_sh2 = 0; |
| 2717 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2717 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2718 | 2718 | |
| 2719 | 2719 | timer_0 = 0; |
| 2720 | 2720 | timer_1 = 0; |
| r1591 | r1592 | |
| 2722 | 2722 | NMI_reset = 1; |
| 2723 | 2723 | smpc_ram[0x21] = (0x80) | ((NMI_reset & 1) << 6); |
| 2724 | 2724 | |
| 2725 | cpunum_set_clock(0, MASTER_CLOCK_320/2); | |
| 2726 | cpunum_set_clock(1, MASTER_CLOCK_320/2); | |
| 2727 | cpunum_set_clock(2, MASTER_CLOCK_320/5); | |
| 2725 | cpunum_set_clock(machine, 0, MASTER_CLOCK_320/2); | |
| 2726 | cpunum_set_clock(machine, 1, MASTER_CLOCK_320/2); | |
| 2727 | cpunum_set_clock(machine, 2, MASTER_CLOCK_320/5); | |
| 2728 | 2728 | |
| 2729 | 2729 | stvcd_reset(); |
| 2730 | 2730 | } |
| r1591 | r1592 | |
| 3806 | 3806 | } |
| 3807 | 3807 | |
| 3808 | 3808 | |
| 3809 | | |
| 3809 | DRIVER_INIT_CALL(sasissu | |
| 3810 | 3810 | } |
| 3811 | 3811 | |
| 3812 | 3812 | GAME( 1996, stvbios, 0, stv, stv, stv, ROT0, "Sega", "ST-V Bios", GAME_IS_BIOS_ROOT ) |
| r1591 | r1592 | |
|---|---|---|
| 92 | 92 | #define MASTER_CLOCK 53693100 |
| 93 | 93 | |
| 94 | 94 | /* give us access to the megadriv start and update functions so that we can call them */ |
| 95 | extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 96 | extern void video_start_megadriv(running_machine *machine); | |
| 97 | extern void video_eof_megadriv(running_machine *machine); | |
| 98 | extern void machine_reset_megadriv(running_machine *machine); | |
| 95 | VIDEO_UPDATE( megadriv ); | |
| 96 | VIDEO_START( megadriv ); | |
| 97 | VIDEO_EOF( megadriv ); | |
| 98 | MACHINE_RESET( megadriv ); | |
| 99 | 99 | |
| 100 | 100 | /* in drivers/segae.c */ |
| 101 | extern UINT32 video_update_megatech_bios(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 102 | extern void video_eof_megatech_bios(running_machine *machine); | |
| 103 | extern void machine_reset_megatech_bios(running_machine *machine); | |
| 104 | extern void driver_init_megatech_bios(running_machine *machine); | |
| 101 | VIDEO_UPDATE( megatech_bios ); | |
| 102 | VIDEO_EOF( megatech_bios ); | |
| 103 | MACHINE_RESET( megatech_bios ); | |
| 104 | DRIVER_INIT( megatech_bios ); | |
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | /* not currently used */ |
| r1591 | r1592 | |
| 286 | 286 | case 0: |
| 287 | 287 | logerror("bank w %02x %02x\n", offset, data); |
| 288 | 288 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MRA8_BANK5); |
| 289 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_ | |
| 289 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_UNMAP); | |
| 290 | 290 | |
| 291 | 291 | //printf("bank ram??\n"); |
| 292 | 292 | break; |
| r1591 | r1592 | |
| 353 | 353 | /* fixed rom bank area */ |
| 354 | 354 | sms_rom = auto_malloc(0x400000); |
| 355 | 355 | memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MRA8_BANK5); |
| 356 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_ | |
| 356 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_UNMAP); | |
| 357 | 357 | memory_set_bankptr( 5, sms_rom ); |
| 358 | 358 | |
| 359 | 359 | memcpy(sms_rom, memory_region(REGION_CPU1), 0x400000); |
| r1591 | r1592 | |
| 375 | 375 | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | static void megatech_select_game(int gameno) | |
| 378 | static void megatech_select_game(running_machine *machine, int gameno) | |
| 379 | 379 | { |
| 380 | 380 | UINT8* game_region; |
| 381 | 381 | UINT8* bios_region; |
| 382 | 382 | |
| 383 | 383 | printf("game 0 selected\n"); |
| 384 | 384 | |
| 385 | cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 386 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 387 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 388 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 385 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 386 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 387 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 388 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 389 | 389 | sndti_reset(SOUND_YM2612, 0); |
| 390 | 390 | |
| 391 | 391 | game_region = memory_region(REGION_USER1 + (gameno*2) + 0); |
| r1591 | r1592 | |
| 409 | 409 | printf("SMS cart!!, CPU not running\n"); |
| 410 | 410 | current_game_is_sms = 1; |
| 411 | 411 | megatech_set_genz80_as_sms_standard_map(); |
| 412 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 413 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 412 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 413 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 414 | 414 | |
| 415 | 415 | |
| 416 | 416 | } |
| r1591 | r1592 | |
| 419 | 419 | printf("Genesis Cart, CPU0 running\n"); |
| 420 | 420 | current_game_is_sms = 0; |
| 421 | 421 | megatech_set_megadrive_z80_as_megadrive_z80(); |
| 422 | cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 423 | cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 422 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 423 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 424 | 424 | } |
| 425 | 425 | else |
| 426 | 426 | { |
| r1591 | r1592 | |
| 429 | 429 | } |
| 430 | 430 | else |
| 431 | 431 | { |
| 432 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 433 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 434 | // cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 435 | // cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 432 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 433 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 434 | // cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 435 | // cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 436 | 436 | |
| 437 | 437 | /* no cart.. */ |
| 438 | 438 | memset(memory_region(REGION_CPU3)+0x8000, 0x00, 0x8000); |
| r1591 | r1592 | |
| 454 | 454 | mt_cart_select_reg = data; |
| 455 | 455 | |
| 456 | 456 | |
| 457 | megatech_select_game(mt_cart_select_reg); | |
| 457 | megatech_select_game(Machine, mt_cart_select_reg); | |
| 458 | 458 | |
| 459 | 459 | /* |
| 460 | 460 | if (mt_cart_select_reg==2) |
| r1591 | r1592 | |
| 597 | 597 | static DRIVER_INIT(mtnew) |
| 598 | 598 | { |
| 599 | 599 | megatech_banked_ram = auto_malloc(0x1000*8); |
| 600 | driver_init_megadriv(Machine); | |
| 601 | driver_init_megatech_bios(Machine); | |
| 600 | DRIVER_INIT_CALL(megadriv); | |
| 601 | DRIVER_INIT_CALL(megatech_bios); | |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | static VIDEO_START(mtnew) |
| 605 | 605 | { |
| 606 | 606 | init_for_megadrive(); // create an sms vdp too, for comptibility mode |
| 607 | | |
| 607 | VIDEO_START_CALL(megadriv | |
| 608 | 608 | } |
| 609 | 609 | //attotime_never |
| 610 | 610 | static VIDEO_UPDATE(mtnew) |
| r1591 | r1592 | |
| 612 | 612 | if (screen ==0) |
| 613 | 613 | { |
| 614 | 614 | /* if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip */ |
| 615 | if (!current_game_is_sms) video_update_megadriv(machine,0,bitmap,cliprect); | |
| 616 | else video_update_megatech_md_sms(machine,0,bitmap,cliprect); | |
| 615 | if (!current_game_is_sms) VIDEO_UPDATE_CALL(megadriv); | |
| 616 | else VIDEO_UPDATE_CALL(megatech_md_sms); | |
| 617 | 617 | } |
| 618 | else if (screen ==1) | |
| 618 | else if (screen ==1) VIDEO_UPDATE_CALL(megatech_bios | |
| 619 | 619 | return 0; |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | static VIDEO_EOF(mtnew) |
| 623 | 623 | { |
| 624 | if (!current_game_is_sms) video_eof_megadriv(Machine); | |
| 625 | else video_eof_megatech_md_sms(Machine); | |
| 626 | video_eof_megatech_bios(Machine); | |
| 624 | if (!current_game_is_sms) VIDEO_EOF_CALL(megadriv); | |
| 625 | else VIDEO_EOF_CALL(megatech_md_sms); | |
| 626 | VIDEO_EOF_CALL(megatech_bios); | |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | static MACHINE_RESET(mtnew) |
| 630 | 630 | { |
| 631 | machine_reset_megadriv(Machine); | |
| 632 | machine_reset_megatech_bios(Machine); | |
| 633 | machine_reset_megatech_md_sms(Machine); | |
| 634 | megatech_select_game(0); | |
| 631 | MACHINE_RESET_CALL(megadriv); | |
| 632 | MACHINE_RESET_CALL(megatech_bios); | |
| 633 | MACHINE_RESET_CALL(megatech_md_sms); | |
| 634 | megatech_select_game(machine, 0); | |
| 635 | 635 | } |
| 636 | 636 | |
| 637 | 637 | static MACHINE_DRIVER_START( megatech ) |
| r1591 | r1592 | |
|---|---|---|
| 49 | 49 | static WRITE8_HANDLER( sound_reset_w ) |
| 50 | 50 | { |
| 51 | 51 | if ( data & 1 ) |
| 52 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE ); | |
| 52 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE ); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| r1591 | r1592 | |
| 250 | 250 | |
| 251 | 251 | static INTERRUPT_GEN( timelimt_irq ) { |
| 252 | 252 | if ( nmi_enabled ) |
| 253 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 253 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /***************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 27 | 27 | static WRITE8_HANDLER( talbot_mcu_halt_w ) |
| 28 | 28 | { |
| 29 | 29 | data &= 1; |
| 30 | cpunum_set_input_line(1, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); | |
| 30 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static WRITE8_HANDLER( talbot_mcu_switch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 442 | 442 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 443 | 443 | static void irqhandler(int irq) |
| 444 | 444 | { |
| 445 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 445 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 2387 | 2387 | { |
| 2388 | 2388 | switch (cpu_getiloops()) |
| 2389 | 2389 | { |
| 2390 | case 0: cpunum_set_input_line(0, 6, HOLD_LINE); break; | |
| 2390 | case 0: cpunum_set_input_line(machine, 0, 6, HOLD_LINE); break; | |
| 2391 | 2391 | default: |
| 2392 | case 1: cpunum_set_input_line(0, 5, HOLD_LINE); break; | |
| 2392 | case 1: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; | |
| 2393 | 2393 | } |
| 2394 | 2394 | } |
| 2395 | 2395 | |
| r1591 | r1592 | |
| 2421 | 2421 | { |
| 2422 | 2422 | switch (cpu_getiloops()) |
| 2423 | 2423 | { |
| 2424 | case 0: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 2425 | case 1: cpunum_set_input_line(0, 6, HOLD_LINE); break; | |
| 2424 | case 0: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 2425 | case 1: cpunum_set_input_line(machine, 0, 6, HOLD_LINE); break; | |
| 2426 | 2426 | } |
| 2427 | 2427 | } |
| 2428 | 2428 | |
| r1591 | r1592 | |
| 2439 | 2439 | { |
| 2440 | 2440 | switch (cpu_getiloops()) |
| 2441 | 2441 | { |
| 2442 | case 0: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 2443 | case 1: cpunum_set_input_line(0, 5, HOLD_LINE); break; | |
| 2444 | case 2: cpunum_set_input_line(0, 6, HOLD_LINE); break; | |
| 2442 | case 0: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 2443 | case 1: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; | |
| 2444 | case 2: cpunum_set_input_line(machine, 0, 6, HOLD_LINE); break; | |
| 2445 | 2445 | } |
| 2446 | 2446 | } |
| 2447 | 2447 | |
| r1591 | r1592 | |
| 2456 | 2456 | |
| 2457 | 2457 | static void sound_irq(int state) |
| 2458 | 2458 | { |
| 2459 | // cpunum_set_input_line(0, 3, state); | |
| 2459 | // cpunum_set_input_line(Machine, 0, 3, state); | |
| 2460 | 2460 | } |
| 2461 | 2461 | |
| 2462 | 2462 | static const struct ics2115_interface pgm_ics2115_interface = { |
| r1591 | r1592 | |
| 2468 | 2468 | { |
| 2469 | 2469 | switch (cpu_getiloops()) |
| 2470 | 2470 | { |
| 2471 | case 0: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 2472 | case 1: cpunum_set_input_line(0, 5, HOLD_LINE); break; | |
| 2473 | case 2: cpunum_set_input_line(0, 6, HOLD_LINE); break; | |
| 2471 | case 0: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 2472 | case 1: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; | |
| 2473 | case 2: cpunum_set_input_line(machine, 0, 6, HOLD_LINE); break; | |
| 2474 | 2474 | default: |
| 2475 | case 3: cpunum_set_input_line(0, 3, HOLD_LINE); break; // sound | |
| 2475 | case 3: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; // sound | |
| 2476 | 2476 | } |
| 2477 | 2477 | } |
| 2478 | 2478 |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | if (ACCESSING_MSB) |
| 32 | 32 | { |
| 33 | 33 | soundlatch_w(0, (data >> 8) & 0xff); |
| 34 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 34 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| r1591 | r1592 | |
| 234 | 234 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 235 | 235 | static void irqhandler(int irq) |
| 236 | 236 | { |
| 237 | cpunum_set_input_line(1, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 237 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
| 255 | 255 | |
| 256 | 256 | toggle ^= 1; |
| 257 | 257 | if(toggle) |
| 258 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 258 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | static const struct MSM5205interface msm5205_interface = |
| r1591 | r1592 | |
|---|---|---|
| 51 | 51 | switch (cpu_getiloops()) |
| 52 | 52 | { |
| 53 | 53 | case 0: |
| 54 | cpunum_set_input_line(0, MC68000_IRQ_3, HOLD_LINE); | |
| 54 | cpunum_set_input_line(machine, 0, MC68000_IRQ_3, HOLD_LINE); | |
| 55 | 55 | break; |
| 56 | 56 | |
| 57 | 57 | case 1: |
| 58 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 58 | cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 59 | 59 | break; |
| 60 | 60 | } |
| 61 | 61 | } |
| r1591 | r1592 | |
| 251 | 251 | static void sound_irq_gen(int state) |
| 252 | 252 | { |
| 253 | 253 | if (state) |
| 254 | cpunum_set_input_line(0, MC68000_IRQ_1, ASSERT_LINE); | |
| 254 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_1, ASSERT_LINE); | |
| 255 | 255 | else |
| 256 | cpunum_set_input_line(0, MC68000_IRQ_1, CLEAR_LINE); | |
| 256 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_1, CLEAR_LINE); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | static const struct YMZ280Binterface ymz280b_intf = |
| r1591 | r1592 | |
|---|---|---|
| 102 | 102 | static INTERRUPT_GEN( c1942_interrupt ) |
| 103 | 103 | { |
| 104 | 104 | if (cpu_getiloops() != 0) |
| 105 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf);/* RST 08h */ | |
| 105 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf);/* RST 08h */ | |
| 106 | 106 | else |
| 107 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ | |
| 107 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 |
| r1591 | r1592 | |
|---|---|---|
| 25 | 25 | static INTERRUPT_GEN( mayumi_interrupt ) |
| 26 | 26 | { |
| 27 | 27 | if (int_enable) |
| 28 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 28 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | static WRITE8_HANDLER( bank_sel_w ) |
| r1591 | r1592 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | static READ8_HANDLER( poolshrk_irq_reset_r ) |
| 92 | 92 | { |
| 93 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 93 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 94 | 94 | |
| 95 | 95 | return 0; |
| 96 | 96 | } |
| r1591 | r1592 | |
|---|---|---|
| 223 | 223 | |
| 224 | 224 | static INTERRUPT_GEN( raiden_interrupt ) |
| 225 | 225 | { |
| 226 | cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc8/4); /* VBL */ | |
| 226 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc8/4); /* VBL */ | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | static VIDEO_EOF( raiden ) |
| r1591 | r1592 | |
|---|---|---|
| 76 | 76 | add_exit_callback(machine, video_cleanup); |
| 77 | 77 | |
| 78 | 78 | /* standard video start */ |
| 79 | | |
| 79 | VIDEO_START_CALL(amiga | |
| 80 | 80 | |
| 81 | 81 | /* configure pen 4096 as transparent in the renderer and use it for the genlock color */ |
| 82 | 82 | render_container_set_palette_alpha(render_container_get_screen(0), 4096, 0x00); |
| r1591 | r1592 | |
| 152 | 152 | |
| 153 | 153 | static MACHINE_RESET( alg ) |
| 154 | 154 | { |
| 155 | | |
| 155 | MACHINE_RESET_CALL(amiga | |
| 156 | 156 | laserdisc_reset(discinfo, 0); |
| 157 | 157 | } |
| 158 | 158 | |
| r1591 | r1592 | |
| 269 | 269 | |
| 270 | 270 | else |
| 271 | 271 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 272 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ | |
| 272 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP); | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 |
| r1591 | r1592 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | static INTERRUPT_GEN( fromanc2_interrupt ) |
| 126 | 126 | { |
| 127 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 127 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| r1591 | r1592 | |
| 137 | 137 | soundlatch_w(offset, (data >> 8) & 0xff); // 1P (LEFT) |
| 138 | 138 | soundlatch2_w(offset, data & 0xff); // 2P (RIGHT) |
| 139 | 139 | |
| 140 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 140 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 141 | 141 | fromanc2_sndcpu_nmi_flag = 0; |
| 142 | 142 | } |
| 143 | 143 | |
| r1591 | r1592 | |
| 243 | 243 | { |
| 244 | 244 | fromanc2_datalatch1 = data; |
| 245 | 245 | |
| 246 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 246 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 247 | 247 | fromanc2_subcpu_int_flag = 0; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | static READ16_HANDLER( fromanc2_subcpu_r ) |
| 251 | 251 | { |
| 252 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 252 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 253 | 253 | fromanc2_subcpu_nmi_flag = 0; |
| 254 | 254 | |
| 255 | 255 | return (fromanc2_datalatch_2h << 8) | fromanc2_datalatch_2l; |
| r1591 | r1592 | |
| 684 | 684 | |
| 685 | 685 | static void irqhandler(int irq) |
| 686 | 686 | { |
| 687 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 687 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | static TIMER_CALLBACK( irq_off ) |
| 113 | 113 | { |
| 114 | cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 114 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r1591 | r1592 | |
| 124 | 124 | timer_set(video_screen_get_time_until_pos(0, param + 64, 0), NULL, param + 64, irq_timer); |
| 125 | 125 | |
| 126 | 126 | /* IRQ starts on scanline 0, 64, 128, etc. */ |
| 127 | cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 127 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 128 | 128 | |
| 129 | 129 | /* it will turn off on the next HBLANK */ |
| 130 | 130 | timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), NULL, 0, irq_off); |
| r1591 | r1592 | |
| 133 | 133 | |
| 134 | 134 | static TIMER_CALLBACK( firq_off ) |
| 135 | 135 | { |
| 136 | cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 136 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| r1591 | r1592 | |
| 143 | 143 | timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, 0), NULL, 0, firq_timer); |
| 144 | 144 | |
| 145 | 145 | /* IRQ starts on scanline FIRQ_SCANLINE? */ |
| 146 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 146 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 147 | 147 | |
| 148 | 148 | /* it will turn off on the next HBLANK */ |
| 149 | 149 | timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, BALSENTE_HBSTART), NULL, 0, firq_off); |
| r1591 | r1592 | |
|---|---|---|
| 203 | 203 | static WRITE8_HANDLER( rallyx_interrupt_vector_w ) |
| 204 | 204 | { |
| 205 | 205 | cpunum_set_input_line_vector(0, 0, data); |
| 206 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 206 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| r1591 | r1592 | |
| 232 | 232 | case 0x01: /* INT ON */ |
| 233 | 233 | cpu_interrupt_enable(0,bit); |
| 234 | 234 | if (!bit) |
| 235 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 235 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 236 | 236 | break; |
| 237 | 237 | |
| 238 | 238 | case 0x02: /* SOUND ON */ |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | static TIMER_CALLBACK( dac_irq ) |
| 55 | 55 | { |
| 56 | cpunum_set_input_line( 0, INPUT_LINE_NMI, PULSE_LINE ); | |
| 56 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE ); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static WRITE8_HANDLER( audio_dac_w) |
| r1591 | r1592 | |
|---|---|---|
| 1294 | 1294 | for(i=15; i>=0 && !(irqreq & (1<<i)); i--); |
| 1295 | 1295 | irqreq &= ~(1<<i); |
| 1296 | 1296 | if(!irqreq) |
| 1297 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 1297 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 1298 | 1298 | return i; |
| 1299 | 1299 | } |
| 1300 | 1300 | |
| 1301 | 1301 | static void irq_init(void) |
| 1302 | 1302 | { |
| 1303 | 1303 | irqreq = 0; |
| 1304 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 1304 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 1305 | 1305 | cpunum_set_irq_callback(0, irq_callback); |
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | 1308 | static void irq_raise(int level) |
| 1309 | 1309 | { |
| 1310 | 1310 | irqreq |= (1<<level); |
| 1311 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 1311 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 1312 | 1312 | } |
| 1313 | 1313 | |
| 1314 | 1314 |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | if (data & (1 << i)) code |= 0x80 >> i; |
| 82 | 82 | |
| 83 | 83 | soundlatch_w(offset,code); |
| 84 | if (sndnmi_enable) cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 84 | if (sndnmi_enable) cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE8_HANDLER( bking3_addr_l_w ) |
| r1591 | r1592 | |
| 210 | 210 | if (~data & 0x02) |
| 211 | 211 | { |
| 212 | 212 | portA_in = from_main; |
| 213 | if (main_sent) cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 213 | if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 214 | 214 | main_sent = 0; |
| 215 | 215 | } |
| 216 | 216 |
| r1591 | r1592 | |
|---|---|---|
| 715 | 715 | |
| 716 | 716 | static MACHINE_RESET( zeropt ) |
| 717 | 717 | { |
| 718 | | |
| 718 | MACHINE_RESET_CALL(unico | |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | static MACHINE_DRIVER_START( zeropnt ) |
| r1591 | r1592 | |
|---|---|---|
| 39 | 39 | static INTERRUPT_GEN( blockhl_interrupt ) |
| 40 | 40 | { |
| 41 | 41 | if (K052109_is_IRQ_enabled() && rombank == 0) /* kludge to prevent crashes */ |
| 42 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 42 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | static READ8_HANDLER( bankedram_r ) |
| 46 | 46 | { |
| 47 | 47 | if (palette_selected) |
| 48 | return paletteram | |
| 48 | return paletteram[ | |
| 49 | 49 | else |
| 50 | 50 | return ram[offset]; |
| 51 | 51 | } |
| r1591 | r1592 | |
| 60 | 60 | |
| 61 | 61 | static WRITE8_HANDLER( blockhl_sh_irqtrigger_w ) |
| 62 | 62 | { |
| 63 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0xff); | |
| 63 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 |
| r1591 | r1592 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | static TIMER_CALLBACK( gcpinbal_interrupt1 ) |
| 48 | 48 | { |
| 49 | cpunum_set_input_line(0,1,HOLD_LINE); | |
| 49 | cpunum_set_input_line(machine, 0,1,HOLD_LINE); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | #ifdef UNUSED_FUNCTION |
| r1591 | r1592 | |
| 55 | 55 | // IRQ3 is from the M6585 |
| 56 | 56 | // if (!ADPCM_playing(0)) |
| 57 | 57 | { |
| 58 | cpunum_set_input_line(0,3,HOLD_LINE); | |
| 58 | cpunum_set_input_line(machine, 0,3,HOLD_LINE); | |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | #endif |
| r1591 | r1592 | |
| 66 | 66 | |
| 67 | 67 | timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, gcpinbal_interrupt1); |
| 68 | 68 | // timer_set(ATTOTIME_IN_CYCLES(1000,0), NULL, 0, gcpinbal_interrupt3); |
| 69 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 69 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| r1591 | r1592 | |
| 210 | 210 | AM_RANGE(0x000000, 0x1fffff) AM_READ(MRA16_ROM) |
| 211 | 211 | AM_RANGE(0xc00000, 0xc03fff) AM_READ(gcpinbal_tilemaps_word_r) |
| 212 | 212 | AM_RANGE(0xc80000, 0xc80fff) AM_READ(MRA16_RAM) /* sprite ram */ |
| 213 | AM_RANGE(0xd00000, 0xd00fff) AM_READ( | |
| 213 | AM_RANGE(0xd00000, 0xd00fff) AM_READ(MRA | |
| 214 | 214 | AM_RANGE(0xd80000, 0xd800ff) AM_READ(ioc_r) |
| 215 | 215 | AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM) /* RAM */ |
| 216 | 216 | ADDRESS_MAP_END |
| r1591 | r1592 | |
|---|---|---|
| 227 | 227 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 228 | 228 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 229 | 229 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) // BUTTON3 in test mode |
| 230 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) | |
| 230 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) | |
| 231 | 231 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 232 | 232 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) |
| 233 | 233 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| r1591 | r1592 | |
| 235 | 235 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 236 | 236 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 237 | 237 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) // BUTTON3 in test mode |
| 238 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 ) | |
| 238 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 ) | |
| 239 | 239 | |
| 240 | 240 | PORT_START // IN1 - $c00002.w |
| 241 | 241 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r1591 | r1592 | |
| 249 | 249 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 250 | 250 | |
| 251 | 251 | PORT_START // IN2 - $c00004.w (DSW1) |
| 252 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) | |
| 252 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") | |
| 253 | 253 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) |
| 254 | 254 | PORT_DIPSETTING( 0x0001, DEF_STR( 4C_1C ) ) |
| 255 | 255 | PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) |
| r1591 | r1592 | |
| 258 | 258 | PORT_DIPSETTING( 0x0006, DEF_STR( 1C_2C ) ) |
| 259 | 259 | PORT_DIPSETTING( 0x0005, DEF_STR( 1C_3C ) ) |
| 260 | 260 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_5C ) ) |
| 261 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) | |
| 261 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6") | |
| 262 | 262 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) |
| 263 | 263 | PORT_DIPSETTING( 0x0008, DEF_STR( 4C_1C ) ) |
| 264 | 264 | PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) |
| r1591 | r1592 | |
| 267 | 267 | PORT_DIPSETTING( 0x0030, DEF_STR( 1C_2C ) ) |
| 268 | 268 | PORT_DIPSETTING( 0x0028, DEF_STR( 1C_3C ) ) |
| 269 | 269 | PORT_DIPSETTING( 0x0020, DEF_STR( 1C_5C ) ) |
| 270 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) | |
| 270 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:7") | |
| 271 | 271 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 272 | 272 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 273 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Demo_Sounds ) ) | |
| 273 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") | |
| 274 | 274 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 275 | 275 | PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) |
| 276 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) | |
| 276 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:9") | |
| 277 | 277 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 278 | 278 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 279 | PORT_SERVICE( 0x0200, IP_ACTIVE_LOW ) | |
| 279 | PORT_SERVICE_DIPLOC( 0x0200, IP_ACTIVE_LOW, "SW1:10" ) | |
| 280 | 280 | |
| 281 | 281 | PORT_START // IN3 - $c00004.w (DSW2) |
| 282 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) | |
| 282 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") | |
| 283 | 283 | PORT_DIPSETTING( 0x0000, "4" ) |
| 284 | 284 | PORT_DIPSETTING( 0x0001, "5" ) |
| 285 | 285 | PORT_DIPSETTING( 0x0003, "6" ) |
| 286 | 286 | PORT_DIPSETTING( 0x0002, "7" ) |
| 287 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) | |
| 287 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") | |
| 288 | 288 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 289 | 289 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 290 | 290 | PORT_DIPSETTING( 0x0004, DEF_STR( Harder ) ) |
| 291 | 291 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 292 | PORT_DIPNAME( 0x0030, 0x0030, "Time" ) | |
| 292 | PORT_DIPNAME( 0x0030, 0x0030, "Time" ) PORT_DIPLOCATION("SW2:5,6") | |
| 293 | 293 | PORT_DIPSETTING( 0x0000, "110" ) |
| 294 | 294 | PORT_DIPSETTING( 0x0030, "120" ) |
| 295 | 295 | PORT_DIPSETTING( 0x0020, "130" ) |
| 296 | 296 | PORT_DIPSETTING( 0x0010, "150" ) |
| 297 | PORT_DIPNAME( 0x0040, 0x0040, " | |
| 297 | PORT_DIPNAME( 0x0040, 0x0040, " | |
| 298 | 298 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 299 | 299 | PORT_DIPSETTING( 0x0040, DEF_STR( Yes ) ) |
| 300 | PORT_DIPNAME( 0x0080, 0x0080, " | |
| 300 | PORT_DIPNAME( 0x0080, 0x0080, " | |
| 301 | 301 | PORT_DIPSETTING( 0x0000, "1" ) |
| 302 | 302 | PORT_DIPSETTING( 0x0080, "2" ) |
| 303 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) | |
| 304 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 305 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 306 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) | |
| 307 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) | |
| 308 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 303 | PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW2:9" ) /* Manual doesn't even show switches 9 & 10 */ | |
| 304 | PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW2:10" ) | |
| 309 | 305 | |
| 310 | 306 | PORT_START // IN4 - $c00004.w (DSW3) - Unused |
| 311 | 307 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r1591 | r1592 | |
| 365 | 361 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) |
| 366 | 362 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 367 | 363 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 368 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) | |
| 369 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 370 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 371 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) | |
| 372 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 373 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 374 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) | |
| 375 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 376 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 377 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) | |
| 378 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 379 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 380 | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) | |
| 381 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) | |
| 382 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 364 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Coin_B ) ) | |
| 365 | PORT_DIPSETTING( 0x0800, DEF_STR( 1C_5C ) ) | |
| 366 | PORT_DIPSETTING( 0x0000, "1 Coin/10 Credits" ) | |
| 367 | PORT_DIPNAME( 0xf000, 0xf000, "Balls Per Credit" ) | |
| 368 | PORT_DIPSETTING( 0x7000, "5 Balls" ) | |
| 369 | PORT_DIPSETTING( 0x6000, "6 Balls" ) | |
| 370 | PORT_DIPSETTING( 0x5000, "10 Balls" ) | |
| 371 | PORT_DIPSETTING( 0x4000, "15 Balls" ) | |
| 372 | PORT_DIPSETTING( 0x3000, "20 Balls" ) | |
| 373 | PORT_DIPSETTING( 0x0000, "30 Balls" ) | |
| 374 | // PORT_DIPSETTING( 0x1000, "30 Balls" ) /* Duplicate Setting for 30 balls */ | |
| 375 | // PORT_DIPSETTING( 0x2000, "30 Balls" ) /* Duplicate Setting for 30 balls */ | |
| 376 | PORT_DIPSETTING( 0xf000, "40 Balls" ) | |
| 377 | PORT_DIPSETTING( 0xe000, "50 Balls" ) | |
| 378 | PORT_DIPSETTING( 0xd000, "60 Balls" ) | |
| 379 | PORT_DIPSETTING( 0xc000, "80 Balls" ) | |
| 380 | PORT_DIPSETTING( 0x8000, "100 Balls" ) | |
| 381 | // PORT_DIPSETTING( 0x9000, "100 Balls" ) /* Duplicate Setting for 100 balls */ | |
| 382 | // PORT_DIPSETTING( 0xa000, "100 Balls" ) /* Duplicate Setting for 100 balls */ | |
| 383 | // PORT_DIPSETTING( 0xb000, "100 Balls" ) /* Duplicate Setting for 100 balls */ | |
| 383 | 384 | |
| 384 | 385 | PORT_START |
| 385 | 386 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 386 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) | |
| 387 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 388 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 387 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) ) | |
| 388 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 389 | PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) | |
| 389 | 390 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 390 | 391 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 391 | 392 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r1591 | r1592 | |
| 403 | 404 | |
| 404 | 405 | PORT_START |
| 405 | 406 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 406 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) | |
| 407 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) | |
| 407 | 408 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 408 | 409 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) //F/F |
| 409 | 410 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) //Stop |
| r1591 | r1592 | |
| 415 | 416 | |
| 416 | 417 | PORT_START |
| 417 | 418 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )/*There's the Pay Out SW here IIRC*/ |
| 418 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 ) | |
| 419 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 ) | |
| 419 | 420 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 420 | 421 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) //F/F |
| 421 | 422 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) //Stop |
| r1591 | r1592 | |
| 444 | 445 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) |
| 445 | 446 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 446 | 447 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 447 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) | |
| 448 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 449 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 450 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) | |
| 451 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 452 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 453 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) | |
| 454 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 455 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 456 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) | |
| 457 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 458 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 459 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) | |
| 460 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 461 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 448 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Coin_B ) ) | |
| 449 | PORT_DIPSETTING( 0x0008, DEF_STR( 1C_5C ) ) | |
| 450 | PORT_DIPSETTING( 0x0000, "1 Coin/10 Credits" ) | |
| 451 | PORT_DIPNAME( 0x00f0, 0x00f0, "Balls Per Credit" ) | |
| 452 | PORT_DIPSETTING( 0x0070, "5 Balls" ) | |
| 453 | PORT_DIPSETTING( 0x0060, "6 Balls" ) | |
| 454 | PORT_DIPSETTING( 0x0050, "10 Balls" ) | |
| 455 | PORT_DIPSETTING( 0x0040, "15 Balls" ) | |
| 456 | PORT_DIPSETTING( 0x0030, "20 Balls" ) | |
| 457 | PORT_DIPSETTING( 0x0000, "30 Balls" ) | |
| 458 | // PORT_DIPSETTING( 0x0010, "30 Balls" ) /* Duplicate Setting for 30 balls */ | |
| 459 | // PORT_DIPSETTING( 0x0020, "30 Balls" ) /* Duplicate Setting for 30 balls */ | |
| 460 | PORT_DIPSETTING( 0x00f0, "40 Balls" ) | |
| 461 | PORT_DIPSETTING( 0x00e0, "50 Balls" ) | |
| 462 | PORT_DIPSETTING( 0x00d0, "60 Balls" ) | |
| 463 | PORT_DIPSETTING( 0x00c0, "80 Balls" ) | |
| 464 | PORT_DIPSETTING( 0x0080, "100 Balls" ) | |
| 465 | // PORT_DIPSETTING( 0x0090, "100 Balls" ) /* Duplicate Setting for 100 balls */ | |
| 466 | // PORT_DIPSETTING( 0x00a0, "100 Balls" ) /* Duplicate Setting for 100 balls */ | |
| 467 | // PORT_DIPSETTING( 0x00b0, "100 Balls" ) /* Duplicate Setting for 100 balls */ | |
| 462 | 468 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) |
| 463 | 469 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 464 | 470 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r1591 | r1592 | |
| 491 | 497 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) |
| 492 | 498 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 493 | 499 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 494 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) | |
| 495 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 496 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 500 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) ) | |
| 501 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 502 | PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) | |
| 497 | 503 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 498 | 504 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 499 | 505 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r1591 | r1592 | |
| 563 | 569 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 564 | 570 | |
| 565 | 571 | PORT_START //IN5 |
| 566 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) | |
| 572 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) | |
| 567 | 573 | PORT_DIPNAME( 0x0002, 0x0002, "Pay-Out SW" )//Not a real DIP-Switch |
| 568 | 574 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) |
| 569 | 575 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r1591 | r1592 | |
| 578 | 584 | PORT_BIT( 0xff00, 0x0000, IPT_PADDLE ) PORT_PLAYER(1) PORT_MINMAX(0,0x6400) PORT_SENSITIVITY(15) PORT_KEYDELTA(15) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) |
| 579 | 585 | |
| 580 | 586 | PORT_START //IN6 |
| 581 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START2 ) | |
| 587 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START2 ) | |
| 582 | 588 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED ) //Again Pay-Out SW in test mode,but it doesn't work,maybe it is for Player-2? |
| 583 | 589 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) //F/F |
| 584 | 590 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) //Stop |
| r1591 | r1592 | |
|---|---|---|
| 61 | 61 | if (ACCESSING_LSB) |
| 62 | 62 | { |
| 63 | 63 | soundlatch_w(0,data & 0xff); |
| 64 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 64 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 |
| r1591 | r1592 | |
|---|---|---|
| 122 | 122 | |
| 123 | 123 | else |
| 124 | 124 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 125 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ | |
| 125 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP); | |
| 126 | 126 | |
| 127 | 127 | /* bit 2 = Power Led on Amiga */ |
| 128 | 128 | set_led_status(0, (data & 2) ? 0 : 1); |
| r1591 | r1592 | |
|---|---|---|
| 182 | 182 | { |
| 183 | 183 | /* pressing the service switch sends an NMI */ |
| 184 | 184 | if (newval) |
| 185 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 185 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 |
| r1591 | r1592 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | if (ACCESSING_MSB) |
| 89 | 89 | { |
| 90 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE); | |
| 91 | if (data&0x8000) cpunum_set_input_line(0,3,HOLD_LINE); /* Guess */ | |
| 90 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE); | |
| 91 | if (data&0x8000) cpunum_set_input_line(Machine, 0,3,HOLD_LINE); /* Guess */ | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | if (ACCESSING_LSB32) |
| r1591 | r1592 | |
| 221 | 221 | different byte in this long word before the RTE. I assume all but the last |
| 222 | 222 | (top) byte cause an IRQ with the final one being an ACK. (Total guess but it works). */ |
| 223 | 223 | if (mem_mask!=0x00ffffff) |
| 224 | cpunum_set_input_line(0,3,HOLD_LINE); | |
| 224 | cpunum_set_input_line(Machine, 0,3,HOLD_LINE); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /*********************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 24 | 24 | static INTERRUPT_GEN( bottom9_interrupt ) |
| 25 | 25 | { |
| 26 | 26 | if (K052109_is_IRQ_enabled()) |
| 27 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 27 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| r1591 | r1592 | |
| 52 | 52 | static READ8_HANDLER( bottom9_bankedram2_r ) |
| 53 | 53 | { |
| 54 | 54 | if (K052109_selected) return K052109_051960_r(offset + 0x2000); |
| 55 | else return paletteram | |
| 55 | else return paletteram[ | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static WRITE8_HANDLER( bottom9_bankedram2_w ) |
| r1591 | r1592 | |
| 96 | 96 | |
| 97 | 97 | static WRITE8_HANDLER( bottom9_sh_irqtrigger_w ) |
| 98 | 98 | { |
| 99 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 99 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | static int nmienable; |
| r1591 | r1592 | |
| 104 | 104 | static INTERRUPT_GEN( bottom9_sound_interrupt ) |
| 105 | 105 | { |
| 106 | 106 | if (nmienable) |
| 107 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 107 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static WRITE8_HANDLER( nmi_enable_w ) |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | static WRITE8_HANDLER( flower_irq_ack ) |
| 55 | 55 | { |
| 56 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 56 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| r1591 | r1592 | |
| 63 | 63 | { |
| 64 | 64 | sn_irq_enable = data & 1; |
| 65 | 65 | |
| 66 | cpunum_set_input_line(2, 0, CLEAR_LINE); | |
| 66 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static INTERRUPT_GEN( sn_irq ) |
| 70 | 70 | { |
| 71 | 71 | if (sn_irq_enable) |
| 72 | cpunum_set_input_line(2, 0, ASSERT_LINE); | |
| 72 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static WRITE8_HANDLER( sn_nmi_enable_w ) |
| r1591 | r1592 | |
| 81 | 81 | { |
| 82 | 82 | soundlatch_w(0,data); |
| 83 | 83 | if (sn_nmi_enable) |
| 84 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 84 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static ADDRESS_MAP_START( flower_cpu1, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 47 | 47 | { |
| 48 | 48 | if (offset==0) { |
| 49 | 49 | soundlatch_w(0,data); |
| 50 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 50 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| r1591 | r1592 | |
| 119 | 119 | |
| 120 | 120 | toggle = 1 - toggle; |
| 121 | 121 | if (toggle) |
| 122 | cpunum_set_input_line(1, 1, HOLD_LINE); | |
| 122 | cpunum_set_input_line(Machine, 1, 1, HOLD_LINE); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static WRITE8_HANDLER( battlera_adpcm_data_w ) |
| r1591 | r1592 | |
|---|---|---|
| 199 | 199 | static WRITE8_HANDLER( xain_sound_command_w ) |
| 200 | 200 | { |
| 201 | 201 | soundlatch_w(offset,data); |
| 202 | cpunum_set_input_line(2,M6809_IRQ_LINE,HOLD_LINE); | |
| 202 | cpunum_set_input_line(Machine, 2,M6809_IRQ_LINE,HOLD_LINE); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | static WRITE8_HANDLER( xain_main_irq_w ) |
| r1591 | r1592 | |
| 207 | 207 | switch (offset) |
| 208 | 208 | { |
| 209 | 209 | case 0: /* 0x3a09 - NMI clear */ |
| 210 | cpunum_set_input_line(0,INPUT_LINE_NMI,CLEAR_LINE); | |
| 210 | cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,CLEAR_LINE); | |
| 211 | 211 | break; |
| 212 | 212 | case 1: /* 0x3a0a - FIRQ clear */ |
| 213 | cpunum_set_input_line(0,M6809_FIRQ_LINE,CLEAR_LINE); | |
| 213 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,CLEAR_LINE); | |
| 214 | 214 | break; |
| 215 | 215 | case 2: /* 0x3a0b - IRQ clear */ |
| 216 | cpunum_set_input_line(0,M6809_IRQ_LINE,CLEAR_LINE); | |
| 216 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,CLEAR_LINE); | |
| 217 | 217 | break; |
| 218 | 218 | case 3: /* 0x3a0c - IRQB assert */ |
| 219 | cpunum_set_input_line(1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 219 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 220 | 220 | break; |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | static WRITE8_HANDLER( xain_irqA_assert_w ) |
| 225 | 225 | { |
| 226 | cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 226 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | static WRITE8_HANDLER( xain_irqB_clear_w ) |
| 230 | 230 | { |
| 231 | cpunum_set_input_line(1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 231 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | static READ8_HANDLER( xain_68705_r ) |
| r1591 | r1592 | |
| 253 | 253 | |
| 254 | 254 | /* FIRQ (IMS) fires every on every 8th scanline (except 0) */ |
| 255 | 255 | if (scanline&0x08) |
| 256 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 256 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 257 | 257 | |
| 258 | 258 | /* NMI fires on scanline 248 (VBL) and is latched */ |
| 259 | 259 | if (scanline==248) |
| 260 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 260 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 261 | 261 | |
| 262 | 262 | /* VBLANK input bit is held high from scanlines 248-255 */ |
| 263 | 263 | if (scanline>=248-1) // -1 is a hack - see notes above |
| r1591 | r1592 | |
| 455 | 455 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 456 | 456 | static void irqhandler(int irq) |
| 457 | 457 | { |
| 458 | cpunum_set_input_line(2,M6809_FIRQ_LINE,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 458 | cpunum_set_input_line(Machine, 2,M6809_FIRQ_LINE,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 76 | 76 | rambase[0x005] = readinputport(3); /* IN1 */ |
| 77 | 77 | rambase[0x006] = readinputport(2); /* IN0 */ |
| 78 | 78 | } |
| 79 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h vblank */ | |
| 79 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h vblank */ | |
| 80 | 80 | } |
| 81 | 81 | else if ((cpu_getiloops() & 1) == 1) |
| 82 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h sound (hand tuned) */ | |
| 82 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h sound (hand tuned) */ | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static WRITE8_HANDLER( yamyam_bankswitch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 394 | 394 | |
| 395 | 395 | static WRITE8_HANDLER( namcos1_sub_firq_w ) |
| 396 | 396 | { |
| 397 | cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 397 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | static WRITE8_HANDLER( irq_ack_w ) |
| 401 | 401 | { |
| 402 | cpunum_set_input_line(cpu_getactivecpu(), 0, CLEAR_LINE); | |
| 402 | cpunum_set_input_line(Machine, cpu_getactivecpu(), 0, CLEAR_LINE); | |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | static WRITE8_HANDLER( firq_ack_w ) |
| 406 | 406 | { |
| 407 | cpunum_set_input_line(cpu_getactivecpu(), M6809_FIRQ_LINE, CLEAR_LINE); | |
| 407 | cpunum_set_input_line(Machine, cpu_getactivecpu(), M6809_FIRQ_LINE, CLEAR_LINE); | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | |
| r1591 | r1592 | |
| 971 | 971 | |
| 972 | 972 | static void namcos1_sound_interrupt( int irq ) |
| 973 | 973 | { |
| 974 | cpunum_set_input_line( 2, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 974 | cpunum_set_input_line(Machine, 2, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 975 | 975 | } |
| 976 | 976 | |
| 977 | 977 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 1007 | 1007 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 1008 | 1008 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| 1009 | 1009 | |
| 1010 | MDRV_CPU_ADD_TAG("MCU",HD63701,49152000/ | |
| 1010 | MDRV_CPU_ADD_TAG("MCU",HD63701,49152000/8 | |
| 1011 | 1011 | MDRV_CPU_PROGRAM_MAP(mcu_map, 0) |
| 1012 | 1012 | MDRV_CPU_IO_MAP(mcu_port_map, 0) |
| 1013 | 1013 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| r1591 | r1592 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | static WRITE8_HANDLER( mainevt_sh_irqtrigger_w ) |
| 90 | 90 | { |
| 91 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 91 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static WRITE8_HANDLER( mainevt_sh_irqcontrol_w ) |
| r1591 | r1592 | |
| 706 | 706 | static MACHINE_DRIVER_START( mainevt ) |
| 707 | 707 | |
| 708 | 708 | /* basic machine hardware */ |
| 709 | MDRV_CPU_ADD(HD6309, 3000000) /* ?? */ | |
| 709 | MDRV_CPU_ADD(HD6309, 3000000*4) /* ?? */ | |
| 710 | 710 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 711 | 711 | MDRV_CPU_VBLANK_INT(mainevt_interrupt,1) |
| 712 | 712 | |
| r1591 | r1592 | |
| 745 | 745 | static MACHINE_DRIVER_START( devstors ) |
| 746 | 746 | |
| 747 | 747 | /* basic machine hardware */ |
| 748 | MDRV_CPU_ADD(HD6309, 3000000) /* ?? */ | |
| 748 | MDRV_CPU_ADD(HD6309, 3000000*4) /* ?? */ | |
| 749 | 749 | MDRV_CPU_PROGRAM_MAP(dv_readmem,dv_writemem) |
| 750 | 750 | MDRV_CPU_VBLANK_INT(dv_interrupt,1) |
| 751 | 751 |
| r1591 | r1592 | |
|---|---|---|
| 482 | 482 | |
| 483 | 483 | static void ctc_interrupt(int state) |
| 484 | 484 | { |
| 485 | cpunum_set_input_line(1, 0, state); | |
| 485 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | |
| r1591 | r1592 | |
| 508 | 508 | /* initialize the CTC */ |
| 509 | 509 | ctc_intf.baseclock = cpunum_get_clock(0); |
| 510 | 510 | z80ctc_init(0, &ctc_intf); |
| 511 | | |
| 511 | MACHINE_START_CALL(astrocd | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | |
| 515 | 515 | static WRITE8_HANDLER( tenpindx_sound_w ) |
| 516 | 516 | { |
| 517 | 517 | soundlatch_w(offset, data); |
| 518 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 518 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 |
| r1591 | r1592 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | static WRITE8_HANDLER( megazone_i8039_irq_w ) |
| 77 | 77 | { |
| 78 | cpunum_set_input_line(2, 0, ASSERT_LINE); | |
| 78 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static WRITE8_HANDLER( i8039_irqen_and_status_w ) |
| 82 | 82 | { |
| 83 | 83 | if ((data & 0x80) == 0) |
| 84 | cpunum_set_input_line(2, 0, CLEAR_LINE); | |
| 84 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); | |
| 85 | 85 | i8039_status = (data & 0x70) >> 4; |
| 86 | 86 | } |
| 87 | 87 |
| r1591 | r1592 | |
|---|---|---|
| 417 | 417 | |
| 418 | 418 | static INTERRUPT_GEN( deco32_vbl_interrupt ) |
| 419 | 419 | { |
| 420 | cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE); | |
| 420 | cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE); | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | static MACHINE_DRIVER_START( hvysmsh ) |
| r1591 | r1592 | |
|---|---|---|
| 61 | 61 | static WRITE16_HANDLER( tokib_soundcommand16_w ) |
| 62 | 62 | { |
| 63 | 63 | soundlatch_w(0,data & 0xff); |
| 64 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 64 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static READ16_HANDLER( pip16_r ) |
| r1591 | r1592 | |
| 81 | 81 | |
| 82 | 82 | toggle ^= 1; |
| 83 | 83 | if (toggle) |
| 84 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 84 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE8_HANDLER( toki_adpcm_control_w ) |
| r1591 | r1592 | |
| 726 | 726 | |
| 727 | 727 | static DRIVER_INIT( toki ) |
| 728 | 728 | { |
| 729 | UINT8 *ROM = memory_region(REGION_SOUND1); | |
| 730 | UINT8 *buffer = malloc_or_die(0x20000); | |
| 731 | int i; | |
| 732 | ||
| 733 | memcpy(buffer,ROM,0x20000); | |
| 734 | for( i = 0; i < 0x20000; i++ ) | |
| 735 | { | |
| 736 | ROM[i] = buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,13,14,15,12,11,10,9,8,7,6,5,4,3,2,1,0)]; | |
| 737 | } | |
| 738 | ||
| 739 | free(buffer); | |
| 740 | ||
| 729 | 741 | seibu_sound_decrypt(REGION_CPU2,0x2000); |
| 730 | 742 | } |
| 731 | 743 | |
| r1591 | r1592 | |
| 800 | 812 | rom[i] = src^0x55; |
| 801 | 813 | } |
| 802 | 814 | } |
| 815 | ||
| 816 | { | |
| 817 | UINT8 *ROM = memory_region(REGION_SOUND1); | |
| 818 | UINT8 *buffer = malloc_or_die(0x20000); | |
| 819 | int i; | |
| 820 | ||
| 821 | memcpy(buffer,ROM,0x20000); | |
| 822 | for( i = 0; i < 0x20000; i++ ) | |
| 823 | { | |
| 824 | ROM[i] = buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,13,14,15,12,11,10,9,8,7,6,5,4,3,2,1,0)]; | |
| 825 | } | |
| 826 | ||
| 827 | free(buffer); | |
| 828 | } | |
| 803 | 829 | } |
| 804 | 830 | |
| 805 | 831 |
| r1591 | r1592 | |
|---|---|---|
| 545 | 545 | if(cpu_getiloops() < NUM_LINES) |
| 546 | 546 | { |
| 547 | 547 | cpunum_set_info_fct(0, CPUINFO_PTR_I8085_SOD_CALLBACK, (void*)dwarfd_sod_callback); |
| 548 | cpunum_set_input_line(0,I8085_RST65_LINE,HOLD_LINE); // 34 - every 8th line | |
| 548 | cpunum_set_input_line(machine, 0,I8085_RST65_LINE,HOLD_LINE); // 34 - every 8th line | |
| 549 | 549 | line=cpu_getiloops(); |
| 550 | 550 | idx=0; |
| 551 | 551 | } |
| r1591 | r1592 | |
| 553 | 553 | { |
| 554 | 554 | if(cpu_getiloops() == NUM_LINES) |
| 555 | 555 | { |
| 556 | cpunum_set_input_line(0,I8085_RST55_LINE,HOLD_LINE);//2c - generated by crt - end of frame | |
| 556 | cpunum_set_input_line(machine, 0,I8085_RST55_LINE,HOLD_LINE);//2c - generated by crt - end of frame | |
| 557 | 557 | } |
| 558 | 558 | } |
| 559 | 559 | } |
| r1591 | r1592 | |
| 683 | 683 | |
| 684 | 684 | static MACHINE_DRIVER_START( dwarfd ) |
| 685 | 685 | /* basic machine hardware */ |
| 686 | MDRV_CPU_ADD(8085A, 10595000/3) /* ? MHz */ | |
| 686 | /* FIXME: The 8085A had a max clock of 6MHz, internally divided by 2! */ | |
| 687 | MDRV_CPU_ADD(8085A, 10595000/3*2) /* ? MHz */ | |
| 687 | 688 | |
| 688 | 689 | MDRV_CPU_PROGRAM_MAP(mem_map, 0) |
| 689 | 690 | MDRV_CPU_IO_MAP(io_map, 0) |
| r1591 | r1592 | |
|---|---|---|
| 260 | 260 | |
| 261 | 261 | static TIMER_CALLBACK( nmi_callback ) |
| 262 | 262 | { |
| 263 | if (sound_nmi_enable) cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 263 | if (sound_nmi_enable) cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 264 | 264 | else pending_nmi = 1; |
| 265 | 265 | } |
| 266 | 266 | |
| r1591 | r1592 | |
| 280 | 280 | sound_nmi_enable = 1; |
| 281 | 281 | if (pending_nmi) |
| 282 | 282 | { |
| 283 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 283 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 284 | 284 | pending_nmi = 0; |
| 285 | 285 | } |
| 286 | 286 | } |
| r1591 | r1592 | |
|---|---|---|
| 153 | 153 | if (last == 0 && data == 1) |
| 154 | 154 | { |
| 155 | 155 | /* setting bit 0 low then high triggers IRQ on the sound CPU */ |
| 156 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 156 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | last = data; |
| r1591 | r1592 | |
| 162 | 162 | |
| 163 | 163 | static WRITE8_HANDLER( junofrst_i8039_irq_w ) |
| 164 | 164 | { |
| 165 | cpunum_set_input_line(2, 0, ASSERT_LINE); | |
| 165 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | static WRITE8_HANDLER( i8039_irqen_and_status_w ) |
| 170 | 170 | { |
| 171 | 171 | if ((data & 0x80) == 0) |
| 172 | cpunum_set_input_line(2, 0, CLEAR_LINE); | |
| 172 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); | |
| 173 | 173 | i8039_status = (data & 0x70) >> 4; |
| 174 | 174 | } |
| 175 | 175 |
| r1591 | r1592 | |
|---|---|---|
| 200 | 200 | static WRITE8_HANDLER( sound_w ) |
| 201 | 201 | { |
| 202 | 202 | soundlatch_w(offset, data); |
| 203 | cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE); | |
| 203 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /********************************************************************************************/ |
| r1591 | r1592 | |
| 503 | 503 | static int count; |
| 504 | 504 | count = !count; |
| 505 | 505 | if (count) |
| 506 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 506 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 507 | 507 | else |
| 508 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 508 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | static WRITE8_HANDLER( renegade_coin_counter_w ) |
| r1591 | r1592 | |
| 761 | 761 | /* handler called by the 3526 emulator when the internal timers cause an IRQ */ |
| 762 | 762 | static void irqhandler(int linestate) |
| 763 | 763 | { |
| 764 | cpunum_set_input_line(1, M6809_FIRQ_LINE, linestate); | |
| 764 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, linestate); | |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
|---|---|---|
| 248 | 248 | |
| 249 | 249 | static void vdp_interrupt (int state) |
| 250 | 250 | { |
| 251 | cpunum_set_input_line(0,0, HOLD_LINE); | |
| 251 | cpunum_set_input_line(Machine, 0,0, HOLD_LINE); | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | static const TMS9928a_interface tms9928a_interface = |
| r1591 | r1592 | |
| 323 | 323 | |
| 324 | 324 | static DRIVER_INIT(chwrestl) |
| 325 | 325 | { |
| 326 | | |
| 326 | DRIVER_INIT_CALL(sg1000a | |
| 327 | 327 | regulus_decode(); |
| 328 | 328 | } |
| 329 | 329 |
| r1591 | r1592 | |
|---|---|---|
| 746 | 746 | case 0x00: /* IRQ1 */ |
| 747 | 747 | cpu_interrupt_enable(0,bit); |
| 748 | 748 | if (!bit) |
| 749 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 749 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 750 | 750 | break; |
| 751 | 751 | |
| 752 | 752 | case 0x01: /* IRQ2 */ |
| 753 | 753 | cpu_interrupt_enable(1,bit); |
| 754 | 754 | if (!bit) |
| 755 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 755 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 756 | 756 | break; |
| 757 | 757 | |
| 758 | 758 | case 0x02: /* NMION */ |
| r1591 | r1592 | |
| 760 | 760 | break; |
| 761 | 761 | |
| 762 | 762 | case 0x03: /* RESET */ |
| 763 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 764 | cpunum_set_input_line(2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 763 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 764 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 765 | 765 | break; |
| 766 | 766 | |
| 767 | 767 | case 0x04: /* n.c. */ |
| r1591 | r1592 | |
| 3033 | 3033 | |
| 3034 | 3034 | static DRIVER_INIT (gatsbee) |
| 3035 | 3035 | { |
| 3036 | | |
| 3036 | DRIVER_INIT_CALL(galaga | |
| 3037 | 3037 | |
| 3038 | 3038 | /* Gatsbee has a larger character ROM, we need a handler for banking */ |
| 3039 | 3039 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, gatsbee_bank_w); |
| r1591 | r1592 | |
| 3071 | 3071 | rom[A] = BITSWAP8(rom[A],3,7,5,1,2,6,4,0); |
| 3072 | 3072 | } |
| 3073 | 3073 | |
| 3074 | | |
| 3074 | DRIVER_INIT_CALL(xevious | |
| 3075 | 3075 | } |
| 3076 | 3076 | |
| 3077 | 3077 | |
| r1591 | r1592 | |
| 3083 | 3083 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_w ); |
| 3084 | 3084 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_w ); |
| 3085 | 3085 | |
| 3086 | | |
| 3086 | DRIVER_INIT_CALL(xevious | |
| 3087 | 3087 | } |
| 3088 | 3088 | |
| 3089 | 3089 |
| r1591 | r1592 | |
|---|---|---|
| 71 | 71 | int i; |
| 72 | 72 | |
| 73 | 73 | |
| 74 | | |
| 74 | PALETTE_INIT_CALL(RRRR_GGGG_BBBB | |
| 75 | 75 | color_prom += 256*3; |
| 76 | 76 | |
| 77 | 77 | // txt lookup table |
| r1591 | r1592 | |
| 209 | 209 | static INTERRUPT_GEN( panicr_interrupt ) |
| 210 | 210 | { |
| 211 | 211 | if (cpu_getiloops()) |
| 212 | cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc8/4); | |
| 212 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc8/4); | |
| 213 | 213 | else |
| 214 | cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc4/4); | |
| 214 | cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc4/4); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | static INPUT_PORTS_START( panicr ) |
| r1591 | r1592 | |
|---|---|---|
| 101 | 101 | if (z80_2_nmi_enable) |
| 102 | 102 | { |
| 103 | 103 | logerror("Executing an NMI on CPU2\n"); |
| 104 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */ | |
| 104 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */ | |
| 105 | 105 | z80_2_nmi_enable = 0; |
| 106 | 106 | } |
| 107 | 107 | } |
| r1591 | r1592 | |
| 315 | 315 | static INTERRUPT_GEN( vblank_callback_istellar ) |
| 316 | 316 | { |
| 317 | 317 | /* Interrupt presumably comes from VBlank */ |
| 318 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 318 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 319 | 319 | |
| 320 | 320 | /* Interrupt presumably comes from the LDP's status strobe */ |
| 321 | cpunum_set_input_line(2, 0, ASSERT_LINE); | |
| 321 | cpunum_set_input_line(machine, 2, 0, ASSERT_LINE); | |
| 322 | 322 | |
| 323 | 323 | /* Only do the LDP's sync once */ |
| 324 | 324 | if (cpunum == 0) |
| r1591 | r1592 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | // VBlank |
| 40 | 40 | if (cpu_getiloops() == 0) |
| 41 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 41 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 42 | 42 | else |
| 43 | 43 | { |
| 44 | 44 | UINT8 coins_new; |
| r1591 | r1592 | |
| 48 | 48 | |
| 49 | 49 | if ( ((coins_new & 0x10) && !(coins_old & 0x10)) || |
| 50 | 50 | ((coins_new & 0x20) && !(coins_old & 0x20)) ) |
| 51 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 51 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 52 | 52 | |
| 53 | 53 | coins_old = coins_new; |
| 54 | 54 | } |
| r1591 | r1592 | |
| 64 | 64 | static WRITE8_HANDLER( sound_command_w ) |
| 65 | 65 | { |
| 66 | 66 | soundlatch_w(offset,data); |
| 67 | cpunum_set_input_line(1, 0, PULSE_LINE); | |
| 67 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static WRITE8_HANDLER( pinbo_sound_command_w ) |
| 71 | 71 | { |
| 72 | 72 | soundlatch_w(offset,data); |
| 73 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 73 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static READ8_HANDLER( sound_status_r ) |
| r1591 | r1592 | |
|---|---|---|
| 134 | 134 | { |
| 135 | 135 | int vector = video_screen_get_vblank(0) ? 0xcf : 0xd7; /* RST 08h/10h */ |
| 136 | 136 | |
| 137 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, vector); | |
| 137 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, vector); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | static WRITE8_HANDLER (system_w) |
| r1591 | r1592 | |
|---|---|---|
| 361 | 361 | static INTERRUPT_GEN( psychic5_interrupt ) |
| 362 | 362 | { |
| 363 | 363 | if (cpu_getiloops() == 0) |
| 364 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 364 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 365 | 365 | else |
| 366 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 366 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | |
| r1591 | r1592 | |
| 536 | 536 | |
| 537 | 537 | static void irqhandler(int irq) |
| 538 | 538 | { |
| 539 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 539 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 160 | 160 | /* Handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 161 | 161 | static void irqhandler(int irq) |
| 162 | 162 | { |
| 163 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 163 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | static const struct YM2610interface syvalion_ym2610_interface = |
| r1591 | r1592 | |
| 274 | 274 | AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP) |
| 275 | 275 | AM_RANGE(0x300002, 0x300003) AM_READ(taitosound_comm16_lsb_r) |
| 276 | 276 | AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r) |
| 277 | AM_RANGE(0x500800, 0x500fff) AM_READ( | |
| 277 | AM_RANGE(0x500800, 0x500fff) AM_READ(MRA | |
| 278 | 278 | ADDRESS_MAP_END |
| 279 | 279 | |
| 280 | 280 | static ADDRESS_MAP_START( syvalion_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 297 | 297 | AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP) |
| 298 | 298 | AM_RANGE(0x300002, 0x300003) AM_READ(taitosound_comm16_lsb_r) |
| 299 | 299 | AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r) |
| 300 | AM_RANGE(0x500800, 0x500fff) AM_READ( | |
| 300 | AM_RANGE(0x500800, 0x500fff) AM_READ(MRA | |
| 301 | 301 | ADDRESS_MAP_END |
| 302 | 302 | |
| 303 | 303 | static ADDRESS_MAP_START( recordbr_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 319 | 319 | AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP) |
| 320 | 320 | AM_RANGE(0x300002, 0x300003) AM_READ(taitosound_comm16_lsb_r) |
| 321 | 321 | AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r) |
| 322 | AM_RANGE(0x500800, 0x500fff) AM_READ( | |
| 322 | AM_RANGE(0x500800, 0x500fff) AM_READ(MRA | |
| 323 | 323 | ADDRESS_MAP_END |
| 324 | 324 | |
| 325 | 325 | static ADDRESS_MAP_START( dleague_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
|---|---|---|
| 269 | 269 | |
| 270 | 270 | if (curr_level != last_irq_level) |
| 271 | 271 | { |
| 272 | cpunum_set_input_line(0,curr_level,curr_level ? ASSERT_LINE : CLEAR_LINE); | |
| 272 | cpunum_set_input_line(Machine, 0,curr_level,curr_level ? ASSERT_LINE : CLEAR_LINE); | |
| 273 | 273 | last_irq_level = curr_level; |
| 274 | 274 | } |
| 275 | 275 | } |
| r1591 | r1592 | |
| 681 | 681 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 682 | 682 | static void irqhandler(int irq) |
| 683 | 683 | { |
| 684 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 684 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 327 | 327 | if (MC6809_CTR > S_TEMPO) |
| 328 | 328 | { |
| 329 | 329 | MC6809_CTR = 0; |
| 330 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 330 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 331 | 331 | } |
| 332 | 332 | else |
| 333 | 333 | { |
| r1591 | r1592 | |
|---|---|---|
| 41 | 41 | if (ACCESSING_LSB) |
| 42 | 42 | { |
| 43 | 43 | soundlatch_w(offset,data & 0xff); |
| 44 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 44 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| r1591 | r1592 | |
| 246 | 246 | |
| 247 | 247 | static void irqhandler(int irq) |
| 248 | 248 | { |
| 249 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 249 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | static const struct YM2608interface ym2608_interface = |
| r1591 | r1592 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | static INTERRUPT_GEN( M79_interrupt ) |
| 146 | 146 | { |
| 147 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 147 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | static DRIVER_INIT( m79amb ) |
| r1591 | r1592 | |
|---|---|---|
| 372 | 372 | |
| 373 | 373 | static INTERRUPT_GEN( quasar_interrupt ) |
| 374 | 374 | { |
| 375 | cpunum_set_input_line_and_vector(0,0,PULSE_LINE,0x03); | |
| 375 | cpunum_set_input_line_and_vector(machine, 0,0,PULSE_LINE,0x03); | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | // ************************(*************** |
| r1591 | r1592 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | static TIMER_CALLBACK( slapshot_interrupt6 ) |
| 183 | 183 | { |
| 184 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 184 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
| 188 | 188 | static INTERRUPT_GEN( slapshot_interrupt ) |
| 189 | 189 | { |
| 190 | 190 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, slapshot_interrupt6); |
| 191 | cpunum_set_input_line(0,5,HOLD_LINE); | |
| 191 | cpunum_set_input_line(machine, 0,5,HOLD_LINE); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| r1591 | r1592 | |
| 217 | 217 | static WRITE16_HANDLER( opwolf3_adc_req_w ) |
| 218 | 218 | { |
| 219 | 219 | /* 4 writes a frame - one for each analogue port */ |
| 220 | cpunum_set_input_line(0,3,HOLD_LINE); | |
| 220 | cpunum_set_input_line(Machine, 0,3,HOLD_LINE); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /***************************************************** |
| r1591 | r1592 | |
| 529 | 529 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 530 | 530 | static void irqhandler(int irq) |
| 531 | 531 | { |
| 532 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 532 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 154 | 154 | IRQSTA|=0x40; |
| 155 | 155 | if(IRQMSKA&0x40) |
| 156 | 156 | { |
| 157 | cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE); | |
| 157 | cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE); | |
| 158 | 158 | } |
| 159 | 159 | startTimer(); |
| 160 | 160 | } |
| r1591 | r1592 | |
| 355 | 355 | IRQSTA|=0x08; |
| 356 | 356 | if(IRQMSKA&0x08) |
| 357 | 357 | { |
| 358 | cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE); | |
| 358 | cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE); | |
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 |
| r1591 | r1592 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | static WRITE8_HANDLER( xyonix_irqack_w ) |
| 36 | 36 | { |
| 37 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 37 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 |
| r1591 | r1592 | |
|---|---|---|
| 59 | 59 | static WRITE16_HANDLER( cninja_sound_w ) |
| 60 | 60 | { |
| 61 | 61 | soundlatch_w(0,data&0xff); |
| 62 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 62 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static WRITE16_HANDLER( stoneage_sound_w ) |
| 66 | 66 | { |
| 67 | 67 | soundlatch_w(0,data&0xff); |
| 68 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 68 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static TIMER_CALLBACK( interrupt_gen ) |
| r1591 | r1592 | |
| 83 | 83 | deco16_raster_display_list[deco16_raster_display_position++]=deco16_pf34_control[3]&0xffff; |
| 84 | 84 | deco16_raster_display_list[deco16_raster_display_position++]=deco16_pf34_control[4]&0xffff; |
| 85 | 85 | |
| 86 | cpunum_set_input_line(0, (cninja_irq_mask&0x10) ? 3 : 4, ASSERT_LINE); | |
| 86 | cpunum_set_input_line(machine, 0, (cninja_irq_mask&0x10) ? 3 : 4, ASSERT_LINE); | |
| 87 | 87 | timer_adjust(raster_irq_timer,attotime_never,0,attotime_zero); |
| 88 | 88 | } |
| 89 | 89 | |
| r1591 | r1592 | |
| 95 | 95 | return cninja_scanline; |
| 96 | 96 | |
| 97 | 97 | case 2: /* Raster IRQ ACK - value read is not used */ |
| 98 | cpunum_set_input_line(0, 3, CLEAR_LINE); | |
| 99 | cpunum_set_input_line(0, 4, CLEAR_LINE); | |
| 98 | cpunum_set_input_line(Machine, 0, 3, CLEAR_LINE); | |
| 99 | cpunum_set_input_line(Machine, 0, 4, CLEAR_LINE); | |
| 100 | 100 | return 0; |
| 101 | 101 | } |
| 102 | 102 | |
| r1591 | r1592 | |
| 752 | 752 | |
| 753 | 753 | static void sound_irq(int state) |
| 754 | 754 | { |
| 755 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 755 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | static void sound_irq2(int state) |
| 759 | 759 | { |
| 760 | cpunum_set_input_line(1,0,state); | |
| 760 | cpunum_set_input_line(Machine, 1,0,state); | |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 193 | 193 | static WRITE8_HANDLER( pacland_subreset_w ) |
| 194 | 194 | { |
| 195 | 195 | int bit = !BIT(offset,11); |
| 196 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 196 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | static WRITE8_HANDLER( pacland_flipscreen_w ) |
| r1591 | r1592 | |
| 232 | 232 | int bit = !BIT(offset,11); |
| 233 | 233 | cpu_interrupt_enable(0,bit); |
| 234 | 234 | if (!bit) |
| 235 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 235 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | static WRITE8_HANDLER( pacland_irq_2_ctrl_w ) |
| r1591 | r1592 | |
| 240 | 240 | int bit = !BIT(offset,13); |
| 241 | 241 | cpu_interrupt_enable(1,bit); |
| 242 | 242 | if (!bit) |
| 243 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 243 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
| r1591 | r1592 | |
| 416 | 416 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 417 | 417 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| 418 | 418 | |
| 419 | MDRV_CPU_ADD(HD63701, 49152000/ | |
| 419 | MDRV_CPU_ADD(HD63701, 49152000/8 | |
| 420 | 420 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 421 | 421 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 422 | 422 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| r1591 | r1592 | |
|---|---|---|
| 225 | 225 | |
| 226 | 226 | static INTERRUPT_GEN(psikyosh_interrupt) |
| 227 | 227 | { |
| 228 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 228 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | static READ32_HANDLER(hotgmck_io32_r) /* used by hotgmck/hgkairak */ |
| r1591 | r1592 | |
| 476 | 476 | static void irqhandler(int linestate) |
| 477 | 477 | { |
| 478 | 478 | if (linestate) |
| 479 | cpunum_set_input_line(0, 12, ASSERT_LINE); | |
| 479 | cpunum_set_input_line(Machine, 0, 12, ASSERT_LINE); | |
| 480 | 480 | else |
| 481 | cpunum_set_input_line(0, 12, CLEAR_LINE); | |
| 481 | cpunum_set_input_line(Machine, 0, 12, CLEAR_LINE); | |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | static const struct YMF278B_interface ymf278b_interface = |
| r1591 | r1592 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | wardner_membank = data; |
| 144 | 144 | |
| 145 | if (data) { | |
| 145 | if (data) | |
| 146 | { | |
| 146 | 147 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, MRA8_BANK1); |
| 147 | switch (data) { | |
| 148 | switch (data) | |
| 149 | { | |
| 148 | 150 | case 2: bankaddress = 0x10000; break; |
| 149 | 151 | case 3: bankaddress = 0x18000; break; |
| 150 | 152 | case 4: bankaddress = 0x20000; break; |
| r1591 | r1592 | |
| 156 | 158 | } |
| 157 | 159 | memory_set_bankptr(1,&RAM[bankaddress]); |
| 158 | 160 | } |
| 159 | else { | |
| 160 | memory_set_bankptr(1,&RAM[0x0000]); | |
| 161 | else | |
| 162 | { | |
| 161 | 163 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wardner_sprite_r); |
| 162 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, | |
| 164 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, MRA8 | |
| 163 | 165 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xae00, 0xafff, 0, 0, MRA8_BANK2); |
| 164 | 166 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0, MRA8_BANK3); |
| 167 | memory_set_bankptr(1, &RAM[0x0000]); | |
| 165 | 168 | memory_set_bankptr(2, rambase_ae00); |
| 166 | 169 | memory_set_bankptr(3, rambase_c000); |
| 170 | memory_set_bankptr(4, paletteram); | |
| 167 | 171 | } |
| 168 | 172 | } |
| 169 | 173 | } |
| r1591 | r1592 | |
| 441 | 445 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 442 | 446 | static void irqhandler(int linestate) |
| 443 | 447 | { |
| 444 | cpunum_set_input_line(1,0,linestate); | |
| 448 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 445 | 449 | } |
| 446 | 450 | |
| 447 | 451 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | { |
| 56 | 56 | sound_cpu_busy = 0x20; |
| 57 | 57 | soundlatch_w(0, data); |
| 58 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static READ8_HANDLER( sound_command_r ) |
| r1591 | r1592 | |
| 66 | 66 | |
| 67 | 67 | static READ8_HANDLER( sound_nmi_ack_r ) |
| 68 | 68 | { |
| 69 | cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 69 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 70 | 70 | return 0; |
| 71 | 71 | } |
| 72 | 72 |
| r1591 | r1592 | |
|---|---|---|
| 477 | 477 | MDRV_MACHINE_RESET( snes ) |
| 478 | 478 | |
| 479 | 479 | /* video hardware */ |
| 480 | MDRV_VIDEO_START( generic_bitmapped ) | |
| 481 | 480 | MDRV_VIDEO_UPDATE( snes ) |
| 482 | 481 | |
| 483 | 482 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| r1591 | r1592 | |
|---|---|---|
| 256 | 256 | MDRV_PALETTE_LENGTH(256) |
| 257 | 257 | |
| 258 | 258 | MDRV_PALETTE_INIT(wiz) |
| 259 | MDRV_VIDEO_START(generic) | |
| 260 | 259 | MDRV_VIDEO_UPDATE(rollrace) |
| 261 | 260 | |
| 262 | 261 | /* sound hardware */ |
| r1591 | r1592 | |
|---|---|---|
| 315 | 315 | |
| 316 | 316 | /* assert the IRQ if not already asserted */ |
| 317 | 317 | irq_state = (~curv >> 5) & 1; |
| 318 | cpunum_set_input_line(0, 0, irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 318 | cpunum_set_input_line(machine, 0, 0, irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 319 | 319 | |
| 320 | 320 | /* force an update while we're here */ |
| 321 | 321 | video_screen_update_partial(0, v_to_scanline(curv)); |
| r1591 | r1592 | |
| 345 | 345 | |
| 346 | 346 | /* starting at scanline 224, the CPU runs at half speed */ |
| 347 | 347 | if (curv == 224) |
| 348 | cpunum_set_clock(0, MASTER_CLOCK/16); | |
| 348 | cpunum_set_clock(machine, 0, MASTER_CLOCK/16); | |
| 349 | 349 | else |
| 350 | cpunum_set_clock(0, MASTER_CLOCK/8); | |
| 350 | cpunum_set_clock(machine, 0, MASTER_CLOCK/8); | |
| 351 | 351 | |
| 352 | 352 | /* scanline for the next run */ |
| 353 | 353 | curv ^= 224; |
| r1591 | r1592 | |
| 410 | 410 | |
| 411 | 411 | static MACHINE_RESET( missile ) |
| 412 | 412 | { |
| 413 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 413 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 414 | 414 | irq_state = 0; |
| 415 | 415 | } |
| 416 | 416 | |
| r1591 | r1592 | |
| 610 | 610 | |
| 611 | 611 | /* watchdog */ |
| 612 | 612 | else if (offset >= 0x4c00 && offset < 0x4d00) |
| 613 | watchdog_reset(); | |
| 613 | watchdog_reset(Machine); | |
| 614 | 614 | |
| 615 | 615 | /* interrupt ack */ |
| 616 | 616 | else if (offset >= 0x4d00 && offset < 0x4e00) |
| 617 | 617 | { |
| 618 | 618 | if (irq_state) |
| 619 | 619 | { |
| 620 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 620 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 621 | 621 | irq_state = 0; |
| 622 | 622 | } |
| 623 | 623 | } |
| r1591 | r1592 | |
|---|---|---|
| 38 | 38 | static INTERRUPT_GEN( ddrible_interrupt_0 ) |
| 39 | 39 | { |
| 40 | 40 | if (ddrible_int_enable_0) |
| 41 | cpunum_set_input_line(0, M6809_FIRQ_LINE, HOLD_LINE); | |
| 41 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, HOLD_LINE); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | static INTERRUPT_GEN( ddrible_interrupt_1 ) |
| 45 | 45 | { |
| 46 | 46 | if (ddrible_int_enable_1) |
| 47 | cpunum_set_input_line(1, M6809_FIRQ_LINE, HOLD_LINE); | |
| 47 | cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, HOLD_LINE); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 |
| r1591 | r1592 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | static READ8_HANDLER( popper_soundcpu_nmi_r ) |
| 151 | 151 | { |
| 152 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 152 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 153 | 153 | return 0; |
| 154 | 154 | } |
| 155 | 155 |
| r1591 | r1592 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | static WRITE8_HANDLER( sound_cpu_reset_w ) |
| 87 | 87 | { |
| 88 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE); | |
| 88 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static TIMER_CALLBACK( nmi_callback ) |
| 92 | 92 | { |
| 93 | if (sound_nmi_enable) cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 93 | if (sound_nmi_enable) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 94 | 94 | else pending_nmi = 1; |
| 95 | 95 | } |
| 96 | 96 | |
| r1591 | r1592 | |
| 110 | 110 | sound_nmi_enable = 1; |
| 111 | 111 | if (pending_nmi) |
| 112 | 112 | { |
| 113 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 113 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 114 | 114 | pending_nmi = 0; |
| 115 | 115 | } |
| 116 | 116 | } |
| r1591 | r1592 | |
|---|---|---|
| 656 | 656 | |
| 657 | 657 | static WRITE8_HANDLER( trigger_nmi_on_cpu0 ) |
| 658 | 658 | { |
| 659 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 659 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | static WRITE8_HANDLER( cpu0_bankswitch_w ) |
| r1591 | r1592 | |
| 715 | 715 | static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 ) |
| 716 | 716 | { |
| 717 | 717 | soundlatch_w(0,data); |
| 718 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 718 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 719 | 719 | } /* trigger_nmi_on_sound_cpu2 */ |
| 720 | 720 | |
| 721 | 721 | static WRITE8_HANDLER( cpu2_bankswitch_w ) |
| r1591 | r1592 | |
| 821 | 821 | { /* CPU1 uses interrupt mode 2. For now, just alternate the two interrupts. */ |
| 822 | 822 | static int addr = 0xff; |
| 823 | 823 | addr ^= 0x02; |
| 824 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, addr); | |
| 824 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, addr); | |
| 825 | 825 | } |
| 826 | 826 | |
| 827 | 827 | static MACHINE_DRIVER_START( djboy ) |
| r1591 | r1592 | |
|---|---|---|
| 699 | 699 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 700 | 700 | static void irqhandler(int irq) |
| 701 | 701 | { |
| 702 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 702 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 422 | 422 | AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r) |
| 423 | 423 | AM_RANGE(0x900000, 0x9007ff) AM_READ(cchip1_ram_r) |
| 424 | 424 | AM_RANGE(0x900802, 0x900803) AM_READ(cchip1_ctrl_r) |
| 425 | AM_RANGE(0xb00000, 0xb00fff) AM_READ( | |
| 425 | AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA | |
| 426 | 426 | AM_RANGE(0xd00000, 0xd007ff) AM_READ(MRA16_RAM) /* video attribute ram */ |
| 427 | 427 | AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM) /* object ram */ |
| 428 | 428 | AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM) /* Main RAM */ |
| r1591 | r1592 | |
| 450 | 450 | AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP) |
| 451 | 451 | AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r) |
| 452 | 452 | AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r) |
| 453 | AM_RANGE(0xb00000, 0xb00fff) AM_READ( | |
| 453 | AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA | |
| 454 | 454 | AM_RANGE(0xd00000, 0xd00fff) AM_READ(MRA16_RAM) /* video attribute ram */ |
| 455 | 455 | AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM) /* object ram */ |
| 456 | 456 | AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM) /* Main RAM */ |
| r1591 | r1592 | |
| 475 | 475 | AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP) |
| 476 | 476 | AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r) |
| 477 | 477 | AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r) |
| 478 | AM_RANGE(0xb00000, 0xb00fff) AM_READ( | |
| 478 | AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA | |
| 479 | 479 | AM_RANGE(0xd00000, 0xd007ff) AM_READ(MRA16_RAM) /* video attribute ram */ |
| 480 | 480 | AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM) /* object ram */ |
| 481 | 481 | AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM) /* Main RAM */ |
| r1591 | r1592 | |
| 500 | 500 | AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP) |
| 501 | 501 | AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r) |
| 502 | 502 | AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r) |
| 503 | AM_RANGE(0xb00000, 0xb00fff) AM_READ( | |
| 503 | AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA | |
| 504 | 504 | AM_RANGE(0xd00000, 0xd007ff) AM_READ(MRA16_RAM) /* video attribute ram */ |
| 505 | 505 | AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM) /* object ram */ |
| 506 | 506 | AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM) /* Main RAM */ |
| r1591 | r1592 | |
| 972 | 972 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 973 | 973 | static void irqhandler(int irq) |
| 974 | 974 | { |
| 975 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 975 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | static WRITE8_HANDLER( jack_sh_command_w ) |
| 73 | 73 | { |
| 74 | 74 | soundlatch_w(0,data); |
| 75 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 75 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r1591 | r1592 | |
| 914 | 914 | static INTERRUPT_GEN( joinem_interrupts ) |
| 915 | 915 | { |
| 916 | 916 | if(cpu_getiloops() > 0) |
| 917 | { | |
| 918 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 919 | } | |
| 917 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 920 | 918 | else |
| 921 | 919 | { |
| 922 | 920 | if(!(readinputport(4) & 0x80)) |
| 923 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 921 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 924 | 922 | } |
| 925 | 923 | } |
| 926 | 924 |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | static WRITE16_HANDLER( tumblep_sound_w ) |
| 73 | 73 | { |
| 74 | 74 | soundlatch_w(0,data & 0xff); |
| 75 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 75 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | #ifdef UNUSED_FUNCTION |
| 79 | 79 | static WRITE16_HANDLER( jumppop_sound_w ) |
| 80 | 80 | { |
| 81 | 81 | soundlatch_w(0,data & 0xff); |
| 82 | cpunum_set_input_line( 1, 0, ASSERT_LINE ); | |
| 82 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE ); | |
| 83 | 83 | } |
| 84 | 84 | #endif |
| 85 | 85 | |
| r1591 | r1592 | |
| 307 | 307 | |
| 308 | 308 | static void sound_irq(int state) |
| 309 | 309 | { |
| 310 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 310 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | /* bit 0 used but unknown */ |
| 31 | 31 | |
| 32 | 32 | if (data & 0x04) |
| 33 | cpunum_set_input_line(1,0,ASSERT_LINE); | |
| 33 | cpunum_set_input_line(Machine, 1,0,ASSERT_LINE); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static WRITE8_HANDLER( sub_irqack_w ) |
| 37 | 37 | { |
| 38 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 38 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r1591 | r1592 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | static void sound_irq(int state) |
| 194 | 194 | { |
| 195 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 195 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 206 | 206 | MDRV_CPU_PROGRAM_MAP(dietgo_map,0) |
| 207 | 207 | MDRV_CPU_VBLANK_INT(irq6_line_hold,1) |
| 208 | 208 | |
| 209 | MDRV_CPU_ADD(H6280, XTAL_32_22MHz/4/ | |
| 209 | MDRV_CPU_ADD(H6280, XTAL_32_22MHz/4/3 | |
| 210 | 210 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 211 | 211 | |
| 212 | 212 | MDRV_SCREEN_REFRESH_RATE(58) |
| r1591 | r1592 | |
|---|---|---|
| 226 | 226 | static WRITE8_HANDLER( taitosj_soundcommand_w ) |
| 227 | 227 | { |
| 228 | 228 | soundlatch_w(offset,data); |
| 229 | if (!sndnmi_disable) cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 229 | if (!sndnmi_disable) cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | static UINT8 input_port_4_f0; |
| r1591 | r1592 | |
|---|---|---|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static WRITE8_HANDLER( video_interrupt_w ) { |
| 63 | cpunum_set_input_line_and_vector( 1, 0, HOLD_LINE, 0xff ); | |
| 63 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff ); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static WRITE8_HANDLER( sprite_interrupt_w ) { |
| 67 | cpunum_set_input_line_and_vector( 2, 0, HOLD_LINE, 0xff ); | |
| 67 | cpunum_set_input_line_and_vector(Machine, 2, 0, HOLD_LINE, 0xff ); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static WRITE8_HANDLER( scroll_interrupt_w ) { |
| r1591 | r1592 | |
| 74 | 74 | |
| 75 | 75 | static WRITE8_HANDLER( sound_command_w ) { |
| 76 | 76 | soundlatch_w( 0, data ); |
| 77 | cpunum_set_input_line_and_vector( 3, 0, HOLD_LINE, 0xff ); | |
| 77 | cpunum_set_input_line_and_vector(Machine, 3, 0, HOLD_LINE, 0xff ); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| r1591 | r1592 | |
| 544 | 544 | static INTERRUPT_GEN( kingofb_interrupt ) { |
| 545 | 545 | |
| 546 | 546 | if ( kingofb_nmi_enable ) |
| 547 | cpunum_set_input_line(cpu_getactivecpu(), INPUT_LINE_NMI, PULSE_LINE); | |
| 547 | cpunum_set_input_line(machine, cpu_getactivecpu(), INPUT_LINE_NMI, PULSE_LINE); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | static MACHINE_DRIVER_START( kingofb ) |
| r1591 | r1592 | |
|---|---|---|
| 83 | 83 | memory_configure_bank(1, 0, 4, memory_region(REGION_CPU2) + 0x8000, 0x8000); |
| 84 | 84 | memory_set_bank(1, 0); |
| 85 | 85 | } |
| 86 | | |
| 86 | MACHINE_RESET_CALL(nb1413m3 | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static DRIVER_INIT( pstadium ) |
| r1591 | r1592 | |
|---|---|---|
| 28 | 28 | /* interrupt 6 is vblank */ |
| 29 | 29 | /* interrupt 5 reads coin inputs - might have to be triggered only */ |
| 30 | 30 | /* when a coin is inserted */ |
| 31 | cpunum_set_input_line(0, 6 - cpu_getiloops(), HOLD_LINE); | |
| 31 | cpunum_set_input_line(machine, 0, 6 - cpu_getiloops(), HOLD_LINE); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | static WRITE16_HANDLER( blockout_sound_command_w ) |
| r1591 | r1592 | |
| 36 | 36 | if (ACCESSING_LSB) |
| 37 | 37 | { |
| 38 | 38 | soundlatch_w(offset,data & 0xff); |
| 39 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 39 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| r1591 | r1592 | |
| 303 | 303 | /* handler called by the 2151 emulator when the internal timers cause an IRQ */ |
| 304 | 304 | static void blockout_irq_handler(int irq) |
| 305 | 305 | { |
| 306 | cpunum_set_input_line_and_vector(1,0,irq ? ASSERT_LINE : CLEAR_LINE,0xff); | |
| 306 | cpunum_set_input_line_and_vector(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE,0xff); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static INTERRUPT_GEN( samurai_interrupt ){ |
| 75 | if (nmi_enabled) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 75 | if (nmi_enabled) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static READ8_HANDLER( unknown_d803_r ) |
| r1591 | r1592 | |
| 103 | 103 | static WRITE8_HANDLER( sound_command1_w ) |
| 104 | 104 | { |
| 105 | 105 | sound_command1 = data; |
| 106 | cpunum_set_input_line( 1, 0, HOLD_LINE ); | |
| 106 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static WRITE8_HANDLER( sound_command2_w ) |
| 110 | 110 | { |
| 111 | 111 | sound_command2 = data; |
| 112 | cpunum_set_input_line( 2, 0, HOLD_LINE ); | |
| 112 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE ); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | static WRITE8_HANDLER( sound_command3_w ) |
| 116 | 116 | { |
| 117 | 117 | sound_command3 = data; |
| 118 | cpunum_set_input_line( 3, 0, HOLD_LINE ); | |
| 118 | cpunum_set_input_line(Machine, 3, 0, HOLD_LINE ); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static WRITE8_HANDLER( flip_screen_w ) |
| r1591 | r1592 | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | static INTERRUPT_GEN( vsgongf_sound_interrupt ){ |
| 360 | if (vsgongf_sound_nmi_enabled) cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 360 | if (vsgongf_sound_nmi_enabled) cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /* what are these, protection of some kind? */ |
| r1591 | r1592 | |
| 384 | 384 | |
| 385 | 385 | static WRITE8_HANDLER( vsgongf_sound_command_w ){ |
| 386 | 386 | soundlatch_w( offset, data ); |
| 387 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 387 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | static ADDRESS_MAP_START( readmem_vsgongf, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 359 | 359 | |
| 360 | 360 | static INTERRUPT_GEN( igs_majhong_interrupt ) |
| 361 | 361 | { |
| 362 | cpunum_set_input_line(0, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 362 | cpunum_set_input_line(machine, 0, ARM7_FIRQ_LINE, PULSE_LINE); | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 |
| r1591 | r1592 | |
|---|---|---|
| 214 | 214 | static INTERRUPT_GEN( ettrivia_interrupt ) |
| 215 | 215 | { |
| 216 | 216 | if( readinputport(2) & 0x01 ) |
| 217 | { | |
| 218 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 219 | } | |
| 217 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 220 | 218 | else |
| 221 | { | |
| 222 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 223 | } | |
| 219 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 224 | 220 | } |
| 225 | 221 | |
| 226 | 222 | static MACHINE_DRIVER_START( ettrivia ) |
| r1591 | r1592 | |
|---|---|---|
| 69 | 69 | { |
| 70 | 70 | if (ACCESSING_LSB){ |
| 71 | 71 | soundlatch_w(0,data & 0xff); |
| 72 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 72 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| r1591 | r1592 | |
| 77 | 77 | { |
| 78 | 78 | if (ACCESSING_LSB){ |
| 79 | 79 | soundlatch_w(0,data & 0xff); |
| 80 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 80 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // give the z80 time to see it |
| r1591 | r1592 | |
|---|---|---|
| 1886 | 1886 | { |
| 1887 | 1887 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, urashima_mcu_r ); |
| 1888 | 1888 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, urashima_mcu_w ); |
| 1889 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0320, 0xf0321, 0, 0, MRA16_RAM ); | |
| 1890 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0320, 0xf0321, 0, 0, MWA16_RAM ); | |
| 1891 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c0, 0xf03c5, 0, 0, MRA16_RAM ); | |
| 1892 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c0, 0xf03c5, 0, 0, MWA16_RAM ); | |
| 1893 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c6, 0xf03e5, 0, 0, MRA16_RAM ); | |
| 1894 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c6, 0xf03e5, 0, 0, MWA16_RAM ); | |
| 1889 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0320, 0xf0321, 0, 0, MRA16_BANK1, MWA16_BANK1 ); | |
| 1890 | memory_set_bankptr(1, auto_malloc(0xf0322 - 0xf0320)); | |
| 1891 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c0, 0xf03c5, 0, 0, MRA16_BANK2, MWA16_BANK2 ); | |
| 1892 | memory_set_bankptr(2, auto_malloc(0xf03c6 - 0xf03c0)); | |
| 1893 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c6, 0xf03e5, 0, 0, MRA16_BANK3, MWA16_BANK3 ); | |
| 1894 | memory_set_bankptr(3, auto_malloc(0xf03e6 - 0xf03c6)); | |
| 1895 | 1895 | mcu_prg = 0x12; |
| 1896 | 1896 | } |
| 1897 | 1897 | |
| r1591 | r1592 | |
| 1899 | 1899 | { |
| 1900 | 1900 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, daireika_mcu_r ); |
| 1901 | 1901 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, daireika_mcu_w ); |
| 1902 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0140, 0xf0141, 0, 0, MRA16_RAM ); | |
| 1903 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0140, 0xf0141, 0, 0, MWA16_RAM ); | |
| 1904 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf0025, 0, 0, MRA16_RAM ); | |
| 1905 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf0025, 0, 0, MWA16_RAM ); | |
| 1906 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00d5, 0, 0, MRA16_RAM ); | |
| 1907 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00d5, 0, 0, MWA16_RAM ); | |
| 1908 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0100, 0xf012f, 0, 0, MRA16_RAM ); | |
| 1909 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0100, 0xf012f, 0, 0, MWA16_RAM ); | |
| 1902 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0140, 0xf0141, 0, 0, MRA16_BANK1, MWA16_BANK1 ); | |
| 1903 | memory_set_bankptr(1, auto_malloc(0xf0142 - 0xf0140)); | |
| 1904 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf0025, 0, 0, MRA16_BANK2, MWA16_BANK2 ); | |
| 1905 | memory_set_bankptr(2, auto_malloc(0xf0026 - 0xf0020)); | |
| 1906 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00d5, 0, 0, MRA16_BANK3, MWA16_BANK3 ); | |
| 1907 | memory_set_bankptr(3, auto_malloc(0xf00d6 - 0xf00c0)); | |
| 1908 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0100, 0xf0130, 0, 0, MRA16_BANK4, MWA16_BANK4 ); | |
| 1909 | memory_set_bankptr(4, auto_malloc(0xf0130 - 0xf0100)); | |
| 1910 | 1910 | mcu_prg = 0x11; |
| 1911 | 1911 | } |
| 1912 | 1912 | |
| r1591 | r1592 | |
| 1914 | 1914 | { |
| 1915 | 1915 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, mjzoomin_mcu_r ); |
| 1916 | 1916 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, mjzoomin_mcu_w ); |
| 1917 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00c5, 0, 0, MRA16_RAM ); | |
| 1918 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00c5, 0, 0, MWA16_RAM ); | |
| 1919 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c6, 0xf00d1, 0, 0, MRA16_RAM ); | |
| 1920 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c6, 0xf00d1, 0, 0, MWA16_RAM ); | |
| 1921 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf002f, 0, 0, MRA16_RAM ); | |
| 1922 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf002f, 0, 0, MWA16_RAM ); | |
| 1917 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00c5, 0, 0, MRA16_BANK1, MWA16_BANK1 ); | |
| 1918 | memory_set_bankptr(1, auto_malloc(0xf00c6 - 0xf00c0)); | |
| 1919 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c6, 0xf00d1, 0, 0, MRA16_BANK2, MWA16_BANK2 ); | |
| 1920 | memory_set_bankptr(2, auto_malloc(0xf00d2 - 0xf00c6)); | |
| 1921 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf002f, 0, 0, MRA16_BANK3, MWA16_BANK3 ); | |
| 1922 | memory_set_bankptr(3, auto_malloc(0xf0030 - 0xf0020)); | |
| 1923 | 1923 | mcu_prg = 0x13; |
| 1924 | 1924 | } |
| 1925 | 1925 |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | { |
| 73 | 73 | pending_command = 1; |
| 74 | 74 | soundlatch_w(offset,data & 0xff); |
| 75 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 75 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| r1591 | r1592 | |
| 550 | 550 | |
| 551 | 551 | static void irqhandler(int irq) |
| 552 | 552 | { |
| 553 | cpunum_set_input_line(2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 553 | cpunum_set_input_line(Machine, 2,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 434 | 434 | if (input_code_pressed_once(KEYCODE_C)) |
| 435 | 435 | { |
| 436 | 436 | soundlatch_w(0,command_data); |
| 437 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 437 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 438 | 438 | popmessage("command write=%2x",command_data); |
| 439 | 439 | } |
| 440 | 440 | #endif |
| r1591 | r1592 | |
| 518 | 518 | static void sound_irq(int irq) |
| 519 | 519 | { |
| 520 | 520 | /* IRQ */ |
| 521 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 521 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | static const struct YMF262interface ymf262_interface = |
| r1591 | r1592 | |
| 648 | 648 | |
| 649 | 649 | static TIMER_CALLBACK( reset_callback ) |
| 650 | 650 | { |
| 651 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 651 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 |
| r1591 | r1592 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | static INTERRUPT_GEN( periodic_interrupt ) |
| 141 | 141 | { |
| 142 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x4e); | |
| 142 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x4e); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| r1591 | r1592 | |
| 148 | 148 | static int last = 0; |
| 149 | 149 | |
| 150 | 150 | if (readinputport(0) & 0x80) |
| 151 | { | |
| 152 | 151 | last = 0; |
| 153 | } | |
| 154 | 152 | else |
| 155 | 153 | { |
| 156 | 154 | if (last == 0) /* coin inserted */ |
| 157 | { | |
| 158 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x50); | |
| 159 | } | |
| 155 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x50); | |
| 160 | 156 | |
| 161 | 157 | last = 1; |
| 162 | 158 | } |
| r1591 | r1592 | |
| 367 | 363 | |
| 368 | 364 | static TIMER_CALLBACK( polyplay_timer_callback ) |
| 369 | 365 | { |
| 370 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x4c); | |
| 366 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x4c); | |
| 371 | 367 | } |
| 372 | 368 | |
| 373 | 369 | /* game driver */ |
| r1591 | r1592 | |
|---|---|---|
| 267 | 267 | * |
| 268 | 268 | *************************************/ |
| 269 | 269 | |
| 270 | static void handle_coins( | |
| 270 | static void handle_coins(running_machine *machine) | |
| 271 | 271 | { |
| 272 | 272 | int coins; |
| 273 | 273 | |
| 274 | 274 | /* if we got a coin, set the IRQ on the main CPU */ |
| 275 | 275 | coins = readinputport(3) & 3; |
| 276 | 276 | if (((coins ^ last_coins) & 0x01) && (coins & 0x01) == 0) |
| 277 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 277 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 278 | 278 | if (((coins ^ last_coins) & 0x02) && (coins & 0x02) == 0) |
| 279 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 279 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 280 | 280 | last_coins = coins; |
| 281 | 281 | } |
| 282 | 282 | |
| r1591 | r1592 | |
| 284 | 284 | static INTERRUPT_GEN( main_interrupt ) |
| 285 | 285 | { |
| 286 | 286 | /* generate coin interrupts */ |
| 287 | handle_coins(); | |
| 287 | handle_coins(machine); | |
| 288 | 288 | exidy440_vblank_interrupt(machine, cpunum); |
| 289 | 289 | } |
| 290 | 290 | |
| r1591 | r1592 | |
| 381 | 381 | result = readinputport(3) ^ port_3_xor; |
| 382 | 382 | |
| 383 | 383 | /* I/O1 accesses clear the CIRQ flip/flop */ |
| 384 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 384 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 385 | 385 | break; |
| 386 | 386 | |
| 387 | 387 | case 0x40: /* clear coin counters I/O2 */ |
| r1591 | r1592 | |
| 434 | 434 | exidy440_sound_command_ack = 0; |
| 435 | 435 | |
| 436 | 436 | /* cause an FIRQ on the sound CPU */ |
| 437 | cpunum_set_input_line(1, 1, ASSERT_LINE); | |
| 437 | cpunum_set_input_line(machine, 1, 1, ASSERT_LINE); | |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | |
| r1591 | r1592 | |
| 452 | 452 | case 0x20: /* coin bits I/O1 */ |
| 453 | 453 | |
| 454 | 454 | /* accesses here clear the CIRQ flip/flop */ |
| 455 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 455 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 456 | 456 | break; |
| 457 | 457 | |
| 458 | 458 | case 0x40: /* coin counter I/O2 */ |
| r1591 | r1592 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | static WRITE8_HANDLER( exzisus_cpub_reset_w ) |
| 133 | 133 | { |
| 134 | cpunum_set_input_line(3, INPUT_LINE_RESET, PULSE_LINE); | |
| 134 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, PULSE_LINE); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | #if 0 |
| r1591 | r1592 | |
| 312 | 312 | |
| 313 | 313 | static void irqhandler(int irq) |
| 314 | 314 | { |
| 315 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 315 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 62 | 62 | /* Main CPU and Z80 synchronisation */ |
| 63 | 63 | static WRITE16_HANDLER( z80_busreq_w ) |
| 64 | 64 | { |
| 65 | cpunum_set_input_line(2, INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 65 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static WRITE16_HANDLER( resume_math_w ) |
| 69 | 69 | { |
| 70 | cpunum_set_input_line(1, INPUT_LINE_TEST, ASSERT_LINE); | |
| 70 | cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, ASSERT_LINE); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | static WRITE16_HANDLER( halt_math_w ) |
| 74 | 74 | { |
| 75 | cpunum_set_input_line(1, INPUT_LINE_TEST, CLEAR_LINE); | |
| 75 | cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, CLEAR_LINE); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /* Z80 can trigger an interrupt itself */ |
| 79 | 79 | static WRITE8_HANDLER( z80_intreq_w ) |
| 80 | 80 | { |
| 81 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 81 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /* Periodic Z80 interrupt */ |
| 85 | 85 | static INTERRUPT_GEN( z80_irq ) |
| 86 | 86 | { |
| 87 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 87 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static READ16_HANDLER( z80_shared_r ) |
| r1591 | r1592 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | static WRITE8_HANDLER(intrq_w) |
| 157 | 157 | { |
| 158 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 158 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static WRITE8_HANDLER(sc01_register_w) |
| r1591 | r1592 | |
| 180 | 180 | SET_Z80_SSI_REQUEST(); |
| 181 | 181 | if (!(Z80_SSI_REQUEST())) |
| 182 | 182 | logerror("SETTING IRQ LINE sc01\n"); |
| 183 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 183 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 184 | 184 | break; |
| 185 | 185 | |
| 186 | 186 | default: |
| r1591 | r1592 | |
| 289 | 289 | /* Assert the Z80's interrupt line if necessary */ |
| 290 | 290 | if (irq_flag) |
| 291 | 291 | { |
| 292 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 292 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE); | |
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 |
| r1591 | r1592 | |
|---|---|---|
| 170 | 170 | static WRITE16_HANDLER( dassault_sound_w ) |
| 171 | 171 | { |
| 172 | 172 | soundlatch_w(0,data&0xff); |
| 173 | cpunum_set_input_line(2,0,HOLD_LINE); /* IRQ1 */ | |
| 173 | cpunum_set_input_line(Machine, 2,0,HOLD_LINE); /* IRQ1 */ | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /* The CPU-CPU irq controller is overlaid onto the end of the shared memory */ |
| 177 | 177 | static READ16_HANDLER( dassault_irq_r ) |
| 178 | 178 | { |
| 179 | 179 | switch (offset) { |
| 180 | case 0: cpunum_set_input_line(0, 5, CLEAR_LINE); break; | |
| 181 | case 1: cpunum_set_input_line(1, 6, CLEAR_LINE); break; | |
| 180 | case 0: cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE); break; | |
| 181 | case 1: cpunum_set_input_line(Machine, 1, 6, CLEAR_LINE); break; | |
| 182 | 182 | } |
| 183 | 183 | return shared_ram[(0xffc/2)+offset]; /* The values probably don't matter */ |
| 184 | 184 | } |
| r1591 | r1592 | |
| 186 | 186 | static WRITE16_HANDLER( dassault_irq_w ) |
| 187 | 187 | { |
| 188 | 188 | switch (offset) { |
| 189 | case 0: cpunum_set_input_line(0, 5, ASSERT_LINE); break; | |
| 190 | case 1: cpunum_set_input_line(1, 6, ASSERT_LINE); break; | |
| 189 | case 0: cpunum_set_input_line(Machine, 0, 5, ASSERT_LINE); break; | |
| 190 | case 1: cpunum_set_input_line(Machine, 1, 6, ASSERT_LINE); break; | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | COMBINE_DATA(&shared_ram[(0xffc/2)+offset]); /* The values probably don't matter */ |
| r1591 | r1592 | |
| 533 | 533 | |
| 534 | 534 | static void sound_irq(int state) |
| 535 | 535 | { |
| 536 | cpunum_set_input_line(2,1,state); | |
| 536 | cpunum_set_input_line(Machine, 2,1,state); | |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | if (cpu_getiloops() == 0) |
| 77 | 77 | { |
| 78 | if (intenable & 0x04) cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 78 | if (intenable & 0x04) cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 79 | 79 | } |
| 80 | 80 | else if (cpu_getiloops() % 2) |
| 81 | 81 | { |
| 82 | if (intenable & 0x08) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 82 | if (intenable & 0x08) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | * |
| 31 | 31 | *************************************/ |
| 32 | 32 | |
| 33 | static void update_interrupts( | |
| 33 | static void update_interrupts(running_machine *machine) | |
| 34 | 34 | { |
| 35 | 35 | int newstate = 0; |
| 36 | 36 | |
| r1591 | r1592 | |
| 42 | 42 | newstate = 4; |
| 43 | 43 | |
| 44 | 44 | if (newstate) |
| 45 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 46 | 46 | else |
| 47 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 47 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 |
| r1591 | r1592 | |
|---|---|---|
| 170 | 170 | static WRITE16_HANDLER(cyclwarr_sound_w) |
| 171 | 171 | { |
| 172 | 172 | soundlatch_w(0, data >> 8); |
| 173 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 173 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /***************************************************************************/ |
| r1591 | r1592 | |
| 807 | 807 | |
| 808 | 808 | static void sound_irq(int state) |
| 809 | 809 | { |
| 810 | cpunum_set_input_line(2, INPUT_LINE_IRQ0, state); | |
| 810 | cpunum_set_input_line(Machine, 2, INPUT_LINE_IRQ0, state); | |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 817 | 817 | |
| 818 | 818 | static INTERRUPT_GEN( roundup5_interrupt ) |
| 819 | 819 | { |
| 820 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xc8/4); /* VBL */ | |
| 820 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xc8/4); /* VBL */ | |
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 | static MACHINE_DRIVER_START( apache3 ) |
| r1591 | r1592 | |
| 1188 | 1188 | UINT8 *src2 = memory_region(REGION_GFX3); |
| 1189 | 1189 | int i; |
| 1190 | 1190 | |
| 1191 | cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE); // ? | |
| 1191 | cpunum_set_input_line(machine, 3, INPUT_LINE_HALT, ASSERT_LINE); // ? | |
| 1192 | 1192 | |
| 1193 | 1193 | for (i=0; i<0x100000; i+=32) { |
| 1194 | 1194 | memcpy(dst,src1,32); |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | static WRITE16_HANDLER( sound_w ) |
| 54 | 54 | { |
| 55 | 55 | soundlatch_w(0,data & 0xff); |
| 56 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 56 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /******************************************************************************/ |
| r1591 | r1592 | |
| 362 | 362 | |
| 363 | 363 | static void sound_irq(int state) |
| 364 | 364 | { |
| 365 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 365 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | static void main_cpu_irq(int state) |
| 120 | 120 | { |
| 121 | logerror("GEN IRQ: %x\n", state); | |
| 122 | cpunum_set_input_line(0, 0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 121 | int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0); | |
| 122 | ||
| 123 | logerror("GEN IRQ: %x\n", combined_state); | |
| 124 | cpunum_set_input_line(Machine, 0, 0, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 123 | 125 | } |
| 124 | 126 | |
| 125 | 127 | |
| r1591 | r1592 | |
| 140 | 142 | if (last != (input_port_0_r(0) & 0x0f)) |
| 141 | 143 | { |
| 142 | 144 | last = input_port_0_r(0) & 0x0f; |
| 143 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 145 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 144 | 146 | } |
| 145 | 147 | pia_set_input_a(0, input_port_0_r(0) & 0x0f, 0); |
| 146 | 148 |
| r1591 | r1592 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | static WRITE8_HANDLER( cpu1_reset_w ) |
| 67 | 67 | { |
| 68 | cpunum_set_input_line(1, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 68 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static WRITE8_HANDLER( cpu2_reset_w ) |
| 72 | 72 | { |
| 73 | cpunum_set_input_line(2, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 73 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static WRITE8_HANDLER( mcu_reset_w ) |
| 77 | 77 | { |
| 78 | 78 | /* the bootlegs don't have a MCU, so make sure it's there before trying to reset it */ |
| 79 | 79 | if (cpu_gettotalcpu() >= 4) |
| 80 | cpunum_set_input_line(3, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 80 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | static WRITE8_HANDLER( cpu2_m6000_w ) |
| r1591 | r1592 | |
| 93 | 93 | static WRITE8_HANDLER( soundcommand_w ) |
| 94 | 94 | { |
| 95 | 95 | soundlatch_w(0, data); |
| 96 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 96 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | static WRITE8_HANDLER( irq0_ack_w ) |
| r1591 | r1592 | |
| 102 | 102 | |
| 103 | 103 | cpu_interrupt_enable(0,bit); |
| 104 | 104 | if (!bit) |
| 105 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 105 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | static WRITE8_HANDLER( irq1_ack_w ) |
| r1591 | r1592 | |
| 111 | 111 | |
| 112 | 112 | cpu_interrupt_enable(1,bit); |
| 113 | 113 | if (!bit) |
| 114 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 114 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | static WRITE8_HANDLER( coincounter_w ) |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | static INTERRUPT_GEN( gbusters_interrupt ) |
| 30 | 30 | { |
| 31 | 31 | if (K052109_is_IRQ_enabled()) |
| 32 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 32 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static READ8_HANDLER( bankedram_r ) |
| 36 | 36 | { |
| 37 | 37 | if (palette_selected) |
| 38 | return paletteram | |
| 38 | return paletteram[ | |
| 39 | 39 | else |
| 40 | 40 | return ram[offset]; |
| 41 | 41 | } |
| r1591 | r1592 | |
| 100 | 100 | |
| 101 | 101 | static WRITE8_HANDLER( gbusters_sh_irqtrigger_w ) |
| 102 | 102 | { |
| 103 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 103 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | static WRITE8_HANDLER( gbusters_snd_bankswitch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 94 | 94 | segae_hintpending = 1; |
| 95 | 95 | |
| 96 | 96 | if ((segae_vdp_regs[0][0] & 0x10)) { |
| 97 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 97 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE); | |
| 98 | 98 | return; |
| 99 | 99 | } |
| 100 | 100 | |
| r1591 | r1592 | |
| 107 | 107 | hintcount = segae_vdp_regs[0][10]; |
| 108 | 108 | |
| 109 | 109 | if ( (sline<0xe0) && (segae_vintpending) ) { |
| 110 | cpunum_set_input_line(2, 0, HOLD_LINE); | |
| 110 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE); | |
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| r1591 | r1592 | |
| 531 | 531 | static WRITE8_HANDLER( megaplay_bios_6404_w ) |
| 532 | 532 | { |
| 533 | 533 | if(((bios_6404 & 0x0c) == 0x00) && ((data & 0x0c) == 0x0c)) |
| 534 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 534 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 535 | 535 | bios_6404 = data; |
| 536 | 536 | |
| 537 | 537 | // logerror("BIOS: 0x6404 write: 0x%02x\n",data); |
| r1591 | r1592 | |
| 665 | 665 | |
| 666 | 666 | |
| 667 | 667 | /* in video/segasyse.c */ |
| 668 | void megaplay_start_video_normal(running_machine *machine); | |
| 669 | void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ); | |
| 668 | VIDEO_START( megaplay_normal ); | |
| 669 | VIDEO_UPDATE( megaplay_normal ); | |
| 670 | 670 | |
| 671 | 671 | /* give us access to the megadriv start and update functions so that we can call them */ |
| 672 | extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 673 | extern void video_start_megadriv(running_machine *machine); | |
| 672 | VIDEO_START( megadriv ); | |
| 673 | VIDEO_UPDATE( megadriv ); | |
| 674 | 674 | |
| 675 | 675 | static VIDEO_START(megplay) |
| 676 | 676 | { |
| 677 | 677 | //printf("megplay vs\n"); |
| 678 | video_start_megadriv(Machine); | |
| 679 | megaplay_start_video_normal(Machine); | |
| 678 | VIDEO_START_CALL(megadriv); | |
| 679 | VIDEO_START_CALL(megaplay_normal); | |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | static VIDEO_UPDATE(megplay) |
| 683 | 683 | { |
| 684 | 684 | //printf("megplay vu\n"); |
| 685 | video_update_megadriv(machine,0,bitmap,cliprect); | |
| 686 | megaplay_update_video_normal(machine, bitmap,cliprect); | |
| 685 | VIDEO_UPDATE_CALL(megadriv); | |
| 686 | VIDEO_UPDATE_CALL(megaplay_normal); | |
| 687 | 687 | return 0; |
| 688 | 688 | } |
| 689 | 689 | |
| r1591 | r1592 | |
| 1010 | 1010 | ic37_ram = auto_malloc(0x10000); |
| 1011 | 1011 | genesis_io_ram = auto_malloc(0x20); |
| 1012 | 1012 | |
| 1013 | | |
| 1013 | DRIVER_INIT_CALL(megadrij | |
| 1014 | 1014 | megplay_stat(); |
| 1015 | 1015 | |
| 1016 | 1016 | /* for now ... */ |
| r1591 | r1592 | |
|---|---|---|
| 217 | 217 | |
| 218 | 218 | /* fake something toggling the sense input line of the S2650 */ |
| 219 | 219 | main_sense_state ^= 1; |
| 220 | cpunum_set_input_line(0, 1, main_sense_state ? ASSERT_LINE : CLEAR_LINE); | |
| 220 | cpunum_set_input_line(machine, 0, 1, main_sense_state ? ASSERT_LINE : CLEAR_LINE); | |
| 221 | 221 | |
| 222 | 222 | /* check the fake coin input */ |
| 223 | 223 | if (readinputport(3) & 0x01) |
| r1591 | r1592 | |
| 225 | 225 | if (!coin1_state) |
| 226 | 226 | { |
| 227 | 227 | coin1_state = 1; |
| 228 | cpunum_set_input_line_and_vector(0, 0, PULSE_LINE, 0x82); | |
| 228 | cpunum_set_input_line_and_vector(machine, 0, 0, PULSE_LINE, 0x82); | |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | else |
| r1591 | r1592 | |
| 245 | 245 | /* preserve the actual cycle count */ |
| 246 | 246 | cycles_at_vsync = cpunum_gettotalcycles(0); |
| 247 | 247 | minferno_sense++; |
| 248 | cpunum_set_input_line(0, 1, (minferno_sense & 0x40) ? ASSERT_LINE : CLEAR_LINE ); | |
| 248 | cpunum_set_input_line(machine, 0, 1, (minferno_sense & 0x40) ? ASSERT_LINE : CLEAR_LINE ); | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | |
| r1591 | r1592 | |
| 327 | 327 | { |
| 328 | 328 | /* fake something toggling the sense input line of the S2650 */ |
| 329 | 329 | sound_sense_state ^= 1; |
| 330 | cpunum_set_input_line(1, 1, sound_sense_state ? ASSERT_LINE : CLEAR_LINE); | |
| 330 | cpunum_set_input_line(machine, 1, 1, sound_sense_state ? ASSERT_LINE : CLEAR_LINE); | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 |
| r1591 | r1592 | |
|---|---|---|
| 95 | 95 | { |
| 96 | 96 | switch (cpu_getiloops()) |
| 97 | 97 | { |
| 98 | case 0: cpunum_set_input_line(0, 4, HOLD_LINE); break; /* vblank */ | |
| 99 | default: cpunum_set_input_line(0, 2, HOLD_LINE); break; /* sound */ | |
| 98 | case 0: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; /* vblank */ | |
| 99 | default: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; /* sound */ | |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| r1591 | r1592 | |
| 422 | 422 | AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP) /* ??? */ |
| 423 | 423 | AM_RANGE(0x500000, 0x500001) AM_READ(input_port_8_word_r) /* DSW 3-1 */ |
| 424 | 424 | AM_RANGE(0x500010, 0x500011) AM_READ(input_port_9_word_r) /* DSW 3-2 */ |
| 425 | AM_RANGE(0x700000, 0x7003ff) AM_READ( | |
| 425 | AM_RANGE(0x700000, 0x7003ff) AM_READ(MRA | |
| 426 | 426 | AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP) /* ??? */ |
| 427 | 427 | AM_RANGE(0x900000, 0x900001) AM_READ(srmp2_input_1_r) /* I/O port 1 */ |
| 428 | 428 | AM_RANGE(0x900002, 0x900003) AM_READ(srmp2_input_2_r) /* I/O port 2 */ |
| r1591 | r1592 | |
|---|---|---|
| 98 | 98 | static MACHINE_RESET( m72 ) |
| 99 | 99 | { |
| 100 | 100 | m72_irq_base = 0x20; |
| 101 | | |
| 101 | MACHINE_RESET_CALL(m72_sound | |
| 102 | 102 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static MACHINE_RESET( xmultipl ) |
| 106 | 106 | { |
| 107 | 107 | m72_irq_base = 0x08; |
| 108 | | |
| 108 | MACHINE_RESET_CALL(m72_sound | |
| 109 | 109 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static MACHINE_RESET( kengo ) |
| 113 | 113 | { |
| 114 | 114 | m72_irq_base = 0x18; |
| 115 | | |
| 115 | MACHINE_RESET_CALL(m72_sound | |
| 116 | 116 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never); |
| 117 | 117 | } |
| 118 | 118 | |
| r1591 | r1592 | |
| 124 | 124 | if (scanline < 256 && scanline == m72_raster_irq_position - 128) |
| 125 | 125 | { |
| 126 | 126 | video_screen_update_partial(0, scanline); |
| 127 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m72_irq_base + 2); | |
| 127 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, m72_irq_base + 2); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /* VBLANK interrupt */ |
| 131 | 131 | else if (scanline == 256) |
| 132 | 132 | { |
| 133 | 133 | video_screen_update_partial(0, scanline); |
| 134 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m72_irq_base + 0); | |
| 134 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, m72_irq_base + 0); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /* adjust for next scanline */ |
| r1591 | r1592 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | static void main_cpu_irq(int state) |
| 75 | 75 | { |
| 76 | cpunum_set_input_line(0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 76 | int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0) | | |
| 77 | pia_get_irq_a(1) | pia_get_irq_b(1); | |
| 78 | ||
| 79 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); | |
| 77 | 80 | } |
| 78 | 81 | |
| 79 | 82 | |
| r1591 | r1592 | |
| 97 | 100 | static WRITE8_HANDLER( audio_command_w ) |
| 98 | 101 | { |
| 99 | 102 | soundlatch_w(0, ~data); |
| 100 | cpunum_set_input_line(1, M6802_IRQ_LINE, HOLD_LINE); | |
| 103 | cpunum_set_input_line(Machine, 1, M6802_IRQ_LINE, HOLD_LINE); | |
| 101 | 104 | |
| 102 | 105 | if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", safe_activecpu_get_pc(), data^0xff); |
| 103 | 106 | } |
| r1591 | r1592 | |
| 119 | 122 | data = 0x00; |
| 120 | 123 | |
| 121 | 124 | soundlatch2_w(0, data); |
| 122 | cpunum_set_input_line(0, M6809_IRQ_LINE, HOLD_LINE); | |
| 125 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 123 | 126 | |
| 124 | 127 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", safe_activecpu_get_pc(), data); |
| 125 | 128 | } |
| r1591 | r1592 | |
| 526 | 529 | MDRV_CPU_PROGRAM_MAP(r2dtank_main_map,0) |
| 527 | 530 | |
| 528 | 531 | /* audio CPU */ |
| 529 | MDRV_CPU_ADD(M6802,3000000 | |
| 532 | MDRV_CPU_ADD(M6802,3000000 | |
| 530 | 533 | MDRV_CPU_PROGRAM_MAP(r2dtank_audio_map,0) |
| 531 | 534 | |
| 532 | 535 | MDRV_MACHINE_START(r2dtank) |
| r1591 | r1592 | |
|---|---|---|
| 95 | 95 | static WRITE8_HANDLER( pokechmp_sound_w ) |
| 96 | 96 | { |
| 97 | 97 | soundlatch_w(0,data); |
| 98 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 98 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 |
| r1591 | r1592 | |
|---|---|---|
| 127 | 127 | static WRITE16_HANDLER( sound_w ) |
| 128 | 128 | { |
| 129 | 129 | soundlatch_w(0,(data>>8)&0xff); |
| 130 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 130 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /*******************************************************************************/ |
| r1591 | r1592 | |
| 679 | 679 | |
| 680 | 680 | static void irqhandler(int irq) |
| 681 | 681 | { |
| 682 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 682 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 329 | 329 | |
| 330 | 330 | static INTERRUPT_GEN( madalien_interrupt ) |
| 331 | 331 | { |
| 332 | cpunum_set_input_line(0, INPUT_LINE_NMI, | |
| 332 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, | |
| 333 | 333 | (readinputportbytag("PLAYER2") & 0x80) ? CLEAR_LINE : ASSERT_LINE); |
| 334 | 334 | } |
| 335 | 335 | |
| r1591 | r1592 | |
| 466 | 466 | |
| 467 | 467 | static WRITE8_HANDLER( madalien_sound_command_w ) |
| 468 | 468 | { |
| 469 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 469 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 470 | 470 | |
| 471 | 471 | soundlatch_w(offset, data); |
| 472 | 472 | } |
| r1591 | r1592 | |
| 474 | 474 | |
| 475 | 475 | static READ8_HANDLER(madalien_sound_command_r ) |
| 476 | 476 | { |
| 477 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 477 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 478 | 478 | |
| 479 | 479 | return soundlatch_r(offset); |
| 480 | 480 | } |
| r1591 | r1592 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | static WRITE8_HANDLER( nmi_ack_w ) |
| 61 | 61 | { |
| 62 | // cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 62 | // cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static WRITE8_HANDLER( irq0_ack_w ) |
| 66 | 66 | { |
| 67 | // cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 67 | // cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static READ8_HANDLER( ff_r ) |
| r1591 | r1592 | |
| 117 | 117 | static INTERRUPT_GEN( igs_180_interrupt ) |
| 118 | 118 | { |
| 119 | 119 | if (cpu_getiloops() & 1) |
| 120 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);//ASSERT_LINE); /* ???? */ | |
| 120 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);//ASSERT_LINE); /* ???? */ | |
| 121 | 121 | else |
| 122 | cpunum_set_input_line(0, 0, HOLD_LINE);//ASSERT_LINE); /* ???? */ | |
| 122 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE);//ASSERT_LINE); /* ???? */ | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static MACHINE_DRIVER_START( igs_180 ) |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | static INTERRUPT_GEN( aeroboto_interrupt ) |
| 56 | 56 | { |
| 57 | 57 | if (!disable_irq) |
| 58 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 58 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 59 | 59 | else |
| 60 | 60 | disable_irq--; |
| 61 | 61 | } |
| r1591 | r1592 | |
|---|---|---|
| 444 | 444 | |
| 445 | 445 | static NVRAM_HANDLER( simpbowl ) |
| 446 | 446 | { |
| 447 | | |
| 447 | NVRAM_HANDLER_CALL(konamigv_93C46 | |
| 448 | 448 | nvram_handler_intelflash( machine, 0, file, read_or_write ); |
| 449 | 449 | nvram_handler_intelflash( machine, 1, file, read_or_write ); |
| 450 | 450 | nvram_handler_intelflash( machine, 2, file, read_or_write ); |
| r1591 | r1592 | |
| 551 | 551 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c7, 0, 0, trackball_r ); |
| 552 | 552 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c8, 0x1f6800cb, 0, 0, unknown_r ); /* ?? */ |
| 553 | 553 | |
| 554 | | |
| 554 | DRIVER_INIT_CALL(konamigv | |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | static MACHINE_DRIVER_START( simpbowl ) |
| r1591 | r1592 | |
| 626 | 626 | |
| 627 | 627 | static NVRAM_HANDLER( btchamp ) |
| 628 | 628 | { |
| 629 | | |
| 629 | NVRAM_HANDLER_CALL(konamigv_93C46 | |
| 630 | 630 | nvram_handler_intelflash( machine, 0, file, read_or_write ); |
| 631 | 631 | } |
| 632 | 632 | |
| r1591 | r1592 | |
| 640 | 640 | memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r ); |
| 641 | 641 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w ); |
| 642 | 642 | |
| 643 | | |
| 643 | DRIVER_INIT_CALL(konamigv | |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | static MACHINE_DRIVER_START( btchamp ) |
| r1591 | r1592 | |
| 695 | 695 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, tokimeki_serial_r ); |
| 696 | 696 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, tokimeki_serial_w ); |
| 697 | 697 | |
| 698 | | |
| 698 | DRIVER_INIT_CALL(konamigv | |
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /* |
| r1591 | r1592 | |
| 732 | 732 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r ); |
| 733 | 733 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w ); |
| 734 | 734 | |
| 735 | | |
| 735 | DRIVER_INIT_CALL(konamigv | |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | static MACHINE_DRIVER_START( kdeadeye ) |
| r1591 | r1592 | |
|---|---|---|
| 145 | 145 | if (data==0x26) { |
| 146 | 146 | i8751_current_command=0; |
| 147 | 147 | i8751_return=0xff; /* This value is XOR'd and must equal 0 */ |
| 148 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xff); | |
| 148 | cpunum_set_input_line_and_vector(Machine, 0,0,HOLD_LINE,0xff); | |
| 149 | 149 | return; |
| 150 | 150 | } |
| 151 | 151 | |
| r1591 | r1592 | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /* Signal main cpu task is complete */ |
| 195 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xff); | |
| 195 | cpunum_set_input_line_and_vector(Machine, 0,0,HOLD_LINE,0xff); | |
| 196 | 196 | i8751_current_command=data; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | static WRITE8_HANDLER( firetrap_sound_command_w ) |
| 200 | 200 | { |
| 201 | 201 | soundlatch_w(offset,data); |
| 202 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 202 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | static WRITE8_HANDLER( firetrap_sound_2400_w ) |
| r1591 | r1592 | |
| 228 | 228 | |
| 229 | 229 | toggle ^= 1; |
| 230 | 230 | if (firetrap_irq_enable && toggle) |
| 231 | cpunum_set_input_line (1, M6502_IRQ_LINE, HOLD_LINE); | |
| 231 | cpunum_set_input_line (Machine, 1, M6502_IRQ_LINE, HOLD_LINE); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | static WRITE8_HANDLER( firetrap_adpcm_data_w ) |
| r1591 | r1592 | |
| 555 | 555 | definitely doesn't expect them as it locks out the coin routine */ |
| 556 | 556 | if (coin_command_pending && !i8751_current_command) { |
| 557 | 557 | i8751_return=coin_command_pending; |
| 558 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xff); | |
| 558 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xff); | |
| 559 | 559 | coin_command_pending=0; |
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | if (firetrap_nmi_enable && !cpu_getiloops()) |
| 564 | cpunum_set_input_line (0, INPUT_LINE_NMI, PULSE_LINE); | |
| 564 | cpunum_set_input_line (machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | static INTERRUPT_GEN( bootleg ) |
| 568 | 568 | { |
| 569 | 569 | if (firetrap_nmi_enable) |
| 570 | cpunum_set_input_line (0, INPUT_LINE_NMI, PULSE_LINE); | |
| 570 | cpunum_set_input_line (machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | static MACHINE_DRIVER_START( firetrap ) |
| r1591 | r1592 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | static TIMER_CALLBACK( main_to_sound_callback ) |
| 119 | 119 | { |
| 120 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 120 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 121 | 121 | main_to_sound_data = param; |
| 122 | 122 | } |
| 123 | 123 | |
| r1591 | r1592 | |
| 130 | 130 | |
| 131 | 131 | static READ8_HANDLER( main_to_sound_r ) |
| 132 | 132 | { |
| 133 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 133 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 134 | 134 | return main_to_sound_data; |
| 135 | 135 | } |
| 136 | 136 | |
| r1591 | r1592 | |
| 144 | 144 | |
| 145 | 145 | static TIMER_CALLBACK( sound_to_main_callback ) |
| 146 | 146 | { |
| 147 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 147 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 148 | 148 | sound_to_main_data = param; |
| 149 | 149 | } |
| 150 | 150 | |
| r1591 | r1592 | |
| 157 | 157 | |
| 158 | 158 | static READ8_HANDLER( sound_to_main_r ) |
| 159 | 159 | { |
| 160 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 160 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 161 | 161 | return sound_to_main_data; |
| 162 | 162 | } |
| 163 | 163 |
| r1591 | r1592 | |
|---|---|---|
| 640 | 640 | |
| 641 | 641 | mastboy_m5205_part ^= 1; |
| 642 | 642 | if(!mastboy_m5205_part) |
| 643 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 643 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | |
| r1591 | r1592 | |
| 655 | 655 | static WRITE8_HANDLER( mastboy_irq0_ack_w ) |
| 656 | 656 | { |
| 657 | 657 | mastboy_irq0_ack = data; |
| 658 | if ((data&1)==1) cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 658 | if ((data&1)==1) cpunum_set_input_line(Machine, 0,0, CLEAR_LINE); | |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | static INTERRUPT_GEN( mastboy_interrupt ) |
| 662 | 662 | { |
| 663 | 663 | if ((mastboy_irq0_ack&1)==1) |
| 664 | 664 | { |
| 665 | cpunum_set_input_line(0,0, ASSERT_LINE); | |
| 665 | cpunum_set_input_line(machine, 0,0, ASSERT_LINE); | |
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | static WRITE8_HANDLER( thedeep_sound_w ) |
| 45 | 45 | { |
| 46 | 46 | soundlatch_w(0,data); |
| 47 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 47 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static UINT8 protection_command, protection_data; |
| r1591 | r1592 | |
| 322 | 322 | |
| 323 | 323 | static void irqhandler(int irq) |
| 324 | 324 | { |
| 325 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 325 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | static const struct YM2203interface thedeep_ym2203_intf = |
| r1591 | r1592 | |
| 347 | 347 | protection_irq = 1; |
| 348 | 348 | } |
| 349 | 349 | if (protection_irq) |
| 350 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 350 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 351 | 351 | } |
| 352 | 352 | else |
| 353 | 353 | { |
| 354 | 354 | if (nmi_enable) |
| 355 | 355 | { |
| 356 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 357 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 356 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 357 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | } |
| r1591 | r1592 | |
|---|---|---|
| 358 | 358 | |
| 359 | 359 | static void irq_handler(int irq) |
| 360 | 360 | { |
| 361 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 361 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 269 | 269 | /* bit 0 enables cpu B */ |
| 270 | 270 | /* however this fails when recovering from a save state |
| 271 | 271 | if cpu B is disabled !! */ |
| 272 | cpunum_set_input_line(2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 272 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 273 | 273 | |
| 274 | 274 | } |
| 275 | 275 | |
| r1591 | r1592 | |
| 293 | 293 | |
| 294 | 294 | static TIMER_CALLBACK( topspeed_interrupt6 ) |
| 295 | 295 | { |
| 296 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 296 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /* 68000 B */ |
| 300 | 300 | |
| 301 | 301 | static TIMER_CALLBACK( topspeed_cpub_interrupt6 ) |
| 302 | 302 | { |
| 303 | cpunum_set_input_line(2,6,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 303 | cpunum_set_input_line(machine, 2,6,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | |
| r1591 | r1592 | |
| 308 | 308 | { |
| 309 | 309 | /* Unsure how many int6's per frame */ |
| 310 | 310 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, topspeed_interrupt6); |
| 311 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 311 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static INTERRUPT_GEN( topspeed_cpub_interrupt ) |
| 315 | 315 | { |
| 316 | 316 | /* Unsure how many int6's per frame */ |
| 317 | 317 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, topspeed_cpub_interrupt6); |
| 318 | cpunum_set_input_line(2, 5, HOLD_LINE); | |
| 318 | cpunum_set_input_line(machine, 2, 5, HOLD_LINE); | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| r1591 | r1592 | |
| 453 | 453 | static ADDRESS_MAP_START( topspeed_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 454 | 454 | AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM) |
| 455 | 455 | AM_RANGE(0x400000, 0x40ffff) AM_READ(sharedram_r) // all shared ?? |
| 456 | AM_RANGE(0x500000, 0x503fff) AM_READ( | |
| 456 | AM_RANGE(0x500000, 0x503fff) AM_READ(MRA | |
| 457 | 457 | AM_RANGE(0x7e0000, 0x7e0001) AM_READ(MRA16_NOP) |
| 458 | 458 | AM_RANGE(0x7e0002, 0x7e0003) AM_READ(taitosound_comm16_lsb_r) |
| 459 | 459 | AM_RANGE(0x800000, 0x8003ff) AM_READ(MRA16_RAM) /* raster line color control */ |
| r1591 | r1592 | |
| 658 | 658 | |
| 659 | 659 | static void irq_handler(int irq) /* assumes Z80 sandwiched between 68Ks */ |
| 660 | 660 | { |
| 661 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 661 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 216 | 216 | EEPROM_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE); |
| 217 | 217 | |
| 218 | 218 | if (data & 0x10) |
| 219 | { | |
| 220 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 221 | } | |
| 219 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 222 | 220 | else |
| 223 | { | |
| 224 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 225 | } | |
| 221 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 226 | 222 | } |
| 227 | 223 | return; |
| 228 | 224 | } |
| r1591 | r1592 | |
| 231 | 227 | if (!(mem_mask & 0xff000000)) |
| 232 | 228 | { |
| 233 | 229 | if (data & 0x80000000) /* CG Board 1 IRQ Ack */ |
| 234 | { | |
| 235 | cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 236 | } | |
| 230 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 231 | ||
| 237 | 232 | if (data & 0x40000000) /* CG Board 0 IRQ Ack */ |
| 238 | { | |
| 239 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 240 | } | |
| 233 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 241 | 234 | |
| 242 | 235 | set_cgboard_id((data >> 28) & 0x3); |
| 243 | 236 | |
| r1591 | r1592 | |
| 311 | 304 | AM_RANGE(0x74000000, 0x74003fff) AM_MIRROR(0x80000000) AM_READWRITE(K056832_ram_long_r, K056832_ram_long_w) |
| 312 | 305 | AM_RANGE(0x74020000, 0x7402003f) AM_MIRROR(0x80000000) AM_READWRITE(K056832_long_r, K056832_long_w) |
| 313 | 306 | AM_RANGE(0x74060000, 0x7406003f) AM_MIRROR(0x80000000) AM_READWRITE(ccu_r, ccu_w) |
| 314 | AM_RANGE(0x74080000, 0x74081fff) AM_MIRROR(0x80000000) AM_READWRITE( | |
| 307 | AM_RANGE(0x74080000, 0x74081fff) AM_MIRROR(0x80000000) AM_READWRITE(MRA | |
| 315 | 308 | AM_RANGE(0x740a0000, 0x740a3fff) AM_MIRROR(0x80000000) AM_READ(K056832_rom_long_r) |
| 316 | 309 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) /* 21N 21K 23N 23K */ |
| 317 | 310 | AM_RANGE(0x78010000, 0x7801ffff) AM_MIRROR(0x80000000) AM_WRITE(cgboard_dsp_shared_w_ppc) |
| r1591 | r1592 | |
| 337 | 330 | static ADDRESS_MAP_START( jetwave_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 338 | 331 | AM_RANGE(0x00000000, 0x000fffff) AM_MIRROR(0x80000000) AM_RAM /* Work RAM */ |
| 339 | 332 | AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_reg_r, K001604_reg_w) |
| 340 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_READWRITE( | |
| 333 | AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_READWRITE(MRA | |
| 341 | 334 | AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w) |
| 342 | 335 | AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w) |
| 343 | 336 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) /* 21N 21K 23N 23K */ |
| r1591 | r1592 | |
| 566 | 559 | */ |
| 567 | 560 | static INTERRUPT_GEN( zr107_vblank ) |
| 568 | 561 | { |
| 569 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 562 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 570 | 563 | } |
| 571 | 564 | static MACHINE_RESET( zr107 ) |
| 572 | 565 | { |
| 573 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 566 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 574 | 567 | } |
| 575 | 568 | |
| 576 | 569 | static MACHINE_DRIVER_START( zr107 ) |
| r1591 | r1592 | |
| 666 | 659 | static void sound_irq_callback(int irq) |
| 667 | 660 | { |
| 668 | 661 | if (irq == 0) |
| 669 | { | |
| 670 | cpunum_set_input_line(1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 671 | } | |
| 662 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 672 | 663 | else |
| 673 | { | |
| 674 | cpunum_set_input_line(1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 675 | } | |
| 664 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 676 | 665 | } |
| 677 | 666 | |
| 678 | 667 | static DRIVER_INIT(zr107) |
| r1591 | r1592 | |
|---|---|---|
| 68 | 68 | static WRITE8_HANDLER( amspdwy_sound_w ) |
| 69 | 69 | { |
| 70 | 70 | soundlatch_w(0,data); |
| 71 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 71 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static ADDRESS_MAP_START( amspdwy_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
| 258 | 258 | |
| 259 | 259 | static void irq_handler(int irq) |
| 260 | 260 | { |
| 261 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 261 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | static const struct YM2151interface amspdwy_ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 581 | 581 | static int sms_vdp_cpu0_irq_callback(int status) |
| 582 | 582 | { |
| 583 | 583 | if (status==1) |
| 584 | { | |
| 585 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 586 | } | |
| 584 | cpunum_set_input_line(Machine, 0,0,HOLD_LINE); | |
| 587 | 585 | else |
| 588 | { | |
| 589 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 590 | } | |
| 586 | cpunum_set_input_line(Machine, 0,0,CLEAR_LINE); | |
| 591 | 587 | |
| 592 | 588 | return 0; |
| 593 | 589 | } |
| r1591 | r1592 | |
| 595 | 591 | static int sms_vdp_cpu1_irq_callback(int status) |
| 596 | 592 | { |
| 597 | 593 | if (status==1) |
| 598 | { | |
| 599 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 600 | } | |
| 594 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 601 | 595 | else |
| 602 | { | |
| 603 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 604 | } | |
| 596 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 605 | 597 | |
| 606 | 598 | return 0; |
| 607 | 599 | } |
| r1591 | r1592 | |
| 610 | 602 | static int sms_vdp_cpu2_irq_callback(int status) |
| 611 | 603 | { |
| 612 | 604 | if (status==1) |
| 613 | { | |
| 614 | cpunum_set_input_line(2,0,HOLD_LINE); | |
| 615 | } | |
| 605 | cpunum_set_input_line(Machine, 2,0,HOLD_LINE); | |
| 616 | 606 | else |
| 617 | { | |
| 618 | cpunum_set_input_line(2,0,CLEAR_LINE); | |
| 619 | } | |
| 607 | cpunum_set_input_line(Machine, 2,0,CLEAR_LINE); | |
| 620 | 608 | |
| 621 | 609 | return 0; |
| 622 | 610 | } |
| r1591 | r1592 | |
| 1476 | 1464 | VIDEO_EOF(sms) |
| 1477 | 1465 | { |
| 1478 | 1466 | end_of_frame(vdp1); |
| 1479 | //if (SMS_PAUSE_BUTTON) cpunum_set_input_line(0,INPUT_LINE_NMI,PULSE_LINE); // not on systeme!!! | |
| 1467 | //if (SMS_PAUSE_BUTTON) cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE); // not on systeme!!! | |
| 1480 | 1468 | } |
| 1481 | 1469 | #endif |
| 1482 | 1470 | |
| r1591 | r1592 | |
| 2216 | 2204 | /* fixed rom bank area */ |
| 2217 | 2205 | // sms_rom = auto_malloc(0xc000); |
| 2218 | 2206 | // memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MRA8_BANK1); |
| 2219 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, MWA8_ | |
| 2207 | // memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, MWA8_UNMAP); | |
| 2220 | 2208 | // memory_set_bankptr( 1, sms_rom ); |
| 2221 | 2209 | |
| 2222 | 2210 | memory_configure_bank(1, 0, 16, memory_region(REGION_CPU1) + 0x10000, 0x4000); |
| r1591 | r1592 | |
| 2353 | 2341 | |
| 2354 | 2342 | static DRIVER_INIT( ridleofp ) |
| 2355 | 2343 | { |
| 2356 | | |
| 2344 | DRIVER_INIT_CALL(segasys | |
| 2357 | 2345 | |
| 2358 | 2346 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r); |
| 2359 | 2347 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w); |
| r1591 | r1592 | |
| 2362 | 2350 | |
| 2363 | 2351 | static DRIVER_INIT( hangonjr ) |
| 2364 | 2352 | { |
| 2365 | | |
| 2353 | DRIVER_INIT_CALL(segasys | |
| 2366 | 2354 | |
| 2367 | 2355 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r); |
| 2368 | 2356 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w); |
| r1591 | r1592 | |
| 2370 | 2358 | |
| 2371 | 2359 | static DRIVER_INIT( opaopa ) |
| 2372 | 2360 | { |
| 2373 | | |
| 2361 | DRIVER_INIT_CALL(segasys | |
| 2374 | 2362 | |
| 2375 | 2363 | mc8123_decrypt_rom(0, memory_region(REGION_USER1), 1, 8); |
| 2376 | 2364 | } |
| 2377 | 2365 | |
| 2378 | 2366 | static DRIVER_INIT( fantzn2 ) |
| 2379 | 2367 | { |
| 2380 | | |
| 2368 | DRIVER_INIT_CALL(segasys | |
| 2381 | 2369 | |
| 2382 | 2370 | mc8123_decrypt_rom(0, memory_region(REGION_USER1), 0, 0); |
| 2383 | 2371 | } |
| 2384 | 2372 | |
| 2385 | 2373 | static DRIVER_INIT( astrofl ) |
| 2386 | 2374 | { |
| 2387 | | |
| 2375 | DRIVER_INIT_CALL(segasys | |
| 2388 | 2376 | |
| 2389 | 2377 | astrofl_decode(); |
| 2390 | 2378 | } |
| r1591 | r1592 | |
|---|---|---|
| 69 | 69 | static WRITE8_HANDLER( fantland_soundlatch_w ) |
| 70 | 70 | { |
| 71 | 71 | soundlatch_w(0,data); |
| 72 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 72 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static WRITE16_HANDLER( fantland_soundlatch_16_w ) |
| r1591 | r1592 | |
| 700 | 700 | static INTERRUPT_GEN( fantland_irq ) |
| 701 | 701 | { |
| 702 | 702 | if (fantland_nmi_enable & 8) |
| 703 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 703 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | static INTERRUPT_GEN( fantland_sound_irq ) |
| 707 | 707 | { |
| 708 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0x80/4); | |
| 708 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0x80/4); | |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | static MACHINE_DRIVER_START( fantland ) |
| r1591 | r1592 | |
| 752 | 752 | |
| 753 | 753 | static void galaxygn_sound_irq(int line) |
| 754 | 754 | { |
| 755 | cpunum_set_input_line_and_vector(1, 0, line ? ASSERT_LINE : CLEAR_LINE, 0x80/4); | |
| 755 | cpunum_set_input_line_and_vector(Machine, 1, 0, line ? ASSERT_LINE : CLEAR_LINE, 0x80/4); | |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | static const struct YM2151interface galaxygn_ym2151_interface = |
| r1591 | r1592 | |
| 808 | 808 | { |
| 809 | 809 | int voice; |
| 810 | 810 | |
| 811 | | |
| 811 | MACHINE_RESET_CALL(fantland | |
| 812 | 812 | |
| 813 | 813 | for (voice = 0; voice < 4; voice++) |
| 814 | 814 | borntofi_adpcm_stop(voice); |
| r1591 | r1592 | |
|---|---|---|
| 263 | 263 | { |
| 264 | 264 | int i; |
| 265 | 265 | |
| 266 | | |
| 266 | NVRAM_HANDLER_CALL(timekeeper_0 | |
| 267 | 267 | |
| 268 | 268 | if( nvram_handler_security_cart_0 != NULL ) |
| 269 | 269 | { |
| 270 | | |
| 270 | NVRAM_HANDLER_CALL(security_cart_0 | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | if( nvram_handler_security_cart_1 != NULL ) |
| 274 | 274 | { |
| 275 | | |
| 275 | NVRAM_HANDLER_CALL(security_cart_1 | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | for( i = 0; i < flash_chips; i++ ) |
| r1591 | r1592 | |
| 1672 | 1672 | |
| 1673 | 1673 | static DRIVER_INIT( ge765pwbba ) |
| 1674 | 1674 | { |
| 1675 | | |
| 1675 | DRIVER_INIT_CALL(konami573 | |
| 1676 | 1676 | |
| 1677 | 1677 | uPD4701_init( 0 ); |
| 1678 | 1678 | |
| r1591 | r1592 | |
| 1972 | 1972 | |
| 1973 | 1973 | static DRIVER_INIT( ddr ) |
| 1974 | 1974 | { |
| 1975 | | |
| 1975 | DRIVER_INIT_CALL(konami573 | |
| 1976 | 1976 | |
| 1977 | 1977 | gx700pwfbf_init( gn845pwbb_output_callback ); |
| 1978 | 1978 | |
| r1591 | r1592 | |
| 2030 | 2030 | |
| 2031 | 2031 | static DRIVER_INIT( gtrfrks ) |
| 2032 | 2032 | { |
| 2033 | | |
| 2033 | DRIVER_INIT_CALL(konami573 | |
| 2034 | 2034 | |
| 2035 | 2035 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r ); |
| 2036 | 2036 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_w ); |
| r1591 | r1592 | |
| 2340 | 2340 | |
| 2341 | 2341 | static DRIVER_INIT( ddrdigital ) |
| 2342 | 2342 | { |
| 2343 | | |
| 2343 | DRIVER_INIT_CALL(konami573 | |
| 2344 | 2344 | |
| 2345 | 2345 | gx894pwbba_init( gn845pwbb_output_callback ); |
| 2346 | 2346 | } |
| r1591 | r1592 | |
| 2349 | 2349 | |
| 2350 | 2350 | static DRIVER_INIT( gtrfrkdigital ) |
| 2351 | 2351 | { |
| 2352 | | |
| 2352 | DRIVER_INIT_CALL(konami573 | |
| 2353 | 2353 | |
| 2354 | 2354 | gx894pwbba_init( NULL ); |
| 2355 | 2355 | |
| r1591 | r1592 | |
| 2414 | 2414 | |
| 2415 | 2415 | static DRIVER_INIT( ddrsolo ) |
| 2416 | 2416 | { |
| 2417 | | |
| 2417 | DRIVER_INIT_CALL(konami573 | |
| 2418 | 2418 | |
| 2419 | 2419 | gx894pwbba_init( ddrsolo_output_callback ); |
| 2420 | 2420 | } |
| r1591 | r1592 | |
| 2487 | 2487 | |
| 2488 | 2488 | static DRIVER_INIT( drmn ) |
| 2489 | 2489 | { |
| 2490 | | |
| 2490 | DRIVER_INIT_CALL(konami573 | |
| 2491 | 2491 | |
| 2492 | 2492 | gx700pwfbf_init( drmn_output_callback ); |
| 2493 | 2493 | } |
| 2494 | 2494 | |
| 2495 | 2495 | static DRIVER_INIT( drmndigital ) |
| 2496 | 2496 | { |
| 2497 | | |
| 2497 | DRIVER_INIT_CALL(konami573 | |
| 2498 | 2498 | |
| 2499 | 2499 | gx894pwbba_init( drmn_output_callback ); |
| 2500 | 2500 | } |
| r1591 | r1592 | |
| 2643 | 2643 | |
| 2644 | 2644 | static DRIVER_INIT( dmx ) |
| 2645 | 2645 | { |
| 2646 | | |
| 2646 | DRIVER_INIT_CALL(konami573 | |
| 2647 | 2647 | |
| 2648 | 2648 | gx894pwbba_init( dmx_output_callback ); |
| 2649 | 2649 | |
| r1591 | r1592 | |
| 2711 | 2711 | |
| 2712 | 2712 | static DRIVER_INIT( salarymc ) |
| 2713 | 2713 | { |
| 2714 | | |
| 2714 | DRIVER_INIT_CALL(konami573 | |
| 2715 | 2715 | |
| 2716 | 2716 | security_bit7_write = salarymc_lamp_data_write; |
| 2717 | 2717 | security_bit6_write = salarymc_lamp_rst_write; |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | * |
| 49 | 49 | *************************************/ |
| 50 | 50 | |
| 51 | static void update_interrupts( | |
| 51 | static void update_interrupts(running_machine *machine) | |
| 52 | 52 | { |
| 53 | 53 | int newstate = 0; |
| 54 | 54 | |
| r1591 | r1592 | |
| 58 | 58 | newstate = 2; |
| 59 | 59 | |
| 60 | 60 | if (newstate) |
| 61 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 61 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 62 | 62 | else |
| 63 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 63 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 |
| r1591 | r1592 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | /* if this is a rising edge of 16V, assert the CPU interrupt */ |
| 118 | 118 | if (scanline % 32 == 16) |
| 119 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 119 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 120 | 120 | |
| 121 | 121 | /* update the DAC state */ |
| 122 | 122 | DAC_data_w(0, (videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0); |
| r1591 | r1592 | |
| 138 | 138 | |
| 139 | 139 | static WRITE8_HANDLER( irq_ack_w ) |
| 140 | 140 | { |
| 141 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 141 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| r1591 | r1592 | |
| 182 | 182 | static void update_nmi_state(void) |
| 183 | 183 | { |
| 184 | 184 | if ((pot_trigger[0] & ~pot_mask[0]) | (pot_trigger[1] & ~pot_mask[1])) |
| 185 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 185 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 186 | 186 | else |
| 187 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 187 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 |
| r1591 | r1592 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | if (cpu_getiloops() == 0){ |
| 45 | 45 | if (K007342_is_INT_enabled()) |
| 46 | cpunum_set_input_line(0, HD6309_FIRQ_LINE, HOLD_LINE); | |
| 46 | cpunum_set_input_line(machine, 0, HD6309_FIRQ_LINE, HOLD_LINE); | |
| 47 | 47 | } |
| 48 | 48 | else if (cpu_getiloops() % 2){ |
| 49 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 49 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| r1591 | r1592 | |
| 89 | 89 | static WRITE8_HANDLER( bladestl_sh_irqtrigger_w ) |
| 90 | 90 | { |
| 91 | 91 | soundlatch_w(offset, data); |
| 92 | cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE); | |
| 92 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 93 | 93 | //logerror("(sound) write %02x\n", data); |
| 94 | 94 | } |
| 95 | 95 | |
| r1591 | r1592 | |
| 107 | 107 | AM_RANGE(0x0000, 0x1fff) AM_READ(K007342_r) /* Color RAM + Video RAM */ |
| 108 | 108 | AM_RANGE(0x2000, 0x21ff) AM_READ(K007420_r) /* Sprite RAM */ |
| 109 | 109 | AM_RANGE(0x2200, 0x23ff) AM_READ(K007342_scroll_r) /* Scroll RAM */ |
| 110 | AM_RANGE(0x2400, 0x245f) AM_READ( | |
| 110 | AM_RANGE(0x2400, 0x245f) AM_READ(MRA8 | |
| 111 | 111 | AM_RANGE(0x2e01, 0x2e01) AM_READ(input_port_3_r) /* 1P controls */ |
| 112 | 112 | AM_RANGE(0x2e02, 0x2e02) AM_READ(input_port_4_r) /* 2P controls */ |
| 113 | 113 | AM_RANGE(0x2e03, 0x2e03) AM_READ(input_port_1_r) /* DISPW #2 */ |
| r1591 | r1592 | |
| 431 | 431 | static MACHINE_DRIVER_START( bladestl ) |
| 432 | 432 | |
| 433 | 433 | /* basic machine hardware */ |
| 434 | MDRV_CPU_ADD(HD6309, | |
| 434 | MDRV_CPU_ADD(HD6309, 24000000/2) /* 24MHz/2 (?) */ | |
| 435 | 435 | MDRV_CPU_PROGRAM_MAP(bladestl_readmem,bladestl_writemem) |
| 436 | 436 | MDRV_CPU_VBLANK_INT(bladestl_interrupt,2) /* (1 IRQ + 1 NMI) */ |
| 437 | 437 |
| r1591 | r1592 | |
|---|---|---|
| 40 | 40 | * |
| 41 | 41 | *************************************/ |
| 42 | 42 | |
| 43 | static void update_interrupts( | |
| 43 | static void update_interrupts(running_machine *machine) | |
| 44 | 44 | { |
| 45 | 45 | int newstate = 0; |
| 46 | 46 | |
| r1591 | r1592 | |
| 50 | 50 | newstate |= 2; |
| 51 | 51 | |
| 52 | 52 | if (newstate) |
| 53 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 53 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 54 | 54 | else |
| 55 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 55 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 |
| r1591 | r1592 | |
|---|---|---|
| 326 | 326 | |
| 327 | 327 | static WRITE8_HANDLER( irq_ack_w ) |
| 328 | 328 | { |
| 329 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 329 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 |
| r1591 | r1592 | |
|---|---|---|
| 58 | 58 | static INTERRUPT_GEN( srumbler_interrupt ) |
| 59 | 59 | { |
| 60 | 60 | if (cpu_getiloops()==0) |
| 61 | { | |
| 62 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 63 | } | |
| 61 | cpunum_set_input_line(machine, 0,0,HOLD_LINE); | |
| 64 | 62 | else |
| 65 | { | |
| 66 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 67 | } | |
| 63 | cpunum_set_input_line(machine, 0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 68 | 64 | } |
| 69 | 65 | |
| 70 | 66 |
| r1591 | r1592 | |
|---|---|---|
| 2564 | 2564 | case (0x65c/2): |
| 2565 | 2565 | { |
| 2566 | 2566 | soundlatch_w(1,data&0xff); |
| 2567 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 2567 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 2568 | 2568 | break; |
| 2569 | 2569 | } |
| 2570 | 2570 | /*video regs (not scrollram,something else)*/ |
| r1591 | r1592 | |
| 2581 | 2581 | /*case (0x740/2): |
| 2582 | 2582 | { |
| 2583 | 2583 | soundlatch_w(1,data&0x00ff); |
| 2584 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 2584 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 2585 | 2585 | break; |
| 2586 | 2586 | }*/ |
| 2587 | 2587 | #if 0 |
| r1591 | r1592 | |
| 3851 | 3851 | ROM_LOAD( "barrel.8", 0x00000, 0x20000, CRC(489e5b1d) SHA1(ecd69d87ed354d1d08dbe6c2890af5f05d9d67d0) ) |
| 3852 | 3852 | ROM_END |
| 3853 | 3853 | |
| 3854 | ROM_START( hetbrlu2 ) | |
| 3855 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 68000 code */ | |
| 3856 | ROM_LOAD32_BYTE( "hb1", 0x00000, 0x20000, CRC(16a3754f) SHA1(3e070f2d004fc17d8ae9171955dc48ec5d14cf8a) ) | |
| 3857 | ROM_LOAD32_BYTE( "hb2", 0x00001, 0x20000, CRC(b34dc60c) SHA1(f9d1438469bf0d36d53d3f148bdf7f04dee5eae0) ) | |
| 3858 | ROM_LOAD32_BYTE( "hb3", 0x00002, 0x20000, CRC(3b035081) SHA1(b7ecbacd85102eda21dd162427a0e57cc6d24661) ) | |
| 3859 | ROM_LOAD32_BYTE( "hb4", 0x00003, 0x20000, CRC(fae85c88) SHA1(1b0316e66d4e0c5b3aa4045d6bfcc8a5464dc74e) ) | |
| 3860 | ||
| 3861 | ROM_REGION( 0x20000*2, REGION_CPU2, 0 ) /* Z80 code, banked data */ | |
| 3862 | ROM_LOAD( "barrel.7", 0x00000, 0x08000, CRC(0784dbd8) SHA1(bdf7f8a3a3eb346eb2aeaf4f9bfc49af059d04c9) ) | |
| 3863 | ROM_CONTINUE( 0x10000, 0x08000 ) /* banked stuff */ | |
| 3864 | ||
| 3865 | ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 3866 | ROM_LOAD( "barrel.6", 0x000000, 0x10000, CRC(bea3c581) SHA1(7f7f0a74bf106acaf57c182d47f0c707da2011bd) ) /* chars */ | |
| 3867 | ROM_LOAD( "barrel.5", 0x010000, 0x10000, CRC(5604d155) SHA1(afc30347b1e1316ec25056c0c1576f78be5f1a72) ) | |
| 3868 | ||
| 3869 | ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE ) | |
| 3870 | ROM_LOAD( "obj1", 0x000000, 0x100000, CRC(f7a7c31c) SHA1(683e5c7a0732ff5fd56167dd82035ca050de0507) ) /* sprites */ | |
| 3871 | ROM_LOAD( "obj2", 0x100000, 0x100000, CRC(24236116) SHA1(b27bd771cacd1587d4927e3f489c4f54b5dec110) ) | |
| 3872 | ||
| 3873 | ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE ) /* MBK tiles */ | |
| 3874 | ROM_LOAD( "bg-1", 0x000000, 0x100000, CRC(2f5d8baa) SHA1(0bf687c46c603150eadb304adcd78d53a338e615) ) | |
| 3875 | ||
| 3876 | ROM_REGION( 0x020000, REGION_GFX4, ROMREGION_DISPOSE ) /* not used */ | |
| 3877 | ||
| 3878 | ROM_REGION( 0x080000, REGION_GFX5, ROMREGION_DISPOSE ) /* BK3 tiles */ | |
| 3879 | ROM_LOAD( "bg-3", 0x000000, 0x080000, CRC(83850e2d) SHA1(cdc2df8e3bc58319c50768ea2a05b9c7ddc2a652) ) | |
| 3880 | ||
| 3881 | ROM_REGION( 0x080000, REGION_GFX6, ROMREGION_DISPOSE ) /* LBK tiles */ | |
| 3882 | ROM_LOAD( "bg-2", 0x000000, 0x080000, CRC(77ee4c6f) SHA1(a0072331bc970ba448ac5bb1ae5caa0332c82a99) ) | |
| 3883 | ||
| 3884 | ROM_REGION( 0x020000, REGION_SOUND1, 0 ) /* ADPCM samples */ | |
| 3885 | ROM_LOAD( "barrel.8", 0x00000, 0x20000, CRC(489e5b1d) SHA1(ecd69d87ed354d1d08dbe6c2890af5f05d9d67d0) ) | |
| 3886 | ROM_END | |
| 3887 | ||
| 3888 | 3854 | /* |
| 3889 | 3855 | |
| 3890 | 3856 | Godzilla |
| r1591 | r1592 | |
| 4407 | 4373 | GAME( 1992, heatbrl, 0, heatbrl, heatbrl, 0, ROT0, "Tad", "Heated Barrel (World)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 4408 | 4374 | GAME( 1992, heatbrlo, heatbrl, heatbrl, heatbrl, 0, ROT0, "Tad", "Heated Barrel (World old version)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 4409 | 4375 | GAME( 1992, heatbrlu, heatbrl, heatbrl, heatbrl, 0, ROT0, "Tad", "Heated Barrel (US)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 4410 | GAME( 1992, hetbrlu2, heatbrl, heatbrl, heatbrl, 0, ROT0, "Tad", "Heated Barrel (US set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) | |
| 4411 | 4376 | |
| 4412 | 4377 | GAME( 1993, godzilla, 0, godzilla, godzilla, 0, ROT0, "Banpresto", "Godzilla", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 4413 | 4378 | GAME( 1993, sdgndmrb, 0, sdgndmrb, sdgndmrb, 0, ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| r1591 | r1592 | |
|---|---|---|
| 54 | 54 | static WRITE8_HANDLER( pbaction_sh_command_w ) |
| 55 | 55 | { |
| 56 | 56 | soundlatch_w(offset,data); |
| 57 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0x00); | |
| 57 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0x00); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| r1591 | r1592 | |
| 257 | 257 | |
| 258 | 258 | static INTERRUPT_GEN( pbaction_interrupt ) |
| 259 | 259 | { |
| 260 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0x02); /* the CPU is in Interrupt Mode 2 */ | |
| 260 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0x02); /* the CPU is in Interrupt Mode 2 */ | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 |
| r1591 | r1592 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | static INTERRUPT_GEN( cpuA_interrupt ) |
| 155 | 155 | { |
| 156 | if (cpu_getiloops()) cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 157 | else cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 156 | if (cpu_getiloops()) cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 157 | else cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | static INTERRUPT_GEN( cpuB_interrupt ) |
| 161 | 161 | { |
| 162 | if (K053246_is_IRQ_enabled()) cpunum_set_input_line(1, 4, HOLD_LINE); | |
| 162 | if (K053246_is_IRQ_enabled()) cpunum_set_input_line(machine, 1, 4, HOLD_LINE); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| 166 | 166 | static MACHINE_RESET( overdriv ) |
| 167 | 167 | { |
| 168 | 168 | /* start with cpu B halted */ |
| 169 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 169 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | static WRITE16_HANDLER( cpuA_ctrl_w ) |
| r1591 | r1592 | |
| 174 | 174 | if (ACCESSING_LSB) |
| 175 | 175 | { |
| 176 | 176 | /* bit 0 probably enables the second 68000 */ |
| 177 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 177 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 178 | 178 | |
| 179 | 179 | /* bit 1 is clear during service mode - function unknown */ |
| 180 | 180 | |
| r1591 | r1592 | |
| 236 | 236 | |
| 237 | 237 | static WRITE16_HANDLER( overdriv_soundirq_w ) |
| 238 | 238 | { |
| 239 | cpunum_set_input_line(2,M6809_IRQ_LINE,HOLD_LINE); | |
| 239 | cpunum_set_input_line(Machine, 2,M6809_IRQ_LINE,HOLD_LINE); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | static WRITE16_HANDLER( overdriv_cpuB_irq5_w ) |
| 243 | 243 | { |
| 244 | cpunum_set_input_line(1,5,HOLD_LINE); | |
| 244 | cpunum_set_input_line(Machine, 1,5,HOLD_LINE); | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | static WRITE16_HANDLER( overdriv_cpuB_irq6_w ) |
| 248 | 248 | { |
| 249 | cpunum_set_input_line(1,6,HOLD_LINE); | |
| 249 | cpunum_set_input_line(Machine, 1,6,HOLD_LINE); | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | static INTERRUPT_GEN( scontra_interrupt ) |
| 30 | 30 | { |
| 31 | 31 | if (K052109_is_IRQ_enabled()) |
| 32 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 32 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TIMER_CALLBACK( thunderx_firq_callback ) |
| 36 | 36 | { |
| 37 | cpunum_set_input_line(0, KONAMI_FIRQ_LINE, HOLD_LINE); | |
| 37 | cpunum_set_input_line(machine, 0, KONAMI_FIRQ_LINE, HOLD_LINE); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| r1591 | r1592 | |
| 45 | 45 | static READ8_HANDLER( scontra_bankedram_r ) |
| 46 | 46 | { |
| 47 | 47 | if (palette_selected) |
| 48 | return paletteram | |
| 48 | return paletteram[ | |
| 49 | 49 | else |
| 50 | 50 | return ram[offset]; |
| 51 | 51 | } |
| r1591 | r1592 | |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | else |
| 79 | return paletteram | |
| 79 | return paletteram[ | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static WRITE8_HANDLER( thunderx_bankedram_w ) |
| r1591 | r1592 | |
| 354 | 354 | |
| 355 | 355 | static WRITE8_HANDLER( thunderx_sh_irqtrigger_w ) |
| 356 | 356 | { |
| 357 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 357 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | static WRITE8_HANDLER( scontra_snd_bankswitch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 168 | 168 | /* verify */ |
| 169 | 169 | static INTERRUPT_GEN( jackpool_interrupt ) |
| 170 | 170 | { |
| 171 | cpunum_set_input_line(0, cpu_getiloops()+1, HOLD_LINE); /* IRQs 3, 2, and 1 */ | |
| 171 | cpunum_set_input_line(machine, 0, cpu_getiloops()+1, HOLD_LINE); /* IRQs 3, 2, and 1 */ | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 |
| r1591 | r1592 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | static WRITE8_HANDLER( spcforce_soundtrigger_w ) |
| 76 | 76 | { |
| 77 | cpunum_set_input_line(1, 0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 77 | cpunum_set_input_line(Machine, 1, 0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| r1591 | r1592 | |
| 251 | 251 | static MACHINE_DRIVER_START( spcforce ) |
| 252 | 252 | |
| 253 | 253 | /* basic machine hardware */ |
| 254 | MDRV_CPU_ADD(8085A, 4000000) /* 4.00 MHz??? */ | |
| 254 | /* FIXME: The 8085A had a max clock of 6MHz, internally divided by 2! */ | |
| 255 | MDRV_CPU_ADD(8085A, 8000000 * 2) /* 4.00 MHz??? */ | |
| 255 | 256 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 256 | 257 | MDRV_CPU_VBLANK_INT(irq3_line_hold,1) |
| 257 | 258 | |
| r1591 | r1592 | |
| 273 | 274 | MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0])) |
| 274 | 275 | |
| 275 | 276 | MDRV_PALETTE_INIT(spcforce) |
| 276 | MDRV_VIDEO_START(generic_bitmapped) | |
| 277 | 277 | MDRV_VIDEO_UPDATE(spcforce) |
| 278 | 278 | |
| 279 | 279 | /* sound hardware */ |
| r1591 | r1592 | |
|---|---|---|
| 274 | 274 | { |
| 275 | 275 | if(josvolly_nmi_enable) |
| 276 | 276 | { |
| 277 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 277 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 278 | 278 | josvolly_nmi_enable = 0; |
| 279 | 279 | } |
| 280 | 280 | } |
| r1591 | r1592 | |
| 284 | 284 | { |
| 285 | 285 | if(gsword_nmi_enable) |
| 286 | 286 | { |
| 287 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 287 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | |
| r1591 | r1592 | |
| 358 | 358 | static WRITE8_HANDLER( adpcm_soundcommand_w ) |
| 359 | 359 | { |
| 360 | 360 | soundlatch_w(0,data); |
| 361 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 361 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | static ADDRESS_MAP_START( cpu1_map, 0 , 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 245 | 245 | if (ACCESSING_LSB) |
| 246 | 246 | { |
| 247 | 247 | soundlatch_w(0,data & 0xff); |
| 248 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 248 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
| r1591 | r1592 | |
| 958 | 958 | |
| 959 | 959 | static void soundirq(int state) |
| 960 | 960 | { |
| 961 | cpunum_set_input_line(1, 0, state); | |
| 961 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | static const struct YM3812interface ym3812_intf = |
| r1591 | r1592 | |
|---|---|---|
| 163 | 163 | static ADDRESS_MAP_START( mario_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 164 | 164 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 165 | 165 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
| 166 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* physical sprite ram */ | |
| 167 | AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, mario_videoram_w) AM_BASE(&videoram) | |
| 166 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(mario_state, spriteram) AM_SIZE_MEMBER(mario_state, spriteram_size) /* physical sprite ram */ | |
| 167 | AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, mario_videoram_w) AM_BASE_MEMBER(mario_state, videoram) | |
| 168 | 168 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(mario_sh1_w) /* Mario run sample */ |
| 169 | 169 | AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(mario_sh2_w) /* Luigi run sample */ |
| 170 | 170 | AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w) |
| r1591 | r1592 | |
|---|---|---|
| 141 | 141 | |
| 142 | 142 | static WRITE16_HANDLER( sound_irq_w ) |
| 143 | 143 | { |
| 144 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 144 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | //int xmen_irqenabled; |
| r1591 | r1592 | |
|---|---|---|
| 111 | 111 | #include "abaseb.lh" |
| 112 | 112 | |
| 113 | 113 | |
| 114 | int atarifb_game; | |
| 115 | 114 | |
| 116 | ||
| 117 | ||
| 118 | 115 | /************************************* |
| 119 | 116 | * |
| 120 | 117 | * Palette generation |
| r1591 | r1592 | |
| 153 | 150 | static ADDRESS_MAP_START( atarifb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 154 | 151 | ADDRESS_MAP_FLAGS( AMEF_ABITS(15) ) |
| 155 | 152 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 156 | AM_RANGE(0x0200, 0x025f) AM_WRITE(M | |
| 153 | AM_RANGE(0x0200, 0x025f) AM_READWRITE(MRA8_RAM, | |
| 157 | 154 | AM_RANGE(0x0260, 0x039f) AM_RAM |
| 158 | AM_RANGE(0x03a0, 0x03ff) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap2_vram) AM_SIZE(&atarifb_alphap2_vram_size) | |
| 159 | AM_RANGE(0x1000, 0x13bf) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 155 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(MRA8_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 156 | AM_RANGE(0x1000, 0x13bf) AM_READWRITE(MRA8_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 160 | 157 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 161 | 158 | AM_RANGE(0x2000, 0x2000) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ |
| 162 | 159 | AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb_out1_w) /* OUT 1 */ |
| r1591 | r1592 | |
| 171 | 168 | ADDRESS_MAP_END |
| 172 | 169 | |
| 173 | 170 | |
| 171 | static ADDRESS_MAP_START( atarifb4_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 172 | ADDRESS_MAP_FLAGS( AMEF_ABITS(15) ) | |
| 173 | AM_RANGE(0x0000, 0x01ff) AM_RAM | |
| 174 | AM_RANGE(0x0200, 0x025f) AM_READWRITE(MRA8_RAM, atarifb_alpha1_videoram_w) AM_BASE(&atarifb_alphap1_videoram) | |
| 175 | AM_RANGE(0x0260, 0x039f) AM_RAM | |
| 176 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(MRA8_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 177 | AM_RANGE(0x1000, 0x13bf) AM_READWRITE(MRA8_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 178 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 179 | AM_RANGE(0x2000, 0x2000) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ | |
| 180 | AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb4_out1_w) /* OUT 1 */ | |
| 181 | AM_RANGE(0x2002, 0x2002) AM_WRITE(atarifb_out2_w) /* OUT 2 */ | |
| 182 | AM_RANGE(0x2003, 0x2003) AM_WRITE(atarifb_out3_w) /* OUT 3 */ | |
| 183 | AM_RANGE(0x3000, 0x3000) AM_READ(MRA8_RAM) | |
| 184 | AM_RANGE(0x3000, 0x3000) AM_WRITE(MWA8_NOP) /* Interrupt Acknowledge */ | |
| 185 | AM_RANGE(0x4000, 0x4000) AM_READ(atarifb4_in0_r) | |
| 186 | AM_RANGE(0x4001, 0x4001) AM_READ(input_port_1_r) | |
| 187 | AM_RANGE(0x4002, 0x4002) AM_READ(atarifb4_in2_r) | |
| 188 | AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w) | |
| 189 | AM_RANGE(0x6000, 0x7fff) AM_ROM | |
| 190 | ADDRESS_MAP_END | |
| 191 | ||
| 192 | ||
| 193 | static ADDRESS_MAP_START( abaseb_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 194 | ADDRESS_MAP_FLAGS( AMEF_ABITS(15) ) | |
| 195 | AM_RANGE(0x0000, 0x01ff) AM_RAM | |
| 196 | AM_RANGE(0x0200, 0x025f) AM_READWRITE(MRA8_RAM, atarifb_alpha1_videoram_w) AM_BASE(&atarifb_alphap1_videoram) | |
| 197 | AM_RANGE(0x0260, 0x039f) AM_RAM | |
| 198 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(MRA8_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 199 | AM_RANGE(0x1000, 0x13bf) AM_READWRITE(MRA8_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 200 | AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 201 | AM_RANGE(0x2000, 0x2000) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ | |
| 202 | AM_RANGE(0x2001, 0x2001) AM_WRITE(abaseb_out1_w) /* OUT 1 */ | |
| 203 | AM_RANGE(0x2002, 0x2002) AM_WRITE(atarifb_out2_w) /* OUT 2 */ | |
| 204 | AM_RANGE(0x2003, 0x2003) AM_WRITE(atarifb_out3_w) /* OUT 3 */ | |
| 205 | AM_RANGE(0x3000, 0x3000) AM_READ(MRA8_RAM) | |
| 206 | AM_RANGE(0x3000, 0x3000) AM_WRITE(MWA8_NOP) /* Interrupt Acknowledge */ | |
| 207 | AM_RANGE(0x4000, 0x4000) AM_READ(atarifb_in0_r) | |
| 208 | AM_RANGE(0x4002, 0x4002) AM_READ(atarifb_in2_r) | |
| 209 | AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w) | |
| 210 | AM_RANGE(0x6000, 0x7fff) AM_ROM | |
| 211 | ADDRESS_MAP_END | |
| 212 | ||
| 213 | ||
| 174 | 214 | static ADDRESS_MAP_START( soccer_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 175 | 215 | ADDRESS_MAP_FLAGS( AMEF_ABITS(14) ) |
| 176 | 216 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 177 | AM_RANGE(0x0200, 0x025f) AM_WRITE(M | |
| 217 | AM_RANGE(0x0200, 0x025f) AM_READWRITE(MRA8_RAM, | |
| 178 | 218 | AM_RANGE(0x0260, 0x039f) AM_RAM |
| 179 | AM_RANGE(0x03a0, 0x03ff) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap2_vram) AM_SIZE(&atarifb_alphap2_vram_size) | |
| 180 | AM_RANGE(0x0800, 0x0bbf) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 219 | AM_RANGE(0x03a0, 0x03ff) AM_READWRITE(MRA8_RAM, atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram) | |
| 220 | AM_RANGE(0x0800, 0x0bbf) AM_READWRITE(MRA8_RAM, atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram) | |
| 181 | 221 | AM_RANGE(0x0bc0, 0x0bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 182 | 222 | AM_RANGE(0x1000, 0x1000) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */ |
| 183 | AM_RANGE(0x1001, 0x1001) AM_WRITE(atarifb_out1_w) /* OUT 1 */ | |
| 184 | AM_RANGE(0x1002, 0x1002) AM_WRITE(atarifb_out2_w) /* OUT 2 */ | |
| 223 | AM_RANGE(0x1001, 0x1001) AM_WRITE(soccer_out1_w) /* OUT 1 */ | |
| 224 | AM_RANGE(0x1002, 0x1002) AM_WRITE(soccer_out2_w) /* OUT 2 */ | |
| 185 | 225 | AM_RANGE(0x1004, 0x1004) AM_WRITE(MWA8_NOP) /* Interrupt Acknowledge */ |
| 186 | 226 | AM_RANGE(0x1005, 0x1005) AM_WRITE(watchdog_reset_w) |
| 187 | 227 | AM_RANGE(0x1800, 0x1800) AM_READ(atarifb4_in0_r) |
| r1591 | r1592 | |
| 485 | 525 | { 0 }, |
| 486 | 526 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 487 | 527 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, |
| 488 | | |
| 528 | 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, | |
| 489 | 529 | 16*8 |
| 490 | 530 | }; |
| 491 | 531 | |
| r1591 | r1592 | |
| 498 | 538 | { 0 }, |
| 499 | 539 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 500 | 540 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, |
| 501 | | |
| 541 | 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, | |
| 502 | 542 | 16*8 |
| 503 | 543 | }; |
| 504 | 544 | |
| r1591 | r1592 | |
| 543 | 583 | MDRV_PALETTE_LENGTH(12) |
| 544 | 584 | |
| 545 | 585 | MDRV_PALETTE_INIT(atarifb) |
| 546 | MDRV_VIDEO_START( | |
| 586 | MDRV_VIDEO_START(ata | |
| 547 | 587 | MDRV_VIDEO_UPDATE(atarifb) |
| 548 | 588 | |
| 549 | 589 | /* sound hardware */ |
| r1591 | r1592 | |
| 555 | 595 | MACHINE_DRIVER_END |
| 556 | 596 | |
| 557 | 597 | |
| 598 | static MACHINE_DRIVER_START( atarifb4 ) | |
| 599 | ||
| 600 | /* basic machine hardware */ | |
| 601 | MDRV_IMPORT_FROM(atarifb) | |
| 602 | MDRV_CPU_MODIFY("main") | |
| 603 | MDRV_CPU_PROGRAM_MAP(atarifb4_map,0) | |
| 604 | MACHINE_DRIVER_END | |
| 605 | ||
| 606 | ||
| 558 | 607 | static MACHINE_DRIVER_START( abaseb ) |
| 559 | 608 | |
| 560 | 609 | /* basic machine hardware */ |
| 561 | 610 | MDRV_IMPORT_FROM(atarifb) |
| 611 | MDRV_CPU_PROGRAM_MAP(abaseb_map,0) | |
| 562 | 612 | |
| 613 | /* video hardware */ | |
| 614 | MDRV_VIDEO_UPDATE(abaseb) | |
| 615 | ||
| 563 | 616 | /* sound hardware */ |
| 564 | 617 | MDRV_SOUND_REPLACE("discrete", DISCRETE, 0) |
| 565 | 618 | MDRV_SOUND_CONFIG_DISCRETE(abaseb) |
| r1591 | r1592 | |
| 577 | 630 | /* video hardware */ |
| 578 | 631 | MDRV_SCREEN_VISIBLE_AREA(0*8, 38*8-1, 2*8, 32*8-1) |
| 579 | 632 | MDRV_GFXDECODE(soccer) |
| 633 | MDRV_VIDEO_UPDATE(soccer) | |
| 580 | 634 | MACHINE_DRIVER_END |
| 581 | 635 | |
| 582 | 636 | |
| r1591 | r1592 | |
| 729 | 783 | ROM_END |
| 730 | 784 | |
| 731 | 785 | |
| 732 | /************************************* | |
| 733 | * | |
| 734 | * Driver initialization | |
| 735 | * | |
| 736 | *************************************/ | |
| 737 | 786 | |
| 738 | static DRIVER_INIT( atarifb ) | |
| 739 | { | |
| 740 | /* Tell the video code to draw the plays for this version */ | |
| 741 | atarifb_game = 1; | |
| 742 | } | |
| 743 | ||
| 744 | ||
| 745 | static DRIVER_INIT( atarifb4 ) | |
| 746 | { | |
| 747 | /* Tell the video code to draw the plays for this version */ | |
| 748 | atarifb_game = 2; | |
| 749 | ||
| 750 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000, 0, 0, atarifb4_in0_r); | |
| 751 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4001, 0x4001, 0, 0, input_port_1_r); | |
| 752 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4002, 0x4002, 0, 0, atarifb4_in2_r); | |
| 753 | } | |
| 754 | ||
| 755 | ||
| 756 | static DRIVER_INIT( abaseb ) | |
| 757 | { | |
| 758 | /* Tell the video code to draw the plays for this version */ | |
| 759 | atarifb_game = 3; | |
| 760 | } | |
| 761 | ||
| 762 | ||
| 763 | static DRIVER_INIT( soccer ) | |
| 764 | { | |
| 765 | /* Tell the video code to draw the plays for this version */ | |
| 766 | atarifb_game = 4; | |
| 767 | } | |
| 768 | ||
| 769 | ||
| 770 | ||
| 771 | 787 | /************************************* |
| 772 | 788 | * |
| 773 | 789 | * Game drivers |
| 774 | 790 | * |
| 775 | 791 | *************************************/ |
| 776 | 792 | |
| 777 | /* YEAR NAME PARENT MACHINE INPUT INIT MONITOR */ | |
| 778 | GAMEL( 1978, atarifb, 0, atarifb, atarifb, atarifb, ROT0, "Atari", "Atari Football (revision 2)", 0, layout_atarifb ) | |
| 779 | GAMEL( 1978, atarifb1, atarifb, atarifb, atarifb, atarifb, ROT0, "Atari", "Atari Football (revision 1)", 0, layout_atarifb ) | |
| 780 | GAMEL( 1979, atarifb4, atarifb, atarifb, atarifb4, atarifb4, ROT0, "Atari", "Atari Football (4 players)", 0, layout_atarifb4 ) | |
| 781 | GAMEL( 1979, abaseb, 0, abaseb, abaseb, abaseb, ROT0, "Atari", "Atari Baseball (set 1)", 0, layout_abaseb ) | |
| 782 | GAMEL( 1979, abaseb2, abaseb, abaseb, abaseb, abaseb, ROT0, "Atari", "Atari Baseball (set 2)", 0, layout_abaseb ) | |
| 783 | GAME ( 1980, soccer, 0, soccer, soccer, soccer, ROT0, "Atari", "Atari Soccer", 0 ) | |
| 793 | /* YEAR NAME PARENT MACHINE INPUT */ | |
| 794 | GAMEL( 1978, atarifb, 0, atarifb, atarifb, 0, ROT0, "Atari", "Atari Football (revision 2)", 0, layout_atarifb ) | |
| 795 | GAMEL( 1978, atarifb1, atarifb, atarifb, atarifb, 0, ROT0, "Atari", "Atari Football (revision 1)", 0, layout_atarifb ) | |
| 796 | GAMEL( 1979, atarifb4, atarifb, atarifb4, atarifb4, 0, ROT0, "Atari", "Atari Football (4 players)", 0, layout_atarifb4 ) | |
| 797 | GAMEL( 1979, abaseb, 0, abaseb, abaseb, 0, ROT0, "Atari", "Atari Baseball (set 1)", 0, layout_abaseb ) | |
| 798 | GAMEL( 1979, abaseb2, abaseb, abaseb, abaseb, 0, ROT0, "Atari", "Atari Baseball (set 2)", 0, layout_abaseb ) | |
| 799 | GAME ( 1980, soccer, 0, soccer, soccer, 0, ROT0, "Atari", "Atari Soccer", 0 ) |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static WRITE8_HANDLER( sound_irq_w ) |
| 57 | 57 | { |
| 58 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 58 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 59 | 59 | //sync with sound cpu (but it still loses some soundlatches...) |
| 60 | 60 | //timer_call_after_resynch(NULL, 0, NULL); |
| 61 | 61 | } |
| r1591 | r1592 | |
|---|---|---|
| 172 | 172 | #include "machine/eeprom.h" |
| 173 | 173 | #include "sound/k054539.h" |
| 174 | 174 | |
| 175 | #define MAIN_CLOCK XTAL_24MHz | |
| 176 | #define SOUND_CLOCK XTAL_18_432MHz | |
| 177 | ||
| 178 | ||
| 175 | 179 | #define GUNX( a ) (( ( readinputport( a ) * 287 ) / 0xff ) + 16) |
| 176 | 180 | #define GUNY( a ) (( ( readinputport( a ) * 223 ) / 0xff ) + 10) |
| 177 | 181 | |
| r1591 | r1592 | |
| 247 | 251 | |
| 248 | 252 | static INTERRUPT_GEN(lethalen_interrupt) |
| 249 | 253 | { |
| 250 | if (K056832_is_IRQ_enabled(0)) cpunum_set_input_line(0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 254 | if (K056832_is_IRQ_enabled(0)) cpunum_set_input_line(machine, 0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 251 | 255 | } |
| 252 | 256 | |
| 253 | 257 | static WRITE8_HANDLER( sound_cmd_w ) |
| r1591 | r1592 | |
| 257 | 261 | |
| 258 | 262 | static WRITE8_HANDLER( sound_irq_w ) |
| 259 | 263 | { |
| 260 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 264 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 261 | 265 | } |
| 262 | 266 | |
| 263 | 267 | static READ8_HANDLER( sound_status_r ) |
| r1591 | r1592 | |
| 267 | 271 | |
| 268 | 272 | static void sound_nmi(void) |
| 269 | 273 | { |
| 270 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 274 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 271 | 275 | } |
| 272 | 276 | |
| 273 | 277 | static WRITE8_HANDLER( le_bankswitch_w ) |
| r1591 | r1592 | |
| 281 | 285 | { |
| 282 | 286 | if (cur_control2 & 0x10) // RAM enable |
| 283 | 287 | { |
| 284 | return paletteram | |
| 288 | return paletteram[ | |
| 285 | 289 | } |
| 286 | 290 | else |
| 287 | 291 | { |
| r1591 | r1592 | |
| 649 | 653 | |
| 650 | 654 | static MACHINE_DRIVER_START( lethalen ) |
| 651 | 655 | /* basic machine hardware */ |
| 652 | MDRV_CPU_ADD_TAG("main", HD6309, | |
| 656 | MDRV_CPU_ADD_TAG("main", HD6309, MAIN_CLOCK/2) // ??? | |
| 653 | 657 | MDRV_CPU_PROGRAM_MAP(le_main, 0) |
| 654 | 658 | MDRV_CPU_VBLANK_INT(lethalen_interrupt, 1) |
| 655 | 659 | |
| 656 | 660 | MDRV_CPU_ADD_TAG("sound", Z80, 8000000) |
| 657 | /* audio CPU */ | |
| 658 | 661 | MDRV_CPU_PROGRAM_MAP(le_sound, 0) |
| 659 | 662 | |
| 660 | 663 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
| 667 | 670 | |
| 668 | 671 | MDRV_GFXDECODE(lethal) |
| 669 | 672 | |
| 670 | ||
| 671 | 673 | /* video hardware */ |
| 672 | 674 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS) |
| 673 | 675 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| r1591 | r1592 | |
|---|---|---|
| 36 | 36 | time_released = timer_get_time(); |
| 37 | 37 | |
| 38 | 38 | if (!mask) |
| 39 | { | |
| 40 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 41 | } | |
| 39 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 42 | 40 | } |
| 43 | 41 | else |
| 44 | { | |
| 45 | 42 | time_pushed = timer_get_time(); |
| 46 | } | |
| 47 | 43 | |
| 48 | 44 | prev = val; |
| 49 | 45 | } |
| r1591 | r1592 | |
| 56 | 52 | |
| 57 | 53 | update_plunger(); |
| 58 | 54 | |
| 59 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 55 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 60 | 56 | |
| 61 | 57 | scanline = scanline + 32; |
| 62 | 58 | |
| r1591 | r1592 | |
| 135 | 131 | output_set_value(matrix[i][3], (data >> 3) & 1); |
| 136 | 132 | |
| 137 | 133 | if (i == 7) |
| 138 | { | |
| 139 | 134 | set_led_status(0, data & 8); /* start button */ |
| 140 | } | |
| 141 | 135 | |
| 142 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 136 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 143 | 137 | } |
| 144 | 138 | |
| 145 | 139 | |
| r1591 | r1592 | |
| 157 | 151 | mask = ~data & 0x10; |
| 158 | 152 | |
| 159 | 153 | if (mask) |
| 160 | { | |
| 161 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 162 | } | |
| 154 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 163 | 155 | |
| 164 | 156 | coin_lockout_global_w(~data & 0x08); |
| 165 | 157 |
| r1591 | r1592 | |
|---|---|---|
| 99 | 99 | static WRITE8_HANDLER( sound_cpu_command_w ) |
| 100 | 100 | { |
| 101 | 101 | soundlatch_w(0,data); |
| 102 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 102 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static READ8_HANDLER( vblank_r ) |
| r1591 | r1592 | |
| 280 | 280 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 281 | 281 | static void irqhandler(int linestate) |
| 282 | 282 | { |
| 283 | cpunum_set_input_line_and_vector(1,0,linestate,0xff); | |
| 283 | cpunum_set_input_line_and_vector(Machine, 1,0,linestate,0xff); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
| 295 | 295 | if ( ( ~readinputport( 3 ) ) & 0xc0 ) { |
| 296 | 296 | if ( coin == 0 ) { |
| 297 | 297 | coin = 1; |
| 298 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 298 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 299 | 299 | } |
| 300 | 300 | } else |
| 301 | 301 | coin = 0; |
| r1591 | r1592 | |
|---|---|---|
| 62 | 62 | if (ACCESSING_LSB) |
| 63 | 63 | { |
| 64 | 64 | soundlatch_w(0x00,data & 0xff); |
| 65 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 65 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| r1591 | r1592 | |
| 427 | 427 | |
| 428 | 428 | static void irqhandler(int irq) |
| 429 | 429 | { |
| 430 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 430 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 176 | 176 | |
| 177 | 177 | static INTERRUPT_GEN( drill_interrupt ) |
| 178 | 178 | { |
| 179 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 179 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | static void irqhandler(int irq) |
| 183 | 183 | { |
| 184 | cpunum_set_input_line(0,5,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 184 | cpunum_set_input_line(Machine, 0,5,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 218 | 218 | static INTERRUPT_GEN( naughtyb_interrupt ) |
| 219 | 219 | { |
| 220 | 220 | if (readinputport(3) & 1) |
| 221 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 221 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | static INPUT_PORTS_START( naughtyb ) |
| r1591 | r1592 | |
|---|---|---|
| 32 | 32 | /* assume Centipede-style interrupt timing */ |
| 33 | 33 | int scanline = param; |
| 34 | 34 | |
| 35 | cpunum_set_input_line(0, 0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 35 | cpunum_set_input_line(machine, 0, 0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | 36 | |
| 37 | 37 | scanline += 32; |
| 38 | 38 | |
| r1591 | r1592 | |
| 82 | 82 | |
| 83 | 83 | static WRITE8_HANDLER( runaway_irq_ack_w ) |
| 84 | 84 | { |
| 85 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 85 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 |
| r1591 | r1592 | |
|---|---|---|
| 451 | 451 | |
| 452 | 452 | static void set_gate_a20(int a20) |
| 453 | 453 | { |
| 454 | cpunum_set_input_line(0, INPUT_LINE_A20, a20); | |
| 454 | cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20); | |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | static void keyboard_interrupt(int state) |
| r1591 | r1592 | |
|---|---|---|
| 161 | 161 | static WRITE8_HANDLER( toypop_main_interrupt_enable_w ) |
| 162 | 162 | { |
| 163 | 163 | cpu_interrupt_enable(0,1); |
| 164 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 164 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | static WRITE8_HANDLER( toypop_main_interrupt_disable_w ) |
| r1591 | r1592 | |
| 172 | 172 | static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w ) |
| 173 | 173 | { |
| 174 | 174 | cpu_interrupt_enable(1,1); |
| 175 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 175 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | static WRITE8_HANDLER( toypop_sound_interrupt_disable_w ) |
| r1591 | r1592 | |
| 183 | 183 | static INTERRUPT_GEN( toypop_main_interrupt ) |
| 184 | 184 | { |
| 185 | 185 | irq0_line_assert(machine, cpunum); // this also checks if irq is enabled - IMPORTANT! |
| 186 | // so don't replace with cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 186 | // so don't replace with cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 187 | 187 | |
| 188 | 188 | namcoio_set_irq_line(0,PULSE_LINE); |
| 189 | 189 | namcoio_set_irq_line(1,PULSE_LINE); |
| r1591 | r1592 | |
| 192 | 192 | |
| 193 | 193 | static WRITE8_HANDLER( toypop_sound_clear_w ) |
| 194 | 194 | { |
| 195 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 195 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | static WRITE8_HANDLER( toypop_sound_assert_w ) |
| 199 | 199 | { |
| 200 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 200 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | static WRITE8_HANDLER( toypop_m68000_clear_w ) |
| 204 | 204 | { |
| 205 | cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 205 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | static WRITE8_HANDLER( toypop_m68000_assert_w ) |
| 209 | 209 | { |
| 210 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 210 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | static TIMER_CALLBACK( disable_interrupts ) |
| 214 | 214 | { |
| 215 | 215 | cpu_interrupt_enable(0,0); |
| 216 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 216 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 217 | 217 | cpu_interrupt_enable(1,0); |
| 218 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 218 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 219 | 219 | interrupt_enable_68k = 0; |
| 220 | 220 | } |
| 221 | 221 | |
| r1591 | r1592 | |
| 229 | 229 | static INTERRUPT_GEN( toypop_m68000_interrupt ) |
| 230 | 230 | { |
| 231 | 231 | if (interrupt_enable_68k) |
| 232 | cpunum_set_input_line(2, 6, HOLD_LINE); | |
| 232 | cpunum_set_input_line(machine, 2, 6, HOLD_LINE); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | static WRITE16_HANDLER( toypop_m68000_interrupt_enable_w ) |
| r1591 | r1592 | |
|---|---|---|
| 339 | 339 | static WRITE16_HANDLER( tumblepb_sound_w ) |
| 340 | 340 | { |
| 341 | 341 | soundlatch_w(0,data & 0xff); |
| 342 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 342 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 343 | 343 | } |
| 344 | 344 | #endif |
| 345 | 345 | |
| 346 | 346 | static WRITE16_HANDLER( jumppop_sound_w ) |
| 347 | 347 | { |
| 348 | 348 | soundlatch_w(0,data & 0xff); |
| 349 | cpunum_set_input_line( 1, 0, ASSERT_LINE ); | |
| 349 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE ); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /******************************************************************************/ |
| r1591 | r1592 | |
| 460 | 460 | |
| 461 | 461 | static INTERRUPT_GEN( tumbleb2_interrupt ) |
| 462 | 462 | { |
| 463 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 463 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 464 | 464 | tumbleb2_playmusic(); |
| 465 | 465 | } |
| 466 | 466 | |
| r1591 | r1592 | |
| 768 | 768 | static WRITE16_HANDLER( jumpkids_sound_w ) |
| 769 | 769 | { |
| 770 | 770 | soundlatch_w(0,data & 0xff); |
| 771 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 771 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | |
| r1591 | r1592 | |
| 895 | 895 | |
| 896 | 896 | static READ8_HANDLER(jumppop_z80latch_r) |
| 897 | 897 | { |
| 898 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 898 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 899 | 899 | return soundlatch_r(0); |
| 900 | 900 | } |
| 901 | 901 | |
| r1591 | r1592 | |
| 2155 | 2155 | |
| 2156 | 2156 | static void semicom_irqhandler(int irq) |
| 2157 | 2157 | { |
| 2158 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2158 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2159 | 2159 | } |
| 2160 | 2160 | |
| 2161 | 2161 | |
| r1591 | r1592 | |
| 3670 | 3670 | |
| 3671 | 3671 | static DRIVER_INIT( chokchok ) |
| 3672 | 3672 | { |
| 3673 | | |
| 3673 | DRIVER_INIT_CALL(htchctch | |
| 3674 | 3674 | |
| 3675 | 3675 | /* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */ |
| 3676 | 3676 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w); |
| r1591 | r1592 | |
| 3681 | 3681 | |
| 3682 | 3682 | static DRIVER_INIT( wlstar ) |
| 3683 | 3683 | { |
| 3684 | | |
| 3684 | DRIVER_INIT_CALL(htchctch | |
| 3685 | 3685 | |
| 3686 | 3686 | /* slightly different banking */ |
| 3687 | 3687 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, wlstar_tilebank_w); |
| r1591 | r1592 | |
|---|---|---|
| 118 | 118 | M68681.SRB |= 0x0100; // Set Receiver B ready. |
| 119 | 119 | if(M68681.IMR & 0x1000) |
| 120 | 120 | { |
| 121 | cpunum_set_input_line_and_vector(0,3, HOLD_LINE, M68681.IVR); // Generate a receiver interrupt. | |
| 121 | cpunum_set_input_line_and_vector(Machine, 0,3, HOLD_LINE, M68681.IVR); // Generate a receiver interrupt. | |
| 122 | 122 | mame_printf_debug("INTERRUPT!!!\n"); |
| 123 | 123 | } |
| 124 | 124 | mame_printf_debug("8031 sent data: %x\n",data); |
| r1591 | r1592 | |
| 451 | 451 | |
| 452 | 452 | if(m68901_base[IMASK_REG] & (bit<<8)) // If interrupt is not masked by MFD, trigger a 68k INT |
| 453 | 453 | { |
| 454 | cpunum_set_input_line(0,4, HOLD_LINE); | |
| 454 | cpunum_set_input_line(Machine, 0,4, HOLD_LINE); | |
| 455 | 455 | // logerror("M68901 interrupt %d serviced.\n",source); |
| 456 | 456 | } |
| 457 | 457 | } |
| r1591 | r1592 | |
| 513 | 513 | |
| 514 | 514 | case 0x03: M68681.TBA = value; // Fill transmit buffer |
| 515 | 515 | M68681.SRA |=0x0400; // Data has been sent - TX ready for more. |
| 516 | if(M68681.IMR & 1) cpunum_set_input_line_and_vector(0,3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. | |
| 516 | if(M68681.IMR & 1) cpunum_set_input_line_and_vector(Machine, 0,3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. | |
| 517 | 517 | |
| 518 | 518 | #if HOST_MONITOR_DISPLAY |
| 519 | 519 | mame_printf_debug("%c",value); // Port A - Monitor |
| r1591 | r1592 | |
| 541 | 541 | // Write to sound board |
| 542 | 542 | if(M68681.IMR & 0x1000) |
| 543 | 543 | { |
| 544 | cpunum_set_input_line_and_vector(0,3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. | |
| 544 | cpunum_set_input_line_and_vector(Machine, 0,3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. | |
| 545 | 545 | } |
| 546 | cpunum_set_input_line(2, I8051_RX_LINE, ASSERT_LINE); // Generate 8031 interrupt | |
| 546 | cpunum_set_input_line(Machine, 2, I8051_RX_LINE, ASSERT_LINE); // Generate 8031 interrupt | |
| 547 | 547 | mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,activecpu_get_pc()); |
| 548 | 548 | break; |
| 549 | 549 |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | AM_RANGE(0xd406, 0xd406) AM_READ(input_port_2_r) |
| 56 | 56 | AM_RANGE(0xd407, 0xd407) AM_READ(input_port_3_r) |
| 57 | 57 | |
| 58 | AM_RANGE(0xd800, 0xdbff) AM_READ( | |
| 58 | AM_RANGE(0xd800, 0xdbff) AM_READ(MRA8 | |
| 59 | 59 | AM_RANGE(0xe000, 0xe3ff) AM_READ(MRA8_RAM) /* text */ |
| 60 | 60 | |
| 61 | 61 | AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_BANK1) |
| r1591 | r1592 | |
| 270 | 270 | MDRV_GFXDECODE(momoko) |
| 271 | 271 | MDRV_PALETTE_LENGTH(512) |
| 272 | 272 | |
| 273 | MDRV_VIDEO_START(generic) | |
| 274 | 273 | MDRV_VIDEO_UPDATE(momoko) |
| 275 | 274 | |
| 276 | 275 | /* sound hardware */ |
| r1591 | r1592 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | static WRITE8_HANDLER( sound_reset_w ) { |
| 120 | 120 | if ( !( data & 1 ) ) |
| 121 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 121 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | static WRITE8_HANDLER( sound_control_w ) { |
| r1591 | r1592 | |
| 128 | 128 | |
| 129 | 129 | static WRITE8_HANDLER( sound_command_w ) { |
| 130 | 130 | soundlatch_w( 0, data ); |
| 131 | cpunum_set_input_line_and_vector( 1, 0, HOLD_LINE, 0xff ); | |
| 131 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff ); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | static int msm_data = 0; |
| r1591 | r1592 | |
| 203 | 203 | ADDRESS_MAP_END |
| 204 | 204 | |
| 205 | 205 | static READ8_HANDLER( sound_reset_r ) { |
| 206 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 206 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 207 | 207 | return 0; |
| 208 | 208 | } |
| 209 | 209 | |
| r1591 | r1592 | |
| 399 | 399 | static INTERRUPT_GEN( kc_interrupt ) { |
| 400 | 400 | |
| 401 | 401 | if ( nmi_enable ) |
| 402 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 402 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | static void msmint( int data ) { |
| r1591 | r1592 | |
| 415 | 415 | |
| 416 | 416 | if ( !( counter ^= 1 ) ) { |
| 417 | 417 | if ( sound_nmi_enable ) { |
| 418 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 418 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | 421 | } |
| r1591 | r1592 | |
| 433 | 433 | static INTERRUPT_GEN( sound_int ) { |
| 434 | 434 | |
| 435 | 435 | if ( sound_nmi_enable ) |
| 436 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 436 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 |
| r1591 | r1592 | |
|---|---|---|
| 363 | 363 | static INTERRUPT_GEN( olibochu_interrupt ) |
| 364 | 364 | { |
| 365 | 365 | if (cpu_getiloops() == 0) |
| 366 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 366 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 367 | 367 | else |
| 368 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 368 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ | |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | static MACHINE_DRIVER_START( olibochu ) |
| r1591 | r1592 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | /* NMI and watchdog are disabled during service mode */ |
| 56 | 56 | |
| 57 | watchdog_enable(readinputport(0) & 0x40); | |
| 57 | watchdog_enable(machine, readinputport(0) & 0x40); | |
| 58 | 58 | |
| 59 | 59 | if (readinputport(0) & 0x40) |
| 60 | 60 | { |
| 61 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 61 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, nmi_callback); |
| r1591 | r1592 | |
|---|---|---|
| 22 | 22 | selection moves too fast with the clock set at 16 MHz. It's still fast at |
| 23 | 23 | 8 MHz, but at least it's usable. |
| 24 | 24 | |
| 25 | - Probably all | |
| 25 | - Probably all | |
| 26 | 26 | we need a proper V35+ core for the use of the 0x63 instruction (brkn, to call a unencrypted |
| 27 | 27 | routine from encrypted code); for simulate the instruction there's an hack (m90_game_kludge). |
| 28 | For both the games, the unencrypted routine is from 0x0a8fd to 0x0a90b | |
| 29 | 28 | |
| 30 | 29 | *****************************************************************************/ |
| 31 | 30 | |
| r1591 | r1592 | |
| 646 | 645 | |
| 647 | 646 | static INTERRUPT_GEN( m90_interrupt ) |
| 648 | 647 | { |
| 649 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x60/4); | |
| 648 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x60/4); | |
| 650 | 649 | } |
| 651 | 650 | |
| 652 | 651 | static INTERRUPT_GEN( bomblord_interrupt ) |
| 653 | 652 | { |
| 654 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x50/4); | |
| 653 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x50/4); | |
| 655 | 654 | } |
| 656 | 655 | |
| 657 | 656 | |
| r1591 | r1592 | |
| 1170 | 1169 | irem_cpu_decrypt(0,gussun_decryption_table); |
| 1171 | 1170 | } |
| 1172 | 1171 | |
| 1172 | static DRIVER_INIT( gussun ) | |
| 1173 | { | |
| 1174 | m90_game_kludge=2; | |
| 1175 | irem_cpu_decrypt(0,gussun_decryption_table); | |
| 1176 | } | |
| 1177 | ||
| 1173 | 1178 | static DRIVER_INIT( matchit2 ) |
| 1174 | 1179 | { |
| 1175 | 1180 | m90_game_kludge=0; |
| r1591 | r1592 | |
| 1208 | 1213 | GAME( 1992, bomblord, bbmanw, bomblord, bbmanw, bomblord, ROT0, "bootleg", "Bomber Lord (bootleg)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL | GAME_NOT_WORKING ) |
| 1209 | 1214 | GAME( 1992, quizf1, 0, quizf1, quizf1, quizf1, ROT0, "Irem", "Quiz F-1 1,2finish", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) |
| 1210 | 1215 | GAME( 1993, riskchal, 0, m90, riskchal, riskchal, ROT0, "Irem", "Risky Challenge", GAME_NOT_WORKING | GAME_NO_COCKTAIL ) |
| 1211 | GAME( 1993, gussun, riskchal, m90, riskchal, | |
| 1216 | GAME( 1993, gussun, riskchal, m90, riskchal, gussun | |
| 1212 | 1217 | GAME( 1993, matchit2, 0, quizf1, matchit2, matchit2, ROT0, "Tamtex", "Match It II", GAME_NO_COCKTAIL ) |
| 1213 | 1218 | GAME( 1993, shisen2, matchit2, quizf1, shisen2, matchit2, ROT0, "Tamtex", "Shisensho II", GAME_NO_COCKTAIL ) |
| r1591 | r1592 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | static TIMER_CALLBACK( interrupt_gen ) |
| 169 | 169 | { |
| 170 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 170 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 171 | 171 | timer_set(video_screen_get_frame_period(0), NULL, 0, interrupt_gen); |
| 172 | 172 | } |
| 173 | 173 |
| r1591 | r1592 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | static TIMER_CALLBACK( gunbustr_interrupt5 ) |
| 66 | 66 | { |
| 67 | cpunum_set_input_line(0,5,HOLD_LINE); | |
| 67 | cpunum_set_input_line(machine, 0,5,HOLD_LINE); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static INTERRUPT_GEN( gunbustr_interrupt ) |
| 71 | 71 | { |
| 72 | 72 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, gunbustr_interrupt5); |
| 73 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 73 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static WRITE32_HANDLER( gunbustr_palette_w ) |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | static INTERRUPT_GEN( scotrsht_interrupt ) |
| 32 | 32 | { |
| 33 | 33 | if (irq_enable) |
| 34 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 34 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static WRITE8_HANDLER( scotrsht_soundlatch_w ) |
| 38 | 38 | { |
| 39 | 39 | soundlatch_w(0,data); |
| 40 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 40 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static ADDRESS_MAP_START( scotrsht_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 823 | 823 | /* bit 0 enables cpu B */ |
| 824 | 824 | /* however this fails when recovering from a save state |
| 825 | 825 | if cpu B is disabled !! */ |
| 826 | cpunum_set_input_line(2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 826 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 827 | 827 | |
| 828 | 828 | } |
| 829 | 829 | |
| r1591 | r1592 | |
| 832 | 832 | /* bit 0 enables cpu B */ |
| 833 | 833 | /* however this fails when recovering from a save state |
| 834 | 834 | if cpu B is disabled !! */ |
| 835 | cpunum_set_input_line(1, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 835 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 836 | 836 | |
| 837 | 837 | } |
| 838 | 838 | |
| r1591 | r1592 | |
| 874 | 874 | |
| 875 | 875 | static TIMER_CALLBACK( taitoz_interrupt6 ) |
| 876 | 876 | { |
| 877 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 877 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | 880 | /* 68000 B */ |
| r1591 | r1592 | |
| 882 | 882 | #if 0 |
| 883 | 883 | static TIMER_CALLBACK( taitoz_cpub_interrupt5 ) |
| 884 | 884 | { |
| 885 | cpunum_set_input_line(2,5,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 885 | cpunum_set_input_line(machine, 2,5,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 886 | 886 | } |
| 887 | 887 | #endif |
| 888 | 888 | |
| 889 | 889 | static TIMER_CALLBACK( taitoz_sg_cpub_interrupt5 ) |
| 890 | 890 | { |
| 891 | cpunum_set_input_line(1,5,HOLD_LINE); /* assumes no Z80 */ | |
| 891 | cpunum_set_input_line(machine, 1,5,HOLD_LINE); /* assumes no Z80 */ | |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | #if 0 |
| 895 | 895 | static TIMER_CALLBACK( taitoz_cpub_interrupt6 ) |
| 896 | 896 | { |
| 897 | cpunum_set_input_line(2,6,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 897 | cpunum_set_input_line(machine, 2,6,HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
| 898 | 898 | } |
| 899 | 899 | #endif |
| 900 | 900 | |
| r1591 | r1592 | |
| 912 | 912 | |
| 913 | 913 | if (sci_int6) |
| 914 | 914 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, taitoz_interrupt6); |
| 915 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 915 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 916 | 916 | } |
| 917 | 917 | |
| 918 | 918 | /* Double Axle seems to keep only 1 sprite frame in sprite ram, |
| r1591 | r1592 | |
| 928 | 928 | if (dblaxle_int6) |
| 929 | 929 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, taitoz_interrupt6); |
| 930 | 930 | |
| 931 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 931 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | static INTERRUPT_GEN( dblaxle_cpub_interrupt ) |
| 935 | 935 | { |
| 936 | 936 | // Unsure how many int6's per frame |
| 937 | 937 | timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, taitoz_interrupt6); |
| 938 | cpunum_set_input_line(2, 4, HOLD_LINE); | |
| 938 | cpunum_set_input_line(machine, 2, 4, HOLD_LINE); | |
| 939 | 939 | } |
| 940 | 940 | |
| 941 | 941 | |
| r1591 | r1592 | |
| 1558 | 1558 | AM_RANGE(0x110000, 0x113fff) AM_READ(sharedram_r) |
| 1559 | 1559 | AM_RANGE(0x400000, 0x40000f) AM_READ(TC0220IOC_halfword_r) |
| 1560 | 1560 | AM_RANGE(0x800000, 0x800007) AM_READ(bshark_stick_r) |
| 1561 | AM_RANGE(0xa00000, 0xa01fff) AM_READ( | |
| 1561 | AM_RANGE(0xa00000, 0xa01fff) AM_READ(MRA | |
| 1562 | 1562 | AM_RANGE(0xc00000, 0xc00fff) AM_READ(MRA16_RAM) /* spriteram */ |
| 1563 | 1563 | AM_RANGE(0xd00000, 0xd0ffff) AM_READ(TC0100SCN_word_0_r) /* tilemaps */ |
| 1564 | 1564 | AM_RANGE(0xd20000, 0xd2000f) AM_READ(TC0100SCN_ctrl_word_0_r) |
| r1591 | r1592 | |
| 1613 | 1613 | AM_RANGE(0x200000, 0x20000f) AM_READ(TC0220IOC_halfword_r) |
| 1614 | 1614 | AM_RANGE(0x200010, 0x20001f) AM_READ(sci_steer_input_r) |
| 1615 | 1615 | AM_RANGE(0x420000, 0x420003) AM_READ(taitoz_sound_r) |
| 1616 | AM_RANGE(0x800000, 0x801fff) AM_READ( | |
| 1616 | AM_RANGE(0x800000, 0x801fff) AM_READ(MRA | |
| 1617 | 1617 | AM_RANGE(0xa00000, 0xa0ffff) AM_READ(TC0100SCN_word_0_r) /* tilemaps */ |
| 1618 | 1618 | AM_RANGE(0xa20000, 0xa2000f) AM_READ(TC0100SCN_ctrl_word_0_r) |
| 1619 | 1619 | AM_RANGE(0xc00000, 0xc03fff) AM_READ(MRA16_RAM) /* spriteram */ // Raine draws only 0x1000 |
| r1591 | r1592 | |
| 1796 | 1796 | AM_RANGE(0x400000, 0x40000f) AM_READ(TC0510NIO_halfword_wordswap_r) |
| 1797 | 1797 | AM_RANGE(0x400010, 0x40001f) AM_READ(dblaxle_steer_input_r) |
| 1798 | 1798 | AM_RANGE(0x620000, 0x620003) AM_READ(taitoz_sound_r) |
| 1799 | AM_RANGE(0x800000, 0x801fff) AM_READ( | |
| 1799 | AM_RANGE(0x800000, 0x801fff) AM_READ(MRA | |
| 1800 | 1800 | AM_RANGE(0xa00000, 0xa0ffff) AM_READ(TC0480SCP_word_r) /* tilemaps */ |
| 1801 | 1801 | AM_RANGE(0xa30000, 0xa3002f) AM_READ(TC0480SCP_ctrl_word_r) |
| 1802 | 1802 | AM_RANGE(0xc00000, 0xc03fff) AM_READ(MRA16_RAM) /* spriteram */ |
| r1591 | r1592 | |
| 1842 | 1842 | AM_RANGE(0x300000, 0x30000f) AM_READ(TC0510NIO_halfword_wordswap_r) |
| 1843 | 1843 | AM_RANGE(0x300010, 0x30001f) AM_READ(dblaxle_steer_input_r) |
| 1844 | 1844 | AM_RANGE(0x520000, 0x520003) AM_READ(taitoz_sound_r) |
| 1845 | AM_RANGE(0x700000, 0x701fff) AM_READ( | |
| 1845 | AM_RANGE(0x700000, 0x701fff) AM_READ(MRA | |
| 1846 | 1846 | AM_RANGE(0x900000, 0x90ffff) AM_READ(TC0480SCP_word_r) /* tilemaps */ |
| 1847 | 1847 | AM_RANGE(0x930000, 0x93002f) AM_READ(TC0480SCP_ctrl_word_r) |
| 1848 | 1848 | AM_RANGE(0xb00000, 0xb03fff) AM_READ(MRA16_RAM) /* spriteram */ |
| r1591 | r1592 | |
| 2742 | 2742 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 2743 | 2743 | static void irqhandler(int irq) // assumes Z80 sandwiched between 68Ks |
| 2744 | 2744 | { |
| 2745 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2745 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2746 | 2746 | } |
| 2747 | 2747 | |
| 2748 | 2748 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 2749 | 2749 | static void irqhandlerb(int irq) |
| 2750 | 2750 | { |
| 2751 | 2751 | // DG: this is probably specific to Z80 and wrong? |
| 2752 | // cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2752 | // cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2753 | 2753 | } |
| 2754 | 2754 | |
| 2755 | 2755 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | #include "phoenix.h" |
| 45 | 45 | |
| 46 | 46 | |
| 47 | static ADDRESS_MAP_START( phoenix_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 48 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM) | |
| 49 | AM_RANGE(0x4000, 0x4fff) AM_READ(MRA8_BANK1) /* 2 pages selected by bit 0 of the video register */ | |
| 50 | AM_RANGE(0x7000, 0x73ff) AM_READ(phoenix_input_port_0_r) /* IN0 or IN1 */ | |
| 51 | AM_RANGE(0x7800, 0x7bff) AM_READ(input_port_2_r) /* DSW */ | |
| 52 | ADDRESS_MAP_END | |
| 53 | ||
| 54 | static ADDRESS_MAP_START( pleiads_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 55 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM) | |
| 56 | AM_RANGE(0x4000, 0x4fff) AM_READ(MRA8_BANK1) /* 2 pages selected by bit 0 of the video register */ | |
| 57 | AM_RANGE(0x7000, 0x73ff) AM_READ(pleiads_input_port_0_r) /* IN0 or IN1 + protection */ | |
| 58 | AM_RANGE(0x7800, 0x7bff) AM_READ(input_port_2_r) /* DSW */ | |
| 59 | ADDRESS_MAP_END | |
| 60 | ||
| 61 | static ADDRESS_MAP_START( survival_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 62 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM) | |
| 63 | AM_RANGE(0x4000, 0x4fff) AM_READ(MRA8_BANK1) /* 2 pages selected by bit 0 of the video register */ | |
| 64 | AM_RANGE(0x6900, 0x69ff) AM_READ(AY8910_read_port_0_r) | |
| 65 | AM_RANGE(0x7000, 0x73ff) AM_READ(survival_input_port_0_r)/* IN0 or IN1 */ | |
| 66 | AM_RANGE(0x7800, 0x7bff) AM_READ(input_port_2_r) /* DSW */ | |
| 67 | ADDRESS_MAP_END | |
| 68 | ||
| 69 | ||
| 70 | static ADDRESS_MAP_START( phoenix_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 71 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 72 | AM_RANGE(0x4000, 0x4fff) AM_WRITE(phoenix_videoram_w) /* 2 pages selected by bit 0 of the video register */ | |
| 47 | static ADDRESS_MAP_START( phoenix_memory_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 48 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 49 | AM_RANGE(0x4000, 0x4fff) AM_READWRITE(MRA8_BANK1, phoenix_videoram_w) /* 2 pages selected by bit 0 of the video register */ | |
| 73 | 50 | AM_RANGE(0x5000, 0x53ff) AM_WRITE(phoenix_videoreg_w) |
| 74 | 51 | AM_RANGE(0x5800, 0x5bff) AM_WRITE(phoenix_scroll_w) |
| 75 | 52 | AM_RANGE(0x6000, 0x63ff) AM_WRITE(phoenix_sound_control_a_w) |
| 76 | 53 | AM_RANGE(0x6800, 0x6bff) AM_WRITE(phoenix_sound_control_b_w) |
| 54 | AM_RANGE(0x7000, 0x73ff) AM_READ(phoenix_input_port_0_r) /* IN0 or IN1 */ | |
| 55 | AM_RANGE(0x7800, 0x7bff) AM_READ_PORT("DSW0") /* DSW */ | |
| 77 | 56 | ADDRESS_MAP_END |
| 78 | 57 | |
| 79 | static ADDRESS_MAP_START( pleiads_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 80 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 81 | AM_RANGE(0x4000, 0x4fff) AM_WRITE(phoenix_videoram_w) /* 2 pages selected by bit 0 of the video register */ | |
| 58 | static ADDRESS_MAP_START( pleiads_memory_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 59 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 60 | AM_RANGE(0x4000, 0x4fff) AM_READWRITE(MRA8_BANK1, phoenix_videoram_w) /* 2 pages selected by bit 0 of the video register */ | |
| 82 | 61 | AM_RANGE(0x5000, 0x53ff) AM_WRITE(pleiads_videoreg_w) |
| 83 | 62 | AM_RANGE(0x5800, 0x5bff) AM_WRITE(phoenix_scroll_w) |
| 84 | 63 | AM_RANGE(0x6000, 0x63ff) AM_WRITE(pleiads_sound_control_a_w) |
| 85 | 64 | AM_RANGE(0x6800, 0x6bff) AM_WRITE(pleiads_sound_control_b_w) |
| 65 | AM_RANGE(0x7000, 0x73ff) AM_READ(pleiads_input_port_0_r) /* IN0 or IN1 + protection */ | |
| 66 | AM_RANGE(0x7800, 0x7bff) AM_READ_PORT("DSW0") /* DSW */ | |
| 86 | 67 | ADDRESS_MAP_END |
| 87 | 68 | |
| 88 | static ADDRESS_MAP_START( survival_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 89 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 90 | AM_RANGE(0x4000, 0x4fff) AM_WRITE(phoenix_videoram_w) /* 2 pages selected by bit 0 of the video register */ | |
| 69 | static ADDRESS_MAP_START( survival_memory_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 70 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 71 | AM_RANGE(0x4000, 0x4fff) AM_READWRITE(MRA8_BANK1, phoenix_videoram_w) /* 2 pages selected by bit 0 of the video register */ | |
| 91 | 72 | AM_RANGE(0x5000, 0x53ff) AM_WRITE(phoenix_videoreg_w) |
| 92 | 73 | AM_RANGE(0x5800, 0x5bff) AM_WRITE(phoenix_scroll_w) |
| 93 | 74 | AM_RANGE(0x6800, 0x68ff) AM_WRITE(AY8910_control_port_0_w) |
| 94 | AM_RANGE(0x6900, 0x69ff) AM_WRITE(AY8910_write_port_0_w) | |
| 75 | AM_RANGE(0x6900, 0x69ff) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) | |
| 76 | AM_RANGE(0x7000, 0x73ff) AM_READ(survival_input_port_0_r) /* IN0 or IN1 */ | |
| 77 | AM_RANGE(0x7800, 0x7bff) AM_READ_PORT("DSW0") /* DSW */ | |
| 95 | 78 | ADDRESS_MAP_END |
| 96 | 79 | |
| 97 | 80 | |
| 98 | 81 | |
| 99 | 82 | static INPUT_PORTS_START( phoenix ) |
| 100 | PORT_START /* IN0 */ | |
| 83 | PORT_START_TAG("IN0") /* IN0 */ | |
| 101 | 84 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 102 | 85 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) |
| 103 | 86 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| r1591 | r1592 | |
| 107 | 90 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY |
| 108 | 91 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 109 | 92 | |
| 110 | PORT_START /* IN1 */ | |
| 93 | PORT_START_TAG("IN1") /* IN1 */ | |
| 111 | 94 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ |
| 112 | 95 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 113 | 96 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| r1591 | r1592 | |
| 115 | 98 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL |
| 116 | 99 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 117 | 100 | |
| 118 | PORT_START /* DSW0 */ | |
| 119 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 101 | PORT_START_TAG("DSW0") /* DSW0 */ | |
| 102 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" ) | |
| 120 | 103 | PORT_DIPSETTING( 0x00, "3" ) |
| 121 | 104 | PORT_DIPSETTING( 0x01, "4" ) |
| 122 | 105 | PORT_DIPSETTING( 0x02, "5" ) |
| 123 | 106 | PORT_DIPSETTING( 0x03, "6" ) |
| 124 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 107 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION( "SW1:3,4" ) | |
| 125 | 108 | PORT_DIPSETTING( 0x00, "3K 30K" ) |
| 126 | 109 | PORT_DIPSETTING( 0x04, "4K 40K" ) |
| 127 | 110 | PORT_DIPSETTING( 0x08, "5K 50K" ) |
| 128 | 111 | PORT_DIPSETTING( 0x0c, "6K 60K" ) |
| 129 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) | |
| 112 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW1:5" ) | |
| 130 | 113 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) |
| 131 | 114 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 132 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 115 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:6" ) | |
| 133 | 116 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 134 | 117 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 135 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 118 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:7" ) | |
| 136 | 119 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 137 | 120 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 138 | 121 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 139 | 122 | |
| 140 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 141 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 123 | PORT_START_TAG("CAB") /* fake port for non-memory mapped dip switch */ | |
| 124 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION( "SW1:!8" ) | |
| 142 | 125 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 143 | 126 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) |
| 144 | 127 | INPUT_PORTS_END |
| 145 | 128 | |
| 146 | 129 | static INPUT_PORTS_START( phoenixa ) |
| 147 | PORT_START /* IN0 */ | |
| 148 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 149 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 150 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 151 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 152 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 153 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 154 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 155 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 130 | PORT_INCLUDE( phoenix ) | |
| 156 | 131 | |
| 157 | PORT_START /* IN1 */ | |
| 158 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 159 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 160 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 161 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 162 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 163 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 164 | ||
| 165 | PORT_START /* DSW0 */ | |
| 166 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 167 | PORT_DIPSETTING( 0x00, "3" ) | |
| 168 | PORT_DIPSETTING( 0x01, "4" ) | |
| 169 | PORT_DIPSETTING( 0x02, "5" ) | |
| 170 | PORT_DIPSETTING( 0x03, "6" ) | |
| 171 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 172 | PORT_DIPSETTING( 0x00, "3K 30K" ) | |
| 173 | PORT_DIPSETTING( 0x04, "4K 40K" ) | |
| 174 | PORT_DIPSETTING( 0x08, "5K 50K" ) | |
| 175 | PORT_DIPSETTING( 0x0c, "6K 60K" ) | |
| 132 | PORT_MODIFY("DSW0") | |
| 176 | 133 | /* Coinage is backwards from phoenix (Amstar) */ |
| 177 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Coinage ) ) | |
| 134 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW1:5" ) | |
| 178 | 135 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) |
| 179 | 136 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) |
| 180 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 181 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 182 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 183 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 184 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 185 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 186 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 187 | ||
| 188 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 189 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 190 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 191 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 192 | 137 | INPUT_PORTS_END |
| 193 | 138 | |
| 194 | 139 | static INPUT_PORTS_START( phoenixt ) |
| 195 | PORT_START /* IN0 */ | |
| 196 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 197 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 198 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 199 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 200 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 201 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 202 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 203 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 140 | PORT_INCLUDE( phoenix ) | |
| 204 | 141 | |
| 205 | PORT_START /* IN1 */ | |
| 206 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 207 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 208 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 209 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 210 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 211 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 212 | ||
| 213 | PORT_START /* DSW0 */ | |
| 214 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 215 | PORT_DIPSETTING( 0x00, "3" ) | |
| 216 | PORT_DIPSETTING( 0x01, "4" ) | |
| 217 | PORT_DIPSETTING( 0x02, "5" ) | |
| 218 | PORT_DIPSETTING( 0x03, "6" ) | |
| 219 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 220 | PORT_DIPSETTING( 0x00, "3K 30K" ) | |
| 221 | PORT_DIPSETTING( 0x04, "4K 40K" ) | |
| 222 | PORT_DIPSETTING( 0x08, "5K 50K" ) | |
| 223 | PORT_DIPSETTING( 0x0c, "6K 60K" ) | |
| 224 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 142 | PORT_MODIFY("DSW0") | |
| 143 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:5" ) | |
| 225 | 144 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 226 | 145 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 227 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 228 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 229 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 230 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 231 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 232 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 233 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 234 | ||
| 235 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 236 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 237 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 238 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 239 | 146 | INPUT_PORTS_END |
| 240 | 147 | |
| 241 | 148 | static INPUT_PORTS_START( phoenix3 ) |
| 242 | PORT_START /* IN0 */ | |
| 243 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 244 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 245 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 246 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 247 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 248 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 249 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 250 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 149 | PORT_INCLUDE( phoenix ) | |
| 251 | 150 | |
| 252 | PORT_START /* IN1 */ | |
| 253 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 254 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 255 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 256 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 257 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 258 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 259 | ||
| 260 | PORT_START /* DSW0 */ | |
| 261 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 262 | PORT_DIPSETTING( 0x00, "3" ) | |
| 263 | PORT_DIPSETTING( 0x01, "4" ) | |
| 264 | PORT_DIPSETTING( 0x02, "5" ) | |
| 265 | PORT_DIPSETTING( 0x03, "6" ) | |
| 266 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 267 | PORT_DIPSETTING( 0x00, "3K 30K" ) | |
| 268 | PORT_DIPSETTING( 0x04, "4K 40K" ) | |
| 269 | PORT_DIPSETTING( 0x08, "5K 50K" ) | |
| 270 | PORT_DIPSETTING( 0x0c, "6K 60K" ) | |
| 271 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 151 | PORT_MODIFY("DSW0") | |
| 152 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:5" ) | |
| 272 | 153 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 273 | 154 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 274 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 155 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:6" ) | |
| 275 | 156 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 276 | 157 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 277 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) ) | |
| 158 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW1:7" ) | |
| 278 | 159 | PORT_DIPSETTING( 0x40, "A - 2C/1C B - 1C/3C" ) |
| 279 | 160 | PORT_DIPSETTING( 0x00, "A - 1C/1C B - 1C/6C" ) |
| 280 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 281 | ||
| 282 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 283 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 284 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 285 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 286 | 161 | INPUT_PORTS_END |
| 287 | 162 | |
| 288 | 163 | static INPUT_PORTS_START( condor ) |
| 289 | PORT_START /* IN0 */ | |
| 290 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 291 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 292 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 293 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 294 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 295 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 296 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 297 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) | |
| 164 | PORT_INCLUDE( phoenix ) | |
| 298 | 165 | |
| 299 | PORT_START /* IN1 */ | |
| 300 | PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 301 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 302 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 303 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 304 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 305 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 306 | ||
| 307 | PORT_START /* DSW0 */ | |
| 308 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 166 | PORT_MODIFY("DSW0") | |
| 167 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" ) | |
| 309 | 168 | PORT_DIPSETTING( 0x00, "2" ) |
| 310 | 169 | PORT_DIPSETTING( 0x01, "3" ) |
| 311 | 170 | PORT_DIPSETTING( 0x02, "4" ) |
| 312 | 171 | PORT_DIPSETTING( 0x03, "5" ) |
| 313 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 172 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION( "SW1:3,4" ) | |
| 314 | 173 | PORT_DIPSETTING( 0x00, "Every 6000" ) |
| 315 | 174 | PORT_DIPSETTING( 0x08, "Every 10000" ) |
| 316 | 175 | PORT_DIPSETTING( 0x04, "Every 14000" ) |
| 317 | 176 | PORT_DIPSETTING( 0x0c, "Every 18000" ) |
| 318 | PORT_DIPNAME( 0x70, 0x30, "Fuel Consumption" ) | |
| 177 | PORT_DIPNAME( 0x70, 0x30, "Fuel Consumption" ) PORT_DIPLOCATION( "SW1:5,6,7" ) | |
| 319 | 178 | PORT_DIPSETTING( 0x00, "Slowest" ) |
| 320 | 179 | PORT_DIPSETTING( 0x10, "Slower" ) |
| 321 | 180 | PORT_DIPSETTING( 0x20, "Slow" ) |
| r1591 | r1592 | |
| 324 | 183 | PORT_DIPSETTING( 0x50, "Fast" ) |
| 325 | 184 | PORT_DIPSETTING( 0x60, "Faster" ) |
| 326 | 185 | PORT_DIPSETTING( 0x70, "Fastest" ) |
| 327 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 328 | 186 | |
| 329 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 330 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 331 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 332 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 333 | ||
| 334 | PORT_START | |
| 187 | PORT_START_TAG("COINAGE") | |
| 335 | 188 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_B ) ) |
| 336 | 189 | PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) |
| 337 | 190 | PORT_DIPSETTING( 0x09, DEF_STR( 2C_2C ) ) |
| r1591 | r1592 | |
| 369 | 222 | INPUT_PORTS_END |
| 370 | 223 | |
| 371 | 224 | static INPUT_PORTS_START( falcona ) |
| 372 | PORT_START /* IN0 */ | |
| 373 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 374 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 375 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 376 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 377 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 378 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 379 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 380 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 225 | PORT_INCLUDE( phoenix ) | |
| 381 | 226 | |
| 382 | PORT_START /* IN1 */ | |
| 383 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 384 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 385 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 386 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 387 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 388 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 389 | ||
| 390 | PORT_START /* DSW0 */ | |
| 391 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 227 | PORT_MODIFY("DSW0") | |
| 228 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" ) | |
| 392 | 229 | PORT_DIPSETTING( 0x00, "2" ) |
| 393 | 230 | PORT_DIPSETTING( 0x01, "3" ) |
| 394 | 231 | PORT_DIPSETTING( 0x02, "4" ) |
| 395 | 232 | PORT_DIPSETTING( 0x03, "5" ) |
| 396 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 233 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION( "SW1:3,4" ) | |
| 397 | 234 | PORT_DIPSETTING( 0x00, "3K 30K" ) |
| 398 | 235 | PORT_DIPSETTING( 0x04, "4K 40K" ) |
| 399 | 236 | PORT_DIPSETTING( 0x08, "5K 50K" ) |
| 400 | 237 | PORT_DIPSETTING( 0x0c, "6K 60K" ) |
| 401 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 238 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:5" ) | |
| 402 | 239 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 403 | 240 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 404 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 241 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:6" ) | |
| 405 | 242 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 406 | 243 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 407 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) ) | |
| 244 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW1:7" ) | |
| 408 | 245 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) |
| 409 | 246 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_1C ) ) |
| 410 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 411 | ||
| 412 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 413 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 414 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 415 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 416 | 247 | INPUT_PORTS_END |
| 417 | 248 | |
| 418 | 249 | |
| 419 | 250 | static INPUT_PORTS_START( nextfase ) |
| 420 | PORT_START /* IN0 */ | |
| 421 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 422 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 423 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 424 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 425 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 426 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 427 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 428 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 251 | PORT_INCLUDE( phoenix ) | |
| 429 | 252 | |
| 430 | PORT_START /* IN1 */ | |
| 431 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 432 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 433 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 434 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 435 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 436 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 437 | ||
| 438 | PORT_START /* DSW0 */ | |
| 439 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) | |
| 253 | PORT_MODIFY("DSW0") | |
| 254 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" ) | |
| 440 | 255 | PORT_DIPSETTING( 0x00, "1" ) |
| 441 | 256 | PORT_DIPSETTING( 0x01, "2" ) |
| 442 | 257 | PORT_DIPSETTING( 0x02, "3" ) |
| 443 | 258 | PORT_DIPSETTING( 0x03, "4" ) |
| 444 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 259 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION( "SW1:3,4" ) | |
| 445 | 260 | PORT_DIPSETTING( 0x00, "3K 30K" ) |
| 446 | 261 | PORT_DIPSETTING( 0x04, "4K 40K" ) |
| 447 | 262 | PORT_DIPSETTING( 0x08, "5K 50K" ) |
| 448 | 263 | PORT_DIPSETTING( 0x0c, "6K 60K" ) |
| 449 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 264 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:5" ) | |
| 450 | 265 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 451 | 266 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 452 | PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coinage ) ) | |
| 267 | PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW1:6,7" ) | |
| 453 | 268 | PORT_DIPSETTING( 0x00, "1C/1C & 1C/2C" ) |
| 454 | 269 | PORT_DIPSETTING( 0x20, "2C/3C & 1C/3C" ) |
| 455 | 270 | PORT_DIPSETTING( 0x40, "1C/2C & 1C/4C" ) |
| 456 | 271 | PORT_DIPSETTING( 0x60, "2C/5C & 1C/5C" ) |
| 457 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 458 | ||
| 459 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 460 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 461 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 462 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 463 | 272 | INPUT_PORTS_END |
| 464 | 273 | |
| 465 | 274 | |
| 466 | 275 | static INPUT_PORTS_START( pleiads ) |
| 467 | PORT_START /* IN0 */ | |
| 468 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 469 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 470 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 471 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) /* Protection. See 0x0552 */ | |
| 472 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 473 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 474 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 475 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 276 | PORT_INCLUDE( phoenix ) | |
| 476 | 277 | |
| 477 | PORT_START /* IN1 */ | |
| 478 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 479 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 480 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 481 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 482 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 483 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 278 | PORT_MODIFY("IN0") | |
| 279 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) /* Protection. See 0x0552 */ | |
| 484 | 280 | |
| 485 | PORT_START /* DSW0 */ | |
| 486 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 487 | PORT_DIPSETTING( 0x00, "3" ) | |
| 488 | PORT_DIPSETTING( 0x01, "4" ) | |
| 489 | PORT_DIPSETTING( 0x02, "5" ) | |
| 490 | PORT_DIPSETTING( 0x03, "6" ) | |
| 491 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 492 | PORT_DIPSETTING( 0x00, "3K 30K" ) | |
| 493 | PORT_DIPSETTING( 0x04, "4K 40K" ) | |
| 494 | PORT_DIPSETTING( 0x08, "5K 50K" ) | |
| 495 | PORT_DIPSETTING( 0x0c, "6K 60K" ) | |
| 496 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) | |
| 497 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 498 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 499 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 500 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 501 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 502 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) | |
| 281 | PORT_MODIFY("DSW0") | |
| 282 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW1:7" ) | |
| 503 | 283 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 504 | 284 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 505 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 506 | ||
| 507 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 508 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 509 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 510 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 511 | 285 | INPUT_PORTS_END |
| 512 | 286 | |
| 513 | 287 | static INPUT_PORTS_START( pleiadce ) |
| 514 | PORT_START /* IN0 */ | |
| 515 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 516 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 517 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 518 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) /* Protection. See 0x0552 */ | |
| 519 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 520 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 521 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 522 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 288 | PORT_INCLUDE( pleiads ) | |
| 523 | 289 | |
| 524 | PORT_START /* IN1 */ | |
| 525 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 526 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 527 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 528 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 529 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 530 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 531 | ||
| 532 | PORT_START /* DSW0 */ | |
| 533 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 534 | PORT_DIPSETTING( 0x00, "3" ) | |
| 535 | PORT_DIPSETTING( 0x01, "4" ) | |
| 536 | PORT_DIPSETTING( 0x02, "5" ) | |
| 537 | PORT_DIPSETTING( 0x03, "6" ) | |
| 538 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 290 | PORT_MODIFY("DSW0") | |
| 291 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION( "SW1:3,4" ) | |
| 539 | 292 | PORT_DIPSETTING( 0x00, "7K 70K" ) |
| 540 | 293 | PORT_DIPSETTING( 0x04, "8K 80K" ) |
| 541 | 294 | PORT_DIPSETTING( 0x08, "9K 90K" ) |
| 542 | 295 | /*PORT_DIPSETTING( 0x0c, "INVALID" ) Sets bonus to A000 */ |
| 543 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) | |
| 544 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 545 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 546 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 547 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 548 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 549 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) | |
| 550 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 551 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 552 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 553 | ||
| 554 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 555 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 556 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 557 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 558 | 296 | INPUT_PORTS_END |
| 559 | 297 | |
| 560 | 298 | static INPUT_PORTS_START( capitol ) |
| 561 | PORT_START /* IN0 */ | |
| 562 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 563 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) | |
| 564 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 565 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 566 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 567 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 568 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 569 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 299 | PORT_INCLUDE( phoenix ) | |
| 570 | 300 | |
| 571 | PORT_START /* IN1 */ | |
| 572 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ | |
| 573 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 574 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 575 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 576 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 577 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 578 | ||
| 579 | PORT_START /* DSW0 */ | |
| 580 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) | |
| 581 | PORT_DIPSETTING( 0x00, "3" ) | |
| 582 | PORT_DIPSETTING( 0x01, "4" ) | |
| 583 | PORT_DIPSETTING( 0x02, "5" ) | |
| 584 | PORT_DIPSETTING( 0x03, "6" ) | |
| 585 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 586 | PORT_DIPSETTING( 0x00, "3K 30K" ) | |
| 587 | PORT_DIPSETTING( 0x04, "4K 40K" ) | |
| 588 | PORT_DIPSETTING( 0x08, "5K 50K" ) | |
| 589 | PORT_DIPSETTING( 0x0c, "6K 60K" ) | |
| 590 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) | |
| 591 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 592 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 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, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 597 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 598 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 599 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 600 | ||
| 601 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 602 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 603 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 604 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 301 | PORT_MODIFY("DSW0") | |
| 302 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW1:7" ) | |
| 303 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 304 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 605 | 305 | INPUT_PORTS_END |
| 606 | 306 | |
| 607 | 307 | static INPUT_PORTS_START( survival ) |
| 608 | PORT_START /* IN0 */ | |
| 308 | PORT_START_TAG("IN0") /* IN0 */ | |
| 609 | 309 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 610 | 310 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) |
| 611 | 311 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| r1591 | r1592 | |
| 615 | 315 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) |
| 616 | 316 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) |
| 617 | 317 | |
| 618 | PORT_START /* IN1 */ | |
| 318 | PORT_START_TAG("IN1") /* IN1 */ | |
| 619 | 319 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) /* comes from IN0 0-2 */ |
| 620 | 320 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 621 | 321 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL |
| r1591 | r1592 | |
| 623 | 323 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL |
| 624 | 324 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL |
| 625 | 325 | |
| 626 | PORT_START | |
| 326 | PORT_START_TAG("DSW0") | |
| 627 | 327 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) |
| 628 | 328 | PORT_DIPSETTING( 0x03, "2" ) |
| 629 | 329 | PORT_DIPSETTING( 0x02, "3" ) |
| r1591 | r1592 | |
| 644 | 344 | PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) |
| 645 | 345 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 646 | 346 | |
| 647 | PORT_START /* fake port for non-memory mapped dip switch */ | |
| 347 | PORT_START_TAG("CAB") /* fake port for non-memory mapped dip switch */ | |
| 648 | 348 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) |
| 649 | 349 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 650 | 350 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) |
| r1591 | r1592 | |
| 664 | 364 | }; |
| 665 | 365 | |
| 666 | 366 | static GFXDECODE_START( phoenix ) |
| 667 | GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 ) | |
| 668 | GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 16 ) | |
| 367 | GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 ) | |
| 368 | GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 32 ) | |
| 669 | 369 | GFXDECODE_END |
| 670 | 370 | |
| 671 | 371 | static GFXDECODE_START( pleiads ) |
| 672 | GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 ) | |
| 673 | GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 32*4, 32 ) | |
| 372 | GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 64 ) | |
| 373 | GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 64 ) | |
| 674 | 374 | GFXDECODE_END |
| 675 | 375 | |
| 676 | 376 | |
| r1591 | r1592 | |
| 721 | 421 | |
| 722 | 422 | /* basic machine hardware */ |
| 723 | 423 | MDRV_CPU_ADD_TAG("main", 8085A, CPU_CLOCK) /* 2.75 MHz */ |
| 724 | MDRV_CPU_PROGRAM_MAP(phoenix_ | |
| 424 | MDRV_CPU_PROGRAM_MAP(phoenix_ | |
| 725 | 425 | |
| 726 | 426 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) |
| 727 | 427 | |
| r1591 | r1592 | |
| 761 | 461 | /* basic machine hardware */ |
| 762 | 462 | MDRV_IMPORT_FROM(phoenix) |
| 763 | 463 | MDRV_CPU_MODIFY("main") |
| 764 | MDRV_CPU_PROGRAM_MAP(pleiads_ | |
| 464 | MDRV_CPU_PROGRAM_MAP(pleiads_ | |
| 765 | 465 | |
| 766 | 466 | /* video hardware */ |
| 767 | 467 | MDRV_GFXDECODE(pleiads) |
| 768 | MDRV_COLORTABLE_LENGTH(32*4+32*4) | |
| 769 | 468 | |
| 770 | 469 | MDRV_PALETTE_INIT(pleiads) |
| 771 | MDRV_VIDEO_START(pleiads) | |
| 772 | 470 | |
| 773 | 471 | /* sound hardware */ |
| 774 | 472 | MDRV_SOUND_REPLACE("tms", TMS36XX, 247) |
| r1591 | r1592 | |
| 788 | 486 | static MACHINE_DRIVER_START( survival ) |
| 789 | 487 | |
| 790 | 488 | /* basic machine hardware */ |
| 791 | MDRV_CPU_ADD(8085A,11000000/4) /* 2.75 MHz */ | |
| 792 | MDRV_CPU_PROGRAM_MAP(survival_readmem,survival_writemem) | |
| 489 | MDRV_CPU_ADD_TAG("main", 8085A, CPU_CLOCK) /* 5.50 MHz */ | |
| 490 | MDRV_CPU_PROGRAM_MAP(survival_memory_map, 0) | |
| 793 | 491 | |
| 794 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 795 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION) | |
| 492 | /* schematics fairly identical to phoenix, however the interesting | |
| 493 | * page is missing | |
| 494 | */ | |
| 495 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) | |
| 796 | 496 | |
| 497 | MDRV_MACHINE_RESET(phoenix) | |
| 498 | ||
| 797 | 499 | /* video hardware */ |
| 798 | 500 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 799 | 501 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 800 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 801 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 26*8-1) | |
| 802 | 502 | MDRV_GFXDECODE(phoenix) |
| 803 | 503 | MDRV_PALETTE_LENGTH(256) |
| 804 | MDRV_COLORTABLE_LENGTH(16*4+16*4) | |
| 805 | 504 | |
| 806 | MDRV_PALETTE_INIT( | |
| 505 | MDRV_PALETTE_INIT(surv | |
| 807 | 506 | MDRV_VIDEO_START(phoenix) |
| 808 | 507 | MDRV_VIDEO_UPDATE(phoenix) |
| 809 | 508 | |
| 810 | 509 | /* sound hardware */ |
| 811 | 510 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 812 | 511 | |
| 512 | /* FIXME: check clock */ | |
| 813 | 513 | MDRV_SOUND_ADD(AY8910, 11000000/4) |
| 814 | 514 | MDRV_SOUND_CONFIG(survival_ay8910_interface) |
| 815 | 515 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| r1591 | r1592 | |
| 821 | 521 | |
| 822 | 522 | /* basic machine hardware */ |
| 823 | 523 | MDRV_IMPORT_FROM(phoenix) |
| 524 | /* FIXME: Verify clock. This is most likely 11MHz/2 */ | |
| 824 | 525 | MDRV_CPU_REPLACE("main", Z80, 11000000/4) /* 2.75 MHz??? */ |
| 825 | 526 | MACHINE_DRIVER_END |
| 826 | 527 | |
| r1591 | r1592 | |
| 1314 | 1015 | GAME( 1981, phoenixc, phoenix, phoenix, phoenixt, 0, ROT90, "bootleg?", "Phoenix (IRECSA, G.G.I Corp)", GAME_SUPPORTS_SAVE ) |
| 1315 | 1016 | |
| 1316 | 1017 | |
| 1317 | GAME( 1981, condor, phoenix, condor, condor, condor, ROT90, "Sidam (bootleg)", "Condor (bootleg of Phoenix)", | |
| 1018 | GAME( 1981, condor, phoenix, condor, condor, condor, ROT90, "Sidam (bootleg)", "Condor (bootleg of Phoenix)", GAME_SUPPORTS_SAVE ) | |
| 1318 | 1019 | // the following 2 were common bootlegs in england & france respectively |
| 1319 | 1020 | GAME( 1980, falcon, phoenix, phoenix, phoenixt, 0, ROT90, "bootleg", "Falcon (bootleg of Phoenix) (set 1)", GAME_SUPPORTS_SAVE ) |
| 1320 | 1021 | GAME( 1980, vautour, phoenix, phoenix, phoenixt, 0, ROT90, "Jeutel (bootleg)", "Vautour (bootleg of Phoenix) (set 1)", GAME_SUPPORTS_SAVE ) |
| 1321 | GAME( 1980, vautour2, phoenix, condor, condor, condor, ROT90, "bootleg", "Vautour (bootleg of Phoenix) (set 2)", | |
| 1022 | GAME( 1980, vautour2, phoenix, condor, condor, condor, ROT90, "bootleg", "Vautour (bootleg of Phoenix) (set 2)", GAME_SUPPORTS_SAVE ) | |
| 1322 | 1023 | // fenix is an italian bootleg based on vautour |
| 1323 | GAME( 1980, fenix, phoenix, condor, condor, condor, ROT90, "bootleg", "Fenix (bootleg of Phoenix)", GAME_NOT_WORKING ) | |
| 1324 | GAME( 1980, griffon, phoenix, condor, condor, condor, ROT90, "Videotron (bootleg)", "Griffon (bootleg of Phoenix)", 0 ) | |
| 1325 | GAME( 1980, falcona, phoenix, condor, falcona, 0, ROT90, "bootleg", "Falcon (bootleg of Phoenix) (set 2)", 0 ) | |
| 1024 | GAME( 1980, fenix, phoenix, condor, condor, condor, ROT90, "bootleg", "Fenix (bootleg of Phoenix)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 1025 | GAME( 1980, griffon, phoenix, condor, condor, condor, ROT90, "Videotron (bootleg)", "Griffon (bootleg of Phoenix)", GAME_SUPPORTS_SAVE ) | |
| 1026 | GAME( 1980, falcona, phoenix, condor, falcona, 0, ROT90, "bootleg", "Falcon (bootleg of Phoenix) (set 2)", GAME_SUPPORTS_SAVE ) | |
| 1326 | 1027 | // nextfase is a spanish bootleg |
| 1327 | GAME( 1981, nextfase, phoenix, phoenix, nextfase, 0, ROT90, "Petaco S.A. (bootleg)","Next Fase (bootleg of Phoenix)", | |
| 1028 | GAME( 1981, nextfase, phoenix, phoenix, nextfase, 0, ROT90, "Petaco S.A. (bootleg)","Next Fase (bootleg of Phoenix)", GAME_SUPPORTS_SAVE ) | |
| 1328 | 1029 | |
| 1329 | 1030 | GAME( 1981, pleiads, 0, pleiads, pleiads, 0, ROT90, "Tehkan", "Pleiads (Tehkan)", GAME_IMPERFECT_COLORS ) |
| 1330 | 1031 | GAME( 1981, pleiadbl, pleiads, pleiads, pleiads, 0, ROT90, "bootleg", "Pleiads (bootleg)", GAME_IMPERFECT_COLORS ) |
| r1591 | r1592 | |
|---|---|---|
| 451 | 451 | switch (cpu_getiloops()) |
| 452 | 452 | { |
| 453 | 453 | case 0: |
| 454 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 454 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 455 | 455 | break; |
| 456 | 456 | default: |
| 457 | 457 | h8_3002_InterruptRequest(24); |
| r1591 | r1592 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | static TIMER_CALLBACK( nmi_callback ) |
| 65 | 65 | { |
| 66 | if (sound_nmi_enable) cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 66 | if (sound_nmi_enable) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 67 | 67 | else pending_nmi = 1; |
| 68 | 68 | } |
| 69 | 69 | |
| r1591 | r1592 | |
| 83 | 83 | sound_nmi_enable = 1; |
| 84 | 84 | if (pending_nmi) |
| 85 | 85 | { |
| 86 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 86 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 87 | 87 | pending_nmi = 0; |
| 88 | 88 | } |
| 89 | 89 | } |
| r1591 | r1592 | |
|---|---|---|
| 290 | 290 | |
| 291 | 291 | static READ8_HANDLER( nmi_ack_r ) |
| 292 | 292 | { |
| 293 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 293 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 294 | 294 | return 0; |
| 295 | 295 | } |
| 296 | 296 | |
| r1591 | r1592 | |
| 344 | 344 | logerror("Z80 sends command %02x\n",param); |
| 345 | 345 | from_z80 = param; |
| 346 | 346 | from_mcu_pending = 0; |
| 347 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 347 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 348 | 348 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(200)); |
| 349 | 349 | } |
| 350 | 350 | |
| r1591 | r1592 | |
| 500 | 500 | ADDRESS_MAP_END |
| 501 | 501 | |
| 502 | 502 | static ADDRESS_MAP_START( pbillian_port_map, ADDRESS_SPACE_IO, 8 ) |
| 503 | AM_RANGE(0x0000, 0x01ff) AM_READWRITE( | |
| 503 | AM_RANGE(0x0000, 0x01ff) AM_READWRITE(MRA8 | |
| 504 | 504 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 505 | 505 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 506 | 506 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r1591 | r1592 | |
| 514 | 514 | ADDRESS_MAP_END |
| 515 | 515 | |
| 516 | 516 | static ADDRESS_MAP_START( hotsmash_port_map, ADDRESS_SPACE_IO, 8 ) |
| 517 | AM_RANGE(0x0000, 0x01ff) AM_READWRITE( | |
| 517 | AM_RANGE(0x0000, 0x01ff) AM_READWRITE(MRA8 | |
| 518 | 518 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 519 | 519 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 520 | 520 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r1591 | r1592 | |
| 528 | 528 | ADDRESS_MAP_END |
| 529 | 529 | |
| 530 | 530 | static ADDRESS_MAP_START( sqix_port_map, ADDRESS_SPACE_IO, 8 ) |
| 531 | AM_RANGE(0x0000, 0x00ff) AM_READWRITE( | |
| 531 | AM_RANGE(0x0000, 0x00ff) AM_READWRITE(MRA8 | |
| 532 | 532 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 533 | 533 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 534 | 534 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r1591 | r1592 | |
| 543 | 543 | ADDRESS_MAP_END |
| 544 | 544 | |
| 545 | 545 | static ADDRESS_MAP_START( bootleg_port_map, ADDRESS_SPACE_IO, 8 ) |
| 546 | AM_RANGE(0x0000, 0x00ff) AM_READWRITE( | |
| 546 | AM_RANGE(0x0000, 0x00ff) AM_READWRITE(MRA8 | |
| 547 | 547 | AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r) |
| 548 | 548 | AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w) |
| 549 | 549 | AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w) |
| r1591 | r1592 | |
|---|---|---|
| 717 | 717 | |
| 718 | 718 | /* LS161A, Sheet 1 - bottom left of Z80 */ |
| 719 | 719 | if ( !pc10_dog_di && !pc10_nmi_enable ) { |
| 720 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE ); | |
| 720 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE ); | |
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | else if ( pc10_nmi_enable ) |
| 724 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 724 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | static const struct NESinterface nes_interface = |
| r1591 | r1592 | |
|---|---|---|
| 34 | 34 | * |
| 35 | 35 | *************************************/ |
| 36 | 36 | |
| 37 | static void update_interrupts( | |
| 37 | static void update_interrupts(running_machine *machine) | |
| 38 | 38 | { |
| 39 | 39 | int newstate1 = 0; |
| 40 | 40 | int newstate2 = 0; |
| r1591 | r1592 | |
| 46 | 46 | newstate2 |= 1; |
| 47 | 47 | |
| 48 | 48 | if (newstate1) |
| 49 | cpunum_set_input_line(0, newstate1, ASSERT_LINE); | |
| 49 | cpunum_set_input_line(machine, 0, newstate1, ASSERT_LINE); | |
| 50 | 50 | else |
| 51 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 51 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 52 | 52 | |
| 53 | 53 | if (newstate2) |
| 54 | cpunum_set_input_line(2, newstate2, ASSERT_LINE); | |
| 54 | cpunum_set_input_line(machine, 2, newstate2, ASSERT_LINE); | |
| 55 | 55 | else |
| 56 | cpunum_set_input_line(2, 7, CLEAR_LINE); | |
| 56 | cpunum_set_input_line(machine, 2, 7, CLEAR_LINE); | |
| 57 | 57 | |
| 58 | 58 | /* check for screen swapping */ |
| 59 | 59 | temp = readinputport(2); |
| r1591 | r1592 | |
| 73 | 73 | cyberbal_sound_reset(); |
| 74 | 74 | |
| 75 | 75 | /* CPU 2 doesn't run until reset */ |
| 76 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 76 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 77 | 77 | |
| 78 | 78 | /* make sure we're pointing to the right screen by default */ |
| 79 | 79 | cyberbal_set_screen(0); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | static void cyberb2p_update_interrupts( | |
| 83 | static void cyberb2p_update_interrupts(running_machine *machine) | |
| 84 | 84 | { |
| 85 | 85 | int newstate = 0; |
| 86 | 86 | |
| r1591 | r1592 | |
| 90 | 90 | newstate |= 3; |
| 91 | 91 | |
| 92 | 92 | if (newstate) |
| 93 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 93 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 94 | 94 | else |
| 95 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 95 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| r1591 | r1592 | |
| 148 | 148 | |
| 149 | 149 | static WRITE16_HANDLER( p2_reset_w ) |
| 150 | 150 | { |
| 151 | cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 151 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 |
| r1591 | r1592 | |
|---|---|---|
| 279 | 279 | static INTERRUPT_GEN( lockon_irq ) |
| 280 | 280 | { |
| 281 | 281 | if(main_inten) |
| 282 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x60/4); | |
| 282 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x60/4); | |
| 283 | 283 | |
| 284 | 284 | // Ground CPU takes an interrupt on BUFEND - this is incorrect. |
| 285 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, 0x60/4); | |
| 285 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0x60/4); | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /* |
| r1591 | r1592 | |
| 308 | 308 | v30_obj_addr = (data & 0x18) >> 3; |
| 309 | 309 | |
| 310 | 310 | if (data & 0x04) |
| 311 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 311 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 312 | 312 | else |
| 313 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 313 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 314 | 314 | |
| 315 | 315 | if (data & 0x20) |
| 316 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 316 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE); | |
| 317 | 317 | else |
| 318 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 318 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE); | |
| 319 | 319 | |
| 320 | 320 | /* Suspend the Z80 when writing to shared RAM */ |
| 321 | 321 | if (data & 0x40) |
| 322 | cpunum_set_input_line(3, INPUT_LINE_HALT, CLEAR_LINE); | |
| 322 | cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE); | |
| 323 | 323 | else |
| 324 | cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE); | |
| 324 | cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, ASSERT_LINE); | |
| 325 | 325 | } |
| 326 | 326 | } |
| 327 | 327 | |
| r1591 | r1592 | |
| 564 | 564 | |
| 565 | 565 | static void YM2203_irq(int irq) |
| 566 | 566 | { |
| 567 | cpunum_set_input_line(3, 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 567 | cpunum_set_input_line(Machine, 3, 0, irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | static WRITE8_HANDLER(YM2203_out_b) |
| r1591 | r1592 | |
|---|---|---|
| 704 | 704 | case 0x00: /* INT ON 2 */ |
| 705 | 705 | cpu_interrupt_enable(1,bit); |
| 706 | 706 | if (!bit) |
| 707 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 707 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 708 | 708 | break; |
| 709 | 709 | |
| 710 | 710 | case 0x02: /* INT ON */ |
| 711 | 711 | cpu_interrupt_enable(0,bit); |
| 712 | 712 | if (!bit) |
| 713 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 713 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 714 | 714 | break; |
| 715 | 715 | |
| 716 | 716 | case 0x04: /* n.c. */ |
| r1591 | r1592 | |
| 726 | 726 | break; |
| 727 | 727 | |
| 728 | 728 | case 0x0a: /* SUB RESET */ |
| 729 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 729 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 730 | 730 | break; |
| 731 | 731 | |
| 732 | 732 | case 0x0c: /* n.c. */ |
| r1591 | r1592 | |
| 746 | 746 | case 0x00: |
| 747 | 747 | cpu_interrupt_enable(1,bit); |
| 748 | 748 | if (!bit) |
| 749 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 749 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 750 | 750 | break; |
| 751 | 751 | |
| 752 | 752 | case 0x02: |
| 753 | 753 | cpu_interrupt_enable(0,bit); |
| 754 | 754 | if (!bit) |
| 755 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 755 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 756 | 756 | break; |
| 757 | 757 | |
| 758 | 758 | case 0x04: |
| 759 | 759 | cpu_interrupt_enable(2,bit); |
| 760 | 760 | if (!bit) |
| 761 | cpunum_set_input_line(2, 0, CLEAR_LINE); | |
| 761 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); | |
| 762 | 762 | break; |
| 763 | 763 | |
| 764 | 764 | case 0x06: |
| r1591 | r1592 | |
| 771 | 771 | break; |
| 772 | 772 | |
| 773 | 773 | case 0x0a: |
| 774 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 774 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 775 | 775 | break; |
| 776 | 776 | |
| 777 | 777 | case 0x0c: |
| 778 | cpunum_set_input_line(2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 778 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 779 | 779 | break; |
| 780 | 780 | |
| 781 | 781 | case 0x0e: |
| r1591 | r1592 | |
| 792 | 792 | case 0x00: /* INT ON 2 */ |
| 793 | 793 | cpu_interrupt_enable(1,bit); |
| 794 | 794 | if (!bit) |
| 795 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 795 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 796 | 796 | break; |
| 797 | 797 | |
| 798 | 798 | case 0x02: /* INT ON */ |
| 799 | 799 | cpu_interrupt_enable(0,bit); |
| 800 | 800 | if (!bit) |
| 801 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 801 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 802 | 802 | break; |
| 803 | 803 | |
| 804 | 804 | case 0x04: /* FLIP */ |
| r1591 | r1592 | |
| 815 | 815 | break; |
| 816 | 816 | |
| 817 | 817 | case 0x0a: /* SUB RESET */ |
| 818 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 818 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 819 | 819 | break; |
| 820 | 820 | |
| 821 | 821 | case 0x0c: /* n.c. */ |
| r1591 | r1592 | |
| 856 | 856 | static INTERRUPT_GEN( mappy_interrupt_1 ) |
| 857 | 857 | { |
| 858 | 858 | irq0_line_assert(machine, cpunum); // this also checks if irq is enabled - IMPORTANT! |
| 859 | // so don't replace with cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 859 | // so don't replace with cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 860 | 860 | |
| 861 | 861 | namcoio_set_irq_line(0,PULSE_LINE); |
| 862 | 862 | namcoio_set_irq_line(1,PULSE_LINE); |
| r1591 | r1592 | |
| 2132 | 2132 | */ |
| 2133 | 2133 | memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0002, 0x0002, 0, 0, grobda_DAC_w ); |
| 2134 | 2134 | |
| 2135 | | |
| 2135 | DRIVER_INIT_CALL(58_56 | |
| 2136 | 2136 | } |
| 2137 | 2137 | |
| 2138 | 2138 | static DRIVER_INIT( digdug2 ) |
| 2139 | 2139 | { |
| 2140 | 2140 | /* appears to not use the watchdog */ |
| 2141 | 2141 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, MWA8_NOP); |
| 2142 | | |
| 2142 | DRIVER_INIT_CALL(58_56 | |
| 2143 | 2143 | } |
| 2144 | 2144 | |
| 2145 | 2145 |
| r1591 | r1592 | |
|---|---|---|
| 360 | 360 | /* handler called by the YM2151 emulator when the internal timers cause an IRQ */ |
| 361 | 361 | static void irqhandler(int irq) |
| 362 | 362 | { |
| 363 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 363 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 412 | 412 | static INTERRUPT_GEN( pntnpuzl_irq ) |
| 413 | 413 | { |
| 414 | 414 | if (readinputport(0) & 0x02) /* coin */ |
| 415 | cpunum_set_input_line(0, 1, PULSE_LINE); | |
| 415 | cpunum_set_input_line(machine, 0, 1, PULSE_LINE); | |
| 416 | 416 | else if (readinputport(0) & 0x04) /* service */ |
| 417 | cpunum_set_input_line(0, 2, PULSE_LINE); | |
| 417 | cpunum_set_input_line(machine, 0, 2, PULSE_LINE); | |
| 418 | 418 | else if (readinputport(0) & 0x08) /* coin */ |
| 419 | cpunum_set_input_line(0, 4, PULSE_LINE); | |
| 419 | cpunum_set_input_line(machine, 0, 4, PULSE_LINE); | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | static INPUT_PORTS_START( pntnpuzl ) |
| r1591 | r1592 | |
|---|---|---|
| 159 | 159 | static TIMER_CALLBACK( dmaend_callback ) |
| 160 | 160 | { |
| 161 | 161 | if (cur_control2 & 0x0020) |
| 162 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 162 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static INTERRUPT_GEN( gijoe_interrupt ) |
| r1591 | r1592 | |
| 177 | 177 | |
| 178 | 178 | // trigger V-blank interrupt |
| 179 | 179 | if (cur_control2 & 0x0080) |
| 180 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 180 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static WRITE16_HANDLER( sound_cmd_w ) |
| r1591 | r1592 | |
| 190 | 190 | |
| 191 | 191 | static WRITE16_HANDLER( sound_irq_w ) |
| 192 | 192 | { |
| 193 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 193 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | static READ16_HANDLER( sound_status_r ) |
| r1591 | r1592 | |
| 200 | 200 | |
| 201 | 201 | static void sound_nmi(void) |
| 202 | 202 | { |
| 203 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 203 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | static MACHINE_START( gijoe ) |
| r1591 | r1592 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | if ( diff & 0x40 ) |
| 42 | 42 | { |
| 43 | cpunum_set_input_line(0, INPUT_LINE_RESET, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 43 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // bit 3 - enable 752 Hz (D-3) square wave output |
| r1591 | r1592 | |
| 224 | 224 | |
| 225 | 225 | static DRIVER_INIT(uapce) |
| 226 | 226 | { |
| 227 | | |
| 227 | DRIVER_INIT_CALL(pc | |
| 228 | 228 | }; |
| 229 | 229 | |
| 230 | 230 | GAME( 1989, blazlaz, 0, uapce, uapce, uapce, ROT0, "Hudson Soft", "Blazing Lazers", GAME_IMPERFECT_SOUND ) |
| r1591 | r1592 | |
|---|---|---|
| 528 | 528 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 529 | 529 | static void irqhandler(int irq) |
| 530 | 530 | { |
| 531 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 531 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 217 | 217 | |
| 218 | 218 | static WRITE8_HANDLER( snd_irq_w ) |
| 219 | 219 | { |
| 220 | cpunum_set_input_line(1, 0, PULSE_LINE); | |
| 220 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 |
| r1591 | r1592 | |
|---|---|---|
| 174 | 174 | static int io9400; |
| 175 | 175 | static int io9401; |
| 176 | 176 | |
| 177 | static VIDEO_UPDATE( spaceg ) | |
| 178 | { | |
| 179 | copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0); | |
| 180 | ||
| 181 | return 0; | |
| 182 | } | |
| 183 | ||
| 184 | 177 | static PALETTE_INIT( spaceg ) |
| 185 | 178 | { |
| 186 | 179 | int i; |
| r1591 | r1592 | |
| 433 | 426 | MDRV_PALETTE_LENGTH(16+128-16) |
| 434 | 427 | MDRV_PALETTE_INIT( spaceg ) |
| 435 | 428 | MDRV_VIDEO_START(generic_bitmapped) |
| 436 | MDRV_VIDEO_UPDATE( | |
| 429 | MDRV_VIDEO_UPDATE( generic_bitmapped ) | |
| 437 | 430 | |
| 438 | 431 | /* sound hardware */ |
| 439 | 432 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r1591 | r1592 | |
|---|---|---|
| 304 | 304 | |
| 305 | 305 | static INTERRUPT_GEN( looping_interrupt ) |
| 306 | 306 | { |
| 307 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, 4); | |
| 307 | cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 4); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | |
| 311 | 311 | static WRITE8_HANDLER( level2_irq_set ) |
| 312 | 312 | { |
| 313 | 313 | if (!(data & 1)) |
| 314 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, 4); | |
| 314 | cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, 4); | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | |
| 318 | 318 | static WRITE8_HANDLER( main_irq_ack_w ) |
| 319 | 319 | { |
| 320 | 320 | if (data == 0) |
| 321 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 321 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | |
| 325 | 325 | static WRITE8_HANDLER( looping_souint_clr ) |
| 326 | 326 | { |
| 327 | 327 | if (data == 0) |
| 328 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 328 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | |
| 332 | 332 | static void looping_spcint(int state) |
| 333 | 333 | { |
| 334 | cpunum_set_input_line_and_vector(1, 0, state, 6); | |
| 334 | cpunum_set_input_line_and_vector(Machine, 1, 0, state, 6); | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | |
| 338 | 338 | static WRITE8_HANDLER( looping_soundlatch_w ) |
| 339 | 339 | { |
| 340 | 340 | soundlatch_w(offset, data); |
| 341 | cpunum_set_input_line_and_vector(1, 0, ASSERT_LINE, 4); | |
| 341 | cpunum_set_input_line_and_vector(Machine, 1, 0, ASSERT_LINE, 4); | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 |
| r1591 | r1592 | |
|---|---|---|
| 396 | 396 | v60_irq_timer[1] = timer_alloc(signal_v60_irq_callback, NULL); |
| 397 | 397 | |
| 398 | 398 | /* clear IRQ lines */ |
| 399 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 399 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | |
| r1591 | r1592 | |
| 417 | 417 | for (vector = 0; vector < 5; vector++) |
| 418 | 418 | if (effirq & (1 << vector)) |
| 419 | 419 | { |
| 420 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, vector); | |
| 420 | cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, vector); | |
| 421 | 421 | break; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | /* if we didn't find any, clear the interrupt line */ |
| 425 | 425 | if (vector == 5) |
| 426 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 426 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | |
| r1591 | r1592 | |
| 691 | 691 | case 0x1c/2: |
| 692 | 692 | system32_displayenable[which] = (data & 0x02); |
| 693 | 693 | if (which == 0) |
| 694 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 694 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 695 | 695 | break; |
| 696 | 696 | } |
| 697 | 697 | } |
| r1591 | r1592 | |
| 1036 | 1036 | for (vector = 0; vector < 3; vector++) |
| 1037 | 1037 | if (effirq & (1 << vector)) |
| 1038 | 1038 | { |
| 1039 | cpunum_set_input_line_and_vector(1, 0, ASSERT_LINE, 2 * vector); | |
| 1039 | cpunum_set_input_line_and_vector(Machine, 1, 0, ASSERT_LINE, 2 * vector); | |
| 1040 | 1040 | break; |
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | 1043 | /* if we didn't find any, clear the interrupt line */ |
| 1044 | 1044 | if (vector == 3) |
| 1045 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 1045 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 |
| r1591 | r1592 | |
|---|---|---|
| 118 | 118 | * |
| 119 | 119 | *************************************/ |
| 120 | 120 | |
| 121 | static void update_interrupts( | |
| 121 | static void update_interrupts(running_machine *machine) | |
| 122 | 122 | { |
| 123 | 123 | int newstate = 0; |
| 124 | 124 | |
| r1591 | r1592 | |
| 128 | 128 | newstate = 2; |
| 129 | 129 | |
| 130 | 130 | if (newstate) |
| 131 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 131 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 132 | 132 | else |
| 133 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 133 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 |
| r1591 | r1592 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | static TIMER_CALLBACK( kamikaze_int_off ) |
| 176 | 176 | { |
| 177 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 177 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
| 181 | 181 | static TIMER_CALLBACK( kamizake_int_gen ) |
| 182 | 182 | { |
| 183 | 183 | /* interrupts are asserted on every state change of the 128V line */ |
| 184 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 184 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 185 | 185 | param ^= 128; |
| 186 | 186 | timer_adjust(int_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_never); |
| 187 | 187 | |
| r1591 | r1592 | |
| 201 | 201 | static INTERRUPT_GEN( spaceint_interrupt ) |
| 202 | 202 | { |
| 203 | 203 | if (readinputport(2) & 1) /* coin */ |
| 204 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 204 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 205 | 205 | |
| 206 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 206 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 |
| r1591 | r1592 | |
|---|---|---|
| 413 | 413 | |
| 414 | 414 | static INTERRUPT_GEN(psikyosh_interrupt) |
| 415 | 415 | { |
| 416 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 416 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | static READ32_HANDLER(io32_r) |
| r1591 | r1592 | |
| 582 | 582 | static void irqhandler(int linestate) |
| 583 | 583 | { |
| 584 | 584 | if (linestate) |
| 585 | cpunum_set_input_line(0, 12, ASSERT_LINE); | |
| 585 | cpunum_set_input_line(Machine, 0, 12, ASSERT_LINE); | |
| 586 | 586 | else |
| 587 | cpunum_set_input_line(0, 12, CLEAR_LINE); | |
| 587 | cpunum_set_input_line(Machine, 0, 12, CLEAR_LINE); | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | static const struct YMF278B_interface ymf278b_interface = |
| r1591 | r1592 | |
|---|---|---|
| 51 | 51 | Driver by Bryan McPhail and David Haywood. |
| 52 | 52 | |
| 53 | 53 | Todo: |
| 54 | Sprite priorities aren't verified to be 100% accurate. | |
| 55 | There may be some kind of fullscreen palette effect (controlled by bit 3 in priority | |
| 56 | word - used at end of each level, and on final boss). | |
| 57 | A shadow effect (used in level 1) is not implemented. | |
| 54 | * Sprite priorities aren't verified to be 100% accurate. | |
| 55 | (Addendum - all known issues seem to be correct - see Sprite Priority Notes below). | |
| 56 | * There may be some kind of fullscreen palette effect (controlled by bit 3 in priority | |
| 57 | word - used at end of each level, and on final boss). | |
| 58 | * A shadow effect (used in level 1) is not implemented. | |
| 59 | ||
| 60 | Sprite Priority Notes: | |
| 61 | * On the Imperial Science Museum level at the beginning, you fly behind a wall, but your | |
| 62 | shots go in front of it. This is verified to be correct behavior by Guru. | |
| 63 | * There's a level where the player passes through several columns in a building and the | |
| 64 | player goes behind every 2nd one. That is correct as well. | |
| 65 | * There is a fire hydrant with an odd-looking spray of water on various levels. | |
| 66 | If you drop the hydrant in front of an enemy (a tank, for example), the priorities are | |
| 67 | wrong. This is actual PCB behavior. Also, the strange-looking water spray is correct. | |
| 68 | ||
| 69 | Alpha Blend Note: | |
| 70 | * There are semi-transparent round spots around your plane while fighting the final boss. | |
| 71 | These are correct. | |
| 72 | * The final boss shoots a blue beam downwards during the battle. This should have alpha. | |
| 73 | It fades in to blue, then fades out to nothing again after a few seconds (Guru). | |
| 74 | (Potentially related to note above about bit 3 in priority word) | |
| 58 | 75 | */ |
| 59 | 76 | |
| 60 | 77 | #include "driver.h" |
| r1591 | r1592 | |
| 267 | 284 | |
| 268 | 285 | static void sound_irq(int state) |
| 269 | 286 | { |
| 270 | cpunum_set_input_line(1,1,state); /* IRQ 2 */ | |
| 287 | cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */ | |
| 271 | 288 | } |
| 272 | 289 | |
| 273 | 290 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1591 | r1592 | |
|---|---|---|
| 152 | 152 | static INTERRUPT_GEN( supertnk_interrupt ) |
| 153 | 153 | { |
| 154 | 154 | /* On a TMS9980, a 6 on the interrupt bus means a level 4 interrupt */ |
| 155 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, 6); | |
| 155 | cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 6); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | static WRITE8_HANDLER( supertnk_interrupt_ack_w ) |
| 160 | 160 | { |
| 161 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 161 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 |
| r1591 | r1592 | |
|---|---|---|
| 590 | 590 | { |
| 591 | 591 | switch (cpu_getiloops()) |
| 592 | 592 | { |
| 593 | case 0: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 594 | case 1: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 595 | case 2: cpunum_set_input_line(0, 5, HOLD_LINE); break; | |
| 593 | case 0: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 594 | case 1: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 595 | case 2: cpunum_set_input_line(machine, 0, 5, HOLD_LINE); break; | |
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 |
| r1591 | r1592 | |
|---|---|---|
| 430 | 430 | switch (cpu_getiloops()) |
| 431 | 431 | { |
| 432 | 432 | case 0: |
| 433 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 433 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 434 | 434 | break; |
| 435 | 435 | default: |
| 436 | 436 | h8_3002_InterruptRequest(24); |
| r1591 | r1592 | |
|---|---|---|
| 41 | 41 | #include "cpu/z80/z80.h" |
| 42 | 42 | |
| 43 | 43 | |
| 44 | #define MASTER_CLOCK XTAL_18_432MHz | |
| 45 | #define SOUND_CLOCK XTAL_3_579545MHz | |
| 44 | 46 | |
| 47 | ||
| 48 | ||
| 49 | READ8_HANDLER( mpatrol_protection_r ); | |
| 45 | 50 | WRITE8_HANDLER( mpatrol_scroll_w ); |
| 46 | 51 | WRITE8_HANDLER( mpatrol_bg1xpos_w ); |
| 47 | 52 | WRITE8_HANDLER( mpatrol_bg1ypos_w ); |
| r1591 | r1592 | |
| 58 | 63 | |
| 59 | 64 | |
| 60 | 65 | |
| 61 | /* this looks like some kind of protection. The game does strange things */ | |
| 62 | /* if a read from this address doesn't return the value it expects. */ | |
| 63 | static READ8_HANDLER( mpatrol_protection_r ) | |
| 66 | static CUSTOM_INPUT( coin_mode ) | |
| 64 | 67 | { |
| 65 | return activecpu_get_reg(Z80_DE) & 0xff; | |
| 66 | } | |
| 67 | ||
| 68 | ||
| 69 | static READ8_HANDLER( mpatrol_input_port_3_r ) | |
| 70 | { | |
| 71 | int ret = input_port_3_r(0); | |
| 72 | ||
| 73 | 68 | /* Based on the coin mode fill in the upper bits */ |
| 74 | if (input_port_4_r(0) & 0x04) | |
| 75 | { | |
| 76 | /* Mode 1 */ | |
| 77 | ret |= (input_port_5_r(0) << 4); | |
| 78 | } | |
| 79 | else | |
| 80 | { | |
| 81 | /* Mode 2 */ | |
| 82 | ret |= (input_port_5_r(0) & 0xf0); | |
| 83 | } | |
| 84 | ||
| 85 | return ret; | |
| 69 | UINT8 port5 = readinputport(5); | |
| 70 | return (readinputport(4) & 0x04) ? (port5 & 0x0f) : (port5 >> 4); | |
| 86 | 71 | } |
| 87 | 72 | |
| 88 | 73 | |
| 89 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 90 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM) | |
| 91 | AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) | |
| 92 | AM_RANGE(0x8800, 0x8800) AM_READ(mpatrol_protection_r) | |
| 93 | AM_RANGE(0xd000, 0xd000) AM_READ(input_port_0_r) /* IN0 */ | |
| 94 | AM_RANGE(0xd001, 0xd001) AM_READ(input_port_1_r) /* IN1 */ | |
| 95 | AM_RANGE(0xd002, 0xd002) AM_READ(input_port_2_r) /* IN2 */ | |
| 96 | AM_RANGE(0xd003, 0xd003) AM_READ(mpatrol_input_port_3_r) /* DSW1 */ | |
| 97 | AM_RANGE(0xd004, 0xd004) AM_READ(input_port_4_r) /* DSW2 */ | |
| 98 | AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM) | |
| 99 | ADDRESS_MAP_END | |
| 100 | 74 | |
| 101 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 102 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 103 | AM_RANGE(0x8000, 0x83ff) AM_WRITE(mpatrol_videoram_w) AM_BASE(&videoram) | |
| 104 | AM_RANGE(0x8400, 0x87ff) AM_WRITE(mpatrol_colorram_w) AM_BASE(&colorram) | |
| 105 | AM_RANGE(0xc800, 0xc8ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 106 | AM_RANGE(0xd000, 0xd000) AM_WRITE(irem_sound_cmd_w) | |
| 107 | AM_RANGE(0xd001, 0xd001) AM_WRITE(mpatrol_flipscreen_w) /* + coin counters */ | |
| 108 | AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM) | |
| 109 | ADDRESS_MAP_END | |
| 75 | /************************************* | |
| 76 | * | |
| 77 | * Memory maps | |
| 78 | * | |
| 79 | *************************************/ | |
| 110 | 80 | |
| 111 | static ADDRESS_MAP_START( readmem_alpha1v, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 112 | AM_RANGE(0x0000, 0x6fff) AM_READ(MRA8_ROM) | |
| 113 | AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) | |
| 114 | AM_RANGE(0x8800, 0x8800) AM_READ(mpatrol_protection_r) | |
| 115 | AM_RANGE(0xd000, 0xd000) AM_READ(input_port_0_r) /* IN0 */ | |
| 116 | AM_RANGE(0xd001, 0xd001) AM_READ(input_port_1_r) /* IN1 */ | |
| 117 | AM_RANGE(0xd002, 0xd002) AM_READ(input_port_2_r) /* IN2 */ | |
| 118 | AM_RANGE(0xd003, 0xd003) AM_READ(mpatrol_input_port_3_r) /* DSW1 */ | |
| 119 | AM_RANGE(0xd004, 0xd004) AM_READ(input_port_4_r) /* DSW2 */ | |
| 120 | AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM) | |
| 81 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 82 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 83 | AM_RANGE(0x8000, 0x83ff) AM_READWRITE(MRA8_RAM, mpatrol_videoram_w) AM_BASE(&videoram) | |
| 84 | AM_RANGE(0x8400, 0x87ff) AM_READWRITE(MRA8_RAM, mpatrol_colorram_w) AM_BASE(&colorram) | |
| 85 | AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_READ(mpatrol_protection_r) | |
| 86 | AM_RANGE(0xc800, 0xcbff) AM_MIRROR(0x0400) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 87 | AM_RANGE(0xd000, 0xd000) AM_MIRROR(0x07fc) AM_WRITE(irem_sound_cmd_w) | |
| 88 | AM_RANGE(0xd001, 0xd001) AM_MIRROR(0x07fc) AM_WRITE(mpatrol_flipscreen_w) /* + coin counters */ | |
| 89 | AM_RANGE(0xd000, 0xd000) AM_MIRROR(0x07f8) AM_READ_PORT("IN0") | |
| 90 | AM_RANGE(0xd001, 0xd001) AM_MIRROR(0x07f8) AM_READ_PORT("IN1") | |
| 91 | AM_RANGE(0xd002, 0xd002) AM_MIRROR(0x07f8) AM_READ_PORT("IN2") | |
| 92 | AM_RANGE(0xd003, 0xd003) AM_MIRROR(0x07f8) AM_READ_PORT("DSW0") | |
| 93 | AM_RANGE(0xd004, 0xd004) AM_MIRROR(0x07f8) AM_READ_PORT("DSW1") | |
| 94 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 121 | 95 | ADDRESS_MAP_END |
| 122 | 96 | |
| 123 | static ADDRESS_MAP_START( writemem_alpha1v, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 124 | AM_RANGE(0x0000, 0x6fff) AM_WRITE(MWA8_ROM) | |
| 125 | AM_RANGE(0x8000, 0x83ff) AM_WRITE(mpatrol_videoram_w) AM_BASE(&videoram) | |
| 126 | AM_RANGE(0x8400, 0x87ff) AM_WRITE(mpatrol_colorram_w) AM_BASE(&colorram) | |
| 97 | ||
| 98 | static ADDRESS_MAP_START( alpha1v_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 99 | AM_RANGE(0x0000, 0x6fff) AM_ROM | |
| 100 | AM_RANGE(0x8000, 0x83ff) AM_READWRITE(MRA8_RAM, mpatrol_videoram_w) AM_BASE(&videoram) | |
| 101 | AM_RANGE(0x8400, 0x87ff) AM_READWRITE(MRA8_RAM, mpatrol_colorram_w) AM_BASE(&colorram) | |
| 127 | 102 | AM_RANGE(0xc800, 0xc9ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) AM_SHARE(1) // bigger or mirrored? |
| 128 | AM_RANGE(0xd000, 0xd000) AM_WRITE(irem_sound_cmd_w) | |
| 129 | AM_RANGE(0xd001, 0xd001) AM_WRITE(mpatrol_flipscreen_w) /* + coin counters */ | |
| 130 | AM_RANGE(0xe000, 0xefff) AM_WRITE(MWA8_RAM) // bigger or mirrored? | |
| 103 | AM_RANGE(0xd000, 0xd000) AM_READ_PORT("IN0") AM_WRITE(irem_sound_cmd_w) | |
| 104 | AM_RANGE(0xd001, 0xd001) AM_READ_PORT("IN1") AM_WRITE(mpatrol_flipscreen_w) /* + coin counters */ | |
| 105 | AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN2") | |
| 106 | AM_RANGE(0xd003, 0xd003) AM_READ_PORT("DSW0") | |
| 107 | AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW1") | |
| 108 | AM_RANGE(0xe000, 0xefff) AM_RAM // bigger or mirrored? | |
| 131 | 109 | ADDRESS_MAP_END |
| 132 | 110 | |
| 133 | 111 | |
| 134 | ||
| 135 | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) | |
| 112 | static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 136 | 113 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 137 | AM_RANGE(0x10, 0x1f) AM_WRITE(mpatrol_scroll_w) | |
| 138 | AM_RANGE(0x40, 0x40) AM_WRITE(mpatrol_bg1xpos_w) | |
| 139 | AM_RANGE(0x60, 0x60) AM_WRITE(mpatrol_bg1ypos_w) | |
| 140 | AM_RANGE(0x80, 0x80) AM_WRITE(mpatrol_bg2xpos_w) | |
| 141 | AM_RANGE(0xa0, 0xa0) AM_WRITE(mpatrol_bg2ypos_w) | |
| 142 | AM_RANGE(0xc0, 0xc0) AM_WRITE(mpatrol_bgcontrol_w) | |
| 114 | AM_RANGE(0x00, 0x00) AM_MIRROR(0x1f) AM_WRITE(mpatrol_scroll_w) | |
| 115 | AM_RANGE(0x40, 0x40) AM_MIRROR(0x1f) AM_WRITE(mpatrol_bg1xpos_w) | |
| 116 | AM_RANGE(0x60, 0x60) AM_MIRROR(0x1f) AM_WRITE(mpatrol_bg1ypos_w) | |
| 117 | AM_RANGE(0x80, 0x80) AM_MIRROR(0x1f) AM_WRITE(mpatrol_bg2xpos_w) | |
| 118 | AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1f) AM_WRITE(mpatrol_bg2ypos_w) | |
| 119 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_WRITE(mpatrol_bgcontrol_w) | |
| 143 | 120 | ADDRESS_MAP_END |
| 144 | 121 | |
| 145 | #define MPATROL_COMMON\ | |
| 146 | PORT_START_TAG("IN0")\ | |
| 147 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )\ | |
| 148 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )\ | |
| 149 | /* coin input must be active for ? frames to be consistently recognized */\ | |
| 150 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(17)\ | |
| 151 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )\ | |
| 152 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 153 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 154 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 155 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 156 | PORT_START_TAG("IN1")\ | |
| 157 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY\ | |
| 158 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY\ | |
| 159 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 160 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 161 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 162 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )\ | |
| 163 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 164 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )\ | |
| 165 | PORT_START_TAG("IN2")\ | |
| 166 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL\ | |
| 167 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL\ | |
| 168 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 169 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 170 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )\ | |
| 171 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL\ | |
| 172 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )\ | |
| 173 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 174 | 122 | |
| 175 | #define MPATROL_COMMON2\ | |
| 176 | PORT_START_TAG("DSW1")\ | |
| 177 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )\ | |
| 178 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) )\ | |
| 179 | PORT_DIPSETTING( 0x00, DEF_STR( On ) )\ | |
| 180 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )\ | |
| 181 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )\ | |
| 182 | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) )\ | |
| 183 | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" )\ | |
| 184 | PORT_DIPSETTING( 0x04, "Mode 1" )\ | |
| 185 | PORT_DIPSETTING( 0x00, "Mode 2" )\ | |
| 186 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )\ | |
| 187 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) )\ | |
| 188 | PORT_DIPSETTING( 0x00, DEF_STR( On ) )\ | |
| 189 | /* In stop mode, press 2 to stop and 1 to restart */\ | |
| 190 | PORT_DIPNAME( 0x10, 0x10, "Stop Mode (Cheat)")\ | |
| 191 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) )\ | |
| 192 | PORT_DIPSETTING( 0x00, DEF_STR( On ) )\ | |
| 193 | PORT_DIPNAME( 0x20, 0x20, "Sector Selection (Cheat)")\ | |
| 194 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) )\ | |
| 195 | PORT_DIPSETTING( 0x00, DEF_STR( On ) )\ | |
| 196 | PORT_DIPNAME( 0x40, 0x40, "Invulnerability (Cheat)")\ | |
| 197 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) )\ | |
| 198 | PORT_DIPSETTING( 0x00, DEF_STR( On ) )\ | |
| 199 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW )\ | |
| 200 | /* Fake port to support the two different coin modes */\ | |
| 201 | PORT_START_TAG("FAKE")\ | |
| 202 | PORT_DIPNAME( 0x0f, 0x0f, "Coinage Mode 1" ) /* mapped on coin mode 1 */\ | |
| 203 | PORT_DIPSETTING( 0x09, DEF_STR( 7C_1C ) )\ | |
| 204 | PORT_DIPSETTING( 0x0a, DEF_STR( 6C_1C ) )\ | |
| 205 | PORT_DIPSETTING( 0x0b, DEF_STR( 5C_1C ) )\ | |
| 206 | PORT_DIPSETTING( 0x0c, DEF_STR( 4C_1C ) )\ | |
| 207 | PORT_DIPSETTING( 0x0d, DEF_STR( 3C_1C ) )\ | |
| 208 | PORT_DIPSETTING( 0x0e, DEF_STR( 2C_1C ) )\ | |
| 209 | PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) )\ | |
| 210 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_2C ) )\ | |
| 211 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_3C ) )\ | |
| 212 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_4C ) )\ | |
| 213 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) )\ | |
| 214 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_6C ) )\ | |
| 215 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_7C ) )\ | |
| 216 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_8C ) )\ | |
| 217 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )\ | |
| 218 | PORT_DIPNAME( 0x30, 0x30, "Coin A Mode 2" ) /* mapped on coin mode 2 */\ | |
| 219 | PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) )\ | |
| 220 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) )\ | |
| 221 | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )\ | |
| 222 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )\ | |
| 223 | PORT_DIPNAME( 0xc0, 0xc0, "Coin B Mode 2" )\ | |
| 224 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) )\ | |
| 225 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) )\ | |
| 226 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) )\ | |
| 227 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) | |
| 228 | 123 | |
| 124 | /************************************* | |
| 125 | * | |
| 126 | * Port definitions | |
| 127 | * | |
| 128 | *************************************/ | |
| 129 | ||
| 229 | 130 | static INPUT_PORTS_START( mpatrol ) |
| 230 | MPATROL_COMMON | |
| 131 | PORT_START_TAG("IN0") | |
| 132 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 133 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 134 | /* coin input must be active for ? frames to be consistently recognized */ | |
| 135 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(17) | |
| 136 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 137 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 231 | 138 | |
| 139 | PORT_START_TAG("IN1") | |
| 140 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 141 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY | |
| 142 | PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 143 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 144 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 145 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 146 | ||
| 147 | PORT_START_TAG("IN2") | |
| 148 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL | |
| 149 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL | |
| 150 | PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 151 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 152 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 153 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 154 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 155 | ||
| 232 | 156 | PORT_START_TAG("DSW0") |
| 233 | 157 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) |
| 234 | 158 | PORT_DIPSETTING( 0x00, "1" ) |
| r1591 | r1592 | |
| 240 | 164 | PORT_DIPSETTING( 0x08, "20000 40000 60000" ) |
| 241 | 165 | PORT_DIPSETTING( 0x04, "10000" ) |
| 242 | 166 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 243 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Gets filled in based on the coin mode */ | |
| 167 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(coin_mode, NULL) | |
| 168 | /* Gets filled in based on the coin mode */ | |
| 244 | 169 | |
| 245 | MPATROL_COMMON2 | |
| 170 | PORT_START_TAG("DSW1") | |
| 171 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) | |
| 172 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 173 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 174 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) | |
| 175 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 176 | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) | |
| 177 | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) | |
| 178 | PORT_DIPSETTING( 0x04, "Mode 1" ) | |
| 179 | PORT_DIPSETTING( 0x00, "Mode 2" ) | |
| 180 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 181 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 182 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 183 | /* In stop mode, press 2 to stop and 1 to restart */ | |
| 184 | PORT_DIPNAME( 0x10, 0x10, "Stop Mode (Cheat)") | |
| 185 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 186 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 187 | PORT_DIPNAME( 0x20, 0x20, "Sector Selection (Cheat)") | |
| 188 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 189 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 190 | PORT_DIPNAME( 0x40, 0x40, "Invulnerability (Cheat)") | |
| 191 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 192 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 193 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 194 | ||
| 195 | /* Fake port to support the two different coin modes */ | |
| 196 | PORT_START_TAG("FAKE") | |
| 197 | PORT_DIPNAME( 0x0f, 0x0f, "Coinage Mode 1" ) /* mapped on coin mode 1 */ | |
| 198 | PORT_DIPSETTING( 0x09, DEF_STR( 7C_1C ) ) | |
| 199 | PORT_DIPSETTING( 0x0a, DEF_STR( 6C_1C ) ) | |
| 200 | PORT_DIPSETTING( 0x0b, DEF_STR( 5C_1C ) ) | |
| 201 | PORT_DIPSETTING( 0x0c, DEF_STR( 4C_1C ) ) | |
| 202 | PORT_DIPSETTING( 0x0d, DEF_STR( 3C_1C ) ) | |
| 203 | PORT_DIPSETTING( 0x0e, DEF_STR( 2C_1C ) ) | |
| 204 | PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) | |
| 205 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_2C ) ) | |
| 206 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_3C ) ) | |
| 207 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_4C ) ) | |
| 208 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) | |
| 209 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_6C ) ) | |
| 210 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_7C ) ) | |
| 211 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_8C ) ) | |
| 212 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 213 | PORT_DIPNAME( 0x30, 0x30, "Coin A Mode 2" ) /* mapped on coin mode 2 */ | |
| 214 | PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) | |
| 215 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 216 | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) | |
| 217 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 218 | PORT_DIPNAME( 0xc0, 0xc0, "Coin B Mode 2" ) | |
| 219 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 220 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) | |
| 221 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) | |
| 222 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) | |
| 246 | 223 | INPUT_PORTS_END |
| 247 | 224 | |
| 248 | ||
| 225 | ||
| 249 | 226 | static INPUT_PORTS_START( mpatrolw ) |
| 250 | ||
| 227 | P | |
| 251 | 228 | |
| 252 | PORT_ | |
| 229 | PORT_MODIFY | |
| 253 | 230 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) |
| 254 | 231 | PORT_DIPSETTING( 0x00, "2" ) |
| 255 | 232 | PORT_DIPSETTING( 0x01, "3" ) |
| 256 | 233 | PORT_DIPSETTING( 0x02, "4" ) |
| 257 | 234 | PORT_DIPSETTING( 0x03, "5" ) |
| 258 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) | |
| 259 | PORT_DIPSETTING( 0x0c, "10000 30000 50000" ) | |
| 260 | PORT_DIPSETTING( 0x08, "20000 40000 60000" ) | |
| 261 | PORT_DIPSETTING( 0x04, "10000" ) | |
| 262 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 263 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Gets filled in based on the coin mode */ | |
| 264 | ||
| 265 | MPATROL_COMMON2 | |
| 266 | 235 | INPUT_PORTS_END |
| 267 | 236 | |
| 268 | 237 | |
| 269 | 238 | static INPUT_PORTS_START( alpha1v ) |
| 270 | PORT_START_TAG("IN0")\ | |
| 271 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 272 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 273 | /* coin input must be active for ? frames to be consistently recognized */ | |
| 274 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(17) | |
| 275 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 276 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 277 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 278 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 279 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 239 | PORT_INCLUDE(mpatrol) | |
| 280 | 240 | |
| 281 | PORT_ | |
| 241 | PORT_MODIFY | |
| 282 | 242 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) |
| 283 | 243 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) |
| 284 | 244 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) |
| 285 | 245 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) |
| 286 | 246 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 287 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 288 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 289 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 290 | 247 | |
| 291 | PORT_ | |
| 248 | PORT_MODIFY | |
| 292 | 249 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL |
| 293 | 250 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL |
| 294 | 251 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL |
| 295 | 252 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL |
| 296 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 297 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 298 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 299 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 300 | 253 | |
| 301 | PORT_ | |
| 254 | PORT_MODIFY | |
| 302 | 255 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) |
| 303 | 256 | PORT_DIPSETTING( 0x00, "2" ) |
| 304 | 257 | PORT_DIPSETTING( 0x01, "3" ) |
| 305 | 258 | PORT_DIPSETTING( 0x02, "4" ) |
| 306 | 259 | PORT_DIPSETTING( 0x03, "5" ) |
| 307 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) | |
| 308 | PORT_DIPSETTING( 0x0c, "10000 30000 50000" ) | |
| 309 | PORT_DIPSETTING( 0x08, "20000 40000 60000" ) | |
| 310 | PORT_DIPSETTING( 0x04, "10000" ) | |
| 311 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 312 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Gets filled in based on the coin mode */ | |
| 313 | ||
| 314 | MPATROL_COMMON2 | |
| 315 | 260 | INPUT_PORTS_END |
| 316 | 261 | |
| 262 | ||
| 263 | ||
| 264 | /************************************* | |
| 265 | * | |
| 266 | * Graphics layouts | |
| 267 | * | |
| 268 | *************************************/ | |
| 269 | ||
| 317 | 270 | static const gfx_layout charlayout = |
| 318 | 271 | { |
| 319 | 8,8, /* 8*8 characters */ | |
| 320 | 512, /* 512 characters */ | |
| 321 | 2, /* 2 bits per pixel */ | |
| 322 | { 0, 512*8*8 }, /* the two bitplanes are separated */ | |
| 272 | 8,8, | |
| 273 | RGN_FRAC(1,2), | |
| 274 | 2, | |
| 275 | { RGN_FRAC(0,2), RGN_FRAC(1,2) }, | |
| 323 | 276 | { STEP8(0,1) }, |
| 324 | 277 | { STEP8(0,8) }, |
| 325 | 8*8 | |
| 278 | 8*8 | |
| 326 | 279 | }; |
| 280 | ||
| 327 | 281 | static const gfx_layout spritelayout = |
| 328 | 282 | { |
| 329 | 16,16, /* 16*16 sprites */ | |
| 330 | 128, /* 128 sprites */ | |
| 331 | 2, /* 2 bits per pixel */ | |
| 332 | { 0, 128*16*16 }, /* the two bitplanes are separated */ | |
| 283 | 16,16, | |
| 284 | RGN_FRAC(1,2), | |
| 285 | 2, | |
| 286 | { RGN_FRAC(0,2), RGN_FRAC(1,2) }, | |
| 333 | 287 | { STEP8(0,1), STEP8(16*8,1) }, |
| 334 | 288 | { STEP16(0,8) }, |
| 335 | 32*8 | |
| 289 | 32*8 | |
| 336 | 290 | }; |
| 337 | 291 | |
| 338 | 292 | static const UINT32 bgcharlayout_xoffset[256] = |
| 339 | 293 | { |
| 340 | STEP4(0x000,1), STEP4(0x008,1), | |
| 341 | STEP4(0x010,1), STEP4(0x018,1), | |
| 342 | STEP4(0x020,1), STEP4(0x028,1), | |
| 343 | STEP4(0x030,1), STEP4(0x038,1), | |
| 344 | STEP4(0x040,1), STEP4(0x048,1), | |
| 345 | STEP4(0x050,1), STEP4(0x058,1), | |
| 346 | STEP4(0x060,1), STEP4(0x068,1), | |
| 347 | STEP4(0x070,1), STEP4(0x078,1), | |
| 348 | STEP4(0x080,1), STEP4(0x088,1), | |
| 349 | STEP4(0x090,1), STEP4(0x098,1), | |
| 350 | STEP4(0x0a0,1), STEP4(0x0a8,1), | |
| 351 | STEP4(0x0b0,1), STEP4(0x0b8,1), | |
| 352 | STEP4(0x0c0,1), STEP4(0x0c8,1), | |
| 353 | STEP4(0x0d0,1), STEP4(0x0d8,1), | |
| 354 | STEP4(0x0e0,1), STEP4(0x0e8,1), | |
| 355 | STEP4(0x0f0,1), STEP4(0x0f8,1), | |
| 356 | STEP4(0x100,1), STEP4(0x108,1), | |
| 357 | STEP4(0x110,1), STEP4(0x118,1), | |
| 358 | STEP4(0x120,1), STEP4(0x128,1), | |
| 359 | STEP4(0x130,1), STEP4(0x138,1), | |
| 360 | STEP4(0x140,1), STEP4(0x148,1), | |
| 361 | STEP4(0x150,1), STEP4(0x158,1), | |
| 362 | STEP4(0x160,1), STEP4(0x168,1), | |
| 363 | STEP4(0x170,1), STEP4(0x178,1), | |
| 364 | STEP4(0x180,1), STEP4(0x188,1), | |
| 365 | STEP4(0x190,1), STEP4(0x198,1), | |
| 366 | STEP4(0x1a0,1), STEP4(0x1a8,1), | |
| 367 | STEP4(0x1b0,1), STEP4(0x1b8,1), | |
| 368 | STEP4(0x1c0,1), STEP4(0x1c8,1), | |
| 369 | STEP4(0x1d0,1), STEP4(0x1d8,1), | |
| 370 | STEP4(0x1e0,1), STEP4(0x1e8,1), | |
| 371 | STEP4(0x1f0,1), STEP4(0x1f8,1) | |
| 294 | STEP4(0x000,1), STEP4(0x008,1), STEP4(0x010,1), STEP4(0x018,1), | |
| 295 | STEP4(0x020,1), STEP4(0x028,1), STEP4(0x030,1), STEP4(0x038,1), | |
| 296 | STEP4(0x040,1), STEP4(0x048,1), STEP4(0x050,1), STEP4(0x058,1), | |
| 297 | STEP4(0x060,1), STEP4(0x068,1), STEP4(0x070,1), STEP4(0x078,1), | |
| 298 | STEP4(0x080,1), STEP4(0x088,1), STEP4(0x090,1), STEP4(0x098,1), | |
| 299 | STEP4(0x0a0,1), STEP4(0x0a8,1), STEP4(0x0b0,1), STEP4(0x0b8,1), | |
| 300 | STEP4(0x0c0,1), STEP4(0x0c8,1), STEP4(0x0d0,1), STEP4(0x0d8,1), | |
| 301 | STEP4(0x0e0,1), STEP4(0x0e8,1), STEP4(0x0f0,1), STEP4(0x0f8,1), | |
| 302 | STEP4(0x100,1), STEP4(0x108,1), STEP4(0x110,1), STEP4(0x118,1), | |
| 303 | STEP4(0x120,1), STEP4(0x128,1), STEP4(0x130,1), STEP4(0x138,1), | |
| 304 | STEP4(0x140,1), STEP4(0x148,1), STEP4(0x150,1), STEP4(0x158,1), | |
| 305 | STEP4(0x160,1), STEP4(0x168,1), STEP4(0x170,1), STEP4(0x178,1), | |
| 306 | STEP4(0x180,1), STEP4(0x188,1), STEP4(0x190,1), STEP4(0x198,1), | |
| 307 | STEP4(0x1a0,1), STEP4(0x1a8,1), STEP4(0x1b0,1), STEP4(0x1b8,1), | |
| 308 | STEP4(0x1c0,1), STEP4(0x1c8,1), STEP4(0x1d0,1), STEP4(0x1d8,1), | |
| 309 | STEP4(0x1e0,1), STEP4(0x1e8,1), STEP4(0x1f0,1), STEP4(0x1f8,1) | |
| 372 | 310 | }; |
| 373 | 311 | |
| 374 | 312 | static const UINT32 bgcharlayout_yoffset[64] = |
| 375 | 313 | { |
| 376 | STEP32(0x0000,0x200), | |
| 377 | STEP32(0x4000,0x200) | |
| 314 | STEP32(0x0000,0x200), STEP32(0x4000,0x200) | |
| 378 | 315 | }; |
| 379 | 316 | |
| 380 | 317 | static const gfx_layout bgcharlayout = |
| r1591 | r1592 | |
| 391 | 328 | }; |
| 392 | 329 | |
| 393 | 330 | |
| 394 | ||
| 395 | 331 | static GFXDECODE_START( mpatrol ) |
| 396 | 332 | GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 128 ) |
| 397 | 333 | GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 128*4, 16 ) |
| r1591 | r1592 | |
| 402 | 338 | |
| 403 | 339 | |
| 404 | 340 | |
| 341 | /************************************* | |
| 342 | * | |
| 343 | * Machine drivers | |
| 344 | * | |
| 345 | *************************************/ | |
| 346 | ||
| 405 | 347 | static MACHINE_DRIVER_START( mpatrol ) |
| 406 | 348 | |
| 407 | 349 | /* basic machine hardware */ |
| 408 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz ? */ | |
| 409 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 410 | MDRV_CPU_IO_MAP(0,writeport) | |
| 350 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/6) | |
| 351 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 352 | MDRV_CPU_IO_MAP(main_portmap,0) | |
| 411 | 353 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 412 | 354 | |
| 413 | MDRV_SCREEN_REFRESH_RATE(57) | |
| 414 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1790) /* accurate frequency, measured on a real board, is 56.75Hz. */) | |
| 415 | /* the Lode Runner manual (similar but different hardware) */ | |
| 416 | /* talks about 55Hz and 1790ms vblank duration. */ | |
| 417 | ||
| 418 | 355 | /* video hardware */ |
| 419 | 356 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 420 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 421 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 422 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 32*8-1) | |
| 423 | 357 | MDRV_GFXDECODE(mpatrol) |
| 424 | 358 | MDRV_PALETTE_LENGTH(512+32+32) |
| 425 | 359 | MDRV_COLORTABLE_LENGTH(128*4+16*4+3*4) |
| 426 | 360 | |
| 361 | MDRV_SCREEN_ADD("main", 0) | |
| 362 | MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 136, 376, 282, 22, 274) | |
| 363 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 364 | ||
| 427 | 365 | MDRV_PALETTE_INIT(mpatrol) |
| 428 | 366 | MDRV_VIDEO_START(mpatrol) |
| 429 | 367 | MDRV_VIDEO_UPDATE(mpatrol) |
| r1591 | r1592 | |
| 434 | 372 | |
| 435 | 373 | |
| 436 | 374 | static MACHINE_DRIVER_START( alpha1v ) |
| 375 | MDRV_IMPORT_FROM(mpatrol) | |
| 437 | 376 | |
| 438 | 377 | /* basic machine hardware */ |
| 439 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz ? */ | |
| 440 | MDRV_CPU_PROGRAM_MAP(readmem_alpha1v,writemem_alpha1v) | |
| 441 | MDRV_CPU_IO_MAP(0,writeport) | |
| 442 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 443 | ||
| 444 | MDRV_SCREEN_REFRESH_RATE(57) | |
| 445 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1790) /* accurate frequency, measured on a real board, is 56.75Hz. */) | |
| 446 | /* the Lode Runner manual (similar but different hardware) */ | |
| 447 | /* talks about 55Hz and 1790ms vblank duration. */ | |
| 448 | ||
| 449 | /* video hardware */ | |
| 450 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 451 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 452 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 453 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 32*8-1) | |
| 454 | // MDRV_GFXDECODE(alpha1v) | |
| 455 | MDRV_GFXDECODE(mpatrol) | |
| 456 | MDRV_PALETTE_LENGTH(512+32+32) | |
| 457 | MDRV_COLORTABLE_LENGTH(128*4+16*4+3*4) | |
| 458 | ||
| 459 | MDRV_PALETTE_INIT(mpatrol) | |
| 460 | MDRV_VIDEO_START(mpatrol) | |
| 461 | MDRV_VIDEO_UPDATE(mpatrol) | |
| 462 | ||
| 463 | /* sound hardware */ | |
| 464 | MDRV_IMPORT_FROM(irem_audio) | |
| 378 | MDRV_CPU_MODIFY("main") | |
| 379 | MDRV_CPU_PROGRAM_MAP(alpha1v_map,0) | |
| 465 | 380 | MACHINE_DRIVER_END |
| 466 | 381 | |
| 467 | 382 | |
| 468 | 383 | |
| 469 | /*************************************************************************** | |
| 384 | /************************************* | |
| 385 | * | |
| 386 | * ROM definitions | |
| 387 | * | |
| 388 | *************************************/ | |
| 470 | 389 | |
| 471 | Game driver(s) | |
| 472 | ||
| 473 | ***************************************************************************/ | |
| 474 | ||
| 475 | 390 | ROM_START( mpatrol ) |
| 476 | 391 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 477 | 392 | ROM_LOAD( "mpa-1.3m", 0x0000, 0x1000, CRC(5873a860) SHA1(8c03726d6e049c3edbc277440184e31679f78258) ) |
| r1591 | r1592 | |
| 583 | 498 | |
| 584 | 499 | |
| 585 | 500 | |
| 586 | GAME( 1982, mpatrol, 0, mpatrol, mpatrol, 0, ROT0, "Irem", "Moon Patrol", 0 ) | |
| 587 | GAME( 1982, mpatrolw, mpatrol, mpatrol, mpatrolw, 0, ROT0, "Irem (Williams license)", "Moon Patrol (Williams)", 0 ) | |
| 501 | /************************************* | |
| 502 | * | |
| 503 | * Game drivers | |
| 504 | * | |
| 505 | *************************************/ | |
| 506 | ||
| 507 | GAME( 1982, mpatrol, 0, mpatrol, mpatrol, 0, ROT0, "Irem", "Moon Patrol", GAME_SUPPORTS_SAVE ) | |
| 508 | GAME( 1982, mpatrolw, mpatrol, mpatrol, mpatrolw, 0, ROT0, "Irem (Williams license)", "Moon Patrol (Williams)", GAME_SUPPORTS_SAVE ) | |
| 588 | 509 | GAME( 1988, alpha1v, 0, alpha1v, alpha1v, 0, ROT0, "Vision Electronics", "Alpha One (Vision Electronics / Kyle Hodgetts)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | * |
| 31 | 31 | *************************************/ |
| 32 | 32 | |
| 33 | static void update_interrupts( | |
| 33 | static void update_interrupts(running_machine *machine) | |
| 34 | 34 | { |
| 35 | 35 | int newstate = 0; |
| 36 | 36 | |
| r1591 | r1592 | |
| 40 | 40 | newstate = 6; |
| 41 | 41 | |
| 42 | 42 | if (newstate) |
| 43 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 43 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 44 | 44 | else |
| 45 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 45 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| r1591 | r1592 | |
| 83 | 83 | if (ACCESSING_LSB) |
| 84 | 84 | { |
| 85 | 85 | /* bit 4 resets the sound CPU */ |
| 86 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 86 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 87 | 87 | if (!(data & 0x10)) atarijsa_reset(); |
| 88 | 88 | } |
| 89 | 89 |
| r1591 | r1592 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | else |
| 93 | 93 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 94 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ | |
| 94 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 |
| r1591 | r1592 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | // Common Hardware Start |
| 144 | 144 | #define EQUITES_ADD_SOUNDBOARD7 \ |
| 145 | MDRV_CPU_ADD(8085A, XTAL_6_144MHz | |
| 145 | MDRV_CPU_ADD(8085A, XTAL_6_144MHz | |
| 146 | 146 | /* audio CPU */ \ |
| 147 | 147 | MDRV_CPU_PROGRAM_MAP(equites_s_readmem, equites_s_writemem) \ |
| 148 | 148 | MDRV_CPU_IO_MAP(0, equites_s_writeport) \ |
| r1591 | r1592 | |
| 255 | 255 | static INTERRUPT_GEN( equites_interrupt ) |
| 256 | 256 | { |
| 257 | 257 | if (cpu_getiloops()) |
| 258 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 258 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 259 | 259 | else |
| 260 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 260 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | // Splendor Blast Hareware |
| 264 | 264 | static INTERRUPT_GEN( splndrbt_interrupt ) |
| 265 | 265 | { |
| 266 | 266 | if (cpu_getiloops()) |
| 267 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 267 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 268 | 268 | else |
| 269 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 269 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | /******************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 134 | 134 | static WRITE8_HANDLER(nmi_line_w) |
| 135 | 135 | { |
| 136 | 136 | if (data == 0x00) |
| 137 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 137 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 138 | 138 | if (data == 0x01) |
| 139 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 139 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 140 | 140 | |
| 141 | 141 | if (data != 0x00 && data != 0x01) |
| 142 | 142 | logerror("NMI line got a weird value!\n"); |
| r1591 | r1592 | |
| 267 | 267 | |
| 268 | 268 | static TIMER_CALLBACK( irq_stop ) |
| 269 | 269 | { |
| 270 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 270 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | static INTERRUPT_GEN( vblank_callback_esh ) |
| 274 | 274 | { |
| 275 | 275 | // IRQ |
| 276 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 276 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 277 | 277 | timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop); |
| 278 | 278 | |
| 279 | 279 | laserdisc_vsync(discinfo); |
| r1591 | r1592 | |
|---|---|---|
| 6612 | 6612 | |
| 6613 | 6613 | static DRIVER_INIT( fatfury2 ) |
| 6614 | 6614 | { |
| 6615 | | |
| 6615 | DRIVER_INIT_CALL(neogeo | |
| 6616 | 6616 | |
| 6617 | 6617 | fatfury2_install_protection(); |
| 6618 | 6618 | } |
| 6619 | 6619 | |
| 6620 | 6620 | static DRIVER_INIT( mslugx ) |
| 6621 | 6621 | { |
| 6622 | | |
| 6622 | DRIVER_INIT_CALL(neogeo | |
| 6623 | 6623 | mslugx_install_protection(); |
| 6624 | 6624 | } |
| 6625 | 6625 | |
| r1591 | r1592 | |
| 6628 | 6628 | kof99_decrypt_68k(); |
| 6629 | 6629 | neogeo_fixed_layer_bank_type = 1; |
| 6630 | 6630 | kof99_neogeo_gfx_decrypt(0x00); |
| 6631 | | |
| 6631 | DRIVER_INIT_CALL(neogeo | |
| 6632 | 6632 | kof99_install_protection(); |
| 6633 | 6633 | } |
| 6634 | 6634 | |
| r1591 | r1592 | |
| 6637 | 6637 | garou_decrypt_68k(); |
| 6638 | 6638 | neogeo_fixed_layer_bank_type = 1; |
| 6639 | 6639 | kof99_neogeo_gfx_decrypt(0x06); |
| 6640 | | |
| 6640 | DRIVER_INIT_CALL(neogeo | |
| 6641 | 6641 | garou_install_protection(); |
| 6642 | 6642 | } |
| 6643 | 6643 | |
| r1591 | r1592 | |
| 6646 | 6646 | garouo_decrypt_68k(); |
| 6647 | 6647 | neogeo_fixed_layer_bank_type = 1; |
| 6648 | 6648 | kof99_neogeo_gfx_decrypt(0x06); |
| 6649 | | |
| 6649 | DRIVER_INIT_CALL(neogeo | |
| 6650 | 6650 | garouo_install_protection(); |
| 6651 | 6651 | } |
| 6652 | 6652 | |
| r1591 | r1592 | |
| 6654 | 6654 | { |
| 6655 | 6655 | neogeo_bootleg_sx_decrypt(2); |
| 6656 | 6656 | neogeo_bootleg_cx_decrypt(); |
| 6657 | | |
| 6657 | DRIVER_INIT_CALL(neogeo | |
| 6658 | 6658 | } |
| 6659 | 6659 | |
| 6660 | 6660 | static DRIVER_INIT( mslug3 ) |
| r1591 | r1592 | |
| 6662 | 6662 | mslug3_decrypt_68k(); |
| 6663 | 6663 | neogeo_fixed_layer_bank_type = 1; |
| 6664 | 6664 | kof99_neogeo_gfx_decrypt(0xad); |
| 6665 | | |
| 6665 | DRIVER_INIT_CALL(neogeo | |
| 6666 | 6666 | mslug3_install_protection(); |
| 6667 | 6667 | } |
| 6668 | 6668 | |
| r1591 | r1592 | |
| 6671 | 6671 | kof2000_decrypt_68k(); |
| 6672 | 6672 | neogeo_fixed_layer_bank_type = 2; |
| 6673 | 6673 | kof2000_neogeo_gfx_decrypt(0x00); |
| 6674 | | |
| 6674 | DRIVER_INIT_CALL(neogeo | |
| 6675 | 6675 | kof2000_install_protection(); |
| 6676 | 6676 | } |
| 6677 | 6677 | |
| 6678 | 6678 | static DRIVER_INIT( kof2001 ) |
| 6679 | 6679 | { |
| 6680 | 6680 | kof2000_neogeo_gfx_decrypt(0x1e); |
| 6681 | | |
| 6681 | DRIVER_INIT_CALL(neogeo | |
| 6682 | 6682 | } |
| 6683 | 6683 | |
| 6684 | 6684 | static DRIVER_INIT( mslug4 ) |
| 6685 | 6685 | { |
| 6686 | 6686 | neogeo_fixed_layer_bank_type = 1; /* USA violent content screen is wrong -- not a bug, confirmed on real hardware! */ |
| 6687 | 6687 | kof2000_neogeo_gfx_decrypt(0x31); |
| 6688 | | |
| 6688 | DRIVER_INIT_CALL(neogeo | |
| 6689 | 6689 | neo_pcm2_snk_1999(8); |
| 6690 | 6690 | } |
| 6691 | 6691 | |
| r1591 | r1592 | |
| 6693 | 6693 | { |
| 6694 | 6694 | neogeo_fixed_layer_bank_type = 1; |
| 6695 | 6695 | kof99_neogeo_gfx_decrypt(0x00); |
| 6696 | | |
| 6696 | DRIVER_INIT_CALL(neogeo | |
| 6697 | 6697 | } |
| 6698 | 6698 | |
| 6699 | 6699 | static DRIVER_INIT( ganryu ) |
| 6700 | 6700 | { |
| 6701 | 6701 | neogeo_fixed_layer_bank_type = 1; |
| 6702 | 6702 | kof99_neogeo_gfx_decrypt(0x07); |
| 6703 | | |
| 6703 | DRIVER_INIT_CALL(neogeo | |
| 6704 | 6704 | } |
| 6705 | 6705 | |
| 6706 | 6706 | static DRIVER_INIT( s1945p ) |
| 6707 | 6707 | { |
| 6708 | 6708 | neogeo_fixed_layer_bank_type = 1; |
| 6709 | 6709 | kof99_neogeo_gfx_decrypt(0x05); |
| 6710 | | |
| 6710 | DRIVER_INIT_CALL(neogeo | |
| 6711 | 6711 | } |
| 6712 | 6712 | |
| 6713 | 6713 | static DRIVER_INIT( preisle2 ) |
| 6714 | 6714 | { |
| 6715 | 6715 | neogeo_fixed_layer_bank_type = 1; |
| 6716 | 6716 | kof99_neogeo_gfx_decrypt(0x9f); |
| 6717 | | |
| 6717 | DRIVER_INIT_CALL(neogeo | |
| 6718 | 6718 | } |
| 6719 | 6719 | |
| 6720 | 6720 | static DRIVER_INIT( mslug3n ) |
| 6721 | 6721 | { |
| 6722 | 6722 | neogeo_fixed_layer_bank_type = 1; |
| 6723 | 6723 | kof99_neogeo_gfx_decrypt(0xad); |
| 6724 | | |
| 6724 | DRIVER_INIT_CALL(neogeo | |
| 6725 | 6725 | } |
| 6726 | 6726 | |
| 6727 | 6727 | static DRIVER_INIT( kof2000n ) |
| 6728 | 6728 | { |
| 6729 | 6729 | neogeo_fixed_layer_bank_type = 2; |
| 6730 | 6730 | kof2000_neogeo_gfx_decrypt(0x00); |
| 6731 | | |
| 6731 | DRIVER_INIT_CALL(neogeo | |
| 6732 | 6732 | } |
| 6733 | 6733 | |
| 6734 | 6734 | static DRIVER_INIT( bangbead ) |
| 6735 | 6735 | { |
| 6736 | 6736 | neogeo_fixed_layer_bank_type = 1; |
| 6737 | 6737 | kof99_neogeo_gfx_decrypt(0xf8); |
| 6738 | | |
| 6738 | DRIVER_INIT_CALL(neogeo | |
| 6739 | 6739 | } |
| 6740 | 6740 | |
| 6741 | 6741 | static DRIVER_INIT( nitd ) |
| 6742 | 6742 | { |
| 6743 | 6743 | neogeo_fixed_layer_bank_type = 1; |
| 6744 | 6744 | kof99_neogeo_gfx_decrypt(0xff); |
| 6745 | | |
| 6745 | DRIVER_INIT_CALL(neogeo | |
| 6746 | 6746 | } |
| 6747 | 6747 | |
| 6748 | 6748 | static DRIVER_INIT( zupapa ) |
| 6749 | 6749 | { |
| 6750 | 6750 | neogeo_fixed_layer_bank_type = 1; |
| 6751 | 6751 | kof99_neogeo_gfx_decrypt(0xbd); |
| 6752 | | |
| 6752 | DRIVER_INIT_CALL(neogeo | |
| 6753 | 6753 | } |
| 6754 | 6754 | |
| 6755 | 6755 | static DRIVER_INIT( sengoku3 ) |
| 6756 | 6756 | { |
| 6757 | 6757 | neogeo_fixed_layer_bank_type = 1; |
| 6758 | 6758 | kof99_neogeo_gfx_decrypt(0xfe); |
| 6759 | | |
| 6759 | DRIVER_INIT_CALL(neogeo | |
| 6760 | 6760 | } |
| 6761 | 6761 | |
| 6762 | 6762 | static DRIVER_INIT ( kof98 ) |
| 6763 | 6763 | { |
| 6764 | 6764 | kof98_decrypt_68k(); |
| 6765 | | |
| 6765 | DRIVER_INIT_CALL(neogeo | |
| 6766 | 6766 | install_kof98_protection(); |
| 6767 | 6767 | } |
| 6768 | 6768 | |
| r1591 | r1592 | |
| 6771 | 6771 | neo_pcm2_snk_1999(16); |
| 6772 | 6772 | neogeo_fixed_layer_bank_type = 1; |
| 6773 | 6773 | kof2000_neogeo_gfx_decrypt(0x3f); |
| 6774 | | |
| 6774 | DRIVER_INIT_CALL(neogeo | |
| 6775 | 6775 | } |
| 6776 | 6776 | |
| 6777 | 6777 | |
| r1591 | r1592 | |
| 6780 | 6780 | kof2002_decrypt_68k(); |
| 6781 | 6781 | neo_pcm2_swap(0 ); |
| 6782 | 6782 | kof2000_neogeo_gfx_decrypt(0xec); |
| 6783 | | |
| 6783 | DRIVER_INIT_CALL(neogeo | |
| 6784 | 6784 | } |
| 6785 | 6785 | |
| 6786 | 6786 | static DRIVER_INIT( kf2k2pls ) |
| r1591 | r1592 | |
| 6788 | 6788 | kof2002_decrypt_68k(); |
| 6789 | 6789 | neo_pcm2_swap(0 ); |
| 6790 | 6790 | cmc50_neogeo_gfx_decrypt(0xec); |
| 6791 | | |
| 6791 | DRIVER_INIT_CALL(neogeo | |
| 6792 | 6792 | } |
| 6793 | 6793 | |
| 6794 | 6794 | static DRIVER_INIT( kf2k2mp ) |
| r1591 | r1592 | |
| 6797 | 6797 | neo_pcm2_swap(0 ); |
| 6798 | 6798 | neogeo_bootleg_sx_decrypt(2); |
| 6799 | 6799 | cmc50_neogeo_gfx_decrypt(0xec); |
| 6800 | | |
| 6800 | DRIVER_INIT_CALL(neogeo | |
| 6801 | 6801 | } |
| 6802 | 6802 | |
| 6803 | 6803 | static DRIVER_INIT( kof2km2 ) |
| r1591 | r1592 | |
| 6806 | 6806 | neo_pcm2_swap(0 ); |
| 6807 | 6807 | neogeo_bootleg_sx_decrypt(1); |
| 6808 | 6808 | cmc50_neogeo_gfx_decrypt(0xec); |
| 6809 | | |
| 6809 | DRIVER_INIT_CALL(neogeo | |
| 6810 | 6810 | } |
| 6811 | 6811 | |
| 6812 | 6812 | static DRIVER_INIT( matrim ) |
| r1591 | r1592 | |
| 6815 | 6815 | neo_pcm2_swap(1); |
| 6816 | 6816 | neogeo_fixed_layer_bank_type = 2; |
| 6817 | 6817 | kof2000_neogeo_gfx_decrypt(0x6a); |
| 6818 | | |
| 6818 | DRIVER_INIT_CALL(neogeo | |
| 6819 | 6819 | } |
| 6820 | 6820 | |
| 6821 | 6821 | static DRIVER_INIT( pnyaa ) |
| r1591 | r1592 | |
| 6823 | 6823 | neo_pcm2_snk_1999(4); |
| 6824 | 6824 | neogeo_fixed_layer_bank_type = 1; |
| 6825 | 6825 | kof2000_neogeo_gfx_decrypt(0x2e); |
| 6826 | | |
| 6826 | DRIVER_INIT_CALL(neogeo | |
| 6827 | 6827 | } |
| 6828 | 6828 | |
| 6829 | 6829 | static DRIVER_INIT( mslug5 ) |
| r1591 | r1592 | |
| 6832 | 6832 | neo_pcm2_swap(2); |
| 6833 | 6833 | neogeo_fixed_layer_bank_type = 1; |
| 6834 | 6834 | kof2000_neogeo_gfx_decrypt(0x19); |
| 6835 | | |
| 6835 | DRIVER_INIT_CALL(neogeo | |
| 6836 | 6836 | install_pvc_protection(); |
| 6837 | 6837 | } |
| 6838 | 6838 | |
| r1591 | r1592 | |
| 6844 | 6844 | neogeo_fixed_layer_bank_type = 2; |
| 6845 | 6845 | svcpcb_s1data_decrypt(); |
| 6846 | 6846 | neo_pcm2_swap(2); |
| 6847 | | |
| 6847 | DRIVER_INIT_CALL(neogeo | |
| 6848 | 6848 | install_pvc_protection(); |
| 6849 | 6849 | } |
| 6850 | 6850 | |
| r1591 | r1592 | |
| 6855 | 6855 | // decrypt_ms5plus_s1(); |
| 6856 | 6856 | neogeo_bootleg_sx_decrypt(1); |
| 6857 | 6857 | neogeo_fixed_layer_bank_type = 1; |
| 6858 | | |
| 6858 | DRIVER_INIT_CALL(neogeo | |
| 6859 | 6859 | install_ms5plus_protection(); |
| 6860 | 6860 | } |
| 6861 | 6861 | |
| r1591 | r1592 | |
| 6878 | 6878 | svcpcb_s1data_decrypt(); |
| 6879 | 6879 | neo_pcm2_swap(3); |
| 6880 | 6880 | neogeo_fixed_layer_bank_type = 2; |
| 6881 | | |
| 6881 | DRIVER_INIT_CALL(neogeo | |
| 6882 | 6882 | install_pvc_protection(); |
| 6883 | 6883 | } |
| 6884 | 6884 | |
| r1591 | r1592 | |
| 6888 | 6888 | neo_pcm2_swap(3); |
| 6889 | 6889 | neogeo_fixed_layer_bank_type = 2; |
| 6890 | 6890 | kof2000_neogeo_gfx_decrypt(0x57); |
| 6891 | | |
| 6891 | DRIVER_INIT_CALL(neogeo | |
| 6892 | 6892 | install_pvc_protection(); |
| 6893 | 6893 | } |
| 6894 | 6894 | |
| r1591 | r1592 | |
| 6896 | 6896 | { |
| 6897 | 6897 | svcboot_px_decrypt(); |
| 6898 | 6898 | svcboot_cx_decrypt(); |
| 6899 | | |
| 6899 | DRIVER_INIT_CALL(neogeo | |
| 6900 | 6900 | install_pvc_protection(); |
| 6901 | 6901 | } |
| 6902 | 6902 | |
| r1591 | r1592 | |
| 6907 | 6907 | // svcplus_sx_decrypt(); |
| 6908 | 6908 | neogeo_bootleg_sx_decrypt(1); |
| 6909 | 6909 | svcplus_px_hack(); |
| 6910 | | |
| 6910 | DRIVER_INIT_CALL(neogeo | |
| 6911 | 6911 | } |
| 6912 | 6912 | |
| 6913 | 6913 | static DRIVER_INIT( svcplusa ) |
| r1591 | r1592 | |
| 6915 | 6915 | svcplusa_px_decrypt(); |
| 6916 | 6916 | svcboot_cx_decrypt(); |
| 6917 | 6917 | svcplus_px_hack(); |
| 6918 | | |
| 6918 | DRIVER_INIT_CALL(neogeo | |
| 6919 | 6919 | } |
| 6920 | 6920 | |
| 6921 | 6921 | static DRIVER_INIT( svcsplus ) |
| r1591 | r1592 | |
| 6925 | 6925 | neogeo_bootleg_sx_decrypt(2); |
| 6926 | 6926 | svcboot_cx_decrypt(); |
| 6927 | 6927 | svcsplus_px_hack(); |
| 6928 | | |
| 6928 | DRIVER_INIT_CALL(neogeo | |
| 6929 | 6929 | install_pvc_protection(); |
| 6930 | 6930 | } |
| 6931 | 6931 | |
| r1591 | r1592 | |
| 6935 | 6935 | neo_pcm2_swap(4); |
| 6936 | 6936 | neogeo_fixed_layer_bank_type = 1; |
| 6937 | 6937 | kof2000_neogeo_gfx_decrypt(0x0f); |
| 6938 | | |
| 6938 | DRIVER_INIT_CALL(neogeo | |
| 6939 | 6939 | } |
| 6940 | 6940 | |
| 6941 | 6941 | static DRIVER_INIT( samsho5b ) |
| r1591 | r1592 | |
| 6944 | 6944 | neogeo_fixed_layer_bank_type = 1; |
| 6945 | 6945 | kof2000_neogeo_gfx_decrypt(0x0f); |
| 6946 | 6946 | samsh5bl_px_decrypt(); |
| 6947 | | |
| 6947 | DRIVER_INIT_CALL(neogeo | |
| 6948 | 6948 | } |
| 6949 | 6949 | |
| 6950 | 6950 | static DRIVER_INIT( kf2k3pcb ) |
| r1591 | r1592 | |
| 6957 | 6957 | /* rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2) -- extra encrypted m1 swap? not confirmed */ |
| 6958 | 6958 | neo_pcm2_swap(5); |
| 6959 | 6959 | neogeo_fixed_layer_bank_type = 2; |
| 6960 | | |
| 6960 | DRIVER_INIT_CALL(neogeo | |
| 6961 | 6961 | install_pvc_protection(); |
| 6962 | 6962 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc7ffff, 0, 0, MRA16_BANK6 ); // 512k bios |
| 6963 | 6963 | } |
| r1591 | r1592 | |
| 6969 | 6969 | neo_pcm2_swap(5); |
| 6970 | 6970 | neogeo_fixed_layer_bank_type = 2; |
| 6971 | 6971 | kof2000_neogeo_gfx_decrypt(0x9d); |
| 6972 | | |
| 6972 | DRIVER_INIT_CALL(neogeo | |
| 6973 | 6973 | install_pvc_protection(); |
| 6974 | 6974 | } |
| 6975 | 6975 | |
| r1591 | r1592 | |
| 6977 | 6977 | { |
| 6978 | 6978 | // kof2003b_sx_decrypt(); |
| 6979 | 6979 | neogeo_bootleg_sx_decrypt(1); |
| 6980 | | |
| 6980 | DRIVER_INIT_CALL(neogeo | |
| 6981 | 6981 | kof2003b_install_protection(); |
| 6982 | 6982 | } |
| 6983 | 6983 | |
| r1591 | r1592 | |
| 6986 | 6986 | kof2k3pl_px_decrypt(); |
| 6987 | 6987 | //decrypt_ms5plus_s1(); |
| 6988 | 6988 | neogeo_bootleg_sx_decrypt(1); |
| 6989 | | |
| 6989 | DRIVER_INIT_CALL(neogeo | |
| 6990 | 6990 | kf2k3pl_install_protection(); |
| 6991 | 6991 | } |
| 6992 | 6992 | |
| r1591 | r1592 | |
| 6996 | 6996 | kof2k3up_px_decrypt(); |
| 6997 | 6997 | // kof2k3up_sx_decrypt(); |
| 6998 | 6998 | neogeo_bootleg_sx_decrypt(2); |
| 6999 | | |
| 6999 | DRIVER_INIT_CALL(neogeo | |
| 7000 | 7000 | kof2k3up_install_protection(); |
| 7001 | 7001 | } |
| 7002 | 7002 | |
| r1591 | r1592 | |
| 7008 | 7008 | neo_pcm2_swap(6); |
| 7009 | 7009 | neogeo_fixed_layer_bank_type = 1; |
| 7010 | 7010 | kof2000_neogeo_gfx_decrypt(0x0d); |
| 7011 | | |
| 7011 | DRIVER_INIT_CALL(neogeo | |
| 7012 | 7012 | } |
| 7013 | 7013 | |
| 7014 | 7014 | |
| r1591 | r1592 | |
| 7029 | 7029 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") ); |
| 7030 | 7030 | // memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") ); |
| 7031 | 7031 | |
| 7032 | | |
| 7032 | DRIVER_INIT_CALL(neogeo | |
| 7033 | 7033 | } |
| 7034 | 7034 | |
| 7035 | 7035 | static DRIVER_INIT( vliner ) |
| r1591 | r1592 | |
| 7046 | 7046 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") ); |
| 7047 | 7047 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") ); |
| 7048 | 7048 | |
| 7049 | | |
| 7049 | DRIVER_INIT_CALL(neogeo | |
| 7050 | 7050 | } |
| 7051 | 7051 | |
| 7052 | 7052 | |
| r1591 | r1592 | |
| 7058 | 7058 | kog_px_decrypt(); |
| 7059 | 7059 | neogeo_bootleg_sx_decrypt(1); |
| 7060 | 7060 | neogeo_bootleg_cx_decrypt(); |
| 7061 | | |
| 7061 | DRIVER_INIT_CALL(neogeo | |
| 7062 | 7062 | } |
| 7063 | 7063 | |
| 7064 | 7064 | |
| 7065 | 7065 | static DRIVER_INIT( kof10th ) |
| 7066 | 7066 | { |
| 7067 | 7067 | decrypt_kof10th(); |
| 7068 | | |
| 7068 | DRIVER_INIT_CALL(neogeo | |
| 7069 | 7069 | install_kof10th_protection(); |
| 7070 | 7070 | } |
| 7071 | 7071 | |
| 7072 | 7072 | static DRIVER_INIT( kf10thep ) |
| 7073 | 7073 | { |
| 7074 | 7074 | decrypt_kf10thep(); |
| 7075 | | |
| 7075 | DRIVER_INIT_CALL(neogeo | |
| 7076 | 7076 | } |
| 7077 | 7077 | |
| 7078 | 7078 | |
| 7079 | 7079 | static DRIVER_INIT( kf2k5uni ) |
| 7080 | 7080 | { |
| 7081 | 7081 | decrypt_kf2k5uni(); |
| 7082 | | |
| 7082 | DRIVER_INIT_CALL(neogeo | |
| 7083 | 7083 | } |
| 7084 | 7084 | |
| 7085 | 7085 | static DRIVER_INIT( cthd2003 ) |
| 7086 | 7086 | { |
| 7087 | 7087 | decrypt_cthd2003(); |
| 7088 | | |
| 7088 | DRIVER_INIT_CALL(neogeo | |
| 7089 | 7089 | patch_cthd2003(); |
| 7090 | 7090 | } |
| 7091 | 7091 | |
| 7092 | 7092 | static DRIVER_INIT ( ct2k3sp ) |
| 7093 | 7093 | { |
| 7094 | 7094 | decrypt_ct2k3sp(); |
| 7095 | | |
| 7095 | DRIVER_INIT_CALL(neogeo | |
| 7096 | 7096 | patch_cthd2003(); |
| 7097 | 7097 | } |
| 7098 | 7098 | |
| 7099 | 7099 | static DRIVER_INIT ( ct2k3sa ) |
| 7100 | 7100 | { |
| 7101 | 7101 | decrypt_ct2k3sa(); |
| 7102 | | |
| 7102 | DRIVER_INIT_CALL(neogeo | |
| 7103 | 7103 | patch_ct2k3sa(); |
| 7104 | 7104 | } |
| 7105 | 7105 | |
| 7106 | 7106 | static DRIVER_INIT( kof2k4se ) |
| 7107 | 7107 | { |
| 7108 | 7108 | decrypt_kof2k4se_68k(); |
| 7109 | | |
| 7109 | DRIVER_INIT_CALL(neogeo | |
| 7110 | 7110 | } |
| 7111 | 7111 | |
| 7112 | 7112 | static DRIVER_INIT( lans2004 ) |
| r1591 | r1592 | |
| 7115 | 7115 | lans2004_vx_decrypt(); |
| 7116 | 7116 | neogeo_bootleg_sx_decrypt(1); |
| 7117 | 7117 | neogeo_bootleg_cx_decrypt(); |
| 7118 | | |
| 7118 | DRIVER_INIT_CALL(neogeo | |
| 7119 | 7119 | } |
| 7120 | 7120 | |
| 7121 | 7121 | static DRIVER_INIT( mslug3b6 ) |
| 7122 | 7122 | { |
| 7123 | 7123 | neogeo_bootleg_sx_decrypt(2); |
| 7124 | 7124 | cmc42_neogeo_gfx_decrypt(0xad); |
| 7125 | | |
| 7125 | DRIVER_INIT_CALL(neogeo | |
| 7126 | 7126 | } |
| 7127 | 7127 | |
| 7128 | 7128 |
| r1591 | r1592 | |
|---|---|---|
| 77 | 77 | //audio tester |
| 78 | 78 | if(input_code_pressed_once(KEYCODE_Q)) |
| 79 | 79 | { |
| 80 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 80 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 81 | 81 | } |
| 82 | 82 | #endif |
| 83 | 83 | return 0; |
| r1591 | r1592 | |
|---|---|---|
| 78 | 78 | static MACHINE_RESET( gradius3 ) |
| 79 | 79 | { |
| 80 | 80 | /* start with cpu B halted */ |
| 81 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 81 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 82 | 82 | irqAen = 0; |
| 83 | 83 | irqBmask = 0; |
| 84 | 84 | } |
| r1591 | r1592 | |
| 97 | 97 | gradius3_priority = data & 0x04; |
| 98 | 98 | |
| 99 | 99 | /* bit 3 enables cpu B */ |
| 100 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 100 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 101 | 101 | |
| 102 | 102 | /* bit 5 enables irq */ |
| 103 | 103 | irqAen = data & 0x20; |
| r1591 | r1592 | |
| 116 | 116 | static INTERRUPT_GEN( cpuA_interrupt ) |
| 117 | 117 | { |
| 118 | 118 | if (irqAen) |
| 119 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 119 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | static INTERRUPT_GEN( cpuB_interrupt ) |
| r1591 | r1592 | |
| 124 | 124 | if (cpu_getiloops() & 1) /* ??? */ |
| 125 | 125 | { |
| 126 | 126 | if (irqBmask & 2) |
| 127 | cpunum_set_input_line(1, 2, HOLD_LINE); | |
| 127 | cpunum_set_input_line(machine, 1, 2, HOLD_LINE); | |
| 128 | 128 | } |
| 129 | 129 | else |
| 130 | 130 | { |
| 131 | 131 | if (irqBmask & 1) |
| 132 | cpunum_set_input_line(1, 1, HOLD_LINE); | |
| 132 | cpunum_set_input_line(machine, 1, 1, HOLD_LINE); | |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| r1591 | r1592 | |
| 138 | 138 | if (irqBmask & 4) |
| 139 | 139 | { |
| 140 | 140 | logerror("%04x trigger cpu B irq 4 %02x\n",activecpu_get_pc(),data); |
| 141 | cpunum_set_input_line(1,4,HOLD_LINE); | |
| 141 | cpunum_set_input_line(Machine, 1,4,HOLD_LINE); | |
| 142 | 142 | } |
| 143 | 143 | else |
| 144 | 144 | logerror("%04x MISSED cpu B irq 4 %02x\n",activecpu_get_pc(),data); |
| r1591 | r1592 | |
| 152 | 152 | |
| 153 | 153 | static WRITE16_HANDLER( sound_irq_w ) |
| 154 | 154 | { |
| 155 | cpunum_set_input_line_and_vector(2,0,HOLD_LINE,0xff); | |
| 155 | cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | static WRITE8_HANDLER( sound_bank_w ) |
| r1591 | r1592 | |
|---|---|---|
| 322 | 322 | static WRITE8_HANDLER( omegrace_soundlatch_w ) |
| 323 | 323 | { |
| 324 | 324 | soundlatch_w (offset, data); |
| 325 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 325 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 |
| r1591 | r1592 | |
|---|---|---|
| 1129 | 1129 | int i; |
| 1130 | 1130 | |
| 1131 | 1131 | /* standard init */ |
| 1132 | | |
| 1132 | DRIVER_INIT_CALL(decocass | |
| 1133 | 1133 | |
| 1134 | 1134 | /* decrypt the ROMs */ |
| 1135 | 1135 | for (i = 0; i < romlength; i++) |
| r1591 | r1592 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | if (eolith_scanline==eolith_speedup_resume_scanline) |
| 88 | 88 | { |
| 89 | cpu_trigger(1000); | |
| 89 | cpu_trigger(machine, 1000); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if (eolith_scanline==240) |
| r1591 | r1592 | |
|---|---|---|
| 200 | 200 | switch (cpu_getiloops()) |
| 201 | 201 | { |
| 202 | 202 | case 0: |
| 203 | cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE); | |
| 203 | cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE); | |
| 204 | 204 | break; |
| 205 | 205 | |
| 206 | 206 | case 1: |
| 207 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 207 | cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 208 | 208 | break; |
| 209 | 209 | |
| 210 | 210 | case 2: |
| 211 | cpunum_set_input_line(0, MC68000_IRQ_6, HOLD_LINE); | |
| 211 | cpunum_set_input_line(machine, 0, MC68000_IRQ_6, HOLD_LINE); | |
| 212 | 212 | break; |
| 213 | 213 | } |
| 214 | 214 | } |
| r1591 | r1592 | |
| 218 | 218 | switch (cpu_getiloops()) |
| 219 | 219 | { |
| 220 | 220 | case 0: |
| 221 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 221 | cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 222 | 222 | break; |
| 223 | 223 | |
| 224 | 224 | case 15: |
| 225 | cpunum_set_input_line(0, MC68000_IRQ_6, HOLD_LINE); | |
| 225 | cpunum_set_input_line(machine, 0, MC68000_IRQ_6, HOLD_LINE); | |
| 226 | 226 | break; |
| 227 | 227 | |
| 228 | 228 | case 39: |
| 229 | if (K053246_is_IRQ_enabled()) cpunum_set_input_line(0, MC68000_IRQ_5, HOLD_LINE); | |
| 229 | if (K053246_is_IRQ_enabled()) cpunum_set_input_line(machine, 0, MC68000_IRQ_5, HOLD_LINE); | |
| 230 | 230 | break; |
| 231 | 231 | } |
| 232 | 232 | } |
| r1591 | r1592 | |
| 238 | 238 | switch (cpu_getiloops()) |
| 239 | 239 | { |
| 240 | 240 | case 0: |
| 241 | if (K053246_is_IRQ_enabled()) cpunum_set_input_line(0, MC68000_IRQ_6, HOLD_LINE); | |
| 241 | if (K053246_is_IRQ_enabled()) cpunum_set_input_line(machine, 0, MC68000_IRQ_6, HOLD_LINE); | |
| 242 | 242 | break; |
| 243 | 243 | |
| 244 | 244 | case 1: |
| 245 | cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE); | |
| 245 | cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE); | |
| 246 | 246 | break; |
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | static INTERRUPT_GEN(ddd_interrupt) |
| 251 | 251 | { |
| 252 | cpunum_set_input_line(0, MC68000_IRQ_5, HOLD_LINE); | |
| 252 | cpunum_set_input_line(machine, 0, MC68000_IRQ_5, HOLD_LINE); | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| r1591 | r1592 | |
| 279 | 279 | |
| 280 | 280 | static WRITE16_HANDLER( sound_irq_w ) |
| 281 | 281 | { |
| 282 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 282 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static READ16_HANDLER( sound_status_r ) |
| r1591 | r1592 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | /* generate an NMI if we're out of data */ |
| 182 | 182 | if (!fromance_vclk_left) |
| 183 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 183 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 |
| r1591 | r1592 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | static void dleuro_interrupt(int state) |
| 92 | 92 | { |
| 93 | cpunum_set_input_line(0, 0, state); | |
| 93 | cpunum_set_input_line(Machine, 0, 0, state); | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| r1591 | r1592 | |
| 189 | 189 | |
| 190 | 190 | static VIDEO_START( dleuro ) |
| 191 | 191 | { |
| 192 | | |
| 192 | VIDEO_START_CALL(dlair | |
| 193 | 193 | |
| 194 | 194 | overlay_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16); |
| 195 | 195 | fillbitmap(overlay_bitmap, 8, NULL); |
| r1591 | r1592 | |
|---|---|---|
| 394 | 394 | static INTERRUPT_GEN( jollyjgr_interrupt ) |
| 395 | 395 | { |
| 396 | 396 | if(nmi_enable) |
| 397 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 397 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | static MACHINE_DRIVER_START( jollyjgr ) |
| r1591 | r1592 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | static WRITE8_HANDLER( irobot_clearirq_w ) |
| 104 | 104 | { |
| 105 | cpunum_set_input_line(0, M6809_IRQ_LINE ,CLEAR_LINE); | |
| 105 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE ,CLEAR_LINE); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | static WRITE8_HANDLER( irobot_clearfirq_w ) |
| 110 | 110 | { |
| 111 | cpunum_set_input_line(0, M6809_FIRQ_LINE ,CLEAR_LINE); | |
| 111 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE ,CLEAR_LINE); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 |
| r1591 | r1592 | |
|---|---|---|
| 79 | 79 | static WRITE8_HANDLER( skykid_subreset_w ) |
| 80 | 80 | { |
| 81 | 81 | int bit = !BIT(offset,11); |
| 82 | cpunum_set_input_line(1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 82 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static WRITE8_HANDLER( skykid_bankswitch_w ) |
| r1591 | r1592 | |
| 92 | 92 | int bit = !BIT(offset,11); |
| 93 | 93 | cpu_interrupt_enable(0,bit); |
| 94 | 94 | if (!bit) |
| 95 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 95 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | static WRITE8_HANDLER( skykid_irq_2_ctrl_w ) |
| r1591 | r1592 | |
| 100 | 100 | int bit = !BIT(offset,13); |
| 101 | 101 | cpu_interrupt_enable(1,bit); |
| 102 | 102 | if (!bit) |
| 103 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 103 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | static MACHINE_START( skykid ) |
| r1591 | r1592 | |
| 455 | 455 | MDRV_CPU_PROGRAM_MAP(skykid_map,0) |
| 456 | 456 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| 457 | 457 | |
| 458 | MDRV_CPU_ADD(HD63701,49152000/ | |
| 458 | MDRV_CPU_ADD(HD63701,49152000/8 | |
| 459 | 459 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 460 | 460 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 461 | 461 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| r1591 | r1592 | |
|---|---|---|
| 30 | 30 | * |
| 31 | 31 | *************************************/ |
| 32 | 32 | |
| 33 | static void update_interrupts( | |
| 33 | static void update_interrupts(running_machine *machine) | |
| 34 | 34 | { |
| 35 | 35 | int newstate = 0; |
| 36 | 36 | |
| r1591 | r1592 | |
| 38 | 38 | newstate = 4; |
| 39 | 39 | |
| 40 | 40 | if (newstate) |
| 41 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 41 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 42 | 42 | else |
| 43 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 43 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 |
| r1591 | r1592 | |
|---|---|---|
| 1001 | 1001 | if (i==0 || (i==4 && !data)) |
| 1002 | 1002 | { |
| 1003 | 1003 | blitter_busy = 0; |
| 1004 | if (firq_level) cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's | |
| 1004 | if (firq_level) cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's | |
| 1005 | 1005 | } |
| 1006 | 1006 | else |
| 1007 | 1007 | { |
| r1591 | r1592 | |
| 1499 | 1499 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); |
| 1500 | 1500 | latch_delay = (latch_data) ? 0 : 4; |
| 1501 | 1501 | soundlatch_w(0, latch_data); |
| 1502 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1502 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1503 | 1503 | } |
| 1504 | 1504 | |
| 1505 | 1505 | // clear collision list of this frame unconditionally |
| r1591 | r1592 | |
| 1508 | 1508 | |
| 1509 | 1509 | // In Halley's Comet, NMI is used exclusively to handle coin input |
| 1510 | 1510 | case 1: |
| 1511 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1511 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1512 | 1512 | break; |
| 1513 | 1513 | |
| 1514 | 1514 | // FIRQ drives gameplay; we need both types of NMI each frame. |
| 1515 | 1515 | case 2: |
| 1516 | mVectorType = 1; cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1516 | mVectorType = 1; cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1517 | 1517 | break; |
| 1518 | 1518 | |
| 1519 | 1519 | case 3: |
| 1520 | mVectorType = 0; cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1520 | mVectorType = 0; cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1521 | 1521 | break; |
| 1522 | 1522 | } |
| 1523 | 1523 | } |
| r1591 | r1592 | |
| 1539 | 1539 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); |
| 1540 | 1540 | latch_delay = (latch_data) ? 0 : 4; |
| 1541 | 1541 | soundlatch_w(0, latch_data); |
| 1542 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1542 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1543 | 1543 | } |
| 1544 | 1544 | break; |
| 1545 | 1545 | |
| 1546 | 1546 | case 1: |
| 1547 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1547 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1548 | 1548 | break; |
| 1549 | 1549 | |
| 1550 | 1550 | case 2: |
| 1551 | 1551 | case 3: |
| 1552 | 1552 | // FIRQ must not happen when the blitter is being updated or it'll cause serious screen artifacts |
| 1553 | if (!blitter_busy) cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); else firq_level++; | |
| 1553 | if (!blitter_busy) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); else firq_level++; | |
| 1554 | 1554 | break; |
| 1555 | 1555 | } |
| 1556 | 1556 | } |
| r1591 | r1592 | |
| 1567 | 1567 | io_ram[0x9c] = data; |
| 1568 | 1568 | |
| 1569 | 1569 | if (firq_level) firq_level--; |
| 1570 | cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 1570 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 1571 | 1571 | } |
| 1572 | 1572 | |
| 1573 | 1573 |
| r1591 | r1592 | |
|---|---|---|
| 228 | 228 | if (pending_vb_int && !DISABLE_VB_INT) |
| 229 | 229 | { |
| 230 | 230 | pending_vb_int = 0; |
| 231 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 231 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | } |
| r1591 | r1592 | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | //logerror("V-Blank interrupt\n"); |
| 433 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 433 | cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | |
| r1591 | r1592 | |
| 439 | 439 | if (state != CLEAR_LINE) |
| 440 | 440 | { |
| 441 | 441 | //logerror("IDE interrupt asserted\n"); |
| 442 | cpunum_set_input_line(0, MC68000_IRQ_1, HOLD_LINE); | |
| 442 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_1, HOLD_LINE); | |
| 443 | 443 | } |
| 444 | 444 | else |
| 445 | 445 | { |
| 446 | 446 | //logerror("IDE interrupt cleared\n"); |
| 447 | cpunum_set_input_line(0, MC68000_IRQ_1, CLEAR_LINE); | |
| 447 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_1, CLEAR_LINE); | |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
| r1591 | r1592 | |
| 460 | 460 | static ADDRESS_MAP_START( memory_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 461 | 461 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // PRG ROM |
| 462 | 462 | AM_RANGE(0x400000, 0x40ffff) AM_RAM // WORK RAM |
| 463 | AM_RANGE(0x480000, 0x48443f) AM_READWRITE( | |
| 463 | AM_RANGE(0x480000, 0x48443f) AM_READWRITE(MRA | |
| 464 | 464 | AM_BASE(&paletteram32) |
| 465 | 465 | AM_RANGE(0x500000, 0x57ffff) AM_READWRITE(sndram_r, sndram_w) // SOUND RAM |
| 466 | 466 | AM_RANGE(0x580000, 0x58003f) AM_READWRITE(K056832_long_r, K056832_long_w) // VIDEO REG (tilemap) |
| r1591 | r1592 | |
| 1751 | 1751 | 0x6b, 0x09, 0x02, 0x0f, 0x05, 0x00, 0x7d, 0x1b |
| 1752 | 1752 | }; |
| 1753 | 1753 | |
| 1754 | | |
| 1754 | DRIVER_INIT_CALL(beatmania | |
| 1755 | 1755 | |
| 1756 | 1756 | ide_set_master_password(0, beatmania_master_password); |
| 1757 | 1757 | ide_set_user_password(0, hmcompmx_user_password); |
| r1591 | r1592 | |
| 1768 | 1768 | 0x18, 0x06, 0x1e, 0x07, 0x77, 0x1a, 0x7d, 0x77 |
| 1769 | 1769 | }; |
| 1770 | 1770 | |
| 1771 | | |
| 1771 | DRIVER_INIT_CALL(beatmania | |
| 1772 | 1772 | |
| 1773 | 1773 | ide_set_user_password(0, bm4thmix_user_password); |
| 1774 | 1774 | } |
| r1591 | r1592 | |
| 1784 | 1784 | 0x6b, 0x1a, 0x1e, 0x06, 0x04, 0x01, 0x7d, 0x1f |
| 1785 | 1785 | }; |
| 1786 | 1786 | |
| 1787 | | |
| 1787 | DRIVER_INIT_CALL(beatmania | |
| 1788 | 1788 | |
| 1789 | 1789 | ide_set_master_password(0, beatmania_master_password); |
| 1790 | 1790 | ide_set_user_password(0, bm5thmix_user_password); |
| r1591 | r1592 | |
| 1801 | 1801 | 0x0a, 0x1a, 0x71, 0x07, 0x1e, 0x19, 0x7d, 0x02 |
| 1802 | 1802 | }; |
| 1803 | 1803 | |
| 1804 | | |
| 1804 | DRIVER_INIT_CALL(beatmania | |
| 1805 | 1805 | |
| 1806 | 1806 | ide_set_master_password(0, beatmania_master_password); |
| 1807 | 1807 | ide_set_user_password(0, bmclubmx_user_password); |
| r1591 | r1592 | |
| 1819 | 1819 | 0x6b, 0x0d, 0x71, 0x0f, 0x1d, 0x10, 0x7d, 0x7a |
| 1820 | 1820 | }; |
| 1821 | 1821 | |
| 1822 | | |
| 1822 | DRIVER_INIT_CALL(beatmania | |
| 1823 | 1823 | |
| 1824 | 1824 | ide_set_master_password(0, beatmania_master_password); |
| 1825 | 1825 | ide_set_user_password(0, bmcompm2_user_password); |
| r1591 | r1592 | |
| 1836 | 1836 | 0x09, 0x68, 0x71, 0x0b, 0x77, 0x15, 0x17, 0x1e |
| 1837 | 1837 | }; |
| 1838 | 1838 | |
| 1839 | | |
| 1839 | DRIVER_INIT_CALL(beatmania | |
| 1840 | 1840 | |
| 1841 | 1841 | ide_set_master_password(0, beatmania_master_password); |
| 1842 | 1842 | ide_set_user_password(0, hmcompm2_user_password); |
| r1591 | r1592 | |
| 1853 | 1853 | 0x0e, 0x0a, 0x05, 0x0f, 0x13, 0x74, 0x09, 0x19 |
| 1854 | 1854 | }; |
| 1855 | 1855 | |
| 1856 | | |
| 1856 | DRIVER_INIT_CALL(beatmania | |
| 1857 | 1857 | |
| 1858 | 1858 | ide_set_master_password(0, beatmania_master_password); |
| 1859 | 1859 | ide_set_user_password(0, bmdct_user_password); |
| r1591 | r1592 | |
| 1870 | 1870 | 0x05, 0x09, 0x14, 0x0d, 0x7a, 0x74, 0x7d, 0x7a |
| 1871 | 1871 | }; |
| 1872 | 1872 | |
| 1873 | | |
| 1873 | DRIVER_INIT_CALL(beatmania | |
| 1874 | 1874 | |
| 1875 | 1875 | ide_set_master_password(0, beatmania_master_password); |
| 1876 | 1876 | ide_set_user_password(0, bmcorerm_user_password); |
| r1591 | r1592 | |
| 1887 | 1887 | 0x02, 0x06, 0x09, 0x0f, 0x7a, 0x74, 0x7d, 0x7a |
| 1888 | 1888 | }; |
| 1889 | 1889 | |
| 1890 | | |
| 1890 | DRIVER_INIT_CALL(beatmania | |
| 1891 | 1891 | |
| 1892 | 1892 | ide_set_master_password(0, beatmania_master_password); |
| 1893 | 1893 | ide_set_user_password(0, bm6thmix_user_password); |
| r1591 | r1592 | |
| 1904 | 1904 | 0x0c, 0x06, 0x7c, 0x6e, 0x77, 0x74, 0x7d, 0x7a |
| 1905 | 1905 | }; |
| 1906 | 1906 | |
| 1907 | | |
| 1907 | DRIVER_INIT_CALL(beatmania | |
| 1908 | 1908 | |
| 1909 | 1909 | ide_set_master_password(0, beatmania_master_password); |
| 1910 | 1910 | ide_set_user_password(0, bm7thmix_user_password); |
| r1591 | r1592 | |
| 1922 | 1922 | 0x0c, 0x06, 0x71, 0x6e, 0x77, 0x79, 0x7d, 0x7a |
| 1923 | 1923 | }; |
| 1924 | 1924 | |
| 1925 | | |
| 1925 | DRIVER_INIT_CALL(beatmania | |
| 1926 | 1926 | |
| 1927 | 1927 | ide_set_master_password(0, beatmania_master_password); |
| 1928 | 1928 | ide_set_user_password(0, bmfinal_user_password); |
| r1591 | r1592 | |
|---|---|---|
| 258 | 258 | PS7500_IO[IRQSTA]|=0x20; |
| 259 | 259 | if(PS7500_IO[IRQMSKA]&0x20) |
| 260 | 260 | { |
| 261 | cpunum_set_input_line(0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 261 | cpunum_set_input_line(machine, 0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| r1591 | r1592 | |
| 277 | 277 | PS7500_IO[IRQSTA]|=0x40; |
| 278 | 278 | if(PS7500_IO[IRQMSKA]&0x40) |
| 279 | 279 | { |
| 280 | cpunum_set_input_line(0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 280 | cpunum_set_input_line(machine, 0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | |
| r1591 | r1592 | |
| 295 | 295 | PS7500_IO[IRQSTA]|=0x08; |
| 296 | 296 | if(PS7500_IO[IRQMSKA]&0x08) |
| 297 | 297 | { |
| 298 | cpunum_set_input_line(0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 298 | cpunum_set_input_line(machine, 0, ARM7_IRQ_LINE, PULSE_LINE); | |
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |
| r1591 | r1592 | |
| 624 | 624 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239) |
| 625 | 625 | MDRV_PALETTE_LENGTH(256) |
| 626 | 626 | |
| 627 | MDRV_VIDEO_START(generic_bitmapped) | |
| 628 | 627 | MDRV_VIDEO_UPDATE(ssfindo) |
| 629 | 628 | |
| 630 | 629 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
| 647 | 646 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239) |
| 648 | 647 | MDRV_PALETTE_LENGTH(256) |
| 649 | 648 | |
| 650 | MDRV_VIDEO_START(generic_bitmapped) | |
| 651 | 649 | MDRV_VIDEO_UPDATE(ssfindo) |
| 652 | 650 | MACHINE_DRIVER_END |
| 653 | 651 |
| r1591 | r1592 | |
|---|---|---|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | static void set_firetrk_service(int enable) | |
| 42 | static void set_firetrk_service(running_machine *machine, int enable) | |
| 43 | 43 | { |
| 44 | 44 | /* watchdog is disabled during service mode */ |
| 45 | watchdog_enable(!enable); | |
| 45 | watchdog_enable(machine, !enable); | |
| 46 | 46 | |
| 47 | 47 | /* change CPU clock speed according to service switch change */ |
| 48 | cpunum_set_clock(0, enable ? FIRETRK_CPU_CLOCK_750KZ : FIRETRK_CPU_CLOCK_1MHZ); | |
| 48 | cpunum_set_clock(machine, 0, enable ? FIRETRK_CPU_CLOCK_750KZ : FIRETRK_CPU_CLOCK_1MHZ); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| r1591 | r1592 | |
| 58 | 58 | firetrk_service = readinputport(4) & 0x80; |
| 59 | 59 | if (firetrk_service != last_service) |
| 60 | 60 | { |
| 61 | set_firetrk_service(firetrk_service); | |
| 61 | set_firetrk_service(machine, firetrk_service); | |
| 62 | 62 | |
| 63 | 63 | last_service = firetrk_service; |
| 64 | 64 | } |
| r1591 | r1592 | |
| 71 | 71 | firetrk_service = readinputport(6) & 0x04; |
| 72 | 72 | if (firetrk_service != last_service) |
| 73 | 73 | { |
| 74 | set_firetrk_service(firetrk_service); | |
| 74 | set_firetrk_service(machine, firetrk_service); | |
| 75 | 75 | |
| 76 | 76 | last_service = firetrk_service; |
| 77 | 77 | } |
| r1591 | r1592 | |
| 83 | 83 | |
| 84 | 84 | /* NMI interrupts are disabled during service mode in firetrk and montecar */ |
| 85 | 85 | /* they never make it here if in service mode */ |
| 86 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 86 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| r1591 | r1592 | |
| 91 | 91 | { |
| 92 | 92 | int scanline = param; |
| 93 | 93 | |
| 94 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 94 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 95 | 95 | |
| 96 | 96 | /* IRQs are generated by inverse 16V signal */ |
| 97 | 97 | |
| r1591 | r1592 | |
| 232 | 232 | { |
| 233 | 233 | write_output(0); |
| 234 | 234 | last_service = readinputport(6) & 0x04; |
| 235 | set_firetrk_service(last_service); | |
| 235 | set_firetrk_service(machine, last_service); | |
| 236 | 236 | } |
| 237 | 237 | else |
| 238 | 238 | if (GAME_IS_FIRETRUCK) |
| 239 | 239 | { |
| 240 | 240 | last_service = readinputport(4) & 0x80; |
| 241 | set_firetrk_service(last_service); | |
| 241 | set_firetrk_service(machine, last_service); | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | timer_call_after_resynch(NULL, 0, periodic_callback); |
| r1591 | r1592 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | gamename method |
| 85 | 85 | -------- ------ |
| 86 | pepp0065 1 | |
| 86 | 87 | pepp0158 2 |
| 87 | 88 | pepp0188 1 |
| 89 | pepp0250 1 | |
| 90 | pepp0447 2 | |
| 88 | 91 | pepp0516 1 |
| 89 | 92 | pebe0014 1 |
| 90 | 93 | peke1012 1 |
| r1591 | r1592 | |
| 92 | 95 | peps0716 2 |
| 93 | 96 | pexp0019 2 |
| 94 | 97 | pexs0006 2 |
| 98 | pexmp006 2 | |
| 95 | 99 | |
| 96 | 100 | |
| 97 | 101 | 2) Configuration |
| r1591 | r1592 | |
| 220 | 224 | } |
| 221 | 225 | } |
| 222 | 226 | |
| 223 | | |
| 227 | NVRAM_HANDLER_CALL(i2cmem_0 | |
| 224 | 228 | } |
| 225 | 229 | |
| 226 | 230 | /***************** |
| r1591 | r1592 | |
| 443 | 447 | |
| 444 | 448 | static READ8_HANDLER( peplus_cmos_r ) |
| 445 | 449 | { |
| 446 | switch (offset) | |
| 447 | { | |
| 448 | case 0x00db: | |
| 449 | if ((readinputportbytag_safe("DOOR",0xff) & 0x01) == 0) { | |
| 450 | cmos_ram[offset] = 0x00; | |
| 451 | } | |
| 452 | break; | |
| 453 | case 0x0b8d: | |
| 454 | if ((readinputportbytag_safe("DOOR",0xff) & 0x02) == 1) { | |
| 455 | cmos_ram[offset] = 0x01; | |
| 456 | } | |
| 457 | break; | |
| 458 | } | |
| 459 | ||
| 460 | 450 | return cmos_ram[offset]; |
| 461 | 451 | } |
| 462 | 452 | |
| r1591 | r1592 | |
| 953 | 943 | |
| 954 | 944 | static MACHINE_RESET( peplus ) |
| 955 | 945 | { |
| 956 | if (autohold_addr) | |
| 957 | program_ram[autohold_addr] = readinputportbytag_safe("AUTOHOLD",0x00) & 0x01; | |
| 946 | /* | |
| 947 | AutoHold Feature Currently Disabled | |
| 948 | ||
| 949 | // pepp0158 | |
| 950 | program_ram[0xa19f] = 0x22; // RET - Disable Memory Test | |
| 951 | program_ram[0xddea] = 0x22; // RET - Disable Program Checksum | |
| 952 | autohold_addr = 0x5ffe; // AutoHold Address | |
| 953 | ||
| 954 | // pepp0188 | |
| 955 | program_ram[0x9a8d] = 0x22; // RET - Disable Memory Test | |
| 956 | program_ram[0xf429] = 0x22; // RET - Disable Program Checksum | |
| 957 | autohold_addr = 0x742f; // AutoHold Address | |
| 958 | ||
| 959 | // pepp0516 | |
| 960 | program_ram[0x9a24] = 0x22; // RET - Disable Memory Test | |
| 961 | program_ram[0xd61d] = 0x22; // RET - Disable Program Checksum | |
| 962 | autohold_addr = 0x5e7e; // AutoHold Address | |
| 963 | ||
| 964 | if (autohold_addr) | |
| 965 | program_ram[autohold_addr] = readinputportbytag_safe("AUTOHOLD",0x00) & 0x01; | |
| 966 | */ | |
| 958 | 967 | } |
| 959 | 968 | |
| 960 | 969 | |
| r1591 | r1592 | |
| 1013 | 1022 | autohold_addr = 0; |
| 1014 | 1023 | } |
| 1015 | 1024 | |
| 1025 | ||
| 1026 | /************************* | |
| 1027 | * Driver Init * | |
| 1028 | *************************/ | |
| 1029 | ||
| 1030 | /* Normal board */ | |
| 1031 | static DRIVER_INIT( peplus ) | |
| 1032 | { | |
| 1033 | peplus_init(); | |
| 1034 | } | |
| 1035 | ||
| 1016 | 1036 | /* Superboard */ |
| 1017 | static | |
| 1037 | static DRIVER_INIT( peplussb | |
| 1018 | 1038 | { |
| 1019 | 1039 | UINT8 *super_data = memory_region(REGION_USER1); |
| 1020 | 1040 | |
| r1591 | r1592 | |
| 1029 | 1049 | peplus_init(); |
| 1030 | 1050 | } |
| 1031 | 1051 | |
| 1032 | ||
| 1033 | 1052 | /************************* |
| 1034 | * | |
| 1053 | * | |
| 1035 | 1054 | *************************/ |
| 1036 | 1055 | |
| 1037 | static DRIVER_INIT( peset038 ) | |
| 1038 | { | |
| 1039 | peplus_init(); | |
| 1056 | ROM_START( peset038 ) /* Normal board : Set Chip (Set038) */ | |
| 1057 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 1058 | ROM_LOAD( "set038.u68", 0x00000, 0x10000, CRC(9c4b1d1a) SHA1(8a65cd1d8e2d74c7b66f4dfc73e7afca8458e979) ) | |
| 1040 | 1059 | |
| 1041 | // For testing only, cannot stay in final driver | |
| 1042 | program_ram[0x302] = 0x22; // RET - Disable Memory Test | |
| 1043 | program_ram[0x289f] = 0x22; // RET - Disable Program Checksum | |
| 1044 | } | |
| 1060 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 1061 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) | |
| 1062 | ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) | |
| 1063 | ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) | |
| 1064 | ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) | |
| 1045 | 1065 | |
| 1046 | static DRIVER_INIT( pepp0158 ) | |
| 1047 | { | |
| 1048 | peplus_init(); | |
| 1066 | ROM_REGION( 0x100, REGION_PROMS, 0 ) | |
| 1067 | ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) | |
| 1068 | ROM_END | |
| 1049 | 1069 | |
| 1050 | // For testing only, cannot stay in final driver | |
| 1051 | program_ram[0xa19f] = 0x22; // RET - Disable Memory Test | |
| 1052 | program_ram[0xddea] = 0x22; // RET - Disable Program Checksum | |
| 1070 | ROM_START( pepp0065 ) /* Normal board : Jokers Wild Poker (PP0065) */ | |
| 1071 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 1072 | ROM_LOAD( "pp0065.u68", 0x00000, 0x10000, CRC(76c1a367) SHA1(ea8be9241e9925b5a4206db6875e1572f85fa5fe) ) | |
| 1053 | 1073 | |
| 1054 | autohold_addr = 0x5ffe; | |
| 1055 | } | |
| 1074 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 1075 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) | |
| 1076 | ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) | |
| 1077 | ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) | |
| 1078 | ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) | |
| 1056 | 1079 | |
| 1057 | static DRIVER_INIT( pepp0188 ) | |
| 1058 | { | |
| 1059 | peplus_init(); | |
| 1080 | ROM_REGION( 0x100, REGION_PROMS, 0 ) | |
| 1081 | ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) | |
| 1082 | ROM_END | |
| 1060 | 1083 | |
| 1061 | // For testing only, cannot stay in final driver | |
| 1062 | program_ram[0x9a8d] = 0x22; // RET - Disable Memory Test | |
| 1063 | program_ram[0xf429] = 0x22; // RET - Disable Program Checksum | |
| 1084 | ROM_START( pepp0158 ) /* Normal board : 4 of a Kind Bonus Poker (PP0158) */ | |
| 1085 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 1086 | ROM_LOAD( "pp0158.u68", 0x00000, 0x10000, CRC(5976cd19) SHA1(6a461ea9ddf78dffa3cf8b65903ebf3127f23d45) ) | |
| 1064 | 1087 | |
| 1065 | autohold_addr = 0x742f; | |
| 1066 | } | |
| 1088 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 1089 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) | |
| 1090 | ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) | |
| 1091 | ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) | |
| 1092 | ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) | |
| 1067 | 1093 | |
| 1068 | static DRIVER_INIT( pepp0516 ) | |
| 1069 | { | |
| 1070 | peplus_init(); | |
| 1094 | ROM_REGION( 0x100, REGION_PROMS, 0 ) | |
| 1095 | ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) | |
| 1096 | ROM_END | |
| 1071 | 1097 | |
| 1072 | // For testing only, cannot stay in final driver | |
| 1073 | program_ram[0x9a24] = 0x22; // RET - Disable Memory Test | |
| 1074 | program_ram[0xd61d] = 0x22; // RET - Disable Program Checksum | |
| 1098 | ROM_START( pepp0188 ) /* Normal board : Standard Draw Poker (PP0188) */ | |
| 1099 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 1100 | ROM_LOAD( "pp0188.u68", 0x00000, 0x10000, CRC(cf36a53c) SHA1(99b578538ab24d9ff91971b1f77599272d1dbfc6) ) | |
| 1075 | 1101 | |
| 1076 | autohold_addr = 0x5e7e; | |
| 1077 | } | |
| 1078 | ||
| 1079 | static DRIVER_INIT( pebe0014 ) | |
| 1080 | { | |
| 1081 | peplus_init(); | |
| 1082 | ||
| 1083 | // For testing only, cannot stay in final driver | |
| 1084 | program_ram[0x75e7] = 0x22; // RET - Disable Memory Test | |
| 1085 | program_ram[0xc3ab] = 0x22; // RET - Disable Program Checksum | |
| 1086 | } | |
| 1087 | ||
| 1088 | static DRIVER_INIT( peke1012 ) | |
| 1089 | { | |
| 1090 | peplus_init(); | |
| 1091 | ||
| 1092 | // For testing only, cannot stay in final driver | |
| 1093 | program_ram[0x59e7] = 0x22; // RET - Disable Memory Test | |
| 1094 | program_ram[0xbe01] = 0x22; // RET - Disable Program Checksum | |
| 1095 | } | |
| 1096 | ||
| 1097 | static DRIVER_INIT( peps0615 ) | |
| 1098 | { | |
| 1099 | peplus_init(); | |
| 1100 | ||
| 1101 | // For testing only, cannot stay in final driver | |
| 1102 | program_ram[0x84be] = 0x22; // RET - Disable Memory Test | |
| 1103 | program_ram[0xbfd8] = 0x22; // RET - Disable Program Checksum | |
| 1104 | } | |
| 1105 | ||
| 1106 | static DRIVER_INIT( peps0716 ) | |
| 1107 | { | |
| 1108 | peplus_init(); | |
| 1109 | ||
| 1110 | // For testing only, cannot stay in final driver | |
| 1111 | program_ram[0x7f99] = 0x22; // RET - Disable Memory Test | |
| 1112 | program_ram[0xbaa9] = 0x22; // RET - Disable Program Checksum | |
| 1113 | } | |
| 1114 | ||
| 1115 | static DRIVER_INIT( pexp0019 ) | |
| 1116 | { | |
| 1117 | peplussb_init(); | |
| 1118 | ||
| 1119 | // For testing only, cannot stay in final driver | |
| 1120 | program_ram[0xc1e4] = 0x22; // RET - Disable Memory Test | |
| 1121 | program_ram[0xc15f] = 0x22; // RET - Disable Program Checksum | |
| 1122 | program_ram[0xc421] = 0x22; // RET - Disable 2nd Memory Test | |
| 1123 | } | |
| 1124 | ||
| 1125 | static DRIVER_INIT( pexs0006 ) | |
| 1126 | { | |
| 1127 | peplussb_init(); | |
| 1128 | ||
| 1129 | // For testing only, cannot stay in final driver | |
| 1130 | program_ram[0x9bd4] = 0x22; // RET - Disable Memory Test | |
| 1131 | program_ram[0x9e9c] = 0x22; // RET - Disable 2nd Memory Test | |
| 1132 | } | |
| 1133 | ||
| 1134 | static DRIVER_INIT( pexmp006 ) | |
| 1135 | { | |
| 1136 | peplussb_init(); | |
| 1137 | ||
| 1138 | // For testing only, cannot stay in final driver | |
| 1139 | program_ram[0xbfc6] = 0x22; // RET - Disable Memory Test | |
| 1140 | program_ram[0xc2a2] = 0x22; // RET - Disable 2nd Memory Test | |
| 1141 | } | |
| 1142 | ||
| 1143 | ||
| 1144 | /************************* | |
| 1145 | * Rom Load * | |
| 1146 | *************************/ | |
| 1147 | ||
| 1148 | ROM_START( peset038 ) | |
| 1149 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* Normal board : Set Chip (Set038) */ | |
| 1150 | ROM_LOAD( "set038.u68", 0x00000, 0x10000, CRC(9c4b1d1a) SHA1(8a65cd1d8e2d74c7b66f4dfc73e7afca8458e979) ) | |
| 1151 | ||
| 1152 | 1102 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1153 | 1103 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) |
| 1154 | 1104 | ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) |
| r1591 | r1592 | |
| 1159 | 1109 | ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) |
| 1160 | 1110 | ROM_END |
| 1161 | 1111 | |
| 1162 | ROM_START( pepp0 | |
| 1112 | ROM_START( pepp0250 ) /* Normal board : D | |
| 1163 | 1113 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 1164 | ROM_LOAD( "pp0 | |
| 1114 | ROM_LOAD( "pp0250.u68", 0x00000, 0x10000, CRC(4 | |
| 1165 | 1115 | |
| 1166 | 1116 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1167 | 1117 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) |
| r1591 | r1592 | |
| 1173 | 1123 | ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) |
| 1174 | 1124 | ROM_END |
| 1175 | 1125 | |
| 1176 | ROM_START( pepp0 | |
| 1126 | ROM_START( pepp0447 ) /* Normal board : Standard Draw Poker (PP0447) */ | |
| 1177 | 1127 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 1178 | ROM_LOAD( "pp0 | |
| 1128 | ROM_LOAD( "pp0447.u68", 0x00000, 0x10000, CRC(0ef0bb6 | |
| 1179 | 1129 | |
| 1180 | 1130 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1181 | 1131 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) |
| r1591 | r1592 | |
| 1315 | 1265 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ |
| 1316 | 1266 | |
| 1317 | 1267 | /* Set chips */ |
| 1318 | GAMEL(1987, peset038, 0, peplus, peplus_schip, pes | |
| 1268 | GAMEL(1987, peset038, 0, peplus, peplus_schip, peplus | |
| 1319 | 1269 | |
| 1320 | 1270 | /* Normal board : poker */ |
| 1321 | GAMEL(1987, pepp0158, 0, peplus, peplus_pokah, pepp0158, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) | |
| 1322 | GAMEL(1987, pepp0188, 0, peplus, peplus_pokah, pepp0188, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker", 0, layout_pe_poker ) | |
| 1323 | GAMEL(1987, pepp0516, 0, peplus, peplus_pokah, pepp0516, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0516) Double Bonus Poker", 0, layout_pe_poker ) | |
| 1271 | GAMEL(1987, pepp0065, 0, peplus, peplus_poker, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0065) Jokers Wild Poker", 0, layout_pe_poker ) | |
| 1272 | GAMEL(1987, pepp0158, 0, peplus, peplus_pokah, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) | |
| 1273 | GAMEL(1987, pepp0188, 0, peplus, peplus_pokah, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker", 0, layout_pe_poker ) | |
| 1274 | GAMEL(1987, pepp0250, 0, peplus, peplus_poker, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0250) Double Down Stud Poker", 0, layout_pe_poker ) | |
| 1275 | GAMEL(1987, pepp0447, 0, peplus, peplus_poker, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0447) Standard Draw Poker", 0, layout_pe_poker ) | |
| 1276 | GAMEL(1987, pepp0516, 0, peplus, peplus_pokah, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0516) Double Bonus Poker", 0, layout_pe_poker ) | |
| 1324 | 1277 | |
| 1325 | 1278 | /* Normal board : blackjack */ |
| 1326 | GAMEL(1994, pebe0014, 0, peplus, peplus_bjack, pe | |
| 1279 | GAMEL(1994, pebe0014, 0, peplus, peplus_bjack, peplus | |
| 1327 | 1280 | |
| 1328 | 1281 | /* Normal board : keno */ |
| 1329 | GAMEL(1994, peke1012, 0, peplus, peplus_keno, pe | |
| 1282 | GAMEL(1994, peke1012, 0, peplus, peplus_keno, peplus | |
| 1330 | 1283 | |
| 1331 | 1284 | /* Normal board : slots machine */ |
| 1332 | GAMEL(1996, peps0615, 0, peplus, peplus_slots, peps0615, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots", 0, layout_pe_slots ) | |
| 1333 | GAMEL(1996, peps0716, 0, peplus, peplus_slots, peps0716, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PS0716) Quarter Mania Slots", 0, layout_pe_slots ) | |
| 1285 | GAMEL(1996, peps0615, 0, peplus, peplus_slots, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots", 0, layout_pe_slots ) | |
| 1286 | GAMEL(1996, peps0716, 0, peplus, peplus_slots, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PS0716) Quarter Mania Slots", 0, layout_pe_slots ) | |
| 1334 | 1287 | |
| 1335 | 1288 | /* Superboard : poker */ |
| 1336 | GAMEL(1995, pexp0019, 0, peplus, peplus_poker, pe | |
| 1289 | GAMEL(1995, pexp0019, 0, peplus, peplus_poker, pe | |
| 1337 | 1290 | |
| 1338 | 1291 | /* Superboard : multi-poker */ |
| 1339 | GAMEL(1995, pexmp006, 0, peplus, peplus_poker, pe | |
| 1292 | GAMEL(1995, pexmp006, 0, peplus, peplus_poker, pe | |
| 1340 | 1293 | |
| 1341 | 1294 | /* Superboard : slots machine */ |
| 1342 | GAMEL(1997, pexs0006, 0, peplus, peplus_slots, pe | |
| 1295 | GAMEL(1997, pexs0006, 0, peplus, peplus_slots, peplussb |
| r1591 | r1592 | |
|---|---|---|
| 692 | 692 | int changed = resetcontrol ^ prev_resetcontrol; |
| 693 | 693 | if(changed & 2) { |
| 694 | 694 | if(resetcontrol & 2) { |
| 695 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 696 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 695 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 696 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 697 | 697 | // mame_printf_debug("enable 2nd cpu!\n"); |
| 698 | 698 | // DEBUGGER_BREAK; |
| 699 | 699 | s24_fd1094_machine_init(); |
| 700 | 700 | |
| 701 | 701 | } else |
| 702 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 702 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 703 | 703 | } |
| 704 | 704 | if(changed & 4) |
| 705 | 705 | sndti_reset(SOUND_YM2151, 0); |
| r1591 | r1592 | |
| 824 | 824 | { |
| 825 | 825 | irq_timer_pend0 = irq_timer_pend1 = 1; |
| 826 | 826 | if(irq_allow0 & (1 << IRQ_TIMER)) |
| 827 | cpunum_set_input_line(0, IRQ_TIMER+1, ASSERT_LINE); | |
| 827 | cpunum_set_input_line(machine, 0, IRQ_TIMER+1, ASSERT_LINE); | |
| 828 | 828 | if(irq_allow1 & (1 << IRQ_TIMER)) |
| 829 | cpunum_set_input_line(1, IRQ_TIMER+1, ASSERT_LINE); | |
| 829 | cpunum_set_input_line(machine, 1, IRQ_TIMER+1, ASSERT_LINE); | |
| 830 | 830 | } |
| 831 | 831 | |
| 832 | 832 | static void irq_init(void) |
| r1591 | r1592 | |
| 869 | 869 | break; |
| 870 | 870 | case 2: |
| 871 | 871 | irq_allow0 = data; |
| 872 | cpunum_set_input_line(0, IRQ_TIMER+1, irq_timer_pend0 && (irq_allow0 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE); | |
| 873 | cpunum_set_input_line(0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 872 | cpunum_set_input_line(Machine, 0, IRQ_TIMER+1, irq_timer_pend0 && (irq_allow0 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE); | |
| 873 | cpunum_set_input_line(Machine, 0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 874 | 874 | break; |
| 875 | 875 | case 3: |
| 876 | 876 | irq_allow1 = data; |
| 877 | cpunum_set_input_line(1, IRQ_TIMER+1, irq_timer_pend1 && (irq_allow1 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE); | |
| 878 | cpunum_set_input_line(1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 877 | cpunum_set_input_line(Machine, 1, IRQ_TIMER+1, irq_timer_pend1 && (irq_allow1 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE); | |
| 878 | cpunum_set_input_line(Machine, 1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 879 | 879 | break; |
| 880 | 880 | } |
| 881 | 881 | } |
| r1591 | r1592 | |
| 886 | 886 | don't get uploaded correctly and you see nothing */ |
| 887 | 887 | static TIMER_CALLBACK( gground_generate_kludge_irq ) |
| 888 | 888 | { |
| 889 | cpunum_set_input_line(1, 5, HOLD_LINE); | |
| 889 | cpunum_set_input_line(machine, 1, 5, HOLD_LINE); | |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | 892 | |
| r1591 | r1592 | |
| 907 | 907 | if (activecpu_get_pc()==0x084ba) |
| 908 | 908 | { |
| 909 | 909 | /* Clear IRQ line so IRQ doesn't happen too early */ |
| 910 | cpunum_set_input_line(1, 5, CLEAR_LINE); | |
| 910 | cpunum_set_input_line(Machine, 1, 5, CLEAR_LINE); | |
| 911 | 911 | |
| 912 | 912 | /* set a timer to generate an irq at the needed point */ |
| 913 | 913 | if (ggground_kludge == 1) |
| r1591 | r1592 | |
| 931 | 931 | if (activecpu_get_pc()==0x084bc) |
| 932 | 932 | { |
| 933 | 933 | /* Clear IRQ line so IRQ doesn't happen too early */ |
| 934 | cpunum_set_input_line(1, 5, CLEAR_LINE); | |
| 934 | cpunum_set_input_line(Machine, 1, 5, CLEAR_LINE); | |
| 935 | 935 | |
| 936 | 936 | /* set a timer to generate an irq at the needed point */ |
| 937 | 937 | if (ggground_kludge == 1) |
| r1591 | r1592 | |
| 946 | 946 | switch(offset) { |
| 947 | 947 | case 2: |
| 948 | 948 | irq_timer_pend0 = 0; |
| 949 | cpunum_set_input_line(0, IRQ_TIMER+1, CLEAR_LINE); | |
| 949 | cpunum_set_input_line(Machine, 0, IRQ_TIMER+1, CLEAR_LINE); | |
| 950 | 950 | break; |
| 951 | 951 | case 3: |
| 952 | 952 | irq_timer_pend1 = 0; |
| 953 | cpunum_set_input_line(1, IRQ_TIMER+1, CLEAR_LINE); | |
| 953 | cpunum_set_input_line(Machine, 1, IRQ_TIMER+1, CLEAR_LINE); | |
| 954 | 954 | break; |
| 955 | 955 | } |
| 956 | 956 | return 0xffff; |
| r1591 | r1592 | |
| 962 | 962 | int mask = 1 << irq; |
| 963 | 963 | |
| 964 | 964 | if(irq_allow0 & mask) |
| 965 | cpunum_set_input_line(0, 1+irq, HOLD_LINE); | |
| 965 | cpunum_set_input_line(machine, 0, 1+irq, HOLD_LINE); | |
| 966 | 966 | |
| 967 | 967 | if(irq_allow1 & mask) |
| 968 | cpunum_set_input_line(1, 1+irq, HOLD_LINE); | |
| 968 | cpunum_set_input_line(machine, 1, 1+irq, HOLD_LINE); | |
| 969 | 969 | |
| 970 | 970 | if(!cpu_getiloops()) { |
| 971 | 971 | // Ensure one index pulse every 20 frames |
| r1591 | r1592 | |
| 980 | 980 | static void irq_ym(int irq) |
| 981 | 981 | { |
| 982 | 982 | irq_yms = irq; |
| 983 | cpunum_set_input_line(0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 984 | cpunum_set_input_line(1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 983 | cpunum_set_input_line(Machine, 0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 984 | cpunum_set_input_line(Machine, 1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 985 | 985 | } |
| 986 | 986 | |
| 987 | 987 | |
| r1591 | r1592 | |
| 1265 | 1265 | |
| 1266 | 1266 | static MACHINE_RESET(system24) |
| 1267 | 1267 | { |
| 1268 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1268 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1269 | 1269 | prev_resetcontrol = resetcontrol = 0x06; |
| 1270 | 1270 | fdc_init(); |
| 1271 | 1271 | curbank = 0; |
| r1591 | r1592 | |
|---|---|---|
| 183 | 183 | |
| 184 | 184 | static TIMER_CALLBACK( clear_irq_cb ) |
| 185 | 185 | { |
| 186 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 186 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | static INTERRUPT_GEN( assert_irq ) |
| 190 | 190 | { |
| 191 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 191 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 192 | 192 | timer_set(ATTOTIME_IN_CYCLES(14288, 0), NULL, 0, clear_irq_cb); |
| 193 | 193 | /* Timing here is an educated GUESS, Z80 /INT must stay high so the irq |
| 194 | 194 | fires no less than TWICE per frame, else game doesn't work right. |
| r1591 | r1592 | |
|---|---|---|
| 171 | 171 | static WRITE8_HANDLER( sound_w ) |
| 172 | 172 | { |
| 173 | 173 | soundlatch_w(offset,data); |
| 174 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 174 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | static WRITE8_HANDLER( i8257_CH0_w ) |
| r1591 | r1592 | |
| 386 | 386 | static INTERRUPT_GEN( ddayjlc_interrupt ) |
| 387 | 387 | { |
| 388 | 388 | if(main_nmi_enable) |
| 389 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 389 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | static INTERRUPT_GEN( ddayjlc_snd_interrupt ) |
| 393 | 393 | { |
| 394 | 394 | if(sound_nmi_enable) |
| 395 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 395 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | static MACHINE_DRIVER_START( ddayjlc ) |
| r1591 | r1592 | |
|---|---|---|
| 205 | 205 | static void system16a_generic_init(running_machine *machine) |
| 206 | 206 | { |
| 207 | 207 | /* call the generic init */ |
| 208 | | |
| 208 | MACHINE_RESET_CALL(sys16_onetim | |
| 209 | 209 | |
| 210 | 210 | /* init the FD1094 */ |
| 211 | 211 | fd1094_driver_init(NULL); |
| r1591 | r1592 | |
| 367 | 367 | 0= Sound is disabled |
| 368 | 368 | 1= sound is enabled |
| 369 | 369 | */ |
| 370 | cpunum_set_input_line(1, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 370 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 371 | 371 | segaic16_tilemap_set_colscroll(0, ~data & 0x04); |
| 372 | 372 | segaic16_tilemap_set_rowscroll(0, ~data & 0x02); |
| 373 | 373 | } |
| r1591 | r1592 | |
| 419 | 419 | D1 = /RESET line on 7751 |
| 420 | 420 | D0 = /IRQ line on 7751 |
| 421 | 421 | */ |
| 422 | cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 423 | cpunum_set_input_line(2, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 422 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 423 | cpunum_set_input_line(Machine, 2, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 424 | 424 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 425 | 425 | } |
| 426 | 426 | |
| r1591 | r1592 | |
| 497 | 497 | UINT8 min = workram[0x202/2] & 0xff; |
| 498 | 498 | |
| 499 | 499 | /* signal a VBLANK to the main CPU */ |
| 500 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 500 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 501 | 501 | |
| 502 | 502 | /* out of time? set the flag */ |
| 503 | 503 | if (tick == 0 && sec == 0 && min == 0) |
| r1591 | r1592 | |
| 537 | 537 | static void quartet_i8751_sim(void) |
| 538 | 538 | { |
| 539 | 539 | /* signal a VBLANK to the main CPU */ |
| 540 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 540 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 541 | 541 | |
| 542 | 542 | /* X scroll values */ |
| 543 | 543 | segaic16_textram_0_w(0xff8/2, workram[0x0d14/2], 0); |
| r1591 | r1592 | |
| 803 | 803 | AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_READWRITE(MRA16_RAM, segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0) |
| 804 | 804 | AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_READWRITE(MRA16_RAM, segaic16_textram_0_w) AM_BASE(&segaic16_textram_0) |
| 805 | 805 | AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_BASE(&segaic16_spriteram_0) |
| 806 | AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_READWRITE( | |
| 806 | AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_READWRITE(MRA | |
| 807 | 807 | AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w) |
| 808 | 808 | AM_RANGE(0xc60000, 0xc6ffff) AM_READ(watchdog_reset16_r) |
| 809 | 809 | AM_RANGE(0xc70000, 0xc73fff) AM_MIRROR(0x38c000) AM_RAM AM_BASE(&workram) |
| r1591 | r1592 | |
|---|---|---|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| 200 | static void update_interrupts( | |
| 200 | static void update_interrupts(running_machine *machine) | |
| 201 | 201 | { |
| 202 | 202 | int level = 0; |
| 203 | 203 | |
| r1591 | r1592 | |
| 208 | 208 | |
| 209 | 209 | /* either set or clear the appropriate lines */ |
| 210 | 210 | if (level) |
| 211 | cpunum_set_input_line(0, level, ASSERT_LINE); | |
| 211 | cpunum_set_input_line(machine, 0, level, ASSERT_LINE); | |
| 212 | 212 | else |
| 213 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 213 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| r1591 | r1592 | |
| 220 | 220 | if (data & 0x02) display_position_interrupt_pending = 0; |
| 221 | 221 | if (data & 0x04) vblank_interrupt_pending = 0; |
| 222 | 222 | |
| 223 | update_interrupts(); | |
| 223 | update_interrupts(Machine); | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| r1591 | r1592 | |
| 232 | 232 | if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) *** y: %02x x: %02x\n", video_screen_get_vpos(0), video_screen_get_hpos(0)); |
| 233 | 233 | display_position_interrupt_pending = 1; |
| 234 | 234 | |
| 235 | update_interrupts(); | |
| 235 | update_interrupts(machine); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT) |
| r1591 | r1592 | |
| 265 | 265 | |
| 266 | 266 | vblank_interrupt_pending = 1; |
| 267 | 267 | |
| 268 | update_interrupts(); | |
| 268 | update_interrupts(machine); | |
| 269 | 269 | |
| 270 | 270 | /* set timer for next screen */ |
| 271 | 271 | timer_adjust(vblank_interrupt_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, 0), 0, attotime_zero); |
| r1591 | r1592 | |
| 296 | 296 | |
| 297 | 297 | static void audio_cpu_irq(int assert) |
| 298 | 298 | { |
| 299 | cpunum_set_input_line(1, 0, assert ? ASSERT_LINE : CLEAR_LINE); | |
| 299 | cpunum_set_input_line(Machine, 1, 0, assert ? ASSERT_LINE : CLEAR_LINE); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | |
| 303 | 303 | static void audio_cpu_assert_nmi(void) |
| 304 | 304 | { |
| 305 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 305 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | |
| 309 | 309 | static WRITE8_HANDLER( audio_cpu_clear_nmi_w ) |
| 310 | 310 | { |
| 311 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 311 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | |
| r1591 | r1592 | |
| 748 | 748 | { |
| 749 | 749 | audio_cpu_rom_source_last = audio_cpu_rom_source; |
| 750 | 750 | |
| 751 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 751 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 752 | 752 | |
| 753 | 753 | if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", safe_activecpu_get_pc(), audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); |
| 754 | 754 | } |
| r1591 | r1592 | |
| 1014 | 1014 | start_interrupt_timers(); |
| 1015 | 1015 | |
| 1016 | 1016 | /* trigger the IRQ3 that was set by MACHINE_START */ |
| 1017 | update_interrupts(); | |
| 1017 | update_interrupts(machine); | |
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | 1020 |
| r1591 | r1592 | |
|---|---|---|
| 439 | 439 | if (konamigx_wrport1_1 & 0x10) |
| 440 | 440 | { |
| 441 | 441 | gx_rdport1_3 &= ~8; |
| 442 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 442 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | else |
| r1591 | r1592 | |
| 558 | 558 | { |
| 559 | 559 | // enable 68k |
| 560 | 560 | // clear the halt condition and reset the 68000 |
| 561 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 562 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 561 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 562 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 563 | 563 | } |
| 564 | 564 | else |
| 565 | 565 | { |
| 566 | 566 | // disable 68k |
| 567 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 567 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | K053246_set_OBJCHA_line((data&0x100000) ? ASSERT_LINE : CLEAR_LINE); |
| r1591 | r1592 | |
| 628 | 628 | // vblank interrupt ACK |
| 629 | 629 | if (!(mem_mask & 0xff000000)) |
| 630 | 630 | { |
| 631 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 631 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE); | |
| 632 | 632 | gx_syncen |= 0x20; |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | // hblank interrupt ACK |
| 636 | 636 | if (!(mem_mask & 0x0000ff00)) |
| 637 | 637 | { |
| 638 | cpunum_set_input_line(0, 2, CLEAR_LINE); | |
| 638 | cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE); | |
| 639 | 639 | gx_syncen |= 0x40; |
| 640 | 640 | } |
| 641 | 641 | } |
| r1591 | r1592 | |
| 653 | 653 | static TIMER_CALLBACK( dmaend_callback ) |
| 654 | 654 | { |
| 655 | 655 | // foul-proof (CPU0 could be deactivated while we wait) |
| 656 | if (resume_trigger && suspension_active) { suspension_active = 0; cpu_trigger(resume_trigger); } | |
| 656 | if (resume_trigger && suspension_active) { suspension_active = 0; cpu_trigger(machine, resume_trigger); } | |
| 657 | 657 | |
| 658 | 658 | // DMA busy flag must be cleared before triggering IRQ 3 |
| 659 | 659 | gx_rdport1_3 &= ~2; |
| r1591 | r1592 | |
| 665 | 665 | |
| 666 | 666 | // lower OBJINT-REQ flag and trigger interrupt |
| 667 | 667 | gx_rdport1_3 &= ~0x80; |
| 668 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 668 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 669 | 669 | } |
| 670 | 670 | } |
| 671 | 671 | |
| r1591 | r1592 | |
| 689 | 689 | static INTERRUPT_GEN(konamigx_vbinterrupt) |
| 690 | 690 | { |
| 691 | 691 | // lift idle suspension |
| 692 | if (resume_trigger && suspension_active) { suspension_active = 0; cpu_trigger(resume_trigger); } | |
| 692 | if (resume_trigger && suspension_active) { suspension_active = 0; cpu_trigger(machine, resume_trigger); } | |
| 693 | 693 | |
| 694 | 694 | // IRQ 1 is the main 60hz vblank interrupt |
| 695 | 695 | if (gx_syncen & 0x20) |
| r1591 | r1592 | |
| 699 | 699 | if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1)) |
| 700 | 700 | { |
| 701 | 701 | gx_syncen &= ~1; |
| 702 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 702 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 703 | 703 | } |
| 704 | 704 | } |
| 705 | 705 | |
| r1591 | r1592 | |
| 709 | 709 | static INTERRUPT_GEN(konamigx_vbinterrupt_type4) |
| 710 | 710 | { |
| 711 | 711 | // lift idle suspension |
| 712 | if (resume_trigger && suspension_active) { suspension_active = 0; cpu_trigger(resume_trigger); } | |
| 712 | if (resume_trigger && suspension_active) { suspension_active = 0; cpu_trigger(machine, resume_trigger); } | |
| 713 | 713 | |
| 714 | 714 | // IRQ 1 is the main 60hz vblank interrupt |
| 715 | 715 | // the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board |
| r1591 | r1592 | |
| 721 | 721 | if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1)) |
| 722 | 722 | { |
| 723 | 723 | gx_syncen &= ~1; |
| 724 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 724 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 725 | 725 | } |
| 726 | 726 | } |
| 727 | 727 | |
| r1591 | r1592 | |
| 744 | 744 | if ((konamigx_wrport1_1 & 0x82) == 0x82 || (gx_syncen & 2)) |
| 745 | 745 | { |
| 746 | 746 | gx_syncen &= ~2; |
| 747 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 747 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 748 | 748 | } |
| 749 | 749 | } |
| 750 | 750 | } |
| r1591 | r1592 | |
| 823 | 823 | |
| 824 | 824 | if (reg == 7) |
| 825 | 825 | { |
| 826 | cpunum_set_input_line(1, 1, HOLD_LINE); | |
| 826 | cpunum_set_input_line(Machine, 1, 1, HOLD_LINE); | |
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | 829 | |
| r1591 | r1592 | |
| 1096 | 1096 | if (konamigx_wrport1_1 & 0x10) |
| 1097 | 1097 | { |
| 1098 | 1098 | gx_rdport1_3 &= ~8; |
| 1099 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1099 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | // don't accidentally do a phony command |
| r1591 | r1592 | |
| 3444 | 3444 | tms57002_init(); |
| 3445 | 3445 | |
| 3446 | 3446 | // sound CPU initially disabled? |
| 3447 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 3447 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 3448 | 3448 | |
| 3449 | 3449 | if (!strcmp(machine->gamedrv->name, "tkmmpzdm")) |
| 3450 | 3450 | { |
| r1591 | r1592 | |
|---|---|---|
| 122 | 122 | { |
| 123 | 123 | /* according to the schematics, IRQ2 is generated every 16 scanlines */ |
| 124 | 124 | if (cpu_getiloops() != 0) |
| 125 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 125 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 126 | 126 | else |
| 127 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 127 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 128 | 128 | } |
| 129 | 129 | #endif |
| 130 | 130 | |
| r1591 | r1592 | |
| 271 | 271 | /* D2 : SCONT1 - Tilemap origin bit 1 */ |
| 272 | 272 | /* D1 : SCONT0 - Tilemap origin bit 0 */ |
| 273 | 273 | /* D0 : MUTE (1= audio on, 0= audio off) */ |
| 274 | cpunum_set_input_line(2, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 274 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 275 | 275 | segaic16_tilemap_set_colscroll(0, ~data & 0x04); |
| 276 | 276 | segaic16_tilemap_set_rowscroll(0, ~data & 0x02); |
| 277 | 277 | sound_global_enable(data & 0x01); |
| r1591 | r1592 | |
| 284 | 284 | /* D6 : INTR line on second CPU */ |
| 285 | 285 | /* D5 : RESET line on second CPU */ |
| 286 | 286 | /* D3-D2 : ADC_SELECT */ |
| 287 | cpunum_set_input_line(1, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 288 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 287 | cpunum_set_input_line(Machine, 1, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 288 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 289 | 289 | adc_select = (data >> 2) & 3; |
| 290 | 290 | } |
| 291 | 291 | |
| r1591 | r1592 | |
| 338 | 338 | |
| 339 | 339 | static void sound_irq(int irq) |
| 340 | 340 | { |
| 341 | cpunum_set_input_line(2, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 341 | cpunum_set_input_line(Machine, 2, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 |
| r1591 | r1592 | |
|---|---|---|
| 276 | 276 | if (cpu_getiloops() == 0) |
| 277 | 277 | { |
| 278 | 278 | if(sprcros2_m_port7&0x01) |
| 279 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 279 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 280 | 280 | } |
| 281 | 281 | else |
| 282 | 282 | { |
| 283 | 283 | if(sprcros2_m_port7&0x08) |
| 284 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 284 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | static INTERRUPT_GEN( sprcros2_s_interrupt ) |
| 289 | 289 | { |
| 290 | 290 | if(sprcros2_s_port3&0x01) |
| 291 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 291 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | static MACHINE_START( sprcros2 ) |
| r1591 | r1592 | |
|---|---|---|
| 601 | 601 | |
| 602 | 602 | static INTERRUPT_GEN( statriv2_interrupt ) |
| 603 | 603 | { |
| 604 | cpunum_set_input_line(0, I8085_RST75_LINE, HOLD_LINE); | |
| 604 | cpunum_set_input_line(machine, 0, I8085_RST75_LINE, HOLD_LINE); | |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | static MACHINE_DRIVER_START( statriv2 ) |
| 608 | 608 | /* basic machine hardware */ |
| 609 | MDRV_CPU_ADD_TAG("main",8085A,12400000) /* 12.4MHz / 4? */ | |
| 609 | /* FIXME: The 8085A had a max clock of 6MHz, internally divided by 2! */ | |
| 610 | MDRV_CPU_ADD_TAG("main",8085A,12400000*2) /* 12.4MHz / 4? */ | |
| 610 | 611 | MDRV_CPU_PROGRAM_MAP(statriv2_readmem,statriv2_writemem) |
| 611 | 612 | MDRV_CPU_IO_MAP(statriv2_readport,statriv2_writeport) |
| 612 | 613 | MDRV_CPU_VBLANK_INT(statriv2_interrupt,1) |
| r1591 | r1592 | |
|---|---|---|
| 34 | 34 | * |
| 35 | 35 | *************************************/ |
| 36 | 36 | |
| 37 | static void update_interrupts( | |
| 37 | static void update_interrupts(running_machine *machine) | |
| 38 | 38 | { |
| 39 | 39 | int newstate = 0; |
| 40 | 40 | int newstate2 = 0; |
| r1591 | r1592 | |
| 45 | 45 | newstate |= 6; |
| 46 | 46 | |
| 47 | 47 | if (newstate) |
| 48 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 48 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 49 | 49 | else |
| 50 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 50 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 51 | 51 | |
| 52 | 52 | if (newstate2) |
| 53 | cpunum_set_input_line(1, newstate2, ASSERT_LINE); | |
| 53 | cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE); | |
| 54 | 54 | else |
| 55 | cpunum_set_input_line(1, 7, CLEAR_LINE); | |
| 55 | cpunum_set_input_line(machine, 1, 7, CLEAR_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| r1591 | r1592 | |
| 95 | 95 | { |
| 96 | 96 | /* 0 means hold CPU 2's reset low */ |
| 97 | 97 | if (data & 1) |
| 98 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 98 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 99 | 99 | else |
| 100 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 100 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 101 | 101 | |
| 102 | 102 | /* bits 2-5 are the alpha bank */ |
| 103 | 103 | if (thunderj_alpha_tile_bank != ((data >> 2) & 7)) |
| r1591 | r1592 | |
|---|---|---|
| 104 | 104 | static WRITE16_HANDLER( sound_irq_trigger_w ) |
| 105 | 105 | { |
| 106 | 106 | if (ACCESSING_LSB) |
| 107 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 107 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 |
| r1591 | r1592 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | static INTERRUPT_GEN( parodius_interrupt ) |
| 25 | 25 | { |
| 26 | if (K052109_is_IRQ_enabled()) cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 26 | if (K052109_is_IRQ_enabled()) cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | static READ8_HANDLER( bankedram_r ) |
| r1591 | r1592 | |
| 31 | 31 | if (videobank & 0x01) |
| 32 | 32 | { |
| 33 | 33 | if (videobank & 0x04) |
| 34 | return paletteram | |
| 34 | return paletteram[ | |
| 35 | 35 | else |
| 36 | return paletteram | |
| 36 | return paletteram[ | |
| 37 | 37 | } |
| 38 | 38 | else |
| 39 | 39 | return ram[offset]; |
| r1591 | r1592 | |
| 99 | 99 | |
| 100 | 100 | static WRITE8_HANDLER( parodius_sh_irqtrigger_w ) |
| 101 | 101 | { |
| 102 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 102 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | #if 0 |
| r1591 | r1592 | |
| 107 | 107 | |
| 108 | 108 | static void sound_nmi_callback( int param ) |
| 109 | 109 | { |
| 110 | cpunum_set_input_line(1, INPUT_LINE_NMI, ( nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 110 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ( nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE ); | |
| 111 | 111 | |
| 112 | 112 | nmi_enabled = 0; |
| 113 | 113 | } |
| r1591 | r1592 | |
| 115 | 115 | |
| 116 | 116 | static TIMER_CALLBACK( nmi_callback ) |
| 117 | 117 | { |
| 118 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 118 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static WRITE8_HANDLER( sound_arm_nmi_w ) |
| 122 | 122 | { |
| 123 | 123 | // sound_nmi_enabled = 1; |
| 124 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 124 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 125 | 125 | timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback); /* kludge until the K053260 is emulated correctly */ |
| 126 | 126 | } |
| 127 | 127 |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | static INTERRUPT_GEN( ladybug_interrupt ) |
| 111 | 111 | { |
| 112 | 112 | if (readinputport(5) & 1) /* Left Coin */ |
| 113 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 113 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 114 | 114 | else if (readinputport(5) & 2) /* Right Coin */ |
| 115 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 115 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | static WRITE8_HANDLER( blueprnt_sound_command_w ) |
| 82 | 82 | { |
| 83 | 83 | soundlatch_w(offset, data); |
| 84 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 84 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE8_HANDLER( blueprnt_coin_counter_w ) |
| r1591 | r1592 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | static WRITE8_HANDLER( combasc_sh_irqtrigger_w ) |
| 215 | 215 | { |
| 216 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 216 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | static WRITE8_HANDLER( combasc_play_w ) |
| r1591 | r1592 | |
| 659 | 659 | static MACHINE_DRIVER_START( combasc ) |
| 660 | 660 | |
| 661 | 661 | /* basic machine hardware */ |
| 662 | MDRV_CPU_ADD(HD6309, 3000000) /* 3 MHz? */ | |
| 662 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 3 MHz? */ | |
| 663 | 663 | MDRV_CPU_PROGRAM_MAP(combasc_readmem,combasc_writemem) |
| 664 | 664 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 665 | 665 | |
| r1591 | r1592 | |
| 702 | 702 | static MACHINE_DRIVER_START( combascb ) |
| 703 | 703 | |
| 704 | 704 | /* basic machine hardware */ |
| 705 | MDRV_CPU_ADD(HD6309, 3000000) /* 3 MHz? */ | |
| 705 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 3 MHz? */ | |
| 706 | 706 | MDRV_CPU_PROGRAM_MAP(combascb_readmem,combascb_writemem) |
| 707 | 707 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| 708 | 708 |
| r1591 | r1592 | |
|---|---|---|
| 65 | 65 | static INTERRUPT_GEN( rockrage_interrupt ) |
| 66 | 66 | { |
| 67 | 67 | if (K007342_is_INT_enabled()) |
| 68 | cpunum_set_input_line(0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 68 | cpunum_set_input_line(machine, 0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static WRITE8_HANDLER( rockrage_bankswitch_w ) |
| r1591 | r1592 | |
| 87 | 87 | static WRITE8_HANDLER( rockrage_sh_irqtrigger_w ) |
| 88 | 88 | { |
| 89 | 89 | soundlatch_w(offset, data); |
| 90 | cpunum_set_input_line(1,M6809_IRQ_LINE,HOLD_LINE); | |
| 90 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | static READ8_HANDLER( rockrage_VLM5030_busy_r ) { |
| r1591 | r1592 | |
| 104 | 104 | AM_RANGE(0x0000, 0x1fff) AM_READ(K007342_r) /* Color RAM + Video RAM */ |
| 105 | 105 | AM_RANGE(0x2000, 0x21ff) AM_READ(K007420_r) /* Sprite RAM */ |
| 106 | 106 | AM_RANGE(0x2200, 0x23ff) AM_READ(K007342_scroll_r) /* Scroll RAM */ |
| 107 | AM_RANGE(0x2400, 0x247f) AM_READ( | |
| 107 | AM_RANGE(0x2400, 0x247f) AM_READ(MRA8 | |
| 108 | 108 | AM_RANGE(0x2e01, 0x2e01) AM_READ(input_port_3_r) /* 1P controls */ |
| 109 | 109 | AM_RANGE(0x2e02, 0x2e02) AM_READ(input_port_4_r) /* 2P controls */ |
| 110 | 110 | AM_RANGE(0x2e03, 0x2e03) AM_READ(input_port_1_r) /* DISPW #2 */ |
| r1591 | r1592 | |
| 292 | 292 | static MACHINE_DRIVER_START( rockrage ) |
| 293 | 293 | |
| 294 | 294 | /* basic machine hardware */ |
| 295 | MDRV_CPU_ADD(HD6309, 3000000) /* 24MHz/8 */ | |
| 295 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 24MHz/8 */ | |
| 296 | 296 | MDRV_CPU_PROGRAM_MAP(rockrage_readmem,rockrage_writemem) |
| 297 | 297 | MDRV_CPU_VBLANK_INT(rockrage_interrupt,1) |
| 298 | 298 |
| r1591 | r1592 | |
|---|---|---|
| 77 | 77 | DRIVER_INIT ( ic13 ) |
| 78 | 78 | { |
| 79 | 79 | ic13_shifter(); |
| 80 | | |
| 80 | DRIVER_INIT_CALL(stv | |
| 81 | 81 | } |
| 82 | 82 | /* |
| 83 | 83 | EEPROM write 0000 to address 2d |
| r1591 | r1592 | |
| 226 | 226 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ae8e0, 0x60ae8e3, 0, 0, shienryu_speedup_r ); // after you enable sound cpu |
| 227 | 227 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ae8e4, 0x60ae8e7, 0, 0, shienryu_slave_speedup_r ); // after you enable sound cpu |
| 228 | 228 | |
| 229 | | |
| 229 | DRIVER_INIT_CALL(stv | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | static READ32_HANDLER( prikura_speedup_r ) |
| r1591 | r1592 | |
| 254 | 254 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b9228, 0x60b922b, 0, 0, prikura_speedup_r ); |
| 255 | 255 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)prikura_slave_speedup ); |
| 256 | 256 | |
| 257 | | |
| 257 | DRIVER_INIT_CALL(stv | |
| 258 | 258 | |
| 259 | 259 | minit_boost = sinit_boost = 0; |
| 260 | 260 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| r1591 | r1592 | |
| 272 | 272 | static READ32_HANDLER( hanagumi_slave_off ) |
| 273 | 273 | { |
| 274 | 274 | /* just turn the slave off, i don't think the game needs it */ |
| 275 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 275 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 276 | 276 | |
| 277 | 277 | return stv_workram_h[0x015438/4]; |
| 278 | 278 | } |
| r1591 | r1592 | |
| 299 | 299 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6094188, 0x609418b, 0, 0, hanagumi_speedup_r ); |
| 300 | 300 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6015438, 0x601543b, 0, 0, hanagumi_slave_off ); |
| 301 | 301 | |
| 302 | | |
| 302 | DRIVER_INIT_CALL(stv | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| r1591 | r1592 | |
| 341 | 341 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, puyosun_speedup_r ); // idle loop of main cpu |
| 342 | 342 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)puyosun_slave_speedup ); |
| 343 | 343 | |
| 344 | | |
| 344 | DRIVER_INIT_CALL(ic13 | |
| 345 | 345 | |
| 346 | 346 | minit_boost = sinit_boost = 0; |
| 347 | 347 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| r1591 | r1592 | |
| 368 | 368 | { |
| 369 | 369 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, mausuke_speedup_r ); // idle loop of main cpu |
| 370 | 370 | |
| 371 | | |
| 371 | DRIVER_INIT_CALL(ic13 | |
| 372 | 372 | |
| 373 | 373 | minit_boost = sinit_boost = 0; |
| 374 | 374 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| r1591 | r1592 | |
| 406 | 406 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cottonbm_speedup_r ); // idle loop of main cpu |
| 407 | 407 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cottonbm_slave_speedup ); |
| 408 | 408 | |
| 409 | | |
| 409 | DRIVER_INIT_CALL(stv | |
| 410 | 410 | |
| 411 | 411 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(10); |
| 412 | 412 | } |
| r1591 | r1592 | |
| 442 | 442 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cotton2_speedup_r ); // idle loop of main cpu |
| 443 | 443 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cotton2_slave_speedup ); |
| 444 | 444 | |
| 445 | | |
| 445 | DRIVER_INIT_CALL(stv | |
| 446 | 446 | |
| 447 | 447 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 448 | 448 | } |
| r1591 | r1592 | |
| 463 | 463 | |
| 464 | 464 | if ( data != 0 ) dnmtdeka_pending_commands++; |
| 465 | 465 | //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, dnmtdeka_pending_commands ); |
| 466 | cpu_trigger(1000); | |
| 466 | cpu_trigger(Machine, 1000); | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | static READ32_HANDLER(dnmtdeka_cmd_read) |
| r1591 | r1592 | |
| 494 | 494 | memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_write ); |
| 495 | 495 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_read ); |
| 496 | 496 | |
| 497 | | |
| 497 | DRIVER_INIT_CALL(ic13 | |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | static int diehard_pending_commands; |
| r1591 | r1592 | |
| 513 | 513 | |
| 514 | 514 | if ( data != 0 ) diehard_pending_commands++; |
| 515 | 515 | //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, diehard_pending_commands ); |
| 516 | cpu_trigger(1000); | |
| 516 | cpu_trigger(Machine, 1000); | |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | static READ32_HANDLER(diehard_cmd_read) |
| r1591 | r1592 | |
| 537 | 537 | if ( (stv_workram_h[0x000e0dd8/4] & 0xff000000) == 0 && |
| 538 | 538 | diehard_pending_commands == 0 ) |
| 539 | 539 | { |
| 540 | cpu_trigger(1000); | |
| 540 | cpu_trigger(Machine, 1000); | |
| 541 | 541 | } |
| 542 | 542 | return stv_workram_h[0x000e0dd8/4]; |
| 543 | 543 | } |
| r1591 | r1592 | |
| 556 | 556 | { |
| 557 | 557 | //logerror( "CMDACK: Write by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, diehard_pending_commands ); |
| 558 | 558 | COMBINE_DATA(&stv_workram_h[0x000e0dd8/4]); |
| 559 | cpu_trigger(1000); | |
| 559 | cpu_trigger(Machine, 1000); | |
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | DRIVER_INIT(diehard) |
| r1591 | r1592 | |
| 571 | 571 | memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write ); |
| 572 | 572 | |
| 573 | 573 | |
| 574 | | |
| 574 | DRIVER_INIT_CALL(ic13 | |
| 575 | 575 | |
| 576 | 576 | } |
| 577 | 577 | |
| r1591 | r1592 | |
| 604 | 604 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6090740, 0x6090743, 0, 0, fhboxers_speedup2_r ); // idle loop of second cpu |
| 605 | 605 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06090bb4, 0x06090bb7, 0, 0, fhboxers_speedup3_r ); // idle loop of main cpu |
| 606 | 606 | |
| 607 | | |
| 607 | DRIVER_INIT_CALL(ic13 | |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | |
| r1591 | r1592 | |
| 617 | 617 | |
| 618 | 618 | static READ32_HANDLER( bakubaku_speedup2_r ) |
| 619 | 619 | { |
| 620 | if (activecpu_get_pc()==0x06033762) cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 620 | if (activecpu_get_pc()==0x06033762) cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 621 | 621 | |
| 622 | 622 | return stv_workram_h[0x0033762/4]; |
| 623 | 623 | } |
| r1591 | r1592 | |
| 637 | 637 | memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60fdfe8, 0x60fdfeb, 0, 0, bakubaku_speedup2_r ); // turn off slave sh2, is it needed after boot ?? |
| 638 | 638 | //memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6033660, 0x6033663, 0, 0, bakubaku_hangskip_r ); // it waits for a ram address to change what should change it? |
| 639 | 639 | |
| 640 | | |
| 640 | DRIVER_INIT_CALL(ic13 | |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | static READ32_HANDLER( groovef_hack1_r ) |
| r1591 | r1592 | |
| 669 | 669 | /* |
| 670 | 670 | static READ32_HANDLER( groovef_second_cpu_off_r ) |
| 671 | 671 | { |
| 672 | if (activecpu_get_pc()==0x060060c2) cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 672 | if (activecpu_get_pc()==0x060060c2) cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 673 | 673 | return 0; |
| 674 | 674 | } |
| 675 | 675 | */ |
| r1591 | r1592 | |
| 691 | 691 | // memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60060dc, 0x60060df, 0, 0, groovef_second_cpu_off_r ); // not a good idea, needs it for ai. |
| 692 | 692 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)groovef_slave_speedup ); |
| 693 | 693 | |
| 694 | | |
| 694 | DRIVER_INIT_CALL(stv | |
| 695 | 695 | |
| 696 | 696 | minit_boost = sinit_boost = 0; |
| 697 | 697 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| r1591 | r1592 | |
| 753 | 753 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, danchih_speedup_r ); |
| 754 | 754 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)danchih_slave_speedup ); |
| 755 | 755 | |
| 756 | | |
| 756 | DRIVER_INIT_CALL(stv | |
| 757 | 757 | |
| 758 | 758 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5); |
| 759 | 759 | |
| r1591 | r1592 | |
| 802 | 802 | |
| 803 | 803 | install_astrass_protection(); |
| 804 | 804 | |
| 805 | | |
| 805 | DRIVER_INIT_CALL(ic13 | |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | /* Treasure Hunt idle loop skipping */ |
| r1591 | r1592 | |
| 857 | 857 | |
| 858 | 858 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)thunt_slave_speedup); |
| 859 | 859 | |
| 860 | | |
| 860 | DRIVER_INIT_CALL(ic13 | |
| 861 | 861 | |
| 862 | 862 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1); |
| 863 | 863 | } |
| r1591 | r1592 | |
| 887 | 887 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060314f8, 0x060314fb, 0, 0, sandor_speedup_r ); |
| 888 | 888 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06075a2c, 0x06075a2f, 0, 0, sandor_speedup2_r ); |
| 889 | 889 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)sandor_slave_speedup); |
| 890 | | |
| 890 | DRIVER_INIT_CALL(ic13 | |
| 891 | 891 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1); |
| 892 | 892 | |
| 893 | 893 | } |
| r1591 | r1592 | |
| 934 | 934 | |
| 935 | 935 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)grdforce_slave_speedup); |
| 936 | 936 | |
| 937 | | |
| 937 | DRIVER_INIT_CALL(stv | |
| 938 | 938 | |
| 939 | 939 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 940 | 940 | } |
| r1591 | r1592 | |
| 961 | 961 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0602acf0, 0x0602acf3, 0, 0, batmanfr_speedup_r ); |
| 962 | 962 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)batmanfr_slave_speedup ); |
| 963 | 963 | |
| 964 | | |
| 964 | DRIVER_INIT_CALL(stv | |
| 965 | 965 | |
| 966 | 966 | minit_boost = sinit_boost = 0; |
| 967 | 967 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| r1591 | r1592 | |
| 983 | 983 | { |
| 984 | 984 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)colmns97_slave_speedup ); |
| 985 | 985 | |
| 986 | | |
| 986 | DRIVER_INIT_CALL(ic13 | |
| 987 | 987 | |
| 988 | 988 | minit_boost = sinit_boost = 0; |
| 989 | 989 | |
| r1591 | r1592 | |
| 1008 | 1008 | |
| 1009 | 1009 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)winterht_slave_speedup ); |
| 1010 | 1010 | |
| 1011 | | |
| 1011 | DRIVER_INIT_CALL(ic13 | |
| 1012 | 1012 | |
| 1013 | 1013 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(2); |
| 1014 | 1014 | } |
| r1591 | r1592 | |
| 1033 | 1033 | |
| 1034 | 1034 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)seabass_slave_speedup ); |
| 1035 | 1035 | |
| 1036 | | |
| 1036 | DRIVER_INIT_CALL(ic13 | |
| 1037 | 1037 | |
| 1038 | 1038 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5); |
| 1039 | 1039 | } |
| r1591 | r1592 | |
| 1056 | 1056 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06074f98, 0x06074f9b, 0, 0, vfremix_speedup_r ); |
| 1057 | 1057 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)vfremix_slave_speedup ); |
| 1058 | 1058 | |
| 1059 | | |
| 1059 | DRIVER_INIT_CALL(ic13 | |
| 1060 | 1060 | |
| 1061 | 1061 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(20); |
| 1062 | 1062 | } |
| r1591 | r1592 | |
| 1081 | 1081 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, sss_speedup_r ); |
| 1082 | 1082 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sss_slave_speedup ); |
| 1083 | 1083 | |
| 1084 | | |
| 1084 | DRIVER_INIT_CALL(ic13 | |
| 1085 | 1085 | |
| 1086 | 1086 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 1087 | 1087 | } |
| r1591 | r1592 | |
| 1108 | 1108 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, othellos_speedup_r ); |
| 1109 | 1109 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)othellos_slave_speedup ); |
| 1110 | 1110 | |
| 1111 | | |
| 1111 | DRIVER_INIT_CALL(stv | |
| 1112 | 1112 | |
| 1113 | 1113 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 1114 | 1114 | |
| r1591 | r1592 | |
| 1125 | 1125 | { |
| 1126 | 1126 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sasissu_slave_speedup ); |
| 1127 | 1127 | |
| 1128 | | |
| 1128 | DRIVER_INIT_CALL(ic13 | |
| 1129 | 1129 | |
| 1130 | 1130 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(2); |
| 1131 | 1131 | } |
| r1591 | r1592 | |
| 1139 | 1139 | DRIVER_INIT(gaxeduel) |
| 1140 | 1140 | { |
| 1141 | 1141 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002f4068, 0x002f406b, 0, 0, gaxeduel_speedup_r); |
| 1142 | | |
| 1142 | DRIVER_INIT_CALL(ic13 | |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | static READ32_HANDLER(suikoenb_speedup_r) |
| r1591 | r1592 | |
| 1151 | 1151 | DRIVER_INIT(suikoenb) |
| 1152 | 1152 | { |
| 1153 | 1153 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060705d0, 0x060705d3, 0, 0, suikoenb_speedup_r); |
| 1154 | | |
| 1154 | DRIVER_INIT_CALL(ic13 | |
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | static void sokyugrt_slave_speedup( UINT32 data ) |
| r1591 | r1592 | |
| 1173 | 1173 | { |
| 1174 | 1174 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sokyugrt_slave_speedup ); |
| 1175 | 1175 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060788cc, 0x060788cf, 0, 0, sokyugrt_speedup_r); |
| 1176 | | |
| 1176 | DRIVER_INIT_CALL(ic13 | |
| 1177 | 1177 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 1178 | 1178 | |
| 1179 | 1179 | } |
| r1591 | r1592 | |
| 1207 | 1207 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)znpwfv_slave_speedup ); |
| 1208 | 1208 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, znpwfv_speedup_r ); |
| 1209 | 1209 | |
| 1210 | | |
| 1210 | DRIVER_INIT_CALL(ic13 | |
| 1211 | 1211 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_NSEC(500); |
| 1212 | 1212 | } |
| 1213 | 1213 | |
| r1591 | r1592 | |
| 1229 | 1229 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)twcup98_slave_speedup ); |
| 1230 | 1230 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, twcup98_speedup_r ); |
| 1231 | 1231 | |
| 1232 | | |
| 1232 | DRIVER_INIT_CALL(ic13 | |
| 1233 | 1233 | install_standard_protection(); |
| 1234 | 1234 | |
| 1235 | 1235 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5); |
| r1591 | r1592 | |
| 1253 | 1253 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)smleague_slave_speedup ); |
| 1254 | 1254 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, smleague_speedup_r ); |
| 1255 | 1255 | |
| 1256 | | |
| 1256 | DRIVER_INIT_CALL(ic13 | |
| 1257 | 1257 | |
| 1258 | 1258 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 1259 | 1259 | } |
| r1591 | r1592 | |
| 1269 | 1269 | { |
| 1270 | 1270 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, finlarch_speedup_r ); |
| 1271 | 1271 | |
| 1272 | | |
| 1272 | DRIVER_INIT_CALL(ic13 | |
| 1273 | 1273 | |
| 1274 | 1274 | } |
| 1275 | 1275 | |
| r1591 | r1592 | |
| 1300 | 1300 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)maruchan_slave_speedup ); |
| 1301 | 1301 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, maruchan_speedup_r ); |
| 1302 | 1302 | |
| 1303 | | |
| 1303 | DRIVER_INIT_CALL(ic13 | |
| 1304 | 1304 | |
| 1305 | 1305 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50); |
| 1306 | 1306 | } |
| r1591 | r1592 | |
| 1317 | 1317 | { |
| 1318 | 1318 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0606c398, 0x0606c39b, 0, 0, pblbeach_speedup_r ); |
| 1319 | 1319 | |
| 1320 | | |
| 1320 | DRIVER_INIT_CALL(ic13 | |
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | static READ32_HANDLER( shanhigw_speedup_r ) |
| r1591 | r1592 | |
| 1331 | 1331 | { |
| 1332 | 1332 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06095cd8, 0x06095cdb, 0, 0, shanhigw_speedup_r ); |
| 1333 | 1333 | |
| 1334 | | |
| 1334 | DRIVER_INIT_CALL(stv | |
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | 1337 | static READ32_HANDLER( elandore_speedup_r ) |
| r1591 | r1592 | |
| 1358 | 1358 | install_standard_protection(); |
| 1359 | 1359 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, elandore_speedup_r ); |
| 1360 | 1360 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)elandore_slave_speedup); |
| 1361 | | |
| 1361 | DRIVER_INIT_CALL(stv | |
| 1362 | 1362 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(0); |
| 1363 | 1363 | |
| 1364 | 1364 | } |
| r1591 | r1592 | |
| 1387 | 1387 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, rsgun_speedup_r ); |
| 1388 | 1388 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)rsgun_slave_speedup); |
| 1389 | 1389 | |
| 1390 | | |
| 1390 | DRIVER_INIT_CALL(stv | |
| 1391 | 1391 | |
| 1392 | 1392 | minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(20); |
| 1393 | 1393 | |
| r1591 | r1592 | |
| 1396 | 1396 | DRIVER_INIT(ffreveng) |
| 1397 | 1397 | { |
| 1398 | 1398 | install_standard_protection(); |
| 1399 | | |
| 1399 | DRIVER_INIT_CALL(stv | |
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | 1402 | DRIVER_INIT(decathlt) |
| 1403 | 1403 | { |
| 1404 | 1404 | install_decathlt_protection(); |
| 1405 | | |
| 1405 | DRIVER_INIT_CALL(ic13 | |
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 1408 | 1408 | static READ32_HANDLER( nameclv3_speedup_r ) |
| r1591 | r1592 | |
| 1422 | 1422 | { |
| 1423 | 1423 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60452c0, 0x60452c3, 0, 0, nameclv3_speedup_r ); |
| 1424 | 1424 | cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)nameclv3_slave_speedup ); |
| 1425 | | |
| 1425 | DRIVER_INIT_CALL(stv | |
| 1426 | 1426 | } |
| r1591 | r1592 | |
|---|---|---|
| 217 | 217 | |
| 218 | 218 | static INTERRUPT_GEN( ttchamp_irq ) /* right? */ |
| 219 | 219 | { |
| 220 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 220 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static MACHINE_DRIVER_START( ttchamp ) |
| r1591 | r1592 | |
|---|---|---|
| 173 | 173 | static WRITE8_HANDLER( egghunt_soundlatch_w ) |
| 174 | 174 | { |
| 175 | 175 | soundlatch_w(0,data); |
| 176 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 176 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | static READ8_HANDLER( egghunt_okibanking_r ) |
| r1591 | r1592 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | static TIMER_CALLBACK( nmi_callback ) |
| 128 | 128 | { |
| 129 | if (sound_nmi_enable) cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 129 | if (sound_nmi_enable) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 130 | 130 | else pending_nmi = 1; |
| 131 | 131 | } |
| 132 | 132 | |
| r1591 | r1592 | |
| 146 | 146 | sound_nmi_enable = 1; |
| 147 | 147 | if (pending_nmi) |
| 148 | 148 | { |
| 149 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 149 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 150 | 150 | pending_nmi = 0; |
| 151 | 151 | } |
| 152 | 152 | } |
| r1591 | r1592 | |
|---|---|---|
| 131 | 131 | state_save_register_global(prot_write_buf); |
| 132 | 132 | state_save_register_global(prot_read_buf); |
| 133 | 133 | |
| 134 | | |
| 134 | MACHINE_START_CALL(genesis | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| 138 | 138 | static MACHINE_RESET( segac2 ) |
| 139 | 139 | { |
| 140 | 140 | /* set up interrupts and such */ |
| 141 | | |
| 141 | MACHINE_RESET_CALL(genesis | |
| 142 | 142 | |
| 143 | 143 | /* determine how many sound banks */ |
| 144 | 144 | sound_banks = 0; |
| r1591 | r1592 | |
|---|---|---|
| 261 | 261 | |
| 262 | 262 | static void irqhandler(int linestate) |
| 263 | 263 | { |
| 264 | cpunum_set_input_line(1,0,linestate); | |
| 264 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 18 | 18 | static INTERRUPT_GEN( starshp1_interrupt ) |
| 19 | 19 | { |
| 20 | 20 | if ((readinputport(0) & 0x90) != 0x90) |
| 21 | { | |
| 22 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 23 | } | |
| 21 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 24 | 22 | } |
| 25 | 23 | |
| 26 | 24 |
| r1591 | r1592 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | static INTERRUPT_GEN( pandoras_interrupt_a ){ |
| 42 | 42 | if (irq_enable_a) |
| 43 | cpunum_set_input_line(0, M6809_IRQ_LINE, HOLD_LINE); | |
| 43 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static INTERRUPT_GEN( pandoras_interrupt_b ){ |
| 47 | 47 | if (irq_enable_b) |
| 48 | cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE); | |
| 48 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static READ8_HANDLER( pandoras_sharedram_r ){ |
| r1591 | r1592 | |
| 75 | 75 | other bytes unknown */ |
| 76 | 76 | |
| 77 | 77 | switch (offset){ |
| 78 | case 0x00: if (!data) cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 78 | case 0x00: if (!data) cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 79 | 79 | irq_enable_a = data; |
| 80 | 80 | break; |
| 81 | 81 | case 0x02: coin_counter_w(0,data & 0x01); |
| r1591 | r1592 | |
| 84 | 84 | break; |
| 85 | 85 | case 0x05: pandoras_flipscreen_w(0, data); |
| 86 | 86 | break; |
| 87 | case 0x06: if (!data) cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 87 | case 0x06: if (!data) cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); | |
| 88 | 88 | irq_enable_b = data; |
| 89 | 89 | break; |
| 90 | case 0x07: cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 90 | case 0x07: cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 91 | 91 | break; |
| 92 | 92 | |
| 93 | 93 | default: |
| r1591 | r1592 | |
| 97 | 97 | |
| 98 | 98 | static WRITE8_HANDLER( pandoras_cpua_irqtrigger_w ){ |
| 99 | 99 | if (!firq_old_data_a && data){ |
| 100 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 100 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | firq_old_data_a = data; |
| r1591 | r1592 | |
| 105 | 105 | |
| 106 | 106 | static WRITE8_HANDLER( pandoras_cpub_irqtrigger_w ){ |
| 107 | 107 | if (!firq_old_data_b && data){ |
| 108 | cpunum_set_input_line(1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 108 | cpunum_set_input_line(Machine, 1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | firq_old_data_b = data; |
| r1591 | r1592 | |
| 113 | 113 | |
| 114 | 114 | static WRITE8_HANDLER( pandoras_i8039_irqtrigger_w ) |
| 115 | 115 | { |
| 116 | cpunum_set_input_line(3, 0, ASSERT_LINE); | |
| 116 | cpunum_set_input_line(Machine, 3, 0, ASSERT_LINE); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static WRITE8_HANDLER( i8039_irqen_and_status_w ) |
| 120 | 120 | { |
| 121 | 121 | /* bit 7 enables IRQ */ |
| 122 | 122 | if ((data & 0x80) == 0) |
| 123 | cpunum_set_input_line(3, 0, CLEAR_LINE); | |
| 123 | cpunum_set_input_line(Machine, 3, 0, CLEAR_LINE); | |
| 124 | 124 | |
| 125 | 125 | /* bit 5 goes to 8910 port A */ |
| 126 | 126 | i8039_status = (data & 0x20) >> 5; |
| r1591 | r1592 | |
| 128 | 128 | |
| 129 | 129 | static WRITE8_HANDLER( pandoras_z80_irqtrigger_w ) |
| 130 | 130 | { |
| 131 | cpunum_set_input_line_and_vector(2,0,HOLD_LINE,0xff); | |
| 131 | cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 |
| r1591 | r1592 | |
|---|---|---|
| 795 | 795 | |
| 796 | 796 | static TIMER_CALLBACK( taitof2_interrupt6 ) |
| 797 | 797 | { |
| 798 | cpunum_set_input_line(0,6,HOLD_LINE); | |
| 798 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | static INTERRUPT_GEN( taitof2_interrupt ) |
| 802 | 802 | { |
| 803 | 803 | timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, taitof2_interrupt6); |
| 804 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 804 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | |
| r1591 | r1592 | |
| 845 | 845 | |
| 846 | 846 | static READ8_HANDLER( driveout_sound_command_r) |
| 847 | 847 | { |
| 848 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 848 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 849 | 849 | // logerror("sound IRQ OFF (sound command=%02x)\n",driveout_sound_latch); |
| 850 | 850 | return driveout_sound_latch; |
| 851 | 851 | } |
| r1591 | r1592 | |
| 886 | 886 | else |
| 887 | 887 | { |
| 888 | 888 | driveout_sound_latch = ((data<<4) & 0xf0) | (driveout_sound_latch & 0x0f); |
| 889 | cpunum_set_input_line (1, 0, ASSERT_LINE); | |
| 889 | cpunum_set_input_line (Machine, 1, 0, ASSERT_LINE); | |
| 890 | 890 | } |
| 891 | 891 | } |
| 892 | 892 | } |
| r1591 | r1592 | |
| 3820 | 3820 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 3821 | 3821 | static void irq_handler(int irq) |
| 3822 | 3822 | { |
| 3823 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 3823 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 3824 | 3824 | } |
| 3825 | 3825 | |
| 3826 | 3826 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 534 | 534 | if (cpu_getiloops() == 0) |
| 535 | 535 | { |
| 536 | 536 | if (enable_IRQ) |
| 537 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 537 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | if (cpu_getiloops() % 2) |
| 541 | 541 | { |
| 542 | 542 | if (enable_NMI) |
| 543 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 543 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 544 | 544 | } |
| 545 | 545 | } |
| 546 | 546 |
| r1591 | r1592 | |
|---|---|---|
| 516 | 516 | /* sound hardware */ |
| 517 | 517 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 518 | 518 | |
| 519 | MDRV_SOUND_ADD(YM2203, | |
| 519 | MDRV_SOUND_ADD(YM2203, 3000000) | |
| 520 | 520 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 521 | 521 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 522 | 522 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| 523 | 523 | MDRV_SOUND_ROUTE(3, "mono", 0.10) |
| 524 | 524 | |
| 525 | MDRV_SOUND_ADD(YM2203, | |
| 525 | MDRV_SOUND_ADD(YM2203, 3000000) | |
| 526 | 526 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 527 | 527 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 528 | 528 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| r1591 | r1592 | |
|---|---|---|
| 405 | 405 | else audioready = 0; |
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 408 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | |
| r1591 | r1592 | |
| 2252 | 2252 | GAME( 1982, qberttst, qbert, qbert, qbert, 0, ROT270, "Gottlieb", "Q*bert (early test version)", 0 ) |
| 2253 | 2253 | GAME( 1982, qbtrktst, qbert, qbert, qbert, 0, ROT270, "Gottlieb", "Q*bert Board Input Test Rom", 0 ) |
| 2254 | 2254 | GAME( 1982, insector, 0, gottlieb, insector, 0, ROT0, "Gottlieb", "Insector (prototype)", 0 ) |
| 2255 | GAME( 1982, tylz, 0, | |
| 2255 | GAME( 1982, tylz, 0, q | |
| 2256 | 2256 | GAME( 1984, argusg, 0, krull, argusg, 0, ROT0, "Gottlieb", "Argus (Gottlieb, prototype)" , 0) // aka Guardian / Protector? |
| 2257 | 2257 | GAME( 1983, mplanets, 0, gottlieb, mplanets, 0, ROT270, "Gottlieb", "Mad Planets", 0 ) |
| 2258 | 2258 | GAME( 1983, mplanuk, mplanets, gottlieb, mplanets, 0, ROT270, "Gottlieb (Taitel license)", "Mad Planets (UK)", 0 ) |
| r1591 | r1592 | |
|---|---|---|
| 37 | 37 | static void update_irq_state(void) |
| 38 | 38 | { |
| 39 | 39 | if (vblank_irq || sprite_irq || unknown_irq) |
| 40 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 40 | cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE); | |
| 41 | 41 | else |
| 42 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 42 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| r1591 | r1592 | |
| 129 | 129 | { |
| 130 | 130 | latch1_full = 1; |
| 131 | 131 | soundlatch_w(0, data & 0xff); |
| 132 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 132 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 133 | 133 | cpu_spinuntil_time(ATTOTIME_IN_USEC(100)); // Allow the other cpu to reply |
| 134 | 134 | } |
| 135 | 135 | } |
| r1591 | r1592 | |
| 350 | 350 | |
| 351 | 351 | static void irq_handler(int irq) |
| 352 | 352 | { |
| 353 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 353 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | static const struct YM2203interface ym2203_intf_sandscrp = |
| r1591 | r1592 | |
|---|---|---|
| 393 | 393 | |
| 394 | 394 | static TIMER_CALLBACK( irq_stop ) |
| 395 | 395 | { |
| 396 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 396 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | static INTERRUPT_GEN( vblank_callback_gpworld ) |
| r1591 | r1592 | |
| 403 | 403 | { |
| 404 | 404 | laserdisc_data_w(discinfo,ldp_write_latch); |
| 405 | 405 | ldp_read_latch = laserdisc_data_r(discinfo); |
| 406 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 406 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */ |
| 410 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 410 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 411 | 411 | timer_set(ATTOTIME_IN_USEC(100), NULL, 0, irq_stop); |
| 412 | 412 | |
| 413 | 413 | laserdisc_vsync(discinfo); |
| r1591 | r1592 | |
|---|---|---|
| 73 | 73 | #include "sound/okim6295.h" |
| 74 | 74 | #include "sound/msm5205.h" |
| 75 | 75 | |
| 76 | ||
| 77 | #define MAIN_CLOCK XTAL_12MHz | |
| 78 | #define SOUND_CLOCK XTAL_3_579545MHz | |
| 79 | #define MCU_CLOCK XTAL_4MHz | |
| 80 | ||
| 81 | ||
| 76 | 82 | /* from video */ |
| 77 | 83 | extern UINT8 *ddragon_bgvideoram,*ddragon_fgvideoram; |
| 78 | extern | |
| 84 | extern UINT16 ddragon_scrollx_hi, ddragon_scrolly_hi; | |
| 79 | 85 | extern UINT8 *ddragon_scrollx_lo; |
| 80 | 86 | extern UINT8 *ddragon_scrolly_lo; |
| 81 | 87 | VIDEO_START( ddragon ); |
| r1591 | r1592 | |
| 83 | 89 | WRITE8_HANDLER( ddragon_bgvideoram_w ); |
| 84 | 90 | WRITE8_HANDLER( ddragon_fgvideoram_w ); |
| 85 | 91 | extern UINT8 *ddragon_spriteram; |
| 86 | extern | |
| 92 | extern UINT8 technos_video_hw; | |
| 87 | 93 | /* end of extern code & data */ |
| 88 | 94 | |
| 95 | static emu_timer *scanline_timer; | |
| 89 | 96 | static MACHINE_START( ddragon ); |
| 97 | static WRITE8_HANDLER( ddragon_bankswitch_w ); | |
| 90 | 98 | |
| 91 | 99 | /* private globals */ |
| 92 | static int dd_sub_cpu_busy; | |
| 93 | static int sprite_irq, sound_irq, ym_irq, snd_cpu; | |
| 94 | static int adpcm_pos[2],adpcm_end[2],adpcm_idle[2]; | |
| 95 | static UINT8* darktowr_mcu_ports, *darktowr_ram; | |
| 96 | static int VBLK; | |
| 97 | static UINT8 bank_data; | |
| 100 | static UINT8 dd_sub_cpu_busy; | |
| 101 | static UINT8 sprite_irq, sound_irq, ym_irq, snd_cpu; | |
| 102 | static UINT32 adpcm_pos[2], adpcm_end[2]; | |
| 103 | static UINT8 adpcm_idle[2]; | |
| 104 | static UINT8 *darktowr_mcu_ports; | |
| 105 | static UINT8 *rambase; | |
| 98 | 106 | /* end of private globals */ |
| 99 | 107 | |
| 100 | 108 | |
| 101 | static MACHINE_RESET( ddragon ) | |
| 109 | /************************************* | |
| 110 | * | |
| 111 | * Video timing | |
| 112 | * | |
| 113 | *************************************/ | |
| 114 | ||
| 115 | /* | |
| 116 | Based on the Solar Warrior schematics, vertical timing counts as follows: | |
| 117 | ||
| 118 | 08,09,0A,0B,...,FC,FD,FE,FF,E8,E9,EA,EB,...,FC,FD,FE,FF, | |
| 119 | 08,09,.... | |
| 120 | ||
| 121 | Thus, it counts from 08 to FF, then resets to E8 and counts to FF again. | |
| 122 | This gives (256 - 8) + (256 - 232) = 248 + 24 = 272 total scanlines. | |
| 123 | ||
| 124 | VBLK is signalled starting when the counter hits F8, and continues through | |
| 125 | the reset to E8 and through until the next reset to 08 again. | |
| 126 | ||
| 127 | Since MAME's video timing is 0-based, we need to convert this. | |
| 128 | */ | |
| 129 | ||
| 130 | INLINE int scanline_to_vcount(int scanline) | |
| 102 | 131 | { |
| 103 | sprite_irq = INPUT_LINE_NMI; | |
| 104 | sound_irq = M6809_IRQ_LINE; | |
| 105 | ym_irq = M6809_FIRQ_LINE; | |
| 106 | technos_video_hw = 0; | |
| 107 | dd_sub_cpu_busy = 0x10; | |
| 108 | adpcm_idle[0] = adpcm_idle[1] = 1; | |
| 109 | snd_cpu = 2; | |
| 132 | int vcount = scanline + 8; | |
| 133 | if (vcount < 0x100) | |
| 134 | return vcount; | |
| 135 | else | |
| 136 | return (vcount - 0x18) | 0x100; | |
| 110 | 137 | } |
| 111 | 138 | |
| 112 | static MACHINE_RESET( toffy ) | |
| 139 | ||
| 140 | static TIMER_CALLBACK( ddragon_scanline_callback ) | |
| 113 | 141 | { |
| 114 | sound_irq = M6809_IRQ_LINE; | |
| 115 | ym_irq = M6809_FIRQ_LINE; | |
| 116 | technos_video_hw = 0; | |
| 117 | dd_sub_cpu_busy = 0x10; | |
| 118 | adpcm_idle[0] = adpcm_idle[1] = 1; | |
| 119 | snd_cpu = 1; | |
| 142 | int scanline = param; | |
| 143 | int vcount_old = scanline_to_vcount((scanline == 0) ? machine->screen[0].height - 1 : scanline - 1); | |
| 144 | int vcount = scanline_to_vcount(scanline); | |
| 145 | ||
| 146 | /* update to the current point */ | |
| 147 | video_screen_update_partial(0, scanline - 1); | |
| 148 | ||
| 149 | /* on the rising edge of VBLK (vcount == F8), signal an NMI */ | |
| 150 | if (vcount == 0xf8) | |
| 151 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 152 | ||
| 153 | /* set 1ms signal on rising edge of vcount & 8 */ | |
| 154 | if (!(vcount_old & 8) && (vcount & 8)) | |
| 155 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 156 | ||
| 157 | /* adjust for next scanline */ | |
| 158 | if (++scanline >= machine->screen[0].height) | |
| 159 | scanline = 0; | |
| 160 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_never); | |
| 120 | 161 | } |
| 121 | 162 | |
| 122 | static MACHINE_RESET( ddragonb ) | |
| 163 | ||
| 164 | ||
| 165 | /************************************* | |
| 166 | * | |
| 167 | * System setup and intialization | |
| 168 | * | |
| 169 | *************************************/ | |
| 170 | ||
| 171 | static MACHINE_START( ddragon ) | |
| 123 | 172 | { |
| 124 | sprite_irq = INPUT_LINE_NMI; | |
| 125 | sound_irq = M6809_IRQ_LINE; | |
| 126 | ym_irq = M6809_FIRQ_LINE; | |
| 127 | technos_video_hw = 0; | |
| 128 | dd_sub_cpu_busy = 0x10; | |
| 129 | adpcm_idle[0] = adpcm_idle[1] = 1; | |
| 130 | snd_cpu = 2; | |
| 173 | /* configure banks */ | |
| 174 | memory_configure_bank(1, 0, 8, memory_region(REGION_CPU1) + 0x10000, 0x4000); | |
| 175 | ||
| 176 | /* allocate timer for scanlines */ | |
| 177 | scanline_timer = timer_alloc(ddragon_scanline_callback, NULL); | |
| 178 | ||
| 179 | /* determine the sound CPU index */ | |
| 180 | snd_cpu = mame_find_cpu_index(machine, "sound"); | |
| 181 | ||
| 182 | /* register for save states */ | |
| 183 | state_save_register_global(dd_sub_cpu_busy); | |
| 184 | state_save_register_global_array(adpcm_pos); | |
| 185 | state_save_register_global_array(adpcm_end); | |
| 186 | state_save_register_global_array(adpcm_idle); | |
| 131 | 187 | } |
| 132 | 188 | |
| 133 | static MACHINE_RESET( ddragon2 ) | |
| 189 | ||
| 190 | static MACHINE_RESET( ddragon ) | |
| 134 | 191 | { |
| 135 | sprite_irq = INPUT_LINE_NMI; | |
| 136 | sound_irq = INPUT_LINE_NMI; | |
| 137 | ym_irq = 0; | |
| 138 | technos_video_hw = 2; | |
| 139 | dd_sub_cpu_busy = 0x10; | |
| 140 | snd_cpu = 2; | |
| 192 | dd_sub_cpu_busy = 1; | |
| 193 | adpcm_idle[0] = adpcm_idle[1] = 1; | |
| 194 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never); | |
| 141 | 195 | } |
| 142 | 196 | |
| 143 | /*****************************************************************************/ | |
| 144 | 197 | |
| 145 | static WRITE8_HANDLER( ddragon_bankswitch_w ) | |
| 146 | { | |
| 147 | UINT8 *RAM = memory_region(REGION_CPU1); | |
| 148 | 198 | |
| 149 | ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 ); | |
| 150 | ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 ); | |
| 199 | /************************************* | |
| 200 | * | |
| 201 | * Bank switching | |
| 202 | * | |
| 203 | *************************************/ | |
| 151 | 204 | |
| 205 | static WRITE8_HANDLER( ddragon_bankswitch_w ) | |
| 206 | { | |
| 207 | ddragon_scrollx_hi = ((data & 0x01) << 8); | |
| 208 | ddragon_scrolly_hi = ((data & 0x02) << 7); | |
| 152 | 209 | flip_screen_set(~data & 0x04); |
| 153 | 210 | |
| 154 | 211 | /* bit 3 unknown */ |
| 155 | 212 | |
| 156 | 213 | if (data & 0x10) |
| 157 | dd_sub_cpu_busy = 0x00; | |
| 158 | else if (dd_sub_cpu_busy == 0x00) | |
| 159 | cpunum_set_input_line( 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 214 | dd_sub_cpu_busy = 0; | |
| 215 | else if (dd_sub_cpu_busy == 0) | |
| 216 | cpunum_set_input_line(Machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 160 | 217 | |
| 161 | memory_set_bankptr( 1,&RAM[ 0x10000 + ( 0x4000 * ( ( data & 0xe0) >> 5 ) ) ] ); | |
| 162 | ||
| 163 | bank_data=data; | |
| 218 | memory_set_bank(1, (data & 0xe0) >> 5); | |
| 164 | 219 | } |
| 165 | 220 | |
| 221 | ||
| 166 | 222 | static WRITE8_HANDLER( toffy_bankswitch_w ) |
| 167 | 223 | { |
| 168 | UINT8 *RAM = memory_region(REGION_CPU1); | |
| 224 | ddragon_scrollx_hi = ((data & 0x01) << 8); | |
| 225 | ddragon_scrolly_hi = ((data & 0x02) << 7); | |
| 169 | 226 | |
| 170 | ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 ); | |
| 171 | ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 ); | |
| 172 | ||
| 173 | 227 | // flip_screen_set(~data & 0x04); |
| 174 | 228 | |
| 175 | 229 | /* bit 3 unknown */ |
| 176 | 230 | |
| 177 | 231 | /* I don't know ... */ |
| 178 | memory_set_bank | |
| 232 | memory_set_bank | |
| 179 | 233 | } |
| 180 | 234 | |
| 181 | /*****************************************************************************/ | |
| 182 | 235 | |
| 183 | static int darktowr_bank=0; | |
| 236 | static READ8_HANDLER( darktowr_mcu_bank_r ) | |
| 237 | { | |
| 238 | // logerror("BankRead %05x %08x\n",activecpu_get_pc(),offset); | |
| 184 | 239 | |
| 240 | /* Horrible hack - the alternate TStrike set is mismatched against the MCU, | |
| 241 | so just hack around the protection here. (The hacks are 'right' as I have | |
| 242 | the original source code & notes to this version of TStrike to examine). | |
| 243 | */ | |
| 244 | if (!strcmp(Machine->gamedrv->name, "tstrike")) | |
| 245 | { | |
| 246 | /* Static protection checks at boot-up */ | |
| 247 | if (activecpu_get_pc() == 0x9ace) | |
| 248 | return 0; | |
| 249 | if (activecpu_get_pc() == 0x9ae4) | |
| 250 | return 0x63; | |
| 251 | ||
| 252 | /* Just return whatever the code is expecting */ | |
| 253 | return rambase[0xbe1]; | |
| 254 | } | |
| 255 | ||
| 256 | if (offset == 0x1401 || offset == 1) | |
| 257 | return darktowr_mcu_ports[0]; | |
| 258 | ||
| 259 | logerror("Unmapped mcu bank read %04x\n",offset); | |
| 260 | return 0xff; | |
| 261 | } | |
| 262 | ||
| 263 | ||
| 264 | static WRITE8_HANDLER( darktowr_mcu_bank_w ) | |
| 265 | { | |
| 266 | logerror("BankWrite %05x %08x %08x\n", activecpu_get_pc(), offset, data); | |
| 267 | ||
| 268 | if (offset == 0x1400 || offset == 0) | |
| 269 | { | |
| 270 | darktowr_mcu_ports[1] = BITSWAP8(data,0,1,2,3,4,5,6,7); | |
| 271 | logerror("MCU PORT 1 -> %04x (from %04x)\n", BITSWAP8(data,0,1,2,3,4,5,6,7), data); | |
| 272 | } | |
| 273 | } | |
| 274 | ||
| 275 | ||
| 185 | 276 | static WRITE8_HANDLER( darktowr_bankswitch_w ) |
| 186 | 277 | { |
| 187 | ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 ); | |
| 188 | ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 ); | |
| 278 | int oldbank = memory_get_bank(1); | |
| 279 | int newbank = (data & 0xe0) >> 5; | |
| 189 | 280 | |
| 281 | ddragon_scrollx_hi = ((data & 0x01) << 8); | |
| 282 | ddragon_scrolly_hi = ((data & 0x02) << 7); | |
| 283 | ||
| 190 | 284 | // flip_screen_set(~data & 0x04); |
| 191 | 285 | |
| 192 | 286 | /* bit 3 unknown */ |
| 193 | 287 | |
| 194 | 288 | if (data & 0x10) |
| 195 | dd_sub_cpu_busy = 0x00; | |
| 196 | else if (dd_sub_cpu_busy == 0x00) | |
| 197 | cpunum_set_input_line( 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 289 | dd_sub_cpu_busy = 0; | |
| 290 | else if (dd_sub_cpu_busy == 0) | |
| 291 | cpunum_set_input_line(Machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 198 | 292 | |
| 199 | darktowr_bank=(data & 0xe0) >> 5; | |
| 200 | // memory_set_bankptr( 1,&RAM[ 0x10000 + ( 0x4000 * ( ( data & 0xe0) >> 5 ) ) ] ); | |
| 201 | // logerror("Bank %05x %02x %02x\n",activecpu_get_pc(),darktowr_bank,data); | |
| 293 | memory_set_bank(1, newbank); | |
| 294 | if (newbank == 4 && oldbank != 4) | |
| 295 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w); | |
| 296 | else if (newbank != 4 && oldbank == 4) | |
| 297 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MRA8_BANK1, MWA8_BANK1); | |
| 202 | 298 | } |
| 203 | 299 | |
| 204 | static READ8_HANDLER( darktowr_bank_r ) | |
| 205 | { | |
| 206 | UINT8 *RAM = memory_region(REGION_CPU1); | |
| 207 | 300 | |
| 208 | /* MCU is mapped into main cpu memory as a bank */ | |
| 209 | if (darktowr_bank==4) { | |
| 210 | // logerror("BankRead %05x %08x\n",activecpu_get_pc(),offset); | |
| 211 | 301 | |
| 212 | /* Horrible hack - the alternate TStrike set is mismatched against the MCU, | |
| 213 | so just hack around the protection here. (The hacks are 'right' as I have | |
| 214 | the original source code & notes to this version of TStrike to examine). | |
| 215 | */ | |
| 216 | if(!strcmp(Machine->gamedrv->name, "tstrike")) | |
| 217 | { | |
| 218 | /* Static protection checks at boot-up */ | |
| 219 | if (activecpu_get_pc()==0x9ace) | |
| 220 | return 0; | |
| 221 | if (activecpu_get_pc()==0x9ae4) | |
| 222 | return 0x63; | |
| 302 | /************************************* | |
| 303 | * | |
| 304 | * Interrupt control | |
| 305 | * | |
| 306 | *************************************/ | |
| 223 | 307 | |
| 224 | /* Just return whatever the code is expecting */ | |
| 225 | return darktowr_ram[0xbe1]; | |
| 226 | } | |
| 308 | static WRITE8_HANDLER( ddragon_interrupt_w ) | |
| 309 | { | |
| 310 | switch (offset) | |
| 311 | { | |
| 312 | case 0: /* 380b - NMI ack */ | |
| 313 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 314 | break; | |
| 227 | 315 | |
| 228 | if (offset==0x1401 || offset==1) { | |
| 229 | return darktowr_mcu_ports[0]; | |
| 230 | } | |
| 316 | case 1: /* 380c - FIRQ ack */ | |
| 317 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 318 | break; | |
| 231 | 319 | |
| 232 | logerror("Unmapped mcu bank read %04x\n",offset); | |
| 233 | return 0xff; | |
| 234 | } | |
| 320 | case 2: /* 380d - IRQ ack */ | |
| 321 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 322 | break; | |
| 235 | 323 | |
| 236 | return RAM[offset + 0x10000 + (0x4000*darktowr_bank)]; | |
| 324 | case 3: /* 380e - SND irq */ | |
| 325 | soundlatch_w(0, data); | |
| 326 | cpunum_set_input_line(Machine, snd_cpu, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 327 | break; | |
| 328 | ||
| 329 | case 4: /* 380f - ? */ | |
| 330 | /* Not sure what this is - almost certainly related to the sprite mcu */ | |
| 331 | break; | |
| 332 | } | |
| 237 | 333 | } |
| 238 | 334 | |
| 239 | static WRITE8_HANDLER( darktowr_bank_w ) | |
| 335 | ||
| 336 | static WRITE8_HANDLER( ddragon2_sub_irq_ack_w ) | |
| 240 | 337 | { |
| 241 | if (darktowr_bank==4) { | |
| 242 | logerror("BankWrite %05x %08x %08x\n",activecpu_get_pc(),offset,data); | |
| 338 | cpunum_set_input_line(Machine, 1, sprite_irq, CLEAR_LINE ); | |
| 339 | } | |
| 243 | 340 | |
| 244 | if (offset==0x1400 || offset==0) { | |
| 245 | int bitSwappedData=BITSWAP8(data,0,1,2,3,4,5,6,7); | |
| 246 | 341 | |
| 247 | darktowr_mcu_ports[1]=bitSwappedData; | |
| 342 | static WRITE8_HANDLER( ddragon2_sub_irq_w ) | |
| 343 | { | |
| 344 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 345 | } | |
| 248 | 346 | |
| 249 | logerror("MCU PORT 1 -> %04x (from %04x)\n",bitSwappedData,data); | |
| 250 | return; | |
| 251 | } | |
| 252 | return; | |
| 253 | } | |
| 254 | 347 | |
| 255 | logerror("ROM write! %04x %02x\n",offset,data); | |
| 348 | static void irq_handler(int irq) | |
| 349 | { | |
| 350 | cpunum_set_input_line(Machine, snd_cpu, ym_irq , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 256 | 351 | } |
| 257 | 352 | |
| 258 | static READ8_HANDLER( darktowr_mcu_r ) | |
| 353 | ||
| 354 | ||
| 355 | /************************************* | |
| 356 | * | |
| 357 | * MCU handlers | |
| 358 | * | |
| 359 | *************************************/ | |
| 360 | ||
| 361 | static CUSTOM_INPUT( sub_cpu_busy ) | |
| 259 | 362 | { |
| 260 | return d | |
| 363 | return dd | |
| 261 | 364 | } |
| 262 | 365 | |
| 366 | ||
| 263 | 367 | static WRITE8_HANDLER( darktowr_mcu_w ) |
| 264 | 368 | { |
| 265 | 369 | logerror("McuWrite %05x %08x %08x\n",activecpu_get_pc(),offset,data); |
| 266 | 370 | darktowr_mcu_ports[offset]=data; |
| 267 | 371 | } |
| 268 | 372 | |
| 269 | /**************************************************************************/ | |
| 270 | 373 | |
| 271 | static WRITE8_HANDLER( ddragon_interrupt_w ) | |
| 272 | { | |
| 273 | switch (offset) { | |
| 274 | case 0: /* 380b - NMI ack */ | |
| 275 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 276 | break; | |
| 277 | case 1: /* 380c - FIRQ ack */ | |
| 278 | cpunum_set_input_line(0,M6809_FIRQ_LINE,CLEAR_LINE); | |
| 279 | break; | |
| 280 | case 2: /* 380d - IRQ ack */ | |
| 281 | cpunum_set_input_line(0,M6809_IRQ_LINE,CLEAR_LINE); | |
| 282 | break; | |
| 283 | case 3: /* 380e - SND irq */ | |
| 284 | soundlatch_w( 0, data ); | |
| 285 | cpunum_set_input_line( snd_cpu, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 286 | break; | |
| 287 | case 4: /* 380f - ? */ | |
| 288 | /* Not sure what this is - almost certainly related to the sprite mcu */ | |
| 289 | break; | |
| 290 | }; | |
| 291 | } | |
| 292 | ||
| 293 | 374 | static READ8_HANDLER( ddragon_hd63701_internal_registers_r ) |
| 294 | 375 | { |
| 295 | logerror("%04x: read %d\n",activecpu_get_pc(),offset); | |
| 376 | logerror("%04x: read %d\n", activecpu_get_pc(), offset); | |
| 296 | 377 | return 0; |
| 297 | 378 | } |
| 298 | 379 | |
| 380 | ||
| 299 | 381 | static WRITE8_HANDLER( ddragon_hd63701_internal_registers_w ) |
| 300 | 382 | { |
| 301 | 383 | /* I don't know why port 0x17 is used.. Doesn't seem to be a standard MCU port */ |
| 302 | if (offset==0x17) { | |
| 384 | if (offset == 0x17) | |
| 385 | { | |
| 303 | 386 | /* This is a guess, but makes sense.. The mcu definitely interrupts the main cpu. |
| 304 | 387 | I don't know what bit is the assert and what is the clear though (in comparison |
| 305 | 388 | it's quite obvious from the Double Dragon 2 code, below). */ |
| 306 | if (data&3) { | |
| 307 | cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 308 | cpunum_set_input_line(1,sprite_irq, CLEAR_LINE ); | |
| 389 | if (data & 3) | |
| 390 | { | |
| 391 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 392 | cpunum_set_input_line(Machine, 1, sprite_irq, CLEAR_LINE); | |
| 309 | 393 | } |
| 310 | 394 | } |
| 311 | 395 | } |
| 312 | 396 | |
| 313 | static WRITE8_HANDLER( ddragon2_sub_irq_ack_w ) | |
| 314 | { | |
| 315 | cpunum_set_input_line(1,sprite_irq, CLEAR_LINE ); | |
| 316 | } | |
| 317 | 397 | |
| 318 | static WRITE8_HANDLER( ddragon2_sub_irq_w ) | |
| 319 | { | |
| 320 | cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 321 | } | |
| 322 | 398 | |
| 323 | static READ8_HANDLER( port4_r ) | |
| 324 | { | |
| 325 | int port = readinputportbytag("IN4"); | |
| 399 | /************************************* | |
| 400 | * | |
| 401 | * Sprite RAM hacks | |
| 402 | * | |
| 403 | *************************************/ | |
| 326 | 404 | |
| 327 | return port | dd_sub_cpu_busy | VBLK; | |
| 328 | } | |
| 329 | ||
| 330 | 405 | static READ8_HANDLER( ddragon_spriteram_r ) |
| 331 | 406 | { |
| 332 | 407 | /* Double Dragon crash fix - see notes above */ |
| 333 | if (offset==0x49 && activecpu_get_pc()==0x6261 && ddragon_spriteram[offset]==0x1f) | |
| 408 | if (offset == 0x49 && activecpu_get_pc() == 0x6261 && ddragon_spriteram[offset] == 0x1f) | |
| 334 | 409 | return 0x1; |
| 335 | 410 | |
| 336 | 411 | return ddragon_spriteram[offset]; |
| 337 | 412 | } |
| 338 | 413 | |
| 414 | ||
| 339 | 415 | static WRITE8_HANDLER( ddragon_spriteram_w ) |
| 340 | 416 | { |
| 341 | if ( cpu_getactivecpu() == 1 && offset == 0 ) | |
| 342 | dd_sub_cpu_busy = 0x10; | |
| 417 | if (cpu_getactivecpu() == 1 && offset == 0) | |
| 418 | dd_sub_cpu_busy = 1; | |
| 343 | 419 | |
| 344 | 420 | ddragon_spriteram[offset] = data; |
| 345 | 421 | } |
| 346 | 422 | |
| 347 | /*****************************************************************************/ | |
| 348 | 423 | |
| 349 | #if 0 | |
| 350 | static WRITE8_HANDLER( cpu_sound_command_w ) | |
| 351 | { | |
| 352 | soundlatch_w( offset, data ); | |
| 353 | cpunum_set_input_line( snd_cpu, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 354 | } | |
| 355 | #endif | |
| 356 | 424 | |
| 425 | /************************************* | |
| 426 | * | |
| 427 | * ADPCM sound | |
| 428 | * | |
| 429 | *************************************/ | |
| 430 | ||
| 357 | 431 | static WRITE8_HANDLER( dd_adpcm_w ) |
| 358 | 432 | { |
| 359 | 433 | int chip = offset & 1; |
| r1591 | r1592 | |
| 380 | 454 | } |
| 381 | 455 | } |
| 382 | 456 | |
| 457 | ||
| 383 | 458 | static void dd_adpcm_int(int chip) |
| 384 | 459 | { |
| 385 | 460 | static int adpcm_data[2] = { -1, -1 }; |
| r1591 | r1592 | |
| 391 | 466 | } |
| 392 | 467 | else if (adpcm_data[chip] != -1) |
| 393 | 468 | { |
| 394 | MSM5205_data_w(chip,adpcm_data[chip] & 0x0f); | |
| 469 | MSM5205_data_w(chip, adpcm_data[chip] & 0x0f); | |
| 395 | 470 | adpcm_data[chip] = -1; |
| 396 | 471 | } |
| 397 | 472 | else |
| r1591 | r1592 | |
| 403 | 478 | } |
| 404 | 479 | } |
| 405 | 480 | |
| 481 | ||
| 406 | 482 | static READ8_HANDLER( dd_adpcm_status_r ) |
| 407 | 483 | { |
| 408 | 484 | return adpcm_idle[0] + (adpcm_idle[1] << 1); |
| 409 | 485 | } |
| 410 | 486 | |
| 411 | /*****************************************************************************/ | |
| 412 | 487 | |
| 413 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 414 | AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM) | |
| 415 | AM_RANGE(0x2000, 0x2fff) AM_READ(ddragon_spriteram_r) | |
| 416 | AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) | |
| 417 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r) | |
| 418 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_1_r) | |
| 419 | AM_RANGE(0x3802, 0x3802) AM_READ(port4_r) | |
| 420 | AM_RANGE(0x3803, 0x3803) AM_READ(input_port_2_r) | |
| 421 | AM_RANGE(0x3804, 0x3804) AM_READ(input_port_3_r) | |
| 422 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1) | |
| 423 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 424 | ADDRESS_MAP_END | |
| 425 | 488 | |
| 426 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 427 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) | |
| 428 | AM_RANGE(0x1000, 0x11ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 429 | AM_RANGE(0x1200, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 430 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(MWA8_RAM) | |
| 431 | AM_RANGE(0x1800, 0x1fff) AM_WRITE(ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 432 | AM_RANGE(0x2000, 0x2fff) AM_WRITE(ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) | |
| 433 | AM_RANGE(0x3000, 0x37ff) AM_WRITE(ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 434 | AM_RANGE(0x3808, 0x3808) AM_WRITE(ddragon_bankswitch_w) | |
| 435 | AM_RANGE(0x3809, 0x3809) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrollx_lo) | |
| 436 | AM_RANGE(0x380a, 0x380a) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrolly_lo) | |
| 437 | AM_RANGE(0x380b, 0x380f) AM_WRITE(ddragon_interrupt_w) | |
| 438 | AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 439 | ADDRESS_MAP_END | |
| 489 | /************************************* | |
| 490 | * | |
| 491 | * Main CPU memory maps | |
| 492 | * | |
| 493 | *************************************/ | |
| 440 | 494 | |
| 441 | static ADDRESS_MAP_START( darktowr_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 442 | AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM) | |
| 443 | AM_RANGE(0x2000, 0x2fff) AM_READ(ddragon_spriteram_r) | |
| 444 | AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) | |
| 495 | static ADDRESS_MAP_START( ddragon_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 496 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&rambase) | |
| 497 | AM_RANGE(0x1000, 0x11ff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 498 | AM_RANGE(0x1200, 0x13ff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 499 | AM_RANGE(0x1400, 0x17ff) AM_RAM | |
| 500 | AM_RANGE(0x1800, 0x1fff) AM_READWRITE(MRA8_RAM, ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 501 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) | |
| 502 | AM_RANGE(0x3000, 0x37ff) AM_READWRITE(MRA8_RAM, ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 445 | 503 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r) |
| 446 | 504 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_1_r) |
| 447 | AM_RANGE(0x3802, 0x3802) AM_READ(port4_r) | |
| 505 | AM_RANGE(0x3802, 0x3802) AM_READ(input_port_4_r) | |
| 448 | 506 | AM_RANGE(0x3803, 0x3803) AM_READ(input_port_2_r) |
| 449 | 507 | AM_RANGE(0x3804, 0x3804) AM_READ(input_port_3_r) |
| 450 | AM_RANGE(0x4000, 0x7fff) AM_READ(darktowr_bank_r) | |
| 451 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 452 | ADDRESS_MAP_END | |
| 453 | ||
| 454 | static ADDRESS_MAP_START( darktowr_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 455 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_BASE(&darktowr_ram) | |
| 456 | AM_RANGE(0x1000, 0x11ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 457 | AM_RANGE(0x1200, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 458 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(MWA8_RAM) | |
| 459 | AM_RANGE(0x1800, 0x1fff) AM_WRITE(ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 460 | AM_RANGE(0x2000, 0x2fff) AM_WRITE(ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) | |
| 461 | AM_RANGE(0x3000, 0x37ff) AM_WRITE(ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 462 | AM_RANGE(0x3808, 0x3808) AM_WRITE(darktowr_bankswitch_w) | |
| 508 | AM_RANGE(0x3808, 0x3808) AM_WRITE(ddragon_bankswitch_w) | |
| 463 | 509 | AM_RANGE(0x3809, 0x3809) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrollx_lo) |
| 464 | 510 | AM_RANGE(0x380a, 0x380a) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrolly_lo) |
| 465 | 511 | AM_RANGE(0x380b, 0x380f) AM_WRITE(ddragon_interrupt_w) |
| 466 | AM_RANGE(0x4000, 0x7fff) AM_WRITE(darktowr_bank_w) | |
| 467 | AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 512 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1) | |
| 513 | AM_RANGE(0x8000, 0xffff) AM_ROM | |
| 468 | 514 | ADDRESS_MAP_END |
| 469 | 515 | |
| 470 | static ADDRESS_MAP_START( dd2_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 471 | AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM) | |
| 472 | AM_RANGE(0x2000, 0x2fff) AM_READ(ddragon_spriteram_r) | |
| 473 | AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) | |
| 516 | ||
| 517 | static ADDRESS_MAP_START( dd2_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 518 | AM_RANGE(0x0000, 0x17ff) AM_RAM | |
| 519 | AM_RANGE(0x1800, 0x1fff) AM_READWRITE(MRA8_RAM, ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 520 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) | |
| 521 | AM_RANGE(0x3000, 0x37ff) AM_READWRITE(MRA8_RAM, ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 474 | 522 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r) |
| 475 | 523 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_1_r) |
| 476 | AM_RANGE(0x3802, 0x3802) AM_READ(port4_r) | |
| 524 | AM_RANGE(0x3802, 0x3802) AM_READ(input_port_4_r) | |
| 477 | 525 | AM_RANGE(0x3803, 0x3803) AM_READ(input_port_2_r) |
| 478 | 526 | AM_RANGE(0x3804, 0x3804) AM_READ(input_port_3_r) |
| 479 | AM_RANGE(0x3c00, 0x3fff) AM_READ(MRA8_RAM) | |
| 480 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1) | |
| 481 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 482 | ADDRESS_MAP_END | |
| 483 | ||
| 484 | static ADDRESS_MAP_START( dd2_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 485 | AM_RANGE(0x0000, 0x17ff) AM_WRITE(MWA8_RAM) | |
| 486 | AM_RANGE(0x1800, 0x1fff) AM_WRITE(ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 487 | AM_RANGE(0x2000, 0x2fff) AM_WRITE(ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) | |
| 488 | AM_RANGE(0x3000, 0x37ff) AM_WRITE(ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 489 | 527 | AM_RANGE(0x3808, 0x3808) AM_WRITE(ddragon_bankswitch_w) |
| 490 | 528 | AM_RANGE(0x3809, 0x3809) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrollx_lo) |
| 491 | 529 | AM_RANGE(0x380a, 0x380a) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrolly_lo) |
| 492 | 530 | AM_RANGE(0x380b, 0x380f) AM_WRITE(ddragon_interrupt_w) |
| 493 | AM_RANGE(0x3c00, 0x3dff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 494 | AM_RANGE(0x3e00, 0x3fff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 495 | AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 531 | AM_RANGE(0x3c00, 0x3dff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 532 | AM_RANGE(0x3e00, 0x3fff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 533 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1) | |
| 534 | AM_RANGE(0x8000, 0xffff) AM_ROM | |
| 496 | 535 | ADDRESS_MAP_END |
| 497 | 536 | |
| 498 | static ADDRESS_MAP_START( toffy_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 499 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) | |
| 500 | AM_RANGE(0x1000, 0x11ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 501 | AM_RANGE(0x1200, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 502 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(MWA8_RAM) | |
| 503 | AM_RANGE(0x1800, 0x1fff) AM_WRITE(ddragon_fgvideoram_w) AM_BASE(&ddragon_fgvideoram) | |
| 504 | AM_RANGE(0x2000, 0x2fff) AM_WRITE(ddragon_spriteram_w) AM_BASE(&ddragon_spriteram) | |
| 505 | AM_RANGE(0x3000, 0x37ff) AM_WRITE(ddragon_bgvideoram_w) AM_BASE(&ddragon_bgvideoram) | |
| 506 | AM_RANGE(0x3808, 0x3808) AM_WRITE(toffy_bankswitch_w) | |
| 507 | AM_RANGE(0x3809, 0x3809) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrollx_lo) | |
| 508 | AM_RANGE(0x380a, 0x380a) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrolly_lo) | |
| 509 | AM_RANGE(0x380b, 0x380f) AM_WRITE(ddragon_interrupt_w) | |
| 510 | AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 511 | ADDRESS_MAP_END | |
| 512 | 537 | |
| 513 | static ADDRESS_MAP_START( sub_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 514 | AM_RANGE(0x0000, 0x001f) AM_READ(ddragon_hd63701_internal_registers_r) | |
| 515 | AM_RANGE(0x001f, 0x0fff) AM_READ(MRA8_RAM) | |
| 516 | AM_RANGE(0x8000, 0x8fff) AM_READ(ddragon_spriteram_r) | |
| 517 | AM_RANGE(0xc000, 0xffff) AM_READ(MRA8_ROM) | |
| 518 | ADDRESS_MAP_END | |
| 519 | 538 | |
| 520 | static ADDRESS_MAP_START( sub_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 521 | AM_RANGE(0x0000, 0x001f) AM_WRITE(ddragon_hd63701_internal_registers_w) | |
| 522 | AM_RANGE(0x001f, 0x0fff) AM_WRITE(MWA8_RAM) | |
| 523 | AM_RANGE(0x8000, 0x8fff) AM_WRITE(ddragon_spriteram_w) | |
| 524 | AM_RANGE(0xc000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 539 | /************************************* | |
| 540 | * | |
| 541 | * Sub CPU memory maps | |
| 542 | * | |
| 543 | *************************************/ | |
| 544 | ||
| 545 | static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 546 | AM_RANGE(0x0000, 0x001f) AM_READWRITE(ddragon_hd63701_internal_registers_r, ddragon_hd63701_internal_registers_w) | |
| 547 | AM_RANGE(0x001f, 0x0fff) AM_RAM | |
| 548 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) | |
| 549 | AM_RANGE(0xc000, 0xffff) AM_ROM | |
| 525 | 550 | ADDRESS_MAP_END |
| 526 | 551 | |
| 527 | static ADDRESS_MAP_START( ddragnba_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 528 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) | |
| 529 | AM_RANGE(0x8000, 0x8fff) AM_READ(ddragon_spriteram_r) | |
| 530 | AM_RANGE(0xc000, 0xffff) AM_READ(MRA8_ROM) | |
| 552 | ||
| 553 | static ADDRESS_MAP_START( ddragnba_sub_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 554 | AM_RANGE(0x0000, 0x0fff) AM_RAM | |
| 555 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) | |
| 556 | AM_RANGE(0xc000, 0xffff) AM_ROM | |
| 531 | 557 | ADDRESS_MAP_END |
| 532 | 558 | |
| 533 | static ADDRESS_MAP_START( ddragnba_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 534 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) | |
| 535 | AM_RANGE(0x8000, 0x8fff) AM_WRITE(ddragon_spriteram_w) | |
| 536 | AM_RANGE(0xc000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 559 | ||
| 560 | static ADDRESS_MAP_START( dd2_sub_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 561 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 562 | AM_RANGE(0xc000, 0xc3ff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) | |
| 563 | AM_RANGE(0xd000, 0xd000) AM_WRITE(ddragon2_sub_irq_ack_w) | |
| 564 | AM_RANGE(0xe000, 0xe000) AM_WRITE(ddragon2_sub_irq_w) | |
| 537 | 565 | ADDRESS_MAP_END |
| 538 | 566 | |
| 539 | 567 | /* might not be 100% accurate, check bits written */ |
| 540 | 568 | static WRITE8_HANDLER( ddragnba_port_w ) |
| 541 | 569 | { |
| 542 | cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 543 | cpunum_set_input_line(1,sprite_irq, CLEAR_LINE ); | |
| 570 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 571 | cpunum_set_input_line(Machine, 1,sprite_irq, CLEAR_LINE ); | |
| 544 | 572 | } |
| 545 | 573 | |
| 546 | static ADDRESS_MAP_START( ddragnba_sub_ | |
| 574 | static ADDRESS_MAP_START( ddragnba_sub_ | |
| 547 | 575 | AM_RANGE(0x0000, 0xffff) AM_WRITE(ddragnba_port_w) |
| 548 | 576 | ADDRESS_MAP_END |
| 549 | 577 | |
| 550 | 578 | |
| 551 | 579 | |
| 552 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 553 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) | |
| 580 | /************************************* | |
| 581 | * | |
| 582 | * Sound CPU memory maps | |
| 583 | * | |
| 584 | *************************************/ | |
| 585 | ||
| 586 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 587 | AM_RANGE(0x0000, 0x0fff) AM_RAM | |
| 554 | 588 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_r) |
| 555 | 589 | AM_RANGE(0x1800, 0x1800) AM_READ(dd_adpcm_status_r) |
| 556 | AM_RANGE(0x2800, 0x2801) AM_READ(YM2151_status_port_0_r) | |
| 557 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 558 | ADDRESS_MAP_END | |
| 559 | ||
| 560 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 561 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) | |
| 562 | AM_RANGE(0x2800, 0x2800) AM_WRITE(YM2151_register_port_0_w) | |
| 563 | AM_RANGE(0x2801, 0x2801) AM_WRITE(YM2151_data_port_0_w) | |
| 590 | AM_RANGE(0x2800, 0x2800) AM_READWRITE(YM2151_status_port_0_r, YM2151_register_port_0_w) | |
| 591 | AM_RANGE(0x2801, 0x2801) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 564 | 592 | AM_RANGE(0x3800, 0x3807) AM_WRITE(dd_adpcm_w) |
| 565 | AM_RANGE(0x8000, 0xffff) AM_ | |
| 593 | AM_RANGE(0x8000, 0xffff) AM_ | |
| 566 | 594 | ADDRESS_MAP_END |
| 567 | 595 | |
| 568 | static ADDRESS_MAP_START( dd2_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 569 | AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM) | |
| 570 | AM_RANGE(0xc000, 0xc3ff) AM_READ(ddragon_spriteram_r) | |
| 571 | ADDRESS_MAP_END | |
| 572 | 596 | |
| 573 | static ADDRESS_MAP_START( dd2_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 574 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 575 | AM_RANGE(0xc000, 0xc3ff) AM_WRITE(ddragon_spriteram_w) | |
| 576 | AM_RANGE(0xd000, 0xd000) AM_WRITE(ddragon2_sub_irq_ack_w) | |
| 577 | AM_RANGE(0xe000, 0xe000) AM_WRITE(ddragon2_sub_irq_w) | |
| 578 | ADDRESS_MAP_END | |
| 579 | ||
| 580 | static ADDRESS_MAP_START( dd2_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 581 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 582 | AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) | |
| 583 | AM_RANGE(0x8801, 0x8801) AM_READ(YM2151_status_port_0_r) | |
| 584 | AM_RANGE(0x9800, 0x9800) AM_READ(OKIM6295_status_0_r) | |
| 597 | static ADDRESS_MAP_START( dd2_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 598 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 599 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 600 | AM_RANGE(0x8800, 0x8800) AM_WRITE(YM2151_register_port_0_w) | |
| 601 | AM_RANGE(0x8801, 0x8801) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 602 | AM_RANGE(0x9800, 0x9800) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) | |
| 585 | 603 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r) |
| 586 | 604 | ADDRESS_MAP_END |
| 587 | 605 | |
| 588 | static ADDRESS_MAP_START( dd2_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 589 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM) | |
| 590 | AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) | |
| 591 | AM_RANGE(0x8800, 0x8800) AM_WRITE(YM2151_register_port_0_w) | |
| 592 | AM_RANGE(0x8801, 0x8801) AM_WRITE(YM2151_data_port_0_w) | |
| 593 | AM_RANGE(0x9800, 0x9800) AM_WRITE(OKIM6295_data_0_w) | |
| 594 | ADDRESS_MAP_END | |
| 595 | 606 | |
| 596 | static ADDRESS_MAP_START( mcu_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 597 | ADDRESS_MAP_FLAGS( AMEF_ABITS(11) ) | |
| 598 | AM_RANGE(0x0000, 0x0007) AM_READ(darktowr_mcu_r) | |
| 599 | AM_RANGE(0x0008, 0x007f) AM_READ(MRA8_RAM) | |
| 600 | AM_RANGE(0x0080, 0x07ff) AM_READ(MRA8_ROM) | |
| 601 | ADDRESS_MAP_END | |
| 602 | 607 | |
| 603 | static ADDRESS_MAP_START( mcu_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 608 | /************************************* | |
| 609 | * | |
| 610 | * MCU memory maps | |
| 611 | * | |
| 612 | *************************************/ | |
| 613 | ||
| 614 | static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 604 | 615 | ADDRESS_MAP_FLAGS( AMEF_ABITS(11) ) |
| 605 | AM_RANGE(0x0000, 0x0007) AM_WRITE(darktowr_mcu_w) AM_BASE(&darktowr_mcu_ports) | |
| 606 | AM_RANGE(0x0008, 0x007f) AM_WRITE(MWA8_RAM) | |
| 607 | AM_RANGE(0x0080, 0x07ff) AM_WRITE(MWA8_ROM) | |
| 616 | AM_RANGE(0x0000, 0x0007) AM_READWRITE(MRA8_RAM, darktowr_mcu_w) AM_BASE(&darktowr_mcu_ports) | |
| 617 | AM_RANGE(0x0008, 0x007f) AM_RAM | |
| 618 | AM_RANGE(0x0080, 0x07ff) AM_ROM | |
| 608 | 619 | ADDRESS_MAP_END |
| 609 | 620 | |
| 610 | /*****************************************************************************/ | |
| 611 | 621 | |
| 612 | #define COMMON_PORT4 PORT_START_TAG("IN4") \ | |
| 613 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) \ | |
| 614 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) \ | |
| 615 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) \ | |
| 616 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Vblank verified to be active high (palette fades in ddragon2) */ \ | |
| 617 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* sub cpu busy */ \ | |
| 618 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) \ | |
| 619 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \ | |
| 620 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 621 | 622 | |
| 622 | #define COMMON_INPUT_DIP1 PORT_START_TAG("DSW0") \ | |
| 623 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) \ | |
| 624 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) \ | |
| 625 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) \ | |
| 626 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) \ | |
| 627 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) \ | |
| 628 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) \ | |
| 629 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) \ | |
| 630 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) \ | |
| 631 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) \ | |
| 632 | PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) \ | |
| 633 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) \ | |
| 634 | PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) \ | |
| 635 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) \ | |
| 636 | PORT_DIPSETTING( 0x38, DEF_STR( 1C_1C ) ) \ | |
| 637 | PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) ) \ | |
| 638 | PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) ) \ | |
| 639 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) \ | |
| 640 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_5C ) ) \ | |
| 641 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) \ | |
| 642 | PORT_DIPSETTING( 0x40, DEF_STR( Upright ) ) \ | |
| 643 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) \ | |
| 644 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) \ | |
| 645 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) \ | |
| 646 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 623 | /************************************* | |
| 624 | * | |
| 625 | * Input ports | |
| 626 | * | |
| 627 | *************************************/ | |
| 647 | 628 | |
| 648 | #define COMMON_INPUT_DIP2 PORT_START_TAG("DSW0")\ | |
| 649 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) \ | |
| 650 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) \ | |
| 651 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) \ | |
| 652 | PORT_DIPSETTING( 0x07, DEF_STR( 4C_2C ) ) \ | |
| 653 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) \ | |
| 654 | PORT_DIPSETTING( 0x06, DEF_STR( 3C_2C ) ) \ | |
| 655 | PORT_DIPSETTING( 0x0b, DEF_STR( 4C_3C ) ) \ | |
| 656 | PORT_DIPSETTING( 0x0f, DEF_STR( 4C_4C ) ) \ | |
| 657 | PORT_DIPSETTING( 0x0a, DEF_STR( 3C_3C ) ) \ | |
| 658 | PORT_DIPSETTING( 0x05, DEF_STR( 2C_2C ) ) \ | |
| 659 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 660 | PORT_DIPSETTING( 0x0e, DEF_STR( 3C_4C ) ) \ | |
| 661 | PORT_DIPSETTING( 0x09, DEF_STR( 2C_3C ) ) \ | |
| 662 | PORT_DIPSETTING( 0x0d, DEF_STR( 2C_4C ) ) \ | |
| 663 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) \ | |
| 664 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) \ | |
| 665 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) \ | |
| 666 | PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) ) \ | |
| 667 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) \ | |
| 668 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) \ | |
| 669 | PORT_DIPSETTING( 0x70, DEF_STR( 4C_2C ) ) \ | |
| 670 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) \ | |
| 671 | PORT_DIPSETTING( 0x60, DEF_STR( 3C_2C ) ) \ | |
| 672 | PORT_DIPSETTING( 0xb0, DEF_STR( 4C_3C ) ) \ | |
| 673 | PORT_DIPSETTING( 0xf0, DEF_STR( 4C_4C ) ) \ | |
| 674 | PORT_DIPSETTING( 0xa0, DEF_STR( 3C_3C ) ) \ | |
| 675 | PORT_DIPSETTING( 0x50, DEF_STR( 2C_2C ) ) \ | |
| 676 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 677 | PORT_DIPSETTING( 0xe0, DEF_STR( 3C_4C ) ) \ | |
| 678 | PORT_DIPSETTING( 0x90, DEF_STR( 2C_3C ) ) \ | |
| 679 | PORT_DIPSETTING( 0xd0, DEF_STR( 2C_4C ) ) \ | |
| 680 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) \ | |
| 681 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) \ | |
| 682 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) | |
| 629 | static INPUT_PORTS_START( ddragon ) | |
| 630 | PORT_START_TAG("IN0") | |
| 631 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 632 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 633 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 634 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 635 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 636 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 637 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) | |
| 638 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) | |
| 683 | 639 | |
| 684 | #define COMMON_INPUT_PORTS PORT_START_TAG("IN0") \ | |
| 685 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY \ | |
| 686 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY \ | |
| 687 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY \ | |
| 688 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY \ | |
| 689 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) \ | |
| 690 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) \ | |
| 691 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) \ | |
| 692 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) \ | |
| 693 | PORT_START_TAG("IN1") \ | |
| 694 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) \ | |
| 695 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) \ | |
| 696 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) \ | |
| 697 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) \ | |
| 698 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) \ | |
| 699 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) \ | |
| 700 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) \ | |
| 640 | PORT_START_TAG("IN1") | |
| 641 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
| 642 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
| 643 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) | |
| 644 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
| 645 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 646 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 647 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 701 | 648 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 702 | 649 | |
| 703 | ||
| 704 | static INPUT_PORTS_START( darktowr ) | |
| 705 | COMMON_INPUT_PORTS | |
| 706 | ||
| 707 | COMMON_INPUT_DIP2 | |
| 708 | ||
| 709 | PORT_START_TAG("DSW1") | |
| 710 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 711 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 712 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 713 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 714 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 715 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 716 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 717 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 718 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 719 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 720 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 721 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 722 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 723 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 724 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 725 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 726 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 727 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 728 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 729 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 730 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 731 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 650 | PORT_START_TAG("DSW0") | |
| 651 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) | |
| 652 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) | |
| 653 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) | |
| 654 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 655 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) | |
| 656 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) | |
| 657 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) | |
| 658 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) | |
| 659 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) | |
| 660 | PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) | |
| 661 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) | |
| 662 | PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) | |
| 663 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 664 | PORT_DIPSETTING( 0x38, DEF_STR( 1C_1C ) ) | |
| 665 | PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) ) | |
| 666 | PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) ) | |
| 667 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) | |
| 668 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_5C ) ) | |
| 669 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) | |
| 670 | PORT_DIPSETTING( 0x40, DEF_STR( Upright ) ) | |
| 671 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 672 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) | |
| 732 | 673 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 733 | 674 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 734 | 675 | |
| 735 | COMMON_PORT4 | |
| 736 | INPUT_PORTS_END | |
| 737 | ||
| 738 | static INPUT_PORTS_START( tstrike ) | |
| 739 | COMMON_INPUT_PORTS | |
| 740 | ||
| 741 | COMMON_INPUT_DIP1 | |
| 742 | ||
| 743 | 676 | PORT_START_TAG("DSW1") |
| 744 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 745 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 746 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 747 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 748 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 749 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 750 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) | |
| 751 | PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) ) | |
| 752 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) | |
| 753 | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) | |
| 754 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 755 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) | |
| 756 | PORT_DIPSETTING( 0x30, "1" ) | |
| 757 | PORT_DIPSETTING( 0x20, "2" ) | |
| 758 | PORT_DIPSETTING( 0x10, "3" ) | |
| 759 | PORT_DIPSETTING( 0x00, "4" ) | |
| 760 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) | |
| 761 | PORT_DIPSETTING( 0xc0, "100k and 200k" ) | |
| 762 | PORT_DIPSETTING( 0x80, "200k and 300k" ) | |
| 763 | PORT_DIPSETTING( 0x40, "300k and 400k" ) | |
| 764 | PORT_DIPSETTING( 0x00, "400k and 500k" ) | |
| 765 | ||
| 766 | COMMON_PORT4 | |
| 767 | INPUT_PORTS_END | |
| 768 | ||
| 769 | static INPUT_PORTS_START( ddragon ) | |
| 770 | COMMON_INPUT_PORTS | |
| 771 | ||
| 772 | COMMON_INPUT_DIP1 | |
| 773 | ||
| 774 | PORT_START_TAG("DSW1") | |
| 775 | 677 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) |
| 776 | 678 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) |
| 777 | 679 | PORT_DIPSETTING( 0x03, DEF_STR( Medium ) ) |
| r1591 | r1592 | |
| 792 | 694 | PORT_DIPSETTING( 0x40, "4" ) |
| 793 | 695 | PORT_DIPSETTING( 0x00, "Infinite (Cheat)") |
| 794 | 696 | |
| 795 | COMMON_PORT4 | |
| 697 | PORT_START_TAG("IN4") | |
| 698 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 699 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) | |
| 700 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) | |
| 701 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 702 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sub_cpu_busy, 0) | |
| 703 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 704 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 705 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 796 | 706 | INPUT_PORTS_END |
| 797 | 707 | |
| 708 | ||
| 798 | 709 | static INPUT_PORTS_START( ddragon2 ) |
| 799 | | |
| 710 | PORT | |
| 800 | 711 | |
| 801 | COMMON_INPUT_DIP1 | |
| 802 | ||
| 803 | PORT_START_TAG("DSW1") | |
| 804 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) | |
| 805 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 806 | PORT_DIPSETTING( 0x03, DEF_STR( Medium ) ) | |
| 807 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) | |
| 808 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 809 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) | |
| 810 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 811 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 712 | PORT_MODIFY("DSW1") | |
| 812 | 713 | PORT_DIPNAME( 0x08, 0x08, "Hurricane Kick" ) |
| 813 | 714 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 814 | 715 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| r1591 | r1592 | |
| 822 | 723 | PORT_DIPSETTING( 0x80, "2" ) |
| 823 | 724 | PORT_DIPSETTING( 0x40, "3" ) |
| 824 | 725 | PORT_DIPSETTING( 0x00, "4" ) |
| 726 | INPUT_PORTS_END | |
| 825 | 727 | |
| 826 | COMMON_PORT4 | |
| 728 | ||
| 729 | static INPUT_PORTS_START( tstrike ) | |
| 730 | PORT_INCLUDE(ddragon) | |
| 731 | ||
| 732 | PORT_MODIFY("DSW1") | |
| 733 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 734 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 735 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 736 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 737 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 738 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 739 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) | |
| 740 | PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) ) | |
| 741 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) | |
| 742 | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) | |
| 743 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 744 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) | |
| 745 | PORT_DIPSETTING( 0x30, "1" ) | |
| 746 | PORT_DIPSETTING( 0x20, "2" ) | |
| 747 | PORT_DIPSETTING( 0x10, "3" ) | |
| 748 | PORT_DIPSETTING( 0x00, "4" ) | |
| 749 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) | |
| 750 | PORT_DIPSETTING( 0xc0, "100k and 200k" ) | |
| 751 | PORT_DIPSETTING( 0x80, "200k and 300k" ) | |
| 752 | PORT_DIPSETTING( 0x40, "300k and 400k" ) | |
| 753 | PORT_DIPSETTING( 0x00, "400k and 500k" ) | |
| 827 | 754 | INPUT_PORTS_END |
| 828 | 755 | |
| 756 | ||
| 829 | 757 | static INPUT_PORTS_START( ddungeon ) |
| 830 | | |
| 758 | PORT | |
| 831 | 759 | |
| 832 | COMMON_INPUT_DIP2 | |
| 760 | PORT_MODIFY("DSW0") | |
| 761 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) | |
| 762 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) | |
| 763 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 764 | PORT_DIPSETTING( 0x07, DEF_STR( 4C_2C ) ) | |
| 765 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 766 | PORT_DIPSETTING( 0x06, DEF_STR( 3C_2C ) ) | |
| 767 | PORT_DIPSETTING( 0x0b, DEF_STR( 4C_3C ) ) | |
| 768 | PORT_DIPSETTING( 0x0f, DEF_STR( 4C_4C ) ) | |
| 769 | PORT_DIPSETTING( 0x0a, DEF_STR( 3C_3C ) ) | |
| 770 | PORT_DIPSETTING( 0x05, DEF_STR( 2C_2C ) ) | |
| 771 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 772 | PORT_DIPSETTING( 0x0e, DEF_STR( 3C_4C ) ) | |
| 773 | PORT_DIPSETTING( 0x09, DEF_STR( 2C_3C ) ) | |
| 774 | PORT_DIPSETTING( 0x0d, DEF_STR( 2C_4C ) ) | |
| 775 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) | |
| 776 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) | |
| 777 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) | |
| 778 | PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) ) | |
| 779 | PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) | |
| 780 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) | |
| 781 | PORT_DIPSETTING( 0x70, DEF_STR( 4C_2C ) ) | |
| 782 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) | |
| 783 | PORT_DIPSETTING( 0x60, DEF_STR( 3C_2C ) ) | |
| 784 | PORT_DIPSETTING( 0xb0, DEF_STR( 4C_3C ) ) | |
| 785 | PORT_DIPSETTING( 0xf0, DEF_STR( 4C_4C ) ) | |
| 786 | PORT_DIPSETTING( 0xa0, DEF_STR( 3C_3C ) ) | |
| 787 | PORT_DIPSETTING( 0x50, DEF_STR( 2C_2C ) ) | |
| 788 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 789 | PORT_DIPSETTING( 0xe0, DEF_STR( 3C_4C ) ) | |
| 790 | PORT_DIPSETTING( 0x90, DEF_STR( 2C_3C ) ) | |
| 791 | PORT_DIPSETTING( 0xd0, DEF_STR( 2C_4C ) ) | |
| 792 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) | |
| 793 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) | |
| 794 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) | |
| 833 | 795 | |
| 834 | PORT_ | |
| 796 | PORT_MODIFY | |
| 835 | 797 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) |
| 836 | 798 | PORT_DIPSETTING( 0x00, "1" ) |
| 837 | 799 | PORT_DIPSETTING( 0x01, "2" ) |
| r1591 | r1592 | |
| 844 | 806 | PORT_DIPSETTING( 0x90, DEF_STR( Medium ) ) |
| 845 | 807 | PORT_DIPSETTING( 0x70, DEF_STR( Hard ) ) |
| 846 | 808 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 809 | INPUT_PORTS_END | |
| 847 | 810 | |
| 848 | COMMON_PORT4 | |
| 811 | ||
| 812 | static INPUT_PORTS_START( darktowr ) | |
| 813 | PORT_INCLUDE(ddungeon) | |
| 814 | ||
| 815 | PORT_MODIFY("DSW1") | |
| 816 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 817 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 818 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 819 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 820 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 821 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 822 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 823 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 824 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 825 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 826 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 827 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 828 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 829 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 830 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 831 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 832 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 833 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 834 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 835 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 836 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 837 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 838 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 839 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 849 | 840 | INPUT_PORTS_END |
| 850 | 841 | |
| 842 | ||
| 851 | 843 | static INPUT_PORTS_START( toffy ) |
| 852 | | |
| 844 | PORT | |
| 853 | 845 | |
| 854 | PORT_ | |
| 846 | PORT_MODIFY | |
| 855 | 847 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) |
| 856 | 848 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 857 | 849 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| r1591 | r1592 | |
| 887 | 879 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_5C ) ) |
| 888 | 880 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) |
| 889 | 881 | |
| 890 | PORT_ | |
| 882 | PORT_MODIFY | |
| 891 | 883 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) |
| 892 | 884 | PORT_DIPSETTING( 0x00, "2" ) |
| 893 | 885 | PORT_DIPSETTING( 0x01, "3" ) |
| r1591 | r1592 | |
| 905 | 897 | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) |
| 906 | 898 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) |
| 907 | 899 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 908 | ||
| 909 | COMMON_PORT4 | |
| 910 | 900 | INPUT_PORTS_END |
| 911 | 901 | |
| 912 | #undef COMMON_INPUT_PORTS //Are these needed? They're not used for any other macros. | |
| 913 | #undef COMMON_INPUT_DIP2 | |
| 914 | #undef COMMON_INPUT_DIP1 | |
| 915 | #undef COMMON_PORT4 | |
| 916 | 902 | |
| 917 | /*****************************************************************************/ | |
| 918 | 903 | |
| 904 | /************************************* | |
| 905 | * | |
| 906 | * Graphics layouts | |
| 907 | * | |
| 908 | *************************************/ | |
| 909 | ||
| 919 | 910 | static const gfx_layout char_layout = |
| 920 | 911 | { |
| 921 | 912 | 8,8, |
| r1591 | r1592 | |
| 946 | 937 | GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout, 256, 8 ) /* colors 256-383 */ |
| 947 | 938 | GFXDECODE_END |
| 948 | 939 | |
| 949 | /*****************************************************************************/ | |
| 950 | 940 | |
| 951 | static void irq_handler(int irq) | |
| 952 | { | |
| 953 | cpunum_set_input_line( snd_cpu, ym_irq , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 954 | } | |
| 955 | 941 | |
| 942 | /************************************* | |
| 943 | * | |
| 944 | * Sound definitions | |
| 945 | * | |
| 946 | *************************************/ | |
| 947 | ||
| 956 | 948 | static const struct YM2151interface ym2151_interface = |
| 957 | 949 | { |
| 958 | 950 | irq_handler |
| r1591 | r1592 | |
| 964 | 956 | MSM5205_S48_4B /* 8kHz */ |
| 965 | 957 | }; |
| 966 | 958 | |
| 967 | static INTERRUPT_GEN( ddragon_interrupt ) | |
| 968 | { | |
| 969 | int scanline=271 - cpu_getiloops(); | |
| 970 | 959 | |
| 971 | /* VBLK is lowered on scanline 0 */ | |
| 972 | if (scanline==0) { | |
| 973 | VBLK=0; | |
| 974 | } | |
| 975 | 960 | |
| 976 | /* VBLK is raised on scanline 240 and NMI line is pulled high */ | |
| 977 | if (scanline==240) { | |
| 978 | video_screen_update_partial(0, scanline); | |
| 979 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 980 | VBLK=0x8; | |
| 981 | } | |
| 961 | /************************************* | |
| 962 | * | |
| 963 | * Machine drivers | |
| 964 | * | |
| 965 | *************************************/ | |
| 982 | 966 | |
| 983 | /* IMS is triggered every time VPOS line 3 is raised, as VPOS counter starts at 16, effectively every 16 scanlines */ | |
| 984 | if ((scanline%16)==7) | |
| 985 | { | |
| 986 | video_screen_update_partial(0, scanline); | |
| 987 | cpunum_set_input_line(0,M6809_FIRQ_LINE,ASSERT_LINE); | |
| 988 | } | |
| 989 | } | |
| 990 | ||
| 991 | 967 | static MACHINE_DRIVER_START( ddragon ) |
| 992 | 968 | |
| 993 | 969 | /* basic machine hardware */ |
| 994 | MDRV_CPU_ADD(HD6309, 3579545) /* 3.579545 MHz */ | |
| 995 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 996 | MDRV_CPU_VBLANK_INT(ddragon_interrupt,272) | |
| 970 | MDRV_CPU_ADD_TAG("main", HD6309, MAIN_CLOCK) /* 12MHz / 4 internally */ | |
| 971 | MDRV_CPU_PROGRAM_MAP(ddragon_map,0) | |
| 997 | 972 | |
| 998 | MDRV_CPU_ADD(HD63701, 3579545 / 3) /* This divider seems correct by comparison to real board */ | |
| 999 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) | |
| 973 | MDRV_CPU_ADD_TAG("sub", HD63701, MAIN_CLOCK/2) /* 6Mhz / 4 internally */ | |
| 974 | MDRV_CPU_PROGRAM_MAP(sub_map,0) | |
| 1000 | 975 | |
| 1001 | MDRV_CPU_ADD(HD6309, 3579545) | |
| 1002 | /* audio CPU */ | |
| 1003 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 976 | MDRV_CPU_ADD_TAG("sound", M6809, MAIN_CLOCK/2) /* 6MHz / 4 internally */ | |
| 977 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 1004 | 978 | |
| 1005 | MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0) | |
| 1006 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1007 | 979 | MDRV_INTERLEAVE(1000) /* heavy interleaving to sync up sprite<->main cpu's */ |
| 1008 | 980 | |
| 1009 | 981 | MDRV_MACHINE_START(ddragon) |
| r1591 | r1592 | |
| 1011 | 983 | |
| 1012 | 984 | /* video hardware */ |
| 1013 | 985 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 1014 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1015 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1016 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) | |
| 1017 | 986 | MDRV_GFXDECODE(ddragon) |
| 1018 | 987 | MDRV_PALETTE_LENGTH(384) |
| 1019 | 988 | |
| 1020 | MDRV_VIDEO_START(ddragon) | |
| 1021 | MDRV_VIDEO_UPDATE(ddragon) | |
| 1022 | ||
| 1023 | /* sound hardware */ | |
| 1024 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1025 | ||
| 1026 | MDRV_SOUND_ADD(YM2151, 3579545) | |
| 1027 | MDRV_SOUND_CONFIG(ym2151_interface) | |
| 1028 | MDRV_SOUND_ROUTE(0, "mono", 0.60) | |
| 1029 | MDRV_SOUND_ROUTE(1, "mono", 0.60) | |
| 1030 | ||
| 1031 | MDRV_SOUND_ADD(MSM5205, 384000) | |
| 1032 | MDRV_SOUND_CONFIG(msm5205_interface) | |
| 1033 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1034 | ||
| 1035 | MDRV_SOUND_ADD(MSM5205, 384000) | |
| 1036 | MDRV_SOUND_CONFIG(msm5205_interface) | |
| 1037 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1038 | MACHINE_DRIVER_END | |
| 1039 | ||
| 1040 | static MACHINE_DRIVER_START( darktowr ) | |
| 1041 | ||
| 1042 | /* basic machine hardware */ | |
| 1043 | MDRV_CPU_ADD(HD6309, 3579545) /* 3.579545 MHz */ | |
| 1044 | MDRV_CPU_PROGRAM_MAP(darktowr_readmem,darktowr_writemem) | |
| 1045 | MDRV_CPU_VBLANK_INT(ddragon_interrupt,272) | |
| 1046 | ||
| 1047 | MDRV_CPU_ADD(HD63701, 3579545 / 3) | |
| 1048 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) | |
| 1049 | ||
| 1050 | MDRV_CPU_ADD(HD6309, 3579545) | |
| 1051 | /* audio CPU */ /* ? */ | |
| 1052 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 1053 | ||
| 1054 | MDRV_CPU_ADD(M68705,8000000/2) /* ? MHz */ | |
| 1055 | MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem) | |
| 1056 | ||
| 1057 | MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0) | |
| 1058 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1059 | MDRV_INTERLEAVE(1000) /* heavy interleaving to sync up sprite<->main cpu's */ | |
| 1060 | ||
| 1061 | MDRV_MACHINE_RESET(ddragon) | |
| 1062 | ||
| 1063 | /* video hardware */ | |
| 1064 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 989 | MDRV_SCREEN_ADD("main", 0) | |
| 1065 | 990 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1066 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1067 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
| 1068 | MDRV_GFXDECODE(ddragon) | |
| 1069 | MDRV_PALETTE_LENGTH(512) | |
| 991 | MDRV_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 384, 0, 256, 272, 0, 240) | |
| 1070 | 992 | |
| 1071 | 993 | MDRV_VIDEO_START(ddragon) |
| 1072 | 994 | MDRV_VIDEO_UPDATE(ddragon) |
| r1591 | r1592 | |
| 1074 | 996 | /* sound hardware */ |
| 1075 | 997 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1076 | 998 | |
| 1077 | MDRV_SOUND_ADD(YM2151, | |
| 999 | MDRV_SOUND_ADD_TAG("fm", YM2151, SOUND_CLOCK) | |
| 1078 | 1000 | MDRV_SOUND_CONFIG(ym2151_interface) |
| 1079 | 1001 | MDRV_SOUND_ROUTE(0, "mono", 0.60) |
| 1080 | 1002 | MDRV_SOUND_ROUTE(1, "mono", 0.60) |
| 1081 | 1003 | |
| 1082 | MDRV_SOUND_ADD(MSM5205, 3 | |
| 1004 | MDRV_SOUND_ADD_TAG("oki1", MSM5205, MAIN_CLOCK/32 | |
| 1083 | 1005 | MDRV_SOUND_CONFIG(msm5205_interface) |
| 1084 | 1006 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1085 | 1007 | |
| 1086 | MDRV_SOUND_ADD(MSM5205, 3 | |
| 1008 | MDRV_SOUND_ADD_TAG("oki2", MSM5205, MAIN_CLOCK/32 | |
| 1087 | 1009 | MDRV_SOUND_CONFIG(msm5205_interface) |
| 1088 | 1010 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1089 | 1011 | MACHINE_DRIVER_END |
| 1090 | 1012 | |
| 1013 | ||
| 1091 | 1014 | static MACHINE_DRIVER_START( ddragonb ) |
| 1015 | MDRV_IMPORT_FROM(ddragon) | |
| 1092 | 1016 | |
| 1093 | 1017 | /* basic machine hardware */ |
| 1094 | MDRV_CPU_ADD(HD6309, 3579545) /* 3.579545 MHz */ | |
| 1095 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 1096 | MDRV_CPU_VBLANK_INT(ddragon_interrupt,272) | |
| 1097 | ||
| 1098 | MDRV_CPU_ADD(HD6309, 12000000 / 3) /* 4 MHz */ | |
| 1099 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) | |
| 1100 | ||
| 1101 | MDRV_CPU_ADD(HD6309, 3579545) | |
| 1102 | /* audio CPU */ /* ? */ | |
| 1103 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 1104 | ||
| 1105 | MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0) | |
| 1106 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1107 | MDRV_INTERLEAVE(100) /* heavy interleaving to sync up sprite<->main cpu's */ | |
| 1108 | ||
| 1109 | MDRV_MACHINE_START(ddragon) | |
| 1110 | MDRV_MACHINE_RESET(ddragonb) | |
| 1111 | ||
| 1112 | /* video hardware */ | |
| 1113 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 1114 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1115 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1116 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) | |
| 1117 | MDRV_GFXDECODE(ddragon) | |
| 1118 | MDRV_PALETTE_LENGTH(384) | |
| 1119 | ||
| 1120 | MDRV_VIDEO_START(ddragon) | |
| 1121 | MDRV_VIDEO_UPDATE(ddragon) | |
| 1122 | ||
| 1123 | /* sound hardware */ | |
| 1124 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1125 | ||
| 1126 | MDRV_SOUND_ADD(YM2151, 3579545) | |
| 1127 | MDRV_SOUND_CONFIG(ym2151_interface) | |
| 1128 | MDRV_SOUND_ROUTE(0, "mono", 0.60) | |
| 1129 | MDRV_SOUND_ROUTE(1, "mono", 0.60) | |
| 1130 | ||
| 1131 | MDRV_SOUND_ADD(MSM5205, 384000) | |
| 1132 | MDRV_SOUND_CONFIG(msm5205_interface) | |
| 1133 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1134 | ||
| 1135 | MDRV_SOUND_ADD(MSM5205, 384000) | |
| 1136 | MDRV_SOUND_CONFIG(msm5205_interface) | |
| 1137 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1018 | MDRV_CPU_REPLACE("sub", M6809, MAIN_CLOCK/2) /* 6Mhz / 4 internally */ | |
| 1019 | MDRV_CPU_PROGRAM_MAP(sub_map,0) | |
| 1138 | 1020 | MACHINE_DRIVER_END |
| 1139 | 1021 | |
| 1022 | ||
| 1140 | 1023 | static MACHINE_DRIVER_START( ddragnba ) |
| 1024 | MDRV_IMPORT_FROM(ddragon) | |
| 1141 | 1025 | |
| 1142 | 1026 | /* basic machine hardware */ |
| 1143 | MDRV_CPU_ADD(HD6309, 3579545) /* 3.579545 MHz */ | |
| 1144 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 1145 | MDRV_CPU_VBLANK_INT(ddragon_interrupt,272) | |
| 1146 | ||
| 1147 | MDRV_CPU_ADD(M6803, 12000000 / 3) /* 4 MHz */ | |
| 1148 | MDRV_CPU_PROGRAM_MAP(ddragnba_sub_readmem,ddragnba_sub_writemem) | |
| 1149 | MDRV_CPU_IO_MAP(0,ddragnba_sub_writeport) | |
| 1150 | ||
| 1151 | MDRV_CPU_ADD(HD6309, 3579545) | |
| 1152 | /* audio CPU */ /* ? */ | |
| 1153 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 1154 | ||
| 1155 | MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0) | |
| 1156 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1157 | MDRV_INTERLEAVE(100) /* heavy interleaving to sync up sprite<->main cpu's */ | |
| 1158 | ||
| 1159 | MDRV_MACHINE_START(ddragon) | |
| 1160 | MDRV_MACHINE_RESET(ddragonb) | |
| 1161 | ||
| 1162 | /* video hardware */ | |
| 1163 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 1164 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1165 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1166 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) | |
| 1167 | MDRV_GFXDECODE(ddragon) | |
| 1168 | MDRV_PALETTE_LENGTH(384) | |
| 1169 | ||
| 1170 | MDRV_VIDEO_START(ddragon) | |
| 1171 | MDRV_VIDEO_UPDATE(ddragon) | |
| 1172 | ||
| 1173 | /* sound hardware */ | |
| 1174 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1175 | ||
| 1176 | MDRV_SOUND_ADD(YM2151, 3579545) | |
| 1177 | MDRV_SOUND_CONFIG(ym2151_interface) | |
| 1178 | MDRV_SOUND_ROUTE(0, "mono", 0.60) | |
| 1179 | MDRV_SOUND_ROUTE(1, "mono", 0.60) | |
| 1180 | ||
| 1181 | MDRV_SOUND_ADD(MSM5205, 384000) | |
| 1182 | MDRV_SOUND_CONFIG(msm5205_interface) | |
| 1183 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1184 | ||
| 1185 | MDRV_SOUND_ADD(MSM5205, 384000) | |
| 1186 | MDRV_SOUND_CONFIG(msm5205_interface) | |
| 1187 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 1027 | MDRV_CPU_REPLACE("sub", M6803, MAIN_CLOCK/2) /* 6Mhz / 4 internally */ | |
| 1028 | MDRV_CPU_PROGRAM_MAP(ddragnba_sub_map,0) | |
| 1029 | MDRV_CPU_IO_MAP(ddragnba_sub_portmap,0) | |
| 1188 | 1030 | MACHINE_DRIVER_END |
| 1189 | 1031 | |
| 1190 | 1032 | |
| 1191 | 1033 | static MACHINE_DRIVER_START( ddragon2 ) |
| 1192 | 1034 | |
| 1193 | 1035 | /* basic machine hardware */ |
| 1194 | MDRV_CPU_ADD(HD6309, 3579545) /* 3.579545 MHz */ | |
| 1195 | MDRV_CPU_PROGRAM_MAP(dd2_readmem,dd2_writemem) | |
| 1196 | MDRV_CPU_VBLANK_INT(ddragon_interrupt,272) | |
| 1036 | MDRV_CPU_ADD_TAG("main", HD6309, MAIN_CLOCK) /* 12MHz / 4 internally */ | |
| 1037 | MDRV_CPU_PROGRAM_MAP(dd2_map,0) | |
| 1197 | 1038 | |
| 1198 | MDRV_CPU_ADD(Z80,12000000 / 3) /* 4 MHz */ | |
| 1199 | MDRV_CPU_PROGRAM_MAP(dd2_sub_readmem,dd2_sub_writemem) | |
| 1039 | MDRV_CPU_ADD_TAG("sub", Z80, MAIN_CLOCK / 3) /* 4 MHz */ | |
| 1040 | MDRV_CPU_PROGRAM_MAP(dd2_sub_map,0) | |
| 1200 | 1041 | |
| 1201 | MDRV_CPU_ADD(Z80, 3579545) | |
| 1202 | /* audio CPU */ /* 3.579545 MHz */ | |
| 1203 | MDRV_CPU_PROGRAM_MAP(dd2_sound_readmem,dd2_sound_writemem) | |
| 1042 | MDRV_CPU_ADD_TAG("sound", Z80, 3579545) | |
| 1043 | MDRV_CPU_PROGRAM_MAP(dd2_sound_map,0) | |
| 1204 | 1044 | |
| 1205 | MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0) | |
| 1206 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1207 | MDRV_INTERLEAVE(100) /* heavy interleaving to sync up sprite<->main cpu's */ | |
| 1045 | MDRV_INTERLEAVE(1000) /* heavy interleaving to sync up sprite<->main cpu's */ | |
| 1208 | 1046 | |
| 1209 | MDRV_MACHINE_RESET(ddragon2) | |
| 1047 | MDRV_MACHINE_START(ddragon) | |
| 1048 | MDRV_MACHINE_RESET(ddragon) | |
| 1210 | 1049 | |
| 1211 | 1050 | /* video hardware */ |
| 1212 | 1051 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 1213 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1214 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1215 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) | |
| 1216 | 1052 | MDRV_GFXDECODE(ddragon) |
| 1217 | 1053 | MDRV_PALETTE_LENGTH(384) |
| 1218 | 1054 | |
| 1055 | MDRV_SCREEN_ADD("main", 0) | |
| 1056 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1057 | MDRV_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 384, 0, 256, 272, 0, 240) | |
| 1058 | ||
| 1219 | 1059 | MDRV_VIDEO_START(ddragon) |
| 1220 | 1060 | MDRV_VIDEO_UPDATE(ddragon) |
| 1221 | 1061 | |
| 1222 | 1062 | /* sound hardware */ |
| 1223 | 1063 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1224 | 1064 | |
| 1225 | MDRV_SOUND_ADD(YM2151, | |
| 1065 | MDRV_SOUND_ADD(YM2151, SOUND_CLOCK) | |
| 1226 | 1066 | MDRV_SOUND_CONFIG(ym2151_interface) |
| 1227 | 1067 | MDRV_SOUND_ROUTE(0, "mono", 0.60) |
| 1228 | 1068 | MDRV_SOUND_ROUTE(1, "mono", 0.60) |
| r1591 | r1592 | |
| 1232 | 1072 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 1233 | 1073 | MACHINE_DRIVER_END |
| 1234 | 1074 | |
| 1235 | static MACHINE_DRIVER_START( toffy ) | |
| 1236 | 1075 | |
| 1076 | static MACHINE_DRIVER_START( darktowr ) | |
| 1077 | MDRV_IMPORT_FROM(ddragon) | |
| 1078 | ||
| 1237 | 1079 | /* basic machine hardware */ |
| 1238 | MDRV_CPU_ADD(M6809,3579545) // 12 MHz / 2 or 3.579545 ? | |
| 1239 | MDRV_CPU_PROGRAM_MAP(readmem,toffy_writemem) | |
| 1240 | MDRV_CPU_VBLANK_INT(ddragon_interrupt,272) | |
| 1080 | MDRV_CPU_ADD(M68705,XTAL_4MHz) | |
| 1081 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) | |
| 1241 | 1082 | |
| 1242 | MDRV_CPU_ADD(M6809, 3579545) | |
| 1243 | /* audio CPU */ | |
| 1244 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 1245 | ||
| 1246 | MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0) | |
| 1247 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1248 | ||
| 1249 | 1083 | /* video hardware */ |
| 1250 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER ) | |
| 1251 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1252 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1253 | MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) | |
| 1254 | MDRV_GFXDECODE(ddragon) | |
| 1255 | MDRV_PALETTE_LENGTH(384) | |
| 1084 | MACHINE_DRIVER_END | |
| 1256 | 1085 | |
| 1257 | MDRV_VIDEO_START(ddragon) | |
| 1258 | MDRV_VIDEO_UPDATE(ddragon) | |
| 1259 | 1086 | |
| 1260 | MDRV_MACHINE_RESET(toffy) | |
| 1087 | static MACHINE_DRIVER_START( toffy ) | |
| 1088 | MDRV_IMPORT_FROM(ddragon) | |
| 1261 | 1089 | |
| 1262 | /* sound hardware */ | |
| 1263 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") | |
| 1090 | /* basic machine hardware */ | |
| 1091 | MDRV_CPU_REMOVE("sub") | |
| 1264 | 1092 | |
| 1265 | MDRV_SOUND_ADD(YM2151, 3579545) | |
| 1266 | MDRV_SOUND_CONFIG(ym2151_interface) | |
| 1267 | MDRV_SOUND_ROUTE(0, "left", 0.60) | |
| 1268 | MDRV_SOUND_ROUTE(1, "right", 0.60) | |
| 1093 | /* sound hardware */ | |
| 1094 | MDRV_SOUND_REMOVE("oki1") | |
| 1095 | MDRV_SOUND_REMOVE("oki2") | |
| 1269 | 1096 | MACHINE_DRIVER_END |
| 1270 | 1097 | |
| 1271 | /*************************************************************************** | |
| 1272 | 1098 | |
| 1273 | Game driver(s) | |
| 1274 | 1099 | |
| 1275 | ***************************************************************************/ | |
| 1100 | /************************************* | |
| 1101 | * | |
| 1102 | * ROM definitions | |
| 1103 | * | |
| 1104 | *************************************/ | |
| 1276 | 1105 | |
| 1277 | 1106 | ROM_START( ddragon ) |
| 1278 | ROM_REGION( 0x | |
| 1107 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1279 | 1108 | ROM_LOAD( "21j-1-5.26", 0x08000, 0x08000, CRC(42045dfd) SHA1(0983705ea3bb87c4c239692f400e02f15c243479) ) |
| 1280 | 1109 | ROM_LOAD( "21j-2-3.25", 0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */ |
| 1281 | 1110 | ROM_LOAD( "21j-3.24", 0x18000, 0x08000, CRC(3bdea613) SHA1(d9038c80646a6ce3ea61da222873237b0383680e) ) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1316 | 1145 | ROM_END |
| 1317 | 1146 | |
| 1318 | 1147 | ROM_START( ddragonw ) |
| 1319 | ROM_REGION( 0x | |
| 1148 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1320 | 1149 | ROM_LOAD( "21j-1.26", 0x08000, 0x08000, CRC(ae714964) SHA1(072522b97ca4edd099c6b48d7634354dc7088c53) ) |
| 1321 | 1150 | ROM_LOAD( "21j-2-3.25", 0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */ |
| 1322 | 1151 | ROM_LOAD( "21a-3.24", 0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1357 | 1186 | ROM_END |
| 1358 | 1187 | |
| 1359 | 1188 | ROM_START( ddragnw1 ) |
| 1360 | ROM_REGION( 0x | |
| 1189 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1361 | 1190 | ROM_LOAD( "e1-1.26", 0x08000, 0x08000, CRC(4b951643) SHA1(efb1f9ef2e46597d76123c9770854c1d83639eb2) ) |
| 1362 | 1191 | ROM_LOAD( "21a-2-4.25", 0x10000, 0x08000, CRC(5cd67657) SHA1(96bc7a5354a76524bd43a4d7eb8b0053a89e39c4) ) /* banked at 0x4000-0x8000 */ |
| 1363 | 1192 | ROM_LOAD( "21a-3.24", 0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1398 | 1227 | ROM_END |
| 1399 | 1228 | |
| 1400 | 1229 | ROM_START( ddragonu ) |
| 1401 | ROM_REGION( 0x | |
| 1230 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1402 | 1231 | ROM_LOAD( "21a-1-5.26", 0x08000, 0x08000, CRC(e24a6e11) SHA1(9dd97dd712d5c896f91fd80df58be9b8a2b198ee) ) |
| 1403 | 1232 | ROM_LOAD( "21j-2-3.25", 0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */ |
| 1404 | 1233 | ROM_LOAD( "21a-3.24", 0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1439 | 1268 | ROM_END |
| 1440 | 1269 | |
| 1441 | 1270 | ROM_START( ddragoua ) |
| 1442 | ROM_REGION( 0x | |
| 1271 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1443 | 1272 | ROM_LOAD( "21a-1", 0x08000, 0x08000, CRC(1d625008) SHA1(84cc19a55e7c91fca1943d9624d93e0347ed4150) ) |
| 1444 | 1273 | ROM_LOAD( "21a-2_4", 0x10000, 0x08000, CRC(5cd67657) SHA1(96bc7a5354a76524bd43a4d7eb8b0053a89e39c4) ) /* banked at 0x4000-0x8000 */ |
| 1445 | 1274 | ROM_LOAD( "21a-3", 0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1480 | 1309 | ROM_END |
| 1481 | 1310 | |
| 1482 | 1311 | ROM_START( ddragonb ) /* Same program roms as the World set */ |
| 1483 | ROM_REGION( 0x | |
| 1312 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1484 | 1313 | ROM_LOAD( "21j-1.26", 0x08000, 0x08000, CRC(ae714964) SHA1(072522b97ca4edd099c6b48d7634354dc7088c53) ) |
| 1485 | 1314 | ROM_LOAD( "21j-2-3.25", 0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */ |
| 1486 | 1315 | ROM_LOAD( "21a-3.24", 0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1520 | 1349 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ |
| 1521 | 1350 | ROM_END |
| 1522 | 1351 | |
| 1523 | ||
| 1524 | 1352 | ROM_START( ddragnba ) |
| 1525 | ROM_REGION( 0x | |
| 1353 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1526 | 1354 | ROM_LOAD( "5.bin", 0x08000, 0x08000, CRC(ae714964) SHA1(072522b97ca4edd099c6b48d7634354dc7088c53) ) |
| 1527 | 1355 | ROM_LOAD( "4.bin", 0x10000, 0x08000, CRC(48045762) SHA1(ca39eea71ca76627a98210ce9cc61457a58f16b9) ) /* banked at 0x4000-0x8000 */ |
| 1528 | 1356 | ROM_CONTINUE(0x20000,0x8000) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1562 | 1390 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ |
| 1563 | 1391 | ROM_END |
| 1564 | 1392 | |
| 1393 | ||
| 1565 | 1394 | ROM_START( ddragon2 ) |
| 1566 | ROM_REGION( 0x | |
| 1395 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) | |
| 1567 | 1396 | ROM_LOAD( "26a9-04.bin", 0x08000, 0x8000, CRC(f2cfc649) SHA1(d3f1e0bae02472914a940222e4f600170a91736d) ) |
| 1568 | 1397 | ROM_LOAD( "26aa-03.bin", 0x10000, 0x8000, CRC(44dd5d4b) SHA1(427c4e419668b41545928cfc96435c010ecdc88b) ) |
| 1569 | 1398 | ROM_LOAD( "26ab-0.bin", 0x18000, 0x8000, CRC(49ddddcd) SHA1(91dc53718d04718b313f23d86e241027c89d1a03) ) |
| r1591 | r1592 | |
| 1599 | 1428 | ROM_END |
| 1600 | 1429 | |
| 1601 | 1430 | ROM_START( ddragn2u ) |
| 1602 | ROM_REGION( 0x | |
| 1431 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) | |
| 1603 | 1432 | ROM_LOAD( "26a9-04.bin", 0x08000, 0x8000, CRC(f2cfc649) SHA1(d3f1e0bae02472914a940222e4f600170a91736d) ) |
| 1604 | 1433 | ROM_LOAD( "26aa-03.bin", 0x10000, 0x8000, CRC(44dd5d4b) SHA1(427c4e419668b41545928cfc96435c010ecdc88b) ) |
| 1605 | 1434 | ROM_LOAD( "26ab-0.bin", 0x18000, 0x8000, CRC(49ddddcd) SHA1(91dc53718d04718b313f23d86e241027c89d1a03) ) |
| r1591 | r1592 | |
| 1634 | 1463 | ROM_LOAD( "prom.16", 0x0000, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown (same as ddragon) */ |
| 1635 | 1464 | ROM_END |
| 1636 | 1465 | |
| 1637 | ROM_START( toffy ) | |
| 1638 | ROM_REGION( 0x28000, REGION_CPU1, 0 ) /* Main CPU? */ | |
| 1639 | ROM_LOAD( "2-27512.rom", 0x00000, 0x10000, CRC(244709dd) SHA1(b2db51b910f1a031b94fb50e684351f657a465dc) ) | |
| 1640 | ROM_RELOAD( 0x10000, 0x10000 ) | |
| 1641 | 1466 | |
| 1642 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU? */ | |
| 1643 | ROM_LOAD( "u142.1", 0x00000, 0x10000, CRC(541bd7f0) SHA1(3f0097f5877eae50651f94d46d7dd9127037eb6e) ) | |
| 1467 | ROM_START( tstrike ) | |
| 1468 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1469 | ROM_LOAD( "prog.rom", 0x08000, 0x08000, CRC(bf011a00) SHA1(09a55042a219dd37cb9e7feeab092ebfb903ddde) ) | |
| 1470 | ROM_LOAD( "tstrike.25", 0x10000, 0x08000, CRC(b6a0c2f3) SHA1(3434689ca217f5af268058ad34c277db672d389c) ) /* banked at 0x4000-0x8000 */ | |
| 1471 | ROM_LOAD( "tstrike.24", 0x18000, 0x08000, CRC(363816fa) SHA1(65c1ccbb950e09230196b49dc7312a13a34f3f79) ) /* banked at 0x4000-0x8000 */ | |
| 1472 | /* IC23 is replaced with a daughterboard containing a 68705 MCU */ | |
| 1644 | 1473 | |
| 1645 | ROM_REGION( 0x10000, REGION_GFX1, 0 ) /* GFX? */ | |
| 1646 | ROM_LOAD( "7-27512.rom", 0x000, 0x10000, CRC(f9e8ec64) SHA1(36891cd8f28800e03fe0eac84b2484a70011eabb) ) | |
| 1474 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sprite cpu */ | |
| 1475 | ROM_LOAD( "63701.bin", 0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) ) | |
| 1647 | 1476 | |
| 1648 | ROM_REGION( 0x20000, REGION_GFX3, 0 ) /* GFX */ | |
| 1649 | /* the same as 'Dangerous Dungeons' once decrypted */ | |
| 1650 | ROM_LOAD( "4-27512.rom", 0x00000, 0x10000, CRC(94b5ef6f) SHA1(32967f6cfc6a077c31923318891ed508f83e67f6) ) | |
| 1651 | ROM_LOAD( "3-27512.rom", 0x10000, 0x10000, CRC(a7a053a3) SHA1(98625fe73a409c8d51136931a5f707a0bf75b66a) ) | |
| 1477 | ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* audio cpu */ | |
| 1478 | ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) ) | |
| 1652 | 1479 | |
| 1653 | ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* GFX */ | |
| 1654 | ROM_LOAD( "6-27512.rom", 0x00000, 0x10000, CRC(2ba7ca47) SHA1(ad709fc871f1f1a7d4b0fdf0f516c53fd4c8b685) ) | |
| 1655 | ROM_LOAD( "5-27512.rom", 0x10000, 0x10000, CRC(4f91eec6) SHA1(18a5f98dfba33837b73d032a6153eeb03263684b) ) | |
| 1480 | ROM_REGION( 0x0800, REGION_CPU4, 0 ) /* 8k for the microcontroller */ | |
| 1481 | ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) ) | |
| 1482 | ||
| 1483 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 1484 | ROM_LOAD( "alpha.rom", 0x00000, 0x08000, CRC(3a7c3185) SHA1(1ccaa6a1f46d66feda49fdea337b8eb32f14c7b5) ) /* chars */ | |
| 1485 | ||
| 1486 | ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE ) /* sprites */ | |
| 1487 | ROM_LOAD( "tstrike.117", 0x00000, 0x10000, CRC(f7122c0d) SHA1(2b6b359585d9df966c1fc0041fb972aac9b1ab93) ) | |
| 1488 | ROM_LOAD( "21j-b", 0x10000, 0x10000, CRC(40507a76) SHA1(74581a4b6f48100bddf20f319903af2fe36f39fa) ) /* from ddragon (116) */ | |
| 1489 | ROM_LOAD( "tstrike.115", 0x20000, 0x10000, CRC(a13c7b62) SHA1(d929d8db7eb2b949cd3bd77238611ecc54b2e885) ) | |
| 1490 | ROM_LOAD( "21j-d", 0x30000, 0x10000, CRC(cb4f231b) SHA1(9f2270f9ceedfe51c5e9a9bbb00d6f43dbc4a3ea) ) /* from ddragon (114) */ | |
| 1491 | ROM_LOAD( "tstrike.113", 0x40000, 0x10000, CRC(5ad60938) SHA1(a0af9b227157d87fa6d4ea88b34227a97baff20e) ) | |
| 1492 | ROM_LOAD( "21j-f", 0x50000, 0x10000, CRC(6ba152f6) SHA1(a301ff809be0e1471f4ff8305b30c2fa4aa57fae) ) /* from ddragon (112) */ | |
| 1493 | ROM_LOAD( "tstrike.111", 0x60000, 0x10000, CRC(7b9c87ad) SHA1(429049f84b2084bb074e380dca63b75150e7e69f) ) | |
| 1494 | ROM_LOAD( "21j-h", 0x70000, 0x10000, CRC(65c7517d) SHA1(f177ba9c1c7cc75ff04d5591b9865ee364788f94) ) /* from ddragon (110) */ | |
| 1495 | ||
| 1496 | ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE ) /* tiles */ | |
| 1497 | ROM_LOAD( "tstrike.78", 0x00000, 0x10000, CRC(88284aec) SHA1(f07bc5f84f2b2f976c911541c8f1ff2558f569ca) ) | |
| 1498 | ROM_LOAD( "21j-9", 0x10000, 0x10000, CRC(c6640aed) SHA1(f156c337f48dfe4f7e9caee9a72c7ea3d53e3098) ) /* from ddragon (77) */ | |
| 1499 | ROM_LOAD( "tstrike.109", 0x20000, 0x10000, CRC(8c2cd0bb) SHA1(364a708484c7750f38162d463104216bbd555b86) ) | |
| 1500 | ROM_LOAD( "21j-j", 0x30000, 0x10000, CRC(5fb42e7c) SHA1(7953316712c56c6f8ca6bba127319e24b618b646) ) /* from ddragon (108) */ | |
| 1501 | ||
| 1502 | ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* adpcm samples */ | |
| 1503 | ROM_LOAD( "tstrike.94", 0x00000, 0x10000, CRC(8a2c09fc) SHA1(f59a43c3fa814b169a51744f9604d36ae63c190f) ) /* first+second half identical */ | |
| 1504 | ROM_LOAD( "tstrike.95", 0x10000, 0x08000, CRC(1812eecb) SHA1(9b7d526f30a86682cdf088600b25ea5a56b112ef) ) | |
| 1505 | ||
| 1506 | ROM_REGION( 0x0300, REGION_PROMS, 0 ) | |
| 1507 | ROM_LOAD( "21j-k-0", 0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) ) /* unknown */ | |
| 1508 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ | |
| 1656 | 1509 | ROM_END |
| 1657 | 1510 | |
| 1658 | ROM_START( stoffy ) | |
| 1659 | ROM_REGION( 0x28000, REGION_CPU1, 0 ) /* Main CPU? */ | |
| 1660 | ROM_LOAD( "u70.2", 0x00000, 0x10000, CRC(3c156610) SHA1(d7fdbc595bdc77c452da39da8b20774db0952e33) ) | |
| 1661 | ROM_RELOAD( 0x10000, 0x10000 ) | |
| 1511 | ROM_START( tstrikea ) | |
| 1512 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1513 | ROM_LOAD( "tstrike.26", 0x08000, 0x08000, CRC(871b10bc) SHA1(c824775cf72c039612fda76c4a518cd89e4c8657) ) | |
| 1514 | ROM_LOAD( "tstrike.25", 0x10000, 0x08000, CRC(b6a0c2f3) SHA1(3434689ca217f5af268058ad34c277db672d389c) ) /* banked at 0x4000-0x8000 */ | |
| 1515 | ROM_LOAD( "tstrike.24", 0x18000, 0x08000, CRC(363816fa) SHA1(65c1ccbb950e09230196b49dc7312a13a34f3f79) ) /* banked at 0x4000-0x8000 */ | |
| 1516 | /* IC23 is replaced with a daughterboard containing a 68705 MCU */ | |
| 1662 | 1517 | |
| 1663 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU? */ | |
| 1664 | ROM_LOAD( "u142.1", 0x00000, 0x10000, CRC(541bd7f0) SHA1(3f0097f5877eae50651f94d46d7dd9127037eb6e) ) // same as 'toffy' | |
| 1518 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sprite cpu */ | |
| 1519 | ROM_LOAD( "63701.bin", 0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) ) | |
| 1665 | 1520 | |
| 1666 | ROM_REGION( 0x10000, REGION_GFX1, 0 ) /* GFX? */ | |
| 1667 | ROM_LOAD( "u35.7", 0x00000, 0x10000, CRC(83735d25) SHA1(d82c046db0112d7d2877339652b2111f12513a4f) ) | |
| 1521 | ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* audio cpu */ | |
| 1522 | ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) ) | |
| 1668 | 1523 | |
| 1669 | ROM_REGION( 0x20000, REGION_GFX3, 0 ) /* GFX */ | |
| 1670 | ROM_LOAD( "u78.4", 0x00000, 0x10000, CRC(9743a74d) SHA1(876696c5e88e58e6e44671c33a4c140be02a941e) ) // 0 | |
| 1671 | ROM_LOAD( "u77.3", 0x10000, 0x10000, CRC(f267109a) SHA1(679d2147c79636796dda850345c04ad8a9daa6af) ) // 0 | |
| 1524 | ROM_REGION( 0x0800, REGION_CPU4, 0 ) /* 8k for the microcontroller */ | |
| 1525 | ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) ) | |
| 1672 | 1526 | |
| 1673 | ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* GFX */ | |
| 1674 | ROM_LOAD( "u80.5", 0x00000, 0x10000, CRC(ff190865) SHA1(245e69651d0161fcb416bba8f743602b4ee83139) ) // 1 | should be u80.6 ? | |
| 1675 | ROM_LOAD( "u79.5", 0x10000, 0x10000, CRC(333d5b8a) SHA1(d3573db87e2318c144ee9ace6c975a70fc96f4c4) ) // 1 | |
| 1527 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 1528 | ROM_LOAD( "tstrike.20", 0x00000, 0x08000, CRC(b6b8bfa0) SHA1(ce50f8eb1a84873ef3df621d971a6b087473d6c2) ) /* chars */ | |
| 1529 | ||
| 1530 | ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE ) /* sprites */ | |
| 1531 | ROM_LOAD( "tstrike.117", 0x00000, 0x10000, CRC(f7122c0d) SHA1(2b6b359585d9df966c1fc0041fb972aac9b1ab93) ) | |
| 1532 | ROM_LOAD( "21j-b", 0x10000, 0x10000, CRC(40507a76) SHA1(74581a4b6f48100bddf20f319903af2fe36f39fa) ) /* from ddragon (116) */ | |
| 1533 | ROM_LOAD( "tstrike.115", 0x20000, 0x10000, CRC(a13c7b62) SHA1(d929d8db7eb2b949cd3bd77238611ecc54b2e885) ) | |
| 1534 | ROM_LOAD( "21j-d", 0x30000, 0x10000, CRC(cb4f231b) SHA1(9f2270f9ceedfe51c5e9a9bbb00d6f43dbc4a3ea) ) /* from ddragon (114) */ | |
| 1535 | ROM_LOAD( "tstrike.113", 0x40000, 0x10000, CRC(5ad60938) SHA1(a0af9b227157d87fa6d4ea88b34227a97baff20e) ) | |
| 1536 | ROM_LOAD( "21j-f", 0x50000, 0x10000, CRC(6ba152f6) SHA1(a301ff809be0e1471f4ff8305b30c2fa4aa57fae) ) /* from ddragon (112) */ | |
| 1537 | ROM_LOAD( "tstrike.111", 0x60000, 0x10000, CRC(7b9c87ad) SHA1(429049f84b2084bb074e380dca63b75150e7e69f) ) | |
| 1538 | ROM_LOAD( "21j-h", 0x70000, 0x10000, CRC(65c7517d) SHA1(f177ba9c1c7cc75ff04d5591b9865ee364788f94) ) /* from ddragon (110) */ | |
| 1539 | ||
| 1540 | ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE ) /* tiles */ | |
| 1541 | ROM_LOAD( "tstrike.78", 0x00000, 0x10000, CRC(88284aec) SHA1(f07bc5f84f2b2f976c911541c8f1ff2558f569ca) ) | |
| 1542 | ROM_LOAD( "21j-9", 0x10000, 0x10000, CRC(c6640aed) SHA1(f156c337f48dfe4f7e9caee9a72c7ea3d53e3098) ) /* from ddragon (77) */ | |
| 1543 | ROM_LOAD( "tstrike.109", 0x20000, 0x10000, CRC(8c2cd0bb) SHA1(364a708484c7750f38162d463104216bbd555b86) ) | |
| 1544 | ROM_LOAD( "21j-j", 0x30000, 0x10000, CRC(5fb42e7c) SHA1(7953316712c56c6f8ca6bba127319e24b618b646) ) /* from ddragon (108) */ | |
| 1545 | ||
| 1546 | ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* adpcm samples */ | |
| 1547 | ROM_LOAD( "tstrike.94", 0x00000, 0x10000, CRC(8a2c09fc) SHA1(f59a43c3fa814b169a51744f9604d36ae63c190f) ) /* first+second half identical */ | |
| 1548 | ROM_LOAD( "tstrike.95", 0x10000, 0x08000, CRC(1812eecb) SHA1(9b7d526f30a86682cdf088600b25ea5a56b112ef) ) | |
| 1549 | ||
| 1550 | ROM_REGION( 0x0300, REGION_PROMS, 0 ) | |
| 1551 | ROM_LOAD( "21j-k-0", 0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) ) /* unknown */ | |
| 1552 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ | |
| 1676 | 1553 | ROM_END |
| 1677 | 1554 | |
| 1555 | ||
| 1678 | 1556 | ROM_START( ddungeon ) |
| 1679 | ROM_REGION( 0x | |
| 1557 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* Main CPU? */ | |
| 1680 | 1558 | ROM_LOAD( "dd3.bin", 0x10000, 0x8000, CRC(922e719c) SHA1(d1c73f56913cd368158abc613d7bbab669509742) ) |
| 1681 | 1559 | ROM_LOAD( "dd2.bin", 0x08000, 0x8000, CRC(a6e7f608) SHA1(83b9301c39bfdc1e50a37f2bdc4d4f65a1111bee) ) |
| 1682 | 1560 | /* IC23 is replaced with a daughterboard containing a 68705 MCU */ |
| r1591 | r1592 | |
| 1710 | 1588 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ |
| 1711 | 1589 | ROM_END |
| 1712 | 1590 | |
| 1591 | ||
| 1713 | 1592 | ROM_START( darktowr ) |
| 1714 | ROM_REGION( 0x | |
| 1593 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1715 | 1594 | ROM_LOAD( "dt.26", 0x08000, 0x08000, CRC(8134a472) SHA1(7d42d2ed8d09855241d98ed94bce140a314c2f66) ) |
| 1716 | 1595 | ROM_LOAD( "21j-2-3.25", 0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* from ddragon */ |
| 1717 | 1596 | ROM_LOAD( "dt.24", 0x18000, 0x08000, CRC(523a5413) SHA1(71c04287e4f2e792c98abdeb97fe70abd0d5e918) ) /* banked at 0x4000-0x8000 */ |
| r1591 | r1592 | |
| 1754 | 1633 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ /* from ddragon */ |
| 1755 | 1634 | ROM_END |
| 1756 | 1635 | |
| 1757 | ROM_START( tstrikea ) | |
| 1758 | ROM_REGION( 0x28000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1759 | ROM_LOAD( "tstrike.26", 0x08000, 0x08000, CRC(871b10bc) SHA1(c824775cf72c039612fda76c4a518cd89e4c8657) ) | |
| 1760 | ROM_LOAD( "tstrike.25", 0x10000, 0x08000, CRC(b6a0c2f3) SHA1(3434689ca217f5af268058ad34c277db672d389c) ) /* banked at 0x4000-0x8000 */ | |
| 1761 | ROM_LOAD( "tstrike.24", 0x18000, 0x08000, CRC(363816fa) SHA1(65c1ccbb950e09230196b49dc7312a13a34f3f79) ) /* banked at 0x4000-0x8000 */ | |
| 1762 | /* IC23 is replaced with a daughterboard containing a 68705 MCU */ | |
| 1763 | 1636 | |
| 1764 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sprite cpu */ | |
| 1765 | ROM_LOAD( "63701.bin", 0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) ) | |
| 1637 | ROM_START( toffy ) | |
| 1638 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* Main CPU? */ | |
| 1639 | ROM_LOAD( "2-27512.rom", 0x00000, 0x10000, CRC(244709dd) SHA1(b2db51b910f1a031b94fb50e684351f657a465dc) ) | |
| 1640 | ROM_RELOAD( 0x10000, 0x10000 ) | |
| 1766 | 1641 | |
| 1767 | ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* audio cpu */ | |
| 1768 | ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) ) | |
| 1642 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU? */ | |
| 1643 | ROM_LOAD( "u142.1", 0x00000, 0x10000, CRC(541bd7f0) SHA1(3f0097f5877eae50651f94d46d7dd9127037eb6e) ) | |
| 1769 | 1644 | |
| 1770 | ROM_REGION( 0x0800, REGION_CPU4, 0 ) /* 8k for the microcontroller */ | |
| 1771 | ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) ) | |
| 1645 | ROM_REGION( 0x10000, REGION_GFX1, 0 ) /* GFX? */ | |
| 1646 | ROM_LOAD( "7-27512.rom", 0x000, 0x10000, CRC(f9e8ec64) SHA1(36891cd8f28800e03fe0eac84b2484a70011eabb) ) | |
| 1772 | 1647 | |
| 1773 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 1774 | ROM_LOAD( "tstrike.20", 0x00000, 0x08000, CRC(b6b8bfa0) SHA1(ce50f8eb1a84873ef3df621d971a6b087473d6c2) ) /* chars */ | |
| 1648 | ROM_REGION( 0x20000, REGION_GFX3, 0 ) /* GFX */ | |
| 1649 | /* the same as 'Dangerous Dungeons' once decrypted */ | |
| 1650 | ROM_LOAD( "4-27512.rom", 0x00000, 0x10000, CRC(94b5ef6f) SHA1(32967f6cfc6a077c31923318891ed508f83e67f6) ) | |
| 1651 | ROM_LOAD( "3-27512.rom", 0x10000, 0x10000, CRC(a7a053a3) SHA1(98625fe73a409c8d51136931a5f707a0bf75b66a) ) | |
| 1775 | 1652 | |
| 1776 | ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE ) /* sprites */ | |
| 1777 | ROM_LOAD( "tstrike.117", 0x00000, 0x10000, CRC(f7122c0d) SHA1(2b6b359585d9df966c1fc0041fb972aac9b1ab93) ) | |
| 1778 | ROM_LOAD( "21j-b", 0x10000, 0x10000, CRC(40507a76) SHA1(74581a4b6f48100bddf20f319903af2fe36f39fa) ) /* from ddragon (116) */ | |
| 1779 | ROM_LOAD( "tstrike.115", 0x20000, 0x10000, CRC(a13c7b62) SHA1(d929d8db7eb2b949cd3bd77238611ecc54b2e885) ) | |
| 1780 | ROM_LOAD( "21j-d", 0x30000, 0x10000, CRC(cb4f231b) SHA1(9f2270f9ceedfe51c5e9a9bbb00d6f43dbc4a3ea) ) /* from ddragon (114) */ | |
| 1781 | ROM_LOAD( "tstrike.113", 0x40000, 0x10000, CRC(5ad60938) SHA1(a0af9b227157d87fa6d4ea88b34227a97baff20e) ) | |
| 1782 | ROM_LOAD( "21j-f", 0x50000, 0x10000, CRC(6ba152f6) SHA1(a301ff809be0e1471f4ff8305b30c2fa4aa57fae) ) /* from ddragon (112) */ | |
| 1783 | ROM_LOAD( "tstrike.111", 0x60000, 0x10000, CRC(7b9c87ad) SHA1(429049f84b2084bb074e380dca63b75150e7e69f) ) | |
| 1784 | ROM_LOAD( "21j-h", 0x70000, 0x10000, CRC(65c7517d) SHA1(f177ba9c1c7cc75ff04d5591b9865ee364788f94) ) /* from ddragon (110) */ | |
| 1785 | ||
| 1786 | ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE ) /* tiles */ | |
| 1787 | ROM_LOAD( "tstrike.78", 0x00000, 0x10000, CRC(88284aec) SHA1(f07bc5f84f2b2f976c911541c8f1ff2558f569ca) ) | |
| 1788 | ROM_LOAD( "21j-9", 0x10000, 0x10000, CRC(c6640aed) SHA1(f156c337f48dfe4f7e9caee9a72c7ea3d53e3098) ) /* from ddragon (77) */ | |
| 1789 | ROM_LOAD( "tstrike.109", 0x20000, 0x10000, CRC(8c2cd0bb) SHA1(364a708484c7750f38162d463104216bbd555b86) ) | |
| 1790 | ROM_LOAD( "21j-j", 0x30000, 0x10000, CRC(5fb42e7c) SHA1(7953316712c56c6f8ca6bba127319e24b618b646) ) /* from ddragon (108) */ | |
| 1791 | ||
| 1792 | ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* adpcm samples */ | |
| 1793 | ROM_LOAD( "tstrike.94", 0x00000, 0x10000, CRC(8a2c09fc) SHA1(f59a43c3fa814b169a51744f9604d36ae63c190f) ) /* first+second half identical */ | |
| 1794 | ROM_LOAD( "tstrike.95", 0x10000, 0x08000, CRC(1812eecb) SHA1(9b7d526f30a86682cdf088600b25ea5a56b112ef) ) | |
| 1795 | ||
| 1796 | ROM_REGION( 0x0300, REGION_PROMS, 0 ) | |
| 1797 | ROM_LOAD( "21j-k-0", 0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) ) /* unknown */ | |
| 1798 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ | |
| 1653 | ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* GFX */ | |
| 1654 | ROM_LOAD( "6-27512.rom", 0x00000, 0x10000, CRC(2ba7ca47) SHA1(ad709fc871f1f1a7d4b0fdf0f516c53fd4c8b685) ) | |
| 1655 | ROM_LOAD( "5-27512.rom", 0x10000, 0x10000, CRC(4f91eec6) SHA1(18a5f98dfba33837b73d032a6153eeb03263684b) ) | |
| 1799 | 1656 | ROM_END |
| 1800 | 1657 | |
| 1801 | ROM_START( tstrike ) | |
| 1802 | ROM_REGION( 0x28000, REGION_CPU1, 0 ) /* 64k for code + bankswitched memory */ | |
| 1803 | ROM_LOAD( "prog.rom", 0x08000, 0x08000, CRC(bf011a00) SHA1(09a55042a219dd37cb9e7feeab092ebfb903ddde) ) | |
| 1804 | ROM_LOAD( "tstrike.25", 0x10000, 0x08000, CRC(b6a0c2f3) SHA1(3434689ca217f5af268058ad34c277db672d389c) ) /* banked at 0x4000-0x8000 */ | |
| 1805 | ROM_LOAD( "tstrike.24", 0x18000, 0x08000, CRC(363816fa) SHA1(65c1ccbb950e09230196b49dc7312a13a34f3f79) ) /* banked at 0x4000-0x8000 */ | |
| 1806 | /* IC23 is replaced with a daughterboard containing a 68705 MCU */ | |
| 1658 | ROM_START( stoffy ) | |
| 1659 | ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* Main CPU? */ | |
| 1660 | ROM_LOAD( "u70.2", 0x00000, 0x10000, CRC(3c156610) SHA1(d7fdbc595bdc77c452da39da8b20774db0952e33) ) | |
| 1661 | ROM_RELOAD( 0x10000, 0x10000 ) | |
| 1807 | 1662 | |
| 1808 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sprite cpu */ | |
| 1809 | ROM_LOAD( "63701.bin", 0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) ) | |
| 1663 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU? */ | |
| 1664 | ROM_LOAD( "u142.1", 0x00000, 0x10000, CRC(541bd7f0) SHA1(3f0097f5877eae50651f94d46d7dd9127037eb6e) ) // same as 'toffy' | |
| 1810 | 1665 | |
| 1811 | ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* audio cpu */ | |
| 1812 | ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) ) | |
| 1666 | ROM_REGION( 0x10000, REGION_GFX1, 0 ) /* GFX? */ | |
| 1667 | ROM_LOAD( "u35.7", 0x00000, 0x10000, CRC(83735d25) SHA1(d82c046db0112d7d2877339652b2111f12513a4f) ) | |
| 1813 | 1668 | |
| 1814 | ROM_REGION( 0x0800, REGION_CPU4, 0 ) /* 8k for the microcontroller */ | |
| 1815 | ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) ) | |
| 1669 | ROM_REGION( 0x20000, REGION_GFX3, 0 ) /* GFX */ | |
| 1670 | ROM_LOAD( "u78.4", 0x00000, 0x10000, CRC(9743a74d) SHA1(876696c5e88e58e6e44671c33a4c140be02a941e) ) // 0 | |
| 1671 | ROM_LOAD( "u77.3", 0x10000, 0x10000, CRC(f267109a) SHA1(679d2147c79636796dda850345c04ad8a9daa6af) ) // 0 | |
| 1816 | 1672 | |
| 1817 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) | |
| 1818 | ROM_LOAD( "alpha.rom", 0x00000, 0x08000, CRC(3a7c3185) SHA1(1ccaa6a1f46d66feda49fdea337b8eb32f14c7b5) ) /* chars */ | |
| 1673 | ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* GFX */ | |
| 1674 | ROM_LOAD( "u80.5", 0x00000, 0x10000, CRC(ff190865) SHA1(245e69651d0161fcb416bba8f743602b4ee83139) ) // 1 | should be u80.6 ? | |
| 1675 | ROM_LOAD( "u79.5", 0x10000, 0x10000, CRC(333d5b8a) SHA1(d3573db87e2318c144ee9ace6c975a70fc96f4c4) ) // 1 | |
| 1676 | ROM_END | |
| 1819 | 1677 | |
| 1820 | ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE ) /* sprites */ | |
| 1821 | ROM_LOAD( "tstrike.117", 0x00000, 0x10000, CRC(f7122c0d) SHA1(2b6b359585d9df966c1fc0041fb972aac9b1ab93) ) | |
| 1822 | ROM_LOAD( "21j-b", 0x10000, 0x10000, CRC(40507a76) SHA1(74581a4b6f48100bddf20f319903af2fe36f39fa) ) /* from ddragon (116) */ | |
| 1823 | ROM_LOAD( "tstrike.115", 0x20000, 0x10000, CRC(a13c7b62) SHA1(d929d8db7eb2b949cd3bd77238611ecc54b2e885) ) | |
| 1824 | ROM_LOAD( "21j-d", 0x30000, 0x10000, CRC(cb4f231b) SHA1(9f2270f9ceedfe51c5e9a9bbb00d6f43dbc4a3ea) ) /* from ddragon (114) */ | |
| 1825 | ROM_LOAD( "tstrike.113", 0x40000, 0x10000, CRC(5ad60938) SHA1(a0af9b227157d87fa6d4ea88b34227a97baff20e) ) | |
| 1826 | ROM_LOAD( "21j-f", 0x50000, 0x10000, CRC(6ba152f6) SHA1(a301ff809be0e1471f4ff8305b30c2fa4aa57fae) ) /* from ddragon (112) */ | |
| 1827 | ROM_LOAD( "tstrike.111", 0x60000, 0x10000, CRC(7b9c87ad) SHA1(429049f84b2084bb074e380dca63b75150e7e69f) ) | |
| 1828 | ROM_LOAD( "21j-h", 0x70000, 0x10000, CRC(65c7517d) SHA1(f177ba9c1c7cc75ff04d5591b9865ee364788f94) ) /* from ddragon (110) */ | |
| 1829 | 1678 | |
| 1830 | ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE ) /* tiles */ | |
| 1831 | ROM_LOAD( "tstrike.78", 0x00000, 0x10000, CRC(88284aec) SHA1(f07bc5f84f2b2f976c911541c8f1ff2558f569ca) ) | |
| 1832 | ROM_LOAD( "21j-9", 0x10000, 0x10000, CRC(c6640aed) SHA1(f156c337f48dfe4f7e9caee9a72c7ea3d53e3098) ) /* from ddragon (77) */ | |
| 1833 | ROM_LOAD( "tstrike.109", 0x20000, 0x10000, CRC(8c2cd0bb) SHA1(364a708484c7750f38162d463104216bbd555b86) ) | |
| 1834 | ROM_LOAD( "21j-j", 0x30000, 0x10000, CRC(5fb42e7c) SHA1(7953316712c56c6f8ca6bba127319e24b618b646) ) /* from ddragon (108) */ | |
| 1835 | 1679 | |
| 1836 | ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* adpcm samples */ | |
| 1837 | ROM_LOAD( "tstrike.94", 0x00000, 0x10000, CRC(8a2c09fc) SHA1(f59a43c3fa814b169a51744f9604d36ae63c190f) ) /* first+second half identical */ | |
| 1838 | ROM_LOAD( "tstrike.95", 0x10000, 0x08000, CRC(1812eecb) SHA1(9b7d526f30a86682cdf088600b25ea5a56b112ef) ) | |
| 1680 | /************************************* | |
| 1681 | * | |
| 1682 | * Driver-specific initialization | |
| 1683 | * | |
| 1684 | *************************************/ | |
| 1839 | 1685 | |
| 1840 | ROM_REGION( 0x0300, REGION_PROMS, 0 ) | |
| 1841 | ROM_LOAD( "21j-k-0", 0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) ) /* unknown */ | |
| 1842 | ROM_LOAD( "21j-l-0", 0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) ) /* unknown */ | |
| 1843 | ROM_END | |
| 1686 | static DRIVER_INIT( ddragon ) | |
| 1687 | { | |
| 1688 | sprite_irq = INPUT_LINE_NMI; | |
| 1689 | sound_irq = M6809_IRQ_LINE; | |
| 1690 | ym_irq = M6809_FIRQ_LINE; | |
| 1691 | technos_video_hw = 0; | |
| 1692 | } | |
| 1844 | 1693 | |
| 1845 | /** INITS ** | |
| 1846 | toffy / stoffy are 'encrytped | |
| 1847 | 1694 | |
| 1848 | */ | |
| 1849 | ||
| 1850 | static void ddragon_restore_state(int dummy) | |
| 1695 | static DRIVER_INIT( ddragon2 ) | |
| 1851 | 1696 | { |
| 1852 | ddragon_bankswitch_w(0, bank_data); | |
| 1697 | sprite_irq = INPUT_LINE_NMI; | |
| 1698 | sound_irq = INPUT_LINE_NMI; | |
| 1699 | ym_irq = 0; | |
| 1700 | technos_video_hw = 2; | |
| 1853 | 1701 | } |
| 1854 | 1702 | |
| 1855 | static MACHINE_START( ddragon ) | |
| 1703 | ||
| 1704 | static DRIVER_INIT( darktowr ) | |
| 1856 | 1705 | { |
| 1857 | state_save_register_global(bank_data); | |
| 1858 | state_save_register_func_postload_int(ddragon_restore_state, 0); | |
| 1706 | sprite_irq = INPUT_LINE_NMI; | |
| 1707 | sound_irq = M6809_IRQ_LINE; | |
| 1708 | ym_irq = M6809_FIRQ_LINE; | |
| 1709 | technos_video_hw = 0; | |
| 1710 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, darktowr_bankswitch_w); | |
| 1859 | 1711 | } |
| 1860 | 1712 | |
| 1713 | ||
| 1861 | 1714 | static DRIVER_INIT( toffy ) |
| 1862 | 1715 | { |
| 1863 | /* the program rom has a simple bitswap encryption */ | |
| 1864 | UINT8 *rom=memory_region(REGION_CPU1); | |
| 1865 | int i; | |
| 1716 | int i, length; | |
| 1717 | UINT8 *rom; | |
| 1866 | 1718 | |
| 1867 | for (i = 0;i < 0x20000;i++) | |
| 1868 | rom[i] = BITSWAP8(rom[i] , 6,7,5,4,3,2,1,0); | |
| 1719 | sound_irq = M6809_IRQ_LINE; | |
| 1720 | ym_irq = M6809_FIRQ_LINE; | |
| 1721 | technos_video_hw = 0; | |
| 1722 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, toffy_bankswitch_w); | |
| 1869 | 1723 | |
| 1724 | /* the program rom has a simple bitswap encryption */ | |
| 1725 | rom = memory_region(REGION_CPU1); | |
| 1726 | length = memory_region_length(REGION_CPU1); | |
| 1727 | for (i = 0; i < length; i++) | |
| 1728 | rom[i] = BITSWAP8(rom[i], 6,7,5,4,3,2,1,0); | |
| 1729 | ||
| 1870 | 1730 | /* and the fg gfx ... */ |
| 1871 | rom=memory_region(REGION_GFX1); | |
| 1731 | rom = memory_region(REGION_GFX1); | |
| 1732 | length = memory_region_length(REGION_GFX1); | |
| 1733 | for (i = 0; i < length; i++) | |
| 1734 | rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0); | |
| 1872 | 1735 | |
| 1873 | for (i = 0;i < 0x10000;i++) | |
| 1874 | rom[i] = BITSWAP8(rom[i] , 7,6,5,3,4,2,1,0); | |
| 1736 | /* and the sprites gfx */ | |
| 1737 | rom = memory_region(REGION_GFX2); | |
| 1738 | length = memory_region_length(REGION_GFX2); | |
| 1739 | for (i = 0; i < length; i++) | |
| 1740 | rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,0,1); | |
| 1875 | 1741 | |
| 1876 | 1742 | /* and the bg gfx */ |
| 1877 | rom=memory_region(REGION_GFX3); | |
| 1878 | ||
| 1879 | for (i = 0;i < 0x10000;i++) | |
| 1743 | rom = memory_region(REGION_GFX3); | |
| 1744 | length = memory_region_length(REGION_GFX3); | |
| 1745 | for (i = 0; i < length / 2; i++) | |
| 1880 | 1746 | { |
| 1881 | rom[i] = BITSWAP8(rom[i] , 7,6,1,4,3,2,5,0); | |
| 1882 | rom[i+0x10000] = BITSWAP8(rom[i+0x10000] , 7,6,2,4,3,5,1,0); | |
| 1747 | rom[i + 0*length/2] = BITSWAP8(rom[i + 0*length/2], 7,6,1,4,3,2,5,0); | |
| 1748 | rom[i + 1*length/2] = BITSWAP8(rom[i + 1*length/2], 7,6,2,4,3,5,1,0); | |
| 1883 | 1749 | } |
| 1884 | 1750 | |
| 1885 | /* and the sprites gfx */ | |
| 1886 | rom=memory_region(REGION_GFX2); | |
| 1751 | /* should the sound rom be bitswapped too? */ | |
| 1752 | } | |
| 1887 | 1753 | |
| 1888 | for (i = 0;i < 0x20000;i++) | |
| 1889 | rom[i] = BITSWAP8(rom[i] , 7,6,5,4,3,2,0,1); | |
| 1890 | 1754 | |
| 1891 | /* should the sound rom be bitswapped too? */ | |
| 1892 | 1755 | |
| 1893 | } | |
| 1756 | /************************************* | |
| 1757 | * | |
| 1758 | * Game drivers | |
| 1759 | * | |
| 1760 | *************************************/ | |
| 1894 | 1761 | |
| 1895 | GAME( 1987, ddragon, 0, ddragon, ddragon, 0, ROT0, "Technos", "Double Dragon (Japan)", 0 ) | |
| 1896 | GAME( 1987, ddragonw, ddragon, ddragon, ddragon, 0, ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 1)", 0 ) | |
| 1897 | GAME( 1987, ddragnw1, ddragon, ddragon, ddragon, 0, ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 2)", 0 ) | |
| 1898 | GAME( 1987, ddragonu, ddragon, ddragon, ddragon, 0, ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 1)", 0 ) | |
| 1899 | GAME( 1987, ddragoua, ddragon, ddragon, ddragon, 0, ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 2)", 0 ) | |
| 1900 | GAME( 1987, ddragonb, ddragon, ddragonb, ddragon, 0, ROT0, "bootleg", "Double Dragon (bootleg with HD6903)", 0 ) // according to dump notes | |
| 1901 | GAME( 1987, ddragnba, ddragon, ddragnba, ddragon, 0, ROT0, "bootleg", "Double Dragon (bootleg with M6803)", 0 ) | |
| 1762 | GAME( 1987, ddragon, 0, ddragon, ddragon, ddragon, ROT0, "Technos", "Double Dragon (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1763 | GAME( 1987, ddragonw, ddragon, ddragon, ddragon, ddragon, ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 1)", GAME_SUPPORTS_SAVE ) | |
| 1764 | GAME( 1987, ddragnw1, ddragon, ddragon, ddragon, ddragon, ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 2)", GAME_SUPPORTS_SAVE ) | |
| 1765 | GAME( 1987, ddragonu, ddragon, ddragon, ddragon, ddragon, ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 1)", GAME_SUPPORTS_SAVE ) | |
| 1766 | GAME( 1987, ddragoua, ddragon, ddragon, ddragon, ddragon, ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 2)", GAME_SUPPORTS_SAVE ) | |
| 1767 | GAME( 1987, ddragonb, ddragon, ddragonb, ddragon, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", GAME_SUPPORTS_SAVE ) // according to dump notes | |
| 1768 | GAME( 1987, ddragnba, ddragon, ddragnba, ddragon, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with M6803)", GAME_SUPPORTS_SAVE ) | |
| 1902 | 1769 | |
| 1903 | GAME( 1988, ddragon2, 0, ddragon2, ddragon2, 0, ROT0, "Technos", "Double Dragon II - The Revenge (World)", 0 ) | |
| 1904 | GAME( 1988, ddragn2u, ddragon2, ddragon2, ddragon2, 0, ROT0, "Technos", "Double Dragon II - The Revenge (US)", 0 ) | |
| 1770 | GAME( 1988, ddragon2, 0, ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (World)", GAME_SUPPORTS_SAVE ) | |
| 1771 | GAME( 1988, ddragn2u, ddragon2, ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (US)", GAME_SUPPORTS_SAVE ) | |
| 1905 | 1772 | |
| 1906 | 1773 | /* these were conversions of double dragon */ |
| 1907 | GAME( 1991, tstrike, 0, darktowr, tstrike, 0, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Newer)", 0 ) | |
| 1908 | GAME( 1991, tstrikea, tstrike, darktowr, tstrike, 0, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Older)", 0 ) | |
| 1909 | GAME( 1992, ddungeon, 0, darktowr, ddungeon, 0, ROT0, "East Coast Coin Company (Melbourne)", "Dangerous Dungeons", 0 ) | |
| 1910 | GAME( 1992, darktowr, 0, darktowr, darktowr, 0, ROT0, "Game Room", "Dark Tower", 0 ) | |
| 1774 | GAME( 1991, tstrike, 0, darktowr, tstrike, darktowr, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Newer)", GAME_SUPPORTS_SAVE ) | |
| 1775 | GAME( 1991, tstrikea, tstrike, darktowr, tstrike, darktowr, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Older)", GAME_SUPPORTS_SAVE ) | |
| 1776 | GAME( 1992, ddungeon, 0, darktowr, ddungeon, darktowr, ROT0, "East Coast Coin Company (Melbourne)", "Dangerous Dungeons", GAME_SUPPORTS_SAVE ) | |
| 1777 | GAME( 1992, darktowr, 0, darktowr, darktowr, darktowr, ROT0, "Game Room", "Dark Tower", GAME_SUPPORTS_SAVE ) | |
| 1911 | 1778 | |
| 1912 | 1779 | /* these run on their own board, but are basically the same game. Toffy even has 'dangerous dungeons' text in it */ |
| 1913 | GAME( 1993, toffy, 0, toffy, toffy, toffy, ROT0, "Midas", "Toffy", 0 ) | |
| 1914 | GAME( 1994, stoffy, 0, toffy, toffy, toffy, ROT0, "Midas (Unico license)", "Super Toffy", 0 ) | |
| 1780 | GAME( 1993, toffy, 0, toffy, toffy, toffy, ROT0, "Midas", "Toffy", GAME_SUPPORTS_SAVE ) | |
| 1781 | GAME( 1994, stoffy, 0, toffy, toffy, toffy, ROT0, "Midas (Unico license)", "Super Toffy", GAME_SUPPORTS_SAVE ) |
| r1591 | r1592 | |
|---|---|---|
| 508 | 508 | static INTERRUPT_GEN( acommand_irq ) |
| 509 | 509 | { |
| 510 | 510 | if (cpu_getiloops() == 0) |
| 511 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 511 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 512 | 512 | else if (cpu_getiloops() == 1) |
| 513 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 513 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | static MACHINE_DRIVER_START( acommand ) |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | // global interrupt masking |
| 111 | 111 | if (!K056832_is_IRQ_enabled(0)) return; |
| 112 | 112 | |
| 113 | cpunum_set_input_line(0, 5, HOLD_LINE); /* ??? All irqs have the same vector, and the | |
| 113 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); /* ??? All irqs have the same vector, and the | |
| 114 | 114 | mask used is 0 or 7 */ |
| 115 | 115 | } |
| 116 | 116 | |
| r1591 | r1592 | |
| 121 | 121 | |
| 122 | 122 | static TIMER_CALLBACK( nmi_callback ) |
| 123 | 123 | { |
| 124 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 124 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static WRITE8_HANDLER( sound_arm_nmi_w ) |
| 128 | 128 | { |
| 129 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 129 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 130 | 130 | timer_set(ATTOTIME_IN_USEC(5), NULL,0,nmi_callback); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static WRITE16_HANDLER( sound_irq_w ) |
| 134 | 134 | { |
| 135 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 135 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | // Check the routine at 7f30 in the ead version. |
| r1591 | r1592 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | static WRITE8_HANDLER( main_cpu_irq_line_clear_w ) |
| 169 | 169 | { |
| 170 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 170 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 171 | 171 | logerror("CPU#0 VBLANK int clear at scanline=%3i\n", curr_scanline); |
| 172 | 172 | return; |
| 173 | 173 | } |
| r1591 | r1592 | |
| 203 | 203 | |
| 204 | 204 | static WRITE8_HANDLER( second_cpu_irq_line_clear_w ) |
| 205 | 205 | { |
| 206 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 206 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 207 | 207 | logerror("CPU#1 VBLANK int clear at scanline=%3i\n", curr_scanline); |
| 208 | 208 | return; |
| 209 | 209 | } |
| r1591 | r1592 | |
| 238 | 238 | |
| 239 | 239 | static READ8_HANDLER( tubep_sound_irq_ack ) |
| 240 | 240 | { |
| 241 | cpunum_set_input_line(2, 0, CLEAR_LINE); | |
| 241 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE); | |
| 242 | 242 | return 0; |
| 243 | 243 | } |
| 244 | 244 | |
| r1591 | r1592 | |
| 281 | 281 | if (scanline==240) |
| 282 | 282 | { |
| 283 | 283 | logerror("VBLANK CPU#0\n"); |
| 284 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 284 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | |
| r1591 | r1592 | |
| 290 | 290 | if (scanline==16) |
| 291 | 291 | { |
| 292 | 292 | logerror("/VBLANK CPU#1\n"); |
| 293 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 293 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| r1591 | r1592 | |
| 300 | 300 | { |
| 301 | 301 | logerror("/nmi CPU#3\n"); |
| 302 | 302 | tubep_vblank_end(); /* switch buffered sprite RAM page */ |
| 303 | cpunum_set_input_line(3, INPUT_LINE_NMI, ASSERT_LINE); | |
| 303 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, ASSERT_LINE); | |
| 304 | 304 | } |
| 305 | 305 | /* CPU #3 MS2010-A NMI */ |
| 306 | 306 | /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ |
| 307 | 307 | if (scanline==240) |
| 308 | 308 | { |
| 309 | 309 | logerror("CPU#3 nmi clear\n"); |
| 310 | cpunum_set_input_line(3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 310 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | |
| r1591 | r1592 | |
| 315 | 315 | /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */ |
| 316 | 316 | if ((scanline==64) || (scanline==192)) |
| 317 | 317 | { |
| 318 | cpunum_set_input_line(2,0,ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
| 318 | cpunum_set_input_line(machine, 2,0,ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| r1591 | r1592 | |
| 408 | 408 | static WRITE8_HANDLER( rjammer_soundlatch_w ) |
| 409 | 409 | { |
| 410 | 410 | sound_latch = data; |
| 411 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 411 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | |
| r1591 | r1592 | |
| 463 | 463 | if (scanline==240) |
| 464 | 464 | { |
| 465 | 465 | logerror("VBLANK CPU#0\n"); |
| 466 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 466 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | |
| r1591 | r1592 | |
| 472 | 472 | if (scanline==16) |
| 473 | 473 | { |
| 474 | 474 | logerror("/VBLANK CPU#1\n"); |
| 475 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 475 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | |
| r1591 | r1592 | |
| 482 | 482 | { |
| 483 | 483 | logerror("/nmi CPU#3\n"); |
| 484 | 484 | tubep_vblank_end(); /* switch buffered sprite RAM page */ |
| 485 | cpunum_set_input_line(3, INPUT_LINE_NMI, ASSERT_LINE); | |
| 485 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, ASSERT_LINE); | |
| 486 | 486 | } |
| 487 | 487 | /* CPU #3 MS2010-A NMI */ |
| 488 | 488 | /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ |
| 489 | 489 | if (scanline==240) |
| 490 | 490 | { |
| 491 | 491 | logerror("CPU#3 nmi clear\n"); |
| 492 | cpunum_set_input_line(3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 492 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
| r1591 | r1592 | |
| 497 | 497 | /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */ |
| 498 | 498 | if ((scanline==64) || (scanline==192)) |
| 499 | 499 | { |
| 500 | cpunum_set_input_line(2,0,ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
| 500 | cpunum_set_input_line(machine, 2,0,ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | |
| r1591 | r1592 | |
| 571 | 571 | if (ls74==1) |
| 572 | 572 | { |
| 573 | 573 | MSM5205_data_w(0, (ls377>>0) & 15 ); |
| 574 | cpunum_set_input_line(2, 0, ASSERT_LINE ); | |
| 574 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE ); | |
| 575 | 575 | } |
| 576 | 576 | else |
| 577 | 577 | { |
| r1591 | r1592 | |
| 593 | 593 | I do it here because this port (0x80) is first one accessed |
| 594 | 594 | in the interrupt routine. |
| 595 | 595 | */ |
| 596 | cpunum_set_input_line(2, 0, CLEAR_LINE ); | |
| 596 | cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE ); | |
| 597 | 597 | return; |
| 598 | 598 | } |
| 599 | 599 | |
| r1591 | r1592 | |
| 936 | 936 | MDRV_CPU_PROGRAM_MAP(tubep_sound_map,0) |
| 937 | 937 | MDRV_CPU_IO_MAP(tubep_sound_portmap,0) |
| 938 | 938 | |
| 939 | MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000 | |
| 939 | MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000 | |
| 940 | 940 | MDRV_CPU_PROGRAM_MAP(nsc_map,0) |
| 941 | 941 | |
| 942 | 942 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
| 980 | 980 | |
| 981 | 981 | MDRV_CPU_REMOVE("nsc") |
| 982 | 982 | |
| 983 | MDRV_CPU_ADD(M6802,6000000 | |
| 983 | MDRV_CPU_ADD(M6802,6000000 | |
| 984 | 984 | MDRV_CPU_PROGRAM_MAP(nsc_map,0) |
| 985 | 985 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) |
| 986 | 986 | MACHINE_DRIVER_END |
| r1591 | r1592 | |
| 1002 | 1002 | MDRV_CPU_PROGRAM_MAP(rjammer_sound_map,0) |
| 1003 | 1003 | MDRV_CPU_IO_MAP(rjammer_sound_portmap,0) |
| 1004 | 1004 | |
| 1005 | MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000 | |
| 1005 | MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000 | |
| 1006 | 1006 | MDRV_CPU_PROGRAM_MAP(nsc_map,0) |
| 1007 | 1007 | |
| 1008 | 1008 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1591 | r1592 | |
|---|---|---|
| 233 | 233 | static INTERRUPT_GEN( homedata_irq ) |
| 234 | 234 | { |
| 235 | 235 | vblank = 1; |
| 236 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 236 | cpunum_set_input_line(machine, 0,M6809_FIRQ_LINE,HOLD_LINE); | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | static INTERRUPT_GEN( upd7807_irq ) |
| 240 | 240 | { |
| 241 | cpunum_set_input_line(1,UPD7810_INTF1,HOLD_LINE); | |
| 241 | cpunum_set_input_line(machine, 1,UPD7810_INTF1,HOLD_LINE); | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | |
| r1591 | r1592 | |
| 326 | 326 | static WRITE8_HANDLER( mrokumei_sound_cmd_w ) |
| 327 | 327 | { |
| 328 | 328 | soundlatch_w(offset,data); |
| 329 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 329 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | case 0x40: |
| 50 | 50 | xxmissio_status &= ~0x08; |
| 51 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0x10); | |
| 51 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0x10); | |
| 52 | 52 | break; |
| 53 | 53 | |
| 54 | 54 | case 0x80: |
| r1591 | r1592 | |
| 71 | 71 | |
| 72 | 72 | case 0x80: |
| 73 | 73 | xxmissio_status &= ~0x04; |
| 74 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0x10); | |
| 74 | cpunum_set_input_line_and_vector(Machine, 0,0,HOLD_LINE,0x10); | |
| 75 | 75 | break; |
| 76 | 76 | } |
| 77 | 77 | } |
| r1591 | r1592 | |
| 79 | 79 | static INTERRUPT_GEN( xxmissio_interrupt_m ) |
| 80 | 80 | { |
| 81 | 81 | xxmissio_status &= ~0x20; |
| 82 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 82 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static INTERRUPT_GEN( xxmissio_interrupt_s ) |
| 86 | 86 | { |
| 87 | 87 | xxmissio_status &= ~0x10; |
| 88 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 88 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static MACHINE_START( xxmissio ) |
| r1591 | r1592 | |
|---|---|---|
| 62 | 62 | { |
| 63 | 63 | case 1: |
| 64 | 64 | soundlatch_w(1,data&0xff); |
| 65 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 65 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 66 | 66 | break; |
| 67 | 67 | |
| 68 | 68 | default: |
| r1591 | r1592 | |
| 418 | 418 | |
| 419 | 419 | static void irq_handler(int irq) |
| 420 | 420 | { |
| 421 | cpunum_set_input_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 421 | cpunum_set_input_line(Machine, 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 46 | 46 | static WRITE8_HANDLER( pcktgal_sound_w ) |
| 47 | 47 | { |
| 48 | 48 | soundlatch_w(0,data); |
| 49 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 49 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static int msm5205next; |
| r1591 | r1592 | |
| 60 | 60 | |
| 61 | 61 | toggle = 1 - toggle; |
| 62 | 62 | if (toggle) |
| 63 | cpunum_set_input_line(1,M6502_IRQ_LINE,HOLD_LINE); | |
| 63 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static WRITE8_HANDLER( pcktgal_adpcm_data_w ) |
| r1591 | r1592 | |
| 461 | 461 | |
| 462 | 462 | static DRIVER_INIT( pcktgal ) |
| 463 | 463 | { |
| 464 | driver_init_deco222(machine); | |
| 465 | driver_init_graphics(machine); | |
| 464 | DRIVER_INIT_CALL(deco222); | |
| 465 | DRIVER_INIT_CALL(graphics); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /***************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 1409 | 1409 | static DRIVER_INIT(hng64_fght) |
| 1410 | 1410 | { |
| 1411 | 1411 | no_machine_error_code=0x01010101; |
| 1412 | | |
| 1412 | DRIVER_INIT_CALL(hng64 | |
| 1413 | 1413 | } |
| 1414 | 1414 | |
| 1415 | 1415 | static DRIVER_INIT(hng64_race) |
| 1416 | 1416 | { |
| 1417 | 1417 | no_machine_error_code=0x02020202; |
| 1418 | | |
| 1418 | DRIVER_INIT_CALL(hng64 | |
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | |
| r1591 | r1592 | |
| 1429 | 1429 | |
| 1430 | 1430 | static TIMER_CALLBACK( irq_stop ) |
| 1431 | 1431 | { |
| 1432 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 1432 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 1433 | 1433 | } |
| 1434 | 1434 | |
| 1435 | 1435 | static INTERRUPT_GEN( irq_start ) |
| r1591 | r1592 | |
| 1447 | 1447 | break; |
| 1448 | 1448 | } |
| 1449 | 1449 | |
| 1450 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 1450 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 1451 | 1451 | timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop); |
| 1452 | 1452 | } |
| 1453 | 1453 | |
| r1591 | r1592 | |
| 1462 | 1462 | UINT8 *RAM = (UINT8*)hng64_soundram; |
| 1463 | 1463 | memory_set_bankptr(1,&RAM[0x1e0000]); |
| 1464 | 1464 | memory_set_bankptr(2,&RAM[0x001000]); // where.. |
| 1465 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1466 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1465 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1466 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1467 | 1467 | |
| 1468 | 1468 | |
| 1469 | 1469 | /* Comm CPU */ |
| r1591 | r1592 | |
| 1480 | 1480 | KL5C80_virtual_mem_sync(); |
| 1481 | 1481 | memory_set_opbase_handler(2, KL5C80_opbase_handler); |
| 1482 | 1482 | |
| 1483 | cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip | |
| 1484 | // cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); // hold on there pardner... | |
| 1483 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip | |
| 1484 | // cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE); // hold on there pardner... | |
| 1485 | 1485 | |
| 1486 | 1486 | |
| 1487 | 1487 |
| r1591 | r1592 | |
|---|---|---|
| 24 | 24 | static WRITE8_HANDLER( solomon_sh_command_w ) |
| 25 | 25 | { |
| 26 | 26 | soundlatch_w(offset,data); |
| 27 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 27 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /* this is checked on the title screen and when you reach certain scores in the game |
| r1591 | r1592 | |
|---|---|---|
| 279 | 279 | //logerror("%08x write soundcmd %08x (%08x)\n",activecpu_get_pc(),data,mem_mask); |
| 280 | 280 | soundlatch_word_w(0,data >> 16,0); |
| 281 | 281 | sndpending = 1; |
| 282 | cpunum_set_input_line(1,2,HOLD_LINE); | |
| 282 | cpunum_set_input_line(Machine, 1,2,HOLD_LINE); | |
| 283 | 283 | /* spin for a while to let the sound CPU read the command */ |
| 284 | 284 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); |
| 285 | 285 | } |
| r1591 | r1592 | |
| 516 | 516 | |
| 517 | 517 | /* IRQ lines 1 & 4 on the sound 68000 are definitely triggered by the ES5506, |
| 518 | 518 | but I haven't noticed the ES5506 ever assert the line - maybe only used when developing the game? */ |
| 519 | // cpunum_set_input_line(1,1,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 519 | // cpunum_set_input_line(Machine, 1,1,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | static const struct ES5506interface es5506_interface = |
| r1591 | r1592 | |
|---|---|---|
| 290 | 290 | static void gladiator_ym_irq(int irq) |
| 291 | 291 | { |
| 292 | 292 | /* NMI IRQ is not used by gladiator sound program */ |
| 293 | cpunum_set_input_line(1, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 293 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /*Sound Functions*/ |
| r1591 | r1592 | |
| 309 | 309 | static WRITE8_HANDLER( glad_cpu_sound_command_w ) |
| 310 | 310 | { |
| 311 | 311 | soundlatch_w(0,data); |
| 312 | cpunum_set_input_line(2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 312 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static READ8_HANDLER( glad_cpu_sound_command_r ) |
| 316 | 316 | { |
| 317 | cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 317 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 318 | 318 | return soundlatch_r(0); |
| 319 | 319 | } |
| 320 | 320 | |
| r1591 | r1592 | |
| 328 | 328 | /* !!!!! patch to IRQ timming for 2nd CPU !!!!! */ |
| 329 | 329 | static WRITE8_HANDLER( gladiatr_irq_patch_w ) |
| 330 | 330 | { |
| 331 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 331 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 332 | 332 | } |
| 333 | 333 | #endif |
| 334 | 334 |
| r1591 | r1592 | |
|---|---|---|
| 112 | 112 | } |
| 113 | 113 | static READ8_HANDLER( trigger_slave_nmi_r ) |
| 114 | 114 | { |
| 115 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 115 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 116 | 116 | return 0; |
| 117 | 117 | } |
| 118 | 118 | |
| r1591 | r1592 | |
| 365 | 365 | memcpy( &slave_workram[0x80], mComData, mComCount ); |
| 366 | 366 | mComCount = 0; |
| 367 | 367 | #endif |
| 368 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 368 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 369 | 369 | } |
| 370 | 370 | else |
| 371 | 371 | { |
| r1591 | r1592 | |
| 386 | 386 | { |
| 387 | 387 | oldsteer = (oldsteer+1)&0xf; |
| 388 | 388 | } |
| 389 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 389 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | } /* master_interrupt */ |
| r1591 | r1592 | |
|---|---|---|
| 237 | 237 | MDRV_MACHINE_RESET( snes ) |
| 238 | 238 | |
| 239 | 239 | /* video hardware */ |
| 240 | MDRV_VIDEO_START( generic_bitmapped ) | |
| 241 | 240 | MDRV_VIDEO_UPDATE( snes ) |
| 242 | 241 | |
| 243 | 242 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| r1591 | r1592 | |
| 266 | 265 | { |
| 267 | 266 | memory_region(REGION_USER3)[i]=BITSWAP8(memory_region(REGION_USER3)[i],5,0,6,1,7,4,3,2 ); |
| 268 | 267 | } |
| 269 | | |
| 268 | DRIVER_INIT_CALL(snes_hirom | |
| 270 | 269 | } |
| 271 | 270 | |
| 272 | 271 | ROM_START( kinstb ) |
| r1591 | r1592 | |
|---|---|---|
| 168 | 168 | static TIMER_CALLBACK( dmaend_callback ) |
| 169 | 169 | { |
| 170 | 170 | if (cur_control2 & 0x800) |
| 171 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 171 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | static INTERRUPT_GEN(moo_interrupt) |
| r1591 | r1592 | |
| 183 | 183 | |
| 184 | 184 | // trigger V-blank interrupt |
| 185 | 185 | if (cur_control2 & 0x20) |
| 186 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 186 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | static INTERRUPT_GEN(moobl_interrupt) |
| r1591 | r1592 | |
| 194 | 194 | timer_set(ATTOTIME_IN_USEC(MOO_DMADELAY), NULL, 0, dmaend_callback); |
| 195 | 195 | |
| 196 | 196 | // trigger V-blank interrupt |
| 197 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 197 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | static WRITE16_HANDLER( sound_cmd1_w ) |
| r1591 | r1592 | |
| 214 | 214 | |
| 215 | 215 | static WRITE16_HANDLER( sound_irq_w ) |
| 216 | 216 | { |
| 217 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 217 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | static READ16_HANDLER( sound_status_r ) |
| r1591 | r1592 | |
|---|---|---|
| 414 | 414 | static READ8_HANDLER( iremm10_a700_r ) |
| 415 | 415 | { |
| 416 | 416 | //printf("rd:%d\n",video_screen_get_vpos(0)); |
| 417 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 417 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 418 | 418 | return 0x00; |
| 419 | 419 | } |
| 420 | 420 | |
| r1591 | r1592 | |
| 434 | 434 | { |
| 435 | 435 | if (param==0) |
| 436 | 436 | { |
| 437 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 437 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 438 | 438 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+16, 0), NULL, 1,skychut_callback); |
| 439 | 439 | } |
| 440 | 440 | if (param==1) |
| 441 | 441 | { |
| 442 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 442 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 443 | 443 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+24, 0), NULL, 2,skychut_callback); |
| 444 | 444 | } |
| 445 | 445 | if (param==-1) |
| 446 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 446 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 447 | 447 | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | static INTERRUPT_GEN( iremm11_interrupt ) |
| 451 | 451 | { |
| 452 | 452 | if (readinputport(2) & 1) /* Left Coin */ |
| 453 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 453 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 454 | 454 | else |
| 455 | 455 | { |
| 456 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 456 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 457 | 457 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBEND, 0), NULL, -1,skychut_callback); |
| 458 | 458 | } |
| 459 | 459 | } |
| r1591 | r1592 | |
| 461 | 461 | static INTERRUPT_GEN( iremm10_interrupt ) |
| 462 | 462 | { |
| 463 | 463 | if (readinputport(2) & 1) /* Left Coin */ |
| 464 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 464 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 465 | 465 | else |
| 466 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 466 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | static INTERRUPT_GEN( iremm15_interrupt ) |
| 470 | 470 | { |
| 471 | 471 | if (readinputport(2) & 1) /* Left Coin */ |
| 472 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 472 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 473 | 473 | else |
| 474 | 474 | { |
| 475 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 475 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 476 | 476 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+1, 80), NULL, -1,skychut_callback); |
| 477 | 477 | } |
| 478 | 478 | } |
| r1591 | r1592 | |
| 777 | 777 | MDRV_COLORTABLE_LENGTH(2*8) |
| 778 | 778 | |
| 779 | 779 | MDRV_PALETTE_INIT(skychut) |
| 780 | //MDRV_VIDEO_START(generic) | |
| 781 | 780 | MDRV_VIDEO_START(iremm10) |
| 782 | 781 | MDRV_VIDEO_UPDATE(iremm10) |
| 783 | 782 |
| r1591 | r1592 | |
|---|---|---|
| 272 | 272 | if (cpu_getiloops() == 1 && (irq_enable & 1)) |
| 273 | 273 | { |
| 274 | 274 | last_irq_level = 0; |
| 275 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 275 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 276 | 276 | } |
| 277 | 277 | else if (cpu_getiloops() == 2 && (irq_enable & 2)) |
| 278 | 278 | { |
| 279 | 279 | last_irq_level = 1; |
| 280 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 280 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 281 | 281 | } |
| 282 | 282 | else if (cpu_getiloops() == 0 && (irq_enable & 4)) |
| 283 | 283 | { |
| 284 | 284 | last_irq_level = 2; |
| 285 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 285 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| r1591 | r1592 | |
| 304 | 304 | |
| 305 | 305 | // fix Plotting test mode |
| 306 | 306 | if ((irq_enable & (1 << last_irq_level)) == 0) |
| 307 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 307 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | static READ8_HANDLER( irq_enable_r ) |
| r1591 | r1592 | |
| 1023 | 1023 | static WRITE8_HANDLER (evilston_snd_w) |
| 1024 | 1024 | { |
| 1025 | 1025 | shared_ram[0x7fe]=data&0x7f; |
| 1026 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 1026 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | 1029 | |
| r1591 | r1592 | |
| 2221 | 2221 | |
| 2222 | 2222 | static void irqhandler(int irq) |
| 2223 | 2223 | { |
| 2224 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2224 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | 2227 | static WRITE8_HANDLER( portA_w ) |
| r1591 | r1592 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | static TIMER_CALLBACK( groundfx_interrupt5 ) |
| 109 | 109 | { |
| 110 | cpunum_set_input_line(0,5,HOLD_LINE); //from 5... ADC port | |
| 110 | cpunum_set_input_line(machine, 0,5,HOLD_LINE); //from 5... ADC port | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r1591 | r1592 | |
| 400 | 400 | static INTERRUPT_GEN( groundfx_interrupt ) |
| 401 | 401 | { |
| 402 | 402 | frame_counter^=1; |
| 403 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 403 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | static MACHINE_DRIVER_START( groundfx ) |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | if (cpu_getiloops() == 0) |
| 30 | 30 | { |
| 31 | 31 | if (K007121_ctrlram[0][0x07] & 0x02) |
| 32 | cpunum_set_input_line(0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 32 | cpunum_set_input_line(machine, 0, HD6309_IRQ_LINE, HOLD_LINE); | |
| 33 | 33 | } |
| 34 | 34 | else if (cpu_getiloops() % 2) |
| 35 | 35 | { |
| 36 | 36 | if (K007121_ctrlram[0][0x07] & 0x01) |
| 37 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 37 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| r1591 | r1592 | |
| 276 | 276 | static MACHINE_DRIVER_START( fastlane ) |
| 277 | 277 | |
| 278 | 278 | /* basic machine hardware */ |
| 279 | MDRV_CPU_ADD(HD6309, 3000000) /* 24MHz/8? */ | |
| 279 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 24MHz/8? */ | |
| 280 | 280 | MDRV_CPU_PROGRAM_MAP(fastlane_readmem,fastlane_writemem) |
| 281 | 281 | MDRV_CPU_VBLANK_INT(fastlane_interrupt,16) /* 1 IRQ + ??? NMI (generated by the 007121) */ |
| 282 | 282 |
| r1591 | r1592 | |
|---|---|---|
| 486 | 486 | |
| 487 | 487 | static void set_gate_a20(int a20) |
| 488 | 488 | { |
| 489 | cpunum_set_input_line(0, INPUT_LINE_A20, a20); | |
| 489 | cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20); | |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | static void keyboard_interrupt(int state) |
| r1591 | r1592 | |
|---|---|---|
| 142 | 142 | /* the copy protection. */ |
| 143 | 143 | /* Anyway, what I do here is just immediately generate the NMI, so the game */ |
| 144 | 144 | /* properly starts. */ |
| 145 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 145 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 |
| r1591 | r1592 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | static WRITE16_HANDLER( cabalbl_sound_irq_trigger_word_w ) |
| 115 | 115 | { |
| 116 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 116 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| r1591 | r1592 | |
| 515 | 515 | |
| 516 | 516 | static void irqhandler(int irq) |
| 517 | 517 | { |
| 518 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 518 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | static const struct YM2151interface cabalbl_ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 456 | 456 | switch (scanline) |
| 457 | 457 | { |
| 458 | 458 | case CDP1869_SCANLINE_PREDISPLAY_START_PAL: |
| 459 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 459 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 460 | 460 | cdp1869_prd = 1; // inverted |
| 461 | 461 | break; |
| 462 | 462 | |
| 463 | 463 | case CDP1869_SCANLINE_PREDISPLAY_END_PAL: |
| 464 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 464 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 465 | 465 | cdp1869_prd = 0; // inverted |
| 466 | 466 | break; |
| 467 | 467 | } |
| r1591 | r1592 | |
| 503 | 503 | |
| 504 | 504 | static MACHINE_RESET( destryer ) |
| 505 | 505 | { |
| 506 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 506 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /* Machine Drivers */ |
| r1591 | r1592 | |
|---|---|---|
| 56 | 56 | static TIMER_CALLBACK( trigger_gun_interrupt ) |
| 57 | 57 | { |
| 58 | 58 | /* fire the IRQ at the correct moment */ |
| 59 | cpunum_set_input_line(0, param, ASSERT_LINE); | |
| 59 | cpunum_set_input_line(machine, 0, param, ASSERT_LINE); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | static TIMER_CALLBACK( clear_gun_interrupt ) |
| 64 | 64 | { |
| 65 | 65 | /* clear the IRQ on the next scanline? */ |
| 66 | cpunum_set_input_line(0, param, CLEAR_LINE); | |
| 66 | cpunum_set_input_line(machine, 0, param, CLEAR_LINE); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 |
| r1591 | r1592 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | static INTERRUPT_GEN( hotblocks_irq ) /* right? */ |
| 175 | 175 | { |
| 176 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 176 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | static const struct AY8910interface ay8910_interface = |
| r1591 | r1592 | |
|---|---|---|
| 32 | 32 | static WRITE8_HANDLER( suprloco_soundport_w ) |
| 33 | 33 | { |
| 34 | 34 | soundlatch_w(0,data); |
| 35 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 35 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 36 | 36 | /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */ |
| 37 | 37 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); |
| 38 | 38 | } |
| r1591 | r1592 | |
|---|---|---|
| 243 | 243 | if (scanline == m92_raster_irq_position) |
| 244 | 244 | { |
| 245 | 245 | video_screen_update_partial(0, scanline); |
| 246 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_2); | |
| 246 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M92_IRQ_2); | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /* VBLANK interrupt */ |
| 250 | 250 | else if (scanline == machine->screen[0].visarea.max_y + 1) |
| 251 | 251 | { |
| 252 | 252 | video_screen_update_partial(0, scanline); |
| 253 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_0); | |
| 253 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M92_IRQ_0); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /* adjust for next scanline */ |
| r1591 | r1592 | |
| 323 | 323 | cpunum_set_input_line_vector(1, 0, 0x19); |
| 324 | 324 | |
| 325 | 325 | if (irqvector == 0) /* no IRQs pending */ |
| 326 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 326 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 327 | 327 | else /* IRQ pending */ |
| 328 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 328 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | static WRITE16_HANDLER( m92_soundlatch_w ) |
| r1591 | r1592 | |
| 353 | 353 | static WRITE16_HANDLER( m92_sound_status_w ) |
| 354 | 354 | { |
| 355 | 355 | COMBINE_DATA(&sound_status); |
| 356 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_3); | |
| 356 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, M92_IRQ_3); | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | /*****************************************************************************/ |
| r1591 | r1592 | |
| 947 | 947 | |
| 948 | 948 | void m92_sprite_interrupt(void) |
| 949 | 949 | { |
| 950 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_1); | |
| 950 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, M92_IRQ_1); | |
| 951 | 951 | } |
| 952 | 952 | |
| 953 | 953 | static MACHINE_DRIVER_START( m92 ) |
| r1591 | r1592 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | snk_sound_busy_bit = 0x20; |
| 118 | 118 | soundlatch_w(0, data); |
| 119 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); | |
| 119 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /**************************************************************************/ |
| r1591 | r1592 | |
| 566 | 566 | { |
| 567 | 567 | snk_sound_busy_bit = 0x20; |
| 568 | 568 | soundlatch_w(0, data); |
| 569 | cpunum_set_input_line( 2, 0, HOLD_LINE ); | |
| 569 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE ); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | static INTERRUPT_GEN( hal21_sound_interrupt ) |
| r1591 | r1592 | |
|---|---|---|
| 204 | 204 | { |
| 205 | 205 | if ( select & 1 ) |
| 206 | 206 | { |
| 207 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, paletteram_r ); | |
| 208 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w ); | |
| 209 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r ); | |
| 210 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_w ); | |
| 207 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, MRA8_BANK4, paletteram_xBBBBBGGGGGRRRRR_be_w ); | |
| 208 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r, K053247_w ); | |
| 209 | memory_set_bankptr(4, paletteram); | |
| 211 | 210 | } |
| 212 | 211 | else |
| 213 | 212 | { |
| 214 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r ); | |
| 215 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_w ); | |
| 216 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r ); | |
| 217 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_w ); | |
| 213 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r, vendetta_K052109_w ); | |
| 214 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r, K052109_w ); | |
| 218 | 215 | } |
| 219 | 216 | } |
| 220 | 217 | |
| r1591 | r1592 | |
| 237 | 234 | |
| 238 | 235 | static TIMER_CALLBACK( z80_nmi_callback ) |
| 239 | 236 | { |
| 240 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE ); | |
| 237 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE ); | |
| 241 | 238 | } |
| 242 | 239 | |
| 243 | 240 | static WRITE8_HANDLER( z80_arm_nmi_w ) |
| 244 | 241 | { |
| 245 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 242 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 246 | 243 | |
| 247 | 244 | timer_set( ATTOTIME_IN_USEC( 25 ), NULL, 0, z80_nmi_callback ); |
| 248 | 245 | } |
| 249 | 246 | |
| 250 | 247 | static WRITE8_HANDLER( z80_irq_w ) |
| 251 | 248 | { |
| 252 | cpunum_set_input_line_and_vector( 1, 0, HOLD_LINE, 0xff ); | |
| 249 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff ); | |
| 253 | 250 | } |
| 254 | 251 | |
| 255 | 252 | static READ8_HANDLER( vendetta_sound_interrupt_r ) |
| 256 | 253 | { |
| 257 | cpunum_set_input_line_and_vector( 1, 0, HOLD_LINE, 0xff ); | |
| 254 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff ); | |
| 258 | 255 | return 0x00; |
| 259 | 256 | } |
| 260 | 257 | |
| r1591 | r1592 | |
| 574 | 571 | static INTERRUPT_GEN( vendetta_irq ) |
| 575 | 572 | { |
| 576 | 573 | if (irq_enabled) |
| 577 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 574 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 578 | 575 | } |
| 579 | 576 | |
| 580 | 577 | static MACHINE_DRIVER_START( vendetta ) |
| r1591 | r1592 | |
|---|---|---|
| 299 | 299 | { |
| 300 | 300 | /* Exerion triggers NMIs on coin insertion */ |
| 301 | 301 | if (readinputport(4) & 1) |
| 302 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 302 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /************************************* |
| r1591 | r1592 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | if (destroyr_potmask[dial]) |
| 39 | 39 | { |
| 40 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 40 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| r1591 | r1592 | |
| 86 | 86 | |
| 87 | 87 | static WRITE8_HANDLER( destroyr_interrupt_ack_w ) |
| 88 | 88 | { |
| 89 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 89 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 |
| r1591 | r1592 | |
|---|---|---|
| 916 | 916 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, MRA16_BANK12, segaic16_textram_0_w, &segaic16_textram_0, "text RAM" }, |
| 917 | 917 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, MRA16_BANK13, MWA16_BANK13, &segaic16_spriteram_0, "object RAM" }, |
| 918 | 918 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 919 | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x20000, MRA16_BANK15, MWA16_ROM, NULL, "ROM 2" }, | |
| 920 | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x10000, MRA16_BANK16, MWA16_ROM, NULL, "ROM 1" }, | |
| 921 | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, MRA16_BANK17, MWA16_ROM, NULL, "ROM 0" }, | |
| 919 | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x20000, MRA16_BANK15, MWA16_UNMAP, NULL, "ROM 2" }, | |
| 920 | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x10000, MRA16_BANK16, MWA16_UNMAP, NULL, "ROM 1" }, | |
| 921 | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, MRA16_BANK17, MWA16_UNMAP, NULL, "ROM 0" }, | |
| 922 | 922 | { 0 } |
| 923 | 923 | }; |
| 924 | 924 | |
| r1591 | r1592 | |
| 930 | 930 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, MRA16_BANK12, segaic16_textram_0_w, &segaic16_textram_0, "text RAM" }, |
| 931 | 931 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, MRA16_BANK13, MWA16_BANK13, &segaic16_spriteram_0, "object RAM" }, |
| 932 | 932 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 933 | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x40000, MRA16_BANK15, MWA16_ROM, NULL, "ROM 2" }, | |
| 934 | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x20000, MRA16_BANK16, MWA16_ROM, NULL, "ROM 1" }, | |
| 935 | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, MRA16_BANK17, MWA16_ROM, NULL, "ROM 0" }, | |
| 933 | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x40000, MRA16_BANK15, MWA16_UNMAP, NULL, "ROM 2" }, | |
| 934 | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x20000, MRA16_BANK16, MWA16_UNMAP, NULL, "ROM 1" }, | |
| 935 | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, MRA16_BANK17, MWA16_UNMAP, NULL, "ROM 0" }, | |
| 936 | 936 | { 0 } |
| 937 | 937 | }; |
| 938 | 938 | |
| r1591 | r1592 | |
| 945 | 945 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, MRA16_BANK13, MWA16_BANK13, &segaic16_spriteram_0, "object RAM" }, |
| 946 | 946 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 947 | 947 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, rom_5704_bank_w, NULL, "tile bank" }, |
| 948 | { 0x25/2, 0x00000, 0x80000, 0xfc0000, 0x80000, MRA16_BANK16, MWA16_ROM, NULL, "ROM 1" }, | |
| 949 | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, MRA16_BANK17, MWA16_ROM, NULL, "ROM 0" }, | |
| 948 | { 0x25/2, 0x00000, 0x80000, 0xfc0000, 0x80000, MRA16_BANK16, MWA16_UNMAP, NULL, "ROM 1" }, | |
| 949 | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, MRA16_BANK17, MWA16_UNMAP, NULL, "ROM 0" }, | |
| 950 | 950 | { 0 } |
| 951 | 951 | }; |
| 952 | 952 | |
| r1591 | r1592 | |
| 960 | 960 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 961 | 961 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, rom_5704_bank_w, NULL, "tile bank" }, |
| 962 | 962 | { 0x25/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, atomicp_sound_w, NULL, "sound" }, |
| 963 | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, MRA16_BANK17, MWA16_ | |
| 963 | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, MRA16_BANK17, MWA16_UNMAP, | |
| 964 | 964 | { 0 } |
| 965 | 965 | }; |
| 966 | 966 | |
| r1591 | r1592 | |
| 974 | 974 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 975 | 975 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, unknown_rgn2_r, unknown_rgn2_w, NULL, "???" }, |
| 976 | 976 | { 0x25/2, 0x00000, 0x04000, 0xffc000, ~0, rom_5797_bank_math_r, rom_5797_bank_math_w, NULL, "tile bank/math" }, |
| 977 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17, MWA16_ | |
| 977 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17, MWA16_UNMAP, | |
| 978 | 978 | { 0 } |
| 979 | 979 | }; |
| 980 | 980 | |
| r1591 | r1592 | |
| 1000 | 1000 | if (has_sound_cpu) |
| 1001 | 1001 | { |
| 1002 | 1002 | soundlatch_w(0, data & 0xff); |
| 1003 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 1003 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 1004 | 1004 | } |
| 1005 | 1005 | } |
| 1006 | 1006 | |
| r1591 | r1592 | |
| 1073 | 1073 | |
| 1074 | 1074 | static TIMER_CALLBACK( atomicp_sound_irq ) |
| 1075 | 1075 | { |
| 1076 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 1076 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | |
| 1080 | 1080 | static MACHINE_RESET( atomicp ) |
| 1081 | 1081 | { |
| 1082 | | |
| 1082 | MACHINE_RESET_CALL(system16b | |
| 1083 | 1083 | timer_pulse(ATTOTIME_IN_HZ(atomicp_sound_rate), NULL, 0, atomicp_sound_irq); |
| 1084 | 1084 | } |
| 1085 | 1085 | |
| r1591 | r1592 | |
| 1303 | 1303 | static void upd7759_generate_nmi(int state) |
| 1304 | 1304 | { |
| 1305 | 1305 | if (state) |
| 1306 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1306 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1307 | 1307 | } |
| 1308 | 1308 | |
| 1309 | 1309 | |
| r1591 | r1592 | |
| 1311 | 1311 | static WRITE8_HANDLER( mcu_data_w ) |
| 1312 | 1312 | { |
| 1313 | 1313 | mcu_data = data; |
| 1314 | cpunum_set_input_line(2, 1, PULSE_LINE); | |
| 1314 | cpunum_set_input_line(Machine, 2, 1, PULSE_LINE); | |
| 1315 | 1315 | } |
| 1316 | 1316 | #endif |
| 1317 | 1317 | |
| r1591 | r1592 | |
| 1342 | 1342 | UINT16 temp; |
| 1343 | 1343 | |
| 1344 | 1344 | /* signal a VBLANK to the main CPU */ |
| 1345 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1345 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 1346 | 1346 | |
| 1347 | 1347 | /* set tile banks */ |
| 1348 | 1348 | rom_5704_bank_w(1, workram[0x3094/2] & 0x00ff, 0xff00); |
| r1591 | r1592 | |
| 1380 | 1380 | UINT16 temp; |
| 1381 | 1381 | |
| 1382 | 1382 | /* signal a VBLANK to the main CPU */ |
| 1383 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1383 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 1384 | 1384 | |
| 1385 | 1385 | /* process any new sound data */ |
| 1386 | 1386 | temp = workram[0x0bd0/2]; |
| r1591 | r1592 | |
| 1415 | 1415 | UINT16 temp; |
| 1416 | 1416 | |
| 1417 | 1417 | /* signal a VBLANK to the main CPU */ |
| 1418 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1418 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 1419 | 1419 | |
| 1420 | 1420 | /* they periodically clear the data at 2cd8,2cda,2cdc,2cde and expect the MCU to fill it in */ |
| 1421 | 1421 | if (workram[0x2cd8/2] == 0 && workram[0x2cda/2] == 0 && workram[0x2cdc/2] == 0 && workram[0x2cde/2] == 0) |
| r1591 | r1592 | |
| 1445 | 1445 | UINT16 temp; |
| 1446 | 1446 | |
| 1447 | 1447 | /* signal a VBLANK to the main CPU */ |
| 1448 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1448 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 1449 | 1449 | |
| 1450 | 1450 | /* process any new sound data */ |
| 1451 | 1451 | temp = workram[0x01d0/2]; |
| r1591 | r1592 | |
| 1467 | 1467 | UINT16 temp; |
| 1468 | 1468 | |
| 1469 | 1469 | /* signal a VBLANK to the main CPU */ |
| 1470 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1470 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 1471 | 1471 | |
| 1472 | 1472 | /* process any new sound data */ |
| 1473 | 1473 | temp = workram[0x0008/2]; |
| r1591 | r1592 | |
| 1484 | 1484 | UINT16 temp; |
| 1485 | 1485 | |
| 1486 | 1486 | /* signal a VBLANK to the main CPU */ |
| 1487 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 1487 | cpunum_set_input_line(Machine, 0, 4, HOLD_LINE); | |
| 1488 | 1488 | |
| 1489 | 1489 | /* process any new sound data */ |
| 1490 | 1490 | temp = workram[0x208e/2]; |
| r1591 | r1592 | |
| 5994 | 5994 | static DRIVER_INIT( aliensy3_5358 ) |
| 5995 | 5995 | { |
| 5996 | 5996 | void fd1089_decrypt_0033(void); |
| 5997 | | |
| 5997 | DRIVER_INIT_CALL(generic_5358 | |
| 5998 | 5998 | fd1089_decrypt_0033(); |
| 5999 | 5999 | } |
| 6000 | 6000 | |
| 6001 | 6001 | |
| 6002 | 6002 | static DRIVER_INIT( altbeast_5521 ) |
| 6003 | 6003 | { |
| 6004 | | |
| 6004 | DRIVER_INIT_CALL(generic_5521 | |
| 6005 | 6005 | i8751_vblank_hook = altbeast_i8751_sim; |
| 6006 | 6006 | } |
| 6007 | 6007 | |
| 6008 | 6008 | |
| 6009 | 6009 | static DRIVER_INIT( altbeasj_5521 ) |
| 6010 | 6010 | { |
| 6011 | | |
| 6011 | DRIVER_INIT_CALL(generic_5521 | |
| 6012 | 6012 | i8751_vblank_hook = altbeasj_i8751_sim; |
| 6013 | 6013 | } |
| 6014 | 6014 | |
| 6015 | 6015 | |
| 6016 | 6016 | static DRIVER_INIT( altbeas5_5521 ) |
| 6017 | 6017 | { |
| 6018 | | |
| 6018 | DRIVER_INIT_CALL(generic_5521 | |
| 6019 | 6019 | i8751_vblank_hook = altbeas5_i8751_sim; |
| 6020 | 6020 | } |
| 6021 | 6021 | |
| 6022 | 6022 | |
| 6023 | 6023 | static DRIVER_INIT( altbeas4_5521 ) |
| 6024 | 6024 | { |
| 6025 | | |
| 6025 | DRIVER_INIT_CALL(generic_5521 | |
| 6026 | 6026 | mc8123_decrypt_rom(1, memory_region(REGION_USER2), 0, 0); |
| 6027 | 6027 | } |
| 6028 | 6028 | |
| r1591 | r1592 | |
| 6030 | 6030 | static DRIVER_INIT( aurail1_5704 ) |
| 6031 | 6031 | { |
| 6032 | 6032 | void fd1089_decrypt_0168(void); |
| 6033 | | |
| 6033 | DRIVER_INIT_CALL(generic_5704 | |
| 6034 | 6034 | fd1089_decrypt_0168(); |
| 6035 | 6035 | } |
| 6036 | 6036 | |
| r1591 | r1592 | |
| 6038 | 6038 | static DRIVER_INIT( aurailj_5704 ) |
| 6039 | 6039 | { |
| 6040 | 6040 | void fd1089_decrypt_0167(void); |
| 6041 | | |
| 6041 | DRIVER_INIT_CALL(generic_5704 | |
| 6042 | 6042 | fd1089_decrypt_0167(); |
| 6043 | 6043 | } |
| 6044 | 6044 | |
| 6045 | 6045 | |
| 6046 | 6046 | static DRIVER_INIT( ddux_5704 ) |
| 6047 | 6047 | { |
| 6048 | | |
| 6048 | DRIVER_INIT_CALL(generic_5704 | |
| 6049 | 6049 | i8751_vblank_hook = ddux_i8751_sim; |
| 6050 | 6050 | } |
| 6051 | 6051 | |
| r1591 | r1592 | |
| 6053 | 6053 | static DRIVER_INIT( dunkshot_5358 ) |
| 6054 | 6054 | { |
| 6055 | 6055 | void fd1089_decrypt_0022(void); |
| 6056 | | |
| 6056 | DRIVER_INIT_CALL(generic_5358 | |
| 6057 | 6057 | fd1089_decrypt_0022(); |
| 6058 | 6058 | custom_io_r = dunkshot_custom_io_r; |
| 6059 | 6059 | } |
| r1591 | r1592 | |
| 6061 | 6061 | |
| 6062 | 6062 | static DRIVER_INIT( exctleag_5358 ) |
| 6063 | 6063 | { |
| 6064 | | |
| 6064 | DRIVER_INIT_CALL(generic_5358 | |
| 6065 | 6065 | custom_io_r = sdi_custom_io_r; |
| 6066 | 6066 | } |
| 6067 | 6067 | |
| 6068 | 6068 | |
| 6069 | 6069 | static DRIVER_INIT( goldnaxe_5704 ) |
| 6070 | 6070 | { |
| 6071 | | |
| 6071 | DRIVER_INIT_CALL(generic_5704 | |
| 6072 | 6072 | goldnaxe_i8751_init(); |
| 6073 | 6073 | i8751_vblank_hook = goldnaxe_i8751_sim; |
| 6074 | 6074 | } |
| r1591 | r1592 | |
| 6076 | 6076 | |
| 6077 | 6077 | static DRIVER_INIT( goldnaxe_5797 ) |
| 6078 | 6078 | { |
| 6079 | | |
| 6079 | DRIVER_INIT_CALL(generic_5797 | |
| 6080 | 6080 | goldnaxe_i8751_init(); |
| 6081 | 6081 | i8751_vblank_hook = goldnaxe_i8751_sim; |
| 6082 | 6082 | } |
| r1591 | r1592 | |
| 6084 | 6084 | |
| 6085 | 6085 | static DRIVER_INIT( hwchamp_5521 ) |
| 6086 | 6086 | { |
| 6087 | | |
| 6087 | DRIVER_INIT_CALL(generic_5521 | |
| 6088 | 6088 | custom_io_r = hwchamp_custom_io_r; |
| 6089 | 6089 | custom_io_w = hwchamp_custom_io_w; |
| 6090 | 6090 | } |
| r1591 | r1592 | |
| 6092 | 6092 | |
| 6093 | 6093 | static DRIVER_INIT( sdi_5358 ) |
| 6094 | 6094 | { |
| 6095 | | |
| 6095 | DRIVER_INIT_CALL(generic_5358 | |
| 6096 | 6096 | custom_io_r = sdi_custom_io_r; |
| 6097 | 6097 | } |
| 6098 | 6098 | |
| 6099 | 6099 | static DRIVER_INIT( defense_5358 ) |
| 6100 | 6100 | { |
| 6101 | 6101 | void fd1089_decrypt_0028(void); |
| 6102 | | |
| 6102 | DRIVER_INIT_CALL(generic_5358 | |
| 6103 | 6103 | fd1089_decrypt_0028(); |
| 6104 | 6104 | custom_io_r = sdi_custom_io_r; |
| 6105 | 6105 | } |
| r1591 | r1592 | |
| 6107 | 6107 | |
| 6108 | 6108 | static DRIVER_INIT( shinobi3_5358 ) |
| 6109 | 6109 | { |
| 6110 | | |
| 6110 | DRIVER_INIT_CALL(generic_5358 | |
| 6111 | 6111 | mc8123_decrypt_rom(1, memory_region(REGION_USER2), 0, 0); |
| 6112 | 6112 | } |
| 6113 | 6113 | |
| r1591 | r1592 | |
| 6115 | 6115 | static DRIVER_INIT( sjryuko_5358 ) |
| 6116 | 6116 | { |
| 6117 | 6117 | void fd1089_decrypt_5021(void); |
| 6118 | | |
| 6118 | DRIVER_INIT_CALL(generic_5358 | |
| 6119 | 6119 | fd1089_decrypt_5021(); |
| 6120 | 6120 | custom_io_r = sjryuko_custom_io_r; |
| 6121 | 6121 | custom_io_w = sjryuko_custom_io_w; |
| r1591 | r1592 | |
| 6124 | 6124 | |
| 6125 | 6125 | static DRIVER_INIT( passshtj_5358 ) |
| 6126 | 6126 | { |
| 6127 | | |
| 6127 | DRIVER_INIT_CALL(generic_5358 | |
| 6128 | 6128 | custom_io_r = passshtj_custom_io_r; |
| 6129 | 6129 | } |
| 6130 | 6130 | |
| 6131 | 6131 | static DRIVER_INIT( tturf_5704 ) |
| 6132 | 6132 | { |
| 6133 | | |
| 6133 | DRIVER_INIT_CALL(generic_5704 | |
| 6134 | 6134 | i8751_vblank_hook = tturf_i8751_sim; |
| 6135 | 6135 | } |
| 6136 | 6136 | |
| 6137 | 6137 | |
| 6138 | 6138 | static DRIVER_INIT( tturf_5358 ) |
| 6139 | 6139 | { |
| 6140 | | |
| 6140 | DRIVER_INIT_CALL(generic_5358 | |
| 6141 | 6141 | i8751_vblank_hook = tturf_i8751_sim; |
| 6142 | 6142 | } |
| 6143 | 6143 | |
| 6144 | 6144 | |
| 6145 | 6145 | static DRIVER_INIT( wb3_5704 ) |
| 6146 | 6146 | { |
| 6147 | | |
| 6147 | DRIVER_INIT_CALL(generic_5704 | |
| 6148 | 6148 | i8751_vblank_hook = wb3_i8751_sim; |
| 6149 | 6149 | } |
| 6150 | 6150 | |
| 6151 | 6151 | |
| 6152 | 6152 | static DRIVER_INIT( wrestwar_8751 ) |
| 6153 | 6153 | { |
| 6154 | | |
| 6154 | DRIVER_INIT_CALL(generic_5704 | |
| 6155 | 6155 | i8751_vblank_hook = wrestwar_i8751_sim; |
| 6156 | 6156 | } |
| 6157 | 6157 |
| r1591 | r1592 | |
|---|---|---|
| 199 | 199 | static WRITE16_HANDLER ( wwfwfest_soundwrite ) |
| 200 | 200 | { |
| 201 | 201 | soundlatch_w(1,data & 0xff); |
| 202 | cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 202 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /******************************************************************************* |
| r1591 | r1592 | |
| 369 | 369 | |
| 370 | 370 | static INTERRUPT_GEN( wwfwfest_interrupt ) { |
| 371 | 371 | if( cpu_getiloops() == 0 ) |
| 372 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 372 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 373 | 373 | else |
| 374 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 374 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | /******************************************************************************* |
| r1591 | r1592 | |
| 382 | 382 | |
| 383 | 383 | static void dd3_ymirq_handler(int irq) |
| 384 | 384 | { |
| 385 | cpunum_set_input_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 385 | cpunum_set_input_line(Machine, 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 43 | 43 | static MACHINE_RESET( marineb ) |
| 44 | 44 | { |
| 45 | 45 | marineb_active_low_flipscreen = 0; |
| 46 | | |
| 46 | MACHINE_RESET_CALL(espial | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static MACHINE_RESET( springer ) |
| 50 | 50 | { |
| 51 | 51 | marineb_active_low_flipscreen = 1; |
| 52 | | |
| 52 | MACHINE_RESET_CALL(espial | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static ADDRESS_MAP_START( marineb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
|---|---|---|
| 224 | 224 | |
| 225 | 225 | static void ppu_irq( int num, int *ppu_regs ) |
| 226 | 226 | { |
| 227 | cpunum_set_input_line(num, INPUT_LINE_NMI, PULSE_LINE ); | |
| 227 | cpunum_set_input_line(Machine, num, INPUT_LINE_NMI, PULSE_LINE ); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /* our ppu interface */ |
| r1591 | r1592 | |
|---|---|---|
| 47 | 47 | * |
| 48 | 48 | *************************************/ |
| 49 | 49 | |
| 50 | static void update_interrupts( | |
| 50 | static void update_interrupts(running_machine *machine) | |
| 51 | 51 | { |
| 52 | 52 | int newstate = 0; |
| 53 | 53 | |
| r1591 | r1592 | |
| 57 | 57 | newstate = 5; |
| 58 | 58 | |
| 59 | 59 | if (newstate) |
| 60 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 60 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 61 | 61 | else |
| 62 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 62 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| r1591 | r1592 | |
| 144 | 144 | |
| 145 | 145 | /* lower byte */ |
| 146 | 146 | if (!(mem_mask & 0x00ff0000)) |
| 147 | cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE); | |
| 147 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 |
| r1591 | r1592 | |
|---|---|---|
| 78 | 78 | if (ACCESSING_LSB) |
| 79 | 79 | { |
| 80 | 80 | soundlatch_w(0,data & 0xff); |
| 81 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 81 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 82 | 82 | // cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other CPU to reply |
| 83 | 83 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); // Fixes glitching in rasters |
| 84 | 84 | } |
| r1591 | r1592 | |
| 499 | 499 | |
| 500 | 500 | static void soundirq(int state) |
| 501 | 501 | { |
| 502 | cpunum_set_input_line(1, 0, state); | |
| 502 | cpunum_set_input_line(Machine, 1, 0, state); | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | static const struct YM3812interface fuuki16_ym3812_intf = |
| r1591 | r1592 | |
| 521 | 521 | |
| 522 | 522 | static TIMER_CALLBACK( level_1_interrupt_callback ) |
| 523 | 523 | { |
| 524 | cpunum_set_input_line(0, 1, PULSE_LINE); | |
| 524 | cpunum_set_input_line(machine, 0, 1, PULSE_LINE); | |
| 525 | 525 | timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback); |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | |
| 529 | 529 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 530 | 530 | { |
| 531 | cpunum_set_input_line(0, 3, PULSE_LINE); // VBlank IRQ | |
| 531 | cpunum_set_input_line(machine, 0, 3, PULSE_LINE); // VBlank IRQ | |
| 532 | 532 | timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback); |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | |
| 536 | 536 | static TIMER_CALLBACK( raster_interrupt_callback ) |
| 537 | 537 | { |
| 538 | cpunum_set_input_line(0, 5, PULSE_LINE); // Raster Line IRQ | |
| 538 | cpunum_set_input_line(machine, 0, 5, PULSE_LINE); // Raster Line IRQ | |
| 539 | 539 | video_screen_update_partial(0, video_screen_get_vpos(0)); |
| 540 | 540 | timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero); |
| 541 | 541 | } |
| r1591 | r1592 | |
|---|---|---|
| 530 | 530 | |
| 531 | 531 | static void voodoo_vblank_0(int param) |
| 532 | 532 | { |
| 533 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 533 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | static VIDEO_START( nwktr ) |
| r1591 | r1592 | |
| 637 | 637 | { |
| 638 | 638 | if (data & 0x80) // CG Board 1 IRQ Ack |
| 639 | 639 | { |
| 640 | //cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 640 | //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE); | |
| 641 | 641 | } |
| 642 | 642 | if (data & 0x40) // CG Board 0 IRQ Ack |
| 643 | 643 | { |
| 644 | //cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 644 | //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | 647 | return; |
| r1591 | r1592 | |
| 765 | 765 | static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 766 | 766 | AM_RANGE(0x00000000, 0x003fffff) AM_MIRROR(0x80000000) AM_RAM AM_BASE(&work_ram) /* Work RAM */ |
| 767 | 767 | AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_reg_r, K001604_reg_w) |
| 768 | AM_RANGE(0x74010000, 0x74017fff) AM_MIRROR(0x80000000) AM_READWRITE( | |
| 768 | AM_RANGE(0x74010000, 0x74017fff) AM_MIRROR(0x80000000) AM_READWRITE(MRA | |
| 769 | 769 | AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w) |
| 770 | 770 | AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w) |
| 771 | 771 | AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc) |
| r1591 | r1592 | |
| 900 | 900 | |
| 901 | 901 | static MACHINE_RESET( nwktr ) |
| 902 | 902 | { |
| 903 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 903 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | static MACHINE_DRIVER_START( nwktr ) |
| r1591 | r1592 | |
| 971 | 971 | static void sound_irq_callback(int irq) |
| 972 | 972 | { |
| 973 | 973 | if (irq == 0) |
| 974 | { | |
| 975 | cpunum_set_input_line(1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 976 | } | |
| 974 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ1, PULSE_LINE); | |
| 977 | 975 | else |
| 978 | { | |
| 979 | cpunum_set_input_line(1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 980 | } | |
| 976 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ2, PULSE_LINE); | |
| 981 | 977 | } |
| 982 | 978 | |
| 983 | 979 | static DRIVER_INIT( nwktr ) |
| r1591 | r1592 | |
| 1029 | 1025 | backup_ram[0x0e] = (checksum >> 8) & 0xff; // checksum |
| 1030 | 1026 | backup_ram[0x0f] = (checksum >> 0) & 0xff; // checksum |
| 1031 | 1027 | |
| 1032 | | |
| 1028 | DRIVER_INIT_CALL(nwktr | |
| 1033 | 1029 | } |
| 1034 | 1030 | |
| 1035 | 1031 | static DRIVER_INIT(racingj) |
| r1591 | r1592 | |
| 1063 | 1059 | backup_ram[0x0e] = (checksum >> 8) & 0xff; // checksum |
| 1064 | 1060 | backup_ram[0x0f] = (checksum >> 0) & 0xff; // checksum |
| 1065 | 1061 | |
| 1066 | | |
| 1062 | DRIVER_INIT_CALL(nwktr | |
| 1067 | 1063 | } |
| 1068 | 1064 | |
| 1069 | 1065 | static DRIVER_INIT(racingj2) |
| r1591 | r1592 | |
| 1097 | 1093 | backup_ram[0x0e] = (checksum >> 8) & 0xff; // checksum |
| 1098 | 1094 | backup_ram[0x0f] = (checksum >> 0) & 0xff; // checksum |
| 1099 | 1095 | |
| 1100 | | |
| 1096 | DRIVER_INIT_CALL(nwktr | |
| 1101 | 1097 | } |
| 1102 | 1098 | |
| 1103 | 1099 |
| r1591 | r1592 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | static INTERRUPT_GEN( vulgus_interrupt ) |
| 61 | 61 | { |
| 62 | if (cpu_getiloops() != 0) cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 63 | else cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ | |
| 62 | if (cpu_getiloops() != 0) | |
| 63 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ | |
| 64 | else | |
| 65 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ | |
| 64 | 66 | } |
| 65 | 67 | |
| 66 | 68 |
| r1591 | r1592 | |
|---|---|---|
| 105 | 105 | if (ACCESSING_LSB) |
| 106 | 106 | { |
| 107 | 107 | soundlatch_w(0,data & 0xff); |
| 108 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); /* RST 38h */ | |
| 108 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); /* RST 38h */ | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| r1591 | r1592 | |
| 484 | 484 | |
| 485 | 485 | static void irqhandler(int linestate) |
| 486 | 486 | { |
| 487 | cpunum_set_input_line(1, INPUT_LINE_NMI, linestate); | |
| 487 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, linestate); | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | static const struct YM3438interface ym3438_interface = |
| r1591 | r1592 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | if (!(out & 0x2000) && interrupt_line_active) |
| 89 | 89 | { |
| 90 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 90 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE); | |
| 91 | 91 | interrupt_line_active = 0; |
| 92 | 92 | } |
| 93 | 93 | |
| r1591 | r1592 | |
| 211 | 211 | if (param==interrupt_scanline) |
| 212 | 212 | { |
| 213 | 213 | if (out&0x2000) |
| 214 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 214 | cpunum_set_input_line(machine, 0, 1, ASSERT_LINE); | |
| 215 | 215 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, param+1, 0), param+1, attotime_zero); |
| 216 | 216 | interrupt_line_active = 1; |
| 217 | 217 | } |
| 218 | 218 | else |
| 219 | 219 | { |
| 220 | 220 | if (interrupt_line_active) |
| 221 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 221 | cpunum_set_input_line(machine, 0, 1, CLEAR_LINE); | |
| 222 | 222 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero); |
| 223 | 223 | interrupt_line_active = 0; |
| 224 | 224 | } |
| r1591 | r1592 | |
| 261 | 261 | static void irqhandler(int irq) |
| 262 | 262 | { |
| 263 | 263 | if(out & 0x10) |
| 264 | cpunum_set_input_line(0,2,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 264 | cpunum_set_input_line(Machine, 0,2,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
|---|---|---|
| 84 | 84 | static MACHINE_RESET( vastar ) |
| 85 | 85 | { |
| 86 | 86 | /* we must start with the second CPU halted */ |
| 87 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 87 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static WRITE8_HANDLER( vastar_hold_cpu2_w ) |
| 91 | 91 | { |
| 92 | 92 | /* I'm not sure that this works exactly like this */ |
| 93 | 93 | if (data & 1) |
| 94 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 94 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 95 | 95 | else |
| 96 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 96 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | static READ8_HANDLER( vastar_sharedram_r ) |
| r1591 | r1592 | |
|---|---|---|
| 94 | 94 | { |
| 95 | 95 | pending_command = 1; |
| 96 | 96 | soundlatch_w(offset,data & 0xff); |
| 97 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 97 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | static ADDRESS_MAP_START( taotaido_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 346 | 346 | |
| 347 | 347 | static void irqhandler(int irq) |
| 348 | 348 | { |
| 349 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 349 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 42 | 42 | * |
| 43 | 43 | *************************************/ |
| 44 | 44 | |
| 45 | static void update_interrupts( | |
| 45 | static void update_interrupts(running_machine *machine) | |
| 46 | 46 | { |
| 47 | 47 | int newstate = 0; |
| 48 | 48 | |
| r1591 | r1592 | |
| 50 | 50 | newstate = 4; |
| 51 | 51 | |
| 52 | 52 | if (newstate) |
| 53 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 53 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 54 | 54 | else |
| 55 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 55 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 |
| r1591 | r1592 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | static INTERRUPT_GEN( gunpey_interrupt ) |
| 115 | 115 | { |
| 116 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0x200/4); | |
| 116 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0x200/4); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /***************************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | static WRITE32_HANDLER( f3_sound_reset_0_w ) |
| 120 | 120 | { |
| 121 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 121 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | static WRITE32_HANDLER( f3_sound_reset_1_w ) |
| 125 | 125 | { |
| 126 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 126 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | static WRITE32_HANDLER( f3_sound_bankswitch_w ) |
| r1591 | r1592 | |
| 387 | 387 | |
| 388 | 388 | static TIMER_CALLBACK( f3_interrupt3 ) |
| 389 | 389 | { |
| 390 | cpunum_set_input_line(0, 3, HOLD_LINE); // some signal from video hardware? | |
| 390 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); // some signal from video hardware? | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | static INTERRUPT_GEN( f3_interrupt2 ) |
| 394 | 394 | { |
| 395 | cpunum_set_input_line(0, 2, HOLD_LINE); // vblank | |
| 395 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); // vblank | |
| 396 | 396 | timer_set( ATTOTIME_IN_CYCLES(10000,0), NULL, 0, f3_interrupt3); |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | static MACHINE_RESET( f3 ) |
| 400 | 400 | { |
| 401 | 401 | taito_f3_soundsystem_reset(); |
| 402 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 402 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 403 | 403 | |
| 404 | 404 | f3_68681_reset(); |
| 405 | 405 | } |
| r1591 | r1592 | |
|---|---|---|
| 256 | 256 | static INTERRUPT_GEN( bang_interrupt ) |
| 257 | 257 | { |
| 258 | 258 | if (cpu_getiloops() == 0){ |
| 259 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 259 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 260 | 260 | |
| 261 | 261 | clr_gun_int = 0; |
| 262 | 262 | } |
| 263 | 263 | else if (cpu_getiloops() % 2){ |
| 264 | 264 | if (clr_gun_int){ |
| 265 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 265 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | } |
| r0 | r1592 | |
|---|---|---|
| 1 | /******************************************************************************* | |
| 2 | Ninja Kid / Ninjakun Majou no Bouken | (c) 1984 UPL / Taito | |
| 3 | ******************************************************************************** | |
| 4 | Driver by David Haywood | |
| 5 | with help from Steph and Phil Stroffolino | |
| 6 | ||
| 7 | Last Changes: 21 Jan 2008 | |
| 8 | ||
| 9 | This driver was started after interest was shown in the game by a poster at | |
| 10 | various messageboards going under the name of 'ninjakun' I decided to attempt | |
| 11 | a driver for this game to gain some experience with Z80 & Multi-processor | |
| 12 | games. | |
| 13 | ||
| 14 | Hold P1 Start after a reset to skip the startup memory tests. | |
| 15 | ||
| 16 | Change Log: | |
| 17 | 5 Mar - Added Saved State Support (DJH) | |
| 18 | 8 Jun - Added palette animation, Fixed FG priority. (Uki) | |
| 19 | 9 Jun - Fixed BG scroll handling, Fixed CPU clock. | |
| 20 | *******************************************************************************/ | |
| 21 | ||
| 22 | #include "driver.h" | |
| 23 | #include "cpu/z80/z80.h" | |
| 24 | #include "sound/ay8910.h" | |
| 25 | ||
| 26 | ||
| 27 | extern UINT8 *ninjakun_fg_videoram; | |
| 28 | extern UINT8 *ninjakun_bg_videoram; | |
| 29 | ||
| 30 | WRITE8_HANDLER( ninjakun_bg_videoram_w ); | |
| 31 | WRITE8_HANDLER( ninjakun_fg_videoram_w ); | |
| 32 | READ8_HANDLER( ninjakun_bg_videoram_r ); | |
| 33 | ||
| 34 | READ8_HANDLER( ninjakun_io_8000_r ); | |
| 35 | WRITE8_HANDLER( ninjakun_io_8000_w ); | |
| 36 | ||
| 37 | VIDEO_START( ninjakun ); | |
| 38 | VIDEO_UPDATE( ninjakun ); | |
| 39 | WRITE8_HANDLER( ninjakun_flipscreen_w ); | |
| 40 | ||
| 41 | WRITE8_HANDLER( ninjakun_paletteram_w ); | |
| 42 | ||
| 43 | ||
| 44 | /******************************************************************************* | |
| 45 | 0xA000 Read / Write Handlers | |
| 46 | *******************************************************************************/ | |
| 47 | ||
| 48 | static UINT8 ninjakun_io_a002_ctrl; | |
| 49 | ||
| 50 | static READ8_HANDLER( ninjakun_io_A002_r ) | |
| 51 | { | |
| 52 | return ninjakun_io_a002_ctrl | readinputport(2); /* vblank */ | |
| 53 | } | |
| 54 | ||
| 55 | static WRITE8_HANDLER( ninjakun_cpu1_io_A002_w ) | |
| 56 | { | |
| 57 | if( data == 0x80 ) ninjakun_io_a002_ctrl |= 0x04; | |
| 58 | if( data == 0x40 ) ninjakun_io_a002_ctrl &= ~0x08; | |
| 59 | } | |
| 60 | ||
| 61 | static WRITE8_HANDLER( ninjakun_cpu2_io_A002_w ) | |
| 62 | { | |
| 63 | if( data == 0x40 ) ninjakun_io_a002_ctrl |= 0x08; | |
| 64 | if( data == 0x80 ) ninjakun_io_a002_ctrl &= ~0x04; | |
| 65 | } | |
| 66 | ||
| 67 | /******************************************************************************* | |
| 68 | Init | |
| 69 | *******************************************************************************/ | |
| 70 | ||
| 71 | static MACHINE_START( ninjakun ) | |
| 72 | { | |
| 73 | /* Save State Stuff */ | |
| 74 | state_save_register_global(ninjakun_io_a002_ctrl); | |
| 75 | } | |
| 76 | ||
| 77 | /******************************************************************************* | |
| 78 | Memory Maps | |
| 79 | *******************************************************************************/ | |
| 80 | ||
| 81 | static ADDRESS_MAP_START( ninjakun_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 82 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 83 | AM_RANGE(0x2000, 0x7fff) AM_ROM | |
| 84 | AM_RANGE(0x8000, 0x8003) AM_READWRITE(ninjakun_io_8000_r, ninjakun_io_8000_w) | |
| 85 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) | |
| 86 | AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r) | |
| 87 | AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu1_io_A002_w) | |
| 88 | AM_RANGE(0xa003, 0xa003) AM_WRITE(ninjakun_flipscreen_w) | |
| 89 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(MRA8_RAM, ninjakun_fg_videoram_w) AM_BASE(&ninjakun_fg_videoram) AM_SHARE(1) | |
| 90 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE(&ninjakun_bg_videoram) AM_SHARE(2) | |
| 91 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SHARE(3) | |
| 92 | AM_RANGE(0xd800, 0xd9ff) AM_READWRITE(MRA8_RAM, ninjakun_paletteram_w) AM_BASE(&paletteram) AM_SHARE(4) | |
| 93 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(5) | |
| 94 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(6) | |
| 95 | ADDRESS_MAP_END | |
| 96 | ||
| 97 | static ADDRESS_MAP_START( ninjakun_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 98 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 99 | AM_RANGE(0x2000, 0x7fff) AM_ROM AM_REGION(REGION_CPU1, 0x2000) | |
| 100 | AM_RANGE(0x8000, 0x8003) AM_READWRITE(ninjakun_io_8000_r, ninjakun_io_8000_w) | |
| 101 | AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) | |
| 102 | AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r) | |
| 103 | AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu2_io_A002_w) | |
| 104 | AM_RANGE(0xa003, 0xa003) AM_WRITE(ninjakun_flipscreen_w) | |
| 105 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(MRA8_RAM, ninjakun_fg_videoram_w) AM_SHARE(1) | |
| 106 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_SHARE(2) | |
| 107 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(3) | |
| 108 | AM_RANGE(0xd800, 0xd9ff) AM_READWRITE(MRA8_RAM, ninjakun_paletteram_w) AM_SHARE(4) | |
| 109 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(6) /* swapped wrt CPU1 */ | |
| 110 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(5) /* swapped wrt CPU1 */ | |
| 111 | ADDRESS_MAP_END | |
| 112 | ||
| 113 | /******************************************************************************* | |
| 114 | GFX Decoding Information | |
| 115 | *******************************************************************************/ | |
| 116 | ||
| 117 | static const gfx_layout tile_layout = | |
| 118 | { | |
| 119 | 8,8, /* tile size */ | |
| 120 | 0x400, /* number of tiles */ | |
| 121 | 4, /* bits per pixel */ | |
| 122 | { 0, 1, 2, 3 }, /* plane offsets */ | |
| 123 | { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, /* x offsets */ | |
| 124 | { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, /* y offsets */ | |
| 125 | 256 | |
| 126 | }; | |
| 127 | ||
| 128 | static const gfx_layout sprite_layout = | |
| 129 | { | |
| 130 | 16,16, /* tile size */ | |
| 131 | 0x100, /* number of tiles */ | |
| 132 | 4, /* bits per pixel */ | |
| 133 | { 0, 1, 2, 3 }, /* plane offsets */ | |
| 134 | { | |
| 135 | 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, | |
| 136 | 256+0*4, 256+1*4, 256+2*4, 256+3*4, 256+4*4, 256+5*4, 256+6*4, 256+7*4, | |
| 137 | }, /* x offsets */ | |
| 138 | { | |
| 139 | 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, | |
| 140 | 512+0*32, 512+1*32, 512+2*32, 512+3*32, 512+4*32, 512+5*32, 512+6*32, 512+7*32 | |
| 141 | }, /* y offsets */ | |
| 142 | 1024 | |
| 143 | }; | |
| 144 | ||
| 145 | static GFXDECODE_START( ninjakun ) | |
| 146 | GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0x000, 0x10 ) | |
| 147 | GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 0x100, 0x10 ) | |
| 148 | GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout, 0x200, 0x10 ) | |
| 149 | GFXDECODE_END | |
| 150 | ||
| 151 | /******************************************************************************* | |
| 152 | Machine Driver Structure(s) | |
| 153 | *******************************************************************************/ | |
| 154 | ||
| 155 | static MACHINE_DRIVER_START( ninjakun ) | |
| 156 | ||
| 157 | /* basic machine hardware */ | |
| 158 | MDRV_CPU_ADD(Z80, 3000000) /* 3.00MHz */ | |
| 159 | MDRV_CPU_PROGRAM_MAP(ninjakun_cpu1_map,0) | |
| 160 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 161 | ||
| 162 | MDRV_CPU_ADD(Z80, 3000000) /* 3.00MHz */ | |
| 163 | MDRV_CPU_PROGRAM_MAP(ninjakun_cpu2_map,0) | |
| 164 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* ? */ | |
| 165 | ||
| 166 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 167 | ||
| 168 | MDRV_MACHINE_START(ninjakun) | |
| 169 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION) | |
| 170 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */ | |
| 171 | ||
| 172 | /* video hardware */ | |
| 173 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) | |
| 174 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 175 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 176 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, (32-4)*8-1 ) | |
| 177 | MDRV_GFXDECODE(ninjakun) | |
| 178 | MDRV_PALETTE_LENGTH(768) | |
| 179 | ||
| 180 | MDRV_VIDEO_START(ninjakun) | |
| 181 | MDRV_VIDEO_UPDATE(ninjakun) | |
| 182 | ||
| 183 | /* sound hardware */ | |
| 184 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 185 | ||
| 186 | MDRV_SOUND_ADD(AY8910, 6000000/2) | |
| 187 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 188 | ||
| 189 | MDRV_SOUND_ADD(AY8910, 6000000/2) | |
| 190 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 191 | MACHINE_DRIVER_END | |
| 192 | ||
| 193 | /******************************************************************************* | |
| 194 | Rom Definitions | |
| 195 | *******************************************************************************/ | |
| 196 | ||
| 197 | ROM_START( ninjakun ) /* Original Board? */ | |
| 198 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* Main CPU */ | |
| 199 | ROM_LOAD( "ninja-1.7a", 0x0000, 0x02000, CRC(1c1dc141) SHA1(423d3ed35e73a8d5bfce075a889b0322b207bd0d) ) | |
| 200 | ROM_LOAD( "ninja-2.7b", 0x2000, 0x02000, CRC(39cc7d37) SHA1(7f0d0e1e92cb6a57f15eb7fc51a67112f1c5fc8e) ) | |
| 201 | ROM_LOAD( "ninja-3.7d", 0x4000, 0x02000, CRC(d542bfe3) SHA1(3814d8f5b1acda21438fff4f71670fa653dc7b30) ) | |
| 202 | ROM_LOAD( "ninja-4.7e", 0x6000, 0x02000, CRC(a57385c6) SHA1(77925a281e64889bfe967c3d42a388529aaf7eb6) ) | |
| 203 | ||
| 204 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Secondary CPU */ | |
| 205 | ROM_LOAD( "ninja-5.7h", 0x0000, 0x02000, CRC(164a42c4) SHA1(16b434b33b76b878514f67c23315d4c6da7bfc9e) ) | |
| 206 | ||
| 207 | ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) /* Graphics */ | |
| 208 | ROM_LOAD16_BYTE( "ninja-6.7n", 0x0000, 0x02000, CRC(a74c4297) SHA1(87184d14c67331f2c8a2412e28f31427eddae799) ) | |
| 209 | ROM_LOAD16_BYTE( "ninja-7.7p", 0x0001, 0x02000, CRC(53a72039) SHA1(d77d608ce9388a8956831369badd88a8eda8e102) ) | |
| 210 | ROM_LOAD16_BYTE( "ninja-8.7s", 0x4000, 0x02000, CRC(4a99d857) SHA1(6aadb6a5c721a161a5c1bef5569c1e323e380cff) ) | |
| 211 | ROM_LOAD16_BYTE( "ninja-9.7t", 0x4001, 0x02000, CRC(dede49e4) SHA1(8ce4bc02ec583b3885ca63fb5e2d5dad185fe192) ) | |
| 212 | ||
| 213 | ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE ) /* Graphics */ | |
| 214 | ROM_LOAD16_BYTE( "ninja-10.2c", 0x0000, 0x02000, CRC(0d55664a) SHA1(955a607b4401ce9f3f807d53833a766152b0ef9b) ) | |
| 215 | ROM_LOAD16_BYTE( "ninja-11.2d", 0x0001, 0x02000, CRC(12ff9597) SHA1(10b572844ab32e3ae54abe3600fecc1a811ac713) ) | |
| 216 | ROM_LOAD16_BYTE( "ninja-12.4c", 0x4000, 0x02000, CRC(e9b75807) SHA1(cf4c8ac962f785e9de5502df58eab9b3725aaa28) ) | |
| 217 | ROM_LOAD16_BYTE( "ninja-13.4d", 0x4001, 0x02000, CRC(1760ed2c) SHA1(ee4c8efcce483c8051873714856824a1a1e14b61) ) | |
| 218 | ROM_END | |
| 219 | ||
| 220 | /******************************************************************************* | |
| 221 | Input Ports | |
| 222 | ******************************************************************************** | |
| 223 | 2 Sets of Controls | |
| 224 | 2 Sets of Dipsiwtches | |
| 225 | *******************************************************************************/ | |
| 226 | ||
| 227 | static INPUT_PORTS_START( ninjakun ) | |
| 228 | PORT_START_TAG("IN0") /* 0xa000 */ | |
| 229 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY /* "XPOS1" */ | |
| 230 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY | |
| 231 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 232 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 233 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 234 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) | |
| 235 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 236 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 237 | ||
| 238 | PORT_START_TAG("IN1") /* 0xa001 */ | |
| 239 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_2WAY PORT_COCKTAIL /* "YPOS1" */ | |
| 240 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_2WAY PORT_COCKTAIL | |
| 241 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL | |
| 242 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 243 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 244 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) | |
| 245 | PORT_SERVICE( 0x40, IP_ACTIVE_HIGH ) | |
| 246 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 247 | ||
| 248 | PORT_START_TAG("IN2") /* 0xa002 */ | |
| 249 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 250 | ||
| 251 | PORT_START_TAG("DSW1") | |
| 252 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) | |
| 253 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) | |
| 254 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) | |
| 255 | PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) ) | |
| 256 | PORT_DIPSETTING( 0x02, "2" ) | |
| 257 | PORT_DIPSETTING( 0x04, "3" ) | |
| 258 | PORT_DIPSETTING( 0x06, "4" ) | |
| 259 | PORT_DIPSETTING( 0x00, "5" ) | |
| 260 | PORT_DIPNAME( 0x08, 0x08, "First Bonus" ) | |
| 261 | PORT_DIPSETTING( 0x08, "30000" ) | |
| 262 | PORT_DIPSETTING( 0x00, "40000" ) | |
| 263 | PORT_DIPNAME( 0x30, 0x30, "Second Bonus" ) | |
| 264 | PORT_DIPSETTING( 0x00, "No Bonus" ) | |
| 265 | PORT_DIPSETTING( 0x10, "Every 30000" ) | |
| 266 | PORT_DIPSETTING( 0x30, "Every 50000" ) | |
| 267 | PORT_DIPSETTING( 0x20, "Every 70000" ) | |
| 268 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 269 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 270 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 271 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) ) | |
| 272 | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) | |
| 273 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) | |
| 274 | ||
| 275 | PORT_START_TAG("DSW2") | |
| 276 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) | |
| 277 | PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) | |
| 278 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) | |
| 279 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_2C ) ) | |
| 280 | PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) | |
| 281 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_2C ) ) | |
| 282 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_2C ) ) | |
| 283 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) | |
| 284 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) ) | |
| 285 | PORT_DIPNAME( 0x08, 0x08, "High Score Names" ) | |
| 286 | PORT_DIPSETTING( 0x00, "3 Letters" ) | |
| 287 | PORT_DIPSETTING( 0x08, "8 Letters" ) | |
| 288 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) | |
| 289 | PORT_DIPSETTING( 0x10, DEF_STR( No ) ) | |
| 290 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 291 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )/* Probably Unused */ | |
| 292 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 293 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 294 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) | |
| 295 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 296 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 297 | PORT_DIPNAME( 0x80, 0x80, "Endless Game (If Free Play)" ) | |
| 298 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 299 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 300 | INPUT_PORTS_END | |
| 301 | ||
| 302 | /******************************************************************************* | |
| 303 | Game Drivers | |
| 304 | *******************************************************************************/ | |
| 305 | ||
| 306 | GAME( 1984, ninjakun, 0, ninjakun, ninjakun, 0, ROT0, "[UPL] (Taito license)", "Ninjakun Majou no Bouken", 0 ) |
| r1591 | r1592 | |
|---|---|---|
| 80 | 80 | static WRITE8_HANDLER( champbas_mcu_halt_w ) |
| 81 | 81 | { |
| 82 | 82 | data &= 1; |
| 83 | cpunum_set_input_line(2, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); | |
| 83 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /* champbja another protection */ |
| r1591 | r1592 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | static WRITE8_HANDLER( baraduke_irq_ack_w ) |
| 166 | 166 | { |
| 167 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 167 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| r1591 | r1592 | |
| 439 | 439 | MDRV_CPU_PROGRAM_MAP(baraduke_map,0) |
| 440 | 440 | MDRV_CPU_VBLANK_INT(irq0_line_assert,1) |
| 441 | 441 | |
| 442 | MDRV_CPU_ADD(HD63701,49152000/ | |
| 442 | MDRV_CPU_ADD(HD63701,49152000/8 | |
| 443 | 443 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 444 | 444 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 445 | 445 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) |
| r1591 | r1592 | |
|---|---|---|
| 51 | 51 | static WRITE8_HANDLER( ssozumo_sh_command_w ) |
| 52 | 52 | { |
| 53 | 53 | soundlatch_w(offset, data); |
| 54 | cpunum_set_input_line(1, M6502_IRQ_LINE, HOLD_LINE); | |
| 54 | cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, HOLD_LINE); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | int next_interrupt_number; |
| 82 | 82 | int next_vpos; |
| 83 | 83 | |
| 84 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 84 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 85 | 85 | |
| 86 | 86 | /* set up for next interrupt */ |
| 87 | 87 | next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME; |
| r1591 | r1592 | |
|---|---|---|
| 63 | 63 | if (scanline == m107_raster_irq_position) |
| 64 | 64 | { |
| 65 | 65 | video_screen_update_partial(0, scanline); |
| 66 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M107_IRQ_2); | |
| 66 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M107_IRQ_2); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /* VBLANK interrupt */ |
| 70 | 70 | else if (scanline == machine->screen[0].visarea.max_y + 1) |
| 71 | 71 | { |
| 72 | 72 | video_screen_update_partial(0, scanline); |
| 73 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M107_IRQ_0); | |
| 73 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M107_IRQ_0); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /* adjust for next scanline */ |
| r1591 | r1592 | |
| 112 | 112 | cpunum_set_input_line_vector(1,0,0x19); |
| 113 | 113 | |
| 114 | 114 | if (irqvector == 0) /* no IRQs pending */ |
| 115 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 115 | cpunum_set_input_line(machine, 1,0,CLEAR_LINE); | |
| 116 | 116 | else /* IRQ pending */ |
| 117 | cpunum_set_input_line(1,0,ASSERT_LINE); | |
| 117 | cpunum_set_input_line(machine, 1,0,ASSERT_LINE); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | static WRITE16_HANDLER( m107_soundlatch_w ) |
| r1591 | r1592 | |
| 144 | 144 | static WRITE16_HANDLER( m107_sound_status_w ) |
| 145 | 145 | { |
| 146 | 146 | COMBINE_DATA(&sound_status); |
| 147 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M107_IRQ_3); | |
| 147 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, M107_IRQ_3); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /*****************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 212 | 212 | /* bit 0 enables cpu B */ |
| 213 | 213 | /* however this fails when recovering from a save state |
| 214 | 214 | if cpu B is disabled !! */ |
| 215 | cpunum_set_input_line(2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 215 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE); | |
| 216 | 216 | |
| 217 | 217 | } |
| 218 | 218 | |
| r1591 | r1592 | |
| 570 | 570 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 571 | 571 | static void irqhandler(int irq) |
| 572 | 572 | { |
| 573 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 573 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 60 | 60 | static WRITE8_HANDLER( matmania_sh_command_w ) |
| 61 | 61 | { |
| 62 | 62 | soundlatch_w(offset,data); |
| 63 | cpunum_set_input_line(1,M6502_IRQ_LINE,HOLD_LINE); | |
| 63 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static WRITE8_HANDLER( matmania_dac_w ) |
| r1591 | r1592 | |
| 72 | 72 | static WRITE8_HANDLER( maniach_sh_command_w ) |
| 73 | 73 | { |
| 74 | 74 | soundlatch_w(offset,data); |
| 75 | cpunum_set_input_line(1,M6809_IRQ_LINE,HOLD_LINE); | |
| 75 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r1591 | r1592 | |
| 378 | 378 | /* handler called by the 3526 emulator when the internal timers cause an IRQ */ |
| 379 | 379 | static void irqhandler(int linestate) |
| 380 | 380 | { |
| 381 | cpunum_set_input_line(1,1,linestate); | |
| 381 | cpunum_set_input_line(Machine, 1,1,linestate); | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
|---|---|---|
| 169 | 169 | if( twin16_CPUA_register!=old ) |
| 170 | 170 | { |
| 171 | 171 | if( (old&0x08)==0 && (twin16_CPUA_register&0x08) ) |
| 172 | { | |
| 173 | cpunum_set_input_line_and_vector( CPU_SOUND, 0, HOLD_LINE, 0xff ); | |
| 174 | } | |
| 172 | cpunum_set_input_line_and_vector(Machine, CPU_SOUND, 0, HOLD_LINE, 0xff ); | |
| 175 | 173 | |
| 176 | 174 | if( (old&0x40) && (twin16_CPUA_register&0x40)==0 ) |
| 177 | { | |
| 178 | 175 | twin16_spriteram_process(); |
| 179 | } | |
| 180 | 176 | |
| 181 | 177 | if( (old&0x10)==0 && (twin16_CPUA_register&0x10) ) |
| 182 | { | |
| 183 | cpunum_set_input_line( CPU_B, MC68000_IRQ_6, HOLD_LINE ); | |
| 184 | } | |
| 178 | cpunum_set_input_line(Machine, CPU_B, MC68000_IRQ_6, HOLD_LINE ); | |
| 179 | ||
| 185 | 180 | coin_counter_w( 0, twin16_CPUA_register&0x01 ); |
| 186 | 181 | coin_counter_w( 1, twin16_CPUA_register&0x02 ); |
| 187 | 182 | coin_counter_w( 2, twin16_CPUA_register&0x04 ); |
| r1591 | r1592 | |
| 202 | 197 | { |
| 203 | 198 | if( (old&0x01)==0 && (twin16_CPUB_register&0x1) ) |
| 204 | 199 | { |
| 205 | cpunum_set_input_line( CPU_A, MC68000_IRQ_6, HOLD_LINE ); | |
| 200 | cpunum_set_input_line(Machine, CPU_A, MC68000_IRQ_6, HOLD_LINE ); | |
| 206 | 201 | } |
| 207 | 202 | } |
| 208 | 203 | } |
| r1591 | r1592 | |
| 214 | 209 | if( twin16_CPUA_register!=old ) |
| 215 | 210 | { |
| 216 | 211 | if( (old&0x08)==0 && (twin16_CPUA_register&0x08) ) |
| 217 | cpunum_set_input_line_and_vector( CPU_SOUND, 0, HOLD_LINE, 0xff ); // trigger IRQ on sound CPU | |
| 212 | cpunum_set_input_line_and_vector(Machine, CPU_SOUND, 0, HOLD_LINE, 0xff ); // trigger IRQ on sound CPU | |
| 218 | 213 | } |
| 219 | 214 | } |
| 220 | 215 | |
| r1591 | r1592 | |
| 946 | 941 | |
| 947 | 942 | static INTERRUPT_GEN( CPUA_interrupt ) |
| 948 | 943 | { |
| 949 | if (CPUA_IRQ_ENABLE) cpunum_set_input_line(cpunum, 5, HOLD_LINE); | |
| 944 | if (CPUA_IRQ_ENABLE) cpunum_set_input_line(machine, cpunum, 5, HOLD_LINE); | |
| 950 | 945 | } |
| 951 | 946 | |
| 952 | 947 | static INTERRUPT_GEN( CPUB_interrupt ) |
| 953 | 948 | { |
| 954 | if (CPUB_IRQ_ENABLE) cpunum_set_input_line(cpunum, 5, HOLD_LINE); | |
| 949 | if (CPUB_IRQ_ENABLE) cpunum_set_input_line(machine, cpunum, 5, HOLD_LINE); | |
| 955 | 950 | } |
| 956 | 951 | |
| 957 | 952 | /* Machine Drivers */ |
| r1591 | r1592 | |
|---|---|---|
| 190 | 190 | { |
| 191 | 191 | switch ( cpu_getiloops() ) |
| 192 | 192 | { |
| 193 | case 0: cpunum_set_input_line(0, 3, HOLD_LINE); break; | |
| 194 | case 1: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 195 | case 2: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 193 | case 0: cpunum_set_input_line(machine, 0, 3, HOLD_LINE); break; | |
| 194 | case 1: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 195 | case 2: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | |
| r1591 | r1592 | |
| 200 | 200 | { |
| 201 | 201 | switch ( cpu_getiloops() ) |
| 202 | 202 | { |
| 203 | case 0: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 204 | case 1: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 205 | // case 2: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 203 | case 0: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 204 | case 1: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 205 | // case 2: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| r1591 | r1592 | |
| 218 | 218 | AM_RANGE(0x080006, 0x080007) AM_READ(dsw_r) |
| 219 | 219 | AM_RANGE(0x080008, 0x080009) AM_READ(soundlatch2_word_r) /* from sound cpu */ |
| 220 | 220 | AM_RANGE(0x084000, 0x084fff) AM_READ(MRA16_RAM) |
| 221 | AM_RANGE(0x088000, 0x0887ff) AM_READ( | |
| 221 | AM_RANGE(0x088000, 0x0887ff) AM_READ(MRA | |
| 222 | 222 | AM_RANGE(0x08e000, 0x08ffff) AM_READ(MRA16_RAM) |
| 223 | 223 | AM_RANGE(0x090000, 0x093fff) AM_READ(MRA16_RAM) |
| 224 | 224 | AM_RANGE(0x094000, 0x097fff) AM_READ(MRA16_RAM) |
| r1591 | r1592 | |
| 249 | 249 | { |
| 250 | 250 | switch (cpu_getiloops()) |
| 251 | 251 | { |
| 252 | case 0: cpunum_set_input_line(0, 4, HOLD_LINE); break; | |
| 253 | case 1: cpunum_set_input_line(0, 1, HOLD_LINE); break; | |
| 254 | default: cpunum_set_input_line(0, 2, HOLD_LINE); break; | |
| 252 | case 0: cpunum_set_input_line(machine, 0, 4, HOLD_LINE); break; | |
| 253 | case 1: cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break; | |
| 254 | default: cpunum_set_input_line(machine, 0, 2, HOLD_LINE); break; | |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
| r1591 | r1592 | |
| 298 | 298 | static WRITE16_HANDLER( ip_select_w ) |
| 299 | 299 | { |
| 300 | 300 | COMBINE_DATA(&ip_select); |
| 301 | cpunum_set_input_line(0,2,HOLD_LINE); | |
| 301 | cpunum_set_input_line(Machine, 0,2,HOLD_LINE); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
| r1591 | r1592 | |
| 306 | 306 | ADDRESS_MAP_FLAGS( AMEF_ABITS(20) ) |
| 307 | 307 | AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) |
| 308 | 308 | AM_RANGE(0x044000, 0x044fff) AM_READ(MRA16_RAM) |
| 309 | AM_RANGE(0x048000, 0x0487ff) AM_READ( | |
| 309 | AM_RANGE(0x048000, 0x0487ff) AM_READ(MRA | |
| 310 | 310 | AM_RANGE(0x04e000, 0x04ffff) AM_READ(MRA16_RAM) |
| 311 | 311 | AM_RANGE(0x050000, 0x053fff) AM_READ(MRA16_RAM) |
| 312 | 312 | AM_RANGE(0x054000, 0x057fff) AM_READ(MRA16_RAM) |
| r1591 | r1592 | |
| 348 | 348 | AM_RANGE(0x0e0000, 0x0e3fff) AM_READ(MRA16_RAM) |
| 349 | 349 | AM_RANGE(0x0e8000, 0x0ebfff) AM_READ(MRA16_RAM) |
| 350 | 350 | AM_RANGE(0x0f0000, 0x0f3fff) AM_READ(MRA16_RAM) |
| 351 | AM_RANGE(0x0f8000, 0x0f87ff) AM_READ( | |
| 351 | AM_RANGE(0x0f8000, 0x0f87ff) AM_READ(MRA | |
| 352 | 352 | AM_RANGE(0x0d8000, 0x0d8001) AM_READ(ip_select_r) |
| 353 | 353 | AM_RANGE(0x1f0000, 0x1fffff) AM_READ(MRA16_RAM) |
| 354 | 354 | ADDRESS_MAP_END |
| r1591 | r1592 | |
| 376 | 376 | #define INTERRUPT_NUM_D 1 |
| 377 | 377 | static INTERRUPT_GEN( interrupt_D ) |
| 378 | 378 | { |
| 379 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 379 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | static ADDRESS_MAP_START( readmem_D, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1591 | r1592 | |
| 385 | 385 | AM_RANGE(0x0ca000, 0x0cbfff) AM_READ(MRA16_RAM) |
| 386 | 386 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READ(MRA16_RAM) |
| 387 | 387 | AM_RANGE(0x0d4000, 0x0d7fff) AM_READ(MRA16_RAM) |
| 388 | AM_RANGE(0x0d8000, 0x0d87ff) AM_READ(paletteram16_word_r) | |
| 389 | AM_RANGE(0x0db000, 0x0db7ff) AM_READ(paletteram16_word_r) | |
| 388 | AM_RANGE(0x0d8000, 0x0d87ff) AM_MIRROR(0x3000) AM_READ(MRA16_RAM) | |
| 390 | 389 | AM_RANGE(0x0e0000, 0x0e0001) AM_READ(dsw_r) |
| 391 | 390 | AM_RANGE(0x0e8000, 0x0ebfff) AM_READ(MRA16_RAM) |
| 392 | 391 | AM_RANGE(0x0f0000, 0x0f0001) AM_READ(coins_r) /* Coins + P1&P2 Buttons */ |
| r1591 | r1592 | |
| 401 | 400 | AM_RANGE(0x0ca000, 0x0cbfff) AM_WRITE(MWA16_RAM) AM_BASE(&megasys1_objectram) |
| 402 | 401 | AM_RANGE(0x0d0000, 0x0d3fff) AM_WRITE(megasys1_scrollram_1_w) AM_BASE(&megasys1_scrollram[1]) |
| 403 | 402 | AM_RANGE(0x0d4000, 0x0d7fff) AM_WRITE(megasys1_scrollram_2_w) AM_BASE(&megasys1_scrollram[2]) |
| 404 | AM_RANGE(0x0d8000, 0x0d87ff) AM_WRITE(paletteram16_RRRRRGGGGGBBBBBx_word_w) | |
| 405 | AM_RANGE(0x0db000, 0x0db7ff) AM_WRITE(paletteram16_RRRRRGGGGGBBBBBx_word_w) AM_BASE(&paletteram16) | |
| 403 | AM_RANGE(0x0d8000, 0x0d87ff) AM_MIRROR(0x3000) AM_WRITE(paletteram16_RRRRRGGGGGBBBBBx_word_w) AM_BASE(&paletteram16) | |
| 406 | 404 | AM_RANGE(0x0e8000, 0x0ebfff) AM_WRITE(megasys1_scrollram_0_w) AM_BASE(&megasys1_scrollram[0]) |
| 407 | 405 | AM_RANGE(0x0f8000, 0x0f8001) AM_WRITE(OKIM6295_data_0_lsb_w) |
| 408 | 406 | // { 0x100000, 0x100001 protection |
| r1591 | r1592 | |
| 474 | 472 | static void megasys1_sound_irq(int irq) |
| 475 | 473 | { |
| 476 | 474 | if (irq) |
| 477 | cpunum_set_input_line(1, 4, HOLD_LINE); | |
| 475 | cpunum_set_input_line(Machine, 1, 4, HOLD_LINE); | |
| 478 | 476 | } |
| 479 | 477 | |
| 480 | 478 | static READ16_HANDLER( oki_status_0_r ) |
| r1591 | r1592 | |
| 810 | 808 | |
| 811 | 809 | static void irq_handler(int irq) |
| 812 | 810 | { |
| 813 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 811 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 814 | 812 | } |
| 815 | 813 | |
| 816 | 814 | |
| r1591 | r1592 | |
| 2969 | 2967 | } |
| 2970 | 2968 | } |
| 2971 | 2969 | |
| 2972 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 2970 | cpunum_set_input_line(Machine, 0,4,HOLD_LINE); | |
| 2973 | 2971 | } |
| 2974 | 2972 | |
| 2975 | 2973 |
| r1591 | r1592 | |
|---|---|---|
| 166 | 166 | { |
| 167 | 167 | pending_command = 1; |
| 168 | 168 | soundlatch_w(offset,data & 0xff); |
| 169 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 169 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
| r1591 | r1592 | |
| 607 | 607 | |
| 608 | 608 | static void irqhandler(int irq) |
| 609 | 609 | { |
| 610 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 610 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 274 | 274 | |
| 275 | 275 | static WRITE8_HANDLER( master_nmi_trigger_w ) |
| 276 | 276 | { |
| 277 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 277 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | static void airbustr_bankswitch(int cpunum, int data) |
| r1591 | r1592 | |
| 331 | 331 | { |
| 332 | 332 | soundlatch_w(0, data); |
| 333 | 333 | soundlatch_status = 1; // soundlatch has been written |
| 334 | cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu | |
| 334 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | static WRITE8_HANDLER( soundcommand2_w ) |
| r1591 | r1592 | |
| 570 | 570 | static int addr = 0xff; |
| 571 | 571 | |
| 572 | 572 | addr ^= 0x02; |
| 573 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, addr); | |
| 573 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, addr); | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | static INTERRUPT_GEN( slave_interrupt ) |
| r1591 | r1592 | |
| 578 | 578 | static int addr = 0xfd; |
| 579 | 579 | |
| 580 | 580 | addr ^= 0x02; |
| 581 | cpunum_set_input_line_and_vector(1, 0, HOLD_LINE, addr); | |
| 581 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, addr); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | /* Machine Initialization */ |
| r1591 | r1592 | |
|---|---|---|
| 387 | 387 | static WRITE8_HANDLER( pacman_interrupt_vector_w ) |
| 388 | 388 | { |
| 389 | 389 | cpunum_set_input_line_vector(0, 0, data); |
| 390 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 390 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | |
| r1591 | r1592 | |
| 683 | 683 | |
| 684 | 684 | static INTERRUPT_GEN( s2650_interrupt ) |
| 685 | 685 | { |
| 686 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x03); | |
| 686 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x03); | |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | static WRITE8_HANDLER( porky_banking_w ) |
| r1591 | r1592 | |
| 824 | 824 | |
| 825 | 825 | |
| 826 | 826 | static ADDRESS_MAP_START( mspacman_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 827 | AM_RANGE(0x0000, 0x3fff) AM_R | |
| 827 | AM_RANGE(0x0000, 0x3fff) AM_RO | |
| 828 | 828 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 829 | 829 | AM_RANGE(0x4400, 0x47ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_colorram_w) AM_BASE(&colorram) |
| 830 | 830 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READWRITE(pacman_read_nop,MWA8_NOP) |
| r1591 | r1592 | |
| 846 | 846 | AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ(input_port_1_r) /* IN1 */ |
| 847 | 847 | AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ(input_port_2_r) /* DSW1 */ |
| 848 | 848 | AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_READ(input_port_3_r) /* DSW2 */ |
| 849 | AM_RANGE(0x8000, 0xbfff) AM_R | |
| 849 | AM_RANGE(0x8000, 0xbfff) AM_RO | |
| 850 | 850 | ADDRESS_MAP_END |
| 851 | 851 | |
| 852 | 852 | |
| r1591 | r1592 | |
| 936 | 936 | |
| 937 | 937 | |
| 938 | 938 | static ADDRESS_MAP_START( epos_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 939 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x8000) AM_R | |
| 939 | AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x8000) AM_RO | |
| 940 | 940 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 941 | 941 | AM_RANGE(0x4400, 0x47ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_colorram_w) AM_BASE(&colorram) |
| 942 | 942 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READWRITE(pacman_read_nop,MWA8_NOP) |
| r1591 | r1592 | |
| 1069 | 1069 | |
| 1070 | 1070 | |
| 1071 | 1071 | static ADDRESS_MAP_START( mschamp_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1072 | AM_RANGE(0x0000, 0x3fff) AM_R | |
| 1072 | AM_RANGE(0x0000, 0x3fff) AM_RO | |
| 1073 | 1073 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 1074 | 1074 | AM_RANGE(0x4400, 0x47ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_colorram_w) AM_BASE(&colorram) |
| 1075 | 1075 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READWRITE(pacman_read_nop,MWA8_NOP) |
| r1591 | r1592 | |
| 1091 | 1091 | AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ(input_port_1_r) /* IN1 */ |
| 1092 | 1092 | AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ(input_port_2_r) /* DSW1 */ |
| 1093 | 1093 | AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_READ(input_port_3_r) /* DSW2 */ |
| 1094 | AM_RANGE(0x8000, 0xbfff) AM_R | |
| 1094 | AM_RANGE(0x8000, 0xbfff) AM_RO | |
| 1095 | 1095 | ADDRESS_MAP_END |
| 1096 | 1096 | |
| 1097 | 1097 | static ADDRESS_MAP_START( crushs_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
| 5377 | 5377 | static DRIVER_INIT( cannonbp ) |
| 5378 | 5378 | { |
| 5379 | 5379 | /* extra memory */ |
| 5380 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, MRA8_RAM); | |
| 5381 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, MWA8_RAM); | |
| 5380 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, MRA8_BANK5, MWA8_BANK5); | |
| 5381 | memory_set_bankptr(5, auto_malloc(0x400)); | |
| 5382 | 5382 | |
| 5383 | 5383 | /* protection? */ |
| 5384 | 5384 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, cannonbp_protection_r); |
| r1591 | r1592 | |
|---|---|---|
| 66 | 66 | for (i = 4; i >= 0; i--) |
| 67 | 67 | if (irq_state[i]) |
| 68 | 68 | { |
| 69 | cpunum_set_input_line(0, i, ASSERT_LINE); | |
| 69 | cpunum_set_input_line(Machine, 0, i, ASSERT_LINE); | |
| 70 | 70 | return; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /* otherwise, clear them all */ |
| 74 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 74 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| r1591 | r1592 | |
| 157 | 157 | { |
| 158 | 158 | /* write the latch and set the IRQ */ |
| 159 | 159 | soundlatch_full = 1; |
| 160 | cpunum_set_input_line(1, 0, ASSERT_LINE); | |
| 160 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 161 | 161 | soundlatch_w(0, data & 0xff); |
| 162 | 162 | } |
| 163 | 163 | } |
| r1591 | r1592 | |
| 174 | 174 | { |
| 175 | 175 | /* read the latch and clear the IRQ */ |
| 176 | 176 | soundlatch_full = 0; |
| 177 | cpunum_set_input_line(1, 0, CLEAR_LINE); | |
| 177 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 178 | 178 | return soundlatch_r(0); |
| 179 | 179 | } |
| 180 | 180 |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | if (cpu_getiloops() == 0) |
| 30 | 30 | { |
| 31 | 31 | if (K051960_is_IRQ_enabled()) |
| 32 | cpunum_set_input_line(0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 32 | cpunum_set_input_line(machine, 0, KONAMI_IRQ_LINE, HOLD_LINE); | |
| 33 | 33 | } |
| 34 | 34 | else if (cpu_getiloops() % 2) |
| 35 | 35 | { |
| 36 | 36 | if (K051960_is_NMI_enabled()) |
| 37 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 37 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| r1591 | r1592 | |
| 48 | 48 | memory_set_bankptr(4,&RAM[bankaddress]); |
| 49 | 49 | |
| 50 | 50 | /* bit 5 = memory bank select */ |
| 51 | if (data & 0x20){ | |
| 52 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, paletteram_r); /* palette */ | |
| 53 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w); /* palette */ | |
| 54 | if (K051316_readroms){ | |
| 55 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r); /* 051316 #1 (ROM test) */ | |
| 56 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_w); /* 051316 #1 */ | |
| 57 | } | |
| 58 | else{ | |
| 59 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r); /* 051316 #1 */ | |
| 60 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_w); /* 051316 #1 */ | |
| 61 | } | |
| 51 | if (data & 0x20) | |
| 52 | { | |
| 53 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MRA8_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 54 | memory_set_bankptr(5, paletteram); | |
| 55 | ||
| 56 | if (K051316_readroms) | |
| 57 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */ | |
| 58 | else | |
| 59 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */ | |
| 62 | 60 | } |
| 63 | else{ | |
| 64 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, MRA8_BANK1); /* RAM */ | |
| 65 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, MWA8_BANK1); /* RAM */ | |
| 66 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MRA8_BANK2); /* RAM */ | |
| 67 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MWA8_BANK2); /* RAM */ | |
| 61 | else | |
| 62 | { | |
| 63 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, MRA8_BANK1, MWA8_BANK1); /* RAM */ | |
| 64 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MRA8_BANK2, MWA8_BANK2); /* RAM */ | |
| 68 | 65 | } |
| 69 | 66 | |
| 70 | 67 | /* other bits unknown/unused */ |
| r1591 | r1592 | |
| 138 | 135 | |
| 139 | 136 | static WRITE8_HANDLER( chqflag_sh_irqtrigger_w ) |
| 140 | 137 | { |
| 141 | cpunum_set_input_line(1,0,HOLD_LINE); | |
| 138 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 142 | 139 | } |
| 143 | 140 | |
| 144 | 141 | |
| r1591 | r1592 | |
| 323 | 320 | |
| 324 | 321 | static void chqflag_ym2151_irq_w(int data) |
| 325 | 322 | { |
| 326 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 323 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 327 | 324 | } |
| 328 | 325 | |
| 329 | 326 |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | latch_data = sound_fifo[fftail]; |
| 73 | 73 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); |
| 74 | 74 | soundlatch_w(0, latch_data); |
| 75 | cpunum_set_input_line(2, DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ | |
| 75 | cpunum_set_input_line(machine, 2, DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ | |
| 76 | 76 | } |
| 77 | 77 | break; |
| 78 | 78 | |
| 79 | 79 | case 1: |
| 80 | 80 | if (~readinputport(4) & 0x03) |
| 81 | { if (!coin) { coin = 1; cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); } } | |
| 81 | { if (!coin) { coin = 1; cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); } } | |
| 82 | 82 | else |
| 83 | 83 | coin = 0; |
| 84 | 84 | break; |
| 85 | 85 | |
| 86 | 86 | case 2: |
| 87 | if (readinputport(5)) cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 87 | if (readinputport(5)) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 88 | 88 | break; |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | static INTERRUPT_GEN ( bwp3_interrupt ) { if (!bwp3_nmimask) cpunum_set_input_line(2, INPUT_LINE_NMI, ASSERT_LINE); } | |
| 93 | static INTERRUPT_GEN ( bwp3_interrupt ) { if (!bwp3_nmimask) cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, ASSERT_LINE); } | |
| 94 | 94 | |
| 95 | 95 | //**************************************************************************** |
| 96 | 96 | // Memory and I/O Handlers |
| 97 | 97 | |
| 98 | 98 | static WRITE8_HANDLER( bwp12_sharedram1_w ) { bwp1_sharedram1[offset] = bwp2_sharedram1[offset] = data; } |
| 99 | 99 | static WRITE8_HANDLER( bwp3_u8F_w ) { bwp3_u8F_d = data; } // prepares custom chip for various operations |
| 100 | static WRITE8_HANDLER( bwp3_nmiack_w ) { cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); } | |
| 100 | static WRITE8_HANDLER( bwp3_nmiack_w ) { cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); } | |
| 101 | 101 | static WRITE8_HANDLER( bwp3_nmimask_w ) { bwp3_nmimask = data & 0x80; } |
| 102 | 102 | |
| 103 | 103 | |
| r1591 | r1592 | |
| 118 | 118 | switch (offset) |
| 119 | 119 | { |
| 120 | 120 | // MSSTB |
| 121 | case 0: cpunum_set_input_line(1, M6809_IRQ_LINE, ASSERT_LINE); break; | |
| 121 | case 0: cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, ASSERT_LINE); break; | |
| 122 | 122 | |
| 123 | 123 | // IRQACK |
| 124 | case 1: cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE); break; | |
| 124 | case 1: cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE); break; | |
| 125 | 125 | |
| 126 | 126 | // FIRQACK |
| 127 | case 2: cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); break; | |
| 127 | case 2: cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); break; | |
| 128 | 128 | |
| 129 | 129 | // NMIACK |
| 130 | case 3: cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); break; | |
| 130 | case 3: cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); break; | |
| 131 | 131 | |
| 132 | 132 | // SWAP(bank-swaps sprite RAM between 1800 & 1900; ignored bc. they're treated as a single chunk.) |
| 133 | 133 | case 4: break; |
| r1591 | r1592 | |
| 135 | 135 | // SNDREQ |
| 136 | 136 | case 5: |
| 137 | 137 | if (data == 0x80) // protection trick to screw CPU1 & 3 |
| 138 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); // SNMI | |
| 138 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); // SNMI | |
| 139 | 139 | else |
| 140 | 140 | if (ffcount < MAX_SOUNDS) |
| 141 | 141 | { |
| r1591 | r1592 | |
| 162 | 162 | { |
| 163 | 163 | switch (offset) |
| 164 | 164 | { |
| 165 | case 0: cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB | |
| 165 | case 0: cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB | |
| 166 | 166 | |
| 167 | case 1: cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE); break; | |
| 167 | case 1: cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); break; | |
| 168 | 168 | |
| 169 | case 2: cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE); break; | |
| 169 | case 2: cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); break; | |
| 170 | 170 | |
| 171 | case 3: cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); break; | |
| 171 | case 3: cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); break; | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | #if BW_DEBUG |
| r1591 | r1592 | |
|---|---|---|
| 700 | 700 | static INTERRUPT_GEN(srmp6_interrupt) |
| 701 | 701 | { |
| 702 | 702 | if(!cpu_getiloops()) |
| 703 | { | |
| 704 | cpunum_set_input_line(0,3,HOLD_LINE); | |
| 705 | } | |
| 703 | cpunum_set_input_line(machine, 0,3,HOLD_LINE); | |
| 706 | 704 | else |
| 707 | { | |
| 708 | cpunum_set_input_line(0,4,HOLD_LINE); | |
| 709 | } | |
| 705 | cpunum_set_input_line(machine, 0,4,HOLD_LINE); | |
| 710 | 706 | } |
| 711 | 707 | |
| 712 | 708 | static MACHINE_DRIVER_START( srmp6 ) |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | if (ACCESSING_LSB) |
| 54 | 54 | { |
| 55 | 55 | soundlatch_w(offset,data & 0xff); |
| 56 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 56 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| r1591 | r1592 | |
| 800 | 800 | |
| 801 | 801 | static void irq_handler(int irq) |
| 802 | 802 | { |
| 803 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 803 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
|---|---|---|
| 566 | 566 | |
| 567 | 567 | static void irqhandler(int irq) |
| 568 | 568 | { |
| 569 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 569 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | static WRITE8_HANDLER( unk ) |
| r1591 | r1592 | |
|---|---|---|
| 227 | 227 | if (data & 0x800000) |
| 228 | 228 | { |
| 229 | 229 | mame_printf_debug("CPU%d: CPU1 IRQ at %08X\n", cpu_getactivecpu(), activecpu_get_pc()); |
| 230 | cpunum_set_input_line(1, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 230 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | unk20004 = (UINT32)(data); |
| r1591 | r1592 | |
| 322 | 322 | { |
| 323 | 323 | if (data & U64(0x100000000)) |
| 324 | 324 | { |
| 325 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 325 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 326 | 326 | unk3 = 0; |
| 327 | 327 | } |
| 328 | 328 | } |
| r1591 | r1592 | |
| 1038 | 1038 | irq_active |= 0x8; |
| 1039 | 1039 | }*/ |
| 1040 | 1040 | |
| 1041 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 1041 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 1042 | 1042 | } |
| 1043 | 1043 | |
| 1044 | 1044 | static MACHINE_DRIVER_START( m2 ) |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | { |
| 56 | 56 | int scanline = param; |
| 57 | 57 | |
| 58 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 58 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 59 | 59 | |
| 60 | 60 | scanline = scanline + 32; |
| 61 | 61 |
| r1591 | r1592 | |
|---|---|---|
| 280 | 280 | |
| 281 | 281 | static INTERRUPT_GEN( sengokmj_interrupt ) |
| 282 | 282 | { |
| 283 | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xcb/4); | |
| 283 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xcb/4); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | static MACHINE_DRIVER_START( sengokmj ) |
| r1591 | r1592 | |
|---|---|---|
| 214 | 214 | |
| 215 | 215 | static void ppu_irq( int num, int *ppu_regs ) |
| 216 | 216 | { |
| 217 | cpunum_set_input_line(num, INPUT_LINE_NMI, PULSE_LINE ); | |
| 217 | cpunum_set_input_line(Machine, num, INPUT_LINE_NMI, PULSE_LINE ); | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /* our ppu interface */ |
| r1591 | r1592 | |
|---|---|---|
| 94 | 94 | static UINT8 agallet_vblank_irq; |
| 95 | 95 | |
| 96 | 96 | /* Update the IRQ state based on all possible causes */ |
| 97 | static void update_irq_state( | |
| 97 | static void update_irq_state(running_machine *machine) | |
| 98 | 98 | { |
| 99 | 99 | if (vblank_irq || sound_irq || unknown_irq) |
| 100 | cpunum_set_input_line(0, irq_level, ASSERT_LINE); | |
| 100 | cpunum_set_input_line(machine, 0, irq_level, ASSERT_LINE); | |
| 101 | 101 | else |
| 102 | cpunum_set_input_line(0, irq_level, CLEAR_LINE); | |
| 102 | cpunum_set_input_line(machine, 0, irq_level, CLEAR_LINE); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static TIMER_CALLBACK( cave_vblank_start ) |
| 106 | 106 | { |
| 107 | 107 | vblank_irq = 1; |
| 108 | update_irq_state(); | |
| 108 | update_irq_state(machine); | |
| 109 | 109 | cave_get_sprite_info(machine); |
| 110 | 110 | agallet_vblank_irq = 1; |
| 111 | 111 | } |
| r1591 | r1592 | |
| 115 | 115 | if(cave_kludge == 3) /* mazinger metmqstr */ |
| 116 | 116 | { |
| 117 | 117 | unknown_irq = 1; |
| 118 | update_irq_state(); | |
| 118 | update_irq_state(machine); | |
| 119 | 119 | } |
| 120 | 120 | agallet_vblank_irq = 0; |
| 121 | 121 | } |
| r1591 | r1592 | |
| 131 | 131 | static void sound_irq_gen(int state) |
| 132 | 132 | { |
| 133 | 133 | sound_irq = (state != 0); |
| 134 | update_irq_state(); | |
| 134 | update_irq_state(Machine); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| r1591 | r1592 | |
| 161 | 161 | if (offset == 4/2) vblank_irq = 0; |
| 162 | 162 | if (offset == 6/2) unknown_irq = 0; |
| 163 | 163 | |
| 164 | update_irq_state(); | |
| 164 | update_irq_state(Machine); | |
| 165 | 165 | |
| 166 | 166 | /* |
| 167 | 167 | sailormn and agallet wait for bit 2 of $b80001 to go 1 -> 0. |
| r1591 | r1592 | |
| 221 | 221 | // sound_flag1 = 1; |
| 222 | 222 | // sound_flag2 = 1; |
| 223 | 223 | soundlatch_word_w(offset,data,mem_mask); |
| 224 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 224 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 225 | 225 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other cpu to reply |
| 226 | 226 | } |
| 227 | 227 | |
| r1591 | r1592 | |
| 1994 | 1994 | |
| 1995 | 1995 | static void irqhandler(int irq) |
| 1996 | 1996 | { |
| 1997 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1997 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 1998 | 1998 | } |
| 1999 | 1999 | |
| 2000 | 2000 | static const struct YM2151interface ym2151_interface = |
| r1591 | r1592 | |
| 4295 | 4295 | { |
| 4296 | 4296 | /* this patch fixes on of the moves, why is it needed? is the rom bad or is there another |
| 4297 | 4297 | problem? does the Japan set need it or not? */ |
| 4298 | | |
| 4298 | DRIVER_INIT_CALL(pwrins2j | |
| 4299 | 4299 | |
| 4300 | 4300 | #if 1 //ROM PATCH |
| 4301 | 4301 | { |
| r1591 | r1592 | |
|---|---|---|
| 899 | 899 | |
| 900 | 900 | static void irqhandler(int irq) |
| 901 | 901 | { |
| 902 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 902 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | static READ8_HANDLER( unk_r ) |
| r1591 | r1592 | |
| 1164 | 1164 | static INTERRUPT_GEN( rshark_interrupt ) |
| 1165 | 1165 | { |
| 1166 | 1166 | if (cpu_getiloops() == 0) |
| 1167 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 1167 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 1168 | 1168 | else |
| 1169 | cpunum_set_input_line(0, 6, HOLD_LINE); | |
| 1169 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); | |
| 1170 | 1170 | } |
| 1171 | 1171 | |
| 1172 | 1172 | static MACHINE_DRIVER_START( rshark ) |
| r1591 | r1592 | |
|---|---|---|
| 87 | 87 | static WRITE8_HANDLER( brkthru_soundlatch_w ) |
| 88 | 88 | { |
| 89 | 89 | soundlatch_w(offset,data); |
| 90 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 90 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| r1591 | r1592 | |
| 147 | 147 | if (cpu_getiloops() == 0) |
| 148 | 148 | { |
| 149 | 149 | if (nmi_enable) |
| 150 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 150 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 151 | 151 | } |
| 152 | 152 | else |
| 153 | 153 | { |
| 154 | 154 | /* generate IRQ on coin insertion */ |
| 155 | 155 | if ((readinputportbytag("IN2") & 0xe0) != 0xe0) |
| 156 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 156 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
| r1591 | r1592 | |
| 386 | 386 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 387 | 387 | static void irqhandler(int linestate) |
| 388 | 388 | { |
| 389 | cpunum_set_input_line(1,M6809_IRQ_LINE,linestate); | |
| 389 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,linestate); | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
|---|---|---|
| 559 | 559 | ADDRESS_MAP_END |
| 560 | 560 | |
| 561 | 561 | |
| 562 | static ADDRESS_MAP_START( williams_extra_ram_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 563 | AM_RANGE(0x0000, 0x8fff) AM_READWRITE(MRA8_BANK1, MWA8_RAM) AM_BASE(&williams_videoram) | |
| 564 | AM_RANGE(0x9000, 0xbfff) AM_RAM | |
| 565 | AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITE(williams_paletteram_w) AM_BASE(&paletteram) | |
| 566 | AM_RANGE(0xc804, 0xc807) AM_MIRROR(0x00f0) AM_READWRITE(pia_0_r, pia_0_w) | |
| 567 | AM_RANGE(0xc80c, 0xc80f) AM_MIRROR(0x00f0) AM_READWRITE(pia_1_r, pia_1_w) | |
| 568 | AM_RANGE(0xc900, 0xc9ff) AM_WRITE(sinistar_vram_select_w) | |
| 569 | AM_RANGE(0xca00, 0xca07) AM_MIRROR(0x00f8) AM_WRITE(williams_blitter_w) | |
| 570 | AM_RANGE(0xcb00, 0xcbff) AM_READ(williams_video_counter_r) | |
| 571 | AM_RANGE(0xcbff, 0xcbff) AM_WRITE(williams_watchdog_reset_w) | |
| 572 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(MRA8_RAM, williams_cmos_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 573 | AM_RANGE(0xd000, 0xdfff) AM_RAM | |
| 574 | AM_RANGE(0xe000, 0xffff) AM_ROM | |
| 575 | ADDRESS_MAP_END | |
| 562 | 576 | |
| 577 | ||
| 578 | ||
| 563 | 579 | /************************************* |
| 564 | 580 | * |
| 565 | 581 | * Blaster memory handlers |
| r1591 | r1592 | |
| 616 | 632 | ADDRESS_MAP_END |
| 617 | 633 | |
| 618 | 634 | |
| 635 | static ADDRESS_MAP_START( williams2_extra_ram_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 636 | AM_RANGE(0x0000, 0x7fff) AM_READWRITE(MRA8_BANK1, MWA8_RAM) AM_BASE(&williams_videoram) | |
| 637 | AM_RANGE(0x8000, 0xbfff) AM_RAM | |
| 638 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(MRA8_RAM, williams2_tileram_w) AM_BASE(&williams2_tileram) | |
| 639 | AM_RANGE(0xc800, 0xc87f) AM_WRITE(williams2_bank_select_w) | |
| 640 | AM_RANGE(0xc880, 0xc887) AM_MIRROR(0x0078) AM_WRITE(williams_blitter_w) | |
| 641 | AM_RANGE(0xc900, 0xc97f) AM_WRITE(williams2_watchdog_reset_w) | |
| 642 | AM_RANGE(0xc980, 0xc983) AM_MIRROR(0x0070) AM_READWRITE(pia_1_r, pia_1_w) | |
| 643 | AM_RANGE(0xc984, 0xc987) AM_MIRROR(0x0070) AM_READWRITE(pia_0_r, pia_0_w) | |
| 644 | AM_RANGE(0xc98c, 0xc98f) AM_MIRROR(0x0070) AM_WRITE(williams2_7segment_w) | |
| 645 | AM_RANGE(0xcb00, 0xcb1f) AM_WRITE(williams2_fg_select_w) | |
| 646 | AM_RANGE(0xcb20, 0xcb3f) AM_WRITE(williams2_bg_select_w) | |
| 647 | AM_RANGE(0xcb40, 0xcb5f) AM_WRITE(williams2_xscroll_low_w) | |
| 648 | AM_RANGE(0xcb60, 0xcb7f) AM_WRITE(williams2_xscroll_high_w) | |
| 649 | AM_RANGE(0xcb80, 0xcb9f) AM_WRITE(defender_video_control_w) | |
| 650 | AM_RANGE(0xcba0, 0xcbbf) AM_WRITE(williams2_blit_window_enable_w) | |
| 651 | AM_RANGE(0xcbe0, 0xcbef) AM_READ(williams2_video_counter_r) | |
| 652 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(MRA8_RAM, williams_cmos_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 653 | AM_RANGE(0xd000, 0xdfff) AM_RAM | |
| 654 | AM_RANGE(0xe000, 0xffff) AM_ROM | |
| 655 | ADDRESS_MAP_END | |
| 619 | 656 | |
| 657 | ||
| 658 | ||
| 620 | 659 | /************************************* |
| 621 | 660 | * |
| 622 | 661 | * Sound board memory handlers |
| r1591 | r1592 | |
| 1370 | 1409 | MDRV_CPU_ADD_TAG("main", M6809, MASTER_CLOCK/3/4) |
| 1371 | 1410 | MDRV_CPU_PROGRAM_MAP(defender_map,0) |
| 1372 | 1411 | |
| 1373 | MDRV_CPU_ADD_TAG("sound", M6808, SOUND_CLOCK | |
| 1412 | MDRV_CPU_ADD_TAG("sound", M6808, SOUND_CLOCK | |
| 1374 | 1413 | MDRV_CPU_PROGRAM_MAP(defender_sound_map,0) |
| 1375 | 1414 | |
| 1376 | 1415 | MDRV_MACHINE_RESET(defender) |
| r1591 | r1592 | |
| 1418 | 1457 | MACHINE_DRIVER_END |
| 1419 | 1458 | |
| 1420 | 1459 | |
| 1460 | static MACHINE_DRIVER_START( williams_extra_ram ) | |
| 1461 | ||
| 1462 | /* basic machine hardware */ | |
| 1463 | MDRV_IMPORT_FROM(williams) | |
| 1464 | ||
| 1465 | MDRV_CPU_MODIFY("main") | |
| 1466 | MDRV_CPU_PROGRAM_MAP(williams_extra_ram_map,0) | |
| 1467 | MACHINE_DRIVER_END | |
| 1468 | ||
| 1469 | ||
| 1421 | 1470 | static MACHINE_DRIVER_START( alienar ) |
| 1422 | 1471 | |
| 1423 | 1472 | /* basic machine hardware */ |
| r1591 | r1592 | |
| 1434 | 1483 | static MACHINE_DRIVER_START( sinistar ) |
| 1435 | 1484 | |
| 1436 | 1485 | /* basic machine hardware */ |
| 1437 | MDRV_IMPORT_FROM(williams) | |
| 1486 | MDRV_IMPORT_FROM(williams_extra_ram) | |
| 1438 | 1487 | |
| 1439 | 1488 | /* sound hardware */ |
| 1440 | 1489 | MDRV_SOUND_ADD(HC55516, 0) |
| r1591 | r1592 | |
| 1445 | 1494 | static MACHINE_DRIVER_START( playball ) |
| 1446 | 1495 | |
| 1447 | 1496 | /* basic machine hardware */ |
| 1448 | MDRV_IMPORT_FROM( | |
| 1497 | MDRV_IMPORT_FROM(willi | |
| 1449 | 1498 | |
| 1450 | 1499 | /* video hardware */ |
| 1451 | 1500 | MDRV_SCREEN_VISIBLE_AREA(6, 298-1, 8, 239-1) |
| 1501 | ||
| 1502 | /* sound hardware */ | |
| 1503 | MDRV_SOUND_ADD(HC55516, 0) | |
| 1504 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) | |
| 1452 | 1505 | MACHINE_DRIVER_END |
| 1453 | 1506 | |
| 1454 | 1507 | |
| r1591 | r1592 | |
| 1476 | 1529 | MDRV_CPU_ADD_TAG("main", M6809, MASTER_CLOCK/3/4) |
| 1477 | 1530 | MDRV_CPU_PROGRAM_MAP(williams2_map,0) |
| 1478 | 1531 | |
| 1479 | MDRV_CPU_ADD_TAG("sound", M6808, MASTER_CLOCK/3 | |
| 1532 | MDRV_CPU_ADD_TAG("sound", M6808, MASTER_CLOCK/3 | |
| 1480 | 1533 | MDRV_CPU_PROGRAM_MAP(williams2_sound_map,0) |
| 1481 | 1534 | |
| 1482 | 1535 | MDRV_MACHINE_RESET(williams2) |
| r1591 | r1592 | |
| 1502 | 1555 | MACHINE_DRIVER_END |
| 1503 | 1556 | |
| 1504 | 1557 | |
| 1558 | static MACHINE_DRIVER_START( williams2_extra_ram ) | |
| 1559 | ||
| 1560 | /* basic machine hardware */ | |
| 1561 | MDRV_IMPORT_FROM(williams2) | |
| 1562 | ||
| 1563 | MDRV_CPU_MODIFY("main") | |
| 1564 | MDRV_CPU_PROGRAM_MAP(williams2_extra_ram_map,0) | |
| 1565 | MACHINE_DRIVER_END | |
| 1566 | ||
| 1567 | ||
| 1505 | 1568 | static MACHINE_DRIVER_START( joust2 ) |
| 1506 | 1569 | |
| 1507 | 1570 | /* basic machine hardware */ |
| r1591 | r1592 | |
| 2593 | 2656 | { |
| 2594 | 2657 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0x7400); |
| 2595 | 2658 | CONFIGURE_PIAS(williams_49way_pia_0_intf, williams_pia_1_intf, sinistar_snd_pia_intf); |
| 2596 | ||
| 2597 | /* install clipping circuit control */ | |
| 2598 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc900, 0xc9ff, 0, 0, sinistar_vram_select_w); | |
| 2599 | ||
| 2600 | /* install RAM instead of ROM in the Dxxx slot */ | |
| 2601 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, MRA8_RAM); | |
| 2602 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, MWA8_RAM); | |
| 2603 | 2659 | } |
| 2604 | 2660 | |
| 2605 | 2661 | |
| r1591 | r1592 | |
| 2676 | 2732 | { |
| 2677 | 2733 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000); |
| 2678 | 2734 | CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_MYSTICM); |
| 2679 | CONFIGURE_PIAS(mysticm_pia_0_intf, williams2_pia_1_intf, williams2_snd_pia_intf); | |
| 2680 | ||
| 2681 | /* install RAM instead of ROM in the Dxxx slot */ | |
| 2682 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, MRA8_RAM); | |
| 2683 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, MWA8_RAM); | |
| 2735 | CONFIGURE_PIAS(mysticm_pia_0_intf, mysticm_pia_1_intf, williams2_snd_pia_intf); | |
| 2684 | 2736 | } |
| 2685 | 2737 | |
| 2686 | 2738 | |
| r1591 | r1592 | |
| 2688 | 2740 | { |
| 2689 | 2741 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000); |
| 2690 | 2742 | CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT); |
| 2691 | CONFIGURE_PIAS(tshoot_pia_0_intf, | |
| 2743 | CONFIGURE_PIAS(tshoot_pia_0_intf, t | |
| 2692 | 2744 | } |
| 2693 | 2745 | |
| 2694 | 2746 | |
| r1591 | r1592 | |
| 2697 | 2749 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000); |
| 2698 | 2750 | CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT); |
| 2699 | 2751 | CONFIGURE_PIAS(williams2_muxed_pia_0_intf, williams2_pia_1_intf, williams2_snd_pia_intf); |
| 2700 | ||
| 2701 | /* install RAM instead of ROM in the Dxxx slot */ | |
| 2702 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, MRA8_RAM); | |
| 2703 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, MWA8_RAM); | |
| 2704 | 2752 | } |
| 2705 | 2753 | |
| 2706 | 2754 | |
| r1591 | r1592 | |
| 2720 | 2768 | *************************************/ |
| 2721 | 2769 | |
| 2722 | 2770 | /* Defender hardware games */ |
| 2723 | GAME( 1980, defender, 0, defender, defender, defender, ROT0, "Williams", "Defender (Red label)", GAME_SUPPORTS_SAVE ) | |
| 2724 | GAME( 1980, defendg, defender, defender, defender, defender, ROT0, "Williams", "Defender (Green label)", GAME_SUPPORTS_SAVE ) | |
| 2725 | GAME( 1980, defendw, defender, defender, defender, defender, ROT0, "Williams", "Defender (White label)", GAME_SUPPORTS_SAVE ) | |
| 2726 | GAME( 1980, defndjeu, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Defender (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 2727 | GAME( 1980, tornado1, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Tornado (bootleg set 1)", GAME_SUPPORTS_SAVE ) | |
| 2728 | GAME( 1980, tornado2, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Tornado (bootleg set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // bad dump? | |
| 2729 | GAME( 1980, zero, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Zero", GAME_SUPPORTS_SAVE ) | |
| 2730 | GAME( 1980, zero2, defender, defender, defender, defndjeu, ROT0, "Amtec", "Zero (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2731 | GAME( 1980, defcmnd, defender, defender, defender, defender, ROT0, "bootleg", "Defense Command (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2732 | GAME( 1981, defence, defender, defender, defender, defender, ROT0, "Outer Limits", "Defence Command", GAME_SUPPORTS_SAVE ) | |
| 2733 | GAME( 1981, startrkd, defender, defender, defender, defender, ROT0, "bootleg", "Star Trek (Defender bootleg)", GAME_SUPPORTS_SAVE ) | |
| 2734 | GAME( 1980, mayday, 0, defender, mayday, mayday, ROT0, "<unknown>", "Mayday (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2735 | GAME( 1980, maydaya, mayday, defender, mayday, mayday, ROT0, "<unknown>", "Mayday (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2736 | GAME( 1980, maydayb, mayday, defender, mayday, mayday, ROT0, "<unknown>", "Mayday (set 3)", GAME_SUPPORTS_SAVE ) | |
| 2737 | GAME( 1981, colony7, 0, defender, colony7, defender, ROT270, "Taito", "Colony 7 (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2738 | GAME( 1981, colony7a, colony7, defender, colony7, defender, ROT270, "Taito", "Colony 7 (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2739 | GAME( 1982, jin, 0, jin, jin, defender, ROT90, "Falcon", "Jin", GAME_SUPPORTS_SAVE ) | |
| 2771 | GAME( 1980, defender, 0, defender, defender, defender, ROT0, "Williams", "Defender (Red label)", GAME_SUPPORTS_SAVE ) | |
| 2772 | GAME( 1980, defendg, defender, defender, defender, defender, ROT0, "Williams", "Defender (Green label)", GAME_SUPPORTS_SAVE ) | |
| 2773 | GAME( 1980, defendw, defender, defender, defender, defender, ROT0, "Williams", "Defender (White label)", GAME_SUPPORTS_SAVE ) | |
| 2774 | GAME( 1980, defndjeu, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Defender (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 2775 | GAME( 1980, tornado1, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Tornado (bootleg set 1)", GAME_SUPPORTS_SAVE ) | |
| 2776 | GAME( 1980, tornado2, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Tornado (bootleg set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // bad dump? | |
| 2777 | GAME( 1980, zero, defender, defender, defender, defndjeu, ROT0, "Jeutel", "Zero", GAME_SUPPORTS_SAVE ) | |
| 2778 | GAME( 1980, zero2, defender, defender, defender, defndjeu, ROT0, "Amtec", "Zero (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2779 | GAME( 1980, defcmnd, defender, defender, defender, defender, ROT0, "bootleg", "Defense Command (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2780 | GAME( 1981, defence, defender, defender, defender, defender, ROT0, "Outer Limits", "Defence Command", GAME_SUPPORTS_SAVE ) | |
| 2781 | GAME( 1981, startrkd, defender, defender, defender, defender, ROT0, "bootleg", "Star Trek (Defender bootleg)", GAME_SUPPORTS_SAVE ) | |
| 2782 | GAME( 1980, mayday, 0, defender, mayday, mayday, ROT0, "<unknown>", "Mayday (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2783 | GAME( 1980, maydaya, mayday, defender, mayday, mayday, ROT0, "<unknown>", "Mayday (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2784 | GAME( 1980, maydayb, mayday, defender, mayday, mayday, ROT0, "<unknown>", "Mayday (set 3)", GAME_SUPPORTS_SAVE ) | |
| 2785 | GAME( 1981, colony7, 0, defender, colony7, defender, ROT270, "Taito", "Colony 7 (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2786 | GAME( 1981, colony7a, colony7, defender, colony7, defender, ROT270, "Taito", "Colony 7 (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2787 | GAME( 1982, jin, 0, jin, jin, defender, ROT90, "Falcon", "Jin", GAME_SUPPORTS_SAVE ) | |
| 2740 | 2788 | |
| 2741 | 2789 | /* Standard Williams hardware */ |
| 2742 | GAME( 1981, stargate, 0, williams, stargate, stargate, ROT0, "Williams", "Stargate", GAME_SUPPORTS_SAVE ) | |
| 2743 | GAME( 1982, robotron, 0, williams, robotron, robotron, ROT0, "Williams", "Robotron (Solid Blue label)", GAME_SUPPORTS_SAVE ) | |
| 2744 | GAME( 1982, robotryo, robotron, williams, robotron, robotron, ROT0, "Williams", "Robotron (Yellow/Orange label)", GAME_SUPPORTS_SAVE ) | |
| 2745 | GAME( 1982, joust, 0, williams, joust, joust, ROT0, "Williams", "Joust (White/Green label)", GAME_SUPPORTS_SAVE ) | |
| 2746 | GAME( 1982, joustr, joust, williams, joust, joust, ROT0, "Williams", "Joust (Solid Red label)", GAME_SUPPORTS_SAVE ) | |
| 2747 | GAME( 1982, joustwr, joust, williams, joust, joust, ROT0, "Williams", "Joust (White/Red label)", GAME_SUPPORTS_SAVE ) | |
| 2748 | GAME( 1982, bubbles, 0, williams, bubbles, bubbles, ROT0, "Williams", "Bubbles", GAME_SUPPORTS_SAVE ) | |
| 2749 | GAME( 1982, bubblesr, bubbles, williams, bubbles, bubbles, ROT0, "Williams", "Bubbles (Solid Red label)", GAME_SUPPORTS_SAVE ) | |
| 2750 | GAME( 1982, bubblesp, bubbles, williams, bubbles, bubbles, ROT0, "Williams", "Bubbles (prototype version)", GAME_SUPPORTS_SAVE ) | |
| 2751 | GAME( 1982, splat, 0, williams, splat, splat, ROT0, "Williams", "Splat!", GAME_SUPPORTS_SAVE ) | |
| 2752 | GAME( 1982, sinistar, 0, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 3)", GAME_SUPPORTS_SAVE ) | |
| 2753 | GAME( 1982, sinista1, sinistar, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (prototype version)", GAME_SUPPORTS_SAVE ) | |
| 2754 | GAME( 1982, sinista2, sinistar, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 2)", GAME_SUPPORTS_SAVE ) | |
| 2755 | GAME( 1983, playball, 0, playball, playball, playball, ROT270, "Williams", "PlayBall! (prototype)", GAME_SUPPORTS_SAVE ) | |
| 2756 | GAME( 1983, blaster, 0, blaster, blaster, blaster, ROT0, "Williams", "Blaster", GAME_SUPPORTS_SAVE ) | |
| 2757 | GAME( 1983, blast30, blaster, blaster, blaster, blaster, ROT0, "Williams", "Blaster (early 30 wave version)", GAME_SUPPORTS_SAVE ) | |
| 2758 | GAME( 1983, blastkit, blaster, blaster, blastkit, blastkit, ROT0, "Williams", "Blaster (kit)", GAME_SUPPORTS_SAVE ) | |
| 2759 | GAME( 1985, spdball, 0, williams, spdball, spdball, ROT0, "Williams", "Speed Ball (prototype)", GAME_SUPPORTS_SAVE ) | |
| 2760 | GAME( 1985, alienar, 0, alienar, alienar, alienar, ROT0, "Duncan Brown", "Alien Arena", GAME_SUPPORTS_SAVE ) | |
| 2761 | GAME( 1985, alienaru, alienar, alienar, alienar, alienaru, ROT0, "Duncan Brown", "Alien Arena (Stargate Upgrade)", GAME_SUPPORTS_SAVE ) | |
| 2762 | GAME( 1987, lottofun, 0, williams, lottofun, lottofun, ROT0, "H.A.R. Management", "Lotto Fun", GAME_SUPPORTS_SAVE ) | |
| 2790 | GAME( 1981, stargate, 0, williams, stargate, stargate, ROT0, "Williams", "Stargate", GAME_SUPPORTS_SAVE ) | |
| 2791 | GAME( 1982, robotron, 0, williams, robotron, robotron, ROT0, "Williams", "Robotron (Solid Blue label)", GAME_SUPPORTS_SAVE ) | |
| 2792 | GAME( 1982, robotryo, robotron, williams, robotron, robotron, ROT0, "Williams", "Robotron (Yellow/Orange label)", GAME_SUPPORTS_SAVE ) | |
| 2793 | GAME( 1982, joust, 0, williams, joust, joust, ROT0, "Williams", "Joust (White/Green label)", GAME_SUPPORTS_SAVE ) | |
| 2794 | GAME( 1982, joustr, joust, williams, joust, joust, ROT0, "Williams", "Joust (Solid Red label)", GAME_SUPPORTS_SAVE ) | |
| 2795 | GAME( 1982, joustwr, joust, williams, joust, joust, ROT0, "Williams", "Joust (White/Red label)", GAME_SUPPORTS_SAVE ) | |
| 2796 | GAME( 1982, bubbles, 0, williams, bubbles, bubbles, ROT0, "Williams", "Bubbles", GAME_SUPPORTS_SAVE ) | |
| 2797 | GAME( 1982, bubblesr, bubbles, williams, bubbles, bubbles, ROT0, "Williams", "Bubbles (Solid Red label)", GAME_SUPPORTS_SAVE ) | |
| 2798 | GAME( 1982, bubblesp, bubbles, williams, bubbles, bubbles, ROT0, "Williams", "Bubbles (prototype version)", GAME_SUPPORTS_SAVE ) | |
| 2799 | GAME( 1982, splat, 0, williams, splat, splat, ROT0, "Williams", "Splat!", GAME_SUPPORTS_SAVE ) | |
| 2800 | GAME( 1982, sinistar, 0, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 3)", GAME_SUPPORTS_SAVE ) | |
| 2801 | GAME( 1982, sinista1, sinistar, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (prototype version)", GAME_SUPPORTS_SAVE ) | |
| 2802 | GAME( 1982, sinista2, sinistar, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 2)", GAME_SUPPORTS_SAVE ) | |
| 2803 | GAME( 1983, playball, 0, playball, playball, playball, ROT270, "Williams", "PlayBall! (prototype)", GAME_SUPPORTS_SAVE ) | |
| 2804 | GAME( 1983, blaster, 0, blaster, blaster, blaster, ROT0, "Williams", "Blaster", GAME_SUPPORTS_SAVE ) | |
| 2805 | GAME( 1983, blast30, blaster, blaster, blaster, blaster, ROT0, "Williams", "Blaster (early 30 wave version)", GAME_SUPPORTS_SAVE ) | |
| 2806 | GAME( 1983, blastkit, blaster, blaster, blastkit, blastkit, ROT0, "Williams", "Blaster (kit)", GAME_SUPPORTS_SAVE ) | |
| 2807 | GAME( 1985, spdball, 0, williams, spdball, spdball, ROT0, "Williams", "Speed Ball (prototype)", GAME_SUPPORTS_SAVE ) | |
| 2808 | GAME( 1985, alienar, 0, alienar, alienar, alienar, ROT0, "Duncan Brown", "Alien Arena", GAME_SUPPORTS_SAVE ) | |
| 2809 | GAME( 1985, alienaru, alienar, alienar, alienar, alienaru, ROT0, "Duncan Brown", "Alien Arena (Stargate Upgrade)", GAME_SUPPORTS_SAVE ) | |
| 2810 | GAME( 1987, lottofun, 0, williams, lottofun, lottofun, ROT0, "H.A.R. Management", "Lotto Fun", GAME_SUPPORTS_SAVE ) | |
| 2763 | 2811 | |
| 2764 | 2812 | /* 2nd Generation Williams hardware with tilemaps */ |
| 2765 | GAME( 1983, mysticm, 0, williams2,mysticm, mysticm, ROT0, "Williams", "Mystic Marathon", GAME_SUPPORTS_SAVE ) | |
| 2766 | GAME( 1984, tshoot, 0, williams2,tshoot, tshoot, ROT0, "Williams", "Turkey Shoot", GAME_SUPPORTS_SAVE ) | |
| 2767 | GAME( 1984, inferno, 0, williams2,inferno, inferno, ROT0, "Williams", "Inferno", GAME_SUPPORTS_SAVE ) | |
| 2768 | GAME( 1986, joust2, 0, joust2, joust2, joust2, ROT270, "Williams", "Joust 2 - Survival of the Fittest (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2813 | GAME( 1983, mysticm, 0, williams2_extra_ram, mysticm, mysticm, ROT0, "Williams", "Mystic Marathon", GAME_SUPPORTS_SAVE ) | |
| 2814 | GAME( 1984, tshoot, 0, williams2, tshoot, tshoot, ROT0, "Williams", "Turkey Shoot", GAME_SUPPORTS_SAVE ) | |
| 2815 | GAME( 1984, inferno, 0, williams2_extra_ram, inferno, inferno, ROT0, "Williams", "Inferno", GAME_SUPPORTS_SAVE ) | |
| 2816 | GAME( 1986, joust2, 0, joust2, joust2, joust2, ROT270, "Williams", "Joust 2 - Survival of the Fittest (set 1)", GAME_SUPPORTS_SAVE ) |
| r1591 | r1592 | |
|---|---|---|
| 538 | 538 | |
| 539 | 539 | static TIMER_CALLBACK( level_1_interrupt_callback ) |
| 540 | 540 | { |
| 541 | cpunum_set_input_line(0, 1, PULSE_LINE); | |
| 541 | cpunum_set_input_line(machine, 0, 1, PULSE_LINE); | |
| 542 | 542 | timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback); |
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | |
| 546 | 546 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 547 | 547 | { |
| 548 | cpunum_set_input_line(0, 3, PULSE_LINE); // VBlank IRQ | |
| 548 | cpunum_set_input_line(machine, 0, 3, PULSE_LINE); // VBlank IRQ | |
| 549 | 549 | timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback); |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | |
| 553 | 553 | static TIMER_CALLBACK( raster_interrupt_callback ) |
| 554 | 554 | { |
| 555 | cpunum_set_input_line(0, 5, PULSE_LINE); // Raster Line IRQ | |
| 555 | cpunum_set_input_line(machine, 0, 5, PULSE_LINE); // Raster Line IRQ | |
| 556 | 556 | video_screen_update_partial(0, video_screen_get_vpos(0)); |
| 557 | 557 | timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero); |
| 558 | 558 | } |
| r1591 | r1592 | |
| 574 | 574 | |
| 575 | 575 | static void irqhandler(int irq) |
| 576 | 576 | { |
| 577 | cpunum_set_input_line(1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 577 | cpunum_set_input_line(Machine, 1, 0, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | static const struct YMF278B_interface ymf278b_interface = |
| r1591 | r1592 | |
|---|---|---|
| 237 | 237 | switch (offset) { |
| 238 | 238 | case 0: /* High byte */ |
| 239 | 239 | i8751_value=(i8751_value&0xff) | (data<<8); |
| 240 | if (int_enable) cpunum_set_input_line (0, M6809_IRQ_LINE, HOLD_LINE); /* IRQ on *high* byte only */ | |
| 240 | if (int_enable) cpunum_set_input_line (Machine, 0, M6809_IRQ_LINE, HOLD_LINE); /* IRQ on *high* byte only */ | |
| 241 | 241 | break; |
| 242 | 242 | case 1: /* Low byte */ |
| 243 | 243 | i8751_value=(i8751_value&0xff00) | data; |
| r1591 | r1592 | |
| 270 | 270 | switch (offset) { |
| 271 | 271 | case 0: /* High byte */ |
| 272 | 272 | i8751_value=(i8751_value&0xff) | (data<<8); |
| 273 | cpunum_set_input_line (1, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */ | |
| 273 | cpunum_set_input_line (Machine, 1, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */ | |
| 274 | 274 | break; |
| 275 | 275 | case 1: /* Low byte */ |
| 276 | 276 | i8751_value=(i8751_value&0xff00) | data; |
| r1591 | r1592 | |
| 298 | 298 | switch (offset) { |
| 299 | 299 | case 0: /* High byte */ |
| 300 | 300 | i8751_value=(i8751_value&0xff) | (data<<8); |
| 301 | cpunum_set_input_line (0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */ | |
| 301 | cpunum_set_input_line (Machine, 0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */ | |
| 302 | 302 | break; |
| 303 | 303 | case 1: /* Low byte */ |
| 304 | 304 | i8751_value=(i8751_value&0xff00) | data; |
| r1591 | r1592 | |
| 329 | 329 | switch (offset) { |
| 330 | 330 | case 0: /* High byte */ |
| 331 | 331 | i8751_value=(i8751_value&0xff) | (data<<8); |
| 332 | cpunum_set_input_line (0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */ | |
| 332 | cpunum_set_input_line (Machine, 0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */ | |
| 333 | 333 | break; |
| 334 | 334 | case 1: /* Low byte */ |
| 335 | 335 | i8751_value=(i8751_value&0xff00) | data; |
| r1591 | r1592 | |
| 426 | 426 | static WRITE8_HANDLER( dec8_sound_w ) |
| 427 | 427 | { |
| 428 | 428 | soundlatch_w(0,data); |
| 429 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 429 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | static WRITE8_HANDLER( oscar_sound_w ) |
| 433 | 433 | { |
| 434 | 434 | soundlatch_w(0,data); |
| 435 | cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 435 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | static void csilver_adpcm_int(int data) |
| r1591 | r1592 | |
| 441 | 441 | |
| 442 | 442 | toggle ^= 1; |
| 443 | 443 | if (toggle) |
| 444 | cpunum_set_input_line(2,M6502_IRQ_LINE,HOLD_LINE); | |
| 444 | cpunum_set_input_line(Machine, 2,M6502_IRQ_LINE,HOLD_LINE); | |
| 445 | 445 | |
| 446 | 446 | MSM5205_data_w (0,msm5205next>>4); |
| 447 | 447 | msm5205next<<=4; |
| r1591 | r1592 | |
| 473 | 473 | /* Deal with interrupts, coins also generate NMI to CPU 0 */ |
| 474 | 474 | switch (offset) { |
| 475 | 475 | case 0: /* IRQ2 */ |
| 476 | cpunum_set_input_line(1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 476 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 477 | 477 | return; |
| 478 | 478 | case 1: /* IRC 1 */ |
| 479 | cpunum_set_input_line(0,M6809_IRQ_LINE,CLEAR_LINE); | |
| 479 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,CLEAR_LINE); | |
| 480 | 480 | return; |
| 481 | 481 | case 2: /* IRQ 1 */ |
| 482 | cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 482 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 483 | 483 | return; |
| 484 | 484 | case 3: /* IRC 2 */ |
| 485 | cpunum_set_input_line(1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 485 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 486 | 486 | return; |
| 487 | 487 | } |
| 488 | 488 | } |
| r1591 | r1592 | |
| 496 | 496 | (The last interrupt has not finished and been ack'd when the new one occurs */ |
| 497 | 497 | switch (offset) { |
| 498 | 498 | case 0: /* CPU 2 - IRQ acknowledge */ |
| 499 | cpunum_set_input_line(1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 499 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE); | |
| 500 | 500 | return; |
| 501 | 501 | case 1: /* CPU 1 - IRQ acknowledge */ |
| 502 | cpunum_set_input_line(0,M6809_IRQ_LINE,CLEAR_LINE); | |
| 502 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,CLEAR_LINE); | |
| 503 | 503 | return; |
| 504 | 504 | case 2: /* i8751 - FIRQ acknowledge */ |
| 505 | 505 | return; |
| 506 | 506 | case 3: /* IRQ 1 */ |
| 507 | cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 507 | cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE); | |
| 508 | 508 | return; |
| 509 | 509 | case 4: /* IRQ 2 */ |
| 510 | cpunum_set_input_line(1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 510 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE); | |
| 511 | 511 | return; |
| 512 | 512 | } |
| 513 | 513 | #endif |
| r1591 | r1592 | |
| 520 | 520 | case 2: /* i8751 - FIRQ acknowledge */ |
| 521 | 521 | return; |
| 522 | 522 | case 3: /* IRQ 1 */ |
| 523 | cpunum_set_input_line (0, M6809_IRQ_LINE, HOLD_LINE); | |
| 523 | cpunum_set_input_line (Machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 524 | 524 | return; |
| 525 | 525 | case 4: /* IRQ 2 */ |
| 526 | cpunum_set_input_line (1, M6809_IRQ_LINE, HOLD_LINE); | |
| 526 | cpunum_set_input_line (Machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 527 | 527 | return; |
| 528 | 528 | } |
| 529 | 529 | } |
| r1591 | r1592 | |
| 541 | 541 | AM_RANGE(0x0800, 0x0fff) AM_READ(dec8_pf0_data_r) |
| 542 | 542 | AM_RANGE(0x1000, 0x17ff) AM_READ(dec8_pf1_data_r) |
| 543 | 543 | AM_RANGE(0x1800, 0x2fff) AM_READ(MRA8_RAM) |
| 544 | AM_RANGE(0x3000, 0x31ff) AM_READ( | |
| 544 | AM_RANGE(0x3000, 0x31ff) AM_READ(MRA8 | |
| 545 | 545 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r) /* Player 1 */ |
| 546 | 546 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_1_r) /* Player 2 */ |
| 547 | 547 | AM_RANGE(0x3802, 0x3802) AM_READ(input_port_3_r) /* Dip 1 */ |
| r1591 | r1592 | |
| 636 | 636 | AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_RAM) |
| 637 | 637 | AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM) |
| 638 | 638 | AM_RANGE(0x2000, 0x27ff) AM_READ(dec8_pf0_data_r) |
| 639 | AM_RANGE(0x2800, 0x2bff) AM_READ(paletteram_r) | |
| 640 | AM_RANGE(0x2c00, 0x2fff) AM_READ(paletteram_2_r) | |
| 639 | AM_RANGE(0x2800, 0x2bff) AM_READ(MRA8_RAM) | |
| 640 | AM_RANGE(0x2c00, 0x2fff) AM_READ(MRA8_RAM) | |
| 641 | 641 | AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) /* Sprites */ |
| 642 | 642 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_7_r) /* Dip 1 */ |
| 643 | 643 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_8_r) /* Dip 2 */ |
| r1591 | r1592 | |
| 672 | 672 | AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM) |
| 673 | 673 | AM_RANGE(0x2800, 0x2fff) AM_READ(dec8_pf0_data_r) |
| 674 | 674 | AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) /* Sprites */ |
| 675 | AM_RANGE(0x3800, 0x3bff) AM_READ( | |
| 675 | AM_RANGE(0x3800, 0x3bff) AM_READ(MRA8 | |
| 676 | 676 | AM_RANGE(0x3c00, 0x3c00) AM_READ(input_port_0_r) |
| 677 | 677 | AM_RANGE(0x3c01, 0x3c01) AM_READ(input_port_1_r) |
| 678 | 678 | AM_RANGE(0x3c02, 0x3c02) AM_READ(input_port_2_r) /* VBL & coins */ |
| r1591 | r1592 | |
| 716 | 716 | |
| 717 | 717 | static ADDRESS_MAP_START( lastmiss_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 718 | 718 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1) |
| 719 | AM_RANGE(0x1000, 0x13ff) AM_READ(paletteram_r) | |
| 720 | AM_RANGE(0x1400, 0x17ff) AM_READ(paletteram_2_r) | |
| 719 | AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(3) | |
| 720 | AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(4) | |
| 721 | 721 | AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r) |
| 722 | 722 | AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r) |
| 723 | 723 | AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r) |
| r1591 | r1592 | |
| 735 | 735 | |
| 736 | 736 | static ADDRESS_MAP_START( lastmiss_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 737 | 737 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_SHARE(1) |
| 738 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 739 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 738 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE(3) AM_BASE(&paletteram) | |
| 739 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE(4) AM_BASE(&paletteram_2) | |
| 740 | 740 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
| 741 | 741 | AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */ |
| 742 | 742 | AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w) |
| r1591 | r1592 | |
| 754 | 754 | |
| 755 | 755 | static ADDRESS_MAP_START( lastmiss_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 756 | 756 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1) |
| 757 | AM_RANGE(0x1000, 0x13ff) AM_READ(paletteram_r) | |
| 758 | AM_RANGE(0x1400, 0x17ff) AM_READ(paletteram_2_r) | |
| 757 | AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(3) | |
| 758 | AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(4) | |
| 759 | 759 | AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r) |
| 760 | 760 | AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r) |
| 761 | 761 | AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r) |
| r1591 | r1592 | |
| 769 | 769 | |
| 770 | 770 | static ADDRESS_MAP_START( lastmiss_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 771 | 771 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_SHARE(1) |
| 772 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) | |
| 773 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) | |
| 772 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE(3) | |
| 773 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE(4) | |
| 774 | 774 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
| 775 | 775 | AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */ |
| 776 | 776 | AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w) |
| r1591 | r1592 | |
| 784 | 784 | |
| 785 | 785 | static ADDRESS_MAP_START( shackled_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 786 | 786 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1) |
| 787 | AM_RANGE(0x1000, 0x13ff) AM_READ(paletteram_r) | |
| 788 | AM_RANGE(0x1400, 0x17ff) AM_READ(paletteram_2_r) | |
| 787 | AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(3) | |
| 788 | AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(4) | |
| 789 | 789 | AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r) |
| 790 | 790 | AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r) |
| 791 | 791 | AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r) |
| r1591 | r1592 | |
| 801 | 801 | |
| 802 | 802 | static ADDRESS_MAP_START( shackled_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 803 | 803 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_SHARE(1) |
| 804 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 805 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 804 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE(3) AM_BASE(&paletteram) | |
| 805 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE(4) AM_BASE(&paletteram_2) | |
| 806 | 806 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
| 807 | 807 | AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */ |
| 808 | 808 | AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w) |
| r1591 | r1592 | |
| 819 | 819 | |
| 820 | 820 | static ADDRESS_MAP_START( shackled_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 821 | 821 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1) |
| 822 | AM_RANGE(0x1000, 0x13ff) AM_READ(paletteram_r) | |
| 823 | AM_RANGE(0x1400, 0x17ff) AM_READ(paletteram_2_r) | |
| 822 | AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(3) | |
| 823 | AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(4) | |
| 824 | 824 | AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r) |
| 825 | 825 | AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r) |
| 826 | 826 | AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r) |
| r1591 | r1592 | |
| 837 | 837 | |
| 838 | 838 | static ADDRESS_MAP_START( shackled_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 839 | 839 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_SHARE(1) |
| 840 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) | |
| 841 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) | |
| 840 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE(3) | |
| 841 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE(4) | |
| 842 | 842 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
| 843 | 843 | AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */ |
| 844 | 844 | AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w) |
| r1591 | r1592 | |
| 856 | 856 | |
| 857 | 857 | static ADDRESS_MAP_START( csilver_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 858 | 858 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1) |
| 859 | AM_RANGE(0x1000, 0x13ff) AM_READ(paletteram_r) | |
| 860 | AM_RANGE(0x1400, 0x17ff) AM_READ(paletteram_2_r) | |
| 859 | AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(3) | |
| 860 | AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(4) | |
| 861 | 861 | AM_RANGE(0x1800, 0x1800) AM_READ(input_port_1_r) |
| 862 | 862 | AM_RANGE(0x1801, 0x1801) AM_READ(input_port_0_r) |
| 863 | 863 | AM_RANGE(0x1803, 0x1803) AM_READ(input_port_2_r) |
| r1591 | r1592 | |
| 875 | 875 | |
| 876 | 876 | static ADDRESS_MAP_START( csilver_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 877 | 877 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_SHARE(1) |
| 878 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) | |
| 879 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) | |
| 878 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE(3) AM_BASE(&paletteram) | |
| 879 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE(4) AM_BASE(&paletteram_2) | |
| 880 | 880 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
| 881 | 881 | AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */ |
| 882 | 882 | AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w) |
| r1591 | r1592 | |
| 893 | 893 | |
| 894 | 894 | static ADDRESS_MAP_START( csilver_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 895 | 895 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1) |
| 896 | AM_RANGE(0x1000, 0x13ff) AM_READ(paletteram_r) | |
| 897 | AM_RANGE(0x1400, 0x17ff) AM_READ(paletteram_2_r) | |
| 896 | AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(3) | |
| 897 | AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(4) | |
| 898 | 898 | AM_RANGE(0x1803, 0x1803) AM_READ(input_port_2_r) |
| 899 | 899 | AM_RANGE(0x1804, 0x1804) AM_READ(input_port_4_r) |
| 900 | 900 | AM_RANGE(0x1805, 0x1805) AM_READ(input_port_3_r) |
| r1591 | r1592 | |
| 907 | 907 | |
| 908 | 908 | static ADDRESS_MAP_START( csilver_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 909 | 909 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_SHARE(1) |
| 910 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) | |
| 911 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) | |
| 910 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE(3) | |
| 911 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE(4) | |
| 912 | 912 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
| 913 | 913 | AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */ |
| 914 | 914 | AM_RANGE(0x180c, 0x180c) AM_WRITE(oscar_sound_w) |
| r1591 | r1592 | |
| 923 | 923 | AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_RAM) |
| 924 | 924 | AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM) |
| 925 | 925 | AM_RANGE(0x2000, 0x27ff) AM_READ(dec8_pf0_data_r) |
| 926 | AM_RANGE(0x2800, 0x2bff) AM_READ(paletteram_r) | |
| 927 | AM_RANGE(0x2c00, 0x2fff) AM_READ(paletteram_2_r) | |
| 926 | AM_RANGE(0x2800, 0x2bff) AM_READ(MRA8_RAM) | |
| 927 | AM_RANGE(0x2c00, 0x2fff) AM_READ(MRA8_RAM) | |
| 928 | 928 | AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) /* Sprites */ |
| 929 | 929 | AM_RANGE(0x3800, 0x3800) AM_READ(input_port_3_r) /* Dip 1 */ |
| 930 | 930 | AM_RANGE(0x3801, 0x3801) AM_READ(input_port_4_r) /* Dip 2 */ |
| r1591 | r1592 | |
| 2011 | 2011 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 2012 | 2012 | static void irqhandler(int linestate) |
| 2013 | 2013 | { |
| 2014 | cpunum_set_input_line(1,0,linestate); /* M6502_IRQ_LINE */ | |
| 2014 | cpunum_set_input_line(Machine, 1,0,linestate); /* M6502_IRQ_LINE */ | |
| 2015 | 2015 | } |
| 2016 | 2016 | |
| 2017 | 2017 | static void oscar_irqhandler(int linestate) |
| 2018 | 2018 | { |
| 2019 | cpunum_set_input_line(2,0,linestate); /* M6502_IRQ_LINE */ | |
| 2019 | cpunum_set_input_line(Machine, 2,0,linestate); /* M6502_IRQ_LINE */ | |
| 2020 | 2020 | } |
| 2021 | 2021 | |
| 2022 | 2022 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
| 2053 | 2053 | if ((i8751_out & 0x2) == 0x2) latch[2]=1; |
| 2054 | 2054 | if ((i8751_out & 0x1) == 0x1) latch[3]=1; |
| 2055 | 2055 | |
| 2056 | if (((i8751_out & 0x8) != 0x8) && latch[0]) {latch[0]=0; cpunum_set_input_line(0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x8001; } /* Player 1 coin */ | |
| 2057 | if (((i8751_out & 0x4) != 0x4) && latch[1]) {latch[1]=0; cpunum_set_input_line(0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x4001; } /* Player 2 coin */ | |
| 2058 | if (((i8751_out & 0x2) != 0x2) && latch[2]) {latch[2]=0; cpunum_set_input_line(0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x2001; } /* Player 3 coin */ | |
| 2059 | if (((i8751_out & 0x1) != 0x1) && latch[3]) {latch[3]=0; cpunum_set_input_line(0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x1001; } /* Service */ | |
| 2056 | if (((i8751_out & 0x8) != 0x8) && latch[0]) {latch[0]=0; cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x8001; } /* Player 1 coin */ | |
| 2057 | if (((i8751_out & 0x4) != 0x4) && latch[1]) {latch[1]=0; cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x4001; } /* Player 2 coin */ | |
| 2058 | if (((i8751_out & 0x2) != 0x2) && latch[2]) {latch[2]=0; cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x2001; } /* Player 3 coin */ | |
| 2059 | if (((i8751_out & 0x1) != 0x1) && latch[3]) {latch[3]=0; cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,HOLD_LINE); i8751_return=0x1001; } /* Service */ | |
| 2060 | 2060 | |
| 2061 | if (nmi_enable) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); /* VBL */ | |
| 2061 | if (nmi_enable) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* VBL */ | |
| 2062 | 2062 | } |
| 2063 | 2063 | |
| 2064 | 2064 | static INTERRUPT_GEN( gondo_interrupt ) |
| 2065 | 2065 | { |
| 2066 | 2066 | if (nmi_enable) |
| 2067 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); /* VBL */ | |
| 2067 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* VBL */ | |
| 2068 | 2068 | } |
| 2069 | 2069 | |
| 2070 | 2070 | /* Coins generate NMI's */ |
| r1591 | r1592 | |
| 2075 | 2075 | if ((readinputport(2) & 0x7) == 0x7) latch=1; |
| 2076 | 2076 | if (latch && (readinputport(2) & 0x7) != 0x7) { |
| 2077 | 2077 | latch=0; |
| 2078 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 2078 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 2079 | 2079 | } |
| 2080 | 2080 | } |
| 2081 | 2081 | |
| r1591 | r1592 | |
| 2123 | 2123 | static MACHINE_DRIVER_START( ghostb ) |
| 2124 | 2124 | |
| 2125 | 2125 | /* basic machine hardware */ |
| 2126 | MDRV_CPU_ADD(HD6309, 3000000) | |
| 2126 | MDRV_CPU_ADD(HD6309, 3000000*4) | |
| 2127 | 2127 | MDRV_CPU_PROGRAM_MAP(ghostb_readmem,ghostb_writemem) |
| 2128 | 2128 | MDRV_CPU_VBLANK_INT(ghostb_interrupt,1) |
| 2129 | 2129 | |
| r1591 | r1592 | |
| 2203 | 2203 | static MACHINE_DRIVER_START( gondo ) |
| 2204 | 2204 | |
| 2205 | 2205 | /* basic machine hardware */ |
| 2206 | MDRV_CPU_ADD(HD6309,3000000) /* HD63C09EP */ | |
| 2206 | MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP */ | |
| 2207 | 2207 | MDRV_CPU_PROGRAM_MAP(gondo_readmem,gondo_writemem) |
| 2208 | 2208 | MDRV_CPU_VBLANK_INT(gondo_interrupt,1) |
| 2209 | 2209 | |
| r1591 | r1592 | |
| 2243 | 2243 | static MACHINE_DRIVER_START( oscar ) |
| 2244 | 2244 | |
| 2245 | 2245 | /* basic machine hardware */ |
| 2246 | MDRV_CPU_ADD(HD6309, XTAL_12MHz/ | |
| 2246 | MDRV_CPU_ADD(HD6309, XTAL_12MHz/2) /* verified on pcb */ | |
| 2247 | 2247 | MDRV_CPU_PROGRAM_MAP(oscar_readmem,oscar_writemem) |
| 2248 | 2248 | MDRV_CPU_VBLANK_INT(oscar_interrupt,1) |
| 2249 | 2249 | |
| 2250 | MDRV_CPU_ADD(HD6309, XTAL_12MHz/ | |
| 2250 | MDRV_CPU_ADD(HD6309, XTAL_12MHz/2) /* verified on pcb */ | |
| 2251 | 2251 | MDRV_CPU_PROGRAM_MAP(oscar_sub_readmem,oscar_sub_writemem) |
| 2252 | 2252 | |
| 2253 | 2253 | MDRV_CPU_ADD(M6502, XTAL_12MHz/8) |
| r1591 | r1592 | |
| 2417 | 2417 | static MACHINE_DRIVER_START( garyoret ) |
| 2418 | 2418 | |
| 2419 | 2419 | /* basic machine hardware */ |
| 2420 | MDRV_CPU_ADD(HD6309,3000000) /* HD63C09EP */ | |
| 2420 | MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP */ | |
| 2421 | 2421 | MDRV_CPU_PROGRAM_MAP(garyoret_readmem,garyoret_writemem) |
| 2422 | 2422 | MDRV_CPU_VBLANK_INT(gondo_interrupt,1) |
| 2423 | 2423 | |
| r1591 | r1592 | |
| 3407 | 3407 | |
| 3408 | 3408 | static DRIVER_INIT( ghostb ) |
| 3409 | 3409 | { |
| 3410 | driver_init_deco222(machine); | |
| 3411 | driver_init_meikyuh(machine); | |
| 3410 | DRIVER_INIT_CALL(deco222); | |
| 3411 | DRIVER_INIT_CALL(meikyuh); | |
| 3412 | 3412 | } |
| 3413 | 3413 | |
| 3414 | 3414 | /******************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 86 | 86 | static WRITE8_HANDLER( tbowl_sound_command_w ) |
| 87 | 87 | { |
| 88 | 88 | soundlatch_w(offset,data); |
| 89 | cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE); | |
| 89 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| r1591 | r1592 | |
| 151 | 151 | static WRITE8_HANDLER ( tbowl_trigger_nmi ) |
| 152 | 152 | { |
| 153 | 153 | /* trigger NMI on 6206B's Cpu? (guess but seems to work..) */ |
| 154 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 154 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | static ADDRESS_MAP_START( readmem_6206C, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
| 557 | 557 | |
| 558 | 558 | static void irqhandler(int linestate) |
| 559 | 559 | { |
| 560 | cpunum_set_input_line(2,0,linestate); | |
| 560 | cpunum_set_input_line(Machine, 2,0,linestate); | |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | static const struct YM3526interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 59 | 59 | /* |
| 60 | 60 | if (~battlane_cpu_control & 0x08) |
| 61 | 61 | { |
| 62 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 63 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 62 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 63 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 64 | 64 | } |
| 65 | 65 | */ |
| 66 | 66 | |
| r1591 | r1592 | |
| 68 | 68 | CPU2's SWI will trigger an 6809 IRQ on the master by resetting 0x04 |
| 69 | 69 | Master will respond by setting the bit back again |
| 70 | 70 | */ |
| 71 | cpunum_set_input_line(0, M6809_IRQ_LINE, data & 0x04 ? CLEAR_LINE : HOLD_LINE); | |
| 71 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, data & 0x04 ? CLEAR_LINE : HOLD_LINE); | |
| 72 | 72 | |
| 73 | 73 | /* |
| 74 | 74 | Slave function call (e.g. ROM test): |
| r1591 | r1592 | |
| 86 | 86 | FA96: 27 FA BEQ $FA92 ; Wait for bit to be set |
| 87 | 87 | */ |
| 88 | 88 | |
| 89 | cpunum_set_input_line(1, M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE); | |
| 89 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static ADDRESS_MAP_START( battlane_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1591 | r1592 | |
| 110 | 110 | |
| 111 | 111 | if (~battlane_cpu_control & 0x08) |
| 112 | 112 | { |
| 113 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 114 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 113 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 114 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| r1591 | r1592 | |
| 243 | 243 | |
| 244 | 244 | static void irqhandler(int irq) |
| 245 | 245 | { |
| 246 | cpunum_set_input_line(0, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 246 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
|---|---|---|
| 54 | 54 | * |
| 55 | 55 | *************************************/ |
| 56 | 56 | |
| 57 | static void update_interrupts( | |
| 57 | static void update_interrupts(running_machine *machine) | |
| 58 | 58 | { |
| 59 | 59 | int newstate = 0; |
| 60 | 60 | |
| r1591 | r1592 | |
| 66 | 66 | newstate = 6; |
| 67 | 67 | |
| 68 | 68 | if (newstate) |
| 69 | cpunum_set_input_line(0, newstate, ASSERT_LINE); | |
| 69 | cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE); | |
| 70 | 70 | else |
| 71 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 71 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 |
| r1591 | r1592 | |
|---|---|---|
| 109 | 109 | AM_RANGE(0x500000, 0x50ffff) AM_RAM |
| 110 | 110 | AM_RANGE(0x940000, 0x940fff) AM_RAM AM_BASE(&gms_vidram2) |
| 111 | 111 | AM_RANGE(0x980300, 0x983fff) AM_RAM // 0x2048 words ???, byte access |
| 112 | AM_RANGE(0x900000, 0x900fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) | |
| 113 | AM_READ(paletteram16_word_r) AM_BASE(&paletteram16) | |
| 112 | AM_RANGE(0x900000, 0x900fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 114 | 113 | AM_RANGE(0x9c0000, 0x9c0fff) AM_RAM AM_BASE(&gms_vidram) |
| 115 | 114 | AM_RANGE(0xb00000, 0xb00001) AM_WRITE(eeprom_w) |
| 116 | AM_RANGE(0xC00000, 0xC00001) AM_READ(input_port_0_word_r) | |
| 117 | AM_WRITE(gms_write1) | |
| 118 | AM_RANGE(0xC08000, 0xC08001) AM_READ(input_port_1_word_r) | |
| 119 | AM_WRITE(gms_write2) | |
| 115 | AM_RANGE(0xC00000, 0xC00001) AM_READ(input_port_0_word_r) AM_WRITE(gms_write1) | |
| 116 | AM_RANGE(0xC08000, 0xC08001) AM_READ(input_port_1_word_r) AM_WRITE(gms_write2) | |
| 120 | 117 | AM_RANGE(0xC10000, 0xC10001) AM_READ(eeprom_r) |
| 121 | 118 | AM_RANGE(0xC18080, 0xC18081) AM_READ(gms_read) |
| 122 | 119 | AM_RANGE(0xC20000, 0xC20001) AM_READ(input_port_2_word_r) |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | ******************************************************************************/ |
| 68 | 68 | |
| 69 | 69 | /* call this whenever the interrupt state has changed */ |
| 70 | static void update_interrupts( | |
| 70 | static void update_interrupts(running_machine *machine) | |
| 71 | 71 | { |
| 72 | 72 | int level = 0; |
| 73 | 73 | |
| r1591 | r1592 | |
| 78 | 78 | |
| 79 | 79 | /* either set or clear the appropriate lines */ |
| 80 | 80 | if (level) |
| 81 | cpunum_set_input_line(0, level, ASSERT_LINE); | |
| 81 | cpunum_set_input_line(machine, 0, level, ASSERT_LINE); | |
| 82 | 82 | else |
| 83 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 83 | cpunum_set_input_line(machine, 0, 7, CLEAR_LINE); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| r1591 | r1592 | |
| 88 | 88 | static TIMER_CALLBACK( vdp_int4_off ) |
| 89 | 89 | { |
| 90 | 90 | scanline_int = 0; |
| 91 | update_interrupts(); | |
| 91 | update_interrupts(machine); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| r1591 | r1592 | |
| 102 | 102 | if (scanline != 0 || genesis_vdp_regs[10] == 0) |
| 103 | 103 | { |
| 104 | 104 | scanline_int = 1; |
| 105 | update_interrupts(); | |
| 105 | update_interrupts(machine); | |
| 106 | 106 | timer_set(video_screen_get_time_until_pos(0, scanline + 1, 0), NULL, 0, vdp_int4_off); |
| 107 | 107 | } |
| 108 | 108 | |
| r1591 | r1592 | |
| 122 | 122 | static TIMER_CALLBACK( vdp_int6_off ) |
| 123 | 123 | { |
| 124 | 124 | vblank_int = 0; |
| 125 | update_interrupts(); | |
| 125 | update_interrupts(machine); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| r1591 | r1592 | |
| 131 | 131 | { |
| 132 | 132 | /* generate the interrupt */ |
| 133 | 133 | vblank_int = 1; |
| 134 | update_interrupts(); | |
| 134 | update_interrupts(machine); | |
| 135 | 135 | |
| 136 | 136 | /* set a timer to turn it off */ |
| 137 | 137 | timer_set(video_screen_get_time_until_pos(0, video_screen_get_vpos(0), 22), NULL, 0, vdp_int6_off); |
| r1591 | r1592 | |
| 142 | 142 | void genesis_irq2_interrupt(int state) |
| 143 | 143 | { |
| 144 | 144 | irq2_int = state; |
| 145 | update_interrupts(); | |
| 145 | update_interrupts(Machine); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| r1591 | r1592 | |
| 164 | 164 | genesis_z80_ram[0] = 0x76; |
| 165 | 165 | genesis_z80_ram[0x38] = 0x76; |
| 166 | 166 | |
| 167 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 167 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 168 | 168 | |
| 169 | 169 | z80running = 0; |
| 170 | 170 | } |
| r1591 | r1592 | |
| 216 | 216 | if (data == 0x100) |
| 217 | 217 | { |
| 218 | 218 | z80running = 0; |
| 219 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); /* halt Z80 */ | |
| 219 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); /* halt Z80 */ | |
| 220 | 220 | /* logerror("z80 stopped by 68k BusReq\n"); */ |
| 221 | 221 | } |
| 222 | 222 | else |
| r1591 | r1592 | |
| 224 | 224 | z80running = 1; |
| 225 | 225 | // memory_set_bankptr(1, &genesis_z80_ram[0]); |
| 226 | 226 | |
| 227 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 227 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 228 | 228 | /* logerror("z80 started, BusReq ends\n"); */ |
| 229 | 229 | } |
| 230 | 230 | return; |
| r1591 | r1592 | |
| 232 | 232 | case 0x100: /* Z80 CPU Reset */ |
| 233 | 233 | if (data == 0x00) |
| 234 | 234 | { |
| 235 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 236 | cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE); | |
| 235 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 236 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); | |
| 237 | 237 | |
| 238 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 238 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 239 | 239 | /* logerror("z80 reset, ram is %p\n", &genesis_z80_ram[0]); */ |
| 240 | 240 | z80running = 0; |
| 241 | 241 | return; |
| r1591 | r1592 | |
|---|---|---|
| 184 | 184 | { |
| 185 | 185 | if(activecpu_get_previouspc()==0x29e9)// || activecpu_get_previouspc()==0x1b3f) //29f5 |
| 186 | 186 | { |
| 187 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 187 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 188 | 188 | } |
| 189 | 189 | // else |
| 190 | 190 | // printf("%x \n", activecpu_get_previouspc()); |
| r1591 | r1592 | |
|---|---|---|
| 140 | 140 | /* assert the IRQ if not already asserted */ |
| 141 | 141 | if (!irq_state) |
| 142 | 142 | { |
| 143 | cpunum_set_input_line(0, 0, ASSERT_LINE); | |
| 143 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 144 | 144 | irq_state = 1; |
| 145 | 145 | } |
| 146 | 146 | |
| r1591 | r1592 | |
| 211 | 211 | |
| 212 | 212 | static MACHINE_RESET( cloud9 ) |
| 213 | 213 | { |
| 214 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 214 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 215 | 215 | irq_state = 0; |
| 216 | 216 | } |
| 217 | 217 | |
| r1591 | r1592 | |
| 227 | 227 | { |
| 228 | 228 | if (irq_state) |
| 229 | 229 | { |
| 230 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 230 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 231 | 231 | irq_state = 0; |
| 232 | 232 | } |
| 233 | 233 | } |
| r1591 | r1592 | |
|---|---|---|
| 146 | 146 | static void ym2151_irq_gen(int state) |
| 147 | 147 | { |
| 148 | 148 | ym2151_irq = state; |
| 149 | cpunum_set_input_line(1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
| 149 | cpunum_set_input_line(Machine, 1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| r1591 | r1592 | |
| 180 | 180 | { |
| 181 | 181 | sound_busy = 1; |
| 182 | 182 | sound_data = param; |
| 183 | cpunum_set_input_line(1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
| 183 | cpunum_set_input_line(machine, 1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
| r1591 | r1592 | |
| 194 | 194 | static READ8_HANDLER( sound_command_r ) |
| 195 | 195 | { |
| 196 | 196 | sound_busy = 0; |
| 197 | cpunum_set_input_line(1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
| 197 | cpunum_set_input_line(Machine, 1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
| 198 | 198 | return sound_data; |
| 199 | 199 | } |
| 200 | 200 |
| r1591 | r1592 | |
|---|---|---|
| 465 | 465 | |
| 466 | 466 | // video_screen_update_partial(0, video_screen_get_vpos(0)); |
| 467 | 467 | |
| 468 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, vector); | |
| 468 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, vector); | |
| 469 | 469 | |
| 470 | 470 | /* it seems the V8 == Vblank and it is connected to the INT on the 68705 */ |
| 471 | 471 | //so we should cause an INT on the cpu 1 here, as well. |
| 472 | 472 | //but only once per frame ! |
| 473 | 473 | if (vector == 0xdf) /* only on vblank */ |
| 474 | cpunum_set_input_line(1, 0, PULSE_LINE ); | |
| 474 | cpunum_set_input_line(machine, 1, 0, PULSE_LINE ); | |
| 475 | 475 | |
| 476 | 476 | } |
| 477 | 477 |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | static WRITE8_HANDLER( crimfght_sh_irqtrigger_w ) |
| 32 | 32 | { |
| 33 | 33 | soundlatch_w(offset,data); |
| 34 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 34 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static WRITE8_HANDLER( crimfght_snd_bankswitch_w ) |
| r1591 | r1592 | |
| 490 | 490 | int offs = 0; |
| 491 | 491 | |
| 492 | 492 | /* bit 5 = select work RAM or palette */ |
| 493 | if (lines & 0x20){ | |
| 494 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, paletteram_r); /* palette */ | |
| 495 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w); /* palette */ | |
| 493 | if (lines & 0x20) | |
| 494 | { | |
| 495 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MRA8_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w); | |
| 496 | memory_set_bankptr(3, paletteram); | |
| 496 | 497 | } |
| 497 | else{ | |
| 498 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MRA8_BANK1); /* RAM */ | |
| 499 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MWA8_BANK1); /* RAM */ | |
| 500 | } | |
| 498 | else | |
| 499 | memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MRA8_BANK1, MWA8_BANK1); /* RAM */ | |
| 501 | 500 | |
| 502 | 501 | /* bit 6 = enable char ROM reading through the video RAM */ |
| 503 | 502 | K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 504 | 503 | |
| 505 | offs = 0x10000 + ( ( lines & 0x0f ) * 0x2000 ); | |
| 506 | memory_set_bankptr( 2, &RAM[offs] ); | |
| 504 | offs = 0x10000 + ((lines & 0x0f) * 0x2000); | |
| 505 | memory_set_bankptr(2, &RAM[offs]); | |
| 507 | 506 | } |
| 508 | 507 | |
| 509 | 508 | static MACHINE_RESET( crimfght ) |
| r1591 | r1592 | |
|---|---|---|
| 609 | 609 | |
| 610 | 610 | static TIMER_CALLBACK( rabbit_blit_done ) |
| 611 | 611 | { |
| 612 | cpunum_set_input_line(0, rabbit_bltirqlevel, HOLD_LINE); | |
| 612 | cpunum_set_input_line(machine, 0, rabbit_bltirqlevel, HOLD_LINE); | |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | static void rabbit_do_blit(void) |
| r1591 | r1592 | |
| 1061 | 1061 | return; |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | cpunum_set_input_line(0, intlevel, HOLD_LINE); | |
| 1064 | cpunum_set_input_line(machine, 0, intlevel, HOLD_LINE); | |
| 1065 | 1065 | } |
| 1066 | 1066 | |
| 1067 | 1067 | static MACHINE_DRIVER_START( rabbit ) |
| r1591 | r1592 | |
| 1189 | 1189 | else |
| 1190 | 1190 | intlevel = 3; |
| 1191 | 1191 | |
| 1192 | cpunum_set_input_line(0, intlevel, HOLD_LINE); | |
| 1192 | cpunum_set_input_line(machine, 0, intlevel, HOLD_LINE); | |
| 1193 | 1193 | } |
| 1194 | 1194 | |
| 1195 | 1195 | static MACHINE_DRIVER_START( tmmjprd ) |
| r1591 | r1592 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | static TIMER_CALLBACK( cadash_interrupt5 ) |
| 238 | 238 | { |
| 239 | cpunum_set_input_line(0, 5, HOLD_LINE); | |
| 239 | cpunum_set_input_line(machine, 0, 5, HOLD_LINE); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | static INTERRUPT_GEN( cadash_interrupt ) |
| 243 | 243 | { |
| 244 | 244 | timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, cadash_interrupt5); |
| 245 | cpunum_set_input_line(0, 4, HOLD_LINE); /* interrupt vector 4 */ | |
| 245 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); /* interrupt vector 4 */ | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
| r1591 | r1592 | |
| 812 | 812 | |
| 813 | 813 | static void irq_handler(int irq) |
| 814 | 814 | { |
| 815 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 815 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | 818 | static const struct YM2610interface ym2610_interface = |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | triplhnt_hit_code = code; |
| 33 | 33 | |
| 34 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 34 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 |
| r1591 | r1592 | |
|---|---|---|
| 478 | 478 | |
| 479 | 479 | static INTERRUPT_GEN( deco32_vbl_interrupt ) |
| 480 | 480 | { |
| 481 | cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE); | |
| 481 | cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE); | |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | |
| r1591 | r1592 | |
| 690 | 690 | deco56_decrypt(REGION_GFX1); /* 141 */ |
| 691 | 691 | deco56_decrypt(REGION_GFX2); /* 141 */ |
| 692 | 692 | decrypt156(); |
| 693 | cpunum_set_clockscale(0, 4.0f); /* core timings aren't accurate */ | |
| 693 | cpunum_set_clockscale(machine, 0, 4.0f); /* core timings aren't accurate */ | |
| 694 | 694 | descramble_sound(); |
| 695 | 695 | memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r ); |
| 696 | 696 | } |
| r1591 | r1592 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | static WRITE8_HANDLER( soundirq_w ) |
| 58 | 58 | { |
| 59 | cpunum_set_input_line_and_vector(1,0,HOLD_LINE,0xff); | |
| 59 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static TIMER_CALLBACK( nmi_callback ) |
| 63 | 63 | { |
| 64 | cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 64 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static WRITE8_HANDLER( sound_arm_nmi_w ) |
| 68 | 68 | { |
| 69 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 69 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 70 | 70 | timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback); /* kludge until the K053260 is emulated correctly */ |
| 71 | 71 | } |
| 72 | 72 | |
| r1591 | r1592 | |
| 87 | 87 | AM_RANGE(0x0300, 0x030f) AM_READ(K053244_r) |
| 88 | 88 | AM_RANGE(0x0800, 0x0fff) AM_READ(rollerg_K051316_r) |
| 89 | 89 | AM_RANGE(0x1000, 0x17ff) AM_READ(K053245_r) |
| 90 | AM_RANGE(0x1800, 0x1fff) AM_READ( | |
| 90 | AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8 | |
| 91 | 91 | AM_RANGE(0x2000, 0x3aff) AM_READ(MRA8_RAM) |
| 92 | 92 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1) |
| 93 | 93 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) |
| r1591 | r1592 | |
|---|---|---|
| 33 | 33 | static WRITE8_HANDLER( sound_cpu_command_w ) |
| 34 | 34 | { |
| 35 | 35 | soundlatch_w(offset,data); |
| 36 | cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE); | |
| 36 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | static READ8_HANDLER( sidepckt_i8751_r ) |
| r1591 | r1592 | |
| 48 | 48 | static const int table_3[]={0xbd,0x73,0x80,0xbd,0x73,0xa7,0xbd,0x73,0xe0,0x7e,0x72,0x56,0xff,0xff,0xff,0xff}; |
| 49 | 49 | static int current_ptr=0,current_table=0,in_math=0,math_param; |
| 50 | 50 | |
| 51 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */ | |
| 51 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */ | |
| 52 | 52 | |
| 53 | 53 | /* This function takes multiple parameters */ |
| 54 | 54 | if (in_math==1) { |
| r1591 | r1592 | |
| 89 | 89 | static const int table_3[]={0xbd,0x71,0xc8,0xbd,0x71,0xef,0xbd,0x72,0x28,0x7e,0x70,0x9e,0xff,0xff,0xff,0xff}; |
| 90 | 90 | static int current_ptr=0,current_table=0,in_math,math_param; |
| 91 | 91 | |
| 92 | cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */ | |
| 92 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */ | |
| 93 | 93 | |
| 94 | 94 | /* This function takes multiple parameters */ |
| 95 | 95 | if (in_math==1) { |
| r1591 | r1592 | |
| 279 | 279 | /* handler called by the 3526 emulator when the internal timers cause an IRQ */ |
| 280 | 280 | static void irqhandler(int linestate) |
| 281 | 281 | { |
| 282 | cpunum_set_input_line(1,0,linestate); | |
| 282 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static const struct YM3526interface ym3526_interface = |
| r1591 | r1592 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | static WRITE8_HANDLER( irq_ack_w ) |
| 79 | 79 | { |
| 80 | cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 80 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r1591 | r1592 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | int scanline = param; |
| 40 | 40 | |
| 41 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 41 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 42 | 42 | |
| 43 | 43 | scanline += 64; |
| 44 | 44 |
| r1591 | r1592 | |
|---|---|---|
| 106 | 106 | tankbatt_sound_enable = !data; |
| 107 | 107 | if (data != 0) |
| 108 | 108 | { |
| 109 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 110 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 109 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 110 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 111 | 111 | } |
| 112 | 112 | /* hack - turn off the engine noise if the normal game nmi's are disabled */ |
| 113 | 113 | if (data) sample_stop (2); |
| r1591 | r1592 | |
| 119 | 119 | tankbatt_nmi_enable = data; |
| 120 | 120 | if (data != 0) |
| 121 | 121 | { |
| 122 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 123 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 122 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 123 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 124 | 124 | } |
| 125 | 125 | // interrupt_enable_w (offset, data); |
| 126 | 126 | } |
| r1591 | r1592 | |
| 176 | 176 | |
| 177 | 177 | static INTERRUPT_GEN( tankbatt_interrupt ) |
| 178 | 178 | { |
| 179 | if ((readinputport (0) & 0x60) == 0) cpunum_set_input_line(0,0,HOLD_LINE); | |
| 180 | else if (tankbatt_nmi_enable) cpunum_set_input_line(0,INPUT_LINE_NMI,PULSE_LINE); | |
| 179 | if ((readinputport (0) & 0x60) == 0) cpunum_set_input_line(machine, 0,0,HOLD_LINE); | |
| 180 | else if (tankbatt_nmi_enable) cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static INPUT_PORTS_START( tankbatt ) |
| r1591 | r1592 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | /* Exerion triggers NMIs on coin insertion */ |
| 38 | 38 | if (readinputport(4) & 1) |
| 39 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 39 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| r1591 | r1592 | |
| 473 | 473 | ram[addr] = (ram[addr] & 0xf9) | ((ram[addr] & 2) << 1) | ((ram[addr] & 4) >> 1); |
| 474 | 474 | |
| 475 | 475 | /* also convert the gfx as in Exerion */ |
| 476 | | |
| 476 | DRIVER_INIT_CALL(exerion | |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 |
| r1591 | r1592 | |
|---|---|---|
| 99 | 99 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 100 | 100 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, NULL, NULL, "????" }, |
| 101 | 101 | { 0x25/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" }, |
| 102 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17, MWA16_ | |
| 102 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17, MWA16_UNMAP, | |
| 103 | 103 | { 0 } |
| 104 | 104 | }; |
| 105 | 105 | |
| r1591 | r1592 | |
| 112 | 112 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, MRA16_BANK13, MWA16_BANK13, &segaic16_spriteram_0, "object RAM" }, |
| 113 | 113 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 114 | 114 | { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" }, |
| 115 | { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, MRA16_BANK16, MWA16_ROM, NULL, "ROM 1" }, | |
| 116 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17, MWA16_ROM, NULL, "ROM 0" }, | |
| 115 | { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, MRA16_BANK16, MWA16_UNMAP, NULL, "ROM 1" }, | |
| 116 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17, MWA16_UNMAP, NULL, "ROM 0" }, | |
| 117 | 117 | { 0 } |
| 118 | 118 | }; |
| 119 | 119 | |
| r1591 | r1592 | |
| 127 | 127 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, MRA16_BANK14, MWA16_BANK14, &workram, "work RAM" }, |
| 128 | 128 | { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" }, |
| 129 | 129 | { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, MRA16_BANK16, rom_5987_bank_w, NULL, "ROM 1/banking" }, |
| 130 | { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, MRA16_BANK17, MWA16_ | |
| 130 | { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, MRA16_BANK17, MWA16_UNMAP, | |
| 131 | 131 | { 0 } |
| 132 | 132 | }; |
| 133 | 133 | |
| r1591 | r1592 | |
| 149 | 149 | static void sound_w(UINT8 data) |
| 150 | 150 | { |
| 151 | 151 | soundlatch_w(0, data & 0xff); |
| 152 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); | |
| 152 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| r1591 | r1592 | |
| 555 | 555 | static WRITE8_HANDLER( mcu_data_w ) |
| 556 | 556 | { |
| 557 | 557 | mcu_data = data; |
| 558 | cpunum_set_input_line(2, 1, PULSE_LINE); | |
| 558 | cpunum_set_input_line(Machine, 2, 1, PULSE_LINE); | |
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | |
| r1591 | r1592 | |
| 2212 | 2212 | |
| 2213 | 2213 | static DRIVER_INIT( ddcrew ) |
| 2214 | 2214 | { |
| 2215 | | |
| 2215 | DRIVER_INIT_CALL(generic_5987 | |
| 2216 | 2216 | custom_io_r = ddcrew_custom_io_r; |
| 2217 | 2217 | } |
| 2218 | 2218 | |
| 2219 | 2219 | static DRIVER_INIT( lghost ) |
| 2220 | 2220 | { |
| 2221 | | |
| 2221 | DRIVER_INIT_CALL(generic_5987 | |
| 2222 | 2222 | custom_io_r = lghost_custom_io_r; |
| 2223 | 2223 | custom_io_w = lghost_custom_io_w; |
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | 2226 | static DRIVER_INIT( wwally ) |
| 2227 | 2227 | { |
| 2228 | | |
| 2228 | DRIVER_INIT_CALL(generic_5987 | |
| 2229 | 2229 | custom_io_r = wwally_custom_io_r; |
| 2230 | 2230 | custom_io_w = wwally_custom_io_w; |
| 2231 | 2231 | } |
| r1591 | r1592 | |
|---|---|---|
| 283 | 283 | static INTERRUPT_GEN( meijinsn_interrupt ) |
| 284 | 284 | { |
| 285 | 285 | if (cpu_getiloops() == 0) |
| 286 | cpunum_set_input_line(0, 1, HOLD_LINE); | |
| 286 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 287 | 287 | else |
| 288 | cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 288 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | static const struct AY8910interface ay8910_interface = |
| r1591 | r1592 | |
|---|---|---|
| 392 | 392 | |
| 393 | 393 | static void irqhandler(int linestate) |
| 394 | 394 | { |
| 395 | cpunum_set_input_line(1,0,linestate); | |
| 395 | cpunum_set_input_line(Machine, 1,0,linestate); | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | static const struct YM3812interface ym3812_interface = |
| r1591 | r1592 | |
|---|---|---|
| 3354 | 3354 | static INTERRUPT_GEN( suzume_irq ) |
| 3355 | 3355 | { |
| 3356 | 3356 | if ( suzume_bank & 0x40 ) |
| 3357 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 3357 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 3358 | 3358 | } |
| 3359 | 3359 | |
| 3360 | 3360 | static MACHINE_DRIVER_START( suzume ) |
| r1591 | r1592 | |
| 3404 | 3404 | { |
| 3405 | 3405 | switch(cpu_getiloops()) |
| 3406 | 3406 | { |
| 3407 | case 0: cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x80); break; // vblank | |
| 3408 | case 1: cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x82); break; // rtc | |
| 3409 | default: cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x84); // demo | |
| 3407 | case 0: cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x80); break; // vblank | |
| 3408 | case 1: cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x82); break; // rtc | |
| 3409 | default: cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x84); // demo | |
| 3410 | 3410 | } |
| 3411 | 3411 | } |
| 3412 | 3412 | |
| r1591 | r1592 | |
| 3447 | 3447 | { |
| 3448 | 3448 | switch(cpu_getiloops()) |
| 3449 | 3449 | { |
| 3450 | case 0: cpunum_set_input_line(0, INPUT_LINE_IRQ0, HOLD_LINE); break; // vblank | |
| 3451 | case 1: cpunum_set_input_line(0, INPUT_LINE_IRQ1, HOLD_LINE); break; // rtc | |
| 3450 | case 0: cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, HOLD_LINE); break; // vblank | |
| 3451 | case 1: cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, HOLD_LINE); break; // rtc | |
| 3452 | 3452 | } |
| 3453 | 3453 | } |
| 3454 | 3454 |
| r1591 | r1592 | |
|---|---|---|
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | MDRV_PALETTE_INIT(subs) |
| 218 | MDRV_VIDEO_START(generic) | |
| 219 | 218 | MDRV_VIDEO_UPDATE(subs) |
| 220 | 219 | |
| 221 | 220 |
| r1591 | r1592 | |
|---|---|---|
| 149 | 149 | static INTERRUPT_GEN( system_h1 ) |
| 150 | 150 | { |
| 151 | 151 | if (cpu_getiloops()) |
| 152 | { | |
| 153 | cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 154 | } | |
| 152 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 155 | 153 | else |
| 156 | { | |
| 157 | cpunum_set_input_line(0, 3, HOLD_LINE); | |
| 158 | } | |
| 154 | cpunum_set_input_line(machine, 0, 3, HOLD_LINE); | |
| 159 | 155 | } |
| 160 | 156 | |
| 161 | 157 | // not sure on SH-1 |
| r1591 | r1592 | |
| 163 | 159 | { |
| 164 | 160 | if (cpu_getiloops()) |
| 165 | 161 | { |
| 166 | // cpunum_set_input_line(2, 4, HOLD_LINE); | |
| 162 | // cpunum_set_input_line(machine, 2, 4, HOLD_LINE); | |
| 167 | 163 | } |
| 168 | 164 | else |
| 169 | 165 | { |
| 170 | // cpunum_set_input_line(2, 3, HOLD_LINE); | |
| 166 | // cpunum_set_input_line(machine, 2, 3, HOLD_LINE); | |
| 171 | 167 | } |
| 172 | 168 | } |
| 173 | 169 | |
| 174 | 170 | static MACHINE_RESET ( coolridr ) |
| 175 | 171 | { |
| 176 | 172 | |
| 177 | // cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 178 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 173 | // cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 174 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 179 | 175 | |
| 180 | 176 | } |
| 181 | 177 |
| r1591 | r1592 | |
|---|---|---|
| 239 | 239 | static INTERRUPT_GEN( darkmist_interrupt ) |
| 240 | 240 | { |
| 241 | 241 | if(cpu_getiloops()) |
| 242 | { | |
| 243 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x08); | |
| 244 | } | |
| 242 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x08); | |
| 245 | 243 | else |
| 246 | { | |
| 247 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x10); | |
| 248 | } | |
| 244 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0x10); | |
| 249 | 245 | } |
| 250 | 246 | |
| 251 | 247 |
| r1591 | r1592 | |
|---|---|---|
| 116 | 116 | const int *p; |
| 117 | 117 | |
| 118 | 118 | data &= 1; |
| 119 | cpunum_set_input_line(2, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); | |
| 119 | cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); | |
| 120 | 120 | if( (p=mcu_patch_data) != NULL) |
| 121 | 121 | { |
| 122 | 122 | /* patch MCU program */ |
| r1591 | r1592 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | else |
| 47 | 47 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 48 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ | |
| 48 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| r1591 | r1592 | |
| 338 | 338 | /* set ES5503 wave memory (this is banked in 64k increments) */ |
| 339 | 339 | ES5503_set_base_0(memory_region(REGION_SOUND1)); |
| 340 | 340 | |
| 341 | | |
| 341 | MACHINE_RESET_CALL(amiga | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /************************************* |
| r1591 | r1592 | |
|---|---|---|
| 80 | 80 | static WRITE8_HANDLER( funybubl_soundcommand_w ) |
| 81 | 81 | { |
| 82 | 82 | soundlatch_w(0,data); |
| 83 | cpunum_set_input_line(1,0, HOLD_LINE); | |
| 83 | cpunum_set_input_line(Machine, 1,0, HOLD_LINE); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static WRITE8_HANDLER( funybubl_oki_bank_sw ) |
| r1591 | r1592 | |
|---|---|---|
| 28 | 28 | static INTERRUPT_GEN( rotaryf_interrupt ) |
| 29 | 29 | { |
| 30 | 30 | if (video_screen_get_vblank(0)) |
| 31 | cpunum_set_input_line(0, I8085_RST55_LINE,HOLD_LINE); | |
| 31 | cpunum_set_input_line(machine, 0, I8085_RST55_LINE, HOLD_LINE); | |
| 32 | 32 | else |
| 33 | cpunum_set_input_line(0, I8085_RST75_LINE,HOLD_LINE); | |
| 33 | cpunum_set_input_line(machine, 0, I8085_RST75_LINE, HOLD_LINE); | |
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
| r1591 | r1592 | |
| 148 | 148 | static MACHINE_DRIVER_START( rotaryf ) |
| 149 | 149 | |
| 150 | 150 | /* basic machine hardware */ |
| 151 | MDRV_CPU_ADD_TAG("main",8085A, | |
| 151 | MDRV_CPU_ADD_TAG("main",8085A,4000000) /* 8080? */ /* 2 MHz? */ | |
| 152 | 152 | MDRV_CPU_PROGRAM_MAP(rotaryf_map,0) |
| 153 | 153 | MDRV_CPU_IO_MAP(rotaryf_io_map,0) |
| 154 | 154 | MDRV_CPU_VBLANK_INT(rotaryf_interrupt,5) |
| r1591 | r1592 | |
|---|---|---|
| 266 | 266 | |
| 267 | 267 | static MACHINE_RESET( mustang_sound ) |
| 268 | 268 | { |
| 269 | | |
| 269 | MACHINE_RESET_CALL(seibu_sound_1 | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | static WRITE16_HANDLER ( ssmissin_sound_w ) |
| r1591 | r1592 | |
| 274 | 274 | if (ACCESSING_LSB) |
| 275 | 275 | { |
| 276 | 276 | soundlatch_w(0,data & 0xff); |
| 277 | cpunum_set_input_line(1,0, HOLD_LINE); | |
| 277 | cpunum_set_input_line(Machine, 1,0, HOLD_LINE); | |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| r1591 | r1592 | |
| 370 | 370 | if (ACCESSING_LSB) |
| 371 | 371 | { |
| 372 | 372 | soundlatch_w(0,data&0xff); |
| 373 | cpunum_set_input_line(1, 0, HOLD_LINE); | |
| 373 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
| r1591 | r1592 | |
| 3672 | 3672 | |
| 3673 | 3673 | static void ym2203_irqhandler(int irq) |
| 3674 | 3674 | { |
| 3675 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 3675 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 3676 | 3676 | } |
| 3677 | 3677 | |
| 3678 | 3678 | static const struct YM2203interface ym2203_interface = |
| r1591 | r1592 | |
| 3682 | 3682 | |
| 3683 | 3683 | static INTERRUPT_GEN( nmk_interrupt ) |
| 3684 | 3684 | { |
| 3685 | if (cpu_getiloops() == 0) cpunum_set_input_line(0, 4, HOLD_LINE); | |
| 3686 | else cpunum_set_input_line(0, 2, HOLD_LINE); | |
| 3685 | if (cpu_getiloops() == 0) cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 3686 | else cpunum_set_input_line(machine, 0, 2, HOLD_LINE); | |
| 3687 | 3687 | } |
| 3688 | 3688 | |
| 3689 | 3689 | |
| r1591 | r1592 | |
| 3955 | 3955 | static MACHINE_DRIVER_START( vandyke ) |
| 3956 | 3956 | |
| 3957 | 3957 | /* basic machine hardware */ |
| 3958 | MDRV_CPU_ADD(M68000, 10 | |
| 3958 | MDRV_CPU_ADD(M68000, XTAL_10MHz | |
| 3959 | 3959 | MDRV_CPU_PROGRAM_MAP(vandyke_readmem,vandyke_writemem) |
| 3960 | 3960 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) |
| 3961 | 3961 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| r1591 | r1592 | |
| 3979 | 3979 | /* sound hardware */ |
| 3980 | 3980 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 3981 | 3981 | |
| 3982 | MDRV_SOUND_ADD(YM2203, 1 | |
| 3982 | MDRV_SOUND_ADD(YM2203, XTAL_12MHz/8) /* verified on pcb */ | |
| 3983 | 3983 | MDRV_SOUND_CONFIG(ym2203_nmk004_interface) |
| 3984 | 3984 | MDRV_SOUND_ROUTE(0, "mono", 0.50) |
| 3985 | 3985 | MDRV_SOUND_ROUTE(1, "mono", 0.50) |
| 3986 | 3986 | MDRV_SOUND_ROUTE(2, "mono", 0.50) |
| 3987 | 3987 | MDRV_SOUND_ROUTE(3, "mono", 2.00) |
| 3988 | 3988 | |
| 3989 | MDRV_SOUND_ADD(OKIM6295, 16000000/4) | |
| 3990 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) | |
| 3989 | MDRV_SOUND_ADD(OKIM6295, XTAL_12MHz/3) /* verified on pcb */ | |
| 3990 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) /* verified on pcb */ | |
| 3991 | 3991 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 3992 | 3992 | |
| 3993 | MDRV_SOUND_ADD(OKIM6295, 16000000/4) | |
| 3994 | MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7low) | |
| 3993 | MDRV_SOUND_ADD(OKIM6295, XTAL_12MHz/3) /* verified on pcb */ | |
| 3994 | MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7low) /* verified on pcb */ | |
| 3995 | 3995 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 3996 | 3996 | MACHINE_DRIVER_END |
| 3997 | 3997 | |
| r1591 | r1592 | |
| 4735 | 4735 | |
| 4736 | 4736 | static DRIVER_INIT( bjtwin ) |
| 4737 | 4737 | { |
| 4738 | | |
| 4738 | DRIVER_INIT_CALL(nmk | |
| 4739 | 4739 | |
| 4740 | 4740 | /* Patch rom to enable test mode */ |
| 4741 | 4741 | |
| r1591 | r1592 | |
| 4987 | 4987 | |
| 4988 | 4988 | static void irq_handler(int irq) |
| 4989 | 4989 | { |
| 4990 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 4990 | cpunum_set_input_line(Machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 4991 | 4991 | } |
| 4992 | 4992 | |
| 4993 | 4993 | static const struct YM2151interface afega_ym2151_intf = |
| r1591 | r1592 | |
|---|---|---|
| 67 | 67 | { 0, "-fno-strict-aliasing", "/Oa" }, |
| 68 | 68 | { 0, "-fno-omit-frame-pointer", "" }, |
| 69 | 69 | { 0, "-Werror", "/WX" }, |
| 70 | { VS2005, "-Wall", "/Wall /W3 /wd4018 /wd4146 /wd4242 /wd4244 /wd4305 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826" }, | |
| 71 | { VS7, "-Wall", "/Wall /W3 /wd4018 /wd4146 /wd4242 /wd4244 /wd4305 /wd4550 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4826" }, | |
| 70 | { VS7, "-Wall", "/Wall /W3 /wd4018 /wd4146 /wd4242 /wd4244 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826" }, | |
| 72 | 71 | { 0, "-Wall", "/W0" }, |
| 73 | 72 | { VS7, "-Wno-unused", "/wd4100 /wd4101 /wd4102" }, |
| 74 | 73 | { 0, "-W*", "" }, |
| r1591 | r1592 | |
|---|---|---|
| 12 | 12 | #ifndef __EIVC__ |
| 13 | 13 | #define __EIVC__ |
| 14 | 14 | |
| 15 | #if | |
| 15 | #if | |
| 16 | 16 | #include <intrin.h> |
| 17 | #pragma intrinsic(_BitScanReverse) | |
| 18 | 17 | #else |
| 18 | long __cdecl _InterlockedIncrement(long volatile *); | |
| 19 | long __cdecl _InterlockedDecrement(long volatile *); | |
| 20 | long _InterlockedExchange(long volatile *, long); | |
| 21 | long _InterlockedCompareExchange (long volatile *, long, long); | |
| 22 | long _InterlockedExchangeAdd(long volatile *, long); | |
| 23 | unsigned char _BitScanReverse(unsigned long *Index, unsigned long Mask); | |
| 24 | #endif | |
| 25 | ||
| 26 | #pragma intrinsic(_InterlockedIncrement) | |
| 27 | #pragma intrinsic(_InterlockedDecrement) | |
| 19 | 28 | #pragma intrinsic(_InterlockedCompareExchange) |
| 20 | 29 | #pragma intrinsic(_InterlockedExchange) |
| 21 | 30 | #pragma intrinsic(_InterlockedExchangeAdd) |
| 31 | #if (_MSC_VER >= 1310) | |
| 32 | #pragma intrinsic(_BitScanReverse) | |
| 22 | 33 | #endif |
| 23 | 34 | |
| 24 | 35 |
| r1591 | r1592 | |
|---|---|---|
| 133 | 133 | UINT32 minwidth, maxwidth; |
| 134 | 134 | UINT32 minheight, maxheight; |
| 135 | 135 | void (*recompute_children)(debugwin_info *); |
| 136 | void (*update_menu)(debugwin_info *); | |
| 136 | 137 | |
| 137 | 138 | int (*handle_command)(debugwin_info *, WPARAM, LPARAM); |
| 138 | 139 | int (*handle_key)(debugwin_info *, WPARAM, LPARAM); |
| r1591 | r1592 | |
| 221 | 222 | static void memory_create_window(void); |
| 222 | 223 | static void memory_recompute_children(debugwin_info *info); |
| 223 | 224 | static void memory_process_string(debugwin_info *info, const char *string); |
| 224 | static void memory_update_ | |
| 225 | static void memory_update_ | |
| 225 | 226 | static int memory_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam); |
| 226 | 227 | static int memory_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam); |
| 227 | 228 | |
| 228 | 229 | static void disasm_create_window(void); |
| 229 | 230 | static void disasm_recompute_children(debugwin_info *info); |
| 230 | 231 | static void disasm_process_string(debugwin_info *info, const char *string); |
| 231 | static void disasm_update_ | |
| 232 | static void disasm_update_ | |
| 232 | 233 | static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam); |
| 233 | 234 | static int disasm_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam); |
| 234 | 235 | static void disasm_update_caption(HWND wnd); |
| r1591 | r1592 | |
| 640 | 641 | |
| 641 | 642 | // keydown: handle debugger keys |
| 642 | 643 | case WM_KEYDOWN: |
| 643 | { | |
| 644 | 644 | if ((*info->handle_key)(info, wparam, lparam)) |
| 645 | 645 | info->ignore_char_lparam = lparam >> 16; |
| 646 | 646 | break; |
| 647 | } | |
| 648 | 647 | |
| 649 | 648 | // char: ignore chars associated with keys we've handled |
| 650 | 649 | case WM_CHAR: |
| 651 | { | |
| 652 | 650 | if (info->ignore_char_lparam != (lparam >> 16)) |
| 653 | 651 | return DefWindowProc(wnd, message, wparam, lparam); |
| 654 | 652 | else |
| 655 | 653 | info->ignore_char_lparam = 0; |
| 656 | 654 | break; |
| 657 | } | |
| 658 | 655 | |
| 659 | 656 | // activate: set the focus |
| 660 | 657 | case WM_ACTIVATE: |
| 661 | { | |
| 662 | 658 | if (wparam != WA_INACTIVE && info->focuswnd != NULL) |
| 663 | 659 | SetFocus(info->focuswnd); |
| 664 | 660 | break; |
| 665 | } | |
| 666 | 661 | |
| 667 | 662 | // get min/max info: set the minimum window size |
| 668 | 663 | case WM_GETMINMAXINFO: |
| r1591 | r1592 | |
| 680 | 675 | |
| 681 | 676 | // sizing: recompute child window locations |
| 682 | 677 | case WM_SIZING: |
| 683 | { | |
| 684 | 678 | if (info->recompute_children) |
| 685 | 679 | (*info->recompute_children)(info); |
| 686 | 680 | InvalidateRect(wnd, NULL, FALSE); |
| 687 | 681 | break; |
| 688 | } | |
| 689 | 682 | |
| 690 | 683 | // mouse wheel: forward to the first view |
| 691 | 684 | case WM_MOUSEWHEEL: |
| r1591 | r1592 | |
| 726 | 719 | break; |
| 727 | 720 | } |
| 728 | 721 | |
| 722 | // activate: set the focus | |
| 723 | case WM_INITMENU: | |
| 724 | if (info->update_menu != NULL) | |
| 725 | (*info->update_menu)(info); | |
| 726 | break; | |
| 727 | ||
| 729 | 728 | // command: handle a comment |
| 730 | 729 | case WM_COMMAND: |
| 731 | 730 | if (!(*info->handle_command)(info, wparam, lparam)) |
| r1591 | r1592 | |
| 1856 | 1855 | // set the handlers |
| 1857 | 1856 | info->handle_command = memory_handle_command; |
| 1858 | 1857 | info->handle_key = memory_handle_key; |
| 1858 | info->update_menu = memory_update_menu; | |
| 1859 | 1859 | |
| 1860 | 1860 | // create the options menu |
| 1861 | 1861 | optionsmenu = CreatePopupMenu(); |
| r1591 | r1592 | |
| 1872 | 1872 | AppendMenu(optionsmenu, MF_ENABLED, ID_INCREASE_MEM_WIDTH, TEXT("Increase bytes per line\tCtrl+P")); |
| 1873 | 1873 | AppendMenu(optionsmenu, MF_ENABLED, ID_DECREASE_MEM_WIDTH, TEXT("Decrease bytes per line\tCtrl+O")); |
| 1874 | 1874 | AppendMenu(GetMenu(info->wnd), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options")); |
| 1875 | memory_update_checkmarks(info); | |
| 1876 | 1875 | |
| 1877 | 1876 | // set up the view to track the initial expression |
| 1878 | 1877 | debug_view_begin_update(info->view[0].view); |
| r1591 | r1592 | |
| 2005 | 2004 | |
| 2006 | 2005 | |
| 2007 | 2006 | //============================================================ |
| 2008 | // memory_update_ | |
| 2007 | // memory_update_ | |
| 2009 | 2008 | //============================================================ |
| 2010 | 2009 | |
| 2011 | static void memory_update_ | |
| 2010 | static void memory_update_ | |
| 2012 | 2011 | { |
| 2013 | 2012 | CheckMenuItem(GetMenu(info->wnd), ID_1_BYTE_CHUNKS, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK) == 1? MF_CHECKED : MF_UNCHECKED)); |
| 2014 | 2013 | CheckMenuItem(GetMenu(info->wnd), ID_2_BYTE_CHUNKS, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK) == 2 ? MF_CHECKED : MF_UNCHECKED)); |
| r1591 | r1592 | |
| 2060 | 2059 | debug_view_begin_update(info->view[0].view); |
| 2061 | 2060 | debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 1); |
| 2062 | 2061 | debug_view_end_update(info->view[0].view); |
| 2063 | memory_update_checkmarks(info); | |
| 2064 | 2062 | return 1; |
| 2065 | 2063 | |
| 2066 | 2064 | case ID_2_BYTE_CHUNKS: |
| 2067 | 2065 | debug_view_begin_update(info->view[0].view); |
| 2068 | 2066 | debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 2); |
| 2069 | 2067 | debug_view_end_update(info->view[0].view); |
| 2070 | memory_update_checkmarks(info); | |
| 2071 | 2068 | return 1; |
| 2072 | 2069 | |
| 2073 | 2070 | case ID_4_BYTE_CHUNKS: |
| 2074 | 2071 | debug_view_begin_update(info->view[0].view); |
| 2075 | 2072 | debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 4); |
| 2076 | 2073 | debug_view_end_update(info->view[0].view); |
| 2077 | memory_update_checkmarks(info); | |
| 2078 | 2074 | return 1; |
| 2079 | 2075 | |
| 2080 | 2076 | case ID_8_BYTE_CHUNKS: |
| 2081 | 2077 | debug_view_begin_update(info->view[0].view); |
| 2082 | 2078 | debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 8); |
| 2083 | 2079 | debug_view_end_update(info->view[0].view); |
| 2084 | memory_update_checkmarks(info); | |
| 2085 | 2080 | return 1; |
| 2086 | 2081 | |
| 2087 | 2082 | case ID_LOGICAL_ADDRESSES: |
| 2088 | 2083 | debug_view_begin_update(info->view[0].view); |
| 2089 | 2084 | debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION, FALSE); |
| 2090 | 2085 | debug_view_end_update(info->view[0].view); |
| 2091 | memory_update_checkmarks(info); | |
| 2092 | 2086 | return 1; |
| 2093 | 2087 | |
| 2094 | 2088 | case ID_PHYSICAL_ADDRESSES: |
| 2095 | 2089 | debug_view_begin_update(info->view[0].view); |
| 2096 | 2090 | debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION, TRUE); |
| 2097 | 2091 | debug_view_end_update(info->view[0].view); |
| 2098 | memory_update_checkmarks(info); | |
| 2099 | 2092 | return 1; |
| 2100 | 2093 | |
| 2101 | 2094 | case ID_REVERSE_VIEW: |
| 2102 | 2095 | debug_view_begin_update(info->view[0].view); |
| 2103 | 2096 | debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_REVERSE_VIEW, !debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_REVERSE_VIEW)); |
| 2104 | 2097 | debug_view_end_update(info->view[0].view); |
| 2105 | memory_update_checkmarks(info); | |
| 2106 | 2098 | return 1; |
| 2107 | 2099 | |
| 2108 | 2100 | case ID_INCREASE_MEM_WIDTH: |
| r1591 | r1592 | |
| 2201 | 2193 | AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_ENCRYPTED, TEXT("Encrypted opcodes\tCtrl+E")); |
| 2202 | 2194 | AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_COMMENTS, TEXT("Comments\tCtrl+M")); |
| 2203 | 2195 | AppendMenu(GetMenu(info->wnd), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options")); |
| 2204 | disasm_update_checkmarks(info); | |
| 2205 | 2196 | |
| 2206 | 2197 | // set the handlers |
| 2207 | 2198 | info->handle_command = disasm_handle_command; |
| 2208 | 2199 | info->handle_key = disasm_handle_key; |
| 2200 | info->update_menu = disasm_update_menu; | |
| 2209 | 2201 | |
| 2210 | 2202 | // set up the view to track the initial expression |
| 2211 | 2203 | debug_view_begin_update(info->view[0].view); |
| r1591 | r1592 | |
| 2346 | 2338 | |
| 2347 | 2339 | |
| 2348 | 2340 | //============================================================ |
| 2349 | // disasm_update_ | |
| 2341 | // disasm_update_ | |
| 2350 | 2342 | //============================================================ |
| 2351 | 2343 | |
| 2352 | static void disasm_update_ | |
| 2344 | static void disasm_update_ | |
| 2353 | 2345 | { |
| 2354 | 2346 | int rightcol = debug_view_get_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN); |
| 2355 | 2347 | CheckMenuItem(GetMenu(info->wnd), ID_SHOW_RAW, MF_BYCOMMAND | (rightcol == DVP_DASM_RIGHTCOL_RAW ? MF_CHECKED : MF_UNCHECKED)); |
| r1591 | r1592 | |
| 2407 | 2399 | debug_view_begin_update(info->view[0].view); |
| 2408 | 2400 | debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN, DVP_DASM_RIGHTCOL_RAW); |
| 2409 | 2401 | debug_view_end_update(info->view[0].view); |
| 2410 | disasm_update_checkmarks(info); | |
| 2411 | 2402 | (*info->recompute_children)(info); |
| 2412 | 2403 | return 1; |
| 2413 | 2404 | |
| r1591 | r1592 | |
| 2415 | 2406 | debug_view_begin_update(info->view[0].view); |
| 2416 | 2407 | debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN, DVP_DASM_RIGHTCOL_ENCRYPTED); |
| 2417 | 2408 | debug_view_end_update(info->view[0].view); |
| 2418 | disasm_update_checkmarks(info); | |
| 2419 | 2409 | (*info->recompute_children)(info); |
| 2420 | 2410 | return 1; |
| 2421 | 2411 | |
| r1591 | r1592 | |
| 2423 | 2413 | debug_view_begin_update(info->view[0].view); |
| 2424 | 2414 | debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN, DVP_DASM_RIGHTCOL_COMMENTS); |
| 2425 | 2415 | debug_view_end_update(info->view[0].view); |
| 2426 | disasm_update_checkmarks(info); | |
| 2427 | 2416 | (*info->recompute_children)(info); |
| 2428 | 2417 | return 1; |
| 2429 | 2418 | |
| r1591 | r1592 | |
| 2589 | 2578 | AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_ENCRYPTED, TEXT("Encrypted opcodes\tCtrl+E")); |
| 2590 | 2579 | AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_COMMENTS, TEXT("Comments\tCtrl+N")); |
| 2591 | 2580 | AppendMenu(GetMenu(info->wnd), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options")); |
| 2592 | disasm_update_checkmarks(info); | |
| 2593 | 2581 | |
| 2594 | 2582 | // set the handlers |
| 2595 | 2583 | info->handle_command = disasm_handle_command; |
| r1591 | r1592 | |
|---|---|---|
| 1261 | 1261 | |
| 1262 | 1262 | // if refresh is smaller than we'd like, it only scores up to 0.1 |
| 1263 | 1263 | if ((double)desc->dwRefreshRate < einfo->target_refresh) |
| 1264 | refresh_score *= 0.1; | |
| 1264 | refresh_score *= 0.1f; | |
| 1265 | 1265 | |
| 1266 | 1266 | // if we're looking for a particular refresh, make sure it matches |
| 1267 | 1267 | if (desc->dwRefreshRate == einfo->window->refresh) |
| r1591 | r1592 | |
|---|---|---|
| 515 | 515 | goto error; |
| 516 | 516 | |
| 517 | 517 | // create the device immediately for the full screen case (defer for window mode) |
| 518 | // if (window->fullscreen && device_create(window)) | |
| 519 | // goto error; | |
| 518 | if (window->fullscreen && device_create(window)) | |
| 519 | goto error; | |
| 520 | 520 | |
| 521 | 521 | return 0; |
| 522 | 522 | |
| r1591 | r1592 | |
| 1241 | 1241 | INT32 target_width, target_height; |
| 1242 | 1242 | d3d_info *d3d = window->drawdata; |
| 1243 | 1243 | INT32 minwidth, minheight; |
| 1244 | float best_score = 0.0; | |
| 1244 | float best_score = 0.0f; | |
| 1245 | 1245 | int maxmodes; |
| 1246 | 1246 | int modenum; |
| 1247 | 1247 | |
| r1591 | r1592 | |
| 1295 | 1295 | |
| 1296 | 1296 | // if refresh is smaller than we'd like, it only scores up to 0.1 |
| 1297 | 1297 | if ((double)mode.RefreshRate < target_refresh) |
| 1298 | refresh_score *= 0.1; | |
| 1298 | refresh_score *= 0.1f; | |
| 1299 | 1299 | |
| 1300 | 1300 | // if we're looking for a particular refresh, make sure it matches |
| 1301 | 1301 | if (mode.RefreshRate == window->refresh) |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | FUNCTION PROTOTYPES |
| 54 | 54 | ***************************************************************************/ |
| 55 | 55 | |
| 56 | static int config_load_xml(mame_file *file, int type); | |
| 57 | static int config_save_xml(mame_file *file, int type); | |
| 56 | static int config_load_xml(running_machine *machine, mame_file *file, int type); | |
| 57 | static int config_save_xml(running_machine *machine, mame_file *file, int type); | |
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | |
| r1591 | r1592 | |
| 111 | 111 | * |
| 112 | 112 | *************************************/ |
| 113 | 113 | |
| 114 | int config_load_settings( | |
| 114 | int config_load_settings(running_machine *machine) | |
| 115 | 115 | { |
| 116 | 116 | const char *controller = options_get_string(mame_options(), OPTION_CTRLR); |
| 117 | 117 | file_error filerr; |
| r1591 | r1592 | |
| 136 | 136 | fatalerror("Could not load controller file %s.cfg", controller); |
| 137 | 137 | |
| 138 | 138 | /* load the XML */ |
| 139 | if (!config_load_xml(file, CONFIG_TYPE_CONTROLLER)) | |
| 139 | if (!config_load_xml(machine, file, CONFIG_TYPE_CONTROLLER)) | |
| 140 | 140 | fatalerror("Could not load controller file %s.cfg", controller); |
| 141 | 141 | mame_fclose(file); |
| 142 | 142 | } |
| r1591 | r1592 | |
| 145 | 145 | filerr = mame_fopen(SEARCHPATH_CONFIG, "default.cfg", OPEN_FLAG_READ, &file); |
| 146 | 146 | if (filerr == FILERR_NONE) |
| 147 | 147 | { |
| 148 | config_load_xml(file, CONFIG_TYPE_DEFAULT); | |
| 148 | config_load_xml(machine, file, CONFIG_TYPE_DEFAULT); | |
| 149 | 149 | mame_fclose(file); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /* finally, load the game-specific file */ |
| 153 | fname = astring_assemble_2(astring_alloc(), | |
| 153 | fname = astring_assemble_2(astring_alloc(), machine->basename, ".cfg"); | |
| 154 | 154 | filerr = mame_fopen(SEARCHPATH_CONFIG, astring_c(fname), OPEN_FLAG_READ, &file); |
| 155 | 155 | astring_free(fname); |
| 156 | 156 | |
| 157 | 157 | if (filerr == FILERR_NONE) |
| 158 | 158 | { |
| 159 | loaded = config_load_xml(file, CONFIG_TYPE_GAME); | |
| 159 | loaded = config_load_xml(machine, file, CONFIG_TYPE_GAME); | |
| 160 | 160 | mame_fclose(file); |
| 161 | 161 | } |
| 162 | 162 | |
| r1591 | r1592 | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| 173 | void config_save_settings( | |
| 173 | void config_save_settings(running_machine *machine) | |
| 174 | 174 | { |
| 175 | 175 | file_error filerr; |
| 176 | 176 | config_type *type; |
| r1591 | r1592 | |
| 185 | 185 | filerr = mame_fopen(SEARCHPATH_CONFIG, "default.cfg", OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file); |
| 186 | 186 | if (filerr == FILERR_NONE) |
| 187 | 187 | { |
| 188 | config_save_xml(file, CONFIG_TYPE_DEFAULT); | |
| 188 | config_save_xml(machine, file, CONFIG_TYPE_DEFAULT); | |
| 189 | 189 | mame_fclose(file); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /* finally, save the game-specific file */ |
| 193 | fname = astring_assemble_2(astring_alloc(), | |
| 193 | fname = astring_assemble_2(astring_alloc(), machine->basename, ".cfg"); | |
| 194 | 194 | filerr = mame_fopen(SEARCHPATH_CONFIG, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file); |
| 195 | 195 | astring_free(fname); |
| 196 | 196 | |
| 197 | 197 | if (filerr == FILERR_NONE) |
| 198 | 198 | { |
| 199 | config_save_xml(file, CONFIG_TYPE_GAME); | |
| 199 | config_save_xml(machine, file, CONFIG_TYPE_GAME); | |
| 200 | 200 | mame_fclose(file); |
| 201 | 201 | } |
| 202 | 202 | |
| r1591 | r1592 | |
| 213 | 213 | * |
| 214 | 214 | *************************************/ |
| 215 | 215 | |
| 216 | static int config_load_xml(mame_file *file, int which_type) | |
| 216 | static int config_load_xml(running_machine *machine, mame_file *file, int which_type) | |
| 217 | 217 | { |
| 218 | 218 | xml_data_node *root, *confignode, *systemnode; |
| 219 | 219 | config_type *type; |
| r1591 | r1592 | |
| 236 | 236 | goto error; |
| 237 | 237 | |
| 238 | 238 | /* strip off all the path crap from the source filename */ |
| 239 | srcfile = strrchr( | |
| 239 | srcfile = strrchr(machine->gamedrv->source_file, '/'); | |
| 240 | 240 | if (!srcfile) |
| 241 | srcfile = strrchr( | |
| 241 | srcfile = strrchr(machine->gamedrv->source_file, '\\'); | |
| 242 | 242 | if (!srcfile) |
| 243 | srcfile = strrchr( | |
| 243 | srcfile = strrchr(machine->gamedrv->source_file, ':'); | |
| 244 | 244 | if (!srcfile) |
| 245 | srcfile = | |
| 245 | srcfile = machine->gamedrv->source_file; | |
| 246 | 246 | else |
| 247 | 247 | srcfile++; |
| 248 | 248 | |
| r1591 | r1592 | |
| 258 | 258 | { |
| 259 | 259 | case CONFIG_TYPE_GAME: |
| 260 | 260 | /* only match on the specific game name */ |
| 261 | if (strcmp(name, | |
| 261 | if (strcmp(name, machine->gamedrv->name) != 0) | |
| 262 | 262 | continue; |
| 263 | 263 | break; |
| 264 | 264 | |
| r1591 | r1592 | |
| 273 | 273 | const game_driver *clone_of; |
| 274 | 274 | /* match on: default, game name, source file name, parent name, grandparent name */ |
| 275 | 275 | if (strcmp(name, "default") != 0 && |
| 276 | strcmp(name, | |
| 276 | strcmp(name, machine->gamedrv->name) != 0 && | |
| 277 | 277 | strcmp(name, srcfile) != 0 && |
| 278 | ((clone_of = driver_get_clone( | |
| 278 | ((clone_of = driver_get_clone(machine->gamedrv)) == NULL || strcmp(name, clone_of->name) != 0) && | |
| 279 | 279 | (clone_of == NULL || ((clone_of = driver_get_clone(clone_of)) == NULL) || strcmp(name, clone_of->name) != 0)) |
| 280 | 280 | continue; |
| 281 | 281 | break; |
| r1591 | r1592 | |
| 314 | 314 | * |
| 315 | 315 | *************************************/ |
| 316 | 316 | |
| 317 | static int config_save_xml(mame_file *file, int which_type) | |
| 317 | static int config_save_xml(running_machine *machine, mame_file *file, int which_type) | |
| 318 | 318 | { |
| 319 | 319 | xml_data_node *root = xml_file_create(); |
| 320 | 320 | xml_data_node *confignode, *systemnode; |
| r1591 | r1592 | |
| 334 | 334 | systemnode = xml_add_child(confignode, "system", NULL); |
| 335 | 335 | if (!systemnode) |
| 336 | 336 | goto error; |
| 337 | xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : | |
| 337 | xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine->gamedrv->name); | |
| 338 | 338 | |
| 339 | 339 | /* create the input node and write it out */ |
| 340 | 340 | /* loop over all registrants and call their save function */ |
| r1591 | r1592 | |
|---|---|---|
| 528 | 528 | |
| 529 | 529 | void debug_refresh_display(void) |
| 530 | 530 | { |
| 531 | video_frame_update(TRUE); | |
| 531 | video_frame_update(Machine, TRUE); | |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 |
| r1591 | r1592 | |
|---|---|---|
| 2096 | 2096 | view->supports_cursor = TRUE; |
| 2097 | 2097 | |
| 2098 | 2098 | /* start out with 16 bytes in a single column */ |
| 2099 | memdata->bytes_per_chunk = 1; | |
| 2099 | 2100 | memdata->chunks_displayed = 16; |
| 2100 | 2101 | |
| 2101 | 2102 | return 1; |
| r1591 | r1592 | |
| 2664 | 2665 | addrmask = cpuinfo->space[memdata->spacenum].logbytemask; |
| 2665 | 2666 | |
| 2666 | 2667 | /* clamp the bytes per chunk */ |
| 2667 | if (memdata->bytes_per_chunk < (1 << cpuinfo->space[memdata->spacenum].addr2byte_lshift)) | |
| 2668 | memdata->bytes_per_chunk = (1 << cpuinfo->space[memdata->spacenum].addr2byte_lshift); | |
| 2668 | while (memdata->bytes_per_chunk < (1 << cpuinfo->space[memdata->spacenum].addr2byte_lshift)) | |
| 2669 | { | |
| 2670 | memdata->bytes_per_chunk *= 2; | |
| 2671 | memdata->chunks_displayed /= 2; | |
| 2672 | if (memdata->chunks_displayed == 0) | |
| 2673 | memdata->chunks_displayed = 1; | |
| 2674 | } | |
| 2669 | 2675 | } |
| 2670 | 2676 | |
| 2671 | 2677 | /* determine how many characters we need for an address and set the divider */ |
| r1591 | r1592 | |
|---|---|---|
| 919 | 919 | m68ki_clear_trace(); |
| 920 | 920 | /* Interrupt mask to level 7 */ |
| 921 | 921 | FLAG_INT_MASK = 0x0700; |
| 922 | CPU_INT_LEVEL = 0; | |
| 922 | 923 | /* Reset VBR */ |
| 923 | 924 | REG_VBR = 0; |
| 924 | 925 | /* Go to supervisor mode */ |
| r1591 | r1592 | |
|---|---|---|
| 569 | 569 | |
| 570 | 570 | /* CST */ |
| 571 | 571 | case 0xf7: |
| 572 | watchdog_reset(); | |
| 572 | watchdog_reset(Machine); | |
| 573 | 573 | /* ADDP */ |
| 574 | 574 | case 0xe7: |
| 575 | 575 | tempval = RDMEM(ccpu.I); |
| r1591 | r1592 | |
|---|---|---|
| 32 | 32 | /** Added 4 cycle penalty when leaving HALT state for **/ |
| 33 | 33 | /** newer versions of the cpu core **/ |
| 34 | 34 | /** **/ |
| 35 | /** 1.4: **/ | |
| 36 | /** Split fetch and execute cycles. **/ | |
| 37 | /** **/ | |
| 35 | 38 | /*************************************************************/ |
| 36 | 39 | #include "z80gb.h" |
| 37 | 40 | #include "debugger.h" |
| r1591 | r1592 | |
| 62 | 65 | int (*irq_callback)(int irqline); |
| 63 | 66 | /* Timer stuff */ |
| 64 | 67 | void (*timer_callback)(int cycles); |
| 68 | /* Fetch & execute related */ | |
| 69 | int execution_state; | |
| 70 | UINT8 op; | |
| 65 | 71 | /* Others */ |
| 66 | 72 | int gb_speed; |
| 67 | 73 | int gb_speed_change_pending; |
| r1591 | r1592 | |
| 209 | 215 | Regs.w.IE = 0; |
| 210 | 216 | Regs.w.IF = 0; |
| 211 | 217 | |
| 218 | Regs.w.execution_state = 0; | |
| 212 | 219 | Regs.w.doHALTbug = 0; |
| 213 | 220 | Regs.w.ei_delay = 0; |
| 214 | 221 | Regs.w.gb_speed_change_pending = 0; |
| r1591 | r1592 | |
| 246 | 253 | Regs.w.enable &= ~HALTED; |
| 247 | 254 | Regs.w.IF &= ~(1 << irqline); |
| 248 | 255 | Regs.w.PC++; |
| 249 | if ( ! Regs.w.enable & IME ) { | |
| 250 | if ( Regs.w.features & Z80GB_FEATURE_HALT_BUG ) { | |
| 256 | if ( Regs.w.features & Z80GB_FEATURE_HALT_BUG ) { | |
| 257 | if ( ! Regs.w.enable & IME ) { | |
| 251 | 258 | /* Old cpu core (dmg/mgb/sgb) */ |
| 252 | 259 | /* check if the HALT bug should be performed */ |
| 253 | 260 | if ( Regs.w.haltIFstatus ) { |
| 254 | 261 | Regs.w.doHALTbug = 1; |
| 255 | 262 | } |
| 256 | } else { | |
| 257 | /* New cpu core (cgb/agb/ags) */ | |
| 263 | } | |
| 264 | } else { | |
| 265 | /* New cpu core (cgb/agb/ags) */ | |
| 266 | /* Adjust for internal syncing with video core */ | |
| 267 | /* This feature needs more investigation */ | |
| 268 | if ( irqline < 2 ) { | |
| 258 | 269 | CYCLES_PASSED( 4 ); |
| 259 | 270 | } |
| 260 | 271 | } |
| r1591 | r1592 | |
| 282 | 293 | /**********************************************************/ |
| 283 | 294 | static int z80gb_execute (int cycles) |
| 284 | 295 | { |
| 285 | UINT8 x; | |
| 286 | ||
| 287 | 296 | z80gb_ICount = cycles; |
| 288 | 297 | |
| 289 | 298 | do |
| 290 | 299 | { |
| 291 | z80gb_ProcessInterrupts (); | |
| 292 | CALL_MAME_DEBUG; | |
| 293 | if ( Regs.w.enable & HALTED ) { | |
| 294 | CYCLES_PASSED( Cycles[0x76] ); | |
| 300 | if ( Regs.w.execution_state ) { | |
| 301 | UINT8 x; | |
| 302 | /* Execute instruction */ | |
| 303 | switch( Regs.w.op ) { | |
| 304 | #include "opc_main.h" | |
| 305 | } | |
| 295 | 306 | } else { |
| 296 | x = mem_ReadByte (Regs.w.PC++); | |
| 297 | if ( Regs.w.doHALTbug ) { | |
| 298 | Regs.w.PC--; | |
| 299 | Regs.w.doHALTbug = 0; | |
| 307 | /* Fetch and count cycles */ | |
| 308 | z80gb_ProcessInterrupts (); | |
| 309 | CALL_MAME_DEBUG; | |
| 310 | if ( Regs.w.enable & HALTED ) { | |
| 311 | CYCLES_PASSED( Cycles[0x76] ); | |
| 312 | Regs.w.execution_state = 1; | |
| 313 | } else { | |
| 314 | Regs.w.op = mem_ReadByte (Regs.w.PC++); | |
| 315 | if ( Regs.w.doHALTbug ) { | |
| 316 | Regs.w.PC--; | |
| 317 | Regs.w.doHALTbug = 0; | |
| 318 | } | |
| 319 | CYCLES_PASSED( Cycles[Regs.w.op] ); | |
| 300 | 320 | } |
| 301 | CYCLES_PASSED( Cycles[x] ); | |
| 302 | switch (x) | |
| 303 | { | |
| 304 | #include "opc_main.h" | |
| 305 | } | |
| 306 | 321 | } |
| 322 | Regs.w.execution_state ^= 1; | |
| 307 | 323 | } while (z80gb_ICount > 0); |
| 308 | 324 | |
| 309 | 325 | return cycles - z80gb_ICount; |
| r1591 | r1592 | |
| 438 | 454 | case CPUINFO_INT_REGISTER + Z80GB_HL: info->i = Regs.w.HL; break; |
| 439 | 455 | case CPUINFO_INT_REGISTER + Z80GB_IE: info->i = Regs.w.IE; break; |
| 440 | 456 | case CPUINFO_INT_REGISTER + Z80GB_IF: info->i = Regs.w.IF; break; |
| 441 | case CPUINFO_INT_REGISTER + Z80GB_SPEED: info->i = 0x7E | ( ( Regs.w.gb_speed - 1 ) << 7 ) | Regs.w.gb_speed_change_pending; | |
| 457 | case CPUINFO_INT_REGISTER + Z80GB_SPEED: info->i = 0x7E | ( ( Regs.w.gb_speed - 1 ) << 7 ) | Regs.w.gb_speed_change_pending; break; | |
| 442 | 458 | |
| 443 | 459 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 444 | 460 | case CPUINFO_PTR_SET_INFO: info->setinfo = z80gb_set_info; break; |
| r1591 | r1592 | |
| 457 | 473 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 458 | 474 | case CPUINFO_STR_NAME: strcpy(info->s, "Z80GB"); break; |
| 459 | 475 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Nintendo Z80"); break; |
| 460 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1. | |
| 476 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.4"); break; | |
| 461 | 477 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; |
| 462 | 478 | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright The MESS Team."); break; |
| 463 | 479 |
| r1591 | r1592 | |
|---|---|---|
| 97 | 97 | /* extra check to prevent bad things */ |
| 98 | 98 | if (PC == 0 || opcode_table[cpu_readop16(TOBYTE(PC)) >> 4] == unimpl) |
| 99 | 99 | { |
| 100 | cpunum_set_input_line(cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); | |
| 100 | cpunum_set_input_line(Machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); | |
| 101 | 101 | DEBUGGER_BREAK; |
| 102 | 102 | } |
| 103 | 103 | } |
| r1591 | r1592 | |
|---|---|---|
| 804 | 804 | cpuintrf_pop_context(); |
| 805 | 805 | |
| 806 | 806 | /* generate triggers so that spin loops can key off them */ |
| 807 | cpu_triggerint(cpunum); | |
| 807 | cpu_triggerint(machine, cpunum); | |
| 808 | 808 | } |
| 809 | 809 | |
| 810 | 810 | |
| r1591 | r1592 | |
| 1210 | 1210 | /* if the CPU is halting itself, stop execution right away */ |
| 1211 | 1211 | if ((data & 0x8000) && !external_host_access) |
| 1212 | 1212 | tms34010_ICount = 0; |
| 1213 | cpunum_set_input_line(cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); | |
| 1213 | cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); | |
| 1214 | 1214 | |
| 1215 | 1215 | /* NMI issued? */ |
| 1216 | 1216 | if (data & 0x0100) |
| r1591 | r1592 | |
| 1361 | 1361 | /* if the CPU is halting itself, stop execution right away */ |
| 1362 | 1362 | if ((data & 0x8000) && !external_host_access) |
| 1363 | 1363 | tms34010_ICount = 0; |
| 1364 | cpunum_set_input_line(cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); | |
| 1364 | cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); | |
| 1365 | 1365 | |
| 1366 | 1366 | /* NMI issued? */ |
| 1367 | 1367 | if (data & 0x0100) |
| r1591 | r1592 | |
|---|---|---|
| 276 | 276 | |
| 277 | 277 | m37710i_cpu.m37710_regs[m37710_irq_levels[12]] |= 0x04; |
| 278 | 278 | m37710_set_irq_line(M37710_LINE_TIMERA0, PULSE_LINE); |
| 279 | cpu_triggerint(cpunum); | |
| 279 | cpu_triggerint(machine, cpunum); | |
| 280 | 280 | cpuintrf_pop_context(); |
| 281 | 281 | } |
| 282 | 282 | |
| r1591 | r1592 | |
| 289 | 289 | |
| 290 | 290 | m37710i_cpu.m37710_regs[m37710_irq_levels[11]] |= 0x04; |
| 291 | 291 | m37710_set_irq_line(M37710_LINE_TIMERA1, PULSE_LINE); |
| 292 | cpu_triggerint(cpunum); | |
| 292 | cpu_triggerint(machine, cpunum); | |
| 293 | 293 | cpuintrf_pop_context(); |
| 294 | 294 | } |
| 295 | 295 | |
| r1591 | r1592 | |
| 302 | 302 | |
| 303 | 303 | m37710i_cpu.m37710_regs[m37710_irq_levels[10]] |= 0x04; |
| 304 | 304 | m37710_set_irq_line(M37710_LINE_TIMERA2, PULSE_LINE); |
| 305 | cpu_triggerint(cpunum); | |
| 305 | cpu_triggerint(machine, cpunum); | |
| 306 | 306 | cpuintrf_pop_context(); |
| 307 | 307 | } |
| 308 | 308 | |
| r1591 | r1592 | |
| 315 | 315 | |
| 316 | 316 | m37710i_cpu.m37710_regs[m37710_irq_levels[9]] |= 0x04; |
| 317 | 317 | m37710_set_irq_line(M37710_LINE_TIMERA3, PULSE_LINE); |
| 318 | cpu_triggerint(cpunum); | |
| 318 | cpu_triggerint(machine, cpunum); | |
| 319 | 319 | cpuintrf_pop_context(); |
| 320 | 320 | } |
| 321 | 321 | |
| r1591 | r1592 | |
| 328 | 328 | |
| 329 | 329 | m37710i_cpu.m37710_regs[m37710_irq_levels[8]] |= 0x04; |
| 330 | 330 | m37710_set_irq_line(M37710_LINE_TIMERA4, PULSE_LINE); |
| 331 | cpu_triggerint(cpunum); | |
| 331 | cpu_triggerint(machine, cpunum); | |
| 332 | 332 | cpuintrf_pop_context(); |
| 333 | 333 | } |
| 334 | 334 | |
| r1591 | r1592 | |
| 341 | 341 | |
| 342 | 342 | m37710i_cpu.m37710_regs[m37710_irq_levels[7]] |= 0x04; |
| 343 | 343 | m37710_set_irq_line(M37710_LINE_TIMERB0, PULSE_LINE); |
| 344 | cpu_triggerint(cpunum); | |
| 344 | cpu_triggerint(machine, cpunum); | |
| 345 | 345 | cpuintrf_pop_context(); |
| 346 | 346 | } |
| 347 | 347 | |
| r1591 | r1592 | |
| 354 | 354 | |
| 355 | 355 | m37710i_cpu.m37710_regs[m37710_irq_levels[6]] |= 0x04; |
| 356 | 356 | m37710_set_irq_line(M37710_LINE_TIMERB1, PULSE_LINE); |
| 357 | cpu_triggerint(cpunum); | |
| 357 | cpu_triggerint(machine, cpunum); | |
| 358 | 358 | cpuintrf_pop_context(); |
| 359 | 359 | } |
| 360 | 360 | |
| r1591 | r1592 | |
| 367 | 367 | |
| 368 | 368 | m37710i_cpu.m37710_regs[m37710_irq_levels[5]] |= 0x04; |
| 369 | 369 | m37710_set_irq_line(M37710_LINE_TIMERB2, PULSE_LINE); |
| 370 | cpu_triggerint(cpunum); | |
| 370 | cpu_triggerint(machine, cpunum); | |
| 371 | 371 | cpuintrf_pop_context(); |
| 372 | 372 | } |
| 373 | 373 |
| r1591 | r1592 | |
|---|---|---|
| 1244 | 1244 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; |
| 1245 | 1245 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 1246 | 1246 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; |
| 1247 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = | |
| 1247 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 1248 | 1248 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; |
| 1249 | 1249 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 5; break; |
| 1250 | 1250 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| r1591 | r1592 | |
|---|---|---|
| 120 | 120 | #define S_ACCUM_M (2 << 4) |
| 121 | 121 | #define S_ACCUM_L (1 << 4) |
| 122 | 122 | |
| 123 | #define M_ACCUM_H ((INT64)0x0000FFFFll << S_ACCUM_H) | |
| 124 | #define M_ACCUM_M ((INT64)0x0000FFFFll << S_ACCUM_M) | |
| 125 | #define M_ACCUM_L ((INT64)0x0000FFFFll << S_ACCUM_L) | |
| 123 | #define M_ACCUM_H (((INT64)0x0000FFFF) << S_ACCUM_H) | |
| 124 | #define M_ACCUM_M (((INT64)0x0000FFFF) << S_ACCUM_M) | |
| 125 | #define M_ACCUM_L (((INT64)0x0000FFFF) << S_ACCUM_L) | |
| 126 | 126 | |
| 127 | 127 | #define R_ACCUM_H(x) ((INT16)((ACCUM(x) >> S_ACCUM_H) & 0x00FFFF)) |
| 128 | 128 | #define R_ACCUM_M(x) ((INT16)((ACCUM(x) >> S_ACCUM_M) & 0x00FFFF)) |
| r1591 | r1592 | |
| 345 | 345 | |
| 346 | 346 | static void rsp_init(int index, int clock, const void *_config, int (*irqcallback)(int)) |
| 347 | 347 | { |
| 348 | | |
| 348 | | |
| 349 | 349 | int accumIdx; |
| 350 | 350 | config = (rsp_config *)_config; |
| 351 | 351 | |
| r1591 | r1592 | |
| 355 | 355 | |
| 356 | 356 | rsp.irq_callback = irqcallback; |
| 357 | 357 | |
| 358 | #if 0 | |
| 359 | // Do not enable! RSP registers are in a *random* state at powerup... | |
| 358 | #if 1 | |
| 359 | // Inaccurate. RSP registers power on to a random state... | |
| 360 | 360 | for(regIdx = 0; regIdx < 32; regIdx++ ) |
| 361 | 361 | { |
| 362 | 362 | rsp.r[regIdx] = 0; |
| r1591 | r1592 | |
| 374 | 374 | #endif |
| 375 | 375 | |
| 376 | 376 | // ...except for the accumulators. |
| 377 | // We're not calling mame_rand() because initializing something with mame_rand() | |
| 378 | // makes me retch uncontrollably. | |
| 377 | 379 | for(accumIdx = 0; accumIdx < 8; accumIdx++ ) |
| 378 | 380 | { |
| 379 | 381 | rsp.accum[accumIdx] = 0; |
| r1591 | r1592 | |
| 2287 | 2289 | // Calculates reciprocal |
| 2288 | 2290 | |
| 2289 | 2291 | int del = (VS1REG & 7); |
| 2290 | int sel = | |
| 2292 | int sel = | |
| 2291 | 2293 | INT32 rec; |
| 2292 | 2294 | |
| 2293 | 2295 | rec = (INT16)(R_VREG_S(VS2REG, sel)); |
| r1591 | r1592 | |
| 2299 | 2301 | } |
| 2300 | 2302 | else |
| 2301 | 2303 | { |
| 2302 | int negative = 0; | |
| 2304 | int sign = 0; | |
| 2305 | int exp = 0; | |
| 2306 | int mantissa = 0; | |
| 2307 | ||
| 2303 | 2308 | if (rec < 0) |
| 2304 | 2309 | { |
| 2305 | rec = ~rec+1; | |
| 2306 | negative = 1; | |
| 2310 | rec = -rec; // rec = MINUS rec | |
| 2311 | sign = 1; | |
| 2307 | 2312 | } |
| 2308 | for (i = 15; i > 0; i--) | |
| 2313 | ||
| 2314 | // restrict to 10-bit mantissa | |
| 2315 | for (i = 15; i >= 0; i--) | |
| 2309 | 2316 | { |
| 2310 | 2317 | if (rec & (1 << i)) |
| 2311 | 2318 | { |
| 2312 | rec &= ((0xffc0) >> (15 - i)); | |
| 2313 | i = 0; | |
| 2319 | exp = i; | |
| 2320 | mantissa = (rec << (15 - i)) >> 6; | |
| 2321 | break; | |
| 2314 | 2322 | } |
| 2315 | 2323 | } |
| 2316 | rec = (INT32)(0x7fffffff / (double)rec); | |
| 2317 | for (i = 31; i > 0; i--) | |
| 2324 | ||
| 2325 | if (mantissa == 0x200) | |
| 2318 | 2326 | { |
| 2319 | if (rec & (1 << i)) | |
| 2320 | { | |
| 2321 | rec &= ((0xffff8000) >> (31 - i)); | |
| 2322 | i = 0; | |
| 2323 | } | |
| 2327 | rec = 0x7fffffff; | |
| 2324 | 2328 | } |
| 2325 | | |
| 2329 | | |
| 2326 | 2330 | { |
| 2327 | rec = ~rec; | |
| 2331 | rec = 0xffffffffU / mantissa; | |
| 2332 | ||
| 2333 | // | |
| 2334 | // simulate rounding error | |
| 2335 | // | |
| 2336 | // This has been verified on the real hardware. | |
| 2337 | // | |
| 2338 | // I was able to replicate this exact behaviour by using a five-round | |
| 2339 | // Newton reciprocal method using floorf() on intermediate results | |
| 2340 | // to force the use of IEEE 754 32bit floats. | |
| 2341 | // However, for the sake of portability, we'll use integer arithmetic. | |
| 2342 | // | |
| 2343 | if (rec & 0x800) | |
| 2344 | rec += 1; | |
| 2345 | ||
| 2346 | rec <<= 8; | |
| 2328 | 2347 | } |
| 2348 | ||
| 2349 | // restrict result to 17 significant bits | |
| 2350 | rec &= 0x7fffc000; | |
| 2351 | ||
| 2352 | rec >>= exp; | |
| 2353 | ||
| 2354 | if (sign) | |
| 2355 | { | |
| 2356 | rec = ~rec; // rec = BITWISE NOT rec | |
| 2357 | } | |
| 2329 | 2358 | } |
| 2330 | 2359 | |
| 2331 | 2360 | for (i=0; i < 8; i++) |
| r1591 | r1592 | |
| 2683 | 2712 | // ------------------------------------------------ |
| 2684 | 2713 | // |
| 2685 | 2714 | |
| 2686 | if (RTREG) RTVAL = rsp.flag[RDREG]; | |
| 2715 | if (RTREG) | |
| 2716 | { | |
| 2717 | if (RDREG == 2) | |
| 2718 | { | |
| 2719 | // Anciliary clipping flags | |
| 2720 | RTVAL = rsp.flag[RDREG] & 0x00ff; | |
| 2721 | } | |
| 2722 | else | |
| 2723 | { | |
| 2724 | // All other flags are 16 bits but sign-extended at retrieval | |
| 2725 | RTVAL = (UINT32)rsp.flag[RDREG] | ( ( rsp.flag[RDREG] & 0x8000 ) ? 0xffff0000 : 0 ); | |
| 2726 | } | |
| 2727 | } | |
| 2687 | 2728 | break; |
| 2688 | 2729 | } |
| 2689 | 2730 | case 0x04: /* MTC2 */ |
| r1591 | r1592 | |
| 2884 | 2925 | case CPUINFO_INT_REGISTER + RSP_R30: rsp.r[30] = info->i; break; |
| 2885 | 2926 | case CPUINFO_INT_SP: |
| 2886 | 2927 | case CPUINFO_INT_REGISTER + RSP_R31: rsp.r[31] = info->i; break; |
| 2887 | case CPUINFO_INT_REGISTER + RSP_SR: | |
| 2888 | rsp.sr = info->i; | |
| 2889 | if( info->i & RSP_STATUS_SSTEP ) | |
| 2890 | { | |
| 2891 | rsp.step_count = 1; | |
| 2892 | } | |
| 2893 | break; | |
| 2894 | case CPUINFO_INT_REGISTER + RSP_NEXTPC: rsp.nextpc = info->i; break; | |
| 2928 | case CPUINFO_INT_REGISTER + RSP_SR: rsp.sr = info->i; break; | |
| 2929 | case CPUINFO_INT_REGISTER + RSP_NEXTPC: rsp.nextpc = info->i; break; | |
| 2930 | case CPUINFO_INT_REGISTER + RSP_STEPCNT: rsp.step_count = info->i; break; | |
| 2895 | 2931 | } |
| 2896 | 2932 | } |
| 2897 | 2933 | |
| r1591 | r1592 | |
| 2963 | 2999 | case CPUINFO_INT_REGISTER + RSP_R31: info->i = rsp.r[31]; break; |
| 2964 | 3000 | case CPUINFO_INT_REGISTER + RSP_SR: info->i = rsp.sr; break; |
| 2965 | 3001 | case CPUINFO_INT_REGISTER + RSP_NEXTPC: info->i = rsp.nextpc; break; |
| 3002 | case CPUINFO_INT_REGISTER + RSP_STEPCNT: info->i = rsp.step_count; break; | |
| 2966 | 3003 | |
| 2967 | 3004 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2968 | 3005 | case CPUINFO_PTR_GET_CONTEXT: info->getcontext = rsp_get_context; break; |
| r1591 | r1592 | |
| 3023 | 3060 | case CPUINFO_STR_REGISTER + RSP_R31: sprintf(info->s, "R31: %08X", rsp.r[31]); break; |
| 3024 | 3061 | case CPUINFO_STR_REGISTER + RSP_SR: sprintf(info->s, "SR: %08X", rsp.sr); break; |
| 3025 | 3062 | case CPUINFO_STR_REGISTER + RSP_NEXTPC: sprintf(info->s, "NPC: %08X", rsp.nextpc);break; |
| 3063 | case CPUINFO_STR_REGISTER + RSP_STEPCNT: sprintf(info->s, "STEP: %d", rsp.step_count); break; | |
| 3026 | 3064 | } |
| 3027 | 3065 | } |
| r1591 | r1592 | |
|---|---|---|
| 48 | 48 | RSP_R31, |
| 49 | 49 | RSP_SR, |
| 50 | 50 | RSP_NEXTPC, |
| 51 | RSP_STEPCNT, | |
| 51 | 52 | }; |
| 52 | 53 | |
| 53 | 54 | #define RSP_STATUS_HALT 0x0001 |
| r1591 | r1592 | |
|---|---|---|
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | 56 | #define M6502_IRQ_LINE 0 |
| 57 | /* use cpunum_set_input_line(cpu, M6502_SET_OVERFLOW, level) | |
| 57 | /* use cpunum_set_input_line(machine, cpu, M6502_SET_OVERFLOW, level) | |
| 58 | 58 | to change level of the so input line |
| 59 | 59 | positiv edge sets overflow flag */ |
| 60 | 60 | #define M6502_SET_OVERFLOW 1 |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | 33 | #define M6509_IRQ_LINE M6502_IRQ_LINE |
| 34 | /* use cpunum_set_input_line(cpu, M6509_SET_OVERFLOW, level) | |
| 34 | /* use cpunum_set_input_line(machine, cpu, M6509_SET_OVERFLOW, level) | |
| 35 | 35 | to change level of the so input line |
| 36 | 36 | positiv edge sets overflow flag */ |
| 37 | 37 | #define M6509_SET_OVERFLOW 3 |
| r1591 | r1592 | |
|---|---|---|
| 496 | 496 | /* if we're halted, we shouldn't be here */ |
| 497 | 497 | if (!(jaguar.ctrl[G_CTRL] & 1)) |
| 498 | 498 | { |
| 499 | cpunum_set_input_line(cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); | |
| 499 | cpunum_set_input_line(Machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); | |
| 500 | 500 | return cycles; |
| 501 | 501 | } |
| 502 | 502 | |
| r1591 | r1592 | |
| 542 | 542 | /* if we're halted, we shouldn't be here */ |
| 543 | 543 | if (!(jaguar.ctrl[G_CTRL] & 1)) |
| 544 | 544 | { |
| 545 | cpunum_set_input_line(cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); | |
| 545 | cpunum_set_input_line(Machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); | |
| 546 | 546 | return cycles; |
| 547 | 547 | } |
| 548 | 548 | |
| r1591 | r1592 | |
| 1362 | 1362 | jaguar.ctrl[offset] = newval; |
| 1363 | 1363 | if ((oldval ^ newval) & 0x01) |
| 1364 | 1364 | { |
| 1365 | cpunum_set_input_line(cpunum, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 1365 | cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 1366 | 1366 | if (cpu_getexecutingcpu() >= 0) |
| 1367 | 1367 | cpu_yield(); |
| 1368 | 1368 | } |
| r1591 | r1592 | |
| 1477 | 1477 | jaguar.ctrl[offset] = newval; |
| 1478 | 1478 | if ((oldval ^ newval) & 0x01) |
| 1479 | 1479 | { |
| 1480 | cpunum_set_input_line(cpunum, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 1480 | cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 1481 | 1481 | if (cpu_getexecutingcpu() >= 0) |
| 1482 | 1482 | cpu_yield(); |
| 1483 | 1483 | } |
| r1591 | r1592 | |
|---|---|---|
| 12 | 12 | enum |
| 13 | 13 | { |
| 14 | 14 | CPUINFO_PTR_I8085_SOD_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC, |
| 15 | CPUINFO_PTR_I8085_SID_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC + 1, | |
| 15 | 16 | CPUINFO_INT_I8085_SID = CPUINFO_INT_CPU_SPECIFIC |
| 16 | 17 | }; |
| 17 | 18 |
| r1591 | r1592 | |
|---|---|---|
| 144 | 144 | INT8 irq_state[4]; |
| 145 | 145 | int (*irq_callback)(int); |
| 146 | 146 | void (*sod_callback)(int state); |
| 147 | int (*sid_callback)(void); | |
| 147 | 148 | } i8085_Regs; |
| 148 | 149 | |
| 149 | 150 | static int i8085_ICount = 0; |
| r1591 | r1592 | |
| 313 | 314 | if( I.cputype ) { |
| 314 | 315 | i8085_ICount -= 7; /* RIM */ |
| 315 | 316 | I.AF.b.h = I.IM; |
| 317 | if (I.sid_callback) | |
| 318 | I.AF.b.h = (I.AF.b.h & 0x7f) | ((*I.sid_callback)() ? 0x80 : 0); | |
| 316 | 319 | I.AF.b.h |= RIM_IEN; RIM_IEN = 0; //AT: read and clear IEN status latch |
| 317 | 320 | } else { |
| 318 | 321 | i8085_ICount -= 4; /* NOP undocumented */ |
| r1591 | r1592 | |
| 1340 | 1343 | static void i8085_reset(void) |
| 1341 | 1344 | { |
| 1342 | 1345 | int (*save_irqcallback)(int); |
| 1346 | void (*save_sodcallback)(int); | |
| 1347 | int (*save_sidcallback)(void); | |
| 1343 | 1348 | int cputype_bak = I.cputype; |
| 1344 | 1349 | |
| 1345 | 1350 | init_tables(); |
| 1346 | 1351 | save_irqcallback = I.irq_callback; |
| 1352 | save_sodcallback = I.sod_callback; | |
| 1353 | save_sidcallback = I.sid_callback; | |
| 1347 | 1354 | memset(&I, 0, sizeof(i8085_Regs)); |
| 1348 | 1355 | I.irq_callback = save_irqcallback; |
| 1356 | I.sod_callback = save_sodcallback; | |
| 1357 | I.sid_callback = save_sidcallback; | |
| 1349 | 1358 | change_pc(I.PC.d); |
| 1350 | 1359 | |
| 1351 | 1360 | I.cputype = cputype_bak; |
| r1591 | r1592 | |
| 1612 | 1621 | |
| 1613 | 1622 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 1614 | 1623 | case CPUINFO_PTR_I8085_SOD_CALLBACK: I.sod_callback = (void (*)(int))info->f; break; |
| 1624 | case CPUINFO_PTR_I8085_SID_CALLBACK: I.sid_callback = (int (*)(void))info->f; break; | |
| 1615 | 1625 | } |
| 1616 | 1626 | } |
| 1617 | 1627 | |
| r1591 | r1592 | |
| 1631 | 1641 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0xff; break; |
| 1632 | 1642 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1633 | 1643 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; |
| 1634 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = | |
| 1644 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 2; break; | |
| 1635 | 1645 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1; break; |
| 1636 | 1646 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 3; break; |
| 1637 | 1647 | case CPUINFO_INT_MIN_CYCLES: info->i = 4; break; |
| r1591 | r1592 | |
| 1739 | 1749 | switch (state) |
| 1740 | 1750 | { |
| 1741 | 1751 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1752 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; | |
| 1742 | 1753 | case CPUINFO_INT_INPUT_LINES: info->i = 1; break; |
| 1743 | 1754 | case CPUINFO_INT_INPUT_STATE + I8085_INTR_LINE: info->i = (I.IREQ & IM_INTR) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1744 | 1755 | case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = (I.IREQ & IM_TRAP) ? ASSERT_LINE : CLEAR_LINE; break; |
| r1591 | r1592 | |
|---|---|---|
| 372 | 372 | case AM_r1: |
| 373 | 373 | ea = oprom[pos++]; |
| 374 | 374 | switch( ea & 0xC0 ) { |
| 375 | case 0x00: | |
| 375 | 376 | dst += sprintf( dst, "@r%02Xh", (ea >> 3 ) & 0x07 ); |
| 376 | 377 | break; |
| 377 | 378 | case 0x40: |
| r1591 | r1592 | |
|---|---|---|
| 4406 | 4406 | if (sh4.irln == value) |
| 4407 | 4407 | return; |
| 4408 | 4408 | sh4.irln = value; |
| 4409 | cpunum_set_input_line(cpunum, SH4_IRLn, PULSE_LINE); | |
| 4409 | cpunum_set_input_line(Machine, cpunum, SH4_IRLn, PULSE_LINE); | |
| 4410 | 4410 | } |
| 4411 | 4411 | |
| 4412 | 4412 | static void set_irq_line(int irqline, int state) // set state of external interrupt line |
| r1591 | r1592 | |
|---|---|---|
| 605 | 605 | if(PC != PPC) op = cpu_readop(PC); |
| 606 | 606 | |
| 607 | 607 | //Update Timer (if any timers are running) |
| 608 | if( | |
| 608 | if((GET_IT0 | |
| 609 | 609 | update_timer(i8051.prev_used_cycles); |
| 610 | 610 | |
| 611 | 611 | //Update Serial (if serial port sending data) |
| r1591 | r1592 | |
|---|---|---|
| 724 | 724 | |
| 725 | 725 | static TIMER_CALLBACK( compare_int_callback ) |
| 726 | 726 | { |
| 727 | cpunum_set_input_line(param, MIPS3_IRQ5, ASSERT_LINE); | |
| 727 | cpunum_set_input_line(machine, param, MIPS3_IRQ5, ASSERT_LINE); | |
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 |
| r1591 | r1592 | |
|---|---|---|
| 561 | 561 | if( --tms7000.t1_decrementer < 0 ) /* Decrement timer1 register and check for underflow */ |
| 562 | 562 | { |
| 563 | 563 | tms7000.t1_decrementer = tms7000.pf[2]; /* Reload decrementer (8 bit) */ |
| 564 | cpunum_set_input_line( cpu_getactivecpu(), TMS7000_IRQ2_LINE, HOLD_LINE); | |
| 564 | cpunum_set_input_line(Machine, cpu_getactivecpu(), TMS7000_IRQ2_LINE, HOLD_LINE); | |
| 565 | 565 | //LOG( ("tms7000: trigger int2 (cycles: %d)\t%d\tdelta %d\n", activecpu_gettotalcycles(), activecpu_gettotalcycles() - tick, tms7000_cycles_per_INT2-(activecpu_gettotalcycles() - tick) ); |
| 566 | 566 | //tick = activecpu_gettotalcycles() ); |
| 567 | 567 | /* Also, cascade out to timer 2 - timer 2 unimplemented */ |
| r1591 | r1592 | |
|---|---|---|
| 1200 | 1200 | } |
| 1201 | 1201 | break; |
| 1202 | 1202 | case 0xe: /* B #offs */ |
| 1203 | offs = ( opcode & THUMB_BRANCH_OFFS ) << 1; | |
| 1204 | if( offs & 0x00000800 ) | |
| 1205 | { | |
| 1206 | offs |= 0xfffff800; | |
| 1207 | } | |
| 1208 | pBuf += sprintf( pBuf, "B #%08x (%08x)", offs, pc + 4 + offs); | |
| 1203 | if( opcode & THUMB_BLOP_LO ) | |
| 1204 | { | |
| 1205 | addr = ( ( opcode & THUMB_BLOP_OFFS ) << 1 ) & 0xfffc; | |
| 1206 | pBuf += sprintf( pBuf, "BLX (LO) %08x", addr ); | |
| 1207 | dasmflags = DASMFLAG_STEP_OVER; | |
| 1208 | } | |
| 1209 | else | |
| 1210 | { | |
| 1211 | offs = ( opcode & THUMB_BRANCH_OFFS ) << 1; | |
| 1212 | if( offs & 0x00000800 ) | |
| 1213 | { | |
| 1214 | offs |= 0xfffff800; | |
| 1215 | } | |
| 1216 | pBuf += sprintf( pBuf, "B #%08x (%08x)", offs, pc + 4 + offs); | |
| 1217 | } | |
| 1209 | 1218 | break; |
| 1210 | 1219 | case 0xf: /* BL */ |
| 1211 | 1220 | if( opcode & THUMB_BLOP_LO ) |
| 1212 | 1221 | { |
| 1213 | pBuf += sprintf( pBuf, "BL (LO) %0 | |
| 1222 | pBuf += sprintf( pBuf, "BL (LO) %08x", ( opcode & THUMB_BLOP_OFFS ) << 1 ); | |
| 1214 | 1223 | dasmflags = DASMFLAG_STEP_OVER; |
| 1215 | 1224 | } |
| 1216 | 1225 | else |
| r1591 | r1592 | |
| 1220 | 1229 | { |
| 1221 | 1230 | addr |= 0xff800000; |
| 1222 | 1231 | } |
| 1223 | pBuf += sprintf( pBuf, "BL (HI) %0 | |
| 1232 | pBuf += sprintf( pBuf, "BL (HI) %08x", a | |
| 1224 | 1233 | dasmflags = DASMFLAG_STEP_OVER; |
| 1225 | 1234 | } |
| 1226 | 1235 | break; |
| r1591 | r1592 | |
|---|---|---|
| 1109 | 1109 | } |
| 1110 | 1110 | break; |
| 1111 | 1111 | case 0xe: /* B #offs */ |
| 1112 | offs = ( insn & THUMB_BRANCH_OFFS ) << 1; | |
| 1113 | if( offs & 0x00000800 ) | |
| 1114 | { | |
| 1115 | offs |= 0xfffff800; | |
| 1116 | } | |
| 1117 | R15 += 4 + offs; | |
| 1112 | if( insn & THUMB_BLOP_LO ) | |
| 1113 | { | |
| 1114 | addr = GET_REGISTER(14); | |
| 1115 | addr += ( insn & THUMB_BLOP_OFFS ) << 1; | |
| 1116 | addr &= 0xfffffffc; | |
| 1117 | SET_REGISTER( 14, ( R15 + 4 ) | 1 ); | |
| 1118 | R15 = addr; | |
| 1119 | } | |
| 1120 | else | |
| 1121 | { | |
| 1122 | offs = ( insn & THUMB_BRANCH_OFFS ) << 1; | |
| 1123 | if( offs & 0x00000800 ) | |
| 1124 | { | |
| 1125 | offs |= 0xfffff800; | |
| 1126 | } | |
| 1127 | R15 += 4 + offs; | |
| 1128 | } | |
| 1118 | 1129 | break; |
| 1119 | 1130 | case 0xf: /* BL */ |
| 1120 | 1131 | if( insn & THUMB_BLOP_LO ) |
| r1591 | r1592 | |
|---|---|---|
| 2697 | 2697 | switch (state) |
| 2698 | 2698 | { |
| 2699 | 2699 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2700 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 2700 | 2701 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 2701 | 2702 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; |
| 2702 | 2703 | |
| r1591 | r1592 | |
| 2725 | 2726 | { |
| 2726 | 2727 | switch (state) |
| 2727 | 2728 | { |
| 2729 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 2730 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 2731 | ||
| 2728 | 2732 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2729 | 2733 | case CPUINFO_PTR_INIT: info->init = m6802_init; break; |
| 2730 | 2734 | #ifdef MAME_DEBUG |
| r1591 | r1592 | |
| 2750 | 2754 | switch (state) |
| 2751 | 2755 | { |
| 2752 | 2756 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2757 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 2753 | 2758 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 2754 | 2759 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; |
| 2755 | 2760 | |
| r1591 | r1592 | |
| 2780 | 2785 | { |
| 2781 | 2786 | switch (state) |
| 2782 | 2787 | { |
| 2788 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 2789 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 2790 | ||
| 2783 | 2791 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2784 | 2792 | case CPUINFO_PTR_INIT: info->init = m6808_init; break; |
| 2785 | 2793 | #ifdef MAME_DEBUG |
| r1591 | r1592 | |
| 2805 | 2813 | switch (state) |
| 2806 | 2814 | { |
| 2807 | 2815 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2816 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 2808 | 2817 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 2809 | 2818 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 9; break; |
| 2810 | 2819 | |
| r1591 | r1592 | |
| 2833 | 2842 | { |
| 2834 | 2843 | switch (state) |
| 2835 | 2844 | { |
| 2845 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 2846 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 2847 | ||
| 2836 | 2848 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2837 | 2849 | case CPUINFO_PTR_INIT: info->init = nsc8105_init; break; |
| 2838 | 2850 | case CPUINFO_PTR_EXECUTE: info->execute = nsc8105_execute; break; |
| r1591 | r1592 | |
|---|---|---|
| 1548 | 1548 | static void cp1610_reset(void) |
| 1549 | 1549 | { |
| 1550 | 1550 | /* This is how we set the reset vector */ |
| 1551 | cpunum_set_input_line(cpu_getactivecpu(), CP1610_RESET, PULSE_LINE); | |
| 1551 | cpunum_set_input_line(Machine, cpu_getactivecpu(), CP1610_RESET, PULSE_LINE); | |
| 1552 | 1552 | } |
| 1553 | 1553 | |
| 1554 | 1554 | /*************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | void config_init(running_machine *machine); |
| 57 | 57 | void config_register(const char *nodename, config_callback load, config_callback save); |
| 58 | int config_load_settings(void); | |
| 59 | void config_save_settings(void); | |
| 58 | int config_load_settings(running_machine *machine); | |
| 59 | void config_save_settings(running_machine *machine); | |
| 60 | 60 | |
| 61 | 61 | #endif /* __CONFIG_H__ */ |
| r1591 | r1592 | |
|---|---|---|
| 149 | 149 | ui_gfx_ui_handler - primary UI handler |
| 150 | 150 | -------------------------------------------------*/ |
| 151 | 151 | |
| 152 | UINT32 ui_gfx_ui_handler(UINT32 uistate) | |
| 152 | UINT32 ui_gfx_ui_handler(running_machine *machine, UINT32 uistate) | |
| 153 | 153 | { |
| 154 | 154 | ui_gfx_state *state = &ui_gfx; |
| 155 | 155 |
| r1591 | r1592 | |
|---|---|---|
| 50 | 50 | #include "driver.h" |
| 51 | 51 | #include "resnet.h" |
| 52 | 52 | |
| 53 | #define VERBOSE 0 | |
| 54 | ||
| 55 | ||
| 53 | 56 | double compute_resistor_weights( |
| 54 | 57 | int minval, int maxval, double scaler, |
| 55 | 58 | int count_1, const int * resistances_1, double * weights_1, int pulldown_1, int pullup_1, |
| r1591 | r1592 | |
| 109 | 112 | |
| 110 | 113 | /* parameters validity check */ |
| 111 | 114 | if (count > MAX_RES_PER_NET) |
| 112 | { | |
| 113 | logerror(" ERROR: res_net.h: compute_resistor_weights(): too many resistors in net #%i. The maximum allowed is %i, the number requested was: %i\n",n, MAX_RES_PER_NET, count); | |
| 114 | /* quit */ | |
| 115 | return (0.0); | |
| 116 | } | |
| 115 | fatalerror("compute_resistor_weights(): too many resistors in net #%i. The maximum allowed is %i, the number requested was: %i\n",n, MAX_RES_PER_NET, count); | |
| 117 | 116 | |
| 118 | 117 | |
| 119 | 118 | if (count > 0) |
| r1591 | r1592 | |
| 130 | 129 | } |
| 131 | 130 | } |
| 132 | 131 | if (networks_no < 1) |
| 133 | { | |
| 134 | /* error - no networks to anaylse */ | |
| 135 | logerror(" ERROR: res_net.h: compute_resistor_weights(): no input data\n"); | |
| 136 | return (0.0); | |
| 137 | } | |
| 132 | fatalerror("compute_resistor_weights(): no input data\n"); | |
| 138 | 133 | |
| 139 | 134 | /* calculate outputs for all given networks */ |
| 140 | 135 | for( i = 0; i < networks_no; i++ ) |
| r1591 | r1592 | |
| 208 | 203 | } |
| 209 | 204 | |
| 210 | 205 | /* debug code */ |
| 211 | #if | |
| 206 | #if | |
| 212 | 207 | logerror("compute_resistor_weights(): scaler = %15.10f\n",scale); |
| 213 | 208 | logerror("min val :%i max val:%i Total number of networks :%i\n", minval, maxval, networks_no ); |
| 214 | 209 | |
| r1591 | r1592 | |
| 301 | 296 | |
| 302 | 297 | /* parameters validity check */ |
| 303 | 298 | if (count > MAX_RES_PER_NET) |
| 304 | { | |
| 305 | logerror(" ERROR: res_net.h: compute_resistor_net_outputs(): too many resistors in net #%i. The maximum allowed is %i, the number requested was: %i\n",n, MAX_RES_PER_NET, count); | |
| 306 | /* quit */ | |
| 307 | free(o); | |
| 308 | free(os); | |
| 309 | return (0.0); | |
| 310 | } | |
| 299 | fatalerror("compute_resistor_net_outputs(): too many resistors in net #%i. The maximum allowed is %i, the number requested was: %i\n",n, MAX_RES_PER_NET, count); | |
| 311 | 300 | |
| 312 | 301 | if (count > 0) |
| 313 | 302 | { |
| r1591 | r1592 | |
| 324 | 313 | } |
| 325 | 314 | |
| 326 | 315 | if (networks_no<1) |
| 327 | { | |
| 328 | /* error - no networks to anaylse */ | |
| 329 | logerror(" ERROR: res_net.h: compute_resistor_net_outputs(): no input data\n"); | |
| 330 | free(o); | |
| 331 | free(os); | |
| 332 | return (0.0); | |
| 333 | } | |
| 316 | fatalerror("compute_resistor_net_outputs(): no input data\n"); | |
| 334 | 317 | |
| 335 | 318 | /* calculate outputs for all given networks */ |
| 336 | 319 | for( i = 0; i < networks_no; i++ ) |
| r1591 | r1592 | |
| 413 | 396 | } |
| 414 | 397 | |
| 415 | 398 | /* debug code */ |
| 416 | #if | |
| 399 | #if | |
| 417 | 400 | logerror("compute_resistor_net_outputs(): scaler = %15.10f\n",scale); |
| 418 | 401 | logerror("min val :%i max val:%i Total number of networks :%i\n", minval, maxval, networks_no ); |
| 419 | 402 |
| r1591 | r1592 | |
|---|---|---|
| 135 | 135 | UINT8 pal[19268*3]; |
| 136 | 136 | |
| 137 | 137 | /* init v9938 512-color palette */ |
| 138 | | |
| 138 | PALETTE_INIT_CALL(v9938 | |
| 139 | 139 | |
| 140 | 140 | /* set up YJK table */ |
| 141 | 141 | pal_indYJK = auto_malloc(0x20000 * sizeof(UINT16)); |
| r1591 | r1592 | |
| 430 | 430 | else |
| 431 | 431 | vdp.vram_exp = NULL; |
| 432 | 432 | |
| 433 | | |
| 433 | VIDEO_START_CALL(generic_bitmapped | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | void v9938_reset (void) |
| r1591 | r1592 | |
|---|---|---|
| 197 | 197 | static void init_tmu_shared(tmu_shared_state *s); |
| 198 | 198 | static void init_tmu(voodoo_state *v, tmu_state *t, int type, voodoo_reg *reg, void *memory, int tmem); |
| 199 | 199 | static void soft_reset(voodoo_state *v); |
| 200 | static void check_stalled_cpu(voodoo_state *v, attotime current_time); | |
| 200 | static void check_stalled_cpu(running_machine *machine, voodoo_state *v, attotime current_time); | |
| 201 | 201 | static void flush_fifos(voodoo_state *v, attotime current_time); |
| 202 | 202 | static TIMER_CALLBACK( stall_cpu_callback ); |
| 203 | 203 | static void stall_cpu(voodoo_state *v, int state, attotime current_time); |
| r1591 | r1592 | |
| 1019 | 1019 | |
| 1020 | 1020 | /* we may be able to unstall now */ |
| 1021 | 1021 | if (v->pci.stall_state != NOT_STALLED) |
| 1022 | check_stalled_cpu(v, timer_get_time()); | |
| 1022 | check_stalled_cpu(Machine, v, timer_get_time()); | |
| 1023 | 1023 | |
| 1024 | 1024 | /* periodically log rasterizer info */ |
| 1025 | 1025 | v->stats.swaps++; |
| r1591 | r1592 | |
| 2141 | 2141 | |
| 2142 | 2142 | static TIMER_CALLBACK( stall_cpu_callback ) |
| 2143 | 2143 | { |
| 2144 | check_stalled_cpu(ptr, timer_get_time()); | |
| 2144 | check_stalled_cpu(machine, ptr, timer_get_time()); | |
| 2145 | 2145 | } |
| 2146 | 2146 | |
| 2147 | 2147 | |
| 2148 | static void check_stalled_cpu(voodoo_state *v, attotime current_time) | |
| 2148 | static void check_stalled_cpu(running_machine *machine, voodoo_state *v, attotime current_time) | |
| 2149 | 2149 | { |
| 2150 | 2150 | int resume = FALSE; |
| 2151 | 2151 | |
| r1591 | r1592 | |
| 2188 | 2188 | if (v->pci.stall_callback) |
| 2189 | 2189 | (*v->pci.stall_callback)(FALSE); |
| 2190 | 2190 | else |
| 2191 | cpu_trigger(v->trigger); | |
| 2191 | cpu_trigger(machine, v->trigger); | |
| 2192 | 2192 | } |
| 2193 | 2193 | |
| 2194 | 2194 | /* if not, set a timer for the next one */ |
| r1591 | r1592 | |
|---|---|---|
| 303 | 303 | ***************************************************************************/ |
| 304 | 304 | |
| 305 | 305 | /*------------------------------------------------- |
| 306 | | |
| 306 | VIDEO_START( generic ) - general video system | |
| 307 | 307 | -------------------------------------------------*/ |
| 308 | 308 | |
| 309 | 309 | VIDEO_START( generic ) |
| 310 | 310 | { |
| 311 | assert_always(videoram_size != 0, "VIDEO_START(generic) requires non-zero videoram_size"); | |
| 312 | ||
| 313 | 311 | /* allocate the temporary bitmap */ |
| 314 | 312 | tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 315 | 313 | } |
| 316 | 314 | |
| 317 | 315 | |
| 318 | 316 | /*------------------------------------------------- |
| 319 | | |
| 317 | VIDEO_START( generic_bitmapped ) - general video | |
| 320 | 318 | system with a bitmap |
| 321 | 319 | -------------------------------------------------*/ |
| 322 | 320 | |
| r1591 | r1592 | |
| 331 | 329 | |
| 332 | 330 | |
| 333 | 331 | /*------------------------------------------------- |
| 334 | | |
| 332 | VIDEO_UPDATE( generic_bitmapped ) - blast the | |
| 335 | 333 | generic bitmap to the screen |
| 336 | 334 | -------------------------------------------------*/ |
| 337 | 335 | |
| r1591 | r1592 | |
| 588 | 586 | |
| 589 | 587 | |
| 590 | 588 | /*************************************************************************** |
| 591 | GENERIC PALETTE READ HANDLERS | |
| 592 | ***************************************************************************/ | |
| 593 | ||
| 594 | /*------------------------------------------------- | |
| 595 | 8-bit read handlers | |
| 596 | -------------------------------------------------*/ | |
| 597 | ||
| 598 | READ8_HANDLER( paletteram_r ) | |
| 599 | { | |
| 600 | return paletteram[offset]; | |
| 601 | } | |
| 602 | ||
| 603 | READ8_HANDLER( paletteram_2_r ) | |
| 604 | { | |
| 605 | return paletteram_2[offset]; | |
| 606 | } | |
| 607 | ||
| 608 | ||
| 609 | /*------------------------------------------------- | |
| 610 | 16-bit read handlers | |
| 611 | -------------------------------------------------*/ | |
| 612 | ||
| 613 | READ16_HANDLER( paletteram16_word_r ) | |
| 614 | { | |
| 615 | return paletteram16[offset]; | |
| 616 | } | |
| 617 | ||
| 618 | READ16_HANDLER( paletteram16_2_word_r ) | |
| 619 | { | |
| 620 | return paletteram16_2[offset]; | |
| 621 | } | |
| 622 | ||
| 623 | ||
| 624 | /*------------------------------------------------- | |
| 625 | 32-bit read handlers | |
| 626 | -------------------------------------------------*/ | |
| 627 | ||
| 628 | READ32_HANDLER( paletteram32_r ) | |
| 629 | { | |
| 630 | return paletteram32[offset]; | |
| 631 | } | |
| 632 | ||
| 633 | ||
| 634 | ||
| 635 | /*************************************************************************** | |
| 636 | 589 | 3-3-2 RGB PALETTE WRITE HANDLERS |
| 637 | 590 | ***************************************************************************/ |
| 638 | 591 |
| r1591 | r1592 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | |
| 142 | /* ----- generic palette RAM | |
| 142 | /* ----- generic palette RAM | |
| 143 | 143 | |
| 144 | /* read handlers */ | |
| 145 | READ8_HANDLER( paletteram_r ); | |
| 146 | READ8_HANDLER( paletteram_2_r ); | |
| 147 | READ16_HANDLER( paletteram16_word_r ); | |
| 148 | READ16_HANDLER( paletteram16_2_word_r ); | |
| 149 | READ32_HANDLER( paletteram32_r ); | |
| 150 | ||
| 151 | 144 | /* 3-3-2 RGB palette write handlers */ |
| 152 | 145 | WRITE8_HANDLER( paletteram_BBGGGRRR_w ); |
| 153 | 146 | WRITE8_HANDLER( paletteram_RRRGGGBB_w ); |
| r1591 | r1592 | |
|---|---|---|
| 25 | 25 | void ui_gfx_init(running_machine *machine); |
| 26 | 26 | |
| 27 | 27 | /* master handler */ |
| 28 | UINT32 ui_gfx_ui_handler(UINT32 state); | |
| 28 | UINT32 ui_gfx_ui_handler(running_machine *machine, UINT32 state); | |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | #endif /* __UIGFX_H__ */ |
| r1591 | r1592 | |
|---|---|---|
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | |
| 658 | /*------------------------------------------------- | |
| 659 | tilemap_get_scrollx - return the scroll value | |
| 660 | for a row unit | |
| 661 | -------------------------------------------------*/ | |
| 658 | 662 | |
| 663 | int tilemap_get_scrollx(tilemap *tmap, int which) | |
| 664 | { | |
| 665 | if (which < tmap->scrollrows) | |
| 666 | return tmap->rowscroll[which]; | |
| 667 | else | |
| 668 | return 0; | |
| 669 | } | |
| 670 | ||
| 671 | ||
| 672 | /*------------------------------------------------- | |
| 673 | tilemap_get_scrolly - return the scroll value | |
| 674 | for a column unit | |
| 675 | -------------------------------------------------*/ | |
| 676 | ||
| 677 | int tilemap_get_scrolly(tilemap *tmap, int which) | |
| 678 | { | |
| 679 | if (which < tmap->scrollcols) | |
| 680 | return tmap->colscroll[which]; | |
| 681 | else | |
| 682 | return 0; | |
| 683 | } | |
| 684 | ||
| 685 | ||
| 686 | ||
| 659 | 687 | /*************************************************************************** |
| 660 | 688 | INTERNAL MAP ACCESS |
| 661 | 689 | ***************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 518 | 518 | void tilemap_set_scrollx(tilemap *tmap, int row, int value); |
| 519 | 519 | void tilemap_set_scrolly(tilemap *tmap, int col, int value); |
| 520 | 520 | |
| 521 | /* return the scroll value for a row/column unit */ | |
| 522 | int tilemap_get_scrollx(tilemap *tmap, int row); | |
| 523 | int tilemap_get_scrolly(tilemap *tmap, int col); | |
| 521 | 524 | |
| 522 | 525 | |
| 526 | ||
| 523 | 527 | /* ----- internal map access ----- */ |
| 524 | 528 | |
| 525 | 529 | /* return a pointer to the (updated) internal pixmap for a tilemap */ |
| r1591 | r1592 | |
|---|---|---|
| 684 | 684 | and calls the menu handler |
| 685 | 685 | -------------------------------------------------*/ |
| 686 | 686 | |
| 687 | UINT32 ui_menu_ui_handler(UINT32 state) | |
| 687 | UINT32 ui_menu_ui_handler(running_machine *machine, UINT32 state) | |
| 688 | 688 | { |
| 689 | 689 | UINT32 newstate; |
| 690 | 690 | |
| r1591 | r1592 | |
| 1264 | 1264 | |
| 1265 | 1265 | static UINT32 menu_cheat(UINT32 state) |
| 1266 | 1266 | { |
| 1267 | int result = cheat_menu(state); | |
| 1267 | int result = cheat_menu(Machine, state); | |
| 1268 | 1268 | if (result == 0) |
| 1269 | 1269 | return ui_menu_stack_pop(); |
| 1270 | 1270 | return result; |
| r1591 | r1592 | |
|---|---|---|
| 644 | 644 | |
| 645 | 645 | /* display some startup text */ |
| 646 | 646 | sprintf(buffer, "Decoding (%d%%)", curgfx * 100 / totalgfx); |
| 647 | ui_set_startup_text(buffer, FALSE); | |
| 647 | ui_set_startup_text(machine, buffer, FALSE); | |
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | |
| r1591 | r1592 | |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | /* recompute the VBLANK timing */ |
| 759 | cpu_compute_vblank_timing(); | |
| 759 | cpu_compute_vblank_timing(Machine); | |
| 760 | 760 | |
| 761 | 761 | /* if we are on scanline 0 already, reset the update timer immediately */ |
| 762 | 762 | /* otherwise, defer until the next scanline 0 */ |
| r1591 | r1592 | |
| 1035 | 1035 | operations |
| 1036 | 1036 | -------------------------------------------------*/ |
| 1037 | 1037 | |
| 1038 | void video_frame_update(int debug) | |
| 1038 | void video_frame_update(running_machine *machine, int debug) | |
| 1039 | 1039 | { |
| 1040 | 1040 | attotime current_time = timer_get_time(); |
| 1041 | 1041 | int skipped_it = global.skipping_this_frame; |
| r1591 | r1592 | |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| 1058 | 1058 | /* draw the user interface */ |
| 1059 | ui_update_and_render(); | |
| 1059 | ui_update_and_render(machine); | |
| 1060 | 1060 | |
| 1061 | 1061 | /* if we're throttling, synchronize before rendering */ |
| 1062 | 1062 | if (!debug && !skipped_it && effective_throttle()) |
| r1591 | r1592 | |
| 1553 | 1553 | /* if we're throttling and autoframeskip is on, adjust */ |
| 1554 | 1554 | if (effective_throttle() && effective_autoframeskip() && global.frameskip_counter == 0) |
| 1555 | 1555 | { |
| 1556 | | |
| 1556 | d | |
| 1557 | 1557 | |
| 1558 | 1558 | /* if we're too fast, attempt to increase the frameskip */ |
| 1559 | 1559 | if (global.speed_percent >= 0.995 * speed) |
| r1591 | r1592 | |
|---|---|---|
| 66 | 66 | int ui_menu_draw(const ui_menu_item *items, int numitems, int selected, const menu_extra *extra); |
| 67 | 67 | |
| 68 | 68 | /* master handler */ |
| 69 | UINT32 ui_menu_ui_handler(UINT32 state); | |
| 69 | UINT32 ui_menu_ui_handler(running_machine *machine, UINT32 state); | |
| 70 | 70 | |
| 71 | 71 | /* menu keyboard handling */ |
| 72 | 72 | int ui_menu_generic_keys(UINT32 *selected, int num_items, int visible_items); |
| r1591 | r1592 | |
|---|---|---|
| 381 | 381 | static void init_addrspace(UINT8 cpunum, UINT8 spacenum); |
| 382 | 382 | static void preflight_memory(void); |
| 383 | 383 | static void populate_memory(void); |
| 384 | static void install_mem_handler_private(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name); | |
| 384 | 385 | static void install_mem_handler(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name); |
| 385 | 386 | static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked); |
| 386 | 387 | static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask); |
| r1591 | r1592 | |
| 951 | 952 | void *_memory_install_read_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) |
| 952 | 953 | { |
| 953 | 954 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 954 | if ( | |
| 955 | if ( | |
| 955 | 956 | fatalerror("fatal: can only use static banks with memory_install_read_handler()"); |
| 956 | 957 | install_mem_handler(space, 0, space->dbits, 0, start, end, mask, mirror, (genf *)(FPTR)handler, 0, handler_name); |
| 957 | 958 | mem_dump(); |
| r1591 | r1592 | |
| 999 | 1000 | void *_memory_install_write_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) |
| 1000 | 1001 | { |
| 1001 | 1002 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1002 | if ( | |
| 1003 | if ( | |
| 1003 | 1004 | fatalerror("fatal: can only use static banks with memory_install_write_handler()"); |
| 1004 | 1005 | install_mem_handler(space, 1, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); |
| 1005 | 1006 | mem_dump(); |
| r1591 | r1592 | |
| 1040 | 1041 | |
| 1041 | 1042 | |
| 1042 | 1043 | /*------------------------------------------------- |
| 1044 | memory_install_readwriteX_handler - install | |
| 1045 | dynamic read and write handlers for X-bit case | |
| 1046 | -------------------------------------------------*/ | |
| 1047 | ||
| 1048 | void *_memory_install_readwrite_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) | |
| 1049 | { | |
| 1050 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1051 | if (rhandler < 0 || rhandler >= STATIC_COUNT || whandler < 0 || whandler >= STATIC_COUNT) | |
| 1052 | fatalerror("fatal: can only use static banks with memory_install_readwrite_handler()"); | |
| 1053 | install_mem_handler(space, 0, space->dbits, 0, start, end, mask, mirror, (genf *)(FPTR)rhandler, 0, rhandler_name); | |
| 1054 | install_mem_handler(space, 1, space->dbits, 0, start, end, mask, mirror, (genf *)(FPTR)whandler, 0, whandler_name); | |
| 1055 | mem_dump(); | |
| 1056 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); | |
| 1057 | } | |
| 1058 | ||
| 1059 | UINT8 *_memory_install_readwrite8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_handler rhandler, write8_handler whandler, const char *rhandler_name, const char *whandler_name) | |
| 1060 | { | |
| 1061 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1062 | install_mem_handler(space, 0, 8, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1063 | install_mem_handler(space, 1, 8, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1064 | mem_dump(); | |
| 1065 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); | |
| 1066 | } | |
| 1067 | ||
| 1068 | UINT16 *_memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_handler rhandler, write16_handler whandler, const char *rhandler_name, const char *whandler_name) | |
| 1069 | { | |
| 1070 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1071 | install_mem_handler(space, 0, 16, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1072 | install_mem_handler(space, 1, 16, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1073 | mem_dump(); | |
| 1074 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); | |
| 1075 | } | |
| 1076 | ||
| 1077 | UINT32 *_memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_handler rhandler, write32_handler whandler, const char *rhandler_name, const char *whandler_name) | |
| 1078 | { | |
| 1079 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1080 | install_mem_handler(space, 0, 32, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1081 | install_mem_handler(space, 1, 32, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1082 | mem_dump(); | |
| 1083 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); | |
| 1084 | } | |
| 1085 | ||
| 1086 | UINT64 *_memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_handler rhandler, write64_handler whandler, const char *rhandler_name, const char *whandler_name) | |
| 1087 | { | |
| 1088 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1089 | install_mem_handler(space, 0, 64, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1090 | install_mem_handler(space, 1, 64, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1091 | mem_dump(); | |
| 1092 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); | |
| 1093 | } | |
| 1094 | ||
| 1095 | ||
| 1096 | /*------------------------------------------------- | |
| 1043 | 1097 | memory_install_readX_matchmask_handler - |
| 1044 | 1098 | install dynamic match/mask read handler for |
| 1045 | 1099 | X-bit case |
| r1591 | r1592 | |
| 1048 | 1102 | void *_memory_install_read_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) |
| 1049 | 1103 | { |
| 1050 | 1104 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1051 | if ( | |
| 1105 | if ( | |
| 1052 | 1106 | fatalerror("fatal: can only use static banks with memory_install_read_matchmask_handler()"); |
| 1053 | 1107 | install_mem_handler(space, 0, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); |
| 1054 | 1108 | mem_dump(); |
| r1591 | r1592 | |
| 1097 | 1151 | void *_memory_install_write_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) |
| 1098 | 1152 | { |
| 1099 | 1153 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1100 | if ( | |
| 1154 | if ( | |
| 1101 | 1155 | fatalerror("fatal: can only use static banks with memory_install_write_matchmask_handler()"); |
| 1102 | 1156 | install_mem_handler(space, 1, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); |
| 1103 | 1157 | mem_dump(); |
| r1591 | r1592 | |
| 1452 | 1506 | int ismatchmask = ((map->flags & AM_FLAGS_MATCH_MASK) != 0); |
| 1453 | 1507 | int isfixed = (map->memory != NULL) || (map->share != 0); |
| 1454 | 1508 | if (map->read.handler != NULL) |
| 1455 | install_mem_handler(space, 0, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->read.handler, isfixed, map->read_name); | |
| 1509 | install_mem_handler_private(space, 0, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->read.handler, isfixed, map->read_name); | |
| 1456 | 1510 | if (map->write.handler != NULL) |
| 1457 | install_mem_handler(space, 1, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->write.handler, isfixed, map->write_name); | |
| 1511 | install_mem_handler_private(space, 1, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->write.handler, isfixed, map->write_name); | |
| 1458 | 1512 | } |
| 1459 | 1513 | } |
| 1460 | 1514 | } |
| r1591 | r1592 | |
| 1462 | 1516 | |
| 1463 | 1517 | |
| 1464 | 1518 | /*------------------------------------------------- |
| 1519 | install_mem_handler_private - wrapper for | |
| 1520 | install_mem_handler which is used at | |
| 1521 | initialization time and converts RAM/ROM | |
| 1522 | banks to dynamically assigned banks | |
| 1523 | -------------------------------------------------*/ | |
| 1524 | ||
| 1525 | static void install_mem_handler_private(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name) | |
| 1526 | { | |
| 1527 | /* translate ROM to RAM/UNMAP here */ | |
| 1528 | if (HANDLER_IS_ROM(handler)) | |
| 1529 | handler = iswrite ? (genf *)STATIC_UNMAP : (genf *)MRA8_RAM; | |
| 1530 | ||
| 1531 | /* assign banks for RAM/ROM areas */ | |
| 1532 | if (HANDLER_IS_RAM(handler)) | |
| 1533 | { | |
| 1534 | int ismasked = (mask != 0); | |
| 1535 | offs_t temp_start = start; | |
| 1536 | offs_t temp_end = end; | |
| 1537 | offs_t temp_mask = mask; | |
| 1538 | offs_t temp_mirror = mirror; | |
| 1539 | ||
| 1540 | /* adjust the incoming addresses (temporarily) */ | |
| 1541 | adjust_addresses(space, ismatchmask, &temp_start, &temp_end, &temp_mask, &temp_mirror); | |
| 1542 | ||
| 1543 | /* assign a bank to the adjusted addresses */ | |
| 1544 | handler = (genf *)assign_dynamic_bank(space->cpunum, space->spacenum, temp_start, temp_end, temp_mirror, isfixed, ismasked); | |
| 1545 | if (!bank_ptr[HANDLER_TO_BANK(handler)]) | |
| 1546 | bank_ptr[HANDLER_TO_BANK(handler)] = memory_find_base(space->cpunum, space->spacenum, iswrite, temp_start); | |
| 1547 | } | |
| 1548 | ||
| 1549 | /* then do a normal installation */ | |
| 1550 | install_mem_handler(space, iswrite, databits, ismatchmask, start, end, mask, mirror, handler, isfixed, handler_name); | |
| 1551 | } | |
| 1552 | ||
| 1553 | ||
| 1554 | /*------------------------------------------------- | |
| 1465 | 1555 | install_mem_handler - installs a handler for |
| 1466 | 1556 | memory operations |
| 1467 | 1557 | -------------------------------------------------*/ |
| r1591 | r1592 | |
| 1472 | 1562 | table_data *tabledata = iswrite ? &space->write : &space->read; |
| 1473 | 1563 | UINT8 idx, prev_entry = STATIC_INVALID; |
| 1474 | 1564 | int cur_index, prev_index = 0; |
| 1475 | int ismasked = (mask != 0); | |
| 1476 | 1565 | int i; |
| 1477 | 1566 | |
| 1478 | 1567 | /* sanity check */ |
| 1568 | if (HANDLER_IS_ROM(handler) || HANDLER_IS_RAM(handler)) | |
| 1569 | fatalerror("fatal: install_mem_handler called with ROM or RAM after initialization"); | |
| 1479 | 1570 | if (space->dbits != databits) |
| 1480 | 1571 | fatalerror("fatal: install_mem_handler called with a %d-bit handler for a %d-bit address space", databits, space->dbits); |
| 1481 | 1572 | if (start > end) |
| r1591 | r1592 | |
| 1508 | 1599 | /* adjust the incoming addresses */ |
| 1509 | 1600 | adjust_addresses(space, ismatchmask, &start, &end, &mask, &mirror); |
| 1510 | 1601 | |
| 1511 | /* sanity check */ | |
| 1512 | if (HANDLER_IS_RAM(handler)) | |
| 1513 | assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "RAM/ROM memory handlers can only be installed at init time"); | |
| 1514 | ||
| 1515 | /* translate ROM to RAM/UNMAP here */ | |
| 1516 | if (HANDLER_IS_ROM(handler)) | |
| 1517 | handler = iswrite ? (genf *)STATIC_UNMAP : (genf *)MRA8_RAM; | |
| 1518 | ||
| 1519 | /* assign banks for RAM/ROM areas */ | |
| 1520 | if (HANDLER_IS_RAM(handler)) | |
| 1521 | { | |
| 1522 | handler = (genf *)assign_dynamic_bank(space->cpunum, space->spacenum, start, end, mirror, isfixed, ismasked); | |
| 1523 | if (!bank_ptr[HANDLER_TO_BANK(handler)]) | |
| 1524 | bank_ptr[HANDLER_TO_BANK(handler)] = memory_find_base(space->cpunum, space->spacenum, iswrite, start); | |
| 1525 | } | |
| 1526 | ||
| 1527 | 1602 | /* if this ended up a bank handler, tag it for reads or writes */ |
| 1528 | 1603 | if (HANDLER_IS_BANK(handler)) |
| 1529 | 1604 | { |
| r1591 | r1592 | |
|---|---|---|
| 117 | 117 | /* ----- global rendering ----- */ |
| 118 | 118 | |
| 119 | 119 | /* update the screen, handling frame skipping and rendering */ |
| 120 | void video_frame_update(int debug); | |
| 120 | void video_frame_update(running_machine *machine, int debug); | |
| 121 | 121 | |
| 122 | 122 | |
| 123 | 123 | /* ----- throttling/frameskipping/performance ----- */ |
| r1591 | r1592 | |
|---|---|---|
| 57 | 57 | typedef offs_t (*opbase_handler) (ATTR_UNUSED offs_t address); |
| 58 | 58 | |
| 59 | 59 | /* ----- this struct contains pointers to the live read/write routines ----- */ |
| 60 | typedef struct _data_accessors data_accessors; | |
| 60 | 61 | struct _data_accessors |
| 61 | 62 | { |
| 62 | 63 | UINT8 (*read_byte)(offs_t offset); |
| r1591 | r1592 | |
| 69 | 70 | void (*write_dword)(offs_t offset, UINT32 data); |
| 70 | 71 | void (*write_qword)(offs_t offset, UINT64 data); |
| 71 | 72 | }; |
| 72 | typedef struct _data_accessors data_accessors; | |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | |
| r1591 | r1592 | |
| 591 | 591 | UINT8 * writelookup; /* write table lookup */ |
| 592 | 592 | handler_data * readhandlers; /* read handlers */ |
| 593 | 593 | handler_data * writehandlers; /* write handlers */ |
| 594 | const data_accessors * | |
| 594 | const data_accessors * | |
| 595 | 595 | }; |
| 596 | 596 | |
| 597 | 597 | |
| r1591 | r1592 | |
| 687 | 687 | |
| 688 | 688 | #define AM_SIZE_MEMBER(_struct, _member) \ |
| 689 | 689 | if (Machine != NULL && Machine->driver_data != NULL) \ |
| 690 | map->size = &((_struct *)Machine->driver_data)-> | |
| 690 | map->size = &((_struct *)Machine->driver_data)-> | |
| 691 | 691 | |
| 692 | 692 | /* ----- common shortcuts ----- */ |
| 693 | 693 | #define AM_READWRITE(_read,_write) AM_READ(_read) AM_WRITE(_write) |
| r1591 | r1592 | |
| 972 | 972 | UINT16 * _memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name); |
| 973 | 973 | UINT32 * _memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name); |
| 974 | 974 | UINT64 * _memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name); |
| 975 | void * _memory_install_readwrite_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name); | |
| 976 | UINT8 * _memory_install_readwrite8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_handler rhandler, write8_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 977 | UINT16 * _memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_handler rhandler, write16_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 978 | UINT32 * _memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_handler rhandler, write32_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 979 | UINT64 * _memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_handler rhandler, write64_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 975 | 980 | |
| 976 | 981 | void * _memory_install_read_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name); |
| 977 | 982 | UINT8 * _memory_install_read8_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name); |
| r1591 | r1592 | |
| 1036 | 1041 | #endif |
| 1037 | 1042 | |
| 1038 | 1043 | /* ----- dynamic memory installation ----- */ |
| 1039 | #define memory_install_read_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1044 | #define memory_install_read_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1040 | 1045 | _memory_install_read_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1041 | #define memory_install_read8_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1046 | #define memory_install_read8_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1042 | 1047 | _memory_install_read8_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1043 | #define memory_install_read16_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1048 | #define memory_install_read16_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1044 | 1049 | _memory_install_read16_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1045 | #define memory_install_read32_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1050 | #define memory_install_read32_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1046 | 1051 | _memory_install_read32_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1047 | #define memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1052 | #define memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1048 | 1053 | _memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1049 | 1054 | |
| 1050 | #define memory_install_write_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1055 | #define memory_install_write_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1051 | 1056 | _memory_install_write_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1052 | #define memory_install_write8_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1057 | #define memory_install_write8_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1053 | 1058 | _memory_install_write8_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1054 | #define memory_install_write16_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1059 | #define memory_install_write16_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1055 | 1060 | _memory_install_write16_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1056 | #define memory_install_write32_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1061 | #define memory_install_write32_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1057 | 1062 | _memory_install_write32_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1058 | #define memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1063 | #define memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1059 | 1064 | _memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| 1060 | 1065 | |
| 1061 | #define memory_install_readwrite_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1062 | _memory_install_read_handler(cpu, space, start, end, mask, mirror, rhandler, #rhandler); \ | |
| 1063 | _memory_install_write_handler(cpu, space, start, end, mask, mirror, whandler, #whandler) | |
| 1064 | #define memory_install_readwrite8_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1065 | _memory_install_read8_handler(cpu, space, start, end, mask, mirror, rhandler, #rhandler); \ | |
| 1066 | _memory_install_write8_handler(cpu, space, start, end, mask, mirror, whandler, #whandler) | |
| 1067 | #define memory_install_readwrite16_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1068 | _memory_install_read16_handler(cpu, space, start, end, mask, mirror, rhandler, #rhandler); \ | |
| 1069 | _memory_install_write16_handler(cpu, space, start, end, mask, mirror, whandler, #whandler) | |
| 1070 | #define memory_install_readwrite32_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1071 | _memory_install_read32_handler(cpu, space, start, end, mask, mirror, rhandler, #rhandler); \ | |
| 1072 | _memory_install_write32_handler(cpu, space, start, end, mask, mirror, whandler, #whandler) | |
| 1073 | #define memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1074 | _memory_install_read64_handler(cpu, space, start, end, mask, mirror, rhandler, #rhandler); \ | |
| 1075 | _memory_install_write64_handler(cpu, space, start, end, mask, mirror, whandler, #whandler) | |
| 1066 | #define memory_install_readwrite_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1067 | _memory_install_readwrite_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 1068 | #define memory_install_readwrite8_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1069 | _memory_install_readwrite8_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 1070 | #define memory_install_readwrite16_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1071 | _memory_install_readwrite16_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 1072 | #define memory_install_readwrite32_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1073 | _memory_install_readwrite32_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 1074 | #define memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ | |
| 1075 | _memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) | |
| 1076 | 1076 | |
| 1077 | 1077 | #define memory_install_read_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ |
| 1078 | 1078 | _memory_install_read_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) |
| r1591 | r1592 | |
|---|---|---|
| 142 | 142 | UINT8 exit_pending; |
| 143 | 143 | const game_driver *new_driver_pending; |
| 144 | 144 | astring * saveload_pending_file; |
| 145 | emu_timer * soft_reset_timer; | |
| 145 | emu_timer * soft_reset_timer; | |
| 146 | 146 | mame_file * logfile; |
| 147 | 147 | |
| 148 | 148 | /* callbacks */ |
| r1591 | r1592 | |
| 365 | 365 | init_machine(machine); |
| 366 | 366 | |
| 367 | 367 | /* load the configuration settings and NVRAM */ |
| 368 | settingsloaded = config_load_settings(); | |
| 368 | settingsloaded = config_load_settings(machine); | |
| 369 | 369 | nvram_load(); |
| 370 | 370 | |
| 371 | 371 | /* display the startup screens */ |
| 372 | ui_display_startup_screens(firstrun, !settingsloaded); | |
| 372 | ui_display_startup_screens(machine, firstrun, !settingsloaded); | |
| 373 | 373 | firstrun = FALSE; |
| 374 | 374 | |
| 375 | 375 | /* start resource tracking; note that soft_reset assumes it can */ |
| r1591 | r1592 | |
| 388 | 388 | |
| 389 | 389 | /* execute CPUs if not paused */ |
| 390 | 390 | if (!mame->paused) |
| 391 | cpuexec_timeslice(); | |
| 391 | cpuexec_timeslice(machine); | |
| 392 | 392 | |
| 393 | 393 | /* otherwise, just pump video updates through */ |
| 394 | 394 | else |
| 395 | video_frame_update(FALSE); | |
| 395 | video_frame_update(machine, FALSE); | |
| 396 | 396 | |
| 397 | 397 | /* handle save/load */ |
| 398 | 398 | if (mame->saveload_schedule_callback) |
| r1591 | r1592 | |
| 409 | 409 | |
| 410 | 410 | /* save the NVRAM and configuration */ |
| 411 | 411 | nvram_save(); |
| 412 | config_save_settings(); | |
| 412 | config_save_settings(machine); | |
| 413 | 413 | } |
| 414 | 414 | mame->fatal_error_jmpbuf_valid = FALSE; |
| 415 | 415 | |
| r1591 | r1592 | |
| 1552 | 1552 | /* call the game driver's init function */ |
| 1553 | 1553 | /* this is where decryption is done and memory maps are altered */ |
| 1554 | 1554 | /* so this location in the init order is important */ |
| 1555 | ui_set_startup_text("Initializing...", TRUE); | |
| 1555 | ui_set_startup_text(machine, "Initializing...", TRUE); | |
| 1556 | 1556 | if (machine->gamedrv->driver_init != NULL) |
| 1557 | 1557 | (*machine->gamedrv->driver_init)(machine); |
| 1558 | 1558 |
| r1591 | r1592 | |
|---|---|---|
| 312 | 312 | if (dma[which].intf && dma[which].intf->cpunum >= 0) |
| 313 | 313 | { |
| 314 | 314 | //FIXME: Synchronization is done by BUSREQ! |
| 315 | cpunum_set_input_line(dma[which].intf->cpunum, INPUT_LINE_HALT, | |
| 315 | cpunum_set_input_line(Machine, dma[which].intf->cpunum, INPUT_LINE_HALT, | |
| 316 | 316 | pending_transfer ? ASSERT_LINE : CLEAR_LINE); |
| 317 | 317 | } |
| 318 | 318 | } |
| r1591 | r1592 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | |
| 318 | 318 | /*------------------------------------------------- |
| 319 | | |
| 319 | NVRAM_HANDLER( generic_0fill ) - generic NVRAM | |
| 320 | 320 | with a 0 fill |
| 321 | 321 | -------------------------------------------------*/ |
| 322 | 322 | |
| r1591 | r1592 | |
| 332 | 332 | |
| 333 | 333 | |
| 334 | 334 | /*------------------------------------------------- |
| 335 | | |
| 335 | NVRAM_HANDLER( generic_1fill ) - generic NVRAM | |
| 336 | 336 | with a 1 fill |
| 337 | 337 | -------------------------------------------------*/ |
| 338 | 338 | |
| r1591 | r1592 | |
| 348 | 348 | |
| 349 | 349 | |
| 350 | 350 | /*------------------------------------------------- |
| 351 | | |
| 351 | NVRAM_HANDLER( generic_randfill ) - generic NVRAM | |
| 352 | 352 | with a random fill |
| 353 | 353 | -------------------------------------------------*/ |
| 354 | 354 | |
| r1591 | r1592 | |
| 564 | 564 | int line; |
| 565 | 565 | |
| 566 | 566 | /* clear NMI and all inputs */ |
| 567 | cpunum_set_input_line(cpunum, INPUT_LINE_NMI, CLEAR_LINE); | |
| 567 | cpunum_set_input_line(machine, cpunum, INPUT_LINE_NMI, CLEAR_LINE); | |
| 568 | 568 | for (line = 0; line < inputcount; line++) |
| 569 | cpunum_set_input_line(cpunum, line, CLEAR_LINE); | |
| 569 | cpunum_set_input_line(machine, cpunum, line, CLEAR_LINE); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | |
| r1591 | r1592 | |
| 624 | 624 | specified state on the active CPU |
| 625 | 625 | -------------------------------------------------*/ |
| 626 | 626 | |
| 627 | INLINE void irqn_line_set(int cpunum, int line, int state) | |
| 627 | INLINE void irqn_line_set(running_machine *machine, int cpunum, int line, int state) | |
| 628 | 628 | { |
| 629 | 629 | if (interrupt_enable[cpunum]) |
| 630 | cpunum_set_input_line(cpunum, line, state); | |
| 630 | cpunum_set_input_line(machine, cpunum, line, state); | |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | |
| r1591 | r1592 | |
| 635 | 635 | NMI callbacks |
| 636 | 636 | -------------------------------------------------*/ |
| 637 | 637 | |
| 638 | INTERRUPT_GEN( nmi_line_pulse ) { irqn_line_set(cpunum, INPUT_LINE_NMI, PULSE_LINE); } | |
| 639 | INTERRUPT_GEN( nmi_line_assert ) { irqn_line_set(cpunum, INPUT_LINE_NMI, ASSERT_LINE); } | |
| 638 | INTERRUPT_GEN( nmi_line_pulse ) { irqn_line_set(machine, cpunum, INPUT_LINE_NMI, PULSE_LINE); } | |
| 639 | INTERRUPT_GEN( nmi_line_assert ) { irqn_line_set(machine, cpunum, INPUT_LINE_NMI, ASSERT_LINE); } | |
| 640 | 640 | |
| 641 | 641 | |
| 642 | 642 | /*------------------------------------------------- |
| 643 | 643 | IRQn callbacks |
| 644 | 644 | -------------------------------------------------*/ |
| 645 | 645 | |
| 646 | INTERRUPT_GEN( irq0_line_hold ) { irqn_line_set(cpunum, 0, HOLD_LINE); } | |
| 647 | INTERRUPT_GEN( irq0_line_pulse ) { irqn_line_set(cpunum, 0, PULSE_LINE); } | |
| 648 | INTERRUPT_GEN( irq0_line_assert ) { irqn_line_set(cpunum, 0, ASSERT_LINE); } | |
| 646 | INTERRUPT_GEN( irq0_line_hold ) { irqn_line_set(machine, cpunum, 0, HOLD_LINE); } | |
| 647 | INTERRUPT_GEN( irq0_line_pulse ) { irqn_line_set(machine, cpunum, 0, PULSE_LINE); } | |
| 648 | INTERRUPT_GEN( irq0_line_assert ) { irqn_line_set(machine, cpunum, 0, ASSERT_LINE); } | |
| 649 | 649 | |
| 650 | INTERRUPT_GEN( irq1_line_hold ) { irqn_line_set(cpunum, 1, HOLD_LINE); } | |
| 651 | INTERRUPT_GEN( irq1_line_pulse ) { irqn_line_set(cpunum, 1, PULSE_LINE); } | |
| 652 | INTERRUPT_GEN( irq1_line_assert ) { irqn_line_set(cpunum, 1, ASSERT_LINE); } | |
| 650 | INTERRUPT_GEN( irq1_line_hold ) { irqn_line_set(machine, cpunum, 1, HOLD_LINE); } | |
| 651 | INTERRUPT_GEN( irq1_line_pulse ) { irqn_line_set(machine, cpunum, 1, PULSE_LINE); } | |
| 652 | INTERRUPT_GEN( irq1_line_assert ) { irqn_line_set(machine, cpunum, 1, ASSERT_LINE); } | |
| 653 | 653 | |
| 654 | INTERRUPT_GEN( irq2_line_hold ) { irqn_line_set(cpunum, 2, HOLD_LINE); } | |
| 655 | INTERRUPT_GEN( irq2_line_pulse ) { irqn_line_set(cpunum, 2, PULSE_LINE); } | |
| 656 | INTERRUPT_GEN( irq2_line_assert ) { irqn_line_set(cpunum, 2, ASSERT_LINE); } | |
| 654 | INTERRUPT_GEN( irq2_line_hold ) { irqn_line_set(machine, cpunum, 2, HOLD_LINE); } | |
| 655 | INTERRUPT_GEN( irq2_line_pulse ) { irqn_line_set(machine, cpunum, 2, PULSE_LINE); } | |
| 656 | INTERRUPT_GEN( irq2_line_assert ) { irqn_line_set(machine, cpunum, 2, ASSERT_LINE); } | |
| 657 | 657 | |
| 658 | INTERRUPT_GEN( irq3_line_hold ) { irqn_line_set(cpunum, 3, HOLD_LINE); } | |
| 659 | INTERRUPT_GEN( irq3_line_pulse ) { irqn_line_set(cpunum, 3, PULSE_LINE); } | |
| 660 | INTERRUPT_GEN( irq3_line_assert ) { irqn_line_set(cpunum, 3, ASSERT_LINE); } | |
| 658 | INTERRUPT_GEN( irq3_line_hold ) { irqn_line_set(machine, cpunum, 3, HOLD_LINE); } | |
| 659 | INTERRUPT_GEN( irq3_line_pulse ) { irqn_line_set(machine, cpunum, 3, PULSE_LINE); } | |
| 660 | INTERRUPT_GEN( irq3_line_assert ) { irqn_line_set(machine, cpunum, 3, ASSERT_LINE); } | |
| 661 | 661 | |
| 662 | INTERRUPT_GEN( irq4_line_hold ) { irqn_line_set(cpunum, 4, HOLD_LINE); } | |
| 663 | INTERRUPT_GEN( irq4_line_pulse ) { irqn_line_set(cpunum, 4, PULSE_LINE); } | |
| 664 | INTERRUPT_GEN( irq4_line_assert ) { irqn_line_set(cpunum, 4, ASSERT_LINE); } | |
| 662 | INTERRUPT_GEN( irq4_line_hold ) { irqn_line_set(machine, cpunum, 4, HOLD_LINE); } | |
| 663 | INTERRUPT_GEN( irq4_line_pulse ) { irqn_line_set(machine, cpunum, 4, PULSE_LINE); } | |
| 664 | INTERRUPT_GEN( irq4_line_assert ) { irqn_line_set(machine, cpunum, 4, ASSERT_LINE); } | |
| 665 | 665 | |
| 666 | INTERRUPT_GEN( irq5_line_hold ) { irqn_line_set(cpunum, 5, HOLD_LINE); } | |
| 667 | INTERRUPT_GEN( irq5_line_pulse ) { irqn_line_set(cpunum, 5, PULSE_LINE); } | |
| 668 | INTERRUPT_GEN( irq5_line_assert ) { irqn_line_set(cpunum, 5, ASSERT_LINE); } | |
| 666 | INTERRUPT_GEN( irq5_line_hold ) { irqn_line_set(machine, cpunum, 5, HOLD_LINE); } | |
| 667 | INTERRUPT_GEN( irq5_line_pulse ) { irqn_line_set(machine, cpunum, 5, PULSE_LINE); } | |
| 668 | INTERRUPT_GEN( irq5_line_assert ) { irqn_line_set(machine, cpunum, 5, ASSERT_LINE); } | |
| 669 | 669 | |
| 670 | INTERRUPT_GEN( irq6_line_hold ) { irqn_line_set(cpunum, 6, HOLD_LINE); } | |
| 671 | INTERRUPT_GEN( irq6_line_pulse ) { irqn_line_set(cpunum, 6, PULSE_LINE); } | |
| 672 | INTERRUPT_GEN( irq6_line_assert ) { irqn_line_set(cpunum, 6, ASSERT_LINE); } | |
| 670 | INTERRUPT_GEN( irq6_line_hold ) { irqn_line_set(machine, cpunum, 6, HOLD_LINE); } | |
| 671 | INTERRUPT_GEN( irq6_line_pulse ) { irqn_line_set(machine, cpunum, 6, PULSE_LINE); } | |
| 672 | INTERRUPT_GEN( irq6_line_assert ) { irqn_line_set(machine, cpunum, 6, ASSERT_LINE); } | |
| 673 | 673 | |
| 674 | INTERRUPT_GEN( irq7_line_hold ) { irqn_line_set(cpunum, 7, HOLD_LINE); } | |
| 675 | INTERRUPT_GEN( irq7_line_pulse ) { irqn_line_set(cpunum, 7, PULSE_LINE); } | |
| 676 | INTERRUPT_GEN( irq7_line_assert ) { irqn_line_set(cpunum, 7, ASSERT_LINE); } | |
| 674 | INTERRUPT_GEN( irq7_line_hold ) { irqn_line_set(machine, cpunum, 7, HOLD_LINE); } | |
| 675 | INTERRUPT_GEN( irq7_line_pulse ) { irqn_line_set(machine, cpunum, 7, PULSE_LINE); } | |
| 676 | INTERRUPT_GEN( irq7_line_assert ) { irqn_line_set(machine, cpunum, 7, ASSERT_LINE); } | |
| 677 | 677 | |
| 678 | 678 | |
| 679 | 679 | |
| r1591 | r1592 | |
| 685 | 685 | 8-bit reset read/write handlers |
| 686 | 686 | -------------------------------------------------*/ |
| 687 | 687 | |
| 688 | WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(); } | |
| 689 | READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(); return 0xff; } | |
| 688 | WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(Machine); } | |
| 689 | READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(Machine); return 0xff; } | |
| 690 | 690 | |
| 691 | 691 | |
| 692 | 692 | /*------------------------------------------------- |
| 693 | 693 | 16-bit reset read/write handlers |
| 694 | 694 | -------------------------------------------------*/ |
| 695 | 695 | |
| 696 | WRITE16_HANDLER( watchdog_reset16_w ) { watchdog_reset(); } | |
| 697 | READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(); return 0xffff; } | |
| 696 | WRITE16_HANDLER( watchdog_reset16_w ) { watchdog_reset(Machine); } | |
| 697 | READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(Machine); return 0xffff; } | |
| 698 | 698 | |
| 699 | 699 | |
| 700 | 700 | /*------------------------------------------------- |
| 701 | 701 | 32-bit reset read/write handlers |
| 702 | 702 | -------------------------------------------------*/ |
| 703 | 703 | |
| 704 | WRITE32_HANDLER( watchdog_reset32_w ) { watchdog_reset(); } | |
| 705 | READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(); return 0xffffffff; } | |
| 704 | WRITE32_HANDLER( watchdog_reset32_w ) { watchdog_reset(Machine); } | |
| 705 | READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(Machine); return 0xffffffff; } | |
| 706 | 706 | |
| 707 | 707 | |
| 708 | 708 |
| r1591 | r1592 | |
|---|---|---|
| 599 | 599 | * the bits low set in the command byte. The only pulse that has |
| 600 | 600 | * an effect currently is bit 0, which pulses the CPU's reset line |
| 601 | 601 | */ |
| 602 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 602 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 603 | 603 | at_8042_set_outport(kbdc8042.outport | 0x02, 0); |
| 604 | 604 | break; |
| 605 | 605 | } |
| r1591 | r1592 | |
|---|---|---|
| 209 | 209 | /* set the halt line */ |
| 210 | 210 | if (dma[which].intf && dma[which].intf->cpunum >= 0) |
| 211 | 211 | { |
| 212 | cpunum_set_input_line(dma[which].intf->cpunum, INPUT_LINE_HALT, | |
| 212 | cpunum_set_input_line(Machine, dma[which].intf->cpunum, INPUT_LINE_HALT, | |
| 213 | 213 | pending_transfer ? ASSERT_LINE : CLEAR_LINE); |
| 214 | 214 | } |
| 215 | 215 |
| r1591 | r1592 | |
|---|---|---|
| 234 | 234 | /* set the halt line */ |
| 235 | 235 | if (dma[which].intf && dma[which].intf->cpunum >= 0) |
| 236 | 236 | { |
| 237 | cpunum_set_input_line(dma[which].intf->cpunum, INPUT_LINE_HALT, | |
| 237 | cpunum_set_input_line(Machine, dma[which].intf->cpunum, INPUT_LINE_HALT, | |
| 238 | 238 | pending_transfer ? ASSERT_LINE : CLEAR_LINE); |
| 239 | 239 | } |
| 240 | 240 |
| r1591 | r1592 | |
|---|---|---|
| 47 | 47 | tmp68301_irq_vector[level] = IVNR & 0x00e0; |
| 48 | 48 | tmp68301_irq_vector[level] += 4+i; |
| 49 | 49 | |
| 50 | cpunum_set_input_line(0,level,HOLD_LINE); | |
| 50 | cpunum_set_input_line(machine, 0,level,HOLD_LINE); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if (TCR & 0x0080) // N/1 |
| r1591 | r1592 | |
| 145 | 145 | |
| 146 | 146 | tmp68301_IE[i] = 0; // Interrupts are edge triggerred |
| 147 | 147 | |
| 148 | cpunum_set_input_line(0,level,HOLD_LINE); | |
| 148 | cpunum_set_input_line(Machine, 0,level,HOLD_LINE); | |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | } |
| r1591 | r1592 | |
|---|---|---|
| 155 | 155 | static void cpuexec_exit(running_machine *machine); |
| 156 | 156 | static void cpuexec_reset(running_machine *machine); |
| 157 | 157 | static void cpu_inittimers(running_machine *machine); |
| 158 | static void cpu_vblankreset( | |
| 158 | static void cpu_vblankreset(running_machine *machine); | |
| 159 | 159 | static TIMER_CALLBACK( cpu_vblankcallback ); |
| 160 | 160 | static TIMER_CALLBACK( cpu_updatecallback ); |
| 161 | 161 | static TIMER_CALLBACK( end_interleave_boost ); |
| 162 | static void compute_perfect_interleave(void); | |
| 163 | static void watchdog_setup(int alloc_new); | |
| 162 | static void compute_perfect_interleave(running_machine *machine); | |
| 163 | static void watchdog_setup(running_machine *machine, int alloc_new); | |
| 164 | 164 | |
| 165 | 165 | |
| 166 | 166 | |
| r1591 | r1592 | |
| 200 | 200 | /* allocate vblank and refresh timers, and compute the initial timing */ |
| 201 | 201 | vblank_timer = timer_alloc(cpu_vblankcallback, NULL); |
| 202 | 202 | refresh_timer = timer_alloc(NULL, NULL); |
| 203 | cpu_compute_vblank_timing(); | |
| 203 | cpu_compute_vblank_timing(machine); | |
| 204 | 204 | |
| 205 | 205 | /* loop over all our CPUs */ |
| 206 | 206 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) |
| r1591 | r1592 | |
| 260 | 260 | add_exit_callback(machine, cpuexec_exit); |
| 261 | 261 | |
| 262 | 262 | /* compute the perfect interleave factor */ |
| 263 | compute_perfect_interleave(); | |
| 263 | compute_perfect_interleave(machine); | |
| 264 | 264 | |
| 265 | 265 | /* save some stuff in the default tag */ |
| 266 | 266 | state_save_push_tag(0); |
| r1591 | r1592 | |
| 286 | 286 | /* initialize the various timers (suspends all CPUs at startup) */ |
| 287 | 287 | cpu_inittimers(machine); |
| 288 | 288 | watchdog_counter = WATCHDOG_IS_INVALID; |
| 289 | watchdog_setup(TRUE); | |
| 289 | watchdog_setup(machine, TRUE); | |
| 290 | 290 | |
| 291 | 291 | /* first pass over CPUs */ |
| 292 | 292 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) |
| r1591 | r1592 | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /* reset the globals */ |
| 308 | cpu_vblankreset(); | |
| 308 | cpu_vblankreset(machine); | |
| 309 | 309 | vblank = 0; |
| 310 | 310 | current_frame = 0; |
| 311 | 311 | } |
| r1591 | r1592 | |
| 355 | 355 | * |
| 356 | 356 | *************************************/ |
| 357 | 357 | |
| 358 | static void watchdog_setup(int alloc_new) | |
| 358 | static void watchdog_setup(running_machine *machine, int alloc_new) | |
| 359 | 359 | { |
| 360 | 360 | if (watchdog_counter != WATCHDOG_IS_DISABLED) |
| 361 | 361 | { |
| 362 | if ( | |
| 362 | if (machine->drv->watchdog_vblank_count) | |
| 363 | 363 | { |
| 364 | 364 | /* Start a vblank based watchdog. */ |
| 365 | watchdog_counter = | |
| 365 | watchdog_counter = machine->drv->watchdog_vblank_count; | |
| 366 | 366 | } |
| 367 | else if (attotime_compare( | |
| 367 | else if (attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0) | |
| 368 | 368 | { |
| 369 | 369 | /* Start a time based watchdog. */ |
| 370 | 370 | if (alloc_new) |
| 371 | 371 | watchdog_timer = timer_alloc(watchdog_callback, NULL); |
| 372 | timer_adjust(watchdog_timer, | |
| 372 | timer_adjust(watchdog_timer, machine->drv->watchdog_time, 0, attotime_zero); | |
| 373 | 373 | watchdog_counter = WATCHDOG_IS_TIMER_BASED; |
| 374 | 374 | } |
| 375 | 375 | else if (watchdog_counter == WATCHDOG_IS_INVALID) |
| r1591 | r1592 | |
| 390 | 390 | * The 3 seconds delay is targeted at qzshowby, which otherwise |
| 391 | 391 | * would reset at the start of a game. |
| 392 | 392 | */ |
| 393 | watchdog_counter = 3 * ATTOSECONDS_TO_HZ( | |
| 393 | watchdog_counter = 3 * ATTOSECONDS_TO_HZ(machine->screen[0].refresh); | |
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | } |
| r1591 | r1592 | |
| 403 | 403 | * |
| 404 | 404 | *************************************/ |
| 405 | 405 | |
| 406 | void watchdog_reset( | |
| 406 | void watchdog_reset(running_machine *machine) | |
| 407 | 407 | { |
| 408 | 408 | if (watchdog_counter == WATCHDOG_IS_TIMER_BASED) |
| 409 | 409 | { |
| 410 | timer_reset(watchdog_timer, | |
| 410 | timer_reset(watchdog_timer, machine->drv->watchdog_time); | |
| 411 | 411 | } |
| 412 | 412 | else |
| 413 | 413 | { |
| r1591 | r1592 | |
| 417 | 417 | logerror("(vblank) watchdog armed by reset\n"); |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | watchdog_setup(FALSE); | |
| 420 | watchdog_setup(machine, FALSE); | |
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | 423 | |
| r1591 | r1592 | |
| 429 | 429 | * |
| 430 | 430 | *************************************/ |
| 431 | 431 | |
| 432 | void watchdog_enable(int enable) | |
| 432 | void watchdog_enable(running_machine *machine, int enable) | |
| 433 | 433 | { |
| 434 | 434 | if (!enable) |
| 435 | 435 | { |
| r1591 | r1592 | |
| 442 | 442 | if (watchdog_counter == WATCHDOG_IS_DISABLED) |
| 443 | 443 | { |
| 444 | 444 | watchdog_counter = WATCHDOG_IS_BEING_STARTED; |
| 445 | watchdog_setup(FALSE); | |
| 445 | watchdog_setup(machine, FALSE); | |
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
| r1591 | r1592 | |
| 460 | 460 | * |
| 461 | 461 | *************************************/ |
| 462 | 462 | |
| 463 | void cpuexec_timeslice( | |
| 463 | void cpuexec_timeslice(running_machine *machine) | |
| 464 | 464 | { |
| 465 | 465 | attotime target = timer_next_fire_time(); |
| 466 | 466 | attotime base = timer_get_time(); |
| r1591 | r1592 | |
| 470 | 470 | LOG(("cpu_timeslice: target = %s\n", attotime_string(target, 9))); |
| 471 | 471 | |
| 472 | 472 | /* process any pending suspends */ |
| 473 | for (cpunum = 0; | |
| 473 | for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) | |
| 474 | 474 | { |
| 475 | 475 | if (cpu[cpunum].suspend != cpu[cpunum].nextsuspend) |
| 476 | 476 | LOG(("--> updated CPU%d suspend from %X to %X\n", cpunum, cpu[cpunum].suspend, cpu[cpunum].nextsuspend)); |
| r1591 | r1592 | |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | /* loop over CPUs */ |
| 482 | for (cpunum = 0; | |
| 482 | for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) | |
| 483 | 483 | { |
| 484 | 484 | /* only process if we're not suspended */ |
| 485 | 485 | if (!cpu[cpunum].suspend) |
| r1591 | r1592 | |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | /* update the local times of all CPUs */ |
| 528 | for (cpunum = 0; | |
| 528 | for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) | |
| 529 | 529 | { |
| 530 | 530 | /* if we're suspended and counting, process */ |
| 531 | 531 | if (cpu[cpunum].suspend && cpu[cpunum].eatcycles && attotime_compare(cpu[cpunum].localtime, target) < 0) |
| r1591 | r1592 | |
| 677 | 677 | * |
| 678 | 678 | *************************************/ |
| 679 | 679 | |
| 680 | void cpunum_set_clock(int cpunum, int clock) | |
| 680 | void cpunum_set_clock(running_machine *machine, int cpunum, int clock) | |
| 681 | 681 | { |
| 682 | 682 | VERIFY_CPUNUM(cpunum_set_clock); |
| 683 | 683 | |
| r1591 | r1592 | |
| 686 | 686 | attoseconds_per_cycle[cpunum] = ATTOSECONDS_PER_SECOND / ((double)clock * cpu[cpunum].clockscale); |
| 687 | 687 | |
| 688 | 688 | /* re-compute the perfect interleave factor */ |
| 689 | compute_perfect_interleave(); | |
| 689 | compute_perfect_interleave(machine); | |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | |
| 693 | 693 | |
| 694 | void cpunum_set_clock_period(int cpunum, attoseconds_t clock_period) | |
| 694 | void cpunum_set_clock_period(running_machine *machine, int cpunum, attoseconds_t clock_period) | |
| 695 | 695 | { |
| 696 | 696 | VERIFY_CPUNUM(cpunum_set_clock); |
| 697 | 697 | |
| r1591 | r1592 | |
| 700 | 700 | attoseconds_per_cycle[cpunum] = clock_period; |
| 701 | 701 | |
| 702 | 702 | /* re-compute the perfect interleave factor */ |
| 703 | compute_perfect_interleave(); | |
| 703 | compute_perfect_interleave(machine); | |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | |
| r1591 | r1592 | |
| 727 | 727 | * |
| 728 | 728 | *************************************/ |
| 729 | 729 | |
| 730 | void cpunum_set_clockscale(int cpunum, double clockscale) | |
| 730 | void cpunum_set_clockscale(running_machine *machine, int cpunum, double clockscale) | |
| 731 | 731 | { |
| 732 | 732 | VERIFY_CPUNUM(cpunum_set_clockscale); |
| 733 | 733 | |
| r1591 | r1592 | |
| 736 | 736 | attoseconds_per_cycle[cpunum] = ATTOSECONDS_PER_SECOND / ((double)cpu[cpunum].clock * clockscale); |
| 737 | 737 | |
| 738 | 738 | /* re-compute the perfect interleave factor */ |
| 739 | compute_perfect_interleave(); | |
| 739 | compute_perfect_interleave(machine); | |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 | |
| r1591 | r1592 | |
| 898 | 898 | * |
| 899 | 899 | *************************************/ |
| 900 | 900 | |
| 901 | void cpu_compute_vblank_timing( | |
| 901 | void cpu_compute_vblank_timing(running_machine *machine) | |
| 902 | 902 | { |
| 903 | refresh_period = attotime_make(0, | |
| 903 | refresh_period = attotime_make(0, machine->screen[0].refresh); | |
| 904 | 904 | |
| 905 | 905 | /* recompute the vblank period */ |
| 906 | vblank_period = attotime_make(0, | |
| 906 | vblank_period = attotime_make(0, machine->screen[0].refresh / (vblank_multiplier ? vblank_multiplier : 1)); | |
| 907 | 907 | if (vblank_timer != NULL && timer_enable(vblank_timer, FALSE)) |
| 908 | 908 | { |
| 909 | 909 | attotime remaining = timer_timeleft(vblank_timer); |
| r1591 | r1592 | |
| 954 | 954 | * |
| 955 | 955 | *************************************/ |
| 956 | 956 | |
| 957 | void cpu_trigger(int trigger) | |
| 957 | void cpu_trigger(running_machine *machine, int trigger) | |
| 958 | 958 | { |
| 959 | 959 | int cpunum; |
| 960 | 960 | |
| r1591 | r1592 | |
| 966 | 966 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) |
| 967 | 967 | { |
| 968 | 968 | /* if this is a dummy, stop looking */ |
| 969 | if ( | |
| 969 | if (machine->drv->cpu[cpunum].type == CPU_DUMMY) | |
| 970 | 970 | break; |
| 971 | 971 | |
| 972 | 972 | /* see if this is a matching trigger */ |
| r1591 | r1592 | |
| 988 | 988 | |
| 989 | 989 | static TIMER_CALLBACK( cpu_triggertime_callback ) |
| 990 | 990 | { |
| 991 | cpu_trigger(param); | |
| 991 | cpu_trigger(machine, param); | |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | |
| r1591 | r1592 | |
| 1005 | 1005 | * |
| 1006 | 1006 | *************************************/ |
| 1007 | 1007 | |
| 1008 | void cpu_triggerint(int cpunum) | |
| 1008 | void cpu_triggerint(running_machine *machine, int cpunum) | |
| 1009 | 1009 | { |
| 1010 | cpu_trigger(TRIGGER_INT + cpunum); | |
| 1010 | cpu_trigger(machine, TRIGGER_INT + cpunum); | |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | 1013 | |
| r1591 | r1592 | |
| 1143 | 1143 | * |
| 1144 | 1144 | *************************************/ |
| 1145 | 1145 | |
| 1146 | static void cpu_vblankreset( | |
| 1146 | static void cpu_vblankreset(running_machine *machine) | |
| 1147 | 1147 | { |
| 1148 | 1148 | int cpunum; |
| 1149 | 1149 | |
| 1150 | 1150 | /* notify the video system of a VBLANK start */ |
| 1151 | video_vblank_start( | |
| 1151 | video_vblank_start(machine); | |
| 1152 | 1152 | |
| 1153 | 1153 | /* read keyboard & update the status of the input ports */ |
| 1154 | 1154 | input_port_vblank_start(); |
| r1591 | r1592 | |
| 1159 | 1159 | if (--watchdog_counter == 0) |
| 1160 | 1160 | { |
| 1161 | 1161 | logerror("reset caused by the (vblank) watchdog\n"); |
| 1162 | mame_schedule_soft_reset( | |
| 1162 | mame_schedule_soft_reset(machine); | |
| 1163 | 1163 | } |
| 1164 | 1164 | } |
| 1165 | 1165 | |
| r1591 | r1592 | |
| 1167 | 1167 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) |
| 1168 | 1168 | { |
| 1169 | 1169 | if (!(cpu[cpunum].suspend & SUSPEND_REASON_DISABLE)) |
| 1170 | cpu[cpunum].iloops = | |
| 1170 | cpu[cpunum].iloops = machine->drv->cpu[cpunum].vblank_interrupts_per_frame - 1; | |
| 1171 | 1171 | else |
| 1172 | 1172 | cpu[cpunum].iloops = -1; |
| 1173 | 1173 | } |
| r1591 | r1592 | |
| 1245 | 1245 | { |
| 1246 | 1246 | /* do we update the screen now? */ |
| 1247 | 1247 | if (!(machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)) |
| 1248 | video_frame_update(FALSE); | |
| 1248 | video_frame_update(machine, FALSE); | |
| 1249 | 1249 | |
| 1250 | 1250 | /* Set the timer to update the screen */ |
| 1251 | 1251 | timer_adjust(update_timer, attotime_make(0, machine->screen[0].vblank), 0, attotime_zero); |
| 1252 | 1252 | |
| 1253 | 1253 | /* reset the globals */ |
| 1254 | cpu_vblankreset(); | |
| 1254 | cpu_vblankreset(machine); | |
| 1255 | 1255 | |
| 1256 | 1256 | /* reset the counter */ |
| 1257 | 1257 | vblank_countdown = vblank_multiplier; |
| r1591 | r1592 | |
| 1275 | 1275 | { |
| 1276 | 1276 | /* update the screen if we didn't before */ |
| 1277 | 1277 | if (machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) |
| 1278 | video_frame_update(FALSE); | |
| 1278 | video_frame_update(machine, FALSE); | |
| 1279 | 1279 | vblank = 0; |
| 1280 | 1280 | |
| 1281 | 1281 | /* update IPT_VBLANK input ports */ |
| r1591 | r1592 | |
| 1318 | 1318 | |
| 1319 | 1319 | static TIMER_CALLBACK( cpu_timeslicecallback ) |
| 1320 | 1320 | { |
| 1321 | cpu_trigger(TRIGGER_TIMESLICE); | |
| 1321 | cpu_trigger(machine, TRIGGER_TIMESLICE); | |
| 1322 | 1322 | } |
| 1323 | 1323 | |
| 1324 | 1324 | |
| r1591 | r1592 | |
| 1345 | 1345 | * |
| 1346 | 1346 | *************************************/ |
| 1347 | 1347 | |
| 1348 | static void compute_perfect_interleave( | |
| 1348 | static void compute_perfect_interleave(running_machine *machine) | |
| 1349 | 1349 | { |
| 1350 | 1350 | attoseconds_t smallest = attoseconds_per_cycle[0]; |
| 1351 | 1351 | int cpunum; |
| r1591 | r1592 | |
| 1353 | 1353 | /* start with a huge time factor and find the 2nd smallest cycle time */ |
| 1354 | 1354 | perfect_interleave = attotime_zero; |
| 1355 | 1355 | perfect_interleave.attoseconds = ATTOSECONDS_PER_SECOND - 1; |
| 1356 | for (cpunum = 1; | |
| 1356 | for (cpunum = 1; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) | |
| 1357 | 1357 | { |
| 1358 | 1358 | /* find the 2nd smallest cycle interval */ |
| 1359 | 1359 | if (attoseconds_per_cycle[cpunum] < smallest) |
| r1591 | r1592 | |
|---|---|---|
| 1929 | 1929 | if (xml_get_attribute(boundsnode, "left") != NULL) |
| 1930 | 1930 | { |
| 1931 | 1931 | /* left/right/top/bottom format */ |
| 1932 | bounds->x0 = xml_get_attribute_float_with_subst(boundsnode, "left", 0.0); | |
| 1933 | bounds->x1 = xml_get_attribute_float_with_subst(boundsnode, "right", 1.0); | |
| 1934 | bounds->y0 = xml_get_attribute_float_with_subst(boundsnode, "top", 0.0); | |
| 1935 | bounds->y1 = xml_get_attribute_float_with_subst(boundsnode, "bottom", 1.0); | |
| 1932 | bounds->x0 = xml_get_attribute_float_with_subst(boundsnode, "left", 0.0f); | |
| 1933 | bounds->x1 = xml_get_attribute_float_with_subst(boundsnode, "right", 1.0f); | |
| 1934 | bounds->y0 = xml_get_attribute_float_with_subst(boundsnode, "top", 0.0f); | |
| 1935 | bounds->y1 = xml_get_attribute_float_with_subst(boundsnode, "bottom", 1.0f); | |
| 1936 | 1936 | } |
| 1937 | 1937 | else if (xml_get_attribute(boundsnode, "x") != NULL) |
| 1938 | 1938 | { |
| 1939 | 1939 | /* x/y/width/height format */ |
| 1940 | bounds->x0 = xml_get_attribute_float_with_subst(boundsnode, "x", 0.0); | |
| 1941 | bounds->x1 = bounds->x0 + xml_get_attribute_float_with_subst(boundsnode, "width", 1.0); | |
| 1942 | bounds->y0 = xml_get_attribute_float_with_subst(boundsnode, "y", 0.0); | |
| 1943 | bounds->y1 = bounds->y0 + xml_get_attribute_float_with_subst(boundsnode, "height", 1.0); | |
| 1940 | bounds->x0 = xml_get_attribute_float_with_subst(boundsnode, "x", 0.0f); | |
| 1941 | bounds->x1 = bounds->x0 + xml_get_attribute_float_with_subst(boundsnode, "width", 1.0f); | |
| 1942 | bounds->y0 = xml_get_attribute_float_with_subst(boundsnode, "y", 0.0f); | |
| 1943 | bounds->y1 = bounds->y0 + xml_get_attribute_float_with_subst(boundsnode, "height", 1.0f); | |
| 1944 | 1944 | } |
| 1945 | 1945 | else |
| 1946 | 1946 | { |
| r1591 | r1592 | |
|---|---|---|
| 263 | 263 | void cpuexec_init(running_machine *machine); |
| 264 | 264 | |
| 265 | 265 | /* Execute for a single timeslice */ |
| 266 | void cpuexec_timeslice( | |
| 266 | void cpuexec_timeslice(running_machine *machine); | |
| 267 | 267 | |
| 268 | 268 | |
| 269 | 269 | |
| r1591 | r1592 | |
| 274 | 274 | *************************************/ |
| 275 | 275 | |
| 276 | 276 | /* bang on the watchdog */ |
| 277 | void watchdog_reset( | |
| 277 | void watchdog_reset(running_machine *machine); | |
| 278 | 278 | |
| 279 | 279 | /* watchdog enabled when TRUE */ |
| 280 | 280 | /* timer is set to reset state when going from disable to enable */ |
| 281 | void watchdog_enable(int enable); | |
| 281 | void watchdog_enable(running_machine *machine, int enable); | |
| 282 | 282 | |
| 283 | 283 | |
| 284 | 284 | |
| r1591 | r1592 | |
| 320 | 320 | int cpunum_get_clock(int cpunum); |
| 321 | 321 | |
| 322 | 322 | /* Sets the current CPU's clock speed and then adjusts for scaling */ |
| 323 | void cpunum_set_clock(int cpunum, int clock); | |
| 324 | void cpunum_set_clock_period(int cpunum, attoseconds_t clock_period); | |
| 323 | void cpunum_set_clock(running_machine *machine, int cpunum, int clock); | |
| 324 | void cpunum_set_clock_period(running_machine *machine, int cpunum, attoseconds_t clock_period); | |
| 325 | 325 | |
| 326 | 326 | /* Returns the current scaling factor for a CPU's clock speed */ |
| 327 | 327 | double cpunum_get_clockscale(int cpunum); |
| 328 | 328 | |
| 329 | 329 | /* Sets the current scaling factor for a CPU's clock speed */ |
| 330 | void cpunum_set_clockscale(int cpunum, double clockscale); | |
| 330 | void cpunum_set_clockscale(running_machine *machine, int cpunum, double clockscale); | |
| 331 | 331 | |
| 332 | 332 | /* Temporarily boosts the interleave factor */ |
| 333 | 333 | void cpu_boost_interleave(attotime timeslice_time, attotime boost_duration); |
| r1591 | r1592 | |
| 371 | 371 | /***** These functions may eventually go away. */ |
| 372 | 372 | |
| 373 | 373 | /* Recomputes the VBLANK timing after, e.g., a visible area change */ |
| 374 | void cpu_compute_vblank_timing( | |
| 374 | void cpu_compute_vblank_timing(running_machine *machine); | |
| 375 | 375 | |
| 376 | 376 | /* Returns the number of the video frame we are currently playing */ |
| 377 | 377 | int cpu_getcurrentframe(void); |
| r1591 | r1592 | |
| 385 | 385 | *************************************/ |
| 386 | 386 | |
| 387 | 387 | /* generate a trigger now */ |
| 388 | void cpu_trigger(int trigger); | |
| 388 | void cpu_trigger(running_machine *machine, int trigger); | |
| 389 | 389 | |
| 390 | 390 | /* generate a trigger after a specific period of time */ |
| 391 | 391 | void cpu_triggertime(attotime duration, int trigger); |
| 392 | 392 | |
| 393 | 393 | /* generate a trigger corresponding to an interrupt on the given CPU */ |
| 394 | void cpu_triggerint(int cpunum); | |
| 394 | void cpu_triggerint(running_machine *machine, int cpunum); | |
| 395 | 395 | |
| 396 | 396 | /* burn CPU cycles until a timer trigger */ |
| 397 | 397 | void cpu_spinuntil_trigger(int trigger); |
| r1591 | r1592 | |
|---|---|---|
| 1 | /***************************************************************************** | |
| 2 | ||
| 3 | Harris HC-55516 (and related) emulator | |
| 4 | ||
| 5 | Copyright Nicola Salmoria and the MAME Team | |
| 6 | ||
| 7 | Notes: | |
| 8 | * The only difference between MC3417 and MC3418 is the number | |
| 9 | of bits checked for the Coincidence Output. For the MC3417, | |
| 10 | it is three bits, while for the MC3418 it is four. | |
| 11 | This is not emulated. | |
| 12 | ||
| 13 | *****************************************************************************/ | |
| 14 | ||
| 1 | 15 | #include "sndintrf.h" |
| 2 | 16 | #include "streams.h" |
| 3 | 17 | #include "hc55516.h" |
| r1591 | r1592 | |
| 4 | 18 | #include <math.h> |
| 5 | 19 | |
| 6 | 20 | |
| 7 | /* default to 4x oversampling */ | |
| 8 | #define DEFAULT_SAMPLE_RATE (48000 * 4) | |
| 21 | /* 4x oversampling */ | |
| 22 | #define SAMPLE_RATE (48000 * 4) | |
| 9 | 23 | |
| 10 | ||
| 11 | 24 | #define INTEGRATOR_LEAK_TC 0.001 |
| 12 | 25 | #define FILTER_DECAY_TC 0.004 |
| 13 | 26 | #define FILTER_CHARGE_TC 0.004 |
| r1591 | r1592 | |
| 19 | 32 | struct hc55516_data |
| 20 | 33 | { |
| 21 | 34 | sound_stream *channel; |
| 22 | int sample_rate; | |
| 35 | int clock; /* 0 = software driven, non-0 = oscillator */ | |
| 36 | int active_clock_hi; | |
| 23 | 37 | |
| 24 | UINT8 last_clock; | |
| 25 | UINT8 databit; | |
| 38 | UINT8 last_clock_state; | |
| 39 | UINT8 digit; | |
| 40 | UINT8 new_digit; | |
| 26 | 41 | UINT8 shiftreg; |
| 27 | 42 | |
| 28 | INT16 curr_value; | |
| 29 | INT16 next_value; | |
| 43 | INT16 curr_sample; | |
| 44 | INT16 next_sample; | |
| 30 | 45 | |
| 31 | 46 | UINT32 update_count; |
| 32 | 47 | |
| r1591 | r1592 | |
| 42 | 57 | |
| 43 | 58 | |
| 44 | 59 | |
| 45 | static void * | |
| 60 | static void * | |
| 46 | 61 | { |
| 47 | 62 | struct hc55516_data *chip; |
| 48 | 63 | |
| r1591 | r1592 | |
| 55 | 70 | decay = pow(exp(-1), 1.0 / (FILTER_DECAY_TC * 16000.0)); |
| 56 | 71 | leak = pow(exp(-1), 1.0 / (INTEGRATOR_LEAK_TC * 16000.0)); |
| 57 | 72 | |
| 73 | chip->clock = clock; | |
| 74 | chip->active_clock_hi = _active_clock_hi; | |
| 75 | chip->last_clock_state = 0; | |
| 76 | ||
| 58 | 77 | /* create the stream */ |
| 59 | chip->sample_rate = clock ? clock : DEFAULT_SAMPLE_RATE; | |
| 60 | chip->channel = stream_create(0, 1, chip->sample_rate, chip, hc55516_update); | |
| 78 | chip->channel = stream_create(0, 1, SAMPLE_RATE, chip, hc55516_update); | |
| 61 | 79 | |
| 62 | state_save_register_item("hc55516", sndindex, chip->last_clock); | |
| 63 | state_save_register_item("hc55516", sndindex, chip->databit); | |
| 80 | state_save_register_item("hc55516", sndindex, chip->last_clock_state); | |
| 81 | state_save_register_item("hc55516", sndindex, chip->digit); | |
| 82 | state_save_register_item("hc55516", sndindex, chip->new_digit); | |
| 64 | 83 | state_save_register_item("hc55516", sndindex, chip->shiftreg); |
| 65 | state_save_register_item("hc55516", sndindex, chip->curr_value); | |
| 66 | state_save_register_item("hc55516", sndindex, chip->next_value); | |
| 84 | state_save_register_item("hc55516", sndindex, chip->curr_sample); | |
| 85 | state_save_register_item("hc55516", sndindex, chip->next_sample); | |
| 67 | 86 | state_save_register_item("hc55516", sndindex, chip->update_count); |
| 68 | 87 | state_save_register_item("hc55516", sndindex, chip->filter); |
| 69 | 88 | state_save_register_item("hc55516", sndindex, chip->integrator); |
| r1591 | r1592 | |
| 73 | 92 | } |
| 74 | 93 | |
| 75 | 94 | |
| 95 | static void *hc55516_start(int sndindex, int clock, const void *config) | |
| 96 | { | |
| 97 | return start_common(sndindex, clock, config, TRUE); | |
| 98 | } | |
| 99 | ||
| 100 | ||
| 101 | static void *mc3417_start(int sndindex, int clock, const void *config) | |
| 102 | { | |
| 103 | return start_common(sndindex, clock, config, FALSE); | |
| 104 | } | |
| 105 | ||
| 106 | ||
| 107 | static void *mc3418_start(int sndindex, int clock, const void *config) | |
| 108 | { | |
| 109 | return start_common(sndindex, clock, config, FALSE); | |
| 110 | } | |
| 111 | ||
| 112 | ||
| 113 | ||
| 114 | static void hc55516_reset(void *chip) | |
| 115 | { | |
| 116 | ((struct hc55516_data *)chip)->last_clock_state = 0; | |
| 117 | } | |
| 118 | ||
| 119 | ||
| 120 | ||
| 121 | INLINE int is_external_osciallator(struct hc55516_data *chip) | |
| 122 | { | |
| 123 | return chip->clock != 0; | |
| 124 | } | |
| 125 | ||
| 126 | ||
| 127 | INLINE int is_active_clock_transition(struct hc55516_data *chip, int clock_state) | |
| 128 | { | |
| 129 | return (( chip->active_clock_hi && !chip->last_clock_state && clock_state) || | |
| 130 | (!chip->active_clock_hi && chip->last_clock_state && !clock_state)); | |
| 131 | } | |
| 132 | ||
| 133 | ||
| 134 | INLINE int current_clock_state(struct hc55516_data *chip) | |
| 135 | { | |
| 136 | return ((UINT64)chip->update_count * chip->clock * 2 / SAMPLE_RATE) & 0x01; | |
| 137 | } | |
| 138 | ||
| 139 | ||
| 140 | static void process_digit(struct hc55516_data *chip) | |
| 141 | { | |
| 142 | double integrator = chip->integrator, temp; | |
| 143 | ||
| 144 | /* move the estimator up or down a step based on the bit */ | |
| 145 | if (chip->digit) | |
| 146 | { | |
| 147 | chip->shiftreg = ((chip->shiftreg << 1) | 1) & 7; | |
| 148 | integrator += chip->filter; | |
| 149 | } | |
| 150 | else | |
| 151 | { | |
| 152 | chip->shiftreg = (chip->shiftreg << 1) & 7; | |
| 153 | integrator -= chip->filter; | |
| 154 | } | |
| 155 | ||
| 156 | /* simulate leakage */ | |
| 157 | integrator *= leak; | |
| 158 | ||
| 159 | /* if we got all 0's or all 1's in the last n bits, bump the step up */ | |
| 160 | if (chip->shiftreg == 0 || chip->shiftreg == 7) | |
| 161 | { | |
| 162 | chip->filter = FILTER_MAX - ((FILTER_MAX - chip->filter) * charge); | |
| 163 | if (chip->filter > FILTER_MAX) | |
| 164 | chip->filter = FILTER_MAX; | |
| 165 | } | |
| 166 | ||
| 167 | /* simulate decay */ | |
| 168 | else | |
| 169 | { | |
| 170 | chip->filter *= decay; | |
| 171 | if (chip->filter < FILTER_MIN) | |
| 172 | chip->filter = FILTER_MIN; | |
| 173 | } | |
| 174 | ||
| 175 | /* compute the sample as a 32-bit word */ | |
| 176 | temp = integrator * SAMPLE_GAIN; | |
| 177 | chip->integrator = integrator; | |
| 178 | ||
| 179 | /* compress the sample range to fit better in a 16-bit word */ | |
| 180 | if (temp < 0) | |
| 181 | chip->next_sample = (int)(temp / (-temp * (1.0 / 32768.0) + 1.0)); | |
| 182 | else | |
| 183 | chip->next_sample = (int)(temp / (temp * (1.0 / 32768.0) + 1.0)); | |
| 184 | } | |
| 185 | ||
| 186 | ||
| 76 | 187 | static void hc55516_update(void *param, stream_sample_t **inputs, stream_sample_t **_buffer, int length) |
| 77 | 188 | { |
| 78 | 189 | struct hc55516_data *chip = param; |
| 79 | 190 | stream_sample_t *buffer = _buffer[0]; |
| 80 | INT32 data, slope; | |
| 81 | 191 | int i; |
| 192 | INT32 sample, slope; | |
| 82 | 193 | |
| 83 | 194 | /* zero-length? bail */ |
| 84 | 195 | if (length == 0) |
| 85 | 196 | return; |
| 86 | 197 | |
| 87 | /* track how many samples we've updated without a clock */ | |
| 88 | chip->update_count += length; | |
| 89 | if (chip->update_count > chip->sample_rate / 32) | |
| 198 | if (!is_external_osciallator(chip)) | |
| 90 | 199 | { |
| 91 | chip->update_count = chip->sample_rate; | |
| 92 | chip->next_value = 0; | |
| 200 | /* track how many samples we've updated without a clock */ | |
| 201 | chip->update_count += length; | |
| 202 | if (chip->update_count > SAMPLE_RATE / 32) | |
| 203 | { | |
| 204 | chip->update_count = SAMPLE_RATE; | |
| 205 | chip->next_sample = 0; | |
| 206 | } | |
| 93 | 207 | } |
| 94 | 208 | |
| 95 | 209 | /* compute the interpolation slope */ |
| 96 | data = chip->curr_value; | |
| 97 | slope = ((INT32)chip->next_value - data) / length; | |
| 98 | chip->curr_value = chip->next_value; | |
| 210 | sample = chip->curr_sample; | |
| 211 | slope = ((INT32)chip->next_sample - sample) / length; | |
| 212 | chip->curr_sample = chip->next_sample; | |
| 99 | 213 | |
| 100 | /* reset the sample count */ | |
| 101 | for (i = 0; i < length; i++, data += slope) | |
| 102 | *buffer++ = data; | |
| 103 | } | |
| 214 | if (is_external_osciallator(chip)) | |
| 215 | { | |
| 216 | /* external oscillator */ | |
| 217 | for (i = 0; i < length; i++, sample += slope) | |
| 218 | { | |
| 219 | UINT8 clock_state; | |
| 104 | 220 | |
| 221 | *buffer++ = sample; | |
| 105 | 222 | |
| 106 | void hc55516_clock_w(int num, int state) | |
| 107 | { | |
| 108 | struct hc55516_data *chip = sndti_token(SOUND_HC55516, num); | |
| 109 | int clock = state & 1, diffclock; | |
| 223 | chip->update_count++; | |
| 110 | 224 | |
| 111 | /* update the clock */ | |
| 112 | diffclock = clock ^ chip->last_clock; | |
| 113 | chip->last_clock = clock; | |
| 225 | clock_state = current_clock_state(chip); | |
| 114 | 226 | |
| 115 | /* speech clock changing (active on rising edge) */ | |
| 116 | if (diffclock && clock) | |
| 117 | { | |
| 118 | double integrator = chip->integrator, temp; | |
| 227 | /* pull in next digit on the appropriate edge of the clock */ | |
| 228 | if (is_active_clock_transition(chip, clock_state)) | |
| 229 | { | |
| 230 | chip->digit = chip->new_digit; | |
| 119 | 231 | |
| 120 | /* clear the update count */ | |
| 121 | chip->update_count = 0; | |
| 232 | process_digit(chip); | |
| 233 | } | |
| 122 | 234 | |
| 123 | /* move the estimator up or down a step based on the bit */ | |
| 124 | if (chip->databit) | |
| 125 | { | |
| 126 | chip->shiftreg = ((chip->shiftreg << 1) | 1) & 7; | |
| 127 | integrator += chip->filter; | |
| 235 | chip->last_clock_state = clock_state; | |
| 128 | 236 | } |
| 129 | else | |
| 130 | { | |
| 131 | chip->shiftreg = (chip->shiftreg << 1) & 7; | |
| 132 | integrator -= chip->filter; | |
| 133 | } | |
| 237 | } | |
| 134 | 238 | |
| 135 | /* simulate leakage */ | |
| 136 | integrator *= leak; | |
| 239 | /* software driven clock */ | |
| 240 | else | |
| 241 | for (i = 0; i < length; i++, sample += slope) | |
| 242 | *buffer++ = sample; | |
| 243 | } | |
| 137 | 244 | |
| 138 | /* if we got all 0's or all 1's in the last n bits, bump the step up */ | |
| 139 | if (chip->shiftreg == 0 || chip->shiftreg == 7) | |
| 140 | { | |
| 141 | chip->filter = FILTER_MAX - ((FILTER_MAX - chip->filter) * charge); | |
| 142 | if (chip->filter > FILTER_MAX) | |
| 143 | chip->filter = FILTER_MAX; | |
| 144 | } | |
| 145 | 245 | |
| 146 | /* simulate decay */ | |
| 147 | else | |
| 148 | { | |
| 149 | chip->filter *= decay; | |
| 150 | if (chip->filter < FILTER_MIN) | |
| 151 | chip->filter = FILTER_MIN; | |
| 152 | } | |
| 246 | void hc55516_clock_w(int num, int state) | |
| 247 | { | |
| 248 | struct hc55516_data *chip = sndti_token(SOUND_HC55516, num); | |
| 249 | UINT8 clock_state = state ? TRUE : FALSE; | |
| 153 | 250 | |
| 154 | /* compute the sample as a 32-bit word */ | |
| 155 | temp = integrator * SAMPLE_GAIN; | |
| 156 | chip->integrator = integrator; | |
| 251 | /* only makes sense for setups with a software driven clock */ | |
| 252 | assert(!is_external_osciallator(chip)); | |
| 157 | 253 | |
| 158 | /* compress the sample range to fit better in a 16-bit word */ | |
| 159 | if (temp < 0) | |
| 160 | chip->next_value = (int)(temp / (-temp * (1.0 / 32768.0) + 1.0)); | |
| 161 | else | |
| 162 | chip->next_value = (int)(temp / (temp * (1.0 / 32768.0) + 1.0)); | |
| 163 | ||
| 254 | /* speech clock changing? */ | |
| 255 | if (is_active_clock_transition(chip, clock_state)) | |
| 256 | { | |
| 164 | 257 | /* update the output buffer before changing the registers */ |
| 165 | 258 | stream_update(chip->channel); |
| 259 | ||
| 260 | /* clear the update count */ | |
| 261 | chip->update_count = 0; | |
| 262 | ||
| 263 | process_digit(chip); | |
| 166 | 264 | } |
| 265 | ||
| 266 | /* update the clock */ | |
| 267 | chip->last_clock_state = clock_state; | |
| 167 | 268 | } |
| 168 | 269 | |
| 169 | 270 | |
| 170 | void hc55516_digit_w(int num, int d | |
| 271 | void hc55516_digit_w(int num, int digit | |
| 171 | 272 | { |
| 172 | 273 | struct hc55516_data *chip = sndti_token(SOUND_HC55516, num); |
| 173 | chip->databit = data & 1; | |
| 274 | ||
| 275 | if (is_external_osciallator(chip)) | |
| 276 | { | |
| 277 | stream_update(chip->channel); | |
| 278 | chip->new_digit = digit & 1; | |
| 279 | } | |
| 280 | else | |
| 281 | chip->digit = digit & 1; | |
| 174 | 282 | } |
| 175 | 283 | |
| 176 | 284 | |
| 177 | void hc55516_clock_clear_w(int num | |
| 285 | void hc55516_clock_clear_w(int num | |
| 178 | 286 | { |
| 179 | 287 | hc55516_clock_w(num, 0); |
| 180 | 288 | } |
| 181 | 289 | |
| 182 | 290 | |
| 183 | void hc55516_clock_set_w(int num | |
| 291 | void hc55516_clock_set_w(int num | |
| 184 | 292 | { |
| 185 | 293 | hc55516_clock_w(num, 1); |
| 186 | 294 | } |
| 187 | 295 | |
| 188 | 296 | |
| 189 | void hc55516_digit_clock_clear_w(int num, int d | |
| 297 | void hc55516_digit_clock_clear_w(int num, int digit | |
| 190 | 298 | { |
| 191 | 299 | struct hc55516_data *chip = sndti_token(SOUND_HC55516, num); |
| 192 | chip->d | |
| 300 | chip->d | |
| 193 | 301 | hc55516_clock_w(num, 0); |
| 194 | 302 | } |
| 195 | 303 | |
| 196 | 304 | |
| 197 | WRITE8_HANDLER( hc55516_0_digit_w ) { hc55516_digit_w(0,data); } | |
| 198 | WRITE8_HANDLER( hc55516_0_clock_w ) { hc55516_clock_w(0,data); } | |
| 199 | WRITE8_HANDLER( hc55516_0_clock_clear_w ) { hc55516_clock_clear_w(0,data); } | |
| 200 | WRITE8_HANDLER( hc55516_0_clock_set_w ) { hc55516_clock_set_w(0,data); } | |
| 201 | WRITE8_HANDLER( hc55516_0_digit_clock_clear_w ) { hc55516_digit_clock_clear_w(0,data); } | |
| 305 | int hc55516_clock_state_r(int num) | |
| 306 | { | |
| 307 | struct hc55516_data *chip = sndti_token(SOUND_HC55516, num); | |
| 202 | 308 | |
| 203 | WRITE8_HANDLER( hc55516_1_digit_w ) { hc55516_digit_w(1,data); } | |
| 204 | WRITE8_HANDLER( hc55516_1_clock_w ) { hc55516_clock_w(1,data); } | |
| 205 | WRITE8_HANDLER( hc55516_1_clock_clear_w ) { hc55516_clock_clear_w(1,data); } | |
| 206 | WRITE8_HANDLER( hc55516_1_clock_set_w ) { hc55516_clock_set_w(1,data); } | |
| 207 | WRITE8_HANDLER( hc55516_1_digit_clock_clear_w ) { hc55516_digit_clock_clear_w(1,data); } | |
| 309 | /* only makes sense for setups with an external oscillator */ | |
| 310 | assert(is_external_osciallator(chip)); | |
| 208 | 311 | |
| 312 | stream_update(chip->channel); | |
| 209 | 313 | |
| 314 | return current_clock_state(chip); | |
| 315 | } | |
| 210 | 316 | |
| 211 | 317 | |
| 212 | 318 | |
| 319 | WRITE8_HANDLER( hc55516_0_digit_w ) { hc55516_digit_w(0, data); } | |
| 320 | WRITE8_HANDLER( hc55516_0_clock_w ) { hc55516_clock_w(0, data); } | |
| 321 | WRITE8_HANDLER( hc55516_0_clock_clear_w ) { hc55516_clock_clear_w(0); } | |
| 322 | WRITE8_HANDLER( hc55516_0_clock_set_w ) { hc55516_clock_set_w(0); } | |
| 323 | WRITE8_HANDLER( hc55516_0_digit_clock_clear_w ) { hc55516_digit_clock_clear_w(0, data); } | |
| 324 | READ8_HANDLER ( hc55516_0_clock_state_r ) { return hc55516_clock_state_r(0); } | |
| 325 | ||
| 326 | WRITE8_HANDLER( hc55516_1_digit_w ) { hc55516_digit_w(1, data); } | |
| 327 | WRITE8_HANDLER( hc55516_1_clock_w ) { hc55516_clock_w(1, data); } | |
| 328 | WRITE8_HANDLER( hc55516_1_clock_clear_w ) { hc55516_clock_clear_w(1); } | |
| 329 | WRITE8_HANDLER( hc55516_1_clock_set_w ) { hc55516_clock_set_w(1); } | |
| 330 | WRITE8_HANDLER( hc55516_1_digit_clock_clear_w ) { hc55516_digit_clock_clear_w(1, data); } | |
| 331 | READ8_HANDLER ( hc55516_1_clock_state_r ) { return hc55516_clock_state_r(1); } | |
| 332 | ||
| 333 | ||
| 334 | ||
| 213 | 335 | /************************************************************************** |
| 214 | 336 | * Generic get_info |
| 215 | 337 | **************************************************************************/ |
| 216 | 338 | |
| 217 | static void hc55516_set_info(void *token, UINT32 state, sndinfo *info) | |
| 218 | { | |
| 219 | switch (state) | |
| 220 | { | |
| 221 | /* no parameters to set */ | |
| 222 | } | |
| 223 | } | |
| 224 | ||
| 225 | ||
| 226 | 339 | void hc55516_get_info(void *token, UINT32 state, sndinfo *info) |
| 227 | 340 | { |
| 228 | 341 | switch (state) |
| 229 | 342 | { |
| 230 | 343 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 344 | case SNDINFO_INT_ALIAS: info->i = SOUND_HC55516; break; | |
| 231 | 345 | |
| 232 | 346 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 233 | case SNDINFO_PTR_SET_INFO: info->set_info = hc55516_set_info; break; | |
| 234 | 347 | case SNDINFO_PTR_START: info->start = hc55516_start; break; |
| 235 | case SNDINFO_PTR_STOP: /* nothing */ break; | |
| 236 | case SNDINFO_PTR_RESET: /* nothing */ break; | |
| 348 | case SNDINFO_PTR_RESET: info->reset = hc55516_reset; break; | |
| 237 | 349 | |
| 238 | 350 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 239 | case SNDINFO_STR_NAME: info->s = "HC55516"; break; | |
| 240 | case SNDINFO_STR_CORE_FAMILY: info->s = "Gaelco custom"; break; | |
| 241 | case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break; | |
| 351 | case SNDINFO_STR_NAME: info->s = "HC-55516"; break; | |
| 352 | case SNDINFO_STR_CORE_FAMILY: info->s = "CVSD"; break; | |
| 353 | case SNDINFO_STR_CORE_VERSION: info->s = "2.0"; break; | |
| 242 | 354 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; |
| 243 | 355 | case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; |
| 244 | 356 | } |
| 245 | 357 | } |
| 246 | 358 | |
| 359 | ||
| 360 | void mc3417_get_info(void *token, UINT32 state, sndinfo *info) | |
| 361 | { | |
| 362 | switch (state) | |
| 363 | { | |
| 364 | case SNDINFO_PTR_START: info->start = mc3417_start; break; | |
| 365 | case SNDINFO_PTR_RESET: /* chip has no reset pin */ break; | |
| 366 | case SNDINFO_STR_NAME: info->s = "MC3417"; break; | |
| 367 | default: hc55516_get_info(token, state, info); break; | |
| 368 | } | |
| 369 | } | |
| 370 | ||
| 371 | ||
| 372 | void mc3418_get_info(void *token, UINT32 state, sndinfo *info) | |
| 373 | { | |
| 374 | switch (state) | |
| 375 | { | |
| 376 | case SNDINFO_PTR_START: info->start = mc3418_start; break; | |
| 377 | case SNDINFO_PTR_RESET: /* chip has no reset pin */ break; | |
| 378 | case SNDINFO_STR_NAME: info->s = "MC3418"; break; | |
| 379 | default: hc55516_get_info(token, state, info); break; | |
| 380 | } | |
| 381 | } |
| r1591 | r1592 | |
|---|---|---|
| 2 | 2 | #define HC55516_H |
| 3 | 3 | |
| 4 | 4 | |
| 5 | /* sets the databit (0 or 1) */ | |
| 6 | void hc55516_digit_w(int num, int data); | |
| 5 | /* sets the digit (0 or 1) */ | |
| 6 | void hc55516_digit_w(int num, int digit); | |
| 7 | 7 | |
| 8 | 8 | /* sets the clock state (0 or 1, clocked on the rising edge) */ |
| 9 | 9 | void hc55516_clock_w(int num, int state); |
| 10 | 10 | |
| 11 | 11 | /* clears or sets the clock state */ |
| 12 | void hc55516_clock_clear_w(int num, int data); | |
| 13 | void hc55516_clock_set_w(int num, int data); | |
| 12 | void hc55516_clock_clear_w(int num); | |
| 13 | void hc55516_clock_set_w(int num); | |
| 14 | 14 | |
| 15 | /* clears the clock state and sets the databit */ | |
| 16 | void hc55516_digit_clock_clear_w(int num, int data); | |
| 15 | /* clears the clock state and sets the digit */ | |
| 16 | void hc55516_digit_clock_clear_w(int num, int digit); | |
| 17 | 17 | |
| 18 | /* returns whether the clock is currently LO or HI */ | |
| 19 | int hc55516_clock_state_r(int num); | |
| 20 | ||
| 18 | 21 | WRITE8_HANDLER( hc55516_0_digit_w ); |
| 19 | 22 | WRITE8_HANDLER( hc55516_0_clock_w ); |
| 20 | 23 | WRITE8_HANDLER( hc55516_0_clock_clear_w ); |
| 21 | 24 | WRITE8_HANDLER( hc55516_0_clock_set_w ); |
| 22 | 25 | WRITE8_HANDLER( hc55516_0_digit_clock_clear_w ); |
| 26 | READ8_HANDLER ( hc55516_0_clock_state_r ); | |
| 23 | 27 | |
| 24 | 28 | WRITE8_HANDLER( hc55516_1_digit_w ); |
| 25 | 29 | WRITE8_HANDLER( hc55516_1_clock_w ); |
| 26 | 30 | WRITE8_HANDLER( hc55516_1_clock_clear_w ); |
| 27 | 31 | WRITE8_HANDLER( hc55516_1_clock_set_w ); |
| 28 | 32 | WRITE8_HANDLER( hc55516_1_digit_clock_clear_w ); |
| 33 | READ8_HANDLER ( hc55516_1_clock_state_r ); | |
| 29 | 34 | |
| 30 | 35 | |
| 31 | 36 | #endif |
| r1591 | r1592 | |
|---|---|---|
| 85 | 85 | struct tms5110 |
| 86 | 86 | { |
| 87 | 87 | /* coefficient tables */ |
| 88 | int variant; /* Variant of the 5110 - see tms5110.h */ | |
| 89 | ||
| 90 | /* coefficient tables */ | |
| 88 | 91 | const struct tms5100_coeffs *coeff; |
| 92 | ||
| 89 | 93 | /* these contain data that describes the 64 bits FIFO */ |
| 90 | 94 | UINT8 fifo[FIFO_SIZE]; |
| 91 | 95 | UINT8 fifo_head; |
| r1591 | r1592 | |
| 149 | 153 | |
| 150 | 154 | #define DEBUG_5110 0 |
| 151 | 155 | |
| 152 | ||
| 153 | void *tms5110_create(int index, int variant) | |
| 156 | void tms5110_set_variant(void *chip, int variant) | |
| 154 | 157 | { |
| 155 | struct tms5110 *tms; | |
| 158 | struct tms5110 *tms = chip; | |
| 156 | 159 | |
| 157 | tms = malloc_or_die(sizeof(*tms)); | |
| 158 | memset(tms, 0, sizeof(*tms)); | |
| 159 | ||
| 160 | 160 | switch (variant) |
| 161 | 161 | { |
| 162 | 162 | case TMS5110_IS_5110A: |
| r1591 | r1592 | |
| 172 | 172 | fatalerror("Unknown variant in tms5110_create\n"); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | tms->variant = variant; | |
| 176 | } | |
| 177 | ||
| 178 | void *tms5110_create(int index, int variant) | |
| 179 | { | |
| 180 | struct tms5110 *tms; | |
| 181 | ||
| 182 | tms = malloc_or_die(sizeof(*tms)); | |
| 183 | memset(tms, 0, sizeof(*tms)); | |
| 184 | ||
| 185 | tms5110_set_variant(tms, variant); | |
| 186 | ||
| 175 | 187 | state_save_register_item_array("tms5110", index, tms->fifo); |
| 176 | 188 | state_save_register_item("tms5110", index, tms->fifo_head); |
| 177 | 189 | state_save_register_item("tms5110", index, tms->fifo_tail); |
| r1591 | r1592 | |
|---|---|---|
| 28 | 28 | void *tms5110_create(int index, int variant); |
| 29 | 29 | void tms5110_destroy(void *chip); |
| 30 | 30 | |
| 31 | void tms5110_set_variant(void *chip, int variant); | |
| 32 | ||
| 31 | 33 | void tms5110_reset_chip(void *chip); |
| 32 | 34 | void tms5110_set_M0_callback(void *chip, int (*func)(void)); |
| 33 | 35 | void tms5110_set_load_address(void *chip, void (*func)(int)); |
| r1591 | r1592 | |
|---|---|---|
| 255 | 255 | void dss_input_stream_step(node_description *node) |
| 256 | 256 | { |
| 257 | 257 | // the context pointer is set to point to the current input stream data in discrete_stream_update |
| 258 | stream_sample_t *data = node->context; | |
| 258 | stream_sample_t **ptr = node->context; | |
| 259 | stream_sample_t *data = *ptr; | |
| 259 | 260 | |
| 260 | node->output = data ? *data | |
| 261 | node->output = data ? (*data) | |
| 261 | 262 | } |
| 263 | ||
| 264 | void dss_input_stream_reset(node_description *node) | |
| 265 | { | |
| 266 | int istream = DSS_INPUT_STREAM__STREAM; | |
| 267 | /* we will use the node's context pointer to point to the input stream data */ | |
| 268 | assert(istream < discrete_current_context->discrete_input_streams); | |
| 269 | node->context = &discrete_current_context->input_stream_data[istream]; | |
| 270 | } |
| r1591 | r1592 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | static int PLFO_TRI[256],PLFO_SQR[256],PLFO_SAW[256],PLFO_NOI[256]; |
| 30 | 30 | static int ALFO_TRI[256],ALFO_SQR[256],ALFO_SAW[256],ALFO_NOI[256]; |
| 31 | static const float LFOFreq[32]={0.17,0.19,0.23,0.27,0.34,0.39,0.45,0.55,0.68,0.78,0.92,1.10,1.39,1.60,1.87,2.27, | |
| 32 | 2.87,3.31,3.92,4.79,6.15,7.18,8.60,10.8,14.4,17.2,21.5,28.7,43.1,57.4,86.1,172.3}; | |
| 33 | static const float ASCALE[8]={0.0,0.4,0.8,1.5,3.0,6.0,12.0,24.0}; | |
| 34 | static const float PSCALE[8]={0.0,7.0,13.5,27.0,55.0,112.0,230.0,494}; | |
| 31 | static const float LFOFreq[32]= | |
| 32 | { | |
| 33 | 0.17f,0.19f,0.23f,0.27f,0.34f,0.39f,0.45f,0.55f,0.68f,0.78f,0.92f,1.10f,1.39f,1.60f,1.87f,2.27f, | |
| 34 | 2.87f,3.31f,3.92f,4.79f,6.15f,7.18f,8.60f,10.8f,14.4f,17.2f,21.5f,28.7f,43.1f,57.4f,86.1f,172.3f | |
| 35 | }; | |
| 36 | static const float ASCALE[8]={0.0f,0.4f,0.8f,1.5f,3.0f,6.0f,12.0f,24.0f}; | |
| 37 | static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f}; | |
| 35 | 38 | static int PSCALES[8][256]; |
| 36 | 39 | static int ASCALES[8][256]; |
| 37 | 40 |
| r1591 | r1592 | |
|---|---|---|
| 32 | 32 | INT32 si, sj ; |
| 33 | 33 | |
| 34 | 34 | /* 8-bit volume modulation tables. */ |
| 35 | float filterAmpl = | |
| 35 | float filterAmpl = | |
| 36 | 36 | |
| 37 | filterAmpl = 0.7; | |
| 38 | ||
| 39 | 37 | ampMod1x8=(INT8*) auto_malloc(256*256); |
| 40 | 38 | |
| 41 | 39 | uk = 0; |
| r1591 | r1592 | |
|---|---|---|
| 156 | 156 | UINT16 uk; |
| 157 | 157 | /* Parameter calculation has not been moved to a separate function */ |
| 158 | 158 | /* by purpose. */ |
| 159 | const float filterRefFreq = 44100.0; | |
| 159 | const float filterRefFreq = 44100.0f; | |
| 160 | 160 | |
| 161 | float yMax = 1.0; | |
| 162 | float yMin = 0.01; | |
| 161 | float yMax = 1.0f; | |
| 162 | float yMin = 0.01f; | |
| 163 | 163 | float yAdd; |
| 164 | 164 | float yTmp, rk, rk2; |
| 165 | 165 | |
| r1591 | r1592 | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /*extern float bandPassParam[0x800]; */ |
| 186 | yMax = 0.22; | |
| 187 | yMin = 0.05; /* less for some R1/R4 chips */ | |
| 188 | yAdd = (yMax-yMin)/2048.0; | |
| 186 | yMax = 0.22f; | |
| 187 | yMin = 0.05f; /* less for some R1/R4 chips */ | |
| 188 | yAdd = (yMax-yMin)/2048.0f; | |
| 189 | 189 | yTmp = yMin; |
| 190 | 190 | uk = 0; |
| 191 | 191 | /* Some C++ compilers still have non-local scope! */ |
| r1591 | r1592 | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /*extern float filterResTable[16]; */ |
| 200 | resDyMax = 1.0; | |
| 201 | resDyMin = 2.0; | |
| 200 | resDyMax = 1.0f; | |
| 201 | resDyMin = 2.0f; | |
| 202 | 202 | resDy = resDyMin; |
| 203 | 203 | for ( uk = 0; uk < 16; uk++ ) |
| 204 | 204 | { |
| r1591 | r1592 | |
| 282 | 282 | { |
| 283 | 283 | This->filter.Value = 0x7ff & ( (This->reg[0x15]&7) | ( (UINT16)This->reg[0x16] << 3 )); |
| 284 | 284 | if (This->filter.Type == 0x20) |
| 285 | This->filter.Dy = bandPassParam ? bandPassParam[This->filter.Value] : 0.0; | |
| 285 | This->filter.Dy = bandPassParam ? bandPassParam[This->filter.Value] : 0.0f; | |
| 286 | 286 | else |
| 287 | This->filter.Dy = lowPassParam ? lowPassParam[This->filter.Value] : 0.0; | |
| 287 | This->filter.Dy = lowPassParam ? lowPassParam[This->filter.Value] : 0.0f; | |
| 288 | 288 | This->filter.ResDy = filterResTable[This->reg[0x17] >> 4] - This->filter.Dy; |
| 289 | if ( This->filter.ResDy < 1.0 ) | |
| 290 | This->filter.ResDy = 1.0; | |
| 289 | if ( This->filter.ResDy < 1.0f ) | |
| 290 | This->filter.ResDy = 1.0f; | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | sidEmuSet( &This->optr1 ); |
| r1591 | r1592 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | /* the input streams */ |
| 76 | 76 | int discrete_input_streams; |
| 77 | stream_sample_t * | |
| 77 | stream_sample_t * | |
| 78 | 78 | |
| 79 | 79 | /* output node tracking */ |
| 80 | 80 | int discrete_outputs; |
| r1591 | r1592 | |
| 175 | 175 | { DSS_INPUT_LOGIC ,"DSS_INPUT_LOGIC" ,sizeof(UINT8) ,dss_input_reset ,dss_input_step }, |
| 176 | 176 | { DSS_INPUT_NOT ,"DSS_INPUT_NOT" ,sizeof(UINT8) ,dss_input_reset ,dss_input_step }, |
| 177 | 177 | { DSS_INPUT_PULSE ,"DSS_INPUT_PULSE" ,sizeof(UINT8) ,dss_input_reset ,dss_input_pulse_step }, |
| 178 | { DSS_INPUT_STREAM,"DSS_INPUT_STREAM",0 , | |
| 178 | { DSS_INPUT_STREAM,"DSS_INPUT_STREAM",0 ,dss_input_stream_reset,dss_input_stream_step}, | |
| 179 | 179 | |
| 180 | 180 | /* from disc_wav.c */ |
| 181 | 181 | /* Generic modules */ |
| r1591 | r1592 | |
| 443 | 443 | /* Setup any input streams */ |
| 444 | 444 | for (nodenum = 0; nodenum < info->discrete_input_streams; nodenum++) |
| 445 | 445 | { |
| 446 | | |
| 446 | | |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /* Now we must do length iterations of the node list, one output for each step */ |
| r1591 | r1592 | |
| 500 | 500 | wav_add_data_16lr(info->disc_wav_file[outputnum], &wave_data_l, &wave_data_r, 1); |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | ||
| 504 | /* advance input streams */ | |
| 505 | for (nodenum = 0; nodenum < info->discrete_input_streams; nodenum++) | |
| 506 | { | |
| 507 | info->input_stream_data[nodenum]++; | |
| 508 | } | |
| 503 | 509 | } |
| 504 | 510 | |
| 505 | 511 | discrete_current_context = NULL; |
| r1591 | r1592 | |
| 616 | 622 | if (info->discrete_input_streams == DISCRETE_MAX_OUTPUTS) |
| 617 | 623 | fatalerror("init_nodes() - There can not be more then %d input stream nodes", DISCRETE_MAX_OUTPUTS); |
| 618 | 624 | /* we will use the node's context pointer to point to the input stream data */ |
| 619 | *info->input_stream_data[info->discrete_input_streams++] = (stream_sample_t *)&node->context; | |
| 625 | //node->context = &info->input_stream_data[info->discrete_input_streams++]; | |
| 626 | node->context = NULL; | |
| 627 | info->discrete_input_streams++; | |
| 620 | 628 | } |
| 621 | 629 | } |
| 622 | 630 |
| r1591 | r1592 | |
|---|---|---|
| 126 | 126 | * DISCRETE_INPUT_NOT(NODE) |
| 127 | 127 | * DISCRETE_INPUTX_NOT(NODE,GAIN,OFFSET,INIT) |
| 128 | 128 | * DISCRETE_INPUT_PULSE(NODE,INIT) |
| 129 | * DISCRETE_INPUT_STREAM(NODE) | |
| 130 | * DISCRETE_INPUTX_STREAM(NODE,GAIN,OFFSET) | |
| 129 | * DISCRETE_INPUT_STREAM(NODE, NUM) | |
| 130 | * DISCRETE_INPUTX_STREAM(NODE,NUM, GAIN,OFFSET) | |
| 131 | 131 | * |
| 132 | 132 | * DISCRETE_COUNTER(NODE,ENAB,RESET,CLK,MAX,DIR,INIT0,CLKTYPE) |
| 133 | 133 | * DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK) |
| r1591 | r1592 | |
| 349 | 349 | * |
| 350 | 350 | *********************************************************************** |
| 351 | 351 | * |
| 352 | * !!!!! NOT WORKING YET !!!!! | |
| 352 | * DISCRETE_INPUT_STREAM(NODE,NUM) - Accepts stream input NUM | |
| 353 | * DISCRETE_INPUTX_STREAM(NODE,NUM,GAIN,OFFSET) - Accepts a stream input and | |
| 354 | * applies a gain and offset. | |
| 353 | 355 | * |
| 354 | * DISCRETE_INPUT_STREAM(NODE) - Accepts a stream input | |
| 355 | * DISCRETE_INPUTX_STREAM(NODE,GAIN,OFFSET) - Accepts a stream input and | |
| 356 | * applies a gain and offset. | |
| 357 | * | |
| 358 | 356 | * Declaration syntax |
| 359 | 357 | * |
| 360 | * DISCRETE_INPUT_STREAM (name of node) | |
| 361 | * DISCRETE_INPUTX_STREAM(name of node, gain, offset) | |
| 358 | * DISCRETE_INPUT_STREAM (name of node, stream number, ) | |
| 359 | * DISCRETE_INPUTX_STREAM(name of node, stream nubmer, gain, offset) | |
| 362 | 360 | * |
| 363 | * Note: These inputs must be defined in the same order that the sound routes | |
| 364 | * are defined in the game's MACHINE_DRIVER. | |
| 365 | * The discrete system is floating point based. So when routing a stream | |
| 361 | * Note: The discrete system is floating point based. So when routing a stream | |
| 366 | 362 | * set it's gain to 100% and then use DISCRETE_INPUTX_STREAM to adjust |
| 367 | 363 | * it if needed. |
| 368 | 364 | * |
| r1591 | r1592 | |
| 3828 | 3824 | #define DISCRETE_INPUT_NOT(NODE) { NODE, DSS_INPUT_NOT , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,0 }, NULL, "Input Not" }, |
| 3829 | 3825 | #define DISCRETE_INPUTX_NOT(NODE,GAIN,OFFSET,INIT) { NODE, DSS_INPUT_NOT , 3, { NODE_NC,NODE_NC,NODE_NC }, { GAIN,OFFSET,INIT }, NULL, "InputX Not" }, |
| 3830 | 3826 | #define DISCRETE_INPUT_PULSE(NODE,INIT) { NODE, DSS_INPUT_PULSE , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,INIT }, NULL, "Input Pulse" }, |
| 3831 | #define DISCRETE_INPUT_STREAM(NODE) { NODE, DSS_INPUT_STREAM, 2, { NODE_NC,NODE_NC }, { 1,0 }, NULL, "Input Stream" }, | |
| 3832 | #define DISCRETE_INPUTX_STREAM(NODE,GAIN,OFFSET) { NODE, DSS_INPUT_STREAM, 2, { NODE_NC,NODE_NC }, { GAIN,OFFSET }, NULL, "InputX Stream" }, | |
| 3827 | #define DISCRETE_INPUT_STREAM(NODE, NUM) { NODE, DSS_INPUT_STREAM, 3, { NUM,NODE_NC,NODE_NC }, { NUM,1,0 }, NULL, "Input Stream" }, | |
| 3828 | #define DISCRETE_INPUTX_STREAM(NODE, NUM, GAIN,OFFSET) { NODE, DSS_INPUT_STREAM, 3, { NUM,NODE_NC,NODE_NC }, { NUM,GAIN,OFFSET }, NULL, "InputX Stream" }, | |
| 3833 | 3829 | |
| 3834 | 3830 | /* from disc_wav.c */ |
| 3835 | 3831 | /* generic modules */ |
| r1591 | r1592 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | #define EG_SHIFT 16 |
| 43 | #define FM_DELAY 4 // delay in number of slots processed before samples are written to the FM ring buffer | |
| 43 | #define FM_DELAY 0 // delay in number of slots processed before samples are written to the FM ring buffer | |
| 44 | // driver code indicates should be 4, but sounds distorted then | |
| 44 | 45 | |
| 45 | 46 | // include the LFO handling code |
| 46 | 47 | #include "scsplfo.c" |
| r1591 | r1592 | |
| 231 | 232 | #define scsp_dexe scsp_regs[0x16/2] & 0x1000 |
| 232 | 233 | #define dma_transfer_end ((scsp_regs[0x24/2] & 0x10)>>4)|(((scsp_regs[0x26/2] & 0x10)>>4)<<1)|(((scsp_regs[0x28/2] & 0x10)>>4)<<2) |
| 233 | 234 | |
| 234 | static const float SDLT[8]={-1000000.0,-36.0,-30.0,-24.0,-18.0,-12.0,-6.0,0.0}; | |
| 235 | static const float SDLT[8]={-1000000.0f,-36.0f,-30.0f,-24.0f,-18.0f,-12.0f,-6.0f,0.0f}; | |
| 235 | 236 | |
| 236 | 237 | static stream_sample_t *bufferl; |
| 237 | 238 | static stream_sample_t *bufferr; |
| r1591 | r1592 | |
| 333 | 334 | SCSP->TimCnt[1] = 0xFFFF; |
| 334 | 335 | SCSP->udata.data[0x20/2]|=0x80; |
| 335 | 336 | SCSP->udata.data[0x1a/2]&=0xff00; |
| 336 | SCSP->udata.data[0x1a/2]|=SCSP->TimCnt[ | |
| 337 | SCSP->udata.data[0x1a/2]|=SCSP->TimCnt[1]>>8; | |
| 337 | 338 | |
| 338 | 339 | CheckPendingIRQ(SCSP); |
| 339 | 340 | } |
| r1591 | r1592 | |
| 345 | 346 | SCSP->TimCnt[2] = 0xFFFF; |
| 346 | 347 | SCSP->udata.data[0x20/2]|=0x100; |
| 347 | 348 | SCSP->udata.data[0x1c/2]&=0xff00; |
| 348 | SCSP->udata.data[0x1c/2]|=SCSP->TimCnt[ | |
| 349 | SCSP->udata.data[0x1c/2]|=SCSP->TimCnt[2]>>8; | |
| 349 | 350 | |
| 350 | 351 | CheckPendingIRQ(SCSP); |
| 351 | 352 | } |
| r1591 | r1592 | |
| 501 | 502 | slot->udata.data[0]&=~0x800; |
| 502 | 503 | } |
| 503 | 504 | |
| 504 | #define log_base_2(n) (log(( | |
| 505 | #define log_base_2(n) (log((d | |
| 505 | 506 | |
| 506 | 507 | static void SCSP_Init(struct _SCSP *SCSP, const struct SCSPinterface *intf, int sndindex) |
| 507 | 508 | { |
| r1591 | r1592 | |
| 540 | 541 | |
| 541 | 542 | for(i=0;i<0x400;++i) |
| 542 | 543 | { |
| 543 | //float fcent=(double) 1200.0*log_base_2(( | |
| 544 | //float fcent=(double) 1200.0*log_base_2(( | |
| 544 | 545 | //fcent=(double) 44100.0*pow(2.0,fcent/1200.0); |
| 545 | float fcent=44100.0*(1024.0+( | |
| 546 | float fcent=44100.0f*(1024.0f+(f | |
| 546 | 547 | FNS_Table[i]=(float) (1<<SHIFT) *fcent; |
| 547 | 548 | } |
| 548 | 549 | |
| 549 | 550 | for(i=0;i<0x400;++i) |
| 550 | 551 | { |
| 551 | float envDB=((float)(3*(i-0x3ff)))/32.0; | |
| 552 | float envDB=((float)(3*(i-0x3ff)))/32.0f; | |
| 552 | 553 | float scale=(float)(1<<SHIFT); |
| 553 | 554 | EG_TABLE[i]=(INT32)(pow(10.0,envDB/20.0)*scale); |
| 554 | 555 | } |
| r1591 | r1592 | |
| 558 | 559 | int iTL =(i>>0x0)&0xff; |
| 559 | 560 | int iPAN=(i>>0x8)&0x1f; |
| 560 | 561 | int iSDL=(i>>0xD)&0x07; |
| 561 | float TL=1.0; | |
| 562 | float SegaDB=0; | |
| 563 | float fSDL=1.0; | |
| 564 | float PAN=1.0; | |
| 562 | float TL=1.0f; | |
| 563 | float SegaDB=0.0f; | |
| 564 | float fSDL=1.0f; | |
| 565 | float PAN=1.0f; | |
| 565 | 566 | float LPAN,RPAN; |
| 566 | 567 | |
| 567 | if(iTL&0x01) SegaDB-=0.4; | |
| 568 | if(iTL&0x02) SegaDB-=0.8; | |
| 569 | if(iTL&0x04) SegaDB-=1.5; | |
| 570 | if(iTL&0x08) SegaDB-=3; | |
| 571 | if(iTL&0x10) SegaDB-=6; | |
| 572 | if(iTL&0x20) SegaDB-=12; | |
| 573 | if(iTL&0x40) SegaDB-=24; | |
| 574 | if(iTL&0x80) SegaDB-=48; | |
| 568 | if(iTL&0x01) SegaDB-=0.4f; | |
| 569 | if(iTL&0x02) SegaDB-=0.8f; | |
| 570 | if(iTL&0x04) SegaDB-=1.5f; | |
| 571 | if(iTL&0x08) SegaDB-=3.0f; | |
| 572 | if(iTL&0x10) SegaDB-=6.0f; | |
| 573 | if(iTL&0x20) SegaDB-=12.0f; | |
| 574 | if(iTL&0x40) SegaDB-=24.0f; | |
| 575 | if(iTL&0x80) SegaDB-=48.0f; | |
| 575 | 576 | |
| 576 | 577 | TL=pow(10.0,SegaDB/20.0); |
| 577 | 578 | |
| 578 | 579 | SegaDB=0; |
| 579 | if(iPAN&0x1) SegaDB-=3; | |
| 580 | if(iPAN&0x2) SegaDB-=6; | |
| 581 | if(iPAN&0x4) SegaDB-=12; | |
| 582 | if(iPAN&0x8) SegaDB-=24; | |
| 580 | if(iPAN&0x1) SegaDB-=3.0f; | |
| 581 | if(iPAN&0x2) SegaDB-=6.0f; | |
| 582 | if(iPAN&0x4) SegaDB-=12.0f; | |
| 583 | if(iPAN&0x8) SegaDB-=24.0f; | |
| 583 | 584 | |
| 584 | 585 | if((iPAN&0xf)==0xf) PAN=0.0; |
| 585 | 586 | else PAN=pow(10.0,SegaDB/20.0); |
| r1591 | r1592 | |
| 1009 | 1010 | } |
| 1010 | 1011 | |
| 1011 | 1012 | for (addr_select=0;addr_select<2;addr_select++) |
| 1012 | { | |
| 1013 | { | |
| 1014 | INT32 rem_addr; | |
| 1013 | 1015 | switch(LPCTL(slot)) |
| 1014 | 1016 | { |
| 1015 | 1017 | case 0: //no loop |
| r1591 | r1592 | |
| 1021 | 1023 | break; |
| 1022 | 1024 | case 1: //normal loop |
| 1023 | 1025 | if(*addr[addr_select]>=LEA(slot)) |
| 1024 | *slot_addr[addr_select]=LSA(slot)<<SHIFT; | |
| 1026 | { | |
| 1027 | rem_addr = *slot_addr[addr_select] - (LEA(slot)<<SHIFT); | |
| 1028 | *slot_addr[addr_select]=(LSA(slot)<<SHIFT) + rem_addr; | |
| 1029 | } | |
| 1025 | 1030 | break; |
| 1026 | 1031 | case 2: //reverse loop |
| 1027 | 1032 | if((*addr[addr_select]>=LSA(slot)) && !(slot->Backwards)) |
| 1028 | 1033 | { |
| 1029 | *slot_addr[addr_select]=LEA(slot)<<SHIFT; | |
| 1034 | rem_addr = *slot_addr[addr_select] - (LSA(slot)<<SHIFT); | |
| 1035 | *slot_addr[addr_select]=(LEA(slot)<<SHIFT) - rem_addr; | |
| 1030 | 1036 | slot->Backwards=1; |
| 1031 | 1037 | } |
| 1032 | if((*addr[addr_select]<=LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards) | |
| 1033 | *slot_addr[addr_select]=LEA(slot)<<SHIFT; | |
| 1038 | else if((*addr[addr_select]<LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards) | |
| 1039 | { | |
| 1040 | rem_addr = (LSA(slot)<<SHIFT) - *slot_addr[addr_select]; | |
| 1041 | *slot_addr[addr_select]=(LEA(slot)<<SHIFT) - rem_addr; | |
| 1042 | } | |
| 1034 | 1043 | break; |
| 1035 | 1044 | case 3: //ping-pong |
| 1036 | 1045 | if(*addr[addr_select]>=LEA(slot)) //reached end, reverse till start |
| 1037 | 1046 | { |
| 1038 | *slot_addr[addr_select]=LEA(slot)<<SHIFT; | |
| 1047 | rem_addr = *slot_addr[addr_select] - (LEA(slot)<<SHIFT); | |
| 1048 | *slot_addr[addr_select]=(LEA(slot)<<SHIFT) - rem_addr; | |
| 1039 | 1049 | slot->Backwards=1; |
| 1040 | 1050 | } |
| 1041 | ||
| 1051 | ||
| 1042 | 1052 | { |
| 1043 | *slot_addr[addr_select]=LSA(slot)<<SHIFT; | |
| 1053 | rem_addr = (LSA(slot)<<SHIFT) - *slot_addr[addr_select]; | |
| 1054 | *slot_addr[addr_select]=(LSA(slot)<<SHIFT) + rem_addr; | |
| 1044 | 1055 | slot->Backwards=0; |
| 1045 | 1056 | } |
| 1046 | 1057 | break; |
| r1591 | r1592 | |
| 1181 | 1192 | |
| 1182 | 1193 | /*Job done,request a dma end irq*/ |
| 1183 | 1194 | if(scsp_regs[0x1e/2] & 0x10) |
| 1184 | cpunum_set_input_line(2,dma_transfer_end,HOLD_LINE); | |
| 1195 | cpunum_set_input_line(Machine, 2,dma_transfer_end,HOLD_LINE); | |
| 1185 | 1196 | } |
| 1186 | 1197 | |
| 1187 | 1198 | #ifdef UNUSED_FUNCTION |
| r1591 | r1592 | |
| 1296 | 1307 | case 0x42a: |
| 1297 | 1308 | if(stv_scu && !(stv_scu[40] & 0x40) /*&& scsp_regs[0x42c/2] & 0x20*/)/*Main CPU allow sound irq*/ |
| 1298 | 1309 | { |
| 1299 | cpunum_set_input_line_and_vector(0, 9, HOLD_LINE , 0x46); | |
| 1310 | cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46); | |
| 1300 | 1311 | logerror("SCSP: Main CPU interrupt\n"); |
| 1301 | 1312 | } |
| 1302 | 1313 | break; |
| r1591 | r1592 | |
|---|---|---|
| 186 | 186 | { |
| 187 | 187 | double clockscale = (double)chip->clock / 2119040.0; |
| 188 | 188 | double time = (ATBL[i] / 1000.0) / clockscale; /* attack time in seconds */ |
| 189 | chip->ar_tbl[i] = | |
| 189 | chip->ar_tbl[i] = | |
| 190 | 190 | /* logerror("ATBL[%i] = %20.16f time = %f s\n",i, chip->ar_tbl[i], time); */ |
| 191 | 191 | } |
| 192 | 192 | |
| r1591 | r1592 | |
| 194 | 194 | { |
| 195 | 195 | double clockscale = (double)chip->clock / 2119040.0; |
| 196 | 196 | double time = (DTBL[i] / 1000.0) / clockscale; /* decay time in seconds */ |
| 197 | chip->dr_tbl[i] = | |
| 197 | chip->dr_tbl[i] = | |
| 198 | 198 | /* logerror("DTBL[%i] = %20.16f time = %f s\n",i, chip->dr_tbl[i], time); */ |
| 199 | 199 | } |
| 200 | 200 | } |
| r1591 | r1592 | |
|---|---|---|
| 13 | 13 | 1.01 fixed clipping problem - LN (0.111u5) |
| 14 | 14 | 1.1 add VSU-1000 features, fully fixed stream update by fixing word latching - LN (0.111u6) |
| 15 | 15 | 1.11 fix signedness of output, pre-multiply, fixes clicking on VSU-1000 volume change - LN (0.111u7) |
| 16 | 1.20 supports setting the clock freq directly - reset is done by external hardware, | |
| 17 | the chip has no reset line ZV (0.122) | |
| 16 | 18 | |
| 17 | 19 | TODO: |
| 18 | 20 | * increase accuracy of internal S14001A 'filter' for both driven and undriven cycles (its not terribly inaccurate for undriven cycles, but the dc sliding of driven cycles is not emulated) |
| r1591 | r1592 | |
| 156 | 158 | UINT8 audioout; // filtered audio output |
| 157 | 159 | UINT8 *SpeechRom; // array to hold rom contents, mame will not need this, will use a pointer |
| 158 | 160 | UINT8 filtervals[8]; |
| 159 | UINT8 VSU1000_amp; // amplitude setting on VSU-1000 board | |
| 160 | UINT16 VSU1000_freq; // frequency setting on VSU-1000 board | |
| 161 | UINT16 VSU1000_counter; // counter for freq divider | |
| 161 | UINT8 VSU1000_amp; // amplitude setting on VSU-1000 board | |
| 162 | 162 | } S14001AChip; |
| 163 | 163 | |
| 164 | 164 | //#define DEBUGSTATE |
| r1591 | r1592 | |
| 437 | 437 | mixp = &mix[0]; |
| 438 | 438 | for (i = 0; i < length; i++) |
| 439 | 439 | { |
| 440 | if (--chip->VSU1000_counter==0) | |
| 441 | { | |
| 442 | s14001a_clock(chip); | |
| 443 | chip->VSU1000_counter = chip->VSU1000_freq; | |
| 444 | } | |
| 440 | s14001a_clock(chip); | |
| 445 | 441 | outputs[0][i] = ((((INT16)chip->audioout)-128)<<6)*chip->VSU1000_amp; |
| 446 | 442 | } |
| 447 | 443 | } |
| r1591 | r1592 | |
| 459 | 455 | chip->GlobalSilenceState = 1; |
| 460 | 456 | chip->OldDelta = 0x02; |
| 461 | 457 | chip->DACOutput = SILENCE; |
| 462 | chip->VSU1000_amp = 0; /* reset by /reset line */ | |
| 463 | chip->VSU1000_freq = 1; /* base-1; reset by /reset line */ | |
| 464 | chip->VSU1000_counter = 1; /* base-1; not reset by /reset line but this is the best place to reset it */ | |
| 465 | 458 | |
| 466 | 459 | for (i = 0; i < 8; i++) |
| 467 | 460 | { |
| r1591 | r1592 | |
| 472 | 465 | |
| 473 | 466 | chip->SpeechRom = memory_region(intf->region); |
| 474 | 467 | |
| 475 | chip->stream = stream_create(0, 1, clock, chip, s14001a_pcm_update); | |
| 468 | chip->stream = stream_create(0, 1, clock ? clock : Machine->sample_rate, chip, s14001a_pcm_update); | |
| 476 | 469 | |
| 477 | 470 | return chip; |
| 478 | 471 | } |
| r1591 | r1592 | |
| 488 | 481 | int S14001A_bsy_0_r(void) |
| 489 | 482 | { |
| 490 | 483 | S14001AChip *chip = sndti_token(SOUND_S14001A, 0); |
| 491 | ||
| 484 | | |
| 492 | 485 | #ifdef DEBUGSTATE |
| 493 | 486 | fprintf(stderr,"busy state checked: %d\n",(chip->machineState != 0) ); |
| 494 | 487 | #endif |
| r1591 | r1592 | |
| 506 | 499 | { |
| 507 | 500 | S14001AChip *chip = sndti_token(SOUND_S14001A, 0); |
| 508 | 501 | stream_update(chip->stream); |
| 509 | ||
| 502 | | |
| 510 | 503 | chip->resetState = (data==1); |
| 511 | 504 | chip->machineState = chip->resetState ? 1 : chip->machineState; |
| 512 | 505 | } |
| 513 | 506 | |
| 514 | void S14001A_set_ | |
| 507 | void S14001A_set_clock(int clock | |
| 515 | 508 | { |
| 516 | S14001AChip *chip = sndti_token(SOUND_S14001A, 0); | |
| 517 | stream_update(chip->stream); | |
| 518 | chip->VSU1000_freq = newrate; | |
| 509 | S14001AChip *chip = sndti_token(SOUND_S14001A, 0); | |
| 510 | stream_set_sample_rate(chip->stream, clock); | |
| 519 | 511 | } |
| 520 | 512 | |
| 521 | 513 | void S14001A_set_volume(int volume) |
| 522 | 514 | { |
| 523 | 515 | S14001AChip *chip = sndti_token(SOUND_S14001A, 0); |
| 524 | stream_update(chip->stream); | |
| 525 | chip->VSU1000_amp = volume; | |
| 516 | stream_update(chip->stream); | |
| 517 | chip->VSU1000_amp = volume; | |
| 526 | 518 | } |
| 527 | 519 | |
| 528 | 520 | void s14001a_get_info(void *token, UINT32 state, sndinfo *info) |
| 529 | 521 | { |
| 530 | 522 | switch (state) |
| 531 | 523 | { |
| 532 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 533 | ||
| 534 | 524 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 535 | 525 | case SNDINFO_PTR_SET_INFO: info->set_info = s14001a_set_info; break; |
| 536 | 526 | case SNDINFO_PTR_START: info->start = s14001a_start; break; |
| 537 | case SNDINFO_PTR_STOP: /* Nothing */ break; | |
| 538 | case SNDINFO_PTR_RESET: /* Nothing */ break; | |
| 539 | 527 | |
| 540 | 528 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 541 | case SNDINFO_STR_NAME: info->s = "S14001A"; break; | |
| 542 | case SNDINFO_STR_CORE_FAMILY: info->s = "TSI S14001A"; break; | |
| 543 | case SNDINFO_STR_CORE_VERSION: info->s = "1.11"; break; | |
| 529 | case SNDINFO_STR_NAME: info->s = "S14001A"; break; | |
| 530 | case SNDINFO_STR_CORE_FAMILY: info->s = "TSI S14001A"; break; | |
| 531 | case SNDINFO_STR_CORE_VERSION: info->s = "1.20"; break; | |
| 544 | 532 | case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break; |
| 545 | case SNDINFO_STR_CORE_CREDITS: | |
| 533 | case SNDINFO_STR_CORE_CREDITS: | |
| 546 | 534 | } |
| 547 | 535 | } |
| 548 |
| r1591 | r1592 | |
|---|---|---|
| 9 | 9 | int S14001A_bsy_0_r(void); /* read BUSY pin */ |
| 10 | 10 | void S14001A_reg_0_w(int data); /* write to input latch */ |
| 11 | 11 | void S14001A_rst_0_w(int data); /* write to RESET pin */ |
| 12 | void S14001A_set_ | |
| 12 | void S14001A_set_clock(int clock | |
| 13 | 13 | void S14001A_set_volume(int volume); /* set VSU-1000 volume control */ |
| 14 | 14 | |
| 15 | 15 | #endif |
| r1591 | r1592 | |
|---|---|---|
| 580 | 580 | # Texas Instruments TMS5110 speech synthesizers |
| 581 | 581 | #------------------------------------------------- |
| 582 | 582 | |
| 583 | SOUNDDEFS += -DHAS_TMS5100=$(if $(filter TMS5100,$(SOUNDS)),1,0) | |
| 583 | 584 | SOUNDDEFS += -DHAS_TMS5110=$(if $(filter TMS5110,$(SOUNDS)),1,0) |
| 585 | SOUNDDEFS += -DHAS_TMS5110A=$(if $(filter TMS5110A,$(SOUNDS)),1,0) | |
| 586 | SOUNDDEFS += -DHAS_CD2801=$(if $(filter CD2801,$(SOUNDS)),1,0) | |
| 587 | SOUNDDEFS += -DHAS_TMC0281=$(if $(filter TMC0281,$(SOUNDS)),1,0) | |
| 588 | SOUNDDEFS += -DHAS_CD2802=$(if $(filter CD2802,$(SOUNDS)),1,0) | |
| 589 | SOUNDDEFS += -DHAS_M58817=$(if $(filter M58817,$(SOUNDS)),1,0) | |
| 590 | SOUNDDEFS += -DHAS_TMS5110=$(if $(filter TMS5110,$(SOUNDS)),1,0) | |
| 584 | 591 | SOUNDDEFS += -DHAS_TMC0285=$(if $(filter TMC0285,$(SOUNDS)),1,0) |
| 585 | 592 | SOUNDDEFS += -DHAS_TMS5200=$(if $(filter TMS5200,$(SOUNDS)),1,0) |
| 586 | 593 | SOUNDDEFS += -DHAS_TMS5220=$(if $(filter TMS5220,$(SOUNDS)),1,0) |
| r1591 | r1592 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | static void *tms5110_start(int sndindex, int clock, const void *config) |
| 68 | 68 | { |
| 69 | static const struct TMS5110interface dummy = { | |
| 69 | static const struct TMS5110interface dummy = { | |
| 70 | 70 | struct tms5110_info *info; |
| 71 | 71 | |
| 72 | 72 | info = auto_malloc(sizeof(*info)); |
| 73 | 73 | memset(info, 0, sizeof(*info)); |
| 74 | 74 | info->intf = config ? config : &dummy; |
| 75 | 75 | |
| 76 | info->chip = tms5110_create(sndindex, | |
| 76 | info->chip = tms5110_create(sndindex, TMS5110_IS_5110A | |
| 77 | 77 | if (!info->chip) |
| 78 | 78 | return NULL; |
| 79 | 79 | sndintrf_register_token(info); |
| r1591 | r1592 | |
| 104 | 104 | return info; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | static void *tms5100_start(int sndindex, int clock, const void *config) | |
| 108 | { | |
| 109 | struct tms5110_info *info = tms5110_start(sndindex, clock, config); | |
| 110 | tms5110_set_variant(info->chip, TMS5110_IS_5100); | |
| 111 | return info; | |
| 112 | } | |
| 107 | 113 | |
| 114 | static void *tms5110a_start(int sndindex, int clock, const void *config) | |
| 115 | { | |
| 116 | struct tms5110_info *info = tms5110_start(sndindex, clock, config); | |
| 117 | tms5110_set_variant(info->chip, TMS5110_IS_5110A); | |
| 118 | return info; | |
| 119 | } | |
| 108 | 120 | |
| 121 | static void *cd2801_start(int sndindex, int clock, const void *config) | |
| 122 | { | |
| 123 | struct tms5110_info *info = tms5110_start(sndindex, clock, config); | |
| 124 | tms5110_set_variant(info->chip, TMS5110_IS_CD2801); | |
| 125 | return info; | |
| 126 | } | |
| 127 | ||
| 128 | static void *tmc0281_start(int sndindex, int clock, const void *config) | |
| 129 | { | |
| 130 | struct tms5110_info *info = tms5110_start(sndindex, clock, config); | |
| 131 | tms5110_set_variant(info->chip, TMS5110_IS_TMC0281); | |
| 132 | return info; | |
| 133 | } | |
| 134 | ||
| 135 | static void *cd2802_start(int sndindex, int clock, const void *config) | |
| 136 | { | |
| 137 | struct tms5110_info *info = tms5110_start(sndindex, clock, config); | |
| 138 | tms5110_set_variant(info->chip, TMS5110_IS_CD2802); | |
| 139 | return info; | |
| 140 | } | |
| 141 | ||
| 142 | static void *m58817_start(int sndindex, int clock, const void *config) | |
| 143 | { | |
| 144 | struct tms5110_info *info = tms5110_start(sndindex, clock, config); | |
| 145 | tms5110_set_variant(info->chip, TMS5110_IS_M58817); | |
| 146 | return info; | |
| 147 | } | |
| 148 | ||
| 149 | ||
| 109 | 150 | /****************************************************************************** |
| 110 | 151 | |
| 111 | 152 | tms5110_stop -- free buffers |
| r1591 | r1592 | |
| 251 | 292 | } |
| 252 | 293 | } |
| 253 | 294 | |
| 254 | ||
| 255 | 295 | void tms5110_get_info(void *token, UINT32 state, sndinfo *info) |
| 256 | 296 | { |
| 257 | 297 | switch (state) |
| 258 | 298 | { |
| 259 | 299 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 300 | case SNDINFO_INT_ALIAS: info->i = SOUND_TMS5110; break; | |
| 260 | 301 | |
| 261 | 302 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 262 | 303 | case SNDINFO_PTR_SET_INFO: info->set_info = tms5110_set_info; break; |
| r1591 | r1592 | |
| 273 | 314 | } |
| 274 | 315 | } |
| 275 | 316 | |
| 317 | void tms5100_get_info(void *token, UINT32 state, sndinfo *info) | |
| 318 | { | |
| 319 | switch (state) | |
| 320 | { | |
| 321 | case SNDINFO_PTR_START: info->start = tms5100_start; break; | |
| 322 | case SNDINFO_STR_NAME: info->s = "TMS5100"; break; | |
| 323 | default: tms5110_get_info(token, state, info); break; | |
| 324 | } | |
| 325 | } | |
| 326 | ||
| 327 | void tms5110a_get_info(void *token, UINT32 state, sndinfo *info) | |
| 328 | { | |
| 329 | switch (state) | |
| 330 | { | |
| 331 | case SNDINFO_PTR_START: info->start = tms5110a_start; break; | |
| 332 | case SNDINFO_STR_NAME: info->s = "TMS5100A"; break; | |
| 333 | default: tms5110_get_info(token, state, info); break; | |
| 334 | } | |
| 335 | } | |
| 336 | ||
| 337 | void cd2801_get_info(void *token, UINT32 state, sndinfo *info) | |
| 338 | { | |
| 339 | switch (state) | |
| 340 | { | |
| 341 | case SNDINFO_PTR_START: info->start = cd2801_start; break; | |
| 342 | case SNDINFO_STR_NAME: info->s = "CD2801"; break; | |
| 343 | default: tms5110_get_info(token, state, info); break; | |
| 344 | } | |
| 345 | } | |
| 346 | ||
| 347 | void tmc0281_get_info(void *token, UINT32 state, sndinfo *info) | |
| 348 | { | |
| 349 | switch (state) | |
| 350 | { | |
| 351 | case SNDINFO_PTR_START: info->start = tmc0281_start; break; | |
| 352 | case SNDINFO_STR_NAME: info->s = "TMS5100"; break; | |
| 353 | default: tms5110_get_info(token, state, info); break; | |
| 354 | } | |
| 355 | } | |
| 356 | ||
| 357 | void cd2802_get_info(void *token, UINT32 state, sndinfo *info) | |
| 358 | { | |
| 359 | switch (state) | |
| 360 | { | |
| 361 | case SNDINFO_PTR_START: info->start = cd2802_start; break; | |
| 362 | case SNDINFO_STR_NAME: info->s = "CD2802"; break; | |
| 363 | default: tms5110_get_info(token, state, info); break; | |
| 364 | } | |
| 365 | } | |
| 366 | ||
| 367 | void m58817_get_info(void *token, UINT32 state, sndinfo *info) | |
| 368 | { | |
| 369 | switch (state) | |
| 370 | { | |
| 371 | case SNDINFO_PTR_START: info->start = m58817_start; break; | |
| 372 | case SNDINFO_STR_NAME: info->s = "M58817"; break; | |
| 373 | default: tms5110_get_info(token, state, info); break; | |
| 374 | } | |
| 375 | } | |
| 376 | ||
| 377 | ||
| 378 |
| r1591 | r1592 | |
|---|---|---|
| 50 | 50 | { |
| 51 | 51 | /* milliseconds */ |
| 52 | 52 | #if defined(SID_REFTIMES) |
| 53 | 2,8,16,24,38,56,68,80, | |
| 54 | 100,250,500,800,1000,3000,5000,8000 | |
| 53 | 2.0f, 8.0f, 16.0f, 24.0f, 38.0f, 56.0f, 68.0f, 80.0f, | |
| 54 | 100.0f, 250.0f, 500.0f, 800.0f, 1000.0f, 3000.0f, 5000.0f, 8000.0f | |
| 55 | 55 | #else |
| 56 | 2.2528606, 8.0099577, 15.7696042, 23.7795619, 37.2963655, 55.0684591, | |
| 57 | 66.8330845, 78.3473987, | |
| 58 | 98.1219818, 244.554021, 489.108042, 782.472742, 977.715461, 2933.64701, | |
| 59 | 4889.07793, 7822.72493 | |
| 56 | 2.2528606f, 8.0099577f, 15.7696042f, 23.7795619f, 37.2963655f, 55.0684591f, | |
| 57 | 66.8330845f, 78.3473987f, | |
| 58 | 98.1219818f, 244.554021f, 489.108042f, 782.472742f, 977.715461f, 2933.64701f, | |
| 59 | 4889.07793f, 7822.72493f | |
| 60 | 60 | #endif |
| 61 | 61 | }; |
| 62 | 62 | |
| r1591 | r1592 | |
| 64 | 64 | { |
| 65 | 65 | /* milliseconds */ |
| 66 | 66 | #if defined(SID_REFTIMES) |
| 67 | 8,24,48,72,114,168,204,240, | |
| 68 | 300,750,1500,2400,3000,9000,15000,24000 | |
| 67 | 8.0f, 24.0f, 48.0f, 72.0f, 114.0f, 168.0f, 204.0f, 240.0f, | |
| 68 | 300.0f, 750.0f, 1500.0f, 2400.0f, 3000.0f, 9000.0f, 15000.0f, 24000.0f | |
| 69 | 69 | #else |
| 70 | 8.91777693, 24.594051, 48.4185907, 73.0116639, 114.512475, 169.078356, | |
| 71 | 205.199432, 240.551975, | |
| 72 | 301.266125, 750.858245, 1501.71551, 2402.43682, 3001.89298, 9007.21405, | |
| 73 | 15010.998, 24018.2111 | |
| 70 | 8.91777693f, 24.594051f, 48.4185907f, 73.0116639f, 114.512475f, 169.078356f, | |
| 71 | 205.199432f, 240.551975f, | |
| 72 | 301.266125f, 750.858245f, 1501.71551f, 2402.43682f, 3001.89298f, 9007.21405f, | |
| 73 | 15010.998f, 24018.2111f | |
| 74 | 74 | #endif |
| 75 | 75 | }; |
| 76 | 76 |
| r1591 | r1592 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | struct TMS5110interface |
| 9 | 9 | { |
| 10 | int variant; /* Variant of the 5110 - see tms5110.h */ | |
| 11 | 10 | int rom_region; /* set to -1 to specifiy callbacks below */ |
| 12 | 11 | int (*M0_callback)(void); /* function to be called when chip requests another bit */ |
| 13 | 12 | void (*load_address)(int addr); /* speech ROM load address callback */ |
| r1591 | r1592 | |
|---|---|---|
| 13 | 13 | extern const ptr2sidUwordFunc enveModeTable[]; // -> envelope.cpp |
| 14 | 14 | extern const UINT8 masterVolumeLevels[16]; // -> envelope.cpp |
| 15 | 15 | |
| 16 | static const UINT8 ENVE_STARTATTACK = 0; | |
| 17 | static const UINT8 ENVE_STARTRELEASE = 2; | |
| 16 | enum | |
| 17 | { | |
| 18 | ENVE_STARTATTACK = 0, | |
| 19 | ENVE_STARTRELEASE = 2, | |
| 18 | 20 | |
| 19 | static const UINT8 ENVE_ATTACK = 4; | |
| 20 | static const UINT8 ENVE_DECAY = 6; | |
| 21 | static const UINT8 ENVE_SUSTAIN = 8; | |
| 22 | static const UINT8 ENVE_RELEASE = 10; | |
| 23 | static const UINT8 ENVE_SUSTAINDECAY = 12; | |
| 24 | static const UINT8 ENVE_MUTE = 14; | |
| 21 | ENVE_ATTACK = 4, | |
| 22 | ENVE_DECAY = 6, | |
| 23 | ENVE_SUSTAIN = 8, | |
| 24 | ENVE_RELEASE = 10, | |
| 25 | ENVE_SUSTAINDECAY = 12, | |
| 26 | ENVE_MUTE = 14, | |
| 25 | 27 | |
| 26 | static const UINT8 ENVE_STARTSHORTATTACK = 16; | |
| 27 | static const UINT8 ENVE_SHORTATTACK = 16; | |
| 28 | ENVE_STARTSHORTATTACK = 16, | |
| 29 | ENVE_SHORTATTACK = 16, | |
| 28 | 30 | |
| 29 | static const UINT8 ENVE_ALTER = 32; | |
| 31 | ENVE_ALTER = 32 | |
| 32 | }; | |
| 30 | 33 | |
| 31 | 34 | |
| 32 | 35 | #endif |
| r1591 | r1592 | |
|---|---|---|
| 74 | 74 | INT32 defval; /* default value */ |
| 75 | 75 | INT32 maxval; /* maximum value */ |
| 76 | 76 | INT32 incval; /* increment value */ |
| 77 | INT32 (*update)(INT32 newval, char *buffer, int arg); /* callback */ | |
| 77 | INT32 (*update)(running_machine *machine, INT32 newval, char *buffer, int arg); /* callback */ | |
| 78 | 78 | int arg; /* argument */ |
| 79 | 79 | }; |
| 80 | 80 | |
| r1591 | r1592 | |
| 88 | 88 | static render_font *ui_font; |
| 89 | 89 | |
| 90 | 90 | /* current UI handler */ |
| 91 | static UINT32 (*ui_handler_callback)(UINT32); | |
| 91 | static UINT32 (*ui_handler_callback)(running_machine *, UINT32); | |
| 92 | 92 | static UINT32 ui_handler_param; |
| 93 | 93 | |
| 94 | 94 | /* flag to track single stepping */ |
| r1591 | r1592 | |
| 130 | 130 | static int sprintf_warnings(char *buffer); |
| 131 | 131 | |
| 132 | 132 | /* UI handlers */ |
| 133 | static UINT32 handler_messagebox(UINT32 state); | |
| 134 | static UINT32 handler_messagebox_ok(UINT32 state); | |
| 135 | static UINT32 handler_messagebox_anykey(UINT32 state); | |
| 136 | static UINT32 handler_ingame(UINT32 state); | |
| 137 | static UINT32 handler_slider(UINT32 state); | |
| 138 | static UINT32 handler_load_save(UINT32 state); | |
| 133 | static UINT32 handler_messagebox(running_machine *machine, UINT32 state); | |
| 134 | static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state); | |
| 135 | static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state); | |
| 136 | static UINT32 handler_ingame(running_machine *machine, UINT32 state); | |
| 137 | static UINT32 handler_slider(running_machine *machine, UINT32 state); | |
| 138 | static UINT32 handler_load_save(running_machine *machine, UINT32 state); | |
| 139 | 139 | |
| 140 | 140 | /* slider controls */ |
| 141 | 141 | static void slider_init(void); |
| 142 | 142 | static void slider_display(const char *text, int minval, int maxval, int defval, int curval); |
| 143 | 143 | static void slider_draw_bar(float leftx, float topy, float width, float height, float percentage, float default_percentage); |
| 144 | static INT32 slider_volume(INT32 newval, char *buffer, int arg); | |
| 145 | static INT32 slider_mixervol(INT32 newval, char *buffer, int arg); | |
| 146 | static INT32 slider_adjuster(INT32 newval, char *buffer, int arg); | |
| 147 | static INT32 slider_overclock(INT32 newval, char *buffer, int arg); | |
| 148 | static INT32 slider_refresh(INT32 newval, char *buffer, int arg); | |
| 149 | static INT32 slider_brightness(INT32 newval, char *buffer, int arg); | |
| 150 | static INT32 slider_contrast(INT32 newval, char *buffer, int arg); | |
| 151 | static INT32 slider_gamma(INT32 newval, char *buffer, int arg); | |
| 152 | static INT32 slider_xscale(INT32 newval, char *buffer, int arg); | |
| 153 | static INT32 slider_yscale(INT32 newval, char *buffer, int arg); | |
| 154 | static INT32 slider_xoffset(INT32 newval, char *buffer, int arg); | |
| 155 | static INT32 slider_yoffset(INT32 newval, char *buffer, int arg); | |
| 156 | static INT32 slider_flicker(INT32 newval, char *buffer, int arg); | |
| 157 | static INT32 slider_beam(INT32 newval, char *buffer, int arg); | |
| 144 | static INT32 slider_volume(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 145 | static INT32 slider_mixervol(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 146 | static INT32 slider_adjuster(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 147 | static INT32 slider_overclock(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 148 | static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 149 | static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 150 | static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 151 | static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 152 | static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 153 | static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 154 | static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 155 | static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 156 | static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 157 | static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 158 | static char *slider_get_screen_desc(int arg); | |
| 158 | 159 | #ifdef MAME_DEBUG |
| 159 | static INT32 slider_crossscale(INT32 newval, char *buffer, int arg); | |
| 160 | static INT32 slider_crossoffset(INT32 newval, char *buffer, int arg); | |
| 160 | static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 161 | static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, int arg); | |
| 161 | 162 | #endif |
| 162 | 163 | |
| 163 | 164 | |
| r1591 | r1592 | |
| 170 | 171 | pair for the current UI handler |
| 171 | 172 | -------------------------------------------------*/ |
| 172 | 173 | |
| 173 | INLINE UINT32 ui_set_handler(UINT32 (*callback)(UINT32), UINT32 param) | |
| 174 | INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine *, UINT32), UINT32 param) | |
| 174 | 175 | { |
| 175 | 176 | ui_handler_callback = callback; |
| 176 | 177 | ui_handler_param = param; |
| r1591 | r1592 | |
| 182 | 183 | slider_config - configure a slider entry |
| 183 | 184 | -------------------------------------------------*/ |
| 184 | 185 | |
| 185 | INLINE void slider_config(slider_state *state, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, INT32 (*update)(INT32, char *, int), int arg) | |
| 186 | INLINE void slider_config(slider_state *state, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, | |
| 187 | INT32 (*update)(running_machine *, INT32, char *, int), int arg) | |
| 186 | 188 | { |
| 187 | 189 | state->minval = minval; |
| 188 | 190 | state->defval = defval; |
| r1591 | r1592 | |
| 304 | 306 | various startup screens |
| 305 | 307 | -------------------------------------------------*/ |
| 306 | 308 | |
| 307 | int ui_display_startup_screens(int first_time, int show_disclaimer) | |
| 309 | int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer) | |
| 308 | 310 | { |
| 309 | 311 | #ifdef MESS |
| 310 | 312 | const int maxstate = 4; |
| r1591 | r1592 | |
| 369 | 371 | |
| 370 | 372 | /* loop while we have a handler */ |
| 371 | 373 | while (ui_handler_callback != handler_ingame && !mame_is_scheduled_event_pending(Machine) && !ui_menu_is_force_game_select()) |
| 372 | video_frame_update(FALSE); | |
| 374 | video_frame_update(machine, FALSE); | |
| 373 | 375 | |
| 374 | 376 | /* clear the handler and force an update */ |
| 375 | 377 | ui_set_handler(handler_ingame, 0); |
| 376 | video_frame_update(FALSE); | |
| 378 | video_frame_update(machine, FALSE); | |
| 377 | 379 | } |
| 378 | 380 | |
| 379 | 381 | /* if we're the empty driver, force the menus on */ |
| r1591 | r1592 | |
| 389 | 391 | at startup |
| 390 | 392 | -------------------------------------------------*/ |
| 391 | 393 | |
| 392 | void ui_set_startup_text(const char *text, int force) | |
| 394 | void ui_set_startup_text(running_machine *machine, const char *text, int force) | |
| 393 | 395 | { |
| 394 | 396 | static osd_ticks_t lastupdatetime = 0; |
| 395 | 397 | osd_ticks_t curtime = osd_ticks(); |
| r1591 | r1592 | |
| 402 | 404 | if (force || (curtime - lastupdatetime) > osd_ticks_per_second() / 4) |
| 403 | 405 | { |
| 404 | 406 | lastupdatetime = curtime; |
| 405 | video_frame_update(FALSE); | |
| 407 | video_frame_update(machine, FALSE); | |
| 406 | 408 | } |
| 407 | 409 | } |
| 408 | 410 | |
| r1591 | r1592 | |
| 412 | 414 | render it; called by video.c |
| 413 | 415 | -------------------------------------------------*/ |
| 414 | 416 | |
| 415 | void ui_update_and_render( | |
| 417 | void ui_update_and_render(running_machine *machine) | |
| 416 | 418 | { |
| 417 | 419 | /* always start clean */ |
| 418 | 420 | render_container_empty(render_container_get_ui()); |
| r1591 | r1592 | |
| 431 | 433 | |
| 432 | 434 | /* call the current UI handler */ |
| 433 | 435 | assert(ui_handler_callback != NULL); |
| 434 | ui_handler_param = (*ui_handler_callback)(ui_handler_param); | |
| 436 | ui_handler_param = (*ui_handler_callback)(machine, ui_handler_param); | |
| 435 | 437 | |
| 436 | 438 | /* cancel takes us back to the ingame handler */ |
| 437 | 439 | if (ui_handler_param == UI_HANDLER_CANCEL) |
| r1591 | r1592 | |
| 1137 | 1139 | messagebox_text string but handles no input |
| 1138 | 1140 | -------------------------------------------------*/ |
| 1139 | 1141 | |
| 1140 | static UINT32 handler_messagebox(UINT32 state) | |
| 1142 | static UINT32 handler_messagebox(running_machine *machine, UINT32 state) | |
| 1141 | 1143 | { |
| 1142 | 1144 | ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); |
| 1143 | 1145 | return 0; |
| r1591 | r1592 | |
| 1149 | 1151 | messagebox_text string and waits for an OK |
| 1150 | 1152 | -------------------------------------------------*/ |
| 1151 | 1153 | |
| 1152 | static UINT32 handler_messagebox_ok(UINT32 state) | |
| 1154 | static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state) | |
| 1153 | 1155 | { |
| 1154 | 1156 | /* draw a standard message window */ |
| 1155 | 1157 | ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); |
| r1591 | r1592 | |
| 1179 | 1181 | any keypress |
| 1180 | 1182 | -------------------------------------------------*/ |
| 1181 | 1183 | |
| 1182 | static UINT32 handler_messagebox_anykey(UINT32 state) | |
| 1184 | static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state) | |
| 1183 | 1185 | { |
| 1184 | 1186 | /* draw a standard message window */ |
| 1185 | 1187 | ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); |
| r1591 | r1592 | |
| 1204 | 1206 | of the standard keypresses |
| 1205 | 1207 | -------------------------------------------------*/ |
| 1206 | 1208 | |
| 1207 | static UINT32 handler_ingame(UINT32 state) | |
| 1209 | static UINT32 handler_ingame(running_machine *machine, UINT32 state) | |
| 1208 | 1210 | { |
| 1209 | 1211 | int is_paused = mame_is_paused(Machine); |
| 1210 | 1212 | |
| r1591 | r1592 | |
| 1378 | 1380 | and calls the slider handler |
| 1379 | 1381 | -------------------------------------------------*/ |
| 1380 | 1382 | |
| 1381 | static UINT32 handler_slider(UINT32 state) | |
| 1383 | static UINT32 handler_slider(running_machine *machine, UINT32 state) | |
| 1382 | 1384 | { |
| 1383 | 1385 | slider_state *cur = &slider_list[slider_current]; |
| 1384 | 1386 | INT32 increment = 0, newval; |
| r1591 | r1592 | |
| 1402 | 1404 | } |
| 1403 | 1405 | |
| 1404 | 1406 | /* determine the new value */ |
| 1405 | newval = (*cur->update)(0, NULL, cur->arg) + increment; | |
| 1407 | newval = (*cur->update)(machine, 0, NULL, cur->arg) + increment; | |
| 1406 | 1408 | |
| 1407 | 1409 | /* select resets to the default value */ |
| 1408 | 1410 | if (input_ui_pressed(IPT_UI_SELECT)) |
| r1591 | r1592 | |
| 1415 | 1417 | newval = cur->maxval; |
| 1416 | 1418 | |
| 1417 | 1419 | /* update the new data and get the text */ |
| 1418 | (*cur->update)(newval, textbuf, cur->arg); | |
| 1420 | (*cur->update)(machine, newval, textbuf, cur->arg); | |
| 1419 | 1421 | |
| 1420 | 1422 | /* display the UI */ |
| 1421 | 1423 | slider_display(textbuf, cur->minval, cur->maxval, cur->defval, newval); |
| r1591 | r1592 | |
| 1443 | 1445 | specifying a game to save or load |
| 1444 | 1446 | -------------------------------------------------*/ |
| 1445 | 1447 | |
| 1446 | static UINT32 handler_load_save(UINT32 state) | |
| 1448 | static UINT32 handler_load_save(running_machine *machine, UINT32 state) | |
| 1447 | 1449 | { |
| 1448 | 1450 | char filename[20]; |
| 1449 | 1451 | input_code code; |
| r1591 | r1592 | |
| 1657 | 1659 | slider_volume - global volume slider callback |
| 1658 | 1660 | -------------------------------------------------*/ |
| 1659 | 1661 | |
| 1660 | static INT32 slider_volume(INT32 newval, char *buffer, int arg) | |
| 1662 | static INT32 slider_volume(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1661 | 1663 | { |
| 1662 | 1664 | if (buffer != NULL) |
| 1663 | 1665 | { |
| 1664 | 1666 | sound_set_attenuation(newval); |
| 1665 | sprintf(buffer, "Volume %3ddB", sound_get_attenuation()); | |
| 1667 | sprintf(buffer, "Master Volume %3ddB", sound_get_attenuation()); | |
| 1666 | 1668 | } |
| 1667 | 1669 | return sound_get_attenuation(); |
| 1668 | 1670 | } |
| r1591 | r1592 | |
| 1673 | 1675 | slider callback |
| 1674 | 1676 | -------------------------------------------------*/ |
| 1675 | 1677 | |
| 1676 | static INT32 slider_mixervol(INT32 newval, char *buffer, int arg) | |
| 1678 | static INT32 slider_mixervol(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1677 | 1679 | { |
| 1678 | 1680 | if (buffer != NULL) |
| 1679 | 1681 | { |
| r1591 | r1592 | |
| 1689 | 1691 | callback |
| 1690 | 1692 | -------------------------------------------------*/ |
| 1691 | 1693 | |
| 1692 | static INT32 slider_adjuster(INT32 newval, char *buffer, int arg) | |
| 1694 | static INT32 slider_adjuster(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1693 | 1695 | { |
| 1694 | 1696 | input_port_entry *in = &Machine->input_ports[arg]; |
| 1695 | 1697 | if (buffer != NULL) |
| r1591 | r1592 | |
| 1706 | 1708 | callback |
| 1707 | 1709 | -------------------------------------------------*/ |
| 1708 | 1710 | |
| 1709 | static INT32 slider_overclock(INT32 newval, char *buffer, int arg) | |
| 1711 | static INT32 slider_overclock(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1710 | 1712 | { |
| 1711 | 1713 | if (buffer != NULL) |
| 1712 | 1714 | { |
| 1713 | cpunum_set_clockscale(arg, (float)newval * 0.001f); | |
| 1715 | cpunum_set_clockscale(machine, arg, (float)newval * 0.001f); | |
| 1714 | 1716 | sprintf(buffer, "Overclock CPU %d %3.0f%%", arg, floor(cpunum_get_clockscale(arg) * 100.0f + 0.5f)); |
| 1715 | 1717 | } |
| 1716 | 1718 | return floor(cpunum_get_clockscale(arg) * 1000.0f + 0.5f); |
| r1591 | r1592 | |
| 1721 | 1723 | slider_refresh - refresh rate slider callback |
| 1722 | 1724 | -------------------------------------------------*/ |
| 1723 | 1725 | |
| 1724 | static INT32 slider_refresh(INT32 newval, char *buffer, int arg) | |
| 1726 | static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1725 | 1727 | { |
| 1726 | 1728 | double defrefresh = ATTOSECONDS_TO_HZ(Machine->drv->screen[arg].defstate.refresh); |
| 1727 | 1729 | double refresh; |
| r1591 | r1592 | |
| 1730 | 1732 | { |
| 1731 | 1733 | screen_state *state = &Machine->screen[arg]; |
| 1732 | 1734 | video_screen_configure(arg, state->width, state->height, &state->visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001)); |
| 1733 | sprintf(buffer, " | |
| 1735 | sprintf(buffer, " | |
| 1734 | 1736 | } |
| 1735 | 1737 | refresh = ATTOSECONDS_TO_HZ(Machine->screen[arg].refresh); |
| 1736 | 1738 | return floor((refresh - defrefresh) * 1000.0f + 0.5f); |
| r1591 | r1592 | |
| 1742 | 1744 | callback |
| 1743 | 1745 | -------------------------------------------------*/ |
| 1744 | 1746 | |
| 1745 | static INT32 slider_brightness(INT32 newval, char *buffer, int arg) | |
| 1747 | static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1746 | 1748 | { |
| 1747 | 1749 | render_container *container = render_container_get_screen(arg); |
| 1748 | 1750 | if (buffer != NULL) |
| 1749 | 1751 | { |
| 1750 | 1752 | render_container_set_brightness(container, (float)newval * 0.001f); |
| 1751 | sprintf(buffer, " | |
| 1753 | sprintf(buffer, " | |
| 1752 | 1754 | } |
| 1753 | 1755 | return floor(render_container_get_brightness(container) * 1000.0f + 0.5f); |
| 1754 | 1756 | } |
| r1591 | r1592 | |
| 1759 | 1761 | callback |
| 1760 | 1762 | -------------------------------------------------*/ |
| 1761 | 1763 | |
| 1762 | static INT32 slider_contrast(INT32 newval, char *buffer, int arg) | |
| 1764 | static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1763 | 1765 | { |
| 1764 | 1766 | render_container *container = render_container_get_screen(arg); |
| 1765 | 1767 | if (buffer != NULL) |
| 1766 | 1768 | { |
| 1767 | 1769 | render_container_set_contrast(container, (float)newval * 0.001f); |
| 1768 | sprintf(buffer, " | |
| 1770 | sprintf(buffer, " | |
| 1769 | 1771 | } |
| 1770 | 1772 | return floor(render_container_get_contrast(container) * 1000.0f + 0.5f); |
| 1771 | 1773 | } |
| r1591 | r1592 | |
| 1775 | 1777 | slider_gamma - screen gamma slider callback |
| 1776 | 1778 | -------------------------------------------------*/ |
| 1777 | 1779 | |
| 1778 | static INT32 slider_gamma(INT32 newval, char *buffer, int arg) | |
| 1780 | static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1779 | 1781 | { |
| 1780 | 1782 | render_container *container = render_container_get_screen(arg); |
| 1781 | 1783 | if (buffer != NULL) |
| 1782 | 1784 | { |
| 1783 | 1785 | render_container_set_gamma(container, (float)newval * 0.001f); |
| 1784 | sprintf(buffer, " | |
| 1786 | sprintf(buffer, " | |
| 1785 | 1787 | } |
| 1786 | 1788 | return floor(render_container_get_gamma(container) * 1000.0f + 0.5f); |
| 1787 | 1789 | } |
| r1591 | r1592 | |
| 1792 | 1794 | callback |
| 1793 | 1795 | -------------------------------------------------*/ |
| 1794 | 1796 | |
| 1795 | static INT32 slider_xscale(INT32 newval, char *buffer, int arg) | |
| 1797 | static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1796 | 1798 | { |
| 1797 | 1799 | render_container *container = render_container_get_screen(arg); |
| 1798 | 1800 | if (buffer != NULL) |
| 1799 | 1801 | { |
| 1800 | 1802 | render_container_set_xscale(container, (float)newval * 0.001f); |
| 1801 | sprintf(buffer, " | |
| 1803 | sprintf(buffer, " | |
| 1802 | 1804 | } |
| 1803 | 1805 | return floor(render_container_get_xscale(container) * 1000.0f + 0.5f); |
| 1804 | 1806 | } |
| r1591 | r1592 | |
| 1809 | 1811 | callback |
| 1810 | 1812 | -------------------------------------------------*/ |
| 1811 | 1813 | |
| 1812 | static INT32 slider_yscale(INT32 newval, char *buffer, int arg) | |
| 1814 | static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1813 | 1815 | { |
| 1814 | 1816 | render_container *container = render_container_get_screen(arg); |
| 1815 | 1817 | if (buffer != NULL) |
| 1816 | 1818 | { |
| 1817 | 1819 | render_container_set_yscale(container, (float)newval * 0.001f); |
| 1818 | sprintf(buffer, " | |
| 1820 | sprintf(buffer, " | |
| 1819 | 1821 | } |
| 1820 | 1822 | return floor(render_container_get_yscale(container) * 1000.0f + 0.5f); |
| 1821 | 1823 | } |
| r1591 | r1592 | |
| 1826 | 1828 | slider callback |
| 1827 | 1829 | -------------------------------------------------*/ |
| 1828 | 1830 | |
| 1829 | static INT32 slider_xoffset(INT32 newval, char *buffer, int arg) | |
| 1831 | static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1830 | 1832 | { |
| 1831 | 1833 | render_container *container = render_container_get_screen(arg); |
| 1832 | 1834 | if (buffer != NULL) |
| 1833 | 1835 | { |
| 1834 | 1836 | render_container_set_xoffset(container, (float)newval * 0.001f); |
| 1835 | sprintf(buffer, " | |
| 1837 | sprintf(buffer, " | |
| 1836 | 1838 | } |
| 1837 | 1839 | return floor(render_container_get_xoffset(container) * 1000.0f + 0.5f); |
| 1838 | 1840 | } |
| r1591 | r1592 | |
| 1843 | 1845 | slider callback |
| 1844 | 1846 | -------------------------------------------------*/ |
| 1845 | 1847 | |
| 1846 | static INT32 slider_yoffset(INT32 newval, char *buffer, int arg) | |
| 1848 | static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1847 | 1849 | { |
| 1848 | 1850 | render_container *container = render_container_get_screen(arg); |
| 1849 | 1851 | if (buffer != NULL) |
| 1850 | 1852 | { |
| 1851 | 1853 | render_container_set_yoffset(container, (float)newval * 0.001f); |
| 1852 | sprintf(buffer, " | |
| 1854 | sprintf(buffer, " | |
| 1853 | 1855 | } |
| 1854 | 1856 | return floor(render_container_get_yoffset(container) * 1000.0f + 0.5f); |
| 1855 | 1857 | } |
| r1591 | r1592 | |
| 1860 | 1862 | callback |
| 1861 | 1863 | -------------------------------------------------*/ |
| 1862 | 1864 | |
| 1863 | static INT32 slider_flicker(INT32 newval, char *buffer, int arg) | |
| 1865 | static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1864 | 1866 | { |
| 1865 | 1867 | if (buffer != NULL) |
| 1866 | 1868 | { |
| r1591 | r1592 | |
| 1876 | 1878 | callback |
| 1877 | 1879 | -------------------------------------------------*/ |
| 1878 | 1880 | |
| 1879 | static INT32 slider_beam(INT32 newval, char *buffer, int arg) | |
| 1881 | static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1880 | 1882 | { |
| 1881 | 1883 | if (buffer != NULL) |
| 1882 | 1884 | { |
| r1591 | r1592 | |
| 1888 | 1890 | |
| 1889 | 1891 | |
| 1890 | 1892 | /*------------------------------------------------- |
| 1893 | slider_get_screen_desc - returns the | |
| 1894 | description for a given screen index | |
| 1895 | -------------------------------------------------*/ | |
| 1896 | ||
| 1897 | static char *slider_get_screen_desc(int arg) | |
| 1898 | { | |
| 1899 | static char descbuf[256]; | |
| 1900 | int item; | |
| 1901 | int screen_count = 0; | |
| 1902 | ||
| 1903 | for (item = 0; item < MAX_SCREENS; item++) | |
| 1904 | if (Machine->drv->screen[item].tag != NULL) | |
| 1905 | screen_count++; | |
| 1906 | ||
| 1907 | if (screen_count > 1) | |
| 1908 | sprintf(descbuf, "Screen #%d", arg); | |
| 1909 | else | |
| 1910 | strcpy(descbuf, "Screen"); | |
| 1911 | ||
| 1912 | return descbuf; | |
| 1913 | } | |
| 1914 | ||
| 1915 | ||
| 1916 | /*------------------------------------------------- | |
| 1891 | 1917 | slider_crossscale - crosshair scale slider |
| 1892 | 1918 | callback |
| 1893 | 1919 | -------------------------------------------------*/ |
| 1894 | 1920 | |
| 1895 | 1921 | #ifdef MAME_DEBUG |
| 1896 | static INT32 slider_crossscale(INT32 newval, char *buffer, int arg) | |
| 1922 | static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1897 | 1923 | { |
| 1898 | 1924 | input_port_entry *in; |
| 1899 | 1925 | |
| r1591 | r1592 | |
| 1921 | 1947 | -------------------------------------------------*/ |
| 1922 | 1948 | |
| 1923 | 1949 | #ifdef MAME_DEBUG |
| 1924 | static INT32 slider_crossoffset(INT32 newval, char *buffer, int arg) | |
| 1950 | static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, int arg) | |
| 1925 | 1951 | { |
| 1926 | 1952 | input_port_entry *in; |
| 1927 | 1953 |
| r1591 | r1592 | |
|---|---|---|
| 86 | 86 | int ui_init(running_machine *machine); |
| 87 | 87 | |
| 88 | 88 | /* display the startup screens */ |
| 89 | int ui_display_startup_screens(int first_time, int show_disclaimer); | |
| 89 | int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer); | |
| 90 | 90 | |
| 91 | 91 | /* set the current text to display at startup */ |
| 92 | void ui_set_startup_text(const char *text, int force); | |
| 92 | void ui_set_startup_text(running_machine *machine, const char *text, int force); | |
| 93 | 93 | |
| 94 | 94 | /* once-per-frame update and render */ |
| 95 | void ui_update_and_render( | |
| 95 | void ui_update_and_render(running_machine *machine); | |
| 96 | 96 | |
| 97 | 97 | /* returns the current UI font */ |
| 98 | 98 | render_font *ui_get_font(void); |
| r1591 | r1592 | |
|---|---|---|
| 50 | 50 | struct _sndintrf_data |
| 51 | 51 | { |
| 52 | 52 | sound_interface intf; /* copy of the interface data */ |
| 53 | sound_type sndtype; /* type index of this sound chip */ | |
| 54 | sound_type aliastype; /* aliased type index of this sound chip */ | |
| 53 | sound_type sndtype; /* type index of this sound chip */ | |
| 54 | sound_type aliastype; /* aliased type index of this sound chip */ | |
| 55 | 55 | int index; /* index of this sound chip */ |
| 56 | 56 | int clock; /* clock for this sound chip */ |
| 57 | 57 | void * token; /* dynamically allocated token data */ |
| r1591 | r1592 | |
| 107 | 107 | void namcona_get_info(void *token, UINT32 state, sndinfo *info); |
| 108 | 108 | void tms36xx_get_info(void *token, UINT32 state, sndinfo *info); |
| 109 | 109 | void tms3615_get_info(void *token, UINT32 state, sndinfo *info); |
| 110 | void tms5100_get_info(void *token, UINT32 state, sndinfo *info); | |
| 110 | 111 | void tms5110_get_info(void *token, UINT32 state, sndinfo *info); |
| 112 | void tms5110a_get_info(void *token, UINT32 state, sndinfo *info); | |
| 113 | void cd2801_get_info(void *token, UINT32 state, sndinfo *info); | |
| 114 | void tmc0281_get_info(void *token, UINT32 state, sndinfo *info); | |
| 115 | void cd2802_get_info(void *token, UINT32 state, sndinfo *info); | |
| 116 | void m58817_get_info(void *token, UINT32 state, sndinfo *info); | |
| 111 | 117 | void tmc0285_get_info(void *token, UINT32 state, sndinfo *info); |
| 112 | 118 | void tms5200_get_info(void *token, UINT32 state, sndinfo *info); |
| 113 | 119 | void tms5220_get_info(void *token, UINT32 state, sndinfo *info); |
| r1591 | r1592 | |
| 118 | 124 | void msm5232_get_info(void *token, UINT32 state, sndinfo *info); |
| 119 | 125 | void upd7759_get_info(void *token, UINT32 state, sndinfo *info); |
| 120 | 126 | void hc55516_get_info(void *token, UINT32 state, sndinfo *info); |
| 127 | void mc3417_get_info(void *token, UINT32 state, sndinfo *info); | |
| 128 | void mc3418_get_info(void *token, UINT32 state, sndinfo *info); | |
| 121 | 129 | void k005289_get_info(void *token, UINT32 state, sndinfo *info); |
| 122 | 130 | void k007232_get_info(void *token, UINT32 state, sndinfo *info); |
| 123 | 131 | void k051649_get_info(void *token, UINT32 state, sndinfo *info); |
| r1591 | r1592 | |
| 177 | 185 | static const struct |
| 178 | 186 | { |
| 179 | 187 | sound_type sndtype; |
| 180 | void (*get_info)(void *token, UINT32 state, sndinfo *info); | |
| 188 | void (*get_info)(void *token, UINT32 state, sndinfo *info); | |
| 181 | 189 | } sndintrf_map[] = |
| 182 | 190 | { |
| 183 | 191 | { SOUND_DUMMY, dummy_sound_get_info }, |
| r1591 | r1592 | |
| 286 | 294 | #if (HAS_TMS3615) |
| 287 | 295 | { SOUND_TMS3615, tms3615_get_info }, |
| 288 | 296 | #endif |
| 297 | #if (HAS_TMS5100) | |
| 298 | { SOUND_TMS5100, tms5100_get_info }, | |
| 299 | #endif | |
| 289 | 300 | #if (HAS_TMS5110) |
| 290 | 301 | { SOUND_TMS5110, tms5110_get_info }, |
| 291 | 302 | #endif |
| 292 | #if (HAS_TMC0285) | |
| 293 | { SOUND_TMC0285, tmc0285_get_info }, | |
| 303 | #if (HAS_TMS5110A) | |
| 304 | { SOUND_TMS5110A, tms5110a_get_info }, | |
| 294 | 305 | #endif |
| 306 | #if (HAS_CD2801) | |
| 307 | { SOUND_CD2801, cd2801_get_info }, | |
| 308 | #endif | |
| 309 | #if (HAS_TMC0281) | |
| 310 | { SOUND_TMC0281, tmc0281_get_info }, | |
| 311 | #endif | |
| 312 | #if (HAS_CD2802) | |
| 313 | { SOUND_CD2802, cd2802_get_info }, | |
| 314 | #endif | |
| 315 | #if (HAS_M58817) | |
| 316 | { SOUND_M58817, m58817_get_info }, | |
| 317 | #endif | |
| 295 | 318 | #if (HAS_TMS5200) |
| 296 | 319 | { SOUND_TMS5200, tms5200_get_info }, |
| 297 | 320 | #endif |
| r1591 | r1592 | |
| 315 | 338 | #endif |
| 316 | 339 | #if (HAS_HC55516) |
| 317 | 340 | { SOUND_HC55516, hc55516_get_info }, |
| 341 | { SOUND_MC3417, mc3417_get_info }, | |
| 342 | { SOUND_MC3418, mc3418_get_info }, | |
| 318 | 343 | #endif |
| 319 | 344 | #if (HAS_K005289) |
| 320 | 345 | { SOUND_K005289, k005289_get_info }, |
| r1591 | r1592 | |
| 648 | 673 | } |
| 649 | 674 | |
| 650 | 675 | |
| 676 | /*------------------------------------------------- | |
| 677 | sndtype_count - count the number of a | |
| 678 | given type | |
| 679 | -------------------------------------------------*/ | |
| 651 | 680 | |
| 681 | int sndtype_count(sound_type sndtype) | |
| 682 | { | |
| 683 | int index; | |
| 684 | int count = 0; | |
| 685 | ||
| 686 | for (index = 0; index < totalsnd; index++) | |
| 687 | if (sound[index].sndtype == sndtype) | |
| 688 | count++; | |
| 689 | ||
| 690 | return count; | |
| 691 | } | |
| 692 | ||
| 693 | ||
| 694 | ||
| 652 | 695 | /*************************************************************************** |
| 653 | 696 | CHIP INTERFACES BY INDEX |
| 654 | 697 | ***************************************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 473 | 473 | char namebuf[256]; |
| 474 | 474 | int index; |
| 475 | 475 | |
| 476 | sndnum_to_sndti(sndnum, &index); | |
| 476 | sound_type sndtype = sndnum_to_sndti(sndnum, &index); | |
| 477 | 477 | |
| 478 | /* built the display name */ | |
| 479 | namebuf[0] = '\0'; | |
| 480 | ||
| 481 | /* speaker name, if more than one speaker */ | |
| 482 | if (totalspeakers > 1) | |
| 483 | sprintf(namebuf, "%sSpeaker '%s': ", namebuf, speaker->speaker->tag); | |
| 484 | ||
| 485 | /* device name */ | |
| 486 | sprintf(namebuf, "%s%s ", namebuf, sndnum_name(sndnum)); | |
| 487 | ||
| 488 | /* device index, if more than one of this type */ | |
| 489 | if (sndtype_count(sndtype) > 1) | |
| 490 | sprintf(namebuf, "%s#%d ", namebuf, index); | |
| 491 | ||
| 492 | /* channel number, if more than channel for this device */ | |
| 493 | if (info->outputs > 1) | |
| 494 | sprintf(namebuf, "%sCh.%d", namebuf, outputnum); | |
| 495 | ||
| 496 | /* remove final space */ | |
| 497 | if (namebuf[strlen(namebuf) - 1] == ' ') | |
| 498 | namebuf[strlen(namebuf) - 1] = '\0'; | |
| 499 | ||
| 478 | 500 | /* fill in the input data on this speaker */ |
| 479 | 501 | speaker->input[speaker->inputs].gain = mroute->gain; |
| 480 | 502 | speaker->input[speaker->inputs].default_gain = mroute->gain; |
| 481 | sprintf(namebuf, "%s:%s #%d.%d", speaker->speaker->tag, sndnum_name(sndnum), index, outputnum); | |
| 482 | 503 | speaker->input[speaker->inputs].name = auto_strdup(namebuf); |
| 483 | 504 | |
| 484 | 505 | /* connect the output to the input */ |
| r1591 | r1592 | |
| 489 | 510 | /* if it's a sound chip, set the input */ |
| 490 | 511 | else |
| 491 | 512 | { |
| 492 | for (outputnum = 0; outputnum < info->outputs; outputnum++) | |
| 493 | if (mroute->output == outputnum || mroute->output == ALL_OUTPUTS) | |
| 494 | stream_set_input(sound->output[0].stream, 0, info->output[outputnum].stream, info->output[outputnum].output, mroute->gain); | |
| 513 | if (mroute->input < 0) | |
| 514 | { | |
| 515 | for (outputnum = 0; outputnum < info->outputs; outputnum++) | |
| 516 | if (mroute->output == outputnum || mroute->output == ALL_OUTPUTS) | |
| 517 | stream_set_input(sound->output[0].stream, 0, info->output[outputnum].stream, info->output[outputnum].output, mroute->gain); | |
| 518 | } | |
| 519 | else | |
| 520 | { | |
| 521 | assert(mroute->output != ALL_OUTPUTS); | |
| 522 | for (outputnum = 0; outputnum < info->outputs; outputnum++) | |
| 523 | if (mroute->output == outputnum) | |
| 524 | stream_set_input(sound->output[0].stream, mroute->input, info->output[outputnum].stream, info->output[outputnum].output, mroute->gain); | |
| 525 | } | |
| 526 | ||
| 495 | 527 | } |
| 496 | 528 | } |
| 497 | 529 | } |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | SOUND_NAMCONA, |
| 73 | 73 | SOUND_TMS36XX, |
| 74 | 74 | SOUND_TMS3615, |
| 75 | SOUND_TMS5100, | |
| 75 | 76 | SOUND_TMS5110, |
| 77 | SOUND_TMS5110A, | |
| 78 | SOUND_CD2801, | |
| 79 | SOUND_TMC0281, | |
| 80 | SOUND_CD2802, | |
| 81 | SOUND_M58817, | |
| 76 | 82 | SOUND_TMC0285, |
| 77 | 83 | SOUND_TMS5200, |
| 78 | 84 | SOUND_TMS5220, |
| r1591 | r1592 | |
| 82 | 88 | SOUND_MSM5232, |
| 83 | 89 | SOUND_UPD7759, |
| 84 | 90 | SOUND_HC55516, |
| 91 | SOUND_MC3417, | |
| 92 | SOUND_MC3418, | |
| 85 | 93 | SOUND_K005289, |
| 86 | 94 | SOUND_K007232, |
| 87 | 95 | SOUND_K051649, |
| r1591 | r1592 | |
| 282 | 290 | int sndti_exists(sound_type sndtype, int sndindex); |
| 283 | 291 | int sndti_to_sndnum(sound_type type, int index); |
| 284 | 292 | sound_type sndnum_to_sndti(int sndnum, int *index); |
| 293 | int sndtype_count(sound_type sndtype); | |
| 285 | 294 | |
| 286 | 295 | |
| 287 | 296 | #endif /* __SNDINTRF_H__ */ |
| r1591 | r1592 | |
|---|---|---|
| 36 | 36 | int output; /* output ID */ |
| 37 | 37 | const char *target; /* tag of the target */ |
| 38 | 38 | float gain; /* gain */ |
| 39 | int input; /* input ID, -1 is default behavior */ | |
| 39 | 40 | }; |
| 40 | 41 | |
| 41 | 42 |
| r1591 | r1592 | |
|---|---|---|
| 19 | 19 | MACROS (must be *before* the includes below) |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | #define DRIVER_INIT(name) void driver_init_##name(running_machine *machine) | |
| 22 | #define DRIVER_INIT(name) void driver_init_##name(running_machine *machine) | |
| 23 | #define DRIVER_INIT_CALL(name) driver_init_##name(machine) | |
| 23 | 24 | |
| 24 | #define NVRAM_HANDLER(name) void nvram_handler_##name(running_machine *machine, mame_file *file, int read_or_write) | |
| 25 | #define NVRAM_HANDLER(name) void nvram_handler_##name(running_machine *machine, mame_file *file, int read_or_write) | |
| 26 | #define NVRAM_HANDLER_CALL(name) nvram_handler_##name(machine, file, read_or_write) | |
| 25 | 27 | |
| 26 | #define MEMCARD_HANDLER(name) void memcard_handler_##name(running_machine *machine, mame_file *file, int action) | |
| 28 | #define MEMCARD_HANDLER(name) void memcard_handler_##name(running_machine *machine, mame_file *file, int action) | |
| 29 | #define MEMCARD_HANDLER_CALL(name) memcard_handler_##name(machine, file, action) | |
| 27 | 30 | |
| 28 | #define MACHINE_START(name) void machine_start_##name(running_machine *machine) | |
| 29 | #define MACHINE_RESET(name) void machine_reset_##name(running_machine *machine) | |
| 31 | #define MACHINE_START(name) void machine_start_##name(running_machine *machine) | |
| 32 | #define MACHINE_START_CALL(name) machine_start_##name(machine) | |
| 30 | 33 | |
| 31 | #define SOUND_START(name) void sound_start_##name(running_machine *machine) | |
| 32 | #define SOUND_RESET(name) void sound_reset_##name(running_machine *machine) | |
| 34 | #define MACHINE_RESET(name) void machine_reset_##name(running_machine *machine) | |
| 35 | #define MACHINE_RESET_CALL(name) machine_reset_##name(machine) | |
| 33 | 36 | |
| 34 | #define VIDEO_START(name) void video_start_##name(running_machine *machine) | |
| 35 | #define VIDEO_RESET(name) void video_reset_##name(running_machine *machine) | |
| 37 | #define SOUND_START(name) void sound_start_##name(running_machine *machine) | |
| 38 | #define SOUND_START_CALL(name) sound_start_##name(machine) | |
| 36 | 39 | |
| 37 | #define PALETTE_INIT(name) void palette_init_##name(running_machine *machine, UINT16 *colortable, const UINT8 *color_prom) | |
| 38 | #define VIDEO_EOF(name) void video_eof_##name(running_machine *machine) | |
| 39 | #define VIDEO_UPDATE(name) UINT32 video_update_##name(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect) | |
| 40 | #define SOUND_RESET(name) void sound_reset_##name(running_machine *machine) | |
| 41 | #define SOUND_RESET_CALL(name) sound_reset_##name(machine) | |
| 40 | 42 | |
| 43 | #define VIDEO_START(name) void video_start_##name(running_machine *machine) | |
| 44 | #define VIDEO_START_CALL(name) video_start_##name(machine) | |
| 45 | ||
| 46 | #define VIDEO_RESET(name) void video_reset_##name(running_machine *machine) | |
| 47 | #define VIDEO_RESET_CALL(name) video_reset_##name(machine) | |
| 48 | ||
| 49 | #define PALETTE_INIT(name) void palette_init_##name(running_machine *machine, UINT16 *colortable, const UINT8 *color_prom) | |
| 50 | #define PALETTE_INIT_CALL(name) palette_init_##name(machine, colortable, color_prom) | |
| 51 | ||
| 52 | #define VIDEO_EOF(name) void video_eof_##name(running_machine *machine) | |
| 53 | #define VIDEO_EOF_CALL(name) video_eof_##name(machine) | |
| 54 | ||
| 55 | #define VIDEO_UPDATE(name) UINT32 video_update_##name(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect) | |
| 56 | #define VIDEO_UPDATE_CALL(name) video_update_##name(machine, screen, bitmap, cliprect) | |
| 57 | ||
| 58 | ||
| 41 | 59 | /* NULL versions */ |
| 42 | #define nvram_handler_NULL NULL | |
| 43 | #define memcard_handler_NULL NULL | |
| 44 | #define machine_start_NULL NULL | |
| 45 | #define machine_reset_NULL NULL | |
| 46 | #define sound_start_NULL NULL | |
| 47 | #define sound_reset_NULL NULL | |
| 48 | #define video_start_NULL NULL | |
| 49 | #define video_reset_NULL NULL | |
| 50 | #define palette_init_NULL NULL | |
| 51 | #define video_eof_NULL NULL | |
| 52 | #define video_update_NULL NULL | |
| 60 | #define nvram_handler_NULL NULL | |
| 61 | #define memcard_handler_NULL NULL | |
| 62 | #define machine_start_NULL NULL | |
| 63 | #define machine_reset_NULL NULL | |
| 64 | #define sound_start_NULL NULL | |
| 65 | #define sound_reset_NULL NULL | |
| 66 | #define video_start_NULL NULL | |
| 67 | #define video_reset_NULL NULL | |
| 68 | #define palette_init_NULL NULL | |
| 69 | #define video_eof_NULL NULL | |
| 70 | #define video_update_NULL NULL | |
| 53 | 71 | |
| 54 | 72 | |
| 55 | 73 | |
| r1591 | r1592 | |
| 436 | 454 | screen->defstate.visarea.max_y = (maxy); \ |
| 437 | 455 | |
| 438 | 456 | #define MDRV_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs) \ |
| 439 | screen->xoffset = (_xoffs); \ | |
| 440 | screen->xscale = (_xscale); \ | |
| 441 | screen->yoffset = (_yoffs); \ | |
| 442 | screen->yscale = (_yscale); \ | |
| 457 | screen->xoffset = (float)(_xoffs); \ | |
| 458 | screen->xscale = (float)(_xscale); \ | |
| 459 | screen->yoffset = (float)(_yoffs); \ | |
| 460 | screen->yscale = (float)(_yscale); \ | |
| 443 | 461 | |
| 444 | 462 | |
| 445 | 463 | /* add/remove speakers */ |
| 446 | 464 | #define MDRV_SPEAKER_ADD(tag, x, y, z) \ |
| 447 | driver_add_speaker(machine, (tag), (x), (y), (z)); | |
| 465 | driver_add_speaker(machine, (tag), (float)(x), (float)(y), (float)(z)); | |
| 448 | 466 | |
| 449 | 467 | #define MDRV_SPEAKER_REMOVE(tag) \ |
| 450 | 468 | driver_remove_speaker(machine, (tag)); \ |
| r1591 | r1592 | |
| 487 | 505 | sound = driver_find_sound(machine, tag); \ |
| 488 | 506 | if (sound) \ |
| 489 | 507 | { \ |
| 490 | sound->type = SOUND_##_type; \ | |
| 508 | sound->type = SOUND_##_type; \ | |
| 491 | 509 | sound->clock = (_clock); \ |
| 492 | 510 | sound->config = NULL; \ |
| 493 | 511 | sound->routes = 0; \ |
| 494 | 512 | } \ |
| 495 | 513 | |
| 496 | #define MDRV_SOUND_ROUTE(_output, _target, _gain) | |
| 514 | #define MDRV_SOUND_ROUTE_EX(_output, _target, _gain, _input) | |
| 497 | 515 | if (sound) \ |
| 498 | 516 | { \ |
| 499 | 517 | sound->route[sound->routes].output = (_output); \ |
| 500 | 518 | sound->route[sound->routes].target = (_target); \ |
| 501 | sound->route[sound->routes].gain = (_gain); \ | |
| 519 | sound->route[sound->routes].gain = (float)(_gain); \ | |
| 520 | sound->route[sound->routes].input = (_input); \ | |
| 502 | 521 | sound->routes++; \ |
| 503 | 522 | } \ |
| 504 | 523 | |
| 524 | #define MDRV_SOUND_ROUTE(_output, _target, _gain) \ | |
| 525 | MDRV_SOUND_ROUTE_EX(_output, _target, _gain, -1) \ | |
| 505 | 526 | |
| 506 | 527 | |
| 507 | 528 | /*************************************************************************** |
| r1591 | r1592 | |
|---|---|---|
| 121 | 121 | { |
| 122 | 122 | input_line_state[cpunum][line] = CLEAR_LINE; |
| 123 | 123 | interrupt_vector[cpunum][line] = |
| 124 | input_line_vector[cpunum][line] = cputype_default_irq_vector( | |
| 124 | input_line_vector[cpunum][line] = cputype_default_irq_vector(machine->drv->cpu[cpunum].type); | |
| 125 | 125 | input_event_index[cpunum][line] = 0; |
| 126 | 126 | } |
| 127 | 127 | } |
| r1591 | r1592 | |
| 250 | 250 | |
| 251 | 251 | /* generate a trigger to unsuspend any CPUs waiting on the interrupt */ |
| 252 | 252 | if (state != CLEAR_LINE) |
| 253 | cpu_triggerint(cpunum); | |
| 253 | cpu_triggerint(machine, cpunum); | |
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
| r1591 | r1592 | |
| 270 | 270 | * |
| 271 | 271 | *************************************/ |
| 272 | 272 | |
| 273 | void cpunum_set_input_line(int cpunum, int line, int state) | |
| 273 | void cpunum_set_input_line(running_machine *machine, int cpunum, int line, int state) | |
| 274 | 274 | { |
| 275 | 275 | int vector = (line >= 0 && line < MAX_INPUT_LINES) ? interrupt_vector[cpunum][line] : 0xff; |
| 276 | cpunum_set_input_line_and_vector(cpunum, line, state, vector); | |
| 276 | cpunum_set_input_line_and_vector(machine, cpunum, line, state, vector); | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | |
| r1591 | r1592 | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| 292 | void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector) | |
| 292 | void cpunum_set_input_line_and_vector(running_machine *machine, int cpunum, int line, int state, int vector) | |
| 293 | 293 | { |
| 294 | 294 | if (line >= 0 && line < MAX_INPUT_LINES) |
| 295 | 295 | { |
| r1591 | r1592 | |
| 302 | 302 | if (event_index >= MAX_INPUT_EVENTS) |
| 303 | 303 | { |
| 304 | 304 | input_event_index[cpunum][line]--; |
| 305 | cpunum_empty_event_queue( | |
| 305 | cpunum_empty_event_queue(machine, NULL, cpunum | (line << 8)); | |
| 306 | 306 | event_index = input_event_index[cpunum][line]++; |
| 307 | 307 | logerror("Exceeded pending input line event queue on CPU %d!\n", cpunum); |
| 308 | 308 | } |
| r1591 | r1592 | |
|---|---|---|
| 41 | 41 | *************************************/ |
| 42 | 42 | |
| 43 | 43 | /* Set the logical state (ASSERT_LINE/CLEAR_LINE) of the an input line on a CPU */ |
| 44 | void cpunum_set_input_line(int cpunum, int line, int state); | |
| 44 | void cpunum_set_input_line(running_machine *machine, int cpunum, int line, int state); | |
| 45 | 45 | |
| 46 | 46 | /* Set the vector to be returned during a CPU's interrupt acknowledge cycle */ |
| 47 | 47 | void cpunum_set_input_line_vector(int cpunum, int irqline, int vector); |
| 48 | 48 | |
| 49 | 49 | /* Set the logical state (ASSERT_LINE/CLEAR_LINE) of the an input line on a CPU and its associated vector */ |
| 50 | void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector); | |
| 50 | void cpunum_set_input_line_and_vector(running_machine *machine, int cpunum, int line, int state, int vector); | |
| 51 | 51 | |
| 52 | 52 | /* Install a driver callback for IRQ acknowledge */ |
| 53 | 53 | void cpunum_set_irq_callback(int cpunum, int (*callback)(int irqline)); |
| r1591 | r1592 | |
|---|---|---|
| 623 | 623 | |
| 624 | 624 | /* configure the groups */ |
| 625 | 625 | if (palette->shadow_group != 0) |
| 626 | palette_group_set_contrast(machine->palette, palette->shadow_group, PALETTE_DEFAULT_SHADOW_FACTOR); | |
| 626 | palette_group_set_contrast(machine->palette, palette->shadow_group, (float)PALETTE_DEFAULT_SHADOW_FACTOR); | |
| 627 | 627 | if (palette->hilight_group != 0) |
| 628 | palette_group_set_contrast(machine->palette, palette->hilight_group, PALETTE_DEFAULT_HIGHLIGHT_FACTOR); | |
| 628 | palette_group_set_contrast(machine->palette, palette->hilight_group, (float)PALETTE_DEFAULT_HIGHLIGHT_FACTOR); | |
| 629 | 629 | |
| 630 | 630 | /* set the initial colors to a standard rainbow */ |
| 631 | 631 | for (index = 0; index < machine->drv->total_colors; index++) |
| r1591 | r1592 | |
| 726 | 726 | { |
| 727 | 727 | palette->shadow_table[0].base = table; |
| 728 | 728 | palette->shadow_table[2].base = table + 32768; |
| 729 | configure_rgb_shadows(machine, 0, PALETTE_DEFAULT_SHADOW_FACTOR); | |
| 729 | configure_rgb_shadows(machine, 0, (float)PALETTE_DEFAULT_SHADOW_FACTOR); | |
| 730 | 730 | } |
| 731 | 731 | } |
| 732 | 732 | |
| r1591 | r1592 | |
| 749 | 749 | { |
| 750 | 750 | palette->shadow_table[1].base = table; |
| 751 | 751 | palette->shadow_table[3].base = table + 32768; |
| 752 | configure_rgb_shadows(machine, 1, PALETTE_DEFAULT_HIGHLIGHT_FACTOR); | |
| 752 | configure_rgb_shadows(machine, 1, (float)PALETTE_DEFAULT_HIGHLIGHT_FACTOR); | |
| 753 | 753 | } |
| 754 | 754 | } |
| 755 | 755 |
| r1591 | r1592 | |
|---|---|---|
| 780 | 780 | static INT32 UserSelectValueMenu(int selection, CheatEntry * entry); |
| 781 | 781 | |
| 782 | 782 | /********** CHEAT MENU **********/ |
| 783 | static int EnableDisableCheatMenu(int selection, int firstTime); | |
| 784 | static int AddEditCheatMenu(int selection); | |
| 785 | static int EditCheatMenu(CheatEntry * entry, int index, int selection); | |
| 783 | static int EnableDisableCheatMenu(running_machine *machine, int selection, int firstTime); | |
| 784 | static int AddEditCheatMenu(running_machine *machine, int selection); | |
| 785 | static int EditCheatMenu(running_machine *machine, CheatEntry * entry, int index, int selection); | |
| 786 | 786 | |
| 787 | static int DoSearchMenuMinimum(int selection); // minimum mode | |
| 788 | static int DoSearchMenuClassic(int selection); // classic mode | |
| 789 | static int DoSearchMenu(int selection); // advanced mode | |
| 790 | static int SelectSearchRegions(int selection, SearchInfo * search); | |
| 787 | static int DoSearchMenuMinimum(running_machine *machine, int selection); // minimum mode | |
| 788 | static int DoSearchMenuClassic(running_machine *machine, int selection); // classic mode | |
| 789 | static int DoSearchMenu(running_machine *machine, int selection); // advanced mode | |
| 790 | static int SelectSearchRegions(running_machine *machine, int selection, SearchInfo * search); | |
| 791 | 791 | static int ViewSearchResults(int selection, int firstTime); |
| 792 | 792 | |
| 793 | static int ChooseWatch(int selection); | |
| 794 | static int EditWatch(WatchInfo * entry, int selection); | |
| 793 | static int ChooseWatch(running_machine *machine, int selection); | |
| 794 | static int EditWatch(running_machine *machine, WatchInfo * entry, int selection); | |
| 795 | 795 | |
| 796 | static int SelectOptions(int selection); | |
| 797 | static int SelectSearch(int selection); | |
| 796 | static int SelectOptions(running_machine *machine, int selection); | |
| 797 | static int SelectSearch(running_machine *machine, int selection); | |
| 798 | 798 | |
| 799 | 799 | /********** ENTRY LIST **********/ |
| 800 | 800 | static void ResizeCheatList(UINT32 newLength); |
| r1591 | r1592 | |
| 849 | 849 | static void RestoreRegionBackup(SearchRegion * region); |
| 850 | 850 | static void SetSearchRegionDefaultName(SearchRegion * region); |
| 851 | 851 | static void AllocateSearchRegions(SearchInfo * info); |
| 852 | static void BuildSearchRegions(SearchInfo * info); | |
| 852 | static void BuildSearchRegions(running_machine *machine, SearchInfo * info); | |
| 853 | 853 | |
| 854 | 854 | /********** CODE LOADER **********/ |
| 855 | 855 | static int ConvertOldCode(int code, int cpu, int * data, int * extendData); |
| 856 | static void HandleLocalCommandCheat(UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description); | |
| 856 | static void HandleLocalCommandCheat(running_machine *machine, UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description); | |
| 857 | 857 | |
| 858 | static void LoadCheatFile(char * fileName); | |
| 859 | static void LoadCheatDatabase(void); | |
| 858 | static void LoadCheatFile(running_machine *machine, char * fileName); | |
| 859 | static void LoadCheatDatabase(running_machine *machine); | |
| 860 | 860 | |
| 861 | 861 | static void DisposeCheatDatabase(void); |
| 862 | static void ReloadCheatDatabase( | |
| 862 | static void ReloadCheatDatabase(running_machine *machine); | |
| 863 | 863 | |
| 864 | static void SaveCheat(CheatEntry * entry, int selection, int saveCode); | |
| 865 | static void DoAutoSaveCheats(void); | |
| 864 | static void SaveCheat(running_machine *machine, CheatEntry * entry, int selection, int saveCode); | |
| 865 | static void DoAutoSaveCheats(running_machine *machine); | |
| 866 | 866 | |
| 867 | 867 | /********** CODE ADDITION **********/ |
| 868 | 868 | static void AddCheatFromResult(SearchInfo * search, SearchRegion * region, UINT32 address); |
| r1591 | r1592 | |
| 920 | 920 | static void TempDeactivateCheat(CheatEntry * entry); |
| 921 | 921 | |
| 922 | 922 | static void cheat_periodicOperation(CheatAction * action); |
| 923 | static void cheat_periodicAction(CheatAction * action); | |
| 924 | static void cheat_periodicEntry(CheatEntry * entry); | |
| 923 | static void cheat_periodicAction(running_machine *machine, CheatAction * action); | |
| 924 | static void cheat_periodicEntry(running_machine *machine, CheatEntry * entry); | |
| 925 | 925 | |
| 926 | 926 | static void UpdateAllCheatInfo(void); |
| 927 | 927 | static void UpdateCheatInfo(CheatEntry * entry, UINT8 isLoadTime); |
| 928 | 928 | |
| 929 | 929 | static int IsAddressInRange(CheatAction * action, UINT32 length); |
| 930 | 930 | |
| 931 | static void BuildCPUInfoList( | |
| 931 | static void BuildCPUInfoList(running_machine *machine); | |
| 932 | 932 | |
| 933 | 933 | /*-------------------------------------------------------------- |
| 934 | 934 | special key handler - check pressing shift, ctrl or alt key |
| r1591 | r1592 | |
| 1484 | 1484 | fullMenuPageHeight = floor(1.0f / ui_get_line_height()) - 1; |
| 1485 | 1485 | |
| 1486 | 1486 | /* ----- initialize CPU info for cheat system ----- */ |
| 1487 | BuildCPUInfoList(); | |
| 1487 | BuildCPUInfoList(machine); | |
| 1488 | 1488 | |
| 1489 | 1489 | /* ----- load cheat database ----- */ |
| 1490 | LoadCheatDatabase(); | |
| 1490 | LoadCheatDatabase(machine); | |
| 1491 | 1491 | |
| 1492 | 1492 | ResizeSearchList(1); |
| 1493 | 1493 | ResizeWatchList(20); |
| 1494 | 1494 | |
| 1495 | 1495 | /* ----- initialize search regions ----- */ |
| 1496 | BuildSearchRegions(GetCurrentSearch()); | |
| 1496 | BuildSearchRegions(machine, GetCurrentSearch()); | |
| 1497 | 1497 | AllocateSearchRegions(GetCurrentSearch()); |
| 1498 | 1498 | |
| 1499 | 1499 | /* ----- initialize string table ----- */ |
| 1500 | 1500 | InitStringTable(); |
| 1501 | 1501 | |
| 1502 | 1502 | periodic_timer = timer_alloc(cheat_periodic, NULL); |
| 1503 | timer_adjust(periodic_timer, attotime_make(0, | |
| 1503 | timer_adjust(periodic_timer, attotime_make(0, machine->screen[0].refresh), 0, attotime_make(0, machine->screen[0].refresh)); | |
| 1504 | 1504 | |
| 1505 | 1505 | add_exit_callback(machine, cheat_exit); |
| 1506 | 1506 | } |
| r1591 | r1592 | |
| 1515 | 1515 | |
| 1516 | 1516 | /* ----- save all cheats automatically if needed ----- */ |
| 1517 | 1517 | if(TEST_FIELD(cheatOptions, AutoSaveEnabled)) |
| 1518 | DoAutoSaveCheats(); | |
| 1518 | DoAutoSaveCheats(machine); | |
| 1519 | 1519 | |
| 1520 | 1520 | /* ----- free database ----- */ |
| 1521 | 1521 | DisposeCheatDatabase(); |
| r1591 | r1592 | |
| 1570 | 1570 | cheat_menu - management for the cheat general menu |
| 1571 | 1571 | -----------------------------------------------------*/ |
| 1572 | 1572 | |
| 1573 | int cheat_menu(int selection) | |
| 1573 | int cheat_menu(running_machine *machine, int selection) | |
| 1574 | 1574 | { |
| 1575 | 1575 | enum |
| 1576 | 1576 | { |
| r1591 | r1592 | |
| 1607 | 1607 | switch(sel) |
| 1608 | 1608 | { |
| 1609 | 1609 | case kMenu_EnableDisable: |
| 1610 | submenu_choice = EnableDisableCheatMenu(submenu_choice, firstEntry); | |
| 1610 | submenu_choice = EnableDisableCheatMenu(machine, submenu_choice, firstEntry); | |
| 1611 | 1611 | break; |
| 1612 | 1612 | |
| 1613 | 1613 | case kMenu_AddEdit: |
| 1614 | submenu_choice = AddEditCheatMenu(submenu_choice); | |
| 1614 | submenu_choice = AddEditCheatMenu(machine, submenu_choice); | |
| 1615 | 1615 | break; |
| 1616 | 1616 | |
| 1617 | 1617 | case kMenu_Search: |
| 1618 | 1618 | switch(EXTRACT_FIELD(cheatOptions, SearchBox)) |
| 1619 | 1619 | { |
| 1620 | 1620 | case kSearchBox_Minimum: |
| 1621 | submenu_choice = DoSearchMenuMinimum(submenu_choice); | |
| 1621 | submenu_choice = DoSearchMenuMinimum(machine, submenu_choice); | |
| 1622 | 1622 | break; |
| 1623 | 1623 | |
| 1624 | 1624 | case kSearchBox_Classic: |
| 1625 | submenu_choice = DoSearchMenuClassic(submenu_choice); | |
| 1625 | submenu_choice = DoSearchMenuClassic(machine, submenu_choice); | |
| 1626 | 1626 | break; |
| 1627 | 1627 | |
| 1628 | 1628 | case kSearchBox_Advanced: |
| 1629 | submenu_choice = DoSearchMenu(submenu_choice); | |
| 1629 | submenu_choice = DoSearchMenu(machine, submenu_choice); | |
| 1630 | 1630 | break; |
| 1631 | 1631 | } |
| 1632 | 1632 | break; |
| 1633 | 1633 | |
| 1634 | 1634 | case kMenu_ChooseWatch: |
| 1635 | submenu_choice = ChooseWatch(submenu_choice); | |
| 1635 | submenu_choice = ChooseWatch(machine, submenu_choice); | |
| 1636 | 1636 | break; |
| 1637 | 1637 | |
| 1638 | 1638 | case kMenu_Options: |
| 1639 | submenu_choice = SelectOptions(submenu_choice); | |
| 1639 | submenu_choice = SelectOptions(machine, submenu_choice); | |
| 1640 | 1640 | break; |
| 1641 | 1641 | } |
| 1642 | 1642 | |
| r1591 | r1592 | |
| 1740 | 1740 | break; |
| 1741 | 1741 | |
| 1742 | 1742 | case kMenu_ReloadDatabase: |
| 1743 | ReloadCheatDatabase(); | |
| 1743 | ReloadCheatDatabase(machine); | |
| 1744 | 1744 | break; |
| 1745 | 1745 | |
| 1746 | 1746 | default: |
| r1591 | r1592 | |
| 1751 | 1751 | } |
| 1752 | 1752 | |
| 1753 | 1753 | if(input_ui_pressed(IPT_UI_RELOAD_CHEAT)) |
| 1754 | ReloadCheatDatabase(); | |
| 1754 | ReloadCheatDatabase(machine); | |
| 1755 | 1755 | |
| 1756 | 1756 | if(input_ui_pressed(IPT_UI_CANCEL)) |
| 1757 | 1757 | { |
| r1591 | r1592 | |
| 2194 | 2194 | EnableDisableCheatMenu - management for Enable/Disable menu |
| 2195 | 2195 | --------------------------------------------------------------*/ |
| 2196 | 2196 | |
| 2197 | static int EnableDisableCheatMenu(int selection, int firstTime) | |
| 2197 | static int EnableDisableCheatMenu(running_machine *machine, int selection, int firstTime) | |
| 2198 | 2198 | { |
| 2199 | 2199 | INT32 sel; |
| 2200 | 2200 | static INT32 submenu_choice = 0; |
| r1591 | r1592 | |
| 2229 | 2229 | break; |
| 2230 | 2230 | |
| 2231 | 2231 | case 3: |
| 2232 | submenu_choice = EditCheatMenu(&cheatList[sel], sel, submenu_choice); | |
| 2232 | submenu_choice = EditCheatMenu(machine, &cheatList[sel], sel, submenu_choice); | |
| 2233 | 2233 | break; |
| 2234 | 2234 | |
| 2235 | 2235 | default: |
| r1591 | r1592 | |
| 2582 | 2582 | if(input_ui_pressed(IPT_UI_SAVE_CHEAT)) // shift + save = save all codes |
| 2583 | 2583 | { |
| 2584 | 2584 | for(i = 0; i < cheatListLength; i++) |
| 2585 | SaveCheat(&cheatList[i], 0, 0); | |
| 2585 | SaveCheat(machine, &cheatList[i], 0, 0); | |
| 2586 | 2586 | |
| 2587 | 2587 | ui_popup_time(1, "%d cheats saved", cheatListLength); |
| 2588 | 2588 | } |
| r1591 | r1592 | |
| 2601 | 2601 | { |
| 2602 | 2602 | if((entry->flags & kCheatFlag_HasActivationKey1) || (entry->flags & kCheatFlag_HasActivationKey2)) |
| 2603 | 2603 | { |
| 2604 | SaveCheat(entry, sel, 1); | |
| 2604 | SaveCheat(machine, entry, sel, 1); | |
| 2605 | 2605 | |
| 2606 | 2606 | ui_popup_time(1, "activation key saved"); |
| 2607 | 2607 | } |
| r1591 | r1592 | |
| 2612 | 2612 | else |
| 2613 | 2613 | { |
| 2614 | 2614 | if(input_ui_pressed(IPT_UI_SAVE_CHEAT)) |
| 2615 | SaveCheat(entry, 0, 0); | |
| 2615 | SaveCheat(machine, entry, 0, 0); | |
| 2616 | 2616 | } |
| 2617 | 2617 | } |
| 2618 | 2618 | |
| r1591 | r1592 | |
| 2623 | 2623 | } |
| 2624 | 2624 | |
| 2625 | 2625 | if(input_ui_pressed(IPT_UI_RELOAD_CHEAT)) |
| 2626 | ReloadCheatDatabase(); | |
| 2626 | ReloadCheatDatabase(machine); | |
| 2627 | 2627 | |
| 2628 | 2628 | if(UIPressedRepeatThrottle(IPT_UI_ZOOM_IN, kVerticalKeyRepeatRate)) |
| 2629 | 2629 | /* ----- quick menu switch : enable/disable -> add/edit ----- */ |
| r1591 | r1592 | |
| 2643 | 2643 | AddEditCheatMenu - management for Add/Edit cheat menu |
| 2644 | 2644 | --------------------------------------------------------*/ |
| 2645 | 2645 | |
| 2646 | static int AddEditCheatMenu(int selection) | |
| 2646 | static int AddEditCheatMenu(running_machine *machine, int selection) | |
| 2647 | 2647 | { |
| 2648 | 2648 | INT32 sel; |
| 2649 | 2649 | static INT32 submenuChoice = 0; |
| r1591 | r1592 | |
| 2662 | 2662 | /********** SUB MENU **********/ |
| 2663 | 2663 | if(submenuChoice) |
| 2664 | 2664 | { |
| 2665 | submenuChoice = EditCheatMenu(&cheatList[submenuCheat], submenuCheat, submenuChoice); | |
| 2665 | submenuChoice = EditCheatMenu(machine, &cheatList[submenuCheat], submenuCheat, submenuChoice); | |
| 2666 | 2666 | |
| 2667 | 2667 | /* ----- meaningless ? because no longer return with sel = -1 (pressed UI_CONFIG in submenu) ----- */ |
| 2668 | 2668 | // if(submenuChoice == -1) |
| r1591 | r1592 | |
| 2741 | 2741 | if(ShiftKeyPressed()) |
| 2742 | 2742 | { |
| 2743 | 2743 | for(i = 0; i < cheatListLength; i++) // shift + save = save all codes |
| 2744 | SaveCheat(&cheatList[i], 0, 0); | |
| 2744 | SaveCheat(machine, &cheatList[i], 0, 0); | |
| 2745 | 2745 | |
| 2746 | 2746 | ui_popup_time(1, "%d cheats saved", cheatListLength); |
| 2747 | 2747 | } |
| r1591 | r1592 | |
| 2751 | 2751 | { |
| 2752 | 2752 | if((entry->flags & kCheatFlag_HasActivationKey1) || (entry->flags & kCheatFlag_HasActivationKey2)) |
| 2753 | 2753 | { |
| 2754 | SaveCheat(entry, sel, 1); | |
| 2754 | SaveCheat(machine, entry, sel, 1); | |
| 2755 | 2755 | |
| 2756 | 2756 | ui_popup_time(1, "activation key saved"); |
| 2757 | 2757 | } |
| r1591 | r1592 | |
| 2759 | 2759 | ui_popup_time(1, "no activation key"); |
| 2760 | 2760 | } |
| 2761 | 2761 | else |
| 2762 | SaveCheat(entry, 0, 0); // save current entry | |
| 2762 | SaveCheat(machine, entry, 0, 0); // save current entry | |
| 2763 | 2763 | } |
| 2764 | 2764 | } |
| 2765 | 2765 | |
| r1591 | r1592 | |
| 2799 | 2799 | } |
| 2800 | 2800 | |
| 2801 | 2801 | if(input_ui_pressed(IPT_UI_RELOAD_CHEAT)) |
| 2802 | ReloadCheatDatabase(); | |
| 2802 | ReloadCheatDatabase(machine); | |
| 2803 | 2803 | |
| 2804 | 2804 | if(UIPressedRepeatThrottle(IPT_UI_ZOOM_IN, kVerticalKeyRepeatRate)) |
| 2805 | 2805 | /* ----- quick menu switch : add/edit -> search ----- */ |
| r1591 | r1592 | |
| 2819 | 2819 | EditCheatMenu - management for edit code menu |
| 2820 | 2820 | ------------------------------------------------*/ |
| 2821 | 2821 | |
| 2822 | static int EditCheatMenu(CheatEntry * entry, int index, int selection) | |
| 2822 | static int EditCheatMenu(running_machine *machine, CheatEntry * entry, int index, int selection) | |
| 2823 | 2823 | { |
| 2824 | 2824 | static const char *const kTypeNames[] = |
| 2825 | 2825 | { |
| r1591 | r1592 | |
| 4464 | 4464 | } |
| 4465 | 4465 | else |
| 4466 | 4466 | { |
| 4467 | int code = input_code_poll_ | |
| 4467 | int code = input_code_poll_ | |
| 4468 | 4468 | |
| 4469 | 4469 | if(code == KEYCODE_ESC) |
| 4470 | 4470 | { |
| r1591 | r1592 | |
| 4624 | 4624 | if(ControlKeyPressed()) |
| 4625 | 4625 | if((entry->flags & kCheatFlag_HasActivationKey1) || (entry->flags & kCheatFlag_HasActivationKey2)) |
| 4626 | 4626 | { |
| 4627 | SaveCheat(entry, index, 1); | |
| 4627 | SaveCheat(machine, entry, index, 1); | |
| 4628 | 4628 | |
| 4629 | 4629 | ui_popup_time(1, "activation key saved"); |
| 4630 | 4630 | } |
| 4631 | 4631 | else |
| 4632 | 4632 | ui_popup_time(1, "no activation key"); |
| 4633 | 4633 | else |
| 4634 | SaveCheat(entry, 0, 0); | |
| 4634 | SaveCheat(machine, entry, 0, 0); | |
| 4635 | 4635 | } |
| 4636 | 4636 | |
| 4637 | 4637 | if(input_ui_pressed(IPT_UI_WATCH_VALUE)) |
| r1591 | r1592 | |
| 4683 | 4683 | DoSearchMenuMinimum - management for minimum search menu |
| 4684 | 4684 | -----------------------------------------------------------*/ |
| 4685 | 4685 | |
| 4686 | static int DoSearchMenuMinimum(int selection) | |
| 4686 | static int DoSearchMenuMinimum(running_machine *machine, int selection) | |
| 4687 | 4687 | { |
| 4688 | 4688 | /* main */ |
| 4689 | 4689 | enum |
| r1591 | r1592 | |
| 4741 | 4741 | switch(sel) |
| 4742 | 4742 | { |
| 4743 | 4743 | case kMenu_CPU: |
| 4744 | submenuChoice = SelectSearchRegions(submenuChoice, GetCurrentSearch()); | |
| 4744 | submenuChoice = SelectSearchRegions(machine, submenuChoice, GetCurrentSearch()); | |
| 4745 | 4745 | break; |
| 4746 | 4746 | |
| 4747 | 4747 | case kMenu_ViewResult: |
| r1591 | r1592 | |
| 4980 | 4980 | { |
| 4981 | 4981 | search->targetIdx--; |
| 4982 | 4982 | |
| 4983 | BuildSearchRegions(search); | |
| 4983 | BuildSearchRegions(machine, search); | |
| 4984 | 4984 | AllocateSearchRegions(search); |
| 4985 | 4985 | |
| 4986 | 4986 | doneSaveMemory = 0; |
| r1591 | r1592 | |
| 5024 | 5024 | { |
| 5025 | 5025 | search->targetIdx++; |
| 5026 | 5026 | |
| 5027 | BuildSearchRegions(search); | |
| 5027 | BuildSearchRegions(machine, search); | |
| 5028 | 5028 | AllocateSearchRegions(search); |
| 5029 | 5029 | |
| 5030 | 5030 | doneSaveMemory = 0; |
| r1591 | r1592 | |
| 5262 | 5262 | DoSearchMenuClassic - management for classic search menu |
| 5263 | 5263 | -----------------------------------------------------------*/ |
| 5264 | 5264 | |
| 5265 | static int DoSearchMenuClassic(int selection) | |
| 5265 | static int DoSearchMenuClassic(running_machine *machine, int selection) | |
| 5266 | 5266 | { |
| 5267 | 5267 | static const char *const energyStrings[] = |
| 5268 | 5268 | { |
| r1591 | r1592 | |
| 5362 | 5362 | switch(sel) |
| 5363 | 5363 | { |
| 5364 | 5364 | case kMenu_CPU: |
| 5365 | submenuChoice = SelectSearchRegions(submenuChoice, GetCurrentSearch()); | |
| 5365 | submenuChoice = SelectSearchRegions(machine, submenuChoice, GetCurrentSearch()); | |
| 5366 | 5366 | break; |
| 5367 | 5367 | |
| 5368 | 5368 | case kMenu_ViewResult: |
| r1591 | r1592 | |
| 5530 | 5530 | { |
| 5531 | 5531 | search->targetIdx--; |
| 5532 | 5532 | |
| 5533 | BuildSearchRegions(search); | |
| 5533 | BuildSearchRegions(machine, search); | |
| 5534 | 5534 | AllocateSearchRegions(search); |
| 5535 | 5535 | |
| 5536 | 5536 | doneSaveMemory = 0; |
| r1591 | r1592 | |
| 5584 | 5584 | { |
| 5585 | 5585 | search->targetIdx++; |
| 5586 | 5586 | |
| 5587 | BuildSearchRegions(search); | |
| 5587 | BuildSearchRegions(machine, search); | |
| 5588 | 5588 | AllocateSearchRegions(search); |
| 5589 | 5589 | |
| 5590 | 5590 | doneSaveMemory = 0; |
| r1591 | r1592 | |
| 5791 | 5791 | DoSearchMenu - management for advanced search menu |
| 5792 | 5792 | -----------------------------------------------------*/ |
| 5793 | 5793 | |
| 5794 | static int DoSearchMenu(int selection) | |
| 5794 | static int DoSearchMenu(running_machine *machine, int selection) | |
| 5795 | 5795 | { |
| 5796 | 5796 | /* menu stirngs */ |
| 5797 | 5797 | static const char *const kOperandNameTable[] = |
| r1591 | r1592 | |
| 5880 | 5880 | switch(sel) |
| 5881 | 5881 | { |
| 5882 | 5882 | case kMenu_CPU: |
| 5883 | submenuChoice = SelectSearchRegions(submenuChoice, GetCurrentSearch()); | |
| 5883 | submenuChoice = SelectSearchRegions(machine, submenuChoice, GetCurrentSearch()); | |
| 5884 | 5884 | break; |
| 5885 | 5885 | |
| 5886 | 5886 | case kMenu_ViewResult: |
| r1591 | r1592 | |
| 6097 | 6097 | { |
| 6098 | 6098 | search->targetIdx--; |
| 6099 | 6099 | |
| 6100 | BuildSearchRegions(search); | |
| 6100 | BuildSearchRegions(machine, search); | |
| 6101 | 6101 | AllocateSearchRegions(search); |
| 6102 | 6102 | |
| 6103 | 6103 | doneMemorySave = 0; |
| r1591 | r1592 | |
| 6157 | 6157 | { |
| 6158 | 6158 | search->targetIdx++; |
| 6159 | 6159 | |
| 6160 | BuildSearchRegions(search); | |
| 6160 | BuildSearchRegions(machine, search); | |
| 6161 | 6161 | AllocateSearchRegions(search); |
| 6162 | 6162 | |
| 6163 | 6163 | doneMemorySave = 0; |
| r1591 | r1592 | |
| 6281 | 6281 | SelectSearchRegions - management for search regions selection menu |
| 6282 | 6282 | ---------------------------------------------------------------------*/ |
| 6283 | 6283 | |
| 6284 | static int SelectSearchRegions(int selection, SearchInfo * search) | |
| 6284 | static int SelectSearchRegions(running_machine *machine, int selection, SearchInfo * search) | |
| 6285 | 6285 | { |
| 6286 | 6286 | static const char *const kSearchSpeedList[] = |
| 6287 | 6287 | { |
| r1591 | r1592 | |
| 6390 | 6390 | else |
| 6391 | 6391 | search->searchSpeed = kSearchSpeed_Max; |
| 6392 | 6392 | |
| 6393 | BuildSearchRegions(search); | |
| 6393 | BuildSearchRegions(machine, search); | |
| 6394 | 6394 | AllocateSearchRegions(search); |
| 6395 | 6395 | } |
| 6396 | 6396 | } |
| r1591 | r1592 | |
| 6411 | 6411 | else |
| 6412 | 6412 | search->searchSpeed = kSearchSpeed_Fast; |
| 6413 | 6413 | |
| 6414 | BuildSearchRegions(search); | |
| 6414 | BuildSearchRegions(machine, search); | |
| 6415 | 6415 | AllocateSearchRegions(search); |
| 6416 | 6416 | } |
| 6417 | 6417 | } |
| r1591 | r1592 | |
| 6817 | 6817 | ChooseWatch - management for watchpoint list menu |
| 6818 | 6818 | ----------------------------------------------------*/ |
| 6819 | 6819 | |
| 6820 | static int ChooseWatch(int selection) | |
| 6820 | static int ChooseWatch(running_machine *machine, int selection) | |
| 6821 | 6821 | { |
| 6822 | 6822 | const char ** menuItem; |
| 6823 | 6823 | char ** buf; |
| r1591 | r1592 | |
| 6840 | 6840 | /********** SUB MENU **********/ |
| 6841 | 6841 | if(submenuChoice) |
| 6842 | 6842 | { |
| 6843 | submenuChoice = EditWatch(&watchList[submenuWatch], submenuChoice); | |
| 6843 | submenuChoice = EditWatch(machine, &watchList[submenuWatch], submenuChoice); | |
| 6844 | 6844 | |
| 6845 | 6845 | /* ----- meaningless ? because no longer return with sel = -1 (pressed UI_CONFIG in submenu) ----- */ |
| 6846 | 6846 | // if(submenuChoice == -1) |
| r1591 | r1592 | |
| 6933 | 6933 | memset(&entry, 0, sizeof(CheatEntry)); |
| 6934 | 6934 | |
| 6935 | 6935 | SetupCheatFromWatchAsWatch(&entry, watch); |
| 6936 | SaveCheat(&entry, 0, 0); | |
| 6936 | SaveCheat(machine, &entry, 0, 0); | |
| 6937 | 6937 | DisposeCheat(&entry); |
| 6938 | 6938 | } |
| 6939 | 6939 | } |
| r1591 | r1592 | |
| 7037 | 7037 | EditWatch - management for watchpoint edit menu |
| 7038 | 7038 | --------------------------------------------------*/ |
| 7039 | 7039 | |
| 7040 | static int EditWatch(WatchInfo * entry, int selection) | |
| 7040 | static int EditWatch(running_machine *machine, WatchInfo * entry, int selection) | |
| 7041 | 7041 | { |
| 7042 | 7042 | enum |
| 7043 | 7043 | { |
| r1591 | r1592 | |
| 7254 | 7254 | break; |
| 7255 | 7255 | |
| 7256 | 7256 | case kMenu_XPosition: |
| 7257 | entry->x -= 0.01; | |
| 7257 | entry->x -= 0.01f; | |
| 7258 | 7258 | break; |
| 7259 | 7259 | |
| 7260 | 7260 | case kMenu_YPosition: |
| 7261 | entry->y -= 0.01; | |
| 7261 | entry->y -= 0.01f; | |
| 7262 | 7262 | break; |
| 7263 | 7263 | |
| 7264 | 7264 | case kMenu_Skip: |
| r1591 | r1592 | |
| 7349 | 7349 | break; |
| 7350 | 7350 | |
| 7351 | 7351 | case kMenu_XPosition: |
| 7352 | entry->x += 0.01; | |
| 7352 | entry->x += 0.01f; | |
| 7353 | 7353 | break; |
| 7354 | 7354 | |
| 7355 | 7355 | case kMenu_YPosition: |
| 7356 | entry->y += 0.01; | |
| 7356 | entry->y += 0.01f; | |
| 7357 | 7357 | break; |
| 7358 | 7358 | |
| 7359 | 7359 | case kMenu_Skip: |
| r1591 | r1592 | |
| 7525 | 7525 | memset(&tempEntry, 0, sizeof(CheatEntry)); |
| 7526 | 7526 | |
| 7527 | 7527 | SetupCheatFromWatchAsWatch(&tempEntry, entry); |
| 7528 | SaveCheat(&tempEntry, 0, 0); | |
| 7528 | SaveCheat(machine, &tempEntry, 0, 0); | |
| 7529 | 7529 | DisposeCheat(&tempEntry); |
| 7530 | 7530 | } |
| 7531 | 7531 | } |
| r1591 | r1592 | |
| 7540 | 7540 | SelectOptions - management for options menu |
| 7541 | 7541 | ----------------------------------------------*/ |
| 7542 | 7542 | |
| 7543 | static int SelectOptions(int selection) | |
| 7543 | static int SelectOptions(running_machine *machine, int selection) | |
| 7544 | 7544 | { |
| 7545 | 7545 | enum |
| 7546 | 7546 | { |
| r1591 | r1592 | |
| 7570 | 7570 | switch(sel) |
| 7571 | 7571 | { |
| 7572 | 7572 | case kMenu_SelectSearch: |
| 7573 | submenuChoice = SelectSearch(submenuChoice); | |
| 7573 | submenuChoice = SelectSearch(machine, submenuChoice); | |
| 7574 | 7574 | break; |
| 7575 | 7575 | |
| 7576 | 7576 | default: |
| r1591 | r1592 | |
| 7737 | 7737 | |
| 7738 | 7738 | if(input_ui_pressed(IPT_UI_SAVE_CHEAT)) |
| 7739 | 7739 | { |
| 7740 | SaveCheat(NULL, 0, 2); | |
| 7740 | SaveCheat(machine, NULL, 0, 2); | |
| 7741 | 7741 | |
| 7742 | 7742 | ui_popup_time(1, "command code saved"); |
| 7743 | 7743 | } |
| 7744 | 7744 | |
| 7745 | 7745 | if(input_ui_pressed(IPT_UI_RELOAD_CHEAT)) |
| 7746 | ReloadCheatDatabase(); | |
| 7746 | ReloadCheatDatabase(machine); | |
| 7747 | 7747 | |
| 7748 | 7748 | if(input_ui_pressed(IPT_UI_CANCEL)) |
| 7749 | 7749 | sel = -1; |
| r1591 | r1592 | |
| 7755 | 7755 | SelectSearch - management for search selection menu |
| 7756 | 7756 | ------------------------------------------------------*/ |
| 7757 | 7757 | |
| 7758 | static int SelectSearch(int selection) | |
| 7758 | static int SelectSearch(running_machine *machine, int selection) | |
| 7759 | 7759 | { |
| 7760 | 7760 | INT32 sel; |
| 7761 | 7761 | const char ** menuItem; |
| r1591 | r1592 | |
| 7844 | 7844 | { |
| 7845 | 7845 | AddSearchBefore(sel); |
| 7846 | 7846 | |
| 7847 | BuildSearchRegions(&searchList[sel]); | |
| 7847 | BuildSearchRegions(machine, &searchList[sel]); | |
| 7848 | 7848 | AllocateSearchRegions(&searchList[sel]); |
| 7849 | 7849 | } |
| 7850 | 7850 | |
| r1591 | r1592 | |
| 7910 | 7910 | return; |
| 7911 | 7911 | |
| 7912 | 7912 | for(i = 0; i < cheatListLength; i++) |
| 7913 | cheat_periodicEntry(&cheatList[i]); | |
| 7913 | cheat_periodicEntry(machine, &cheatList[i]); | |
| 7914 | 7914 | } |
| 7915 | 7915 | |
| 7916 | 7916 | /*-------------- |
| r1591 | r1592 | |
| 8921 | 8921 | DefaultEnableRegion - get default regions you can search |
| 8922 | 8922 | -----------------------------------------------------------*/ |
| 8923 | 8923 | |
| 8924 | static UINT8 DefaultEnableRegion(SearchRegion * region, SearchInfo * info) | |
| 8924 | static UINT8 DefaultEnableRegion(running_machine *machine, SearchRegion * region, SearchInfo * info) | |
| 8925 | 8925 | { |
| 8926 | 8926 | write8_handler handler = region->writeHandler->write.handler8; |
| 8927 | 8927 | FPTR handlerAddress = (FPTR)handler; |
| r1591 | r1592 | |
| 8931 | 8931 | case kSearchSpeed_Fast: |
| 8932 | 8932 | |
| 8933 | 8933 | #if HAS_SH2 |
| 8934 | if( | |
| 8934 | if(machine->drv->cpu[0].type == CPU_SH2) | |
| 8935 | 8935 | { |
| 8936 | 8936 | if( (info->targetType == kRegionType_CPU) && (info->targetIdx == 0) && (region->address == 0x06000000)) |
| 8937 | 8937 | return 1; |
| r1591 | r1592 | |
| 8947 | 8947 | |
| 8948 | 8948 | { |
| 8949 | 8949 | /* ----- for neogeo, search bank one ----- */ |
| 8950 | if( (!strcmp( | |
| 8950 | if( (!strcmp(machine->gamedrv->parent, "neogeo")) && (info->targetType == kRegionType_CPU) && | |
| 8951 | 8951 | (info->targetIdx == 0) && (handler == MWA8_BANK1)) |
| 8952 | 8952 | return 1; |
| 8953 | 8953 | } |
| r1591 | r1592 | |
| 8957 | 8957 | #if HAS_TMS34010 |
| 8958 | 8958 | |
| 8959 | 8959 | /* ----- for exterminator, search bank one ----- */ |
| 8960 | if( ( | |
| 8960 | if( (machine->drv->cpu[1].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) && | |
| 8961 | 8961 | (info->targetIdx == 1) && (handler == MWA8_BANK1)) |
| 8962 | 8962 | return 1; |
| 8963 | 8963 | |
| 8964 | 8964 | /* ----- for smashtv, search bank two ----- */ |
| 8965 | if( ( | |
| 8965 | if( (machine->drv->cpu[0].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) && | |
| 8966 | 8966 | (info->targetIdx == 0) && (handler == MWA8_BANK2)) |
| 8967 | 8967 | return 1; |
| 8968 | 8968 | |
| r1591 | r1592 | |
| 9114 | 9114 | BuildSearchRegions |
| 9115 | 9115 | ---------------------*/ |
| 9116 | 9116 | |
| 9117 | static void BuildSearchRegions(SearchInfo * info) | |
| 9117 | static void BuildSearchRegions(running_machine *machine, SearchInfo * info) | |
| 9118 | 9118 | { |
| 9119 | 9119 | info->comparison = kSearchComparison_EqualTo; |
| 9120 | 9120 | |
| r1591 | r1592 | |
| 9195 | 9195 | traverse->backupLast = NULL; |
| 9196 | 9196 | traverse->backupStatus = NULL; |
| 9197 | 9197 | |
| 9198 | traverse->flags = DefaultEnableRegion(traverse, info) ? kRegionFlag_Enabled : 0; | |
| 9198 | traverse->flags = DefaultEnableRegion(machine, traverse, info) ? kRegionFlag_Enabled : 0; | |
| 9199 | 9199 | |
| 9200 | 9200 | SetSearchRegionDefaultName(traverse); |
| 9201 | 9201 | |
| r1591 | r1592 | |
| 9364 | 9364 | HandleLocalCommandCheat - get special code which is not added into cheat list |
| 9365 | 9365 | --------------------------------------------------------------------------------*/ |
| 9366 | 9366 | |
| 9367 | static void HandleLocalCommandCheat(UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description) | |
| 9367 | static void HandleLocalCommandCheat(running_machine *machine, UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description) | |
| 9368 | 9368 | { |
| 9369 | 9369 | switch(EXTRACT_FIELD(type, LocationType)) |
| 9370 | 9370 | { |
| r1591 | r1592 | |
| 9415 | 9415 | |
| 9416 | 9416 | overclock /= 65536.0; |
| 9417 | 9417 | |
| 9418 | cpunum_set_clockscale(address, overclock); | |
| 9418 | cpunum_set_clockscale(machine, address, overclock); | |
| 9419 | 9419 | } |
| 9420 | 9420 | } |
| 9421 | 9421 | break; |
| r1591 | r1592 | |
| 9423 | 9423 | /* ----- refresh rate ----- */ |
| 9424 | 9424 | case kCustomLocation_RefreshRate: |
| 9425 | 9425 | { |
| 9426 | screen_state *state = & | |
| 9426 | screen_state *state = &machine->screen[0]; | |
| 9427 | 9427 | double refresh = data; |
| 9428 | 9428 | |
| 9429 | 9429 | refresh /= 65536.0; |
| r1591 | r1592 | |
| 9440 | 9440 | LoadCheatFile - load cheat code from database |
| 9441 | 9441 | ------------------------------------------------*/ |
| 9442 | 9442 | |
| 9443 | static void LoadCheatFile(char * fileName) | |
| 9443 | static void LoadCheatFile(running_machine *machine, char * fileName) | |
| 9444 | 9444 | { |
| 9445 | 9445 | mame_file * theFile; |
| 9446 | 9446 | file_error filerr; |
| r1591 | r1592 | |
| 9459 | 9459 | |
| 9460 | 9460 | /* ----- make the format strings ----- */ |
| 9461 | 9461 | #ifdef MESS |
| 9462 | sprintf(formatString, ":%s:%s", Machine->gamedrv->name, "%x:%x:%x:%x:%x:%[^:\n\r]:%[^:\n\r]"); | |
| 9463 | sprintf(oldFormatString, "%s:%s", Machine->gamedrv->name, "%x:%d:%x:%x:%d:%[^:\n\r]:%[^:\n\r]"); | |
| 9462 | sprintf(formatString, ":%s:%s", machine->gamedrv->name, "%x:%x:%x:%x:%x:%[^:\n\r]:%[^:\n\r]"); | |
| 9463 | sprintf(oldFormatString, "%s:%s", machine->gamedrv->name, "%x:%d:%x:%x:%d:%[^:\n\r]:%[^:\n\r]"); | |
| 9464 | 9464 | #else |
| 9465 | sprintf(formatString, ":%s:%s", Machine->gamedrv->name, "%x:%x:%x:%x:%[^:\n\r]:%[^:\n\r]"); | |
| 9466 | sprintf(oldFormatString, "%s:%s", Machine->gamedrv->name, "%d:%x:%x:%d:%[^:\n\r]:%[^:\n\r]"); | |
| 9465 | sprintf(formatString, ":%s:%s", machine->gamedrv->name, "%x:%x:%x:%x:%[^:\n\r]:%[^:\n\r]"); | |
| 9466 | sprintf(oldFormatString, "%s:%s", machine->gamedrv->name, "%d:%x:%x:%d:%[^:\n\r]:%[^:\n\r]"); | |
| 9467 | 9467 | #endif |
| 9468 | 9468 | |
| 9469 | 9469 | /* ----- get a line from database ----- */ |
| r1591 | r1592 | |
| 9552 | 9552 | { |
| 9553 | 9553 | //logerror("cheat: cheat line removed\n", buf); |
| 9554 | 9554 | |
| 9555 | HandleLocalCommandCheat(type, address, data, extendData, name, description); | |
| 9555 | HandleLocalCommandCheat(machine, type, address, data, extendData, name, description); | |
| 9556 | 9556 | } |
| 9557 | 9557 | else |
| 9558 | 9558 | { |
| r1591 | r1592 | |
| 9634 | 9634 | LoadCheatDatabase - get the database name then load it |
| 9635 | 9635 | ---------------------------------------------------------*/ |
| 9636 | 9636 | |
| 9637 | static void LoadCheatDatabase( | |
| 9637 | static void LoadCheatDatabase(running_machine *machine) | |
| 9638 | 9638 | { |
| 9639 | 9639 | char buf[4096]; |
| 9640 | 9640 | const char * inTraverse; |
| r1591 | r1592 | |
| 9671 | 9671 | if(buf[0]) |
| 9672 | 9672 | { |
| 9673 | 9673 | /* ----- load database based on the name we gotten ----- */ |
| 9674 | LoadCheatFile(buf); | |
| 9674 | LoadCheatFile(machine, buf); | |
| 9675 | 9675 | |
| 9676 | 9676 | outTraverse =buf; |
| 9677 | 9677 | buf[0] = 0; |
| r1591 | r1592 | |
| 9722 | 9722 | ReloadCheatDatabase - reload cheat database directly on the cheat menu |
| 9723 | 9723 | -------------------------------------------------------------------------*/ |
| 9724 | 9724 | |
| 9725 | static void ReloadCheatDatabase( | |
| 9725 | static void ReloadCheatDatabase(running_machine *machine) | |
| 9726 | 9726 | { |
| 9727 | 9727 | DisposeCheatDatabase(); |
| 9728 | LoadCheatDatabase(); | |
| 9728 | LoadCheatDatabase(machine); | |
| 9729 | 9729 | |
| 9730 | 9730 | ui_popup_time(1, "Cheat Database reloaded"); |
| 9731 | 9731 | } |
| r1591 | r1592 | |
| 9734 | 9734 | SaveCheat - save a code (normal code, activation key, option) |
| 9735 | 9735 | ---------------------------------------------------------------*/ |
| 9736 | 9736 | |
| 9737 | static void SaveCheat(CheatEntry * entry, int selection, int saveCode) | |
| 9737 | static void SaveCheat(running_machine *machine, CheatEntry * entry, int selection, int saveCode) | |
| 9738 | 9738 | { |
| 9739 | 9739 | enum{ |
| 9740 | 9740 | normalCode = 0, |
| r1591 | r1592 | |
| 9817 | 9817 | break; |
| 9818 | 9818 | } |
| 9819 | 9819 | #ifdef MESS |
| 9820 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.8X:%.*X:%.8X:%.8X", | |
| 9820 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.8X:%.*X:%.8X:%.8X", machine->gamedrv->name, thisGameCRC, type, addressLength, action->address, action->originalDataField, action->extendData); | |
| 9821 | 9821 | #else |
| 9822 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.*X:%.8X:%.8X", | |
| 9822 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.*X:%.8X:%.8X", machine->gamedrv->name, type, addressLength, action->address, action->originalDataField, action->extendData); | |
| 9823 | 9823 | #endif |
| 9824 | 9824 | /* ----- set description and comment ----- */ |
| 9825 | 9825 | if(name) |
| r1591 | r1592 | |
| 9863 | 9863 | addressLength = cpuInfoList[EXTRACT_FIELD(entry->actionList[1].type, LocationParameter)].addressCharsNeeded; |
| 9864 | 9864 | #ifdef MESS |
| 9865 | 9865 | if(!i) |
| 9866 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004000:%.*X:%.8X:00000000", | |
| 9866 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004000:%.*X:%.8X:00000000", machine->gamedrv->name, thisGameCRC, addressLength, selection, entry->activationKey1); | |
| 9867 | 9867 | else |
| 9868 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004001:%.*X:%.8X:00000000", | |
| 9868 | bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004001:%.*X:%.8X:00000000", machine->gamedrv->name, thisGameCRC, addressLength, selection, entry->activationKey2); | |
| 9869 | 9869 | #else |
| 9870 | 9870 | if(!i) |
| 9871 | bufTraverse += sprintf(bufTraverse, ":%s:63004000:%.*X:%.8X:00000000", | |
| 9871 | bufTraverse += sprintf(bufTraverse, ":%s:63004000:%.*X:%.8X:00000000", machine->gamedrv->name, addressLength, selection, entry->activationKey1); | |
| 9872 | 9872 | else |
| 9873 | bufTraverse += sprintf(bufTraverse, ":%s:63004001:%.*X:%.8X:00000000", | |
| 9873 | bufTraverse += sprintf(bufTraverse, ":%s:63004001:%.*X:%.8X:00000000", machine->gamedrv->name, addressLength, selection, entry->activationKey2); | |
| 9874 | 9874 | #endif |
| 9875 | 9875 | /* ----- set description and button index ----- */ |
| 9876 | 9876 | if(!i) |
| r1591 | r1592 | |
| 9922 | 9922 | DoAutoSaveCheat - save normal code automatically when exit cheat system |
| 9923 | 9923 | --------------------------------------------------------------------------*/ |
| 9924 | 9924 | |
| 9925 | static void DoAutoSaveCheats( | |
| 9925 | static void DoAutoSaveCheats(running_machine *machine) | |
| 9926 | 9926 | { |
| 9927 | 9927 | int i; |
| 9928 | 9928 | |
| r1591 | r1592 | |
| 9931 | 9931 | CheatEntry * entry = &cheatList[i]; |
| 9932 | 9932 | |
| 9933 | 9933 | if(entry->flags & kCheatFlag_Dirty) |
| 9934 | SaveCheat(entry, 0, 0); | |
| 9934 | SaveCheat(machine, entry, 0, 0); | |
| 9935 | 9935 | } |
| 9936 | 9936 | } |
| 9937 | 9937 | |
| r1591 | r1592 | |
| 11359 | 11359 | cheat_periodicAction - management for cheat actions |
| 11360 | 11360 | ------------------------------------------------------*/ |
| 11361 | 11361 | |
| 11362 | static void cheat_periodicAction(CheatAction * action) | |
| 11362 | static void cheat_periodicAction(running_machine *machine, CheatAction * action) | |
| 11363 | 11363 | { |
| 11364 | 11364 | UINT8 parameter = EXTRACT_FIELD(action->type, TypeParameter); |
| 11365 | 11365 | |
| r1591 | r1592 | |
| 11400 | 11400 | /* ----- keep if one shot + restore prevous value + delay !=0 ----- */ |
| 11401 | 11401 | cheat_periodicOperation(action); |
| 11402 | 11402 | |
| 11403 | if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ( | |
| 11403 | if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ(machine->screen[0].refresh))) | |
| 11404 | 11404 | { |
| 11405 | 11405 | action->frameTimer = 0; |
| 11406 | 11406 | |
| r1591 | r1592 | |
| 11412 | 11412 | else |
| 11413 | 11413 | { |
| 11414 | 11414 | /* ----- otherwise, delay ----- */ |
| 11415 | if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ( | |
| 11415 | if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ(machine->screen[0].refresh))) | |
| 11416 | 11416 | { |
| 11417 | 11417 | action->frameTimer = 0; |
| 11418 | 11418 | |
| r1591 | r1592 | |
| 11451 | 11451 | |
| 11452 | 11452 | if(currentValue != action->lastValue) |
| 11453 | 11453 | { |
| 11454 | action->frameTimer = parameter * ATTOSECONDS_TO_HZ( | |
| 11454 | action->frameTimer = parameter * ATTOSECONDS_TO_HZ(machine->screen[0].refresh); | |
| 11455 | 11455 | |
| 11456 | 11456 | action->flags |= kActionFlag_WasModified; |
| 11457 | 11457 | } |
| r1591 | r1592 | |
| 11487 | 11487 | cheat_periodicEntry - management for cheat entries |
| 11488 | 11488 | -----------------------------------------------------*/ |
| 11489 | 11489 | |
| 11490 | static void cheat_periodicEntry(CheatEntry * entry) | |
| 11490 | static void cheat_periodicEntry(running_machine *machine, CheatEntry * entry) | |
| 11491 | 11491 | { |
| 11492 | 11492 | int i; |
| 11493 | 11493 | |
| r1591 | r1592 | |
| 11596 | 11596 | |
| 11597 | 11597 | do{ |
| 11598 | 11598 | if(!(entry->flags & kCheatFlag_OneShot) || (entry->flags & kCheatFlag_DoOneShot)) |
| 11599 | cheat_periodicAction(&entry->actionList[i]); | |
| 11599 | cheat_periodicAction(machine, &entry->actionList[i]); | |
| 11600 | 11600 | |
| 11601 | 11601 | i++; |
| 11602 | 11602 | |
| r1591 | r1592 | |
| 11659 | 11659 | |
| 11660 | 11660 | /* ----- update all actions ----- */ |
| 11661 | 11661 | for(i = 0; i < entry->actionListLength; i++) |
| 11662 | cheat_periodicAction(&entry->actionList[i]); | |
| 11662 | cheat_periodicAction(machine, &entry->actionList[i]); | |
| 11663 | 11663 | |
| 11664 | 11664 | /* ----- if all actions are done, deactivate the cheat if oneshot entry ----- */ |
| 11665 | 11665 | { |
| r1591 | r1592 | |
| 11778 | 11778 | BuildCPUInfoList - get CPU info when initialize cheat system |
| 11779 | 11779 | ---------------------------------------------------------------*/ |
| 11780 | 11780 | |
| 11781 | static void BuildCPUInfoList( | |
| 11781 | static void BuildCPUInfoList(running_machine *machine) | |
| 11782 | 11782 | { |
| 11783 | 11783 | int i; |
| 11784 | 11784 | |
| 11785 | 11785 | /* ----- do regions ----- */ |
| 11786 | 11786 | { |
| 11787 | const rom_entry * traverse = rom_first_region( | |
| 11787 | const rom_entry * traverse = rom_first_region(machine->gamedrv); | |
| 11788 | 11788 | |
| 11789 | 11789 | memset(regionInfoList, 0, sizeof(CPUInfo) * kRegionListLength); |
| 11790 | 11790 | |
| r1591 | r1592 | |
| 11846 | 11846 | CPUInfo * info = &cpuInfoList[i]; |
| 11847 | 11847 | CPUInfo * regionInfo = ®ionInfoList[REGION_CPU1 + i - REGION_INVALID]; |
| 11848 | 11848 | |
| 11849 | cpu_type type = | |
| 11849 | cpu_type type = machine->drv->cpu[i].type; | |
| 11850 | 11850 | |
| 11851 | 11851 | info->type = type; |
| 11852 | 11852 | info->dataBits = cputype_databus_width(type, ADDRESS_SPACE_PROGRAM); |
| r1591 | r1592 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | void cheat_init(running_machine *machine); |
| 20 | 20 | |
| 21 | int cheat_menu(int selection); | |
| 21 | int cheat_menu(running_machine *machine, int selection); | |
| 22 | 22 | |
| 23 | 23 | void cheat_display_watches(void); |
| 24 | 24 |
| r1591 | r1592 | |
|---|---|---|
| 51 | 51 | XTAL_4_224MHz = 4224000, /* Used to drive OKI M6295 chips, usually with /4 divider */ |
| 52 | 52 | XTAL_4_433619MHz = 4433619, /* PAL subcarrier */ |
| 53 | 53 | XTAL_4_9152MHz = 4915200, |
| 54 | XTAL_5MHz = 5000000, /* Mutant Night */ | |
| 54 | 55 | XTAL_6MHz = 6000000, |
| 55 | 56 | XTAL_6_144MHz = 6144000, /* Used on Alpha Denshi early 80's games sound board */ |
| 56 | 57 | XTAL_7_3728MHz = 7372800, |
| r1591 | r1592 | |
| 60 | 61 | XTAL_10_595MHz = 10595000, /* Mad Alien */ |
| 61 | 62 | XTAL_11MHz = 11000000, /* Mario I8039 sound */ |
| 62 | 63 | XTAL_11_0592MHz = 11059200, /* Lethal Justice */ |
| 64 | XTAL_11_2MHz = 11200000, /* New York, New York */ | |
| 63 | 65 | XTAL_11_289MHz = 11289000, /* Vanguard */ |
| 64 | 66 | XTAL_12MHz = 12000000, |
| 65 | 67 | XTAL_12_096MHz = 12096000, /* Some early 80's Atari games */ |
| 66 | 68 | XTAL_12_288MHz = 12288000, /* Sega Model 3 digital audio board */ |
| 69 | XTAL_12_5MHz = 12500000, /* Red Alert audio board */ | |
| 67 | 70 | XTAL_13_3MHz = 13300000, /* BMC bowling */ |
| 68 | 71 | XTAL_13_33056MHz = 13330560, /* Taito L */ |
| 69 | 72 | XTAL_13_4MHz = 13400000, /* TNK3, Ikari Warriors h/w */ |
| r1591 | r1592 | |
| 80 | 83 | XTAL_19_968MHz = 19968000, /* Used mostly by Space Invaders games by Taito/Midway and clones */ |
| 81 | 84 | XTAL_20MHz = 20000000, |
| 82 | 85 | XTAL_21_3MHz = 21300000, |
| 83 | XTAL_21_4772MHz = 21477200, /* BMC bowling */ | |
| 86 | XTAL_21_4772MHz = 21477200, /* BMC bowling, some Data East 90's games */ | |
| 84 | 87 | XTAL_22MHz = 22000000, |
| 85 | 88 | XTAL_24MHz = 24000000, /* Mario, 80's Data East games, 80's Konami games */ |
| 86 | 89 | XTAL_24_576MHz = 24576000, /* Pole Position h/w, Model 3 CPU board */ |
| r1591 | r1592 | |
| 125 | 128 | /* Resonators (There are probably more. Almost always used for driving OKI sound chips) */ |
| 126 | 129 | |
| 127 | 130 | XTAL_384kHz = 384000, |
| 128 | XTAL_400kHz = 400000, /* Used on Great Swordman h/w */ | |
| 129 | XTAL_455kHz = 455000, /* Used on Gladiator h/w */ | |
| 130 | XTAL_640kHz = 640000 | |
| 131 | XTAL_400kHz = 400000, /* Used on Great Swordman h/w */ | |
| 132 | XTAL_455kHz = 455000, /* Used on Gladiator h/w */ | |
| 133 | XTAL_640kHz = 640000, | |
| 134 | XTAL_1_056MHz = 1056000 /* used on Trio The Punch */ | |
| 131 | 135 | }; |
| 132 | 136 | |
| 133 | 137 |
| r1591 | r1592 | |
|---|---|---|
| 397 | 397 | else |
| 398 | 398 | sprintf(buffer, "Loading Complete"); |
| 399 | 399 | |
| 400 | ui_set_startup_text(buffer, FALSE); | |
| 400 | ui_set_startup_text(Machine, buffer, FALSE); | |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 |
| r1591 | r1592 | |
|---|---|---|
| 143 | 143 | return NULL; |
| 144 | 144 | memset(pool, 0, sizeof(*pool)); |
| 145 | 145 | |
| 146 | /* set the failure handler */ | |
| 147 | pool->fail = fail; | |
| 148 | ||
| 146 | 149 | /* register the built-in types */ |
| 147 | 150 | pool_type_register(pool, OBJTYPE_MEMORY, "Memory", memory_destruct); |
| 148 | 151 |
| r1591 | r1592 | |
|---|---|---|
| 102 | 102 | r.min_y = r.max_y = video_screen_get_vpos(0); |
| 103 | 103 | fillbitmap(bitmap, machine->pens[1], &r); |
| 104 | 104 | logerror("ULA %3d[%d] NMI, R:$%02X, $%04x\n", video_screen_get_vpos(0), ula_scancode_count, (unsigned) cpunum_get_reg(0, Z80_R), (unsigned) cpunum_get_reg(0, Z80_PC)); |
| 105 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 105 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 106 | 106 | if (++ula_scanline_count == machine->screen[0].height) |
| 107 | 107 | ula_scanline_count = 0; |
| 108 | 108 | } |
| r1591 | r1592 | |
| 121 | 121 | ula_irq_active = 0; |
| 122 | 122 | if (++ula_scancode_count == 8) |
| 123 | 123 | ula_scancode_count = 0; |
| 124 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 124 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 125 | 125 | if (++ula_scanline_count == machine->screen[0].height) |
| 126 | 126 | ula_scanline_count = 0; |
| 127 | 127 | } |
| r1591 | r1592 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | static void ppu_nmi(int num, int *ppu_regs) |
| 21 | 21 | { |
| 22 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 22 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | static void nes_vh_reset(running_machine *machine) |
| r1591 | r1592 | |
|---|---|---|
| 1139 | 1139 | }; |
| 1140 | 1140 | |
| 1141 | 1141 | static TIMER_CALLBACK( gb_video_init_vbl ) { |
| 1142 | cpunum_set_input_line( 0, VBL_INT, ASSERT_LINE ); | |
| 1142 | cpunum_set_input_line(machine, 0, VBL_INT, ASSERT_LINE ); | |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | void gb_video_init( int mode ) { |
| r1591 | r1592 | |
| 1328 | 1328 | if ( ! gb_lcd.mode_irq ) { |
| 1329 | 1329 | if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) { |
| 1330 | 1330 | gb_lcd.mode_irq = 1; |
| 1331 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1331 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1332 | 1332 | } |
| 1333 | 1333 | } else { |
| 1334 | 1334 | gb_lcd.mode_irq = 0; |
| r1591 | r1592 | |
| 1364 | 1364 | /* Generate lcd interrupt if requested */ |
| 1365 | 1365 | if ( ! gb_lcd.mode_irq && ( LCDSTAT & 0x08 ) && |
| 1366 | 1366 | ( ( ! gb_lcd.line_irq && gb_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) { |
| 1367 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1367 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1368 | 1368 | } |
| 1369 | 1369 | /* Check for HBLANK DMA */ |
| 1370 | 1370 | if( gbc_hdma_enabled ) |
| r1591 | r1592 | |
| 1378 | 1378 | if ( ! gb_lcd.mode_irq ) { |
| 1379 | 1379 | if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) { |
| 1380 | 1380 | gb_lcd.mode_irq = 1; |
| 1381 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1381 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1382 | 1382 | } |
| 1383 | 1383 | } else { |
| 1384 | 1384 | gb_lcd.mode_irq = 0; |
| r1591 | r1592 | |
| 1394 | 1394 | gb_lcd.line_irq = 0; |
| 1395 | 1395 | if ( ! gb_lcd.mode_irq && ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) { |
| 1396 | 1396 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1397 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1397 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1398 | 1398 | } |
| 1399 | 1399 | /* Reset LY==LYC STAT bit */ |
| 1400 | 1400 | LCDSTAT &= 0xFB; |
| r1591 | r1592 | |
| 1408 | 1408 | if ( ! gb_lcd.mode_irq && ( LCDSTAT & 0x20 ) && |
| 1409 | 1409 | ( ( ! gb_lcd.triggering_line_irq && ! gb_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) { |
| 1410 | 1410 | gb_lcd.mode_irq = 1; |
| 1411 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1411 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1412 | 1412 | } |
| 1413 | 1413 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LYXX_M2, attotime_never ); |
| 1414 | 1414 | } |
| r1591 | r1592 | |
| 1420 | 1420 | gb_lcd.oam_locked = LOCKED; |
| 1421 | 1421 | /* Generate lcd interrupt if requested */ |
| 1422 | 1422 | if ( ( LCDSTAT & 0x20 ) && ! gb_lcd.line_irq && ! gb_lcd.line_irq ) { |
| 1423 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1423 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1424 | 1424 | } |
| 1425 | 1425 | /* Check for regular compensation of x-scroll register */ |
| 1426 | 1426 | gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| r1591 | r1592 | |
| 1434 | 1434 | /* Generate lcd interrupt if requested */ |
| 1435 | 1435 | if ( ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) || |
| 1436 | 1436 | ( !gb_lcd.mode_irq && ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq && ( LCDSTAT & 0x20 ) ) ) { |
| 1437 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1437 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1438 | 1438 | } |
| 1439 | 1439 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1440 | 1440 | /* Check if LY==LYC STAT bit should be set */ |
| r1591 | r1592 | |
| 1461 | 1461 | case GB_LCD_STATE_LY9X_M1: /* Switch to or stay in mode 1 */ |
| 1462 | 1462 | if ( CURLINE == 144 ) { |
| 1463 | 1463 | /* Trigger VBlank interrupt */ |
| 1464 | cpunum_set_input_line( 0, VBL_INT, HOLD_LINE ); | |
| 1464 | cpunum_set_input_line(machine, 0, VBL_INT, HOLD_LINE ); | |
| 1465 | 1465 | /* Set VBlank lcdstate */ |
| 1466 | 1466 | gb_lcd.mode = 1; |
| 1467 | 1467 | LCDSTAT = (LCDSTAT & 0xFC) | 0x01; |
| 1468 | 1468 | /* Trigger LCD interrupt if requested */ |
| 1469 | 1469 | if ( LCDSTAT & 0x10 ) { |
| 1470 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1470 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1471 | 1471 | } |
| 1472 | 1472 | } |
| 1473 | 1473 | /* Check if LY==LYC STAT bit should be set */ |
| r1591 | r1592 | |
| 1475 | 1475 | LCDSTAT |= 0x04; |
| 1476 | 1476 | } |
| 1477 | 1477 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1478 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1478 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1479 | 1479 | } |
| 1480 | 1480 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(452,0), GB_LCD_STATE_LY9X_M1_INC, attotime_never ); |
| 1481 | 1481 | break; |
| r1591 | r1592 | |
| 1486 | 1486 | gb_lcd.line_irq = 0; |
| 1487 | 1487 | if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1488 | 1488 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1489 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1489 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1490 | 1490 | } |
| 1491 | 1491 | /* Reset LY==LYC STAT bit */ |
| 1492 | 1492 | LCDSTAT &= 0xFB; |
| r1591 | r1592 | |
| 1500 | 1500 | /* Check LY=LYC for line #153 */ |
| 1501 | 1501 | if ( gb_lcd.delayed_line_irq ) { |
| 1502 | 1502 | if ( gb_lcd.triggering_line_irq ) { |
| 1503 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1503 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1504 | 1504 | } |
| 1505 | 1505 | } |
| 1506 | 1506 | gb_lcd.delayed_line_irq = gb_lcd.delayed_line_irq | gb_lcd.line_irq; |
| r1591 | r1592 | |
| 1516 | 1516 | case GB_LCD_STATE_LY00_M1_1: |
| 1517 | 1517 | if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1518 | 1518 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1519 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1519 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1520 | 1520 | } |
| 1521 | 1521 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LY00_M1_2, attotime_never ); |
| 1522 | 1522 | break; |
| 1523 | 1523 | case GB_LCD_STATE_LY00_M1_2: /* Rest of line #0 during VBlank */ |
| 1524 | 1524 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1525 | 1525 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1526 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1526 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1527 | 1527 | } |
| 1528 | 1528 | if ( CURLINE == CMPLINE ) { |
| 1529 | 1529 | LCDSTAT |= 0x04; |
| r1591 | r1592 | |
| 1559 | 1559 | if ( ! gb_lcd.mode_irq ) { |
| 1560 | 1560 | if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) { |
| 1561 | 1561 | gb_lcd.mode_irq = 1; |
| 1562 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1562 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1563 | 1563 | } |
| 1564 | 1564 | } else { |
| 1565 | 1565 | gb_lcd.mode_irq = 0; |
| r1591 | r1592 | |
| 1596 | 1596 | /* Generate lcd interrupt if requested */ |
| 1597 | 1597 | if ( ! gb_lcd.mode_irq && gb_lcd.triggering_mode_irq && |
| 1598 | 1598 | ( ( ! gb_lcd.line_irq && gb_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) { |
| 1599 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1599 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1600 | 1600 | gb_lcd.triggering_mode_irq = 0; |
| 1601 | 1601 | } |
| 1602 | 1602 | /* Check for HBLANK DMA */ |
| r1591 | r1592 | |
| 1618 | 1618 | if ( ! gb_lcd.mode_irq ) { |
| 1619 | 1619 | if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) { |
| 1620 | 1620 | gb_lcd.mode_irq = 1; |
| 1621 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1621 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1622 | 1622 | } |
| 1623 | 1623 | } else { |
| 1624 | 1624 | gb_lcd.mode_irq = 0; |
| r1591 | r1592 | |
| 1634 | 1634 | gb_lcd.line_irq = 0; |
| 1635 | 1635 | if ( ! gb_lcd.mode_irq && ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) { |
| 1636 | 1636 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1637 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1637 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1638 | 1638 | } |
| 1639 | 1639 | /* Check if we're going into VBlank next */ |
| 1640 | 1640 | if ( CURLINE == 144 ) { |
| r1591 | r1592 | |
| 1646 | 1646 | if ( ! gb_lcd.mode_irq && ( LCDSTAT & 0x20 ) && |
| 1647 | 1647 | ( ( ! gb_lcd.triggering_line_irq && ! gb_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) { |
| 1648 | 1648 | gb_lcd.mode_irq = 1; |
| 1649 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1649 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1650 | 1650 | } |
| 1651 | 1651 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LYXX_M2, attotime_never ); |
| 1652 | 1652 | } |
| r1591 | r1592 | |
| 1658 | 1658 | gb_lcd.oam_locked = LOCKED; |
| 1659 | 1659 | /* Generate lcd interrupt if requested */ |
| 1660 | 1660 | if ( ( LCDSTAT & 0x20 ) && ! gb_lcd.line_irq && ! gb_lcd.line_irq ) { |
| 1661 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1661 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1662 | 1662 | } |
| 1663 | 1663 | /* Check for regular compensation of x-scroll register */ |
| 1664 | 1664 | gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| r1591 | r1592 | |
| 1672 | 1672 | /* Generate lcd interrupt if requested */ |
| 1673 | 1673 | if ( ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) || |
| 1674 | 1674 | ( !gb_lcd.mode_irq && ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq && ( LCDSTAT & 0x20 ) ) ) { |
| 1675 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1675 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1676 | 1676 | } |
| 1677 | 1677 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1678 | 1678 | /* Check if LY==LYC STAT bit should be set */ |
| r1591 | r1592 | |
| 1702 | 1702 | case GB_LCD_STATE_LY9X_M1: /* Switch to or stay in mode 1 */ |
| 1703 | 1703 | if ( CURLINE == 144 ) { |
| 1704 | 1704 | /* Trigger VBlank interrupt */ |
| 1705 | cpunum_set_input_line( 0, VBL_INT, HOLD_LINE ); | |
| 1705 | cpunum_set_input_line(machine, 0, VBL_INT, HOLD_LINE ); | |
| 1706 | 1706 | /* Set VBlank lcdstate */ |
| 1707 | 1707 | gb_lcd.mode = 1; |
| 1708 | 1708 | LCDSTAT = (LCDSTAT & 0xFC) | 0x01; |
| 1709 | 1709 | /* Trigger LCD interrupt if requested */ |
| 1710 | 1710 | if ( LCDSTAT & 0x10 ) { |
| 1711 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1711 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1712 | 1712 | } |
| 1713 | 1713 | } |
| 1714 | 1714 | /* Check if LY==LYC STAT bit should be set */ |
| r1591 | r1592 | |
| 1718 | 1718 | LCDSTAT &= ~0x04; |
| 1719 | 1719 | } |
| 1720 | 1720 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1721 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1721 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1722 | 1722 | } |
| 1723 | 1723 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(452,0), GB_LCD_STATE_LY9X_M1_INC, attotime_never ); |
| 1724 | 1724 | break; |
| r1591 | r1592 | |
| 1729 | 1729 | gb_lcd.line_irq = 0; |
| 1730 | 1730 | if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1731 | 1731 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1732 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1732 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1733 | 1733 | } |
| 1734 | 1734 | if ( gb_lcd.current_line == 153 ) { |
| 1735 | 1735 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LY00_M1, attotime_never ); |
| r1591 | r1592 | |
| 1741 | 1741 | /* Check LY=LYC for line #153 */ |
| 1742 | 1742 | if ( gb_lcd.delayed_line_irq ) { |
| 1743 | 1743 | if ( gb_lcd.triggering_line_irq ) { |
| 1744 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1744 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1745 | 1745 | } |
| 1746 | 1746 | } |
| 1747 | 1747 | gb_lcd.delayed_line_irq = gb_lcd.delayed_line_irq | gb_lcd.line_irq; |
| r1591 | r1592 | |
| 1759 | 1759 | case GB_LCD_STATE_LY00_M1_1: |
| 1760 | 1760 | if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1761 | 1761 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1762 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1762 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1763 | 1763 | } |
| 1764 | 1764 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LY00_M1_2, attotime_never ); |
| 1765 | 1765 | break; |
| 1766 | 1766 | case GB_LCD_STATE_LY00_M1_2: /* Rest of line #0 during VBlank */ |
| 1767 | 1767 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1768 | 1768 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1769 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1769 | cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE ); | |
| 1770 | 1770 | } |
| 1771 | 1771 | if ( CURLINE == CMPLINE ) { |
| 1772 | 1772 | LCDSTAT |= 0x04; |
| r1591 | r1592 | |
| 1803 | 1803 | LCDSTAT |= 0x04; |
| 1804 | 1804 | /* Generate lcd interrupt if requested */ |
| 1805 | 1805 | if ( LCDSTAT & 0x40 ) { |
| 1806 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1806 | cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE ); | |
| 1807 | 1807 | } |
| 1808 | 1808 | } |
| 1809 | 1809 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(80,0), GB_LCD_STATE_LYXX_M3, attotime_never ); |
| r1591 | r1592 | |
| 1897 | 1897 | ( ( LCDSTAT & 0x60 ) == 0x00 && ( data & 0x60 ) == 0x20 ) || |
| 1898 | 1898 | ( ( LCDSTAT & 0x60 ) == 0x20 && ( data & 0x40 ) ) |
| 1899 | 1899 | ) ) { |
| 1900 | cpunum_set_input_line(0, LCD_INT, HOLD_LINE); | |
| 1900 | cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE); | |
| 1901 | 1901 | } |
| 1902 | 1902 | /* |
| 1903 | 1903 | - 0x20 -> 0x08/0x18/0x28/0x48 (mode 0, after m2int) - trigger |
| r1591 | r1592 | |
| 1905 | 1905 | - 0x00 -> 0xXX (mode 0) - trigger stat bug |
| 1906 | 1906 | */ |
| 1907 | 1907 | if ( gb_lcd.mode_irq && gb_lcd.mode == 0 ) { |
| 1908 | cpunum_set_input_line(0, LCD_INT, HOLD_LINE); | |
| 1908 | cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE); | |
| 1909 | 1909 | } |
| 1910 | 1910 | } |
| 1911 | 1911 | break; |
| r1591 | r1592 | |
| 1917 | 1917 | LCDSTAT |= 0x04; |
| 1918 | 1918 | /* Generate lcd interrupt if requested */ |
| 1919 | 1919 | if ( LCDSTAT & 0x40 ) { |
| 1920 | cpunum_set_input_line( 0, LCD_INT, HOLD_LINE ); | |
| 1920 | cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE ); | |
| 1921 | 1921 | } |
| 1922 | 1922 | } else { |
| 1923 | 1923 | LCDSTAT &= 0xFB; |
| r1591 | r1592 | |
| 2013 | 2013 | - 0x20 -> 0x08/0x18/0x28/0x48 (mode 0, after m2int) - trigger |
| 2014 | 2014 | */ |
| 2015 | 2015 | if ( gb_lcd.mode_irq && gb_lcd.mode == 0 && ( LCDSTAT & 0x28 ) == 0x20 && ( data & 0x08 ) ) { |
| 2016 | cpunum_set_input_line(0, LCD_INT, HOLD_LINE); | |
| 2016 | cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE); | |
| 2017 | 2017 | } |
| 2018 | 2018 | } |
| 2019 | 2019 | break; |
| r1591 | r1592 | |
|---|---|---|
| 107 | 107 | } |
| 108 | 108 | if (vectrex_lightpen_port & 2) |
| 109 | 109 | { |
| 110 | cpunum_set_input_line(0, M6809_FIRQ_LINE, PULSE_LINE); | |
| 110 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, PULSE_LINE); | |
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| r1591 | r1592 | |
| 189 | 189 | i = (i+1) % NVECT; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | video_update_vector( | |
| 192 | video_update_vector(Machine, screen, bitmap, cliprect); | |
| 193 | 193 | vector_clear_list(); |
| 194 | 194 | return 0; |
| 195 | 195 | } |
| r1591 | r1592 | |
|---|---|---|
| 1872 | 1872 | if (cfg->cpu0_timing_factor > 0) |
| 1873 | 1873 | { |
| 1874 | 1874 | cpu0_clock_period = period * cfg->cpu0_timing_factor * GROSS_FACTOR; |
| 1875 | cpunum_set_clock_period(0, cpu0_clock_period); | |
| 1875 | cpunum_set_clock_period(Machine, 0, cpu0_clock_period); | |
| 1876 | 1876 | } |
| 1877 | 1877 | |
| 1878 | 1878 | /* calculate timing */ |
| r1591 | r1592 | |
|---|---|---|
| 1090 | 1090 | sys.mfp.isra = 0; |
| 1091 | 1091 | sys.mfp.isrb = 0; |
| 1092 | 1092 | // mfp_trigger_irq(MFP_IRQ_GPIP6); |
| 1093 | // cpunum_set_input_line_and_vector(0,6,ASSERT_LINE,0x43); | |
| 1093 | // cpunum_set_input_line_and_vector(Machine, 0,6,ASSERT_LINE,0x43); | |
| 1094 | 1094 | } |
| 1095 | 1095 | if(input_code_pressed(KEYCODE_9)) |
| 1096 | 1096 | { |
| r1591 | r1592 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | if ((y == shifter.vblank_start) && (x == 0)) |
| 172 | 172 | { |
| 173 | cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE); | |
| 173 | cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE); | |
| 174 | 174 | shifter.ofs = shifter.base; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if (x == shifter.hblank_start) |
| 178 | 178 | { |
| 179 | cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE); | |
| 179 | cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE); | |
| 180 | 180 | shifter.ofs += (shifter.lineofs * 2); // STe |
| 181 | 181 | } |
| 182 | 182 | } |
| r1591 | r1592 | |
|---|---|---|
| 81 | 81 | break; |
| 82 | 82 | case 0x31: |
| 83 | 83 | vic2.reg[offset] = data; |
| 84 | if (data&0x40) cpunum_set_clockscale(0,1.0); | |
| 85 | else cpunum_set_clockscale(0, 1.0/3.5); | |
| 84 | if (data&0x40) cpunum_set_clockscale(Machine, 0,1.0); | |
| 85 | else cpunum_set_clockscale(Machine, 0, 1.0/3.5); | |
| 86 | 86 | break; |
| 87 | 87 | case 0x32: |
| 88 | 88 | case 0x33: |
| r1591 | r1592 | |
|---|---|---|
| 352 | 352 | |
| 353 | 353 | if( maria_wsync ) |
| 354 | 354 | { |
| 355 | cpu_trigger( TRIGGER_HSYNC ); | |
| 355 | cpu_trigger( machine, TRIGGER_HSYNC ); | |
| 356 | 356 | maria_wsync = 0; |
| 357 | 357 | } |
| 358 | 358 | |
| r1591 | r1592 | |
| 434 | 434 | if( maria_dli ) |
| 435 | 435 | { |
| 436 | 436 | maria_dli = 0; |
| 437 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 437 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | } |
| r1591 | r1592 | |
|---|---|---|
| 34 | 34 | { |
| 35 | 35 | if (cdp1864.disp) |
| 36 | 36 | { |
| 37 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, HOLD_LINE); | |
| 37 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, HOLD_LINE); | |
| 38 | 38 | cdp1864.dmaptr = 0; |
| 39 | 39 | } |
| 40 | 40 | |
| r1591 | r1592 | |
| 44 | 44 | { |
| 45 | 45 | if (cdp1864.disp) |
| 46 | 46 | { |
| 47 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 47 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | timer_adjust(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0, attotime_zero); |
| r1591 | r1592 | |
| 89 | 89 | { |
| 90 | 90 | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) |
| 91 | 91 | { |
| 92 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 92 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| r1591 | r1592 | |
| 103 | 103 | { |
| 104 | 104 | if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END) |
| 105 | 105 | { |
| 106 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE); | |
| 106 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE); | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| r1591 | r1592 | |
| 170 | 170 | READ8_HANDLER( cdp1864_dispoff_r ) |
| 171 | 171 | { |
| 172 | 172 | cdp1864.disp = 0; |
| 173 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 174 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 173 | cpunum_set_input_line(Machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 174 | cpunum_set_input_line(Machine, 0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 175 | 175 | |
| 176 | 176 | return 0xff; |
| 177 | 177 | } |
| r1591 | r1592 | |
| 187 | 187 | cdp1864.dmaptr = 0; |
| 188 | 188 | cdp1864.bgcolor = 0; |
| 189 | 189 | |
| 190 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 191 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 190 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 191 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 192 | 192 | cdp1864_efx = CLEAR_LINE; |
| 193 | 193 | |
| 194 | 194 | cdp1864_audio_output_enable(0); |
| r1591 | r1592 | |
|---|---|---|
| 89 | 89 | static void vtech1_field_sync_callback(int data) |
| 90 | 90 | { |
| 91 | 91 | if (data) |
| 92 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 92 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 93 | 93 | else |
| 94 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 94 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 |
| r1591 | r1592 | |
|---|---|---|
| 981 | 981 | static void amstrad_plus_dma_parse(int channel, int *addr) |
| 982 | 982 | { |
| 983 | 983 | unsigned short command; |
| 984 | running_machine *machine = Machine; | |
| 984 | 985 | |
| 985 | 986 | if(*addr & 0x01) |
| 986 | 987 | (*addr)++; // align to even address |
| r1591 | r1592 | |
| 1030 | 1031 | { |
| 1031 | 1032 | amstrad_plus_irq_cause = channel * 2; |
| 1032 | 1033 | amstrad_plus_asic_ram[0x2c0f] |= (0x40 >> channel); |
| 1033 | cpunum_set_input_line(0,0,ASSERT_LINE); | |
| 1034 | cpunum_set_input_line(machine, 0,0,ASSERT_LINE); | |
| 1034 | 1035 | logerror("DMA %i: INT\n",channel); |
| 1035 | 1036 | } |
| 1036 | 1037 | if(command & 0x20) // Stop processing on this channel |
| r1591 | r1592 | |
| 1136 | 1137 | /* CRTC - Set new Horizontal Sync Status */ |
| 1137 | 1138 | static void amstrad_Set_HS(int offset, int data) |
| 1138 | 1139 | { |
| 1140 | running_machine *machine = Machine; | |
| 1141 | ||
| 1139 | 1142 | if (data != 0) |
| 1140 | 1143 | { |
| 1141 | 1144 | amstrad_render_mode = amstrad_current_mode; |
| r1591 | r1592 | |
| 1163 | 1166 | { |
| 1164 | 1167 | if(amstrad_plus_pri == 0 || amstrad_plus_asic_enabled == 0) |
| 1165 | 1168 | { |
| 1166 | cpunum_set_input_line(0,0, ASSERT_LINE); | |
| 1169 | cpunum_set_input_line(machine, 0,0, ASSERT_LINE); | |
| 1167 | 1170 | } |
| 1168 | 1171 | } |
| 1169 | 1172 | amstrad_CRTC_HS_Counter = 0; |
| r1591 | r1592 | |
| 1175 | 1178 | amstrad_CRTC_HS_Counter = 0; |
| 1176 | 1179 | if(amstrad_plus_pri == 0 || amstrad_plus_asic_enabled == 0) |
| 1177 | 1180 | { |
| 1178 | cpunum_set_input_line(0,0, ASSERT_LINE); | |
| 1181 | cpunum_set_input_line(machine, 0,0, ASSERT_LINE); | |
| 1179 | 1182 | } |
| 1180 | 1183 | } |
| 1181 | 1184 | if(amstrad_plus_asic_enabled != 0) |
| r1591 | r1592 | |
| 1186 | 1189 | if(m6845_get_row_counter() == ((amstrad_plus_pri >> 3) & 0x1f) && m6845_get_scanline_counter() == (amstrad_plus_pri & 0x07)) |
| 1187 | 1190 | { |
| 1188 | 1191 | // logerror("PRI: triggered, scanline %i, VSync width = %i\n",amstrad_scanline,vid.vertical_sync_width); |
| 1189 | cpunum_set_input_line(0,0,ASSERT_LINE); | |
| 1192 | cpunum_set_input_line(machine, 0,0,ASSERT_LINE); | |
| 1190 | 1193 | amstrad_plus_irq_cause = 0x06; // raster interrupt vector |
| 1191 | 1194 | amstrad_CRTC_HS_Counter &= ~0x20; // ASIC PRI resets the MSB of the raster counter |
| 1192 | 1195 | } |
| r1591 | r1592 | |
|---|---|---|
| 121 | 121 | translate = translate_videoram[(input_port_0_r(0) & 0x40) ? 1 : 0]; |
| 122 | 122 | |
| 123 | 123 | if (readinputport(0) & 0x08) |
| 124 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 124 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 125 | 125 | |
| 126 | 126 | /* check for changed color settings */ |
| 127 | 127 | if (color != (readinputport(0) & 3)) |
| r1591 | r1592 | |
|---|---|---|
| 322 | 322 | switch (line) |
| 323 | 323 | { |
| 324 | 324 | case 252: |
| 325 | cpunum_set_input_line(0, 0, ASSERT_LINE); /* vsync?? */ | |
| 325 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); /* vsync?? */ | |
| 326 | 326 | break; |
| 327 | 327 | case 253: |
| 328 | cpunum_set_input_line(0, 0, CLEAR_LINE); /* vsync?? */ | |
| 328 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); /* vsync?? */ | |
| 329 | 329 | break; |
| 330 | 330 | } |
| 331 | 331 | } |
| r1591 | r1592 | |
| 584 | 584 | /* Throw an interrupt if enabled */ |
| 585 | 585 | if( o2_vdc.s.control & 0x4 ) |
| 586 | 586 | { |
| 587 | cpunum_set_input_line(0, 1, HOLD_LINE); /* Is this right? */ | |
| 587 | cpunum_set_input_line(Machine, 0, 1, HOLD_LINE); /* Is this right? */ | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /* Adjust volume */ |
| r1591 | r1592 | |
|---|---|---|
| 474 | 474 | (vc4000_video.sprites[0].finished_now)) |
| 475 | 475 | { |
| 476 | 476 | cpunum_set_input_line_vector(0, 0, 3); |
| 477 | cpunum_set_input_line(0, 0, PULSE_LINE); | |
| 477 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); | |
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 |
| r1591 | r1592 | |
|---|---|---|
| 26 | 26 | { |
| 27 | 27 | if (cdp1861.disp) |
| 28 | 28 | { |
| 29 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, HOLD_LINE); | |
| 29 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, HOLD_LINE); | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | timer_adjust(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_END, 0), 0, attotime_zero); |
| r1591 | r1592 | |
| 35 | 35 | { |
| 36 | 36 | if (cdp1861.disp) |
| 37 | 37 | { |
| 38 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 38 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | timer_adjust(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0, attotime_zero); |
| r1591 | r1592 | |
| 80 | 80 | { |
| 81 | 81 | if (scanline >= CDP1861_SCANLINE_DISPLAY_START && scanline < CDP1861_SCANLINE_DISPLAY_END) |
| 82 | 82 | { |
| 83 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 83 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
| r1591 | r1592 | |
| 94 | 94 | { |
| 95 | 95 | if (scanline >= CDP1861_SCANLINE_DISPLAY_START && scanline < CDP1861_SCANLINE_DISPLAY_END) |
| 96 | 96 | { |
| 97 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE); | |
| 97 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE); | |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| r1591 | r1592 | |
| 127 | 127 | cdp1861.disp = 0; |
| 128 | 128 | cdp1861.dmaout = 0; |
| 129 | 129 | |
| 130 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 131 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 130 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 131 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 132 | 132 | cdp1861_efx = CLEAR_LINE; |
| 133 | 133 | } |
| 134 | 134 | |
| r1591 | r1592 | |
| 142 | 142 | WRITE8_HANDLER( cdp1861_dispoff_w ) |
| 143 | 143 | { |
| 144 | 144 | cdp1861.disp = 0; |
| 145 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 146 | cpunum_set_input_line(0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 145 | cpunum_set_input_line(Machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); | |
| 146 | cpunum_set_input_line(Machine, 0, CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | VIDEO_START( cdp1861 ) |
| r1591 | r1592 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | static void wswan_handle_irqs( void ) { |
| 128 | 128 | if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_HBLTMR ) { |
| 129 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_HBLTMR ); | |
| 129 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_HBLTMR ); | |
| 130 | 130 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_VBL ) { |
| 131 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_VBL ); | |
| 131 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_VBL ); | |
| 132 | 132 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_VBLTMR ) { |
| 133 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_VBLTMR ); | |
| 133 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_VBLTMR ); | |
| 134 | 134 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_LCMP ) { |
| 135 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_LCMP ); | |
| 135 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_LCMP ); | |
| 136 | 136 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_SRX ) { |
| 137 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_SRX ); | |
| 137 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_SRX ); | |
| 138 | 138 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_RTC ) { |
| 139 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_RTC ); | |
| 139 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_RTC ); | |
| 140 | 140 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_KEY ) { |
| 141 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_KEY ); | |
| 141 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_KEY ); | |
| 142 | 142 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_STX ) { |
| 143 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_STX ); | |
| 143 | cpunum_set_input_line_and_vector( Machine, 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_STX ); | |
| 144 | 144 | } else { |
| 145 | cpunum_set_input_line( 0, 0, CLEAR_LINE ); | |
| 145 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE ); | |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 |
| r1591 | r1592 | |
|---|---|---|
| 681 | 681 | HALT_DMA=CLEAR_LINE; |
| 682 | 682 | |
| 683 | 683 | LOG_HALT(("DMA_CPU HALT=%d\n",HALT_DMA)); |
| 684 | cpunum_set_input_line(1, INPUT_LINE_HALT, HALT_DMA); | |
| 684 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, HALT_DMA); | |
| 685 | 685 | |
| 686 | 686 | /* CPU un-halted let it run ! */ |
| 687 | 687 | if (HALT_DMA==CLEAR_LINE) |
| r1591 | r1592 | |
| 724 | 724 | else |
| 725 | 725 | HALT_CPU=ASSERT_LINE; |
| 726 | 726 | LOG_HALT(("MAIN_CPU HALT=%d\n",HALT_CPU)); |
| 727 | cpunum_set_input_line(0, INPUT_LINE_HALT, HALT_CPU); | |
| 727 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, HALT_CPU); | |
| 728 | 728 | |
| 729 | 729 | d_pia1_pb_last=data & 0x02; |
| 730 | 730 | |
| r1591 | r1592 | |
| 775 | 775 | LOG_INTS(("cpu1 NMI : %d\n",NMI)); |
| 776 | 776 | if(!NMI) |
| 777 | 777 | { |
| 778 | cpunum_set_input_line(1,INPUT_LINE_NMI,ASSERT_LINE); | |
| 778 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,ASSERT_LINE); | |
| 779 | 779 | logerror("cpu_yield()\n"); |
| 780 | 780 | cpu_yield(); /* Let DMA CPU run */ |
| 781 | 781 | } |
| 782 | 782 | else |
| 783 | 783 | { |
| 784 | cpunum_set_input_line(1,INPUT_LINE_NMI,CLEAR_LINE); | |
| 784 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,CLEAR_LINE); | |
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | DMA_NMI_LAST=NMI; /* Save it for next time */ |
| r1591 | r1592 | |
| 865 | 865 | else |
| 866 | 866 | IRQ = CLEAR_LINE; |
| 867 | 867 | |
| 868 | cpunum_set_input_line(0, M6809_IRQ_LINE, IRQ); | |
| 868 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, IRQ); | |
| 869 | 869 | LOG_INTS(("cpu0 IRQ : %d\n",IRQ)); |
| 870 | 870 | } |
| 871 | 871 | |
| r1591 | r1592 | |
| 879 | 879 | else |
| 880 | 880 | FIRQ = CLEAR_LINE; |
| 881 | 881 | |
| 882 | cpunum_set_input_line(0, M6809_FIRQ_LINE, FIRQ); | |
| 882 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, FIRQ); | |
| 883 | 883 | |
| 884 | 884 | LOG_INTS(("cpu0 FIRQ : %d\n",FIRQ)); |
| 885 | 885 | } |
| r1591 | r1592 | |
| 888 | 888 | |
| 889 | 889 | static void cpu1_recalc_firq(int state) |
| 890 | 890 | { |
| 891 | cpunum_set_input_line(1, M6809_FIRQ_LINE, state); | |
| 891 | cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, state); | |
| 892 | 892 | LOG_INTS(("cpu1 FIRQ : %d\n",state)); |
| 893 | 893 | } |
| 894 | 894 | |
| r1591 | r1592 | |
| 1045 | 1045 | system_rom = memory_region(REGION_CPU1); |
| 1046 | 1046 | |
| 1047 | 1047 | /* Make sure CPU 1 is started out halted ! */ |
| 1048 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1048 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1049 | 1049 | |
| 1050 | 1050 | /* Reset to task 0, and map banks disabled, so standard memory map */ |
| 1051 | 1051 | /* with ram at $0000-$BFFF, ROM at $C000-FBFF, IO at $FC00-$FEFF */ |
| r1591 | r1592 | |
|---|---|---|
| 924 | 924 | { |
| 925 | 925 | io_status &= ~io_st_tyi; |
| 926 | 926 | if (USE_SBS) |
| 927 | cpunum_set_input_line_and_vector(0, 0, CLEAR_LINE, 0); /* interrupt it, baby */ | |
| 927 | cpunum_set_input_line_and_vector(Machine, 0, 0, CLEAR_LINE, 0); /* interrupt it, baby */ | |
| 928 | 928 | } |
| 929 | 929 | } |
| 930 | 930 | |
| r1591 | r1592 | |
| 1274 | 1274 | typewriter.tb = (i << 4) + j; |
| 1275 | 1275 | io_status |= io_st_tyi; |
| 1276 | 1276 | #if USE_SBS |
| 1277 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, 0); /* interrupt it, baby */ | |
| 1277 | cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, 0); /* interrupt it, baby */ | |
| 1278 | 1278 | #endif |
| 1279 | 1279 | cpunum_set_reg(0, PDP1_PF1, 1); |
| 1280 | 1280 | pdp1_typewriter_drawchar(typewriter.tb); /* we want to echo input */ |
| r1591 | r1592 | |
|---|---|---|
| 315 | 315 | logerror("apple2gs_add_irq(): adding %s\n", apple2gs_irq_name(irq_mask)); |
| 316 | 316 | |
| 317 | 317 | apple2gs_pending_irqs |= irq_mask; |
| 318 | cpunum_set_input_line(0, G65816_LINE_IRQ, apple2gs_pending_irqs ? ASSERT_LINE : CLEAR_LINE); | |
| 318 | cpunum_set_input_line(Machine, 0, G65816_LINE_IRQ, apple2gs_pending_irqs ? ASSERT_LINE : CLEAR_LINE); | |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
| r1591 | r1592 | |
| 329 | 329 | logerror("apple2gs_remove_irq(): removing %s\n", apple2gs_irq_name(irq_mask)); |
| 330 | 330 | |
| 331 | 331 | apple2gs_pending_irqs &= ~irq_mask; |
| 332 | cpunum_set_input_line(0, G65816_LINE_IRQ, apple2gs_pending_irqs ? ASSERT_LINE : CLEAR_LINE); | |
| 332 | cpunum_set_input_line(Machine, 0, G65816_LINE_IRQ, apple2gs_pending_irqs ? ASSERT_LINE : CLEAR_LINE); | |
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | |
| r1591 | r1592 | |
| 1172 | 1172 | |
| 1173 | 1173 | case 0x36: /* C036 - CYAREG */ |
| 1174 | 1174 | apple2gs_cyareg = data & ~0x20; |
| 1175 | cpunum_set_clock(0, (data & 0x80) ? APPLE2GS_14M/5 : APPLE2GS_7M/7); | |
| 1175 | cpunum_set_clock(Machine, 0, (data & 0x80) ? APPLE2GS_14M/5 : APPLE2GS_7M/7); | |
| 1176 | 1176 | break; |
| 1177 | 1177 | |
| 1178 | 1178 | case 0x38: /* C038 - SCCBREG */ |
| r1591 | r1592 | |
|---|---|---|
| 337 | 337 | logerror("apple3_update_memory(): via_0_b=0x%02x via_1_a=0x0x%02x\n", via_0_b, via_1_a); |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | cpunum_set_clock(0, (via_0_a & 0x80) ? 1000000 : 2000000); | |
| 340 | cpunum_set_clock(Machine, 0, (via_0_a & 0x80) ? 1000000 : 2000000); | |
| 341 | 341 | |
| 342 | 342 | /* bank 2 (0100-01FF) */ |
| 343 | 343 | if (!(via_0_a & 0x04)) |
| r1591 | r1592 | |
| 480 | 480 | static void apple2_via_1_irq_func(int state) |
| 481 | 481 | { |
| 482 | 482 | if (!via_1_irq && state) |
| 483 | cpunum_set_input_line(0, M6502_IRQ_LINE, PULSE_LINE); | |
| 483 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, PULSE_LINE); | |
| 484 | 484 | via_1_irq = state; |
| 485 | 485 | } |
| 486 | 486 |
| r1591 | r1592 | |
|---|---|---|
| 78 | 78 | static void dai_interrupt_callback(int intreq, UINT8 vector) |
| 79 | 79 | { |
| 80 | 80 | if (intreq) |
| 81 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, vector); | |
| 81 | cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, vector); | |
| 82 | 82 | else |
| 83 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 83 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static const tms5501_init_param dai_tms5501_init_param = |
| r1591 | r1592 | |
|---|---|---|
| 140 | 140 | { |
| 141 | 141 | if (scc_interrupt) |
| 142 | 142 | /* SCC interrupt */ |
| 143 | cpunum_set_input_line(0, 2, ASSERT_LINE); | |
| 143 | cpunum_set_input_line(Machine, 0, 2, ASSERT_LINE); | |
| 144 | 144 | else if (via_interrupt) |
| 145 | 145 | /* VIA interrupt */ |
| 146 | cpunum_set_input_line(0, 1, ASSERT_LINE); | |
| 146 | cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE); | |
| 147 | 147 | else |
| 148 | 148 | /* clear all interrupts */ |
| 149 | cpunum_set_input_line(0, 7, CLEAR_LINE); | |
| 149 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | static void set_scc_interrupt(int value) |
| r1591 | r1592 | |
| 741 | 741 | scc_set_status(0x02); |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | //cpunum_set_input_line(0, 2, ASSERT_LINE); | |
| 744 | //cpunum_set_input_line(machine, 0, 2, ASSERT_LINE); | |
| 745 | 745 | set_scc_interrupt(1); |
| 746 | 746 | } |
| 747 | 747 | |
| r1591 | r1592 | |
| 1247 | 1247 | static void mac_via_irq(int state) |
| 1248 | 1248 | { |
| 1249 | 1249 | /* interrupt the 68k (level 1) */ |
| 1250 | //cpunum_set_input_line(0, 1, state); | |
| 1250 | //cpunum_set_input_line(machine, 0, 1, state); | |
| 1251 | 1251 | set_via_interrupt(state); |
| 1252 | 1252 | } |
| 1253 | 1253 |
| r1591 | r1592 | |
|---|---|---|
| 164 | 164 | if (level != old_level) |
| 165 | 165 | { |
| 166 | 166 | DBG_LOG (3, "mos6509", ("irq %s\n", level ? "start" : "end")); |
| 167 | cpunum_set_input_line | |
| 167 | cpunum_set_input_line | |
| 168 | 168 | old_level = level; |
| 169 | 169 | } |
| 170 | 170 | } |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | static void pio_interrupt(int state) |
| 46 | 46 | { |
| 47 | cpunum_set_input_line(0, 0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 47 | cpunum_set_input_line(Machine, 0, 0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /* |
| r1591 | r1592 | |
| 152 | 152 | switch( state ) |
| 153 | 153 | { |
| 154 | 154 | case WD17XX_IRQ_CLR: |
| 155 | // cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 155 | // cpunum_set_input_line(machine, 0,0,CLEAR_LINE); | |
| 156 | 156 | fdc_status &= ~0x40; |
| 157 | 157 | break; |
| 158 | 158 | case WD17XX_IRQ_SET: |
| 159 | // cpunum_set_input_line(0,0,HOLD_LINE); | |
| 159 | // cpunum_set_input_line(machine, 0,0,HOLD_LINE); | |
| 160 | 160 | fdc_status |= 0x40; |
| 161 | 161 | break; |
| 162 | 162 | case WD17XX_DRQ_CLR: |
| r1591 | r1592 | |
|---|---|---|
| 710 | 710 | UINT8 pia0_irq_b = pia_get_irq_b(0); |
| 711 | 711 | |
| 712 | 712 | if (pia0_irq_a || pia0_irq_b) |
| 713 | cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 713 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 714 | 714 | else |
| 715 | cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 715 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE); | |
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | static void d_recalc_firq(void) |
| r1591 | r1592 | |
| 723 | 723 | UINT8 pia2_firq_b = pia_get_irq_b(2); |
| 724 | 724 | |
| 725 | 725 | if (pia1_firq_a || pia1_firq_b || pia2_firq_a || pia2_firq_b) |
| 726 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 726 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 727 | 727 | else |
| 728 | cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 728 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | static void coco3_recalc_irq(void) |
| 732 | 732 | { |
| 733 | 733 | if ((coco3_gimereg[0] & 0x20) && gime_irq) |
| 734 | cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 734 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE); | |
| 735 | 735 | else |
| 736 | 736 | d_recalc_irq(); |
| 737 | 737 | } |
| r1591 | r1592 | |
| 739 | 739 | static void coco3_recalc_firq(void) |
| 740 | 740 | { |
| 741 | 741 | if ((coco3_gimereg[0] & 0x10) && gime_firq) |
| 742 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 742 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 743 | 743 | else |
| 744 | 744 | d_recalc_firq(); |
| 745 | 745 | } |
| r1591 | r1592 | |
| 871 | 871 | |
| 872 | 872 | void coco_set_halt_line(int halt_line) |
| 873 | 873 | { |
| 874 | cpunum_set_input_line(0, INPUT_LINE_HALT, halt_line); | |
| 874 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, halt_line); | |
| 875 | 875 | if (halt_line == CLEAR_LINE) |
| 876 | 876 | timer_set(ATTOTIME_IN_CYCLES(1,0), NULL, 0, recalc_interrupts); |
| 877 | 877 | } |
| r1591 | r1592 | |
| 1580 | 1580 | switch(event) |
| 1581 | 1581 | { |
| 1582 | 1582 | case WD17XX_IRQ_CLR: |
| 1583 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1583 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1584 | 1584 | break; |
| 1585 | 1585 | case WD17XX_IRQ_SET: |
| 1586 | 1586 | if(dgnalpha_just_reset) |
| r1591 | r1592 | |
| 1590 | 1590 | else |
| 1591 | 1591 | { |
| 1592 | 1592 | if (pia_get_output_ca2(2)) |
| 1593 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1593 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1594 | 1594 | } |
| 1595 | 1595 | break; |
| 1596 | 1596 | case WD17XX_DRQ_CLR: |
| r1591 | r1592 | |
| 1801 | 1801 | * TODO: Make the overclock more accurate. In dual speed, ROM was a fast |
| 1802 | 1802 | * access but RAM was not. I don't know how to simulate this. |
| 1803 | 1803 | */ |
| 1804 | cpunum_set_clockscale(0, val ? 2 : 1); | |
| 1804 | cpunum_set_clockscale(Machine, 0, val ? 2 : 1); | |
| 1805 | 1805 | } |
| 1806 | 1806 | |
| 1807 | 1807 | READ8_HANDLER(dragon_alpha_mapped_irq_r) |
| r1591 | r1592 | |
| 2608 | 2608 | static TIMER_CALLBACK(halt_timer_proc) |
| 2609 | 2609 | { |
| 2610 | 2610 | int data = param; |
| 2611 | cpunum_set_input_line(0, INPUT_LINE_HALT, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 2611 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 2612 | 2612 | } |
| 2613 | 2613 | |
| 2614 | 2614 | |
| r1591 | r1592 | |
| 2620 | 2620 | static TIMER_CALLBACK(nmi_timer_proc) |
| 2621 | 2621 | { |
| 2622 | 2622 | int data = param; |
| 2623 | cpunum_set_input_line(0, INPUT_LINE_NMI, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 2623 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 2624 | 2624 | } |
| 2625 | 2625 | |
| 2626 | 2626 |
| r1591 | r1592 | |
|---|---|---|
| 1770 | 1770 | if ( ! SIOCount ) { |
| 1771 | 1771 | SIOCONT &= 0x7F; |
| 1772 | 1772 | timer_enable( gb_serial_timer, 0 ); |
| 1773 | cpunum_set_input_line(0, SIO_INT, HOLD_LINE); | |
| 1773 | cpunum_set_input_line(machine, 0, SIO_INT, HOLD_LINE); | |
| 1774 | 1774 | } |
| 1775 | 1775 | } |
| 1776 | 1776 | |
| r1591 | r1592 | |
| 1780 | 1780 | gb_timer.triggering_irq = 0; |
| 1781 | 1781 | if ( TIMECNT == 0 ) { |
| 1782 | 1782 | TIMECNT = TIMEMOD; |
| 1783 | cpunum_set_input_line( 0, TIM_INT, HOLD_LINE ); | |
| 1783 | cpunum_set_input_line(Machine, 0, TIM_INT, HOLD_LINE ); | |
| 1784 | 1784 | gb_timer.reloading = 1; |
| 1785 | 1785 | } |
| 1786 | 1786 | } |
| r1591 | r1592 | |
|---|---|---|
| 156 | 156 | |
| 157 | 157 | if (final_level) |
| 158 | 158 | /* assert interrupt */ |
| 159 | cpunum_set_input_line_and_vector(0, M68K_IRQ_1+final_level-1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 159 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_1+final_level-1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 160 | 160 | else |
| 161 | 161 | /* clear all interrupts */ |
| 162 | cpunum_set_input_line_and_vector(0, M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 162 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | INLINE void post_in_KeyQueue(int keycode) |
| r1591 | r1592 | |
|---|---|---|
| 663 | 663 | logerror("m6530(%d) timer expired\n", chip); |
| 664 | 664 | m6530[chip].state |= 0x80; |
| 665 | 665 | if (m6530[chip].irqen) /* with IRQ? */ |
| 666 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 666 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | INTERRUPT_GEN( kim1_interrupt ) |
| r1591 | r1592 | |
|---|---|---|
| 72 | 72 | static void fdc_handle_hold(void) |
| 73 | 73 | { |
| 74 | 74 | if (DSKhold && (!DRQ_IRQ_status) && DVENA) |
| 75 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 75 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 76 | 76 | else |
| 77 | cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 77 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /* |
| r1591 | r1592 | |
|---|---|---|
| 278 | 278 | |
| 279 | 279 | void msx_vdp_interrupt(int i) |
| 280 | 280 | { |
| 281 | cpunum_set_input_line (0, 0, (i ? HOLD_LINE : CLEAR_LINE)); | |
| 281 | cpunum_set_input_line (Machine, 0, 0, (i ? HOLD_LINE : CLEAR_LINE)); | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | static void msx_ch_reset_core (void) |
| r1591 | r1592 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | UINT8 val = ( ( internal_registers[SM8521_CLKT] & 0x3F ) + 1 ) & 0x3F; |
| 67 | 67 | internal_registers[SM8521_CLKT] = ( internal_registers[SM8521_CLKT] & 0xC0 ) | val; |
| 68 | cpunum_set_input_line( 0, CK_INT, HOLD_LINE ); | |
| 68 | cpunum_set_input_line(machine, 0, CK_INT, HOLD_LINE ); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | MACHINE_RESET( gamecom ) |
| r1591 | r1592 | |
| 553 | 553 | gamecom_dma.dest_current = gamecom_dma.dest_line; |
| 554 | 554 | } |
| 555 | 555 | gamecom_dma.enabled = 0; |
| 556 | cpunum_set_input_line( 0, DMA_INT, HOLD_LINE ); | |
| 556 | cpunum_set_input_line(Machine, 0, DMA_INT, HOLD_LINE ); | |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | void gamecom_update_timers( int cycles ) { |
| r1591 | r1592 | |
| 564 | 564 | gamecom_timer[0].counter++; |
| 565 | 565 | if ( gamecom_timer[0].counter == gamecom_timer[0].check_value ) { |
| 566 | 566 | gamecom_timer[0].counter = 0; |
| 567 | cpunum_set_input_line( 0, TIM0_INT, HOLD_LINE ); | |
| 567 | cpunum_set_input_line(Machine, 0, TIM0_INT, HOLD_LINE ); | |
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | } |
| r1591 | r1592 | |
| 575 | 575 | gamecom_timer[1].counter++; |
| 576 | 576 | if ( gamecom_timer[1].counter == gamecom_timer[1].check_value ) { |
| 577 | 577 | gamecom_timer[1].counter = 0; |
| 578 | cpunum_set_input_line( 0, TIM1_INT, HOLD_LINE ); | |
| 578 | cpunum_set_input_line(Machine, 0, TIM1_INT, HOLD_LINE ); | |
| 579 | 579 | } |
| 580 | 580 | } |
| 581 | 581 | } |
| r1591 | r1592 | |
|---|---|---|
| 40 | 40 | advision_videoenable = 0; |
| 41 | 41 | wLpointer = 0; |
| 42 | 42 | rLpointer = 0; |
| 43 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 43 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | |
| r1591 | r1592 | |
| 61 | 61 | { |
| 62 | 62 | if (d & 0x01) |
| 63 | 63 | { |
| 64 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 64 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 65 | 65 | /* logerror("RELEASE RESET\n"); */ |
| 66 | 66 | wLpointer = 0; |
| 67 | 67 | rLpointer = 0; |
| 68 | 68 | } |
| 69 | 69 | else |
| 70 | 70 | { |
| 71 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 71 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 72 | 72 | /* logerror("SET RESET\n");*/ |
| 73 | 73 | } |
| 74 | 74 |
| r1591 | r1592 | |
|---|---|---|
| 125 | 125 | { |
| 126 | 126 | /* INTMSK: interrupt enabled? */ |
| 127 | 127 | if (pio_port_c_output & 0x04) |
| 128 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 128 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /************************ PIO ************************************************/ |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | for (level = 0; ! (intlines & (1 << level)); level++) |
| 33 | 33 | ; |
| 34 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, level); /* interrupt it, baby */ | |
| 34 | cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, level); /* interrupt it, baby */ | |
| 35 | 35 | } |
| 36 | 36 | else |
| 37 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 37 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | void ti990_set_int2(int state) |
| r1591 | r1592 | |
| 78 | 78 | |
| 79 | 79 | static TIMER_CALLBACK(clear_load) |
| 80 | 80 | { |
| 81 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 81 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | void ti990_hold_load(void) |
| 85 | 85 | { |
| 86 | cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 86 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 87 | 87 | timer_set(ATTOTIME_IN_MSEC(100), NULL, 0, clear_load); |
| 88 | 88 | } |
| 89 | 89 |
| r1591 | r1592 | |
|---|---|---|
| 189 | 189 | *********************************************************************/ |
| 190 | 190 | void v_via_irq (int level) |
| 191 | 191 | { |
| 192 | cpunum_set_input_line(0, M6809_IRQ_LINE, level); | |
| 192 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, level); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | READ8_HANDLER( v_via_pb_r ) |
| r1591 | r1592 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | static void aim65_via_irq_func(int state) |
| 59 | 59 | { |
| 60 | cpunum_set_input_line(0, M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE); | |
| 60 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /* STEP/RUN |
| r1591 | r1592 | |
| 171 | 171 | |
| 172 | 172 | static void aim65_riot_irq(int state) |
| 173 | 173 | { |
| 174 | cpunum_set_input_line(0, M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE); | |
| 174 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 |
| r1591 | r1592 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | static TIMER_CALLBACK(nes_irq_callback) |
| 101 | 101 | { |
| 102 | cpunum_set_input_line | |
| 102 | cpunum_set_input_line | |
| 103 | 103 | timer_adjust(nes_irq_timer, attotime_never, 0, attotime_never); |
| 104 | 104 | } |
| 105 | 105 | |
| r1591 | r1592 | |
| 632 | 632 | if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount) |
| 633 | 633 | { |
| 634 | 634 | logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(0), video_screen_get_hpos(0)); |
| 635 | cpunum_set_input_line | |
| 635 | cpunum_set_input_line | |
| 636 | 636 | // timer_adjust(nes_irq_timer, ATTOTIME_IN_CYCLES(4, 0), 0, attotime_never); |
| 637 | 637 | } |
| 638 | 638 | } |
| r1591 | r1592 | |
| 837 | 837 | if (scanline == IRQ_count) |
| 838 | 838 | { |
| 839 | 839 | if (IRQ_enable) |
| 840 | cpunum_set_input_line | |
| 840 | cpunum_set_input_line | |
| 841 | 841 | |
| 842 | 842 | IRQ_status = 0xff; |
| 843 | 843 | } |
| r1591 | r1592 | |
| 1586 | 1586 | { |
| 1587 | 1587 | if (IRQ_count <= 114) |
| 1588 | 1588 | { |
| 1589 | cpunum_set_input_line | |
| 1589 | cpunum_set_input_line | |
| 1590 | 1590 | } |
| 1591 | 1591 | IRQ_count -= 114; |
| 1592 | 1592 | } |
| r1591 | r1592 | |
| 1726 | 1726 | { |
| 1727 | 1727 | if ((IRQ_count & 0x0f) == 0x00) |
| 1728 | 1728 | /* rollover every 0x10 */ |
| 1729 | cpunum_set_input_line | |
| 1729 | cpunum_set_input_line | |
| 1730 | 1730 | } |
| 1731 | 1731 | else if (IRQ_mode & 0x04) |
| 1732 | 1732 | { |
| 1733 | 1733 | if ((IRQ_count & 0x0ff) == 0x00) |
| 1734 | 1734 | /* rollover every 0x100 */ |
| 1735 | cpunum_set_input_line | |
| 1735 | cpunum_set_input_line | |
| 1736 | 1736 | } |
| 1737 | 1737 | else if (IRQ_mode & 0x02) |
| 1738 | 1738 | { |
| 1739 | 1739 | if ((IRQ_count & 0x0fff) == 0x000) |
| 1740 | 1740 | /* rollover every 0x1000 */ |
| 1741 | cpunum_set_input_line | |
| 1741 | cpunum_set_input_line | |
| 1742 | 1742 | } |
| 1743 | 1743 | else if (IRQ_count == 0) |
| 1744 | 1744 | /* rollover at 0x10000 */ |
| 1745 | cpunum_set_input_line | |
| 1745 | cpunum_set_input_line | |
| 1746 | 1746 | } |
| 1747 | 1747 | } |
| 1748 | 1748 | else |
| r1591 | r1592 | |
| 1960 | 1960 | /* Increment & check the IRQ scanline counter */ |
| 1961 | 1961 | if (IRQ_enable && (IRQ_count == 0x7fff)) |
| 1962 | 1962 | { |
| 1963 | cpunum_set_input_line | |
| 1963 | cpunum_set_input_line | |
| 1964 | 1964 | } |
| 1965 | 1965 | } |
| 1966 | 1966 | |
| r1591 | r1592 | |
| 2017 | 2017 | static void fds_irq ( int num, int scanline, int vblank, int blanked ) |
| 2018 | 2018 | { |
| 2019 | 2019 | if (IRQ_enable_latch) |
| 2020 | cpunum_set_input_line | |
| 2020 | cpunum_set_input_line | |
| 2021 | 2021 | |
| 2022 | 2022 | /* Increment & check the IRQ scanline counter */ |
| 2023 | 2023 | if (IRQ_enable) |
| 2024 | 2024 | { |
| 2025 | 2025 | if (IRQ_count <= 114) |
| 2026 | 2026 | { |
| 2027 | cpunum_set_input_line | |
| 2027 | cpunum_set_input_line | |
| 2028 | 2028 | IRQ_enable = 0; |
| 2029 | 2029 | nes_fds.status0 |= 0x01; |
| 2030 | 2030 | } |
| r1591 | r1592 | |
| 2135 | 2135 | { |
| 2136 | 2136 | IRQ_count = IRQ_count_latch; |
| 2137 | 2137 | IRQ_enable = IRQ_enable_latch; |
| 2138 | cpunum_set_input_line | |
| 2138 | cpunum_set_input_line | |
| 2139 | 2139 | } |
| 2140 | 2140 | } |
| 2141 | 2141 | |
| r1591 | r1592 | |
| 2802 | 2802 | { |
| 2803 | 2803 | if (--IRQ_count == 0) |
| 2804 | 2804 | { |
| 2805 | cpunum_set_input_line | |
| 2805 | cpunum_set_input_line | |
| 2806 | 2806 | } |
| 2807 | 2807 | } |
| 2808 | 2808 | } |
| r1591 | r1592 | |
| 3246 | 3246 | if (IRQ_enable) |
| 3247 | 3247 | { |
| 3248 | 3248 | if (--IRQ_count == 0) |
| 3249 | cpunum_set_input_line | |
| 3249 | cpunum_set_input_line | |
| 3250 | 3250 | } |
| 3251 | 3251 | } |
| 3252 | 3252 | |
| r1591 | r1592 | |
| 3324 | 3324 | { |
| 3325 | 3325 | if (IRQ_count <= 114) |
| 3326 | 3326 | { |
| 3327 | cpunum_set_input_line | |
| 3327 | cpunum_set_input_line | |
| 3328 | 3328 | } |
| 3329 | 3329 | IRQ_count -= 114; |
| 3330 | 3330 | } |
| r1591 | r1592 | |
| 4324 | 4324 | if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount) |
| 4325 | 4325 | { |
| 4326 | 4326 | logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(0), video_screen_get_hpos(0)); |
| 4327 | cpunum_set_input_line | |
| 4327 | cpunum_set_input_line | |
| 4328 | 4328 | } |
| 4329 | 4329 | } |
| 4330 | 4330 | } |
| r1591 | r1592 | |
| 4830 | 4830 | if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount) |
| 4831 | 4831 | { |
| 4832 | 4832 | logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(0), video_screen_get_hpos(0)); |
| 4833 | cpunum_set_input_line | |
| 4833 | cpunum_set_input_line | |
| 4834 | 4834 | } |
| 4835 | 4835 | } |
| 4836 | 4836 | } |
| r1591 | r1592 | |
|---|---|---|
| 353 | 353 | vc1541->head.ready=0; |
| 354 | 354 | vc1541->head.sync=0; |
| 355 | 355 | if (vc1541->type==TypeVC1541) { |
| 356 | cpunum_set_input_line(vc1541->cpunumber, M6502_SET_OVERFLOW, 1); | |
| 356 | cpunum_set_input_line(Machine, vc1541->cpunumber, M6502_SET_OVERFLOW, 1); | |
| 357 | 357 | via_3_ca1_w(0,1); |
| 358 | 358 | } |
| 359 | 359 | return; |
| r1591 | r1592 | |
| 377 | 377 | vc1541->head.sync=0; |
| 378 | 378 | } |
| 379 | 379 | if (vc1541->type==TypeVC1541) { |
| 380 | cpunum_set_input_line(vc1541->cpunumber, M6502_SET_OVERFLOW, 0); | |
| 380 | cpunum_set_input_line(Machine, vc1541->cpunumber, M6502_SET_OVERFLOW, 0); | |
| 381 | 381 | via_3_ca1_w(0,0); |
| 382 | 382 | } |
| 383 | 383 | vc1541->clock=0; |
| r1591 | r1592 | |
| 402 | 402 | { |
| 403 | 403 | vc1541->via0irq = level; |
| 404 | 404 | DBG_LOG(2, "vc1541 via0 irq",("level %d %d\n",vc1541->via0irq,vc1541->via1irq)); |
| 405 | cpunum_set_input_line (vc1541->cpunumber, | |
| 405 | cpunum_set_input_line (Machine, vc1541->cpunumber, | |
| 406 | 406 | M6502_IRQ_LINE, vc1541->via1irq || vc1541->via0irq); |
| 407 | 407 | } |
| 408 | 408 | |
| r1591 | r1592 | |
| 501 | 501 | { |
| 502 | 502 | vc1541->via1irq = level; |
| 503 | 503 | DBG_LOG(2, "vc1541 via1 irq",("level %d %d\n",vc1541->via0irq,vc1541->via1irq)); |
| 504 | cpunum_set_input_line (vc1541->cpunumber, | |
| 504 | cpunum_set_input_line (Machine, vc1541->cpunumber, | |
| 505 | 505 | M6502_IRQ_LINE, vc1541->via1irq || vc1541->via0irq); |
| 506 | 506 | } |
| 507 | 507 | |
| r1591 | r1592 | |
| 811 | 811 | */ |
| 812 | 812 | static TIMER_CALLBACK(c1551_timer) |
| 813 | 813 | { |
| 814 | cpunum_set_input_line(vc1541->cpunumber, M6502_IRQ_LINE, PULSE_LINE); | |
| 814 | cpunum_set_input_line(machine, vc1541->cpunumber, M6502_IRQ_LINE, PULSE_LINE); | |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | /* |
| r1591 | r1592 | |
|---|---|---|
| 70 | 70 | if ( old && !thom_irq ) |
| 71 | 71 | LOG_IRQ(( "%f thom_set_irq: irq line down %i\n", attotime_to_double(timer_get_time()), line )); |
| 72 | 72 | |
| 73 | cpunum_set_input_line( 0, M6809_IRQ_LINE, thom_irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 73 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, thom_irq ? ASSERT_LINE : CLEAR_LINE ); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| r1591 | r1592 | |
| 89 | 89 | if ( old && !thom_firq ) |
| 90 | 90 | LOG_IRQ(( "%f thom_set_firq: firq line down %i\n", attotime_to_double(timer_get_time()), line )); |
| 91 | 91 | |
| 92 | cpunum_set_input_line( 0, M6809_FIRQ_LINE, thom_firq ? ASSERT_LINE : CLEAR_LINE ); | |
| 92 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, thom_firq ? ASSERT_LINE : CLEAR_LINE ); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| r1591 | r1592 | |
| 98 | 98 | { |
| 99 | 99 | thom_irq = 0; |
| 100 | 100 | thom_firq = 0; |
| 101 | cpunum_set_input_line( 0, M6809_IRQ_LINE, CLEAR_LINE ); | |
| 102 | cpunum_set_input_line( 0, M6809_FIRQ_LINE, CLEAR_LINE ); | |
| 101 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE ); | |
| 102 | cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE ); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 |
| r1591 | r1592 | |
|---|---|---|
| 222 | 222 | |
| 223 | 223 | /*if (RSIR) |
| 224 | 224 | // serial interrupt |
| 225 | cpunum_set_input_line_and_vector(0, M68K_IRQ_6, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 225 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_6, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 226 | 226 | else if (int0) |
| 227 | 227 | // external interrupt |
| 228 | cpunum_set_input_line_and_vector(0, M68K_IRQ_5, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 228 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_5, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 229 | 229 | else if (int1) |
| 230 | 230 | // external interrupt |
| 231 | cpunum_set_input_line_and_vector(0, M68K_IRQ_4, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 231 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_4, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 232 | 232 | else if (int2) |
| 233 | 233 | // external interrupt |
| 234 | cpunum_set_input_line_and_vector(0, M68K_IRQ_3, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 234 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_3, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 235 | 235 | else*/ if (KBIR) |
| 236 | 236 | /* COPS VIA interrupt */ |
| 237 | cpunum_set_input_line_and_vector(0, M68K_IRQ_2, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 237 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_2, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 238 | 238 | else if (FDIR || VTIR) |
| 239 | 239 | /* floppy disk or VBl */ |
| 240 | cpunum_set_input_line_and_vector(0, M68K_IRQ_1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 240 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 241 | 241 | else |
| 242 | 242 | /* clear all interrupts */ |
| 243 | cpunum_set_input_line_and_vector(0, M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 243 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | static void set_parity_error_pending(int value) |
| r1591 | r1592 | |
| 250 | 250 | parity_error_pending = value; |
| 251 | 251 | if (parity_error_pending) |
| 252 | 252 | { |
| 253 | cpunum_set_input_line_and_vector(0, M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 253 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 254 | 254 | } |
| 255 | 255 | else |
| 256 | 256 | { |
| 257 | cpunum_set_input_line(0, M68K_IRQ_7, CLEAR_LINE); | |
| 257 | cpunum_set_input_line(machine, 0, M68K_IRQ_7, CLEAR_LINE); | |
| 258 | 258 | } |
| 259 | 259 | #else |
| 260 | 260 | /* work-around... */ |
| 261 | 261 | if ((! parity_error_pending) && value) |
| 262 | 262 | { |
| 263 | 263 | parity_error_pending = TRUE; |
| 264 | cpunum_set_input_line_and_vector(0, M68K_IRQ_7, PULSE_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 264 | cpunum_set_input_line_and_vector(Machine, 0, M68K_IRQ_7, PULSE_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 265 | 265 | } |
| 266 | 266 | else if (parity_error_pending && (! value)) |
| 267 | 267 | { |
| r1591 | r1592 | |
| 420 | 420 | #if 0 |
| 421 | 421 | if (keycode == NMIcode) |
| 422 | 422 | { /* generate NMI interrupt */ |
| 423 | cpunum_set_input_line(0, M68K_IRQ_7, PULSE_LINE); | |
| 423 | cpunum_set_input_line(machine, 0, M68K_IRQ_7, PULSE_LINE); | |
| 424 | 424 | cpunum_set_input_line_vector(0, M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR); |
| 425 | 425 | } |
| 426 | 426 | #endif |
| r1591 | r1592 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | static void sym1_irq(int level) |
| 174 | 174 | { |
| 175 | cpunum_set_input_line(0, M6502_IRQ_LINE, level); | |
| 175 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, level); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 |
| r1591 | r1592 | |
|---|---|---|
| 828 | 828 | { |
| 829 | 829 | if ( ( lynx_timer[which].cntrl1 & 0x80 ) && ( which != 4 ) ) { // irq flag handling later |
| 830 | 830 | mikey.data[0x81] |= ( 1 << which ); |
| 831 | cpunum_set_input_line(0, M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 831 | cpunum_set_input_line(Machine, 0, M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 832 | 832 | } |
| 833 | 833 | switch ( which ) { |
| 834 | 834 | case 0: |
| r1591 | r1592 | |
| 990 | 990 | // mikey.data[0x80]|=0x10; |
| 991 | 991 | if (uart.serctl&0x80) { |
| 992 | 992 | mikey.data[0x81]|=0x10; |
| 993 | cpunum_set_input_line(0, M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 993 | cpunum_set_input_line(machine, 0, M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 994 | 994 | } |
| 995 | 995 | } |
| 996 | 996 | |
| r1591 | r1592 | |
| 1096 | 1096 | mikey.data[0x81]&=~data; // clear interrupt source |
| 1097 | 1097 | logerror("mikey write %.2x %.2x\n",offset,data); |
| 1098 | 1098 | if (!mikey.data[0x81]) |
| 1099 | cpunum_set_input_line(0, M65SC02_IRQ_LINE, CLEAR_LINE); | |
| 1099 | cpunum_set_input_line(Machine, 0, M65SC02_IRQ_LINE, CLEAR_LINE); | |
| 1100 | 1100 | break; |
| 1101 | 1101 | |
| 1102 | 1102 | case 0x87: |
| r1591 | r1592 | |
| 1180 | 1180 | int i; |
| 1181 | 1181 | lynx_memory_config_w(0, 0); |
| 1182 | 1182 | |
| 1183 | cpunum_set_input_line(0, M65SC02_IRQ_LINE, CLEAR_LINE); | |
| 1183 | cpunum_set_input_line(machine, 0, M65SC02_IRQ_LINE, CLEAR_LINE); | |
| 1184 | 1184 | |
| 1185 | 1185 | memset(&suzy, 0, sizeof(suzy)); |
| 1186 | 1186 | memset(&mikey, 0, sizeof(mikey)); |
| r1591 | r1592 | |
|---|---|---|
| 317 | 317 | * Every fifth cycle is a wait cycle, so I reduced |
| 318 | 318 | * the overlocking by one fitfth |
| 319 | 319 | */ |
| 320 | cpunum_set_clockscale(0, 0.80); | |
| 320 | cpunum_set_clockscale(Machine, 0, 0.80); | |
| 321 | 321 | |
| 322 | 322 | /* Initialize some patterns to be displayed in graphics mode */ |
| 323 | 323 | for( i = 0; i < 256; i++ ) |
| r1591 | r1592 | |
| 970 | 970 | if( (irq_status & IRQ_TIMER) == 0 ) |
| 971 | 971 | { |
| 972 | 972 | irq_status |= IRQ_TIMER; |
| 973 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 973 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 974 | 974 | } |
| 975 | 975 | } |
| 976 | 976 | |
| r1591 | r1592 | |
| 979 | 979 | if( (irq_status & IRQ_FDC) == 0 ) |
| 980 | 980 | { |
| 981 | 981 | irq_status |= IRQ_FDC; |
| 982 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 982 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 |
| r1591 | r1592 | |
|---|---|---|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | data = (status & 0x10)>>4; |
| 491 | cpunum_set_input_line(0, 0, data); | |
| 492 | cpunum_set_input_line(0, INPUT_LINE_NMI, data); | |
| 493 | cpunum_set_input_line(0, INPUT_LINE_HALT, 0); | |
| 491 | cpunum_set_input_line(Machine, 0, 0, data); | |
| 492 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, data); | |
| 493 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, 0); | |
| 494 | 494 | |
| 495 | 495 | spectrum_page_basicrom(); |
| 496 | 496 | |
| r1591 | r1592 | |
| 591 | 591 | set_last_border_color(pSnapshot[26] & 0x07); |
| 592 | 592 | force_border_redraw(); |
| 593 | 593 | |
| 594 | cpunum_set_input_line(0, 0, data); | |
| 595 | cpunum_set_input_line(0, INPUT_LINE_NMI, data); | |
| 596 | cpunum_set_input_line(0, INPUT_LINE_HALT, 0); | |
| 594 | cpunum_set_input_line(Machine, 0, 0, data); | |
| 595 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, data); | |
| 596 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, 0); | |
| 597 | 597 | |
| 598 | 598 | if (SnapshotSize == 49179) |
| 599 | 599 | /* 48K Snapshot */ |
| r1591 | r1592 | |
| 899 | 899 | /* cpunum_set_reg(0, Z80_IRQ_STATE, 1); */ |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | cpunum_set_input_line(0, 0, data); | |
| 903 | cpunum_set_input_line(0, INPUT_LINE_NMI, data); | |
| 904 | cpunum_set_input_line(0, INPUT_LINE_HALT, 0); | |
| 902 | cpunum_set_input_line(Machine, 0, 0, data); | |
| 903 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, data); | |
| 904 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, 0); | |
| 905 | 905 | |
| 906 | 906 | /* IFF2 */ |
| 907 | 907 | if (pSnapshot[28] != 0) |
| r1591 | r1592 | |
|---|---|---|
| 71 | 71 | /* Scanline interrupt enabled ? */ |
| 72 | 72 | if ((screen_interrupts_enabled) && (screen_interrupt_mode == 0) |
| 73 | 73 | && (CurrentScan == NextScanInt)) |
| 74 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 74 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | WRITE8_HANDLER( astrocade_interrupt_vector_w ) |
| 78 | 78 | { |
| 79 | 79 | cpunum_set_input_line_vector(0, 0, data); |
| 80 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 80 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 81 | 81 | } |
| 82 | 82 |
| r1591 | r1592 | |
|---|---|---|
| 343 | 343 | static void inta_callback(int state) |
| 344 | 344 | { |
| 345 | 345 | tms9901_set_single_int(0, 1, state); |
| 346 | cpunum_set_input_line(0, 1, state ? ASSERT_LINE : CLEAR_LINE); | |
| 346 | cpunum_set_input_line(Machine, 0, 1, state ? ASSERT_LINE : CLEAR_LINE); | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | /* |
| r1591 | r1592 | |
| 1341 | 1341 | static void tms9901_interrupt_callback(int intreq, int ic) |
| 1342 | 1342 | { |
| 1343 | 1343 | /* INTREQ is connected to INT1 (IC0-3 are not connected) */ |
| 1344 | cpunum_set_input_line(0, 0, intreq ? ASSERT_LINE : CLEAR_LINE); | |
| 1344 | cpunum_set_input_line(Machine, 0, 0, intreq ? ASSERT_LINE : CLEAR_LINE); | |
| 1345 | 1345 | } |
| 1346 | 1346 | |
| 1347 | 1347 | /* |
| r1591 | r1592 | |
|---|---|---|
| 510 | 510 | memory_set_context(0); |
| 511 | 511 | c128_bankswitch_z80(); |
| 512 | 512 | memory_set_context(1); |
| 513 | cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 514 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 513 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 514 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 515 | 515 | } |
| 516 | 516 | else |
| 517 | 517 | { |
| r1591 | r1592 | |
| 520 | 520 | memory_set_context(1); |
| 521 | 521 | c128_bankswitch_128(reset); |
| 522 | 522 | memory_set_context(0); |
| 523 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 524 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 523 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE); | |
| 524 | cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 525 | 525 | |
| 526 | 526 | /* NPW 19-Nov-2005 - In the C128, CPU #0 starts out and hands over |
| 527 | 527 | * control to CPU #1. CPU #1 seems to execute garbage from 0x0000 |
| r1591 | r1592 | |
| 831 | 831 | |
| 832 | 832 | c64mode = 0; |
| 833 | 833 | c128_mmu8722_reset (); |
| 834 | cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 835 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 834 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE); | |
| 835 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | VIDEO_START( c128 ) |
| r1591 | r1592 | |
|---|---|---|
| 32 | 32 | if (val != ti->cur_val) |
| 33 | 33 | { |
| 34 | 34 | ti->cur_val = val; |
| 35 | cpunum_set_clockscale(ti->cpunum, val ? ti->on_speed : ti->off_speed); | |
| 35 | cpunum_set_clockscale(machine, ti->cpunum, val ? ti->on_speed : ti->off_speed); | |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 |
| r1591 | r1592 | |
|---|---|---|
| 428 | 428 | if (!reset_flag) { |
| 429 | 429 | reset_flag = 1; |
| 430 | 430 | /* using PULSE_LINE does not allow us to press and hold key */ |
| 431 | cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 431 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 432 | 432 | } |
| 433 | 433 | return; |
| 434 | 434 | } |
| 435 | 435 | if (reset_flag) |
| 436 | 436 | { |
| 437 | 437 | reset_flag = 0; |
| 438 | cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 438 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 439 | 439 | mame_schedule_soft_reset(Machine); |
| 440 | 440 | } |
| 441 | 441 |
| r1591 | r1592 | |
|---|---|---|
| 122 | 122 | } |
| 123 | 123 | if (level >= 0 && level<interrupt_level_reg) |
| 124 | 124 | { |
| 125 | cpunum_set_input_line | |
| 125 | cpunum_set_input_line | |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| r1591 | r1592 | |
| 793 | 793 | /* callback for /INT output from FDC */ |
| 794 | 794 | static void pc8801_fdc_interrupt(int state) |
| 795 | 795 | { |
| 796 | cpunum_set_input_line | |
| 796 | cpunum_set_input_line | |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | 799 | /* callback for /DRQ output from FDC */ |
| r1591 | r1592 | |
|---|---|---|
| 96 | 96 | { |
| 97 | 97 | DBG_LOG (3, "mos6502", ("irq %s\n", level ? "start" : "end")); |
| 98 | 98 | if (superpet) |
| 99 | cpunum_set_input_line (1, M6809_IRQ_LINE, level); | |
| 100 | cpunum_set_input_line (0, M6502_IRQ_LINE, level); | |
| 99 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, level); | |
| 100 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, level); | |
| 101 | 101 | old_level = level; |
| 102 | 102 | } |
| 103 | 103 | } |
| r1591 | r1592 | |
| 553 | 553 | spet.rom = 0; |
| 554 | 554 | if (M6809_SELECT) |
| 555 | 555 | { |
| 556 | cpunum_set_input_line(0, INPUT_LINE_HALT, 1); | |
| 557 | cpunum_set_input_line(0, INPUT_LINE_HALT, 0); | |
| 556 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, 1); | |
| 557 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, 0); | |
| 558 | 558 | pet_font = 2; |
| 559 | 559 | } |
| 560 | 560 | else |
| 561 | 561 | { |
| 562 | cpunum_set_input_line(0, INPUT_LINE_HALT, 0); | |
| 563 | cpunum_set_input_line(0, INPUT_LINE_HALT, 1); | |
| 562 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, 0); | |
| 563 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, 1); | |
| 564 | 564 | pet_font = 0; |
| 565 | 565 | } |
| 566 | 566 | } |
| r1591 | r1592 | |
| 601 | 601 | if (superpet) |
| 602 | 602 | { |
| 603 | 603 | if (M6809_SELECT) { |
| 604 | cpunum_set_input_line(0, INPUT_LINE_HALT,1); | |
| 605 | cpunum_set_input_line(0, INPUT_LINE_HALT, 0); | |
| 604 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT,1); | |
| 605 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, 0); | |
| 606 | 606 | pet_font|=2; |
| 607 | 607 | } else { |
| 608 | cpunum_set_input_line(0, INPUT_LINE_HALT,0); | |
| 609 | cpunum_set_input_line(0, INPUT_LINE_HALT, 1); | |
| 608 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT,0); | |
| 609 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, 1); | |
| 610 | 610 | pet_font&=~2; |
| 611 | 611 | } |
| 612 | 612 | } |
| r1591 | r1592 | |
|---|---|---|
| 375 | 375 | if (level != old_level) |
| 376 | 376 | { |
| 377 | 377 | DBG_LOG (3, "mos7501", ("irq %s\n", level ? "start" : "end")); |
| 378 | cpunum_set_input_line | |
| 378 | cpunum_set_input_line | |
| 379 | 379 | old_level = level; |
| 380 | 380 | } |
| 381 | 381 | } |
| r1591 | r1592 | |
|---|---|---|
| 83 | 83 | /* any irq set? */ |
| 84 | 84 | if ((oric_irqs & 0x0f)!=0) |
| 85 | 85 | { |
| 86 | cpunum_set_input_line(0,0, HOLD_LINE); | |
| 86 | cpunum_set_input_line(Machine, 0,0, HOLD_LINE); | |
| 87 | 87 | } |
| 88 | 88 | else |
| 89 | 89 | { |
| 90 | cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 90 | cpunum_set_input_line(Machine, 0,0, CLEAR_LINE); | |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 |
| r1591 | r1592 | |
|---|---|---|
| 115 | 115 | break; |
| 116 | 116 | case 4: |
| 117 | 117 | switch(data&0xc0) { |
| 118 | case 0x00: cpunum_set_clockscale(0, 1.0/2);break; | |
| 119 | case 0x40: cpunum_set_clockscale(0, 3.0/4);break; | |
| 120 | default: cpunum_set_clockscale(0, 1);break; | |
| 118 | case 0x00: cpunum_set_clockscale(Machine, 0, 1.0/2);break; | |
| 119 | case 0x40: cpunum_set_clockscale(Machine, 0, 3.0/4);break; | |
| 120 | default: cpunum_set_clockscale(Machine, 0, 1);break; | |
| 121 | 121 | } |
| 122 | 122 | break; |
| 123 | 123 | case 0xa: |
| r1591 | r1592 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | if (state) |
| 45 | 45 | { |
| 46 | cpunum_set_input_line(0,0, HOLD_LINE); | |
| 46 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 47 | 47 | } |
| 48 | 48 | else |
| 49 | 49 | { |
| 50 | cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 50 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r1591 | r1592 | |
| 153 | 153 | { |
| 154 | 154 | /* I'll pulse it because if I used hold-line I'm not sure |
| 155 | 155 | it would clear - to be checked */ |
| 156 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 156 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 |
| r1591 | r1592 | |
|---|---|---|
| 31 | 31 | static void at_set_gate_a20(int a20) |
| 32 | 32 | { |
| 33 | 33 | /* set the CPU's A20 line */ |
| 34 | cpunum_set_input_line(0, INPUT_LINE_A20, a20); | |
| 34 | cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 |
| r1591 | r1592 | |
|---|---|---|
| 56 | 56 | */ |
| 57 | 57 | static void vc20_via0_irq (int level) |
| 58 | 58 | { |
| 59 | cpunum_set_input_line(0, INPUT_LINE_NMI, level); | |
| 59 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, level); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static READ8_HANDLER( vc20_via0_read_ca1 ) |
| r1591 | r1592 | |
| 120 | 120 | */ |
| 121 | 121 | static void vc20_via1_irq (int level) |
| 122 | 122 | { |
| 123 | cpunum_set_input_line | |
| 123 | cpunum_set_input_line | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static READ8_HANDLER( vc20_via1_read_porta ) |
| r1591 | r1592 | |
|---|---|---|
| 250 | 250 | } |
| 251 | 251 | if ( ula.interrupt_status & ula.interrupt_control & ~0x83 ) { |
| 252 | 252 | ula.interrupt_status |= 0x01; |
| 253 | cpunum_set_input_line( 0, 0, ASSERT_LINE ); | |
| 253 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE ); | |
| 254 | 254 | } else { |
| 255 | 255 | ula.interrupt_status &= ~0x01; |
| 256 | cpunum_set_input_line( 0, 0, CLEAR_LINE ); | |
| 256 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE ); | |
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 |
| r1591 | r1592 | |
|---|---|---|
| 303 | 303 | if (!reset_flag) { |
| 304 | 304 | reset_flag = 1; |
| 305 | 305 | /* using PULSE_LINE does not allow us to press and hold key */ |
| 306 | cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 306 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE); | |
| 307 | 307 | pia_reset(); |
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | else if (reset_flag) { |
| 311 | 311 | /* RESET released--allow the processor to continue. */ |
| 312 | 312 | reset_flag = 0; |
| 313 | cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 313 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /* The CLEAR SCREEN switch clears the video hardware. */ |
| r1591 | r1592 | |
|---|---|---|
| 229 | 229 | (crossproc_map[i].inputline == PPC_INPUT_LINE_SMI) ? "SMI" : "TLBISYNC"); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | cpunum_set_input_line(crossproc_map[i].cpunum, crossproc_map[i].inputline, line); | |
| 232 | cpunum_set_input_line(Machine, crossproc_map[i].cpunum, crossproc_map[i].inputline, line); | |
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | } |
| r1591 | r1592 | |
| 240 | 240 | |
| 241 | 241 | if (b & 0x20) |
| 242 | 242 | { |
| 243 | cpunum_set_input_line(1, INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 243 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| r1591 | r1592 | |
| 260 | 260 | bebox_interrupts, bebox_cpu_imask[cpunum], interrupt ? "on" : "off"); |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | cpunum_set_input_line(cpunum, INPUT_LINE_IRQ0, interrupt ? ASSERT_LINE : CLEAR_LINE); | |
| 263 | cpunum_set_input_line(Machine, cpunum, INPUT_LINE_IRQ0, interrupt ? ASSERT_LINE : CLEAR_LINE); | |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| r1591 | r1592 | |
| 972 | 972 | |
| 973 | 973 | MACHINE_RESET( bebox ) |
| 974 | 974 | { |
| 975 | cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 976 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 975 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); | |
| 976 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 977 | 977 | ide_controller_reset(0); |
| 978 | 978 | } |
| 979 | 979 |
| r1591 | r1592 | |
|---|---|---|
| 189 | 189 | static void mtx_ctc_interrupt(int state) |
| 190 | 190 | { |
| 191 | 191 | // logerror("mtx_ctc_interrupt: %02x\n", state); |
| 192 | cpunum_set_input_line(0, 0, state); | |
| 192 | cpunum_set_input_line(Machine, 0, 0, state); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | READ8_HANDLER( mtx_ctc_r ) |
| r1591 | r1592 | |
|---|---|---|
| 139 | 139 | /* The 6502 IRQ line is active low and probably driven |
| 140 | 140 | by open collector outputs (guess). Since MAME/MESS use |
| 141 | 141 | a non-0 value for ASSERT_LINE we OR the signals here */ |
| 142 | cpunum_set_input_line(0, 0, via_0_irq_line | via_1_irq_line | kbd_irq_line); | |
| 142 | cpunum_set_input_line(Machine, 0, 0, via_0_irq_line | via_1_irq_line | kbd_irq_line); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | static mess_image *cassette_device_image(void) |
| r1591 | r1592 | |
| 423 | 423 | /* This callback is called one clock cycle after BFF2 is written (delayed nmi) */ |
| 424 | 424 | static TIMER_CALLBACK(microtan_pulse_nmi) |
| 425 | 425 | { |
| 426 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 426 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | WRITE8_HANDLER ( microtan_bffx_w ) |
| r1591 | r1592 | |
|---|---|---|
| 429 | 429 | |
| 430 | 430 | static TIMER_CALLBACK(intv_interrupt_complete) |
| 431 | 431 | { |
| 432 | cpunum_set_input_line(0, CP1610_INT_INTRM, CLEAR_LINE); | |
| 432 | cpunum_set_input_line(machine, 0, CP1610_INT_INTRM, CLEAR_LINE); | |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | INTERRUPT_GEN( intv_interrupt ) |
| 436 | 436 | { |
| 437 | cpunum_set_input_line(0, CP1610_INT_INTRM, ASSERT_LINE); | |
| 437 | cpunum_set_input_line(machine, 0, CP1610_INT_INTRM, ASSERT_LINE); | |
| 438 | 438 | sr1_int_pending = 1; |
| 439 | 439 | timer_set(ATTOTIME_IN_CYCLES(3791, 0), NULL, 0, intv_interrupt_complete); |
| 440 | 440 | stic_screenrefresh(); |
| r1591 | r1592 | |
|---|---|---|
| 84 | 84 | static TIMER_CALLBACK( amiga_ar1_delayed_nmi ) |
| 85 | 85 | { |
| 86 | 86 | (void)param; |
| 87 | cpunum_set_input_line(0, 7, PULSE_LINE); | |
| 87 | cpunum_set_input_line(Machine, 0, 7, PULSE_LINE); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static void amiga_ar1_nmi( void ) |
| r1591 | r1592 | |
| 280 | 280 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, 0, amiga_ar23_chipmem_w); |
| 281 | 281 | |
| 282 | 282 | /* trigger NMI irq */ |
| 283 | cpunum_set_input_line(0, 7, PULSE_LINE); | |
| 283 | cpunum_set_input_line(Machine, 0, 7, PULSE_LINE); | |
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 |
| r1591 | r1592 | |
|---|---|---|
| 229 | 229 | //logerror("Changing irq state; pia_0_irq_state = %s, pia_1_irq_state = %s\n", osborne1.pia_0_irq_state ? "SET" : "CLEARED", osborne1.pia_1_irq_state ? "SET" : "CLEARED" ); |
| 230 | 230 | |
| 231 | 231 | if ( osborne1.pia_1_irq_state ) { |
| 232 | cpunum_set_input_line( 0, 0, ASSERT_LINE ); | |
| 232 | cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE ); | |
| 233 | 233 | } else { |
| 234 | cpunum_set_input_line( 0, 0, CLEAR_LINE ); | |
| 234 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE ); | |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 |
| r1591 | r1592 | |
|---|---|---|
| 283 | 283 | if ( ! IS_GAMEGEAR ) { |
| 284 | 284 | if ( ! (readinputport(2) & 0x80) ) { |
| 285 | 285 | if ( ! smsPaused ) { |
| 286 | cpunum_set_input_line( 0, INPUT_LINE_NMI, ASSERT_LINE ); | |
| 287 | cpunum_set_input_line( 0, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 286 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE ); | |
| 287 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 288 | 288 | } |
| 289 | 289 | smsPaused = 1; |
| 290 | 290 | } else { |
| r1591 | r1592 | |
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | void sms_int_callback( int state ) { |
| 1006 | cpunum_set_input_line( 0, 0, state ); | |
| 1006 | cpunum_set_input_line(Machine, 0, 0, state ); | |
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | void sms_store_int_callback( int state ) { |
| 1010 | cpunum_set_input_line( sms_store_control & 0x01 ? 1 : 0, 0, state ); | |
| 1010 | cpunum_set_input_line(Machine, sms_store_control & 0x01 ? 1 : 0, 0, state ); | |
| 1011 | 1011 | } |
| 1012 | 1012 |
| r1591 | r1592 | |
|---|---|---|
| 614 | 614 | if( (irq_status & IRQ_TIMER) == 0 ) |
| 615 | 615 | { |
| 616 | 616 | irq_status |= IRQ_TIMER; |
| 617 | cpunum_set_input_line | |
| 617 | cpunum_set_input_line | |
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | |
| r1591 | r1592 | |
| 623 | 623 | if ((irq_status & IRQ_FDC) == 0) |
| 624 | 624 | { |
| 625 | 625 | irq_status |= IRQ_FDC; |
| 626 | cpunum_set_input_line | |
| 626 | cpunum_set_input_line | |
| 627 | 627 | } |
| 628 | 628 | } |
| 629 | 629 |
| r1591 | r1592 | |
|---|---|---|
| 772 | 772 | irq_freq = 1; |
| 773 | 773 | |
| 774 | 774 | if (irq_freq) |
| 775 | cpunum_set_input_line(0, M6502_IRQ_LINE, PULSE_LINE); | |
| 775 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, PULSE_LINE); | |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | 778 | video_screen_update_partial(0, scanline); |
| r1591 | r1592 | |
|---|---|---|
| 188 | 188 | break; |
| 189 | 189 | case 2: |
| 190 | 190 | tandy_ppi.portc = data; |
| 191 | if (data&8) cpunum_set_clockscale(0, 1); | |
| 192 | else cpunum_set_clockscale(0, 4.77/8); | |
| 191 | if (data&8) cpunum_set_clockscale(Machine, 0, 1); | |
| 192 | else cpunum_set_clockscale(Machine, 0, 4.77/8); | |
| 193 | 193 | break; |
| 194 | 194 | } |
| 195 | 195 | } |
| r1591 | r1592 | |
|---|---|---|
| 37 | 37 | INTERRUPT_GEN( primo_vblank_interrupt ) |
| 38 | 38 | { |
| 39 | 39 | if (primo_nmi) |
| 40 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 40 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /******************************************************************************* |
| r1591 | r1592 | |
| 243 | 243 | if (readinputport(6)) |
| 244 | 244 | primo_port_FD = 0x00; |
| 245 | 245 | primo_update_memory(); |
| 246 | cpunum_set_clockscale(0, readinputport(5) ? 1.5 : 1.0); | |
| 246 | cpunum_set_clockscale(Machine, 0, readinputport(5) ? 1.5 : 1.0); | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | MACHINE_RESET( primoa ) |
| r1591 | r1592 | |
|---|---|---|
| 114 | 114 | { |
| 115 | 115 | if (ti85_ON_interrupt_mask && !ti85_ON_pressed) |
| 116 | 116 | { |
| 117 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 117 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 118 | 118 | ti85_ON_interrupt_status = 1; |
| 119 | 119 | if (!ti85_timer_interrupt_mask) ti85_timer_interrupt_mask = 1; |
| 120 | 120 | } |
| r1591 | r1592 | |
| 125 | 125 | ti85_ON_pressed = 0; |
| 126 | 126 | if (ti85_timer_interrupt_mask) |
| 127 | 127 | { |
| 128 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 128 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 129 | 129 | ti85_timer_interrupt_status = 1; |
| 130 | 130 | } |
| 131 | 131 | } |
| r1591 | r1592 | |
| 529 | 529 | |
| 530 | 530 | activecpu_set_input_line(0, 0); |
| 531 | 531 | activecpu_set_input_line(INPUT_LINE_NMI, 0); |
| 532 | cpunum_set_input_line(0, INPUT_LINE_HALT, 0); | |
| 532 | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, 0); | |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | static void ti85_setup_snapshot (UINT8 * data) |
| r1591 | r1592 | |
|---|---|---|
| 101 | 101 | if (cpu_getactivecpu()==0) |
| 102 | 102 | { |
| 103 | 103 | /* z80 */ |
| 104 | cpunum_set_input_line(0, INPUT_LINE_NMI, KEY_RESTORE||cia1irq); | |
| 104 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, KEY_RESTORE||cia1irq); | |
| 105 | 105 | } |
| 106 | 106 | else |
| 107 | 107 | { |
| 108 | cpunum_set_input_line(1, INPUT_LINE_NMI, KEY_RESTORE||cia1irq); | |
| 108 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, KEY_RESTORE||cia1irq); | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | else |
| 112 | 112 | { |
| 113 | cpunum_set_input_line(0, INPUT_LINE_NMI, KEY_RESTORE||cia1irq); | |
| 113 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, KEY_RESTORE||cia1irq); | |
| 114 | 114 | } |
| 115 | 115 | nmilevel = KEY_RESTORE||cia1irq; |
| 116 | 116 | } |
| r1591 | r1592 | |
| 302 | 302 | { |
| 303 | 303 | if (0&&(cpu_getactivecpu()==0)) |
| 304 | 304 | { |
| 305 | cpunum_set_input_line | |
| 305 | cpunum_set_input_line | |
| 306 | 306 | } |
| 307 | 307 | else |
| 308 | 308 | { |
| 309 | cpunum_set_input_line | |
| 309 | cpunum_set_input_line | |
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | else |
| 313 | 313 | { |
| 314 | cpunum_set_input_line | |
| 314 | cpunum_set_input_line | |
| 315 | 315 | } |
| 316 | 316 | old_level = level; |
| 317 | 317 | } |
| r1591 | r1592 | |
|---|---|---|
| 204 | 204 | // Burst transfers will halt the CPU until the transfer is complete |
| 205 | 205 | if((dmac.reg[channel].dcr & 0xc0) == 0x00) // Burst transfer |
| 206 | 206 | { |
| 207 | cpunum_set_input_line(dmac.intf->cpu,INPUT_LINE_HALT,ASSERT_LINE); | |
| 207 | cpunum_set_input_line(Machine, dmac.intf->cpu,INPUT_LINE_HALT,ASSERT_LINE); | |
| 208 | 208 | timer_adjust(dmac.timer[channel],attotime_zero,channel, dmac.intf->burst_clock[channel]); |
| 209 | 209 | } |
| 210 | 210 | else |
| r1591 | r1592 | |
| 367 | 367 | dmac.reg[x].csr |= 0xe0; // channel operation complete, block transfer complete |
| 368 | 368 | dmac.reg[x].csr &= ~0x08; // channel no longer active |
| 369 | 369 | if((dmac.reg[x].dcr & 0xc0) == 0x00) // Burst transfer |
| 370 | cpunum_set_input_line(dmac.intf->cpu,INPUT_LINE_HALT,CLEAR_LINE); | |
| 370 | cpunum_set_input_line(Machine, dmac.intf->cpu,INPUT_LINE_HALT,CLEAR_LINE); | |
| 371 | 371 | |
| 372 | 372 | if(dmac.intf->dma_end) |
| 373 | 373 | dmac.intf->dma_end(x,dmac.reg[x].ccr & 0x08); |
| r1591 | r1592 | |
|---|---|---|
| 1187 | 1187 | // write 0100 requests z80 bus (z80 paused) |
| 1188 | 1188 | if (data == 0x0000) |
| 1189 | 1189 | { |
| 1190 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1190 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE); | |
| 1191 | 1191 | genesis_68k_has_z80_bus = 0; |
| 1192 | 1192 | // logerror("-- z80 running %04x\n",data); |
| 1193 | 1193 | |
| r1591 | r1592 | |
| 1195 | 1195 | |
| 1196 | 1196 | if (data == 0x0100) |
| 1197 | 1197 | { |
| 1198 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1198 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 1199 | 1199 | genesis_68k_has_z80_bus = 1; |
| 1200 | 1200 | // logerror("-- z80 stopped %04x\n",data); |
| 1201 | 1201 | |
| r1591 | r1592 | |
| 1212 | 1212 | |
| 1213 | 1213 | if (data == 0x0000) |
| 1214 | 1214 | { |
| 1215 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1215 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 1216 | 1216 | genesis_z80_is_reset = 1; |
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | if (data == 0x0100) |
| 1220 | 1220 | { |
| 1221 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1221 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 1222 | 1222 | genesis_z80_is_reset = 0; |
| 1223 | 1223 | } |
| 1224 | 1224 | } |
| r1591 | r1592 | |
| 2275 | 2275 | // if (!irqlevel) |
| 2276 | 2276 | irqlevel = 6; |
| 2277 | 2277 | |
| 2278 | cpunum_set_input_line(1,0, HOLD_LINE); // z80 interrupt, always? | |
| 2278 | cpunum_set_input_line(machine, 1,0, HOLD_LINE); // z80 interrupt, always? | |
| 2279 | 2279 | } |
| 2280 | 2280 | |
| 2281 | 2281 | |
| r1591 | r1592 | |
| 2285 | 2285 | genesis_vdp_draw_scanline(&genesis_vdp,genesis_vdp.sline); |
| 2286 | 2286 | } |
| 2287 | 2287 | |
| 2288 | cpunum_set_input_line(0,irqlevel, HOLD_LINE); | |
| 2288 | cpunum_set_input_line(machine, 0,irqlevel, HOLD_LINE); | |
| 2289 | 2289 | } |
| 2290 | 2290 | |
| 2291 | 2291 | //static void ym3438_interrupt(int state) |
| r1591 | r1592 | |
| 2297 | 2297 | { |
| 2298 | 2298 | // logerror("MACHINE_RESET ( genesis )\n"); |
| 2299 | 2299 | /* prevent the z80 from running (code must be uploaded by the 68k first) */ |
| 2300 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2300 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2301 | 2301 | genesis_z80_is_reset = 1; |
| 2302 | 2302 | |
| 2303 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2303 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2304 | 2304 | genesis_68k_has_z80_bus = 1; |
| 2305 | 2305 | |
| 2306 | 2306 | memset(memory_region(REGION_CPU2), 0xcf, 0x2000); |
| r1591 | r1592 | |
| 2338 | 2338 | // memory_set_bankptr(3,memory_region(REGION_CPU2)); /* BANK3 = mainram */ |
| 2339 | 2339 | |
| 2340 | 2340 | /* prevent the z80 from running (code must be uploaded by the 68k first) */ |
| 2341 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2341 | cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); | |
| 2342 | 2342 | genesis_68k_has_z80_bus = 0; |
| 2343 | 2343 | |
| 2344 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2344 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2345 | 2345 | genesis_z80_is_reset = 1; |
| 2346 | 2346 | |
| 2347 | 2347 | // memset(genesis_z80ram, 0x00, 0x2000); |
| r1591 | r1592 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | static void svi318_uart8250_interrupt(int nr, int state) |
| 67 | 67 | { |
| 68 | cpunum_set_input_line(0, 0, (state ? HOLD_LINE : CLEAR_LINE)); | |
| 68 | cpunum_set_input_line(Machine, 0, 0, (state ? HOLD_LINE : CLEAR_LINE)); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static const uart8250_interface svi318_uart8250_interface[1] = |
| r1591 | r1592 | |
| 535 | 535 | |
| 536 | 536 | void svi318_vdp_interrupt(int i) |
| 537 | 537 | { |
| 538 | cpunum_set_input_line(0, 0, (i ? HOLD_LINE : CLEAR_LINE)); | |
| 538 | cpunum_set_input_line(Machine, 0, 0, (i ? HOLD_LINE : CLEAR_LINE)); | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | DRIVER_INIT( svi318 ) |
| r1591 | r1592 | |
|---|---|---|
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | if ( pce_cd.regs[0x02] & pce_cd.regs[0x03] & ( PCE_CD_IRQ_TRANSFER_DONE | PCE_CD_IRQ_TRANSFER_READY ) ) { |
| 766 | cpunum_set_input_line( 0, 1, ASSERT_LINE ); | |
| 766 | cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE ); | |
| 767 | 767 | } else { |
| 768 | cpunum_set_input_line( 0, 1, CLEAR_LINE ); | |
| 768 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE ); | |
| 769 | 769 | } |
| 770 | 770 | } |
| 771 | 771 |
| r1591 | r1592 | |
|---|---|---|
| 496 | 496 | /* There is a circuitry in TI99/4(a) that resets the console when a |
| 497 | 497 | cartridge is inserted or removed. We emulate this instead of resetting the |
| 498 | 498 | emulator (which is the default in MESS). */ |
| 499 | /*cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 499 | /*cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 500 | 500 | tms9901_reset(0); |
| 501 | 501 | if (! has_evpc) |
| 502 | 502 | TMS9928A_reset(); |
| r1591 | r1592 | |
| 593 | 593 | /* There is a circuitry in TI99/4(a) that resets the console when a |
| 594 | 594 | cartridge is inserted or removed. We emulate this instead of resetting the |
| 595 | 595 | emulator (which is the default in MESS). */ |
| 596 | /*cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 596 | /*cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 597 | 597 | tms9901_reset(0); |
| 598 | 598 | if (! has_evpc) |
| 599 | 599 | TMS9928A_reset(); |
| r1591 | r1592 | |
| 2199 | 2199 | { |
| 2200 | 2200 | /* On TI99, TMS9900 IC0-3 lines are not connected to TMS9901, |
| 2201 | 2201 | * but hard-wired to force level 1 interrupts */ |
| 2202 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, 1); /* interrupt it, baby */ | |
| 2202 | cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, 1); /* interrupt it, baby */ | |
| 2203 | 2203 | } |
| 2204 | 2204 | else |
| 2205 | 2205 | { |
| 2206 | cpunum_set_input_line(0, 0, CLEAR_LINE); | |
| 2206 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 2207 | 2207 | } |
| 2208 | 2208 | } |
| 2209 | 2209 |
| r1591 | r1592 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | INTERRUPT_GEN( galaxy_interrupt ) |
| 48 | 48 | { |
| 49 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 49 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static int galaxy_irq_callback (int cpu) |
| r1591 | r1592 | |
| 118 | 118 | break; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 122 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 121 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 122 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | SNAPSHOT_LOAD( galaxy ) |
| r1591 | r1592 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | static void bbc_setirq(void) |
| 49 | 49 | { |
| 50 | ||
| 50 | | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /************************ |
| r1591 | r1592 | |
| 1513 | 1513 | { |
| 1514 | 1514 | /* I'll pulse it because if I used hold-line I'm not sure |
| 1515 | 1515 | it would clear - to be checked */ |
| 1516 | cpunum_set_input_line(0, INPUT_LINE_NMI,PULSE_LINE); | |
| 1516 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI,PULSE_LINE); | |
| 1517 | 1517 | } |
| 1518 | 1518 | } |
| 1519 | 1519 | |
| r1591 | r1592 | |
| 1678 | 1678 | { |
| 1679 | 1679 | /* I'll pulse it because if I used hold-line I'm not sure |
| 1680 | 1680 | it would clear - to be checked */ |
| 1681 | cpunum_set_input_line(0, INPUT_LINE_NMI,PULSE_LINE); | |
| 1681 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI,PULSE_LINE); | |
| 1682 | 1682 | } |
| 1683 | 1683 | } |
| 1684 | 1684 |
| r1591 | r1592 | |
|---|---|---|
| 186 | 186 | void compis_irq_set(UINT8 irq) |
| 187 | 187 | { |
| 188 | 188 | cpunum_set_input_line_vector(0, 0, irq); |
| 189 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 189 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 190 | 190 | } |
| 191 | 191 | #endif |
| 192 | 192 | |
| r1591 | r1592 | |
| 680 | 680 | /* generate the appropriate interrupt */ |
| 681 | 681 | i186.intr.poll_status = 0x8000 | new_vector; |
| 682 | 682 | if (!i186.intr.pending) |
| 683 | cpunum_set_input_line(2, 0, ASSERT_LINE); | |
| 683 | cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE); | |
| 684 | 684 | i186.intr.pending = 1; |
| 685 | cpu_trigger(CPU_RESUME_TRIGGER); | |
| 685 | cpu_trigger(Machine, CPU_RESUME_TRIGGER); | |
| 686 | 686 | if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n"); |
| 687 | 687 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", attotime_to_double(timer_get_time()), new_vector); |
| 688 | 688 | } |
| r1591 | r1592 | |
| 1541 | 1541 | { |
| 1542 | 1542 | case 0: |
| 1543 | 1543 | /* Master */ |
| 1544 | cpunum_set_input_line(0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); | |
| 1544 | cpunum_set_input_line(Machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); | |
| 1545 | 1545 | break; |
| 1546 | 1546 | |
| 1547 | 1547 | case 1: |
| r1591 | r1592 | |
|---|---|---|
| 150 | 150 | #if 0 |
| 151 | 151 | static void kc85_disc_hw_ctc_interrupt(int state) |
| 152 | 152 | { |
| 153 | cpunum_set_input_line(1, 0, state); | |
| 153 | cpunum_set_input_line(machine, 1, 0, state); | |
| 154 | 154 | } |
| 155 | 155 | #endif |
| 156 | 156 | |
| r1591 | r1592 | |
| 246 | 246 | z80ctc_reset(1); |
| 247 | 247 | |
| 248 | 248 | /* hold cpu at reset */ |
| 249 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 249 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /*****************/ |
| r1591 | r1592 | |
| 1727 | 1727 | |
| 1728 | 1728 | static void kc85_pio_interrupt(int state) |
| 1729 | 1729 | { |
| 1730 | cpunum_set_input_line(0, 0, state); | |
| 1730 | cpunum_set_input_line(Machine, 0, 0, state); | |
| 1731 | 1731 | } |
| 1732 | 1732 | |
| 1733 | 1733 | static void kc85_ctc_interrupt(int state) |
| 1734 | 1734 | { |
| 1735 | cpunum_set_input_line(0, 1, state); | |
| 1735 | cpunum_set_input_line(Machine, 0, 1, state); | |
| 1736 | 1736 | } |
| 1737 | 1737 | |
| 1738 | 1738 | /* callback for ardy output from PIO */ |
| r1591 | r1592 | |
|---|---|---|
| 256 | 256 | #SOUNDS += NAMCONA |
| 257 | 257 | #SOUNDS += TMS36XX |
| 258 | 258 | #SOUNDS += TMS3615 |
| 259 | #SOUNDS += TMS5100 | |
| 259 | 260 | #SOUNDS += TMS5110 |
| 261 | #SOUNDS += TMS5110A | |
| 262 | #SOUNDS += CD2801 | |
| 263 | #SOUNDS += TMC0281 | |
| 264 | #SOUNDS += CD2802 | |
| 265 | #SOUNDS += M58817 | |
| 260 | 266 | #SOUNDS += TMC0285 |
| 261 | 267 | #SOUNDS += TMS5200 |
| 262 | 268 | SOUNDS += TMS5220 |
| r1591 | r1592 | |
| 310 | 316 | SOUNDS += SID6581 |
| 311 | 317 | SOUNDS += SID8580 |
| 312 | 318 | SOUNDS += SP0256 |
| 313 | #SOUNDS += M58817 | |
| 314 | 319 | |
| 315 | 320 | |
| 316 | 321 |
| r1591 | r1592 | |
|---|---|---|
| 306 | 306 | { |
| 307 | 307 | logerror("int set %02x\n",nc_irq_status & nc_irq_mask); |
| 308 | 308 | /* set int */ |
| 309 | cpunum_set_input_line(0,0, HOLD_LINE); | |
| 309 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 310 | 310 | } |
| 311 | 311 | else |
| 312 | 312 | { |
| 313 | 313 | /* clear int */ |
| 314 | cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 314 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| r1591 | r1592 | |
| 532 | 532 | case NC_TYPE_1xx: |
| 533 | 533 | { |
| 534 | 534 | LOG(("nmi triggered\n")); |
| 535 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 535 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 536 | 536 | } |
| 537 | 537 | break; |
| 538 | 538 | |
| r1591 | r1592 | |
| 873 | 873 | { |
| 874 | 874 | /* I'll pulse it because if I used hold-line I'm not sure |
| 875 | 875 | it would clear - to be checked */ |
| 876 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 876 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 877 | 877 | } |
| 878 | 878 | } |
| 879 | 879 |
| r1591 | r1592 | |
|---|---|---|
| 433 | 433 | /* only if it goes up */ |
| 434 | 434 | if (state && !last_state) |
| 435 | 435 | { |
| 436 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 436 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 437 | 437 | } |
| 438 | 438 | last_state = state; |
| 439 | 439 | } |
| r1591 | r1592 | |
| 458 | 458 | adam_joy_stat[1] = 1; |
| 459 | 459 | |
| 460 | 460 | if (adam_joy_stat[0] || adam_joy_stat[1]) |
| 461 | cpunum_set_input_line (0, 0, HOLD_LINE); | |
| 461 | cpunum_set_input_line (Machine, 0, 0, HOLD_LINE); | |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | void set_memory_banks(void) |
| r1591 | r1592 | |
|---|---|---|
| 161 | 161 | { |
| 162 | 162 | if (state) |
| 163 | 163 | { |
| 164 | cpunum_set_input_line(1,0, HOLD_LINE); | |
| 164 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 165 | 165 | } |
| 166 | 166 | else |
| 167 | 167 | { |
| 168 | cpunum_set_input_line(1,0,CLEAR_LINE); | |
| 168 | cpunum_set_input_line(Machine, 1, 0,CLEAR_LINE); | |
| 169 | 169 | |
| 170 | 170 | } |
| 171 | 171 | } |
| r1591 | r1592 | |
| 263 | 263 | |
| 264 | 264 | if (data==0x0f0) |
| 265 | 265 | { |
| 266 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 267 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 266 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 267 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 268 | 268 | } |
| 269 | 269 | LOG(("m5 write to pi5 port b: %02x %04x\n",data,activecpu_get_pc())); |
| 270 | 270 | } |
| r1591 | r1592 | |
| 302 | 302 | static void sord_m5_ctc_interrupt(int state) |
| 303 | 303 | { |
| 304 | 304 | //logerror("interrupting ctc %02x\r\n ",state); |
| 305 | cpunum_set_input_line(0, 0, state); | |
| 305 | cpunum_set_input_line(Machine, 0, 0, state); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | static z80ctc_interface sord_m5_ctc_intf = |
| r1591 | r1592 | |
| 617 | 617 | static INTERRUPT_GEN( sord_interrupt ) |
| 618 | 618 | { |
| 619 | 619 | if (TMS9928A_interrupt()) |
| 620 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 620 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | static MACHINE_DRIVER_START( sord_m5 ) |
| r1591 | r1592 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | static void mk1_interrupt( UINT16 addr, int level ) { |
| 187 | 187 | cpunum_set_input_line_vector( 0, 0, addr ); |
| 188 | cpunum_set_input_line( 0, 0, level ? F8_INT_INTR : F8_INT_NONE ); | |
| 188 | cpunum_set_input_line( Machine, 0, 0, level ? F8_INT_INTR : F8_INT_NONE ); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | static const F3853_CONFIG mk1_config = { |
| r1591 | r1592 | |
|---|---|---|
| 44 | 44 | ) |
| 45 | 45 | { |
| 46 | 46 | logerror("set int\n"); |
| 47 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 47 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | logerror("clear int\n"); |
| 53 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 53 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static void z88_update_rtc_interrupt(void) |
| r1591 | r1592 | |
| 99 | 99 | /* column has gone low in snooze/coma */ |
| 100 | 100 | blink.sta |= STA_KEY; |
| 101 | 101 | |
| 102 | cpu_trigger(Z88_SNOOZE_TRIGGER); | |
| 102 | cpu_trigger(Machine, Z88_SNOOZE_TRIGGER); | |
| 103 | 103 | |
| 104 | 104 | z88_interrupt_refresh(); |
| 105 | 105 | } |
| r1591 | r1592 | |
|---|---|---|
| 132 | 132 | /* any bits set excluding vsync */ |
| 133 | 133 | if ((pcw16_system_status & (~0x04))!=0) |
| 134 | 134 | { |
| 135 | cpunum_set_input_line(0,0, HOLD_LINE); | |
| 135 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 136 | 136 | } |
| 137 | 137 | else |
| 138 | 138 | { |
| 139 | cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 139 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
| r1591 | r1592 | |
| 1013 | 1013 | { |
| 1014 | 1014 | /* I'll pulse it because if I used hold-line I'm not sure |
| 1015 | 1015 | it would clear - to be checked */ |
| 1016 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1016 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1017 | 1017 | } |
| 1018 | 1018 | } |
| 1019 | 1019 | } |
| r1591 | r1592 | |
|---|---|---|
| 534 | 534 | |
| 535 | 535 | static TIMER_CALLBACK( update_nmi ) |
| 536 | 536 | { |
| 537 | // if (irq_flag==0)cpunum_set_input_line_and_vector(0, MC68000_IRQ_7, PULSE_LINE, MC68000_INT_ACK_AUTOVECTOR); | |
| 538 | cpunum_set_input_line_and_vector(0, MC68000_IRQ_7, PULSE_LINE, MC68000_INT_ACK_AUTOVECTOR); | |
| 537 | // if (irq_flag==0)cpunum_set_input_line_and_vector(Machine, 0, MC68000_IRQ_7, PULSE_LINE, MC68000_INT_ACK_AUTOVECTOR); | |
| 538 | cpunum_set_input_line_and_vector(Machine, 0, MC68000_IRQ_7, PULSE_LINE, MC68000_INT_ACK_AUTOVECTOR); | |
| 539 | 539 | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | static TIMER_CALLBACK( update_nmi32 ) |
| 543 | 543 | { |
| 544 | cpunum_set_input_line_and_vector(0, MC68020_IRQ_7, PULSE_LINE, MC68020_INT_ACK_AUTOVECTOR); | |
| 544 | cpunum_set_input_line_and_vector(Machine, 0, MC68020_IRQ_7, PULSE_LINE, MC68020_INT_ACK_AUTOVECTOR); | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | static MACHINE_START( glasgow ) |
| r1591 | r1592 | |
|---|---|---|
| 328 | 328 | |
| 329 | 329 | static MACHINE_RESET( tmc600 ) |
| 330 | 330 | { |
| 331 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 331 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | /* Machine Drivers */ |
| r1591 | r1592 | |
|---|---|---|
| 348 | 348 | static void field_interrupts(void) |
| 349 | 349 | { |
| 350 | 350 | if (load_state) |
| 351 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, 2); | |
| 351 | cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, 2); | |
| 352 | 352 | else |
| 353 | cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, ic_state); | |
| 353 | cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, ic_state); | |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /* |
| r1591 | r1592 | |
|---|---|---|
| 207 | 207 | |
| 208 | 208 | static INTERRUPT_GEN( aquarius_interrupt ) |
| 209 | 209 | { |
| 210 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 210 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /* Machine definition */ |
| r1591 | r1592 | |
|---|---|---|
| 401 | 401 | |
| 402 | 402 | static INTERRUPT_GEN( abc80_nmi_interrupt ) |
| 403 | 403 | { |
| 404 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 404 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | /* Machine Initialization */ |
| r1591 | r1592 | |
|---|---|---|
| 232 | 232 | // if(sys.mfp.iera & (1 << x)) |
| 233 | 233 | { |
| 234 | 234 | current_vector[6] = (sys.mfp.vr & 0xf0) | (x+8); |
| 235 | cpunum_set_input_line_and_vector(0,sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | (x + 8)); | |
| 235 | cpunum_set_input_line_and_vector(Machine, 0,sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | (x + 8)); | |
| 236 | 236 | // logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(sys.mfp.vr & 0xf0) | (x+8),sys.mfp.irqline); |
| 237 | 237 | return; // one at a time only |
| 238 | 238 | } |
| r1591 | r1592 | |
| 251 | 251 | // if(sys.mfp.ierb & (1 << x)) |
| 252 | 252 | { |
| 253 | 253 | current_vector[6] = (sys.mfp.vr & 0xf0) | x; |
| 254 | cpunum_set_input_line_and_vector(0,sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | x); | |
| 254 | cpunum_set_input_line_and_vector(Machine, 0,sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | x); | |
| 255 | 255 | // logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(sys.mfp.vr & 0xf0) | x,sys.mfp.irqline); |
| 256 | 256 | return; // one at a time only |
| 257 | 257 | } |
| r1591 | r1592 | |
| 626 | 626 | sys.mouse.irqactive = 1; |
| 627 | 627 | current_vector[5] = 0x54; |
| 628 | 628 | current_irq_line = 5; |
| 629 | cpunum_set_input_line_and_vector(0,5,HOLD_LINE,0x54); | |
| 629 | cpunum_set_input_line_and_vector(Machine, 0,5,HOLD_LINE,0x54); | |
| 630 | 630 | } |
| 631 | 631 | } |
| 632 | 632 | } |
| r1591 | r1592 | |
| 770 | 770 | sys.ioc.irqstatus |= 0x80; |
| 771 | 771 | current_irq_line = 1; |
| 772 | 772 | logerror("FDC: IRQ triggered\n"); |
| 773 | cpunum_set_input_line_and_vector(0,1,HOLD_LINE,current_vector[1]); | |
| 773 | cpunum_set_input_line_and_vector(Machine, 0,1,HOLD_LINE,current_vector[1]); | |
| 774 | 774 | } |
| 775 | 775 | } |
| 776 | 776 | |
| r1591 | r1592 | |
| 1311 | 1311 | then access causes a bus error */ |
| 1312 | 1312 | current_vector[2] = 0x02; // bus error |
| 1313 | 1313 | current_irq_line = 2; |
| 1314 | cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]); | |
| 1314 | cpunum_set_input_line_and_vector(Machine, 0,2,ASSERT_LINE,current_vector[2]); | |
| 1315 | 1315 | return 0xff; |
| 1316 | 1316 | } |
| 1317 | 1317 | |
| r1591 | r1592 | |
| 1321 | 1321 | then access causes a bus error */ |
| 1322 | 1322 | current_vector[2] = 0x02; // bus error |
| 1323 | 1323 | current_irq_line = 2; |
| 1324 | cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]); | |
| 1324 | cpunum_set_input_line_and_vector(Machine, 0,2,ASSERT_LINE,current_vector[2]); | |
| 1325 | 1325 | } |
| 1326 | 1326 | |
| 1327 | 1327 | static READ16_HANDLER( x68k_exp_r ) |
| r1591 | r1592 | |
| 1335 | 1335 | if(ACCESSING_LSB) |
| 1336 | 1336 | offset++; |
| 1337 | 1337 | timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error); |
| 1338 | // cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]); | |
| 1338 | // cpunum_set_input_line_and_vector(Machine, 0,2,ASSERT_LINE,current_vector[2]); | |
| 1339 | 1339 | } |
| 1340 | 1340 | return 0xffff; |
| 1341 | 1341 | } |
| r1591 | r1592 | |
| 1351 | 1351 | if(ACCESSING_LSB) |
| 1352 | 1352 | offset++; |
| 1353 | 1353 | timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error); |
| 1354 | // cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]); | |
| 1354 | // cpunum_set_input_line_and_vector(Machine, 0,2,ASSERT_LINE,current_vector[2]); | |
| 1355 | 1355 | } |
| 1356 | 1356 | } |
| 1357 | 1357 | |
| r1591 | r1592 | |
| 1360 | 1360 | current_vector[3] = hd63450_get_vector(channel); |
| 1361 | 1361 | current_irq_line = 3; |
| 1362 | 1362 | logerror("DMA#%i: DMA End (vector 0x%02x)\n",channel,current_vector[3]); |
| 1363 | cpunum_set_input_line_and_vector(0,3,ASSERT_LINE,current_vector[3]); | |
| 1363 | cpunum_set_input_line_and_vector(Machine, 0,3,ASSERT_LINE,current_vector[3]); | |
| 1364 | 1364 | } |
| 1365 | 1365 | |
| 1366 | 1366 | static void x68k_dma_end(int channel,int irq) |
| r1591 | r1592 | |
| 1377 | 1377 | { |
| 1378 | 1378 | current_vector[3] = hd63450_get_error_vector(channel); |
| 1379 | 1379 | current_irq_line = 3; |
| 1380 | cpunum_set_input_line_and_vector(0,3,ASSERT_LINE,current_vector[3]); | |
| 1380 | cpunum_set_input_line_and_vector(Machine, 0,3,ASSERT_LINE,current_vector[3]); | |
| 1381 | 1381 | } |
| 1382 | 1382 | } |
| 1383 | 1383 | |
| r1591 | r1592 | |
| 1413 | 1413 | return; |
| 1414 | 1414 | if((sys.ioc.irqstatus & 0xc0) != 0) // if the FDC is busy, then we don't want to miss that IRQ |
| 1415 | 1415 | return; |
| 1416 | cpunum_set_input_line(0,6,state); | |
| 1416 | cpunum_set_input_line(Machine, 0, 6, state); | |
| 1417 | 1417 | prev = state; |
| 1418 | 1418 | } |
| 1419 | 1419 | |
| r1591 | r1592 | |
| 1462 | 1462 | return current_vector[6]; |
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | cpunum_set_input_line_and_vector(0,line,CLEAR_LINE,current_vector[line]); | |
| 1465 | cpunum_set_input_line_and_vector(Machine, 0,line,CLEAR_LINE,current_vector[line]); | |
| 1466 | 1466 | if(line == 1) // IOSC |
| 1467 | 1467 | { |
| 1468 | 1468 | sys.ioc.irqstatus &= ~0xf0; |
| r1591 | r1592 | |
| 1805 | 1805 | current_vector[1] = 0x61; |
| 1806 | 1806 | sys.ioc.irqstatus |= 0x40; |
| 1807 | 1807 | current_irq_line = 1; |
| 1808 | cpunum_set_input_line_and_vector(0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt | |
| 1808 | cpunum_set_input_line_and_vector(Machine, 0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt | |
| 1809 | 1809 | logerror("IOC: Disk image inserted\n"); |
| 1810 | 1810 | } |
| 1811 | 1811 | sys.fdc.disk_inserted[image_index_in_device(image)] = 1; |
| r1591 | r1592 | |
| 1822 | 1822 | current_vector[1] = 0x61; |
| 1823 | 1823 | sys.ioc.irqstatus |= 0x40; |
| 1824 | 1824 | current_irq_line = 1; |
| 1825 | cpunum_set_input_line_and_vector(0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt | |
| 1825 | cpunum_set_input_line_and_vector(Machine, 0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt | |
| 1826 | 1826 | } |
| 1827 | 1827 | sys.fdc.disk_inserted[image_index_in_device(image)] = 0; |
| 1828 | 1828 | } |
| r1591 | r1592 | |
|---|---|---|
| 1952 | 1952 | |
| 1953 | 1953 | static INTERRUPT_GEN( spec_interrupt ) |
| 1954 | 1954 | { |
| 1955 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 1955 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 1956 | 1956 | } |
| 1957 | 1957 | |
| 1958 | 1958 |
| r1591 | r1592 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | static void pio_interrupt(int state) |
| 43 | 43 | { |
| 44 | cpunum_set_input_line(0, 0, state); | |
| 44 | cpunum_set_input_line(Machine, 0, 0, state); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static void keyboard_scan(void) |
| r1591 | r1592 | |
|---|---|---|
| 762 | 762 | static WRITE16_HANDLER( megaste_cache_w ) |
| 763 | 763 | { |
| 764 | 764 | megaste_cache = data; |
| 765 | cpunum_set_clock(0, (data & 0x01) ? Y2/2 : Y2/4); | |
| 765 | cpunum_set_clock(Machine, 0, (data & 0x01) ? Y2/2 : Y2/4); | |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | /* ST Book */ |
| r1591 | r1592 | |
| 1399 | 1399 | |
| 1400 | 1400 | static void mfp_interrupt(int which, int state) |
| 1401 | 1401 | { |
| 1402 | cpunum_set_input_line(0, MC68000_IRQ_6, state); | |
| 1402 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_6, state); | |
| 1403 | 1403 | } |
| 1404 | 1404 | |
| 1405 | 1405 | static UINT8 mfp_rx, mfp_tx; |
| r1591 | r1592 | |
|---|---|---|
| 317 | 317 | |
| 318 | 318 | static void sg1000_vdp_interrupt(int state) |
| 319 | 319 | { |
| 320 | cpunum_set_input_line_and_vector(0, INPUT_LINE_IRQ0, state, 0x38); | |
| 320 | cpunum_set_input_line_and_vector(Machine, 0, INPUT_LINE_IRQ0, state, 0x38); | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | static const TMS9928a_interface tms9928a_interface = |
| r1591 | r1592 | |
|---|---|---|
| 156 | 156 | // if it's not masked, also assert it now at the CPU |
| 157 | 157 | if (int3_regs[1] & source_mask) |
| 158 | 158 | { |
| 159 | cpunum_set_input_line(0, MIPS3_IRQ0, ASSERT_LINE); | |
| 159 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ0, ASSERT_LINE); | |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| r1591 | r1592 | |
| 176 | 176 | // if it's not masked, also assert it now at the CPU |
| 177 | 177 | if (int3_regs[2] & source_mask) |
| 178 | 178 | { |
| 179 | cpunum_set_input_line(0, MIPS3_IRQ1, ASSERT_LINE); | |
| 179 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ1, ASSERT_LINE); | |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| r1591 | r1592 | |
| 342 | 342 | // if no local0 interrupts now, clear the input to the CPU |
| 343 | 343 | if ((int3_regs[0] & int3_regs[1]) == 0) |
| 344 | 344 | { |
| 345 | cpunum_set_input_line(0, MIPS3_IRQ0, CLEAR_LINE); | |
| 345 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ0, CLEAR_LINE); | |
| 346 | 346 | } |
| 347 | 347 | else |
| 348 | 348 | { |
| 349 | cpunum_set_input_line(0, MIPS3_IRQ0, ASSERT_LINE); | |
| 349 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ0, ASSERT_LINE); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | // if no local1 interrupts now, clear the input to the CPU |
| 353 | 353 | if ((int3_regs[2] & int3_regs[3]) == 0) |
| 354 | 354 | { |
| 355 | cpunum_set_input_line(0, MIPS3_IRQ1, CLEAR_LINE); | |
| 355 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ1, CLEAR_LINE); | |
| 356 | 356 | } |
| 357 | 357 | else |
| 358 | 358 | { |
| 359 | cpunum_set_input_line(0, MIPS3_IRQ1, ASSERT_LINE); | |
| 359 | cpunum_set_input_line(Machine, 0, MIPS3_IRQ1, ASSERT_LINE); | |
| 360 | 360 | } |
| 361 | 361 | break; |
| 362 | 362 | case 0xb0/4: |
| r1591 | r1592 | |
|---|---|---|
| 201 | 201 | |
| 202 | 202 | static INTERRUPT_GEN( p2000_interrupt ) |
| 203 | 203 | { |
| 204 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 204 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /* Machine definition */ |
| r1591 | r1592 | |
|---|---|---|
| 248 | 248 | { |
| 249 | 249 | machine_reset_cdp1864(machine); |
| 250 | 250 | |
| 251 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 251 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /* Machine Drivers */ |
| r1591 | r1592 | |
|---|---|---|
| 147 | 147 | ((fdc_interrupt_code==1) && ((pcw_system_status & (1<<5))!=0)) |
| 148 | 148 | ) |
| 149 | 149 | { |
| 150 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 150 | cpunum_set_input_line(Machine, 0, 0,HOLD_LINE); | |
| 151 | 151 | } |
| 152 | 152 | else |
| 153 | 153 | { |
| 154 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 154 | cpunum_set_input_line(Machine, 0, 0,CLEAR_LINE); | |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| r1591 | r1592 | |
| 191 | 191 | { |
| 192 | 192 | /* I'll pulse it because if I used hold-line I'm not sure |
| 193 | 193 | it would clear - to be checked */ |
| 194 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 194 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | } |
| r1591 | r1592 | |
| 480 | 480 | /* yes */ |
| 481 | 481 | |
| 482 | 482 | /* clear nmi interrupt */ |
| 483 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 483 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /* re-issue interrupt */ |
| r1591 | r1592 | |
| 502 | 502 | /* yes */ |
| 503 | 503 | |
| 504 | 504 | /* Clear NMI */ |
| 505 | cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 505 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 506 | 506 | |
| 507 | 507 | } |
| 508 | 508 |
| r1591 | r1592 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | static void mk2_irq(int chip, int level) |
| 211 | 211 | { |
| 212 | cpunum_set_input_line(0, M6502_IRQ_LINE, level); | |
| 212 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, level); | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | static const RRIOT_CONFIG riot={ |
| r1591 | r1592 | |
|---|---|---|
| 155 | 155 | static void enterprise_dave_interrupt(int state) |
| 156 | 156 | { |
| 157 | 157 | if (state) |
| 158 | cpunum_set_input_line(0,0,HOLD_LINE); | |
| 158 | cpunum_set_input_line(Machine, 0,0,HOLD_LINE); | |
| 159 | 159 | else |
| 160 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 160 | cpunum_set_input_line(Machine, 0,0,CLEAR_LINE); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /* enterprise interface to dave - ok, so Dave chip is unique |
| r1591 | r1592 | |
| 166 | 166 | static const DAVE_INTERFACE enterprise_dave_interface = |
| 167 | 167 | { |
| 168 | 168 | enterprise_dave_reg_read, |
| 169 | enterprise_dave_reg_write, | |
| 170 | enterprise_dave_interrupt, | |
| 169 | enterprise_dave_reg_write, | |
| 170 | enterprise_dave_interrupt, | |
| 171 | 171 | }; |
| 172 | 172 | |
| 173 | 173 |
| r1591 | r1592 | |
|---|---|---|
| 184 | 184 | static int last_state = 0; |
| 185 | 185 | |
| 186 | 186 | // only if it goes up |
| 187 | if (state && !last_state) cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 187 | if (state && !last_state) cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 188 | 188 | last_state = state; |
| 189 | 189 | } |
| 190 | 190 | |
| r1591 | r1592 | |
| 208 | 208 | JoyStat[1] = 1; |
| 209 | 209 | |
| 210 | 210 | if (JoyStat[0] || JoyStat[1]) |
| 211 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 211 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | static const TMS9928a_interface tms9928a_interface = |
| r1591 | r1592 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | if (newvalue) |
| 172 | 172 | { |
| 173 | cpunum_set_input_line(0, UPD7810_INTF1, state); | |
| 173 | cpunum_set_input_line(Machine, 0, UPD7810_INTF1, state); | |
| 174 | 174 | state = (state == ASSERT_LINE) ? CLEAR_LINE : ASSERT_LINE; |
| 175 | 175 | } |
| 176 | 176 | } |
| r1591 | r1592 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | void apf_update_ints(void) |
| 130 | 130 | { |
| 131 | cpunum_set_input_line(0, 0, apf_ints ? HOLD_LINE : CLEAR_LINE); | |
| 131 | cpunum_set_input_line(Machine, 0, 0, apf_ints ? HOLD_LINE : CLEAR_LINE); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | static void apf_m1000_irq_a_func(int state) |
| r1591 | r1592 | |
|---|---|---|
| 248 | 248 | |
| 249 | 249 | /*A-Bus IRQ checks,where they could be located these?*/ |
| 250 | 250 | #define ABUSIRQ(_irq_,_vector_,_mask_) \ |
| 251 | if(!(stv_scu[40] & _mask_)) { cpunum_set_input_line_and_vector(0, _irq_, HOLD_LINE , _vector_); } | |
| 251 | if(!(stv_scu[40] & _mask_)) { cpunum_set_input_line_and_vector(Machine, 0, _irq_, HOLD_LINE , _vector_); } | |
| 252 | 252 | #if 0 |
| 253 | 253 | if(stv_scu[42] & 1)//IRQ ACK |
| 254 | 254 | { |
| r1591 | r1592 | |
| 537 | 537 | intback_stage = 2; |
| 538 | 538 | } |
| 539 | 539 | smpc_intbackhelper(); |
| 540 | cpunum_set_input_line_and_vector(0, 8, HOLD_LINE , 0x47); | |
| 540 | cpunum_set_input_line_and_vector(Machine, 0, 8, HOLD_LINE , 0x47); | |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | if ((offset == 1) && (data & 0x40)) |
| r1591 | r1592 | |
| 581 | 581 | if(!(stv_scu[40] & 0x0100)) /*Pad irq*/ |
| 582 | 582 | { |
| 583 | 583 | if(LOG_SMPC) logerror ("Interrupt: PAD irq at scanline %04x, Vector 0x48 Level 0x08\n",scanline); |
| 584 | cpunum_set_input_line_and_vector(0, 8, HOLD_LINE , 0x48); | |
| 584 | cpunum_set_input_line_and_vector(Machine, 0, 8, HOLD_LINE , 0x48); | |
| 585 | 585 | } |
| 586 | 586 | } |
| 587 | 587 | |
| r1591 | r1592 | |
| 598 | 598 | if(LOG_SMPC) logerror ("SMPC: Slave ON\n"); |
| 599 | 599 | smpc_ram[0x5f]=0x02; |
| 600 | 600 | stv_enable_slave_sh2 = 1; |
| 601 | cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 601 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 602 | 602 | break; |
| 603 | 603 | case 0x03: |
| 604 | 604 | if(LOG_SMPC) logerror ("SMPC: Slave OFF\n"); |
| 605 | 605 | smpc_ram[0x5f]=0x03; |
| 606 | 606 | stv_enable_slave_sh2 = 0; |
| 607 | cpu_trigger(1000); | |
| 608 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 607 | cpu_trigger(Machine, 1000); | |
| 608 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 609 | 609 | break; |
| 610 | 610 | case 0x06: |
| 611 | 611 | if(LOG_SMPC) logerror ("SMPC: Sound ON\n"); |
| 612 | 612 | /* wrong? */ |
| 613 | 613 | smpc_ram[0x5f]=0x06; |
| 614 | cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 614 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 615 | 615 | en_68k = 1; |
| 616 | 616 | break; |
| 617 | 617 | case 0x07: |
| 618 | 618 | if(LOG_SMPC) logerror ("SMPC: Sound OFF\n"); |
| 619 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 619 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 620 | 620 | en_68k = 0; |
| 621 | 621 | smpc_ram[0x5f]=0x07; |
| 622 | 622 | break; |
| r1591 | r1592 | |
| 626 | 626 | case 0x0d: |
| 627 | 627 | if(LOG_SMPC) logerror ("SMPC: System Reset\n"); |
| 628 | 628 | smpc_ram[0x5f]=0x0d; |
| 629 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 629 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 630 | 630 | system_reset(); |
| 631 | 631 | break; |
| 632 | 632 | case 0x0e: |
| 633 | 633 | if(LOG_SMPC) logerror ("SMPC: Change Clock to 352\n"); |
| 634 | 634 | smpc_ram[0x5f]=0x0e; |
| 635 | cpunum_set_clock(0, MASTER_CLOCK_352/2); | |
| 636 | cpunum_set_clock(1, MASTER_CLOCK_352/2); | |
| 637 | cpunum_set_clock(2, MASTER_CLOCK_352/5); | |
| 638 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 635 | cpunum_set_clock(Machine, 0, MASTER_CLOCK_352/2); | |
| 636 | cpunum_set_clock(Machine, 1, MASTER_CLOCK_352/2); | |
| 637 | cpunum_set_clock(Machine, 2, MASTER_CLOCK_352/5); | |
| 638 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 639 | 639 | break; |
| 640 | 640 | case 0x0f: |
| 641 | 641 | if(LOG_SMPC) logerror ("SMPC: Change Clock to 320\n"); |
| 642 | 642 | smpc_ram[0x5f]=0x0f; |
| 643 | cpunum_set_clock(0, MASTER_CLOCK_320/2); | |
| 644 | cpunum_set_clock(1, MASTER_CLOCK_320/2); | |
| 645 | cpunum_set_clock(2, MASTER_CLOCK_320/5); | |
| 646 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 643 | cpunum_set_clock(Machine, 0, MASTER_CLOCK_320/2); | |
| 644 | cpunum_set_clock(Machine, 1, MASTER_CLOCK_320/2); | |
| 645 | cpunum_set_clock(Machine, 2, MASTER_CLOCK_320/5); | |
| 646 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi? | |
| 647 | 647 | break; |
| 648 | 648 | /*"Interrupt Back"*/ |
| 649 | 649 | case 0x10: |
| r1591 | r1592 | |
| 695 | 695 | { |
| 696 | 696 | // if(LOG_SMPC) logerror ("Interrupt: System Manager (SMPC) at scanline %04x, Vector 0x47 Level 0x08\n",scanline); |
| 697 | 697 | smpc_intbackhelper(); |
| 698 | cpunum_set_input_line_and_vector(0, 8, HOLD_LINE , 0x47); | |
| 698 | cpunum_set_input_line_and_vector(Machine, 0, 8, HOLD_LINE , 0x47); | |
| 699 | 699 | } |
| 700 | 700 | break; |
| 701 | 701 | /* RTC write*/ |
| r1591 | r1592 | |
| 724 | 724 | if(LOG_SMPC) logerror ("SMPC: NMI request\n"); |
| 725 | 725 | smpc_ram[0x5f]=0x18; |
| 726 | 726 | /*NMI is unconditionally requested?*/ |
| 727 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 727 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 728 | 728 | break; |
| 729 | 729 | case 0x19: |
| 730 | 730 | if(LOG_SMPC) logerror ("SMPC: NMI Enable\n"); |
| r1591 | r1592 | |
| 819 | 819 | if(!(stv_scu[40] & 2))/*VBLANK-OUT*/ |
| 820 | 820 | { |
| 821 | 821 | if(LOG_IRQ) logerror ("Interrupt: VBlank-OUT at scanline %04x, Vector 0x41 Level 0x0e\n",scanline); |
| 822 | cpunum_set_input_line_and_vector(0, 0xe, HOLD_LINE , 0x41); | |
| 822 | cpunum_set_input_line_and_vector(Machine, 0, 0xe, HOLD_LINE , 0x41); | |
| 823 | 823 | } |
| 824 | 824 | stv_vblank = 0; |
| 825 | 825 | } |
| r1591 | r1592 | |
| 835 | 835 | if((!(stv_scu[40] & 0x10)) && (!(stv_scu[38] & 0x80))) |
| 836 | 836 | { |
| 837 | 837 | if(LOG_IRQ) logerror ("Interrupt: Timer 1 at scanline %04x, Vector 0x44 Level 0x0b\n",scanline); |
| 838 | cpunum_set_input_line_and_vector(0, 0xb, HOLD_LINE, 0x44 ); | |
| 838 | cpunum_set_input_line_and_vector(Machine, 0, 0xb, HOLD_LINE, 0x44 ); | |
| 839 | 839 | } |
| 840 | 840 | else if((!(stv_scu[40] & 0x10)) && (stv_scu[38] & 0x80)) |
| 841 | 841 | { |
| 842 | 842 | if(timer_1 == (stv_scu[36] & 0x1ff)) |
| 843 | 843 | { |
| 844 | 844 | if(LOG_IRQ) logerror ("Interrupt: Timer 1 at scanline %04x, Vector 0x44 Level 0x0b\n",scanline); |
| 845 | cpunum_set_input_line_and_vector(0, 0xb, HOLD_LINE, 0x44 ); | |
| 845 | cpunum_set_input_line_and_vector(Machine, 0, 0xb, HOLD_LINE, 0x44 ); | |
| 846 | 846 | } |
| 847 | 847 | } |
| 848 | 848 | } |
| r1591 | r1592 | |
| 851 | 851 | if(!(stv_scu[40] & 8))/*Timer 0*/ |
| 852 | 852 | { |
| 853 | 853 | if(LOG_IRQ) logerror ("Interrupt: Timer 0 at scanline %04x, Vector 0x43 Level 0x0c\n",scanline); |
| 854 | cpunum_set_input_line_and_vector(0, 0xc, HOLD_LINE, 0x43 ); | |
| 854 | cpunum_set_input_line_and_vector(Machine, 0, 0xc, HOLD_LINE, 0x43 ); | |
| 855 | 855 | } |
| 856 | 856 | } |
| 857 | 857 | |
| r1591 | r1592 | |
| 859 | 859 | if(!(stv_scu[40] & 4))/*HBLANK-IN*/ |
| 860 | 860 | { |
| 861 | 861 | if(LOG_IRQ) logerror ("Interrupt: HBlank-In at scanline %04x, Vector 0x42 Level 0x0d\n",scanline); |
| 862 | cpunum_set_input_line_and_vector(0, 0xd, HOLD_LINE , 0x42); | |
| 862 | cpunum_set_input_line_and_vector(Machine, 0, 0xd, HOLD_LINE , 0x42); | |
| 863 | 863 | } |
| 864 | 864 | } |
| 865 | 865 | else if(scanline == 224) |
| r1591 | r1592 | |
| 870 | 870 | if(!(stv_scu[40] & 1))/*VBLANK-IN*/ |
| 871 | 871 | { |
| 872 | 872 | if(LOG_IRQ) logerror ("Interrupt: VBlank IN at scanline %04x, Vector 0x40 Level 0x0f\n",scanline); |
| 873 | cpunum_set_input_line_and_vector(0, 0xf, HOLD_LINE , 0x40); | |
| 873 | cpunum_set_input_line_and_vector(Machine, 0, 0xf, HOLD_LINE , 0x40); | |
| 874 | 874 | } |
| 875 | 875 | stv_vblank = 1; |
| 876 | 876 | |
| r1591 | r1592 | |
| 879 | 879 | if(!(stv_scu[40] & 8))/*Timer 0*/ |
| 880 | 880 | { |
| 881 | 881 | if(LOG_IRQ) logerror ("Interrupt: Timer 0 at scanline %04x, Vector 0x43 Level 0x0c\n",scanline); |
| 882 | cpunum_set_input_line_and_vector(0, 0xc, HOLD_LINE, 0x43 ); | |
| 882 | cpunum_set_input_line_and_vector(Machine, 0, 0xc, HOLD_LINE, 0x43 ); | |
| 883 | 883 | } |
| 884 | 884 | } |
| 885 | 885 | if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/ |
| 886 | cpunum_set_input_line_and_vector(0, 2, HOLD_LINE , 0x4d); | |
| 886 | cpunum_set_input_line_and_vector(Machine, 0, 2, HOLD_LINE , 0x4d); | |
| 887 | 887 | } |
| 888 | 888 | } |
| 889 | 889 | |
| r1591 | r1592 | |
| 1106 | 1106 | /*Sound IRQ*/ |
| 1107 | 1107 | if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1) |
| 1108 | 1108 | { |
| 1109 | //cpunum_set_input_line_and_vector(0, 9, HOLD_LINE , 0x46); | |
| 1109 | //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46); | |
| 1110 | 1110 | logerror("SCSP: Main CPU interrupt\n"); |
| 1111 | 1111 | #if 0 |
| 1112 | 1112 | if((scu_dst_0 & 0x7ffffff) != 0x05a00000) |
| 1113 | 1113 | { |
| 1114 | 1114 | if(!(stv_scu[40] & 0x1000)) |
| 1115 | 1115 | { |
| 1116 | cpunum_set_input_line_and_vector(0, 3, HOLD_LINE, 0x4c); | |
| 1116 | cpunum_set_input_line_and_vector(Machine, 0, 3, HOLD_LINE, 0x4c); | |
| 1117 | 1117 | logerror("SCU: Illegal DMA interrupt\n"); |
| 1118 | 1118 | } |
| 1119 | 1119 | } |
| r1591 | r1592 | |
| 1167 | 1167 | /*Sound IRQ*/ |
| 1168 | 1168 | if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1) |
| 1169 | 1169 | { |
| 1170 | //cpunum_set_input_line_and_vector(0, 9, HOLD_LINE , 0x46); | |
| 1170 | //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46); | |
| 1171 | 1171 | logerror("SCSP: Main CPU interrupt\n"); |
| 1172 | 1172 | } |
| 1173 | 1173 | } |
| r1591 | r1592 | |
| 1217 | 1217 | /*Sound IRQ*/ |
| 1218 | 1218 | if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1) |
| 1219 | 1219 | { |
| 1220 | //cpunum_set_input_line_and_vector(0, 9, HOLD_LINE , 0x46); | |
| 1220 | //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46); | |
| 1221 | 1221 | logerror("SCSP: Main CPU interrupt\n"); |
| 1222 | 1222 | } |
| 1223 | 1223 | } |
| r1591 | r1592 | |
| 1396 | 1396 | |
| 1397 | 1397 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1398 | 1398 | if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/ |
| 1399 | cpunum_set_input_line_and_vector(0, 5, HOLD_LINE , 0x4b); | |
| 1399 | cpunum_set_input_line_and_vector(Machine, 0, 5, HOLD_LINE , 0x4b); | |
| 1400 | 1400 | |
| 1401 | 1401 | if(scu_add_tmp & 0x80000000) |
| 1402 | 1402 | { |
| r1591 | r1592 | |
| 1499 | 1499 | |
| 1500 | 1500 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1501 | 1501 | if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/ |
| 1502 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x4a); | |
| 1502 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x4a); | |
| 1503 | 1503 | |
| 1504 | 1504 | if(scu_add_tmp & 0x80000000) |
| 1505 | 1505 | { |
| r1591 | r1592 | |
| 1602 | 1602 | |
| 1603 | 1603 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1604 | 1604 | if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/ |
| 1605 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x49); | |
| 1605 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x49); | |
| 1606 | 1606 | |
| 1607 | 1607 | if(scu_add_tmp & 0x80000000) |
| 1608 | 1608 | { |
| r1591 | r1592 | |
| 1680 | 1680 | }while(job_done == 0); |
| 1681 | 1681 | |
| 1682 | 1682 | if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/ |
| 1683 | cpunum_set_input_line_and_vector(0, 5, HOLD_LINE , 0x4b); | |
| 1683 | cpunum_set_input_line_and_vector(Machine, 0, 5, HOLD_LINE , 0x4b); | |
| 1684 | 1684 | |
| 1685 | 1685 | D0MV_0; |
| 1686 | 1686 | } |
| r1591 | r1592 | |
| 1752 | 1752 | }while(job_done == 0); |
| 1753 | 1753 | |
| 1754 | 1754 | if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/ |
| 1755 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x4a); | |
| 1755 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x4a); | |
| 1756 | 1756 | |
| 1757 | 1757 | D1MV_0; |
| 1758 | 1758 | } |
| r1591 | r1592 | |
| 1823 | 1823 | }while(job_done == 0); |
| 1824 | 1824 | |
| 1825 | 1825 | if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/ |
| 1826 | cpunum_set_input_line_and_vector(0, 6, HOLD_LINE , 0x49); | |
| 1826 | cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x49); | |
| 1827 | 1827 | |
| 1828 | 1828 | D2MV_0; |
| 1829 | 1829 | } |
| r1591 | r1592 | |
| 1863 | 1863 | { |
| 1864 | 1864 | logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data); |
| 1865 | 1865 | cpu_boost_interleave(double_to_attotime(minit_boost_timeslice), ATTOTIME_IN_USEC(minit_boost)); |
| 1866 | cpu_trigger(1000); | |
| 1866 | cpu_trigger(Machine, 1000); | |
| 1867 | 1867 | cpunum_set_info_int(1, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE); |
| 1868 | 1868 | } |
| 1869 | 1869 | |
| r1591 | r1592 | |
| 2148 | 2148 | static MACHINE_RESET( saturn ) |
| 2149 | 2149 | { |
| 2150 | 2150 | // don't let the slave cpu and the 68k go anywhere |
| 2151 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2151 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2152 | 2152 | stv_enable_slave_sh2 = 0; |
| 2153 | cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2153 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 2154 | 2154 | |
| 2155 | 2155 | smpcSR = 0x40; // this bit is always on according to docs |
| 2156 | 2156 | |
| r1591 | r1592 | |
| 2165 | 2165 | memset(stv_workram_l, 0, 0x100000); |
| 2166 | 2166 | memset(stv_workram_h, 0, 0x100000); |
| 2167 | 2167 | |
| 2168 | cpunum_set_clock(0, MASTER_CLOCK_320/2); | |
| 2169 | cpunum_set_clock(1, MASTER_CLOCK_320/2); | |
| 2170 | cpunum_set_clock(2, MASTER_CLOCK_320/5); | |
| 2168 | cpunum_set_clock(Machine, 0, MASTER_CLOCK_320/2); | |
| 2169 | cpunum_set_clock(Machine, 1, MASTER_CLOCK_320/2); | |
| 2170 | cpunum_set_clock(Machine, 2, MASTER_CLOCK_320/5); | |
| 2171 | 2171 | |
| 2172 | 2172 | stvcd_reset(); |
| 2173 | 2173 | } |
| r1591 | r1592 | |
| 2257 | 2257 | if (irq > 0) |
| 2258 | 2258 | { |
| 2259 | 2259 | scsp_last_line = irq; |
| 2260 | cpunum_set_input_line(2, irq, ASSERT_LINE); | |
| 2260 | cpunum_set_input_line(Machine, 2, irq, ASSERT_LINE); | |
| 2261 | 2261 | } |
| 2262 | 2262 | else if (irq < 0) |
| 2263 | 2263 | { |
| 2264 | cpunum_set_input_line(2, -irq, CLEAR_LINE); | |
| 2264 | cpunum_set_input_line(Machine, 2, -irq, CLEAR_LINE); | |
| 2265 | 2265 | } |
| 2266 | 2266 | else |
| 2267 | 2267 | { |
| 2268 | cpunum_set_input_line(2, scsp_last_line, CLEAR_LINE); | |
| 2268 | cpunum_set_input_line(Machine, 2, scsp_last_line, CLEAR_LINE); | |
| 2269 | 2269 | } |
| 2270 | 2270 | } |
| 2271 | 2271 |
| r1591 | r1592 | |
|---|---|---|
| 106 | 106 | static void zx8302_interrupt(UINT8 line) |
| 107 | 107 | { |
| 108 | 108 | zx8302.irq |= line; |
| 109 | cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE); | |
| 109 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, HOLD_LINE); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static void zx8302_txd(int level) |
| r1591 | r1592 | |
| 366 | 366 | |
| 367 | 367 | if (!zx8302.irq) |
| 368 | 368 | { |
| 369 | cpunum_set_input_line(0, MC68000_IRQ_2, CLEAR_LINE); | |
| 369 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, CLEAR_LINE); | |
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | |
| r1591 | r1592 | |
| 483 | 483 | switch (ipl) |
| 484 | 484 | { |
| 485 | 485 | case 0: |
| 486 | cpunum_set_input_line(0, MC68000_IRQ_2, CLEAR_LINE); | |
| 487 | cpunum_set_input_line(0, MC68000_IRQ_5, CLEAR_LINE); | |
| 488 | cpunum_set_input_line(0, MC68000_IRQ_7, HOLD_LINE); | |
| 486 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, CLEAR_LINE); | |
| 487 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_5, CLEAR_LINE); | |
| 488 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_7, HOLD_LINE); | |
| 489 | 489 | break; |
| 490 | 490 | case 1: // CTRL-ALT-7 |
| 491 | cpunum_set_input_line(0, MC68000_IRQ_2, CLEAR_LINE); | |
| 492 | cpunum_set_input_line(0, MC68000_IRQ_5, HOLD_LINE); | |
| 493 | cpunum_set_input_line(0, MC68000_IRQ_7, CLEAR_LINE); | |
| 491 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, CLEAR_LINE); | |
| 492 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_5, HOLD_LINE); | |
| 493 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_7, CLEAR_LINE); | |
| 494 | 494 | break; |
| 495 | 495 | case 2: |
| 496 | cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE); | |
| 497 | cpunum_set_input_line(0, MC68000_IRQ_5, CLEAR_LINE); | |
| 498 | cpunum_set_input_line(0, MC68000_IRQ_7, CLEAR_LINE); | |
| 496 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, HOLD_LINE); | |
| 497 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_5, CLEAR_LINE); | |
| 498 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_7, CLEAR_LINE); | |
| 499 | 499 | break; |
| 500 | 500 | case 3: |
| 501 | cpunum_set_input_line(0, MC68000_IRQ_2, CLEAR_LINE); | |
| 502 | cpunum_set_input_line(0, MC68000_IRQ_5, CLEAR_LINE); | |
| 503 | cpunum_set_input_line(0, MC68000_IRQ_7, CLEAR_LINE); | |
| 501 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, CLEAR_LINE); | |
| 502 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_5, CLEAR_LINE); | |
| 503 | cpunum_set_input_line(Machine, 0, MC68000_IRQ_7, CLEAR_LINE); | |
| 504 | 504 | break; |
| 505 | 505 | } |
| 506 | 506 | |
| r1591 | r1592 | |
| 534 | 534 | |
| 535 | 535 | int irq = (ipc.ser2_rxd | ipc.ser1_txd); |
| 536 | 536 | |
| 537 | cpunum_set_input_line(1, INPUT_LINE_IRQ0, irq); | |
| 537 | cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, irq); | |
| 538 | 538 | |
| 539 | 539 | return (zx8302.comdata << 7) | irq; |
| 540 | 540 | } |
| r1591 | r1592 | |
|---|---|---|
| 157 | 157 | { |
| 158 | 158 | machine_reset_cdp1864(machine); |
| 159 | 159 | |
| 160 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 160 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 161 | 161 | |
| 162 | 162 | // reset program counter to 0xc000 |
| 163 | 163 | } |
| r1591 | r1592 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | static MACHINE_RESET( tmc1800 ) |
| 260 | 260 | { |
| 261 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 261 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | static MACHINE_START( tmc2000 ) |
| r1591 | r1592 | |
| 273 | 273 | { |
| 274 | 274 | machine_reset_cdp1864(machine); |
| 275 | 275 | |
| 276 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); | |
| 276 | cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 277 | 277 | |
| 278 | 278 | // set program counter to 0x8000 |
| 279 | 279 | memory_set_bank(1, 0); |
| r1591 | r1592 | |
|---|---|---|
| 201 | 201 | |
| 202 | 202 | static void crvision_vdp_interrupt(int state) |
| 203 | 203 | { |
| 204 | cpunum_set_input_line(0, INPUT_LINE_IRQ0, state); | |
| 204 | cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, state); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | static const TMS9928a_interface tms9918_intf = |
| r1591 | r1592 | |
|---|---|---|
| 191 | 191 | |
| 192 | 192 | static INTERRUPT_GEN( nascom_interrupt ) |
| 193 | 193 | { |
| 194 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 194 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /* Machine definition */ |
| r1591 | r1592 | |
|---|---|---|
| 352 | 352 | /* NPW 21-Jul-2005 - Not sure how to update this for MAME 0.98u2 */ |
| 353 | 353 | /* |
| 354 | 354 | if (einstein_int & einstein_int_mask & EINSTEIN_KEY_INT) |
| 355 | cpunum_set_input_line(0, Z80_INT_REQ, PULSE_LINE); | |
| 355 | cpunum_set_input_line(Machine, 0, Z80_INT_REQ, PULSE_LINE); | |
| 356 | 356 | else |
| 357 | cpunum_set_input_line(0, Z80_INT_IEO, PULSE_LINE); | |
| 357 | cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE); | |
| 358 | 358 | |
| 359 | 359 | if (einstein_int & einstein_int_mask & EINSTEIN_ADC_INT) |
| 360 | cpunum_set_input_line(0, Z80_INT_REQ, PULSE_LINE); | |
| 360 | cpunum_set_input_line(Machine, 0, Z80_INT_REQ, PULSE_LINE); | |
| 361 | 361 | else |
| 362 | cpunum_set_input_line(0, Z80_INT_IEO, PULSE_LINE); | |
| 362 | cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE); | |
| 363 | 363 | |
| 364 | 364 | if (einstein_int & einstein_int_mask & EINSTEIN_FIRE_INT) |
| 365 | cpunum_set_input_line(0, Z80_INT_REQ, PULSE_LINE); | |
| 365 | cpunum_set_input_line(Machine, 0, Z80_INT_REQ, PULSE_LINE); | |
| 366 | 366 | else |
| 367 | cpunum_set_input_line(0, Z80_INT_IEO, PULSE_LINE); | |
| 367 | cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE); | |
| 368 | 368 | */ |
| 369 | 369 | } |
| 370 | 370 | |
| r1591 | r1592 | |
| 401 | 401 | static void einstein_ctc_interrupt(int state) |
| 402 | 402 | { |
| 403 | 403 | logerror("ctc irq state: %02x\n",state); |
| 404 | cpunum_set_input_line(0, 1, state); | |
| 404 | cpunum_set_input_line(Machine, 0, 1, state); | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | static void einstein_pio_interrupt(int state) |
| 408 | 408 | { |
| 409 | 409 | logerror("pio irq state: %02x\n",state); |
| 410 | cpunum_set_input_line(0, 3, state); | |
| 410 | cpunum_set_input_line(Machine, 0, 3, state); | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | static WRITE8_HANDLER(einstein_serial_transmit_clock) |
| r1591 | r1592 | |
|---|---|---|
| 110 | 110 | static INTERRUPT_GEN( ti99_2_vblank_interrupt ) |
| 111 | 111 | { |
| 112 | 112 | /* We trigger a level-4 interrupt. The PULSE_LINE is a mere guess. */ |
| 113 | cpunum_set_input_line(0, 1, PULSE_LINE); | |
| 113 | cpunum_set_input_line(machine, 0, 1, PULSE_LINE); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 |
| r1591 | r1592 | |
|---|---|---|
| 338 | 338 | |
| 339 | 339 | static INTERRUPT_GEN( intv_interrupt2 ) |
| 340 | 340 | { |
| 341 | cpunum_set_input_line(1, 0, PULSE_LINE); | |
| 341 | cpunum_set_input_line(machine, 1, 0, PULSE_LINE); | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | static MACHINE_DRIVER_START( intv ) |
| r1591 | r1592 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | static INTERRUPT_GEN( jupiter_interrupt ) |
| 169 | 169 | { |
| 170 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 170 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /* machine definition */ |
| r1591 | r1592 | |
|---|---|---|
| 204 | 204 | break; |
| 205 | 205 | case IOS_INIT: |
| 206 | 206 | mailbox_out = 0x08; |
| 207 | cpunum_set_input_line(0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 207 | cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 208 | 208 | io_state = IOS_NOP; |
| 209 | 209 | break; |
| 210 | 210 | case IOS_RESET: |
| r1591 | r1592 | |
| 220 | 220 | break; |
| 221 | 221 | case IOS_CHARDEF1: |
| 222 | 222 | mailbox_out = 0x07; |
| 223 | cpunum_set_input_line(0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 223 | cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 224 | 224 | io_state = IOS_CHARDEF2; |
| 225 | 225 | break; |
| 226 | 226 | case IOS_CHARDEF2: |
| 227 | 227 | mailbox_out = 0x04; |
| 228 | cpunum_set_input_line(0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 228 | cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 229 | 229 | io_state = IOS_CHARDEF3; |
| 230 | 230 | break; |
| 231 | 231 | case IOS_CHARDEF3: |
| 232 | 232 | mailbox_out = 0xF5; |
| 233 | cpunum_set_input_line(0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 233 | cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 234 | 234 | io_state = IOS_CHARDEF4; |
| 235 | 235 | io_counter = 0; |
| 236 | 236 | break; |
| r1591 | r1592 | |
| 369 | 369 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 370 | 370 | }; |
| 371 | 371 | mailbox_out = fontdata[io_counter+9-2*(io_counter%10)] >> 2; |
| 372 | cpunum_set_input_line(0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 372 | cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 373 | 373 | io_counter++; |
| 374 | 374 | if (io_counter == 127*10) |
| 375 | 375 | io_state = IOS_NOP; |
| r1591 | r1592 | |
| 387 | 387 | if (io_command_ack) |
| 388 | 388 | { |
| 389 | 389 | if (io_hsk) |
| 390 | cpunum_set_input_line(0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 390 | cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE); | |
| 391 | 391 | else |
| 392 | 392 | { |
| 393 | 393 | io_command_ack = 0; |
| r1591 | r1592 | |
|---|---|---|
| 174 | 174 | static TIMER_CALLBACK( update_nmi ) |
| 175 | 175 | { |
| 176 | 176 | |
| 177 | cpunum_set_input_line(0, INPUT_LINE_NMI,PULSE_LINE); | |
| 177 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI,PULSE_LINE); | |
| 178 | 178 | // DAC_data_w(0,led_status&64?128:0); |
| 179 | 179 | beep_set_state(0,led_status&64?1:0); |
| 180 | 180 | |
| r1591 | r1592 | |
| 185 | 185 | lcd_shift_counter=3; |
| 186 | 186 | // timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, update_leds); |
| 187 | 187 | timer_pulse(ATTOTIME_IN_HZ(600), NULL, 0, update_nmi); |
| 188 | // cpunum_set_input_line(0, M65C02_IRQ_LINE,CLEAR_LINE); | |
| 188 | // cpunum_set_input_line(machine, 0, M65C02_IRQ_LINE,CLEAR_LINE); | |
| 189 | 189 | //beep_set_frequency(0, 4000); |
| 190 | 190 | } |
| 191 | 191 |
| r1591 | r1592 | |
|---|---|---|
| 771 | 771 | if(data & 0x40) |
| 772 | 772 | { |
| 773 | 773 | logerror("ASIC: DMA 0 IRQ acknowledge\n"); |
| 774 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 774 | cpunum_set_input_line(Machine, 0,0,CLEAR_LINE); | |
| 775 | 775 | amstrad_plus_irq_cause = 0x06; |
| 776 | 776 | amstrad_plus_asic_ram[0x2c0f] &= ~0x40; |
| 777 | 777 | } |
| 778 | 778 | if(data & 0x20) |
| 779 | 779 | { |
| 780 | 780 | logerror("ASIC: DMA 1 IRQ acknowledge\n"); |
| 781 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 781 | cpunum_set_input_line(Machine, 0,0,CLEAR_LINE); | |
| 782 | 782 | amstrad_plus_irq_cause = 0x06; |
| 783 | 783 | amstrad_plus_asic_ram[0x2c0f] &= ~0x20; |
| 784 | 784 | } |
| 785 | 785 | if(data & 0x10) |
| 786 | 786 | { |
| 787 | 787 | logerror("ASIC: DMA 2 IRQ acknowledge\n"); |
| 788 | cpunum_set_input_line(0,0,CLEAR_LINE); | |
| 788 | cpunum_set_input_line(Machine, 0,0,CLEAR_LINE); | |
| 789 | 789 | amstrad_plus_irq_cause = 0x06; |
| 790 | 790 | amstrad_plus_asic_ram[0x2c0f] &= ~0x10; |
| 791 | 791 | } |
| r1591 | r1592 | |
| 1068 | 1068 | then the interrupt request is cleared and the 6-bit counter is reset to "0". */ |
| 1069 | 1069 | if ((amstrad_GateArray_ModeAndRomConfiguration & (1<<4)) != 0) { |
| 1070 | 1070 | amstrad_CRTC_HS_Counter = 0; |
| 1071 | cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 1071 | cpunum_set_input_line(Machine, 0,0, CLEAR_LINE); | |
| 1072 | 1072 | |
| 1073 | 1073 | } |
| 1074 | 1074 | /* b3b2 != 0 then change the state of upper or lower rom area and rethink memory */ |
| r1591 | r1592 | |
| 1636 | 1636 | multiface_rethink_memory(); |
| 1637 | 1637 | |
| 1638 | 1638 | /* pulse the nmi line */ |
| 1639 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1639 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 1640 | 1640 | |
| 1641 | 1641 | /* initialise 0065 override to monitor calls to 0065 */ |
| 1642 | 1642 | memory_set_opbase_handler(0,amstrad_multiface_opbaseoverride); |
| r1591 | r1592 | |
| 1807 | 1807 | amstrad_plus_asic_ram[0x2c0f] &= ~0x80; // not a raster interrupt, so this bit is reset |
| 1808 | 1808 | return (amstrad_plus_asic_ram[0x2805] & 0xf8) + amstrad_plus_irq_cause; |
| 1809 | 1809 | } |
| 1810 | cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 1810 | cpunum_set_input_line(Machine, 0,0, CLEAR_LINE); | |
| 1811 | 1811 | amstrad_CRTC_HS_Counter &= 0x1F; |
| 1812 | 1812 | if(amstrad_plus_asic_enabled != 0) |
| 1813 | 1813 | { |
| r1591 | r1592 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | if (a310_iocregs[6] & mask) |
| 91 | 91 | { |
| 92 | cpunum_set_input_line(0, ARM_IRQ_LINE, ASSERT_LINE); | |
| 92 | cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, ASSERT_LINE); | |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| r1591 | r1592 | |
| 99 | 99 | |
| 100 | 100 | if (a310_iocregs[10] & mask) |
| 101 | 101 | { |
| 102 | cpunum_set_input_line(0, ARM_IRQ_LINE, PULSE_LINE); | |
| 102 | cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, PULSE_LINE); | |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| r1591 | r1592 | |
| 109 | 109 | |
| 110 | 110 | if (a310_iocregs[14] & mask) |
| 111 | 111 | { |
| 112 | cpunum_set_input_line(0, ARM_FIRQ_LINE, PULSE_LINE); | |
| 112 | cpunum_set_input_line(Machine, 0, ARM_FIRQ_LINE, PULSE_LINE); | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r1591 | r1592 | |
| 436 | 436 | // if that did it, clear the IRQ |
| 437 | 437 | if (a310_iocregs[4] == 0) |
| 438 | 438 | { |
| 439 | cpunum_set_input_line(0, ARM_IRQ_LINE, CLEAR_LINE); | |
| 439 | cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, CLEAR_LINE); | |
| 440 | 440 | } |
| 441 | 441 | break; |
| 442 | 442 |
| r1591 | r1592 | |
|---|---|---|
| 154 | 154 | static void avigo_refresh_ints(void) |
| 155 | 155 | { |
| 156 | 156 | if (avigo_irq!=0) |
| 157 | cpunum_set_input_line(0,0, HOLD_LINE); | |
| 157 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 158 | 158 | else |
| 159 | cpunum_set_input_line(0,0, CLEAR_LINE); | |
| 159 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| r1591 | r1592 | |
| 210 | 210 | if ((current_input_port_data[3] & 0x02)!=0) |
| 211 | 211 | { |
| 212 | 212 | /* ????? causes a NMI */ |
| 213 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 213 | cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 |
| r1591 | r1592 | |
|---|---|---|
| 53 | 53 | { |
| 54 | 54 | /* No other interrupts can occur - NOT CORRECT!!! */ |
| 55 | 55 | STAT=0x1E; |
| 56 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 56 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 57 | 57 | interrupted=1; |
| 58 | 58 | } |
| 59 | 59 | } |
| r1591 | r1592 | |
| 87 | 87 | else |
| 88 | 88 | STAT=0x17; |
| 89 | 89 | |
| 90 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 90 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 91 | 91 | interrupted=1; |
| 92 | 92 | } |
| 93 | 93 |
| r1591 | r1592 | |
|---|---|---|
| 257 | 257 | static TIMER_CALLBACK(tape_interrupt_handler) |
| 258 | 258 | { |
| 259 | 259 | //assert(tape_interrupt_enable); |
| 260 | cpunum_set_input_line(0, 1, (cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0)) > 0.0) ? ASSERT_LINE : CLEAR_LINE); | |
| 260 | cpunum_set_input_line(machine, 0, 1, (cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0)) > 0.0) ? ASSERT_LINE : CLEAR_LINE); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /* CRU handler */ |
| r1591 | r1592 | |
| 293 | 293 | else |
| 294 | 294 | { |
| 295 | 295 | timer_adjust(tape_interrupt_timer, attotime_never, 0, attotime_zero); |
| 296 | cpunum_set_input_line(0, 1, CLEAR_LINE); | |
| 296 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE); | |
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | break; |
| r1591 | r1592 | |
|---|---|---|
| 78 | 78 | int irq = svision.timer_shot && (BANK & 2); |
| 79 | 79 | irq = irq || (svision_dma.finished && (BANK & 4)); |
| 80 | 80 | |
| 81 | cpunum_set_input_line(0, M6502_IRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 81 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static TIMER_CALLBACK(svision_timer) |
| r1591 | r1592 | |
| 418 | 418 | static INTERRUPT_GEN( svision_frame_int ) |
| 419 | 419 | { |
| 420 | 420 | if (BANK&1) |
| 421 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); | |
| 421 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 422 | 422 | |
| 423 | 423 | if (svision_channel->count) |
| 424 | 424 | svision_channel->count--; |
| r1591 | r1592 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | static void tms_interrupt(int dummy) |
| 31 | 31 | { |
| 32 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 32 | cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static INTERRUPT_GEN( bbcbc_interrupt ) |
| r1591 | r1592 | |
|---|---|---|
| 449 | 449 | |
| 450 | 450 | static INTERRUPT_GEN( vtech2_interrupt ) |
| 451 | 451 | { |
| 452 | cpunum_set_input_line(0, 0, HOLD_LINE); | |
| 452 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | static MACHINE_DRIVER_START( laser350 ) |
| r1591 | r1592 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | Source Changes: |
| 66 | 66 | ---------------- |
| 67 | - The core is based on MAME 0.122u | |
| 67 | - The core is based on MAME 0.122u7. This incorporates all features of the | |
| 68 | 68 | update to this core. [MAME team] |
| 69 | 69 | |
| 70 | 70 | - Miscellaneous cleanups (staticization, constification, conditional logging, |
| Previous | 15994 Revisions | Next |