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

src/mame/audio/cchasm.c
r1591r1592
7171    case 0x41:
7272        sound_flags |= 0x40;
7373        soundlatch4_w (offset, data);
74        cpunum_set_input_line(0, 1, HOLD_LINE);
74        cpunum_set_input_line(Machine, 0, 1, HOLD_LINE);
7575        break;
7676
7777    case 0x61:
r1591r1592
9999         sound_flags |= 0x80;
100100         soundlatch2_w (offset, data);
101101         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);
103103         break;
104104      case 2:
105105         led = data;
r1591r1592
133133
134134static void ctc_interrupt (int state)
135135{
136   cpunum_set_input_line(1, 0, state);
136   cpunum_set_input_line(Machine, 1, 0, state);
137137}
138138
139139static WRITE8_HANDLER( ctc_timer_1_w )
src/mame/audio/spacefb.c
r1591r1592
3636
3737WRITE8_HANDLER( spacefb_port_1_w )
3838{
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);
4040
4141   /* enemy killed */
4242   if (!(data & 0x01) && (spacefb_sound_latch & 0x01))  sample_start(0,0,0);
src/mame/audio/jaguar.c
r1591r1592
212212{
213213   if (gpu_irq_state & dsp_regs[JINTCTRL] & 0x1f)
214214   {
215      cpunum_set_input_line(1, 1, ASSERT_LINE);
215      cpunum_set_input_line(Machine, 1, 1, ASSERT_LINE);
216216      jaguar_gpu_resume();
217217   }
218218   else
219      cpunum_set_input_line(1, 1, CLEAR_LINE);
219      cpunum_set_input_line(Machine, 1, 1, CLEAR_LINE);
220220}
221221
222222
r1591r1592
396396static TIMER_CALLBACK( serial_chunky_callback )
397397{
398398   /* 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);
400400   jaguar_dsp_resume();
401401
402402   /* fix flaky code in interrupt handler which thwarts our speedup */
r1591r1592
415415static TIMER_CALLBACK( serial_callback )
416416{
417417   /* 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);
419419   jaguar_dsp_resume();
420420}
421421
src/mame/audio/phoenix.c
r1591r1592
4848#define VMIN    0
4949#define VMAX   32767
5050
51static UINT8 sound_latch_a;
51struct c_state
52{
53   INT32 counter;
54   INT32 level;
55};
5256
53static sound_stream * channel;
57struct n_state
58{
59   INT32 counter;
60   INT32 polyoffs;
61   INT32 polybit;
62   INT32 lowpass_counter;
63   INT32 lowpass_polybit;
64};
5465
55static UINT32 *poly18 = NULL;
66static struct c_state       c24_state;
67static struct c_state       c25_state;
68static struct n_state       noise_state;
69static UINT8             sound_latch_a;
70static sound_stream *       channel;
71static UINT32 *            poly18;
5672
5773INLINE int update_c24(int samplerate)
5874{
59   static int counter, level;
6075   /*
6176     * Noise frequency control (Port B):
6277     * Bit 6 lo charges C24 (6.8u) via R51 (330) and when
r1591r1592
6984   #define R52 20000
7085   if( sound_latch_a & 0x40 )
7186   {
72      if (level > VMIN)
87      if (c24_state.level > VMIN)
7388      {
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 )
7691         {
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;
8196         }
8297      }
8398    }
8499   else
85100   {
86      if (level < VMAX)
101      if (c24_state.level < VMAX)
87102      {
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 )
90105         {
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;
95110         }
96111      }
97112    }
98   return VMAX - level;
113   return VMAX - c24_state.level;
99114}
100115
101116INLINE int update_c25(int samplerate)
102117{
103   static int counter, level;
104118   /*
105119     * Bit 7 hi charges C25 (6.8u) over a R50 (1k) and R53 (330) and when
106120     * bit 7 is lo, C25 is discharged through R54 (47k)
r1591r1592
113127
114128   if( sound_latch_a & 0x80 )
115129   {
116      if (level < VMAX)
130      if (c25_state.level < VMAX)
117131      {
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 )
120134         {
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;
125139         }
126140      }
127141   }
128142   else
129143   {
130      if (level > VMIN)
144      if (c25_state.level > VMIN)
131145      {
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 )
134148         {
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;
139153         }
140154      }
141155   }
142   return level;
156   return c25_state.level;
143157}
144158
145159
146160INLINE int noise(int samplerate)
147161{
148   static int counter, polyoffs, polybit, lowpass_counter, lowpass_polybit;
149162   int vc24 = update_c24(samplerate);
150163   int vc25 = update_c25(samplerate);
151164   int sum = 0, level, frequency;
r1591r1592
168181     * R71 (2700 Ohms) parallel to R73 (47k Ohms) = approx. 2553 Ohms
169182     * maxfreq = 1.44 / ((2553+2*1000) * 0.05e-6) = approx. 6325 Hz
170183     */
171   counter -= frequency;
172   if( counter <= 0 )
184   noise_state.counter -= frequency;
185   if( noise_state.counter <= 0 )
173186   {
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;
178191   }
179   if (!polybit)
192   if (!noise_state.polybit)
180193      sum += vc24;
181194
182195   /* 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 )
185198   {
186      lowpass_counter += samplerate;
187      lowpass_polybit = polybit;
199      noise_state.lowpass_counter += samplerate;
200      noise_state.lowpass_polybit = noise_state.polybit;
188201   }
189   if (!lowpass_polybit)
202   if (!noise_state.lowpass_polybit)
190203      sum += vc25;
191204
192205   return sum;
r1591r1592
374387
375388WRITE8_HANDLER( phoenix_sound_control_a_w )
376389{
377   if( data == sound_latch_a )
378      return;
379
380390   discrete_sound_w(PHOENIX_EFFECT_2_DATA, data & 0x0f);
381391   discrete_sound_w(PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4);
382392//  discrete_sound_w(PHOENIX_EFFECT_3_EN  , data & 0x40);
r1591r1592
388398
389399SOUND_START( phoenix)
390400{
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
391406   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
392417}
393418
394419WRITE8_HANDLER( phoenix_sound_control_b_w )
src/mame/audio/n8080.c
r1591r1592
201201   }
202202   if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
203203   {
204      cpunum_set_input_line(1, 0, PULSE_LINE);
204      cpunum_set_input_line(Machine, 1, 0, PULSE_LINE);
205205   }
206206}
207207
r1591r1592
224224   }
225225   if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
226226   {
227      cpunum_set_input_line(1, 0, PULSE_LINE);
227      cpunum_set_input_line(Machine, 1, 0, PULSE_LINE);
228228   }
229229}
230230
r1591r1592
239239
240240   if (changes & (1 << 6))
241241   {
242      cpunum_set_input_line(1, 0, PULSE_LINE);
242      cpunum_set_input_line(Machine, 1, 0, PULSE_LINE);
243243   }
244244}
245245
src/mame/audio/timeplt.c
r1591r1592
130130   if (last == 0 && data)
131131   {
132132      /* 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);
134134   }
135135
136136   last = data;
src/mame/audio/cinemat.c
r1591r1592
9696static void generic_init(running_machine *machine, void (*callback)(UINT8, UINT8))
9797{
9898   /* call the standard init */
99   machine_reset_cinemat(machine);
99   MACHINE_RESET_CALL(cinemat);
100100
101101   /* set the sound handler */
102102   sound_handler = callback;
r1591r1592
976976        if (sample_playing(2) && cpu_getcurrentframe() > last_frame)
977977        {
978978            if (current_volume > target_volume)
979                current_volume -= 0.078;
979                current_volume -= 0.078f;
980980            if (current_volume < target_volume)
981                current_volume += 0.078;
981                current_volume += 0.078f;
982982            if (current_volume > 0)
983983                sample_set_volume(2, current_volume);
984984            else
r1591r1592
14871487
14881488static void ctc_interrupt(int state)
14891489{
1490   cpunum_set_input_line(1, 0, state);
1490   cpunum_set_input_line(Machine, 1, 0, state);
14911491}
14921492
14931493
r1591r1592
15931593
15941594static MACHINE_RESET( qb3_sound )
15951595{
1596   machine_reset_demon_sound(machine);
1596   MACHINE_RESET_CALL(demon_sound);
15971597   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, qb3_sound_w);
15981598
15991599   /* this patch prevents the sound ROM from eating itself when command $0A is sent */
src/mame/audio/cyberbal.c
r1591r1592
1717static UINT8 sound_data_from_68k_ready, sound_data_from_6502_ready;
1818
1919
20static void update_sound_68k_interrupts(void);
20static void update_sound_68k_interrupts(running_machine *machine);
2121
2222
2323
r1591r1592
6363   memory_set_bankptr(8, &bank_base[0x1000 * ((data >> 6) & 3)]);
6464   coin_counter_w(1, (data >> 5) & 1);
6565   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);
6767   if (!(data & 0x01)) sndti_reset(SOUND_YM2151, 0);
6868
6969}
r1591r1592
8484   if (!io_68k_int)
8585   {
8686      io_68k_int = 1;
87      update_sound_68k_interrupts();
87      update_sound_68k_interrupts(Machine);
8888   }
8989}
9090
r1591r1592
9696 *
9797 *************************************/
9898
99static void update_sound_68k_interrupts(void)
99static void update_sound_68k_interrupts(running_machine *machine)
100100{
101101   int newstate = 0;
102102
r1591r1592
106106      newstate |= 2;
107107
108108   if (newstate)
109      cpunum_set_input_line(3, newstate, ASSERT_LINE);
109      cpunum_set_input_line(machine, 3, newstate, ASSERT_LINE);
110110   else
111      cpunum_set_input_line(3, 7, CLEAR_LINE);
111      cpunum_set_input_line(machine, 3, 7, CLEAR_LINE);
112112}
113113
114114
r1591r1592
117117   if (!fast_68k_int)
118118   {
119119      fast_68k_int = 1;
120      update_sound_68k_interrupts();
120      update_sound_68k_interrupts(machine);
121121   }
122122}
123123
r1591r1592
127127   if (io_68k_int)
128128   {
129129      io_68k_int = 0;
130      update_sound_68k_interrupts();
130      update_sound_68k_interrupts(Machine);
131131   }
132132}
133133
r1591r1592
161161   if (fast_68k_int)
162162   {
163163      fast_68k_int = 0;
164      update_sound_68k_interrupts();
164      update_sound_68k_interrupts(Machine);
165165   }
166166}
src/mame/audio/galaxian.c
r1591r1592
1919#define SHOOT_LENGTH 13000
2020
2121#define TOOTHSAW_LENGTH 16
22#define TOOTHSAW_VOLUME 36
22#define TOOTHSAW_VOLUME 0.36f
2323#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
2727#define NOISE_AMPLITUDE (70*256)
2828#define TOOTHSAW_AMPLITUDE (64*256)
2929
r1591r1592
344344   vol = 0;
345345
346346   tone_stream = stream_create(0,1,SOUND_CLOCK/STEPS,NULL,tone_update);
347   stream_set_output_gain(tone_stream, 0, TOOTHSAW_VOLUME / 100.0);
347   stream_set_output_gain(tone_stream, 0, TOOTHSAW_VOLUME);
348348
349349   sample_set_volume(CHANNEL_NOISE,0);
350350   sample_start_raw(CHANNEL_NOISE,noisewave,NOISE_LENGTH,NOISE_RATE,1);
src/mame/audio/trackfld.c
r1591r1592
8989    if (last == 0 && data)
9090    {
9191        /* 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);
9393    }
9494
9595    last = data;
src/mame/audio/cage.c
r1591r1592
183183{
184184   if (state)
185185      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);
187187}
188188
189189
r1591r1592
212212   tms32031_io_regs[DMA_SOURCE_ADDR] = param;
213213
214214   /* 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);
216216   dma_enabled = 0;
217217}
218218
r1591r1592
281281   int which = param;
282282
283283   /* 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);
285285   cage_timer_enabled[which] = 0;
286286   update_timer(which);
287287}
r1591r1592
466466      logerror("%06X:CAGE read command = %04X\n", activecpu_get_pc(), cage_from_main);
467467   cpu_to_cage_ready = 0;
468468   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);
470470   return cage_from_main;
471471}
472472
r1591r1592
514514   cage_from_main = param;
515515   cpu_to_cage_ready = 1;
516516   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);
518518}
519519
520520
r1591r1592
546546   /* CPU is reset if both control lines are 0 */
547547   if (!(cage_control & 3))
548548   {
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);
550550
551551      dma_enabled = 0;
552552      dma_timer_enabled = 0;
r1591r1592
563563      cage_to_cpu_ready = 0;
564564   }
565565   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);
567567
568568   /* update the control state */
569569   update_control_lines();
src/mame/audio/namco54.c
r1591r1592
109109
110110static TIMER_CALLBACK( namco_54xx_irq_clear )
111111{
112   cpunum_set_input_line(param, 0, CLEAR_LINE);
112   cpunum_set_input_line(machine, param, 0, CLEAR_LINE);
113113}
114114
115115void namco_54xx_write(UINT8 data)
r1591r1592
121121
122122   timer_call_after_resynch(NULL, data, namco_54xx_latch_callback);
123123
124   cpunum_set_input_line(cpunum, 0, ASSERT_LINE);
124   cpunum_set_input_line(Machine, cpunum, 0, ASSERT_LINE);
125125
126126   // The execution time of one instruction is ~4us, so we must make sure to
127127   // give the cpu time to poll the /IRQ input before we clear it.
src/mame/audio/senjyo.c
r1591r1592
88/* z80 pio */
99static void pio_interrupt(int state)
1010{
11   cpunum_set_input_line(1, 0, state);
11   cpunum_set_input_line(Machine, 1, 0, state);
1212}
1313
1414static const z80pio_interface pio_intf =
r1591r1592
2121/* z80 ctc */
2222static void ctc_interrupt (int state)
2323{
24   cpunum_set_input_line(1, 0, state);
24   cpunum_set_input_line(Machine, 1, 0, state);
2525}
2626
2727static z80ctc_interface ctc_intf =
src/mame/audio/exidy440.c
r1591r1592
357357READ8_HANDLER( exidy440_sound_command_r )
358358{
359359   /* 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);
361361   exidy440_sound_command_ack = 1;
362362
363363   return exidy440_sound_command;
r1591r1592
393393
394394WRITE8_HANDLER( exidy440_sound_interrupt_clear_w )
395395{
396   cpunum_set_input_line(1, 0, CLEAR_LINE);
396   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
397397}
398398
399399
src/mame/audio/mcr.c
r1591r1592
314314
315315   /* if the low 5 bits clocked to 0, bit 6 has changed state */
316316   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);
318318}
319319
320320static READ8_HANDLER( ssio_irq_clear )
321321{
322322   /* a read here asynchronously resets the 14024 count, clearing /SINT */
323323   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);
325325   return 0xff;
326326}
327327
r1591r1592
397397   {
398398      int i;
399399
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);
401401
402402      /* latches also get reset */
403403      for (i = 0; i < 4; i++)
r1591r1592
407407   }
408408   /* going low resets and reactivates the CPU */
409409   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);
411411}
412412
413413READ8_HANDLER( ssio_input_port_r )
r1591r1592
527527
528528static void csdeluxe_irq(int state)
529529{
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);
531533}
532534
533535static TIMER_CALLBACK( csdeluxe_delayed_data_w )
r1591r1592
574576
575577void csdeluxe_reset_w(int state)
576578{
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);
578580}
579581
580582
r1591r1592
647649
648650static void soundsgood_irq(int state)
649651{
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);
651655}
652656
653657static TIMER_CALLBACK( soundsgood_delayed_data_w )
r1591r1592
675679void soundsgood_reset_w(int state)
676680{
677681//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);
679683}
680684
681685
r1591r1592
738742
739743static void turbocs_irq(int state)
740744{
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);
742748}
743749
744750static TIMER_CALLBACK( turbocs_delayed_data_w )
r1591r1592
765771
766772void turbocs_reset_w(int state)
767773{
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);
769775}
770776
771777
r1591r1592
869875
870876static void squawkntalk_irq(int state)
871877{
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);
873881}
874882
875883static TIMER_CALLBACK( squawkntalk_delayed_data_w )
r1591r1592
887895
888896void squawkntalk_reset_w(int state)
889897{
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);
891899}
892900
893901
r1591r1592
937945
938946/********* machine driver ***********/
939947MACHINE_DRIVER_START(squawk_n_talk)
940   MDRV_CPU_ADD_TAG("snt", M6802, SQUAWKTALK_CLOCK/4)
948   MDRV_CPU_ADD_TAG("snt", M6802, SQUAWKTALK_CLOCK)
941949   MDRV_CPU_PROGRAM_MAP(squawkntalk_map,0)
942950
943951   /* only used on Discs of Tron, which is stereo */
src/mame/audio/t5182.c
r1591r1592
168168      return;
169169
170170   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);
172172   else   /* IRQ pending */
173      cpunum_set_input_line(cpunum,0,ASSERT_LINE);
173      cpunum_set_input_line(machine, cpunum,0,ASSERT_LINE);
174174}
175175
176176
src/mame/audio/segasnd.c
r1591r1592
215215   speech_latch = data;
216216
217217   /* 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);
219219
220220   /* a clock on the high bit clocks a 1 into T0 */
221221   if (!(old & 0x80) && (data & 0x80))
r1591r1592
314314void sega_usb_reset(UINT8 t1_clock_mask)
315315{
316316   /* 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);
318318
319319   /* start the clock timer */
320320   timer_pulse(attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock);
r1591r1592
346346   int data = param;
347347
348348   /* 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);
350350
351351   /* if the CLEAR line is set, the low 7 bits of the input are ignored */
352352   if ((usb.last_p2_value & 0x40) == 0)
src/mame/audio/aztarac.c
r1591r1592
2323      soundlatch_w(offset, data);
2424      sound_status ^= 0x21;
2525      if (sound_status & 0x20)
26         cpunum_set_input_line(1, 0, HOLD_LINE);
26         cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
2727   }
2828}
2929
r1591r1592
4949    sound_status ^= 0x10;
5050
5151    if (sound_status & 0x10)
52        cpunum_set_input_line(1,0,HOLD_LINE);
52        cpunum_set_input_line(machine, 1,0,HOLD_LINE);
5353}
5454
5555
src/mame/audio/taitosnd.c
r1591r1592
4444{
4545   if ( tc0140syt.nmi_req && tc0140syt.nmi_enabled )
4646   {
47      cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE );
47      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE );
4848      tc0140syt.nmi_req = 0;
4949   }
5050}
r1591r1592
9898//#endif
9999         /* this does a hi-lo transition to reset the sound cpu */
100100         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);
102102         else
103103         {
104            cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
104            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
105105                cpu_spin(); /* otherwise no sound in driftout */
106106            }
107107         break;
src/mame/audio/irem.c
r1591r1592
44#include "sound/ay8910.h"
55#include "sound/msm5205.h"
66
7static UINT8 port1,port2;
78
9
10static SOUND_START( irem_audio )
11{
12   state_save_register_global(port1);
13   state_save_register_global(port2);
14}
15
16
817WRITE8_HANDLER( irem_sound_cmd_w )
918{
1019   if ((data & 0x80) == 0)
11      soundlatch_w(0,data & 0x7f);
20      soundlatch_w(0, data & 0x7f);
1221   else
13      cpunum_set_input_line(1,0,HOLD_LINE);
22      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
1423}
1524
1625
17static int port1,port2;
26static WRITE8_HANDLER( irem_sound_irq_ack_w )
27{
28   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
29}
1830
31
1932static WRITE8_HANDLER( irem_port1_w )
2033{
2134   port1 = data;
r1591r1592
8396
8497static void irem_adpcm_int(int data)
8598{
86   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
99   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
87100
88101   /* the first MSM5205 clocks the second */
89102   MSM5205_vclk_w(1,1);
r1591r1592
128141
129142
130143
131static ADDRESS_MAP_START( irem_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
132   AM_RANGE(0x4000, 0xffff) AM_READ(MRA8_ROM)
133ADDRESS_MAP_END
134
135static ADDRESS_MAP_START( irem_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
136   AM_RANGE(0x0800, 0x0800) AM_WRITE(MWA8_NOP)    /* IACK */
144static ADDRESS_MAP_START( irem_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
145   AM_RANGE(0x0800, 0x0800) AM_WRITENOP
137146   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
140149ADDRESS_MAP_END
141150
142static 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)
151static 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)
145154ADDRESS_MAP_END
146155
147static 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)
150ADDRESS_MAP_END
151156
152
153157MACHINE_DRIVER_START( irem_audio )
154158
159   MDRV_SOUND_START(irem_audio)
160
155161   /* 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)
160165
161166   /* sound hardware */
162167   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/audio/leland.c
r1591r1592
723723   /* generate the appropriate interrupt */
724724   i80186.intr.poll_status = 0x8000 | new_vector;
725725   if (!i80186.intr.pending)
726      cpunum_set_input_line(2, 0, ASSERT_LINE);
726      cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
727727   i80186.intr.pending = 1;
728728   if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", attotime_to_double(timer_get_time()), new_vector);
729729}
r1591r1592
16671667   }
16681668
16691669   /* /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);
16711671
16721672   /* /NMI */
16731673/*  If the master CPU doesn't get a response by the time it's ready to send
16741674    the next command, it uses an NMI to force the issue; unfortunately, this
16751675    seems to really screw up the sound system. It turns out it's better to
16761676    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);*/
16781678
16791679   /* INT0 */
16801680   if (data & 0x20)
src/mame/audio/carnival.c
r1591r1592
228228   port2State = data;
229229
230230   if ( bitsGoneLow & OUT_PORT_2_BEAR )
231   {
232231      PLAY( SND_BEAR, 0 );
233   }
234232
235233   if ( bitsGoneLow & OUT_PORT_2_RANKING )
236   {
237234      PLAY( SND_RANKING, 0 );
238   }
239235
240236   if ( bitsGoneHigh & OUT_PORT_2_MUSIC_RESET )
241   {
242237      /* 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 );
245239}
246240
247241
src/mame/audio/dkong.c
r1591r1592
166166#define DK_C30      CAP_U(10)
167167#define DK_C32      CAP_U(10)
168168#define DK_C34      CAP_N(10)
169#define DK_C159      CAP_N(0)      /* 100nF in Schematics but sound is way off */
169#define DK_C159      CAP_N(100)
170170
171171
172172/*
r1591r1592
367367#if DK_NO_FILTERS
368368   DISCRETE_OUTPUT(NODE_288, 32767.0/5.0 * 10)
369369#else
370   DISCRETE_OUTPUT(NODE_296, 32767.0/5.0 * 3)
370   DISCRETE_OUTPUT(NODE_296, 32767.0/5.0 * 2)
371371#endif
372372
373373DISCRETE_SOUND_END
r1591r1592
889889
890890static SOUND_RESET( dkongjr )
891891{
892   sound_reset_dkong(machine);
892   SOUND_RESET_CALL(dkong);
893893   soundlatch_w(0,0x00);
894894}
895895
r1591r1592
11171117WRITE8_HANDLER( dkong_audio_irq_w )
11181118{
11191119   if (data)
1120      cpunum_set_input_line(1, 0, ASSERT_LINE);
1120      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
11211121   else
1122      cpunum_set_input_line(1, 0, CLEAR_LINE);
1122      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
11231123}
11241124
11251125WRITE8_HANDLER( dkong_snd_disc_w )
r1591r1592
12731273
12741274static struct TMS5110interface tms5110_interface =
12751275{
1276   TMS5110_IS_M58817,
12771276   REGION_SOUND1,      /* Sample Rom */
12781277   NULL,
12791278   NULL
r1591r1592
13171316   MDRV_CPU_MODIFY("sound")
13181317   MDRV_CPU_IO_MAP(radarsc1_sound_io_map, 0)
13191318
1320   MDRV_SOUND_ADD(TMS5110, 640000)
1319   MDRV_SOUND_ADD(M58817, XTAL_640kHz)
13211320   MDRV_SOUND_CONFIG(tms5110_interface)
13221321   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
13231322
src/mame/audio/taito_en.c
r1591r1592
7373   /* Only cause IRQ if the mask is set to allow it */
7474   if (m68681_imr&8) {
7575      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);
7777      imr_status|=0x8;
7878   }
7979}
r1591r1592
9696
9797   /* IRQ ack */
9898   if (offset==0xf) {
99      cpunum_set_input_line(1, 6, CLEAR_LINE);
99      cpunum_set_input_line(Machine, 1, 6, CLEAR_LINE);
100100      return 0;
101101   }
102102
r1591r1592
257257   sound_ram[2]=ROM[0x80002];
258258   sound_ram[3]=ROM[0x80003];
259259
260   //cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
260   //cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
261261}
262262
263263const struct ES5505interface es5505_interface =
src/mame/audio/harddriv.c
r1591r1592
6565 *
6666 *************************************/
6767
68static void update_68k_interrupts(void)
68static void update_68k_interrupts(running_machine *machine)
6969{
7070   int irqline = 0;
7171
r1591r1592
7373   if (irq68k) irqline = 3;
7474
7575   if (irqline)
76      cpunum_set_input_line(hdcpu_sound, irqline, ASSERT_LINE);
76      cpunum_set_input_line(machine, hdcpu_sound, irqline, ASSERT_LINE);
7777   else
78      cpunum_set_input_line(hdcpu_sound, 7, CLEAR_LINE);
78      cpunum_set_input_line(machine, hdcpu_sound, 7, CLEAR_LINE);
7979}
8080
8181
r1591r1592
104104{
105105   maindata = param;
106106   mainflag = 1;
107   update_68k_interrupts();
107   update_68k_interrupts(machine);
108108}
109109
110110
r1591r1592
117117
118118WRITE16_HANDLER( hd68k_snd_reset_w )
119119{
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);
122122   mainflag = soundflag = 0;
123   update_68k_interrupts();
123   update_68k_interrupts(Machine);
124124   logerror("%06X:Reset sound\n", activecpu_get_previouspc());
125125}
126126
r1591r1592
135135READ16_HANDLER( hdsnd68k_data_r )
136136{
137137   mainflag = 0;
138   update_68k_interrupts();
138   update_68k_interrupts(Machine);
139139   logerror("%06X:sound read from main=%04X\n", activecpu_get_previouspc(), maindata);
140140   return maindata;
141141}
r1591r1592
221221      case 4:   /* RES320 */
222222         logerror("%06X:RES320=%d\n", activecpu_get_previouspc(), data);
223223         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);
225225         break;
226226
227227      case 7:   /* LED */
r1591r1592
239239WRITE16_HANDLER( hdsnd68k_irqclr_w )
240240{
241241   irq68k = 0;
242   update_68k_interrupts();
242   update_68k_interrupts(Machine);
243243}
244244
245245
r1591r1592
357357{
358358   /* generate 68k IRQ */
359359   irq68k = 1;
360   update_68k_interrupts();
360   update_68k_interrupts(Machine);
361361}
362362
363363
src/mame/audio/m72.c
r1591r1592
100100
101101   cpunum_set_input_line_vector(1,0,irqvector);
102102   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);
104104   else   /* IRQ pending */
105      cpunum_set_input_line(1,0,ASSERT_LINE);
105      cpunum_set_input_line(machine, 1,0,ASSERT_LINE);
106106}
107107
108108MACHINE_RESET( m72_sound )
src/mame/audio/seibu.c
r1591r1592
287287   RST18_CLEAR
288288};
289289
290static void update_irq_lines(int param)
290static void update_irq_lines(running_machine *machine, int param)
291291{
292292   static int irq1,irq2;
293293
r1591r1592
315315   }
316316
317317   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);
319319   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);
321321}
322322
323323WRITE8_HANDLER( seibu_irq_clear_w )
324324{
325   update_irq_lines(VECTOR_INIT);
325   update_irq_lines(Machine, VECTOR_INIT);
326326}
327327
328328WRITE8_HANDLER( seibu_rst10_ack_w )
r1591r1592
332332
333333WRITE8_HANDLER( seibu_rst18_ack_w )
334334{
335   update_irq_lines(RST18_CLEAR);
335   update_irq_lines(Machine, RST18_CLEAR);
336336}
337337
338338void seibu_ym3812_irqhandler(int linestate)
339339{
340   update_irq_lines(linestate ? RST10_ASSERT : RST10_CLEAR);
340   update_irq_lines(Machine, linestate ? RST10_ASSERT : RST10_CLEAR);
341341}
342342
343343void seibu_ym2151_irqhandler(int linestate)
344344{
345   update_irq_lines(linestate ? RST10_ASSERT : RST10_CLEAR);
345   update_irq_lines(Machine, linestate ? RST10_ASSERT : RST10_CLEAR);
346346}
347347
348348void seibu_ym2203_irqhandler(int linestate)
349349{
350   update_irq_lines(linestate ? RST10_ASSERT : RST10_CLEAR);
350   update_irq_lines(Machine, linestate ? RST10_ASSERT : RST10_CLEAR);
351351}
352352
353353/***************************************************************************/
r1591r1592
359359   UINT8 *rom = memory_region(REGION_CPU2);
360360
361361   sound_cpu=1;
362   update_irq_lines(VECTOR_INIT);
362   update_irq_lines(machine, VECTOR_INIT);
363363   if (romlength > 0x10000)
364364      memory_configure_bank(1, 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);
365365}
r1591r1592
371371   UINT8 *rom = memory_region(REGION_CPU3);
372372
373373   sound_cpu=2;
374   update_irq_lines(VECTOR_INIT);
374   update_irq_lines(machine, VECTOR_INIT);
375375   if (romlength > 0x10000)
376376      memory_configure_bank(1, 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);
377377}
r1591r1592
442442            main2sub[offset] = data;
443443            break;
444444         case 4:
445            update_irq_lines(RST18_ASSERT);
445            update_irq_lines(Machine, RST18_ASSERT);
446446            break;
447447         case 6:
448448            /* just a guess */
r1591r1592
473473
474474//  logerror("seibu_main_mustb_w: %x -> %x %x\n", data, main2sub[0], main2sub[1]);
475475
476   update_irq_lines(RST18_ASSERT);
476   update_irq_lines(Machine, RST18_ASSERT);
477477}
478478
479479/***************************************************************************/
src/mame/audio/namcoc7x.c
r1591r1592
168168INTERRUPT_GEN( namcoc7x_interrupt )
169169{
170170   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);
172172   else
173      cpunum_set_input_line(1, M37710_LINE_IRQ2, HOLD_LINE);
173      cpunum_set_input_line(machine, 1, M37710_LINE_IRQ2, HOLD_LINE);
174174}
175175
src/mame/audio/segag80r.c
r1591r1592
933933        D3    = /INT line
934934    */
935935   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);
937937   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
938938}
939939
src/mame/audio/williams.c
r1591r1592
6262    FUNCTION PROTOTYPES
6363****************************************************************************/
6464
65static void init_audio_state(void);
65static void init_audio_state(running_machine *machine);
6666
6767static void cvsd_ym2151_irq(int state);
6868static void adpcm_ym2151_irq(int state);
r1591r1592
376376}
377377
378378
379static void init_audio_state(void)
379static void init_audio_state(running_machine *machine)
380380{
381381   /* reset the YM2151 state */
382382   sndti_reset(SOUND_YM2151, 0);
r1591r1592
385385   williams_sound_int_state = 0;
386386   if (sound_cpunum != -1)
387387   {
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);
391391   }
392392   if (soundalt_cpunum != -1)
393393   {
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);
397397   }
398398}
399399
r1591r1592
411411
412412static void cvsd_irqa(int state)
413413{
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);
415415}
416416
417417
418418static void cvsd_irqb(int state)
419419{
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);
421421}
422422
423423
r1591r1592
428428
429429static void adpcm_ym2151_irq(int state)
430430{
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);
432432}
433433
434434
r1591r1592
487487   if (state)
488488   {
489489      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);
492492   }
493493   /* going low resets and reactivates the CPU */
494494   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);
496496}
497497
498498
r1591r1592
515515
516516static READ8_HANDLER( narc_command_r )
517517{
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);
519519   williams_sound_int_state = 0;
520520   return soundlatch_r(0);
521521}
r1591r1592
524524static WRITE8_HANDLER( narc_command2_w )
525525{
526526   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);
528528}
529529
530530
531531static READ8_HANDLER( narc_command2_r )
532532{
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);
534534   return soundlatch2_r(0);
535535}
536536
r1591r1592
577577void williams_narc_data_w(int data)
578578{
579579   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);
581581   if (!(data & 0x200))
582582   {
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);
584584      williams_sound_int_state = 1;
585585   }
586586}
r1591r1592
593593   {
594594      narc_master_bank_select_w(0, 0);
595595      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);
599599   }
600600   /* going low resets and reactivates the CPU */
601601   else
602602   {
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);
605605   }
606606}
607607
r1591r1592
637637
638638static READ8_HANDLER( adpcm_command_r )
639639{
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);
641641
642642   /* don't clear the external IRQ state for a short while; this allows the
643643       self-tests to pass */
r1591r1592
663663   soundlatch_w(0, data & 0xff);
664664   if (!(data & 0x200))
665665   {
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);
667667      williams_sound_int_state = 1;
668668      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
669669   }
r1591r1592
676676   if (state)
677677   {
678678      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);
681681   }
682682   /* going low resets and reactivates the CPU */
683683   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);
685685}
686686
687687
src/mame/audio/scramble.c
r1591r1592
170170{
171171   /* the Q bar is connected to the Z80's INT line.  But since INT is complemented, */
172172   /* 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);
174174}
175175
176176static void sfx_sh_7474_callback(void)
177177{
178178   /* the Q bar is connected to the Z80's INT line.  But since INT is complemented, */
179179   /* 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);
181181}
182182
183183WRITE8_HANDLER( hotshock_sh_irqtrigger_w )
184184{
185   cpunum_set_input_line(1, 0, ASSERT_LINE);
185   cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
186186}
187187
188188READ8_HANDLER( hotshock_soundlatch_r )
189189{
190   cpunum_set_input_line(1, 0, CLEAR_LINE);
190   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
191191   return soundlatch_r(0);
192192}
193193
r1591r1592
395395
396396static const struct TMS5110interface ad2083_tms5110_interface =
397397{
398   TMS5110_IS_5110A,
399398   -1,                     /* rom_region */
400399   ad2083_speech_rom_read_bit   /* M0 callback function. Called whenever chip requests a single bit of data */
401400};
r1591r1592
455454   MDRV_SOUND_CONFIG(ad2083_ay8910_interface_2)
456455   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
457456
458   MDRV_SOUND_ADD(TMS5110, AD2083_TMS5110_CLOCK)
457   MDRV_SOUND_ADD(TMS5110A, AD2083_TMS5110_CLOCK)
459458   MDRV_SOUND_CONFIG(ad2083_tms5110_interface)
460459   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
461460MACHINE_DRIVER_END
src/mame/audio/system16.c
r1591r1592
2828
2929   port_8255_c03 = (data>>5);
3030
31   cpunum_set_input_line(2, 0, PULSE_LINE);
31   cpunum_set_input_line(machine, 2, 0, PULSE_LINE);
3232}
3333
3434// I'm sure this must be wrong, but it seems to work for quartet music.
r1591r1592
3838
3939   if ((data & 0x0f) != 8)
4040   {
41      cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE);
41      cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE);
4242      timer_set(ATTOTIME_IN_USEC(300), NULL, data, trigger_7751_sound);
4343   }
4444}
src/mame/audio/redalert.c
r1591r1592
11/***************************************************************************
22
3Irem Red Alert sound hardware
3    Irem Red Alert hardware
44
5The 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)
67
7Analogue:
8- Formation Aircraft
9- Dive bombers
10- Helicopters
11- Launcher firing
12- Explosion #1
13- Explosion #2
14- Explosion #3
8****************************************************************************/
159
16Digital:
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
29If you have any questions about how this driver works, don't hesitate to
30ask.  - Mike Balfour (mab22@po.cwru.edu)
31***************************************************************************/
32
3310#include "driver.h"
34#include "cpu/m6502/m6502.h"
11#include "rescap.h"
3512#include "cpu/i8085/i8085.h"
13#include "machine/6821pia.h"
3614#include "sound/ay8910.h"
15#include "sound/hc55516.h"
3716
38static int AY8910_A_input_data = 0;
39static int c030_data = 0;
40static int sound_register_IC1 = 0;
41static int sound_register_IC2 = 0;
4217
43WRITE8_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
40static UINT8 ay8910_latch_1;
41static UINT8 ay8910_latch_2;
42
43static UINT8 ay8910_latch_1;
44
45
46
47/*************************************
48 *
49 *  Read Alert analog sounds
50 *
51 *************************************/
52
53static WRITE8_HANDLER( redalert_analog_w )
4454{
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? */
4663
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);
5165}
5266
53READ8_HANDLER( redalert_voicecommand_r )
67
68
69/*************************************
70 *
71 *  Red Alert audio board
72 *
73 *************************************/
74
75WRITE8_HANDLER( redalert_audio_command_w )
5476{
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);
5684}
5785
58WRITE8_HANDLER( redalert_soundlatch_w )
86
87static WRITE8_HANDLER( redalert_AY8910_w )
5988{
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;
6295
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   }
66112}
67113
68READ8_HANDLER( redalert_AY8910_A_r )
114
115static READ8_HANDLER( redalert_ay8910_latch_1_r )
69116{
70   return AY8910_A_input_data;
117   return ay8910_latch_1;
71118}
72119
73WRITE8_HANDLER( redalert_AY8910_w )
120
121static WRITE8_HANDLER( redalert_ay8910_latch_2_w )
74122{
75   /* BC2 is connected to a pull-up resistor, so BC2=1 always */
76   switch (data)
123   ay8910_latch_2 = data;
124}
125
126
127static 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
134static 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
141ADDRESS_MAP_END
142
143
144static 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
158WRITE8_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
166static void sod_callback(int data)
167{
168   hc55516_digit_w(0, data);
169}
170
171
172static int sid_callback(void)
173{
174   return hc55516_clock_state_r(0);
175}
176
177
178static 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
185static 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)
190ADDRESS_MAP_END
191
192
193
194/*************************************
195 *
196 *  Red Alert audio start
197 *
198 *************************************/
199
200static 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
214MACHINE_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)
235MACHINE_DRIVER_END
236
237
238
239/*************************************
240 *
241 *  Demoneye-X audio board
242 *
243 *************************************/
244
245
246WRITE8_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
255static WRITE8_HANDLER( demoneye_ay8910_latch_1_w )
256{
257   ay8910_latch_1 = data;
258}
259
260
261static READ8_HANDLER( demoneye_ay8910_latch_2_r )
262{
263   return ay8910_latch_2;
264}
265
266
267static WRITE8_HANDLER( demoneye_ay8910_data_w )
268{
269   switch (ay8910_latch_1 & 0x03)
77270   {
78271      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
80278         break;
279
81280      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
84287         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
89289      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
92296         break;
297
93298      default:
94         logerror("Invalid Sound Command: %02X\n",data);
299         logerror("demoneye_ay8910_data_w called with latch %02X  data %02X\n", ay8910_latch_1, data);
95300         break;
96301   }
97302}
98303
99READ8_HANDLER( redalert_sound_register_IC1_r )
304
305static 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
310ADDRESS_MAP_END
311
312
313static const struct AY8910interface demoneye_ay8910_interface =
100314{
101   return sound_register_IC1;
102}
315   soundlatch_r, 0,   /* port A/B read */
316   0, 0            /* port A/B write */
317};
103318
104WRITE8_HANDLER( redalert_sound_register_IC2_w )
319
320static const pia6821_interface demoneye_pia_intf =
105321{
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
335static 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);
107341}
108342
109WRITE8_HANDLER( redalert_AY8910_B_w )
343
344
345/*************************************
346 *
347 *  Demoneye-X audio reset
348 *
349 *************************************/
350
351static SOUND_RESET( demoneye )
110352{
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();
120354}
121355
356
357
358/*************************************
359 *
360 *  Demoneye-X machine driver
361 *
362 *************************************/
363
364MACHINE_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)
381MACHINE_DRIVER_END
src/mame/audio/starwars.c
r1591r1592
5353static TIMER_CALLBACK( snd_interrupt )
5454{
5555   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);
5757}
5858
5959
r1591r1592
8787
8888      case 5: /* 0x85 - Read Interrupt Flag Register */
8989         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);
9191         temp = irq_flag;
9292         irq_flag = 0;   /* Clear int flags */
9393         return temp;
r1591r1592
188188{
189189   port_A &= 0x7f; /* ready to receive new commands from main */
190190   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);
192192   return sound_data;
193193}
194194
r1591r1592
228228   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
229229
230230   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);
232232}
233233
234234WRITE8_HANDLER( starwars_main_wr_w )
r1591r1592
242242   port_A &= 0x3f;
243243
244244   /* 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);
246246}
247247
src/mame/audio/mario.c
r1591r1592
7575 *
7676 * Mario Discrete Sound Interface
7777 *
78 * verified against picture of a TMA1-04-CPU Board. Some
79 * of the values were hard to read, though.
80 *
7881 ****************************************************************/
7982
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                             */
8794
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                             */
101110
111
112
102113/* KT = 0.25 for diode circuit, 0.33 else */
103114
104115#define DISCRETE_LS123(_N, _T, _R, _C) \
r1591r1592
109120#define DISCRETE_BITSET(_N, _N1, _B) DISCRETE_TRANSFORM3(_N, 1, _N1, 1 << ((_B)-1), 0, "01&2>")
110121#define DISCRETE_ENERGY_NAND(_N, _E, _N1, _N2) DISCRETE_TRANSFORM3(_N, _E, _N1, _N2, 1, "201*-")
111122
112#define MR_R20      RES_K(22)
113#define MR_R19      RES_K(22)
114123
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
121124static const discrete_mixer_desc mario_mixer_desc =
122125   {DISC_MIXER_IS_RESISTOR,
123126      {MR_R20, MR_R19, MR_R41, MR_R40},
124127      {0,0,0,0,0},   // no variable resistors
125128      {0,0,0,0,0},  // no node capacitors
126      0, RES_M(1), // Dummy,
129      0, 0,
127130      MR_C31,
128131      MR_C32,
129132      0, 1};
r1591r1592
175178   DISCRETE_MULTIPLY(DS_OUT_SOUND1, 1, NODE_25, TTL_HIGH)
176179
177180   /************************************************/
178   /* SOUND7                              */
181   /* SOUND7                                       */
179182   /************************************************/
180183
181184   DISCRETE_COUNTER(NODE_100,1,0,NODE_118,0xFFFF,DISC_COUNT_UP,0,DISC_CLK_BY_COUNT)
r1591r1592
217220   /* Amplifier: internal amplifier
218221     * Just a 1:n amplifier without filters and no output capacitor
219222     */
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)
221227
222228DISCRETE_SOUND_END
223229
r1591r1592
330336   if (state->last == 1 && data == 0)
331337   {
332338      /* 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);
334340   }
335341
336342   state->last = data;
r1591r1592
362368   {
363369      case 0: /* death */
364370         if (data)
365            cpunum_set_input_line(1,0,ASSERT_LINE);
371            cpunum_set_input_line(Machine, 1,0,ASSERT_LINE);
366372         else
367            cpunum_set_input_line(1,0,CLEAR_LINE);
373            cpunum_set_input_line(Machine, 1,0,CLEAR_LINE);
368374         break;
369375      case 1: /* get coin */
370376         I8035_T_W_AH(0,data & 1);
src/mame/audio/gottlieb.c
r1591r1592
8181      {
8282      case 2:
8383         /* 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);
8585         break;
8686      case 3:
8787      case 4:
8888         /* 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);
9191         break;
9292      }
9393   }
r1591r1592
108108/* callback for the timer */
109109static TIMER_CALLBACK( gottlieb_nmi_generate )
110110{
111   cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
111   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
112112}
113113
114114static const char *const PhonemeTable[0x40] =
r1591r1592
225225/* callback for the timer */
226226static TIMER_CALLBACK( nmi_callback )
227227{
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);
229229}
230230
231231static WRITE8_HANDLER( common_sound_control_w )
r1591r1592
296296
297297WRITE8_HANDLER( gottlieb_cause_dac_nmi_w )
298298{
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);
300300}
src/mame/audio/dcs.c
r1591r1592
758758      /* rev 3/4: HALT the ADSP-2181 until program is downloaded via IDMA */
759759      case 3:
760760      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);
762762         dsio.start_on_next_write = 0;
763763         break;
764764   }
r1591r1592
815815   memset(dcs.control_regs, 0, sizeof(dcs.control_regs));
816816
817817   /* 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);
821821
822822   /* initialize the comm bits */
823823   SET_INPUT_EMPTY();
r1591r1592
14281428   if (dsio.start_on_next_write && --dsio.start_on_next_write == 0)
14291429   {
14301430      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);
14321432   }
14331433}
14341434
r1591r1592
14821482
14831483      /* just run through the init code again */
14841484      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);
14861486   }
14871487
14881488   /* going low resets and reactivates the CPU */
14891489   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);
14911491}
14921492
14931493
r1591r1592
15201520    INPUT LATCH (data from host to DCS)
15211521****************************************************************************/
15221522
1523static void dcs_delayed_data_w(int data)
1523static void dcs_delayed_data_w(running_machine *machine, int data)
15241524{
15251525   if (LOG_DCS_IO)
15261526      logerror("%08X:dcs_data_w(%04X)\n", activecpu_get_pc(), data);
r1591r1592
15291529   cpu_boost_interleave(ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5));
15301530
15311531   /* 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);
15331533
15341534   /* indicate we are no longer empty */
15351535   if (dcs.last_input_empty && dcs.input_empty_cb)
r1591r1592
15431543
15441544static TIMER_CALLBACK( dcs_delayed_data_w_callback )
15451545{
1546   dcs_delayed_data_w(param);
1546   dcs_delayed_data_w(machine, param);
15471547}
15481548
15491549
r1591r1592
15571557   if (!dcs.sport_timer)
15581558      timer_call_after_resynch(NULL, data, dcs_delayed_data_w_callback);
15591559   else
1560       dcs_delayed_data_w(data);
1560       dcs_delayed_data_w(Machine, data);
15611561}
15621562
15631563
r1591r1592
15661566   if (!dcs.last_input_empty && dcs.input_empty_cb)
15671567      (*dcs.input_empty_cb)(dcs.last_input_empty = 1);
15681568   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);
15701570}
15711571
15721572
r1591r1592
17181718   /* set the next timer, but only if it's for a reasonable number */
17191719   if (!dcs.timer_ignore && (dcs.timer_period > 10 || dcs.timer_scale > 1))
17201720      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);
17221722}
17231723
17241724
r1591r1592
18381838         if (data & 0x0200)
18391839         {
18401840            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);
18421842            dcs_boot();
18431843            dcs.control_regs[SYSCONTROL_REG] = 0;
18441844         }
r1591r1592
19321932      reg = dcs.ireg_base;
19331933
19341934      /* 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);
19361936   }
19371937
19381938   /* store it */
r1591r1592
19471947   /* register; if we don't interlock it, we will eventually lose sound (see CarnEvil) */
19481948   /* so we skip the SPORT interrupt if we read with output_control within the last 5 cycles */
19491949   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);
19511951}
19521952
19531953
src/mame/audio/exidy.c
r1591r1592
1111#include "machine/6821pia.h"
1212#include "sound/hc55516.h"
1313#include "sound/5220intf.h"
14#include "sound/s14001a.h"
1514#include "sound/custom.h"
16#include "berzerk.h"
1715
1816
1917
r1591r1592
2422 *************************************/
2523
2624#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)
3130#define BASE_VOLUME            (32767 / 6)
3231
3332enum
r1591r1592
101100   UINT32   fraction;
102101};
103102static struct sh8253_timer_channel sh8253_timer[3];
104static UINT8 has_sh8253;
103static int has_sh8253;
105104
106105/* 5220/CVSD variables */
107static UINT8 has_hc55516;
108static UINT8 has_tms5220;
106static int has_mc3417;
107static int has_tms5220;
109108
110109/* sound streaming variables */
111110static sound_stream *exidy_stream;
r1591r1592
115114
116115/*************************************
117116 *
117 *  Prototypes
118 *
119 *************************************/
120
121static TIMER_CALLBACK( riot_interrupt );
122
123
124
125/*************************************
126 *
118127 *  Interrupt generation helper
119128 *
120129 *************************************/
121130
122131static void update_irq_state(/* unused */ int state)
123132{
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);
125134}
126135
127136
r1591r1592
341350
342351/*************************************
343352 *
344 *  Sound startup routines
353 *  Audio startup routines
345354 *
346355 *************************************/
347356
348static TIMER_CALLBACK( riot_interrupt );
349
350static void *common_sh_start(int _has_sh8253, int _has_tms5220)
357void *exidy_sh6840_sh_start(int clock, const struct CustomSound_interface *config)
351358{
352359   int sample_rate = SH8253_CLOCK;
353   int i;
354360
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));
357362
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
366363   /* allocate the stream */
367364   exidy_stream = stream_create(0, 1, sample_rate, NULL, exidy_stream_update);
368365
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;
371370
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
378371   return auto_malloc(1);
379372}
380373
r1591r1592
382375
383376/*************************************
384377 *
385 *  Sound reset routines
378 *  Audio reset routines
386379 *
387380 *************************************/
388381
389static void common_sh_reset(void)
382void exidy_sh6840_sh_reset(void *token)
390383{
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
409384   /* 6840 */
410385   memset(sh6840_timer, 0, sizeof(sh6840_timer));
411386   sh6840_MSB = 0;
r1591r1592
414389   sh6840_volume[2] = 0;
415390   exidy_sfxctrl = 0;
416391
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;
419398}
420399
421400
r1591r1592
465444      switch (offset & 0x03)
466445      {
467446         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);
470449            riot_porta_data = (riot_porta_data & ~riot_porta_ddr) | (data & riot_porta_ddr);
471450            break;
472451
r1591r1592
660639}
661640
662641
663static WRITE8_HANDLER( exidy_sh6840_w )
642WRITE8_HANDLER( exidy_sh6840_w )
664643{
665644   /* force an update of the stream */
666645   stream_update(exidy_stream);
r1591r1592
720699 *
721700 *************************************/
722701
723static WRITE8_HANDLER( exidy_sfxctrl_w )
702WRITE8_HANDLER( exidy_sfxctrl_w )
724703{
725704   stream_update(exidy_stream);
726705
r1591r1592
775754};
776755
777756
757static 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
778784static void *venture_sh_start(int clock, const struct CustomSound_interface *config)
779785{
780786   pia_config(0, &venture_pia_0_intf);
781787   pia_config(1, &venture_pia_1_intf);
782788
783   return common_sh_start(TRUE, FALSE);
789   return venture_common_sh_start(clock, config, FALSE);
784790}
785791
786792
787793static void venture_sh_reset(void *token)
788794{
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));
790810}
791811
792812
r1591r1592
834854static WRITE8_HANDLER( mtrap_voiceio_w )
835855{
836856   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);
841858
842859   if (!(offset & 0x20))
843860      riot_portb_data = data & 1;
r1591r1592
856873   }
857874
858875   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;
862877
863      return (clock_pulse & 1) << 7;
864   }
865878   return 0;
866879}
867880
r1591r1592
880893
881894MACHINE_DRIVER_START( mtrap_cvsd_audio )
882895
883   MDRV_CPU_ADD(Z80, 3579545/2)
896   MDRV_CPU_ADD(Z80, CVSD_Z80_CLOCK)
884897   MDRV_CPU_PROGRAM_MAP(cvsd_map,0)
885898   MDRV_CPU_IO_MAP(cvsd_iomap,0)
886899
887900   /* audio hardware */
888   MDRV_SOUND_ADD(HC55516, 0)
901   MDRV_SOUND_ADD(MC3417, CVSD_CLOCK)
889902   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
890903MACHINE_DRIVER_END
891904
r1591r1592
973986
974987   state_save_register_global(victory_sound_response_ack_clk);
975988
976   return common_sh_start(TRUE, TRUE);
989   return venture_common_sh_start(clock, config, TRUE);
977990}
978991
979992
980993static void victory_sh_reset(void *token)
981994{
982   common_sh_reset();
995   venture_sh_reset(token);
983996
984997   /* the flip-flop @ F4 is reset */
985998   victory_sound_response_ack_clk = 0;
r1591r1592
10271040   MDRV_SOUND_ADD(TMS5220, 640000)
10281041   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10291042MACHINE_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
1045static void *berzerk_sh_start(int clock, const struct CustomSound_interface *config)
1046{
1047   return common_sh_start(FALSE, FALSE);
1048}
1049
1050
1051static void berzerk_sh_reset(void *token)
1052{
1053   common_sh_reset();
1054}
1055
1056
1057static const struct S14001A_interface berzerk_s14001a_interface =
1058{
1059   REGION_SOUND1   /* voice data region */
1060};
1061
1062
1063static const struct CustomSound_interface berzerk_custom_interface =
1064{
1065   berzerk_sh_start,
1066   0,
1067   berzerk_sh_reset,
1068};
1069
1070
1071MACHINE_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)
1082MACHINE_DRIVER_END
1083
1084
1085WRITE8_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
1137READ8_HANDLER( berzerk_audio_r )
1138{
1139   return ((offset == 4) && !S14001A_bsy_0_r()) ? 0x40 : 0x00;
1140}
src/mame/audio/8080bw.c
r1591r1592
884884{
885885   schaser_effect_555_timer = timer_alloc(schaser_effect_555_cb, NULL);
886886
887   machine_start_mw8080bw(machine);
887   MACHINE_START_CALL(mw8080bw);
888888}
889889
890890
r1591r1592
896896   schaser_sh_port_2_w(0, 0);
897897   schaser_effect_555_time_remain = attotime_zero;
898898
899   machine_reset_mw8080bw(machine);
899   MACHINE_RESET_CALL(mw8080bw);
900900}
901901
902902
src/mame/audio/gyruss.c
r1591r1592
7878WRITE8_HANDLER( gyruss_sh_irqtrigger_w )
7979{
8080   /* 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);
8282}
8383
8484WRITE8_HANDLER( gyruss_i8039_irq_w )
8585{
86   cpunum_set_input_line(3, 0, PULSE_LINE);
86   cpunum_set_input_line(Machine, 3, 0, PULSE_LINE);
8787}
src/mame/machine/nycaptor.c
r1591r1592
5555   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
5656   {
5757      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);
5959      main_sent = 0;
6060
6161   }
r1591r1592
102102
103103   from_main = data;
104104   main_sent = 1;
105   cpunum_set_input_line(3,0,ASSERT_LINE);
105   cpunum_set_input_line(Machine, 3,0,ASSERT_LINE);
106106}
107107
108108READ8_HANDLER( nycaptor_mcu_r )
src/mame/machine/scudsp.c
r1591r1592
319319   if(LEF) dsp_reg.pc = (data & 0xff);
320320   if(EXF) dsp_execute_program();
321321   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);
323323}
324324
325325void dsp_prg_data(UINT32 data)
src/mame/machine/xevious.c
r1591r1592
4747
4848   if( battles_customio_command & 0x10 ){
4949      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);
5151      }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);
5454      }
5555   }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);
5858   }
5959   battles_customio_command_count++;
6060}
r1591r1592
180180
181181INTERRUPT_GEN( battles_interrupt_4 )
182182{
183   cpunum_set_input_line(3, 0, HOLD_LINE);
183   cpunum_set_input_line(machine, 3, 0, HOLD_LINE);
184184}
185185
src/mame/machine/irem_cpu.c
r1591r1592
300300
301301
302302const 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
309309   0x26,xxxx,xxxx,0x8b,xxxx,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0xf1,0xb3,xxxx, /* 30 */
310310//
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                                !!!! ^^^^
317317   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//            ^^^^                           ^^^^                     ^^^^ ????
329329   xxxx,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,xxxx,xxxx,0x1f,0x23,xxxx, /* d0 */
330//           ^^^^                                               ????
330//       ^^^^                                               ????
331331   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
335335};
336336
337337
338338/*
339339missing opcode:
340
3411**14 -> 09? (2097b - 20980 (01 09 11 31
342+++19 -> 79? (2282f - routine from 2281f to 22871) (78, 79, 7a, 7b)
3430++1b -> 19? (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (09,11,21,29,31 - 01,19)
34401+22 -> 00? (1deff - routine from 1dee8 to 1df26) no 08,18,20,30 - ok 00,10
3450++26 -> 29? (14ed_ , 198e_
34601*29 -> 48? (1df22 - routine from 1df1d to
34701+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 -
3511//5a -> 76? (222fc - routine from 222ed to ) (7x j...) 70 76 78 7a 7c
340N**14 -> 08? (2097b 20980 - routine from 2097a) (00 01 08 09 30 31) probably 08 - after the start and before the menu
341             - to handle the player number
342N++26 -> 29? (14ed_ , 198e_
343N--41 -> 19?
344N//46 -> 10? (1461b
345N--4e -> 19? (208ac -
346Y//5a -> 76? (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,71,77,79,7a,7b,7d,7f - ok 76 78 7c 7e
3523471//62 -> 28? (1cf86 1cfa3 - routine from 1cf61 to 1cff4)  (water in level 1)
3531--83 -> b7? (194cd - routine from
3540**84 -> 18? (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,10,18,20,28,30)
3481--83 -> b7? (194cd - routine from) no b7,b3,b4 ok b6,b5
3490**84 -> 18? (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,18,20,28,30)
355350---9f -> 19? (
356351///ab -> 42?
357352---b1 -> 19?
358---b2 -> 19? (20a8c - 20acd
353---b2 -> 20. (20a8b - 20acc             probably 20 - after the start and before the menu - to handle the player number
359354///b3 -> 19? (216b6 - 216cf
360///ba -> 4b? (1094d, 10b28 - routine from 10948 to 10b73) one byte (4b
36101+ce -> 11? (10236 - routine from 1017e to 10254) (01, 09, 11, 19, 21, 29, 31)
35501+ce -> 01? (10236 - routine from 1017e to 10254) (01, 09, 19, 21, 29, 31) -> probably 01
362356///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
364359
360rz probably:
36119 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) ok 79,7d,7f -> 79
36222 -> 11 (1deff - routine from 1dee8 to 1df26) -> 11 - to handle sprite animation
3632d -> 10 (1df1d - routine from 1dee8 to 1df26) -> 10 - to handle sprite animation
36429 -> 98 (1df22 - routine from 1dee8 to 1df26) -> 98 - to handle sprite animation
365ba -> 4b (1094d, 10b28 - routine from 10948 to 10b73) one byte -> probably 4b
365366
366367rz guess:
3673682b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) (ok 40,48,96) -> 40
r1591r1592
3693702c -> 28 (20333 - routine from 2032a to 20366)
37037159 -> 2c (220cf - 2037f - routine from 2202f to ) 2bytes (2c,
37137263 -> 7d (1df7f, 1df8c, 1df95,21f08 - routine from 1df1d to ) - two bytes j..
3731b -> 8f (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (pop instruction for the push in 1d8e6)
372374a7 -> b4 (2029a - routine from 20290 to
373375ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc)
374376b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) 7f,7d,7b  -  79 - "77"
r1591r1592
779781   for (A = 0;A < size; A++)
780782      irem_cpu_decrypted[A] = decryption_table[rom[A]];
781783
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
784786   // 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 (to force to not decrypt the code from 0xa8fd to 0xa90b)
787   // for now we use "cd" (int) instruction + hack
786788
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];
790803
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
791819/*
792820    for (A=0; A<256; A++) {
793821        t[A]=0;
src/mame/machine/cubocd32.c
r1591r1592
200200
201201NVRAM_HANDLER( cd32 )
202202{
203   nvram_handler_i2cmem_0( machine, file, read_or_write );
203   NVRAM_HANDLER_CALL(i2cmem_0);
204204}
205205
206206/*************************************
src/mame/machine/stactics.c
r1591r1592
8484            stactics_vert_pos++;
8585    }
8686
87    cpunum_set_input_line(0,0,HOLD_LINE);
87    cpunum_set_input_line(machine, 0,0,HOLD_LINE);
8888}
8989
9090WRITE8_HANDLER( stactics_coin_lockout_w )
src/mame/machine/playch10.c
r1591r1592
101101
102102WRITE8_HANDLER( pc10_GAMERES_w )
103103{
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 );
105105}
106106
107107WRITE8_HANDLER( pc10_GAMESTOP_w )
108108{
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 );
110110}
111111
112112WRITE8_HANDLER( pc10_PPURES_w )
r1591r1592
292292DRIVER_INIT( pc_gun )
293293{
294294   /* common init */
295   driver_init_playch10(machine);
295   DRIVER_INIT_CALL(playch10);
296296
297297   /* set the control type */
298298   pc10_gun_controller = 1;
r1591r1592
304304DRIVER_INIT( pc_hrz )
305305{
306306   /* common init */
307   driver_init_playch10(machine);
307   DRIVER_INIT_CALL(playch10);
308308
309309   /* setup mirroring */
310310   mirroring = PPU_MIRROR_HORZ;
r1591r1592
438438   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, aboard_vrom_switch_w );
439439
440440   /* common init */
441   driver_init_playch10(machine);
441   DRIVER_INIT_CALL(playch10);
442442
443443   /* set the mirroring here */
444444   mirroring = PPU_MIRROR_VERT;
r1591r1592
465465   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, bboard_rom_switch_w );
466466
467467   /* common init */
468   driver_init_playch10(machine);
468   DRIVER_INIT_CALL(playch10);
469469
470470   /* set the mirroring here */
471471   mirroring = PPU_MIRROR_VERT;
r1591r1592
486486   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, cboard_vrom_switch_w );
487487
488488   /* common init */
489   driver_init_playch10(machine);
489   DRIVER_INIT_CALL(playch10);
490490}
491491
492492/**********************************************************************************/
r1591r1592
505505   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w );
506506
507507   /* common init */
508   driver_init_playch10(machine);
508   DRIVER_INIT_CALL(playch10);
509509}
510510
511511/* D Board games with extra ram (Metroid) */
r1591r1592
513513DRIVER_INIT( pcdboard_2 )
514514{
515515   /* 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));
518518
519519   /* common init */
520   driver_init_pcdboard(machine);
520   DRIVER_INIT_CALL(pcdboard);
521521}
522522
523523/**********************************************************************************/
r1591r1592
605605   ppu_latch = mapper9_latch;
606606
607607   /* 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));
610610
611611   /* common init */
612   driver_init_playch10(machine);
612   DRIVER_INIT_CALL(playch10);
613613}
614614
615615/**********************************************************************************/
r1591r1592
628628   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w );
629629
630630   /* common init */
631   driver_init_playch10(machine);
631   DRIVER_INIT_CALL(playch10);
632632}
633633
634634/* F Board games with extra ram (Baseball Stars) */
r1591r1592
636636DRIVER_INIT( pcfboard_2 )
637637{
638638   /* 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));
641641
642642   /* common init */
643   driver_init_pcfboard(machine);
643   DRIVER_INIT_CALL(pcfboard);
644644}
645645
646646/**********************************************************************************/
r1591r1592
659659      if ( --gboard_scanline_counter == -1 )
660660      {
661661         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 );
663663      }
664664   }
665665}
r1591r1592
805805   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w );
806806
807807   /* 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));
810810
811811   gboard_banks[0] = 0x1e;
812812   gboard_banks[1] = 0x1f;
r1591r1592
815815   gboard_4screen = 0;
816816
817817   /* common init */
818   driver_init_playch10(machine);
818   DRIVER_INIT_CALL(playch10);
819819}
820820
821821DRIVER_INIT( pcgboard_type2 )
822822{
823823   /* common init */
824   driver_init_pcgboard(machine);
824   DRIVER_INIT_CALL(pcgboard);
825825
826826   /* enable 4 screen mirror */
827827   gboard_4screen = 1;
r1591r1592
853853   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, iboard_rom_switch_w );
854854
855855   /* common init */
856   driver_init_playch10(machine);
856   DRIVER_INIT_CALL(playch10);
857857}
858858
859859/**********************************************************************************/
r1591r1592
869869   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, gboard_rom_switch_w );
870870
871871   /* 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));
874874
875875   gboard_banks[0] = 0x1e;
876876   gboard_banks[1] = 0x1f;
r1591r1592
878878   gboard_scanline_latch = 0;
879879
880880   /* common init */
881   driver_init_playch10(machine);
881   DRIVER_INIT_CALL(playch10);
882882}
883883
884884/**********************************************************************************/
r1591r1592
894894   mmc1_rom_mask = 0x0f;
895895
896896   /* 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));
899899
900900   /* Roms are banked at $8000 to $bfff */
901901   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w );
902902
903903   /* common init */
904   driver_init_playch10(machine);
904   DRIVER_INIT_CALL(playch10);
905905}
src/mame/machine/bublbobl.c
r1591r1592
2626   /* bit 3 n.c. */
2727
2828   /* 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);
3030
3131   /* bit 5 resets mcu */
3232   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);
3434
3535   /* bit 6 enables display */
3636   bublbobl_video_enable = data & 0x40;
r1591r1592
5959
6060WRITE8_HANDLER( bublbobl_nmitrigger_w )
6161{
62   cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
62   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
6363}
6464
6565
r1591r1592
9898
9999static TIMER_CALLBACK( nmi_callback )
100100{
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);
102102   else pending_nmi = 1;
103103}
104104
r1591r1592
118118   sound_nmi_enable = 1;
119119   if (pending_nmi)
120120   {
121      cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE);
121      cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE);
122122      pending_nmi = 0;
123123   }
124124}
r1591r1592
199199   {
200200//      logerror("triggering IRQ on main CPU\n");
201201      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);
203203   }
204204
205205   // bit 7: select read or write shared RAM
r1591r1592
370370{
371371   /* I don't know how to handle the interrupt line so I just toggle it every time. */
372372   if (cpu_getiloops() & 1)
373      cpunum_set_input_line(3,0,CLEAR_LINE);
373      cpunum_set_input_line(machine, 3,0,CLEAR_LINE);
374374   else
375      cpunum_set_input_line(3,0,ASSERT_LINE);
375      cpunum_set_input_line(machine, 3,0,ASSERT_LINE);
376376}
377377
378378
r1591r1592
477477      bublbobl_mcu_sharedram[0x7c] = mame_rand(Machine)%6;
478478
479479      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);
481481   }
482482   if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40))
483483   {
src/mame/machine/galaxian.c
r1591r1592
3232static void galaxian_7474_9M_1_callback(void)
3333{
3434   /* 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);
3636}
3737
3838static const struct TTL7474_interface galaxian_7474_9M_2_intf =
r1591r1592
406406   for (i = 0;i < memory_region_length(REGION_CPU1);i++)
407407      rom[i] = decode_mooncrst(rom[i],i);
408408
409   driver_init_mooncrsu(machine);
409   DRIVER_INIT_CALL(mooncrsu);
410410}
411411
412412DRIVER_INIT( mooncrgx )
r1591r1592
493493
494494DRIVER_INIT( gteikob2 )
495495{
496   driver_init_pisces(machine);
496   DRIVER_INIT_CALL(pisces);
497497
498498   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7006, 0x7006, 0, 0, gteikob2_flip_screen_x_w);
499499   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7007, 0x7007, 0, 0, gteikob2_flip_screen_y_w);
r1591r1592
501501
502502DRIVER_INIT( azurian )
503503{
504   driver_init_pisces(machine);
504   DRIVER_INIT_CALL(pisces);
505505
506506   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6800, 0x6800, 0, 0, azurian_IN1_r);
507507   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0, azurian_IN2_r);
r1591r1592
526526
527527INTERRUPT_GEN( hunchbks_vh_interrupt )
528528{
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);
530530}
531531
532532DRIVER_INIT( ladybugg )
r1591r1592
558558      /* Ghost Muncher never clears this */
559559      galaxian_stars_enable_w(0, 0);
560560
561      cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE);
561      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE);
562562   }
563563}
src/mame/machine/asic65.c
r1591r1592
143143{
144144   /* rom-based means reset and clear states */
145145   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);
147147
148148   /* otherwise, do it manually */
149149   else
r1591r1592
179179   asic65_tfull = 1;
180180   asic65_cmd = param >> 16;
181181   asic65_tdata = param;
182   cpunum_set_input_line(asic65_cpunum, 0, ASSERT_LINE);
182   cpunum_set_input_line(machine, asic65_cpunum, 0, ASSERT_LINE);
183183}
184184
185185
r1591r1592
480480static READ16_HANDLER( asic65_68k_r )
481481{
482482   asic65_tfull = 0;
483   cpunum_set_input_line(asic65_cpunum, 0, CLEAR_LINE);
483   cpunum_set_input_line(Machine, asic65_cpunum, 0, CLEAR_LINE);
484484   return asic65_tdata;
485485}
486486
src/mame/machine/docastle.c
r1591r1592
5656
5757   if (offset == 8)
5858      /* awake the master CPU */
59      cpu_trigger(500);
59      cpu_trigger(Machine, 500);
6060}
6161
6262
r1591r1592
7878
7979WRITE8_HANDLER( docastle_nmitrigger_w )
8080{
81   cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
81   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
8282}
src/mame/machine/tnzs.c
r1591r1592
670670         break;
671671   }
672672
673   cpunum_set_input_line(0, 0, HOLD_LINE);
673   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
674674}
675675
676676MACHINE_RESET( tnzs )
r1591r1592
721721
722722   /* bit 4 resets the second CPU */
723723   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);
725725   else
726      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
726      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
727727
728728   /* bits 0-2 select RAM/ROM bank */
729729   memory_set_bankptr (1, &RAM[0x10000 + 0x4000 * (data & 0x07)]);
r1591r1592
743743            if (data & 0x04)
744744            {
745745               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);
747747            }
748748            /* Coin count and lockout is handled by the i8742 */
749749            break;
src/mame/machine/atari.c
r1591r1592
6868         logerror("atari interrupt_cb TIMR1\n");
6969   }
7070
71   cpunum_set_input_line(0, 0, HOLD_LINE);
71   cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
7272}
7373
7474/**************************************************************
src/mame/machine/midyunit.c
r1591r1592
295295
296296      case SOUND_CVSD:
297297         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));
299300         break;
300301
301302      case SOUND_ADPCM:
302303         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));
304306         break;
305307
306308      case SOUND_NARC:
307309         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));
309312         break;
310313
311314      case SOUND_YAWDIM:
r1591r1592
576579
577580         case SOUND_YAWDIM:
578581            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);
580583            break;
581584      }
582585}
src/mame/machine/flstory.c
r1591r1592
7070   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
7171   {
7272      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);
7474      main_sent = 0;
7575logerror("read command %02x from main cpu\n",portA_in);
7676   }
r1591r1592
117117logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
118118   from_main = data;
119119   main_sent = 1;
120   cpunum_set_input_line(2,0,ASSERT_LINE);
120   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
121121}
122122
123123READ8_HANDLER( flstory_mcu_r )
src/mame/machine/slapfght.c
r1591r1592
3434   getstar_sh_intenabled = 0;   /* disable sound cpu interrupts */
3535
3636   /* 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);
3838
3939   /* MCU */
4040   mcu_val = 0;
r1591r1592
6363/* Reset and hold sound CPU */
6464WRITE8_HANDLER( slapfight_port_00_w )
6565{
66   cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
66   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
6767   getstar_sh_intenabled = 0;
6868}
6969
7070/* Release reset on sound CPU */
7171WRITE8_HANDLER( slapfight_port_01_w )
7272{
73   cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
73   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
7474}
7575
7676/* Disable and clear hardware interrupt */
r1591r1592
144144INTERRUPT_GEN( getstar_interrupt )
145145{
146146   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);
148148}
149149
150150#ifdef UNUSED_FUNCTION
r1591r1592
191191   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
192192   {
193193      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);
195195      main_sent = 0;
196196   }
197197   if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04))
r1591r1592
232232   from_main = data;
233233   main_sent = 1;
234234   mcu_sent=0;
235   cpunum_set_input_line(2,0,ASSERT_LINE);
235   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
236236}
237237
238238READ8_HANDLER( tigerh_mcu_r )
src/mame/machine/asteroid.c
r1591r1592
1818{
1919   /* Turn off interrupts if self-test is enabled */
2020   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);
2222}
2323
2424INTERRUPT_GEN( asterock_interrupt )
2525{
2626   /* Turn off interrupts if self-test is enabled */
2727   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);
2929}
3030
3131INTERRUPT_GEN( llander_interrupt )
3232{
3333   /* Turn off interrupts if self-test is enabled */
3434   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);
3636}
3737
3838
src/mame/machine/mhavoc.c
r1591r1592
4444      alpha_irq_clock++;
4545      if ((alpha_irq_clock & 0x0c) == 0x0c)
4646      {
47         cpunum_set_input_line(0, 0, ASSERT_LINE);
47         cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
4848         alpha_irq_clock_enable = 0;
4949      }
5050   }
r1591r1592
5353   if (has_gamma_cpu)
5454   {
5555      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);
5757   }
5858}
5959
r1591r1592
6161WRITE8_HANDLER( mhavoc_alpha_irq_ack_w )
6262{
6363   /* 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);
6565   alpha_irq_clock = 0;
6666   alpha_irq_clock_enable = 1;
6767}
r1591r1592
7070WRITE8_HANDLER( mhavoc_gamma_irq_ack_w )
7171{
7272   /* 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);
7474   gamma_irq_clock = 0;
7575}
7676
r1591r1592
143143   alpha_data = param;
144144
145145   /* 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);
147147
148148   /* the sound CPU needs to reply in 250microseconds (according to Neil Bradley) */
149149   timer_set(ATTOTIME_IN_USEC(250), NULL, 0, 0);
r1591r1592
319319   player_1 = (data >> 5) & 1;
320320
321321   /* 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);
323323   if (!(data & 0x08))
324324   {
325325      logerror("\t\t\t\t*** resetting gamma processor. ***\n");
src/mame/machine/equites.c
r1591r1592
1919
2020#define MCU_RTNMSB 0x80
2121
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
46extern void equites_8404init(void);
47extern void equites_8404rule(unsigned pc, int offset, int data);
48
49extern READ16_HANDLER(equites_8404_r);
50extern WRITE8_HANDLER(equites_5232_w);
51extern WRITE8_HANDLER(equites_8910control_w);
52extern WRITE8_HANDLER(equites_8910data_w);
53extern WRITE8_HANDLER(equites_dac0_w);
54extern WRITE8_HANDLER(equites_dac1_w);
55
56extern UINT16 *equites_8404ram;
57extern struct const MSM5232interface equites_5232intf;
58extern struct const AY8910interface equites_8910intf;
59
60static 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
64ADDRESS_MAP_END
65
66static 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
78ADDRESS_MAP_END
79
80static ADDRESS_MAP_START( equites_s_writeport, ADDRESS_SPACE_IO, 8 )
81   { 0x00e0, 0x00e5, MWA8_NOP }, // soundboard I/O, ignored
82ADDRESS_MAP_END
83// Common Hardware End
84
85#endif
86
8722/******************************************************************************/
8823// Imports
8924
r1591r1592
179114{
180115   static int parity = 0;
181116
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);
184120}
185121
186122// Optimized Mersenne Twister - courtesy of Shawn J. Cokus, University of Washington
src/mame/machine/decocass.c
r1591r1592
107107   decocass_sound_ack |= 0x80;
108108   /* remove snd cpu data ack bit. i don't see it in the schems, but... */
109109   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);
111111}
112112
113113READ8_HANDLER( decocass_sound_data_r )
r1591r1592
135135{
136136   UINT8 data = soundlatch_r(0);
137137   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);
139139   decocass_sound_ack &= ~0x80;
140140   return data;
141141}
142142
143143static TIMER_CALLBACK( decocass_sound_nmi_pulse )
144144{
145   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
145   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
146146}
147147
148148WRITE8_HANDLER( decocass_sound_nmi_enable_w )
r1591r1592
175175
176176WRITE8_HANDLER( decocass_nmi_reset_w )
177177{
178   cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE );
178   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE );
179179}
180180
181181WRITE8_HANDLER( decocass_quadrature_decoder_reset_w )
r1591r1592
281281   decocass_reset = data;
282282
283283   /* 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 );
285285
286286   /* on reset also remove the sound timer */
287287   if (data & 1)
288288      timer_adjust(decocass_sound_timer, attotime_never, 0, attotime_never);
289289
290290   /* 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 );
292292}
293293
294294static const char *dirnm(int speed)
src/mame/machine/twincobr.c
r1591r1592
3434{
3535   if (twincobr_intenable) {
3636      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);
3838   }
3939}
4040
r1591r1592
4242{
4343   if (twincobr_intenable) {
4444      twincobr_intenable = 0;
45      cpunum_set_input_line(0, 0, HOLD_LINE);
45      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
4646   }
4747}
4848
r1591r1592
158158   if (data == 0) {
159159      if (dsp_execute) {
160160         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);
162162         dsp_execute = 0;
163163      }
164164      twincobr_dsp_BIO = ASSERT_LINE;
r1591r1592
195195   twincobr_dsp_on = enable;
196196   if (enable) {
197197      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);
201201   }
202202   else {
203203      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);
206206   }
207207}
208208
r1591r1592
281281      /****** The following apply to Flying Shark/Wardner only ******/
282282      case 0x00:   /* This means assert the INT line to the DSP */
283283               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);
287287               break;
288288      case 0x01:   /* This means inhibit the INT line to the DSP */
289289               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);
292292               break;
293293   }
294294}
src/mame/machine/konppc.c
r1591r1592
141141            dsp_shared_ram_bank[cgboard_id] = (data >> 24) & 0x1;
142142
143143            if (data & 0x80000000)
144            {
145144               dsp_state[cgboard_id] |= 0x10;
146            }
147145
148146            pci_bridge_enable[cgboard_id] = (data & 0x20000000) ? 1 : 0;
149147
150148            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);
154150            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);
158152
159153            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
163156            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);
167158         }
168159
169160         if (!(mem_mask & 0x000000ff))
170         {
171161            dsp_comm_ppc[cgboard_id][offset] = data & 0xff;
172         }
173162      }
174163      else
175      {
176164         dsp_comm_ppc[cgboard_id][offset] = data;
177      }
178165   }
179166}
180167
r1591r1592
196183{
197184   if (cgboard_id < MAX_CG_BOARDS)
198185   {
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)
200187      COMBINE_DATA(dsp_shared_ram[cgboard_id] + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD)));
201188   }
202189}
r1591r1592
222209      case CGBOARD_TYPE_ZR107:
223210      case CGBOARD_TYPE_GTICLUB:
224211      {
225         //cpunum_set_input_line(2, SHARC_INPUT_FLAG0, ASSERT_LINE);
212         //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG0, ASSERT_LINE);
226213         cpuintrf_push_context(2);
227214         sharc_set_flag_input(0, ASSERT_LINE);
228215         cpuintrf_pop_context();
r1591r1592
230217         if (offset == 1)
231218         {
232219            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);
236221         }
237222         break;
238223      }
src/mame/machine/irobot.c
r1591r1592
180180    if (scanline == 224) irvg_vblank=1;
181181    logerror("SCANLINE CALLBACK %d\n",scanline);
182182    /* 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);
184184
185185    /* set a callback for the next 32-scanline increment */
186186    scanline += 32;
r1591r1592
457457{
458458    logerror("mb done. ");
459459   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);
461461}
462462
463463
r1591r1592
861861      timer_adjust(irmb_timer, attotime_mul(ATTOTIME_IN_NSEC(200), icount), 0, attotime_zero);
862862   }
863863#else
864   cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE);
864   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
865865#endif
866866   irmb_running=1;
867867}
src/mame/machine/leland.c
r1591r1592
469469
470470   /* interrupts generated on the VA10 line, which is every */
471471   /* 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);
473473
474474   /* set a timer for the next one */
475475   scanline += 16;
r1591r1592
486486   leland_last_scanline_int = scanline;
487487
488488   /* 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);
490490
491491   /* set a timer for the next one */
492492   timer_adjust(master_int_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
r1591r1592
497497{
498498   /* check for coins here */
499499   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);
501501}
502502
503503
r1591r1592
11591159
11601160      case 0x02:   /* /GIN2 */
11611161      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);
11631163         break;
11641164
11651165      case 0x03:   /* /IGID */
r1591r1592
11901190   switch (offset)
11911191   {
11921192      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);
11941194         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);
11971197
11981198         if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", safe_activecpu_get_pc(),
11991199               (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
r1591r1592
12681268         break;
12691269
12701270      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);
12741274         break;
12751275
12761276      case 0x08:   /*  */
r1591r1592
13011301READ8_HANDLER( leland_gated_paletteram_r )
13021302{
13031303   if (wcol_enable)
1304      return paletteram_r(offset);
1304      return paletteram[offset];
13051305   return 0xff;
13061306}
13071307
r1591r1592
13401340READ8_HANDLER( ataxx_paletteram_and_misc_r )
13411341{
13421342   if (wcol_enable)
1343      return paletteram_r(offset);
1343      return paletteram[offset];
13441344   else if (offset == 0x7fc || offset == 0x7fd)
13451345   {
13461346      int result = xrom_base[0x00000 | xrom1_addr | ((offset & 1) << 16)];
src/mame/machine/toaplan1.c
r1591r1592
3030INTERRUPT_GEN( toaplan1_interrupt )
3131{
3232   if (toaplan1_intenable)
33      cpunum_set_input_line(0, 4, HOLD_LINE);
33      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
3434}
3535
3636WRITE16_HANDLER( toaplan1_intenable_w )
r1591r1592
9898   if (data == 0) {
9999      if (dsp_execute) {
100100         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);
102102         dsp_execute = 0;
103103      }
104104      demonwld_dsp_BIO = ASSERT_LINE;
r1591r1592
117117   if (enable)
118118   {
119119      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);
123123   }
124124   else
125125   {
126126      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);
129129   }
130130}
131131static void demonwld_restore_dsp(void)
r1591r1592
228228      if (Machine->drv->sound[0].type == SOUND_YM3812)
229229         sndti_reset(SOUND_YM3812, 0);
230230      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);
232232   }
233233}
234234
r1591r1592
307307
308308MACHINE_RESET( zerozone )   /* Hack for ZeroWing and OutZone. See the video driver */
309309{
310   machine_reset_toaplan1(machine);
310   MACHINE_RESET_CALL(toaplan1);
311311   toaplan1_unk_reset_port = 1;
312312}
313313
314314MACHINE_RESET( demonwld )
315315{
316   machine_reset_toaplan1(machine);
316   MACHINE_RESET_CALL(toaplan1);
317317   dsp_addr_w = 0;
318318   main_ram_seg = 0;
319319   dsp_execute = 0;
r1591r1592
330330
331331MACHINE_RESET( vimana )
332332{
333   machine_reset_toaplan1(machine);
333   MACHINE_RESET_CALL(toaplan1);
334334   vimana_credits = 0;
335335   vimana_latch = 0;
336336}
src/mame/machine/namcoio.c
r1591r1592
830830   {
831831      LOG(("NMI cpu %d\n",nmi_cpu[param]));
832832
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);
834834   }
835835   else
836836      LOG(("NMI not generated because cpu %d is suspended\n",nmi_cpu[param]));
src/mame/machine/dc.c
r1591r1592
581581MACHINE_RESET( dc )
582582{
583583   /* 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);
585585
586586   memset(sysctrl_regs, 0, sizeof(sysctrl_regs));
587587   memset(maple_regs, 0, sizeof(maple_regs));
r1591r1592
615615      if (dat & 1)
616616      {
617617         /* 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);
619619      }
620620      else
621621      {
622622         /* 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);
624624      }
625625        }
626626   mame_printf_verbose("AICA REG: write %llx to %x, mask %llx\n", data, offset, mem_mask);
src/mame/machine/scramble.c
r1591r1592
2020
2121MACHINE_RESET( scramble )
2222{
23   machine_reset_galaxian(machine);
23   MACHINE_RESET_CALL(galaxian);
2424
2525   if (cpu_gettotalcpu() > 1)
2626   {
r1591r1592
3232
3333MACHINE_RESET( sfx )
3434{
35   machine_reset_scramble(machine);
35   MACHINE_RESET_CALL(scramble);
3636
3737   sfx_sh_init();
3838}
r1591r1592
4949
5050    ROM[0xc5bc] = 0xaf;
5151*/
52   machine_reset_scramble(machine);
52   MACHINE_RESET_CALL(scramble);
5353
5454   sfx_sh_init();
5555
r1591r1592
6161   UINT8 *RAM = memory_region(REGION_CPU1);
6262   RAM[0x47ff] = 0; /* If not set, it doesn't reset after the 1st time */
6363
64   machine_reset_galaxian(machine);
64   MACHINE_RESET_CALL(galaxian);
6565}
6666
6767static READ8_HANDLER( scrambls_input_port_2_r )
r1591r1592
331331
332332DRIVER_INIT( scobra )
333333{
334   driver_init_scramble_ppi(machine);
334   DRIVER_INIT_CALL(scramble_ppi);
335335
336336   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scramble_background_enable_w);
337337}
338338
339339DRIVER_INIT( atlantis )
340340{
341   driver_init_scramble_ppi(machine);
341   DRIVER_INIT_CALL(scramble_ppi);
342342
343343   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scramble_background_enable_w);
344344}
345345
346346DRIVER_INIT( scramble )
347347{
348   driver_init_atlantis(machine);
348   DRIVER_INIT_CALL(atlantis);
349349
350350   ppi8255_set_portCread (1, scramble_protection_r);
351351   ppi8255_set_portCwrite(1, scramble_protection_w);
r1591r1592
353353
354354DRIVER_INIT( scrambls )
355355{
356   driver_init_atlantis(machine);
356   DRIVER_INIT_CALL(atlantis);
357357
358358   ppi8255_set_portCread(0, scrambls_input_port_2_r);
359359   ppi8255_set_portCread(1, scrambls_protection_r);
r1591r1592
362362
363363DRIVER_INIT( theend )
364364{
365   driver_init_scramble_ppi(machine);
365   DRIVER_INIT_CALL(scramble_ppi);
366366
367367   ppi8255_set_portCwrite(0, theend_coin_counter_w);
368368}
369369
370370DRIVER_INIT( stratgyx )
371371{
372   driver_init_scramble_ppi(machine);
372   DRIVER_INIT_CALL(scramble_ppi);
373373
374374   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0, scramble_background_green_w);
375375   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scramble_background_blue_w);
r1591r1592
381381
382382DRIVER_INIT( tazmani2 )
383383{
384   driver_init_scramble_ppi(machine);
384   DRIVER_INIT_CALL(scramble_ppi);
385385
386386   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scramble_background_enable_w);
387387}
388388
389389DRIVER_INIT( amidar )
390390{
391   driver_init_scramble_ppi(machine);
391   DRIVER_INIT_CALL(scramble_ppi);
392392
393393   /* Amidar has a the DIP switches connected to port C of the 2nd 8255 */
394394   ppi8255_set_portCread(1, input_port_3_r);
r1591r1592
396396
397397DRIVER_INIT( ckongs )
398398{
399   driver_init_scramble_ppi(machine);
399   DRIVER_INIT_CALL(scramble_ppi);
400400
401401   ppi8255_set_portBread(0, ckongs_input_port_1_r);
402402   ppi8255_set_portCread(0, ckongs_input_port_2_r);
r1591r1592
404404
405405DRIVER_INIT( mariner )
406406{
407   driver_init_scramble_ppi(machine);
407   DRIVER_INIT_CALL(scramble_ppi);
408408
409409   /* 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);
412411   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800);
413412
414413   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9008, 0x9008, 0, 0, mariner_protection_2_r);
r1591r1592
424423   UINT8 *ROM;
425424
426425
427   driver_init_scramble_ppi(machine);
426   DRIVER_INIT_CALL(scramble_ppi);
428427
429428
430429   /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
r1591r1592
444443   UINT8 *ROM;
445444
446445
447   driver_init_scramble_ppi(machine);
446   DRIVER_INIT_CALL(scramble_ppi);
448447
449448   /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
450449   ROM = memory_region(REGION_CPU2);
r1591r1592
458457   UINT8 *RAM;
459458
460459
461   driver_init_scramble_ppi(machine);
460   DRIVER_INIT_CALL(scramble_ppi);
462461
463462
464463   /* Address lines are scrambled on the main CPU */
r1591r1592
487486
488487DRIVER_INIT( mars )
489488{
490   driver_init_devilfsh(machine);
489   DRIVER_INIT_CALL(devilfsh);
491490
492491   /* extra port */
493492   ppi8255_set_portCread(1, input_port_3_r);
r1591r1592
504503{
505504   UINT8 *ROM = memory_region(REGION_CPU1);
506505
507   driver_init_scramble_ppi(machine);
506   DRIVER_INIT_CALL(scramble_ppi);
508507
509508   /* banked ROM */
510509   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MRA8_BANK1);
r1591r1592
523522
524523DRIVER_INIT( moonwar )
525524{
526   driver_init_scramble_ppi(machine);
525   DRIVER_INIT_CALL(scramble_ppi);
527526
528527   /* special handler for the spinner */
529528   ppi8255_set_portAread (0, moonwar_input_port_0_r);
r1591r1592
534533
535534DRIVER_INIT( darkplnt )
536535{
537   driver_init_scramble_ppi(machine);
536   DRIVER_INIT_CALL(scramble_ppi);
538537
539538   /* special handler for the spinner */
540539   ppi8255_set_portBread(0, darkplnt_input_port_1_r);
r1591r1592
575574      ctr++;
576575   }
577576
578   driver_init_scramble_ppi(machine);
577   DRIVER_INIT_CALL(scramble_ppi);
579578
580579   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scramble_background_enable_w);
581580}
582581
583582DRIVER_INIT( mimonsco )
584583{
585   driver_init_scramble_ppi(machine);
584   DRIVER_INIT_CALL(scramble_ppi);
586585
587586   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scramble_background_enable_w);
588587}
589588
590589DRIVER_INIT( mimonscr )
591590{
592   driver_init_scramble_ppi(machine);
591   DRIVER_INIT_CALL(scramble_ppi);
593592
594593   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6804, 0x6804, 0, 0, scramble_background_enable_w);
595594}
r1591r1592
608607   UINT8 *scratch;
609608
610609
611   driver_init_scobra(machine);
610   DRIVER_INIT_CALL(scobra);
612611
613612   /*
614613    *   Code To Decode Lost Tomb by Mirko Buffoni
r1591r1592
644643   UINT8 *scratch;
645644
646645
647   driver_init_scobra(machine);
646   DRIVER_INIT_CALL(scobra);
648647
649648   /*
650649    *   Code To Decode Lost Tomb by Mirko Buffoni
r1591r1592
680679   UINT8 *scratch;
681680
682681
683   driver_init_scobra(machine);
682   DRIVER_INIT_CALL(scobra);
684683
685684   /*
686685    *   Code To Decode Minefield by Mike Balfour and Nicola Salmoria
r1591r1592
716715   UINT8 *scratch;
717716
718717
719   driver_init_scramble(machine);
718   DRIVER_INIT_CALL(scramble);
720719
721720   /*
722721    *   Code To Decode Lost Tomb by Mirko Buffoni
r1591r1592
751750   UINT8 *RAM;
752751
753752
754   driver_init_scramble(machine);
753   DRIVER_INIT_CALL(scramble);
755754
756755   /* Deryption worked out by hand by Chris Hardy. */
757756
r1591r1592
784783   offs_t A;
785784
786785
787   driver_init_scramble_ppi(machine);
786   DRIVER_INIT_CALL(scramble_ppi);
788787
789788
790789   for (A = 0;A < 0x4000;A++)
r1591r1592
826825   offs_t A;
827826
828827
829   driver_init_scramble_ppi(machine);
828   DRIVER_INIT_CALL(scramble_ppi);
830829
831830
832831   for (A = 0;A < 0x4000;A++)
r1591r1592
875874
876875DRIVER_INIT( mrkougar )
877876{
878   driver_init_devilfsh(machine);
877   DRIVER_INIT_CALL(devilfsh);
879878
880879   /* no sound enabled bit */
881880   ppi8255_set_portBwrite(1, mrkougar_sh_irqtrigger_w);
r1591r1592
883882
884883DRIVER_INIT( mrkougb )
885884{
886   driver_init_scramble_ppi(machine);
885   DRIVER_INIT_CALL(scramble_ppi);
887886
888887   /* no sound enabled bit */
889888   ppi8255_set_portBwrite(1, mrkougar_sh_irqtrigger_w);
src/mame/machine/midtunit.c
r1591r1592
449449   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1b6ffff, 0, 0, mk_prot_w);
450450
451451   /* 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));
453454}
454455
455456static void init_nbajam_common(int te_protection)
r1591r1592
475476
476477   /* sound chip protection (hidden RAM) */
477478   if (!te_protection)
478      memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbaa, 0xfbd4, 0, 0, MWA8_RAM);
479      memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfbaa, 0xfbd4, 0, 0, MRA8_BANK9, MWA8_BANK9);
479480   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));
481483}
482484
483485DRIVER_INIT( nbajam )
r1591r1592
503505   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1b00000, 0x1bfffff, 0, 0, jdredd_prot_w);
504506
505507   /* 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));
507510
508511#if ENABLE_ALL_JDREDD_LEVELS
509512   /* how about the final levels? */
src/mame/machine/pitnrun.c
r1591r1592
1818{
1919   zaccept = 1;
2020   zready = 0;
21   cpunum_set_input_line(2,0,CLEAR_LINE);
21   cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
2222}
2323
2424static TIMER_CALLBACK( pitnrun_mcu_real_data_r )
r1591r1592
3535static TIMER_CALLBACK( pitnrun_mcu_real_data_w )
3636{
3737   zready = 1;
38   cpunum_set_input_line(2,0,ASSERT_LINE);
38   cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
3939   fromz80 = param;
4040}
4141
r1591r1592
109109   {
110110      /* 68705 is going to read data from the Z80 */
111111      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);
113113      portA_in = fromz80;
114114   }
115115   if (~data & 0x04)
src/mame/machine/carpolo.c
r1591r1592
8989
9090static void TTL74148_3S_cb(void)
9191{
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);
9393}
9494
9595
src/mame/machine/namcos1.c
r1591r1592
585585      namcos1_reset = data & 1;
586586   }
587587
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);
591591}
592592
593593
r1591r1592
860860   namcos1_bankswitch(1, 0x0e01, 0xff);
861861
862862   /* 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);
866866
867867   /* mcu patch data clear */
868868   mcu_patch_data = 0;
src/mame/machine/segaic16.c
r1591r1592
217217         /*   03 - maybe controls halt and reset lines together? */
218218         if ((oldval ^ chip->regs[offset]) & 3)
219219         {
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);
221221            if ((chip->regs[offset] & 3) == 3)
222222               fd1094_machine_init();
223223         }
r1591r1592
231231      case 0x04:
232232         /* controls IRQ lines to 68000, negative logic -- write $B to signal IRQ4 */
233233         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);
235235         break;
236236
237237      case 0x05:
src/mame/machine/buggychl.c
r1591r1592
99{
1010   mcu_sent = 0;
1111   main_sent = 0;
12   cpunum_set_input_line(2,0,CLEAR_LINE);
12   cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
1313}
1414
1515
r1591r1592
7474   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
7575   {
7676      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);
7878      main_sent = 0;
7979logerror("read command %02x from main cpu\n",portA_in);
8080   }
r1591r1592
131131logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
132132   from_main = data;
133133   main_sent = 1;
134   cpunum_set_input_line(2,0,ASSERT_LINE);
134   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
135135}
136136
137137READ8_HANDLER( buggychl_mcu_r )
src/mame/machine/n64.c
r1591r1592
3434   {
3535      mi_interrupt |= interrupt;
3636
37      cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
37      cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
3838   }
3939}
4040
r1591r1592
4444
4545   //if (!mi_interrupt)
4646   {
47      cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE);
47      cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
4848   }
4949}
5050
r1591r1592
125125static void sp_dma(int direction)
126126{
127127   UINT8 *src, *dst;
128   int i;
128   int i, c;
129129   //int cpu = cpu_getactivecpu();
130130
131131   if (sp_dma_length == 0)
r1591r1592
134134   }
135135
136136   sp_dma_length++;
137
138137   if ((sp_dma_length & 3) != 0)
139138   {
140139      //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;
143142
144143      //sp_dma_length &= ~3;
145144   }
r1591r1592
153152   }
154153   if (sp_dram_addr & 0x3)
155154   {
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;
164156   }
165157
166158   if (sp_dma_count > 0)
167159   {
168      fatalerror("sp_dma: dma_count = %d\n", sp_dma_count);
160      // fatalerror("sp_dma: dma_count = %d\n", sp_dma_count);
169161   }
170162   if (sp_dma_skip > 0)
171163   {
172      fatalerror("sp_dma: dma_skip = %d\n", sp_dma_skip);
164      // fatalerror("sp_dma: dma_skip = %d\n", sp_dma_skip);
173165   }
174166
175167   if ((sp_mem_addr & 0xfff) + (sp_dma_length) > 0x1000)
r1591r1592
179171
180172   if (direction == 0)      // RDRAM -> I/DMEM
181173   {
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];
184178
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            }
186183
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;
191186
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        }
200189   }
201190   else               // I/DMEM -> RDRAM
202191   {
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];
205196
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            }
207201
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;
212204
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        }
221207   }
222208}
223209
r1591r1592
228214{
229215   if (status & 0x1)
230216   {
231      //cpu_trigger(6789);
217      //cpu_trigger(Machine, 6789);
232218
233      cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
219      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
234220        cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT);
235221      //rsp_sp_status |= SP_STATUS_HALT;
236222   }
r1591r1592
282268            return 0;
283269
284270        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;
286272
287273        default:
288274            logerror("sp_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc());
r1591r1592
330316                    //  cpu_spinuntil_trigger(6789);
331317
332318                        // 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);
334320                        cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_HALT );
335321                        // RSP_STATUS &= ~RSP_STATUS_HALT;
336322                    //}
r1591r1592
342328                if (data & 0x00000002)      // set halt
343329                {
344330                    // 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);
346332                    cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT );
347333                    // RSP_STATUS |= RSP_STATUS_HALT;
348334                }
r1591r1592
370356                {
371357                    //printf( "Setting RSP_STATUS_SSTEP\n" );
372358                    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                    }
373363                    // RSP_STATUS |= RSP_STATUS_SSTEP;      // set single step
374364                }
375365                if (data & 0x00000080)
r1591r1592
575565
576566
577567// Video Interface
578static UINT32 vi_width;
579UINT32 vi_origin;
580UINT32 vi_control;
581static UINT32 vi_burst, vi_vsync, vi_hsync, vi_leap, vi_hstart, vi_vstart;
582static UINT32 vi_intr, vi_vburst, vi_xscale, vi_yscale;
568UINT32 n64_vi_width;
569UINT32 n64_vi_origin;
570UINT32 n64_vi_control;
571static UINT32 n64_vi_burst, n64_vi_vsync,  n64_vi_hsync,  n64_vi_leap,  n64_vi_hstart, n64_vi_vstart;
572static UINT32 n64_vi_intr,  n64_vi_vburst, n64_vi_xscale, n64_vi_yscale;
583573
584574READ32_HANDLER( n64_vi_reg_r )
585575{
586576   switch (offset)
587577   {
588578      case 0x04/4:      // VI_ORIGIN_REG
589         return vi_origin;
579            return n64_vi_origin;
590580
591581      case 0x08/4:      // VI_WIDTH_REG
592         return vi_width;
582            return n64_vi_width;
593583
594584      case 0x0c/4:
595         return vi_intr;
585            return n64_vi_intr;
596586
597587      case 0x10/4:      // VI_CURRENT_REG
598588         return video_screen_get_vpos(0);
599589
600590      case 0x14/4:      // VI_BURST_REG
601         return vi_burst;
591            return n64_vi_burst;
602592
603593      case 0x18/4:      // VI_V_SYNC_REG
604         return vi_vsync;
594            return n64_vi_vsync;
605595
606596      case 0x1c/4:      // VI_H_SYNC_REG
607         return vi_hsync;
597            return n64_vi_hsync;
608598
609599      case 0x20/4:      // VI_LEAP_REG
610         return vi_leap;
600            return n64_vi_leap;
611601
612602      case 0x24/4:      // VI_H_START_REG
613         return vi_hstart;
603            return n64_vi_hstart;
614604
615605      case 0x28/4:      // VI_V_START_REG
616         return vi_vstart;
606            return n64_vi_vstart;
617607
618608      case 0x2c/4:      // VI_V_BURST_REG
619         return vi_vburst;
609            return n64_vi_vburst;
620610
621611      case 0x30/4:      // VI_X_SCALE_REG
622         return vi_xscale;
612            return n64_vi_xscale;
623613
624614      case 0x34/4:      // VI_Y_SCALE_REG
625         return vi_yscale;
615            return n64_vi_yscale;
626616
627617      default:
628618         logerror("vi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc());
r1591r1592
636626   switch (offset)
637627   {
638628      case 0x00/4:      // VI_CONTROL_REG
639         if ((vi_control & 0x40) != (data & 0x40))
629            if ((n64_vi_control & 0x40) != (data & 0x40))
640630         {
641631            screen_state *state = &Machine->screen[0];
642632            rectangle visarea = state->visarea;
643633            visarea.max_y = (data & 0x40) ? 479 : 239;
644634            video_screen_configure(0, state->width, visarea.max_y + 1, &visarea, Machine->screen[0].refresh);
645635         }
646         vi_control = data;
636            n64_vi_control = data;
647637         break;
648638
649639      case 0x04/4:      // VI_ORIGIN_REG
650         vi_origin = data & 0xffffff;
640            n64_vi_origin = data & 0xffffff;
651641         break;
652642
653643      case 0x08/4:      // VI_WIDTH_REG
654         if (vi_width != data && data > 0)
644            if (n64_vi_width != data && data > 0)
655645         {
656646            screen_state *state = &Machine->screen[0];
657647            rectangle visarea = state->visarea;
658648            visarea.max_x = data-1;
659649            video_screen_configure(0, visarea.max_x + 1, state->height, &visarea, Machine->screen[0].refresh);
660650         }
661         vi_width = data;
662              fb_width = data;
651            n64_vi_width = data;
652          fb_width = data;
663653         break;
664654
665655      case 0x0c/4:      // VI_INTR_REG
666         vi_intr = data;
656            n64_vi_intr = data;
667657         break;
668658
669659      case 0x10/4:      // VI_CURRENT_REG
r1591r1592
671661         break;
672662
673663      case 0x14/4:      // VI_BURST_REG
674         vi_burst = data;
664            n64_vi_burst = data;
675665         break;
676666
677667      case 0x18/4:      // VI_V_SYNC_REG
678         vi_vsync = data;
668            n64_vi_vsync = data;
679669         break;
680670
681671      case 0x1c/4:      // VI_H_SYNC_REG
682         vi_hsync = data;
672            n64_vi_hsync = data;
683673         break;
684674
685675      case 0x20/4:      // VI_LEAP_REG
686         vi_leap = data;
676            n64_vi_leap = data;
687677         break;
688678
689679      case 0x24/4:      // VI_H_START_REG
690         vi_hstart = data;
680            n64_vi_hstart = data;
691681         break;
692682
693683      case 0x28/4:      // VI_V_START_REG
694         vi_vstart = data;
684            n64_vi_vstart = data;
695685         break;
696686
697687      case 0x2c/4:      // VI_V_BURST_REG
698         vi_vburst = data;
688            n64_vi_vburst = data;
699689         break;
700690
701691      case 0x30/4:      // VI_X_SCALE_REG
702         vi_xscale = data;
692            n64_vi_xscale = data;
703693         break;
704694
705695      case 0x34/4:      // VI_Y_SCALE_REG
706         vi_yscale = data;
696            n64_vi_yscale = data;
707697         break;
708698
709699        /*
r1591r1592
974964         int i;
975965         UINT32 dma_length = (data + 1);
976966
977         /*if (dma_length & 3)
967         if (dma_length & 3)
978968            {
979969                dma_length = (dma_length + 3) & ~3;
980            }*/
970            }
981971
982972         //mame_printf_debug("PI DMA: %08X to %08X, length %08X\n", pi_cart_addr, pi_dram_addr, dma_length);
983973
r1591r1592
15701560   audio_timer = timer_alloc(audio_timer_callback, NULL);
15711561   timer_adjust(audio_timer, attotime_never, 0, attotime_never);
15721562
1573   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
1563   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
15741564
15751565    // bootcode differs between CIC-chips, so we can use its checksum to detect the CIC-chip
15761566    boot_checksum = 0;
src/mame/machine/stfight.c
r1591r1592
6868
6969DRIVER_INIT( stfight )
7070{
71   driver_init_empcity(machine);
71   DRIVER_INIT_CALL(empcity);
7272
7373   /* patch out a tight loop during startup - is the code waiting */
7474   /* for NMI to wake it up? */
r1591r1592
101101static TIMER_CALLBACK( stfight_interrupt_1 )
102102{
103103    // 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);
105105}
106106
107107INTERRUPT_GEN( stfight_vb_interrupt )
108108{
109109    // 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);
111111      timer_set(ATTOTIME_IN_HZ(120), NULL, 0, stfight_interrupt_1);
112112}
113113
src/mame/machine/tait8741.c
r1591r1592
495495      {
496496         if(josvolly_nmi_enable)
497497         {
498            cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
498            cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
499499            josvolly_nmi_enable = 0;
500500         }
501501      }
src/mame/machine/balsente.c
r1591r1592
103103
104104static TIMER_CALLBACK( irq_off )
105105{
106   cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE);
106   cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
107107}
108108
109109
r1591r1592
116116      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, param + 64, 0), param + 64, attotime_zero);
117117
118118   /* 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);
120120
121121   /* it will turn off on the next HBLANK */
122122   timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), NULL, 0, irq_off);
r1591r1592
448448   /* apply the change */
449449   if (new_state && !(m6850_status & 0x80))
450450   {
451      cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE);
451      cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
452452      m6850_status |= 0x80;
453453   }
454454   else if (!new_state && (m6850_status & 0x80))
455455   {
456      cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE);
456      cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
457457      m6850_status &= ~0x80;
458458   }
459459
r1591r1592
466466   /* apply the change */
467467   if (new_state && !(m6850_sound_status & 0x80))
468468   {
469      cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
469      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
470470      m6850_sound_status |= 0x80;
471471   }
472472   else if (!new_state && (m6850_sound_status & 0x80))
473473   {
474      cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
474      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
475475      m6850_sound_status &= ~0x80;
476476   }
477477}
r1591r1592
756756{
757757   /* OUT on counter 2 is hooked to the /INT line on the Z80 */
758758   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);
760760
761761   /* OUT on counter 0 is hooked to the GATE line on counter 1 */
762762   else if (which == 0)
src/mame/machine/vsnes.c
r1591r1592
314314   init_vsnes(machine);
315315
316316   /* normal banking */
317   driver_init_vsnormal(machine);
317   DRIVER_INIT_CALL(vsnormal);
318318
319319   /* 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));
322322
323323   /* now override the vidaccess callback */
324324   /* we need to remap color tables */
r1591r1592
466466   init_vsnes(machine);
467467
468468   /* normal banking */
469   driver_init_vsnormal(machine);
469   DRIVER_INIT_CALL(vsnormal);
470470
471471   /* now override the vidaccess callback */
472472   remapped_colortable = rp2c04001_colortable;
r1591r1592
682682   init_vsnes(machine);
683683
684684   /* normal banking */
685   driver_init_vsnormal(machine);
685   DRIVER_INIT_CALL(vsnormal);
686686
687687   /* now override the vidaccess callback */
688688   /* we need to remap color tables */
r1591r1592
696696   init_vsnes(machine);
697697
698698   /* normal banking */
699   driver_init_vsnormal(machine);
699   DRIVER_INIT_CALL(vsnormal);
700700
701701   /* now override the vidaccess callback */
702702   /* we need to remap color tables */
r1591r1592
715715   init_vsnes(machine);
716716
717717   /* normal banking */
718   driver_init_vsnormal(machine);
718   DRIVER_INIT_CALL(vsnormal);
719719
720720   /* now override the vidaccess callback */
721721   /* we need to remap color tables */
r1591r1592
841841         if (IRQ_count == 0)
842842         {
843843            IRQ_count = IRQ_count_latch;
844            cpunum_set_input_line (0, 0, HOLD_LINE);
844            cpunum_set_input_line (Machine, 0, 0, HOLD_LINE);
845845         }
846846         IRQ_count --;
847847      }
r1591r1592
967967   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, mapper4_w );
968968
969969   /* 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));
972972
973973   /* common init */
974974   init_vsnes(machine);
r1591r1592
10091009
10101010DRIVER_INIT( rbibb )
10111011{
1012   driver_init_MMC3(machine);
1012   DRIVER_INIT_CALL(MMC3);
10131013
10141014   /* RBI Base ball hack */
10151015   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, rbi_hack_r) ;
r1591r1592
10591059
10601060DRIVER_INIT( supxevs )
10611061{
1062   driver_init_MMC3(machine);
1062   DRIVER_INIT_CALL(MMC3);
10631063
10641064   /* Vs. Super Xevious Protection */
10651065   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x54ff, 0x54ff, 0, 0, supxevs_read_prot_1_r );
r1591r1592
10941094
10951095DRIVER_INIT( tkoboxng )
10961096{
1097   driver_init_MMC3(machine);
1097   DRIVER_INIT_CALL(MMC3);
10981098
10991099   /* security device at $5e00-$5e01 */
11001100   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5e00, 0x5e01, 0, 0, tko_security_r );
r1591r1592
11091109
11101110DRIVER_INIT( vsfdf )
11111111{
1112   driver_init_MMC3(machine);
1112   DRIVER_INIT_CALL(MMC3);
11131113
11141114   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_r );
11151115   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4016, 0x4016, 0, 0, gun_in0_w );
r1591r1592
11761176static WRITE8_HANDLER ( set_bnglngby_irq_w )
11771177{
11781178   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 );
11801180   /* other values ??? */
11811181   /* 0, 4, 84 */
11821182}
r1591r1592
11921192   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0231, 0x0231, 0, 0, set_bnglngby_irq_w );
11931193
11941194   /* 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));
11971197
11981198   ret = 0;
11991199
r1591r1592
12011201   init_vsnes(machine);
12021202
12031203   /* normal banking */
1204   driver_init_vsnormal(machine);
1204   DRIVER_INIT_CALL(vsnormal);
12051205
12061206   remapped_colortable = rp2c04002_colortable;
12071207}
r1591r1592
12291229   init_vsnes(machine);
12301230
12311231   /* normal banking */
1232   driver_init_vsnormal(machine);
1232   DRIVER_INIT_CALL(vsnormal);
12331233}
12341234
12351235/***********************************************************************/
r1591r1592
12631263   ppu2c0x_set_videorom_bank( cpu_getactivecpu(), 0, 8, ( data & 4 ) ? 1 : 0, 512 );
12641264
12651265   /* 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 );
12671267
12681268   /* move along */
12691269   if ( cpu_getactivecpu() == 0 )
r1591r1592
12941294{
12951295   /* only differance between this and vstennis is the colors */
12961296
1297   driver_init_vstennis(machine);
1297   DRIVER_INIT_CALL(vstennis);
12981298   remapped_colortable = rp2c04002_colortable;
12991299}
13001300
r1591r1592
13051305{
13061306   /* only differance between this and vstennis is the colors */
13071307
1308   driver_init_vstennis(machine);
1308   DRIVER_INIT_CALL(vstennis);
13091309
13101310   remapped_colortable = rp2c04003_colortable;
13111311}
r1591r1592
13181318{
13191319   /* only differance between this and vstennis is the colors */
13201320
1321   driver_init_vstennis(machine);
1321   DRIVER_INIT_CALL(vstennis);
13221322
13231323   remapped_colortable = rp2c04001_colortable;
13241324
r1591r1592
13321332{
13331333   /* only differance between this and vstennis is the colors */
13341334
1335   driver_init_vstennis(machine);
1335   DRIVER_INIT_CALL(vstennis);
13361336
13371337   remapped_colortable = rp2c05004_colortable;
13381338
r1591r1592
13431343DRIVER_INIT( btlecity )
13441344{
13451345   init_vsnes(machine);
1346   driver_init_vsnormal(machine);
1346   DRIVER_INIT_CALL(vsnormal);
13471347   remapped_colortable = rp2c04003_colortable;
13481348}
13491349
r1591r1592
13521352DRIVER_INIT( vstetris )
13531353{
13541354   /* 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));
13571357
13581358   init_vsnes(machine);
1359   driver_init_vsnormal(machine);
1359   DRIVER_INIT_CALL(vsnormal);
13601360   remapped_colortable = rp2c04003_colortable;
13611361}
src/mame/machine/qix.c
r1591r1592
299299
300300WRITE8_HANDLER( qix_data_firq_w )
301301{
302   cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE);
302   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
303303}
304304
305305
306306WRITE8_HANDLER( qix_data_firq_ack_w )
307307{
308   cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE);
308   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
309309}
310310
311311
312312READ8_HANDLER( qix_data_firq_r )
313313{
314   cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE);
314   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
315315   return 0xff;
316316}
317317
318318
319319READ8_HANDLER( qix_data_firq_ack_r )
320320{
321   cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE);
321   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
322322   return 0xff;
323323}
324324
r1591r1592
332332
333333WRITE8_HANDLER( qix_video_firq_w )
334334{
335   cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE);
335   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE);
336336}
337337
338338
339339WRITE8_HANDLER( qix_video_firq_ack_w )
340340{
341   cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE);
341   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE);
342342}
343343
344344
345345READ8_HANDLER( qix_video_firq_r )
346346{
347   cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE);
347   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE);
348348   return 0xff;
349349}
350350
351351
352352READ8_HANDLER( qix_video_firq_ack_r )
353353{
354   cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE);
354   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE);
355355   return 0xff;
356356}
357357
r1591r1592
385385
386386static void qix_pia_dint(int state)
387387{
388   int combined_state = pia_get_irq_a(3) | pia_get_irq_b(3);
389
388390   /* 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);
390392}
391393
392394
393395static void qix_pia_sint(int state)
394396{
397   int combined_state = pia_get_irq_a(4) | pia_get_irq_b(4);
398
395399   /* 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);
397401}
398402
399403
r1591r1592
424428{
425429   if (!(data & 0x04))
426430   {
427      cpunum_set_input_line(3, M68705_IRQ_LINE, ASSERT_LINE);
431      cpunum_set_input_line(Machine, 3, M68705_IRQ_LINE, ASSERT_LINE);
428432      /* temporarily boost the interleave to sync things up */
429433      /* note: I'm using 50 because 30 is not enough for space dungeon at game over */
430434      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50));
431435   }
432436   else
433      cpunum_set_input_line(3, M68705_IRQ_LINE, CLEAR_LINE);
437      cpunum_set_input_line(Machine, 3, M68705_IRQ_LINE, CLEAR_LINE);
434438
435439   /* this is a callback called by pia_0_w(), so I don't need to synchronize */
436440   /* the CPUs - they have already been synchronized by qix_pia_0_w() */
src/mame/machine/mexico86.c
r1591r1592
2020*/
2121WRITE8_HANDLER( mexico86_f008_w )
2222{
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);
2424    if (Machine->drv->cpu[2].type != CPU_DUMMY)
2525   {
2626      // 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);
2828   }
2929   else
3030   {
r1591r1592
156156      mcu_simulate();
157157
158158   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);
160160}
161161
162162
r1591r1592
223223{
224224   /* I don't know how to handle the interrupt line so I just toggle it every time. */
225225   if (cpu_getiloops() & 1)
226      cpunum_set_input_line(2,0,CLEAR_LINE);
226      cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
227227   else
228      cpunum_set_input_line(2,0,ASSERT_LINE);
228      cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
229229}
230230
231231
r1591r1592
313313   if ((ddrB & 0x20) && (data & 0x20) && (~portB_out & 0x20))
314314   {
315315      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.
318318   }
319319   if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40))
320320   {
src/mame/machine/snes.c
r1591r1592
7979static TIMER_CALLBACK( snes_nmi_tick )
8080{
8181   // 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 );
8383
8484   // don't happen again
8585   timer_adjust(snes_nmi_timer, attotime_never, 0, attotime_never);
r1591r1592
9191   // (don't need to switch to the 65816 context, we don't do anything dependant on it)
9292   snes_latch_counters();
9393   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 );
9595
9696   // don't happen again
9797   timer_adjust(snes_hirq_timer, attotime_never, 0, attotime_never);
r1591r1592
121121         snes_ram[TIMEUP] = 0x80;   /* Indicate that irq occured */
122122         // IRQ latches the counters, do it now
123123         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 );
125125      }
126126   }
127127   /* Horizontal IRQ timer */
r1591r1592
224224      snes_ram[STAT77] &= 0x3f;      /* Clear Time Over and Range Over bits */
225225      snes_ram[STAT78] ^= 0x80;      /* Toggle field flag */
226226
227      cpunum_set_input_line( 0, G65816_LINE_NMI, CLEAR_LINE );
227      cpunum_set_input_line(machine, 0, G65816_LINE_NMI, CLEAR_LINE );
228228   }
229229
230230   cpuintrf_pop_context();
r1591r1592
14521452      case MEMSEL:   /* Access cycle designation in memory (2) area */
14531453         /* FIXME: Need to adjust the speed only during access of banks 0x80+
14541454             * 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 );
14561456#ifdef SNES_DBG_REG_W
14571457         if( (data & 0x1) != (snes_ram[MEMSEL] & 0x1) )
14581458            mame_printf_debug( "CPU speed: %f Mhz\n", (data & 0x1) ? 3.58 : 2.68 );
src/mame/machine/taitosj.c
r1591r1592
5757   zready = 0;
5858   busreq = 0;
5959    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);
6161
6262   spacecr_prot_value = 0;
6363}
r1591r1592
116116static TIMER_CALLBACK( taitosj_mcu_real_data_w )
117117{
118118   zready = 1;
119   cpunum_set_input_line(2,0,ASSERT_LINE);
119   cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
120120   fromz80 = param;
121121}
122122
r1591r1592
202202   {
203203      /* 68705 is going to read data from the Z80 */
204204      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);
206206      portA_in = fromz80;
207207      LOG(("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in));
208208   }
src/mame/machine/amiga.c
r1591r1592
426426
427427   /* set the highest IRQ line */
428428   if (irq >= 0)
429      cpunum_set_input_line(0, irq, ASSERT_LINE);
429      cpunum_set_input_line(Machine, 0, irq, ASSERT_LINE);
430430   else
431      cpunum_set_input_line(0, 7, CLEAR_LINE);
431      cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
432432}
433433
434434static TIMER_CALLBACK( amiga_irq_proc )
src/mame/machine/vertigo.c
r1591r1592
7676static void update_irq(void)
7777{
7878   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);
8080
8181   irq_state = TTL74148_output_r(0);
8282
8383   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);
8585}
8686
8787static void update_irq_encoder(int line, int state)
r1591r1592
100100static void v_irq3_w(int level)
101101{
102102   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);
104104
105105   update_irq_encoder(INPUT_LINE_IRQ3, level);
106106}
r1591r1592
153153{
154154   /* Reset sound cpu */
155155   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);
157157   else
158      cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
158      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
159159}
160160
161161static TIMER_CALLBACK( sound_command_w )
162162{
163163   exidy440_sound_command = param;
164164   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);
166166
167167   /* It is important that the sound cpu ACKs the sound command
168168       quickly. Otherwise the main CPU gives up with sound. Boosting
src/mame/machine/lkage.c
r1591r1592
6767   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
6868   {
6969      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);
7171      main_sent = 0;
7272logerror("read command %02x from main cpu\n",portA_in);
7373   }
r1591r1592
115115logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
116116   from_main = data;
117117   main_sent = 1;
118   cpunum_set_input_line(2,0,ASSERT_LINE);
118   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
119119}
120120
121121READ8_HANDLER( lkage_mcu_r )
src/mame/machine/pcshare.c
r1591r1592
413413   {
414414      case 0:
415415         /* 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);
417417         break;
418418
419419      case 1:
src/mame/machine/atarigen.c
r1591r1592
158158
159159void atarigen_update_interrupts(void)
160160{
161   (*update_int_callback)();
161   (*update_int_callback)(Machine);
162162}
163163
164164
r1591r1592
182182INTERRUPT_GEN( atarigen_scanline_int_gen )
183183{
184184   atarigen_scanline_int_state = 1;
185   (*update_int_callback)();
185   (*update_int_callback)(machine);
186186}
187187
188188
r1591r1592
194194WRITE16_HANDLER( atarigen_scanline_int_ack_w )
195195{
196196   atarigen_scanline_int_state = 0;
197   (*update_int_callback)();
197   (*update_int_callback)(Machine);
198198}
199199
200200WRITE32_HANDLER( atarigen_scanline_int_ack32_w )
201201{
202202   atarigen_scanline_int_state = 0;
203   (*update_int_callback)();
203   (*update_int_callback)(Machine);
204204}
205205
206206
r1591r1592
212212INTERRUPT_GEN( atarigen_sound_int_gen )
213213{
214214   atarigen_sound_int_state = 1;
215   (*update_int_callback)();
215   (*update_int_callback)(machine);
216216}
217217
218218
r1591r1592
224224WRITE16_HANDLER( atarigen_sound_int_ack_w )
225225{
226226   atarigen_sound_int_state = 0;
227   (*update_int_callback)();
227   (*update_int_callback)(Machine);
228228}
229229
230230WRITE32_HANDLER( atarigen_sound_int_ack32_w )
231231{
232232   atarigen_sound_int_state = 0;
233   (*update_int_callback)();
233   (*update_int_callback)(Machine);
234234}
235235
236236
r1591r1592
242242INTERRUPT_GEN( atarigen_video_int_gen )
243243{
244244   atarigen_video_int_state = 1;
245   (*update_int_callback)();
245   (*update_int_callback)(machine);
246246}
247247
248248
r1591r1592
254254WRITE16_HANDLER( atarigen_video_int_ack_w )
255255{
256256   atarigen_video_int_state = 0;
257   (*update_int_callback)();
257   (*update_int_callback)(Machine);
258258}
259259
260260WRITE32_HANDLER( atarigen_video_int_ack32_w )
261261{
262262   atarigen_video_int_state = 0;
263   (*update_int_callback)();
263   (*update_int_callback)(Machine);
264264}
265265
266266
r1591r1592
362362
363363
364364/*---------------------------------------------------------------
365    nvram_handler_atarigen: Loads the EEPROM data.
365    NVRAM_HANDLER( atarigen ): Loads the EEPROM data.
366366---------------------------------------------------------------*/
367367
368368NVRAM_HANDLER( atarigen )
r1591r1592
693693READ8_HANDLER( atarigen_6502_sound_r )
694694{
695695   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);
697697   return atarigen_cpu_to_sound;
698698}
699699
r1591r1592
708708void update_6502_irq(void)
709709{
710710   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);
712712   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);
714714}
715715
716716
r1591r1592
724724   /* unhalt and reset the sound CPU */
725725   if (param == 0)
726726   {
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);
729729   }
730730
731731   /* reset the sound write state */
r1591r1592
752752   /* set up the states and signal an NMI to the sound CPU */
753753   atarigen_cpu_to_sound = param;
754754   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);
756756
757757   /* allocate a high frequency timer until a response is generated */
758758   /* the main CPU is *very* sensistive to the timing of the response */
r1591r1592
13111311   /* halt and set a timer to wake up */
13121312   fraction = (double)(hblank - hpos) / (double)Machine->screen[0].width;
13131313   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);
13151315}
13161316
13171317
r1591r1592
13991399
14001400static TIMER_CALLBACK( unhalt_cpu )
14011401{
1402   cpunum_set_input_line(param, INPUT_LINE_HALT, CLEAR_LINE);
1402   cpunum_set_input_line(machine, param, INPUT_LINE_HALT, CLEAR_LINE);
14031403}
14041404
14051405
src/mame/machine/atarigen.h
r1591r1592
2828    TYPES & STRUCTURES
2929***************************************************************************/
3030
31typedef void (*atarigen_int_callback)(void);
31typedef void (*atarigen_int_callback)(running_machine *machine);
3232
3333typedef void (*atarigen_scanline_callback)(running_machine *machine, int scrnum, int scanline);
3434
src/mame/machine/midwunit.c
r1591r1592
251251{
252252   /* only signal if not in loopback state */
253253   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);
255255}
256256
257257
r1591r1592
624624
625625MACHINE_RESET( midxunit )
626626{
627   machine_reset_midwunit(machine);
627   MACHINE_RESET_CALL(midwunit);
628628   dcs_set_io_callbacks(midxunit_dcs_output_full, NULL);
629629}
630630
src/mame/machine/namcos2.c
r1591r1592
7474static void
7575ResetAllSubCPUs( int state )
7676{
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);
7979   switch( namcos2_gametype )
8080   {
8181   case NAMCOS21_SOLVALOU:
8282   case NAMCOS21_STARBLADE:
8383   case NAMCOS21_AIRCOMBAT:
8484   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 */
8787      break;
8888
8989//  case NAMCOS21_WINRUN91:
r1591r1592
100100   /* Initialise the bank select in the sound CPU */
101101   namcos2_sound_bankselect_w(0,0); /* Page in bank 0 */
102102
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 );
104104
105105   /* Place CPU2 & CPU3 into the reset condition */
106106   ResetAllSubCPUs( ASSERT_LINE );
r1591r1592
510510   case 0x1d0000:
511511      if( bWrite )
512512      {
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);
515515      break;
516516
517517   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);
519519      break;
520520
521521   case 0x1d4000:
522522      if( bWrite )
523523      {
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);
525525      }
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);
527527      break;
528528
529529   case 0x1d6000:
r1591r1592
531531      {
532532      //  mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
533533      }
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);
535535      break;
536536
537537   case 0x1d8000: /* ack EXIRQ */
r1591r1592
539539      {
540540      //  mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
541541      }
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);
543543      break;
544544
545545   case 0x1da000: /* ack POSIRQ */
r1591r1592
547547      {
548548      //  mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
549549      }
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);
551551      break;
552552
553553   case 0x1dc000: /* ack SCIRQ */
r1591r1592
555555      {
556556      //  mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
557557      }
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);
559559      break;
560560
561561   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);
563563      break;
564564
565565   case 0x1e0000: /* EEPROM Status Register */
r1591r1592
572572         if( data&0x01 )
573573         {
574574            /* 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);
576576            cpu_yield();
577577         }
578578         else
579579         {
580580            /* 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);
582582         }
583583         if( IsSystem21() )
584584         {
r1591r1592
650650static TIMER_CALLBACK( namcos2_68k_master_posirq )
651651{
652652   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);
654654}
655655
656656static int
r1591r1592
667667      int scanline = GetPosIRQScanline();
668668      timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_master_posirq );
669669   }
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);
671671}
672672
673673static TIMER_CALLBACK( namcos2_68k_slave_posirq )
674674{
675675   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);
677677}
678678
679679INTERRUPT_GEN( namcos2_68k_slave_vblank )
r1591r1592
683683      int scanline = GetPosIRQScanline();
684684      timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_slave_posirq );
685685   }
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);
687687}
688688
689689static TIMER_CALLBACK( namcos2_68k_gpu_posirq )
690690{
691691   //printf( "namcos2_68k_gpu_posirq(%d)\n", param );
692692   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);
694694}
695695
696696INTERRUPT_GEN( namcos2_68k_gpu_vblank )
r1591r1592
701701      int scanline = 0x50+0x89; /* HACK for Winning Run */
702702      timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_gpu_posirq );
703703   }
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);
705705}
706706
707707/**************************************************************/
r1591r1592
776776      /* If the interrupt enable bit is set trigger an A/D IRQ */
777777      if(data&0x20)
778778      {
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);
780780      }
781781   }
782782}
src/mame/machine/namco50.c
r1591r1592
254254
255255static TIMER_CALLBACK( namco_50xx_irq_clear )
256256{
257   cpunum_set_input_line(param, 0, CLEAR_LINE);
257   cpunum_set_input_line(machine, param, 0, CLEAR_LINE);
258258}
259259
260260static void namco_50xx_irq_set(int cpunum)
261261{
262   cpunum_set_input_line(cpunum, 0, ASSERT_LINE);
262   cpunum_set_input_line(Machine, cpunum, 0, ASSERT_LINE);
263263
264264   // The execution time of one instruction is ~4us, so we must make sure to
265265   // give the cpu time to poll the /IRQ input before we clear it.
src/mame/machine/tx1.c
r1591r1592
6363*/
6464static TIMER_CALLBACK( interrupt_callback )
6565{
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);
6767   timer_set(video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), NULL, 0, interrupt_callback);
6868}
6969
src/mame/machine/decoprot.c
r1591r1592
110110{
111111   if (offset==(0x150/2)) {
112112      soundlatch_w(0,data&0xff);
113      cpunum_set_input_line(1,0,HOLD_LINE);
113      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
114114      return;
115115   }
116116
r1591r1592
228228{
229229   if (offset==(0x64/2)) {
230230      soundlatch_w(0,data&0xff);
231      cpunum_set_input_line(1,0,HOLD_LINE);
231      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
232232   }
233233
234234   COMBINE_DATA(&deco16_prot_ram[offset]);
r1591r1592
417417{
418418   if (offset==(0x64/2)) {
419419      soundlatch_w(0,data&0xff);
420      cpunum_set_input_line(1,0,HOLD_LINE);
420      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
421421      return;
422422   }
423423
r1591r1592
603603{
604604   if (offset==(0xa8/2)) {
605605      soundlatch_w(0,data&0xff);
606      cpunum_set_input_line(1,0,HOLD_LINE);
606      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
607607      return;
608608   }
609609
r1591r1592
665665
666666   if (offset == (0x10a >> 1)) {
667667      soundlatch_w(0,data&0xff);
668      cpunum_set_input_line(1,0,HOLD_LINE);
668      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
669669      return;
670670   }
671671}
r1591r1592
785785
786786   if (offset==(0xa8/2)) {
787787      soundlatch_w(0,data&0xff);
788      cpunum_set_input_line(1,0,HOLD_LINE);
788      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
789789      return;
790790   }
791791
r1591r1592
12161216
12171217   if (writeport==sndport) {
12181218      soundlatch_w(0,data&0xff);
1219      cpunum_set_input_line(1,0,HOLD_LINE);
1219      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
12201220      return;
12211221   }
12221222
r1591r1592
17461746{
17471747   if (offset==(0x380/2)) {
17481748      soundlatch_w(0,data&0xff);
1749      cpunum_set_input_line(1,0,HOLD_LINE);
1749      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
17501750      return;
17511751   }
17521752   logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",activecpu_get_pc(),offset<<1,data);
src/mame/machine/mcr.c
r1591r1592
189189
190190static void ctc_interrupt(int state)
191191{
192   cpunum_set_input_line(0, 0, state);
192   cpunum_set_input_line(Machine, 0, 0, state);
193193}
194194
195195
196196static void ipu_ctc_interrupt(int state)
197197{
198   cpunum_set_input_line(3, 0, state);
198   cpunum_set_input_line(Machine, 3, 0, state);
199199}
200200
201201
r1591r1592
393393   pia_config(3, &zwackery_pia_3_intf);
394394   pia_config(4, &zwackery_pia_4_intf);
395395
396   machine_start_mcr68(machine);
396   MACHINE_START_CALL(mcr68);
397397}
398398
399399
r1591r1592
482482
483483   /* set the new state of the IRQ lines */
484484   if (newstate)
485      cpunum_set_input_line(0, newstate, ASSERT_LINE);
485      cpunum_set_input_line(Machine, 0, newstate, ASSERT_LINE);
486486   else
487      cpunum_set_input_line(0, 7, CLEAR_LINE);
487      cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
488488}
489489
490490
r1591r1592
604604}
605605
606606
607void zwackery_pia_irq(int state)
607static void zwackery_pia_irq(int state)
608608{
609   v493_irq_state = state;
609   v493_irq_state = pia_get_irq_a(2) | pia_get_irq_b(2);
610610   update_mcr68_interrupts();
611611}
612612
r1591r1592
10031003static TIMER_CALLBACK( ipu_watchdog_reset )
10041004{
10051005   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);
10071007   z80ctc_reset(1);
10081008   z80pio_reset(0);
10091009   z80pio_reset(1);
src/mame/machine/tatsumi.c
r1591r1592
4848   if (tatsumi_control_word&0x7f00)
4949   {
5050      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); // ?
5252   }
5353   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);
5555
5656   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);
5858   else
59      cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE);
59      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
6060
6161   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);
6363   else
64      cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE);
64      cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
6565
6666   tatsumi_last_control=tatsumi_control_word;
6767}
6868
6969WRITE16_HANDLER( apache3_irq_ack_w )
7070{
71   cpunum_set_input_line(1, INPUT_LINE_IRQ4, CLEAR_LINE);
71   cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE);
7272
7373   if ((data&2) && (tatsumi_last_irq&2)==0)
7474   {
75      cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE);
75      cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, ASSERT_LINE);
7676   }
7777
7878   if ((tatsumi_last_irq&2) && (data&2)==0)
7979   {
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);
8282   }
8383
8484   tatsumi_last_irq=data;
r1591r1592
186186   COMBINE_DATA(&tatsumi_control_word);
187187
188188   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);
190190   else
191      cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE);
191      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
192192
193193   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);
195195   else
196      cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE);
196      cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
197197
198198//  if (offset==1 && (tatsumi_control_w&0xfeff)!=(last_bank&0xfeff))
199199//      logerror("%08x:  Changed bank to %04x (%d)\n",activecpu_get_pc(),tatsumi_control_w,offset);
r1591r1592
219219    */
220220
221221   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);
223223//  if (tatsumi_control_w&0x200)
224224//      cpu_set_reset_line(1, CLEAR_LINE);
225225//  else
r1591r1592
252252    */
253253
254254   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
256256
257257//  logerror("d_68k_e0000_w %06x %04x\n",activecpu_get_pc(),data);
258258}
r1591r1592
283283
284284   if ((tatsumi_control_word&4)==4 && (tatsumi_last_control&4)==0) {
285285//      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);
287287   }
288288
289289   if ((tatsumi_control_word&4)==0 && (tatsumi_last_control&4)==4) {
290290//      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);
292292   }
293293
294294
src/mame/machine/retofinv.c
r1591r1592
5656   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
5757   {
5858      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);
6060      main_sent = 0;
6161//logerror("read command %02x from main cpu\n",portA_in);
6262   }
r1591r1592
113113logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
114114   from_main = data;
115115   main_sent = 1;
116   cpunum_set_input_line(3,0,ASSERT_LINE);
116   cpunum_set_input_line(Machine, 3,0,ASSERT_LINE);
117117}
118118
119119READ8_HANDLER( retofinv_mcu_r )
src/mame/machine/bsktball.c
r1591r1592
3131   i256V=(i256V+1) % 8;
3232
3333   if (i256V==0)
34      cpunum_set_input_line(0, 0, HOLD_LINE);
34      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
3535   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);
3737}
3838
3939/***************************************************************************
src/mame/machine/slikshot.c
r1591r1592
508508   /* at its endpoint; otherwise, we never get a result from the Z80 */
509509   if ((data & 0x10) || cpunum_get_reg(2, Z80_PC) == 0x13a)
510510   {
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);
512512
513513      /* on the rising edge, make the crosshair visible again */
514514      if ((data & 0x10) && !(z80_ctrl & 0x10))
r1591r1592
532532
533533/*************************************
534534 *
535 *  video_update_slikshot
535 *  VIDEO_UPDATE( slishot )
536536 *
537537 *************************************/
538538
r1591r1592
542542   int temp, i;
543543
544544   /* draw the normal video first */
545   video_update_itech8_2page(machine, screen, bitmap, cliprect);
545   VIDEO_UPDATE_CALL(itech8_2page);
546546
547547   /* add the current X,Y positions to the list */
548548   xbuffer[ybuffer_next % YBUFFER_COUNT] = readinputportbytag_safe("FAKEX", 0);
src/mame/machine/harddriv.c
r1591r1592
147147static UINT32 dataval[MAX_MSP_SYNC];
148148static int next_msp_sync;
149149
150static void hd68k_update_interrupts(void);
150static void hd68k_update_interrupts(running_machine *machine);
151151static TIMER_CALLBACK( duart_callback );
152152
153153
r1591r1592
181181   atarigen_interrupt_reset(hd68k_update_interrupts);
182182
183183   /* 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);
187187
188188   /* if we found a 6502, reset the JSA board */
189189   if (hdcpu_jsa != -1)
r1591r1592
216216 *
217217 *************************************/
218218
219static void hd68k_update_interrupts(void)
219static void hd68k_update_interrupts(running_machine *machine)
220220{
221221   int newstate = 0;
222222
r1591r1592
234234      newstate = 6;
235235
236236   if (newstate)
237      cpunum_set_input_line(hdcpu_main, newstate, ASSERT_LINE);
237      cpunum_set_input_line(machine, hdcpu_main, newstate, ASSERT_LINE);
238238   else
239      cpunum_set_input_line(hdcpu_main, 7, CLEAR_LINE);
239      cpunum_set_input_line(machine, hdcpu_main, 7, CLEAR_LINE);
240240}
241241
242242
r1591r1592
532532      case 6:   /* /GSPRES */
533533         logerror("Write to /GSPRES(%d)\n", data);
534534         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);
536536         break;
537537      case 7:   /* /MSPRES */
538538         logerror("Write to /MSPRES(%d)\n", data);
539539         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);
541541         break;
542542   }
543543}
r1591r1592
772772   offs_t offset = (param >> 16) & 0xfff;
773773   UINT16 data = param;
774774   stmsp_sync[which][offset] = data;
775   cpu_triggerint(hdcpu_msp);
775   cpu_triggerint(machine, hdcpu_msp);
776776}
777777
778778
r1591r1592
872872   {
873873      logerror("%06X:ADSP sync address written (%04X)\n", activecpu_get_previouspc(), data);
874874      timer_call_after_resynch(NULL, 0, 0);
875      cpu_triggerint(hdcpu_adsp);
875      cpu_triggerint(Machine, hdcpu_adsp);
876876   }
877877   else
878878      logerror("%06X:ADSP W@%04X (%04X)\n", activecpu_get_previouspc(), offset, data);
r1591r1592
983983         adsp_br = !val;
984984         logerror("ADSP /BR = %d\n", !adsp_br);
985985         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);
987987         else
988988         {
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);
990990            /* a yield in this case is not enough */
991991            /* we would need to increase the interleaving otherwise */
992992            /* note that this only affects the test mode */
r1591r1592
10001000         adsp_halt = !val;
10011001         logerror("ADSP /HALT = %d\n", !adsp_halt);
10021002         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);
10041004         else
10051005         {
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);
10071007            /* a yield in this case is not enough */
10081008            /* we would need to increase the interleaving otherwise */
10091009            /* note that this only affects the test mode */
r1591r1592
10131013
10141014      case 7:
10151015         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);
10171017         cpu_yield();
10181018         break;
10191019
r1591r1592
11291129{
11301130   /* update the IRQ2 signal to the ADSP2101 */
11311131   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);
11331133   else
1134      cpunum_set_input_line(hdcpu_adsp, ADSP2100_IRQ2, CLEAR_LINE);
1134      cpunum_set_input_line(Machine, hdcpu_adsp, ADSP2100_IRQ2, CLEAR_LINE);
11351135}
11361136
11371137
r1591r1592
11541154         /* the ADSP at the next instruction boundary */
11551155         adsp_br = !val;
11561156         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);
11581158         else
11591159         {
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);
11611161            /* a yield in this case is not enough */
11621162            /* we would need to increase the interleaving otherwise */
11631163            /* note that this only affects the test mode */
r1591r1592
11661166         break;
11671167
11681168      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);
11701170         if (val && !ds3_reset)
11711171         {
11721172            ds3_gflag = 0;
r1591r1592
12641264   COMBINE_DATA(&ds3_g68data);
12651265   ds3_g68flag = 1;
12661266   ds3_gcmd = offset & 1;
1267   cpu_triggerint(hdcpu_adsp);
1267   cpu_triggerint(Machine, hdcpu_adsp);
12681268   update_ds3_irq();
12691269}
12701270
r1591r1592
13421342         update_ds3_irq();
13431343
13441344         /* once we've written data, trigger the main CPU to wake up again */
1345         cpu_trigger(DS3_TRIGGER);
1345         cpu_trigger(Machine, DS3_TRIGGER);
13461346         break;
13471347
13481348      case 1:
13491349         logerror("%04X:ADSP sets interrupt = %d\n", activecpu_get_previouspc(), (data >> 1) & 1);
13501350         adsp_irq_state = (data >> 1) & 1;
1351         hd68k_update_interrupts();
1351         hd68k_update_interrupts(Machine);
13521352         break;
13531353
13541354      case 2:
r1591r1592
14381438void hddsk_update_pif(UINT32 pins)
14391439{
14401440   atarigen_sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0);
1441   hd68k_update_interrupts();
1441   hd68k_update_interrupts(Machine);
14421442}
14431443
14441444
r1591r1592
14551455   switch (offset & 7)
14561456   {
14571457      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);
14591459         break;
14601460
14611461      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);
14631463         break;
14641464
14651465      case 2:   /* ZW1 */
r1591r1592
17971797
17981798   /* if $ffff is written, send an "interrupt" trigger to break us out of the spin loop */
17991799   if (hdgsp_speedup_addr[0][offset] == 0xffff)
1800      cpu_triggerint(hdcpu_gsp);
1800      cpu_triggerint(Machine, hdcpu_gsp);
18011801}
18021802
18031803
r1591r1592
18071807
18081808   /* if $ffff is written, send an "interrupt" trigger to break us out of the spin loop */
18091809   if (hdgsp_speedup_addr[1][offset] == 0xffff)
1810      cpu_triggerint(hdcpu_gsp);
1810      cpu_triggerint(Machine, hdcpu_gsp);
18111811}
18121812
18131813
r1591r1592
18401840{
18411841   COMBINE_DATA(&hdgsp_speedup_addr[0][offset]);
18421842   if (cpu_getactivecpu() != hdcpu_gsp)
1843      cpu_triggerint(hdcpu_gsp);
1843      cpu_triggerint(Machine, hdcpu_gsp);
18441844}
18451845
18461846
r1591r1592
18741874{
18751875   COMBINE_DATA(&hdmsp_speedup_addr[offset]);
18761876   if (offset == 0 && hdmsp_speedup_addr[offset] != 0)
1877      cpu_triggerint(hdcpu_msp);
1877      cpu_triggerint(Machine, hdcpu_msp);
18781878}
18791879
18801880
src/mame/machine/psx.c
r1591r1592
7070   if( ( m_n_irqdata & m_n_irqmask ) != 0 )
7171   {
7272      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 );
7474   }
7575   else
7676   {
7777      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 );
7979   }
8080}
8181
src/mame/machine/dec0.c
r1591r1592
463463static TIMER_CALLBACK( i8751_callback )
464464{
465465   /* 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);
467467   i8751_timer=NULL;
468468
469469   logerror("i8751:  Timer called!!!\n");
r1591r1592
477477   if (GAME==2) baddudes_i8751_write(data);
478478   if (GAME==3) birdtry_i8751_write(data);
479479
480   cpunum_set_input_line(0,5,HOLD_LINE);
480   cpunum_set_input_line(Machine, 0,5,HOLD_LINE);
481481
482482   /* Simulate the processing time of the i8751, time value is guessed
483483    if (i8751_timer)
r1591r1592
526526   robocop_shared_ram[offset]=data&0xff;
527527
528528   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);
530530}
531531
532532/******************************************************************************/
src/mame/machine/beezer.c
r1591r1592
4949
5050static void b_via_0_irq (int level)
5151{
52   cpunum_set_input_line(0, M6809_IRQ_LINE, level);
52   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, level);
5353}
5454
5555static READ8_HANDLER( b_via_0_pb_r )
r1591r1592
6060static WRITE8_HANDLER( b_via_0_pa_w )
6161{
6262   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);
6464   else
65      cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
65      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
6666
6767   if ((data & 0x04) == 0)
6868   {
r1591r1592
9191
9292static void b_via_1_irq (int level)
9393{
94   cpunum_set_input_line(1, M6809_IRQ_LINE, level);
94   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, level);
9595}
9696
9797static READ8_HANDLER( b_via_1_pa_r )
src/mame/machine/lsasquad.c
r1591r1592
1717
1818static TIMER_CALLBACK( nmi_callback )
1919{
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);
2121   else pending_nmi = 1;
2222}
2323
r1591r1592
3131   sound_nmi_enable = 1;
3232   if (pending_nmi)
3333   {
34      cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
34      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
3535      pending_nmi = 0;
3636   }
3737}
r1591r1592
144144   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
145145   {
146146      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);
148148      main_sent = 0;
149149//logerror("read command %02x from main cpu\n",portA_in);
150150   }
r1591r1592
168168//logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
169169   from_main = data;
170170   main_sent = 1;
171   cpunum_set_input_line(2,0,ASSERT_LINE);
171   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
172172}
173173
174174READ8_HANDLER( lsasquad_mcu_r )
src/mame/machine/williams.c
r1591r1592
4747
4848/* newer-Williams routines */
4949static WRITE8_HANDLER( williams2_snd_cmd_w );
50static void mysticm_main_irq(int state);
51static void tshoot_main_irq(int state);
5052
5153/* Lotto Fun-specific code */
5254static READ8_HANDLER( lottofun_input_port_0_r );
r1591r1592
209211{
210212   /*inputs : A/B,CA/B1,CA/B2 */ input_port_0_r, input_port_1_r, 0, 0, 0, 0,
211213   /*outputs: A/B,CA/B2       */ 0, 0, 0, 0,
212   /*irqs   : A/B             */ williams_main_firq, williams_main_irq
214   /*irqs   : A/B             */ williams_main_firq, mysticm_main_irq
213215};
214216
217/* Mystic Marathon PIA 1 */
218const 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
215225/* Turkey Shoot PIA 0 */
216226const pia6821_interface tshoot_pia_0_intf =
217227{
218228   /*inputs : A/B,CA/B1,CA/B2 */ tshoot_input_port_0_3_r, input_port_1_r, 0, 0, 0, 0,
219229   /*outputs: A/B,CA/B2       */ 0, tshoot_lamp_w, williams_port_select_w, 0,
220   /*irqs   : A/B             */ williams_main_irq, williams_main_irq
230   /*irqs   : A/B             */ tshoot_main_irq, tshoot_main_irq
221231};
222232
233/* Turkey Shoot PIA 1 */
234const 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
223241/* Turkey Shoot PIA 2 */
224242const pia6821_interface tshoot_snd_pia_intf =
225243{
r1591r1592
283301
284302static void williams_main_irq(int state)
285303{
304   int combined_state = pia_get_irq_a(1) | pia_get_irq_b(1);
305
286306   /* 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);
288308}
289309
290310
291311static void williams_main_firq(int state)
292312{
293313   /* 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);
295315}
296316
297317
298318static void williams_snd_irq(int state)
299319{
320   int combined_state = pia_get_irq_a(2) | pia_get_irq_b(2);
321
300322   /* 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);
302324}
303325
304326
305327
306328/*************************************
307329 *
330 *  Newer Williams interrupts
331 *
332 *************************************/
333
334static 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
343static 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 *
308355 *  Older Williams initialization
309356 *
310357 *************************************/
r1591r1592
892939MACHINE_RESET( joust2 )
893940{
894941   /* standard init */
895   machine_reset_williams2(machine);
942   MACHINE_RESET_CALL(williams2);
896943   pia_set_input_ca1(3, 1);
897944   state_save_register_global(joust2_current_sound_data);
898945}
src/mame/machine/system16.c
r1591r1592
5555
5656static void sound_cause_nmi( int chip ){
5757   /* 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);
5959}
6060
6161
src/mame/machine/namcond1.c
r1591r1592
4848    namcond1_h8_irq5_enabled = 0;
4949
5050    // 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);
5252}
5353
5454// instance of the shared ram pointer
r1591r1592
9797            // this is a kludge until we emulate the h8
9898       if ((namcond1_h8_irq5_enabled == 0) && (data != 0x0000))
9999       {
100          cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
100          cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
101101       }
102102            namcond1_h8_irq5_enabled = ( data != 0x0000 );
103103            break;
src/mame/machine/cps2crpt.c
r1591r1592
673673      {
674674         char loadingMessage[256]; // for displaying with UI
675675         sprintf(loadingMessage, "Decrypting %d%%", i*100/0x10000);
676         ui_set_startup_text(loadingMessage,FALSE);
676         ui_set_startup_text(Machine, loadingMessage,FALSE);
677677      }
678678
679679
r1591r1592
974974      ++k;
975975   }
976976
977   driver_init_cps2_video(machine);
977   DRIVER_INIT_CALL(cps2_video);
978978}
src/mame/machine/nb1413m3.c
r1591r1592
5454
5555      if (nb1413m3_nmi_enable)
5656      {
57         cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
57         cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
5858         nb1413m3_nmi_count++;
5959      }
6060
r1591r1592
198198   {
199199//      nb1413m3_busyflag = 1;
200200//      nb1413m3_busyctr = 0;
201      cpunum_set_input_line(0, 0, HOLD_LINE);
201      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
202202   }
203203   if (nb1413m3_nmi_enable)
204204   {
205      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
205      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
206206   }
207207
208208   #if NB1413M3_CHEAT
r1591r1592
211211#else
212212//  nb1413m3_busyflag = 1;
213213//  nb1413m3_busyctr = 0;
214   cpunum_set_input_line(0, 0, HOLD_LINE);
214   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
215215
216216#if NB1413M3_DEBUG
217217   popmessage("NMI SW:%01X CLOCK:%02X COUNT:%02X", nb1413m3_nmi_enable, nb1413m3_nmi_clock, nb1413m3_nmi_count);
src/mame/machine/atarifb.c
r1591r1592
2323   discrete_sound_w(ATARIFB_HIT_EN,  data & 0x02);         // Hit
2424   discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
2525   discrete_sound_w(ATARIFB_NOISE_EN,  data & 0x04);      // Noise Enable / Kicker
26}
2627
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   }
3928
40   if (GAME_IS_FOOTBALL4)
41      coin_counter_w (1, data & 0x80);
29WRITE8_HANDLER( atarifb4_out1_w )
30{
31   CTRLD = data;
4232
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
42WRITE8_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)
4452   {
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  */
5756   }
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   }
5863}
5964
6065
66WRITE8_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
6188WRITE8_HANDLER( atarifb_out2_w )
6289{
6390   discrete_sound_w(ATARIFB_CROWD_DATA, data & 0x0f);   // Crowd
6491
6592   coin_counter_w (0, data & 0x10);
93}
6694
67   if (GAME_IS_SOCCER)
68   {
69      coin_counter_w (1, data & 0x20);
70      coin_counter_w (2, data & 0x40);
71   }
95
96WRITE8_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);
72103}
73104
74105
106
75107/*************************************
76108 *
77109 *  LED control
src/mame/machine/simpsons.c
r1591r1592
101101
102102READ8_HANDLER( simpsons_sound_interrupt_r )
103103{
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 );
105105   return 0x00;
106106}
107107
src/mame/machine/subs.c
r1591r1592
3030{
3131   /* only do NMI interrupt if not in TEST mode */
3232   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);
3434}
3535
3636/***************************************************************************
src/mame/machine/ajax.c
r1591r1592
143143            watchdog_reset_w(0, data);
144144         else{
145145            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);
147147         }
148148         break;
149149      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);
151151         break;
152152      case 0x02:   /* Sound command number */
153153         soundlatch_w(offset,data);
r1591r1592
218218INTERRUPT_GEN( ajax_interrupt )
219219{
220220   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);
222222}
src/mame/machine/bigevglf.c
r1591r1592
4444
4545   if ((ddrB & 0x02) && (~portB_out & 0x02) && (data & 0x02)) /* positive going transition of the clock */
4646   {
47      cpunum_set_input_line(3,0,CLEAR_LINE);
47      cpunum_set_input_line(Machine, 3,0,CLEAR_LINE);
4848      main_sent = 0;
4949
5050   }
r1591r1592
8585{
8686   portA_in = data;
8787   main_sent = 1;
88   cpunum_set_input_line(3,0,ASSERT_LINE);
88   cpunum_set_input_line(Machine, 3,0,ASSERT_LINE);
8989}
9090
9191
src/mame/machine/mw8080bw.c
r1591r1592
6666   int vpos = video_screen_get_vpos(0);
6767   UINT8 counter = vpos_to_vysnc_chain_counter(vpos);
6868   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);
7070
7171   /* set up for next interrupt */
7272   if (counter == MW8080BW_INT_TRIGGER_COUNT_1)
src/mame/mamedriv.c
r1591r1592
13031303   DRIVER( snakjack )   /* (c) 1984 */
13041304   DRIVER( stocker )   /* (c) 1984 */
13051305   DRIVER( triviag1 )   /* (c) 1984 */
1306   DRIVER( trivia12 )   /* (c) 1984 */
13061307   DRIVER( triviag2 )   /* (c) 1984 */
13071308   DRIVER( triviasp )   /* (c) 1984 */
13081309   DRIVER( triviayp )   /* (c) 1984 */
r1591r1592
13141315   DRIVER( toggle )   /* (c) 1985 */
13151316   DRIVER( nametune )   /* (c) 1986 */
13161317   DRIVER( nstocker )   /* (c) 1986 */
1318   DRIVER( nstockr2 )   /* (c) 1986 */
13171319   DRIVER( sfootbal )   /* (c) 1986 */
13181320   DRIVER( spiker )   /* (c) 1986 */
13191321   DRIVER( stompin )   /* (c) 1986 */
r1591r1592
40784080   DRIVER( acombat )   /* bootleg */
40794081   DRIVER( acombato )   /* bootleg */
40804082   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 */
40834085   DRIVER( tomahawk )   /* (c) 1980 Data East, Inc. */
40844086   DRIVER( tomahaw1 )   /* (c) 1980 Data East, Inc. */
40854087   DRIVER( progolf )   /* (c) 1981 */
r1591r1592
58715873   DRIVER( ninjak2b )   /* UPL-????? (c) 1987 */
58725874   DRIVER( rdaction )   /* UPL-87003?(c) 1987 + World Games license */
58735875   DRIVER( mnight )   /* UPL-????? (c) 1987 distributed by Kawakus */
5874   DRIVER( arkarea )   /* UPL-87007 (c) [1988?] */
5876   DRIVER( arkarea )   /* UPL-87007 (c) [1987] */
58755877   DRIVER( robokid )   /* UPL-88013 (c) 1988 */
58765878   DRIVER( robokidj )   /* UPL-88013 (c) 1988 */
58775879   DRIVER( robokdj2 )   /* UPL-88013 (c) 1988 */
r1591r1592
62646266   DRIVER( heatbrl )   /* (c) 1992 Tad (World) */
62656267   DRIVER( heatbrlo )   /* (c) 1992 Tad (World) */
62666268   DRIVER( heatbrlu )   /* (c) 1992 Tad (US) */
6267   DRIVER( hetbrlu2 )   /* (c) 1992 Tad (US) */
62686269   DRIVER( godzilla )   /* (c) 1993 Banpresto */
62696270   DRIVER( denjinmk )   /* (c) 199? Banpresto */
62706271   DRIVER( sdgndmrb )   /* (c) 1993 Banpresto */
r1591r1592
78967897   DRIVER( eshb )      /* (c) 1984 Funai / Gakken */
78977898   DRIVER( comebaby )   /* (c) 2000 ExPotato */
78987899   DRIVER( peset038 )   /* (c) 1987 IGT - International Gaming Technology */
7900   DRIVER( pepp0065 )   /* (c) 1987 IGT - International Gaming Technology */
78997901   DRIVER( pepp0158 )   /* (c) 1987 IGT - International Gaming Technology */
79007902   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 */
79017905   DRIVER( pepp0516 )   /* (c) 1987 IGT - International Gaming Technology */
79027906   DRIVER( pebe0014 )   /* (c) 1994 IGT - International Gaming Technology */
79037907   DRIVER( peke1012 )   /* (c) 1994 IGT - International Gaming Technology */
src/mame/includes/ninjakd2.h
r0r1592
1extern WRITE8_HANDLER( ninjakd2_bgvideoram_w );
2extern WRITE8_HANDLER( ninjakd2_fgvideoram_w );
3extern WRITE8_HANDLER( ninjakd2_bg_ctrl_w );
4extern WRITE8_HANDLER( ninjakd2_sprite_overdraw_w );
5
6extern READ8_HANDLER( robokid_bg0_videoram_r );
7extern READ8_HANDLER( robokid_bg1_videoram_r );
8extern READ8_HANDLER( robokid_bg2_videoram_r );
9extern WRITE8_HANDLER( robokid_bg0_videoram_w );
10extern WRITE8_HANDLER( robokid_bg1_videoram_w );
11extern WRITE8_HANDLER( robokid_bg2_videoram_w );
12extern WRITE8_HANDLER( robokid_bg0_ctrl_w );
13extern WRITE8_HANDLER( robokid_bg1_ctrl_w );
14extern WRITE8_HANDLER( robokid_bg2_ctrl_w );
15extern WRITE8_HANDLER( robokid_bg0_bank_w );
16extern WRITE8_HANDLER( robokid_bg1_bank_w );
17extern WRITE8_HANDLER( robokid_bg2_bank_w );
18
19extern VIDEO_START( ninjakd2 );
20extern VIDEO_START( mnight );
21extern VIDEO_START( robokid );
22extern VIDEO_START( omegaf );
23extern VIDEO_UPDATE( ninjakd2 );
24extern VIDEO_UPDATE( robokid );
25extern VIDEO_UPDATE( omegaf );
26extern VIDEO_EOF( ninjakd2 );
27
28extern UINT8* ninjakd2_bg_videoram;
29extern UINT8* ninjakd2_fg_videoram;
src/mame/includes/phoenix.h
r1591r1592
77#define MASTER_CLOCK          XTAL_11MHz
88
99#define PIXEL_CLOCK            (MASTER_CLOCK/2)
10#define CPU_CLOCK            (PIXEL_CLOCK/2)
10#define CPU_CLOCK            (PIXEL_CLOCK)
1111#define HTOTAL               (512-160)
1212#define HBSTART               (256)
1313#define HBEND               (0)
r1591r1592
5353/*----------- defined in video/phoenix.c -----------*/
5454
5555PALETTE_INIT( phoenix );
56PALETTE_INIT( survival );
5657PALETTE_INIT( pleiads );
5758VIDEO_START( phoenix );
58VIDEO_START( pleiads );
5959VIDEO_UPDATE( phoenix );
6060
6161WRITE8_HANDLER( phoenix_videoram_w );
src/mame/includes/astrocde.h
r1591r1592
2727VIDEO_UPDATE( astrocde );
2828VIDEO_UPDATE( profpac );
2929
30void astrocade_trigger_lightpen(UINT8 vfeedback, UINT8 hfeedback);
31
3230WRITE8_HANDLER( astrocade_pattern_board_w );
3331READ8_HANDLER( astrocade_data_chip_register_r );
3432WRITE8_HANDLER( astrocade_data_chip_register_w );
src/mame/includes/exidy.h
r1591r1592
2424
2525/*----------- defined in audio/exidy.c -----------*/
2626
27void *exidy_sh6840_sh_start(int clock, const struct CustomSound_interface *config);
28void exidy_sh6840_sh_reset(void *token);
29
30WRITE8_HANDLER( exidy_sh6840_w );
31WRITE8_HANDLER( exidy_sfxctrl_w );
32
2733MACHINE_DRIVER_EXTERN( venture_audio );
2834
2935MACHINE_DRIVER_EXTERN( mtrap_cvsd_audio );
r1591r1592
3339READ8_HANDLER( victory_sound_status_r );
3440WRITE8_HANDLER( victory_sound_command_w );
3541
36MACHINE_DRIVER_EXTERN( berzerk_audio );
37WRITE8_HANDLER( berzerk_audio_w );
38READ8_HANDLER( berzerk_audio_r );
3942
4043
4144/*----------- defined in video/exidy.c -----------*/
src/mame/includes/dkong.h
r1591r1592
2525 * 256VF is not being used, so counting is from 248...255, 0...255, ....
2626 */
2727
28#define MASTER_CLOCK          61440000
28#define MASTER_CLOCK          XTAL_61_44MHz
2929#define CLOCK_1H            (MASTER_CLOCK / 5 / 4)
3030#define CLOCK_16H            (CLOCK_1H / 16)
3131#define CLOCK_1VF            ((CLOCK_16H) / 12 / 2)
r1591r1592
3939#define VBSTART               (240)
4040#define VBEND               (16)
4141
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)
4543
4644#define HARDWARE_TYPE_TAG      "HARDWARE_TYPE"
4745#define HARDWARE_TKG04         0
src/mame/includes/williams.h
r1591r1592
3636
3737/* Game-specific later-Williams PIA interfaces */
3838extern const pia6821_interface mysticm_pia_0_intf;
39extern const pia6821_interface mysticm_pia_1_intf;
3940extern const pia6821_interface tshoot_pia_0_intf;
41extern const pia6821_interface tshoot_pia_1_intf;
4042extern const pia6821_interface tshoot_snd_pia_intf;
4143extern const pia6821_interface joust2_pia_1_intf;
4244
src/mame/includes/system16.h
r1591r1592
9797extern void sys16_patch_code( int offset, int data );
9898
9999#define SYS16_MWA16_PALETTERAM   sys16_paletteram_w
100#define SYS16_MRA16_PALETTERAM   paletteram16_word_r
100#define SYS16_MRA16_PALETTERAM   MRA16_RAM
101101
102102#define SYS16_MRA16_WORKINGRAM   MRA16_RAM
103103#define SYS16_MWA16_WORKINGRAM   MWA16_RAM
src/mame/includes/redalert.h
r0r1592
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
12WRITE8_HANDLER( redalert_audio_command_w );
13WRITE8_HANDLER( redalert_voice_command_w );
14
15WRITE8_HANDLER( demoneye_audio_command_w );
16
17MACHINE_DRIVER_EXTERN( redalert_audio );
18MACHINE_DRIVER_EXTERN( demoneye_audio );
19
20
21/*----------- defined in video/redalert.c -----------*/
22
23extern UINT8 *redalert_bitmap_videoram;
24extern UINT8 *redalert_bitmap_color;
25extern UINT8 *redalert_charmap_videoram;
26extern UINT8 *redalert_video_control;
27WRITE8_HANDLER( redalert_bitmap_videoram_w );
28
29MACHINE_DRIVER_EXTERN( redalert_video );
30MACHINE_DRIVER_EXTERN( demoneye_video );
src/mame/includes/mario.h
r1591r1592
4545   UINT8   gfx_bank;
4646   UINT8   palette_bank;
4747   UINT16   gfx_scroll;
48   UINT8   flip;
4849
50   /* driver general */
51
52   UINT8   *spriteram;
53   UINT8   *videoram;
54   size_t   spriteram_size;
4955   tilemap *bg_tilemap;
5056   int monitor;
5157};
src/mame/includes/atarifb.h
r1591r1592
66
77#include "sound/discrete.h"
88
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)
139
1410/* Discrete Sound Input Nodes */
1511#define ATARIFB_WHISTLE_EN      NODE_01
r1591r1592
1915#define ATARIFB_HIT_EN         NODE_05
2016
2117
22/*----------- defined in drivers/atarifb.c -----------*/
23
24extern int atarifb_game;
25
26
2718/*----------- defined in machine/atarifb.c -----------*/
2819
2920WRITE8_HANDLER( atarifb_out1_w );
21WRITE8_HANDLER( atarifb4_out1_w );
22WRITE8_HANDLER( abaseb_out1_w );
23WRITE8_HANDLER( soccer_out1_w );
24
3025WRITE8_HANDLER( atarifb_out2_w );
26WRITE8_HANDLER( soccer_out2_w );
27
3128WRITE8_HANDLER( atarifb_out3_w );
29
3230READ8_HANDLER( atarifb_in0_r );
3331READ8_HANDLER( atarifb_in2_r );
3432READ8_HANDLER( atarifb4_in0_r );
r1591r1592
4341
4442/*----------- defined in video/atarifb.c -----------*/
4543
46extern size_t atarifb_alphap1_vram_size;
47extern size_t atarifb_alphap2_vram_size;
48extern UINT8 *atarifb_alphap1_vram;
49extern UINT8 *atarifb_alphap2_vram;
44extern UINT8 *atarifb_alphap1_videoram;
45extern UINT8 *atarifb_alphap2_videoram;
46extern UINT8 *atarifb_field_videoram;
5047extern UINT8 *atarifb_scroll_register;
5148
49VIDEO_START( atarifb );
5250VIDEO_UPDATE( atarifb );
51VIDEO_UPDATE( abaseb );
52VIDEO_UPDATE( soccer );
53
54WRITE8_HANDLER( atarifb_alpha1_videoram_w );
55WRITE8_HANDLER( atarifb_alpha2_videoram_w );
56WRITE8_HANDLER( atarifb_field_videoram_w );
src/mame/mame.mak
r1591r1592
243243SOUNDS += NAMCONA
244244SOUNDS += TMS36XX
245245SOUNDS += TMS3615
246SOUNDS += TMS5100
246247SOUNDS += TMS5110
248SOUNDS += TMS5110A
249SOUNDS += CD2801
250SOUNDS += TMC0281
251SOUNDS += CD2802
252SOUNDS += M58817
247253SOUNDS += TMC0285
248254SOUNDS += TMS5200
249255SOUNDS += TMS5220
r1591r1592
359365   $(MAMEOBJ)/orca.a \
360366   $(MAMEOBJ)/pacific.a \
361367   $(MAMEOBJ)/pacman.a \
368   $(MAMEOBJ)/pce.a \
362369   $(MAMEOBJ)/phoenix.a \
363370   $(MAMEOBJ)/playmark.a \
364371   $(MAMEOBJ)/psikyo.a \
r1591r1592
10851092   $(MACHINE)/pacplus.o \
10861093   $(MACHINE)/theglobp.o \
10871094
1095$(MAMEOBJ)/pce.a: \
1096   $(DRIVERS)/uapce.o \
1097   $(DRIVERS)/paranoia.o \
1098   $(MACHINE)/pcecommn.o $(VIDEO)/vdc.o \
1099
10881100$(MAMEOBJ)/phoenix.a: \
10891101   $(DRIVERS)/naughtyb.o $(VIDEO)/naughtyb.o \
10901102   $(DRIVERS)/phoenix.o $(AUDIO)/phoenix.o $(VIDEO)/phoenix.o \
r1591r1592
14281440   $(DRIVERS)/superdq.o
14291441
14301442$(MAMEOBJ)/upl.a: \
1431   $(DRIVERS)/mnight.o $(VIDEO)/mnight.o \
14321443   $(DRIVERS)/mouser.o $(VIDEO)/mouser.o \
1433   $(DRIVERS)/ninjakid.o $(VIDEO)/ninjakid.o \
1444   $(DRIVERS)/ninjakun.o $(VIDEO)/ninjakun.o \
14341445   $(DRIVERS)/ninjakd2.o $(VIDEO)/ninjakd2.o \
14351446   $(DRIVERS)/nova2001.o $(VIDEO)/nova2001.o \
1436   $(DRIVERS)/omegaf.o $(VIDEO)/omegaf.o \
14371447   $(DRIVERS)/pkunwar.o $(VIDEO)/pkunwar.o \
14381448   $(DRIVERS)/raiders5.o $(VIDEO)/raiders5.o \
14391449   $(DRIVERS)/xxmissio.o $(VIDEO)/xxmissio.o \
r1591r1592
16211631   $(DRIVERS)/vroulet.o \
16221632   $(DRIVERS)/wldarrow.o \
16231633   $(DRIVERS)/xyonix.o $(VIDEO)/xyonix.o \
1624   $(DRIVERS)/uapce.o $(DRIVERS)/paranoia.o $(VIDEO)/vdc.o $(MACHINE)/pcecommn.o \
16251634
16261635
16271636#-------------------------------------------------
src/mame/video/nycaptor.c
r1591r1592
8282   paletteram = auto_malloc(0x200);
8383   paletteram_2 = auto_malloc(0x200);
8484   tilemap_set_scroll_cols(bg_tilemap,32);
85   video_start_generic(machine);
8685}
8786
8887WRITE8_HANDLER( nycaptor_videoram_w )
src/mame/video/mitchell.c
r1591r1592
229229
230230READ8_HANDLER( pang_paletteram_r )
231231{
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];
234234}
235235
236236WRITE8_HANDLER( mgakuen_paletteram_w )
r1591r1592
240240
241241READ8_HANDLER( mgakuen_paletteram_r )
242242{
243   return paletteram_r(offset);
243   return paletteram[offset];
244244}
245245
246246
src/mame/video/blktiger.c
r1591r1592
160160   coin_counter_w(1,data & 2);
161161
162162   /* 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);
164164
165165   /* bit 6 flips screen */
166166   flip_screen_set(data & 0x40);
src/mame/video/midyunit.c
r1591r1592
100100{
101101   int i;
102102
103   video_start_common(machine);
103   VIDEO_START_CALL(common);
104104
105105   /* init for 4-bit */
106106   for (i = 0; i < 65536; i++)
r1591r1592
113113{
114114   int i;
115115
116   video_start_common(machine);
116   VIDEO_START_CALL(common);
117117
118118   /* init for 6-bit */
119119   for (i = 0; i < 65536; i++)
r1591r1592
124124
125125VIDEO_START( mkyawdim )
126126{
127   video_start_midyunit_6bit(machine);
127   VIDEO_START_CALL(midyunit_6bit);
128128   yawdim_dma = 1;
129129}
130130
r1591r1592
133133{
134134   int i;
135135
136   video_start_common(machine);
136   VIDEO_START_CALL(common);
137137
138138   /* init for 8-bit */
139139   for (i = 0; i < 65536; i++)
r1591r1592
390390static TIMER_CALLBACK( dma_callback )
391391{
392392   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);
394394}
395395
396396
r1591r1592
453453
454454   /* high bit triggers action */
455455   command = dma_register[DMA_COMMAND];
456   cpunum_set_input_line(0, 0, CLEAR_LINE);
456   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
457457   if (!(command & 0x8000))
458458      return;
459459
src/mame/video/stvvdp1.c
r1591r1592
318318            if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/
319319            {
320320               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);
322322            }
323323         }
324324      }
r1591r1592
19961996
19971997   /* not here! this is done every frame drawn even if the cpu isn't running eg in the debugger */
19981998//  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);
20002000
20012001   if (vdp1_sprite_log) logerror ("End of list processing!\n");
20022002}
src/mame/video/galpani2.c
r1591r1592
135135   galpani2_bg8_bitmap_0 = auto_bitmap_alloc(512, 256, BITMAP_FORMAT_INDEXED16);
136136   galpani2_bg8_bitmap_1 = auto_bitmap_alloc(512, 256, BITMAP_FORMAT_INDEXED16);
137137
138   video_start_kaneko16_sprites(machine);
138   VIDEO_START_CALL(kaneko16_sprites);
139139}
140140
141141
src/mame/video/policetr.c
r1591r1592
245245
246246            /* latch 0x50 clears IRQ4 */
247247            case 0x50:
248               cpunum_set_input_line(0, R3000_IRQ4, CLEAR_LINE);
248               cpunum_set_input_line(Machine, 0, R3000_IRQ4, CLEAR_LINE);
249249               break;
250250
251251            /* latch 0x60 clears IRQ5 */
252252            case 0x60:
253               cpunum_set_input_line(0, R3000_IRQ5, CLEAR_LINE);
253               cpunum_set_input_line(Machine, 0, R3000_IRQ5, CLEAR_LINE);
254254               break;
255255
256256            /* log anything else */
src/mame/video/midtunit.c
r1591r1592
107107
108108VIDEO_START( midwunit )
109109{
110   video_start_midtunit(machine);
110   VIDEO_START_CALL(midtunit);
111111   midtunit_gfx_rom_large = 1;
112112}
113113
114114
115115VIDEO_START( midxunit )
116116{
117   video_start_midtunit(machine);
117   VIDEO_START_CALL(midtunit);
118118   midtunit_gfx_rom_large = 1;
119119   videobank_select = 1;
120120}
r1591r1592
311311
312312READ16_HANDLER( midxunit_paletteram_r )
313313{
314   return paletteram16_word_r(offset / 2, 0);
314   return paletteram16[offset / 2];
315315}
316316
317317
r1591r1592
594594static TIMER_CALLBACK( dma_callback )
595595{
596596   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);
598598}
599599
600600
r1591r1592
684684
685685   /* high bit triggers action */
686686   command = dma_register[DMA_COMMAND];
687   cpunum_set_input_line(0, 0, CLEAR_LINE);
687   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
688688   if (!(command & 0x8000))
689689      return;
690690
src/mame/video/carpolo.c
r1591r1592
7676PALETTE_INIT( carpolo )
7777{
7878   /* 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;
8282
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   };
8587
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   };
9093
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   };
9298
9399
94100   int i;
src/mame/video/seta2.c
r1591r1592
367367
368368VIDEO_START( seta2_offset )
369369{
370   video_start_seta2(machine);
370   VIDEO_START_CALL(seta2);
371371
372372   yoffset = 0x10;
373373}
src/mame/video/dynax.c
r1591r1592
771771
772772VIDEO_START( mcnpshnt )
773773{
774   video_start_hnoridur(machine);
774   VIDEO_START_CALL(hnoridur);
775775   priority_table = priority_mcnpshnt;
776776}
777777
r1591r1592
826826
827827VIDEO_START( mjelctrn )
828828{
829   video_start_hnoridur(machine);
829   VIDEO_START_CALL(hnoridur);
830830
831831   priority_table = priority_mjelctrn;
832832   update_irq_func = mjelctrn_update_irq;
r1591r1592
834834
835835VIDEO_START( neruton )
836836{
837   video_start_hnoridur(machine);
837   VIDEO_START_CALL(hnoridur);
838838
839839//  priority_table = priority_mjelctrn;
840840   update_irq_func = neruton_update_irq;
r1591r1592
12561256
12571257VIDEO_START(htengoku)
12581258{
1259   video_start_ddenlovr(machine);
1260   video_start_hnoridur(machine);
1259   VIDEO_START_CALL(ddenlovr);
1260   VIDEO_START_CALL(hnoridur);
12611261   framebuffer = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
12621262}
12631263
r1591r1592
12661266   int layer,x,y;
12671267
12681268   // render the layers, one by one, "dynax.c" style. Then convert the pixmaps to "ddenlovr.c"
1269   // format and let video_eof_ddenlovr do the final compositing (priorities + palettes)
1269   // format and let VIDEO_EOF(ddenlovr) do the final compositing (priorities + palettes)
12701270   for (layer = 0; layer < 4; layer++)
12711271   {
12721272      fillbitmap(framebuffer,0,&machine->screen[0].visarea);
r1591r1592
12761276         for (x=0; x < 512; x++)
12771277            ddenlovr_pixmap[3-layer][y*512+x] = (UINT8)(*BITMAP_ADDR16(framebuffer, y,x));
12781278   }
1279   video_eof_ddenlovr(machine);
1279   VIDEO_EOF_CALL(ddenlovr);
12801280}
src/mame/video/amiga.c
r1591r1592
156156   /* reset the genlock color */
157157   genlock_color = 0xffff;
158158
159   video_start_generic_bitmapped(machine);
159   VIDEO_START_CALL(generic_bitmapped);
160160}
161161
162162
src/mame/video/midzeus.c
r1591r1592
654654                we simply assert immediately if this is enabled. invasn needs this for proper
655655                operations */
656656         if (zeusbase[0x80] & 0x02000000)
657            cpunum_set_input_line(0, 2, ASSERT_LINE);
657            cpunum_set_input_line(Machine, 0, 2, ASSERT_LINE);
658658         else
659            cpunum_set_input_line(0, 2, CLEAR_LINE);
659            cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE);
660660         break;
661661
662662      case 0x84:
src/mame/video/lwings.c
r1591r1592
112112
113113VIDEO_START( avengers )
114114{
115   video_start_trojan(machine);
115   VIDEO_START_CALL(trojan);
116116   bAvengersHardware = 1;
117117}
118118
src/mame/video/gticlub.c
r1591r1592
275275         {
276276            if (K001005_fifo_read_ptr < 0x3ff)
277277            {
278               //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, CLEAR_LINE);
278               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE);
279279               cpuintrf_push_context(2);
280280               sharc_set_flag_input(1, CLEAR_LINE);
281281               cpuintrf_pop_context();
282282            }
283283            else
284284            {
285               //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE);
285               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
286286               cpuintrf_push_context(2);
287287               sharc_set_flag_input(1, ASSERT_LINE);
288288               cpuintrf_pop_context();
r1591r1592
290290         }
291291         else
292292         {
293            //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE);
293            //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
294294            cpuintrf_push_context(2);
295295            sharc_set_flag_input(1, ASSERT_LINE);
296296            cpuintrf_pop_context();
r1591r1592
334334         {
335335            if (K001005_fifo_write_ptr < 0x400)
336336            {
337               //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE);
337               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
338338               cpuintrf_push_context(2);
339339               sharc_set_flag_input(1, ASSERT_LINE);
340340               cpuintrf_pop_context();
341341            }
342342            else
343343            {
344               //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, CLEAR_LINE);
344               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE);
345345               cpuintrf_push_context(2);
346346               sharc_set_flag_input(1, CLEAR_LINE);
347347               cpuintrf_pop_context();
r1591r1592
349349         }
350350         else
351351         {
352            //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE);
352            //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
353353            cpuintrf_push_context(2);
354354            sharc_set_flag_input(1, ASSERT_LINE);
355355            cpuintrf_pop_context();
r1591r1592
10241024   draw_7segment_led(bitmap, 3, 3, gticlub_led_reg0);
10251025   draw_7segment_led(bitmap, 9, 3, gticlub_led_reg1);
10261026
1027   //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE);
1027   //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
10281028   cpuintrf_push_context(2);
10291029   sharc_set_flag_input(1, ASSERT_LINE);
10301030   cpuintrf_pop_context();
src/mame/video/dkong.c
r1591r1592
668668#define RC32   ((18e3 + 68e3) * 33e-6)
669669#define RC4      (90e3 * 0.47e-6)
670670#define dt      (1./60./(double) VTOTAL)
671#define period2 (((long long)(PIXEL_CLOCK) * ( 33L * 68L )) / (long)10000000L / 3)  // period/2 in pixel ...
671#define period2 (((INT64)(PIXEL_CLOCK) * ( 33L * 68L )) / (INT32)10000000L / 3)  // period/2 in pixel ...
672672
673673static void radarscp_step(running_machine *machine, int line_cnt)
674674{
r1591r1592
886886{
887887   dkong_state *state = machine->driver_data;
888888
889   video_start_dkong_base(machine);
889   VIDEO_START_CALL(dkong_base);
890890
891891   switch (state->hardware_type)
892892   {
src/mame/video/beezer.c
r1591r1592
99   scanline = (scanline + 1) % 0x80;
1010   via_0_ca2_w (0, scanline & 0x10);
1111   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);
1313   else
14      cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE);
14      cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
1515}
1616
1717VIDEO_UPDATE( beezer )
src/mame/video/vdc.c
r1591r1592
341341   }
342342
343343   if (ret)
344      cpunum_set_input_line(0, 0, HOLD_LINE);
344      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
345345}
346346
347347VIDEO_START( pce )
r1591r1592
540540      case 0x00:
541541         temp = vdc[which].status;
542542         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);
544544         break;
545545
546546      case 0x02:
r1591r1592
806806         if(sprites_drawn > 16) {
807807            vdc[which].status |= VDC_OR;
808808            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);
810810            continue;  /* Should cause an interrupt */
811811         }
812812
r1591r1592
843843                     else if (drawn[pixel_x]==2)
844844                     {
845845                        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);
847847                        vdc[which].status|=VDC_CR;
848848                     }
849849                  }
r1591r1592
884884                     /* Check for sprite #0 collision */
885885                     else if ( drawn[pixel_x] == 2 ) {
886886                        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);
888888                        vdc[which].status|=VDC_CR;
889889                     }
890890                  }
r1591r1592
903903            if( sprites_drawn > 16 ) {
904904               vdc[which].status |= VDC_OR;
905905               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);
907907            } else {
908908               conv_obj(which, obj_i + (cgypos << 2) + (hf ? 0 : 2), obj_l, hf, vf, buf);
909909               for(x=0;x<16;x++)
r1591r1592
928928                        /* Check for sprite #0 collision */
929929                        else if ( drawn[pixel_x]==2 ) {
930930                           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);
932932                           vdc[which].status|=VDC_CR;
933933                        }
934934                     }
r1591r1592
980980   vdc[which].vdc_data[LENR].w = len;
981981   if(dvc)
982982   {
983      cpunum_set_input_line(0, 0, ASSERT_LINE);
983      cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
984984   }
985985
986986}
src/mame/video/kaneko16.c
r1591r1592
130130
131131VIDEO_START( kaneko16_1xVIEW2 )
132132{
133   video_start_kaneko16_sprites(machine);
133   VIDEO_START_CALL(kaneko16_sprites);
134134
135135   kaneko16_tmap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
136136                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
r1591r1592
176176
177177VIDEO_START( kaneko16_2xVIEW2 )
178178{
179   video_start_kaneko16_1xVIEW2(machine);
179   VIDEO_START_CALL(kaneko16_1xVIEW2);
180180
181181   kaneko16_tmap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
182182                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
r1591r1592
216216
217217VIDEO_START( sandscrp_1xVIEW2 )
218218{
219   video_start_kaneko16_1xVIEW2(machine);
219   VIDEO_START_CALL(kaneko16_1xVIEW2);
220220   pandora_start(0,0,0);
221221
222222   tilemap_set_scrolldy( kaneko16_tmap_0, 0, 256 - 1 );
r1591r1592
281281         *BITMAP_ADDR16(kaneko16_bg15_bitmap, y, sx * 256 + x) = machine->pens[2048 + ((g << 10) | (r << 5) | b)];
282282     }
283283
284   video_start_kaneko16_1xVIEW2(machine);
284   VIDEO_START_CALL(kaneko16_1xVIEW2);
285285}
286286
287287VIDEO_START( galsnew )
288288{
289   video_start_kaneko16_1xVIEW2(machine);
289   VIDEO_START_CALL(kaneko16_1xVIEW2);
290290}
291291
292292/***************************************************************************
r1591r1592
948948      fillbitmap(bitmap,machine->pens[0],cliprect);
949949}
950950
951static void kaneko16_video_update_common(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
951static VIDEO_UPDATE( common )
952952{
953953   int i;
954954
r1591r1592
962962      kaneko16_render_first_tilemap_chip(machine,bitmap,cliprect,i);
963963      kaneko16_render_second_tilemap_chip(machine,bitmap,cliprect,i);
964964   }
965
966   return 0;
965967}
966968
967969VIDEO_UPDATE(berlwall)
r1591r1592
972974   // if the display is disabled, do nothing?
973975   if (!kaneko16_disp_enable) return 0;
974976
975   kaneko16_video_update_common(machine,bitmap,cliprect);
977   VIDEO_UPDATE_CALL(common);
976978   kaneko16_render_sprites(machine,bitmap,cliprect);
977979   return 0;
978980}
r1591r1592
986988   // if the display is disabled, do nothing?
987989   if (!kaneko16_disp_enable) return 0;
988990
989   kaneko16_video_update_common(machine,bitmap,cliprect);
991   VIDEO_UPDATE_CALL(common);
990992   kaneko16_render_sprites(machine,bitmap,cliprect);
991993   return 0;
992994}
r1591r1592
10331035   // if the display is disabled, do nothing?
10341036   if (!kaneko16_disp_enable) return 0;
10351037
1036   kaneko16_video_update_common(machine,bitmap,cliprect);
1038   VIDEO_UPDATE_CALL(common);
10371039
10381040   kaneko16_render_sprites(machine,bitmap,cliprect);
10391041   return 0;
r1591r1592
10471049   // if the display is disabled, do nothing?
10481050   if (!kaneko16_disp_enable) return 0;
10491051
1050   kaneko16_video_update_common(machine,bitmap,cliprect);
1052   VIDEO_UPDATE_CALL(common);
10511053
10521054   // copy sprite bitmap to screen
10531055   pandora_update(machine,bitmap,cliprect);
src/mame/video/goldstar.c
r1591r1592
1414size_t goldstar_video_size;
1515UINT8 *goldstar_scroll1, *goldstar_scroll2, *goldstar_scroll3;
1616
17static mame_bitmap *tmpbitmap1, *tmpbitmap2, *tmpbitmap3;
17static mame_bitmap *tmpbitmap1, *tmpbitmap2, *tmpbitmap3, *tmpbitmap4;
1818static int bgcolor;
1919
2020
r1591r1592
2828{
2929//        int i;
3030
31   video_start_generic(machine);
32
3331   /* the background area is half as high as the screen */
3432   tmpbitmap1 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
3533   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
3634   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);
3736
3837   /* leave everything at the default, but map all foreground 0 pens as transparent */
3938//        for (i = 0;i < 16;i++) palette_used_colors[8 * i] = PALETTE_COLOR_TRANSPARENT;
r1591r1592
7069      sx = offs % 64;
7170      sy = offs / 64;
7271
73      drawgfx(tmpbitmap,machine->gfx[0],
72      drawgfx(tmpbitmap4,machine->gfx[0],
7473            videoram[offs] + ((colorram[offs] & 0xf0) << 4),
7574            colorram[offs] & 0x0f,
7675            0,0,
r1591r1592
7877            0,TRANSPARENCY_NONE,0);
7978   }
8079
81   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
80   copybitmap(bitmap,tmpbitmap4,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
8281
8382
8483   for (offs = goldstar_video_size - 1;offs >= 0;offs--)
r1591r1592
116115         scrolly[i] = -goldstar_scroll1[i];
117116
118117      copyscrollbitmap(bitmap,tmpbitmap1,0,0,64,scrolly,&visible1,TRANSPARENCY_NONE,0);
119                copybitmap(bitmap,tmpbitmap,0,0,0,0,&visible1,TRANSPARENCY_PEN,0);
118      copybitmap(bitmap,tmpbitmap4,0,0,0,0,&visible1,TRANSPARENCY_PEN,0);
120119
121120      for (i= 0;i < 64;i++)
122121         scrolly[i] = -goldstar_scroll2[i];
123122
124123      copyscrollbitmap(bitmap,tmpbitmap2,0,0,64,scrolly,&visible2,TRANSPARENCY_NONE,0);
125                copybitmap(bitmap,tmpbitmap,0,0,0,0,&visible2,TRANSPARENCY_PEN,0);
124      copybitmap(bitmap,tmpbitmap4,0,0,0,0,&visible2,TRANSPARENCY_PEN,0);
126125
127126      for (i= 0;i < 64;i++)
128127         scrolly[i] = -goldstar_scroll3[i];
129128
130129      copyscrollbitmap(bitmap,tmpbitmap3,0,0,64,scrolly,&visible3,TRANSPARENCY_NONE,0);
131                copybitmap(bitmap,tmpbitmap,0,0,0,0,&visible3,TRANSPARENCY_PEN,0);
130      copybitmap(bitmap,tmpbitmap4,0,0,0,0,&visible3,TRANSPARENCY_PEN,0);
132131   }
133132   return 0;
134133}
src/mame/video/system16.c
r1591r1592
885885      8,8,
886886      64*2,32*2 );
887887
888   video_start_system16(machine);
888   VIDEO_START_CALL(system16);
889889
890         tilemap_set_transparent_pen( foreground2, 0 );
890   tilemap_set_transparent_pen( foreground2, 0 );
891891
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   }
900900
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;
905905
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;
911911}
912912
913913/***************************************************************************/
src/mame/video/redalert.c
r1591r1592
11/***************************************************************************
22
3  video.c
3    Irem Red Alert hardware
44
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)
67
7***************************************************************************/
8****************************************************************************/
89
910#include "driver.h"
11#include "video/resnet.h"
1012
11UINT8 *redalert_backram;
12UINT8 *redalert_spriteram1;
13UINT8 *redalert_spriteram2;
14UINT8 *redalert_spriteram3;
15UINT8 *redalert_characterram;
16UINT8 *redalert_characterram2;
1713
18static UINT8 redalert_dirtyback[0x400];
19static UINT8 redalert_dirtycharacter[0x100];
20static UINT8 redalert_dirtycharacter2[0x100];
21static UINT8 redalert_backcolor[0x400];
14#define NUM_CHARMAP_PENS   0x200
15#define NUM_BITMAP_PENS      8
2216
2317
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 */
27static 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,
3618
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 *************************************/
4624
47static int backcolor, flip=0;
25UINT8 *redalert_bitmap_videoram;
26UINT8 *redalert_bitmap_color;
27UINT8 *redalert_charmap_videoram;
4828
49WRITE8_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 */
29UINT8 *redalert_video_control;
5530
56   /*
57        D0 == 1             -> 1 player
58        D1 == 1 and D0 == 1 -> 2 players
59    */
60   flip = !(data & 0x04);
61}
6231
63WRITE8_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}
6932
70WRITE8_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 *************************************/
7838
79/***************************************************************************
80redalert_backram_w
81***************************************************************************/
39static UINT8 *redalert_bitmap_colorram;
8240
83WRITE8_HANDLER( redalert_backram_w )
84{
85   int charnum;
8641
87   charnum = offset / 8 % 0x400;
8842
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 *************************************/
9448
95      redalert_backram[offset] = data;
96   }
49WRITE8_HANDLER( redalert_bitmap_videoram_w )
50{
51   redalert_bitmap_videoram[offset     ] = data;
52   redalert_bitmap_colorram[offset >> 3] = *redalert_bitmap_color & 0x07;
9753}
9854
99/***************************************************************************
100redalert_spriteram1_w
101***************************************************************************/
10255
103WRITE8_HANDLER( redalert_spriteram1_w )
56
57/*************************************
58 *
59 *  Color generation
60 *
61 *************************************/
62
63static void get_pens(pen_t *pens)
10464{
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 };
10870
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];
11278
113/***************************************************************************
114redalert_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);
11683
117WRITE8_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++)
12091   {
92      UINT8 data = memory_region(REGION_PROMS)[offs];
12193
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;
123103
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);
125109   }
126}
127110
128/***************************************************************************
129redalert_characterram_w
130***************************************************************************/
131
132WRITE8_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++)
135113   {
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;
137117
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);
139123   }
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]);
140127}
141128
142WRITE8_HANDLER( redalert_characterram2_w )
129
130
131/*************************************
132 *
133 *  Video hardware start
134 *
135 *************************************/
136
137static VIDEO_START( redalert )
143138{
144   if (redalert_characterram2[offset] != data)
145   {
146      redalert_dirtycharacter[((offset / 8) % 0x80)] = 1;
139   redalert_bitmap_colorram = auto_malloc(0x0400);
147140
148      redalert_characterram2[offset] = data;
149   }
141   state_save_register_global_pointer(redalert_bitmap_colorram, 0x0400);
150142}
151143
152WRITE8_HANDLER( redalert_spriteram3_w )
153{
154   if (redalert_spriteram3[offset] != data)
155   {
156      redalert_dirtycharacter2[((offset / 8) % 0x80) + 0x80] = 1;
157144
158      redalert_spriteram3[offset] = data;
159   }
160145
161}
146/*************************************
147 *
148 *  Red Alert video update
149 *
150 *************************************/
162151
163
164VIDEO_UPDATE( redalert )
152static VIDEO_UPDATE( redalert )
165153{
166   int offs,i;
154   pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
155   offs_t offs;
167156
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++)
170160   {
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;
174164
175      charcode = videoram[offs];
165      UINT8 y = offs & 0xff;
166      UINT8 x = (~offs >> 8) << 3;
176167
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)
179176      {
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];
182179      }
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      }
183185
184      /* decode modified characters */
185      if (redalert_dirtycharacter[charcode] == 1)
186      for (i = 0; i < 8; i++)
186187      {
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];
189196         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];
193198
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;
198210      }
211   }
199212
200      sx = 31 - offs / 32;
201      sy = offs % 32;
213   return 0;
214}
202215
203      stat_transparent = TRANSPARENCY_NONE;
204216
205      /* First layer of color */
206      if (charcode >= 0xC0)
207      {
208         stat_transparent = TRANSPARENCY_COLOR;
209217
210         color = color_lookup[charcode];
218/*************************************
219 *
220 *  Demoneye-X video update
221 *
222 *************************************/
211223
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);
224static VIDEO_UPDATE( demoneye )
225{
226   pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
227   offs_t offs;
218228
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);
226230
227      }
231   for (offs = 0; offs < 0x2000; offs++)
232   {
233      int i;
234      UINT8 charmap_data_1;
235      UINT8 charmap_data_2;
228236
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;
237239
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)
240248      {
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];
248251      }
249      else if (charcode < 0xC0)
252      else
250253      {
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      }
258257
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];
266261
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;
267286      }
268287   }
269288
270   for (i = 0;i < 256;i++)
271   {
272      if (redalert_dirtycharacter[i] == 2)
273         redalert_dirtycharacter[i] = 0;
289   return 0;
290}
274291
275      if (redalert_dirtycharacter2[i] == 2)
276         redalert_dirtycharacter2[i] = 0;
277   }
278292
279   for (i = 0;i < 0x400;i++)
280   {
281      if (redalert_dirtyback[i] == 2)
282         redalert_dirtyback[i] = 0;
283   }
284293
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 *************************************/
287299
288   return 0;
289}
300MACHINE_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
313MACHINE_DRIVER_END
314
315
316
317/*************************************
318 *
319 *  Demoneye-X machine driver
320 *
321 *************************************/
322
323MACHINE_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
336MACHINE_DRIVER_END
src/mame/video/stadhero.c
r1591r1592
1111
1212#include "driver.h"
1313
14UINT16 *stadhero_pf1_data,*stadhero_pf2_data;
14UINT16 *stadhero_pf1_data;
15static UINT16 *stadhero_pf2_data;
16UINT16 *stadhero_pf2_control_0;
17UINT16 *stadhero_pf2_control_1;
1518static tilemap *pf1_tilemap,*pf2_tilemap;
1619static int flipscreen;
1720
18static UINT16 stadhero_pf2_control_0[8];
19static UINT16 stadhero_pf2_control_1[8];
20
2121/******************************************************************************/
2222
2323static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int pri_mask,int pri_val)
r1591r1592
6161         inc = 1;
6262      }
6363
64      if (flip_screen) {
64      if (flipscreen) {
6565         y=240-y;
6666         x=240-x;
6767         if (fx) fx=0; else fx=1;
r1591r1592
106106   tilemap_mark_tile_dirty(pf1_tilemap,offset);
107107}
108108
109WRITE16_HANDLER( stadhero_pf2_data_w )
109READ16_HANDLER( stadhero_pf2_data_r )
110110{
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];
113112}
114113
115WRITE16_HANDLER( stadhero_pf2_control_0_w )
114WRITE16_HANDLER( stadhero_pf2_data_w )
116115{
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);
118118}
119119
120WRITE16_HANDLER( stadhero_pf2_control_1_w )
121{
122   COMBINE_DATA(&stadhero_pf2_control_1[offset]);
123}
124120
125121/******************************************************************************/
126122
r1591r1592
134130{
135131   int tile,color;
136132
137   tile=stadhero_pf2_data[tile_index];
133   tile=stadhero_pf2_data[((stadhero_pf2_control_0[2] & 0x01) ? 0x1000 : 0) | tile_index];
138134   color=tile >> 12;
139135   tile=tile&0xfff;
140136
r1591r1592
163159   pf1_tilemap =     tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
164160   pf2_tilemap =     tilemap_create(get_pf2_tile_info,stadhero_scan,TILEMAP_TYPE_PEN,     16,16,64,64);
165161
162   stadhero_pf2_data = auto_malloc(0x2000 * 2);
163
166164   tilemap_set_transparent_pen(pf1_tilemap,0);
167165}
168166
src/mame/video/simpsons.c
r1591r1592
103103{
104104   if (bank & 1)
105105   {
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);
108108   }
109109   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);
114111
115112   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);
120114   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);
125116}
126117
127118
src/mame/video/taito_b.c
r1591r1592
247247  b_sp_color_base = 0x40*16;   /*sprites   */
248248  b_tx_color_base = 0x00;      /*text      */
249249
250  video_start_taitob_core(machine);
250  VIDEO_START_CALL(taitob_core);
251251}
252252
253253VIDEO_START( taitob_color_order1 )
r1591r1592
258258  b_sp_color_base = 0x80*16;
259259  b_tx_color_base = 0xc0;
260260
261  video_start_taitob_core(machine);
261  VIDEO_START_CALL(taitob_core);
262262}
263263
264264VIDEO_START( taitob_color_order2 )
r1591r1592
269269  b_sp_color_base = 0x10*16;
270270  b_tx_color_base = 0x00;
271271
272  video_start_taitob_core(machine);
272  VIDEO_START_CALL(taitob_core);
273273}
274274
275275
276276VIDEO_START( hitice )
277277{
278  video_start_taitob_color_order0(machine);
278  VIDEO_START_CALL(taitob_color_order0);
279279
280280  pixel_bitmap = auto_bitmap_alloc(1024,512,machine->screen[0].format);
281281
src/mame/video/btime.c
r1591r1592
149149    /* the background area is twice as wide as the screen */
150150    background_bitmap = auto_bitmap_alloc(2*machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
151151
152    video_start_btime(machine);
152    VIDEO_START_CALL(btime);
153153}
154154
155155
r1591r1592
316316INTERRUPT_GEN( lnc_sound_interrupt )
317317{
318318    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);
320320}
321321
322322
src/mame/video/cps1.c
r1591r1592
11391139{
11401140   int i;
11411141
1142    machine_reset_cps(machine);
1142    MACHINE_RESET_CALL(cps);
11431143
11441144   cps1_bg_tilemap[0] = tilemap_create(get_tile0_info,tilemap0_scan,TILEMAP_TYPE_PEN, 8, 8,64,64);
11451145   cps1_bg_tilemap[1] = tilemap_create(get_tile1_info,tilemap1_scan,TILEMAP_TYPE_PEN,16,16,64,64);
r1591r1592
12011201VIDEO_START( cps1 )
12021202{
12031203    cps_version=1;
1204    video_start_cps(machine);
1204    VIDEO_START_CALL(cps);
12051205}
12061206
12071207VIDEO_START( cps2 )
r1591r1592
12101210    {
12111211        cps_version=2;
12121212    }
1213    video_start_cps(machine);
1213    VIDEO_START_CALL(cps);
12141214}
12151215
12161216/***************************************************************************
src/mame/video/wiz.c
r1591r1592
3737
3838VIDEO_START( wiz )
3939{
40   video_start_generic(machine);
41
4240   state_save_register_global_array(char_bank);
4341   state_save_register_global_array(palbank);
4442   state_save_register_global(flipx);
src/mame/video/lethalj.c
r1591r1592
105105
106106static TIMER_CALLBACK( gen_ext1_int )
107107{
108   cpunum_set_input_line(0, 0, ASSERT_LINE);
108   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
109109}
110110
111111
r1591r1592
167167
168168   /* clear the IRQ on offset 0 */
169169   else if (offset == 0)
170      cpunum_set_input_line(0, 0, CLEAR_LINE);
170      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
171171}
172172
173173
src/mame/video/galaxian.c
r1591r1592
224224
225225PALETTE_INIT( scramble )
226226{
227   palette_init_galaxian(machine, colortable, color_prom);
227   PALETTE_INIT_CALL(galaxian);
228228
229229
230230   /* blue background - 390 ohm resistor */
r1591r1592
233233
234234PALETTE_INIT( moonwar )
235235{
236   palette_init_scramble(machine, colortable, color_prom);
236   PALETTE_INIT_CALL(scramble);
237237
238238
239239   /* wire mod to connect the bullet blue output to the 220 ohm resistor */
r1591r1592
245245   int i;
246246
247247
248   palette_init_galaxian(machine, colortable, color_prom);
248   PALETTE_INIT_CALL(galaxian);
249249
250250
251251   /*  The background color generator is connected this way:
r1591r1592
269269   int i;
270270
271271
272   palette_init_galaxian(machine, colortable, color_prom);
272   PALETTE_INIT_CALL(galaxian);
273273
274274
275275   /*  The background color generator is connected this way:
r1591r1592
290290
291291PALETTE_INIT( frogger )
292292{
293   palette_init_galaxian(machine, colortable, color_prom);
293   PALETTE_INIT_CALL(galaxian);
294294
295295
296296   /* blue background - 470 ohm resistor */
r1591r1592
384384   int i;
385385
386386
387   palette_init_galaxian(machine, colortable, color_prom);
387   PALETTE_INIT_CALL(galaxian);
388388
389389
390390   /* set up background colors */
r1591r1592
415415   int i;
416416
417417
418   palette_init_galaxian(machine, colortable, color_prom);
418   PALETTE_INIT_CALL(galaxian);
419419
420420
421421   /* set up background colors */
r1591r1592
436436   int i;
437437
438438
439   palette_init_galaxian(machine, colortable, color_prom);
439   PALETTE_INIT_CALL(galaxian);
440440
441441
442442   /* set up background colors */
r1591r1592
465465{
466466   int i;
467467
468   palette_init_galaxian(machine, colortable, color_prom);
468   PALETTE_INIT_CALL(galaxian);
469469
470470
471471   /*
r1591r1592
559559
560560VIDEO_START( galaxian )
561561{
562   video_start_galaxian_plain(machine);
562   VIDEO_START_CALL(galaxian_plain);
563563
564564   draw_stars = galaxian_draw_stars;
565565
r1591r1592
568568
569569VIDEO_START( gmgalax )
570570{
571   video_start_galaxian(machine);
571   VIDEO_START_CALL(galaxian);
572572
573573   modify_charcode   = gmgalax_modify_charcode;
574574   modify_spritecode = gmgalax_modify_spritecode;
r1591r1592
577577
578578VIDEO_START( mooncrst )
579579{
580   video_start_galaxian(machine);
580   VIDEO_START_CALL(galaxian);
581581
582582   modify_charcode   = mooncrst_modify_charcode;
583583   modify_spritecode = mooncrst_modify_spritecode;
r1591r1592
585585
586586VIDEO_START( mooncrgx )
587587{
588   video_start_galaxian(machine);
588   VIDEO_START_CALL(galaxian);
589589
590590   modify_charcode   = mooncrgx_modify_charcode;
591591   modify_spritecode = mooncrgx_modify_spritecode;
r1591r1592
593593
594594VIDEO_START( moonqsr )
595595{
596   video_start_galaxian(machine);
596   VIDEO_START_CALL(galaxian);
597597
598598   modify_charcode   = moonqsr_modify_charcode;
599599   modify_spritecode = moonqsr_modify_spritecode;
r1591r1592
601601
602602VIDEO_START( mshuttle )
603603{
604   video_start_galaxian(machine);
604   VIDEO_START_CALL(galaxian);
605605
606606   modify_charcode   = mshuttle_modify_charcode;
607607   modify_spritecode = mshuttle_modify_spritecode;
r1591r1592
609609
610610VIDEO_START( pisces )
611611{
612   video_start_galaxian(machine);
612   VIDEO_START_CALL(galaxian);
613613
614614   modify_charcode   = pisces_modify_charcode;
615615   modify_spritecode = pisces_modify_spritecode;
r1591r1592
617617
618618VIDEO_START( gteikob2 )
619619{
620   video_start_pisces(machine);
620   VIDEO_START_CALL(pisces);
621621
622622   draw_bullets = gteikob2_draw_bullets;
623623}
624624
625625VIDEO_START( batman2 )
626626{
627   video_start_galaxian(machine);
627   VIDEO_START_CALL(galaxian);
628628
629629   modify_charcode   = batman2_modify_charcode;
630630   modify_spritecode = batman2_modify_spritecode;
r1591r1592
633633
634634VIDEO_START( scramble )
635635{
636   video_start_galaxian_plain(machine);
636   VIDEO_START_CALL(galaxian_plain);
637637
638638   /* FIXME: This most probably needs to be adjusted
639639     * again when RAW video params are added to scramble
r1591r1592
663663
664664VIDEO_START( turtles )
665665{
666   video_start_galaxian_plain(machine);
666   VIDEO_START_CALL(galaxian_plain);
667667
668668   draw_background = turtles_draw_background;
669669}
670670
671671VIDEO_START( theend )
672672{
673   video_start_galaxian(machine);
673   VIDEO_START_CALL(galaxian);
674674
675675   draw_bullets = theend_draw_bullets;
676676}
677677
678678VIDEO_START( darkplnt )
679679{
680   video_start_galaxian_plain(machine);
680   VIDEO_START_CALL(galaxian_plain);
681681
682682   tilemap_set_scrolldx(bg_tilemap, 0, 0);
683683   draw_bullets = darkplnt_draw_bullets;
r1591r1592
685685
686686VIDEO_START( rescue )
687687{
688   video_start_scramble(machine);
688   VIDEO_START_CALL(scramble);
689689
690690   draw_stars = rescue_draw_stars;
691691
r1591r1592
694694
695695VIDEO_START( minefld )
696696{
697   video_start_scramble(machine);
697   VIDEO_START_CALL(scramble);
698698
699699   draw_stars = rescue_draw_stars;
700700
r1591r1592
703703
704704VIDEO_START( stratgyx )
705705{
706   video_start_galaxian_plain(machine);
706   VIDEO_START_CALL(galaxian_plain);
707707
708708   draw_background = stratgyx_draw_background;
709709}
710710
711711VIDEO_START( ckongs )
712712{
713   video_start_scramble(machine);
713   VIDEO_START_CALL(scramble);
714714
715715   modify_spritecode = mshuttle_modify_spritecode;
716716}
717717
718718VIDEO_START( calipso )
719719{
720   video_start_galaxian_plain(machine);
720   VIDEO_START_CALL(galaxian_plain);
721721
722722   draw_bullets = scramble_draw_bullets;
723723
r1591r1592
728728
729729VIDEO_START( mariner )
730730{
731   video_start_galaxian_plain(machine);
731   VIDEO_START_CALL(galaxian_plain);
732732
733733   draw_stars = mariner_draw_stars;
734734
r1591r1592
741741
742742VIDEO_START( froggers )
743743{
744   video_start_galaxian_plain(machine);
744   VIDEO_START_CALL(galaxian_plain);
745745
746746   draw_background = frogger_draw_background;
747747   modify_color = frogger_modify_color;
r1591r1592
749749
750750VIDEO_START( frogger )
751751{
752   video_start_froggers(machine);
752   VIDEO_START_CALL(froggers);
753753
754754   modify_ypos = frogger_modify_ypos;
755755}
756756
757757VIDEO_START( jumpbug )
758758{
759   video_start_scramble(machine);
759   VIDEO_START_CALL(scramble);
760760
761761   draw_stars = jumpbug_draw_stars;
762762
r1591r1592
766766
767767VIDEO_START( azurian )
768768{
769   video_start_galaxian_plain(machine);
769   VIDEO_START_CALL(galaxian_plain);
770770
771771   draw_stars = galaxian_draw_stars;
772772   draw_bullets = scramble_draw_bullets; /* Shots are yellow like in Scramble */
r1591r1592
774774
775775VIDEO_START( mimonkey )
776776{
777   video_start_scramble(machine);
777   VIDEO_START_CALL(scramble);
778778
779779   modify_charcode   = mimonkey_modify_charcode;
780780   modify_spritecode = mimonkey_modify_spritecode;
r1591r1592
782782
783783VIDEO_START( dkongjrm )
784784{
785   video_start_galaxian_plain(machine);
785   VIDEO_START_CALL(galaxian_plain);
786786
787787   modify_charcode   = pisces_modify_charcode;
788788   modify_spritecode = dkongjrm_modify_spritecode;
r1591r1592
792792
793793VIDEO_START( newsin7 )
794794{
795   video_start_scramble(machine);
795   VIDEO_START_CALL(scramble);
796796
797797   spritevisiblearea      = &_spritevisibleareaflipx;
798798   spritevisibleareaflipx = &_spritevisiblearea;
r1591r1592
800800
801801VIDEO_START( scorpion )
802802{
803   video_start_scramble(machine);
803   VIDEO_START_CALL(scramble);
804804
805805   modify_spritecode = batman2_modify_spritecode;
806806}
r1591r1592
817817
818818VIDEO_START( rockclim )
819819{
820   video_start_galaxian(machine);
820   VIDEO_START_CALL(galaxian);
821821   rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
822822   draw_background = rockclim_draw_background;
823823   modify_charcode = mooncrst_modify_charcode;
r1591r1592
976976
977977VIDEO_START( bongo )
978978{
979   video_start_galaxian_plain(machine);
979   VIDEO_START_CALL(galaxian_plain);
980980
981981   modify_spritecode = batman2_modify_spritecode;
982982}
r1591r1592
10031003
10041004VIDEO_START( dambustr )
10051005{
1006   video_start_galaxian(machine);
1006   VIDEO_START_CALL(galaxian);
10071007
10081008   dambustr_bg_split_line = 0;
10091009   dambustr_bg_color_1 = 0;
src/mame/video/snk.c
r1591r1592
3636PALETTE_INIT( snk_3bpp_shadow )
3737{
3838   int i;
39   palette_init_RRRR_GGGG_BBBB(machine, colortable, color_prom);
39   PALETTE_INIT_CALL(RRRR_GGGG_BBBB);
4040
4141   if(!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
4242      popmessage("driver should use VIDEO_HAS_SHADOWS");
r1591r1592
5151PALETTE_INIT( snk_4bpp_shadow )
5252{
5353   int i;
54   palette_init_RRRR_GGGG_BBBB(machine, colortable, color_prom);
54   PALETTE_INIT_CALL(RRRR_GGGG_BBBB);
5555
5656   if(!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
5757      popmessage("driver should use VIDEO_HAS_SHADOWS");
src/mame/video/flstory.c
r1591r1592
5454
5555   paletteram = auto_malloc(0x200);
5656   paletteram_2 = auto_malloc(0x200);
57   video_start_generic(machine);
5857}
5958
6059VIDEO_START( victnine )
r1591r1592
6463
6564   paletteram = auto_malloc(0x200);
6665   paletteram_2 = auto_malloc(0x200);
67   video_start_generic(machine);
6866}
6967
7068WRITE8_HANDLER( flstory_videoram_w )
src/mame/video/leland.c
r1591r1592
7171VIDEO_START( ataxx )
7272{
7373   /* first do the standard stuff */
74   video_start_leland(machine);
74   VIDEO_START_CALL(leland);
7575
7676   /* allocate memory */
7777   ataxx_qram = auto_malloc(QRAM_SIZE);
src/mame/video/4enraya.c
r1591r1592
3030VIDEO_START( 4enraya )
3131{
3232   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
33   video_start_generic(machine);
3433}
3534
3635VIDEO_UPDATE( 4enraya)
src/mame/video/toaplan1.c
r1591r1592
12421242{
12431243   buffer_spriteram16_w(0, 0, 0);
12441244   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 */
12461246}
src/mame/video/segag80r.c
r1591r1592
611611   {
612612      /* port 0: irq ack */
613613      case 0:
614         cpunum_set_input_line(0, 0, CLEAR_LINE);
614         cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
615615         break;
616616
617617      /* port 1: background control
src/mame/video/tmnt.c
r1591r1592
339339
340340      /* bit 3 high then low triggers irq on sound CPU */
341341      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);
343343
344344      last = data & 0x08;
345345
r1591r1592
365365
366366      /* bit 2 = trigger irq on sound CPU */
367367      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);
369369
370370      last = data & 0x04;
371371
r1591r1592
387387
388388      /* bit 2 = trigger irq on sound CPU */
389389      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);
391391
392392      last = data & 0x04;
393393
r1591r1592
767767         palette_set_shadow_mode(machine, 0);
768768   }
769769
770   video_update_lgtnfght(machine,screen,bitmap,cliprect);
770   VIDEO_UPDATE_CALL(lgtnfght);
771771   return 0;
772772}
773773
src/mame/video/jpmimpct.c
r1591r1592
146146   state_save_register_global(bt477.pixmask);
147147   state_save_register_global(bt477.command);
148148   state_save_register_global(bt477.color);
149
150   video_start_generic_bitmapped(machine);
151149}
src/mame/video/pitnrun.c
r1591r1592
185185   tmp_bitmap[2] = auto_bitmap_alloc(128,128,machine->screen[0].format);
186186   tmp_bitmap[3] = auto_bitmap_alloc(128,128,machine->screen[0].format);
187187   pitnrun_spotlights();
188   video_start_generic(machine);
189188}
190189
191190static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/midzeus2.c
r1591r1592
252252
253253static TIMER_CALLBACK( int_timer_callback )
254254{
255   cpunum_set_input_line(0, 2, ASSERT_LINE);
255   cpunum_set_input_line(machine, 0, 2, ASSERT_LINE);
256256}
257257
258258
src/mame/video/capbowl.c
r1591r1592
2323
2424static void generate_interrupt(running_machine *machine, int state)
2525{
26   cpunum_set_input_line(0, M6809_FIRQ_LINE, state);
26   cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, state);
2727}
2828
2929static const struct tms34061_interface tms34061intf =
src/mame/video/beathead.c
r1591r1592
118118   if ((oldword & 8) && !(newword & 8) && current_scanline != 0)
119119   {
120120      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);
122122   }
123123}
124124
src/mame/video/cchasm.c
r1591r1592
2323
2424static TIMER_CALLBACK( cchasm_refresh_end )
2525{
26    cpunum_set_input_line (0, 2, ASSERT_LINE);
26    cpunum_set_input_line (machine, 0, 2, ASSERT_LINE);
2727}
2828
2929static void cchasm_refresh (void)
r1591r1592
114114         cchasm_refresh();
115115         break;
116116      case 0xf7:
117         cpunum_set_input_line (0, 2, CLEAR_LINE);
117         cpunum_set_input_line (Machine, 0, 2, CLEAR_LINE);
118118         break;
119119      }
120120   }
r1591r1592
132132   xcenter=((xmax+xmin)/2) << 16;
133133   ycenter=((ymax+ymin)/2) << 16;
134134
135   video_start_vector(machine);
135   VIDEO_START_CALL(vector);
136136}
src/mame/video/atarirle.c
r1591r1592
441441
442442
443443/*---------------------------------------------------------------
444    video_eof_atarirle: Flush remaining changes.
444    VIDEO_EOF(atarirle): Flush remaining changes.
445445---------------------------------------------------------------*/
446446
447447VIDEO_EOF( atarirle )
448448{
449449   int i;
450450
451//logerror("video_eof_atarirle\n");
451//logerror("VIDEO_EOF(atarirle)\n");
452452
453453   /* loop over all RLE handlers */
454454   for (i = 0; i < ATARIRLE_MAX; i++)
src/mame/video/cinemat.c
r1591r1592
180180VIDEO_START( cinemat_bilevel )
181181{
182182   color_mode = COLOR_BILEVEL;
183   video_start_vector(machine);
183   VIDEO_START_CALL(vector);
184184}
185185
186186
187187VIDEO_START( cinemat_16level )
188188{
189189   color_mode = COLOR_16LEVEL;
190   video_start_vector(machine);
190   VIDEO_START_CALL(vector);
191191}
192192
193193
194194VIDEO_START( cinemat_64level )
195195{
196196   color_mode = COLOR_64LEVEL;
197   video_start_vector(machine);
197   VIDEO_START_CALL(vector);
198198}
199199
200200
201201VIDEO_START( cinemat_color )
202202{
203203   color_mode = COLOR_RGB;
204   video_start_vector(machine);
204   VIDEO_START_CALL(vector);
205205}
206206
207207
208208VIDEO_START( cinemat_qb3color )
209209{
210210   color_mode = COLOR_QB3;
211   video_start_vector(machine);
211   VIDEO_START_CALL(vector);
212212}
213213
214214
r1591r1592
236236{
237237   int sw_option = readinputportbytag("INPUTS");
238238
239   video_update_vector(machine, screen, bitmap, cliprect);
239   VIDEO_UPDATE_CALL(vector);
240240
241241   /* set the state of the artwork */
242242   output_set_value("pressed3", (~sw_option >> 0) & 1);
src/mame/video/toaplan2.c
r1591r1592
952952                  /* HACK! When tilted, sound CPU needs to be reset. */
953953                  if (Machine->drv->sound[0].type == SOUND_YM3812)
954954                  {
955                     cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
955                     cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
956956                     sndti_reset(SOUND_YM3812, 0);
957957                  }
958958               }
r1591r1592
15171517
15181518VIDEO_UPDATE( truxton2_0 )
15191519{
1520   video_update_toaplan2_0(machine,screen,bitmap,cliprect);
1520   VIDEO_UPDATE_CALL(toaplan2_0);
15211521   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
15221522   return 0;
15231523}
src/mame/video/jailbrek.c
r1591r1592
7272{
7373   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
7474      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
75   tilemap_set_scrolldx(bg_tilemap, 0, 396 - 256);
7576}
7677
7778static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/btoads.c
r1591r1592
7777   COMBINE_DATA(&misc_control);
7878
7979   /* 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);
8181}
8282
8383
src/mame/video/cischeat.c
r1591r1592
141141/* 32 colour codes for the tiles */
142142VIDEO_START( cischeat )
143143{
144   video_start_megasys1(machine);
144   VIDEO_START_CALL(megasys1);
145145
146146    megasys1_bits_per_color_code = 5;
147147
r1591r1592
155155/* 16 colour codes for the tiles */
156156VIDEO_START( f1gpstar )
157157{
158   video_start_cischeat(machine);
158   VIDEO_START_CALL(cischeat);
159159
160160    megasys1_bits_per_color_code = 4;
161161}
162162
163163VIDEO_START( bigrun )
164164{
165   video_start_f1gpstar(machine);
165   VIDEO_START_CALL(f1gpstar);
166166}
167167
168168
r1591r1592
297297      case 0x2208/2   : break;   // watchdog reset
298298
299299      /* 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 );
303303                     break;
304304
305305      default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
r1591r1592
386386
387387      case 0x2300/2   :   /* Sound CPU: reads latch during int 4, and stores command */
388388                     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);
390390                     break;
391391
392392      /* 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 );
396396                     break;
397397
398398      default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
r1591r1592
505505
506506      /* Usually written in sequence, but not always */
507507      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;
509509
510510      case 0x0010/2   :   break;
511511
r1591r1592
525525      case 0x2208/2   : break;   // watchdog reset
526526
527527      /* 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 );
531531                     break;
532532
533533      default:      SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
r1591r1592
547547      case 0x0000/2   :
548548         if (ACCESSING_LSB)
549549         {
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);
552552         }
553553         break;
554554
src/mame/video/namcos22.c
r1591r1592
706706   {
707707      for(col=0;col<4;col++)
708708      {
709         float sum = 0.0;
709         float sum = 0.0f;
710710         int i;
711711         for( i=0; i<4; i++ )
712712         {
r1591r1592
22222222   poly_free(poly);
22232223}
22242224
2225static void video_start_common(running_machine *machine)
2225static VIDEO_START( common )
22262226{
22272227   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64 );
22282228      tilemap_set_transparent_pen( bgtilemap, 0xf );
r1591r1592
22492249VIDEO_START( namcos22 )
22502250{
22512251   mbSuperSystem22 = 0;
2252   video_start_common(machine);
2252   VIDEO_START_CALL(common);
22532253}
22542254
22552255VIDEO_START( namcos22s )
r1591r1592
22592259   namcos22_czram[1] = auto_malloc( 0x200 );
22602260   namcos22_czram[2] = auto_malloc( 0x200 );
22612261   namcos22_czram[3] = auto_malloc( 0x200 );
2262   video_start_common(machine);
2262   VIDEO_START_CALL(common);
22632263}
22642264
22652265VIDEO_UPDATE( namcos22s )
src/mame/video/vicdual.c
r1591r1592
143143VIDEO_UPDATE( vicdual_bw_or_color )
144144{
145145   if (vicdual_is_cabinet_color())
146      video_update_vicdual_color(machine, screen, bitmap, cliprect);
146      VIDEO_UPDATE_CALL(vicdual_color);
147147   else
148      video_update_vicdual_bw(machine, screen, bitmap, cliprect);
148      VIDEO_UPDATE_CALL(vicdual_bw);
149149
150150   return 0;
151151}
src/mame/video/atarisy1.c
r1591r1592
248248   /* sound CPU reset */
249249   if (diff & 0x0080)
250250   {
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);
252252      if (!(newselect & 0x0080)) atarigen_sound_reset();
253253   }
254254
src/mame/video/dec0.c
r1591r1592
5858        bit 7 (0x80) set in playfield 1 is reverse screen (set via dip-switch)
5959        bit 7 (0x80) in other playfields unknown
6060   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)
6262   6: playfield shape: 00 = 4x1, 01 = 2x2, 02 = 1x4 (low 4 bits only)
6363
6464   bank 1:
r1591r1592
713713
714714VIDEO_START( dec0 )
715715{
716   video_start_dec0_nodma(machine);
716   VIDEO_START_CALL(dec0_nodma);
717717   dec0_spriteram=auto_malloc(0x800);
718718}
719719
src/mame/video/ssv.c
r1591r1592
199199
200200VIDEO_START( eaglshot )
201201{
202   video_start_ssv(machine);
202   VIDEO_START_CALL(ssv);
203203
204204   eaglshot_gfxram      =   (UINT16*)auto_malloc(16 * 0x40000);
205205   eaglshot_dirty_tile   =   (char*)auto_malloc(16 * 0x40000 / (16*8));
r1591r1592
221221
222222VIDEO_START( gdfs )
223223{
224   video_start_ssv(machine);
224   VIDEO_START_CALL(ssv);
225225
226226   machine->gfx[2]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
227227
r1591r1592
936936      }
937937   }
938938
939   video_update_ssv(machine, screen, bitmap, cliprect);
939   VIDEO_UPDATE_CALL(ssv);
940940   return 0;
941941}
942942
r1591r1592
11071107{
11081108   int tile, pri;
11091109
1110   video_update_ssv(machine, screen, bitmap, cliprect);
1110   VIDEO_UPDATE_CALL(ssv);
11111111
11121112   // Decode zooming sprites tiles from ram
11131113   if (eaglshot_dirty)
src/mame/video/metro.c
r1591r1592
459459
460460VIDEO_START( blzntrnd )
461461{
462   video_start_metro_14220(machine);
462   VIDEO_START_CALL(metro_14220);
463463
464464   has_zoom = 1;
465465
r1591r1592
476476
477477VIDEO_START( gstrik2 )
478478{
479   video_start_metro_14220(machine);
479   VIDEO_START_CALL(metro_14220);
480480
481481   has_zoom = 1;
482482
src/mame/video/midvunit.c
r1591r1592
5959
6060   if (scanline != -1)
6161   {
62      cpunum_set_input_line(0, 0, ASSERT_LINE);
62      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
6363      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline + 1, 0), scanline, attotime_zero);
6464      timer_set(ATTOTIME_IN_HZ(25000000), NULL, -1, scanline_timer_cb);
6565   }
6666   else
67      cpunum_set_input_line(0, 0, CLEAR_LINE);
67      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
6868}
6969
7070
src/mame/video/commando.c
r1591r1592
5959   coin_counter_w(1, data & 0x02);
6060
6161   // 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);
6363
6464   // bit 7 flips screen
6565   flip_screen_set(data & 0x80);
src/mame/video/ninjakd2.c
r1591r1592
11#include "driver.h"
2#include "ninjakd2.h"
23
3UINT8 *ninjakd2_bg_videoram, *ninjakd2_fg_videoram;
4UINT8* ninjakd2_bg_videoram;
5UINT8* ninjakd2_fg_videoram;
46
5static UINT8  ninjakd2_bg_enable = 1, sprite_overdraw_enabled = 0;
6static UINT16 ninjakd2_scrollx, ninjakd2_scrolly;
7static tilemap *fg_tilemap, *bg_tilemap;
8static mame_bitmap *bitmap_sp;   /* for sprite overdraw */
7static int sprite_overdraw_enabled;
8static int next_sprite_overdraw_enabled;
9static mame_bitmap *sp_bitmap;
10// in robokid and omegaf big sprites are laid out differently in ROM
11static int robokid_sprites;
912
10static TILE_GET_INFO( get_bg_tile_info )
13static tilemap* fg_tilemap;
14static tilemap* bg_tilemap;
15static tilemap* bg0_tilemap;
16static tilemap* bg1_tilemap;
17static tilemap* bg2_tilemap;
18
19static int bank_mask = 1;
20static int robokid_bg0_bank = 0;
21static int robokid_bg1_bank = 0;
22static int robokid_bg2_bank = 0;
23static UINT8* robokid_bg0_videoram;
24static UINT8* robokid_bg1_videoram;
25static UINT8* robokid_bg2_videoram;
26
27
28static TILE_GET_INFO( get_fg_tile_info )
1129{
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));
1541}
1642
17static TILE_GET_INFO( get_fg_tile_info )
43static TILE_GET_INFO( ninjakd2_get_bg_tile_info )
1844{
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));
2256}
2357
58static 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
73static TILEMAP_MAPPER( robokid_bg_scan )
74{
75   /* logical (col,row) -> memory offset */
76   return (col & 0x0f) | ((row & 0x1f) << 4) | ((col & 0x10) << 5);
77}
78
79static TILEMAP_MAPPER( omegaf_bg_scan )
80{
81   /* logical (col,row) -> memory offset */
82   return (col & 0x0f) | ((row & 0x1f) << 4) | ((col & 0x70) << 5);
83}
84
85void 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
99static 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
104static 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
109static 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
116static 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
24134VIDEO_START( ninjakd2 )
25135{
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);
28137
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
29141   tilemap_set_transparent_pen(fg_tilemap, 15);
30142
31   bitmap_sp = auto_bitmap_alloc (machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
143   robokid_sprites = 0;
32144}
33145
146VIDEO_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
158VIDEO_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
176VIDEO_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
34197WRITE8_HANDLER( ninjakd2_bgvideoram_w )
35198{
36199   ninjakd2_bg_videoram[offset] = data;
r1591r1592
43206   tilemap_mark_tile_dirty(fg_tilemap, offset >> 1);
44207}
45208
46WRITE8_HANDLER( ninjakd2_scrollx_w )
209
210
211WRITE8_HANDLER( robokid_bg0_bank_w )
47212{
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;
52214}
53215
54WRITE8_HANDLER( ninjakd2_scrolly_w )
216WRITE8_HANDLER( robokid_bg1_bank_w )
55217{
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;
60219}
61220
62WRITE8_HANDLER( ninjakd2_background_enable_w )
221WRITE8_HANDLER( robokid_bg2_bank_w )
63222{
64   ninjakd2_bg_enable = data & 1;
223   robokid_bg2_bank = data & bank_mask;
65224}
66225
67WRITE8_HANDLER( ninjakd2_sprite_overdraw_w )
226READ8_HANDLER( robokid_bg0_videoram_r )
68227{
69   sprite_overdraw_enabled = data & 1;
228   return robokid_bg0_videoram[(robokid_bg0_bank << 10) | offset];
229}
70230
71   if(sprite_overdraw_enabled)
72      fillbitmap(bitmap_sp, 15, &Machine->screen[0].visarea);
231READ8_HANDLER( robokid_bg1_videoram_r )
232{
233   return robokid_bg1_videoram[(robokid_bg1_bank << 10) | offset];
73234}
74235
75static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
236READ8_HANDLER( robokid_bg2_videoram_r )
76237{
77   int offs;
238   return robokid_bg2_videoram[(robokid_bg2_bank << 10) | offset];
239}
78240
79   /* Draw the sprites */
241WRITE8_HANDLER( robokid_bg0_videoram_w )
242{
243   int const address = (robokid_bg0_bank << 10 ) | offset;
80244
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
249WRITE8_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
257WRITE8_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
267void 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)
82273   {
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   }
84280
85      if (spriteram[offs+2] & 2)
281   tilemap_set_scrollx(tilemap, 0, scrollx);
282   tilemap_set_scrolly(tilemap, 0, scrolly);
283}
284
285WRITE8_HANDLER( ninjakd2_bg_ctrl_w )
286{
287   bg_ctrl(offset, data, bg_tilemap);
288}
289
290WRITE8_HANDLER( robokid_bg0_ctrl_w )
291{
292   bg_ctrl(offset, data, bg0_tilemap);
293}
294
295WRITE8_HANDLER( robokid_bg1_ctrl_w )
296{
297   bg_ctrl(offset, data, bg1_tilemap);
298}
299
300WRITE8_HANDLER( robokid_bg2_ctrl_w )
301{
302   bg_ctrl(offset, data, bg2_tilemap);
303}
304
305
306
307WRITE8_HANDLER( ninjakd2_sprite_overdraw_w )
308{
309   next_sprite_overdraw_enabled = data & 1;
310}
311
312
313static 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)
86333      {
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;
94344
95         if(sprite_overdraw_enabled && (color >= 0x0c && color <= 0x0e) )
345         if (flip_screen)
96346         {
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;
105351         }
106         else
352
353         if (big)
107354         {
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         }
115359
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)
118363            {
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);
122365
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)
124368               {
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)
126373                  {
127                     if(srcgfx[offset] != 15)
374                     for (xx = 0; xx < 16; ++xx)
128375                     {
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                        }
130383                     }
131
132                     offset++;
133384                  }
134385               }
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;
135400            }
136401         }
137402      }
403      else
404      {
405         ++sprites_drawn;
406         if (sprites_drawn >= 96)
407            return;
408      }
409
410      sprptr += 16;
138411   }
412}
139413
140   if(sprite_overdraw_enabled)
141      copybitmap(bitmap, bitmap_sp, 0, 0, 0, 0, cliprect, TRANSPARENCY_PEN, 15);
414
415static 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   }
142437}
143438
439
144440VIDEO_UPDATE( ninjakd2 )
145441{
146   fillbitmap(bitmap, machine->pens[0],0);
442   fillbitmap(bitmap, machine->pens[0], cliprect);
147443
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);
150445
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);
153447
154   draw_sprites(machine, bitmap, cliprect);
155448   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
156449
157450   return 0;
158451}
452
453VIDEO_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
470VIDEO_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
488VIDEO_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}
src/mame/video/jaguar.c
r1591r1592
324324static void update_cpu_irq(void)
325325{
326326   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);
328328   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);
330330}
331331
332332
src/mame/video/bfm_adr2.c
r1591r1592
262262   if ( adder2_c101 & 0x01 )
263263   {
264264      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 );
266266   }
267267}
268268
src/mame/video/n8080.c
r1591r1592
4646{
4747   int i;
4848
49   palette_init_n8080(machine, NULL, NULL);
49   PALETTE_INIT_CALL(n8080);
5050
5151   for (i = 0; i < 0x100; i++)
5252   {
src/mame/video/liberate.c
r1591r1592
9999         /* Todo */
100100         break;
101101      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);
103103         break;
104104      case 9: /* Sound */
105105         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);
107107         break;
108108   }
109109}
src/mame/video/spdodgeb.c
r1591r1592
9797
9898   if (iloop > 1 && iloop < 32)
9999   {
100      cpunum_set_input_line(0, M6502_IRQ_LINE, HOLD_LINE);
100      cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, HOLD_LINE);
101101      video_screen_update_partial(0, scanline+7);
102102   }
103103   else if (!iloop)
104104   {
105      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
105      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
106106      video_screen_update_partial(0, 256);
107107   }
108108}
src/mame/video/seta.c
r1591r1592
537537
538538VIDEO_START( oisipuzl_2_layers )
539539{
540   video_start_seta_2_layers(machine);
540   VIDEO_START_CALL(seta_2_layers);
541541   tilemaps_flip = 1;
542542}
543543
src/mame/video/vball.c
r1591r1592
183183{
184184   int line = 31 - cpu_getiloops();
185185   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);
187187   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);
189189   //save the scroll x register value
190190   if(line<32) scrollx[31-line] = (vb_scrollx_hi + vb_scrollx_lo+4);
191191}
src/mame/video/nemesis.c
r1591r1592
9494   else
9595   {
9696      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);
10098   }
10199}
102100
src/mame/video/1942.c
r1591r1592
185185
186186   coin_counter_w(0,data & 0x01);
187187
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);
189189
190190   flip_screen_set(data & 0x80);
191191}
src/mame/video/segag80v.c
r1591r1592
331331   min_x =machine->screen[0].visarea.min_x;
332332   min_y =machine->screen[0].visarea.min_y;
333333
334   video_start_vector(machine);
334   VIDEO_START_CALL(vector);
335335}
336336
337337
338338VIDEO_UPDATE( sega )
339339{
340340   sega_generate_vector_list();
341   video_update_vector(machine,screen,bitmap,cliprect);
341   VIDEO_UPDATE_CALL(vector);
342342   return 0;
343343}
src/mame/video/battlera.c
r1591r1592
395395   /* If raster interrupt occurs, refresh screen _up_ to this point */
396396   if (rcr_enable && (current_scanline+56)==HuC6270_registers[6]) {
397397      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 */
399399   }
400400
401401   /* Start of vblank */
r1591r1592
403403      bldwolf_vblank=1;
404404      video_screen_update_partial(0, 240);
405405      if (irq_enable)
406         cpunum_set_input_line(0, 0, HOLD_LINE); /* VBL */
406         cpunum_set_input_line(machine, 0, 0, HOLD_LINE); /* VBL */
407407   }
408408
409409   /* End of vblank */
src/mame/video/mrdo.c
r1591r1592
5959   const int pull = 200;
6060   float pot[16];
6161   int weight[16];
62   const float potadjust = 0.2;   /* diode voltage drop */
62   const float potadjust = 0.2f;   /* diode voltage drop */
6363
6464   for (i = 15;i >= 0;i--)
6565   {
src/mame/video/astrocde.c
r1591r1592
426426
427427static TIMER_CALLBACK( interrupt_off )
428428{
429   cpunum_set_input_line(0, 0, CLEAR_LINE);
429   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
430430}
431431
432432
433void astrocade_trigger_lightpen(UINT8 vfeedback, UINT8 hfeedback)
433static void astrocade_trigger_lightpen(running_machine *machine, UINT8 vfeedback, UINT8 hfeedback)
434434{
435435   /* both bits 1 and 4 enable lightpen interrupts; bit 4 enables them even in horizontal */
436436   /* blanking regions; we treat them both the same here */
r1591r1592
438438   {
439439      /* bit 0 controls the interrupt mode: mode 0 means assert until acknowledged */
440440      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);
442442
443443      /* mode 1 means assert for 1 instruction */
444444      else
445445      {
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);
447447         timer_set(ATTOTIME_IN_CYCLES(1, 0), NULL, 0, interrupt_off);
448448      }
449449
r1591r1592
474474   {
475475      /* bit 2 controls the interrupt mode: mode 0 means assert until acknowledged */
476476      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);
478478
479479      /* mode 1 means assert for 1 instruction */
480480      else
481481      {
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);
483483         timer_set(ATTOTIME_IN_CYCLES(1, 0), NULL, 0, interrupt_off);
484484      }
485485   }
486486
487487   /* on some games, the horizontal drive line is conected to the lightpen interrupt */
488488   else if (astrocade_video_config & AC_LIGHTPEN_INTS)
489      astrocade_trigger_lightpen(astrocade_scanline, 8);
489      astrocade_trigger_lightpen(machine, astrocade_scanline, 8);
490490
491491   /* advance to the next scanline */
492492   scanline++;
src/mame/video/lasso.c
r1591r1592
9595{
9696   int color, pen;
9797
98   palette_init_lasso(machine,colortable,color_prom);
98   PALETTE_INIT_CALL(lasso);
9999
100100   for( color = 0; color < 0x10; color++ )
101101      for( pen = 0; pen < 0x10; pen++ )
src/mame/video/nbmj8688.c
r1591r1592
713713{
714714   int x, y, b;
715715
716   if(screen==0) video_update_mbmj8688(machine,screen,bitmap,cliprect);
716   if(screen==0) VIDEO_UPDATE_CALL(mbmj8688);
717717
718718   if (screen==1)
719719   {
src/mame/video/ginganin.c
r1591r1592
181181      break;
182182   case 7:
183183      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);
185185      break;
186186   default:
187187      logerror("CPU #0 PC %06X : Warning, videoreg %04X <- %04X\n",activecpu_get_pc(),offset,data);
src/mame/video/quasar.c
r1591r1592
126126   effect_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
127127   background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
128128
129   video_start_cvs(machine);
129   VIDEO_START_CALL(cvs);
130130}
131131
132132VIDEO_UPDATE( quasar )
src/mame/video/slapshot.c
r1591r1592
6666{
6767   taito_hide_pixels = 3;
6868   taito_sprite_type = 2;
69   video_start_slapshot_core(machine);
69   VIDEO_START_CALL(slapshot_core);
7070}
7171
7272
src/mame/video/vsnes.c
r1591r1592
1818
1919static void ppu_irq( int num, int *ppu_regs )
2020{
21   cpunum_set_input_line(num, INPUT_LINE_NMI, PULSE_LINE );
21   cpunum_set_input_line(Machine, num, INPUT_LINE_NMI, PULSE_LINE );
2222}
2323
2424/* our ppu interface                                            */
src/mame/video/victory.c
r1591r1592
103103static void victory_update_irq(void)
104104{
105105   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);
107107   else
108      cpunum_set_input_line(0, 0, CLEAR_LINE);
108      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
109109}
110110
111111
src/mame/video/sidearms.c
r1591r1592
5252   /* bit 4 resets the sound CPU */
5353   if (data & 0x10)
5454   {
55      cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
55      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
5656   }
5757
5858   /* bit 5 enables starfield */
src/mame/video/avgdvg.c
r1591r1592
14661466   vg->ydac_xor = 0x200;
14671467
14681468   register_state ();
1469   video_start_vector(machine);
1469   VIDEO_START_CALL(vector);
14701470}
14711471
14721472VIDEO_START( dvg )
r1591r1592
14811481   vg_run_timer = timer_alloc(run_state_machine, NULL);
14821482
14831483   register_state ();
1484   video_start_vector(machine);
1484   VIDEO_START_CALL(vector);
14851485}
14861486
14871487VIDEO_START( avg )
14881488{
14891489   vgc = &avg_default;
14901490   vg = &vgd;
1491   video_start_avg_common(machine);
1491   VIDEO_START_CALL(avg_common);
14921492}
14931493
14941494VIDEO_START( avg_starwars )
14951495{
14961496   vgc = &avg_starwars;
14971497   vg = &vgd;
1498   video_start_avg_common(machine);
1498   VIDEO_START_CALL(avg_common);
14991499}
15001500
15011501VIDEO_START( avg_tempest )
15021502{
15031503   vgc = &avg_tempest;
15041504   vg = &vgd;
1505   video_start_avg_common(machine);
1505   VIDEO_START_CALL(avg_common);
15061506}
15071507
15081508VIDEO_START( avg_mhavoc )
15091509{
15101510   vgc = &avg_mhavoc;
15111511   vg = &vgd;
1512   video_start_avg_common(machine);
1512   VIDEO_START_CALL(avg_common);
15131513}
15141514
15151515VIDEO_START( avg_bzone )
15161516{
15171517   vgc = &avg_bzone;
15181518   vg = &vgd;
1519   video_start_avg_common(machine);
1519   VIDEO_START_CALL(avg_common);
15201520}
15211521
15221522VIDEO_START( avg_quantum )
15231523{
15241524   vgc = &avg_quantum;
15251525   vg = &vgd;
1526   video_start_avg_common(machine);
1526   VIDEO_START_CALL(avg_common);
15271527}
15281528
src/mame/video/canyon.c
r1591r1592
9191   draw_bombs(bitmap, cliprect);
9292
9393   /* watchdog is disabled during service mode */
94   watchdog_enable(!(readinputport(2) & 0x10));
94   watchdog_enable(machine, !(readinputport(2) & 0x10));
9595
9696   return 0;
9797}
src/mame/video/exidy440.c
r1591r1592
223223static void exidy440_update_firq(void)
224224{
225225   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);
227227   else
228      cpunum_set_input_line(0, 1, CLEAR_LINE);
228      cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
229229}
230230
231231
src/mame/video/tx1.c
r1591r1592
15321532      }
15331533      case 0xe0:
15341534      {
1535         cpunum_set_input_line(1, INPUT_LINE_TEST, CLEAR_LINE);
1535         cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, CLEAR_LINE);
15361536         vregs.flags = data;
15371537         break;
15381538      }
src/mame/video/aztarac.c
r1591r1592
9191   xcenter=((xmax + xmin) / 2) << 16;
9292   ycenter=((ymax + ymin) / 2) << 16;
9393
94   video_start_vector(machine);
94   VIDEO_START_CALL(vector);
9595}
src/mame/video/m72.c
r1591r1592
173173
174174VIDEO_START( poundfor )
175175{
176   video_start_rtype2(machine);
176   VIDEO_START_CALL(rtype2);
177177
178178   tilemap_set_scrolldx(fg_tilemap,6,0);
179179   tilemap_set_scrolldx(bg_tilemap,6,0);
r1591r1592
352352
353353      /* bit 4 resets sound CPU (active low) */
354354      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);
356356      else
357         cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
357         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
358358
359359      /* bit 5 = "bank"? */
360360   }
src/mame/video/mario.c
r1591r1592
8181{
8282   mario_state   *state = Machine->driver_data;
8383
84   videoram[offset] = data;
84   state->videoram[offset] = data;
8585   tilemap_mark_tile_dirty(state->bg_tilemap, offset);
8686}
8787
r1591r1592
116116
117117WRITE8_HANDLER( mario_flip_w )
118118{
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   }
120130}
121131
122132static TILE_GET_INFO( get_bg_tile_info )
123133{
124134   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;
126136   int color;
127137
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);
129139   color = color >> 2;
130140   SET_TILE_INFO(0, code, color, 0);
131141}
r1591r1592
143153   state_save_register_global(state->gfx_bank);
144154   state_save_register_global(state->palette_bank);
145155   state_save_register_global(state->gfx_scroll);
146   state_save_register_global(flip_screen);
156   state_save_register_global(state->flip);
147157}
148158
149159/*
r1591r1592
156166   mario_state   *state = Machine->driver_data;
157167   int offs;
158168
159   for (offs = 0;offs < spriteram_size;offs += 4)
169   for (offs = 0;offs < state->spriteram_size;offs += 4)
160170   {
161      if (spriteram[offs])
171      if (state->spriteram[offs])
162172      {
163173         int x, y;
164174
165175         // 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];
168178         // sprite will be drawn if (y + scanline) & 0xF0 = 0xF0
169179         y = 240 - y; /* logical screen position */
170180
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 */
173183
174         if (flip_screen)
184         if (state->flip)
175185         {
176            y -= 6;
186            y -= 14;
177187            x -= 7;
178188            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),
182192                  x, y,
183193                  cliprect,TRANSPARENCY_PEN,0);
184194         }
r1591r1592
187197            y += 1;
188198            x -= 8;
189199            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),
193203                  x, y,
194204                  cliprect,TRANSPARENCY_PEN,0);
195205         }
r1591r1592
208218      state->monitor = t;
209219      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
210220   }
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
213225   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
214226   draw_sprites(machine, bitmap, cliprect);
227
215228   return 0;
216229}
src/mame/video/atarifb.c
r1591r1592
55*************************************************************************/
66
77#include "driver.h"
8#include "atarifb.h"
9#include "ui.h"
108
9
1110/* local */
12size_t atarifb_alphap1_vram_size;
13size_t atarifb_alphap2_vram_size;
14UINT8 *atarifb_alphap1_vram;
15UINT8 *atarifb_alphap2_vram;
11UINT8 *atarifb_alphap1_videoram;
12UINT8 *atarifb_alphap2_videoram;
13UINT8 *atarifb_field_videoram;
1614UINT8 *atarifb_scroll_register;
1715
16static tilemap *alpha1_tilemap;
17static tilemap *alpha2_tilemap;
18static tilemap *field_tilemap;
1819
19static const rectangle bigfield_area = {  4*8, 34*8-1, 0*8, 32*8-1 };
20static const rectangle left_area =     {  0*8,  3*8-1, 0*8, 32*8-1 };
21static const rectangle right_area =    { 34*8, 38*8-1, 0*8, 32*8-1 };
2220
2321
24VIDEO_UPDATE( atarifb )
22/*************************************
23 *
24 *  Tilemap callbacks
25 *
26 *************************************/
27
28static void get_tile_info_common(running_machine *machine, tile_data *tileinfo,
29                         tilemap_memory_index tile_index, UINT8 *alpha_videoram)
2530{
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;
2834
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 */
3437
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}
4140
42      sx = 8 * (offs / 32) + 35*8;
43      sy = 8 * (offs % 32) + 8;
4441
45      charcode = atarifb_alphap1_vram[offs] & 0x3f;
46      flipbit = (atarifb_alphap1_vram[offs] & 0x40) >> 6;
47      disable = (atarifb_alphap1_vram[offs] & 0x80) >> 7;
42static TILE_GET_INFO( alpha1_get_tile_info )
43{
44   get_tile_info_common(machine, tileinfo, tile_index, atarifb_alphap1_videoram);
45}
4846
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   }
5747
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;
48static TILE_GET_INFO( alpha2_get_tile_info )
49{
50   get_tile_info_common(machine, tileinfo, tile_index, atarifb_alphap2_videoram);
51}
6452
65      sx = 8 * (offs / 32);
66      sy = 8 * (offs % 32) + 8;
6753
68      charcode = atarifb_alphap2_vram[offs] & 0x3f;
69      flipbit = (atarifb_alphap2_vram[offs] & 0x40) >> 6;
70      disable = (atarifb_alphap2_vram[offs] & 0x80) >> 7;
54static 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;
7158
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}
8061
81   for (offs = videoram_size - 1;offs >= 0;offs--)
82   {
83      int charcode;
84      int flipx,flipy;
85      int sx,sy;
8662
87      charcode = videoram[offs] & 0x3f;
88      flipx = (videoram[offs] & 0x40) >> 6;
89      flipy = (videoram[offs] & 0x80) >> 7;
9063
91      sx = 8 * (offs % 32) - *atarifb_scroll_register + 8;
92      sy = 8 * (offs / 32) + 8;
9364
94      /* Soccer hack */
95      if (atarifb_game == 4)
96      {
97         sy += 8;
98      }
65/*************************************
66 *
67 *  Video RAM writes
68 *
69 *************************************/
9970
100      /* Baseball hack */
101      if (atarifb_game == 0x03) sx -= 8;
71WRITE8_HANDLER( atarifb_alpha1_videoram_w )
72{
73   atarifb_alphap1_videoram[offset] = data;
74   tilemap_mark_tile_dirty(alpha1_tilemap, offset);
75}
10276
103      if (sx < 0) sx += 256;
104      if (sx > 255) sx -= 256;
10577
106      drawgfx(tmpbitmap,machine->gfx[1],
107            charcode, 0,
108            flipx,flipy,sx,sy,
109            0,TRANSPARENCY_NONE,0);
110   }
78WRITE8_HANDLER( atarifb_alpha2_videoram_w )
79{
80   atarifb_alphap2_videoram[offset] = data;
81   tilemap_mark_tile_dirty(alpha2_tilemap, offset);
82}
11183
112   /* copy the character mapped graphics */
113   copybitmap(bitmap,tmpbitmap,0,0,8*3,0,&bigfield_area,TRANSPARENCY_NONE,0);
11484
115   /* Draw our motion objects */
85WRITE8_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
99VIDEO_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
108static 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
125static 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
116132   for (obj=0;obj<16;obj++)
117133   {
118134      int charcode;
r1591r1592
132148      /* There are 3 sets of 2 bits each, where the 2 bits represent */
133149      /* black, dk grey, grey and white. I think the 3 sets determine the */
134150      /* color of each bit in the sprite, but I haven't implemented it that way. */
135      if (atarifb_game == 4)
151      if (is_soccer)
136152      {
137153         shade = ((spriteram[obj*2+1 + 0x20]) & 0x07);
138154
139         drawgfx(bitmap,machine->gfx[sprite_bank+1],
155         drawgfx(bitmap,machine->gfx[gfx + 1],
140156            charcode, shade,
141157            flipx,flipy,sx,sy,
142158            &bigfield_area,TRANSPARENCY_PEN,0);
r1591r1592
144160         shade = ((spriteram[obj*2+1 + 0x20]) & 0x08) >> 3;
145161      }
146162
147      drawgfx(bitmap,machine->gfx[sprite_bank],
163      drawgfx(bitmap,machine->gfx[gfx],
148164            charcode, shade,
149165            flipx,flipy,sx,sy,
150166            &bigfield_area,TRANSPARENCY_PEN,0);
151167
152168      /* If this isn't soccer, handle the multiplexed sprites */
153      if (atarifb_game != 4)
169      if (!is_soccer)
154170      {
155171         /* The down markers are multiplexed by altering the y location during */
156172         /* mid-screen. We'll fake it by essentially doing the same thing here. */
157173         if ((charcode == 0x11) && (sy == 0x07))
158174         {
159175            sy = 0xf1; /* When multiplexed, it's 0x10...why? */
160            drawgfx(bitmap,machine->gfx[sprite_bank],
176            drawgfx(bitmap,machine->gfx[gfx],
161177               charcode, 0,
162178               flipx,flipy,sx,sy,
163179               &bigfield_area,TRANSPARENCY_PEN,0);
164180         }
165181      }
166182   }
183}
167184
185
186VIDEO_UPDATE( atarifb )
187{
188   draw_playfield_and_alpha(machine, bitmap, cliprect, 0, 0);
189
190   draw_sprites(machine, bitmap, cliprect, 1, 0);
191
168192   return 0;
169193}
194
195
196VIDEO_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
206VIDEO_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}
src/mame/video/csk.c
r1591r1592
125125   abilityflag = (oldstate == 5 || (RAM[ intstate1 ] == 1 && RAM[ intstate2 ] == 5)) ? 1 : 0;
126126
127127   if (cpu_getiloops() % 2)
128      cpunum_set_input_line(0, 0, HOLD_LINE);
128      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
129129   else
130      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
130      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
131131
132132}
133133
src/mame/video/taito_z.c
r1591r1592
830830   if (ACCESSING_LSB)
831831   {
832832      /* 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);
834834
835835      /* bits 1-3 n.c. */
836836
src/mame/video/phoenix.c
r1591r1592
6262   }
6363};
6464
65static 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
75static 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
6585PALETTE_INIT( phoenix )
6686{
6787   int i;
68   int t[4]= {0,1,2,3};
6988   rgb_t   *rgb;
70   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
7189
7290   rgb = compute_res_net_all(color_prom, &phoenix_decode_info, &phoenix_net_info);
7391   /* native order */
7492   for (i=0;i<256;i++)
7593   {
7694      int col;
77      col = ((t[i & 0x03] << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60);
95      col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60);
7896      palette_set_color(machine,i,rgb[col]);
7997   }
8098   palette_normalize_range(machine->palette, 0, 255, 0, 255);
8199   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 */
85100}
86101
87PALETTE_INIT( pleiads )
102PALETTE_INIT( survival )
88103{
89104   int i;
90   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
105   rgb_t   *rgb;
91106
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++)
94110   {
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]);
110114   }
115   palette_normalize_range(machine->palette, 0, 255, 0, 255);
116   free(rgb);
117}
111118
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++)
119PALETTE_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++)
115127   {
116128      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]);
123131   }
132   palette_normalize_range(machine->palette, 0, 255, 0, 255);
133   free(rgb);
124134}
125135
126136/***************************************************************************
r1591r1592
157167         0);
158168}
159169
160static 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
172static 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
184170/***************************************************************************
185171
186172  Start the video hardware emulation.
r1591r1592
215201   state_save_register_global(cocktail_mode);
216202}
217203
218VIDEO_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
240204/***************************************************************************
241205
242206  Memory handlers
r1591r1592
287251
288252WRITE8_HANDLER( pleiads_videoreg_w )
289253{
290    if (videoram_pg_index != (data & 1))
254   if (videoram_pg_index != (data & 1))
291255   {
292256      /* set memory bank */
293257      videoram_pg_index = data & 1;
r1591r1592
306270
307271    if (palette_bank != ((data >> 1) & 3))
308272   {
309      palette_bank = ((data >> 1) & 3);
273         palette_bank = ((data >> 1) & 3);
310274
311275      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
312276
r1591r1592
329293READ8_HANDLER( phoenix_input_port_0_r )
330294{
331295   if (cocktail_mode)
332      return (input_port_0_r(0) & 0x07) | (input_port_1_r(0) & 0xf8);
296      return (readinputportbytag("IN0") & 0x07) | (readinputportbytag("IN1") & 0xf8);
333297   else
334      return input_port_0_r(0);
298      return readinputportbytag("IN0");
335299}
336300
337301READ8_HANDLER( pleiads_input_port_0_r )
338302{
339   int ret = phoenix_input_port_0_r(0) & 0xf7;
303   int ret = readinputportbytag("IN0") & 0xf7;
340304
341305   /* handle Pleiads protection */
342306   switch (pleiads_protection_question)
r1591r1592
359323
360324READ8_HANDLER( survival_input_port_0_r )
361325{
362   int ret = phoenix_input_port_0_r(0);
326   int ret = readinputportbytag("IN0");
363327
364328   if (survival_protection_value)
365329   {
src/mame/video/playch10.c
r1591r1592
6767
6868static void ppu_irq( int num, int *ppu_regs )
6969{
70   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE );
70   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE );
7171   pc10_int_detect = 1;
7272}
7373
src/mame/video/atari.c
r1591r1592
766766      memset(antic.video[i], 0, sizeof(VIDEO));
767767    }
768768
769    video_start_generic_bitmapped(machine);
769    VIDEO_START_CALL(generic_bitmapped);
770770}
771771
772772/************************************************************************
r1591r1592
778778{
779779   UINT32 new_tv_artifacts;
780780
781   video_update_generic_bitmapped(machine, screen, bitmap, cliprect);
781   VIDEO_UPDATE_CALL(generic_bitmapped);
782782
783783   new_tv_artifacts = readinputportbytag_safe("artifacts", 0);
784784   if( tv_artifacts != new_tv_artifacts )
r1591r1592
10731073   {
10741074      LOG(("           @cycle #%3d issue DLI\n", cycle()));
10751075      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);
10771077   }
10781078   else
10791079   {
r1591r1592
11421142    {
11431143      LOG(("           @cycle #%3d release WSYNC\n", cycle()));
11441144        /* release the CPU if it was actually waiting for HSYNC */
1145        cpu_trigger(TRIGGER_HSYNC);
1145        cpu_trigger(machine, TRIGGER_HSYNC);
11461146        /* and turn off the 'wait for hsync' flag */
11471147        antic.w.wsync = 0;
11481148    }
11491149   LOG(("           @cycle #%3d release CPU\n", cycle()));
11501150    /* release the CPU (held for emulating cycles stolen by ANTIC DMA) */
1151   cpu_trigger(TRIGGER_STEAL);
1151   cpu_trigger(machine, TRIGGER_STEAL);
11521152
11531153   /* refresh the display (translate color clocks to pixels) */
11541154    antic_linerefresh();
r1591r1592
15311531         LOG(("           cause VBL NMI\n"));
15321532         /* set the VBL NMI status bit */
15331533         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);
15351535      }
15361536    }
15371537
src/mame/video/mpatrol.c
r1591r1592
198198
199199VIDEO_START( mpatrol )
200200{
201   int y;
202
203201   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
204202
205203   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);
207206   tilemap_set_scroll_rows(bg_tilemap, 4); /* only lines 192-256 scroll */
208207
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);
214213}
215214
216215
r1591r1592
223222    with a NAND gate on the V64 and V128 lines to control when it's read, and when
224223    255 (via 8 pull up resistors) is used.
225224
226    So we set the first 3 quarters to 255 (done in VIDEO_START) and the last to the scroll value
225    So we set the first 3 quarters to 255 and the last to the scroll value
227226*/
227   tilemap_set_scrollx(bg_tilemap, 0, 255);
228   tilemap_set_scrollx(bg_tilemap, 1, 255);
229   tilemap_set_scrollx(bg_tilemap, 2, 255);
228230   tilemap_set_scrollx(bg_tilemap, 3, -data);
229231}
230232
r1591r1592
245247}
246248
247249
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) */
253READ8_HANDLER( mpatrol_protection_r )
254{
255   int popcount = 0;
256   int temp;
248257
258   for (temp = bg1xpos & 0x7f; temp != 0; temp >>= 1)
259      popcount += temp & 1;
260   return popcount ^ (bg1xpos >> 7);
261}
262
263
249264WRITE8_HANDLER( mpatrol_bg1ypos_w )
250265{
251266   bg1ypos = data;
r1591r1592
291306      ypos = 255 - ypos - BGHEIGHT;
292307   }
293308
309   xpos += 128;
310
294311   drawgfx(bitmap, machine->gfx[image],
295312      0, 0,
296313      flip_screen,
r1591r1592
337354   if (!(bgcontrol & 0x20))
338355   {
339356      if (!(bgcontrol & 0x10))
340      {
341357         draw_background(machine, bitmap, cliprect, bg2xpos, bg2ypos, 2); /* distant mountains */
342      }
358
343359      if (!(bgcontrol & 0x02))
344      {
345360         draw_background(machine, bitmap, cliprect, bg1xpos, bg1ypos, 3); /* hills */
346      }
361
347362      if (!(bgcontrol & 0x04))
348      {
349363         draw_background(machine, bitmap, cliprect, bg1xpos, bg1ypos, 4); /* cityscape */
350      }
351364   }
352365
353366   tilemap_set_flip(bg_tilemap, flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
r1591r1592
355368   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
356369
357370   /* draw the sprites */
358
359   for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
371   for (offs = 0xfc; offs >= 0; offs -= 4)
360372   {
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;
362380
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;
367388
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 */
373390      if (flip_screen)
374391      {
392         int temp = clip.min_y;
393         clip.min_y = 255 - clip.max_y;
394         clip.max_y = 255 - temp;
375395         flipx = !flipx;
376396         flipy = !flipy;
377397         sx = 240 - sx;
378         sy = 240 - sy;
398         sy = 257 + 11 - sy;
379399      }
380400
381      sy++; /* odd */
401      sx += 128;
382402
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
383410      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);
389413   }
390414   return 0;
391415}
src/mame/video/decocass.c
r1591r1592
608608   rectangle clip;
609609
610610   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);
612612
613613   if (0 == (watchdog_flip & 0x04))
614614      watchdog_reset_w (0,0);
src/mame/video/fromance.c
r1591r1592
153153
154154VIDEO_START( pipedrm )
155155{
156   video_start_fromance(machine);
156   VIDEO_START_CALL(fromance);
157157   scrolly_ofs = 0x00;
158158}
159159
160160VIDEO_START( hatris )
161161{
162   video_start_fromance(machine);
162   VIDEO_START_CALL(fromance);
163163   scrollx_ofs = 0xB9;
164164   scrolly_ofs = 0x00;
165165}
r1591r1592
292292
293293static TIMER_CALLBACK( crtc_interrupt_gen )
294294{
295   cpunum_set_input_line(1, 0, HOLD_LINE);
295   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
296296   if (param != 0)
297297      timer_adjust(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param));
298298}
src/mame/video/combatsc.c
r1591r1592
304304static WRITE8_HANDLER( combascb_sh_irqtrigger_w )
305305{
306306   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);
308308}
309309
310310static READ8_HANDLER( combascb_io_r )
r1591r1592
384384      }
385385      else
386386      {
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 */
389388      }
390389   }
391390}
src/mame/video/n64.c
r1591r1592
1717extern UINT32 *rsp_dmem;
1818extern void dp_full_sync(void);
1919
20extern UINT32 vi_origin;
21extern UINT32 vi_width;
22extern UINT32 vi_control;
20extern UINT32 n64_vi_origin;
21extern UINT32 n64_vi_width;
22extern UINT32 n64_vi_control;
2323
2424extern UINT32 dp_start;
2525extern UINT32 dp_end;
r1591r1592
313313VIDEO_UPDATE(n64)
314314{
315315   int i, j;
316   int height = (vi_control & 0x40) ? 479 : 239;
316    int height = (n64_vi_control & 0x40) ? 479 : 239;
317317
318   switch (vi_control & 0x3)
318    switch (n64_vi_control & 0x3)
319319   {
320320      case 0:      // blank/no signal
321321      {
r1591r1592
324324
325325      case 2:      // RGBA5551
326326      {
327         UINT16 *frame_buffer = (UINT16*)&rdram[vi_origin / 4];
327            UINT16 *frame_buffer = (UINT16*)&rdram[n64_vi_origin / 4];
328328         if (frame_buffer)
329329         {
330330            for (j=0; j <height; j++)
r1591r1592
345345
346346      case 3:      // RGBA8888
347347      {
348         UINT32 *frame_buffer = (UINT32*)&rdram[vi_origin / 4];
348            UINT32 *frame_buffer = (UINT32*)&rdram[n64_vi_origin / 4];
349349         if (frame_buffer)
350350         {
351351            for (j=0; j < height; j++)
r1591r1592
361361         break;
362362      }
363363
364      default:   fatalerror("Unknown framebuffer format %d\n", vi_control & 0x3);
364        default:    fatalerror("Unknown framebuffer format %d\n", n64_vi_control & 0x3);
365365   }
366366   return 0;
367367}
src/mame/video/ddragon.c
r1591r1592
4444
4545
4646UINT8 *ddragon_bgvideoram,*ddragon_fgvideoram;
47int ddragon_scrollx_hi, ddragon_scrolly_hi;
47UINT16 ddragon_scrollx_hi, ddragon_scrolly_hi;
4848UINT8 *ddragon_scrollx_lo;
4949UINT8 *ddragon_scrolly_lo;
5050UINT8 *ddragon_spriteram;
51int technos_video_hw;
51UINT8 technos_video_hw;
5252
5353static tilemap *fg_tilemap,*bg_tilemap;
5454
r1591r1592
109109   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
110110
111111   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);
112119}
113120
114121VIDEO_START( chinagat )
r1591r1592
117124   fg_tilemap = tilemap_create(get_fg_16color_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
118125
119126   tilemap_set_transparent_pen(fg_tilemap,0);
127
128   state_save_register_global(ddragon_scrollx_hi);
129   state_save_register_global(ddragon_scrolly_hi);
120130}
121131
122132
r1591r1592
166176      int attr = src[i+1];
167177      if ( attr & 0x80 ) { /* visible */
168178         int sx = 240 - src[i+4] + ( ( attr & 2 ) << 7 );
169         int sy = 240 - src[i+0] + ( ( attr & 1 ) << 8 );
179         int sy = 232 - src[i+0] + ( ( attr & 1 ) << 8 );
170180         int size = ( attr & 0x30 ) >> 4;
171181         int flipx = ( attr & 8 );
172182         int flipy = ( attr & 4 );
r1591r1592
194204         if (flip_screen)
195205         {
196206            sx = 240 - sx;
197            sy = 240 - sy;
207            sy = 256 - sy;
198208            flipx = !flipx;
199209            flipy = !flipy;
200210            dx = -dx;
src/mame/video/asterix.c
r1591r1592
4848   K056832_vh_start(machine, REGION_GFX1, K056832_BPP_4, 1, NULL, asterix_tile_callback, 1);
4949   K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER, asterix_sprite_callback);
5050
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
5651   K053245_set_SpriteOffset(0,-3,-1);
5752}
5853
r1591r1592
7772   static const int K053251_CI[4] = { K053251_CI0, K053251_CI2, K053251_CI3, K053251_CI4 };
7873   int layer[3], plane, new_colorbase;
7974
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
8092   tilebanks[0] = (K056832_get_lookup(0) << 10);
8193   tilebanks[1] = (K056832_get_lookup(1) << 10);
8294   tilebanks[2] = (K056832_get_lookup(2) << 10);
src/mame/video/tubep.c
r1591r1592
437437
438438static TIMER_CALLBACK( sprite_timer_callback )
439439{
440   cpunum_set_input_line(3,0,ASSERT_LINE);
440   cpunum_set_input_line(machine, 3,0,ASSERT_LINE);
441441}
442442
443443
r1591r1592
566566            /SINT line will be reasserted in XSize * YSize cycles (RH0 signal cycles)
567567            */
568568         /* 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);
570570
571571         /* 2.assert /SINT again after this time */
572572         timer_set( attotime_mul(ATTOTIME_IN_HZ(19968000/8), (XSize+1)*(YSize+1)), NULL, 0, sprite_timer_callback);
src/mame/video/homedata.c
r1591r1592
132132   } /* for(;;) */
133133
134134finish:
135   cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE);
135   cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE);
136136}
137137
138138static void reikaids_handleblit( int rom_base )
r1591r1592
232232   }
233233
234234finish:
235   cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE);
235   cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE);
236236}
237237
238238static void pteacher_handleblit( int rom_base )
r1591r1592
320320   } /* for(;;) */
321321
322322finish:
323   cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE);
323   cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE);
324324}
325325
326326
src/mame/video/exidy.c
r1591r1592
8080   int_condition &= ~0x80;
8181
8282   /* set the IRQ line */
83   cpunum_set_input_line(0, 0, ASSERT_LINE);
83   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
8484}
8585
8686
r1591r1592
9191      exidy_vblank_interrupt(machine, cpunum);
9292
9393   /* 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);
9595}
9696
9797
9898READ8_HANDLER( exidy_interrupt_r )
9999{
100100   /* clear any interrupts */
101   cpunum_set_input_line(0, 0, CLEAR_LINE);
101   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
102102
103103   /* return the latched condition */
104104   return int_condition;
r1591r1592
282282   latch_condition(param);
283283
284284   /* set the IRQ line */
285   cpunum_set_input_line(0, 0, ASSERT_LINE);
285   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
286286}
287287
288288
src/mame/video/hng64.c
r1591r1592
12781278   /* hack to enable 2nd cpu when key is pressed */
12791279//  if ( input_code_pressed_once(KEYCODE_L) )
12801280//  {
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);
12831283//  }
12841284
12851285   /* AJG */
src/mame/video/skychut.c
r1591r1592
9797   for (i=0;i<32*8;i++)
9898      extyoffs[i] = i*8;
9999
100   video_start_generic(machine);
101
102100   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,32,32);
103101   tilemap_set_transparent_pen(tx_tilemap, 0x07);
104102   tilemap_set_scrolldx(tx_tilemap, 0, 62);
r1591r1592
120118
121119   decodegfx(machine->gfx[0], state->chargen,0,256);
122120
123   video_start_generic(machine);
124
125121   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,32,32);
126122   tilemap_set_scrolldx(tx_tilemap, 0, 116);
127123   tilemap_set_scrolldy(tx_tilemap, 0, 0);
src/mame/video/m92.c
r1591r1592
129129
130130READ16_HANDLER( m92_paletteram_r )
131131{
132   return paletteram16_word_r(offset + 0x400 * m92_palette_bank, mem_mask);
132   return paletteram16[offset + 0x400 * m92_palette_bank];
133133}
134134
135135WRITE16_HANDLER( m92_paletteram_w )
src/mame/video/fcombat.c
r1591r1592
116116VIDEO_START( fcombat )
117117{
118118   bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32*8*2,32);
119   video_start_generic(machine);
120119}
121120
122121
src/mame/video/wwfwfest.c
r1591r1592
237237
238238VIDEO_START( wwfwfstb )
239239{
240   video_start_wwfwfest(machine);
240   VIDEO_START_CALL(wwfwfest);
241241
242242   sprite_xoff = 2;
243243   bg0_dx = bg1_dx[0] = -4;
src/mame/video/circus.c
r1591r1592
259259   // report collision only when the character is not blank and within display area
260260   if (collision && code!=0xf && clown_x>0 && clown_x<240 && clown_y>-12 && clown_y<240)
261261   {
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);
264264   }
265265}
266266
src/mame/video/ninjakun.c
r0r1592
1#include "driver.h"
2#include "sound/ay8910.h"
3
4
5UINT8 *ninjakun_fg_videoram;
6UINT8 *ninjakun_bg_videoram;
7static tilemap *bg_tilemap, *fg_tilemap;
8static UINT8 flipscreen;
9static UINT8 ninjakun_xscroll,ninjakun_yscroll;
10
11static UINT8 ninjakun_io_8000_ctrl[4];
12// static UINT8 old_scroll;
13
14/*******************************************************************************
15 Tilemap Callbacks
16*******************************************************************************/
17
18static 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
29static 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
40WRITE8_HANDLER( ninjakun_fg_videoram_w ){
41   ninjakun_fg_videoram[offset] = data;
42   tilemap_mark_tile_dirty(fg_tilemap,offset&0x3ff);
43}
44
45WRITE8_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
55READ8_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
66WRITE8_HANDLER( ninjakun_flipscreen_w ){
67   flipscreen = data?(TILEMAP_FLIPX|TILEMAP_FLIPY):0;
68   tilemap_set_flip( ALL_TILEMAPS,flipscreen );
69}
70
71READ8_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
135WRITE8_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
177WRITE8_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
202VIDEO_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
214static 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
262VIDEO_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}
src/mame/video/segasyse.c
r1591r1592
5353*******************************************************************************/
5454
5555/* starts vdp for bios screen only */
56void megaplay_start_video_normal(running_machine *machine)
56VIDEO_START( megaplay_normal )
5757{
5858   palette_base = 0x40;
5959
r1591r1592
6262   cache_bitmap = auto_malloc( (16+256+16) * 192); /* 16 pixels either side to simplify drawing */
6363}
6464
65void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
65VIDEO_UPDATE( megaplay_normal )
6666{
6767   int miny = (cliprect->min_y < 16) ? 16 : cliprect->min_y;
6868   int maxy = (cliprect->max_y > 16+192-1) ? 16+192-1 : cliprect->max_y;
r1591r1592
7676   for (i = miny;i <= maxy;i++)
7777      draw_scanline8(bitmap,32,i,256,&cache_bitmap[(i-16) * (16+256+16) +24],&machine->pens[palette_base],0);
7878
79   return 0;
7980}
8081
8182/*******************************************************************************
r1591r1592
464465
465466      if ( (line >= ypos) && (line < ypos+sheight) ) {
466467         int xpos;
467         UINT8 sprnum;
468         UINT16 sprnum;
468469         UINT8 spline;
469470
470471         spline = line - ypos;
src/mame/video/ninjaw.c
r1591r1592
4848VIDEO_START( ninjaw )
4949{
5050   taito_hide_pixels = 22;
51   video_start_ninjaw_core(machine);
51   VIDEO_START_CALL(ninjaw_core);
5252}
5353
5454/************************************************************
src/mame/video/arkanoid.c
r1591r1592
6767     which resets itself).  This bit is the likely candidate as it is flipped
6868     early in bootup just prior to accessing the MCU for the first time. */
6969   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);
7171}
7272
7373static TILE_GET_INFO( get_bg_tile_info )
src/mame/video/megasys1.c
r1591r1592
449449
450450      case 0x300/2   :   megasys1_screen_flag = new_data;
451451                     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);
453453                     else
454                        cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
454                        cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
455455                     break;
456456
457457      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);
459459                     break;
460460
461461      default       :   SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
r1591r1592
500500
501501      case 0x2308/2   :   megasys1_screen_flag = new_data;
502502                     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);
504504                     else
505                        cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
505                        cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
506506                     break;
507507
508508      case 0x8000/2   :   /* Cybattler reads sound latch on irq 2 */
509509                     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);
511511                     break;
512512
513513      default:      SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
src/mame/video/bwing.c
r1591r1592
130130
131131WRITE8_HANDLER( bwing_paletteram_w )
132132{
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}};
134134   int r, g, b, i;
135135
136136   paletteram[offset] = data;
src/mame/video/dec8.c
r1591r1592
195195   scroll2[2]=(data>>6)&1;
196196
197197   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);
199199   else
200      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
200      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
201201}
202202
203203WRITE8_HANDLER( shackled_control_w )
src/mame/video/genesis.c
r1591r1592
1111#include "genesis.h"
1212
1313/* in video/segasyse.c */
14void megaplay_start_video_normal(running_machine *machine);
15void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
14VIDEO_START( megaplay_normal );
15VIDEO_UPDATE( megaplay_normal );
1616
1717static int genesis_screen_number;
1818
r1591r1592
272272   if (!display_enable)
273273      fillbitmap(bitmap, get_black_pen(machine), cliprect);
274274   else
275      video_update_genesis(machine, screen, bitmap, cliprect);
275      VIDEO_UPDATE_CALL(genesis);
276276   return 0;
277277}
278278
r1591r1592
290290   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
291291      drawline(BITMAP_ADDR16(bitmap, y, 0), y, 0);
292292
293   megaplay_update_video_normal(machine, bitmap, cliprect);
293   VIDEO_UPDATE_CALL(megaplay_normal);
294294
295295   return 0;
296296}
src/mame/video/rpunch.c
r1591r1592
7676
7777static TIMER_CALLBACK( crtc_interrupt_gen )
7878{
79   cpunum_set_input_line(0, 1, HOLD_LINE);
79   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
8080   if (param != 0)
8181      timer_adjust(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param));
8282}
src/mame/video/exerion.c
r1591r1592
162162            *dst++ = 0;
163163      }
164164   }
165
166   video_start_generic(machine);
167165}
168166
169167
src/mame/video/exctsccr.c
r1591r1592
9797
9898static TIMER_CALLBACK( exctsccr_fm_callback )
9999{
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 );
101101}
102102
103103WRITE8_HANDLER( exctsccr_videoram_w )
src/mame/video/nmk16.c
r1591r1592
754754   }
755755   tilemap_set_scrolly(bg_tilemap,0,gunnail_scrolly);
756756
757   video_update_macross(machine,screen,bitmap,cliprect);
757   VIDEO_UPDATE_CALL(macross);
758758   return 0;
759759}
760760
src/mame/drivers/bfcobra.c
r1591r1592
122122INLINE void z80_bank(int num, int data);
123123
124124
125static void update_irqs(void)
125static void update_irqs(running_machine *machine)
126126{
127127   int newstate = blitter_irq || vblank_irq || acia_irq;
128128
129129   if (newstate != irq_state)
130130   {
131131      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);
133133   }
134134}
135135
r1591r1592
647647         val = 0x1;
648648
649649         /* TODO */
650         update_irqs();
650         update_irqs(Machine);
651651         break;
652652      }
653653      case 0x1C:
r1591r1592
11551155      if ( changed & (1 << i) )
11561156      {
11571157         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 );
11591159      }
11601160    }
11611161}
r1591r1592
13571357static void z80_acia_irq(int state)
13581358{
13591359   acia_irq = state ? CLEAR_LINE : ASSERT_LINE;
1360   update_irqs();
1360   update_irqs(Machine);
13611361}
13621362
13631363static void m6809_data_irq(int state)
13641364{
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);
13661366}
13671367
13681368/*
r1591r1592
14831483/* TODO */
14841484static INTERRUPT_GEN( timer_irq )
14851485{
1486   cpunum_set_input_line(1, M6809_IRQ_LINE, PULSE_LINE);
1486   cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, PULSE_LINE);
14871487}
14881488
14891489/* TODO */
14901490static INTERRUPT_GEN( vblank_gen )
14911491{
14921492   vblank_irq = 1;
1493   update_irqs();
1493   update_irqs(machine);
14941494}
14951495
14961496static MACHINE_DRIVER_START( bfcobra )
r1591r1592
15241524   MDRV_SOUND_CONFIG(upd7759_interface)
15251525   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
15261526
1527   MDRV_VIDEO_START(generic_bitmapped)
15281527   MDRV_VIDEO_UPDATE(bfcobra)
15291528MACHINE_DRIVER_END
15301529
src/mame/drivers/sbugger.c
r1591r1592
226226/* machine driver */
227227
228228static MACHINE_DRIVER_START( sbugger )
229   MDRV_CPU_ADD(8085A, 6000000/2)        /* 3.00 MHz??? */
229   MDRV_CPU_ADD(8085A, 6000000)        /* 3.00 MHz??? */
230230   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
231231   MDRV_CPU_IO_MAP(readport,0)
232232   MDRV_CPU_VBLANK_INT(irq3_line_hold,NUM_INTS_FRAME)
src/mame/drivers/targeth.c
r1591r1592
4242{
4343   switch(cpu_getiloops()){
4444      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);
4646         break;
4747      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);
4949         break;
5050      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);
5252         break;
5353   }
5454}
src/mame/drivers/nycaptor.c
r1591r1592
192192
193193static WRITE8_HANDLER( sub_cpu_halt_w )
194194{
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);
196196}
197197
198198static UINT8 snd_data;
r1591r1592
240240
241241static WRITE8_HANDLER( sound_cpu_reset_w )
242242{
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);
244244}
245245
246246static int vol_ctrl[16];
r1591r1592
264264
265265static TIMER_CALLBACK( nmi_callback )
266266{
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);
268268   else pending_nmi = 1;
269269}
270270
r1591r1592
284284   sound_nmi_enable = 1;
285285   if (pending_nmi)
286286   {
287      cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE);
287      cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE);
288288      pending_nmi = 0;
289289   }
290290}
src/mame/drivers/mitchell.c
r1591r1592
483483static WRITE8_HANDLER(mstworld_sound_w)
484484{
485485   soundlatch_w(0,data);
486   cpunum_set_input_line(1,0,HOLD_LINE);
486   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
487487}
488488
489489extern WRITE8_HANDLER( mstworld_gfxctrl_w );
r1591r1592
14181418   sample_buffer >>= 4;
14191419   sample_select ^= 1;
14201420   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);
14221422}
14231423
14241424
src/mame/drivers/rainbow.c
r1591r1592
267267   if (ACCESSING_LSB)
268268   {
269269      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);
271271   }
272272}
273273
r1591r1592
598598
599599static void irqhandler(int irq)
600600{
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);
602602}
603603
604604static const struct YM2151interface ym2151_interface =
src/mame/drivers/galspnbl.c
r1591r1592
3737   if (ACCESSING_LSB)
3838   {
3939      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);
4141   }
4242}
4343
r1591r1592
286286
287287static void irqhandler(int linestate)
288288{
289   cpunum_set_input_line(1,0,linestate);
289   cpunum_set_input_line(Machine, 1,0,linestate);
290290}
291291
292292static const struct YM3812interface ym3812_interface =
src/mame/drivers/blktiger.c
r1591r1592
5353
5454static WRITE8_HANDLER( blktiger_coinlockout_w )
5555{
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   }
5861}
5962
6063
61
62static 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)
64static 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)
6773ADDRESS_MAP_END
6874
69static 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)
77ADDRESS_MAP_END
78
79static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
75static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 )
8076   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)
88ADDRESS_MAP_END
89
90static 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")
9683   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) */
9885   AM_RANGE(0x08, 0x09) AM_WRITE(blktiger_scrollx_w)
9986   AM_RANGE(0x0a, 0x0b) AM_WRITE(blktiger_scrolly_w)
10087   AM_RANGE(0x0c, 0x0c) AM_WRITE(blktiger_video_enable_w)
r1591r1592
10289   AM_RANGE(0x0e, 0x0e) AM_WRITE(blktiger_screen_layout_w)
10390ADDRESS_MAP_END
10491
105
106static 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)
92static ADDRESS_MAP_START( sound_mem_map, ADDRESS_SPACE_PROGRAM, 8 )
93   AM_RANGE(0x0000, 0x7fff) AM_ROM
94   AM_RANGE(0xc000, 0xc7ff) AM_RAM
10995   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)
114100ADDRESS_MAP_END
115101
116static 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)
123ADDRESS_MAP_END
124102
125
126
127103static INPUT_PORTS_START( blktiger )
128   PORT_START   /* IN0 */
104   PORT_START_TAG("IN0")   /* IN0 */
129105   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
130106   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
131107   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
r1591r1592
135111   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
136112   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
137113
138   PORT_START   /* IN1 */
114   PORT_START_TAG("IN1")   /* IN1 */
139115   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
140116   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
141117   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
r1591r1592
145121   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
146122   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
147123
148   PORT_START   /* IN2 */
124   PORT_START_TAG("IN2")   /* IN2 */
149125   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
150126   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
151127   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
r1591r1592
155131   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
156132   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
157133
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" )
160136   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
161137   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
162138   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
r1591r1592
165141   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
166142   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
167143   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" )
169145   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
170146   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
171147   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
r1591r1592
174150   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
175151   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
176152   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" )
178154   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
179155   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 ) )
181159
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" )
184162   PORT_DIPSETTING(    0x02, "2" )
185163   PORT_DIPSETTING(    0x03, "3" )
186164   PORT_DIPSETTING(    0x01, "5" )
187165   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" )
189167   PORT_DIPSETTING(    0x1c, "1 (Easiest)")
190168   PORT_DIPSETTING(    0x18, "2" )
191169   PORT_DIPSETTING(    0x14, "3" )
r1591r1592
194172   PORT_DIPSETTING(    0x08, "6" )
195173   PORT_DIPSETTING(    0x04, "7" )
196174   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" )
198176   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
199177   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" )
201179   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
202180   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" )
204182   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
205183   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
206184
207   PORT_START
185   PORT_START_TAG("FREEZE")
208186   PORT_DIPNAME( 0x01, 0x01, "Freeze" )   /* could be VBLANK */
209187   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
210188   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 ) )
211194INPUT_PORTS_END
212195
213196
r1591r1592
247230/* handler called by the 2203 emulator when the internal timers cause an IRQ */
248231static void irqhandler(int irq)
249232{
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);
251234}
252235
253236static const struct YM2203interface ym2203_interface =
r1591r1592
269252
270253   /* basic machine hardware */
271254   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)
274257   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
275258
276259   MDRV_CPU_ADD(Z80, 3000000)
277260   /* audio CPU */
278   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
261   MDRV_CPU_PROGRAM_MAP(sound_mem_map, 0)
279262
280263   MDRV_SCREEN_REFRESH_RATE(60)
281264   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
src/mame/drivers/dynduke.c
r1591r1592
261261
262262static INTERRUPT_GEN( dynduke_interrupt )
263263{
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
265265}
266266
267267/* Machine Driver */
src/mame/drivers/mgolf.c
r1591r1592
8181         time_released = timer_get_time();
8282
8383         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);
8785      }
8886      else
89      {
9087         time_pushed = timer_get_time();
91      }
9288
9389      prev = val;
9490   }
r1591r1592
10197
10298   update_plunger();
10399
104   cpunum_set_input_line(0, 0, PULSE_LINE);
100   cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
105101
106102   scanline = scanline + 32;
107103
src/mame/drivers/deco_mlc.c
r1591r1592
205205static TIMER_CALLBACK( interrupt_gen )
206206{
207207//  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);
209209}
210210
211211static WRITE32_HANDLER( mlc_irq_w )
r1591r1592
217217   switch (offset*4)
218218   {
219219   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);
221221      return;
222222      break;
223223   case 0x14: /* Prepare scanline interrupt */
r1591r1592
731731   /* The timing in the ARM core isn't as accurate as it should be, so bump up the
732732        effective clock rate here to compensate otherwise we have slowdowns in
733733        Skull Fung where there probably shouldn't be. */
734   cpunum_set_clockscale(0, 2.0f);
734   cpunum_set_clockscale(machine, 0, 2.0f);
735735   mainCpuIsArm=1;
736736   decrypt156();
737737   descramble_sound();
src/mame/drivers/tryout.c
r1591r1592
2929
3030static WRITE8_HANDLER( tryout_nmi_ack_w )
3131{
32   cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE );
32   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE );
3333}
3434
3535static WRITE8_HANDLER( tryout_sound_w )
3636{
3737   soundlatch_w(0,data);
38   cpunum_set_input_line( 1, 0, PULSE_LINE );
38   cpunum_set_input_line(Machine, 1, 0, PULSE_LINE );
3939}
4040
4141static WRITE8_HANDLER( tryout_sound_irq_ack_w )
4242{
43   cpunum_set_input_line( 1, 0, CLEAR_LINE );
43   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE );
4444}
4545
4646static WRITE8_HANDLER( tryout_bankswitch_w )
r1591r1592
183183static INTERRUPT_GEN( tryout_interrupt )
184184{
185185   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);
187187}
188188
189189static MACHINE_DRIVER_START( tryout )
src/mame/drivers/rungun.c
r1591r1592
162162         }
163163
164164         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);
166166      break;
167167
168168      case 0x0c/2:
r1591r1592
192192static WRITE16_HANDLER( sound_irq_w )
193193{
194194   if (ACCESSING_MSB)
195      cpunum_set_input_line(1, 0, HOLD_LINE);
195      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
196196}
197197
198198static READ16_HANDLER( sound_status_msb_r )
r1591r1592
206206static INTERRUPT_GEN(rng_interrupt)
207207{
208208   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);
210210}
211211
212212static ADDRESS_MAP_START( rngreadmem, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
265265   memory_set_bankptr(2, memory_region(REGION_CPU2) + 0x10000 + (data & 0x07) * 0x4000);
266266
267267   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);
269269}
270270
271271static INTERRUPT_GEN(audio_interrupt)
272272{
273273   if (rng_z80_control & 0x80) return;
274274
275   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
275   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
276276}
277277
278278/* sound (this should be split into audio/xexex.c or pregx.c or so someday) */
src/mame/drivers/crystal.c
r1591r1592
147147   {
148148      IntPend|=(1<<num);
149149      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);
151151   }
152152#ifdef IDLE_LOOP_SPEEDUP
153153   FlipCntRead=0;
r1591r1592
205205      IntPend&=~(1<<(data&0x1f));
206206      program_write_dword_32le(0x01800c0c,IntPend);
207207      if(!IntPend)
208         cpunum_set_input_line(0,SE3208_INT,CLEAR_LINE);
208         cpunum_set_input_line(Machine, 0,SE3208_INT,CLEAR_LINE);
209209   }
210210   if((~mem_mask)&0xff00)
211211      IntHigh=(data>>8)&7;
src/mame/drivers/tempest.c
r1591r1592
303303
304304static WRITE8_HANDLER( wdclr_w )
305305{
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);
308308}
309309
310310/*************************************
src/mame/drivers/madmotor.c
r1591r1592
4343   if (ACCESSING_LSB)
4444   {
4545      soundlatch_w(0,data & 0xff);
46      cpunum_set_input_line(1,0,HOLD_LINE);
46      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
4747   }
4848}
4949
r1591r1592
273273
274274static void sound_irq(int state)
275275{
276   cpunum_set_input_line(1,1,state); /* IRQ 2 */
276   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
277277}
278278
279279static const struct YM2151interface ym2151_interface =
src/mame/drivers/eprom.c
r1591r1592
4242 *
4343 *************************************/
4444
45static void update_interrupts(void)
45static void update_interrupts(running_machine *machine)
4646{
4747   int newstate = 0;
4848   int newstate2 = 0;
r1591r1592
5353      newstate |= 6;
5454
5555   if (newstate)
56      cpunum_set_input_line(0, newstate, ASSERT_LINE);
56      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
5757   else
58      cpunum_set_input_line(0, 7, CLEAR_LINE);
58      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
5959
6060   if (newstate2)
61      cpunum_set_input_line(1, newstate2, ASSERT_LINE);
61      cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE);
6262   else
63      cpunum_set_input_line(1, 7, CLEAR_LINE);
63      cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
6464}
6565
6666
r1591r1592
7676
7777static MACHINE_RESET( eprom )
7878{
79   machine_reset_klaxp(machine);
79   MACHINE_RESET_CALL(klaxp);
8080   state_save_register_global_pointer(sync_data, 2);
8181}
8282
r1591r1592
122122   if (ACCESSING_LSB)
123123   {
124124      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);
126126      else
127         cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
127         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
128128   }
129129}
130130
src/mame/drivers/bublbobl.c
r1591r1592
324324#if 0 // doesn't work for some reason
325325static WRITE8_HANDLER(soundcpu_reset_w)
326326{
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);
328328}
329329#endif
330330
r1591r1592
717717// handler called by the 2203 emulator when the internal timers cause an IRQ
718718static void irqhandler(int irq)
719719{
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);
721721}
722722
723723static const struct YM2203interface ym2203_interface =
r1591r1592
784784   /* audio CPU */   // 3 MHz
785785   MDRV_CPU_PROGRAM_MAP(sound_map, 0) // IRQs are triggered by the YM2203
786786
787   MDRV_CPU_ADD_TAG("mcu", M6801, 4000000/4)   // actually 6801U4  // xtal is 4MHz, divided by 4 internally
787   MDRV_CPU_ADD_TAG("mcu", M6801, 4000000)   // actually 6801U4  // xtal is 4MHz, divided by 4 internally
788788   MDRV_CPU_PROGRAM_MAP(mcu_map, 0)
789789   MDRV_CPU_VBLANK_INT(irq0_line_pulse, 1) // comes from the same clock that latches the INT pin on the second Z80
790790
r1591r1592
13331333{
13341334   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r );
13351335
1336   driver_init_tokio(machine);
1336   DRIVER_INIT_CALL(tokio);
13371337}
13381338
13391339
src/mame/drivers/skyfox.c
r1591r1592
248248   skyfox_bg_pos += (skyfox_bg_ctrl >> 1) & 0x7;   // maybe..
249249
250250   /* 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);
252252}
253253
254254static MACHINE_DRIVER_START( skyfox )
src/mame/drivers/cshooter.c
r1591r1592
198198static INTERRUPT_GEN( cshooter_interrupt )
199199{
200200   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);
204202   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);
208204
209205   if(mainram!=NULL)
210   {
211206      ar_coin_hack();
212   }
213207
214208}
215209
src/mame/drivers/aerofgt.c
r1591r1592
108108   {
109109      pending_command = 1;
110110      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);
112112   }
113113}
114114
r1591r1592
118118   {
119119      pending_command = 1;
120120      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);
122122   }
123123}
124124
r1591r1592
127127   if(data & 0x8000)
128128   {
129129      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);
131131   }
132132}
133133
r1591r1592
13771377
13781378static void irqhandler(int irq)
13791379{
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);
13811381}
13821382
13831383static const struct YM2610interface ym2610_interface =
src/mame/drivers/fgoal.c
r1591r1592
8383   int scanline;
8484   int coin = (readinputport(1) & 2);
8585
86   cpunum_set_input_line(0, 0, ASSERT_LINE);
86   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
8787
8888   if (!coin && prev_coin)
8989   {
90      cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE);
90      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
9191   }
9292
9393   prev_coin = coin;
r1591r1592
136136
137137static READ8_HANDLER( fgoal_nmi_reset_r )
138138{
139   cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
139   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
140140
141141   return 0;
142142}
r1591r1592
144144
145145static READ8_HANDLER( fgoal_irq_reset_r )
146146{
147   cpunum_set_input_line(0, 0, CLEAR_LINE);
147   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
148148
149149   return 0;
150150}
src/mame/drivers/expro02.c
r1591r1592
277277
278278static INTERRUPT_GEN( galsnew_interrupt )
279279{
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 */
281281}
282282
283283static MACHINE_RESET( galsnew )
src/mame/drivers/ultrsprt.c
r1591r1592
107107
108108static WRITE32_HANDLER(int_ack_w)
109109{
110   cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE);
110   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
111111}
112112
113113static ADDRESS_MAP_START( ultrsprt_map, ADDRESS_SPACE_PROGRAM, 32 )
r1591r1592
259259
260260static INTERRUPT_GEN( ultrsprt_vblank )
261261{
262   cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE);
262   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
263263}
264264
265265static MACHINE_RESET( ultrsprt )
r1591r1592
309309{
310310   if (irq == 0)
311311   {
312      //cpunum_set_input_line(1, INPUT_LINE_IRQ5, PULSE_LINE);
312      //cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ5, PULSE_LINE);
313313   }
314314   else
315315   {
316      cpunum_set_input_line(1, INPUT_LINE_IRQ6, PULSE_LINE);
316      cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ6, PULSE_LINE);
317317   }
318318}
319319
320320static DRIVER_INIT( ultrsprt )
321321{
322   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
322   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
323323
324324   K056800_init(sound_irq_callback);
325325}
src/mame/drivers/mainsnk.c
r1591r1592
9999   sound_fetched = 0;
100100   sound_command = data;
101101   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);
103103}
104104
105105static READ8_HANDLER( sound_command_r )
src/mame/drivers/mystston.c
r1591r1592
7373
7474static WRITE8_HANDLER( mystston_irq_reset_w )
7575{
76   cpunum_set_input_line(0, 0, CLEAR_LINE);
76   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
7777}
7878
7979
r1591r1592
236236   /* IMS is triggered every time VLOC line 3 is raised,
237237       as VLOC counter starts at 16, effectively every 16 scanlines */
238238   if ((scanline % 16) == 0)
239      cpunum_set_input_line(0, 0, ASSERT_LINE);
239      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
240240}
241241
242242
src/mame/drivers/rampart.c
r1591r1592
3838 *
3939 *************************************/
4040
41static void update_interrupts(void)
41static void update_interrupts(running_machine *machine)
4242{
4343   int newstate = 0;
4444
r1591r1592
4646      newstate = 4;
4747
4848   if (newstate)
49      cpunum_set_input_line(0, newstate, ASSERT_LINE);
49      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
5050   else
51      cpunum_set_input_line(0, 7, CLEAR_LINE);
51      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
5252}
5353
5454
src/mame/drivers/senjyo.c
r1591r1592
127127
128128static INTERRUPT_GEN( senjyo_interrupt )
129129{
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);
131131   else int_delay_kludge--;
132132}
133133
src/mame/drivers/yiear.c
r1591r1592
8282static INTERRUPT_GEN( yiear_nmi_interrupt )
8383{
8484   /* 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);
8686}
8787
8888
src/mame/drivers/murogem.c
r1591r1592
197197
198198static MACHINE_DRIVER_START( murogem )
199199   /* basic machine hardware */
200   MDRV_CPU_ADD(M6802,2000000)       /* ? MHz */
200   MDRV_CPU_ADD(M6802,8000000)       /* ? MHz */
201201   MDRV_CPU_PROGRAM_MAP(murogem_map,0)
202202   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
203203
src/mame/drivers/snowbros.c
r1591r1592
105105
106106static INTERRUPT_GEN( snowbros_interrupt )
107107{
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 */
109109}
110110
111111static INTERRUPT_GEN( snowbro3_interrupt )
112112{
113113   int status = OKIM6295_status_0_r(0);
114114
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 */
116116
117117   if (sb3_music_is_playing)
118118   {
r1591r1592
147147   if (ACCESSING_LSB)
148148   {
149149      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);
151151   }
152152}
153153
r1591r1592
289289   if (ACCESSING_LSB)
290290   {
291291      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);
293293   }
294294}
295295
r1591r1592
15161516/* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */
15171517static void irqhandler(int irq)
15181518{
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);
15201520}
15211521
15221522/* SnowBros Sound */
src/mame/drivers/bzone.c
r1591r1592
253253static INTERRUPT_GEN( bzone_interrupt )
254254{
255255   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);
257257}
258258
259259
r1591r1592
816816
817817static DRIVER_INIT( bradley )
818818{
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));
821821
822822   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1808, 0x1808, 0, 0, input_port_4_r);
823823   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1809, 0x1809, 0, 0, input_port_5_r);
src/mame/drivers/segaxbd.c
r1591r1592
110110   /* assert the lines that are live, or clear everything if nothing is live */
111111   if (irq != 0)
112112   {
113      cpunum_set_input_line(0, irq, ASSERT_LINE);
113      cpunum_set_input_line(Machine, 0, irq, ASSERT_LINE);
114114      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
115115   }
116116   else
117      cpunum_set_input_line(0, 7, CLEAR_LINE);
117      cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
118118}
119119
120120
r1591r1592
132132   if (scanline == 223)
133133   {
134134      vblank_irq_state = update = 1;
135      cpunum_set_input_line(1, 4, ASSERT_LINE);
135      cpunum_set_input_line(machine, 1, 4, ASSERT_LINE);
136136      next_scanline = scanline + 1;
137137   }
138138
r1591r1592
141141   {
142142      vblank_irq_state = 0;
143143      update = 1;
144      cpunum_set_input_line(1, 4, CLEAR_LINE);
144      cpunum_set_input_line(machine, 1, 4, CLEAR_LINE);
145145      next_scanline = scanline + 1;
146146   }
147147
r1591r1592
172172static TIMER_CALLBACK( delayed_sound_data_w )
173173{
174174   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);
176176}
177177
178178
r1591r1592
184184
185185static void sound_cpu_irq(int state)
186186{
187   cpunum_set_input_line(2, 0, state);
187   cpunum_set_input_line(Machine, 2, 0, state);
188188}
189189
190190
191191static READ8_HANDLER( sound_data_r )
192192{
193   cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE);
193   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
194194   return soundlatch_r(offset);
195195}
196196
r1591r1592
204204
205205static void xboard_reset(void)
206206{
207   cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
207   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
208208   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
209209}
210210
r1591r1592
351351            */
352352         if (((oldval ^ data) & 0x40) && !(data & 0x40)) watchdog_reset_w(0,0);
353353         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);
355355         return;
356356
357357      case 3:
src/mame/drivers/nbmj9195.c
r1591r1592
488488
489489static void ctc0_interrupt(int state)
490490{
491   cpunum_set_input_line(0, 0, state);
491   cpunum_set_input_line(Machine, 0, 0, state);
492492}
493493
494494static void ctc1_interrupt(int state)
495495{
496   cpunum_set_input_line(1, 0, state);
496   cpunum_set_input_line(Machine, 1, 0, state);
497497}
498498
499499/* CTC of main cpu, ch0 trigger is vblank */
src/mame/drivers/sonson.c
r1591r1592
6767   if (last == 0 && data == 1)
6868   {
6969      /* 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);
7171   }
7272
7373   last = data;
src/mame/drivers/sslam.c
r1591r1592
395395static WRITE16_HANDLER( powerbls_sound_w )
396396{
397397   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);
399399}
400400
401401/* Memory Maps */
src/mame/drivers/simpl156.c
r1591r1592
474474
475475static INTERRUPT_GEN( simpl156_vbl_interrupt )
476476{
477   cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE);
477   cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE);
478478}
479479
480480
r1591r1592
11621162static DRIVER_INIT (joemacr)
11631163{
11641164   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, joemacr_speedup_r );
1165   driver_init_simpl156(machine);
1165   DRIVER_INIT_CALL(simpl156);
11661166}
11671167
11681168static READ32_HANDLER( chainrec_speedup_r )
r1591r1592
11741174static DRIVER_INIT (chainrec)
11751175{
11761176   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r );
1177   driver_init_simpl156(machine);
1177   DRIVER_INIT_CALL(simpl156);
11781178   simpl156_default_eeprom = chainrec_eeprom;
11791179}
11801180
r1591r1592
11871187static DRIVER_INIT (prtytime)
11881188{
11891189   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
1190   driver_init_simpl156(machine);
1190   DRIVER_INIT_CALL(simpl156);
11911191   simpl156_default_eeprom = prtytime_eeprom;
11921192}
11931193
11941194static DRIVER_INIT (gangonta)
11951195{
11961196   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
1197   driver_init_simpl156(machine);
1197   DRIVER_INIT_CALL(simpl156);
11981198   simpl156_default_eeprom = gangonta_eeprom;
11991199}
12001200
r1591r1592
12081208static DRIVER_INIT (charlien)
12091209{
12101210   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, charlien_speedup_r );
1211   driver_init_simpl156(machine);
1211   DRIVER_INIT_CALL(simpl156);
12121212}
12131213
12141214static READ32_HANDLER( osman_speedup_r )
r1591r1592
12201220static DRIVER_INIT (osman)
12211221{
12221222   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
1223   driver_init_simpl156(machine);
1223   DRIVER_INIT_CALL(simpl156);
12241224   simpl156_default_eeprom = osman_eeprom;
12251225
12261226}
r1591r1592
12281228static DRIVER_INIT (candance)
12291229{
12301230   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
1231   driver_init_simpl156(machine);
1231   DRIVER_INIT_CALL(simpl156);
12321232   simpl156_default_eeprom = candance_eeprom;
12331233}
12341234
src/mame/drivers/lgp.c
r1591r1592
323323
324324static TIMER_CALLBACK( irq_stop )
325325{
326   cpunum_set_input_line(0, 0, CLEAR_LINE);
326   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
327327}
328328
329329static INTERRUPT_GEN( vblank_callback_lgp )
330330{
331331   // NMI
332   //cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
332   //cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
333333
334334   // IRQ
335   cpunum_set_input_line(0, 0, ASSERT_LINE);
335   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
336336   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
337337
338338   laserdisc_vsync(discinfo);
src/mame/drivers/hcastle.c
r1591r1592
3737
3838static WRITE8_HANDLER( hcastle_soundirq_w )
3939{
40   cpunum_set_input_line( 1, 0, HOLD_LINE );
40   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
4141}
4242
4343static WRITE8_HANDLER( hcastle_coin_w )
r1591r1592
5858   AM_RANGE(0x0414, 0x0414) AM_READ(input_port_4_r) /* Dip 2 */
5959   AM_RANGE(0x0415, 0x0415) AM_READ(input_port_3_r) /* Dip 1 */
6060   AM_RANGE(0x0418, 0x0418) AM_READ(hcastle_gfxbank_r)
61   AM_RANGE(0x0600, 0x06ff) AM_READ(paletteram_r)
61   AM_RANGE(0x0600, 0x06ff) AM_READ(MRA8_RAM)
6262   AM_RANGE(0x0700, 0x5fff) AM_READ(MRA8_RAM)
6363   AM_RANGE(0x6000, 0x7fff) AM_READ(MRA8_BANK1)
6464   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)
r1591r1592
243243
244244static void irqhandler(int linestate)
245245{
246//  cpunum_set_input_line(1,0,linestate);
246//  cpunum_set_input_line(Machine, 1,0,linestate);
247247}
248248
249249static void volume_callback(int v)
src/mame/drivers/deadang.c
r1591r1592
268268static INTERRUPT_GEN( deadang_interrupt )
269269{
270270   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 */
272272   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 */
274274}
275275
276276/* Machine Drivers */
src/mame/drivers/cliffhgr.c
r1591r1592
107107static VIDEO_UPDATE( cliff )
108108{
109109   /* update the TMS9928A video */
110   video_update_tms9928a( machine, screen, bitmap, cliprect );
110   VIDEO_UPDATE_CALL(tms9928a);
111111
112112   if (discinfo != NULL)
113113   {
r1591r1592
189189static READ8_HANDLER( cliff_irq_ack_r )
190190{
191191   /* deassert IRQ on the CPU */
192   cpunum_set_input_line(0, 0, CLEAR_LINE);
192   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
193193
194194   return 0x00;
195195}
r1591r1592
249249
250250   /* if we have a valid code, trigger an IRQ */
251251   if ( phillips_code & 0x800000 )
252      cpunum_set_input_line(0, 0, ASSERT_LINE);
252      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
253253
254254   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_zero);
255255}
256256
257257static void vdp_interrupt (int state)
258258{
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 );
260260}
261261
262262
src/mame/drivers/artmagic.c
r1591r1592
4848 *
4949 *************************************/
5050
51static void update_irq_state(void)
51static void update_irq_state(running_machine *machine)
5252{
5353   int irq_lines = 0;
5454
r1591r1592
5858      irq_lines |= 5;
5959
6060   if (irq_lines)
61      cpunum_set_input_line(0, irq_lines, ASSERT_LINE);
61      cpunum_set_input_line(machine, 0, irq_lines, ASSERT_LINE);
6262   else
63      cpunum_set_input_line(0, 7, CLEAR_LINE);
63      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
6464}
6565
6666
6767static void m68k_gen_int(int state)
6868{
6969   tms_irq = state;
70   update_irq_state();
70   update_irq_state(Machine);
7171}
7272
7373
r1591r1592
8181static MACHINE_RESET( artmagic )
8282{
8383   tms_irq = hack_irq = 0;
84   update_irq_state();
84   update_irq_state(machine);
8585   tlc34076_reset(6);
8686}
8787
r1591r1592
137137   if (activecpu_get_pc() == 0x18c2)
138138   {
139139      hack_irq = 1;
140      update_irq_state();
140      update_irq_state(Machine);
141141      hack_irq = 0;
142      update_irq_state();
142      update_irq_state(Machine);
143143   }
144144   return readinputport(0);
145145}
src/mame/drivers/cntsteer.c
r1591r1592
281281static WRITE8_HANDLER( gekitsui_int_w )
282282{
283283//  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);
285285}
286286static WRITE8_HANDLER( gekitsui_int2_w ) // not used..
287287{
288288//  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);
290290}
291291#endif
292292
293293static WRITE8_HANDLER( gekitsui_sub_irq_ack )
294294{
295   cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE);
295   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
296296}
297297
298298#if 0
299299static WRITE8_HANDLER( cntsteer_int_w )
300300{
301   cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE);
301   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
302302}
303303#endif
304304
r1591r1592
310310static WRITE8_HANDLER( zerotrgt_ctrl_w )
311311{
312312   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);
314314
315315   // 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);
318318}
319319
320320#if 0
r1591r1592
468468static int nmimask;
469469static WRITE8_HANDLER( nmimask_w ) { nmimask = data & 0x80; }
470470
471static INTERRUPT_GEN ( sound_interrupt ) { if (!nmimask) cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE); }
471static INTERRUPT_GEN ( sound_interrupt ) { if (!nmimask) cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); }
472472
473473static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
474474   AM_RANGE(0x0000, 0x01ff) AM_RAM
src/mame/drivers/twincobr.c
r1591r1592
203203   AM_RANGE(0x000000, 0x02ffff) AM_ROM
204204   AM_RANGE(0x030000, 0x033fff) AM_RAM      /* 68K and DSP shared RAM */
205205   AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
206   AM_RANGE(0x050000, 0x050dff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
206   AM_RANGE(0x050000, 0x050dff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
207207   AM_RANGE(0x060000, 0x060001) AM_WRITE(twincobr_crtc_reg_sel_w)   /* 6845 CRT controller */
208208   AM_RANGE(0x060002, 0x060003) AM_WRITE(twincobr_crtc_data_w)      /* 6845 CRT controller */
209209   AM_RANGE(0x070000, 0x070003) AM_WRITE(twincobr_txscroll_w)   /* text layer scroll */
r1591r1592
635635/* handler called by the 3812 emulator when the internal timers cause an IRQ */
636636static void irqhandler(int linestate)
637637{
638   cpunum_set_input_line(1,0,linestate);
638   cpunum_set_input_line(Machine, 1,0,linestate);
639639}
640640
641641static const struct YM3812interface ym3812_interface =
src/mame/drivers/hexion.c
r1591r1592
273273{
274274   /* NMI handles start and coin inputs, origin unknown */
275275   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);
277277   else
278      cpunum_set_input_line(0, 0, HOLD_LINE);
278      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
279279}
280280
281281static MACHINE_DRIVER_START( hexion )
src/mame/drivers/battlnts.c
r1591r1592
2424static INTERRUPT_GEN( battlnts_interrupt )
2525{
2626   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);
2828}
2929
3030static WRITE8_HANDLER( battlnts_sh_irqtrigger_w )
3131{
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);
3333}
3434
3535static WRITE8_HANDLER( battlnts_bankswitch_w )
r1591r1592
5252   AM_RANGE(0x0000, 0x1fff) AM_READ(K007342_r)         /* Color RAM + Video RAM */
5353   AM_RANGE(0x2000, 0x21ff) AM_READ(K007420_r)         /* Sprite RAM */
5454   AM_RANGE(0x2200, 0x23ff) AM_READ(K007342_scroll_r)   /* Scroll RAM */
55   AM_RANGE(0x2400, 0x24ff) AM_READ(paletteram_r)      /* Palette */
55   AM_RANGE(0x2400, 0x24ff) AM_READ(MRA8_RAM)         /* Palette */
5656   AM_RANGE(0x2e00, 0x2e00) AM_READ(input_port_0_r)    /* DIPSW #1 */
5757   AM_RANGE(0x2e01, 0x2e01) AM_READ(input_port_4_r)    /* 2P controls */
5858   AM_RANGE(0x2e02, 0x2e02) AM_READ(input_port_3_r)    /* 1P controls */
r1591r1592
333333static MACHINE_DRIVER_START( battlnts )
334334
335335   /* basic machine hardware */
336   MDRV_CPU_ADD(HD6309, 3000000)      /* ? */
336   MDRV_CPU_ADD(HD6309, 3000000*4)      /* ? */
337337   MDRV_CPU_PROGRAM_MAP(battlnts_readmem,battlnts_writemem)
338338   MDRV_CPU_VBLANK_INT(battlnts_interrupt,1)
339339
src/mame/drivers/dblewing.c
r1591r1592
282282   if ((offset*2)==0x104) { dblwings_104_data = data; return; } // p1 inputs select screen  OK
283283   if ((offset*2)==0x200) { dblwings_200_data = data; return; }
284284   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
286286   if ((offset*2)==0x38e) { dblwings_38e_data = data; return; }
287287   if ((offset*2)==0x406) { dblwings_406_data = data; return; } // p2 inputs select screen  OK
288288   if ((offset*2)==0x408) { dblwings_408_data = data; return; } // 3rd player 1st level?
r1591r1592
528528
529529static void sound_irq(int irq)
530530{
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);
532532//  mame_printf_debug("sound irq\n");
533533}
534534
src/mame/drivers/galpani2.c
r1591r1592
7171
7272static MACHINE_RESET( galpani2 )
7373{
74   machine_reset_kaneko16(machine);
74   MACHINE_RESET_CALL(kaneko16);
7575
7676   kaneko16_sprite_type = 1;
7777
r1591r1592
464464{
465465   switch ( cpu_getiloops() )
466466   {
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?
471471   }
472472}
473473
r1591r1592
478478{
479479   switch ( cpu_getiloops() )
480480   {
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;
484484   }
485485}
486486
src/mame/drivers/labyrunr.c
r1591r1592
2727   if (cpu_getiloops() == 0)
2828   {
2929      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);
3131   }
3232   else if (cpu_getiloops() % 2)
3333   {
3434      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);
3636   }
3737}
3838
r1591r1592
6262   AM_RANGE(0x0a01, 0x0a01) AM_READ(input_port_4_r)
6363   AM_RANGE(0x0b00, 0x0b00) AM_READ(input_port_3_r)
6464   AM_RANGE(0x0d00, 0x0d1f) AM_READ(K051733_r)         /* 051733 (protection) */
65   AM_RANGE(0x1000, 0x10ff) AM_READ(paletteram_r)
65   AM_RANGE(0x1000, 0x10ff) AM_READ(MRA8_RAM)
6666   AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM)
6767   AM_RANGE(0x2000, 0x3fff) AM_READ(MRA8_RAM)
6868   AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1)
r1591r1592
238238static MACHINE_DRIVER_START( labyrunr )
239239
240240   /* basic machine hardware */
241   MDRV_CPU_ADD(HD6309, 3000000)      /* 24MHz/8? */
241   MDRV_CPU_ADD(HD6309, 3000000*4)      /* 24MHz/8? */
242242   MDRV_CPU_PROGRAM_MAP(labyrunr_readmem,labyrunr_writemem)
243243   MDRV_CPU_VBLANK_INT(labyrunr_interrupt,8)   /* 1 IRQ + 4 NMI (generated by 007121) */
244244
src/mame/drivers/shougi.c
r1591r1592
9191#include "driver.h"
9292#include "cpu/z80/z80.h"
9393#include "sound/ay8910.h"
94#include "video/resnet.h"
9495
95//VIDEO_START( shougi )
96//{
97//  generic_vh_start();
98//}
9996
100#include "video/resnet.h"
10197/***************************************************************************
10298
10399  Convert the color PROMs into a more useable format.
r1591r1592
180176         *BITMAP_ADDR16(bitmap, 255-sy, 255-(sx*4 + x)) = color*4 + data;
181177      }
182178   }
183   /* copy the character mapped graphics */
184   //copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
179
185180   return 0;
186181}
187182
r1591r1592
232227static WRITE8_HANDLER( shougi_mcu_halt_off_w )
233228{
234229   /* 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);
236231}
237232
238233static WRITE8_HANDLER( shougi_mcu_halt_on_w )
239234{
240235   /* 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);
242237}
243238
244239
r1591r1592
249244   nmi_enabled = 0; /* disable NMIs */
250245
251246   /* 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);
254249}
255250
256251static WRITE8_HANDLER( nmi_enable_w )
r1591r1592
263258   if ( nmi_enabled == 1 )
264259   {
265260      /* 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);
268263   }
269264}
270265
r1591r1592
385380   MDRV_PALETTE_LENGTH(32)
386381
387382   MDRV_PALETTE_INIT(shougi)
388   MDRV_VIDEO_START(generic)
389383   MDRV_VIDEO_UPDATE(shougi)
390384
391385   /* sound hardware */
src/mame/drivers/hornet.c
r1591r1592
488488
489489static void voodoo_vblank_0(int param)
490490{
491   cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
491   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
492492}
493493
494494static void voodoo_vblank_1(int param)
495495{
496   cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE);
496   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
497497}
498498
499499static void hornet_exit(running_machine *machine)
r1591r1592
626626      {
627627         if (data & 0x80)   /* CG Board 1 IRQ Ack */
628628         {
629            cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE);
629            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
630630         }
631631         if (data & 0x40)   /* CG Board 0 IRQ Ack */
632632         {
633            cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE);
633            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
634634         }
635635         set_cgboard_id((data >> 4) & 0x3);
636636      }
r1591r1592
874874{
875875   if (memory_region(REGION_USER3))
876876      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);
878878
879879   if (memory_region(REGION_USER5))
880880      memory_set_bankptr(5, memory_region(REGION_USER5));
r1591r1592
924924{
925925   if (memory_region(REGION_USER3))
926926      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);
929929
930930   if (memory_region(REGION_USER5))
931931      memory_set_bankptr(5, memory_region(REGION_USER5));
r1591r1592
11501150static void sound_irq_callback(int irq)
11511151{
11521152   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);
11561154   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);
11601156}
11611157
11621158static UINT8 backup_ram[0x2000];
src/mame/drivers/thief.c
r1591r1592
5454{
5555   /* SLAM switch causes an NMI if it's pressed */
5656   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);
5858   else
59      cpunum_set_input_line(0, 0, HOLD_LINE);
59      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
6060}
6161
6262/**********************************************************/
r1591r1592
199199   AM_RANGE(0xe0c0, 0xe0c0) AM_WRITE(thief_context_bank_w)
200200ADDRESS_MAP_END
201201
202static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
202static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
203203   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)
207ADDRESS_MAP_END
208
209static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
210   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
211204   AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP) /* watchdog */
212205   AM_RANGE(0x10, 0x10) AM_WRITE(thief_video_control_w)
213206   AM_RANGE(0x30, 0x30) AM_WRITE(thief_input_select_w) // 8255
207   AM_RANGE(0x31, 0x31) AM_READ(thief_io_r) // 8255
214208   AM_RANGE(0x33, 0x33) AM_WRITE(tape_control_w)
215209   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)
217211   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)
219213   AM_RANGE(0x50, 0x50) AM_WRITE(thief_color_plane_w)
220214   AM_RANGE(0x60, 0x6f) AM_WRITE(thief_vtcsel_w)
221215   AM_RANGE(0x70, 0x7f) AM_WRITE(thief_color_map_w)
222216ADDRESS_MAP_END
223217
224218
225
226219/**********************************************************/
227220
228221static INPUT_PORTS_START( sharkatt )
r1591r1592
470463   /* basic machine hardware */
471464   MDRV_CPU_ADD(Z80, 4000000)        /* 4 MHz? */
472465   MDRV_CPU_PROGRAM_MAP(sharkatt_readmem,sharkatt_writemem)
473   MDRV_CPU_IO_MAP(readport,writeport)
466   MDRV_CPU_IO_MAP(io_map,0)
474467   MDRV_CPU_VBLANK_INT(thief_interrupt,1)
475468
476469   MDRV_SCREEN_REFRESH_RATE(60)
r1591r1592
506499   /* basic machine hardware */
507500   MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */
508501   MDRV_CPU_PROGRAM_MAP(thief_readmem,thief_writemem)
509   MDRV_CPU_IO_MAP(readport,writeport)
502   MDRV_CPU_IO_MAP(io_map,0)
510503   MDRV_CPU_VBLANK_INT(thief_interrupt,1)
511504
512505   MDRV_SCREEN_REFRESH_RATE(60)
r1591r1592
542535   /* basic machine hardware */
543536   MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */
544537   MDRV_CPU_PROGRAM_MAP(thief_readmem,thief_writemem)
545   MDRV_CPU_IO_MAP(readport,writeport)
538   MDRV_CPU_IO_MAP(io_map,0)
546539   MDRV_CPU_VBLANK_INT(thief_interrupt,1)
547540
548541   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/pipedrm.c
r1591r1592
182182   /* sound commands. It's possible the NMI isn't really hooked up on the YM2608 */
183183   /* sound board. */
184184   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);
186186}
187187
188188
r1591r1592
201201static WRITE8_HANDLER( pending_command_clear_w )
202202{
203203   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);
205205}
206206
207207
r1591r1592
527527
528528static void irqhandler(int irq)
529529{
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);
531531}
532532
533533
src/mame/drivers/ccastles.c
r1591r1592
173173   /* assert the IRQ if not already asserted */
174174   if (!irq_state)
175175   {
176      cpunum_set_input_line(0, 0, ASSERT_LINE);
176      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
177177      irq_state = 1;
178178   }
179179
r1591r1592
248248
249249static MACHINE_RESET( ccastles )
250250{
251   cpunum_set_input_line(0, 0, CLEAR_LINE);
251   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
252252   irq_state = 0;
253253}
254254
r1591r1592
264264{
265265   if (irq_state)
266266   {
267      cpunum_set_input_line(0, 0, CLEAR_LINE);
267      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
268268      irq_state = 0;
269269   }
270270}
src/mame/drivers/ddragon3.c
r1591r1592
6464
6565      case 1: /* soundlatch_w */
6666      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 );
6868      break;
6969
7070      case 2:
r1591r1592
477477
478478static void dd3_ymirq_handler(int irq)
479479{
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 );
481481}
482482
483483static const struct YM2151interface ym2151_interface =
r1591r1592
489489
490490static INTERRUPT_GEN( ddragon3_cpu_interrupt ) { /* 6:0x177e - 5:0x176a */
491491   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 */
493493   }
494494   else {
495      cpunum_set_input_line(0, 5, HOLD_LINE); /* Input Ports */
495      cpunum_set_input_line(machine, 0, 5, HOLD_LINE); /* Input Ports */
496496   }
497497}
498498
src/mame/drivers/sprint2.c
r1591r1592
109109
110110   /* interrupts and watchdog are disabled during service mode */
111111
112   watchdog_enable(!service_mode());
112   watchdog_enable(machine, !service_mode());
113113
114114   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);
118116}
119117
120118
src/mame/drivers/exterm.c
r1591r1592
199199   {
200200      /* Bit 13 = Resets the slave CPU */
201201      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);
203203
204204      /* Bits 14-15 = Coin counters */
205205      coin_counter_w(0, data & 0x8000);
r1591r1592
214214{
215215   /* data is latched independently for both sound CPUs */
216216   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);
219219}
220220
221221
r1591r1592
237237{
238238   /* bit 0 of the sound control determines if the NMI is actually delivered */
239239   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);
241241}
242242
243243
r1591r1592
264264static READ8_HANDLER( sound_master_latch_r )
265265{
266266   /* 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);
268268   return master_sound_latch;
269269}
270270
r1591r1592
272272static READ8_HANDLER( sound_slave_latch_r )
273273{
274274   /* 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);
276276   return slave_sound_latch;
277277}
278278
r1591r1592
288288static READ8_HANDLER( sound_nmi_to_slave_r )
289289{
290290   /* 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);
292292   return 0xff;
293293}
294294
src/mame/drivers/dragrace.c
r1591r1592
3030   }
3131
3232   /* watchdog is disabled during service mode */
33   watchdog_enable(readinputport(0) & 0x20);
33   watchdog_enable(machine, readinputport(0) & 0x20);
3434}
3535
3636
src/mame/drivers/discoboy.c
r1591r1592
201201static WRITE8_HANDLER( discoboy_port_03_w ) // sfx? (to sound cpu)
202202{
203203//  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);
205205   soundlatch_w(0,data);
206   cpunum_set_input_line(1,0,HOLD_LINE);
206   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
207207}
208208
209209static WRITE8_HANDLER( discoboy_port_06_w )
src/mame/drivers/mediagx.c
r1591r1592
901901
902902static void set_gate_a20(int a20)
903903{
904   cpunum_set_input_line(0, INPUT_LINE_A20, a20);
904   cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20);
905905}
906906
907907static void keyboard_interrupt(int state)
src/mame/drivers/ambush.c
r1591r1592
200200   MDRV_PALETTE_LENGTH(256)
201201
202202   MDRV_PALETTE_INIT(ambush)
203   MDRV_VIDEO_START(generic_bitmapped)
204203   MDRV_VIDEO_UPDATE(ambush)
205204
206205   /* sound hardware */
src/mame/drivers/orbit.c
r1591r1592
3030static INTERRUPT_GEN( orbit_interrupt )
3131{
3232   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);
3634}
3735
3836
src/mame/drivers/policetr.c
r1591r1592
121121
122122static TIMER_CALLBACK( irq5_gen )
123123{
124   cpunum_set_input_line(0, R3000_IRQ5, ASSERT_LINE);
124   cpunum_set_input_line(machine, 0, R3000_IRQ5, ASSERT_LINE);
125125}
126126
127127
128128static INTERRUPT_GEN( irq4_gen )
129129{
130   cpunum_set_input_line(0, R3000_IRQ4, ASSERT_LINE);
130   cpunum_set_input_line(machine, 0, R3000_IRQ4, ASSERT_LINE);
131131   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, irq5_gen);
132132}
133133
src/mame/drivers/seibuspi.c
r1591r1592
840840
841841static READ32_HANDLER( spi_int_r )
842842{
843   cpunum_set_input_line( 0, 0,CLEAR_LINE );
843   cpunum_set_input_line(Machine, 0, 0,CLEAR_LINE );
844844   return 0xffffffff;
845845}
846846
r1591r1592
912912   if( !(mem_mask & 0x000000ff) ) {
913913      if( data & 0x1 ) {
914914         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 );
916916      } else {
917         cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE );
917         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE );
918918      }
919919   }
920920}
r1591r1592
11071107static void irqhandler(int state)
11081108{
11091109   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
11131111   else
1114   {
1115      cpunum_set_input_line(1, 0, CLEAR_LINE);
1116   }
1112      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
11171113}
11181114
11191115static const struct YMF271interface ymf271_interface =
r1591r1592
17311727
17321728static INTERRUPT_GEN( spi_interrupt )
17331729{
1734   cpunum_set_input_line( 0, 0, ASSERT_LINE );
1730   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE );
17351731}
17361732
17371733static int spi_irq_callback(int irq)
r1591r1592
17491745   UINT8 *rombase = memory_region(REGION_USER1);
17501746   UINT8 flash_data = rombase[0x1ffffc];
17511747
1752   cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE );
1748   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE );
17531749   cpunum_set_irq_callback(0, spi_irq_callback);
17541750
17551751   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sound_fifo_r);
src/mame/drivers/coolpool.c
r1591r1592
220220   coin_counter_w(0, ~data & 0x0001);
221221   coin_counter_w(1, ~data & 0x0002);
222222
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);
224224
225225   /* bits 10-15 are counted down over time */
226226   if (data & 0x0400) amerdart_iop_echo = 1;
r1591r1592
233233   iop_answer = iop_cmd;
234234   if (amerdart_iop_echo && iop_cmd != 0x19)
235235   {
236      cpunum_set_input_line(0, 1, ASSERT_LINE);
236      cpunum_set_input_line(machine, 0, 1, ASSERT_LINE);
237237      return;
238238   }
239239   amerdart_iop_echo = 0;
r1591r1592
271271         break;
272272   }
273273
274   cpunum_set_input_line(0, 1, ASSERT_LINE);
274   cpunum_set_input_line(machine, 0, 1, ASSERT_LINE);
275275}
276276
277277
r1591r1592
297297   coin_counter_w(0, ~data & 0x0001);
298298   coin_counter_w(1, ~data & 0x0002);
299299
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);
301301}
302302
303303
r1591r1592
313313{
314314   iop_cmd = param;
315315   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! */
317317                              /* the DSP polls the status bit so it isn't strictly */
318318                              /* necessary to also have an IRQ */
319319   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50));
r1591r1592
330330static READ16_HANDLER( coolpool_iop_r )
331331{
332332   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);
334334
335335   return iop_answer;
336336}
r1591r1592
356356{
357357   logerror("%08x:IOP answer %04x\n",activecpu_get_pc(),data);
358358   iop_answer = data;
359   cpunum_set_input_line(0, 1, ASSERT_LINE);
359   cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE);
360360}
361361
362362
src/mame/drivers/sauro.c
r1591r1592
136136
137137static void lrq_callback(int state)
138138{
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);
141141}
142142
143143static ADDRESS_MAP_START( sauro_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r1591r1592
356356
357357static INTERRUPT_GEN( sauro_interrupt )
358358{
359   cpunum_set_input_line(1, 0, HOLD_LINE);
359   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
360360}
361361
362362static MACHINE_DRIVER_START( tecfri )
r1591r1592
453453
454454   ROM_REGION( 0x10000, REGION_SOUND1, 0 )
455455   /* SP0256 mask rom */
456   ROM_LOAD( "sp0256int.bin",   0x1000, 0x0800, BAD_DUMP CRC(df8de0b0) SHA1(86fb6d9fef955ac0bc76e0c45c66585946d278a1) )
456   ROM_LOAD( "sp0256-al2.bin",   0x1000, 0x0800, CRC(df8de0b0) SHA1(86fb6d9fef955ac0bc76e0c45c66585946d278a1) )
457457ROM_END
458458
459459ROM_START( trckydoc )
src/mame/drivers/gaplus.c
r1591r1592
274274   int bit = !BIT(offset,11);
275275   cpu_interrupt_enable(0,bit);
276276   if (!bit)
277      cpunum_set_input_line(0, 0, CLEAR_LINE);
277      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
278278}
279279
280280static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
r1591r1592
282282   int bit = !BIT(offset,13);
283283   cpu_interrupt_enable(2,bit);
284284   if (!bit)
285      cpunum_set_input_line(2, 0, CLEAR_LINE);
285      cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
286286}
287287
288288static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
r1591r1592
290290   int bit = offset & 1;
291291   cpu_interrupt_enable(1,bit);
292292   if (!bit)
293      cpunum_set_input_line(1, 0, CLEAR_LINE);
293      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
294294}
295295
296296static WRITE8_HANDLER( gaplus_sreset_w )
297297{
298298   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);
301301   mappy_sound_enable(bit);
302302}
303303
r1591r1592
313313{
314314   /* on reset, VINTON is reset, while the other flags don't seem to be affected */
315315   cpu_interrupt_enable(1,0);
316   cpunum_set_input_line(1, 0, CLEAR_LINE);
316   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
317317}
318318
319319static INTERRUPT_GEN( gaplus_interrupt_1 )
320320{
321321   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);
323323
324324   namcoio_set_irq_line(0,PULSE_LINE);
325325   namcoio_set_irq_line(1,PULSE_LINE);
src/mame/drivers/drmicro.c
r1591r1592
3333static INTERRUPT_GEN( drmicro_interrupt )
3434{
3535   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);
3737}
3838
3939static WRITE8_HANDLER( nmi_enable_w )
src/mame/drivers/twins.c
r1591r1592
253253
254254static MACHINE_DRIVER_START( twinsa )
255255   /* basic machine hardware */
256   MDRV_CPU_ADD(V30, 8000000)
256   MDRV_CPU_ADD(V30, XTAL_16MHz/2) /* verified on pcb */
257257   MDRV_CPU_PROGRAM_MAP(twins_map, 0)
258258   MDRV_CPU_IO_MAP(twinsa_io,0)
259259   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
r1591r1592
274274   /* sound hardware */
275275   MDRV_SPEAKER_STANDARD_MONO("mono")
276276
277   MDRV_SOUND_ADD(AY8910, 2000000)
277   MDRV_SOUND_ADD(AY8910, XTAL_16MHz/8) /* verified on pcb */
278278   MDRV_SOUND_CONFIG(ay8910_interface)
279279   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
280280MACHINE_DRIVER_END
src/mame/drivers/system1.c
r1591r1592
3333
3434static MACHINE_RESET( system1_banked )
3535{
36   machine_reset_system1(machine);
36   MACHINE_RESET_CALL(system1);
3737   memory_configure_bank(1, 0, 4, memory_region(REGION_CPU1) + 0x10000, 0x4000);
3838}
3939
r1591r1592
111111static WRITE8_HANDLER( system1_soundport_w )
112112{
113113   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);
115115   /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */
116116   cpu_spinuntil_time(ATTOTIME_IN_USEC(50));
117117}
src/mame/drivers/cultures.c
r1591r1592
350350static INTERRUPT_GEN( cultures_interrupt )
351351{
352352   if (irq_enable)
353      cpunum_set_input_line(0, 0, HOLD_LINE);
353      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
354354}
355355
356356
src/mame/drivers/powerins.c
r1591r1592
333333
334334static void irqhandler(int irq)
335335{
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);
337337}
338338
339339static const struct YM2203interface ym2203_interface =
src/mame/drivers/niyanpai.c
r1591r1592
186186
187187static void ctc0_interrupt(int state)
188188{
189   cpunum_set_input_line(1, 0, state);
189   cpunum_set_input_line(Machine, 1, 0, state);
190190}
191191
192192static z80ctc_interface ctc_intf =
r1591r1592
836836
837837static INTERRUPT_GEN( niyanpai_interrupt )
838838{
839   cpunum_set_input_line(0, 1, HOLD_LINE);
839   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
840840}
841841
842842static const struct z80_irq_daisy_chain daisy_chain_sound[] =
src/mame/drivers/exedexes.c
r1591r1592
3333static INTERRUPT_GEN( exedexes_interrupt )
3434{
3535   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 */
3737   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 */
3939}
4040
4141
src/mame/drivers/jedi.c
r1591r1592
143143   int scanline = param;
144144
145145   /* 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);
148148
149149   /* set up for the next */
150150   scanline += 32;
r1591r1592
156156
157157static WRITE8_HANDLER( main_irq_ack_w )
158158{
159   cpunum_set_input_line(0, M6502_IRQ_LINE, CLEAR_LINE);
159   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, CLEAR_LINE);
160160}
161161
162162
163163static WRITE8_HANDLER( sound_irq_ack_w )
164164{
165   cpunum_set_input_line(1, M6502_IRQ_LINE, CLEAR_LINE);
165   cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, CLEAR_LINE);
166166}
167167
168168
r1591r1592
223223
224224static WRITE8_HANDLER( sound_reset_w )
225225{
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);
227227}
228228
229229
src/mame/drivers/bfm_sc2.c
r1591r1592
261261*/
262262///////////////////////////////////////////////////////////////////////////
263263
264static void send_to_adder(int data)
264static void send_to_adder(running_machine *machine, int data)
265265{
266266   adder2_data_from_sc2 = 1;
267267   adder2_sc2data       = data;
268268
269269   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 );
271271
272272   LOG_SERIAL(("sadder  %02X  (%c)\n",data, data ));
273273}
r1591r1592
518518      irq_timer_stat = 0x01;
519519      irq_status     = 0x02;
520520
521      cpunum_set_input_line(0, M6809_IRQ_LINE, PULSE_LINE );
521      cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, PULSE_LINE );
522522   }
523523}
524524
r1591r1592
680680      }
681681   }
682682
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 );
684684}
685685
686686///////////////////////////////////////////////////////////////////////////
r1591r1592
763763
764764   if ( old != volume_override )
765765   {
766      float percent = volume_override?1.0:(32-global_volume)/32.0;
766      float percent = volume_override? 1.0f : (32-global_volume)/32.0f;
767767
768768      sndti_set_output_gain(SOUND_YM2413,  0, 0, percent);
769769      sndti_set_output_gain(SOUND_YM2413,  0, 1, percent);
r1591r1592
875875         }
876876
877877         {
878            float percent = volume_override?1.0:(32-global_volume)/32.0;
878            float percent = volume_override ? 1.0f : (32-global_volume)/32.0f;
879879
880880            sndti_set_output_gain(SOUND_YM2413,  0, 0, percent);
881881            sndti_set_output_gain(SOUND_YM2413,  0, 1, percent);
r1591r1592
11411141
11421142static WRITE8_HANDLER( vid_uart_tx_w )
11431143{
1144   send_to_adder(data);
1144   send_to_adder(Machine, data);
11451145}
11461146
11471147///////////////////////////////////////////////////////////////////////////
r1591r1592
15541554static MACHINE_RESET( init )
15551555{
15561556   // reset adder2
1557   machine_reset_adder2(machine);
1557   MACHINE_RESET_CALL(adder2);
15581558
15591559   // reset the board //////////////////////////////////////////////////////
15601560
r1591r1592
15711571      output_set_value("door",( Scorpion2_GetSwitchState(sc2_door_state>>4, sc2_door_state & 0x0F) ) );
15721572   }
15731573
1574   return video_update_adder2(machine,screen,bitmap,cliprect);
1574   return VIDEO_UPDATE_CALL(adder2);
15751575}
15761576
15771577// memory map for scorpion2 board video addon /////////////////////////////
src/mame/drivers/suprnova.c
r1591r1592
449449
450450static TIMER_CALLBACK( interrupt_callback )
451451{
452   cpunum_set_input_line(0,param,HOLD_LINE);
452   cpunum_set_input_line(machine, 0,param,HOLD_LINE);
453453}
454454
455455static MACHINE_RESET(skns)
r1591r1592
474474         interrupt = 1; // SPC
475475         break;
476476   }
477   cpunum_set_input_line(0,interrupt,HOLD_LINE);
477   cpunum_set_input_line(machine, 0,interrupt,HOLD_LINE);
478478}
479479
480480/**********************************************************************************
r1591r1592
740740      if(((mem_mask & 0x0000ff00) == 0))
741741      { /* Interrupt Clear, do we need these? */
742742/*          if(data&0x01)
743                cpunum_set_input_line(0,1,CLEAR_LINE);
743                cpunum_set_input_line(Machine, 0,1,CLEAR_LINE);
744744            if(data&0x02)
745                cpunum_set_input_line(0,3,CLEAR_LINE);
745                cpunum_set_input_line(Machine, 0,3,CLEAR_LINE);
746746            if(data&0x04)
747                cpunum_set_input_line(0,5,CLEAR_LINE);
747                cpunum_set_input_line(Machine, 0,5,CLEAR_LINE);
748748            if(data&0x08)
749                cpunum_set_input_line(0,7,CLEAR_LINE);
749                cpunum_set_input_line(Machine, 0,7,CLEAR_LINE);
750750            if(data&0x10)
751                cpunum_set_input_line(0,9,CLEAR_LINE);
751                cpunum_set_input_line(Machine, 0,9,CLEAR_LINE);
752752            if(data&0x20)
753                cpunum_set_input_line(0,0xb,CLEAR_LINE);
753                cpunum_set_input_line(Machine, 0,0xb,CLEAR_LINE);
754754            if(data&0x40)
755                cpunum_set_input_line(0,0xd,CLEAR_LINE);
755                cpunum_set_input_line(Machine, 0,0xd,CLEAR_LINE);
756756            if(data&0x80)
757                cpunum_set_input_line(0,0xf,CLEAR_LINE);*/
757                cpunum_set_input_line(Machine, 0,0xf,CLEAR_LINE);*/
758758
759759         /* 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 */
760760         if (activecpu_get_pc()==0x04013B44)
src/mame/drivers/seta2.c
r1591r1592
716716
717717static INPUT_PORTS_START( gundamex )
718718   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")
720720   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
721721   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")
723723   PORT_DIPSETTING(      0x0004, DEF_STR( Easy ) )
724724   PORT_DIPSETTING(      0x0006, DEF_STR( Normal ) )
725725   PORT_DIPSETTING(      0x0002, DEF_STR( Hard ) )
726726   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")
731729   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
732730   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" */
734732   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
735733   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" */
737735   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
738736   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 )
741739
742740   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")
744742   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
745743   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
746744   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
r1591r1592
749747   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
750748   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_4C ) )
751749   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")
753751   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
754752   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_3C ) )
755753   PORT_DIPSETTING(      0x0000, "3 Coins/5 Credits" )
r1591r1592
758756   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
759757   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_4C ) )
760758   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")
762760   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
763761   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")
765763   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
766764   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
767   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
765   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
768766
769767   PORT_START_TAG("IN2")   // $700000.w
770768   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
r1591r1592
789787   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
790788
791789   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
797795   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Language ) )        //jumper pad
798796   PORT_DIPSETTING(      0x0020, DEF_STR( English ) )
799797   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 )
803801
804802   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 )
814812
815813   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 )
825823INPUT_PORTS_END
826824
827825/***************************************************************************
r1591r1592
830828
831829static INPUT_PORTS_START( grdians )
832830   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")
834832   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    )   // 0
835833   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  )   // 1
836834   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    )   // 2
837835   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")
839837   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
840838   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
841   PORT_DIPNAME( 0x0008, 0x0008, "Title" )
839   PORT_DIPNAME( 0x0008, 0x0008, "Title" ) PORT_DIPLOCATION("SW1:4")
842840   PORT_DIPSETTING(      0x0008, "Guardians" )
843841   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")
845843   PORT_DIPSETTING(      0x0020, "1" )
846844   PORT_DIPSETTING(      0x0030, "2" )
847845   PORT_DIPSETTING(      0x0010, "3" )
848846   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")
851849   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
852850   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )
853   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
851   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
854852
855853   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")
857855   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
858856   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
859857   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
r1591r1592
870868   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
871869   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_7C ) )
872870   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")
874872   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_1C ) )
875873   PORT_DIPSETTING(      0x0050, DEF_STR( 3C_1C ) )
876874   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
r1591r1592
887885   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C ) )
888886   PORT_DIPSETTING(      0x0090, DEF_STR( 1C_7C ) )
889887   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
888   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
890889
891   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
892
893890   PORT_START_TAG("IN2")   // $700000.w
894891   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
895892   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
r1591r1592
899896   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
900897   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
901898   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START1 )
902
903899   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
904900
905901   PORT_START_TAG("IN3")   // $700002.w
r1591r1592
911907   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
912908   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
913909   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2 )
914
915910   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
916911
917912   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 )
927921   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
928922INPUT_PORTS_END
929923
r1591r1592
934928
935929static INPUT_PORTS_START( mj4simai )
936930   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")
938932   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
939933   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
940934   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
r1591r1592
943937   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
944938   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
945939   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")
947941   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
948942   PORT_DIPSETTING(      0x0008, DEF_STR( On ) )
949   PORT_DIPNAME( 0x0010, 0x0010, "Tumo Pin" )
943   PORT_DIPNAME( 0x0010, 0x0010, "Tumo Pin" ) PORT_DIPLOCATION("SW1:5")
950944   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
951945   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")
953947   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
954948   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")
956950   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
957951   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 )
959954
960   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
961
962955   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")
964957   PORT_DIPSETTING(      0x0004, "0" )
965958   PORT_DIPSETTING(      0x0003, "1" )
966959   PORT_DIPSETTING(      0x0002, "2" )
r1591r1592
969962   PORT_DIPSETTING(      0x0007, "5" )
970963   PORT_DIPSETTING(      0x0006, "6" )
971964   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")
973966   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
974967   PORT_DIPSETTING(      0x0008, DEF_STR( Yes ) )
975   PORT_DIPNAME( 0x0010, 0x0000, "Select Girl" )
968   PORT_DIPNAME( 0x0010, 0x0000, "Select Girl" ) PORT_DIPLOCATION("SW2:5")
976969   PORT_DIPSETTING(      0x0010, DEF_STR( No ) )
977970   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
978   PORT_DIPNAME( 0x0020, 0x0000, "Com Put" )
971   PORT_DIPNAME( 0x0020, 0x0000, "Com Put" ) PORT_DIPLOCATION("SW2:6")
979972   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
980973   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
981   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-6" )
974   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7")
982975   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
983976   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
984   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 2-7" )
977   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8")
985978   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
986979   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
980   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
987981
988   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
989
990982   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 )
999992
1000   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1001
1002993   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 )
10101001
10111002   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)
10191010
10201011   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 )
10261017   PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
10271018
10281019   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 )
10331024   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
10341025
10351026   PORT_START_TAG("IN7")   // $600000(4)
r1591r1592
10391030   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
10401031   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
10411032   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 )
10451035INPUT_PORTS_END
10461036
10471037
r1591r1592
10511041
10521042static INPUT_PORTS_START( myangel )
10531043   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")
10621048   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
10631049   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")
10651051   PORT_DIPSETTING(      0x0020, "2" )
10661052   PORT_DIPSETTING(      0x0030, "3" )
10671053   PORT_DIPSETTING(      0x0010, "4" )
10681054   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")
10701056   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
10711057   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")
10731059   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
10741060   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1061   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
10751062
1076   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1077
10781063   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")
10801065   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
10811066   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
10821067   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
r1591r1592
10931078   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
10941079   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_7C ) )
10951080   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")
11061085   PORT_DIPSETTING(      0x0080, DEF_STR( No ) )
11071086   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
1087   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
11081088
1109   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1110
11111089   PORT_START_TAG("IN2") //$700000.w
11121090   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
11131091   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1591r1592
11171095   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
11181096   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
11191097   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START1  )
1120
11211098   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
11221099
11231100   PORT_START_TAG("IN3") //$700002.w
r1591r1592
11291106   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
11301107   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
11311108   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2  )
1132
11331109   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
11341110
11351111   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 )
11391115   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 )
11451120   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
11461121INPUT_PORTS_END
11471122
r1591r1592
11521127
11531128static INPUT_PORTS_START( myangel2 )
11541129   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")
11631134   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
11641135   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")
11661137   PORT_DIPSETTING(      0x0020, "2" )
11671138   PORT_DIPSETTING(      0x0030, "3" )
11681139   PORT_DIPSETTING(      0x0010, "4" )
11691140   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")
11711142   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
11721143   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")
11741145   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
11751146   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
11761147
11771148   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
11781149
11791150   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")
11811152   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
11821153   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
11831154   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
r1591r1592
11941165   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
11951166   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_7C ) )
11961167   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 )
12091173
1210   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1211
12121174   PORT_START_TAG("IN2") //$600000.w
12131175   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
12141176   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1591r1592
12181180   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
12191181   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
12201182   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START1  )
1221
12221183   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
12231184
12241185   PORT_START_TAG("IN3") //$600002.w
r1591r1592
12301191   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
12311192   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
12321193   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2  )
1233
12341194   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
12351195
12361196   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 )
12401200   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 )
12461205   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
12471206INPUT_PORTS_END
12481207
r1591r1592
12531212
12541213static INPUT_PORTS_START( pzlbowl )
12551214   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")
12581217   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
12591218   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")
12611220   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
12621221   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")
12641223   PORT_DIPSETTING(      0x0030, DEF_STR( Easiest ) )
12651224   PORT_DIPSETTING(      0x0028, DEF_STR( Easier ) )
12661225   PORT_DIPSETTING(      0x0020, DEF_STR( Easy ) )
r1591r1592
12691228   PORT_DIPSETTING(      0x0010, DEF_STR( Harder ) )
12701229   PORT_DIPSETTING(      0x0008, DEF_STR( Very_Hard ) )
12711230   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")
12731232   PORT_DIPSETTING(      0x0040, "1" )
12741233   PORT_DIPSETTING(      0x00c0, "2" )      /* This setting is not defined in the manual */
12751234   PORT_DIPSETTING(      0x0080, "3" )
12761235   PORT_DIPSETTING(      0x0000, "5" )
1236   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
12771237
1278   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1279
12801238   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")
12821240   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
12831241   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
12841242   PORT_DIPSETTING(      0x0004, DEF_STR( 3C_2C ) )
r1591r1592
12951253   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
12961254   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_7C ) )
12971255   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")
12991257   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
13001258   PORT_DIPSETTING(      0x0010, DEF_STR( Yes ) )
1301   PORT_DIPNAME( 0x0020, 0x0020, "Join In" )
1259   PORT_DIPNAME( 0x0020, 0x0020, "Join In" ) PORT_DIPLOCATION("SW2:6")
13021260   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
13031261   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")
13081264   PORT_DIPSETTING(      0x0000, DEF_STR( English ) )
13091265   PORT_DIPSETTING(      0x0080, DEF_STR( Japanese ) )
1266   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
13101267
1311   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1312
13131268   PORT_START_TAG("IN2") //$500000.w
13141269   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
13151270   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
r1591r1592
13191274   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
13201275   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
13211276   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START1 )
1322
13231277   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
13241278
13251279   PORT_START_TAG("IN3") //$500002.w
r1591r1592
13311285   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
13321286   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
13331287   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2 )
1334
13351288   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
13361289
13371290   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?
13471299   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
13481300INPUT_PORTS_END
13491301
r1591r1592
13541306
13551307static INPUT_PORTS_START( penbros )
13561308   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")
13591311   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
13601312   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")
13651315   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
13661316   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")
13681318   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
13691319   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
13701320   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
13711321   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")
13731323   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ) )
13741324   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
13751325   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )
13761326   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_2C ) )
1327   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
13771328
1378   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1379
13801329   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")
13821331   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
13831332   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
13841333   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
13851334   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")
13871336   PORT_DIPSETTING(      0x0000, "2" )
13881337   PORT_DIPSETTING(      0x000c, "3" )
13891338   PORT_DIPSETTING(      0x0004, "4" )
13901339   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")
13921341   PORT_DIPSETTING(      0x0010, "150k and 500k" )
13931342   PORT_DIPSETTING(      0x0030, "200k and 700k" )
13941343   PORT_DIPSETTING(      0x0000, "Every 250k" )   // no extra life after the one at 1500k
13951344   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")
13971346   PORT_DIPSETTING(      0x00c0, "2" )
13981347   PORT_DIPSETTING(      0x0040, "3" )
13991348   PORT_DIPSETTING(      0x0080, "4" )
14001349   PORT_DIPSETTING(      0x0000, "5" )
1350   PORT_BIT(             0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
14011351
1402   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1403
14041352   PORT_START_TAG("IN2") //$600000.w
14051353   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
14061354   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
r1591r1592
14081356   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
14091357   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
14101358   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1411   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   // unsure if used
1359   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Player 1 button 3 is unused */
14121360   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START1 )
1413
14141361   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
14151362
14161363   PORT_START_TAG("IN3") //$600002.w
r1591r1592
14201367   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
14211368   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
14221369   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1423   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   // unsure if used
1370   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Player 2 button 3 is unused */
14241371   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2 )
1425
14261372   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
14271373
14281374   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 )
14381383   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
14391384INPUT_PORTS_END
14401385
src/mame/drivers/witch.c
r1591r1592
365365   break;
366366
367367   case 0x08: //A008
368          cpunum_set_input_line(cpu_getactivecpu(),0,CLEAR_LINE);
368          cpunum_set_input_line(Machine, cpu_getactivecpu(),0,CLEAR_LINE);
369369       break;
370370  }
371371}
r1591r1592
442442   AM_RANGE(0xc800, 0xcbff) AM_READWRITE(gfx1_vram_r, gfx1_vram_w) AM_BASE(&gfx1_vram)
443443   AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(gfx1_cram_r, gfx1_cram_w) AM_BASE(&gfx1_cram)
444444   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)
447447   AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE(1)
448448   AM_RANGE(0xf100, 0xf17f) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
449449   AM_RANGE(0xf180, 0xffff) AM_RAM AM_SHARE(2)
r1591r1592
757757
758758static INTERRUPT_GEN( witch_main_interrupt )
759759{
760   cpunum_set_input_line(0,0,ASSERT_LINE);
760   cpunum_set_input_line(machine, 0,0,ASSERT_LINE);
761761}
762762
763763static INTERRUPT_GEN( witch_sub_interrupt )
764764{
765   cpunum_set_input_line(1,0,ASSERT_LINE);
765   cpunum_set_input_line(machine, 1,0,ASSERT_LINE);
766766}
767767
768768static MACHINE_DRIVER_START( witch )
src/mame/drivers/flkatck.c
r1591r1592
3535static INTERRUPT_GEN( flkatck_interrupt )
3636{
3737   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);
3939}
4040
4141static WRITE8_HANDLER( flkatck_bankswitch_w )
r1591r1592
8383         soundlatch_w(0, data);
8484         break;
8585      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);
8787         break;
8888      case 0x07:   /* watchdog reset */
8989         watchdog_reset_w(0, data);
r1591r1592
270270static MACHINE_DRIVER_START( flkatck )
271271
272272   /* basic machine hardware */
273   MDRV_CPU_ADD(HD6309,3000000) /* HD63C09EP, 24/8 MHz */
273   MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP, 24/8 MHz */
274274   MDRV_CPU_PROGRAM_MAP(flkatck_readmem,flkatck_writemem)
275275   MDRV_CPU_VBLANK_INT(flkatck_interrupt,1)
276276
src/mame/drivers/namcofl.c
r1591r1592
313313
314314static TIMER_CALLBACK( network_interrupt_callback )
315315{
316   cpunum_set_input_line(0, I960_IRQ0, ASSERT_LINE);
316   cpunum_set_input_line(machine, 0, I960_IRQ0, ASSERT_LINE);
317317   timer_set(video_screen_get_frame_period(0), NULL, 0, network_interrupt_callback);
318318}
319319
320320
321321static TIMER_CALLBACK( vblank_interrupt_callback )
322322{
323   cpunum_set_input_line(0, I960_IRQ2, ASSERT_LINE);
323   cpunum_set_input_line(machine, 0, I960_IRQ2, ASSERT_LINE);
324324   timer_set(video_screen_get_frame_period(0), NULL, 0, vblank_interrupt_callback);
325325}
326326
r1591r1592
328328static TIMER_CALLBACK( raster_interrupt_callback )
329329{
330330   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);
332332   timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero);
333333}
334334
src/mame/drivers/dynax.c
r1591r1592
103103   int irq   =   ((dynax_sound_irq)   ? 0x08 : 0) |
104104            ((dynax_vblank_irq)  ? 0x10 : 0) |
105105            ((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 */
107107}
108108
109109static WRITE8_HANDLER( dynax_vblank_ack_w )
r1591r1592
143143   int irq   =   ((dynax_blitter_irq)   ? 0x08 : 0) |
144144            ((dynax_blitter2_irq)   ? 0x10 : 0) |
145145            ((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 */
147147}
148148
149149static WRITE8_HANDLER( jantouki_vblank_ack_w )
r1591r1592
183183   int irq   =   ((dynax_sound_irq)         ? 0x08 : 0) |
184184            ((dynax_soundlatch_irq)      ? 0x10 : 0) |
185185            ((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 */
187187}
188188
189189static INTERRUPT_GEN( jantouki_sound_vblank_interrupt )
r1591r1592
404404   if (toggle)
405405   {
406406      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);
408408   }
409409}
410410static void adpcm_int_cpu1(int data)
r1591r1592
418418   if (toggle)
419419   {
420420      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
422422   }
423423}
424424
r1591r1592
39453945void mjelctrn_update_irq(void)
39463946{
39473947   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);
39493949}
39503950
39513951static INTERRUPT_GEN( mjelctrn_vblank_interrupt )
r1591r1592
39533953   // This is a kludge to avoid losing blitter interrupts
39543954   // there should be a vblank ack mechanism
39553955   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);
39573957}
39583958
39593959static MACHINE_DRIVER_START( mjelctrn )
r1591r1592
39793979void neruton_update_irq(void)
39803980{
39813981   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);
39833983}
39843984
39853985static INTERRUPT_GEN( neruton_vblank_interrupt )
r1591r1592
39903990
39913991   switch(cpu_getiloops())
39923992   {
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);
39953995   }
39963996}
39973997
r1591r1592
40174017   // there should be a vblank ack mechanism
40184018   if (dynax_blitter_irq)   return;
40194019
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);
40214021}
40224022
40234023static MACHINE_DRIVER_START( majxtal7 )
r1591r1592
40854085{
40864086   switch(cpu_getiloops())
40874087   {
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;
40914091   }
40924092}
40934093
r1591r1592
51255125      }
51265126      free(rom1);
51275127
5128   driver_init_mjelct3(machine);
5128   DRIVER_INIT_CALL(mjelct3);
51295129}
51305130
51315131
src/mame/drivers/shootout.c
r1591r1592
6161static WRITE8_HANDLER( sound_cpu_command_w )
6262{
6363   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 );
6565}
6666
6767static WRITE8_HANDLER( shootout_flipscreen_w )
r1591r1592
264264
265265static void shootout_snd_irq(int linestate)
266266{
267   cpunum_set_input_line(1,0,linestate);
267   cpunum_set_input_line(Machine, 1,0,linestate);
268268}
269269
270270static void shootout_snd2_irq(int linestate)
271271{
272   cpunum_set_input_line(0,0,linestate);
272   cpunum_set_input_line(Machine, 0,0,linestate);
273273}
274274
275275static const struct YM2203interface ym2203_interface =
src/mame/drivers/contra.c
r1591r1592
4949
5050static WRITE8_HANDLER( contra_sh_irqtrigger_w )
5151{
52   cpunum_set_input_line(1,M6809_IRQ_LINE,HOLD_LINE);
52   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE);
5353}
5454
5555static WRITE8_HANDLER( contra_coin_counter_w )
src/mame/drivers/zn.c
r1591r1592
422422   psx_machine_init();
423423}
424424
425static 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)
452MACHINE_DRIVER_END
453
454static MACHINE_DRIVER_START( zn1_2mb_vram )
455   MDRV_IMPORT_FROM( zn1_1mb_vram )
456
457   MDRV_SCREEN_SIZE( 1024, 1024 )
458MACHINE_DRIVER_END
459
460static MACHINE_DRIVER_START( zn2 )
461   MDRV_IMPORT_FROM( zn1_2mb_vram )
462MACHINE_DRIVER_END
463
425464/*
426465Capcom ZN1 generic PCB Layout
427466----------------------------
r1591r1592
554593
555594static INTERRUPT_GEN( qsound_interrupt )
556595{
557   cpunum_set_input_line(1, 0, HOLD_LINE);
596   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
558597}
559598
560599static WRITE32_HANDLER( zn_qsound_w )
561600{
562601   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);
564603}
565604
566605static DRIVER_INIT( coh1000c )
r1591r1592
620659};
621660
622661static 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 )
627663
628664   MDRV_CPU_ADD( Z80, 8000000 )
629665   /* audio CPU */  /* 8MHz ?? */
r1591r1592
631667   MDRV_CPU_IO_MAP( qsound_readport, 0 )
632668   MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */
633669
634   MDRV_SCREEN_REFRESH_RATE( 60 )
635   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
636
637670   MDRV_MACHINE_RESET( coh1000c )
638671   MDRV_NVRAM_HANDLER( at28c16_0 )
639672
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
659673   MDRV_SOUND_ADD( QSOUND, QSOUND_CLOCK )
660674   MDRV_SOUND_CONFIG( qsound_interface )
661675   MDRV_SOUND_ROUTE(0, "left", 1.0)
r1591r1592
663677MACHINE_DRIVER_END
664678
665679static 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 )
670681
671682   MDRV_CPU_ADD( Z80, 8000000 )
672683   /* audio CPU */  /* 8MHz ?? */
r1591r1592
674685   MDRV_CPU_IO_MAP( qsound_readport, 0 )
675686   MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */
676687
677   MDRV_SCREEN_REFRESH_RATE( 60 )
678   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
679
680688   MDRV_MACHINE_RESET( coh1000c )
681689   MDRV_NVRAM_HANDLER( at28c16_0 )
682690
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
702691   MDRV_SOUND_ADD( QSOUND, QSOUND_CLOCK )
703692   MDRV_SOUND_CONFIG( qsound_interface )
704693   MDRV_SOUND_ROUTE(0, "left", 1.0)
r1591r1592
872861}
873862
874863static 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 )
879865
880   MDRV_CPU_ADD( Z80, 8000000 )
881866   /* audio CPU */  /* 8MHz ?? */
867   MDRV_CPU_ADD( Z80, 8000000 )
882868   MDRV_CPU_PROGRAM_MAP( qsound_readmem, qsound_writemem )
883869   MDRV_CPU_IO_MAP( qsound_readport, 0 )
884870   MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */
885871
886   MDRV_SCREEN_REFRESH_RATE( 60 )
887   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
888
889872   MDRV_MACHINE_RESET( coh3002c )
890873   MDRV_NVRAM_HANDLER( at28c16_0 )
891874
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
911875   MDRV_SOUND_ADD( QSOUND, QSOUND_CLOCK )
912876   MDRV_SOUND_CONFIG( qsound_interface )
913877   MDRV_SOUND_ROUTE(0, "left", 1.0)
r1591r1592
12571221
12581222static NVRAM_HANDLER( coh1000ta )
12591223{
1260   nvram_handler_at28c16_0( machine, file, read_or_write );
1224   NVRAM_HANDLER_CALL(at28c16_0);
12611225   if (read_or_write)
12621226   {
12631227      mame_fwrite(file, taitofx1_eeprom1, taitofx1_eeprom_size1);
r1591r1592
13021266/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
13031267static void irq_handler(int irq)
13041268{
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);
13061270}
13071271
13081272static const struct YM2610interface ym2610_interface =
r1591r1592
13131277};
13141278
13151279static 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
13191282   MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 )
13201283
13211284   MDRV_CPU_ADD( Z80, 16000000 / 4 )
13221285   /* audio CPU */   /* 4 MHz */
13231286   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
13281287   MDRV_MACHINE_RESET( coh1000ta )
13291288   MDRV_NVRAM_HANDLER( coh1000ta )
13301289
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
13501290   MDRV_SOUND_ADD(YM2610B, 16000000/2)
13511291   MDRV_SOUND_CONFIG(ym2610_interface)
13521292   MDRV_SOUND_ROUTE(0, "left",  0.25)
r1591r1592
14011341
14021342static NVRAM_HANDLER( coh1000tb )
14031343{
1404   nvram_handler_at28c16_0( machine, file, read_or_write );
1344   NVRAM_HANDLER_CALL(at28c16_0);
14051345   if (read_or_write)
14061346   {
14071347      mame_fwrite(file, taitofx1_eeprom1, taitofx1_eeprom_size1);
r1591r1592
14201360}
14211361
14221362static 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
14261365   MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 )
14271366
1428   MDRV_SCREEN_REFRESH_RATE( 60 )
1429   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
1430
14311367   MDRV_MACHINE_RESET( coh1000tb )
14321368   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)
14521369MACHINE_DRIVER_END
14531370
14541371/*
r1591r1592
16101527}
16111528
16121529static 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 )
16171531
1618   MDRV_SCREEN_REFRESH_RATE( 60 )
1619   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
1620
16211532   MDRV_MACHINE_RESET( coh3002t )
16221533   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)
16421534MACHINE_DRIVER_END
16431535
16441536/*
r1591r1592
18241716}
18251717
18261718static 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 )
18311720
1832   MDRV_SCREEN_REFRESH_RATE( 60 )
1833   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
1834
18351721   MDRV_MACHINE_RESET( coh1000w )
18361722   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)
18561723MACHINE_DRIVER_END
18571724
18581725/*
r1591r1592
20121879static WRITE32_HANDLER( coh1002e_latch_w )
20131880{
20141881   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
20181883   else
2019   {
20201884      soundlatch_w(0, data);
2021   }
20221885}
20231886
20241887static DRIVER_INIT( coh1002e )
r1591r1592
20661929};
20671930
20681931static 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 )
20731933
2074   MDRV_CPU_ADD( M68000, 12000000 )
20751934   /* audio CPU */
1935   MDRV_CPU_ADD( M68000, 12000000 )
20761936   MDRV_CPU_PROGRAM_MAP( psarc_snd_map, 0 )
20771937
2078   MDRV_SCREEN_REFRESH_RATE( 60 )
2079   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
2080
20811938   MDRV_MACHINE_RESET( coh1002e )
20821939   MDRV_NVRAM_HANDLER( at28c16_0 )
20831940
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
21031941   MDRV_SOUND_ADD( YMF271, 16934400 )
21041942   MDRV_SOUND_CONFIG( ymf271_interface )
21051943   MDRV_SOUND_ROUTE(0, "left", 1.0)
r1591r1592
24112249}
24122250
24132251static 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 )
24182253
2419   MDRV_SCREEN_REFRESH_RATE( 60 )
2420   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
2421
24222254   MDRV_MACHINE_RESET( coh1000a )
24232255   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)
24432256MACHINE_DRIVER_END
24442257
24452258/*
r1591r1592
25782391}
25792392
25802393static 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 )
25852395
2586//  MDRV_CPU_ADD( M68000, 10000000 )
25872396//  /* audio CPU */
2397//  MDRV_CPU_ADD( M68000, 10000000 )
25882398//  MDRV_CPU_PROGRAM_MAP( atlus_snd_map, 0 )
25892399
2590   MDRV_SCREEN_REFRESH_RATE( 60 )
2591   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
2592
25932400   MDRV_MACHINE_RESET( coh1001l )
25942401   MDRV_NVRAM_HANDLER( at28c16_0 )
25952402
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
26152403//  MDRV_SOUND_ADD( YMZ280B, ymz280b_intf )
26162404MACHINE_DRIVER_END
26172405
r1591r1592
26672455}
26682456
26692457static 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
26732460   MDRV_CPU_VBLANK_INT( coh1002v_vblank, 1 )
26742461
2675   MDRV_SCREEN_REFRESH_RATE( 60 )
2676   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
2677
26782462   MDRV_MACHINE_RESET( coh1002v )
26792463   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)
26992464MACHINE_DRIVER_END
27002465
27012466/*
r1591r1592
29362701};
29372702
29382703static 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 )
29432705
2944   MDRV_SCREEN_REFRESH_RATE( 60 )
2945   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
2946
29472706   MDRV_MACHINE_RESET( coh1002m )
29482707   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)
29682708MACHINE_DRIVER_END
29692709
29702710static 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 )
29752712
2976   MDRV_CPU_ADD( Z80, 32000000/8 )
29772713   /* audio CPU */
2714   MDRV_CPU_ADD( Z80, 32000000/8 )
29782715   MDRV_CPU_PROGRAM_MAP( cbaj_z80_map, 0 )
29792716   MDRV_CPU_IO_MAP( cbaj_z80_port_map, 0 )
29802717
2981   MDRV_SCREEN_REFRESH_RATE( 60 )
2982   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
2983
29842718   MDRV_MACHINE_RESET( coh1002m )
29852719   MDRV_NVRAM_HANDLER( at28c16_0 )
29862720
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
30062721   MDRV_SOUND_ADD(YMZ280B, 16934400)
30072722   MDRV_SOUND_CONFIG(ymz280b_intf)
30082723   MDRV_SOUND_ROUTE(0, "left", 1.0)
r1591r1592
30102725MACHINE_DRIVER_END
30112726
30122727static 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 )
30172729
30182730   MDRV_CPU_ADD( Z80, 8000000 )
30192731   MDRV_CPU_PROGRAM_MAP( link_readmem, link_writemem )
30202732
3021   MDRV_SCREEN_REFRESH_RATE( 60 )
3022   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
3023
30242733   MDRV_MACHINE_RESET( coh1002m )
30252734   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)
30452735MACHINE_DRIVER_END
30462736
30472737static INPUT_PORTS_START( zn )
src/mame/drivers/paradise.c
r1591r1592
9696
9797
9898static ADDRESS_MAP_START( paradise_readport, ADDRESS_SPACE_IO, 8 )
99   AM_RANGE(0x0000, 0x17ff) AM_READ(paletteram_r         )   // Palette
99   AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_RAM         )   // Palette
100100   AM_RANGE(0x2010, 0x2010) AM_READ(OKIM6295_status_0_r   )   // OKI 0
101101   AM_RANGE(0x2030, 0x2030) AM_READ(OKIM6295_status_1_r   )   // OKI 1
102102   AM_RANGE(0x2020, 0x2020) AM_READ(input_port_0_r      )   // DSW 1
r1591r1592
536536static MACHINE_DRIVER_START( paradise )
537537
538538   /* basic machine hardware */
539   MDRV_CPU_ADD_TAG("main", Z80, 12000000/2)         /* Z8400B - 6mhz Verified */
539   MDRV_CPU_ADD_TAG("main", Z80, XTAL_12MHz/2)         /* Z8400B - 6mhz Verified */
540540   MDRV_CPU_PROGRAM_MAP(paradise_map,0)
541541   MDRV_CPU_IO_MAP(paradise_readport,paradise_writeport)
542542   MDRV_CPU_VBLANK_INT(irq0_line_hold,4)   /* No nmi routine */
r1591r1592
558558   /* sound hardware */
559559   MDRV_SPEAKER_STANDARD_MONO("mono")
560560
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 */
563563   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
564564
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 */
567567   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
568568MACHINE_DRIVER_END
569569
src/mame/drivers/volfied.c
r1591r1592
7373   AM_RANGE(0x100000, 0x103fff) AM_READ(MRA16_RAM)    /* main    */
7474   AM_RANGE(0x200000, 0x203fff) AM_READ(PC090OJ_word_0_r)
7575   AM_RANGE(0x400000, 0x47ffff) AM_READ(volfied_video_ram_r)
76   AM_RANGE(0x500000, 0x503fff) AM_READ(paletteram16_word_r)
76   AM_RANGE(0x500000, 0x503fff) AM_READ(MRA16_RAM)
7777   AM_RANGE(0xd00000, 0xd00001) AM_READ(volfied_video_ctrl_r)
7878   AM_RANGE(0xe00002, 0xe00003) AM_READ(taitosound_comm16_lsb_r)
7979   AM_RANGE(0xf00000, 0xf007ff) AM_READ(volfied_cchip_ram_r)
r1591r1592
237237
238238static void irqhandler(int irq)
239239{
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);
241241}
242242
243243static const struct YM2203interface ym2203_interface =
src/mame/drivers/dribling.c
r1591r1592
5555static INTERRUPT_GEN( dribling_irq_gen )
5656{
5757   if (di)
58      cpunum_set_input_line(0, 0, ASSERT_LINE);
58      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
5959}
6060
6161
r1591r1592
9898   /* bit 7 = di */
9999   di = (data >> 7) & 1;
100100   if (!di)
101      cpunum_set_input_line(0, 0, CLEAR_LINE);
101      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
102102
103103   /* bit 6 = parata */
104104
src/mame/drivers/balsente.c
r1591r1592
19301930   ROM_LOAD( "tpg1-gr5.bin", 0x0a000, 0x2000, CRC(067bfd66) SHA1(32f5973f2f0aed67c8f9b5886f52b9dc516a611e) )
19311931ROM_END
19321932
1933ROM_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) )
19331943
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) )
1954ROM_END
1955
1956
19341957ROM_START( triviag2 )
19351958   ROM_REGION( 0x40000, REGION_CPU1, 0 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
19361959   ROM_LOAD( "ab01.bin",  0x10000, 0x4000, CRC(4fca20c5) SHA1(595b32ff035036cafbf49d75aa170f39e9f52b38) )
r1591r1592
21482171   ROM_LOAD( "gr67.u1c", 0x0c000, 0x4000, CRC(3311f9c0) SHA1(63b185c761b258113c31cc269ce0b1462bf37f40) )
21492172ROM_END
21502173
2174ROM_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) )
21512184
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) )
2193ROM_END
2194
2195
21522196ROM_START( sfootbal )
21532197   ROM_REGION( 0x40000, REGION_CPU1, 0 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
21542198   ROM_LOAD( "sfbab01.bin",  0x10000, 0x4000, CRC(2a69803f) SHA1(ca86c9d079fbebae4c93c889d98a8573facc05da) )
r1591r1592
24492493GAME( 1984, snakepit, 0,        balsente, snakepit, snakepit, ROT0, "Bally/Sente", "Snake Pit", GAME_SUPPORTS_SAVE )
24502494GAME( 1984, snakjack, 0,        balsente, snakjack, snakjack, ROT0, "Bally/Sente", "Snacks'n Jaxson", GAME_SUPPORTS_SAVE )
24512495GAME( 1984, stocker,  0,        balsente, stocker,  stocker,  ROT0, "Bally/Sente", "Stocker", GAME_SUPPORTS_SAVE )
2452GAME( 1984, triviag1, 0,        balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I)", GAME_SUPPORTS_SAVE )
2496GAME( 1984, triviag1, 0,        balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 1)", GAME_SUPPORTS_SAVE )
2497GAME( 1984, trivia12, 0,        balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 2)", GAME_SUPPORTS_SAVE )
24532498GAME( 1984, triviag2, 0,        balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Genus II)", GAME_SUPPORTS_SAVE )
24542499GAME( 1984, triviasp, 0,        balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (All Star Sports Edition)", GAME_SUPPORTS_SAVE )
24552500GAME( 1984, triviayp, 0,        balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Young Players Edition)", GAME_SUPPORTS_SAVE )
r1591r1592
24612506GAME( 1985, toggle,   0,        balsente, toggle,   toggle,   ROT0, "Bally/Sente", "Toggle (prototype)", GAME_SUPPORTS_SAVE )
24622507GAME( 1986, nametune, 0,        balsente, nametune, nametune, ROT0, "Bally/Sente", "Name That Tune", GAME_SUPPORTS_SAVE )
24632508GAME( 1986, nstocker, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker", GAME_SUPPORTS_SAVE )
2509GAME( 1986, nstockr2, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 2)", GAME_SUPPORTS_SAVE )
24642510GAME( 1986, sfootbal, 0,        balsente, sfootbal, sfootbal, ROT0, "Bally/Sente", "Street Football", GAME_SUPPORTS_SAVE )
24652511GAME( 1986, spiker,   0,        balsente, spiker,   spiker,   ROT0, "Bally/Sente", "Spiker", GAME_SUPPORTS_SAVE )
24662512GAME( 1986, stompin,  0,        balsente, stompin,  stompin,  ROT0, "Bally/Sente", "Stompin'", GAME_SUPPORTS_SAVE )
src/mame/drivers/megadriv.c
r1591r1592
512512      if (megadrive_irq4_pending)
513513      {
514514         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);
518516         else
519         {
520            cpunum_set_input_line(0,4,CLEAR_LINE);
521         }
517            cpunum_set_input_line(Machine, 0,4,CLEAR_LINE);
522518      }
523519
524520      /* ??? Fatal Rewind needs this but I'm not sure it's accurate behavior
r1591r1592
533529      if (megadrive_irq6_pending)
534530      {
535531         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);
539533         else
540         {
541            cpunum_set_input_line(0,6,CLEAR_LINE);
542         }
534            cpunum_set_input_line(Machine, 0,6,CLEAR_LINE);
543535      }
544536
545537      /* ??? */
r1591r1592
22612253      {
22622254         //logerror("%06x: 68000 request z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22632255         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);
22652257      }
22662258      else
22672259      {
22682260         //logerror("%06x: 68000 return z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22692261         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);
22712263
22722264      }
22732265   }
r1591r1592
22772269      {
22782270         //logerror("%06x: 68000 request z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22792271         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);
22812273      }
22822274      else
22832275      {
22842276         //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22852277         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);
22872279      }
22882280   }
22892281   else // word access
r1591r1592
22922284      {
22932285         //logerror("%06x: 68000 request z80 Bus (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22942286         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);
22962288      }
22972289      else
22982290      {
22992291         //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23002292         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);
23022294      }
23032295   }
23042296}
r1591r1592
23112303      {
23122304         //logerror("%06x: 68000 clear z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23132305         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);
23152307      }
23162308      else
23172309      {
23182310         //logerror("%06x: 68000 start z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23192311         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);
23212313         sndti_reset(SOUND_YM2612, 0);
23222314      }
23232315   }
r1591r1592
23272319      {
23282320         //logerror("%06x: 68000 clear z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23292321         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);
23312323      }
23322324      else
23332325      {
23342326         //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23352327         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);
23372329         sndti_reset(SOUND_YM2612, 0);
23382330
23392331      }
r1591r1592
23442336      {
23452337         //logerror("%06x: 68000 clear z80 reset (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23462338         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 );
23482340      }
23492341      else
23502342      {
23512343         //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23522344         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);
23542346         sndti_reset(SOUND_YM2612, 0);
23552347      }
23562348   }
r1591r1592
43184310
43194311      if (genesis_scanline_counter==megadrive_z80irq_scanline)
43204312      {
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);
43224314      }
43234315      if (genesis_scanline_counter==megadrive_z80irq_scanline+1)
43244316      {
4325         cpunum_set_input_line(1,0,CLEAR_LINE);
4317         cpunum_set_input_line(machine, 1,0,CLEAR_LINE);
43264318      }
43274319
43284320
r1591r1592
43404332
43414333   {
43424334//      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);
43444336   }
43454337}
43464338
43474339static TIMER_CALLBACK( irq4_on_callback )
43484340{
43494341   //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);
43514343}
43524344
43534345/*****************************************************************************************/
r1591r1592
43954387
43964388
43974389   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);
43994391   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);
44014393   genz80.z80_bank_pos = 0;
44024394   genz80.z80_bank_addr = 0;
44034395   genesis_scanline_counter = -1;
r1591r1592
44174409   timer_adjust(scanline_timer,  attotime_zero, 0, attotime_zero);
44184410
44194411//  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... */
44224414
44234415   memset(megadrive_ram,0x00,0x10000);
44244416
r1591r1592
44534445   megadrive_sprite_collision=0;//? when to reset this ..
44544446   megadrive_imode = MEGADRIVE_REG0C_INTERLEAVE; // can't change mid-frame..
44554447   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..
44574449
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);
44594451
44604452/*
44614453int megadrive_total_scanlines = 262;
src/mame/drivers/galpani3.c
r1591r1592
8080{
8181   switch ( cpu_getiloops() )
8282   {
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;
8686   }
8787}
8888
src/mame/drivers/itech32.c
r1591r1592
253253static UINT32 *tms1_boot;
254254static UINT8 tms_spinning[2];
255255
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)
258258
259259
260260
r1591r1592
291291
292292   /* update it */
293293   if (level)
294      cpunum_set_input_line(0, level, ASSERT_LINE);
294      cpunum_set_input_line(Machine, 0, level, ASSERT_LINE);
295295   else
296      cpunum_set_input_line(0, 7, CLEAR_LINE);
296      cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
297297}
298298
299299
r1591r1592
335335
336336static MACHINE_RESET( drivedge )
337337{
338   machine_reset_itech32(machine);
338   MACHINE_RESET_CALL(itech32);
339339
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);
344344}
345345
346346
r1591r1592
536536{
537537   sound_data = param;
538538   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);
540540}
541541
542542
r1591r1592
562562
563563static READ8_HANDLER( sound_data_r )
564564{
565   cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE);
565   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
566566   sound_int_state = 0;
567567   return sound_data;
568568}
r1591r1592
633633static void via_irq(int state)
634634{
635635   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);
637637   else
638      cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE);
638      cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE);
639639}
640640
641641
r1591r1592
668668
669669static WRITE8_HANDLER( firq_clear_w )
670670{
671   cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE);
671   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE);
672672}
673673
674674
r1591r1592
681681
682682static WRITE32_HANDLER( tms_reset_assert_w )
683683{
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);
686686}
687687
688688
r1591r1592
691691   /* kludge to prevent crash on first boot */
692692   if ((tms1_ram[0] & 0xff000000) == 0)
693693   {
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);
696696   }
697697   if ((tms2_ram[0] & 0xff000000) == 0)
698698   {
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);
701701   }
702702}
703703
r1591r1592
706706{
707707   COMBINE_DATA(&tms1_ram[offset]);
708708   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);
710710   if (!tms_spinning[0])
711711      cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
712712}
r1591r1592
715715static WRITE32_HANDLER( tms2_68k_ram_w )
716716{
717717   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);
719719   if (!tms_spinning[1])
720720      cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
721721}
r1591r1592
832832
833833static NVRAM_HANDLER( tournament )
834834{
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);
837837}
838838
839839
r1591r1592
38603860   /*
38613861        Tournament Version
38623862    */
3863   driver_init_aama(machine);
3863   DRIVER_INIT_CALL(aama);
38643864   timekeeper_init( 0, TIMEKEEPER_M48T02, NULL );
38653865   memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r);
38663866   memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_w);
r1591r1592
38983898{
38993899   /* a little extra protection */
39003900   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680003, 0, 0, gtclass_prot_result_r);
3901   driver_init_aama(machine);
3901   DRIVER_INIT_CALL(aama);
39023902
39033903   /* The protection code is:
39043904
src/mame/drivers/fitfight.c
r1591r1592
271271
272272static INTERRUPT_GEN( snd_irq )
273273{
274   cpunum_set_input_line(1,UPD7810_INTF2,HOLD_LINE);
274   cpunum_set_input_line(machine, 1,UPD7810_INTF2,HOLD_LINE);
275275}
276276
277277static UPD7810_CONFIG sound_cpu_config =
src/mame/drivers/sspeedr.c
r1591r1592
5555
5656static WRITE8_HANDLER( sspeedr_int_ack_w )
5757{
58   cpunum_set_input_line(0, 0, CLEAR_LINE);
58   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
5959}
6060
6161
src/mame/drivers/filetto.c
r1591r1592
374374static WRITE8_HANDLER( nmi_enable_w )
375375{
376376   //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);
378378   //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);
380380}
381381
382382static READ8_HANDLER( kludge_r )
r1591r1592
438438   }
439439   else//keyboard emulation
440440   {
441      cpunum_set_input_line(0,1,PULSE_LINE);
441      cpunum_set_input_line(Machine, 0,1,PULSE_LINE);
442442      return 0x00;//Keyboard is disconnected
443443      //return 0xaa;//Keyboard code
444444   }
r1591r1592
471471
472472static WRITE8_HANDLER( sys_reset_w )
473473{
474   cpunum_set_input_line(0,INPUT_LINE_RESET,PULSE_LINE);
474   cpunum_set_input_line(Machine, 0,INPUT_LINE_RESET,PULSE_LINE);
475475}
476476
477477
src/mame/drivers/ashnojoe.c
r1591r1592
110110   {
111111      soundlatch_w(0,data & 0xff);
112112      //needed?
113      cpunum_set_input_line(1,0,HOLD_LINE);
113      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
114114   }
115115}
116116
r1591r1592
310310
311311static void irqhandler(int irq)
312312{
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);
314314}
315315
316316static WRITE8_HANDLER(writeA)
r1591r1592
327327
328328static void ashnojoe_adpcm_int (int data)
329329{
330   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
330   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
331331}
332332
333333static const struct MSM5205interface msm5205_interface =
src/mame/drivers/findout.c
r1591r1592
1818#include "sound/dac.h"
1919
2020
21static VIDEO_UPDATE( findout )
22{
23   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
24   return 0;
25}
26
27
2821static UINT8 drawctrl[3];
2922
3023static WRITE8_HANDLER( findout_drawctrl_w )
r1591r1592
470463   MDRV_PALETTE_LENGTH(256)
471464
472465   MDRV_VIDEO_START(generic_bitmapped)
473   MDRV_VIDEO_UPDATE(findout)
466   MDRV_VIDEO_UPDATE(generic_bitmapped)
474467
475468   /* sound hardware */
476469   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/mouser.c
r1591r1592
4545static WRITE8_HANDLER( mouser_sound_interrupt_w )
4646{
4747   mouser_sound_byte = data;
48   cpunum_set_input_line(1, 0, HOLD_LINE);
48   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
4949}
5050
5151static READ8_HANDLER( mouser_sound_byte_r )
src/mame/drivers/undrfire.c
r1591r1592
166166
167167static TIMER_CALLBACK( undrfire_interrupt5 )
168168{
169   cpunum_set_input_line(0,5,HOLD_LINE);
169   cpunum_set_input_line(machine, 0,5,HOLD_LINE);
170170}
171171
172172
r1591r1592
542542static INTERRUPT_GEN( undrfire_interrupt )
543543{
544544   frame_counter^=1;
545   cpunum_set_input_line(0, 4, HOLD_LINE);
545   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
546546}
547547
548548static MACHINE_DRIVER_START( undrfire )
src/mame/drivers/deco32.c
r1591r1592
253253   deco32_raster_display_list[deco32_raster_display_position++]=deco32_pf12_control[3]&0xffff;
254254   deco32_raster_display_list[deco32_raster_display_position++]=deco32_pf12_control[4]&0xffff;
255255
256   cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE);
256   cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE);
257257}
258258
259259static READ32_HANDLER( deco32_irq_controller_r )
r1591r1592
262262
263263   switch (offset) {
264264   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);
266266      return 0;
267267
268268   case 3: /* Irq controller
r1591r1592
316316static WRITE32_HANDLER( deco32_sound_w )
317317{
318318   soundlatch_w(0,data & 0xff);
319   cpunum_set_input_line(1,0,HOLD_LINE);
319   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
320320}
321321
322322static READ32_HANDLER( deco32_71_r )
r1591r1592
606606
607607   /* Sound board reset control */
608608   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);
610610   else
611      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
611      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
612612
613613   /* bit 0x4 fade cancel? */
614614   /* bit 0x8 ?? */
r1591r1592
655655      /* bit 1 of nslasher_sound_irq specifies IRQ command writes */
656656      soundlatch_w(0,(data>>16)&0xff);
657657      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);
659659   }
660660}
661661
r1591r1592
11331133static WRITE8_HANDLER(deco32_bsmt1_w)
11341134{
11351135   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 */
11371137}
11381138
11391139static READ8_HANDLER(deco32_bsmt_status_r)
r1591r1592
11791179{
11801180   /* bit 1 of nslasher_sound_irq specifies IRQ command writes */
11811181   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);
11831183   return soundlatch_r(0);
11841184}
11851185
r1591r1592
17791779
17801780static void sound_irq(int state)
17811781{
1782   cpunum_set_input_line(1,1,state); /* IRQ 2 */
1782   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
17831783}
17841784
17851785static void sound_irq_nslasher(int state)
r1591r1592
17891789      nslasher_sound_irq |= 0x01;
17901790   else
17911791      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);
17931793}
17941794
17951795static WRITE8_HANDLER( sound_bankswitch_w )
r1591r1592
18641864
18651865static INTERRUPT_GEN( deco32_vbl_interrupt )
18661866{
1867   cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE);
1867   cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE);
18681868}
18691869
18701870static INTERRUPT_GEN( tattass_snd_interrupt )
18711871{
1872   cpunum_set_input_line(1, M6809_FIRQ_LINE, HOLD_LINE);
1872   cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, HOLD_LINE);
18731873}
18741874
18751875static MACHINE_DRIVER_START( captaven )
src/mame/drivers/midzeus.c
r1591r1592
9393static MACHINE_START( midzeus2 )
9494{
9595   timekeeper_init(0, TIMEKEEPER_MIDZEUS2, NULL);
96   machine_start_midzeus(machine);
96   MACHINE_START_CALL(midzeus);
9797}
9898
9999
r1591r1592
115115
116116static TIMER_CALLBACK( display_irq_off )
117117{
118   cpunum_set_input_line(0, 0, CLEAR_LINE);
118   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
119119}
120120
121121static INTERRUPT_GEN( display_irq )
122122{
123   cpunum_set_input_line(0, 0, ASSERT_LINE);
123   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
124124   timer_set(ATTOTIME_IN_HZ(30000000), NULL, 0, display_irq_off);
125125}
126126
r1591r1592
202202
203203static NVRAM_HANDLER( midzeus2 )
204204{
205   nvram_handler_timekeeper_0(machine, file, read_or_write);
205   NVRAM_HANDLER_CALL(timekeeper_0);
206206
207207   if (read_or_write)
208208      mame_fwrite(file, zpram, zpram_size);
r1591r1592
504504 *
505505 *************************************/
506506
507static void update_gun_irq(void)
507static void update_gun_irq(running_machine *machine)
508508{
509509   /* low 2 bits of gun_control seem to enable IRQs */
510510   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);
512512   else
513      cpunum_set_input_line(0, 3, CLEAR_LINE);
513      cpunum_set_input_line(machine, 0, 3, CLEAR_LINE);
514514}
515515
516516
r1591r1592
521521
522522   /* set the appropriate IRQ in the internal gun control and update */
523523   gun_irq_state |= 0x01 << player;
524   update_gun_irq();
524   update_gun_irq(machine);
525525
526526   /* generate another interrupt on the next scanline while we are within the BEAM_DY */
527527   beamy++;
r1591r1592
540540   /* bits 0-1 enable IRQs (?) */
541541   /* bits 2-3 reset IRQ states */
542542   gun_irq_state &= ~((gun_control >> 2) & 3);
543   update_gun_irq();
543   update_gun_irq(Machine);
544544
545545   for (player = 0; player < 2; player++)
546546   {
src/mame/drivers/grchamp.c
r1591r1592
9595   grchamp_state *state = machine->driver_data;
9696
9797   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);
9999}
100100
101101
r1591r1592
104104   grchamp_state *state = machine->driver_data;
105105
106106   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);
108108}
109109
110110
r1591r1592
132132         /* bit 6: FOG OUT */
133133         /* bit 7: RADARON */
134134         if ((diff & 0x01) && !(data & 0x01))
135            cpunum_set_input_line(0, 0, CLEAR_LINE);
135            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
136136         if ((diff & 0x02) && !(data & 0x02))
137137            state->collide = state->collmode = 0;
138138         break;
r1591r1592
185185         break;
186186
187187      case 0x0d:   /* OUT13 */
188         watchdog_reset();
188         watchdog_reset(Machine);
189189         break;
190190
191191      case 0x0e:   /* OUT14 */
192192         /* O-21 connector */
193193         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);
195195         break;
196196   }
197197}
r1591r1592
271271      case 0x04:   /* OUT4 */
272272         /* bit 0:   interrupt enable for CPU 1 */
273273         if ((diff & 0x01) && !(data & 0x01))
274            cpunum_set_input_line(1, 0, CLEAR_LINE);
274            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
275275         break;
276276
277277      case 0x05:   /* OUT5 - unused */
src/mame/drivers/argus.c
r1591r1592
160160static INTERRUPT_GEN( argus_interrupt )
161161{
162162   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 */
164164   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 */
166166}
167167
168168/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
169169static void irqhandler(int irq)
170170{
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);
172172}
173173
174174static const struct YM2203interface ym2203_interface =
src/mame/drivers/lkage.c
r1591r1592
5555
5656static TIMER_CALLBACK( nmi_callback )
5757{
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);
5959   else pending_nmi = 1;
6060}
6161
r1591r1592
7575   sound_nmi_enable = 1;
7676   if (pending_nmi)
7777   { /* 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);
7979      pending_nmi = 0;
8080   }
8181}
r1591r1592
8383static ADDRESS_MAP_START( lkage, ADDRESS_SPACE_PROGRAM, 8 )
8484   AM_RANGE(0x0000, 0xdfff) AM_READ(MRA8_ROM) AM_WRITE(MWA8_ROM)
8585   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM) AM_WRITE(MWA8_RAM) /* work ram */
86   AM_RANGE(0xe800, 0xefff) AM_READ(paletteram_r) AM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_BASE(&paletteram)
86   AM_RANGE(0xe800, 0xefff) AM_READWRITE(MRA8_RAM, paletteram_xxxxRRRRGGGGBBBB_le_w) AM_BASE(&paletteram)
8787   AM_RANGE(0xf000, 0xf003) AM_READ(MRA8_RAM) AM_WRITE(MWA8_RAM) AM_BASE(&lkage_vreg) /* video registers */
8888   AM_RANGE(0xf060, 0xf060) AM_WRITE(lkage_sound_command_w)
8989   AM_RANGE(0xf061, 0xf061) AM_WRITE(MWA8_NOP)
r1591r1592
310310
311311static void irqhandler(int irq)
312312{
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);
314314}
315315
316316static const struct YM2203interface ym2203_interface =
src/mame/drivers/superdq.c
r1591r1592
163163       toggles (680usec after the vblank). We could set up a
164164       timer to do that, but this works as well */
165165   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);
167167}
168168
169169static WRITE8_HANDLER( superdq_videoram_w )
r1591r1592
178178   static const UINT8 black_color_entries[] = {7,15,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
179179
180180   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);
182182
183183   coin_counter_w( 0, data & 0x08 );
184184   coin_counter_w( 1, data & 0x04 );
src/mame/drivers/goodejan.c
r1591r1592
266266static INTERRUPT_GEN( goodejan_interrupt )
267267{
268268   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);
270270   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);
272272}
273273
274274static MACHINE_DRIVER_START( goodejan )
src/mame/drivers/gaiden.c
r1591r1592
164164{
165165   if (ACCESSING_LSB) soundlatch_w(0,data & 0xff);   /* Ninja Gaiden */
166166   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);
168168}
169169
170170static WRITE16_HANDLER( drgnbowl_sound_command_w )
r1591r1592
172172   if (ACCESSING_MSB)
173173   {
174174      soundlatch_w(0,data >> 8);
175      cpunum_set_input_line(1,0,HOLD_LINE);
175      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
176176   }
177177}
178178
r1591r1592
951951/* handler called by the 2203 emulator when the internal timers cause an IRQ */
952952static void irqhandler(int irq)
953953{
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);
955955}
956956
957957static const struct YM2203interface ym2203_interface =
src/mame/drivers/zaxxon.c
r1591r1592
354354{
355355   /* pressing the service switch sends an NMI */
356356   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);
358358}
359359
360360
361361static INTERRUPT_GEN( vblank_int )
362362{
363363   if (int_enabled)
364      cpunum_set_input_line(0, 0, ASSERT_LINE);
364      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
365365}
366366
367367
r1591r1592
369369{
370370   int_enabled = data & 1;
371371   if (!int_enabled)
372      cpunum_set_input_line(0, 0, CLEAR_LINE);
372      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
373373}
374374
375375
r1591r1592
14271427static DRIVER_INIT( zaxxonb )
14281428{
14291429   zaxxonb_decode();
1430   driver_init_zaxxon(machine);
1430   DRIVER_INIT_CALL(zaxxon);
14311431}
14321432
14331433
14341434static DRIVER_INIT( szaxxon )
14351435{
14361436   szaxxon_decode();
1437   driver_init_zaxxon(machine);
1437   DRIVER_INIT_CALL(zaxxon);
14381438}
14391439
14401440
14411441static DRIVER_INIT( futspy )
14421442{
14431443   futspy_decode();
1444   driver_init_zaxxon(machine);
1444   DRIVER_INIT_CALL(zaxxon);
14451445}
14461446
14471447
14481448static DRIVER_INIT( razmataz )
14491449{
14501450   nprinces_decode();
1451   driver_init_zaxxon(machine);
1451   DRIVER_INIT_CALL(zaxxon);
14521452
14531453   /* additional input ports are wired */
14541454   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc004, 0xc004, 0, 0x18f3, port_tag_to_handler8("SW04"));
r1591r1592
14711471static DRIVER_INIT( ixion )
14721472{
14731473   szaxxon_decode();
1474   driver_init_zaxxon(machine);
1474   DRIVER_INIT_CALL(zaxxon);
14751475
14761476   /* connect the universal sound board */
14771477   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r);
src/mame/drivers/shangkid.c
r1591r1592
7979
8080static WRITE8_HANDLER( shangkid_bbx_enable_w )
8181{
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 );
8383}
8484
8585static WRITE8_HANDLER( shangkid_cpu_reset_w )
8686{
8787   if( data == 0 )
8888   {
89      cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
89      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
9090   }
9191   else if( data == 1 )
9292   {
93      cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
93      cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
9494   }
9595}
9696
r1591r1592
114114      {
115115         if( data == 0x01 )
116116            /* 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 );
118118      }
119119      break;
120120
r1591r1592
137137      {
138138         if( data == 0x01 )
139139            /* 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 );
141141      }
142142      else
143143         memory_set_bank(2, data ? 0 : 1);
r1591r1592
180180
181181static MACHINE_RESET( chinhero )
182182{
183   cpunum_set_input_line(1, INPUT_LINE_HALT, 1 );
183   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, 1 );
184184}
185185
186186static MACHINE_RESET( shangkid )
187187{
188   cpunum_set_input_line(1, INPUT_LINE_HALT, 1 );
188   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, 1 );
189189
190190   memory_set_bank(1, 0);
191191   memory_set_bank(2, 0);
src/mame/drivers/astrof.c
r1591r1592
8989
9090static READ8_HANDLER( irq_ack_r )
9191{
92   cpunum_set_input_line(0, 0, CLEAR_LINE);
92   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9393
9494   return 0;
9595}
r1591r1592
9797
9898static TIMER_CALLBACK( irq_callback )
9999{
100   cpunum_set_input_line(0, 0, ASSERT_LINE);
100   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
101101
102102   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0, attotime_zero);
103103}
r1591r1592
129129
130130   /* both the coin input and the serice credit generates an NMI */
131131   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);
133133
134134   /* the coin input is also connected to the coin counter */
135135   if (coin)
r1591r1592
435435   state_save_register_global(screen_off);
436436   state_save_register_global(astrof_palette_bank);
437437
438   machine_start_astrof_audio(machine);
438   MACHINE_START_CALL(astrof_audio);
439439}
440440
441441
r1591r1592
444444   /* register for state saving */
445445   state_save_register_global(abattle_count);
446446
447   machine_start_astrof(machine);
447   MACHINE_START_CALL(astrof);
448448}
449449
450450
r1591r1592
494494
495495static MACHINE_RESET( abattle )
496496{
497   machine_reset_astrof(machine);
497   MACHINE_RESET_CALL(astrof);
498498
499499   abattle_count = 0;
500500}
r1591r1592
631631   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
632632   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
633633   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 )
640634INPUT_PORTS_END
641635
642636
r1591r1592
11751169
11761170ROM_START( spfgmk22 )
11771171   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) )
11851179
11861180   ROM_REGION( 0x0020, REGION_PROMS, 0 )
11871181   ROM_LOAD( "709-5.1a",     0x0000, 0x0020, CRC(61329fd1) SHA1(15782d8757d4dda5a8b97815e94c90218f0e08dd) )
r1591r1592
12891283GAME( 1979, acombat,  astrof,   abattle,  abattle,  afire,   ROT90, "bootleg",     "Astro Combat (newer, CB)", GAME_SUPPORTS_SAVE )
12901284GAME( 1979, acombato, astrof,   abattle,  abattle,  afire,   ROT90, "bootleg",     "Astro Combat (older, PZ)", GAME_SUPPORTS_SAVE )
12911285GAME( 1979, sstarbtl, astrof,   abattle,  abattle,  sstarbtl,ROT90, "bootleg",     "Super Star Battle", GAME_SUPPORTS_SAVE )
1292GAME( 1980, spfghmk2, 0,        spfghmk2, spfghmk2, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1293GAME( 1980, spfgmk22, spfghmk2, spfghmk2, spfgmk22, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1286GAME( 1979, spfghmk2, 0,        spfghmk2, spfghmk2, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1287GAME( 1979, spfgmk22, spfghmk2, spfghmk2, spfgmk22, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
12941288GAME( 1980, tomahawk, 0,        tomahawk, tomahawk, 0,       ROT90, "Data East",   "Tomahawk 777 (rev 5)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
12951289GAME( 1980, tomahaw1, tomahawk, tomahawk, tomahawk, 0,       ROT90, "Data East",   "Tomahawk 777 (rev 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/karnov.c
r1591r1592
8686
8787//  if (!i8751_return && data!=0x300) logerror("CPU %04x - Unknown Write %02x intel\n",activecpu_get_pc(),data);
8888
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 */
9090   i8751_needs_ack=1;
9191}
9292
r1591r1592
140140   if (data==0x501) i8751_return=0x6bf8;
141141   if (data==0x500) i8751_return=0x4e75;
142142
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 */
144144   i8751_needs_ack=1;
145145}
146146
r1591r1592
250250
251251//  logerror("CPU %04x - Unknown Write %02x intel\n",activecpu_get_pc(),data);
252252
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 */
254254   i8751_needs_ack=1;
255255}
256256
r1591r1592
261261   /* Mnemonics filled in from the schematics, brackets are my comments */
262262   switch (offset<<1) {
263263      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);
265265
266266         if (i8751_needs_ack) {
267267            /* If a command and coin insert happen at once, then the i8751 will queue the
268268                    coin command until the previous command is ACK'd */
269269            if (i8751_coin_pending) {
270270               i8751_return=i8751_coin_pending;
271               cpunum_set_input_line(0,6,HOLD_LINE);
271               cpunum_set_input_line(Machine, 0,6,HOLD_LINE);
272272               i8751_coin_pending=0;
273273            } else if (i8751_command_queue) {
274274               /* Pending control command - just write it back as SECREQ */
r1591r1592
283283
284284      case 2: /* SONREQ (Sound CPU byte) */
285285         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);
287287         break;
288288
289289      case 4: /* DM (DMA to buffer spriteram) */
r1591r1592
314314         break;
315315
316316      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);
318318         break;
319319   }
320320}
r1591r1592
657657         i8751_coin_pending=readinputport(3) | 0x8000;
658658      } else {
659659         i8751_return=readinputport(3) | 0x8000;
660         cpunum_set_input_line(0,6,HOLD_LINE);
660         cpunum_set_input_line(machine, 0,6,HOLD_LINE);
661661         i8751_needs_ack=1;
662662      }
663663      latch=0;
664664   }
665665
666   cpunum_set_input_line(0,7,HOLD_LINE);   /* VBL */
666   cpunum_set_input_line(machine, 0,7,HOLD_LINE);   /* VBL */
667667}
668668
669669static void sound_irq(int linestate)
670670{
671   cpunum_set_input_line(1,0,linestate); /* IRQ */
671   cpunum_set_input_line(Machine, 1,0,linestate); /* IRQ */
672672}
673673
674674static const struct YM3526interface ym3526_interface =
src/mame/drivers/lwings.c
r1591r1592
9797static INTERRUPT_GEN( lwings_interrupt )
9898{
9999   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 */
101101}
102102
103103
src/mame/drivers/maxaflex.c
r1591r1592
7979
8080   /* clear coin interrupt */
8181   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 );
8383
8484   /* AUDMUTE */
8585   sound_global_enable((data >> 5) & 1);
8686
8787   /* RES600 */
8888   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);
9090
9191   /* latch for lamps */
9292   if ((diff & 0x40) && !(data & 0x40))
r1591r1592
154154      if ( (tcr & 0x40) == 0 )
155155      {
156156         //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 );
158158      }
159159   }
160160}
r1591r1592
227227{
228228   if ( !readinputport(4) )
229229   {
230      cpunum_set_input_line(1, M6805_IRQ_LINE, HOLD_LINE );
230      cpunum_set_input_line(machine, 1, M6805_IRQ_LINE, HOLD_LINE );
231231   }
232232}
233233
src/mame/drivers/punchout.c
r1591r1592
160160static WRITE8_HANDLER( punchout_2a03_reset_w )
161161{
162162   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);
164164   else
165      cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
165      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
166166}
167167
168168static int prot_mode_sel = -1; /* Mode selector */
src/mame/drivers/vegas.c
r1591r1592
940940      if (irq[i])
941941      {
942942         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);
944944      }
945945      else
946946      {
947947         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);
949949      }
950950   }
951951   if (LOG_NILE_IRQS) logerror("\n");
src/mame/drivers/kopunch.c
r1591r1592
1919   {
2020      if (~input_port_1_r(0) & 0x80)   /* coin 1 */
2121      {
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 */
2323         return;
2424      }
2525      else if (~input_port_1_r(0) & 0x08)   /* coin 2 */
2626      {
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 */
2828         return;
2929      }
3030   }
3131
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 */
3333}
3434
3535static READ8_HANDLER( kopunch_in_r )
src/mame/drivers/tecmo.c
r1591r1592
7979static WRITE8_HANDLER( tecmo_sound_command_w )
8080{
8181   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);
8383}
8484
8585static int adpcm_pos,adpcm_end;
r1591r1592
546546
547547static void irqhandler(int linestate)
548548{
549   cpunum_set_input_line(1,0,linestate);
549   cpunum_set_input_line(Machine, 1,0,linestate);
550550}
551551
552552static const struct YM3526interface ym3812_interface =
src/mame/drivers/galpanic.c
r1591r1592
142142{
143143   /* IRQ 3 drives the game, IRQ 5 updates the palette */
144144   if (cpu_getiloops() != 0)
145      cpunum_set_input_line(0, 5, HOLD_LINE);
145      cpunum_set_input_line(machine, 0, 5, HOLD_LINE);
146146   else
147      cpunum_set_input_line(0, 3, HOLD_LINE);
147      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
148148}
149149
150150static INTERRUPT_GEN( galhustl_interrupt )
151151{
152152   switch ( cpu_getiloops() )
153153   {
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;
157157   }
158158}
159159
src/mame/drivers/finalizr.c
r1591r1592
3333   if (cpu_getiloops() == 0)
3434   {
3535      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);
3737   }
3838   else if (cpu_getiloops() % 2)
3939   {
4040      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);
4242   }
4343}
4444
r1591r1592
5050
5151static WRITE8_HANDLER( finalizr_i8039_irq_w )
5252{
53   cpunum_set_input_line(1, 0, ASSERT_LINE);
53   cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
5454}
5555
5656static WRITE8_HANDLER( i8039_irqen_w )
r1591r1592
6161    */
6262
6363   if ((data & 0x80) == 0)
64      cpunum_set_input_line(1, 0, CLEAR_LINE);
64      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
6565}
6666
6767static READ8_HANDLER( i8039_T1_r )
src/mame/drivers/segaybd.c
r1591r1592
7777   /* assert the lines that are live, or clear everything if nothing is live */
7878   if (irq != 0)
7979   {
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);
8383      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50));
8484   }
8585   else
8686   {
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);
9090   }
9191}
9292
r1591r1592
203203
204204static void sound_cpu_irq(int state)
205205{
206   cpunum_set_input_line(3, 0, state);
206   cpunum_set_input_line(Machine, 3, 0, state);
207207}
208208
209209
210210static TIMER_CALLBACK( delayed_sound_data_w )
211211{
212212   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);
214214}
215215
216216
r1591r1592
223223
224224static READ8_HANDLER( sound_data_r )
225225{
226   cpunum_set_input_line(3, INPUT_LINE_NMI, CLEAR_LINE);
226   cpunum_set_input_line(Machine, 3, INPUT_LINE_NMI, CLEAR_LINE);
227227   return soundlatch_r(offset);
228228}
229229
r1591r1592
314314            */
315315         segaic16_set_display_enable(data & 0x80);
316316         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);
320320         break;
321321
322322      /* mute */
src/mame/drivers/shuuz.c
r1591r1592
3030 *
3131 *************************************/
3232
33static void update_interrupts(void)
33static void update_interrupts(running_machine *machine)
3434{
3535   int newstate = 0;
3636
r1591r1592
3838      newstate = 4;
3939
4040   if (newstate)
41      cpunum_set_input_line(0, newstate, ASSERT_LINE);
41      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4242   else
43      cpunum_set_input_line(0, 7, CLEAR_LINE);
43      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
4444}
4545
4646
src/mame/drivers/cclimber.c
r1591r1592
155155static WRITE8_HANDLER( swimmer_sh_soundlatch_w )
156156{
157157   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);
159159}
160160
161161
src/mame/drivers/xorworld.c
r1591r1592
195195{
196196   if (cpu_getiloops() == 0)
197197   {
198      cpunum_set_input_line(0, 2, HOLD_LINE);
198      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
199199   }
200200   else if (cpu_getiloops() % 2)
201201   {
202      cpunum_set_input_line(0, 6, HOLD_LINE);
202      cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
203203   }
204204}
205205
src/mame/drivers/speedspn.c
r1591r1592
103103static WRITE8_HANDLER(speedspn_sound_w)
104104{
105105   soundlatch_w(1,data);
106   cpunum_set_input_line(1,0,HOLD_LINE);
106   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
107107}
108108
109109static WRITE8_HANDLER( oki_banking_w )
src/mame/drivers/enigma2.c
r1591r1592
8585
8686static TIMER_CALLBACK( interrupt_clear_callback )
8787{
88   cpunum_set_input_line(0, 0, CLEAR_LINE);
88   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
8989}
9090
9191
r1591r1592
9898   int vpos = video_screen_get_vpos(0);
9999   UINT16 counter = vpos_to_vysnc_chain_counter(vpos);
100100   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);
102102
103103   /* set up for next interrupt */
104104   if (counter == INT_TRIGGER_COUNT_1)
r1591r1592
136136static MACHINE_RESET( enigma2 )
137137{
138138   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);
140140
141141   engima2_flip_screen = 0;
142142
r1591r1592
347347{
348348   /* clock sound latch shift register on rising edge of D2 */
349349   if (!(data & 0x04) && (last_sound_data & 0x04))
350   {
351350      sound_latch = (sound_latch << 1) | (~data & 0x01);
352   }
353351
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);
355353
356354   last_sound_data = data;
357355}
src/mame/drivers/cowrace.c
r1591r1592
4949static WRITE8_HANDLER( cowrace_soundlatch_w )
5050{
5151   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);
5353}
5454#endif
5555
src/mame/drivers/segaorun.c
r1591r1592
100100   { 0x35/2, 0x90000, 0x10000, 0xf00000,      ~0, segaic16_road_control_0_r, segaic16_road_control_0_w, NULL,                  "road control" },
101101   { 0x35/2, 0x80000, 0x01000, 0xf0f000,      ~0, MRA16_BANK10,              MWA16_BANK10,              &segaic16_roadram_0,   "road RAM" },
102102   { 0x35/2, 0x60000, 0x08000, 0xf18000,      ~0, MRA16_BANK11,              MWA16_BANK11,              &cpu1ram,              "CPU 1 RAM" },
103   { 0x35/2, 0x00000, 0x60000, 0xf00000,      ~0, MRA16_BANK12,              MWA16_ROM,                 &cpu1rom,              "CPU 1 ROM" },
103   { 0x35/2, 0x00000, 0x60000, 0xf00000,      ~0, MRA16_BANK12,              MWA16_UNMAP,               &cpu1rom,              "CPU 1 ROM" },
104104   { 0x31/2, 0x00000, 0x04000, 0xffc000,      ~0, misc_io_r,                 misc_io_w,                 NULL,                  "I/O space" },
105105   { 0x2d/2, 0x00000, 0x01000, 0xfff000,      ~0, MRA16_BANK13,              MWA16_BANK13,              &segaic16_spriteram_0, "object RAM" },
106106   { 0x29/2, 0x00000, 0x02000, 0xffe000,      ~0, MRA16_BANK14,              segaic16_paletteram_w,     &paletteram16,         "color RAM" },
107107   { 0x25/2, 0x00000, 0x10000, 0xfe0000,      ~0, MRA16_BANK15,              segaic16_tileram_0_w,      &segaic16_tileram_0,   "tile RAM" },
108108   { 0x25/2, 0x10000, 0x01000, 0xfef000,      ~0, MRA16_BANK16,              segaic16_textram_0_w,      &segaic16_textram_0,   "text RAM" },
109109   { 0x21/2, 0x60000, 0x08000, 0xf98000,      ~0, MRA16_BANK17,              MWA16_BANK17,              &workram,              "CPU 0 RAM" },
110   { 0x21/2, 0x00000, 0x60000, 0xf80000, 0x00000, MRA16_BANK18,              MWA16_ROM,                 NULL,                  "CPU 0 ROM" },
110   { 0x21/2, 0x00000, 0x60000, 0xf80000, 0x00000, MRA16_BANK18,              MWA16_UNMAP,               NULL,                  "CPU 0 ROM" },
111111   { 0 }
112112};
113113
r1591r1592
122122static TIMER_CALLBACK( delayed_sound_data_w )
123123{
124124   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);
126126}
127127
128128
r1591r1592
134134
135135static READ8_HANDLER( sound_data_r )
136136{
137   cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE);
137   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
138138   return soundlatch_r(offset);
139139}
140140
r1591r1592
172172 *
173173 *************************************/
174174
175static void update_main_irqs(void)
175static void update_main_irqs(running_machine *machine)
176176{
177177   int irq = 0;
178178
r1591r1592
185185   /* assert the lines that are live, or clear everything if nothing is live */
186186   if (irq != 0)
187187   {
188      cpunum_set_input_line(0, irq, ASSERT_LINE);
188      cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
189189      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
190190   }
191191   else
192      cpunum_set_input_line(0, 7, CLEAR_LINE);
192      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
193193}
194194
195195
r1591r1592
197197{
198198   /* set the IRQ2 line */
199199   irq2_state = 1;
200   update_main_irqs();
200   update_main_irqs(machine);
201201}
202202
203203
r1591r1592
229229      case 223:
230230         vblank_irq_state = 1;
231231         next_scanline = scanline + 1;
232         cpunum_set_input_line(1, 4, ASSERT_LINE);
232         cpunum_set_input_line(machine, 1, 4, ASSERT_LINE);
233233         break;
234234
235235      /* VBLANK turns off at the start of scanline 224 */
236236      case 224:
237237         vblank_irq_state = 0;
238238         next_scanline = 65;
239         cpunum_set_input_line(1, 4, CLEAR_LINE);
239         cpunum_set_input_line(machine, 1, 4, CLEAR_LINE);
240240         break;
241241   }
242242
243243   /* update IRQs on the main CPU */
244   update_main_irqs();
244   update_main_irqs(machine);
245245
246246   /* come back at the next targeted scanline */
247247   timer_set(video_screen_get_time_until_pos(0, next_scanline, 0), NULL, next_scanline, scanline_callback);
r1591r1592
257257
258258static void outrun_reset(void)
259259{
260   cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
260   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
261261}
262262
263263
r1591r1592
347347    */
348348   segaic16_set_display_enable(data & 0x20);
349349   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);
351351}
352352
353353
r1591r1592
481481         /* Output port:
482482                D0: Sound section reset (1= normal operation, 0= reset)
483483            */
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);
485485         return;
486486
487487      case 0x3000/2:
src/mame/drivers/gticlub.c
r1591r1592
7878
7979static void voodoo_vblank_0(int param)
8080{
81   cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
81   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
8282}
8383
8484static void voodoo_vblank_1(int param)
8585{
86   cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE);
86   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
8787}
8888
8989static VIDEO_START( hangplt )
r1591r1592
330330      {
331331         if (data & 0x80000000)   /* CG Board 1 IRQ Ack */
332332         {
333            cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE);
333            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
334334         }
335335         if (data & 0x40000000)   /* CG Board 0 IRQ Ack */
336336         {
337            cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE);
337            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
338338         }
339339
340340         adc1038_di_w((data >> 24) & 1);
r1591r1592
377377            // Thunder Hurricane breaks otherwise...
378378            if (mame_stricmp(Machine->gamedrv->name, "thunderh") != 0)
379379            {
380               cpunum_set_input_line(0, INPUT_LINE_IRQ2, ASSERT_LINE);
380               cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ2, ASSERT_LINE);
381381            }
382382         }
383383         break;
r1591r1592
455455static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 )
456456   AM_RANGE(0x00000000, 0x000fffff) AM_MIRROR(0x80000000) AM_RAM AM_BASE(&work_ram)      /* Work RAM */
457457   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(paletteram32_r, paletteram32_w) AM_BASE(&paletteram32)
458   AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_READWRITE(MRA32_RAM, paletteram32_w) AM_BASE(&paletteram32)
459459   AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w)
460460   AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w)
461461   AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)
r1591r1592
724724*/
725725static INTERRUPT_GEN( gticlub_vblank )
726726{
727   cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
727   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
728728}
729729
730730
r1591r1592
745745
746746static MACHINE_RESET( gticlub )
747747{
748   cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE);
748   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
749749}
750750
751751static MACHINE_DRIVER_START( gticlub )
r1591r1592
789789
790790static MACHINE_RESET( hangplt )
791791{
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);
794794}
795795
796796static MACHINE_DRIVER_START( hangplt )
r1591r1592
985985static void sound_irq_callback(int irq)
986986{
987987   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);
991989   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);
995991}
996992
997993static DRIVER_INIT(gticlub)
r1591r1592
10261022
10271023static DRIVER_INIT(slrasslt)
10281024{
1029   driver_init_gticlub(machine);
1025   DRIVER_INIT_CALL(gticlub);
10301026
10311027   // enable self-modifying code checks
10321028   cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_OPTIONS_CHECK_SELFMOD_CODE);
src/mame/drivers/cloak.c
r1591r1592
145145
146146static WRITE8_HANDLER( cloak_irq_reset_0_w )
147147{
148   cpunum_set_input_line(0, 0, CLEAR_LINE);
148   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
149149}
150150
151151static WRITE8_HANDLER( cloak_irq_reset_1_w )
152152{
153   cpunum_set_input_line(1, 0, CLEAR_LINE);
153   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
154154}
155155
156156static WRITE8_HANDLER( cloak_nvram_enable_w )
src/mame/drivers/mazerbla.c
r1591r1592
283283{
284284   zpu_int_vector &= ~2;   /* clear D1 on INTA (interrupt acknowledge) */
285285
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?) */
287287}
288288
289289static READ8_HANDLER( cfb_zpu_int_req_clr )
r1591r1592
292292
293293   /* clear the INT line when there are no more interrupt requests */
294294   if (zpu_int_vector==0xff)
295      cpunum_set_input_line(0, 0, CLEAR_LINE);
295      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
296296
297297   return 0;
298298}
r1591r1592
10781078   soundlatch = param;
10791079
10801080   /* 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);
10821082}
10831083
10841084
r1591r1592
11081108/* frequency is 14.318 MHz/16/16/16/16 */
11091109static INTERRUPT_GEN( sound_interrupt )
11101110{
1111   cpunum_set_input_line(1, 0, ASSERT_LINE);
1111   cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
11121112}
11131113
11141114static WRITE8_HANDLER( sound_int_clear_w )
11151115{
1116   cpunum_set_input_line(1, 0, CLEAR_LINE);
1116   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
11171117}
11181118static WRITE8_HANDLER( sound_nmi_clear_w )
11191119{
1120   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
1120   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
11211121}
11221122
11231123static WRITE8_HANDLER( gg_led_ctrl_w )
src/mame/drivers/foodf.c
r1591r1592
112112 *
113113 *************************************/
114114
115static void update_interrupts(void)
115static void update_interrupts(running_machine *machine)
116116{
117117   int newstate = 0;
118118
r1591r1592
122122      newstate |= 2;
123123
124124   if (newstate)
125      cpunum_set_input_line(0, newstate, ASSERT_LINE);
125      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
126126   else
127      cpunum_set_input_line(0, 7, CLEAR_LINE);
127      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
128128}
129129
130130
src/mame/drivers/namcona1.c
r1591r1592
10751075{
10761076//  logerror("mailbox_w_68k: %x @ %x\n", data, offset);
10771077
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);
10791079
10801080   COMBINE_DATA(&mcu_mailbox[offset%8]);
10811081}
r1591r1592
11931193      logerror("launching 68k, PC=%x\n", activecpu_get_pc());
11941194
11951195      // 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);
11971197   }
11981198
11991199   mcu_port4 = data;
r1591r1592
12721272// for games with the MCU emulated, the MCU boots the 68000.  don't allow it before that.
12731273static MACHINE_RESET( namcona1_mcu )
12741274{
1275   cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE);
1275   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE);
12761276
12771277   mcu_port5 = 1;
12781278}
r1591r1592
13151315   {
13161316      if( (namcona1_vreg[0x1a/2]&(1<<level))==0 )
13171317      {
1318         cpunum_set_input_line(0, level+1, HOLD_LINE);
1318         cpunum_set_input_line(machine, 0, level+1, HOLD_LINE);
13191319      }
13201320   }
13211321}
r1591r1592
13271327static INTERRUPT_GEN( mcu_interrupt )
13281328{
13291329   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);
13311331   else if (cpu_getiloops() == 1)
13321332   {
1333      cpunum_set_input_line(1, M37710_LINE_ADC, HOLD_LINE);
1333      cpunum_set_input_line(machine, 1, M37710_LINE_ADC, HOLD_LINE);
13341334   }
13351335}
13361336
src/mame/drivers/acefruit.c
r1591r1592
1313
1414#include "sidewndr.lh"
1515
16static void acefruit_update_irq( int vpos )
16static void acefruit_update_irq(running_machine *machine, int vpos )
1717{
1818   int col;
1919   int row = vpos / 8;
r1591r1592
2626      switch( color )
2727      {
2828      case 0x0c:
29         cpunum_set_input_line( 0, 0, HOLD_LINE );
29         cpunum_set_input_line(machine, 0, 0, HOLD_LINE );
3030         break;
3131      }
3232   }
r1591r1592
3939   int vpos = video_screen_get_vpos( 0 );
4040
4141   video_screen_update_partial( 0, vpos );
42   acefruit_update_irq( vpos );
42   acefruit_update_irq(machine, vpos );
4343
4444   vpos = ( ( vpos / 8 ) + 1 ) * 8;
4545
r1591r1592
5353
5454static INTERRUPT_GEN( acefruit_vblank )
5555{
56   cpunum_set_input_line( 0, 0, HOLD_LINE );
56   cpunum_set_input_line(machine, 0, 0, HOLD_LINE );
5757   timer_adjust( acefruit_refresh_timer, attotime_zero, 0, attotime_never );
5858}
5959
src/mame/drivers/dkong.c
r1591r1592
329329
330330static INTERRUPT_GEN( hunchbkd_interrupt )
331331{
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);
333333}
334334
335335/*************************************
r1591r1592
359359
360360   dkong_state *state = machine->driver_data;
361361
362   machine_start_dkong2b(machine);
362   MACHINE_START_CALL(dkong2b);
363363   dma8257_config(0, &hb_dma);
364364
365365   for (i=0;i<0x200;i++)
r1591r1592
377377{
378378   dkong_state *state = machine->driver_data;
379379
380   machine_start_dkong2b(machine);
380   MACHINE_START_CALL(dkong2b);
381381   state->hardware_type = HARDWARE_TRS02;
382382}
383383
r1591r1592
385385{
386386   dkong_state *state = machine->driver_data;
387387
388   machine_start_dkong2b(machine);
388   MACHINE_START_CALL(dkong2b);
389389   state->hardware_type = HARDWARE_TRS01;
390390}
391391
392392static MACHINE_START( dkong3 )
393393{
394   machine_start_dkong2b(machine);
394   MACHINE_START_CALL(dkong2b);
395395   z80dma_init(1);
396396   z80dma_config(0, &dk3_dma);
397397}
r1591r1592
415415   dkong_state *state = machine->driver_data;
416416   UINT8 *ROM = memory_region(REGION_CPU1);
417417
418   machine_reset_dkong(machine);
418   MACHINE_RESET_CALL(dkong);
419419
420420   /* The initial state of the counter is 0x08 */
421421   memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000);
r1591r1592
428428   dkong_state *state = machine->driver_data;
429429   UINT8 *ROM = memory_region(REGION_CPU1);
430430
431   machine_reset_dkong(machine);
431   MACHINE_RESET_CALL(dkong);
432432
433433   /* The initial state of the counter is 0x09 */
434434   memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000);
r1591r1592
697697{
698698   if (data & 1)
699699   {
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);
702702   }
703703   else
704704   {
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);
707707   }
708708}
709709
src/mame/drivers/sprint4.c
r1591r1592
115115
116116   /* NMI and watchdog are disabled during service mode */
117117
118   watchdog_enable(readinputport(0) & 0x40);
118   watchdog_enable(machine, readinputport(0) & 0x40);
119119
120120   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);
124122
125123   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, nmi_callback);
126124}
src/mame/drivers/metlclsh.c
r1591r1592
6363
6464static WRITE8_HANDLER( metlclsh_cause_irq )
6565{
66   cpunum_set_input_line(1,M6809_IRQ_LINE,ASSERT_LINE);
66   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
6767}
6868
6969static WRITE8_HANDLER( metlclsh_ack_nmi )
7070{
71   cpunum_set_input_line(0,INPUT_LINE_NMI,CLEAR_LINE);
71   cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,CLEAR_LINE);
7272}
7373
7474static ADDRESS_MAP_START( metlclsh_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r1591r1592
114114
115115static WRITE8_HANDLER( metlclsh_cause_nmi2 )
116116{
117   cpunum_set_input_line(0,INPUT_LINE_NMI,ASSERT_LINE);
117   cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,ASSERT_LINE);
118118}
119119
120120static WRITE8_HANDLER( metlclsh_ack_irq2 )
121121{
122   cpunum_set_input_line(1,M6809_IRQ_LINE,CLEAR_LINE);
122   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
123123}
124124
125125static WRITE8_HANDLER( metlclsh_ack_nmi2 )
126126{
127   cpunum_set_input_line(1,INPUT_LINE_NMI,CLEAR_LINE);
127   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,CLEAR_LINE);
128128}
129129
130130static WRITE8_HANDLER( metlclsh_flipscreen_w )
r1591r1592
288288
289289static void metlclsh_irqhandler(int linestate)
290290{
291   cpunum_set_input_line(0,M6809_IRQ_LINE,linestate);
291   cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,linestate);
292292}
293293
294294static const struct YM3526interface ym3526_interface =
r1591r1592
302302      return;
303303   /* generate NMI on coin insertion */
304304   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);
306306}
307307
308308static MACHINE_RESET( metlclsh )
src/mame/drivers/aliens.c
r1591r1592
2929static INTERRUPT_GEN( aliens_interrupt )
3030{
3131   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);
3333}
3434
3535static READ8_HANDLER( bankedram_r )
3636{
3737   if (palette_selected)
38      return paletteram_r(offset);
38      return paletteram[offset];
3939   else
4040      return ram[offset];
4141}
r1591r1592
7373static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
7474{
7575   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);
7777}
7878
7979static WRITE8_HANDLER( aliens_snd_bankswitch_w )
src/mame/drivers/88games.c
r1591r1592
6767
6868static WRITE8_HANDLER( k88games_sh_irqtrigger_w )
6969{
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);
7171}
7272
7373/* handle fake button for speed cheat for players 1 and 2 */
src/mame/drivers/ddenlovr.c
r1591r1592
184184
185185static VIDEO_START(mmpanic)
186186{
187   video_start_ddenlovr(machine);
187   VIDEO_START_CALL(ddenlovr);
188188
189189   extra_layers = 1;
190190}
191191
192192static VIDEO_START(hanakanz)
193193{
194   video_start_ddenlovr(machine);
194   VIDEO_START_CALL(ddenlovr);
195195
196196   ddenlovr_blit_rom_bits = 16;
197197   ddenlovr_blit_commands = hanakanz_commands;
r1591r1592
199199
200200static VIDEO_START(mjflove)
201201{
202   video_start_ddenlovr(machine);
202   VIDEO_START_CALL(ddenlovr);
203203
204204   ddenlovr_blit_commands = mjflove_commands;
205205}
r1591r1592
743743         }
744744
745745         if (irq_vector)
746         {
747746            /* 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);
750748         else
751749         {
752750            /* ddenlovr */
753751            if (ddenlovr_blitter_irq_enable)
754752            {
755753               ddenlovr_blitter_irq_flag = 1;
756               cpunum_set_input_line(0,1,HOLD_LINE);
754               cpunum_set_input_line(Machine, 0,1,HOLD_LINE);
757755            }
758756         }
759757         break;
r1591r1592
913911            #endif
914912         }
915913
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);
917915         break;
918916
919917      default:
r1591r1592
19671965static WRITE8_HANDLER( mmpanic_soundlatch_w )
19681966{
19691967   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);
19711969}
19721970
19731971static WRITE8_HANDLER( mmpanic_blitter_w )
r1591r1592
66216619      return;
66226620
66236621   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);
66256623   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);
66276625}
66286626
66296627/*
66306628static INTERRUPT_GEN( rtc_irq )
66316629{
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);
66336631}
66346632*/
66356633
r1591r1592
66996697      return;
67006698
67016699   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
67036701   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
67056703}
67066704
67076705static MACHINE_DRIVER_START( mmpanic )
r1591r1592
67696767      return;
67706768
67716769   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);
67736771   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);
67756773}
67766774
67776775static MACHINE_DRIVER_START( hanakanz )
r1591r1592
68426840      return;
68436841
68446842   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);
68466844   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);
68486846}
68496847
68506848
r1591r1592
69016899
69026900   switch( cpu_getiloops() )
69036901   {
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;
69066904   }
69076905}
69086906
69096907static INTERRUPT_GEN( rtc_nmi_irq )
69106908{
6911   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
6909   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
69126910}
69136911
69146912static const struct AY8910interface mjmyster_ay8910_interface =
r1591r1592
69546952      return;
69556953
69566954   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);
69586956   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);
69606958}
69616959
69626960static const struct AY8910interface hginga_ay8910_interface =
r1591r1592
70357033   {
70367034      case 0:
70377035         mjflove_irq_cause &= 1 << 5;
7038         cpunum_set_input_line(0, 0, HOLD_LINE);
7036         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
70397037         break;
70407038      case 1:
70417039         mjflove_irq_cause &= 1 << 6;
7042         cpunum_set_input_line(0, 0, HOLD_LINE);
7040         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
70437041         break;
70447042   }
70457043}
r1591r1592
70627060    0xee is vblank  */
70637061static INTERRUPT_GEN( hparadis_irq )
70647062{
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);
70667064}
70677065
70687066static MACHINE_DRIVER_START( hparadis )
src/mame/drivers/chinagat.c
r1591r1592
8585VIDEO_START( chinagat );
8686VIDEO_UPDATE( ddragon );
8787
88extern int technos_video_hw;
89extern int ddragon_scrollx_hi, ddragon_scrolly_hi;
88extern UINT8 technos_video_hw;
89extern UINT16 ddragon_scrollx_hi, ddragon_scrolly_hi;
9090extern UINT8 *ddragon_scrollx_lo;
9191extern UINT8 *ddragon_scrolly_lo;
9292extern UINT8 *ddragon_bgvideoram,*ddragon_fgvideoram;
r1591r1592
141141
142142static WRITE8_HANDLER( chinagat_sub_IRQ_w )
143143{
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 );
145145}
146146
147147static WRITE8_HANDLER( chinagat_cpu_sound_cmd_w )
148148{
149149   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 );
151151}
152152
153153static READ8_HANDLER( saiyugb1_mcu_command_r )
r1591r1592
457457GFXDECODE_END
458458
459459static 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 );
461461}
462462
463463static const struct YM2151interface ym2151_interface =
r1591r1592
475475
476476static INTERRUPT_GEN( chinagat_interrupt )
477477{
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 */
480480}
481481
482482/* This is only on the second bootleg board */
r1591r1592
492492static MACHINE_DRIVER_START( chinagat )
493493
494494   /* basic machine hardware */
495   MDRV_CPU_ADD(HD6309,12000000/8)      /* 1.5 MHz (12MHz oscillator ???) */
495   MDRV_CPU_ADD(HD6309,12000000/2)      /* 1.5 MHz (12MHz oscillator ???) */
496496   MDRV_CPU_PROGRAM_MAP(main_map,0)
497497   MDRV_CPU_VBLANK_INT(chinagat_interrupt,1)
498498
499   MDRV_CPU_ADD(HD6309,12000000/8)      /* 1.5 MHz (12MHz oscillator ???) */
499   MDRV_CPU_ADD(HD6309,12000000/2)      /* 1.5 MHz (12MHz oscillator ???) */
500500   MDRV_CPU_PROGRAM_MAP(sub_map,0)
501501
502502   MDRV_CPU_ADD(Z80, 3579545)   /* 3.579545 MHz */
r1591r1592
512512   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
513513   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
514514   MDRV_SCREEN_SIZE(32*8, 32*8)
515   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
515   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 29*8-1)
516516   MDRV_GFXDECODE(chinagat)
517517   MDRV_PALETTE_LENGTH(384)
518518
src/mame/drivers/kaneko16.c
r1591r1592
103103
104104static MACHINE_RESET( berlwall )
105105{
106   machine_reset_kaneko16(machine);
106   MACHINE_RESET_CALL(kaneko16);
107107
108108   kaneko16_sprite_type = 2;   // like type 0, but using 16 instead of 8 bytes
109109}
110110
111111static MACHINE_RESET( blazeon )
112112{
113   machine_reset_kaneko16(machine);
113   MACHINE_RESET_CALL(kaneko16);
114114
115115   kaneko16_sprite_xoffs = 0x10000 - 0x680;
116116   kaneko16_sprite_yoffs = 0x000;
r1591r1592
162162
163163static MACHINE_RESET( bakubrkr )
164164{
165   machine_reset_kaneko16(machine);
165   MACHINE_RESET_CALL(kaneko16);
166166
167167   kaneko16_priority.sprite[0] = 8;   // above all
168168   kaneko16_priority.sprite[1] = 8;   // above all
r1591r1592
174174
175175static MACHINE_RESET( gtmr )
176176{
177   machine_reset_kaneko16(machine);
177   MACHINE_RESET_CALL(kaneko16);
178178
179179   kaneko16_sprite_type = 1;
180180
r1591r1592
186186
187187static MACHINE_RESET( mgcrystl )
188188{
189   machine_reset_kaneko16(machine);
189   MACHINE_RESET_CALL(kaneko16);
190190/*
191191    Sx = Sprites with priority x, x = tiles with priority x,
192192    Sprites - Tiles Order:
r1591r1592
215215
216216static MACHINE_RESET( shogwarr )
217217{
218   machine_reset_kaneko16(machine);
218   MACHINE_RESET_CALL(kaneko16);
219219
220220   calc3_mcu_init();
221221}
r1591r1592
261261   if (ACCESSING_MSB)
262262   {
263263      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);
265265   }
266266}
267267
r1591r1592
17501750{
17511751   switch ( cpu_getiloops() )
17521752   {
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;
17561756   }
17571757}
17581758
r1591r1592
20862086{
20872087   switch ( cpu_getiloops() )
20882088   {
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;
20922092   }
20932093}
20942094
r1591r1592
32083208
32093209static DRIVER_INIT( shogwarr )
32103210{
3211   driver_init_kaneko16(machine);
3211   DRIVER_INIT_CALL(kaneko16);
32123212
32133213/*
32143214    ROM test at 2237e:
src/mame/drivers/dbz.c
r1591r1592
7676   switch (cpu_getiloops())
7777   {
7878      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);
8080         break;
8181
8282      case 1:
8383         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);
8585         break;
8686   }
8787}
r1591r1592
134134
135135static WRITE16_HANDLER( dbz_sound_cause_nmi )
136136{
137   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
137   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
138138}
139139
140140static void dbz_sound_irq(int irq)
141141{
142142   if (irq)
143      cpunum_set_input_line(1, 0, ASSERT_LINE);
143      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
144144   else
145      cpunum_set_input_line(1, 0, CLEAR_LINE);
145      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
146146}
147147
148148static ADDRESS_MAP_START( dbz_readmem, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/cybertnk.c
r1591r1592
301301      case 0:
302302         // sound data
303303         if (ACCESSING_LSB)
304            cpunum_set_input_line(2, 0, HOLD_LINE);
304            cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
305305         else
306306            LOG_UNKNOWN_WRITE
307307         break;
r1591r1592
542542{
543543   switch(cpu_getiloops())
544544   {
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;
547547   }
548548}
549549
r1591r1592
551551{
552552   switch(cpu_getiloops())
553553   {
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;
556556   }
557557}
558558
src/mame/drivers/wc90.c
r1591r1592
110110static WRITE8_HANDLER( wc90_sound_command_w )
111111{
112112   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);
114114}
115115
116116
r1591r1592
333333/* handler called by the 2608 emulator when the internal timers cause an IRQ */
334334static void irqhandler(int irq)
335335{
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);
337337}
338338
339339static const struct YM2608interface ym2608_interface =
src/mame/drivers/gauntlet.c
r1591r1592
145145 *
146146 *************************************/
147147
148static void update_interrupts(void)
148static void update_interrupts(running_machine *machine)
149149{
150150   int newstate = 0;
151151
r1591r1592
155155      newstate |= 6;
156156
157157   if (newstate)
158      cpunum_set_input_line(0, newstate, ASSERT_LINE);
158      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
159159   else
160      cpunum_set_input_line(0, 7, CLEAR_LINE);
160      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
161161}
162162
163163
r1591r1592
216216
217217      if ((oldword ^ sound_reset_val) & 1)
218218      {
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);
220220         atarigen_sound_reset();
221221      }
222222   }
src/mame/drivers/ms32.c
r1591r1592
272272static WRITE32_HANDLER( ms32_sound_w )
273273{
274274   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);
276276
277277   // give the Z80 time to respond
278278   cpu_spinuntil_time(ATTOTIME_IN_USEC(40));
r1591r1592
285285
286286static WRITE32_HANDLER( reset_sub_w )
287287{
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 ?
289289}
290290
291291
r1591r1592
12451245   for(i=15; i>=0 && !(irqreq & (1<<i)); i--);
12461246   irqreq &= ~(1<<i);
12471247   if(!irqreq)
1248      cpunum_set_input_line(0, 0, CLEAR_LINE);
1248      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
12491249   return i;
12501250}
12511251
12521252static void irq_init(void)
12531253{
12541254   irqreq = 0;
1255   cpunum_set_input_line(0, 0, CLEAR_LINE);
1255   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
12561256   cpunum_set_irq_callback(0, irq_callback);
12571257}
12581258
12591259static void irq_raise(int level)
12601260{
12611261   irqreq |= (1<<level);
1262   cpunum_set_input_line(0, 0, ASSERT_LINE);
1262   cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
12631263}
12641264
12651265static INTERRUPT_GEN(ms32_interrupt)
r1591r1592
13021302
13031303static READ8_HANDLER( latch_r )
13041304{
1305   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
1305   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
13061306   return soundlatch_r(0)^0xff;
13071307}
13081308
r1591r1592
21952195//  { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
21962196   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
21972197
2198   driver_init_ss92047_01(machine);
2198   DRIVER_INIT_CALL(ss92047_01);
21992199}
22002200
22012201static DRIVER_INIT (47pie2)
r1591r1592
22032203//  { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
22042204   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
22052205
2206   driver_init_ss92048_01(machine);
2206   DRIVER_INIT_CALL(ss92048_01);
22072207}
22082208
22092209static DRIVER_INIT (f1superb)
r1591r1592
22122212   UINT32 *pROM = (UINT32 *)memory_region(REGION_CPU1);
22132213   pROM[0x19d04/4]=0x167a021a; // bne->br  : sprite Y offset table is always copied to RAM
22142214#endif
2215   driver_init_ss92046_01(machine);
2215   DRIVER_INIT_CALL(ss92046_01);
22162216}
22172217
22182218/********** GAME DRIVERS **********/
src/mame/drivers/mpu4.c
r1591r1592
441441
442442///////////////////////////////////////////////////////////////////////////
443443
444static void cpu0_irq(int state)
444static void pia_cpu0_irq(int state)
445445{
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
446453   if (!serial_card_connected)
447454   {
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));
450457   }
451458   else
452459   {
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));
455462   }
456463}
457464
465
466static void ptm_cpu0_irq(int state)
467{
468   if (!serial_card_connected)
469   {
470      cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
471      LOG(("6809 int%d \n", state));
472   }
473   else
474   {
475      cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
476      LOG(("6809 fint%d \n", state));
477   }
478}
479
480
458481///////////////////////////////////////////////////////////////////////////
459482static WRITE8_HANDLER( bankswitch_w )
460483{
r1591r1592
490513   MPU4_MASTER_CLOCK/4,
491514   { 0,0,0 },
492515   { ic2_o1_callback, ic2_o2_callback, ic2_o3_callback },
493   cpu0_irq
516   ptm_cpu0_irq
494517};
495518
496519/***************************************************************************
r1591r1592
542565{
543566   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
544567   /*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
546569};
547570
548571/*---------------------------------------
r1591r1592
672695{
673696   /*inputs : A/B,CA/B1,CA/B2 */ 0, pia_ic4_portb_r, 0, 0, 0, 0,
674697   /*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
676699};
677700
678701//IC5
r1591r1592
768791{
769792   /*inputs : A/B,CA/B1,CA/B2 */ pia_ic5_porta_r, pia_ic5_portb_r, 0, 0, 0, 0,
770793   /*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
772795};
773796
774797//IC6
r1591r1592
826849{
827850   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
828851   /*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
830853};
831854
832855//IC7
r1591r1592
902925{
903926   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
904927   /*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
906929};
907930
908931static READ8_HANDLER( pia_ic8_porta_r )
r1591r1592
950973{
951974   /*inputs : A/B,CA/B1,CA/B2 */ pia_ic8_porta_r, 0, 0, 0, 0, 0,
952975   /*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
954977};
955978
956979
src/mame/drivers/skylncr.c
r1591r1592
419419// It runs in IM 0, thus needs an opcode on the data bus
420420static INTERRUPT_GEN( skylncr_vblank_interrupt )
421421{
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);
423423}
424424
425425static MACHINE_DRIVER_START( skylncr )
src/mame/drivers/darkseal.c
r1591r1592
4141      return;
4242    case 8: /* Sound CPU write */
4343      soundlatch_w(0,data & 0xff);
44      cpunum_set_input_line(1,0,HOLD_LINE);
44      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
4545       return;
4646     case 0xa: /* IRQ Ack (VBL) */
4747      return;
r1591r1592
275275
276276static void sound_irq(int state)
277277{
278   cpunum_set_input_line(1,1,state); /* IRQ 2 */
278   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
279279}
280280
281281static const struct YM2151interface ym2151_interface =
src/mame/drivers/20pacgal.c
r1591r1592
104104   int bit = data & 1;
105105   cpu_interrupt_enable(0,bit);
106106   if (!bit)
107      cpunum_set_input_line( 0, 0, CLEAR_LINE );
107      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE );
108108}
109109
110110static WRITE8_HANDLER( flipscreen_w )
src/mame/drivers/seicross.c
r1591r1592
8484static MACHINE_RESET( friskyt )
8585{
8686   /* 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);
8888}
8989
9090
r1591r1592
106106   if (((portb & 4) == 0) && (data & 4))
107107   {
108108      /* 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);
111111   }
112112
113113   /* other bits unknown */
r1591r1592
405405   MDRV_CPU_IO_MAP(main_portmap,0)
406406   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
407407
408   MDRV_CPU_ADD_TAG("mcu", NSC8105, 6000000/4)   /* ??? */
408   MDRV_CPU_ADD_TAG("mcu", NSC8105, 6000000)   /* ??? */
409409   MDRV_CPU_PROGRAM_MAP(mcu_nvram_map,0)
410410
411411   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/spbactn.c
r1591r1592
139139   if (ACCESSING_LSB)
140140   {
141141      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);
143143   }
144144}
145145
r1591r1592
343343
344344static void irqhandler(int linestate)
345345{
346   cpunum_set_input_line(1,0,linestate);
346   cpunum_set_input_line(Machine, 1,0,linestate);
347347}
348348
349349static const struct YM3812interface ym3812_interface =
src/mame/drivers/system16.c
r1591r1592
212212
213213static INTERRUPT_GEN( sys16_interrupt )
214214{
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 */
216216}
217217
218218
r1591r1592
261261   sample_buffer <<= 4;
262262   sample_select ^= 1;
263263   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);
265265}
266266
267267static const struct MSM5205interface tturfbl_msm5205_interface =
r1591r1592
398398   if( ACCESSING_LSB )
399399{
400400      soundlatch_w( 0,data&0xff );
401      cpunum_set_input_line( 1, 0, HOLD_LINE );
401      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
402402   }
403403}
404404
r1591r1592
407407   if( ACCESSING_LSB )
408408{
409409      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);
411411   }
412412}
413413
r1591r1592
653653
654654static DRIVER_INIT( bayrtbl1 )
655655{
656   machine_reset_sys16_onetime(machine);
656   MACHINE_RESET_CALL(sys16_onetime);
657657}
658658/***************************************************************************/
659659
r1591r1592
812812      0,2,0,0
813813   };
814814
815   machine_reset_sys16_onetime(machine);
815   MACHINE_RESET_CALL(sys16_onetime);
816816   sys16_video_config(dduxbl_update_proc, -0x48, bank);
817817}
818818/***************************************************************************/
r1591r1592
939939
940940static DRIVER_INIT( eswatbl )
941941{
942   machine_reset_sys16_onetime(machine);
942   MACHINE_RESET_CALL(sys16_onetime);
943943   sys16_rowscroll_scroll=0x8000;
944944   sys18_splittab_fg_x=&sys16_textram[0x0f80];
945945}
r1591r1592
10631063
10641064static DRIVER_INIT( fpointbl )
10651065{
1066   machine_reset_sys16_onetime(machine);
1066   MACHINE_RESET_CALL(sys16_onetime);
10671067   sys16_video_config(fpoint_update_proc, -0xb8, NULL);
10681068}
10691069/***************************************************************************/
r1591r1592
12321232   if( ACCESSING_MSB )
12331233{
12341234      soundlatch_w( 0,data>>8 );
1235      cpunum_set_input_line( 1, 0, HOLD_LINE );
1235      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
12361236   }
12371237}
12381238
r1591r1592
12971297
12981298static DRIVER_INIT( goldnabl )
12991299{
1300   machine_reset_sys16_onetime(machine);
1300   MACHINE_RESET_CALL(sys16_onetime);
13011301}
13021302
13031303/***************************************************************************/
r1591r1592
15101510
15111511static DRIVER_INIT( passsht )
15121512{
1513   machine_reset_sys16_onetime(machine);
1513   MACHINE_RESET_CALL(sys16_onetime);
15141514}
15151515
15161516static DRIVER_INIT( passht4b )
15171517{
1518   machine_reset_sys16_onetime(machine);
1518   MACHINE_RESET_CALL(sys16_onetime);
15191519}
15201520
15211521/***************************************************************************/
r1591r1592
17741774static DRIVER_INIT( shinobl )
17751775{
17761776   shinobl_kludge = 1;
1777   machine_reset_sys16_onetime(machine);
1777   MACHINE_RESET_CALL(sys16_onetime);
17781778}
17791779
17801780
r1591r1592
18571857
18581858static DRIVER_INIT( tetrisbl )
18591859{
1860   machine_reset_sys16_onetime(machine);
1860   MACHINE_RESET_CALL(sys16_onetime);
18611861}
18621862
18631863
r1591r1592
20632063{
20642064   UINT8 *mem;
20652065
2066   machine_reset_sys16_onetime(machine);
2066   MACHINE_RESET_CALL(sys16_onetime);
20672067
20682068   mem = memory_region(REGION_CPU2);
20692069   memcpy(mem, mem+0x10000, 0x8000);
r1591r1592
22252225
22262226static DRIVER_INIT( wb3bbl )
22272227{
2228   machine_reset_sys16_onetime(machine);
2228   MACHINE_RESET_CALL(sys16_onetime);
22292229}
22302230
22312231/***************************************************************************/
src/mame/drivers/deniam.c
r1591r1592
5656   if (ACCESSING_MSB)
5757   {
5858      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);
6060   }
6161}
6262
r1591r1592
308308{
309309   /* system 16c doesn't have the sound CPU */
310310   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);
312312}
313313
314314static const struct YM3812interface ym3812_interface =
src/mame/drivers/nyny.c
r1591r1592
7373
7474
7575
76#define MAIN_CPU_MASTER_CLOCK   (11200000)
76#define MAIN_CPU_MASTER_CLOCK   (XTAL_11_2MHz)
7777#define PIXEL_CLOCK            (MAIN_CPU_MASTER_CLOCK / 2)
7878#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)
8383
8484
8585static UINT8 *nyny_videoram_1;
r1591r1592
113113
114114static void main_cpu_irq(int state)
115115{
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);
117119}
118120
119121
120122static void main_cpu_firq(int state)
121123{
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);
123125}
124126
125127
r1591r1592
429431static WRITE8_HANDLER( audio_1_command_w )
430432{
431433   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);
433435}
434436
435437
436438static WRITE8_HANDLER( audio_1_answer_w )
437439{
438440   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);
440442}
441443
442444
r1591r1592
480482static WRITE8_HANDLER( audio_2_command_w )
481483{
482484   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);
484486}
485487
486488
src/mame/drivers/redalert.c
r1591r1592
11/***************************************************************************
22
3Irem Red Alert Driver
3    Irem Red Alert hardware
44
5Everything in this driver is guesswork and speculation.  If something
6seems 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)
77
8If you have any questions about how this driver works, don't hesitate to
9ask.  - Mike Balfour (mab22@po.cwru.edu)
10***************************************************************************/
8    ********************************************************************
9    IREM 'DEMONEYE-X' proto 1981
1110
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
1270#include "driver.h"
13#include "machine/6821pia.h"
14#include "sound/ay8910.h"
71#include "cpu/m6502/m6502.h"
72#include "redalert.h"
1573
16/* video/redalert.c */
17extern UINT8 *redalert_backram;
18extern UINT8 *redalert_spriteram1;
19extern UINT8 *redalert_spriteram2;
20extern UINT8 *redalert_spriteram3;
21extern UINT8 *redalert_characterram;
22extern UINT8 *redalert_characterram2;
23WRITE8_HANDLER( redalert_backram_w );
24WRITE8_HANDLER( redalert_spriteram1_w );
25WRITE8_HANDLER( redalert_spriteram2_w );
26WRITE8_HANDLER( redalert_spriteram3_w );
27WRITE8_HANDLER( redalert_spriteram4_w );
28WRITE8_HANDLER( redalert_characterram_w );
29WRITE8_HANDLER( redalert_characterram2_w );
30extern VIDEO_UPDATE( redalert );
31WRITE8_HANDLER( redalert_c040_w );
32WRITE8_HANDLER( demoneye_c040_w );
33WRITE8_HANDLER( redalert_backcolor_w );
3474
75#define MAIN_PCB_CLOCK      (XTAL_12_5MHz)
76#define MAIN_CPU_CLOCK      (MAIN_PCB_CLOCK / 16)
3577
36/* audio/redalert.c */
37WRITE8_HANDLER( redalert_c030_w );
38READ8_HANDLER( redalert_voicecommand_r );
39WRITE8_HANDLER( redalert_soundlatch_w );
40READ8_HANDLER( redalert_AY8910_A_r );
41WRITE8_HANDLER( redalert_AY8910_B_w );
42WRITE8_HANDLER( redalert_AY8910_w );
43READ8_HANDLER( redalert_sound_register_IC1_r );
44WRITE8_HANDLER( redalert_sound_register_IC2_w );
4578
4679
47static 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 */
58ADDRESS_MAP_END
80/*************************************
81 *
82 *  Interrupt generation
83 *
84 *************************************/
5985
60static 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)
75ADDRESS_MAP_END
86static 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);
7691
77static 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)
82ADDRESS_MAP_END
92   cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, ASSERT_LINE);
93}
8394
84static 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)
90ADDRESS_MAP_END
9195
92static 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? */
96ADDRESS_MAP_END
96static READ8_HANDLER( redalert_interrupt_clear_r )
97{
98   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, CLEAR_LINE);
9799
98static 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)
101ADDRESS_MAP_END
100   /* the result never seems to be actually used */
101   return video_screen_get_vpos(0);
102}
102103
103104
104static 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 */
115ADDRESS_MAP_END
105static WRITE8_HANDLER( redalert_interrupt_clear_w )
106{
107   redalert_interrupt_clear_r(0);
108}
116109
117static 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)
140ADDRESS_MAP_END
141110
142static 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
118static 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)
147132ADDRESS_MAP_END
148133
149static 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
135static 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)
154151ADDRESS_MAP_END
155152
156153
154
155/*************************************
156 *
157 *  Port definitions
158 *
159 *************************************/
160
157161static 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")
160164   PORT_DIPSETTING(    0x00, "3" )
161165   PORT_DIPSETTING(    0x01, "4" )
162166   PORT_DIPSETTING(    0x02, "5" )
163167   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")
165169   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
166170   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")
168172   PORT_DIPSETTING(    0x00, "5000" )
169173   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")
171175   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
172176   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )
173177   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
174178   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")
176180   PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
177181   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
178   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
182   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW:8" )
179183
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 */
189193
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 */
199203
200   PORT_START            /* Fake input for coins */
204   PORT_START_TAG("COIN")
201205   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 )
202209INPUT_PORTS_END
203210
204211
205212static INPUT_PORTS_START( demoneye )
206   PORT_START            /* DIP Switches */
213   PORT_START_TAG("C000")
207214   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
208215   PORT_DIPSETTING(    0x00, "3" )
209216   PORT_DIPSETTING(    0x01, "4" )
r1591r1592
227234   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
228235   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
229236
230   PORT_START            /* IN1 */
237   PORT_START_TAG("C010")
231238   PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
232239   PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
233240   PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
r1591r1592
237244   PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
238245   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */
239246
240   PORT_START            /* IN2  */
247   PORT_START_TAG("C020")
241248   PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
242249   PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */
243250   PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
r1591r1592
247254   PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
248255   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Meter */
249256
250   PORT_START            /* Fake input for coins */
257   PORT_START_TAG("COIN")
251258   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 )
252262INPUT_PORTS_END
253263
254264
255static 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};
265265
266static 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 *************************************/
276271
277static 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
288static 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 */
292GFXDECODE_END
293
294static 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 */
299GFXDECODE_END
300
301/* Arbitrary colortable */
302static 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
319static 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
335static 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
347static 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
355272static MACHINE_DRIVER_START( redalert )
356273
357274   /* 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)
361278
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
375279   /* 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)
383281
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)
393284MACHINE_DRIVER_END
394285
395286
396/* PIA 0, sound CPU */
397static 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
404static MACHINE_START( demoneye )
405{
406   pia_config(0, &pia_0_intf);
407}
408
409static MACHINE_RESET( demoneye )
410{
411   pia_reset();
412}
413
414287static MACHINE_DRIVER_START( demoneye )
415288
416289   /* 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)
420293
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
431294   /* 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)
439296
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)
452299MACHINE_DRIVER_END
453300
454/***************************************************************************
455301
456  Game ROMs
457302
458***************************************************************************/
303/*************************************
304 *
305 *  ROM definitions
306 *
307 *************************************/
459308
460309ROM_START( redalert )
461310   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) )
470318
471319   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) )
474321
475322   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) )
480327
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) )
483330ROM_END
484331
485332
486/********************************************************************
487IREM 'DEMONEYE-X' proto 1981
488
489proto sound board
490
4918910
4926821   8910
4936802  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
520sub 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
533333ROM_START( demoneye )
534334   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) )
542341
543342   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) )
546345
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 */
548350   ROM_LOAD( "demoneye.1a",  0x0000, 0x0200, CRC(d03488ea) SHA1(11027f502ad2a9255b2e5611ab2eee16ede1d704) )
549   ROM_LOAD( "demoneye.1a2", 0x0200, 0x0200, CRC(eaf5a66e) SHA1(d8ebe05ba5d75fbf6ad45f710e5bd27b6afad44b) )
550351ROM_END
551352
552GAME( 1981, redalert, 0, redalert, redalert, 0, ROT270, "Irem + GDI",   "Red Alert",  GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
553GAME( 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
361GAME( 1981, redalert, 0, redalert, redalert, 0, ROT270, "Irem + GDI", "Red Alert",  GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
362GAME( 1981, demoneye, 0, demoneye, demoneye, 0, ROT270, "Irem",       "Demoneye-X", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/pipeline.c
r1591r1592
287287
288288static void ctc0_interrupt(int state)
289289{
290   cpunum_set_input_line(1, 0, state);
290   cpunum_set_input_line(Machine, 1, 0, state);
291291}
292292
293293static z80ctc_interface ctc_intf =
src/mame/drivers/stadhero.c
r1591r1592
1616VIDEO_START( stadhero );
1717VIDEO_UPDATE( stadhero );
1818
19extern UINT16 *stadhero_pf1_data,*stadhero_pf2_data;
19extern UINT16 *stadhero_pf1_data;
20extern UINT16 *stadhero_pf2_control_0;
21extern UINT16 *stadhero_pf2_control_1;
2022
2123WRITE16_HANDLER( stadhero_pf1_data_w );
24READ16_HANDLER( stadhero_pf2_data_r );
2225WRITE16_HANDLER( stadhero_pf2_data_w );
23WRITE16_HANDLER( stadhero_pf2_control_0_w );
24WRITE16_HANDLER( stadhero_pf2_control_1_w );
2526
2627/******************************************************************************/
2728
r1591r1592
5152         break;
5253      case 6: /* 6502 sound cpu */
5354         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);
5556         break;
5657      default:
5758         logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",activecpu_get_pc(),data,0x30c010+offset);
r1591r1592
5960   }
6061}
6162
62static WRITE16_HANDLER( spriteram_mirror_w )
63{
64   spriteram16[offset]=data;
65}
6663
67static READ16_HANDLER( stadhero_pf1_data_r ) { return stadhero_pf1_data[offset]; }
68static READ16_HANDLER( stadhero_pf2_data_r ) { return stadhero_pf2_data[offset]; }
69
7064/******************************************************************************/
7165
72static 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 */
66static 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)
8076ADDRESS_MAP_END
8177
82static 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)
93ADDRESS_MAP_END
94
9578/******************************************************************************/
9679
9780static WRITE8_HANDLER( YM3812_w )
r1591r1592
118101   }
119102}
120103
121static 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)
126ADDRESS_MAP_END
127
128static ADDRESS_MAP_START( stadhero_s_writemem, ADDRESS_SPACE_PROGRAM, 8 )
129   AM_RANGE(0x0000, 0x05ff) AM_WRITE(MWA8_RAM)
104static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 )
105   AM_RANGE(0x0000, 0x05ff) AM_RAM
130106   AM_RANGE(0x0800, 0x0801) AM_WRITE(YM2203_w)
131107   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
134111ADDRESS_MAP_END
135112
136113/******************************************************************************/
r1591r1592
266243
267244static void irqhandler(int linestate)
268245{
269   cpunum_set_input_line(1,0,linestate);
246   cpunum_set_input_line(Machine, 1,0,linestate);
270247}
271248
272249static const struct YM3812interface ym3812_interface =
r1591r1592
280257
281258   /* basic machine hardware */
282259   MDRV_CPU_ADD(M68000, 10000000)
283   MDRV_CPU_PROGRAM_MAP(stadhero_readmem,stadhero_writemem)
260   MDRV_CPU_PROGRAM_MAP(main_map,0)
284261   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)/* VBL */
285262
286263   MDRV_CPU_ADD(M6502, 1500000)
287264   /* audio CPU */
288   MDRV_CPU_PROGRAM_MAP(stadhero_s_readmem,stadhero_s_writemem)
265   MDRV_CPU_PROGRAM_MAP(audio_map,0)
289266
290267   MDRV_SCREEN_REFRESH_RATE(58)
291268   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
src/mame/drivers/prehisle.c
r1591r1592
2929static WRITE16_HANDLER( prehisle_sound16_w )
3030{
3131   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);
3333}
3434
3535/*******************************************************************************/
r1591r1592
216216
217217static void irqhandler(int irq)
218218{
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);
220220}
221221
222222static const struct YM3812interface ym3812_interface =
src/mame/drivers/simpsons.c
r1591r1592
7070
7171static void sound_nmi_callback( int param )
7272{
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 );
7474
7575   nmi_enabled = 0;
7676}
r1591r1592
7878
7979static TIMER_CALLBACK( nmi_callback )
8080{
81   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
81   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
8282}
8383
8484static WRITE8_HANDLER( z80_arm_nmi_w )
8585{
8686//  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);
8888   timer_set(ATTOTIME_IN_USEC(25), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
8989}
9090
r1591r1592
256256static TIMER_CALLBACK( dmaend_callback )
257257{
258258   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);
260260}
261261
262262static INTERRUPT_GEN( simpsons_irq )
r1591r1592
270270   }
271271
272272   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);
274274}
275275
276276static MACHINE_DRIVER_START( simpsons )
src/mame/drivers/marvins.c
r1591r1592
110110{
111111   sound_cpu_busy = snk_sound_busy_bit;
112112   soundlatch_w(0, data);
113   cpunum_set_input_line(2, 0, HOLD_LINE);
113   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
114114}
115115
116116static READ8_HANDLER( sound_command_r )
r1591r1592
121121
122122static READ8_HANDLER( sound_nmi_ack_r )
123123{
124   cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE);
124   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
125125   return 0;
126126}
127127
src/mame/drivers/aladbl.c
r1591r1592
158158   // 220000 = writes to mcu? 330000 = reads?
159159   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x220000, 0x220001, 0, 0, aladbl_w);
160160   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x330000, 0x330001, 0, 0, aladbl_r);
161   driver_init_megadrij(machine);
161   DRIVER_INIT_CALL(megadrij);
162162}
163163
164164GAME( 1993, aladbl ,  0,   megadriv,    aladbl,       aladbl,  ROT0,   "bootleg / Sega", "Aladdin (bootleg of Japanese Megadrive version)", 0)
src/mame/drivers/wwfsstar.c
r1591r1592
144144static WRITE16_HANDLER ( wwfsstar_soundwrite )
145145{
146146   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 );
148148}
149149
150150static WRITE16_HANDLER( wwfsstar_flipscreen_w )
r1591r1592
155155static WRITE16_HANDLER( wwfsstar_irqack_w )
156156{
157157   if(offset == 0)
158      cpunum_set_input_line(0, 6, CLEAR_LINE);
158      cpunum_set_input_line(Machine, 0, 6, CLEAR_LINE);
159159
160160   else
161      cpunum_set_input_line(0, 5, CLEAR_LINE);
161      cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE);
162162}
163163
164164/*
r1591r1592
192192   else if (scanline==240)
193193   {
194194      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);
196196   }
197197
198198   /* An interrupt is generated every 16 scanlines */
199199   if (scanline%16 == 0)
200200   {
201201      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);
203203   }
204204}
205205
r1591r1592
344344
345345static void wwfsstar_ymirq_handler(int irq)
346346{
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 );
348348}
349349
350350static const struct YM2151interface ym2151_interface =
src/mame/drivers/model1.c
r1591r1592
710710   //  logerror("irq: raising %d\n", level);
711711   //  irq_status |= (1 << level);
712712   last_irq = level;
713   cpunum_set_input_line(0, 0, HOLD_LINE);
713   cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
714714}
715715
716716static int irq_callback(int irqline)
r1591r1592
733733
734734static void irq_init(void)
735735{
736   cpunum_set_input_line(0, 0, CLEAR_LINE);
736   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
737737   cpunum_set_irq_callback(0, irq_callback);
738738}
739739
r1591r1592
750750      // if the FIFO has something in it, signal the 68k too
751751      if (fifo_rptr != fifo_wptr)
752752      {
753         cpunum_set_input_line(1, 2, HOLD_LINE);
753         cpunum_set_input_line(machine, 1, 2, HOLD_LINE);
754754      }
755755   }
756756}
r1591r1592
879879   if (fifo_wptr >= FIFO_SIZE) fifo_wptr = 0;
880880
881881   // 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);
883883   // give the 68k time to reply
884884   cpu_spinuntil_time(ATTOTIME_IN_USEC(40));
885885}
src/mame/drivers/actfancr.c
r1591r1592
8484static WRITE8_HANDLER( actfancr_sound_w )
8585{
8686   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);
8888}
8989
9090/******************************************************************************/
r1591r1592
9696   AM_RANGE(0x100000, 0x1007ff) AM_READ(MRA8_RAM)
9797   AM_RANGE(0x130000, 0x130003) AM_READ(actfan_control_1_r)
9898   AM_RANGE(0x140000, 0x140001) AM_READ(actfan_control_0_r)
99   AM_RANGE(0x120000, 0x1205ff) AM_READ(paletteram_r)
99   AM_RANGE(0x120000, 0x1205ff) AM_READ(MRA8_RAM)
100100   AM_RANGE(0x1f0000, 0x1f3fff) AM_READ(MRA8_RAM)
101101ADDRESS_MAP_END
102102
r1591r1592
118118   AM_RANGE(0x044000, 0x045fff) AM_READ(actfancr_pf2_data_r)
119119   AM_RANGE(0x064000, 0x0647ff) AM_READ(actfancr_pf1_data_r)
120120   AM_RANGE(0x120000, 0x1207ff) AM_READ(MRA8_RAM)
121   AM_RANGE(0x130000, 0x1305ff) AM_READ(paletteram_r)
121   AM_RANGE(0x130000, 0x1305ff) AM_READ(MRA8_RAM)
122122   AM_RANGE(0x140000, 0x140001) AM_READ(MRA8_NOP) /* Value doesn't matter */
123123   AM_RANGE(0x1f0000, 0x1f3fff) AM_READ(MRA8_RAM)
124124   AM_RANGE(0x1ff000, 0x1ff001) AM_READ(triothep_control_r)
r1591r1592
377377
378378static void sound_irq(int linestate)
379379{
380   cpunum_set_input_line(1,0,linestate); /* IRQ */
380   cpunum_set_input_line(Machine, 1,0,linestate); /* IRQ */
381381}
382382
383383static const struct YM3812interface ym3812_interface =
r1591r1592
433433static MACHINE_DRIVER_START( triothep )
434434
435435   /* basic machine hardware */
436   MDRV_CPU_ADD(H6280,21477200/3) /* Should be accurate */
436   MDRV_CPU_ADD(H6280,XTAL_21_4772MHz/3) /* XIN=21.4772Mhz, verified on pcb */
437437   MDRV_CPU_PROGRAM_MAP(triothep_readmem,triothep_writemem)
438438   MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* VBL */
439439
440   MDRV_CPU_ADD(M6502, 1500000)
440   MDRV_CPU_ADD(M6502, XTAL_12MHz/8) /* verified on pcb */
441441   /* audio CPU */ /* Should be accurate */
442442   MDRV_CPU_PROGRAM_MAP(dec0_s_readmem,dec0_s_writemem)
443443
r1591r1592
458458   /* sound hardware */
459459   MDRV_SPEAKER_STANDARD_MONO("mono")
460460
461   MDRV_SOUND_ADD(YM2203, 1500000)
461   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/8) /* verified on pcb */
462462   MDRV_SOUND_ROUTE(0, "mono", 0.90)
463463   MDRV_SOUND_ROUTE(1, "mono", 0.90)
464464   MDRV_SOUND_ROUTE(2, "mono", 0.90)
465465   MDRV_SOUND_ROUTE(3, "mono", 0.50)
466466
467   MDRV_SOUND_ADD(YM3812, 3000000)
467   MDRV_SOUND_ADD(YM3812, XTAL_12MHz/4) /* verified on pcb */
468468   MDRV_SOUND_CONFIG(ym3812_interface)
469469   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
470470
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 */
473473   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85)
474474MACHINE_DRIVER_END
475475
src/mame/drivers/polepos.c
r1591r1592
326326      case 0x00:   /* IRQON */
327327         cpu_interrupt_enable(0,bit);
328328         if (!bit)
329            cpunum_set_input_line(0, 0, CLEAR_LINE);
329            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
330330         break;
331331
332332      case 0x01:   /* IOSEL */
r1591r1592
347347         break;
348348
349349      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);
351351         break;
352352
353353      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);
355355         break;
356356
357357      case 0x06:   /* SB0 */
r1591r1592
372372
373373   cpu_interrupt_enable(which,data);
374374   if (!data)
375      cpunum_set_input_line(which, 0, CLEAR_LINE);
375      cpunum_set_input_line(Machine, which, 0, CLEAR_LINE);
376376}
377377
378378
r1591r1592
16951695   /* note that the bootleg version doesn't need this custom IC; it has a hacked ROM in its place */
16961696   memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, polepos2_ic25_r);
16971697
1698   driver_init_polepos(machine);
1698   DRIVER_INIT_CALL(polepos);
16991699}
17001700
17011701
src/mame/drivers/taito_b.c
r1591r1592
211211
212212static TIMER_CALLBACK( rsaga2_interrupt2  )
213213{
214   cpunum_set_input_line(0,2,HOLD_LINE);
214   cpunum_set_input_line(machine, 0,2,HOLD_LINE);
215215}
216216
217217static INTERRUPT_GEN( rastansaga2_interrupt )
218218{
219219   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);
221221}
222222
223223
224224static TIMER_CALLBACK( crimec_interrupt3 )
225225{
226   cpunum_set_input_line(0,3,HOLD_LINE);
226   cpunum_set_input_line(machine, 0,3,HOLD_LINE);
227227}
228228
229229static INTERRUPT_GEN( crimec_interrupt )
230230{
231231   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);
233233}
234234
235235
236236static TIMER_CALLBACK( hitice_interrupt6 )
237237{
238   cpunum_set_input_line(0,6,HOLD_LINE);
238   cpunum_set_input_line(machine, 0,6,HOLD_LINE);
239239}
240240
241241static INTERRUPT_GEN( hitice_interrupt )
242242{
243243   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);
245245}
246246
247247
248248static TIMER_CALLBACK( rambo3_interrupt1 )
249249{
250   cpunum_set_input_line(0,1,HOLD_LINE);
250   cpunum_set_input_line(machine, 0,1,HOLD_LINE);
251251}
252252
253253static INTERRUPT_GEN( rambo3_interrupt )
254254{
255255   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);
257257}
258258
259259
260260static TIMER_CALLBACK( pbobble_interrupt5 )
261261{
262   cpunum_set_input_line(0,5,HOLD_LINE);
262   cpunum_set_input_line(machine, 0,5,HOLD_LINE);
263263}
264264
265265static INTERRUPT_GEN( pbobble_interrupt )
266266{
267267   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);
269269}
270270
271271static TIMER_CALLBACK( viofight_interrupt1 )
272272{
273   cpunum_set_input_line(0,1,HOLD_LINE);
273   cpunum_set_input_line(machine, 0,1,HOLD_LINE);
274274}
275275
276276static INTERRUPT_GEN( viofight_interrupt )
277277{
278278   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);
280280}
281281
282282static TIMER_CALLBACK( masterw_interrupt4 )
283283{
284   cpunum_set_input_line(0,4,HOLD_LINE);
284   cpunum_set_input_line(machine, 0,4,HOLD_LINE);
285285}
286286
287287static INTERRUPT_GEN( masterw_interrupt )
288288{
289289   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);
291291}
292292
293293static TIMER_CALLBACK( silentd_interrupt4 )
294294{
295   cpunum_set_input_line(0,4,HOLD_LINE);
295   cpunum_set_input_line(machine, 0,4,HOLD_LINE);
296296}
297297
298298static INTERRUPT_GEN( silentd_interrupt )
299299{
300300   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);
302302}
303303
304304static TIMER_CALLBACK( selfeena_interrupt4 )
305305{
306   cpunum_set_input_line(0,4,HOLD_LINE);
306   cpunum_set_input_line(machine, 0,4,HOLD_LINE);
307307}
308308
309309static INTERRUPT_GEN( selfeena_interrupt )
310310{
311311   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);
313313}
314314
315315static TIMER_CALLBACK( sbm_interrupt5 )//4
316316{
317   cpunum_set_input_line(0,5,HOLD_LINE);
317   cpunum_set_input_line(machine, 0,5,HOLD_LINE);
318318}
319319
320320static INTERRUPT_GEN( sbm_interrupt )//5
321321{
322322   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);
324324}
325325
326326
r1591r1592
25782578/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
25792579static void irqhandler(int irq)
25802580{
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);
25822582}
25832583
25842584static const struct YM2610interface ym2610_interface_rsaga2 =
src/mame/drivers/jackal.c
r1591r1592
2525#include "sound/2151intf.h"
2626
2727
28#define MASTER_CLOCK      XTAL_18_432MHz
29#define SOUND_CLOCK         XTAL_3_579545MHz
30
31
2832extern UINT8 *jackal_videoctrl;
2933
3034extern MACHINE_RESET( jackal );
r1591r1592
246250static INTERRUPT_GEN( jackal_interrupt )
247251{
248252   if (irq_enable)
249      cpunum_set_input_line(0, 0, HOLD_LINE);
253      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
250254}
251255
252256/* Machine Driver */
253257
254258static MACHINE_DRIVER_START( jackal )
255259   // basic machine hardware
256   MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) // verified on pcb
260   MDRV_CPU_ADD(M6809, MASTER_CLOCK/12) // verified on pcb
257261   MDRV_CPU_PROGRAM_MAP(master_map, 0)
258262   MDRV_CPU_VBLANK_INT(jackal_interrupt, 1)
259263
260   MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) // verified on pcb
264   MDRV_CPU_ADD(M6809, MASTER_CLOCK/12) // verified on pcb
261265   MDRV_CPU_PROGRAM_MAP(slave_map, 0)
262266
263267   MDRV_SCREEN_REFRESH_RATE(60)
264268   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
265   MDRV_INTERLEAVE(10)   // 10 CPU slices per frame - seems enough to keep the CPUs in sync
269   MDRV_INTERLEAVE(100)
266270
267271   MDRV_MACHINE_RESET(jackal)
268272
r1591r1592
282286   // sound hardware
283287   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
284288
285   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz) // verified on pcb
289   MDRV_SOUND_ADD(YM2151, SOUND_CLOCK) // verified on pcb
286290   MDRV_SOUND_ROUTE(0, "left", 0.50)
287291   MDRV_SOUND_ROUTE(1, "right", 0.50)
288292MACHINE_DRIVER_END
src/mame/drivers/tank8.c
r1591r1592
1313
1414void tank8_set_collision(int index)
1515{
16   cpunum_set_input_line(0, 0, ASSERT_LINE);
16   cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
1717
1818   collision_index = index;
1919}
r1591r1592
9595{
9696   collision_index &= ~0x3f;
9797
98   cpunum_set_input_line(0, 0, CLEAR_LINE);
98   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9999}
100100
101101static WRITE8_HANDLER( tank8_crash_w )
src/mame/drivers/viper.c
r1591r1592
700700
701701static DRIVER_INIT(vipercf)
702702{
703   driver_init_viper(machine);
703   DRIVER_INIT_CALL(viper);
704704
705705   memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_r );
706706   memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_w );
r1591r1592
710710
711711static DRIVER_INIT(ppp2nd)
712712{
713   driver_init_viper(machine);
713   DRIVER_INIT_CALL(viper);
714714
715715   /*
716716    backup_ram[0x0000] = 0x50;  // P
src/mame/drivers/paranoia.c
r1591r1592
138138   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
139139   MDRV_INTERLEAVE(1)
140140
141   MDRV_CPU_ADD(8085A, 18000000/6)
141   MDRV_CPU_ADD(8085A, 18000000/3)
142142   MDRV_CPU_PROGRAM_MAP(paranoia_8085_map,0)
143143   MDRV_CPU_IO_MAP(paranoia_8085_io_map,0)
144144
r1591r1592
182182
183183static DRIVER_INIT(paranoia)
184184{
185   driver_init_pce(machine);
185   DRIVER_INIT_CALL(pce);
186186};
187187
188188GAME( 1990, paranoia, 0, paranoia, paranoia, paranoia, ROT0, "Naxat Soft", "Paranoia", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
src/mame/drivers/mw8080bw.c
r1591r1592
882882   state_save_register_global(maze_tone_timing_state);
883883   state_save_register_func_postload(maze_update_discrete);
884884
885   machine_start_mw8080bw(machine);
885   MACHINE_START_CALL(mw8080bw);
886886}
887887
888888
r1591r1592
967967   /* setup for save states */
968968   state_save_register_global(rev_shift_res);
969969
970   machine_start_mw8080bw(machine);
970   MACHINE_START_CALL(mw8080bw);
971971}
972972
973973
r1591r1592
11671167   /* setup for save states */
11681168   state_save_register_global(desertgu_controller_select);
11691169
1170   machine_start_mw8080bw(machine);
1170   MACHINE_START_CALL(mw8080bw);
11711171}
11721172
11731173
r1591r1592
14931493   /* setup for save states */
14941494   state_save_register_global(rev_shift_res);
14951495
1496   machine_start_mw8080bw(machine);
1496   MACHINE_START_CALL(mw8080bw);
14971497}
14981498
14991499
r1591r1592
15851585   /* setup for save states */
15861586   state_save_register_global(rev_shift_res);
15871587
1588   machine_start_mw8080bw(machine);
1588   MACHINE_START_CALL(mw8080bw);
15891589}
15901590
15911591
r1591r1592
16821682   /* setup for save states */
16831683   state_save_register_global(clowns_controller_select);
16841684
1685   machine_start_mw8080bw(machine);
1685   MACHINE_START_CALL(mw8080bw);
16861686}
16871687
16881688
r1591r1592
20592059   state_save_register_global_array(spcenctr_trench_slope);
20602060   state_save_register_func_postload(adjust_strobe_timers);
20612061
2062   machine_start_mw8080bw(machine);
2062   MACHINE_START_CALL(mw8080bw);
20632063}
20642064
20652065
r1591r1592
22262226   /* setup for save states */
22272227   state_save_register_global(phantom2_cloud_counter);
22282228
2229   machine_start_mw8080bw(machine);
2229   MACHINE_START_CALL(mw8080bw);
22302230}
22312231
22322232
r1591r1592
24632463   /* setup for save states */
24642464   state_save_register_global(invaders_flip_screen);
24652465
2466   machine_start_mw8080bw(machine);
2466   MACHINE_START_CALL(mw8080bw);
24672467}
24682468
24692469
src/mame/drivers/namcos86.c
r1591r1592
265265
266266static WRITE8_HANDLER( int_ack1_w )
267267{
268   cpunum_set_input_line(0, 0, CLEAR_LINE);
268   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
269269}
270270
271271static WRITE8_HANDLER( int_ack2_w )
272272{
273   cpunum_set_input_line(1, 0, CLEAR_LINE);
273   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
274274}
275275
276276
r1591r1592
10711071   MDRV_CPU_PROGRAM_MAP(hopmappy_cpu2_map,0)
10721072   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
10731073
1074   MDRV_CPU_ADD_TAG("mcu", HD63701, 49152000/32)   /* or compatible 6808 with extra instructions */
1074   MDRV_CPU_ADD_TAG("mcu", HD63701, 49152000/8)   /* or compatible 6808 with extra instructions */
10751075   MDRV_CPU_PROGRAM_MAP(hopmappy_mcu_map,0)
10761076   MDRV_CPU_IO_MAP(mcu_port_map,0)
10771077   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)   /* ??? */
src/mame/drivers/suna8.c
r1591r1592
811811   AM_RANGE(0xc002, 0xc002) AM_READ(input_port_2_r               )   // DSW 1
812812   AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r               )   // DSW 2
813813   AM_RANGE(0xc080, 0xc080) AM_READ(input_port_4_r               )   // vblank?
814   AM_RANGE(0xc600, 0xc7ff) AM_READ(paletteram_r               )   // Palette (Banked??)
814   AM_RANGE(0xc600, 0xc7ff) AM_READ(MRA8_RAM                  )   // Palette (Banked??)
815815   AM_RANGE(0xc800, 0xdfff) AM_READ(MRA8_BANK2                  )   // RAM (Banked?)
816816   AM_RANGE(0xe000, 0xffff) AM_READ(suna8_banked_spriteram_r      )   // Sprites (Banked)
817817ADDRESS_MAP_END
r1591r1592
971971   AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r         )   // DSW 2
972972   AM_RANGE(0xc080, 0xc080) AM_READ(input_port_4_r         )   // Buttons
973973   AM_RANGE(0xc0a3, 0xc0a3) AM_READ(sparkman_c0a3_r         )   // ???
974   AM_RANGE(0xc600, 0xc7ff) AM_READ(paletteram_r            )   // Palette (Banked??)
974   AM_RANGE(0xc600, 0xc7ff) AM_READ(MRA8_RAM               )   // Palette (Banked??)
975975   AM_RANGE(0xc800, 0xdfff) AM_READ(MRA8_RAM               )   // RAM
976976   AM_RANGE(0xe000, 0xffff) AM_READ(suna8_banked_spriteram_r   )   // Sprites (Banked)
977977ADDRESS_MAP_END
r1591r1592
15191519
15201520static void soundirq(int state)
15211521{
1522   cpunum_set_input_line(1, 0, state);
1522   cpunum_set_input_line(Machine, 1, 0, state);
15231523}
15241524
15251525/* In games with only 2 CPUs, port A&B of the AY8910 are used
r1591r1592
16551655
16561656static INTERRUPT_GEN( brickzn_interrupt )
16571657{
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);
16601660}
16611661
16621662static MACHINE_DRIVER_START( brickzn )
r1591r1592
17281728{
17291729   if (cpu_getiloops())
17301730   {
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);
17321732   }
1733   else cpunum_set_input_line(0, 0, HOLD_LINE);
1733   else cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
17341734}
17351735
17361736static MACHINE_RESET( hardhea2 )
r1591r1592
18181818{
18191819   if (cpu_getiloops())
18201820   {
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);
18221822   }
1823   else cpunum_set_input_line(0, 0, HOLD_LINE);
1823   else cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
18241824}
18251825
18261826static MACHINE_DRIVER_START( sparkman )
src/mame/drivers/vaportra.c
r1591r1592
2929   /* Force synchronisation between CPUs with fake timer */
3030   timer_call_after_resynch(NULL, 0, NULL);
3131   soundlatch_w(0,data & 0xff);
32   cpunum_set_input_line(1,0,ASSERT_LINE);
32   cpunum_set_input_line(Machine, 1,0,ASSERT_LINE);
3333}
3434
3535static READ16_HANDLER( vaportra_control_r )
r1591r1592
9292
9393static READ8_HANDLER( vaportra_soundlatch_r )
9494{
95   cpunum_set_input_line(1,0,CLEAR_LINE);
95   cpunum_set_input_line(Machine, 1,0,CLEAR_LINE);
9696   return soundlatch_r(offset);
9797}
9898
r1591r1592
259259
260260static void sound_irq(int state)
261261{
262   cpunum_set_input_line(1,1,state); /* IRQ 2 */
262   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
263263}
264264
265265static const struct YM2151interface ym2151_interface =
src/mame/drivers/btime.c
r1591r1592
466466Interrupts are still used by the game, coin insertion generates an IRQ.
467467
468468***************************************************************************/
469static void btime_interrupt(int generated_interrupt, int active_high)
469static void btime_interrupt(running_machine *machine, int generated_interrupt, int active_high)
470470{
471471   static int coin;
472472   int port;
r1591r1592
479479      if (coin == 0)
480480      {
481481         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);
483483      }
484484   }
485485   else coin = 0;
r1591r1592
487487
488488static INTERRUPT_GEN( btime_irq_interrupt )
489489{
490   btime_interrupt(0, 1);
490   btime_interrupt(machine, 0, 1);
491491}
492492
493493static INTERRUPT_GEN( zoar_irq_interrupt )
494494{
495   btime_interrupt(0, 0);
495   btime_interrupt(machine, 0, 0);
496496}
497497
498498static INTERRUPT_GEN( btime_nmi_interrupt )
499499{
500   btime_interrupt(INPUT_LINE_NMI, 0);
500   btime_interrupt(machine, INPUT_LINE_NMI, 0);
501501}
502502
503503static WRITE8_HANDLER( sound_command_w )
504504{
505505   soundlatch_w(offset,data);
506   cpunum_set_input_line(1, 0, HOLD_LINE);
506   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
507507}
508508
509509#define COMMON_INPUTS\
src/mame/drivers/qdrmfgp.c
r1591r1592
279279   {
280280      case 0:
281281         if (control & 0x0001)
282            cpunum_set_input_line(0, 1, HOLD_LINE);
282            cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
283283         break;
284284
285285      case 1:
286286         /* trigger V-blank interrupt */
287287         if (control & 0x0004)
288            cpunum_set_input_line(0, 3, HOLD_LINE);
288            cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
289289         break;
290290   }
291291}
r1591r1592
295295   if (control & 0x0008)
296296   {
297297      if (state != CLEAR_LINE)
298         cpunum_set_input_line(0, 4, HOLD_LINE);
298         cpunum_set_input_line(Machine, 0, 4, HOLD_LINE);
299299      else
300         cpunum_set_input_line(0, 4, CLEAR_LINE);
300         cpunum_set_input_line(Machine, 0, 4, CLEAR_LINE);
301301   }
302302}
303303
r1591r1592
306306static TIMER_CALLBACK( gp2_timer_callback )
307307{
308308   if (control & 0x0004)
309      cpunum_set_input_line(0, 3, HOLD_LINE);
309      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
310310}
311311
312312static INTERRUPT_GEN(qdrmfgp2_interrupt)
313313{
314314   /* trigger V-blank interrupt */
315315   if (control & 0x0008)
316      cpunum_set_input_line(0, 4, HOLD_LINE);
316      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
317317}
318318
319319static void gp2_ide_interrupt(int state)
r1591r1592
325325         if (gp2_irq_control)
326326            gp2_irq_control = 0;
327327         else
328            cpunum_set_input_line(0, 5, HOLD_LINE);
328            cpunum_set_input_line(Machine, 0, 5, HOLD_LINE);
329329      } else {
330         cpunum_set_input_line(0, 5, CLEAR_LINE);
330         cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE);
331331      }
332332   }
333333}
r1591r1592
613613static void sound_irq(void)
614614{
615615   if (control & 0x0001)
616      cpunum_set_input_line(0, 1, HOLD_LINE);
616      cpunum_set_input_line(Machine, 0, 1, HOLD_LINE);
617617}
618618
619619static const struct K054539interface k054539_interface =
src/mame/drivers/cps1.c
r1591r1592
296296   /* Strider also has a IRQ4 handler. It is input port related, but the game */
297297   /* works without it (maybe it's used to multiplex controls). It is the */
298298   /* *only* game to have that. */
299   cpunum_set_input_line(0, 2, HOLD_LINE);
299   cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
300300}
301301
302302/********************************************************************
r1591r1592
315315
316316INTERRUPT_GEN( cps1_qsound_interrupt )
317317{
318   cpunum_set_input_line(cpunum, 2, HOLD_LINE);
318   cpunum_set_input_line(machine, cpunum, 2, HOLD_LINE);
319319}
320320
321321
r1591r1592
34413441
34423442static void cps1_irq_handler_mus(int irq)
34433443{
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);
34453445}
34463446
34473447static const struct YM2151interface ym2151_interface =
r1591r1592
72857285static DRIVER_INIT( wof )
72867286{
72877287   wof_decode();
7288   driver_init_cps1(machine);
7288   DRIVER_INIT_CALL(cps1);
72897289}
72907290
72917291static DRIVER_INIT( dino )
72927292{
72937293   dino_decode();
7294   driver_init_cps1(machine);
7294   DRIVER_INIT_CALL(cps1);
72957295}
72967296
72977297static DRIVER_INIT( punisher )
72987298{
72997299   punisher_decode();
7300   driver_init_cps1(machine);
7300   DRIVER_INIT_CALL(cps1);
73017301}
73027302
73037303static DRIVER_INIT( slammast )
73047304{
73057305   slammast_decode();
7306   driver_init_cps1(machine);
7306   DRIVER_INIT_CALL(cps1);
73077307}
73087308
73097309static DRIVER_INIT( pang3 )
r1591r1592
73277327      rom[A/2] = dst;
73287328   }
73297329
7330   driver_init_cps1(machine);
7330   DRIVER_INIT_CALL(cps1);
73317331}
73327332#endif
73337333
src/mame/drivers/yunsun16.c
r1591r1592
168168      if ((data&0xff)!=0x3a)
169169      {
170170      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);
172172      }
173173   }
174174}
r1591r1592
516516
517517static void soundirq(int state)
518518{
519   cpunum_set_input_line(1, 0, state);
519   cpunum_set_input_line(Machine, 1, 0, state);
520520}
521521
522522static const struct YM3812interface magicbub_ym3812_intf =
src/mame/drivers/gaelco3d.c
r1591r1592
178178 *
179179 *************************************/
180180
181static void init_machine_common(void)
181static MACHINE_RESET( common )
182182{
183183   UINT16 *src;
184184   int i;
r1591r1592
203203   memory_set_bank(1, 0);
204204
205205   /* 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);
207207
208208   /* Save state support */
209209   state_save_register_global(sound_data);
r1591r1592
219219
220220static MACHINE_RESET( gaelco3d )
221221{
222   init_machine_common();
222   MACHINE_RESET_CALL( common );
223223   tms_offset_xor = 0;
224224   state_save_register_global(tms_offset_xor);
225225}
r1591r1592
227227
228228static MACHINE_RESET( gaelco3d2 )
229229{
230   init_machine_common();
230   MACHINE_RESET_CALL( common );
231231   tms_offset_xor = BYTE_XOR_BE(0);
232232   state_save_register_global(tms_offset_xor);
233233}
r1591r1592
243243static INTERRUPT_GEN( vblank_gen )
244244{
245245   gaelco3d_render();
246   cpunum_set_input_line(0, 2, ASSERT_LINE);
246   cpunum_set_input_line(machine, 0, 2, ASSERT_LINE);
247247}
248248
249249
250250static WRITE16_HANDLER( irq_ack_w )
251251{
252   cpunum_set_input_line(0, 2, CLEAR_LINE);
252   cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE);
253253}
254254static WRITE32_HANDLER( irq_ack_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) irq_ack_w(offset, data >> 16, mem_mask >> 16); }
255255
r1591r1592
307307{
308308   logerror("delayed_sound_w(%02X)\n", param);
309309   sound_data = param;
310   cpunum_set_input_line(2, ADSP2115_IRQ2, ASSERT_LINE);
310   cpunum_set_input_line(machine, 2, ADSP2115_IRQ2, ASSERT_LINE);
311311}
312312
313313
r1591r1592
323323static READ16_HANDLER( sound_data_r )
324324{
325325   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);
327327   return sound_data;
328328}
329329
r1591r1592
426426static void iack_w(UINT8 state, offs_t addr)
427427{
428428   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);
430430}
431431
432432
r1591r1592
442442   /* this is set to 0 while data is uploaded, then set to $ffff after it is done */
443443   /* it does not ever appear to be touched after that */
444444   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);
446446}
447447static WRITE32_HANDLER( tms_reset_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_reset_w(offset, data, mem_mask); }
448448
r1591r1592
453453   /* done after uploading, and after modifying the comm area */
454454   logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
455455   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);
457457}
458458static WRITE32_HANDLER( tms_irq_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_irq_w(offset, data, mem_mask); }
459459
r1591r1592
584584      reg = adsp_ireg_base;
585585
586586      /* 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);
588588   }
589589
590590   /* store it */
src/mame/drivers/avalnche.c
r1591r1592
4343
4444static INTERRUPT_GEN( avalnche_interrupt )
4545{
46   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
46   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
4747}
4848
4949
src/mame/drivers/namcos11.c
r1591r1592
619619
620620      if( ( SHRAM( 0xbe88 ) & 0x0000ffff ) == 2 )
621621      {
622         cpunum_set_input_line( 0, INPUT_LINE_RESET, PULSE_LINE );
622         cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE );
623623         memset( namcos11_keycus, 0, namcos11_keycus_size );
624624
625625         SHRAM( 0xbe88 ) = ( SHRAM( 0xbe88 ) & 0xffff0000 );
r1591r1592
638638}
639639
640640static UINT32 m_n_bankoffset;
641static UINT32 m_p_n_bankoffset[ 8 ];
642641
643INLINE 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
649static 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
659642INLINE void bankswitch_rom8( int n_bank, int n_data )
660643{
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 ) );
663645}
664646
665647static WRITE32_HANDLER( bankswitch_rom32_w )
r1591r1592
693675INLINE void bankswitch_rom64( int n_bank, int n_data )
694676{
695677   /* 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 ) );
698679}
699680
700681static WRITE32_HANDLER( bankswitch_rom64_w )
r1591r1592
752733
753734static ADDRESS_MAP_START( namcos11_map, ADDRESS_SPACE_PROGRAM, 32 )
754735   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)
763736   AM_RANGE(0x1f800000, 0x1f8003ff) AM_RAM /* scratchpad */
764737   AM_RANGE(0x1f801000, 0x1f801007) AM_WRITENOP
765738   AM_RANGE(0x1f801008, 0x1f80100b) AM_RAM /* ?? */
r1591r1592
842815         }
843816         if( namcos11_config_table[ n_game ].n_daughterboard != 0 )
844817         {
845            int n_bank;
818            int bank;
846819
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++ )
849830            {
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 );
851833            }
852            bankswitch_update_all();
853834
854835            if( namcos11_config_table[ n_game ].n_daughterboard == 32 )
855836            {
r1591r1592
857838            }
858839            if( namcos11_config_table[ n_game ].n_daughterboard == 64 )
859840            {
841               m_n_bankoffset = 0;
860842               memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f080000, 0x1f080003, 0, 0, bankswitch_rom64_upper_w );
861843               memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom64_w );
862844               memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, MRA32_NOP );
845               state_save_register_global( m_n_bankoffset );
863846            }
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 );
867847         }
868848         else
869849         {
r1591r1592
889869{
890870   memset( namcos11_keycus, 0, namcos11_keycus_size );
891871   psx_machine_init();
892   bankswitch_update_all();
893872}
894873
895874NAMCO_C7X_HARDWARE
r1591r1592
13381317   ROM_LOAD16_BYTE( "gnb3vera.2k",  0x0200000, 0x100000, CRC(e6335e4e) SHA1(9067f05d848c1c8a88967a3c6552d2d24e80672b) )
13391318   ROM_LOAD16_BYTE( "gnb3vera.2f",  0x0200001, 0x100000, CRC(2bb7eb6d) SHA1(d1b1e031a28443140ac8652dfd77a65a042b67fc) )
13401319
1341   ROM_REGION32_LE( 0x1000000, REGION_USER2, 0 ) /* main data */
1320   ROM_REGION32_LE( 0x2000000, REGION_USER2, 0 ) /* main data */
13421321   ROM_LOAD16_BYTE( "gnb1prg0l.ic2", 0x000000, 0x800000, CRC(78746037) SHA1(d130ca1153a730e3c967945248f00662f9fab304) )
13431322   ROM_LOAD16_BYTE( "gnb1prg0u.ic5", 0x000001, 0x800000, CRC(697d3279) SHA1(40302780f7494d9413888b2d1da38bd14a9a444f) )
13441323
src/mame/drivers/itech8.c
r1591r1592
548548   if (machine->drv->cpu[0].type == CPU_M6809)
549549   {
550550      /* 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);
554554   }
555555
556556   /* handle the 68000 case */
r1591r1592
564564
565565      /* update it */
566566      if (level)
567         cpunum_set_input_line(0, level, ASSERT_LINE);
567         cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
568568      else
569         cpunum_set_input_line(0, 7, CLEAR_LINE);
569         cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
570570   }
571571}
572572
r1591r1592
591591static WRITE8_HANDLER( itech8_nmi_ack_w )
592592{
593593/* 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);*/
595595}
596596
597597
598598static void generate_sound_irq(int state)
599599{
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);
601601}
602602
603603
r1591r1592
618618
619619static MACHINE_START( sstrike )
620620{
621   machine_start_itech8(machine);
621   MACHINE_START_CALL(itech8);
622622
623623   /* we need to update behind the beam as well */
624624   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 32, behind_the_beam_update);
r1591r1592
779779static TIMER_CALLBACK( delayed_sound_data_w )
780780{
781781   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);
783783}
784784
785785
r1591r1592
802802
803803static READ8_HANDLER( sound_data_r )
804804{
805   cpunum_set_input_line(1, M6809_IRQ_LINE, CLEAR_LINE);
805   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
806806   return sound_data;
807807}
808808
r1591r1592
817817static void via_irq(int state)
818818{
819819   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);
821821   else
822      cpunum_set_input_line(1, M6809_FIRQ_LINE, CLEAR_LINE);
822      cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE);
823823}
824824
825825
src/mame/drivers/galaxian.c
r1591r1592
390390static WRITE8_HANDLER( checkman_sound_command_w )
391391{
392392   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);
394394}
395395
396396static READ8_HANDLER( drivfrcg_port0_r )
src/mame/drivers/othldrby.c
r1591r1592
9999   AM_RANGE(0x200000, 0x20000f) AM_READ(calendar_r)
100100   AM_RANGE(0x300004, 0x300007) AM_READ(othldrby_videoram_r)
101101   AM_RANGE(0x30000c, 0x30000d) AM_READ(pip)   // vblank?
102   AM_RANGE(0x400000, 0x400fff) AM_READ(paletteram16_word_r)
102   AM_RANGE(0x400000, 0x400fff) AM_READ(MRA16_RAM)
103103   AM_RANGE(0x600000, 0x600001) AM_READ(OKIM6295_status_0_lsb_r)
104104   AM_RANGE(0x700000, 0x700001) AM_READ(pap)   // scanline???
105105   AM_RANGE(0x700004, 0x700005) AM_READ(input_port_0_word_r)
src/mame/drivers/bbusters.c
r1591r1592
268268static WRITE16_HANDLER( sound_cpu_w )
269269{
270270   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);
272272}
273273
274274static READ16_HANDLER( mechatt_gun_r )
r1591r1592
639639
640640static void sound_irq( int irq )
641641{
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);
643643}
644644
645645static const struct YM2608interface ym2608_interface =
r1591r1592
673673static INTERRUPT_GEN( bbuster )
674674{
675675   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 */
677677   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 */
679679}
680680
681681static VIDEO_EOF( bbuster )
src/mame/drivers/gstriker.c
r1591r1592
172172   U17-20    ?                 YM2610
173173                   12   Z80
174174
175Frequencies: 68k is XTAL_32MHZ/2
176             z80 is XTAL_20MHz/4
175177
176178******************************************************************************/
177179
r1591r1592
204206   {
205207      pending_command = 1;
206208      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);
208210   }
209211}
210212
r1591r1592
271273static void gs_ym2610_irq(int irq)
272274{
273275   if (irq)
274      cpunum_set_input_line(1, 0, ASSERT_LINE);
276      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
275277   else
276      cpunum_set_input_line(1, 0, CLEAR_LINE);
278      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
277279}
278280
279281static const struct YM2610interface ym2610_interface =
src/mame/drivers/snk.c
r1591r1592
231231static const UINT32 dial_8_gray[8]   = { 0x0a,0x08,0x0c,0x04,0x05,0x01,0x03,0x0f };
232232
233233// see IRQ notes in drivers\marvins.c
234static TIMER_CALLBACK( irq_trigger_callback ) { cpunum_set_input_line(param, 0, HOLD_LINE); }
234static TIMER_CALLBACK( irq_trigger_callback ) { cpunum_set_input_line(machine, param, 0, HOLD_LINE); }
235235
236236INTERRUPT_GEN( snk_irq_AB )
237237{
238   cpunum_set_input_line(0, 0, HOLD_LINE);
238   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
239239   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 1, irq_trigger_callback);
240240}
241241
242242INTERRUPT_GEN( snk_irq_BA )
243243{
244   cpunum_set_input_line(1, 0, HOLD_LINE);
244   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
245245   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 0, irq_trigger_callback);
246246}
247247
248248// NMI handshakes between CPUs are determined to be much simpler
249READ8_HANDLER ( snk_cpuA_nmi_trigger_r ) { cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE); return 0; }
250WRITE8_HANDLER( snk_cpuA_nmi_ack_w ) { cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE); }
249READ8_HANDLER ( snk_cpuA_nmi_trigger_r ) { cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE); return 0; }
250WRITE8_HANDLER( snk_cpuA_nmi_ack_w ) { cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); }
251251
252READ8_HANDLER ( snk_cpuB_nmi_trigger_r ) { cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE); return 0; }
253WRITE8_HANDLER( snk_cpuB_nmi_ack_w ) { cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE); }
252READ8_HANDLER ( snk_cpuB_nmi_trigger_r ) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); return 0; }
253WRITE8_HANDLER( snk_cpuB_nmi_ack_w ) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); }
254254
255255/*********************************************************************/
256256
src/mame/drivers/hyprduel.c
r1591r1592
9696{
9797   int irq = requested_int & ~*hypr_irq_enable;
9898
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);
100100}
101101
102102static READ16_HANDLER( hyprduel_irq_cause_r )
r1591r1592
127127      {
128128         if (pc != 0x95f2)
129129         {
130            cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
130            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
131131            subcpu_resetline = 1;
132132         } else {
133            cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
133            cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
134134            subcpu_resetline = -1;
135135         }
136136      }
137137   } else {
138138      if (subcpu_resetline == 1 && (data != 0x0c))
139139      {
140         cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
140         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
141141         subcpu_resetline = 0;
142142         if (pc == 0xbb0 || pc == 0x9d30 || pc == 0xb19c)
143143            cpu_spinuntil_time(ATTOTIME_IN_USEC(15000));      /* sync semaphore */
144144      }
145145      else if (subcpu_resetline == -1)
146146      {
147         cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE);
147         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
148148         subcpu_resetline = 0;
149149      }
150150   }
r1591r1592
182182static TIMER_CALLBACK( vblank_end_callback )
183183{
184184   requested_int &= ~param;
185   cpunum_set_input_line(1, 2, HOLD_LINE);
185   cpunum_set_input_line(machine, 1, 2, HOLD_LINE);
186186}
187187
188188static INTERRUPT_GEN( hyprduel_interrupt )
r1591r1592
193193   {
194194      requested_int |= 0x01;      /* vblank */
195195      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);
198198      /* the duration is a guess */
199199      timer_set(ATTOTIME_IN_USEC(2500), NULL, 0x20, vblank_end_callback);
200200      rastersplit = 0;
r1591r1592
209209static MACHINE_RESET( hyprduel )
210210{
211211   /* 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);
213213   subcpu_resetline = 1;
214214}
215215
r1591r1592
692692
693693static void sound_irq(int state)
694694{
695   cpunum_set_input_line(1, 1, HOLD_LINE);
695   cpunum_set_input_line(Machine, 1, 1, HOLD_LINE);
696696}
697697
698698static const struct YM2151interface ym2151_interface =
src/mame/drivers/arcadecl.c
r1591r1592
8181 *
8282 *************************************/
8383
84static void update_interrupts(void)
84static void update_interrupts(running_machine *machine)
8585{
8686   int newstate = 0;
8787
r1591r1592
8989      newstate = 4;
9090
9191   if (newstate)
92      cpunum_set_input_line(0, newstate, ASSERT_LINE);
92      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
9393   else
94      cpunum_set_input_line(0, 7, CLEAR_LINE);
94      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
9595}
9696
9797
src/mame/drivers/namconb1.c
r1591r1592
296296{
297297   int irqlevel = GetCPURegister(0x04)>>4;
298298   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);
300300}
301301
302302static TIMER_CALLBACK( namconb2_TriggerPOSIRQ )
303303{
304304   int irqlevel = GetCPURegister(0x02);
305305   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);
307307} /* namconb2_TriggerPOSIRQ */
308308
309309static INTERRUPT_GEN( namconb2_interrupt )
r1591r1592
339339     */
340340   int scanline = (paletteram32[0x1808/4]&0xffff)-32;
341341   int irqlevel = GetCPURegister(0x00);
342   cpunum_set_input_line( 0, irqlevel, HOLD_LINE);
342   cpunum_set_input_line(machine, 0, irqlevel, HOLD_LINE);
343343
344344   if( scanline<0 )
345345   {
r1591r1592
388388     */
389389   int scanline = (paletteram32[0x1808/4]&0xffff)-32;
390390   int irqlevel = GetCPURegister(0x04)&0xf;
391   cpunum_set_input_line( 0, irqlevel, HOLD_LINE);
391   cpunum_set_input_line(machine, 0, irqlevel, HOLD_LINE);
392392   if( scanline<0 )
393393   {
394394      scanline = 0;
src/mame/drivers/flstory.c
r1591r1592
8383
8484static TIMER_CALLBACK( nmi_callback )
8585{
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);
8787   else pending_nmi = 1;
8888}
8989
r1591r1592
104104   sound_nmi_enable = 1;
105105   if (pending_nmi)
106106   {
107      cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
107      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
108108      pending_nmi = 0;
109109   }
110110}
src/mame/drivers/suprslam.c
r1591r1592
106106   {
107107      pending_command = 1;
108108      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);
110110   }
111111}
112112
r1591r1592
313313
314314static void irqhandler(int irq)
315315{
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);
317317}
318318
319319static const struct YM2610interface ym2610_interface =
src/mame/drivers/atetris.c
r1591r1592
8080   int scanline = param;
8181
8282   /* 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);
8484
8585   /* set the next timer */
8686   scanline += 32;
r1591r1592
9292
9393static WRITE8_HANDLER( irq_ack_w )
9494{
95   cpunum_set_input_line(0, 0, CLEAR_LINE);
95   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9696}
9797
9898
src/mame/drivers/cosmic.c
r1591r1592
191191       if ((input_port_3_r(0) & 0xc0) != 0xc0)
192192           panic_sound_output_w(17,1);
193193
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 */
195195    }
196196    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 */
200198}
201199
202200static INTERRUPT_GEN( cosmica_interrupt )
r1591r1592
206204    if (pixel_clock == 0)
207205    {
208206      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);
210208    }
211209}
212210
r1591r1592
220218    as I have no Cosmic Guerilla console :-) . */
221219
222220   if ((readinputport(2) & 1)) /* Coin */
223   {
224221      /* 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);
227223   else
228   {
229      cpunum_set_input_line(0, 0, CLEAR_LINE);
230   }
224      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
231225}
232226
233227static INTERRUPT_GEN( magspot2_interrupt )
234228{
235229   /* Coin 1 causes an IRQ, Coin 2 an NMI */
236230   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);
240232   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);
244234}
245235
246236static INTERRUPT_GEN( nomnlnd_interrupt )
247237{
248238   /* Coin causes an NMI */
249239   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);
253241}
254242
255243
src/mame/drivers/sangho.c
r1591r1592
213213
214214static void msx_vdp_interrupt(int i)
215215{
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));
217217}
218218
219219static INTERRUPT_GEN( sangho_interrupt )
src/mame/drivers/shaolins.c
r1591r1592
2525
2626static INTERRUPT_GEN( shaolins_interrupt )
2727{
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);
2929   else if (cpu_getiloops() % 2)
3030   {
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);
3232   }
3333}
3434
r1591r1592
217217static MACHINE_DRIVER_START( shaolins )
218218
219219   /* basic machine hardware */
220   MDRV_CPU_ADD(M6809, 1250000)        /* 1.25 MHz */
220   MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12)        /* verified on pcb */
221221   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
222222   MDRV_CPU_VBLANK_INT(shaolins_interrupt,16)   /* 1 IRQ + 8 NMI */
223223
r1591r1592
240240   /* sound hardware */
241241   MDRV_SPEAKER_STANDARD_MONO("mono")
242242
243   MDRV_SOUND_ADD(SN76496, 1536000)
243   MDRV_SOUND_ADD(SN76496, XTAL_18_432MHz/12)        /* verified on pcb */
244244   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
245245
246   MDRV_SOUND_ADD(SN76496, 3072000)
246   MDRV_SOUND_ADD(SN76496, XTAL_18_432MHz/6)        /* verified on pcb */
247247   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
248248MACHINE_DRIVER_END
249249
src/mame/drivers/model2.c
r1591r1592
239239         sharc_set_flag_input(1, ASSERT_LINE);
240240         cpuintrf_pop_context();
241241
242         //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, ASSERT_LINE);
242         //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
243243      }
244244      else
245245      {
r1591r1592
247247         sharc_set_flag_input(1, CLEAR_LINE);
248248         cpuintrf_pop_context();
249249
250         //cpunum_set_input_line(2, SHARC_INPUT_FLAG1, CLEAR_LINE);
250         //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE);
251251      }
252252   }
253253}
r1591r1592
256256
257257static NVRAM_HANDLER( model2 )
258258{
259   nvram_handler_93C46(machine, file, read_or_write);
259   NVRAM_HANDLER_CALL(93C46);
260260
261261   if (read_or_write)
262262   {
r1591r1592
313313   model2_intreq |= (1<<bit);
314314   if (model2_intena & (1<<bit))
315315   {
316      cpunum_set_input_line(0, I960_IRQ2, ASSERT_LINE);
316      cpunum_set_input_line(Machine, 0, I960_IRQ2, ASSERT_LINE);
317317   }
318318
319319   model2_timervals[tnum] = 0;
r1591r1592
355355
356356static MACHINE_RESET(model2o)
357357{
358   machine_reset_model2_common(machine);
358   MACHINE_RESET_CALL(model2_common);
359359
360360   // 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);
362362
363363   dsp_type = DSP_TYPE_TGP;
364364}
r1591r1592
374374
375375static MACHINE_RESET(model2)
376376{
377   machine_reset_model2_common(machine);
378   machine_reset_model2_scsp(machine);
377   MACHINE_RESET_CALL(model2_common);
378   MACHINE_RESET_CALL(model2_scsp);
379379
380380   // 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);
382382
383383   dsp_type = DSP_TYPE_TGP;
384384}
385385
386386static MACHINE_RESET(model2b)
387387{
388   machine_reset_model2_common(machine);
389   machine_reset_model2_scsp(machine);
388   MACHINE_RESET_CALL(model2_common);
389   MACHINE_RESET_CALL(model2_scsp);
390390
391   cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE);
391   cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE);
392392
393393   // 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);
395395   // 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);
397397
398398   dsp_type = DSP_TYPE_SHARC;
399399}
400400
401401static MACHINE_RESET(model2c)
402402{
403   machine_reset_model2_common(machine);
404   machine_reset_model2_scsp(machine);
403   MACHINE_RESET_CALL(model2_common);
404   MACHINE_RESET_CALL(model2_scsp);
405405
406406   dsp_type = DSP_TYPE_TGPX4;
407407}
r1591r1592
529529         logerror("Boot copro, %d dwords\n", model2_coprocnt);
530530         if (dsp_type != DSP_TYPE_TGPX4)
531531         {
532            cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE);
532            cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
533533         }
534534      }
535535   }
r1591r1592
658658        else
659659        {
660660            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);
662662            //cpu_spinuntil_time(ATTOTIME_IN_USEC(1000));       // Give the SHARC enough time to boot itself
663663        }
664664    }
r1591r1592
915915
916916   to_68k = data;
917917
918   cpunum_set_input_line(1, 2, HOLD_LINE);
918   cpunum_set_input_line(Machine, 1, 2, HOLD_LINE);
919919
920920   // give the 68k time to notice
921921   cpu_spinuntil_time(ATTOTIME_IN_USEC(40));
r1591r1592
15271527         model2_intreq |= (1<<10);
15281528         if (model2_intena & (1<<10))
15291529         {
1530            cpunum_set_input_line(0, I960_IRQ3, ASSERT_LINE);
1530            cpunum_set_input_line(machine, 0, I960_IRQ3, ASSERT_LINE);
15311531         }
15321532         break;
15331533      case 1:
15341534         model2_intreq |= (1<<0);
15351535         if (model2_intena & (1<<0))
15361536         {
1537            cpunum_set_input_line(0, I960_IRQ0, ASSERT_LINE);
1537            cpunum_set_input_line(machine, 0, I960_IRQ0, ASSERT_LINE);
15381538         }
15391539         break;
15401540   }
r1591r1592
15471547      case 0:
15481548         model2_intreq |= (1<<10);
15491549         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);
15511551         break;
15521552      case 1:
15531553         model2_intreq |= (1<<2);
15541554         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);
15561556
15571557         break;
15581558      case 2:
15591559         model2_intreq |= (1<<0);
15601560         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);
15621562         break;
15631563   }
15641564}
r1591r1592
16911691   if (irq > 0)
16921692   {
16931693      scsp_last_line = irq;
1694      cpunum_set_input_line(1, irq, PULSE_LINE);
1694      cpunum_set_input_line(Machine, 1, irq, PULSE_LINE);
16951695   }
16961696}
16971697
src/mame/drivers/bmcbowl.c
r1591r1592
486486static INTERRUPT_GEN( bmc_interrupt )
487487{
488488   if (cpu_getiloops())
489      cpunum_set_input_line(0, 4, HOLD_LINE);
489      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
490490   else
491      cpunum_set_input_line(0, 2, HOLD_LINE);
491      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
492492}
493493
494494static MACHINE_DRIVER_START( bmcbowl )
src/mame/drivers/ataxx.c
r1591r1592
826826   leland_rotate_memory(1);
827827
828828   /* 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));
831831
832832   /* set up additional input ports */
833833   memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r);
src/mame/drivers/sshangha.c
r1591r1592
8282
8383   if (offset == (0x260 >> 1)) {
8484      //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);
8686   }
8787}
8888
8989static WRITE16_HANDLER( sshangha_sound_w )
9090{
9191   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);
9393}
9494
9595/* Protection/IO chip 146 */
r1591r1592
328328
329329static void irqhandler(int state)
330330{
331   cpunum_set_input_line(1,0,state);
331   cpunum_set_input_line(Machine, 1,0,state);
332332}
333333
334334static const struct YM2203interface ym2203_interface =
src/mame/drivers/wiping.c
r1591r1592
8686static WRITE8_HANDLER( subcpu_reset_w )
8787{
8888   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);
9090   else
91      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
91      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
9292}
9393
9494
src/mame/drivers/kyugo.c
r1591r1592
4545
4646WRITE8_HANDLER( kyugo_sub_cpu_control_w )
4747{
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);
4949}
5050
5151
src/mame/drivers/lazercmd.c
r1591r1592
248248   if( ++timer_count >= 64*128 ) {
249249      timer_count = 0;
250250      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 );
252252   }
253253}
254254
src/mame/drivers/popeye.c
r1591r1592
4242{
4343   /* NMIs are enabled by the I register?? How can that be? */
4444   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);
4646}
4747
4848
src/mame/drivers/blockade.c
r1591r1592
7070   if ((input_port_0_r(0) & 0x80) == 0)
7171   {
7272      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);
7474   }
7575}
7676
src/mame/drivers/compgolf.c
r1591r1592
195195
196196static void sound_irq(int linestate)
197197{
198   cpunum_set_input_line(0,0,linestate);
198   cpunum_set_input_line(Machine, 0,0,linestate);
199199}
200200
201201static const struct YM2203interface ym2203_interface =
src/mame/drivers/cps2.c
r1591r1592
599599   if(cps1_scanline1 == scancount || (cps1_scanline1 < scancount && !cps1_scancalls))
600600   {
601601      cps1_output[0x50/2] = 0;
602      cpunum_set_input_line(0, 4, HOLD_LINE);
602      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
603603      cps2_set_sprite_priorities();
604604      video_screen_update_partial(0, 16 - 10 + scancount);   /* visarea.min_y - [first visible line?] + scancount */
605605      cps1_scancalls++;
r1591r1592
610610   if(cps1_scanline2 == scancount || (cps1_scanline2 < scancount && !cps1_scancalls))
611611   {
612612      cps1_output[0x52/2] = 0;
613      cpunum_set_input_line(0, 4, HOLD_LINE);
613      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
614614      cps2_set_sprite_priorities();
615615      video_screen_update_partial(0, 16 - 10 + scancount);   /* visarea.min_y - [first visible line?] + scancount */
616616      cps1_scancalls++;
r1591r1592
621621   {
622622      cps1_output[0x50/2] = cps1_scanline1;
623623      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);
625625      if(cps1_scancalls)
626626      {
627627         cps2_set_sprite_priorities();
r1591r1592
692692   /* bit 7 - */
693693
694694        /* 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);
696696
697697   coin_counter_w(0, data & 0x0001);
698698   if( (strncmp(Machine->gamedrv->name,"pzloop2",8)==0) ||
r1591r1592
71897189static DRIVER_INIT( cps2 )
71907190{
71917191   /* Decrypt the game - see machine/cps2crpt.c */
7192   driver_init_cps2crpt(machine);
7192   DRIVER_INIT_CALL(cps2crpt);
71937193   cps2networkpresent = 0;
71947194}
71957195
71967196static DRIVER_INIT( ssf2tb )
71977197{
7198   driver_init_cps2(machine);
7198   DRIVER_INIT_CALL(cps2);
71997199   cps2networkpresent = 0;
72007200
72017201   /* we don't emulate the network board, so don't say it's present for now, otherwise the game will
r1591r1592
72067206
72077207static DRIVER_INIT ( puzloop2 )
72087208{
7209   driver_init_cps2(machine);
7209   DRIVER_INIT_CALL(cps2);
72107210   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, pl2_port_0_word_r);
72117211}
72127212
src/mame/drivers/lordgun.c
r1591r1592
168168   if (ACCESSING_LSB)   soundlatch_w (0, (data >> 0) & 0xff);
169169   if (ACCESSING_MSB)   soundlatch2_w(0, (data >> 8) & 0xff);
170170
171   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
171   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
172172}
173173
174174static ADDRESS_MAP_START( lordgun_map, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
426426
427427static void soundirq(int state)
428428{
429   cpunum_set_input_line(1, 0, state);
429   cpunum_set_input_line(Machine, 1, 0, state);
430430}
431431
432432static const struct YM3812interface lordgun_ym3812_interface =
src/mame/drivers/lemmings.c
r1591r1592
7474static WRITE16_HANDLER( lemmings_sound_w )
7575{
7676   soundlatch_w(0,data&0xff);
77   cpunum_set_input_line(1,1,HOLD_LINE);
77   cpunum_set_input_line(Machine, 1,1,HOLD_LINE);
7878}
7979
8080static WRITE8_HANDLER( lemmings_sound_ack_w )
8181{
82   cpunum_set_input_line(1,1,CLEAR_LINE);
82   cpunum_set_input_line(Machine, 1,1,CLEAR_LINE);
8383}
8484
8585/******************************************************************************/
r1591r1592
261261
262262static void sound_irq(int state)
263263{
264   cpunum_set_input_line(1,0,state);
264   cpunum_set_input_line(Machine, 1,0,state);
265265}
266266
267267static const struct YM2151interface ym2151_interface =
src/mame/drivers/pushman.c
r1591r1592
6262
6363   if (offset==1)
6464   {
65        cpunum_set_input_line(2,M68705_IRQ_LINE,HOLD_LINE);
65        cpunum_set_input_line(Machine, 2,M68705_IRQ_LINE,HOLD_LINE);
6666      cpu_spin();
6767      new_latch=0;
6868   }
r1591r1592
420420
421421static void irqhandler(int irq)
422422{
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);
424424}
425425
426426static const struct YM2203interface ym2203_interface =
src/mame/drivers/zerozone.c
r1591r1592
6161   if (ACCESSING_MSB)
6262   {
6363      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);
6565   }
6666}
6767
src/mame/drivers/espial.c
r1591r1592
6060WRITE8_HANDLER( zodiac_master_soundlatch_w )
6161{
6262   soundlatch_w(offset, data);
63   cpunum_set_input_line(1, 0, HOLD_LINE);
63   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
6464}
6565
6666
src/mame/drivers/toaplan1.c
r1591r1592
15691569
15701570static void irqhandler(int linestate)
15711571{
1572   cpunum_set_input_line(1,0,linestate);
1572   cpunum_set_input_line(Machine, 1,0,linestate);
15731573}
15741574
15751575static const struct YM3812interface ym3812_interface =
src/mame/drivers/segag80r.c
r1591r1592
159159{
160160   /* pressing the service switch sends an NMI */
161161   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);
163163}
164164
165165
r1591r1592
305305static WRITE8_HANDLER( sindbadm_soundport_w )
306306{
307307   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);
309309   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50));
310310}
311311
src/mame/drivers/hnayayoi.c
r1591r1592
598598static void irqhandler(int irq)
599599{
600600popmessage("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);
602602}
603603
604604
src/mame/drivers/shanghai.c
r1591r1592
735735
736736static INTERRUPT_GEN( shanghai_interrupt )
737737{
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);
739739}
740740
741741static WRITE16_HANDLER( shanghai_coin_w )
src/mame/drivers/tmnt.c
r1591r1592
197197   switch (cpu_getiloops())
198198   {
199199      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);
201201         break;
202202
203203      default:
204204         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);
206206         break;
207207   }
208208}
r1591r1592
254254      K053260_0_w(offset, (data >> 8) & 0xff);
255255
256256   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);
258258}
259259
260260static READ16_HANDLER( prmrsocr_sound_r )
r1591r1592
274274
275275static WRITE16_HANDLER( prmrsocr_sound_irq_w )
276276{
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);
278278}
279279
280280static WRITE8_HANDLER( prmrsocr_audio_bankswitch_w )
r1591r1592
344344
345345static void sound_nmi_callback( int param )
346346{
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 );
348348
349349   sound_nmi_enabled = 0;
350350}
r1591r1592
352352
353353static TIMER_CALLBACK( nmi_callback )
354354{
355   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
355   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
356356}
357357
358358static WRITE8_HANDLER( sound_arm_nmi_w )
359359{
360360//  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);
362362   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
363363}
364364
r1591r1592
636636
637637      /* bit 5 triggers IRQ on sound cpu */
638638      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);
640640      last = data & 0x20;
641641
642642      /* bit 6 = enable char ROM reading through the video RAM */
r1591r1592
824824static WRITE16_HANDLER( ssriders_soundkludge_w )
825825{
826826   /* 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);
828828}
829829
830830static ADDRESS_MAP_START( blswhstl_main_map, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
26122612
26132613static void sound_nmi(void)
26142614{
2615   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
2615   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
26162616}
26172617
26182618static const struct K054539interface k054539_interface =
r1591r1592
39173917   UINT8 *temp;
39183918
39193919
3920   driver_init_gfx(machine);
3920   DRIVER_INIT_CALL(gfx);
39213921
39223922   /*
39233923        along with the normal byte reordering, TMNT also needs the bits to
r1591r1592
40124012   UINT8 *temp;
40134013
40144014
4015   driver_init_gfx(machine);
4015   DRIVER_INIT_CALL(gfx);
40164016
40174017   /*
40184018        along with the normal byte reordering, TMNT also needs the bits to
src/mame/drivers/jpmimpct.c
r1591r1592
163163      newstate = 5;
164164
165165   if (newstate)
166      cpunum_set_input_line(0, newstate, ASSERT_LINE);
166      cpunum_set_input_line(Machine, 0, newstate, ASSERT_LINE);
167167   else
168      cpunum_set_input_line(0, 7, CLEAR_LINE);
168      cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
169169}
170170
171171
src/mame/drivers/namcos12.c
r1591r1592
979979   return shared16[BYTE_XOR_LE(offset)];
980980}
981981
982static UINT32 m_n_bankoffset, m_n_bankoffseth;
982static UINT32 m_n_bankoffset;
983983
984// called after a state load to properly set things up again
985static 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
998984static WRITE32_HANDLER( bankoffset_w )
999985{
1000986   // Golgo 13 has different banking (maybe the keycus controls it?)
1001987   if( strcmp( Machine->gamedrv->name, "golgo13" ) == 0 ||
1002988      strcmp( Machine->gamedrv->name, "g13knd" ) == 0 )
1003989   {
1004      if (data & 8)
990      if( ( data & 8 ) != 0 )
1005991      {
1006         m_n_bankoffseth = data & 0x6;
1007         m_n_bankoffset = 0;
992         m_n_bankoffset = ( data & 0x6 ) << 2;
1008993      }
1009994      else
1010995      {
1011         m_n_bankoffset = data & 0x7;
996         m_n_bankoffset = ( m_n_bankoffset & ~0x7 ) | ( data & 0x7 );
1012997      }
1013998   }
1014999   else
r1591r1592
10161001      m_n_bankoffset = data;
10171002   }
10181003
1019   s12_resetbank();
1004   memory_set_bank( 1, m_n_bankoffset );
10201005
10211006   verboselog( 1, "bankoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, m_n_bankoffset );
10221007}
r1591r1592
11831168   memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, system11gun_r );
11841169}
11851170
1186static 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
11951171static UINT8 kcram[ 12 ];
11961172
11971173static WRITE32_HANDLER( kcoff_w )
r1591r1592
14041380 *
14051381 * Note: The H8/3002's ADC is 10 bits wide, but
14061382 * 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.
14091384 */
14101385
14111386static READ8_HANDLER( s12_mcu_gun_h_r )
r1591r1592
14131388   int index = port_tag_to_index("IN3");
14141389   if( index != -1 )
14151390   {
1416      int rv = readinputport( index );
1391      int rv = readinputport( index ) << 6;
14171392
14181393      if( ( offset & 1 ) != 0 )
14191394      {
1420         return ( rv & 0x3 ) << 6;
1395         return rv;
14211396      }
14221397
1423      return ( rv & 0x3fc ) >> 2;
1398      return rv >> 8;
14241399   }
14251400
14261401   // if game has no lightgun ports, return 0
r1591r1592
14321407   int index = port_tag_to_index("IN4");
14331408   if( index != -1 )
14341409   {
1435      int rv = readinputport( index );
1410      int rv = readinputport( index ) << 6;
14361411
14371412      if( ( offset & 1 ) != 0 )
14381413      {
1439         return ( rv & 0x3 ) << 6;
1414         return rv;
14401415      }
14411416
1442      return ( rv & 0x3fc ) >> 2;
1417      return rv >> 8;
14431418   }
14441419
14451420   // if game has no lightgun ports, return 0
r1591r1592
14701445   psx_dma_install_read_handler( 5, namcos12_rom_read );
14711446
14721447   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 );
14731456}
14741457
14751458static DRIVER_INIT( ptblank2 )
14761459{
1477   driver_init_namcos12(machine);
1460   DRIVER_INIT_CALL(namcos12);
14781461
14791462   /* patch out wait for dma 5 to complete */
14801463   *( (UINT32 *)( memory_region( REGION_USER1 ) + 0x331c4 ) ) = 0;
r1591r1592
14841467
14851468static DRIVER_INIT( ghlpanic )
14861469{
1487   driver_init_namcos12(machine);
1470   DRIVER_INIT_CALL(namcos12);
14881471
14891472   system11gun_install();
14901473}
14911474
1492static DRIVER_INIT( golgo13 )
1493{
1494   driver_init_namcos12(machine);
1495}
1496
14971475static MACHINE_DRIVER_START( coh700 )
14981476   /* basic machine hardware */
14991477   MDRV_CPU_ADD( PSXCPU, XTAL_100MHz )
r1591r1592
15081486   MDRV_SCREEN_REFRESH_RATE( 60 )
15091487   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
15101488
1511   MDRV_MACHINE_START( namcos12 )
15121489   MDRV_MACHINE_RESET( namcos12 )
15131490   MDRV_NVRAM_HANDLER( at28c16_0 )
15141491
r1591r1592
23902367GAME( 1998, soulclbd,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC020 */
23912368GAME( 1998, ehrgeiz,   0,        coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
23922369GAME( 1998, ehrgeiza,  ehrgeiz,  coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
2393GAME( 1999, kaiunqz,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Kaiun Quiz (KW1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC050 */
23942370GAME( 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 */
23952371GAME( 1998, sws98,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium '98 (SS81/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC0?? */
23962372GAME( 1998, tenkomor,  0,        coh700,   namcos12, namcos12, ROT90, "Namco",        "Tenkomori Shooting (TKM2/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC036 */
r1591r1592
24062382GAME( 1999, ghlpanic,  0,        coh700,   ghlpanic, ghlpanic, ROT0, "Namco",         "Ghoul Panic (OB2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC045 */
24072383GAME( 1999, pacapp2,   0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion 2 (PKS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC046 */
24082384GAME( 1999, mrdrillr,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Mr Driller (DRI1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC048 */
2385GAME( 1999, kaiunqz,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Kaiun Quiz (KW1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC050 */
24092386GAME( 1999, pacappsp,  0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion Special (PSP1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC052 */
24102387GAME( 1999, aquarush,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Aqua Rush (AQ1/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC053 */
2411GAME( 1999, golgo13,   0,        coh700,   golgo13,  golgo13,  ROT0, "Raizing/Namco", "Golgo 13 (GLG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC054 */
2412GAME( 1999, g13knd,    0,        coh700,   golgo13,  golgo13,  ROT0, "Raizing/Namco", "Golgo 13 Kiseki no Dandou (GLS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC059 */
2388GAME( 1999, golgo13,   0,        coh700,   golgo13,  namcos12, ROT0, "Raizing/Namco", "Golgo 13 (GLG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC054 */
2389GAME( 1999, g13knd,    0,        coh700,   golgo13,  namcos12, ROT0, "Raizing/Namco", "Golgo 13 Kiseki no Dandou (GLS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC059 */
24132390GAME( 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 */
24142391GAME( 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
src/mame/drivers/raiden2.c
r1591r1592
485485   mainram[0x74c/2] = readinputport(4) | 0xff00;
486486   mainram[0x74e/2] = 0xffff;
487487
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 */
489489   logerror("VSYNC\n");
490490}
491491
r1591r1592
22232223
22242224static INTERRUPT_GEN( rdx_v33_interrupt )
22252225{
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 */
22272227   logerror("VSYNC\n");
22282228}
22292229
src/mame/drivers/zodiack.c
r1591r1592
2929static MACHINE_RESET( zodiack )
3030{
3131   percuss_hardware = 0;
32   machine_reset_espial(machine);
32   MACHINE_RESET_CALL(espial);
3333}
3434
3535static MACHINE_RESET( percuss )
3636{
3737   percuss_hardware = 1;
38   machine_reset_espial(machine);
38   MACHINE_RESET_CALL(espial);
3939}
4040
4141
src/mame/drivers/scramble.c
r1591r1592
1919
2020- While Atlantis has a cabinet switch, it doesn't use the 2nd player controls
2121  in cocktail mode.
22- DIP locations have been verified from manuals for:
23  800fath
24  scramble
2225
2326***************************************************************************/
2427
r1591r1592
641644   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
642645
643646   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")
645648   PORT_DIPSETTING(    0x00, "3" )
646649   PORT_DIPSETTING(    0x01, "4" )
647650   PORT_DIPSETTING(    0x02, "5" )
648   PORT_DIPSETTING(    0x03, "255 (Cheat)")
651   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
649652   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
650653   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
651654   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
r1591r1592
655658
656659   PORT_START_TAG("IN2")
657660   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")
664667   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
665668   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
666669   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r1591r1592
669672   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )   /* protection bit */
670673INPUT_PORTS_END
671674
675static 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 */
713INPUT_PORTS_END
714
672715static INPUT_PORTS_START( explorer )
673716   PORT_START_TAG("IN0")
674717   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
r1591r1592
931974   PORT_DIPSETTING(    0x03, "2" )
932975   PORT_DIPSETTING(    0x02, "3" )
933976   PORT_DIPSETTING(    0x01, "4" )
934   PORT_DIPSETTING(    0x00, "256 (Cheat)")
977   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
935978   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
936979   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
937980   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
r1591r1592
33233366GAME( 1982, triplep,  0,        triplep,  triplep,  scramble_ppi, ROT90, "KKI", "Triple Punch", GAME_SUPPORTS_SAVE )
33243367GAME( 1982, knockout, triplep,  triplep,  triplep,  scramble_ppi, ROT90, "KKK", "Knock Out!!", GAME_SUPPORTS_SAVE )
33253368GAME( 1981, mariner,  0,        mariner,  scramble, mariner,      ROT90, "Amenip", "Mariner", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
3326GAME( 1981, 800fath,  mariner,  mariner,  scramble, mariner,      ROT90, "Amenip (US Billiards Inc. license)", "800 Fathoms", GAME_SUPPORTS_SAVE )
3369GAME( 1981, 800fath,  mariner,  mariner,  800fath, mariner,      ROT90, "Amenip (US Billiards Inc. license)", "800 Fathoms", GAME_SUPPORTS_SAVE )
33273370GAME( 1981, ckongs,   ckong,    ckongs,   ckongs,   ckongs,       ROT90, "bootleg", "Crazy Kong (Scramble hardware)", GAME_SUPPORTS_SAVE )
33283371GAME( 1981, mars,     0,        mars,     mars,     mars,         ROT90, "Artic", "Mars", GAME_SUPPORTS_SAVE )
33293372GAME( 1982, devilfsh, 0,        devilfsh, devilfsh, devilfsh,     ROT90, "Artic", "Devil Fish", GAME_SUPPORTS_SAVE )
src/mame/drivers/system18.c
r1591r1592
181181   sample_buffer >>= 4;
182182   sample_select ^= 1;
183183   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);
185185}
186186
187187static const struct MSM5205interface shdancbl_msm5205_interface =
r1591r1592
195195static WRITE16_HANDLER( sound_command_irq_w ){
196196   if( ACCESSING_LSB ){
197197      soundlatch_w( 0,data&0xff );
198      cpunum_set_input_line( 1, 0, HOLD_LINE );
198      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
199199   }
200200}
201201
r1591r1592
339339static WRITE16_HANDLER( sound_command_nmi_w ){
340340   if( ACCESSING_LSB ){
341341      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);
343343   }
344344}
345345
r1591r1592
776776   for(i = 0; i < 0xc0000; i++)
777777      mem[i] ^= 0xFF;
778778
779   machine_reset_sys16_onetime(machine);
779   MACHINE_RESET_CALL(sys16_onetime);
780780   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xffc000, 0xffc001, 0, 0, shdancbl_skip_r );
781781
782782   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
r1591r1592
919919      0x1f, 0xA0000  // ROM #4 = 256K
920920   };
921921
922   machine_reset_sys16_onetime(machine);
922   MACHINE_RESET_CALL(sys16_onetime);
923923   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
924924   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
925925
r1591r1592
11001100      0x1f, 0xA0000  // ROM #4 = 256K
11011101   };
11021102
1103   machine_reset_sys16_onetime(machine);
1103   MACHINE_RESET_CALL(sys16_onetime);
11041104   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
11051105   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
11061106   sys16_MaxShadowColors = 0; // doesn't seem to use transparent shadows
src/mame/drivers/taitojc.c
r1591r1592
775775      {
776776         if (!first_dsp_reset)
777777         {
778            cpunum_set_input_line(3, INPUT_LINE_RESET, CLEAR_LINE);
778            cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
779779         }
780780         first_dsp_reset = 0;
781781      }
782782      else
783783      {
784         cpunum_set_input_line(3, INPUT_LINE_RESET, ASSERT_LINE);
784         cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, ASSERT_LINE);
785785      }
786786   }
787787}
r1591r1592
12541254   f3_68681_reset();
12551255
12561256   // 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);
12581258}
12591259
12601260static INTERRUPT_GEN( taitojc_vblank )
12611261{
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);
12631263}
12641264
12651265static INTERRUPT_GEN( taitojc_int6 )
12661266{
1267   cpunum_set_input_line(0, 6, HOLD_LINE);
1267   cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
12681268}
12691269
12701270static MACHINE_DRIVER_START( taitojc )
src/mame/drivers/missb2.c
r1591r1592
346346static void irqhandler(int irq)
347347{
348348   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);
350350}
351351
352352static const struct YM3526interface ym3526_interface =
r1591r1592
358358
359359static INTERRUPT_GEN( missb2_interrupt )
360360{
361   cpunum_set_input_line(2, 0, HOLD_LINE);
361   cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
362362}
363363
364364/* Machine Driver */
src/mame/drivers/pitnrun.c
r1591r1592
101101
102102static INTERRUPT_GEN( pitnrun_nmi_source )
103103{
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);
105105}
106106
107107static WRITE8_HANDLER( nmi_enable_w )
src/mame/drivers/ddealer.c
r1591r1592
180180
181181static INTERRUPT_GEN( ddealer_interrupt )
182182{
183   cpunum_set_input_line(0, 4, HOLD_LINE);
183   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
184184
185185
186186}
src/mame/drivers/berzerk.c
r1591r1592
99***************************************************************************/
1010
1111#include "driver.h"
12#include "berzerk.h"
1312#include "exidy.h"
1413#include "machine/74181.h"
14#include "sound/s14001a.h"
1515#include "video/resnet.h"
1616
1717
1818#define MONITOR_TYPE_PORT_TAG ("MONITOR_TYPE")
1919
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)
2224#define HTOTAL                  (0x140)
2325#define HBEND                  (0x000)
2426#define HBSTART                  (0x100)
r1591r1592
157159
158160   /* set the IRQ line if enabled */
159161   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);
161163
162164   /* set up for next interrupt */
163165   next_irq_number = (irq_number + 1) % IRQS_PER_FRAME;
r1591r1592
234236
235237   /* pulse the NMI line if enabled */
236238   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);
238240
239241   /* set up for next interrupt */
240242   next_nmi_number = (nmi_number + 1) % NMIS_PER_FRAME;
r1591r1592
459461
460462/*************************************
461463 *
464 *  Audio system
465 *
466 *************************************/
467
468static const struct S14001A_interface berzerk_s14001a_interface =
469{
470   REGION_SOUND1   /* voice data region */
471};
472
473
474static const struct CustomSound_interface berzerk_custom_interface =
475{
476   exidy_sh6840_sh_start,
477   0,
478   exidy_sh6840_sh_reset
479};
480
481
482static 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
536static READ8_HANDLER( berzerk_audio_r )
537{
538   return ((offset == 4) && !S14001A_bsy_0_r()) ? 0x40 : 0x00;
539}
540
541
542
543static 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 *
462553 *  Memory handlers
463554 *
464555 *************************************/
r1591r1592
789880   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
790881
791882   /* audio hardware */
792   MDRV_IMPORT_FROM(berzerk_audio)
883   MDRV_SPEAKER_STANDARD_MONO("mono")
793884
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)
794894MACHINE_DRIVER_END
795895
796896
r1591r1592
800900   MDRV_IMPORT_FROM(berzerk)
801901   MDRV_CPU_MODIFY("main")
802902   MDRV_CPU_PROGRAM_MAP(frenzy_map,0)
803
804903MACHINE_DRIVER_END
805904
806905
src/mame/drivers/tehkanwc.c
r1591r1592
119119static WRITE8_HANDLER( sub_cpu_halt_w )
120120{
121121   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);
123123   else
124      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
124      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
125125}
126126
127127
r1591r1592
165165static WRITE8_HANDLER( sound_command_w )
166166{
167167   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);
169169}
170170
171171static TIMER_CALLBACK( reset_callback )
172172{
173   cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE);
173   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, PULSE_LINE);
174174}
175175
176176static WRITE8_HANDLER( sound_answer_w )
src/mame/drivers/bionicc.c
r1591r1592
135135static INTERRUPT_GEN( bionicc_interrupt )
136136{
137137   if (cpu_getiloops() == 0)
138      cpunum_set_input_line(0, 2, HOLD_LINE);
138      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
139139   else
140      cpunum_set_input_line(0, 4, HOLD_LINE);
140      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
141141}
142142
143143static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/suprridr.c
r1591r1592
103103static INTERRUPT_GEN( main_nmi_gen )
104104{
105105   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);
107107}
108108
109109
r1591r1592
117117static TIMER_CALLBACK( delayed_sound_w )
118118{
119119   sound_data = param;
120   cpunum_set_input_line(1, 0, ASSERT_LINE);
120   cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
121121}
122122
123123
r1591r1592
135135
136136static WRITE8_HANDLER( sound_irq_ack_w )
137137{
138   cpunum_set_input_line(1, 0, CLEAR_LINE);
138   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
139139}
140140
141141
src/mame/drivers/spy.c
r1591r1592
3333static INTERRUPT_GEN( spy_interrupt )
3434{
3535   if (K052109_is_IRQ_enabled())
36      cpunum_set_input_line(0, 0, HOLD_LINE);
36      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
3737}
3838
3939
r1591r1592
4444{
4545   if (rambank & 1)
4646   {
47      return paletteram_r(offset);
47      return paletteram[offset];
4848   }
4949   else if (rambank & 2)
5050   {
r1591r1592
323323*/
324324      spy_collision();
325325//ZT
326      cpunum_set_input_line(0,M6809_FIRQ_LINE,HOLD_LINE);
326      cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE);
327327   }
328328
329329   old = data;
r1591r1592
332332
333333static WRITE8_HANDLER( spy_sh_irqtrigger_w )
334334{
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);
336336}
337337
338338static WRITE8_HANDLER( sound_bank_w )
r1591r1592
522522
523523static void irqhandler(int linestate)
524524{
525   cpunum_set_input_line(1, INPUT_LINE_NMI, linestate);
525   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, linestate);
526526}
527527
528528static const struct YM3812interface ym3812_interface =
src/mame/drivers/psikyo.c
r1591r1592
164164static TIMER_CALLBACK( psikyo_soundlatch_callback )
165165{
166166   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);
168168   z80_nmi = 1;
169169}
170170
r1591r1592
370370
371371static void sound_irq( int irq )
372372{
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);
374374}
375375
376376static READ8_HANDLER( psikyo_soundlatch_r )
r1591r1592
380380
381381static WRITE8_HANDLER( psikyo_clear_nmi_w )
382382{
383   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
383   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
384384   z80_nmi = 0;
385385}
386386
r1591r1592
16641664static void irqhandler(int linestate)
16651665{
16661666   if (linestate)
1667      cpunum_set_input_line(1, 0, ASSERT_LINE);
1667      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
16681668   else
1669      cpunum_set_input_line(1, 0, CLEAR_LINE);
1669      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
16701670}
16711671
16721672static const struct YMF278B_interface ymf278b_interface =
src/mame/drivers/dacholer.c
r1591r1592
5353static WRITE8_HANDLER( snd_irq_w )
5454{
5555   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);
5757   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);
5959}
6060
6161static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/esd16.c
r1591r1592
7070   if (ACCESSING_LSB)
7171   {
7272      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
7474      cpu_spinuntil_time(ATTOTIME_IN_USEC(50));   // Allow the other CPU to reply
7575   }
7676}
r1591r1592
285285static READ8_HANDLER( esd16_sound_command_r )
286286{
287287   /* 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);
289289   return soundlatch_r(0);
290290}
291291
src/mame/drivers/model3.c
r1591r1592
789789static void scsi_irq_callback(void)
790790{
791791   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);
793793}
794794
795795/*****************************************************************************/
r1591r1592
951951   {
952952      eeprom_handler(file, read_or_write);
953953   } else {
954      nvram_handler_93C46(machine, file, read_or_write);
954      NVRAM_HANDLER_CALL(93C46);
955955   }
956956
957957   if (read_or_write)
r1591r1592
40144014    if (irq > 0)
40154015   {
40164016      scsp_last_line = irq;
4017      cpunum_set_input_line(1, irq, PULSE_LINE);
4017      cpunum_set_input_line(Machine, 1, irq, PULSE_LINE);
40184018   }
40194019}
40204020
r1591r1592
40514051   } else {
40524052      model3_irq_state = 0x0d;
40534053   }
4054   cpunum_set_input_line(0, INPUT_LINE_IRQ1, ASSERT_LINE);
4054   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
40554055
40564056   model3_vblank++;
40574057   model3_vblank &= 1;
r1591r1592
42984298{
42994299   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
43004300
4301   driver_init_model3_15(machine);
4301   DRIVER_INIT_CALL(model3_15);
43024302   /* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */
43034303   memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r );
43044304   memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w );
r1591r1592
43104310{
43114311   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
43124312
4313   driver_init_model3_15(machine);
4313   DRIVER_INIT_CALL(model3_15);
43144314   /* TODO: network device at 0xC0000000 - FF */
43154315   memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r );
43164316   memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w );
r1591r1592
43234323{
43244324   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
43254325
4326   driver_init_model3_15(machine);
4326   DRIVER_INIT_CALL(model3_15);
43274327   /* TODO: network device at 0xC0000000 - FF */
43284328   memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r );
43294329   memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w );
r1591r1592
43404340static DRIVER_INIT( lemans24 )
43414341{
43424342   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4343   driver_init_model3_15(machine);
4343   DRIVER_INIT_CALL(model3_15);
43444344
43454345   memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r );
43464346   memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w );
r1591r1592
43564356{
43574357   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
43584358
4359   driver_init_model3_10(machine);
4359   DRIVER_INIT_CALL(model3_10);
43604360
43614361   rom[(0x713c7c^4)/4] = 0x60000000;
43624362   rom[(0x713e54^4)/4] = 0x60000000;
r1591r1592
44614461{
44624462   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
44634463
4464   driver_init_model3_20(machine);
4464   DRIVER_INIT_CALL(model3_20);
44654465
44664466   rom[(0x705884^4)/4] = 0x60000000;
44674467   rom[(0x7058a4^4)/4] = 0x60000000;
r1591r1592
44714471{
44724472   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
44734473
4474   driver_init_model3_20(machine);
4474   DRIVER_INIT_CALL(model3_20);
44754475
44764476   rom[(0x603868^4)/4] = 0x60000000;
44774477   rom[(0x603888^4)/4] = 0x60000000;
r1591r1592
44824482{
44834483   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
44844484
4485   driver_init_model3_20(machine);
4485   DRIVER_INIT_CALL(model3_20);
44864486
44874487   rom[(0x603868^4)/4] = 0x60000000;
44884488   rom[(0x603888^4)/4] = 0x60000000;
r1591r1592
44924492{
44934493   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
44944494
4495   driver_init_model3_20(machine);
4495   DRIVER_INIT_CALL(model3_20);
44964496
44974497   rom[(0x603868^4)/4] = 0x60000000;
44984498   rom[(0x603888^4)/4] = 0x60000000;
r1591r1592
45014501static DRIVER_INIT( harley )
45024502{
45034503   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4504   driver_init_model3_20(machine);
4504   DRIVER_INIT_CALL(model3_20);
45054505
45064506   memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_r );
45074507   memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_w );
r1591r1592
45164516static DRIVER_INIT( srally2 )
45174517{
45184518   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4519   driver_init_model3_20(machine);
4519   DRIVER_INIT_CALL(model3_20);
45204520
45214521   rom[(0x7c0c4^4)/4] = 0x60000000;
45224522   rom[(0x7c0c8^4)/4] = 0x60000000;
r1591r1592
45264526static DRIVER_INIT( swtrilgy )
45274527{
45284528   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4529   driver_init_model3_20(machine);
4529   DRIVER_INIT_CALL(model3_20);
45304530
45314531   rom[(0xf0e48^4)/4] = 0x60000000;
45324532    rom[(0x043dc^4)/4] = 0x48000090;
r1591r1592
45374537static DRIVER_INIT( swtrilga )
45384538{
45394539   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4540   driver_init_model3_20(machine);
4540   DRIVER_INIT_CALL(model3_20);
45414541
45424542   rom[(0xf6dd0^4)/4] = 0x60000000;
45434543}
r1591r1592
45454545static DRIVER_INIT( von2 )
45464546{
45474547   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4548   driver_init_model3_20(machine);
4548   DRIVER_INIT_CALL(model3_20);
45494549
45504550   rom[(0x189168^4)/4] = 0x60000000;
45514551   rom[(0x1890ac^4)/4] = 0x60000000;
r1591r1592
45574557static DRIVER_INIT( dirtdvls )
45584558{
45594559   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4560   driver_init_model3_20(machine);
4560   DRIVER_INIT_CALL(model3_20);
45614561
45624562   rom[(0x0600a0^4)/4] = 0x60000000;
45634563   rom[(0x0608a4^4)/4] = 0x60000000;
r1591r1592
45704570static DRIVER_INIT( daytona2 )
45714571{
45724572   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4573   driver_init_model3_20(machine);
4573   DRIVER_INIT_CALL(model3_20);
45744574
45754575   memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w );
45764576
r1591r1592
45834583static DRIVER_INIT( dayto2pe )
45844584{
45854585   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4586   driver_init_model3_20(machine);
4586   DRIVER_INIT_CALL(model3_20);
45874587
45884588   memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w );
45894589
r1591r1592
45974597static DRIVER_INIT( spikeout )
45984598{
45994599   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4600   driver_init_model3_20(machine);
4600   DRIVER_INIT_CALL(model3_20);
46014601
46024602   rom[(0x6059cc^4)/4] = 0x60000000;
46034603   rom[(0x6059ec^4)/4] = 0x60000000;
r1591r1592
46064606static DRIVER_INIT( spikeofe )
46074607{
46084608   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4609   driver_init_model3_20(machine);
4609   DRIVER_INIT_CALL(model3_20);
46104610
46114611   rom[(0x6059cc^4)/4] = 0x60000000;
46124612   rom[(0x6059ec^4)/4] = 0x60000000;
r1591r1592
46154615static DRIVER_INIT( eca )
46164616{
46174617   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4618   driver_init_model3_20(machine);
4618   DRIVER_INIT_CALL(model3_20);
46194619
46204620   rom[(0x535580^4)/4] = 0x60000000;
46214621   rom[(0x5023b4^4)/4] = 0x60000000;
r1591r1592
46254625static DRIVER_INIT( skichamp )
46264626{
46274627   UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
4628   driver_init_model3_20(machine);
4628   DRIVER_INIT_CALL(model3_20);
46294629
46304630   rom[(0x5263c8^4)/4] = 0x60000000;
46314631   rom[(0x5263e8^4)/4] = 0x60000000;
src/mame/drivers/namcos21.c
r1591r1592
534534   mpDspState->slaveOutputSize = 0;
535535   mpDspState->masterFinished = 0;
536536   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 */
539539}
540540
541541static UINT16
r1591r1592
12431243   if( data )
12441244   {
12451245      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);
12471247      namcos21_ClearPolyFrameBuffer();
12481248   }
12491249}
src/mame/drivers/pgm.c
r1591r1592
331331#ifdef PGMARM7SPEEDHACK
332332static TIMER_CALLBACK( arm_irq )
333333{
334   cpunum_set_input_line(2, ARM7_FIRQ_LINE, PULSE_LINE);
334   cpunum_set_input_line(machine, 2, ARM7_FIRQ_LINE, PULSE_LINE);
335335}
336336#endif
337337
r1591r1592
344344#ifdef PGMARM7SPEEDHACK
345345//  cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
346346   if (data!=0xaa) cpu_spinuntil_trigger(1000);
347   cpu_trigger(1002);
347   cpu_trigger(Machine, 1002);
348348#else
349349   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
350350   cpu_spinuntil_time(ATTOTIME_IN_CYCLES(100, 0));
r1591r1592
375375   COMBINE_DATA(&arm7_latch);
376376
377377#ifdef PGMARM7SPEEDHACK
378   cpu_trigger(1000);
378   cpu_trigger(Machine, 1000);
379379   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, arm_irq); // i don't know how long..
380380   cpu_spinuntil_trigger(1002);
381381#else
382   cpunum_set_input_line(2, ARM7_FIRQ_LINE, PULSE_LINE);
382   cpunum_set_input_line(Machine, 2, ARM7_FIRQ_LINE, PULSE_LINE);
383383   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(200));
384384   cpu_spinuntil_time(ATTOTIME_IN_CYCLES(200, 2)); // give the arm time to respond (just boosting the interleave doesn't help
385385#endif
r1591r1592
418418
419419   if(data == 0x5050) {
420420      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);
423423      if(0) {
424424         FILE *out;
425425         out = fopen("z80ram.bin", "wb");
r1591r1592
431431   {
432432      /* this might not be 100% correct, but several of the games (ddp2, puzzli2 etc. expect the z80 to be turned
433433           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);
435435   }
436436}
437437
r1591r1592
445445   if(ACCESSING_LSB) {
446446      if (PGMLOGERROR) logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, activecpu_get_pc());
447447      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 );
449449   }
450450}
451451
r1591r1592
457457
458458static void sound_irq(int level)
459459{
460   cpunum_set_input_line(1, 0, level);
460   cpunum_set_input_line(Machine, 1, 0, level);
461461}
462462
463463static const struct ics2115_interface pgm_ics2115_interface = {
r1591r1592
15281528   is the source? maybe the protection device? */
15291529static INTERRUPT_GEN( drgw_interrupt ) {
15301530   if( cpu_getiloops() == 0 )
1531      cpunum_set_input_line(0, 6, HOLD_LINE);
1531      cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
15321532   else
1533      cpunum_set_input_line(0, 4, HOLD_LINE);
1533      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
15341534}
15351535
15361536static MACHINE_RESET ( pgm )
15371537{
1538   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
1538   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
15391539}
15401540
15411541static MACHINE_DRIVER_START( pgm )
r1591r1592
20572057{
20582058   int i;
20592059
2060   machine_reset_pgm(machine);
2060   MACHINE_RESET_CALL(pgm);
20612061
20622062   /* fill the protection ram with a5 */
20632063   for (i = 0;i < 0x4000/2;i++)
r1591r1592
21982198//  UINT16 *mem16_a = (UINT16 *)memory_region(REGION_CPU1);
21992199   int i;
22002200
2201   machine_reset_pgm(machine);
2201   MACHINE_RESET_CALL(pgm);
22022202
22032203   /* populate shared protection ram with data read from pcb .. */
22042204
src/mame/drivers/iqblock.c
r1591r1592
7575static INTERRUPT_GEN( iqblock_interrupt )
7676{
7777   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);   /* ???? */
7979   else
80      cpunum_set_input_line(0, 0, ASSERT_LINE);         /* ???? */
80      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);         /* ???? */
8181}
8282
8383static WRITE8_HANDLER( iqblock_irqack_w )
8484{
85   cpunum_set_input_line(0, 0, CLEAR_LINE);
85   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
8686}
8787
8888static READ8_HANDLER( iqblock_irqack_r )
8989{
90   cpunum_set_input_line(0, 0, CLEAR_LINE);
90   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9191   return 0;
9292}
9393
src/mame/drivers/gameplan.c
r1591r1592
272272
273273static TIMER_CALLBACK( via_irq_delayed )
274274{
275   cpunum_set_input_line(0, 0, param);
275   cpunum_set_input_line(machine, 0, 0, param);
276276}
277277
278278
r1591r1592
387387
388388static WRITE8_HANDLER( sound_reset_w )
389389{
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);
391391}
392392
393393
r1591r1592
425425
426426static void r6532_irq(int state)
427427{
428   cpunum_set_input_line(1, 0, state);
428   cpunum_set_input_line(Machine, 1, 0, state);
429429}
430430
431431
src/mame/drivers/capbowl.c
r1591r1592
111111static INTERRUPT_GEN( capbowl_interrupt )
112112{
113113   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 */
115115}
116116
117117
r1591r1592
191191
192192static WRITE8_HANDLER( capbowl_sndcmd_w )
193193{
194   cpunum_set_input_line(1, M6809_IRQ_LINE, HOLD_LINE);
194   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE);
195195   soundlatch_w(offset, data);
196196}
197197
r1591r1592
206206
207207static void firqhandler(int irq)
208208{
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);
210210}
211211
212212
src/mame/drivers/darius.c
r1591r1592
157157   /* bit 0 enables cpu B */
158158   /* however this fails when recovering from a save state
159159       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);
161161
162162}
163163
r1591r1592
519519static void darius_adpcm_int (int data)
520520{
521521   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);
525523}
526524
527525static const struct MSM5205interface msm5205_interface =
r1591r1592
806804/* handler called by the YM2203 emulator when the internal timers cause an IRQ */
807805static void irqhandler(int irq)   /* assumes Z80 sandwiched between 68Ks */
808806{
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);
810808}
811809
812810static const struct YM2203interface ym2203_interface_1 =
src/mame/drivers/kinst.c
r1591r1592
242242
243243static TIMER_CALLBACK( irq0_stop )
244244{
245   cpunum_set_input_line(0, 0, CLEAR_LINE);
245   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
246246}
247247
248248
249249static INTERRUPT_GEN( irq0_start )
250250{
251   cpunum_set_input_line(0, 0, ASSERT_LINE);
251   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
252252   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq0_stop);
253253}
254254
255255
256256static void ide_interrupt(int state)
257257{
258   cpunum_set_input_line(0, 1, state);
258   cpunum_set_input_line(Machine, 0, 1, state);
259259}
260260
261261
r1591r1592
379379
380380static TIMER_CALLBACK( end_spin )
381381{
382   cpu_triggerint(0);
382   cpu_triggerint(machine, 0);
383383}
384384
385385
src/mame/drivers/cbasebal.c
r1591r1592
5555   else if (rambank == 1)
5656   {
5757      if (offset < 0x800)
58         return paletteram_r(offset);
58         return paletteram[offset];
5959      else return 0;
6060   }
6161   else
src/mame/drivers/beathead.c
r1591r1592
133133 *
134134 *************************************/
135135
136static void update_interrupts(void);
136static void update_interrupts(running_machine *machine);
137137
138138static TIMER_CALLBACK( scanline_callback )
139139{
r1591r1592
144144
145145   /* on scanline zero, clear any halt condition */
146146   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);
148148
149149   /* wrap around at 262 */
150150   scanline++;
r1591r1592
153153
154154   /* set the scanline IRQ */
155155   irq_state[2] = 1;
156   update_interrupts();
156   update_interrupts(machine);
157157
158158   /* set the timer for the next one */
159159   timer_set(double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(0, scanline, 0)) - hblank_offset), NULL, scanline, scanline_callback);
r1591r1592
189189 *
190190 *************************************/
191191
192static void update_interrupts(void)
192static void update_interrupts(running_machine *machine)
193193{
194194   int gen_int;
195195
r1591r1592
204204   {
205205      irq_line_state = gen_int;
206206//      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);
208208//      else
209209//          asap_set_irq_line(ASAP_IRQ0, irq_line_state);
210210   }
r1591r1592
225225      irq_state[0] = irq_state[1] = irq_state[2] = 0;
226226
227227   /* update the current state */
228   update_interrupts();
228   update_interrupts(Machine);
229229}
230230
231231
r1591r1592
317317static WRITE32_HANDLER( sound_reset_w )
318318{
319319   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);
321321}
322322
323323
src/mame/drivers/st0016.c
r1591r1592
395395static INTERRUPT_GEN(st0016_int)
396396{
397397   if(!cpu_getiloops())
398      cpunum_set_input_line(0,0,HOLD_LINE);
398      cpunum_set_input_line(machine, 0,0,HOLD_LINE);
399399   else
400400      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 );
402402}
403403
404404extern UINT8 *st0016_charram;
src/mame/drivers/cchasm.c
r1591r1592
8484
8585static void cchasm_6840_irq(int state)
8686{
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);
8888}
8989static const ptm6840_interface cchasm_6840_intf =
9090{
src/mame/drivers/sbasketb.c
r1591r1592
4444
4545static WRITE8_HANDLER( sbasketb_sh_irqtrigger_w )
4646{
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);
4848}
4949
5050static WRITE8_HANDLER( sbasketb_coin_counter_w )
src/mame/drivers/funkyjet.c
r1591r1592
354354
355355static void sound_irq(int state)
356356{
357   cpunum_set_input_line(1,1,state); /* IRQ 2 */
357   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
358358}
359359
360360static const struct YM2151interface ym2151_interface =
src/mame/drivers/skyarmy.c
r1591r1592
143143
144144static INTERRUPT_GEN( skyarmy_nmi_source )
145145{
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)   ;
147147}
148148
149149
src/mame/drivers/qix.c
r1591r1592
618618   MDRV_CPU_ADD_TAG("video", M6809, MAIN_CLOCK_OSC/4/4)   /* 1.25 MHz */
619619   MDRV_CPU_PROGRAM_MAP(video_map,0)
620620
621   MDRV_CPU_ADD_TAG("sound", M6802, SOUND_CLOCK_OSC/2/4)   /* 0.92 MHz */
621   MDRV_CPU_ADD_TAG("sound", M6802, SOUND_CLOCK_OSC/2)      /* 0.92 MHz */
622622   MDRV_CPU_PROGRAM_MAP(sound_map,0)
623623
624624   /* high interleave needed to ensure correct text in service mode */
src/mame/drivers/suprgolf.c
r1591r1592
258258
259259static void irqhandler(int irq)
260260{
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);
262262}
263263
264264static const struct YM2203interface ym2203_interface =
src/mame/drivers/xexex.c
r1591r1592
272272
273273static WRITE16_HANDLER( sound_irq_w )
274274{
275   cpunum_set_input_line(1, 0, HOLD_LINE);
275   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
276276}
277277
278278static READ16_HANDLER( sound_status_r )
r1591r1592
304304   if (cur_control2 & 0x0040)
305305   {
306306      // 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); }
308308
309309      // IRQ 5 is the "object DMA end interrupt" and shouldn't be triggered
310310      // 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);
312312   }
313313}
314314
315315static INTERRUPT_GEN( xexex_interrupt )
316316{
317   if (suspension_active) { suspension_active = 0; cpu_trigger(resume_trigger); }
317   if (suspension_active) { suspension_active = 0; cpu_trigger(machine, resume_trigger); }
318318
319319   switch (cpu_getiloops())
320320   {
321321      case 0:
322322         // IRQ 6 is for test mode only
323323         if (cur_control2 & 0x0020)
324            cpunum_set_input_line(0, 6, HOLD_LINE);
324            cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
325325      break;
326326
327327      case 1:
r1591r1592
337337         // IRQ 4 is the V-blank interrupt. It controls color, sound and
338338         // vital game logics that shouldn't be interfered by frame-drop.
339339         if (cur_control2 & 0x0800)
340            cpunum_set_input_line(0, 4, HOLD_LINE);
340            cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
341341      break;
342342   }
343343}
src/mame/drivers/ironhors.c
r1591r1592
3131   if (cpu_getiloops() == 0)
3232   {
3333      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);
3535   }
3636   else if (cpu_getiloops() % 2)
3737   {
3838      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);
4040   }
4141}
4242
4343static WRITE8_HANDLER( ironhors_sh_irqtrigger_w )
4444{
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);
4646}
4747
4848static WRITE8_HANDLER( ironhors_filter_w )
src/mame/drivers/skullxbo.c
r1591r1592
3030 *
3131 *************************************/
3232
33static void update_interrupts(void)
33static void update_interrupts(running_machine *machine)
3434{
3535   int newstate = 0;
3636
r1591r1592
4242      newstate = 4;
4343
4444   if (newstate)
45      cpunum_set_input_line(0, newstate, ASSERT_LINE);
45      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4646   else
47      cpunum_set_input_line(0, 7, CLEAR_LINE);
47      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
4848}
4949
5050
src/mame/drivers/sliver.c
r1591r1592
385385static WRITE16_HANDLER(sound_w)
386386{
387387      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);
389389}
390390
391391static ADDRESS_MAP_START( sliver_map, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
526526static INTERRUPT_GEN( sliver_int )
527527{
528528   //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);
530530}
531531
532532static MACHINE_DRIVER_START( sliver )
src/mame/drivers/konamigq.c
r1591r1592
6666      sndto000[ ( offset << 1 ) + 1 ] = data >> 16;
6767      if( offset == 3 )
6868      {
69         cpunum_set_input_line( 1, 1, HOLD_LINE );
69         cpunum_set_input_line(Machine, 1, 1, HOLD_LINE );
7070      }
7171   }
7272   if( ACCESSING_LSW32 )
r1591r1592
140140   EEPROM_write_bit( ( data & 0x01 ) ? 1 : 0 );
141141   EEPROM_set_clock_line( ( data & 0x04 ) ? ASSERT_LINE : CLEAR_LINE );
142142   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 );
144144}
145145
146146static CUSTOM_INPUT( eeprom_bit_r )
src/mame/drivers/mrflea.c
r1591r1592
126126static WRITE8_HANDLER( mrflea_io_w ){
127127   mrflea_status |= 0x08; // pending command to IO CPU
128128   mrflea_io = data;
129   cpunum_set_input_line( 1, 0, HOLD_LINE );
129   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
130130}
131131
132132static READ8_HANDLER( mrflea_main_r ){
r1591r1592
155155
156156static INTERRUPT_GEN( mrflea_io_interrupt ){
157157   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);
159159}
160160
161161static READ8_HANDLER( mrflea_interrupt_type_r ){
src/mame/drivers/cps3.c
r1591r1592
12061206
12071207               ypos2+=((ysizedraw2+1)/2);
12081208
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;
12111211
12121212               if (flipy) ypos2-= ysize2*((16*yinc)>>16);
12131213
r1591r1592
12171217                  {
12181218                     int current_xpos;
12191219
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));
12221222                     //current_xpos +=  rand()&0x3ff;
12231223                     current_xpos += gscrollx;
12241224                     current_xpos += 1;
r1591r1592
20182018            }
20192019
20202020
2021            cpunum_set_input_line(0,10, ASSERT_LINE);
2021            cpunum_set_input_line(Machine, 0,10, ASSERT_LINE);
20222022
20232023
20242024         }
r1591r1592
22392239            /* We should probably copy this, but a pointer to it is fine for our purposes as the data doesn't change */
22402240            current_table_address = real_source;
22412241         }
2242         cpunum_set_input_line(0,10, ASSERT_LINE);
2242         cpunum_set_input_line(Machine, 0,10, ASSERT_LINE);
22432243      }
22442244      else if  ( (dat1&0x00e00000) ==0x00400000 )
22452245      {
22462246         /* 6bpp DMA decompression
22472247              - this is used for the majority of sprites and backgrounds */
22482248         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);
22502250
22512251      }
22522252      else if  ( (dat1&0x00e00000) ==0x00600000 )
r1591r1592
22542254         /* 8bpp DMA decompression
22552255              - this is used on SFIII NG Sean's Stage ONLY */
22562256         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);
22582258      }
22592259      else
22602260      {
r1591r1592
23112311
23122312static WRITE32_HANDLER( cps3_irq10_ack_w )
23132313{
2314   cpunum_set_input_line(0,10, CLEAR_LINE); return;
2314   cpunum_set_input_line(Machine, 0,10, CLEAR_LINE); return;
23152315}
23162316
23172317static WRITE32_HANDLER( cps3_irq12_ack_w )
23182318{
2319   cpunum_set_input_line(0,12, CLEAR_LINE); return;
2319   cpunum_set_input_line(Machine, 0,12, CLEAR_LINE); return;
23202320}
23212321
23222322static WRITE32_HANDLER( cps3_unk_vidregs_w )
r1591r1592
24582458
24592459static INTERRUPT_GEN(cps3_vbl_interrupt)
24602460{
2461   cpunum_set_input_line(0,12, ASSERT_LINE);
2461   cpunum_set_input_line(machine, 0,12, ASSERT_LINE);
24622462}
24632463
24642464static INTERRUPT_GEN(cps3_other_interrupt)
r1591r1592
24662466   // this seems to need to be periodic (see the life bar portraits in sfiii2
24672467   // but also triggered on certain dma events (or warzard locks up in attract)
24682468   // 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);
24702470}
24712471
24722472
r1591r1592
31203120//  rom[0x1fecc/4]^=0x01000000; // nocd
31213121
31223122   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);
31263126
31273127
31283128}
r1591r1592
31463146//  rom[0x1fec8/4]^=0x00000070; // DEV mode
31473147//  rom[0x1fecc/4]^=0x01000000; // nocd
31483148
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);
31523152
31533153   cps3_use_fastboot = 0;
31543154}
r1591r1592
31723172                               // any actual NCD dumps to compare (or it expects SCSI to report there being
31733173                               // no cd drive?)
31743174
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);
31783178
31793179   cps3_use_fastboot = 0; // required due to cd check, even with ASIA NO CD selected, not req. with CD emulation
31803180}
r1591r1592
32003200
32013201   cps3_use_fastboot = 0;
32023202
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);
32063206
32073207}
32083208
r1591r1592
32243224
32253225   cps3_use_fastboot = 0; // not required
32263226
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);
32303230}
32313231
32323232
r1591r1592
32463246//  rom[0x1fec8/4]^=0x00000001; // region
32473247//  rom[0x1fecc/4]^=0x01000000; // nocd
32483248
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);
32523252
32533253   cps3_use_fastboot = 0;
32543254}
src/mame/drivers/glass.c
r1591r1592
3939static INTERRUPT_GEN( glass_interrupt )
4040{
4141   if (cause_interrupt){
42      cpunum_set_input_line(0, 6, HOLD_LINE);
42      cpunum_set_input_line(Machine, 0, 6, HOLD_LINE);
4343      cause_interrupt = 0;
4444   }
4545}
src/mame/drivers/spiders.c
r1591r1592
231231
232232static void main_cpu_irq(int state)
233233{
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);
235239}
236240
237241
238242static void main_cpu_firq(int state)
239243{
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);
241245}
242246
243247
244248static void audio_cpu_irq(int state)
245249{
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);
247251}
248252
249253
src/mame/drivers/mcatadv.c
r1591r1592
161161static WRITE16_HANDLER( mcat_soundlatch_w )
162162{
163163   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);
165165}
166166
167167#if 0 // mcat only.. install read handler?
r1591r1592
479479/* Stolen from Psikyo.c */
480480static void sound_irq( int irq )
481481{
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);
483483}
484484static const struct YM2610interface mcatadv_ym2610_interface =
485485{
src/mame/drivers/toaplan2.c
r1591r1592
300300static UINT8 *raizing_shared_ram;      /* Shared ram used in Shippumd and Mahoudai */
301301static UINT16 *toaplan2_shared_ram16;   /* Really 8bit RAM connected to Z180 */
302302static UINT16 *V25_shared_ram;         /* Really 8bit RAM connected to Z180 */
303static UINT16 *fixeight_sec_cpu_mem;
303304
304305/************ Video RAM related values ************/
305306extern UINT16 *toaplan2_txvideoram16;
r1591r1592
387388static void toaplan2_reset(void)
388389{
389390   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);
391392}
392393
393static MACHINE_RESET( toaplan2 )      /* machine_reset_toaplan2(); */
394static MACHINE_RESET( toaplan2 )
394395{
395396   mcu_data = 0x00;
396397
r1591r1592
404405
405406static MACHINE_RESET( ghox )
406407{
407   machine_reset_toaplan2(machine);
408   MACHINE_RESET_CALL(toaplan2);
408409   old_p1_paddle_h = 0;
409410   old_p2_paddle_h = 0;
410411}
411412
412413static MACHINE_RESET( dogyuun )
413414{
414   machine_reset_toaplan2(machine);
415   MACHINE_RESET_CALL(toaplan2);
415416   mcu_data = 0xffaa;
416417}
417418
418419static MACHINE_RESET( vfive )
419420{
420   machine_reset_toaplan2(machine);
421   MACHINE_RESET_CALL(toaplan2);
421422   mcu_data = 0xffaa;
422423}
423424
r1591r1592
429430   current_bank = 2;
430431   memory_set_bankptr(1, &Z80[0x10000]);
431432
432   machine_reset_toaplan2(machine);
433   MACHINE_RESET_CALL(toaplan2);
433434}
434435
435436static DRIVER_INIT( T2_Z80 )      /* init_t2_Z80(); */
r1591r1592
454455
455456static DRIVER_INIT( fixeight )
456457{
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);
459460
460461   toaplan2_sub_cpu = CPU_2_V25;
461462}
r1591r1592
582583
583584static TIMER_CALLBACK( toaplan2_raise_irq )
584585{
585   cpunum_set_input_line(0, param, HOLD_LINE);
586   cpunum_set_input_line(machine, 0, param, HOLD_LINE);
586587}
587588
588589static void toaplan2_vblank_irq(int irq_line)
r1591r1592
953954         /* game keeping service mode. It writes/reads the settings to/from */
954955         /* these shared RAM locations. The secondary CPU reads/writes them */
955956         /* 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 !!! */
964962
965963         mcu_data = data;
966964      }
r1591r1592
10511049   if (ACCESSING_LSB)
10521050   {
10531051      soundlatch_w(offset, data & 0xff);
1054      cpunum_set_input_line(1, 0, HOLD_LINE);
1052      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
10551053   }
10561054}
10571055
r1591r1592
11791177   if (ACCESSING_LSB)
11801178   {
11811179      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);
11831181   }
11841182}
11851183
r1591r1592
11891187   if (ACCESSING_LSB)
11901188   {
11911189      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);
11931191   }
11941192}
11951193
r1591r1592
12051203{
12061204   // not sure whether this is correct
12071205   // 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);
12091207}
12101208
12111209
12121210static WRITE8_HANDLER( raizing_sndirq_w )
12131211{
12141212   // 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);
12161214}
12171215
12181216
12191217static WRITE8_HANDLER( raizing_clear_nmi_w )
12201218{
1221   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
1219   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
12221220}
12231221
12241222
r1591r1592
13441342
13451343static INTERRUPT_GEN( bbakraid_snd_interrupt )
13461344{
1347   cpunum_set_input_line(1, 0, HOLD_LINE);
1345   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
13481346}
13491347
13501348
r1591r1592
13531351   AM_RANGE(0x000000, 0x01ffff) AM_ROM
13541352   AM_RANGE(0x020000, 0x03ffff) AM_ROM                     /* extra for Whoopee */
13551353   AM_RANGE(0x080000, 0x082fff) AM_RAM
1356   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1354   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
13571355   AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w)
13581356   AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
13591357   AM_RANGE(0x140008, 0x140009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
r1591r1592
13731371   AM_RANGE(0x000000, 0x03ffff) AM_ROM
13741372   AM_RANGE(0x040000, 0x040001) AM_READ(ghox_p2_h_analog_r)   /* Paddle 2 */
13751373   AM_RANGE(0x080000, 0x083fff) AM_RAM
1376   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1374   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
13771375   AM_RANGE(0x100000, 0x100001) AM_READ(ghox_p1_h_analog_r)   /* Paddle 1 */
13781376   AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w)
13791377   AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
r1591r1592
14141412   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
14151413   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
14161414   AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w)
1417   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1415   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
14181416   /***** The following loctions in 0x50000x are for video controller 2 ******/
14191417   AM_RANGE(0x500000, 0x500001) AM_WRITE(toaplan2_1_voffs_w)   /* VideoRAM selector/offset */
14201418   AM_RANGE(0x500004, 0x500007) AM_READWRITE(toaplan2_1_videoram16_r, toaplan2_1_videoram16_w)   /* Tile/Sprite VideoRAM */
r1591r1592
14401438   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
14411439   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
14421440   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1441   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
14441442   AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r)         /* test bit 8 */
14451443ADDRESS_MAP_END
14461444
r1591r1592
14651463   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
14661464   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
14671465   AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w)
1468   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1466   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
14691467ADDRESS_MAP_END
14701468
14711469
r1591r1592
14761474   AM_RANGE(0x200004, 0x200007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)
14771475   AM_RANGE(0x200008, 0x200009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
14781476   AM_RANGE(0x20000c, 0x20000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w)
1479   AM_RANGE(0x300000, 0x300fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1477   AM_RANGE(0x300000, 0x300fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
14801478   AM_RANGE(0x400000, 0x401fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size)
14811479   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)
14821480   AM_RANGE(0x402200, 0x402fff) AM_RAM
r1591r1592
15001498static ADDRESS_MAP_START( pipibibs_68k_mem, ADDRESS_SPACE_PROGRAM, 16 )
15011499   AM_RANGE(0x000000, 0x03ffff) AM_ROM
15021500   AM_RANGE(0x080000, 0x082fff) AM_RAM
1503   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1501   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
15041502   AM_RANGE(0x140000, 0x140001) AM_WRITE(toaplan2_0_voffs_w)
15051503   AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)
15061504   AM_RANGE(0x140008, 0x140009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
r1591r1592
15211519   AM_RANGE(0x080000, 0x082fff) AM_RAM
15221520   AM_RANGE(0x083000, 0x0837ff) AM_READWRITE(pipibibi_spriteram16_r, pipibibi_spriteram16_w)   /* SpriteRAM */
15231521   AM_RANGE(0x083800, 0x087fff) AM_RAM            /* SpriteRAM (unused) */
1524   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1522   AM_RANGE(0x0c0000, 0x0c0fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
15251523   AM_RANGE(0x120000, 0x120fff) AM_RAM            /* Copy of SpriteRAM ? */
15261524//  AM_RANGE(0x13f000, 0x13f001) AM_WRITENOP        /* ??? */
15271525   AM_RANGE(0x180000, 0x182fff) AM_READWRITE(pipibibi_videoram16_r, pipibibi_videoram16_w)      /* TileRAM */
r1591r1592
15521550   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 */
15531551#else
15541552   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 */
15561554//  AM_RANGE(0x28f002, 0x28f003) AM_READ(MRA16_RAM)             /* part of shared ram */
15571555//  AM_RANGE(0x28f004, 0x28f005) AM_READ_PORT("DSWA") /* Dip Switch A - Wrong !!! */
15581556//  AM_RANGE(0x28f006, 0x28f007) AM_READ_PORT("DSWB") /* Dip Switch B - Wrong !!! */
r1591r1592
15641562   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
15651563   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
15661564   AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w)
1567   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1565   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
15681566   AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size)
15691567   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)
15701568   AM_RANGE(0x503000, 0x5031ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size)
r1591r1592
15881586   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
15891587   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
15901588   AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w)
1591   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1589   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
15921590   AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size)
15931591   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)
15941592   AM_RANGE(0x503000, 0x5031ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size)
r1591r1592
16201618   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
16211619   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
16221620   AM_RANGE(0x30000c, 0x30000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w)
1623   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1621   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
16241622   AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r)
16251623ADDRESS_MAP_END
16261624
r1591r1592
16491647   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
16501648   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
16511649   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1650   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
16531651   /***** The following in 0x50000x are for video controller 2 ******/
16541652   AM_RANGE(0x500000, 0x500001) AM_WRITE(toaplan2_1_voffs_w)   /* VideoRAM selector/offset */
16551653   AM_RANGE(0x500004, 0x500007) AM_READWRITE(toaplan2_1_videoram16_r, toaplan2_1_videoram16_w)   /* Tile/Sprite VideoRAM */
r1591r1592
16661664   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
16671665   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
16681666   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1667   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
16701668   AM_RANGE(0x500000, 0x500001) AM_WRITE(YM2151_register_port_0_lsb_w)
16711669   AM_RANGE(0x500002, 0x500003) AM_READWRITE(YM2151_status_port_0_lsb_r, YM2151_data_port_0_lsb_w)
16721670   AM_RANGE(0x600000, 0x600001) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w)
r1591r1592
16991697   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
17001698   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
17011699   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1700   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
17031701   AM_RANGE(0x401000, 0x4017ff) AM_RAM                     /* Unused PaletteRAM */
17041702   AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size)
17051703   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)
r1591r1592
17261724   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
17271725   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
17281726   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1727   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
17301728   AM_RANGE(0x401000, 0x4017ff) AM_RAM                     /* Unused PaletteRAM */
17311729   AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size)
17321730   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)
r1591r1592
17521750   AM_RANGE(0x300004, 0x300007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w)   /* Tile/Sprite VideoRAM */
17531751   AM_RANGE(0x300008, 0x300009) AM_WRITE(toaplan2_0_scroll_reg_select_w)
17541752   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
1753   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
17561754   AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE(&toaplan2_txvideoram16) AM_SIZE(&toaplan2_tx_vram_size)
17571755   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)
17581756   AM_RANGE(0x502200, 0x502fff) AM_RAM
r1591r1592
17651763static ADDRESS_MAP_START( batrider_68k_mem, ADDRESS_SPACE_PROGRAM, 16 )
17661764   AM_RANGE(0x000000, 0x1fffff) AM_ROM
17671765   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) AM_SIZE(&batrider_paletteram16_size)
1766   AM_RANGE(0x202000, 0x202fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) AM_SIZE(&batrider_paletteram16_size)
17691767   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)
17701768   AM_RANGE(0x203200, 0x2033ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size)
17711769   AM_RANGE(0x203400, 0x207fff) AM_READWRITE(raizing_tx_gfxram16_r, raizing_tx_gfxram16_w)   /* Main RAM actually */
r1591r1592
17961794static ADDRESS_MAP_START( bbakraid_68k_mem, ADDRESS_SPACE_PROGRAM, 16 )
17971795   AM_RANGE(0x000000, 0x1fffff) AM_ROM
17981796   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(paletteram16_word_r, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) AM_SIZE(&batrider_paletteram16_size)
1797   AM_RANGE(0x202000, 0x202fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) AM_SIZE(&batrider_paletteram16_size)
18001798   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)
18011799   AM_RANGE(0x203200, 0x2033ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE(&toaplan2_txscrollram16) AM_SIZE(&toaplan2_tx_scroll_vram_size)
18021800   AM_RANGE(0x203400, 0x207fff) AM_READWRITE(raizing_tx_gfxram16_r, raizing_tx_gfxram16_w)   /* Main RAM actually */
r1591r1592
32753273
32763274static void irqhandler(int linestate)
32773275{
3278   cpunum_set_input_line(1,0,linestate);
3276   cpunum_set_input_line(Machine, 1,0,linestate);
32793277}
32803278
32813279static const struct YM3812interface ym3812_interface =
src/mame/drivers/jchan.c
r1591r1592
401401static INTERRUPT_GEN( jchan_vblank )
402402{
403403   if (!cpu_getiloops())
404      cpunum_set_input_line(0, 1, HOLD_LINE);
404      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
405405   else
406      cpunum_set_input_line(0, 2, HOLD_LINE);
406      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
407407}
408408
409409
r1591r1592
480480{
481481   COMBINE_DATA(&main2sub_cmd);
482482   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);
484484}
485485static READ16_HANDLER ( main2sub_status_r )
486486{
r1591r1592
513513{
514514   COMBINE_DATA(&sub2main_cmd);
515515   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);
517517}
518518static READ16_HANDLER ( sub2main_cmd_r )
519519{
src/mame/drivers/jailbrek.c
r1591r1592
1515
1616*/
1717
18
19#define MASTER_CLOCK      XTAL_18_432MHz
20#define VOICE_CLOCK         XTAL_3_579545MHz
21
22
1823#include "driver.h"
1924#include "cpu/m6809/m6809.h"
2025#include "sound/sn76496.h"
r1591r1592
4752static INTERRUPT_GEN( jb_interrupt )
4853{
4954   if (irq_enable)
50      cpunum_set_input_line(0, 0, HOLD_LINE);
55      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
5156}
5257
5358static INTERRUPT_GEN( jb_interrupt_nmi )
5459{
5560   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);
5762}
5863
5964
r1591r1592
236241static MACHINE_DRIVER_START( jailbrek )
237242
238243   /* basic machine hardware */
239   MDRV_CPU_ADD(M6809, 3000000)        /* 3 MHz ??? */
244   MDRV_CPU_ADD(M6809, MASTER_CLOCK/12)
240245   MDRV_CPU_PROGRAM_MAP(jailbrek_map, 0)
241246   MDRV_CPU_VBLANK_INT(jb_interrupt,1)
242247   MDRV_CPU_PERIODIC_INT(jb_interrupt_nmi, 500) /* ? */
243248
244   MDRV_SCREEN_REFRESH_RATE(60)
245   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
246
247249   MDRV_MACHINE_START(jailbrek)
248250
249251   /* video hardware */
250252   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)
254253   MDRV_GFXDECODE(jailbrek)
255254   MDRV_PALETTE_LENGTH(32)
256255   MDRV_COLORTABLE_LENGTH(512)
257256
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
258261   MDRV_PALETTE_INIT(jailbrek)
259262   MDRV_VIDEO_START(jailbrek)
260263   MDRV_VIDEO_UPDATE(jailbrek)
r1591r1592
262265   /* sound hardware */
263266   MDRV_SPEAKER_STANDARD_MONO("mono")
264267
265   MDRV_SOUND_ADD(SN76496, 1500000)
268   MDRV_SOUND_ADD(SN76496, MASTER_CLOCK/12)
266269   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
267270
268   MDRV_SOUND_ADD(VLM5030, 3580000)
271   MDRV_SOUND_ADD(VLM5030, VOICE_CLOCK)
269272   MDRV_SOUND_CONFIG(vlm5030_interface)
270273   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
271274MACHINE_DRIVER_END
src/mame/drivers/sgladiat.c
r1591r1592
6363   soundlatch_w( offset, data );
6464
6565   /* 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
6767}
6868
6969static READ8_HANDLER( sgladiat_soundlatch_r )
r1591r1592
7474
7575static READ8_HANDLER( sgladiat_sound_nmi_ack_r )
7676{
77//  cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE);
77//  cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
7878   return 0;
7979}
8080
src/mame/drivers/mlanding.c
r1591r1592
7777{
7878   //wrong
7979   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);
8381}
8482
8583static WRITE8_HANDLER( sound_bankswitch_w )
r1591r1592
339337
340338static void irq_handler(int irq)
341339{
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);
343341}
344342
345343static GFXDECODE_START( mlanding )
src/mame/drivers/gaelco.c
r1591r1592
7777{
7878   if (ACCESSING_LSB){
7979      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);
8181   }
8282}
8383
src/mame/drivers/tankbust.c
r1591r1592
7070//logerror("sound_irq_line write = %2x (after CPUs synced) \n",param);
7171
7272      if ((param&1) == 0)
73         cpunum_set_input_line(1, 0, HOLD_LINE);
73         cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
7474}
7575
7676
src/mame/drivers/wecleman.c
r1591r1592
371371
372372      // Bit 0 : SUBINT
373373      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);
375375
376376      // 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 );
379379
380380      // Bit 2 : SOUND-ON
381381      // Bit 3 : SOUNDRST
r1591r1592
651651   if (ACCESSING_LSB)
652652   {
653653      soundlatch_w(0,data & 0xFF);
654      cpunum_set_input_line(2,0, HOLD_LINE);
654      cpunum_set_input_line(Machine, 2,0, HOLD_LINE);
655655   }
656656}
657657
r1591r1592
719719   if (ACCESSING_LSB)
720720   {
721721      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);
723723   }
724724}
725725
r1591r1592
10941094static INTERRUPT_GEN( wecleman_interrupt )
10951095{
10961096   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 */
10981098   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 */
11001100}
11011101
11021102static const struct K007232_interface wecleman_k007232_interface =
r1591r1592
11621162
11631163static INTERRUPT_GEN( hotchase_sound_timer )
11641164{
1165   cpunum_set_input_line( 2, M6809_FIRQ_LINE, PULSE_LINE );
1165   cpunum_set_input_line(machine, 2, M6809_FIRQ_LINE, PULSE_LINE );
11661166}
11671167
11681168static MACHINE_DRIVER_START( hotchase )
src/mame/drivers/dmndrby.c
r1591r1592
167167
168168static INTERRUPT_GEN( dderby_interrupt )
169169{
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?
174174}
175175
176176static MACHINE_DRIVER_START( dderby )
src/mame/drivers/seattle.c
r1591r1592
583583
584584static void ide_interrupt(int state)
585585{
586   cpunum_set_input_line(0, IDE_IRQ_NUM, state);
586   cpunum_set_input_line(Machine, 0, IDE_IRQ_NUM, state);
587587}
588588
589589
r1591r1592
607607   {
608608      UINT8 assert = ethernet_irq_state && (*interrupt_enable & (1 << ETHERNET_IRQ_SHIFT));
609609      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);
611611   }
612612   else if (board_config == SEATTLE_WIDGET_CONFIG)
613613      update_widget_irq();
r1591r1592
629629
630630static void ioasic_irq(int state)
631631{
632   cpunum_set_input_line(0, IOASIC_IRQ_NUM, state);
632   cpunum_set_input_line(Machine, 0, IOASIC_IRQ_NUM, state);
633633}
634634
635635
r1591r1592
664664
665665   /* VBLANK: clear anything pending on the old IRQ */
666666   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);
668668
669669   /* VBLANK: compute the new IRQ vector */
670670   irq = (*interrupt_config >> (2*VBLANK_IRQ_SHIFT)) & 3;
r1591r1592
675675   {
676676      /* Widget: clear anything pending on the old IRQ */
677677      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);
679679
680680      /* Widget: compute the new IRQ vector */
681681      irq = (*interrupt_config >> (2*WIDGET_IRQ_SHIFT)) & 3;
r1591r1592
687687   {
688688      /* Ethernet: clear anything pending on the old IRQ */
689689      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);
691691
692692      /* Ethernet: compute the new IRQ vector */
693693      irq = (*interrupt_config >> (2*ETHERNET_IRQ_SHIFT)) & 3;
r1591r1592
732732   /* if the VBLANK has been latched, and the interrupt is enabled, assert */
733733   if (vblank_latch && (*interrupt_enable & (1 << VBLANK_IRQ_SHIFT)))
734734      state = ASSERT_LINE;
735   cpunum_set_input_line(0, vblank_irq_num, state);
735   cpunum_set_input_line(Machine, 0, vblank_irq_num, state);
736736}
737737
738738
r1591r1592
893893   /* if any unmasked interrupts are live, we generate */
894894   if (galileo.reg[GREG_INT_STATE] & galileo.reg[GREG_INT_MASK])
895895      state = ASSERT_LINE;
896   cpunum_set_input_line(0, GALILEO_IRQ_NUM, state);
896   cpunum_set_input_line(Machine, 0, GALILEO_IRQ_NUM, state);
897897
898898   if (LOG_GALILEO)
899899      logerror("Galileo IRQ %s\n", (state == ASSERT_LINE) ? "asserted" : "cleared");
r1591r1592
13761376
13771377         /* resume CPU execution */
13781378         if (LOG_DMA) logerror("Resuming CPU on voodoo\n");
1379         cpu_trigger(45678);
1379         cpu_trigger(Machine, 45678);
13801380      }
13811381   }
13821382}
r1591r1592
15111511
15121512   /* update the IRQ state */
15131513   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);
15151515}
15161516
15171517
src/mame/drivers/munchmo.c
r1591r1592
5151{
5252   static int which;
5353   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);
5656}
5757
5858static WRITE8_HANDLER( mnchmobl_soundlatch_w )
5959{
6060   soundlatch_w( offset, data );
61   cpunum_set_input_line( 1, 0, HOLD_LINE );
61   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
6262}
6363
6464static WRITE8_HANDLER( sound_nmi_ack_w )
6565{
66   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
66   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
6767}
6868
6969static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/btoads.c
r1591r1592
6767{
6868   main_to_sound_data = param;
6969   main_to_sound_ready = 1;
70   cpu_triggerint(1);
70   cpu_triggerint(machine, 1);
7171
7272   /* use a timer to make long transfers faster */
7373   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, 0);
r1591r1592
149149      sndti_reset(SOUND_BSMT2000, 0);
150150
151151   /* also clears interrupts */
152   cpunum_set_input_line(1, 0, CLEAR_LINE);
152   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
153153   sound_int_state = data;
154154}
155155
src/mame/drivers/tetrisp2.c
r1591r1592
10031003
10041004static TIMER_CALLBACK( rockn_timer_level4_callback )
10051005{
1006   cpunum_set_input_line(0, 4, HOLD_LINE);
1006   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
10071007}
10081008
10091009static TIMER_CALLBACK( rockn_timer_sub_level4_callback )
10101010{
1011   cpunum_set_input_line(1, 4, HOLD_LINE);
1011   cpunum_set_input_line(machine, 1, 4, HOLD_LINE);
10121012}
10131013
10141014
10151015static TIMER_CALLBACK( rockn_timer_level1_callback )
10161016{
1017   cpunum_set_input_line(0, 1, HOLD_LINE);
1017   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
10181018}
10191019
10201020static TIMER_CALLBACK( rockn_timer_sub_level1_callback )
10211021{
1022   cpunum_set_input_line(1, 1, HOLD_LINE);
1022   cpunum_set_input_line(machine, 1, 1, HOLD_LINE);
10231023}
10241024
10251025static void init_rockn_timer(running_machine *machine)
src/mame/drivers/lastduel.c
r1591r1592
231231/* handler called by the 2203 emulator when the internal timers cause an IRQ */
232232static void irqhandler(int irq)
233233{
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);
235235}
236236
237237static const struct YM2203interface ym2203_interface =
r1591r1592
241241
242242static INTERRUPT_GEN( lastduel_interrupt )
243243{
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 */
246248}
247249
248250static INTERRUPT_GEN( madgear_interrupt )
249251{
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 */
252256}
253257
254258static MACHINE_DRIVER_START( lastduel )
src/mame/drivers/alpha68k.c
r1591r1592
336336   if (ACCESSING_LSB)
337337   {
338338      soundlatch_w(0, data);
339      cpunum_set_input_line(1, 0, HOLD_LINE);
339      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
340340   }
341341}
342342
r1591r1592
345345   if (ACCESSING_LSB)
346346   {
347347      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);
349349   }
350350}
351351//ZT
r1591r1592
20302030
20312031static void YM3812_irq(int param)
20322032{
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);
20342034}
20352035
20362036static const struct YM3812interface ym3812_interface =
r1591r1592
20412041static INTERRUPT_GEN( alpha68k_interrupt )
20422042{
20432043   if (cpu_getiloops() == 0)
2044      cpunum_set_input_line(0, 1, HOLD_LINE);
2044      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
20452045   else
2046      cpunum_set_input_line(0, 2, HOLD_LINE);
2046      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
20472047}
20482048//ZT
20492049
src/mame/drivers/boxer.c
r1591r1592
2424   int mask = param;
2525
2626   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);
3028
3129   pot_state |= mask;
3230}
r1591r1592
3634{
3735   int scanline = param;
3836
39   cpunum_set_input_line(0, 0, ASSERT_LINE);
37   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
4038
4139   if (scanline == 0)
4240   {
r1591r1592
156154
157155   pot_latch = data & 0x3f;
158156
159   cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
157   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
160158}
161159
162160
163161static WRITE8_HANDLER( boxer_irq_reset_w )
164162{
165   cpunum_set_input_line(0, 0, CLEAR_LINE);
163   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
166164}
167165
168166
src/mame/drivers/tmaster.c
r1591r1592
242242   {
243243      case 0x0e:
244244         tmaster_draw();
245         cpunum_set_input_line(0, 2, HOLD_LINE);
245         cpunum_set_input_line(Machine, 0, 2, HOLD_LINE);
246246         break;
247247   }
248248}
r1591r1592
344344{
345345   switch (cpu_getiloops())
346346   {
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;
349349
350350      case 2:
351351      case 3:
352352      case 4:
353353      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
355355
356      default:   cpunum_set_input_line(0, 1, HOLD_LINE);   break;
356      default:   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);   break;
357357   }
358358}
359359
r1591r1592
389389{
390390   switch (cpu_getiloops())
391391   {
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;
396396   }
397397}
398398
src/mame/drivers/freekick.c
r1591r1592
118118
119119static INTERRUPT_GEN( freekick_irqgen )
120120{
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);
122122}
123123
124124static WRITE8_HANDLER(oigas_5_w)
src/mame/drivers/cischeat.c
r1591r1592
17251725static INTERRUPT_GEN( cischeat_interrupt )
17261726{
17271727   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 */
17291729   else
17301730   {
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);
17331733   }
17341734}
17351735
r1591r1592
18801880{
18811881   switch ( cpu_getiloops() )
18821882   {
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
18851885                                          // the main loop polls before updating the sprites.
18861886   }
18871887}
r1591r1592
19311931{
19321932   switch ( cpu_getiloops() )
19331933   {
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);
19361936   }
19371937}
19381938
r1591r1592
26872687{
26882688   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087fff, 0, 0, wildplt_vregs_r );
26892689
2690   driver_init_f1gpstar(machine);
2690   DRIVER_INIT_CALL(f1gpstar);
26912691}
26922692
26932693
src/mame/drivers/namcos22.c
r1591r1592
372372InitDSP( int bSuperSystem22 )
373373{
374374   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 */
378378} /* InitDSP */
379379
380380static READ16_HANDLER( pdp_status_r )
r1591r1592
554554
555555static void HaltSlaveDSP( void )
556556{
557   cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE);
557   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
558558}
559559
560560static void EnableSlaveDSP( void )
561561{
562//  cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE);
562//  cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
563563}
564564
565565static READ16_HANDLER( dsp_HOLD_signal_r )
r1591r1592
739739
740740      if( cpu_getiloops()==0 )
741741      {
742         cpunum_set_input_line(1, TMS32025_INT0, HOLD_LINE);
742         cpunum_set_input_line(machine, 1, TMS32025_INT0, HOLD_LINE);
743743      }
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);
748748   }
749749}
750750
r1591r1592
11321132*/
11331133static TIMER_CALLBACK( start_subcpu )
11341134{
1135   cpunum_set_input_line(3, INPUT_LINE_RESET, CLEAR_LINE);
1135   cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
11361136}
11371137
11381138static WRITE32_HANDLER( namcos22_system_controller_w )
r1591r1592
11691169      { /* SUBCPU enable for Super System 22 */
11701170         if (data)
11711171         {
1172            cpunum_set_input_line(3, INPUT_LINE_RESET, CLEAR_LINE);
1172            cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
11731173         }
11741174         else
11751175         {
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 */
11771177         }
11781178      }
11791179   }
r1591r1592
11951195   {
11961196      if( newReg == 0 )
11971197      { /* 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 */
12001200         mbEnableDspIrqs = 0;
12011201      }
12021202      else if( newReg==1 )
12031203      { /*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);
12051205         namcos22_enable_slave_simulation();
12061206         mbEnableDspIrqs = 1;
12071207      }
12081208      else if( newReg==0xff )
12091209      { /* 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);
12111211         mbEnableDspIrqs = 0;
12121212      }
12131213   }
r1591r1592
12301230   if( cpu_getiloops() == 0 )
12311231   {
12321232      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);
12341234      mFrameCount++;
12351235   }
12361236   else
r1591r1592
12381238      //int scanline_level = nthbyte(namcos22_system_controller,0x01)&0x7; /* $700005: ack */
12391239      //int sci_level      = nthbyte(namcos22_system_controller,0x02)&0x7; /* $700006: ack */
12401240      //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);
12421242   }
12431243}
12441244
r1591r1592
16291629            int i;
16301630            for (i = 0; i < 16; i++)
16311631            {
1632               cpunum_set_input_line(3, M37710_LINE_TIMERA3TICK, PULSE_LINE);
1632               cpunum_set_input_line(Machine, 3, M37710_LINE_TIMERA3TICK, PULSE_LINE);
16331633            }
16341634         }
16351635
r1591r1592
17861786{
17871787   if (cpu_getiloops() == 0)
17881788   {
1789       cpunum_set_input_line(3, M37710_LINE_IRQ0, HOLD_LINE);
1789       cpunum_set_input_line(machine, 3, M37710_LINE_IRQ0, HOLD_LINE);
17901790   }
17911791   else if (cpu_getiloops() == 1)
17921792   {
1793      cpunum_set_input_line(3, M37710_LINE_IRQ2, HOLD_LINE);
1793      cpunum_set_input_line(machine, 3, M37710_LINE_IRQ2, HOLD_LINE);
17941794   }
17951795   else
17961796   {
1797      cpunum_set_input_line(3, M37710_LINE_ADC, HOLD_LINE);
1797      cpunum_set_input_line(machine, 3, M37710_LINE_ADC, HOLD_LINE);
17981798   }
17991799}
18001800
r1591r1592
22002200   case 0:
22012201      if( irq_level1 )
22022202      {
2203         cpunum_set_input_line(0, irq_level1, HOLD_LINE); /* vblank */
2203         cpunum_set_input_line(machine, 0, irq_level1, HOLD_LINE); /* vblank */
22042204      }
22052205      break;
22062206   case 1:
22072207      if( irq_level2 )
22082208      {
2209         cpunum_set_input_line(0, irq_level2, HOLD_LINE); /* SCI */
2209         cpunum_set_input_line(machine, 0, irq_level2, HOLD_LINE); /* SCI */
22102210      }
22112211      break;
22122212   }
src/mame/drivers/flyball.c
r1591r1592
2828   int potsense = param;
2929
3030   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);
3432
3533   flyball_potsense |= potsense;
3634}
src/mame/drivers/redclash.c
r1591r1592
4545static INTERRUPT_GEN( redclash_interrupt )
4646{
4747   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);
4949   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);
5151}
5252
5353static WRITE8_HANDLER( irqack_w )
5454{
55   cpunum_set_input_line(0,0,CLEAR_LINE);
55   cpunum_set_input_line(Machine, 0,0,CLEAR_LINE);
5656}
5757
5858
src/mame/drivers/vicdual.c
r1591r1592
9292      coin_counter_w(0, 1);
9393      coin_counter_w(0, 0);
9494
95      cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
95      cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
9696
9797      /* simulate the coin switch being closed for a while */
9898      timer_set(double_to_attotime(4 * attotime_to_double(video_screen_get_frame_period(0))), NULL, 0, clear_coin_status);
src/mame/drivers/xybots.c
r1591r1592
3030 *
3131 *************************************/
3232
33static void update_interrupts(void)
33static void update_interrupts(running_machine *machine)
3434{
3535   int newstate = 0;
3636
r1591r1592
4040      newstate = 2;
4141
4242   if (newstate)
43      cpunum_set_input_line(0, newstate, ASSERT_LINE);
43      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4444   else
45      cpunum_set_input_line(0, 7, CLEAR_LINE);
45      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
4646}
4747
4848
src/mame/drivers/speglsht.c
r1591r1592
250250
251251 static INTERRUPT_GEN( irq4_gen )
252252{
253   cpunum_set_input_line(1, R3000_IRQ4, ASSERT_LINE);
253   cpunum_set_input_line(machine, 1, R3000_IRQ4, ASSERT_LINE);
254254}
255255
256256static const struct r3000_config config =
src/mame/drivers/rockola.c
r1591r1592
947947
948948      /* user asks to insert coin: generate a NMI interrupt. */
949949      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);
951951   }
952952   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 */
954954}
955955
956956static INTERRUPT_GEN( rockola_interrupt )
r1591r1592
964964
965965      /* user asks to insert coin: generate a NMI interrupt. */
966966      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);
968968   }
969969   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 */
971971}
972972
973973/* Machine Initialization */
src/mame/drivers/centiped.c
r1591r1592
449449
450450   /* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */
451451   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);
453453
454454   /* do a partial update now to handle sprite multiplexing (Maze Invaders) */
455455   video_screen_update_partial(0, scanline);
r1591r1592
475475{
476476   interrupt_timer = timer_alloc(generate_interrupt, NULL);
477477   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);
479479   dsw_select = 0;
480480   control_select = 0;
481481}
r1591r1592
483483
484484static MACHINE_RESET( magworm )
485485{
486   machine_reset_centiped(machine);
486   MACHINE_RESET_CALL(centiped);
487487
488488   /* kludge: clear RAM so that magworm can be reset cleanly */
489489   memset(rambase, 0, 0x400);
r1591r1592
492492
493493static WRITE8_HANDLER( irq_ack_w )
494494{
495   cpunum_set_input_line(0, 0, CLEAR_LINE);
495   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
496496}
497497
498498
src/mame/drivers/atarisy1.c
r1591r1592
152152 *
153153 *************************************/
154154
155static void update_interrupts(void)
155static void update_interrupts(running_machine *machine)
156156{
157157   int newstate = 0;
158158
r1591r1592
168168
169169   /* set the new state of the IRQ lines */
170170   if (newstate)
171      cpunum_set_input_line(0, newstate, ASSERT_LINE);
171      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
172172   else
173      cpunum_set_input_line(0, 7, CLEAR_LINE);
173      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
174174}
175175
176176
src/mame/drivers/wgp.c
r1591r1592
437437   /* bit 0 enables cpu B */
438438   /* however this fails when recovering from a save state
439439       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);
441441
442442   /* bit 1 is "vibration" acc. to test mode */
443443}
r1591r1592
463463/*
464464static TIMER_CALLBACK( wgp_interrupt4 )
465465{
466    cpunum_set_input_line(0,4,HOLD_LINE);
466    cpunum_set_input_line(machine, 0,4,HOLD_LINE);
467467}
468468*/
469469
470470static TIMER_CALLBACK( wgp_interrupt6 )
471471{
472   cpunum_set_input_line(0,6,HOLD_LINE);
472   cpunum_set_input_line(machine, 0,6,HOLD_LINE);
473473}
474474
475475/* 68000 B */
476476
477477static TIMER_CALLBACK( wgp_cpub_interrupt6 )
478478{
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 */
480480}
481481
482482
r1591r1592
489489static INTERRUPT_GEN( wgp_cpub_interrupt )
490490{
491491   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);
493493}
494494
495495
r1591r1592
665665   AM_RANGE(0x500000, 0x501fff) AM_READ(MRA16_RAM)   /* unknown/unused */
666666   AM_RANGE(0x502000, 0x517fff) AM_READ(wgp_pivram_word_r)   /* piv tilemaps */
667667   AM_RANGE(0x520000, 0x52001f) AM_READ(wgp_piv_ctrl_word_r)
668   AM_RANGE(0x700000, 0x701fff) AM_READ(paletteram16_word_r)
668   AM_RANGE(0x700000, 0x701fff) AM_READ(MRA16_RAM)
669669ADDRESS_MAP_END
670670
671671static ADDRESS_MAP_START( wgp_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
948948/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
949949static void irqhandler(int irq)   // assumes Z80 sandwiched between 68Ks
950950{
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);
952952}
953953
954954static const struct YM2610interface ym2610_interface =
src/mame/drivers/turbosub.c
r1591r1592
125125   bankaddress = 0x10000 + (data & 0x03) * 0x10000;
126126   memory_set_bankptr(1,&ROM[bankaddress]);
127127
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);
130130}
131131
132132/*
src/mame/drivers/welltris.c
r1591r1592
347347   {
348348      pending_command = 1;
349349      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);
351351   }
352352}
353353
r1591r1592
717717
718718static void irqhandler(int irq)
719719{
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);
721721}
722722
723723static const struct YM2610interface ym2610_interface =
src/mame/drivers/sprint8.c
r1591r1592
1818{
1919   if (collision_reset == 0)
2020   {
21      cpunum_set_input_line(0, 0, ASSERT_LINE);
21      cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
2222
2323      collision_index = n;
2424   }
r1591r1592
161161   collision_reset = !(data & 1);
162162
163163   if (collision_reset)
164   {
165      cpunum_set_input_line(0, 0, CLEAR_LINE);
166   }
164      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
167165}
168166
169167
src/mame/drivers/pturn.c
r1591r1592
426426{
427427   if(nmi_sub)
428428   {
429      cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
429      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
430430   }
431431}
432432
r1591r1592
434434{
435435   if (nmi_main)
436436   {
437      cpunum_set_input_line(0,INPUT_LINE_NMI,PULSE_LINE);
437      cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE);
438438   }
439439}
440440
src/mame/drivers/dec0.c
r1591r1592
6767         if (ACCESSING_LSB)
6868         {
6969            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);
7171         }
7272         break;
7373
r1591r1592
103103         if (ACCESSING_LSB)
104104         {
105105            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);
107107         }
108108         break;
109109      case 2:
r1591r1592
117117   if (ACCESSING_LSB)
118118   {
119119      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);
121121   }
122122}
123123
r1591r1592
904904
905905static void sound_irq(int linestate)
906906{
907   cpunum_set_input_line(1,0,linestate); /* IRQ */
907   cpunum_set_input_line(Machine, 1,0,linestate); /* IRQ */
908908}
909909
910910static void sound_irq2(int linestate)
911911{
912   cpunum_set_input_line(1,1,linestate); /* IRQ2 */
912   cpunum_set_input_line(Machine, 1,1,linestate); /* IRQ2 */
913913}
914914
915915static const struct YM3812interface ym3812_interface =
r1591r1592
11981198   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)/* VBL */
11991199
12001200   MDRV_CPU_ADD(H6280, XTAL_12MHz/2/3)
1201   /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, pin 14 (HSM) is high so XIN/3 */
1201   /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verified on pcb */
12021202   MDRV_CPU_PROGRAM_MAP(slyspy_s_readmem,slyspy_s_writemem)
12031203
12041204   MDRV_SCREEN_REFRESH_RATE(57.41)
r1591r1592
12411241   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)/* VBL */
12421242
12431243   MDRV_CPU_ADD(H6280, XTAL_24MHz/4/3)
1244   /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, pin 14 (HSM) is high so XIN/3 */
1244   /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verified on pcb */
12451245   MDRV_CPU_PROGRAM_MAP(midres_s_readmem,midres_s_writemem)
12461246
12471247   MDRV_SCREEN_REFRESH_RATE(57.41)
src/mame/drivers/ssv.c
r1591r1592
202202/* Update the IRQ state based on all possible causes */
203203static void update_irq_state(void)
204204{
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);
206206}
207207
208208static int ssv_irq_callback(int level)
src/mame/drivers/taitoair.c
r1591r1592
246246
247247   dsp_HOLD_signal = (data & 4) ? CLEAR_LINE : ASSERT_LINE;
248248
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);
250250
251251   logerror("68K:%06x writing %04x to TMS32025.  %s HOLD , %s RESET\n",activecpu_get_previouspc(),data,((data & 4) ? "Clear" : "Assert"),((data & 1) ? "Clear" : "Assert"));
252252}
r1591r1592
374374   AM_RANGE(0x140000, 0x140001) AM_WRITE(system_control_w)   /* Pause the TMS32025 */
375375   AM_RANGE(0x180000, 0x183fff) AM_RAM                    /* "gradiation ram (0)" */
376376   AM_RANGE(0x184000, 0x187fff) AM_RAM                     /* "gradiation ram (1)" */
377   AM_RANGE(0x188000, 0x18bfff) AM_READWRITE(paletteram16_word_r, airsys_paletteram16_w) AM_BASE(&paletteram16)
377   AM_RANGE(0x188000, 0x18bfff) AM_READWRITE(MRA16_RAM, airsys_paletteram16_w) AM_BASE(&paletteram16)
378378   AM_RANGE(0x800000, 0x820fff) AM_READWRITE(TC0080VCO_word_r, TC0080VCO_word_w)   /* tilemaps, sprites */
379379   AM_RANGE(0x908000, 0x90ffff) AM_RAM AM_BASE(&taitoair_line_ram)   /* "line ram" */
380380   AM_RANGE(0x910000, 0x91ffff) AM_RAM   AM_BASE(&dsp_ram)   /* "dsp common ram" (TMS320C25) */
r1591r1592
572572/* Handler called by the YM2610 emulator when the internal timers cause an IRQ */
573573static void irqhandler(int irq)
574574{
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);
576576}
577577
578578static const struct YM2610interface airsys_ym2610_interface =
src/mame/drivers/atarig42.c
r1591r1592
4949 *
5050 *************************************/
5151
52static void update_interrupts(void)
52static void update_interrupts(running_machine *machine)
5353{
5454   int newstate = 0;
5555
r1591r1592
5959      newstate = 5;
6060
6161   if (newstate)
62      cpunum_set_input_line(0, newstate, ASSERT_LINE);
62      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
6363   else
64      cpunum_set_input_line(0, 7, CLEAR_LINE);
64      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
6565}
6666
6767
r1591r1592
119119   if (ACCESSING_LSB)
120120   {
121121      /* 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);
123123      if (!(data & 0x10)) atarijsa_reset();
124124
125125      /* bit 5 is /XRESET, probably related to the ASIC */
src/mame/drivers/tceptor.c
r1591r1592
6262static INTERRUPT_GEN( m6809_vb_interrupt )
6363{
6464   if (m6809_irq_enable)
65      cpunum_set_input_line(0, 0, HOLD_LINE);
65      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
6666   else
6767      m6809_irq_enable = 1;
6868}
r1591r1592
8181static INTERRUPT_GEN( m68k_vb_interrupt )
8282{
8383   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);
8585}
8686
8787static WRITE16_HANDLER( m68k_irq_enable_w )
r1591r1592
9393static INTERRUPT_GEN( mcu_vb_interrupt )
9494{
9595   if (mcu_irq_enable)
96      cpunum_set_input_line(4, 0, HOLD_LINE);
96      cpunum_set_input_line(machine, 4, 0, HOLD_LINE);
9797   else
9898      mcu_irq_enable = 1;
9999}
r1591r1592
447447   MDRV_CPU_PROGRAM_MAP(m68k_map,0)
448448   MDRV_CPU_VBLANK_INT(m68k_vb_interrupt,1)
449449
450   MDRV_CPU_ADD(HD63701, 49152000/32)   /* or compatible 6808 with extra instructions */
450   MDRV_CPU_ADD(HD63701, 49152000/8)   /* or compatible 6808 with extra instructions */
451451   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
452452   MDRV_CPU_IO_MAP(mcu_io_map,0)
453453   MDRV_CPU_VBLANK_INT(mcu_vb_interrupt,1)
src/mame/drivers/cop01.c
r1591r1592
6969static WRITE8_HANDLER( cop01_sound_command_w )
7070{
7171   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);
7373}
7474
7575static READ8_HANDLER( cop01_sound_command_r )
src/mame/drivers/vindictr.c
r1591r1592
3030 *
3131 *************************************/
3232
33static void update_interrupts(void)
33static void update_interrupts(running_machine *machine)
3434{
3535   int newstate = 0;
3636
r1591r1592
4040      newstate |= 6;
4141
4242   if (newstate)
43      cpunum_set_input_line(0, newstate, ASSERT_LINE);
43      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4444   else
45      cpunum_set_input_line(0, 7, CLEAR_LINE);
45      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
4646}
4747
4848
src/mame/drivers/mpu4drvr.c
r1591r1592
223223{
224224   ROC10937_reset(0);   // reset display1
225225
226//  cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
226//  cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
227227   mpu4_stepper_reset();
228228
229229   lamp_strobe    = 0;
r1591r1592
275275   if (newstate)
276276   {
277277      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);
279279   }
280280   else
281281   {
282282      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);
284284   }
285285}
286286
r1591r1592
292292static void m6809_acia_irq(int state)
293293{
294294   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);
296296}
297297
298298static void m68k_acia_irq(int state)
src/mame/drivers/aquarium.c
r1591r1592
102102//  popmessage("sound write %04x",data);
103103
104104   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 );
106106}
107107
108108static WRITE8_HANDLER( aquarium_z80_bank_w )
r1591r1592
355355
356356static void irq_handler(int irq)
357357{
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 );
359359}
360360
361361static const struct YM2151interface ym2151_interface =
src/mame/drivers/metro.c
r1591r1592
166166      {
167167         if (irq & (1 << i))
168168         {
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);
170170            return;
171171         }
172172         i++;
173173      }
174      cpunum_set_input_line(0, 0, ASSERT_LINE);
174      cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
175175   }
176176   else
177177   {
r1591r1592
180180            source by peeking a register (metro_irq_cause_r) */
181181
182182      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);
184184   }
185185}
186186
r1591r1592
319319
320320static void ymf278b_interrupt(int active)
321321{
322   cpunum_set_input_line(0, 2, active);
322   cpunum_set_input_line(Machine, 0, 2, active);
323323}
324324
325325/***************************************************************************
r1591r1592
356356   if (ACCESSING_LSB)
357357   {
358358      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);
360360      cpu_spinuntil_int();
361361      busy_sndcpu = 1;
362362   }
r1591r1592
514514
515515static void metro_sound_irq_handler(int state)
516516{
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);
518518}
519519
520520static const struct YM2151interface ym2151_interface =
r1591r1592
19251925static WRITE16_HANDLER( blzntrnd_sound_w )
19261926{
19271927   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);
19291929}
19301930
19311931static WRITE8_HANDLER( blzntrnd_sh_bankswitch_w )
r1591r1592
19391939
19401940static void blzntrnd_irqhandler(int irq)
19411941{
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);
19431943}
19441944
19451945static const struct YM2610interface blzntrnd_ym2610_interface =
r1591r1592
45624562for (i = 0;i < (0x20000*3)/2;i++)
45634563   RAM[i] = mame_rand(machine);
45644564
4565   driver_init_metro(machine);
4565   DRIVER_INIT_CALL(metro);
45664566}
45674567
45684568static DRIVER_INIT( daitorid )
r1591r1592
46184618      src[i+3] = dat;
46194619   }
46204620
4621   driver_init_metro(machine);
4621   DRIVER_INIT_CALL(metro);
46224622}
46234623
46244624static DRIVER_INIT( blzntrnd )
src/mame/drivers/angelkds.c
r1591r1592
562562
563563static void irqhandler(int irq)
564564{
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);
566566}
567567
568568static const struct YM2203interface ym2203_interface =
src/mame/drivers/jrpacman.c
r1591r1592
106106static WRITE8_HANDLER( jrpacman_interrupt_vector_w )
107107{
108108   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);
110110}
111111
112112
src/mame/drivers/hshavoc.c
r1591r1592
317317
318318
319319
320   driver_init_genesis(machine);
320   DRIVER_INIT_CALL(genesis);
321321
322322}
323323
src/mame/drivers/circusc.c
r1591r1592
7171
7272static WRITE8_HANDLER( circusc_sh_irqtrigger_w )
7373{
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);
7575}
7676
7777static WRITE8_HANDLER( circusc_coin_counter_w )
src/mame/drivers/laserbas.c
r1591r1592
121121static INTERRUPT_GEN( laserbas_interrupt )
122122{
123123   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);
125125   else
126      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
126      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
127127}
128128
129129static MACHINE_DRIVER_START( laserbas )
src/mame/drivers/mikie.c
r1591r1592
4949   if (last == 0 && data == 1)
5050   {
5151      // 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);
5353   }
5454
5555   last = data;
src/mame/drivers/midvunit.c
r1591r1592
146146{
147147   if (!(control_data & 0x40))
148148   {
149      cpunum_set_input_line(0, 3, CLEAR_LINE);
149      cpunum_set_input_line(Machine, 0, 3, CLEAR_LINE);
150150      return adc_data << adc_shift;
151151   }
152152   else
r1591r1592
157157
158158static TIMER_CALLBACK( adc_ready )
159159{
160   cpunum_set_input_line(0, 3, ASSERT_LINE);
160   cpunum_set_input_line(machine, 0, 3, ASSERT_LINE);
161161}
162162
163163
src/mame/drivers/kingpin.c
r1591r1592
132132
133133static void vdp_interrupt (int state)
134134{
135   cpunum_set_input_line(0,0, HOLD_LINE);
135   cpunum_set_input_line(Machine, 0,0, HOLD_LINE);
136136}
137137
138138static const TMS9928a_interface tms9928a_interface =
src/mame/drivers/namcond1.c
r1591r1592
273273{
274274    if( namcond1_h8_irq5_enabled )
275275    {
276       cpunum_set_input_line(1, H8_IRQ5, PULSE_LINE);
276       cpunum_set_input_line(machine, 1, H8_IRQ5, PULSE_LINE);
277277    }
278278}
279279
src/mame/drivers/opwolf.c
r1591r1592
194194   AM_RANGE(0x0f0000, 0x0f07ff) AM_MIRROR(0xf000) AM_READ(opwolf_cchip_data_r)
195195   AM_RANGE(0x0f0802, 0x0f0803) AM_MIRROR(0xf000) AM_READ(opwolf_cchip_status_r)
196196   AM_RANGE(0x100000, 0x107fff) AM_READ(MRA16_RAM)   /* RAM */
197   AM_RANGE(0x200000, 0x200fff) AM_READ(paletteram16_word_r)
197   AM_RANGE(0x200000, 0x200fff) AM_READ(MRA16_RAM)
198198   AM_RANGE(0x380000, 0x380003) AM_READ(opwolf_dsw_r)   /* dip switches */
199199   AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r)   /* lightgun, read at $11e0/6 */
200200   AM_RANGE(0x3e0000, 0x3e0001) AM_READ(MRA16_NOP)
r1591r1592
228228   AM_RANGE(0x0f0008, 0x0f000b) AM_READ(opwolf_in_r)   /* coins and buttons */
229229   AM_RANGE(0x0ff000, 0x0fffff) AM_READ(cchip_r)
230230   AM_RANGE(0x100000, 0x107fff) AM_READ(MRA16_RAM)   /* RAM */
231   AM_RANGE(0x200000, 0x200fff) AM_READ(paletteram16_word_r)
231   AM_RANGE(0x200000, 0x200fff) AM_READ(MRA16_RAM)
232232   AM_RANGE(0x380000, 0x380003) AM_READ(opwolf_dsw_r)   /* dip switches */
233233   AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r)   /* lightgun, read at $11e0/6 */
234234   AM_RANGE(0x3e0000, 0x3e0001) AM_READ(MRA16_NOP)
r1591r1592
538538
539539static void irq_handler(int irq)
540540{
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);
542542}
543543
544544
src/mame/drivers/surpratk.c
r1591r1592
2525
2626static INTERRUPT_GEN( surpratk_interrupt )
2727{
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);
2929}
3030
3131static READ8_HANDLER( bankedram_r )
r1591r1592
3333   if (videobank & 0x02)
3434   {
3535      if (videobank & 0x04)
36         return paletteram_r(offset + 0x0800);
36         return paletteram[offset + 0x0800];
3737      else
38         return paletteram_r(offset);
38         return paletteram[offset];
3939   }
4040   else if (videobank & 0x01)
4141      return K053245_r(offset);
r1591r1592
223223
224224static void irqhandler(int linestate)
225225{
226   cpunum_set_input_line(0,KONAMI_FIRQ_LINE,linestate);
226   cpunum_set_input_line(Machine, 0,KONAMI_FIRQ_LINE,linestate);
227227}
228228
229229static const struct YM2151interface ym2151_interface =
src/mame/drivers/suna16.c
r1591r1592
837837{
838838   switch (cpu_getiloops())
839839   {
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;
842842   }
843843}
844844
r1591r1592
10081008
10091009static void bestbest_ym3526_irqhandler(int state)
10101010{
1011   cpunum_set_input_line(1, INPUT_LINE_IRQ0, state);
1011   cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, state);
10121012}
10131013
10141014static const struct YM3526interface bestbest_ym3526_interface =
src/mame/drivers/zaccaria.c
r1591r1592
9999}
100100
101101
102static void zaccaria_irq0a(int state) { cpunum_set_input_line(1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); }
103static void zaccaria_irq0b(int state) { cpunum_set_input_line(1,0,state ? ASSERT_LINE : CLEAR_LINE); }
102static void zaccaria_irq0a(int state) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); }
103static void zaccaria_irq0b(int state) { cpunum_set_input_line(Machine, 1,0,state ? ASSERT_LINE : CLEAR_LINE); }
104104
105105static int active_8910,port0a,acs;
106106
r1591r1592
257257static WRITE8_HANDLER( sound_command_w )
258258{
259259   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);
261261}
262262
263263static WRITE8_HANDLER( sound1_command_w )
r1591r1592
663663   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
664664   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
665665
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 */
668667   MDRV_CPU_PROGRAM_MAP(sound_readmem1,sound_writemem1)
669668   MDRV_CPU_PERIODIC_INT(zaccaria_cb1_toggle,(double)3580000/4096)
670669
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 */
673671   MDRV_CPU_PROGRAM_MAP(sound_readmem2,sound_writemem2)
674672
675673   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/shadfrce.c
r1591r1592
212212   if (ACCESSING_MSB)
213213   {
214214      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 );
216216   }
217217   else
218218   {
r1591r1592
533533
534534static void irq_handler(int irq)
535535{
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 );
537537}
538538
539539static const struct YM2151interface ym2151_interface =
r1591r1592
543543
544544static INTERRUPT_GEN( shadfrce_interrupt ) {
545545   if( cpu_getiloops() == 0 )
546      cpunum_set_input_line(0, 3, HOLD_LINE);
546      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
547547   else
548      cpunum_set_input_line(0, 2, HOLD_LINE);
548      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
549549}
550550
551551
src/mame/drivers/littlerb.c
r1591r1592
374374   MDRV_PALETTE_LENGTH(256)
375375
376376//  MDRV_PALETTE_INIT(littlerb)
377   MDRV_VIDEO_START(generic_bitmapped)
378377   MDRV_VIDEO_UPDATE(littlerb)
379378MACHINE_DRIVER_END
380379
src/mame/drivers/firebeat.c
r1591r1592
847847
848848static void atapi_cause_irq(void)
849849{
850   cpunum_set_input_line(0, INPUT_LINE_IRQ4, ASSERT_LINE);
850   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ4, ASSERT_LINE);
851851}
852852
853853static void atapi_exit(running_machine* machine)
r1591r1592
12601260static void comm_uart_irq_callback(int channel, int value)
12611261{
12621262   // TODO
1263   //cpunum_set_input_line(0, INPUT_LINE_IRQ2, ASSERT_LINE);
1263   //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ2, ASSERT_LINE);
12641264}
12651265
12661266/*****************************************************************************/
r1591r1592
14161416      if ((extend_board_irq_enable & 0x02) == 0)
14171417      {
14181418         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);
14201420      }
14211421   }
14221422   else
r1591r1592
14241424      if ((extend_board_irq_enable & 0x01) == 0)
14251425      {
14261426         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);
14281428      }
14291429   }
14301430}
r1591r1592
19621962   // IRQ 2: Main board UART
19631963   // IRQ 4: ATAPI
19641964
1965   cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
1965   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
19661966}
19671967
19681968static MACHINE_RESET( firebeat )
src/mame/drivers/tagteam.c
r1591r1592
4646static WRITE8_HANDLER( sound_command_w )
4747{
4848   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);
5050}
5151
5252
r1591r1592
106106      if (coin == 0)
107107      {
108108         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);
110110      }
111111   }
112112   else coin = 0;
src/mame/drivers/bigevglf.c
r1591r1592
141141
142142static TIMER_CALLBACK( nmi_callback )
143143{
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);
145145   else pending_nmi = 1;
146146   sound_state &= ~1;
147147}
r1591r1592
167167   sound_nmi_enable = 1;
168168   if (pending_nmi)
169169   {
170      cpunum_set_input_line(2,INPUT_LINE_NMI,PULSE_LINE);
170      cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE);
171171      pending_nmi = 0;
172172   }
173173}
src/mame/drivers/bagman.c
r1591r1592
555555
556556static const struct TMS5110interface tms5110_interface =
557557{
558   TMS5110_IS_5110A,
559558   -1,      /* ROM_REGION */
560559   bagman_speech_rom_read_bit   /*M0 callback function. Called whenever chip requests a single bit of data*/
561560};
r1591r1592
592591   MDRV_SOUND_CONFIG(ay8910_interface)
593592   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
594593
595   MDRV_SOUND_ADD(TMS5110, 640000)
594   MDRV_SOUND_ADD(TMS5110A, 640000)
596595   MDRV_SOUND_CONFIG(tms5110_interface)
597596   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
598597MACHINE_DRIVER_END
src/mame/drivers/namcos23.c
r1591r1592
607607      if (data)
608608      {
609609         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);
611611      }
612612      else
613613      {
614614         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);
616616      }
617617   }
618618}
src/mame/drivers/inufuku.c
r1591r1592
109109
110110      pending_command = 1;
111111      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);
113113   }
114114}
115115
r1591r1592
378378
379379static void irqhandler(int irq)
380380{
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);
382382}
383383
384384static const struct YM2610interface ym2610_interface =
src/mame/drivers/commando.c
r1591r1592
231231
232232static INTERRUPT_GEN( commando_interrupt )
233233{
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
235235}
236236
237237/* Machine Driver */
src/mame/drivers/atarisy2.c
r1591r1592
182182 *
183183 *************************************/
184184
185static void update_interrupts(void)
185static void update_interrupts(running_machine *machine)
186186{
187187   if (atarigen_video_int_state)
188      cpunum_set_input_line(0, 3, ASSERT_LINE);
188      cpunum_set_input_line(machine, 0, 3, ASSERT_LINE);
189189   else
190      cpunum_set_input_line(0, 3, CLEAR_LINE);
190      cpunum_set_input_line(machine, 0, 3, CLEAR_LINE);
191191
192192   if (atarigen_scanline_int_state)
193      cpunum_set_input_line(0, 2, ASSERT_LINE);
193      cpunum_set_input_line(machine, 0, 2, ASSERT_LINE);
194194   else
195      cpunum_set_input_line(0, 2, CLEAR_LINE);
195      cpunum_set_input_line(machine, 0, 2, CLEAR_LINE);
196196
197197   if (p2portwr_state)
198      cpunum_set_input_line(0, 1, ASSERT_LINE);
198      cpunum_set_input_line(machine, 0, 1, ASSERT_LINE);
199199   else
200      cpunum_set_input_line(0, 1, CLEAR_LINE);
200      cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
201201
202202   if (p2portrd_state)
203      cpunum_set_input_line(0, 0, ASSERT_LINE);
203      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
204204   else
205      cpunum_set_input_line(0, 0, CLEAR_LINE);
205      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
206206}
207207
208208
r1591r1592
302302{
303303   /* reset sound CPU */
304304   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);
306306}
307307
308308
src/mame/drivers/ninjakd2.c
r1591r1592
1/***************************************************************************
1/******************************************************************************
22
3 *****************************
4 *** NINJA KID II hardware ***      (by Roberto Ventura)
5 *****************************
3UPL "sprite framebuffer" hardware
64
7Game authors:
8Game design:    Tsutomu Fuzisawa
9Program design: Satoru Kinjo
10Char. design:   Tsutomu Fizisawa
11Char. design:   Akemi Tsunoda
12Sound compose:  Tsutomu Fuzisawa
13Bgm create:     Mecano Associate
14Data make:      Takashi Hayashi
5driver by Roberto Ventura, Leandro Dardini, Yochizo, Nicola Salmoria
156
16General aspect.
7The peculiar feature of this hardware is the ability to disable clearing of the
8sprite framebuffer, therefore overdrawing new sprites on top of the ones drawn
9in the previous frames.
10When sprite overdrawing is enabled, not all sprites leave trails: only the ones
11using color codes C, D, and E. Sprites using color code F have the special
12effect of clearing the trails which have been left by other sprites.
1713
18The game is driven by a fast Z80 CPU.
19Screen resolution is 256x192.
20768 colors on screen.
2196 sprites.
2214
23Rom Contents:
15Game              Board
16----------------  ---------
17Ninja Kid II      UPL-87003
18Mutant Night      UPL-?????
19Ark Area          UPL-87007
20Atomic Robo-Kid   UPL-88013
21Omega Fighter     UPL-89016
2422
25NK2_01.ROM              Main CPU program ROM
26NK2_02.ROM              CPU banked data ROM 0 (banks 0 and 1)
27NK2_03.ROM              CPU banked data ROM 1 (banks 2 and 3)
28NK2_04.ROM              CPU banked data ROM 2 (banks 4 and 5)
29NK2_05.ROM              CPU banked data ROM 3 (banks 6 and 7)
30NK2_06.ROM              Sound CPU program ROM (encrypted)
31NK2_07.ROM              Sprites data ROM 1
32NK2_08.ROM              Sprites data ROM 0
33NK2_09.ROM              Raw PCM samples (complete?)
34NK2_10.ROM              Background data ROM 1
35NK2_11.ROM              Background data ROM 0
36NK2_12.ROM              Foreground data ROM
3723
38*** MEMORY MAP ***
24Hardware Overview:
25------------------
261xZ80 @ 6MHz (main CPU)
271xZ80 @ 5MHz (sound CPU)
282xYM2203 @ 1.5MHz
29PCM samples (Ninja Kid II only?)
3930
400000-7fff       Main CPU ROM
418000-bfff       Banked CPU ROM
42c000-c7ff       I/O
43c800-cdff       Color RAM
44d000-d7ff       "FRONT" tile map
45d800-dfff       "BACK" tile map
46e000-efff       Main RAM
47f400-f7ff   ??? screen frame ???
48f800-f9ff   CPU Stack
49fa00-ffff       Sprite registers (misc RAM)
31Resolution: 256x192
3296 sprites
33Tilemaps: fg 256x256 (8x8) + bg 512x512 (16x16)
34Atomic Robo-Kid adds two more bg tilemaps, at the same resolution
35Omega Fighter further improves by increasing the bg resolution to 2048x512.
5036
37768 colors on screen out of a palette of 4096
5138
521) CPU
5339
541 OSC 12 MHz
551 OSC 5 MHz
562 YM 2203C.......CaBBe!.
40Designers:
41----------
42Ninja 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
5749
58The Z80 runs in IM0,the game expects execution of RST10 each
59frame.
50Mutant 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
6056
61Game level maps,additional code and data are available to main
62program via CPU banking at lacations 8000-bf00
57Ark Area:
58* Tsutomu Fuzisawa, Hiropi, Mingma, Nihei, Nozawa
6359
64In two of the sets, the encrypted sound program ROM is replaced with a
65double-sized decrypted version. I don0t know if they are bootlegs or originals.
60Atomic 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
6667
68Omega Fighter:
69* Iwatani, Nobuyuki Narita, Abe, Akemi Tsunoda, Nikei, Shigksa, T.T, Ohnuma
6770
6871
692) I/O
72Notes:
73------
74- Press 2 to skip the settings screen on startup.
7075
71c000    "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.
7279
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.
8083
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.
8188
82c001    "PAD1"
83c002    "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"
8497
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.
93100
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.
94104
95c003    "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.
96110
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.
107115
116TODO:
117-----
118- Ninja Kid II PCM sample playback frequency is not verified
108119
109c004 "DIPSW2"
120- What does the "credit service" dip switch do in Ninja Kid II?
110121
111        76543210
112        ||||||||
113        |||||||^-TEST MODE
114        ||||||^--TABLE/UPRIGHT
115        |||||^---"CREDIT SERVICE"
116        ||||^---->
117        |||^----->>
118        ||^------>>> coin/credit configurations
119        |^------->>
120        ^-------->
122******************************************************************************/
121123
122c200    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"
126129
127c201    Unknown,but used.
130#define MAIN_CLOCK_12 XTAL_12MHz
131#define MAIN_CLOCK_5  XTAL_5MHz
128132
129c202 Bank selector (0 to 7)
133static const INT16* ninjakd2_sampledata;
130134
131c203    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...
135static UINT8 omegaf_io_protection[3];
136static UINT8 omegaf_io_protection_input;
137static int omegaf_io_protection_tic;
138static void omegaf_io_protection_reset(void);
141139
142C208    Scroll X  0-7
143140
144C209    Scroll X  MSB
141static INTERRUPT_GEN( ninjakd2_interrupt )
142{
143   cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7);   /* RST 10h */
144}
145145
146C20A    Scroll Y  0-7
147146
148C20B    Scroll Y  MSB
147static 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}
149153
150C20C    Background ENABLE
151        when set to zero the background is totally black,but
152        sprites are drawn correctly.
154static 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}
153161
162static MACHINE_RESET( robokid )
163{
164   robokid_init_banks();
165}
154166
1553) COLOR RAM
167static MACHINE_RESET( omegaf )
168{
169   robokid_init_banks();
156170
157The palette system is dynamic,the game can show up to 768 different
158colors on screen.
171   omegaf_io_protection_reset();
172}
159173
160Palette depth is 12 bits as usual,two consecutive bytes are used for each
161color code.
162174
163format: RRRRGGGGBBBB0000
175static WRITE8_HANDLER( ninjakd2_bankselect_w )
176{
177   memory_set_bank(1, data & 0x7);
178}
164179
165Colors are organized in palettes,since graphics is 4 bits (16 colors)
166each palette takes 32 bytes,the three different layers,BACK,SPRITES and
167FRONT don't share any color,each has its own 256 color space,hence the
168768 colors on screen.
180static WRITE8_HANDLER( robokid_bankselect_w )
181{
182   memory_set_bank(1, data & 0xf);
183}
169184
170c800-c9ff       Background palettes
171ca00-cbff       Sprites palettes
172cc00-cdff       Foreground palettes
173185
186static 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);
174190
1754) TILE-BASED LAYERS
191   // bit 7 flips screen
192   flip_screen_set(data & 0x80);
176193
177The tile format for background and foreground is the same,the
178only difference is that background tiles are 16x16 pixels while foreground
179tiles are only 8x8.
194   // other bits unused
195}
180196
181Background virtual screen is 512x512 pixels scrollable.
182197
183Two consecutive tiles bytes identify one tile.
184198
185        O7 O6 O5 O4 O3 O2 O1 O0         gfx Offset
186        O9 O8 FY FX C3 C2 C1 C0         Attibute
199static void ninjakd2_init_samples(void)
200{
201   const UINT8* const rom = memory_region(REGION_SOUND1);
187202
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);
191204
205   INT16* const sampledata = auto_malloc(length * sizeof(sampledata[0]));
192206
1935) SPRITES
207   int i;
194208
195Five bytes identify each sprite,but the registers actually used
196are placed at intervals of 16.
197Some of the remaining bytes are used (e.g. fa00),their meaning is totally
198unknown to me,they seem to be related to the surprising additional sprite
199feature 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;
200212
201The first sprite data is located at fa0b,then fa1b and so on.
213   ninjakd2_sampledata = sampledata;
214}
202215
216static WRITE8_HANDLER( ninjakd2_pcm_play_w )
217{
218   const UINT8* const rom = memory_region(REGION_SOUND1);
203219
2040b      Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0         Y coord
2050c      X7 X6 X5 X4 X3 X2 X1 X0         X coord
2060d      O9 O8 FY FX -- -- EN X8         hi gfx - FLIP - Enable - hi X
2070e      O7 O6 O5 O4 O3 O2 O1 O0         gfx - offset
2080f      -- -- -- -- 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);
209224
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;
217226
218***************************************************************************/
227      int end;
219228
229      // find end of sample
230      end = start;
231      while (end < length && rom[end] != 0x00)
232         ++end;
220233
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}
225240
226extern WRITE8_HANDLER( ninjakd2_bgvideoram_w );
227extern WRITE8_HANDLER( ninjakd2_fgvideoram_w );
228extern WRITE8_HANDLER( ninjakd2_scrollx_w );
229extern WRITE8_HANDLER( ninjakd2_scrolly_w );
230extern WRITE8_HANDLER( ninjakd2_sprite_overdraw_w );
231extern WRITE8_HANDLER( ninjakd2_background_enable_w );
232extern VIDEO_START( ninjakd2 );
233extern VIDEO_UPDATE( ninjakd2 );
234241
235extern UINT8 *ninjakd2_bg_videoram, *ninjakd2_fg_videoram;
236242
237static int ninjakd2_bank_latch = 255;
238static INT16 *sampledata[8];
239static int samplelen[8];
243/*************************************
244 *
245 *  Omega Fighter I/O protection simulation
246 *
247 *************************************/
240248
241static void ninjakd2_init_samples(void)
249void omegaf_io_protection_reset(void)
242250{
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}
247258
248   for (i=0;i<8;i++)
259static READ8_HANDLER( omegaf_io_protection_r )
260{
261   UINT8 result = 0xff;
262
263   switch (omegaf_io_protection[1] & 3)
249264   {
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;
256286
287                           // second interrogation
288                           case 0x8c:
289                              result = 0x80 | 0x1f;
290                              break;
257291
258static 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;
262299
263#ifdef UNUSED_FUNCTION
264READ8_HANDLER( ninjakd2_bankselect_r )
265{
266   return ninjakd2_bank_latch;
267}
268#endif
300                  case 0x20:
301                     result = 0xc7;
302                     break;
269303
270static WRITE8_HANDLER( ninjakd2_bankselect_w )
271{
272   UINT8 *ROM = memory_region(REGION_CPU1);
273   int bankaddress;
304                  case 0x60:
305                     result = 0x00;
306                     break;
274307
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;
278311
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;
281337   }
338
339   return result;
282340}
283341
284static WRITE8_HANDLER( ninjakd2_pcm_play_w )
342static WRITE8_HANDLER( omegaf_io_protection_w )
285343{
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   }
288350
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;
296352}
297353
354
355
356/*************************************
357 *
358 *  Memory maps
359 *
360 *************************************/
361
298362static ADDRESS_MAP_START( ninjakd2_main_cpu, ADDRESS_SPACE_PROGRAM, 8 )
299363   AM_RANGE(0x0000, 0x7fff) AM_ROM
300364   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")
306370   AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w)
307   AM_RANGE(0xc201, 0xc201) AM_WRITENOP      // unknown but used
371   AM_RANGE(0xc201, 0xc201) AM_WRITE(ninjakd2_soundreset_w)   // sound reset + flip screen
308372   AM_RANGE(0xc202, 0xc202) AM_WRITE(ninjakd2_bankselect_w)
309373   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
313375   AM_RANGE(0xc800, 0xcdff) AM_RAM AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram)
314376   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(&ninjakd2_fg_videoram)
315377   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(&ninjakd2_bg_videoram)
316378   AM_RANGE(0xe000, 0xf9ff) AM_RAM
317   AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
379   AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(&spriteram)
318380ADDRESS_MAP_END
319381
382
383static 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
401ADDRESS_MAP_END
402
403
404static 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)
429ADDRESS_MAP_END
430
431
432static 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)
456ADDRESS_MAP_END
457
458
320459static ADDRESS_MAP_START( ninjakd2_sound_cpu, ADDRESS_SPACE_PROGRAM, 8 )
321460   AM_RANGE(0x0000, 0x7fff) AM_ROM
322461   AM_RANGE(0x8000, 0xbfff) AM_ROM
323462   AM_RANGE(0xc000, 0xc7ff) AM_RAM
324463   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)
328465ADDRESS_MAP_END
329466
330467static ADDRESS_MAP_START( ninjakd2_sound_io, ADDRESS_SPACE_IO, 8 )
r1591r1592
337474
338475
339476
477/*************************************
478 *
479 *  Port definitions
480 *
481 *************************************/
482
483static 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 )
513INPUT_PORTS_END
514
515static 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 )
545INPUT_PORTS_END
546
547
340548static 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)
350550
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 ) )
360575
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 ) )
598INPUT_PORTS_END
370599
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 ) )
600static INPUT_PORTS_START( rdaction )
601   PORT_INCLUDE(ninjakd2)
395602
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" )
418608INPUT_PORTS_END
419609
610static INPUT_PORTS_START( mnight )
611   PORT_INCLUDE(common)
420612
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" )
421637
422static 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 ) )
661INPUT_PORTS_END
662
663static 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 ) )
714INPUT_PORTS_END
715
716static 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 ) )
767INPUT_PORTS_END
768
769static 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+" )
776INPUT_PORTS_END
777
778static 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 ) )
830INPUT_PORTS_END
831
832
833
834/*************************************
835 *
836 *  Graphics layouts
837 *
838 *************************************/
839
840static const gfx_layout layout8x8 =
423841{
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
431849};
432850
433static const gfx_layout spritelayout =
851static const gfx_layout layout16x16 =
434852{
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
444860};
445861
862static 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
446873static 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
450877GFXDECODE_END
451878
452static const struct Samplesinterface samples_interface =
453{
454   1,   /* 1 channel */
455   NULL,
456   ninjakd2_init_samples
457};
879static 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
885GFXDECODE_END
458886
459/* handler called by the 2203 emulator when the internal timers cause an IRQ */
887
888
889/*************************************
890 *
891 *  Sound definitions
892 *
893 *************************************/
894
460895static void irqhandler(int irq)
461896{
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);
463898}
464899
465900static const struct YM2203interface ym2203_interface =
466901{
467   0,0,0,0,irqhandler
902   0, 0, 0, 0,
903   irqhandler
468904};
469905
470906
907static 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
471922static MACHINE_DRIVER_START( ninjakd2 )
472923
473924   /* 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)
476927   MDRV_CPU_VBLANK_INT(ninjakd2_interrupt,1)
477928
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 */
480930   MDRV_CPU_PROGRAM_MAP(ninjakd2_sound_cpu,0)
481931   MDRV_CPU_IO_MAP(ninjakd2_sound_io,0)
482932
483   MDRV_SCREEN_REFRESH_RATE(60)
484   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(10000))
933   MDRV_MACHINE_RESET(ninjakd2)
485934
486935   /* video hardware */
936   MDRV_SCREEN_REFRESH_RATE(60)
487937   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
488938   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
489939   MDRV_SCREEN_SIZE(32*8, 32*8)
490940   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
491941   MDRV_GFXDECODE(ninjakd2)
492   MDRV_PALETTE_LENGTH(768)
942   MDRV_PALETTE_LENGTH(0x300)
493943
494944   MDRV_VIDEO_START(ninjakd2)
495945   MDRV_VIDEO_UPDATE(ninjakd2)
946   MDRV_VIDEO_EOF(ninjakd2)
496947
497948   /* sound hardware */
498949   MDRV_SPEAKER_STANDARD_MONO("mono")
499950
500   MDRV_SOUND_ADD(YM2203, 1500000) /* verified on pcb */
951   MDRV_SOUND_ADD_TAG("2203.1", YM2203, MAIN_CLOCK_12/8)      /* verified */
501952   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)
503957
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)
506963
507   MDRV_SOUND_ADD(SAMPLES, 0)
964   MDRV_SOUND_ADD_TAG("PCM", SAMPLES, 0)
508965   MDRV_SOUND_CONFIG(samples_interface)
509   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
966   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
510967MACHINE_DRIVER_END
511968
969static MACHINE_DRIVER_START( mnight )
512970
971   /* basic machine hardware */
972   MDRV_IMPORT_FROM(ninjakd2)
513973
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")
982MACHINE_DRIVER_END
983
984static 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)
1000MACHINE_DRIVER_END
1001
1002static 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)
1015MACHINE_DRIVER_END
1016
1017
1018
1019/*************************************
1020 *
1021 *  ROM definitions
1022 *
1023 *************************************/
1024
5141025ROM_START( ninjakd2 )
5151026   ROM_REGION( 0x30000, REGION_CPU1, 0 )
5161027   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
5181029   ROM_LOAD( "nk2_03.rom",   0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) )
5191030   ROM_LOAD( "nk2_04.rom",   0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) )
5201031   ROM_LOAD( "nk2_05.rom",   0x28000, 0x8000, CRC(5dac9426) SHA1(0916cddbbe1e93c32b96fe28e145d34b2a892e80) )
5211032
5221033   ROM_REGION( 0x10000, REGION_CPU2, 0 )
523   ROM_LOAD( "nk2_06.rom",   0x0000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) )  // sound z80 code encrypted
1034   ROM_LOAD( "nk2_06.rom",   0x00000, 0x10000, CRC(d3a18a79) SHA1(e4df713f89d8a8b43ef831b14864c50ec9b53f0b) )   // encrypted
5241035
5251036   ROM_REGION( 0x2000, REGION_USER1, 0 ) /* MC8123 key */
5261037   ROM_LOAD( "ninjakd2.key",  0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) )
5271038
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) )
5371041
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) )
5471045
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) )
5531049
5541050   ROM_REGION( 0x10000, REGION_SOUND1, 0 )
555   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   /* raw pcm samples */
1051   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   // unsigned 8-bit pcm samples
5561052ROM_END
5571053
5581054ROM_START( ninjak2a )
5591055   ROM_REGION( 0x30000, REGION_CPU1, 0 )
5601056   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
5621058   ROM_LOAD( "nk2_03.rom",   0x18000, 0x8000, CRC(ad275654) SHA1(7d29a17132adb19aeee9b98be5b76bd6e91f308e) )
5631059   ROM_LOAD( "nk2_04.rom",   0x20000, 0x8000, CRC(e7692a77) SHA1(84beb8b02c564bffa9cc00313214e8f109bd40f9) )
5641060   ROM_LOAD( "nk2_05.bin",   0x28000, 0x8000, CRC(960725fb) SHA1(160c8bfaf089cbeeef2023f12379793079bff93b) )
5651061
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
5691065
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) )
5791068
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) )
5891072
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) )
5951076
5961077   ROM_REGION( 0x10000, REGION_SOUND1, 0 )
597   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   /* raw pcm samples */
1078   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   // unsigned 8-bit pcm samples
5981079ROM_END
5991080
6001081ROM_START( ninjak2b )
6011082   ROM_REGION( 0x30000, REGION_CPU1, 0 )
6021083   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
6071088
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
6111092
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
6211095
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
6311099
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
6371103
6381104   ROM_REGION( 0x10000, REGION_SOUND1, 0 )
639   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   /* raw pcm samples */
1105   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   // 9.6d unsigned 8-bit pcm samples
6401106ROM_END
6411107
6421108ROM_START( rdaction )
6431109   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
6491115
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
6521118
6531119   ROM_REGION( 0x2000, REGION_USER1, 0 ) /* MC8123 key */
6541120   ROM_LOAD( "ninjakd2.key",  0x0000, 0x2000, CRC(ec25318f) SHA1(619da3f69f9919e1457f79ee1d38e7ec80c4ebb0) )
6551121
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
6651124
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
6751128
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
6811132
6821133   ROM_REGION( 0x10000, REGION_SOUND1, 0 )
683   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   /* raw pcm samples */
1134   ROM_LOAD( "nk2_09.rom",   0x0000, 0x10000, CRC(c1d2d170) SHA1(0f325815086fde90fd85360d3660042b0b68ba96) )   // 9.6c unsigned 8-bit pcm samples
6841135ROM_END
6851136
1137ROM_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) )
6861144
1145   ROM_REGION( 0x10000, REGION_CPU2, 0 )
1146   ROM_LOAD( "mn1-j7.bin",   0x00000, 0x10000, CRC(a0782a31) SHA1(8abd2f0b0c2c2eb876f324f7a095a5cdc773c187) )
6871147
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) )
1160ROM_END
1161
1162ROM_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) )
1185ROM_END
1186
1187ROM_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) )
1234ROM_END
1235
1236ROM_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) )
1283ROM_END
1284
1285ROM_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) )
1332ROM_END
1333
1334ROM_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) )
1357ROM_END
1358
1359ROM_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) )
1382ROM_END
1383
1384
1385
1386/*************************************
1387 *
1388 *  Gfx ROM swizzling
1389 *
1390 *************************************/
1391
1392/******************************************************************************
1393
1394Gfx 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
1396to decode graphics without resorting to ROM_CONTINUE trickery, this function
1397makes an address line rotation, bringing bit "bit" to bit 0 and shifting left
1398by one place all the intervening bits.
1399
1400******************************************************************************/
1401
1402static 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
1426static 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
6881441static DRIVER_INIT( ninjakd2 )
6891442{
6901443   mc8123_decrypt_rom(1, memory_region(REGION_USER1), 0, 0);
1444
1445   gfx_unscramble();
6911446}
6921447
6931448static DRIVER_INIT( bootleg )
6941449{
6951450   memory_set_decrypted_region(1, 0x0000, 0x7fff, memory_region(REGION_CPU2) + 0x10000);
1451
1452   gfx_unscramble();
6961453}
6971454
1455static DRIVER_INIT(mnight)
1456{
1457   gfx_unscramble();
1458}
6981459
6991460
700GAME( 1987, ninjakd2, 0,        ninjakd2, ninjakd2, ninjakd2, ROT0, "UPL", "Ninja-Kid II (set 1)", 0 )
701GAME( 1987, ninjak2a, ninjakd2, ninjakd2, ninjakd2, bootleg,  ROT0, "UPL", "Ninja-Kid II (set 2)", 0 )
702GAME( 1987, ninjak2b, ninjakd2, ninjakd2, ninjakd2, bootleg,  ROT0, "UPL", "Ninja-Kid II (set 3)", 0 )
703GAME( 1987, rdaction, ninjakd2, ninjakd2, ninjakd2, ninjakd2, ROT0, "UPL (World Games license)", "Rad Action", 0 )
1461
1462/*************************************
1463 *
1464 *  Game drivers
1465 *
1466 *************************************/
1467
1468GAME( 1987, ninjakd2, 0,        ninjakd2, ninjakd2, ninjakd2, ROT0,   "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 1)", 0 )
1469GAME( 1987, ninjak2a, ninjakd2, ninjakd2, ninjakd2, bootleg,  ROT0,   "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 2)", 0 )
1470GAME( 1987, ninjak2b, ninjakd2, ninjakd2, rdaction, bootleg,  ROT0,   "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 3)", 0 )
1471GAME( 1987, rdaction, ninjakd2, ninjakd2, rdaction, ninjakd2, ROT0,   "UPL (World Games license)", "Rad Action / NinjaKun Ashura no Shou", 0 )
1472GAME( 1987, mnight,   0,        mnight,   mnight,   mnight,   ROT0,   "UPL (Kawakus license)", "Mutant Night", GAME_IMPERFECT_GRAPHICS )
1473GAME( 1987, arkarea,  0,        mnight,   arkarea,  mnight,   ROT0,   "UPL", "Ark Area", 0 )
1474GAME( 1988, robokid,  0,        robokid,  robokid,  0,        ROT0,   "UPL", "Atomic Robo-kid", 0 )
1475GAME( 1988, robokidj, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, Set 1)", 0 )
1476GAME( 1988, robokdj2, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, Set 2)", 0 )
1477GAME( 1989, omegaf,   0,        omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter", 0 )
1478GAME( 1989, omegafs,  omegaf,   omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter Special", 0 )
src/mame/drivers/skydiver.c
r1591r1592
141141   discrete_sound_w(SKYDIVER_NOISE_DATA,  skydiver_videoram[0x396] & 0x0f);   // NAM - Noise Amplitude
142142
143143   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);
145145}
146146
147147
src/mame/drivers/yunsung8.c
r1591r1592
513513
514514   toggle ^= 1;
515515   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);
517517}
518518
519519static const struct MSM5205interface yunsung8_msm5205_interface =
src/mame/drivers/spacefb.c
r1591r1592
127127   /* compute vector and set the interrupt line */
128128   int vpos = video_screen_get_vpos(0);
129129   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);
131131
132132   /* set up for next interrupt */
133133   if (vpos == SPACEFB_INT_TRIGGER_COUNT_1)
src/mame/drivers/warpwarp.c
r1591r1592
288288         warpwarp_ball_on = data & 1;
289289         cpu_interrupt_enable(0,data & 1);
290290         if (~data & 1)
291            cpunum_set_input_line(0, 0, CLEAR_LINE);
291            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
292292         break;
293293      case 7:
294294         flip_screen_set(data & 1);
src/mame/drivers/cubocd32.c
r1591r1592
104104         memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, MWA32_BANK1);
105105      else
106106         /* overlay enabled, map Amiga system ROM on 0x000000 */
107         memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, MWA32_ROM);
107         memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, MWA32_UNMAP);
108108   }
109109}
110110
src/mame/drivers/wheelfir.c
r1591r1592
574574   if (scanline_counter!=(total_scanlines-1))
575575   {
576576      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
578578      timer_adjust(scanline_timer, attotime_div(ATTOTIME_IN_HZ(60), total_scanlines), 0, attotime_zero);
579579
580580      if (scanline_counter<256)
r1591r1592
584584
585585      if (scanline_counter==256)
586586      {
587         cpunum_set_input_line(0, 3, HOLD_LINE); // vblank IRQ?
587         cpunum_set_input_line(machine, 0, 3, HOLD_LINE); // vblank IRQ?
588588         toggle_bit = 0x8000; // must toggle..
589589      }
590590
r1591r1592
622622static INTERRUPT_GEN( wheelfir_irq )
623623{
624624   // 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?
626626}
627627
628628
src/mame/drivers/cbuster.c
r1591r1592
4545
4646    case 2: /* Sound CPU write */
4747      soundlatch_w(0,data & 0xff);
48      cpunum_set_input_line(1,0,HOLD_LINE);
48      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
4949       return;
5050
5151   case 4: /* Protection, maybe this is a PAL on the board?
r1591r1592
332332
333333static void sound_irq(int state)
334334{
335   cpunum_set_input_line(1,1,state); /* IRQ 2 */
335   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
336336}
337337
338338static const struct YM2151interface ym2151_interface =
src/mame/drivers/ghosteo.c
r1591r1592
473473static INTERRUPT_GEN( bballoon_interrupt )
474474{
475475   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);
478478
479479   irq_en = 0;
480480}
src/mame/drivers/onetwo.c
r1591r1592
7575static WRITE8_HANDLER( onetwo_soundlatch_w )
7676{
7777   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);
7979}
8080
8181static void setColor(int offset)
r1591r1592
252252
253253static void irqhandler(int linestate)
254254{
255   cpunum_set_input_line(1,0,linestate);
255   cpunum_set_input_line(Machine, 1,0,linestate);
256256}
257257
258258static const struct YM3812interface ym3812_interface =
src/mame/drivers/ojankohs.c
r1591r1592
120120
121121   /* generate an NMI if we're out of data */
122122   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);
124124}
125125
126126static WRITE8_HANDLER( ojankoc_ctrl_w )
src/mame/drivers/n8080.c
r1591r1592
3636static INTERRUPT_GEN( interrupt )
3737{
3838   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 */
4240   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 */
4642}
4743
4844
src/mame/drivers/wc90b.c
r1591r1592
129129static WRITE8_HANDLER( wc90b_sound_command_w )
130130{
131131   soundlatch_w(offset,data);
132   cpunum_set_input_line(2,0,HOLD_LINE);
132   cpunum_set_input_line(Machine, 2,0,HOLD_LINE);
133133}
134134
135135static WRITE8_HANDLER( adpcm_control_w )
r1591r1592
360360/* handler called by the 2203 emulator when the internal timers cause an IRQ */
361361static void irqhandler(int irq)
362362{
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);
364364}
365365
366366static const struct YM2203interface ym2203_interface =
r1591r1592
377377
378378   toggle ^= 1;
379379   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);
381381
382382}
383383
src/mame/drivers/liberate.c
r1591r1592
8888 *************************************/
8989
9090static ADDRESS_MAP_START( prosport_readmem, ADDRESS_SPACE_PROGRAM, 8 )
91   AM_RANGE(0x0200, 0x021f) AM_READ(paletteram_r)
91   AM_RANGE(0x0200, 0x021f) AM_READ(MRA8_RAM)
9292   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM)
9393   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_RAM)
9494   AM_RANGE(0x8000, 0x800f) AM_READ(deco16_io_r)
r1591r1592
499499   static int latch=0;
500500   int p=~readinputport(3);
501501   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);
503503      latch=1;
504504   } else {
505505      if (!(p&0x43))
r1591r1592
923923
924924static DRIVER_INIT( yellowcb )
925925{
926   driver_init_prosport(machine);
926   DRIVER_INIT_CALL(prosport);
927927
928928   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, input_port_0_r);
929929}
src/mame/drivers/spdodgeb.c
r1591r1592
4646static WRITE8_HANDLER( sound_command_w )
4747{
4848   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);
5050}
5151
5252static WRITE8_HANDLER( spd_adpcm_w )
r1591r1592
413413
414414static void irq_handler(int irq)
415415{
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);
417417}
418418
419419static const struct YM3812interface ym3812_interface =
src/mame/drivers/cvs.c
r1591r1592
238238static INTERRUPT_GEN( cvs_main_cpu_interrupt )
239239{
240240   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);
242242
243243   cvs_scroll_stars();
244244}
r1591r1592
247247static void cvs_dac_cpu_interrupt(void)
248248{
249249   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);
251251}
252252
253253
r1591r1592
430430
431431static const struct TMS5110interface tms5100_interface =
432432{
433   //TMS5110_IS_5110A,
434   TMS5110_IS_5100,
435433   -1,                /* ROM region */
436434   speech_rom_read_bit, /* M0 callback function. Called whenever chip requests a single bit of data */
437435   NULL
r1591r1592
707705   MDRV_SOUND_ADD(DAC, 0)
708706   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
709707
710   MDRV_SOUND_ADD(TMS5110, 640000)
708   MDRV_SOUND_ADD(TMS5100, 640000)
711709   MDRV_SOUND_CONFIG(tms5100_interface)
712710   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
713711MACHINE_DRIVER_END
src/mame/drivers/turbo.c
r1591r1592
344344   /* bit   7 = /INT on the 2nd CPU */
345345   turbo_state *state = Machine->driver_data;
346346   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);
348348}
349349
350350
r1591r1592
15421542static DRIVER_INIT( turbo_enc )
15431543{
15441544   turbo_rom_decode();
1545   driver_init_turbo(machine);
1545   DRIVER_INIT_CALL(turbo);
15461546}
15471547
15481548
r1591r1592
15801580static DRIVER_INIT( buckrog_enc )
15811581{
15821582   buckrog_decode();
1583   driver_init_buckrog(machine);
1583   DRIVER_INIT_CALL(buckrog);
15841584}
15851585
15861586
src/mame/drivers/seta.c
r1591r1592
2323-------------------------------------------------------------------------------
2424P0-029-A (M6100287A)    88 Thundercade / Twin Formation (1) Taito
2525?        (M6100326A)    88 Twin Eagle                       Taito
26?                       89 DownTown                         Taito / RomStar
26P0-045-A (M6100429A)    89 DownTown                         Taito / RomStar
2727?        (M6100430A)    89 U.S. Classic(2)                  Taito / RomStar
2828?                       88 Caliber 50                       Taito / RomStar
2929?                       89 Arbalester                       Taito / RomStar
r1591r1592
13351335------------------------------*/
13361336static TIMER_CALLBACK( uPD71054_timer_callback )
13371337{
1338   cpunum_set_input_line( 0, 4, HOLD_LINE );
1338   cpunum_set_input_line(machine, 0, 4, HOLD_LINE );
13391339   uPD71054_update_timer( param );
13401340}
13411341
r1591r1592
14181418
14191419static void utoukond_ym3438_interrupt(int linestate)
14201420{
1421   cpunum_set_input_line(1, INPUT_LINE_NMI, linestate);
1421   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, linestate);
14221422}
14231423
14241424static const struct YM3438interface utoukond_ym3438_intf =
r1591r1592
14921492         if (ACCESSING_LSB)
14931493         {
14941494            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);
14961496            old_data = data;
14971497         }
14981498         break;
r1591r1592
16751675   if (ACCESSING_LSB)
16761676   {
16771677      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);
16791679      cpu_spinuntil_time(ATTOTIME_IN_USEC(50));   // Allow the other cpu to reply
16801680   }
16811681}
r1591r1592
27132713static WRITE16_HANDLER( wiggie_soundlatch_w )
27142714{
27152715   wiggie_soundlatch = data >> 8;
2716   cpunum_set_input_line(1,0, HOLD_LINE);
2716   cpunum_set_input_line(Machine, 1,0, HOLD_LINE);
27172717}
27182718
27192719
r1591r1592
27712771{
27722772   if (ACCESSING_LSB)
27732773   {
2774      cpunum_set_input_line(1,0,HOLD_LINE);
2774      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
27752775      soundlatch_w(0,data & 0xff);
27762776   }
27772777}
r1591r1592
68226822{
68236823   switch (cpu_getiloops())
68246824   {
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;
68276827   }
68286828}
68296829
r1591r1592
68316831{
68326832   switch (cpu_getiloops())
68336833   {
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;
68366836   }
68376837}
68386838
r1591r1592
68436843{
68446844   switch (cpu_getiloops())
68456845   {
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;
68486848   }
68496849}
68506850
r1591r1592
68646864static INTERRUPT_GEN( tndrcade_sub_interrupt )
68656865{
68666866   if (cpu_getiloops() & 1)
6867      cpunum_set_input_line(1, 0, HOLD_LINE);
6867      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
68686868   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);
68706870}
68716871
68726872static MACHINE_DRIVER_START( tndrcade )
r1591r1592
69646964static MACHINE_DRIVER_START( downtown )
69656965
69666966   /* basic machine hardware */
6967   MDRV_CPU_ADD(M68000, 16000000/2)   /* 8 MHz */
6967   MDRV_CPU_ADD(M68000, XTAL_16MHz/2) /* verified on pcb */
69686968   MDRV_CPU_PROGRAM_MAP(downtown_readmem,downtown_writemem)
69696969   MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM)
69706970
6971   MDRV_CPU_ADD(M65C02, 16000000/8)   /* 2 MHz */
6971   MDRV_CPU_ADD(M65C02, XTAL_16MHz/8) /* verified on pcb */
69726972   MDRV_CPU_PROGRAM_MAP(downtown_sub_readmem,downtown_sub_writemem)
69736973   MDRV_CPU_VBLANK_INT(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM)
69746974
r1591r1592
70157015      case 0:
70167016      case 1:
70177017      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;
70207020   }
70217021}
70227022
r1591r1592
74887488#if __uPD71054_TIMER
74897489static INTERRUPT_GEN( wrofaero_interrupt )
74907490{
7491   cpunum_set_input_line( 0, 2, HOLD_LINE );
7491   cpunum_set_input_line(machine, 0, 2, HOLD_LINE );
74927492}
74937493
74947494static MACHINE_RESET( wrofaero ) { uPD71054_timer_init(); }
r1591r1592
82418241{
82428242   switch (cpu_getiloops())
82438243   {
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?
82468246   }
82478247}
82488248
r1591r1592
82968296      case 4:
82978297      case 5:
82988298      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;
83008300
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;
83028302
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;
83048304
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;
83068306   }
83078307}
83088308
r1591r1592
96549654   seta_vregs = (UINT16*)auto_malloc(sizeof(UINT16)*3);
96559655   seta_vregs[0] = seta_vregs[1] = seta_vregs[2] = 0;
96569656
9657   driver_init_blandia(machine);
9657   DRIVER_INIT_CALL(blandia);
96589658}
96599659
96609660/***************************************************************************
src/mame/drivers/truco.c
r1591r1592
137137   {
138138      if ( trigger == 0 )
139139      {
140         cpunum_set_input_line( 0, M6809_IRQ_LINE, PULSE_LINE );
140         cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, PULSE_LINE );
141141         trigger++;
142142      }
143143   } else
src/mame/drivers/laserbat.c
r1591r1592
561561
562562/* Cat'N Mouse sound ***********************************/
563563
564static void zaccaria_irq0a(int state) { cpunum_set_input_line(1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); }
565static void zaccaria_irq0b(int state) { cpunum_set_input_line(1,0,state ? ASSERT_LINE : CLEAR_LINE); }
564static void zaccaria_irq0a(int state) { cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); }
565static void zaccaria_irq0b(int state) { cpunum_set_input_line(Machine, 1,0,state ? ASSERT_LINE : CLEAR_LINE); }
566566
567567static int active_8910,port0a;
568568
r1591r1592
646646
647647static INTERRUPT_GEN( laserbat_interrupt )
648648{
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);
650650}
651651
652652static INTERRUPT_GEN( zaccaria_cb1_toggle )
r1591r1592
701701   MDRV_CPU_IO_MAP(catnmous_io_map,0)
702702   MDRV_CPU_VBLANK_INT(laserbat_interrupt,1)
703703
704   MDRV_CPU_ADD(M6802,3580000/4) /* ? */
704   MDRV_CPU_ADD(M6802,3580000) /* ? */
705705   MDRV_CPU_PROGRAM_MAP(catnmous_sound_map,0)
706706   MDRV_CPU_PERIODIC_INT(zaccaria_cb1_toggle, (double)3580000/4096)
707707
src/mame/drivers/trvquest.c
r1591r1592
210210
211211static TIMER_CALLBACK( via_irq_delayed )
212212{
213   cpunum_set_input_line(0, 0, param);
213   cpunum_set_input_line(machine, 0, 0, param);
214214}
215215
216216static void via_irq(int state)
src/mame/drivers/ssf2md.c
r1591r1592
2020{
2121   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, MWA16_NOP); // custom banking is disabled (!)
2222   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_ROM);
23   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, MWA16_UNMAP);
2424
2525   memory_set_bankptr( 5, memory_region( REGION_CPU1 )+0x400000 );
2626
2727   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x770070, 0x770075, 0, 0, ssf2ghw_dsw_r );
2828
29   driver_init_megadrij(machine);
29   DRIVER_INIT_CALL(megadrij);
3030
3131}
3232
src/mame/drivers/tnzs.c
r1591r1592
435435static WRITE8_HANDLER( tnzsb_sound_command_w )
436436{
437437   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);
439439}
440440
441441static ADDRESS_MAP_START( tnzsb_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
r1591r1592
12561256/* handler called by the 2203 emulator when the internal timers cause an IRQ */
12571257static void irqhandler(int irq)
12581258{
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);
12601260}
12611261
12621262static const struct YM2203interface kageki_ym2203_interface =
r1591r1592
12931293   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
12941294   MDRV_CPU_VBLANK_INT(arknoid2_interrupt,1)
12951295
1296   MDRV_CPU_ADD(Z80, 12000000/2)   /* verified on pcb */
1296   MDRV_CPU_ADD(Z80, XTAL_12MHz/2)   /* verified on pcb */
12971297   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
12981298   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
12991299
r1591r1592
13181318   /* sound hardware */
13191319   MDRV_SPEAKER_STANDARD_MONO("mono")
13201320
1321   MDRV_SOUND_ADD(YM2203, 12000000/4) /* verified on pcb */
1321   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/4) /* verified on pcb */
13221322   MDRV_SOUND_CONFIG(ym2203_interface)
13231323   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
13241324MACHINE_DRIVER_END
r1591r1592
13271327static MACHINE_DRIVER_START( drtoppel )
13281328
13291329   /* basic machine hardware */
1330   MDRV_CPU_ADD(Z80,12000000/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
1330   MDRV_CPU_ADD(Z80,XTAL_12MHz/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
13311331   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
13321332   MDRV_CPU_VBLANK_INT(arknoid2_interrupt,1)
13331333
1334   MDRV_CPU_ADD(Z80,12000000/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
1334   MDRV_CPU_ADD(Z80,XTAL_12MHz/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
13351335   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
13361336   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
13371337
r1591r1592
13561356   /* sound hardware */
13571357   MDRV_SPEAKER_STANDARD_MONO("mono")
13581358
1359   MDRV_SOUND_ADD(YM2203, 3000000)
1359   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/4)
13601360   MDRV_SOUND_CONFIG(ym2203_interface)
13611361   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
13621362MACHINE_DRIVER_END
r1591r1592
13651365static MACHINE_DRIVER_START( tnzs )
13661366
13671367   /* basic machine hardware */
1368   MDRV_CPU_ADD(Z80,12000000/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
1368   MDRV_CPU_ADD(Z80,XTAL_12MHz/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
13691369   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
13701370   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
13711371
1372   MDRV_CPU_ADD(Z80,12000000/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
1372   MDRV_CPU_ADD(Z80,XTAL_12MHz/2)      /* 6.0 MHz ??? - Main board Crystal is 12MHz */
13731373   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
13741374   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
13751375
r1591r1592
13971397   /* sound hardware */
13981398   MDRV_SPEAKER_STANDARD_MONO("mono")
13991399
1400   MDRV_SOUND_ADD(YM2203, 3000000)
1400   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/4)
14011401   MDRV_SOUND_CONFIG(ym2203_interface)
14021402   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
14031403MACHINE_DRIVER_END
r1591r1592
14061406static MACHINE_DRIVER_START( insectx )
14071407
14081408   /* basic machine hardware */
1409   MDRV_CPU_ADD(Z80, 12000000/2)   /* verified on pcb */
1409   MDRV_CPU_ADD(Z80, XTAL_12MHz/2)   /* verified on pcb */
14101410   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
14111411   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
14121412
1413   MDRV_CPU_ADD(Z80, 12000000/2)   /* verified on pcb */
1413   MDRV_CPU_ADD(Z80, XTAL_12MHz/2)   /* verified on pcb */
14141414   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
14151415   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
14161416
r1591r1592
14341434   /* sound hardware */
14351435   MDRV_SPEAKER_STANDARD_MONO("mono")
14361436
1437   MDRV_SOUND_ADD(YM2203, 12000000/4) /* verified on pcb */
1437   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/4) /* verified on pcb */
14381438   MDRV_SOUND_CONFIG(ym2203_interface)
14391439   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
14401440MACHINE_DRIVER_END
r1591r1592
14431443static MACHINE_DRIVER_START( kageki )
14441444
14451445   /* basic machine hardware */
1446   MDRV_CPU_ADD(Z80, 12000000/2) /* verified on pcb */
1446   MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */
14471447   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
14481448   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
14491449
1450   MDRV_CPU_ADD(Z80, 12000000/2) /* verified on pcb */
1450   MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */
14511451   MDRV_CPU_PROGRAM_MAP(kageki_sub_readmem,kageki_sub_writemem)
14521452   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
14531453
r1591r1592
14711471   /* sound hardware */
14721472   MDRV_SPEAKER_STANDARD_MONO("mono")
14731473
1474   MDRV_SOUND_ADD(YM2203, 12000000/4) /* verified on pcb */
1474   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/4) /* verified on pcb */
14751475   MDRV_SOUND_CONFIG(kageki_ym2203_interface)
14761476   MDRV_SOUND_ROUTE(0, "mono", 0.15)
14771477   MDRV_SOUND_ROUTE(1, "mono", 0.15)
r1591r1592
14871487static MACHINE_DRIVER_START( tnzsb )
14881488
14891489   /* basic machine hardware */
1490   MDRV_CPU_ADD_TAG("cpu0", Z80, 6000000)      /* 6 MHz */
1490   MDRV_CPU_ADD_TAG("cpu0", Z80, XTAL_12MHz/2) /* verified on pcb */
14911491   MDRV_CPU_PROGRAM_MAP(cpu0_type2,0)
14921492   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
14931493
1494   MDRV_CPU_ADD_TAG("cpu1", Z80, 6000000)      /* 6 MHz */
1494   MDRV_CPU_ADD_TAG("cpu1", Z80, XTAL_12MHz/2) /* verified on pcb */
14951495   MDRV_CPU_PROGRAM_MAP(tnzsb_cpu1_map,0)
14961496   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
14971497
1498   MDRV_CPU_ADD_TAG("cpu2", Z80, 12000000/3) /* guessed but it makes sense since it's the sound z80 near the YM2203 */
1498   MDRV_CPU_ADD_TAG("cpu2", Z80, XTAL_12MHz/2) /* verified on pcb */
14991499   MDRV_CPU_PROGRAM_MAP(tnzsb_cpu2_map,0)
15001500   MDRV_CPU_IO_MAP(tnzsb_readport,tnzsb_writeport)
15011501
r1591r1592
15191519   /* sound hardware */
15201520   MDRV_SPEAKER_STANDARD_MONO("mono")
15211521
1522   MDRV_SOUND_ADD_TAG("ym2203", YM2203, 3000000)
1522   MDRV_SOUND_ADD_TAG("ym2203", YM2203, XTAL_12MHz/4) /* verified on pcb */
15231523   MDRV_SOUND_CONFIG(ym2203b_interface)
15241524   MDRV_SOUND_ROUTE(0, "mono", 1.0)
15251525   MDRV_SOUND_ROUTE(1, "mono", 1.0)
src/mame/drivers/tp84.c
r1591r1592
158158
159159static WRITE8_HANDLER( tp84_sh_irqtrigger_w )
160160{
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);
162162}
163163
164164
src/mame/drivers/rohga.c
r1591r1592
657657   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
658658   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
659659   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 ) )
663663   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
664664   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
665665   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r1591r1592
676676   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
677677   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
678678
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 */
680680   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
681681   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
682682   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r1591r1592
692692   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
693693   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
694694   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
695   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
695   PORT_DIPNAME( 0x0020, 0x0020, "Freeze Screen" )
696696   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
697697   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
698698   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
r1591r1592
794794
795795static void sound_irq(int state)
796796{
797   cpunum_set_input_line(1,1,state); /* IRQ 2 */
797   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
798798}
799799
800800static WRITE8_HANDLER( sound_bankswitch_w )
r1591r1592
818818   MDRV_CPU_PROGRAM_MAP(rohga_readmem,rohga_writemem)
819819   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
820820
821   MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280, pin 14 (HSM) is high so XIN/3 */
821   MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
822822   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
823823
824824   MDRV_SCREEN_REFRESH_RATE(58)
r1591r1592
861861   MDRV_CPU_PROGRAM_MAP(wizdfire_readmem,wizdfire_writemem)
862862   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
863863
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 */
865865   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
866866
867867   MDRV_SCREEN_REFRESH_RATE(58)
r1591r1592
904904   MDRV_CPU_PROGRAM_MAP(nitrobal_readmem,nitrobal_writemem)
905905   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
906906
907   MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280, pin 14 (HSM) is high so XIN/3 */
907   MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
908908   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
909909
910910   MDRV_SCREEN_REFRESH_RATE(58)
r1591r1592
947947   MDRV_CPU_PROGRAM_MAP(schmeisr_readmem,schmeisr_writemem)
948948   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
949949
950   MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280, pin 14 (HSM) is high so XIN/3 */
950   MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
951951   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
952952
953953   MDRV_SCREEN_REFRESH_RATE(58)
src/mame/drivers/vball.c
r1591r1592
143143
144144static WRITE8_HANDLER( cpu_sound_command_w ) {
145145   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 );
147147}
148148
149149
r1591r1592
388388
389389static void vball_irq_handler(int irq)
390390{
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 );
392392}
393393
394394static const struct YM2151interface ym2151_interface =
src/mame/drivers/higemaru.c
r1591r1592
2222static INTERRUPT_GEN( higemaru_interrupt )
2323{
2424   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 */
2626   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 */
2828}
2929
3030
src/mame/drivers/plygonet.c
r1591r1592
154154static INTERRUPT_GEN(polygonet_interrupt)
155155{
156156   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);
158158   else
159      cpunum_set_input_line(0, MC68000_IRQ_3, HOLD_LINE);
159      cpunum_set_input_line(machine, 0, MC68000_IRQ_3, HOLD_LINE);
160160}
161161
162162/* sound CPU communications */
r1591r1592
184184
185185static WRITE32_HANDLER( sound_irq_w )
186186{
187   cpunum_set_input_line(2, 0, HOLD_LINE);
187   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
188188}
189189
190190
r1591r1592
639639
640640static INTERRUPT_GEN(audio_interrupt)
641641{
642   cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE);
642   cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE);
643643}
644644
645645static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/batman.c
r1591r1592
4040 *
4141 *************************************/
4242
43static void update_interrupts(void)
43static void update_interrupts(running_machine *machine)
4444{
4545   int newstate = 0;
4646
r1591r1592
5050      newstate |= 6;
5151
5252   if (newstate)
53      cpunum_set_input_line(0, newstate, ASSERT_LINE);
53      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
5454   else
55      cpunum_set_input_line(0, 7, CLEAR_LINE);
55      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
5656}
5757
5858
r1591r1592
9292
9393   /* bit 4 is connected to the /RESET pin on the 6502 */
9494   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);
9696   else
97      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
97      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
9898
9999   /* alpha bank is selected by the upper 4 bits */
100100   if ((oldword ^ latch_data) & 0x7000)
src/mame/drivers/naomi.c
r1591r1592
698698#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
699699      ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_BIOS(bios+1)) /* Note '+1' */
700700
701/* BIOS info:
701702
703Revisions A through C can handle game carts only
704Revisions D and later can also handle GD-Rom board
705Revisions F and later can also handle GD-Rom board and or the network GD-Rom board
702706
707F355 has it's own BIOS (3 screen version) and different JVS I/O Board
708
709Info from roms starting at 0x1ffd60
710
711EPR-21576g - NAOMI BOOT ROM 2001 09/10  1.70 (Japan)
712EPR-21577e - NAOMI BOOT ROM 2000 08/25  1.50 (USA)
713EPR-21578e - NAOMI BOOT ROM 2000 08/25  1.50 (Export)
714EPR-21578d - NAOMI BOOT ROM 1999 06/04  1.40 (Export)
715EPR-21578a - NAOMI BOOT ROM 1999 02/15  1.20 (Export)
716EPR-21579  - No known dump (Korea)
717EPR-21580  - No known dump (Australia)
718EPR-22851  - NAOMI BOOT ROM 1999 08/30  1.35 (Multisystem 3 screen)
719
720EPR-21577e & EPR-2178e differ by 7 bytes:
721
7220x53e20 is the region byte (only one region byte)
7230x1ffffa-0x1fffff is the BIOS checksum
724
725
726Region byte encoding is as follows:
727
7280x00 = Japan
7290x01 = USA
7300x02 = Export
731???? = Korea
732???? = Australia
733
734Scan 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
703739#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) ) \
712752
713753
754/* NAOMI2 BIOS:
714755
756EPR-23609  - NAOMI BOOT ROM 2001 01/19  1.50
757EPR-2360xB - NAOMI BOOT ROM 2001 09/10  1.70
758
759EPR-23605B, EPR-23607B & EPR-23608B all differ by 6 bytes:
760
7610x0553a0 is the first region byte
7620x1ecf40 is a second region byte (value is the same as the first region byte )
7630x1fffc-1ffff is the BIOS rom checksum (might be 0x1ffffa-0x1fffff)
764
765EPR-23609  - Japan  (region = 0x00)
766EPR-23605b - Japan  (region = 0x00)
767EPR-23607b - USA    (region = 0x01)
768EPR-23608b - Export (region = 0x02)
769
770*/
771
715772#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) ) \
718775   ROM_SYSTEM_BIOS( 1, "bios1", "epr-23607b" ) \
719776   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) ) \
722779   ROM_SYSTEM_BIOS( 3, "bios3", "epr-23609" ) \
723   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-23609.bin",    0x000000, 0x200000, CRC(5731e446) SHA1(787b0844fc408cf124c12405c095c59948709ea6) ) /* might be naomi1 */ \
780   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-23609.bin",    0x000000, 0x200000, CRC(5731e446) SHA1(787b0844fc408cf124c12405c095c59948709ea6) ) \
724781
725782/* 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 */
726783#define AW_BIOS \
src/mame/drivers/nemesis.c
r1591r1592
9494static INTERRUPT_GEN( nemesis_interrupt )
9595{
9696   if (irq_on)
97      cpunum_set_input_line(0, 1, HOLD_LINE);
97      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
9898}
9999
100100
r1591r1592
102102{
103103   if(ACCESSING_LSB) {
104104      soundlatch_w(offset,data & 0xff);
105      cpunum_set_input_line(1,0,HOLD_LINE);
105      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
106106   }
107107}
108108
r1591r1592
112112{
113113   if (cpu_getiloops() == 0)
114114   {
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);
116116   }
117117   else
118118   {
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);
120120   }
121121}
122122
r1591r1592
125125   switch (cpu_getiloops())
126126   {
127127      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);
129129         break;
130130
131131      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);
133133         break;
134134
135135      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);
137137         break;
138138   }
139139}
r1591r1592
180180static INTERRUPT_GEN( salamand_interrupt )
181181{
182182   if (irq_on)
183      cpunum_set_input_line(0, 1, HOLD_LINE);
183      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
184184}
185185
186186static INTERRUPT_GEN( blkpnthr_interrupt )
187187{
188188   if (irq_on)
189      cpunum_set_input_line(0, 2, HOLD_LINE);
189      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
190190}
191191
192192static WRITE16_HANDLER( nemesis_irq_enable_word_w )
r1591r1592
21092109static void sound_irq(int state)
21102110{
21112111/* 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);*/
21132113}
21142114
21152115static const struct YM2151interface ym2151_interface =
src/mame/drivers/progolf.c
r1591r1592
194194static INTERRUPT_GEN( progolf_interrupt )
195195{
196196   //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);
198198}
199199#endif
200200
src/mame/drivers/magmax.c
r1591r1592
3333   if (ACCESSING_LSB)
3434   {
3535      sound_latch = (data & 0xff) << 1;
36      cpunum_set_input_line(1, 0, ASSERT_LINE);
36      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
3737   }
3838}
3939
4040static READ8_HANDLER( magmax_sound_irq_ack )
4141{
42   cpunum_set_input_line(1, 0, CLEAR_LINE);
42   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
4343   return 0;
4444}
4545
src/mame/drivers/stv.c
r1591r1592
300300
301301/*A-Bus IRQ checks,where they could be located these?*/
302302#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_); }
304304#if 0
305305if(stv_scu[42] & 1)//IRQ ACK
306306{
r1591r1592
533533   return return_data;
534534}
535535
536static void stv_SMPC_w8 (int offset, UINT8 data)
536static void stv_SMPC_w8 (running_machine *machine, int offset, UINT8 data)
537537{
538538   mame_system_time systime;
539539
r1591r1592
569569      if(!(smpc_ram[0x77] & 0x10))
570570      {
571571         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);
573573         en_68k = 1;
574574      }
575575      else
576576      {
577577         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);
579579         en_68k = 0;
580580      }
581581      //if(LOG_SMPC) logerror("SMPC: ram [0x77] = %02x\n",smpc_ram[0x77]);
r1591r1592
604604         if(!(stv_scu[40] & 0x0100)) /*Pad irq*/
605605         {
606606            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);
608608         }
609609   }
610610
r1591r1592
622622            smpc_ram[0x5f]=0x02;
623623            #if USE_SLAVE
624624            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);
626626            #endif
627627            break;
628628         case 0x03:
629629            if(LOG_SMPC) logerror ("SMPC: Slave OFF\n");
630630            smpc_ram[0x5f]=0x03;
631631            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);
634634            break;
635635         case 0x06:
636636            if(LOG_SMPC) logerror ("SMPC: Sound ON\n");
637637            /* wrong? */
638638            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);
640640            break;
641641         case 0x07:
642642            if(LOG_SMPC) logerror ("SMPC: Sound OFF\n");
r1591r1592
648648         case 0x0d:
649649            if(LOG_SMPC) logerror ("SMPC: System Reset\n");
650650            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);
652652            system_reset();
653653            break;
654654         case 0x0e:
655655            if(LOG_SMPC) logerror ("SMPC: Change Clock to 352\n");
656656            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?
661661            break;
662662         case 0x0f:
663663            if(LOG_SMPC) logerror ("SMPC: Change Clock to 320\n");
664664            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?
669669            break;
670670         /*"Interrupt Back"*/
671671         case 0x10:
r1591r1592
711711         //  if(!(stv_scu[40] & 0x0080)) /*System Manager(SMPC) irq*/ /* we can't check this .. breaks controls .. probably issues elsewhere? */
712712            {
713713               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);
715715            }
716716         break;
717717         /* RTC write*/
r1591r1592
735735            if(LOG_SMPC) logerror ("SMPC: NMI request\n");
736736            smpc_ram[0x5f]=0x18;
737737            /*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);
739739            break;
740740         case 0x19:
741741            if(LOG_SMPC) logerror ("SMPC: NMI Enable\n");
r1591r1592
793793
794794   offset += byte;
795795
796   stv_SMPC_w8(offset,writedata);
796   stv_SMPC_w8(Machine, offset,writedata);
797797}
798798
799799
r1591r1592
830830      if(!(stv_scu[40] & 2))/*VBLANK-OUT*/
831831      {
832832         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);
834834      }
835835      stv_vblank = 0;
836836      #if UGLY_SOUND_HACK
r1591r1592
852852         if((!(stv_scu[40] & 0x10)) && (!(stv_scu[38] & 0x80)))
853853         {
854854            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 );
856856         }
857857         else if((!(stv_scu[40] & 0x10)) && (stv_scu[38] & 0x80))
858858         {
859859            if(timer_1 == (stv_scu[36] & 0x1ff))
860860            {
861861               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 );
863863            }
864864         }
865865      }
r1591r1592
868868         if(!(stv_scu[40] & 8))/*Timer 0*/
869869         {
870870            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 );
872872         }
873873      }
874874
r1591r1592
876876      if(!(stv_scu[40] & 4))/*HBLANK-IN*/
877877      {
878878         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);
880880      }
881881   }
882882   else if(scanline == 224)
r1591r1592
887887      if(!(stv_scu[40] & 1))/*VBLANK-IN*/
888888      {
889889         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);
891891      }
892892      stv_vblank = 1;
893893
r1591r1592
896896         if(!(stv_scu[40] & 8))/*Timer 0*/
897897         {
898898            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 );
900900         }
901901      }
902902      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);
904904   }
905905}
906906
r1591r1592
12941294         /*Sound IRQ*/
12951295         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
12961296         {
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);
12981298            logerror("SCSP: Main CPU interrupt\n");
12991299            #if 0
13001300            if((scu_dst_0 & 0x7ffffff) != 0x05a00000)
13011301            {
13021302               if(!(stv_scu[40] & 0x1000))
13031303               {
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);
13051305                  logerror("SCU: Illegal DMA interrupt\n");
13061306               }
13071307            }
r1591r1592
13551355         /*Sound IRQ*/
13561356         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
13571357         {
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);
13591359            logerror("SCSP: Main CPU interrupt\n");
13601360         }
13611361      }
r1591r1592
14051405         /*Sound IRQ*/
14061406         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
14071407         {
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);
14091409            logerror("SCSP: Main CPU interrupt\n");
14101410         }
14111411      }
r1591r1592
15841584
15851585   if(LOG_SCU) logerror("DMA transfer END\n");
15861586   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);
15881588
15891589   if(scu_add_tmp & 0x80000000)
15901590   {
r1591r1592
16871687
16881688   if(LOG_SCU) logerror("DMA transfer END\n");
16891689   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);
16911691
16921692   if(scu_add_tmp & 0x80000000)
16931693   {
r1591r1592
17901790
17911791   if(LOG_SCU) logerror("DMA transfer END\n");
17921792   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);
17941794
17951795   if(scu_add_tmp & 0x80000000)
17961796   {
r1591r1592
18681868   }while(job_done == 0);
18691869
18701870   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);
18721872
18731873   D0MV_0;
18741874}
r1591r1592
19401940   }while(job_done == 0);
19411941
19421942   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);
19441944
19451945   D1MV_0;
19461946}
r1591r1592
20112011   }while(job_done == 0);
20122012
20132013   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);
20152015
20162016   D2MV_0;
20172017}
r1591r1592
20512051{
20522052   logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data);
20532053   cpu_boost_interleave(minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost));
2054   cpu_trigger(1000);
2054   cpu_trigger(Machine, 1000);
20552055   cpunum_set_info_int(1, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE);
20562056}
20572057
r1591r1592
26592659   if (irq > 0)
26602660   {
26612661      scsp_last_line = irq;
2662      cpunum_set_input_line(2, irq, ASSERT_LINE);
2662      cpunum_set_input_line(Machine, 2, irq, ASSERT_LINE);
26632663   }
26642664   else if (irq < 0)
26652665   {
2666      cpunum_set_input_line(2, -irq, CLEAR_LINE);
2666      cpunum_set_input_line(Machine, 2, -irq, CLEAR_LINE);
26672667   }
26682668   else
26692669   {
2670      cpunum_set_input_line(2, scsp_last_line, CLEAR_LINE);
2670      cpunum_set_input_line(Machine, 2, scsp_last_line, CLEAR_LINE);
26712671   }
26722672}
26732673
r1591r1592
27122712static MACHINE_RESET( stv )
27132713{
27142714   // 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);
27162716   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);
27182718
27192719   timer_0 = 0;
27202720   timer_1 = 0;
r1591r1592
27222722   NMI_reset = 1;
27232723   smpc_ram[0x21] = (0x80) | ((NMI_reset & 1) << 6);
27242724
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);
27282728
27292729   stvcd_reset();
27302730}
r1591r1592
38063806   }
38073807
38083808
3809   driver_init_sasissu(Machine);
3809   DRIVER_INIT_CALL(sasissu);
38103810}
38113811
38123812GAME( 1996, stvbios,   0, stv, stv,  stv,       ROT0,   "Sega",                      "ST-V Bios", GAME_IS_BIOS_ROOT )
src/mame/drivers/megatech.c
r1591r1592
9292#define MASTER_CLOCK      53693100
9393
9494/* give us access to the megadriv start and update functions so that we can call them */
95extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
96extern void video_start_megadriv(running_machine *machine);
97extern void video_eof_megadriv(running_machine *machine);
98extern void machine_reset_megadriv(running_machine *machine);
95VIDEO_UPDATE( megadriv );
96VIDEO_START( megadriv );
97VIDEO_EOF( megadriv );
98MACHINE_RESET( megadriv );
9999
100100/* in drivers/segae.c */
101extern UINT32 video_update_megatech_bios(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
102extern void video_eof_megatech_bios(running_machine *machine);
103extern void machine_reset_megatech_bios(running_machine *machine);
104extern void driver_init_megatech_bios(running_machine *machine);
101VIDEO_UPDATE( megatech_bios );
102VIDEO_EOF( megatech_bios );
103MACHINE_RESET( megatech_bios );
104DRIVER_INIT( megatech_bios );
105105
106106
107107/* not currently used */
r1591r1592
286286      case 0:
287287         logerror("bank w %02x %02x\n", offset, data);
288288         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_ROM);
289         memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_UNMAP);
290290
291291         //printf("bank ram??\n");
292292         break;
r1591r1592
353353   /* fixed rom bank area */
354354   sms_rom = auto_malloc(0x400000);
355355   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_ROM);
356   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_UNMAP);
357357   memory_set_bankptr( 5, sms_rom );
358358
359359   memcpy(sms_rom, memory_region(REGION_CPU1), 0x400000);
r1591r1592
375375
376376}
377377
378static void megatech_select_game(int gameno)
378static void megatech_select_game(running_machine *machine, int gameno)
379379{
380380   UINT8* game_region;
381381   UINT8* bios_region;
382382
383383   printf("game 0 selected\n");
384384
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);
389389   sndti_reset(SOUND_YM2612, 0);
390390
391391   game_region = memory_region(REGION_USER1 + (gameno*2) + 0);
r1591r1592
409409         printf("SMS cart!!, CPU not running\n");
410410         current_game_is_sms = 1;
411411         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);
414414
415415
416416      }
r1591r1592
419419         printf("Genesis Cart, CPU0 running\n");
420420         current_game_is_sms = 0;
421421         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);
424424      }
425425      else
426426      {
r1591r1592
429429   }
430430   else
431431   {
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);
436436
437437      /* no cart.. */
438438      memset(memory_region(REGION_CPU3)+0x8000, 0x00, 0x8000);
r1591r1592
454454   mt_cart_select_reg = data;
455455
456456
457   megatech_select_game(mt_cart_select_reg);
457   megatech_select_game(Machine, mt_cart_select_reg);
458458
459459/*
460460    if (mt_cart_select_reg==2)
r1591r1592
597597static DRIVER_INIT(mtnew)
598598{
599599   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);
602602}
603603
604604static VIDEO_START(mtnew)
605605{
606606   init_for_megadrive(); // create an sms vdp too, for comptibility mode
607   video_start_megadriv(Machine);
607   VIDEO_START_CALL(megadriv);
608608}
609609//attotime_never
610610static VIDEO_UPDATE(mtnew)
r1591r1592
612612   if (screen ==0)
613613   {
614614      /* 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);
617617   }
618   else if (screen ==1) video_update_megatech_bios(machine, 1, bitmap,cliprect);
618   else if (screen ==1) VIDEO_UPDATE_CALL(megatech_bios);
619619   return 0;
620620}
621621
622622static VIDEO_EOF(mtnew)
623623{
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);
627627}
628628
629629static MACHINE_RESET(mtnew)
630630{
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);
635635}
636636
637637static MACHINE_DRIVER_START( megatech )
src/mame/drivers/timelimt.c
r1591r1592
4949static WRITE8_HANDLER( sound_reset_w )
5050{
5151   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 );
5353}
5454
5555
r1591r1592
250250
251251static INTERRUPT_GEN( timelimt_irq ) {
252252   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);
254254}
255255
256256/***************************************************************************/
src/mame/drivers/talbot.c
r1591r1592
2727static WRITE8_HANDLER( talbot_mcu_halt_w )
2828{
2929   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);
3131}
3232
3333static WRITE8_HANDLER( talbot_mcu_switch_w )
src/mame/drivers/warriorb.c
r1591r1592
442442/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
443443static void irqhandler(int irq)
444444{
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);
446446}
447447
448448static const struct YM2610interface ym2610_interface =
src/mame/drivers/igs_blit.c
r1591r1592
23872387{
23882388   switch (cpu_getiloops())
23892389   {
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;
23912391      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;
23932393   }
23942394}
23952395
r1591r1592
24212421{
24222422   switch (cpu_getiloops())
24232423   {
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;
24262426   }
24272427}
24282428
r1591r1592
24392439{
24402440   switch (cpu_getiloops())
24412441   {
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;
24452445   }
24462446}
24472447
r1591r1592
24562456
24572457static void sound_irq(int state)
24582458{
2459//  cpunum_set_input_line(0, 3, state);
2459//  cpunum_set_input_line(Machine, 0, 3, state);
24602460}
24612461
24622462static const struct ics2115_interface pgm_ics2115_interface = {
r1591r1592
24682468{
24692469   switch (cpu_getiloops())
24702470   {
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;
24742474      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
24762476   }
24772477}
24782478
src/mame/drivers/goal92.c
r1591r1592
3131   if (ACCESSING_MSB)
3232   {
3333      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);
3535   }
3636}
3737
r1591r1592
234234/* handler called by the 2203 emulator when the internal timers cause an IRQ */
235235static void irqhandler(int irq)
236236{
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);
238238}
239239
240240static const struct YM2203interface ym2203_interface =
r1591r1592
255255
256256   toggle ^= 1;
257257   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);
259259}
260260
261261static const struct MSM5205interface msm5205_interface =
src/mame/drivers/bishi.c
r1591r1592
5151      switch (cpu_getiloops())
5252      {
5353         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);
5555            break;
5656
5757         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);
5959            break;
6060      }
6161   }
r1591r1592
251251static void sound_irq_gen(int state)
252252{
253253   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);
255255   else
256      cpunum_set_input_line(0, MC68000_IRQ_1, CLEAR_LINE);
256      cpunum_set_input_line(Machine, 0, MC68000_IRQ_1, CLEAR_LINE);
257257}
258258
259259static const struct YMZ280Binterface ymz280b_intf =
src/mame/drivers/1942.c
r1591r1592
102102static INTERRUPT_GEN( c1942_interrupt )
103103{
104104   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 */
106106   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 */
108108}
109109
110110
src/mame/drivers/mayumi.c
r1591r1592
2525static INTERRUPT_GEN( mayumi_interrupt )
2626{
2727   if (int_enable)
28       cpunum_set_input_line(0, 0, HOLD_LINE);
28       cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
2929}
3030
3131static WRITE8_HANDLER( bank_sel_w )
src/mame/drivers/poolshrk.c
r1591r1592
9090
9191static READ8_HANDLER( poolshrk_irq_reset_r )
9292{
93   cpunum_set_input_line(0, 0, CLEAR_LINE);
93   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9494
9595   return 0;
9696}
src/mame/drivers/raiden.c
r1591r1592
223223
224224static INTERRUPT_GEN( raiden_interrupt )
225225{
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 */
227227}
228228
229229static VIDEO_EOF( raiden )
src/mame/drivers/alg.c
r1591r1592
7676   add_exit_callback(machine, video_cleanup);
7777
7878   /* standard video start */
79   video_start_amiga(machine);
79   VIDEO_START_CALL(amiga);
8080
8181   /* configure pen 4096 as transparent in the renderer and use it for the genlock color */
8282   render_container_set_palette_alpha(render_container_get_screen(0), 4096, 0x00);
r1591r1592
152152
153153static MACHINE_RESET( alg )
154154{
155   machine_reset_amiga(machine);
155   MACHINE_RESET_CALL(amiga);
156156   laserdisc_reset(discinfo, 0);
157157}
158158
r1591r1592
269269
270270   else
271271      /* overlay enabled, map Amiga system ROM on 0x000000 */
272      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ROM);
272      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP);
273273}
274274
275275
src/mame/drivers/fromanc2.c
r1591r1592
124124
125125static INTERRUPT_GEN( fromanc2_interrupt )
126126{
127   cpunum_set_input_line(0, 1, HOLD_LINE);
127   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
128128}
129129
130130
r1591r1592
137137   soundlatch_w(offset, (data >> 8) & 0xff);   // 1P (LEFT)
138138   soundlatch2_w(offset, data & 0xff);         // 2P (RIGHT)
139139
140   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
140   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
141141   fromanc2_sndcpu_nmi_flag = 0;
142142}
143143
r1591r1592
243243{
244244   fromanc2_datalatch1 = data;
245245
246   cpunum_set_input_line(2, 0, HOLD_LINE);
246   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
247247   fromanc2_subcpu_int_flag = 0;
248248}
249249
250250static READ16_HANDLER( fromanc2_subcpu_r )
251251{
252   cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE);
252   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE);
253253   fromanc2_subcpu_nmi_flag = 0;
254254
255255   return (fromanc2_datalatch_2h << 8) | fromanc2_datalatch_2l;
r1591r1592
684684
685685static void irqhandler(int irq)
686686{
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);
688688}
689689
690690static const struct YM2610interface ym2610_interface =
src/mame/drivers/gridlee.c
r1591r1592
111111
112112static TIMER_CALLBACK( irq_off )
113113{
114   cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE);
114   cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
115115}
116116
117117
r1591r1592
124124      timer_set(video_screen_get_time_until_pos(0, param + 64, 0), NULL, param + 64, irq_timer);
125125
126126   /* 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);
128128
129129   /* it will turn off on the next HBLANK */
130130   timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), NULL, 0, irq_off);
r1591r1592
133133
134134static TIMER_CALLBACK( firq_off )
135135{
136   cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE);
136   cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
137137}
138138
139139
r1591r1592
143143   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, 0), NULL, 0, firq_timer);
144144
145145   /* 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);
147147
148148   /* it will turn off on the next HBLANK */
149149   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, BALSENTE_HBSTART), NULL, 0, firq_off);
src/mame/drivers/rallyx.c
r1591r1592
203203static WRITE8_HANDLER( rallyx_interrupt_vector_w )
204204{
205205   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);
207207}
208208
209209
r1591r1592
232232      case 0x01:   /* INT ON */
233233         cpu_interrupt_enable(0,bit);
234234         if (!bit)
235            cpunum_set_input_line(0, 0, CLEAR_LINE);
235            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
236236         break;
237237
238238      case 0x02:   /* SOUND ON */
src/mame/drivers/trucocl.c
r1591r1592
5353
5454static TIMER_CALLBACK( dac_irq )
5555{
56   cpunum_set_input_line( 0, INPUT_LINE_NMI, PULSE_LINE );
56   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE );
5757}
5858
5959static WRITE8_HANDLER( audio_dac_w)
src/mame/drivers/bnstars.c
r1591r1592
12941294   for(i=15; i>=0 && !(irqreq & (1<<i)); i--);
12951295   irqreq &= ~(1<<i);
12961296   if(!irqreq)
1297      cpunum_set_input_line(0, 0, CLEAR_LINE);
1297      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
12981298   return i;
12991299}
13001300
13011301static void irq_init(void)
13021302{
13031303   irqreq = 0;
1304   cpunum_set_input_line(0, 0, CLEAR_LINE);
1304   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
13051305   cpunum_set_irq_callback(0, irq_callback);
13061306}
13071307
13081308static void irq_raise(int level)
13091309{
13101310   irqreq |= (1<<level);
1311   cpunum_set_input_line(0, 0, ASSERT_LINE);
1311   cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
13121312}
13131313
13141314
src/mame/drivers/bking2.c
r1591r1592
8181      if (data & (1 << i)) code |= 0x80 >> i;
8282
8383   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);
8585}
8686
8787static WRITE8_HANDLER( bking3_addr_l_w )
r1591r1592
210210   if (~data & 0x02)
211211   {
212212      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);
214214      main_sent = 0;
215215   }
216216
src/mame/drivers/unico.c
r1591r1592
715715
716716static MACHINE_RESET( zeropt )
717717{
718   machine_reset_unico(machine);
718   MACHINE_RESET_CALL(unico);
719719}
720720
721721static MACHINE_DRIVER_START( zeropnt )
src/mame/drivers/blockhl.c
r1591r1592
3939static INTERRUPT_GEN( blockhl_interrupt )
4040{
4141   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);
4343}
4444
4545static READ8_HANDLER( bankedram_r )
4646{
4747   if (palette_selected)
48      return paletteram_r(offset);
48      return paletteram[offset];
4949   else
5050      return ram[offset];
5151}
r1591r1592
6060
6161static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
6262{
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);
6464}
6565
6666
src/mame/drivers/gcpinbal.c
r1591r1592
4646
4747static TIMER_CALLBACK( gcpinbal_interrupt1 )
4848{
49   cpunum_set_input_line(0,1,HOLD_LINE);
49   cpunum_set_input_line(machine, 0,1,HOLD_LINE);
5050}
5151
5252#ifdef UNUSED_FUNCTION
r1591r1592
5555   // IRQ3 is from the M6585
5656//  if (!ADPCM_playing(0))
5757   {
58      cpunum_set_input_line(0,3,HOLD_LINE);
58      cpunum_set_input_line(machine, 0,3,HOLD_LINE);
5959   }
6060}
6161#endif
r1591r1592
6666
6767   timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, gcpinbal_interrupt1);
6868//  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);
7070}
7171
7272
r1591r1592
210210   AM_RANGE(0x000000, 0x1fffff) AM_READ(MRA16_ROM)
211211   AM_RANGE(0xc00000, 0xc03fff) AM_READ(gcpinbal_tilemaps_word_r)
212212   AM_RANGE(0xc80000, 0xc80fff) AM_READ(MRA16_RAM)   /* sprite ram */
213   AM_RANGE(0xd00000, 0xd00fff) AM_READ(paletteram16_word_r)
213   AM_RANGE(0xd00000, 0xd00fff) AM_READ(MRA16_RAM)
214214   AM_RANGE(0xd80000, 0xd800ff) AM_READ(ioc_r)
215215   AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM)   /* RAM */
216216ADDRESS_MAP_END
src/mame/drivers/realbrk.c
r1591r1592
227227   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
228228   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
229229   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNUSED )   // BUTTON3 in test mode
230   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2 ) PORT_PLAYER(2)
230   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2 )
231231   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
232232   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
233233   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
r1591r1592
235235   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
236236   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
237237   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNUSED )   // BUTTON3 in test mode
238   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1)
238   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_START1 )
239239
240240   PORT_START   // IN1 - $c00002.w
241241   PORT_BIT(  0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1591r1592
249249   PORT_BIT(  0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
250250
251251   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")
253253   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
254254   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
255255   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
r1591r1592
258258   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
259259   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
260260   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")
262262   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
263263   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
264264   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
r1591r1592
267267   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
268268   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
269269   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")
271271   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
272272   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")
274274   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
275275   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")
277277   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
278278   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
279   PORT_SERVICE( 0x0200, IP_ACTIVE_LOW )
279   PORT_SERVICE_DIPLOC( 0x0200, IP_ACTIVE_LOW, "SW1:10" )
280280
281281   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")
283283   PORT_DIPSETTING(      0x0000, "4" )
284284   PORT_DIPSETTING(      0x0001, "5" )
285285   PORT_DIPSETTING(      0x0003, "6" )
286286   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")
288288   PORT_DIPSETTING(      0x0008, DEF_STR( Easy )    )
289289   PORT_DIPSETTING(      0x000c, DEF_STR( Normal )  )
290290   PORT_DIPSETTING(      0x0004, DEF_STR( Harder )  )
291291   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
292   PORT_DIPNAME( 0x0030, 0x0030, "Time" )
292   PORT_DIPNAME( 0x0030, 0x0030, "Time" ) PORT_DIPLOCATION("SW2:5,6")
293293   PORT_DIPSETTING(      0x0000, "110" )
294294   PORT_DIPSETTING(      0x0030, "120" )
295295   PORT_DIPSETTING(      0x0020, "130" )
296296   PORT_DIPSETTING(      0x0010, "150" )
297   PORT_DIPNAME( 0x0040, 0x0040, "? Show time in easy mode ?" )
297   PORT_DIPNAME( 0x0040, 0x0040, "Showtime With Easy Mode" ) PORT_DIPLOCATION("SW2:7")
298298   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
299299   PORT_DIPSETTING(      0x0040, DEF_STR( Yes ) )
300   PORT_DIPNAME( 0x0080, 0x0080, "? Coins ?" )
300   PORT_DIPNAME( 0x0080, 0x0080, "Coins for Versus" ) PORT_DIPLOCATION("SW2:8")
301301   PORT_DIPSETTING(      0x0000, "1" )
302302   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" )
309305
310306   PORT_START   // IN4 - $c00004.w (DSW3) - Unused
311307   PORT_BIT(  0xffff, IP_ACTIVE_LOW,  IPT_UNKNOWN )
r1591r1592
365361   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
366362   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
367363   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 */
383384
384385   PORT_START
385386   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 ) )
389390   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
390391   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
391392   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r1591r1592
403404
404405   PORT_START
405406   PORT_BIT(     0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
406   PORT_BIT(     0x0100, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1)
407   PORT_BIT(     0x0100, IP_ACTIVE_LOW, IPT_START1 )
407408   PORT_BIT(     0x0200, IP_ACTIVE_LOW, IPT_UNUSED )
408409   PORT_BIT(     0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) //F/F
409410   PORT_BIT(     0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) //Stop
r1591r1592
415416
416417   PORT_START
417418   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 ) PORT_PLAYER(2)
419   PORT_BIT(     0x0100, IP_ACTIVE_LOW, IPT_START2 )
419420   PORT_BIT(     0x0200, IP_ACTIVE_LOW, IPT_UNUSED )
420421   PORT_BIT(     0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) //F/F
421422   PORT_BIT(     0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) //Stop
r1591r1592
444445   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
445446   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
446447   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 */
462468   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
463469   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
464470   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r1591r1592
491497   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
492498   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
493499   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 ) )
497503   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
498504   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
499505   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r1591r1592
563569   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
564570
565571   PORT_START //IN5
566   PORT_BIT(     0x0001, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1)
572   PORT_BIT(     0x0001, IP_ACTIVE_LOW, IPT_START1 )
567573   PORT_DIPNAME( 0x0002, 0x0002, "Pay-Out SW" )//Not a real DIP-Switch
568574   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
569575   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r1591r1592
578584   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)
579585
580586   PORT_START //IN6
581   PORT_BIT(     0x0001, IP_ACTIVE_LOW, IPT_START2 ) PORT_PLAYER(2)
587   PORT_BIT(     0x0001, IP_ACTIVE_LOW, IPT_START2 )
582588   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?
583589   PORT_BIT(     0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) //F/F
584590   PORT_BIT(     0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) //Stop
src/mame/drivers/diverboy.c
r1591r1592
6161   if (ACCESSING_LSB)
6262   {
6363      soundlatch_w(0,data & 0xff);
64      cpunum_set_input_line(1,0,HOLD_LINE);
64      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
6565   }
6666}
6767
src/mame/drivers/arcadia.c
r1591r1592
122122
123123   else
124124      /* overlay enabled, map Amiga system ROM on 0x000000 */
125      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ROM);
125      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP);
126126
127127   /* bit 2 = Power Led on Amiga */
128128   set_led_status(0, (data & 2) ? 0 : 1);
src/mame/drivers/segag80v.c
r1591r1592
182182{
183183   /* pressing the service switch sends an NMI */
184184   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);
186186}
187187
188188
src/mame/drivers/superchs.c
r1591r1592
8787
8888   if (ACCESSING_MSB)
8989   {
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 */
9292   }
9393
9494   if (ACCESSING_LSB32)
r1591r1592
221221        different byte in this long word before the RTE.  I assume all but the last
222222        (top) byte cause an IRQ with the final one being an ACK.  (Total guess but it works). */
223223   if (mem_mask!=0x00ffffff)
224      cpunum_set_input_line(0,3,HOLD_LINE);
224      cpunum_set_input_line(Machine, 0,3,HOLD_LINE);
225225}
226226
227227/***********************************************************
src/mame/drivers/bottom9.c
r1591r1592
2424static INTERRUPT_GEN( bottom9_interrupt )
2525{
2626   if (K052109_is_IRQ_enabled())
27      cpunum_set_input_line(0, 0, HOLD_LINE);
27      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
2828}
2929
3030
r1591r1592
5252static READ8_HANDLER( bottom9_bankedram2_r )
5353{
5454   if (K052109_selected) return K052109_051960_r(offset + 0x2000);
55   else return paletteram_r(offset);
55   else return paletteram[offset];
5656}
5757
5858static WRITE8_HANDLER( bottom9_bankedram2_w )
r1591r1592
9696
9797static WRITE8_HANDLER( bottom9_sh_irqtrigger_w )
9898{
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);
100100}
101101
102102static int nmienable;
r1591r1592
104104static INTERRUPT_GEN( bottom9_sound_interrupt )
105105{
106106   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);
108108}
109109
110110static WRITE8_HANDLER( nmi_enable_w )
src/mame/drivers/flower.c
r1591r1592
5353
5454static WRITE8_HANDLER( flower_irq_ack )
5555{
56   cpunum_set_input_line(0, 0, CLEAR_LINE);
56   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
5757}
5858
5959
r1591r1592
6363{
6464   sn_irq_enable = data & 1;
6565
66   cpunum_set_input_line(2, 0, CLEAR_LINE);
66   cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
6767}
6868
6969static INTERRUPT_GEN( sn_irq )
7070{
7171   if (sn_irq_enable)
72      cpunum_set_input_line(2, 0, ASSERT_LINE);
72      cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
7373}
7474
7575static WRITE8_HANDLER( sn_nmi_enable_w )
r1591r1592
8181{
8282   soundlatch_w(0,data);
8383   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);
8585}
8686
8787static ADDRESS_MAP_START( flower_cpu1, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/battlera.c
r1591r1592
4747{
4848   if (offset==0) {
4949      soundlatch_w(0,data);
50      cpunum_set_input_line(1, 0, HOLD_LINE);
50      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
5151   }
5252}
5353
r1591r1592
119119
120120   toggle = 1 - toggle;
121121   if (toggle)
122      cpunum_set_input_line(1, 1, HOLD_LINE);
122      cpunum_set_input_line(Machine, 1, 1, HOLD_LINE);
123123}
124124
125125static WRITE8_HANDLER( battlera_adpcm_data_w )
src/mame/drivers/xain.c
r1591r1592
199199static WRITE8_HANDLER( xain_sound_command_w )
200200{
201201   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);
203203}
204204
205205static WRITE8_HANDLER( xain_main_irq_w )
r1591r1592
207207   switch (offset)
208208   {
209209   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);
211211      break;
212212   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);
214214      break;
215215   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);
217217      break;
218218   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);
220220      break;
221221   }
222222}
223223
224224static WRITE8_HANDLER( xain_irqA_assert_w )
225225{
226   cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE);
226   cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
227227}
228228
229229static WRITE8_HANDLER( xain_irqB_clear_w )
230230{
231   cpunum_set_input_line(1,M6809_IRQ_LINE,CLEAR_LINE);
231   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
232232}
233233
234234static READ8_HANDLER( xain_68705_r )
r1591r1592
253253
254254   /* FIRQ (IMS) fires every on every 8th scanline (except 0) */
255255   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);
257257
258258   /* NMI fires on scanline 248 (VBL) and is latched */
259259   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);
261261
262262   /* VBLANK input bit is held high from scanlines 248-255 */
263263   if (scanline>=248-1) // -1 is a hack - see notes above
r1591r1592
455455/* handler called by the 2203 emulator when the internal timers cause an IRQ */
456456static void irqhandler(int irq)
457457{
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);
459459}
460460
461461static const struct YM2203interface ym2203_interface =
src/mame/drivers/gundealr.c
r1591r1592
7676         rambase[0x005] = readinputport(3);   /* IN1 */
7777         rambase[0x006] = readinputport(2);   /* IN0 */
7878      }
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 */
8080   }
8181   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) */
8383}
8484
8585static WRITE8_HANDLER( yamyam_bankswitch_w )
src/mame/drivers/namcos1.c
r1591r1592
394394
395395static WRITE8_HANDLER( namcos1_sub_firq_w )
396396{
397   cpunum_set_input_line(1, M6809_FIRQ_LINE, ASSERT_LINE);
397   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE);
398398}
399399
400400static WRITE8_HANDLER( irq_ack_w )
401401{
402   cpunum_set_input_line(cpu_getactivecpu(), 0, CLEAR_LINE);
402   cpunum_set_input_line(Machine, cpu_getactivecpu(), 0, CLEAR_LINE);
403403}
404404
405405static WRITE8_HANDLER( firq_ack_w )
406406{
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);
408408}
409409
410410
r1591r1592
971971
972972static void namcos1_sound_interrupt( int irq )
973973{
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);
975975}
976976
977977static const struct YM2151interface ym2151_interface =
r1591r1592
10071007   MDRV_CPU_PROGRAM_MAP(sound_map, 0)
10081008   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
10091009
1010   MDRV_CPU_ADD_TAG("MCU",HD63701,49152000/32)
1010   MDRV_CPU_ADD_TAG("MCU",HD63701,49152000/8)
10111011   MDRV_CPU_PROGRAM_MAP(mcu_map, 0)
10121012   MDRV_CPU_IO_MAP(mcu_port_map, 0)
10131013   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
src/mame/drivers/mainevt.c
r1591r1592
8888
8989static WRITE8_HANDLER( mainevt_sh_irqtrigger_w )
9090{
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);
9292}
9393
9494static WRITE8_HANDLER( mainevt_sh_irqcontrol_w )
r1591r1592
706706static MACHINE_DRIVER_START( mainevt )
707707
708708   /* basic machine hardware */
709   MDRV_CPU_ADD(HD6309, 3000000)   /* ?? */
709   MDRV_CPU_ADD(HD6309, 3000000*4)   /* ?? */
710710   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
711711   MDRV_CPU_VBLANK_INT(mainevt_interrupt,1)
712712
r1591r1592
745745static MACHINE_DRIVER_START( devstors )
746746
747747   /* basic machine hardware */
748   MDRV_CPU_ADD(HD6309, 3000000)   /* ?? */
748   MDRV_CPU_ADD(HD6309, 3000000*4)   /* ?? */
749749   MDRV_CPU_PROGRAM_MAP(dv_readmem,dv_writemem)
750750   MDRV_CPU_VBLANK_INT(dv_interrupt,1)
751751
src/mame/drivers/astrocde.c
r1591r1592
482482
483483static void ctc_interrupt(int state)
484484{
485   cpunum_set_input_line(1, 0, state);
485   cpunum_set_input_line(Machine, 1, 0, state);
486486}
487487
488488
r1591r1592
508508   /* initialize the CTC */
509509   ctc_intf.baseclock = cpunum_get_clock(0);
510510   z80ctc_init(0, &ctc_intf);
511   machine_start_astrocde(machine);
511   MACHINE_START_CALL(astrocde);
512512}
513513
514514
515515static WRITE8_HANDLER( tenpindx_sound_w )
516516{
517517   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);
519519}
520520
521521
src/mame/drivers/megazone.c
r1591r1592
7575
7676static WRITE8_HANDLER( megazone_i8039_irq_w )
7777{
78   cpunum_set_input_line(2, 0, ASSERT_LINE);
78   cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
7979}
8080
8181static WRITE8_HANDLER( i8039_irqen_and_status_w )
8282{
8383   if ((data & 0x80) == 0)
84      cpunum_set_input_line(2, 0, CLEAR_LINE);
84      cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
8585   i8039_status = (data & 0x70) >> 4;
8686}
8787
src/mame/drivers/deco156.c
r1591r1592
417417
418418static INTERRUPT_GEN( deco32_vbl_interrupt )
419419{
420   cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE);
420   cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE);
421421}
422422
423423static MACHINE_DRIVER_START( hvysmsh )
src/mame/drivers/toki.c
r1591r1592
6161static WRITE16_HANDLER( tokib_soundcommand16_w )
6262{
6363   soundlatch_w(0,data & 0xff);
64   cpunum_set_input_line(1, 0, HOLD_LINE);
64   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
6565}
6666
6767static READ16_HANDLER( pip16_r )
r1591r1592
8181
8282   toggle ^= 1;
8383   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);
8585}
8686
8787static WRITE8_HANDLER( toki_adpcm_control_w )
r1591r1592
726726
727727static DRIVER_INIT( toki )
728728{
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
729741   seibu_sound_decrypt(REGION_CPU2,0x2000);
730742}
731743
r1591r1592
800812         rom[i] = src^0x55;
801813      }
802814   }
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   }
803829}
804830
805831
src/mame/drivers/dwarfd.c
r1591r1592
545545   if(cpu_getiloops() < NUM_LINES)
546546   {
547547      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
549549      line=cpu_getiloops();
550550      idx=0;
551551   }
r1591r1592
553553   {
554554      if(cpu_getiloops() == NUM_LINES)
555555      {
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
557557      }
558558   }
559559}
r1591r1592
683683
684684static MACHINE_DRIVER_START( dwarfd )
685685   /* 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 */
687688
688689   MDRV_CPU_PROGRAM_MAP(mem_map, 0)
689690   MDRV_CPU_IO_MAP(io_map, 0)
src/mame/drivers/40love.c
r1591r1592
260260
261261static TIMER_CALLBACK( nmi_callback )
262262{
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);
264264   else pending_nmi = 1;
265265}
266266
r1591r1592
280280   sound_nmi_enable = 1;
281281   if (pending_nmi)
282282   {
283      cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
283      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
284284      pending_nmi = 0;
285285   }
286286}
src/mame/drivers/junofrst.c
r1591r1592
153153   if (last == 0 && data == 1)
154154   {
155155      /* 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);
157157   }
158158
159159   last = data;
r1591r1592
162162
163163static WRITE8_HANDLER( junofrst_i8039_irq_w )
164164{
165   cpunum_set_input_line(2, 0, ASSERT_LINE);
165   cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
166166}
167167
168168
169169static WRITE8_HANDLER( i8039_irqen_and_status_w )
170170{
171171   if ((data & 0x80) == 0)
172      cpunum_set_input_line(2, 0, CLEAR_LINE);
172      cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
173173   i8039_status = (data & 0x70) >> 4;
174174}
175175
src/mame/drivers/renegade.c
r1591r1592
200200static WRITE8_HANDLER( sound_w )
201201{
202202   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);
204204}
205205
206206/********************************************************************************************/
r1591r1592
503503   static int count;
504504   count = !count;
505505   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);
507507   else
508      cpunum_set_input_line(0, 0, HOLD_LINE);
508      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
509509}
510510
511511static WRITE8_HANDLER( renegade_coin_counter_w )
r1591r1592
761761/* handler called by the 3526 emulator when the internal timers cause an IRQ */
762762static void irqhandler(int linestate)
763763{
764   cpunum_set_input_line(1, M6809_FIRQ_LINE, linestate);
764   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, linestate);
765765}
766766
767767static const struct YM3526interface ym3526_interface =
src/mame/drivers/sg1000a.c
r1591r1592
248248
249249static void vdp_interrupt (int state)
250250{
251   cpunum_set_input_line(0,0, HOLD_LINE);
251   cpunum_set_input_line(Machine, 0,0, HOLD_LINE);
252252}
253253
254254static const TMS9928a_interface tms9928a_interface =
r1591r1592
323323
324324static DRIVER_INIT(chwrestl)
325325{
326   driver_init_sg1000a(machine);
326   DRIVER_INIT_CALL(sg1000a);
327327   regulus_decode();
328328}
329329
src/mame/drivers/galaga.c
r1591r1592
746746      case 0x00:   /* IRQ1 */
747747         cpu_interrupt_enable(0,bit);
748748         if (!bit)
749            cpunum_set_input_line(0, 0, CLEAR_LINE);
749            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
750750         break;
751751
752752      case 0x01:   /* IRQ2 */
753753         cpu_interrupt_enable(1,bit);
754754         if (!bit)
755            cpunum_set_input_line(1, 0, CLEAR_LINE);
755            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
756756         break;
757757
758758      case 0x02:   /* NMION */
r1591r1592
760760         break;
761761
762762      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);
765765         break;
766766
767767      case 0x04:   /* n.c. */
r1591r1592
30333033
30343034static DRIVER_INIT (gatsbee)
30353035{
3036   driver_init_galaga(machine);
3036   DRIVER_INIT_CALL(galaga);
30373037
30383038   /* Gatsbee has a larger character ROM, we need a handler for banking */
30393039   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, gatsbee_bank_w);
r1591r1592
30713071      rom[A] = BITSWAP8(rom[A],3,7,5,1,2,6,4,0);
30723072   }
30733073
3074   driver_init_xevious(machine);
3074   DRIVER_INIT_CALL(xevious);
30753075}
30763076
30773077
r1591r1592
30833083   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_w );
30843084   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_w );
30853085
3086   driver_init_xevious(machine);
3086   DRIVER_INIT_CALL(xevious);
30873087}
30883088
30893089
src/mame/drivers/panicr.c
r1591r1592
7171   int i;
7272
7373
74   palette_init_RRRR_GGGG_BBBB(machine, colortable, color_prom);
74   PALETTE_INIT_CALL(RRRR_GGGG_BBBB);
7575   color_prom += 256*3;
7676
7777   // txt lookup table
r1591r1592
209209static INTERRUPT_GEN( panicr_interrupt )
210210{
211211   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);
213213   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);
215215}
216216
217217static INPUT_PORTS_START( panicr )
src/mame/drivers/istellar.c
r1591r1592
101101   if (z80_2_nmi_enable)
102102   {
103103      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? */
105105      z80_2_nmi_enable = 0;
106106   }
107107}
r1591r1592
315315static INTERRUPT_GEN( vblank_callback_istellar )
316316{
317317   /* Interrupt presumably comes from VBlank */
318   cpunum_set_input_line(0, 0, ASSERT_LINE);
318   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
319319
320320   /* 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);
322322
323323   /* Only do the LDP's sync once */
324324   if (cpunum == 0)
src/mame/drivers/lasso.c
r1591r1592
3838{
3939   // VBlank
4040   if (cpu_getiloops() == 0)
41      cpunum_set_input_line(0, 0, HOLD_LINE);
41      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
4242   else
4343   {
4444      UINT8 coins_new;
r1591r1592
4848
4949      if ( ((coins_new & 0x10) && !(coins_old & 0x10)) ||
5050          ((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);
5252
5353      coins_old = coins_new;
5454   }
r1591r1592
6464static WRITE8_HANDLER( sound_command_w )
6565{
6666   soundlatch_w(offset,data);
67   cpunum_set_input_line(1, 0, PULSE_LINE);
67   cpunum_set_input_line(Machine, 1, 0, PULSE_LINE);
6868}
6969
7070static WRITE8_HANDLER( pinbo_sound_command_w )
7171{
7272   soundlatch_w(offset,data);
73   cpunum_set_input_line(1, 0, HOLD_LINE);
73   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
7474}
7575
7676static READ8_HANDLER( sound_status_r )
src/mame/drivers/sbowling.c
r1591r1592
134134{
135135   int vector = video_screen_get_vblank(0) ? 0xcf : 0xd7;   /* RST 08h/10h */
136136
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);
138138}
139139
140140static WRITE8_HANDLER (system_w)
src/mame/drivers/psychic5.c
r1591r1592
361361static INTERRUPT_GEN( psychic5_interrupt )
362362{
363363   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 */
365365   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 */
367367}
368368
369369
r1591r1592
536536
537537static void irqhandler(int irq)
538538{
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);
540540}
541541
542542static const struct YM2203interface ym2203_interface =
src/mame/drivers/taito_h.c
r1591r1592
160160/* Handler called by the YM2610 emulator when the internal timers cause an IRQ */
161161static void irqhandler(int irq)
162162{
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);
164164}
165165
166166static const struct YM2610interface syvalion_ym2610_interface =
r1591r1592
274274   AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP)
275275   AM_RANGE(0x300002, 0x300003) AM_READ(taitosound_comm16_lsb_r)
276276   AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r)
277   AM_RANGE(0x500800, 0x500fff) AM_READ(paletteram16_word_r)
277   AM_RANGE(0x500800, 0x500fff) AM_READ(MRA16_RAM)
278278ADDRESS_MAP_END
279279
280280static ADDRESS_MAP_START( syvalion_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
297297   AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP)
298298   AM_RANGE(0x300002, 0x300003) AM_READ(taitosound_comm16_lsb_r)
299299   AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r)
300   AM_RANGE(0x500800, 0x500fff) AM_READ(paletteram16_word_r)
300   AM_RANGE(0x500800, 0x500fff) AM_READ(MRA16_RAM)
301301ADDRESS_MAP_END
302302
303303static ADDRESS_MAP_START( recordbr_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
319319   AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP)
320320   AM_RANGE(0x300002, 0x300003) AM_READ(taitosound_comm16_lsb_r)
321321   AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r)
322   AM_RANGE(0x500800, 0x500fff) AM_READ(paletteram16_word_r)
322   AM_RANGE(0x500800, 0x500fff) AM_READ(MRA16_RAM)
323323ADDRESS_MAP_END
324324
325325static ADDRESS_MAP_START( dleague_writemem, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/othunder.c
r1591r1592
269269
270270   if (curr_level != last_irq_level)
271271   {
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);
273273      last_irq_level = curr_level;
274274   }
275275}
r1591r1592
681681/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
682682static void irqhandler(int irq)
683683{
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);
685685}
686686
687687static const struct YM2610interface ym2610_interface =
src/mame/drivers/ginganin.c
r1591r1592
327327      if (MC6809_CTR > S_TEMPO)
328328      {
329329         MC6809_CTR = 0;
330         cpunum_set_input_line(1, 0, HOLD_LINE);
330         cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
331331      }
332332      else
333333      {
src/mame/drivers/tail2nos.c
r1591r1592
4141   if (ACCESSING_LSB)
4242   {
4343      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);
4545   }
4646}
4747
r1591r1592
246246
247247static void irqhandler(int irq)
248248{
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);
250250}
251251
252252static const struct YM2608interface ym2608_interface =
src/mame/drivers/m79amb.c
r1591r1592
144144
145145static INTERRUPT_GEN( M79_interrupt )
146146{
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 */
148148}
149149
150150static DRIVER_INIT( m79amb )
src/mame/drivers/quasar.c
r1591r1592
372372
373373static INTERRUPT_GEN( quasar_interrupt )
374374{
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);
376376}
377377
378378// ************************(***************
src/mame/drivers/slapshot.c
r1591r1592
181181
182182static TIMER_CALLBACK( slapshot_interrupt6 )
183183{
184   cpunum_set_input_line(0,6,HOLD_LINE);
184   cpunum_set_input_line(machine, 0,6,HOLD_LINE);
185185}
186186
187187
188188static INTERRUPT_GEN( slapshot_interrupt )
189189{
190190   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);
192192}
193193
194194
r1591r1592
217217static WRITE16_HANDLER( opwolf3_adc_req_w )
218218{
219219   /* 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);
221221}
222222
223223/*****************************************************
r1591r1592
529529/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
530530static void irqhandler(int irq)
531531{
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);
533533}
534534
535535static const struct YM2610interface ym2610_interface =
src/mame/drivers/ertictac.c
r1591r1592
154154   IRQSTA|=0x40;
155155   if(IRQMSKA&0x40)
156156   {
157      cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE);
157      cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE);
158158   }
159159   startTimer();
160160}
r1591r1592
355355   IRQSTA|=0x08;
356356   if(IRQMSKA&0x08)
357357   {
358      cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE);
358      cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE);
359359   }
360360}
361361
src/mame/drivers/xyonix.c
r1591r1592
3434
3535static WRITE8_HANDLER( xyonix_irqack_w )
3636{
37   cpunum_set_input_line(0, 0, CLEAR_LINE);
37   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
3838}
3939
4040
src/mame/drivers/cninja.c
r1591r1592
5959static WRITE16_HANDLER( cninja_sound_w )
6060{
6161   soundlatch_w(0,data&0xff);
62   cpunum_set_input_line(1,0,HOLD_LINE);
62   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
6363}
6464
6565static WRITE16_HANDLER( stoneage_sound_w )
6666{
6767   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);
6969}
7070
7171static TIMER_CALLBACK( interrupt_gen )
r1591r1592
8383   deco16_raster_display_list[deco16_raster_display_position++]=deco16_pf34_control[3]&0xffff;
8484   deco16_raster_display_list[deco16_raster_display_position++]=deco16_pf34_control[4]&0xffff;
8585
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);
8787   timer_adjust(raster_irq_timer,attotime_never,0,attotime_zero);
8888}
8989
r1591r1592
9595      return cninja_scanline;
9696
9797   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);
100100      return 0;
101101   }
102102
r1591r1592
752752
753753static void sound_irq(int state)
754754{
755   cpunum_set_input_line(1,1,state); /* IRQ 2 */
755   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
756756}
757757
758758static void sound_irq2(int state)
759759{
760   cpunum_set_input_line(1,0,state);
760   cpunum_set_input_line(Machine, 1,0,state);
761761}
762762
763763static WRITE8_HANDLER( sound_bankswitch_w )
src/mame/drivers/pacland.c
r1591r1592
193193static WRITE8_HANDLER( pacland_subreset_w )
194194{
195195   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);
197197}
198198
199199static WRITE8_HANDLER( pacland_flipscreen_w )
r1591r1592
232232   int bit = !BIT(offset,11);
233233   cpu_interrupt_enable(0,bit);
234234   if (!bit)
235      cpunum_set_input_line(0, 0, CLEAR_LINE);
235      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
236236}
237237
238238static WRITE8_HANDLER( pacland_irq_2_ctrl_w )
r1591r1592
240240   int bit = !BIT(offset,13);
241241   cpu_interrupt_enable(1,bit);
242242   if (!bit)
243      cpunum_set_input_line(1, 0, CLEAR_LINE);
243      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
244244}
245245
246246
r1591r1592
416416   MDRV_CPU_PROGRAM_MAP(main_map,0)
417417   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
418418
419   MDRV_CPU_ADD(HD63701, 49152000/32)   /* 1.536 MHz? */
419   MDRV_CPU_ADD(HD63701, 49152000/8)   /* 1.536 MHz? */
420420   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
421421   MDRV_CPU_IO_MAP(mcu_port_map,0)
422422   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
src/mame/drivers/psikyo4.c
r1591r1592
225225
226226static INTERRUPT_GEN(psikyosh_interrupt)
227227{
228   cpunum_set_input_line(0, 4, HOLD_LINE);
228   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
229229}
230230
231231static READ32_HANDLER(hotgmck_io32_r) /* used by hotgmck/hgkairak */
r1591r1592
476476static void irqhandler(int linestate)
477477{
478478   if (linestate)
479      cpunum_set_input_line(0, 12, ASSERT_LINE);
479      cpunum_set_input_line(Machine, 0, 12, ASSERT_LINE);
480480   else
481      cpunum_set_input_line(0, 12, CLEAR_LINE);
481      cpunum_set_input_line(Machine, 0, 12, CLEAR_LINE);
482482}
483483
484484static const struct YMF278B_interface ymf278b_interface =
src/mame/drivers/wardner.c
r1591r1592
142142
143143      wardner_membank = data;
144144
145      if (data) {
145      if (data)
146      {
146147         memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, MRA8_BANK1);
147         switch (data) {
148         switch (data)
149         {
148150            case 2:  bankaddress = 0x10000; break;
149151            case 3:  bankaddress = 0x18000; break;
150152            case 4:  bankaddress = 0x20000; break;
r1591r1592
156158         }
157159         memory_set_bankptr(1,&RAM[bankaddress]);
158160      }
159      else {
160         memory_set_bankptr(1,&RAM[0x0000]);
161      else
162      {
161163         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, paletteram_r);
164         memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, MRA8_BANK4);
163165         memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xae00, 0xafff, 0, 0, MRA8_BANK2);
164166         memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0, MRA8_BANK3);
167         memory_set_bankptr(1, &RAM[0x0000]);
165168         memory_set_bankptr(2, rambase_ae00);
166169         memory_set_bankptr(3, rambase_c000);
170         memory_set_bankptr(4, paletteram);
167171      }
168172   }
169173}
r1591r1592
441445/* handler called by the 3812 emulator when the internal timers cause an IRQ */
442446static void irqhandler(int linestate)
443447{
444   cpunum_set_input_line(1,0,linestate);
448   cpunum_set_input_line(Machine, 1,0,linestate);
445449}
446450
447451static const struct YM3812interface ym3812_interface =
src/mame/drivers/jcross.c
r1591r1592
5555{
5656   sound_cpu_busy = 0x20;
5757   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);
5959}
6060
6161static READ8_HANDLER( sound_command_r )
r1591r1592
6666
6767static READ8_HANDLER( sound_nmi_ack_r )
6868{
69   cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE);
69   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
7070   return 0;
7171}
7272
src/mame/drivers/nss.c
r1591r1592
477477   MDRV_MACHINE_RESET( snes )
478478
479479   /* video hardware */
480   MDRV_VIDEO_START( generic_bitmapped )
481480   MDRV_VIDEO_UPDATE( snes )
482481
483482   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mame/drivers/rollrace.c
r1591r1592
256256   MDRV_PALETTE_LENGTH(256)
257257
258258   MDRV_PALETTE_INIT(wiz)
259   MDRV_VIDEO_START(generic)
260259   MDRV_VIDEO_UPDATE(rollrace)
261260
262261   /* sound hardware */
src/mame/drivers/missile.c
r1591r1592
315315
316316   /* assert the IRQ if not already asserted */
317317   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);
319319
320320   /* force an update while we're here */
321321   video_screen_update_partial(0, v_to_scanline(curv));
r1591r1592
345345
346346   /* starting at scanline 224, the CPU runs at half speed */
347347   if (curv == 224)
348      cpunum_set_clock(0, MASTER_CLOCK/16);
348      cpunum_set_clock(machine, 0, MASTER_CLOCK/16);
349349   else
350      cpunum_set_clock(0, MASTER_CLOCK/8);
350      cpunum_set_clock(machine, 0, MASTER_CLOCK/8);
351351
352352   /* scanline for the next run */
353353   curv ^= 224;
r1591r1592
410410
411411static MACHINE_RESET( missile )
412412{
413   cpunum_set_input_line(0, 0, CLEAR_LINE);
413   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
414414   irq_state = 0;
415415}
416416
r1591r1592
610610
611611   /* watchdog */
612612   else if (offset >= 0x4c00 && offset < 0x4d00)
613      watchdog_reset();
613      watchdog_reset(Machine);
614614
615615   /* interrupt ack */
616616   else if (offset >= 0x4d00 && offset < 0x4e00)
617617   {
618618      if (irq_state)
619619      {
620         cpunum_set_input_line(0, 0, CLEAR_LINE);
620         cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
621621         irq_state = 0;
622622      }
623623   }
src/mame/drivers/ddrible.c
r1591r1592
3838static INTERRUPT_GEN( ddrible_interrupt_0 )
3939{
4040   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);
4242}
4343
4444static INTERRUPT_GEN( ddrible_interrupt_1 )
4545{
4646   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);
4848}
4949
5050
src/mame/drivers/popper.c
r1591r1592
149149
150150static READ8_HANDLER( popper_soundcpu_nmi_r )
151151{
152   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
152   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
153153   return 0;
154154}
155155
src/mame/drivers/ladyfrog.c
r1591r1592
8585
8686static WRITE8_HANDLER( sound_cpu_reset_w )
8787{
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);
8989}
9090
9191static TIMER_CALLBACK( nmi_callback )
9292{
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);
9494   else pending_nmi = 1;
9595}
9696
r1591r1592
110110   sound_nmi_enable = 1;
111111   if (pending_nmi)
112112   {
113      cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
113      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
114114      pending_nmi = 0;
115115   }
116116}
src/mame/drivers/djboy.c
r1591r1592
656656
657657static WRITE8_HANDLER( trigger_nmi_on_cpu0 )
658658{
659   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
659   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
660660}
661661
662662static WRITE8_HANDLER( cpu0_bankswitch_w )
r1591r1592
715715static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 )
716716{
717717   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);
719719} /* trigger_nmi_on_sound_cpu2 */
720720
721721static WRITE8_HANDLER( cpu2_bankswitch_w )
r1591r1592
821821{ /* CPU1 uses interrupt mode 2. For now, just alternate the two interrupts. */
822822   static int addr = 0xff;
823823   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);
825825}
826826
827827static MACHINE_DRIVER_START( djboy )
src/mame/drivers/sidearms.c
r1591r1592
699699/* handler called by the 2203 emulator when the internal timers cause an IRQ */
700700static void irqhandler(int irq)
701701{
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);
703703}
704704
705705static const struct YM2203interface ym2203_interface =
src/mame/drivers/taito_x.c
r1591r1592
422422   AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r)
423423   AM_RANGE(0x900000, 0x9007ff) AM_READ(cchip1_ram_r)
424424   AM_RANGE(0x900802, 0x900803) AM_READ(cchip1_ctrl_r)
425   AM_RANGE(0xb00000, 0xb00fff) AM_READ(paletteram16_word_r)
425   AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA16_RAM)
426426   AM_RANGE(0xd00000, 0xd007ff) AM_READ(MRA16_RAM)   /* video attribute ram */
427427   AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM)   /* object ram */
428428   AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM)   /* Main RAM */
r1591r1592
450450   AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP)
451451   AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r)
452452   AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r)
453   AM_RANGE(0xb00000, 0xb00fff) AM_READ(paletteram16_word_r)
453   AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA16_RAM)
454454   AM_RANGE(0xd00000, 0xd00fff) AM_READ(MRA16_RAM)   /* video attribute ram */
455455   AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM)   /* object ram */
456456   AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM)   /* Main RAM */
r1591r1592
475475   AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP)
476476   AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r)
477477   AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r)
478   AM_RANGE(0xb00000, 0xb00fff) AM_READ(paletteram16_word_r)
478   AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA16_RAM)
479479   AM_RANGE(0xd00000, 0xd007ff) AM_READ(MRA16_RAM)   /* video attribute ram */
480480   AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM)   /* object ram */
481481   AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM)   /* Main RAM */
r1591r1592
500500   AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP)
501501   AM_RANGE(0x800002, 0x800003) AM_READ(taitosound_comm16_lsb_r)
502502   AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r)
503   AM_RANGE(0xb00000, 0xb00fff) AM_READ(paletteram16_word_r)
503   AM_RANGE(0xb00000, 0xb00fff) AM_READ(MRA16_RAM)
504504   AM_RANGE(0xd00000, 0xd007ff) AM_READ(MRA16_RAM)   /* video attribute ram */
505505   AM_RANGE(0xe00000, 0xe03fff) AM_READ(MRA16_RAM)   /* object ram */
506506   AM_RANGE(0xf00000, 0xf03fff) AM_READ(MRA16_RAM)   /* Main RAM */
r1591r1592
972972/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
973973static void irqhandler(int irq)
974974{
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);
976976}
977977
978978static const struct YM2610interface ym2610_interface =
src/mame/drivers/jack.c
r1591r1592
7272static WRITE8_HANDLER( jack_sh_command_w )
7373{
7474   soundlatch_w(0,data);
75   cpunum_set_input_line(1, 0, HOLD_LINE);
75   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
7676}
7777
7878
r1591r1592
914914static INTERRUPT_GEN( joinem_interrupts )
915915{
916916   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);
920918   else
921919   {
922920      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);
924922   }
925923}
926924
src/mame/drivers/tumblep.c
r1591r1592
7272static WRITE16_HANDLER( tumblep_sound_w )
7373{
7474   soundlatch_w(0,data & 0xff);
75   cpunum_set_input_line(1,0,HOLD_LINE);
75   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
7676}
7777
7878#ifdef UNUSED_FUNCTION
7979static WRITE16_HANDLER( jumppop_sound_w )
8080{
8181   soundlatch_w(0,data & 0xff);
82   cpunum_set_input_line( 1, 0, ASSERT_LINE );
82   cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE );
8383}
8484#endif
8585
r1591r1592
307307
308308static void sound_irq(int state)
309309{
310   cpunum_set_input_line(1,1,state); /* IRQ 2 */
310   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
311311}
312312
313313static const struct YM2151interface ym2151_interface =
src/mame/drivers/dogfgt.c
r1591r1592
3030   /* bit 0 used but unknown */
3131
3232   if (data & 0x04)
33      cpunum_set_input_line(1,0,ASSERT_LINE);
33      cpunum_set_input_line(Machine, 1,0,ASSERT_LINE);
3434}
3535
3636static WRITE8_HANDLER( sub_irqack_w )
3737{
38   cpunum_set_input_line(1,0,CLEAR_LINE);
38   cpunum_set_input_line(Machine, 1,0,CLEAR_LINE);
3939}
4040
4141
src/mame/drivers/dietgo.c
r1591r1592
192192
193193static void sound_irq(int state)
194194{
195   cpunum_set_input_line(1,1,state); /* IRQ 2 */
195   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
196196}
197197
198198static const struct YM2151interface ym2151_interface =
r1591r1592
206206   MDRV_CPU_PROGRAM_MAP(dietgo_map,0)
207207   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
208208
209   MDRV_CPU_ADD(H6280, XTAL_32_22MHz/4/12)   /* Custom chip 45; XIN is 32.220MHZ/4, HSM pin is low so XIN/12 */
209   MDRV_CPU_ADD(H6280, XTAL_32_22MHz/4/3)   /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */
210210   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
211211
212212   MDRV_SCREEN_REFRESH_RATE(58)
src/mame/drivers/taitosj.c
r1591r1592
226226static WRITE8_HANDLER( taitosj_soundcommand_w )
227227{
228228   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);
230230}
231231
232232static UINT8 input_port_4_f0;
src/mame/drivers/kingobox.c
r1591r1592
6060}
6161
6262static 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 );
6464}
6565
6666static 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 );
6868}
6969
7070static WRITE8_HANDLER( scroll_interrupt_w ) {
r1591r1592
7474
7575static WRITE8_HANDLER( sound_command_w ) {
7676   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 );
7878}
7979
8080
r1591r1592
544544static INTERRUPT_GEN( kingofb_interrupt ) {
545545
546546   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);
548548}
549549
550550static MACHINE_DRIVER_START( kingofb )
src/mame/drivers/nbmj8991.c
r1591r1592
8383      memory_configure_bank(1, 0, 4, memory_region(REGION_CPU2) + 0x8000, 0x8000);
8484      memory_set_bank(1, 0);
8585   }
86   machine_reset_nb1413m3(machine);
86   MACHINE_RESET_CALL(nb1413m3);
8787}
8888
8989static DRIVER_INIT( pstadium )
src/mame/drivers/blockout.c
r1591r1592
2828   /* interrupt 6 is vblank */
2929   /* interrupt 5 reads coin inputs - might have to be triggered only */
3030   /* 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);
3232}
3333
3434static WRITE16_HANDLER( blockout_sound_command_w )
r1591r1592
3636   if (ACCESSING_LSB)
3737   {
3838      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);
4040   }
4141}
4242
r1591r1592
303303/* handler called by the 2151 emulator when the internal timers cause an IRQ */
304304static void blockout_irq_handler(int irq)
305305{
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);
307307}
308308
309309static const struct YM2151interface ym2151_interface =
src/mame/drivers/tsamurai.c
r1591r1592
7272}
7373
7474static 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);
7676}
7777
7878static READ8_HANDLER( unknown_d803_r )
r1591r1592
103103static WRITE8_HANDLER( sound_command1_w )
104104{
105105   sound_command1 = data;
106   cpunum_set_input_line( 1, 0, HOLD_LINE );
106   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
107107}
108108
109109static WRITE8_HANDLER( sound_command2_w )
110110{
111111   sound_command2 = data;
112   cpunum_set_input_line( 2, 0, HOLD_LINE );
112   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE );
113113}
114114
115115static WRITE8_HANDLER( sound_command3_w )
116116{
117117   sound_command3 = data;
118   cpunum_set_input_line( 3, 0, HOLD_LINE );
118   cpunum_set_input_line(Machine, 3, 0, HOLD_LINE );
119119}
120120
121121static WRITE8_HANDLER( flip_screen_w )
r1591r1592
357357}
358358
359359static 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);
361361}
362362
363363/* what are these, protection of some kind? */
r1591r1592
384384
385385static WRITE8_HANDLER( vsgongf_sound_command_w ){
386386   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 );
388388}
389389
390390static ADDRESS_MAP_START( readmem_vsgongf, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/igs_m027.c
r1591r1592
359359
360360static INTERRUPT_GEN( igs_majhong_interrupt )
361361{
362   cpunum_set_input_line(0, ARM7_FIRQ_LINE, PULSE_LINE);
362   cpunum_set_input_line(machine, 0, ARM7_FIRQ_LINE, PULSE_LINE);
363363}
364364
365365
src/mame/drivers/ettrivia.c
r1591r1592
214214static INTERRUPT_GEN( ettrivia_interrupt )
215215{
216216   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);
220218   else
221   {
222      cpunum_set_input_line(0, 0, HOLD_LINE);
223   }
219      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
224220}
225221
226222static MACHINE_DRIVER_START( ettrivia )
src/mame/drivers/splash.c
r1591r1592
6969{
7070   if (ACCESSING_LSB){
7171      soundlatch_w(0,data & 0xff);
72      cpunum_set_input_line(1,0,HOLD_LINE);
72      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
7373   }
7474}
7575
r1591r1592
7777{
7878   if (ACCESSING_LSB){
7979      soundlatch_w(0,data & 0xff);
80      cpunum_set_input_line(1,0,HOLD_LINE);
80      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
8181   }
8282
8383   // give the z80 time to see it
src/mame/drivers/jalmah.c
r1591r1592
18861886{
18871887   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, urashima_mcu_r );
18881888   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));
18951895   mcu_prg = 0x12;
18961896}
18971897
r1591r1592
18991899{
19001900   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, daireika_mcu_r );
19011901   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));
19101910   mcu_prg = 0x11;
19111911}
19121912
r1591r1592
19141914{
19151915   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, mjzoomin_mcu_r );
19161916   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));
19231923   mcu_prg = 0x13;
19241924}
19251925
src/mame/drivers/f1gp.c
r1591r1592
7272   {
7373      pending_command = 1;
7474      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);
7676   }
7777}
7878
r1591r1592
550550
551551static void irqhandler(int irq)
552552{
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);
554554}
555555
556556static const struct YM2610interface ym2610_interface =
src/mame/drivers/tecmosys.c
r1591r1592
434434   if (input_code_pressed_once(KEYCODE_C))
435435   {
436436      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);
438438      popmessage("command write=%2x",command_data);
439439   }
440440#endif
r1591r1592
518518static void sound_irq(int irq)
519519{
520520   /* 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);
522522}
523523
524524static const struct YMF262interface ymf262_interface =
r1591r1592
648648
649649static TIMER_CALLBACK( reset_callback )
650650{
651   cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
651   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
652652}
653653
654654
src/mame/drivers/polyplay.c
r1591r1592
139139
140140static INTERRUPT_GEN( periodic_interrupt )
141141{
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);
143143}
144144
145145
r1591r1592
148148   static int last = 0;
149149
150150   if (readinputport(0) & 0x80)
151   {
152151      last = 0;
153   }
154152   else
155153   {
156154      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);
160156
161157      last = 1;
162158   }
r1591r1592
367363
368364static TIMER_CALLBACK( polyplay_timer_callback )
369365{
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);
371367}
372368
373369/* game driver */
src/mame/drivers/exidy440.c
r1591r1592
267267 *
268268 *************************************/
269269
270static void handle_coins(void)
270static void handle_coins(running_machine *machine)
271271{
272272   int coins;
273273
274274   /* if we got a coin, set the IRQ on the main CPU */
275275   coins = readinputport(3) & 3;
276276   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);
278278   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);
280280   last_coins = coins;
281281}
282282
r1591r1592
284284static INTERRUPT_GEN( main_interrupt )
285285{
286286   /* generate coin interrupts */
287   handle_coins();
287   handle_coins(machine);
288288   exidy440_vblank_interrupt(machine, cpunum);
289289}
290290
r1591r1592
381381         result = readinputport(3) ^ port_3_xor;
382382
383383         /* 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);
385385         break;
386386
387387      case 0x40:                              /* clear coin counters I/O2 */
r1591r1592
434434   exidy440_sound_command_ack = 0;
435435
436436   /* 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);
438438}
439439
440440
r1591r1592
452452      case 0x20:                              /* coin bits I/O1 */
453453
454454         /* 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);
456456         break;
457457
458458      case 0x40:                              /* coin counter I/O2 */
src/mame/drivers/exzisus.c
r1591r1592
131131
132132static WRITE8_HANDLER( exzisus_cpub_reset_w )
133133{
134   cpunum_set_input_line(3, INPUT_LINE_RESET, PULSE_LINE);
134   cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, PULSE_LINE);
135135}
136136
137137#if 0
r1591r1592
312312
313313static void irqhandler(int irq)
314314{
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);
316316}
317317
318318static const struct YM2151interface ym2151_interface =
src/mame/drivers/tx1.c
r1591r1592
6262/* Main CPU and Z80 synchronisation */
6363static WRITE16_HANDLER( z80_busreq_w )
6464{
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);
6666}
6767
6868static WRITE16_HANDLER( resume_math_w )
6969{
70   cpunum_set_input_line(1, INPUT_LINE_TEST, ASSERT_LINE);
70   cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, ASSERT_LINE);
7171}
7272
7373static WRITE16_HANDLER( halt_math_w )
7474{
75   cpunum_set_input_line(1, INPUT_LINE_TEST, CLEAR_LINE);
75   cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, CLEAR_LINE);
7676}
7777
7878/* Z80 can trigger an interrupt itself */
7979static WRITE8_HANDLER( z80_intreq_w )
8080{
81   cpunum_set_input_line(2, 0, HOLD_LINE);
81   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
8282}
8383
8484/* Periodic Z80 interrupt */
8585static INTERRUPT_GEN( z80_irq )
8686{
87   cpunum_set_input_line(2, 0, HOLD_LINE);
87   cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
8888}
8989
9090static READ16_HANDLER( z80_shared_r )
src/mame/drivers/thayers.c
r1591r1592
155155
156156static WRITE8_HANDLER(intrq_w)
157157{
158   cpunum_set_input_line(0, 0, ASSERT_LINE);
158   cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
159159}
160160
161161static WRITE8_HANDLER(sc01_register_w)
r1591r1592
180180                  SET_Z80_SSI_REQUEST();
181181                    if (!(Z80_SSI_REQUEST()))
182182                     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);
184184                  break;
185185
186186               default:
r1591r1592
289289   /* Assert the Z80's interrupt line if necessary */
290290   if (irq_flag)
291291   {
292      cpunum_set_input_line(0, 0, ASSERT_LINE);
292      cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
293293   }
294294}
295295
src/mame/drivers/dassault.c
r1591r1592
170170static WRITE16_HANDLER( dassault_sound_w )
171171{
172172   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 */
174174}
175175
176176/* The CPU-CPU irq controller is overlaid onto the end of the shared memory */
177177static READ16_HANDLER( dassault_irq_r )
178178{
179179   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;
182182   }
183183   return shared_ram[(0xffc/2)+offset]; /* The values probably don't matter */
184184}
r1591r1592
186186static WRITE16_HANDLER( dassault_irq_w )
187187{
188188   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;
191191   }
192192
193193   COMBINE_DATA(&shared_ram[(0xffc/2)+offset]); /* The values probably don't matter */
r1591r1592
533533
534534static void sound_irq(int state)
535535{
536   cpunum_set_input_line(2,1,state);
536   cpunum_set_input_line(Machine, 2,1,state);
537537}
538538
539539static WRITE8_HANDLER( sound_bankswitch_w )
src/mame/drivers/pingpong.c
r1591r1592
7575{
7676   if (cpu_getiloops() == 0)
7777   {
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);
7979   }
8080   else if (cpu_getiloops() % 2)
8181   {
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);
8383   }
8484}
8585
src/mame/drivers/blstroid.c
r1591r1592
3030 *
3131 *************************************/
3232
33static void update_interrupts(void)
33static void update_interrupts(running_machine *machine)
3434{
3535   int newstate = 0;
3636
r1591r1592
4242      newstate = 4;
4343
4444   if (newstate)
45      cpunum_set_input_line(0, newstate, ASSERT_LINE);
45      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4646   else
47      cpunum_set_input_line(0, 7, CLEAR_LINE);
47      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
4848}
4949
5050
src/mame/drivers/tatsumi.c
r1591r1592
170170static WRITE16_HANDLER(cyclwarr_sound_w)
171171{
172172   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);
174174}
175175
176176/***************************************************************************/
r1591r1592
807807
808808static void sound_irq(int state)
809809{
810   cpunum_set_input_line(2, INPUT_LINE_IRQ0, state);
810   cpunum_set_input_line(Machine, 2, INPUT_LINE_IRQ0, state);
811811}
812812
813813static const struct YM2151interface ym2151_interface =
r1591r1592
817817
818818static INTERRUPT_GEN( roundup5_interrupt )
819819{
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 */
821821}
822822
823823static MACHINE_DRIVER_START( apache3 )
r1591r1592
11881188   UINT8 *src2 = memory_region(REGION_GFX3);
11891189   int i;
11901190
1191   cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE); // ?
1191   cpunum_set_input_line(machine, 3, INPUT_LINE_HALT, ASSERT_LINE); // ?
11921192
11931193   for (i=0; i<0x100000; i+=32) {
11941194      memcpy(dst,src1,32);
src/mame/drivers/supbtime.c
r1591r1592
5353static WRITE16_HANDLER( sound_w )
5454{
5555   soundlatch_w(0,data & 0xff);
56   cpunum_set_input_line(1,0,HOLD_LINE);
56   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
5757}
5858
5959/******************************************************************************/
r1591r1592
362362
363363static void sound_irq(int state)
364364{
365   cpunum_set_input_line(1,1,state); /* IRQ 2 */
365   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
366366}
367367
368368static const struct YM2151interface ym2151_interface =
src/mame/drivers/toratora.c
r1591r1592
118118
119119static void main_cpu_irq(int state)
120120{
121logerror("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
123logerror("GEN IRQ: %x\n", combined_state);
124   cpunum_set_input_line(Machine, 0, 0, combined_state ? ASSERT_LINE : CLEAR_LINE);
123125}
124126
125127
r1591r1592
140142   if (last != (input_port_0_r(0) & 0x0f))
141143   {
142144      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);
144146   }
145147   pia_set_input_a(0, input_port_0_r(0) & 0x0f, 0);
146148
src/mame/drivers/retofinv.c
r1591r1592
6565
6666static WRITE8_HANDLER( cpu1_reset_w )
6767{
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);
6969}
7070
7171static WRITE8_HANDLER( cpu2_reset_w )
7272{
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);
7474}
7575
7676static WRITE8_HANDLER( mcu_reset_w )
7777{
7878   /* the bootlegs don't have a MCU, so make sure it's there before trying to reset it */
7979   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);
8181}
8282
8383static WRITE8_HANDLER( cpu2_m6000_w )
r1591r1592
9393static WRITE8_HANDLER( soundcommand_w )
9494{
9595      soundlatch_w(0, data);
96      cpunum_set_input_line(2, 0, HOLD_LINE);
96      cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
9797}
9898
9999static WRITE8_HANDLER( irq0_ack_w )
r1591r1592
102102
103103   cpu_interrupt_enable(0,bit);
104104   if (!bit)
105      cpunum_set_input_line(0, 0, CLEAR_LINE);
105      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
106106}
107107
108108static WRITE8_HANDLER( irq1_ack_w )
r1591r1592
111111
112112   cpu_interrupt_enable(1,bit);
113113   if (!bit)
114      cpunum_set_input_line(1, 0, CLEAR_LINE);
114      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
115115}
116116
117117static WRITE8_HANDLER( coincounter_w )
src/mame/drivers/gbusters.c
r1591r1592
2929static INTERRUPT_GEN( gbusters_interrupt )
3030{
3131   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);
3333}
3434
3535static READ8_HANDLER( bankedram_r )
3636{
3737   if (palette_selected)
38      return paletteram_r(offset);
38      return paletteram[offset];
3939   else
4040      return ram[offset];
4141}
r1591r1592
100100
101101static WRITE8_HANDLER( gbusters_sh_irqtrigger_w )
102102{
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);
104104}
105105
106106static WRITE8_HANDLER( gbusters_snd_bankswitch_w )
src/mame/drivers/megaplay.c
r1591r1592
9494         segae_hintpending = 1;
9595
9696         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);
9898            return;
9999         }
100100
r1591r1592
107107      hintcount = segae_vdp_regs[0][10];
108108
109109      if ( (sline<0xe0) && (segae_vintpending) ) {
110         cpunum_set_input_line(2, 0, HOLD_LINE);
110         cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
111111      }
112112   }
113113
r1591r1592
531531static WRITE8_HANDLER( megaplay_bios_6404_w )
532532{
533533   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);
535535   bios_6404 = data;
536536
537537//  logerror("BIOS: 0x6404 write: 0x%02x\n",data);
r1591r1592
665665
666666
667667/* in video/segasyse.c */
668void megaplay_start_video_normal(running_machine *machine);
669void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
668VIDEO_START( megaplay_normal );
669VIDEO_UPDATE( megaplay_normal );
670670
671671/* give us access to the megadriv start and update functions so that we can call them */
672extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
673extern void video_start_megadriv(running_machine *machine);
672VIDEO_START( megadriv );
673VIDEO_UPDATE( megadriv );
674674
675675static VIDEO_START(megplay)
676676{
677677   //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);
680680}
681681
682682static VIDEO_UPDATE(megplay)
683683{
684684   //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);
687687   return 0;
688688}
689689
r1591r1592
10101010   ic37_ram = auto_malloc(0x10000);
10111011   genesis_io_ram = auto_malloc(0x20);
10121012
1013   driver_init_megadrij(machine);
1013   DRIVER_INIT_CALL(megadrij);
10141014   megplay_stat();
10151015
10161016   /* for now ... */
src/mame/drivers/meadows.c
r1591r1592
217217
218218    /* fake something toggling the sense input line of the S2650 */
219219   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);
221221
222222   /* check the fake coin input */
223223   if (readinputport(3) & 0x01)
r1591r1592
225225      if (!coin1_state)
226226      {
227227         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);
229229      }
230230   }
231231   else
r1591r1592
245245   /* preserve the actual cycle count */
246246   cycles_at_vsync = cpunum_gettotalcycles(0);
247247   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 );
249249}
250250
251251
r1591r1592
327327{
328328    /* fake something toggling the sense input line of the S2650 */
329329   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);
331331}
332332
333333
src/mame/drivers/srmp2.c
r1591r1592
9595{
9696   switch (cpu_getiloops())
9797   {
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 */
100100   }
101101}
102102
r1591r1592
422422   AM_RANGE(0x300000, 0x300001) AM_READ(MRA16_NOP)            /* ??? */
423423   AM_RANGE(0x500000, 0x500001) AM_READ(input_port_8_word_r)   /* DSW 3-1 */
424424   AM_RANGE(0x500010, 0x500011) AM_READ(input_port_9_word_r)   /* DSW 3-2 */
425   AM_RANGE(0x700000, 0x7003ff) AM_READ(paletteram16_word_r)
425   AM_RANGE(0x700000, 0x7003ff) AM_READ(MRA16_RAM)
426426   AM_RANGE(0x800000, 0x800001) AM_READ(MRA16_NOP)            /* ??? */
427427   AM_RANGE(0x900000, 0x900001) AM_READ(srmp2_input_1_r)      /* I/O port 1 */
428428   AM_RANGE(0x900002, 0x900003) AM_READ(srmp2_input_2_r)      /* I/O port 2 */
src/mame/drivers/m72.c
r1591r1592
9898static MACHINE_RESET( m72 )
9999{
100100   m72_irq_base = 0x20;
101   machine_reset_m72_sound(machine);
101   MACHINE_RESET_CALL(m72_sound);
102102   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
103103}
104104
105105static MACHINE_RESET( xmultipl )
106106{
107107   m72_irq_base = 0x08;
108   machine_reset_m72_sound(machine);
108   MACHINE_RESET_CALL(m72_sound);
109109   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
110110}
111111
112112static MACHINE_RESET( kengo )
113113{
114114   m72_irq_base = 0x18;
115   machine_reset_m72_sound(machine);
115   MACHINE_RESET_CALL(m72_sound);
116116   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
117117}
118118
r1591r1592
124124   if (scanline < 256 && scanline == m72_raster_irq_position - 128)
125125   {
126126      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);
128128   }
129129
130130   /* VBLANK interrupt */
131131   else if (scanline == 256)
132132   {
133133      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);
135135   }
136136
137137   /* adjust for next scanline */
src/mame/drivers/r2dtank.c
r1591r1592
7373
7474static void main_cpu_irq(int state)
7575{
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);
7780}
7881
7982
r1591r1592
97100static WRITE8_HANDLER( audio_command_w )
98101{
99102   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);
101104
102105if (LOG_AUDIO_COMM) logerror("%08X   CPU#0  Audio Command Write: %x\n", safe_activecpu_get_pc(), data^0xff);
103106}
r1591r1592
119122      data = 0x00;
120123
121124   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);
123126
124127if (LOG_AUDIO_COMM) logerror("%08X  CPU#1  Audio Answer Write: %x\n", safe_activecpu_get_pc(), data);
125128}
r1591r1592
526529   MDRV_CPU_PROGRAM_MAP(r2dtank_main_map,0)
527530
528531   /* audio CPU */
529   MDRV_CPU_ADD(M6802,3000000/4)         /* ?? */
532   MDRV_CPU_ADD(M6802,3000000)         /* ?? */
530533   MDRV_CPU_PROGRAM_MAP(r2dtank_audio_map,0)
531534
532535   MDRV_MACHINE_START(r2dtank)
src/mame/drivers/pokechmp.c
r1591r1592
9595static WRITE8_HANDLER( pokechmp_sound_w )
9696{
9797   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);
9999}
100100
101101
src/mame/drivers/snk68.c
r1591r1592
127127static WRITE16_HANDLER( sound_w )
128128{
129129   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);
131131}
132132
133133/*******************************************************************************/
r1591r1592
679679
680680static void irqhandler(int irq)
681681{
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);
683683}
684684
685685static const struct YM3812interface ym3812_interface =
src/mame/drivers/madalien.c
r1591r1592
329329
330330static INTERRUPT_GEN( madalien_interrupt )
331331{
332   cpunum_set_input_line(0, INPUT_LINE_NMI,
332   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI,
333333      (readinputportbytag("PLAYER2") & 0x80) ? CLEAR_LINE : ASSERT_LINE);
334334}
335335
r1591r1592
466466
467467static WRITE8_HANDLER( madalien_sound_command_w )
468468{
469   cpunum_set_input_line(1, 0, ASSERT_LINE);
469   cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
470470
471471   soundlatch_w(offset, data);
472472}
r1591r1592
474474
475475static READ8_HANDLER(madalien_sound_command_r )
476476{
477   cpunum_set_input_line(1, 0, CLEAR_LINE);
477   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
478478
479479   return soundlatch_r(offset);
480480}
src/mame/drivers/igs_180.c
r1591r1592
5959
6060static WRITE8_HANDLER( nmi_ack_w )
6161{
62//  cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
62//  cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
6363}
6464
6565static WRITE8_HANDLER( irq0_ack_w )
6666{
67//  cpunum_set_input_line(0, 0, CLEAR_LINE);
67//  cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
6868}
6969
7070static READ8_HANDLER( ff_r )
r1591r1592
117117static INTERRUPT_GEN( igs_180_interrupt )
118118{
119119   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);    /* ???? */
121121   else
122      cpunum_set_input_line(0, 0, HOLD_LINE);//ASSERT_LINE);          /* ???? */
122      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);//ASSERT_LINE);          /* ???? */
123123}
124124
125125static MACHINE_DRIVER_START( igs_180 )
src/mame/drivers/aeroboto.c
r1591r1592
5555static INTERRUPT_GEN( aeroboto_interrupt )
5656{
5757   if (!disable_irq)
58      cpunum_set_input_line(0, 0, HOLD_LINE);
58      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
5959   else
6060      disable_irq--;
6161}
src/mame/drivers/konamigv.c
r1591r1592
444444
445445static NVRAM_HANDLER( simpbowl )
446446{
447   nvram_handler_konamigv_93C46( machine, file, read_or_write );
447   NVRAM_HANDLER_CALL(konamigv_93C46);
448448   nvram_handler_intelflash( machine, 0, file, read_or_write );
449449   nvram_handler_intelflash( machine, 1, file, read_or_write );
450450   nvram_handler_intelflash( machine, 2, file, read_or_write );
r1591r1592
551551   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c7, 0, 0, trackball_r );
552552   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c8, 0x1f6800cb, 0, 0, unknown_r ); /* ?? */
553553
554   driver_init_konamigv(machine);
554   DRIVER_INIT_CALL(konamigv);
555555}
556556
557557static MACHINE_DRIVER_START( simpbowl )
r1591r1592
626626
627627static NVRAM_HANDLER( btchamp )
628628{
629   nvram_handler_konamigv_93C46( machine, file, read_or_write );
629   NVRAM_HANDLER_CALL(konamigv_93C46);
630630   nvram_handler_intelflash( machine, 0, file, read_or_write );
631631}
632632
r1591r1592
640640   memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r );
641641   memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w );
642642
643   driver_init_konamigv(machine);
643   DRIVER_INIT_CALL(konamigv);
644644}
645645
646646static MACHINE_DRIVER_START( btchamp )
r1591r1592
695695   memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, tokimeki_serial_r );
696696   memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, tokimeki_serial_w );
697697
698   driver_init_konamigv(machine);
698   DRIVER_INIT_CALL(konamigv);
699699}
700700
701701/*
r1591r1592
732732   memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r );
733733   memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w );
734734
735   driver_init_konamigv(machine);
735   DRIVER_INIT_CALL(konamigv);
736736}
737737
738738static MACHINE_DRIVER_START( kdeadeye )
src/mame/drivers/firetrap.c
r1591r1592
145145   if (data==0x26) {
146146      i8751_current_command=0;
147147      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);
149149      return;
150150   }
151151
r1591r1592
192192   }
193193
194194   /* 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);
196196   i8751_current_command=data;
197197}
198198
199199static WRITE8_HANDLER( firetrap_sound_command_w )
200200{
201201   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);
203203}
204204
205205static WRITE8_HANDLER( firetrap_sound_2400_w )
r1591r1592
228228
229229   toggle ^= 1;
230230   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);
232232}
233233
234234static WRITE8_HANDLER( firetrap_adpcm_data_w )
r1591r1592
555555            definitely doesn't expect them as it locks out the coin routine */
556556      if (coin_command_pending && !i8751_current_command) {
557557         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);
559559         coin_command_pending=0;
560560      }
561561   }
562562
563563   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);
565565}
566566
567567static INTERRUPT_GEN( bootleg )
568568{
569569   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);
571571}
572572
573573static MACHINE_DRIVER_START( firetrap )
src/mame/drivers/crgolf.c
r1591r1592
117117
118118static TIMER_CALLBACK( main_to_sound_callback )
119119{
120   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
120   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
121121   main_to_sound_data = param;
122122}
123123
r1591r1592
130130
131131static READ8_HANDLER( main_to_sound_r )
132132{
133   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
133   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
134134   return main_to_sound_data;
135135}
136136
r1591r1592
144144
145145static TIMER_CALLBACK( sound_to_main_callback )
146146{
147   cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE);
147   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
148148   sound_to_main_data = param;
149149}
150150
r1591r1592
157157
158158static READ8_HANDLER( sound_to_main_r )
159159{
160   cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
160   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
161161   return sound_to_main_data;
162162}
163163
src/mame/drivers/mastboy.c
r1591r1592
640640
641641   mastboy_m5205_part ^= 1;
642642   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);
644644}
645645
646646
r1591r1592
655655static WRITE8_HANDLER( mastboy_irq0_ack_w )
656656{
657657   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);
659659}
660660
661661static INTERRUPT_GEN( mastboy_interrupt )
662662{
663663   if ((mastboy_irq0_ack&1)==1)
664664   {
665      cpunum_set_input_line(0,0, ASSERT_LINE);
665      cpunum_set_input_line(machine, 0,0, ASSERT_LINE);
666666   }
667667}
668668
src/mame/drivers/thedeep.c
r1591r1592
4444static WRITE8_HANDLER( thedeep_sound_w )
4545{
4646   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);
4848}
4949
5050static UINT8 protection_command, protection_data;
r1591r1592
322322
323323static void irqhandler(int irq)
324324{
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);
326326}
327327
328328static const struct YM2203interface thedeep_ym2203_intf =
r1591r1592
347347            protection_irq = 1;
348348      }
349349      if (protection_irq)
350         cpunum_set_input_line(0, 0, HOLD_LINE);
350         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
351351   }
352352   else
353353   {
354354      if (nmi_enable)
355355      {
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);
358358      }
359359   }
360360}
src/mame/drivers/oneshot.c
r1591r1592
358358
359359static void irq_handler(int irq)
360360{
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);
362362}
363363
364364static const struct YM3812interface ym3812_interface =
src/mame/drivers/topspeed.c
r1591r1592
269269   /* bit 0 enables cpu B */
270270   /* however this fails when recovering from a save state
271271       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);
273273
274274}
275275
r1591r1592
293293
294294static TIMER_CALLBACK( topspeed_interrupt6  )
295295{
296   cpunum_set_input_line(0,6,HOLD_LINE);
296   cpunum_set_input_line(machine, 0,6,HOLD_LINE);
297297}
298298
299299/* 68000 B */
300300
301301static TIMER_CALLBACK( topspeed_cpub_interrupt6 )
302302{
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 */
304304}
305305
306306
r1591r1592
308308{
309309   /* Unsure how many int6's per frame */
310310   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);
312312}
313313
314314static INTERRUPT_GEN( topspeed_cpub_interrupt )
315315{
316316   /* Unsure how many int6's per frame */
317317   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);
319319}
320320
321321
r1591r1592
453453static ADDRESS_MAP_START( topspeed_readmem, ADDRESS_SPACE_PROGRAM, 16 )
454454   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM)
455455   AM_RANGE(0x400000, 0x40ffff) AM_READ(sharedram_r)   // all shared ??
456   AM_RANGE(0x500000, 0x503fff) AM_READ(paletteram16_word_r)
456   AM_RANGE(0x500000, 0x503fff) AM_READ(MRA16_RAM)
457457   AM_RANGE(0x7e0000, 0x7e0001) AM_READ(MRA16_NOP)
458458   AM_RANGE(0x7e0002, 0x7e0003) AM_READ(taitosound_comm16_lsb_r)
459459   AM_RANGE(0x800000, 0x8003ff) AM_READ(MRA16_RAM)   /* raster line color control */
r1591r1592
658658
659659static void irq_handler(int irq)   /* assumes Z80 sandwiched between 68Ks */
660660{
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);
662662}
663663
664664static const struct YM2151interface ym2151_interface =
src/mame/drivers/zr107.c
r1591r1592
216216         EEPROM_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
217217
218218         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);
222220         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);
226222      }
227223      return;
228224   }
r1591r1592
231227      if (!(mem_mask & 0xff000000))
232228      {
233229         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
237232         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);
241234
242235         set_cgboard_id((data >> 28) & 0x3);
243236
r1591r1592
311304   AM_RANGE(0x74000000, 0x74003fff) AM_MIRROR(0x80000000) AM_READWRITE(K056832_ram_long_r, K056832_ram_long_w)
312305   AM_RANGE(0x74020000, 0x7402003f) AM_MIRROR(0x80000000) AM_READWRITE(K056832_long_r, K056832_long_w)
313306   AM_RANGE(0x74060000, 0x7406003f) AM_MIRROR(0x80000000) AM_READWRITE(ccu_r, ccu_w)
314   AM_RANGE(0x74080000, 0x74081fff) AM_MIRROR(0x80000000) AM_READWRITE(paletteram32_r, paletteram32_w) AM_BASE(&paletteram32)
307   AM_RANGE(0x74080000, 0x74081fff) AM_MIRROR(0x80000000) AM_READWRITE(MRA32_RAM, paletteram32_w) AM_BASE(&paletteram32)
315308   AM_RANGE(0x740a0000, 0x740a3fff) AM_MIRROR(0x80000000) AM_READ(K056832_rom_long_r)
316309   AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)      /* 21N 21K 23N 23K */
317310   AM_RANGE(0x78010000, 0x7801ffff) AM_MIRROR(0x80000000) AM_WRITE(cgboard_dsp_shared_w_ppc)
r1591r1592
337330static ADDRESS_MAP_START( jetwave_map, ADDRESS_SPACE_PROGRAM, 32 )
338331   AM_RANGE(0x00000000, 0x000fffff) AM_MIRROR(0x80000000) AM_RAM      /* Work RAM */
339332   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(paletteram32_r, jetwave_palette_w) AM_BASE(&paletteram32)
333   AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_READWRITE(MRA32_RAM, jetwave_palette_w) AM_BASE(&paletteram32)
341334   AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w)
342335   AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w)
343336   AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)      /* 21N 21K 23N 23K */
r1591r1592
566559*/
567560static INTERRUPT_GEN( zr107_vblank )
568561{
569   cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
562   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
570563}
571564static MACHINE_RESET( zr107 )
572565{
573   cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE);
566   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
574567}
575568
576569static MACHINE_DRIVER_START( zr107 )
r1591r1592
666659static void sound_irq_callback(int irq)
667660{
668661   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);
672663   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);
676665}
677666
678667static DRIVER_INIT(zr107)
src/mame/drivers/amspdwy.c
r1591r1592
6868static WRITE8_HANDLER( amspdwy_sound_w )
6969{
7070   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);
7272}
7373
7474static ADDRESS_MAP_START( amspdwy_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r1591r1592
258258
259259static void irq_handler(int irq)
260260{
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);
262262}
263263
264264static const struct YM2151interface amspdwy_ym2151_interface =
src/mame/drivers/segae.c
r1591r1592
581581static int sms_vdp_cpu0_irq_callback(int status)
582582{
583583   if (status==1)
584   {
585      cpunum_set_input_line(0,0,HOLD_LINE);
586   }
584      cpunum_set_input_line(Machine, 0,0,HOLD_LINE);
587585   else
588   {
589      cpunum_set_input_line(0,0,CLEAR_LINE);
590   }
586      cpunum_set_input_line(Machine, 0,0,CLEAR_LINE);
591587
592588   return 0;
593589}
r1591r1592
595591static int sms_vdp_cpu1_irq_callback(int status)
596592{
597593   if (status==1)
598   {
599      cpunum_set_input_line(1,0,HOLD_LINE);
600   }
594      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
601595   else
602   {
603      cpunum_set_input_line(1,0,CLEAR_LINE);
604   }
596      cpunum_set_input_line(Machine, 1,0,CLEAR_LINE);
605597
606598   return 0;
607599}
r1591r1592
610602static int sms_vdp_cpu2_irq_callback(int status)
611603{
612604   if (status==1)
613   {
614      cpunum_set_input_line(2,0,HOLD_LINE);
615   }
605      cpunum_set_input_line(Machine, 2,0,HOLD_LINE);
616606   else
617   {
618      cpunum_set_input_line(2,0,CLEAR_LINE);
619   }
607      cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
620608
621609   return 0;
622610}
r1591r1592
14761464VIDEO_EOF(sms)
14771465{
14781466   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!!!
14801468}
14811469#endif
14821470
r1591r1592
22162204   /* fixed rom bank area */
22172205//  sms_rom = auto_malloc(0xc000);
22182206//  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_ROM);
2207//  memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, MWA8_UNMAP);
22202208//  memory_set_bankptr( 1, sms_rom );
22212209
22222210   memory_configure_bank(1, 0, 16, memory_region(REGION_CPU1) + 0x10000, 0x4000);
r1591r1592
23532341
23542342static DRIVER_INIT( ridleofp )
23552343{
2356   driver_init_segasyse(machine);
2344   DRIVER_INIT_CALL(segasyse);
23572345
23582346   memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r);
23592347   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w);
r1591r1592
23622350
23632351static DRIVER_INIT( hangonjr )
23642352{
2365   driver_init_segasyse(machine);
2353   DRIVER_INIT_CALL(segasyse);
23662354
23672355   memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r);
23682356   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w);
r1591r1592
23702358
23712359static DRIVER_INIT( opaopa )
23722360{
2373   driver_init_segasyse(machine);
2361   DRIVER_INIT_CALL(segasyse);
23742362
23752363   mc8123_decrypt_rom(0, memory_region(REGION_USER1), 1, 8);
23762364}
23772365
23782366static DRIVER_INIT( fantzn2 )
23792367{
2380   driver_init_segasyse(machine);
2368   DRIVER_INIT_CALL(segasyse);
23812369
23822370   mc8123_decrypt_rom(0, memory_region(REGION_USER1), 0, 0);
23832371}
23842372
23852373static DRIVER_INIT( astrofl )
23862374{
2387   driver_init_segasyse(machine);
2375   DRIVER_INIT_CALL(segasyse);
23882376
23892377   astrofl_decode();
23902378}
src/mame/drivers/fantland.c
r1591r1592
6969static WRITE8_HANDLER( fantland_soundlatch_w )
7070{
7171   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);
7373}
7474
7575static WRITE16_HANDLER( fantland_soundlatch_16_w )
r1591r1592
700700static INTERRUPT_GEN( fantland_irq )
701701{
702702   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);
704704}
705705
706706static INTERRUPT_GEN( fantland_sound_irq )
707707{
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);
709709}
710710
711711static MACHINE_DRIVER_START( fantland )
r1591r1592
752752
753753static void galaxygn_sound_irq(int line)
754754{
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);
756756}
757757
758758static const struct YM2151interface galaxygn_ym2151_interface =
r1591r1592
808808{
809809   int voice;
810810
811   machine_reset_fantland(machine);
811   MACHINE_RESET_CALL(fantland);
812812
813813   for (voice = 0; voice < 4; voice++)
814814      borntofi_adpcm_stop(voice);
src/mame/drivers/ksys573.c
r1591r1592
263263{
264264   int i;
265265
266   nvram_handler_timekeeper_0( machine, file, read_or_write );
266   NVRAM_HANDLER_CALL(timekeeper_0);
267267
268268   if( nvram_handler_security_cart_0 != NULL )
269269   {
270      nvram_handler_security_cart_0( machine, file, read_or_write );
270      NVRAM_HANDLER_CALL(security_cart_0);
271271   }
272272
273273   if( nvram_handler_security_cart_1 != NULL )
274274   {
275      nvram_handler_security_cart_1( machine, file, read_or_write );
275      NVRAM_HANDLER_CALL(security_cart_1);
276276   }
277277
278278   for( i = 0; i < flash_chips; i++ )
r1591r1592
16721672
16731673static DRIVER_INIT( ge765pwbba )
16741674{
1675   driver_init_konami573( machine );
1675   DRIVER_INIT_CALL(konami573);
16761676
16771677   uPD4701_init( 0 );
16781678
r1591r1592
19721972
19731973static DRIVER_INIT( ddr )
19741974{
1975   driver_init_konami573( machine );
1975   DRIVER_INIT_CALL(konami573);
19761976
19771977   gx700pwfbf_init( gn845pwbb_output_callback );
19781978
r1591r1592
20302030
20312031static DRIVER_INIT( gtrfrks )
20322032{
2033   driver_init_konami573( machine );
2033   DRIVER_INIT_CALL(konami573);
20342034
20352035   memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r );
20362036   memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_w );
r1591r1592
23402340
23412341static DRIVER_INIT( ddrdigital )
23422342{
2343   driver_init_konami573( machine );
2343   DRIVER_INIT_CALL(konami573);
23442344
23452345   gx894pwbba_init( gn845pwbb_output_callback );
23462346}
r1591r1592
23492349
23502350static DRIVER_INIT( gtrfrkdigital )
23512351{
2352   driver_init_konami573( machine );
2352   DRIVER_INIT_CALL(konami573);
23532353
23542354   gx894pwbba_init( NULL );
23552355
r1591r1592
24142414
24152415static DRIVER_INIT( ddrsolo )
24162416{
2417   driver_init_konami573( machine );
2417   DRIVER_INIT_CALL(konami573);
24182418
24192419   gx894pwbba_init( ddrsolo_output_callback );
24202420}
r1591r1592
24872487
24882488static DRIVER_INIT( drmn )
24892489{
2490   driver_init_konami573( machine );
2490   DRIVER_INIT_CALL(konami573);
24912491
24922492   gx700pwfbf_init( drmn_output_callback );
24932493}
24942494
24952495static DRIVER_INIT( drmndigital )
24962496{
2497   driver_init_konami573( machine );
2497   DRIVER_INIT_CALL(konami573);
24982498
24992499   gx894pwbba_init( drmn_output_callback );
25002500}
r1591r1592
26432643
26442644static DRIVER_INIT( dmx )
26452645{
2646   driver_init_konami573( machine );
2646   DRIVER_INIT_CALL(konami573);
26472647
26482648   gx894pwbba_init( dmx_output_callback );
26492649
r1591r1592
27112711
27122712static DRIVER_INIT( salarymc )
27132713{
2714   driver_init_konami573( machine );
2714   DRIVER_INIT_CALL(konami573);
27152715
27162716   security_bit7_write = salarymc_lamp_data_write;
27172717   security_bit6_write = salarymc_lamp_rst_write;
src/mame/drivers/atarig1.c
r1591r1592
4848 *
4949 *************************************/
5050
51static void update_interrupts(void)
51static void update_interrupts(running_machine *machine)
5252{
5353   int newstate = 0;
5454
r1591r1592
5858      newstate = 2;
5959
6060   if (newstate)
61      cpunum_set_input_line(0, newstate, ASSERT_LINE);
61      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
6262   else
63      cpunum_set_input_line(0, 7, CLEAR_LINE);
63      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
6464}
6565
6666
src/mame/drivers/sbrkout.c
r1591r1592
116116
117117   /* if this is a rising edge of 16V, assert the CPU interrupt */
118118   if (scanline % 32 == 16)
119      cpunum_set_input_line(0, 0, ASSERT_LINE);
119      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
120120
121121   /* update the DAC state */
122122   DAC_data_w(0, (videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
r1591r1592
138138
139139static WRITE8_HANDLER( irq_ack_w )
140140{
141   cpunum_set_input_line(0, 0, CLEAR_LINE);
141   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
142142}
143143
144144
r1591r1592
182182static void update_nmi_state(void)
183183{
184184   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);
186186   else
187      cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
187      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
188188}
189189
190190
src/mame/drivers/bladestl.c
r1591r1592
4343{
4444   if (cpu_getiloops() == 0){
4545      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);
4747   }
4848   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);
5050   }
5151}
5252
r1591r1592
8989static WRITE8_HANDLER( bladestl_sh_irqtrigger_w )
9090{
9191   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);
9393   //logerror("(sound) write %02x\n", data);
9494}
9595
r1591r1592
107107   AM_RANGE(0x0000, 0x1fff) AM_READ(K007342_r)         /* Color RAM + Video RAM */
108108   AM_RANGE(0x2000, 0x21ff) AM_READ(K007420_r)         /* Sprite RAM */
109109   AM_RANGE(0x2200, 0x23ff) AM_READ(K007342_scroll_r)   /* Scroll RAM */
110   AM_RANGE(0x2400, 0x245f) AM_READ(paletteram_r)      /* Palette */
110   AM_RANGE(0x2400, 0x245f) AM_READ(MRA8_RAM)         /* Palette */
111111   AM_RANGE(0x2e01, 0x2e01) AM_READ(input_port_3_r)      /* 1P controls */
112112   AM_RANGE(0x2e02, 0x2e02) AM_READ(input_port_4_r)      /* 2P controls */
113113   AM_RANGE(0x2e03, 0x2e03) AM_READ(input_port_1_r)      /* DISPW #2 */
r1591r1592
431431static MACHINE_DRIVER_START( bladestl )
432432
433433   /* basic machine hardware */
434   MDRV_CPU_ADD(HD6309, 3000000)      /* 24MHz/8 (?) */
434   MDRV_CPU_ADD(HD6309, 24000000/2)      /* 24MHz/2 (?) */
435435   MDRV_CPU_PROGRAM_MAP(bladestl_readmem,bladestl_writemem)
436436   MDRV_CPU_VBLANK_INT(bladestl_interrupt,2) /* (1 IRQ + 1 NMI) */
437437
src/mame/drivers/toobin.c
r1591r1592
4040 *
4141 *************************************/
4242
43static void update_interrupts(void)
43static void update_interrupts(running_machine *machine)
4444{
4545   int newstate = 0;
4646
r1591r1592
5050      newstate |= 2;
5151
5252   if (newstate)
53      cpunum_set_input_line(0, newstate, ASSERT_LINE);
53      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
5454   else
55      cpunum_set_input_line(0, 7, CLEAR_LINE);
55      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
5656}
5757
5858
src/mame/drivers/bwidow.c
r1591r1592
326326
327327static WRITE8_HANDLER( irq_ack_w )
328328{
329   cpunum_set_input_line(0, 0, CLEAR_LINE);
329   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
330330}
331331
332332
src/mame/drivers/srumbler.c
r1591r1592
5858static INTERRUPT_GEN( srumbler_interrupt )
5959{
6060   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);
6462   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);
6864}
6965
7066
src/mame/drivers/legionna.c
r1591r1592
25642564      case (0x65c/2):
25652565      {
25662566         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 );
25682568         break;
25692569      }
25702570      /*video regs (not scrollram,something else)*/
r1591r1592
25812581      /*case (0x740/2):
25822582        {
25832583            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 );
25852585            break;
25862586        }*/
25872587      #if 0
r1591r1592
38513851   ROM_LOAD( "barrel.8",  0x00000, 0x20000, CRC(489e5b1d) SHA1(ecd69d87ed354d1d08dbe6c2890af5f05d9d67d0) )
38523852ROM_END
38533853
3854ROM_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) )
3886ROM_END
3887
38883854/*
38893855
38903856Godzilla
r1591r1592
44074373GAME( 1992, heatbrl,  0,        heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (World)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
44084374GAME( 1992, heatbrlo, heatbrl,  heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (World old version)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
44094375GAME( 1992, heatbrlu, heatbrl,  heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (US)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4410GAME( 1992, hetbrlu2, heatbrl,  heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (US set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
44114376
44124377GAME( 1993, godzilla, 0,        godzilla, godzilla, 0,        ROT0, "Banpresto", "Godzilla", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
44134378GAME( 1993, sdgndmrb, 0,        sdgndmrb, sdgndmrb, 0,         ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/pbaction.c
r1591r1592
5454static WRITE8_HANDLER( pbaction_sh_command_w )
5555{
5656   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);
5858}
5959
6060
r1591r1592
257257
258258static INTERRUPT_GEN( pbaction_interrupt )
259259{
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 */
261261}
262262
263263
src/mame/drivers/overdriv.c
r1591r1592
153153
154154static INTERRUPT_GEN( cpuA_interrupt )
155155{
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);
158158}
159159
160160static INTERRUPT_GEN( cpuB_interrupt )
161161{
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);
163163}
164164
165165
166166static MACHINE_RESET( overdriv )
167167{
168168   /* 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);
170170}
171171
172172static WRITE16_HANDLER( cpuA_ctrl_w )
r1591r1592
174174   if (ACCESSING_LSB)
175175   {
176176      /* 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);
178178
179179      /* bit 1 is clear during service mode - function unknown */
180180
r1591r1592
236236
237237static WRITE16_HANDLER( overdriv_soundirq_w )
238238{
239   cpunum_set_input_line(2,M6809_IRQ_LINE,HOLD_LINE);
239   cpunum_set_input_line(Machine, 2,M6809_IRQ_LINE,HOLD_LINE);
240240}
241241
242242static WRITE16_HANDLER( overdriv_cpuB_irq5_w )
243243{
244   cpunum_set_input_line(1,5,HOLD_LINE);
244   cpunum_set_input_line(Machine, 1,5,HOLD_LINE);
245245}
246246
247247static WRITE16_HANDLER( overdriv_cpuB_irq6_w )
248248{
249   cpunum_set_input_line(1,6,HOLD_LINE);
249   cpunum_set_input_line(Machine, 1,6,HOLD_LINE);
250250}
251251
252252
src/mame/drivers/thunderx.c
r1591r1592
2929static INTERRUPT_GEN( scontra_interrupt )
3030{
3131   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);
3333}
3434
3535static TIMER_CALLBACK( thunderx_firq_callback )
3636{
37   cpunum_set_input_line(0, KONAMI_FIRQ_LINE, HOLD_LINE);
37   cpunum_set_input_line(machine, 0, KONAMI_FIRQ_LINE, HOLD_LINE);
3838}
3939
4040
r1591r1592
4545static READ8_HANDLER( scontra_bankedram_r )
4646{
4747   if (palette_selected)
48      return paletteram_r(offset);
48      return paletteram[offset];
4949   else
5050      return ram[offset];
5151}
r1591r1592
7676      }
7777   }
7878   else
79      return paletteram_r(offset);
79      return paletteram[offset];
8080}
8181
8282static WRITE8_HANDLER( thunderx_bankedram_w )
r1591r1592
354354
355355static WRITE8_HANDLER( thunderx_sh_irqtrigger_w )
356356{
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);
358358}
359359
360360static WRITE8_HANDLER( scontra_snd_bankswitch_w )
src/mame/drivers/jackpool.c
r1591r1592
168168/* verify */
169169static INTERRUPT_GEN( jackpool_interrupt )
170170{
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 */
172172}
173173
174174
src/mame/drivers/spcforce.c
r1591r1592
7474
7575static WRITE8_HANDLER( spcforce_soundtrigger_w )
7676{
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);
7878}
7979
8080
r1591r1592
251251static MACHINE_DRIVER_START( spcforce )
252252
253253   /* 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??? */
255256   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
256257   MDRV_CPU_VBLANK_INT(irq3_line_hold,1)
257258
r1591r1592
273274   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
274275
275276   MDRV_PALETTE_INIT(spcforce)
276   MDRV_VIDEO_START(generic_bitmapped)
277277   MDRV_VIDEO_UPDATE(spcforce)
278278
279279   /* sound hardware */
src/mame/drivers/gsword.c
r1591r1592
274274{
275275   if(josvolly_nmi_enable)
276276   {
277      cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
277      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
278278      josvolly_nmi_enable = 0;
279279   }
280280}
r1591r1592
284284{
285285   if(gsword_nmi_enable)
286286   {
287      cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
287      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
288288   }
289289}
290290
r1591r1592
358358static WRITE8_HANDLER( adpcm_soundcommand_w )
359359{
360360   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);
362362}
363363
364364static ADDRESS_MAP_START( cpu1_map, 0 , 8 )
src/mame/drivers/nmg5.c
r1591r1592
245245   if (ACCESSING_LSB)
246246   {
247247      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);
249249   }
250250}
251251
r1591r1592
958958
959959static void soundirq(int state)
960960{
961   cpunum_set_input_line(1, 0, state);
961   cpunum_set_input_line(Machine, 1, 0, state);
962962}
963963
964964static const struct YM3812interface ym3812_intf =
src/mame/drivers/mario.c
r1591r1592
163163static ADDRESS_MAP_START( mario_map, ADDRESS_SPACE_PROGRAM, 8 )
164164   AM_RANGE(0x0000, 0x5fff) AM_ROM
165165   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)
168168   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(mario_sh1_w) /* Mario run sample */
169169   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(mario_sh2_w) /* Luigi run sample */
170170   AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
src/mame/drivers/xmen.c
r1591r1592
141141
142142static WRITE16_HANDLER( sound_irq_w )
143143{
144   cpunum_set_input_line(1, 0, HOLD_LINE);
144   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
145145}
146146
147147//int xmen_irqenabled;
src/mame/drivers/atarifb.c
r1591r1592
111111#include "abaseb.lh"
112112
113113
114int atarifb_game;
115114
116
117
118115/*************************************
119116 *
120117 *  Palette generation
r1591r1592
153150static ADDRESS_MAP_START( atarifb_map, ADDRESS_SPACE_PROGRAM, 8 )
154151   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )
155152   AM_RANGE(0x0000, 0x01ff) AM_RAM
156   AM_RANGE(0x0200, 0x025f) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap1_vram) AM_SIZE(&atarifb_alphap1_vram_size)
153   AM_RANGE(0x0200, 0x025f) AM_READWRITE(MRA8_RAM, atarifb_alpha1_videoram_w) AM_BASE(&atarifb_alphap1_videoram)
157154   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)
160157   AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
161158   AM_RANGE(0x2000, 0x2000) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
162159   AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb_out1_w) /* OUT 1 */
r1591r1592
171168ADDRESS_MAP_END
172169
173170
171static 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
190ADDRESS_MAP_END
191
192
193static 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
211ADDRESS_MAP_END
212
213
174214static ADDRESS_MAP_START( soccer_map, ADDRESS_SPACE_PROGRAM, 8 )
175215   ADDRESS_MAP_FLAGS( AMEF_ABITS(14) )
176216   AM_RANGE(0x0000, 0x01ff) AM_RAM
177   AM_RANGE(0x0200, 0x025f) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap1_vram) AM_SIZE(&atarifb_alphap1_vram_size)
217   AM_RANGE(0x0200, 0x025f) AM_READWRITE(MRA8_RAM, atarifb_alpha1_videoram_w) AM_BASE(&atarifb_alphap1_videoram)
178218   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)
181221   AM_RANGE(0x0bc0, 0x0bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
182222   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 */
185225   AM_RANGE(0x1004, 0x1004) AM_WRITE(MWA8_NOP) /* Interrupt Acknowledge */
186226   AM_RANGE(0x1005, 0x1005) AM_WRITE(watchdog_reset_w)
187227   AM_RANGE(0x1800, 0x1800) AM_READ(atarifb4_in0_r)
r1591r1592
485525   { 0 },
486526   { 0, 1, 2, 3, 4, 5, 6, 7 },
487527   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
488         8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
528     8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
489529   16*8
490530};
491531
r1591r1592
498538   { 0 },
499539   { 0, 1, 2, 3, 4, 5, 6, 7 },
500540   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
501         8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
541     8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
502542   16*8
503543};
504544
r1591r1592
543583   MDRV_PALETTE_LENGTH(12)
544584
545585   MDRV_PALETTE_INIT(atarifb)
546   MDRV_VIDEO_START(generic)
586   MDRV_VIDEO_START(atarifb)
547587   MDRV_VIDEO_UPDATE(atarifb)
548588
549589   /* sound hardware */
r1591r1592
555595MACHINE_DRIVER_END
556596
557597
598static 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)
604MACHINE_DRIVER_END
605
606
558607static MACHINE_DRIVER_START( abaseb )
559608
560609   /* basic machine hardware */
561610   MDRV_IMPORT_FROM(atarifb)
611   MDRV_CPU_PROGRAM_MAP(abaseb_map,0)
562612
613   /* video hardware */
614   MDRV_VIDEO_UPDATE(abaseb)
615
563616   /* sound hardware */
564617   MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
565618   MDRV_SOUND_CONFIG_DISCRETE(abaseb)
r1591r1592
577630   /* video hardware */
578631   MDRV_SCREEN_VISIBLE_AREA(0*8, 38*8-1, 2*8, 32*8-1)
579632   MDRV_GFXDECODE(soccer)
633   MDRV_VIDEO_UPDATE(soccer)
580634MACHINE_DRIVER_END
581635
582636
r1591r1592
729783ROM_END
730784
731785
732/*************************************
733 *
734 *  Driver initialization
735 *
736 *************************************/
737786
738static DRIVER_INIT( atarifb )
739{
740   /* Tell the video code to draw the plays for this version */
741   atarifb_game = 1;
742}
743
744
745static 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
756static DRIVER_INIT( abaseb )
757{
758   /* Tell the video code to draw the plays for this version */
759   atarifb_game = 3;
760}
761
762
763static DRIVER_INIT( soccer )
764{
765   /* Tell the video code to draw the plays for this version */
766   atarifb_game = 4;
767}
768
769
770
771787/*************************************
772788 *
773789 *  Game drivers
774790 *
775791 *************************************/
776792
777/*     YEAR  NAME      PARENT   MACHINE   INPUT     INIT      MONITOR  */
778GAMEL( 1978, atarifb,  0,       atarifb,  atarifb,  atarifb,  ROT0, "Atari", "Atari Football (revision 2)", 0, layout_atarifb )
779GAMEL( 1978, atarifb1, atarifb, atarifb,  atarifb,  atarifb,  ROT0, "Atari", "Atari Football (revision 1)", 0, layout_atarifb )
780GAMEL( 1979, atarifb4, atarifb, atarifb,  atarifb4, atarifb4, ROT0, "Atari", "Atari Football (4 players)", 0, layout_atarifb4 )
781GAMEL( 1979, abaseb,   0,       abaseb,   abaseb,   abaseb,   ROT0, "Atari", "Atari Baseball (set 1)", 0, layout_abaseb )
782GAMEL( 1979, abaseb2,  abaseb,  abaseb,   abaseb,   abaseb,   ROT0, "Atari", "Atari Baseball (set 2)", 0, layout_abaseb )
783GAME ( 1980, soccer,   0,       soccer,   soccer,   soccer,   ROT0, "Atari", "Atari Soccer", 0 )
793/*     YEAR  NAME      PARENT   MACHINE   INPUT */
794GAMEL( 1978, atarifb,  0,       atarifb,  atarifb,  0, ROT0, "Atari", "Atari Football (revision 2)", 0, layout_atarifb )
795GAMEL( 1978, atarifb1, atarifb, atarifb,  atarifb,  0, ROT0, "Atari", "Atari Football (revision 1)", 0, layout_atarifb )
796GAMEL( 1979, atarifb4, atarifb, atarifb4, atarifb4, 0, ROT0, "Atari", "Atari Football (4 players)", 0, layout_atarifb4 )
797GAMEL( 1979, abaseb,   0,       abaseb,   abaseb,   0, ROT0, "Atari", "Atari Baseball (set 1)", 0, layout_abaseb )
798GAMEL( 1979, abaseb2,  abaseb,  abaseb,   abaseb,   0, ROT0, "Atari", "Atari Baseball (set 2)", 0, layout_abaseb )
799GAME ( 1980, soccer,   0,       soccer,   soccer,   0, ROT0, "Atari", "Atari Soccer", 0 )
src/mame/drivers/wink.c
r1591r1592
5555
5656static WRITE8_HANDLER( sound_irq_w )
5757{
58   cpunum_set_input_line(1,0,HOLD_LINE);
58   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
5959   //sync with sound cpu (but it still loses some soundlatches...)
6060   //timer_call_after_resynch(NULL, 0, NULL);
6161}
src/mame/drivers/lethal.c
r1591r1592
172172#include "machine/eeprom.h"
173173#include "sound/k054539.h"
174174
175#define MAIN_CLOCK      XTAL_24MHz
176#define SOUND_CLOCK      XTAL_18_432MHz
177
178
175179#define GUNX( a ) (( ( readinputport( a ) * 287 ) / 0xff ) + 16)
176180#define GUNY( a ) (( ( readinputport( a ) * 223 ) / 0xff ) + 10)
177181
r1591r1592
247251
248252static INTERRUPT_GEN(lethalen_interrupt)
249253{
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);
251255}
252256
253257static WRITE8_HANDLER( sound_cmd_w )
r1591r1592
257261
258262static WRITE8_HANDLER( sound_irq_w )
259263{
260   cpunum_set_input_line(1, 0, HOLD_LINE);
264   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
261265}
262266
263267static READ8_HANDLER( sound_status_r )
r1591r1592
267271
268272static void sound_nmi(void)
269273{
270   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
274   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
271275}
272276
273277static WRITE8_HANDLER( le_bankswitch_w )
r1591r1592
281285{
282286   if (cur_control2 & 0x10)   // RAM enable
283287   {
284      return paletteram_r(offset);
288      return paletteram[offset];
285289   }
286290   else
287291   {
r1591r1592
649653
650654static MACHINE_DRIVER_START( lethalen )
651655   /* basic machine hardware */
652   MDRV_CPU_ADD_TAG("main", HD6309, 8000000)   // ???
656   MDRV_CPU_ADD_TAG("main", HD6309, MAIN_CLOCK/2)   // ???
653657   MDRV_CPU_PROGRAM_MAP(le_main, 0)
654658   MDRV_CPU_VBLANK_INT(lethalen_interrupt, 1)
655659
656660   MDRV_CPU_ADD_TAG("sound", Z80, 8000000)
657   /* audio CPU */
658661   MDRV_CPU_PROGRAM_MAP(le_sound, 0)
659662
660663   MDRV_SCREEN_REFRESH_RATE(60)
r1591r1592
667670
668671   MDRV_GFXDECODE(lethal)
669672
670
671673   /* video hardware */
672674   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS)
673675   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/videopin.c
r1591r1592
3636         time_released = timer_get_time();
3737
3838         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);
4240      }
4341      else
44      {
4542         time_pushed = timer_get_time();
46      }
4743
4844      prev = val;
4945   }
r1591r1592
5652
5753   update_plunger();
5854
59   cpunum_set_input_line(0, 0, ASSERT_LINE);
55   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
6056
6157   scanline = scanline + 32;
6258
r1591r1592
135131   output_set_value(matrix[i][3], (data >> 3) & 1);
136132
137133   if (i == 7)
138   {
139134      set_led_status(0, data & 8);   /* start button */
140   }
141135
142   cpunum_set_input_line(0, 0, CLEAR_LINE);
136   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
143137}
144138
145139
r1591r1592
157151   mask = ~data & 0x10;
158152
159153   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);
163155
164156   coin_lockout_global_w(~data & 0x08);
165157
src/mame/drivers/exprraid.c
r1591r1592
9999static WRITE8_HANDLER( sound_cpu_command_w )
100100{
101101    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);
103103}
104104
105105static READ8_HANDLER( vblank_r )
r1591r1592
280280/* handler called by the 3812 emulator when the internal timers cause an IRQ */
281281static void irqhandler(int linestate)
282282{
283   cpunum_set_input_line_and_vector(1,0,linestate,0xff);
283   cpunum_set_input_line_and_vector(Machine, 1,0,linestate,0xff);
284284}
285285
286286static const struct YM3526interface ym3526_interface =
r1591r1592
295295   if ( ( ~readinputport( 3 ) ) & 0xc0 ) {
296296      if ( coin == 0 ) {
297297         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);
299299      }
300300   } else
301301      coin = 0;
src/mame/drivers/tecmo16.c
r1591r1592
6262   if (ACCESSING_LSB)
6363   {
6464      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);
6666   }
6767}
6868
r1591r1592
427427
428428static void irqhandler(int irq)
429429{
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);
431431}
432432
433433static const struct YM2151interface ym2151_interface =
src/mame/drivers/2mindril.c
r1591r1592
176176
177177static INTERRUPT_GEN( drill_interrupt )
178178{
179   cpunum_set_input_line(0, 4, HOLD_LINE);
179   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
180180}
181181
182182static void irqhandler(int irq)
183183{
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);
185185}
186186
187187static const struct YM2610interface ym2610_interface =
src/mame/drivers/naughtyb.c
r1591r1592
218218static INTERRUPT_GEN( naughtyb_interrupt )
219219{
220220   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);
222222}
223223
224224static INPUT_PORTS_START( naughtyb )
src/mame/drivers/runaway.c
r1591r1592
3232   /* assume Centipede-style interrupt timing */
3333   int scanline = param;
3434
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);
3636
3737   scanline += 32;
3838
r1591r1592
8282
8383static WRITE8_HANDLER( runaway_irq_ack_w )
8484{
85   cpunum_set_input_line(0, 0, CLEAR_LINE);
85   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
8686}
8787
8888
src/mame/drivers/taitowlf.c
r1591r1592
451451
452452static void set_gate_a20(int a20)
453453{
454   cpunum_set_input_line(0, INPUT_LINE_A20, a20);
454   cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20);
455455}
456456
457457static void keyboard_interrupt(int state)
src/mame/drivers/toypop.c
r1591r1592
161161static WRITE8_HANDLER( toypop_main_interrupt_enable_w )
162162{
163163   cpu_interrupt_enable(0,1);
164   cpunum_set_input_line(0, 0, CLEAR_LINE);
164   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
165165}
166166
167167static WRITE8_HANDLER( toypop_main_interrupt_disable_w )
r1591r1592
172172static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w )
173173{
174174   cpu_interrupt_enable(1,1);
175   cpunum_set_input_line(1, 0, CLEAR_LINE);
175   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
176176}
177177
178178static WRITE8_HANDLER( toypop_sound_interrupt_disable_w )
r1591r1592
183183static INTERRUPT_GEN( toypop_main_interrupt )
184184{
185185   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);
187187
188188   namcoio_set_irq_line(0,PULSE_LINE);
189189   namcoio_set_irq_line(1,PULSE_LINE);
r1591r1592
192192
193193static WRITE8_HANDLER( toypop_sound_clear_w )
194194{
195   cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
195   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
196196}
197197
198198static WRITE8_HANDLER( toypop_sound_assert_w )
199199{
200   cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
200   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
201201}
202202
203203static WRITE8_HANDLER( toypop_m68000_clear_w )
204204{
205   cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE);
205   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
206206}
207207
208208static WRITE8_HANDLER( toypop_m68000_assert_w )
209209{
210   cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE);
210   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
211211}
212212
213213static TIMER_CALLBACK( disable_interrupts )
214214{
215215   cpu_interrupt_enable(0,0);
216   cpunum_set_input_line(0, 0, CLEAR_LINE);
216   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
217217   cpu_interrupt_enable(1,0);
218   cpunum_set_input_line(1, 0, CLEAR_LINE);
218   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
219219   interrupt_enable_68k = 0;
220220}
221221
r1591r1592
229229static INTERRUPT_GEN( toypop_m68000_interrupt )
230230{
231231   if (interrupt_enable_68k)
232      cpunum_set_input_line(2, 6, HOLD_LINE);
232      cpunum_set_input_line(machine, 2, 6, HOLD_LINE);
233233}
234234
235235static WRITE16_HANDLER( toypop_m68000_interrupt_enable_w )
src/mame/drivers/tumbleb.c
r1591r1592
339339static WRITE16_HANDLER( tumblepb_sound_w )
340340{
341341   soundlatch_w(0,data & 0xff);
342   cpunum_set_input_line(1,0,HOLD_LINE);
342   cpunum_set_input_line(machine, 1,0,HOLD_LINE);
343343}
344344#endif
345345
346346static WRITE16_HANDLER( jumppop_sound_w )
347347{
348348   soundlatch_w(0,data & 0xff);
349   cpunum_set_input_line( 1, 0, ASSERT_LINE );
349   cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE );
350350}
351351
352352/******************************************************************************/
r1591r1592
460460
461461static INTERRUPT_GEN( tumbleb2_interrupt )
462462{
463   cpunum_set_input_line(0, 6, HOLD_LINE);
463   cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
464464   tumbleb2_playmusic();
465465}
466466
r1591r1592
768768static WRITE16_HANDLER( jumpkids_sound_w )
769769{
770770   soundlatch_w(0,data & 0xff);
771   cpunum_set_input_line(1,0,HOLD_LINE);
771   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
772772}
773773
774774
r1591r1592
895895
896896static READ8_HANDLER(jumppop_z80latch_r)
897897{
898   cpunum_set_input_line(1, 0, CLEAR_LINE);
898   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
899899   return soundlatch_r(0);
900900}
901901
r1591r1592
21552155
21562156static void semicom_irqhandler(int irq)
21572157{
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);
21592159}
21602160
21612161
r1591r1592
36703670
36713671static DRIVER_INIT( chokchok )
36723672{
3673   driver_init_htchctch(machine);
3673   DRIVER_INIT_CALL(htchctch);
36743674
36753675   /* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */
36763676   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w);
r1591r1592
36813681
36823682static DRIVER_INIT( wlstar )
36833683{
3684   driver_init_htchctch(machine);
3684   DRIVER_INIT_CALL(htchctch);
36853685
36863686   /* slightly different banking */
36873687   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, wlstar_tilebank_w);
src/mame/drivers/micro3d.c
r1591r1592
118118     M68681.SRB |= 0x0100;                          // Set Receiver B ready.
119119     if(M68681.IMR & 0x1000)
120120     {
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.
122122        mame_printf_debug("INTERRUPT!!!\n");
123123     }
124124   mame_printf_debug("8031 sent data: %x\n",data);
r1591r1592
451451
452452       if(m68901_base[IMASK_REG] & (bit<<8))              // If interrupt is not masked by MFD, trigger a 68k INT
453453       {
454                cpunum_set_input_line(0,4, HOLD_LINE);
454                cpunum_set_input_line(Machine, 0,4, HOLD_LINE);
455455            //    logerror("M68901 interrupt %d serviced.\n",source);
456456       }
457457}
r1591r1592
513513
514514      case 0x03:        M68681.TBA = value;                   // Fill transmit buffer
515515                        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.
517517
518518#if HOST_MONITOR_DISPLAY
519519                        mame_printf_debug("%c",value);                    // Port A - Monitor
r1591r1592
541541                        // Write to sound board
542542                        if(M68681.IMR & 0x1000)
543543                        {
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.
545545                        }
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
547547                        mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,activecpu_get_pc());
548548                        break;
549549
src/mame/drivers/momoko.c
r1591r1592
5555   AM_RANGE(0xd406, 0xd406) AM_READ(input_port_2_r)
5656   AM_RANGE(0xd407, 0xd407) AM_READ(input_port_3_r)
5757
58   AM_RANGE(0xd800, 0xdbff) AM_READ(paletteram_r)
58   AM_RANGE(0xd800, 0xdbff) AM_READ(MRA8_RAM)
5959   AM_RANGE(0xe000, 0xe3ff) AM_READ(MRA8_RAM) /* text */
6060
6161   AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_BANK1)
r1591r1592
270270   MDRV_GFXDECODE(momoko)
271271   MDRV_PALETTE_LENGTH(512)
272272
273   MDRV_VIDEO_START(generic)
274273   MDRV_VIDEO_UPDATE(momoko)
275274
276275   /* sound hardware */
src/mame/drivers/kchamp.c
r1591r1592
118118
119119static WRITE8_HANDLER( sound_reset_w ) {
120120   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);
122122}
123123
124124static WRITE8_HANDLER( sound_control_w ) {
r1591r1592
128128
129129static WRITE8_HANDLER( sound_command_w ) {
130130   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 );
132132}
133133
134134static int msm_data = 0;
r1591r1592
203203ADDRESS_MAP_END
204204
205205static 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);
207207   return 0;
208208}
209209
r1591r1592
399399static INTERRUPT_GEN( kc_interrupt ) {
400400
401401   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);
403403}
404404
405405static void msmint( int data ) {
r1591r1592
415415
416416   if ( !( counter ^= 1 ) ) {
417417      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 );
419419      }
420420   }
421421}
r1591r1592
433433static INTERRUPT_GEN( sound_int ) {
434434
435435   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);
437437}
438438
439439
src/mame/drivers/olibochu.c
r1591r1592
363363static INTERRUPT_GEN( olibochu_interrupt )
364364{
365365   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 */
367367   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 */
369369}
370370
371371static MACHINE_DRIVER_START( olibochu )
src/mame/drivers/ultratnk.c
r1591r1592
5454
5555   /* NMI and watchdog are disabled during service mode */
5656
57   watchdog_enable(readinputport(0) & 0x40);
57   watchdog_enable(machine, readinputport(0) & 0x40);
5858
5959   if (readinputport(0) & 0x40)
6060   {
61      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
61      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
6262   }
6363
6464   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, nmi_callback);
src/mame/drivers/m90.c
r1591r1592
2222  selection moves too fast with the clock set at 16 MHz. It's still fast at
2323  8 MHz, but at least it's usable.
2424
25- Probably all the encrypted games use a nec V35+ cpu: for gussun and risky challenge
25- Probably all games use a nec V35+ cpu: for gussun and risky challenge
2626  we need a proper V35+ core for the use of the 0x63 instruction (brkn, to call a unencrypted
2727  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
2928
3029*****************************************************************************/
3130
r1591r1592
646645
647646static INTERRUPT_GEN( m90_interrupt )
648647{
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);
650649}
651650
652651static INTERRUPT_GEN( bomblord_interrupt )
653652{
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);
655654}
656655
657656
r1591r1592
11701169   irem_cpu_decrypt(0,gussun_decryption_table);
11711170}
11721171
1172static DRIVER_INIT( gussun )
1173{
1174   m90_game_kludge=2;
1175   irem_cpu_decrypt(0,gussun_decryption_table);
1176}
1177
11731178static DRIVER_INIT( matchit2 )
11741179{
11751180   m90_game_kludge=0;
r1591r1592
12081213GAME( 1992, bomblord, bbmanw,   bomblord, bbmanw,   bomblord, ROT0, "bootleg", "Bomber Lord (bootleg)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL | GAME_NOT_WORKING )
12091214GAME( 1992, quizf1,   0,        quizf1,   quizf1,   quizf1,   ROT0, "Irem", "Quiz F-1 1,2finish", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
12101215GAME( 1993, riskchal, 0,        m90,      riskchal, riskchal, ROT0, "Irem", "Risky Challenge", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1211GAME( 1993, gussun,   riskchal, m90,      riskchal, riskchal, ROT0, "Irem", "Gussun Oyoyo (Japan)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
1216GAME( 1993, gussun,   riskchal, m90,      riskchal, gussun,  ROT0, "Irem", "Gussun Oyoyo (Japan)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
12121217GAME( 1993, matchit2, 0,        quizf1,   matchit2, matchit2, ROT0, "Tamtex", "Match It II", GAME_NO_COCKTAIL )
12131218GAME( 1993, shisen2,  matchit2, quizf1,   shisen2,  matchit2, ROT0, "Tamtex", "Shisensho II", GAME_NO_COCKTAIL )
src/mame/drivers/tugboat.c
r1591r1592
167167
168168static TIMER_CALLBACK( interrupt_gen )
169169{
170   cpunum_set_input_line(0, 0, HOLD_LINE);
170   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
171171   timer_set(video_screen_get_frame_period(0), NULL, 0, interrupt_gen);
172172}
173173
src/mame/drivers/gunbustr.c
r1591r1592
6464
6565static TIMER_CALLBACK( gunbustr_interrupt5 )
6666{
67   cpunum_set_input_line(0,5,HOLD_LINE);
67   cpunum_set_input_line(machine, 0,5,HOLD_LINE);
6868}
6969
7070static INTERRUPT_GEN( gunbustr_interrupt )
7171{
7272   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);
7474}
7575
7676static WRITE32_HANDLER( gunbustr_palette_w )
src/mame/drivers/scotrsht.c
r1591r1592
3131static INTERRUPT_GEN( scotrsht_interrupt )
3232{
3333   if (irq_enable)
34      cpunum_set_input_line(0, 0, HOLD_LINE);
34      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
3535}
3636
3737static WRITE8_HANDLER( scotrsht_soundlatch_w )
3838{
3939   soundlatch_w(0,data);
40   cpunum_set_input_line(1, 0, HOLD_LINE);
40   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
4141}
4242
4343static ADDRESS_MAP_START( scotrsht_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/taito_z.c
r1591r1592
823823   /* bit 0 enables cpu B */
824824   /* however this fails when recovering from a save state
825825       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);
827827
828828}
829829
r1591r1592
832832   /* bit 0 enables cpu B */
833833   /* however this fails when recovering from a save state
834834       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);
836836
837837}
838838
r1591r1592
874874
875875static TIMER_CALLBACK( taitoz_interrupt6 )
876876{
877   cpunum_set_input_line(0,6,HOLD_LINE);
877   cpunum_set_input_line(machine, 0,6,HOLD_LINE);
878878}
879879
880880/* 68000 B */
r1591r1592
882882#if 0
883883static TIMER_CALLBACK( taitoz_cpub_interrupt5 )
884884{
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 */
886886}
887887#endif
888888
889889static TIMER_CALLBACK( taitoz_sg_cpub_interrupt5 )
890890{
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 */
892892}
893893
894894#if 0
895895static TIMER_CALLBACK( taitoz_cpub_interrupt6 )
896896{
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 */
898898}
899899#endif
900900
r1591r1592
912912
913913   if (sci_int6)
914914      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);
916916}
917917
918918/* Double Axle seems to keep only 1 sprite frame in sprite ram,
r1591r1592
928928   if (dblaxle_int6)
929929      timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, taitoz_interrupt6);
930930
931   cpunum_set_input_line(0, 4, HOLD_LINE);
931   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
932932}
933933
934934static INTERRUPT_GEN( dblaxle_cpub_interrupt )
935935{
936936   // Unsure how many int6's per frame
937937   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);
939939}
940940
941941
r1591r1592
15581558   AM_RANGE(0x110000, 0x113fff) AM_READ(sharedram_r)
15591559   AM_RANGE(0x400000, 0x40000f) AM_READ(TC0220IOC_halfword_r)
15601560   AM_RANGE(0x800000, 0x800007) AM_READ(bshark_stick_r)
1561   AM_RANGE(0xa00000, 0xa01fff) AM_READ(paletteram16_word_r)   /* palette */
1561   AM_RANGE(0xa00000, 0xa01fff) AM_READ(MRA16_RAM)   /* palette */
15621562   AM_RANGE(0xc00000, 0xc00fff) AM_READ(MRA16_RAM)   /* spriteram */
15631563   AM_RANGE(0xd00000, 0xd0ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
15641564   AM_RANGE(0xd20000, 0xd2000f) AM_READ(TC0100SCN_ctrl_word_0_r)
r1591r1592
16131613   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0220IOC_halfword_r)
16141614   AM_RANGE(0x200010, 0x20001f) AM_READ(sci_steer_input_r)
16151615   AM_RANGE(0x420000, 0x420003) AM_READ(taitoz_sound_r)
1616   AM_RANGE(0x800000, 0x801fff) AM_READ(paletteram16_word_r)
1616   AM_RANGE(0x800000, 0x801fff) AM_READ(MRA16_RAM)
16171617   AM_RANGE(0xa00000, 0xa0ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
16181618   AM_RANGE(0xa20000, 0xa2000f) AM_READ(TC0100SCN_ctrl_word_0_r)
16191619   AM_RANGE(0xc00000, 0xc03fff) AM_READ(MRA16_RAM)   /* spriteram */   // Raine draws only 0x1000
r1591r1592
17961796   AM_RANGE(0x400000, 0x40000f) AM_READ(TC0510NIO_halfword_wordswap_r)
17971797   AM_RANGE(0x400010, 0x40001f) AM_READ(dblaxle_steer_input_r)
17981798   AM_RANGE(0x620000, 0x620003) AM_READ(taitoz_sound_r)
1799   AM_RANGE(0x800000, 0x801fff) AM_READ(paletteram16_word_r)   /* palette */
1799   AM_RANGE(0x800000, 0x801fff) AM_READ(MRA16_RAM)   /* palette */
18001800   AM_RANGE(0xa00000, 0xa0ffff) AM_READ(TC0480SCP_word_r)     /* tilemaps */
18011801   AM_RANGE(0xa30000, 0xa3002f) AM_READ(TC0480SCP_ctrl_word_r)
18021802   AM_RANGE(0xc00000, 0xc03fff) AM_READ(MRA16_RAM)   /* spriteram */
r1591r1592
18421842   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0510NIO_halfword_wordswap_r)
18431843   AM_RANGE(0x300010, 0x30001f) AM_READ(dblaxle_steer_input_r)
18441844   AM_RANGE(0x520000, 0x520003) AM_READ(taitoz_sound_r)
1845   AM_RANGE(0x700000, 0x701fff) AM_READ(paletteram16_word_r)   /* palette */
1845   AM_RANGE(0x700000, 0x701fff) AM_READ(MRA16_RAM)   /* palette */
18461846   AM_RANGE(0x900000, 0x90ffff) AM_READ(TC0480SCP_word_r)     /* tilemaps */
18471847   AM_RANGE(0x930000, 0x93002f) AM_READ(TC0480SCP_ctrl_word_r)
18481848   AM_RANGE(0xb00000, 0xb03fff) AM_READ(MRA16_RAM)   /* spriteram */
r1591r1592
27422742/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
27432743static void irqhandler(int irq)   // assumes Z80 sandwiched between 68Ks
27442744{
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);
27462746}
27472747
27482748/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
27492749static void irqhandlerb(int irq)
27502750{
27512751   // 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);
27532753}
27542754
27552755static const struct YM2610interface ym2610_interface =
src/mame/drivers/phoenix.c
r1591r1592
4444#include "phoenix.h"
4545
4646
47static 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 */
52ADDRESS_MAP_END
53
54static 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 */
59ADDRESS_MAP_END
60
61static 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 */
67ADDRESS_MAP_END
68
69
70static 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 */
47static 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 */
7350   AM_RANGE(0x5000, 0x53ff) AM_WRITE(phoenix_videoreg_w)
7451   AM_RANGE(0x5800, 0x5bff) AM_WRITE(phoenix_scroll_w)
7552   AM_RANGE(0x6000, 0x63ff) AM_WRITE(phoenix_sound_control_a_w)
7653   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 */
7756ADDRESS_MAP_END
7857
79static 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 */
58static 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 */
8261   AM_RANGE(0x5000, 0x53ff) AM_WRITE(pleiads_videoreg_w)
8362   AM_RANGE(0x5800, 0x5bff) AM_WRITE(phoenix_scroll_w)
8463   AM_RANGE(0x6000, 0x63ff) AM_WRITE(pleiads_sound_control_a_w)
8564   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 */
8667ADDRESS_MAP_END
8768
88static 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 */
69static 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 */
9172   AM_RANGE(0x5000, 0x53ff) AM_WRITE(phoenix_videoreg_w)
9273   AM_RANGE(0x5800, 0x5bff) AM_WRITE(phoenix_scroll_w)
9374   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 */
9578ADDRESS_MAP_END
9679
9780
9881
9982static INPUT_PORTS_START( phoenix )
100   PORT_START      /* IN0 */
83   PORT_START_TAG("IN0")      /* IN0 */
10184   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
10285   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
10386   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
r1591r1592
10790   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
10891   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
10992
110   PORT_START      /* IN1 */
93   PORT_START_TAG("IN1")      /* IN1 */
11194   PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL )   /* comes from IN0 0-2 */
11295   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
11396   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
r1591r1592
11598   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL
11699   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2  ) PORT_COCKTAIL
117100
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" )
120103   PORT_DIPSETTING(   0x00, "3" )
121104   PORT_DIPSETTING(   0x01, "4" )
122105   PORT_DIPSETTING(   0x02, "5" )
123106   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" )
125108   PORT_DIPSETTING(   0x00, "3K 30K" )
126109   PORT_DIPSETTING(   0x04, "4K 40K" )
127110   PORT_DIPSETTING(   0x08, "5K 50K" )
128111   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" )
130113   PORT_DIPSETTING(   0x10, DEF_STR( 2C_1C ) )
131114   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" )
133116   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
134117   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" )
136119   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
137120   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
138121   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
139122
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" )
142125   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
143126   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
144127INPUT_PORTS_END
145128
146129static 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 )
156131
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")
176133   /* 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" )
178135   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
179136   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 ) )
192137INPUT_PORTS_END
193138
194139static 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 )
204141
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 ) )
142PORT_MODIFY("DSW0")
143   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:5" )
225144   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
226145   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 ) )
239146INPUT_PORTS_END
240147
241148static 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 )
251150
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" )
272153   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
273154   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" )
275156   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
276157   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" )
278159   PORT_DIPSETTING(   0x40, "A - 2C/1C B - 1C/3C" )
279160   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 ) )
286161INPUT_PORTS_END
287162
288163static 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 )
298165
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" )
309168   PORT_DIPSETTING(   0x00, "2" )
310169   PORT_DIPSETTING(   0x01, "3" )
311170   PORT_DIPSETTING(   0x02, "4" )
312171   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" )
314173   PORT_DIPSETTING(   0x00, "Every 6000" )
315174   PORT_DIPSETTING(   0x08, "Every 10000" )
316175   PORT_DIPSETTING(   0x04, "Every 14000" )
317176   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" )
319178   PORT_DIPSETTING(   0x00, "Slowest" )
320179   PORT_DIPSETTING(   0x10, "Slower" )
321180   PORT_DIPSETTING(   0x20, "Slow" )
r1591r1592
324183   PORT_DIPSETTING(   0x50, "Fast" )
325184   PORT_DIPSETTING(   0x60, "Faster" )
326185   PORT_DIPSETTING(   0x70, "Fastest" )
327   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
328186
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")
335188   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_B ) )
336189   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
337190   PORT_DIPSETTING(    0x09, DEF_STR( 2C_2C ) )
r1591r1592
369222INPUT_PORTS_END
370223
371224static 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 )
381226
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" )
392229   PORT_DIPSETTING(   0x00, "2" )
393230   PORT_DIPSETTING(   0x01, "3" )
394231   PORT_DIPSETTING(   0x02, "4" )
395232   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" )
397234   PORT_DIPSETTING(   0x00, "3K 30K" )
398235   PORT_DIPSETTING(   0x04, "4K 40K" )
399236   PORT_DIPSETTING(   0x08, "5K 50K" )
400237   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" )
402239   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
403240   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" )
405242   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
406243   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" )
408245   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
409246   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 ) )
416247INPUT_PORTS_END
417248
418249
419250static 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 )
429252
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" )
440255   PORT_DIPSETTING(   0x00, "1" )
441256   PORT_DIPSETTING(   0x01, "2" )
442257   PORT_DIPSETTING(   0x02, "3" )
443258   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" )
445260   PORT_DIPSETTING(   0x00, "3K 30K" )
446261   PORT_DIPSETTING(   0x04, "4K 40K" )
447262   PORT_DIPSETTING(   0x08, "5K 50K" )
448263   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" )
450265   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
451266   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" )
453268   PORT_DIPSETTING(   0x00, "1C/1C & 1C/2C" )
454269   PORT_DIPSETTING(   0x20, "2C/3C & 1C/3C" )
455270   PORT_DIPSETTING(   0x40, "1C/2C & 1C/4C" )
456271   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 ) )
463272INPUT_PORTS_END
464273
465274
466275static 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 )
476277
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 */
484280
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" )
503283   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
504284   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 ) )
511285INPUT_PORTS_END
512286
513287static 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 )
523289
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" )
539292   PORT_DIPSETTING(   0x00, "7K 70K" )
540293   PORT_DIPSETTING(   0x04, "8K 80K" )
541294   PORT_DIPSETTING(   0x08, "9K 90K" )
542295  /*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 ) )
558296INPUT_PORTS_END
559297
560298static 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 )
570300
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 ) )
605305INPUT_PORTS_END
606306
607307static INPUT_PORTS_START( survival )
608   PORT_START      /* IN0 */
308   PORT_START_TAG("IN0")      /* IN0 */
609309   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
610310   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
611311   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
r1591r1592
615315   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
616316   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
617317
618   PORT_START      /* IN1 */
318   PORT_START_TAG("IN1")      /* IN1 */
619319   PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL )   /* comes from IN0 0-2 */
620320   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
621321   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
r1591r1592
623323   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP  ) PORT_COCKTAIL
624324   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_COCKTAIL
625325
626    PORT_START
326    PORT_START_TAG("DSW0")
627327   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
628328   PORT_DIPSETTING(   0x03, "2" )
629329   PORT_DIPSETTING(   0x02, "3" )
r1591r1592
644344   PORT_DIPSETTING(   0x60, DEF_STR( 1C_1C ) )
645345   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
646346
647   PORT_START      /* fake port for non-memory mapped dip switch */
347   PORT_START_TAG("CAB")      /* fake port for non-memory mapped dip switch */
648348   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
649349   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
650350   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
r1591r1592
664364};
665365
666366static 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 )
669369GFXDECODE_END
670370
671371static 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 )
674374GFXDECODE_END
675375
676376
r1591r1592
721421
722422   /* basic machine hardware */
723423   MDRV_CPU_ADD_TAG("main", 8085A, CPU_CLOCK)   /* 2.75 MHz */
724   MDRV_CPU_PROGRAM_MAP(phoenix_readmem,phoenix_writemem)
424   MDRV_CPU_PROGRAM_MAP(phoenix_memory_map, 0)
725425
726426   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
727427
r1591r1592
761461   /* basic machine hardware */
762462   MDRV_IMPORT_FROM(phoenix)
763463   MDRV_CPU_MODIFY("main")
764   MDRV_CPU_PROGRAM_MAP(pleiads_readmem,pleiads_writemem)
464   MDRV_CPU_PROGRAM_MAP(pleiads_memory_map, 0)
765465
766466   /* video hardware */
767467   MDRV_GFXDECODE(pleiads)
768   MDRV_COLORTABLE_LENGTH(32*4+32*4)
769468
770469   MDRV_PALETTE_INIT(pleiads)
771   MDRV_VIDEO_START(pleiads)
772470
773471   /* sound hardware */
774472   MDRV_SOUND_REPLACE("tms", TMS36XX, 247)
r1591r1592
788486static MACHINE_DRIVER_START( survival )
789487
790488   /* 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)
793491
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)
796496
497   MDRV_MACHINE_RESET(phoenix)
498
797499   /* video hardware */
798500   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
799501   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)
802502   MDRV_GFXDECODE(phoenix)
803503   MDRV_PALETTE_LENGTH(256)
804   MDRV_COLORTABLE_LENGTH(16*4+16*4)
805504
806   MDRV_PALETTE_INIT(phoenix)
505   MDRV_PALETTE_INIT(survival)
807506   MDRV_VIDEO_START(phoenix)
808507   MDRV_VIDEO_UPDATE(phoenix)
809508
810509   /* sound hardware */
811510   MDRV_SPEAKER_STANDARD_MONO("mono")
812511
512   /* FIXME: check clock */
813513   MDRV_SOUND_ADD(AY8910, 11000000/4)
814514   MDRV_SOUND_CONFIG(survival_ay8910_interface)
815515   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
r1591r1592
821521
822522   /* basic machine hardware */
823523   MDRV_IMPORT_FROM(phoenix)
524   /* FIXME: Verify clock. This is most likely 11MHz/2 */
824525   MDRV_CPU_REPLACE("main", Z80, 11000000/4)   /* 2.75 MHz??? */
825526MACHINE_DRIVER_END
826527
r1591r1592
13141015GAME( 1981, phoenixc, phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg?", "Phoenix (IRECSA, G.G.I Corp)", GAME_SUPPORTS_SAVE )
13151016
13161017
1317GAME( 1981, condor,   phoenix, condor,   condor,   condor,   ROT90, "Sidam (bootleg)",      "Condor (bootleg of Phoenix)", 0 )
1018GAME( 1981, condor,   phoenix, condor,   condor,   condor,   ROT90, "Sidam (bootleg)",      "Condor (bootleg of Phoenix)", GAME_SUPPORTS_SAVE )
13181019// the following 2 were common bootlegs in england & france respectively
13191020GAME( 1980, falcon,   phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg",              "Falcon (bootleg of Phoenix) (set 1)", GAME_SUPPORTS_SAVE )
13201021GAME( 1980, vautour,  phoenix, phoenix,  phoenixt, 0,        ROT90, "Jeutel (bootleg)",     "Vautour (bootleg of Phoenix) (set 1)", GAME_SUPPORTS_SAVE )
1321GAME( 1980, vautour2, phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Vautour (bootleg of Phoenix) (set 2)", 0 )
1022GAME( 1980, vautour2, phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Vautour (bootleg of Phoenix) (set 2)", GAME_SUPPORTS_SAVE )
13221023// fenix is an italian bootleg based on vautour
1323GAME( 1980, fenix,    phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Fenix (bootleg of Phoenix)", GAME_NOT_WORKING )
1324GAME( 1980, griffon,  phoenix, condor,   condor,   condor,   ROT90, "Videotron (bootleg)",  "Griffon (bootleg of Phoenix)", 0 )
1325GAME( 1980, falcona,  phoenix, condor,   falcona,  0,        ROT90, "bootleg",              "Falcon (bootleg of Phoenix) (set 2)", 0 )
1024GAME( 1980, fenix,    phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Fenix (bootleg of Phoenix)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1025GAME( 1980, griffon,  phoenix, condor,   condor,   condor,   ROT90, "Videotron (bootleg)",  "Griffon (bootleg of Phoenix)", GAME_SUPPORTS_SAVE )
1026GAME( 1980, falcona,  phoenix, condor,   falcona,  0,        ROT90, "bootleg",              "Falcon (bootleg of Phoenix) (set 2)", GAME_SUPPORTS_SAVE )
13261027// nextfase is a spanish bootleg
1327GAME( 1981, nextfase, phoenix, phoenix,  nextfase, 0,        ROT90, "Petaco S.A. (bootleg)","Next Fase (bootleg of Phoenix)", 0 )
1028GAME( 1981, nextfase, phoenix, phoenix,  nextfase, 0,        ROT90, "Petaco S.A. (bootleg)","Next Fase (bootleg of Phoenix)", GAME_SUPPORTS_SAVE )
13281029
13291030GAME( 1981, pleiads,  0,       pleiads,  pleiads,  0,        ROT90, "Tehkan", "Pleiads (Tehkan)", GAME_IMPERFECT_COLORS )
13301031GAME( 1981, pleiadbl, pleiads, pleiads,  pleiads,  0,        ROT90, "bootleg", "Pleiads (bootleg)", GAME_IMPERFECT_COLORS )
src/mame/drivers/lastfght.c
r1591r1592
451451   switch (cpu_getiloops())
452452   {
453453      case 0:
454         cpunum_set_input_line(0, 0, PULSE_LINE);
454         cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
455455         break;
456456      default:
457457         h8_3002_InterruptRequest(24);
src/mame/drivers/msisaac.c
r1591r1592
6363
6464static TIMER_CALLBACK( nmi_callback )
6565{
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);
6767   else pending_nmi = 1;
6868}
6969
r1591r1592
8383   sound_nmi_enable = 1;
8484   if (pending_nmi)
8585   {
86      cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
86      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
8787      pending_nmi = 0;
8888   }
8989}
src/mame/drivers/superqix.c
r1591r1592
290290
291291static READ8_HANDLER( nmi_ack_r )
292292{
293   cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
293   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
294294   return 0;
295295}
296296
r1591r1592
344344logerror("Z80 sends command %02x\n",param);
345345   from_z80 = param;
346346   from_mcu_pending = 0;
347   cpunum_set_input_line(1, 0, HOLD_LINE);
347   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
348348   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(200));
349349}
350350
r1591r1592
500500ADDRESS_MAP_END
501501
502502static ADDRESS_MAP_START( pbillian_port_map, ADDRESS_SPACE_IO, 8 )
503   AM_RANGE(0x0000, 0x01ff) AM_READWRITE(paletteram_r, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
503   AM_RANGE(0x0000, 0x01ff) AM_READWRITE(MRA8_RAM, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
504504   AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r)
505505   AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w)
506506   AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w)
r1591r1592
514514ADDRESS_MAP_END
515515
516516static ADDRESS_MAP_START( hotsmash_port_map, ADDRESS_SPACE_IO, 8 )
517   AM_RANGE(0x0000, 0x01ff) AM_READWRITE(paletteram_r, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
517   AM_RANGE(0x0000, 0x01ff) AM_READWRITE(MRA8_RAM, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
518518   AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r)
519519   AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w)
520520   AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w)
r1591r1592
528528ADDRESS_MAP_END
529529
530530static ADDRESS_MAP_START( sqix_port_map, ADDRESS_SPACE_IO, 8 )
531   AM_RANGE(0x0000, 0x00ff) AM_READWRITE(paletteram_r, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
531   AM_RANGE(0x0000, 0x00ff) AM_READWRITE(MRA8_RAM, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
532532   AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r)
533533   AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w)
534534   AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w)
r1591r1592
543543ADDRESS_MAP_END
544544
545545static ADDRESS_MAP_START( bootleg_port_map, ADDRESS_SPACE_IO, 8 )
546   AM_RANGE(0x0000, 0x00ff) AM_READWRITE(paletteram_r, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
546   AM_RANGE(0x0000, 0x00ff) AM_READWRITE(MRA8_RAM, paletteram_BBGGRRII_w) AM_BASE(&paletteram)
547547   AM_RANGE(0x0401, 0x0401) AM_READ(AY8910_read_port_0_r)
548548   AM_RANGE(0x0402, 0x0402) AM_WRITE(AY8910_write_port_0_w)
549549   AM_RANGE(0x0403, 0x0403) AM_WRITE(AY8910_control_port_0_w)
src/mame/drivers/playch10.c
r1591r1592
717717
718718   /* LS161A, Sheet 1 - bottom left of Z80 */
719719   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 );
721721   }
722722
723723   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);
725725}
726726
727727static const struct NESinterface nes_interface =
src/mame/drivers/cyberbal.c
r1591r1592
3434 *
3535 *************************************/
3636
37static void update_interrupts(void)
37static void update_interrupts(running_machine *machine)
3838{
3939   int newstate1 = 0;
4040   int newstate2 = 0;
r1591r1592
4646      newstate2 |= 1;
4747
4848   if (newstate1)
49      cpunum_set_input_line(0, newstate1, ASSERT_LINE);
49      cpunum_set_input_line(machine, 0, newstate1, ASSERT_LINE);
5050   else
51      cpunum_set_input_line(0, 7, CLEAR_LINE);
51      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
5252
5353   if (newstate2)
54      cpunum_set_input_line(2, newstate2, ASSERT_LINE);
54      cpunum_set_input_line(machine, 2, newstate2, ASSERT_LINE);
5555   else
56      cpunum_set_input_line(2, 7, CLEAR_LINE);
56      cpunum_set_input_line(machine, 2, 7, CLEAR_LINE);
5757
5858   /* check for screen swapping */
5959   temp = readinputport(2);
r1591r1592
7373   cyberbal_sound_reset();
7474
7575   /* 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);
7777
7878   /* make sure we're pointing to the right screen by default */
7979   cyberbal_set_screen(0);
8080}
8181
8282
83static void cyberb2p_update_interrupts(void)
83static void cyberb2p_update_interrupts(running_machine *machine)
8484{
8585   int newstate = 0;
8686
r1591r1592
9090      newstate |= 3;
9191
9292   if (newstate)
93      cpunum_set_input_line(0, newstate, ASSERT_LINE);
93      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
9494   else
95      cpunum_set_input_line(0, 7, CLEAR_LINE);
95      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
9696}
9797
9898
r1591r1592
148148
149149static WRITE16_HANDLER( p2_reset_w )
150150{
151   cpunum_set_input_line(2, INPUT_LINE_RESET, CLEAR_LINE);
151   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
152152}
153153
154154
src/mame/drivers/lockon.c
r1591r1592
279279static INTERRUPT_GEN( lockon_irq )
280280{
281281        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);
283283
284284          // 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);
286286}
287287
288288/*
r1591r1592
308308      v30_obj_addr = (data & 0x18) >> 3;
309309
310310      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);
312312      else
313         cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE);
313         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
314314
315315      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);
317317      else
318         cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE);
318         cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
319319
320320      /* Suspend the Z80 when writing to shared RAM */
321321      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);
323323      else
324         cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE);
324         cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, ASSERT_LINE);
325325   }
326326}
327327
r1591r1592
564564
565565static void YM2203_irq(int irq)
566566{
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 );
568568}
569569
570570static WRITE8_HANDLER(YM2203_out_b)
src/mame/drivers/mappy.c
r1591r1592
704704      case 0x00:   /* INT ON 2 */
705705         cpu_interrupt_enable(1,bit);
706706         if (!bit)
707            cpunum_set_input_line(1, 0, CLEAR_LINE);
707            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
708708         break;
709709
710710      case 0x02:   /* INT ON */
711711         cpu_interrupt_enable(0,bit);
712712         if (!bit)
713            cpunum_set_input_line(0, 0, CLEAR_LINE);
713            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
714714         break;
715715
716716      case 0x04:   /* n.c. */
r1591r1592
726726         break;
727727
728728      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);
730730         break;
731731
732732      case 0x0c:   /* n.c. */
r1591r1592
746746      case 0x00:
747747         cpu_interrupt_enable(1,bit);
748748         if (!bit)
749            cpunum_set_input_line(1, 0, CLEAR_LINE);
749            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
750750         break;
751751
752752      case 0x02:
753753         cpu_interrupt_enable(0,bit);
754754         if (!bit)
755            cpunum_set_input_line(0, 0, CLEAR_LINE);
755            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
756756         break;
757757
758758      case 0x04:
759759         cpu_interrupt_enable(2,bit);
760760         if (!bit)
761            cpunum_set_input_line(2, 0, CLEAR_LINE);
761            cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
762762         break;
763763
764764      case 0x06:
r1591r1592
771771         break;
772772
773773      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);
775775         break;
776776
777777      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);
779779         break;
780780
781781      case 0x0e:
r1591r1592
792792      case 0x00:   /* INT ON 2 */
793793         cpu_interrupt_enable(1,bit);
794794         if (!bit)
795            cpunum_set_input_line(1, 0, CLEAR_LINE);
795            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
796796         break;
797797
798798      case 0x02:   /* INT ON */
799799         cpu_interrupt_enable(0,bit);
800800         if (!bit)
801            cpunum_set_input_line(0, 0, CLEAR_LINE);
801            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
802802         break;
803803
804804      case 0x04:   /* FLIP */
r1591r1592
815815         break;
816816
817817      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);
819819         break;
820820
821821      case 0x0c:   /* n.c. */
r1591r1592
856856static INTERRUPT_GEN( mappy_interrupt_1 )
857857{
858858   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);
860860
861861   namcoio_set_irq_line(0,PULSE_LINE);
862862   namcoio_set_irq_line(1,PULSE_LINE);
r1591r1592
21322132      */
21332133   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0002, 0x0002, 0, 0, grobda_DAC_w );
21342134
2135   driver_init_58_56(machine);
2135   DRIVER_INIT_CALL(58_56);
21362136}
21372137
21382138static DRIVER_INIT( digdug2 )
21392139{
21402140   /* appears to not use the watchdog */
21412141   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, MWA8_NOP);
2142   driver_init_58_56(machine);
2142   DRIVER_INIT_CALL(58_56);
21432143}
21442144
21452145
src/mame/drivers/rastan.c
r1591r1592
360360/* handler called by the YM2151 emulator when the internal timers cause an IRQ */
361361static void irqhandler(int irq)
362362{
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);
364364}
365365
366366static const struct YM2151interface ym2151_interface =
src/mame/drivers/pntnpuzl.c
r1591r1592
412412static INTERRUPT_GEN( pntnpuzl_irq )
413413{
414414   if (readinputport(0) & 0x02)   /* coin */
415      cpunum_set_input_line(0, 1, PULSE_LINE);
415      cpunum_set_input_line(machine, 0, 1, PULSE_LINE);
416416   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);
418418   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);
420420}
421421
422422static INPUT_PORTS_START( pntnpuzl )
src/mame/drivers/gijoe.c
r1591r1592
159159static TIMER_CALLBACK( dmaend_callback )
160160{
161161   if (cur_control2 & 0x0020)
162      cpunum_set_input_line(0, 6, HOLD_LINE);
162      cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
163163}
164164
165165static INTERRUPT_GEN( gijoe_interrupt )
r1591r1592
177177
178178   // trigger V-blank interrupt
179179   if (cur_control2 & 0x0080)
180      cpunum_set_input_line(0, 5, HOLD_LINE);
180      cpunum_set_input_line(machine, 0, 5, HOLD_LINE);
181181}
182182
183183static WRITE16_HANDLER( sound_cmd_w )
r1591r1592
190190
191191static WRITE16_HANDLER( sound_irq_w )
192192{
193   cpunum_set_input_line(1, 0, HOLD_LINE);
193   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
194194}
195195
196196static READ16_HANDLER( sound_status_r )
r1591r1592
200200
201201static void sound_nmi(void)
202202{
203   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
203   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
204204}
205205
206206static MACHINE_START( gijoe )
src/mame/drivers/uapce.c
r1591r1592
4040
4141   if ( diff & 0x40 )
4242   {
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);
4444   }
4545
4646   // bit 3 - enable 752 Hz (D-3) square wave output
r1591r1592
224224
225225static DRIVER_INIT(uapce)
226226{
227   driver_init_pce(machine);
227   DRIVER_INIT_CALL(pce);
228228};
229229
230230GAME( 1989, blazlaz, 0, uapce, uapce, uapce, ROT0, "Hudson Soft", "Blazing Lazers", GAME_IMPERFECT_SOUND )
src/mame/drivers/tigeroad.c
r1591r1592
528528/* handler called by the 2203 emulator when the internal timers cause an IRQ */
529529static void irqhandler(int irq)
530530{
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);
532532}
533533
534534static const struct YM2203interface ym2203_interface =
src/mame/drivers/wilytowr.c
r1591r1592
217217
218218static WRITE8_HANDLER( snd_irq_w )
219219{
220   cpunum_set_input_line(1, 0, PULSE_LINE);
220   cpunum_set_input_line(Machine, 1, 0, PULSE_LINE);
221221}
222222
223223
src/mame/drivers/spaceg.c
r1591r1592
174174static int io9400;
175175static int io9401;
176176
177static VIDEO_UPDATE( spaceg )
178{
179   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
180
181   return 0;
182}
183
184177static PALETTE_INIT( spaceg )
185178{
186179   int i;
r1591r1592
433426   MDRV_PALETTE_LENGTH(16+128-16)
434427   MDRV_PALETTE_INIT( spaceg )
435428   MDRV_VIDEO_START(generic_bitmapped)
436   MDRV_VIDEO_UPDATE( spaceg )
429   MDRV_VIDEO_UPDATE( generic_bitmapped )
437430
438431   /* sound hardware */
439432   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/looping.c
r1591r1592
304304
305305static INTERRUPT_GEN( looping_interrupt )
306306{
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);
308308}
309309
310310
311311static WRITE8_HANDLER( level2_irq_set )
312312{
313313   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);
315315}
316316
317317
318318static WRITE8_HANDLER( main_irq_ack_w )
319319{
320320   if (data == 0)
321      cpunum_set_input_line(0, 0, CLEAR_LINE);
321      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
322322}
323323
324324
325325static WRITE8_HANDLER( looping_souint_clr )
326326{
327327   if (data == 0)
328      cpunum_set_input_line(1, 0, CLEAR_LINE);
328      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
329329}
330330
331331
332332static void looping_spcint(int state)
333333{
334   cpunum_set_input_line_and_vector(1, 0, state, 6);
334   cpunum_set_input_line_and_vector(Machine, 1, 0, state, 6);
335335}
336336
337337
338338static WRITE8_HANDLER( looping_soundlatch_w )
339339{
340340   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);
342342}
343343
344344
src/mame/drivers/segas32.c
r1591r1592
396396   v60_irq_timer[1] = timer_alloc(signal_v60_irq_callback, NULL);
397397
398398   /* clear IRQ lines */
399   cpunum_set_input_line(0, 0, CLEAR_LINE);
399   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
400400}
401401
402402
r1591r1592
417417   for (vector = 0; vector < 5; vector++)
418418      if (effirq & (1 << vector))
419419      {
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);
421421         break;
422422      }
423423
424424   /* if we didn't find any, clear the interrupt line */
425425   if (vector == 5)
426      cpunum_set_input_line(0, 0, CLEAR_LINE);
426      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
427427}
428428
429429
r1591r1592
691691      case 0x1c/2:
692692         system32_displayenable[which] = (data & 0x02);
693693         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);
695695         break;
696696   }
697697}
r1591r1592
10361036   for (vector = 0; vector < 3; vector++)
10371037      if (effirq & (1 << vector))
10381038      {
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);
10401040         break;
10411041      }
10421042
10431043   /* if we didn't find any, clear the interrupt line */
10441044   if (vector == 3)
1045      cpunum_set_input_line(1, 0, CLEAR_LINE);
1045      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
10461046}
10471047
10481048
src/mame/drivers/badlands.c
r1591r1592
118118 *
119119 *************************************/
120120
121static void update_interrupts(void)
121static void update_interrupts(running_machine *machine)
122122{
123123   int newstate = 0;
124124
r1591r1592
128128      newstate = 2;
129129
130130   if (newstate)
131      cpunum_set_input_line(0, newstate, ASSERT_LINE);
131      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
132132   else
133      cpunum_set_input_line(0, 7, CLEAR_LINE);
133      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
134134}
135135
136136
src/mame/drivers/astinvad.c
r1591r1592
174174
175175static TIMER_CALLBACK( kamikaze_int_off )
176176{
177   cpunum_set_input_line(0, 0, CLEAR_LINE);
177   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
178178}
179179
180180
181181static TIMER_CALLBACK( kamizake_int_gen )
182182{
183183   /* 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);
185185   param ^= 128;
186186   timer_adjust(int_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_never);
187187
r1591r1592
201201static INTERRUPT_GEN( spaceint_interrupt )
202202{
203203   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);
205205
206   cpunum_set_input_line(0, 0, HOLD_LINE);
206   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
207207}
208208
209209
src/mame/drivers/psikyosh.c
r1591r1592
413413
414414static INTERRUPT_GEN(psikyosh_interrupt)
415415{
416   cpunum_set_input_line(0, 4, HOLD_LINE);
416   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
417417}
418418
419419static READ32_HANDLER(io32_r)
r1591r1592
582582static void irqhandler(int linestate)
583583{
584584   if (linestate)
585      cpunum_set_input_line(0, 12, ASSERT_LINE);
585      cpunum_set_input_line(Machine, 0, 12, ASSERT_LINE);
586586   else
587      cpunum_set_input_line(0, 12, CLEAR_LINE);
587      cpunum_set_input_line(Machine, 0, 12, CLEAR_LINE);
588588}
589589
590590static const struct YMF278B_interface ymf278b_interface =
src/mame/drivers/boogwing.c
r1591r1592
5151    Driver by Bryan McPhail and David Haywood.
5252
5353    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)
5875*/
5976
6077#include "driver.h"
r1591r1592
267284
268285static void sound_irq(int state)
269286{
270   cpunum_set_input_line(1,1,state); /* IRQ 2 */
287   cpunum_set_input_line(Machine, 1,1,state); /* IRQ 2 */
271288}
272289
273290static WRITE8_HANDLER( sound_bankswitch_w )
src/mame/drivers/supertnk.c
r1591r1592
152152static INTERRUPT_GEN( supertnk_interrupt )
153153{
154154   /* 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);
156156}
157157
158158
159159static WRITE8_HANDLER( supertnk_interrupt_ack_w )
160160{
161   cpunum_set_input_line(0, 0, CLEAR_LINE);
161   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
162162}
163163
164164
src/mame/drivers/darkhors.c
r1591r1592
590590{
591591   switch (cpu_getiloops())
592592   {
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;
596596   }
597597}
598598
src/mame/drivers/bishjan.c
r1591r1592
430430   switch (cpu_getiloops())
431431   {
432432      case 0:
433         cpunum_set_input_line(0, 0, PULSE_LINE);
433         cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
434434         break;
435435      default:
436436         h8_3002_InterruptRequest(24);
src/mame/drivers/mpatrol.c
r1591r1592
4141#include "cpu/z80/z80.h"
4242
4343
44#define MASTER_CLOCK      XTAL_18_432MHz
45#define SOUND_CLOCK         XTAL_3_579545MHz
4446
47
48
49READ8_HANDLER( mpatrol_protection_r );
4550WRITE8_HANDLER( mpatrol_scroll_w );
4651WRITE8_HANDLER( mpatrol_bg1xpos_w );
4752WRITE8_HANDLER( mpatrol_bg1ypos_w );
r1591r1592
5863
5964
6065
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. */
63static READ8_HANDLER( mpatrol_protection_r )
66static CUSTOM_INPUT( coin_mode )
6467{
65   return activecpu_get_reg(Z80_DE) & 0xff;
66}
67
68
69static READ8_HANDLER( mpatrol_input_port_3_r )
70{
71   int ret = input_port_3_r(0);
72
7368   /* 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);
8671}
8772
8873
89static 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)
99ADDRESS_MAP_END
10074
101static 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)
109ADDRESS_MAP_END
75/*************************************
76 *
77 *  Memory maps
78 *
79 *************************************/
11080
111static 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)
81static 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
12195ADDRESS_MAP_END
12296
123static 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
98static 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)
127102   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?
131109ADDRESS_MAP_END
132110
133111
134
135static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
112static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 )
136113   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)
143120ADDRESS_MAP_END
144121
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
174122
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 ) )
228123
124/*************************************
125 *
126 *  Port definitions
127 *
128 *************************************/
129
229130static INPUT_PORTS_START( mpatrol )
230MPATROL_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 )
231138
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
232156   PORT_START_TAG("DSW0")
233157   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
234158   PORT_DIPSETTING(    0x00, "1" )
r1591r1592
240164   PORT_DIPSETTING(    0x08, "20000 40000 60000" )
241165   PORT_DIPSETTING(    0x04, "10000" )
242166   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 */
244169
245MPATROL_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 ) )
246223INPUT_PORTS_END
247224
248/* Identical to mpatrol, the only difference is the number of lives */
225
249226static INPUT_PORTS_START( mpatrolw )
250MPATROL_COMMON
227   PORT_INCLUDE(mpatrol)
251228
252   PORT_START_TAG("DSW0")
229   PORT_MODIFY("DSW0")
253230   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
254231   PORT_DIPSETTING(    0x00, "2" )
255232   PORT_DIPSETTING(    0x01, "3" )
256233   PORT_DIPSETTING(    0x02, "4" )
257234   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
265MPATROL_COMMON2
266235INPUT_PORTS_END
267236
268237
269238static 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)
280240
281   PORT_START_TAG("IN1")\
241   PORT_MODIFY("IN1")
282242   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
283243   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
284244   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
285245   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
286246   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 )
290247
291   PORT_START_TAG("IN2")
248   PORT_MODIFY("IN2")
292249   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
293250   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
294251   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
295252   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
300253
301   PORT_START_TAG("DSW0")
254   PORT_MODIFY("DSW0")
302255   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
303256   PORT_DIPSETTING(    0x00, "2" )
304257   PORT_DIPSETTING(    0x01, "3" )
305258   PORT_DIPSETTING(    0x02, "4" )
306259   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
314MPATROL_COMMON2
315260INPUT_PORTS_END
316261
262
263
264/*************************************
265 *
266 *  Graphics layouts
267 *
268 *************************************/
269
317270static const gfx_layout charlayout =
318271{
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) },
323276   { STEP8(0,1) },
324277   { STEP8(0,8) },
325   8*8     /* every char takes 8 consecutive bytes */
278   8*8
326279};
280
327281static const gfx_layout spritelayout =
328282{
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) },
333287   { STEP8(0,1), STEP8(16*8,1) },
334288   { STEP16(0,8) },
335   32*8    /* every sprite takes 32 consecutive bytes */
289   32*8
336290};
337291
338292static const UINT32 bgcharlayout_xoffset[256] =
339293{
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)
372310};
373311
374312static const UINT32 bgcharlayout_yoffset[64] =
375313{
376   STEP32(0x0000,0x200),
377   STEP32(0x4000,0x200)
314   STEP32(0x0000,0x200), STEP32(0x4000,0x200)
378315};
379316
380317static const gfx_layout bgcharlayout =
r1591r1592
391328};
392329
393330
394
395331static GFXDECODE_START( mpatrol )
396332   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,                0, 128 )
397333   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,          128*4,  16 )
r1591r1592
402338
403339
404340
341/*************************************
342 *
343 *  Machine drivers
344 *
345 *************************************/
346
405347static MACHINE_DRIVER_START( mpatrol )
406348
407349   /* 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)
411353   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
412354
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
418355   /* video hardware */
419356   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)
423357   MDRV_GFXDECODE(mpatrol)
424358   MDRV_PALETTE_LENGTH(512+32+32)
425359   MDRV_COLORTABLE_LENGTH(128*4+16*4+3*4)
426360
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
427365   MDRV_PALETTE_INIT(mpatrol)
428366   MDRV_VIDEO_START(mpatrol)
429367   MDRV_VIDEO_UPDATE(mpatrol)
r1591r1592
434372
435373
436374static MACHINE_DRIVER_START( alpha1v )
375   MDRV_IMPORT_FROM(mpatrol)
437376
438377   /* 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)
465380MACHINE_DRIVER_END
466381
467382
468383
469/***************************************************************************
384/*************************************
385 *
386 *  ROM definitions
387 *
388 *************************************/
470389
471  Game driver(s)
472
473***************************************************************************/
474
475390ROM_START( mpatrol )
476391   ROM_REGION( 0x10000, REGION_CPU1, 0 )
477392   ROM_LOAD( "mpa-1.3m",      0x0000, 0x1000, CRC(5873a860) SHA1(8c03726d6e049c3edbc277440184e31679f78258) )
r1591r1592
583498
584499
585500
586GAME( 1982, mpatrol,  0,       mpatrol, mpatrol,  0, ROT0, "Irem", "Moon Patrol", 0 )
587GAME( 1982, mpatrolw, mpatrol, mpatrol, mpatrolw, 0, ROT0, "Irem (Williams license)", "Moon Patrol (Williams)", 0 )
501/*************************************
502 *
503 *  Game drivers
504 *
505 *************************************/
506
507GAME( 1982, mpatrol,  0,       mpatrol, mpatrol,  0, ROT0, "Irem", "Moon Patrol", GAME_SUPPORTS_SAVE )
508GAME( 1982, mpatrolw, mpatrol, mpatrol, mpatrolw, 0, ROT0, "Irem (Williams license)", "Moon Patrol (Williams)", GAME_SUPPORTS_SAVE )
588509GAME( 1988, alpha1v,  0,       alpha1v, alpha1v,  0, ROT0, "Vision Electronics", "Alpha One (Vision Electronics / Kyle Hodgetts)", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/offtwall.c
r1591r1592
3030 *
3131 *************************************/
3232
33static void update_interrupts(void)
33static void update_interrupts(running_machine *machine)
3434{
3535   int newstate = 0;
3636
r1591r1592
4040      newstate = 6;
4141
4242   if (newstate)
43      cpunum_set_input_line(0, newstate, ASSERT_LINE);
43      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4444   else
45      cpunum_set_input_line(0, 7, CLEAR_LINE);
45      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
4646}
4747
4848
r1591r1592
8383   if (ACCESSING_LSB)
8484   {
8585      /* 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);
8787      if (!(data & 0x10)) atarijsa_reset();
8888   }
8989
src/mame/drivers/upscope.c
r1591r1592
9191
9292   else
9393      /* overlay enabled, map Amiga system ROM on 0x000000 */
94      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ROM);
94      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP);
9595}
9696
9797
src/mame/drivers/equites.c
r1591r1592
142142
143143// Common Hardware Start
144144#define EQUITES_ADD_SOUNDBOARD7 \
145   MDRV_CPU_ADD(8085A, XTAL_6_144MHz/2) /* verified on pcb */ \
145   MDRV_CPU_ADD(8085A, XTAL_6_144MHz) /* verified on pcb */ \
146146   /* audio CPU */ \
147147   MDRV_CPU_PROGRAM_MAP(equites_s_readmem, equites_s_writemem) \
148148   MDRV_CPU_IO_MAP(0, equites_s_writeport) \
r1591r1592
255255static INTERRUPT_GEN( equites_interrupt )
256256{
257257   if (cpu_getiloops())
258      cpunum_set_input_line(0, 2, HOLD_LINE);
258      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
259259   else
260      cpunum_set_input_line(0, 1, HOLD_LINE);
260      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
261261}
262262
263263// Splendor Blast Hareware
264264static INTERRUPT_GEN( splndrbt_interrupt )
265265{
266266   if (cpu_getiloops())
267      cpunum_set_input_line(0, 2, HOLD_LINE);
267      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
268268   else
269      cpunum_set_input_line(0, 1, HOLD_LINE);
269      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
270270}
271271
272272/******************************************************************************/
src/mame/drivers/esh.c
r1591r1592
134134static WRITE8_HANDLER(nmi_line_w)
135135{
136136   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);
138138   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);
140140
141141   if (data != 0x00 && data != 0x01)
142142      logerror("NMI line got a weird value!\n");
r1591r1592
267267
268268static TIMER_CALLBACK( irq_stop )
269269{
270   cpunum_set_input_line(0, 0, CLEAR_LINE);
270   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
271271}
272272
273273static INTERRUPT_GEN( vblank_callback_esh )
274274{
275275   // IRQ
276   cpunum_set_input_line(0, 0, ASSERT_LINE);
276   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
277277   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
278278
279279   laserdisc_vsync(discinfo);
src/mame/drivers/neodrvr.c
r1591r1592
66126612
66136613static DRIVER_INIT( fatfury2 )
66146614{
6615   driver_init_neogeo(machine);
6615   DRIVER_INIT_CALL(neogeo);
66166616
66176617   fatfury2_install_protection();
66186618}
66196619
66206620static DRIVER_INIT( mslugx )
66216621{
6622   driver_init_neogeo(machine);
6622   DRIVER_INIT_CALL(neogeo);
66236623   mslugx_install_protection();
66246624}
66256625
r1591r1592
66286628   kof99_decrypt_68k();
66296629   neogeo_fixed_layer_bank_type = 1;
66306630   kof99_neogeo_gfx_decrypt(0x00);
6631   driver_init_neogeo(machine);
6631   DRIVER_INIT_CALL(neogeo);
66326632   kof99_install_protection();
66336633}
66346634
r1591r1592
66376637   garou_decrypt_68k();
66386638   neogeo_fixed_layer_bank_type = 1;
66396639   kof99_neogeo_gfx_decrypt(0x06);
6640   driver_init_neogeo(machine);
6640   DRIVER_INIT_CALL(neogeo);
66416641   garou_install_protection();
66426642}
66436643
r1591r1592
66466646   garouo_decrypt_68k();
66476647   neogeo_fixed_layer_bank_type = 1;
66486648   kof99_neogeo_gfx_decrypt(0x06);
6649   driver_init_neogeo(machine);
6649   DRIVER_INIT_CALL(neogeo);
66506650   garouo_install_protection();
66516651}
66526652
r1591r1592
66546654{
66556655   neogeo_bootleg_sx_decrypt(2);
66566656   neogeo_bootleg_cx_decrypt();
6657   driver_init_neogeo(machine);
6657   DRIVER_INIT_CALL(neogeo);
66586658}
66596659
66606660static DRIVER_INIT( mslug3 )
r1591r1592
66626662   mslug3_decrypt_68k();
66636663   neogeo_fixed_layer_bank_type = 1;
66646664   kof99_neogeo_gfx_decrypt(0xad);
6665   driver_init_neogeo(machine);
6665   DRIVER_INIT_CALL(neogeo);
66666666   mslug3_install_protection();
66676667}
66686668
r1591r1592
66716671   kof2000_decrypt_68k();
66726672   neogeo_fixed_layer_bank_type = 2;
66736673   kof2000_neogeo_gfx_decrypt(0x00);
6674   driver_init_neogeo(machine);
6674   DRIVER_INIT_CALL(neogeo);
66756675   kof2000_install_protection();
66766676}
66776677
66786678static DRIVER_INIT( kof2001 )
66796679{
66806680   kof2000_neogeo_gfx_decrypt(0x1e);
6681   driver_init_neogeo(machine);
6681   DRIVER_INIT_CALL(neogeo);
66826682}
66836683
66846684static DRIVER_INIT( mslug4 )
66856685{
66866686   neogeo_fixed_layer_bank_type = 1; /* USA violent content screen is wrong -- not a bug, confirmed on real hardware! */
66876687   kof2000_neogeo_gfx_decrypt(0x31);
6688   driver_init_neogeo(machine);
6688   DRIVER_INIT_CALL(neogeo);
66896689   neo_pcm2_snk_1999(8);
66906690}
66916691
r1591r1592
66936693{
66946694   neogeo_fixed_layer_bank_type = 1;
66956695   kof99_neogeo_gfx_decrypt(0x00);
6696   driver_init_neogeo(machine);
6696   DRIVER_INIT_CALL(neogeo);
66976697}
66986698
66996699static DRIVER_INIT( ganryu )
67006700{
67016701   neogeo_fixed_layer_bank_type = 1;
67026702   kof99_neogeo_gfx_decrypt(0x07);
6703   driver_init_neogeo(machine);
6703   DRIVER_INIT_CALL(neogeo);
67046704}
67056705
67066706static DRIVER_INIT( s1945p )
67076707{
67086708   neogeo_fixed_layer_bank_type = 1;
67096709   kof99_neogeo_gfx_decrypt(0x05);
6710   driver_init_neogeo(machine);
6710   DRIVER_INIT_CALL(neogeo);
67116711}
67126712
67136713static DRIVER_INIT( preisle2 )
67146714{
67156715   neogeo_fixed_layer_bank_type = 1;
67166716   kof99_neogeo_gfx_decrypt(0x9f);
6717   driver_init_neogeo(machine);
6717   DRIVER_INIT_CALL(neogeo);
67186718}
67196719
67206720static DRIVER_INIT( mslug3n )
67216721{
67226722   neogeo_fixed_layer_bank_type = 1;
67236723   kof99_neogeo_gfx_decrypt(0xad);
6724   driver_init_neogeo(machine);
6724   DRIVER_INIT_CALL(neogeo);
67256725}
67266726
67276727static DRIVER_INIT( kof2000n )
67286728{
67296729   neogeo_fixed_layer_bank_type = 2;
67306730   kof2000_neogeo_gfx_decrypt(0x00);
6731   driver_init_neogeo(machine);
6731   DRIVER_INIT_CALL(neogeo);
67326732}
67336733
67346734static DRIVER_INIT( bangbead )
67356735{
67366736   neogeo_fixed_layer_bank_type = 1;
67376737   kof99_neogeo_gfx_decrypt(0xf8);
6738   driver_init_neogeo(machine);
6738   DRIVER_INIT_CALL(neogeo);
67396739}
67406740
67416741static DRIVER_INIT( nitd )
67426742{
67436743   neogeo_fixed_layer_bank_type = 1;
67446744   kof99_neogeo_gfx_decrypt(0xff);
6745   driver_init_neogeo(machine);
6745   DRIVER_INIT_CALL(neogeo);
67466746}
67476747
67486748static DRIVER_INIT( zupapa )
67496749{
67506750   neogeo_fixed_layer_bank_type = 1;
67516751   kof99_neogeo_gfx_decrypt(0xbd);
6752   driver_init_neogeo(machine);
6752   DRIVER_INIT_CALL(neogeo);
67536753}
67546754
67556755static DRIVER_INIT( sengoku3 )
67566756{
67576757   neogeo_fixed_layer_bank_type = 1;
67586758   kof99_neogeo_gfx_decrypt(0xfe);
6759   driver_init_neogeo(machine);
6759   DRIVER_INIT_CALL(neogeo);
67606760}
67616761
67626762static DRIVER_INIT ( kof98 )
67636763{
67646764   kof98_decrypt_68k();
6765   driver_init_neogeo(machine);
6765   DRIVER_INIT_CALL(neogeo);
67666766   install_kof98_protection();
67676767}
67686768
r1591r1592
67716771   neo_pcm2_snk_1999(16);
67726772   neogeo_fixed_layer_bank_type = 1;
67736773   kof2000_neogeo_gfx_decrypt(0x3f);
6774   driver_init_neogeo(machine);
6774   DRIVER_INIT_CALL(neogeo);
67756775}
67766776
67776777
r1591r1592
67806780   kof2002_decrypt_68k();
67816781   neo_pcm2_swap(0 );
67826782   kof2000_neogeo_gfx_decrypt(0xec);
6783   driver_init_neogeo(machine);
6783   DRIVER_INIT_CALL(neogeo);
67846784}
67856785
67866786static DRIVER_INIT( kf2k2pls )
r1591r1592
67886788   kof2002_decrypt_68k();
67896789   neo_pcm2_swap(0 );
67906790   cmc50_neogeo_gfx_decrypt(0xec);
6791   driver_init_neogeo(machine);
6791   DRIVER_INIT_CALL(neogeo);
67926792}
67936793
67946794static DRIVER_INIT( kf2k2mp )
r1591r1592
67976797   neo_pcm2_swap(0 );
67986798   neogeo_bootleg_sx_decrypt(2);
67996799   cmc50_neogeo_gfx_decrypt(0xec);
6800   driver_init_neogeo(machine);
6800   DRIVER_INIT_CALL(neogeo);
68016801}
68026802
68036803static DRIVER_INIT( kof2km2 )
r1591r1592
68066806   neo_pcm2_swap(0 );
68076807   neogeo_bootleg_sx_decrypt(1);
68086808   cmc50_neogeo_gfx_decrypt(0xec);
6809   driver_init_neogeo(machine);
6809   DRIVER_INIT_CALL(neogeo);
68106810}
68116811
68126812static DRIVER_INIT( matrim )
r1591r1592
68156815   neo_pcm2_swap(1);
68166816   neogeo_fixed_layer_bank_type = 2;
68176817   kof2000_neogeo_gfx_decrypt(0x6a);
6818   driver_init_neogeo(machine);
6818   DRIVER_INIT_CALL(neogeo);
68196819}
68206820
68216821static DRIVER_INIT( pnyaa )
r1591r1592
68236823   neo_pcm2_snk_1999(4);
68246824   neogeo_fixed_layer_bank_type = 1;
68256825   kof2000_neogeo_gfx_decrypt(0x2e);
6826   driver_init_neogeo(machine);
6826   DRIVER_INIT_CALL(neogeo);
68276827}
68286828
68296829static DRIVER_INIT( mslug5 )
r1591r1592
68326832   neo_pcm2_swap(2);
68336833   neogeo_fixed_layer_bank_type = 1;
68346834   kof2000_neogeo_gfx_decrypt(0x19);
6835   driver_init_neogeo(machine);
6835   DRIVER_INIT_CALL(neogeo);
68366836   install_pvc_protection();
68376837}
68386838
r1591r1592
68446844   neogeo_fixed_layer_bank_type = 2;
68456845   svcpcb_s1data_decrypt();
68466846   neo_pcm2_swap(2);
6847   driver_init_neogeo(machine);
6847   DRIVER_INIT_CALL(neogeo);
68486848   install_pvc_protection();
68496849}
68506850
r1591r1592
68556855//  decrypt_ms5plus_s1();
68566856    neogeo_bootleg_sx_decrypt(1);
68576857   neogeo_fixed_layer_bank_type = 1;
6858   driver_init_neogeo(machine);
6858   DRIVER_INIT_CALL(neogeo);
68596859   install_ms5plus_protection();
68606860}
68616861
r1591r1592
68786878   svcpcb_s1data_decrypt();
68796879   neo_pcm2_swap(3);
68806880   neogeo_fixed_layer_bank_type = 2;
6881   driver_init_neogeo(machine);
6881   DRIVER_INIT_CALL(neogeo);
68826882   install_pvc_protection();
68836883}
68846884
r1591r1592
68886888   neo_pcm2_swap(3);
68896889   neogeo_fixed_layer_bank_type = 2;
68906890   kof2000_neogeo_gfx_decrypt(0x57);
6891   driver_init_neogeo(machine);
6891   DRIVER_INIT_CALL(neogeo);
68926892   install_pvc_protection();
68936893}
68946894
r1591r1592
68966896{
68976897   svcboot_px_decrypt();
68986898   svcboot_cx_decrypt();
6899   driver_init_neogeo(machine);
6899   DRIVER_INIT_CALL(neogeo);
69006900   install_pvc_protection();
69016901}
69026902
r1591r1592
69076907//  svcplus_sx_decrypt();
69086908   neogeo_bootleg_sx_decrypt(1);
69096909   svcplus_px_hack();
6910   driver_init_neogeo(machine);
6910   DRIVER_INIT_CALL(neogeo);
69116911}
69126912
69136913static DRIVER_INIT( svcplusa )
r1591r1592
69156915   svcplusa_px_decrypt();
69166916   svcboot_cx_decrypt();
69176917   svcplus_px_hack();
6918   driver_init_neogeo(machine);
6918   DRIVER_INIT_CALL(neogeo);
69196919}
69206920
69216921static DRIVER_INIT( svcsplus )
r1591r1592
69256925   neogeo_bootleg_sx_decrypt(2);
69266926   svcboot_cx_decrypt();
69276927   svcsplus_px_hack();
6928   driver_init_neogeo(machine);
6928   DRIVER_INIT_CALL(neogeo);
69296929   install_pvc_protection();
69306930}
69316931
r1591r1592
69356935   neo_pcm2_swap(4);
69366936   neogeo_fixed_layer_bank_type = 1;
69376937   kof2000_neogeo_gfx_decrypt(0x0f);
6938   driver_init_neogeo(machine);
6938   DRIVER_INIT_CALL(neogeo);
69396939}
69406940
69416941static DRIVER_INIT( samsho5b )
r1591r1592
69446944   neogeo_fixed_layer_bank_type = 1;
69456945   kof2000_neogeo_gfx_decrypt(0x0f);
69466946   samsh5bl_px_decrypt();
6947   driver_init_neogeo(machine);
6947   DRIVER_INIT_CALL(neogeo);
69486948}
69496949
69506950static DRIVER_INIT( kf2k3pcb )
r1591r1592
69576957   /* rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2) -- extra encrypted m1 swap? not confirmed */
69586958   neo_pcm2_swap(5);
69596959   neogeo_fixed_layer_bank_type = 2;
6960   driver_init_neogeo(machine);
6960   DRIVER_INIT_CALL(neogeo);
69616961   install_pvc_protection();
69626962   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc7ffff, 0, 0, MRA16_BANK6 );  // 512k bios
69636963}
r1591r1592
69696969   neo_pcm2_swap(5);
69706970   neogeo_fixed_layer_bank_type = 2;
69716971   kof2000_neogeo_gfx_decrypt(0x9d);
6972   driver_init_neogeo(machine);
6972   DRIVER_INIT_CALL(neogeo);
69736973   install_pvc_protection();
69746974}
69756975
r1591r1592
69776977{
69786978//  kof2003b_sx_decrypt();
69796979   neogeo_bootleg_sx_decrypt(1);
6980   driver_init_neogeo(machine);
6980   DRIVER_INIT_CALL(neogeo);
69816981   kof2003b_install_protection();
69826982}
69836983
r1591r1592
69866986   kof2k3pl_px_decrypt();
69876987   //decrypt_ms5plus_s1();
69886988    neogeo_bootleg_sx_decrypt(1);
6989   driver_init_neogeo(machine);
6989   DRIVER_INIT_CALL(neogeo);
69906990   kf2k3pl_install_protection();
69916991}
69926992
r1591r1592
69966996    kof2k3up_px_decrypt();
69976997//  kof2k3up_sx_decrypt();
69986998   neogeo_bootleg_sx_decrypt(2);
6999   driver_init_neogeo(machine);
6999   DRIVER_INIT_CALL(neogeo);
70007000   kof2k3up_install_protection();
70017001}
70027002
r1591r1592
70087008   neo_pcm2_swap(6);
70097009   neogeo_fixed_layer_bank_type = 1;
70107010   kof2000_neogeo_gfx_decrypt(0x0d);
7011   driver_init_neogeo(machine);
7011   DRIVER_INIT_CALL(neogeo);
70127012}
70137013
70147014
r1591r1592
70297029//  memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") );
70307030//  memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") );
70317031
7032   driver_init_neogeo(machine);
7032   DRIVER_INIT_CALL(neogeo);
70337033}
70347034
70357035static DRIVER_INIT( vliner )
r1591r1592
70467046   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") );
70477047    memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") );
70487048
7049   driver_init_neogeo(machine);
7049   DRIVER_INIT_CALL(neogeo);
70507050}
70517051
70527052
r1591r1592
70587058   kog_px_decrypt();
70597059   neogeo_bootleg_sx_decrypt(1);
70607060   neogeo_bootleg_cx_decrypt();
7061   driver_init_neogeo(machine);
7061   DRIVER_INIT_CALL(neogeo);
70627062}
70637063
70647064
70657065static DRIVER_INIT( kof10th )
70667066{
70677067   decrypt_kof10th();
7068   driver_init_neogeo(machine);
7068   DRIVER_INIT_CALL(neogeo);
70697069   install_kof10th_protection();
70707070}
70717071
70727072static DRIVER_INIT( kf10thep )
70737073{
70747074   decrypt_kf10thep();
7075   driver_init_neogeo(machine);
7075   DRIVER_INIT_CALL(neogeo);
70767076}
70777077
70787078
70797079static DRIVER_INIT( kf2k5uni )
70807080{
70817081   decrypt_kf2k5uni();
7082   driver_init_neogeo(machine);
7082   DRIVER_INIT_CALL(neogeo);
70837083}
70847084
70857085static DRIVER_INIT( cthd2003 )
70867086{
70877087   decrypt_cthd2003();
7088    driver_init_neogeo(machine);
7088    DRIVER_INIT_CALL(neogeo);
70897089   patch_cthd2003();
70907090}
70917091
70927092static DRIVER_INIT ( ct2k3sp )
70937093{
70947094   decrypt_ct2k3sp();
7095   driver_init_neogeo(machine);
7095   DRIVER_INIT_CALL(neogeo);
70967096   patch_cthd2003();
70977097}
70987098
70997099static DRIVER_INIT ( ct2k3sa )
71007100{
71017101   decrypt_ct2k3sa();
7102   driver_init_neogeo(machine);
7102   DRIVER_INIT_CALL(neogeo);
71037103   patch_ct2k3sa();
71047104}
71057105
71067106static DRIVER_INIT( kof2k4se )
71077107{
71087108   decrypt_kof2k4se_68k();
7109   driver_init_neogeo(machine);
7109   DRIVER_INIT_CALL(neogeo);
71107110}
71117111
71127112static DRIVER_INIT( lans2004 )
r1591r1592
71157115   lans2004_vx_decrypt();
71167116   neogeo_bootleg_sx_decrypt(1);
71177117   neogeo_bootleg_cx_decrypt();
7118   driver_init_neogeo(machine);
7118   DRIVER_INIT_CALL(neogeo);
71197119}
71207120
71217121static DRIVER_INIT( mslug3b6 )
71227122{
71237123   neogeo_bootleg_sx_decrypt(2);
71247124   cmc42_neogeo_gfx_decrypt(0xad);
7125   driver_init_neogeo(machine);
7125   DRIVER_INIT_CALL(neogeo);
71267126}
71277127
71287128
src/mame/drivers/mirax.c
r1591r1592
7777   //audio tester
7878   if(input_code_pressed_once(KEYCODE_Q))
7979   {
80      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
80      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
8181   }
8282#endif
8383   return 0;
src/mame/drivers/gradius3.c
r1591r1592
7878static MACHINE_RESET( gradius3 )
7979{
8080   /* 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);
8282   irqAen = 0;
8383   irqBmask = 0;
8484}
r1591r1592
9797      gradius3_priority = data & 0x04;
9898
9999      /* 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);
101101
102102      /* bit 5 enables irq */
103103      irqAen = data & 0x20;
r1591r1592
116116static INTERRUPT_GEN( cpuA_interrupt )
117117{
118118   if (irqAen)
119      cpunum_set_input_line(0, 2, HOLD_LINE);
119      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
120120}
121121
122122static INTERRUPT_GEN( cpuB_interrupt )
r1591r1592
124124   if (cpu_getiloops() & 1)   /* ??? */
125125   {
126126      if (irqBmask & 2)
127         cpunum_set_input_line(1, 2, HOLD_LINE);
127         cpunum_set_input_line(machine, 1, 2, HOLD_LINE);
128128   }
129129   else
130130   {
131131      if (irqBmask & 1)
132         cpunum_set_input_line(1, 1, HOLD_LINE);
132         cpunum_set_input_line(machine, 1, 1, HOLD_LINE);
133133   }
134134}
135135
r1591r1592
138138   if (irqBmask & 4)
139139   {
140140logerror("%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);
142142   }
143143   else
144144logerror("%04x MISSED cpu B irq 4 %02x\n",activecpu_get_pc(),data);
r1591r1592
152152
153153static WRITE16_HANDLER( sound_irq_w )
154154{
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);
156156}
157157
158158static WRITE8_HANDLER( sound_bank_w )
src/mame/drivers/omegrace.c
r1591r1592
322322static WRITE8_HANDLER( omegrace_soundlatch_w )
323323{
324324   soundlatch_w (offset, data);
325   cpunum_set_input_line(1, 0, HOLD_LINE);
325   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
326326}
327327
328328
src/mame/drivers/decocass.c
r1591r1592
11291129   int i;
11301130
11311131   /* standard init */
1132   driver_init_decocass(machine);
1132   DRIVER_INIT_CALL(decocass);
11331133
11341134   /* decrypt the ROMs */
11351135   for (i = 0; i < romlength; i++)
src/mame/drivers/eolithsp.c
r1591r1592
8686
8787   if (eolith_scanline==eolith_speedup_resume_scanline)
8888   {
89      cpu_trigger(1000);
89      cpu_trigger(machine, 1000);
9090   }
9191
9292   if (eolith_scanline==240)
src/mame/drivers/mystwarr.c
r1591r1592
200200   switch (cpu_getiloops())
201201   {
202202      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);
204204      break;
205205
206206      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);
208208      break;
209209
210210      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);
212212      break;
213213   }
214214}
r1591r1592
218218   switch (cpu_getiloops())
219219   {
220220      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);
222222      break;
223223
224224      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);
226226      break;
227227
228228      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);
230230      break;
231231   }
232232}
r1591r1592
238238   switch (cpu_getiloops())
239239   {
240240      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);
242242      break;
243243
244244      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);
246246      break;
247247   }
248248}
249249
250250static INTERRUPT_GEN(ddd_interrupt)
251251{
252   cpunum_set_input_line(0, MC68000_IRQ_5, HOLD_LINE);
252   cpunum_set_input_line(machine, 0, MC68000_IRQ_5, HOLD_LINE);
253253}
254254
255255
r1591r1592
279279
280280static WRITE16_HANDLER( sound_irq_w )
281281{
282   cpunum_set_input_line(1, 0, HOLD_LINE);
282   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
283283}
284284
285285static READ16_HANDLER( sound_status_r )
src/mame/drivers/fromance.c
r1591r1592
180180
181181   /* generate an NMI if we're out of data */
182182   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);
184184}
185185
186186
src/mame/drivers/dlair.c
r1591r1592
9090
9191static void dleuro_interrupt(int state)
9292{
93   cpunum_set_input_line(0, 0, state);
93   cpunum_set_input_line(Machine, 0, 0, state);
9494}
9595
9696
r1591r1592
189189
190190static VIDEO_START( dleuro )
191191{
192   video_start_dlair(machine);
192   VIDEO_START_CALL(dlair);
193193
194194   overlay_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
195195   fillbitmap(overlay_bitmap, 8, NULL);
src/mame/drivers/jollyjgr.c
r1591r1592
394394static INTERRUPT_GEN( jollyjgr_interrupt )
395395{
396396   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);
398398}
399399
400400static MACHINE_DRIVER_START( jollyjgr )
src/mame/drivers/irobot.c
r1591r1592
102102
103103static WRITE8_HANDLER( irobot_clearirq_w )
104104{
105    cpunum_set_input_line(0, M6809_IRQ_LINE ,CLEAR_LINE);
105    cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE ,CLEAR_LINE);
106106}
107107
108108
109109static WRITE8_HANDLER( irobot_clearfirq_w )
110110{
111    cpunum_set_input_line(0, M6809_FIRQ_LINE ,CLEAR_LINE);
111    cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE ,CLEAR_LINE);
112112}
113113
114114
src/mame/drivers/skykid.c
r1591r1592
7979static WRITE8_HANDLER( skykid_subreset_w )
8080{
8181   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);
8383}
8484
8585static WRITE8_HANDLER( skykid_bankswitch_w )
r1591r1592
9292   int bit = !BIT(offset,11);
9393   cpu_interrupt_enable(0,bit);
9494   if (!bit)
95      cpunum_set_input_line(0, 0, CLEAR_LINE);
95      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9696}
9797
9898static WRITE8_HANDLER( skykid_irq_2_ctrl_w )
r1591r1592
100100   int bit = !BIT(offset,13);
101101   cpu_interrupt_enable(1,bit);
102102   if (!bit)
103      cpunum_set_input_line(1, 0, CLEAR_LINE);
103      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
104104}
105105
106106static MACHINE_START( skykid )
r1591r1592
455455   MDRV_CPU_PROGRAM_MAP(skykid_map,0)
456456   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
457457
458   MDRV_CPU_ADD(HD63701,49152000/32)   /* or compatible 6808 with extra instructions */
458   MDRV_CPU_ADD(HD63701,49152000/8)   /* or compatible 6808 with extra instructions */
459459   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
460460   MDRV_CPU_IO_MAP(mcu_port_map,0)
461461   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
src/mame/drivers/klax.c
r1591r1592
3030 *
3131 *************************************/
3232
33static void update_interrupts(void)
33static void update_interrupts(running_machine *machine)
3434{
3535   int newstate = 0;
3636
r1591r1592
3838      newstate = 4;
3939
4040   if (newstate)
41      cpunum_set_input_line(0, newstate, ASSERT_LINE);
41      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4242   else
43      cpunum_set_input_line(0, 7, CLEAR_LINE);
43      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
4444}
4545
4646
src/mame/drivers/halleys.c
r1591r1592
10011001      if (i==0 || (i==4 && !data))
10021002      {
10031003         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
10051005      }
10061006      else
10071007      {
r1591r1592
14991499            fftail = (fftail + 1) & (MAX_SOUNDS - 1);
15001500            latch_delay = (latch_data) ? 0 : 4;
15011501            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);
15031503         }
15041504
15051505         // clear collision list of this frame unconditionally
r1591r1592
15081508
15091509      // In Halley's Comet, NMI is used exclusively to handle coin input
15101510      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);
15121512      break;
15131513
15141514      // FIRQ drives gameplay; we need both types of NMI each frame.
15151515      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);
15171517      break;
15181518
15191519      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);
15211521      break;
15221522   }
15231523}
r1591r1592
15391539            fftail = (fftail + 1) & (MAX_SOUNDS - 1);
15401540            latch_delay = (latch_data) ? 0 : 4;
15411541            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);
15431543         }
15441544      break;
15451545
15461546      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);
15481548      break;
15491549
15501550      case 2:
15511551      case 3:
15521552         // 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++;
15541554      break;
15551555   }
15561556}
r1591r1592
15671567   io_ram[0x9c] = data;
15681568
15691569   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);
15711571}
15721572
15731573
src/mame/drivers/djmain.c
r1591r1592
228228      if (pending_vb_int && !DISABLE_VB_INT)
229229      {
230230         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);
232232      }
233233   }
234234}
r1591r1592
430430   }
431431
432432   //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);
434434}
435435
436436
r1591r1592
439439   if (state != CLEAR_LINE)
440440   {
441441      //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);
443443   }
444444   else
445445   {
446446      //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);
448448   }
449449}
450450
r1591r1592
460460static ADDRESS_MAP_START( memory_map, ADDRESS_SPACE_PROGRAM, 32 )
461461   AM_RANGE(0x000000, 0x0fffff) AM_ROM                     // PRG ROM
462462   AM_RANGE(0x400000, 0x40ffff) AM_RAM                     // WORK RAM
463   AM_RANGE(0x480000, 0x48443f) AM_READWRITE(paletteram32_r, paletteram32_w)      // COLOR RAM
463   AM_RANGE(0x480000, 0x48443f) AM_READWRITE(MRA32_RAM, paletteram32_w)      // COLOR RAM
464464                                AM_BASE(&paletteram32)
465465   AM_RANGE(0x500000, 0x57ffff) AM_READWRITE(sndram_r, sndram_w)            // SOUND RAM
466466   AM_RANGE(0x580000, 0x58003f) AM_READWRITE(K056832_long_r, K056832_long_w)      // VIDEO REG (tilemap)
r1591r1592
17511751      0x6b, 0x09, 0x02, 0x0f, 0x05, 0x00, 0x7d, 0x1b
17521752   };
17531753
1754   driver_init_beatmania(machine);
1754   DRIVER_INIT_CALL(beatmania);
17551755
17561756   ide_set_master_password(0, beatmania_master_password);
17571757   ide_set_user_password(0, hmcompmx_user_password);
r1591r1592
17681768      0x18, 0x06, 0x1e, 0x07, 0x77, 0x1a, 0x7d, 0x77
17691769   };
17701770
1771   driver_init_beatmania(machine);
1771   DRIVER_INIT_CALL(beatmania);
17721772
17731773   ide_set_user_password(0, bm4thmix_user_password);
17741774}
r1591r1592
17841784      0x6b, 0x1a, 0x1e, 0x06, 0x04, 0x01, 0x7d, 0x1f
17851785   };
17861786
1787   driver_init_beatmania(machine);
1787   DRIVER_INIT_CALL(beatmania);
17881788
17891789   ide_set_master_password(0, beatmania_master_password);
17901790   ide_set_user_password(0, bm5thmix_user_password);
r1591r1592
18011801      0x0a, 0x1a, 0x71, 0x07, 0x1e, 0x19, 0x7d, 0x02
18021802   };
18031803
1804   driver_init_beatmania(machine);
1804   DRIVER_INIT_CALL(beatmania);
18051805
18061806   ide_set_master_password(0, beatmania_master_password);
18071807   ide_set_user_password(0, bmclubmx_user_password);
r1591r1592
18191819      0x6b, 0x0d, 0x71, 0x0f, 0x1d, 0x10, 0x7d, 0x7a
18201820   };
18211821
1822   driver_init_beatmania(machine);
1822   DRIVER_INIT_CALL(beatmania);
18231823
18241824   ide_set_master_password(0, beatmania_master_password);
18251825   ide_set_user_password(0, bmcompm2_user_password);
r1591r1592
18361836      0x09, 0x68, 0x71, 0x0b, 0x77, 0x15, 0x17, 0x1e
18371837   };
18381838
1839   driver_init_beatmania(machine);
1839   DRIVER_INIT_CALL(beatmania);
18401840
18411841   ide_set_master_password(0, beatmania_master_password);
18421842   ide_set_user_password(0, hmcompm2_user_password);
r1591r1592
18531853      0x0e, 0x0a, 0x05, 0x0f, 0x13, 0x74, 0x09, 0x19
18541854   };
18551855
1856   driver_init_beatmania(machine);
1856   DRIVER_INIT_CALL(beatmania);
18571857
18581858   ide_set_master_password(0, beatmania_master_password);
18591859   ide_set_user_password(0, bmdct_user_password);
r1591r1592
18701870      0x05, 0x09, 0x14, 0x0d, 0x7a, 0x74, 0x7d, 0x7a
18711871   };
18721872
1873   driver_init_beatmania(machine);
1873   DRIVER_INIT_CALL(beatmania);
18741874
18751875   ide_set_master_password(0, beatmania_master_password);
18761876   ide_set_user_password(0, bmcorerm_user_password);
r1591r1592
18871887      0x02, 0x06, 0x09, 0x0f, 0x7a, 0x74, 0x7d, 0x7a
18881888   };
18891889
1890   driver_init_beatmania(machine);
1890   DRIVER_INIT_CALL(beatmania);
18911891
18921892   ide_set_master_password(0, beatmania_master_password);
18931893   ide_set_user_password(0, bm6thmix_user_password);
r1591r1592
19041904      0x0c, 0x06, 0x7c, 0x6e, 0x77, 0x74, 0x7d, 0x7a
19051905   };
19061906
1907   driver_init_beatmania(machine);
1907   DRIVER_INIT_CALL(beatmania);
19081908
19091909   ide_set_master_password(0, beatmania_master_password);
19101910   ide_set_user_password(0, bm7thmix_user_password);
r1591r1592
19221922      0x0c, 0x06, 0x71, 0x6e, 0x77, 0x79, 0x7d, 0x7a
19231923   };
19241924
1925   driver_init_beatmania(machine);
1925   DRIVER_INIT_CALL(beatmania);
19261926
19271927   ide_set_master_password(0, beatmania_master_password);
19281928   ide_set_user_password(0, bmfinal_user_password);
src/mame/drivers/ssfindo.c
r1591r1592
258258   PS7500_IO[IRQSTA]|=0x20;
259259   if(PS7500_IO[IRQMSKA]&0x20)
260260   {
261      cpunum_set_input_line(0, ARM7_IRQ_LINE, PULSE_LINE);
261      cpunum_set_input_line(machine, 0, ARM7_IRQ_LINE, PULSE_LINE);
262262   }
263263}
264264
r1591r1592
277277   PS7500_IO[IRQSTA]|=0x40;
278278   if(PS7500_IO[IRQMSKA]&0x40)
279279   {
280      cpunum_set_input_line(0, ARM7_IRQ_LINE, PULSE_LINE);
280      cpunum_set_input_line(machine, 0, ARM7_IRQ_LINE, PULSE_LINE);
281281   }
282282}
283283
r1591r1592
295295   PS7500_IO[IRQSTA]|=0x08;
296296      if(PS7500_IO[IRQMSKA]&0x08)
297297      {
298         cpunum_set_input_line(0, ARM7_IRQ_LINE, PULSE_LINE);
298         cpunum_set_input_line(machine, 0, ARM7_IRQ_LINE, PULSE_LINE);
299299      }
300300}
301301
r1591r1592
624624   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
625625   MDRV_PALETTE_LENGTH(256)
626626
627   MDRV_VIDEO_START(generic_bitmapped)
628627   MDRV_VIDEO_UPDATE(ssfindo)
629628
630629MACHINE_DRIVER_END
r1591r1592
647646   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
648647   MDRV_PALETTE_LENGTH(256)
649648
650   MDRV_VIDEO_START(generic_bitmapped)
651649   MDRV_VIDEO_UPDATE(ssfindo)
652650MACHINE_DRIVER_END
653651
src/mame/drivers/firetrk.c
r1591r1592
3939}
4040
4141
42static void set_firetrk_service(int enable)
42static void set_firetrk_service(running_machine *machine, int enable)
4343{
4444   /* watchdog is disabled during service mode */
45   watchdog_enable(!enable);
45   watchdog_enable(machine, !enable);
4646
4747   /* 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);
4949}
5050
5151
r1591r1592
5858      firetrk_service = readinputport(4) & 0x80;
5959      if (firetrk_service != last_service)
6060      {
61         set_firetrk_service(firetrk_service);
61         set_firetrk_service(machine, firetrk_service);
6262
6363         last_service = firetrk_service;
6464      }
r1591r1592
7171      firetrk_service = readinputport(6) & 0x04;
7272      if (firetrk_service != last_service)
7373      {
74         set_firetrk_service(firetrk_service);
74         set_firetrk_service(machine, firetrk_service);
7575
7676         last_service = firetrk_service;
7777      }
r1591r1592
8383
8484   /* NMI interrupts are disabled during service mode in firetrk and montecar */
8585   /* 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);
8787}
8888
8989
r1591r1592
9191{
9292   int scanline = param;
9393
94   cpunum_set_input_line(0, 0, PULSE_LINE);
94   cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
9595
9696   /* IRQs are generated by inverse 16V signal */
9797
r1591r1592
232232   {
233233      write_output(0);
234234      last_service = readinputport(6) & 0x04;
235      set_firetrk_service(last_service);
235      set_firetrk_service(machine, last_service);
236236   }
237237   else
238238   if (GAME_IS_FIRETRUCK)
239239   {
240240      last_service = readinputport(4) & 0x80;
241      set_firetrk_service(last_service);
241      set_firetrk_service(machine, last_service);
242242   }
243243
244244   timer_call_after_resynch(NULL, 0, periodic_callback);
src/mame/drivers/peplus.c
r1591r1592
8383
8484          gamename  method
8585          --------  ------
86          pepp0065     1
8687          pepp0158     2
8788          pepp0188     1
89          pepp0250     1
90          pepp0447     2
8891          pepp0516     1
8992          pebe0014     1
9093          peke1012     1
r1591r1592
9295          peps0716     2
9396          pexp0019     2
9497          pexs0006     2
98          pexmp006     2
9599
96100
971012) Configuration
r1591r1592
220224      }
221225   }
222226
223   nvram_handler_i2cmem_0( machine, file, read_or_write );
227   NVRAM_HANDLER_CALL(i2cmem_0);
224228}
225229
226230/*****************
r1591r1592
443447
444448static READ8_HANDLER( peplus_cmos_r )
445449{
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
460450   return cmos_ram[offset];
461451}
462452
r1591r1592
953943
954944static MACHINE_RESET( peplus )
955945{
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*/
958967}
959968
960969
r1591r1592
10131022   autohold_addr = 0;
10141023}
10151024
1025
1026/*************************
1027*      Driver Init       *
1028*************************/
1029
1030/* Normal board */
1031static DRIVER_INIT( peplus )
1032{
1033   peplus_init();
1034}
1035
10161036/* Superboard */
1017static void peplussb_init(void)
1037static DRIVER_INIT( peplussb )
10181038{
10191039    UINT8 *super_data = memory_region(REGION_USER1);
10201040
r1591r1592
10291049   peplus_init();
10301050}
10311051
1032
10331052/*************************
1034*      Driver Init       *
1053*      Rom Load        *
10351054*************************/
10361055
1037static DRIVER_INIT( peset038 )
1038{
1039   peplus_init();
1056ROM_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) )
10401059
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) )
10451065
1046static 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) )
1068ROM_END
10491069
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
1070ROM_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) )
10531073
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) )
10561079
1057static 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) )
1082ROM_END
10601083
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
1084ROM_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) )
10641087
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) )
10671093
1068static 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) )
1096ROM_END
10711097
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
1098ROM_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) )
10751101
1076   autohold_addr = 0x5e7e;
1077}
1078
1079static 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
1088static 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
1097static 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
1106static 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
1115static 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
1125static 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
1134static 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
1148ROM_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
11521102   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
11531103   ROM_LOAD( "mro-cg740.u72",    0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
11541104   ROM_LOAD( "mgo-cg740.u73",    0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
r1591r1592
11591109   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) )
11601110ROM_END
11611111
1162ROM_START( pepp0158 ) /* Normal board : 4 of a Kind Bonus Poker (PP0158) */
1112ROM_START( pepp0250 ) /* Normal board : Double Down Stud Poker (PP0250) */
11631113   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1164   ROM_LOAD( "pp0158.u68",   0x00000, 0x10000, CRC(5976cd19) SHA1(6a461ea9ddf78dffa3cf8b65903ebf3127f23d45) )
1114   ROM_LOAD( "pp0250.u68",   0x00000, 0x10000, CRC(4c919598) SHA1(fe73503c6ccb3c5746fb96be58cd5b740c819713) )
11651115
11661116   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
11671117   ROM_LOAD( "mro-cg740.u72",    0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
r1591r1592
11731123   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) )
11741124ROM_END
11751125
1176ROM_START( pepp0188 ) /* Normal board : Standard Draw Poker (PP0188) */
1126ROM_START( pepp0447 ) /* Normal board : Standard Draw Poker (PP0447) */
11771127   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1178   ROM_LOAD( "pp0188.u68",   0x00000, 0x10000, CRC(cf36a53c) SHA1(99b578538ab24d9ff91971b1f77599272d1dbfc6) )
1128   ROM_LOAD( "pp0447.u68",   0x00000, 0x10000, CRC(0ef0bb6c) SHA1(d0ef7a83417054f05d32d0a93ed0d5d618f4dfb9) )
11791129
11801130   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
11811131   ROM_LOAD( "mro-cg740.u72",    0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
r1591r1592
13151265/*    YEAR  NAME      PARENT  MACHINE   INPUT         INIT      ROT    COMPANY                                  FULLNAME                                                  FLAGS   LAYOUT */
13161266
13171267/* Set chips */
1318GAMEL(1987, peset038, 0,      peplus,  peplus_schip, peset038, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (Set038) Set Chip",                      0,   layout_pe_schip )
1268GAMEL(1987, peset038, 0,      peplus,  peplus_schip, peplus,  ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (Set038) Set Chip",                      0,   layout_pe_schip )
13191269
13201270/* Normal board : poker */
1321GAMEL(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 )
1322GAMEL(1987, pepp0188, 0,      peplus,  peplus_pokah, pepp0188, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker",           0,   layout_pe_poker )
1323GAMEL(1987, pepp0516, 0,      peplus,  peplus_pokah, pepp0516, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0516) Double Bonus Poker",            0,   layout_pe_poker )
1271GAMEL(1987, pepp0065, 0,      peplus,  peplus_poker, peplus,   ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0065) Jokers Wild Poker",             0,   layout_pe_poker )
1272GAMEL(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 )
1273GAMEL(1987, pepp0188, 0,      peplus,  peplus_pokah, peplus,   ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker",           0,   layout_pe_poker )
1274GAMEL(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 )
1275GAMEL(1987, pepp0447, 0,      peplus,  peplus_poker, peplus,   ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0447) Standard Draw Poker",           0,   layout_pe_poker )
1276GAMEL(1987, pepp0516, 0,      peplus,  peplus_pokah, peplus,   ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0516) Double Bonus Poker",            0,   layout_pe_poker )
13241277
13251278/* Normal board : blackjack */
1326GAMEL(1994, pebe0014, 0,      peplus,  peplus_bjack, pebe0014, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (BE0014) Blackjack",                     0,   layout_pe_bjack )
1279GAMEL(1994, pebe0014, 0,      peplus,  peplus_bjack, peplus,  ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (BE0014) Blackjack",                     0,   layout_pe_bjack )
13271280
13281281/* Normal board : keno */
1329GAMEL(1994, peke1012, 0,      peplus,  peplus_keno,  peke1012, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (KE1012) Keno",                          0,   layout_pe_keno )
1282GAMEL(1994, peke1012, 0,      peplus,  peplus_keno,  peplus,  ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (KE1012) Keno",                          0,   layout_pe_keno )
13301283
13311284/* Normal board : slots machine */
1332GAMEL(1996, peps0615, 0,      peplus,  peplus_slots, peps0615, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots",                   0,   layout_pe_slots )
1333GAMEL(1996, peps0716, 0,      peplus,  peplus_slots, peps0716, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0716) Quarter Mania Slots",           0,   layout_pe_slots )
1285GAMEL(1996, peps0615, 0,      peplus,  peplus_slots, peplus,   ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots",                   0,   layout_pe_slots )
1286GAMEL(1996, peps0716, 0,      peplus,  peplus_slots, peplus,   ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0716) Quarter Mania Slots",           0,   layout_pe_slots )
13341287
13351288/* Superboard : poker */
1336GAMEL(1995, pexp0019, 0,      peplus,  peplus_poker, pexp0019, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XP000019) Deuces Wild Poker",           0,   layout_pe_poker )
1289GAMEL(1995, pexp0019, 0,      peplus,  peplus_poker, peplussb, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XP000019) Deuces Wild Poker",           0,   layout_pe_poker )
13371290
13381291/* Superboard : multi-poker */
1339GAMEL(1995, pexmp006, 0,      peplus,  peplus_poker, pexmp006, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XMP00006) Multi-Poker",                 0,   layout_pe_poker )
1292GAMEL(1995, pexmp006, 0,      peplus,  peplus_poker, peplussb, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XMP00006) Multi-Poker",                 0,   layout_pe_poker )
13401293
13411294/* Superboard : slots machine */
1342GAMEL(1997, pexs0006, 0,      peplus,  peplus_slots, pexs0006, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XS000006) Triple Triple Diamond Slots", 0,   layout_pe_slots )
1295GAMEL(1997, pexs0006, 0,      peplus,  peplus_slots, peplussb, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XS000006) Triple Triple Diamond Slots", 0,   layout_pe_slots )
src/mame/drivers/segas24.c
r1591r1592
692692   int changed = resetcontrol ^ prev_resetcontrol;
693693   if(changed & 2) {
694694      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);
697697//          mame_printf_debug("enable 2nd cpu!\n");
698698//          DEBUGGER_BREAK;
699699         s24_fd1094_machine_init();
700700
701701      } else
702         cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
702         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
703703   }
704704   if(changed & 4)
705705      sndti_reset(SOUND_YM2151, 0);
r1591r1592
824824{
825825   irq_timer_pend0 = irq_timer_pend1 = 1;
826826   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);
828828   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);
830830}
831831
832832static void irq_init(void)
r1591r1592
869869      break;
870870   case 2:
871871      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);
874874      break;
875875   case 3:
876876      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);
879879      break;
880880   }
881881}
r1591r1592
886886  don't get uploaded correctly and you see nothing */
887887static TIMER_CALLBACK( gground_generate_kludge_irq )
888888{
889      cpunum_set_input_line(1, 5, HOLD_LINE);
889      cpunum_set_input_line(machine, 1, 5, HOLD_LINE);
890890}
891891
892892
r1591r1592
907907      if (activecpu_get_pc()==0x084ba)
908908      {
909909         /* 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);
911911
912912         /* set a timer to generate an irq at the needed point */
913913         if (ggground_kludge == 1)
r1591r1592
931931      if (activecpu_get_pc()==0x084bc)
932932      {
933933         /* 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);
935935
936936         /* set a timer to generate an irq at the needed point */
937937         if (ggground_kludge == 1)
r1591r1592
946946   switch(offset) {
947947   case 2:
948948      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);
950950      break;
951951   case 3:
952952      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);
954954      break;
955955   }
956956   return 0xffff;
r1591r1592
962962   int mask = 1 << irq;
963963
964964   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);
966966
967967   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);
969969
970970   if(!cpu_getiloops()) {
971971      // Ensure one index pulse every 20 frames
r1591r1592
980980static void irq_ym(int irq)
981981{
982982   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);
985985}
986986
987987
r1591r1592
12651265
12661266static MACHINE_RESET(system24)
12671267{
1268   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
1268   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
12691269   prev_resetcontrol = resetcontrol = 0x06;
12701270   fdc_init();
12711271   curbank = 0;
src/mame/drivers/mustache.c
r1591r1592
183183
184184static TIMER_CALLBACK( clear_irq_cb )
185185{
186   cpunum_set_input_line(0, 0, CLEAR_LINE);
186   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
187187}
188188
189189static INTERRUPT_GEN( assert_irq )
190190{
191   cpunum_set_input_line(0, 0, ASSERT_LINE);
191   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
192192   timer_set(ATTOTIME_IN_CYCLES(14288, 0), NULL, 0, clear_irq_cb);
193193       /* Timing here is an educated GUESS, Z80 /INT must stay high so the irq
194194          fires no less than TWICE per frame, else game doesn't work right.
src/mame/drivers/ddayjlc.c
r1591r1592
171171static WRITE8_HANDLER( sound_w )
172172{
173173   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);
175175}
176176
177177static WRITE8_HANDLER( i8257_CH0_w )
r1591r1592
386386static INTERRUPT_GEN( ddayjlc_interrupt )
387387{
388388   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);
390390}
391391
392392static INTERRUPT_GEN( ddayjlc_snd_interrupt )
393393{
394394   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);
396396}
397397
398398static MACHINE_DRIVER_START( ddayjlc )
src/mame/drivers/segas16a.c
r1591r1592
205205static void system16a_generic_init(running_machine *machine)
206206{
207207   /* call the generic init */
208   machine_reset_sys16_onetime(machine);
208   MACHINE_RESET_CALL(sys16_onetime);
209209
210210   /* init the FD1094 */
211211   fd1094_driver_init(NULL);
r1591r1592
367367             0= Sound is disabled
368368             1= sound is enabled
369369    */
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);
371371   segaic16_tilemap_set_colscroll(0, ~data & 0x04);
372372   segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
373373}
r1591r1592
419419        D1 = /RESET line on 7751
420420        D0 = /IRQ line on 7751
421421    */
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);
424424   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
425425}
426426
r1591r1592
497497   UINT8 min = workram[0x202/2] & 0xff;
498498
499499   /* 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);
501501
502502   /* out of time? set the flag */
503503   if (tick == 0 && sec == 0 && min == 0)
r1591r1592
537537static void quartet_i8751_sim(void)
538538{
539539   /* 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);
541541
542542   /* X scroll values */
543543   segaic16_textram_0_w(0xff8/2, workram[0x0d14/2], 0);
r1591r1592
803803   AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_READWRITE(MRA16_RAM, segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0)
804804   AM_RANGE(0x410000, 0x410fff) AM_MIRROR(0xb8f000) AM_READWRITE(MRA16_RAM, segaic16_textram_0_w) AM_BASE(&segaic16_textram_0)
805805   AM_RANGE(0x440000, 0x4407ff) AM_MIRROR(0x3bf800) AM_RAM AM_BASE(&segaic16_spriteram_0)
806   AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_READWRITE(paletteram16_word_r, segaic16_paletteram_w) AM_BASE(&paletteram16)
806   AM_RANGE(0x840000, 0x840fff) AM_MIRROR(0x3bf000) AM_READWRITE(MRA16_RAM, segaic16_paletteram_w) AM_BASE(&paletteram16)
807807   AM_RANGE(0xc40000, 0xc43fff) AM_MIRROR(0x39c000) AM_READWRITE(misc_io_r, misc_io_w)
808808   AM_RANGE(0xc60000, 0xc6ffff) AM_READ(watchdog_reset16_r)
809809   AM_RANGE(0xc70000, 0xc73fff) AM_MIRROR(0x38c000) AM_RAM AM_BASE(&workram)
src/mame/drivers/neogeo.c
r1591r1592
197197}
198198
199199
200static void update_interrupts(void)
200static void update_interrupts(running_machine *machine)
201201{
202202   int level = 0;
203203
r1591r1592
208208
209209   /* either set or clear the appropriate lines */
210210   if (level)
211      cpunum_set_input_line(0, level, ASSERT_LINE);
211      cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
212212   else
213      cpunum_set_input_line(0, 7, CLEAR_LINE);
213      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
214214}
215215
216216
r1591r1592
220220   if (data & 0x02) display_position_interrupt_pending = 0;
221221   if (data & 0x04) vblank_interrupt_pending = 0;
222222
223   update_interrupts();
223   update_interrupts(Machine);
224224}
225225
226226
r1591r1592
232232      if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) ***  y: %02x  x: %02x\n", video_screen_get_vpos(0), video_screen_get_hpos(0));
233233      display_position_interrupt_pending = 1;
234234
235      update_interrupts();
235      update_interrupts(machine);
236236   }
237237
238238   if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT)
r1591r1592
265265
266266   vblank_interrupt_pending = 1;
267267
268   update_interrupts();
268   update_interrupts(machine);
269269
270270   /* set timer for next screen */
271271   timer_adjust(vblank_interrupt_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, 0), 0, attotime_zero);
r1591r1592
296296
297297static void audio_cpu_irq(int assert)
298298{
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);
300300}
301301
302302
303303static void audio_cpu_assert_nmi(void)
304304{
305   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
305   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
306306}
307307
308308
309309static WRITE8_HANDLER( audio_cpu_clear_nmi_w )
310310{
311   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
311   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
312312}
313313
314314
r1591r1592
748748   {
749749      audio_cpu_rom_source_last = audio_cpu_rom_source;
750750
751      cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
751      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
752752
753753      if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", safe_activecpu_get_pc(), audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
754754   }
r1591r1592
10141014   start_interrupt_timers();
10151015
10161016   /* trigger the IRQ3 that was set by MACHINE_START */
1017   update_interrupts();
1017   update_interrupts(machine);
10181018}
10191019
10201020
src/mame/drivers/konamigx.c
r1591r1592
439439      if (konamigx_wrport1_1 & 0x10)
440440      {
441441         gx_rdport1_3 &= ~8;
442         cpunum_set_input_line(0, 4, HOLD_LINE);
442         cpunum_set_input_line(Machine, 0, 4, HOLD_LINE);
443443      }
444444   }
445445   else
r1591r1592
558558      {
559559         // enable 68k
560560         // 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);
563563      }
564564      else
565565      {
566566         // 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);
568568      }
569569
570570      K053246_set_OBJCHA_line((data&0x100000) ? ASSERT_LINE : CLEAR_LINE);
r1591r1592
628628      // vblank interrupt ACK
629629      if (!(mem_mask & 0xff000000))
630630      {
631         cpunum_set_input_line(0, 1, CLEAR_LINE);
631         cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
632632         gx_syncen |= 0x20;
633633      }
634634
635635      // hblank interrupt ACK
636636      if (!(mem_mask & 0x0000ff00))
637637      {
638         cpunum_set_input_line(0, 2, CLEAR_LINE);
638         cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE);
639639         gx_syncen |= 0x40;
640640      }
641641   }
r1591r1592
653653static TIMER_CALLBACK( dmaend_callback )
654654{
655655   // 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); }
657657
658658   // DMA busy flag must be cleared before triggering IRQ 3
659659   gx_rdport1_3 &= ~2;
r1591r1592
665665
666666      // lower OBJINT-REQ flag and trigger interrupt
667667      gx_rdport1_3 &= ~0x80;
668      cpunum_set_input_line(0, 3, HOLD_LINE);
668      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
669669   }
670670}
671671
r1591r1592
689689static INTERRUPT_GEN(konamigx_vbinterrupt)
690690{
691691   // 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); }
693693
694694   // IRQ 1 is the main 60hz vblank interrupt
695695   if (gx_syncen & 0x20)
r1591r1592
699699      if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1))
700700      {
701701         gx_syncen &= ~1;
702         cpunum_set_input_line(0, 1, HOLD_LINE);
702         cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
703703      }
704704   }
705705
r1591r1592
709709static INTERRUPT_GEN(konamigx_vbinterrupt_type4)
710710{
711711   // 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); }
713713
714714   // IRQ 1 is the main 60hz vblank interrupt
715715   // the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board
r1591r1592
721721      if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1))
722722      {
723723         gx_syncen &= ~1;
724         cpunum_set_input_line(0, 1, HOLD_LINE);
724         cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
725725      }
726726   }
727727
r1591r1592
744744         if ((konamigx_wrport1_1 & 0x82) == 0x82 || (gx_syncen & 2))
745745         {
746746            gx_syncen &= ~2;
747            cpunum_set_input_line(0, 2, HOLD_LINE);
747            cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
748748         }
749749      }
750750   }
r1591r1592
823823
824824   if (reg == 7)
825825   {
826      cpunum_set_input_line(1, 1, HOLD_LINE);
826      cpunum_set_input_line(Machine, 1, 1, HOLD_LINE);
827827   }
828828}
829829
r1591r1592
10961096            if (konamigx_wrport1_1 & 0x10)
10971097            {
10981098               gx_rdport1_3 &= ~8;
1099               cpunum_set_input_line(0, 4, HOLD_LINE);
1099               cpunum_set_input_line(Machine, 0, 4, HOLD_LINE);
11001100            }
11011101
11021102            // don't accidentally do a phony command
r1591r1592
34443444   tms57002_init();
34453445
34463446   // 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);
34483448
34493449   if (!strcmp(machine->gamedrv->name, "tkmmpzdm"))
34503450   {
src/mame/drivers/segahang.c
r1591r1592
122122{
123123   /* according to the schematics, IRQ2 is generated every 16 scanlines */
124124   if (cpu_getiloops() != 0)
125      cpunum_set_input_line(0, 2, HOLD_LINE);
125      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
126126   else
127      cpunum_set_input_line(0, 4, HOLD_LINE);
127      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
128128}
129129#endif
130130
r1591r1592
271271   /* D2 : SCONT1 - Tilemap origin bit 1 */
272272   /* D1 : SCONT0 - Tilemap origin bit 0 */
273273   /* 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);
275275   segaic16_tilemap_set_colscroll(0, ~data & 0x04);
276276   segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
277277   sound_global_enable(data & 0x01);
r1591r1592
284284   /* D6 : INTR line on second CPU */
285285   /* D5 : RESET line on second CPU */
286286   /* 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);
289289   adc_select = (data >> 2) & 3;
290290}
291291
r1591r1592
338338
339339static void sound_irq(int irq)
340340{
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);
342342}
343343
344344
src/mame/drivers/sprcros2.c
r1591r1592
276276   if (cpu_getiloops() == 0)
277277   {
278278      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);
280280   }
281281   else
282282   {
283283      if(sprcros2_m_port7&0x08)
284         cpunum_set_input_line(0, 0, HOLD_LINE);
284         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
285285   }
286286}
287287
288288static INTERRUPT_GEN( sprcros2_s_interrupt )
289289{
290290   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);
292292}
293293
294294static MACHINE_START( sprcros2 )
src/mame/drivers/statriv2.c
r1591r1592
601601
602602static INTERRUPT_GEN( statriv2_interrupt )
603603{
604   cpunum_set_input_line(0, I8085_RST75_LINE, HOLD_LINE);
604   cpunum_set_input_line(machine, 0, I8085_RST75_LINE, HOLD_LINE);
605605}
606606
607607static MACHINE_DRIVER_START( statriv2 )
608608   /* 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? */
610611   MDRV_CPU_PROGRAM_MAP(statriv2_readmem,statriv2_writemem)
611612   MDRV_CPU_IO_MAP(statriv2_readport,statriv2_writeport)
612613   MDRV_CPU_VBLANK_INT(statriv2_interrupt,1)
src/mame/drivers/thunderj.c
r1591r1592
3434 *
3535 *************************************/
3636
37static void update_interrupts(void)
37static void update_interrupts(running_machine *machine)
3838{
3939   int newstate = 0;
4040   int newstate2 = 0;
r1591r1592
4545      newstate |= 6;
4646
4747   if (newstate)
48      cpunum_set_input_line(0, newstate, ASSERT_LINE);
48      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
4949   else
50      cpunum_set_input_line(0, 7, CLEAR_LINE);
50      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
5151
5252   if (newstate2)
53      cpunum_set_input_line(1, newstate2, ASSERT_LINE);
53      cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE);
5454   else
55      cpunum_set_input_line(1, 7, CLEAR_LINE);
55      cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
5656}
5757
5858
r1591r1592
9595   {
9696      /* 0 means hold CPU 2's reset low */
9797      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);
9999      else
100         cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
100         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
101101
102102      /* bits 2-5 are the alpha bank */
103103      if (thunderj_alpha_tile_bank != ((data >> 2) & 7))
src/mame/drivers/ultraman.c
r1591r1592
104104static WRITE16_HANDLER( sound_irq_trigger_w )
105105{
106106   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);
108108}
109109
110110
src/mame/drivers/parodius.c
r1591r1592
2323
2424static INTERRUPT_GEN( parodius_interrupt )
2525{
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);
2727}
2828
2929static READ8_HANDLER( bankedram_r )
r1591r1592
3131   if (videobank & 0x01)
3232   {
3333      if (videobank & 0x04)
34         return paletteram_r(offset + 0x0800);
34         return paletteram[offset + 0x0800];
3535      else
36         return paletteram_r(offset);
36         return paletteram[offset];
3737   }
3838   else
3939      return ram[offset];
r1591r1592
9999
100100static WRITE8_HANDLER( parodius_sh_irqtrigger_w )
101101{
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);
103103}
104104
105105#if 0
r1591r1592
107107
108108static void sound_nmi_callback( int param )
109109{
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 );
111111
112112   nmi_enabled = 0;
113113}
r1591r1592
115115
116116static TIMER_CALLBACK( nmi_callback )
117117{
118   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
118   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
119119}
120120
121121static WRITE8_HANDLER( sound_arm_nmi_w )
122122{
123123//  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);
125125   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
126126}
127127
src/mame/drivers/ladybug.c
r1591r1592
110110static INTERRUPT_GEN( ladybug_interrupt )
111111{
112112   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);
114114   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);
116116}
117117
118118
src/mame/drivers/blueprnt.c
r1591r1592
8181static WRITE8_HANDLER( blueprnt_sound_command_w )
8282{
8383   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);
8585}
8686
8787static WRITE8_HANDLER( blueprnt_coin_counter_w )
src/mame/drivers/combatsc.c
r1591r1592
213213
214214static WRITE8_HANDLER( combasc_sh_irqtrigger_w )
215215{
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);
217217}
218218
219219static WRITE8_HANDLER( combasc_play_w )
r1591r1592
659659static MACHINE_DRIVER_START( combasc )
660660
661661   /* basic machine hardware */
662   MDRV_CPU_ADD(HD6309, 3000000)   /* 3 MHz? */
662   MDRV_CPU_ADD(HD6309, 3000000*4)   /* 3 MHz? */
663663   MDRV_CPU_PROGRAM_MAP(combasc_readmem,combasc_writemem)
664664   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
665665
r1591r1592
702702static MACHINE_DRIVER_START( combascb )
703703
704704   /* basic machine hardware */
705   MDRV_CPU_ADD(HD6309, 3000000)   /* 3 MHz? */
705   MDRV_CPU_ADD(HD6309, 3000000*4)   /* 3 MHz? */
706706   MDRV_CPU_PROGRAM_MAP(combascb_readmem,combascb_writemem)
707707   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
708708
src/mame/drivers/rockrage.c
r1591r1592
6565static INTERRUPT_GEN( rockrage_interrupt )
6666{
6767   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);
6969}
7070
7171static WRITE8_HANDLER( rockrage_bankswitch_w )
r1591r1592
8787static WRITE8_HANDLER( rockrage_sh_irqtrigger_w )
8888{
8989   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);
9191}
9292
9393static READ8_HANDLER( rockrage_VLM5030_busy_r ) {
r1591r1592
104104   AM_RANGE(0x0000, 0x1fff) AM_READ(K007342_r)         /* Color RAM + Video RAM */
105105   AM_RANGE(0x2000, 0x21ff) AM_READ(K007420_r)         /* Sprite RAM */
106106   AM_RANGE(0x2200, 0x23ff) AM_READ(K007342_scroll_r)   /* Scroll RAM */
107   AM_RANGE(0x2400, 0x247f) AM_READ(paletteram_r)      /* Palette */
107   AM_RANGE(0x2400, 0x247f) AM_READ(MRA8_RAM)         /* Palette */
108108   AM_RANGE(0x2e01, 0x2e01) AM_READ(input_port_3_r)      /* 1P controls */
109109   AM_RANGE(0x2e02, 0x2e02) AM_READ(input_port_4_r)      /* 2P controls */
110110   AM_RANGE(0x2e03, 0x2e03) AM_READ(input_port_1_r)      /* DISPW #2 */
r1591r1592
292292static MACHINE_DRIVER_START( rockrage )
293293
294294   /* basic machine hardware */
295   MDRV_CPU_ADD(HD6309, 3000000)      /* 24MHz/8 */
295   MDRV_CPU_ADD(HD6309, 3000000*4)      /* 24MHz/8 */
296296   MDRV_CPU_PROGRAM_MAP(rockrage_readmem,rockrage_writemem)
297297   MDRV_CPU_VBLANK_INT(rockrage_interrupt,1)
298298
src/mame/drivers/stvinit.c
r1591r1592
7777DRIVER_INIT ( ic13 )
7878{
7979   ic13_shifter();
80   driver_init_stv(machine);
80   DRIVER_INIT_CALL(stv);
8181}
8282/*
8383EEPROM write 0000 to address 2d
r1591r1592
226226   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ae8e0, 0x60ae8e3, 0, 0, shienryu_speedup_r ); // after you enable sound cpu
227227   memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ae8e4, 0x60ae8e7, 0, 0, shienryu_slave_speedup_r ); // after you enable sound cpu
228228
229   driver_init_stv(machine);
229   DRIVER_INIT_CALL(stv);
230230}
231231
232232static READ32_HANDLER( prikura_speedup_r )
r1591r1592
254254   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b9228, 0x60b922b, 0, 0, prikura_speedup_r );
255255   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)prikura_slave_speedup );
256256
257   driver_init_stv(machine);
257   DRIVER_INIT_CALL(stv);
258258
259259   minit_boost = sinit_boost = 0;
260260   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
r1591r1592
272272static READ32_HANDLER( hanagumi_slave_off )
273273{
274274   /* 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);
276276
277277   return stv_workram_h[0x015438/4];
278278}
r1591r1592
299299      memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6094188, 0x609418b, 0, 0, hanagumi_speedup_r );
300300      memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6015438, 0x601543b, 0, 0, hanagumi_slave_off );
301301
302   driver_init_stv(machine);
302   DRIVER_INIT_CALL(stv);
303303}
304304
305305
r1591r1592
341341      memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, puyosun_speedup_r ); // idle loop of main cpu
342342   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)puyosun_slave_speedup );
343343
344   driver_init_ic13(machine);
344   DRIVER_INIT_CALL(ic13);
345345
346346   minit_boost = sinit_boost = 0;
347347   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
r1591r1592
368368{
369369      memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, mausuke_speedup_r ); // idle loop of main cpu
370370
371   driver_init_ic13(machine);
371   DRIVER_INIT_CALL(ic13);
372372
373373   minit_boost = sinit_boost = 0;
374374   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
r1591r1592
406406      memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cottonbm_speedup_r ); // idle loop of main cpu
407407   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cottonbm_slave_speedup );
408408
409   driver_init_stv(machine);
409   DRIVER_INIT_CALL(stv);
410410
411411   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(10);
412412}
r1591r1592
442442      memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cotton2_speedup_r ); // idle loop of main cpu
443443   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cotton2_slave_speedup );
444444
445   driver_init_stv(machine);
445   DRIVER_INIT_CALL(stv);
446446
447447   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
448448}
r1591r1592
463463
464464   if ( data != 0 ) dnmtdeka_pending_commands++;
465465   //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);
467467}
468468
469469static READ32_HANDLER(dnmtdeka_cmd_read)
r1591r1592
494494   memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_write );
495495   memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_read );
496496
497   driver_init_ic13(machine);
497   DRIVER_INIT_CALL(ic13);
498498}
499499
500500static int diehard_pending_commands;
r1591r1592
513513
514514   if ( data != 0 ) diehard_pending_commands++;
515515   //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);
517517}
518518
519519static READ32_HANDLER(diehard_cmd_read)
r1591r1592
537537   if ( (stv_workram_h[0x000e0dd8/4] & 0xff000000) == 0 &&
538538       diehard_pending_commands == 0 )
539539   {
540      cpu_trigger(1000);
540      cpu_trigger(Machine, 1000);
541541   }
542542   return stv_workram_h[0x000e0dd8/4];
543543}
r1591r1592
556556{
557557   //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 );
558558   COMBINE_DATA(&stv_workram_h[0x000e0dd8/4]);
559   cpu_trigger(1000);
559   cpu_trigger(Machine, 1000);
560560}
561561
562562DRIVER_INIT(diehard)
r1591r1592
571571   memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write );
572572
573573
574   driver_init_ic13(machine);
574   DRIVER_INIT_CALL(ic13);
575575
576576}
577577
r1591r1592
604604      memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6090740, 0x6090743, 0, 0, fhboxers_speedup2_r ); // idle loop of second cpu
605605     memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06090bb4, 0x06090bb7, 0, 0, fhboxers_speedup3_r ); // idle loop of main cpu
606606
607   driver_init_ic13(machine);
607   DRIVER_INIT_CALL(ic13);
608608}
609609
610610
r1591r1592
617617
618618static READ32_HANDLER( bakubaku_speedup2_r )
619619{
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);
621621
622622   return stv_workram_h[0x0033762/4];
623623}
r1591r1592
637637      memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60fdfe8, 0x60fdfeb, 0, 0, bakubaku_speedup2_r ); // turn off slave sh2, is it needed after boot ??
638638      //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?
639639
640   driver_init_ic13(machine);
640   DRIVER_INIT_CALL(ic13);
641641}
642642
643643static READ32_HANDLER( groovef_hack1_r )
r1591r1592
669669/*
670670static READ32_HANDLER( groovef_second_cpu_off_r )
671671{
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);
673673    return 0;
674674}
675675*/
r1591r1592
691691//  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.
692692   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)groovef_slave_speedup );
693693
694   driver_init_stv(machine);
694   DRIVER_INIT_CALL(stv);
695695
696696   minit_boost = sinit_boost = 0;
697697   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
r1591r1592
753753   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, danchih_speedup_r );
754754   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)danchih_slave_speedup );
755755
756   driver_init_stv(machine);
756   DRIVER_INIT_CALL(stv);
757757
758758   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5);
759759
r1591r1592
802802
803803   install_astrass_protection();
804804
805   driver_init_ic13(machine);
805   DRIVER_INIT_CALL(ic13);
806806}
807807
808808/* Treasure Hunt idle loop skipping */
r1591r1592
857857
858858   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)thunt_slave_speedup);
859859
860   driver_init_ic13(machine);
860   DRIVER_INIT_CALL(ic13);
861861
862862   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1);
863863}
r1591r1592
887887   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060314f8, 0x060314fb, 0, 0, sandor_speedup_r );
888888   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06075a2c, 0x06075a2f, 0, 0, sandor_speedup2_r );
889889   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)sandor_slave_speedup);
890   driver_init_ic13(machine);
890   DRIVER_INIT_CALL(ic13);
891891   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1);
892892
893893}
r1591r1592
934934
935935   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)grdforce_slave_speedup);
936936
937   driver_init_stv(machine);
937   DRIVER_INIT_CALL(stv);
938938
939939   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
940940}
r1591r1592
961961   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0602acf0, 0x0602acf3, 0, 0, batmanfr_speedup_r );
962962   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)batmanfr_slave_speedup );
963963
964   driver_init_stv(machine);
964   DRIVER_INIT_CALL(stv);
965965
966966   minit_boost = sinit_boost = 0;
967967   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
r1591r1592
983983{
984984   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)colmns97_slave_speedup );
985985
986   driver_init_ic13(machine);
986   DRIVER_INIT_CALL(ic13);
987987
988988   minit_boost = sinit_boost = 0;
989989
r1591r1592
10081008
10091009   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)winterht_slave_speedup );
10101010
1011   driver_init_ic13(machine);
1011   DRIVER_INIT_CALL(ic13);
10121012
10131013   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(2);
10141014}
r1591r1592
10331033
10341034   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)seabass_slave_speedup );
10351035
1036   driver_init_ic13(machine);
1036   DRIVER_INIT_CALL(ic13);
10371037
10381038   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5);
10391039}
r1591r1592
10561056   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06074f98, 0x06074f9b, 0, 0, vfremix_speedup_r );
10571057   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)vfremix_slave_speedup );
10581058
1059   driver_init_ic13(machine);
1059   DRIVER_INIT_CALL(ic13);
10601060
10611061   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(20);
10621062}
r1591r1592
10811081   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, sss_speedup_r );
10821082   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sss_slave_speedup );
10831083
1084   driver_init_ic13(machine);
1084   DRIVER_INIT_CALL(ic13);
10851085
10861086   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
10871087}
r1591r1592
11081108   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, othellos_speedup_r );
11091109   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)othellos_slave_speedup );
11101110
1111   driver_init_stv(machine);
1111   DRIVER_INIT_CALL(stv);
11121112
11131113   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
11141114
r1591r1592
11251125{
11261126   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sasissu_slave_speedup );
11271127
1128   driver_init_ic13(machine);
1128   DRIVER_INIT_CALL(ic13);
11291129
11301130   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(2);
11311131}
r1591r1592
11391139DRIVER_INIT(gaxeduel)
11401140{
11411141   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002f4068, 0x002f406b, 0, 0, gaxeduel_speedup_r);
1142   driver_init_ic13(machine);
1142   DRIVER_INIT_CALL(ic13);
11431143}
11441144
11451145static READ32_HANDLER(suikoenb_speedup_r)
r1591r1592
11511151DRIVER_INIT(suikoenb)
11521152{
11531153   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060705d0, 0x060705d3, 0, 0, suikoenb_speedup_r);
1154   driver_init_ic13(machine);
1154   DRIVER_INIT_CALL(ic13);
11551155}
11561156
11571157static void sokyugrt_slave_speedup( UINT32 data )
r1591r1592
11731173{
11741174   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sokyugrt_slave_speedup );
11751175   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060788cc, 0x060788cf, 0, 0, sokyugrt_speedup_r);
1176   driver_init_ic13(machine);
1176   DRIVER_INIT_CALL(ic13);
11771177   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
11781178
11791179}
r1591r1592
12071207   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)znpwfv_slave_speedup );
12081208   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, znpwfv_speedup_r );
12091209
1210   driver_init_ic13(machine);
1210   DRIVER_INIT_CALL(ic13);
12111211   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_NSEC(500);
12121212}
12131213
r1591r1592
12291229   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)twcup98_slave_speedup );
12301230   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, twcup98_speedup_r );
12311231
1232   driver_init_ic13(machine);
1232   DRIVER_INIT_CALL(ic13);
12331233   install_standard_protection();
12341234
12351235   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5);
r1591r1592
12531253   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)smleague_slave_speedup );
12541254   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, smleague_speedup_r );
12551255
1256   driver_init_ic13(machine);
1256   DRIVER_INIT_CALL(ic13);
12571257
12581258   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
12591259}
r1591r1592
12691269{
12701270   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, finlarch_speedup_r );
12711271
1272   driver_init_ic13(machine);
1272   DRIVER_INIT_CALL(ic13);
12731273
12741274}
12751275
r1591r1592
13001300   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)maruchan_slave_speedup );
13011301   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, maruchan_speedup_r );
13021302
1303   driver_init_ic13(machine);
1303   DRIVER_INIT_CALL(ic13);
13041304
13051305   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
13061306}
r1591r1592
13171317{
13181318   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0606c398, 0x0606c39b, 0, 0, pblbeach_speedup_r );
13191319
1320   driver_init_ic13(machine);
1320   DRIVER_INIT_CALL(ic13);
13211321}
13221322
13231323static READ32_HANDLER( shanhigw_speedup_r )
r1591r1592
13311331{
13321332   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06095cd8, 0x06095cdb, 0, 0, shanhigw_speedup_r );
13331333
1334   driver_init_stv(machine);
1334   DRIVER_INIT_CALL(stv);
13351335}
13361336
13371337static READ32_HANDLER( elandore_speedup_r )
r1591r1592
13581358   install_standard_protection();
13591359   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, elandore_speedup_r );
13601360   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)elandore_slave_speedup);
1361   driver_init_stv(machine);
1361   DRIVER_INIT_CALL(stv);
13621362   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(0);
13631363
13641364}
r1591r1592
13871387   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, rsgun_speedup_r );
13881388   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)rsgun_slave_speedup);
13891389
1390   driver_init_stv(machine);
1390   DRIVER_INIT_CALL(stv);
13911391
13921392   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(20);
13931393
r1591r1592
13961396DRIVER_INIT(ffreveng)
13971397{
13981398   install_standard_protection();
1399   driver_init_stv(machine);
1399   DRIVER_INIT_CALL(stv);
14001400}
14011401
14021402DRIVER_INIT(decathlt)
14031403{
14041404   install_decathlt_protection();
1405   driver_init_ic13(machine);
1405   DRIVER_INIT_CALL(ic13);
14061406}
14071407
14081408static READ32_HANDLER( nameclv3_speedup_r )
r1591r1592
14221422{
14231423   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60452c0, 0x60452c3, 0, 0, nameclv3_speedup_r );
14241424   cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)nameclv3_slave_speedup );
1425   driver_init_stv(machine);
1425   DRIVER_INIT_CALL(stv);
14261426}
src/mame/drivers/ttchamp.c
r1591r1592
217217
218218static INTERRUPT_GEN( ttchamp_irq ) /* right? */
219219{
220   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
220   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
221221}
222222
223223static MACHINE_DRIVER_START( ttchamp )
src/mame/drivers/egghunt.c
r1591r1592
173173static WRITE8_HANDLER( egghunt_soundlatch_w )
174174{
175175   soundlatch_w(0,data);
176   cpunum_set_input_line(1,0,HOLD_LINE);
176   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
177177}
178178
179179static READ8_HANDLER( egghunt_okibanking_r )
src/mame/drivers/buggychl.c
r1591r1592
126126
127127static TIMER_CALLBACK( nmi_callback )
128128{
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);
130130   else pending_nmi = 1;
131131}
132132
r1591r1592
146146   sound_nmi_enable = 1;
147147   if (pending_nmi)
148148   {
149      cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
149      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
150150      pending_nmi = 0;
151151   }
152152}
src/mame/drivers/segac2.c
r1591r1592
131131   state_save_register_global(prot_write_buf);
132132   state_save_register_global(prot_read_buf);
133133
134   machine_start_genesis(machine);
134   MACHINE_START_CALL(genesis);
135135}
136136
137137
138138static MACHINE_RESET( segac2 )
139139{
140140   /* set up interrupts and such */
141   machine_reset_genesis(machine);
141   MACHINE_RESET_CALL(genesis);
142142
143143   /* determine how many sound banks */
144144   sound_banks = 0;
src/mame/drivers/gotcha.c
r1591r1592
261261
262262static void irqhandler(int linestate)
263263{
264   cpunum_set_input_line(1,0,linestate);
264   cpunum_set_input_line(Machine, 1,0,linestate);
265265}
266266
267267static const struct YM2151interface ym2151_interface =
src/mame/drivers/starshp1.c
r1591r1592
1818static INTERRUPT_GEN( starshp1_interrupt )
1919{
2020   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);
2422}
2523
2624
src/mame/drivers/pandoras.c
r1591r1592
4040
4141static INTERRUPT_GEN( pandoras_interrupt_a ){
4242   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);
4444}
4545
4646static INTERRUPT_GEN( pandoras_interrupt_b ){
4747   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);
4949}
5050
5151static READ8_HANDLER( pandoras_sharedram_r ){
r1591r1592
7575        other bytes unknown */
7676
7777   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);
7979               irq_enable_a = data;
8080               break;
8181      case 0x02:   coin_counter_w(0,data & 0x01);
r1591r1592
8484               break;
8585      case 0x05:   pandoras_flipscreen_w(0, data);
8686               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);
8888               irq_enable_b = data;
8989               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);
9191               break;
9292
9393      default:
r1591r1592
9797
9898static WRITE8_HANDLER( pandoras_cpua_irqtrigger_w ){
9999   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);
101101   }
102102
103103   firq_old_data_a = data;
r1591r1592
105105
106106static WRITE8_HANDLER( pandoras_cpub_irqtrigger_w ){
107107   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);
109109   }
110110
111111   firq_old_data_b = data;
r1591r1592
113113
114114static WRITE8_HANDLER( pandoras_i8039_irqtrigger_w )
115115{
116   cpunum_set_input_line(3, 0, ASSERT_LINE);
116   cpunum_set_input_line(Machine, 3, 0, ASSERT_LINE);
117117}
118118
119119static WRITE8_HANDLER( i8039_irqen_and_status_w )
120120{
121121   /* bit 7 enables IRQ */
122122   if ((data & 0x80) == 0)
123      cpunum_set_input_line(3, 0, CLEAR_LINE);
123      cpunum_set_input_line(Machine, 3, 0, CLEAR_LINE);
124124
125125   /* bit 5 goes to 8910 port A */
126126   i8039_status = (data & 0x20) >> 5;
r1591r1592
128128
129129static WRITE8_HANDLER( pandoras_z80_irqtrigger_w )
130130{
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);
132132}
133133
134134
src/mame/drivers/taito_f2.c
r1591r1592
795795
796796static TIMER_CALLBACK( taitof2_interrupt6 )
797797{
798   cpunum_set_input_line(0,6,HOLD_LINE);
798   cpunum_set_input_line(machine, 0,6,HOLD_LINE);
799799}
800800
801801static INTERRUPT_GEN( taitof2_interrupt )
802802{
803803   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);
805805}
806806
807807
r1591r1592
845845
846846static READ8_HANDLER( driveout_sound_command_r)
847847{
848   cpunum_set_input_line(1,0,CLEAR_LINE);
848   cpunum_set_input_line(Machine, 1,0,CLEAR_LINE);
849849//  logerror("sound IRQ OFF (sound command=%02x)\n",driveout_sound_latch);
850850   return driveout_sound_latch;
851851}
r1591r1592
886886         else
887887         {
888888            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);
890890         }
891891      }
892892   }
r1591r1592
38203820/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
38213821static void irq_handler(int irq)
38223822{
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);
38243824}
38253825
38263826static const struct YM2610interface ym2610_interface =
src/mame/drivers/gberet.c
r1591r1592
534534   if (cpu_getiloops() == 0)
535535   {
536536      if (enable_IRQ)
537         cpunum_set_input_line(0, 0, HOLD_LINE);
537         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
538538   }
539539
540540   if (cpu_getiloops() % 2)
541541   {
542542      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);
544544   }
545545}
546546
src/mame/drivers/stfight.c
r1591r1592
516516   /* sound hardware */
517517   MDRV_SPEAKER_STANDARD_MONO("mono")
518518
519   MDRV_SOUND_ADD(YM2203, 1500000)
519   MDRV_SOUND_ADD(YM2203, 3000000)
520520   MDRV_SOUND_ROUTE(0, "mono", 0.15)
521521   MDRV_SOUND_ROUTE(1, "mono", 0.15)
522522   MDRV_SOUND_ROUTE(2, "mono", 0.15)
523523   MDRV_SOUND_ROUTE(3, "mono", 0.10)
524524
525   MDRV_SOUND_ADD(YM2203, 1500000)
525   MDRV_SOUND_ADD(YM2203, 3000000)
526526   MDRV_SOUND_ROUTE(0, "mono", 0.15)
527527   MDRV_SOUND_ROUTE(1, "mono", 0.15)
528528   MDRV_SOUND_ROUTE(2, "mono", 0.15)
src/mame/drivers/gottlieb.c
r1591r1592
405405         else audioready = 0;
406406      }
407407   }
408   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
408   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
409409}
410410
411411
r1591r1592
22522252GAME( 1982, qberttst, qbert,    qbert,    qbert,    0,        ROT270, "Gottlieb", "Q*bert (early test version)", 0 )
22532253GAME( 1982, qbtrktst, qbert,    qbert,    qbert,    0,        ROT270, "Gottlieb", "Q*bert Board Input Test Rom", 0 )
22542254GAME( 1982, insector, 0,        gottlieb, insector, 0,        ROT0,   "Gottlieb", "Insector (prototype)", 0 )
2255GAME( 1982, tylz,     0,        gottlieb, tylz,     0,        ROT0,   "Mylstar",  "Tylz (prototype)", GAME_IMPERFECT_SOUND ) // modified sound hw?
2255GAME( 1982, tylz,     0,        qbert,    tylz,     0,        ROT0,   "Mylstar",  "Tylz (prototype)", GAME_IMPERFECT_SOUND ) // modified sound hw?
22562256GAME( 1984, argusg,   0,        krull,    argusg,   0,        ROT0,   "Gottlieb", "Argus (Gottlieb, prototype)" , 0) // aka Guardian / Protector?
22572257GAME( 1983, mplanets, 0,        gottlieb, mplanets, 0,        ROT270, "Gottlieb", "Mad Planets", 0 )
22582258GAME( 1983, mplanuk,  mplanets, gottlieb, mplanets, 0,        ROT270, "Gottlieb (Taitel license)", "Mad Planets (UK)", 0 )
src/mame/drivers/sandscrp.c
r1591r1592
3737static void update_irq_state(void)
3838{
3939   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);
4141   else
42      cpunum_set_input_line(0, 1, CLEAR_LINE);
42      cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
4343}
4444
4545
r1591r1592
129129   {
130130      latch1_full = 1;
131131      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);
133133      cpu_spinuntil_time(ATTOTIME_IN_USEC(100));   // Allow the other cpu to reply
134134   }
135135}
r1591r1592
350350
351351static void irq_handler(int irq)
352352{
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);
354354}
355355
356356static const struct YM2203interface ym2203_intf_sandscrp =
src/mame/drivers/gpworld.c
r1591r1592
393393
394394static TIMER_CALLBACK( irq_stop )
395395{
396   cpunum_set_input_line(0, 0, CLEAR_LINE);
396   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
397397}
398398
399399static INTERRUPT_GEN( vblank_callback_gpworld )
r1591r1592
403403   {
404404      laserdisc_data_w(discinfo,ldp_write_latch);
405405      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);
407407   }
408408
409409   /* 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);
411411   timer_set(ATTOTIME_IN_USEC(100), NULL, 0, irq_stop);
412412
413413   laserdisc_vsync(discinfo);
src/mame/drivers/ddragon.c
r1591r1592
7373#include "sound/okim6295.h"
7474#include "sound/msm5205.h"
7575
76
77#define MAIN_CLOCK      XTAL_12MHz
78#define SOUND_CLOCK      XTAL_3_579545MHz
79#define MCU_CLOCK      XTAL_4MHz
80
81
7682/* from video */
7783extern UINT8 *ddragon_bgvideoram,*ddragon_fgvideoram;
78extern int ddragon_scrollx_hi, ddragon_scrolly_hi;
84extern UINT16 ddragon_scrollx_hi, ddragon_scrolly_hi;
7985extern UINT8 *ddragon_scrollx_lo;
8086extern UINT8 *ddragon_scrolly_lo;
8187VIDEO_START( ddragon );
r1591r1592
8389WRITE8_HANDLER( ddragon_bgvideoram_w );
8490WRITE8_HANDLER( ddragon_fgvideoram_w );
8591extern UINT8 *ddragon_spriteram;
86extern int technos_video_hw;
92extern UINT8 technos_video_hw;
8793/* end of extern code & data */
8894
95static emu_timer *scanline_timer;
8996static MACHINE_START( ddragon );
97static WRITE8_HANDLER( ddragon_bankswitch_w );
9098
9199/* private globals */
92static int dd_sub_cpu_busy;
93static int sprite_irq, sound_irq, ym_irq, snd_cpu;
94static int adpcm_pos[2],adpcm_end[2],adpcm_idle[2];
95static UINT8* darktowr_mcu_ports, *darktowr_ram;
96static int VBLK;
97static UINT8 bank_data;
100static UINT8 dd_sub_cpu_busy;
101static UINT8 sprite_irq, sound_irq, ym_irq, snd_cpu;
102static UINT32 adpcm_pos[2], adpcm_end[2];
103static UINT8 adpcm_idle[2];
104static UINT8 *darktowr_mcu_ports;
105static UINT8 *rambase;
98106/* end of private globals */
99107
100108
101static 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
130INLINE int scanline_to_vcount(int scanline)
102131{
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;
110137}
111138
112static MACHINE_RESET( toffy )
139
140static TIMER_CALLBACK( ddragon_scanline_callback )
113141{
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);
120161}
121162
122static MACHINE_RESET( ddragonb )
163
164
165/*************************************
166 *
167 *  System setup and intialization
168 *
169 *************************************/
170
171static MACHINE_START( ddragon )
123172{
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);
131187}
132188
133static MACHINE_RESET( ddragon2 )
189
190static MACHINE_RESET( ddragon )
134191{
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);
141195}
142196
143/*****************************************************************************/
144197
145static WRITE8_HANDLER( ddragon_bankswitch_w )
146{
147   UINT8 *RAM = memory_region(REGION_CPU1);
148198
149   ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 );
150   ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 );
199/*************************************
200 *
201 *  Bank switching
202 *
203 *************************************/
151204
205static WRITE8_HANDLER( ddragon_bankswitch_w )
206{
207   ddragon_scrollx_hi = ((data & 0x01) << 8);
208   ddragon_scrolly_hi = ((data & 0x02) << 7);
152209   flip_screen_set(~data & 0x04);
153210
154211   /* bit 3 unknown */
155212
156213   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);
160217
161   memory_set_bankptr( 1,&RAM[ 0x10000 + ( 0x4000 * ( ( data & 0xe0) >> 5 ) ) ] );
162
163   bank_data=data;
218   memory_set_bank(1, (data & 0xe0) >> 5);
164219}
165220
221
166222static WRITE8_HANDLER( toffy_bankswitch_w )
167223{
168   UINT8 *RAM = memory_region(REGION_CPU1);
224   ddragon_scrollx_hi = ((data & 0x01) << 8);
225   ddragon_scrolly_hi = ((data & 0x02) << 7);
169226
170   ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 );
171   ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 );
172
173227//  flip_screen_set(~data & 0x04);
174228
175229   /* bit 3 unknown */
176230
177231   /* I don't know ... */
178   memory_set_bankptr( 1,&RAM[ 0x10000 + ( 0x4000 * ( ( data & 0x20) >> 5 ) ) ] );
232   memory_set_bank(1, (data & 0x20) >> 5);
179233}
180234
181/*****************************************************************************/
182235
183static int darktowr_bank=0;
236static READ8_HANDLER( darktowr_mcu_bank_r )
237{
238   // logerror("BankRead %05x %08x\n",activecpu_get_pc(),offset);
184239
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
264static 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
185276static WRITE8_HANDLER( darktowr_bankswitch_w )
186277{
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;
189280
281   ddragon_scrollx_hi = ((data & 0x01) << 8);
282   ddragon_scrolly_hi = ((data & 0x02) << 7);
283
190284//  flip_screen_set(~data & 0x04);
191285
192286   /* bit 3 unknown */
193287
194288   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);
198292
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);
202298}
203299
204static READ8_HANDLER( darktowr_bank_r )
205{
206   UINT8 *RAM = memory_region(REGION_CPU1);
207300
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);
211301
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 *************************************/
223307
224         /* Just return whatever the code is expecting */
225         return darktowr_ram[0xbe1];
226      }
308static 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;
227315
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;
231319
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;
235323
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   }
237333}
238334
239static WRITE8_HANDLER( darktowr_bank_w )
335
336static WRITE8_HANDLER( ddragon2_sub_irq_ack_w )
240337{
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}
243340
244      if (offset==0x1400 || offset==0) {
245         int bitSwappedData=BITSWAP8(data,0,1,2,3,4,5,6,7);
246341
247         darktowr_mcu_ports[1]=bitSwappedData;
342static WRITE8_HANDLER( ddragon2_sub_irq_w )
343{
344   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
345}
248346
249         logerror("MCU PORT 1 -> %04x (from %04x)\n",bitSwappedData,data);
250         return;
251      }
252      return;
253   }
254347
255   logerror("ROM write! %04x %02x\n",offset,data);
348static void irq_handler(int irq)
349{
350   cpunum_set_input_line(Machine, snd_cpu, ym_irq , irq ? ASSERT_LINE : CLEAR_LINE );
256351}
257352
258static READ8_HANDLER( darktowr_mcu_r )
353
354
355/*************************************
356 *
357 *  MCU handlers
358 *
359 *************************************/
360
361static CUSTOM_INPUT( sub_cpu_busy )
259362{
260   return darktowr_mcu_ports[offset];
363   return dd_sub_cpu_busy;
261364}
262365
366
263367static WRITE8_HANDLER( darktowr_mcu_w )
264368{
265369   logerror("McuWrite %05x %08x %08x\n",activecpu_get_pc(),offset,data);
266370   darktowr_mcu_ports[offset]=data;
267371}
268372
269/**************************************************************************/
270373
271static 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
293374static READ8_HANDLER( ddragon_hd63701_internal_registers_r )
294375{
295   logerror("%04x: read %d\n",activecpu_get_pc(),offset);
376   logerror("%04x: read %d\n", activecpu_get_pc(), offset);
296377   return 0;
297378}
298379
380
299381static WRITE8_HANDLER( ddragon_hd63701_internal_registers_w )
300382{
301383   /* 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   {
303386      /* This is a guess, but makes sense.. The mcu definitely interrupts the main cpu.
304387        I don't know what bit is the assert and what is the clear though (in comparison
305388        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);
309393      }
310394   }
311395}
312396
313static WRITE8_HANDLER( ddragon2_sub_irq_ack_w )
314{
315   cpunum_set_input_line(1,sprite_irq, CLEAR_LINE );
316}
317397
318static WRITE8_HANDLER( ddragon2_sub_irq_w )
319{
320   cpunum_set_input_line(0,M6809_IRQ_LINE,ASSERT_LINE);
321}
322398
323static READ8_HANDLER( port4_r )
324{
325   int port = readinputportbytag("IN4");
399/*************************************
400 *
401 *  Sprite RAM hacks
402 *
403 *************************************/
326404
327   return port | dd_sub_cpu_busy | VBLK;
328}
329
330405static READ8_HANDLER( ddragon_spriteram_r )
331406{
332407   /* 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)
334409      return 0x1;
335410
336411   return ddragon_spriteram[offset];
337412}
338413
414
339415static WRITE8_HANDLER( ddragon_spriteram_w )
340416{
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;
343419
344420   ddragon_spriteram[offset] = data;
345421}
346422
347/*****************************************************************************/
348423
349#if 0
350static 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
356424
425/*************************************
426 *
427 *  ADPCM sound
428 *
429 *************************************/
430
357431static WRITE8_HANDLER( dd_adpcm_w )
358432{
359433   int chip = offset & 1;
r1591r1592
380454   }
381455}
382456
457
383458static void dd_adpcm_int(int chip)
384459{
385460   static int adpcm_data[2] = { -1, -1 };
r1591r1592
391466   }
392467   else if (adpcm_data[chip] != -1)
393468   {
394      MSM5205_data_w(chip,adpcm_data[chip] & 0x0f);
469      MSM5205_data_w(chip, adpcm_data[chip] & 0x0f);
395470      adpcm_data[chip] = -1;
396471   }
397472   else
r1591r1592
403478   }
404479}
405480
481
406482static READ8_HANDLER( dd_adpcm_status_r )
407483{
408484   return adpcm_idle[0] + (adpcm_idle[1] << 1);
409485}
410486
411/*****************************************************************************/
412487
413static 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)
424ADDRESS_MAP_END
425488
426static 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)
439ADDRESS_MAP_END
489/*************************************
490 *
491 *  Main CPU memory maps
492 *
493 *************************************/
440494
441static 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)
495static 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)
445503   AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r)
446504   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)
448506   AM_RANGE(0x3803, 0x3803) AM_READ(input_port_2_r)
449507   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)
452ADDRESS_MAP_END
453
454static 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)
463509   AM_RANGE(0x3809, 0x3809) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrollx_lo)
464510   AM_RANGE(0x380a, 0x380a) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrolly_lo)
465511   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
468514ADDRESS_MAP_END
469515
470static 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
517static 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)
474522   AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r)
475523   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)
477525   AM_RANGE(0x3803, 0x3803) AM_READ(input_port_2_r)
478526   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)
482ADDRESS_MAP_END
483
484static 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)
489527   AM_RANGE(0x3808, 0x3808) AM_WRITE(ddragon_bankswitch_w)
490528   AM_RANGE(0x3809, 0x3809) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrollx_lo)
491529   AM_RANGE(0x380a, 0x380a) AM_WRITE(MWA8_RAM) AM_BASE(&ddragon_scrolly_lo)
492530   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
496535ADDRESS_MAP_END
497536
498static 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)
511ADDRESS_MAP_END
512537
513static 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)
518ADDRESS_MAP_END
519538
520static 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
545static 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
525550ADDRESS_MAP_END
526551
527static 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
553static 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
531557ADDRESS_MAP_END
532558
533static 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
560static 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)
537565ADDRESS_MAP_END
538566
539567/* might not be 100% accurate, check bits written */
540568static WRITE8_HANDLER( ddragnba_port_w )
541569{
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 );
544572}
545573
546static ADDRESS_MAP_START( ddragnba_sub_writeport, ADDRESS_SPACE_IO, 8 )
574static ADDRESS_MAP_START( ddragnba_sub_portmap, ADDRESS_SPACE_IO, 8 )
547575   AM_RANGE(0x0000, 0xffff) AM_WRITE(ddragnba_port_w)
548576ADDRESS_MAP_END
549577
550578
551579
552static 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
586static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
587   AM_RANGE(0x0000, 0x0fff) AM_RAM
554588   AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_r)
555589   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)
558ADDRESS_MAP_END
559
560static 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)
564592   AM_RANGE(0x3800, 0x3807) AM_WRITE(dd_adpcm_w)
565   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
593   AM_RANGE(0x8000, 0xffff) AM_ROM
566594ADDRESS_MAP_END
567595
568static 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)
571ADDRESS_MAP_END
572596
573static 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)
578ADDRESS_MAP_END
579
580static 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)
597static 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)
585603   AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r)
586604ADDRESS_MAP_END
587605
588static 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)
594ADDRESS_MAP_END
595606
596static 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)
601ADDRESS_MAP_END
602607
603static ADDRESS_MAP_START( mcu_writemem, ADDRESS_SPACE_PROGRAM, 8 )
608/*************************************
609 *
610 *  MCU memory maps
611 *
612 *************************************/
613
614static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
604615   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
608619ADDRESS_MAP_END
609620
610/*****************************************************************************/
611621
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 )
621622
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 *************************************/
647628
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 ) )
629static 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 )
683639
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 )
701648   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
702649
703
704static 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 ) )
732673   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
733674   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
734675
735   COMMON_PORT4
736INPUT_PORTS_END
737
738static INPUT_PORTS_START( tstrike )
739   COMMON_INPUT_PORTS
740
741   COMMON_INPUT_DIP1
742
743676   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
767INPUT_PORTS_END
768
769static INPUT_PORTS_START( ddragon )
770   COMMON_INPUT_PORTS
771
772   COMMON_INPUT_DIP1
773
774   PORT_START_TAG("DSW1")
775677   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
776678   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
777679   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
r1591r1592
792694   PORT_DIPSETTING(    0x40, "4" )
793695   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
794696
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 )
796706INPUT_PORTS_END
797707
708
798709static INPUT_PORTS_START( ddragon2 )
799   COMMON_INPUT_PORTS
710   PORT_INCLUDE(ddragon)
800711
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")
812713   PORT_DIPNAME( 0x08, 0x08, "Hurricane Kick" )
813714   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
814715   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
r1591r1592
822723   PORT_DIPSETTING(    0x80, "2" )
823724   PORT_DIPSETTING(    0x40, "3" )
824725   PORT_DIPSETTING(    0x00, "4" )
726INPUT_PORTS_END
825727
826   COMMON_PORT4
728
729static 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" )
827754INPUT_PORTS_END
828755
756
829757static INPUT_PORTS_START( ddungeon )
830   COMMON_INPUT_PORTS
758   PORT_INCLUDE(ddragon)
831759
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 ) )
833795
834   PORT_START_TAG("DSW1")
796   PORT_MODIFY("DSW1")
835797   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
836798   PORT_DIPSETTING(    0x00, "1" )
837799   PORT_DIPSETTING(    0x01, "2" )
r1591r1592
844806   PORT_DIPSETTING(    0x90, DEF_STR( Medium ) )
845807   PORT_DIPSETTING(    0x70, DEF_STR( Hard ) )
846808   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
809INPUT_PORTS_END
847810
848   COMMON_PORT4
811
812static 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 ) )
849840INPUT_PORTS_END
850841
842
851843static INPUT_PORTS_START( toffy )
852   COMMON_INPUT_PORTS
844   PORT_INCLUDE(ddragon)
853845
854   PORT_START_TAG("DSW0")
846   PORT_MODIFY("DSW0")
855847   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
856848   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
857849   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
r1591r1592
887879   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
888880   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
889881
890   PORT_START_TAG("DSW1")
882   PORT_MODIFY("DSW1")
891883   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
892884   PORT_DIPSETTING(    0x00, "2" )
893885   PORT_DIPSETTING(    0x01, "3" )
r1591r1592
905897   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
906898   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
907899   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
908
909   COMMON_PORT4
910900INPUT_PORTS_END
911901
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
916902
917/*****************************************************************************/
918903
904/*************************************
905 *
906 *  Graphics layouts
907 *
908 *************************************/
909
919910static const gfx_layout char_layout =
920911{
921912   8,8,
r1591r1592
946937   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout, 256, 8 )   /* colors 256-383 */
947938GFXDECODE_END
948939
949/*****************************************************************************/
950940
951static void irq_handler(int irq)
952{
953   cpunum_set_input_line( snd_cpu, ym_irq , irq ? ASSERT_LINE : CLEAR_LINE );
954}
955941
942/*************************************
943 *
944 *  Sound definitions
945 *
946 *************************************/
947
956948static const struct YM2151interface ym2151_interface =
957949{
958950   irq_handler
r1591r1592
964956   MSM5205_S48_4B   /* 8kHz */
965957};
966958
967static INTERRUPT_GEN( ddragon_interrupt )
968{
969   int scanline=271 - cpu_getiloops();
970959
971   /* VBLK is lowered on scanline 0 */
972   if (scanline==0) {
973      VBLK=0;
974   }
975960
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 *************************************/
982966
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
991967static MACHINE_DRIVER_START( ddragon )
992968
993969   /* 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)
997972
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)
1000975
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)
1004978
1005   MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0)
1006   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1007979   MDRV_INTERLEAVE(1000) /* heavy interleaving to sync up sprite<->main cpu's */
1008980
1009981   MDRV_MACHINE_START(ddragon)
r1591r1592
1011983
1012984   /* video hardware */
1013985   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)
1017986   MDRV_GFXDECODE(ddragon)
1018987   MDRV_PALETTE_LENGTH(384)
1019988
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)
1038MACHINE_DRIVER_END
1039
1040static 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)
1065990   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)
1070992
1071993   MDRV_VIDEO_START(ddragon)
1072994   MDRV_VIDEO_UPDATE(ddragon)
r1591r1592
1074996   /* sound hardware */
1075997   MDRV_SPEAKER_STANDARD_MONO("mono")
1076998
1077   MDRV_SOUND_ADD(YM2151, 3579545)
999   MDRV_SOUND_ADD_TAG("fm", YM2151, SOUND_CLOCK)
10781000   MDRV_SOUND_CONFIG(ym2151_interface)
10791001   MDRV_SOUND_ROUTE(0, "mono", 0.60)
10801002   MDRV_SOUND_ROUTE(1, "mono", 0.60)
10811003
1082   MDRV_SOUND_ADD(MSM5205, 384000)
1004   MDRV_SOUND_ADD_TAG("oki1", MSM5205, MAIN_CLOCK/32)
10831005   MDRV_SOUND_CONFIG(msm5205_interface)
10841006   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
10851007
1086   MDRV_SOUND_ADD(MSM5205, 384000)
1008   MDRV_SOUND_ADD_TAG("oki2", MSM5205, MAIN_CLOCK/32)
10871009   MDRV_SOUND_CONFIG(msm5205_interface)
10881010   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
10891011MACHINE_DRIVER_END
10901012
1013
10911014static MACHINE_DRIVER_START( ddragonb )
1015   MDRV_IMPORT_FROM(ddragon)
10921016
10931017   /* 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)
11381020MACHINE_DRIVER_END
11391021
1022
11401023static MACHINE_DRIVER_START( ddragnba )
1024   MDRV_IMPORT_FROM(ddragon)
11411025
11421026   /* 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)
11881030MACHINE_DRIVER_END
11891031
11901032
11911033static MACHINE_DRIVER_START( ddragon2 )
11921034
11931035   /* 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)
11971038
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)
12001041
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)
12041044
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 */
12081046
1209   MDRV_MACHINE_RESET(ddragon2)
1047   MDRV_MACHINE_START(ddragon)
1048   MDRV_MACHINE_RESET(ddragon)
12101049
12111050   /* video hardware */
12121051   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)
12161052   MDRV_GFXDECODE(ddragon)
12171053   MDRV_PALETTE_LENGTH(384)
12181054
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
12191059   MDRV_VIDEO_START(ddragon)
12201060   MDRV_VIDEO_UPDATE(ddragon)
12211061
12221062   /* sound hardware */
12231063   MDRV_SPEAKER_STANDARD_MONO("mono")
12241064
1225   MDRV_SOUND_ADD(YM2151, 3579545)
1065   MDRV_SOUND_ADD(YM2151, SOUND_CLOCK)
12261066   MDRV_SOUND_CONFIG(ym2151_interface)
12271067   MDRV_SOUND_ROUTE(0, "mono", 0.60)
12281068   MDRV_SOUND_ROUTE(1, "mono", 0.60)
r1591r1592
12321072   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
12331073MACHINE_DRIVER_END
12341074
1235static MACHINE_DRIVER_START( toffy )
12361075
1076static MACHINE_DRIVER_START( darktowr )
1077   MDRV_IMPORT_FROM(ddragon)
1078
12371079   /* 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)
12411082
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
12491083   /* 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)
1084MACHINE_DRIVER_END
12561085
1257   MDRV_VIDEO_START(ddragon)
1258   MDRV_VIDEO_UPDATE(ddragon)
12591086
1260   MDRV_MACHINE_RESET(toffy)
1087static MACHINE_DRIVER_START( toffy )
1088   MDRV_IMPORT_FROM(ddragon)
12611089
1262   /* sound hardware */
1263   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1090   /* basic machine hardware */
1091   MDRV_CPU_REMOVE("sub")
12641092
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")
12691096MACHINE_DRIVER_END
12701097
1271/***************************************************************************
12721098
1273  Game driver(s)
12741099
1275***************************************************************************/
1100/*************************************
1101 *
1102 *  ROM definitions
1103 *
1104 *************************************/
12761105
12771106ROM_START( ddragon )
1278   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1107   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
12791108   ROM_LOAD( "21j-1-5.26",   0x08000, 0x08000, CRC(42045dfd) SHA1(0983705ea3bb87c4c239692f400e02f15c243479) )
12801109   ROM_LOAD( "21j-2-3.25",   0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */
12811110   ROM_LOAD( "21j-3.24",     0x18000, 0x08000, CRC(3bdea613) SHA1(d9038c80646a6ce3ea61da222873237b0383680e) ) /* banked at 0x4000-0x8000 */
r1591r1592
13161145ROM_END
13171146
13181147ROM_START( ddragonw )
1319   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1148   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
13201149   ROM_LOAD( "21j-1.26",     0x08000, 0x08000, CRC(ae714964) SHA1(072522b97ca4edd099c6b48d7634354dc7088c53) )
13211150   ROM_LOAD( "21j-2-3.25",   0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */
13221151   ROM_LOAD( "21a-3.24",     0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */
r1591r1592
13571186ROM_END
13581187
13591188ROM_START( ddragnw1 )
1360   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1189   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
13611190   ROM_LOAD( "e1-1.26",       0x08000, 0x08000, CRC(4b951643) SHA1(efb1f9ef2e46597d76123c9770854c1d83639eb2) )
13621191   ROM_LOAD( "21a-2-4.25",    0x10000, 0x08000, CRC(5cd67657) SHA1(96bc7a5354a76524bd43a4d7eb8b0053a89e39c4) ) /* banked at 0x4000-0x8000 */
13631192   ROM_LOAD( "21a-3.24",      0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */
r1591r1592
13981227ROM_END
13991228
14001229ROM_START( ddragonu )
1401   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1230   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
14021231   ROM_LOAD( "21a-1-5.26",   0x08000, 0x08000, CRC(e24a6e11) SHA1(9dd97dd712d5c896f91fd80df58be9b8a2b198ee) )
14031232   ROM_LOAD( "21j-2-3.25",   0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */
14041233   ROM_LOAD( "21a-3.24",     0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */
r1591r1592
14391268ROM_END
14401269
14411270ROM_START( ddragoua )
1442   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1271   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
14431272   ROM_LOAD( "21a-1",     0x08000, 0x08000, CRC(1d625008) SHA1(84cc19a55e7c91fca1943d9624d93e0347ed4150) )
14441273   ROM_LOAD( "21a-2_4",   0x10000, 0x08000, CRC(5cd67657) SHA1(96bc7a5354a76524bd43a4d7eb8b0053a89e39c4) ) /* banked at 0x4000-0x8000 */
14451274   ROM_LOAD( "21a-3",     0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */
r1591r1592
14801309ROM_END
14811310
14821311ROM_START( ddragonb ) /* Same program roms as the World set */
1483   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1312   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
14841313   ROM_LOAD( "21j-1.26",     0x08000, 0x08000, CRC(ae714964) SHA1(072522b97ca4edd099c6b48d7634354dc7088c53) )
14851314   ROM_LOAD( "21j-2-3.25",   0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */
14861315   ROM_LOAD( "21a-3.24",     0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */
r1591r1592
15201349   ROM_LOAD( "21j-l-0",      0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) )   /* unknown */
15211350ROM_END
15221351
1523
15241352ROM_START( ddragnba )
1525   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1353   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
15261354   ROM_LOAD( "5.bin",     0x08000, 0x08000, CRC(ae714964) SHA1(072522b97ca4edd099c6b48d7634354dc7088c53) )
15271355   ROM_LOAD( "4.bin",     0x10000, 0x08000, CRC(48045762) SHA1(ca39eea71ca76627a98210ce9cc61457a58f16b9) ) /* banked at 0x4000-0x8000 */
15281356   ROM_CONTINUE(0x20000,0x8000) /* banked at 0x4000-0x8000 */
r1591r1592
15621390   ROM_LOAD( "21j-l-0",      0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) )   /* unknown */
15631391ROM_END
15641392
1393
15651394ROM_START( ddragon2 )
1566   ROM_REGION( 0x28000, REGION_CPU1, 0 )
1395   ROM_REGION( 0x30000, REGION_CPU1, 0 )
15671396   ROM_LOAD( "26a9-04.bin",  0x08000, 0x8000, CRC(f2cfc649) SHA1(d3f1e0bae02472914a940222e4f600170a91736d) )
15681397   ROM_LOAD( "26aa-03.bin",  0x10000, 0x8000, CRC(44dd5d4b) SHA1(427c4e419668b41545928cfc96435c010ecdc88b) )
15691398   ROM_LOAD( "26ab-0.bin",   0x18000, 0x8000, CRC(49ddddcd) SHA1(91dc53718d04718b313f23d86e241027c89d1a03) )
r1591r1592
15991428ROM_END
16001429
16011430ROM_START( ddragn2u )
1602   ROM_REGION( 0x28000, REGION_CPU1, 0 )
1431   ROM_REGION( 0x30000, REGION_CPU1, 0 )
16031432   ROM_LOAD( "26a9-04.bin",  0x08000, 0x8000, CRC(f2cfc649) SHA1(d3f1e0bae02472914a940222e4f600170a91736d) )
16041433   ROM_LOAD( "26aa-03.bin",  0x10000, 0x8000, CRC(44dd5d4b) SHA1(427c4e419668b41545928cfc96435c010ecdc88b) )
16051434   ROM_LOAD( "26ab-0.bin",   0x18000, 0x8000, CRC(49ddddcd) SHA1(91dc53718d04718b313f23d86e241027c89d1a03) )
r1591r1592
16341463   ROM_LOAD( "prom.16",      0x0000, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) )   /* unknown (same as ddragon) */
16351464ROM_END
16361465
1637ROM_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 )
16411466
1642   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU? */
1643   ROM_LOAD( "u142.1", 0x00000, 0x10000, CRC(541bd7f0) SHA1(3f0097f5877eae50651f94d46d7dd9127037eb6e) )
1467ROM_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 */
16441473
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) )
16471476
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) )
16521479
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 */
16561509ROM_END
16571510
1658ROM_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 )
1511ROM_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 */
16621517
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) )
16651520
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) )
16681523
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) )
16721526
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 */
16761553ROM_END
16771554
1555
16781556ROM_START( ddungeon )
1679   ROM_REGION( 0x28000, REGION_CPU1, 0 ) /* Main CPU? */
1557   ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* Main CPU? */
16801558   ROM_LOAD( "dd3.bin", 0x10000, 0x8000, CRC(922e719c) SHA1(d1c73f56913cd368158abc613d7bbab669509742) )
16811559   ROM_LOAD( "dd2.bin", 0x08000, 0x8000, CRC(a6e7f608) SHA1(83b9301c39bfdc1e50a37f2bdc4d4f65a1111bee) )
16821560   /* IC23 is replaced with a daughterboard containing a 68705 MCU */
r1591r1592
17101588   ROM_LOAD( "21j-l-0",      0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) )   /* unknown */
17111589ROM_END
17121590
1591
17131592ROM_START( darktowr )
1714   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1593   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
17151594   ROM_LOAD( "dt.26",         0x08000, 0x08000, CRC(8134a472) SHA1(7d42d2ed8d09855241d98ed94bce140a314c2f66) )
17161595   ROM_LOAD( "21j-2-3.25",    0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* from ddragon */
17171596   ROM_LOAD( "dt.24",         0x18000, 0x08000, CRC(523a5413) SHA1(71c04287e4f2e792c98abdeb97fe70abd0d5e918) ) /* banked at 0x4000-0x8000 */
r1591r1592
17541633   ROM_LOAD( "21j-l-0",      0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) )   /* unknown */ /* from ddragon */
17551634ROM_END
17561635
1757ROM_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 */
17631636
1764   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sprite cpu */
1765   ROM_LOAD( "63701.bin",    0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) )
1637ROM_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 )
17661641
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) )
17691644
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) )
17721647
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) )
17751652
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) )
17991656ROM_END
18001657
1801ROM_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 */
1658ROM_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 )
18071662
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'
18101665
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) )
18131668
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
18161672
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
1676ROM_END
18191677
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) */
18291678
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) */
18351679
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 *************************************/
18391685
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 */
1843ROM_END
1686static 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}
18441693
1845/** INITS **
1846toffy / stoffy are 'encrytped
18471694
1848*/
1849
1850static void ddragon_restore_state(int dummy)
1695static DRIVER_INIT( ddragon2 )
18511696{
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;
18531701}
18541702
1855static MACHINE_START( ddragon )
1703
1704static DRIVER_INIT( darktowr )
18561705{
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);
18591711}
18601712
1713
18611714static DRIVER_INIT( toffy )
18621715{
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;
18661718
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);
18691723
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
18701730   /* 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);
18721735
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);
18751741
18761742   /* 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++)
18801746   {
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);
18831749   }
18841750
1885   /* and the sprites gfx */
1886   rom=memory_region(REGION_GFX2);
1751   /* should the sound rom be bitswapped too? */
1752}
18871753
1888   for (i = 0;i < 0x20000;i++)
1889      rom[i] = BITSWAP8(rom[i] , 7,6,5,4,3,2,0,1);
18901754
1891   /* should the sound rom be bitswapped too? */
18921755
1893}
1756/*************************************
1757 *
1758 *  Game drivers
1759 *
1760 *************************************/
18941761
1895GAME( 1987, ddragon,  0,        ddragon,  ddragon,  0, ROT0, "Technos", "Double Dragon (Japan)", 0 )
1896GAME( 1987, ddragonw, ddragon,  ddragon,  ddragon,  0, ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 1)", 0 )
1897GAME( 1987, ddragnw1, ddragon,  ddragon,  ddragon,  0, ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 2)", 0 )
1898GAME( 1987, ddragonu, ddragon,  ddragon,  ddragon,  0, ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 1)", 0 )
1899GAME( 1987, ddragoua, ddragon,  ddragon,  ddragon,  0, ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 2)", 0 )
1900GAME( 1987, ddragonb, ddragon,  ddragonb, ddragon,  0, ROT0, "bootleg", "Double Dragon (bootleg with HD6903)", 0 ) // according to dump notes
1901GAME( 1987, ddragnba, ddragon,  ddragnba, ddragon,  0, ROT0, "bootleg", "Double Dragon (bootleg with M6803)", 0 )
1762GAME( 1987, ddragon,  0,        ddragon,  ddragon,  ddragon,  ROT0, "Technos", "Double Dragon (Japan)", GAME_SUPPORTS_SAVE )
1763GAME( 1987, ddragonw, ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 1)", GAME_SUPPORTS_SAVE )
1764GAME( 1987, ddragnw1, ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos] (Taito license)", "Double Dragon (World Set 2)", GAME_SUPPORTS_SAVE )
1765GAME( 1987, ddragonu, ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 1)", GAME_SUPPORTS_SAVE )
1766GAME( 1987, ddragoua, ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 2)", GAME_SUPPORTS_SAVE )
1767GAME( 1987, ddragonb, ddragon,  ddragonb, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", GAME_SUPPORTS_SAVE ) // according to dump notes
1768GAME( 1987, ddragnba, ddragon,  ddragnba, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with M6803)", GAME_SUPPORTS_SAVE )
19021769
1903GAME( 1988, ddragon2, 0,        ddragon2, ddragon2, 0, ROT0, "Technos", "Double Dragon II - The Revenge (World)", 0 )
1904GAME( 1988, ddragn2u, ddragon2, ddragon2, ddragon2, 0, ROT0, "Technos", "Double Dragon II - The Revenge (US)", 0 )
1770GAME( 1988, ddragon2, 0,        ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (World)", GAME_SUPPORTS_SAVE )
1771GAME( 1988, ddragn2u, ddragon2, ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (US)", GAME_SUPPORTS_SAVE )
19051772
19061773/* these were conversions of double dragon */
1907GAME( 1991, tstrike,   0,        darktowr,  tstrike,   0, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Newer)", 0 )
1908GAME( 1991, tstrikea,  tstrike,  darktowr,  tstrike,   0, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Older)", 0 )
1909GAME( 1992, ddungeon,  0,        darktowr,  ddungeon,  0, ROT0, "East Coast Coin Company (Melbourne)", "Dangerous Dungeons", 0 )
1910GAME( 1992, darktowr,  0,        darktowr,  darktowr,  0, ROT0, "Game Room", "Dark Tower", 0 )
1774GAME( 1991, tstrike,  0,        darktowr, tstrike,  darktowr, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Newer)", GAME_SUPPORTS_SAVE )
1775GAME( 1991, tstrikea, tstrike,  darktowr, tstrike,  darktowr, ROT0, "East Coast Coin Company (Melbourne)", "Thunder Strike (Older)", GAME_SUPPORTS_SAVE )
1776GAME( 1992, ddungeon, 0,        darktowr, ddungeon, darktowr, ROT0, "East Coast Coin Company (Melbourne)", "Dangerous Dungeons", GAME_SUPPORTS_SAVE )
1777GAME( 1992, darktowr, 0,        darktowr, darktowr, darktowr, ROT0, "Game Room", "Dark Tower", GAME_SUPPORTS_SAVE )
19111778
19121779/* these run on their own board, but are basically the same game. Toffy even has 'dangerous dungeons' text in it */
1913GAME( 1993, toffy,  0, toffy, toffy, toffy, ROT0, "Midas",                 "Toffy", 0 )
1914GAME( 1994, stoffy, 0, toffy, toffy, toffy, ROT0, "Midas (Unico license)", "Super Toffy", 0 )
1780GAME( 1993, toffy,    0,        toffy,    toffy,    toffy,    ROT0, "Midas", "Toffy", GAME_SUPPORTS_SAVE )
1781GAME( 1994, stoffy,   0,        toffy,    toffy,    toffy,    ROT0, "Midas (Unico license)", "Super Toffy", GAME_SUPPORTS_SAVE )
src/mame/drivers/acommand.c
r1591r1592
508508static INTERRUPT_GEN( acommand_irq )
509509{
510510   if (cpu_getiloops() == 0)
511      cpunum_set_input_line(0, 2, HOLD_LINE);
511      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
512512   else if (cpu_getiloops() == 1)
513      cpunum_set_input_line(0, 3, HOLD_LINE);
513      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
514514}
515515
516516static MACHINE_DRIVER_START( acommand )
src/mame/drivers/asterix.c
r1591r1592
110110   // global interrupt masking
111111   if (!K056832_is_IRQ_enabled(0)) return;
112112
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
114114                                              mask used is 0 or 7 */
115115}
116116
r1591r1592
121121
122122static TIMER_CALLBACK( nmi_callback )
123123{
124   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
124   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
125125}
126126
127127static WRITE8_HANDLER( sound_arm_nmi_w )
128128{
129   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
129   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
130130   timer_set(ATTOTIME_IN_USEC(5), NULL,0,nmi_callback);
131131}
132132
133133static WRITE16_HANDLER( sound_irq_w )
134134{
135   cpunum_set_input_line(1, 0, HOLD_LINE);
135   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
136136}
137137
138138// Check the routine at 7f30 in the ead version.
src/mame/drivers/tubep.c
r1591r1592
167167
168168static WRITE8_HANDLER( main_cpu_irq_line_clear_w )
169169{
170   cpunum_set_input_line(0, 0, CLEAR_LINE);
170   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
171171   logerror("CPU#0 VBLANK int clear at scanline=%3i\n", curr_scanline);
172172   return;
173173}
r1591r1592
203203
204204static WRITE8_HANDLER( second_cpu_irq_line_clear_w )
205205{
206   cpunum_set_input_line(1, 0, CLEAR_LINE);
206   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
207207   logerror("CPU#1 VBLANK int clear at scanline=%3i\n", curr_scanline);
208208   return;
209209}
r1591r1592
238238
239239static READ8_HANDLER( tubep_sound_irq_ack )
240240{
241   cpunum_set_input_line(2, 0, CLEAR_LINE);
241   cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
242242   return 0;
243243}
244244
r1591r1592
281281   if (scanline==240)
282282   {
283283      logerror("VBLANK CPU#0\n");
284      cpunum_set_input_line(0, 0, ASSERT_LINE);
284      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
285285   }
286286
287287
r1591r1592
290290   if (scanline==16)
291291   {
292292      logerror("/VBLANK CPU#1\n");
293      cpunum_set_input_line(1, 0, ASSERT_LINE);
293      cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
294294   }
295295
296296
r1591r1592
300300   {
301301      logerror("/nmi CPU#3\n");
302302      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);
304304   }
305305   /* CPU #3 MS2010-A NMI */
306306   /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/
307307   if (scanline==240)
308308   {
309309      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);
311311   }
312312
313313
r1591r1592
315315   /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */
316316   if ((scanline==64) || (scanline==192))
317317   {
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) */
319319   }
320320
321321
r1591r1592
408408static WRITE8_HANDLER( rjammer_soundlatch_w )
409409{
410410   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);
412412}
413413
414414
r1591r1592
463463   if (scanline==240)
464464   {
465465      logerror("VBLANK CPU#0\n");
466      cpunum_set_input_line(0, 0, ASSERT_LINE);
466      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
467467   }
468468
469469
r1591r1592
472472   if (scanline==16)
473473   {
474474      logerror("/VBLANK CPU#1\n");
475      cpunum_set_input_line(1, 0, HOLD_LINE);
475      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
476476   }
477477
478478
r1591r1592
482482   {
483483      logerror("/nmi CPU#3\n");
484484      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);
486486   }
487487   /* CPU #3 MS2010-A NMI */
488488   /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/
489489   if (scanline==240)
490490   {
491491      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);
493493   }
494494
495495
r1591r1592
497497   /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */
498498   if ((scanline==64) || (scanline==192))
499499   {
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) */
501501   }
502502
503503
r1591r1592
571571   if (ls74==1)
572572   {
573573      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 );
575575   }
576576   else
577577   {
r1591r1592
593593            I do it here because this port (0x80) is first one accessed
594594            in the interrupt routine.
595595    */
596   cpunum_set_input_line(2, 0, CLEAR_LINE );
596   cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE );
597597   return;
598598}
599599
r1591r1592
936936   MDRV_CPU_PROGRAM_MAP(tubep_sound_map,0)
937937   MDRV_CPU_IO_MAP(tubep_sound_portmap,0)
938938
939   MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000 / 2)   /* 6 MHz Xtal - divided internally ??? */
939   MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000)   /* 6 MHz Xtal - divided internally ??? */
940940   MDRV_CPU_PROGRAM_MAP(nsc_map,0)
941941
942942   MDRV_SCREEN_REFRESH_RATE(60)
r1591r1592
980980
981981   MDRV_CPU_REMOVE("nsc")
982982
983   MDRV_CPU_ADD(M6802,6000000/4) /* ? MHz Xtal */
983   MDRV_CPU_ADD(M6802,6000000) /* ? MHz Xtal */
984984   MDRV_CPU_PROGRAM_MAP(nsc_map,0)
985985   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
986986MACHINE_DRIVER_END
r1591r1592
10021002   MDRV_CPU_PROGRAM_MAP(rjammer_sound_map,0)
10031003   MDRV_CPU_IO_MAP(rjammer_sound_portmap,0)
10041004
1005   MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000/4)   /* 6 MHz Xtal - divided internally ??? */
1005   MDRV_CPU_ADD_TAG("nsc",NSC8105,6000000)   /* 6 MHz Xtal - divided internally ??? */
10061006   MDRV_CPU_PROGRAM_MAP(nsc_map,0)
10071007
10081008   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/homedata.c
r1591r1592
233233static INTERRUPT_GEN( homedata_irq )
234234{
235235   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);
237237}
238238
239239static INTERRUPT_GEN( upd7807_irq )
240240{
241   cpunum_set_input_line(1,UPD7810_INTF1,HOLD_LINE);
241   cpunum_set_input_line(machine, 1,UPD7810_INTF1,HOLD_LINE);
242242}
243243
244244
r1591r1592
326326static WRITE8_HANDLER( mrokumei_sound_cmd_w )
327327{
328328   soundlatch_w(offset,data);
329   cpunum_set_input_line(1,0,HOLD_LINE);
329   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
330330}
331331
332332
src/mame/drivers/xxmissio.c
r1591r1592
4848
4949      case 0x40:
5050         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);
5252         break;
5353
5454      case 0x80:
r1591r1592
7171
7272      case 0x80:
7373         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);
7575         break;
7676   }
7777}
r1591r1592
7979static INTERRUPT_GEN( xxmissio_interrupt_m )
8080{
8181   xxmissio_status &= ~0x20;
82   cpunum_set_input_line(0, 0, HOLD_LINE);
82   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
8383}
8484
8585static INTERRUPT_GEN( xxmissio_interrupt_s )
8686{
8787   xxmissio_status &= ~0x10;
88   cpunum_set_input_line(1, 0, HOLD_LINE);
88   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
8989}
9090
9191static MACHINE_START( xxmissio )
src/mame/drivers/mugsmash.c
r1591r1592
6262   {
6363   case 1:
6464      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 );
6666      break;
6767
6868   default:
r1591r1592
418418
419419static void irq_handler(int irq)
420420{
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 );
422422}
423423
424424static const struct YM2151interface ym2151_interface =
src/mame/drivers/pcktgal.c
r1591r1592
4646static WRITE8_HANDLER( pcktgal_sound_w )
4747{
4848   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);
5050}
5151
5252static int msm5205next;
r1591r1592
6060
6161   toggle = 1 - toggle;
6262   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);
6464}
6565
6666static WRITE8_HANDLER( pcktgal_adpcm_data_w )
r1591r1592
461461
462462static DRIVER_INIT( pcktgal )
463463{
464   driver_init_deco222(machine);
465   driver_init_graphics(machine);
464   DRIVER_INIT_CALL(deco222);
465   DRIVER_INIT_CALL(graphics);
466466}
467467
468468/***************************************************************************/
src/mame/drivers/hng64.c
r1591r1592
14091409static DRIVER_INIT(hng64_fght)
14101410{
14111411   no_machine_error_code=0x01010101;
1412   driver_init_hng64(machine);
1412   DRIVER_INIT_CALL(hng64);
14131413}
14141414
14151415static DRIVER_INIT(hng64_race)
14161416{
14171417   no_machine_error_code=0x02020202;
1418   driver_init_hng64(machine);
1418   DRIVER_INIT_CALL(hng64);
14191419}
14201420
14211421
r1591r1592
14291429
14301430static TIMER_CALLBACK( irq_stop )
14311431{
1432   cpunum_set_input_line(0, 0, CLEAR_LINE);
1432   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
14331433}
14341434
14351435static INTERRUPT_GEN( irq_start )
r1591r1592
14471447      break;
14481448   }
14491449
1450   cpunum_set_input_line(0, 0, ASSERT_LINE);
1450   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
14511451   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
14521452}
14531453
r1591r1592
14621462   UINT8 *RAM = (UINT8*)hng64_soundram;
14631463   memory_set_bankptr(1,&RAM[0x1e0000]);
14641464   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);
14671467
14681468
14691469   /* Comm CPU */
r1591r1592
14801480   KL5C80_virtual_mem_sync();
14811481   memory_set_opbase_handler(2, KL5C80_opbase_handler);
14821482
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...
14851485
14861486
14871487
src/mame/drivers/solomon.c
r1591r1592
2424static WRITE8_HANDLER( solomon_sh_command_w )
2525{
2626   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);
2828}
2929
3030/* this is checked on the title screen and when you reach certain scores in the game
src/mame/drivers/macrossp.c
r1591r1592
279279      //logerror("%08x write soundcmd %08x (%08x)\n",activecpu_get_pc(),data,mem_mask);
280280      soundlatch_word_w(0,data >> 16,0);
281281      sndpending = 1;
282      cpunum_set_input_line(1,2,HOLD_LINE);
282      cpunum_set_input_line(Machine, 1,2,HOLD_LINE);
283283      /* spin for a while to let the sound CPU read the command */
284284      cpu_spinuntil_time(ATTOTIME_IN_USEC(50));
285285   }
r1591r1592
516516
517517   /* IRQ lines 1 & 4 on the sound 68000 are definitely triggered by the ES5506,
518518    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);
520520}
521521
522522static const struct ES5506interface es5506_interface =
src/mame/drivers/gladiatr.c
r1591r1592
290290static void gladiator_ym_irq(int irq)
291291{
292292   /* 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);
294294}
295295
296296/*Sound Functions*/
r1591r1592
309309static WRITE8_HANDLER( glad_cpu_sound_command_w )
310310{
311311   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);
313313}
314314
315315static READ8_HANDLER( glad_cpu_sound_command_r )
316316{
317   cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE);
317   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
318318   return soundlatch_r(0);
319319}
320320
r1591r1592
328328/* !!!!! patch to IRQ timming for 2nd CPU !!!!! */
329329static WRITE8_HANDLER( gladiatr_irq_patch_w )
330330{
331   cpunum_set_input_line(1,0,HOLD_LINE);
331   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
332332}
333333#endif
334334
src/mame/drivers/imolagp.c
r1591r1592
112112}
113113static READ8_HANDLER( trigger_slave_nmi_r )
114114{
115   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
115   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
116116   return 0;
117117}
118118
r1591r1592
365365      memcpy( &slave_workram[0x80], mComData, mComCount );
366366      mComCount = 0;
367367#endif
368      cpunum_set_input_line(0, 0, HOLD_LINE);
368      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
369369   }
370370   else
371371   {
r1591r1592
386386         {
387387            oldsteer = (oldsteer+1)&0xf;
388388         }
389         cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
389         cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
390390      }
391391   }
392392} /* master_interrupt */
src/mame/drivers/kinstb.c
r1591r1592
237237   MDRV_MACHINE_RESET( snes )
238238
239239   /* video hardware */
240   MDRV_VIDEO_START( generic_bitmapped )
241240   MDRV_VIDEO_UPDATE( snes )
242241
243242   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
r1591r1592
266265   {
267266      memory_region(REGION_USER3)[i]=BITSWAP8(memory_region(REGION_USER3)[i],5,0,6,1,7,4,3,2 );
268267   }
269   driver_init_snes_hirom(machine);
268   DRIVER_INIT_CALL(snes_hirom);
270269}
271270
272271ROM_START( kinstb )
src/mame/drivers/moo.c
r1591r1592
168168static TIMER_CALLBACK( dmaend_callback )
169169{
170170   if (cur_control2 & 0x800)
171      cpunum_set_input_line(0, 4, HOLD_LINE);
171      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
172172}
173173
174174static INTERRUPT_GEN(moo_interrupt)
r1591r1592
183183
184184   // trigger V-blank interrupt
185185   if (cur_control2 & 0x20)
186      cpunum_set_input_line(0, 5, HOLD_LINE);
186      cpunum_set_input_line(machine, 0, 5, HOLD_LINE);
187187}
188188
189189static INTERRUPT_GEN(moobl_interrupt)
r1591r1592
194194   timer_set(ATTOTIME_IN_USEC(MOO_DMADELAY), NULL, 0, dmaend_callback);
195195
196196   // trigger V-blank interrupt
197   cpunum_set_input_line(0, 5, HOLD_LINE);
197   cpunum_set_input_line(machine, 0, 5, HOLD_LINE);
198198}
199199
200200static WRITE16_HANDLER( sound_cmd1_w )
r1591r1592
214214
215215static WRITE16_HANDLER( sound_irq_w )
216216{
217   cpunum_set_input_line(1, 0, HOLD_LINE);
217   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
218218}
219219
220220static READ16_HANDLER( sound_status_r )
src/mame/drivers/skychut.c
r1591r1592
414414static READ8_HANDLER( iremm10_a700_r )
415415{
416416      //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);
418418   return 0x00;
419419}
420420
r1591r1592
434434{
435435    if (param==0)
436436    {
437       cpunum_set_input_line(0, 0, ASSERT_LINE);
437       cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
438438       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+16, 0), NULL, 1,skychut_callback);
439439    }
440440    if (param==1)
441441    {
442       cpunum_set_input_line(0, 0, ASSERT_LINE);
442       cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
443443       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+24, 0), NULL, 2,skychut_callback);
444444    }
445445    if (param==-1)
446       cpunum_set_input_line(0, 0, CLEAR_LINE);
446       cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
447447
448448}
449449
450450static INTERRUPT_GEN( iremm11_interrupt )
451451{
452452   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);
454454    else
455455    {
456       cpunum_set_input_line(0, 0, ASSERT_LINE);
456       cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
457457       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBEND, 0), NULL, -1,skychut_callback);
458458    }
459459}
r1591r1592
461461static INTERRUPT_GEN( iremm10_interrupt )
462462{
463463   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);
465465    else
466      cpunum_set_input_line(0, 0, ASSERT_LINE);
466      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
467467}
468468
469469static INTERRUPT_GEN( iremm15_interrupt )
470470{
471471   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);
473473    else
474474    {
475      cpunum_set_input_line(0, 0, ASSERT_LINE);
475      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
476476       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+1, 80), NULL, -1,skychut_callback);
477477    }
478478}
r1591r1592
777777   MDRV_COLORTABLE_LENGTH(2*8)
778778
779779   MDRV_PALETTE_INIT(skychut)
780   //MDRV_VIDEO_START(generic)
781780   MDRV_VIDEO_START(iremm10)
782781   MDRV_VIDEO_UPDATE(iremm10)
783782
src/mame/drivers/taito_l.c
r1591r1592
272272   if (cpu_getiloops() == 1 && (irq_enable & 1))
273273   {
274274      last_irq_level = 0;
275      cpunum_set_input_line(0, 0, HOLD_LINE);
275      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
276276   }
277277   else if (cpu_getiloops() == 2 && (irq_enable & 2))
278278   {
279279      last_irq_level = 1;
280      cpunum_set_input_line(0, 0, HOLD_LINE);
280      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
281281   }
282282   else if (cpu_getiloops() == 0 && (irq_enable & 4))
283283   {
284284      last_irq_level = 2;
285      cpunum_set_input_line(0, 0, HOLD_LINE);
285      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
286286   }
287287}
288288
r1591r1592
304304
305305   // fix Plotting test mode
306306   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);
308308}
309309
310310static READ8_HANDLER( irq_enable_r )
r1591r1592
10231023static WRITE8_HANDLER (evilston_snd_w)
10241024{
10251025   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);
10271027}
10281028
10291029
r1591r1592
22212221
22222222static void irqhandler(int irq)
22232223{
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);
22252225}
22262226
22272227static WRITE8_HANDLER( portA_w )
src/mame/drivers/groundfx.c
r1591r1592
107107
108108static TIMER_CALLBACK( groundfx_interrupt5 )
109109{
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
111111}
112112
113113
r1591r1592
400400static INTERRUPT_GEN( groundfx_interrupt )
401401{
402402   frame_counter^=1;
403   cpunum_set_input_line(0, 4, HOLD_LINE);
403   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
404404}
405405
406406static MACHINE_DRIVER_START( groundfx )
src/mame/drivers/fastlane.c
r1591r1592
2929   if (cpu_getiloops() == 0)
3030   {
3131      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);
3333   }
3434   else if (cpu_getiloops() % 2)
3535   {
3636      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);
3838   }
3939}
4040
r1591r1592
276276static MACHINE_DRIVER_START( fastlane )
277277
278278   /* basic machine hardware */
279   MDRV_CPU_ADD(HD6309, 3000000)      /* 24MHz/8? */
279   MDRV_CPU_ADD(HD6309, 3000000*4)      /* 24MHz/8? */
280280   MDRV_CPU_PROGRAM_MAP(fastlane_readmem,fastlane_writemem)
281281   MDRV_CPU_VBLANK_INT(fastlane_interrupt,16)   /* 1 IRQ + ??? NMI (generated by the 007121) */
282282
src/mame/drivers/gamecstl.c
r1591r1592
486486
487487static void set_gate_a20(int a20)
488488{
489   cpunum_set_input_line(0, INPUT_LINE_A20, a20);
489   cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20);
490490}
491491
492492static void keyboard_interrupt(int state)
src/mame/drivers/kangaroo.c
r1591r1592
142142   /* the copy protection. */
143143   /* Anyway, what I do here is just immediately generate the NMI, so the game */
144144   /* 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);
146146}
147147
148148
src/mame/drivers/cabal.c
r1591r1592
113113
114114static WRITE16_HANDLER( cabalbl_sound_irq_trigger_word_w )
115115{
116   cpunum_set_input_line( 1, INPUT_LINE_NMI, PULSE_LINE );
116   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE );
117117}
118118
119119
r1591r1592
515515
516516static void irqhandler(int irq)
517517{
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);
519519}
520520
521521static const struct YM2151interface cabalbl_ym2151_interface =
src/mame/drivers/cidelsa.c
r1591r1592
456456   switch (scanline)
457457   {
458458   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);
460460      cdp1869_prd = 1; // inverted
461461      break;
462462
463463   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);
465465      cdp1869_prd = 0; // inverted
466466      break;
467467   }
r1591r1592
503503
504504static MACHINE_RESET( destryer )
505505{
506   cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
506   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
507507}
508508
509509/* Machine Drivers */
src/mame/drivers/tickee.c
r1591r1592
5656static TIMER_CALLBACK( trigger_gun_interrupt )
5757{
5858   /* 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);
6060}
6161
6262
6363static TIMER_CALLBACK( clear_gun_interrupt )
6464{
6565   /* 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);
6767}
6868
6969
src/mame/drivers/hotblock.c
r1591r1592
173173
174174static INTERRUPT_GEN( hotblocks_irq ) /* right? */
175175{
176   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
176   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
177177}
178178
179179static const struct AY8910interface ay8910_interface =
src/mame/drivers/suprloco.c
r1591r1592
3232static WRITE8_HANDLER( suprloco_soundport_w )
3333{
3434   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);
3636   /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */
3737   cpu_spinuntil_time(ATTOTIME_IN_USEC(50));
3838}
src/mame/drivers/m92.c
r1591r1592
243243   if (scanline == m92_raster_irq_position)
244244   {
245245      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);
247247   }
248248
249249   /* VBLANK interrupt */
250250   else if (scanline == machine->screen[0].visarea.max_y + 1)
251251   {
252252      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);
254254   }
255255
256256   /* adjust for next scanline */
r1591r1592
323323      cpunum_set_input_line_vector(1, 0, 0x19);
324324
325325   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);
327327   else   /* IRQ pending */
328      cpunum_set_input_line(1, 0, ASSERT_LINE);
328      cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
329329}
330330
331331static WRITE16_HANDLER( m92_soundlatch_w )
r1591r1592
353353static WRITE16_HANDLER( m92_sound_status_w )
354354{
355355   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);
357357}
358358
359359/*****************************************************************************/
r1591r1592
947947
948948void m92_sprite_interrupt(void)
949949{
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);
951951}
952952
953953static MACHINE_DRIVER_START( m92 )
src/mame/drivers/hal21.c
r1591r1592
116116
117117   snk_sound_busy_bit = 0x20;
118118   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);
120120}
121121
122122/**************************************************************************/
r1591r1592
566566{
567567   snk_sound_busy_bit = 0x20;
568568   soundlatch_w(0, data);
569   cpunum_set_input_line( 2, 0, HOLD_LINE );
569   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE );
570570}
571571
572572static INTERRUPT_GEN( hal21_sound_interrupt )
src/mame/drivers/vendetta.c
r1591r1592
204204{
205205   if ( select & 1 )
206206   {
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);
211210   }
212211   else
213212   {
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 );
218215   }
219216}
220217
r1591r1592
237234
238235static TIMER_CALLBACK( z80_nmi_callback )
239236{
240   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE );
237   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE );
241238}
242239
243240static WRITE8_HANDLER( z80_arm_nmi_w )
244241{
245   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE );
242   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE );
246243
247244   timer_set( ATTOTIME_IN_USEC( 25 ), NULL, 0, z80_nmi_callback );
248245}
249246
250247static WRITE8_HANDLER( z80_irq_w )
251248{
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 );
253250}
254251
255252static READ8_HANDLER( vendetta_sound_interrupt_r )
256253{
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 );
258255   return 0x00;
259256}
260257
r1591r1592
574571static INTERRUPT_GEN( vendetta_irq )
575572{
576573   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);
578575}
579576
580577static MACHINE_DRIVER_START( vendetta )
src/mame/drivers/fcombat.c
r1591r1592
299299{
300300   /* Exerion triggers NMIs on coin insertion */
301301   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);
303303}
304304
305305/*************************************
src/mame/drivers/destroyr.c
r1591r1592
3737
3838   if (destroyr_potmask[dial])
3939   {
40      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
40      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
4141   }
4242}
4343
r1591r1592
8686
8787static WRITE8_HANDLER( destroyr_interrupt_ack_w )
8888{
89   cpunum_set_input_line(0, 0, CLEAR_LINE);
89   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9090}
9191
9292
src/mame/drivers/segas16b.c
r1591r1592
916916   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, MRA16_BANK12,          segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
917917   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, MRA16_BANK13,          MWA16_BANK13,          &segaic16_spriteram_0, "object RAM" },
918918   { 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" },
922922   { 0 }
923923};
924924
r1591r1592
930930   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, MRA16_BANK12,          segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
931931   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, MRA16_BANK13,          MWA16_BANK13,          &segaic16_spriteram_0, "object RAM" },
932932   { 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" },
936936   { 0 }
937937};
938938
r1591r1592
945945   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, MRA16_BANK13,          MWA16_BANK13,          &segaic16_spriteram_0, "object RAM" },
946946   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, MRA16_BANK14,          MWA16_BANK14,          &workram,              "work RAM" },
947947   { 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" },
950950   { 0 }
951951};
952952
r1591r1592
960960   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, MRA16_BANK14,          MWA16_BANK14,          &workram,              "work RAM" },
961961   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,                  rom_5704_bank_w,       NULL,                  "tile bank" },
962962   { 0x25/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,                  atomicp_sound_w,       NULL,                  "sound" },
963   { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, MRA16_BANK17,          MWA16_ROM,             NULL,                  "ROM 0" },
963   { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, MRA16_BANK17,          MWA16_UNMAP,           NULL,                  "ROM 0" },
964964   { 0 }
965965};
966966
r1591r1592
974974   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, MRA16_BANK14,          MWA16_BANK14,          &workram,              "work RAM" },
975975   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, unknown_rgn2_r,        unknown_rgn2_w,        NULL,                  "???" },
976976   { 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_ROM,             NULL,                  "ROM 0" },
977   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17,          MWA16_UNMAP,           NULL,                  "ROM 0" },
978978   { 0 }
979979};
980980
r1591r1592
10001000   if (has_sound_cpu)
10011001   {
10021002      soundlatch_w(0, data & 0xff);
1003      cpunum_set_input_line(1, 0, HOLD_LINE);
1003      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
10041004   }
10051005}
10061006
r1591r1592
10731073
10741074static TIMER_CALLBACK( atomicp_sound_irq )
10751075{
1076   cpunum_set_input_line(0, 2, HOLD_LINE);
1076   cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
10771077}
10781078
10791079
10801080static MACHINE_RESET( atomicp )
10811081{
1082   machine_reset_system16b(machine);
1082   MACHINE_RESET_CALL(system16b);
10831083   timer_pulse(ATTOTIME_IN_HZ(atomicp_sound_rate), NULL, 0, atomicp_sound_irq);
10841084}
10851085
r1591r1592
13031303static void upd7759_generate_nmi(int state)
13041304{
13051305   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);
13071307}
13081308
13091309
r1591r1592
13111311static WRITE8_HANDLER( mcu_data_w )
13121312{
13131313   mcu_data = data;
1314   cpunum_set_input_line(2, 1, PULSE_LINE);
1314   cpunum_set_input_line(Machine, 2, 1, PULSE_LINE);
13151315}
13161316#endif
13171317
r1591r1592
13421342   UINT16 temp;
13431343
13441344   /* 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);
13461346
13471347   /* set tile banks */
13481348   rom_5704_bank_w(1, workram[0x3094/2] & 0x00ff, 0xff00);
r1591r1592
13801380   UINT16 temp;
13811381
13821382   /* 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);
13841384
13851385   /* process any new sound data */
13861386   temp = workram[0x0bd0/2];
r1591r1592
14151415   UINT16 temp;
14161416
14171417   /* 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);
14191419
14201420   /* they periodically clear the data at 2cd8,2cda,2cdc,2cde and expect the MCU to fill it in */
14211421   if (workram[0x2cd8/2] == 0 && workram[0x2cda/2] == 0 && workram[0x2cdc/2] == 0 && workram[0x2cde/2] == 0)
r1591r1592
14451445   UINT16 temp;
14461446
14471447   /* 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);
14491449
14501450   /* process any new sound data */
14511451   temp = workram[0x01d0/2];
r1591r1592
14671467   UINT16 temp;
14681468
14691469   /* 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);
14711471
14721472   /* process any new sound data */
14731473   temp = workram[0x0008/2];
r1591r1592
14841484   UINT16 temp;
14851485
14861486   /* 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);
14881488
14891489   /* process any new sound data */
14901490   temp = workram[0x208e/2];
r1591r1592
59945994static DRIVER_INIT( aliensy3_5358 )
59955995{
59965996   void fd1089_decrypt_0033(void);
5997   driver_init_generic_5358(machine);
5997   DRIVER_INIT_CALL(generic_5358);
59985998   fd1089_decrypt_0033();
59995999}
60006000
60016001
60026002static DRIVER_INIT( altbeast_5521 )
60036003{
6004   driver_init_generic_5521(machine);
6004   DRIVER_INIT_CALL(generic_5521);
60056005   i8751_vblank_hook = altbeast_i8751_sim;
60066006}
60076007
60086008
60096009static DRIVER_INIT( altbeasj_5521 )
60106010{
6011   driver_init_generic_5521(machine);
6011   DRIVER_INIT_CALL(generic_5521);
60126012   i8751_vblank_hook = altbeasj_i8751_sim;
60136013}
60146014
60156015
60166016static DRIVER_INIT( altbeas5_5521 )
60176017{
6018   driver_init_generic_5521(machine);
6018   DRIVER_INIT_CALL(generic_5521);
60196019   i8751_vblank_hook = altbeas5_i8751_sim;
60206020}
60216021
60226022
60236023static DRIVER_INIT( altbeas4_5521 )
60246024{
6025   driver_init_generic_5521(machine);
6025   DRIVER_INIT_CALL(generic_5521);
60266026   mc8123_decrypt_rom(1, memory_region(REGION_USER2), 0, 0);
60276027}
60286028
r1591r1592
60306030static DRIVER_INIT( aurail1_5704 )
60316031{
60326032   void fd1089_decrypt_0168(void);
6033   driver_init_generic_5704(machine);
6033   DRIVER_INIT_CALL(generic_5704);
60346034   fd1089_decrypt_0168();
60356035}
60366036
r1591r1592
60386038static DRIVER_INIT( aurailj_5704 )
60396039{
60406040   void fd1089_decrypt_0167(void);
6041   driver_init_generic_5704(machine);
6041   DRIVER_INIT_CALL(generic_5704);
60426042   fd1089_decrypt_0167();
60436043}
60446044
60456045
60466046static DRIVER_INIT( ddux_5704 )
60476047{
6048   driver_init_generic_5704(machine);
6048   DRIVER_INIT_CALL(generic_5704);
60496049   i8751_vblank_hook = ddux_i8751_sim;
60506050}
60516051
r1591r1592
60536053static DRIVER_INIT( dunkshot_5358 )
60546054{
60556055   void fd1089_decrypt_0022(void);
6056   driver_init_generic_5358(machine);
6056   DRIVER_INIT_CALL(generic_5358);
60576057   fd1089_decrypt_0022();
60586058   custom_io_r = dunkshot_custom_io_r;
60596059}
r1591r1592
60616061
60626062static DRIVER_INIT( exctleag_5358 )
60636063{
6064   driver_init_generic_5358(machine);
6064   DRIVER_INIT_CALL(generic_5358);
60656065   custom_io_r = sdi_custom_io_r;
60666066}
60676067
60686068
60696069static DRIVER_INIT( goldnaxe_5704 )
60706070{
6071   driver_init_generic_5704(machine);
6071   DRIVER_INIT_CALL(generic_5704);
60726072   goldnaxe_i8751_init();
60736073   i8751_vblank_hook = goldnaxe_i8751_sim;
60746074}
r1591r1592
60766076
60776077static DRIVER_INIT( goldnaxe_5797 )
60786078{
6079   driver_init_generic_5797(machine);
6079   DRIVER_INIT_CALL(generic_5797);
60806080   goldnaxe_i8751_init();
60816081   i8751_vblank_hook = goldnaxe_i8751_sim;
60826082}
r1591r1592
60846084
60856085static DRIVER_INIT( hwchamp_5521 )
60866086{
6087   driver_init_generic_5521(machine);
6087   DRIVER_INIT_CALL(generic_5521);
60886088   custom_io_r = hwchamp_custom_io_r;
60896089   custom_io_w = hwchamp_custom_io_w;
60906090}
r1591r1592
60926092
60936093static DRIVER_INIT( sdi_5358 )
60946094{
6095   driver_init_generic_5358(machine);
6095   DRIVER_INIT_CALL(generic_5358);
60966096   custom_io_r = sdi_custom_io_r;
60976097}
60986098
60996099static DRIVER_INIT( defense_5358 )
61006100{
61016101   void fd1089_decrypt_0028(void);
6102   driver_init_generic_5358(machine);
6102   DRIVER_INIT_CALL(generic_5358);
61036103   fd1089_decrypt_0028();
61046104   custom_io_r = sdi_custom_io_r;
61056105}
r1591r1592
61076107
61086108static DRIVER_INIT( shinobi3_5358 )
61096109{
6110   driver_init_generic_5358(machine);
6110   DRIVER_INIT_CALL(generic_5358);
61116111   mc8123_decrypt_rom(1, memory_region(REGION_USER2), 0, 0);
61126112}
61136113
r1591r1592
61156115static DRIVER_INIT( sjryuko_5358 )
61166116{
61176117   void fd1089_decrypt_5021(void);
6118   driver_init_generic_5358(machine);
6118   DRIVER_INIT_CALL(generic_5358);
61196119   fd1089_decrypt_5021();
61206120   custom_io_r = sjryuko_custom_io_r;
61216121   custom_io_w = sjryuko_custom_io_w;
r1591r1592
61246124
61256125static DRIVER_INIT( passshtj_5358 )
61266126{
6127   driver_init_generic_5358(machine);
6127   DRIVER_INIT_CALL(generic_5358);
61286128   custom_io_r = passshtj_custom_io_r;
61296129}
61306130
61316131static DRIVER_INIT( tturf_5704 )
61326132{
6133   driver_init_generic_5704(machine);
6133   DRIVER_INIT_CALL(generic_5704);
61346134   i8751_vblank_hook = tturf_i8751_sim;
61356135}
61366136
61376137
61386138static DRIVER_INIT( tturf_5358 )
61396139{
6140   driver_init_generic_5358(machine);
6140   DRIVER_INIT_CALL(generic_5358);
61416141   i8751_vblank_hook = tturf_i8751_sim;
61426142}
61436143
61446144
61456145static DRIVER_INIT( wb3_5704 )
61466146{
6147   driver_init_generic_5704(machine);
6147   DRIVER_INIT_CALL(generic_5704);
61486148   i8751_vblank_hook = wb3_i8751_sim;
61496149}
61506150
61516151
61526152static DRIVER_INIT( wrestwar_8751 )
61536153{
6154   driver_init_generic_5704(machine);
6154   DRIVER_INIT_CALL(generic_5704);
61556155   i8751_vblank_hook = wrestwar_i8751_sim;
61566156}
61576157
src/mame/drivers/wwfwfest.c
r1591r1592
199199static WRITE16_HANDLER ( wwfwfest_soundwrite )
200200{
201201   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 );
203203}
204204
205205/*******************************************************************************
r1591r1592
369369
370370static INTERRUPT_GEN( wwfwfest_interrupt ) {
371371   if( cpu_getiloops() == 0 )
372      cpunum_set_input_line(0, 3, HOLD_LINE);
372      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
373373   else
374      cpunum_set_input_line(0, 2, HOLD_LINE);
374      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
375375}
376376
377377/*******************************************************************************
r1591r1592
382382
383383static void dd3_ymirq_handler(int irq)
384384{
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 );
386386}
387387
388388static const struct YM2151interface ym2151_interface =
src/mame/drivers/marineb.c
r1591r1592
4343static MACHINE_RESET( marineb )
4444{
4545   marineb_active_low_flipscreen = 0;
46   machine_reset_espial(machine);
46   MACHINE_RESET_CALL(espial);
4747}
4848
4949static MACHINE_RESET( springer )
5050{
5151   marineb_active_low_flipscreen = 1;
52   machine_reset_espial(machine);
52   MACHINE_RESET_CALL(espial);
5353}
5454
5555static ADDRESS_MAP_START( marineb_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/multigam.c
r1591r1592
224224
225225static void ppu_irq( int num, int *ppu_regs )
226226{
227   cpunum_set_input_line(num, INPUT_LINE_NMI, PULSE_LINE );
227   cpunum_set_input_line(Machine, num, INPUT_LINE_NMI, PULSE_LINE );
228228}
229229
230230/* our ppu interface                                            */
src/mame/drivers/atarigx2.c
r1591r1592
4747 *
4848 *************************************/
4949
50static void update_interrupts(void)
50static void update_interrupts(running_machine *machine)
5151{
5252   int newstate = 0;
5353
r1591r1592
5757      newstate = 5;
5858
5959   if (newstate)
60      cpunum_set_input_line(0, newstate, ASSERT_LINE);
60      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
6161   else
62      cpunum_set_input_line(0, 7, CLEAR_LINE);
62      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
6363}
6464
6565
r1591r1592
144144
145145   /* lower byte */
146146   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);
148148}
149149
150150
src/mame/drivers/fuukifg2.c
r1591r1592
7878   if (ACCESSING_LSB)
7979   {
8080      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);
8282//      cpu_spinuntil_time(ATTOTIME_IN_USEC(50));   // Allow the other CPU to reply
8383      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); // Fixes glitching in rasters
8484   }
r1591r1592
499499
500500static void soundirq(int state)
501501{
502   cpunum_set_input_line(1, 0, state);
502   cpunum_set_input_line(Machine, 1, 0, state);
503503}
504504
505505static const struct YM3812interface fuuki16_ym3812_intf =
r1591r1592
521521
522522static TIMER_CALLBACK( level_1_interrupt_callback )
523523{
524   cpunum_set_input_line(0, 1, PULSE_LINE);
524   cpunum_set_input_line(machine, 0, 1, PULSE_LINE);
525525   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
526526}
527527
528528
529529static TIMER_CALLBACK( vblank_interrupt_callback )
530530{
531   cpunum_set_input_line(0, 3, PULSE_LINE);   // VBlank IRQ
531   cpunum_set_input_line(machine, 0, 3, PULSE_LINE);   // VBlank IRQ
532532   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
533533}
534534
535535
536536static TIMER_CALLBACK( raster_interrupt_callback )
537537{
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
539539   video_screen_update_partial(0, video_screen_get_vpos(0));
540540   timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero);
541541}
src/mame/drivers/nwk-tr.c
r1591r1592
530530
531531static void voodoo_vblank_0(int param)
532532{
533   cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
533   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
534534}
535535
536536static VIDEO_START( nwktr )
r1591r1592
637637      {
638638         if (data & 0x80)   // CG Board 1 IRQ Ack
639639         {
640            //cpunum_set_input_line(0, INPUT_LINE_IRQ1, CLEAR_LINE);
640            //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
641641         }
642642         if (data & 0x40)   // CG Board 0 IRQ Ack
643643         {
644            //cpunum_set_input_line(0, INPUT_LINE_IRQ0, CLEAR_LINE);
644            //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
645645         }
646646      }
647647      return;
r1591r1592
765765static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 )
766766   AM_RANGE(0x00000000, 0x003fffff) AM_MIRROR(0x80000000) AM_RAM AM_BASE(&work_ram)      /* Work RAM */
767767   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(paletteram32_r, paletteram32_w) AM_BASE(&paletteram32)
768   AM_RANGE(0x74010000, 0x74017fff) AM_MIRROR(0x80000000) AM_READWRITE(MRA32_RAM, paletteram32_w) AM_BASE(&paletteram32)
769769   AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w)
770770   AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w)
771771   AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)
r1591r1592
900900
901901static MACHINE_RESET( nwktr )
902902{
903   cpunum_set_input_line(2, INPUT_LINE_RESET, ASSERT_LINE);
903   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
904904}
905905
906906static MACHINE_DRIVER_START( nwktr )
r1591r1592
971971static void sound_irq_callback(int irq)
972972{
973973   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);
977975   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);
981977}
982978
983979static DRIVER_INIT( nwktr )
r1591r1592
10291025   backup_ram[0x0e] = (checksum >> 8) & 0xff;   // checksum
10301026   backup_ram[0x0f] = (checksum >> 0) & 0xff;   // checksum
10311027
1032   driver_init_nwktr(machine);
1028   DRIVER_INIT_CALL(nwktr);
10331029}
10341030
10351031static DRIVER_INIT(racingj)
r1591r1592
10631059   backup_ram[0x0e] = (checksum >> 8) & 0xff;   // checksum
10641060   backup_ram[0x0f] = (checksum >> 0) & 0xff;   // checksum
10651061
1066   driver_init_nwktr(machine);
1062   DRIVER_INIT_CALL(nwktr);
10671063}
10681064
10691065static DRIVER_INIT(racingj2)
r1591r1592
10971093   backup_ram[0x0e] = (checksum >> 8) & 0xff;   // checksum
10981094   backup_ram[0x0f] = (checksum >> 0) & 0xff;   // checksum
10991095
1100   driver_init_nwktr(machine);
1096   DRIVER_INIT_CALL(nwktr);
11011097}
11021098
11031099
src/mame/drivers/vulgus.c
r1591r1592
5959
6060static INTERRUPT_GEN( vulgus_interrupt )
6161{
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 */
6466}
6567
6668
src/mame/drivers/shangha3.c
r1591r1592
105105   if (ACCESSING_LSB)
106106   {
107107      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 */
109109   }
110110}
111111
r1591r1592
484484
485485static void irqhandler(int linestate)
486486{
487   cpunum_set_input_line(1, INPUT_LINE_NMI, linestate);
487   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, linestate);
488488}
489489
490490static const struct YM3438interface ym3438_interface =
src/mame/drivers/pkscram.c
r1591r1592
8787
8888   if (!(out & 0x2000) && interrupt_line_active)
8989   {
90       cpunum_set_input_line(0, 1, CLEAR_LINE);
90       cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
9191      interrupt_line_active = 0;
9292   }
9393
r1591r1592
211211   if (param==interrupt_scanline)
212212   {
213213       if (out&0x2000)
214          cpunum_set_input_line(0, 1, ASSERT_LINE);
214          cpunum_set_input_line(machine, 0, 1, ASSERT_LINE);
215215      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, param+1, 0), param+1, attotime_zero);
216216      interrupt_line_active = 1;
217217   }
218218   else
219219   {
220220      if (interrupt_line_active)
221          cpunum_set_input_line(0, 1, CLEAR_LINE);
221          cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
222222      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero);
223223      interrupt_line_active = 0;
224224   }
r1591r1592
261261static void irqhandler(int irq)
262262{
263263   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);
265265}
266266
267267static const struct YM2203interface ym2203_interface =
src/mame/drivers/vastar.c
r1591r1592
8484static MACHINE_RESET( vastar )
8585{
8686   /* 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);
8888}
8989
9090static WRITE8_HANDLER( vastar_hold_cpu2_w )
9191{
9292   /* I'm not sure that this works exactly like this */
9393   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);
9595   else
96      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
96      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
9797}
9898
9999static READ8_HANDLER( vastar_sharedram_r )
src/mame/drivers/taotaido.c
r1591r1592
9494   {
9595      pending_command = 1;
9696      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);
9898   }
9999}
100100static ADDRESS_MAP_START( taotaido_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
346346
347347static void irqhandler(int irq)
348348{
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);
350350}
351351
352352static const struct YM2610interface ym2610_interface =
src/mame/drivers/relief.c
r1591r1592
4242 *
4343 *************************************/
4444
45static void update_interrupts(void)
45static void update_interrupts(running_machine *machine)
4646{
4747   int newstate = 0;
4848
r1591r1592
5050      newstate = 4;
5151
5252   if (newstate)
53      cpunum_set_input_line(0, newstate, ASSERT_LINE);
53      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
5454   else
55      cpunum_set_input_line(0, 7, CLEAR_LINE);
55      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
5656}
5757
5858
src/mame/drivers/gunpey.c
r1591r1592
113113
114114static INTERRUPT_GEN( gunpey_interrupt )
115115{
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);
117117}
118118
119119/***************************************************************************************/
src/mame/drivers/taito_f3.c
r1591r1592
118118
119119static WRITE32_HANDLER( f3_sound_reset_0_w )
120120{
121   cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
121   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
122122}
123123
124124static WRITE32_HANDLER( f3_sound_reset_1_w )
125125{
126   cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
126   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
127127}
128128
129129static WRITE32_HANDLER( f3_sound_bankswitch_w )
r1591r1592
387387
388388static TIMER_CALLBACK( f3_interrupt3 )
389389{
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?
391391}
392392
393393static INTERRUPT_GEN( f3_interrupt2 )
394394{
395   cpunum_set_input_line(0, 2, HOLD_LINE);   // vblank
395   cpunum_set_input_line(machine, 0, 2, HOLD_LINE);   // vblank
396396   timer_set( ATTOTIME_IN_CYCLES(10000,0), NULL, 0, f3_interrupt3);
397397}
398398
399399static MACHINE_RESET( f3 )
400400{
401401   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);
403403
404404   f3_68681_reset();
405405}
src/mame/drivers/gaelco2.c
r1591r1592
256256static INTERRUPT_GEN( bang_interrupt )
257257{
258258   if (cpu_getiloops() == 0){
259      cpunum_set_input_line(0, 2, HOLD_LINE);
259      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
260260
261261      clr_gun_int = 0;
262262   }
263263   else if (cpu_getiloops() % 2){
264264      if (clr_gun_int){
265         cpunum_set_input_line(0, 4, HOLD_LINE);
265         cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
266266      }
267267   }
268268}
src/mame/drivers/ninjakun.c
r0r1592
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
14Hold P1 Start after a reset to skip the startup memory tests.
15
16Change Log:
175 Mar - Added Saved State Support (DJH)
188 Jun - Added palette animation, Fixed FG priority. (Uki)
199 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
27extern UINT8 *ninjakun_fg_videoram;
28extern UINT8 *ninjakun_bg_videoram;
29
30WRITE8_HANDLER( ninjakun_bg_videoram_w );
31WRITE8_HANDLER( ninjakun_fg_videoram_w );
32READ8_HANDLER( ninjakun_bg_videoram_r );
33
34READ8_HANDLER( ninjakun_io_8000_r );
35WRITE8_HANDLER( ninjakun_io_8000_w );
36
37VIDEO_START( ninjakun );
38VIDEO_UPDATE( ninjakun );
39WRITE8_HANDLER( ninjakun_flipscreen_w );
40
41WRITE8_HANDLER( ninjakun_paletteram_w );
42
43
44/*******************************************************************************
45 0xA000 Read / Write Handlers
46*******************************************************************************/
47
48static UINT8 ninjakun_io_a002_ctrl;
49
50static READ8_HANDLER( ninjakun_io_A002_r )
51{
52   return ninjakun_io_a002_ctrl | readinputport(2); /* vblank */
53}
54
55static 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
61static 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
71static 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
81static 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)
95ADDRESS_MAP_END
96
97static 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 */
111ADDRESS_MAP_END
112
113/*******************************************************************************
114 GFX Decoding Information
115*******************************************************************************/
116
117static 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
128static 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
145static 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 )
149GFXDECODE_END
150
151/*******************************************************************************
152 Machine Driver Structure(s)
153*******************************************************************************/
154
155static 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)
191MACHINE_DRIVER_END
192
193/*******************************************************************************
194 Rom Definitions
195*******************************************************************************/
196
197ROM_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) )
218ROM_END
219
220/*******************************************************************************
221 Input Ports
222********************************************************************************
223 2 Sets of Controls
224 2 Sets of Dipsiwtches
225*******************************************************************************/
226
227static 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 ) )
300INPUT_PORTS_END
301
302/*******************************************************************************
303 Game Drivers
304*******************************************************************************/
305
306GAME( 1984, ninjakun, 0, ninjakun, ninjakun, 0, ROT0, "[UPL] (Taito license)", "Ninjakun Majou no Bouken", 0 )
src/mame/drivers/champbas.c
r1591r1592
8080static WRITE8_HANDLER( champbas_mcu_halt_w )
8181{
8282   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);
8484}
8585
8686/* champbja another protection */
src/mame/drivers/baraduke.c
r1591r1592
164164
165165static WRITE8_HANDLER( baraduke_irq_ack_w )
166166{
167   cpunum_set_input_line(0, 0, CLEAR_LINE);
167   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
168168}
169169
170170
r1591r1592
439439   MDRV_CPU_PROGRAM_MAP(baraduke_map,0)
440440   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
441441
442   MDRV_CPU_ADD(HD63701,49152000/32)
442   MDRV_CPU_ADD(HD63701,49152000/8)
443443   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
444444   MDRV_CPU_IO_MAP(mcu_port_map,0)
445445   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
src/mame/drivers/ssozumo.c
r1591r1592
5151static WRITE8_HANDLER( ssozumo_sh_command_w )
5252{
5353   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);
5555}
5656
5757
src/mame/drivers/beaminv.c
r1591r1592
8181   int next_interrupt_number;
8282   int next_vpos;
8383
84   cpunum_set_input_line(0, 0, HOLD_LINE);
84   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
8585
8686   /* set up for next interrupt */
8787   next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME;
src/mame/drivers/m107.c
r1591r1592
6363   if (scanline == m107_raster_irq_position)
6464   {
6565      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);
6767   }
6868
6969   /* VBLANK interrupt */
7070   else if (scanline == machine->screen[0].visarea.max_y + 1)
7171   {
7272      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);
7474   }
7575
7676   /* adjust for next scanline */
r1591r1592
112112      cpunum_set_input_line_vector(1,0,0x19);
113113
114114   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);
116116   else   /* IRQ pending */
117      cpunum_set_input_line(1,0,ASSERT_LINE);
117      cpunum_set_input_line(machine, 1,0,ASSERT_LINE);
118118}
119119
120120static WRITE16_HANDLER( m107_soundlatch_w )
r1591r1592
144144static WRITE16_HANDLER( m107_sound_status_w )
145145{
146146   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);
148148}
149149
150150/*****************************************************************************/
src/mame/drivers/ninjaw.c
r1591r1592
212212   /* bit 0 enables cpu B */
213213   /* however this fails when recovering from a save state
214214       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);
216216
217217}
218218
r1591r1592
570570/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
571571static void irqhandler(int irq)
572572{
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);
574574}
575575
576576static const struct YM2610interface ym2610_interface =
src/mame/drivers/matmania.c
r1591r1592
6060static WRITE8_HANDLER( matmania_sh_command_w )
6161{
6262   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);
6464}
6565
6666static WRITE8_HANDLER( matmania_dac_w )
r1591r1592
7272static WRITE8_HANDLER( maniach_sh_command_w )
7373{
7474   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);
7676}
7777
7878
r1591r1592
378378/* handler called by the 3526 emulator when the internal timers cause an IRQ */
379379static void irqhandler(int linestate)
380380{
381   cpunum_set_input_line(1,1,linestate);
381   cpunum_set_input_line(Machine, 1,1,linestate);
382382}
383383
384384static const struct YM3526interface ym3526_interface =
src/mame/drivers/twin16.c
r1591r1592
169169   if( twin16_CPUA_register!=old )
170170   {
171171      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 );
175173
176174      if( (old&0x40) && (twin16_CPUA_register&0x40)==0 )
177      {
178175         twin16_spriteram_process();
179      }
180176
181177      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
185180      coin_counter_w( 0, twin16_CPUA_register&0x01 );
186181      coin_counter_w( 1, twin16_CPUA_register&0x02 );
187182      coin_counter_w( 2, twin16_CPUA_register&0x04 );
r1591r1592
202197   {
203198      if( (old&0x01)==0 && (twin16_CPUB_register&0x1) )
204199      {
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 );
206201      }
207202   }
208203}
r1591r1592
214209   if( twin16_CPUA_register!=old )
215210   {
216211      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
218213   }
219214}
220215
r1591r1592
946941
947942static INTERRUPT_GEN( CPUA_interrupt )
948943{
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);
950945}
951946
952947static INTERRUPT_GEN( CPUB_interrupt )
953948{
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);
955950}
956951
957952/* Machine Drivers */
src/mame/drivers/megasys1.c
r1591r1592
190190{
191191   switch ( cpu_getiloops() )
192192   {
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;
196196   }
197197}
198198
r1591r1592
200200{
201201   switch ( cpu_getiloops() )
202202   {
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;
206206   }
207207}
208208
r1591r1592
218218   AM_RANGE(0x080006, 0x080007) AM_READ(dsw_r)
219219   AM_RANGE(0x080008, 0x080009) AM_READ(soundlatch2_word_r)   /* from sound cpu */
220220   AM_RANGE(0x084000, 0x084fff) AM_READ(MRA16_RAM)
221   AM_RANGE(0x088000, 0x0887ff) AM_READ(paletteram16_word_r)
221   AM_RANGE(0x088000, 0x0887ff) AM_READ(MRA16_RAM)
222222   AM_RANGE(0x08e000, 0x08ffff) AM_READ(MRA16_RAM)
223223   AM_RANGE(0x090000, 0x093fff) AM_READ(MRA16_RAM)
224224   AM_RANGE(0x094000, 0x097fff) AM_READ(MRA16_RAM)
r1591r1592
249249{
250250   switch (cpu_getiloops())
251251   {
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;
255255   }
256256}
257257
r1591r1592
298298static WRITE16_HANDLER( ip_select_w )
299299{
300300   COMBINE_DATA(&ip_select);
301   cpunum_set_input_line(0,2,HOLD_LINE);
301   cpunum_set_input_line(Machine, 0,2,HOLD_LINE);
302302}
303303
304304
r1591r1592
306306   ADDRESS_MAP_FLAGS( AMEF_ABITS(20) )
307307   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
308308   AM_RANGE(0x044000, 0x044fff) AM_READ(MRA16_RAM)
309   AM_RANGE(0x048000, 0x0487ff) AM_READ(paletteram16_word_r)
309   AM_RANGE(0x048000, 0x0487ff) AM_READ(MRA16_RAM)
310310   AM_RANGE(0x04e000, 0x04ffff) AM_READ(MRA16_RAM)
311311   AM_RANGE(0x050000, 0x053fff) AM_READ(MRA16_RAM)
312312   AM_RANGE(0x054000, 0x057fff) AM_READ(MRA16_RAM)
r1591r1592
348348   AM_RANGE(0x0e0000, 0x0e3fff) AM_READ(MRA16_RAM)
349349   AM_RANGE(0x0e8000, 0x0ebfff) AM_READ(MRA16_RAM)
350350   AM_RANGE(0x0f0000, 0x0f3fff) AM_READ(MRA16_RAM)
351   AM_RANGE(0x0f8000, 0x0f87ff) AM_READ(paletteram16_word_r)
351   AM_RANGE(0x0f8000, 0x0f87ff) AM_READ(MRA16_RAM)
352352   AM_RANGE(0x0d8000, 0x0d8001) AM_READ(ip_select_r)
353353   AM_RANGE(0x1f0000, 0x1fffff) AM_READ(MRA16_RAM)
354354ADDRESS_MAP_END
r1591r1592
376376#define INTERRUPT_NUM_D      1
377377static INTERRUPT_GEN( interrupt_D )
378378{
379   cpunum_set_input_line(0, 2, HOLD_LINE);
379   cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
380380}
381381
382382static ADDRESS_MAP_START( readmem_D, ADDRESS_SPACE_PROGRAM, 16 )
r1591r1592
385385   AM_RANGE(0x0ca000, 0x0cbfff) AM_READ(MRA16_RAM)
386386   AM_RANGE(0x0d0000, 0x0d3fff) AM_READ(MRA16_RAM)
387387   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)
390389   AM_RANGE(0x0e0000, 0x0e0001) AM_READ(dsw_r)
391390   AM_RANGE(0x0e8000, 0x0ebfff) AM_READ(MRA16_RAM)
392391   AM_RANGE(0x0f0000, 0x0f0001) AM_READ(coins_r) /* Coins + P1&P2 Buttons */
r1591r1592
401400   AM_RANGE(0x0ca000, 0x0cbfff) AM_WRITE(MWA16_RAM) AM_BASE(&megasys1_objectram)
402401   AM_RANGE(0x0d0000, 0x0d3fff) AM_WRITE(megasys1_scrollram_1_w) AM_BASE(&megasys1_scrollram[1])
403402   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)
406404   AM_RANGE(0x0e8000, 0x0ebfff) AM_WRITE(megasys1_scrollram_0_w) AM_BASE(&megasys1_scrollram[0])
407405   AM_RANGE(0x0f8000, 0x0f8001) AM_WRITE(OKIM6295_data_0_lsb_w)
408406//  { 0x100000, 0x100001  protection
r1591r1592
474472static void megasys1_sound_irq(int irq)
475473{
476474   if (irq)
477      cpunum_set_input_line(1, 4, HOLD_LINE);
475      cpunum_set_input_line(Machine, 1, 4, HOLD_LINE);
478476}
479477
480478static READ16_HANDLER( oki_status_0_r )
r1591r1592
810808
811809static void irq_handler(int irq)
812810{
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);
814812}
815813
816814
r1591r1592
29692967      }
29702968   }
29712969
2972   cpunum_set_input_line(0,4,HOLD_LINE);
2970   cpunum_set_input_line(Machine, 0,4,HOLD_LINE);
29732971}
29742972
29752973
src/mame/drivers/crshrace.c
r1591r1592
166166   {
167167      pending_command = 1;
168168      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);
170170   }
171171}
172172
r1591r1592
607607
608608static void irqhandler(int irq)
609609{
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);
611611}
612612
613613static const struct YM2610interface ym2610_interface =
src/mame/drivers/airbustr.c
r1591r1592
274274
275275static WRITE8_HANDLER( master_nmi_trigger_w )
276276{
277   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
277   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
278278}
279279
280280static void airbustr_bankswitch(int cpunum, int data)
r1591r1592
331331{
332332   soundlatch_w(0, data);
333333   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
335335}
336336
337337static WRITE8_HANDLER( soundcommand2_w )
r1591r1592
570570   static int addr = 0xff;
571571
572572   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);
574574}
575575
576576static INTERRUPT_GEN( slave_interrupt )
r1591r1592
578578   static int addr = 0xfd;
579579
580580   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);
582582}
583583
584584/* Machine Initialization */
src/mame/drivers/pacman.c
r1591r1592
387387static WRITE8_HANDLER( pacman_interrupt_vector_w )
388388{
389389   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);
391391}
392392
393393
r1591r1592
683683
684684static INTERRUPT_GEN( s2650_interrupt )
685685{
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);
687687}
688688
689689static WRITE8_HANDLER( porky_banking_w )
r1591r1592
824824
825825
826826static ADDRESS_MAP_START( mspacman_map, ADDRESS_SPACE_PROGRAM, 8 )
827   AM_RANGE(0x0000, 0x3fff) AM_READWRITE(MRA8_BANK1,MWA8_ROM)
827   AM_RANGE(0x0000, 0x3fff) AM_ROMBANK(1)
828828   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
829829   AM_RANGE(0x4400, 0x47ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_colorram_w) AM_BASE(&colorram)
830830   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READWRITE(pacman_read_nop,MWA8_NOP)
r1591r1592
846846   AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ(input_port_1_r)   /* IN1 */
847847   AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ(input_port_2_r)   /* DSW1 */
848848   AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_READ(input_port_3_r)   /* DSW2 */
849   AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK1,MWA8_ROM)
849   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
850850ADDRESS_MAP_END
851851
852852
r1591r1592
936936
937937
938938static ADDRESS_MAP_START( epos_map, ADDRESS_SPACE_PROGRAM, 8 )
939   AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x8000) AM_READWRITE(MRA8_BANK1,MWA8_ROM)
939   AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x8000) AM_ROMBANK(1)
940940   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
941941   AM_RANGE(0x4400, 0x47ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_colorram_w) AM_BASE(&colorram)
942942   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READWRITE(pacman_read_nop,MWA8_NOP)
r1591r1592
10691069
10701070
10711071static ADDRESS_MAP_START( mschamp_map, ADDRESS_SPACE_PROGRAM, 8 )
1072   AM_RANGE(0x0000, 0x3fff) AM_READWRITE(MRA8_BANK1,MWA8_ROM)
1072   AM_RANGE(0x0000, 0x3fff) AM_ROMBANK(1)
10731073   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
10741074   AM_RANGE(0x4400, 0x47ff) AM_MIRROR(0xa000) AM_READWRITE(MRA8_RAM,pacman_colorram_w) AM_BASE(&colorram)
10751075   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READWRITE(pacman_read_nop,MWA8_NOP)
r1591r1592
10911091   AM_RANGE(0x5040, 0x5040) AM_MIRROR(0xaf3f) AM_READ(input_port_1_r)   /* IN1 */
10921092   AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ(input_port_2_r)   /* DSW1 */
10931093   AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0xaf3f) AM_READ(input_port_3_r)   /* DSW2 */
1094   AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK2,MWA8_ROM)
1094   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(2)
10951095ADDRESS_MAP_END
10961096
10971097static ADDRESS_MAP_START( crushs_map, ADDRESS_SPACE_PROGRAM, 8 )
r1591r1592
53775377static DRIVER_INIT( cannonbp )
53785378{
53795379   /* 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));
53825382
53835383   /* protection? */
53845384   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, cannonbp_protection_r);
src/mame/drivers/dcheese.c
r1591r1592
6666   for (i = 4; i >= 0; i--)
6767      if (irq_state[i])
6868      {
69         cpunum_set_input_line(0, i, ASSERT_LINE);
69         cpunum_set_input_line(Machine, 0, i, ASSERT_LINE);
7070         return;
7171      }
7272
7373   /* otherwise, clear them all */
74   cpunum_set_input_line(0, 7, CLEAR_LINE);
74   cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
7575}
7676
7777
r1591r1592
157157   {
158158      /* write the latch and set the IRQ */
159159      soundlatch_full = 1;
160      cpunum_set_input_line(1, 0, ASSERT_LINE);
160      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
161161      soundlatch_w(0, data & 0xff);
162162   }
163163}
r1591r1592
174174{
175175   /* read the latch and clear the IRQ */
176176   soundlatch_full = 0;
177   cpunum_set_input_line(1, 0, CLEAR_LINE);
177   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
178178   return soundlatch_r(0);
179179}
180180
src/mame/drivers/chqflag.c
r1591r1592
2929   if (cpu_getiloops() == 0)
3030   {
3131      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);
3333   }
3434   else if (cpu_getiloops() % 2)
3535   {
3636      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);
3838   }
3939}
4040
r1591r1592
4848   memory_set_bankptr(4,&RAM[bankaddress]);
4949
5050   /* 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 */
6260   }
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 */
6865   }
6966
7067   /* other bits unknown/unused */
r1591r1592
138135
139136static WRITE8_HANDLER( chqflag_sh_irqtrigger_w )
140137{
141   cpunum_set_input_line(1,0,HOLD_LINE);
138   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
142139}
143140
144141
r1591r1592
323320
324321static void chqflag_ym2151_irq_w(int data)
325322{
326   cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
323   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
327324}
328325
329326
src/mame/drivers/bwing.c
r1591r1592
7272            latch_data = sound_fifo[fftail];
7373            fftail = (fftail + 1) & (MAX_SOUNDS - 1);
7474            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
7676         }
7777      break;
7878
7979      case 1:
8080         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); } }
8282         else
8383            coin = 0;
8484      break;
8585
8686      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);
8888      break;
8989   }
9090}
9191
9292
93static INTERRUPT_GEN ( bwp3_interrupt ) { if (!bwp3_nmimask) cpunum_set_input_line(2, INPUT_LINE_NMI, ASSERT_LINE); }
93static INTERRUPT_GEN ( bwp3_interrupt ) { if (!bwp3_nmimask) cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, ASSERT_LINE); }
9494
9595//****************************************************************************
9696// Memory and I/O Handlers
9797
9898static WRITE8_HANDLER( bwp12_sharedram1_w ) { bwp1_sharedram1[offset] = bwp2_sharedram1[offset] = data; }
9999static WRITE8_HANDLER( bwp3_u8F_w ) { bwp3_u8F_d = data; } // prepares custom chip for various operations
100static WRITE8_HANDLER( bwp3_nmiack_w ) { cpunum_set_input_line(2, INPUT_LINE_NMI, CLEAR_LINE); }
100static WRITE8_HANDLER( bwp3_nmiack_w ) { cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); }
101101static WRITE8_HANDLER( bwp3_nmimask_w ) { bwp3_nmimask = data & 0x80; }
102102
103103
r1591r1592
118118   switch (offset)
119119   {
120120      // 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;
122122
123123      // 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;
125125
126126      // 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;
128128
129129      // 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;
131131
132132      // SWAP(bank-swaps sprite RAM between 1800 & 1900; ignored bc. they're treated as a single chunk.)
133133      case 4: break;
r1591r1592
135135      // SNDREQ
136136      case 5:
137137         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
139139         else
140140         if (ffcount < MAX_SOUNDS)
141141         {
r1591r1592
162162{
163163   switch (offset)
164164   {
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
166166
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;
168168
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;
170170
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;
172172   }
173173
174174   #if BW_DEBUG
src/mame/drivers/srmp6.c
r1591r1592
700700static INTERRUPT_GEN(srmp6_interrupt)
701701{
702702   if(!cpu_getiloops())
703   {
704      cpunum_set_input_line(0,3,HOLD_LINE);
705   }
703      cpunum_set_input_line(machine, 0,3,HOLD_LINE);
706704   else
707   {
708      cpunum_set_input_line(0,4,HOLD_LINE);
709   }
705      cpunum_set_input_line(machine, 0,4,HOLD_LINE);
710706}
711707
712708static MACHINE_DRIVER_START( srmp6 )
src/mame/drivers/sf.c
r1591r1592
5353   if (ACCESSING_LSB)
5454   {
5555      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);
5757   }
5858}
5959
r1591r1592
800800
801801static void irq_handler(int irq)
802802{
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);
804804}
805805
806806static const struct YM2151interface ym2151_interface =
src/mame/drivers/lsasquad.c
r1591r1592
566566
567567static void irqhandler(int irq)
568568{
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);
570570}
571571
572572static WRITE8_HANDLER( unk )
src/mame/drivers/konamim2.c
r1591r1592
227227      if (data & 0x800000)
228228      {
229229         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);
231231      }
232232
233233      unk20004 = (UINT32)(data);
r1591r1592
322322   {
323323      if (data & U64(0x100000000))
324324      {
325         cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
325         cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
326326         unk3 = 0;
327327      }
328328   }
r1591r1592
10381038        irq_active |= 0x8;
10391039    }*/
10401040
1041   cpunum_set_input_line(0, INPUT_LINE_IRQ0, ASSERT_LINE);
1041   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
10421042}
10431043
10441044static MACHINE_DRIVER_START( m2 )
src/mame/drivers/cball.c
r1591r1592
5555{
5656   int scanline = param;
5757
58   cpunum_set_input_line(0, 0, PULSE_LINE);
58   cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
5959
6060   scanline = scanline + 32;
6161
src/mame/drivers/sengokmj.c
r1591r1592
280280
281281static INTERRUPT_GEN( sengokmj_interrupt )
282282{
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);
284284}
285285
286286static MACHINE_DRIVER_START( sengokmj )
src/mame/drivers/cham24.c
r1591r1592
214214
215215static void ppu_irq( int num, int *ppu_regs )
216216{
217   cpunum_set_input_line(num, INPUT_LINE_NMI, PULSE_LINE );
217   cpunum_set_input_line(Machine, num, INPUT_LINE_NMI, PULSE_LINE );
218218}
219219
220220/* our ppu interface                                            */
src/mame/drivers/cave.c
r1591r1592
9494static UINT8 agallet_vblank_irq;
9595
9696/* Update the IRQ state based on all possible causes */
97static void update_irq_state(void)
97static void update_irq_state(running_machine *machine)
9898{
9999   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);
101101   else
102      cpunum_set_input_line(0, irq_level, CLEAR_LINE);
102      cpunum_set_input_line(machine, 0, irq_level, CLEAR_LINE);
103103}
104104
105105static TIMER_CALLBACK( cave_vblank_start )
106106{
107107   vblank_irq = 1;
108   update_irq_state();
108   update_irq_state(machine);
109109   cave_get_sprite_info(machine);
110110   agallet_vblank_irq = 1;
111111}
r1591r1592
115115   if(cave_kludge == 3)   /* mazinger metmqstr */
116116   {
117117      unknown_irq = 1;
118      update_irq_state();
118      update_irq_state(machine);
119119   }
120120   agallet_vblank_irq = 0;
121121}
r1591r1592
131131static void sound_irq_gen(int state)
132132{
133133   sound_irq = (state != 0);
134   update_irq_state();
134   update_irq_state(Machine);
135135}
136136
137137
r1591r1592
161161   if (offset == 4/2)   vblank_irq = 0;
162162   if (offset == 6/2)   unknown_irq = 0;
163163
164   update_irq_state();
164   update_irq_state(Machine);
165165
166166/*
167167    sailormn and agallet wait for bit 2 of $b80001 to go 1 -> 0.
r1591r1592
221221//  sound_flag1 = 1;
222222//  sound_flag2 = 1;
223223   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);
225225   cpu_spinuntil_time(ATTOTIME_IN_USEC(50));   // Allow the other cpu to reply
226226}
227227
r1591r1592
19941994
19951995static void irqhandler(int irq)
19961996{
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);
19981998}
19991999
20002000static const struct YM2151interface ym2151_interface =
r1591r1592
42954295{
42964296   /* this patch fixes on of the moves, why is it needed? is the rom bad or is there another
42974297       problem? does the Japan set need it or not? */
4298   driver_init_pwrins2j(machine);
4298   DRIVER_INIT_CALL(pwrins2j);
42994299
43004300#if 1      //ROM PATCH
43014301   {
src/mame/drivers/dooyong.c
r1591r1592
899899
900900static void irqhandler(int irq)
901901{
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);
903903}
904904
905905static READ8_HANDLER( unk_r )
r1591r1592
11641164static INTERRUPT_GEN( rshark_interrupt )
11651165{
11661166   if (cpu_getiloops() == 0)
1167      cpunum_set_input_line(0, 5, HOLD_LINE);
1167      cpunum_set_input_line(machine, 0, 5, HOLD_LINE);
11681168   else
1169      cpunum_set_input_line(0, 6, HOLD_LINE);
1169      cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
11701170}
11711171
11721172static MACHINE_DRIVER_START( rshark )
src/mame/drivers/brkthru.c
r1591r1592
8787static WRITE8_HANDLER( brkthru_soundlatch_w )
8888{
8989   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);
9191}
9292
9393
r1591r1592
147147   if (cpu_getiloops() == 0)
148148   {
149149      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);
151151   }
152152   else
153153   {
154154      /* generate IRQ on coin insertion */
155155      if ((readinputportbytag("IN2") & 0xe0) != 0xe0)
156         cpunum_set_input_line(0, 0, HOLD_LINE);
156         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
157157   }
158158}
159159
r1591r1592
386386/* handler called by the 3812 emulator when the internal timers cause an IRQ */
387387static void irqhandler(int linestate)
388388{
389   cpunum_set_input_line(1,M6809_IRQ_LINE,linestate);
389   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,linestate);
390390}
391391
392392static const struct YM3526interface ym3526_interface =
src/mame/drivers/williams.c
r1591r1592
559559ADDRESS_MAP_END
560560
561561
562static 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
575ADDRESS_MAP_END
562576
577
578
563579/*************************************
564580 *
565581 *  Blaster memory handlers
r1591r1592
616632ADDRESS_MAP_END
617633
618634
635static 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
655ADDRESS_MAP_END
619656
657
658
620659/*************************************
621660 *
622661 *  Sound board memory handlers
r1591r1592
13701409   MDRV_CPU_ADD_TAG("main", M6809, MASTER_CLOCK/3/4)
13711410   MDRV_CPU_PROGRAM_MAP(defender_map,0)
13721411
1373   MDRV_CPU_ADD_TAG("sound", M6808, SOUND_CLOCK/4)
1412   MDRV_CPU_ADD_TAG("sound", M6808, SOUND_CLOCK)
13741413   MDRV_CPU_PROGRAM_MAP(defender_sound_map,0)
13751414
13761415   MDRV_MACHINE_RESET(defender)
r1591r1592
14181457MACHINE_DRIVER_END
14191458
14201459
1460static 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)
1467MACHINE_DRIVER_END
1468
1469
14211470static MACHINE_DRIVER_START( alienar )
14221471
14231472   /* basic machine hardware */
r1591r1592
14341483static MACHINE_DRIVER_START( sinistar )
14351484
14361485   /* basic machine hardware */
1437   MDRV_IMPORT_FROM(williams)
1486   MDRV_IMPORT_FROM(williams_extra_ram)
14381487
14391488   /* sound hardware */
14401489   MDRV_SOUND_ADD(HC55516, 0)
r1591r1592
14451494static MACHINE_DRIVER_START( playball )
14461495
14471496   /* basic machine hardware */
1448   MDRV_IMPORT_FROM(sinistar)
1497   MDRV_IMPORT_FROM(williams)
14491498
14501499   /* video hardware */
14511500   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)
14521505MACHINE_DRIVER_END
14531506
14541507
r1591r1592
14761529   MDRV_CPU_ADD_TAG("main", M6809, MASTER_CLOCK/3/4)
14771530   MDRV_CPU_PROGRAM_MAP(williams2_map,0)
14781531
1479   MDRV_CPU_ADD_TAG("sound", M6808, MASTER_CLOCK/3/4)   /* yes, this is different from the older games */
1532   MDRV_CPU_ADD_TAG("sound", M6808, MASTER_CLOCK/3)   /* yes, this is different from the older games */
14801533   MDRV_CPU_PROGRAM_MAP(williams2_sound_map,0)
14811534
14821535   MDRV_MACHINE_RESET(williams2)
r1591r1592
15021555MACHINE_DRIVER_END
15031556
15041557
1558static 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)
1565MACHINE_DRIVER_END
1566
1567
15051568static MACHINE_DRIVER_START( joust2 )
15061569
15071570   /* basic machine hardware */
r1591r1592
25932656{
25942657   CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0x7400);
25952658   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);
26032659}
26042660
26052661
r1591r1592
26762732{
26772733   CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000);
26782734   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);
26842736}
26852737
26862738
r1591r1592
26882740{
26892741   CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000);
26902742   CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT);
2691   CONFIGURE_PIAS(tshoot_pia_0_intf, williams2_pia_1_intf, tshoot_snd_pia_intf);
2743   CONFIGURE_PIAS(tshoot_pia_0_intf, tshoot_pia_1_intf, tshoot_snd_pia_intf);
26922744}
26932745
26942746
r1591r1592
26972749   CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000);
26982750   CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT);
26992751   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);
27042752}
27052753
27062754
r1591r1592
27202768 *************************************/
27212769
27222770/* Defender hardware games */
2723GAME( 1980, defender, 0,        defender, defender, defender, ROT0,   "Williams", "Defender (Red label)", GAME_SUPPORTS_SAVE )
2724GAME( 1980, defendg,  defender, defender, defender, defender, ROT0,   "Williams", "Defender (Green label)", GAME_SUPPORTS_SAVE )
2725GAME( 1980, defendw,  defender, defender, defender, defender, ROT0,   "Williams", "Defender (White label)", GAME_SUPPORTS_SAVE )
2726GAME( 1980, defndjeu, defender, defender, defender, defndjeu, ROT0,   "Jeutel", "Defender (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
2727GAME( 1980, tornado1, defender, defender, defender, defndjeu, ROT0,   "Jeutel", "Tornado (bootleg set 1)", GAME_SUPPORTS_SAVE )
2728GAME( 1980, tornado2, defender, defender, defender, defndjeu, ROT0,   "Jeutel", "Tornado (bootleg set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // bad dump?
2729GAME( 1980, zero,     defender, defender, defender, defndjeu, ROT0,   "Jeutel", "Zero", GAME_SUPPORTS_SAVE )
2730GAME( 1980, zero2,    defender, defender, defender, defndjeu, ROT0,   "Amtec", "Zero (set 2)", GAME_SUPPORTS_SAVE )
2731GAME( 1980, defcmnd,  defender, defender, defender, defender, ROT0,   "bootleg", "Defense Command (set 1)", GAME_SUPPORTS_SAVE )
2732GAME( 1981, defence,  defender, defender, defender, defender, ROT0,   "Outer Limits", "Defence Command", GAME_SUPPORTS_SAVE )
2733GAME( 1981, startrkd, defender, defender, defender, defender, ROT0,   "bootleg", "Star Trek (Defender bootleg)", GAME_SUPPORTS_SAVE )
2734GAME( 1980, mayday,   0,        defender, mayday,   mayday,   ROT0,   "<unknown>", "Mayday (set 1)", GAME_SUPPORTS_SAVE )
2735GAME( 1980, maydaya,  mayday,   defender, mayday,   mayday,   ROT0,   "<unknown>", "Mayday (set 2)", GAME_SUPPORTS_SAVE )
2736GAME( 1980, maydayb,  mayday,   defender, mayday,   mayday,   ROT0,   "<unknown>", "Mayday (set 3)", GAME_SUPPORTS_SAVE )
2737GAME( 1981, colony7,  0,        defender, colony7,  defender, ROT270, "Taito", "Colony 7 (set 1)", GAME_SUPPORTS_SAVE )
2738GAME( 1981, colony7a, colony7,  defender, colony7,  defender, ROT270, "Taito", "Colony 7 (set 2)", GAME_SUPPORTS_SAVE )
2739GAME( 1982, jin,      0,        jin,      jin,      defender, ROT90,  "Falcon", "Jin", GAME_SUPPORTS_SAVE )
2771GAME( 1980, defender, 0,        defender,            defender, defender, ROT0,   "Williams", "Defender (Red label)", GAME_SUPPORTS_SAVE )
2772GAME( 1980, defendg,  defender, defender,            defender, defender, ROT0,   "Williams", "Defender (Green label)", GAME_SUPPORTS_SAVE )
2773GAME( 1980, defendw,  defender, defender,            defender, defender, ROT0,   "Williams", "Defender (White label)", GAME_SUPPORTS_SAVE )
2774GAME( 1980, defndjeu, defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Defender (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
2775GAME( 1980, tornado1, defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Tornado (bootleg set 1)", GAME_SUPPORTS_SAVE )
2776GAME( 1980, tornado2, defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Tornado (bootleg set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // bad dump?
2777GAME( 1980, zero,     defender, defender,            defender, defndjeu, ROT0,   "Jeutel", "Zero", GAME_SUPPORTS_SAVE )
2778GAME( 1980, zero2,    defender, defender,            defender, defndjeu, ROT0,   "Amtec", "Zero (set 2)", GAME_SUPPORTS_SAVE )
2779GAME( 1980, defcmnd,  defender, defender,            defender, defender, ROT0,   "bootleg", "Defense Command (set 1)", GAME_SUPPORTS_SAVE )
2780GAME( 1981, defence,  defender, defender,            defender, defender, ROT0,   "Outer Limits", "Defence Command", GAME_SUPPORTS_SAVE )
2781GAME( 1981, startrkd, defender, defender,            defender, defender, ROT0,   "bootleg", "Star Trek (Defender bootleg)", GAME_SUPPORTS_SAVE )
2782GAME( 1980, mayday,   0,        defender,            mayday,   mayday,   ROT0,   "<unknown>", "Mayday (set 1)", GAME_SUPPORTS_SAVE )
2783GAME( 1980, maydaya,  mayday,   defender,            mayday,   mayday,   ROT0,   "<unknown>", "Mayday (set 2)", GAME_SUPPORTS_SAVE )
2784GAME( 1980, maydayb,  mayday,   defender,            mayday,   mayday,   ROT0,   "<unknown>", "Mayday (set 3)", GAME_SUPPORTS_SAVE )
2785GAME( 1981, colony7,  0,        defender,            colony7,  defender, ROT270, "Taito", "Colony 7 (set 1)", GAME_SUPPORTS_SAVE )
2786GAME( 1981, colony7a, colony7,  defender,            colony7,  defender, ROT270, "Taito", "Colony 7 (set 2)", GAME_SUPPORTS_SAVE )
2787GAME( 1982, jin,      0,        jin,                 jin,      defender, ROT90,  "Falcon", "Jin", GAME_SUPPORTS_SAVE )
27402788
27412789/* Standard Williams hardware */
2742GAME( 1981, stargate, 0,        williams, stargate, stargate, ROT0,   "Williams", "Stargate", GAME_SUPPORTS_SAVE )
2743GAME( 1982, robotron, 0,        williams, robotron, robotron, ROT0,   "Williams", "Robotron (Solid Blue label)", GAME_SUPPORTS_SAVE )
2744GAME( 1982, robotryo, robotron, williams, robotron, robotron, ROT0,   "Williams", "Robotron (Yellow/Orange label)", GAME_SUPPORTS_SAVE )
2745GAME( 1982, joust,    0,        williams, joust,    joust,    ROT0,   "Williams", "Joust (White/Green label)", GAME_SUPPORTS_SAVE )
2746GAME( 1982, joustr,   joust,    williams, joust,    joust,    ROT0,   "Williams", "Joust (Solid Red label)", GAME_SUPPORTS_SAVE )
2747GAME( 1982, joustwr,  joust,    williams, joust,    joust,    ROT0,   "Williams", "Joust (White/Red label)", GAME_SUPPORTS_SAVE )
2748GAME( 1982, bubbles,  0,        williams, bubbles,  bubbles,  ROT0,   "Williams", "Bubbles", GAME_SUPPORTS_SAVE )
2749GAME( 1982, bubblesr, bubbles,  williams, bubbles,  bubbles,  ROT0,   "Williams", "Bubbles (Solid Red label)", GAME_SUPPORTS_SAVE )
2750GAME( 1982, bubblesp, bubbles,  williams, bubbles,  bubbles,  ROT0,   "Williams", "Bubbles (prototype version)", GAME_SUPPORTS_SAVE )
2751GAME( 1982, splat,    0,        williams, splat,    splat,    ROT0,   "Williams", "Splat!", GAME_SUPPORTS_SAVE )
2752GAME( 1982, sinistar, 0,        sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 3)", GAME_SUPPORTS_SAVE )
2753GAME( 1982, sinista1, sinistar, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (prototype version)", GAME_SUPPORTS_SAVE )
2754GAME( 1982, sinista2, sinistar, sinistar, sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 2)", GAME_SUPPORTS_SAVE )
2755GAME( 1983, playball, 0,        playball, playball, playball, ROT270, "Williams", "PlayBall! (prototype)", GAME_SUPPORTS_SAVE )
2756GAME( 1983, blaster,  0,        blaster,  blaster,  blaster,  ROT0,   "Williams", "Blaster", GAME_SUPPORTS_SAVE )
2757GAME( 1983, blast30,  blaster,  blaster,  blaster,  blaster,  ROT0,   "Williams", "Blaster (early 30 wave version)", GAME_SUPPORTS_SAVE )
2758GAME( 1983, blastkit, blaster,  blaster,  blastkit, blastkit, ROT0,   "Williams", "Blaster (kit)", GAME_SUPPORTS_SAVE )
2759GAME( 1985, spdball,  0,        williams, spdball,  spdball,  ROT0,   "Williams", "Speed Ball (prototype)", GAME_SUPPORTS_SAVE )
2760GAME( 1985, alienar,  0,        alienar,  alienar,  alienar,  ROT0,   "Duncan Brown", "Alien Arena", GAME_SUPPORTS_SAVE )
2761GAME( 1985, alienaru, alienar,  alienar,  alienar,  alienaru, ROT0,   "Duncan Brown", "Alien Arena (Stargate Upgrade)", GAME_SUPPORTS_SAVE )
2762GAME( 1987, lottofun, 0,        williams, lottofun, lottofun, ROT0,   "H.A.R. Management", "Lotto Fun", GAME_SUPPORTS_SAVE )
2790GAME( 1981, stargate, 0,        williams,            stargate, stargate, ROT0,   "Williams", "Stargate", GAME_SUPPORTS_SAVE )
2791GAME( 1982, robotron, 0,        williams,            robotron, robotron, ROT0,   "Williams", "Robotron (Solid Blue label)", GAME_SUPPORTS_SAVE )
2792GAME( 1982, robotryo, robotron, williams,            robotron, robotron, ROT0,   "Williams", "Robotron (Yellow/Orange label)", GAME_SUPPORTS_SAVE )
2793GAME( 1982, joust,    0,        williams,            joust,    joust,    ROT0,   "Williams", "Joust (White/Green label)", GAME_SUPPORTS_SAVE )
2794GAME( 1982, joustr,   joust,    williams,            joust,    joust,    ROT0,   "Williams", "Joust (Solid Red label)", GAME_SUPPORTS_SAVE )
2795GAME( 1982, joustwr,  joust,    williams,            joust,    joust,    ROT0,   "Williams", "Joust (White/Red label)", GAME_SUPPORTS_SAVE )
2796GAME( 1982, bubbles,  0,        williams,            bubbles,  bubbles,  ROT0,   "Williams", "Bubbles", GAME_SUPPORTS_SAVE )
2797GAME( 1982, bubblesr, bubbles,  williams,            bubbles,  bubbles,  ROT0,   "Williams", "Bubbles (Solid Red label)", GAME_SUPPORTS_SAVE )
2798GAME( 1982, bubblesp, bubbles,  williams,            bubbles,  bubbles,  ROT0,   "Williams", "Bubbles (prototype version)", GAME_SUPPORTS_SAVE )
2799GAME( 1982, splat,    0,        williams,            splat,    splat,    ROT0,   "Williams", "Splat!", GAME_SUPPORTS_SAVE )
2800GAME( 1982, sinistar, 0,        sinistar,            sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 3)", GAME_SUPPORTS_SAVE )
2801GAME( 1982, sinista1, sinistar, sinistar,            sinistar, sinistar, ROT270, "Williams", "Sinistar (prototype version)", GAME_SUPPORTS_SAVE )
2802GAME( 1982, sinista2, sinistar, sinistar,            sinistar, sinistar, ROT270, "Williams", "Sinistar (revision 2)", GAME_SUPPORTS_SAVE )
2803GAME( 1983, playball, 0,        playball,            playball, playball, ROT270, "Williams", "PlayBall! (prototype)", GAME_SUPPORTS_SAVE )
2804GAME( 1983, blaster,  0,        blaster,             blaster,  blaster,  ROT0,   "Williams", "Blaster", GAME_SUPPORTS_SAVE )
2805GAME( 1983, blast30,  blaster,  blaster,             blaster,  blaster,  ROT0,   "Williams", "Blaster (early 30 wave version)", GAME_SUPPORTS_SAVE )
2806GAME( 1983, blastkit, blaster,  blaster,             blastkit, blastkit, ROT0,   "Williams", "Blaster (kit)", GAME_SUPPORTS_SAVE )
2807GAME( 1985, spdball,  0,        williams,            spdball,  spdball,  ROT0,   "Williams", "Speed Ball (prototype)", GAME_SUPPORTS_SAVE )
2808GAME( 1985, alienar,  0,        alienar,             alienar,  alienar,  ROT0,   "Duncan Brown", "Alien Arena", GAME_SUPPORTS_SAVE )
2809GAME( 1985, alienaru, alienar,  alienar,             alienar,  alienaru, ROT0,   "Duncan Brown", "Alien Arena (Stargate Upgrade)", GAME_SUPPORTS_SAVE )
2810GAME( 1987, lottofun, 0,        williams,            lottofun, lottofun, ROT0,   "H.A.R. Management", "Lotto Fun", GAME_SUPPORTS_SAVE )
27632811
27642812/* 2nd Generation Williams hardware with tilemaps */
2765GAME( 1983, mysticm,  0,        williams2,mysticm,  mysticm,  ROT0,   "Williams", "Mystic Marathon", GAME_SUPPORTS_SAVE )
2766GAME( 1984, tshoot,   0,        williams2,tshoot,   tshoot,   ROT0,   "Williams", "Turkey Shoot", GAME_SUPPORTS_SAVE )
2767GAME( 1984, inferno,  0,        williams2,inferno,  inferno,  ROT0,   "Williams", "Inferno", GAME_SUPPORTS_SAVE )
2768GAME( 1986, joust2,   0,        joust2,   joust2,   joust2,   ROT270, "Williams", "Joust 2 - Survival of the Fittest (set 1)", GAME_SUPPORTS_SAVE )
2813GAME( 1983, mysticm,  0,        williams2_extra_ram, mysticm,  mysticm,  ROT0,   "Williams", "Mystic Marathon", GAME_SUPPORTS_SAVE )
2814GAME( 1984, tshoot,   0,        williams2,           tshoot,   tshoot,   ROT0,   "Williams", "Turkey Shoot", GAME_SUPPORTS_SAVE )
2815GAME( 1984, inferno,  0,        williams2_extra_ram, inferno,  inferno,  ROT0,   "Williams", "Inferno", GAME_SUPPORTS_SAVE )
2816GAME( 1986, joust2,   0,        joust2,              joust2,   joust2,   ROT270, "Williams", "Joust 2 - Survival of the Fittest (set 1)", GAME_SUPPORTS_SAVE )
src/mame/drivers/fuukifg3.c
r1591r1592
538538
539539static TIMER_CALLBACK( level_1_interrupt_callback )
540540{
541   cpunum_set_input_line(0, 1, PULSE_LINE);
541   cpunum_set_input_line(machine, 0, 1, PULSE_LINE);
542542   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
543543}
544544
545545
546546static TIMER_CALLBACK( vblank_interrupt_callback )
547547{
548   cpunum_set_input_line(0, 3, PULSE_LINE);   // VBlank IRQ
548   cpunum_set_input_line(machine, 0, 3, PULSE_LINE);   // VBlank IRQ
549549   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
550550}
551551
552552
553553static TIMER_CALLBACK( raster_interrupt_callback )
554554{
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
556556   video_screen_update_partial(0, video_screen_get_vpos(0));
557557   timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero);
558558}
r1591r1592
574574
575575static void irqhandler(int irq)
576576{
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);
578578}
579579
580580static const struct YMF278B_interface ymf278b_interface =
src/mame/drivers/dec8.c
r1591r1592
237237   switch (offset) {
238238   case 0: /* High byte */
239239      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 */
241241      break;
242242   case 1: /* Low byte */
243243      i8751_value=(i8751_value&0xff00) | data;
r1591r1592
270270   switch (offset) {
271271   case 0: /* High byte */
272272      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 */
274274      break;
275275   case 1: /* Low byte */
276276      i8751_value=(i8751_value&0xff00) | data;
r1591r1592
298298   switch (offset) {
299299   case 0: /* High byte */
300300      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 */
302302      break;
303303   case 1: /* Low byte */
304304      i8751_value=(i8751_value&0xff00) | data;
r1591r1592
329329   switch (offset) {
330330   case 0: /* High byte */
331331      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 */
333333      break;
334334   case 1: /* Low byte */
335335      i8751_value=(i8751_value&0xff00) | data;
r1591r1592
426426static WRITE8_HANDLER( dec8_sound_w )
427427{
428428    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);
430430}
431431
432432static WRITE8_HANDLER( oscar_sound_w )
433433{
434434    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);
436436}
437437
438438static void csilver_adpcm_int(int data)
r1591r1592
441441
442442   toggle ^= 1;
443443   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);
445445
446446   MSM5205_data_w (0,msm5205next>>4);
447447   msm5205next<<=4;
r1591r1592
473473   /* Deal with interrupts, coins also generate NMI to CPU 0 */
474474   switch (offset) {
475475      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);
477477         return;
478478      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);
480480         return;
481481      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);
483483         return;
484484      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);
486486         return;
487487   }
488488}
r1591r1592
496496    (The last interrupt has not finished and been ack'd when the new one occurs */
497497   switch (offset) {
498498      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);
500500            return;
501501        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);
503503           return;
504504        case 2: /* i8751 - FIRQ acknowledge */
505505            return;
506506        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);
508508         return;
509509        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);
511511            return;
512512   }
513513#endif
r1591r1592
520520        case 2: /* i8751 - FIRQ acknowledge */
521521            return;
522522        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);
524524         return;
525525        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);
527527            return;
528528   }
529529}
r1591r1592
541541   AM_RANGE(0x0800, 0x0fff) AM_READ(dec8_pf0_data_r)
542542   AM_RANGE(0x1000, 0x17ff) AM_READ(dec8_pf1_data_r)
543543   AM_RANGE(0x1800, 0x2fff) AM_READ(MRA8_RAM)
544   AM_RANGE(0x3000, 0x31ff) AM_READ(paletteram_r)
544   AM_RANGE(0x3000, 0x31ff) AM_READ(MRA8_RAM)
545545   AM_RANGE(0x3800, 0x3800) AM_READ(input_port_0_r) /* Player 1 */
546546   AM_RANGE(0x3801, 0x3801) AM_READ(input_port_1_r) /* Player 2 */
547547   AM_RANGE(0x3802, 0x3802) AM_READ(input_port_3_r) /* Dip 1 */
r1591r1592
636636   AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_RAM)
637637   AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM)
638638   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)
641641   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM)          /* Sprites */
642642   AM_RANGE(0x3800, 0x3800) AM_READ(input_port_7_r)   /* Dip 1 */
643643   AM_RANGE(0x3801, 0x3801) AM_READ(input_port_8_r)   /* Dip 2 */
r1591r1592
672672   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
673673   AM_RANGE(0x2800, 0x2fff) AM_READ(dec8_pf0_data_r)
674674   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) /* Sprites */
675   AM_RANGE(0x3800, 0x3bff) AM_READ(paletteram_r)
675   AM_RANGE(0x3800, 0x3bff) AM_READ(MRA8_RAM)
676676   AM_RANGE(0x3c00, 0x3c00) AM_READ(input_port_0_r)
677677   AM_RANGE(0x3c01, 0x3c01) AM_READ(input_port_1_r)
678678   AM_RANGE(0x3c02, 0x3c02) AM_READ(input_port_2_r) /* VBL & coins */
r1591r1592
716716
717717static ADDRESS_MAP_START( lastmiss_readmem, ADDRESS_SPACE_PROGRAM, 8 )
718718   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)
721721   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)
722722   AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r)
723723   AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r)
r1591r1592
735735
736736static ADDRESS_MAP_START( lastmiss_writemem, ADDRESS_SPACE_PROGRAM, 8 )
737737   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)
740740   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
741741   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
742742   AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w)
r1591r1592
754754
755755static ADDRESS_MAP_START( lastmiss_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 )
756756   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)
759759   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)
760760   AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r)
761761   AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r)
r1591r1592
769769
770770static ADDRESS_MAP_START( lastmiss_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 )
771771   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)
774774   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
775775   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
776776   AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w)
r1591r1592
784784
785785static ADDRESS_MAP_START( shackled_readmem, ADDRESS_SPACE_PROGRAM, 8 )
786786   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)
789789   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)
790790   AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r)
791791   AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r)
r1591r1592
801801
802802static ADDRESS_MAP_START( shackled_writemem, ADDRESS_SPACE_PROGRAM, 8 )
803803   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)
806806   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
807807   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
808808   AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w)
r1591r1592
819819
820820static ADDRESS_MAP_START( shackled_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 )
821821   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)
824824   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)
825825   AM_RANGE(0x1801, 0x1801) AM_READ(input_port_1_r)
826826   AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r)
r1591r1592
837837
838838static ADDRESS_MAP_START( shackled_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 )
839839   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)
842842   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
843843   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
844844   AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w)
r1591r1592
856856
857857static ADDRESS_MAP_START( csilver_readmem, ADDRESS_SPACE_PROGRAM, 8 )
858858   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)
861861   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_1_r)
862862   AM_RANGE(0x1801, 0x1801) AM_READ(input_port_0_r)
863863   AM_RANGE(0x1803, 0x1803) AM_READ(input_port_2_r)
r1591r1592
875875
876876static ADDRESS_MAP_START( csilver_writemem, ADDRESS_SPACE_PROGRAM, 8 )
877877   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)
880880   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
881881   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
882882   AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w)
r1591r1592
893893
894894static ADDRESS_MAP_START( csilver_sub_readmem, ADDRESS_SPACE_PROGRAM, 8 )
895895   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)
898898   AM_RANGE(0x1803, 0x1803) AM_READ(input_port_2_r)
899899   AM_RANGE(0x1804, 0x1804) AM_READ(input_port_4_r)
900900   AM_RANGE(0x1805, 0x1805) AM_READ(input_port_3_r)
r1591r1592
907907
908908static ADDRESS_MAP_START( csilver_sub_writemem, ADDRESS_SPACE_PROGRAM, 8 )
909909   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)
912912   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
913913   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
914914   AM_RANGE(0x180c, 0x180c) AM_WRITE(oscar_sound_w)
r1591r1592
923923   AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_RAM)
924924   AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM)
925925   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)
928928   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM)          /* Sprites */
929929   AM_RANGE(0x3800, 0x3800) AM_READ(input_port_3_r)   /* Dip 1 */
930930   AM_RANGE(0x3801, 0x3801) AM_READ(input_port_4_r)   /* Dip 2 */
r1591r1592
20112011/* handler called by the 3812 emulator when the internal timers cause an IRQ */
20122012static void irqhandler(int linestate)
20132013{
2014   cpunum_set_input_line(1,0,linestate); /* M6502_IRQ_LINE */
2014   cpunum_set_input_line(Machine, 1,0,linestate); /* M6502_IRQ_LINE */
20152015}
20162016
20172017static void oscar_irqhandler(int linestate)
20182018{
2019   cpunum_set_input_line(2,0,linestate); /* M6502_IRQ_LINE */
2019   cpunum_set_input_line(Machine, 2,0,linestate); /* M6502_IRQ_LINE */
20202020}
20212021
20222022static const struct YM3526interface ym3526_interface =
r1591r1592
20532053   if ((i8751_out & 0x2) == 0x2) latch[2]=1;
20542054   if ((i8751_out & 0x1) == 0x1) latch[3]=1;
20552055
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 */
20602060
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 */
20622062}
20632063
20642064static INTERRUPT_GEN( gondo_interrupt )
20652065{
20662066   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 */
20682068}
20692069
20702070/* Coins generate NMI's */
r1591r1592
20752075   if ((readinputport(2) & 0x7) == 0x7) latch=1;
20762076   if (latch && (readinputport(2) & 0x7) != 0x7) {
20772077      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);
20792079    }
20802080}
20812081
r1591r1592
21232123static MACHINE_DRIVER_START( ghostb )
21242124
21252125   /* basic machine hardware */
2126   MDRV_CPU_ADD(HD6309, 3000000)
2126   MDRV_CPU_ADD(HD6309, 3000000*4)
21272127   MDRV_CPU_PROGRAM_MAP(ghostb_readmem,ghostb_writemem)
21282128   MDRV_CPU_VBLANK_INT(ghostb_interrupt,1)
21292129
r1591r1592
22032203static MACHINE_DRIVER_START( gondo )
22042204
22052205   /* basic machine hardware */
2206   MDRV_CPU_ADD(HD6309,3000000) /* HD63C09EP */
2206   MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP */
22072207   MDRV_CPU_PROGRAM_MAP(gondo_readmem,gondo_writemem)
22082208   MDRV_CPU_VBLANK_INT(gondo_interrupt,1)
22092209
r1591r1592
22432243static MACHINE_DRIVER_START( oscar )
22442244
22452245   /* basic machine hardware */
2246   MDRV_CPU_ADD(HD6309, XTAL_12MHz/8) /* verified on pcb */
2246   MDRV_CPU_ADD(HD6309, XTAL_12MHz/2) /* verified on pcb */
22472247   MDRV_CPU_PROGRAM_MAP(oscar_readmem,oscar_writemem)
22482248   MDRV_CPU_VBLANK_INT(oscar_interrupt,1)
22492249
2250   MDRV_CPU_ADD(HD6309, XTAL_12MHz/8) /* verified on pcb */
2250   MDRV_CPU_ADD(HD6309, XTAL_12MHz/2) /* verified on pcb */
22512251   MDRV_CPU_PROGRAM_MAP(oscar_sub_readmem,oscar_sub_writemem)
22522252
22532253   MDRV_CPU_ADD(M6502, XTAL_12MHz/8)
r1591r1592
24172417static MACHINE_DRIVER_START( garyoret )
24182418
24192419   /* basic machine hardware */
2420   MDRV_CPU_ADD(HD6309,3000000) /* HD63C09EP */
2420   MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP */
24212421   MDRV_CPU_PROGRAM_MAP(garyoret_readmem,garyoret_writemem)
24222422   MDRV_CPU_VBLANK_INT(gondo_interrupt,1)
24232423
r1591r1592
34073407
34083408static DRIVER_INIT( ghostb )
34093409{
3410   driver_init_deco222(machine);
3411   driver_init_meikyuh(machine);
3410   DRIVER_INIT_CALL(deco222);
3411   DRIVER_INIT_CALL(meikyuh);
34123412}
34133413
34143414/******************************************************************************/
src/mame/drivers/tbowl.c
r1591r1592
8686static WRITE8_HANDLER( tbowl_sound_command_w )
8787{
8888   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);
9090}
9191
9292
r1591r1592
151151static WRITE8_HANDLER ( tbowl_trigger_nmi )
152152{
153153   /* 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);
155155}
156156
157157static ADDRESS_MAP_START( readmem_6206C, ADDRESS_SPACE_PROGRAM, 8 )
r1591r1592
557557
558558static void irqhandler(int linestate)
559559{
560   cpunum_set_input_line(2,0,linestate);
560   cpunum_set_input_line(Machine, 2,0,linestate);
561561}
562562
563563static const struct YM3526interface ym3812_interface =
src/mame/drivers/battlane.c
r1591r1592
5959    /*
6060    if (~battlane_cpu_control & 0x08)
6161    {
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);
6464    }
6565    */
6666
r1591r1592
6868        CPU2's SWI will trigger an 6809 IRQ on the master by resetting 0x04
6969        Master will respond by setting the bit back again
7070    */
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);
7272
7373   /*
7474    Slave function call (e.g. ROM test):
r1591r1592
8686    FA96: 27 FA       BEQ   $FA92   ; Wait for bit to be set
8787    */
8888
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);
9090}
9191
9292static ADDRESS_MAP_START( battlane_map, ADDRESS_SPACE_PROGRAM, 8 )
r1591r1592
110110
111111   if (~battlane_cpu_control & 0x08)
112112   {
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);
115115   }
116116}
117117
r1591r1592
243243
244244static void irqhandler(int irq)
245245{
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);
247247}
248248
249249static const struct YM3526interface ym3526_interface =
src/mame/drivers/atarigt.c
r1591r1592
5454 *
5555 *************************************/
5656
57static void update_interrupts(void)
57static void update_interrupts(running_machine *machine)
5858{
5959   int newstate = 0;
6060
r1591r1592
6666      newstate = 6;
6767
6868   if (newstate)
69      cpunum_set_input_line(0, newstate, ASSERT_LINE);
69      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
7070   else
71      cpunum_set_input_line(0, 7, CLEAR_LINE);
71      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
7272}
7373
7474
src/mame/drivers/rbmk.c
r1591r1592
109109   AM_RANGE(0x500000, 0x50ffff) AM_RAM
110110   AM_RANGE(0x940000, 0x940fff) AM_RAM AM_BASE(&gms_vidram2)
111111   AM_RANGE(0x980300, 0x983fff) AM_RAM // 0x2048  words ???, byte access
112   AM_RANGE(0x900000, 0x900fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w)
113AM_READ(paletteram16_word_r) AM_BASE(&paletteram16)
112   AM_RANGE(0x900000, 0x900fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
114113   AM_RANGE(0x9c0000, 0x9c0fff) AM_RAM AM_BASE(&gms_vidram)
115114   AM_RANGE(0xb00000, 0xb00001) AM_WRITE(eeprom_w)
116   AM_RANGE(0xC00000, 0xC00001) AM_READ(input_port_0_word_r)
117AM_WRITE(gms_write1)
118   AM_RANGE(0xC08000, 0xC08001) AM_READ(input_port_1_word_r)
119AM_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)
120117   AM_RANGE(0xC10000, 0xC10001) AM_READ(eeprom_r)
121118   AM_RANGE(0xC18080, 0xC18081) AM_READ(gms_read)
122119   AM_RANGE(0xC20000, 0xC20001) AM_READ(input_port_2_word_r)
src/mame/drivers/genesis.c
r1591r1592
6767******************************************************************************/
6868
6969/* call this whenever the interrupt state has changed */
70static void update_interrupts(void)
70static void update_interrupts(running_machine *machine)
7171{
7272   int level = 0;
7373
r1591r1592
7878
7979   /* either set or clear the appropriate lines */
8080   if (level)
81      cpunum_set_input_line(0, level, ASSERT_LINE);
81      cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
8282   else
83      cpunum_set_input_line(0, 7, CLEAR_LINE);
83      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
8484}
8585
8686
r1591r1592
8888static TIMER_CALLBACK( vdp_int4_off )
8989{
9090   scanline_int = 0;
91   update_interrupts();
91   update_interrupts(machine);
9292}
9393
9494
r1591r1592
102102      if (scanline != 0 || genesis_vdp_regs[10] == 0)
103103      {
104104         scanline_int = 1;
105         update_interrupts();
105         update_interrupts(machine);
106106         timer_set(video_screen_get_time_until_pos(0, scanline + 1, 0), NULL, 0, vdp_int4_off);
107107      }
108108
r1591r1592
122122static TIMER_CALLBACK( vdp_int6_off )
123123{
124124   vblank_int = 0;
125   update_interrupts();
125   update_interrupts(machine);
126126}
127127
128128
r1591r1592
131131{
132132   /* generate the interrupt */
133133   vblank_int = 1;
134   update_interrupts();
134   update_interrupts(machine);
135135
136136   /* set a timer to turn it off */
137137   timer_set(video_screen_get_time_until_pos(0, video_screen_get_vpos(0), 22), NULL, 0, vdp_int6_off);
r1591r1592
142142void genesis_irq2_interrupt(int state)
143143{
144144   irq2_int = state;
145   update_interrupts();
145   update_interrupts(Machine);
146146}
147147
148148
r1591r1592
164164       genesis_z80_ram[0] = 0x76;
165165      genesis_z80_ram[0x38] = 0x76;
166166
167      cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
167      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
168168
169169      z80running = 0;
170170   }
r1591r1592
216216      if (data == 0x100)
217217      {
218218         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 */
220220         /* logerror("z80 stopped by 68k BusReq\n"); */
221221      }
222222      else
r1591r1592
224224         z80running = 1;
225225//          memory_set_bankptr(1, &genesis_z80_ram[0]);
226226
227         cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE);
227         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
228228         /* logerror("z80 started, BusReq ends\n"); */
229229      }
230230      return;
r1591r1592
232232   case 0x100:                  /* Z80 CPU Reset */
233233      if (data == 0x00)
234234      {
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);
237237
238         cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
238         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
239239         /* logerror("z80 reset, ram is %p\n", &genesis_z80_ram[0]); */
240240         z80running = 0;
241241         return;
src/mame/drivers/trvmadns.c
r1591r1592
184184   {
185185      if(activecpu_get_previouspc()==0x29e9)// || activecpu_get_previouspc()==0x1b3f) //29f5
186186      {
187         cpunum_set_input_line(0, 0, HOLD_LINE);
187         cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
188188      }
189189//      else
190190//          printf("%x \n", activecpu_get_previouspc());
src/mame/drivers/cloud9.c
r1591r1592
140140   /* assert the IRQ if not already asserted */
141141   if (!irq_state)
142142   {
143      cpunum_set_input_line(0, 0, ASSERT_LINE);
143      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
144144      irq_state = 1;
145145   }
146146
r1591r1592
211211
212212static MACHINE_RESET( cloud9 )
213213{
214   cpunum_set_input_line(0, 0, CLEAR_LINE);
214   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
215215   irq_state = 0;
216216}
217217
r1591r1592
227227{
228228   if (irq_state)
229229   {
230      cpunum_set_input_line(0, 0, CLEAR_LINE);
230      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
231231      irq_state = 0;
232232   }
233233}
src/mame/drivers/rpunch.c
r1591r1592
146146static void ym2151_irq_gen(int state)
147147{
148148   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);
150150}
151151
152152
r1591r1592
180180{
181181   sound_busy = 1;
182182   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);
184184}
185185
186186
r1591r1592
194194static READ8_HANDLER( sound_command_r )
195195{
196196   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);
198198   return sound_data;
199199}
200200
src/mame/drivers/changela.c
r1591r1592
465465
466466//    video_screen_update_partial(0, video_screen_get_vpos(0));
467467
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);
469469
470470   /* it seems the V8 == Vblank and it is connected to the INT on the 68705 */
471471   //so we should cause an INT on the cpu 1 here, as well.
472472   //but only once per frame !
473473   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 );
475475
476476}
477477
src/mame/drivers/crimfght.c
r1591r1592
3131static WRITE8_HANDLER( crimfght_sh_irqtrigger_w )
3232{
3333   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);
3535}
3636
3737static WRITE8_HANDLER( crimfght_snd_bankswitch_w )
r1591r1592
490490   int offs = 0;
491491
492492   /* 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);
496497   }
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 */
501500
502501   /* bit 6 = enable char ROM reading through the video RAM */
503502   K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
504503
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]);
507506}
508507
509508static MACHINE_RESET( crimfght )
src/mame/drivers/rabbit.c
r1591r1592
609609
610610static TIMER_CALLBACK( rabbit_blit_done )
611611{
612   cpunum_set_input_line(0, rabbit_bltirqlevel, HOLD_LINE);
612   cpunum_set_input_line(machine, 0, rabbit_bltirqlevel, HOLD_LINE);
613613}
614614
615615static void rabbit_do_blit(void)
r1591r1592
10611061      return;
10621062   }
10631063
1064   cpunum_set_input_line(0, intlevel, HOLD_LINE);
1064   cpunum_set_input_line(machine, 0, intlevel, HOLD_LINE);
10651065}
10661066
10671067static MACHINE_DRIVER_START( rabbit )
r1591r1592
11891189   else
11901190      intlevel = 3;
11911191
1192   cpunum_set_input_line(0, intlevel, HOLD_LINE);
1192   cpunum_set_input_line(machine, 0, intlevel, HOLD_LINE);
11931193}
11941194
11951195static MACHINE_DRIVER_START( tmmjprd )
src/mame/drivers/asuka.c
r1591r1592
236236
237237static TIMER_CALLBACK( cadash_interrupt5 )
238238{
239   cpunum_set_input_line(0, 5, HOLD_LINE);
239   cpunum_set_input_line(machine, 0, 5, HOLD_LINE);
240240}
241241
242242static INTERRUPT_GEN( cadash_interrupt )
243243{
244244   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 */
246246}
247247
248248
r1591r1592
812812
813813static void irq_handler(int irq)
814814{
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);
816816}
817817
818818static const struct YM2610interface ym2610_interface =
src/mame/drivers/triplhnt.c
r1591r1592
3131{
3232   triplhnt_hit_code = code;
3333
34   cpunum_set_input_line(0, 0, HOLD_LINE);
34   cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
3535}
3636
3737
src/mame/drivers/backfire.c
r1591r1592
478478
479479static INTERRUPT_GEN( deco32_vbl_interrupt )
480480{
481   cpunum_set_input_line(0, ARM_IRQ_LINE, HOLD_LINE);
481   cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, HOLD_LINE);
482482}
483483
484484
r1591r1592
690690   deco56_decrypt(REGION_GFX1); /* 141 */
691691   deco56_decrypt(REGION_GFX2); /* 141 */
692692   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 */
694694   descramble_sound();
695695   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
696696}
src/mame/drivers/rollerg.c
r1591r1592
5656
5757static WRITE8_HANDLER( soundirq_w )
5858{
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);
6060}
6161
6262static TIMER_CALLBACK( nmi_callback )
6363{
64   cpunum_set_input_line(1, INPUT_LINE_NMI, ASSERT_LINE);
64   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
6565}
6666
6767static WRITE8_HANDLER( sound_arm_nmi_w )
6868{
69   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
69   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
7070   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
7171}
7272
r1591r1592
8787   AM_RANGE(0x0300, 0x030f) AM_READ(K053244_r)
8888   AM_RANGE(0x0800, 0x0fff) AM_READ(rollerg_K051316_r)
8989   AM_RANGE(0x1000, 0x17ff) AM_READ(K053245_r)
90   AM_RANGE(0x1800, 0x1fff) AM_READ(paletteram_r)
90   AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM)
9191   AM_RANGE(0x2000, 0x3aff) AM_READ(MRA8_RAM)
9292   AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1)
9393   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)
src/mame/drivers/sidepckt.c
r1591r1592
3333static WRITE8_HANDLER( sound_cpu_command_w )
3434{
3535    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);
3737}
3838
3939static READ8_HANDLER( sidepckt_i8751_r )
r1591r1592
4848   static const int table_3[]={0xbd,0x73,0x80,0xbd,0x73,0xa7,0xbd,0x73,0xe0,0x7e,0x72,0x56,0xff,0xff,0xff,0xff};
4949   static int current_ptr=0,current_table=0,in_math=0,math_param;
5050
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 */
5252
5353   /* This function takes multiple parameters */
5454   if (in_math==1) {
r1591r1592
8989   static const int table_3[]={0xbd,0x71,0xc8,0xbd,0x71,0xef,0xbd,0x72,0x28,0x7e,0x70,0x9e,0xff,0xff,0xff,0xff};
9090   static int current_ptr=0,current_table=0,in_math,math_param;
9191
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 */
9393
9494   /* This function takes multiple parameters */
9595   if (in_math==1) {
r1591r1592
279279/* handler called by the 3526 emulator when the internal timers cause an IRQ */
280280static void irqhandler(int linestate)
281281{
282   cpunum_set_input_line(1,0,linestate);
282   cpunum_set_input_line(Machine, 1,0,linestate);
283283}
284284
285285static const struct YM3526interface ym3526_interface =
src/mame/drivers/starwars.c
r1591r1592
7777
7878static WRITE8_HANDLER( irq_ack_w )
7979{
80   cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE);
80   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
8181}
8282
8383
src/mame/drivers/wolfpack.c
r1591r1592
3838{
3939   int scanline = param;
4040
41   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
41   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
4242
4343   scanline += 64;
4444
src/mame/drivers/tankbatt.c
r1591r1592
106106   tankbatt_sound_enable = !data;
107107   if (data != 0)
108108   {
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);
111111   }
112112   /* hack - turn off the engine noise if the normal game nmi's are disabled */
113113   if (data) sample_stop (2);
r1591r1592
119119   tankbatt_nmi_enable = data;
120120   if (data != 0)
121121   {
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);
124124   }
125125//  interrupt_enable_w (offset, data);
126126}
r1591r1592
176176
177177static INTERRUPT_GEN( tankbatt_interrupt )
178178{
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);
181181}
182182
183183static INPUT_PORTS_START( tankbatt )
src/mame/drivers/exerion.c
r1591r1592
3636{
3737   /* Exerion triggers NMIs on coin insertion */
3838   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);
4040}
4141
4242
r1591r1592
473473      ram[addr] = (ram[addr] & 0xf9) | ((ram[addr] & 2) << 1) | ((ram[addr] & 4) >> 1);
474474
475475   /* also convert the gfx as in Exerion */
476   driver_init_exerion(machine);
476   DRIVER_INIT_CALL(exerion);
477477}
478478
479479
src/mame/drivers/segas18.c
r1591r1592
9999   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, MRA16_BANK14,          MWA16_BANK14,          &workram,              "work RAM" },
100100   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,                  NULL,                  NULL,                  "????" },
101101   { 0x25/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,         genesis_vdp_w,         NULL,                  "VDP" },
102   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17,          MWA16_ROM,             NULL,                  "ROM 0" },
102   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, MRA16_BANK17,          MWA16_UNMAP,           NULL,                  "ROM 0" },
103103   { 0 }
104104};
105105
r1591r1592
112112   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, MRA16_BANK13,          MWA16_BANK13,          &segaic16_spriteram_0, "object RAM" },
113113   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, MRA16_BANK14,          MWA16_BANK14,          &workram,              "work RAM" },
114114   { 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" },
117117   { 0 }
118118};
119119
r1591r1592
127127   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, MRA16_BANK14,          MWA16_BANK14,          &workram,              "work RAM" },
128128   { 0x29/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,         genesis_vdp_w,         NULL,                  "VDP" },
129129   { 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_ROM,             NULL,                  "ROM 0" },
130   { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, MRA16_BANK17,          MWA16_UNMAP,           NULL,                  "ROM 0" },
131131   { 0 }
132132};
133133
r1591r1592
149149static void sound_w(UINT8 data)
150150{
151151   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);
153153}
154154
155155
r1591r1592
555555static WRITE8_HANDLER( mcu_data_w )
556556{
557557   mcu_data = data;
558   cpunum_set_input_line(2, 1, PULSE_LINE);
558   cpunum_set_input_line(Machine, 2, 1, PULSE_LINE);
559559}
560560
561561
r1591r1592
22122212
22132213static DRIVER_INIT( ddcrew )
22142214{
2215   driver_init_generic_5987(machine);
2215   DRIVER_INIT_CALL(generic_5987);
22162216   custom_io_r = ddcrew_custom_io_r;
22172217}
22182218
22192219static DRIVER_INIT( lghost )
22202220{
2221   driver_init_generic_5987(machine);
2221   DRIVER_INIT_CALL(generic_5987);
22222222   custom_io_r = lghost_custom_io_r;
22232223   custom_io_w = lghost_custom_io_w;
22242224}
22252225
22262226static DRIVER_INIT( wwally )
22272227{
2228   driver_init_generic_5987(machine);
2228   DRIVER_INIT_CALL(generic_5987);
22292229   custom_io_r = wwally_custom_io_r;
22302230   custom_io_w = wwally_custom_io_w;
22312231}
src/mame/drivers/meijinsn.c
r1591r1592
283283static INTERRUPT_GEN( meijinsn_interrupt )
284284{
285285   if (cpu_getiloops() == 0)
286      cpunum_set_input_line(0, 1, HOLD_LINE);
286      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
287287   else
288      cpunum_set_input_line(0, 2, HOLD_LINE);
288      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
289289}
290290
291291static const struct AY8910interface ay8910_interface =
src/mame/drivers/crospang.c
r1591r1592
392392
393393static void irqhandler(int linestate)
394394{
395   cpunum_set_input_line(1,0,linestate);
395   cpunum_set_input_line(Machine, 1,0,linestate);
396396}
397397
398398static const struct YM3812interface ym3812_interface =
src/mame/drivers/royalmah.c
r1591r1592
33543354static INTERRUPT_GEN( suzume_irq )
33553355{
33563356   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);
33583358}
33593359
33603360static MACHINE_DRIVER_START( suzume )
r1591r1592
34043404{
34053405   switch(cpu_getiloops())
34063406   {
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
34103410   }
34113411}
34123412
r1591r1592
34473447{
34483448   switch(cpu_getiloops())
34493449   {
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
34523452   }
34533453}
34543454
src/mame/drivers/subs.c
r1591r1592
215215
216216
217217   MDRV_PALETTE_INIT(subs)
218   MDRV_VIDEO_START(generic)
219218   MDRV_VIDEO_UPDATE(subs)
220219
221220
src/mame/drivers/coolridr.c
r1591r1592
149149static INTERRUPT_GEN( system_h1 )
150150{
151151   if (cpu_getiloops())
152   {
153      cpunum_set_input_line(0, 4, HOLD_LINE);
154   }
152      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
155153   else
156   {
157      cpunum_set_input_line(0, 3, HOLD_LINE);
158   }
154      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
159155}
160156
161157// not sure on SH-1
r1591r1592
163159{
164160   if (cpu_getiloops())
165161   {
166//      cpunum_set_input_line(2, 4, HOLD_LINE);
162//      cpunum_set_input_line(machine, 2, 4, HOLD_LINE);
167163   }
168164   else
169165   {
170//      cpunum_set_input_line(2, 3, HOLD_LINE);
166//      cpunum_set_input_line(machine, 2, 3, HOLD_LINE);
171167   }
172168}
173169
174170static MACHINE_RESET ( coolridr )
175171{
176172
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);
179175
180176}
181177
src/mame/drivers/darkmist.c
r1591r1592
239239static INTERRUPT_GEN( darkmist_interrupt )
240240{
241241   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);
245243   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);
249245}
250246
251247
src/mame/drivers/exctsccr.c
r1591r1592
116116   const int *p;
117117
118118   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);
120120   if( (p=mcu_patch_data) != NULL)
121121   {
122122      /* patch MCU program */
src/mame/drivers/mquake.c
r1591r1592
4545
4646   else
4747      /* overlay enabled, map Amiga system ROM on 0x000000 */
48      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_ROM);
48      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, MWA16_UNMAP);
4949}
5050
5151
r1591r1592
338338   /* set ES5503 wave memory (this is banked in 64k increments) */
339339   ES5503_set_base_0(memory_region(REGION_SOUND1));
340340
341   machine_reset_amiga(machine);
341   MACHINE_RESET_CALL(amiga);
342342}
343343
344344/*************************************
src/mame/drivers/funybubl.c
r1591r1592
8080static WRITE8_HANDLER( funybubl_soundcommand_w )
8181{
8282   soundlatch_w(0,data);
83   cpunum_set_input_line(1,0, HOLD_LINE);
83   cpunum_set_input_line(Machine, 1,0, HOLD_LINE);
8484}
8585
8686static WRITE8_HANDLER( funybubl_oki_bank_sw )
src/mame/drivers/rotaryf.c
r1591r1592
2828static INTERRUPT_GEN( rotaryf_interrupt )
2929{
3030   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);
3232   else
33      cpunum_set_input_line(0, I8085_RST75_LINE,HOLD_LINE);
33      cpunum_set_input_line(machine, 0, I8085_RST75_LINE, HOLD_LINE);
3434
3535}
3636
r1591r1592
148148static MACHINE_DRIVER_START( rotaryf )
149149
150150   /* basic machine hardware */
151   MDRV_CPU_ADD_TAG("main",8085A,2000000) /* 8080? */ /* 2 MHz? */
151   MDRV_CPU_ADD_TAG("main",8085A,4000000) /* 8080? */ /* 2 MHz? */
152152   MDRV_CPU_PROGRAM_MAP(rotaryf_map,0)
153153   MDRV_CPU_IO_MAP(rotaryf_io_map,0)
154154   MDRV_CPU_VBLANK_INT(rotaryf_interrupt,5)
src/mame/drivers/nmk16.c
r1591r1592
266266
267267static MACHINE_RESET( mustang_sound )
268268{
269   machine_reset_seibu_sound_1(machine);
269   MACHINE_RESET_CALL(seibu_sound_1);
270270}
271271
272272static WRITE16_HANDLER ( ssmissin_sound_w )
r1591r1592
274274   if (ACCESSING_LSB)
275275   {
276276      soundlatch_w(0,data & 0xff);
277      cpunum_set_input_line(1,0, HOLD_LINE);
277      cpunum_set_input_line(Machine, 1,0, HOLD_LINE);
278278   }
279279}
280280
r1591r1592
370370   if (ACCESSING_LSB)
371371   {
372372      soundlatch_w(0,data&0xff);
373      cpunum_set_input_line(1, 0, HOLD_LINE);
373      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
374374   }
375375}
376376
r1591r1592
36723672
36733673static void ym2203_irqhandler(int irq)
36743674{
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);
36763676}
36773677
36783678static const struct YM2203interface ym2203_interface =
r1591r1592
36823682
36833683static INTERRUPT_GEN( nmk_interrupt )
36843684{
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);
36873687}
36883688
36893689
r1591r1592
39553955static MACHINE_DRIVER_START( vandyke )
39563956
39573957   /* basic machine hardware */
3958   MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ? */
3958   MDRV_CPU_ADD(M68000, XTAL_10MHz) /* 68000p12 running at 10Mhz, verified on pcb */
39593959   MDRV_CPU_PROGRAM_MAP(vandyke_readmem,vandyke_writemem)
39603960   MDRV_CPU_VBLANK_INT(nmk_interrupt,2)
39613961   MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */
r1591r1592
39793979   /* sound hardware */
39803980   MDRV_SPEAKER_STANDARD_MONO("mono")
39813981
3982   MDRV_SOUND_ADD(YM2203, 1500000)
3982   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/8) /* verified on pcb */
39833983   MDRV_SOUND_CONFIG(ym2203_nmk004_interface)
39843984   MDRV_SOUND_ROUTE(0, "mono", 0.50)
39853985   MDRV_SOUND_ROUTE(1, "mono", 0.50)
39863986   MDRV_SOUND_ROUTE(2, "mono", 0.50)
39873987   MDRV_SOUND_ROUTE(3, "mono", 2.00)
39883988
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 */
39913991   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
39923992
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 */
39953995   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
39963996MACHINE_DRIVER_END
39973997
r1591r1592
47354735
47364736static DRIVER_INIT( bjtwin )
47374737{
4738   driver_init_nmk(machine);
4738   DRIVER_INIT_CALL(nmk);
47394739
47404740   /* Patch rom to enable test mode */
47414741
r1591r1592
49874987
49884988static void irq_handler(int irq)
49894989{
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);
49914991}
49924992
49934993static const struct YM2151interface afega_ym2151_intf =
src/osd/windows/vconv.c
r1591r1592
6767   { 0,      "-fno-strict-aliasing",   "/Oa" },
6868   { 0,      "-fno-omit-frame-pointer",   "" },
6969   { 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" },
7271   { 0,      "-Wall",            "/W0" },
7372   { VS7,      "-Wno-unused",         "/wd4100 /wd4101 /wd4102" },
7473   { 0,      "-W*",               "" },
src/osd/windows/eivc.h
r1591r1592
1212#ifndef __EIVC__
1313#define __EIVC__
1414
15#ifdef PTR64
15#if (_MSC_VER >= 1400)
1616#include <intrin.h>
17#pragma intrinsic(_BitScanReverse)
1817#else
18long __cdecl _InterlockedIncrement(long volatile *);
19long __cdecl _InterlockedDecrement(long volatile *);
20long _InterlockedExchange(long volatile *, long);
21long _InterlockedCompareExchange (long volatile *, long, long);
22long _InterlockedExchangeAdd(long volatile *, long);
23unsigned char _BitScanReverse(unsigned long *Index, unsigned long Mask);
24#endif
25
26#pragma intrinsic(_InterlockedIncrement)
27#pragma intrinsic(_InterlockedDecrement)
1928#pragma intrinsic(_InterlockedCompareExchange)
2029#pragma intrinsic(_InterlockedExchange)
2130#pragma intrinsic(_InterlockedExchangeAdd)
31#if (_MSC_VER >= 1310)
32#pragma intrinsic(_BitScanReverse)
2233#endif
2334
2435
src/osd/windows/debugwin.c
r1591r1592
133133   UINT32               minwidth, maxwidth;
134134   UINT32               minheight, maxheight;
135135   void               (*recompute_children)(debugwin_info *);
136   void               (*update_menu)(debugwin_info *);
136137
137138   int                  (*handle_command)(debugwin_info *, WPARAM, LPARAM);
138139   int                  (*handle_key)(debugwin_info *, WPARAM, LPARAM);
r1591r1592
221222static void memory_create_window(void);
222223static void memory_recompute_children(debugwin_info *info);
223224static void memory_process_string(debugwin_info *info, const char *string);
224static void memory_update_checkmarks(debugwin_info *info);
225static void memory_update_menu(debugwin_info *info);
225226static int memory_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam);
226227static int memory_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam);
227228
228229static void disasm_create_window(void);
229230static void disasm_recompute_children(debugwin_info *info);
230231static void disasm_process_string(debugwin_info *info, const char *string);
231static void disasm_update_checkmarks(debugwin_info *info);
232static void disasm_update_menu(debugwin_info *info);
232233static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam);
233234static int disasm_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam);
234235static void disasm_update_caption(HWND wnd);
r1591r1592
640641
641642      // keydown: handle debugger keys
642643      case WM_KEYDOWN:
643      {
644644         if ((*info->handle_key)(info, wparam, lparam))
645645            info->ignore_char_lparam = lparam >> 16;
646646         break;
647      }
648647
649648      // char: ignore chars associated with keys we've handled
650649      case WM_CHAR:
651      {
652650         if (info->ignore_char_lparam != (lparam >> 16))
653651            return DefWindowProc(wnd, message, wparam, lparam);
654652         else
655653            info->ignore_char_lparam = 0;
656654         break;
657      }
658655
659656      // activate: set the focus
660657      case WM_ACTIVATE:
661      {
662658         if (wparam != WA_INACTIVE && info->focuswnd != NULL)
663659            SetFocus(info->focuswnd);
664660         break;
665      }
666661
667662      // get min/max info: set the minimum window size
668663      case WM_GETMINMAXINFO:
r1591r1592
680675
681676      // sizing: recompute child window locations
682677      case WM_SIZING:
683      {
684678         if (info->recompute_children)
685679            (*info->recompute_children)(info);
686680         InvalidateRect(wnd, NULL, FALSE);
687681         break;
688      }
689682
690683      // mouse wheel: forward to the first view
691684      case WM_MOUSEWHEEL:
r1591r1592
726719         break;
727720      }
728721
722      // activate: set the focus
723      case WM_INITMENU:
724         if (info->update_menu != NULL)
725            (*info->update_menu)(info);
726         break;
727
729728      // command: handle a comment
730729      case WM_COMMAND:
731730         if (!(*info->handle_command)(info, wparam, lparam))
r1591r1592
18561855   // set the handlers
18571856   info->handle_command = memory_handle_command;
18581857   info->handle_key = memory_handle_key;
1858   info->update_menu = memory_update_menu;
18591859
18601860   // create the options menu
18611861   optionsmenu = CreatePopupMenu();
r1591r1592
18721872   AppendMenu(optionsmenu, MF_ENABLED, ID_INCREASE_MEM_WIDTH, TEXT("Increase bytes per line\tCtrl+P"));
18731873   AppendMenu(optionsmenu, MF_ENABLED, ID_DECREASE_MEM_WIDTH, TEXT("Decrease bytes per line\tCtrl+O"));
18741874   AppendMenu(GetMenu(info->wnd), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options"));
1875   memory_update_checkmarks(info);
18761875
18771876   // set up the view to track the initial expression
18781877   debug_view_begin_update(info->view[0].view);
r1591r1592
20052004
20062005
20072006//============================================================
2008//  memory_update_checkmarks
2007//  memory_update_menu
20092008//============================================================
20102009
2011static void memory_update_checkmarks(debugwin_info *info)
2010static void memory_update_menu(debugwin_info *info)
20122011{
20132012   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));
20142013   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));
r1591r1592
20602059               debug_view_begin_update(info->view[0].view);
20612060               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 1);
20622061               debug_view_end_update(info->view[0].view);
2063               memory_update_checkmarks(info);
20642062               return 1;
20652063
20662064            case ID_2_BYTE_CHUNKS:
20672065               debug_view_begin_update(info->view[0].view);
20682066               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 2);
20692067               debug_view_end_update(info->view[0].view);
2070               memory_update_checkmarks(info);
20712068               return 1;
20722069
20732070            case ID_4_BYTE_CHUNKS:
20742071               debug_view_begin_update(info->view[0].view);
20752072               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 4);
20762073               debug_view_end_update(info->view[0].view);
2077               memory_update_checkmarks(info);
20782074               return 1;
20792075
20802076            case ID_8_BYTE_CHUNKS:
20812077               debug_view_begin_update(info->view[0].view);
20822078               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 8);
20832079               debug_view_end_update(info->view[0].view);
2084               memory_update_checkmarks(info);
20852080               return 1;
20862081
20872082            case ID_LOGICAL_ADDRESSES:
20882083               debug_view_begin_update(info->view[0].view);
20892084               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION, FALSE);
20902085               debug_view_end_update(info->view[0].view);
2091               memory_update_checkmarks(info);
20922086               return 1;
20932087
20942088            case ID_PHYSICAL_ADDRESSES:
20952089               debug_view_begin_update(info->view[0].view);
20962090               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION, TRUE);
20972091               debug_view_end_update(info->view[0].view);
2098               memory_update_checkmarks(info);
20992092               return 1;
21002093
21012094            case ID_REVERSE_VIEW:
21022095               debug_view_begin_update(info->view[0].view);
21032096               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));
21042097               debug_view_end_update(info->view[0].view);
2105               memory_update_checkmarks(info);
21062098               return 1;
21072099
21082100            case ID_INCREASE_MEM_WIDTH:
r1591r1592
22012193   AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_ENCRYPTED, TEXT("Encrypted opcodes\tCtrl+E"));
22022194   AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_COMMENTS, TEXT("Comments\tCtrl+M"));
22032195   AppendMenu(GetMenu(info->wnd), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options"));
2204   disasm_update_checkmarks(info);
22052196
22062197   // set the handlers
22072198   info->handle_command = disasm_handle_command;
22082199   info->handle_key = disasm_handle_key;
2200   info->update_menu = disasm_update_menu;
22092201
22102202   // set up the view to track the initial expression
22112203   debug_view_begin_update(info->view[0].view);
r1591r1592
23462338
23472339
23482340//============================================================
2349//  disasm_update_checkmarks
2341//  disasm_update_menu
23502342//============================================================
23512343
2352static void disasm_update_checkmarks(debugwin_info *info)
2344static void disasm_update_menu(debugwin_info *info)
23532345{
23542346   int rightcol = debug_view_get_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN);
23552347   CheckMenuItem(GetMenu(info->wnd), ID_SHOW_RAW, MF_BYCOMMAND | (rightcol == DVP_DASM_RIGHTCOL_RAW ? MF_CHECKED : MF_UNCHECKED));
r1591r1592
24072399               debug_view_begin_update(info->view[0].view);
24082400               debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN, DVP_DASM_RIGHTCOL_RAW);
24092401               debug_view_end_update(info->view[0].view);
2410               disasm_update_checkmarks(info);
24112402               (*info->recompute_children)(info);
24122403               return 1;
24132404
r1591r1592
24152406               debug_view_begin_update(info->view[0].view);
24162407               debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN, DVP_DASM_RIGHTCOL_ENCRYPTED);
24172408               debug_view_end_update(info->view[0].view);
2418               disasm_update_checkmarks(info);
24192409               (*info->recompute_children)(info);
24202410               return 1;
24212411
r1591r1592
24232413               debug_view_begin_update(info->view[0].view);
24242414               debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_RIGHT_COLUMN, DVP_DASM_RIGHTCOL_COMMENTS);
24252415               debug_view_end_update(info->view[0].view);
2426               disasm_update_checkmarks(info);
24272416               (*info->recompute_children)(info);
24282417               return 1;
24292418
r1591r1592
25892578   AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_ENCRYPTED, TEXT("Encrypted opcodes\tCtrl+E"));
25902579   AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_COMMENTS, TEXT("Comments\tCtrl+N"));
25912580   AppendMenu(GetMenu(info->wnd), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options"));
2592   disasm_update_checkmarks(info);
25932581
25942582   // set the handlers
25952583   info->handle_command = disasm_handle_command;
src/osd/windows/drawdd.c
r1591r1592
12611261
12621262   // if refresh is smaller than we'd like, it only scores up to 0.1
12631263   if ((double)desc->dwRefreshRate < einfo->target_refresh)
1264      refresh_score *= 0.1;
1264      refresh_score *= 0.1f;
12651265
12661266   // if we're looking for a particular refresh, make sure it matches
12671267   if (desc->dwRefreshRate == einfo->window->refresh)
src/osd/windows/drawd3d.c
r1591r1592
515515      goto error;
516516
517517   // 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;
520520
521521   return 0;
522522
r1591r1592
12411241   INT32 target_width, target_height;
12421242   d3d_info *d3d = window->drawdata;
12431243   INT32 minwidth, minheight;
1244   float best_score = 0.0;
1244   float best_score = 0.0f;
12451245   int maxmodes;
12461246   int modenum;
12471247
r1591r1592
12951295
12961296      // if refresh is smaller than we'd like, it only scores up to 0.1
12971297      if ((double)mode.RefreshRate < target_refresh)
1298         refresh_score *= 0.1;
1298         refresh_score *= 0.1f;
12991299
13001300      // if we're looking for a particular refresh, make sure it matches
13011301      if (mode.RefreshRate == window->refresh)
src/emu/config.c
r1591r1592
5353    FUNCTION PROTOTYPES
5454***************************************************************************/
5555
56static int config_load_xml(mame_file *file, int type);
57static int config_save_xml(mame_file *file, int type);
56static int config_load_xml(running_machine *machine, mame_file *file, int type);
57static int config_save_xml(running_machine *machine, mame_file *file, int type);
5858
5959
6060
r1591r1592
111111 *
112112 *************************************/
113113
114int config_load_settings(void)
114int config_load_settings(running_machine *machine)
115115{
116116   const char *controller = options_get_string(mame_options(), OPTION_CTRLR);
117117   file_error filerr;
r1591r1592
136136         fatalerror("Could not load controller file %s.cfg", controller);
137137
138138      /* load the XML */
139      if (!config_load_xml(file, CONFIG_TYPE_CONTROLLER))
139      if (!config_load_xml(machine, file, CONFIG_TYPE_CONTROLLER))
140140         fatalerror("Could not load controller file %s.cfg", controller);
141141      mame_fclose(file);
142142   }
r1591r1592
145145   filerr = mame_fopen(SEARCHPATH_CONFIG, "default.cfg", OPEN_FLAG_READ, &file);
146146   if (filerr == FILERR_NONE)
147147   {
148      config_load_xml(file, CONFIG_TYPE_DEFAULT);
148      config_load_xml(machine, file, CONFIG_TYPE_DEFAULT);
149149      mame_fclose(file);
150150   }
151151
152152   /* finally, load the game-specific file */
153   fname = astring_assemble_2(astring_alloc(), Machine->basename, ".cfg");
153   fname = astring_assemble_2(astring_alloc(), machine->basename, ".cfg");
154154   filerr = mame_fopen(SEARCHPATH_CONFIG, astring_c(fname), OPEN_FLAG_READ, &file);
155155   astring_free(fname);
156156
157157   if (filerr == FILERR_NONE)
158158   {
159      loaded = config_load_xml(file, CONFIG_TYPE_GAME);
159      loaded = config_load_xml(machine, file, CONFIG_TYPE_GAME);
160160      mame_fclose(file);
161161   }
162162
r1591r1592
170170}
171171
172172
173void config_save_settings(void)
173void config_save_settings(running_machine *machine)
174174{
175175   file_error filerr;
176176   config_type *type;
r1591r1592
185185   filerr = mame_fopen(SEARCHPATH_CONFIG, "default.cfg", OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
186186   if (filerr == FILERR_NONE)
187187   {
188      config_save_xml(file, CONFIG_TYPE_DEFAULT);
188      config_save_xml(machine, file, CONFIG_TYPE_DEFAULT);
189189      mame_fclose(file);
190190   }
191191
192192   /* finally, save the game-specific file */
193   fname = astring_assemble_2(astring_alloc(), Machine->basename, ".cfg");
193   fname = astring_assemble_2(astring_alloc(), machine->basename, ".cfg");
194194   filerr = mame_fopen(SEARCHPATH_CONFIG, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
195195   astring_free(fname);
196196
197197   if (filerr == FILERR_NONE)
198198   {
199      config_save_xml(file, CONFIG_TYPE_GAME);
199      config_save_xml(machine, file, CONFIG_TYPE_GAME);
200200      mame_fclose(file);
201201   }
202202
r1591r1592
213213 *
214214 *************************************/
215215
216static int config_load_xml(mame_file *file, int which_type)
216static int config_load_xml(running_machine *machine, mame_file *file, int which_type)
217217{
218218   xml_data_node *root, *confignode, *systemnode;
219219   config_type *type;
r1591r1592
236236      goto error;
237237
238238   /* strip off all the path crap from the source filename */
239   srcfile = strrchr(Machine->gamedrv->source_file, '/');
239   srcfile = strrchr(machine->gamedrv->source_file, '/');
240240   if (!srcfile)
241      srcfile = strrchr(Machine->gamedrv->source_file, '\\');
241      srcfile = strrchr(machine->gamedrv->source_file, '\\');
242242   if (!srcfile)
243      srcfile = strrchr(Machine->gamedrv->source_file, ':');
243      srcfile = strrchr(machine->gamedrv->source_file, ':');
244244   if (!srcfile)
245      srcfile = Machine->gamedrv->source_file;
245      srcfile = machine->gamedrv->source_file;
246246   else
247247      srcfile++;
248248
r1591r1592
258258      {
259259         case CONFIG_TYPE_GAME:
260260            /* only match on the specific game name */
261            if (strcmp(name, Machine->gamedrv->name) != 0)
261            if (strcmp(name, machine->gamedrv->name) != 0)
262262               continue;
263263            break;
264264
r1591r1592
273273            const game_driver *clone_of;
274274            /* match on: default, game name, source file name, parent name, grandparent name */
275275            if (strcmp(name, "default") != 0 &&
276               strcmp(name, Machine->gamedrv->name) != 0 &&
276               strcmp(name, machine->gamedrv->name) != 0 &&
277277               strcmp(name, srcfile) != 0 &&
278               ((clone_of = driver_get_clone(Machine->gamedrv)) == NULL || strcmp(name, clone_of->name) != 0) &&
278               ((clone_of = driver_get_clone(machine->gamedrv)) == NULL || strcmp(name, clone_of->name) != 0) &&
279279               (clone_of == NULL || ((clone_of = driver_get_clone(clone_of)) == NULL) || strcmp(name, clone_of->name) != 0))
280280               continue;
281281            break;
r1591r1592
314314 *
315315 *************************************/
316316
317static int config_save_xml(mame_file *file, int which_type)
317static int config_save_xml(running_machine *machine, mame_file *file, int which_type)
318318{
319319   xml_data_node *root = xml_file_create();
320320   xml_data_node *confignode, *systemnode;
r1591r1592
334334   systemnode = xml_add_child(confignode, "system", NULL);
335335   if (!systemnode)
336336      goto error;
337   xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : Machine->gamedrv->name);
337   xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine->gamedrv->name);
338338
339339   /* create the input node and write it out */
340340   /* loop over all registrants and call their save function */
src/emu/debug/debugcpu.c
r1591r1592
528528
529529void debug_refresh_display(void)
530530{
531   video_frame_update(TRUE);
531   video_frame_update(Machine, TRUE);
532532}
533533
534534
src/emu/debug/debugvw.c
r1591r1592
20962096   view->supports_cursor = TRUE;
20972097
20982098   /* start out with 16 bytes in a single column */
2099   memdata->bytes_per_chunk = 1;
20992100   memdata->chunks_displayed = 16;
21002101
21012102   return 1;
r1591r1592
26642665      addrmask = cpuinfo->space[memdata->spacenum].logbytemask;
26652666
26662667      /* 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      }
26692675   }
26702676
26712677   /* determine how many characters we need for an address and set the divider */
src/emu/cpu/m68000/m68kcpu.c
r1591r1592
919919   m68ki_clear_trace();
920920   /* Interrupt mask to level 7 */
921921   FLAG_INT_MASK = 0x0700;
922   CPU_INT_LEVEL = 0;
922923   /* Reset VBR */
923924   REG_VBR = 0;
924925   /* Go to supervisor mode */
src/emu/cpu/ccpu/ccpu.c
r1591r1592
569569
570570         /* CST */
571571         case 0xf7:
572            watchdog_reset();
572            watchdog_reset(Machine);
573573         /* ADDP */
574574         case 0xe7:
575575            tempval = RDMEM(ccpu.I);
src/emu/cpu/z80gb/z80gb.c
r1591r1592
3232/**   Added 4 cycle penalty when leaving HALT state for     **/
3333/**   newer versions of the cpu core                        **/
3434/**                                                         **/
35/** 1.4:                                                    **/
36/**   Split fetch and execute cycles.                       **/
37/**                                                         **/
3538/*************************************************************/
3639#include "z80gb.h"
3740#include "debugger.h"
r1591r1592
6265   int   (*irq_callback)(int irqline);
6366   /* Timer stuff */
6467   void   (*timer_callback)(int cycles);
68   /* Fetch & execute related */
69   int      execution_state;
70   UINT8   op;
6571   /* Others */
6672   int gb_speed;
6773   int gb_speed_change_pending;
r1591r1592
209215   Regs.w.IE = 0;
210216   Regs.w.IF = 0;
211217
218   Regs.w.execution_state = 0;
212219   Regs.w.doHALTbug = 0;
213220   Regs.w.ei_delay = 0;
214221   Regs.w.gb_speed_change_pending = 0;
r1591r1592
246253               Regs.w.enable &= ~HALTED;
247254               Regs.w.IF &= ~(1 << irqline);
248255               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 ) {
251258                     /* Old cpu core (dmg/mgb/sgb) */
252259                     /* check if the HALT bug should be performed */
253260                     if ( Regs.w.haltIFstatus ) {
254261                        Regs.w.doHALTbug = 1;
255262                     }
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 ) {
258269                     CYCLES_PASSED( 4 );
259270                  }
260271               }
r1591r1592
282293/**********************************************************/
283294static int z80gb_execute (int cycles)
284295{
285   UINT8 x;
286
287296   z80gb_ICount = cycles;
288297
289298   do
290299   {
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         }
295306      } 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] );
300320         }
301         CYCLES_PASSED( Cycles[x] );
302         switch (x)
303         {
304#include "opc_main.h"
305         }
306321      }
322      Regs.w.execution_state ^= 1;
307323   } while (z80gb_ICount > 0);
308324
309325   return cycles - z80gb_ICount;
r1591r1592
438454   case CPUINFO_INT_REGISTER + Z80GB_HL:         info->i = Regs.w.HL;               break;
439455   case CPUINFO_INT_REGISTER + Z80GB_IE:         info->i = Regs.w.IE;               break;
440456   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;
442458
443459   /* --- the following bits of info are returned as pointers to data or functions --- */
444460   case CPUINFO_PTR_SET_INFO:                  info->setinfo = z80gb_set_info;         break;
r1591r1592
457473   /* --- the following bits of info are returned as NULL-terminated strings --- */
458474   case CPUINFO_STR_NAME:                      strcpy(info->s, "Z80GB"); break;
459475   case CPUINFO_STR_CORE_FAMILY:                strcpy(info->s, "Nintendo Z80"); break;
460   case CPUINFO_STR_CORE_VERSION:                strcpy(info->s, "1.3"); break;
476   case CPUINFO_STR_CORE_VERSION:                strcpy(info->s, "1.4"); break;
461477   case CPUINFO_STR_CORE_FILE:                strcpy(info->s, __FILE__); break;
462478   case CPUINFO_STR_CORE_CREDITS:                strcpy(info->s, "Copyright The MESS Team."); break;
463479
src/emu/cpu/tms34010/34010ops.c
r1591r1592
9797   /* extra check to prevent bad things */
9898   if (PC == 0 || opcode_table[cpu_readop16(TOBYTE(PC)) >> 4] == unimpl)
9999   {
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);
101101      DEBUGGER_BREAK;
102102   }
103103}
src/emu/cpu/tms34010/tms34010.c
r1591r1592
804804   cpuintrf_pop_context();
805805
806806   /* generate triggers so that spin loops can key off them */
807   cpu_triggerint(cpunum);
807   cpu_triggerint(machine, cpunum);
808808}
809809
810810
r1591r1592
12101210         /* if the CPU is halting itself, stop execution right away */
12111211         if ((data & 0x8000) && !external_host_access)
12121212            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);
12141214
12151215         /* NMI issued? */
12161216         if (data & 0x0100)
r1591r1592
13611361         /* if the CPU is halting itself, stop execution right away */
13621362         if ((data & 0x8000) && !external_host_access)
13631363            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);
13651365
13661366         /* NMI issued? */
13671367         if (data & 0x0100)
src/emu/cpu/m37710/m37710.c
r1591r1592
276276
277277   m37710i_cpu.m37710_regs[m37710_irq_levels[12]] |= 0x04;
278278   m37710_set_irq_line(M37710_LINE_TIMERA0, PULSE_LINE);
279   cpu_triggerint(cpunum);
279   cpu_triggerint(machine, cpunum);
280280   cpuintrf_pop_context();
281281}
282282
r1591r1592
289289
290290   m37710i_cpu.m37710_regs[m37710_irq_levels[11]] |= 0x04;
291291   m37710_set_irq_line(M37710_LINE_TIMERA1, PULSE_LINE);
292   cpu_triggerint(cpunum);
292   cpu_triggerint(machine, cpunum);
293293   cpuintrf_pop_context();
294294}
295295
r1591r1592
302302
303303   m37710i_cpu.m37710_regs[m37710_irq_levels[10]] |= 0x04;
304304   m37710_set_irq_line(M37710_LINE_TIMERA2, PULSE_LINE);
305   cpu_triggerint(cpunum);
305   cpu_triggerint(machine, cpunum);
306306   cpuintrf_pop_context();
307307}
308308
r1591r1592
315315
316316   m37710i_cpu.m37710_regs[m37710_irq_levels[9]] |= 0x04;
317317   m37710_set_irq_line(M37710_LINE_TIMERA3, PULSE_LINE);
318   cpu_triggerint(cpunum);
318   cpu_triggerint(machine, cpunum);
319319   cpuintrf_pop_context();
320320}
321321
r1591r1592
328328
329329   m37710i_cpu.m37710_regs[m37710_irq_levels[8]] |= 0x04;
330330   m37710_set_irq_line(M37710_LINE_TIMERA4, PULSE_LINE);
331   cpu_triggerint(cpunum);
331   cpu_triggerint(machine, cpunum);
332332   cpuintrf_pop_context();
333333}
334334
r1591r1592
341341
342342   m37710i_cpu.m37710_regs[m37710_irq_levels[7]] |= 0x04;
343343   m37710_set_irq_line(M37710_LINE_TIMERB0, PULSE_LINE);
344   cpu_triggerint(cpunum);
344   cpu_triggerint(machine, cpunum);
345345   cpuintrf_pop_context();
346346}
347347
r1591r1592
354354
355355   m37710i_cpu.m37710_regs[m37710_irq_levels[6]] |= 0x04;
356356   m37710_set_irq_line(M37710_LINE_TIMERB1, PULSE_LINE);
357   cpu_triggerint(cpunum);
357   cpu_triggerint(machine, cpunum);
358358   cpuintrf_pop_context();
359359}
360360
r1591r1592
367367
368368   m37710i_cpu.m37710_regs[m37710_irq_levels[5]] |= 0x04;
369369   m37710_set_irq_line(M37710_LINE_TIMERB2, PULSE_LINE);
370   cpu_triggerint(cpunum);
370   cpu_triggerint(machine, cpunum);
371371   cpuintrf_pop_context();
372372}
373373
src/emu/cpu/hd6309/hd6309.c
r1591r1592
12441244      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
12451245      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
12461246      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
1247      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
1247      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
12481248      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
12491249      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
12501250      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
src/emu/cpu/rsp/rsp.c
r1591r1592
120120#define S_ACCUM_M            (2 << 4)
121121#define S_ACCUM_L            (1 << 4)
122122
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)
126126
127127#define R_ACCUM_H(x)         ((INT16)((ACCUM(x) >> S_ACCUM_H) & 0x00FFFF))
128128#define R_ACCUM_M(x)         ((INT16)((ACCUM(x) >> S_ACCUM_M) & 0x00FFFF))
r1591r1592
345345
346346static void rsp_init(int index, int clock, const void *_config, int (*irqcallback)(int))
347347{
348    // int regIdx;
348    int regIdx;
349349    int accumIdx;
350350   config = (rsp_config *)_config;
351351
r1591r1592
355355
356356   rsp.irq_callback = irqcallback;
357357
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...
360360   for(regIdx = 0; regIdx < 32; regIdx++ )
361361   {
362362      rsp.r[regIdx] = 0;
r1591r1592
374374#endif
375375
376376    // ...except for the accumulators.
377    // We're not calling mame_rand() because initializing something with mame_rand()
378    //   makes me retch uncontrollably.
377379    for(accumIdx = 0; accumIdx < 8; accumIdx++ )
378380    {
379381        rsp.accum[accumIdx] = 0;
r1591r1592
22872289         // Calculates reciprocal
22882290
22892291         int del = (VS1REG & 7);
2290         int sel = VEC_EL_2(EL, del);
2292         int sel = EL & 7;
22912293         INT32 rec;
22922294
22932295         rec = (INT16)(R_VREG_S(VS2REG, sel));
r1591r1592
22992301         }
23002302         else
23012303         {
2302            int negative = 0;
2304            int sign = 0;
2305            int exp = 0;
2306            int mantissa = 0;
2307
23032308            if (rec < 0)
23042309            {
2305               rec = ~rec+1;
2306               negative = 1;
2310               rec = -rec;   // rec = MINUS rec
2311               sign = 1;
23072312            }
2308            for (i = 15; i > 0; i--)
2313
2314            // restrict to 10-bit mantissa
2315            for (i = 15; i >= 0; i--)
23092316            {
23102317               if (rec & (1 << i))
23112318               {
2312                  rec &= ((0xffc0) >> (15 - i));
2313                  i = 0;
2319                  exp = i;
2320                  mantissa = (rec << (15 - i)) >> 6;
2321                  break;
23142322               }
23152323            }
2316            rec = (INT32)(0x7fffffff / (double)rec);
2317            for (i = 31; i > 0; i--)
2324
2325            if (mantissa == 0x200)
23182326            {
2319               if (rec & (1 << i))
2320               {
2321                  rec &= ((0xffff8000) >> (31 - i));
2322                  i = 0;
2323               }
2327               rec = 0x7fffffff;
23242328            }
2325            if (negative)
2329            else
23262330            {
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;
23282347            }
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            }
23292358         }
23302359
23312360         for (i=0; i < 8; i++)
r1591r1592
26832712                  // ------------------------------------------------
26842713                  //
26852714
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                        }
26872728                  break;
26882729               }
26892730               case 0x04:   /* MTC2 */
r1591r1592
28842925        case CPUINFO_INT_REGISTER + RSP_R30:            rsp.r[30] = info->i;        break;
28852926        case CPUINFO_INT_SP:
28862927        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;
28952931   }
28962932}
28972933
r1591r1592
29632999      case CPUINFO_INT_REGISTER + RSP_R31:         info->i = rsp.r[31];               break;
29643000      case CPUINFO_INT_REGISTER + RSP_SR:             info->i = rsp.sr;                       break;
29653001      case CPUINFO_INT_REGISTER + RSP_NEXTPC:         info->i = rsp.nextpc;                   break;
3002        case CPUINFO_INT_REGISTER + RSP_STEPCNT:        info->i = rsp.step_count;               break;
29663003
29673004      /* --- the following bits of info are returned as pointers to data or functions --- */
29683005      case CPUINFO_PTR_GET_CONTEXT:               info->getcontext = rsp_get_context;      break;
r1591r1592
30233060      case CPUINFO_STR_REGISTER + RSP_R31:         sprintf(info->s, "R31: %08X", rsp.r[31]); break;
30243061      case CPUINFO_STR_REGISTER + RSP_SR:             sprintf(info->s, "SR: %08X",  rsp.sr);    break;
30253062      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;
30263064   }
30273065}
src/emu/cpu/rsp/rsp.h
r1591r1592
4848    RSP_R31,
4949    RSP_SR,
5050    RSP_NEXTPC,
51    RSP_STEPCNT,
5152};
5253
5354#define RSP_STATUS_HALT          0x0001
src/emu/cpu/m6502/m6502.h
r1591r1592
5454};
5555
5656#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)
5858   to change level of the so input line
5959   positiv edge sets overflow flag */
6060#define M6502_SET_OVERFLOW   1
src/emu/cpu/m6502/m6509.h
r1591r1592
3131};
3232
3333#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)
3535   to change level of the so input line
3636   positiv edge sets overflow flag */
3737#define M6509_SET_OVERFLOW 3
src/emu/cpu/jaguar/jaguar.c
r1591r1592
496496   /* if we're halted, we shouldn't be here */
497497   if (!(jaguar.ctrl[G_CTRL] & 1))
498498   {
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);
500500      return cycles;
501501   }
502502
r1591r1592
542542   /* if we're halted, we shouldn't be here */
543543   if (!(jaguar.ctrl[G_CTRL] & 1))
544544   {
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);
546546      return cycles;
547547   }
548548
r1591r1592
13621362         jaguar.ctrl[offset] = newval;
13631363         if ((oldval ^ newval) & 0x01)
13641364         {
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);
13661366            if (cpu_getexecutingcpu() >= 0)
13671367               cpu_yield();
13681368         }
r1591r1592
14771477         jaguar.ctrl[offset] = newval;
14781478         if ((oldval ^ newval) & 0x01)
14791479         {
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);
14811481            if (cpu_getexecutingcpu() >= 0)
14821482               cpu_yield();
14831483         }
src/emu/cpu/i8085/i8085.h
r1591r1592
1212enum
1313{
1414   CPUINFO_PTR_I8085_SOD_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC,
15   CPUINFO_PTR_I8085_SID_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC + 1,
1516   CPUINFO_INT_I8085_SID = CPUINFO_INT_CPU_SPECIFIC
1617};
1718
src/emu/cpu/i8085/i8085.c
r1591r1592
144144   INT8   irq_state[4];
145145   int    (*irq_callback)(int);
146146   void   (*sod_callback)(int state);
147   int      (*sid_callback)(void);
147148}   i8085_Regs;
148149
149150static int i8085_ICount = 0;
r1591r1592
313314         if( I.cputype ) {
314315            i8085_ICount -= 7;      /* RIM  */
315316            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);
316319            I.AF.b.h |= RIM_IEN; RIM_IEN = 0; //AT: read and clear IEN status latch
317320         } else {
318321            i8085_ICount -= 4;      /* NOP undocumented */
r1591r1592
13401343static void i8085_reset(void)
13411344{
13421345   int (*save_irqcallback)(int);
1346   void (*save_sodcallback)(int);
1347   int (*save_sidcallback)(void);
13431348   int cputype_bak = I.cputype;
13441349
13451350   init_tables();
13461351   save_irqcallback = I.irq_callback;
1352   save_sodcallback = I.sod_callback;
1353   save_sidcallback = I.sid_callback;
13471354   memset(&I, 0, sizeof(i8085_Regs));
13481355   I.irq_callback = save_irqcallback;
1356   I.sod_callback = save_sodcallback;
1357   I.sid_callback = save_sidcallback;
13491358   change_pc(I.PC.d);
13501359
13511360   I.cputype = cputype_bak;
r1591r1592
16121621
16131622      /* --- the following bits of info are set as pointers to data or functions --- */
16141623      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;
16151625   }
16161626}
16171627
r1591r1592
16311641      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
16321642      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
16331643      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
1634      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
1644      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 2;                     break;
16351645      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
16361646      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
16371647      case CPUINFO_INT_MIN_CYCLES:               info->i = 4;                     break;
r1591r1592
17391749   switch (state)
17401750   {
17411751      /* --- the following bits of info are returned as 64-bit signed integers --- */
1752      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
17421753      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
17431754      case CPUINFO_INT_INPUT_STATE + I8085_INTR_LINE:   info->i = (I.IREQ & IM_INTR) ? ASSERT_LINE : CLEAR_LINE; break;
17441755      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:   info->i = (I.IREQ & IM_TRAP) ? ASSERT_LINE : CLEAR_LINE; break;
src/emu/cpu/sm8500/sm8500d.c
r1591r1592
372372      case AM_r1:
373373         ea = oprom[pos++];
374374         switch( ea & 0xC0 ) {
375         case 0x00:
375376            dst += sprintf( dst, "@r%02Xh", (ea >> 3 ) & 0x07 );
376377            break;
377378         case 0x40:
src/emu/cpu/sh4/sh4.c
r1591r1592
44064406   if (sh4.irln == value)
44074407      return;
44084408   sh4.irln = value;
4409   cpunum_set_input_line(cpunum, SH4_IRLn, PULSE_LINE);
4409   cpunum_set_input_line(Machine, cpunum, SH4_IRLn, PULSE_LINE);
44104410}
44114411
44124412static void set_irq_line(int irqline, int state) // set state of external interrupt line
src/emu/cpu/i8051/i8051.c
r1591r1592
605605      if(PC != PPC)   op = cpu_readop(PC);
606606
607607      //Update Timer (if any timers are running)
608      if(R_TCON & 0x50)
608      if((GET_IT0 && GET_ET0) || (GET_IT1 && GET_ET1))
609609         update_timer(i8051.prev_used_cycles);
610610
611611      //Update Serial (if serial port sending data)
src/emu/cpu/mips/mips3com.c
r1591r1592
724724
725725static TIMER_CALLBACK( compare_int_callback )
726726{
727   cpunum_set_input_line(param, MIPS3_IRQ5, ASSERT_LINE);
727   cpunum_set_input_line(machine, param, MIPS3_IRQ5, ASSERT_LINE);
728728}
729729
730730
src/emu/cpu/tms7000/tms7000.c
r1591r1592
561561        if( --tms7000.t1_decrementer < 0 ) /* Decrement timer1 register and check for underflow */
562562        {
563563            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);
565565            //LOG( ("tms7000: trigger int2 (cycles: %d)\t%d\tdelta %d\n", activecpu_gettotalcycles(), activecpu_gettotalcycles() - tick, tms7000_cycles_per_INT2-(activecpu_gettotalcycles() - tick) );
566566         //tick = activecpu_gettotalcycles() );
567567            /* Also, cascade out to timer 2 - timer 2 unimplemented */
src/emu/cpu/arm7/arm7dasm.c
r1591r1592
12001200            }
12011201            break;
12021202         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                }
12091218            break;
12101219         case 0xf: /* BL */
12111220            if( opcode & THUMB_BLOP_LO )
12121221            {
1213               pBuf += sprintf( pBuf, "BL (LO) %04x", ( opcode & THUMB_BLOP_OFFS ) << 1 );
1222               pBuf += sprintf( pBuf, "BL (LO) %08x", ( opcode & THUMB_BLOP_OFFS ) << 1 );
12141223               dasmflags = DASMFLAG_STEP_OVER;
12151224            }
12161225            else
r1591r1592
12201229               {
12211230                  addr |= 0xff800000;
12221231               }
1223               pBuf += sprintf( pBuf, "BL (HI) %04x", ( opcode & THUMB_BLOP_OFFS ) << 12 );
1232               pBuf += sprintf( pBuf, "BL (HI) %08x", addr );
12241233               dasmflags = DASMFLAG_STEP_OVER;
12251234            }
12261235            break;
src/emu/cpu/arm7/arm7exec.c
r1591r1592
11091109            }
11101110            break;
11111111         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                }
11181129            break;
11191130         case 0xf: /* BL */
11201131            if( insn & THUMB_BLOP_LO )
src/emu/cpu/m6800/m6800.c
r1591r1592
26972697   switch (state)
26982698   {
26992699      /* --- the following bits of info are returned as 64-bit signed integers --- */
2700      case CPUINFO_INT_CLOCK_DIVIDER:                     info->i = 4;               break;
27002701      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;               break;
27012702      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 9;               break;
27022703
r1591r1592
27252726{
27262727   switch (state)
27272728   {
2729      /* --- the following bits of info are returned as 64-bit signed integers --- */
2730      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
2731
27282732      /* --- the following bits of info are returned as pointers to data or functions --- */
27292733      case CPUINFO_PTR_INIT:                     info->init = m6802_init;            break;
27302734#ifdef MAME_DEBUG
r1591r1592
27502754   switch (state)
27512755   {
27522756      /* --- the following bits of info are returned as 64-bit signed integers --- */
2757      case CPUINFO_INT_CLOCK_DIVIDER:                     info->i = 4;               break;
27532758      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;               break;
27542759      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 9;               break;
27552760
r1591r1592
27802785{
27812786   switch (state)
27822787   {
2788      /* --- the following bits of info are returned as 64-bit signed integers --- */
2789      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
2790
27832791      /* --- the following bits of info are returned as pointers to data or functions --- */
27842792      case CPUINFO_PTR_INIT:                     info->init = m6808_init;            break;
27852793#ifdef MAME_DEBUG
r1591r1592
28052813   switch (state)
28062814   {
28072815      /* --- the following bits of info are returned as 64-bit signed integers --- */
2816      case CPUINFO_INT_CLOCK_DIVIDER:                     info->i = 4;               break;
28082817      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;               break;
28092818      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 9;               break;
28102819
r1591r1592
28332842{
28342843   switch (state)
28352844   {
2845      /* --- the following bits of info are returned as 64-bit signed integers --- */
2846      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
2847
28362848      /* --- the following bits of info are returned as pointers to data or functions --- */
28372849      case CPUINFO_PTR_INIT:                     info->init = nsc8105_init;            break;
28382850      case CPUINFO_PTR_EXECUTE:                  info->execute = nsc8105_execute;      break;
src/emu/cpu/cp1610/cp1610.c
r1591r1592
15481548static void cp1610_reset(void)
15491549{
15501550   /* 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);
15521552}
15531553
15541554/***************************************************
src/emu/config.h
r1591r1592
5555
5656void config_init(running_machine *machine);
5757void config_register(const char *nodename, config_callback load, config_callback save);
58int config_load_settings(void);
59void config_save_settings(void);
58int config_load_settings(running_machine *machine);
59void config_save_settings(running_machine *machine);
6060
6161#endif   /* __CONFIG_H__ */
src/emu/uigfx.c
r1591r1592
149149    ui_gfx_ui_handler - primary UI handler
150150-------------------------------------------------*/
151151
152UINT32 ui_gfx_ui_handler(UINT32 uistate)
152UINT32 ui_gfx_ui_handler(running_machine *machine, UINT32 uistate)
153153{
154154   ui_gfx_state *state = &ui_gfx;
155155
src/emu/video/resnet.c
r1591r1592
5050#include "driver.h"
5151#include "resnet.h"
5252
53#define VERBOSE 0
54
55
5356double compute_resistor_weights(
5457   int minval, int maxval, double scaler,
5558   int count_1, const int * resistances_1, double * weights_1, int pulldown_1, int pullup_1,
r1591r1592
109112
110113      /* parameters validity check */
111114      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);
117116
118117
119118      if (count > 0)
r1591r1592
130129      }
131130   }
132131   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");
138133
139134   /* calculate outputs for all given networks */
140135   for( i = 0; i < networks_no; i++ )
r1591r1592
208203   }
209204
210205/* debug code */
211#ifdef MAME_DEBUG
206#if VERBOSE
212207   logerror("compute_resistor_weights():  scaler = %15.10f\n",scale);
213208   logerror("min val :%i  max val:%i  Total number of networks :%i\n", minval, maxval, networks_no );
214209
r1591r1592
301296
302297      /* parameters validity check */
303298      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);
311300
312301      if (count > 0)
313302      {
r1591r1592
324313   }
325314
326315   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");
334317
335318   /* calculate outputs for all given networks */
336319   for( i = 0; i < networks_no; i++ )
r1591r1592
413396   }
414397
415398/* debug code */
416#ifdef MAME_DEBUG
399#if VERBOSE
417400   logerror("compute_resistor_net_outputs():  scaler = %15.10f\n",scale);
418401   logerror("min val :%i  max val:%i  Total number of networks :%i\n", minval, maxval, networks_no );
419402
src/emu/video/v9938.c
r1591r1592
135135   UINT8 pal[19268*3];
136136
137137   /* init v9938 512-color palette */
138   palette_init_v9938(machine, colortable, color_prom);
138   PALETTE_INIT_CALL(v9938);
139139
140140   /* set up YJK table */
141141      pal_indYJK = auto_malloc(0x20000 * sizeof(UINT16));
r1591r1592
430430   else
431431      vdp.vram_exp = NULL;
432432
433   video_start_generic_bitmapped(machine);
433   VIDEO_START_CALL(generic_bitmapped);
434434}
435435
436436void v9938_reset (void)
src/emu/video/voodoo.c
r1591r1592
197197static void init_tmu_shared(tmu_shared_state *s);
198198static void init_tmu(voodoo_state *v, tmu_state *t, int type, voodoo_reg *reg, void *memory, int tmem);
199199static void soft_reset(voodoo_state *v);
200static void check_stalled_cpu(voodoo_state *v, attotime current_time);
200static void check_stalled_cpu(running_machine *machine, voodoo_state *v, attotime current_time);
201201static void flush_fifos(voodoo_state *v, attotime current_time);
202202static TIMER_CALLBACK( stall_cpu_callback );
203203static void stall_cpu(voodoo_state *v, int state, attotime current_time);
r1591r1592
10191019
10201020   /* we may be able to unstall now */
10211021   if (v->pci.stall_state != NOT_STALLED)
1022      check_stalled_cpu(v, timer_get_time());
1022      check_stalled_cpu(Machine, v, timer_get_time());
10231023
10241024   /* periodically log rasterizer info */
10251025   v->stats.swaps++;
r1591r1592
21412141
21422142static TIMER_CALLBACK( stall_cpu_callback )
21432143{
2144   check_stalled_cpu(ptr, timer_get_time());
2144   check_stalled_cpu(machine, ptr, timer_get_time());
21452145}
21462146
21472147
2148static void check_stalled_cpu(voodoo_state *v, attotime current_time)
2148static void check_stalled_cpu(running_machine *machine, voodoo_state *v, attotime current_time)
21492149{
21502150   int resume = FALSE;
21512151
r1591r1592
21882188      if (v->pci.stall_callback)
21892189         (*v->pci.stall_callback)(FALSE);
21902190      else
2191         cpu_trigger(v->trigger);
2191         cpu_trigger(machine, v->trigger);
21922192   }
21932193
21942194   /* if not, set a timer for the next one */
src/emu/video/generic.c
r1591r1592
303303***************************************************************************/
304304
305305/*-------------------------------------------------
306    video_start_generic - general video system
306    VIDEO_START( generic ) - general video system
307307-------------------------------------------------*/
308308
309309VIDEO_START( generic )
310310{
311   assert_always(videoram_size != 0, "VIDEO_START(generic) requires non-zero videoram_size");
312
313311   /* allocate the temporary bitmap */
314312   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
315313}
316314
317315
318316/*-------------------------------------------------
319    video_start_generic_bitmapped - general video
317    VIDEO_START( generic_bitmapped ) - general video
320318    system with a bitmap
321319-------------------------------------------------*/
322320
r1591r1592
331329
332330
333331/*-------------------------------------------------
334    video_update_generic_bitmapped - blast the
332    VIDEO_UPDATE( generic_bitmapped ) - blast the
335333    generic bitmap to the screen
336334-------------------------------------------------*/
337335
r1591r1592
588586
589587
590588/***************************************************************************
591    GENERIC PALETTE READ HANDLERS
592***************************************************************************/
593
594/*-------------------------------------------------
595    8-bit read handlers
596-------------------------------------------------*/
597
598READ8_HANDLER( paletteram_r )
599{
600   return paletteram[offset];
601}
602
603READ8_HANDLER( paletteram_2_r )
604{
605   return paletteram_2[offset];
606}
607
608
609/*-------------------------------------------------
610    16-bit read handlers
611-------------------------------------------------*/
612
613READ16_HANDLER( paletteram16_word_r )
614{
615   return paletteram16[offset];
616}
617
618READ16_HANDLER( paletteram16_2_word_r )
619{
620   return paletteram16_2[offset];
621}
622
623
624/*-------------------------------------------------
625    32-bit read handlers
626-------------------------------------------------*/
627
628READ32_HANDLER( paletteram32_r )
629{
630   return paletteram32[offset];
631}
632
633
634
635/***************************************************************************
636589    3-3-2 RGB PALETTE WRITE HANDLERS
637590***************************************************************************/
638591
src/emu/video/generic.h
r1591r1592
139139
140140
141141
142/* ----- generic palette RAM read/write handlers ----- */
142/* ----- generic palette RAM write handlers, use MRAx_RAM to read ----- */
143143
144/* read handlers */
145READ8_HANDLER( paletteram_r );
146READ8_HANDLER( paletteram_2_r );
147READ16_HANDLER( paletteram16_word_r );
148READ16_HANDLER( paletteram16_2_word_r );
149READ32_HANDLER( paletteram32_r );
150
151144/* 3-3-2 RGB palette write handlers */
152145WRITE8_HANDLER( paletteram_BBGGGRRR_w );
153146WRITE8_HANDLER( paletteram_RRRGGGBB_w );
src/emu/uigfx.h
r1591r1592
2525void ui_gfx_init(running_machine *machine);
2626
2727/* master handler */
28UINT32 ui_gfx_ui_handler(UINT32 state);
28UINT32 ui_gfx_ui_handler(running_machine *machine, UINT32 state);
2929
3030
3131#endif   /* __UIGFX_H__ */
src/emu/tilemap.c
r1591r1592
655655}
656656
657657
658/*-------------------------------------------------
659    tilemap_get_scrollx - return the scroll value
660    for a row unit
661-------------------------------------------------*/
658662
663int 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
677int 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
659687/***************************************************************************
660688    INTERNAL MAP ACCESS
661689***************************************************************************/
src/emu/tilemap.h
r1591r1592
518518void tilemap_set_scrollx(tilemap *tmap, int row, int value);
519519void tilemap_set_scrolly(tilemap *tmap, int col, int value);
520520
521/* return the scroll value for a row/column unit */
522int tilemap_get_scrollx(tilemap *tmap, int row);
523int tilemap_get_scrolly(tilemap *tmap, int col);
521524
522525
526
523527/* ----- internal map access ----- */
524528
525529/* return a pointer to the (updated) internal pixmap for a tilemap */
src/emu/uimenu.c
r1591r1592
684684    and calls the menu handler
685685-------------------------------------------------*/
686686
687UINT32 ui_menu_ui_handler(UINT32 state)
687UINT32 ui_menu_ui_handler(running_machine *machine, UINT32 state)
688688{
689689   UINT32 newstate;
690690
r1591r1592
12641264
12651265static UINT32 menu_cheat(UINT32 state)
12661266{
1267   int result = cheat_menu(state);
1267   int result = cheat_menu(Machine, state);
12681268   if (result == 0)
12691269      return ui_menu_stack_pop();
12701270   return result;
src/emu/video.c
r1591r1592
644644
645645               /* display some startup text */
646646               sprintf(buffer, "Decoding (%d%%)", curgfx * 100 / totalgfx);
647               ui_set_startup_text(buffer, FALSE);
647               ui_set_startup_text(machine, buffer, FALSE);
648648            }
649649         }
650650
r1591r1592
756756   }
757757
758758   /* recompute the VBLANK timing */
759   cpu_compute_vblank_timing();
759   cpu_compute_vblank_timing(Machine);
760760
761761   /* if we are on scanline 0 already, reset the update timer immediately */
762762   /* otherwise, defer until the next scanline 0 */
r1591r1592
10351035    operations
10361036-------------------------------------------------*/
10371037
1038void video_frame_update(int debug)
1038void video_frame_update(running_machine *machine, int debug)
10391039{
10401040   attotime current_time = timer_get_time();
10411041   int skipped_it = global.skipping_this_frame;
r1591r1592
10561056   }
10571057
10581058   /* draw the user interface */
1059   ui_update_and_render();
1059   ui_update_and_render(machine);
10601060
10611061   /* if we're throttling, synchronize before rendering */
10621062   if (!debug && !skipped_it && effective_throttle())
r1591r1592
15531553   /* if we're throttling and autoframeskip is on, adjust */
15541554   if (effective_throttle() && effective_autoframeskip() && global.frameskip_counter == 0)
15551555   {
1556      float speed = global.speed * 0.01;
1556      double speed = global.speed * 0.01;
15571557
15581558      /* if we're too fast, attempt to increase the frameskip */
15591559      if (global.speed_percent >= 0.995 * speed)
src/emu/uimenu.h
r1591r1592
6666int ui_menu_draw(const ui_menu_item *items, int numitems, int selected, const menu_extra *extra);
6767
6868/* master handler */
69UINT32 ui_menu_ui_handler(UINT32 state);
69UINT32 ui_menu_ui_handler(running_machine *machine, UINT32 state);
7070
7171/* menu keyboard handling */
7272int ui_menu_generic_keys(UINT32 *selected, int num_items, int visible_items);
src/emu/memory.c
r1591r1592
381381static void init_addrspace(UINT8 cpunum, UINT8 spacenum);
382382static void preflight_memory(void);
383383static void populate_memory(void);
384static 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);
384385static 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);
385386static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked);
386387static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask);
r1591r1592
951952void *_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)
952953{
953954   addrspace_data *space = &cpudata[cpunum].space[spacenum];
954   if ((handler < 0) || (handler >= STATIC_COUNT))
955   if (handler < 0 || handler >= STATIC_COUNT)
955956      fatalerror("fatal: can only use static banks with memory_install_read_handler()");
956957   install_mem_handler(space, 0, space->dbits, 0, start, end, mask, mirror, (genf *)(FPTR)handler, 0, handler_name);
957958   mem_dump();
r1591r1592
9991000void *_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)
10001001{
10011002   addrspace_data *space = &cpudata[cpunum].space[spacenum];
1002   if ((handler < 0) || (handler >= STATIC_COUNT))
1003   if (handler < 0 || handler >= STATIC_COUNT)
10031004      fatalerror("fatal: can only use static banks with memory_install_write_handler()");
10041005   install_mem_handler(space, 1, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
10051006   mem_dump();
r1591r1592
10401041
10411042
10421043/*-------------------------------------------------
1044    memory_install_readwriteX_handler - install
1045    dynamic read and write handlers for X-bit case
1046-------------------------------------------------*/
1047
1048void *_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
1059UINT8 *_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
1068UINT16 *_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
1077UINT32 *_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
1086UINT64 *_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/*-------------------------------------------------
10431097    memory_install_readX_matchmask_handler -
10441098    install dynamic match/mask read handler for
10451099    X-bit case
r1591r1592
10481102void *_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)
10491103{
10501104   addrspace_data *space = &cpudata[cpunum].space[spacenum];
1051   if ((handler < 0) || (handler >= STATIC_COUNT))
1105   if (handler < 0 || handler >= STATIC_COUNT)
10521106      fatalerror("fatal: can only use static banks with memory_install_read_matchmask_handler()");
10531107   install_mem_handler(space, 0, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
10541108   mem_dump();
r1591r1592
10971151void *_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)
10981152{
10991153   addrspace_data *space = &cpudata[cpunum].space[spacenum];
1100   if ((handler < 0) || (handler >= STATIC_COUNT))
1154   if (handler < 0 || handler >= STATIC_COUNT)
11011155      fatalerror("fatal: can only use static banks with memory_install_write_matchmask_handler()");
11021156   install_mem_handler(space, 1, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
11031157   mem_dump();
r1591r1592
14521506                     int ismatchmask = ((map->flags & AM_FLAGS_MATCH_MASK) != 0);
14531507                     int isfixed = (map->memory != NULL) || (map->share != 0);
14541508                     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);
14561510                     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);
14581512                  }
14591513            }
14601514         }
r1591r1592
14621516
14631517
14641518/*-------------------------------------------------
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
1525static 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/*-------------------------------------------------
14651555    install_mem_handler - installs a handler for
14661556    memory operations
14671557-------------------------------------------------*/
r1591r1592
14721562   table_data *tabledata = iswrite ? &space->write : &space->read;
14731563   UINT8 idx, prev_entry = STATIC_INVALID;
14741564   int cur_index, prev_index = 0;
1475   int ismasked = (mask != 0);
14761565   int i;
14771566
14781567   /* 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");
14791570   if (space->dbits != databits)
14801571      fatalerror("fatal: install_mem_handler called with a %d-bit handler for a %d-bit address space", databits, space->dbits);
14811572   if (start > end)
r1591r1592
15081599   /* adjust the incoming addresses */
15091600   adjust_addresses(space, ismatchmask, &start, &end, &mask, &mirror);
15101601
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
15271602   /* if this ended up a bank handler, tag it for reads or writes */
15281603   if (HANDLER_IS_BANK(handler))
15291604   {
src/emu/video.h
r1591r1592
117117/* ----- global rendering ----- */
118118
119119/* update the screen, handling frame skipping and rendering */
120void video_frame_update(int debug);
120void video_frame_update(running_machine *machine, int debug);
121121
122122
123123/* ----- throttling/frameskipping/performance ----- */
src/emu/memory.h
r1591r1592
5757typedef offs_t         (*opbase_handler) (ATTR_UNUSED offs_t address);
5858
5959/* ----- this struct contains pointers to the live read/write routines ----- */
60typedef struct _data_accessors data_accessors;
6061struct _data_accessors
6162{
6263   UINT8         (*read_byte)(offs_t offset);
r1591r1592
6970   void         (*write_dword)(offs_t offset, UINT32 data);
7071   void         (*write_qword)(offs_t offset, UINT64 data);
7172};
72typedef struct _data_accessors data_accessors;
7373
7474
7575
r1591r1592
591591   UINT8 *            writelookup;      /* write table lookup */
592592   handler_data *      readhandlers;      /* read handlers */
593593   handler_data *      writehandlers;      /* write handlers */
594   const data_accessors *   accessors;         /* pointers to the data access handlers */
594   const data_accessors *accessors;      /* pointers to the data access handlers */
595595};
596596
597597
r1591r1592
687687
688688#define AM_SIZE_MEMBER(_struct, _member)                        \
689689   if (Machine != NULL && Machine->driver_data != NULL)            \
690      map->size = &((_struct *)Machine->driver_data)->(_member);      \
690      map->size = &((_struct *)Machine->driver_data)->_member;      \
691691
692692/* ----- common shortcuts ----- */
693693#define AM_READWRITE(_read,_write)         AM_READ(_read) AM_WRITE(_write)
r1591r1592
972972UINT16 *   _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);
973973UINT32 *   _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);
974974UINT64 *   _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);
975void *      _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);
976UINT8 *      _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);
977UINT16 *   _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);
978UINT32 *   _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);
979UINT64 *   _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);
975980
976981void *      _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);
977982UINT8 *      _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);
r1591r1592
10361041#endif
10371042
10381043/* ----- 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)                  \
10401045   _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)                  \
10421047   _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)               \
10441049   _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)               \
10461051   _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)               \
10481053   _memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler, #handler)
10491054
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)                  \
10511056   _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)               \
10531058   _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)               \
10551060   _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)               \
10571062   _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)               \
10591064   _memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler, #handler)
10601065
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)
10761076
10771077#define memory_install_read_matchmask_handler(cpu, space, start, end, mask, mirror, handler)         \
10781078   _memory_install_read_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler)
src/emu/mame.c
r1591r1592
142142   UINT8         exit_pending;
143143   const game_driver *new_driver_pending;
144144   astring *      saveload_pending_file;
145   emu_timer *   soft_reset_timer;
145   emu_timer *      soft_reset_timer;
146146   mame_file *      logfile;
147147
148148   /* callbacks */
r1591r1592
365365         init_machine(machine);
366366
367367         /* load the configuration settings and NVRAM */
368         settingsloaded = config_load_settings();
368         settingsloaded = config_load_settings(machine);
369369         nvram_load();
370370
371371         /* display the startup screens */
372         ui_display_startup_screens(firstrun, !settingsloaded);
372         ui_display_startup_screens(machine, firstrun, !settingsloaded);
373373         firstrun = FALSE;
374374
375375         /* start resource tracking; note that soft_reset assumes it can */
r1591r1592
388388
389389            /* execute CPUs if not paused */
390390            if (!mame->paused)
391               cpuexec_timeslice();
391               cpuexec_timeslice(machine);
392392
393393            /* otherwise, just pump video updates through */
394394            else
395               video_frame_update(FALSE);
395               video_frame_update(machine, FALSE);
396396
397397            /* handle save/load */
398398            if (mame->saveload_schedule_callback)
r1591r1592
409409
410410         /* save the NVRAM and configuration */
411411         nvram_save();
412         config_save_settings();
412         config_save_settings(machine);
413413      }
414414      mame->fatal_error_jmpbuf_valid = FALSE;
415415
r1591r1592
15521552   /* call the game driver's init function */
15531553   /* this is where decryption is done and memory maps are altered */
15541554   /* so this location in the init order is important */
1555   ui_set_startup_text("Initializing...", TRUE);
1555   ui_set_startup_text(machine, "Initializing...", TRUE);
15561556   if (machine->gamedrv->driver_init != NULL)
15571557      (*machine->gamedrv->driver_init)(machine);
15581558
src/emu/machine/z80dma.c
r1591r1592
312312   if (dma[which].intf && dma[which].intf->cpunum >= 0)
313313   {
314314      //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,
316316         pending_transfer ? ASSERT_LINE : CLEAR_LINE);
317317   }
318318}
src/emu/machine/generic.c
r1591r1592
316316
317317
318318/*-------------------------------------------------
319    nvram_handler_generic_0fill - generic NVRAM
319    NVRAM_HANDLER( generic_0fill ) - generic NVRAM
320320    with a 0 fill
321321-------------------------------------------------*/
322322
r1591r1592
332332
333333
334334/*-------------------------------------------------
335    nvram_handler_generic_1fill - generic NVRAM
335    NVRAM_HANDLER( generic_1fill ) - generic NVRAM
336336    with a 1 fill
337337-------------------------------------------------*/
338338
r1591r1592
348348
349349
350350/*-------------------------------------------------
351    nvram_handler_generic_randfill - generic NVRAM
351    NVRAM_HANDLER( generic_randfill ) - generic NVRAM
352352    with a random fill
353353-------------------------------------------------*/
354354
r1591r1592
564564   int line;
565565
566566   /* 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);
568568   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);
570570}
571571
572572
r1591r1592
624624    specified state on the active CPU
625625-------------------------------------------------*/
626626
627INLINE void irqn_line_set(int cpunum, int line, int state)
627INLINE void irqn_line_set(running_machine *machine, int cpunum, int line, int state)
628628{
629629   if (interrupt_enable[cpunum])
630      cpunum_set_input_line(cpunum, line, state);
630      cpunum_set_input_line(machine, cpunum, line, state);
631631}
632632
633633
r1591r1592
635635    NMI callbacks
636636-------------------------------------------------*/
637637
638INTERRUPT_GEN( nmi_line_pulse )      { irqn_line_set(cpunum, INPUT_LINE_NMI, PULSE_LINE); }
639INTERRUPT_GEN( nmi_line_assert )   { irqn_line_set(cpunum, INPUT_LINE_NMI, ASSERT_LINE); }
638INTERRUPT_GEN( nmi_line_pulse )      { irqn_line_set(machine, cpunum, INPUT_LINE_NMI, PULSE_LINE); }
639INTERRUPT_GEN( nmi_line_assert )   { irqn_line_set(machine, cpunum, INPUT_LINE_NMI, ASSERT_LINE); }
640640
641641
642642/*-------------------------------------------------
643643    IRQn callbacks
644644-------------------------------------------------*/
645645
646INTERRUPT_GEN( irq0_line_hold )      { irqn_line_set(cpunum, 0, HOLD_LINE); }
647INTERRUPT_GEN( irq0_line_pulse )   { irqn_line_set(cpunum, 0, PULSE_LINE); }
648INTERRUPT_GEN( irq0_line_assert )   { irqn_line_set(cpunum, 0, ASSERT_LINE); }
646INTERRUPT_GEN( irq0_line_hold )      { irqn_line_set(machine, cpunum, 0, HOLD_LINE); }
647INTERRUPT_GEN( irq0_line_pulse )   { irqn_line_set(machine, cpunum, 0, PULSE_LINE); }
648INTERRUPT_GEN( irq0_line_assert )   { irqn_line_set(machine, cpunum, 0, ASSERT_LINE); }
649649
650INTERRUPT_GEN( irq1_line_hold )      { irqn_line_set(cpunum, 1, HOLD_LINE); }
651INTERRUPT_GEN( irq1_line_pulse )   { irqn_line_set(cpunum, 1, PULSE_LINE); }
652INTERRUPT_GEN( irq1_line_assert )   { irqn_line_set(cpunum, 1, ASSERT_LINE); }
650INTERRUPT_GEN( irq1_line_hold )      { irqn_line_set(machine, cpunum, 1, HOLD_LINE); }
651INTERRUPT_GEN( irq1_line_pulse )   { irqn_line_set(machine, cpunum, 1, PULSE_LINE); }
652INTERRUPT_GEN( irq1_line_assert )   { irqn_line_set(machine, cpunum, 1, ASSERT_LINE); }
653653
654INTERRUPT_GEN( irq2_line_hold )      { irqn_line_set(cpunum, 2, HOLD_LINE); }
655INTERRUPT_GEN( irq2_line_pulse )   { irqn_line_set(cpunum, 2, PULSE_LINE); }
656INTERRUPT_GEN( irq2_line_assert )   { irqn_line_set(cpunum, 2, ASSERT_LINE); }
654INTERRUPT_GEN( irq2_line_hold )      { irqn_line_set(machine, cpunum, 2, HOLD_LINE); }
655INTERRUPT_GEN( irq2_line_pulse )   { irqn_line_set(machine, cpunum, 2, PULSE_LINE); }
656INTERRUPT_GEN( irq2_line_assert )   { irqn_line_set(machine, cpunum, 2, ASSERT_LINE); }
657657
658INTERRUPT_GEN( irq3_line_hold )      { irqn_line_set(cpunum, 3, HOLD_LINE); }
659INTERRUPT_GEN( irq3_line_pulse )   { irqn_line_set(cpunum, 3, PULSE_LINE); }
660INTERRUPT_GEN( irq3_line_assert )   { irqn_line_set(cpunum, 3, ASSERT_LINE); }
658INTERRUPT_GEN( irq3_line_hold )      { irqn_line_set(machine, cpunum, 3, HOLD_LINE); }
659INTERRUPT_GEN( irq3_line_pulse )   { irqn_line_set(machine, cpunum, 3, PULSE_LINE); }
660INTERRUPT_GEN( irq3_line_assert )   { irqn_line_set(machine, cpunum, 3, ASSERT_LINE); }
661661
662INTERRUPT_GEN( irq4_line_hold )      { irqn_line_set(cpunum, 4, HOLD_LINE); }
663INTERRUPT_GEN( irq4_line_pulse )   { irqn_line_set(cpunum, 4, PULSE_LINE); }
664INTERRUPT_GEN( irq4_line_assert )   { irqn_line_set(cpunum, 4, ASSERT_LINE); }
662INTERRUPT_GEN( irq4_line_hold )      { irqn_line_set(machine, cpunum, 4, HOLD_LINE); }
663INTERRUPT_GEN( irq4_line_pulse )   { irqn_line_set(machine, cpunum, 4, PULSE_LINE); }
664INTERRUPT_GEN( irq4_line_assert )   { irqn_line_set(machine, cpunum, 4, ASSERT_LINE); }
665665
666INTERRUPT_GEN( irq5_line_hold )      { irqn_line_set(cpunum, 5, HOLD_LINE); }
667INTERRUPT_GEN( irq5_line_pulse )   { irqn_line_set(cpunum, 5, PULSE_LINE); }
668INTERRUPT_GEN( irq5_line_assert )   { irqn_line_set(cpunum, 5, ASSERT_LINE); }
666INTERRUPT_GEN( irq5_line_hold )      { irqn_line_set(machine, cpunum, 5, HOLD_LINE); }
667INTERRUPT_GEN( irq5_line_pulse )   { irqn_line_set(machine, cpunum, 5, PULSE_LINE); }
668INTERRUPT_GEN( irq5_line_assert )   { irqn_line_set(machine, cpunum, 5, ASSERT_LINE); }
669669
670INTERRUPT_GEN( irq6_line_hold )      { irqn_line_set(cpunum, 6, HOLD_LINE); }
671INTERRUPT_GEN( irq6_line_pulse )   { irqn_line_set(cpunum, 6, PULSE_LINE); }
672INTERRUPT_GEN( irq6_line_assert )   { irqn_line_set(cpunum, 6, ASSERT_LINE); }
670INTERRUPT_GEN( irq6_line_hold )      { irqn_line_set(machine, cpunum, 6, HOLD_LINE); }
671INTERRUPT_GEN( irq6_line_pulse )   { irqn_line_set(machine, cpunum, 6, PULSE_LINE); }
672INTERRUPT_GEN( irq6_line_assert )   { irqn_line_set(machine, cpunum, 6, ASSERT_LINE); }
673673
674INTERRUPT_GEN( irq7_line_hold )      { irqn_line_set(cpunum, 7, HOLD_LINE); }
675INTERRUPT_GEN( irq7_line_pulse )   { irqn_line_set(cpunum, 7, PULSE_LINE); }
676INTERRUPT_GEN( irq7_line_assert )   { irqn_line_set(cpunum, 7, ASSERT_LINE); }
674INTERRUPT_GEN( irq7_line_hold )      { irqn_line_set(machine, cpunum, 7, HOLD_LINE); }
675INTERRUPT_GEN( irq7_line_pulse )   { irqn_line_set(machine, cpunum, 7, PULSE_LINE); }
676INTERRUPT_GEN( irq7_line_assert )   { irqn_line_set(machine, cpunum, 7, ASSERT_LINE); }
677677
678678
679679
r1591r1592
685685    8-bit reset read/write handlers
686686-------------------------------------------------*/
687687
688WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(); }
689READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(); return 0xff; }
688WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(Machine); }
689READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(Machine); return 0xff; }
690690
691691
692692/*-------------------------------------------------
693693    16-bit reset read/write handlers
694694-------------------------------------------------*/
695695
696WRITE16_HANDLER( watchdog_reset16_w ) {   watchdog_reset(); }
697READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(); return 0xffff; }
696WRITE16_HANDLER( watchdog_reset16_w ) {   watchdog_reset(Machine); }
697READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(Machine); return 0xffff; }
698698
699699
700700/*-------------------------------------------------
701701    32-bit reset read/write handlers
702702-------------------------------------------------*/
703703
704WRITE32_HANDLER( watchdog_reset32_w ) {   watchdog_reset(); }
705READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(); return 0xffffffff; }
704WRITE32_HANDLER( watchdog_reset32_w ) {   watchdog_reset(Machine); }
705READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(Machine); return 0xffffffff; }
706706
707707
708708
src/emu/machine/8042kbdc.c
r1591r1592
599599             * the bits low set in the command byte.  The only pulse that has
600600             * an effect currently is bit 0, which pulses the CPU's reset line
601601             */
602         cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
602         cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
603603         at_8042_set_outport(kbdc8042.outport | 0x02, 0);
604604         break;
605605      }
src/emu/machine/8237dma.c
r1591r1592
209209      /* set the halt line */
210210      if (dma[which].intf && dma[which].intf->cpunum >= 0)
211211      {
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,
213213            pending_transfer ? ASSERT_LINE : CLEAR_LINE);
214214      }
215215
src/emu/machine/8257dma.c
r1591r1592
234234   /* set the halt line */
235235   if (dma[which].intf && dma[which].intf->cpunum >= 0)
236236   {
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,
238238         pending_transfer ? ASSERT_LINE : CLEAR_LINE);
239239   }
240240
src/emu/machine/tmp68301.c
r1591r1592
4747      tmp68301_irq_vector[level]   =   IVNR & 0x00e0;
4848      tmp68301_irq_vector[level]   +=   4+i;
4949
50      cpunum_set_input_line(0,level,HOLD_LINE);
50      cpunum_set_input_line(machine, 0,level,HOLD_LINE);
5151   }
5252
5353   if (TCR & 0x0080)   // N/1
r1591r1592
145145
146146         tmp68301_IE[i] = 0;      // Interrupts are edge triggerred
147147
148         cpunum_set_input_line(0,level,HOLD_LINE);
148         cpunum_set_input_line(Machine, 0,level,HOLD_LINE);
149149      }
150150   }
151151}
src/emu/cpuexec.c
r1591r1592
155155static void cpuexec_exit(running_machine *machine);
156156static void cpuexec_reset(running_machine *machine);
157157static void cpu_inittimers(running_machine *machine);
158static void cpu_vblankreset(void);
158static void cpu_vblankreset(running_machine *machine);
159159static TIMER_CALLBACK( cpu_vblankcallback );
160160static TIMER_CALLBACK( cpu_updatecallback );
161161static TIMER_CALLBACK( end_interleave_boost );
162static void compute_perfect_interleave(void);
163static void watchdog_setup(int alloc_new);
162static void compute_perfect_interleave(running_machine *machine);
163static void watchdog_setup(running_machine *machine, int alloc_new);
164164
165165
166166
r1591r1592
200200   /* allocate vblank and refresh timers, and compute the initial timing */
201201   vblank_timer = timer_alloc(cpu_vblankcallback, NULL);
202202   refresh_timer = timer_alloc(NULL, NULL);
203   cpu_compute_vblank_timing();
203   cpu_compute_vblank_timing(machine);
204204
205205   /* loop over all our CPUs */
206206   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
r1591r1592
260260   add_exit_callback(machine, cpuexec_exit);
261261
262262   /* compute the perfect interleave factor */
263   compute_perfect_interleave();
263   compute_perfect_interleave(machine);
264264
265265   /* save some stuff in the default tag */
266266   state_save_push_tag(0);
r1591r1592
286286   /* initialize the various timers (suspends all CPUs at startup) */
287287   cpu_inittimers(machine);
288288   watchdog_counter = WATCHDOG_IS_INVALID;
289   watchdog_setup(TRUE);
289   watchdog_setup(machine, TRUE);
290290
291291   /* first pass over CPUs */
292292   for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
r1591r1592
305305   }
306306
307307   /* reset the globals */
308   cpu_vblankreset();
308   cpu_vblankreset(machine);
309309   vblank = 0;
310310   current_frame = 0;
311311}
r1591r1592
355355 *
356356 *************************************/
357357
358static void watchdog_setup(int alloc_new)
358static void watchdog_setup(running_machine *machine, int alloc_new)
359359{
360360   if (watchdog_counter != WATCHDOG_IS_DISABLED)
361361   {
362      if (Machine->drv->watchdog_vblank_count)
362      if (machine->drv->watchdog_vblank_count)
363363      {
364364         /* Start a vblank based watchdog. */
365         watchdog_counter = Machine->drv->watchdog_vblank_count;
365         watchdog_counter = machine->drv->watchdog_vblank_count;
366366      }
367      else if (attotime_compare(Machine->drv->watchdog_time, attotime_zero) != 0)
367      else if (attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0)
368368      {
369369         /* Start a time based watchdog. */
370370         if (alloc_new)
371371            watchdog_timer = timer_alloc(watchdog_callback, NULL);
372         timer_adjust(watchdog_timer, Machine->drv->watchdog_time, 0, attotime_zero);
372         timer_adjust(watchdog_timer, machine->drv->watchdog_time, 0, attotime_zero);
373373         watchdog_counter = WATCHDOG_IS_TIMER_BASED;
374374      }
375375      else if (watchdog_counter == WATCHDOG_IS_INVALID)
r1591r1592
390390             * The 3 seconds delay is targeted at qzshowby, which otherwise
391391             * would reset at the start of a game.
392392             */
393         watchdog_counter = 3 * ATTOSECONDS_TO_HZ(Machine->screen[0].refresh);
393         watchdog_counter = 3 * ATTOSECONDS_TO_HZ(machine->screen[0].refresh);
394394      }
395395   }
396396}
r1591r1592
403403 *
404404 *************************************/
405405
406void watchdog_reset(void)
406void watchdog_reset(running_machine *machine)
407407{
408408   if (watchdog_counter == WATCHDOG_IS_TIMER_BASED)
409409   {
410      timer_reset(watchdog_timer, Machine->drv->watchdog_time);
410      timer_reset(watchdog_timer, machine->drv->watchdog_time);
411411   }
412412   else
413413   {
r1591r1592
417417         logerror("(vblank) watchdog armed by reset\n");
418418      }
419419
420      watchdog_setup(FALSE);
420      watchdog_setup(machine, FALSE);
421421   }
422422}
423423
r1591r1592
429429 *
430430 *************************************/
431431
432void watchdog_enable(int enable)
432void watchdog_enable(running_machine *machine, int enable)
433433{
434434   if (!enable)
435435   {
r1591r1592
442442   if (watchdog_counter == WATCHDOG_IS_DISABLED)
443443   {
444444      watchdog_counter = WATCHDOG_IS_BEING_STARTED;
445      watchdog_setup(FALSE);
445      watchdog_setup(machine, FALSE);
446446   }
447447}
448448
r1591r1592
460460 *
461461 *************************************/
462462
463void cpuexec_timeslice(void)
463void cpuexec_timeslice(running_machine *machine)
464464{
465465   attotime target = timer_next_fire_time();
466466   attotime base = timer_get_time();
r1591r1592
470470   LOG(("cpu_timeslice: target = %s\n", attotime_string(target, 9)));
471471
472472   /* process any pending suspends */
473   for (cpunum = 0; Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
473   for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
474474   {
475475      if (cpu[cpunum].suspend != cpu[cpunum].nextsuspend)
476476         LOG(("--> updated CPU%d suspend from %X to %X\n", cpunum, cpu[cpunum].suspend, cpu[cpunum].nextsuspend));
r1591r1592
479479   }
480480
481481   /* loop over CPUs */
482   for (cpunum = 0; Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
482   for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
483483   {
484484      /* only process if we're not suspended */
485485      if (!cpu[cpunum].suspend)
r1591r1592
525525   }
526526
527527   /* update the local times of all CPUs */
528   for (cpunum = 0; Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
528   for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
529529   {
530530      /* if we're suspended and counting, process */
531531      if (cpu[cpunum].suspend && cpu[cpunum].eatcycles && attotime_compare(cpu[cpunum].localtime, target) < 0)
r1591r1592
677677 *
678678 *************************************/
679679
680void cpunum_set_clock(int cpunum, int clock)
680void cpunum_set_clock(running_machine *machine, int cpunum, int clock)
681681{
682682   VERIFY_CPUNUM(cpunum_set_clock);
683683
r1591r1592
686686   attoseconds_per_cycle[cpunum] = ATTOSECONDS_PER_SECOND / ((double)clock * cpu[cpunum].clockscale);
687687
688688   /* re-compute the perfect interleave factor */
689   compute_perfect_interleave();
689   compute_perfect_interleave(machine);
690690}
691691
692692
693693
694void cpunum_set_clock_period(int cpunum, attoseconds_t clock_period)
694void cpunum_set_clock_period(running_machine *machine, int cpunum, attoseconds_t clock_period)
695695{
696696   VERIFY_CPUNUM(cpunum_set_clock);
697697
r1591r1592
700700   attoseconds_per_cycle[cpunum] = clock_period;
701701
702702   /* re-compute the perfect interleave factor */
703   compute_perfect_interleave();
703   compute_perfect_interleave(machine);
704704}
705705
706706
r1591r1592
727727 *
728728 *************************************/
729729
730void cpunum_set_clockscale(int cpunum, double clockscale)
730void cpunum_set_clockscale(running_machine *machine, int cpunum, double clockscale)
731731{
732732   VERIFY_CPUNUM(cpunum_set_clockscale);
733733
r1591r1592
736736   attoseconds_per_cycle[cpunum] = ATTOSECONDS_PER_SECOND / ((double)cpu[cpunum].clock * clockscale);
737737
738738   /* re-compute the perfect interleave factor */
739   compute_perfect_interleave();
739   compute_perfect_interleave(machine);
740740}
741741
742742
r1591r1592
898898 *
899899 *************************************/
900900
901void cpu_compute_vblank_timing(void)
901void cpu_compute_vblank_timing(running_machine *machine)
902902{
903   refresh_period = attotime_make(0, Machine->screen[0].refresh);
903   refresh_period = attotime_make(0, machine->screen[0].refresh);
904904
905905   /* recompute the vblank period */
906   vblank_period = attotime_make(0, Machine->screen[0].refresh / (vblank_multiplier ? vblank_multiplier : 1));
906   vblank_period = attotime_make(0, machine->screen[0].refresh / (vblank_multiplier ? vblank_multiplier : 1));
907907   if (vblank_timer != NULL && timer_enable(vblank_timer, FALSE))
908908   {
909909      attotime remaining = timer_timeleft(vblank_timer);
r1591r1592
954954 *
955955 *************************************/
956956
957void cpu_trigger(int trigger)
957void cpu_trigger(running_machine *machine, int trigger)
958958{
959959   int cpunum;
960960
r1591r1592
966966   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
967967   {
968968      /* if this is a dummy, stop looking */
969      if (Machine->drv->cpu[cpunum].type == CPU_DUMMY)
969      if (machine->drv->cpu[cpunum].type == CPU_DUMMY)
970970         break;
971971
972972      /* see if this is a matching trigger */
r1591r1592
988988
989989static TIMER_CALLBACK( cpu_triggertime_callback )
990990{
991   cpu_trigger(param);
991   cpu_trigger(machine, param);
992992}
993993
994994
r1591r1592
10051005 *
10061006 *************************************/
10071007
1008void cpu_triggerint(int cpunum)
1008void cpu_triggerint(running_machine *machine, int cpunum)
10091009{
1010   cpu_trigger(TRIGGER_INT + cpunum);
1010   cpu_trigger(machine, TRIGGER_INT + cpunum);
10111011}
10121012
10131013
r1591r1592
11431143 *
11441144 *************************************/
11451145
1146static void cpu_vblankreset(void)
1146static void cpu_vblankreset(running_machine *machine)
11471147{
11481148   int cpunum;
11491149
11501150   /* notify the video system of a VBLANK start */
1151   video_vblank_start(Machine);
1151   video_vblank_start(machine);
11521152
11531153   /* read keyboard & update the status of the input ports */
11541154   input_port_vblank_start();
r1591r1592
11591159      if (--watchdog_counter == 0)
11601160      {
11611161         logerror("reset caused by the (vblank) watchdog\n");
1162         mame_schedule_soft_reset(Machine);
1162         mame_schedule_soft_reset(machine);
11631163      }
11641164   }
11651165
r1591r1592
11671167   for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
11681168   {
11691169      if (!(cpu[cpunum].suspend & SUSPEND_REASON_DISABLE))
1170         cpu[cpunum].iloops = Machine->drv->cpu[cpunum].vblank_interrupts_per_frame - 1;
1170         cpu[cpunum].iloops = machine->drv->cpu[cpunum].vblank_interrupts_per_frame - 1;
11711171      else
11721172         cpu[cpunum].iloops = -1;
11731173   }
r1591r1592
12451245   {
12461246      /* do we update the screen now? */
12471247      if (!(machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
1248         video_frame_update(FALSE);
1248         video_frame_update(machine, FALSE);
12491249
12501250      /* Set the timer to update the screen */
12511251      timer_adjust(update_timer, attotime_make(0, machine->screen[0].vblank), 0, attotime_zero);
12521252
12531253      /* reset the globals */
1254      cpu_vblankreset();
1254      cpu_vblankreset(machine);
12551255
12561256      /* reset the counter */
12571257      vblank_countdown = vblank_multiplier;
r1591r1592
12751275{
12761276   /* update the screen if we didn't before */
12771277   if (machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)
1278      video_frame_update(FALSE);
1278      video_frame_update(machine, FALSE);
12791279   vblank = 0;
12801280
12811281   /* update IPT_VBLANK input ports */
r1591r1592
13181318
13191319static TIMER_CALLBACK( cpu_timeslicecallback )
13201320{
1321   cpu_trigger(TRIGGER_TIMESLICE);
1321   cpu_trigger(machine, TRIGGER_TIMESLICE);
13221322}
13231323
13241324
r1591r1592
13451345 *
13461346 *************************************/
13471347
1348static void compute_perfect_interleave(void)
1348static void compute_perfect_interleave(running_machine *machine)
13491349{
13501350   attoseconds_t smallest = attoseconds_per_cycle[0];
13511351   int cpunum;
r1591r1592
13531353   /* start with a huge time factor and find the 2nd smallest cycle time */
13541354   perfect_interleave = attotime_zero;
13551355   perfect_interleave.attoseconds = ATTOSECONDS_PER_SECOND - 1;
1356   for (cpunum = 1; Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
1356   for (cpunum = 1; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++)
13571357   {
13581358      /* find the 2nd smallest cycle interval */
13591359      if (attoseconds_per_cycle[cpunum] < smallest)
src/emu/rendlay.c
r1591r1592
19291929   if (xml_get_attribute(boundsnode, "left") != NULL)
19301930   {
19311931      /* 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);
19361936   }
19371937   else if (xml_get_attribute(boundsnode, "x") != NULL)
19381938   {
19391939      /* 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);
19441944   }
19451945   else
19461946   {
src/emu/cpuexec.h
r1591r1592
263263void cpuexec_init(running_machine *machine);
264264
265265/* Execute for a single timeslice */
266void cpuexec_timeslice(void);
266void cpuexec_timeslice(running_machine *machine);
267267
268268
269269
r1591r1592
274274 *************************************/
275275
276276/* bang on the watchdog */
277void watchdog_reset(void);
277void watchdog_reset(running_machine *machine);
278278
279279/* watchdog enabled when TRUE */
280280/* timer is set to reset state when going from disable to enable */
281void watchdog_enable(int enable);
281void watchdog_enable(running_machine *machine, int enable);
282282
283283
284284
r1591r1592
320320int cpunum_get_clock(int cpunum);
321321
322322/* Sets the current CPU's clock speed and then adjusts for scaling */
323void cpunum_set_clock(int cpunum, int clock);
324void cpunum_set_clock_period(int cpunum, attoseconds_t clock_period);
323void cpunum_set_clock(running_machine *machine, int cpunum, int clock);
324void cpunum_set_clock_period(running_machine *machine, int cpunum, attoseconds_t clock_period);
325325
326326/* Returns the current scaling factor for a CPU's clock speed */
327327double cpunum_get_clockscale(int cpunum);
328328
329329/* Sets the current scaling factor for a CPU's clock speed */
330void cpunum_set_clockscale(int cpunum, double clockscale);
330void cpunum_set_clockscale(running_machine *machine, int cpunum, double clockscale);
331331
332332/* Temporarily boosts the interleave factor */
333333void cpu_boost_interleave(attotime timeslice_time, attotime boost_duration);
r1591r1592
371371/***** These functions may eventually go away. */
372372
373373/* Recomputes the VBLANK timing after, e.g., a visible area change */
374void cpu_compute_vblank_timing(void);
374void cpu_compute_vblank_timing(running_machine *machine);
375375
376376/* Returns the number of the video frame we are currently playing */
377377int cpu_getcurrentframe(void);
r1591r1592
385385 *************************************/
386386
387387/* generate a trigger now */
388void cpu_trigger(int trigger);
388void cpu_trigger(running_machine *machine, int trigger);
389389
390390/* generate a trigger after a specific period of time */
391391void cpu_triggertime(attotime duration, int trigger);
392392
393393/* generate a trigger corresponding to an interrupt on the given CPU */
394void cpu_triggerint(int cpunum);
394void cpu_triggerint(running_machine *machine, int cpunum);
395395
396396/* burn CPU cycles until a timer trigger */
397397void cpu_spinuntil_trigger(int trigger);
src/emu/sound/hc55516.c
r1591r1592
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
115#include "sndintrf.h"
216#include "streams.h"
317#include "hc55516.h"
r1591r1592
418#include <math.h>
519
620
7/* default to 4x oversampling */
8#define DEFAULT_SAMPLE_RATE (48000 * 4)
21/* 4x oversampling */
22#define SAMPLE_RATE          (48000 * 4)
923
10
1124#define   INTEGRATOR_LEAK_TC      0.001
1225#define   FILTER_DECAY_TC         0.004
1326#define   FILTER_CHARGE_TC      0.004
r1591r1592
1932struct hc55516_data
2033{
2134   sound_stream *channel;
22   int      sample_rate;
35   int      clock;      /* 0 = software driven, non-0 = oscillator */
36   int      active_clock_hi;
2337
24   UINT8   last_clock;
25   UINT8   databit;
38   UINT8   last_clock_state;
39   UINT8   digit;
40   UINT8   new_digit;
2641   UINT8   shiftreg;
2742
28   INT16   curr_value;
29   INT16   next_value;
43   INT16   curr_sample;
44   INT16   next_sample;
3045
3146   UINT32   update_count;
3247
r1591r1592
4257
4358
4459
45static void *hc55516_start(int sndindex, int clock, const void *config)
60static void *start_common(int sndindex, int clock, const void *config, int _active_clock_hi)
4661{
4762   struct hc55516_data *chip;
4863
r1591r1592
5570   decay = pow(exp(-1), 1.0 / (FILTER_DECAY_TC * 16000.0));
5671   leak = pow(exp(-1), 1.0 / (INTEGRATOR_LEAK_TC * 16000.0));
5772
73   chip->clock = clock;
74   chip->active_clock_hi = _active_clock_hi;
75   chip->last_clock_state = 0;
76
5877   /* 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);
6179
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);
6483   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);
6786   state_save_register_item("hc55516", sndindex, chip->update_count);
6887   state_save_register_item("hc55516", sndindex, chip->filter);
6988   state_save_register_item("hc55516", sndindex, chip->integrator);
r1591r1592
7392}
7493
7594
95static void *hc55516_start(int sndindex, int clock, const void *config)
96{
97   return start_common(sndindex, clock, config, TRUE);
98}
99
100
101static void *mc3417_start(int sndindex, int clock, const void *config)
102{
103   return start_common(sndindex, clock, config, FALSE);
104}
105
106
107static void *mc3418_start(int sndindex, int clock, const void *config)
108{
109   return start_common(sndindex, clock, config, FALSE);
110}
111
112
113
114static void hc55516_reset(void *chip)
115{
116   ((struct hc55516_data *)chip)->last_clock_state = 0;
117}
118
119
120
121INLINE int is_external_osciallator(struct hc55516_data *chip)
122{
123   return chip->clock != 0;
124}
125
126
127INLINE 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
134INLINE int current_clock_state(struct hc55516_data *chip)
135{
136   return ((UINT64)chip->update_count * chip->clock * 2 / SAMPLE_RATE) & 0x01;
137}
138
139
140static 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
76187static void hc55516_update(void *param, stream_sample_t **inputs, stream_sample_t **_buffer, int length)
77188{
78189   struct hc55516_data *chip = param;
79190   stream_sample_t *buffer = _buffer[0];
80   INT32 data, slope;
81191   int i;
192   INT32 sample, slope;
82193
83194   /* zero-length? bail */
84195   if (length == 0)
85196      return;
86197
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))
90199   {
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      }
93207   }
94208
95209   /* 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;
99213
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;
104220
221         *buffer++ = sample;
105222
106void 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++;
110224
111   /* update the clock */
112   diffclock = clock ^ chip->last_clock;
113   chip->last_clock = clock;
225         clock_state = current_clock_state(chip);
114226
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;
119231
120      /* clear the update count */
121      chip->update_count = 0;
232            process_digit(chip);
233         }
122234
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;
128236      }
129      else
130      {
131         chip->shiftreg = (chip->shiftreg << 1) & 7;
132         integrator -= chip->filter;
133      }
237   }
134238
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}
137244
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      }
145245
146      /* simulate decay */
147      else
148      {
149         chip->filter *= decay;
150         if (chip->filter < FILTER_MIN)
151            chip->filter = FILTER_MIN;
152      }
246void 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;
153250
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));
157253
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   {
164257      /* update the output buffer before changing the registers */
165258      stream_update(chip->channel);
259
260      /* clear the update count */
261      chip->update_count = 0;
262
263      process_digit(chip);
166264   }
265
266   /* update the clock */
267   chip->last_clock_state = clock_state;
167268}
168269
169270
170void hc55516_digit_w(int num, int data)
271void hc55516_digit_w(int num, int digit)
171272{
172273   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;
174282}
175283
176284
177void hc55516_clock_clear_w(int num, int data)
285void hc55516_clock_clear_w(int num)
178286{
179287   hc55516_clock_w(num, 0);
180288}
181289
182290
183void hc55516_clock_set_w(int num, int data)
291void hc55516_clock_set_w(int num)
184292{
185293   hc55516_clock_w(num, 1);
186294}
187295
188296
189void hc55516_digit_clock_clear_w(int num, int data)
297void hc55516_digit_clock_clear_w(int num, int digit)
190298{
191299   struct hc55516_data *chip = sndti_token(SOUND_HC55516, num);
192   chip->databit = data & 1;
300   chip->digit = digit & 1;
193301   hc55516_clock_w(num, 0);
194302}
195303
196304
197WRITE8_HANDLER( hc55516_0_digit_w )   { hc55516_digit_w(0,data); }
198WRITE8_HANDLER( hc55516_0_clock_w )   { hc55516_clock_w(0,data); }
199WRITE8_HANDLER( hc55516_0_clock_clear_w )   { hc55516_clock_clear_w(0,data); }
200WRITE8_HANDLER( hc55516_0_clock_set_w )      { hc55516_clock_set_w(0,data); }
201WRITE8_HANDLER( hc55516_0_digit_clock_clear_w )   { hc55516_digit_clock_clear_w(0,data); }
305int hc55516_clock_state_r(int num)
306{
307   struct hc55516_data *chip = sndti_token(SOUND_HC55516, num);
202308
203WRITE8_HANDLER( hc55516_1_digit_w ) { hc55516_digit_w(1,data); }
204WRITE8_HANDLER( hc55516_1_clock_w ) { hc55516_clock_w(1,data); }
205WRITE8_HANDLER( hc55516_1_clock_clear_w ) { hc55516_clock_clear_w(1,data); }
206WRITE8_HANDLER( hc55516_1_clock_set_w )  { hc55516_clock_set_w(1,data); }
207WRITE8_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));
208311
312   stream_update(chip->channel);
209313
314   return current_clock_state(chip);
315}
210316
211317
212318
319WRITE8_HANDLER( hc55516_0_digit_w )   { hc55516_digit_w(0, data); }
320WRITE8_HANDLER( hc55516_0_clock_w )   { hc55516_clock_w(0, data); }
321WRITE8_HANDLER( hc55516_0_clock_clear_w )   { hc55516_clock_clear_w(0); }
322WRITE8_HANDLER( hc55516_0_clock_set_w )      { hc55516_clock_set_w(0); }
323WRITE8_HANDLER( hc55516_0_digit_clock_clear_w )   { hc55516_digit_clock_clear_w(0, data); }
324READ8_HANDLER ( hc55516_0_clock_state_r )   { return hc55516_clock_state_r(0); }
325
326WRITE8_HANDLER( hc55516_1_digit_w ) { hc55516_digit_w(1, data); }
327WRITE8_HANDLER( hc55516_1_clock_w ) { hc55516_clock_w(1, data); }
328WRITE8_HANDLER( hc55516_1_clock_clear_w ) { hc55516_clock_clear_w(1); }
329WRITE8_HANDLER( hc55516_1_clock_set_w )  { hc55516_clock_set_w(1); }
330WRITE8_HANDLER( hc55516_1_digit_clock_clear_w ) { hc55516_digit_clock_clear_w(1, data); }
331READ8_HANDLER ( hc55516_1_clock_state_r )   { return hc55516_clock_state_r(1); }
332
333
334
213335/**************************************************************************
214336 * Generic get_info
215337 **************************************************************************/
216338
217static void hc55516_set_info(void *token, UINT32 state, sndinfo *info)
218{
219   switch (state)
220   {
221      /* no parameters to set */
222   }
223}
224
225
226339void hc55516_get_info(void *token, UINT32 state, sndinfo *info)
227340{
228341   switch (state)
229342   {
230343      /* --- the following bits of info are returned as 64-bit signed integers --- */
344      case SNDINFO_INT_ALIAS:                     info->i = SOUND_HC55516;            break;
231345
232346      /* --- 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;
234347      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;
237349
238350      /* --- 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;
242354      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
243355      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
244356   }
245357}
246358
359
360void 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
372void 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}
src/emu/sound/hc55516.h
r1591r1592
22#define HC55516_H
33
44
5/* sets the databit (0 or 1) */
6void hc55516_digit_w(int num, int data);
5/* sets the digit (0 or 1) */
6void hc55516_digit_w(int num, int digit);
77
88/* sets the clock state (0 or 1, clocked on the rising edge) */
99void hc55516_clock_w(int num, int state);
1010
1111/* clears or sets the clock state */
12void hc55516_clock_clear_w(int num, int data);
13void hc55516_clock_set_w(int num, int data);
12void hc55516_clock_clear_w(int num);
13void hc55516_clock_set_w(int num);
1414
15/* clears the clock state and sets the databit */
16void hc55516_digit_clock_clear_w(int num, int data);
15/* clears the clock state and sets the digit */
16void hc55516_digit_clock_clear_w(int num, int digit);
1717
18/* returns whether the clock is currently LO or HI */
19int hc55516_clock_state_r(int num);
20
1821WRITE8_HANDLER( hc55516_0_digit_w );
1922WRITE8_HANDLER( hc55516_0_clock_w );
2023WRITE8_HANDLER( hc55516_0_clock_clear_w );
2124WRITE8_HANDLER( hc55516_0_clock_set_w );
2225WRITE8_HANDLER( hc55516_0_digit_clock_clear_w );
26READ8_HANDLER ( hc55516_0_clock_state_r );
2327
2428WRITE8_HANDLER( hc55516_1_digit_w );
2529WRITE8_HANDLER( hc55516_1_clock_w );
2630WRITE8_HANDLER( hc55516_1_clock_clear_w );
2731WRITE8_HANDLER( hc55516_1_clock_set_w );
2832WRITE8_HANDLER( hc55516_1_digit_clock_clear_w );
33READ8_HANDLER ( hc55516_1_clock_state_r );
2934
3035
3136#endif
src/emu/sound/tms5110.c
r1591r1592
8585struct tms5110
8686{
8787   /* coefficient tables */
88   int variant;            /* Variant of the 5110 - see tms5110.h */
89
90   /* coefficient tables */
8891   const struct tms5100_coeffs *coeff;
92
8993   /* these contain data that describes the 64 bits FIFO */
9094   UINT8 fifo[FIFO_SIZE];
9195   UINT8 fifo_head;
r1591r1592
149153
150154#define DEBUG_5110   0
151155
152
153void *tms5110_create(int index, int variant)
156void tms5110_set_variant(void *chip, int variant)
154157{
155   struct tms5110 *tms;
158   struct tms5110 *tms = chip;
156159
157   tms = malloc_or_die(sizeof(*tms));
158   memset(tms, 0, sizeof(*tms));
159
160160   switch (variant)
161161   {
162162      case TMS5110_IS_5110A:
r1591r1592
172172         fatalerror("Unknown variant in tms5110_create\n");
173173   }
174174
175   tms->variant = variant;
176}
177
178void *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
175187   state_save_register_item_array("tms5110", index, tms->fifo);
176188   state_save_register_item("tms5110", index, tms->fifo_head);
177189   state_save_register_item("tms5110", index, tms->fifo_tail);
src/emu/sound/tms5110.h
r1591r1592
2828void *tms5110_create(int index, int variant);
2929void tms5110_destroy(void *chip);
3030
31void tms5110_set_variant(void *chip, int variant);
32
3133void tms5110_reset_chip(void *chip);
3234void tms5110_set_M0_callback(void *chip, int (*func)(void));
3335void tms5110_set_load_address(void *chip, void (*func)(int));
src/emu/sound/disc_inp.c
r1591r1592
255255void dss_input_stream_step(node_description *node)
256256{
257257   // 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;
259260
260   node->output = data ? *data++ * DSS_INPUT_STREAM__GAIN + DSS_INPUT_STREAM__OFFSET : 0;
261   node->output = data ? (*data) * DSS_INPUT_STREAM__GAIN + DSS_INPUT_STREAM__OFFSET : 0;
261262}
263
264void 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}
src/emu/sound/scsplfo.c
r1591r1592
2828
2929static int PLFO_TRI[256],PLFO_SQR[256],PLFO_SAW[256],PLFO_NOI[256];
3030static int ALFO_TRI[256],ALFO_SQR[256],ALFO_SAW[256],ALFO_NOI[256];
31static 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};
33static const float ASCALE[8]={0.0,0.4,0.8,1.5,3.0,6.0,12.0,24.0};
34static const float PSCALE[8]={0.0,7.0,13.5,27.0,55.0,112.0,230.0,494};
31static 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};
36static const float ASCALE[8]={0.0f,0.4f,0.8f,1.5f,3.0f,6.0f,12.0f,24.0f};
37static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f};
3538static int PSCALES[8][256];
3639static int ASCALES[8][256];
3740
src/emu/sound/sidvoice.c
r1591r1592
3232   INT32 si, sj    ;
3333
3434   /* 8-bit volume modulation tables. */
35   float filterAmpl = 1.0;
35   float filterAmpl = 0.7f;
3636
37   filterAmpl = 0.7;
38
3937   ampMod1x8=(INT8*) auto_malloc(256*256);
4038
4139   uk = 0;
src/emu/sound/sid.c
r1591r1592
156156   UINT16 uk;
157157   /* Parameter calculation has not been moved to a separate function */
158158   /* by purpose. */
159   const float filterRefFreq = 44100.0;
159   const float filterRefFreq = 44100.0f;
160160
161   float yMax = 1.0;
162   float yMin = 0.01;
161   float yMax = 1.0f;
162   float yMin = 0.01f;
163163   float yAdd;
164164   float yTmp, rk, rk2;
165165
r1591r1592
183183   }
184184
185185   /*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;
189189   yTmp = yMin;
190190   uk = 0;
191191   /* Some C++ compilers still have non-local scope! */
r1591r1592
197197   }
198198
199199   /*extern float filterResTable[16]; */
200   resDyMax = 1.0;
201   resDyMin = 2.0;
200   resDyMax = 1.0f;
201   resDyMin = 2.0f;
202202   resDy = resDyMin;
203203   for ( uk = 0; uk < 16; uk++ )
204204   {
r1591r1592
282282         {
283283            This->filter.Value = 0x7ff & ( (This->reg[0x15]&7) | ( (UINT16)This->reg[0x16] << 3 ));
284284            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;
286286            else
287               This->filter.Dy = lowPassParam ? lowPassParam[This->filter.Value] : 0.0;
287               This->filter.Dy = lowPassParam ? lowPassParam[This->filter.Value] : 0.0f;
288288            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;
291291         }
292292
293293         sidEmuSet( &This->optr1 );
src/emu/sound/discrete.c
r1591r1592
7474
7575   /* the input streams */
7676   int discrete_input_streams;
77   stream_sample_t **input_stream_data[DISCRETE_MAX_OUTPUTS];
77   stream_sample_t *input_stream_data[DISCRETE_MAX_OUTPUTS];
7878
7979   /* output node tracking */
8080   int discrete_outputs;
r1591r1592
175175   { DSS_INPUT_LOGIC ,"DSS_INPUT_LOGIC" ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
176176   { DSS_INPUT_NOT   ,"DSS_INPUT_NOT"   ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
177177   { DSS_INPUT_PULSE ,"DSS_INPUT_PULSE" ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_pulse_step },
178   { DSS_INPUT_STREAM,"DSS_INPUT_STREAM",0                                      ,NULL                  ,dss_input_stream_step},
178   { DSS_INPUT_STREAM,"DSS_INPUT_STREAM",0                                      ,dss_input_stream_reset,dss_input_stream_step},
179179
180180   /* from disc_wav.c */
181181   /* Generic modules */
r1591r1592
443443   /* Setup any input streams */
444444   for (nodenum = 0; nodenum < info->discrete_input_streams; nodenum++)
445445   {
446      *info->input_stream_data[nodenum] = inputs[nodenum];
446      info->input_stream_data[nodenum] = inputs[nodenum];
447447   }
448448
449449   /* Now we must do length iterations of the node list, one output for each step */
r1591r1592
500500            wav_add_data_16lr(info->disc_wav_file[outputnum], &wave_data_l, &wave_data_r, 1);
501501         }
502502      }
503
504      /* advance input streams */
505      for (nodenum = 0; nodenum < info->discrete_input_streams; nodenum++)
506      {
507         info->input_stream_data[nodenum]++;
508      }
503509   }
504510
505511   discrete_current_context = NULL;
r1591r1592
616622         if (info->discrete_input_streams == DISCRETE_MAX_OUTPUTS)
617623            fatalerror("init_nodes() - There can not be more then %d input stream nodes", DISCRETE_MAX_OUTPUTS);
618624         /* 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++;
620628      }
621629   }
622630
src/emu/sound/discrete.h
r1591r1592
126126 * DISCRETE_INPUT_NOT(NODE)
127127 * DISCRETE_INPUTX_NOT(NODE,GAIN,OFFSET,INIT)
128128 * 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)
131131 *
132132 * DISCRETE_COUNTER(NODE,ENAB,RESET,CLK,MAX,DIR,INIT0,CLKTYPE)
133133 * DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK)
r1591r1592
349349 *
350350 ***********************************************************************
351351 *
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.
353355 *
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 *
358356 *  Declaration syntax
359357 *
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)
362360 *
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
366362 *       set it's gain to 100% and then use DISCRETE_INPUTX_STREAM to adjust
367363 *       it if needed.
368364 *
r1591r1592
38283824#define DISCRETE_INPUT_NOT(NODE)                                        { NODE, DSS_INPUT_NOT   , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,0 }, NULL, "Input Not" },
38293825#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" },
38303826#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" },
38333829
38343830/* from disc_wav.c */
38353831/* generic modules */
src/emu/sound/scsp.c
r1591r1592
4040
4141
4242#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
4445
4546// include the LFO handling code
4647#include "scsplfo.c"
r1591r1592
231232#define scsp_dexe       scsp_regs[0x16/2] & 0x1000
232233#define dma_transfer_end   ((scsp_regs[0x24/2] & 0x10)>>4)|(((scsp_regs[0x26/2] & 0x10)>>4)<<1)|(((scsp_regs[0x28/2] & 0x10)>>4)<<2)
233234
234static const float SDLT[8]={-1000000.0,-36.0,-30.0,-24.0,-18.0,-12.0,-6.0,0.0};
235static const float SDLT[8]={-1000000.0f,-36.0f,-30.0f,-24.0f,-18.0f,-12.0f,-6.0f,0.0f};
235236
236237static stream_sample_t *bufferl;
237238static stream_sample_t *bufferr;
r1591r1592
333334   SCSP->TimCnt[1] = 0xFFFF;
334335   SCSP->udata.data[0x20/2]|=0x80;
335336   SCSP->udata.data[0x1a/2]&=0xff00;
336   SCSP->udata.data[0x1a/2]|=SCSP->TimCnt[0]>>8;
337   SCSP->udata.data[0x1a/2]|=SCSP->TimCnt[1]>>8;
337338
338339   CheckPendingIRQ(SCSP);
339340}
r1591r1592
345346   SCSP->TimCnt[2] = 0xFFFF;
346347   SCSP->udata.data[0x20/2]|=0x100;
347348   SCSP->udata.data[0x1c/2]&=0xff00;
348   SCSP->udata.data[0x1c/2]|=SCSP->TimCnt[0]>>8;
349   SCSP->udata.data[0x1c/2]|=SCSP->TimCnt[2]>>8;
349350
350351   CheckPendingIRQ(SCSP);
351352}
r1591r1592
501502   slot->udata.data[0]&=~0x800;
502503}
503504
504#define log_base_2(n) (log((float) n)/log((float) 2))
505#define log_base_2(n) (log((double)(n))/log(2.0))
505506
506507static void SCSP_Init(struct _SCSP *SCSP, const struct SCSPinterface *intf, int sndindex)
507508{
r1591r1592
540541
541542   for(i=0;i<0x400;++i)
542543   {
543      //float fcent=(double) 1200.0*log_base_2((double)(((double) 1024.0+(double)i)/(double)1024.0));
544      //float fcent=(double) 1200.0*log_base_2((1024.0+(double)i)/1024.0);
544545      //fcent=(double) 44100.0*pow(2.0,fcent/1200.0);
545      float fcent=44100.0*(1024.0+(double) i)/1024.0;
546      float fcent=44100.0f*(1024.0f+(float)i)/1024.0f;
546547      FNS_Table[i]=(float) (1<<SHIFT) *fcent;
547548   }
548549
549550   for(i=0;i<0x400;++i)
550551   {
551      float envDB=((float)(3*(i-0x3ff)))/32.0;
552      float envDB=((float)(3*(i-0x3ff)))/32.0f;
552553      float scale=(float)(1<<SHIFT);
553554      EG_TABLE[i]=(INT32)(pow(10.0,envDB/20.0)*scale);
554555   }
r1591r1592
558559      int iTL =(i>>0x0)&0xff;
559560      int iPAN=(i>>0x8)&0x1f;
560561      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;
565566      float LPAN,RPAN;
566567
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;
575576
576577      TL=pow(10.0,SegaDB/20.0);
577578
578579      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;
583584
584585      if((iPAN&0xf)==0xf) PAN=0.0;
585586      else PAN=pow(10.0,SegaDB/20.0);
r1591r1592
10091010   }
10101011
10111012    for (addr_select=0;addr_select<2;addr_select++)
1012     {
1013    {
1014      INT32 rem_addr;
10131015       switch(LPCTL(slot))
10141016        {
10151017       case 0:   //no loop
r1591r1592
10211023          break;
10221024       case 1: //normal loop
10231025          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         }
10251030          break;
10261031       case 2:   //reverse loop
10271032          if((*addr[addr_select]>=LSA(slot)) && !(slot->Backwards))
10281033          {
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;
10301036             slot->Backwards=1;
10311037          }
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         }
10341043          break;
10351044       case 3: //ping-pong
10361045          if(*addr[addr_select]>=LEA(slot)) //reached end, reverse till start
10371046          {
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;
10391049             slot->Backwards=1;
10401050          }
1041          if((*addr[addr_select]<=LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards)//reached start or negative
1051         else if((*addr[addr_select]<LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards)//reached start or negative
10421052          {
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;
10441055             slot->Backwards=0;
10451056          }
10461057          break;
r1591r1592
11811192
11821193   /*Job done,request a dma end irq*/
11831194   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);
11851196}
11861197
11871198#ifdef UNUSED_FUNCTION
r1591r1592
12961307      case 0x42a:
12971308         if(stv_scu && !(stv_scu[40] & 0x40) /*&& scsp_regs[0x42c/2] & 0x20*/)/*Main CPU allow sound irq*/
12981309         {
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);
13001311             logerror("SCSP: Main CPU interrupt\n");
13011312         }
13021313      break;
src/emu/sound/msm5232.c
r1591r1592
186186   {
187187      double clockscale = (double)chip->clock / 2119040.0;
188188      double time = (ATBL[i] / 1000.0) / clockscale;   /* attack time in seconds */
189      chip->ar_tbl[i] = (float)0.50 * ( (1.0/time) / (double)chip->rate );
189      chip->ar_tbl[i] = 0.50 * ( (1.0/time) / (double)chip->rate );
190190      /* logerror("ATBL[%i] = %20.16f time = %f s\n",i, chip->ar_tbl[i], time); */
191191   }
192192
r1591r1592
194194   {
195195      double clockscale = (double)chip->clock / 2119040.0;
196196      double time = (DTBL[i] / 1000.0) / clockscale;   /* decay time in seconds */
197      chip->dr_tbl[i] = (float)0.50 * ( (1.0/time) / (double)chip->rate );
197      chip->dr_tbl[i] = 0.50 * ( (1.0/time) / (double)chip->rate );
198198      /* logerror("DTBL[%i] = %20.16f time = %f s\n",i, chip->dr_tbl[i], time); */
199199   }
200200}
src/emu/sound/s14001a.c
r1591r1592
1313 1.01 fixed clipping problem - LN (0.111u5)
1414 1.1 add VSU-1000 features, fully fixed stream update by fixing word latching - LN (0.111u6)
1515 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)
1618
1719 TODO:
1820 * 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)
r1591r1592
156158   UINT8 audioout; // filtered audio output
157159   UINT8 *SpeechRom; // array to hold rom contents, mame will not need this, will use a pointer
158160   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
162162} S14001AChip;
163163
164164//#define DEBUGSTATE
r1591r1592
437437   mixp = &mix[0];
438438   for (i = 0; i < length; i++)
439439   {
440      if (--chip->VSU1000_counter==0)
441        {
442        s14001a_clock(chip);
443        chip->VSU1000_counter = chip->VSU1000_freq;
444        }
440      s14001a_clock(chip);
445441      outputs[0][i] = ((((INT16)chip->audioout)-128)<<6)*chip->VSU1000_amp;
446442   }
447443}
r1591r1592
459455   chip->GlobalSilenceState = 1;
460456   chip->OldDelta = 0x02;
461457   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 */
465458
466459   for (i = 0; i < 8; i++)
467460   {
r1591r1592
472465
473466   chip->SpeechRom = memory_region(intf->region);
474467
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);
476469
477470   return chip;
478471}
r1591r1592
488481int S14001A_bsy_0_r(void)
489482{
490483   S14001AChip *chip = sndti_token(SOUND_S14001A, 0);
491        stream_update(chip->stream);
484   stream_update(chip->stream);
492485#ifdef DEBUGSTATE
493486   fprintf(stderr,"busy state checked: %d\n",(chip->machineState != 0) );
494487#endif
r1591r1592
506499{
507500   S14001AChip *chip = sndti_token(SOUND_S14001A, 0);
508501   stream_update(chip->stream);
509        chip->LatchedWord = chip->WordInput;
502   chip->LatchedWord = chip->WordInput;
510503   chip->resetState = (data==1);
511504   chip->machineState = chip->resetState ? 1 : chip->machineState;
512505}
513506
514void S14001A_set_rate(int newrate)
507void S14001A_set_clock(int clock)
515508{
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);
519511}
520512
521513void S14001A_set_volume(int volume)
522514{
523515   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;
526518}
527519
528520void s14001a_get_info(void *token, UINT32 state, sndinfo *info)
529521{
530522   switch (state)
531523   {
532      /* --- the following bits of info are returned as 64-bit signed integers --- */
533
534524      /* --- the following bits of info are returned as pointers to data or functions --- */
535525      case SNDINFO_PTR_SET_INFO:               info->set_info = s14001a_set_info;   break;
536526      case SNDINFO_PTR_START:                  info->start = s14001a_start;      break;
537      case SNDINFO_PTR_STOP:                  /* Nothing */            break;
538      case SNDINFO_PTR_RESET:                  /* Nothing */            break;
539527
540528      /* --- 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;
544532      case SNDINFO_STR_CORE_FILE:               info->s = __FILE__;         break;
545      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Jonathan Gevaryahu"; break;
533      case SNDINFO_STR_CORE_CREDITS:            info->s = "Copyright Jonathan Gevaryahu"; break;
546534   }
547535}
548
src/emu/sound/s14001a.h
r1591r1592
99int S14001A_bsy_0_r(void);           /* read BUSY pin */
1010void S14001A_reg_0_w(int data);      /* write to input latch */
1111void S14001A_rst_0_w(int data);      /* write to RESET pin */
12void S14001A_set_rate(int newrate);     /* set VSU-1000 clock divider */
12void S14001A_set_clock(int clock);     /* set VSU-1000 clock */
1313void S14001A_set_volume(int volume);    /* set VSU-1000 volume control */
1414
1515#endif
src/emu/sound/sound.mak
r1591r1592
580580# Texas Instruments TMS5110 speech synthesizers
581581#-------------------------------------------------
582582
583SOUNDDEFS += -DHAS_TMS5100=$(if $(filter TMS5100,$(SOUNDS)),1,0)
583584SOUNDDEFS += -DHAS_TMS5110=$(if $(filter TMS5110,$(SOUNDS)),1,0)
585SOUNDDEFS += -DHAS_TMS5110A=$(if $(filter TMS5110A,$(SOUNDS)),1,0)
586SOUNDDEFS += -DHAS_CD2801=$(if $(filter CD2801,$(SOUNDS)),1,0)
587SOUNDDEFS += -DHAS_TMC0281=$(if $(filter TMC0281,$(SOUNDS)),1,0)
588SOUNDDEFS += -DHAS_CD2802=$(if $(filter CD2802,$(SOUNDS)),1,0)
589SOUNDDEFS += -DHAS_M58817=$(if $(filter M58817,$(SOUNDS)),1,0)
590SOUNDDEFS += -DHAS_TMS5110=$(if $(filter TMS5110,$(SOUNDS)),1,0)
584591SOUNDDEFS += -DHAS_TMC0285=$(if $(filter TMC0285,$(SOUNDS)),1,0)
585592SOUNDDEFS += -DHAS_TMS5200=$(if $(filter TMS5200,$(SOUNDS)),1,0)
586593SOUNDDEFS += -DHAS_TMS5220=$(if $(filter TMS5220,$(SOUNDS)),1,0)
src/emu/sound/5110intf.c
r1591r1592
6666
6767static void *tms5110_start(int sndindex, int clock, const void *config)
6868{
69   static const struct TMS5110interface dummy = { TMS5110_IS_5110A, -1 };
69   static const struct TMS5110interface dummy = { -1 };
7070   struct tms5110_info *info;
7171
7272   info = auto_malloc(sizeof(*info));
7373   memset(info, 0, sizeof(*info));
7474   info->intf = config ? config : &dummy;
7575
76   info->chip = tms5110_create(sndindex, info->intf->variant);
76   info->chip = tms5110_create(sndindex, TMS5110_IS_5110A);
7777   if (!info->chip)
7878      return NULL;
7979   sndintrf_register_token(info);
r1591r1592
104104    return info;
105105}
106106
107static 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}
107113
114static 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}
108120
121static 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
128static 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
135static 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
142static 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
109150/******************************************************************************
110151
111152     tms5110_stop -- free buffers
r1591r1592
251292   }
252293}
253294
254
255295void tms5110_get_info(void *token, UINT32 state, sndinfo *info)
256296{
257297   switch (state)
258298   {
259299      /* --- the following bits of info are returned as 64-bit signed integers --- */
300      case SNDINFO_INT_ALIAS:                     info->i = SOUND_TMS5110;            break;
260301
261302      /* --- the following bits of info are returned as pointers to data or functions --- */
262303      case SNDINFO_PTR_SET_INFO:                  info->set_info = tms5110_set_info;      break;
r1591r1592
273314   }
274315}
275316
317void 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
327void 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
337void 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
347void 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
357void 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
367void 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
src/emu/sound/sidenvel.c
r1591r1592
5050{
5151  /* milliseconds */
5252#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
5555#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
6060#endif
6161};
6262
r1591r1592
6464{
6565  /* milliseconds */
6666#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
6969#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
7474#endif
7575};
7676
src/emu/sound/5110intf.h
r1591r1592
77
88struct TMS5110interface
99{
10   int variant;            /* Variant of the 5110 - see tms5110.h */
1110   int rom_region;            /* set to -1 to specifiy callbacks below */
1211   int (*M0_callback)(void);   /* function to be called when chip requests another bit */
1312   void (*load_address)(int addr);   /* speech ROM load address callback */
src/emu/sound/sidenvel.h
r1591r1592
1313extern const ptr2sidUwordFunc enveModeTable[];   // -> envelope.cpp
1414extern const UINT8 masterVolumeLevels[16];  // -> envelope.cpp
1515
16static const UINT8 ENVE_STARTATTACK = 0;
17static const UINT8 ENVE_STARTRELEASE = 2;
16enum
17{
18   ENVE_STARTATTACK = 0,
19   ENVE_STARTRELEASE = 2,
1820
19static const UINT8 ENVE_ATTACK = 4;
20static const UINT8 ENVE_DECAY = 6;
21static const UINT8 ENVE_SUSTAIN = 8;
22static const UINT8 ENVE_RELEASE = 10;
23static const UINT8 ENVE_SUSTAINDECAY = 12;
24static 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,
2527
26static const UINT8 ENVE_STARTSHORTATTACK = 16;
27static const UINT8 ENVE_SHORTATTACK = 16;
28   ENVE_STARTSHORTATTACK = 16,
29   ENVE_SHORTATTACK = 16,
2830
29static const UINT8 ENVE_ALTER = 32;
31   ENVE_ALTER = 32
32};
3033
3134
3235#endif
src/emu/ui.c
r1591r1592
7474   INT32         defval;            /* default value */
7575   INT32         maxval;            /* maximum value */
7676   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 */
7878   int            arg;            /* argument */
7979};
8080
r1591r1592
8888static render_font *ui_font;
8989
9090/* current UI handler */
91static UINT32 (*ui_handler_callback)(UINT32);
91static UINT32 (*ui_handler_callback)(running_machine *, UINT32);
9292static UINT32 ui_handler_param;
9393
9494/* flag to track single stepping */
r1591r1592
130130static int sprintf_warnings(char *buffer);
131131
132132/* UI handlers */
133static UINT32 handler_messagebox(UINT32 state);
134static UINT32 handler_messagebox_ok(UINT32 state);
135static UINT32 handler_messagebox_anykey(UINT32 state);
136static UINT32 handler_ingame(UINT32 state);
137static UINT32 handler_slider(UINT32 state);
138static UINT32 handler_load_save(UINT32 state);
133static UINT32 handler_messagebox(running_machine *machine, UINT32 state);
134static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state);
135static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state);
136static UINT32 handler_ingame(running_machine *machine, UINT32 state);
137static UINT32 handler_slider(running_machine *machine, UINT32 state);
138static UINT32 handler_load_save(running_machine *machine, UINT32 state);
139139
140140/* slider controls */
141141static void slider_init(void);
142142static void slider_display(const char *text, int minval, int maxval, int defval, int curval);
143143static void slider_draw_bar(float leftx, float topy, float width, float height, float percentage, float default_percentage);
144static INT32 slider_volume(INT32 newval, char *buffer, int arg);
145static INT32 slider_mixervol(INT32 newval, char *buffer, int arg);
146static INT32 slider_adjuster(INT32 newval, char *buffer, int arg);
147static INT32 slider_overclock(INT32 newval, char *buffer, int arg);
148static INT32 slider_refresh(INT32 newval, char *buffer, int arg);
149static INT32 slider_brightness(INT32 newval, char *buffer, int arg);
150static INT32 slider_contrast(INT32 newval, char *buffer, int arg);
151static INT32 slider_gamma(INT32 newval, char *buffer, int arg);
152static INT32 slider_xscale(INT32 newval, char *buffer, int arg);
153static INT32 slider_yscale(INT32 newval, char *buffer, int arg);
154static INT32 slider_xoffset(INT32 newval, char *buffer, int arg);
155static INT32 slider_yoffset(INT32 newval, char *buffer, int arg);
156static INT32 slider_flicker(INT32 newval, char *buffer, int arg);
157static INT32 slider_beam(INT32 newval, char *buffer, int arg);
144static INT32 slider_volume(running_machine *machine, INT32 newval, char *buffer, int arg);
145static INT32 slider_mixervol(running_machine *machine, INT32 newval, char *buffer, int arg);
146static INT32 slider_adjuster(running_machine *machine, INT32 newval, char *buffer, int arg);
147static INT32 slider_overclock(running_machine *machine, INT32 newval, char *buffer, int arg);
148static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer, int arg);
149static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buffer, int arg);
150static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffer, int arg);
151static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer, int arg);
152static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer, int arg);
153static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer, int arg);
154static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer, int arg);
155static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, int arg);
156static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, int arg);
157static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, int arg);
158static char *slider_get_screen_desc(int arg);
158159#ifdef MAME_DEBUG
159static INT32 slider_crossscale(INT32 newval, char *buffer, int arg);
160static INT32 slider_crossoffset(INT32 newval, char *buffer, int arg);
160static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, int arg);
161static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, int arg);
161162#endif
162163
163164
r1591r1592
170171    pair for the current UI handler
171172-------------------------------------------------*/
172173
173INLINE UINT32 ui_set_handler(UINT32 (*callback)(UINT32), UINT32 param)
174INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine *, UINT32), UINT32 param)
174175{
175176   ui_handler_callback = callback;
176177   ui_handler_param = param;
r1591r1592
182183    slider_config - configure a slider entry
183184-------------------------------------------------*/
184185
185INLINE void slider_config(slider_state *state, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, INT32 (*update)(INT32, char *, int), int arg)
186INLINE void slider_config(slider_state *state, INT32 minval, INT32 defval, INT32 maxval, INT32 incval,
187                    INT32 (*update)(running_machine *, INT32, char *, int), int arg)
186188{
187189   state->minval = minval;
188190   state->defval = defval;
r1591r1592
304306    various startup screens
305307-------------------------------------------------*/
306308
307int ui_display_startup_screens(int first_time, int show_disclaimer)
309int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer)
308310{
309311#ifdef MESS
310312   const int maxstate = 4;
r1591r1592
369371
370372      /* loop while we have a handler */
371373      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);
373375
374376      /* clear the handler and force an update */
375377      ui_set_handler(handler_ingame, 0);
376      video_frame_update(FALSE);
378      video_frame_update(machine, FALSE);
377379   }
378380
379381   /* if we're the empty driver, force the menus on */
r1591r1592
389391    at startup
390392-------------------------------------------------*/
391393
392void ui_set_startup_text(const char *text, int force)
394void ui_set_startup_text(running_machine *machine, const char *text, int force)
393395{
394396   static osd_ticks_t lastupdatetime = 0;
395397   osd_ticks_t curtime = osd_ticks();
r1591r1592
402404   if (force || (curtime - lastupdatetime) > osd_ticks_per_second() / 4)
403405   {
404406      lastupdatetime = curtime;
405      video_frame_update(FALSE);
407      video_frame_update(machine, FALSE);
406408   }
407409}
408410
r1591r1592
412414    render it; called by video.c
413415-------------------------------------------------*/
414416
415void ui_update_and_render(void)
417void ui_update_and_render(running_machine *machine)
416418{
417419   /* always start clean */
418420   render_container_empty(render_container_get_ui());
r1591r1592
431433
432434   /* call the current UI handler */
433435   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);
435437
436438   /* cancel takes us back to the ingame handler */
437439   if (ui_handler_param == UI_HANDLER_CANCEL)
r1591r1592
11371139    messagebox_text string but handles no input
11381140-------------------------------------------------*/
11391141
1140static UINT32 handler_messagebox(UINT32 state)
1142static UINT32 handler_messagebox(running_machine *machine, UINT32 state)
11411143{
11421144   ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
11431145   return 0;
r1591r1592
11491151    messagebox_text string and waits for an OK
11501152-------------------------------------------------*/
11511153
1152static UINT32 handler_messagebox_ok(UINT32 state)
1154static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state)
11531155{
11541156   /* draw a standard message window */
11551157   ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
r1591r1592
11791181    any keypress
11801182-------------------------------------------------*/
11811183
1182static UINT32 handler_messagebox_anykey(UINT32 state)
1184static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state)
11831185{
11841186   /* draw a standard message window */
11851187   ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
r1591r1592
12041206    of the standard keypresses
12051207-------------------------------------------------*/
12061208
1207static UINT32 handler_ingame(UINT32 state)
1209static UINT32 handler_ingame(running_machine *machine, UINT32 state)
12081210{
12091211   int is_paused = mame_is_paused(Machine);
12101212
r1591r1592
13781380    and calls the slider handler
13791381-------------------------------------------------*/
13801382
1381static UINT32 handler_slider(UINT32 state)
1383static UINT32 handler_slider(running_machine *machine, UINT32 state)
13821384{
13831385   slider_state *cur = &slider_list[slider_current];
13841386   INT32 increment = 0, newval;
r1591r1592
14021404   }
14031405
14041406   /* determine the new value */
1405   newval = (*cur->update)(0, NULL, cur->arg) + increment;
1407   newval = (*cur->update)(machine, 0, NULL, cur->arg) + increment;
14061408
14071409   /* select resets to the default value */
14081410   if (input_ui_pressed(IPT_UI_SELECT))
r1591r1592
14151417      newval = cur->maxval;
14161418
14171419   /* update the new data and get the text */
1418   (*cur->update)(newval, textbuf, cur->arg);
1420   (*cur->update)(machine, newval, textbuf, cur->arg);
14191421
14201422   /* display the UI */
14211423   slider_display(textbuf, cur->minval, cur->maxval, cur->defval, newval);
r1591r1592
14431445    specifying a game to save or load
14441446-------------------------------------------------*/
14451447
1446static UINT32 handler_load_save(UINT32 state)
1448static UINT32 handler_load_save(running_machine *machine, UINT32 state)
14471449{
14481450   char filename[20];
14491451   input_code code;
r1591r1592
16571659    slider_volume - global volume slider callback
16581660-------------------------------------------------*/
16591661
1660static INT32 slider_volume(INT32 newval, char *buffer, int arg)
1662static INT32 slider_volume(running_machine *machine, INT32 newval, char *buffer, int arg)
16611663{
16621664   if (buffer != NULL)
16631665   {
16641666      sound_set_attenuation(newval);
1665      sprintf(buffer, "Volume %3ddB", sound_get_attenuation());
1667      sprintf(buffer, "Master Volume %3ddB", sound_get_attenuation());
16661668   }
16671669   return sound_get_attenuation();
16681670}
r1591r1592
16731675    slider callback
16741676-------------------------------------------------*/
16751677
1676static INT32 slider_mixervol(INT32 newval, char *buffer, int arg)
1678static INT32 slider_mixervol(running_machine *machine, INT32 newval, char *buffer, int arg)
16771679{
16781680   if (buffer != NULL)
16791681   {
r1591r1592
16891691    callback
16901692-------------------------------------------------*/
16911693
1692static INT32 slider_adjuster(INT32 newval, char *buffer, int arg)
1694static INT32 slider_adjuster(running_machine *machine, INT32 newval, char *buffer, int arg)
16931695{
16941696   input_port_entry *in = &Machine->input_ports[arg];
16951697   if (buffer != NULL)
r1591r1592
17061708    callback
17071709-------------------------------------------------*/
17081710
1709static INT32 slider_overclock(INT32 newval, char *buffer, int arg)
1711static INT32 slider_overclock(running_machine *machine, INT32 newval, char *buffer, int arg)
17101712{
17111713   if (buffer != NULL)
17121714   {
1713      cpunum_set_clockscale(arg, (float)newval * 0.001f);
1715      cpunum_set_clockscale(machine, arg, (float)newval * 0.001f);
17141716      sprintf(buffer, "Overclock CPU %d %3.0f%%", arg, floor(cpunum_get_clockscale(arg) * 100.0f + 0.5f));
17151717   }
17161718   return floor(cpunum_get_clockscale(arg) * 1000.0f + 0.5f);
r1591r1592
17211723    slider_refresh - refresh rate slider callback
17221724-------------------------------------------------*/
17231725
1724static INT32 slider_refresh(INT32 newval, char *buffer, int arg)
1726static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer, int arg)
17251727{
17261728   double defrefresh = ATTOSECONDS_TO_HZ(Machine->drv->screen[arg].defstate.refresh);
17271729   double refresh;
r1591r1592
17301732   {
17311733      screen_state *state = &Machine->screen[arg];
17321734      video_screen_configure(arg, state->width, state->height, &state->visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
1733      sprintf(buffer, "Screen %d Refresh rate %.3f", arg, ATTOSECONDS_TO_HZ(Machine->screen[arg].refresh));
1735      sprintf(buffer, "%s Refresh rate %.3f", slider_get_screen_desc(arg), ATTOSECONDS_TO_HZ(Machine->screen[arg].refresh));
17341736   }
17351737   refresh = ATTOSECONDS_TO_HZ(Machine->screen[arg].refresh);
17361738   return floor((refresh - defrefresh) * 1000.0f + 0.5f);
r1591r1592
17421744    callback
17431745-------------------------------------------------*/
17441746
1745static INT32 slider_brightness(INT32 newval, char *buffer, int arg)
1747static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buffer, int arg)
17461748{
17471749   render_container *container = render_container_get_screen(arg);
17481750   if (buffer != NULL)
17491751   {
17501752      render_container_set_brightness(container, (float)newval * 0.001f);
1751      sprintf(buffer, "Screen %d Brightness %.3f", arg, render_container_get_brightness(container));
1753      sprintf(buffer, "%s Brightness %.3f", slider_get_screen_desc(arg), render_container_get_brightness(container));
17521754   }
17531755   return floor(render_container_get_brightness(container) * 1000.0f + 0.5f);
17541756}
r1591r1592
17591761    callback
17601762-------------------------------------------------*/
17611763
1762static INT32 slider_contrast(INT32 newval, char *buffer, int arg)
1764static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffer, int arg)
17631765{
17641766   render_container *container = render_container_get_screen(arg);
17651767   if (buffer != NULL)
17661768   {
17671769      render_container_set_contrast(container, (float)newval * 0.001f);
1768      sprintf(buffer, "Screen %d Contrast %.3f", arg, render_container_get_contrast(container));
1770      sprintf(buffer, "%s Contrast %.3f", slider_get_screen_desc(arg), render_container_get_contrast(container));
17691771   }
17701772   return floor(render_container_get_contrast(container) * 1000.0f + 0.5f);
17711773}
r1591r1592
17751777    slider_gamma - screen gamma slider callback
17761778-------------------------------------------------*/
17771779
1778static INT32 slider_gamma(INT32 newval, char *buffer, int arg)
1780static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer, int arg)
17791781{
17801782   render_container *container = render_container_get_screen(arg);
17811783   if (buffer != NULL)
17821784   {
17831785      render_container_set_gamma(container, (float)newval * 0.001f);
1784      sprintf(buffer, "Screen %d Gamma %.3f", arg, render_container_get_gamma(container));
1786      sprintf(buffer, "%s Gamma %.3f", slider_get_screen_desc(arg), render_container_get_gamma(container));
17851787   }
17861788   return floor(render_container_get_gamma(container) * 1000.0f + 0.5f);
17871789}
r1591r1592
17921794    callback
17931795-------------------------------------------------*/
17941796
1795static INT32 slider_xscale(INT32 newval, char *buffer, int arg)
1797static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer, int arg)
17961798{
17971799   render_container *container = render_container_get_screen(arg);
17981800   if (buffer != NULL)
17991801   {
18001802      render_container_set_xscale(container, (float)newval * 0.001f);
1801      sprintf(buffer, "Screen %d %s %.3f", arg, "Horiz stretch", render_container_get_xscale(container));
1803      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Horiz Stretch", render_container_get_xscale(container));
18021804   }
18031805   return floor(render_container_get_xscale(container) * 1000.0f + 0.5f);
18041806}
r1591r1592
18091811    callback
18101812-------------------------------------------------*/
18111813
1812static INT32 slider_yscale(INT32 newval, char *buffer, int arg)
1814static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer, int arg)
18131815{
18141816   render_container *container = render_container_get_screen(arg);
18151817   if (buffer != NULL)
18161818   {
18171819      render_container_set_yscale(container, (float)newval * 0.001f);
1818      sprintf(buffer, "Screen %d %s %.3f", arg, "Vert stretch", render_container_get_yscale(container));
1820      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Vert Stretch", render_container_get_yscale(container));
18191821   }
18201822   return floor(render_container_get_yscale(container) * 1000.0f + 0.5f);
18211823}
r1591r1592
18261828    slider callback
18271829-------------------------------------------------*/
18281830
1829static INT32 slider_xoffset(INT32 newval, char *buffer, int arg)
1831static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer, int arg)
18301832{
18311833   render_container *container = render_container_get_screen(arg);
18321834   if (buffer != NULL)
18331835   {
18341836      render_container_set_xoffset(container, (float)newval * 0.001f);
1835      sprintf(buffer, "Screen %d %s %.3f", arg, "Horiz position", render_container_get_xoffset(container));
1837      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Horiz Position", render_container_get_xoffset(container));
18361838   }
18371839   return floor(render_container_get_xoffset(container) * 1000.0f + 0.5f);
18381840}
r1591r1592
18431845    slider callback
18441846-------------------------------------------------*/
18451847
1846static INT32 slider_yoffset(INT32 newval, char *buffer, int arg)
1848static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, int arg)
18471849{
18481850   render_container *container = render_container_get_screen(arg);
18491851   if (buffer != NULL)
18501852   {
18511853      render_container_set_yoffset(container, (float)newval * 0.001f);
1852      sprintf(buffer, "Screen %d %s %.3f", arg, "Vert position", render_container_get_yoffset(container));
1854      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Vert Position", render_container_get_yoffset(container));
18531855   }
18541856   return floor(render_container_get_yoffset(container) * 1000.0f + 0.5f);
18551857}
r1591r1592
18601862    callback
18611863-------------------------------------------------*/
18621864
1863static INT32 slider_flicker(INT32 newval, char *buffer, int arg)
1865static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, int arg)
18641866{
18651867   if (buffer != NULL)
18661868   {
r1591r1592
18761878    callback
18771879-------------------------------------------------*/
18781880
1879static INT32 slider_beam(INT32 newval, char *buffer, int arg)
1881static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, int arg)
18801882{
18811883   if (buffer != NULL)
18821884   {
r1591r1592
18881890
18891891
18901892/*-------------------------------------------------
1893    slider_get_screen_desc - returns the
1894    description for a given screen index
1895-------------------------------------------------*/
1896
1897static 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/*-------------------------------------------------
18911917    slider_crossscale - crosshair scale slider
18921918    callback
18931919-------------------------------------------------*/
18941920
18951921#ifdef MAME_DEBUG
1896static INT32 slider_crossscale(INT32 newval, char *buffer, int arg)
1922static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, int arg)
18971923{
18981924   input_port_entry *in;
18991925
r1591r1592
19211947-------------------------------------------------*/
19221948
19231949#ifdef MAME_DEBUG
1924static INT32 slider_crossoffset(INT32 newval, char *buffer, int arg)
1950static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, int arg)
19251951{
19261952   input_port_entry *in;
19271953
src/emu/ui.h
r1591r1592
8686int ui_init(running_machine *machine);
8787
8888/* display the startup screens */
89int ui_display_startup_screens(int first_time, int show_disclaimer);
89int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer);
9090
9191/* set the current text to display at startup */
92void ui_set_startup_text(const char *text, int force);
92void ui_set_startup_text(running_machine *machine, const char *text, int force);
9393
9494/* once-per-frame update and render */
95void ui_update_and_render(void);
95void ui_update_and_render(running_machine *machine);
9696
9797/* returns the current UI font */
9898render_font *ui_get_font(void);
src/emu/sndintrf.c
r1591r1592
5050struct _sndintrf_data
5151{
5252   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 */
5555   int            index;          /* index of this sound chip */
5656   int            clock;          /* clock for this sound chip */
5757   void *         token;         /* dynamically allocated token data */
r1591r1592
107107void namcona_get_info(void *token, UINT32 state, sndinfo *info);
108108void tms36xx_get_info(void *token, UINT32 state, sndinfo *info);
109109void tms3615_get_info(void *token, UINT32 state, sndinfo *info);
110void tms5100_get_info(void *token, UINT32 state, sndinfo *info);
110111void tms5110_get_info(void *token, UINT32 state, sndinfo *info);
112void tms5110a_get_info(void *token, UINT32 state, sndinfo *info);
113void cd2801_get_info(void *token, UINT32 state, sndinfo *info);
114void tmc0281_get_info(void *token, UINT32 state, sndinfo *info);
115void cd2802_get_info(void *token, UINT32 state, sndinfo *info);
116void m58817_get_info(void *token, UINT32 state, sndinfo *info);
111117void tmc0285_get_info(void *token, UINT32 state, sndinfo *info);
112118void tms5200_get_info(void *token, UINT32 state, sndinfo *info);
113119void tms5220_get_info(void *token, UINT32 state, sndinfo *info);
r1591r1592
118124void msm5232_get_info(void *token, UINT32 state, sndinfo *info);
119125void upd7759_get_info(void *token, UINT32 state, sndinfo *info);
120126void hc55516_get_info(void *token, UINT32 state, sndinfo *info);
127void mc3417_get_info(void *token, UINT32 state, sndinfo *info);
128void mc3418_get_info(void *token, UINT32 state, sndinfo *info);
121129void k005289_get_info(void *token, UINT32 state, sndinfo *info);
122130void k007232_get_info(void *token, UINT32 state, sndinfo *info);
123131void k051649_get_info(void *token, UINT32 state, sndinfo *info);
r1591r1592
177185static const struct
178186{
179187   sound_type   sndtype;
180   void   (*get_info)(void *token, UINT32 state, sndinfo *info);
188   void      (*get_info)(void *token, UINT32 state, sndinfo *info);
181189} sndintrf_map[] =
182190{
183191   { SOUND_DUMMY, dummy_sound_get_info },
r1591r1592
286294#if (HAS_TMS3615)
287295   { SOUND_TMS3615, tms3615_get_info },
288296#endif
297#if (HAS_TMS5100)
298   { SOUND_TMS5100, tms5100_get_info },
299#endif
289300#if (HAS_TMS5110)
290301   { SOUND_TMS5110, tms5110_get_info },
291302#endif
292#if (HAS_TMC0285)
293   { SOUND_TMC0285, tmc0285_get_info },
303#if (HAS_TMS5110A)
304   { SOUND_TMS5110A, tms5110a_get_info },
294305#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
295318#if (HAS_TMS5200)
296319   { SOUND_TMS5200, tms5200_get_info },
297320#endif
r1591r1592
315338#endif
316339#if (HAS_HC55516)
317340   { SOUND_HC55516, hc55516_get_info },
341   { SOUND_MC3417, mc3417_get_info },
342   { SOUND_MC3418, mc3418_get_info },
318343#endif
319344#if (HAS_K005289)
320345   { SOUND_K005289, k005289_get_info },
r1591r1592
648673}
649674
650675
676/*-------------------------------------------------
677    sndtype_count - count the number of a
678    given type
679-------------------------------------------------*/
651680
681int 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
652695/***************************************************************************
653696    CHIP INTERFACES BY INDEX
654697***************************************************************************/
src/emu/sound.c
r1591r1592
473473                  char namebuf[256];
474474                  int index;
475475
476                  sndnum_to_sndti(sndnum, &index);
476                  sound_type sndtype = sndnum_to_sndti(sndnum, &index);
477477
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
478500                  /* fill in the input data on this speaker */
479501                  speaker->input[speaker->inputs].gain = mroute->gain;
480502                  speaker->input[speaker->inputs].default_gain = mroute->gain;
481                  sprintf(namebuf, "%s:%s #%d.%d", speaker->speaker->tag, sndnum_name(sndnum), index, outputnum);
482503                  speaker->input[speaker->inputs].name = auto_strdup(namebuf);
483504
484505                  /* connect the output to the input */
r1591r1592
489510         /* if it's a sound chip, set the input */
490511         else
491512         {
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
495527         }
496528      }
497529   }
src/emu/sndintrf.h
r1591r1592
7272   SOUND_NAMCONA,
7373   SOUND_TMS36XX,
7474   SOUND_TMS3615,
75   SOUND_TMS5100,
7576   SOUND_TMS5110,
77   SOUND_TMS5110A,
78   SOUND_CD2801,
79   SOUND_TMC0281,
80   SOUND_CD2802,
81   SOUND_M58817,
7682   SOUND_TMC0285,
7783   SOUND_TMS5200,
7884   SOUND_TMS5220,
r1591r1592
8288   SOUND_MSM5232,
8389   SOUND_UPD7759,
8490   SOUND_HC55516,
91   SOUND_MC3417,
92   SOUND_MC3418,
8593   SOUND_K005289,
8694   SOUND_K007232,
8795   SOUND_K051649,
r1591r1592
282290int sndti_exists(sound_type sndtype, int sndindex);
283291int sndti_to_sndnum(sound_type type, int index);
284292sound_type sndnum_to_sndti(int sndnum, int *index);
293int sndtype_count(sound_type sndtype);
285294
286295
287296#endif   /* __SNDINTRF_H__ */
src/emu/sound.h
r1591r1592
3636   int         output;               /* output ID */
3737   const char *target;               /* tag of the target */
3838   float      gain;               /* gain */
39   int         input;               /* input ID, -1 is default behavior */
3940};
4041
4142
src/emu/driver.h
r1591r1592
1919    MACROS (must be *before* the includes below)
2020***************************************************************************/
2121
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)
2324
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)
2527
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)
2730
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)
3033
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)
3336
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)
3639
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)
4042
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
4159/* 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
5371
5472
5573
r1591r1592
436454   screen->defstate.visarea.max_y = (maxy);                     \
437455
438456#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);                           \
443461
444462
445463/* add/remove speakers */
446464#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));   \
448466
449467#define MDRV_SPEAKER_REMOVE(tag)                              \
450468   driver_remove_speaker(machine, (tag));                        \
r1591r1592
487505   sound = driver_find_sound(machine, tag);                     \
488506   if (sound)                                             \
489507   {                                                   \
490      sound->type = SOUND_##_type;                        \
508      sound->type = SOUND_##_type;                           \
491509      sound->clock = (_clock);                              \
492510      sound->config = NULL;                                 \
493511      sound->routes = 0;                                    \
494512   }                                                   \
495513
496#define MDRV_SOUND_ROUTE(_output, _target, _gain)                  \
514#define MDRV_SOUND_ROUTE_EX(_output, _target, _gain, _input)         \
497515   if (sound)                                             \
498516   {                                                   \
499517      sound->route[sound->routes].output = (_output);               \
500518      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);               \
502521      sound->routes++;                                    \
503522   }                                                   \
504523
524#define MDRV_SOUND_ROUTE(_output, _target, _gain)                  \
525   MDRV_SOUND_ROUTE_EX(_output, _target, _gain, -1)               \
505526
506527
507528/***************************************************************************
src/emu/cpuint.c
r1591r1592
121121      {
122122         input_line_state[cpunum][line] = CLEAR_LINE;
123123         interrupt_vector[cpunum][line] =
124         input_line_vector[cpunum][line] = cputype_default_irq_vector(Machine->drv->cpu[cpunum].type);
124         input_line_vector[cpunum][line] = cputype_default_irq_vector(machine->drv->cpu[cpunum].type);
125125         input_event_index[cpunum][line] = 0;
126126      }
127127   }
r1591r1592
250250
251251         /* generate a trigger to unsuspend any CPUs waiting on the interrupt */
252252         if (state != CLEAR_LINE)
253            cpu_triggerint(cpunum);
253            cpu_triggerint(machine, cpunum);
254254      }
255255   }
256256
r1591r1592
270270 *
271271 *************************************/
272272
273void cpunum_set_input_line(int cpunum, int line, int state)
273void cpunum_set_input_line(running_machine *machine, int cpunum, int line, int state)
274274{
275275   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);
277277}
278278
279279
r1591r1592
289289}
290290
291291
292void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector)
292void cpunum_set_input_line_and_vector(running_machine *machine, int cpunum, int line, int state, int vector)
293293{
294294   if (line >= 0 && line < MAX_INPUT_LINES)
295295   {
r1591r1592
302302      if (event_index >= MAX_INPUT_EVENTS)
303303      {
304304         input_event_index[cpunum][line]--;
305         cpunum_empty_event_queue(Machine, NULL, cpunum | (line << 8));
305         cpunum_empty_event_queue(machine, NULL, cpunum | (line << 8));
306306         event_index = input_event_index[cpunum][line]++;
307307         logerror("Exceeded pending input line event queue on CPU %d!\n", cpunum);
308308      }
src/emu/cpuint.h
r1591r1592
4141 *************************************/
4242
4343/* Set the logical state (ASSERT_LINE/CLEAR_LINE) of the an input line on a CPU */
44void cpunum_set_input_line(int cpunum, int line, int state);
44void cpunum_set_input_line(running_machine *machine, int cpunum, int line, int state);
4545
4646/* Set the vector to be returned during a CPU's interrupt acknowledge cycle */
4747void cpunum_set_input_line_vector(int cpunum, int irqline, int vector);
4848
4949/* Set the logical state (ASSERT_LINE/CLEAR_LINE) of the an input line on a CPU and its associated vector */
50void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector);
50void cpunum_set_input_line_and_vector(running_machine *machine, int cpunum, int line, int state, int vector);
5151
5252/* Install a driver callback for IRQ acknowledge */
5353void cpunum_set_irq_callback(int cpunum, int (*callback)(int irqline));
src/emu/emupal.c
r1591r1592
623623
624624   /* configure the groups */
625625   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);
627627   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);
629629
630630   /* set the initial colors to a standard rainbow */
631631   for (index = 0; index < machine->drv->total_colors; index++)
r1591r1592
726726      {
727727         palette->shadow_table[0].base = table;
728728         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);
730730      }
731731   }
732732
r1591r1592
749749      {
750750         palette->shadow_table[1].base = table;
751751         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);
753753      }
754754   }
755755
src/emu/cheat.c
r1591r1592
780780static INT32   UserSelectValueMenu(int selection, CheatEntry * entry);
781781
782782/********** CHEAT MENU **********/
783static int      EnableDisableCheatMenu(int selection, int firstTime);
784static int      AddEditCheatMenu(int selection);
785static int      EditCheatMenu(CheatEntry * entry, int index, int selection);
783static int      EnableDisableCheatMenu(running_machine *machine, int selection, int firstTime);
784static int      AddEditCheatMenu(running_machine *machine, int selection);
785static int      EditCheatMenu(running_machine *machine, CheatEntry * entry, int index, int selection);
786786
787static int      DoSearchMenuMinimum(int selection);         // minimum mode
788static int      DoSearchMenuClassic(int selection);         // classic mode
789static int      DoSearchMenu(int selection);            // advanced mode
790static int      SelectSearchRegions(int selection, SearchInfo * search);
787static int      DoSearchMenuMinimum(running_machine *machine, int selection);   // minimum mode
788static int      DoSearchMenuClassic(running_machine *machine, int selection);   // classic mode
789static int      DoSearchMenu(running_machine *machine, int selection);         // advanced mode
790static int      SelectSearchRegions(running_machine *machine, int selection, SearchInfo * search);
791791static int      ViewSearchResults(int selection, int firstTime);
792792
793static int      ChooseWatch(int selection);
794static int      EditWatch(WatchInfo * entry, int selection);
793static int      ChooseWatch(running_machine *machine, int selection);
794static int      EditWatch(running_machine *machine, WatchInfo * entry, int selection);
795795
796static int      SelectOptions(int selection);
797static int      SelectSearch(int selection);
796static int      SelectOptions(running_machine *machine, int selection);
797static int      SelectSearch(running_machine *machine, int selection);
798798
799799/********** ENTRY LIST **********/
800800static void      ResizeCheatList(UINT32 newLength);
r1591r1592
849849static void      RestoreRegionBackup(SearchRegion * region);
850850static void      SetSearchRegionDefaultName(SearchRegion * region);
851851static void      AllocateSearchRegions(SearchInfo * info);
852static void      BuildSearchRegions(SearchInfo * info);
852static void      BuildSearchRegions(running_machine *machine, SearchInfo * info);
853853
854854/********** CODE LOADER **********/
855855static int      ConvertOldCode(int code, int cpu, int * data, int * extendData);
856static void      HandleLocalCommandCheat(UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description);
856static void      HandleLocalCommandCheat(running_machine *machine, UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description);
857857
858static void      LoadCheatFile(char * fileName);
859static void      LoadCheatDatabase(void);
858static void      LoadCheatFile(running_machine *machine, char * fileName);
859static void      LoadCheatDatabase(running_machine *machine);
860860
861861static void      DisposeCheatDatabase(void);
862static void      ReloadCheatDatabase(void);
862static void      ReloadCheatDatabase(running_machine *machine);
863863
864static void      SaveCheat(CheatEntry * entry, int selection, int saveCode);
865static void      DoAutoSaveCheats(void);
864static void      SaveCheat(running_machine *machine, CheatEntry * entry, int selection, int saveCode);
865static void      DoAutoSaveCheats(running_machine *machine);
866866
867867/********** CODE ADDITION **********/
868868static void      AddCheatFromResult(SearchInfo * search, SearchRegion * region, UINT32 address);
r1591r1592
920920static void      TempDeactivateCheat(CheatEntry * entry);
921921
922922static void      cheat_periodicOperation(CheatAction * action);
923static void      cheat_periodicAction(CheatAction * action);
924static void      cheat_periodicEntry(CheatEntry * entry);
923static void      cheat_periodicAction(running_machine *machine, CheatAction * action);
924static void      cheat_periodicEntry(running_machine *machine, CheatEntry * entry);
925925
926926static void      UpdateAllCheatInfo(void);
927927static void      UpdateCheatInfo(CheatEntry * entry, UINT8 isLoadTime);
928928
929929static int      IsAddressInRange(CheatAction * action, UINT32 length);
930930
931static void      BuildCPUInfoList(void);
931static void      BuildCPUInfoList(running_machine *machine);
932932
933933/*--------------------------------------------------------------
934934  special key handler - check pressing shift, ctrl or alt key
r1591r1592
14841484   fullMenuPageHeight =   floor(1.0f / ui_get_line_height()) - 1;
14851485
14861486   /* ----- initialize CPU info for cheat system ----- */
1487   BuildCPUInfoList();
1487   BuildCPUInfoList(machine);
14881488
14891489   /* ----- load cheat database ----- */
1490   LoadCheatDatabase();
1490   LoadCheatDatabase(machine);
14911491
14921492   ResizeSearchList(1);
14931493   ResizeWatchList(20);
14941494
14951495   /* ----- initialize search regions ----- */
1496   BuildSearchRegions(GetCurrentSearch());
1496   BuildSearchRegions(machine, GetCurrentSearch());
14971497   AllocateSearchRegions(GetCurrentSearch());
14981498
14991499   /* ----- initialize string table ----- */
15001500   InitStringTable();
15011501
15021502   periodic_timer = timer_alloc(cheat_periodic, NULL);
1503   timer_adjust(periodic_timer, attotime_make(0, Machine->screen[0].refresh), 0, attotime_make(0, Machine->screen[0].refresh));
1503   timer_adjust(periodic_timer, attotime_make(0, machine->screen[0].refresh), 0, attotime_make(0, machine->screen[0].refresh));
15041504
15051505   add_exit_callback(machine, cheat_exit);
15061506}
r1591r1592
15151515
15161516   /* ----- save all cheats automatically if needed ----- */
15171517   if(TEST_FIELD(cheatOptions, AutoSaveEnabled))
1518      DoAutoSaveCheats();
1518      DoAutoSaveCheats(machine);
15191519
15201520   /* ----- free database ----- */
15211521   DisposeCheatDatabase();
r1591r1592
15701570  cheat_menu - management for the cheat general menu
15711571-----------------------------------------------------*/
15721572
1573int cheat_menu(int selection)
1573int cheat_menu(running_machine *machine, int selection)
15741574{
15751575   enum
15761576   {
r1591r1592
16071607      switch(sel)
16081608      {
16091609         case kMenu_EnableDisable:
1610            submenu_choice = EnableDisableCheatMenu(submenu_choice, firstEntry);
1610            submenu_choice = EnableDisableCheatMenu(machine, submenu_choice, firstEntry);
16111611            break;
16121612
16131613         case kMenu_AddEdit:
1614            submenu_choice = AddEditCheatMenu(submenu_choice);
1614            submenu_choice = AddEditCheatMenu(machine, submenu_choice);
16151615            break;
16161616
16171617         case kMenu_Search:
16181618            switch(EXTRACT_FIELD(cheatOptions, SearchBox))
16191619            {
16201620               case kSearchBox_Minimum:
1621                  submenu_choice = DoSearchMenuMinimum(submenu_choice);
1621                  submenu_choice = DoSearchMenuMinimum(machine, submenu_choice);
16221622                  break;
16231623
16241624               case kSearchBox_Classic:
1625                  submenu_choice = DoSearchMenuClassic(submenu_choice);
1625                  submenu_choice = DoSearchMenuClassic(machine, submenu_choice);
16261626                  break;
16271627
16281628               case kSearchBox_Advanced:
1629                  submenu_choice = DoSearchMenu(submenu_choice);
1629                  submenu_choice = DoSearchMenu(machine, submenu_choice);
16301630                  break;
16311631            }
16321632            break;
16331633
16341634         case kMenu_ChooseWatch:
1635            submenu_choice = ChooseWatch(submenu_choice);
1635            submenu_choice = ChooseWatch(machine, submenu_choice);
16361636            break;
16371637
16381638         case kMenu_Options:
1639            submenu_choice = SelectOptions(submenu_choice);
1639            submenu_choice = SelectOptions(machine, submenu_choice);
16401640            break;
16411641      }
16421642
r1591r1592
17401740            break;
17411741
17421742         case kMenu_ReloadDatabase:
1743            ReloadCheatDatabase();
1743            ReloadCheatDatabase(machine);
17441744            break;
17451745
17461746         default:
r1591r1592
17511751   }
17521752
17531753   if(input_ui_pressed(IPT_UI_RELOAD_CHEAT))
1754      ReloadCheatDatabase();
1754      ReloadCheatDatabase(machine);
17551755
17561756   if(input_ui_pressed(IPT_UI_CANCEL))
17571757   {
r1591r1592
21942194  EnableDisableCheatMenu - management for Enable/Disable menu
21952195--------------------------------------------------------------*/
21962196
2197static int EnableDisableCheatMenu(int selection, int firstTime)
2197static int EnableDisableCheatMenu(running_machine *machine, int selection, int firstTime)
21982198{
21992199   INT32         sel;
22002200   static INT32   submenu_choice = 0;
r1591r1592
22292229            break;
22302230
22312231         case 3:
2232            submenu_choice = EditCheatMenu(&cheatList[sel], sel, submenu_choice);
2232            submenu_choice = EditCheatMenu(machine, &cheatList[sel], sel, submenu_choice);
22332233            break;
22342234
22352235         default:
r1591r1592
25822582      if(input_ui_pressed(IPT_UI_SAVE_CHEAT))         // shift + save = save all codes
25832583      {
25842584         for(i = 0; i < cheatListLength; i++)
2585            SaveCheat(&cheatList[i], 0, 0);
2585            SaveCheat(machine, &cheatList[i], 0, 0);
25862586
25872587         ui_popup_time(1, "%d cheats saved", cheatListLength);
25882588      }
r1591r1592
26012601         {
26022602            if((entry->flags & kCheatFlag_HasActivationKey1) || (entry->flags & kCheatFlag_HasActivationKey2))
26032603            {
2604               SaveCheat(entry, sel, 1);
2604               SaveCheat(machine, entry, sel, 1);
26052605
26062606               ui_popup_time(1, "activation key saved");
26072607            }
r1591r1592
26122612      else
26132613      {
26142614         if(input_ui_pressed(IPT_UI_SAVE_CHEAT))
2615            SaveCheat(entry, 0, 0);                  // save current entry
2615            SaveCheat(machine, entry, 0, 0);         // save current entry
26162616      }
26172617   }
26182618
r1591r1592
26232623   }
26242624
26252625   if(input_ui_pressed(IPT_UI_RELOAD_CHEAT))
2626      ReloadCheatDatabase();
2626      ReloadCheatDatabase(machine);
26272627
26282628   if(UIPressedRepeatThrottle(IPT_UI_ZOOM_IN, kVerticalKeyRepeatRate))
26292629      /* ----- quick menu switch : enable/disable -> add/edit ----- */
r1591r1592
26432643  AddEditCheatMenu - management for Add/Edit cheat menu
26442644--------------------------------------------------------*/
26452645
2646static int AddEditCheatMenu(int selection)
2646static int AddEditCheatMenu(running_machine *machine, int selection)
26472647{
26482648   INT32         sel;
26492649   static INT32   submenuChoice = 0;
r1591r1592
26622662   /********** SUB MENU **********/
26632663   if(submenuChoice)
26642664   {
2665      submenuChoice = EditCheatMenu(&cheatList[submenuCheat], submenuCheat, submenuChoice);
2665      submenuChoice = EditCheatMenu(machine, &cheatList[submenuCheat], submenuCheat, submenuChoice);
26662666
26672667      /* ----- meaningless ? because no longer return with sel = -1 (pressed UI_CONFIG in submenu) ----- */
26682668//      if(submenuChoice == -1)
r1591r1592
27412741      if(ShiftKeyPressed())
27422742      {
27432743         for(i = 0; i < cheatListLength; i++)      // shift + save = save all codes
2744            SaveCheat(&cheatList[i], 0, 0);
2744            SaveCheat(machine, &cheatList[i], 0, 0);
27452745
27462746         ui_popup_time(1, "%d cheats saved", cheatListLength);
27472747      }
r1591r1592
27512751         {
27522752            if((entry->flags & kCheatFlag_HasActivationKey1) || (entry->flags & kCheatFlag_HasActivationKey2))
27532753            {
2754               SaveCheat(entry, sel, 1);      // ctrl + save = save activation key
2754               SaveCheat(machine, entry, sel, 1);   // ctrl + save = save activation key
27552755
27562756               ui_popup_time(1, "activation key saved");
27572757            }
r1591r1592
27592759               ui_popup_time(1, "no activation key");
27602760         }
27612761         else
2762            SaveCheat(entry, 0, 0);      // save current entry
2762            SaveCheat(machine, entry, 0, 0);      // save current entry
27632763      }
27642764   }
27652765
r1591r1592
27992799   }
28002800
28012801   if(input_ui_pressed(IPT_UI_RELOAD_CHEAT))
2802      ReloadCheatDatabase();
2802      ReloadCheatDatabase(machine);
28032803
28042804   if(UIPressedRepeatThrottle(IPT_UI_ZOOM_IN, kVerticalKeyRepeatRate))
28052805      /* ----- quick menu switch : add/edit -> search ----- */
r1591r1592
28192819  EditCheatMenu - management for edit code menu
28202820------------------------------------------------*/
28212821
2822static int EditCheatMenu(CheatEntry * entry, int index, int selection)
2822static int EditCheatMenu(running_machine *machine, CheatEntry * entry, int index, int selection)
28232823{
28242824   static const char *const kTypeNames[] =
28252825   {
r1591r1592
44644464            }
44654465            else
44664466            {
4467               int   code = input_code_poll_keyboard_switches(FALSE);
4467               int   code = input_code_poll_switches(FALSE);
44684468
44694469               if(code == KEYCODE_ESC)
44704470               {
r1591r1592
46244624         if(ControlKeyPressed())
46254625            if((entry->flags & kCheatFlag_HasActivationKey1) || (entry->flags & kCheatFlag_HasActivationKey2))
46264626            {
4627               SaveCheat(entry, index, 1);         // save activation key
4627               SaveCheat(machine, entry, index, 1);   // save activation key
46284628
46294629               ui_popup_time(1, "activation key saved");
46304630            }
46314631            else
46324632               ui_popup_time(1, "no activation key");
46334633         else
4634            SaveCheat(entry, 0, 0);               // save current entry
4634            SaveCheat(machine, entry, 0, 0);         // save current entry
46354635      }
46364636
46374637      if(input_ui_pressed(IPT_UI_WATCH_VALUE))
r1591r1592
46834683  DoSearchMenuMinimum - management for minimum search menu
46844684-----------------------------------------------------------*/
46854685
4686static int DoSearchMenuMinimum(int selection)
4686static int DoSearchMenuMinimum(running_machine *machine, int selection)
46874687{
46884688   /* main */
46894689   enum
r1591r1592
47414741      switch(sel)
47424742      {
47434743         case kMenu_CPU:
4744            submenuChoice = SelectSearchRegions(submenuChoice, GetCurrentSearch());
4744            submenuChoice = SelectSearchRegions(machine, submenuChoice, GetCurrentSearch());
47454745            break;
47464746
47474747         case kMenu_ViewResult:
r1591r1592
49804980               {
49814981                  search->targetIdx--;
49824982
4983                  BuildSearchRegions(search);
4983                  BuildSearchRegions(machine, search);
49844984                  AllocateSearchRegions(search);
49854985
49864986                  doneSaveMemory = 0;
r1591r1592
50245024               {
50255025                  search->targetIdx++;
50265026
5027                  BuildSearchRegions(search);
5027                  BuildSearchRegions(machine, search);
50285028                  AllocateSearchRegions(search);
50295029
50305030                  doneSaveMemory = 0;
r1591r1592
52625262  DoSearchMenuClassic - management for classic search menu
52635263-----------------------------------------------------------*/
52645264
5265static int DoSearchMenuClassic(int selection)
5265static int DoSearchMenuClassic(running_machine *machine, int selection)
52665266{
52675267   static const char *const energyStrings[] =
52685268   {
r1591r1592
53625362      switch(sel)
53635363      {
53645364         case kMenu_CPU:
5365            submenuChoice = SelectSearchRegions(submenuChoice, GetCurrentSearch());
5365            submenuChoice = SelectSearchRegions(machine, submenuChoice, GetCurrentSearch());
53665366            break;
53675367
53685368         case kMenu_ViewResult:
r1591r1592
55305530            {
55315531               search->targetIdx--;
55325532
5533               BuildSearchRegions(search);
5533               BuildSearchRegions(machine, search);
55345534               AllocateSearchRegions(search);
55355535
55365536               doneSaveMemory = 0;
r1591r1592
55845584            {
55855585               search->targetIdx++;
55865586
5587               BuildSearchRegions(search);
5587               BuildSearchRegions(machine, search);
55885588               AllocateSearchRegions(search);
55895589
55905590               doneSaveMemory = 0;
r1591r1592
57915791  DoSearchMenu - management for advanced search menu
57925792-----------------------------------------------------*/
57935793
5794static int DoSearchMenu(int selection)
5794static int DoSearchMenu(running_machine *machine, int selection)
57955795{
57965796   /* menu stirngs */
57975797   static const char *const kOperandNameTable[] =
r1591r1592
58805880      switch(sel)
58815881      {
58825882         case kMenu_CPU:
5883            submenuChoice = SelectSearchRegions(submenuChoice, GetCurrentSearch());
5883            submenuChoice = SelectSearchRegions(machine, submenuChoice, GetCurrentSearch());
58845884            break;
58855885
58865886         case kMenu_ViewResult:
r1591r1592
60976097            {
60986098               search->targetIdx--;
60996099
6100               BuildSearchRegions(search);
6100               BuildSearchRegions(machine, search);
61016101               AllocateSearchRegions(search);
61026102
61036103               doneMemorySave = 0;
r1591r1592
61576157            {
61586158               search->targetIdx++;
61596159
6160               BuildSearchRegions(search);
6160               BuildSearchRegions(machine, search);
61616161               AllocateSearchRegions(search);
61626162
61636163               doneMemorySave = 0;
r1591r1592
62816281  SelectSearchRegions - management for search regions selection menu
62826282---------------------------------------------------------------------*/
62836283
6284static int SelectSearchRegions(int selection, SearchInfo * search)
6284static int SelectSearchRegions(running_machine *machine, int selection, SearchInfo * search)
62856285{
62866286   static const char *const kSearchSpeedList[] =
62876287   {
r1591r1592
63906390         else
63916391            search->searchSpeed = kSearchSpeed_Max;
63926392
6393         BuildSearchRegions(search);
6393         BuildSearchRegions(machine, search);
63946394         AllocateSearchRegions(search);
63956395      }
63966396   }
r1591r1592
64116411         else
64126412            search->searchSpeed = kSearchSpeed_Fast;
64136413
6414         BuildSearchRegions(search);
6414         BuildSearchRegions(machine, search);
64156415         AllocateSearchRegions(search);
64166416      }
64176417   }
r1591r1592
68176817  ChooseWatch - management for watchpoint list menu
68186818----------------------------------------------------*/
68196819
6820static int ChooseWatch(int selection)
6820static int ChooseWatch(running_machine *machine, int selection)
68216821{
68226822   const char      ** menuItem;
68236823   char         ** buf;
r1591r1592
68406840   /********** SUB MENU **********/
68416841   if(submenuChoice)
68426842   {
6843      submenuChoice = EditWatch(&watchList[submenuWatch], submenuChoice);
6843      submenuChoice = EditWatch(machine, &watchList[submenuWatch], submenuChoice);
68446844
68456845      /* ----- meaningless ? because no longer return with sel = -1 (pressed UI_CONFIG in submenu) ----- */
68466846//      if(submenuChoice == -1)
r1591r1592
69336933            memset(&entry, 0, sizeof(CheatEntry));
69346934
69356935            SetupCheatFromWatchAsWatch(&entry, watch);
6936            SaveCheat(&entry, 0, 0);
6936            SaveCheat(machine, &entry, 0, 0);
69376937            DisposeCheat(&entry);
69386938         }
69396939      }
r1591r1592
70377037  EditWatch - management for watchpoint edit menu
70387038--------------------------------------------------*/
70397039
7040static int EditWatch(WatchInfo * entry, int selection)
7040static int EditWatch(running_machine *machine, WatchInfo * entry, int selection)
70417041{
70427042   enum
70437043   {
r1591r1592
72547254            break;
72557255
72567256         case kMenu_XPosition:
7257            entry->x -= 0.01;
7257            entry->x -= 0.01f;
72587258            break;
72597259
72607260         case kMenu_YPosition:
7261            entry->y -= 0.01;
7261            entry->y -= 0.01f;
72627262            break;
72637263
72647264         case kMenu_Skip:
r1591r1592
73497349            break;
73507350
73517351         case kMenu_XPosition:
7352            entry->x += 0.01;
7352            entry->x += 0.01f;
73537353            break;
73547354
73557355         case kMenu_YPosition:
7356            entry->y += 0.01;
7356            entry->y += 0.01f;
73577357            break;
73587358
73597359         case kMenu_Skip:
r1591r1592
75257525         memset(&tempEntry, 0, sizeof(CheatEntry));
75267526
75277527         SetupCheatFromWatchAsWatch(&tempEntry, entry);
7528         SaveCheat(&tempEntry, 0, 0);
7528         SaveCheat(machine, &tempEntry, 0, 0);
75297529         DisposeCheat(&tempEntry);
75307530      }
75317531   }
r1591r1592
75407540  SelectOptions - management for options menu
75417541----------------------------------------------*/
75427542
7543static int SelectOptions(int selection)
7543static int SelectOptions(running_machine *machine, int selection)
75447544{
75457545   enum
75467546   {
r1591r1592
75707570      switch(sel)
75717571      {
75727572         case kMenu_SelectSearch:
7573            submenuChoice = SelectSearch(submenuChoice);
7573            submenuChoice = SelectSearch(machine, submenuChoice);
75747574            break;
75757575
75767576         default:
r1591r1592
77377737
77387738   if(input_ui_pressed(IPT_UI_SAVE_CHEAT))
77397739   {
7740      SaveCheat(NULL, 0, 2);
7740      SaveCheat(machine, NULL, 0, 2);
77417741
77427742      ui_popup_time(1, "command code saved");
77437743   }
77447744
77457745   if(input_ui_pressed(IPT_UI_RELOAD_CHEAT))
7746      ReloadCheatDatabase();
7746      ReloadCheatDatabase(machine);
77477747
77487748   if(input_ui_pressed(IPT_UI_CANCEL))
77497749      sel = -1;
r1591r1592
77557755  SelectSearch - management for search selection menu
77567756------------------------------------------------------*/
77577757
7758static int SelectSearch(int selection)
7758static int SelectSearch(running_machine *machine, int selection)
77597759{
77607760   INT32         sel;
77617761   const char      ** menuItem;
r1591r1592
78447844   {
78457845      AddSearchBefore(sel);
78467846
7847      BuildSearchRegions(&searchList[sel]);
7847      BuildSearchRegions(machine, &searchList[sel]);
78487848      AllocateSearchRegions(&searchList[sel]);
78497849   }
78507850
r1591r1592
79107910      return;
79117911
79127912   for(i = 0; i < cheatListLength; i++)
7913      cheat_periodicEntry(&cheatList[i]);
7913      cheat_periodicEntry(machine, &cheatList[i]);
79147914}
79157915
79167916/*--------------
r1591r1592
89218921  DefaultEnableRegion - get default regions you can search
89228922-----------------------------------------------------------*/
89238923
8924static UINT8 DefaultEnableRegion(SearchRegion * region, SearchInfo * info)
8924static UINT8 DefaultEnableRegion(running_machine *machine, SearchRegion * region, SearchInfo * info)
89258925{
89268926   write8_handler      handler = region->writeHandler->write.handler8;
89278927   FPTR            handlerAddress = (FPTR)handler;
r1591r1592
89318931      case kSearchSpeed_Fast:
89328932
89338933#if HAS_SH2
8934         if(Machine->drv->cpu[0].type == CPU_SH2)
8934         if(machine->drv->cpu[0].type == CPU_SH2)
89358935         {
89368936            if(   (info->targetType == kRegionType_CPU) && (info->targetIdx == 0) && (region->address == 0x06000000))
89378937               return 1;
r1591r1592
89478947
89488948         {
89498949            /* ----- for neogeo, search bank one ----- */
8950            if(   (!strcmp(Machine->gamedrv->parent, "neogeo")) && (info->targetType == kRegionType_CPU) &&
8950            if(   (!strcmp(machine->gamedrv->parent, "neogeo")) && (info->targetType == kRegionType_CPU) &&
89518951               (info->targetIdx == 0) && (handler == MWA8_BANK1))
89528952               return 1;
89538953         }
r1591r1592
89578957#if HAS_TMS34010
89588958
89598959         /* ----- for exterminator, search bank one ----- */
8960         if(   (Machine->drv->cpu[1].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) &&
8960         if(   (machine->drv->cpu[1].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) &&
89618961            (info->targetIdx == 1) && (handler == MWA8_BANK1))
89628962            return 1;
89638963
89648964         /* ----- for smashtv, search bank two ----- */
8965         if(   (Machine->drv->cpu[0].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) &&
8965         if(   (machine->drv->cpu[0].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) &&
89668966            (info->targetIdx == 0) && (handler == MWA8_BANK2))
89678967            return 1;
89688968
r1591r1592
91149114  BuildSearchRegions
91159115---------------------*/
91169116
9117static void BuildSearchRegions(SearchInfo * info)
9117static void BuildSearchRegions(running_machine *machine, SearchInfo * info)
91189118{
91199119   info->comparison = kSearchComparison_EqualTo;
91209120
r1591r1592
91959195                     traverse->backupLast = NULL;
91969196                     traverse->backupStatus = NULL;
91979197
9198                     traverse->flags = DefaultEnableRegion(traverse, info) ? kRegionFlag_Enabled : 0;
9198                     traverse->flags = DefaultEnableRegion(machine, traverse, info) ? kRegionFlag_Enabled : 0;
91999199
92009200                     SetSearchRegionDefaultName(traverse);
92019201
r1591r1592
93649364  HandleLocalCommandCheat - get special code which is not added into cheat list
93659365--------------------------------------------------------------------------------*/
93669366
9367static void HandleLocalCommandCheat(UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description)
9367static void HandleLocalCommandCheat(running_machine *machine, UINT32 type, UINT32 address, UINT32 data, UINT32 extendData, char * name, char * description)
93689368{
93699369   switch(EXTRACT_FIELD(type, LocationType))
93709370   {
r1591r1592
94159415
94169416                  overclock /= 65536.0;
94179417
9418                  cpunum_set_clockscale(address, overclock);
9418                  cpunum_set_clockscale(machine, address, overclock);
94199419               }
94209420            }
94219421            break;
r1591r1592
94239423            /* ----- refresh rate ----- */
94249424            case kCustomLocation_RefreshRate:
94259425            {
9426               screen_state   *state = &Machine->screen[0];
9426               screen_state   *state = &machine->screen[0];
94279427               double         refresh = data;
94289428
94299429               refresh /= 65536.0;
r1591r1592
94409440  LoadCheatFile - load cheat code from database
94419441------------------------------------------------*/
94429442
9443static void LoadCheatFile(char * fileName)
9443static void LoadCheatFile(running_machine *machine, char * fileName)
94449444{
94459445   mame_file   * theFile;
94469446   file_error filerr;
r1591r1592
94599459
94609460   /* ----- make the format strings ----- */
94619461#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]");
94649464#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]");
94679467#endif
94689468
94699469   /* ----- get a line from database ----- */
r1591r1592
95529552      {
95539553         //logerror("cheat: cheat line removed\n", buf);
95549554
9555         HandleLocalCommandCheat(type, address, data, extendData, name, description);
9555         HandleLocalCommandCheat(machine, type, address, data, extendData, name, description);
95569556      }
95579557      else
95589558      {
r1591r1592
96349634  LoadCheatDatabase - get the database name then load it
96359635---------------------------------------------------------*/
96369636
9637static void LoadCheatDatabase(void)
9637static void LoadCheatDatabase(running_machine *machine)
96389638{
96399639   char      buf[4096];
96409640   const char   * inTraverse;
r1591r1592
96719671         if(buf[0])
96729672         {
96739673            /* ----- load database based on the name we gotten ----- */
9674            LoadCheatFile(buf);
9674            LoadCheatFile(machine, buf);
96759675
96769676            outTraverse =buf;
96779677            buf[0] = 0;
r1591r1592
97229722  ReloadCheatDatabase - reload cheat database directly on the cheat menu
97239723-------------------------------------------------------------------------*/
97249724
9725static void ReloadCheatDatabase(void)
9725static void ReloadCheatDatabase(running_machine *machine)
97269726{
97279727   DisposeCheatDatabase();
9728   LoadCheatDatabase();
9728   LoadCheatDatabase(machine);
97299729
97309730   ui_popup_time(1, "Cheat Database reloaded");
97319731}
r1591r1592
97349734  SaveCheat - save a code (normal code, activation key, option)
97359735---------------------------------------------------------------*/
97369736
9737static void SaveCheat(CheatEntry * entry, int selection, int saveCode)
9737static void SaveCheat(running_machine *machine, CheatEntry * entry, int selection, int saveCode)
97389738{
97399739   enum{
97409740         normalCode = 0,
r1591r1592
98179817                  break;
98189818            }
98199819#ifdef MESS
9820            bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.8X:%.*X:%.8X:%.8X", Machine->gamedrv->name, thisGameCRC, type, addressLength, action->address, action->originalDataField, action->extendData);
9820            bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.8X:%.*X:%.8X:%.8X", machine->gamedrv->name, thisGameCRC, type, addressLength, action->address, action->originalDataField, action->extendData);
98219821#else
9822            bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.*X:%.8X:%.8X", Machine->gamedrv->name, type, addressLength, action->address, action->originalDataField, action->extendData);
9822            bufTraverse += sprintf(bufTraverse, ":%s:%.8X:%.*X:%.8X:%.8X", machine->gamedrv->name, type, addressLength, action->address, action->originalDataField, action->extendData);
98239823#endif
98249824            /* ----- set description and comment ----- */
98259825            if(name)
r1591r1592
98639863               addressLength = cpuInfoList[EXTRACT_FIELD(entry->actionList[1].type, LocationParameter)].addressCharsNeeded;
98649864#ifdef MESS
98659865            if(!i)
9866               bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004000:%.*X:%.8X:00000000", Machine->gamedrv->name, thisGameCRC, addressLength, selection, entry->activationKey1);
9866               bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004000:%.*X:%.8X:00000000", machine->gamedrv->name, thisGameCRC, addressLength, selection, entry->activationKey1);
98679867            else
9868               bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004001:%.*X:%.8X:00000000", Machine->gamedrv->name, thisGameCRC, addressLength, selection, entry->activationKey2);
9868               bufTraverse += sprintf(bufTraverse, ":%s:%.8X:63004001:%.*X:%.8X:00000000", machine->gamedrv->name, thisGameCRC, addressLength, selection, entry->activationKey2);
98699869#else
98709870            if(!i)
9871               bufTraverse += sprintf(bufTraverse, ":%s:63004000:%.*X:%.8X:00000000", Machine->gamedrv->name, addressLength, selection, entry->activationKey1);
9871               bufTraverse += sprintf(bufTraverse, ":%s:63004000:%.*X:%.8X:00000000", machine->gamedrv->name, addressLength, selection, entry->activationKey1);
98729872            else
9873               bufTraverse += sprintf(bufTraverse, ":%s:63004001:%.*X:%.8X:00000000", Machine->gamedrv->name, addressLength, selection, entry->activationKey2);
9873               bufTraverse += sprintf(bufTraverse, ":%s:63004001:%.*X:%.8X:00000000", machine->gamedrv->name, addressLength, selection, entry->activationKey2);
98749874#endif
98759875            /* ----- set description and button index ----- */
98769876            if(!i)
r1591r1592
99229922  DoAutoSaveCheat - save normal code automatically when exit cheat system
99239923--------------------------------------------------------------------------*/
99249924
9925static void DoAutoSaveCheats(void)
9925static void DoAutoSaveCheats(running_machine *machine)
99269926{
99279927   int   i;
99289928
r1591r1592
99319931      CheatEntry   * entry = &cheatList[i];
99329932
99339933      if(entry->flags & kCheatFlag_Dirty)
9934         SaveCheat(entry, 0, 0);
9934         SaveCheat(machine, entry, 0, 0);
99359935   }
99369936}
99379937
r1591r1592
1135911359  cheat_periodicAction - management for cheat actions
1136011360------------------------------------------------------*/
1136111361
11362static void cheat_periodicAction(CheatAction * action)
11362static void cheat_periodicAction(running_machine *machine, CheatAction * action)
1136311363{
1136411364   UINT8   parameter = EXTRACT_FIELD(action->type, TypeParameter);
1136511365
r1591r1592
1140011400            /* ----- keep if one shot + restore prevous value + delay !=0 ----- */
1140111401            cheat_periodicOperation(action);
1140211402
11403            if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ(Machine->screen[0].refresh)))
11403            if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ(machine->screen[0].refresh)))
1140411404            {
1140511405               action->frameTimer = 0;
1140611406
r1591r1592
1141211412         else
1141311413         {
1141411414            /* ----- otherwise, delay ----- */
11415            if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ(Machine->screen[0].refresh)))
11415            if(action->frameTimer >= (parameter * ATTOSECONDS_TO_HZ(machine->screen[0].refresh)))
1141611416            {
1141711417               action->frameTimer = 0;
1141811418
r1591r1592
1145111451
1145211452            if(currentValue != action->lastValue)
1145311453            {
11454               action->frameTimer = parameter * ATTOSECONDS_TO_HZ(Machine->screen[0].refresh);
11454               action->frameTimer = parameter * ATTOSECONDS_TO_HZ(machine->screen[0].refresh);
1145511455
1145611456               action->flags |= kActionFlag_WasModified;
1145711457            }
r1591r1592
1148711487  cheat_periodicEntry - management for cheat entries
1148811488-----------------------------------------------------*/
1148911489
11490static void cheat_periodicEntry(CheatEntry * entry)
11490static void cheat_periodicEntry(running_machine *machine, CheatEntry * entry)
1149111491{
1149211492   int   i;
1149311493
r1591r1592
1159611596
1159711597         do{
1159811598            if(!(entry->flags & kCheatFlag_OneShot) || (entry->flags & kCheatFlag_DoOneShot))
11599               cheat_periodicAction(&entry->actionList[i]);
11599               cheat_periodicAction(machine, &entry->actionList[i]);
1160011600
1160111601            i++;
1160211602
r1591r1592
1165911659
1166011660      /* ----- update all actions ----- */
1166111661      for(i = 0; i < entry->actionListLength; i++)
11662         cheat_periodicAction(&entry->actionList[i]);
11662         cheat_periodicAction(machine, &entry->actionList[i]);
1166311663
1166411664      /* ----- if all actions are done, deactivate the cheat if oneshot entry ----- */
1166511665      {
r1591r1592
1177811778  BuildCPUInfoList - get CPU info when initialize cheat system
1177911779---------------------------------------------------------------*/
1178011780
11781static void BuildCPUInfoList(void)
11781static void BuildCPUInfoList(running_machine *machine)
1178211782{
1178311783   int   i;
1178411784
1178511785   /* ----- do regions ----- */
1178611786   {
11787      const rom_entry    * traverse = rom_first_region(Machine->gamedrv);
11787      const rom_entry    * traverse = rom_first_region(machine->gamedrv);
1178811788
1178911789      memset(regionInfoList, 0, sizeof(CPUInfo) * kRegionListLength);
1179011790
r1591r1592
1184611846         CPUInfo   * info = &cpuInfoList[i];
1184711847         CPUInfo   * regionInfo = &regionInfoList[REGION_CPU1 + i - REGION_INVALID];
1184811848
11849         cpu_type type = Machine->drv->cpu[i].type;
11849         cpu_type type = machine->drv->cpu[i].type;
1185011850
1185111851         info->type = type;
1185211852         info->dataBits = cputype_databus_width(type, ADDRESS_SPACE_PROGRAM);
src/emu/cheat.h
r1591r1592
1818
1919void cheat_init(running_machine *machine);
2020
21int cheat_menu(int selection);
21int cheat_menu(running_machine *machine, int selection);
2222
2323void cheat_display_watches(void);
2424
src/emu/drivers/xtal.h
r1591r1592
5151   XTAL_4_224MHz      = 4224000,      /* Used to drive OKI M6295 chips, usually with /4 divider */
5252   XTAL_4_433619MHz   = 4433619,      /* PAL subcarrier */
5353   XTAL_4_9152MHz      = 4915200,
54   XTAL_5MHz          = 5000000,      /* Mutant Night */
5455   XTAL_6MHz          = 6000000,
5556   XTAL_6_144MHz      = 6144000,      /* Used on Alpha Denshi early 80's games sound board */
5657   XTAL_7_3728MHz      = 7372800,
r1591r1592
6061   XTAL_10_595MHz     = 10595000,      /* Mad Alien */
6162   XTAL_11MHz         = 11000000,      /* Mario I8039 sound */
6263   XTAL_11_0592MHz     = 11059200,      /* Lethal Justice */
64   XTAL_11_2MHz        = 11200000,      /* New York, New York */
6365   XTAL_11_289MHz     = 11289000,      /* Vanguard */
6466   XTAL_12MHz         = 12000000,
6567   XTAL_12_096MHz       = 12096000,      /* Some early 80's Atari games */
6668   XTAL_12_288MHz     = 12288000,      /* Sega Model 3 digital audio board */
69   XTAL_12_5MHz         = 12500000,      /* Red Alert audio board */
6770   XTAL_13_3MHz        = 13300000,      /* BMC bowling */
6871   XTAL_13_33056MHz    = 13330560,      /* Taito L */
6972   XTAL_13_4MHz      = 13400000,      /* TNK3, Ikari Warriors h/w */
r1591r1592
8083   XTAL_19_968MHz     = 19968000,      /* Used mostly by Space Invaders games by Taito/Midway and clones */
8184   XTAL_20MHz         = 20000000,
8285   XTAL_21_3MHz        = 21300000,
83   XTAL_21_4772MHz    = 21477200,      /* BMC bowling */
86   XTAL_21_4772MHz    = 21477200,      /* BMC bowling, some Data East 90's games */
8487   XTAL_22MHz         = 22000000,
8588   XTAL_24MHz         = 24000000,      /* Mario, 80's Data East games, 80's Konami games */
8689   XTAL_24_576MHz     = 24576000,      /* Pole Position h/w, Model 3 CPU board */
r1591r1592
125128/* Resonators (There are probably more. Almost always used for driving OKI sound chips) */
126129
127130   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 */
131135};
132136
133137
src/emu/romload.c
r1591r1592
397397   else
398398      sprintf(buffer, "Loading Complete");
399399
400   ui_set_startup_text(buffer, FALSE);
400   ui_set_startup_text(Machine, buffer, FALSE);
401401}
402402
403403
src/lib/util/pool.c
r1591r1592
143143      return NULL;
144144   memset(pool, 0, sizeof(*pool));
145145
146   /* set the failure handler */
147   pool->fail = fail;
148
146149   /* register the built-in types */
147150   pool_type_register(pool, OBJTYPE_MEMORY, "Memory", memory_destruct);
148151
src/mess/video/zx.c
r1591r1592
102102   r.min_y = r.max_y = video_screen_get_vpos(0);
103103   fillbitmap(bitmap, machine->pens[1], &r);
104104   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);
106106   if (++ula_scanline_count == machine->screen[0].height)
107107      ula_scanline_count = 0;
108108}
r1591r1592
121121      ula_irq_active = 0;
122122      if (++ula_scancode_count == 8)
123123         ula_scancode_count = 0;
124      cpunum_set_input_line(0, 0, HOLD_LINE);
124      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
125125      if (++ula_scanline_count == machine->screen[0].height)
126126         ula_scanline_count = 0;
127127   }
src/mess/video/nes.c
r1591r1592
1919
2020static void ppu_nmi(int num, int *ppu_regs)
2121{
22   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
22   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
2323}
2424
2525static void nes_vh_reset(running_machine *machine)
src/mess/video/gb.c
r1591r1592
11391139};
11401140
11411141static 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 );
11431143}
11441144
11451145void gb_video_init( int mode ) {
r1591r1592
13281328            if ( ! gb_lcd.mode_irq ) {
13291329               if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) {
13301330                  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 );
13321332               }
13331333            } else {
13341334               gb_lcd.mode_irq = 0;
r1591r1592
13641364         /* Generate lcd interrupt if requested */
13651365         if ( ! gb_lcd.mode_irq && ( LCDSTAT & 0x08 ) &&
13661366              ( ( ! 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 );
13681368         }
13691369         /* Check for HBLANK DMA */
13701370         if( gbc_hdma_enabled )
r1591r1592
13781378               if ( ! gb_lcd.mode_irq ) {
13791379                  if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) {
13801380                     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 );
13821382                  }
13831383               } else {
13841384                  gb_lcd.mode_irq = 0;
r1591r1592
13941394         gb_lcd.line_irq = 0;
13951395         if ( ! gb_lcd.mode_irq && ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) {
13961396            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 );
13981398         }
13991399         /* Reset LY==LYC STAT bit */
14001400         LCDSTAT &= 0xFB;
r1591r1592
14081408            if ( ! gb_lcd.mode_irq && ( LCDSTAT & 0x20 ) &&
14091409                ( ( ! gb_lcd.triggering_line_irq && ! gb_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) {
14101410               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 );
14121412            }
14131413            timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LYXX_M2, attotime_never );
14141414         }
r1591r1592
14201420         gb_lcd.oam_locked = LOCKED;
14211421         /* Generate lcd interrupt if requested */
14221422         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 );
14241424         }
14251425         /* Check for regular compensation of x-scroll register */
14261426         gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0;
r1591r1592
14341434         /* Generate lcd interrupt if requested */
14351435         if ( ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) ||
14361436             ( !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 );
14381438         }
14391439         gb_lcd.line_irq = gb_lcd.triggering_line_irq;
14401440         /* Check if LY==LYC STAT bit should be set */
r1591r1592
14611461      case GB_LCD_STATE_LY9X_M1:      /* Switch to or stay in mode 1 */
14621462         if ( CURLINE == 144 ) {
14631463            /* Trigger VBlank interrupt */
1464            cpunum_set_input_line( 0, VBL_INT, HOLD_LINE );
1464            cpunum_set_input_line(machine, 0, VBL_INT, HOLD_LINE );
14651465            /* Set VBlank lcdstate */
14661466            gb_lcd.mode = 1;
14671467            LCDSTAT = (LCDSTAT & 0xFC) | 0x01;
14681468            /* Trigger LCD interrupt if requested */
14691469            if ( LCDSTAT & 0x10 ) {
1470               cpunum_set_input_line( 0, LCD_INT, HOLD_LINE );
1470               cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE );
14711471            }
14721472         }
14731473         /* Check if LY==LYC STAT bit should be set */
r1591r1592
14751475            LCDSTAT |= 0x04;
14761476         }
14771477         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 );
14791479         }
14801480         timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(452,0), GB_LCD_STATE_LY9X_M1_INC, attotime_never );
14811481         break;
r1591r1592
14861486         gb_lcd.line_irq = 0;
14871487         if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
14881488            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 );
14901490         }
14911491         /* Reset LY==LYC STAT bit */
14921492         LCDSTAT &= 0xFB;
r1591r1592
15001500         /* Check LY=LYC for line #153 */
15011501         if ( gb_lcd.delayed_line_irq ) {
15021502            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 );
15041504            }
15051505         }
15061506         gb_lcd.delayed_line_irq = gb_lcd.delayed_line_irq | gb_lcd.line_irq;
r1591r1592
15161516      case GB_LCD_STATE_LY00_M1_1:
15171517         if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
15181518            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 );
15201520         }
15211521         timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LY00_M1_2, attotime_never );
15221522         break;
15231523      case GB_LCD_STATE_LY00_M1_2:   /* Rest of line #0 during VBlank */
15241524         if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
15251525            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 );
15271527         }
15281528         if ( CURLINE == CMPLINE ) {
15291529            LCDSTAT |= 0x04;
r1591r1592
15591559            if ( ! gb_lcd.mode_irq ) {
15601560               if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) {
15611561                  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 );
15631563               }
15641564            } else {
15651565               gb_lcd.mode_irq = 0;
r1591r1592
15961596         /* Generate lcd interrupt if requested */
15971597         if ( ! gb_lcd.mode_irq && gb_lcd.triggering_mode_irq &&
15981598              ( ( ! 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 );
16001600            gb_lcd.triggering_mode_irq = 0;
16011601         }
16021602         /* Check for HBLANK DMA */
r1591r1592
16181618               if ( ! gb_lcd.mode_irq ) {
16191619                  if ( ! gb_lcd.line_irq && ! gb_lcd.delayed_line_irq ) {
16201620                     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 );
16221622                  }
16231623               } else {
16241624                  gb_lcd.mode_irq = 0;
r1591r1592
16341634         gb_lcd.line_irq = 0;
16351635         if ( ! gb_lcd.mode_irq && ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) {
16361636            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 );
16381638         }
16391639         /* Check if we're going into VBlank next */
16401640         if ( CURLINE == 144 ) {
r1591r1592
16461646            if ( ! gb_lcd.mode_irq && ( LCDSTAT & 0x20 ) &&
16471647                ( ( ! gb_lcd.triggering_line_irq && ! gb_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) {
16481648               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 );
16501650            }
16511651            timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LYXX_M2, attotime_never );
16521652         }
r1591r1592
16581658         gb_lcd.oam_locked = LOCKED;
16591659         /* Generate lcd interrupt if requested */
16601660         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 );
16621662         }
16631663         /* Check for regular compensation of x-scroll register */
16641664         gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0;
r1591r1592
16721672         /* Generate lcd interrupt if requested */
16731673         if ( ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) ||
16741674             ( !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 );
16761676         }
16771677         gb_lcd.line_irq = gb_lcd.triggering_line_irq;
16781678         /* Check if LY==LYC STAT bit should be set */
r1591r1592
17021702      case GB_LCD_STATE_LY9X_M1:      /* Switch to or stay in mode 1 */
17031703         if ( CURLINE == 144 ) {
17041704            /* Trigger VBlank interrupt */
1705            cpunum_set_input_line( 0, VBL_INT, HOLD_LINE );
1705            cpunum_set_input_line(machine, 0, VBL_INT, HOLD_LINE );
17061706            /* Set VBlank lcdstate */
17071707            gb_lcd.mode = 1;
17081708            LCDSTAT = (LCDSTAT & 0xFC) | 0x01;
17091709            /* Trigger LCD interrupt if requested */
17101710            if ( LCDSTAT & 0x10 ) {
1711               cpunum_set_input_line( 0, LCD_INT, HOLD_LINE );
1711               cpunum_set_input_line(machine, 0, LCD_INT, HOLD_LINE );
17121712            }
17131713         }
17141714         /* Check if LY==LYC STAT bit should be set */
r1591r1592
17181718            LCDSTAT &= ~0x04;
17191719         }
17201720         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 );
17221722         }
17231723         timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(452,0), GB_LCD_STATE_LY9X_M1_INC, attotime_never );
17241724         break;
r1591r1592
17291729         gb_lcd.line_irq = 0;
17301730         if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
17311731            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 );
17331733         }
17341734         if ( gb_lcd.current_line == 153 ) {
17351735            timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LY00_M1, attotime_never );
r1591r1592
17411741         /* Check LY=LYC for line #153 */
17421742         if ( gb_lcd.delayed_line_irq ) {
17431743            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 );
17451745            }
17461746         }
17471747         gb_lcd.delayed_line_irq = gb_lcd.delayed_line_irq | gb_lcd.line_irq;
r1591r1592
17591759      case GB_LCD_STATE_LY00_M1_1:
17601760         if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
17611761            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 );
17631763         }
17641764         timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(4,0), GB_LCD_STATE_LY00_M1_2, attotime_never );
17651765         break;
17661766      case GB_LCD_STATE_LY00_M1_2:   /* Rest of line #0 during VBlank */
17671767         if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
17681768            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 );
17701770         }
17711771         if ( CURLINE == CMPLINE ) {
17721772            LCDSTAT |= 0x04;
r1591r1592
18031803      LCDSTAT |= 0x04;
18041804      /* Generate lcd interrupt if requested */
18051805      if ( LCDSTAT & 0x40 ) {
1806         cpunum_set_input_line( 0, LCD_INT, HOLD_LINE );
1806         cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE );
18071807      }
18081808   }
18091809   timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(80,0), GB_LCD_STATE_LYXX_M3, attotime_never );
r1591r1592
18971897            ( ( LCDSTAT & 0x60 ) == 0x00 && ( data & 0x60 ) == 0x20 ) ||
18981898            ( ( LCDSTAT & 0x60 ) == 0x20 && ( data & 0x40 ) )
18991899            ) ) {
1900            cpunum_set_input_line(0, LCD_INT, HOLD_LINE);
1900            cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE);
19011901         }
19021902         /*
19031903            - 0x20 -> 0x08/0x18/0x28/0x48 (mode 0, after m2int) - trigger
r1591r1592
19051905            - 0x00 -> 0xXX (mode 0) - trigger stat bug
19061906         */
19071907         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);
19091909         }
19101910      }
19111911      break;
r1591r1592
19171917            LCDSTAT |= 0x04;
19181918            /* Generate lcd interrupt if requested */
19191919            if ( LCDSTAT & 0x40 ) {
1920               cpunum_set_input_line( 0, LCD_INT, HOLD_LINE );
1920               cpunum_set_input_line(Machine, 0, LCD_INT, HOLD_LINE );
19211921            }
19221922         } else {
19231923            LCDSTAT &= 0xFB;
r1591r1592
20132013            - 0x20 -> 0x08/0x18/0x28/0x48 (mode 0, after m2int) - trigger
20142014         */
20152015         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);
20172017         }
20182018      }
20192019      break;
src/mess/video/vectrex.c
r1591r1592
107107   }
108108   if (vectrex_lightpen_port & 2)
109109   {
110      cpunum_set_input_line(0, M6809_FIRQ_LINE, PULSE_LINE);
110      cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, PULSE_LINE);
111111   }
112112}
113113
r1591r1592
189189      i = (i+1) % NVECT;
190190   }
191191
192   video_update_vector(machine, screen, bitmap, cliprect);
192   video_update_vector(Machine, screen, bitmap, cliprect);
193193   vector_clear_list();
194194   return 0;
195195}
src/mess/video/m6847.c
r1591r1592
18721872   if (cfg->cpu0_timing_factor > 0)
18731873   {
18741874      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);
18761876   }
18771877
18781878   /* calculate timing */
src/mess/video/x68k.c
r1591r1592
10901090      sys.mfp.isra = 0;
10911091      sys.mfp.isrb = 0;
10921092//      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);
10941094   }
10951095   if(input_code_pressed(KEYCODE_9))
10961096   {
src/mess/video/atarist.c
r1591r1592
170170
171171   if ((y == shifter.vblank_start) && (x == 0))
172172   {
173      cpunum_set_input_line(0, MC68000_IRQ_4, HOLD_LINE);
173      cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE);
174174      shifter.ofs = shifter.base;
175175   }
176176
177177   if (x == shifter.hblank_start)
178178   {
179      cpunum_set_input_line(0, MC68000_IRQ_2, HOLD_LINE);
179      cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE);
180180      shifter.ofs += (shifter.lineofs * 2); // STe
181181   }
182182}
src/mess/video/vic4567.c
r1591r1592
8181      break;
8282   case 0x31:
8383      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);
8686      break;
8787   case 0x32:
8888   case 0x33:
src/mess/video/a7800.c
r1591r1592
352352
353353   if( maria_wsync )
354354   {
355      cpu_trigger( TRIGGER_HSYNC );
355      cpu_trigger( machine, TRIGGER_HSYNC );
356356      maria_wsync = 0;
357357   }
358358
r1591r1592
434434   if( maria_dli )
435435   {
436436      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);
438438   }
439439
440440}
src/mess/video/cdp1864.c
r1591r1592
3434   {
3535      if (cdp1864.disp)
3636      {
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);
3838         cdp1864.dmaptr = 0;
3939      }
4040
r1591r1592
4444   {
4545      if (cdp1864.disp)
4646      {
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);
4848      }
4949
5050      timer_adjust(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0, attotime_zero);
r1591r1592
8989      {
9090         if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END)
9191         {
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);
9393         }
9494      }
9595
r1591r1592
103103      {
104104         if (scanline >= CDP1864_SCANLINE_DISPLAY_START && scanline < CDP1864_SCANLINE_DISPLAY_END)
105105         {
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);
107107         }
108108      }
109109
r1591r1592
170170READ8_HANDLER( cdp1864_dispoff_r )
171171{
172172   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);
175175
176176   return 0xff;
177177}
r1591r1592
187187   cdp1864.dmaptr = 0;
188188   cdp1864.bgcolor = 0;
189189
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);
192192   cdp1864_efx = CLEAR_LINE;
193193
194194   cdp1864_audio_output_enable(0);
src/mess/video/vtech1.c
r1591r1592
8989static void vtech1_field_sync_callback(int data)
9090{
9191   if (data)
92      cpunum_set_input_line(0, 0, CLEAR_LINE);
92      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
9393   else
94      cpunum_set_input_line(0, 0, HOLD_LINE);
94      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
9595}
9696
9797
src/mess/video/amstrad.c
r1591r1592
981981static void amstrad_plus_dma_parse(int channel, int *addr)
982982{
983983   unsigned short command;
984   running_machine *machine = Machine;
984985
985986   if(*addr & 0x01)
986987      (*addr)++;  // align to even address
r1591r1592
10301031      {
10311032         amstrad_plus_irq_cause = channel * 2;
10321033         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);
10341035         logerror("DMA %i: INT\n",channel);
10351036      }
10361037      if(command & 0x20)  // Stop processing on this channel
r1591r1592
11361137/* CRTC - Set new Horizontal Sync Status */
11371138static void amstrad_Set_HS(int offset, int data)
11381139{
1140   running_machine *machine = Machine;
1141
11391142   if (data != 0)
11401143   {
11411144      amstrad_render_mode = amstrad_current_mode;
r1591r1592
11631166            {
11641167               if(amstrad_plus_pri == 0 || amstrad_plus_asic_enabled == 0)
11651168               {
1166                  cpunum_set_input_line(0,0, ASSERT_LINE);
1169                  cpunum_set_input_line(machine, 0,0, ASSERT_LINE);
11671170               }
11681171            }
11691172            amstrad_CRTC_HS_Counter = 0;
r1591r1592
11751178         amstrad_CRTC_HS_Counter = 0;
11761179         if(amstrad_plus_pri == 0 || amstrad_plus_asic_enabled == 0)
11771180         {
1178            cpunum_set_input_line(0,0, ASSERT_LINE);
1181            cpunum_set_input_line(machine, 0,0, ASSERT_LINE);
11791182         }
11801183      }
11811184      if(amstrad_plus_asic_enabled != 0)
r1591r1592
11861189            if(m6845_get_row_counter() == ((amstrad_plus_pri >> 3) & 0x1f) && m6845_get_scanline_counter() == (amstrad_plus_pri & 0x07))
11871190            {
11881191//               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);
11901193               amstrad_plus_irq_cause = 0x06;  // raster interrupt vector
11911194               amstrad_CRTC_HS_Counter &= ~0x20;  // ASIC PRI resets the MSB of the raster counter
11921195            }
src/mess/video/trs80.c
r1591r1592
121121   translate = translate_videoram[(input_port_0_r(0) & 0x40) ? 1 : 0];
122122
123123   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);
125125
126126    /* check for changed color settings */
127127   if (color != (readinputport(0) & 3))
src/mess/video/odyssey2.c
r1591r1592
322322    switch (line)
323323    {
324324        case 252:
325            cpunum_set_input_line(0, 0, ASSERT_LINE); /* vsync?? */
325            cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); /* vsync?? */
326326            break;
327327        case 253:
328            cpunum_set_input_line(0, 0, CLEAR_LINE); /* vsync?? */
328            cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); /* vsync?? */
329329            break;
330330    }
331331}
r1591r1592
584584         /* Throw an interrupt if enabled */
585585         if( o2_vdc.s.control & 0x4 )
586586         {
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? */
588588         }
589589
590590         /* Adjust volume */
src/mess/video/vc4000.c
r1591r1592
474474      (vc4000_video.sprites[0].finished_now))
475475   {
476476      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);
478478   }
479479}
480480
src/mess/video/cdp1861.c
r1591r1592
2626   {
2727      if (cdp1861.disp)
2828      {
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);
3030      }
3131
3232      timer_adjust(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_END, 0), 0, attotime_zero);
r1591r1592
3535   {
3636      if (cdp1861.disp)
3737      {
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);
3939      }
4040
4141      timer_adjust(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0, attotime_zero);
r1591r1592
8080      {
8181         if (scanline >= CDP1861_SCANLINE_DISPLAY_START && scanline < CDP1861_SCANLINE_DISPLAY_END)
8282         {
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);
8484         }
8585      }
8686
r1591r1592
9494      {
9595         if (scanline >= CDP1861_SCANLINE_DISPLAY_START && scanline < CDP1861_SCANLINE_DISPLAY_END)
9696         {
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);
9898         }
9999      }
100100
r1591r1592
127127   cdp1861.disp = 0;
128128   cdp1861.dmaout = 0;
129129
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);
132132   cdp1861_efx = CLEAR_LINE;
133133}
134134
r1591r1592
142142WRITE8_HANDLER( cdp1861_dispoff_w )
143143{
144144   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);
147147}
148148
149149VIDEO_START( cdp1861 )
src/mess/machine/wswan.c
r1591r1592
126126
127127static void wswan_handle_irqs( void ) {
128128   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 );
130130   } 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 );
132132   } 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 );
134134   } 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 );
136136   } 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 );
138138   } 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 );
140140   } 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 );
142142   } 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 );
144144   } else {
145      cpunum_set_input_line( 0, 0, CLEAR_LINE );
145      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE );
146146   }
147147}
148148
src/mess/machine/dgn_beta.c
r1591r1592
681681         HALT_DMA=CLEAR_LINE;
682682
683683      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);
685685
686686      /* CPU un-halted let it run ! */
687687      if (HALT_DMA==CLEAR_LINE)
r1591r1592
724724      else
725725         HALT_CPU=ASSERT_LINE;
726726      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);
728728
729729      d_pia1_pb_last=data & 0x02;
730730
r1591r1592
775775      LOG_INTS(("cpu1 NMI : %d\n",NMI));
776776      if(!NMI)
777777      {
778         cpunum_set_input_line(1,INPUT_LINE_NMI,ASSERT_LINE);
778         cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,ASSERT_LINE);
779779         logerror("cpu_yield()\n");
780780         cpu_yield();   /* Let DMA CPU run */
781781      }
782782      else
783783      {
784         cpunum_set_input_line(1,INPUT_LINE_NMI,CLEAR_LINE);
784         cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,CLEAR_LINE);
785785      }
786786
787787      DMA_NMI_LAST=NMI;   /* Save it for next time */
r1591r1592
865865   else
866866      IRQ = CLEAR_LINE;
867867
868   cpunum_set_input_line(0, M6809_IRQ_LINE, IRQ);
868   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, IRQ);
869869   LOG_INTS(("cpu0 IRQ : %d\n",IRQ));
870870}
871871
r1591r1592
879879   else
880880      FIRQ = CLEAR_LINE;
881881
882   cpunum_set_input_line(0, M6809_FIRQ_LINE, FIRQ);
882   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, FIRQ);
883883
884884   LOG_INTS(("cpu0 FIRQ : %d\n",FIRQ));
885885}
r1591r1592
888888
889889static void cpu1_recalc_firq(int state)
890890{
891   cpunum_set_input_line(1, M6809_FIRQ_LINE, state);
891   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, state);
892892   LOG_INTS(("cpu1 FIRQ : %d\n",state));
893893}
894894
r1591r1592
10451045   system_rom = memory_region(REGION_CPU1);
10461046
10471047   /* 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);
10491049
10501050   /* Reset to task 0, and map banks disabled, so standard memory map */
10511051   /* with ram at $0000-$BFFF, ROM at $C000-FBFF, IO at $FC00-$FEFF */
src/mess/machine/pdp1.c
r1591r1592
924924   {
925925      io_status &= ~io_st_tyi;
926926      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 */
928928   }
929929}
930930
r1591r1592
12741274         typewriter.tb = (i << 4) + j;
12751275         io_status |= io_st_tyi;
12761276         #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 */
12781278         #endif
12791279         cpunum_set_reg(0, PDP1_PF1, 1);
12801280         pdp1_typewriter_drawchar(typewriter.tb);   /* we want to echo input */
src/mess/machine/apple2gs.c
r1591r1592
315315         logerror("apple2gs_add_irq(): adding %s\n", apple2gs_irq_name(irq_mask));
316316
317317      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);
319319   }
320320}
321321
r1591r1592
329329         logerror("apple2gs_remove_irq(): removing %s\n", apple2gs_irq_name(irq_mask));
330330
331331      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);
333333   }
334334}
335335
r1591r1592
11721172
11731173      case 0x36:   /* C036 - CYAREG */
11741174         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);
11761176         break;
11771177
11781178      case 0x38:   /* C038 - SCCBREG */
src/mess/machine/apple3.c
r1591r1592
337337      logerror("apple3_update_memory(): via_0_b=0x%02x via_1_a=0x0x%02x\n", via_0_b, via_1_a);
338338   }
339339
340   cpunum_set_clock(0, (via_0_a & 0x80) ? 1000000 : 2000000);
340   cpunum_set_clock(Machine, 0, (via_0_a & 0x80) ? 1000000 : 2000000);
341341
342342   /* bank 2 (0100-01FF) */
343343   if (!(via_0_a & 0x04))
r1591r1592
480480static void apple2_via_1_irq_func(int state)
481481{
482482   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);
484484   via_1_irq = state;
485485}
486486
src/mess/machine/dai.c
r1591r1592
7878static void dai_interrupt_callback(int intreq, UINT8 vector)
7979{
8080   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);
8282   else
83      cpunum_set_input_line(0, 0, CLEAR_LINE);
83      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
8484}
8585
8686static const tms5501_init_param dai_tms5501_init_param =
src/mess/machine/mac.c
r1591r1592
140140{
141141   if (scc_interrupt)
142142      /* SCC interrupt */
143      cpunum_set_input_line(0, 2, ASSERT_LINE);
143      cpunum_set_input_line(Machine, 0, 2, ASSERT_LINE);
144144   else if (via_interrupt)
145145      /* VIA interrupt */
146      cpunum_set_input_line(0, 1, ASSERT_LINE);
146      cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE);
147147   else
148148      /* clear all interrupts */
149      cpunum_set_input_line(0, 7, CLEAR_LINE);
149      cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
150150}
151151
152152static void set_scc_interrupt(int value)
r1591r1592
741741         scc_set_status(0x02);
742742   }
743743
744   //cpunum_set_input_line(0, 2, ASSERT_LINE);
744   //cpunum_set_input_line(machine, 0, 2, ASSERT_LINE);
745745   set_scc_interrupt(1);
746746}
747747
r1591r1592
12471247static void mac_via_irq(int state)
12481248{
12491249   /* interrupt the 68k (level 1) */
1250   //cpunum_set_input_line(0, 1, state);
1250   //cpunum_set_input_line(machine, 0, 1, state);
12511251   set_via_interrupt(state);
12521252}
12531253
src/mess/machine/cbmb.c
r1591r1592
164164   if (level != old_level)
165165   {
166166      DBG_LOG (3, "mos6509", ("irq %s\n", level ? "start" : "end"));
167      cpunum_set_input_line (0, M6502_IRQ_LINE, level);
167      cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, level);
168168      old_level = level;
169169   }
170170}
src/mess/machine/mbee.c
r1591r1592
4444
4545static void pio_interrupt(int state)
4646{
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);
4848}
4949
5050/*
r1591r1592
152152   switch( state )
153153   {
154154   case WD17XX_IRQ_CLR:
155//      cpunum_set_input_line(0,0,CLEAR_LINE);
155//      cpunum_set_input_line(machine, 0,0,CLEAR_LINE);
156156      fdc_status &= ~0x40;
157157        break;
158158   case WD17XX_IRQ_SET:
159//      cpunum_set_input_line(0,0,HOLD_LINE);
159//      cpunum_set_input_line(machine, 0,0,HOLD_LINE);
160160      fdc_status |= 0x40;
161161        break;
162162   case WD17XX_DRQ_CLR:
src/mess/machine/coco.c
r1591r1592
710710   UINT8 pia0_irq_b = pia_get_irq_b(0);
711711
712712   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);
714714   else
715      cpunum_set_input_line(0, M6809_IRQ_LINE, CLEAR_LINE);
715      cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
716716}
717717
718718static void d_recalc_firq(void)
r1591r1592
723723   UINT8 pia2_firq_b = pia_get_irq_b(2);
724724
725725   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);
727727   else
728      cpunum_set_input_line(0, M6809_FIRQ_LINE, CLEAR_LINE);
728      cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
729729}
730730
731731static void coco3_recalc_irq(void)
732732{
733733   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);
735735   else
736736      d_recalc_irq();
737737}
r1591r1592
739739static void coco3_recalc_firq(void)
740740{
741741   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);
743743   else
744744      d_recalc_firq();
745745}
r1591r1592
871871
872872void coco_set_halt_line(int halt_line)
873873{
874   cpunum_set_input_line(0, INPUT_LINE_HALT, halt_line);
874   cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, halt_line);
875875   if (halt_line == CLEAR_LINE)
876876      timer_set(ATTOTIME_IN_CYCLES(1,0), NULL, 0, recalc_interrupts);
877877}
r1591r1592
15801580   switch(event)
15811581   {
15821582      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);
15841584         break;
15851585      case WD17XX_IRQ_SET:
15861586         if(dgnalpha_just_reset)
r1591r1592
15901590         else
15911591         {
15921592            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);
15941594         }
15951595         break;
15961596      case WD17XX_DRQ_CLR:
r1591r1592
18011801    * TODO:  Make the overclock more accurate.  In dual speed, ROM was a fast
18021802    * access but RAM was not.  I don't know how to simulate this.
18031803    */
1804    cpunum_set_clockscale(0, val ? 2 : 1);
1804    cpunum_set_clockscale(Machine, 0, val ? 2 : 1);
18051805}
18061806
18071807READ8_HANDLER(dragon_alpha_mapped_irq_r)
r1591r1592
26082608static TIMER_CALLBACK(halt_timer_proc)
26092609{
26102610   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);
26122612}
26132613
26142614
r1591r1592
26202620static TIMER_CALLBACK(nmi_timer_proc)
26212621{
26222622   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);
26242624}
26252625
26262626
src/mess/machine/gb.c
r1591r1592
17701770   if ( ! SIOCount ) {
17711771      SIOCONT &= 0x7F;
17721772      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);
17741774   }
17751775}
17761776
r1591r1592
17801780      gb_timer.triggering_irq = 0;
17811781      if ( TIMECNT == 0 ) {
17821782         TIMECNT = TIMEMOD;
1783         cpunum_set_input_line( 0, TIM_INT, HOLD_LINE );
1783         cpunum_set_input_line(Machine, 0, TIM_INT, HOLD_LINE );
17841784         gb_timer.reloading = 1;
17851785      }
17861786   }
src/mess/machine/concept.c
r1591r1592
156156
157157   if (final_level)
158158      /* 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);
160160   else
161161      /* 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);
163163}
164164
165165INLINE void post_in_KeyQueue(int keycode)
src/mess/machine/kim1.c
r1591r1592
663663   logerror("m6530(%d) timer expired\n", chip);
664664   m6530[chip].state |= 0x80;
665665   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);
667667}
668668
669669INTERRUPT_GEN( kim1_interrupt )
src/mess/machine/99_dsk.c
r1591r1592
7272static void fdc_handle_hold(void)
7373{
7474   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);
7676   else
77      cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE);
77      cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE);
7878}
7979
8080/*
src/mess/machine/msx.c
r1591r1592
278278
279279void msx_vdp_interrupt(int i)
280280{
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));
282282}
283283
284284static void msx_ch_reset_core (void)
src/mess/machine/gamecom.c
r1591r1592
6565{
6666   UINT8 val = ( ( internal_registers[SM8521_CLKT] & 0x3F ) + 1 ) & 0x3F;
6767   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 );
6969}
7070
7171MACHINE_RESET( gamecom )
r1591r1592
553553      gamecom_dma.dest_current = gamecom_dma.dest_line;
554554   }
555555   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 );
557557}
558558
559559void gamecom_update_timers( int cycles ) {
r1591r1592
564564         gamecom_timer[0].counter++;
565565         if ( gamecom_timer[0].counter == gamecom_timer[0].check_value ) {
566566            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 );
568568         }
569569      }
570570   }
r1591r1592
575575         gamecom_timer[1].counter++;
576576         if ( gamecom_timer[1].counter == gamecom_timer[1].check_value ) {
577577            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 );
579579         }
580580      }
581581   }
src/mess/machine/advision.c
r1591r1592
4040   advision_videoenable = 0;
4141   wLpointer = 0;
4242   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);
4444
4545}
4646
r1591r1592
6161   {
6262      if (d & 0x01)
6363      {
64         cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
64         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
6565         /*   logerror("RELEASE RESET\n"); */
6666         wLpointer = 0;
6767         rLpointer = 0;
6868      }
6969      else
7070      {
71         cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
71         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
7272         /*   logerror("SET RESET\n");*/
7373      }
7474
src/mess/machine/mz700.c
r1591r1592
125125{
126126   /* INTMSK: interrupt enabled? */
127127    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);
129129}
130130
131131/************************ PIO ************************************************/
src/mess/machine/ti990.c
r1591r1592
3131   {
3232      for (level = 0; ! (intlines & (1 << level)); level++)
3333         ;
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 */
3535   }
3636   else
37      cpunum_set_input_line(0, 0, CLEAR_LINE);
37      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
3838}
3939
4040void ti990_set_int2(int state)
r1591r1592
7878
7979static TIMER_CALLBACK(clear_load)
8080{
81   cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
81   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
8282}
8383
8484void ti990_hold_load(void)
8585{
86   cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE);
86   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
8787   timer_set(ATTOTIME_IN_MSEC(100), NULL, 0, clear_load);
8888}
8989
src/mess/machine/vectrex.c
r1591r1592
189189 *********************************************************************/
190190void v_via_irq (int level)
191191{
192   cpunum_set_input_line(0, M6809_IRQ_LINE, level);
192   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, level);
193193}
194194
195195 READ8_HANDLER( v_via_pb_r )
src/mess/machine/aim65.c
r1591r1592
5757
5858static void aim65_via_irq_func(int state)
5959{
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);
6161}
6262
6363/* STEP/RUN
r1591r1592
171171
172172static void aim65_riot_irq(int state)
173173{
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);
175175}
176176
177177
src/mess/machine/nes_mmc.c
r1591r1592
9999
100100static TIMER_CALLBACK(nes_irq_callback)
101101{
102   cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
102   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
103103   timer_adjust(nes_irq_timer, attotime_never, 0, attotime_never);
104104}
105105
r1591r1592
632632      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
633633      {
634634         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 (0, M6502_IRQ_LINE, HOLD_LINE);
635         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
636636//         timer_adjust(nes_irq_timer, ATTOTIME_IN_CYCLES(4, 0), 0, attotime_never);
637637      }
638638   }
r1591r1592
837837   if (scanline == IRQ_count)
838838   {
839839      if (IRQ_enable)
840         cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
840         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
841841
842842      IRQ_status = 0xff;
843843   }
r1591r1592
15861586   {
15871587      if (IRQ_count <= 114)
15881588      {
1589         cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
1589         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
15901590      }
15911591      IRQ_count -= 114;
15921592   }
r1591r1592
17261726         {
17271727            if ((IRQ_count & 0x0f) == 0x00)
17281728               /* rollover every 0x10 */
1729               cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
1729               cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
17301730         }
17311731         else if (IRQ_mode & 0x04)
17321732         {
17331733            if ((IRQ_count & 0x0ff) == 0x00)
17341734               /* rollover every 0x100 */
1735               cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
1735               cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
17361736         }
17371737         else if (IRQ_mode & 0x02)
17381738         {
17391739            if ((IRQ_count & 0x0fff) == 0x000)
17401740               /* rollover every 0x1000 */
1741               cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
1741               cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
17421742         }
17431743         else if (IRQ_count == 0)
17441744            /* rollover at 0x10000 */
1745            cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
1745            cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
17461746      }
17471747   }
17481748   else
r1591r1592
19601960   /* Increment & check the IRQ scanline counter */
19611961   if (IRQ_enable && (IRQ_count == 0x7fff))
19621962   {
1963      cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
1963      cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
19641964   }
19651965}
19661966
r1591r1592
20172017static void fds_irq ( int num, int scanline, int vblank, int blanked )
20182018{
20192019   if (IRQ_enable_latch)
2020      cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
2020      cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
20212021
20222022   /* Increment & check the IRQ scanline counter */
20232023   if (IRQ_enable)
20242024   {
20252025      if (IRQ_count <= 114)
20262026      {
2027         cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
2027         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
20282028         IRQ_enable = 0;
20292029         nes_fds.status0 |= 0x01;
20302030      }
r1591r1592
21352135   {
21362136      IRQ_count = IRQ_count_latch;
21372137      IRQ_enable = IRQ_enable_latch;
2138      cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
2138      cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
21392139   }
21402140}
21412141
r1591r1592
28022802   {
28032803      if (--IRQ_count == 0)
28042804      {
2805         cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
2805         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
28062806      }
28072807   }
28082808}
r1591r1592
32463246   if (IRQ_enable)
32473247   {
32483248      if (--IRQ_count == 0)
3249         cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
3249         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
32503250   }
32513251}
32523252
r1591r1592
33243324   {
33253325      if (IRQ_count <= 114)
33263326      {
3327         cpunum_set_input_line (0, M6502_IRQ_LINE, HOLD_LINE);
3327         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
33283328      }
33293329      IRQ_count -= 114;
33303330   }
r1591r1592
43244324      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
43254325      {
43264326         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 (0, M6502_IRQ_LINE, HOLD_LINE);
4327         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
43284328      }
43294329   }
43304330}
r1591r1592
48304830      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
48314831      {
48324832         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 (0, M6502_IRQ_LINE, HOLD_LINE);
4833         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
48344834      }
48354835   }
48364836}
src/mess/machine/vc1541.c
r1591r1592
353353      vc1541->head.ready=0;
354354      vc1541->head.sync=0;
355355      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);
357357         via_3_ca1_w(0,1);
358358      }
359359      return;
r1591r1592
377377      vc1541->head.sync=0;
378378   }
379379   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);
381381      via_3_ca1_w(0,0);
382382   }
383383   vc1541->clock=0;
r1591r1592
402402{
403403   vc1541->via0irq = level;
404404   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,
406406                 M6502_IRQ_LINE, vc1541->via1irq || vc1541->via0irq);
407407}
408408
r1591r1592
501501{
502502   vc1541->via1irq = level;
503503   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,
505505                 M6502_IRQ_LINE, vc1541->via1irq || vc1541->via0irq);
506506}
507507
r1591r1592
811811 */
812812static TIMER_CALLBACK(c1551_timer)
813813{
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);
815815}
816816
817817/*
src/mess/machine/thomson.c
r1591r1592
7070   if ( old && !thom_irq )
7171      LOG_IRQ(( "%f thom_set_irq: irq line down %i\n", attotime_to_double(timer_get_time()), line ));
7272
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 );
7474}
7575
7676
r1591r1592
8989   if ( old && !thom_firq )
9090      LOG_IRQ(( "%f thom_set_firq: firq line down %i\n", attotime_to_double(timer_get_time()), line ));
9191
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 );
9393}
9494
9595
r1591r1592
9898{
9999   thom_irq = 0;
100100   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 );
103103}
104104
105105
src/mess/machine/lisa.c
r1591r1592
222222
223223   /*if (RSIR)
224224      // 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);
226226   else if (int0)
227227      // 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);
229229   else if (int1)
230230      // 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);
232232   else if (int2)
233233      // 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);
235235   else*/ if (KBIR)
236236      /* 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);
238238   else if (FDIR || VTIR)
239239      /* 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);
241241   else
242242      /* 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);
244244}
245245
246246static void set_parity_error_pending(int value)
r1591r1592
250250   parity_error_pending = value;
251251   if (parity_error_pending)
252252   {
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);
254254   }
255255   else
256256   {
257      cpunum_set_input_line(0, M68K_IRQ_7, CLEAR_LINE);
257      cpunum_set_input_line(machine, 0, M68K_IRQ_7, CLEAR_LINE);
258258   }
259259#else
260260   /* work-around... */
261261   if ((! parity_error_pending) && value)
262262   {
263263      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);
265265   }
266266   else if (parity_error_pending && (! value))
267267   {
r1591r1592
420420#if 0
421421                  if (keycode == NMIcode)
422422                  {   /* 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);
424424                     cpunum_set_input_line_vector(0, M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR);
425425                  }
426426#endif
src/mess/machine/sym1.c
r1591r1592
172172
173173static void sym1_irq(int level)
174174{
175   cpunum_set_input_line(0, M6502_IRQ_LINE, level);
175   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, level);
176176}
177177
178178
src/mess/machine/lynx.c
r1591r1592
828828{
829829    if ( ( lynx_timer[which].cntrl1 & 0x80 ) && ( which != 4 ) ) { // irq flag handling later
830830      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);
832832    }
833833    switch ( which ) {
834834    case 0:
r1591r1592
990990//    mikey.data[0x80]|=0x10;
991991    if (uart.serctl&0x80) {
992992   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);
994994    }
995995}
996996
r1591r1592
10961096      mikey.data[0x81]&=~data; // clear interrupt source
10971097      logerror("mikey write %.2x %.2x\n",offset,data);
10981098      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);
11001100      break;
11011101
11021102   case 0x87:
r1591r1592
11801180   int i;
11811181   lynx_memory_config_w(0, 0);
11821182
1183   cpunum_set_input_line(0, M65SC02_IRQ_LINE, CLEAR_LINE);
1183   cpunum_set_input_line(machine, 0, M65SC02_IRQ_LINE, CLEAR_LINE);
11841184
11851185   memset(&suzy, 0, sizeof(suzy));
11861186   memset(&mikey, 0, sizeof(mikey));
src/mess/machine/cgenie.c
r1591r1592
317317    * Every fifth cycle is a wait cycle, so I reduced
318318    * the overlocking by one fitfth
319319    */
320   cpunum_set_clockscale(0, 0.80);
320   cpunum_set_clockscale(Machine, 0, 0.80);
321321
322322   /* Initialize some patterns to be displayed in graphics mode */
323323   for( i = 0; i < 256; i++ )
r1591r1592
970970   if( (irq_status & IRQ_TIMER) == 0 )
971971   {
972972      irq_status |= IRQ_TIMER;
973      cpunum_set_input_line(0, 0, HOLD_LINE);
973      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
974974   }
975975}
976976
r1591r1592
979979   if( (irq_status & IRQ_FDC) == 0 )
980980   {
981981      irq_status |= IRQ_FDC;
982      cpunum_set_input_line(0, 0, HOLD_LINE);
982      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
983983   }
984984}
985985
src/mess/machine/spectrum.c
r1591r1592
488488   }
489489
490490   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);
494494
495495   spectrum_page_basicrom();
496496
r1591r1592
591591   set_last_border_color(pSnapshot[26] & 0x07);
592592   force_border_redraw();
593593
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);
597597
598598   if (SnapshotSize == 49179)
599599      /* 48K Snapshot */
r1591r1592
899899      /* cpunum_set_reg(0, Z80_IRQ_STATE, 1); */
900900   }
901901
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);
905905
906906   /* IFF2 */
907907   if (pSnapshot[28] != 0)
src/mess/machine/astrocde.c
r1591r1592
7171    /* Scanline interrupt enabled ? */
7272    if ((screen_interrupts_enabled) && (screen_interrupt_mode == 0)
7373                                   && (CurrentScan == NextScanInt))
74      cpunum_set_input_line(0, 0, HOLD_LINE);
74      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
7575}
7676
7777WRITE8_HANDLER( astrocade_interrupt_vector_w )
7878{
7979   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);
8181}
8282
src/mess/machine/geneve.c
r1591r1592
343343static void inta_callback(int state)
344344{
345345   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);
347347}
348348
349349/*
r1591r1592
13411341static void tms9901_interrupt_callback(int intreq, int ic)
13421342{
13431343   /* 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);
13451345}
13461346
13471347/*
src/mess/machine/c128.c
r1591r1592
510510         memory_set_context(0);
511511         c128_bankswitch_z80();
512512         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);
515515      }
516516      else
517517      {
r1591r1592
520520         memory_set_context(1);
521521         c128_bankswitch_128(reset);
522522         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);
525525
526526         /* NPW 19-Nov-2005 - In the C128, CPU #0 starts out and hands over
527527          * control to CPU #1.  CPU #1 seems to execute garbage from 0x0000
r1591r1592
831831
832832   c64mode = 0;
833833   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);
836836}
837837
838838VIDEO_START( c128 )
src/mess/machine/pc_turbo.c
r1591r1592
3232   if (val != ti->cur_val)
3333   {
3434      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);
3636   }
3737}
3838
src/mess/machine/ay3600.c
r1591r1592
428428         if (!reset_flag) {
429429            reset_flag = 1;
430430            /* 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);
432432         }
433433         return;
434434   }
435435   if (reset_flag)
436436   {
437437      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);
439439      mame_schedule_soft_reset(Machine);
440440   }
441441
src/mess/machine/pc8801.c
r1591r1592
122122   }
123123   if (level >= 0 && level<interrupt_level_reg)
124124   {
125      cpunum_set_input_line (0, 0, HOLD_LINE);
125      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
126126   }
127127}
128128
r1591r1592
793793/* callback for /INT output from FDC */
794794static void pc8801_fdc_interrupt(int state)
795795{
796    cpunum_set_input_line (1, 0, state ? HOLD_LINE : CLEAR_LINE);
796    cpunum_set_input_line(Machine, 1, 0, state ? HOLD_LINE : CLEAR_LINE);
797797}
798798
799799/* callback for /DRQ output from FDC */
src/mess/machine/pet.c
r1591r1592
9696   {
9797      DBG_LOG (3, "mos6502", ("irq %s\n", level ? "start" : "end"));
9898      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);
101101      old_level = level;
102102   }
103103}
r1591r1592
553553      spet.rom = 0;
554554      if (M6809_SELECT)
555555      {
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);
558558         pet_font = 2;
559559      }
560560      else
561561      {
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);
564564         pet_font = 0;
565565      }
566566   }
r1591r1592
601601   if (superpet)
602602   {
603603      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);
606606         pet_font|=2;
607607      } 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);
610610         pet_font&=~2;
611611      }
612612   }
src/mess/machine/c16.c
r1591r1592
375375   if (level != old_level)
376376   {
377377      DBG_LOG (3, "mos7501", ("irq %s\n", level ? "start" : "end"));
378      cpunum_set_input_line (0, M6510_IRQ_LINE, level);
378      cpunum_set_input_line(Machine, 0, M6510_IRQ_LINE, level);
379379      old_level = level;
380380   }
381381}
src/mess/machine/oric.c
r1591r1592
8383   /* any irq set? */
8484   if ((oric_irqs & 0x0f)!=0)
8585   {
86      cpunum_set_input_line(0,0, HOLD_LINE);
86      cpunum_set_input_line(Machine, 0,0, HOLD_LINE);
8787   }
8888   else
8989   {
90      cpunum_set_input_line(0,0, CLEAR_LINE);
90      cpunum_set_input_line(Machine, 0,0, CLEAR_LINE);
9191   }
9292}
9393
src/mess/machine/europc.c
r1591r1592
115115      break;
116116   case 4:
117117      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;
121121      }
122122      break;
123123   case 0xa:
src/mess/machine/atom.c
r1591r1592
4343{
4444   if (state)
4545   {
46      cpunum_set_input_line(0,0, HOLD_LINE);
46      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
4747   }
4848   else
4949   {
50      cpunum_set_input_line(0,0, CLEAR_LINE);
50      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
5151   }
5252
5353
r1591r1592
153153      {
154154         /* I'll pulse it because if I used hold-line I'm not sure
155155         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);
157157      }
158158   }
159159
src/mess/machine/at.c
r1591r1592
3131static void at_set_gate_a20(int a20)
3232{
3333   /* 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);
3535}
3636
3737
src/mess/machine/vc20.c
r1591r1592
5656*/
5757static void vc20_via0_irq (int level)
5858{
59   cpunum_set_input_line(0, INPUT_LINE_NMI, level);
59   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, level);
6060}
6161
6262static  READ8_HANDLER( vc20_via0_read_ca1 )
r1591r1592
120120 */
121121static void vc20_via1_irq (int level)
122122{
123   cpunum_set_input_line (0, M6502_IRQ_LINE, level);
123   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, level);
124124}
125125
126126static  READ8_HANDLER( vc20_via1_read_porta )
src/mess/machine/electron.c
r1591r1592
250250   }
251251   if ( ula.interrupt_status & ula.interrupt_control & ~0x83 ) {
252252      ula.interrupt_status |= 0x01;
253      cpunum_set_input_line( 0, 0, ASSERT_LINE );
253      cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE );
254254   } else {
255255      ula.interrupt_status &= ~0x01;
256      cpunum_set_input_line( 0, 0, CLEAR_LINE );
256      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE );
257257   }
258258}
259259
src/mess/machine/apple1.c
r1591r1592
303303      if (!reset_flag) {
304304         reset_flag = 1;
305305         /* 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);
307307         pia_reset();
308308      }
309309   }
310310   else if (reset_flag) {
311311      /* RESET released--allow the processor to continue. */
312312      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);
314314   }
315315
316316   /* The CLEAR SCREEN switch clears the video hardware. */
src/mess/machine/bebox.c
r1591r1592
229229               (crossproc_map[i].inputline == PPC_INPUT_LINE_SMI) ? "SMI" : "TLBISYNC");
230230         }
231231
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);
233233      }
234234   }
235235}
r1591r1592
240240
241241   if (b & 0x20)
242242   {
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);
244244   }
245245}
246246
r1591r1592
260260            bebox_interrupts, bebox_cpu_imask[cpunum], interrupt ? "on" : "off");
261261      }
262262
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);
264264   }
265265}
266266
r1591r1592
972972
973973MACHINE_RESET( bebox )
974974{
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);
977977   ide_controller_reset(0);
978978}
979979
src/mess/machine/mtx.c
r1591r1592
189189static void mtx_ctc_interrupt(int state)
190190{
191191//  logerror("mtx_ctc_interrupt: %02x\n", state);
192   cpunum_set_input_line(0, 0, state);
192   cpunum_set_input_line(Machine, 0, 0, state);
193193}
194194 
195195READ8_HANDLER( mtx_ctc_r )
src/mess/machine/microtan.c
r1591r1592
139139    /* The 6502 IRQ line is active low and probably driven
140140       by open collector outputs (guess). Since MAME/MESS use
141141       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);
143143}
144144
145145static mess_image *cassette_device_image(void)
r1591r1592
423423/* This callback is called one clock cycle after BFF2 is written (delayed nmi) */
424424static TIMER_CALLBACK(microtan_pulse_nmi)
425425{
426    cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
426    cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
427427}
428428
429429WRITE8_HANDLER ( microtan_bffx_w )
src/mess/machine/intv.c
r1591r1592
429429
430430static TIMER_CALLBACK(intv_interrupt_complete)
431431{
432   cpunum_set_input_line(0, CP1610_INT_INTRM, CLEAR_LINE);
432   cpunum_set_input_line(machine, 0, CP1610_INT_INTRM, CLEAR_LINE);
433433}
434434
435435INTERRUPT_GEN( intv_interrupt )
436436{
437   cpunum_set_input_line(0, CP1610_INT_INTRM, ASSERT_LINE);
437   cpunum_set_input_line(machine, 0, CP1610_INT_INTRM, ASSERT_LINE);
438438   sr1_int_pending = 1;
439439   timer_set(ATTOTIME_IN_CYCLES(3791, 0), NULL, 0, intv_interrupt_complete);
440440   stic_screenrefresh();
src/mess/machine/amigacrt.c
r1591r1592
8484static TIMER_CALLBACK( amiga_ar1_delayed_nmi )
8585{
8686   (void)param;
87   cpunum_set_input_line(0, 7, PULSE_LINE);
87   cpunum_set_input_line(Machine, 0, 7, PULSE_LINE);
8888}
8989
9090static void amiga_ar1_nmi( void )
r1591r1592
280280      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, amiga_chip_ram_size - 1, 0, 0, amiga_ar23_chipmem_w);
281281
282282      /* trigger NMI irq */
283      cpunum_set_input_line(0, 7, PULSE_LINE);
283      cpunum_set_input_line(Machine, 0, 7, PULSE_LINE);
284284   }
285285}
286286
src/mess/machine/osborne1.c
r1591r1592
229229   //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" );
230230
231231   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 );
233233   } else {
234      cpunum_set_input_line( 0, 0, CLEAR_LINE );
234      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE );
235235   }
236236}
237237
src/mess/machine/sms.c
r1591r1592
283283   if ( ! IS_GAMEGEAR ) {
284284      if ( ! (readinputport(2) & 0x80) ) {
285285         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 );
288288         }
289289         smsPaused = 1;
290290      } else {
r1591r1592
10031003}
10041004
10051005void sms_int_callback( int state ) {
1006   cpunum_set_input_line( 0, 0, state );
1006   cpunum_set_input_line(Machine, 0, 0, state );
10071007}
10081008
10091009void 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 );
10111011}
10121012
src/mess/machine/trs80.c
r1591r1592
614614   if( (irq_status & IRQ_TIMER) == 0 )
615615   {
616616      irq_status |= IRQ_TIMER;
617      cpunum_set_input_line (0, 0, HOLD_LINE);
617      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
618618   }
619619}
620620
r1591r1592
623623   if ((irq_status & IRQ_FDC) == 0)
624624   {
625625      irq_status |= IRQ_FDC;
626      cpunum_set_input_line (0, 0, HOLD_LINE);
626      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
627627   }
628628}
629629
src/mess/machine/apple2.c
r1591r1592
772772         irq_freq = 1;
773773
774774      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);
776776   }
777777
778778   video_screen_update_partial(0, scanline);
src/mess/machine/tandy1t.c
r1591r1592
188188      break;
189189   case 2:
190190      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);
193193      break;
194194   }
195195}
src/mess/machine/primo.c
r1591r1592
3737INTERRUPT_GEN( primo_vblank_interrupt )
3838{
3939   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);
4141}
4242
4343/*******************************************************************************
r1591r1592
243243   if (readinputport(6))
244244      primo_port_FD = 0x00;
245245   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);
247247}
248248
249249MACHINE_RESET( primoa )
src/mess/machine/ti85.c
r1591r1592
114114   {
115115      if (ti85_ON_interrupt_mask && !ti85_ON_pressed)
116116      {
117         cpunum_set_input_line(0, 0, HOLD_LINE);
117         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
118118         ti85_ON_interrupt_status = 1;
119119         if (!ti85_timer_interrupt_mask) ti85_timer_interrupt_mask = 1;
120120      }
r1591r1592
125125      ti85_ON_pressed = 0;
126126   if (ti85_timer_interrupt_mask)
127127   {
128      cpunum_set_input_line(0, 0, HOLD_LINE);
128      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
129129      ti85_timer_interrupt_status = 1;
130130   }
131131}
r1591r1592
529529
530530   activecpu_set_input_line(0, 0);
531531   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);
533533}
534534
535535static void ti85_setup_snapshot (UINT8 * data)
src/mess/machine/c64.c
r1591r1592
101101         if (cpu_getactivecpu()==0)
102102         {
103103            /* 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);
105105         }
106106         else
107107         {
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);
109109         }
110110      }
111111      else
112112      {
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);
114114      }
115115      nmilevel = KEY_RESTORE||cia1irq;
116116   }
r1591r1592
302302      {
303303         if (0&&(cpu_getactivecpu()==0))
304304         {
305            cpunum_set_input_line (0, 0, level);
305            cpunum_set_input_line(Machine, 0, 0, level);
306306         }
307307         else
308308         {
309            cpunum_set_input_line (1, M6510_IRQ_LINE, level);
309            cpunum_set_input_line(Machine, 1, M6510_IRQ_LINE, level);
310310         }
311311      }
312312      else
313313      {
314         cpunum_set_input_line (0, M6510_IRQ_LINE, level);
314         cpunum_set_input_line(Machine, 0, M6510_IRQ_LINE, level);
315315      }
316316      old_level = level;
317317   }
src/mess/machine/hd63450.c
r1591r1592
204204   // Burst transfers will halt the CPU until the transfer is complete
205205   if((dmac.reg[channel].dcr & 0xc0) == 0x00)  // Burst transfer
206206   {
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);
208208      timer_adjust(dmac.timer[channel],attotime_zero,channel, dmac.intf->burst_clock[channel]);
209209   }
210210   else
r1591r1592
367367            dmac.reg[x].csr |= 0xe0;  // channel operation complete, block transfer complete
368368            dmac.reg[x].csr &= ~0x08;  // channel no longer active
369369            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);
371371
372372            if(dmac.intf->dma_end)
373373               dmac.intf->dma_end(x,dmac.reg[x].ccr & 0x08);
src/mess/machine/genesis.c
r1591r1592
11871187   // write 0100 requests z80 bus (z80 paused)
11881188   if (data == 0x0000)
11891189   {
1190      cpunum_set_input_line(1, INPUT_LINE_HALT,  CLEAR_LINE);
1190      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT,  CLEAR_LINE);
11911191      genesis_68k_has_z80_bus = 0;
11921192//         logerror("-- z80 running %04x\n",data);
11931193
r1591r1592
11951195
11961196   if (data == 0x0100)
11971197   {
1198      cpunum_set_input_line(1, INPUT_LINE_HALT,  ASSERT_LINE);
1198      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT,  ASSERT_LINE);
11991199      genesis_68k_has_z80_bus = 1;
12001200//         logerror("-- z80 stopped %04x\n",data);
12011201
r1591r1592
12121212
12131213   if (data == 0x0000)
12141214   {
1215      cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
1215      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
12161216      genesis_z80_is_reset = 1;
12171217   }
12181218
12191219   if (data == 0x0100)
12201220   {
1221      cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
1221      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
12221222      genesis_z80_is_reset = 0;
12231223   }
12241224}
r1591r1592
22752275   //   if (!irqlevel)
22762276         irqlevel = 6;
22772277
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?
22792279   }
22802280
22812281
r1591r1592
22852285      genesis_vdp_draw_scanline(&genesis_vdp,genesis_vdp.sline);
22862286   }
22872287
2288   cpunum_set_input_line(0,irqlevel, HOLD_LINE);
2288   cpunum_set_input_line(machine, 0,irqlevel, HOLD_LINE);
22892289}
22902290
22912291//static void ym3438_interrupt(int state)
r1591r1592
22972297{
22982298//   logerror("MACHINE_RESET ( genesis )\n");
22992299   /* 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);
23012301   genesis_z80_is_reset = 1;
23022302
2303   cpunum_set_input_line(1, INPUT_LINE_HALT,  ASSERT_LINE);
2303   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT,  ASSERT_LINE);
23042304   genesis_68k_has_z80_bus = 1;
23052305
23062306   memset(memory_region(REGION_CPU2), 0xcf, 0x2000);
r1591r1592
23382338//   memory_set_bankptr(3,memory_region(REGION_CPU2));  /* BANK3 = mainram */
23392339
23402340   /* 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);
23422342   genesis_68k_has_z80_bus = 0;
23432343
2344   cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
2344   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
23452345   genesis_z80_is_reset = 1;
23462346
23472347//   memset(genesis_z80ram, 0x00, 0x2000);
src/mess/machine/svi318.c
r1591r1592
6565
6666static void svi318_uart8250_interrupt(int nr, int state)
6767{
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));
6969}
7070
7171static const uart8250_interface svi318_uart8250_interface[1] =
r1591r1592
535535
536536void svi318_vdp_interrupt(int i)
537537{
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));
539539}
540540
541541DRIVER_INIT( svi318 )
src/mess/machine/pce.c
r1591r1592
763763   }
764764
765765   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 );
767767   } else {
768      cpunum_set_input_line( 0, 1, CLEAR_LINE );
768      cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE );
769769   }
770770}
771771
src/mess/machine/ti99_4x.c
r1591r1592
496496   /* There is a circuitry in TI99/4(a) that resets the console when a
497497   cartridge is inserted or removed.  We emulate this instead of resetting the
498498   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);
500500   tms9901_reset(0);
501501   if (! has_evpc)
502502      TMS9928A_reset();
r1591r1592
593593   /* There is a circuitry in TI99/4(a) that resets the console when a
594594   cartridge is inserted or removed.  We emulate this instead of resetting the
595595   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);
597597   tms9901_reset(0);
598598   if (! has_evpc)
599599      TMS9928A_reset();
r1591r1592
21992199   {
22002200      /* On TI99, TMS9900 IC0-3 lines are not connected to TMS9901,
22012201       * 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 */
22032203   }
22042204   else
22052205   {
2206      cpunum_set_input_line(0, 0, CLEAR_LINE);
2206      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
22072207   }
22082208}
22092209
src/mess/machine/galaxy.c
r1591r1592
4646
4747INTERRUPT_GEN( galaxy_interrupt )
4848{
49   cpunum_set_input_line(0, 0, HOLD_LINE);
49   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
5050}
5151
5252static int galaxy_irq_callback (int cpu)
r1591r1592
118118         break;
119119   }
120120
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);
123123}
124124
125125SNAPSHOT_LOAD( galaxy )
src/mess/machine/bbc.c
r1591r1592
4747
4848static void bbc_setirq(void)
4949{
50  cpunum_set_input_line(0, M6502_IRQ_LINE, via_system_irq|via_user_irq|MC6850_irq|ACCCON_IRR);
50   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, via_system_irq|via_user_irq|MC6850_irq|ACCCON_IRR);
5151}
5252
5353/************************
r1591r1592
15131513      {
15141514         /* I'll pulse it because if I used hold-line I'm not sure
15151515         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);
15171517      }
15181518   }
15191519
r1591r1592
16781678      {
16791679         /* I'll pulse it because if I used hold-line I'm not sure
16801680         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);
16821682      }
16831683   }
16841684
src/mess/machine/compis.c
r1591r1592
186186void compis_irq_set(UINT8 irq)
187187{
188188   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);
190190}
191191#endif
192192
r1591r1592
680680   /* generate the appropriate interrupt */
681681   i186.intr.poll_status = 0x8000 | new_vector;
682682   if (!i186.intr.pending)
683      cpunum_set_input_line(2, 0, ASSERT_LINE);
683      cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
684684   i186.intr.pending = 1;
685   cpu_trigger(CPU_RESUME_TRIGGER);
685   cpu_trigger(Machine, CPU_RESUME_TRIGGER);
686686   if (LOG_OPTIMIZATION) logerror("  - trigger due to interrupt pending\n");
687687   if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", attotime_to_double(timer_get_time()), new_vector);
688688}
r1591r1592
15411541   {
15421542      case 0:
15431543         /* 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);
15451545         break;
15461546
15471547      case 1:
src/mess/machine/kc.c
r1591r1592
150150#if 0
151151static void kc85_disc_hw_ctc_interrupt(int state)
152152{
153   cpunum_set_input_line(1, 0, state);
153   cpunum_set_input_line(machine, 1, 0, state);
154154}
155155#endif
156156
r1591r1592
246246   z80ctc_reset(1);
247247
248248   /* 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);
250250}
251251
252252/*****************/
r1591r1592
17271727
17281728static void kc85_pio_interrupt(int state)
17291729{
1730   cpunum_set_input_line(0, 0, state);
1730   cpunum_set_input_line(Machine, 0, 0, state);
17311731}
17321732
17331733static void kc85_ctc_interrupt(int state)
17341734{
1735   cpunum_set_input_line(0, 1, state);
1735   cpunum_set_input_line(Machine, 0, 1, state);
17361736}
17371737
17381738/* callback for ardy output from PIO */
src/mess/mess.mak
r1591r1592
256256#SOUNDS += NAMCONA
257257#SOUNDS += TMS36XX
258258#SOUNDS += TMS3615
259#SOUNDS += TMS5100
259260#SOUNDS += TMS5110
261#SOUNDS += TMS5110A
262#SOUNDS += CD2801
263#SOUNDS += TMC0281
264#SOUNDS += CD2802
265#SOUNDS += M58817
260266#SOUNDS += TMC0285
261267#SOUNDS += TMS5200
262268SOUNDS += TMS5220
r1591r1592
310316SOUNDS += SID6581
311317SOUNDS += SID8580
312318SOUNDS += SP0256
313#SOUNDS += M58817
314319
315320
316321
src/mess/drivers/nc.c
r1591r1592
306306   {
307307      logerror("int set %02x\n",nc_irq_status & nc_irq_mask);
308308      /* set int */
309      cpunum_set_input_line(0,0, HOLD_LINE);
309      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
310310   }
311311   else
312312   {
313313      /* clear int */
314      cpunum_set_input_line(0,0, CLEAR_LINE);
314      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
315315   }
316316}
317317
r1591r1592
532532            case NC_TYPE_1xx:
533533            {
534534                 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);
536536            }
537537            break;
538538
r1591r1592
873873      {
874874         /* I'll pulse it because if I used hold-line I'm not sure
875875            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);
877877      }
878878   }
879879
src/mess/drivers/adam.c
r1591r1592
433433    /* only if it goes up */
434434   if (state && !last_state)
435435       {
436           cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
436           cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
437437       }
438438   last_state = state;
439439}
r1591r1592
458458      adam_joy_stat[1] = 1;
459459
460460   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);
462462}
463463
464464void set_memory_banks(void)
src/mess/drivers/sord.c
r1591r1592
161161{
162162   if (state)
163163   {
164      cpunum_set_input_line(1,0, HOLD_LINE);
164      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
165165   }
166166   else
167167   {
168      cpunum_set_input_line(1,0,CLEAR_LINE);
168      cpunum_set_input_line(Machine, 1, 0,CLEAR_LINE);
169169
170170   }
171171}
r1591r1592
263263
264264   if (data==0x0f0)
265265   {
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);
268268   }
269269   LOG(("m5 write to pi5 port b: %02x %04x\n",data,activecpu_get_pc()));
270270}
r1591r1592
302302static void sord_m5_ctc_interrupt(int state)
303303{
304304   //logerror("interrupting ctc %02x\r\n ",state);
305   cpunum_set_input_line(0, 0, state);
305   cpunum_set_input_line(Machine, 0, 0, state);
306306}
307307
308308static z80ctc_interface   sord_m5_ctc_intf =
r1591r1592
617617static INTERRUPT_GEN( sord_interrupt )
618618{
619619   if (TMS9928A_interrupt())
620      cpunum_set_input_line(0, 0, HOLD_LINE);
620      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
621621}
622622
623623static MACHINE_DRIVER_START( sord_m5 )
src/mess/drivers/mk1.c
r1591r1592
185185
186186static void mk1_interrupt( UINT16 addr, int level ) {
187187    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 );
189189}
190190
191191static const F3853_CONFIG mk1_config = {
src/mess/drivers/z88.c
r1591r1592
4444         )
4545      {
4646         logerror("set int\n");
47         cpunum_set_input_line(0,0,HOLD_LINE);
47         cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
4848         return;
4949      }
5050   }
5151
5252   logerror("clear int\n");
53   cpunum_set_input_line(0,0,CLEAR_LINE);
53   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
5454}
5555
5656static void z88_update_rtc_interrupt(void)
r1591r1592
9999         /* column has gone low in snooze/coma */
100100         blink.sta |= STA_KEY;
101101
102         cpu_trigger(Z88_SNOOZE_TRIGGER);
102         cpu_trigger(Machine, Z88_SNOOZE_TRIGGER);
103103
104104         z88_interrupt_refresh();
105105      }
src/mess/drivers/pcw16.c
r1591r1592
132132   /* any bits set excluding vsync */
133133   if ((pcw16_system_status & (~0x04))!=0)
134134   {
135      cpunum_set_input_line(0,0, HOLD_LINE);
135      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
136136   }
137137   else
138138   {
139      cpunum_set_input_line(0,0, CLEAR_LINE);
139      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
140140   }
141141}
142142
r1591r1592
10131013            {
10141014               /* I'll pulse it because if I used hold-line I'm not sure
10151015                    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);
10171017            }
10181018         }
10191019      }
src/mess/drivers/glasgow.c
r1591r1592
534534
535535static TIMER_CALLBACK( update_nmi )
536536{
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);
539539
540540}
541541
542542static TIMER_CALLBACK( update_nmi32 )
543543{
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);
545545}
546546
547547static MACHINE_START( glasgow )
src/mess/drivers/tmc600.c
r1591r1592
328328
329329static MACHINE_RESET( tmc600 )
330330{
331   cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
331   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
332332}
333333
334334/* Machine Drivers */
src/mess/drivers/tm990189.c
r1591r1592
348348static void field_interrupts(void)
349349{
350350   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);
352352   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);
354354}
355355
356356/*
src/mess/drivers/aquarius.c
r1591r1592
207207
208208static INTERRUPT_GEN( aquarius_interrupt )
209209{
210   cpunum_set_input_line(0, 0, HOLD_LINE);
210   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
211211}
212212
213213/* Machine definition */
src/mess/drivers/abc80.c
r1591r1592
401401
402402static INTERRUPT_GEN( abc80_nmi_interrupt )
403403{
404   cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
404   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
405405}
406406
407407/* Machine Initialization */
src/mess/drivers/x68k.c
r1591r1592
232232//              if(sys.mfp.iera & (1 << x))
233233                {
234234                    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));
236236//                  logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(sys.mfp.vr & 0xf0) | (x+8),sys.mfp.irqline);
237237                    return;  // one at a time only
238238                }
r1591r1592
251251//              if(sys.mfp.ierb & (1 << x))
252252                {
253253                    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);
255255//                  logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(sys.mfp.vr & 0xf0) | x,sys.mfp.irqline);
256256                    return;  // one at a time only
257257                }
r1591r1592
626626            sys.mouse.irqactive = 1;
627627            current_vector[5] = 0x54;
628628            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);
630630         }
631631      }
632632   }
r1591r1592
770770      sys.ioc.irqstatus |= 0x80;
771771      current_irq_line = 1;
772772      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]);
774774   }
775775}
776776
r1591r1592
13111311       then access causes a bus error */
13121312   current_vector[2] = 0x02;  // bus error
13131313   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]);
13151315   return 0xff;
13161316}
13171317
r1591r1592
13211321       then access causes a bus error */
13221322   current_vector[2] = 0x02;  // bus error
13231323   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]);
13251325}
13261326
13271327static READ16_HANDLER( x68k_exp_r )
r1591r1592
13351335      if(ACCESSING_LSB)
13361336         offset++;
13371337      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]);
13391339   }
13401340   return 0xffff;
13411341}
r1591r1592
13511351      if(ACCESSING_LSB)
13521352         offset++;
13531353      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]);
13551355   }
13561356}
13571357
r1591r1592
13601360   current_vector[3] = hd63450_get_vector(channel);
13611361   current_irq_line = 3;
13621362   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]);
13641364}
13651365
13661366static void x68k_dma_end(int channel,int irq)
r1591r1592
13771377   {
13781378      current_vector[3] = hd63450_get_error_vector(channel);
13791379      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]);
13811381   }
13821382}
13831383
r1591r1592
14131413      return;
14141414   if((sys.ioc.irqstatus & 0xc0) != 0)  // if the FDC is busy, then we don't want to miss that IRQ
14151415      return;
1416   cpunum_set_input_line(0,6,state);
1416   cpunum_set_input_line(Machine, 0, 6, state);
14171417   prev = state;
14181418}
14191419
r1591r1592
14621462      return current_vector[6];
14631463   }
14641464
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]);
14661466   if(line == 1)  // IOSC
14671467   {
14681468      sys.ioc.irqstatus &= ~0xf0;
r1591r1592
18051805         current_vector[1] = 0x61;
18061806         sys.ioc.irqstatus |= 0x40;
18071807         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
18091809         logerror("IOC: Disk image inserted\n");
18101810      }
18111811      sys.fdc.disk_inserted[image_index_in_device(image)] = 1;
r1591r1592
18221822      current_vector[1] = 0x61;
18231823      sys.ioc.irqstatus |= 0x40;
18241824      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
18261826   }
18271827   sys.fdc.disk_inserted[image_index_in_device(image)] = 0;
18281828}
src/mess/drivers/spectrum.c
r1591r1592
19521952
19531953static INTERRUPT_GEN( spec_interrupt )
19541954{
1955   cpunum_set_input_line(0, 0, HOLD_LINE);
1955   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
19561956}
19571957
19581958
src/mess/drivers/super80.c
r1591r1592
4141
4242static void pio_interrupt(int state)
4343{
44   cpunum_set_input_line(0, 0, state);
44   cpunum_set_input_line(Machine, 0, 0, state);
4545}
4646
4747static void keyboard_scan(void)
src/mess/drivers/atarist.c
r1591r1592
762762static WRITE16_HANDLER( megaste_cache_w )
763763{
764764   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);
766766}
767767
768768/* ST Book */
r1591r1592
13991399
14001400static void mfp_interrupt(int which, int state)
14011401{
1402   cpunum_set_input_line(0, MC68000_IRQ_6, state);
1402   cpunum_set_input_line(Machine, 0, MC68000_IRQ_6, state);
14031403}
14041404
14051405static UINT8 mfp_rx, mfp_tx;
src/mess/drivers/sg1000.c
r1591r1592
317317
318318static void sg1000_vdp_interrupt(int state)
319319{
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);
321321}
322322
323323static const TMS9928a_interface tms9928a_interface =
src/mess/drivers/ip22.c
r1591r1592
156156   // if it's not masked, also assert it now at the CPU
157157   if (int3_regs[1] & source_mask)
158158   {
159      cpunum_set_input_line(0, MIPS3_IRQ0, ASSERT_LINE);
159      cpunum_set_input_line(Machine, 0, MIPS3_IRQ0, ASSERT_LINE);
160160   }
161161}
162162
r1591r1592
176176   // if it's not masked, also assert it now at the CPU
177177   if (int3_regs[2] & source_mask)
178178   {
179      cpunum_set_input_line(0, MIPS3_IRQ1, ASSERT_LINE);
179      cpunum_set_input_line(Machine, 0, MIPS3_IRQ1, ASSERT_LINE);
180180   }
181181}
182182
r1591r1592
342342      // if no local0 interrupts now, clear the input to the CPU
343343      if ((int3_regs[0] & int3_regs[1]) == 0)
344344      {
345         cpunum_set_input_line(0, MIPS3_IRQ0, CLEAR_LINE);
345         cpunum_set_input_line(Machine, 0, MIPS3_IRQ0, CLEAR_LINE);
346346      }
347347      else
348348      {
349         cpunum_set_input_line(0, MIPS3_IRQ0, ASSERT_LINE);
349         cpunum_set_input_line(Machine, 0, MIPS3_IRQ0, ASSERT_LINE);
350350      }
351351
352352      // if no local1 interrupts now, clear the input to the CPU
353353      if ((int3_regs[2] & int3_regs[3]) == 0)
354354      {
355         cpunum_set_input_line(0, MIPS3_IRQ1, CLEAR_LINE);
355         cpunum_set_input_line(Machine, 0, MIPS3_IRQ1, CLEAR_LINE);
356356      }
357357      else
358358      {
359         cpunum_set_input_line(0, MIPS3_IRQ1, ASSERT_LINE);
359         cpunum_set_input_line(Machine, 0, MIPS3_IRQ1, ASSERT_LINE);
360360      }
361361      break;
362362   case 0xb0/4:
src/mess/drivers/p2000t.c
r1591r1592
201201
202202static INTERRUPT_GEN( p2000_interrupt )
203203{
204   cpunum_set_input_line(0, 0, HOLD_LINE);
204   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
205205}
206206
207207/* Machine definition */
src/mess/drivers/studio2.c
r1591r1592
248248{
249249   machine_reset_cdp1864(machine);
250250
251   cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
251   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
252252}
253253
254254/* Machine Drivers */
src/mess/drivers/pcw.c
r1591r1592
147147      ((fdc_interrupt_code==1) && ((pcw_system_status & (1<<5))!=0))
148148      )
149149   {
150      cpunum_set_input_line(0,0,HOLD_LINE);
150      cpunum_set_input_line(Machine, 0, 0,HOLD_LINE);
151151   }
152152   else
153153   {
154      cpunum_set_input_line(0,0,CLEAR_LINE);
154      cpunum_set_input_line(Machine, 0, 0,CLEAR_LINE);
155155   }
156156}
157157
r1591r1592
191191            {
192192               /* I'll pulse it because if I used hold-line I'm not sure
193193                    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);
195195            }
196196         }
197197      }
r1591r1592
480480            /* yes */
481481
482482            /* 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);
484484         }
485485
486486         /* re-issue interrupt */
r1591r1592
502502            /* yes */
503503
504504            /* 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);
506506
507507         }
508508
src/mess/drivers/mk2.c
r1591r1592
209209
210210static void mk2_irq(int chip, int level)
211211{
212   cpunum_set_input_line(0, M6502_IRQ_LINE, level);
212   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, level);
213213}
214214
215215static const RRIOT_CONFIG riot={
src/mess/drivers/enterp.c
r1591r1592
155155static void enterprise_dave_interrupt(int state)
156156{
157157   if (state)
158      cpunum_set_input_line(0,0,HOLD_LINE);
158      cpunum_set_input_line(Machine, 0,0,HOLD_LINE);
159159   else
160      cpunum_set_input_line(0,0,CLEAR_LINE);
160      cpunum_set_input_line(Machine, 0,0,CLEAR_LINE);
161161}
162162
163163/* enterprise interface to dave - ok, so Dave chip is unique
r1591r1592
166166static const DAVE_INTERFACE enterprise_dave_interface =
167167{
168168   enterprise_dave_reg_read,
169      enterprise_dave_reg_write,
170      enterprise_dave_interrupt,
169   enterprise_dave_reg_write,
170   enterprise_dave_interrupt,
171171};
172172
173173
src/mess/drivers/coleco.c
r1591r1592
184184   static int last_state = 0;
185185
186186    // 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);
188188   last_state = state;
189189}
190190
r1591r1592
208208      JoyStat[1] = 1;
209209
210210    if (JoyStat[0] || JoyStat[1])
211      cpunum_set_input_line(0, 0, HOLD_LINE);
211      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
212212}
213213
214214static const TMS9928a_interface tms9928a_interface =
src/mess/drivers/ex800.c
r1591r1592
170170
171171   if (newvalue)
172172   {
173      cpunum_set_input_line(0, UPD7810_INTF1, state);
173      cpunum_set_input_line(Machine, 0, UPD7810_INTF1, state);
174174      state = (state == ASSERT_LINE) ? CLEAR_LINE : ASSERT_LINE;
175175   }
176176}
src/mess/drivers/apf.c
r1591r1592
128128
129129void apf_update_ints(void)
130130{
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);
132132}
133133
134134static void   apf_m1000_irq_a_func(int state)
src/mess/drivers/saturn.c
r1591r1592
248248
249249/*A-Bus IRQ checks,where they could be located these?*/
250250#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_); }
252252#if 0
253253if(stv_scu[42] & 1)//IRQ ACK
254254{
r1591r1592
537537         intback_stage = 2;
538538      }
539539      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);
541541   }
542542
543543   if ((offset == 1) && (data & 0x40))
r1591r1592
581581         if(!(stv_scu[40] & 0x0100)) /*Pad irq*/
582582         {
583583            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);
585585         }
586586   }
587587
r1591r1592
598598            if(LOG_SMPC) logerror ("SMPC: Slave ON\n");
599599            smpc_ram[0x5f]=0x02;
600600            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);
602602            break;
603603         case 0x03:
604604            if(LOG_SMPC) logerror ("SMPC: Slave OFF\n");
605605            smpc_ram[0x5f]=0x03;
606606            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);
609609            break;
610610         case 0x06:
611611            if(LOG_SMPC) logerror ("SMPC: Sound ON\n");
612612            /* wrong? */
613613            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);
615615            en_68k = 1;
616616            break;
617617         case 0x07:
618618            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);
620620            en_68k = 0;
621621            smpc_ram[0x5f]=0x07;
622622            break;
r1591r1592
626626         case 0x0d:
627627            if(LOG_SMPC) logerror ("SMPC: System Reset\n");
628628            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);
630630            system_reset();
631631            break;
632632         case 0x0e:
633633            if(LOG_SMPC) logerror ("SMPC: Change Clock to 352\n");
634634            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?
639639            break;
640640         case 0x0f:
641641            if(LOG_SMPC) logerror ("SMPC: Change Clock to 320\n");
642642            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?
647647            break;
648648         /*"Interrupt Back"*/
649649         case 0x10:
r1591r1592
695695            {
696696//                  if(LOG_SMPC) logerror ("Interrupt: System Manager (SMPC) at scanline %04x, Vector 0x47 Level 0x08\n",scanline);
697697               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);
699699            }
700700         break;
701701         /* RTC write*/
r1591r1592
724724            if(LOG_SMPC) logerror ("SMPC: NMI request\n");
725725            smpc_ram[0x5f]=0x18;
726726            /*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);
728728            break;
729729         case 0x19:
730730            if(LOG_SMPC) logerror ("SMPC: NMI Enable\n");
r1591r1592
819819      if(!(stv_scu[40] & 2))/*VBLANK-OUT*/
820820      {
821821         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);
823823      }
824824      stv_vblank = 0;
825825   }
r1591r1592
835835         if((!(stv_scu[40] & 0x10)) && (!(stv_scu[38] & 0x80)))
836836         {
837837            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 );
839839         }
840840         else if((!(stv_scu[40] & 0x10)) && (stv_scu[38] & 0x80))
841841         {
842842            if(timer_1 == (stv_scu[36] & 0x1ff))
843843            {
844844               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 );
846846            }
847847         }
848848      }
r1591r1592
851851         if(!(stv_scu[40] & 8))/*Timer 0*/
852852         {
853853            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 );
855855         }
856856      }
857857
r1591r1592
859859      if(!(stv_scu[40] & 4))/*HBLANK-IN*/
860860      {
861861         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);
863863      }
864864   }
865865   else if(scanline == 224)
r1591r1592
870870      if(!(stv_scu[40] & 1))/*VBLANK-IN*/
871871      {
872872         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);
874874      }
875875      stv_vblank = 1;
876876
r1591r1592
879879         if(!(stv_scu[40] & 8))/*Timer 0*/
880880         {
881881            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 );
883883         }
884884      }
885885      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);
887887   }
888888}
889889
r1591r1592
11061106         /*Sound IRQ*/
11071107         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
11081108         {
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);
11101110            logerror("SCSP: Main CPU interrupt\n");
11111111            #if 0
11121112            if((scu_dst_0 & 0x7ffffff) != 0x05a00000)
11131113            {
11141114               if(!(stv_scu[40] & 0x1000))
11151115               {
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);
11171117                  logerror("SCU: Illegal DMA interrupt\n");
11181118               }
11191119            }
r1591r1592
11671167         /*Sound IRQ*/
11681168         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
11691169         {
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);
11711171            logerror("SCSP: Main CPU interrupt\n");
11721172         }
11731173      }
r1591r1592
12171217         /*Sound IRQ*/
12181218         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
12191219         {
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);
12211221            logerror("SCSP: Main CPU interrupt\n");
12221222         }
12231223      }
r1591r1592
13961396
13971397   if(LOG_SCU) logerror("DMA transfer END\n");
13981398   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);
14001400
14011401   if(scu_add_tmp & 0x80000000)
14021402   {
r1591r1592
14991499
15001500   if(LOG_SCU) logerror("DMA transfer END\n");
15011501   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);
15031503
15041504   if(scu_add_tmp & 0x80000000)
15051505   {
r1591r1592
16021602
16031603   if(LOG_SCU) logerror("DMA transfer END\n");
16041604   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);
16061606
16071607   if(scu_add_tmp & 0x80000000)
16081608   {
r1591r1592
16801680   }while(job_done == 0);
16811681
16821682   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);
16841684
16851685   D0MV_0;
16861686}
r1591r1592
17521752   }while(job_done == 0);
17531753
17541754   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);
17561756
17571757   D1MV_0;
17581758}
r1591r1592
18231823   }while(job_done == 0);
18241824
18251825   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);
18271827
18281828   D2MV_0;
18291829}
r1591r1592
18631863{
18641864   logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data);
18651865   cpu_boost_interleave(double_to_attotime(minit_boost_timeslice), ATTOTIME_IN_USEC(minit_boost));
1866   cpu_trigger(1000);
1866   cpu_trigger(Machine, 1000);
18671867   cpunum_set_info_int(1, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE);
18681868}
18691869
r1591r1592
21482148static MACHINE_RESET( saturn )
21492149{
21502150   // 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);
21522152   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);
21542154
21552155   smpcSR = 0x40;   // this bit is always on according to docs
21562156
r1591r1592
21652165   memset(stv_workram_l, 0, 0x100000);
21662166   memset(stv_workram_h, 0, 0x100000);
21672167
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);
21712171
21722172   stvcd_reset();
21732173}
r1591r1592
22572257   if (irq > 0)
22582258   {
22592259      scsp_last_line = irq;
2260      cpunum_set_input_line(2, irq, ASSERT_LINE);
2260      cpunum_set_input_line(Machine, 2, irq, ASSERT_LINE);
22612261   }
22622262   else if (irq < 0)
22632263   {
2264      cpunum_set_input_line(2, -irq, CLEAR_LINE);
2264      cpunum_set_input_line(Machine, 2, -irq, CLEAR_LINE);
22652265   }
22662266   else
22672267   {
2268      cpunum_set_input_line(2, scsp_last_line, CLEAR_LINE);
2268      cpunum_set_input_line(Machine, 2, scsp_last_line, CLEAR_LINE);
22692269   }
22702270}
22712271
src/mess/drivers/ql.c
r1591r1592
106106static void zx8302_interrupt(UINT8 line)
107107{
108108   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);
110110}
111111
112112static void zx8302_txd(int level)
r1591r1592
366366
367367   if (!zx8302.irq)
368368   {
369      cpunum_set_input_line(0, MC68000_IRQ_2, CLEAR_LINE);
369      cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, CLEAR_LINE);
370370   }
371371}
372372
r1591r1592
483483      switch (ipl)
484484      {
485485      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);
489489         break;
490490      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);
494494         break;
495495      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);
499499         break;
500500      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);
504504         break;
505505      }
506506
r1591r1592
534534
535535   int irq = (ipc.ser2_rxd | ipc.ser1_txd);
536536
537   cpunum_set_input_line(1, INPUT_LINE_IRQ0, irq);
537   cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, irq);
538538
539539   return (zx8302.comdata << 7) | irq;
540540}
src/mess/drivers/tmc2000e.c
r1591r1592
157157{
158158   machine_reset_cdp1864(machine);
159159
160   cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
160   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
161161
162162   // reset program counter to 0xc000
163163}
src/mess/drivers/tmc1800.c
r1591r1592
258258
259259static MACHINE_RESET( tmc1800 )
260260{
261   cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
261   cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
262262}
263263
264264static MACHINE_START( tmc2000 )
r1591r1592
273273{
274274   machine_reset_cdp1864(machine);
275275
276   cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
276   cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
277277
278278   // set program counter to 0x8000
279279   memory_set_bank(1, 0);
src/mess/drivers/crvision.c
r1591r1592
201201
202202static void crvision_vdp_interrupt(int state)
203203{
204   cpunum_set_input_line(0, INPUT_LINE_IRQ0, state);
204   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, state);
205205}
206206
207207static const TMS9928a_interface tms9918_intf =
src/mess/drivers/nascom1.c
r1591r1592
191191
192192static INTERRUPT_GEN( nascom_interrupt )
193193{
194   cpunum_set_input_line(0, 0, HOLD_LINE);
194   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
195195}
196196
197197/* Machine definition */
src/mess/drivers/einstein.c
r1591r1592
352352   /* NPW 21-Jul-2005 - Not sure how to update this for MAME 0.98u2 */
353353/*
354354    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);
356356    else
357        cpunum_set_input_line(0, Z80_INT_IEO, PULSE_LINE);
357        cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE);
358358
359359    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);
361361    else
362        cpunum_set_input_line(0, Z80_INT_IEO, PULSE_LINE);
362        cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE);
363363
364364    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);
366366    else
367        cpunum_set_input_line(0, Z80_INT_IEO, PULSE_LINE);
367        cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE);
368368*/
369369}
370370
r1591r1592
401401static void einstein_ctc_interrupt(int state)
402402{
403403   logerror("ctc irq state: %02x\n",state);
404   cpunum_set_input_line(0, 1, state);
404   cpunum_set_input_line(Machine, 0, 1, state);
405405}
406406
407407static void einstein_pio_interrupt(int state)
408408{
409409   logerror("pio irq state: %02x\n",state);
410   cpunum_set_input_line(0, 3, state);
410   cpunum_set_input_line(Machine, 0, 3, state);
411411}
412412
413413static WRITE8_HANDLER(einstein_serial_transmit_clock)
src/mess/drivers/ti99_2.c
r1591r1592
110110static INTERRUPT_GEN( ti99_2_vblank_interrupt )
111111{
112112   /* 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);
114114}
115115
116116
src/mess/drivers/intv.c
r1591r1592
338338
339339static INTERRUPT_GEN( intv_interrupt2 )
340340{
341   cpunum_set_input_line(1, 0, PULSE_LINE);
341   cpunum_set_input_line(machine, 1, 0, PULSE_LINE);
342342}
343343
344344static MACHINE_DRIVER_START( intv )
src/mess/drivers/jupiter.c
r1591r1592
167167
168168static INTERRUPT_GEN( jupiter_interrupt )
169169{
170   cpunum_set_input_line(0, 0, HOLD_LINE);
170   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
171171}
172172
173173/* machine definition */
src/mess/drivers/exelv.c
r1591r1592
204204         break;
205205      case IOS_INIT:
206206         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);
208208         io_state = IOS_NOP;
209209         break;
210210      case IOS_RESET:
r1591r1592
220220         break;
221221      case IOS_CHARDEF1:
222222         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);
224224         io_state = IOS_CHARDEF2;
225225         break;
226226      case IOS_CHARDEF2:
227227         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);
229229         io_state = IOS_CHARDEF3;
230230         break;
231231      case IOS_CHARDEF3:
232232         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);
234234         io_state = IOS_CHARDEF4;
235235         io_counter = 0;
236236         break;
r1591r1592
369369               0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
370370            };
371371            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);
373373            io_counter++;
374374            if (io_counter == 127*10)
375375               io_state = IOS_NOP;
r1591r1592
387387      if (io_command_ack)
388388      {
389389         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);
391391         else
392392         {
393393            io_command_ack = 0;
src/mess/drivers/mephisto.c
r1591r1592
174174static TIMER_CALLBACK( update_nmi )
175175{
176176
177   cpunum_set_input_line(0, INPUT_LINE_NMI,PULSE_LINE);
177   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI,PULSE_LINE);
178178   // DAC_data_w(0,led_status&64?128:0);
179179   beep_set_state(0,led_status&64?1:0);
180180
r1591r1592
185185   lcd_shift_counter=3;
186186   // timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, update_leds);
187187   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);
189189   //beep_set_frequency(0, 4000);
190190}
191191
src/mess/drivers/amstrad.c
r1591r1592
771771         if(data & 0x40)
772772         {
773773            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);
775775            amstrad_plus_irq_cause = 0x06;
776776            amstrad_plus_asic_ram[0x2c0f] &= ~0x40;
777777         }
778778         if(data & 0x20)
779779         {
780780            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);
782782            amstrad_plus_irq_cause = 0x06;
783783            amstrad_plus_asic_ram[0x2c0f] &= ~0x20;
784784         }
785785         if(data & 0x10)
786786         {
787787            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);
789789            amstrad_plus_irq_cause = 0x06;
790790            amstrad_plus_asic_ram[0x2c0f] &= ~0x10;
791791         }
r1591r1592
10681068 then the interrupt request is cleared and the 6-bit counter is reset to "0".  */
10691069           if ((amstrad_GateArray_ModeAndRomConfiguration & (1<<4)) != 0) {
10701070            amstrad_CRTC_HS_Counter = 0;
1071               cpunum_set_input_line(0,0, CLEAR_LINE);
1071               cpunum_set_input_line(Machine, 0,0, CLEAR_LINE);
10721072
10731073           }
10741074/* b3b2 != 0 then change the state of upper or lower rom area and rethink memory */
r1591r1592
16361636      multiface_rethink_memory();
16371637
16381638      /* 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);
16401640
16411641      /* initialise 0065 override to monitor calls to 0065 */
16421642      memory_set_opbase_handler(0,amstrad_multiface_opbaseoverride);
r1591r1592
18071807      amstrad_plus_asic_ram[0x2c0f] &= ~0x80;  // not a raster interrupt, so this bit is reset
18081808      return (amstrad_plus_asic_ram[0x2805] & 0xf8) + amstrad_plus_irq_cause;
18091809   }
1810   cpunum_set_input_line(0,0, CLEAR_LINE);
1810   cpunum_set_input_line(Machine, 0,0, CLEAR_LINE);
18111811   amstrad_CRTC_HS_Counter &= 0x1F;
18121812   if(amstrad_plus_asic_enabled != 0)
18131813   {
src/mess/drivers/a310.c
r1591r1592
8989
9090   if (a310_iocregs[6] & mask)
9191   {
92      cpunum_set_input_line(0, ARM_IRQ_LINE, ASSERT_LINE);
92      cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, ASSERT_LINE);
9393   }
9494}
9595
r1591r1592
9999
100100   if (a310_iocregs[10] & mask)
101101   {
102      cpunum_set_input_line(0, ARM_IRQ_LINE, PULSE_LINE);
102      cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, PULSE_LINE);
103103   }
104104}
105105
r1591r1592
109109
110110   if (a310_iocregs[14] & mask)
111111   {
112      cpunum_set_input_line(0, ARM_FIRQ_LINE, PULSE_LINE);
112      cpunum_set_input_line(Machine, 0, ARM_FIRQ_LINE, PULSE_LINE);
113113   }
114114}
115115
r1591r1592
436436            // if that did it, clear the IRQ
437437            if (a310_iocregs[4] == 0)
438438            {
439               cpunum_set_input_line(0, ARM_IRQ_LINE, CLEAR_LINE);
439               cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, CLEAR_LINE);
440440            }
441441            break;
442442
src/mess/drivers/avigo.c
r1591r1592
154154static void avigo_refresh_ints(void)
155155{
156156   if (avigo_irq!=0)
157      cpunum_set_input_line(0,0, HOLD_LINE);
157      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
158158   else
159      cpunum_set_input_line(0,0, CLEAR_LINE);
159      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
160160}
161161
162162
r1591r1592
210210      if ((current_input_port_data[3] & 0x02)!=0)
211211      {
212212         /* ????? 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);
214214      }
215215   }
216216
src/mess/drivers/coupe.c
r1591r1592
5353      {
5454         /* No other interrupts can occur - NOT CORRECT!!! */
5555            STAT=0x1E;
56         cpunum_set_input_line(0, 0, HOLD_LINE);
56         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
5757         interrupted=1;
5858      }
5959   }
r1591r1592
8787      else
8888         STAT=0x17;
8989
90      cpunum_set_input_line(0, 0, HOLD_LINE);
90      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
9191      interrupted=1;
9292   }
9393
src/mess/drivers/tutor.c
r1591r1592
257257static TIMER_CALLBACK(tape_interrupt_handler)
258258{
259259   //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);
261261}
262262
263263/* CRU handler */
r1591r1592
293293            else
294294            {
295295               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);
297297            }
298298         }
299299         break;
src/mess/drivers/svision.c
r1591r1592
7878   int irq = svision.timer_shot && (BANK & 2);
7979   irq = irq || (svision_dma.finished && (BANK & 4));
8080
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);
8282}
8383
8484static TIMER_CALLBACK(svision_timer)
r1591r1592
418418static INTERRUPT_GEN( svision_frame_int )
419419{
420420   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);
422422
423423   if (svision_channel->count)
424424      svision_channel->count--;
src/mess/drivers/bbcbc.c
r1591r1592
2929
3030static void tms_interrupt(int dummy)
3131{
32   cpunum_set_input_line(0, 0, HOLD_LINE);
32   cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
3333}
3434
3535static INTERRUPT_GEN( bbcbc_interrupt )
src/mess/drivers/vtech2.c
r1591r1592
449449
450450static INTERRUPT_GEN( vtech2_interrupt )
451451{
452   cpunum_set_input_line(0, 0, HOLD_LINE);
452   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
453453}
454454
455455static MACHINE_DRIVER_START( laser350 )
docs/messnew.txt
r1591r1592
6464
6565Source Changes:
6666----------------
67- The core is based on MAME 0.122u6.  This incorporates all features of the
67- The core is based on MAME 0.122u7.  This incorporates all features of the
6868  update to this core.  [MAME team]
6969
7070- Miscellaneous cleanups (staticization, constification, conditional logging,

Previous 15994 Revisions Next


© 1998-2018 The MESS Team