| Previous | 199869 Revisions | Next |
| r17814 Wednesday 12th September, 2012 at 03:35:06 UTC by Aaron Giles |
|---|
| Closeout on old macros. Retired cputag_set_input_line and cputag_set_input_line_and_vector, replacing them with machine.device("tag")->execute().set_input_line[_and_vector]. [Aaron Giles] |
| [src/emu] | devcpu.h |
| [src/emu/cpu/psx] | irq.c |
| [src/emu/machine] | s3c24xx.c |
| [src/mame/audio] | aztarac.c beezer.c carnival.c cchasm.c cyberbal.c dkong.c exidy.c exidy440.c irem.c jedi.c leland.c m72.c mario.c qix.c redalert.c scramble.c segag80r.c segasnd.c spacefb.c starwars.c taito_en.c |
| [src/mame/drivers] | 1942.c 2mindril.c 39in1.c 40love.c 5clown.c acefruit.c acommand.c aeroboto.c airbustr.c alien.c arabian.c arcadecl.c argus.c aristmk4.c aristmk5.c armedf.c artmagic.c astrocde.c astrocorp.c asuka.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c atarisy4.c atetris.c badlands.c baraduke.c batman.c battlera.c battlex.c bbusters.c beathead.c berzerk.c bfcobra.c bfm_sc1.c bfm_sc2.c big10.c bingoc.c bionicc.c bishi.c bking.c bladestl.c blitz68k.c blstroid.c bmcbowl.c bnstars.c buggychl.c bwidow.c bwing.c byvid.c cabal.c calchase.c cave.c ccastles.c cchasm.c cclimber.c centiped.c cham24.c changela.c chihiro.c chqflag.c cidelsa.c circus.c cischeat.c cliffhgr.c cloak.c cloud9.c cobra.c compgolf.c coolpool.c coolridr.c corona.c cosmic.c cps1.c cps3.c cshooter.c cubeqst.c cyberbal.c cybertnk.c darkmist.c darkseal.c dbz.c deadang.c dec0.c deco32.c deco_mlc.c deniam.c djboy.c djmain.c dlair.c dmndrby.c dooyong.c ecoinfr.c enigma2.c eolith.c eprom.c equites.c esh.c espial.c esripsys.c exedexes.c exidy440.c expro02.c exterm.c exzisus.c famibox.c fastfred.c feversoc.c finalizr.c firebeat.c firefox.c flower.c foodf.c forte2.c funkball.c gaelco3d.c galaga.c galastrm.c galaxian.c galpani2.c galpanic.c gamecstl.c gaplus.c gauntlet.c gberet.c ginganin.c gladiatr.c gottlieb.c gpworld.c gradius3.c grchamp.c gridlee.c groundfx.c gstriker.c gsword.c gticlub.c guab.c gunbustr.c gundealr.c halleys.c hcastle.c hexion.c higemaru.c hnayayoi.c hng64.c hornet.c hyprduel.c igs011.c igspoker.c iqblock.c irobot.c istellar.c itech32.c itech8.c itgambl2.c itgambl3.c itgamble.c jackie.c jchan.c jedi.c jpmimpct.c jpmsys5.c jrpacman.c kaneko16.c kangaroo.c kas89.c kingdrby.c kinst.c klax.c konamigq.c konamigx.c konamim2.c kungfur.c lgp.c looping.c lordgun.c luckgrln.c m107.c m72.c m90.c madalien.c magmax.c mainsnk.c mappy.c mastboy.c maxaflex.c maygay1b.c maygayv1.c meadows.c mediagx.c megaplay.c megasys1.c megatech.c merit.c metalmx.c metlclsh.c mexico86.c midqslvr.c midvunit.c midzeus.c mirax.c missb2.c mlanding.c model1.c model2.c model3.c mpu3.c mpu4dealem.c mpu4hw.c mpu4vid.c ms32.c msisaac.c multigam.c mustache.c mw18w.c mystston.c mystwarr.c namcofl.c namcona1.c namconb1.c namcos1.c namcos21.c namcos23.c namcos86.c naomi.c naughtyb.c neogeo.c neoprint.c ninjakd2.c nmk16.c nwk-tr.c offtwall.c olibochu.c omegrace.c overdriv.c pacland.c pangofun.c panicr.c paradise.c paranoia.c pcat_dyn.c pcktgal.c pcxt.c pengadvb.c peplus.c pgm.c photoply.c pinkiri8.c pkscram.c plygonet.c pokechmp.c polepos.c policetr.c polyplay.c poo.c poolshrk.c powerins.c prehisle.c progolf.c psychic5.c punchout.c qdrmfgp.c quakeat.c queen.c quizpun2.c r2dtank.c rabbit.c rampart.c rbmk.c re900.c redalert.c relief.c renegade.c retofinv.c rollerg.c roul.c royalmah.c rpunch.c runaway.c sandscrp.c sangho.c saturn.c savquest.c sbrkout.c sbugger.c scotrsht.c seattle.c segac2.c segag80r.c segag80v.c segas24.c segas32.c seibuspi.c seicross.c seta.c sfkick.c sg1000a.c shadfrce.c shangha3.c shangkid.c shootout.c shougi.c shuuz.c sidearms.c sidepckt.c skeetsht.c skullxbo.c skykid.c sliver.c slotcarn.c snk.c snk6502.c snk68.c snowbros.c solomon.c sothello.c spacefb.c spbactn.c spcforce.c spdodgeb.c speedspn.c speglsht.c spiders.c splash.c spoker.c sprint4.c sprint8.c srmp2.c srmp5.c srmp6.c sshangha.c sslam.c ssozumo.c sspeedr.c ssv.c stadhero.c starwars.c su2000.c sub.c subsino2.c suna8.c superchs.c superdq.c superqix.c supertnk.c suprgolf.c suprloco.c suprnova.c suprridr.c system1.c tagteam.c taito_f3.c taito_x.c taitogn.c taitosj.c taitotz.c taitowlf.c tank8.c tankbatt.c tankbust.c taotaido.c tapatune.c tatsumi.c tbowl.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c tempest.c tetrisp2.c thayers.c thedeep.c thunderj.c tickee.c tigeroad.c timelimt.c tmaster.c tmmjprd.c tmnt.c toaplan1.c toki.c tomcat.c tonton.c toobin.c topspeed.c tourvis.c toypop.c tp84.c triplhnt.c trucocl.c trvmadns.c tryout.c tsamurai.c tubep.c tugboat.c tumblep.c twin16.c twincobr.c twinkle.c tx1.c uapce.c ultratnk.c ultrsprt.c umipoker.c undrfire.c vastar.c vball.c vegas.c vicdual.c videopin.c videopkr.c vindictr.c viper.c voyager.c vpoker.c wardner.c warpwarp.c wc90.c wc90b.c wecleman.c welltris.c wheelfir.c wink.c wiping.c wolfpack.c wwfsstar.c wwfwfest.c xain.c xmen.c xorworld.c xtom3d.c xxmissio.c xybots.c xyonix.c zaccaria.c zaxxon.c zn.c zodiack.c zr107.c |
| [src/mame/machine] | amiga.c archimds.c atari.c balsente.c beezer.c bsktball.c bublbobl.c carpolo.c cdi070.c cdicdic.c cdislave.c dc.c dec0.c decoprot.c galaxold.c irobot.c konppc.c leland.c mcr.c mcr68.c megacd.c megadriv.c megavdp.c mhavoc.c micro3d.c midxunit.c midyunit.c n64.c namcond1.c namcos1.c namcos2.c nb1413m3.c pcshare.c pitnrun.c playch10.c qix.c retofinv.c segamsys.c seicop.c slapfght.c slikshot.c snes.c stfight.c tait8741.c taitosj.c tatsumi.c toaplan1.c twincobr.c vectrex.c vertigo.c vsnes.c williams.c xevious.c |
| [src/mame/video] | astrocde.c atari.c atarisy1.c beathead.c bfm_dm01.c cchasm.c cischeat.c esripsys.c exidy.c exidy440.c gticlub.c lethalj.c m72.c mcd212.c megasys1.c micro3d.c midtunit.c midvunit.c midyunit.c midzeus.c midzeus2.c playch10.c policetr.c rpunch.c segag80r.c sidearms.c toaplan1.c tubep.c tx1.c vdc.c vectrex.c victory.c vsnes.c |
| [src/mess/drivers] | ace.c adam.c apollo.c aquarius.c babbage.c basic52.c bbcbc.c bigbord2.c bml3.c camplynx.c casloopy.c cat.c chesstrv.c csc.c dc.c dectalk.c esq1.c ex800.c fidelz80.c fk1.c fm7.c fmtowns.c fp1100.c gamecom.c glasgow.c gmaster.c h19.c ht68k.c intv.c ip22.c junior.c mac.c mekd2.c mephisto.c mk1.c mk2.c mmodular.c mod8.c multi16.c mz2000.c mz2500.c nanos.c nc.c nes.c ng_aes.c p2000t.c p8k.c paso1600.c pasogo.c pasopia7.c pb1000.c pc100.c pc6001.c pc8801.c pc88va.c pc9801.c pce.c pcw.c pcw16.c pdp1.c pecom.c pegasus.c pes.c prestige.c psion.c pv2000.c px4.c qx10.c samcoupe.c scorpion.c scv.c sg1000.c sgi_ip2.c sm1800.c sms.c socrates.c supercon.c supracan.c svi318.c svision.c tec1.c tsispch.c tutor.c vg5k.c vii.c vt100.c vt240.c vtech2.c x1.c x68k.c z100.c zrt80.c |
| [src/mess/formats] | spec_snqk.c |
| [src/mess/machine] | amigacrt.c amstrad.c apollo.c apple1.c apple2gs.c apple3.c ay3600.c b2m.c bbc.c bebox.c bk.c c64.c c65.c cbmb.c cgenie.c compis.c concept.c dai.c dgn_beta.c egret.c electron.c gamecom.c gb.c hec2hrp.c hecdisk2.c hp48.c intv.c irisha.c kaypro.c lisa.c lynx.c mac.c macpci.c microtan.c msx.c mz700.c mz80.c ondra.c oric.c osborne1.c partner.c pce.c pecom.c pet.c pk8020.c pokemini.c poly88.c radio86.c rmnimbus.c sms.c super80.c svi318.c sym1.c thomson.c ti990.c trs80.c wswan.c x1.c z80ne.c |
| [src/mess/machine/ti99] | bwg.c ti_fdc.c |
| [src/mess/video] | fm7.c gb.c odyssey2.c pecom.c vc4000.c x68k.c zx.c |
| r17813 | r17814 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | samples_device *samples = machine().device<samples_device>("samples"); |
| 35 | 35 | |
| 36 | | |
| 36 | | |
| 37 | 37 | |
| 38 | 38 | /* enemy killed */ |
| 39 | 39 | if (!(data & 0x01) && (m_sound_latch & 0x01)) samples->start(0,0); |
| r17813 | r17814 | |
|---|---|---|
| 59 | 59 | membank("soundbank")->set_base(&m_bank_base[0x1000 * ((data >> 6) & 3)]); |
| 60 | 60 | coin_counter_w(machine(), 1, (data >> 5) & 1); |
| 61 | 61 | coin_counter_w(machine(), 0, (data >> 4) & 1); |
| 62 | c | |
| 62 | machine().device("dac")->execute().set_input_line( | |
| 63 | 63 | if (!(data & 0x01)) devtag_reset(machine(), "ymsnd"); |
| 64 | 64 | } |
| 65 | 65 | |
| r17813 | r17814 | |
| 95 | 95 | static void update_sound_68k_interrupts(running_machine &machine) |
| 96 | 96 | { |
| 97 | 97 | cyberbal_state *state = machine.driver_data<cyberbal_state>(); |
| 98 | cputag_set_input_line(machine, "dac", 6, state->m_fast_68k_int ? ASSERT_LINE : CLEAR_LINE); | |
| 99 | cputag_set_input_line(machine, "dac", 2, state->m_io_68k_int ? ASSERT_LINE : CLEAR_LINE); | |
| 98 | machine.device("dac")->execute().set_input_line(6, state->m_fast_68k_int ? ASSERT_LINE : CLEAR_LINE); | |
| 99 | machine.device("dac")->execute().set_input_line(2, state->m_io_68k_int ? ASSERT_LINE : CLEAR_LINE); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 |
| r17813 | r17814 | |
|---|---|---|
| 308 | 308 | state->latch = data; |
| 309 | 309 | |
| 310 | 310 | /* the high bit goes directly to the INT line */ |
| 311 | cput | |
| 311 | machine.device("audiocpu")->execute().set_input_line( | |
| 312 | 312 | |
| 313 | 313 | /* a clock on the high bit clocks a 1 into T0 */ |
| 314 | 314 | if (!(old & 0x80) && (data & 0x80)) |
| r17813 | r17814 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | if ( bitsGoneHigh & OUT_PORT_2_MUSIC_RESET ) |
| 238 | 238 | /* reset output is no longer asserted active low */ |
| 239 | | |
| 239 | | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 |
| r17813 | r17814 | |
|---|---|---|
| 888 | 888 | /* generate the appropriate interrupt */ |
| 889 | 889 | state->m_i80186.intr.poll_status = 0x8000 | new_vector; |
| 890 | 890 | if (!state->m_i80186.intr.pending) |
| 891 | cput | |
| 891 | machine.device("audiocpu")->execute().set_input_line( | |
| 892 | 892 | state->m_i80186.intr.pending = 1; |
| 893 | 893 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", machine.time().as_double(), new_vector); |
| 894 | 894 | } |
| r17813 | r17814 | |
| 1840 | 1840 | } |
| 1841 | 1841 | |
| 1842 | 1842 | /* /RESET */ |
| 1843 | | |
| 1843 | | |
| 1844 | 1844 | |
| 1845 | 1845 | /* /NMI */ |
| 1846 | 1846 | /* If the master CPU doesn't get a response by the time it's ready to send |
| 1847 | 1847 | the next command, it uses an NMI to force the issue; unfortunately, this |
| 1848 | 1848 | seems to really screw up the sound system. It turns out it's better to |
| 1849 | 1849 | just wait for the original interrupt to occur naturally */ |
| 1850 | /* | |
| 1850 | /* | |
| 1851 | 1851 | |
| 1852 | 1852 | /* INT0 */ |
| 1853 | 1853 | if (data & 0x20) |
| r17813 | r17814 | |
|---|---|---|
| 234 | 234 | |
| 235 | 235 | /* reset CPU to catch any banking of startup vectors */ |
| 236 | 236 | machine.device("audiocpu")->reset(); |
| 237 | //cput | |
| 237 | //machine.device("audiocpu")->execute().set_input_line( | |
| 238 | 238 | |
| 239 | 239 | snd_shared_ram = (UINT32 *)machine.root_device().memshare("snd_shared")->ptr(); |
| 240 | 240 | } |
| r17813 | r17814 | |
|---|---|---|
| 973 | 973 | D3 = /INT line |
| 974 | 974 | */ |
| 975 | 975 | state->m_n7751_command = data & 0x07; |
| 976 | | |
| 976 | | |
| 977 | 977 | device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); |
| 978 | 978 | } |
| 979 | 979 |
| r17813 | r17814 | |
|---|---|---|
| 115 | 115 | /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ |
| 116 | 116 | /* we need to complement Q bar */ |
| 117 | 117 | if (device->machine().device("audiocpu")) |
| 118 | | |
| 118 | | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | WRITE8_MEMBER(scramble_state::hotshock_sh_irqtrigger_w) |
| 122 | 122 | { |
| 123 | | |
| 123 | | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | READ8_DEVICE_HANDLER( hotshock_soundlatch_r ) |
| 127 | 127 | { |
| 128 | 128 | driver_device *drvstate = device->machine().driver_data<driver_device>(); |
| 129 | | |
| 129 | | |
| 130 | 130 | return drvstate->soundlatch_byte_r(*device->machine().device("audiocpu")->memory().space(AS_PROGRAM),0); |
| 131 | 131 | } |
| 132 | 132 |
| r17813 | r17814 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | WRITE8_MEMBER(jedi_state::irq_ack_w) |
| 62 | 62 | { |
| 63 | | |
| 63 | | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r17813 | r17814 | |
| 73 | 73 | |
| 74 | 74 | WRITE8_MEMBER(jedi_state::jedi_audio_reset_w) |
| 75 | 75 | { |
| 76 | | |
| 76 | | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 |
| r17813 | r17814 | |
|---|---|---|
| 132 | 132 | static WRITE_LINE_DEVICE_HANDLER( update_irq_state ) |
| 133 | 133 | { |
| 134 | 134 | exidy_sound_state *sndstate = get_safe_token(device); |
| 135 | | |
| 135 | | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| r17813 | r17814 | |
| 529 | 529 | { |
| 530 | 530 | exidy_sound_state *state = get_safe_token(device); |
| 531 | 531 | if (state->m_cvsd != NULL) |
| 532 | | |
| 532 | | |
| 533 | 533 | |
| 534 | 534 | if (state->m_tms != NULL) |
| 535 | 535 | { |
| r17813 | r17814 | |
|---|---|---|
| 47 | 47 | { |
| 48 | 48 | m_sound_flags |= 0x40; |
| 49 | 49 | soundlatch4_byte_w(space, offset, data); |
| 50 | cput | |
| 50 | machine().device("maincpu")->execute().set_input_line( | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | WRITE16_MEMBER(cchasm_state::cchasm_io_w) |
| r17813 | r17814 | |
| 66 | 66 | m_sound_flags |= 0x80; |
| 67 | 67 | soundlatch2_byte_w(space, offset, data); |
| 68 | 68 | m_ctc->trg2(1); |
| 69 | | |
| 69 | | |
| 70 | 70 | break; |
| 71 | 71 | case 2: |
| 72 | 72 | //led = data; |
| r17813 | r17814 | |
|---|---|---|
| 133 | 133 | int combined_state = pia->irq_a_state() | pia->irq_b_state(); |
| 134 | 134 | |
| 135 | 135 | /* DINT is connected to the data CPU's IRQ line */ |
| 136 | | |
| 136 | | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| r17813 | r17814 | |
| 143 | 143 | int combined_state = pia->irq_a_state() | pia->irq_b_state(); |
| 144 | 144 | |
| 145 | 145 | /* SINT is connected to the sound CPU's IRQ line */ |
| 146 | | |
| 146 | | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 |
| r17813 | r17814 | |
|---|---|---|
| 377 | 377 | { |
| 378 | 378 | exidy440_audio_state *state = get_safe_token(device); |
| 379 | 379 | /* clear the FIRQ that got us here and acknowledge the read to the main CPU */ |
| 380 | | |
| 380 | | |
| 381 | 381 | state->sound_command_ack = 1; |
| 382 | 382 | |
| 383 | 383 | return state->sound_command; |
| r17813 | r17814 | |
| 389 | 389 | exidy440_audio_state *state = get_safe_token(device); |
| 390 | 390 | state->sound_command = param; |
| 391 | 391 | state->sound_command_ack = 0; |
| 392 | | |
| 392 | | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | |
| r17813 | r17814 | |
| 436 | 436 | |
| 437 | 437 | static WRITE8_DEVICE_HANDLER( sound_interrupt_clear_w ) |
| 438 | 438 | { |
| 439 | | |
| 439 | | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 |
| r17813 | r17814 | |
|---|---|---|
| 22 | 22 | soundlatch_byte_w(space, offset, data); |
| 23 | 23 | m_sound_status ^= 0x21; |
| 24 | 24 | if (m_sound_status & 0x20) |
| 25 | | |
| 25 | | |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 |
| r17813 | r17814 | |
|---|---|---|
| 68 | 68 | if ((data & 0x80) == 0) |
| 69 | 69 | drvstate->soundlatch_byte_w(*space, 0, data & 0x7f); |
| 70 | 70 | else |
| 71 | | |
| 71 | | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| r17813 | r17814 | |
| 182 | 182 | |
| 183 | 183 | static WRITE8_HANDLER( sound_irq_ack_w ) |
| 184 | 184 | { |
| 185 | | |
| 185 | | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | |
| r17813 | r17814 | |
| 223 | 223 | { |
| 224 | 224 | device_t *adpcm2 = device->machine().device("msm2"); |
| 225 | 225 | |
| 226 | | |
| 226 | | |
| 227 | 227 | |
| 228 | 228 | /* the first MSM5205 clocks the second */ |
| 229 | 229 | if (adpcm2 != NULL) |
| r17813 | r17814 | |
|---|---|---|
| 1273 | 1273 | WRITE8_MEMBER(dkong_state::dkong_audio_irq_w) |
| 1274 | 1274 | { |
| 1275 | 1275 | if (data) |
| 1276 | | |
| 1276 | | |
| 1277 | 1277 | else |
| 1278 | | |
| 1278 | | |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| 1281 | 1281 |
| r17813 | r17814 | |
|---|---|---|
| 117 | 117 | if (state->irqvector == 0) |
| 118 | 118 | logerror("You didn't call m72_init_sound()\n"); |
| 119 | 119 | |
| 120 | cput | |
| 120 | machine.device("soundcpu")->execute().set_input_line_and_vector( | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static DEVICE_START( m72_audio ) |
| r17813 | r17814 | |
|---|---|---|
| 138 | 138 | /*static WRITE_LINE_DEVICE_HANDLER( update_irq_state ) |
| 139 | 139 | { |
| 140 | 140 | beezer_sound_state *sndstate = get_safe_token(device); |
| 141 | | |
| 141 | | |
| 142 | 142 | }*/ |
| 143 | 143 | |
| 144 | 144 |
| r17813 | r17814 | |
|---|---|---|
| 70 | 70 | /* D7 is also connected to the NMI input of the CPU - |
| 71 | 71 | the NMI is actually toggled by a 74121 */ |
| 72 | 72 | if ((data & 0x80) == 0x00) |
| 73 | | |
| 73 | | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| r17813 | r17814 | |
| 155 | 155 | WRITE8_MEMBER(redalert_state::redalert_voice_command_w) |
| 156 | 156 | { |
| 157 | 157 | soundlatch2_byte_w(space, 0, (data & 0x78) >> 3); |
| 158 | c | |
| 158 | machine().device("voice")->execute().set_input_line( | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| r17813 | r17814 | |
| 282 | 282 | { |
| 283 | 283 | /* the byte is connected to port A of the AY8910 */ |
| 284 | 284 | soundlatch_byte_w(space, 0, data); |
| 285 | | |
| 285 | | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 |
| r17813 | r17814 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | static WRITE_LINE_DEVICE_HANDLER( snd_interrupt ) |
| 61 | 61 | { |
| 62 | | |
| 62 | | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| r17813 | r17814 | |
| 144 | 144 | riot6532_porta_in_set(m_riot, 0x00, 0xc0); |
| 145 | 145 | |
| 146 | 146 | /* reset sound CPU here */ |
| 147 | | |
| 147 | | |
| 148 | 148 | } |
| r17813 | r17814 | |
|---|---|---|
| 400 | 400 | { |
| 401 | 401 | mario_state *state = space.machine().driver_data<mario_state>(); |
| 402 | 402 | //printf("ea: %d\n", ea); |
| 403 | //cput | |
| 403 | //machine.device("audiocpu")->execute().set_input_line( | |
| 404 | 404 | if (state->m_eabank != NULL) |
| 405 | 405 | state->membank(state->m_eabank)->set_entry(ea); |
| 406 | 406 | } |
| r17813 | r17814 | |
| 520 | 520 | if (m_last == 1 && data == 0) |
| 521 | 521 | { |
| 522 | 522 | /* setting bit 0 high then low triggers IRQ on the sound CPU */ |
| 523 | cput | |
| 523 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | m_last = data; |
| r17813 | r17814 | |
| 553 | 553 | { |
| 554 | 554 | case 0: /* death */ |
| 555 | 555 | if (data) |
| 556 | | |
| 556 | | |
| 557 | 557 | else |
| 558 | | |
| 558 | | |
| 559 | 559 | break; |
| 560 | 560 | case 1: /* get coin */ |
| 561 | 561 | I8035_T_W_AH(space, 0,data & 1); |
| r17813 | r17814 | |
|---|---|---|
| 44 | 44 | { |
| 45 | 45 | if( battles_customio_command_count == 0 ) |
| 46 | 46 | { |
| 47 | | |
| 47 | | |
| 48 | 48 | } |
| 49 | 49 | else |
| 50 | 50 | { |
| 51 | cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 52 | cputag_set_input_line(timer.machine(), "sub3", INPUT_LINE_NMI, PULSE_LINE); | |
| 51 | timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
| 52 | timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | else |
| 56 | 56 | { |
| 57 | cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | cputag_set_input_line(timer.machine(), "sub3", INPUT_LINE_NMI, PULSE_LINE); | |
| 57 | timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
| 59 | 59 | } |
| 60 | 60 | battles_customio_command_count++; |
| 61 | 61 | } |
| r17813 | r17814 | |
|---|---|---|
| 369 | 369 | ***************************************************************************/ |
| 370 | 370 | static TIMER_CALLBACK( bublbobl_m68705_irq_ack ) |
| 371 | 371 | { |
| 372 | c | |
| 372 | machine.device("mcu")->execute().set_input_line( | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | INTERRUPT_GEN( bublbobl_m68705_interrupt ) |
| r17813 | r17814 | |
|---|---|---|
| 605 | 605 | |
| 606 | 606 | case SOUND_YAWDIM: |
| 607 | 607 | soundlatch_byte_w(space, 0, data); |
| 608 | | |
| 608 | | |
| 609 | 609 | break; |
| 610 | 610 | } |
| 611 | 611 | } |
| r17813 | r17814 | |
|---|---|---|
| 25 | 25 | state->m_alpha_irq_clock++; |
| 26 | 26 | if ((state->m_alpha_irq_clock & 0x0c) == 0x0c) |
| 27 | 27 | { |
| 28 | | |
| 28 | | |
| 29 | 29 | state->m_alpha_irq_clock_enable = 0; |
| 30 | 30 | } |
| 31 | 31 | } |
| r17813 | r17814 | |
| 34 | 34 | if (state->m_has_gamma_cpu) |
| 35 | 35 | { |
| 36 | 36 | state->m_gamma_irq_clock++; |
| 37 | | |
| 37 | | |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| r17813 | r17814 | |
| 42 | 42 | WRITE8_MEMBER(mhavoc_state::mhavoc_alpha_irq_ack_w) |
| 43 | 43 | { |
| 44 | 44 | /* clear the line and reset the clock */ |
| 45 | cput | |
| 45 | machine().device("alpha")->execute().set_input_line( | |
| 46 | 46 | m_alpha_irq_clock = 0; |
| 47 | 47 | m_alpha_irq_clock_enable = 1; |
| 48 | 48 | } |
| r17813 | r17814 | |
| 51 | 51 | WRITE8_MEMBER(mhavoc_state::mhavoc_gamma_irq_ack_w) |
| 52 | 52 | { |
| 53 | 53 | /* clear the line and reset the clock */ |
| 54 | c | |
| 54 | machine().device("gamma")->execute().set_input_line( | |
| 55 | 55 | m_gamma_irq_clock = 0; |
| 56 | 56 | } |
| 57 | 57 | |
| r17813 | r17814 | |
| 131 | 131 | state->m_alpha_data = param; |
| 132 | 132 | |
| 133 | 133 | /* signal with an NMI pulse */ |
| 134 | c | |
| 134 | machine.device("gamma")->execute().set_input_line( | |
| 135 | 135 | |
| 136 | 136 | /* the sound CPU needs to reply in 250microseconds (according to Neil Bradley) */ |
| 137 | 137 | machine.scheduler().timer_set(attotime::from_usec(250), FUNC_NULL); |
| r17813 | r17814 | |
| 256 | 256 | m_player_1 = (data >> 5) & 1; |
| 257 | 257 | |
| 258 | 258 | /* Bit 3 = Gamma reset */ |
| 259 | c | |
| 259 | machine().device("gamma")->execute().set_input_line( | |
| 260 | 260 | if (!(data & 0x08)) |
| 261 | 261 | { |
| 262 | 262 | logerror("\t\t\t\t*** resetting gamma processor. ***\n"); |
| r17813 | r17814 | |
|---|---|---|
| 150 | 150 | if (data == 0) { |
| 151 | 151 | if (m_dsp_execute) { |
| 152 | 152 | LOG(("Turning the main CPU on\n")); |
| 153 | cput | |
| 153 | machine().device("maincpu")->execute().set_input_line( | |
| 154 | 154 | m_dsp_execute = 0; |
| 155 | 155 | } |
| 156 | 156 | m_dsp_BIO = ASSERT_LINE; |
| r17813 | r17814 | |
| 188 | 188 | state->m_dsp_on = enable; |
| 189 | 189 | if (enable) { |
| 190 | 190 | LOG(("Turning DSP on and main CPU off\n")); |
| 191 | cputag_set_input_line(machine, "dsp", INPUT_LINE_HALT, CLEAR_LINE); | |
| 192 | cputag_set_input_line(machine, "dsp", 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 193 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 191 | machine.device("dsp")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 192 | machine.device("dsp")->execute().set_input_line(0, ASSERT_LINE); /* TMS32010 INT */ | |
| 193 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 194 | 194 | } |
| 195 | 195 | else { |
| 196 | 196 | LOG(("Turning DSP off\n")); |
| 197 | cputag_set_input_line(machine, "dsp", 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 198 | cputag_set_input_line(machine, "dsp", INPUT_LINE_HALT, ASSERT_LINE); | |
| 197 | machine.device("dsp")->execute().set_input_line(0, CLEAR_LINE); /* TMS32010 INT */ | |
| 198 | machine.device("dsp")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| r17813 | r17814 | |
| 277 | 277 | /****** The following apply to Flying Shark/Wardner only ******/ |
| 278 | 278 | case 0x00: /* This means assert the INT line to the DSP */ |
| 279 | 279 | LOG(("Turning DSP on and main CPU off\n")); |
| 280 | cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_HALT, CLEAR_LINE); | |
| 281 | cputag_set_input_line(space->machine(), "dsp", 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 282 | cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 280 | space->machine().device("dsp")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 281 | space->machine().device("dsp")->execute().set_input_line(0, ASSERT_LINE); /* TMS32010 INT */ | |
| 282 | space->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 283 | 283 | break; |
| 284 | 284 | case 0x01: /* This means inhibit the INT line to the DSP */ |
| 285 | 285 | LOG(("Turning DSP off\n")); |
| 286 | cputag_set_input_line(space->machine(), "dsp", 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 287 | cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_HALT, ASSERT_LINE); | |
| 286 | space->machine().device("dsp")->execute().set_input_line(0, CLEAR_LINE); /* TMS32010 INT */ | |
| 287 | space->machine().device("dsp")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 288 | 288 | break; |
| 289 | 289 | } |
| 290 | 290 | } |
| r17813 | r17814 | |
|---|---|---|
| 554 | 554 | // Set the CDIC interrupt line |
| 555 | 555 | verboselog(machine(), 0, "Setting CDIC interrupt line for soundmap decode\n" ); |
| 556 | 556 | device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128); |
| 557 | cput | |
| 557 | machine().device("maincpu")->execute().set_input_line( | |
| 558 | 558 | } |
| 559 | 559 | else |
| 560 | 560 | { |
| r17813 | r17814 | |
| 708 | 708 | //printf( "Setting CDIC interrupt line\n" ); |
| 709 | 709 | verboselog(machine(), 0, "Setting CDIC interrupt line for audio sector\n" ); |
| 710 | 710 | device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128); |
| 711 | cput | |
| 711 | machine().device("maincpu")->execute().set_input_line( | |
| 712 | 712 | } |
| 713 | 713 | else if((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == 0x00) |
| 714 | 714 | { |
| r17813 | r17814 | |
| 727 | 727 | //printf( "Setting CDIC interrupt line\n" ); |
| 728 | 728 | verboselog(machine(), 0, "Setting CDIC interrupt line for message sector\n" ); |
| 729 | 729 | device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128); |
| 730 | cput | |
| 730 | machine().device("maincpu")->execute().set_input_line( | |
| 731 | 731 | } |
| 732 | 732 | else |
| 733 | 733 | { |
| r17813 | r17814 | |
| 747 | 747 | //printf( "Setting CDIC interrupt line\n" ); |
| 748 | 748 | verboselog(machine(), 0, "Setting CDIC interrupt line for data sector\n" ); |
| 749 | 749 | device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128); |
| 750 | cput | |
| 750 | machine().device("maincpu")->execute().set_input_line( | |
| 751 | 751 | } |
| 752 | 752 | |
| 753 | 753 | if((buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF) == 0 && m_command != 0x23) |
| r17813 | r17814 | |
| 842 | 842 | |
| 843 | 843 | verboselog(machine(), 0, "Setting CDIC interrupt line for CDDA sector\n" ); |
| 844 | 844 | device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128); |
| 845 | cput | |
| 845 | machine().device("maincpu")->execute().set_input_line( | |
| 846 | 846 | break; |
| 847 | 847 | } |
| 848 | 848 | case 0x2c: // Seek |
| r17813 | r17814 | |
| 893 | 893 | |
| 894 | 894 | verboselog(machine(), 0, "Setting CDIC interrupt line for Seek sector\n" ); |
| 895 | 895 | device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128); |
| 896 | cput | |
| 896 | machine().device("maincpu")->execute().set_input_line( | |
| 897 | 897 | break; |
| 898 | 898 | } |
| 899 | 899 | } |
| r17813 | r17814 | |
| 944 | 944 | m_audio_buffer &= 0x7fff; |
| 945 | 945 | if(!((m_audio_buffer | m_x_buffer) & 0x8000)) |
| 946 | 946 | { |
| 947 | cput | |
| 947 | machine().device("maincpu")->execute().set_input_line( | |
| 948 | 948 | verboselog(machine(), 0, "Clearing CDIC interrupt line\n" ); |
| 949 | 949 | ////printf("Clearing CDIC interrupt line\n" ); |
| 950 | 950 | } |
| r17813 | r17814 | |
| 958 | 958 | m_x_buffer &= 0x7fff; |
| 959 | 959 | if(!((m_audio_buffer | m_x_buffer) & 0x8000)) |
| 960 | 960 | { |
| 961 | cput | |
| 961 | machine().device("maincpu")->execute().set_input_line( | |
| 962 | 962 | verboselog(machine(), 0, "Clearing CDIC interrupt line\n" ); |
| 963 | 963 | ////printf("Clearing CDIC interrupt line\n" ); |
| 964 | 964 | } |
| r17813 | r17814 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | void carpolo_74148_3s_cb(device_t *device) |
| 62 | 62 | { |
| 63 | | |
| 63 | | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 |
| r17813 | r17814 | |
|---|---|---|
| 578 | 578 | m_reset = data & 1; |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 582 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 583 | cputag_set_input_line(machine(), "mcu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 581 | machine().device("sub")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 582 | machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 583 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | |
| r17813 | r17814 | |
| 873 | 873 | |
| 874 | 874 | /* reset Cpu 0 and stop all other CPUs */ |
| 875 | 875 | machine.device("maincpu")->reset(); |
| 876 | cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE); | |
| 877 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 878 | cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 876 | machine.device("sub")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 877 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 878 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 879 | 879 | |
| 880 | 880 | /* mcu patch data clear */ |
| 881 | 881 | state->m_mcu_patch_data = 0; |
| r17813 | r17814 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | static TIMER_CALLBACK( irq_off ) |
| 32 | 32 | { |
| 33 | cput | |
| 33 | machine.device("maincpu")->execute().set_input_line( | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| r17813 | r17814 | |
| 45 | 45 | state->m_scanline_timer->adjust(timer.machine().primary_screen->time_until_pos(param + 64), param + 64); |
| 46 | 46 | |
| 47 | 47 | /* IRQ starts on scanline 0, 64, 128, etc. */ |
| 48 | | |
| 48 | | |
| 49 | 49 | |
| 50 | 50 | /* it will turn off on the next HBLANK */ |
| 51 | 51 | timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), FUNC(irq_off)); |
| r17813 | r17814 | |
| 398 | 398 | /* apply the change */ |
| 399 | 399 | if (new_state && !(state->m_m6850_status & 0x80)) |
| 400 | 400 | { |
| 401 | cput | |
| 401 | machine.device("maincpu")->execute().set_input_line( | |
| 402 | 402 | state->m_m6850_status |= 0x80; |
| 403 | 403 | } |
| 404 | 404 | else if (!new_state && (state->m_m6850_status & 0x80)) |
| 405 | 405 | { |
| 406 | cput | |
| 406 | machine.device("maincpu")->execute().set_input_line( | |
| 407 | 407 | state->m_m6850_status &= ~0x80; |
| 408 | 408 | } |
| 409 | 409 | |
| r17813 | r17814 | |
| 416 | 416 | /* apply the change */ |
| 417 | 417 | if (new_state && !(state->m_m6850_sound_status & 0x80)) |
| 418 | 418 | { |
| 419 | cput | |
| 419 | machine.device("audiocpu")->execute().set_input_line( | |
| 420 | 420 | state->m_m6850_sound_status |= 0x80; |
| 421 | 421 | } |
| 422 | 422 | else if (!new_state && (state->m_m6850_sound_status & 0x80)) |
| 423 | 423 | { |
| 424 | cput | |
| 424 | machine.device("audiocpu")->execute().set_input_line( | |
| 425 | 425 | state->m_m6850_sound_status &= ~0x80; |
| 426 | 426 | } |
| 427 | 427 | } |
| r17813 | r17814 | |
| 716 | 716 | { |
| 717 | 717 | /* OUT on counter 2 is hooked to the /INT line on the Z80 */ |
| 718 | 718 | if (which == 2) |
| 719 | | |
| 719 | | |
| 720 | 720 | |
| 721 | 721 | /* OUT on counter 0 is hooked to the GATE line on counter 1 */ |
| 722 | 722 | else if (which == 0) |
| r17813 | r17814 | |
|---|---|---|
| 71 | 71 | void megadriv_z80_hold(running_machine &machine) |
| 72 | 72 | { |
| 73 | 73 | if ((genz80.z80_has_bus == 1) && (genz80.z80_is_reset == 0)) |
| 74 | | |
| 74 | | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | void megadriv_z80_clear(running_machine &machine) |
| 78 | 78 | { |
| 79 | | |
| 79 | | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static void megadriv_z80_bank_w(UINT16 data) |
| r17813 | r17814 | |
| 1090 | 1090 | void genesis_vdp_lv6irqline_callback_genesis_68k(running_machine &machine, bool state) |
| 1091 | 1091 | { |
| 1092 | 1092 | if (state==true) |
| 1093 | cput | |
| 1093 | machine.device("maincpu")->execute().set_input_line( | |
| 1094 | 1094 | else |
| 1095 | cput | |
| 1095 | machine.device("maincpu")->execute().set_input_line( | |
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | 1098 | // this comes from the vdp, and is connected to 68k irq level 4 (raster interrupt) |
| 1099 | 1099 | void genesis_vdp_lv4irqline_callback_genesis_68k(running_machine &machine, bool state) |
| 1100 | 1100 | { |
| 1101 | 1101 | if (state==true) |
| 1102 | cput | |
| 1102 | machine.device("maincpu")->execute().set_input_line( | |
| 1103 | 1103 | else |
| 1104 | cput | |
| 1104 | machine.device("maincpu")->execute().set_input_line( | |
| 1105 | 1105 | } |
| 1106 | 1106 | |
| 1107 | 1107 | /* Callback when the 68k takes an IRQ */ |
| r17813 | r17814 | |
| 1582 | 1582 | md_base_state *state = screen.machine().driver_data<md_base_state>(); |
| 1583 | 1583 | |
| 1584 | 1584 | if (screen.machine().root_device().ioport(":RESET")->read_safe(0x00) & 0x01) |
| 1585 | | |
| 1585 | | |
| 1586 | 1586 | |
| 1587 | 1587 | // rising edge |
| 1588 | 1588 | if (vblank_on) |
| r17813 | r17814 | |
|---|---|---|
| 674 | 674 | |
| 675 | 675 | if (state->m_IRQ_enable && !blanked && (state->m_IRQ_count == 0) && priorCount) |
| 676 | 676 | { |
| 677 | | |
| 677 | | |
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | } |
| r17813 | r17814 | |
| 969 | 969 | WRITE8_MEMBER(vsnes_state::set_bnglngby_irq_w) |
| 970 | 970 | { |
| 971 | 971 | m_ret = data; |
| 972 | cput | |
| 972 | machine().device("maincpu")->execute().set_input_line( | |
| 973 | 973 | /* other values ??? */ |
| 974 | 974 | /* 0, 4, 84 */ |
| 975 | 975 | } |
| r17813 | r17814 | |
|---|---|---|
| 48 | 48 | state->m_zready = 0; |
| 49 | 49 | state->m_busreq = 0; |
| 50 | 50 | if (machine.device("mcu") != NULL) |
| 51 | c | |
| 51 | machine.device("mcu")->execute().set_input_line( | |
| 52 | 52 | |
| 53 | 53 | state->m_spacecr_prot_value = 0; |
| 54 | 54 | } |
| r17813 | r17814 | |
| 108 | 108 | { |
| 109 | 109 | taitosj_state *state = machine.driver_data<taitosj_state>(); |
| 110 | 110 | state->m_zready = 1; |
| 111 | c | |
| 111 | machine.device("mcu")->execute().set_input_line( | |
| 112 | 112 | state->m_fromz80 = param; |
| 113 | 113 | } |
| 114 | 114 | |
| r17813 | r17814 | |
| 196 | 196 | { |
| 197 | 197 | /* 68705 is going to read data from the Z80 */ |
| 198 | 198 | machine().scheduler().synchronize(FUNC(taitosj_mcu_data_real_r)); |
| 199 | c | |
| 199 | machine().device("mcu")->execute().set_input_line( | |
| 200 | 200 | m_portA_in = m_fromz80; |
| 201 | 201 | LOG(("%04x: 68705 <- Z80 %02x\n", space.device().safe_pc(), m_portA_in)); |
| 202 | 202 | } |
| r17813 | r17814 | |
|---|---|---|
| 372 | 372 | if (CUSTOM_REG(REG_INTENA) & 0x4000) |
| 373 | 373 | { |
| 374 | 374 | /* Serial transmit buffer empty, disk block finished, software interrupts */ |
| 375 | cput | |
| 375 | machine.device("maincpu")->execute().set_input_line( | |
| 376 | 376 | |
| 377 | 377 | /* I/O ports and timer interrupts */ |
| 378 | cput | |
| 378 | machine.device("maincpu")->execute().set_input_line( | |
| 379 | 379 | |
| 380 | 380 | /* Copper, VBLANK, blitter interrupts */ |
| 381 | cput | |
| 381 | machine.device("maincpu")->execute().set_input_line( | |
| 382 | 382 | |
| 383 | 383 | /* Audio interrupts */ |
| 384 | cput | |
| 384 | machine.device("maincpu")->execute().set_input_line( | |
| 385 | 385 | |
| 386 | 386 | /* Serial receive buffer full, disk sync match */ |
| 387 | cput | |
| 387 | machine.device("maincpu")->execute().set_input_line( | |
| 388 | 388 | |
| 389 | 389 | /* External interrupts */ |
| 390 | cput | |
| 390 | machine.device("maincpu")->execute().set_input_line( | |
| 391 | 391 | } |
| 392 | 392 | else |
| 393 | 393 | { |
| 394 | cputag_set_input_line(machine, "maincpu", 1, CLEAR_LINE); | |
| 395 | cputag_set_input_line(machine, "maincpu", 2, CLEAR_LINE); | |
| 396 | cputag_set_input_line(machine, "maincpu", 3, CLEAR_LINE); | |
| 397 | cputag_set_input_line(machine, "maincpu", 4, CLEAR_LINE); | |
| 398 | cputag_set_input_line(machine, "maincpu", 5, CLEAR_LINE); | |
| 399 | cputag_set_input_line(machine, "maincpu", 6, CLEAR_LINE); | |
| 394 | machine.device("maincpu")->execute().set_input_line(1, CLEAR_LINE); | |
| 395 | machine.device("maincpu")->execute().set_input_line(2, CLEAR_LINE); | |
| 396 | machine.device("maincpu")->execute().set_input_line(3, CLEAR_LINE); | |
| 397 | machine.device("maincpu")->execute().set_input_line(4, CLEAR_LINE); | |
| 398 | machine.device("maincpu")->execute().set_input_line(5, CLEAR_LINE); | |
| 399 | machine.device("maincpu")->execute().set_input_line(6, CLEAR_LINE); | |
| 400 | 400 | } |
| 401 | 401 | } |
| 402 | 402 |
| r17813 | r17814 | |
|---|---|---|
| 70 | 70 | { |
| 71 | 71 | vertigo_state *state = device->machine().driver_data<vertigo_state>(); |
| 72 | 72 | if (state->m_irq_state < 7) |
| 73 | | |
| 73 | | |
| 74 | 74 | |
| 75 | 75 | state->m_irq_state = ttl74148_output_r(device); |
| 76 | 76 | |
| 77 | 77 | if (state->m_irq_state < 7) |
| 78 | | |
| 78 | | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| r17813 | r17814 | |
| 99 | 99 | static WRITE_LINE_DEVICE_HANDLER( v_irq3_w ) |
| 100 | 100 | { |
| 101 | 101 | if (state) |
| 102 | | |
| 102 | | |
| 103 | 103 | |
| 104 | 104 | update_irq_encoder(device->machine(), INPUT_LINE_IRQ3, state); |
| 105 | 105 | } |
| r17813 | r17814 | |
| 159 | 159 | { |
| 160 | 160 | /* Reset sound cpu */ |
| 161 | 161 | if ((data & 2) == 0) |
| 162 | | |
| 162 | | |
| 163 | 163 | else |
| 164 | | |
| 164 | | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 |
| r17813 | r17814 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | verboselog(machine(), 0, "Asserting IRQ2\n" ); |
| 62 | 62 | device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_2, 26); |
| 63 | cput | |
| 63 | machine().device("maincpu")->execute().set_input_line( | |
| 64 | 64 | m_interrupt_timer->adjust(attotime::never); |
| 65 | 65 | } |
| 66 | 66 | |
| r17813 | r17814 | |
| 144 | 144 | case 0xf4: |
| 145 | 145 | case 0xf7: |
| 146 | 146 | verboselog(machine(), 0, "slave_r: De-asserting IRQ2\n" ); |
| 147 | cput | |
| 147 | machine().device("maincpu")->execute().set_input_line( | |
| 148 | 148 | break; |
| 149 | 149 | } |
| 150 | 150 | } |
| r17813 | r17814 | |
|---|---|---|
| 84 | 84 | static void |
| 85 | 85 | ResetAllSubCPUs( running_machine &machine, int state ) |
| 86 | 86 | { |
| 87 | cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, state); | |
| 88 | cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, state); | |
| 87 | machine.device("slave")->execute().set_input_line(INPUT_LINE_RESET, state); | |
| 88 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_RESET, state); | |
| 89 | 89 | switch( machine.driver_data<namcos2_shared_state>()->m_gametype ) |
| 90 | 90 | { |
| 91 | 91 | case NAMCOS21_SOLVALOU: |
| 92 | 92 | case NAMCOS21_STARBLADE: |
| 93 | 93 | case NAMCOS21_AIRCOMBAT: |
| 94 | 94 | case NAMCOS21_CYBERSLED: |
| 95 | cputag_set_input_line(machine, "dspmaster", INPUT_LINE_RESET, state); | |
| 96 | cputag_set_input_line(machine, "dspslave", INPUT_LINE_RESET, state); | |
| 95 | machine.device("dspmaster")->execute().set_input_line(INPUT_LINE_RESET, state); | |
| 96 | machine.device("dspslave")->execute().set_input_line(INPUT_LINE_RESET, state); | |
| 97 | 97 | break; |
| 98 | 98 | |
| 99 | 99 | // case NAMCOS21_WINRUN91: |
| r17813 | r17814 | |
| 123 | 123 | /* Initialise the bank select in the sound CPU */ |
| 124 | 124 | namcos2_sound_bankselect_w(space, 0, 0); /* Page in bank 0 */ |
| 125 | 125 | |
| 126 | cput | |
| 126 | machine.device("audiocpu")->execute().set_input_line( | |
| 127 | 127 | |
| 128 | 128 | /* Place CPU2 & CPU3 into the reset condition */ |
| 129 | 129 | ResetAllSubCPUs( machine, ASSERT_LINE ); |
| r17813 | r17814 | |
| 577 | 577 | if (data & 0x01) |
| 578 | 578 | { |
| 579 | 579 | /* Resume execution */ |
| 580 | | |
| 580 | | |
| 581 | 581 | device_yield(&space->device()); |
| 582 | 582 | } |
| 583 | 583 | else |
| 584 | 584 | { |
| 585 | 585 | /* Suspend execution */ |
| 586 | | |
| 586 | | |
| 587 | 587 | } |
| 588 | 588 | if (namcos2_kickstart != NULL) |
| 589 | 589 | { |
| r17813 | r17814 | |
| 666 | 666 | if (state->is_system21()) { |
| 667 | 667 | if (namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ]) { |
| 668 | 668 | machine.primary_screen->update_partial(param); |
| 669 | cput | |
| 669 | machine.device("gpu")->execute().set_input_line( | |
| 670 | 670 | } |
| 671 | 671 | return; |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]|namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) { |
| 675 | 675 | machine.primary_screen->update_partial(param); |
| 676 | if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]) cputag_set_input_line(machine, "maincpu", namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 677 | if (namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) cputag_set_input_line(machine, "slave", namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 676 | if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]) machine.device("maincpu")->execute().set_input_line(namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 677 | if (namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) machine.device("slave")->execute().set_input_line(namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 |
| r17813 | r17814 | |
|---|---|---|
| 112 | 112 | if (offset == (0x150 / 2)) |
| 113 | 113 | { |
| 114 | 114 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 115 | | |
| 115 | | |
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | 118 | |
| r17813 | r17814 | |
| 232 | 232 | if (offset == (0x64 / 2)) |
| 233 | 233 | { |
| 234 | 234 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 235 | | |
| 235 | | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | COMBINE_DATA(&deco16_prot_ram[offset]); |
| r17813 | r17814 | |
| 423 | 423 | if (offset == (0x64 / 2)) |
| 424 | 424 | { |
| 425 | 425 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 426 | | |
| 426 | | |
| 427 | 427 | return; |
| 428 | 428 | } |
| 429 | 429 | |
| r17813 | r17814 | |
| 611 | 611 | if (offset == (0xa8 / 2)) |
| 612 | 612 | { |
| 613 | 613 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 614 | | |
| 614 | | |
| 615 | 615 | return; |
| 616 | 616 | } |
| 617 | 617 | |
| r17813 | r17814 | |
| 675 | 675 | if (offset == (0x10a >> 1)) |
| 676 | 676 | { |
| 677 | 677 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 678 | | |
| 678 | | |
| 679 | 679 | return; |
| 680 | 680 | } |
| 681 | 681 | } |
| r17813 | r17814 | |
| 795 | 795 | if (offset == (0xa8 / 2)) |
| 796 | 796 | { |
| 797 | 797 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 798 | | |
| 798 | | |
| 799 | 799 | return; |
| 800 | 800 | } |
| 801 | 801 | |
| r17813 | r17814 | |
| 1226 | 1226 | if (writeport == sndport) |
| 1227 | 1227 | { |
| 1228 | 1228 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 1229 | | |
| 1229 | | |
| 1230 | 1230 | return; |
| 1231 | 1231 | } |
| 1232 | 1232 | |
| r17813 | r17814 | |
| 1756 | 1756 | if (offset == (0x380 / 2)) |
| 1757 | 1757 | { |
| 1758 | 1758 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 1759 | | |
| 1759 | | |
| 1760 | 1760 | return; |
| 1761 | 1761 | } |
| 1762 | 1762 | logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n", space->device().safe_pc(), offset << 1, data); |
| r17813 | r17814 | |
|---|---|---|
| 41 | 41 | if (m_control_word & 0x7f00) |
| 42 | 42 | { |
| 43 | 43 | logerror("Unknown control Word: %04x\n",m_control_word); |
| 44 | c | |
| 44 | machine().device("sub2")->execute().set_input_line( | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if (m_control_word & 0x10) |
| 48 | c | |
| 48 | machine().device("sub")->execute().set_input_line( | |
| 49 | 49 | else |
| 50 | c | |
| 50 | machine().device("sub")->execute().set_input_line( | |
| 51 | 51 | |
| 52 | 52 | if (m_control_word & 0x80) |
| 53 | | |
| 53 | | |
| 54 | 54 | else |
| 55 | | |
| 55 | | |
| 56 | 56 | |
| 57 | 57 | m_last_control=m_control_word; |
| 58 | 58 | } |
| r17813 | r17814 | |
| 61 | 61 | // D0 = /GRDACC - Allow 68000 access to road pattern RAM |
| 62 | 62 | WRITE16_MEMBER(tatsumi_state::apache3_z80_ctrl_w) |
| 63 | 63 | { |
| 64 | c | |
| 64 | machine().device("sub2")->execute().set_input_line( | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | READ16_MEMBER(tatsumi_state::apache3_v30_v20_r) |
| r17813 | r17814 | |
| 171 | 171 | COMBINE_DATA(&m_control_word); |
| 172 | 172 | |
| 173 | 173 | if (m_control_word & 0x10) |
| 174 | c | |
| 174 | machine().device("sub")->execute().set_input_line( | |
| 175 | 175 | else |
| 176 | c | |
| 176 | machine().device("sub")->execute().set_input_line( | |
| 177 | 177 | |
| 178 | 178 | if (m_control_word & 0x4) |
| 179 | | |
| 179 | | |
| 180 | 180 | else |
| 181 | | |
| 181 | | |
| 182 | 182 | |
| 183 | 183 | // if (offset == 1 && (tatsumi_control_w & 0xfeff) != (last_bank & 0xfeff)) |
| 184 | 184 | // logerror("%08x: Changed bank to %04x (%d)\n", space.device().safe_pc(), tatsumi_control_w,offset); |
| r17813 | r17814 | |
| 204 | 204 | */ |
| 205 | 205 | |
| 206 | 206 | if ((m_control_word & 0x8) == 0 && !(m_last_control & 0x8)) |
| 207 | c | |
| 207 | machine().device("sub")->execute().set_input_line( | |
| 208 | 208 | // if (tatsumi_control_w&0x200) |
| 209 | 209 | // cpu_set_reset_line(1, CLEAR_LINE); |
| 210 | 210 | // else |
| r17813 | r17814 | |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | 239 | COMBINE_DATA(&m_roundup5_e0000_ram[offset]); |
| 240 | c | |
| 240 | machine().device("sub")->execute().set_input_line( | |
| 241 | 241 | |
| 242 | 242 | // logerror("d_68k_e0000_w %06x %04x\n", space.device().safe_pc(), data); |
| 243 | 243 | } |
| r17813 | r17814 | |
| 269 | 269 | if ((m_control_word & 4) == 4 && (m_last_control & 4) == 0) |
| 270 | 270 | { |
| 271 | 271 | // logerror("68k 2 halt\n"); |
| 272 | c | |
| 272 | machine().device("sub")->execute().set_input_line( | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | if ((m_control_word & 4) == 0 && (m_last_control & 4) == 4) |
| 276 | 276 | { |
| 277 | 277 | // logerror("68k 2 irq go\n"); |
| 278 | c | |
| 278 | machine().device("sub")->execute().set_input_line( | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 |
| r17813 | r17814 | |
|---|---|---|
| 308 | 308 | static int sms_vdp_cpu0_irq_callback(running_machine &machine, int status) |
| 309 | 309 | { |
| 310 | 310 | if (status == 1) |
| 311 | cput | |
| 311 | machine.device("maincpu")->execute().set_input_line( | |
| 312 | 312 | else |
| 313 | cput | |
| 313 | machine.device("maincpu")->execute().set_input_line( | |
| 314 | 314 | |
| 315 | 315 | return 0; |
| 316 | 316 | } |
| r17813 | r17814 | |
| 318 | 318 | static int sms_vdp_cpu1_irq_callback(running_machine &machine, int status) |
| 319 | 319 | { |
| 320 | 320 | if (status == 1) |
| 321 | | |
| 321 | | |
| 322 | 322 | else |
| 323 | | |
| 323 | | |
| 324 | 324 | |
| 325 | 325 | return 0; |
| 326 | 326 | } |
| r17813 | r17814 | |
| 329 | 329 | static int sms_vdp_cpu2_irq_callback(running_machine &machine, int status) |
| 330 | 330 | { |
| 331 | 331 | if (status == 1) |
| 332 | c | |
| 332 | machine.device("mtbios")->execute().set_input_line( | |
| 333 | 333 | else |
| 334 | c | |
| 334 | machine.device("mtbios")->execute().set_input_line( | |
| 335 | 335 | |
| 336 | 336 | return 0; |
| 337 | 337 | } |
| r17813 | r17814 | |
| 1181 | 1181 | |
| 1182 | 1182 | // the SMS has a 'RESET' button on the machine, it generates an NMI |
| 1183 | 1183 | if (screen.machine().root_device().ioport("PAUSE")->read_safe(0x00)) |
| 1184 | | |
| 1184 | | |
| 1185 | 1185 | } |
| 1186 | 1186 | } |
| 1187 | 1187 |
| r17813 | r17814 | |
|---|---|---|
| 51 | 51 | if ((m_ddrB & 0x02) && (~data & 0x02) && (m_portB_out & 0x02)) |
| 52 | 52 | { |
| 53 | 53 | m_portA_in = m_from_main; |
| 54 | if (m_main_sent) c | |
| 54 | if (m_main_sent) machine().device("68705")->execute().set_input_line( | |
| 55 | 55 | m_main_sent = 0; |
| 56 | 56 | //logerror("read command %02x from main cpu\n",m_portA_in); |
| 57 | 57 | } |
| r17813 | r17814 | |
| 107 | 107 | logerror("%04x: mcu_w %02x\n",space.device().safe_pc(),data); |
| 108 | 108 | m_from_main = data; |
| 109 | 109 | m_main_sent = 1; |
| 110 | c | |
| 110 | machine().device("68705")->execute().set_input_line( | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | READ8_MEMBER(retofinv_state::retofinv_mcu_r) |
| r17813 | r17814 | |
|---|---|---|
| 25 | 25 | int scanline = param; |
| 26 | 26 | |
| 27 | 27 | if(scanline == 0) // vblank irq |
| 28 | | |
| 28 | | |
| 29 | 29 | else if(((scanline % 28) == 0) && (state->m_nmi_on)) // 32v timer irq |
| 30 | | |
| 30 | | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 |
| r17813 | r17814 | |
|---|---|---|
| 102 | 102 | { |
| 103 | 103 | beezer_state *state = device->machine().driver_data<beezer_state>(); |
| 104 | 104 | if ((data & 0x08) == 0) |
| 105 | | |
| 105 | | |
| 106 | 106 | else |
| 107 | | |
| 107 | | |
| 108 | 108 | |
| 109 | 109 | if ((data & 0x04) == 0) |
| 110 | 110 | { |
| r17813 | r17814 | |
|---|---|---|
| 153 | 153 | #define CHECK_SCD_LV5_INTERRUPT \ |
| 154 | 154 | if (segacd_irq_mask & 0x20) \ |
| 155 | 155 | { \ |
| 156 | | |
| 156 | | |
| 157 | 157 | } \ |
| 158 | 158 | |
| 159 | 159 | #define CHECK_SCD_LV4_INTERRUPT \ |
| 160 | 160 | if (segacd_irq_mask & 0x10) \ |
| 161 | 161 | { \ |
| 162 | | |
| 162 | | |
| 163 | 163 | } \ |
| 164 | 164 | |
| 165 | 165 | #define CHECK_SCD_LV3_INTERRUPT \ |
| 166 | 166 | if (segacd_irq_mask & 0x08) \ |
| 167 | 167 | { \ |
| 168 | | |
| 168 | | |
| 169 | 169 | } \ |
| 170 | 170 | |
| 171 | 171 | #define CHECK_SCD_LV2_INTERRUPT \ |
| 172 | 172 | if (segacd_irq_mask & 0x04) \ |
| 173 | 173 | { \ |
| 174 | | |
| 174 | | |
| 175 | 175 | } \ |
| 176 | 176 | |
| 177 | 177 | #define CHECK_SCD_LV1_INTERRUPT \ |
| 178 | 178 | if (segacd_irq_mask & 0x02) \ |
| 179 | 179 | { \ |
| 180 | | |
| 180 | | |
| 181 | 181 | } \ |
| 182 | 182 | |
| 183 | 183 | #define CURRENT_TRACK_IS_DATA \ |
| r17813 | r17814 | |
| 1174 | 1174 | // reset line |
| 1175 | 1175 | if (a12000_halt_reset_reg&0x0001) |
| 1176 | 1176 | { |
| 1177 | | |
| 1177 | | |
| 1178 | 1178 | if (!(old_halt&0x0001)) printf("clear reset slave\n"); |
| 1179 | 1179 | } |
| 1180 | 1180 | else |
| 1181 | 1181 | { |
| 1182 | | |
| 1182 | | |
| 1183 | 1183 | if ((old_halt&0x0001)) printf("assert reset slave\n"); |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | 1186 | // request BUS |
| 1187 | 1187 | if (a12000_halt_reset_reg&0x0002) |
| 1188 | 1188 | { |
| 1189 | | |
| 1189 | | |
| 1190 | 1190 | if (!(old_halt&0x0002)) printf("halt slave\n"); |
| 1191 | 1191 | } |
| 1192 | 1192 | else |
| 1193 | 1193 | { |
| 1194 | | |
| 1194 | | |
| 1195 | 1195 | if ((old_halt&0x0002)) printf("resume slave\n"); |
| 1196 | 1196 | } |
| 1197 | 1197 | } |
| r17813 | r17814 | |
| 1480 | 1480 | { |
| 1481 | 1481 | // clear this bit |
| 1482 | 1482 | a12000_halt_reset_reg &= ~0x0100; |
| 1483 | | |
| 1483 | | |
| 1484 | 1484 | } |
| 1485 | 1485 | |
| 1486 | 1486 | return (0x60+irqline*4)/4; // vector address |
| r17813 | r17814 | |
|---|---|---|
| 241 | 241 | static void update_mcr68_interrupts(running_machine &machine) |
| 242 | 242 | { |
| 243 | 243 | mcr68_state *state = machine.driver_data<mcr68_state>(); |
| 244 | cputag_set_input_line(machine, "maincpu", state->m_v493_irq_vector, state->m_v493_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 245 | cputag_set_input_line(machine, "maincpu", state->m_m6840_irq_vector, state->m_m6840_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 244 | machine.device("maincpu")->execute().set_input_line(state->m_v493_irq_vector, state->m_v493_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 245 | machine.device("maincpu")->execute().set_input_line(state->m_m6840_irq_vector, state->m_m6840_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 |
| r17813 | r17814 | |
|---|---|---|
| 2857 | 2857 | m_sprite_collision=0;//? when to reset this .. |
| 2858 | 2858 | megadrive_imode = MEGADRIVE_REG0C_INTERLEAVE; // can't change mid-frame.. |
| 2859 | 2859 | m_imode_odd_frame^=1; |
| 2860 | // | |
| 2860 | // | |
| 2861 | 2861 | |
| 2862 | 2862 | |
| 2863 | 2863 |
| r17813 | r17814 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | void micro3d_duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 33 | 33 | { |
| 34 | cput | |
| 34 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | 37 | void micro3d_duart_tx(device_t *device, int channel, UINT8 data) |
| r17813 | r17814 | |
| 47 | 47 | else |
| 48 | 48 | { |
| 49 | 49 | state->m_m68681_tx0 = data; |
| 50 | | |
| 50 | | |
| 51 | 51 | // TODO: next line should be behind a timer callback which lasts one audiocpu clock cycle |
| 52 | | |
| 52 | | |
| 53 | 53 | } |
| 54 | 54 | }; |
| 55 | 55 | |
| r17813 | r17814 | |
| 84 | 84 | */ |
| 85 | 85 | void micro3d_duart_output_w(device_t *device, UINT8 data) |
| 86 | 86 | { |
| 87 | | |
| 87 | | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| r17813 | r17814 | |
| 262 | 262 | { |
| 263 | 263 | micro3d_state *state = machine.driver_data<micro3d_state>(); |
| 264 | 264 | |
| 265 | c | |
| 265 | machine.device("drmath")->execute().set_input_line( | |
| 266 | 266 | state->m_mac_stat = 0; |
| 267 | 267 | } |
| 268 | 268 | |
| r17813 | r17814 | |
| 302 | 302 | mac_sram = m_mac_sram; |
| 303 | 303 | |
| 304 | 304 | if (data & (1 << 14)) |
| 305 | c | |
| 305 | machine().device("drmath")->execute().set_input_line( | |
| 306 | 306 | |
| 307 | 307 | switch (inst) |
| 308 | 308 | { |
| r17813 | r17814 | |
| 557 | 557 | WRITE16_MEMBER(micro3d_state::micro3d_reset_w) |
| 558 | 558 | { |
| 559 | 559 | data >>= 8; |
| 560 | cputag_set_input_line(machine(), "drmath", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); | |
| 561 | cputag_set_input_line(machine(), "vgb", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); | |
| 560 | machine().device("drmath")->execute().set_input_line(INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); | |
| 561 | machine().device("vgb")->execute().set_input_line(INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); | |
| 562 | 562 | /* TODO: Joystick reset? */ |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | WRITE16_MEMBER(micro3d_state::host_drmath_int_w) |
| 566 | 566 | { |
| 567 | c | |
| 567 | machine().device("drmath")->execute().set_input_line( | |
| 568 | 568 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); |
| 569 | 569 | } |
| 570 | 570 | |
| r17813 | r17814 | |
| 588 | 588 | |
| 589 | 589 | WRITE32_MEMBER(micro3d_state::drmath_int_w) |
| 590 | 590 | { |
| 591 | cput | |
| 591 | machine().device("maincpu")->execute().set_input_line( | |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | WRITE32_MEMBER(micro3d_state::drmath_intr2_ack) |
| 595 | 595 | { |
| 596 | c | |
| 596 | machine().device("drmath")->execute().set_input_line( | |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | |
| r17813 | r17814 | |
| 639 | 639 | |
| 640 | 640 | state->m_ti_uart[STATUS] = 1; |
| 641 | 641 | |
| 642 | cputag_set_input_line(machine, "vgb", INPUT_LINE_RESET, ASSERT_LINE); | |
| 643 | cputag_set_input_line(machine, "drmath", INPUT_LINE_RESET, ASSERT_LINE); | |
| 644 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 642 | machine.device("vgb")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 643 | machine.device("drmath")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 644 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 645 | 645 | } |
| r17813 | r17814 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | WRITE8_MEMBER(playch10_state::pc10_GAMERES_w) |
| 131 | 131 | { |
| 132 | c | |
| 132 | machine().device("cart")->execute().set_input_line( | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | WRITE8_MEMBER(playch10_state::pc10_GAMESTOP_w) |
| 136 | 136 | { |
| 137 | c | |
| 137 | machine().device("cart")->execute().set_input_line( | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | WRITE8_MEMBER(playch10_state::pc10_PPURES_w) |
| r17813 | r17814 | |
|---|---|---|
| 53 | 53 | logerror("atari interrupt_cb TIMR1\n"); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | | |
| 56 | | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /************************************************************** |
| r17813 | r17814 | |
|---|---|---|
| 24 | 24 | state->m_getstar_sh_intenabled = 0; /* disable sound cpu interrupts */ |
| 25 | 25 | |
| 26 | 26 | /* SOUND CPU */ |
| 27 | cput | |
| 27 | machine.device("audiocpu")->execute().set_input_line( | |
| 28 | 28 | |
| 29 | 29 | /* MCU */ |
| 30 | 30 | state->m_mcu_val = 0; |
| r17813 | r17814 | |
| 39 | 39 | /* Reset and hold sound CPU */ |
| 40 | 40 | WRITE8_MEMBER(slapfght_state::slapfight_port_00_w) |
| 41 | 41 | { |
| 42 | | |
| 42 | | |
| 43 | 43 | m_getstar_sh_intenabled = 0; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /* Release reset on sound CPU */ |
| 47 | 47 | WRITE8_MEMBER(slapfght_state::slapfight_port_01_w) |
| 48 | 48 | { |
| 49 | | |
| 49 | | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /* Disable and clear hardware interrupt */ |
| r17813 | r17814 | |
| 118 | 118 | m_portA_in = m_from_main; |
| 119 | 119 | |
| 120 | 120 | if (m_main_sent) |
| 121 | c | |
| 121 | machine().device("mcu")->execute().set_input_line( | |
| 122 | 122 | |
| 123 | 123 | m_main_sent = 0; |
| 124 | 124 | } |
| r17813 | r17814 | |
| 170 | 170 | { |
| 171 | 171 | m_from_main = data; |
| 172 | 172 | m_main_sent = 1; |
| 173 | c | |
| 173 | machine().device("mcu")->execute().set_input_line( | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | READ8_MEMBER(slapfght_state::slapfight_mcu_r) |
| r17813 | r17814 | |
| 811 | 811 | if ((m_ddrB & 0x02) && (~data & 0x02) && (m_portB_out & 0x02)) |
| 812 | 812 | { |
| 813 | 813 | m_portA_in = m_from_main; |
| 814 | if (m_main_sent) c | |
| 814 | if (m_main_sent) machine().device("mcu")->execute().set_input_line( | |
| 815 | 815 | m_main_sent = 0; |
| 816 | 816 | } |
| 817 | 817 | if ((m_ddrB & 0x04) && (data & 0x04) && (~m_portB_out & 0x04)) |
| r17813 | r17814 | |
| 852 | 852 | m_from_main = data; |
| 853 | 853 | m_main_sent = 1; |
| 854 | 854 | m_mcu_sent = 0; |
| 855 | c | |
| 855 | machine().device("mcu")->execute().set_input_line( | |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | READ8_MEMBER(slapfght_state::tigerh_mcu_r) |
| r17813 | r17814 | |
|---|---|---|
| 224 | 224 | case CGBOARD_TYPE_ZR107: |
| 225 | 225 | case CGBOARD_TYPE_GTICLUB: |
| 226 | 226 | { |
| 227 | //cput | |
| 227 | //machine.device("dsp")->execute().set_input_line( | |
| 228 | 228 | sharc_set_flag_input(space->machine().device("dsp"), 0, ASSERT_LINE); |
| 229 | 229 | |
| 230 | 230 | if (offset == 1) |
| 231 | 231 | { |
| 232 | 232 | if (data & 0x03) |
| 233 | | |
| 233 | | |
| 234 | 234 | } |
| 235 | 235 | break; |
| 236 | 236 | } |
| r17813 | r17814 | |
|---|---|---|
| 159 | 159 | if (scanline == 224) state->m_irvg_vblank=1; |
| 160 | 160 | logerror("SCANLINE CALLBACK %d\n",scanline); |
| 161 | 161 | /* set the IRQ line state based on the 32V line state */ |
| 162 | cput | |
| 162 | machine.device("maincpu")->execute().set_input_line( | |
| 163 | 163 | |
| 164 | 164 | /* set a callback for the next 32-scanline increment */ |
| 165 | 165 | scanline += 32; |
| r17813 | r17814 | |
| 419 | 419 | irobot_state *state = timer.machine().driver_data<irobot_state>(); |
| 420 | 420 | logerror("mb done. "); |
| 421 | 421 | state->m_irmb_running = 0; |
| 422 | | |
| 422 | | |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | |
| r17813 | r17814 | |
| 824 | 824 | state->m_irmb_timer->adjust(attotime::from_hz(200) * icount); |
| 825 | 825 | } |
| 826 | 826 | #else |
| 827 | cput | |
| 827 | machine.device("maincpu")->execute().set_input_line( | |
| 828 | 828 | #endif |
| 829 | 829 | state->m_irmb_running=1; |
| 830 | 830 | } |
| r17813 | r17814 | |
|---|---|---|
| 426 | 426 | |
| 427 | 427 | /* interrupts generated on the VA10 line, which is every */ |
| 428 | 428 | /* 16 scanlines starting with scanline #8 */ |
| 429 | c | |
| 429 | machine.device("master")->execute().set_input_line( | |
| 430 | 430 | |
| 431 | 431 | /* set a timer for the next one */ |
| 432 | 432 | scanline += 16; |
| r17813 | r17814 | |
| 442 | 442 | int scanline = param; |
| 443 | 443 | |
| 444 | 444 | /* interrupts generated according to the interrupt control register */ |
| 445 | c | |
| 445 | machine.device("master")->execute().set_input_line( | |
| 446 | 446 | |
| 447 | 447 | /* set a timer for the next one */ |
| 448 | 448 | state->m_master_int_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline); |
| r17813 | r17814 | |
| 1102 | 1102 | |
| 1103 | 1103 | case 0x02: /* /GIN2 */ |
| 1104 | 1104 | case 0x12: |
| 1105 | c | |
| 1105 | machine().device("master")->execute().set_input_line( | |
| 1106 | 1106 | break; |
| 1107 | 1107 | |
| 1108 | 1108 | case 0x03: /* /IGID */ |
| r17813 | r17814 | |
| 1134 | 1134 | switch (offset) |
| 1135 | 1135 | { |
| 1136 | 1136 | case 0x09: /* /MCONT */ |
| 1137 | c | |
| 1137 | machine().device("slave")->execute().set_input_line( | |
| 1138 | 1138 | m_wcol_enable = (data & 0x02); |
| 1139 | cputag_set_input_line(machine(), "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1140 | cputag_set_input_line(machine(), "slave", 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 1139 | machine().device("slave")->execute().set_input_line(INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1140 | machine().device("slave")->execute().set_input_line(0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 1141 | 1141 | |
| 1142 | 1142 | eeprom = machine().device<eeprom_device>("eeprom"); |
| 1143 | 1143 | if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", space.device().safe_pc(), |
| r17813 | r17814 | |
| 1210 | 1210 | break; |
| 1211 | 1211 | |
| 1212 | 1212 | case 0x05: /* /SLV0 */ |
| 1213 | cputag_set_input_line(machine(), "slave", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1214 | cputag_set_input_line(machine(), "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1215 | cputag_set_input_line(machine(), "slave", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 1213 | machine().device("slave")->execute().set_input_line(0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1214 | machine().device("slave")->execute().set_input_line(INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1215 | machine().device("slave")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 1216 | 1216 | break; |
| 1217 | 1217 | |
| 1218 | 1218 | case 0x08: /* */ |
| r17813 | r17814 | |
|---|---|---|
| 121 | 121 | if (data == 0) { |
| 122 | 122 | if (m_dsp_execute) { |
| 123 | 123 | logerror("Turning 68000 on\n"); |
| 124 | cput | |
| 124 | machine().device("maincpu")->execute().set_input_line( | |
| 125 | 125 | m_dsp_execute = 0; |
| 126 | 126 | } |
| 127 | 127 | m_dsp_BIO = ASSERT_LINE; |
| r17813 | r17814 | |
| 143 | 143 | if (enable) |
| 144 | 144 | { |
| 145 | 145 | logerror("Turning DSP on and 68000 off\n"); |
| 146 | cputag_set_input_line(machine, "dsp", INPUT_LINE_HALT, CLEAR_LINE); | |
| 147 | cputag_set_input_line(machine, "dsp", 0, ASSERT_LINE); /* TMS32010 INT */ | |
| 148 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 146 | machine.device("dsp")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 147 | machine.device("dsp")->execute().set_input_line(0, ASSERT_LINE); /* TMS32010 INT */ | |
| 148 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 149 | 149 | } |
| 150 | 150 | else |
| 151 | 151 | { |
| 152 | 152 | logerror("Turning DSP off\n"); |
| 153 | cputag_set_input_line(machine, "dsp", 0, CLEAR_LINE); /* TMS32010 INT */ | |
| 154 | cputag_set_input_line(machine, "dsp", INPUT_LINE_HALT, ASSERT_LINE); | |
| 153 | machine.device("dsp")->execute().set_input_line(0, CLEAR_LINE); /* TMS32010 INT */ | |
| 154 | machine.device("dsp")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 |
| r17813 | r17814 | |
|---|---|---|
| 223 | 223 | |
| 224 | 224 | void vectrex_via_irq(device_t *device, int level) |
| 225 | 225 | { |
| 226 | | |
| 226 | | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 |
| r17813 | r17814 | |
|---|---|---|
| 826 | 826 | dc_state *state = machine.driver_data<dc_state>(); |
| 827 | 827 | |
| 828 | 828 | /* halt the ARM7 */ |
| 829 | cput | |
| 829 | machine.device("soundcpu")->execute().set_input_line( | |
| 830 | 830 | |
| 831 | 831 | memset(state->dc_sysctrl_regs, 0, sizeof(state->dc_sysctrl_regs)); |
| 832 | 832 | |
| r17813 | r17814 | |
| 863 | 863 | if (dat & 1) |
| 864 | 864 | { |
| 865 | 865 | /* halt the ARM7 */ |
| 866 | | |
| 866 | | |
| 867 | 867 | } |
| 868 | 868 | else |
| 869 | 869 | { |
| 870 | 870 | /* it's alive ! */ |
| 871 | | |
| 871 | | |
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | 874 |
| r17813 | r17814 | |
|---|---|---|
| 17 | 17 | pitnrun_state *state = machine.driver_data<pitnrun_state>(); |
| 18 | 18 | state->m_zaccept = 1; |
| 19 | 19 | state->m_zready = 0; |
| 20 | c | |
| 20 | machine.device("mcu")->execute().set_input_line( | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | static TIMER_CALLBACK( pitnrun_mcu_real_data_r ) |
| r17813 | r17814 | |
| 36 | 36 | { |
| 37 | 37 | pitnrun_state *state = machine.driver_data<pitnrun_state>(); |
| 38 | 38 | state->m_zready = 1; |
| 39 | c | |
| 39 | machine.device("mcu")->execute().set_input_line( | |
| 40 | 40 | state->m_fromz80 = param; |
| 41 | 41 | } |
| 42 | 42 | |
| r17813 | r17814 | |
| 111 | 111 | { |
| 112 | 112 | /* 68705 is going to read data from the Z80 */ |
| 113 | 113 | machine().scheduler().synchronize(FUNC(pitnrun_mcu_data_real_r)); |
| 114 | c | |
| 114 | machine().device("mcu")->execute().set_input_line( | |
| 115 | 115 | m_portA_in = m_fromz80; |
| 116 | 116 | } |
| 117 | 117 | if (~data & 0x04) |
| r17813 | r17814 | |
|---|---|---|
| 170 | 170 | midxunit_state *drvstate = machine.driver_data<midxunit_state>(); |
| 171 | 171 | /* only signal if not in loopback state */ |
| 172 | 172 | if (drvstate->m_uart[1] != 0x66) |
| 173 | cput | |
| 173 | machine.device("maincpu")->execute().set_input_line( | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | void n64_periphs::reset_tick() |
| 36 | 36 | { |
| 37 | 37 | reset_timer->adjust(attotime::never); |
| 38 | cput | |
| 38 | machine().device("maincpu")->execute().set_input_line( | |
| 39 | 39 | machine().device("maincpu")->reset(); |
| 40 | 40 | machine().device("rsp")->reset(); |
| 41 | 41 | machine().device("rcp")->reset(); |
| 42 | cput | |
| 42 | machine().device("rsp")->execute().set_input_line( | |
| 43 | 43 | reset_held = false; |
| 44 | 44 | } |
| 45 | 45 | |
| r17813 | r17814 | |
| 49 | 49 | reset_held = button; |
| 50 | 50 | if(!old_held && reset_held) |
| 51 | 51 | { |
| 52 | cput | |
| 52 | machine().device("maincpu")->execute().set_input_line( | |
| 53 | 53 | } |
| 54 | 54 | else if(old_held && reset_held) |
| 55 | 55 | { |
| r17813 | r17814 | |
| 365 | 365 | if (mi_intr_mask & mi_interrupt) |
| 366 | 366 | { |
| 367 | 367 | //printf("Asserting IRQ, %02x : %02x\n", mi_intr_mask, mi_interrupt); fflush(stdout); |
| 368 | cput | |
| 368 | machine().device("maincpu")->execute().set_input_line( | |
| 369 | 369 | } |
| 370 | 370 | else |
| 371 | 371 | { |
| 372 | 372 | //printf("Deasserting IRQ, %02x : %02x\n", mi_intr_mask, mi_interrupt); fflush(stdout); |
| 373 | cput | |
| 373 | machine().device("maincpu")->execute().set_input_line( | |
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
| r17813 | r17814 | |
| 2295 | 2295 | |
| 2296 | 2296 | dd_data_reg = (convert_to_bcd(systime.local_time.year % 100) << 24) | (convert_to_bcd(systime.local_time.month + 1) << 16); |
| 2297 | 2297 | |
| 2298 | cput | |
| 2298 | machine().device("maincpu")->execute().set_input_line( | |
| 2299 | 2299 | dd_status_reg |= DD_STATUS_INTR; |
| 2300 | 2300 | break; |
| 2301 | 2301 | } |
| r17813 | r17814 | |
| 2309 | 2309 | |
| 2310 | 2310 | dd_data_reg = (convert_to_bcd(systime.local_time.mday) << 24) | (convert_to_bcd(systime.local_time.hour) << 16); |
| 2311 | 2311 | |
| 2312 | cput | |
| 2312 | machine().device("maincpu")->execute().set_input_line( | |
| 2313 | 2313 | dd_status_reg |= DD_STATUS_INTR; |
| 2314 | 2314 | break; |
| 2315 | 2315 | } |
| r17813 | r17814 | |
| 2323 | 2323 | |
| 2324 | 2324 | dd_data_reg = (convert_to_bcd(systime.local_time.minute) << 24) | (convert_to_bcd(systime.local_time.second) << 16); |
| 2325 | 2325 | |
| 2326 | cput | |
| 2326 | machine().device("maincpu")->execute().set_input_line( | |
| 2327 | 2327 | dd_status_reg |= DD_STATUS_INTR; |
| 2328 | 2328 | break; |
| 2329 | 2329 | } |
| r17813 | r17814 | |
| 2337 | 2337 | |
| 2338 | 2338 | case 0x10/4: // Interrupt Clear |
| 2339 | 2339 | logerror("dd interrupt clear\n"); |
| 2340 | cput | |
| 2340 | machine().device("maincpu")->execute().set_input_line( | |
| 2341 | 2341 | dd_status_reg &= ~DD_STATUS_INTR; |
| 2342 | 2342 | break; |
| 2343 | 2343 | |
| r17813 | r17814 | |
| 2420 | 2420 | |
| 2421 | 2421 | MACHINE_RESET( n64 ) |
| 2422 | 2422 | { |
| 2423 | cput | |
| 2423 | machine.device("rsp")->execute().set_input_line( | |
| 2424 | 2424 | } |
| r17813 | r17814 | |
|---|---|---|
| 113 | 113 | static TIMER_CALLBACK( stfight_interrupt_1 ) |
| 114 | 114 | { |
| 115 | 115 | // Do a RST08 |
| 116 | cput | |
| 116 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | INTERRUPT_GEN( stfight_vb_interrupt ) |
| r17813 | r17814 | |
|---|---|---|
| 498 | 498 | { |
| 499 | 499 | if(josvolly_nmi_enable) |
| 500 | 500 | { |
| 501 | | |
| 501 | | |
| 502 | 502 | josvolly_nmi_enable = 0; |
| 503 | 503 | } |
| 504 | 504 | } |
| r17813 | r17814 | |
|---|---|---|
| 282 | 282 | |
| 283 | 283 | WRITE8_MEMBER(qix_state::qix_data_firq_w) |
| 284 | 284 | { |
| 285 | cput | |
| 285 | machine().device("maincpu")->execute().set_input_line( | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | |
| 289 | 289 | WRITE8_MEMBER(qix_state::qix_data_firq_ack_w) |
| 290 | 290 | { |
| 291 | cput | |
| 291 | machine().device("maincpu")->execute().set_input_line( | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | |
| 295 | 295 | READ8_MEMBER(qix_state::qix_data_firq_r) |
| 296 | 296 | { |
| 297 | cput | |
| 297 | machine().device("maincpu")->execute().set_input_line( | |
| 298 | 298 | return 0xff; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | |
| 302 | 302 | READ8_MEMBER(qix_state::qix_data_firq_ack_r) |
| 303 | 303 | { |
| 304 | cput | |
| 304 | machine().device("maincpu")->execute().set_input_line( | |
| 305 | 305 | return 0xff; |
| 306 | 306 | } |
| 307 | 307 | |
| r17813 | r17814 | |
| 315 | 315 | |
| 316 | 316 | WRITE8_MEMBER(qix_state::qix_video_firq_w) |
| 317 | 317 | { |
| 318 | | |
| 318 | | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| 322 | 322 | WRITE8_MEMBER(qix_state::qix_video_firq_ack_w) |
| 323 | 323 | { |
| 324 | | |
| 324 | | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | READ8_MEMBER(qix_state::qix_video_firq_r) |
| 329 | 329 | { |
| 330 | | |
| 330 | | |
| 331 | 331 | return 0xff; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | |
| 335 | 335 | READ8_MEMBER(qix_state::qix_video_firq_ack_r) |
| 336 | 336 | { |
| 337 | | |
| 337 | | |
| 338 | 338 | return 0xff; |
| 339 | 339 | } |
| 340 | 340 | |
| r17813 | r17814 | |
| 373 | 373 | /* if (!(data & 0x04)) */ |
| 374 | 374 | if (data & 0x04) |
| 375 | 375 | { |
| 376 | | |
| 376 | | |
| 377 | 377 | /* temporarily boost the interleave to sync things up */ |
| 378 | 378 | /* note: I'm using 50 because 30 is not enough for space dungeon at game over */ |
| 379 | 379 | device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); |
| 380 | 380 | } |
| 381 | 381 | else |
| 382 | | |
| 382 | | |
| 383 | 383 | |
| 384 | 384 | /* this is a callback called by pia6821_device::write(), so I don't need to synchronize */ |
| 385 | 385 | /* the CPUs - they have already been synchronized by qix_pia_w() */ |
| r17813 | r17814 | |
|---|---|---|
| 1591 | 1591 | // if we have a DSP, halt it for the moment |
| 1592 | 1592 | if (state->m_upd7725) |
| 1593 | 1593 | { |
| 1594 | cput | |
| 1594 | machine.device("dsp")->execute().set_input_line( | |
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | 1597 | // ditto for a uPD96050 (Seta ST-010 or ST-011) |
| 1598 | 1598 | state->m_upd96050 = machine.device<upd96050_device>("setadsp"); |
| 1599 | 1599 | if (state->m_upd96050) |
| 1600 | 1600 | { |
| 1601 | cput | |
| 1601 | machine.device("setadsp")->execute().set_input_line( | |
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | 1604 | switch (state->m_has_addon_chip) |
| r17813 | r17814 | |
| 1610 | 1610 | // cartridge uses the DSP, let 'er rip |
| 1611 | 1611 | if (state->m_upd7725) |
| 1612 | 1612 | { |
| 1613 | cput | |
| 1613 | machine.device("dsp")->execute().set_input_line( | |
| 1614 | 1614 | } |
| 1615 | 1615 | else |
| 1616 | 1616 | { |
| r17813 | r17814 | |
| 1636 | 1636 | // cartridge uses the DSP, let 'er rip |
| 1637 | 1637 | if (state->m_upd96050) |
| 1638 | 1638 | { |
| 1639 | cput | |
| 1639 | machine.device("setadsp")->execute().set_input_line( | |
| 1640 | 1640 | } |
| 1641 | 1641 | else |
| 1642 | 1642 | { |
| r17813 | r17814 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed ) |
| 156 | 156 | { |
| 157 | | |
| 157 | | |
| 158 | 158 | |
| 159 | 159 | /* Assert HLDA */ |
| 160 | 160 | i8237_hlda_w( device, state ); |
| r17813 | r17814 | |
| 261 | 261 | |
| 262 | 262 | static WRITE_LINE_DEVICE_HANDLER( pic8259_1_set_int_line ) |
| 263 | 263 | { |
| 264 | | |
| 264 | | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | static READ8_DEVICE_HANDLER( get_slave_ack ) |
| r17813 | r17814 | |
|---|---|---|
| 134 | 134 | |
| 135 | 135 | static WRITE_LINE_DEVICE_HANDLER( ipu_ctc_interrupt ) |
| 136 | 136 | { |
| 137 | | |
| 137 | | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| r17813 | r17814 | |
| 253 | 253 | static TIMER_CALLBACK( ipu_watchdog_reset ) |
| 254 | 254 | { |
| 255 | 255 | logerror("ipu_watchdog_reset\n"); |
| 256 | cput | |
| 256 | machine.device("ipu")->execute().set_input_line( | |
| 257 | 257 | devtag_reset(machine, "ipu_ctc"); |
| 258 | 258 | devtag_reset(machine, "ipu_pio0"); |
| 259 | 259 | devtag_reset(machine, "ipu_pio1"); |
| r17813 | r17814 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | if (ioc_regs[IRQ_MASK_A] & mask) |
| 66 | 66 | { |
| 67 | cput | |
| 67 | machine.device("maincpu")->execute().set_input_line( | |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| r17813 | r17814 | |
| 592 | 592 | //if (ioc_regs[IRQ_STATUS_A] == 0) |
| 593 | 593 | { |
| 594 | 594 | //printf("IRQ clear A\n"); |
| 595 | | |
| 595 | | |
| 596 | 596 | } |
| 597 | 597 | break; |
| 598 | 598 |
| r17813 | r17814 | |
|---|---|---|
| 18 | 18 | /* for some reason a call to cputag_set_input_line |
| 19 | 19 | * is significantly delayed .... |
| 20 | 20 | * |
| 21 | * | |
| 21 | * | |
| 22 | 22 | * |
| 23 | 23 | * Therefore we reset the line without any detour .... |
| 24 | 24 | */ |
| r17813 | r17814 | |
| 39 | 39 | { |
| 40 | 40 | galaxold_state *drvstate = device->machine().driver_data<galaxold_state>(); |
| 41 | 41 | /* Q goes to the NMI line */ |
| 42 | | |
| 42 | | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | WRITE8_MEMBER(galaxold_state::galaxold_nmi_enable_w) |
| r17813 | r17814 | |
|---|---|---|
| 496 | 496 | /* at its endpoint; otherwise, we never get a result from the Z80 */ |
| 497 | 497 | if ((data & 0x10) || machine.device("sub")->state().state_int(Z80_PC) == 0x13a) |
| 498 | 498 | { |
| 499 | c | |
| 499 | machine.device("sub")->execute().set_input_line( | |
| 500 | 500 | |
| 501 | 501 | /* on the rising edge, make the crosshair visible again */ |
| 502 | 502 | if ((data & 0x10) && !(state->m_z80_ctrl & 0x10)) |
| r17813 | r17814 | |
|---|---|---|
| 191 | 191 | if (offset==2) |
| 192 | 192 | { |
| 193 | 193 | if ((data&0x4)==0) |
| 194 | cput | |
| 194 | machine().device("maincpu")->execute().set_input_line( | |
| 195 | 195 | if ((data&0x8)==0) |
| 196 | c | |
| 196 | machine().device("mcu")->execute().set_input_line( | |
| 197 | 197 | if ((data&0x40)==0) |
| 198 | 198 | m_i8751_return=(m_i8751_return&0xff00)|(m_i8751_ports[0]); |
| 199 | 199 | if ((data&0x80)==0) |
| r17813 | r17814 | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | if (!state->m_i8751_return) logerror("%s: warning - write unknown command %02x to 8571\n",machine.describe_context(),data); |
| 229 | cput | |
| 229 | machine.device("maincpu")->execute().set_input_line( | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | static void birdtry_i8751_write(running_machine &machine, int data) |
| r17813 | r17814 | |
| 298 | 298 | case 0x7ff: state->m_i8751_return = 0x200; break; |
| 299 | 299 | default: logerror("%s: warning - write unknown command %02x to 8571\n",machine.describe_context(),data); |
| 300 | 300 | } |
| 301 | cput | |
| 301 | machine.device("maincpu")->execute().set_input_line( | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | void dec0_i8751_write(running_machine &machine, int data) |
| r17813 | r17814 | |
| 307 | 307 | state->m_i8751_command=data; |
| 308 | 308 | |
| 309 | 309 | /* Writes to this address cause an IRQ to the i8751 microcontroller */ |
| 310 | if (state->m_GAME == 1) c | |
| 310 | if (state->m_GAME == 1) machine.device("mcu")->execute().set_input_line( | |
| 311 | 311 | if (state->m_GAME == 2) baddudes_i8751_write(machine, data); |
| 312 | 312 | if (state->m_GAME == 3) birdtry_i8751_write(machine, data); |
| 313 | 313 | |
| r17813 | r17814 | |
| 343 | 343 | m_robocop_shared_ram[offset]=data&0xff; |
| 344 | 344 | |
| 345 | 345 | if (offset == 0x7ff) /* A control address - not standard ram */ |
| 346 | c | |
| 346 | machine().device("sub")->execute().set_input_line( | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | /******************************************************************************/ |
| r17813 | r17814 | |
|---|---|---|
| 298 | 298 | int combined_state = pia_1->irq_a_state() | pia_1->irq_b_state(); |
| 299 | 299 | |
| 300 | 300 | /* IRQ to the main CPU */ |
| 301 | | |
| 301 | | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
| 305 | 305 | static void williams_main_firq(device_t *device, int state) |
| 306 | 306 | { |
| 307 | 307 | /* FIRQ to the main CPU */ |
| 308 | | |
| 308 | | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | |
| r17813 | r17814 | |
| 315 | 315 | int combined_state = pia_2->irq_a_state() | pia_2->irq_b_state(); |
| 316 | 316 | |
| 317 | 317 | /* IRQ to the sound CPU */ |
| 318 | | |
| 318 | | |
| 319 | 319 | } |
| 320 | 320 | /* Same as above, but for second sound board */ |
| 321 | 321 | static void williams_snd_irq_b(device_t *device, int state) |
| r17813 | r17814 | |
| 324 | 324 | int combined_state = pia_2->irq_a_state() | pia_2->irq_b_state(); |
| 325 | 325 | |
| 326 | 326 | /* IRQ to the sound CPU */ |
| 327 | | |
| 327 | | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
| r17813 | r17814 | |
| 342 | 342 | int combined_state = pia_0->irq_b_state() | pia_1->irq_a_state() | pia_1->irq_b_state(); |
| 343 | 343 | |
| 344 | 344 | /* IRQ to the main CPU */ |
| 345 | | |
| 345 | | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
| r17813 | r17814 | |
| 353 | 353 | int combined_state = pia_0->irq_a_state() | pia_0->irq_b_state() | pia_1->irq_a_state() | pia_1->irq_b_state(); |
| 354 | 354 | |
| 355 | 355 | /* IRQ to the main CPU */ |
| 356 | | |
| 356 | | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 |
| r17813 | r17814 | |
|---|---|---|
| 48 | 48 | state->m_h8_irq5_enabled = 0; |
| 49 | 49 | |
| 50 | 50 | // halt the MCU |
| 51 | c | |
| 51 | machine.device("mcu")->execute().set_input_line( | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // instance of the shared ram pointer |
| r17813 | r17814 | |
| 96 | 96 | // this is a kludge until we emulate the h8 |
| 97 | 97 | if ((m_h8_irq5_enabled == 0) && (data != 0x0000)) |
| 98 | 98 | { |
| 99 | c | |
| 99 | machine().device("mcu")->execute().set_input_line( | |
| 100 | 100 | } |
| 101 | 101 | m_h8_irq5_enabled = ( data != 0x0000 ); |
| 102 | 102 | break; |
| r17813 | r17814 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | if (nb1413m3_nmi_enable) |
| 55 | 55 | { |
| 56 | cput | |
| 56 | machine.device("maincpu")->execute().set_input_line( | |
| 57 | 57 | nb1413m3_nmi_count++; |
| 58 | 58 | } |
| 59 | 59 |
| r17813 | r17814 | |
|---|---|---|
| 1715 | 1715 | case (0x740/2): |
| 1716 | 1716 | { |
| 1717 | 1717 | state->soundlatch_byte_w(*space, 0, data & 0xff); |
| 1718 | | |
| 1718 | | |
| 1719 | 1719 | break; |
| 1720 | 1720 | } |
| 1721 | 1721 | } |
| r17813 | r17814 | |
|---|---|---|
| 84 | 84 | if(interrupt) |
| 85 | 85 | { |
| 86 | 86 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); |
| 87 | cput | |
| 87 | machine.device("maincpu")->execute().set_input_line( | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| r17813 | r17814 | |
| 171 | 171 | if(interrupt) |
| 172 | 172 | { |
| 173 | 173 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); |
| 174 | cput | |
| 174 | machine.device("maincpu")->execute().set_input_line( | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | scc68070->uart.status_register |= USR_RXRDY; |
| r17813 | r17814 | |
| 382 | 382 | if(interrupt) |
| 383 | 383 | { |
| 384 | 384 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); |
| 385 | cput | |
| 385 | machine.device("maincpu")->execute().set_input_line( | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | if(scc68070->uart.transmit_pointer > -1) |
| r17813 | r17814 | |
| 480 | 480 | |
| 481 | 481 | if((scc68070->picr2 >> 4) & 7) |
| 482 | 482 | { |
| 483 | | |
| 483 | | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | if(scc68070->picr2 & 7) |
| 487 | 487 | { |
| 488 | | |
| 488 | | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | return scc68070->uart.status_register; |
| r17813 | r17814 | |
| 531 | 531 | } |
| 532 | 532 | if((scc68070->picr2 >> 4) & 7) |
| 533 | 533 | { |
| 534 | | |
| 534 | | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | scc68070->uart.receive_holding_register = scc68070->uart.receive_buffer[0]; |
| r17813 | r17814 | |
| 840 | 840 | if(!scc68070->timers.timer_status_register) |
| 841 | 841 | { |
| 842 | 842 | UINT8 interrupt = scc68070->picr1 & 7; |
| 843 | | |
| 843 | | |
| 844 | 844 | } |
| 845 | 845 | } |
| 846 | 846 | break; |
| r17813 | r17814 | |
|---|---|---|
| 624 | 624 | if(interrupt) |
| 625 | 625 | { |
| 626 | 626 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); |
| 627 | cput | |
| 627 | machine.device("maincpu")->execute().set_input_line( | |
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | #if 0 |
| r17813 | r17814 | |
| 634 | 634 | if(interrupt) |
| 635 | 635 | { |
| 636 | 636 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt); |
| 637 | cput | |
| 637 | machine.device("maincpu")->execute().set_input_line( | |
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | #endif |
| r17813 | r17814 | |
| 715 | 715 | if(interrupt) |
| 716 | 716 | { |
| 717 | 717 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt); |
| 718 | cput | |
| 718 | machine.device("maincpu")->execute().set_input_line( | |
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | 721 | #if 0 |
| r17813 | r17814 | |
| 725 | 725 | if(interrupt) |
| 726 | 726 | { |
| 727 | 727 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt); |
| 728 | cput | |
| 728 | machine.device("maincpu")->execute().set_input_line( | |
| 729 | 729 | } |
| 730 | 730 | } |
| 731 | 731 | #endif |
| r17813 | r17814 | |
| 1376 | 1376 | mcd212->channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2); |
| 1377 | 1377 | if(interrupt1) |
| 1378 | 1378 | { |
| 1379 | | |
| 1379 | | |
| 1380 | 1380 | } |
| 1381 | 1381 | //if(interrupt2) |
| 1382 | 1382 | //{ |
| 1383 | // | |
| 1383 | // | |
| 1384 | 1384 | //} |
| 1385 | 1385 | return old_csr; |
| 1386 | 1386 | } |
| r17813 | r17814 | |
|---|---|---|
| 367 | 367 | { |
| 368 | 368 | midyunit_state *state = machine.driver_data<midyunit_state>(); |
| 369 | 369 | state->m_dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */ |
| 370 | cput | |
| 370 | machine.device("maincpu")->execute().set_input_line( | |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | |
| r17813 | r17814 | |
| 431 | 431 | |
| 432 | 432 | /* high bit triggers action */ |
| 433 | 433 | command = m_dma_register[DMA_COMMAND]; |
| 434 | cput | |
| 434 | machine().device("maincpu")->execute().set_input_line( | |
| 435 | 435 | if (!(command & 0x8000)) |
| 436 | 436 | return; |
| 437 | 437 |
| r17813 | r17814 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | /* latch 0x50 clears IRQ4 */ |
| 232 | 232 | case 0x50: |
| 233 | cput | |
| 233 | machine().device("maincpu")->execute().set_input_line( | |
| 234 | 234 | break; |
| 235 | 235 | |
| 236 | 236 | /* latch 0x60 clears IRQ5 */ |
| 237 | 237 | case 0x60: |
| 238 | cput | |
| 238 | machine().device("maincpu")->execute().set_input_line( | |
| 239 | 239 | break; |
| 240 | 240 | |
| 241 | 241 | /* log anything else */ |
| r17813 | r17814 | |
|---|---|---|
| 590 | 590 | static TIMER_CALLBACK( dma_callback ) |
| 591 | 591 | { |
| 592 | 592 | dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */ |
| 593 | cput | |
| 593 | machine.device("maincpu")->execute().set_input_line( | |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | |
| r17813 | r17814 | |
| 680 | 680 | |
| 681 | 681 | /* high bit triggers action */ |
| 682 | 682 | command = dma_register[DMA_COMMAND]; |
| 683 | cput | |
| 683 | machine().device("maincpu")->execute().set_input_line( | |
| 684 | 684 | if (!(command & 0x8000)) |
| 685 | 685 | return; |
| 686 | 686 |
| r17813 | r17814 | |
|---|---|---|
| 678 | 678 | we simply assert immediately if this is enabled. invasn needs this for proper |
| 679 | 679 | operations */ |
| 680 | 680 | if (zeusbase[0x80] & 0x02000000) |
| 681 | cput | |
| 681 | machine.device("maincpu")->execute().set_input_line( | |
| 682 | 682 | else |
| 683 | cput | |
| 683 | machine.device("maincpu")->execute().set_input_line( | |
| 684 | 684 | break; |
| 685 | 685 | |
| 686 | 686 | case 0x84: |
| r17813 | r17814 | |
|---|---|---|
| 353 | 353 | { |
| 354 | 354 | if (K001005_fifo_read_ptr < 0x3ff) |
| 355 | 355 | { |
| 356 | // | |
| 356 | // | |
| 357 | 357 | sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE); |
| 358 | 358 | } |
| 359 | 359 | else |
| 360 | 360 | { |
| 361 | // | |
| 361 | // | |
| 362 | 362 | sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE); |
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | else |
| 366 | 366 | { |
| 367 | // | |
| 367 | // | |
| 368 | 368 | sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE); |
| 369 | 369 | } |
| 370 | 370 | |
| r17813 | r17814 | |
| 406 | 406 | { |
| 407 | 407 | if (K001005_fifo_write_ptr < 0x400) |
| 408 | 408 | { |
| 409 | // | |
| 409 | // | |
| 410 | 410 | sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE); |
| 411 | 411 | } |
| 412 | 412 | else |
| 413 | 413 | { |
| 414 | // | |
| 414 | // | |
| 415 | 415 | sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE); |
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | else |
| 419 | 419 | { |
| 420 | // | |
| 420 | // | |
| 421 | 421 | sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE); |
| 422 | 422 | } |
| 423 | 423 | |
| r17813 | r17814 | |
| 1559 | 1559 | draw_7segment_led(bitmap, 3, 3, gticlub_led_reg[0]); |
| 1560 | 1560 | draw_7segment_led(bitmap, 9, 3, gticlub_led_reg[1]); |
| 1561 | 1561 | |
| 1562 | // | |
| 1562 | // | |
| 1563 | 1563 | sharc_set_flag_input(screen.machine().device("dsp"), 1, ASSERT_LINE); |
| 1564 | 1564 | return 0; |
| 1565 | 1565 | } |
| r17813 | r17814 | |
|---|---|---|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | if (ret) |
| 407 | cput | |
| 407 | machine.device("maincpu")->execute().set_input_line( | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | VIDEO_START( pce ) |
| r17813 | r17814 | |
| 604 | 604 | case 0x00: |
| 605 | 605 | temp = vdc[which].status; |
| 606 | 606 | vdc[which].status &= ~(VDC_VD | VDC_DV | VDC_DS | VDC_RR | VDC_OR | VDC_CR); |
| 607 | cput | |
| 607 | machine.device("maincpu")->execute().set_input_line( | |
| 608 | 608 | break; |
| 609 | 609 | |
| 610 | 610 | case 0x02: |
| r17813 | r17814 | |
| 880 | 880 | { |
| 881 | 881 | /* note: flag is set only if irq is taken, Mizubaku Daibouken relies on this behaviour */ |
| 882 | 882 | vdc[which].status |= VDC_OR; |
| 883 | cput | |
| 883 | machine.device("maincpu")->execute().set_input_line( | |
| 884 | 884 | } |
| 885 | 885 | continue; /* Should cause an interrupt */ |
| 886 | 886 | } |
| r17813 | r17814 | |
| 923 | 923 | else if (drawn[pixel_x] == 2) |
| 924 | 924 | { |
| 925 | 925 | if(vdc[which].vdc_data[CR].w & CR_CC) |
| 926 | cput | |
| 926 | machine.device("maincpu")->execute().set_input_line( | |
| 927 | 927 | vdc[which].status |= VDC_CR; |
| 928 | 928 | } |
| 929 | 929 | } |
| r17813 | r17814 | |
| 973 | 973 | else if ( drawn[pixel_x] == 2 ) |
| 974 | 974 | { |
| 975 | 975 | if(vdc[which].vdc_data[CR].w & CR_CC) |
| 976 | cput | |
| 976 | machine.device("maincpu")->execute().set_input_line( | |
| 977 | 977 | vdc[which].status |= VDC_CR; |
| 978 | 978 | } |
| 979 | 979 | } |
| r17813 | r17814 | |
| 998 | 998 | { |
| 999 | 999 | /* note: flag is set only if irq is taken, Mizubaku Daibouken relies on this behaviour */ |
| 1000 | 1000 | vdc[which].status |= VDC_OR; |
| 1001 | cput | |
| 1001 | machine.device("maincpu")->execute().set_input_line( | |
| 1002 | 1002 | } |
| 1003 | 1003 | } |
| 1004 | 1004 | else |
| r17813 | r17814 | |
| 1032 | 1032 | else if ( drawn[pixel_x] == 2 ) |
| 1033 | 1033 | { |
| 1034 | 1034 | if(vdc[which].vdc_data[CR].w & CR_CC) |
| 1035 | cput | |
| 1035 | machine.device("maincpu")->execute().set_input_line( | |
| 1036 | 1036 | vdc[which].status |= VDC_CR; |
| 1037 | 1037 | } |
| 1038 | 1038 | } |
| r17813 | r17814 | |
| 1087 | 1087 | vdc[which].vdc_data[LENR].w = len; |
| 1088 | 1088 | if(dvc) |
| 1089 | 1089 | { |
| 1090 | cput | |
| 1090 | machine.device("maincpu")->execute().set_input_line( | |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | 1093 | } |
| r17813 | r17814 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | static TIMER_CALLBACK( gen_ext1_int ) |
| 98 | 98 | { |
| 99 | cput | |
| 99 | machine.device("maincpu")->execute().set_input_line( | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| r17813 | r17814 | |
| 158 | 158 | |
| 159 | 159 | /* clear the IRQ on offset 0 */ |
| 160 | 160 | else if (offset == 0) |
| 161 | cput | |
| 161 | machine().device("maincpu")->execute().set_input_line( | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 |
| r17813 | r17814 | |
|---|---|---|
| 1220 | 1220 | |
| 1221 | 1221 | memcpy(state->m_buffered_spriteram, state->m_spriteram, state->m_spriteram.bytes()); |
| 1222 | 1222 | memcpy(state->m_buffered_spritesizeram16, state->m_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); |
| 1223 | | |
| 1223 | | |
| 1224 | 1224 | } |
| 1225 | 1225 | } |
| r17813 | r17814 | |
|---|---|---|
| 591 | 591 | { |
| 592 | 592 | /* port 0: irq ack */ |
| 593 | 593 | case 0: |
| 594 | cput | |
| 594 | machine().device("maincpu")->execute().set_input_line( | |
| 595 | 595 | break; |
| 596 | 596 | |
| 597 | 597 | /* port 1: background control |
| r17813 | r17814 | |
|---|---|---|
| 259 | 259 | |
| 260 | 260 | static TIMER_CALLBACK( int_timer_callback ) |
| 261 | 261 | { |
| 262 | cput | |
| 262 | machine.device("maincpu")->execute().set_input_line( | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 |
| r17813 | r17814 | |
|---|---|---|
| 120 | 120 | if ((oldword & 8) && !(newword & 8) && space.machine().primary_screen->vpos() != 261) |
| 121 | 121 | { |
| 122 | 122 | logerror("Suspending time! (scanline = %d)\n", space.machine().primary_screen->vpos()); |
| 123 | | |
| 123 | | |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 |
| r17813 | r17814 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | static TIMER_CALLBACK( cchasm_refresh_end ) |
| 23 | 23 | { |
| 24 | cput | |
| 24 | machine.device("maincpu")->execute().set_input_line | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | static void cchasm_refresh (running_machine &machine) |
| r17813 | r17814 | |
| 113 | 113 | cchasm_refresh(machine()); |
| 114 | 114 | break; |
| 115 | 115 | case 0xf7: |
| 116 | cput | |
| 116 | machine().device("maincpu")->execute().set_input_line | |
| 117 | 117 | break; |
| 118 | 118 | } |
| 119 | 119 | } |
| r17813 | r17814 | |
|---|---|---|
| 375 | 375 | case 0x2208/2 : break; // watchdog reset |
| 376 | 376 | |
| 377 | 377 | /* Not sure about this one.. */ |
| 378 | case 0x2308/2 : cputag_set_input_line(machine(), "cpu2", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 379 | cputag_set_input_line(machine(), "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 380 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 378 | case 0x2308/2 : machine().device("cpu2")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 379 | machine().device("cpu3")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 380 | machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 381 | 381 | break; |
| 382 | 382 | |
| 383 | 383 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r17813 | r17814 | |
| 463 | 463 | |
| 464 | 464 | case 0x2300/2 : /* Sound CPU: reads latch during int 4, and stores command */ |
| 465 | 465 | soundlatch_word_w(space, 0, new_data, 0xffff); |
| 466 | | |
| 466 | | |
| 467 | 467 | break; |
| 468 | 468 | |
| 469 | 469 | /* Not sure about this one.. */ |
| 470 | case 0x2308/2 : cputag_set_input_line(machine(), "cpu2", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 471 | cputag_set_input_line(machine(), "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 472 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 470 | case 0x2308/2 : machine().device("cpu2")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 471 | machine().device("cpu3")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 472 | machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 473 | 473 | break; |
| 474 | 474 | |
| 475 | 475 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r17813 | r17814 | |
| 578 | 578 | |
| 579 | 579 | /* Usually written in sequence, but not always */ |
| 580 | 580 | case 0x0008/2 : soundlatch_word_w(space, 0, new_data, 0xffff); break; |
| 581 | case 0x0018/2 : | |
| 581 | case 0x0018/2 : | |
| 582 | 582 | |
| 583 | 583 | case 0x0010/2 : break; |
| 584 | 584 | |
| r17813 | r17814 | |
| 598 | 598 | case 0x2208/2 : break; // watchdog reset |
| 599 | 599 | |
| 600 | 600 | /* Not sure about this one. Values: $10 then 0, $7 then 0 */ |
| 601 | case 0x2308/2 : cputag_set_input_line(machine(), "cpu2", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 602 | cputag_set_input_line(machine(), "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 603 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE ); | |
| 601 | case 0x2308/2 : machine().device("cpu2")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 602 | machine().device("cpu3")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 603 | machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE ); | |
| 604 | 604 | break; |
| 605 | 605 | |
| 606 | 606 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r17813 | r17814 | |
| 621 | 621 | if (ACCESSING_BITS_0_7) |
| 622 | 622 | { |
| 623 | 623 | if((old_data & 4) && ((new_data & 4) == 0)) |
| 624 | cput | |
| 624 | machine().device("cpu5")->execute().set_input_line( | |
| 625 | 625 | if((old_data & 2) && ((new_data & 2) == 0)) |
| 626 | cput | |
| 626 | machine().device("cpu5")->execute().set_input_line( | |
| 627 | 627 | } |
| 628 | 628 | break; |
| 629 | 629 |
| r17813 | r17814 | |
|---|---|---|
| 224 | 224 | /* sound CPU reset */ |
| 225 | 225 | if (diff & 0x0080) |
| 226 | 226 | { |
| 227 | | |
| 227 | | |
| 228 | 228 | if (!(newselect & 0x0080)) atarigen_sound_reset(space->machine()); |
| 229 | 229 | } |
| 230 | 230 |
| r17813 | r17814 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | if (scanline != -1) |
| 43 | 43 | { |
| 44 | cput | |
| 44 | machine.device("maincpu")->execute().set_input_line( | |
| 45 | 45 | state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline + 1), scanline); |
| 46 | 46 | machine.scheduler().timer_set(attotime::from_hz(25000000), FUNC(scanline_timer_cb), -1); |
| 47 | 47 | } |
| 48 | 48 | else |
| 49 | cput | |
| 49 | machine.device("maincpu")->execute().set_input_line( | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 |
| r17813 | r17814 | |
|---|---|---|
| 379 | 379 | |
| 380 | 380 | static TIMER_CALLBACK( interrupt_off ) |
| 381 | 381 | { |
| 382 | cput | |
| 382 | machine.device("maincpu")->execute().set_input_line( | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | |
| r17813 | r17814 | |
| 393 | 393 | /* bit 0 controls the interrupt mode: mode 0 means assert until acknowledged */ |
| 394 | 394 | if ((state->m_interrupt_enabl & 0x01) == 0) |
| 395 | 395 | { |
| 396 | cput | |
| 396 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 397 | 397 | state->m_intoff_timer->adjust(machine.primary_screen->time_until_pos(vfeedback)); |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /* mode 1 means assert for 1 instruction */ |
| 401 | 401 | else |
| 402 | 402 | { |
| 403 | cput | |
| 403 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 404 | 404 | state->m_intoff_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1)); |
| 405 | 405 | } |
| 406 | 406 | |
| r17813 | r17814 | |
| 434 | 434 | /* bit 2 controls the interrupt mode: mode 0 means assert until acknowledged */ |
| 435 | 435 | if ((state->m_interrupt_enabl & 0x04) == 0) |
| 436 | 436 | { |
| 437 | cput | |
| 437 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 438 | 438 | machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_end(), FUNC(interrupt_off)); |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /* mode 1 means assert for 1 instruction */ |
| 442 | 442 | else |
| 443 | 443 | { |
| 444 | cput | |
| 444 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 445 | 445 | machine.scheduler().timer_set(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(interrupt_off)); |
| 446 | 446 | } |
| 447 | 447 | } |
| r17813 | r17814 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | static void ppu_irq_1( device_t *device, int *ppu_regs ) |
| 21 | 21 | { |
| 22 | | |
| 22 | | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | static void ppu_irq_2( device_t *device, int *ppu_regs ) |
| 26 | 26 | { |
| 27 | | |
| 27 | | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /* our ppu interface */ |
| r17813 | r17814 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | victory_state *state = machine.driver_data<victory_state>(); |
| 77 | 77 | if (state->m_vblank_irq || state->m_fgcoll || (state->m_bgcoll && (state->m_video_control & 0x20))) |
| 78 | cput | |
| 78 | machine.device("maincpu")->execute().set_input_line( | |
| 79 | 79 | else |
| 80 | cput | |
| 80 | machine.device("maincpu")->execute().set_input_line( | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r17813 | r17814 | |
|---|---|---|
| 45 | 45 | /* bit 4 resets the sound CPU */ |
| 46 | 46 | if (data & 0x10) |
| 47 | 47 | { |
| 48 | | |
| 48 | | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /* bit 5 enables starfield */ |
| r17813 | r17814 | |
|---|---|---|
| 12 | 12 | INTERRUPT_GEN( esripsys_vblank_irq ) |
| 13 | 13 | { |
| 14 | 14 | esripsys_state *state = device->machine().driver_data<esripsys_state>(); |
| 15 | | |
| 15 | | |
| 16 | 16 | state->m_frame_vbl = 0; |
| 17 | 17 | } |
| 18 | 18 | |
| r17813 | r17814 | |
| 24 | 24 | if (state->m_video_firq) |
| 25 | 25 | { |
| 26 | 26 | state->m_video_firq = 0; |
| 27 | cput | |
| 27 | machine.device("game_cpu")->execute().set_input_line( | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /* Not sure if this is totally accurate - I couldn't find the circuit that generates the FIRQs! */ |
| 31 | 31 | if (!(v % 6) && v && state->m_video_firq_en && v < ESRIPSYS_VBLANK_START) |
| 32 | 32 | { |
| 33 | 33 | state->m_video_firq = 1; |
| 34 | cput | |
| 34 | machine.device("game_cpu")->execute().set_input_line( | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /* Adjust for next scanline */ |
| r17813 | r17814 | |
|---|---|---|
| 229 | 229 | { |
| 230 | 230 | exidy440_state *state = machine.driver_data<exidy440_state>(); |
| 231 | 231 | if (state->m_firq_vblank || (state->m_firq_enable && state->m_firq_beam)) |
| 232 | cput | |
| 232 | machine.device("maincpu")->execute().set_input_line( | |
| 233 | 233 | else |
| 234 | cput | |
| 234 | machine.device("maincpu")->execute().set_input_line( | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static TIMER_CALLBACK( interrupt_callback ) |
| 35 | 35 | { |
| 36 | 36 | tx1_state *state = machine.driver_data<tx1_state>(); |
| 37 | cput | |
| 37 | machine.device("main_cpu")->execute().set_input_line_and_vector( | |
| 38 | 38 | state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); |
| 39 | 39 | } |
| 40 | 40 | |
| r17813 | r17814 | |
| 2901 | 2901 | } |
| 2902 | 2902 | case 0xe0: |
| 2903 | 2903 | { |
| 2904 | | |
| 2904 | | |
| 2905 | 2905 | vregs.flags = data; |
| 2906 | 2906 | break; |
| 2907 | 2907 | } |
| r17813 | r17814 | |
|---|---|---|
| 370 | 370 | |
| 371 | 371 | /* bit 4 resets sound CPU (active low) */ |
| 372 | 372 | if (data & 0x10) |
| 373 | | |
| 373 | | |
| 374 | 374 | else |
| 375 | | |
| 375 | | |
| 376 | 376 | |
| 377 | 377 | /* bit 5 = "bank"? */ |
| 378 | 378 | } |
| r17813 | r17814 | |
|---|---|---|
| 119 | 119 | WRITE16_MEMBER(micro3d_state::micro3d_creg_w) |
| 120 | 120 | { |
| 121 | 121 | if (~data & 0x80) |
| 122 | c | |
| 122 | machine().device("vgb")->execute().set_input_line( | |
| 123 | 123 | |
| 124 | 124 | m_creg = data; |
| 125 | 125 | } |
| r17813 | r17814 | |
| 669 | 669 | { |
| 670 | 670 | UINT32 dpram_r_addr = (((data & 0x01ff) << 1) | m_dpram_bank); |
| 671 | 671 | m_pipe_data = m_draw_dpram[dpram_r_addr]; |
| 672 | c | |
| 672 | machine().device("drmath")->execute().set_input_line( | |
| 673 | 673 | break; |
| 674 | 674 | } |
| 675 | 675 | case 0x80: |
| r17813 | r17814 | |
| 697 | 697 | /* TODO: We shouldn't need this extra buffer - is there some sort of sync missing? */ |
| 698 | 698 | memcpy(m_frame_buffers[m_drawing_buffer], m_tmp_buffer, 512*1024*2); |
| 699 | 699 | m_drawing_buffer ^= 1; |
| 700 | c | |
| 700 | machine().device("vgb")->execute().set_input_line( | |
| 701 | 701 | break; |
| 702 | 702 | } |
| 703 | 703 | default: |
| r17813 | r17814 | |
| 750 | 750 | |
| 751 | 751 | READ32_MEMBER(micro3d_state::micro3d_pipe_r) |
| 752 | 752 | { |
| 753 | c | |
| 753 | machine().device("drmath")->execute().set_input_line( | |
| 754 | 754 | return m_pipe_data; |
| 755 | 755 | } |
| 756 | 756 |
| r17813 | r17814 | |
|---|---|---|
| 61 | 61 | static void ppu_irq( device_t *device, int *ppu_regs ) |
| 62 | 62 | { |
| 63 | 63 | playch10_state *state = device->machine().driver_data<playch10_state>(); |
| 64 | | |
| 64 | | |
| 65 | 65 | state->m_pc10_int_detect = 1; |
| 66 | 66 | } |
| 67 | 67 |
| r17813 | r17814 | |
|---|---|---|
| 1065 | 1065 | { |
| 1066 | 1066 | LOG((" @cycle #%3d issue DLI\n", cycle(machine))); |
| 1067 | 1067 | antic.r.nmist |= DLI_NMI; |
| 1068 | cput | |
| 1068 | machine.device("maincpu")->execute().set_input_line( | |
| 1069 | 1069 | } |
| 1070 | 1070 | else |
| 1071 | 1071 | { |
| r17813 | r17814 | |
| 1528 | 1528 | LOG((" cause VBL NMI\n")); |
| 1529 | 1529 | /* set the VBL NMI status bit */ |
| 1530 | 1530 | antic.r.nmist |= VBL_NMI; |
| 1531 | cput | |
| 1531 | machine.device("maincpu")->execute().set_input_line( | |
| 1532 | 1532 | } |
| 1533 | 1533 | } |
| 1534 | 1534 |
| r17813 | r17814 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | static WRITE8_HANDLER( unknown_w ) |
| 211 | 211 | { |
| 212 | | |
| 212 | | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /////////////////////////////////////////////////////////////////////////// |
| r17813 | r17814 | |
| 231 | 231 | dm01.data_avail = 1; |
| 232 | 232 | |
| 233 | 233 | //pulse IRQ line |
| 234 | c | |
| 234 | machine.device("matrix")->execute().set_input_line( | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /////////////////////////////////////////////////////////////////////////// |
| r17813 | r17814 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | if (state->m_lightpen_port & 2) |
| 85 | 85 | { |
| 86 | cput | |
| 86 | machine.device("maincpu")->execute().set_input_line( | |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 |
| r17813 | r17814 | |
|---|---|---|
| 428 | 428 | |
| 429 | 429 | static TIMER_CALLBACK( sprite_timer_callback ) |
| 430 | 430 | { |
| 431 | c | |
| 431 | machine.device("mcu")->execute().set_input_line( | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | |
| r17813 | r17814 | |
| 558 | 558 | /SINT line will be reasserted in m_XSize * m_YSize cycles (RH0 signal cycles) |
| 559 | 559 | */ |
| 560 | 560 | /* 1.clear the /SINT interrupt line */ |
| 561 | c | |
| 561 | machine().device("mcu")->execute().set_input_line( | |
| 562 | 562 | |
| 563 | 563 | /* 2.assert /SINT again after this time */ |
| 564 | 564 | machine().scheduler().timer_set( attotime::from_hz(19968000/8) * ((m_XSize+1)*(m_YSize+1)), FUNC(sprite_timer_callback)); |
| r17813 | r17814 | |
|---|---|---|
| 82 | 82 | READ8_MEMBER(exidy_state::exidy_interrupt_r) |
| 83 | 83 | { |
| 84 | 84 | /* clear any interrupts */ |
| 85 | cput | |
| 85 | machine().device("maincpu")->execute().set_input_line( | |
| 86 | 86 | |
| 87 | 87 | /* return the latched condition */ |
| 88 | 88 | return m_int_condition; |
| r17813 | r17814 | |
| 269 | 269 | latch_condition(machine, param); |
| 270 | 270 | |
| 271 | 271 | /* set the IRQ line */ |
| 272 | cput | |
| 272 | machine.device("maincpu")->execute().set_input_line( | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 |
| r17813 | r17814 | |
|---|---|---|
| 438 | 438 | if (machine().device("soundcpu")) |
| 439 | 439 | { |
| 440 | 440 | if (new_data & 0x10) |
| 441 | | |
| 441 | | |
| 442 | 442 | else |
| 443 | | |
| 443 | | |
| 444 | 444 | } |
| 445 | 445 | break; |
| 446 | 446 | |
| 447 | 447 | case 0x308/2 : soundlatch_word_w(space,0,new_data,0xffff); |
| 448 | | |
| 448 | | |
| 449 | 449 | break; |
| 450 | 450 | |
| 451 | 451 | default : SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r17813 | r17814 | |
| 490 | 490 | |
| 491 | 491 | case 0x2308/2 : m_screen_flag = new_data; |
| 492 | 492 | if (new_data & 0x10) |
| 493 | | |
| 493 | | |
| 494 | 494 | else |
| 495 | | |
| 495 | | |
| 496 | 496 | break; |
| 497 | 497 | |
| 498 | 498 | case 0x8000/2 : /* Cybattler reads sound latch on irq 2 */ |
| 499 | 499 | soundlatch_word_w(space, 0, new_data, 0xffff); |
| 500 | | |
| 500 | | |
| 501 | 501 | break; |
| 502 | 502 | |
| 503 | 503 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X", offset * 2, data); |
| r17813 | r17814 | |
|---|---|---|
| 61 | 61 | static TIMER_CALLBACK( crtc_interrupt_gen ) |
| 62 | 62 | { |
| 63 | 63 | rpunch_state *state = machine.driver_data<rpunch_state>(); |
| 64 | cput | |
| 64 | machine.device("maincpu")->execute().set_input_line( | |
| 65 | 65 | if (param != 0) |
| 66 | 66 | state->m_crtc_timer->adjust(machine.primary_screen->frame_period() / param, 0, machine.primary_screen->frame_period() / param); |
| 67 | 67 | } |
| r17813 | r17814 | |
|---|---|---|
| 208 | 208 | |
| 209 | 209 | WRITE_LINE_MEMBER(sbugger_state::sbugger_interrupt) |
| 210 | 210 | { |
| 211 | cput | |
| 211 | machine().device("maincpu")->execute().set_input_line( | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | static I8156_INTERFACE(i8156_intf) |
| r17813 | r17814 | |
|---|---|---|
| 879 | 879 | if (newstate != state->m_irq_state) |
| 880 | 880 | { |
| 881 | 881 | state->m_irq_state = newstate; |
| 882 | cput | |
| 882 | machine.device("maincpu")->execute().set_input_line( | |
| 883 | 883 | } |
| 884 | 884 | } |
| 885 | 885 | |
| r17813 | r17814 | |
| 1657 | 1657 | |
| 1658 | 1658 | WRITE_LINE_MEMBER(bfcobra_state::m6809_data_irq) |
| 1659 | 1659 | { |
| 1660 | | |
| 1660 | | |
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | 1663 | static ACIA6850_INTERFACE( m6809_acia_if ) |
| r17813 | r17814 | |
|---|---|---|
| 171 | 171 | { |
| 172 | 172 | deco_mlc_state *state = timer.machine().driver_data<deco_mlc_state>(); |
| 173 | 173 | // logerror("hit scanline IRQ %d (%08x)\n", machine.primary_screen->vpos(), info.i); |
| 174 | | |
| 174 | | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | WRITE32_MEMBER(deco_mlc_state::mlc_irq_w) |
| r17813 | r17814 | |
| 182 | 182 | switch (offset*4) |
| 183 | 183 | { |
| 184 | 184 | case 0x10: /* IRQ ack. Value written doesn't matter */ |
| 185 | cput | |
| 185 | machine().device("maincpu")->execute().set_input_line( | |
| 186 | 186 | return; |
| 187 | 187 | case 0x14: /* Prepare scanline interrupt */ |
| 188 | 188 | m_raster_irq_timer->adjust(machine().primary_screen->time_until_pos(m_irq_ram[0x14/4])); |
| r17813 | r17814 | |
|---|---|---|
| 499 | 499 | int scanline = param; |
| 500 | 500 | |
| 501 | 501 | if(scanline == 224) // vblank-out irq |
| 502 | | |
| 502 | | |
| 503 | 503 | else if(scanline == 0) // vblank-in irq? |
| 504 | | |
| 504 | | |
| 505 | 505 | else if(scanline == 112) // VDP end task? (controls sprite colors in gameplay) |
| 506 | | |
| 506 | | |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | static MACHINE_RESET( galsnew ) |
| r17813 | r17814 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | m_sound_cpu_busy = 1; |
| 119 | 119 | soundlatch_byte_w(space, 0, data); |
| 120 | | |
| 120 | | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | READ8_MEMBER(mainsnk_state::sound_command_r) |
| r17813 | r17814 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | void mystston_on_scanline_interrupt(running_machine &machine) |
| 41 | 41 | { |
| 42 | cput | |
| 42 | machine.device("maincpu")->execute().set_input_line( | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER(mystston_state::irq_clear_w) |
| 47 | 47 | { |
| 48 | cput | |
| 48 | machine().device("maincpu")->execute().set_input_line( | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| r17813 | r17814 | |
| 59 | 59 | INPUT_CHANGED_MEMBER(mystston_state::coin_inserted) |
| 60 | 60 | { |
| 61 | 61 | /* coin insertion causes an NMI */ |
| 62 | cput | |
| 62 | machine().device("maincpu")->execute().set_input_line( | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 |
| r17813 | r17814 | |
|---|---|---|
| 42 | 42 | static void update_interrupts(running_machine &machine) |
| 43 | 43 | { |
| 44 | 44 | rampart_state *state = machine.driver_data<rampart_state>(); |
| 45 | cput | |
| 45 | machine.device("maincpu")->execute().set_input_line( | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 |
| r17813 | r17814 | |
|---|---|---|
| 611 | 611 | WRITE8_MEMBER(bfm_sc1_state::vid_uart_tx_w) |
| 612 | 612 | { |
| 613 | 613 | adder2_send(data); |
| 614 | c | |
| 614 | machine().device("adder2")->execute().set_input_line( | |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | /////////////////////////////////////////////////////////////////////////// |
| r17813 | r17814 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | WRITE16_MEMBER(snowbros_state::snowbros_irq4_ack_w) |
| 109 | 109 | { |
| 110 | cput | |
| 110 | machine().device("maincpu")->execute().set_input_line( | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | WRITE16_MEMBER(snowbros_state::snowbros_irq3_ack_w) |
| 114 | 114 | { |
| 115 | cput | |
| 115 | machine().device("maincpu")->execute().set_input_line( | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | WRITE16_MEMBER(snowbros_state::snowbros_irq2_ack_w) |
| 119 | 119 | { |
| 120 | cput | |
| 120 | machine().device("maincpu")->execute().set_input_line( | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static TIMER_DEVICE_CALLBACK( snowbros_irq ) |
| r17813 | r17814 | |
| 184 | 184 | if (ACCESSING_BITS_0_7) |
| 185 | 185 | { |
| 186 | 186 | soundlatch_byte_w(space, offset, data & 0xff); |
| 187 | | |
| 187 | | |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| r17813 | r17814 | |
| 330 | 330 | if (ACCESSING_BITS_0_7) |
| 331 | 331 | { |
| 332 | 332 | soundlatch_byte_w(space, offset, data & 0xff); |
| 333 | | |
| 333 | | |
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
| r17813 | r17814 | |
| 1496 | 1496 | /* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */ |
| 1497 | 1497 | static void irqhandler(device_t *device, int irq) |
| 1498 | 1498 | { |
| 1499 | | |
| 1499 | | |
| 1500 | 1500 | } |
| 1501 | 1501 | |
| 1502 | 1502 | /* SnowBros Sound */ |
| r17813 | r17814 | |
|---|---|---|
| 374 | 374 | WRITE16_MEMBER(sslam_state::powerbls_sound_w) |
| 375 | 375 | { |
| 376 | 376 | soundlatch_byte_w(space, 0, data & 0xff); |
| 377 | | |
| 377 | | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /* Memory Maps */ |
| r17813 | r17814 | |
|---|---|---|
| 158 | 158 | static void irqhandler(device_t *device, int linestate) |
| 159 | 159 | { |
| 160 | 160 | // hcastle_state *state = device->machine().driver_data<hcastle_state>(); |
| 161 | // cput | |
| 161 | // state->m_audiocpu.device(0)->execute().set_input_line( | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | static void volume_callback(device_t *device, int v) |
| r17813 | r17814 | |
|---|---|---|
| 169 | 169 | if (~data & 0x02) |
| 170 | 170 | { |
| 171 | 171 | m_port_a_in = from_main; |
| 172 | if (main_sent) c | |
| 172 | if (main_sent) machine().device("mcu")->execute().set_input_line( | |
| 173 | 173 | main_sent = 0; |
| 174 | 174 | } |
| 175 | 175 | |
| r17813 | r17814 | |
| 457 | 457 | { |
| 458 | 458 | bking_state *state = machine.driver_data<bking_state>(); |
| 459 | 459 | |
| 460 | c | |
| 460 | machine.device("mcu")->execute().set_input_line( | |
| 461 | 461 | |
| 462 | 462 | MACHINE_RESET_CALL(bking); |
| 463 | 463 |
| r17813 | r17814 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | static void skeetsht_tms_irq(device_t *device, int state) |
| 116 | 116 | { |
| 117 | | |
| 117 | | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 |
| r17813 | r17814 | |
|---|---|---|
| 81 | 81 | bit 0 = coin 1 counter |
| 82 | 82 | */ |
| 83 | 83 | |
| 84 | cputag_set_input_line(machine(), "mcu", MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE); | |
| 85 | cputag_set_input_line(machine(), "mcu", INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); | |
| 84 | machine().device("mcu")->execute().set_input_line(MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE); | |
| 85 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); | |
| 86 | 86 | |
| 87 | 87 | /* clock the coin counters */ |
| 88 | 88 | coin_counter_w(machine(), 1, ~data & 0x02); |
| r17813 | r17814 | |
|---|---|---|
| 246 | 246 | WRITE8_MEMBER(shougi_state::shougi_mcu_halt_off_w) |
| 247 | 247 | { |
| 248 | 248 | /* logerror("mcu HALT OFF"); */ |
| 249 | c | |
| 249 | machine().device("mcu")->execute().set_input_line( | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | WRITE8_MEMBER(shougi_state::shougi_mcu_halt_on_w) |
| 253 | 253 | { |
| 254 | 254 | /* logerror("mcu HALT ON"); */ |
| 255 | c | |
| 255 | machine().device("mcu")->execute().set_input_line( | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
| r17813 | r17814 | |
| 262 | 262 | m_nmi_enabled = 0; /* disable NMIs */ |
| 263 | 263 | |
| 264 | 264 | /* NMI lines are tied together on both CPUs and connected to the LS74 /Q output */ |
| 265 | cputag_set_input_line(machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE); | |
| 266 | cputag_set_input_line(machine(), "sub", INPUT_LINE_NMI, CLEAR_LINE); | |
| 265 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
| 266 | machine().device("sub")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | WRITE8_MEMBER(shougi_state::nmi_enable_w) |
| r17813 | r17814 | |
| 279 | 279 | if ( state->m_nmi_enabled == 1 ) |
| 280 | 280 | { |
| 281 | 281 | /* NMI lines are tied together on both CPUs and connected to the LS74 /Q output */ |
| 282 | cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE); | |
| 283 | cputag_set_input_line(device->machine(), "sub", INPUT_LINE_NMI, ASSERT_LINE); | |
| 282 | device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
| 283 | device->machine().device("sub")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 |
| r17813 | r17814 | |
|---|---|---|
| 410 | 410 | |
| 411 | 411 | static void voodoo_vblank_0(device_t *device, int param) |
| 412 | 412 | { |
| 413 | | |
| 413 | | |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | static void voodoo_vblank_1(device_t *device, int param) |
| r17813 | r17814 | |
| 546 | 546 | adc1213x_di_w(adc12138, 0, (data >> 1) & 0x1); |
| 547 | 547 | adc1213x_sclk_w(adc12138, 0, data & 0x1); |
| 548 | 548 | |
| 549 | | |
| 549 | | |
| 550 | 550 | mame_printf_debug("System register 1 = %02X\n", data); |
| 551 | 551 | break; |
| 552 | 552 | |
| r17813 | r17814 | |
| 581 | 581 | 0x01 = EXRGB |
| 582 | 582 | */ |
| 583 | 583 | if (data & 0x80) |
| 584 | cput | |
| 584 | machine().device("maincpu")->execute().set_input_line( | |
| 585 | 585 | if (data & 0x40) |
| 586 | cput | |
| 586 | machine().device("maincpu")->execute().set_input_line( | |
| 587 | 587 | set_cgboard_id((data >> 4) & 3); |
| 588 | 588 | break; |
| 589 | 589 | } |
| r17813 | r17814 | |
| 621 | 621 | if (mem_mask == 0xffff0000) |
| 622 | 622 | { |
| 623 | 623 | m_gn680_latch = data>>16; |
| 624 | c | |
| 624 | machine().device("gn680")->execute().set_input_line( | |
| 625 | 625 | } |
| 626 | 626 | } |
| 627 | 627 | |
| r17813 | r17814 | |
| 672 | 672 | |
| 673 | 673 | READ16_MEMBER(hornet_state::gn680_latch_r) |
| 674 | 674 | { |
| 675 | c | |
| 675 | machine().device("gn680")->execute().set_input_line( | |
| 676 | 676 | |
| 677 | 677 | return m_gn680_latch; |
| 678 | 678 | } |
| r17813 | r17814 | |
| 909 | 909 | machine.root_device().membank("bank1")->set_entry(0); |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | cput | |
| 912 | machine.device("dsp")->execute().set_input_line( | |
| 913 | 913 | |
| 914 | 914 | if (usr5) |
| 915 | 915 | machine.root_device().membank("bank5")->set_base(usr5); |
| r17813 | r17814 | |
| 933 | 933 | |
| 934 | 934 | static TIMER_CALLBACK( irq_off ) |
| 935 | 935 | { |
| 936 | cput | |
| 936 | machine.device("audiocpu")->execute().set_input_line( | |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | static void sound_irq_callback( running_machine &machine, int irq ) |
| r17813 | r17814 | |
| 941 | 941 | hornet_state *state = machine.driver_data<hornet_state>(); |
| 942 | 942 | int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; |
| 943 | 943 | |
| 944 | cput | |
| 944 | machine.device("audiocpu")->execute().set_input_line( | |
| 945 | 945 | state->m_sound_irq_timer->adjust(attotime::from_usec(1), line); |
| 946 | 946 | } |
| 947 | 947 | |
| r17813 | r17814 | |
| 1046 | 1046 | machine.root_device().membank("bank1")->configure_entries(0, machine.root_device().memregion("user3")->bytes() / 0x10000, usr3, 0x10000); |
| 1047 | 1047 | machine.root_device().membank("bank1")->set_entry(0); |
| 1048 | 1048 | } |
| 1049 | cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); | |
| 1050 | cputag_set_input_line(machine, "dsp2", INPUT_LINE_RESET, ASSERT_LINE); | |
| 1049 | machine.device("dsp")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 1050 | machine.device("dsp2")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 1051 | 1051 | |
| 1052 | 1052 | if (usr5) |
| 1053 | 1053 | { |
| r17813 | r17814 | |
|---|---|---|
| 229 | 229 | static MACHINE_RESET( ccastles ) |
| 230 | 230 | { |
| 231 | 231 | ccastles_state *state = machine.driver_data<ccastles_state>(); |
| 232 | cput | |
| 232 | machine.device("maincpu")->execute().set_input_line( | |
| 233 | 233 | state->m_irq_state = 0; |
| 234 | 234 | } |
| 235 | 235 |
| r17813 | r17814 | |
|---|---|---|
| 873 | 873 | |
| 874 | 874 | WRITE_LINE_MEMBER(mediagx_state::pc_dma_hrq_changed) |
| 875 | 875 | { |
| 876 | cput | |
| 876 | machine().device("maincpu")->execute().set_input_line( | |
| 877 | 877 | |
| 878 | 878 | /* Assert HLDA */ |
| 879 | 879 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
| 1091 | 1091 | |
| 1092 | 1092 | WRITE_LINE_MEMBER(mediagx_state::mediagx_pic8259_1_set_int_line) |
| 1093 | 1093 | { |
| 1094 | cput | |
| 1094 | machine().device("maincpu")->execute().set_input_line( | |
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | 1097 | READ8_MEMBER(mediagx_state::get_slave_ack) |
| r17813 | r17814 | |
| 1213 | 1213 | |
| 1214 | 1214 | static void set_gate_a20(running_machine &machine, int a20) |
| 1215 | 1215 | { |
| 1216 | cput | |
| 1216 | machine.device("maincpu")->execute().set_input_line( | |
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | static void keyboard_interrupt(running_machine &machine, int _state) |
| r17813 | r17814 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | static TIMER_CALLBACK( irq5_gen ) |
| 105 | 105 | { |
| 106 | cput | |
| 106 | machine.device("maincpu")->execute().set_input_line( | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 |
| r17813 | r17814 | |
|---|---|---|
| 173 | 173 | int bit = !BIT(offset, 11); |
| 174 | 174 | m_main_irq_mask = bit & 1; |
| 175 | 175 | if (!bit) |
| 176 | cput | |
| 176 | machine().device("maincpu")->execute().set_input_line( | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | WRITE8_MEMBER(gaplus_state::gaplus_irq_2_ctrl_w) |
| r17813 | r17814 | |
| 181 | 181 | int bit = offset & 1; |
| 182 | 182 | m_sub_irq_mask = bit & 1; |
| 183 | 183 | if (!bit) |
| 184 | c | |
| 184 | machine().device("sub")->execute().set_input_line( | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | WRITE8_MEMBER(gaplus_state::gaplus_irq_3_ctrl_w) |
| r17813 | r17814 | |
| 189 | 189 | int bit = !BIT(offset, 13); |
| 190 | 190 | m_sub2_irq_mask = bit & 1; |
| 191 | 191 | if (!bit) |
| 192 | c | |
| 192 | machine().device("sub2")->execute().set_input_line( | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | WRITE8_MEMBER(gaplus_state::gaplus_sreset_w) |
| 196 | 196 | { |
| 197 | 197 | int bit = !BIT(offset, 11); |
| 198 | cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 199 | cputag_set_input_line(machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 198 | machine().device("sub")->execute().set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 199 | machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 200 | 200 | mappy_sound_enable(machine().device("namco"), bit); |
| 201 | 201 | } |
| 202 | 202 | |
| r17813 | r17814 | |
| 232 | 232 | gaplus_state *state = machine.driver_data<gaplus_state>(); |
| 233 | 233 | /* on reset, VINTON is reset, while the other flags don't seem to be affected */ |
| 234 | 234 | state->m_sub_irq_mask = 0; |
| 235 | c | |
| 235 | machine.device("sub")->execute().set_input_line( | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | static TIMER_CALLBACK( namcoio_run ) |
| r17813 | r17814 | |
| 259 | 259 | device_t *io56xx = device->machine().device("56xx"); |
| 260 | 260 | |
| 261 | 261 | if(state->m_main_irq_mask) |
| 262 | | |
| 262 | | |
| 263 | 263 | |
| 264 | 264 | if (!namcoio_read_reset_line(io58xx)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 265 | 265 | device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run)); |
| r17813 | r17814 | |
| 273 | 273 | gaplus_state *state = device->machine().driver_data<gaplus_state>(); |
| 274 | 274 | |
| 275 | 275 | if(state->m_sub_irq_mask) |
| 276 | | |
| 276 | | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | static INTERRUPT_GEN( gaplus_vblank_sub2_irq ) |
| r17813 | r17814 | |
| 281 | 281 | gaplus_state *state = device->machine().driver_data<gaplus_state>(); |
| 282 | 282 | |
| 283 | 283 | if(state->m_sub2_irq_mask) |
| 284 | | |
| 284 | | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 |
| r17813 | r17814 | |
|---|---|---|
| 320 | 320 | |
| 321 | 321 | static void irqhandler(device_t *device, int irq) |
| 322 | 322 | { |
| 323 | | |
| 323 | | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 641 | 641 | |
| 642 | 642 | if ( (data & 0x0f) == 0x07 ) |
| 643 | 643 | { |
| 644 | | |
| 644 | | |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | else |
| 648 | 648 | { |
| 649 | | |
| 649 | | |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | } |
| r17813 | r17814 | |
|---|---|---|
| 21 | 21 | int scanline = param; |
| 22 | 22 | |
| 23 | 23 | if(scanline == 240) // vblank-out irq |
| 24 | cput | |
| 24 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 25 | 25 | |
| 26 | 26 | if(scanline == 0) // unknown irq event |
| 27 | cput | |
| 27 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 |
| r17813 | r17814 | |
|---|---|---|
| 129 | 129 | int scanline = param; |
| 130 | 130 | |
| 131 | 131 | /* IRQ is set by /32V */ |
| 132 | cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 133 | cputag_set_input_line(machine, "audiocpu", M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 132 | machine.device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 133 | machine.device("audiocpu")->execute().set_input_line(M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
| 134 | 134 | |
| 135 | 135 | /* set up for the next */ |
| 136 | 136 | scanline += 32; |
| r17813 | r17814 | |
| 142 | 142 | |
| 143 | 143 | WRITE8_MEMBER(jedi_state::main_irq_ack_w) |
| 144 | 144 | { |
| 145 | cput | |
| 145 | machine().device("maincpu")->execute().set_input_line( | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 |
| r17813 | r17814 | |
|---|---|---|
| 716 | 716 | WRITE32_MEMBER(zn_state::zn_qsound_w) |
| 717 | 717 | { |
| 718 | 718 | soundlatch_byte_w(space, 0, data); |
| 719 | | |
| 719 | | |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | DRIVER_INIT_MEMBER(zn_state,coh1000c) |
| r17813 | r17814 | |
| 1259 | 1259 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 1260 | 1260 | static void irq_handler(device_t *device, int irq) |
| 1261 | 1261 | { |
| 1262 | | |
| 1262 | | |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | static const ym2610_interface ym2610_config = |
| r17813 | r17814 | |
| 1695 | 1695 | WRITE32_MEMBER(zn_state::coh1002e_latch_w) |
| 1696 | 1696 | { |
| 1697 | 1697 | if (offset) |
| 1698 | | |
| 1698 | | |
| 1699 | 1699 | else |
| 1700 | 1700 | soundlatch_byte_w(space, 0, data); |
| 1701 | 1701 | } |
| r17813 | r17814 | |
|---|---|---|
| 701 | 701 | if (state->irq_count<300) |
| 702 | 702 | state->irq_count++; |
| 703 | 703 | else |
| 704 | | |
| 704 | | |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | static MACHINE_CONFIG_START( paradise, paradise_state ) |
| r17813 | r17814 | |
|---|---|---|
| 238 | 238 | static MACHINE_RESET( itgambl2 ) |
| 239 | 239 | { |
| 240 | 240 | /* stop the CPU, we have no code for it anyway */ |
| 241 | cput | |
| 241 | machine.device("maincpu")->execute().set_input_line( | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /* default 444 palette for debug purpose*/ |
| r17813 | r17814 | |
|---|---|---|
| 279 | 279 | |
| 280 | 280 | static TIMER_DEVICE_CALLBACK( interrupt_gen ) |
| 281 | 281 | { |
| 282 | | |
| 282 | | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | READ32_MEMBER(deco32_state::deco32_irq_controller_r) |
| r17813 | r17814 | |
| 289 | 289 | switch (offset) |
| 290 | 290 | { |
| 291 | 291 | case 2: /* Raster IRQ ACK - value read is not used */ |
| 292 | cput | |
| 292 | machine().device("maincpu")->execute().set_input_line( | |
| 293 | 293 | return 0; |
| 294 | 294 | |
| 295 | 295 | case 3: /* Irq controller |
| r17813 | r17814 | |
| 345 | 345 | WRITE32_MEMBER(deco32_state::deco32_sound_w) |
| 346 | 346 | { |
| 347 | 347 | soundlatch_byte_w(space,0,data & 0xff); |
| 348 | | |
| 348 | | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | READ32_MEMBER(deco32_state::deco32_71_r) |
| r17813 | r17814 | |
| 674 | 674 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 675 | 675 | soundlatch_byte_w(space,0,(data>>16)&0xff); |
| 676 | 676 | m_nslasher_sound_irq |= 0x02; |
| 677 | | |
| 677 | | |
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | |
| r17813 | r17814 | |
| 1017 | 1017 | { |
| 1018 | 1018 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 1019 | 1019 | m_nslasher_sound_irq &= ~0x02; |
| 1020 | | |
| 1020 | | |
| 1021 | 1021 | return soundlatch_byte_r(space,0); |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| r17813 | r17814 | |
| 1623 | 1623 | |
| 1624 | 1624 | static void sound_irq(device_t *device, int state) |
| 1625 | 1625 | { |
| 1626 | | |
| 1626 | | |
| 1627 | 1627 | } |
| 1628 | 1628 | |
| 1629 | 1629 | static void sound_irq_nslasher(device_t *device, int state) |
| r17813 | r17814 | |
| 1634 | 1634 | drvstate->m_nslasher_sound_irq |= 0x01; |
| 1635 | 1635 | else |
| 1636 | 1636 | drvstate->m_nslasher_sound_irq &= ~0x01; |
| 1637 | | |
| 1637 | | |
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | WRITE8_MEMBER(deco32_state::sound_bankswitch_w) |
| r17813 | r17814 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | static TIMER_CALLBACK( display_irq_off ) |
| 114 | 114 | { |
| 115 | cput | |
| 115 | machine.device("maincpu")->execute().set_input_line( | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static INTERRUPT_GEN( display_irq ) |
| r17813 | r17814 | |
| 487 | 487 | { |
| 488 | 488 | /* low 2 bits of gun_control seem to enable IRQs */ |
| 489 | 489 | if (gun_irq_state & gun_control & 0x03) |
| 490 | cput | |
| 490 | machine.device("maincpu")->execute().set_input_line( | |
| 491 | 491 | else |
| 492 | cput | |
| 492 | machine.device("maincpu")->execute().set_input_line( | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 |
| r17813 | r17814 | |
|---|---|---|
| 134 | 134 | int scanline = param; |
| 135 | 135 | |
| 136 | 136 | if(scanline == 240) // vblank-out irq |
| 137 | cput | |
| 137 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 138 | 138 | |
| 139 | 139 | if(scanline == 16) // vblank-in irq |
| 140 | cput | |
| 140 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static TIMER_DEVICE_CALLBACK( butasan_scanline ) |
| r17813 | r17814 | |
| 145 | 145 | int scanline = param; |
| 146 | 146 | |
| 147 | 147 | if(scanline == 248) // vblank-out irq |
| 148 | cput | |
| 148 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 149 | 149 | |
| 150 | 150 | if(scanline == 8) // vblank-in irq |
| 151 | cput | |
| 151 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /* Handler called by the YM2203 emulator when the internal timers cause an IRQ */ |
| 155 | 155 | static void irqhandler(device_t *device, int irq) |
| 156 | 156 | { |
| 157 | | |
| 157 | | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 158 | 158 | static const UINT8 black_color_entries[] = {7,15,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; |
| 159 | 159 | |
| 160 | 160 | if ( data & 0x40 ) /* bit 6 = irqack */ |
| 161 | cput | |
| 161 | machine().device("maincpu")->execute().set_input_line( | |
| 162 | 162 | |
| 163 | 163 | coin_counter_w( machine(), 0, data & 0x08 ); |
| 164 | 164 | coin_counter_w( machine(), 1, data & 0x04 ); |
| r17813 | r17814 | |
|---|---|---|
| 293 | 293 | { |
| 294 | 294 | /* pressing the service switch sends an NMI */ |
| 295 | 295 | if (newval) |
| 296 | cput | |
| 296 | machine().device("maincpu")->execute().set_input_line( | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
| r17813 | r17814 | |
| 310 | 310 | { |
| 311 | 311 | m_int_enabled = data & 1; |
| 312 | 312 | if (!m_int_enabled) |
| 313 | cput | |
| 313 | machine().device("maincpu")->execute().set_input_line( | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 |
| r17813 | r17814 | |
|---|---|---|
| 196 | 196 | WRITE16_MEMBER(tomcat_state::tomcat_irqclr_w) |
| 197 | 197 | { |
| 198 | 198 | // Clear IRQ Latch (Address Strobe) |
| 199 | cput | |
| 199 | machine().device("maincpu")->execute().set_input_line( | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | READ16_MEMBER(tomcat_state::tomcat_inputs2_r) |
| r17813 | r17814 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | WRITE8_MEMBER(shangkid_state::shangkid_bbx_enable_w) |
| 65 | 65 | { |
| 66 | c | |
| 66 | machine().device("bbx")->execute().set_input_line( | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | WRITE8_MEMBER(shangkid_state::shangkid_cpu_reset_w) |
| 70 | 70 | { |
| 71 | 71 | if( data == 0 ) |
| 72 | 72 | { |
| 73 | c | |
| 73 | machine().device("bbx")->execute().set_input_line( | |
| 74 | 74 | } |
| 75 | 75 | else if( data == 1 ) |
| 76 | 76 | { |
| 77 | cput | |
| 77 | machine().device("maincpu")->execute().set_input_line( | |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
| r17813 | r17814 | |
| 89 | 89 | { |
| 90 | 90 | if( data == 0x01 ) |
| 91 | 91 | /* 0->1 transition triggers interrupt on Sound CPU */ |
| 92 | | |
| 92 | | |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| r17813 | r17814 | |
| 99 | 99 | { |
| 100 | 100 | if( data == 0x01 ) |
| 101 | 101 | /* 0->1 transition triggers interrupt on Sound CPU */ |
| 102 | | |
| 102 | | |
| 103 | 103 | } |
| 104 | 104 | else |
| 105 | 105 | membank("bank2")->set_entry(data ? 0 : 1); |
| r17813 | r17814 | |
| 137 | 137 | |
| 138 | 138 | static MACHINE_RESET( chinhero ) |
| 139 | 139 | { |
| 140 | c | |
| 140 | machine.device("bbx")->execute().set_input_line( | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static MACHINE_RESET( shangkid ) |
| 144 | 144 | { |
| 145 | c | |
| 145 | machine.device("bbx")->execute().set_input_line( | |
| 146 | 146 | |
| 147 | 147 | machine.root_device().membank("bank1")->set_entry(0); |
| 148 | 148 | machine.root_device().membank("bank2")->set_entry(0); |
| r17813 | r17814 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | WRITE8_MEMBER(fastfred_state::imago_dma_irq_w) |
| 134 | 134 | { |
| 135 | cput | |
| 135 | machine().device("maincpu")->execute().set_input_line( | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | WRITE8_MEMBER(fastfred_state::imago_sprites_bank_w) |
| r17813 | r17814 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | /* clear coin interrupt */ |
| 113 | 113 | if (data & 0x04) |
| 114 | c | |
| 114 | machine().device("mcu")->execute().set_input_line( | |
| 115 | 115 | |
| 116 | 116 | /* AUDMUTE */ |
| 117 | 117 | machine().sound().system_enable((data >> 5) & 1); |
| 118 | 118 | |
| 119 | 119 | /* RES600 */ |
| 120 | 120 | if (diff & 0x10) |
| 121 | cput | |
| 121 | machine().device("maincpu")->execute().set_input_line( | |
| 122 | 122 | |
| 123 | 123 | /* latch for lamps */ |
| 124 | 124 | if ((diff & 0x40) && !(data & 0x40)) |
| r17813 | r17814 | |
| 260 | 260 | INPUT_CHANGED_MEMBER(maxaflex_state::coin_inserted) |
| 261 | 261 | { |
| 262 | 262 | if (!newval) |
| 263 | c | |
| 263 | machine().device("mcu")->execute().set_input_line( | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | int atari_input_disabled(running_machine &machine) |
| r17813 | r17814 | |
|---|---|---|
| 146 | 146 | WRITE8_MEMBER(punchout_state::punchout_2a03_reset_w) |
| 147 | 147 | { |
| 148 | 148 | if (data & 1) |
| 149 | | |
| 149 | | |
| 150 | 150 | else |
| 151 | | |
| 151 | | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 |
| r17813 | r17814 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | WRITE16_MEMBER(xorworld_state::xorworld_irq2_ack_w) |
| 72 | 72 | { |
| 73 | cput | |
| 73 | machine().device("maincpu")->execute().set_input_line( | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | WRITE16_MEMBER(xorworld_state::xorworld_irq6_ack_w) |
| 77 | 77 | { |
| 78 | cput | |
| 78 | machine().device("maincpu")->execute().set_input_line( | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static ADDRESS_MAP_START( xorworld_map, AS_PROGRAM, 16, xorworld_state ) |
| r17813 | r17814 | |
|---|---|---|
| 217 | 217 | WRITE8_MEMBER(cclimber_state::swimmer_sh_soundlatch_w) |
| 218 | 218 | { |
| 219 | 219 | soundlatch_byte_w(space,offset,data); |
| 220 | cput | |
| 220 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 |
| r17813 | r17814 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | WRITE8_MEMBER(cloak_state::cloak_irq_reset_0_w) |
| 144 | 144 | { |
| 145 | cput | |
| 145 | machine().device("maincpu")->execute().set_input_line( | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | WRITE8_MEMBER(cloak_state::cloak_irq_reset_1_w) |
| 149 | 149 | { |
| 150 | c | |
| 150 | machine().device("slave")->execute().set_input_line( | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | WRITE8_MEMBER(cloak_state::cloak_nvram_enable_w) |
| r17813 | r17814 | |
|---|---|---|
| 107 | 107 | static void update_interrupts(running_machine &machine) |
| 108 | 108 | { |
| 109 | 109 | foodf_state *state = machine.driver_data<foodf_state>(); |
| 110 | cputag_set_input_line(machine, "maincpu", 1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 111 | cputag_set_input_line(machine, "maincpu", 2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 112 | cputag_set_input_line(machine, "maincpu", 3, state->m_scanline_int_state && state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 110 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 111 | machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 112 | machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state && state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 |
| r17813 | r17814 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | WRITE_LINE_MEMBER(forte2_state::vdp_interrupt) |
| 99 | 99 | { |
| 100 | cput | |
| 100 | machine().device("maincpu")->execute().set_input_line( | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static TMS9928A_INTERFACE(forte2_tms9928a_interface) |
| r17813 | r17814 | |
|---|---|---|
| 154 | 154 | if (ACCESSING_BITS_8_15) |
| 155 | 155 | { |
| 156 | 156 | soundlatch_byte_w(space, 0, (data & 0xff00) >> 8 ); |
| 157 | | |
| 157 | | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 |
| r17813 | r17814 | |
|---|---|---|
| 531 | 531 | else if (offset == 1) |
| 532 | 532 | { |
| 533 | 533 | soundlatch_byte_w(space, offset, data & 0xff); |
| 534 | | |
| 534 | | |
| 535 | 535 | } |
| 536 | 536 | } |
| 537 | 537 | |
| r17813 | r17814 | |
| 572 | 572 | } |
| 573 | 573 | else if (offset == 1) |
| 574 | 574 | { |
| 575 | cput | |
| 575 | machine().device("maincpu")->execute().set_input_line( | |
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 |
| r17813 | r17814 | |
|---|---|---|
| 102 | 102 | WRITE8_MEMBER(wc90_state::wc90_sound_command_w) |
| 103 | 103 | { |
| 104 | 104 | soundlatch_byte_w(space, offset, data); |
| 105 | | |
| 105 | | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| r17813 | r17814 | |
| 292 | 292 | /* handler called by the 2608 emulator when the internal timers cause an IRQ */ |
| 293 | 293 | static void irqhandler(device_t *device, int irq) |
| 294 | 294 | { |
| 295 | | |
| 295 | | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | static const ym2608_interface ym2608_config = |
| r17813 | r17814 | |
|---|---|---|
| 138 | 138 | static void update_interrupts(running_machine &machine) |
| 139 | 139 | { |
| 140 | 140 | gauntlet_state *state = machine.driver_data<gauntlet_state>(); |
| 141 | cputag_set_input_line(machine, "maincpu", 4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 142 | cputag_set_input_line(machine, "maincpu", 6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 141 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 142 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| r17813 | r17814 | |
| 210 | 210 | |
| 211 | 211 | if ((oldword ^ m_sound_reset_val) & 1) |
| 212 | 212 | { |
| 213 | | |
| 213 | | |
| 214 | 214 | atarigen_sound_reset(machine()); |
| 215 | 215 | if (m_sound_reset_val & 1) |
| 216 | 216 | { |
| r17813 | r17814 | |
|---|---|---|
| 220 | 220 | WRITE32_MEMBER(ms32_state::ms32_sound_w) |
| 221 | 221 | { |
| 222 | 222 | soundlatch_byte_w(space, 0, data & 0xff); |
| 223 | | |
| 223 | | |
| 224 | 224 | |
| 225 | 225 | // give the Z80 time to respond |
| 226 | 226 | device_spin_until_time(&space.device(), attotime::from_usec(40)); |
| r17813 | r17814 | |
| 233 | 233 | |
| 234 | 234 | WRITE32_MEMBER(ms32_state::reset_sub_w) |
| 235 | 235 | { |
| 236 | if(data) | |
| 236 | if(data) | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| r17813 | r17814 | |
| 1292 | 1292 | { |
| 1293 | 1293 | ms32_state *state = machine.driver_data<ms32_state>(); |
| 1294 | 1294 | state->m_irqreq = 0; |
| 1295 | cput | |
| 1295 | machine.device("maincpu")->execute().set_input_line( | |
| 1296 | 1296 | device_set_irq_callback(machine.device("maincpu"), irq_callback); |
| 1297 | 1297 | } |
| 1298 | 1298 | |
| r17813 | r17814 | |
| 1300 | 1300 | { |
| 1301 | 1301 | ms32_state *state = machine.driver_data<ms32_state>(); |
| 1302 | 1302 | state->m_irqreq |= (1<<level); |
| 1303 | cput | |
| 1303 | machine.device("maincpu")->execute().set_input_line( | |
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | /* TODO: fix this arrangement (derived from old deprecat lib) */ |
| r17813 | r17814 | |
| 1346 | 1346 | |
| 1347 | 1347 | READ8_MEMBER(ms32_state::latch_r) |
| 1348 | 1348 | { |
| 1349 | | |
| 1349 | | |
| 1350 | 1350 | return soundlatch_byte_r(space,0)^0xff; |
| 1351 | 1351 | } |
| 1352 | 1352 |
| r17813 | r17814 | |
|---|---|---|
| 33 | 33 | return; |
| 34 | 34 | case 8: /* Sound CPU write */ |
| 35 | 35 | soundlatch_byte_w(space, 0, data & 0xff); |
| 36 | | |
| 36 | | |
| 37 | 37 | return; |
| 38 | 38 | case 0xa: /* IRQ Ack (VBL) */ |
| 39 | 39 | return; |
| r17813 | r17814 | |
| 224 | 224 | |
| 225 | 225 | static void sound_irq(device_t *device, int state) |
| 226 | 226 | { |
| 227 | | |
| 227 | | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | WRITE16_MEMBER(deniam_state::deniam_irq_ack_w) |
| 78 | 78 | { |
| 79 | cput | |
| 79 | machine().device("maincpu")->execute().set_input_line( | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static ADDRESS_MAP_START( deniam16b_map, AS_PROGRAM, 16, deniam_state ) |
| r17813 | r17814 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | READ8_MEMBER(redalert_state::redalert_interrupt_clear_r) |
| 121 | 121 | { |
| 122 | cput | |
| 122 | machine().device("maincpu")->execute().set_input_line( | |
| 123 | 123 | |
| 124 | 124 | /* the result never seems to be actually used */ |
| 125 | 125 | return machine().primary_screen->vpos(); |
| r17813 | r17814 | |
| 134 | 134 | |
| 135 | 135 | READ8_MEMBER(redalert_state::panther_interrupt_clear_r) |
| 136 | 136 | { |
| 137 | cput | |
| 137 | machine().device("maincpu")->execute().set_input_line( | |
| 138 | 138 | |
| 139 | 139 | return ioport("STICK0")->read(); |
| 140 | 140 | } |
| r17813 | r17814 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | static void big10_vdp_interrupt(device_t *, v99x8_device &device, int i) |
| 88 | 88 | { |
| 89 | | |
| 89 | | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static TIMER_DEVICE_CALLBACK( big10_interrupt ) |
| r17813 | r17814 | |
|---|---|---|
| 46 | 46 | break; |
| 47 | 47 | case 6: /* 6502 sound cpu */ |
| 48 | 48 | soundlatch_byte_w(space, 0, data & 0xff); |
| 49 | | |
| 49 | | |
| 50 | 50 | break; |
| 51 | 51 | default: |
| 52 | 52 | logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",space.device().safe_pc(),data,0x30c010+offset); |
| r17813 | r17814 | |
| 202 | 202 | |
| 203 | 203 | static void irqhandler(device_t *device, int linestate) |
| 204 | 204 | { |
| 205 | | |
| 205 | | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 209 | 209 | WRITE16_MEMBER(wwfsstar_state::wwfsstar_soundwrite) |
| 210 | 210 | { |
| 211 | 211 | soundlatch_byte_w(space, 1, data & 0xff); |
| 212 | | |
| 212 | | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | WRITE16_MEMBER(wwfsstar_state::wwfsstar_flipscreen_w) |
| r17813 | r17814 | |
| 220 | 220 | WRITE16_MEMBER(wwfsstar_state::wwfsstar_irqack_w) |
| 221 | 221 | { |
| 222 | 222 | if (offset == 0) |
| 223 | cput | |
| 223 | machine().device("maincpu")->execute().set_input_line( | |
| 224 | 224 | |
| 225 | 225 | else |
| 226 | cput | |
| 226 | machine().device("maincpu")->execute().set_input_line( | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /* |
| r17813 | r17814 | |
| 260 | 260 | { |
| 261 | 261 | if (scanline > 0) |
| 262 | 262 | timer.machine().primary_screen->update_partial(scanline - 1); |
| 263 | | |
| 263 | | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /* Vblank is raised on scanline 240 */ |
| 267 | 267 | if (scanline == 240) |
| 268 | 268 | { |
| 269 | 269 | timer.machine().primary_screen->update_partial(scanline - 1); |
| 270 | | |
| 270 | | |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
| r17813 | r17814 | |
| 409 | 409 | |
| 410 | 410 | static void wwfsstar_ymirq_handler(device_t *device, int irq) |
| 411 | 411 | { |
| 412 | | |
| 412 | | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 156 | 156 | // d0-d3: N/C |
| 157 | 157 | // d4: irq ack |
| 158 | 158 | if (~data & 0x10) |
| 159 | cput | |
| 159 | machine().device("maincpu")->execute().set_input_line( | |
| 160 | 160 | |
| 161 | 161 | // d5: ? |
| 162 | 162 | // d6-d7: sound trigger (edge) |
| r17813 | r17814 | |
|---|---|---|
| 665 | 665 | printf("vector = %02X\n", epic.iack); |
| 666 | 666 | #endif |
| 667 | 667 | |
| 668 | cput | |
| 668 | machine.device("maincpu")->execute().set_input_line( | |
| 669 | 669 | } |
| 670 | 670 | else |
| 671 | 671 | { |
| 672 | cput | |
| 672 | machine.device("maincpu")->execute().set_input_line( | |
| 673 | 673 | } |
| 674 | 674 | } |
| 675 | 675 |
| r17813 | r17814 | |
|---|---|---|
| 424 | 424 | WRITE8_MEMBER(pinkiri8_state::output_regs_w) |
| 425 | 425 | { |
| 426 | 426 | if(data & 0x40) |
| 427 | cput | |
| 427 | machine().device("maincpu")->execute().set_input_line( | |
| 428 | 428 | //data & 0x80 is probably NMI mask |
| 429 | 429 | } |
| 430 | 430 |
| r17813 | r17814 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | WRITE8_MEMBER(namcos86_state::int_ack1_w) |
| 249 | 249 | { |
| 250 | cput | |
| 250 | machine().device("cpu1")->execute().set_input_line( | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | WRITE8_MEMBER(namcos86_state::int_ack2_w) |
| 254 | 254 | { |
| 255 | cput | |
| 255 | machine().device("cpu2")->execute().set_input_line( | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 |
| r17813 | r17814 | |
|---|---|---|
| 1589 | 1589 | |
| 1590 | 1590 | static void soundirq(device_t *device, int state) |
| 1591 | 1591 | { |
| 1592 | | |
| 1592 | | |
| 1593 | 1593 | } |
| 1594 | 1594 | |
| 1595 | 1595 | /* In games with only 2 CPUs, port A&B of the AY8910 are used |
| r17813 | r17814 | |
|---|---|---|
| 162 | 162 | WRITE_LINE_MEMBER(gaelco3d_state::ser_irq) |
| 163 | 163 | { |
| 164 | 164 | if (state) |
| 165 | cput | |
| 165 | machine().device("maincpu")->execute().set_input_line( | |
| 166 | 166 | else |
| 167 | cput | |
| 167 | machine().device("maincpu")->execute().set_input_line( | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| r17813 | r17814 | |
| 220 | 220 | state->membank("bank1")->set_entry(0); |
| 221 | 221 | |
| 222 | 222 | /* keep the TMS32031 halted until the code is ready to go */ |
| 223 | c | |
| 223 | machine.device("tms")->execute().set_input_line( | |
| 224 | 224 | |
| 225 | 225 | for (i = 0; i < SOUND_CHANNELS; i++) |
| 226 | 226 | { |
| r17813 | r17814 | |
| 263 | 263 | |
| 264 | 264 | WRITE16_MEMBER(gaelco3d_state::irq_ack_w) |
| 265 | 265 | { |
| 266 | cput | |
| 266 | machine().device("maincpu")->execute().set_input_line( | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | WRITE32_MEMBER(gaelco3d_state::irq_ack32_w) |
| r17813 | r17814 | |
| 371 | 371 | if (LOG) |
| 372 | 372 | logerror("delayed_sound_w(%02X)\n", param); |
| 373 | 373 | state->m_sound_data = param; |
| 374 | cput | |
| 374 | machine.device("adsp")->execute().set_input_line( | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | |
| r17813 | r17814 | |
| 388 | 388 | { |
| 389 | 389 | if (LOG) |
| 390 | 390 | logerror("sound_data_r(%02X)\n", m_sound_data); |
| 391 | cput | |
| 391 | machine().device("adsp")->execute().set_input_line( | |
| 392 | 392 | return m_sound_data; |
| 393 | 393 | } |
| 394 | 394 | |
| r17813 | r17814 | |
| 509 | 509 | /* it does not ever appear to be touched after that */ |
| 510 | 510 | if (LOG) |
| 511 | 511 | logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask); |
| 512 | c | |
| 512 | machine().device("tms")->execute().set_input_line( | |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | |
| r17813 | r17814 | |
| 520 | 520 | if (LOG) |
| 521 | 521 | logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask); |
| 522 | 522 | if (ACCESSING_BITS_0_7) |
| 523 | c | |
| 523 | machine().device("tms")->execute().set_input_line( | |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 |
| r17813 | r17814 | |
|---|---|---|
| 195 | 195 | { |
| 196 | 196 | m_pending_command = 1; |
| 197 | 197 | soundlatch_byte_w(space, offset, data & 0xff); |
| 198 | | |
| 198 | | |
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| r17813 | r17814 | |
| 262 | 262 | static void gs_ym2610_irq(device_t *device, int irq) |
| 263 | 263 | { |
| 264 | 264 | if (irq) |
| 265 | | |
| 265 | | |
| 266 | 266 | else |
| 267 | | |
| 267 | | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | static const ym2610_interface ym2610_config = |
| r17813 | r17814 | |
|---|---|---|
| 275 | 275 | { |
| 276 | 276 | if(!space.debugger_access()) |
| 277 | 277 | { |
| 278 | cput | |
| 278 | machine().device("maincpu")->execute().set_input_line( | |
| 279 | 279 | } |
| 280 | 280 | return 0xff; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | WRITE8_MEMBER(snk_state::snk_cpuA_nmi_ack_w) |
| 284 | 284 | { |
| 285 | cput | |
| 285 | machine().device("maincpu")->execute().set_input_line( | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | READ8_MEMBER(snk_state::snk_cpuB_nmi_trigger_r) |
| 289 | 289 | { |
| 290 | 290 | if(!space.debugger_access()) |
| 291 | 291 | { |
| 292 | c | |
| 292 | machine().device("sub")->execute().set_input_line( | |
| 293 | 293 | } |
| 294 | 294 | return 0xff; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | WRITE8_MEMBER(snk_state::snk_cpuB_nmi_ack_w) |
| 298 | 298 | { |
| 299 | c | |
| 299 | machine().device("sub")->execute().set_input_line( | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /*********************************************************************/ |
| r17813 | r17814 | |
| 319 | 319 | |
| 320 | 320 | m_marvins_sound_busy_flag = 1; |
| 321 | 321 | soundlatch_byte_w(space, offset, data); |
| 322 | | |
| 322 | | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | READ8_MEMBER(snk_state::marvins_soundlatch_r) |
| r17813 | r17814 | |
| 337 | 337 | |
| 338 | 338 | READ8_MEMBER(snk_state::marvins_sound_nmi_ack_r) |
| 339 | 339 | { |
| 340 | | |
| 340 | | |
| 341 | 341 | return 0xff; |
| 342 | 342 | } |
| 343 | 343 | |
| r17813 | r17814 | |
| 362 | 362 | break; |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | cput | |
| 365 | machine.device("audiocpu")->execute().set_input_line( | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | |
| r17813 | r17814 | |
| 386 | 386 | |
| 387 | 387 | READ8_MEMBER(snk_state::sgladiat_sound_irq_ack_r) |
| 388 | 388 | { |
| 389 | | |
| 389 | | |
| 390 | 390 | return 0xff; |
| 391 | 391 | } |
| 392 | 392 | |
| r17813 | r17814 | |
| 449 | 449 | break; |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | cput | |
| 452 | machine.device("audiocpu")->execute().set_input_line( | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 |
| r17813 | r17814 | |
|---|---|---|
| 288 | 288 | |
| 289 | 289 | /* TODO: real sources of these */ |
| 290 | 290 | if (scanline == 224) |
| 291 | | |
| 291 | | |
| 292 | 292 | else if (scanline == 0) |
| 293 | | |
| 293 | | |
| 294 | 294 | else if (scanline == 128) |
| 295 | | |
| 295 | | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
| r17813 | r17814 | |
| 304 | 304 | |
| 305 | 305 | machine.primary_screen->update_partial(param); |
| 306 | 306 | state->m_pos_irq_active = 1; |
| 307 | cput | |
| 307 | machine.device("maincpu")->execute().set_input_line( | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | static INTERRUPT_GEN( namconb1_interrupt ) |
| r17813 | r17814 | |
| 367 | 367 | namconb1_state *state = machine.driver_data<namconb1_state>(); |
| 368 | 368 | machine.primary_screen->update_partial(param); |
| 369 | 369 | state->m_pos_irq_active = 1; |
| 370 | cput | |
| 370 | machine.device("maincpu")->execute().set_input_line( | |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | static INTERRUPT_GEN( namconb2_interrupt ) |
| r17813 | r17814 | |
| 424 | 424 | switch(reg) { |
| 425 | 425 | case 0x02: // POS IRQ level/enable |
| 426 | 426 | if(state->m_pos_irq_active && (((prev & 0xf) != (data & 0xf)) || !(data & 0xf0))) { |
| 427 | cput | |
| 427 | machine.device("maincpu")->execute().set_input_line( | |
| 428 | 428 | if(data & 0xf0) |
| 429 | cput | |
| 429 | machine.device("maincpu")->execute().set_input_line( | |
| 430 | 430 | else |
| 431 | 431 | state->m_pos_irq_active = 0; |
| 432 | 432 | } |
| r17813 | r17814 | |
| 434 | 434 | |
| 435 | 435 | case 0x04: // VBLANK IRQ level/enable |
| 436 | 436 | if(state->m_vblank_irq_active && (((prev & 0xf) != (data & 0xf)) || !(data & 0xf0))) { |
| 437 | cput | |
| 437 | machine.device("maincpu")->execute().set_input_line( | |
| 438 | 438 | if(data & 0xf0) |
| 439 | cput | |
| 439 | machine.device("maincpu")->execute().set_input_line( | |
| 440 | 440 | else |
| 441 | 441 | state->m_vblank_irq_active = 0; |
| 442 | 442 | } |
| r17813 | r17814 | |
| 444 | 444 | |
| 445 | 445 | case 0x07: // POS ack |
| 446 | 446 | if(state->m_pos_irq_active) { |
| 447 | cput | |
| 447 | machine.device("maincpu")->execute().set_input_line( | |
| 448 | 448 | state->m_pos_irq_active = 0; |
| 449 | 449 | } |
| 450 | 450 | break; |
| 451 | 451 | |
| 452 | 452 | case 0x09: // VBLANK ack |
| 453 | 453 | if(state->m_vblank_irq_active) { |
| 454 | cput | |
| 454 | machine.device("maincpu")->execute().set_input_line( | |
| 455 | 455 | state->m_vblank_irq_active = 0; |
| 456 | 456 | } |
| 457 | 457 | break; |
| r17813 | r17814 | |
| 461 | 461 | |
| 462 | 462 | case 0x18: // C75 Control |
| 463 | 463 | if(data & 1) { |
| 464 | cputag_set_input_line(machine, "mcu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 465 | cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 466 | cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, CLEAR_LINE); | |
| 464 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 465 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 466 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 467 | 467 | } else |
| 468 | c | |
| 468 | machine.device("mcu")->execute().set_input_line( | |
| 469 | 469 | break; |
| 470 | 470 | } |
| 471 | 471 | } |
| r17813 | r17814 | |
| 491 | 491 | switch(reg) { |
| 492 | 492 | case 0x00: // VBLANK IRQ level |
| 493 | 493 | if(state->m_vblank_irq_active && (prev != data)) { |
| 494 | cput | |
| 494 | machine.device("maincpu")->execute().set_input_line( | |
| 495 | 495 | if(data) |
| 496 | cput | |
| 496 | machine.device("maincpu")->execute().set_input_line( | |
| 497 | 497 | else |
| 498 | 498 | state->m_vblank_irq_active = 0; |
| 499 | 499 | } |
| r17813 | r17814 | |
| 501 | 501 | |
| 502 | 502 | case 0x02: // POS IRQ level |
| 503 | 503 | if(state->m_pos_irq_active && (prev != data)) { |
| 504 | cput | |
| 504 | machine.device("maincpu")->execute().set_input_line( | |
| 505 | 505 | if(data) |
| 506 | cput | |
| 506 | machine.device("maincpu")->execute().set_input_line( | |
| 507 | 507 | else |
| 508 | 508 | state->m_pos_irq_active = 0; |
| 509 | 509 | } |
| r17813 | r17814 | |
| 511 | 511 | |
| 512 | 512 | case 0x04: // VBLANK ack |
| 513 | 513 | if(state->m_vblank_irq_active) { |
| 514 | cput | |
| 514 | machine.device("maincpu")->execute().set_input_line( | |
| 515 | 515 | state->m_vblank_irq_active = 0; |
| 516 | 516 | } |
| 517 | 517 | break; |
| 518 | 518 | |
| 519 | 519 | case 0x06: // POS ack |
| 520 | 520 | if(state->m_pos_irq_active) { |
| 521 | cput | |
| 521 | machine.device("maincpu")->execute().set_input_line( | |
| 522 | 522 | state->m_pos_irq_active = 0; |
| 523 | 523 | } |
| 524 | 524 | break; |
| r17813 | r17814 | |
| 528 | 528 | |
| 529 | 529 | case 0x16: // C75 Control |
| 530 | 530 | if(data & 1) { |
| 531 | cputag_set_input_line(machine, "mcu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 532 | cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 533 | cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, CLEAR_LINE); | |
| 531 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 532 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 533 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 534 | 534 | } else { |
| 535 | c | |
| 535 | machine.device("mcu")->execute().set_input_line( | |
| 536 | 536 | } |
| 537 | 537 | break; |
| 538 | 538 | } |
| r17813 | r17814 | |
|---|---|---|
| 472 | 472 | |
| 473 | 473 | INPUT_CHANGED_MEMBER(cosmic_state::cosmica_coin_inserted) |
| 474 | 474 | { |
| 475 | cput | |
| 475 | machine().device("maincpu")->execute().set_input_line( | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | static INPUT_PORTS_START( cosmica ) |
| r17813 | r17814 | |
| 527 | 527 | |
| 528 | 528 | INPUT_CHANGED_MEMBER(cosmic_state::cosmicg_coin_inserted) |
| 529 | 529 | { |
| 530 | cput | |
| 530 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | static INPUT_PORTS_START( cosmicg ) |
| r17813 | r17814 | |
| 574 | 574 | |
| 575 | 575 | INPUT_CHANGED_MEMBER(cosmic_state::coin_inserted_irq0) |
| 576 | 576 | { |
| 577 | cput | |
| 577 | machine().device("maincpu")->execute().set_input_line( | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | INPUT_CHANGED_MEMBER(cosmic_state::coin_inserted_nmi) |
| 581 | 581 | { |
| 582 | cput | |
| 582 | machine().device("maincpu")->execute().set_input_line( | |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | static INPUT_PORTS_START( magspot ) |
| r17813 | r17814 | |
| 1007 | 1007 | int scanline = param; |
| 1008 | 1008 | |
| 1009 | 1009 | if(scanline == 224) // vblank-out irq |
| 1010 | cput | |
| 1010 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1011 | 1011 | |
| 1012 | 1012 | if(scanline == 0) // vblank-in irq |
| 1013 | cput | |
| 1013 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1014 | 1014 | } |
| 1015 | 1015 | |
| 1016 | 1016 |
| r17813 | r17814 | |
|---|---|---|
| 299 | 299 | state->m_intreq |= (1<<bit); |
| 300 | 300 | if (state->m_intena & (1<<bit)) |
| 301 | 301 | { |
| 302 | | |
| 302 | | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | state->m_timervals[tnum] = 0; |
| r17813 | r17814 | |
| 348 | 348 | MACHINE_RESET_CALL(model2_common); |
| 349 | 349 | |
| 350 | 350 | // hold TGP in halt until we have code |
| 351 | cput | |
| 351 | machine.device("tgp")->execute().set_input_line( | |
| 352 | 352 | |
| 353 | 353 | state->m_dsp_type = DSP_TYPE_TGP; |
| 354 | 354 | } |
| r17813 | r17814 | |
| 372 | 372 | MACHINE_RESET_CALL(model2_scsp); |
| 373 | 373 | |
| 374 | 374 | // hold TGP in halt until we have code |
| 375 | cput | |
| 375 | machine.device("tgp")->execute().set_input_line( | |
| 376 | 376 | |
| 377 | 377 | state->m_dsp_type = DSP_TYPE_TGP; |
| 378 | 378 | } |
| r17813 | r17814 | |
| 383 | 383 | MACHINE_RESET_CALL(model2_common); |
| 384 | 384 | MACHINE_RESET_CALL(model2_scsp); |
| 385 | 385 | |
| 386 | cput | |
| 386 | machine.device("dsp")->execute().set_input_line( | |
| 387 | 387 | |
| 388 | 388 | // set FIFOIN empty flag on SHARC |
| 389 | cput | |
| 389 | machine.device("dsp")->execute().set_input_line( | |
| 390 | 390 | // clear FIFOOUT buffer full flag on SHARC |
| 391 | cput | |
| 391 | machine.device("dsp")->execute().set_input_line( | |
| 392 | 392 | |
| 393 | 393 | state->m_dsp_type = DSP_TYPE_SHARC; |
| 394 | 394 | } |
| r17813 | r17814 | |
| 578 | 578 | if(mem_mask == 0x000000ff || mem_mask == 0x0000ffff) |
| 579 | 579 | { |
| 580 | 580 | m_driveio_comm_data = data & 0xff; |
| 581 | | |
| 581 | | |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| r17813 | r17814 | |
| 620 | 620 | if (m_dsp_type != DSP_TYPE_TGPX4) |
| 621 | 621 | { |
| 622 | 622 | if (m_dsp_type == DSP_TYPE_SHARC) |
| 623 | cput | |
| 623 | machine().device("dsp")->execute().set_input_line( | |
| 624 | 624 | else |
| 625 | cput | |
| 625 | machine().device("tgp")->execute().set_input_line( | |
| 626 | 626 | } |
| 627 | 627 | } |
| 628 | 628 | } |
| r17813 | r17814 | |
| 746 | 746 | else |
| 747 | 747 | { |
| 748 | 748 | logerror("Boot geo, %d dwords\n", m_geocnt); |
| 749 | cput | |
| 749 | machine().device("dsp2")->execute().set_input_line( | |
| 750 | 750 | //device_spin_until_time(&space.device(), attotime::from_usec(1000)); // Give the SHARC enough time to boot itself |
| 751 | 751 | } |
| 752 | 752 | } |
| r17813 | r17814 | |
| 993 | 993 | |
| 994 | 994 | state->m_to_68k = data; |
| 995 | 995 | |
| 996 | | |
| 996 | | |
| 997 | 997 | |
| 998 | 998 | // give the 68k time to notice |
| 999 | 999 | device_spin_until_time(&space->device(), attotime::from_usec(40)); |
| r17813 | r17814 | |
| 1884 | 1884 | if (irq > 0) |
| 1885 | 1885 | { |
| 1886 | 1886 | state->m_scsp_last_line = irq; |
| 1887 | | |
| 1887 | | |
| 1888 | 1888 | } |
| 1889 | 1889 | else |
| 1890 | | |
| 1890 | | |
| 1891 | 1891 | } |
| 1892 | 1892 | |
| 1893 | 1893 | static const scsp_interface scsp_config = |
| r17813 | r17814 | |
|---|---|---|
| 358 | 358 | |
| 359 | 359 | static void irqhandler(device_t *device, int state) |
| 360 | 360 | { |
| 361 | | |
| 361 | | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | WRITE8_MEMBER(wiping_state::subcpu_reset_w) |
| 56 | 56 | { |
| 57 | | |
| 57 | | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | WRITE8_MEMBER(wiping_state::main_irq_mask_w) |
| r17813 | r17814 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | static void sound_irq(device_t *device, int linestate) |
| 202 | 202 | { |
| 203 | | |
| 203 | | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 505 | 505 | static void irqhandler(device_t *device, int irq) |
| 506 | 506 | { |
| 507 | 507 | popmessage("irq"); |
| 508 | // | |
| 508 | // | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 |
| r17813 | r17814 | |
|---|---|---|
| 113 | 113 | static void update_irqs(running_machine &machine) |
| 114 | 114 | { |
| 115 | 115 | jpmimpct_state *state = machine.driver_data<jpmimpct_state>(); |
| 116 | cputag_set_input_line(machine, "maincpu", 2, state->m_tms_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 117 | cputag_set_input_line(machine, "maincpu", 5, state->m_duart_1_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 116 | machine.device("maincpu")->execute().set_input_line(2, state->m_tms_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 117 | machine.device("maincpu")->execute().set_input_line(5, state->m_duart_1_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 |
| r17813 | r17814 | |
|---|---|---|
| 416 | 416 | WRITE_LINE_MEMBER(missb2_state::irqhandler) |
| 417 | 417 | { |
| 418 | 418 | logerror("YM3526 firing an IRQ\n"); |
| 419 | // | |
| 419 | // | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | static const ym3526_interface ym3526_config = |
| r17813 | r17814 | |
|---|---|---|
| 98 | 98 | WRITE8_MEMBER(tehkanwc_state::sub_cpu_halt_w) |
| 99 | 99 | { |
| 100 | 100 | if (data) |
| 101 | c | |
| 101 | machine().device("sub")->execute().set_input_line( | |
| 102 | 102 | else |
| 103 | c | |
| 103 | machine().device("sub")->execute().set_input_line( | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| r17813 | r17814 | |
| 141 | 141 | WRITE8_MEMBER(tehkanwc_state::sound_command_w) |
| 142 | 142 | { |
| 143 | 143 | soundlatch_byte_w(space, offset, data); |
| 144 | | |
| 144 | | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | static TIMER_CALLBACK( reset_callback ) |
| 148 | 148 | { |
| 149 | cput | |
| 149 | machine.device("audiocpu")->execute().set_input_line( | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | WRITE8_MEMBER(tehkanwc_state::sound_answer_w) |
| r17813 | r17814 | |
|---|---|---|
| 128 | 128 | int scanline = param; |
| 129 | 129 | |
| 130 | 130 | if(scanline == 240) // vblank-out irq |
| 131 | | |
| 131 | | |
| 132 | 132 | |
| 133 | 133 | if(scanline == 0) // vblank-in or i8751 related irq |
| 134 | | |
| 134 | | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 |
| r17813 | r17814 | |
|---|---|---|
| 516 | 516 | |
| 517 | 517 | MACHINE_RESET( pgm ) |
| 518 | 518 | { |
| 519 | cput | |
| 519 | machine.device("soundcpu")->execute().set_input_line( | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 |
| r17813 | r17814 | |
|---|---|---|
| 519 | 519 | state->m_mpDspState->slaveOutputSize = 0; |
| 520 | 520 | state->m_mpDspState->masterFinished = 0; |
| 521 | 521 | state->m_mpDspState->slaveActive = 0; |
| 522 | cputag_set_input_line(machine, "dspmaster", 0, HOLD_LINE); | |
| 523 | cputag_set_input_line(machine, "dspslave", INPUT_LINE_RESET, PULSE_LINE); | |
| 522 | machine.device("dspmaster")->execute().set_input_line(0, HOLD_LINE); | |
| 523 | machine.device("dspslave")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | static UINT16 |
| r17813 | r17814 | |
| 1230 | 1230 | if( data ) |
| 1231 | 1231 | { |
| 1232 | 1232 | winrun_flushpoly(machine()); |
| 1233 | cput | |
| 1233 | machine().device("dsp")->execute().set_input_line( | |
| 1234 | 1234 | namcos21_ClearPolyFrameBuffer(machine()); |
| 1235 | 1235 | } |
| 1236 | 1236 | } |
| r17813 | r17814 | |
|---|---|---|
| 194 | 194 | void itgamble_state::machine_reset() |
| 195 | 195 | { |
| 196 | 196 | /* stop the CPU, we have no code for it anyway */ |
| 197 | cput | |
| 197 | machine().device("maincpu")->execute().set_input_line( | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 |
| r17813 | r17814 | |
|---|---|---|
| 232 | 232 | |
| 233 | 233 | WRITE_LINE_MEMBER(pengadvb_state::vdp_interrupt) |
| 234 | 234 | { |
| 235 | cput | |
| 235 | machine().device("maincpu")->execute().set_input_line( | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | static TMS9928A_INTERFACE(pengadvb_tms9928a_interface) |
| r17813 | r17814 | |
|---|---|---|
| 277 | 277 | |
| 278 | 278 | static TIMER_CALLBACK( irq0_stop ) |
| 279 | 279 | { |
| 280 | cput | |
| 280 | machine.device("maincpu")->execute().set_input_line( | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r17813 | r17814 | |
| 290 | 290 | |
| 291 | 291 | static void ide_interrupt(device_t *device, int state) |
| 292 | 292 | { |
| 293 | | |
| 293 | | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 |
| r17813 | r17814 | |
|---|---|---|
| 245 | 245 | WRITE8_MEMBER(sub_state::subm_to_sound_w) |
| 246 | 246 | { |
| 247 | 247 | soundlatch_byte_w(space, 0, data & 0xff); |
| 248 | | |
| 248 | | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | WRITE8_MEMBER(sub_state::nmi_mask_w) |
| r17813 | r17814 | |
| 421 | 421 | sub_state *state = device->machine().driver_data<sub_state>(); |
| 422 | 422 | |
| 423 | 423 | if(state->m_nmi_en) |
| 424 | | |
| 424 | | |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | static MACHINE_CONFIG_START( sub, sub_state ) |
| r17813 | r17814 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | /* on scanline zero, clear any halt condition */ |
| 156 | 156 | if (scanline == 0) |
| 157 | | |
| 157 | | |
| 158 | 158 | |
| 159 | 159 | /* wrap around at 262 */ |
| 160 | 160 | scanline++; |
| r17813 | r17814 | |
| 222 | 222 | { |
| 223 | 223 | m_irq_line_state = gen_int; |
| 224 | 224 | //if (m_irq_line_state != CLEAR_LINE) |
| 225 | cput | |
| 225 | machine().device("maincpu")->execute().set_input_line( | |
| 226 | 226 | //else |
| 227 | 227 | //asap_set_irq_line(ASAP_IRQ0, m_irq_line_state); |
| 228 | 228 | } |
| r17813 | r17814 | |
| 317 | 317 | WRITE32_MEMBER( beathead_state::sound_reset_w ) |
| 318 | 318 | { |
| 319 | 319 | logerror("Sound reset = %d\n", !offset); |
| 320 | c | |
| 320 | machine().device("jsa")->execute().set_input_line( | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 |
| r17813 | r17814 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | WRITE_LINE_MEMBER(cchasm_state::cchasm_6840_irq) |
| 71 | 71 | { |
| 72 | cput | |
| 72 | machine().device("maincpu")->execute().set_input_line( | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static const ptm6840_interface cchasm_6840_intf = |
| r17813 | r17814 | |
|---|---|---|
| 423 | 423 | |
| 424 | 424 | static void irqhandler(device_t *device, int irq) |
| 425 | 425 | { |
| 426 | // | |
| 426 | // | |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
| 449 | 449 | if(state->m_toggle) |
| 450 | 450 | { |
| 451 | 451 | msm5205_data_w(device, (state->m_msm5205next & 0xf0) >> 4); |
| 452 | if(state->m_msm_nmi_mask) { | |
| 452 | if(state->m_msm_nmi_mask) { | |
| 453 | 453 | } |
| 454 | 454 | else |
| 455 | 455 | { |
| r17813 | r17814 | |
|---|---|---|
| 60 | 60 | UINT32 ret = m_in0_b4; |
| 61 | 61 | if (m_in0_b4) |
| 62 | 62 | { |
| 63 | cput | |
| 63 | machine().device("maincpu")->execute().set_input_line( | |
| 64 | 64 | m_in0_b4 = 0; |
| 65 | 65 | } |
| 66 | 66 |
| r17813 | r17814 | |
|---|---|---|
| 97 | 97 | m_sndto000[ ( offset << 1 ) + 1 ] = data >> 16; |
| 98 | 98 | if( offset == 3 ) |
| 99 | 99 | { |
| 100 | | |
| 100 | | |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | if( ACCESSING_BITS_0_15 ) |
| r17813 | r17814 | |
| 150 | 150 | WRITE32_MEMBER(konamigq_state::eeprom_w) |
| 151 | 151 | { |
| 152 | 152 | ioport("EEPROMOUT")->write(data & 0x07, 0xff); |
| 153 | | |
| 153 | | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 |
| r17813 | r17814 | |
|---|---|---|
| 298 | 298 | } |
| 299 | 299 | else//keyboard emulation |
| 300 | 300 | { |
| 301 | //cput | |
| 301 | //machine().device("maincpu")->execute().set_input_line( | |
| 302 | 302 | return 0x00;//Keyboard is disconnected |
| 303 | 303 | //return 0xaa;//Keyboard code |
| 304 | 304 | } |
| r17813 | r17814 | |
| 352 | 352 | |
| 353 | 353 | WRITE8_MEMBER(pcxt_state::sys_reset_w) |
| 354 | 354 | { |
| 355 | cput | |
| 355 | machine().device("maincpu")->execute().set_input_line( | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | static I8255A_INTERFACE( ppi8255_0_intf ) |
| r17813 | r17814 | |
| 423 | 423 | |
| 424 | 424 | WRITE_LINE_MEMBER(pcxt_state::pc_dma_hrq_changed) |
| 425 | 425 | { |
| 426 | cput | |
| 426 | machine().device("maincpu")->execute().set_input_line( | |
| 427 | 427 | |
| 428 | 428 | /* Assert HLDA */ |
| 429 | 429 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
| 517 | 517 | |
| 518 | 518 | WRITE_LINE_MEMBER(pcxt_state::pic8259_1_set_int_line) |
| 519 | 519 | { |
| 520 | cput | |
| 520 | machine().device("maincpu")->execute().set_input_line( | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | READ8_MEMBER(pcxt_state::get_slave_ack) |
| r17813 | r17814 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | static void set_gate_a20(running_machine &machine, int a20) |
| 123 | 123 | { |
| 124 | cput | |
| 124 | machine.device("maincpu")->execute().set_input_line( | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static void keyboard_interrupt(running_machine &machine, int state) |
| r17813 | r17814 | |
| 181 | 181 | |
| 182 | 182 | WRITE_LINE_MEMBER(su2000_state::su2000_pic8259_1_set_int_line) |
| 183 | 183 | { |
| 184 | cput | |
| 184 | machine().device("maincpu")->execute().set_input_line( | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | READ8_MEMBER(su2000_state::get_slave_ack) |
| r17813 | r17814 | |
|---|---|---|
| 333 | 333 | |
| 334 | 334 | // Bit 0 : SUBINT |
| 335 | 335 | if ( (m_irqctrl & 1) && (!(data & 1)) ) // 1->0 transition |
| 336 | c | |
| 336 | machine().device("sub")->execute().set_input_line( | |
| 337 | 337 | |
| 338 | 338 | // Bit 1 : NSUBRST |
| 339 | 339 | if (data & 2) |
| 340 | c | |
| 340 | machine().device("sub")->execute().set_input_line( | |
| 341 | 341 | else |
| 342 | c | |
| 342 | machine().device("sub")->execute().set_input_line( | |
| 343 | 343 | |
| 344 | 344 | // Bit 2 : SOUND-ON |
| 345 | 345 | // Bit 3 : SOUNDRST |
| r17813 | r17814 | |
| 584 | 584 | if (ACCESSING_BITS_0_7) |
| 585 | 585 | { |
| 586 | 586 | soundlatch_byte_w(space, 0, data & 0xFF); |
| 587 | | |
| 587 | | |
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | |
| r17813 | r17814 | |
| 645 | 645 | if (ACCESSING_BITS_0_7) |
| 646 | 646 | { |
| 647 | 647 | soundlatch_byte_w(space, 0, data & 0xFF); |
| 648 | | |
| 648 | | |
| 649 | 649 | } |
| 650 | 650 | } |
| 651 | 651 | |
| r17813 | r17814 | |
| 1029 | 1029 | int scanline = param; |
| 1030 | 1030 | |
| 1031 | 1031 | if(scanline == 232) // vblank irq |
| 1032 | | |
| 1032 | | |
| 1033 | 1033 | else if(((scanline % 64) == 0)) // timer irq TODO: timings |
| 1034 | | |
| 1034 | | |
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | static TIMER_DEVICE_CALLBACK( hotchase_scanline ) |
| r17813 | r17814 | |
| 1039 | 1039 | int scanline = param; |
| 1040 | 1040 | |
| 1041 | 1041 | if(scanline == 224) // vblank irq |
| 1042 | | |
| 1042 | | |
| 1043 | 1043 | else if(((scanline % 64) == 0)) // timer irq TODO: timings |
| 1044 | | |
| 1044 | | |
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | 1047 |
| r17813 | r17814 | |
|---|---|---|
| 84 | 84 | WRITE8_MEMBER(dmndrby_state::dderby_sound_w) |
| 85 | 85 | { |
| 86 | 86 | soundlatch_byte_w(space,0,data); |
| 87 | | |
| 87 | | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| r17813 | r17814 | |
| 499 | 499 | /*Main Z80 is IM 0,HW-latched irqs. */ |
| 500 | 500 | static INTERRUPT_GEN( dderby_irq ) |
| 501 | 501 | { |
| 502 | cput | |
| 502 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | static INTERRUPT_GEN( dderby_timer_irq ) |
| 506 | 506 | { |
| 507 | cput | |
| 507 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | static MACHINE_CONFIG_START( dderby, dmndrby_state ) |
| r17813 | r17814 | |
|---|---|---|
| 237 | 237 | |
| 238 | 238 | static void kas89_vdp_interrupt(device_t *, v99x8_device &device, int i) |
| 239 | 239 | { |
| 240 | | |
| 240 | | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | static TIMER_DEVICE_CALLBACK( kas89_interrupt ) |
| r17813 | r17814 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | WRITE_LINE_MEMBER(voyager_state::pc_dma_hrq_changed) |
| 132 | 132 | { |
| 133 | cput | |
| 133 | machine().device("maincpu")->execute().set_input_line( | |
| 134 | 134 | |
| 135 | 135 | /* Assert HLDA */ |
| 136 | 136 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
| 670 | 670 | |
| 671 | 671 | WRITE_LINE_MEMBER(voyager_state::voyager_pic8259_1_set_int_line) |
| 672 | 672 | { |
| 673 | cput | |
| 673 | machine().device("maincpu")->execute().set_input_line( | |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | READ8_MEMBER(voyager_state::get_slave_ack) |
| r17813 | r17814 | |
| 731 | 731 | |
| 732 | 732 | static void set_gate_a20(running_machine &machine, int a20) |
| 733 | 733 | { |
| 734 | cput | |
| 734 | machine.device("maincpu")->execute().set_input_line( | |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | static void keyboard_interrupt(running_machine &machine, int state) |
| r17813 | r17814 | |
|---|---|---|
| 168 | 168 | WRITE8_MEMBER(roul_state::sound_latch_w) |
| 169 | 169 | { |
| 170 | 170 | soundlatch_byte_w(space, 0, data & 0xff); |
| 171 | | |
| 171 | | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | WRITE8_MEMBER(roul_state::ball_w) |
| r17813 | r17814 | |
|---|---|---|
| 1538 | 1538 | int scanline = param; |
| 1539 | 1539 | |
| 1540 | 1540 | if(scanline == 240) // vblank-out irq |
| 1541 | | |
| 1541 | | |
| 1542 | 1542 | |
| 1543 | 1543 | if(scanline == 154) |
| 1544 | | |
| 1544 | | |
| 1545 | 1545 | |
| 1546 | 1546 | if(scanline == 69) |
| 1547 | | |
| 1547 | | |
| 1548 | 1548 | } |
| 1549 | 1549 | |
| 1550 | 1550 | |
| r17813 | r17814 | |
| 1696 | 1696 | int scanline = param; |
| 1697 | 1697 | |
| 1698 | 1698 | if(scanline == 240) // vblank-out irq |
| 1699 | | |
| 1699 | | |
| 1700 | 1700 | |
| 1701 | 1701 | if(scanline == 120) // timer irq (clears a flag, presumably sprite DMA end) |
| 1702 | | |
| 1702 | | |
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | 1705 | static MACHINE_CONFIG_START( scudhamm, cischeat_state ) |
| r17813 | r17814 | |
| 1746 | 1746 | int scanline = param; |
| 1747 | 1747 | |
| 1748 | 1748 | if(scanline == 240) // vblank-out irq |
| 1749 | | |
| 1749 | | |
| 1750 | 1750 | |
| 1751 | 1751 | if(scanline == 120) // timer irq (TODO: timing) |
| 1752 | | |
| 1752 | | |
| 1753 | 1753 | } |
| 1754 | 1754 | |
| 1755 | 1755 | static MACHINE_CONFIG_DERIVED( armchmp2, scudhamm ) |
| r17813 | r17814 | |
|---|---|---|
| 95 | 95 | coin_counter_w(machine(), 0, 1); |
| 96 | 96 | coin_counter_w(machine(), 0, 0); |
| 97 | 97 | |
| 98 | cput | |
| 98 | machine().device("maincpu")->execute().set_input_line( | |
| 99 | 99 | |
| 100 | 100 | /* simulate the coin switch being closed for a while */ |
| 101 | 101 | machine().scheduler().timer_set(4 * machine().primary_screen->frame_period(), FUNC(clear_coin_status)); |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | static void update_interrupts(running_machine &machine) |
| 36 | 36 | { |
| 37 | 37 | xybots_state *state = machine.driver_data<xybots_state>(); |
| 38 | cputag_set_input_line(machine, "maincpu", 1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | cputag_set_input_line(machine, "maincpu", 2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 |
| r17813 | r17814 | |
|---|---|---|
| 222 | 222 | |
| 223 | 223 | READ32_MEMBER(speglsht_state::irq_ack_clear) |
| 224 | 224 | { |
| 225 | c | |
| 225 | machine().device("sub")->execute().set_input_line( | |
| 226 | 226 | return 0; |
| 227 | 227 | } |
| 228 | 228 |
| r17813 | r17814 | |
|---|---|---|
| 447 | 447 | |
| 448 | 448 | /* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */ |
| 449 | 449 | if (scanline & 16) |
| 450 | | |
| 450 | | |
| 451 | 451 | |
| 452 | 452 | /* do a partial update now to handle sprite multiplexing (Maze Invaders) */ |
| 453 | 453 | timer.machine().primary_screen->update_partial(scanline); |
| r17813 | r17814 | |
| 469 | 469 | { |
| 470 | 470 | centiped_state *state = machine.driver_data<centiped_state>(); |
| 471 | 471 | |
| 472 | cput | |
| 472 | machine.device("maincpu")->execute().set_input_line( | |
| 473 | 473 | state->m_dsw_select = 0; |
| 474 | 474 | state->m_control_select = 0; |
| 475 | 475 | state->m_prg_bank = 0; |
| r17813 | r17814 | |
| 489 | 489 | |
| 490 | 490 | WRITE8_MEMBER(centiped_state::irq_ack_w) |
| 491 | 491 | { |
| 492 | cput | |
| 492 | machine().device("maincpu")->execute().set_input_line( | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 |
| r17813 | r17814 | |
|---|---|---|
| 335 | 335 | |
| 336 | 336 | m_pending_command = 1; |
| 337 | 337 | soundlatch_byte_w(space, 0, data & 0xff); |
| 338 | | |
| 338 | | |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| r17813 | r17814 | |
| 675 | 675 | |
| 676 | 676 | static void irqhandler(device_t *device, int irq) |
| 677 | 677 | { |
| 678 | | |
| 678 | | |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | static const ym2610_interface ym2610_config = |
| r17813 | r17814 | |
|---|---|---|
| 119 | 119 | WRITE8_MEMBER(jrpacman_state::jrpacman_interrupt_vector_w) |
| 120 | 120 | { |
| 121 | 121 | device_set_input_line_vector(machine().device("maincpu"), 0, data); |
| 122 | cput | |
| 122 | machine().device("maincpu")->execute().set_input_line( | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | WRITE8_MEMBER(jrpacman_state::irq_mask_w) |
| r17813 | r17814 | |
|---|---|---|
| 674 | 674 | |
| 675 | 675 | // Active low |
| 676 | 676 | if (!(m_vsync_latch_preset)) |
| 677 | cput | |
| 677 | machine().device("maincpu")->execute().set_input_line( | |
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, maygayv1_state ) |
| r17813 | r17814 | |
| 931 | 931 | |
| 932 | 932 | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 933 | 933 | { |
| 934 | cputag_set_input_line_and_vector(device->machine(), "maincpu", 5, state, vector); | |
| 935 | // cputag_set_input_line(device->machine(), "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE); | |
| 934 | device->machine().device("maincpu")->execute().set_input_line_and_vector(5, state, vector); | |
| 935 | // device->machine().device("maincpu")->execute().set_input_line(5, state ? ASSERT_LINE : CLEAR_LINE); | |
| 936 | 936 | }; |
| 937 | 937 | |
| 938 | 938 | |
| r17813 | r17814 | |
| 942 | 942 | if (channel == 0) |
| 943 | 943 | { |
| 944 | 944 | state->m_d68681_val = data; |
| 945 | | |
| 945 | | |
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | }; |
| r17813 | r17814 | |
| 1028 | 1028 | { |
| 1029 | 1029 | maygayv1_state *state = device->machine().driver_data<maygayv1_state>(); |
| 1030 | 1030 | if (state->m_vsync_latch_preset) |
| 1031 | | |
| 1031 | | |
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 |
| r17813 | r17814 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | WRITE_LINE_MEMBER(zaccaria_state::zaccaria_irq0a) |
| 104 | 104 | { |
| 105 | | |
| 105 | | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | WRITE_LINE_MEMBER(zaccaria_state::zaccaria_irq0b) |
| 109 | 109 | { |
| 110 | | |
| 110 | | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | READ8_MEMBER(zaccaria_state::zaccaria_port0a_r) |
| r17813 | r17814 | |
| 180 | 180 | WRITE8_MEMBER(zaccaria_state::sound_command_w) |
| 181 | 181 | { |
| 182 | 182 | soundlatch_byte_w(space, 0, data); |
| 183 | c | |
| 183 | machine().device("audio2")->execute().set_input_line( | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | WRITE8_MEMBER(zaccaria_state::sound1_command_w) |
| r17813 | r17814 | |
|---|---|---|
| 33 | 33 | WRITE8_MEMBER(tagteam_state::sound_command_w) |
| 34 | 34 | { |
| 35 | 35 | soundlatch_byte_w(space, offset, data); |
| 36 | | |
| 36 | | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | WRITE8_MEMBER(tagteam_state::irq_clear_w) |
| 40 | 40 | { |
| 41 | cput | |
| 41 | machine().device("maincpu")->execute().set_input_line( | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tagteam_state ) |
| r17813 | r17814 | |
| 75 | 75 | |
| 76 | 76 | INPUT_CHANGED_MEMBER(tagteam_state::coin_inserted) |
| 77 | 77 | { |
| 78 | cput | |
| 78 | machine().device("maincpu")->execute().set_input_line( | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static INPUT_PORTS_START( bigprowr ) |
| r17813 | r17814 | |
|---|---|---|
| 1435 | 1435 | |
| 1436 | 1436 | static MACHINE_RESET( eolith ) |
| 1437 | 1437 | { |
| 1438 | cput | |
| 1438 | machine.device("soundcpu")->execute().set_input_line( | |
| 1439 | 1439 | } |
| 1440 | 1440 | |
| 1441 | 1441 | DRIVER_INIT_MEMBER(eolith_state,eolith) |
| r17813 | r17814 | |
|---|---|---|
| 1553 | 1553 | |
| 1554 | 1554 | static WRITE_LINE_DEVICE_HANDLER( chihiro_pic8259_1_set_int_line ) |
| 1555 | 1555 | { |
| 1556 | | |
| 1556 | | |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | 1559 | static READ8_DEVICE_HANDLER( get_slave_ack ) |
| r17813 | r17814 | |
|---|---|---|
| 1558 | 1558 | break; |
| 1559 | 1559 | case 7: |
| 1560 | 1560 | logerror("c417_w: ack IRQ 2 (%x)\n", data); |
| 1561 | cput | |
| 1561 | machine().device("maincpu")->execute().set_input_line( | |
| 1562 | 1562 | break; |
| 1563 | 1563 | default: |
| 1564 | 1564 | logerror("c417_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)space.device().state().state_int(MIPS3_R31)); |
| r17813 | r17814 | |
| 1748 | 1748 | |
| 1749 | 1749 | if (c361.scanline != 511) |
| 1750 | 1750 | { |
| 1751 | cput | |
| 1751 | machine.device("maincpu")->execute().set_input_line( | |
| 1752 | 1752 | c361.timer->adjust(attotime::never); |
| 1753 | 1753 | } |
| 1754 | 1754 | } |
| r17813 | r17814 | |
| 1770 | 1770 | c361.scanline = data; |
| 1771 | 1771 | if (data == 0x1ff) |
| 1772 | 1772 | { |
| 1773 | cput | |
| 1773 | machine().device("maincpu")->execute().set_input_line( | |
| 1774 | 1774 | c361.timer->adjust(attotime::never); |
| 1775 | 1775 | } |
| 1776 | 1776 | else |
| r17813 | r17814 | |
| 1809 | 1809 | if (data == 0xfffb) |
| 1810 | 1810 | { |
| 1811 | 1811 | logerror("c422_w: raise IRQ 3\n"); |
| 1812 | cput | |
| 1812 | machine().device("maincpu")->execute().set_input_line( | |
| 1813 | 1813 | } |
| 1814 | 1814 | else if (data == 0x000f) |
| 1815 | 1815 | { |
| 1816 | 1816 | logerror("c422_w: ack IRQ 3\n"); |
| 1817 | cput | |
| 1817 | machine().device("maincpu")->execute().set_input_line( | |
| 1818 | 1818 | } |
| 1819 | 1819 | break; |
| 1820 | 1820 | |
| r17813 | r17814 | |
| 1840 | 1840 | // Panic Park: writing 1 when it's already running means reboot? |
| 1841 | 1841 | if (m_s23_subcpu_running) |
| 1842 | 1842 | { |
| 1843 | | |
| 1843 | | |
| 1844 | 1844 | } |
| 1845 | 1845 | |
| 1846 | | |
| 1846 | | |
| 1847 | 1847 | m_s23_subcpu_running = 1; |
| 1848 | 1848 | } |
| 1849 | 1849 | else |
| 1850 | 1850 | { |
| 1851 | 1851 | logerror("S23: stopping H8/3002\n"); |
| 1852 | | |
| 1852 | | |
| 1853 | 1853 | m_s23_subcpu_running = 0; |
| 1854 | 1854 | } |
| 1855 | 1855 | } |
| r17813 | r17814 | |
| 1874 | 1874 | if ((offset == 0x6000/4) && (data == 0) && (mem_mask == 0xff000000)) |
| 1875 | 1875 | { |
| 1876 | 1876 | logerror("S23: Final Furlong hack stopping H8/3002\n"); |
| 1877 | | |
| 1877 | | |
| 1878 | 1878 | } |
| 1879 | 1879 | } |
| 1880 | 1880 | |
| r17813 | r17814 | |
| 2199 | 2199 | p3d_dma(&space, m_p3d_address, m_p3d_size); |
| 2200 | 2200 | return; |
| 2201 | 2201 | case 0x17: |
| 2202 | cput | |
| 2202 | machine().device("maincpu")->execute().set_input_line( | |
| 2203 | 2203 | m_c361.timer->adjust(attotime::never); |
| 2204 | 2204 | return; |
| 2205 | 2205 | } |
| r17813 | r17814 | |
| 2512 | 2512 | READ32_MEMBER(namcos23_state::gmen_trigger_sh2) |
| 2513 | 2513 | { |
| 2514 | 2514 | logerror("gmen_trigger_sh2: booting SH-2\n"); |
| 2515 | c | |
| 2515 | machine().device("gmen")->execute().set_input_line( | |
| 2516 | 2516 | |
| 2517 | 2517 | return 0; |
| 2518 | 2518 | } |
| r17813 | r17814 | |
| 2542 | 2542 | static MACHINE_RESET(gmen) |
| 2543 | 2543 | { |
| 2544 | 2544 | // halt the SH-2 until we need it |
| 2545 | c | |
| 2545 | machine.device("gmen")->execute().set_input_line( | |
| 2546 | 2546 | } |
| 2547 | 2547 | |
| 2548 | 2548 | WRITE16_MEMBER(namcos23_state::sharedram_sub_w) |
| r17813 | r17814 | |
| 2572 | 2572 | { |
| 2573 | 2573 | if ((mem_mask == 0xffff) && (data == 0x3170)) |
| 2574 | 2574 | { |
| 2575 | cput | |
| 2575 | machine().device("maincpu")->execute().set_input_line( | |
| 2576 | 2576 | } |
| 2577 | 2577 | else |
| 2578 | 2578 | { |
| r17813 | r17814 | |
| 2716 | 2716 | |
| 2717 | 2717 | if (m_im_rd == m_im_wr) |
| 2718 | 2718 | { |
| 2719 | | |
| 2719 | | |
| 2720 | 2720 | } |
| 2721 | 2721 | else |
| 2722 | 2722 | { |
| 2723 | cputag_set_input_line(machine(), "audiocpu", H8_SCI_0_RX, CLEAR_LINE); | |
| 2724 | cputag_set_input_line(machine(), "audiocpu", H8_SCI_0_RX, ASSERT_LINE); | |
| 2723 | machine().device("audiocpu")->execute().set_input_line(H8_SCI_0_RX, CLEAR_LINE); | |
| 2724 | machine().device("audiocpu")->execute().set_input_line(H8_SCI_0_RX, ASSERT_LINE); | |
| 2725 | 2725 | } |
| 2726 | 2726 | |
| 2727 | 2727 | return ret; |
| r17813 | r17814 | |
| 2732 | 2732 | m_maintoio[m_mi_wr++] = data; |
| 2733 | 2733 | m_mi_wr &= 0x7f; |
| 2734 | 2734 | |
| 2735 | | |
| 2735 | | |
| 2736 | 2736 | } |
| 2737 | 2737 | |
| 2738 | 2738 | static INPUT_PORTS_START( gorgon ) |
| r17813 | r17814 | |
| 2964 | 2964 | |
| 2965 | 2965 | if (m_mi_rd == m_mi_wr) |
| 2966 | 2966 | { |
| 2967 | | |
| 2967 | | |
| 2968 | 2968 | } |
| 2969 | 2969 | |
| 2970 | 2970 | return ret; |
| r17813 | r17814 | |
| 2975 | 2975 | m_iotomain[m_im_wr++] = data; |
| 2976 | 2976 | m_im_wr &= 0x7f; |
| 2977 | 2977 | |
| 2978 | | |
| 2978 | | |
| 2979 | 2979 | } |
| 2980 | 2980 | |
| 2981 | 2981 |
| r17813 | r17814 | |
|---|---|---|
| 160 | 160 | atarisy2_state *state = machine.driver_data<atarisy2_state>(); |
| 161 | 161 | |
| 162 | 162 | if (state->m_video_int_state) |
| 163 | cput | |
| 163 | machine.device("maincpu")->execute().set_input_line( | |
| 164 | 164 | else |
| 165 | cput | |
| 165 | machine.device("maincpu")->execute().set_input_line( | |
| 166 | 166 | |
| 167 | 167 | if (state->m_scanline_int_state) |
| 168 | cput | |
| 168 | machine.device("maincpu")->execute().set_input_line( | |
| 169 | 169 | else |
| 170 | cput | |
| 170 | machine.device("maincpu")->execute().set_input_line( | |
| 171 | 171 | |
| 172 | 172 | if (state->m_p2portwr_state) |
| 173 | cput | |
| 173 | machine.device("maincpu")->execute().set_input_line( | |
| 174 | 174 | else |
| 175 | cput | |
| 175 | machine.device("maincpu")->execute().set_input_line( | |
| 176 | 176 | |
| 177 | 177 | if (state->m_p2portrd_state) |
| 178 | cput | |
| 178 | machine.device("maincpu")->execute().set_input_line( | |
| 179 | 179 | else |
| 180 | cput | |
| 180 | machine.device("maincpu")->execute().set_input_line( | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| r17813 | r17814 | |
| 283 | 283 | { |
| 284 | 284 | /* reset sound CPU */ |
| 285 | 285 | if (ACCESSING_BITS_0_7) |
| 286 | | |
| 286 | | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 |
| r17813 | r17814 | |
|---|---|---|
| 214 | 214 | WRITE8_MEMBER(ninjakd2_state::ninjakd2_soundreset_w) |
| 215 | 215 | { |
| 216 | 216 | // bit 4 resets sound CPU |
| 217 | | |
| 217 | | |
| 218 | 218 | |
| 219 | 219 | // bit 7 flips screen |
| 220 | 220 | flip_screen_set(data & 0x80); |
| r17813 | r17814 | |
| 905 | 905 | |
| 906 | 906 | static void irqhandler(device_t *device, int irq) |
| 907 | 907 | { |
| 908 | | |
| 908 | | |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 217 | 217 | case 6: |
| 218 | 218 | m_ball_on = data & 1; |
| 219 | 219 | if (~data & 1) |
| 220 | cput | |
| 220 | machine().device("maincpu")->execute().set_input_line( | |
| 221 | 221 | break; |
| 222 | 222 | case 7: |
| 223 | 223 | flip_screen_set(data & 1); |
| r17813 | r17814 | |
| 301 | 301 | case 6: |
| 302 | 302 | m_ball_on = data & 1; |
| 303 | 303 | if (~data & 1) |
| 304 | cput | |
| 304 | machine().device("maincpu")->execute().set_input_line( | |
| 305 | 305 | break; |
| 306 | 306 | case 7: |
| 307 | 307 | flip_screen_set(data & 1); |
| r17813 | r17814 | |
|---|---|---|
| 132 | 132 | /* compute vector and set the interrupt line */ |
| 133 | 133 | int vpos = machine.primary_screen->vpos(); |
| 134 | 134 | UINT8 vector = 0xc7 | ((vpos & 0x40) >> 2) | ((~vpos & 0x40) >> 3); |
| 135 | cput | |
| 135 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 136 | 136 | |
| 137 | 137 | /* set up for next interrupt */ |
| 138 | 138 | if (vpos == SPACEFB_INT_TRIGGER_COUNT_1) |
| r17813 | r17814 | |
|---|---|---|
| 376 | 376 | if(offset==0xf && data==0xffff) |
| 377 | 377 | { |
| 378 | 378 | |
| 379 | cput | |
| 379 | machine().device("maincpu")->execute().set_input_line( | |
| 380 | 380 | |
| 381 | 381 | { |
| 382 | 382 | UINT8 *rom = memregion("gfx1")->base(); |
| r17813 | r17814 | |
| 644 | 644 | WRITE16_MEMBER(wheelfir_state::wheelfir_snd_w) |
| 645 | 645 | { |
| 646 | 646 | COMBINE_DATA(&m_soundlatch); |
| 647 | cput | |
| 647 | machine().device("subcpu")->execute().set_input_line( | |
| 648 | 648 | machine().scheduler().synchronize(); |
| 649 | 649 | } |
| 650 | 650 | |
| r17813 | r17814 | |
| 749 | 749 | |
| 750 | 750 | if(state->m_scanline_cnt==0) //<=0 ? |
| 751 | 751 | { |
| 752 | | |
| 752 | | |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | 755 | } |
| r17813 | r17814 | |
| 758 | 758 | if(state->m_current_scanline==NUM_SCANLINES) /* vblank */ |
| 759 | 759 | { |
| 760 | 760 | state->m_toggle_bit = 0x8000; |
| 761 | | |
| 761 | | |
| 762 | 762 | } |
| 763 | 763 | } |
| 764 | 764 | } |
| r17813 | r17814 | |
|---|---|---|
| 117 | 117 | WRITE8_MEMBER(wc90b_state::wc90b_sound_command_w) |
| 118 | 118 | { |
| 119 | 119 | soundlatch_byte_w(space, offset, data); |
| 120 | | |
| 120 | | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | WRITE8_MEMBER(wc90b_state::adpcm_control_w) |
| r17813 | r17814 | |
| 327 | 327 | static void irqhandler(device_t *device, int irq) |
| 328 | 328 | { |
| 329 | 329 | /* NMI writes to MSM ports *only*! -AS */ |
| 330 | // | |
| 330 | // | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
| 348 | 348 | if(state->m_toggle) |
| 349 | 349 | { |
| 350 | 350 | msm5205_data_w(device, (state->m_msm5205next & 0xf0) >> 4); |
| 351 | | |
| 351 | | |
| 352 | 352 | } |
| 353 | 353 | else |
| 354 | 354 | msm5205_data_w(device, (state->m_msm5205next & 0x0f) >> 0); |
| r17813 | r17814 | |
|---|---|---|
| 1403 | 1403 | ------------------------------*/ |
| 1404 | 1404 | static TIMER_CALLBACK( uPD71054_timer_callback ) |
| 1405 | 1405 | { |
| 1406 | cput | |
| 1406 | machine.device("maincpu")->execute().set_input_line( | |
| 1407 | 1407 | uPD71054_update_timer( machine, NULL, param ); |
| 1408 | 1408 | } |
| 1409 | 1409 | |
| r17813 | r17814 | |
| 1490 | 1490 | |
| 1491 | 1491 | static void utoukond_ym3438_interrupt(device_t *device, int linestate) |
| 1492 | 1492 | { |
| 1493 | | |
| 1493 | | |
| 1494 | 1494 | } |
| 1495 | 1495 | |
| 1496 | 1496 | static const ym3438_interface utoukond_ym3438_intf = |
| r17813 | r17814 | |
| 1548 | 1548 | { |
| 1549 | 1549 | |
| 1550 | 1550 | if ( !(m_sub_ctrl_data & 1) && (data & 1) ) |
| 1551 | c | |
| 1551 | machine().device("sub")->execute().set_input_line( | |
| 1552 | 1552 | m_sub_ctrl_data = data; |
| 1553 | 1553 | } |
| 1554 | 1554 | break; |
| r17813 | r17814 | |
| 1708 | 1708 | if (ACCESSING_BITS_0_7) |
| 1709 | 1709 | { |
| 1710 | 1710 | soundlatch_word_w(space, 0, data, mem_mask); |
| 1711 | c | |
| 1711 | machine().device("sub")->execute().set_input_line( | |
| 1712 | 1712 | device_spin_until_time(&space.device(), attotime::from_usec(50)); // Allow the other cpu to reply |
| 1713 | 1713 | } |
| 1714 | 1714 | } |
| r17813 | r17814 | |
| 2772 | 2772 | { |
| 2773 | 2773 | |
| 2774 | 2774 | m_wiggie_soundlatch = data >> 8; |
| 2775 | | |
| 2775 | | |
| 2776 | 2776 | } |
| 2777 | 2777 | |
| 2778 | 2778 | |
| r17813 | r17814 | |
| 2838 | 2838 | { |
| 2839 | 2839 | if (ACCESSING_BITS_0_7) |
| 2840 | 2840 | { |
| 2841 | | |
| 2841 | | |
| 2842 | 2842 | soundlatch_byte_w(space, 0, data & 0xff); |
| 2843 | 2843 | } |
| 2844 | 2844 | } |
| r17813 | r17814 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | WRITE8_MEMBER(tp84_state::tp84_sh_irqtrigger_w) |
| 122 | 122 | { |
| 123 | cput | |
| 123 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 |
| r17813 | r17814 | |
|---|---|---|
| 120 | 120 | /* IRQ fires every on every 8th scanline */ |
| 121 | 121 | if (!(vcount_old & 8) && (vcount & 8)) |
| 122 | 122 | { |
| 123 | | |
| 123 | | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /* NMI fires on scanline 248 (VBL) and is latched */ |
| 127 | 127 | if (vcount == 0xf8) |
| 128 | 128 | { |
| 129 | | |
| 129 | | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /* Save the scroll x register value */ |
| r17813 | r17814 | |
| 139 | 139 | WRITE8_MEMBER(vball_state::vball_irq_ack_w) |
| 140 | 140 | { |
| 141 | 141 | if (offset == 0) |
| 142 | cput | |
| 142 | machine().device("maincpu")->execute().set_input_line( | |
| 143 | 143 | |
| 144 | 144 | else |
| 145 | cput | |
| 145 | machine().device("maincpu")->execute().set_input_line( | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| r17813 | r17814 | |
| 172 | 172 | WRITE8_MEMBER(vball_state::cpu_sound_command_w) |
| 173 | 173 | { |
| 174 | 174 | soundlatch_byte_w(space, offset, data); |
| 175 | | |
| 175 | | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| r17813 | r17814 | |
| 396 | 396 | |
| 397 | 397 | static void vball_irq_handler(device_t *device, int irq) |
| 398 | 398 | { |
| 399 | | |
| 399 | | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 1817 | 1817 | */ |
| 1818 | 1818 | static void aica_irq(device_t *device, int irq) |
| 1819 | 1819 | { |
| 1820 | | |
| 1820 | | |
| 1821 | 1821 | } |
| 1822 | 1822 | |
| 1823 | 1823 |
| r17813 | r17814 | |
|---|---|---|
| 457 | 457 | |
| 458 | 458 | WRITE_LINE_MEMBER(queen_state::pc_dma_hrq_changed) |
| 459 | 459 | { |
| 460 | cput | |
| 460 | machine().device("maincpu")->execute().set_input_line( | |
| 461 | 461 | |
| 462 | 462 | /* Assert HLDA */ |
| 463 | 463 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
|---|---|---|
| 231 | 231 | printf("enabling SMS Z80\n"); |
| 232 | 232 | state->m_current_game_is_sms = 1; |
| 233 | 233 | megatech_set_genz80_as_sms_standard_map(machine, "genesis_snd_z80", MAPPER_STANDARD); |
| 234 | //cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_HALT, CLEAR_LINE); | |
| 235 | cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_RESET, CLEAR_LINE); | |
| 234 | //machine.device("genesis_snd_z80")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 235 | machine.device("genesis_snd_z80")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 236 | 236 | } |
| 237 | 237 | else |
| 238 | 238 | { |
| 239 | 239 | printf("disabling SMS Z80\n"); |
| 240 | 240 | state->m_current_game_is_sms = 0; |
| 241 | 241 | megatech_set_megadrive_z80_as_megadrive_z80(machine, "genesis_snd_z80"); |
| 242 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, CLEAR_LINE); | |
| 243 | //cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 242 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 243 | //machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| r17813 | r17814 | |
| 254 | 254 | sprintf(tempname, "game%d", param); |
| 255 | 255 | game_region = machine.root_device().memregion(tempname)->base(); |
| 256 | 256 | |
| 257 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 258 | cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_RESET, ASSERT_LINE); | |
| 259 | //cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 260 | //cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_HALT, ASSERT_LINE); | |
| 257 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 258 | machine.device("genesis_snd_z80")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 259 | //machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 260 | //machine.device("genesis_snd_z80")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 261 | 261 | devtag_reset(machine, "ymsnd"); |
| 262 | 262 | |
| 263 | 263 | megadriv_stop_scanline_timer(machine);// stop the scanline timer for the genesis vdp... it can be restarted in video eof when needed |
| r17813 | r17814 | |
|---|---|---|
| 38 | 38 | WRITE8_MEMBER(timelimt_state::sound_reset_w) |
| 39 | 39 | { |
| 40 | 40 | if (data & 1) |
| 41 | | |
| 41 | | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /***************************************************************************/ |
| r17813 | r17814 | |
|---|---|---|
| 114 | 114 | if (state->m_cur_control & 0x800) |
| 115 | 115 | { |
| 116 | 116 | if(scanline == 240) // vblank-out irq |
| 117 | | |
| 117 | | |
| 118 | 118 | |
| 119 | 119 | if(scanline == 0) // vblank-in irq |
| 120 | | |
| 120 | | |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 |
| r17813 | r17814 | |
|---|---|---|
| 79 | 79 | int scanline = param; |
| 80 | 80 | |
| 81 | 81 | if(scanline == 240) // vblank-out irq |
| 82 | cput | |
| 82 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 83 | 83 | |
| 84 | 84 | if(scanline == 0) // unknown irq event, presumably vblank-in or a periodic one (writes to the soundlatch and drives freeze dip-switch) |
| 85 | cput | |
| 85 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 |
| r17813 | r17814 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | READ8_MEMBER(poolshrk_state::poolshrk_irq_reset_r) |
| 93 | 93 | { |
| 94 | cput | |
| 94 | machine().device("maincpu")->execute().set_input_line( | |
| 95 | 95 | |
| 96 | 96 | return 0; |
| 97 | 97 | } |
| r17813 | r17814 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | static TIMER_CALLBACK( irq_off_tick ) |
| 101 | 101 | { |
| 102 | cput | |
| 102 | machine.device("maincpu")->execute().set_input_line( | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| r17813 | r17814 | |
| 113 | 113 | state->m_irq_timer->adjust(machine.primary_screen->time_until_pos(param + 64), param + 64); |
| 114 | 114 | |
| 115 | 115 | /* IRQ starts on scanline 0, 64, 128, etc. */ |
| 116 | cput | |
| 116 | machine.device("maincpu")->execute().set_input_line( | |
| 117 | 117 | |
| 118 | 118 | /* it will turn off on the next HBLANK */ |
| 119 | 119 | state->m_irq_off->adjust(machine.primary_screen->time_until_pos(param, GRIDLEE_HBSTART)); |
| r17813 | r17814 | |
| 122 | 122 | |
| 123 | 123 | static TIMER_CALLBACK( firq_off_tick ) |
| 124 | 124 | { |
| 125 | cput | |
| 125 | machine.device("maincpu")->execute().set_input_line( | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| r17813 | r17814 | |
| 133 | 133 | state->m_firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE)); |
| 134 | 134 | |
| 135 | 135 | /* IRQ starts on scanline FIRQ_SCANLINE? */ |
| 136 | cput | |
| 136 | machine.device("maincpu")->execute().set_input_line( | |
| 137 | 137 | |
| 138 | 138 | /* it will turn off on the next HBLANK */ |
| 139 | 139 | state->m_firq_off->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART)); |
| r17813 | r17814 | |
|---|---|---|
| 1338 | 1338 | { |
| 1339 | 1339 | bnstars_state *state = machine.driver_data<bnstars_state>(); |
| 1340 | 1340 | state->m_irqreq = 0; |
| 1341 | cput | |
| 1341 | machine.device("maincpu")->execute().set_input_line( | |
| 1342 | 1342 | device_set_irq_callback(machine.device("maincpu"), irq_callback); |
| 1343 | 1343 | } |
| 1344 | 1344 | |
| r17813 | r17814 | |
| 1346 | 1346 | { |
| 1347 | 1347 | bnstars_state *state = machine.driver_data<bnstars_state>(); |
| 1348 | 1348 | state->m_irqreq |= (1<<level); |
| 1349 | cput | |
| 1349 | machine.device("maincpu")->execute().set_input_line( | |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | 1352 | /* TODO: fix this arrangement (derived from old deprecat lib) */ |
| r17813 | r17814 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | if (ACCESSING_BITS_8_15) |
| 82 | 82 | { |
| 83 | cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE); | |
| 84 | if (data&0x8000) cputag_set_input_line(machine(), "maincpu", 3, HOLD_LINE); /* Guess */ | |
| 83 | machine().device("sub")->execute().set_input_line(INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE); | |
| 84 | if (data&0x8000) machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); /* Guess */ | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | if (ACCESSING_BITS_0_7) |
| r17813 | r17814 | |
| 182 | 182 | different byte in this long word before the RTE. I assume all but the last |
| 183 | 183 | (top) byte cause an IRQ with the final one being an ACK. (Total guess but it works). */ |
| 184 | 184 | if (mem_mask != 0xff000000) |
| 185 | cput | |
| 185 | machine().device("maincpu")->execute().set_input_line( | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /*********************************************************** |
| r17813 | r17814 | |
|---|---|---|
| 36 | 36 | if (offset == 0) |
| 37 | 37 | { |
| 38 | 38 | soundlatch_byte_w(space,0,data); |
| 39 | | |
| 39 | | |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| r17813 | r17814 | |
| 92 | 92 | |
| 93 | 93 | state->m_toggle = 1 - state->m_toggle; |
| 94 | 94 | if (state->m_toggle) |
| 95 | | |
| 95 | | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | WRITE8_MEMBER(battlera_state::battlera_adpcm_data_w) |
| r17813 | r17814 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | WRITE8_MEMBER(flower_state::flower_maincpu_irq_ack) |
| 79 | 79 | { |
| 80 | cput | |
| 80 | machine().device("maincpu")->execute().set_input_line( | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | WRITE8_MEMBER(flower_state::flower_subcpu_irq_ack) |
| 84 | 84 | { |
| 85 | cput | |
| 85 | machine().device("subcpu")->execute().set_input_line( | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | WRITE8_MEMBER(flower_state::flower_soundcpu_irq_ack) |
| 89 | 89 | { |
| 90 | | |
| 90 | | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | WRITE8_MEMBER(flower_state::flower_coin_counter_w) |
| r17813 | r17814 | |
| 105 | 105 | soundlatch_byte_w(space, 0, data); |
| 106 | 106 | |
| 107 | 107 | if (*m_sn_nmi_enable & 1) |
| 108 | | |
| 108 | | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static ADDRESS_MAP_START( flower_cpu1_2, AS_PROGRAM, 8, flower_state ) |
| r17813 | r17814 | |
| 144 | 144 | |
| 145 | 145 | INPUT_CHANGED_MEMBER(flower_state::coin_inserted) |
| 146 | 146 | { |
| 147 | cput | |
| 147 | machine().device("maincpu")->execute().set_input_line( | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | static INPUT_PORTS_START( flower ) |
| r17813 | r17814 | |
|---|---|---|
| 190 | 190 | /* FIRQ (IMS) fires every on every 8th scanline (except 0) */ |
| 191 | 191 | if (!(vcount_old & 8) && (vcount & 8)) |
| 192 | 192 | { |
| 193 | | |
| 193 | | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /* NMI fires on scanline 248 (VBL) and is latched */ |
| 197 | 197 | if (vcount == 0xf8) |
| 198 | 198 | { |
| 199 | | |
| 199 | | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /* VBLANK input bit is held high from scanlines 248-255 */ |
| r17813 | r17814 | |
| 224 | 224 | WRITE8_MEMBER(xain_state::xain_sound_command_w) |
| 225 | 225 | { |
| 226 | 226 | soundlatch_byte_w(space,offset,data); |
| 227 | | |
| 227 | | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | WRITE8_MEMBER(xain_state::xain_main_irq_w) |
| r17813 | r17814 | |
| 232 | 232 | switch (offset) |
| 233 | 233 | { |
| 234 | 234 | case 0: /* 0x3a09 - NMI clear */ |
| 235 | cput | |
| 235 | machine().device("maincpu")->execute().set_input_line( | |
| 236 | 236 | break; |
| 237 | 237 | case 1: /* 0x3a0a - FIRQ clear */ |
| 238 | cput | |
| 238 | machine().device("maincpu")->execute().set_input_line( | |
| 239 | 239 | break; |
| 240 | 240 | case 2: /* 0x3a0b - IRQ clear */ |
| 241 | cput | |
| 241 | machine().device("maincpu")->execute().set_input_line( | |
| 242 | 242 | break; |
| 243 | 243 | case 3: /* 0x3a0c - IRQB assert */ |
| 244 | c | |
| 244 | machine().device("sub")->execute().set_input_line( | |
| 245 | 245 | break; |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | WRITE8_MEMBER(xain_state::xain_irqA_assert_w) |
| 250 | 250 | { |
| 251 | cput | |
| 251 | machine().device("maincpu")->execute().set_input_line( | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | WRITE8_MEMBER(xain_state::xain_irqB_clear_w) |
| 255 | 255 | { |
| 256 | c | |
| 256 | machine().device("sub")->execute().set_input_line( | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | READ8_MEMBER(xain_state::xain_68705_r) |
| r17813 | r17814 | |
| 268 | 268 | m_mcu_accept = 0; |
| 269 | 269 | |
| 270 | 270 | if (machine().device("mcu") != NULL) |
| 271 | c | |
| 271 | machine().device("mcu")->execute().set_input_line( | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | CUSTOM_INPUT_MEMBER(xain_state::xain_vblank_r) |
| r17813 | r17814 | |
| 313 | 313 | else if ((m_ddr_b & 0x02) && (~m_port_b_out & 0x02) && (data & 0x02)) |
| 314 | 314 | { |
| 315 | 315 | m_mcu_accept = 1; |
| 316 | c | |
| 316 | machine().device("mcu")->execute().set_input_line( | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /* Rising edge of PB2 */ |
| r17813 | r17814 | |
| 378 | 378 | m_mcu_accept = 1; |
| 379 | 379 | |
| 380 | 380 | if (machine().device("mcu") != NULL) |
| 381 | c | |
| 381 | machine().device("mcu")->execute().set_input_line( | |
| 382 | 382 | |
| 383 | 383 | return 0xff; |
| 384 | 384 | } |
| r17813 | r17814 | |
| 553 | 553 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 554 | 554 | static void irqhandler(device_t *device, int irq) |
| 555 | 555 | { |
| 556 | | |
| 556 | | |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 352 | 352 | |
| 353 | 353 | WRITE8_MEMBER(namcos1_state::namcos1_sub_firq_w) |
| 354 | 354 | { |
| 355 | c | |
| 355 | machine().device("sub")->execute().set_input_line( | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | WRITE8_MEMBER(namcos1_state::irq_ack_w) |
| r17813 | r17814 | |
| 1058 | 1058 | |
| 1059 | 1059 | static void namcos1_sound_interrupt( device_t *device, int irq ) |
| 1060 | 1060 | { |
| 1061 | | |
| 1061 | | |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | 1064 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 388 | 388 | int scanline = param; |
| 389 | 389 | |
| 390 | 390 | if(scanline == 240) // vblank-out irq |
| 391 | cput | |
| 391 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 392 | 392 | else if((scanline == 0) || (scanline == 120) ) //timer irq |
| 393 | cput | |
| 393 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 253 | 253 | { |
| 254 | 254 | timer.machine().primary_screen->update_now(); |
| 255 | 255 | |
| 256 | | |
| 256 | | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | static void set_rgba( running_machine &machine, int start, int index, unsigned char *palette_ram ) |
| r17813 | r17814 | |
| 311 | 311 | { |
| 312 | 312 | m_main_to_sound_flag = 1; |
| 313 | 313 | soundlatch_byte_w(space, 0, data); |
| 314 | | |
| 314 | | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | WRITE8_MEMBER(firefox_state::sound_reset_w) |
| 318 | 318 | { |
| 319 | | |
| 319 | | |
| 320 | 320 | if ((data & 0x80) != 0) |
| 321 | 321 | m_sound_to_main_flag = m_main_to_sound_flag = 0; |
| 322 | 322 | } |
| r17813 | r17814 | |
| 369 | 369 | |
| 370 | 370 | WRITE_LINE_MEMBER(firefox_state::riot_irq) |
| 371 | 371 | { |
| 372 | | |
| 372 | | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | |
| r17813 | r17814 | |
| 441 | 441 | |
| 442 | 442 | WRITE8_MEMBER(firefox_state::main_irq_clear_w) |
| 443 | 443 | { |
| 444 | cput | |
| 444 | machine().device("maincpu")->execute().set_input_line( | |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | WRITE8_MEMBER(firefox_state::main_firq_clear_w) |
| 448 | 448 | { |
| 449 | cput | |
| 449 | machine().device("maincpu")->execute().set_input_line( | |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | WRITE8_MEMBER(firefox_state::self_reset_w) |
| 453 | 453 | { |
| 454 | cput | |
| 454 | machine().device("maincpu")->execute().set_input_line( | |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | |
| r17813 | r17814 | |
| 477 | 477 | static void firq_gen(running_machine &machine, phillips_22vp931_device &laserdisc, int state) |
| 478 | 478 | { |
| 479 | 479 | if (state) |
| 480 | cput | |
| 480 | machine.device("maincpu")->execute().set_input_line( | |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 |
| r17813 | r17814 | |
|---|---|---|
| 46 | 46 | WRITE16_MEMBER(toki_state::tokib_soundcommand16_w) |
| 47 | 47 | { |
| 48 | 48 | soundlatch_byte_w(space, 0, data & 0xff); |
| 49 | | |
| 49 | | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | READ16_MEMBER(toki_state::pip16_r) |
| r17813 | r17814 | |
| 65 | 65 | |
| 66 | 66 | state->m_toggle ^= 1; |
| 67 | 67 | if (state->m_toggle) |
| 68 | | |
| 68 | | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | WRITE8_MEMBER(toki_state::toki_adpcm_control_w) |
| r17813 | r17814 | |
|---|---|---|
| 260 | 260 | WRITE8_MEMBER(renegade_state::sound_w) |
| 261 | 261 | { |
| 262 | 262 | soundlatch_byte_w(space, offset, data); |
| 263 | | |
| 263 | | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /********************************************************************************************/ |
| r17813 | r17814 | |
| 359 | 359 | m_port_a_in = m_from_main; |
| 360 | 360 | |
| 361 | 361 | if (m_main_sent) |
| 362 | c | |
| 362 | machine().device("mcu")->execute().set_input_line( | |
| 363 | 363 | |
| 364 | 364 | m_main_sent = 0; |
| 365 | 365 | } |
| r17813 | r17814 | |
| 416 | 416 | } |
| 417 | 417 | else |
| 418 | 418 | { |
| 419 | c | |
| 419 | machine().device("mcu")->execute().set_input_line( | |
| 420 | 420 | } |
| 421 | 421 | return 0; |
| 422 | 422 | } |
| r17813 | r17814 | |
| 446 | 446 | { |
| 447 | 447 | m_from_main = data; |
| 448 | 448 | m_main_sent = 1; |
| 449 | c | |
| 449 | machine().device("mcu")->execute().set_input_line( | |
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 |
| r17813 | r17814 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | void alien_state::machine_reset() |
| 76 | 76 | { |
| 77 | //cput | |
| 77 | //machine().device("maincpu")->execute().set_input_line( | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static MACHINE_CONFIG_START( alien, alien_state ) |
| r17813 | r17814 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | WRITE8_MEMBER(ginganin_state::ptm_irq) |
| 249 | 249 | { |
| 250 | | |
| 250 | | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | static const ptm6840_interface ptm_intf = |
| r17813 | r17814 | |
|---|---|---|
| 482 | 482 | gpu.mcr = data; |
| 483 | 483 | |
| 484 | 484 | if (~data & 0x08) |
| 485 | cput | |
| 485 | machine().device("maincpu")->execute().set_input_line( | |
| 486 | 486 | |
| 487 | 487 | break; |
| 488 | 488 | } |
| r17813 | r17814 | |
| 517 | 517 | static INTERRUPT_GEN( vblank_int ) |
| 518 | 518 | { |
| 519 | 519 | if (gpu.mcr & 0x08) |
| 520 | | |
| 520 | | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | |
| r17813 | r17814 | |
| 562 | 562 | |
| 563 | 563 | WRITE16_MEMBER(atarisy4_state::dsp0_control_w) |
| 564 | 564 | { |
| 565 | cputag_set_input_line(machine(), "dsp0", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE); | |
| 566 | cputag_set_input_line(machine(), "dsp0", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE); | |
| 565 | machine().device("dsp0")->execute().set_input_line(INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE); | |
| 566 | machine().device("dsp0")->execute().set_input_line(0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE); | |
| 567 | 567 | |
| 568 | 568 | m_csr[0] = data; |
| 569 | 569 | } |
| r17813 | r17814 | |
| 596 | 596 | |
| 597 | 597 | WRITE16_MEMBER(atarisy4_state::dsp1_control_w) |
| 598 | 598 | { |
| 599 | cputag_set_input_line(machine(), "dsp1", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE); | |
| 600 | cputag_set_input_line(machine(), "dsp1", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE); | |
| 599 | machine().device("dsp1")->execute().set_input_line(INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE); | |
| 600 | machine().device("dsp1")->execute().set_input_line(0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE); | |
| 601 | 601 | |
| 602 | 602 | m_csr[1] = data; |
| 603 | 603 | } |
| r17813 | r17814 | |
| 1001 | 1001 | |
| 1002 | 1002 | static MACHINE_RESET( atarisy4 ) |
| 1003 | 1003 | { |
| 1004 | cput | |
| 1004 | machine.device("dsp0")->execute().set_input_line( | |
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | static MACHINE_RESET( airrace ) |
| 1008 | 1008 | { |
| 1009 | cputag_set_input_line(machine, "dsp0", INPUT_LINE_RESET, ASSERT_LINE); | |
| 1010 | cputag_set_input_line(machine, "dsp1", INPUT_LINE_RESET, ASSERT_LINE); | |
| 1009 | machine.device("dsp0")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 1010 | machine.device("dsp1")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | 1013 |
| r17813 | r17814 | |
|---|---|---|
| 366 | 366 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 367 | 367 | static void irqhandler(device_t *device, int linestate) |
| 368 | 368 | { |
| 369 | | |
| 369 | | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 179 | 179 | WRITE8_MEMBER(taitosj_state::taitosj_soundcommand_w) |
| 180 | 180 | { |
| 181 | 181 | soundlatch_byte_w(space,offset,data); |
| 182 | if (!m_sndnmi_disable) | |
| 182 | if (!m_sndnmi_disable) | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 |
| r17813 | r17814 | |
|---|---|---|
| 54 | 54 | if (ACCESSING_BITS_0_7) |
| 55 | 55 | { |
| 56 | 56 | soundlatch_byte_w(space, 0, data & 0xff); |
| 57 | | |
| 57 | | |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| r17813 | r17814 | |
| 63 | 63 | if (ACCESSING_BITS_0_7) |
| 64 | 64 | { |
| 65 | 65 | soundlatch_byte_w(space, 0, data & 0xff); |
| 66 | | |
| 66 | | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // give the z80 time to see it |
| r17813 | r17814 | |
| 223 | 223 | WRITE16_MEMBER(splash_state::funystrp_sh_irqtrigger_w) |
| 224 | 224 | { |
| 225 | 225 | soundlatch_byte_w(space, 0, data>>8); |
| 226 | | |
| 226 | | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | static ADDRESS_MAP_START( funystrp_map, AS_PROGRAM, 16, splash_state ) |
| r17813 | r17814 | |
|---|---|---|
| 873 | 873 | { |
| 874 | 874 | subsino2_state *state = timer.machine().driver_data<subsino2_state>(); |
| 875 | 875 | if ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask |
| 876 | cput | |
| 876 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | /*************************************************************************** |
| r17813 | r17814 | |
| 883 | 883 | // To be removed when cpu core is updated |
| 884 | 884 | static TIMER_DEVICE_CALLBACK( h8_timer_irq ) |
| 885 | 885 | { |
| 886 | | |
| 886 | | |
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 |
| r17813 | r17814 | |
|---|---|---|
| 208 | 208 | { |
| 209 | 209 | machine().scheduler().synchronize(); |
| 210 | 210 | soundlatch_byte_w(space, 0x00, data & 0xff); |
| 211 | | |
| 211 | | |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| r17813 | r17814 | |
| 439 | 439 | static void sound_irq(device_t *device, int irq) |
| 440 | 440 | { |
| 441 | 441 | /* IRQ */ |
| 442 | | |
| 442 | | |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | static const ymf262_interface tecmosys_ymf262_interface = |
| r17813 | r17814 | |
|---|---|---|
| 444 | 444 | |
| 445 | 445 | INPUT_CHANGED_MEMBER(snk6502_state::coin_inserted) |
| 446 | 446 | { |
| 447 | cput | |
| 447 | machine().device("maincpu")->execute().set_input_line( | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | static INPUT_PORTS_START( snk6502_generic_joy8way ) |
| r17813 | r17814 | |
|---|---|---|
| 349 | 349 | |
| 350 | 350 | static TIMER_DEVICE_CALLBACK( polyplay_timer_callback ) |
| 351 | 351 | { |
| 352 | cput | |
| 352 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /* game driver */ |
| r17813 | r17814 | |
|---|---|---|
| 256 | 256 | { |
| 257 | 257 | /* if we got a coin, set the IRQ on the main CPU */ |
| 258 | 258 | if (oldval) |
| 259 | cput | |
| 259 | machine().device("maincpu")->execute().set_input_line( | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
| r17813 | r17814 | |
| 335 | 335 | READ8_MEMBER(exidy440_state::exidy440_input_port_3_r) |
| 336 | 336 | { |
| 337 | 337 | /* I/O1 accesses clear the CIRQ flip/flop */ |
| 338 | cput | |
| 338 | machine().device("maincpu")->execute().set_input_line( | |
| 339 | 339 | return ioport("IN3")->read(); |
| 340 | 340 | } |
| 341 | 341 | |
| r17813 | r17814 | |
| 370 | 370 | WRITE8_MEMBER(exidy440_state::exidy440_input_port_3_w) |
| 371 | 371 | { |
| 372 | 372 | /* I/O1 accesses clear the CIRQ flip/flop */ |
| 373 | cput | |
| 373 | machine().device("maincpu")->execute().set_input_line( | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 |
| r17813 | r17814 | |
|---|---|---|
| 200 | 200 | WRITE16_MEMBER(tatsumi_state::cyclwarr_sound_w) |
| 201 | 201 | { |
| 202 | 202 | soundlatch_byte_w(space, 0, data >> 8); |
| 203 | | |
| 203 | | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /***************************************************************************/ |
| r17813 | r17814 | |
| 841 | 841 | |
| 842 | 842 | static void sound_irq(device_t *device, int state) |
| 843 | 843 | { |
| 844 | | |
| 844 | | |
| 845 | 845 | } |
| 846 | 846 | |
| 847 | 847 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
| 856 | 856 | |
| 857 | 857 | static void apache3_68000_reset(device_t *device) |
| 858 | 858 | { |
| 859 | | |
| 859 | | |
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | static MACHINE_RESET( apache3 ) |
| 863 | 863 | { |
| 864 | c | |
| 864 | machine.device("sub2")->execute().set_input_line( | |
| 865 | 865 | |
| 866 | 866 | /* Hook the RESET line, which resets the Z80 */ |
| 867 | 867 | m68k_set_reset_callback(machine.device("sub"), apache3_68000_reset); |
| r17813 | r17814 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | static WRITE_LINE_DEVICE_HANDLER( dealem_vsync_changed ) |
| 134 | 134 | { |
| 135 | | |
| 135 | | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 |
| r17813 | r17814 | |
|---|---|---|
| 534 | 534 | { |
| 535 | 535 | mplay_state *state = space->machine().driver_data<mplay_state>(); |
| 536 | 536 | if(((state->m_bios_6404 & 0x0c) == 0x00) && ((data & 0x0c) == 0x0c)) |
| 537 | | |
| 537 | | |
| 538 | 538 | state->m_bios_6404 = data; |
| 539 | 539 | |
| 540 | 540 | // logerror("BIOS: 0x6404 write: 0x%02x\n", data); |
| r17813 | r17814 | |
|---|---|---|
| 160 | 160 | if (scanline < 256 && scanline == state->m_raster_irq_position - 128) |
| 161 | 161 | { |
| 162 | 162 | machine.primary_screen->update_partial(scanline); |
| 163 | cput | |
| 163 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /* VBLANK interrupt */ |
| 167 | 167 | else if (scanline == 256) |
| 168 | 168 | { |
| 169 | 169 | machine.primary_screen->update_partial(scanline); |
| 170 | cput | |
| 170 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /* adjust for next scanline */ |
| r17813 | r17814 | |
| 185 | 185 | if (scanline < 256 && scanline == state->m_raster_irq_position - 128) |
| 186 | 186 | { |
| 187 | 187 | machine.primary_screen->update_partial(scanline); |
| 188 | cput | |
| 188 | machine.device("maincpu")->execute().set_input_line( | |
| 189 | 189 | } |
| 190 | 190 | else |
| 191 | cput | |
| 191 | machine.device("maincpu")->execute().set_input_line( | |
| 192 | 192 | |
| 193 | 193 | /* VBLANK interrupt */ |
| 194 | 194 | if (scanline == 256) |
| 195 | 195 | { |
| 196 | 196 | machine.primary_screen->update_partial(scanline); |
| 197 | cput | |
| 197 | machine.device("maincpu")->execute().set_input_line( | |
| 198 | 198 | } |
| 199 | 199 | else |
| 200 | cput | |
| 200 | machine.device("maincpu")->execute().set_input_line( | |
| 201 | 201 | |
| 202 | 202 | /* adjust for next scanline */ |
| 203 | 203 | if (++scanline >= machine.primary_screen->height()) |
| r17813 | r17814 | |
| 238 | 238 | if (ACCESSING_BITS_0_7) |
| 239 | 239 | { |
| 240 | 240 | m_mcu_snd_cmd_latch = data; |
| 241 | c | |
| 241 | machine().device("mcu")->execute().set_input_line( | |
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | |
| r17813 | r17814 | |
| 255 | 255 | if (offset == 0x0fff/2 && ACCESSING_BITS_8_15) |
| 256 | 256 | { |
| 257 | 257 | m_protection_ram[offset] = val; |
| 258 | c | |
| 258 | machine().device("mcu")->execute().set_input_line( | |
| 259 | 259 | /* Line driven, most likely by write line */ |
| 260 | 260 | //machine().scheduler().timer_set(machine().device<cpu_device>("mcu")->cycles_to_attotime(2), FUNC(mcu_irq0_clear)); |
| 261 | 261 | //machine().scheduler().timer_set(machine().device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise)); |
| r17813 | r17814 | |
| 279 | 279 | |
| 280 | 280 | if (offset == 0x0fff || offset == 0x0ffe) |
| 281 | 281 | { |
| 282 | c | |
| 282 | machine().device("mcu")->execute().set_input_line( | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | if (offset&1) ret = (m_protection_ram[offset/2] & 0xff00)>>8; |
| r17813 | r17814 | |
| 305 | 305 | |
| 306 | 306 | WRITE8_MEMBER(m72_state::m72_mcu_ack_w) |
| 307 | 307 | { |
| 308 | c | |
| 308 | machine().device("mcu")->execute().set_input_line( | |
| 309 | 309 | m_mcu_snd_cmd_latch = 0; |
| 310 | 310 | } |
| 311 | 311 | |
| r17813 | r17814 | |
| 325 | 325 | if (offset == 1) |
| 326 | 326 | { |
| 327 | 327 | m_mcu_sample_latch = data; |
| 328 | | |
| 328 | | |
| 329 | 329 | } |
| 330 | 330 | else |
| 331 | 331 | logerror("port: %02x %02x\n", offset, data); |
| r17813 | r17814 | |
|---|---|---|
| 102 | 102 | int combined_state = pia0->irq_a_state() | pia0->irq_b_state() | |
| 103 | 103 | pia1->irq_a_state() | pia1->irq_b_state(); |
| 104 | 104 | |
| 105 | cput | |
| 105 | machine().device("maincpu")->execute().set_input_line( | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| r17813 | r17814 | |
| 126 | 126 | WRITE8_MEMBER(r2dtank_state::audio_command_w) |
| 127 | 127 | { |
| 128 | 128 | soundlatch_byte_w(space, 0, ~data); |
| 129 | | |
| 129 | | |
| 130 | 130 | |
| 131 | 131 | if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", space.device().safe_pc(), data^0xff); |
| 132 | 132 | } |
| r17813 | r17814 | |
| 148 | 148 | data = 0x00; |
| 149 | 149 | |
| 150 | 150 | soundlatch2_byte_w(space, 0, data); |
| 151 | cput | |
| 151 | machine().device("maincpu")->execute().set_input_line( | |
| 152 | 152 | |
| 153 | 153 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", space.device().safe_pc(), data); |
| 154 | 154 | } |
| r17813 | r17814 | |
|---|---|---|
| 72 | 72 | WRITE8_MEMBER(pokechmp_state::pokechmp_sound_w) |
| 73 | 73 | { |
| 74 | 74 | soundlatch_byte_w(space, 0, data); |
| 75 | | |
| 75 | | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 |
| r17813 | r17814 | |
|---|---|---|
| 673 | 673 | |
| 674 | 674 | state->m_m5205_part ^= 1; |
| 675 | 675 | if(!state->m_m5205_part) |
| 676 | | |
| 676 | | |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | |
| r17813 | r17814 | |
| 689 | 689 | { |
| 690 | 690 | m_irq0_ack = data; |
| 691 | 691 | if ((data & 1) == 1) |
| 692 | cput | |
| 692 | machine().device("maincpu")->execute().set_input_line( | |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | static INTERRUPT_GEN( mastboy_interrupt ) |
| r17813 | r17814 | |
|---|---|---|
| 423 | 423 | |
| 424 | 424 | static WRITE8_DEVICE_HANDLER( topspeed_tc0140syt_comm_w ) |
| 425 | 425 | { |
| 426 | | |
| 426 | | |
| 427 | 427 | tc0140syt_comm_w(device, 0, data); |
| 428 | 428 | } |
| 429 | 429 |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | static void update_interrupts(running_machine &machine) |
| 36 | 36 | { |
| 37 | 37 | atarig1_state *state = machine.driver_data<atarig1_state>(); |
| 38 | cputag_set_input_line(machine, "maincpu", 1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | cputag_set_input_line(machine, "maincpu", 2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 |
| r17813 | r17814 | |
|---|---|---|
| 37 | 37 | static void update_interrupts(running_machine &machine) |
| 38 | 38 | { |
| 39 | 39 | toobin_state *state = machine.driver_data<toobin_state>(); |
| 40 | cputag_set_input_line(machine, "maincpu", 1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | cputag_set_input_line(machine, "maincpu", 2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 42 | cputag_set_input_line(machine, "maincpu", 3, state->m_scanline_int_state && state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 42 | machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state && state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 |
| r17813 | r17814 | |
|---|---|---|
| 1521 | 1521 | |
| 1522 | 1522 | WRITE8_MEMBER(aristmk4_state::firq) |
| 1523 | 1523 | { |
| 1524 | cput | |
| 1524 | machine().device("maincpu")->execute().set_input_line( | |
| 1525 | 1525 | } |
| 1526 | 1526 | |
| 1527 | 1527 | static const via6522_interface via_interface = |
| r17813 | r17814 | |
| 1672 | 1672 | |
| 1673 | 1673 | if(timer.machine().root_device().ioport("powerfail")->read()) // send NMI signal if L pressed |
| 1674 | 1674 | { |
| 1675 | | |
| 1675 | | |
| 1676 | 1676 | } |
| 1677 | 1677 | } |
| 1678 | 1678 |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | state->m_time_released = machine.time(); |
| 35 | 35 | |
| 36 | 36 | if (!state->m_mask) |
| 37 | cput | |
| 37 | machine.device("maincpu")->execute().set_input_line( | |
| 38 | 38 | } |
| 39 | 39 | else |
| 40 | 40 | state->m_time_pushed = machine.time(); |
| r17813 | r17814 | |
| 50 | 50 | |
| 51 | 51 | update_plunger(machine); |
| 52 | 52 | |
| 53 | cput | |
| 53 | machine.device("maincpu")->execute().set_input_line( | |
| 54 | 54 | |
| 55 | 55 | scanline = scanline + 32; |
| 56 | 56 | |
| r17813 | r17814 | |
| 132 | 132 | if (i == 7) |
| 133 | 133 | set_led_status(machine(), 0, data & 8); /* start button */ |
| 134 | 134 | |
| 135 | cput | |
| 135 | machine().device("maincpu")->execute().set_input_line( | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| r17813 | r17814 | |
| 151 | 151 | m_mask = ~data & 0x10; |
| 152 | 152 | |
| 153 | 153 | if (m_mask) |
| 154 | cput | |
| 154 | machine().device("maincpu")->execute().set_input_line( | |
| 155 | 155 | |
| 156 | 156 | coin_lockout_global_w(machine(), ~data & 0x08); |
| 157 | 157 |
| r17813 | r17814 | |
|---|---|---|
| 23 | 23 | /* assume Centipede-style interrupt timing */ |
| 24 | 24 | int scanline = param; |
| 25 | 25 | |
| 26 | cput | |
| 26 | machine.device("maincpu")->execute().set_input_line( | |
| 27 | 27 | |
| 28 | 28 | scanline += 32; |
| 29 | 29 | |
| r17813 | r17814 | |
| 77 | 77 | |
| 78 | 78 | WRITE8_MEMBER(runaway_state::runaway_irq_ack_w) |
| 79 | 79 | { |
| 80 | cput | |
| 80 | machine().device("maincpu")->execute().set_input_line( | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r17813 | r17814 | |
|---|---|---|
| 101 | 101 | static TIMER_CALLBACK( subcpu_resume ) |
| 102 | 102 | { |
| 103 | 103 | machine.device<cpu_device>("sub")->resume(SUSPEND_REASON_HALT); |
| 104 | c | |
| 104 | machine.device("sub")->execute().set_input_line( | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | READ8_MEMBER(sothello_state::subcpu_halt_set) |
| r17813 | r17814 | |
| 185 | 185 | |
| 186 | 186 | WRITE8_MEMBER(sothello_state::soundcpu_int_clear_w) |
| 187 | 187 | { |
| 188 | | |
| 188 | | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | static ADDRESS_MAP_START( soundcpu_mem_map, AS_PROGRAM, 8, sothello_state ) |
| r17813 | r17814 | |
| 313 | 313 | |
| 314 | 314 | static void irqhandler(device_t *device, int irq) |
| 315 | 315 | { |
| 316 | | |
| 316 | | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | static void sothello_vdp_interrupt(device_t *, v99x8_device &device, int i) |
| 320 | 320 | { |
| 321 | | |
| 321 | | |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | static TIMER_DEVICE_CALLBACK( sothello_interrupt ) |
| r17813 | r17814 | |
| 332 | 332 | sothello_state *state = device->machine().driver_data<sothello_state>(); |
| 333 | 333 | /* only 4 bits are used */ |
| 334 | 334 | msm5205_data_w( device, state->m_msm_data & 0x0f ); |
| 335 | | |
| 335 | | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 |
| r17813 | r17814 | |
|---|---|---|
| 65 | 65 | WRITE8_MEMBER(toypop_state::toypop_main_interrupt_disable_w) |
| 66 | 66 | { |
| 67 | 67 | m_main_irq_mask = 0; |
| 68 | // cput | |
| 68 | // machine().device("maincpu")->execute().set_input_line( | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | WRITE8_MEMBER(toypop_state::toypop_sound_interrupt_enable_acknowledge_w) |
| 72 | 72 | { |
| 73 | 73 | m_sound_irq_mask = 1; |
| 74 | // | |
| 74 | // | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | WRITE8_MEMBER(toypop_state::toypop_sound_interrupt_disable_w) |
| r17813 | r17814 | |
| 130 | 130 | |
| 131 | 131 | WRITE8_MEMBER(toypop_state::toypop_sound_clear_w) |
| 132 | 132 | { |
| 133 | | |
| 133 | | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | WRITE8_MEMBER(toypop_state::toypop_sound_assert_w) |
| 137 | 137 | { |
| 138 | | |
| 138 | | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | WRITE8_MEMBER(toypop_state::toypop_m68000_clear_w) |
| 142 | 142 | { |
| 143 | c | |
| 143 | machine().device("sub")->execute().set_input_line( | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | WRITE8_MEMBER(toypop_state::toypop_m68000_assert_w) |
| 147 | 147 | { |
| 148 | c | |
| 148 | machine().device("sub")->execute().set_input_line( | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | static MACHINE_RESET( toypop ) |
| r17813 | r17814 | |
| 153 | 153 | toypop_state *state = machine.driver_data<toypop_state>(); |
| 154 | 154 | |
| 155 | 155 | state->m_main_irq_mask = 0; |
| 156 | cput | |
| 156 | machine.device("maincpu")->execute().set_input_line( | |
| 157 | 157 | |
| 158 | 158 | state->m_sound_irq_mask = 0; |
| 159 | cput | |
| 159 | machine.device("audiocpu")->execute().set_input_line( | |
| 160 | 160 | |
| 161 | 161 | state->m_interrupt_enable_68k = 0; |
| 162 | 162 | } |
| r17813 | r17814 | |
|---|---|---|
| 1821 | 1821 | { |
| 1822 | 1822 | m_io_share_ram[0xfff] = 0x0000; |
| 1823 | 1823 | m_io_share_ram[0xe00] = 0xffff; |
| 1824 | cput | |
| 1824 | machine().device("maincpu")->execute().set_input_line( | |
| 1825 | 1825 | } |
| 1826 | 1826 | else if (m_io_share_ram[0xfff] == 0x4004 || m_io_share_ram[0xfff] == 0x4000) |
| 1827 | 1827 | { |
| 1828 | 1828 | m_io_share_ram[0xfff] = 0x0000; |
| 1829 | cput | |
| 1829 | machine().device("maincpu")->execute().set_input_line( | |
| 1830 | 1830 | } |
| 1831 | 1831 | else if (m_io_share_ram[0xfff] == 0x7004) |
| 1832 | 1832 | { |
| 1833 | 1833 | // this command seems to turn off interrupts on TLCS... |
| 1834 | 1834 | m_io_share_ram[0xfff] = 0x0000; |
| 1835 | cput | |
| 1835 | machine().device("maincpu")->execute().set_input_line( | |
| 1836 | 1836 | } |
| 1837 | 1837 | else |
| 1838 | 1838 | { |
| 1839 | 1839 | // normally just raise INT0 on TLCS and let it handle the command |
| 1840 | cputag_set_input_line(machine(), "iocpu", TLCS900_INT0, ASSERT_LINE); | |
| 1841 | cputag_set_input_line(machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 1840 | machine().device("iocpu")->execute().set_input_line(TLCS900_INT0, ASSERT_LINE); | |
| 1841 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 1842 | 1842 | |
| 1843 | 1843 | // The PPC always goes to busy loop waiting for TLCS here, so we can free up the timeslice. |
| 1844 | 1844 | // Only do it for HDD access and backup RAM for now... |
| r17813 | r17814 | |
| 1924 | 1924 | } |
| 1925 | 1925 | #endif |
| 1926 | 1926 | |
| 1927 | cputag_set_input_line(machine(), "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 1928 | cputag_set_input_line(machine(), "iocpu", TLCS900_INT0, CLEAR_LINE); | |
| 1927 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 1928 | machine().device("iocpu")->execute().set_input_line(TLCS900_INT0, CLEAR_LINE); | |
| 1929 | 1929 | |
| 1930 | cput | |
| 1930 | machine().device("iocpu")->execute().set_input_line( | |
| 1931 | 1931 | |
| 1932 | 1932 | // The PPC is now free to continue running |
| 1933 | 1933 | //machine().scheduler().trigger(PPC_TLCS_COMM_TRIGGER); |
| r17813 | r17814 | |
| 2447 | 2447 | |
| 2448 | 2448 | static INTERRUPT_GEN( taitotz_vbi ) |
| 2449 | 2449 | { |
| 2450 | | |
| 2450 | | |
| 2451 | 2451 | } |
| 2452 | 2452 | |
| 2453 | 2453 | static void ide_interrupt(device_t *device, int state) |
| 2454 | 2454 | { |
| 2455 | | |
| 2455 | | |
| 2456 | 2456 | } |
| 2457 | 2457 | |
| 2458 | 2458 | static const powerpc_config ppc603e_config = |
| r17813 | r17814 | |
|---|---|---|
| 436 | 436 | int scanline = param; |
| 437 | 437 | |
| 438 | 438 | if(scanline == 248) // vblank-out irq |
| 439 | cput | |
| 439 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 440 | 440 | |
| 441 | 441 | if(scanline == 0) // sprite buffer irq |
| 442 | cput | |
| 442 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | static MACHINE_CONFIG_START( olibochu, olibochu_state ) |
| r17813 | r17814 | |
|---|---|---|
| 53 | 53 | machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40); |
| 54 | 54 | |
| 55 | 55 | if (machine.root_device().ioport("IN0")->read() & 0x40) |
| 56 | cput | |
| 56 | machine.device("maincpu")->execute().set_input_line( | |
| 57 | 57 | |
| 58 | 58 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline); |
| 59 | 59 | } |
| r17813 | r17814 | |
|---|---|---|
| 59 | 59 | if (ACCESSING_BITS_0_7) |
| 60 | 60 | { |
| 61 | 61 | soundlatch_byte_w(space, offset, data); |
| 62 | | |
| 62 | | |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 |
| r17813 | r17814 | |
|---|---|---|
| 202 | 202 | |
| 203 | 203 | static TIMER_CALLBACK( interrupt_gen ) |
| 204 | 204 | { |
| 205 | cput | |
| 205 | machine.device("maincpu")->execute().set_input_line( | |
| 206 | 206 | machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(interrupt_gen)); |
| 207 | 207 | } |
| 208 | 208 |
| r17813 | r17814 | |
|---|---|---|
| 286 | 286 | |
| 287 | 287 | WRITE8_MEMBER(kingdrby_state::sound_cmd_w) |
| 288 | 288 | { |
| 289 | | |
| 289 | | |
| 290 | 290 | m_sound_cmd = data; |
| 291 | 291 | /* soundlatch is unneeded since we are already using perfect interleave. */ |
| 292 | 292 | // soundlatch_byte_w(space,0, data); |
| r17813 | r17814 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | READ8_MEMBER(superqix_state::nmi_ack_r) |
| 318 | 318 | { |
| 319 | cput | |
| 319 | machine().device("maincpu")->execute().set_input_line( | |
| 320 | 320 | return sqix_system_status_r(space, 0); |
| 321 | 321 | } |
| 322 | 322 | |
| r17813 | r17814 | |
| 370 | 370 | // logerror("Z80 sends command %02x\n",param); |
| 371 | 371 | state->m_from_z80 = param; |
| 372 | 372 | state->m_from_mcu_pending = 0; |
| 373 | c | |
| 373 | machine.device("mcu")->execute().set_input_line( | |
| 374 | 374 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); |
| 375 | 375 | } |
| 376 | 376 |
| r17813 | r17814 | |
|---|---|---|
| 39 | 39 | static void update_interrupts(running_machine &machine) |
| 40 | 40 | { |
| 41 | 41 | cyberbal_state *state = machine.driver_data<cyberbal_state>(); |
| 42 | cputag_set_input_line(machine, "maincpu", 1, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 43 | cputag_set_input_line(machine, "extra", 1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 42 | machine.device("maincpu")->execute().set_input_line(1, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 43 | machine.device("extra")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| r17813 | r17814 | |
| 71 | 71 | cyberbal_sound_reset(machine); |
| 72 | 72 | |
| 73 | 73 | /* Extra CPU (second M68k) doesn't run until reset */ |
| 74 | c | |
| 74 | machine.device("extra")->execute().set_input_line( | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | static void cyberbal2p_update_interrupts(running_machine &machine) |
| 79 | 79 | { |
| 80 | 80 | cyberbal_state *state = machine.driver_data<cyberbal_state>(); |
| 81 | cputag_set_input_line(machine, "maincpu", 1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 82 | cputag_set_input_line(machine, "maincpu", 3, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 81 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 82 | machine.device("maincpu")->execute().set_input_line(3, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| r17813 | r17814 | |
| 134 | 134 | |
| 135 | 135 | WRITE16_MEMBER(cyberbal_state::p2_reset_w) |
| 136 | 136 | { |
| 137 | c | |
| 137 | machine().device("extra")->execute().set_input_line( | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 |
| r17813 | r17814 | |
|---|---|---|
| 495 | 495 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 496 | 496 | static void irqhandler(device_t *device, int irq) |
| 497 | 497 | { |
| 498 | | |
| 498 | | |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 396 | 396 | state->m_v60_irq_timer[1] = machine.device<timer_device>("v60_irq1"); |
| 397 | 397 | |
| 398 | 398 | /* clear IRQ lines */ |
| 399 | cput | |
| 399 | machine.device("maincpu")->execute().set_input_line( | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | |
| r17813 | r17814 | |
| 418 | 418 | for (vector = 0; vector < 5; vector++) |
| 419 | 419 | if (effirq & (1 << vector)) |
| 420 | 420 | { |
| 421 | cput | |
| 421 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 422 | 422 | break; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | /* if we didn't find any, clear the interrupt line */ |
| 426 | 426 | if (vector == 5) |
| 427 | cput | |
| 427 | machine.device("maincpu")->execute().set_input_line( | |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | |
| r17813 | r17814 | |
| 703 | 703 | case 0x1c/2: |
| 704 | 704 | state->m_system32_displayenable[which] = (data & 0x02); |
| 705 | 705 | if (which == 0) |
| 706 | | |
| 706 | | |
| 707 | 707 | break; |
| 708 | 708 | } |
| 709 | 709 | } |
| r17813 | r17814 | |
| 1056 | 1056 | for (vector = 0; vector < 3; vector++) |
| 1057 | 1057 | if (effirq & (1 << vector)) |
| 1058 | 1058 | { |
| 1059 | cput | |
| 1059 | machine.device("soundcpu")->execute().set_input_line_and_vector( | |
| 1060 | 1060 | break; |
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | 1063 | /* if we didn't find any, clear the interrupt line */ |
| 1064 | 1064 | if (vector == 3) |
| 1065 | cput | |
| 1065 | machine.device("soundcpu")->execute().set_input_line( | |
| 1066 | 1066 | } |
| 1067 | 1067 | |
| 1068 | 1068 |
| r17813 | r17814 | |
|---|---|---|
| 341 | 341 | WRITE8_MEMBER(looping_state::level2_irq_set) |
| 342 | 342 | { |
| 343 | 343 | if (!(data & 1)) |
| 344 | cput | |
| 344 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | |
| 348 | 348 | WRITE8_MEMBER(looping_state::main_irq_ack_w) |
| 349 | 349 | { |
| 350 | 350 | if (data == 0) |
| 351 | cput | |
| 351 | machine().device("maincpu")->execute().set_input_line( | |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | |
| 355 | 355 | WRITE8_MEMBER(looping_state::looping_souint_clr) |
| 356 | 356 | { |
| 357 | 357 | if (data == 0) |
| 358 | | |
| 358 | | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| 362 | 362 | WRITE_LINE_MEMBER(looping_state::looping_spcint) |
| 363 | 363 | { |
| 364 | cput | |
| 364 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | |
| 368 | 368 | WRITE8_MEMBER(looping_state::looping_soundlatch_w) |
| 369 | 369 | { |
| 370 | 370 | soundlatch_byte_w(space, offset, data); |
| 371 | cput | |
| 371 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 |
| r17813 | r17814 | |
|---|---|---|
| 180 | 180 | static void update_interrupts(running_machine &machine) |
| 181 | 181 | { |
| 182 | 182 | badlands_state *state = machine.driver_data<badlands_state>(); |
| 183 | cputag_set_input_line(machine, "maincpu", 1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 184 | cputag_set_input_line(machine, "maincpu", 2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 183 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 184 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
| r17813 | r17814 | |
| 678 | 678 | static void update_interrupts_bootleg(running_machine &machine) |
| 679 | 679 | { |
| 680 | 680 | badlands_state *state = machine.driver_data<badlands_state>(); |
| 681 | cput | |
| 681 | machine.device("maincpu")->execute().set_input_line( | |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 |
| r17813 | r17814 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | WRITE8_MEMBER(supertnk_state::supertnk_interrupt_ack_w) |
| 175 | 175 | { |
| 176 | cput | |
| 176 | machine().device("maincpu")->execute().set_input_line( | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static void update_interrupts(running_machine &machine) |
| 35 | 35 | { |
| 36 | 36 | offtwall_state *state = machine.driver_data<offtwall_state>(); |
| 37 | cputag_set_input_line(machine, "maincpu", 4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | cputag_set_input_line(machine, "maincpu", 6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r17813 | r17814 | |
| 103 | 103 | if (ACCESSING_BITS_0_7) |
| 104 | 104 | { |
| 105 | 105 | /* bit 4 resets the sound CPU */ |
| 106 | c | |
| 106 | machine().device("jsa")->execute().set_input_line( | |
| 107 | 107 | if (!(data & 0x10)) atarijsa_reset(); |
| 108 | 108 | } |
| 109 | 109 |
| r17813 | r17814 | |
|---|---|---|
| 147 | 147 | WRITE8_MEMBER(esh_state::nmi_line_w) |
| 148 | 148 | { |
| 149 | 149 | if (data == 0x00) |
| 150 | cput | |
| 150 | machine().device("maincpu")->execute().set_input_line( | |
| 151 | 151 | if (data == 0x01) |
| 152 | cput | |
| 152 | machine().device("maincpu")->execute().set_input_line( | |
| 153 | 153 | |
| 154 | 154 | if (data != 0x00 && data != 0x01) |
| 155 | 155 | logerror("NMI line got a weird value!\n"); |
| r17813 | r17814 | |
| 278 | 278 | |
| 279 | 279 | static TIMER_CALLBACK( irq_stop ) |
| 280 | 280 | { |
| 281 | cput | |
| 281 | machine.device("maincpu")->execute().set_input_line( | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | static INTERRUPT_GEN( vblank_callback_esh ) |
| r17813 | r17814 | |
|---|---|---|
| 64 | 64 | WRITE8_MEMBER(skykid_state::skykid_subreset_w) |
| 65 | 65 | { |
| 66 | 66 | int bit = !BIT(offset,11); |
| 67 | c | |
| 67 | machine().device("mcu")->execute().set_input_line( | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | WRITE8_MEMBER(skykid_state::skykid_bankswitch_w) |
| r17813 | r17814 | |
| 77 | 77 | int bit = !BIT(offset,11); |
| 78 | 78 | m_main_irq_mask = bit; |
| 79 | 79 | if (!bit) |
| 80 | cput | |
| 80 | machine().device("maincpu")->execute().set_input_line( | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | WRITE8_MEMBER(skykid_state::skykid_irq_2_ctrl_w) |
| r17813 | r17814 | |
| 85 | 85 | int bit = !BIT(offset,13); |
| 86 | 86 | m_mcu_irq_mask = bit; |
| 87 | 87 | if (!bit) |
| 88 | c | |
| 88 | machine().device("mcu")->execute().set_input_line( | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static MACHINE_START( skykid ) |
| r17813 | r17814 | |
|---|---|---|
| 1055 | 1055 | if (i==0 || (i==4 && !data)) |
| 1056 | 1056 | { |
| 1057 | 1057 | m_blitter_busy = 0; |
| 1058 | if (m_firq_level) cput | |
| 1058 | if (m_firq_level) machine().device("maincpu")->execute().set_input_line( | |
| 1059 | 1059 | } |
| 1060 | 1060 | else |
| 1061 | 1061 | { |
| r17813 | r17814 | |
| 1555 | 1555 | |
| 1556 | 1556 | // In Halley's Comet, NMI is used exclusively to handle coin input |
| 1557 | 1557 | case 56*3: |
| 1558 | | |
| 1558 | | |
| 1559 | 1559 | break; |
| 1560 | 1560 | |
| 1561 | 1561 | // FIRQ drives gameplay; we need both types of NMI each frame. |
| 1562 | 1562 | case 56*2: |
| 1563 | state->m_mVectorType = 1; | |
| 1563 | state->m_mVectorType = 1; | |
| 1564 | 1564 | break; |
| 1565 | 1565 | |
| 1566 | 1566 | case 56: |
| 1567 | state->m_mVectorType = 0; | |
| 1567 | state->m_mVectorType = 0; | |
| 1568 | 1568 | break; |
| 1569 | 1569 | } |
| 1570 | 1570 | } |
| r17813 | r17814 | |
| 1582 | 1582 | break; |
| 1583 | 1583 | |
| 1584 | 1584 | case 56*3: |
| 1585 | | |
| 1585 | | |
| 1586 | 1586 | break; |
| 1587 | 1587 | |
| 1588 | 1588 | case 56*2: |
| 1589 | 1589 | case 56*1: |
| 1590 | 1590 | // FIRQ must not happen when the blitter is being updated or it'll cause serious screen artifacts |
| 1591 | if (!state->m_blitter_busy) | |
| 1591 | if (!state->m_blitter_busy) | |
| 1592 | 1592 | break; |
| 1593 | 1593 | } |
| 1594 | 1594 | } |
| r17813 | r17814 | |
| 1605 | 1605 | m_io_ram[0x9c] = data; |
| 1606 | 1606 | |
| 1607 | 1607 | if (m_firq_level) m_firq_level--; |
| 1608 | cput | |
| 1608 | machine().device("maincpu")->execute().set_input_line( | |
| 1609 | 1609 | } |
| 1610 | 1610 | |
| 1611 | 1611 | |
| r17813 | r17814 | |
| 1620 | 1620 | |
| 1621 | 1621 | m_io_ram[0x8a] = data; |
| 1622 | 1622 | soundlatch_byte_w(space,offset,data); |
| 1623 | | |
| 1623 | | |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 |
| r17813 | r17814 | |
|---|---|---|
| 199 | 199 | if (m_pending_vb_int && !(!(m_v_ctrl & 0x8000))) // #define DISABLE_VB_INT (!(state->m_v_ctrl & 0x8000)) |
| 200 | 200 | { |
| 201 | 201 | m_pending_vb_int = 0; |
| 202 | cput | |
| 202 | machine().device("maincpu")->execute().set_input_line( | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | } |
| r17813 | r17814 | |
| 417 | 417 | if (state != CLEAR_LINE) |
| 418 | 418 | { |
| 419 | 419 | //logerror("IDE interrupt asserted\n"); |
| 420 | | |
| 420 | | |
| 421 | 421 | } |
| 422 | 422 | else |
| 423 | 423 | { |
| 424 | 424 | //logerror("IDE interrupt cleared\n"); |
| 425 | | |
| 425 | | |
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 |
| r17813 | r17814 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | static TIMER_CALLBACK( clear_irq_cb ) |
| 161 | 161 | { |
| 162 | cput | |
| 162 | machine.device("maincpu")->execute().set_input_line( | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static INTERRUPT_GEN( assert_irq ) |
| r17813 | r17814 | |
|---|---|---|
| 248 | 248 | { |
| 249 | 249 | neogeo_state *state = machine.driver_data<neogeo_state>(); |
| 250 | 250 | |
| 251 | cputag_set_input_line(machine, "maincpu", 1, state->m_vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 252 | cputag_set_input_line(machine, "maincpu", 2, state->m_display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 253 | cputag_set_input_line(machine, "maincpu", 3, state->m_irq3_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 251 | machine.device("maincpu")->execute().set_input_line(1, state->m_vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 252 | machine.device("maincpu")->execute().set_input_line(2, state->m_display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 253 | machine.device("maincpu")->execute().set_input_line(3, state->m_irq3_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
| r17813 | r17814 | |
| 775 | 775 | { |
| 776 | 776 | state->m_audio_cpu_rom_source_last = state->m_audio_cpu_rom_source; |
| 777 | 777 | |
| 778 | | |
| 778 | | |
| 779 | 779 | |
| 780 | 780 | if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space->device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); |
| 781 | 781 | } |
| r17813 | r17814 | |
|---|---|---|
| 379 | 379 | { |
| 380 | 380 | buggychl_state *state = machine.driver_data<buggychl_state>(); |
| 381 | 381 | |
| 382 | c | |
| 382 | machine.device("mcu")->execute().set_input_line( | |
| 383 | 383 | |
| 384 | 384 | state->m_sound_nmi_enable = 0; |
| 385 | 385 | state->m_pending_nmi = 0; |
| r17813 | r17814 | |
|---|---|---|
| 655 | 655 | |
| 656 | 656 | static TIMER_CALLBACK( nmi_clear ) |
| 657 | 657 | { |
| 658 | cput | |
| 658 | machine.device("maincpu")->execute().set_input_line( | |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 |
| r17813 | r17814 | |
|---|---|---|
| 590 | 590 | int scanline = param; |
| 591 | 591 | |
| 592 | 592 | if(scanline == 240) // vblank-out irq |
| 593 | | |
| 593 | | |
| 594 | 594 | |
| 595 | 595 | if(scanline == 0) // vblank-in irq? (update palette and layers) |
| 596 | | |
| 596 | | |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | static MACHINE_CONFIG_START( acommand, acommand_state ) |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | case 0x40: |
| 37 | 37 | m_status &= ~0x08; |
| 38 | c | |
| 38 | machine().device("sub")->execute().set_input_line_and_vector( | |
| 39 | 39 | break; |
| 40 | 40 | |
| 41 | 41 | case 0x80: |
| r17813 | r17814 | |
| 58 | 58 | |
| 59 | 59 | case 0x80: |
| 60 | 60 | m_status &= ~0x04; |
| 61 | cput | |
| 61 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 62 | 62 | break; |
| 63 | 63 | } |
| 64 | 64 | } |
| r17813 | r17814 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | if (state->irq_toggle==0) |
| 111 | 111 | { |
| 112 | cput | |
| 112 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 113 | 113 | } |
| 114 | 114 | else |
| 115 | 115 | { |
| 116 | cput | |
| 116 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 |
| r17813 | r17814 | |
|---|---|---|
| 100 | 100 | |
| 101 | 101 | static TIMER_CALLBACK( groundfx_interrupt5 ) |
| 102 | 102 | { |
| 103 | cput | |
| 103 | machine.device("maincpu")->execute().set_input_line( | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 |
| r17813 | r17814 | |
|---|---|---|
| 93 | 93 | state->m_gunx[which] = beamx; |
| 94 | 94 | |
| 95 | 95 | /* fire the IRQ at the correct moment */ |
| 96 | cput | |
| 96 | machine.device("maincpu")->execute().set_input_line( | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | static TIMER_CALLBACK( clear_gun_interrupt ) |
| 101 | 101 | { |
| 102 | 102 | /* clear the IRQ on the next scanline? */ |
| 103 | cput | |
| 103 | machine.device("maincpu")->execute().set_input_line( | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 |
| r17813 | r17814 | |
|---|---|---|
| 344 | 344 | |
| 345 | 345 | READ32_MEMBER(srmp5_state::irq_ack_clear) |
| 346 | 346 | { |
| 347 | c | |
| 347 | machine().device("sub")->execute().set_input_line( | |
| 348 | 348 | return 0; |
| 349 | 349 | } |
| 350 | 350 |
| r17813 | r17814 | |
|---|---|---|
| 20 | 20 | WRITE8_MEMBER(suprloco_state::suprloco_soundport_w) |
| 21 | 21 | { |
| 22 | 22 | soundlatch_byte_w(space, 0, data); |
| 23 | | |
| 23 | | |
| 24 | 24 | /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */ |
| 25 | 25 | device_spin_until_time(&space.device(), attotime::from_usec(50)); |
| 26 | 26 | } |
| r17813 | r17814 | |
|---|---|---|
| 101 | 101 | WRITE16_MEMBER(wwfwfest_state::wwfwfest_irq_ack_w) |
| 102 | 102 | { |
| 103 | 103 | if (offset == 0) |
| 104 | cput | |
| 104 | machine().device("maincpu")->execute().set_input_line( | |
| 105 | 105 | |
| 106 | 106 | else |
| 107 | cput | |
| 107 | machine().device("maincpu")->execute().set_input_line( | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE16_MEMBER(wwfwfest_state::wwfwfest_flipscreen_w) |
| r17813 | r17814 | |
| 165 | 165 | WRITE16_MEMBER(wwfwfest_state::wwfwfest_soundwrite) |
| 166 | 166 | { |
| 167 | 167 | soundlatch_byte_w(space,1,data & 0xff); |
| 168 | | |
| 168 | | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /******************************************************************************* |
| r17813 | r17814 | |
| 351 | 351 | { |
| 352 | 352 | if (scanline > 0) |
| 353 | 353 | timer.machine().primary_screen->update_partial(scanline - 1); |
| 354 | | |
| 354 | | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /* Vblank is raised on scanline 248 */ |
| 358 | 358 | if (scanline == 248) |
| 359 | 359 | { |
| 360 | 360 | timer.machine().primary_screen->update_partial(scanline - 1); |
| 361 | | |
| 361 | | |
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
| r17813 | r17814 | |
| 370 | 370 | |
| 371 | 371 | static void dd3_ymirq_handler(device_t *device, int irq) |
| 372 | 372 | { |
| 373 | | |
| 373 | | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | static INTERRUPT_GEN( feversoc_irq ) |
| 249 | 249 | { |
| 250 | | |
| 250 | | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | static MACHINE_CONFIG_START( feversoc, feversoc_state ) |
| r17813 | r17814 | |
|---|---|---|
| 1089 | 1089 | |
| 1090 | 1090 | static void ppu_irq( device_t *device, int *ppu_regs ) |
| 1091 | 1091 | { |
| 1092 | | |
| 1092 | | |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | /* our ppu interface */ |
| r17813 | r17814 | |
|---|---|---|
| 110 | 110 | if (ACCESSING_BITS_0_7) |
| 111 | 111 | { |
| 112 | 112 | soundlatch_byte_w(space, 0, data & 0xff); |
| 113 | cput | |
| 113 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| r17813 | r17814 | |
| 457 | 457 | |
| 458 | 458 | static void irqhandler(device_t *device, int linestate) |
| 459 | 459 | { |
| 460 | | |
| 460 | | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | static const ym3438_interface ym3438_config = |
| r17813 | r17814 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | if (!(m_out & 0x2000) && m_interrupt_line_active) |
| 95 | 95 | { |
| 96 | cput | |
| 96 | machine().device("maincpu")->execute().set_input_line( | |
| 97 | 97 | m_interrupt_line_active = 0; |
| 98 | 98 | } |
| 99 | 99 | |
| r17813 | r17814 | |
| 217 | 217 | if (param == interrupt_scanline) |
| 218 | 218 | { |
| 219 | 219 | if (state->m_out & 0x2000) |
| 220 | | |
| 220 | | |
| 221 | 221 | timer.adjust(timer.machine().primary_screen->time_until_pos(param + 1), param+1); |
| 222 | 222 | state->m_interrupt_line_active = 1; |
| 223 | 223 | } |
| 224 | 224 | else |
| 225 | 225 | { |
| 226 | 226 | if (state->m_interrupt_line_active) |
| 227 | | |
| 227 | | |
| 228 | 228 | timer.adjust(timer.machine().primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline); |
| 229 | 229 | state->m_interrupt_line_active = 0; |
| 230 | 230 | } |
| r17813 | r17814 | |
| 270 | 270 | { |
| 271 | 271 | pkscram_state *state = device->machine().driver_data<pkscram_state>(); |
| 272 | 272 | if(state->m_out & 0x10) |
| 273 | | |
| 273 | | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 69 | 69 | static MACHINE_RESET( vastar ) |
| 70 | 70 | { |
| 71 | 71 | /* we must start with the second CPU halted */ |
| 72 | c | |
| 72 | machine.device("sub")->execute().set_input_line( | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | WRITE8_MEMBER(vastar_state::vastar_hold_cpu2_w) |
| 76 | 76 | { |
| 77 | 77 | /* I'm not sure that this works exactly like this */ |
| 78 | c | |
| 78 | machine().device("sub")->execute().set_input_line( | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | READ8_MEMBER(vastar_state::vastar_sharedram_r) |
| r17813 | r17814 | |
|---|---|---|
| 724 | 724 | |
| 725 | 725 | intc_regs->icfp = (intc_regs->icpr & intc_regs->icmr) & intc_regs->iclr; |
| 726 | 726 | intc_regs->icip = (intc_regs->icpr & intc_regs->icmr) & (~intc_regs->iclr); |
| 727 | cputag_set_input_line(machine, "maincpu", ARM7_FIRQ_LINE, intc_regs->icfp ? ASSERT_LINE : CLEAR_LINE); | |
| 728 | cputag_set_input_line(machine, "maincpu", ARM7_IRQ_LINE, intc_regs->icip ? ASSERT_LINE : CLEAR_LINE); | |
| 727 | machine.device("maincpu")->execute().set_input_line(ARM7_FIRQ_LINE, intc_regs->icfp ? ASSERT_LINE : CLEAR_LINE); | |
| 728 | machine.device("maincpu")->execute().set_input_line(ARM7_IRQ_LINE, intc_regs->icip ? ASSERT_LINE : CLEAR_LINE); | |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | static void pxa255_set_irq_line(running_machine& machine, UINT32 line, int irq_state) |
| r17813 | r17814 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | WRITE8_MEMBER(baraduke_state::baraduke_irq_ack_w) |
| 157 | 157 | { |
| 158 | cput | |
| 158 | machine().device("maincpu")->execute().set_input_line( | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 |
| r17813 | r17814 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | WRITE_LINE_MEMBER(guab_state::ptm_irq) |
| 108 | 108 | { |
| 109 | cput | |
| 109 | machine().device("maincpu")->execute().set_input_line( | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static const ptm6840_interface ptm_intf = |
| r17813 | r17814 | |
| 130 | 130 | |
| 131 | 131 | static void tms_interrupt(running_machine &machine, int state) |
| 132 | 132 | { |
| 133 | cput | |
| 133 | machine.device("maincpu")->execute().set_input_line( | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static const struct tms34061_interface tms34061intf = |
| r17813 | r17814 | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | fdc.status |= DATA_REQUEST; |
| 383 | cput | |
| 383 | machine.device("maincpu")->execute().set_input_line( | |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
| r17813 | r17814 | |
| 475 | 475 | fdc.sector)); |
| 476 | 476 | |
| 477 | 477 | /* Trigger a DRQ interrupt on the CPU */ |
| 478 | cput | |
| 478 | machine().device("maincpu")->execute().set_input_line( | |
| 479 | 479 | fdc.status |= DATA_REQUEST; |
| 480 | 480 | break; |
| 481 | 481 | } |
| r17813 | r17814 | |
| 520 | 520 | fdc.data = data; |
| 521 | 521 | |
| 522 | 522 | /* Clear the DRQ */ |
| 523 | cput | |
| 523 | machine().device("maincpu")->execute().set_input_line( | |
| 524 | 524 | |
| 525 | 525 | /* Queue an event to write the data if write command was specified */ |
| 526 | 526 | if (fdc.cmd & 0x20) |
| r17813 | r17814 | |
| 558 | 558 | retval = fdc.data; |
| 559 | 559 | |
| 560 | 560 | /* Clear the DRQ */ |
| 561 | cput | |
| 561 | machine().device("maincpu")->execute().set_input_line( | |
| 562 | 562 | fdc.status &= ~DATA_REQUEST; |
| 563 | 563 | break; |
| 564 | 564 | } |
| r17813 | r17814 | |
|---|---|---|
| 300 | 300 | static void update_mpu68_interrupts(running_machine &machine) |
| 301 | 301 | { |
| 302 | 302 | mpu4vid_state *state = machine.driver_data<mpu4vid_state>(); |
| 303 | cputag_set_input_line(machine, "video", 1, state->m_m6840_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 304 | cputag_set_input_line(machine, "video", 2, state->m_m6850_irq_state ? CLEAR_LINE : ASSERT_LINE); | |
| 305 | cputag_set_input_line(machine, "video", 3, state->m_scn2674->get_irq_state() ? ASSERT_LINE : CLEAR_LINE); | |
| 303 | machine.device("video")->execute().set_input_line(1, state->m_m6840_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 304 | machine.device("video")->execute().set_input_line(2, state->m_m6850_irq_state ? CLEAR_LINE : ASSERT_LINE); | |
| 305 | machine.device("video")->execute().set_input_line(3, state->m_scn2674->get_irq_state() ? ASSERT_LINE : CLEAR_LINE); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /* Communications with 6809 board */ |
| r17813 | r17814 | |
| 341 | 341 | { |
| 342 | 342 | mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>(); |
| 343 | 343 | drvstate->m_m68k_acia_cts = !state; |
| 344 | | |
| 344 | | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | static ACIA6850_INTERFACE( m6809_acia_if ) |
| r17813 | r17814 | |
|---|---|---|
| 32 | 32 | int scanline = param; |
| 33 | 33 | |
| 34 | 34 | if(scanline == 240 && k051960_is_irq_enabled(state->m_k051960)) // vblank irq |
| 35 | | |
| 35 | | |
| 36 | 36 | else if(((scanline % 32) == 0) && (k051960_is_nmi_enabled(state->m_k051960))) // timer irq |
| 37 | | |
| 37 | | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | WRITE8_MEMBER(chqflag_state::chqflag_bankswitch_w) |
| r17813 | r17814 | |
|---|---|---|
| 776 | 776 | |
| 777 | 777 | static void irqhandler(device_t *device, int irq) |
| 778 | 778 | { |
| 779 | | |
| 779 | | |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | static void irqhandler_2203_1(device_t *device, int irq) |
| 783 | 783 | { |
| 784 | 784 | dooyong_state *state = device->machine().driver_data<dooyong_state>(); |
| 785 | 785 | state->m_interrupt_line_1=irq; |
| 786 | | |
| 786 | | |
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | static void irqhandler_2203_2(device_t *device, int irq) |
| 790 | 790 | { |
| 791 | 791 | dooyong_state *state = device->machine().driver_data<dooyong_state>(); |
| 792 | 792 | state->m_interrupt_line_2=irq; |
| 793 | | |
| 793 | | |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | static const ym2203_interface ym2203_interface_1 = |
| r17813 | r17814 | |
| 1068 | 1068 | int scanline = param; |
| 1069 | 1069 | |
| 1070 | 1070 | if(scanline == 248) // vblank-out irq |
| 1071 | | |
| 1071 | | |
| 1072 | 1072 | |
| 1073 | 1073 | if(scanline == 120) // timer irq? |
| 1074 | | |
| 1074 | | |
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | 1077 |
| r17813 | r17814 | |
|---|---|---|
| 280 | 280 | |
| 281 | 281 | static void ppu_irq( device_t *device, int *ppu_regs ) |
| 282 | 282 | { |
| 283 | | |
| 283 | | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /* our ppu interface */ |
| r17813 | r17814 | |
|---|---|---|
| 528 | 528 | |
| 529 | 529 | static INTERRUPT_GEN( mcu_irq ) |
| 530 | 530 | { |
| 531 | | |
| 531 | | |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | static MACHINE_CONFIG_START( rbmk, rbmk_state ) |
| r17813 | r17814 | |
|---|---|---|
| 202 | 202 | { |
| 203 | 203 | if(space.device().safe_pcbase()==0x29e9)// || space.device().safe_pcbase()==0x1b3f) //29f5 |
| 204 | 204 | { |
| 205 | cput | |
| 205 | machine().device("maincpu")->execute().set_input_line( | |
| 206 | 206 | } |
| 207 | 207 | // else |
| 208 | 208 | // logerror("%x \n", space.device().safe_pcbase()); |
| r17813 | r17814 | |
|---|---|---|
| 126 | 126 | { |
| 127 | 127 | rpunch_state *drvstate = device->machine().driver_data<rpunch_state>(); |
| 128 | 128 | drvstate->m_ym2151_irq = state; |
| 129 | | |
| 129 | | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| r17813 | r17814 | |
| 161 | 161 | rpunch_state *state = machine.driver_data<rpunch_state>(); |
| 162 | 162 | state->m_sound_busy = 1; |
| 163 | 163 | state->m_sound_data = param; |
| 164 | cput | |
| 164 | machine.device("audiocpu")->execute().set_input_line( | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
| r17813 | r17814 | |
| 175 | 175 | READ8_MEMBER(rpunch_state::sound_command_r) |
| 176 | 176 | { |
| 177 | 177 | m_sound_busy = 0; |
| 178 | | |
| 178 | | |
| 179 | 179 | return m_sound_data; |
| 180 | 180 | } |
| 181 | 181 |
| r17813 | r17814 | |
|---|---|---|
| 194 | 194 | static MACHINE_RESET( cloud9 ) |
| 195 | 195 | { |
| 196 | 196 | cloud9_state *state = machine.driver_data<cloud9_state>(); |
| 197 | cput | |
| 197 | machine.device("maincpu")->execute().set_input_line( | |
| 198 | 198 | state->m_irq_state = 0; |
| 199 | 199 | } |
| 200 | 200 |
| r17813 | r17814 | |
|---|---|---|
| 91 | 91 | WRITE16_MEMBER(bingoc_state::main_sound_latch_w) |
| 92 | 92 | { |
| 93 | 93 | soundlatch_byte_w(space,0,data&0xff); |
| 94 | | |
| 94 | | |
| 95 | 95 | } |
| 96 | 96 | #endif |
| 97 | 97 |
| r17813 | r17814 | |
|---|---|---|
| 407 | 407 | int scanline = param; |
| 408 | 408 | |
| 409 | 409 | if(scanline == 256) // vblank irq |
| 410 | cput | |
| 410 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 411 | 411 | else if(((scanline % 64) == 0)) // timer irq, 3 times per given vblank field |
| 412 | cput | |
| 412 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | static INTERRUPT_GEN( chl_mcu_irq ) |
| r17813 | r17814 | |
|---|---|---|
| 134 | 134 | WRITE8_MEMBER(sidepckt_state::sound_cpu_command_w) |
| 135 | 135 | { |
| 136 | 136 | soundlatch_byte_w(space, offset, data); |
| 137 | | |
| 137 | | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | READ8_MEMBER(sidepckt_state::sidepckt_i8751_r) |
| r17813 | r17814 | |
| 148 | 148 | static const int table_2[]={0x8e,0x42,0xad,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa2,0xff}; |
| 149 | 149 | static const int table_3[]={0xbd,0x73,0x80,0xbd,0x73,0xa7,0xbd,0x73,0xe0,0x7e,0x72,0x56,0xff,0xff,0xff,0xff}; |
| 150 | 150 | |
| 151 | cput | |
| 151 | machine().device("maincpu")->execute().set_input_line( | |
| 152 | 152 | |
| 153 | 153 | /* This function takes multiple parameters */ |
| 154 | 154 | if (m_in_math==1) { |
| r17813 | r17814 | |
| 188 | 188 | static const int table_2[]={0x8e,0x42,0xb2,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa7,0xff}; |
| 189 | 189 | static const int table_3[]={0xbd,0x71,0xc8,0xbd,0x71,0xef,0xbd,0x72,0x28,0x7e,0x70,0x9e,0xff,0xff,0xff,0xff}; |
| 190 | 190 | |
| 191 | cput | |
| 191 | machine().device("maincpu")->execute().set_input_line( | |
| 192 | 192 | |
| 193 | 193 | /* This function takes multiple parameters */ |
| 194 | 194 | if (m_in_math==1) { |
| r17813 | r17814 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | WRITE8_MEMBER(starwars_state::irq_ack_w) |
| 76 | 76 | { |
| 77 | cput | |
| 77 | machine().device("maincpu")->execute().set_input_line( | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 |
| r17813 | r17814 | |
|---|---|---|
| 280 | 280 | */ |
| 281 | 281 | WRITE16_MEMBER(cubeqst_state::reset_w) |
| 282 | 282 | { |
| 283 | cputag_set_input_line(machine(), "rotate_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); | |
| 284 | cputag_set_input_line(machine(), "line_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); | |
| 285 | cputag_set_input_line(machine(), "sound_cpu", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); | |
| 283 | machine().device("rotate_cpu")->execute().set_input_line(INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); | |
| 284 | machine().device("line_cpu")->execute().set_input_line(INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); | |
| 285 | machine().device("sound_cpu")->execute().set_input_line(INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); | |
| 286 | 286 | |
| 287 | 287 | /* Swap stack and pointer RAM banks on rising edge of display reset */ |
| 288 | 288 | if (!BIT(m_reset_latch, 0) && BIT(data, 0)) |
| r17813 | r17814 | |
| 451 | 451 | state->m_reset_latch = 0; |
| 452 | 452 | |
| 453 | 453 | /* Auxillary CPUs are held in reset */ |
| 454 | cputag_set_input_line(machine, "sound_cpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 455 | cputag_set_input_line(machine, "rotate_cpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 456 | cputag_set_input_line(machine, "line_cpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 454 | machine.device("sound_cpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 455 | machine.device("rotate_cpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 456 | machine.device("line_cpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 |
| r17813 | r17814 | |
|---|---|---|
| 334 | 334 | |
| 335 | 335 | WRITE_LINE_MEMBER(savquest_state::pc_dma_hrq_changed) |
| 336 | 336 | { |
| 337 | cput | |
| 337 | machine().device("maincpu")->execute().set_input_line( | |
| 338 | 338 | |
| 339 | 339 | /* Assert HLDA */ |
| 340 | 340 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
|---|---|---|
| 513 | 513 | int scanline = param; |
| 514 | 514 | |
| 515 | 515 | if(scanline == 240) // vblank-out irq. controls sprites, sound, i/o |
| 516 | | |
| 516 | | |
| 517 | 517 | |
| 518 | 518 | if(scanline == 0) // vblank-in? controls palette |
| 519 | | |
| 519 | | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | static MACHINE_CONFIG_START( skilldrp, astrocorp_state ) |
| r17813 | r17814 | |
|---|---|---|
| 1157 | 1157 | |
| 1158 | 1158 | static MACHINE_RESET ( coolridr ) |
| 1159 | 1159 | { |
| 1160 | // cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 1161 | cputag_set_input_line(machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 1160 | // machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 1161 | machine.device("soundcpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | 1164 | static MACHINE_CONFIG_START( coolridr, coolridr_state ) |
| r17813 | r17814 | |
|---|---|---|
| 490 | 490 | |
| 491 | 491 | if (!m_link7a_connected) //7B = IRQ, 7A = FIRQ, both = NMI |
| 492 | 492 | { |
| 493 | cput | |
| 493 | machine().device("maincpu")->execute().set_input_line( | |
| 494 | 494 | LOG(("6809 int%d \n", combined_state)); |
| 495 | 495 | } |
| 496 | 496 | else |
| 497 | 497 | { |
| 498 | cput | |
| 498 | machine().device("maincpu")->execute().set_input_line( | |
| 499 | 499 | LOG(("6809 fint%d \n", combined_state)); |
| 500 | 500 | } |
| 501 | 501 | } |
| r17813 | r17814 | |
|---|---|---|
| 1231 | 1231 | { |
| 1232 | 1232 | case cobra_fifo::EVENT_EMPTY: |
| 1233 | 1233 | { |
| 1234 | cput | |
| 1234 | machine().device("subcpu")->execute().set_input_line( | |
| 1235 | 1235 | |
| 1236 | 1236 | // give sub cpu a bit more time to stabilize on the current fifo status |
| 1237 | 1237 | device_spin_until_time(machine().device("maincpu"), attotime::from_usec(1)); |
| r17813 | r17814 | |
| 1241 | 1241 | if (!m_m2s_int_mode) |
| 1242 | 1242 | m_main_int_active |= MAIN_INT_M2S; |
| 1243 | 1243 | |
| 1244 | cput | |
| 1244 | machine().device("maincpu")->execute().set_input_line( | |
| 1245 | 1245 | } |
| 1246 | 1246 | |
| 1247 | 1247 | // EXISR needs to update for the *next* instruction during FIFO tests |
| r17813 | r17814 | |
| 1427 | 1427 | if (!m_m2s_int_mode) |
| 1428 | 1428 | m_main_int_active &= ~MAIN_INT_M2S; |
| 1429 | 1429 | |
| 1430 | | |
| 1430 | | |
| 1431 | 1431 | |
| 1432 | 1432 | // EXISR needs to update for the *next* instruction during FIFO tests |
| 1433 | 1433 | // TODO: try to abort the timeslice before the next instruction? |
| r17813 | r17814 | |
| 1484 | 1484 | if ((m_vblank_enable & 0x80) == 0) |
| 1485 | 1485 | { |
| 1486 | 1486 | // clear the interrupt |
| 1487 | | |
| 1487 | | |
| 1488 | 1488 | } |
| 1489 | 1489 | } |
| 1490 | 1490 | if (ACCESSING_BITS_16_23) |
| r17813 | r17814 | |
| 1503 | 1503 | m_main_int_active &= ~MAIN_INT_S2M; |
| 1504 | 1504 | |
| 1505 | 1505 | // clear the interrupt |
| 1506 | | |
| 1506 | | |
| 1507 | 1507 | } |
| 1508 | 1508 | } |
| 1509 | 1509 | if (ACCESSING_BITS_8_15) |
| r17813 | r17814 | |
| 1529 | 1529 | m_main_int_active &= ~MAIN_INT_M2S; |
| 1530 | 1530 | |
| 1531 | 1531 | // clear the interrupt |
| 1532 | | |
| 1532 | | |
| 1533 | 1533 | } |
| 1534 | 1534 | } |
| 1535 | 1535 | |
| r17813 | r17814 | |
| 1722 | 1722 | // fire off an interrupt if enabled |
| 1723 | 1723 | if (m_s2m_int_enable & 0x80) |
| 1724 | 1724 | { |
| 1725 | | |
| 1725 | | |
| 1726 | 1726 | } |
| 1727 | 1727 | } |
| 1728 | 1728 | if (ACCESSING_BITS_16_23) |
| r17813 | r17814 | |
| 3192 | 3192 | |
| 3193 | 3193 | if (cobra->m_vblank_enable & 0x80) |
| 3194 | 3194 | { |
| 3195 | | |
| 3195 | | |
| 3196 | 3196 | cobra->m_gfx_unk_flag = 0x80; |
| 3197 | 3197 | } |
| 3198 | 3198 | } |
| r17813 | r17814 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | WRITE8_MEMBER(tryout_state::tryout_nmi_ack_w) |
| 29 | 29 | { |
| 30 | cput | |
| 30 | machine().device("maincpu")->execute().set_input_line( | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | WRITE8_MEMBER(tryout_state::tryout_sound_w) |
| 34 | 34 | { |
| 35 | 35 | soundlatch_byte_w(space, 0, data); |
| 36 | | |
| 36 | | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /*this is actually irq/nmi mask, polls only four values at start up (81->01->81->01) and then |
| 40 | 40 | stays on this state.*/ |
| 41 | 41 | WRITE8_MEMBER(tryout_state::tryout_sound_irq_ack_w) |
| 42 | 42 | { |
| 43 | // | |
| 43 | // | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER(tryout_state::tryout_bankswitch_w) |
| r17813 | r17814 | |
| 84 | 84 | INPUT_CHANGED_MEMBER(tryout_state::coin_inserted) |
| 85 | 85 | { |
| 86 | 86 | if (oldval) |
| 87 | cput | |
| 87 | machine().device("maincpu")->execute().set_input_line( | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static INPUT_PORTS_START( tryout ) |
| r17813 | r17814 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | WRITE_LINE_MEMBER(photoply_state::pc_dma_hrq_changed) |
| 65 | 65 | { |
| 66 | cput | |
| 66 | machine().device("maincpu")->execute().set_input_line( | |
| 67 | 67 | |
| 68 | 68 | /* Assert HLDA */ |
| 69 | 69 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
| 171 | 171 | |
| 172 | 172 | WRITE_LINE_MEMBER(photoply_state::pic8259_1_set_int_line) |
| 173 | 173 | { |
| 174 | cput | |
| 174 | machine().device("maincpu")->execute().set_input_line( | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | READ8_MEMBER(photoply_state::get_slave_ack) |
| r17813 | r17814 | |
|---|---|---|
| 324 | 324 | |
| 325 | 325 | WRITE8_MEMBER(tempest_state::wdclr_w) |
| 326 | 326 | { |
| 327 | cput | |
| 327 | machine().device("maincpu")->execute().set_input_line( | |
| 328 | 328 | machine().watchdog_reset(); |
| 329 | 329 | } |
| 330 | 330 |
| r17813 | r17814 | |
|---|---|---|
| 41 | 41 | { |
| 42 | 42 | eprom_state *state = machine.driver_data<eprom_state>(); |
| 43 | 43 | |
| 44 | cput | |
| 44 | machine.device("maincpu")->execute().set_input_line( | |
| 45 | 45 | |
| 46 | 46 | if (machine.device("extra") != NULL) |
| 47 | c | |
| 47 | machine.device("extra")->execute().set_input_line( | |
| 48 | 48 | |
| 49 | cput | |
| 49 | machine.device("maincpu")->execute().set_input_line( | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r17813 | r17814 | |
| 110 | 110 | { |
| 111 | 111 | /* bit 0: reset extra CPU */ |
| 112 | 112 | if (data & 1) |
| 113 | c | |
| 113 | machine().device("extra")->execute().set_input_line( | |
| 114 | 114 | else |
| 115 | c | |
| 115 | machine().device("extra")->execute().set_input_line( | |
| 116 | 116 | |
| 117 | 117 | /* bits 1-4: screen intensity */ |
| 118 | 118 | m_screen_intensity = (data & 0x1e) >> 1; |
| r17813 | r17814 | |
|---|---|---|
| 516 | 516 | |
| 517 | 517 | static void ppu_irq( device_t *device, int *ppu_regs ) |
| 518 | 518 | { |
| 519 | | |
| 519 | | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | /* our ppu interface */ |
| r17813 | r17814 | |
|---|---|---|
| 205 | 205 | int scanline = param; |
| 206 | 206 | |
| 207 | 207 | if(scanline == 240) // vblank-out irq |
| 208 | cput | |
| 208 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 209 | 209 | |
| 210 | 210 | if(scanline == 0) // vblank-in irq |
| 211 | cput | |
| 211 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 |
| r17813 | r17814 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | WRITE_LINE_MEMBER(quakeat_state::quakeat_pic8259_1_set_int_line) |
| 119 | 119 | { |
| 120 | cput | |
| 120 | machine().device("maincpu")->execute().set_input_line( | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | READ8_MEMBER(quakeat_state::get_slave_ack) |
| r17813 | r17814 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | WRITE32_MEMBER(ultrsprt_state::int_ack_w) |
| 99 | 99 | { |
| 100 | cput | |
| 100 | machine().device("maincpu")->execute().set_input_line( | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static MACHINE_START( ultrsprt ) |
| r17813 | r17814 | |
| 213 | 213 | if (irq == 0) |
| 214 | 214 | /*generic_pulse_irq_line(machine.device("audiocpu"), INPUT_LINE_IRQ5, 1)*/; |
| 215 | 215 | else |
| 216 | cput | |
| 216 | machine.device("audiocpu")->execute().set_input_line( | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | static const k056800_interface ultrsprt_k056800_interface = |
| r17813 | r17814 | |
|---|---|---|
| 550 | 550 | |
| 551 | 551 | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 552 | 552 | { |
| 553 | | |
| 553 | | |
| 554 | 554 | LOG(("6809 irq%d \n",state)); |
| 555 | 555 | } |
| 556 | 556 | |
| r17813 | r17814 | |
| 564 | 564 | |
| 565 | 565 | static void cpu0_nmi(running_machine &machine, int state) |
| 566 | 566 | { |
| 567 | cput | |
| 567 | machine.device("maincpu")->execute().set_input_line( | |
| 568 | 568 | LOG(("6809 nmi%d \n",state)); |
| 569 | 569 | } |
| 570 | 570 |
| r17813 | r17814 | |
|---|---|---|
| 662 | 662 | |
| 663 | 663 | if ((state_) && (state->m_spu_ctrl & 0x0400)) |
| 664 | 664 | { |
| 665 | | |
| 665 | | |
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 |
| r17813 | r17814 | |
|---|---|---|
| 332 | 332 | |
| 333 | 333 | static TIMER_CALLBACK( irq_stop ) |
| 334 | 334 | { |
| 335 | cput | |
| 335 | machine.device("maincpu")->execute().set_input_line( | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | static INTERRUPT_GEN( vblank_callback_lgp ) |
| r17813 | r17814 | |
|---|---|---|
| 211 | 211 | int scanline = param; |
| 212 | 212 | |
| 213 | 213 | if(scanline == 240) // vblank-out irq |
| 214 | cput | |
| 214 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 215 | 215 | |
| 216 | 216 | if(scanline == 0) // vblank-in irq |
| 217 | cput | |
| 217 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | static TIMER_DEVICE_CALLBACK( deadang_sub_scanline ) |
| r17813 | r17814 | |
| 222 | 222 | int scanline = param; |
| 223 | 223 | |
| 224 | 224 | if(scanline == 240) // vblank-out irq |
| 225 | c | |
| 225 | timer.machine().device("sub")->execute().set_input_line_and_vector( | |
| 226 | 226 | |
| 227 | 227 | if(scanline == 0) // vblank-in irq |
| 228 | c | |
| 228 | timer.machine().device("sub")->execute().set_input_line_and_vector( | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /* Machine Drivers */ |
| r17813 | r17814 | |
|---|---|---|
| 161 | 161 | READ8_MEMBER(cliffhgr_state::cliff_irq_ack_r) |
| 162 | 162 | { |
| 163 | 163 | /* deassert IRQ on the CPU */ |
| 164 | cput | |
| 164 | machine().device("maincpu")->execute().set_input_line( | |
| 165 | 165 | |
| 166 | 166 | return 0x00; |
| 167 | 167 | } |
| r17813 | r17814 | |
| 206 | 206 | if (state->m_phillips_code & 0x800000) |
| 207 | 207 | { |
| 208 | 208 | // printf("%2d:code = %06X\n", param, phillips_code); |
| 209 | cput | |
| 209 | machine.device("maincpu")->execute().set_input_line( | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | state->m_irq_timer->adjust(machine.primary_screen->time_until_pos(param * 2), param); |
| r17813 | r17814 | |
| 214 | 214 | |
| 215 | 215 | WRITE_LINE_MEMBER(cliffhgr_state::vdp_interrupt) |
| 216 | 216 | { |
| 217 | cput | |
| 217 | machine().device("maincpu")->execute().set_input_line( | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 |
| r17813 | r17814 | |
|---|---|---|
| 45 | 45 | static void update_irq_state(running_machine &machine) |
| 46 | 46 | { |
| 47 | 47 | artmagic_state *state = machine.driver_data<artmagic_state>(); |
| 48 | cputag_set_input_line(machine, "maincpu", 4, state->m_tms_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 49 | cputag_set_input_line(machine, "maincpu", 5, state->m_hack_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 48 | machine.device("maincpu")->execute().set_input_line(4, state->m_tms_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 49 | machine.device("maincpu")->execute().set_input_line(5, state->m_hack_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 |
| r17813 | r17814 | |
|---|---|---|
| 549 | 549 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ |
| 550 | 550 | static void irqhandler(device_t *device, int linestate) |
| 551 | 551 | { |
| 552 | | |
| 552 | | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | WRITE_LINE_MEMBER(hexion_state::hexion_irq_ack_w) |
| 106 | 106 | { |
| 107 | cput | |
| 107 | machine().device("maincpu")->execute().set_input_line( | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE_LINE_MEMBER(hexion_state::hexion_nmi_ack_w) |
| 111 | 111 | { |
| 112 | cput | |
| 112 | machine().device("maincpu")->execute().set_input_line( | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8, hexion_state ) |
| r17813 | r17814 | |
| 205 | 205 | int scanline = param; |
| 206 | 206 | |
| 207 | 207 | if(scanline == 256) |
| 208 | | |
| 208 | | |
| 209 | 209 | else if ((scanline == 85) || (scanline == 170)) //TODO |
| 210 | | |
| 210 | | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | static const k053252_interface hexion_k053252_intf = |
| r17813 | r17814 | |
|---|---|---|
| 115 | 115 | mcu_data = srcspace->read_byte(mcu_address ); |
| 116 | 116 | dstspace->write_byte(mcu_address-0x10, mcu_data); |
| 117 | 117 | } |
| 118 | c | |
| 118 | machine().device("sub")->execute().set_input_line( | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static void galpani2_mcu_nmi1(running_machine &machine) |
| r17813 | r17814 | |
|---|---|---|
| 472 | 472 | |
| 473 | 473 | WRITE_LINE_MEMBER(midqslvr_state::pc_dma_hrq_changed) |
| 474 | 474 | { |
| 475 | cput | |
| 475 | machine().device("maincpu")->execute().set_input_line( | |
| 476 | 476 | |
| 477 | 477 | /* Assert HLDA */ |
| 478 | 478 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
|---|---|---|
| 159 | 159 | { |
| 160 | 160 | /* Bit 13 = Resets the slave CPU */ |
| 161 | 161 | if ((data & 0x2000) && !(m_last & 0x2000)) |
| 162 | c | |
| 162 | machine().device("slave")->execute().set_input_line( | |
| 163 | 163 | |
| 164 | 164 | /* Bits 14-15 = Coin counters */ |
| 165 | 165 | coin_counter_w(machine(), 0, data & 0x8000); |
| r17813 | r17814 | |
| 175 | 175 | exterm_state *state = machine.driver_data<exterm_state>(); |
| 176 | 176 | /* data is latched independently for both sound CPUs */ |
| 177 | 177 | state->m_master_sound_latch = state->m_slave_sound_latch = param; |
| 178 | cputag_set_input_line(machine, "audiocpu", M6502_IRQ_LINE, ASSERT_LINE); | |
| 179 | cputag_set_input_line(machine, "audioslave", M6502_IRQ_LINE, ASSERT_LINE); | |
| 178 | machine.device("audiocpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 179 | machine.device("audioslave")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
| r17813 | r17814 | |
| 199 | 199 | exterm_state *state = timer.machine().driver_data<exterm_state>(); |
| 200 | 200 | /* bit 0 of the sound control determines if the NMI is actually delivered */ |
| 201 | 201 | if (state->m_sound_control & 0x01) |
| 202 | | |
| 202 | | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| r17813 | r17814 | |
| 225 | 225 | READ8_MEMBER(exterm_state::sound_master_latch_r) |
| 226 | 226 | { |
| 227 | 227 | /* read latch and clear interrupt */ |
| 228 | | |
| 228 | | |
| 229 | 229 | return m_master_sound_latch; |
| 230 | 230 | } |
| 231 | 231 | |
| r17813 | r17814 | |
| 233 | 233 | READ8_MEMBER(exterm_state::sound_slave_latch_r) |
| 234 | 234 | { |
| 235 | 235 | /* read latch and clear interrupt */ |
| 236 | | |
| 236 | | |
| 237 | 237 | return m_slave_sound_latch; |
| 238 | 238 | } |
| 239 | 239 | |
| r17813 | r17814 | |
| 250 | 250 | READ8_MEMBER(exterm_state::sound_nmi_to_slave_r) |
| 251 | 251 | { |
| 252 | 252 | /* a read from here triggers an NMI pulse to the slave */ |
| 253 | | |
| 253 | | |
| 254 | 254 | return 0xff; |
| 255 | 255 | } |
| 256 | 256 |
| r17813 | r17814 | |
|---|---|---|
| 859 | 859 | |
| 860 | 860 | READ32_MEMBER(seibuspi_state::spi_int_r) |
| 861 | 861 | { |
| 862 | cput | |
| 862 | machine().device("maincpu")->execute().set_input_line( | |
| 863 | 863 | return 0xffffffff; |
| 864 | 864 | } |
| 865 | 865 | |
| r17813 | r17814 | |
| 907 | 907 | if( ACCESSING_BITS_0_7 ) { |
| 908 | 908 | if( data & 0x1 ) { |
| 909 | 909 | m_z80_prg_fifo_pos = 0; |
| 910 | | |
| 910 | | |
| 911 | 911 | } else { |
| 912 | | |
| 912 | | |
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 | } |
| r17813 | r17814 | |
| 1098 | 1098 | static void irqhandler(device_t *device, int state) |
| 1099 | 1099 | { |
| 1100 | 1100 | if (state) |
| 1101 | cput | |
| 1101 | device->machine().device("soundcpu")->execute().set_input_line_and_vector( | |
| 1102 | 1102 | else |
| 1103 | | |
| 1103 | | |
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | WRITE32_MEMBER(seibuspi_state::sys386f2_eeprom_w) |
| r17813 | r17814 | |
| 1816 | 1816 | UINT8 *rombase = state->memregion("user1")->base(); |
| 1817 | 1817 | UINT8 flash_data = rombase[0x1ffffc]; |
| 1818 | 1818 | |
| 1819 | cput | |
| 1819 | machine.device("soundcpu")->execute().set_input_line( | |
| 1820 | 1820 | device_set_irq_callback(machine.device("maincpu"), spi_irq_callback); |
| 1821 | 1821 | |
| 1822 | 1822 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sound_fifo_r),state)); |
| r17813 | r17814 | |
|---|---|---|
| 225 | 225 | |
| 226 | 226 | /* bits 10-15 are counted down over time */ |
| 227 | 227 | |
| 228 | cput | |
| 228 | machine().device("dsp")->execute().set_input_line( | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | READ16_MEMBER(coolpool_state::amerdart_dsp_bio_line_r) |
| r17813 | r17814 | |
| 251 | 251 | { |
| 252 | 252 | |
| 253 | 253 | // logerror("%08x:IOP read %04x\n",space.device().safe_pc(),m_iop_answer); |
| 254 | cput | |
| 254 | machine().device("maincpu")->execute().set_input_line( | |
| 255 | 255 | |
| 256 | 256 | return m_iop_answer; |
| 257 | 257 | } |
| r17813 | r17814 | |
| 277 | 277 | |
| 278 | 278 | // logerror("%08x:DSP answer %04x\n", space.device().safe_pc(), data); |
| 279 | 279 | m_iop_answer = data; |
| 280 | cput | |
| 280 | machine().device("maincpu")->execute().set_input_line( | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r17813 | r17814 | |
| 444 | 444 | coin_counter_w(machine(), 0, ~data & 0x0001); |
| 445 | 445 | coin_counter_w(machine(), 1, ~data & 0x0002); |
| 446 | 446 | |
| 447 | cput | |
| 447 | machine().device("dsp")->execute().set_input_line( | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | |
| r17813 | r17814 | |
| 462 | 462 | |
| 463 | 463 | state->m_iop_cmd = param; |
| 464 | 464 | state->m_cmd_pending = 1; |
| 465 | cput | |
| 465 | machine.device("dsp")->execute().set_input_line( | |
| 466 | 466 | /* the DSP polls the status bit so it isn't strictly */ |
| 467 | 467 | /* necessary to also have an IRQ */ |
| 468 | 468 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); |
| r17813 | r17814 | |
| 480 | 480 | { |
| 481 | 481 | |
| 482 | 482 | logerror("%08x:IOP read %04x\n",space.device().safe_pc(),m_iop_answer); |
| 483 | cput | |
| 483 | machine().device("maincpu")->execute().set_input_line( | |
| 484 | 484 | |
| 485 | 485 | return m_iop_answer; |
| 486 | 486 | } |
| r17813 | r17814 | |
| 508 | 508 | |
| 509 | 509 | logerror("%08x:IOP answer %04x\n", space.device().safe_pc(), data); |
| 510 | 510 | m_iop_answer = data; |
| 511 | cput | |
| 511 | machine().device("maincpu")->execute().set_input_line( | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 |
| r17813 | r17814 | |
|---|---|---|
| 481 | 481 | /* bit 6 = feedback from sound board that read occurrred */ |
| 482 | 482 | |
| 483 | 483 | /* bit 7 controls the sound CPU's NMI line */ |
| 484 | | |
| 484 | | |
| 485 | 485 | |
| 486 | 486 | /* remaining bits are used for video RAM banking */ |
| 487 | 487 | system1_videoram_bank_w(device, offset, data); |
| r17813 | r17814 | |
| 524 | 524 | static TIMER_DEVICE_CALLBACK( soundirq_gen ) |
| 525 | 525 | { |
| 526 | 526 | /* sound IRQ is generated on 32V, 96V, ... and auto-acknowledged */ |
| 527 | | |
| 527 | | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | |
| r17813 | r17814 | |
| 548 | 548 | Bit 0 -> Directly connected to Z80 /INT line |
| 549 | 549 | */ |
| 550 | 550 | m_mcu_control = data; |
| 551 | cputag_set_input_line(machine(), "maincpu", INPUT_LINE_HALT, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 552 | cputag_set_input_line(machine(), "maincpu", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 551 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 552 | machine().device("maincpu")->execute().set_input_line(0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | |
| r17813 | r17814 | |
| 659 | 659 | WRITE8_MEMBER(system1_state::nob_maincpu_latch_w) |
| 660 | 660 | { |
| 661 | 661 | m_nob_maincpu_latch = data; |
| 662 | c | |
| 662 | machine().device("mcu")->execute().set_input_line( | |
| 663 | 663 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); |
| 664 | 664 | } |
| 665 | 665 |
| r17813 | r17814 | |
|---|---|---|
| 620 | 620 | MechMtr_update(i, data & (1 << i) ); |
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | if ( data & 0x1F ) cput | |
| 623 | if ( data & 0x1F ) machine().device("maincpu")->execute().set_input_line( | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | /////////////////////////////////////////////////////////////////////////// |
| r17813 | r17814 | |
| 1036 | 1036 | WRITE8_MEMBER(bfm_sc2_state::vid_uart_tx_w) |
| 1037 | 1037 | { |
| 1038 | 1038 | adder2_send(data); |
| 1039 | c | |
| 1039 | machine().device("adder2")->execute().set_input_line( | |
| 1040 | 1040 | |
| 1041 | 1041 | LOG_SERIAL(("sadder %02X (%c)\n",data, data )); |
| 1042 | 1042 | } |
| r17813 | r17814 | |
|---|---|---|
| 380 | 380 | #if 0 |
| 381 | 381 | static TIMER_CALLBACK( tmmjprd_blit_done ) |
| 382 | 382 | { |
| 383 | cput | |
| 383 | machine.device("maincpu")->execute().set_input_line( | |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | static void tmmjprd_do_blit(running_machine &machine) |
| r17813 | r17814 | |
| 737 | 737 | int scanline = param; |
| 738 | 738 | |
| 739 | 739 | if(scanline == 224) // vblank-out irq |
| 740 | | |
| 740 | | |
| 741 | 741 | |
| 742 | 742 | if(scanline == 736) // blitter irq? |
| 743 | | |
| 743 | | |
| 744 | 744 | |
| 745 | 745 | } |
| 746 | 746 |
| r17813 | r17814 | |
|---|---|---|
| 418 | 418 | |
| 419 | 419 | static TIMER_DEVICE_CALLBACK( interrupt_callback ) |
| 420 | 420 | { |
| 421 | | |
| 421 | | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | static MACHINE_RESET(skns) |
| r17813 | r17814 | |
| 625 | 625 | if(ACCESSING_BITS_8_15) |
| 626 | 626 | { /* Interrupt Clear, do we need these? */ |
| 627 | 627 | /* if(data&0x01) |
| 628 | cput | |
| 628 | machine().device("maincpu")->execute().set_input_line( | |
| 629 | 629 | if(data&0x02) |
| 630 | cput | |
| 630 | machine().device("maincpu")->execute().set_input_line( | |
| 631 | 631 | if(data&0x04) |
| 632 | cput | |
| 632 | machine().device("maincpu")->execute().set_input_line( | |
| 633 | 633 | if(data&0x08) |
| 634 | cput | |
| 634 | machine().device("maincpu")->execute().set_input_line( | |
| 635 | 635 | if(data&0x10) |
| 636 | cput | |
| 636 | machine().device("maincpu")->execute().set_input_line( | |
| 637 | 637 | if(data&0x20) |
| 638 | cput | |
| 638 | machine().device("maincpu")->execute().set_input_line( | |
| 639 | 639 | if(data&0x40) |
| 640 | cput | |
| 640 | machine().device("maincpu")->execute().set_input_line( | |
| 641 | 641 | if(data&0x80) |
| 642 | cput | |
| 642 | machine().device("maincpu")->execute().set_input_line( | |
| 643 | 643 | |
| 644 | 644 | /* 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 */ |
| 645 | 645 | if (space.device().safe_pc()==0x04013B42) |
| r17813 | r17814 | |
|---|---|---|
| 524 | 524 | |
| 525 | 525 | static TIMER_CALLBACK( network_interrupt_callback ) |
| 526 | 526 | { |
| 527 | cput | |
| 527 | machine.device("maincpu")->execute().set_input_line( | |
| 528 | 528 | machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(network_interrupt_callback)); |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
| 532 | 532 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 533 | 533 | { |
| 534 | cput | |
| 534 | machine.device("maincpu")->execute().set_input_line( | |
| 535 | 535 | machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(vblank_interrupt_callback)); |
| 536 | 536 | } |
| 537 | 537 | |
| r17813 | r17814 | |
| 540 | 540 | { |
| 541 | 541 | namcofl_state *state = machine.driver_data<namcofl_state>(); |
| 542 | 542 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); |
| 543 | cput | |
| 543 | machine.device("maincpu")->execute().set_input_line( | |
| 544 | 544 | state->m_raster_interrupt_timer->adjust(machine.primary_screen->frame_period()); |
| 545 | 545 | } |
| 546 | 546 |
| r17813 | r17814 | |
|---|---|---|
| 990 | 990 | { |
| 991 | 991 | luckgrln_state *state = device->machine().driver_data<luckgrln_state>(); |
| 992 | 992 | if(state->m_nmi_enable) |
| 993 | | |
| 993 | | |
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | static MACHINE_CONFIG_START( luckgrln, luckgrln_state ) |
| r17813 | r17814 | |
|---|---|---|
| 49 | 49 | WRITE8_MEMBER(shootout_state::sound_cpu_command_w) |
| 50 | 50 | { |
| 51 | 51 | soundlatch_byte_w( space, offset, data ); |
| 52 | | |
| 52 | | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | WRITE8_MEMBER(shootout_state::shootout_flipscreen_w) |
| r17813 | r17814 | |
| 108 | 108 | |
| 109 | 109 | INPUT_CHANGED_MEMBER(shootout_state::coin_inserted) |
| 110 | 110 | { |
| 111 | cput | |
| 111 | machine().device("maincpu")->execute().set_input_line( | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | static INPUT_PORTS_START( shootout ) |
| r17813 | r17814 | |
| 230 | 230 | |
| 231 | 231 | static void shootout_snd_irq(device_t *device, int linestate) |
| 232 | 232 | { |
| 233 | | |
| 233 | | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | static void shootout_snd2_irq(device_t *device, int linestate) |
| 237 | 237 | { |
| 238 | | |
| 238 | | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 401 | 401 | |
| 402 | 402 | if (state->m_is_drivedge) |
| 403 | 403 | { |
| 404 | cputag_set_input_line(machine, "maincpu", 3, state->m_vint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 405 | cputag_set_input_line(machine, "maincpu", 4, state->m_xint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 406 | cputag_set_input_line(machine, "maincpu", 5, state->m_qint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 404 | machine.device("maincpu")->execute().set_input_line(3, state->m_vint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 405 | machine.device("maincpu")->execute().set_input_line(4, state->m_xint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 406 | machine.device("maincpu")->execute().set_input_line(5, state->m_qint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 407 | 407 | } |
| 408 | 408 | else |
| 409 | 409 | { |
| 410 | cputag_set_input_line(machine, "maincpu", 1, state->m_vint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 411 | cputag_set_input_line(machine, "maincpu", 2, state->m_xint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 412 | cputag_set_input_line(machine, "maincpu", 3, state->m_qint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 410 | machine.device("maincpu")->execute().set_input_line(1, state->m_vint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 411 | machine.device("maincpu")->execute().set_input_line(2, state->m_xint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 412 | machine.device("maincpu")->execute().set_input_line(3, state->m_qint_state ? ASSERT_LINE : CLEAR_LINE); | |
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | |
| r17813 | r17814 | |
| 449 | 449 | { |
| 450 | 450 | MACHINE_RESET_CALL(itech32); |
| 451 | 451 | |
| 452 | cputag_set_input_line(machine, "dsp1", INPUT_LINE_RESET, ASSERT_LINE); | |
| 453 | cputag_set_input_line(machine, "dsp2", INPUT_LINE_RESET, ASSERT_LINE); | |
| 452 | machine.device("dsp1")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 453 | machine.device("dsp2")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 454 | 454 | STOP_TMS_SPINNING(machine, 0); |
| 455 | 455 | STOP_TMS_SPINNING(machine, 1); |
| 456 | 456 | } |
| r17813 | r17814 | |
| 641 | 641 | itech32_state *state = machine.driver_data<itech32_state>(); |
| 642 | 642 | state->m_sound_data = param; |
| 643 | 643 | state->m_sound_int_state = 1; |
| 644 | cput | |
| 644 | machine.device("soundcpu")->execute().set_input_line( | |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | |
| r17813 | r17814 | |
| 667 | 667 | |
| 668 | 668 | READ8_MEMBER(itech32_state::sound_data_r) |
| 669 | 669 | { |
| 670 | | |
| 670 | | |
| 671 | 671 | m_sound_int_state = 0; |
| 672 | 672 | return m_sound_data; |
| 673 | 673 | } |
| r17813 | r17814 | |
| 764 | 764 | |
| 765 | 765 | WRITE8_MEMBER(itech32_state::firq_clear_w) |
| 766 | 766 | { |
| 767 | | |
| 767 | | |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | |
| r17813 | r17814 | |
| 777 | 777 | |
| 778 | 778 | WRITE32_MEMBER(itech32_state::tms_reset_assert_w) |
| 779 | 779 | { |
| 780 | cputag_set_input_line(machine(), "dsp1", INPUT_LINE_RESET, ASSERT_LINE); | |
| 781 | cputag_set_input_line(machine(), "dsp2", INPUT_LINE_RESET, ASSERT_LINE); | |
| 780 | machine().device("dsp1")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 781 | machine().device("dsp2")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | |
| r17813 | r17814 | |
| 787 | 787 | /* kludge to prevent crash on first boot */ |
| 788 | 788 | if ((m_tms1_ram[0] & 0xff000000) == 0) |
| 789 | 789 | { |
| 790 | cput | |
| 790 | machine().device("dsp1")->execute().set_input_line( | |
| 791 | 791 | STOP_TMS_SPINNING(machine(), 0); |
| 792 | 792 | } |
| 793 | 793 | if ((m_tms2_ram[0] & 0xff000000) == 0) |
| 794 | 794 | { |
| 795 | cput | |
| 795 | machine().device("dsp2")->execute().set_input_line( | |
| 796 | 796 | STOP_TMS_SPINNING(machine(), 1); |
| 797 | 797 | } |
| 798 | 798 | } |
| r17813 | r17814 | |
|---|---|---|
| 453 | 453 | |
| 454 | 454 | /*TODO: check the PCB and see how the halt / reset lines are connected. */ |
| 455 | 455 | if (machine.device("sub") != NULL) |
| 456 | c | |
| 456 | machine.device("sub")->execute().set_input_line( | |
| 457 | 457 | |
| 458 | 458 | state->m_port_a_in = 0; |
| 459 | 459 | state->m_port_a_out = 0; |
| r17813 | r17814 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | WRITE_LINE_MEMBER(calchase_state::pc_dma_hrq_changed) |
| 238 | 238 | { |
| 239 | cput | |
| 239 | machine().device("maincpu")->execute().set_input_line( | |
| 240 | 240 | |
| 241 | 241 | /* Assert HLDA */ |
| 242 | 242 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
| 824 | 824 | |
| 825 | 825 | WRITE_LINE_MEMBER(calchase_state::calchase_pic8259_1_set_int_line) |
| 826 | 826 | { |
| 827 | cput | |
| 827 | machine().device("maincpu")->execute().set_input_line( | |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | READ8_MEMBER(calchase_state::get_slave_ack) |
| r17813 | r17814 | |
| 885 | 885 | |
| 886 | 886 | static void set_gate_a20(running_machine &machine, int a20) |
| 887 | 887 | { |
| 888 | cput | |
| 888 | machine.device("maincpu")->execute().set_input_line( | |
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | static void keyboard_interrupt(running_machine &machine, int state) |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | WRITE8_MEMBER(sspeedr_state::sspeedr_int_ack_w) |
| 37 | 37 | { |
| 38 | cput | |
| 38 | machine().device("maincpu")->execute().set_input_line( | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r17813 | r17814 | |
|---|---|---|
| 227 | 227 | |
| 228 | 228 | static TIMER_CALLBACK( interrupt5 ) |
| 229 | 229 | { |
| 230 | cput | |
| 230 | machine.device("maincpu")->execute().set_input_line( | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
| r17813 | r17814 | |
| 452 | 452 | output_set_value("Lamp_6", (data >> 5) & 1 ); |
| 453 | 453 | output_set_value("Wheel_vibration", (data >> 6) & 1 ); |
| 454 | 454 | |
| 455 | c | |
| 455 | machine().device("sub")->execute().set_input_line( | |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | READ32_MEMBER(undrfire_state::cbombers_adc_r) |
| r17813 | r17814 | |
|---|---|---|
| 131 | 131 | /* bit 6: FOG OUT */ |
| 132 | 132 | /* bit 7: RADARON */ |
| 133 | 133 | if ((diff & 0x01) && !(data & 0x01)) |
| 134 | cput | |
| 134 | machine().device("maincpu")->execute().set_input_line( | |
| 135 | 135 | if ((diff & 0x02) && !(data & 0x02)) |
| 136 | 136 | m_collide = m_collmode = 0; |
| 137 | 137 | break; |
| r17813 | r17814 | |
| 190 | 190 | case 0x0e: /* OUT14 */ |
| 191 | 191 | /* O-21 connector */ |
| 192 | 192 | soundlatch_byte_w(space, 0, data); |
| 193 | | |
| 193 | | |
| 194 | 194 | break; |
| 195 | 195 | } |
| 196 | 196 | } |
| r17813 | r17814 | |
| 269 | 269 | case 0x04: /* OUT4 */ |
| 270 | 270 | /* bit 0: interrupt enable for CPU 1 */ |
| 271 | 271 | if ((diff & 0x01) && !(data & 0x01)) |
| 272 | c | |
| 272 | machine().device("sub")->execute().set_input_line( | |
| 273 | 273 | break; |
| 274 | 274 | |
| 275 | 275 | case 0x05: /* OUT5 - unused */ |
| r17813 | r17814 | |
|---|---|---|
| 248 | 248 | pia6->irq_a_state() | pia6->irq_b_state() | |
| 249 | 249 | ptm2->irq_state(); |
| 250 | 250 | |
| 251 | cput | |
| 251 | machine().device("maincpu")->execute().set_input_line( | |
| 252 | 252 | LOG(("6808 int%d \n", combined_state)); |
| 253 | 253 | } |
| 254 | 254 |
| r17813 | r17814 | |
|---|---|---|
| 906 | 906 | if (irq[i]) |
| 907 | 907 | { |
| 908 | 908 | if (LOG_NILE_IRQS) logerror(" 1"); |
| 909 | cput | |
| 909 | machine.device("maincpu")->execute().set_input_line( | |
| 910 | 910 | } |
| 911 | 911 | else |
| 912 | 912 | { |
| 913 | 913 | if (LOG_NILE_IRQS) logerror(" 0"); |
| 914 | cput | |
| 914 | machine.device("maincpu")->execute().set_input_line( | |
| 915 | 915 | } |
| 916 | 916 | } |
| 917 | 917 | if (LOG_NILE_IRQS) logerror("\n"); |
| r17813 | r17814 | |
|---|---|---|
| 68 | 68 | WRITE8_MEMBER(tecmo_state::tecmo_sound_command_w) |
| 69 | 69 | { |
| 70 | 70 | soundlatch_byte_w(space, offset, data); |
| 71 | | |
| 71 | | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | WRITE8_MEMBER(tecmo_state::tecmo_nmi_ack_w) |
| 75 | 75 | { |
| 76 | | |
| 76 | | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | WRITE8_MEMBER(tecmo_state::tecmo_adpcm_start_w) |
| r17813 | r17814 | |
| 606 | 606 | |
| 607 | 607 | static void irqhandler(device_t *device, int linestate) |
| 608 | 608 | { |
| 609 | | |
| 609 | | |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 329 | 329 | |
| 330 | 330 | WRITE_LINE_MEMBER(tourvision_state::tourvision_timer_out) |
| 331 | 331 | { |
| 332 | cput | |
| 332 | machine().device("subcpu")->execute().set_input_line( | |
| 333 | 333 | //logerror("Timer out %d\n", state); |
| 334 | 334 | } |
| 335 | 335 |
| r17813 | r17814 | |
|---|---|---|
| 139 | 139 | int scanline = param; |
| 140 | 140 | |
| 141 | 141 | if(scanline == 224) // vblank-out irq |
| 142 | | |
| 142 | | |
| 143 | 143 | |
| 144 | 144 | /* Pandora "sprite end dma" irq? */ |
| 145 | 145 | if(scanline == 32) |
| 146 | | |
| 146 | | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
| r17813 | r17814 | |
| 152 | 152 | int scanline = param; |
| 153 | 153 | |
| 154 | 154 | if(scanline == 224) // vblank-out irq |
| 155 | | |
| 155 | | |
| 156 | 156 | |
| 157 | 157 | /* Pandora "sprite end dma" irq? */ |
| 158 | 158 | if(scanline == 32) |
| 159 | | |
| 159 | | |
| 160 | 160 | |
| 161 | 161 | if(scanline == 0) // timer irq? |
| 162 | | |
| 162 | | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 |
| r17813 | r17814 | |
|---|---|---|
| 28 | 28 | int scanline = param; |
| 29 | 29 | |
| 30 | 30 | if(scanline == 240 && state->m_irq_enable) // vblank irq |
| 31 | | |
| 31 | | |
| 32 | 32 | else if(((scanline % 32) == 0) && state->m_nmi_enable) // timer irq |
| 33 | | |
| 33 | | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static void update_interrupts(running_machine &machine) |
| 35 | 35 | { |
| 36 | 36 | shuuz_state *state = machine.driver_data<shuuz_state>(); |
| 37 | cput | |
| 37 | machine.device("maincpu")->execute().set_input_line( | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 |
| r17813 | r17814 | |
|---|---|---|
| 464 | 464 | |
| 465 | 465 | WRITE_LINE_MEMBER(xtom3d_state::pc_dma_hrq_changed) |
| 466 | 466 | { |
| 467 | cput | |
| 467 | machine().device("maincpu")->execute().set_input_line( | |
| 468 | 468 | |
| 469 | 469 | /* Assert HLDA */ |
| 470 | 470 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
|---|---|---|
| 93 | 93 | WRITE8_MEMBER(speedspn_state::speedspn_sound_w) |
| 94 | 94 | { |
| 95 | 95 | soundlatch_byte_w(space, 1, data); |
| 96 | | |
| 96 | | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | WRITE8_MEMBER(speedspn_state::oki_banking_w) |
| r17813 | r17814 | |
|---|---|---|
| 176 | 176 | static MACHINE_RESET( enigma2 ) |
| 177 | 177 | { |
| 178 | 178 | enigma2_state *state = machine.driver_data<enigma2_state>(); |
| 179 | cput | |
| 179 | machine.device("audiocpu")->execute().set_input_line( | |
| 180 | 180 | |
| 181 | 181 | state->m_last_sound_data = 0; |
| 182 | 182 | state->m_flip_screen = 0; |
| r17813 | r17814 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | WRITE8_MEMBER(igspoker_state::igs_irqack_w) |
| 154 | 154 | { |
| 155 | // cput | |
| 155 | // machine().device("maincpu")->execute().set_input_line( | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 |
| r17813 | r17814 | |
|---|---|---|
| 743 | 743 | WRITE8_MEMBER(videopkr_state::prog_w) |
| 744 | 744 | { |
| 745 | 745 | if (!data) |
| 746 | cput | |
| 746 | machine().device("maincpu")->execute().set_input_line( | |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | /************************* |
| r17813 | r17814 | |
| 935 | 935 | |
| 936 | 936 | if (state->m_dc_40103 == 0) |
| 937 | 937 | { |
| 938 | | |
| 938 | | |
| 939 | 939 | } |
| 940 | 940 | } |
| 941 | 941 | } |
| r17813 | r17814 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | static void voodoo_vblank_0(device_t *device, int param) |
| 274 | 274 | { |
| 275 | | |
| 275 | | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | static void voodoo_vblank_1(device_t *device, int param) |
| 279 | 279 | { |
| 280 | | |
| 280 | | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | READ32_MEMBER(gticlub_state::gticlub_k001604_tile_r) |
| r17813 | r17814 | |
| 390 | 390 | |
| 391 | 391 | case 4: |
| 392 | 392 | if (data & 0x80) /* CG Board 1 IRQ Ack */ |
| 393 | cput | |
| 393 | machine().device("maincpu")->execute().set_input_line( | |
| 394 | 394 | |
| 395 | 395 | if (data & 0x40) /* CG Board 0 IRQ Ack */ |
| 396 | cput | |
| 396 | machine().device("maincpu")->execute().set_input_line( | |
| 397 | 397 | |
| 398 | 398 | adc1038_di_write(adc1038, (data >> 0) & 1); |
| 399 | 399 | adc1038_clk_write(adc1038, (data >> 1) & 1); |
| r17813 | r17814 | |
| 707 | 707 | |
| 708 | 708 | static TIMER_CALLBACK( irq_off ) |
| 709 | 709 | { |
| 710 | cput | |
| 710 | machine.device("audiocpu")->execute().set_input_line( | |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | 713 | static void sound_irq_callback( running_machine &machine, int irq ) |
| 714 | 714 | { |
| 715 | 715 | int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; |
| 716 | 716 | |
| 717 | cput | |
| 717 | machine.device("audiocpu")->execute().set_input_line( | |
| 718 | 718 | machine.scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line); |
| 719 | 719 | } |
| 720 | 720 | |
| r17813 | r17814 | |
| 797 | 797 | |
| 798 | 798 | static MACHINE_RESET( gticlub ) |
| 799 | 799 | { |
| 800 | cput | |
| 800 | machine.device("dsp")->execute().set_input_line( | |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | static MACHINE_CONFIG_START( gticlub, gticlub_state ) |
| r17813 | r17814 | |
| 878 | 878 | |
| 879 | 879 | static MACHINE_RESET( hangplt ) |
| 880 | 880 | { |
| 881 | cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); | |
| 882 | cputag_set_input_line(machine, "dsp2", INPUT_LINE_RESET, ASSERT_LINE); | |
| 881 | machine.device("dsp")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 882 | machine.device("dsp2")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 883 | 883 | } |
| 884 | 884 | |
| 885 | 885 | static const voodoo_config voodoo_l_intf = |
| r17813 | r17814 | |
|---|---|---|
| 719 | 719 | // logerror("mailbox_w_68k: %x @ %x\n", data, offset); |
| 720 | 720 | |
| 721 | 721 | if (offset == 4) |
| 722 | c | |
| 722 | machine().device("mcu")->execute().set_input_line( | |
| 723 | 723 | |
| 724 | 724 | COMBINE_DATA(&m_mcu_mailbox[offset%8]); |
| 725 | 725 | |
| r17813 | r17814 | |
| 847 | 847 | logerror("launching 68k, PC=%x\n", space.device().safe_pc()); |
| 848 | 848 | |
| 849 | 849 | // reset and launch the 68k |
| 850 | cput | |
| 850 | machine().device("maincpu")->execute().set_input_line( | |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | m_mcu_port4 = data; |
| r17813 | r17814 | |
| 924 | 924 | static MACHINE_RESET( namcona1_mcu ) |
| 925 | 925 | { |
| 926 | 926 | namcona1_state *state = machine.driver_data<namcona1_state>(); |
| 927 | cput | |
| 927 | machine.device("maincpu")->execute().set_input_line( | |
| 928 | 928 | |
| 929 | 929 | state->m_mcu_port5 = 1; |
| 930 | 930 | } |
| r17813 | r17814 | |
|---|---|---|
| 332 | 332 | { |
| 333 | 333 | |
| 334 | 334 | if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition |
| 335 | c | |
| 335 | machine().device("extra")->execute().set_input_line( | |
| 336 | 336 | |
| 337 | 337 | COMBINE_DATA(&m_vreg); |
| 338 | 338 | |
| r17813 | r17814 | |
| 372 | 372 | |
| 373 | 373 | WRITE16_MEMBER(armedf_state::irq_lv1_ack_w) |
| 374 | 374 | { |
| 375 | cput | |
| 375 | machine().device("maincpu")->execute().set_input_line( | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | WRITE16_MEMBER(armedf_state::irq_lv2_ack_w) |
| 379 | 379 | { |
| 380 | cput | |
| 380 | machine().device("maincpu")->execute().set_input_line( | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 |
| r17813 | r17814 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | static void set_gate_a20(running_machine &machine, int a20) |
| 114 | 114 | { |
| 115 | cput | |
| 115 | machine.device("maincpu")->execute().set_input_line( | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static void keyboard_interrupt(running_machine &machine, int state) |
| r17813 | r17814 | |
|---|---|---|
| 55 | 55 | switch( color ) |
| 56 | 56 | { |
| 57 | 57 | case 0x0c: |
| 58 | cput | |
| 58 | machine.device("maincpu")->execute().set_input_line( | |
| 59 | 59 | break; |
| 60 | 60 | } |
| 61 | 61 | } |
| r17813 | r17814 | |
|---|---|---|
| 226 | 226 | static MACHINE_RESET( itgambl3 ) |
| 227 | 227 | { |
| 228 | 228 | /* stop the CPU, we have no code for it anyway */ |
| 229 | cput | |
| 229 | machine.device("maincpu")->execute().set_input_line( | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /* default 444 palette for debug purpose*/ |
| r17813 | r17814 | |
|---|---|---|
| 102 | 102 | machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40); |
| 103 | 103 | |
| 104 | 104 | if (machine.root_device().ioport("IN0")->read() & 0x40) |
| 105 | cput | |
| 105 | machine.device("maincpu")->execute().set_input_line( | |
| 106 | 106 | |
| 107 | 107 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline); |
| 108 | 108 | } |
| r17813 | r17814 | |
|---|---|---|
| 131 | 131 | INPUT_CHANGED_MEMBER(metlclsh_state::coin_inserted) |
| 132 | 132 | { |
| 133 | 133 | if (oldval) |
| 134 | c | |
| 134 | machine().device("sub")->execute().set_input_line( | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | static INPUT_PORTS_START( metlclsh ) |
| r17813 | r17814 | |
|---|---|---|
| 67 | 67 | int scanline = param; |
| 68 | 68 | |
| 69 | 69 | if(scanline == 256) // vblank-out irq |
| 70 | | |
| 70 | | |
| 71 | 71 | |
| 72 | 72 | if(scanline == 0 && k053246_is_irq_enabled(state->m_k053246)) // vblank-in irq |
| 73 | | |
| 73 | | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | #if 0 |
| r17813 | r17814 | |
| 333 | 333 | |
| 334 | 334 | WRITE_LINE_MEMBER(dbz_state::dbz_irq2_ack_w) |
| 335 | 335 | { |
| 336 | cput | |
| 336 | machine().device("maincpu")->execute().set_input_line( | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 |
| r17813 | r17814 | |
|---|---|---|
| 147 | 147 | if (ACCESSING_BITS_0_7) |
| 148 | 148 | { |
| 149 | 149 | soundlatch_byte_w(space, offset, data & 0xff); |
| 150 | | |
| 150 | | |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| r17813 | r17814 | |
| 336 | 336 | |
| 337 | 337 | static void irqhandler(device_t *device, int linestate) |
| 338 | 338 | { |
| 339 | | |
| 339 | | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 76 | 76 | static MACHINE_RESET( friskyt ) |
| 77 | 77 | { |
| 78 | 78 | /* start with the protection mcu halted */ |
| 79 | c | |
| 79 | machine.device("mcu")->execute().set_input_line( | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| r17813 | r17814 | |
| 100 | 100 | if (((m_portb & 4) == 0) && (data & 4)) |
| 101 | 101 | { |
| 102 | 102 | /* reset and start the protection mcu */ |
| 103 | cputag_set_input_line(machine(), "mcu", INPUT_LINE_RESET, PULSE_LINE); | |
| 104 | cputag_set_input_line(machine(), "mcu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 103 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
| 104 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /* other bits unknown */ |
| r17813 | r17814 | |
|---|---|---|
| 20 | 20 | WRITE16_MEMBER(prehisle_state::prehisle_sound16_w) |
| 21 | 21 | { |
| 22 | 22 | soundlatch_byte_w(space, 0, data & 0xff); |
| 23 | | |
| 23 | | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /*******************************************************************************/ |
| r17813 | r17814 | |
| 195 | 195 | |
| 196 | 196 | static void irqhandler(device_t *device, int irq) |
| 197 | 197 | { |
| 198 | | |
| 198 | | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | WRITE_LINE_MEMBER(by133_state::vdp_interrupt) |
| 105 | 105 | { |
| 106 | | |
| 106 | | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static TMS9928A_INTERFACE(byvid_tms9928a_interface) |
| r17813 | r17814 | |
|---|---|---|
| 697 | 697 | // logerror("irq: raising %d\n", level); |
| 698 | 698 | // irq_status |= (1 << level); |
| 699 | 699 | state->m_last_irq = level; |
| 700 | cput | |
| 700 | machine.device("maincpu")->execute().set_input_line( | |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | static IRQ_CALLBACK(irq_callback) |
| r17813 | r17814 | |
| 721 | 721 | |
| 722 | 722 | static void irq_init(running_machine &machine) |
| 723 | 723 | { |
| 724 | cput | |
| 724 | machine.device("maincpu")->execute().set_input_line( | |
| 725 | 725 | device_set_irq_callback(machine.device("maincpu"), irq_callback); |
| 726 | 726 | } |
| 727 | 727 | |
| r17813 | r17814 | |
| 741 | 741 | // if the FIFO has something in it, signal the 68k too |
| 742 | 742 | if (state->m_fifo_rptr != state->m_fifo_wptr) |
| 743 | 743 | { |
| 744 | | |
| 744 | | |
| 745 | 745 | } |
| 746 | 746 | } |
| 747 | 747 | } |
| r17813 | r17814 | |
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | // signal the 68000 that there's data waiting |
| 876 | | |
| 876 | | |
| 877 | 877 | // give the 68k time to reply |
| 878 | 878 | device_spin_until_time(&space.device(), attotime::from_usec(40)); |
| 879 | 879 | } |
| r17813 | r17814 | |
|---|---|---|
| 292 | 292 | case 0x00: /* IRQON */ |
| 293 | 293 | m_main_irq_mask = bit; |
| 294 | 294 | if (!bit) |
| 295 | cput | |
| 295 | machine().device("maincpu")->execute().set_input_line( | |
| 296 | 296 | break; |
| 297 | 297 | |
| 298 | 298 | case 0x01: /* IOSEL */ |
| r17813 | r17814 | |
| 313 | 313 | break; |
| 314 | 314 | |
| 315 | 315 | case 0x04: /* RESB */ |
| 316 | c | |
| 316 | machine().device("sub")->execute().set_input_line( | |
| 317 | 317 | break; |
| 318 | 318 | |
| 319 | 319 | case 0x05: /* RESA */ |
| 320 | c | |
| 320 | machine().device("sub2")->execute().set_input_line( | |
| 321 | 321 | break; |
| 322 | 322 | |
| 323 | 323 | case 0x06: /* SB0 */ |
| r17813 | r17814 | |
| 451 | 451 | int scanline = param; |
| 452 | 452 | |
| 453 | 453 | if (((scanline == 64) || (scanline == 192)) && state->m_main_irq_mask) // 64V |
| 454 | | |
| 454 | | |
| 455 | 455 | |
| 456 | 456 | if (scanline == 240 && state->m_sub_irq_mask) // VBLANK |
| 457 | 457 | { |
| 458 | cputag_set_input_line(timer.machine(), "sub", 0, ASSERT_LINE); | |
| 459 | cputag_set_input_line(timer.machine(), "sub2", 0, ASSERT_LINE); | |
| 458 | timer.machine().device("sub")->execute().set_input_line(0, ASSERT_LINE); | |
| 459 | timer.machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE); | |
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 |
| r17813 | r17814 | |
|---|---|---|
| 14 | 14 | void tank8_set_collision(running_machine &machine, int index) |
| 15 | 15 | { |
| 16 | 16 | tank8_state *state = machine.driver_data<tank8_state>(); |
| 17 | cput | |
| 17 | machine.device("maincpu")->execute().set_input_line( | |
| 18 | 18 | |
| 19 | 19 | state->m_collision_index = index; |
| 20 | 20 | } |
| r17813 | r17814 | |
| 42 | 42 | { |
| 43 | 43 | m_collision_index &= ~0x3f; |
| 44 | 44 | |
| 45 | cput | |
| 45 | machine().device("maincpu")->execute().set_input_line( | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | WRITE8_MEMBER(tank8_state::tank8_crash_w) |
| r17813 | r17814 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | WRITE_LINE_MEMBER(paranoia_state::paranoia_i8155_timer_out) |
| 156 | 156 | { |
| 157 | //c | |
| 157 | //machine().device("sub")->execute().set_input_line( | |
| 158 | 158 | //logerror("Timer out %d\n", state); |
| 159 | 159 | } |
| 160 | 160 |
| r17813 | r17814 | |
|---|---|---|
| 146 | 146 | WRITE8_MEMBER(poo_state::sound_cmd_w) |
| 147 | 147 | { |
| 148 | 148 | soundlatch_byte_w(space, 0, (data & 0xff)); |
| 149 | cput | |
| 149 | machine().device("subcpu")->execute().set_input_line( | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | WRITE8_MEMBER(poo_state::poo_vregs_w) |
| r17813 | r17814 | |
|---|---|---|
| 285 | 285 | if (drvstate->m_control & 0x0008) |
| 286 | 286 | { |
| 287 | 287 | if (state != CLEAR_LINE) |
| 288 | | |
| 288 | | |
| 289 | 289 | else |
| 290 | | |
| 290 | | |
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | |
| r17813 | r17814 | |
| 297 | 297 | { |
| 298 | 298 | qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>(); |
| 299 | 299 | if (state->m_control & 0x0004) |
| 300 | cput | |
| 300 | machine.device("maincpu")->execute().set_input_line( | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | static INTERRUPT_GEN(qdrmfgp2_interrupt) |
| r17813 | r17814 | |
| 318 | 318 | if (drvstate->m_gp2_irq_control) |
| 319 | 319 | drvstate->m_gp2_irq_control = 0; |
| 320 | 320 | else |
| 321 | | |
| 321 | | |
| 322 | 322 | } |
| 323 | 323 | else |
| 324 | 324 | { |
| 325 | | |
| 325 | | |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | } |
| r17813 | r17814 | |
| 570 | 570 | { |
| 571 | 571 | qdrmfgp_state *state = device->machine().driver_data<qdrmfgp_state>(); |
| 572 | 572 | if (state->m_control & 0x0001) |
| 573 | | |
| 573 | | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | static const k054539_interface k054539_config = |
| r17813 | r17814 | |
| 607 | 607 | |
| 608 | 608 | WRITE_LINE_MEMBER(qdrmfgp_state::qdrmfgp_irq3_ack_w) |
| 609 | 609 | { |
| 610 | // cput | |
| 610 | // machine().device("maincpu")->execute().set_input_line( | |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | WRITE_LINE_MEMBER(qdrmfgp_state::qdrmfgp_irq4_ack_w) |
| 614 | 614 | { |
| 615 | // cput | |
| 615 | // machine().device("maincpu")->execute().set_input_line( | |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | static const k053252_interface qdrmfgp_k053252_intf = |
| r17813 | r17814 | |
|---|---|---|
| 3186 | 3186 | // sample_buffer1 >>= 4; |
| 3187 | 3187 | // sample_select1 ^= 1; |
| 3188 | 3188 | // if (sample_select1 == 0) |
| 3189 | // cput | |
| 3189 | // machine.device("audiocpu")->execute().set_input_line( | |
| 3190 | 3190 | } |
| 3191 | 3191 | |
| 3192 | 3192 | static void m5205_int2(device_t *device) |
| r17813 | r17814 | |
|---|---|---|
| 583 | 583 | if (main_cpu_type == M6809 || main_cpu_type == HD6309) |
| 584 | 584 | { |
| 585 | 585 | /* just modify lines that have changed */ |
| 586 | if (periodic != -1) cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE); | |
| 587 | if (tms34061 != -1) cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, tms34061 ? ASSERT_LINE : CLEAR_LINE); | |
| 588 | if (blitter != -1) cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, blitter ? ASSERT_LINE : CLEAR_LINE); | |
| 586 | if (periodic != -1) machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE); | |
| 587 | if (tms34061 != -1) machine.device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, tms34061 ? ASSERT_LINE : CLEAR_LINE); | |
| 588 | if (blitter != -1) machine.device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, blitter ? ASSERT_LINE : CLEAR_LINE); | |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | /* handle the 68000 case */ |
| 592 | 592 | else |
| 593 | 593 | { |
| 594 | cputag_set_input_line(machine, "maincpu", 2, state->m_blitter_int ? ASSERT_LINE : CLEAR_LINE); | |
| 595 | cputag_set_input_line(machine, "maincpu", 3, state->m_periodic_int ? ASSERT_LINE : CLEAR_LINE); | |
| 594 | machine.device("maincpu")->execute().set_input_line(2, state->m_blitter_int ? ASSERT_LINE : CLEAR_LINE); | |
| 595 | machine.device("maincpu")->execute().set_input_line(3, state->m_periodic_int ? ASSERT_LINE : CLEAR_LINE); | |
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 | |
| r17813 | r17814 | |
| 623 | 623 | WRITE8_MEMBER(itech8_state::itech8_nmi_ack_w) |
| 624 | 624 | { |
| 625 | 625 | /* doesn't seem to hold for every game (e.g., hstennis) */ |
| 626 | /* cput | |
| 626 | /* machine().device("maincpu")->execute().set_input_line( | |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | |
| 630 | 630 | static void generate_sound_irq(device_t *device, int state) |
| 631 | 631 | { |
| 632 | | |
| 632 | | |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | |
| r17813 | r17814 | |
| 784 | 784 | { |
| 785 | 785 | itech8_state *state = machine.driver_data<itech8_state>(); |
| 786 | 786 | state->m_sound_data = param; |
| 787 | cput | |
| 787 | machine.device("soundcpu")->execute().set_input_line( | |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | |
| r17813 | r17814 | |
| 807 | 807 | |
| 808 | 808 | READ8_MEMBER(itech8_state::sound_data_r) |
| 809 | 809 | { |
| 810 | | |
| 810 | | |
| 811 | 811 | return m_sound_data; |
| 812 | 812 | } |
| 813 | 813 |
| r17813 | r17814 | |
|---|---|---|
| 457 | 457 | state->m_tenspot_current_game++; |
| 458 | 458 | state->m_tenspot_current_game%=10; |
| 459 | 459 | tenspot_set_game_bank(device->machine(), state->m_tenspot_current_game, 1); |
| 460 | | |
| 460 | | |
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
| r17813 | r17814 | |
| 545 | 545 | /* the inverse of bit 3 clocks the flip flop to signal an INT */ |
| 546 | 546 | /* it is automatically cleared on the acknowledge */ |
| 547 | 547 | if ((old & 0x08) && !(data & 0x08)) |
| 548 | | |
| 548 | | |
| 549 | 549 | |
| 550 | 550 | /* bit 4 is sound disable */ |
| 551 | 551 | machine().sound().system_mute(data & 0x10); |
| r17813 | r17814 | |
| 750 | 750 | |
| 751 | 751 | WRITE8_MEMBER(galaxian_state::explorer_sound_control_w) |
| 752 | 752 | { |
| 753 | | |
| 753 | | |
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | |
| 757 | 757 | READ8_MEMBER(galaxian_state::explorer_sound_latch_r) |
| 758 | 758 | { |
| 759 | | |
| 759 | | |
| 760 | 760 | return soundlatch_byte_r(*machine().device("audiocpu")->memory().space(AS_PROGRAM), 0); |
| 761 | 761 | } |
| 762 | 762 | |
| r17813 | r17814 | |
| 793 | 793 | /* the inverse of bit 0 clocks the flip flop to signal an INT */ |
| 794 | 794 | /* it is automatically cleared on the acknowledge */ |
| 795 | 795 | if ((old & 0x01) && !(data & 0x01)) |
| 796 | c | |
| 796 | machine().device("audio2")->execute().set_input_line( | |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | 799 | |
| r17813 | r17814 | |
| 837 | 837 | state->m_protection_result = rom[0x2000 | (state->m_protection_state & 0x1fff)]; // probably needs a BITSWAP8 |
| 838 | 838 | |
| 839 | 839 | // and an irq on the main z80 afterwards |
| 840 | cput | |
| 840 | machine.device("maincpu")->execute().set_input_line( | |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | |
| r17813 | r17814 | |
| 932 | 932 | |
| 933 | 933 | WRITE8_MEMBER(galaxian_state::froggrmc_sound_control_w) |
| 934 | 934 | { |
| 935 | | |
| 935 | | |
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | |
| r17813 | r17814 | |
| 1079 | 1079 | galaxian_stars_enable_w(*space, 0, 0); |
| 1080 | 1080 | |
| 1081 | 1081 | /* reset the CPU */ |
| 1082 | cput | |
| 1082 | machine().device("maincpu")->execute().set_input_line( | |
| 1083 | 1083 | } |
| 1084 | 1084 | |
| 1085 | 1085 | |
| r17813 | r17814 | |
| 1259 | 1259 | WRITE8_MEMBER(galaxian_state::checkman_sound_command_w) |
| 1260 | 1260 | { |
| 1261 | 1261 | soundlatch_byte_w(space, 0, data); |
| 1262 | | |
| 1262 | | |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | |
| 1266 | 1266 | static TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen ) |
| 1267 | 1267 | { |
| 1268 | | |
| 1268 | | |
| 1269 | 1269 | } |
| 1270 | 1270 | |
| 1271 | 1271 |
| r17813 | r17814 | |
|---|---|---|
| 254 | 254 | if (ACCESSING_BITS_0_7) |
| 255 | 255 | { |
| 256 | 256 | soundlatch_byte_w(space, 0, data&0xff); |
| 257 | | |
| 257 | | |
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | |
| r17813 | r17814 | |
| 639 | 639 | |
| 640 | 640 | static void sound_irq( device_t *device, int irq ) |
| 641 | 641 | { |
| 642 | | |
| 642 | | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | static const ym2608_interface ym2608_config = |
| r17813 | r17814 | |
|---|---|---|
| 640 | 640 | hyprduel_state *state = machine.driver_data<hyprduel_state>(); |
| 641 | 641 | |
| 642 | 642 | /* start with cpu2 halted */ |
| 643 | c | |
| 643 | machine.device("sub")->execute().set_input_line( | |
| 644 | 644 | state->m_subcpu_resetline = 1; |
| 645 | 645 | state->m_cpu_trigger = 0; |
| 646 | 646 |
| r17813 | r17814 | |
|---|---|---|
| 85 | 85 | static void update_interrupts(running_machine &machine) |
| 86 | 86 | { |
| 87 | 87 | arcadecl_state *state = machine.driver_data<arcadecl_state>(); |
| 88 | cput | |
| 88 | machine.device("maincpu")->execute().set_input_line( | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 |
| r17813 | r17814 | |
|---|---|---|
| 431 | 431 | |
| 432 | 432 | static void sfkick_vdp_interrupt(device_t *, v99x8_device &device, int i) |
| 433 | 433 | { |
| 434 | | |
| 434 | | |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | static MACHINE_RESET(sfkick) |
| r17813 | r17814 | |
| 457 | 457 | |
| 458 | 458 | static void irqhandler(device_t *device, int irq) |
| 459 | 459 | { |
| 460 | cput | |
| 460 | device->machine().device("soundcpu")->execute().set_input_line_and_vector( | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 72 | 72 | int scanline = param; |
| 73 | 73 | |
| 74 | 74 | /* assert/deassert the interrupt */ |
| 75 | cput | |
| 75 | machine.device("maincpu")->execute().set_input_line( | |
| 76 | 76 | |
| 77 | 77 | /* set the next timer */ |
| 78 | 78 | scanline += 32; |
| r17813 | r17814 | |
| 84 | 84 | |
| 85 | 85 | WRITE8_MEMBER(atetris_state::irq_ack_w) |
| 86 | 86 | { |
| 87 | cput | |
| 87 | machine().device("maincpu")->execute().set_input_line( | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 |
| r17813 | r17814 | |
|---|---|---|
| 402 | 402 | |
| 403 | 403 | static void msx_vdp_interrupt(device_t *, v99x8_device &device, int i) |
| 404 | 404 | { |
| 405 | | |
| 405 | | |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | static TIMER_DEVICE_CALLBACK( sangho_interrupt ) |
| r17813 | r17814 | |
|---|---|---|
| 260 | 260 | |
| 261 | 261 | WRITE8_MEMBER(bmcbowl_state::via_irq) |
| 262 | 262 | { |
| 263 | cput | |
| 263 | machine().device("maincpu")->execute().set_input_line( | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 |
| r17813 | r17814 | |
|---|---|---|
| 255 | 255 | if (ACCESSING_BITS_0_7) soundlatch_byte_w (space, 0, (data >> 0) & 0xff); |
| 256 | 256 | if (ACCESSING_BITS_8_15) soundlatch2_byte_w(space, 0, (data >> 8) & 0xff); |
| 257 | 257 | |
| 258 | | |
| 258 | | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | static ADDRESS_MAP_START( lordgun_map, AS_PROGRAM, 16, lordgun_state ) |
| r17813 | r17814 | |
| 646 | 646 | |
| 647 | 647 | static void soundirq(device_t *device, int state) |
| 648 | 648 | { |
| 649 | | |
| 649 | | |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | static const ym3812_interface lordgun_ym3812_interface = |
| r17813 | r17814 | |
|---|---|---|
| 83 | 83 | int scanline = param; |
| 84 | 84 | |
| 85 | 85 | if(scanline == 240 && state->m_main_nmi_enabled) // vblank-out irq |
| 86 | | |
| 86 | | |
| 87 | 87 | |
| 88 | 88 | if(scanline == 16) // timer irq, checks soundlatch port then updates some sound related work RAM buffers |
| 89 | | |
| 89 | | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 |
| r17813 | r17814 | |
|---|---|---|
| 1517 | 1517 | |
| 1518 | 1518 | static void irqhandler(device_t *device, int linestate) |
| 1519 | 1519 | { |
| 1520 | | |
| 1520 | | |
| 1521 | 1521 | } |
| 1522 | 1522 | |
| 1523 | 1523 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 149 | 149 | { |
| 150 | 150 | /* pressing the service switch sends an NMI */ |
| 151 | 151 | if (newval) |
| 152 | cput | |
| 152 | machine().device("maincpu")->execute().set_input_line( | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| r17813 | r17814 | |
| 286 | 286 | WRITE8_MEMBER(segag80r_state::sindbadm_soundport_w) |
| 287 | 287 | { |
| 288 | 288 | soundlatch_byte_w(space, 0, data); |
| 289 | | |
| 289 | | |
| 290 | 290 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); |
| 291 | 291 | } |
| 292 | 292 |
| r17813 | r17814 | |
|---|---|---|
| 312 | 312 | |
| 313 | 313 | static void sound_nmi_callback( int param ) |
| 314 | 314 | { |
| 315 | cput | |
| 315 | machine.device("audiocpu")->execute().set_input_line( | |
| 316 | 316 | |
| 317 | 317 | sound_nmi_enabled = 0; |
| 318 | 318 | } |
| r17813 | r17814 | |
|---|---|---|
| 109 | 109 | int scanline = param; |
| 110 | 110 | |
| 111 | 111 | if(scanline == 240 && state->m_nmi_enable) // vblank-out irq |
| 112 | | |
| 112 | | |
| 113 | 113 | |
| 114 | 114 | if(scanline == 0 ) // vblank-in irq |
| 115 | | |
| 115 | | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static INTERRUPT_GEN( zodiack_sound_nmi_gen ) |
| r17813 | r17814 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | /* set the IRQ line if enabled */ |
| 190 | 190 | if (state->m_irq_enabled) |
| 191 | cput | |
| 191 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 192 | 192 | |
| 193 | 193 | /* set up for next interrupt */ |
| 194 | 194 | next_irq_number = (irq_number + 1) % IRQS_PER_FRAME; |
| r17813 | r17814 | |
| 268 | 268 | |
| 269 | 269 | /* pulse the NMI line if enabled */ |
| 270 | 270 | if (state->m_nmi_enabled) |
| 271 | cput | |
| 271 | machine.device("maincpu")->execute().set_input_line( | |
| 272 | 272 | |
| 273 | 273 | /* set up for next interrupt */ |
| 274 | 274 | next_nmi_number = (nmi_number + 1) % NMIS_PER_FRAME; |
| r17813 | r17814 | |
|---|---|---|
| 639 | 639 | |
| 640 | 640 | WRITE_LINE_MEMBER(vpoker_state::ptm_irq) |
| 641 | 641 | { |
| 642 | cput | |
| 642 | machine().device("maincpu")->execute().set_input_line( | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | static const ptm6840_interface ptm_intf = |
| r17813 | r17814 | |
|---|---|---|
| 118 | 118 | { |
| 119 | 119 | suprridr_state *state = machine.driver_data<suprridr_state>(); |
| 120 | 120 | state->m_sound_data = param; |
| 121 | cput | |
| 121 | machine.device("audiocpu")->execute().set_input_line( | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| r17813 | r17814 | |
| 136 | 136 | |
| 137 | 137 | WRITE8_MEMBER(suprridr_state::sound_irq_ack_w) |
| 138 | 138 | { |
| 139 | | |
| 139 | | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 |
| r17813 | r17814 | |
|---|---|---|
| 581 | 581 | WRITE16_MEMBER(blitz68k_state::irq_callback_w) |
| 582 | 582 | { |
| 583 | 583 | // popmessage("%02x",data); |
| 584 | cput | |
| 584 | machine().device("maincpu")->execute().set_input_line( | |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | WRITE16_MEMBER(blitz68k_state::sound_write_w) |
| r17813 | r17814 | |
| 1647 | 1647 | |
| 1648 | 1648 | WRITE_LINE_MEMBER(blitz68k_state::crtc_vsync_irq1) |
| 1649 | 1649 | { |
| 1650 | cput | |
| 1650 | machine().device("maincpu")->execute().set_input_line( | |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | WRITE_LINE_MEMBER(blitz68k_state::crtc_vsync_irq3) |
| 1654 | 1654 | { |
| 1655 | cput | |
| 1655 | machine().device("maincpu")->execute().set_input_line( | |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| 1658 | 1658 | WRITE_LINE_MEMBER(blitz68k_state::crtc_vsync_irq5) |
| 1659 | 1659 | { |
| 1660 | cput | |
| 1660 | machine().device("maincpu")->execute().set_input_line( | |
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | 1663 | const mc6845_interface mc6845_intf_irq1 = |
| r17813 | r17814 | |
|---|---|---|
| 115 | 115 | // logerror("Command to Z80: %04x\n", data); |
| 116 | 116 | m_68k_to_z80_index = data & 0xff; |
| 117 | 117 | m_68k_to_z80_data = (data >> 8) & 0xff; |
| 118 | cput | |
| 118 | machine().device("maincpu")->execute().set_input_line( | |
| 119 | 119 | break; |
| 120 | 120 | case 1: |
| 121 | 121 | break; |
| r17813 | r17814 | |
| 124 | 124 | |
| 125 | 125 | READ16_MEMBER(tapatune_state::irq_ack_r) |
| 126 | 126 | { |
| 127 | cput | |
| 127 | machine().device("maincpu")->execute().set_input_line( | |
| 128 | 128 | return 0; |
| 129 | 129 | } |
| 130 | 130 | |
| r17813 | r17814 | |
| 144 | 144 | |
| 145 | 145 | READ8_MEMBER(tapatune_state::sound_irq_clear) |
| 146 | 146 | { |
| 147 | | |
| 147 | | |
| 148 | 148 | return 0; |
| 149 | 149 | } |
| 150 | 150 | |
| r17813 | r17814 | |
| 174 | 174 | { |
| 175 | 175 | m_z80_to_68k_data = data; |
| 176 | 176 | //logerror("Writing data from Z80: index = %02x, data = %02x\n", m_z80_to_68k_index, m_z80_to_68k_data ); |
| 177 | cput | |
| 177 | machine().device("maincpu")->execute().set_input_line( | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | READ8_MEMBER(tapatune_state::read_index_from_68k) |
| r17813 | r17814 | |
| 358 | 358 | |
| 359 | 359 | WRITE_LINE_MEMBER(tapatune_state::crtc_vsync) |
| 360 | 360 | { |
| 361 | cput | |
| 361 | machine().device("maincpu")->execute().set_input_line( | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | static const mc6845_interface h46505_intf = |
| r17813 | r17814 | |
|---|---|---|
| 673 | 673 | if ((state->m_irq_enable & state->m_irq_state) || state->m_scsi_irq_state) |
| 674 | 674 | { |
| 675 | 675 | // printf("IRQ set: state %x enable %x scsi %x\n", state->m_irq_state, state->m_irq_enable, state->m_scsi_irq_state); |
| 676 | cput | |
| 676 | machine.device("maincpu")->execute().set_input_line( | |
| 677 | 677 | state->m_scsi_irq_state = 0; |
| 678 | 678 | } |
| 679 | 679 | else |
| 680 | 680 | { |
| 681 | 681 | // printf("IRQ clear: state %x enable %x scsi %x\n", state->m_irq_state, state->m_irq_enable, state->m_scsi_irq_state); |
| 682 | cput | |
| 682 | machine.device("maincpu")->execute().set_input_line( | |
| 683 | 683 | } |
| 684 | 684 | } |
| 685 | 685 | |
| r17813 | r17814 | |
| 5226 | 5226 | if (irq > 0) |
| 5227 | 5227 | { |
| 5228 | 5228 | state->m_scsp_last_line = irq; |
| 5229 | | |
| 5229 | | |
| 5230 | 5230 | } |
| 5231 | 5231 | else |
| 5232 | | |
| 5232 | | |
| 5233 | 5233 | } |
| 5234 | 5234 | |
| 5235 | 5235 | static const scsp_interface scsp_config = |
| r17813 | r17814 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | WRITE8_MEMBER(iqblock_state::iqblock_irqack_w) |
| 92 | 92 | { |
| 93 | cput | |
| 93 | machine().device("maincpu")->execute().set_input_line( | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | READ8_MEMBER(iqblock_state::extrarom_r) |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static void update_interrupts(running_machine &machine) |
| 35 | 35 | { |
| 36 | 36 | skullxbo_state *state = machine.driver_data<skullxbo_state>(); |
| 37 | cputag_set_input_line(machine, "maincpu", 1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | cputag_set_input_line(machine, "maincpu", 2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | cputag_set_input_line(machine, "maincpu", 4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 |
| r17813 | r17814 | |
|---|---|---|
| 314 | 314 | WRITE16_MEMBER(sliver_state::sound_w) |
| 315 | 315 | { |
| 316 | 316 | soundlatch_byte_w(space, 0, data & 0xff); |
| 317 | | |
| 317 | | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | static ADDRESS_MAP_START( sliver_map, AS_PROGRAM, 16, sliver_state ) |
| r17813 | r17814 | |
|---|---|---|
| 1786 | 1786 | } |
| 1787 | 1787 | |
| 1788 | 1788 | |
| 1789 | cput | |
| 1789 | machine().device("maincpu")->execute().set_input_line( | |
| 1790 | 1790 | |
| 1791 | 1791 | |
| 1792 | 1792 | } |
| r17813 | r17814 | |
| 2001 | 2001 | /* We should probably copy this, but a pointer to it is fine for our purposes as the data doesn't change */ |
| 2002 | 2002 | state->m_current_table_address = real_source; |
| 2003 | 2003 | } |
| 2004 | cput | |
| 2004 | machine.device("maincpu")->execute().set_input_line( | |
| 2005 | 2005 | } |
| 2006 | 2006 | else if ((dat1 & 0x00e00000) == 0x00400000) |
| 2007 | 2007 | { |
| 2008 | 2008 | /* 6bpp DMA decompression |
| 2009 | 2009 | - this is used for the majority of sprites and backgrounds */ |
| 2010 | 2010 | cps3_do_char_dma( machine, real_source, real_destination, real_length ); |
| 2011 | cput | |
| 2011 | machine.device("maincpu")->execute().set_input_line( | |
| 2012 | 2012 | |
| 2013 | 2013 | } |
| 2014 | 2014 | else if ((dat1 & 0x00e00000) == 0x00600000) |
| r17813 | r17814 | |
| 2016 | 2016 | /* 8bpp DMA decompression |
| 2017 | 2017 | - this is used on SFIII NG Sean's Stage ONLY */ |
| 2018 | 2018 | cps3_do_alt_char_dma( machine, real_source, real_destination, real_length); |
| 2019 | cput | |
| 2019 | machine.device("maincpu")->execute().set_input_line( | |
| 2020 | 2020 | } |
| 2021 | 2021 | else |
| 2022 | 2022 | { |
| r17813 | r17814 | |
| 2074 | 2074 | |
| 2075 | 2075 | WRITE32_MEMBER(cps3_state::cps3_irq10_ack_w) |
| 2076 | 2076 | { |
| 2077 | cput | |
| 2077 | machine().device("maincpu")->execute().set_input_line( | |
| 2078 | 2078 | } |
| 2079 | 2079 | |
| 2080 | 2080 | WRITE32_MEMBER(cps3_state::cps3_irq12_ack_w) |
| 2081 | 2081 | { |
| 2082 | cput | |
| 2082 | machine().device("maincpu")->execute().set_input_line( | |
| 2083 | 2083 | } |
| 2084 | 2084 | |
| 2085 | 2085 | WRITE32_MEMBER(cps3_state::cps3_unk_vidregs_w) |
| r17813 | r17814 | |
|---|---|---|
| 230 | 230 | pia2->irq_b_state() | |
| 231 | 231 | pia3->irq_a_state() | pia3->irq_b_state(); |
| 232 | 232 | |
| 233 | cput | |
| 233 | machine().device("maincpu")->execute().set_input_line( | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| 237 | 237 | WRITE_LINE_MEMBER(spiders_state::main_cpu_firq) |
| 238 | 238 | { |
| 239 | cput | |
| 239 | machine().device("maincpu")->execute().set_input_line( | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| 243 | 243 | WRITE_LINE_MEMBER(spiders_state::audio_cpu_irq) |
| 244 | 244 | { |
| 245 | | |
| 245 | | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 |
| r17813 | r17814 | |
|---|---|---|
| 61 | 61 | |
| 62 | 62 | static void tonton_vdp0_interrupt(device_t *, v99x8_device &device, int i) |
| 63 | 63 | { |
| 64 | | |
| 64 | | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 |
| r17813 | r17814 | |
|---|---|---|
| 392 | 392 | { |
| 393 | 393 | |
| 394 | 394 | COMBINE_DATA(&m_mainsub_shared_ram[0x03ffe/2]); |
| 395 | c | |
| 395 | machine().device("sub")->execute().set_input_line( | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | // is this called? |
| r17813 | r17814 | |
| 400 | 400 | { |
| 401 | 401 | |
| 402 | 402 | COMBINE_DATA(&m_mainsub_shared_ram[0x0000/2]); |
| 403 | cput | |
| 403 | machine().device("maincpu")->execute().set_input_line( | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | /* ram convert for suprnova (requires 32-bit stuff) */ |
| r17813 | r17814 | |
|---|---|---|
| 299 | 299 | if(state->m_trigger == 0) |
| 300 | 300 | { |
| 301 | 301 | state->m_adpcm_pos++; |
| 302 | // | |
| 302 | // | |
| 303 | 303 | /*TODO: simplify this */ |
| 304 | 304 | if(ROM[state->m_adpcm_pos] == 0x00 && ROM[state->m_adpcm_pos+1] == 0x00 && ROM[state->m_adpcm_pos+2] == 0x00 && ROM[state->m_adpcm_pos+3] == 0x00 |
| 305 | 305 | && ROM[state->m_adpcm_pos+4] == 0x00 && ROM[state->m_adpcm_pos+5] == 0x00 && ROM[state->m_adpcm_pos+6] == 0x00 && ROM[state->m_adpcm_pos+7] == 0x00 |
| r17813 | r17814 | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | if(!(data & 0x40)) // unknown line used |
| 334 | c | |
| 334 | machine().device("sub")->execute().set_input_line( | |
| 335 | 335 | |
| 336 | 336 | //data & 0x20 sound cpu? |
| 337 | 337 | |
| 338 | 338 | if(!(data & 0x80)) // unknown line used |
| 339 | 339 | { |
| 340 | cput | |
| 340 | machine().device("dsp")->execute().set_input_line( | |
| 341 | 341 | m_dsp_HOLD_signal = data & 0x80; |
| 342 | 342 | } |
| 343 | 343 | } |
| r17813 | r17814 | |
| 349 | 349 | tc0140syt_port_w(tc0140syt, 0, data & 0xff); |
| 350 | 350 | else if (offset == 1) |
| 351 | 351 | { |
| 352 | // | |
| 352 | // | |
| 353 | 353 | tc0140syt_comm_w(tc0140syt, 0, data & 0xff); |
| 354 | 354 | } |
| 355 | 355 | } |
| r17813 | r17814 | |
| 361 | 361 | tc0140syt_slave_port_w(tc0140syt, 0, data & 0xff); |
| 362 | 362 | else if (offset == 1) |
| 363 | 363 | { |
| 364 | // | |
| 364 | // | |
| 365 | 365 | tc0140syt_slave_comm_w(tc0140syt, 0, data & 0xff); |
| 366 | 366 | } |
| 367 | 367 | } |
| r17813 | r17814 | |
| 457 | 457 | |
| 458 | 458 | WRITE16_MEMBER(mlanding_state::ml_nmi_to_sound_w) |
| 459 | 459 | { |
| 460 | // | |
| 460 | // | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | READ16_MEMBER(mlanding_state::ml_mecha_ram_r) |
| r17813 | r17814 | |
| 730 | 730 | |
| 731 | 731 | static void irq_handler(device_t *device, int irq) |
| 732 | 732 | { |
| 733 | | |
| 733 | | |
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | static const msm5205_interface msm5205_config = |
| r17813 | r17814 | |
| 753 | 753 | static MACHINE_RESET( mlanding ) |
| 754 | 754 | { |
| 755 | 755 | mlanding_state *state = machine.driver_data<mlanding_state>(); |
| 756 | cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE); | |
| 757 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 758 | cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); | |
| 756 | machine.device("sub")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 757 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 758 | machine.device("dsp")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 759 | 759 | state->m_adpcm_pos = 0; |
| 760 | 760 | state->m_adpcm_data = -1; |
| 761 | 761 | state->m_adpcm_idle = 1; |
| r17813 | r17814 | |
|---|---|---|
| 55 | 55 | //logerror("sound_irq_line write = %2x (after CPUs synced) \n",param); |
| 56 | 56 | |
| 57 | 57 | if ((param & 1) == 0) |
| 58 | c | |
| 58 | machine.device("sub")->execute().set_input_line( | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 |
| r17813 | r17814 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | static void audio_cpu_assert_nmi(running_machine &machine) |
| 166 | 166 | { |
| 167 | cput | |
| 167 | machine.device("audiocpu")->execute().set_input_line( | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | WRITE8_MEMBER(neoprint_state::audio_cpu_clear_nmi_w) |
| 172 | 172 | { |
| 173 | | |
| 173 | | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | WRITE16_MEMBER(neoprint_state::audio_command_w) |
| r17813 | r17814 | |
| 448 | 448 | |
| 449 | 449 | static void audio_cpu_irq(device_t *device, int assert) |
| 450 | 450 | { |
| 451 | | |
| 451 | | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | static const ym2610_interface ym2610_config = |
| r17813 | r17814 | |
|---|---|---|
| 623 | 623 | |
| 624 | 624 | static void ide_interrupt(device_t *device, int state) |
| 625 | 625 | { |
| 626 | | |
| 626 | | |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | |
| r17813 | r17814 | |
| 642 | 642 | { |
| 643 | 643 | UINT8 assert = drvstate->m_ethernet_irq_state && (*drvstate->m_interrupt_enable & (1 << ETHERNET_IRQ_SHIFT)); |
| 644 | 644 | if (drvstate->m_ethernet_irq_num != 0) |
| 645 | cput | |
| 645 | machine.device("maincpu")->execute().set_input_line( | |
| 646 | 646 | } |
| 647 | 647 | else if (drvstate->m_board_config == SEATTLE_WIDGET_CONFIG) |
| 648 | 648 | update_widget_irq(machine); |
| r17813 | r17814 | |
| 663 | 663 | |
| 664 | 664 | static void ioasic_irq(running_machine &machine, int state) |
| 665 | 665 | { |
| 666 | cput | |
| 666 | machine.device("maincpu")->execute().set_input_line( | |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | |
| r17813 | r17814 | |
| 698 | 698 | |
| 699 | 699 | /* VBLANK: clear anything pending on the old IRQ */ |
| 700 | 700 | if (m_vblank_irq_num != 0) |
| 701 | cput | |
| 701 | machine().device("maincpu")->execute().set_input_line( | |
| 702 | 702 | |
| 703 | 703 | /* VBLANK: compute the new IRQ vector */ |
| 704 | 704 | irq = (*m_interrupt_config >> (2*VBLANK_IRQ_SHIFT)) & 3; |
| r17813 | r17814 | |
| 709 | 709 | { |
| 710 | 710 | /* Widget: clear anything pending on the old IRQ */ |
| 711 | 711 | if (m_widget.irq_num != 0) |
| 712 | cput | |
| 712 | machine().device("maincpu")->execute().set_input_line( | |
| 713 | 713 | |
| 714 | 714 | /* Widget: compute the new IRQ vector */ |
| 715 | 715 | irq = (*m_interrupt_config >> (2*WIDGET_IRQ_SHIFT)) & 3; |
| r17813 | r17814 | |
| 721 | 721 | { |
| 722 | 722 | /* Ethernet: clear anything pending on the old IRQ */ |
| 723 | 723 | if (m_ethernet_irq_num != 0) |
| 724 | cput | |
| 724 | machine().device("maincpu")->execute().set_input_line( | |
| 725 | 725 | |
| 726 | 726 | /* Ethernet: compute the new IRQ vector */ |
| 727 | 727 | irq = (*m_interrupt_config >> (2*ETHERNET_IRQ_SHIFT)) & 3; |
| r17813 | r17814 | |
| 767 | 767 | /* if the VBLANK has been latched, and the interrupt is enabled, assert */ |
| 768 | 768 | if (drvstate->m_vblank_latch && (*drvstate->m_interrupt_enable & (1 << VBLANK_IRQ_SHIFT))) |
| 769 | 769 | state = ASSERT_LINE; |
| 770 | cput | |
| 770 | machine.device("maincpu")->execute().set_input_line( | |
| 771 | 771 | } |
| 772 | 772 | |
| 773 | 773 | |
| r17813 | r17814 | |
| 936 | 936 | /* if any unmasked interrupts are live, we generate */ |
| 937 | 937 | if (drvstate->m_galileo.reg[GREG_INT_STATE] & drvstate->m_galileo.reg[GREG_INT_MASK]) |
| 938 | 938 | state = ASSERT_LINE; |
| 939 | cput | |
| 939 | machine.device("maincpu")->execute().set_input_line( | |
| 940 | 940 | |
| 941 | 941 | if (LOG_GALILEO) |
| 942 | 942 | logerror("Galileo IRQ %s\n", (state == ASSERT_LINE) ? "asserted" : "cleared"); |
| r17813 | r17814 | |
| 1567 | 1567 | |
| 1568 | 1568 | /* update the IRQ state */ |
| 1569 | 1569 | if (drvstate->m_widget.irq_num != 0) |
| 1570 | cput | |
| 1570 | machine.device("maincpu")->execute().set_input_line( | |
| 1571 | 1571 | } |
| 1572 | 1572 | |
| 1573 | 1573 |
| r17813 | r17814 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | static TIMER_CALLBACK( galastrm_interrupt6 ) |
| 59 | 59 | { |
| 60 | cput | |
| 60 | machine.device("maincpu")->execute().set_input_line( | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 |
| r17813 | r17814 | |
|---|---|---|
| 1250 | 1250 | |
| 1251 | 1251 | static TIMER_CALLBACK( rockn_timer_level4_callback ) |
| 1252 | 1252 | { |
| 1253 | cput | |
| 1253 | machine.device("maincpu")->execute().set_input_line( | |
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | 1256 | static TIMER_CALLBACK( rockn_timer_sub_level4_callback ) |
| 1257 | 1257 | { |
| 1258 | c | |
| 1258 | machine.device("sub")->execute().set_input_line( | |
| 1259 | 1259 | } |
| 1260 | 1260 | |
| 1261 | 1261 | |
| 1262 | 1262 | static TIMER_CALLBACK( rockn_timer_level1_callback ) |
| 1263 | 1263 | { |
| 1264 | cput | |
| 1264 | machine.device("maincpu")->execute().set_input_line( | |
| 1265 | 1265 | } |
| 1266 | 1266 | |
| 1267 | 1267 | static TIMER_CALLBACK( rockn_timer_sub_level1_callback ) |
| 1268 | 1268 | { |
| 1269 | c | |
| 1269 | machine.device("sub")->execute().set_input_line( | |
| 1270 | 1270 | } |
| 1271 | 1271 | |
| 1272 | 1272 | static void init_rockn_timer(running_machine &machine) |
| r17813 | r17814 | |
|---|---|---|
| 212 | 212 | |
| 213 | 213 | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 214 | 214 | { |
| 215 | cput | |
| 215 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 216 | 216 | }; |
| 217 | 217 | |
| 218 | 218 | static void duart_tx(device_t *device, int channel, UINT8 data) |
| r17813 | r17814 | |
| 509 | 509 | { |
| 510 | 510 | case 0x0e: |
| 511 | 511 | tmaster_draw(machine()); |
| 512 | cput | |
| 512 | machine().device("maincpu")->execute().set_input_line( | |
| 513 | 513 | break; |
| 514 | 514 | } |
| 515 | 515 | } |
| r17813 | r17814 | |
|---|---|---|
| 210 | 210 | static void update_interrupts(running_machine &machine) |
| 211 | 211 | { |
| 212 | 212 | atarisy1_state *state = machine.driver_data<atarisy1_state>(); |
| 213 | cputag_set_input_line(machine, "maincpu", 2, state->m_joystick_int && state->m_joystick_int_enable ? ASSERT_LINE : CLEAR_LINE); | |
| 214 | cputag_set_input_line(machine, "maincpu", 3, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 215 | cputag_set_input_line(machine, "maincpu", 4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 216 | cputag_set_input_line(machine, "maincpu", 6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 213 | machine.device("maincpu")->execute().set_input_line(2, state->m_joystick_int && state->m_joystick_int_enable ? ASSERT_LINE : CLEAR_LINE); | |
| 214 | machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 215 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 216 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 |
| r17813 | r17814 | |
|---|---|---|
| 16 | 16 | sprint8_state *state = machine.driver_data<sprint8_state>(); |
| 17 | 17 | if (state->m_collision_reset == 0) |
| 18 | 18 | { |
| 19 | cput | |
| 19 | machine.device("maincpu")->execute().set_input_line( | |
| 20 | 20 | |
| 21 | 21 | state->m_collision_index = n; |
| 22 | 22 | } |
| r17813 | r17814 | |
| 95 | 95 | m_collision_reset = !(data & 1); |
| 96 | 96 | |
| 97 | 97 | if (m_collision_reset) |
| 98 | cput | |
| 98 | machine().device("maincpu")->execute().set_input_line( | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 |
| r17813 | r17814 | |
|---|---|---|
| 180 | 180 | { |
| 181 | 181 | ssv_state *state = machine.driver_data<ssv_state>(); |
| 182 | 182 | |
| 183 | cput | |
| 183 | machine.device("maincpu")->execute().set_input_line( | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | static IRQ_CALLBACK(ssv_irq_callback) |
| r17813 | r17814 | |
|---|---|---|
| 187 | 187 | if (ACCESSING_BITS_0_7) |
| 188 | 188 | { |
| 189 | 189 | soundlatch_byte_w(space, 0, data & 0xff); |
| 190 | | |
| 190 | | |
| 191 | 191 | } |
| 192 | 192 | break; |
| 193 | 193 | |
| r17813 | r17814 | |
| 196 | 196 | break; |
| 197 | 197 | |
| 198 | 198 | case 8: /* Interrupt ack (VBL - IRQ 6) */ |
| 199 | cput | |
| 199 | machine().device("maincpu")->execute().set_input_line( | |
| 200 | 200 | break; |
| 201 | 201 | |
| 202 | 202 | case 0xa: /* Mix Psel(?). */ |
| r17813 | r17814 | |
| 226 | 226 | if (ACCESSING_BITS_0_7) |
| 227 | 227 | { |
| 228 | 228 | soundlatch_byte_w(space, 0, data & 0xff); |
| 229 | | |
| 229 | | |
| 230 | 230 | } |
| 231 | 231 | break; |
| 232 | 232 | |
| r17813 | r17814 | |
| 259 | 259 | if (ACCESSING_BITS_0_7) |
| 260 | 260 | { |
| 261 | 261 | soundlatch_byte_w(space, 0, data & 0xff); |
| 262 | | |
| 262 | | |
| 263 | 263 | } |
| 264 | 264 | break; |
| 265 | 265 | case 2: |
| r17813 | r17814 | |
| 273 | 273 | if (ACCESSING_BITS_0_7) |
| 274 | 274 | { |
| 275 | 275 | soundlatch_byte_w(space, 0, data & 0xff); |
| 276 | | |
| 276 | | |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| r17813 | r17814 | |
| 1287 | 1287 | |
| 1288 | 1288 | static void sound_irq(device_t *device, int linestate) |
| 1289 | 1289 | { |
| 1290 | | |
| 1290 | | |
| 1291 | 1291 | } |
| 1292 | 1292 | |
| 1293 | 1293 | static void sound_irq2(device_t *device, int linestate) |
| 1294 | 1294 | { |
| 1295 | | |
| 1295 | | |
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
| 1385 | 1385 | else |
| 1386 | 1386 | { |
| 1387 | 1387 | msm5205_data_w(device, state->m_automat_adpcm_byte >> 4); |
| 1388 | // | |
| 1388 | // | |
| 1389 | 1389 | } |
| 1390 | 1390 | |
| 1391 | 1391 | state->m_automat_msm5205_vclk_toggle ^= 1; |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static void update_interrupts(running_machine &machine) |
| 35 | 35 | { |
| 36 | 36 | atarig42_state *state = machine.driver_data<atarig42_state>(); |
| 37 | cputag_set_input_line(machine, "maincpu", 4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | cputag_set_input_line(machine, "maincpu", 5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r17813 | r17814 | |
| 111 | 111 | if (ACCESSING_BITS_0_7) |
| 112 | 112 | { |
| 113 | 113 | /* bit 4 resets the sound CPU */ |
| 114 | c | |
| 114 | machine().device("jsa")->execute().set_input_line( | |
| 115 | 115 | if (!(data & 0x10)) atarijsa_reset(); |
| 116 | 116 | |
| 117 | 117 | /* bit 5 is /XRESET, probably related to the ASIC */ |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static void update_interrupts(running_machine &machine) |
| 35 | 35 | { |
| 36 | 36 | vindictr_state *state = machine.driver_data<vindictr_state>(); |
| 37 | cputag_set_input_line(machine, "maincpu", 4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | cputag_set_input_line(machine, "maincpu", 6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r17813 | r17814 | |
|---|---|---|
| 126 | 126 | { |
| 127 | 127 | if (!(m_control_data & 0x40)) |
| 128 | 128 | { |
| 129 | cput | |
| 129 | machine().device("maincpu")->execute().set_input_line( | |
| 130 | 130 | return m_adc_data << m_adc_shift; |
| 131 | 131 | } |
| 132 | 132 | else |
| r17813 | r17814 | |
| 137 | 137 | |
| 138 | 138 | static TIMER_CALLBACK( adc_ready ) |
| 139 | 139 | { |
| 140 | cput | |
| 140 | machine.device("maincpu")->execute().set_input_line( | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 |
| r17813 | r17814 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | static void set_gate_a20(running_machine &machine, int a20) |
| 169 | 169 | { |
| 170 | cput | |
| 170 | machine.device("maincpu")->execute().set_input_line( | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | static void keyboard_interrupt(running_machine &machine, int state) |
| r17813 | r17814 | |
|---|---|---|
| 263 | 263 | if (ACCESSING_BITS_8_15) |
| 264 | 264 | { |
| 265 | 265 | soundlatch_byte_w(space, 1, data >> 8); |
| 266 | | |
| 266 | | |
| 267 | 267 | } |
| 268 | 268 | else |
| 269 | 269 | { |
| r17813 | r17814 | |
| 277 | 277 | |
| 278 | 278 | WRITE16_MEMBER(shadfrce_state::shadfrce_irq_ack_w) |
| 279 | 279 | { |
| 280 | cput | |
| 280 | machine().device("maincpu")->execute().set_input_line( | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | WRITE16_MEMBER(shadfrce_state::shadfrce_irq_w) |
| r17813 | r17814 | |
| 331 | 331 | state->m_raster_scanline = (state->m_raster_scanline + 1) % 240; |
| 332 | 332 | if (state->m_raster_scanline > 0) |
| 333 | 333 | timer.machine().primary_screen->update_partial(state->m_raster_scanline - 1); |
| 334 | | |
| 334 | | |
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | |
| r17813 | r17814 | |
| 342 | 342 | { |
| 343 | 343 | if (scanline > 0) |
| 344 | 344 | timer.machine().primary_screen->update_partial(scanline - 1); |
| 345 | | |
| 345 | | |
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
| r17813 | r17814 | |
| 352 | 352 | if (scanline == 248) |
| 353 | 353 | { |
| 354 | 354 | timer.machine().primary_screen->update_partial(scanline - 1); |
| 355 | | |
| 355 | | |
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | } |
| r17813 | r17814 | |
| 546 | 546 | |
| 547 | 547 | static void irq_handler(device_t *device, int irq) |
| 548 | 548 | { |
| 549 | | |
| 549 | | |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 640 | 640 | /* IRQ clear/enable; ppd writes bit off then on in response to interrupt */ |
| 641 | 641 | /* it enables bits 0x41, but 0x01 seems to be the one it cares about */ |
| 642 | 642 | if (ACCESSING_BITS_16_31 && (data & 0x0001) == 0) |
| 643 | cput | |
| 643 | machine.device("maincpu")->execute().set_input_line( | |
| 644 | 644 | break; |
| 645 | 645 | |
| 646 | 646 | case 0x30: |
| r17813 | r17814 | |
| 907 | 907 | |
| 908 | 908 | static void atapi_cause_irq(running_machine &machine) |
| 909 | 909 | { |
| 910 | cput | |
| 910 | machine.device("maincpu")->execute().set_input_line( | |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | static void atapi_clear_irq(running_machine &machine) |
| 914 | 914 | { |
| 915 | cput | |
| 915 | machine.device("maincpu")->execute().set_input_line( | |
| 916 | 916 | } |
| 917 | 917 | |
| 918 | 918 | static void atapi_init(running_machine &machine) |
| r17813 | r17814 | |
| 1322 | 1322 | static void comm_uart_irq_callback(running_machine &machine, int channel, int value) |
| 1323 | 1323 | { |
| 1324 | 1324 | // TODO |
| 1325 | //cput | |
| 1325 | //machine.device("maincpu")->execute().set_input_line( | |
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | 1328 | /*****************************************************************************/ |
| r17813 | r17814 | |
| 1397 | 1397 | if ((state->m_extend_board_irq_enable & 0x02) == 0 && value != CLEAR_LINE) |
| 1398 | 1398 | { |
| 1399 | 1399 | state->m_extend_board_irq_active |= 0x02; |
| 1400 | cput | |
| 1400 | machine.device("maincpu")->execute().set_input_line( | |
| 1401 | 1401 | } |
| 1402 | 1402 | else |
| 1403 | cput | |
| 1403 | machine.device("maincpu")->execute().set_input_line( | |
| 1404 | 1404 | } |
| 1405 | 1405 | else |
| 1406 | 1406 | { |
| 1407 | 1407 | if ((state->m_extend_board_irq_enable & 0x01) == 0 && value != CLEAR_LINE) |
| 1408 | 1408 | { |
| 1409 | 1409 | state->m_extend_board_irq_active |= 0x01; |
| 1410 | cput | |
| 1410 | machine.device("maincpu")->execute().set_input_line( | |
| 1411 | 1411 | } |
| 1412 | 1412 | else |
| 1413 | cput | |
| 1413 | machine.device("maincpu")->execute().set_input_line( | |
| 1414 | 1414 | } |
| 1415 | 1415 | } |
| 1416 | 1416 |
| r17813 | r17814 | |
|---|---|---|
| 32 | 32 | WRITE8_MEMBER(spdodgeb_state::sound_command_w) |
| 33 | 33 | { |
| 34 | 34 | soundlatch_byte_w(space, offset, data); |
| 35 | | |
| 35 | | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | WRITE8_MEMBER(spdodgeb_state::spd_adpcm_w) |
| r17813 | r17814 | |
| 379 | 379 | |
| 380 | 380 | static void irq_handler(device_t *device, int irq) |
| 381 | 381 | { |
| 382 | | |
| 382 | | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 183 | 183 | |
| 184 | 184 | WRITE32_MEMBER(polygonet_state::sound_irq_w) |
| 185 | 185 | { |
| 186 | | |
| 186 | | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /* DSP communications */ |
| r17813 | r17814 | |
| 253 | 253 | if ((data >> 24) & 0x01) |
| 254 | 254 | { |
| 255 | 255 | // logerror("RESET CLEARED\n"); |
| 256 | cput | |
| 256 | machine().device("dsp")->execute().set_input_line( | |
| 257 | 257 | } |
| 258 | 258 | else |
| 259 | 259 | { |
| 260 | 260 | // logerror("RESET ASSERTED\n"); |
| 261 | cput | |
| 261 | machine().device("dsp")->execute().set_input_line( | |
| 262 | 262 | |
| 263 | 263 | /* A little hacky - I can't seem to set these lines anywhere else where reset is asserted, so i do it here */ |
| 264 | cputag_set_input_line(machine(), "dsp", DSP56K_IRQ_MODA, ASSERT_LINE); | |
| 265 | cputag_set_input_line(machine(), "dsp", DSP56K_IRQ_MODB, CLEAR_LINE); | |
| 264 | machine().device("dsp")->execute().set_input_line(DSP56K_IRQ_MODA, ASSERT_LINE); | |
| 265 | machine().device("dsp")->execute().set_input_line(DSP56K_IRQ_MODB, CLEAR_LINE); | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /* 0x04000000 is the COMBNK line - it switches who has access to the shared RAM - the dsp or the 68020 */ |
| r17813 | r17814 | |
| 608 | 608 | /* It's presumed the hardware has hard-wired operating mode 1 (MODA = 1, MODB = 0) */ |
| 609 | 609 | /* TODO: This should work, but the MAME core appears to do something funny. |
| 610 | 610 | Not a big deal - it's hacked in dsp_w_lines. */ |
| 611 | //cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); | |
| 612 | //cputag_set_input_line(machine, "dsp", DSP56K_IRQ_MODA, ASSERT_LINE); | |
| 613 | //cputag_set_input_line(machine, "dsp", DSP56K_IRQ_MODB, CLEAR_LINE); | |
| 611 | //machine.device("dsp")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 612 | //machine.device("dsp")->execute().set_input_line(DSP56K_IRQ_MODA, ASSERT_LINE); | |
| 613 | //machine.device("dsp")->execute().set_input_line(DSP56K_IRQ_MODB, CLEAR_LINE); | |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | static const k053936_interface polygonet_k053936_intf = |
| r17813 | r17814 | |
|---|---|---|
| 21 | 21 | int scanline = param; |
| 22 | 22 | |
| 23 | 23 | if(scanline == 240) // vblank-out irq |
| 24 | cput | |
| 24 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 25 | 25 | |
| 26 | 26 | if(scanline == 0) // unknown irq event, does various stuff like copying the spriteram |
| 27 | cput | |
| 27 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static void update_interrupts(running_machine &machine) |
| 35 | 35 | { |
| 36 | 36 | batman_state *state = machine.driver_data<batman_state>(); |
| 37 | cputag_set_input_line(machine, "maincpu", 4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | cputag_set_input_line(machine, "maincpu", 6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r17813 | r17814 | |
| 103 | 103 | |
| 104 | 104 | /* bit 4 is connected to the /RESET pin on the 6502 */ |
| 105 | 105 | if (m_latch_data & 0x0010) |
| 106 | c | |
| 106 | machine().device("jsa")->execute().set_input_line( | |
| 107 | 107 | else |
| 108 | c | |
| 108 | machine().device("jsa")->execute().set_input_line( | |
| 109 | 109 | |
| 110 | 110 | /* alpha bank is selected by the upper 4 bits */ |
| 111 | 111 | if ((oldword ^ m_latch_data) & 0x7000) |
| r17813 | r17814 | |
|---|---|---|
| 202 | 202 | WRITE8_MEMBER(progolf_state::audio_command_w) |
| 203 | 203 | { |
| 204 | 204 | m_sound_cmd = data; |
| 205 | | |
| 205 | | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | READ8_MEMBER(progolf_state::audio_command_r) |
| 209 | 209 | { |
| 210 | | |
| 210 | | |
| 211 | 211 | return m_sound_cmd; |
| 212 | 212 | } |
| 213 | 213 | |
| r17813 | r17814 | |
| 274 | 274 | |
| 275 | 275 | INPUT_CHANGED_MEMBER(progolf_state::coin_inserted) |
| 276 | 276 | { |
| 277 | cput | |
| 277 | machine().device("maincpu")->execute().set_input_line( | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | /* verified from M6502 code */ |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | if (ACCESSING_BITS_0_7) |
| 36 | 36 | { |
| 37 | 37 | m_sound_latch = (data & 0xff) << 1; |
| 38 | | |
| 38 | | |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | READ8_MEMBER(magmax_state::magmax_sound_irq_ack) |
| 43 | 43 | { |
| 44 | | |
| 44 | | |
| 45 | 45 | return 0; |
| 46 | 46 | } |
| 47 | 47 |
| r17813 | r17814 | |
|---|---|---|
| 340 | 340 | |
| 341 | 341 | WRITE8_MEMBER(jackie_state::igs_irqack_w) |
| 342 | 342 | { |
| 343 | // cput | |
| 343 | // machine().device("maincpu")->execute().set_input_line( | |
| 344 | 344 | m_out[2] = data; |
| 345 | 345 | show_out(); |
| 346 | 346 | } |
| r17813 | r17814 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | static TIMER_CALLBACK( dac_irq ) |
| 48 | 48 | { |
| 49 | cput | |
| 49 | machine.device("maincpu")->execute().set_input_line( | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | WRITE8_MEMBER(trucocl_state::audio_dac_w) |
| r17813 | r17814 | |
|---|---|---|
| 162 | 162 | { |
| 163 | 163 | /* pressing the service switch sends an NMI */ |
| 164 | 164 | if (newval) |
| 165 | cput | |
| 165 | machine().device("maincpu")->execute().set_input_line( | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 |
| r17813 | r17814 | |
|---|---|---|
| 522 | 522 | WRITE8_MEMBER(astrocde_state::tenpindx_sound_w) |
| 523 | 523 | { |
| 524 | 524 | soundlatch_byte_w(space, offset, data); |
| 525 | c | |
| 525 | machine().device("sub")->execute().set_input_line( | |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 |
| r17813 | r17814 | |
|---|---|---|
| 1034 | 1034 | |
| 1035 | 1035 | static MACHINE_RESET( 40love ) |
| 1036 | 1036 | { |
| 1037 | c | |
| 1037 | machine.device("mcu")->execute().set_input_line( | |
| 1038 | 1038 | |
| 1039 | 1039 | MACHINE_RESET_CALL(common); |
| 1040 | 1040 | } |
| r17813 | r17814 | |
|---|---|---|
| 240 | 240 | |
| 241 | 241 | WRITE_LINE_MEMBER(sg1000a_state::vdp_interrupt) |
| 242 | 242 | { |
| 243 | cput | |
| 243 | machine().device("maincpu")->execute().set_input_line( | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | static TMS9928A_INTERFACE(sg1000a_tms9928a_interface) |
| r17813 | r17814 | |
|---|---|---|
| 494 | 494 | int scanline = param; |
| 495 | 495 | |
| 496 | 496 | if(scanline == 240) // vblank-out irq |
| 497 | cput | |
| 497 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 498 | 498 | |
| 499 | 499 | if(scanline == 0) // <unknown> |
| 500 | cput | |
| 500 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | static MACHINE_CONFIG_START( panicr, panicr_state ) |
| r17813 | r17814 | |
|---|---|---|
| 742 | 742 | case 0x00: /* IRQ1 */ |
| 743 | 743 | m_main_irq_mask = data & 1; |
| 744 | 744 | if (!m_main_irq_mask) |
| 745 | cput | |
| 745 | machine().device("maincpu")->execute().set_input_line( | |
| 746 | 746 | break; |
| 747 | 747 | |
| 748 | 748 | case 0x01: /* IRQ2 */ |
| 749 | 749 | m_sub_irq_mask = data & 1; |
| 750 | 750 | if (!m_sub_irq_mask) |
| 751 | c | |
| 751 | machine().device("sub")->execute().set_input_line( | |
| 752 | 752 | break; |
| 753 | 753 | |
| 754 | 754 | case 0x02: /* NMION */ |
| r17813 | r17814 | |
| 756 | 756 | break; |
| 757 | 757 | |
| 758 | 758 | case 0x03: /* RESET */ |
| 759 | cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 760 | cputag_set_input_line(machine(), "sub2", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 759 | machine().device("sub")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 760 | machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 761 | 761 | break; |
| 762 | 762 | |
| 763 | 763 | case 0x04: /* n.c. */ |
| r17813 | r17814 | |
|---|---|---|
| 109 | 109 | if (m_z80_2_nmi_enable) |
| 110 | 110 | { |
| 111 | 111 | logerror("Executing an NMI on CPU2\n"); |
| 112 | c | |
| 112 | machine().device("sub")->execute().set_input_line( | |
| 113 | 113 | m_z80_2_nmi_enable = 0; |
| 114 | 114 | } |
| 115 | 115 | } |
| r17813 | r17814 | |
| 320 | 320 | device_set_input_line(device, 0, HOLD_LINE); |
| 321 | 321 | |
| 322 | 322 | /* Interrupt presumably comes from the LDP's status strobe */ |
| 323 | | |
| 323 | | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 |
| r17813 | r17814 | |
|---|---|---|
| 333 | 333 | int scanline = param; |
| 334 | 334 | |
| 335 | 335 | if(scanline == 240) // vblank-out irq |
| 336 | cput | |
| 336 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 337 | 337 | |
| 338 | 338 | if(scanline == 0) // sprite buffer irq |
| 339 | cput | |
| 339 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| r17813 | r17814 | |
| 646 | 646 | |
| 647 | 647 | static void irqhandler(device_t *device, int irq) |
| 648 | 648 | { |
| 649 | | |
| 649 | | |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | WRITE8_MEMBER(xyonix_state::xyonix_irqack_w) |
| 29 | 29 | { |
| 30 | cput | |
| 30 | machine().device("maincpu")->execute().set_input_line( | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 |
| r17813 | r17814 | |
|---|---|---|
| 181 | 181 | WRITE8_MEMBER(pacland_state::pacland_subreset_w) |
| 182 | 182 | { |
| 183 | 183 | int bit = !BIT(offset,11); |
| 184 | c | |
| 184 | machine().device("mcu")->execute().set_input_line( | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | WRITE8_MEMBER(pacland_state::pacland_flipscreen_w) |
| r17813 | r17814 | |
| 222 | 222 | int bit = !BIT(offset, 11); |
| 223 | 223 | m_main_irq_mask = bit; |
| 224 | 224 | if (!bit) |
| 225 | cput | |
| 225 | machine().device("maincpu")->execute().set_input_line( | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | WRITE8_MEMBER(pacland_state::pacland_irq_2_ctrl_w) |
| r17813 | r17814 | |
| 230 | 230 | int bit = !BIT(offset, 13); |
| 231 | 231 | m_mcu_irq_mask = bit; |
| 232 | 232 | if (!bit) |
| 233 | c | |
| 233 | machine().device("mcu")->execute().set_input_line( | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| r17813 | r17814 | |
| 401 | 401 | pacland_state *state = device->machine().driver_data<pacland_state>(); |
| 402 | 402 | |
| 403 | 403 | if(state->m_main_irq_mask) |
| 404 | | |
| 404 | | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | static INTERRUPT_GEN( mcu_vblank_irq ) |
| r17813 | r17814 | |
| 409 | 409 | pacland_state *state = device->machine().driver_data<pacland_state>(); |
| 410 | 410 | |
| 411 | 411 | if(state->m_mcu_irq_mask) |
| 412 | | |
| 412 | | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | static MACHINE_CONFIG_START( pacland, pacland_state ) |
| r17813 | r17814 | |
|---|---|---|
| 504 | 504 | int scanline = param; |
| 505 | 505 | |
| 506 | 506 | if(scanline == 240) // vblank-out irq |
| 507 | cput | |
| 507 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 508 | 508 | |
| 509 | 509 | /* Pandora "sprite end dma" irq? TODO: timing is clearly off, attract mode relies on this */ |
| 510 | 510 | if(scanline == 64) |
| 511 | cput | |
| 511 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | static const kaneko_pandora_interface djboy_pandora_config = |
| r17813 | r17814 | |
|---|---|---|
| 634 | 634 | /* handler called by the 2203 emulator when the internal timers cause an IRQ */ |
| 635 | 635 | static void irqhandler(device_t *device, int irq) |
| 636 | 636 | { |
| 637 | | |
| 637 | | |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
|---|---|---|
| 794 | 794 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| 795 | 795 | static void irqhandler(device_t *device, int irq) |
| 796 | 796 | { |
| 797 | | |
| 797 | | |
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 800 | static const ym2610_interface ym2610_config = |
| r17813 | r17814 | |
|---|---|---|
| 78 | 78 | WRITE16_MEMBER(tumblep_state::jumppop_sound_w) |
| 79 | 79 | { |
| 80 | 80 | soundlatch_byte_w(space, 0, data & 0xff); |
| 81 | cput | |
| 81 | m_audiocpu.device(0)->execute().set_input_line( | |
| 82 | 82 | } |
| 83 | 83 | #endif |
| 84 | 84 |
| r17813 | r17814 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | WRITE_LINE_MEMBER(esripsys_state::ptm_irq) |
| 45 | 45 | { |
| 46 | | |
| 46 | | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static const ptm6840_interface ptm_intf = |
| r17813 | r17814 | |
| 111 | 111 | bankaddress = 0x10000 + (data & 0x03) * 0x10000; |
| 112 | 112 | membank("bank1")->set_base(&rom[bankaddress]); |
| 113 | 113 | |
| 114 | cputag_set_input_line(machine(), "frame_cpu", M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); | |
| 115 | cputag_set_input_line(machine(), "frame_cpu", INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE); | |
| 114 | machine().device("frame_cpu")->execute().set_input_line(M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); | |
| 115 | machine().device("frame_cpu")->execute().set_input_line(INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE); | |
| 116 | 116 | |
| 117 | | |
| 117 | | |
| 118 | 118 | |
| 119 | 119 | /* /VBLANK IRQ acknowledge */ |
| 120 | 120 | if (!(data & 0x20)) |
| 121 | | |
| 121 | | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| r17813 | r17814 | |
| 347 | 347 | } |
| 348 | 348 | case 0x02: |
| 349 | 349 | { |
| 350 | | |
| 350 | | |
| 351 | 351 | |
| 352 | 352 | if (!(m_g_to_s_latch2 & 1) && (m_g_iodata & 1)) |
| 353 | 353 | { |
| r17813 | r17814 | |
| 355 | 355 | m_u56a = 1; |
| 356 | 356 | |
| 357 | 357 | /*...causing a sound CPU /IRQ */ |
| 358 | | |
| 358 | | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | if (m_g_iodata & 2) |
| r17813 | r17814 | |
| 408 | 408 | { |
| 409 | 409 | m_io_firq_status |= 2; |
| 410 | 410 | m_keypad_status |= 0x20; |
| 411 | | |
| 411 | | |
| 412 | 412 | } |
| 413 | 413 | } |
| 414 | 414 | |
| r17813 | r17814 | |
| 418 | 418 | { |
| 419 | 419 | m_io_firq_status |= 2; |
| 420 | 420 | m_coin_latch = ioport("COINS")->read() << 2; |
| 421 | | |
| 421 | | |
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
| r17813 | r17814 | |
| 499 | 499 | if (m_s_to_g_latch2 & 0x40) |
| 500 | 500 | { |
| 501 | 501 | m_u56a = 0; |
| 502 | | |
| 502 | | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | if (!(m_s_to_g_latch2 & 0x80) && (data & 0x80)) |
| r17813 | r17814 | |
|---|---|---|
| 80 | 80 | WRITE8_MEMBER(tsamurai_state::sound_command1_w) |
| 81 | 81 | { |
| 82 | 82 | m_sound_command1 = data; |
| 83 | | |
| 83 | | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | WRITE8_MEMBER(tsamurai_state::sound_command2_w) |
| 87 | 87 | { |
| 88 | 88 | m_sound_command2 = data; |
| 89 | c | |
| 89 | machine().device("audio2")->execute().set_input_line( | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | WRITE8_MEMBER(tsamurai_state::sound_command3_w) |
| 93 | 93 | { |
| 94 | 94 | m_sound_command3 = data; |
| 95 | c | |
| 95 | machine().device("audio3")->execute().set_input_line( | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | WRITE8_MEMBER(tsamurai_state::flip_screen_w) |
| r17813 | r17814 | |
| 300 | 300 | WRITE8_MEMBER(tsamurai_state::vsgongf_sound_command_w) |
| 301 | 301 | { |
| 302 | 302 | soundlatch_byte_w(space, offset, data); |
| 303 | | |
| 303 | | |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | static ADDRESS_MAP_START( vsgongf_map, AS_PROGRAM, 8, tsamurai_state ) |
| r17813 | r17814 | |
|---|---|---|
| 109 | 109 | // is it ok that cpub_reset refers to cpuc? |
| 110 | 110 | WRITE8_MEMBER(exzisus_state::exzisus_cpub_reset_w) |
| 111 | 111 | { |
| 112 | cput | |
| 112 | machine().device("cpuc")->execute().set_input_line( | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | #if 0 |
| r17813 | r17814 | |
| 254 | 254 | |
| 255 | 255 | static void irqhandler(device_t *device, int irq) |
| 256 | 256 | { |
| 257 | | |
| 257 | | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 61 | 61 | /* Main CPU and Z80 synchronisation */ |
| 62 | 62 | WRITE16_MEMBER(tx1_state::z80_busreq_w) |
| 63 | 63 | { |
| 64 | | |
| 64 | | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | WRITE16_MEMBER(tx1_state::resume_math_w) |
| 68 | 68 | { |
| 69 | | |
| 69 | | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | WRITE16_MEMBER(tx1_state::halt_math_w) |
| 73 | 73 | { |
| 74 | | |
| 74 | | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /* Z80 can trigger its own interrupts */ |
| 78 | 78 | WRITE8_MEMBER(tx1_state::z80_intreq_w) |
| 79 | 79 | { |
| 80 | | |
| 80 | | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /* Periodic Z80 interrupt */ |
| r17813 | r17814 | |
|---|---|---|
| 96 | 96 | thayers_state *state = machine.driver_data<thayers_state>(); |
| 97 | 97 | if (!state->m_timer_int || !state->m_data_rdy_int || !state->m_ssi_data_request) |
| 98 | 98 | { |
| 99 | cput | |
| 99 | machine.device("maincpu")->execute().set_input_line( | |
| 100 | 100 | } |
| 101 | 101 | else |
| 102 | 102 | { |
| 103 | cput | |
| 103 | machine.device("maincpu")->execute().set_input_line( | |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | static TIMER_CALLBACK( intrq_tick ) |
| 108 | 108 | { |
| 109 | cput | |
| 109 | machine.device("maincpu")->execute().set_input_line( | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | WRITE8_MEMBER(thayers_state::intrq_w) |
| 113 | 113 | { |
| 114 | 114 | // T = 1.1 * R30 * C53 = 1.1 * 750K * 0.01uF = 8.25 ms |
| 115 | 115 | |
| 116 | cput | |
| 116 | machine().device("maincpu")->execute().set_input_line( | |
| 117 | 117 | |
| 118 | 118 | machine().scheduler().timer_set(attotime::from_usec(8250), FUNC(intrq_tick)); |
| 119 | 119 | } |
| r17813 | r17814 | |
| 353 | 353 | |
| 354 | 354 | if ((!BIT(data, 2)) & m_cart_present) |
| 355 | 355 | { |
| 356 | cput | |
| 356 | machine().device("maincpu")->execute().set_input_line( | |
| 357 | 357 | } |
| 358 | 358 | } |
| 359 | 359 |
| r17813 | r17814 | |
|---|---|---|
| 281 | 281 | |
| 282 | 282 | WRITE_LINE_MEMBER(merit_state::vsync_changed) |
| 283 | 283 | { |
| 284 | cput | |
| 284 | machine().device("maincpu")->execute().set_input_line( | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | static const mc6845_interface mc6845_intf = |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | static void update_interrupts(running_machine &machine) |
| 36 | 36 | { |
| 37 | 37 | blstroid_state *state = machine.driver_data<blstroid_state>(); |
| 38 | cputag_set_input_line(machine, "maincpu", 1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | cputag_set_input_line(machine, "maincpu", 2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | cputag_set_input_line(machine, "maincpu", 4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | machine.device("maincpu")->execute().set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 |
| r17813 | r17814 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | WRITE8_MEMBER(retofinv_state::cpu1_reset_w) |
| 40 | 40 | { |
| 41 | c | |
| 41 | machine().device("sub")->execute().set_input_line( | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | WRITE8_MEMBER(retofinv_state::cpu2_reset_w) |
| 45 | 45 | { |
| 46 | | |
| 46 | | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | WRITE8_MEMBER(retofinv_state::mcu_reset_w) |
| 50 | 50 | { |
| 51 | 51 | /* the bootlegs don't have a MCU, so make sure it's there before trying to reset it */ |
| 52 | 52 | if (machine().device("68705") != NULL) |
| 53 | c | |
| 53 | machine().device("68705")->execute().set_input_line( | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | WRITE8_MEMBER(retofinv_state::cpu2_m6000_w) |
| r17813 | r17814 | |
| 66 | 66 | WRITE8_MEMBER(retofinv_state::soundcommand_w) |
| 67 | 67 | { |
| 68 | 68 | soundlatch_byte_w(space, 0, data); |
| 69 | | |
| 69 | | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | WRITE8_MEMBER(retofinv_state::irq0_ack_w) |
| 73 | 73 | { |
| 74 | 74 | m_main_irq_mask = data & 1; |
| 75 | 75 | if (!m_main_irq_mask) |
| 76 | cput | |
| 76 | machine().device("maincpu")->execute().set_input_line( | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | WRITE8_MEMBER(retofinv_state::irq1_ack_w) |
| 80 | 80 | { |
| 81 | 81 | m_sub_irq_mask = data & 1; |
| 82 | 82 | if (!m_sub_irq_mask) |
| 83 | c | |
| 83 | machine().device("sub")->execute().set_input_line( | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | WRITE8_MEMBER(retofinv_state::coincounter_w) |
| r17813 | r17814 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | INPUT_CHANGED_MEMBER(meadows_state::coin_inserted) |
| 200 | 200 | { |
| 201 | cput | |
| 201 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 |
| r17813 | r17814 | |
|---|---|---|
| 144 | 144 | set_led_status(machine(), 6, data & 0x40); // led for coin out / hopper active |
| 145 | 145 | |
| 146 | 146 | if(((m_nmi_ack & 0x80) == 0) && data & 0x80) |
| 147 | cput | |
| 147 | machine().device("maincpu")->execute().set_input_line( | |
| 148 | 148 | |
| 149 | 149 | m_nmi_ack = data & 0x80; // nmi acknowledge, 0 -> 1 |
| 150 | 150 |
| r17813 | r17814 | |
|---|---|---|
| 376 | 376 | |
| 377 | 377 | WRITE8_MEMBER(srmp2_state::srmp2_irq2_ack_w) |
| 378 | 378 | { |
| 379 | cput | |
| 379 | machine().device("maincpu")->execute().set_input_line( | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | WRITE8_MEMBER(srmp2_state::srmp2_irq4_ack_w) |
| 383 | 383 | { |
| 384 | cput | |
| 384 | machine().device("maincpu")->execute().set_input_line( | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
| r17813 | r17814 | |
| 408 | 408 | |
| 409 | 409 | READ8_MEMBER(srmp2_state::mjyuugi_irq2_ack_r) |
| 410 | 410 | { |
| 411 | cput | |
| 411 | machine().device("maincpu")->execute().set_input_line( | |
| 412 | 412 | return 0xff; // value returned doesn't matter |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | READ8_MEMBER(srmp2_state::mjyuugi_irq4_ack_r) |
| 416 | 416 | { |
| 417 | cput | |
| 417 | machine().device("maincpu")->execute().set_input_line( | |
| 418 | 418 | return 0xff; // value returned doesn't matter |
| 419 | 419 | } |
| 420 | 420 | |
| r17813 | r17814 | |
| 461 | 461 | |
| 462 | 462 | WRITE8_MEMBER(srmp2_state::srmp3_irq_ack_w) |
| 463 | 463 | { |
| 464 | cput | |
| 464 | machine().device("maincpu")->execute().set_input_line( | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | static ADDRESS_MAP_START( srmp3_map, AS_PROGRAM, 8, srmp2_state ) |
| r17813 | r17814 | |
|---|---|---|
| 109 | 109 | if (ACCESSING_BITS_8_15) |
| 110 | 110 | { |
| 111 | 111 | soundlatch_byte_w(space, 0, data >> 8); |
| 112 | | |
| 112 | | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r17813 | r17814 | |
| 578 | 578 | |
| 579 | 579 | static void irqhandler(device_t *device, int irq) |
| 580 | 580 | { |
| 581 | | |
| 581 | | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | READ8_MEMBER(aeroboto_state::aeroboto_irq_ack_r) |
| 53 | 53 | { |
| 54 | cput | |
| 54 | machine().device("maincpu")->execute().set_input_line( | |
| 55 | 55 | return 0xff; |
| 56 | 56 | } |
| 57 | 57 |
| r17813 | r17814 | |
|---|---|---|
| 19 | 19 | INPUT_CHANGED_MEMBER(madalien_state::coin_inserted) |
| 20 | 20 | { |
| 21 | 21 | /* coin insertion causes an NMI */ |
| 22 | cput | |
| 22 | machine().device("maincpu")->execute().set_input_line( | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| r17813 | r17814 | |
| 54 | 54 | |
| 55 | 55 | WRITE8_MEMBER(madalien_state::madalien_sound_command_w) |
| 56 | 56 | { |
| 57 | | |
| 57 | | |
| 58 | 58 | soundlatch_byte_w(space, offset, data); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | READ8_MEMBER(madalien_state::madalien_sound_command_r) |
| 63 | 63 | { |
| 64 | | |
| 64 | | |
| 65 | 65 | return soundlatch_byte_r(space, offset); |
| 66 | 66 | } |
| 67 | 67 |
| r17813 | r17814 | |
|---|---|---|
| 46 | 46 | WRITE8_MEMBER(thedeep_state::thedeep_sound_w) |
| 47 | 47 | { |
| 48 | 48 | soundlatch_byte_w(space, 0, data); |
| 49 | | |
| 49 | | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r17813 | r17814 | |
| 394 | 394 | |
| 395 | 395 | static void irqhandler(device_t *device, int irq) |
| 396 | 396 | { |
| 397 | | |
| 397 | | |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | static const ym2203_interface thedeep_ym2203_intf = |
| r17813 | r17814 | |
|---|---|---|
| 335 | 335 | 0x01 = EEPDI |
| 336 | 336 | */ |
| 337 | 337 | ioport("EEPROMOUT")->write(data & 0x07, 0xff); |
| 338 | | |
| 338 | | |
| 339 | 339 | mame_printf_debug("System register 0 = %02X\n", data); |
| 340 | 340 | break; |
| 341 | 341 | |
| r17813 | r17814 | |
| 351 | 351 | 0x01 = ADDSCLK (ADC SCLK) |
| 352 | 352 | */ |
| 353 | 353 | if (data & 0x80) /* CG Board 1 IRQ Ack */ |
| 354 | cput | |
| 354 | machine().device("maincpu")->execute().set_input_line( | |
| 355 | 355 | if (data & 0x40) /* CG Board 0 IRQ Ack */ |
| 356 | cput | |
| 356 | machine().device("maincpu")->execute().set_input_line( | |
| 357 | 357 | set_cgboard_id((data >> 4) & 3); |
| 358 | 358 | ioport("OUT4")->write(data, 0xff); |
| 359 | 359 | mame_printf_debug("System register 1 = %02X\n", data); |
| r17813 | r17814 | |
| 675 | 675 | |
| 676 | 676 | static TIMER_CALLBACK( irq_off ) |
| 677 | 677 | { |
| 678 | cput | |
| 678 | machine.device("audiocpu")->execute().set_input_line( | |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | static void sound_irq_callback( running_machine &machine, int irq ) |
| 682 | 682 | { |
| 683 | 683 | int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; |
| 684 | 684 | |
| 685 | cput | |
| 685 | machine.device("audiocpu")->execute().set_input_line( | |
| 686 | 686 | machine.scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line); |
| 687 | 687 | } |
| 688 | 688 | |
| r17813 | r17814 | |
| 720 | 720 | |
| 721 | 721 | static MACHINE_RESET( zr107 ) |
| 722 | 722 | { |
| 723 | cput | |
| 723 | machine.device("dsp")->execute().set_input_line( | |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | static MACHINE_CONFIG_START( zr107, zr107_state ) |
| r17813 | r17814 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | /* if this is a rising edge of 16V, assert the CPU interrupt */ |
| 137 | 137 | if (scanline % 32 == 16) |
| 138 | cput | |
| 138 | machine.device("maincpu")->execute().set_input_line( | |
| 139 | 139 | |
| 140 | 140 | /* update the DAC state */ |
| 141 | 141 | machine.device<dac_device>("dac")->write_unsigned8((videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0); |
| r17813 | r17814 | |
| 157 | 157 | |
| 158 | 158 | WRITE8_MEMBER(sbrkout_state::irq_ack_w) |
| 159 | 159 | { |
| 160 | cput | |
| 160 | machine().device("maincpu")->execute().set_input_line( | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| r17813 | r17814 | |
| 202 | 202 | { |
| 203 | 203 | sbrkout_state *state = machine.driver_data<sbrkout_state>(); |
| 204 | 204 | if ((state->m_pot_trigger[0] & ~state->m_pot_mask[0]) | (state->m_pot_trigger[1] & ~state->m_pot_mask[1])) |
| 205 | cput | |
| 205 | machine.device("maincpu")->execute().set_input_line( | |
| 206 | 206 | else |
| 207 | cput | |
| 207 | machine.device("maincpu")->execute().set_input_line( | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 |
| r17813 | r17814 | |
|---|---|---|
| 42 | 42 | int scanline = param; |
| 43 | 43 | |
| 44 | 44 | if(scanline == 240 && k007342_is_int_enabled(state->m_k007342)) // vblank-out irq |
| 45 | | |
| 45 | | |
| 46 | 46 | |
| 47 | 47 | if(scanline == 0) // vblank-in or timer irq |
| 48 | | |
| 48 | | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /************************************* |
| r17813 | r17814 | |
|---|---|---|
| 343 | 343 | |
| 344 | 344 | WRITE8_MEMBER(bwidow_state::irq_ack_w) |
| 345 | 345 | { |
| 346 | cput | |
| 346 | machine().device("maincpu")->execute().set_input_line( | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 |
| r17813 | r17814 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | WRITE_LINE_MEMBER(re900_state::vdp_interrupt) |
| 249 | 249 | { |
| 250 | cput | |
| 250 | machine().device("maincpu")->execute().set_input_line( | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 |
| r17813 | r17814 | |
|---|---|---|
| 81 | 81 | /* TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?) */ |
| 82 | 82 | /* this is a temporary solution to get rid of deprecat lib and the crashes, but also makes the game timer to be too slow */ |
| 83 | 83 | if(scanline == 256 && timer.machine().primary_screen->frame_number() & 1) // vblank-out irq |
| 84 | | |
| 84 | | |
| 85 | 85 | else if((scanline % 128) == 0) // timer irq |
| 86 | | |
| 86 | | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static INTERRUPT_GEN( cpuB_interrupt ) |
| r17813 | r17814 | |
| 312 | 312 | state->m_road_colorbase[1] = 0; |
| 313 | 313 | |
| 314 | 314 | /* start with cpu B halted */ |
| 315 | c | |
| 315 | machine.device("sub")->execute().set_input_line( | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | static const k053252_interface overdriv_k053252_intf = |
| r17813 | r17814 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | WRITE8_MEMBER(spcforce_state::spcforce_soundtrigger_w) |
| 78 | 78 | { |
| 79 | | |
| 79 | | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | WRITE8_MEMBER(spcforce_state::irq_mask_w) |
| r17813 | r17814 | |
|---|---|---|
| 324 | 324 | WRITE8_MEMBER(gsword_state::adpcm_soundcommand_w) |
| 325 | 325 | { |
| 326 | 326 | soundlatch_byte_w(space, 0, data); |
| 327 | | |
| 327 | | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM , 8, gsword_state ) |
| r17813 | r17814 | |
|---|---|---|
| 357 | 357 | int scanline = param; |
| 358 | 358 | |
| 359 | 359 | if(scanline == 240 && state->m_vblank_irq_mask) // vblank-out irq |
| 360 | | |
| 360 | | |
| 361 | 361 | |
| 362 | 362 | if(scanline == 0) // sprite DMA irq? |
| 363 | | |
| 363 | | |
| 364 | 364 | |
| 365 | 365 | } |
| 366 | 366 |
| r17813 | r17814 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | WRITE8_MEMBER(wink_state::sound_irq_w) |
| 109 | 109 | { |
| 110 | | |
| 110 | | |
| 111 | 111 | //sync with sound cpu (but it still loses some soundlatches...) |
| 112 | 112 | //machine().scheduler().synchronize(); |
| 113 | 113 | } |
| r17813 | r17814 | |
|---|---|---|
| 37 | 37 | if (ACCESSING_BITS_0_7) |
| 38 | 38 | { |
| 39 | 39 | soundlatch_byte_w(space, 0x00, data & 0xff); |
| 40 | | |
| 40 | | |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| r17813 | r17814 | |
| 363 | 363 | |
| 364 | 364 | static void irqhandler(device_t *device, int irq) |
| 365 | 365 | { |
| 366 | | |
| 366 | | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 186 | 186 | ---- ---- -??- -??? connected to the other levels? |
| 187 | 187 | */ |
| 188 | 188 | if(((irq_reg & 8) == 0) && data & 8) |
| 189 | cput | |
| 189 | machine().device("maincpu")->execute().set_input_line( | |
| 190 | 190 | |
| 191 | 191 | if(((irq_reg & 0x10) == 0) && data & 0x10) |
| 192 | cput | |
| 192 | machine().device("maincpu")->execute().set_input_line( | |
| 193 | 193 | |
| 194 | 194 | if(data & 0xffe7) |
| 195 | 195 | printf("%04x\n",data); |
| r17813 | r17814 | |
|---|---|---|
| 281 | 281 | |
| 282 | 282 | INPUT_CHANGED_MEMBER(naughtyb_state::coin_inserted) |
| 283 | 283 | { |
| 284 | cput | |
| 284 | machine().device("maincpu")->execute().set_input_line( | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | static INPUT_PORTS_START( naughtyb ) |
| r17813 | r17814 | |
|---|---|---|
| 490 | 490 | WRITE8_MEMBER(corona_state::sound_latch_w) |
| 491 | 491 | { |
| 492 | 492 | soundlatch_byte_w(space, 0, data & 0xff); |
| 493 | | |
| 493 | | |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | READ8_MEMBER(corona_state::sound_latch_r) |
| 497 | 497 | { |
| 498 | | |
| 498 | | |
| 499 | 499 | return soundlatch_byte_r(space, 0); |
| 500 | 500 | } |
| 501 | 501 |
| r17813 | r17814 | |
|---|---|---|
| 380 | 380 | |
| 381 | 381 | WRITE_LINE_MEMBER(taitowlf_state::pc_dma_hrq_changed) |
| 382 | 382 | { |
| 383 | cput | |
| 383 | machine().device("maincpu")->execute().set_input_line( | |
| 384 | 384 | |
| 385 | 385 | /* Assert HLDA */ |
| 386 | 386 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
| 553 | 553 | |
| 554 | 554 | WRITE_LINE_MEMBER(taitowlf_state::taitowlf_pic8259_1_set_int_line) |
| 555 | 555 | { |
| 556 | cput | |
| 556 | machine().device("maincpu")->execute().set_input_line( | |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | READ8_MEMBER(taitowlf_state::get_slave_ack) |
| r17813 | r17814 | |
| 663 | 663 | |
| 664 | 664 | static void set_gate_a20(running_machine &machine, int a20) |
| 665 | 665 | { |
| 666 | cput | |
| 666 | machine.device("maincpu")->execute().set_input_line( | |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | static void keyboard_interrupt(running_machine &machine, int state) |
| r17813 | r17814 | |
|---|---|---|
| 893 | 893 | ide_set_gnet_readlock(machine.device(":card"), 1); |
| 894 | 894 | |
| 895 | 895 | // halt sound CPU since it has no valid program at start |
| 896 | c | |
| 896 | machine.device("mn10200")->execute().set_input_line( | |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | 899 | static ADDRESS_MAP_START( taitogn_map, AS_PROGRAM, 32, taitogn_state ) |
| r17813 | r17814 | |
|---|---|---|
| 57 | 57 | WRITE8_MEMBER(scotrsht_state::scotrsht_soundlatch_w) |
| 58 | 58 | { |
| 59 | 59 | soundlatch_byte_w(space, 0, data); |
| 60 | | |
| 60 | | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static ADDRESS_MAP_START( scotrsht_map, AS_PROGRAM, 8, scotrsht_state ) |
| r17813 | r17814 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | static TIMER_CALLBACK( gunbustr_interrupt5 ) |
| 56 | 56 | { |
| 57 | cput | |
| 57 | machine.device("maincpu")->execute().set_input_line( | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static INTERRUPT_GEN( gunbustr_interrupt ) |
| r17813 | r17814 | |
|---|---|---|
| 468 | 468 | state->m_snd_ctrl1 = 0; |
| 469 | 469 | |
| 470 | 470 | #ifdef USE_MCU |
| 471 | c | |
| 471 | machine.device("mcu")->execute().set_input_line( | |
| 472 | 472 | #else |
| 473 | 473 | state->m_mcu_val = 0; |
| 474 | 474 | state->m_direction = 0; |
| r17813 | r17814 | |
|---|---|---|
| 588 | 588 | case 0x00: /* INT ON 2 */ |
| 589 | 589 | m_sub_irq_mask = bit; |
| 590 | 590 | if (!bit) |
| 591 | c | |
| 591 | machine().device("sub")->execute().set_input_line( | |
| 592 | 592 | break; |
| 593 | 593 | |
| 594 | 594 | case 0x02: /* INT ON */ |
| 595 | 595 | m_main_irq_mask = bit; |
| 596 | 596 | if (!bit) |
| 597 | cput | |
| 597 | machine().device("maincpu")->execute().set_input_line( | |
| 598 | 598 | break; |
| 599 | 599 | |
| 600 | 600 | case 0x04: /* n.c. */ |
| r17813 | r17814 | |
| 610 | 610 | break; |
| 611 | 611 | |
| 612 | 612 | case 0x0a: /* SUB RESET */ |
| 613 | c | |
| 613 | machine().device("sub")->execute().set_input_line( | |
| 614 | 614 | break; |
| 615 | 615 | |
| 616 | 616 | case 0x0c: /* n.c. */ |
| r17813 | r17814 | |
| 632 | 632 | case 0x00: |
| 633 | 633 | m_sub_irq_mask = bit; |
| 634 | 634 | if (!bit) |
| 635 | c | |
| 635 | machine().device("sub")->execute().set_input_line( | |
| 636 | 636 | break; |
| 637 | 637 | |
| 638 | 638 | case 0x02: |
| 639 | 639 | m_main_irq_mask = bit; |
| 640 | 640 | if (!bit) |
| 641 | cput | |
| 641 | machine().device("maincpu")->execute().set_input_line( | |
| 642 | 642 | break; |
| 643 | 643 | |
| 644 | 644 | case 0x04: |
| 645 | 645 | m_sub2_irq_mask = bit; |
| 646 | 646 | if (!bit) |
| 647 | c | |
| 647 | machine().device("sub2")->execute().set_input_line( | |
| 648 | 648 | break; |
| 649 | 649 | |
| 650 | 650 | case 0x06: |
| r17813 | r17814 | |
| 657 | 657 | break; |
| 658 | 658 | |
| 659 | 659 | case 0x0a: |
| 660 | c | |
| 660 | machine().device("sub")->execute().set_input_line( | |
| 661 | 661 | break; |
| 662 | 662 | |
| 663 | 663 | case 0x0c: |
| 664 | c | |
| 664 | machine().device("sub2")->execute().set_input_line( | |
| 665 | 665 | break; |
| 666 | 666 | |
| 667 | 667 | case 0x0e: |
| r17813 | r17814 | |
| 680 | 680 | case 0x00: /* INT ON 2 */ |
| 681 | 681 | m_sub_irq_mask = bit; |
| 682 | 682 | if (!bit) |
| 683 | c | |
| 683 | machine().device("sub")->execute().set_input_line( | |
| 684 | 684 | break; |
| 685 | 685 | |
| 686 | 686 | case 0x02: /* INT ON */ |
| 687 | 687 | m_main_irq_mask = bit; |
| 688 | 688 | if (!bit) |
| 689 | cput | |
| 689 | machine().device("maincpu")->execute().set_input_line( | |
| 690 | 690 | break; |
| 691 | 691 | |
| 692 | 692 | case 0x04: /* FLIP */ |
| r17813 | r17814 | |
| 703 | 703 | break; |
| 704 | 704 | |
| 705 | 705 | case 0x0a: /* SUB RESET */ |
| 706 | c | |
| 706 | machine().device("sub")->execute().set_input_line( | |
| 707 | 707 | break; |
| 708 | 708 | |
| 709 | 709 | case 0x0c: /* n.c. */ |
| r17813 | r17814 | |
| 773 | 773 | device_t *namcoio_2 = device->machine().device("namcoio_2"); |
| 774 | 774 | |
| 775 | 775 | if (state->m_main_irq_mask) |
| 776 | | |
| 776 | | |
| 777 | 777 | |
| 778 | 778 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 779 | 779 | device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run)); |
| r17813 | r17814 | |
| 805 | 805 | device_t *namcoio_2 = device->machine().device("namcoio_2"); |
| 806 | 806 | |
| 807 | 807 | if (state->m_main_irq_mask) |
| 808 | | |
| 808 | | |
| 809 | 809 | |
| 810 | 810 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 811 | 811 | device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run)); |
| r17813 | r17814 | |
| 837 | 837 | device_t *namcoio_2 = device->machine().device("namcoio_2"); |
| 838 | 838 | |
| 839 | 839 | if (state->m_main_irq_mask) |
| 840 | | |
| 840 | | |
| 841 | 841 | |
| 842 | 842 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 843 | 843 | device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run)); |
| r17813 | r17814 | |
| 869 | 869 | device_t *namcoio_2 = device->machine().device("namcoio_2"); |
| 870 | 870 | |
| 871 | 871 | if(state->m_main_irq_mask) |
| 872 | | |
| 872 | | |
| 873 | 873 | |
| 874 | 874 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 875 | 875 | device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run)); |
| r17813 | r17814 | |
| 883 | 883 | mappy_state *state = device->machine().driver_data<mappy_state>(); |
| 884 | 884 | |
| 885 | 885 | if(state->m_sub_irq_mask) |
| 886 | | |
| 886 | | |
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | static INTERRUPT_GEN( sub2_vblank_irq ) |
| r17813 | r17814 | |
| 891 | 891 | mappy_state *state = device->machine().driver_data<mappy_state>(); |
| 892 | 892 | |
| 893 | 893 | if(state->m_sub2_irq_mask) |
| 894 | | |
| 894 | | |
| 895 | 895 | } |
| 896 | 896 | |
| 897 | 897 | static ADDRESS_MAP_START( superpac_cpu1_map, AS_PROGRAM, 8, mappy_state ) |
| r17813 | r17814 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | if ( diff & 0x40 ) |
| 138 | 138 | { |
| 139 | cput | |
| 139 | machine().device("maincpu")->execute().set_input_line( | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /* D5 : Connected to a TIP31 which may control the coin meter: |
| r17813 | r17814 | |
|---|---|---|
| 346 | 346 | |
| 347 | 347 | WRITE_LINE_MEMBER(funkball_state::pc_dma_hrq_changed) |
| 348 | 348 | { |
| 349 | cput | |
| 349 | machine().device("maincpu")->execute().set_input_line( | |
| 350 | 350 | |
| 351 | 351 | /* Assert HLDA */ |
| 352 | 352 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
|---|---|---|
| 182 | 182 | // reset 2KHz timer |
| 183 | 183 | m_mk5_2KHz_timer->adjust(attotime::from_hz(1953.125)); |
| 184 | 184 | ioc_regs[IRQ_STATUS_A] &= ~0x01; |
| 185 | cput | |
| 185 | machine().device("maincpu")->execute().set_input_line( | |
| 186 | 186 | return 0xffffffff; |
| 187 | 187 | } |
| 188 | 188 |
| r17813 | r17814 | |
|---|---|---|
| 493 | 493 | |
| 494 | 494 | static void tms_interrupt(device_t *device, int state) |
| 495 | 495 | { |
| 496 | | |
| 496 | | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 |
| r17813 | r17814 | |
|---|---|---|
| 582 | 582 | int scanline = param; |
| 583 | 583 | |
| 584 | 584 | if(scanline == 232) // vblank-out irq |
| 585 | | |
| 585 | | |
| 586 | 586 | |
| 587 | 587 | if(scanline == 24) // vblank-in irq |
| 588 | | |
| 588 | | |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | static TIMER_DEVICE_CALLBACK( splndrbt_scanline ) |
| r17813 | r17814 | |
| 593 | 593 | int scanline = param; |
| 594 | 594 | |
| 595 | 595 | if(scanline == 224) // vblank-out irq |
| 596 | | |
| 596 | | |
| 597 | 597 | |
| 598 | 598 | if(scanline == 32) // vblank-in irq |
| 599 | | |
| 599 | | |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | WRITE8_MEMBER(equites_state::equites_8155_w) |
| r17813 | r17814 | |
|---|---|---|
| 262 | 262 | WRITE8_MEMBER(mirax_state::mirax_sound_cmd_w) |
| 263 | 263 | { |
| 264 | 264 | soundlatch_byte_w(space, 0, data & 0xff); |
| 265 | | |
| 265 | | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 |
| r17813 | r17814 | |
|---|---|---|
| 113 | 113 | int scanline = param; |
| 114 | 114 | |
| 115 | 115 | if(scanline == 240 && state->m_irqBmask & 1) // vblank-out irq |
| 116 | | |
| 116 | | |
| 117 | 117 | |
| 118 | 118 | if(scanline == 16 && state->m_irqBmask & 2) // sprite end DMA irq |
| 119 | | |
| 119 | | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | WRITE16_MEMBER(gradius3_state::cpuB_irqtrigger_w) |
| r17813 | r17814 | |
| 307 | 307 | gradius3_state *state = machine.driver_data<gradius3_state>(); |
| 308 | 308 | |
| 309 | 309 | /* start with cpu B halted */ |
| 310 | c | |
| 310 | machine.device("sub")->execute().set_input_line( | |
| 311 | 311 | state->m_irqAen = 0; |
| 312 | 312 | state->m_irqBmask = 0; |
| 313 | 313 | state->m_priority = 0; |
| r17813 | r17814 | |
|---|---|---|
| 328 | 328 | WRITE8_MEMBER(omegrace_state::omegrace_soundlatch_w) |
| 329 | 329 | { |
| 330 | 330 | soundlatch_byte_w (space, offset, data); |
| 331 | | |
| 331 | | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 |
| r17813 | r17814 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | WRITE16_MEMBER(mystwarr_state::sound_irq_w) |
| 186 | 186 | { |
| 187 | | |
| 187 | | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | READ16_MEMBER(mystwarr_state::sound_status_r) |
| r17813 | r17814 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | static void dleuro_interrupt(device_t *device, int state) |
| 149 | 149 | { |
| 150 | | |
| 150 | | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 |
| r17813 | r17814 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | WRITE8_MEMBER(irobot_state::irobot_clearirq_w) |
| 109 | 109 | { |
| 110 | cput | |
| 110 | machine().device("maincpu")->execute().set_input_line( | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | 114 | WRITE8_MEMBER(irobot_state::irobot_clearfirq_w) |
| 115 | 115 | { |
| 116 | cput | |
| 116 | machine().device("maincpu")->execute().set_input_line( | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 |
| r17813 | r17814 | |
|---|---|---|
| 34 | 34 | static void update_interrupts(running_machine &machine) |
| 35 | 35 | { |
| 36 | 36 | klax_state *state = machine.driver_data<klax_state>(); |
| 37 | cput | |
| 37 | machine.device("maincpu")->execute().set_input_line( | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 |
| r17813 | r17814 | |
|---|---|---|
| 687 | 687 | int changed = resetcontrol ^ prev_resetcontrol; |
| 688 | 688 | if(changed & 2) { |
| 689 | 689 | if(resetcontrol & 2) { |
| 690 | cputag_set_input_line(machine(), "subcpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 691 | cputag_set_input_line(machine(), "subcpu", INPUT_LINE_RESET, PULSE_LINE); | |
| 690 | machine().device("subcpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 691 | machine().device("subcpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
| 692 | 692 | // mame_printf_debug("enable 2nd cpu!\n"); |
| 693 | 693 | // debugger_break(machine); |
| 694 | 694 | |
| 695 | 695 | } else |
| 696 | cput | |
| 696 | machine().device("subcpu")->execute().set_input_line( | |
| 697 | 697 | } |
| 698 | 698 | if(changed & 4) |
| 699 | 699 | devtag_reset(machine(), "ymsnd"); |
| r17813 | r17814 | |
| 756 | 756 | WRITE8_MEMBER( segas24_state::frc_w ) |
| 757 | 757 | { |
| 758 | 758 | /* Undocumented behaviour, Bonanza Bros. seems to use this for irq ack'ing ... */ |
| 759 | cputag_set_input_line(machine(), "maincpu", IRQ_FRC+1, CLEAR_LINE); | |
| 760 | cputag_set_input_line(machine(), "subcpu", IRQ_FRC+1, CLEAR_LINE); | |
| 759 | machine().device("maincpu")->execute().set_input_line(IRQ_FRC+1, CLEAR_LINE); | |
| 760 | machine().device("subcpu")->execute().set_input_line(IRQ_FRC+1, CLEAR_LINE); | |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | |
| r17813 | r17814 | |
| 874 | 874 | |
| 875 | 875 | state->irq_timer_pend0 = state->irq_timer_pend1 = 1; |
| 876 | 876 | if(state->irq_allow0 & (1 << IRQ_TIMER)) |
| 877 | | |
| 877 | | |
| 878 | 878 | if(state->irq_allow1 & (1 << IRQ_TIMER)) |
| 879 | | |
| 879 | | |
| 880 | 880 | |
| 881 | 881 | if(state->irq_tmode == 1 || state->irq_tmode == 2) |
| 882 | 882 | timer.machine().primary_screen->update_now(); |
| r17813 | r17814 | |
| 886 | 886 | { |
| 887 | 887 | segas24_state *state = timer.machine().driver_data<segas24_state>(); |
| 888 | 888 | state->irq_sprite = state->irq_vblank = 0; |
| 889 | cputag_set_input_line(timer.machine(), "maincpu", IRQ_VBLANK+1, CLEAR_LINE); | |
| 890 | cputag_set_input_line(timer.machine(), "maincpu", IRQ_SPRITE+1, CLEAR_LINE); | |
| 891 | cputag_set_input_line(timer.machine(), "subcpu", IRQ_VBLANK+1, CLEAR_LINE); | |
| 892 | cputag_set_input_line(timer.machine(), "subcpu", IRQ_SPRITE+1, CLEAR_LINE); | |
| 889 | timer.machine().device("maincpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE); | |
| 890 | timer.machine().device("maincpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE); | |
| 891 | timer.machine().device("subcpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE); | |
| 892 | timer.machine().device("subcpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE); | |
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | static TIMER_DEVICE_CALLBACK( irq_frc_cb ) |
| r17813 | r17814 | |
| 897 | 897 | segas24_state *state = timer.machine().driver_data<segas24_state>(); |
| 898 | 898 | |
| 899 | 899 | if(state->irq_allow0 & (1 << IRQ_FRC) && state->frc_mode == 1) |
| 900 | | |
| 900 | | |
| 901 | 901 | |
| 902 | 902 | if(state->irq_allow1 & (1 << IRQ_FRC) && state->frc_mode == 1) |
| 903 | | |
| 903 | | |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | void segas24_state::irq_init() |
| r17813 | r17814 | |
| 941 | 941 | case 2: |
| 942 | 942 | irq_allow0 = data & 0x3f; |
| 943 | 943 | irq_timer_pend0 = 0; |
| 944 | cputag_set_input_line(machine(), "maincpu", IRQ_TIMER+1, CLEAR_LINE); | |
| 945 | cputag_set_input_line(machine(), "maincpu", IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 946 | cputag_set_input_line(machine(), "maincpu", IRQ_VBLANK+1, irq_vblank && (irq_allow0 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); | |
| 947 | cputag_set_input_line(machine(), "maincpu", IRQ_SPRITE+1, irq_sprite && (irq_allow0 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); | |
| 948 | //cputag_set_input_line(machine(), "maincpu", IRQ_FRC+1, irq_frc && (irq_allow0 & (1 << IRQ_FRC)) ? ASSERT_LINE : CLEAR_LINE); | |
| 944 | machine().device("maincpu")->execute().set_input_line(IRQ_TIMER+1, CLEAR_LINE); | |
| 945 | machine().device("maincpu")->execute().set_input_line(IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 946 | machine().device("maincpu")->execute().set_input_line(IRQ_VBLANK+1, irq_vblank && (irq_allow0 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); | |
| 947 | machine().device("maincpu")->execute().set_input_line(IRQ_SPRITE+1, irq_sprite && (irq_allow0 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); | |
| 948 | //machine().device("maincpu")->execute().set_input_line(IRQ_FRC+1, irq_frc && (irq_allow0 & (1 << IRQ_FRC)) ? ASSERT_LINE : CLEAR_LINE); | |
| 949 | 949 | break; |
| 950 | 950 | case 3: |
| 951 | 951 | irq_allow1 = data & 0x3f; |
| 952 | 952 | irq_timer_pend1 = 0; |
| 953 | cputag_set_input_line(machine(), "subcpu", IRQ_TIMER+1, CLEAR_LINE); | |
| 954 | cputag_set_input_line(machine(), "subcpu", IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 955 | cputag_set_input_line(machine(), "subcpu", IRQ_VBLANK+1, irq_vblank && (irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); | |
| 956 | cputag_set_input_line(machine(), "subcpu", IRQ_SPRITE+1, irq_sprite && (irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); | |
| 957 | //cputag_set_input_line(machine(), "subcpu", IRQ_FRC+1, irq_frc && (irq_allow1 & (1 << IRQ_FRC)) ? ASSERT_LINE : CLEAR_LINE); | |
| 953 | machine().device("subcpu")->execute().set_input_line(IRQ_TIMER+1, CLEAR_LINE); | |
| 954 | machine().device("subcpu")->execute().set_input_line(IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 955 | machine().device("subcpu")->execute().set_input_line(IRQ_VBLANK+1, irq_vblank && (irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); | |
| 956 | machine().device("subcpu")->execute().set_input_line(IRQ_SPRITE+1, irq_sprite && (irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); | |
| 957 | //machine().device("subcpu")->execute().set_input_line(IRQ_FRC+1, irq_frc && (irq_allow1 & (1 << IRQ_FRC)) ? ASSERT_LINE : CLEAR_LINE); | |
| 958 | 958 | break; |
| 959 | 959 | } |
| 960 | 960 | } |
| r17813 | r17814 | |
| 974 | 974 | switch(offset) { |
| 975 | 975 | case 2: |
| 976 | 976 | irq_timer_pend0 = 0; |
| 977 | cput | |
| 977 | machine().device("maincpu")->execute().set_input_line( | |
| 978 | 978 | break; |
| 979 | 979 | case 3: |
| 980 | 980 | irq_timer_pend1 = 0; |
| 981 | cput | |
| 981 | machine().device("subcpu")->execute().set_input_line( | |
| 982 | 982 | break; |
| 983 | 983 | } |
| 984 | 984 | irq_timer_sync(); |
| r17813 | r17814 | |
| 1002 | 1002 | mask = 1 << irq; |
| 1003 | 1003 | |
| 1004 | 1004 | if(state->irq_allow0 & mask) |
| 1005 | | |
| 1005 | | |
| 1006 | 1006 | |
| 1007 | 1007 | if(state->irq_allow1 & mask) |
| 1008 | | |
| 1008 | | |
| 1009 | 1009 | |
| 1010 | 1010 | if(scanline == 384) { |
| 1011 | 1011 | // Ensure one index pulse every 20 frames |
| r17813 | r17814 | |
| 1024 | 1024 | { |
| 1025 | 1025 | segas24_state *state = device->machine().driver_data<segas24_state>(); |
| 1026 | 1026 | state->irq_yms = irq; |
| 1027 | cputag_set_input_line(device->machine(), "maincpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 1028 | cputag_set_input_line(device->machine(), "subcpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 1027 | device->machine().device("maincpu")->execute().set_input_line(IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 1028 | device->machine().device("subcpu")->execute().set_input_line(IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); | |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | |
| r17813 | r17814 | |
| 1279 | 1279 | static MACHINE_RESET( system24 ) |
| 1280 | 1280 | { |
| 1281 | 1281 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 1282 | cput | |
| 1282 | machine.device("subcpu")->execute().set_input_line( | |
| 1283 | 1283 | state->prev_resetcontrol = state->resetcontrol = 0x06; |
| 1284 | 1284 | state->fdc_init(); |
| 1285 | 1285 | state->curbank = 0; |
| r17813 | r17814 | |
|---|---|---|
| 389 | 389 | WRITE_LINE_MEMBER(peplus_state::crtc_vsync) |
| 390 | 390 | { |
| 391 | 391 | device_t *device = machine().device("crtc"); |
| 392 | cput | |
| 392 | machine().device("maincpu")->execute().set_input_line( | |
| 393 | 393 | handle_lightpen(device); |
| 394 | 394 | } |
| 395 | 395 |
| r17813 | r17814 | |
|---|---|---|
| 420 | 420 | if (konamigx_wrport1_1 & 0x10) |
| 421 | 421 | { |
| 422 | 422 | gx_rdport1_3 &= ~8; |
| 423 | cput | |
| 423 | machine().device("maincpu")->execute().set_input_line( | |
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | else |
| r17813 | r17814 | |
| 510 | 510 | { |
| 511 | 511 | // enable 68k |
| 512 | 512 | // clear the halt condition and reset the 68000 |
| 513 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 514 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, PULSE_LINE); | |
| 513 | machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 514 | machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
| 515 | 515 | } |
| 516 | 516 | else |
| 517 | 517 | { |
| 518 | 518 | // disable 68k |
| 519 | | |
| 519 | | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | K053246_set_OBJCHA_line((data&0x100000) ? ASSERT_LINE : CLEAR_LINE); |
| r17813 | r17814 | |
| 579 | 579 | // vblank interrupt ACK |
| 580 | 580 | if (ACCESSING_BITS_24_31) |
| 581 | 581 | { |
| 582 | cput | |
| 582 | machine().device("maincpu")->execute().set_input_line( | |
| 583 | 583 | gx_syncen |= 0x20; |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | // hblank interrupt ACK |
| 587 | 587 | if (ACCESSING_BITS_8_15) |
| 588 | 588 | { |
| 589 | cput | |
| 589 | machine().device("maincpu")->execute().set_input_line( | |
| 590 | 590 | gx_syncen |= 0x40; |
| 591 | 591 | } |
| 592 | 592 | } |
| r17813 | r17814 | |
| 616 | 616 | |
| 617 | 617 | // lower OBJINT-REQ flag and trigger interrupt |
| 618 | 618 | gx_rdport1_3 &= ~0x80; |
| 619 | cput | |
| 619 | machine.device("maincpu")->execute().set_input_line( | |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | |
| r17813 | r17814 | |
| 840 | 840 | |
| 841 | 841 | if (reg == 7) |
| 842 | 842 | { |
| 843 | cput | |
| 843 | machine.device("soundcpu")->execute().set_input_line( | |
| 844 | 844 | } |
| 845 | 845 | } |
| 846 | 846 | |
| r17813 | r17814 | |
| 1133 | 1133 | if (konamigx_wrport1_1 & 0x10) |
| 1134 | 1134 | { |
| 1135 | 1135 | gx_rdport1_3 &= ~8; |
| 1136 | cput | |
| 1136 | machine().device("maincpu")->execute().set_input_line( | |
| 1137 | 1137 | } |
| 1138 | 1138 | |
| 1139 | 1139 | // don't accidentally do a phony command |
| r17813 | r17814 | |
| 1283 | 1283 | { |
| 1284 | 1284 | machine().device<tms57002_device>("dasp")->pload_w(space, 0, data & 4); |
| 1285 | 1285 | machine().device<tms57002_device>("dasp")->cload_w(space, 0, data & 8); |
| 1286 | cput | |
| 1286 | machine().device("dasp")->execute().set_input_line( | |
| 1287 | 1287 | } |
| 1288 | 1288 | } |
| 1289 | 1289 | |
| r17813 | r17814 | |
| 3645 | 3645 | memset(sndto020, 0, 16); |
| 3646 | 3646 | |
| 3647 | 3647 | // sound CPU initially disabled? |
| 3648 | cputag_set_input_line(machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 3649 | cputag_set_input_line(machine, "dasp", INPUT_LINE_RESET, ASSERT_LINE); | |
| 3648 | machine.device("soundcpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 3649 | machine.device("dasp")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 3650 | 3650 | |
| 3651 | 3651 | if (!strcmp(machine.system().name, "tkmmpzdm")) |
| 3652 | 3652 | { |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | static void update_interrupts(running_machine &machine) |
| 36 | 36 | { |
| 37 | 37 | thunderj_state *state = machine.driver_data<thunderj_state>(); |
| 38 | cputag_set_input_line(machine, "maincpu", 4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | cputag_set_input_line(machine, "extra", 4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | cputag_set_input_line(machine, "maincpu", 6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("extra")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| r17813 | r17814 | |
| 88 | 88 | { |
| 89 | 89 | /* 0 means hold CPU 2's reset low */ |
| 90 | 90 | if (data & 1) |
| 91 | c | |
| 91 | machine().device("extra")->execute().set_input_line( | |
| 92 | 92 | else |
| 93 | c | |
| 93 | machine().device("extra")->execute().set_input_line( | |
| 94 | 94 | |
| 95 | 95 | /* bits 2-5 are the alpha bank */ |
| 96 | 96 | if (m_alpha_tile_bank != ((data >> 2) & 7)) |
| r17813 | r17814 | |
|---|---|---|
| 349 | 349 | |
| 350 | 350 | WRITE8_MEMBER(quizpun2_state::quizpun2_irq_ack) |
| 351 | 351 | { |
| 352 | cput | |
| 352 | machine().device("maincpu")->execute().set_input_line( | |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | WRITE8_MEMBER(quizpun2_state::quizpun2_soundlatch_w) |
| 356 | 356 | { |
| 357 | 357 | soundlatch_byte_w(space, 0, data); |
| 358 | | |
| 358 | | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | static ADDRESS_MAP_START( quizpun2_map, AS_PROGRAM, 8, quizpun2_state ) |
| r17813 | r17814 | |
|---|---|---|
| 1248 | 1248 | static void segac2_irq2_interrupt(device_t *device, int state) |
| 1249 | 1249 | { |
| 1250 | 1250 | //printf("sound irq %d\n", state); |
| 1251 | | |
| 1251 | | |
| 1252 | 1252 | } |
| 1253 | 1253 | static const ym3438_interface ym3438_intf = |
| 1254 | 1254 | { |
| r17813 | r17814 | |
| 1343 | 1343 | void genesis_vdp_sndirqline_callback_segac2(running_machine &machine, bool state) |
| 1344 | 1344 | { |
| 1345 | 1345 | if (state==true) |
| 1346 | cput | |
| 1346 | machine.device("maincpu")->execute().set_input_line( | |
| 1347 | 1347 | } |
| 1348 | 1348 | |
| 1349 | 1349 | // the line usually used to drive irq6 is not connected |
| r17813 | r17814 | |
| 1356 | 1356 | void genesis_vdp_lv4irqline_callback_segac2(running_machine &machine, bool state) |
| 1357 | 1357 | { |
| 1358 | 1358 | if (state==true) |
| 1359 | cput | |
| 1359 | machine.device("maincpu")->execute().set_input_line( | |
| 1360 | 1360 | else |
| 1361 | cput | |
| 1361 | machine.device("maincpu")->execute().set_input_line( | |
| 1362 | 1362 | } |
| 1363 | 1363 | |
| 1364 | 1364 | static const sega315_5124_interface sms_vdp_ntsc_intf = |
| r17813 | r17814 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | // NMI on d0 |
| 92 | 92 | if (ticks_mask & state->m_interrupt_mask & 1) |
| 93 | | |
| 93 | | |
| 94 | 94 | |
| 95 | 95 | // IRQ on d3 (used by mrgoemon) |
| 96 | 96 | if (ticks_mask & state->m_interrupt_mask<<2 & 8) |
| 97 | | |
| 97 | | |
| 98 | 98 | |
| 99 | 99 | // IRQ on d4 (used by gberet) |
| 100 | 100 | if (ticks_mask & state->m_interrupt_mask<<2 & 16) |
| 101 | | |
| 101 | | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| r17813 | r17814 | |
| 132 | 132 | UINT8 ack_mask = ~data & m_interrupt_mask; // 1->0 |
| 133 | 133 | |
| 134 | 134 | if (ack_mask & 1) |
| 135 | cput | |
| 135 | machine().device("maincpu")->execute().set_input_line( | |
| 136 | 136 | |
| 137 | 137 | if (ack_mask & 6) |
| 138 | cput | |
| 138 | machine().device("maincpu")->execute().set_input_line( | |
| 139 | 139 | |
| 140 | 140 | m_interrupt_mask = data & 7; |
| 141 | 141 | |
| r17813 | r17814 | |
| 197 | 197 | |
| 198 | 198 | READ8_MEMBER(gberet_state::gberetb_irq_ack_r) |
| 199 | 199 | { |
| 200 | cput | |
| 200 | machine().device("maincpu")->execute().set_input_line( | |
| 201 | 201 | return 0xff; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | WRITE8_MEMBER(gberet_state::gberetb_nmi_ack_w) |
| 205 | 205 | { |
| 206 | cput | |
| 206 | machine().device("maincpu")->execute().set_input_line( | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static ADDRESS_MAP_START( gberetb_map, AS_PROGRAM, 8, gberet_state ) |
| r17813 | r17814 | |
|---|---|---|
| 151 | 151 | { |
| 152 | 152 | sandscrp_state *state = machine.driver_data<sandscrp_state>(); |
| 153 | 153 | if (state->m_vblank_irq || state->m_sprite_irq || state->m_unknown_irq) |
| 154 | cput | |
| 154 | machine.device("maincpu")->execute().set_input_line( | |
| 155 | 155 | else |
| 156 | cput | |
| 156 | machine.device("maincpu")->execute().set_input_line( | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| r17813 | r17814 | |
| 254 | 254 | { |
| 255 | 255 | m_latch1_full = 1; |
| 256 | 256 | soundlatch_byte_w(space, 0, data & 0xff); |
| 257 | | |
| 257 | | |
| 258 | 258 | device_spin_until_time(&space.device(), attotime::from_usec(100)); // Allow the other cpu to reply |
| 259 | 259 | } |
| 260 | 260 | } |
| r17813 | r17814 | |
| 471 | 471 | |
| 472 | 472 | static void irq_handler(device_t *device, int irq) |
| 473 | 473 | { |
| 474 | | |
| 474 | | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | static const ym2203_interface ym2203_intf_sandscrp = |
| r17813 | r17814 | |
|---|---|---|
| 424 | 424 | |
| 425 | 425 | static TIMER_CALLBACK( irq_stop ) |
| 426 | 426 | { |
| 427 | cput | |
| 427 | machine.device("maincpu")->execute().set_input_line( | |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | static INTERRUPT_GEN( vblank_callback_gpworld ) |
| r17813 | r17814 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | WRITE8_MEMBER(tubep_state::main_cpu_irq_line_clear_w) |
| 157 | 157 | { |
| 158 | cput | |
| 158 | machine().device("maincpu")->execute().set_input_line( | |
| 159 | 159 | logerror("CPU#0 VBLANK int clear at scanline=%3i\n", m_curr_scanline); |
| 160 | 160 | return; |
| 161 | 161 | } |
| r17813 | r17814 | |
| 191 | 191 | |
| 192 | 192 | WRITE8_MEMBER(tubep_state::second_cpu_irq_line_clear_w) |
| 193 | 193 | { |
| 194 | c | |
| 194 | machine().device("slave")->execute().set_input_line( | |
| 195 | 195 | logerror("CPU#1 VBLANK int clear at scanline=%3i\n", m_curr_scanline); |
| 196 | 196 | return; |
| 197 | 197 | } |
| r17813 | r17814 | |
| 226 | 226 | |
| 227 | 227 | READ8_MEMBER(tubep_state::tubep_sound_irq_ack) |
| 228 | 228 | { |
| 229 | | |
| 229 | | |
| 230 | 230 | return 0; |
| 231 | 231 | } |
| 232 | 232 | |
| r17813 | r17814 | |
| 266 | 266 | if (scanline == 240) |
| 267 | 267 | { |
| 268 | 268 | logerror("VBLANK CPU#0\n"); |
| 269 | cput | |
| 269 | machine.device("maincpu")->execute().set_input_line( | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | |
| r17813 | r17814 | |
| 275 | 275 | if (scanline == 16) |
| 276 | 276 | { |
| 277 | 277 | logerror("/VBLANK CPU#1\n"); |
| 278 | c | |
| 278 | machine.device("slave")->execute().set_input_line( | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | |
| r17813 | r17814 | |
| 285 | 285 | { |
| 286 | 286 | logerror("/nmi CPU#3\n"); |
| 287 | 287 | tubep_vblank_end(machine); /* switch buffered sprite RAM page */ |
| 288 | c | |
| 288 | machine.device("mcu")->execute().set_input_line( | |
| 289 | 289 | } |
| 290 | 290 | /* CPU #3 MS2010-A NMI */ |
| 291 | 291 | /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ |
| 292 | 292 | if (scanline == 240) |
| 293 | 293 | { |
| 294 | 294 | logerror("CPU#3 nmi clear\n"); |
| 295 | c | |
| 295 | machine.device("mcu")->execute().set_input_line( | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
| r17813 | r17814 | |
| 300 | 300 | /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */ |
| 301 | 301 | if ((scanline == 64) || (scanline == 192)) |
| 302 | 302 | { |
| 303 | cput | |
| 303 | machine.device("soundcpu")->execute().set_input_line( | |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | |
| r17813 | r17814 | |
| 396 | 396 | WRITE8_MEMBER(tubep_state::rjammer_soundlatch_w) |
| 397 | 397 | { |
| 398 | 398 | m_sound_latch = data; |
| 399 | | |
| 399 | | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | |
| r17813 | r17814 | |
| 451 | 451 | if (scanline == 240) |
| 452 | 452 | { |
| 453 | 453 | logerror("VBLANK CPU#0\n"); |
| 454 | cput | |
| 454 | machine.device("maincpu")->execute().set_input_line( | |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | |
| r17813 | r17814 | |
| 460 | 460 | if (scanline == 16) |
| 461 | 461 | { |
| 462 | 462 | logerror("/VBLANK CPU#1\n"); |
| 463 | c | |
| 463 | machine.device("slave")->execute().set_input_line( | |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | |
| r17813 | r17814 | |
| 470 | 470 | { |
| 471 | 471 | logerror("/nmi CPU#3\n"); |
| 472 | 472 | tubep_vblank_end(machine); /* switch buffered sprite RAM page */ |
| 473 | c | |
| 473 | machine.device("mcu")->execute().set_input_line( | |
| 474 | 474 | } |
| 475 | 475 | /* CPU #3 MS2010-A NMI */ |
| 476 | 476 | /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ |
| 477 | 477 | if (scanline == 240) |
| 478 | 478 | { |
| 479 | 479 | logerror("CPU#3 nmi clear\n"); |
| 480 | c | |
| 480 | machine.device("mcu")->execute().set_input_line( | |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | |
| r17813 | r17814 | |
| 485 | 485 | /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */ |
| 486 | 486 | if ((scanline == 64) || (scanline == 192)) |
| 487 | 487 | { |
| 488 | cput | |
| 488 | machine.device("soundcpu")->execute().set_input_line( | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | |
| r17813 | r17814 | |
| 564 | 564 | if (state->m_ls74 == 1) |
| 565 | 565 | { |
| 566 | 566 | msm5205_data_w(device, (state->m_ls377 >> 0) & 15 ); |
| 567 | | |
| 567 | | |
| 568 | 568 | } |
| 569 | 569 | else |
| 570 | 570 | { |
| r17813 | r17814 | |
| 586 | 586 | I do it here because this port (0x80) is first one accessed |
| 587 | 587 | in the interrupt routine. |
| 588 | 588 | */ |
| 589 | | |
| 589 | | |
| 590 | 590 | return; |
| 591 | 591 | } |
| 592 | 592 |
| r17813 | r17814 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | WRITE8_MEMBER(mw18w_state::mw18w_irq0_clear_w) |
| 66 | 66 | { |
| 67 | cput | |
| 67 | machine().device("maincpu")->execute().set_input_line( | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | CUSTOM_INPUT_MEMBER(mw18w_state::mw18w_sensors_r) |
| r17813 | r17814 | |
|---|---|---|
| 41 | 41 | WRITE8_MEMBER(pcktgal_state::pcktgal_sound_w) |
| 42 | 42 | { |
| 43 | 43 | soundlatch_byte_w(space, 0, data); |
| 44 | | |
| 44 | | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| r17813 | r17814 | |
| 54 | 54 | |
| 55 | 55 | state->m_toggle = 1 - state->m_toggle; |
| 56 | 56 | if (state->m_toggle) |
| 57 | | |
| 57 | | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | WRITE8_MEMBER(pcktgal_state::pcktgal_adpcm_data_w) |
| r17813 | r17814 | |
|---|---|---|
| 1048 | 1048 | if (cmd==0x55AA) |
| 1049 | 1049 | { |
| 1050 | 1050 | printf("soundcpu ON\n"); |
| 1051 | cputag_set_input_line(space.machine(), "audiocpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1052 | cputag_set_input_line(space.machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE); | |
| 1051 | space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1052 | space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 1053 | 1053 | } |
| 1054 | 1054 | else if (cmd==0xAA55) |
| 1055 | 1055 | { |
| 1056 | 1056 | printf("soundcpu OFF\n"); |
| 1057 | cputag_set_input_line(space.machine(), "audiocpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 1058 | cputag_set_input_line(space.machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 1057 | space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 1058 | space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 1059 | 1059 | } |
| 1060 | 1060 | else |
| 1061 | 1061 | { |
| r17813 | r17814 | |
| 1796 | 1796 | UINT8 *RAM = (UINT8*)state->m_soundram; |
| 1797 | 1797 | state->membank("bank1")->set_base(&RAM[0x1f0000]); // allows us to boot |
| 1798 | 1798 | state->membank("bank2")->set_base(&RAM[0x1f0000]); // seems to be the right default for most games (initial area jumps to a DI here) |
| 1799 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_HALT, ASSERT_LINE); | |
| 1800 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 1799 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 1800 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 1801 | 1801 | |
| 1802 | 1802 | /* Comm CPU */ |
| 1803 | 1803 | KL5C80_init(state); |
| r17813 | r17814 | |
| 1811 | 1811 | address_space *space = machine.device<z80_device>("comm")->space(AS_PROGRAM); |
| 1812 | 1812 | space->set_direct_update_handler(direct_update_delegate(FUNC(hng64_state::KL5C80_direct_handler), state)); |
| 1813 | 1813 | |
| 1814 | cputag_set_input_line(machine, "comm", INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip | |
| 1815 | // cputag_set_input_line(machine, "comm", INPUT_LINE_HALT, ASSERT_LINE); // hold on there pardner... | |
| 1814 | machine.device("comm")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip | |
| 1815 | // machine.device("comm")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); // hold on there pardner... | |
| 1816 | 1816 | |
| 1817 | 1817 | // "Display List" init - ugly |
| 1818 | 1818 | state->m_activeBuffer = 0; |
| r17813 | r17814 | |
|---|---|---|
| 14 | 14 | WRITE8_MEMBER(solomon_state::solomon_sh_command_w) |
| 15 | 15 | { |
| 16 | 16 | soundlatch_byte_w(space, offset, data); |
| 17 | | |
| 17 | | |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /* this is checked on the title screen and when you reach certain scores in the game |
| r17813 | r17814 | |
|---|---|---|
| 273 | 273 | static void gladiator_ym_irq(device_t *device, int irq) |
| 274 | 274 | { |
| 275 | 275 | /* NMI IRQ is not used by gladiator sound program */ |
| 276 | | |
| 276 | | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | /*Sound Functions*/ |
| r17813 | r17814 | |
| 293 | 293 | WRITE8_MEMBER(gladiatr_state::glad_cpu_sound_command_w) |
| 294 | 294 | { |
| 295 | 295 | soundlatch_byte_w(space,0,data); |
| 296 | | |
| 296 | | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | READ8_MEMBER(gladiatr_state::glad_cpu_sound_command_r) |
| 300 | 300 | { |
| 301 | | |
| 301 | | |
| 302 | 302 | return soundlatch_byte_r(space,0); |
| 303 | 303 | } |
| 304 | 304 | |
| r17813 | r17814 | |
| 312 | 312 | /* !!!!! patch to IRQ timming for 2nd CPU !!!!! */ |
| 313 | 313 | WRITE8_MEMBER(gladiatr_state::gladiatr_irq_patch_w) |
| 314 | 314 | { |
| 315 | c | |
| 315 | machine().device("sub")->execute().set_input_line( | |
| 316 | 316 | } |
| 317 | 317 | #endif |
| 318 | 318 |
| r17813 | r17814 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | WRITE16_MEMBER(umipoker_state::umipoker_irq_ack_w) |
| 176 | 176 | { |
| 177 | cput | |
| 177 | machine().device("maincpu")->execute().set_input_line( | |
| 178 | 178 | |
| 179 | 179 | /* shouldn't happen */ |
| 180 | 180 | if(data) |
| r17813 | r17814 | |
|---|---|---|
| 452 | 452 | |
| 453 | 453 | WRITE_LINE_MEMBER(gamecstl_state::pc_dma_hrq_changed) |
| 454 | 454 | { |
| 455 | cput | |
| 455 | machine().device("maincpu")->execute().set_input_line( | |
| 456 | 456 | |
| 457 | 457 | /* Assert HLDA */ |
| 458 | 458 | i8237_hlda_w( m_dma8237_1, state ); |
| r17813 | r17814 | |
| 634 | 634 | |
| 635 | 635 | WRITE_LINE_MEMBER(gamecstl_state::gamecstl_pic8259_1_set_int_line) |
| 636 | 636 | { |
| 637 | cput | |
| 637 | machine().device("maincpu")->execute().set_input_line( | |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | READ8_MEMBER(gamecstl_state::get_slave_ack) |
| r17813 | r17814 | |
| 737 | 737 | |
| 738 | 738 | static void set_gate_a20(running_machine &machine, int a20) |
| 739 | 739 | { |
| 740 | cput | |
| 740 | machine.device("maincpu")->execute().set_input_line( | |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | static void keyboard_interrupt(running_machine &machine, int state) |
| r17813 | r17814 | |
|---|---|---|
| 203 | 203 | /* the copy protection. */ |
| 204 | 204 | /* Anyway, what I do here is just immediately generate the NMI, so the game */ |
| 205 | 205 | /* properly starts. */ |
| 206 | cput | |
| 206 | machine.device("maincpu")->execute().set_input_line( | |
| 207 | 207 | |
| 208 | 208 | state->m_clock = 0; |
| 209 | 209 | } |
| r17813 | r17814 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | WRITE16_MEMBER(cabal_state::cabalbl_sound_irq_trigger_word_w) |
| 113 | 113 | { |
| 114 | | |
| 114 | | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r17813 | r17814 | |
| 468 | 468 | |
| 469 | 469 | static void irqhandler(device_t *device, int irq) |
| 470 | 470 | { |
| 471 | | |
| 471 | | |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | static const ym2151_interface cabalbl_ym2151_interface = |
| r17813 | r17814 | |
|---|---|---|
| 278 | 278 | |
| 279 | 279 | INPUT_CHANGED_MEMBER(cidelsa_state::ef_w) |
| 280 | 280 | { |
| 281 | | |
| 281 | | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | static INPUT_PORTS_START( destryer ) |
| r17813 | r17814 | |
|---|---|---|
| 1643 | 1643 | if (irq > 0) |
| 1644 | 1644 | { |
| 1645 | 1645 | scsp_last_line = irq; |
| 1646 | | |
| 1646 | | |
| 1647 | 1647 | } |
| 1648 | 1648 | else if (irq < 0) |
| 1649 | 1649 | { |
| 1650 | | |
| 1650 | | |
| 1651 | 1651 | } |
| 1652 | 1652 | else |
| 1653 | 1653 | { |
| 1654 | | |
| 1654 | | |
| 1655 | 1655 | } |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| r17813 | r17814 | |
| 2037 | 2037 | { |
| 2038 | 2038 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 2039 | 2039 | // don't let the slave cpu and the 68k go anywhere |
| 2040 | cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, ASSERT_LINE); | |
| 2041 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 2040 | machine.device("slave")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 2041 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 2042 | 2042 | |
| 2043 | 2043 | state->m_smpc.SR = 0x40; // this bit is always on according to docs |
| 2044 | 2044 | |
| r17813 | r17814 | |
| 2118 | 2118 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 2119 | 2119 | |
| 2120 | 2120 | // don't let the slave cpu and the 68k go anywhere |
| 2121 | cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, ASSERT_LINE); | |
| 2122 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); | |
| 2121 | machine.device("slave")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 2122 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 2123 | 2123 | |
| 2124 | 2124 | state->m_en_68k = 0; |
| 2125 | 2125 | state->m_NMI_reset = 0; |
| r17813 | r17814 | |
|---|---|---|
| 36 | 36 | static void update_interrupts(running_machine &machine) |
| 37 | 37 | { |
| 38 | 38 | atarigx2_state *state = machine.driver_data<atarigx2_state>(); |
| 39 | cputag_set_input_line(machine, "maincpu", 4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | cputag_set_input_line(machine, "maincpu", 5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | machine.device("maincpu")->execute().set_input_line(5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| r17813 | r17814 | |
| 123 | 123 | |
| 124 | 124 | /* lower byte */ |
| 125 | 125 | if (ACCESSING_BITS_16_23) |
| 126 | c | |
| 126 | machine().device("jsa")->execute().set_input_line( | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 |
| r17813 | r17814 | |
|---|---|---|
| 267 | 267 | |
| 268 | 268 | static void voodoo_vblank_0(device_t *device, int param) |
| 269 | 269 | { |
| 270 | | |
| 270 | | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
| r17813 | r17814 | |
| 358 | 358 | if (ACCESSING_BITS_0_7) |
| 359 | 359 | { |
| 360 | 360 | if (data & 0x80) // CG Board 1 IRQ Ack |
| 361 | cput | |
| 361 | machine().device("maincpu")->execute().set_input_line( | |
| 362 | 362 | if (data & 0x40) // CG Board 0 IRQ Ack |
| 363 | cput | |
| 363 | machine().device("maincpu")->execute().set_input_line( | |
| 364 | 364 | |
| 365 | 365 | //set_cgboard_id((data >> 4) & 3); |
| 366 | 366 | } |
| r17813 | r17814 | |
| 510 | 510 | |
| 511 | 511 | static TIMER_CALLBACK( irq_off ) |
| 512 | 512 | { |
| 513 | cput | |
| 513 | machine.device("audiocpu")->execute().set_input_line( | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | static MACHINE_START( nwktr ) |
| r17813 | r17814 | |
| 675 | 675 | nwktr_state *state = machine.driver_data<nwktr_state>(); |
| 676 | 676 | int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; |
| 677 | 677 | |
| 678 | cput | |
| 678 | machine.device("audiocpu")->execute().set_input_line( | |
| 679 | 679 | state->m_sound_irq_timer->adjust(attotime::from_usec(5), line); |
| 680 | 680 | } |
| 681 | 681 | |
| r17813 | r17814 | |
| 705 | 705 | |
| 706 | 706 | static MACHINE_RESET( nwktr ) |
| 707 | 707 | { |
| 708 | cput | |
| 708 | machine.device("dsp")->execute().set_input_line( | |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | static const voodoo_config voodoo_intf = |
| r17813 | r17814 | |
|---|---|---|
| 53 | 53 | READ8_MEMBER(circus_state::circus_paddle_r) |
| 54 | 54 | { |
| 55 | 55 | // also clears irq |
| 56 | cput | |
| 56 | machine().device("maincpu")->execute().set_input_line( | |
| 57 | 57 | return ioport("PADDLE")->read(); |
| 58 | 58 | } |
| 59 | 59 | |
| r17813 | r17814 | |
| 360 | 360 | int scanline = param; |
| 361 | 361 | |
| 362 | 362 | if(scanline == 256 || scanline == 0) // vblank-out / in irq |
| 363 | | |
| 363 | | |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | static MACHINE_CONFIG_START( crash, circus_state ) |
| r17813 | r17814 | |
|---|---|---|
| 84 | 84 | { |
| 85 | 85 | m_pending_command = 1; |
| 86 | 86 | soundlatch_byte_w(space, offset, data & 0xff); |
| 87 | | |
| 87 | | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, taotaido_state ) |
| r17813 | r17814 | |
| 321 | 321 | |
| 322 | 322 | static void irqhandler(device_t *device, int irq) |
| 323 | 323 | { |
| 324 | | |
| 324 | | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | static const ym2610_interface ym2610_config = |
| r17813 | r17814 | |
|---|---|---|
| 35 | 35 | static void update_interrupts(running_machine &machine) |
| 36 | 36 | { |
| 37 | 37 | relief_state *state = machine.driver_data<relief_state>(); |
| 38 | cput | |
| 38 | machine.device("maincpu")->execute().set_input_line( | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r17813 | r17814 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | WRITE32_MEMBER(taito_f3_state::f3_sound_reset_0_w) |
| 112 | 112 | { |
| 113 | | |
| 113 | | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | WRITE32_MEMBER(taito_f3_state::f3_sound_reset_1_w) |
| 117 | 117 | { |
| 118 | | |
| 118 | | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | WRITE32_MEMBER(taito_f3_state::f3_sound_bankswitch_w) |
| r17813 | r17814 | |
| 392 | 392 | |
| 393 | 393 | static TIMER_CALLBACK( f3_interrupt3 ) |
| 394 | 394 | { |
| 395 | cput | |
| 395 | machine.device("maincpu")->execute().set_input_line( | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | static INTERRUPT_GEN( f3_interrupt2 ) |
| r17813 | r17814 | |
| 404 | 404 | static SOUND_RESET( f3 ) |
| 405 | 405 | { |
| 406 | 406 | SOUND_RESET_CALL( taito_en_soundsystem_reset ); |
| 407 | cput | |
| 407 | machine.device("audiocpu")->execute().set_input_line( | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 |
| r17813 | r17814 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | static void tms_interrupt(running_machine &machine, int state) |
| 130 | 130 | { |
| 131 | cput | |
| 131 | machine.device("maincpu")->execute().set_input_line( | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | static const struct tms34061_interface tms34061intf = |
| r17813 | r17814 | |
| 547 | 547 | |
| 548 | 548 | WRITE_LINE_MEMBER(jpmsys5_state::ptm_irq) |
| 549 | 549 | { |
| 550 | cput | |
| 550 | machine().device("maincpu")->execute().set_input_line( | |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | WRITE8_MEMBER(jpmsys5_state::u26_o1_callback) |
| r17813 | r17814 | |
| 585 | 585 | |
| 586 | 586 | WRITE_LINE_MEMBER(jpmsys5_state::acia_irq) |
| 587 | 587 | { |
| 588 | cput | |
| 588 | machine().device("maincpu")->execute().set_input_line( | |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | /* Clocks are incorrect */ |
| r17813 | r17814 | |
|---|---|---|
| 17 | 17 | WRITE8_MEMBER(ssozumo_state::ssozumo_sh_command_w) |
| 18 | 18 | { |
| 19 | 19 | soundlatch_byte_w(space, 0, data); |
| 20 | | |
| 20 | | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| r17813 | r17814 | |
| 59 | 59 | |
| 60 | 60 | INPUT_CHANGED_MEMBER(ssozumo_state::coin_inserted) |
| 61 | 61 | { |
| 62 | cput | |
| 62 | machine().device("maincpu")->execute().set_input_line( | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static INPUT_PORTS_START( ssozumo ) |
| r17813 | r17814 | |
|---|---|---|
| 57 | 57 | if (scanline == state->m_raster_irq_position) |
| 58 | 58 | { |
| 59 | 59 | machine.primary_screen->update_partial(scanline); |
| 60 | cput | |
| 60 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /* VBLANK interrupt */ |
| 64 | 64 | else if (scanline == machine.primary_screen->visible_area().max_y + 1) |
| 65 | 65 | { |
| 66 | 66 | machine.primary_screen->update_partial(scanline); |
| 67 | cput | |
| 67 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| r17813 | r17814 | |
| 91 | 91 | |
| 92 | 92 | WRITE16_MEMBER(m107_state::m107_soundlatch_w) |
| 93 | 93 | { |
| 94 | | |
| 94 | | |
| 95 | 95 | soundlatch_byte_w(space, 0, data & 0xff); |
| 96 | 96 | // logerror("soundlatch_byte_w %02x\n",data); |
| 97 | 97 | } |
| r17813 | r17814 | |
| 103 | 103 | |
| 104 | 104 | READ16_MEMBER(m107_state::m107_soundlatch_r) |
| 105 | 105 | { |
| 106 | | |
| 106 | | |
| 107 | 107 | return soundlatch_byte_r(space, offset) | 0xff00; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE16_MEMBER(m107_state::m107_sound_irq_ack_w) |
| 111 | 111 | { |
| 112 | | |
| 112 | | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | WRITE16_MEMBER(m107_state::m107_sound_status_w) |
| 116 | 116 | { |
| 117 | 117 | COMBINE_DATA(&m_sound_status); |
| 118 | cput | |
| 118 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | WRITE16_MEMBER(m107_state::m107_sound_reset_w) |
| 122 | 122 | { |
| 123 | | |
| 123 | | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /*****************************************************************************/ |
| r17813 | r17814 | |
| 756 | 756 | |
| 757 | 757 | static void sound_irq(device_t *device, int state) |
| 758 | 758 | { |
| 759 | | |
| 759 | | |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | 762 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 122 | 122 | if (m_CPUA_register != old) |
| 123 | 123 | { |
| 124 | 124 | if ((old & 0x08) == 0 && (m_CPUA_register & 0x08)) |
| 125 | cput | |
| 125 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 126 | 126 | |
| 127 | 127 | if ((old & 0x40) && (m_CPUA_register & 0x40) == 0) |
| 128 | 128 | twin16_spriteram_process(machine()); |
| 129 | 129 | |
| 130 | 130 | if ((old & 0x10) == 0 && (m_CPUA_register & 0x10)) |
| 131 | c | |
| 131 | machine().device("sub")->execute().set_input_line( | |
| 132 | 132 | |
| 133 | 133 | coin_counter_w(machine(), 0, m_CPUA_register & 0x01); |
| 134 | 134 | coin_counter_w(machine(), 1, m_CPUA_register & 0x02); |
| r17813 | r17814 | |
| 149 | 149 | if( m_CPUB_register!=old ) |
| 150 | 150 | { |
| 151 | 151 | if ((old & 0x01) == 0 && (m_CPUB_register & 0x01)) |
| 152 | cput | |
| 152 | machine().device("maincpu")->execute().set_input_line( | |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| r17813 | r17814 | |
| 165 | 165 | if (m_CPUA_register != old) |
| 166 | 166 | { |
| 167 | 167 | if ((old & 0x08) == 0 && (m_CPUA_register & 0x08)) |
| 168 | cput | |
| 168 | machine().device("audiocpu")->execute().set_input_line_and_vector( | |
| 169 | 169 | |
| 170 | 170 | coin_counter_w(machine(), 0, m_CPUA_register & 0x01); |
| 171 | 171 | coin_counter_w(machine(), 1, m_CPUA_register & 0x02); |
| r17813 | r17814 | |
|---|---|---|
| 162 | 162 | int scanline = param; |
| 163 | 163 | |
| 164 | 164 | if(scanline == 240) // vblank-out irq |
| 165 | | |
| 165 | | |
| 166 | 166 | |
| 167 | 167 | if(scanline == 0) |
| 168 | | |
| 168 | | |
| 169 | 169 | |
| 170 | 170 | if(scanline == 128) |
| 171 | | |
| 171 | | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | static ADDRESS_MAP_START( megasys1A_map, AS_PROGRAM, 16, megasys1_state ) |
| r17813 | r17814 | |
| 198 | 198 | int scanline = param; |
| 199 | 199 | |
| 200 | 200 | if(scanline == 240) // vblank-out irq |
| 201 | | |
| 201 | | |
| 202 | 202 | |
| 203 | 203 | if(scanline == 0) |
| 204 | | |
| 204 | | |
| 205 | 205 | |
| 206 | 206 | if(scanline == 128) |
| 207 | | |
| 207 | | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
| r17813 | r17814 | |
| 249 | 249 | WRITE16_MEMBER(megasys1_state::ip_select_w) |
| 250 | 250 | { |
| 251 | 251 | COMBINE_DATA(&m_ip_select); |
| 252 | cput | |
| 252 | machine().device("maincpu")->execute().set_input_line( | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| r17813 | r17814 | |
| 376 | 376 | static void megasys1_sound_irq(device_t *device, int irq) |
| 377 | 377 | { |
| 378 | 378 | if (irq) |
| 379 | | |
| 379 | | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | READ8_MEMBER(megasys1_state::oki_status_1_r) |
| r17813 | r17814 | |
| 1398 | 1398 | } |
| 1399 | 1399 | } |
| 1400 | 1400 | |
| 1401 | cput | |
| 1401 | machine().device("maincpu")->execute().set_input_line( | |
| 1402 | 1402 | } |
| 1403 | 1403 | |
| 1404 | 1404 | /************************************* |
| r17813 | r17814 | |
| 1647 | 1647 | |
| 1648 | 1648 | static void irq_handler(device_t *device, int irq) |
| 1649 | 1649 | { |
| 1650 | | |
| 1650 | | |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 |
| r17813 | r17814 | |
|---|---|---|
| 553 | 553 | int scanline = param; |
| 554 | 554 | |
| 555 | 555 | if(scanline == 240) // vblank-out irq |
| 556 | c | |
| 556 | timer.machine().device("master")->execute().set_input_line_and_vector( | |
| 557 | 557 | |
| 558 | 558 | /* Pandora "sprite end dma" irq? TODO: timing is likely off */ |
| 559 | 559 | if(scanline == 64) |
| 560 | c | |
| 560 | timer.machine().device("master")->execute().set_input_line_and_vector( | |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | /* Sub Z80 uses IM2 too, but 0xff irq routine just contains an irq ack in it */ |
| r17813 | r17814 | |
|---|---|---|
| 3933 | 3933 | |
| 3934 | 3934 | static void sound_irq(device_t *device, int state) |
| 3935 | 3935 | { |
| 3936 | // cput | |
| 3936 | // machine.device("maincpu")->execute().set_input_line( | |
| 3937 | 3937 | } |
| 3938 | 3938 | |
| 3939 | 3939 | static MACHINE_CONFIG_DERIVED( vbowl, igs011_base ) |
| r17813 | r17814 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | INPUT_CHANGED_MEMBER(bwing_state::coin_inserted) |
| 195 | 195 | { |
| 196 | cput | |
| 196 | machine().device("maincpu")->execute().set_input_line( | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | INPUT_CHANGED_MEMBER(bwing_state::tilt_pressed) |
| 200 | 200 | { |
| 201 | cput | |
| 201 | machine().device("maincpu")->execute().set_input_line( | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | static INPUT_PORTS_START( bwing ) |
| r17813 | r17814 | |
|---|---|---|
| 541 | 541 | |
| 542 | 542 | READ16_MEMBER(srmp6_state::srmp6_irq_ack_r) |
| 543 | 543 | { |
| 544 | cput | |
| 544 | machine().device("maincpu")->execute().set_input_line( | |
| 545 | 545 | return 0; // value read doesn't matter |
| 546 | 546 | } |
| 547 | 547 |
| r17813 | r17814 | |
|---|---|---|
| 370 | 370 | if (data & 0x800000) |
| 371 | 371 | { |
| 372 | 372 | // mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", device().tag(), space.device().safe_pc()); |
| 373 | c | |
| 373 | machine().device("sub")->execute().set_input_line( | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | m_unk20004 = (UINT32)(data); |
| r17813 | r17814 | |
| 464 | 464 | { |
| 465 | 465 | if (data & U64(0x100000000)) |
| 466 | 466 | { |
| 467 | cput | |
| 467 | machine().device("maincpu")->execute().set_input_line( | |
| 468 | 468 | m_unk3 = 0; |
| 469 | 469 | } |
| 470 | 470 | } |
| r17813 | r17814 | |
|---|---|---|
| 1829 | 1829 | |
| 1830 | 1830 | static void irqhandler(device_t *device, int irq) |
| 1831 | 1831 | { |
| 1832 | | |
| 1832 | | |
| 1833 | 1833 | } |
| 1834 | 1834 | |
| 1835 | 1835 | static const ym2151_interface ym2151_config = |
| r17813 | r17814 | |
|---|---|---|
| 162 | 162 | |
| 163 | 163 | WRITE_LINE_MEMBER(slotcarn_state::vsync_changed) |
| 164 | 164 | { |
| 165 | cput | |
| 165 | machine().device("maincpu")->execute().set_input_line( | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | static const mc6845_interface mc6845_intf = |
| r17813 | r17814 | |
|---|---|---|
| 70 | 70 | WRITE8_MEMBER(tbowl_state::tbowl_sound_command_w) |
| 71 | 71 | { |
| 72 | 72 | soundlatch_byte_w(space, offset, data); |
| 73 | | |
| 73 | | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| r17813 | r17814 | |
| 123 | 123 | WRITE8_MEMBER(tbowl_state::tbowl_trigger_nmi) |
| 124 | 124 | { |
| 125 | 125 | /* trigger NMI on 6206B's Cpu? (guess but seems to work..) */ |
| 126 | cput | |
| 126 | machine().device("maincpu")->execute().set_input_line( | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | static ADDRESS_MAP_START( 6206C_map, AS_PROGRAM, 8, tbowl_state ) |
| r17813 | r17814 | |
| 421 | 421 | |
| 422 | 422 | static void irqhandler(device_t *device, int linestate) |
| 423 | 423 | { |
| 424 | | |
| 424 | | |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | static const ym3812_interface ym3812_config = |
| r17813 | r17814 | |
|---|---|---|
| 50 | 50 | static void update_interrupts(running_machine &machine) |
| 51 | 51 | { |
| 52 | 52 | atarigt_state *state = machine.driver_data<atarigt_state>(); |
| 53 | cputag_set_input_line(machine, "maincpu", 3, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 54 | cputag_set_input_line(machine, "maincpu", 4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 55 | cputag_set_input_line(machine, "maincpu", 6, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 53 | machine.device("maincpu")->execute().set_input_line(3, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 54 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 55 | machine.device("maincpu")->execute().set_input_line(6, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 |
| r17813 | r17814 | |
|---|---|---|
| 560 | 560 | static TIMER_CALLBACK( rabbit_blit_done ) |
| 561 | 561 | { |
| 562 | 562 | rabbit_state *state = machine.driver_data<rabbit_state>(); |
| 563 | cput | |
| 563 | machine.device("maincpu")->execute().set_input_line( | |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | static void rabbit_do_blit(running_machine &machine) |
| r17813 | r17814 | |
| 872 | 872 | static INTERRUPT_GEN( rabbit_vblank_interrupt ) |
| 873 | 873 | { |
| 874 | 874 | rabbit_state *state = device->machine().driver_data<rabbit_state>(); |
| 875 | | |
| 875 | | |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | static MACHINE_CONFIG_START( rabbit, rabbit_state ) |
| r17813 | r17814 | |
|---|---|---|
| 771 | 771 | |
| 772 | 772 | static void irq_handler(device_t *device, int irq) |
| 773 | 773 | { |
| 774 | | |
| 774 | | |
| 775 | 775 | } |
| 776 | 776 | |
| 777 | 777 | static const ym2610_interface ym2610_config = |
| r17813 | r17814 | |
|---|---|---|
| 28 | 28 | triplhnt_state *state = machine.driver_data<triplhnt_state>(); |
| 29 | 29 | state->m_hit_code = code; |
| 30 | 30 | |
| 31 | cput | |
| 31 | machine.device("maincpu")->execute().set_input_line( | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 |
| r17813 | r17814 | |
|---|---|---|
| 234 | 234 | |
| 235 | 235 | WRITE_LINE_MEMBER(rollerg_state::rollerg_irq_ack_w) |
| 236 | 236 | { |
| 237 | cput | |
| 237 | machine().device("maincpu")->execute().set_input_line( | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | static const k053252_interface rollerg_k053252_intf = |
| r17813 | r17814 | |
|---|---|---|
| 13 | 13 | { |
| 14 | 14 | int scanline = param; |
| 15 | 15 | |
| 16 | cput | |
| 16 | machine.device("maincpu")->execute().set_input_line( | |
| 17 | 17 | |
| 18 | 18 | scanline += 64; |
| 19 | 19 |
| r17813 | r17814 | |
|---|---|---|
| 139 | 139 | WRITE8_MEMBER(tankbatt_state::tankbatt_irq_ack_w) |
| 140 | 140 | { |
| 141 | 141 | /* 0x6e written at the end of the irq routine, could be either irq ack or a coin sample */ |
| 142 | cput | |
| 142 | machine().device("maincpu")->execute().set_input_line( | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | WRITE8_MEMBER(tankbatt_state::tankbatt_coin_counter_w) |
| r17813 | r17814 | |
| 187 | 187 | |
| 188 | 188 | INPUT_CHANGED_MEMBER(tankbatt_state::coin_inserted) |
| 189 | 189 | { |
| 190 | cput | |
| 190 | machine().device("maincpu")->execute().set_input_line( | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | static INPUT_PORTS_START( tankbatt ) |
| r17813 | r17814 | |
|---|---|---|
| 762 | 762 | WRITE8_MEMBER(royalmah_state::jansou_sound_w) |
| 763 | 763 | { |
| 764 | 764 | soundlatch_byte_w(space, 0, data); |
| 765 | | |
| 765 | | |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 |
| r17813 | r17814 | |
|---|---|---|
| 218 | 218 | int scanline = param; |
| 219 | 219 | |
| 220 | 220 | if(scanline == 240) // vblank-out irq |
| 221 | cput | |
| 221 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 222 | 222 | |
| 223 | 223 | if(scanline == 0) // vblank-in irq |
| 224 | cput | |
| 224 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 |
| r17813 | r17814 | |
|---|---|---|
| 206 | 206 | if (ACCESSING_BITS_0_7) |
| 207 | 207 | { |
| 208 | 208 | soundlatch_byte_w(space, 0, data & 0xff); |
| 209 | | |
| 209 | | |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
| r17813 | r17814 | |
| 264 | 264 | { |
| 265 | 265 | /* PCB behaviour verified by Corrado Tomaselli at MAME Italia Forum: |
| 266 | 266 | every time music changes Z80 is resetted */ |
| 267 | | |
| 267 | | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | WRITE16_MEMBER(nmk16_state::macross2_sound_command_w) |
| r17813 | r17814 | |
| 303 | 303 | if (ACCESSING_BITS_0_7) |
| 304 | 304 | { |
| 305 | 305 | soundlatch_byte_w(space, 0, data&0xff); |
| 306 | | |
| 306 | | |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | |
| r17813 | r17814 | |
| 3499 | 3499 | |
| 3500 | 3500 | static void ym2203_irqhandler(device_t *device, int irq) |
| 3501 | 3501 | { |
| 3502 | | |
| 3502 | | |
| 3503 | 3503 | } |
| 3504 | 3504 | |
| 3505 | 3505 | static const ym2203_interface ym2203_config = |
| r17813 | r17814 | |
| 3517 | 3517 | int scanline = param; |
| 3518 | 3518 | |
| 3519 | 3519 | if(scanline == 240) // vblank-out irq |
| 3520 | | |
| 3520 | | |
| 3521 | 3521 | |
| 3522 | 3522 | /* This is either vblank-in or sprite dma irq complete, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous |
| 3523 | 3523 | cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */ |
| 3524 | 3524 | if(scanline == 0) |
| 3525 | | |
| 3525 | | |
| 3526 | 3526 | } |
| 3527 | 3527 | |
| 3528 | 3528 | /* bee-oh board, almost certainly it has different timings */ |
| r17813 | r17814 | |
| 3531 | 3531 | int scanline = param; |
| 3532 | 3532 | |
| 3533 | 3533 | if(scanline == 248) // vblank-out irq |
| 3534 | | |
| 3534 | | |
| 3535 | 3535 | |
| 3536 | 3536 | /* This is either vblank-in or sprite dma irq complete */ |
| 3537 | 3537 | if(scanline == 0) |
| 3538 | | |
| 3538 | | |
| 3539 | 3539 | } |
| 3540 | 3540 | |
| 3541 | 3541 | |
| r17813 | r17814 | |
| 4801 | 4801 | |
| 4802 | 4802 | static void irq_handler(device_t *device, int irq) |
| 4803 | 4803 | { |
| 4804 | | |
| 4804 | | |
| 4805 | 4805 | } |
| 4806 | 4806 | |
| 4807 | 4807 | static const ym2151_interface afega_ym2151_intf = |
| r17813 | r17814 | |
|---|---|---|
| 61 | 61 | if( ( n_irqdata & n_irqmask ) != 0 ) |
| 62 | 62 | { |
| 63 | 63 | verboselog( machine(), 2, "psx irq assert\n" ); |
| 64 | cput | |
| 64 | machine().device("maincpu")->execute().set_input_line( | |
| 65 | 65 | } |
| 66 | 66 | else |
| 67 | 67 | { |
| 68 | 68 | verboselog( machine(), 2, "psx irq clear\n" ); |
| 69 | cput | |
| 69 | machine().device("maincpu")->execute().set_input_line( | |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 |
| r17813 | r17814 | |
|---|---|---|
| 292 | 292 | #define CPU_EXPORT_STRING_CALL(name) CPU_EXPORT_STRING_NAME(name)(device, entry, string) |
| 293 | 293 | |
| 294 | 294 | |
| 295 | // helpers for using machine/cputag instead of cpu objects | |
| 296 | #define cputag_set_input_line(mach, tag, line, state) device_execute((mach).device(tag))->set_input_line(line, state) | |
| 297 | #define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach).device(tag))->set_input_line_and_vector(line, state, vec) | |
| 298 | ||
| 299 | ||
| 300 | 295 | // this template function creates a stub which constructs a device |
| 301 | 296 | template<class _DeviceClass> |
| 302 | 297 | device_t *legacy_device_creator(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| r17813 | r17814 | |
|---|---|---|
| 1191 | 1191 | if (s3c24xx->irq.line_irq != ASSERT_LINE) |
| 1192 | 1192 | { |
| 1193 | 1193 | verboselog( device->machine(), 5, "ARM7_IRQ_LINE -> ASSERT_LINE\n"); |
| 1194 | | |
| 1194 | | |
| 1195 | 1195 | s3c24xx->irq.line_irq = ASSERT_LINE; |
| 1196 | 1196 | } |
| 1197 | 1197 | } |
| r17813 | r17814 | |
| 1201 | 1201 | { |
| 1202 | 1202 | verboselog( device->machine(), 5, "srcpnd %08X intmsk %08X intmod %08X\n", s3c24xx->irq.regs.srcpnd, s3c24xx->irq.regs.intmsk, s3c24xx->irq.regs.intmod); |
| 1203 | 1203 | verboselog( device->machine(), 5, "ARM7_IRQ_LINE -> CLEAR_LINE\n"); |
| 1204 | | |
| 1204 | | |
| 1205 | 1205 | s3c24xx->irq.line_irq = CLEAR_LINE; |
| 1206 | 1206 | } |
| 1207 | 1207 | } |
| r17813 | r17814 | |
| 1220 | 1220 | if (s3c24xx->irq.line_fiq != ASSERT_LINE) |
| 1221 | 1221 | { |
| 1222 | 1222 | verboselog( device->machine(), 5, "ARM7_FIRQ_LINE -> ASSERT_LINE\n"); |
| 1223 | | |
| 1223 | | |
| 1224 | 1224 | s3c24xx->irq.line_fiq = ASSERT_LINE; |
| 1225 | 1225 | } |
| 1226 | 1226 | } |
| r17813 | r17814 | |
| 1229 | 1229 | if (s3c24xx->irq.line_fiq != CLEAR_LINE) |
| 1230 | 1230 | { |
| 1231 | 1231 | verboselog( device->machine(), 5, "ARM7_FIRQ_LINE -> CLEAR_LINE\n"); |
| 1232 | | |
| 1232 | | |
| 1233 | 1233 | s3c24xx->irq.line_fiq = CLEAR_LINE; |
| 1234 | 1234 | } |
| 1235 | 1235 | } |
| r17813 | r17814 | |
|---|---|---|
| 698 | 698 | HALT_DMA = CLEAR_LINE; |
| 699 | 699 | |
| 700 | 700 | LOG_HALT(("DMA_CPU HALT=%d\n", HALT_DMA)); |
| 701 | | |
| 701 | | |
| 702 | 702 | |
| 703 | 703 | /* CPU un-halted let it run ! */ |
| 704 | 704 | if (HALT_DMA == CLEAR_LINE) |
| r17813 | r17814 | |
| 735 | 735 | HALT_CPU = ASSERT_LINE; |
| 736 | 736 | |
| 737 | 737 | LOG_HALT(("MAIN_CPU HALT=%d\n", HALT_CPU)); |
| 738 | | |
| 738 | | |
| 739 | 739 | |
| 740 | 740 | state->m_d_pia1_pb_last = data & 0x02; |
| 741 | 741 | |
| r17813 | r17814 | |
| 787 | 787 | LOG_INTS(("cpu1 NMI : %d\n", NMI)); |
| 788 | 788 | if(!NMI) |
| 789 | 789 | { |
| 790 | | |
| 790 | | |
| 791 | 791 | logerror("device_yield()\n"); |
| 792 | 792 | device_yield(device->machine().device(DMACPU_TAG)); /* Let DMA CPU run */ |
| 793 | 793 | } |
| 794 | 794 | else |
| 795 | 795 | { |
| 796 | | |
| 796 | | |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | 799 | state->m_DMA_NMI_LAST = NMI; /* Save it for next time */ |
| r17813 | r17814 | |
| 875 | 875 | else |
| 876 | 876 | IRQ = CLEAR_LINE; |
| 877 | 877 | |
| 878 | | |
| 878 | | |
| 879 | 879 | LOG_INTS(("cpu0 IRQ : %d\n", IRQ)); |
| 880 | 880 | } |
| 881 | 881 | |
| r17813 | r17814 | |
| 890 | 890 | else |
| 891 | 891 | FIRQ = CLEAR_LINE; |
| 892 | 892 | |
| 893 | | |
| 893 | | |
| 894 | 894 | |
| 895 | 895 | LOG_INTS(("cpu0 FIRQ : %d\n", FIRQ)); |
| 896 | 896 | } |
| r17813 | r17814 | |
| 899 | 899 | |
| 900 | 900 | static void cpu1_recalc_firq(running_machine &machine, int state) |
| 901 | 901 | { |
| 902 | c | |
| 902 | machine.device(DMACPU_TAG)->execute().set_input_line( | |
| 903 | 903 | LOG_INTS(("cpu1 FIRQ : %d\n",state)); |
| 904 | 904 | } |
| 905 | 905 | |
| r17813 | r17814 | |
| 1066 | 1066 | state->m_system_rom = state->memregion(MAINCPU_TAG)->base(); |
| 1067 | 1067 | |
| 1068 | 1068 | /* Make sure CPU 1 is started out halted ! */ |
| 1069 | c | |
| 1069 | machine.device(DMACPU_TAG)->execute().set_input_line( | |
| 1070 | 1070 | |
| 1071 | 1071 | /* Reset to task 0, and map banks disabled, so standard memory map */ |
| 1072 | 1072 | /* with ram at $0000-$BFFF, ROM at $C000-FBFF, IO at $FC00-$FEFF */ |
| r17813 | r17814 | |
|---|---|---|
| 499 | 499 | apple3_state *drvstate = device->machine().driver_data<apple3_state>(); |
| 500 | 500 | if (!drvstate->m_via_1_irq && state) |
| 501 | 501 | { |
| 502 | cputag_set_input_line(device->machine(), "maincpu", M6502_IRQ_LINE, ASSERT_LINE); | |
| 503 | cputag_set_input_line(device->machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE); | |
| 502 | device->machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 503 | device->machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); | |
| 504 | 504 | } |
| 505 | 505 | drvstate->m_via_1_irq = state; |
| 506 | 506 | } |
| r17813 | r17814 | |
|---|---|---|
| 62 | 62 | static TMS5501_IRQ_CALLBACK(dai_interrupt_callback) |
| 63 | 63 | { |
| 64 | 64 | if (intreq) |
| 65 | cput | |
| 65 | device.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 66 | 66 | else |
| 67 | | |
| 67 | | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | TMS5501_INTERFACE( dai_tms5501_interface ) |
| r17813 | r17814 | |
|---|---|---|
| 242 | 242 | if (state != driver_state->m_old_level) |
| 243 | 243 | { |
| 244 | 244 | DBG_LOG(device->machine(), 3, "mos6509", ("irq %s\n", state ? "start" : "end")); |
| 245 | | |
| 245 | | |
| 246 | 246 | driver_state->m_old_level = state; |
| 247 | 247 | } |
| 248 | 248 | } |
| r17813 | r17814 | |
|---|---|---|
| 155 | 155 | { |
| 156 | 156 | //logerror("Triggering IRQ with vector %02x\n", vector ); |
| 157 | 157 | /* Trigger interrupt and set vector */ |
| 158 | cput | |
| 158 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 159 | 159 | } |
| 160 | 160 | else |
| 161 | 161 | { |
| 162 | cput | |
| 162 | machine.device("maincpu")->execute().set_input_line( | |
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 |
| r17813 | r17814 | |
|---|---|---|
| 53 | 53 | { |
| 54 | 54 | x1_state *state = machine().driver_data<x1_state>(); |
| 55 | 55 | state->m_key_irq_flag = 0; |
| 56 | | |
| 56 | | |
| 57 | 57 | return state->m_key_irq_vector; |
| 58 | 58 | } |
| 59 | 59 |
| r17813 | r17814 | |
|---|---|---|
| 10 | 10 | UINT8 * RAM = machine.root_device().memregion("maincpu")->base(); |
| 11 | 11 | UINT8 val = ( ( RAM[SM8521_CLKT] & 0x3F ) + 1 ) & 0x3F; |
| 12 | 12 | RAM[SM8521_CLKT] = ( RAM[SM8521_CLKT] & 0xC0 ) | val; |
| 13 | cput | |
| 13 | machine.device("maincpu")->execute().set_input_line( | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | MACHINE_RESET( gamecom ) |
| r17813 | r17814 | |
| 498 | 498 | state->m_dma.dest_current = state->m_dma.dest_line; |
| 499 | 499 | } |
| 500 | 500 | state->m_dma.enabled = 0; |
| 501 | | |
| 501 | | |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | void gamecom_update_timers( device_t *device, int cycles ) |
| r17813 | r17814 | |
| 515 | 515 | if ( RAM[SM8521_TM0D] >= state->m_timer[0].check_value ) |
| 516 | 516 | { |
| 517 | 517 | RAM[SM8521_TM0D] = 0; |
| 518 | | |
| 518 | | |
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 | } |
| r17813 | r17814 | |
| 529 | 529 | if ( RAM[SM8521_TM1D] >= state->m_timer[1].check_value ) |
| 530 | 530 | { |
| 531 | 531 | RAM[SM8521_TM1D] = 0; |
| 532 | | |
| 532 | | |
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | } |
| r17813 | r17814 | |
|---|---|---|
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | cput | |
| 188 | machine().device("maincpu")->execute().set_input_line( | |
| 189 | 189 | } |
| 190 | 190 | break; |
| 191 | 191 | } |
| r17813 | r17814 | |
|---|---|---|
| 435 | 435 | { |
| 436 | 436 | state->m_reset_flag = 1; |
| 437 | 437 | /* using PULSE_LINE does not allow us to press and hold key */ |
| 438 | cput | |
| 438 | machine.device("maincpu")->execute().set_input_line( | |
| 439 | 439 | } |
| 440 | 440 | return; |
| 441 | 441 | } |
| 442 | 442 | if (state->m_reset_flag) |
| 443 | 443 | { |
| 444 | 444 | state->m_reset_flag = 0; |
| 445 | cput | |
| 445 | machine.device("maincpu")->execute().set_input_line( | |
| 446 | 446 | machine.schedule_soft_reset(); |
| 447 | 447 | } |
| 448 | 448 |
| r17813 | r17814 | |
|---|---|---|
| 302 | 302 | if ( state->m_ula.interrupt_status & state->m_ula.interrupt_control & ~0x83 ) |
| 303 | 303 | { |
| 304 | 304 | state->m_ula.interrupt_status |= 0x01; |
| 305 | cput | |
| 305 | machine.device("maincpu")->execute().set_input_line( | |
| 306 | 306 | } |
| 307 | 307 | else |
| 308 | 308 | { |
| 309 | 309 | state->m_ula.interrupt_status &= ~0x01; |
| 310 | cput | |
| 310 | machine.device("maincpu")->execute().set_input_line( | |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 |
| r17813 | r17814 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | static WRITE_LINE_DEVICE_HANDLER( irisha_pic_set_int_line ) |
| 123 | 123 | { |
| 124 | | |
| 124 | | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | const struct pic8259_interface irisha_pic8259_config = |
| r17813 | r17814 | |
|---|---|---|
| 150 | 150 | /* The 6502 IRQ line is active low and probably driven |
| 151 | 151 | by open collector outputs (guess). Since MAME/MESS use |
| 152 | 152 | a non-0 value for ASSERT_LINE we OR the signals here */ |
| 153 | cput | |
| 153 | machine.device("maincpu")->execute().set_input_line( | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | static cassette_image_device *cassette_device_image(running_machine &machine) |
| r17813 | r17814 | |
| 384 | 384 | /* This callback is called one clock cycle after BFF2 is written (delayed nmi) */ |
| 385 | 385 | static TIMER_CALLBACK(microtan_pulse_nmi) |
| 386 | 386 | { |
| 387 | cput | |
| 387 | machine.device("maincpu")->execute().set_input_line( | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | WRITE8_MEMBER(microtan_state::microtan_bffx_w) |
| r17813 | r17814 | |
|---|---|---|
| 86 | 86 | /* Take NMI only if RNMI ok*/ |
| 87 | 87 | if ((state->m_hector_disc2_RNMI==1) && (state->m_NMI_current_state==1)) |
| 88 | 88 | { |
| 89 | cput | |
| 89 | machine.device("disc2cpu")->execute().set_input_line( | |
| 90 | 90 | state->m_DMA_timer->adjust(attotime::from_usec(6) );//a little time to let the Z80 terminate he's previous job ! |
| 91 | 91 | state->m_NMI_current_state=0; |
| 92 | 92 | } |
| r17813 | r17814 | |
| 103 | 103 | { |
| 104 | 104 | hec2hrp_state *state = machine.driver_data<hec2hrp_state>(); |
| 105 | 105 | /* To generate the NMI signal (late) when uPD DMA request*/ |
| 106 | cput | |
| 106 | machine.device("disc2cpu")->execute().set_input_line( | |
| 107 | 107 | state->m_hector_nb_cde =0; // clear the cde length |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static TIMER_CALLBACK( Callback_INT_irq ) |
| 111 | 111 | { |
| 112 | 112 | /* To generate the INT signal (late) when uPD DMA request*/ |
| 113 | | |
| 113 | | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /* upd765 INT is connected to interrupt of Z80 within a RNMI hardware authorization*/ |
| 117 | 117 | static WRITE_LINE_DEVICE_HANDLER( disc2_fdc_interrupt ) |
| 118 | 118 | { |
| 119 | 119 | hec2hrp_state *drvstate = device->machine().driver_data<hec2hrp_state>(); |
| 120 | | |
| 120 | | |
| 121 | 121 | if (state) |
| 122 | 122 | drvstate->m_INT_timer->adjust(attotime::from_usec(500) );//a little time to let the Z80 terminate he's previous job ! |
| 123 | 123 | } |
| r17813 | r17814 | |
| 144 | 144 | { |
| 145 | 145 | hec2hrp_state *state = machine.driver_data<hec2hrp_state>(); |
| 146 | 146 | // Initialization Disc2 unit |
| 147 | cput | |
| 147 | machine.device("disc2cpu" )->execute().set_input_line( | |
| 148 | 148 | //switch ON and OFF the reset line uPD |
| 149 | 149 | upd765_reset_w(machine.device("upd765"), 1); |
| 150 | 150 | upd765_reset_w(machine.device("upd765"), 0); |
| r17813 | r17814 | |
|---|---|---|
| 119 | 119 | } |
| 120 | 120 | if (key_code==0 && state->m_last_code !=0){ |
| 121 | 121 | state->m_int_vector = 0xef; |
| 122 | cput | |
| 122 | machine.device("maincpu")->execute().set_input_line( | |
| 123 | 123 | } else { |
| 124 | 124 | state->m_last_code = key_code; |
| 125 | 125 | } |
| r17813 | r17814 | |
| 247 | 247 | READ8_MEMBER(poly88_state::poly88_keyboard_r) |
| 248 | 248 | { |
| 249 | 249 | UINT8 retVal = m_last_code; |
| 250 | cput | |
| 250 | machine().device("maincpu")->execute().set_input_line( | |
| 251 | 251 | m_last_code = 0x00; |
| 252 | 252 | return retVal; |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | WRITE8_MEMBER(poly88_state::poly88_intr_w) |
| 256 | 256 | { |
| 257 | cput | |
| 257 | machine().device("maincpu")->execute().set_input_line( | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | SNAPSHOT_LOAD( poly88 ) |
| r17813 | r17814 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | state->m_cassette_data = 0; |
| 40 | 40 | state->m_irq |= CASS_FALL; |
| 41 | cput | |
| 41 | machine.device("maincpu")->execute().set_input_line( | |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | else |
| r17813 | r17814 | |
| 48 | 48 | { |
| 49 | 49 | state->m_cassette_data = 1; |
| 50 | 50 | state->m_irq |= CASS_RISE; |
| 51 | cput | |
| 51 | machine.device("maincpu")->execute().set_input_line( | |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| r17813 | r17814 | |
| 79 | 79 | d1 Cass 1500 baud Falling |
| 80 | 80 | d0 Cass 1500 baud Rising */ |
| 81 | 81 | |
| 82 | cput | |
| 82 | machine().device("maincpu")->execute().set_input_line( | |
| 83 | 83 | return ~(m_mask & m_irq); |
| 84 | 84 | } |
| 85 | 85 | |
| r17813 | r17814 | |
| 95 | 95 | d6 status of Motor Timeout (0=true) |
| 96 | 96 | d5 status of Reset signal (0=true - this will reboot the computer) */ |
| 97 | 97 | |
| 98 | cput | |
| 98 | machine().device("maincpu")->execute().set_input_line( | |
| 99 | 99 | |
| 100 | 100 | return ~(m_nmi_mask & m_nmi_data); |
| 101 | 101 | } |
| r17813 | r17814 | |
| 654 | 654 | if (state->m_nmi_mask & 0x80) // Model 4 does a NMI |
| 655 | 655 | { |
| 656 | 656 | state->m_nmi_data = 0x80; |
| 657 | cput | |
| 657 | machine.device("maincpu")->execute().set_input_line( | |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | else // Model 1 does a IRQ |
| 661 | 661 | { |
| 662 | 662 | state->m_irq |= IRQ_M1_FDC; |
| 663 | cput | |
| 663 | machine.device("maincpu")->execute().set_input_line( | |
| 664 | 664 | } |
| 665 | 665 | } |
| 666 | 666 | |
| r17813 | r17814 | |
| 752 | 752 | which is dealt with by the DOS. We take the opportunity to reset the cpu INT line. */ |
| 753 | 753 | |
| 754 | 754 | int result = m_irq; |
| 755 | cput | |
| 755 | machine().device("maincpu")->execute().set_input_line( | |
| 756 | 756 | m_irq = 0; |
| 757 | 757 | return result; |
| 758 | 758 | } |
| r17813 | r17814 | |
|---|---|---|
| 39 | 39 | svi318_state *drvstate = device->machine().driver_data<svi318_state>(); |
| 40 | 40 | if (drvstate->m_svi.bankLow != SVI_CART) |
| 41 | 41 | { |
| 42 | | |
| 42 | | |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | #if 0 |
| r17813 | r17814 | |
| 408 | 408 | |
| 409 | 409 | void svi318_vdp_interrupt(running_machine &machine, int i) |
| 410 | 410 | { |
| 411 | cput | |
| 411 | machine.device("maincpu")->execute().set_input_line( | |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 |
| r17813 | r17814 | |
|---|---|---|
| 87 | 87 | { |
| 88 | 88 | wswan_state *state = machine.driver_data<wswan_state>(); |
| 89 | 89 | if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_HBLTMR ) { |
| 90 | cput | |
| 90 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 91 | 91 | } else if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_VBL ) { |
| 92 | cput | |
| 92 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 93 | 93 | } else if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_VBLTMR ) { |
| 94 | cput | |
| 94 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 95 | 95 | } else if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_LCMP ) { |
| 96 | cput | |
| 96 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 97 | 97 | } else if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_SRX ) { |
| 98 | cput | |
| 98 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 99 | 99 | } else if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_RTC ) { |
| 100 | cput | |
| 100 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 101 | 101 | } else if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_KEY ) { |
| 102 | cput | |
| 102 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 103 | 103 | } else if ( state->m_ws_portram[0xb2] & state->m_ws_portram[0xb6] & WSWAN_IFLAG_STX ) { |
| 104 | cput | |
| 104 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 105 | 105 | } else { |
| 106 | cput | |
| 106 | machine.device("maincpu")->execute().set_input_line( | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 |
| r17813 | r17814 | |
|---|---|---|
| 173 | 173 | if (!m_nmi_delay_counter) |
| 174 | 174 | { |
| 175 | 175 | machine().device("z80ne")->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_default), this)); |
| 176 | c | |
| 176 | machine().device("z80ne")->execute().set_input_line( | |
| 177 | 177 | } |
| 178 | 178 | return address; |
| 179 | 179 | } |
| r17813 | r17814 | |
| 389 | 389 | |
| 390 | 390 | if ( ! BIT(nmi, 0)) |
| 391 | 391 | { |
| 392 | | |
| 392 | | |
| 393 | 393 | } |
| 394 | 394 | } |
| 395 | 395 |
| r17813 | r17814 | |
|---|---|---|
| 261 | 261 | logerror("apple2gs_add_irq(): adding %s\n", apple2gs_irq_name(irq_mask)); |
| 262 | 262 | |
| 263 | 263 | state->m_pending_irqs |= irq_mask; |
| 264 | cput | |
| 264 | machine.device("maincpu")->execute().set_input_line( | |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| r17813 | r17814 | |
| 276 | 276 | logerror("apple2gs_remove_irq(): removing %s\n", apple2gs_irq_name(irq_mask)); |
| 277 | 277 | |
| 278 | 278 | state->m_pending_irqs &= ~irq_mask; |
| 279 | cput | |
| 279 | machine.device("maincpu")->execute().set_input_line( | |
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 |
| r17813 | r17814 | |
|---|---|---|
| 574 | 574 | |
| 575 | 575 | static WRITE_LINE_DEVICE_HANDLER( apollo_dma_2_hrq_changed ) { |
| 576 | 576 | // DLOG2(("dma 2 hrq changed state %02x", state)); |
| 577 | | |
| 577 | | |
| 578 | 578 | |
| 579 | 579 | /* Assert HLDA */ |
| 580 | 580 | i8237_hlda_w(device, state); |
| r17813 | r17814 | |
| 713 | 713 | apollo_set_cache_status_register(0x10, state ? 0x10 : 0x00); |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | c | |
| 716 | device->machine().device(MAINCPU)->execute().set_input_line_and_vector( | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | static WRITE_LINE_DEVICE_HANDLER( apollo_pic8259_slave_set_int_line ) { |
| r17813 | r17814 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | static void sym1_irq(device_t *device, int level) |
| 176 | 176 | { |
| 177 | | |
| 177 | | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 |
| r17813 | r17814 | |
|---|---|---|
| 79 | 79 | { |
| 80 | 80 | if ((machine.root_device().ioport("NMI")->read() & 1) == 1) |
| 81 | 81 | { |
| 82 | cput | |
| 82 | machine.device("maincpu")->execute().set_input_line( | |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 |
| r17813 | r17814 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | static void kaypro_interrupt(device_t *device, int state) |
| 17 | 17 | { |
| 18 | | |
| 18 | | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | READ8_MEMBER( kaypro_state::pio_system_r ) |
| r17813 | r17814 | |
| 281 | 281 | static TIMER_CALLBACK( kaypro_timer_callback ) |
| 282 | 282 | { |
| 283 | 283 | if (machine.device("maincpu")->state().state_int(Z80_HALT)) |
| 284 | cput | |
| 284 | machine.device("maincpu")->execute().set_input_line( | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | WRITE_LINE_MEMBER( kaypro_state::kaypro_fdc_intrq_w ) |
| r17813 | r17814 | |
| 289 | 289 | if (state) |
| 290 | 290 | machine().scheduler().timer_set(attotime::from_usec(25), FUNC(kaypro_timer_callback)); |
| 291 | 291 | else |
| 292 | cput | |
| 292 | machine().device("maincpu")->execute().set_input_line( | |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | WRITE_LINE_MEMBER( kaypro_state::kaypro_fdc_drq_w ) |
| r17813 | r17814 | |
| 297 | 297 | if (state) |
| 298 | 298 | machine().scheduler().timer_set(attotime::from_usec(25), FUNC(kaypro_timer_callback)); |
| 299 | 299 | else |
| 300 | cput | |
| 300 | machine().device("maincpu")->execute().set_input_line( | |
| 301 | 301 | |
| 302 | 302 | } |
| 303 | 303 |
| r17813 | r17814 | |
|---|---|---|
| 360 | 360 | static WRITE_LINE_DEVICE_HANDLER( hrq_w ) |
| 361 | 361 | { |
| 362 | 362 | /* HACK - this should be connected to the BUSREQ line of Z80 */ |
| 363 | | |
| 363 | | |
| 364 | 364 | |
| 365 | 365 | /* HACK - this should be connected to the BUSACK line of Z80 */ |
| 366 | 366 | i8257_hlda_w(device, state); |
| r17813 | r17814 | |
|---|---|---|
| 246 | 246 | |
| 247 | 247 | if (data & 0x01) /* Reset machine ! (on ESC key)*/ |
| 248 | 248 | { |
| 249 | cput | |
| 249 | machine().device("maincpu")->execute().set_input_line( | |
| 250 | 250 | if (isHectorHR(machine())) /* aviable for HR and up */ |
| 251 | 251 | { |
| 252 | 252 | m_hector_flag_hr=1; |
| r17813 | r17814 | |
| 871 | 871 | state->m_hector_flag_hr = hr; |
| 872 | 872 | state->m_flag_clk = 0; |
| 873 | 873 | state->m_write_cassette = 0; |
| 874 | cput | |
| 874 | machine.device("maincpu" )->execute().set_input_line( | |
| 875 | 875 | |
| 876 | 876 | // Initialization Disc II |
| 877 | 877 | if (with_D2==1) |
| 878 | 878 | |
| 879 | 879 | { |
| 880 | cput | |
| 880 | machine.device("disc2cpu")->execute().set_input_line( | |
| 881 | 881 | device_t *fdc = machine.device("upd765"); |
| 882 | cput | |
| 882 | machine.device("disc2cpu")->execute().set_input_line( | |
| 883 | 883 | upd765_reset(fdc, 1); |
| 884 | 884 | upd765_reset_w(fdc, 1); |
| 885 | 885 | } |
| r17813 | r17814 | |
|---|---|---|
| 249 | 249 | */ |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | | |
| 252 | | |
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | } |
| r17813 | r17814 | |
| 260 | 260 | |
| 261 | 261 | if (b & 0x20) |
| 262 | 262 | { |
| 263 | | |
| 263 | | |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| r17813 | r17814 | |
| 282 | 282 | state->m_interrupts, state->m_cpu_imask[cpunum], interrupt ? "on" : "off"); |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | | |
| 285 | | |
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| r17813 | r17814 | |
| 670 | 670 | |
| 671 | 671 | static WRITE_LINE_DEVICE_HANDLER( bebox_dma_hrq_changed ) |
| 672 | 672 | { |
| 673 | | |
| 673 | | |
| 674 | 674 | |
| 675 | 675 | /* Assert HLDA */ |
| 676 | 676 | i8237_hlda_w( device, state ); |
| r17813 | r17814 | |
| 993 | 993 | |
| 994 | 994 | machine.scheduler().timer_set(attotime::zero, FUNC(bebox_get_devices)); |
| 995 | 995 | |
| 996 | cputag_set_input_line(machine, "ppc1", INPUT_LINE_RESET, CLEAR_LINE); | |
| 997 | cputag_set_input_line(machine, "ppc2", INPUT_LINE_RESET, ASSERT_LINE); | |
| 996 | machine.device("ppc1")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 997 | machine.device("ppc2")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 998 | 998 | |
| 999 | 999 | memcpy(machine.device<fujitsu_29f016a_device>("flash")->space()->get_read_ptr(0),state->memregion("user1")->base(),0x200000); |
| 1000 | 1000 | } |
| r17813 | r17814 | |
|---|---|---|
| 654 | 654 | static TIMER_CALLBACK(intv_interrupt_complete) |
| 655 | 655 | { |
| 656 | 656 | intv_state *state = machine.driver_data<intv_state>(); |
| 657 | cput | |
| 657 | machine.device("maincpu")->execute().set_input_line( | |
| 658 | 658 | state->m_bus_copy_mode = 0; |
| 659 | 659 | } |
| 660 | 660 | |
| r17813 | r17814 | |
| 675 | 675 | INTERRUPT_GEN( intv_interrupt ) |
| 676 | 676 | { |
| 677 | 677 | intv_state *state = device->machine().driver_data<intv_state>(); |
| 678 | | |
| 678 | | |
| 679 | 679 | state->m_sr1_int_pending = 1; |
| 680 | 680 | state->m_bus_copy_mode = 1; |
| 681 | 681 | state->m_backtab_row = 0; |
| r17813 | r17814 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | WRITE_LINE_MEMBER( mz80_state::pit_out2_changed ) |
| 71 | 71 | { |
| 72 | cput | |
| 72 | machine().device("maincpu")->execute().set_input_line( | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | I8255_INTERFACE( mz80k_8255_int ) |
| r17813 | r17814 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | if (state->m_nmilevel != (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq) /* KEY_RESTORE */ |
| 57 | 57 | { |
| 58 | cput | |
| 58 | machine.device("maincpu")->execute().set_input_line( | |
| 59 | 59 | |
| 60 | 60 | state->m_nmilevel = (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq; |
| 61 | 61 | } |
| r17813 | r17814 | |
| 104 | 104 | if (level != state->m_old_level) |
| 105 | 105 | { |
| 106 | 106 | DBG_LOG(machine, 3, "mos6510", ("irq %s\n", level ? "start" : "end")); |
| 107 | cput | |
| 107 | machine.device("maincpu")->execute().set_input_line( | |
| 108 | 108 | state->m_old_level = level; |
| 109 | 109 | } |
| 110 | 110 | } |
| r17813 | r17814 | |
|---|---|---|
| 169 | 169 | |
| 170 | 170 | case COSMAC_STATE_CODE_S2_DMA: |
| 171 | 171 | // DMA acknowledge clears the DMAOUT request |
| 172 | | |
| 172 | | |
| 173 | 173 | break; |
| 174 | 174 | case COSMAC_STATE_CODE_S3_INTERRUPT: |
| 175 | 175 | break; |
| r17813 | r17814 | |
|---|---|---|
| 1112 | 1112 | |
| 1113 | 1113 | if ( pce_cd.regs[0x02] & pce_cd.regs[0x03] & ( PCE_CD_IRQ_TRANSFER_DONE | PCE_CD_IRQ_TRANSFER_READY | PCE_CD_IRQ_SAMPLE_HALF_PLAY | PCE_CD_IRQ_SAMPLE_FULL_PLAY) ) |
| 1114 | 1114 | { |
| 1115 | cput | |
| 1115 | machine.device("maincpu")->execute().set_input_line( | |
| 1116 | 1116 | } |
| 1117 | 1117 | else |
| 1118 | 1118 | { |
| 1119 | cput | |
| 1119 | machine.device("maincpu")->execute().set_input_line( | |
| 1120 | 1120 | } |
| 1121 | 1121 | } |
| 1122 | 1122 | |
| r17813 | r17814 | |
| 1348 | 1348 | pce_cd.adpcm_dma_timer->adjust(attotime::never); // stop ADPCM DMA here |
| 1349 | 1349 | /* any write here clears CD transfer irqs */ |
| 1350 | 1350 | pce_cd.regs[0x03] &= ~0x70; |
| 1351 | cput | |
| 1351 | machine().device("maincpu")->execute().set_input_line( | |
| 1352 | 1352 | break; |
| 1353 | 1353 | case 0x01: /* CDC command / status / data */ |
| 1354 | 1354 | break; |
| r17813 | r17814 | |
|---|---|---|
| 1560 | 1560 | { |
| 1561 | 1561 | /* I'll pulse it because if I used hold-line I'm not sure |
| 1562 | 1562 | it would clear - to be checked */ |
| 1563 | cput | |
| 1563 | machine.device("maincpu")->execute().set_input_line( | |
| 1564 | 1564 | } |
| 1565 | 1565 | } |
| 1566 | 1566 |
| r17813 | r17814 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | static void hp48_pulse_irq( running_machine &machine, int irq_line) |
| 87 | 87 | { |
| 88 | cputag_set_input_line(machine, "maincpu", irq_line, ASSERT_LINE ); | |
| 89 | cputag_set_input_line(machine, "maincpu", irq_line, CLEAR_LINE ); | |
| 88 | machine.device("maincpu")->execute().set_input_line(irq_line, ASSERT_LINE ); | |
| 89 | machine.device("maincpu")->execute().set_input_line(irq_line, CLEAR_LINE ); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 |
| r17813 | r17814 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | m_via_cycles = -256; // for a 66 MHz PowerMac |
| 156 | 156 | |
| 157 | cput | |
| 157 | machine().device("maincpu")->execute().set_input_line( | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | WRITE_LINE_MEMBER(macpci_state::cuda_reset_w) |
| 161 | 161 | { |
| 162 | cput | |
| 162 | machine().device("maincpu")->execute().set_input_line( | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static void mac_driver_init(running_machine &machine, model_t model) |
| r17813 | r17814 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | if (state->m_nmilevel != (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq) /* KEY_RESTORE */ |
| 49 | 49 | { |
| 50 | cput | |
| 50 | machine.device("maincpu")->execute().set_input_line( | |
| 51 | 51 | |
| 52 | 52 | state->m_nmilevel = (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq; |
| 53 | 53 | } |
| r17813 | r17814 | |
| 104 | 104 | if (level != state->m_old_level) |
| 105 | 105 | { |
| 106 | 106 | DBG_LOG(machine, 3, "mos6510", ("irq %s\n", level ? "start" : "end")); |
| 107 | cput | |
| 107 | machine.device("maincpu")->execute().set_input_line( | |
| 108 | 108 | state->m_old_level = level; |
| 109 | 109 | } |
| 110 | 110 | } |
| r17813 | r17814 | |
|---|---|---|
| 213 | 213 | state = CLEAR_LINE; |
| 214 | 214 | |
| 215 | 215 | m_slot->set_ready((state==CLEAR_LINE)? ASSERT_LINE : CLEAR_LINE); |
| 216 | // cput | |
| 216 | // machine().device("maincpu")->execute().set_input_line( | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /* |
| r17813 | r17814 | |
|---|---|---|
| 79 | 79 | state = CLEAR_LINE; |
| 80 | 80 | |
| 81 | 81 | m_slot->set_ready((state==CLEAR_LINE)? ASSERT_LINE : CLEAR_LINE); |
| 82 | // cput | |
| 82 | // machine().device("maincpu")->execute().set_input_line( | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /* |
| r17813 | r17814 | |
|---|---|---|
| 1915 | 1915 | { |
| 1916 | 1916 | state->SIOCONT &= 0x7F; |
| 1917 | 1917 | state->m_gb_serial_timer->enable( 0 ); |
| 1918 | cput | |
| 1918 | machine.device("maincpu")->execute().set_input_line( | |
| 1919 | 1919 | } |
| 1920 | 1920 | } |
| 1921 | 1921 | |
| r17813 | r17814 | |
| 1929 | 1929 | if ( state->TIMECNT == 0 ) |
| 1930 | 1930 | { |
| 1931 | 1931 | state->TIMECNT = state->TIMEMOD; |
| 1932 | cput | |
| 1932 | machine.device("maincpu")->execute().set_input_line( | |
| 1933 | 1933 | state->m_reloading = 1; |
| 1934 | 1934 | } |
| 1935 | 1935 | } |
| r17813 | r17814 | |
|---|---|---|
| 134 | 134 | static WRITE_LINE_DEVICE_HANDLER( hrq_w ) |
| 135 | 135 | { |
| 136 | 136 | /* HACK - this should be connected to the BUSREQ line of Z80 */ |
| 137 | | |
| 137 | | |
| 138 | 138 | |
| 139 | 139 | /* HACK - this should be connected to the BUSACK line of Z80 */ |
| 140 | 140 | i8257_hlda_w(device, state); |
| r17813 | r17814 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | for (level = 0; ! (intlines & (1 << level)); level++) |
| 33 | 33 | ; |
| 34 | cput | |
| 34 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 35 | 35 | } |
| 36 | 36 | else |
| 37 | cput | |
| 37 | machine.device("maincpu")->execute().set_input_line( | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | void ti990_set_int2(device_t *device, int state) |
| r17813 | r17814 | |
| 78 | 78 | |
| 79 | 79 | static TIMER_CALLBACK(clear_load) |
| 80 | 80 | { |
| 81 | cput | |
| 81 | machine.device("maincpu")->execute().set_input_line( | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | void ti990_hold_load(running_machine &machine) |
| 85 | 85 | { |
| 86 | cput | |
| 86 | machine.device("maincpu")->execute().set_input_line( | |
| 87 | 87 | machine.scheduler().timer_set(attotime::from_msec(100), FUNC(clear_load)); |
| 88 | 88 | } |
| 89 | 89 |
| r17813 | r17814 | |
|---|---|---|
| 273 | 273 | |
| 274 | 274 | static WRITE_LINE_DEVICE_HANDLER( b2m_pic_set_int_line ) |
| 275 | 275 | { |
| 276 | | |
| 276 | | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | /* Driver initialization */ |
| r17813 | r17814 | |
|---|---|---|
| 272 | 272 | if ( old && !thom_irq ) |
| 273 | 273 | LOG_IRQ(( "%f thom_set_irq: irq line down %i\n", machine.time().as_double(), line )); |
| 274 | 274 | |
| 275 | cput | |
| 275 | machine.device("maincpu")->execute().set_input_line( | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
| r17813 | r17814 | |
| 291 | 291 | if ( old && !thom_firq ) |
| 292 | 292 | LOG_IRQ(( "%f thom_set_firq: firq line down %i\n", machine.time().as_double(), line )); |
| 293 | 293 | |
| 294 | cput | |
| 294 | machine.device("maincpu")->execute().set_input_line( | |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | |
| r17813 | r17814 | |
| 300 | 300 | { |
| 301 | 301 | thom_irq = 0; |
| 302 | 302 | thom_firq = 0; |
| 303 | cputag_set_input_line( machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE ); | |
| 304 | cputag_set_input_line( machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE ); | |
| 303 | machine.device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, CLEAR_LINE ); | |
| 304 | machine.device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, CLEAR_LINE ); | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 |
| r17813 | r17814 | |
|---|---|---|
| 728 | 728 | state->m_spet.rom = 0; |
| 729 | 729 | if (machine.root_device().ioport("CFG")->read() & 0x04) |
| 730 | 730 | { |
| 731 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, 1); | |
| 732 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, 0); | |
| 731 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, 1); | |
| 732 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, 0); | |
| 733 | 733 | state->m_font = 2; |
| 734 | 734 | } |
| 735 | 735 | else |
| 736 | 736 | { |
| 737 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, 0); | |
| 738 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, 1); | |
| 737 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, 0); | |
| 738 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, 1); | |
| 739 | 739 | state->m_font = 0; |
| 740 | 740 | } |
| 741 | 741 | } |
| r17813 | r17814 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | /* any irq set? */ |
| 66 | 66 | if (state->m_irqs & 0x0f) |
| 67 | cput | |
| 67 | machine.device("maincpu")->execute().set_input_line( | |
| 68 | 68 | else |
| 69 | cput | |
| 69 | machine.device("maincpu")->execute().set_input_line( | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 |
| r17813 | r17814 | |
|---|---|---|
| 59 | 59 | { |
| 60 | 60 | state->m_key_irq_vector = 0xBC; |
| 61 | 61 | } |
| 62 | cput | |
| 62 | machine.device("maincpu")->execute().set_input_line( | |
| 63 | 63 | break; |
| 64 | 64 | } |
| 65 | 65 | } |
| r17813 | r17814 | |
|---|---|---|
| 87 | 87 | static TIMER_CALLBACK( amiga_ar1_delayed_nmi ) |
| 88 | 88 | { |
| 89 | 89 | (void)param; |
| 90 | cput | |
| 90 | machine.device("maincpu")->execute().set_input_line( | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | static void amiga_ar1_nmi( running_machine &machine ) |
| r17813 | r17814 | |
| 286 | 286 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x000000, state->m_chip_ram.bytes() - 1, FUNC(amiga_ar23_chipmem_w)); |
| 287 | 287 | |
| 288 | 288 | /* trigger NMI irq */ |
| 289 | cput | |
| 289 | machine.device("maincpu")->execute().set_input_line( | |
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 |
| r17813 | r17814 | |
|---|---|---|
| 186 | 186 | WRITE_LINE_MEMBER( osborne1_state::ieee_pia_irq_a_func ) |
| 187 | 187 | { |
| 188 | 188 | m_pia_0_irq_state = state; |
| 189 | cput | |
| 189 | machine().device("maincpu")->execute().set_input_line( | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| r17813 | r17814 | |
| 297 | 297 | WRITE_LINE_MEMBER( osborne1_state::video_pia_irq_a_func ) |
| 298 | 298 | { |
| 299 | 299 | m_pia_1_irq_state = state; |
| 300 | cput | |
| 300 | machine().device("maincpu")->execute().set_input_line( | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 |
| r17813 | r17814 | |
|---|---|---|
| 549 | 549 | { |
| 550 | 550 | state->m_plus_irq_cause = channel * 2; |
| 551 | 551 | state->m_asic.ram[0x2c0f] |= (0x40 >> channel); |
| 552 | cput | |
| 552 | machine.device("maincpu")->execute().set_input_line( | |
| 553 | 553 | logerror("DMA %i: INT\n",channel); |
| 554 | 554 | } |
| 555 | 555 | if (command & 0x20) // Stop processing on this channel |
| r17813 | r17814 | |
| 857 | 857 | { |
| 858 | 858 | if (drvstate->m_gate_array.hsync_counter >= 32) |
| 859 | 859 | { |
| 860 | | |
| 860 | | |
| 861 | 861 | } |
| 862 | 862 | drvstate->m_gate_array.hsync_counter = 0; |
| 863 | 863 | } |
| r17813 | r17814 | |
| 866 | 866 | if ( drvstate->m_gate_array.hsync_counter >= 52 ) |
| 867 | 867 | { |
| 868 | 868 | drvstate->m_gate_array.hsync_counter = 0; |
| 869 | | |
| 869 | | |
| 870 | 870 | } |
| 871 | 871 | } |
| 872 | 872 | drvstate->m_gate_array.hsync = state ? 1 : 0; |
| r17813 | r17814 | |
| 903 | 903 | { |
| 904 | 904 | if( drvstate->m_asic.pri == 0 || drvstate->m_asic.enabled == 0) |
| 905 | 905 | { |
| 906 | | |
| 906 | | |
| 907 | 907 | } |
| 908 | 908 | } |
| 909 | 909 | drvstate->m_gate_array.hsync_counter = 0; |
| r17813 | r17814 | |
| 915 | 915 | drvstate->m_gate_array.hsync_counter = 0; |
| 916 | 916 | if ( drvstate->m_asic.pri == 0 || drvstate->m_asic.enabled == 0 ) |
| 917 | 917 | { |
| 918 | | |
| 918 | | |
| 919 | 919 | } |
| 920 | 920 | } |
| 921 | 921 | |
| r17813 | r17814 | |
| 927 | 927 | if ( drvstate->m_asic.pri == drvstate->m_asic.vpos - 1 ) |
| 928 | 928 | { |
| 929 | 929 | logerror("PRI: triggered, scanline %d\n",drvstate->m_asic.pri); |
| 930 | | |
| 930 | | |
| 931 | 931 | drvstate->m_plus_irq_cause = 0x06; // raster interrupt vector |
| 932 | 932 | drvstate->m_gate_array.hsync_counter &= ~0x20; // ASIC PRI resets the MSB of the raster counter |
| 933 | 933 | } |
| r17813 | r17814 | |
| 1139 | 1139 | |
| 1140 | 1140 | WRITE_LINE_DEVICE_HANDLER(cpc_irq_w) |
| 1141 | 1141 | { |
| 1142 | | |
| 1142 | | |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | WRITE_LINE_DEVICE_HANDLER(cpc_nmi_w) |
| 1146 | 1146 | { |
| 1147 | | |
| 1147 | | |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | 1150 | WRITE_LINE_DEVICE_HANDLER(cpc_romdis) |
| r17813 | r17814 | |
| 1490 | 1490 | if(data & 0x40) |
| 1491 | 1491 | { |
| 1492 | 1492 | logerror("ASIC: DMA 0 IRQ acknowledge\n"); |
| 1493 | cput | |
| 1493 | machine().device("maincpu")->execute().set_input_line( | |
| 1494 | 1494 | m_plus_irq_cause = 0x06; |
| 1495 | 1495 | m_asic.ram[0x2c0f] &= ~0x40; |
| 1496 | 1496 | } |
| 1497 | 1497 | if(data & 0x20) |
| 1498 | 1498 | { |
| 1499 | 1499 | logerror("ASIC: DMA 1 IRQ acknowledge\n"); |
| 1500 | cput | |
| 1500 | machine().device("maincpu")->execute().set_input_line( | |
| 1501 | 1501 | m_plus_irq_cause = 0x06; |
| 1502 | 1502 | m_asic.ram[0x2c0f] &= ~0x20; |
| 1503 | 1503 | } |
| 1504 | 1504 | if(data & 0x10) |
| 1505 | 1505 | { |
| 1506 | 1506 | logerror("ASIC: DMA 2 IRQ acknowledge\n"); |
| 1507 | cput | |
| 1507 | machine().device("maincpu")->execute().set_input_line( | |
| 1508 | 1508 | m_plus_irq_cause = 0x06; |
| 1509 | 1509 | m_asic.ram[0x2c0f] &= ~0x10; |
| 1510 | 1510 | } |
| r17813 | r17814 | |
| 1710 | 1710 | if ( state->m_gate_array.mrer & 0x10 ) |
| 1711 | 1711 | { |
| 1712 | 1712 | state->m_gate_array.hsync_counter = 0; |
| 1713 | cput | |
| 1713 | machine.device("maincpu")->execute().set_input_line( | |
| 1714 | 1714 | } |
| 1715 | 1715 | |
| 1716 | 1716 | /* b3b2 != 0 then change the state of upper or lower rom area and rethink memory */ |
| r17813 | r17814 | |
| 2693 | 2693 | state->m_asic.ram[0x2c0f] &= ~0x80; // not a raster interrupt, so this bit is reset |
| 2694 | 2694 | return (state->m_asic.ram[0x2805] & 0xf8) | state->m_plus_irq_cause; |
| 2695 | 2695 | } |
| 2696 | | |
| 2696 | | |
| 2697 | 2697 | state->m_gate_array.hsync_counter &= 0x1F; |
| 2698 | 2698 | if ( state->m_asic.enabled ) |
| 2699 | 2699 | { |
| r17813 | r17814 | |
|---|---|---|
| 785 | 785 | { |
| 786 | 786 | if (!driver_state->m_paused) |
| 787 | 787 | { |
| 788 | | |
| 788 | | |
| 789 | 789 | } |
| 790 | 790 | driver_state->m_paused = 1; |
| 791 | 791 | } |
| r17813 | r17814 | |
|---|---|---|
| 83 | 83 | void compis_irq_set(UINT8 irq) |
| 84 | 84 | { |
| 85 | 85 | cputag_set_input_line_vector(machine, "maincpu", 0, irq); |
| 86 | cput | |
| 86 | machine.device("maincpu")->execute().set_input_line( | |
| 87 | 87 | } |
| 88 | 88 | #endif |
| 89 | 89 | |
| r17813 | r17814 | |
| 523 | 523 | /* generate the appropriate interrupt */ |
| 524 | 524 | state->m_i186.intr.poll_status = 0x8000 | new_vector; |
| 525 | 525 | if (!state->m_i186.intr.pending) |
| 526 | cput | |
| 526 | machine.device("maincpu")->execute().set_input_line( | |
| 527 | 527 | state->m_i186.intr.pending = 1; |
| 528 | 528 | machine.scheduler().trigger(CPU_RESUME_TRIGGER); |
| 529 | 529 | if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n"); |
| r17813 | r17814 | |
| 1325 | 1325 | |
| 1326 | 1326 | WRITE_LINE_MEMBER( compis_state::compis_pic8259_master_set_int_line ) |
| 1327 | 1327 | { |
| 1328 | cput | |
| 1328 | machine().device("maincpu")->execute().set_input_line( | |
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | 1331 | WRITE_LINE_MEMBER( compis_state::compis_pic8259_slave_set_int_line ) |
| r17813 | r17814 | |
|---|---|---|
| 291 | 291 | |
| 292 | 292 | if (m_last_taken_interrupt > -1) |
| 293 | 293 | { |
| 294 | cput | |
| 294 | machine().device("maincpu")->execute().set_input_line( | |
| 295 | 295 | m_last_taken_interrupt = -1; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | if (take_interrupt > -1) |
| 299 | 299 | { |
| 300 | cput | |
| 300 | machine().device("maincpu")->execute().set_input_line( | |
| 301 | 301 | m_last_taken_interrupt = take_interrupt; |
| 302 | 302 | } |
| 303 | 303 | } |
| r17813 | r17814 | |
| 1958 | 1958 | set_memory_overlay(1); |
| 1959 | 1959 | } |
| 1960 | 1960 | |
| 1961 | cput | |
| 1961 | machine().device("maincpu")->execute().set_input_line( | |
| 1962 | 1962 | } |
| 1963 | 1963 | |
| 1964 | 1964 | static void mac_state_load(mac_state *mac) |
| r17813 | r17814 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | if (final_level) |
| 135 | 135 | /* assert interrupt */ |
| 136 | cput | |
| 136 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 137 | 137 | else |
| 138 | 138 | /* clear all interrupts */ |
| 139 | cput | |
| 139 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | INLINE void post_in_KeyQueue(concept_state *state, int keycode) |
| r17813 | r17814 | |
|---|---|---|
| 358 | 358 | |
| 359 | 359 | void msx_vdp_interrupt(device_t *, v99x8_device &device, int i) |
| 360 | 360 | { |
| 361 | | |
| 361 | | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | void msx_state::msx_ch_reset_core () |
| r17813 | r17814 | |
|---|---|---|
| 425 | 425 | mz_state *mz = device->machine().driver_data<mz_state>(); |
| 426 | 426 | |
| 427 | 427 | if (!mz->m_intmsk) |
| 428 | | |
| 428 | | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | |
| r17813 | r17814 | |
| 541 | 541 | |
| 542 | 542 | static void mz800_z80pio_irq(device_t *device, int which) |
| 543 | 543 | { |
| 544 | | |
| 544 | | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | static READ8_DEVICE_HANDLER( mz800_z80pio_port_a_r ) |
| r17813 | r17814 | |
|---|---|---|
| 164 | 164 | #if 0 |
| 165 | 165 | if (RSIR) |
| 166 | 166 | // serial interrupt |
| 167 | cput | |
| 167 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 168 | 168 | else if (int0) |
| 169 | 169 | // external interrupt |
| 170 | cput | |
| 170 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 171 | 171 | else if (int1) |
| 172 | 172 | // external interrupt |
| 173 | cput | |
| 173 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 174 | 174 | else if (int2) |
| 175 | 175 | // external interrupt |
| 176 | cput | |
| 176 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 177 | 177 | else |
| 178 | 178 | #endif |
| 179 | 179 | if (state->m_KBIR) |
| 180 | 180 | /* COPS VIA interrupt */ |
| 181 | cput | |
| 181 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 182 | 182 | else if (state->m_FDIR || state->m_VTIR) |
| 183 | 183 | /* floppy disk or VBl */ |
| 184 | cput | |
| 184 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 185 | 185 | else |
| 186 | 186 | /* clear all interrupts */ |
| 187 | cput | |
| 187 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | static void set_parity_error_pending(running_machine &machine, int value) |
| r17813 | r17814 | |
| 195 | 195 | state->m_parity_error_pending = value; |
| 196 | 196 | if (state->m_parity_error_pending) |
| 197 | 197 | { |
| 198 | cput | |
| 198 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 199 | 199 | } |
| 200 | 200 | else |
| 201 | 201 | { |
| 202 | cput | |
| 202 | machine.device("maincpu")->execute().set_input_line( | |
| 203 | 203 | } |
| 204 | 204 | #else |
| 205 | 205 | /* work-around... */ |
| 206 | 206 | if ((! state->m_parity_error_pending) && value) |
| 207 | 207 | { |
| 208 | 208 | state->m_parity_error_pending = 1; |
| 209 | cput | |
| 209 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 210 | 210 | } |
| 211 | 211 | else if (state->m_parity_error_pending && (! value)) |
| 212 | 212 | { |
| r17813 | r17814 | |
| 327 | 327 | #if 0 |
| 328 | 328 | if (keycode == state->m_NMIcode) |
| 329 | 329 | { /* generate NMI interrupt */ |
| 330 | cput | |
| 330 | machine.device("maincpu")->execute().set_input_line( | |
| 331 | 331 | device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR); |
| 332 | 332 | } |
| 333 | 333 | #endif |
| r17813 | r17814 | |
|---|---|---|
| 604 | 604 | { |
| 605 | 605 | lynx_state *state = machine.driver_data<lynx_state>(); |
| 606 | 606 | state->m_blitter.busy=0; // blitter finished |
| 607 | cput | |
| 607 | machine.device("maincpu")->execute().set_input_line( | |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | /* |
| r17813 | r17814 | |
| 1409 | 1409 | if ( ( state->m_timer[which].cntrl1 & 0x80 ) && ( which != 4 ) ) // if interrupts are enabled and timer != 4 |
| 1410 | 1410 | { |
| 1411 | 1411 | state->m_mikey.data[0x81] |= ( 1 << which ); // set interupt poll register |
| 1412 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1413 | cputag_set_input_line(machine, "maincpu", M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1412 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1413 | machine.device("maincpu")->execute().set_input_line(M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1414 | 1414 | } |
| 1415 | 1415 | switch ( which ) // count down linked timers |
| 1416 | 1416 | { |
| r17813 | r17814 | |
| 1640 | 1640 | if (state->m_uart.serctl & 0x40) |
| 1641 | 1641 | { |
| 1642 | 1642 | state->m_mikey.data[0x81] |= 0x10; |
| 1643 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1644 | cputag_set_input_line(machine, "maincpu", M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1643 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1644 | machine.device("maincpu")->execute().set_input_line(M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1645 | 1645 | } |
| 1646 | 1646 | } |
| 1647 | 1647 | |
| 1648 | 1648 | if (state->m_uart.serctl & 0x80) |
| 1649 | 1649 | { |
| 1650 | 1650 | state->m_mikey.data[0x81] |= 0x10; |
| 1651 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1652 | cputag_set_input_line(machine, "maincpu", M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1651 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1652 | machine.device("maincpu")->execute().set_input_line(M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1653 | 1653 | } |
| 1654 | 1654 | } |
| 1655 | 1655 | |
| r17813 | r17814 | |
| 1806 | 1806 | m_mikey.data[0x81] &= ~data; // clear interrupt source |
| 1807 | 1807 | // logerror("mikey write %.2x %.2x\n", offset, data); |
| 1808 | 1808 | if (!m_mikey.data[0x81]) |
| 1809 | cput | |
| 1809 | machine().device("maincpu")->execute().set_input_line( | |
| 1810 | 1810 | break; |
| 1811 | 1811 | |
| 1812 | 1812 | /* Is this correct? */ // Notes say writing to register will result in interupt being triggered. |
| r17813 | r17814 | |
| 1814 | 1814 | m_mikey.data[0x81] |= data; |
| 1815 | 1815 | if (data) |
| 1816 | 1816 | { |
| 1817 | cputag_set_input_line(machine(), "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1818 | cputag_set_input_line(machine(), "maincpu", M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1817 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1818 | machine().device("maincpu")->execute().set_input_line(M65SC02_IRQ_LINE, ASSERT_LINE); | |
| 1819 | 1819 | logerror("direct write to interupt register\n"); |
| 1820 | 1820 | } |
| 1821 | 1821 | break; |
| r17813 | r17814 | |
| 1869 | 1869 | m_mikey.data[offset] = data; |
| 1870 | 1870 | if (!data && m_blitter.busy) |
| 1871 | 1871 | { |
| 1872 | cput | |
| 1872 | machine().device("maincpu")->execute().set_input_line( | |
| 1873 | 1873 | /* A write of '0' to this address will reset the CPU bus request flip flop */ |
| 1874 | 1874 | } |
| 1875 | 1875 | break; |
| r17813 | r17814 | |
| 1929 | 1929 | lynx_state *state = machine.driver_data<lynx_state>(); |
| 1930 | 1930 | state->lynx_memory_config_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0); |
| 1931 | 1931 | |
| 1932 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1933 | cputag_set_input_line(machine, "maincpu", M65SC02_IRQ_LINE, CLEAR_LINE); | |
| 1932 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1933 | machine.device("maincpu")->execute().set_input_line(M65SC02_IRQ_LINE, CLEAR_LINE); | |
| 1934 | 1934 | |
| 1935 | 1935 | memset(&state->m_suzy, 0, sizeof(state->m_suzy)); |
| 1936 | 1936 | memset(&state->m_mikey, 0, sizeof(state->m_mikey)); |
| r17813 | r17814 | |
|---|---|---|
| 419 | 419 | if( (state->m_irq_status & IRQ_TIMER) == 0 ) |
| 420 | 420 | { |
| 421 | 421 | state->m_irq_status |= IRQ_TIMER; |
| 422 | | |
| 422 | | |
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | |
| r17813 | r17814 | |
| 435 | 435 | if( (drvstate->m_irq_status & IRQ_FDC) == 0 ) |
| 436 | 436 | { |
| 437 | 437 | drvstate->m_irq_status |= IRQ_FDC; |
| 438 | | |
| 438 | | |
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | else |
| r17813 | r17814 | |
|---|---|---|
| 115 | 115 | if (!go_fast) |
| 116 | 116 | { |
| 117 | 117 | if (!state->m_int_sw) |
| 118 | cput | |
| 118 | machine.device("maincpu")->execute().set_input_line( | |
| 119 | 119 | |
| 120 | 120 | state->m_int_sw++; |
| 121 | 121 | if (state->m_int_sw > 1) |
| 122 | 122 | { |
| 123 | cput | |
| 123 | machine.device("maincpu")->execute().set_input_line( | |
| 124 | 124 | state->m_int_sw = 0; |
| 125 | 125 | } |
| 126 | 126 | } |
| r17813 | r17814 | |
| 128 | 128 | { |
| 129 | 129 | if (state->m_int_sw < 8) // @2MHz, reset just once |
| 130 | 130 | { |
| 131 | cput | |
| 131 | machine.device("maincpu")->execute().set_input_line( | |
| 132 | 132 | state->m_int_sw = 8; // ...not every time |
| 133 | 133 | } |
| 134 | 134 | } |
| r17813 | r17814 | |
|---|---|---|
| 297 | 297 | if (!state->m_reset_flag) { |
| 298 | 298 | state->m_reset_flag = 1; |
| 299 | 299 | /* using PULSE_LINE does not allow us to press and hold key */ |
| 300 | cput | |
| 300 | machine.device("maincpu")->execute().set_input_line( | |
| 301 | 301 | pia->reset(); |
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | else if (state->m_reset_flag) { |
| 305 | 305 | /* RESET released--allow the processor to continue. */ |
| 306 | 306 | state->m_reset_flag = 0; |
| 307 | cput | |
| 307 | machine.device("maincpu")->execute().set_input_line( | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /* The CLEAR SCREEN switch clears the video hardware. */ |
| r17813 | r17814 | |
|---|---|---|
| 345 | 345 | /* generate the appropriate interrupt */ |
| 346 | 346 | state->m_i186.intr.poll_status = 0x8000 | new_vector; |
| 347 | 347 | if (!state->m_i186.intr.pending) |
| 348 | | |
| 348 | | |
| 349 | 349 | state->m_i186.intr.pending = 1; |
| 350 | 350 | machine.scheduler().trigger(CPU_RESUME_TRIGGER); |
| 351 | 351 | if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n"); |
| r17813 | r17814 | |
|---|---|---|
| 979 | 979 | |
| 980 | 980 | static WRITE_LINE_DEVICE_HANDLER( pk8020_pic_set_int_line ) |
| 981 | 981 | { |
| 982 | | |
| 982 | | |
| 983 | 983 | } |
| 984 | 984 | |
| 985 | 985 | const struct pic8259_interface pk8020_pic8259_config = |
| r17813 | r17814 | |
|---|---|---|
| 100 | 100 | r.set(r1.min_x, r1.max_x, state->m_ula_scanline_count, state->m_ula_scanline_count); |
| 101 | 101 | bitmap.fill(1, r); |
| 102 | 102 | // logerror("ULA %3d[%d] NMI, R:$%02X, $%04x\n", machine.primary_screen->vpos(), ula_scancode_count, (unsigned) machine.device("maincpu")->state().state_int(Z80_R), (unsigned) machine.device("maincpu")->state().state_int(Z80_PC)); |
| 103 | cput | |
| 103 | machine.device("maincpu")->execute().set_input_line( | |
| 104 | 104 | if (++state->m_ula_scanline_count == height) |
| 105 | 105 | state->m_ula_scanline_count = 0; |
| 106 | 106 | } |
| r17813 | r17814 | |
| 119 | 119 | // logerror("ULA %3d[%d] IRQ, R:$%02X, $%04x\n", machine.primary_screen->vpos(), ula_scancode_count, (unsigned) machine.device("maincpu")->state().state_int(Z80_R), (unsigned) machine.device("maincpu")->state().state_int(Z80_PC)); |
| 120 | 120 | |
| 121 | 121 | state->m_ula_irq_active = 0; |
| 122 | cput | |
| 122 | machine.device("maincpu")->execute().set_input_line( | |
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 |
| r17813 | r17814 | |
|---|---|---|
| 1198 | 1198 | |
| 1199 | 1199 | static TIMER_CALLBACK( gb_video_init_vbl ) |
| 1200 | 1200 | { |
| 1201 | cput | |
| 1201 | machine.device("maincpu")->execute().set_input_line( | |
| 1202 | 1202 | } |
| 1203 | 1203 | |
| 1204 | 1204 | MACHINE_START( gb_video ) |
| r17813 | r17814 | |
| 1391 | 1391 | if ( ! state->m_lcd.line_irq && ! state->m_lcd.delayed_line_irq ) |
| 1392 | 1392 | { |
| 1393 | 1393 | state->m_lcd.mode_irq = 1; |
| 1394 | cput | |
| 1394 | machine.device("maincpu")->execute().set_input_line( | |
| 1395 | 1395 | } |
| 1396 | 1396 | } |
| 1397 | 1397 | else |
| r17813 | r17814 | |
| 1432 | 1432 | if ( ! state->m_lcd.mode_irq && ( LCDSTAT & 0x08 ) && |
| 1433 | 1433 | ( ( ! state->m_lcd.line_irq && state->m_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) |
| 1434 | 1434 | { |
| 1435 | cput | |
| 1435 | machine.device("maincpu")->execute().set_input_line( | |
| 1436 | 1436 | } |
| 1437 | 1437 | state->m_lcd.lcd_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(196 - state->m_lcd.scrollx_adjust - state->m_lcd.sprite_cycles), GB_LCD_STATE_LYXX_M0_PRE_INC); |
| 1438 | 1438 | break; |
| r17813 | r17814 | |
| 1448 | 1448 | if ( ! state->m_lcd.line_irq && ! state->m_lcd.delayed_line_irq ) |
| 1449 | 1449 | { |
| 1450 | 1450 | state->m_lcd.mode_irq = 1; |
| 1451 | cput | |
| 1451 | machine.device("maincpu")->execute().set_input_line( | |
| 1452 | 1452 | } |
| 1453 | 1453 | } |
| 1454 | 1454 | else |
| r17813 | r17814 | |
| 1467 | 1467 | if ( ! state->m_lcd.mode_irq && ! state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq && ! state->m_lcd.triggering_mode_irq ) |
| 1468 | 1468 | { |
| 1469 | 1469 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1470 | cput | |
| 1470 | machine.device("maincpu")->execute().set_input_line( | |
| 1471 | 1471 | } |
| 1472 | 1472 | /* Reset LY==LYC STAT bit */ |
| 1473 | 1473 | LCDSTAT &= 0xFB; |
| r17813 | r17814 | |
| 1485 | 1485 | ( ( ! state->m_lcd.triggering_line_irq && ! state->m_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) |
| 1486 | 1486 | { |
| 1487 | 1487 | state->m_lcd.mode_irq = 1; |
| 1488 | cput | |
| 1488 | machine.device("maincpu")->execute().set_input_line( | |
| 1489 | 1489 | } |
| 1490 | 1490 | state->m_lcd.lcd_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(4), GB_LCD_STATE_LYXX_M2); |
| 1491 | 1491 | } |
| r17813 | r17814 | |
| 1498 | 1498 | /* Generate lcd interrupt if requested */ |
| 1499 | 1499 | if ( ( LCDSTAT & 0x20 ) && ! state->m_lcd.line_irq ) |
| 1500 | 1500 | { |
| 1501 | cput | |
| 1501 | machine.device("maincpu")->execute().set_input_line( | |
| 1502 | 1502 | } |
| 1503 | 1503 | /* Check for regular compensation of x-scroll register */ |
| 1504 | 1504 | state->m_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| r17813 | r17814 | |
| 1513 | 1513 | if ( ( state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) || |
| 1514 | 1514 | ( ! state->m_lcd.mode_irq && ! state->m_lcd.line_irq && ! state->m_lcd.delayed_line_irq && state->m_lcd.triggering_mode_irq ) ) |
| 1515 | 1515 | { |
| 1516 | cput | |
| 1516 | machine.device("maincpu")->execute().set_input_line( | |
| 1517 | 1517 | } |
| 1518 | 1518 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1519 | 1519 | state->m_lcd.triggering_mode_irq = 0; |
| r17813 | r17814 | |
| 1543 | 1543 | if ( CURLINE == 144 ) |
| 1544 | 1544 | { |
| 1545 | 1545 | /* Trigger VBlank interrupt */ |
| 1546 | cput | |
| 1546 | machine.device("maincpu")->execute().set_input_line( | |
| 1547 | 1547 | /* Set VBlank lcdstate */ |
| 1548 | 1548 | state->m_lcd.mode = 1; |
| 1549 | 1549 | LCDSTAT = (LCDSTAT & 0xFC) | 0x01; |
| 1550 | 1550 | /* Trigger LCD interrupt if requested */ |
| 1551 | 1551 | if ( LCDSTAT & 0x10 ) |
| 1552 | 1552 | { |
| 1553 | cput | |
| 1553 | machine.device("maincpu")->execute().set_input_line( | |
| 1554 | 1554 | } |
| 1555 | 1555 | } |
| 1556 | 1556 | /* Check if LY==LYC STAT bit should be set */ |
| r17813 | r17814 | |
| 1560 | 1560 | } |
| 1561 | 1561 | if ( state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1562 | 1562 | { |
| 1563 | cput | |
| 1563 | machine.device("maincpu")->execute().set_input_line( | |
| 1564 | 1564 | } |
| 1565 | 1565 | state->m_lcd.lcd_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(452), GB_LCD_STATE_LY9X_M1_INC); |
| 1566 | 1566 | break; |
| r17813 | r17814 | |
| 1572 | 1572 | if ( ! state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1573 | 1573 | { |
| 1574 | 1574 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1575 | cput | |
| 1575 | machine.device("maincpu")->execute().set_input_line( | |
| 1576 | 1576 | } |
| 1577 | 1577 | /* Reset LY==LYC STAT bit */ |
| 1578 | 1578 | LCDSTAT &= 0xFB; |
| r17813 | r17814 | |
| 1591 | 1591 | { |
| 1592 | 1592 | if ( state->m_lcd.triggering_line_irq ) |
| 1593 | 1593 | { |
| 1594 | cput | |
| 1594 | machine.device("maincpu")->execute().set_input_line( | |
| 1595 | 1595 | } |
| 1596 | 1596 | } |
| 1597 | 1597 | state->m_lcd.delayed_line_irq = state->m_lcd.delayed_line_irq | state->m_lcd.line_irq; |
| r17813 | r17814 | |
| 1609 | 1609 | if ( ! state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1610 | 1610 | { |
| 1611 | 1611 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1612 | cput | |
| 1612 | machine.device("maincpu")->execute().set_input_line( | |
| 1613 | 1613 | } |
| 1614 | 1614 | state->m_lcd.lcd_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(4), GB_LCD_STATE_LY00_M1_2); |
| 1615 | 1615 | break; |
| r17813 | r17814 | |
| 1617 | 1617 | if ( state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1618 | 1618 | { |
| 1619 | 1619 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1620 | cput | |
| 1620 | machine.device("maincpu")->execute().set_input_line( | |
| 1621 | 1621 | } |
| 1622 | 1622 | if ( CURLINE == CMPLINE ) |
| 1623 | 1623 | { |
| r17813 | r17814 | |
| 1664 | 1664 | if ( ! state->m_lcd.line_irq && ! state->m_lcd.delayed_line_irq ) |
| 1665 | 1665 | { |
| 1666 | 1666 | state->m_lcd.mode_irq = 1; |
| 1667 | cput | |
| 1667 | machine.device("maincpu")->execute().set_input_line( | |
| 1668 | 1668 | } |
| 1669 | 1669 | } |
| 1670 | 1670 | else |
| r17813 | r17814 | |
| 1706 | 1706 | if ( ! state->m_lcd.mode_irq && state->m_lcd.triggering_mode_irq && |
| 1707 | 1707 | ( ( ! state->m_lcd.line_irq && state->m_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) |
| 1708 | 1708 | { |
| 1709 | cput | |
| 1709 | machine.device("maincpu")->execute().set_input_line( | |
| 1710 | 1710 | state->m_lcd.triggering_mode_irq = 0; |
| 1711 | 1711 | } |
| 1712 | 1712 | if ( ( SCROLLX & 0x03 ) == 0x03 ) |
| r17813 | r17814 | |
| 1741 | 1741 | if ( ! state->m_lcd.line_irq && ! state->m_lcd.delayed_line_irq ) |
| 1742 | 1742 | { |
| 1743 | 1743 | state->m_lcd.mode_irq = 1; |
| 1744 | cput | |
| 1744 | machine.device("maincpu")->execute().set_input_line( | |
| 1745 | 1745 | } |
| 1746 | 1746 | } |
| 1747 | 1747 | else |
| r17813 | r17814 | |
| 1760 | 1760 | if ( ! state->m_lcd.mode_irq && ! state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) |
| 1761 | 1761 | { |
| 1762 | 1762 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1763 | cput | |
| 1763 | machine.device("maincpu")->execute().set_input_line( | |
| 1764 | 1764 | } |
| 1765 | 1765 | state->m_lcd.hdma_possible = 0; |
| 1766 | 1766 | /* Check if we're going into VBlank next */ |
| r17813 | r17814 | |
| 1777 | 1777 | ( ( ! state->m_lcd.triggering_line_irq && ! state->m_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) |
| 1778 | 1778 | { |
| 1779 | 1779 | state->m_lcd.mode_irq = 1; |
| 1780 | cput | |
| 1780 | machine.device("maincpu")->execute().set_input_line( | |
| 1781 | 1781 | } |
| 1782 | 1782 | state->m_lcd.lcd_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(4), GB_LCD_STATE_LYXX_M2); |
| 1783 | 1783 | } |
| r17813 | r17814 | |
| 1790 | 1790 | /* Generate lcd interrupt if requested */ |
| 1791 | 1791 | if ( ( LCDSTAT & 0x20 ) && ! state->m_lcd.line_irq ) |
| 1792 | 1792 | { |
| 1793 | cput | |
| 1793 | machine.device("maincpu")->execute().set_input_line( | |
| 1794 | 1794 | } |
| 1795 | 1795 | /* Check for regular compensation of x-scroll register */ |
| 1796 | 1796 | state->m_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| r17813 | r17814 | |
| 1805 | 1805 | if ( ( state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq && ! ( LCDSTAT & 0x20 ) ) || |
| 1806 | 1806 | ( !state->m_lcd.mode_irq && ! state->m_lcd.line_irq && ! state->m_lcd.delayed_line_irq && ( LCDSTAT & 0x20 ) ) ) |
| 1807 | 1807 | { |
| 1808 | cput | |
| 1808 | machine.device("maincpu")->execute().set_input_line( | |
| 1809 | 1809 | } |
| 1810 | 1810 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1811 | 1811 | /* Check if LY==LYC STAT bit should be set */ |
| r17813 | r17814 | |
| 1839 | 1839 | if ( CURLINE == 144 ) |
| 1840 | 1840 | { |
| 1841 | 1841 | /* Trigger VBlank interrupt */ |
| 1842 | cput | |
| 1842 | machine.device("maincpu")->execute().set_input_line( | |
| 1843 | 1843 | /* Set VBlank lcdstate */ |
| 1844 | 1844 | state->m_lcd.mode = 1; |
| 1845 | 1845 | LCDSTAT = (LCDSTAT & 0xFC) | 0x01; |
| 1846 | 1846 | /* Trigger LCD interrupt if requested */ |
| 1847 | 1847 | if ( LCDSTAT & 0x10 ) |
| 1848 | 1848 | { |
| 1849 | cput | |
| 1849 | machine.device("maincpu")->execute().set_input_line( | |
| 1850 | 1850 | } |
| 1851 | 1851 | } |
| 1852 | 1852 | /* Check if LY==LYC STAT bit should be set */ |
| r17813 | r17814 | |
| 1860 | 1860 | } |
| 1861 | 1861 | if ( state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1862 | 1862 | { |
| 1863 | cput | |
| 1863 | machine.device("maincpu")->execute().set_input_line( | |
| 1864 | 1864 | } |
| 1865 | 1865 | state->m_lcd.lcd_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(452), GB_LCD_STATE_LY9X_M1_INC); |
| 1866 | 1866 | break; |
| r17813 | r17814 | |
| 1872 | 1872 | if ( ! state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1873 | 1873 | { |
| 1874 | 1874 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1875 | cput | |
| 1875 | machine.device("maincpu")->execute().set_input_line( | |
| 1876 | 1876 | } |
| 1877 | 1877 | if ( state->m_lcd.current_line == 153 ) |
| 1878 | 1878 | { |
| r17813 | r17814 | |
| 1889 | 1889 | { |
| 1890 | 1890 | if ( state->m_lcd.triggering_line_irq ) |
| 1891 | 1891 | { |
| 1892 | cput | |
| 1892 | machine.device("maincpu")->execute().set_input_line( | |
| 1893 | 1893 | } |
| 1894 | 1894 | } |
| 1895 | 1895 | state->m_lcd.delayed_line_irq = state->m_lcd.delayed_line_irq | state->m_lcd.line_irq; |
| r17813 | r17814 | |
| 1911 | 1911 | if ( ! state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1912 | 1912 | { |
| 1913 | 1913 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1914 | cput | |
| 1914 | machine.device("maincpu")->execute().set_input_line( | |
| 1915 | 1915 | } |
| 1916 | 1916 | state->m_lcd.lcd_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(4), GB_LCD_STATE_LY00_M1_2); |
| 1917 | 1917 | break; |
| r17813 | r17814 | |
| 1919 | 1919 | if ( state->m_lcd.delayed_line_irq && state->m_lcd.triggering_line_irq ) |
| 1920 | 1920 | { |
| 1921 | 1921 | state->m_lcd.line_irq = state->m_lcd.triggering_line_irq; |
| 1922 | cput | |
| 1922 | machine.device("maincpu")->execute().set_input_line( | |
| 1923 | 1923 | } |
| 1924 | 1924 | if ( CURLINE == CMPLINE ) |
| 1925 | 1925 | { |
| r17813 | r17814 | |
| 1966 | 1966 | /* Generate lcd interrupt if requested */ |
| 1967 | 1967 | if ( LCDSTAT & 0x40 ) |
| 1968 | 1968 | { |
| 1969 | cput | |
| 1969 | machine.device("maincpu")->execute().set_input_line( | |
| 1970 | 1970 | } |
| 1971 | 1971 | } |
| 1972 | 1972 | state->m_lcd.state = GB_LCD_STATE_LY00_M2; |
| r17813 | r17814 | |
| 2061 | 2061 | ( ( LCDSTAT & 0x60 ) == 0x20 && ( data & 0x40 ) ) |
| 2062 | 2062 | ) ) |
| 2063 | 2063 | { |
| 2064 | cput | |
| 2064 | machine().device("maincpu")->execute().set_input_line( | |
| 2065 | 2065 | } |
| 2066 | 2066 | /* |
| 2067 | 2067 | - 0x20 -> 0x08/0x18/0x28/0x48 (mode 0, after m2int) - trigger |
| r17813 | r17814 | |
| 2070 | 2070 | */ |
| 2071 | 2071 | if ( m_lcd.mode_irq && m_lcd.mode == 0 ) |
| 2072 | 2072 | { |
| 2073 | cput | |
| 2073 | machine().device("maincpu")->execute().set_input_line( | |
| 2074 | 2074 | } |
| 2075 | 2075 | } |
| 2076 | 2076 | break; |
| r17813 | r17814 | |
| 2087 | 2087 | /* Generate lcd interrupt if requested */ |
| 2088 | 2088 | if ( LCDSTAT & 0x40 ) |
| 2089 | 2089 | { |
| 2090 | cput | |
| 2090 | machine().device("maincpu")->execute().set_input_line( | |
| 2091 | 2091 | } |
| 2092 | 2092 | } |
| 2093 | 2093 | } |
| r17813 | r17814 | |
| 2196 | 2196 | */ |
| 2197 | 2197 | if ( m_lcd.mode_irq && m_lcd.mode == 0 && ( LCDSTAT & 0x28 ) == 0x20 && ( data & 0x08 ) ) |
| 2198 | 2198 | { |
| 2199 | cput | |
| 2199 | machine().device("maincpu")->execute().set_input_line( | |
| 2200 | 2200 | } |
| 2201 | 2201 | /* Check if line irqs are being disabled */ |
| 2202 | 2202 | if ( ! ( data & 0x40 ) ) |
| r17813 | r17814 | |
| 2209 | 2209 | if ( CMPLINE == CURLINE ) |
| 2210 | 2210 | { |
| 2211 | 2211 | m_lcd.line_irq = 1; |
| 2212 | cput | |
| 2212 | machine().device("maincpu")->execute().set_input_line( | |
| 2213 | 2213 | } |
| 2214 | 2214 | } |
| 2215 | 2215 | } |
| r17813 | r17814 | |
| 2224 | 2224 | /* Generate lcd interrupt if requested */ |
| 2225 | 2225 | if ( LCDSTAT & 0x40 ) |
| 2226 | 2226 | { |
| 2227 | cput | |
| 2227 | machine().device("maincpu")->execute().set_input_line( | |
| 2228 | 2228 | } |
| 2229 | 2229 | } |
| 2230 | 2230 | else |
| r17813 | r17814 | |
|---|---|---|
| 1277 | 1277 | state->m_mfp.isra = 0; |
| 1278 | 1278 | state->m_mfp.isrb = 0; |
| 1279 | 1279 | // mfp_trigger_irq(MFP_IRQ_GPIP6); |
| 1280 | // cput | |
| 1280 | // machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 1281 | 1281 | } |
| 1282 | 1282 | if(screen.machine().input().code_pressed(KEYCODE_9)) |
| 1283 | 1283 | { |
| r17813 | r17814 | |
|---|---|---|
| 151 | 151 | case 0xa1: |
| 152 | 152 | data = m_control_status; |
| 153 | 153 | m_iff = 0; |
| 154 | cput | |
| 154 | machine().device("maincpu")->execute().set_input_line( | |
| 155 | 155 | m_control_status &= ~ 0x08; |
| 156 | 156 | if ( machine().primary_screen->hpos() < I824X_START_ACTIVE_SCAN || machine().primary_screen->hpos() > I824X_END_ACTIVE_SCAN ) |
| 157 | 157 | { |
| r17813 | r17814 | |
| 538 | 538 | state->m_control_status |= 0x08; |
| 539 | 539 | if ( ! state->m_iff ) |
| 540 | 540 | { |
| 541 | cput | |
| 541 | machine.device("maincpu")->execute().set_input_line( | |
| 542 | 542 | state->m_iff = 1; |
| 543 | 543 | } |
| 544 | 544 | } |
| r17813 | r17814 | |
| 659 | 659 | /* Throw an interrupt if enabled */ |
| 660 | 660 | if( state->m_o2_vdc.s.control & 0x4 ) |
| 661 | 661 | { |
| 662 | | |
| 662 | | |
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | /* Adjust volume */ |
| r17813 | r17814 | |
|---|---|---|
| 77 | 77 | // every other PRD triggers a DMAOUT request |
| 78 | 78 | if (driver_state->m_dma) |
| 79 | 79 | { |
| 80 | | |
| 80 | | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | driver_state->m_dma = !driver_state->m_dma; |
| r17813 | r17814 | |
|---|---|---|
| 596 | 596 | |
| 597 | 597 | if (state->m_irq_pause>10) |
| 598 | 598 | { |
| 599 | | |
| 599 | | |
| 600 | 600 | state->m_irq_pause = 0; |
| 601 | 601 | } |
| 602 | 602 | |
| r17813 | r17814 | |
| 642 | 642 | (state->m_video.sprites[1].finished_now) | |
| 643 | 643 | (state->m_video.sprites[0].finished_now)) && (!state->m_irq_pause)) |
| 644 | 644 | { |
| 645 | cput | |
| 645 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 646 | 646 | state->m_irq_pause=1; |
| 647 | 647 | } |
| 648 | 648 | } |
| r17813 | r17814 | |
|---|---|---|
| 39 | 39 | if(data & 0x80) |
| 40 | 40 | m_video.sub_busy = data & 0x80; |
| 41 | 41 | |
| 42 | c | |
| 42 | machine().device("sub")->execute().set_input_line( | |
| 43 | 43 | if(data & 0x40) |
| 44 | c | |
| 44 | machine().device("sub")->execute().set_input_line( | |
| 45 | 45 | //popmessage("Sub CPU Interface write: %02x\n",data); |
| 46 | 46 | } |
| 47 | 47 | |
| r17813 | r17814 | |
| 63 | 63 | */ |
| 64 | 64 | READ8_MEMBER(fm7_state::fm7_cancel_ack) |
| 65 | 65 | { |
| 66 | c | |
| 66 | machine().device("sub")->execute().set_input_line( | |
| 67 | 67 | return 0x00; |
| 68 | 68 | } |
| 69 | 69 | |
| r17813 | r17814 | |
| 73 | 73 | READ8_MEMBER(fm7_state::fm7_attn_irq_r) |
| 74 | 74 | { |
| 75 | 75 | m_video.attn_irq = 1; |
| 76 | cput | |
| 76 | machine().device("maincpu")->execute().set_input_line( | |
| 77 | 77 | return 0xff; |
| 78 | 78 | } |
| 79 | 79 | |
| r17813 | r17814 | |
| 1177 | 1177 | break; |
| 1178 | 1178 | } |
| 1179 | 1179 | // reset sub CPU, set busy flag, set reset flag |
| 1180 | c | |
| 1180 | machine().device("sub")->execute().set_input_line( | |
| 1181 | 1181 | m_video.sub_busy = 0x80; |
| 1182 | 1182 | m_video.sub_halt = 0; |
| 1183 | 1183 | m_video.sub_reset = 1; |
| r17813 | r17814 | |
|---|---|---|
| 405 | 405 | LOAD_REG(cpu, Z80_IFF2, data); |
| 406 | 406 | |
| 407 | 407 | intr = BIT(status, 4) ? ASSERT_LINE : CLEAR_LINE; |
| 408 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 409 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 408 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 409 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 410 | 410 | |
| 411 | 411 | data = BIT(status, 5); |
| 412 | 412 | state->m_flash_invert = data; |
| r17813 | r17814 | |
| 583 | 583 | LOAD_REG(cpu, Z80_IFF2, BIT(data, 2)); |
| 584 | 584 | |
| 585 | 585 | intr = BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE; |
| 586 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 587 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 586 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 587 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 588 | 588 | |
| 589 | 589 | if (snapsize == SNA48_SIZE) |
| 590 | 590 | /* 48K Snapshot */ |
| r17813 | r17814 | |
| 796 | 796 | LOAD_REG(cpu, Z80_IFF2, data); |
| 797 | 797 | |
| 798 | 798 | intr = snapdata[ACH_OFFSET + 191] ? CLEAR_LINE : ASSERT_LINE; |
| 799 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 800 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 799 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 800 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 801 | 801 | |
| 802 | 802 | logerror("Skipping the 16K ROM dump at offset:%04X\n", ACH_OFFSET + 256); |
| 803 | 803 | |
| r17813 | r17814 | |
| 928 | 928 | LOAD_REG(cpu, Z80_IFF2, BIT(data, 2)); |
| 929 | 929 | |
| 930 | 930 | intr = BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE; |
| 931 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 932 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 931 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 932 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 933 | 933 | |
| 934 | 934 | data = space->read_byte(addr + 1); |
| 935 | 935 | LOAD_REG(cpu, Z80_R, data); |
| r17813 | r17814 | |
| 1130 | 1130 | LOAD_REG(cpu, Z80_IFF2, BIT(data, 2)); |
| 1131 | 1131 | |
| 1132 | 1132 | intr = BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE; |
| 1133 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 1134 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1133 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 1134 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1135 | 1135 | |
| 1136 | 1136 | data = space->read_byte(addr + 1); |
| 1137 | 1137 | LOAD_REG(cpu, Z80_R, data); |
| r17813 | r17814 | |
| 1267 | 1267 | LOAD_REG(cpu, Z80_IFF2, BIT(data, 0)); |
| 1268 | 1268 | |
| 1269 | 1269 | intr = BIT(snapdata[SEM_OFFSET + 30], 0) ? CLEAR_LINE : ASSERT_LINE; |
| 1270 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 1271 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1270 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 1271 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1272 | 1272 | |
| 1273 | 1273 | /* Memory dump */ |
| 1274 | 1274 | logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM); |
| r17813 | r17814 | |
| 1385 | 1385 | LOAD_REG(cpu, Z80_IFF2, data); |
| 1386 | 1386 | |
| 1387 | 1387 | intr = data ? CLEAR_LINE : ASSERT_LINE; |
| 1388 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 1389 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1388 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 1389 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1390 | 1390 | |
| 1391 | 1391 | /* Memory dump */ |
| 1392 | 1392 | logerror("Skipping the 16K ROM dump at offset:%04X\n", SIT_OFFSET + 28); |
| r17813 | r17814 | |
| 1530 | 1530 | LOAD_REG(cpu, Z80_IFF2, data); |
| 1531 | 1531 | |
| 1532 | 1532 | intr = BIT(snapdata[ZX_OFFSET + 142], 0) ? CLEAR_LINE : ASSERT_LINE; |
| 1533 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 1534 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1533 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 1534 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1535 | 1535 | |
| 1536 | 1536 | /* Memory dump */ |
| 1537 | 1537 | logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM); |
| r17813 | r17814 | |
| 1648 | 1648 | LOAD_REG(cpu, Z80_IFF2, data); |
| 1649 | 1649 | |
| 1650 | 1650 | intr = BIT(snapdata[SNP_OFFSET + 19], 0) ? CLEAR_LINE : ASSERT_LINE; |
| 1651 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 1652 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1651 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 1652 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1653 | 1653 | |
| 1654 | 1654 | /* Memory dump */ |
| 1655 | 1655 | logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM); |
| r17813 | r17814 | |
| 1878 | 1878 | LOAD_REG(cpu, Z80_IFF2, BIT(data, 2)); |
| 1879 | 1879 | |
| 1880 | 1880 | intr = BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE; |
| 1881 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 1882 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 1881 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 1882 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1883 | 1883 | |
| 1884 | 1884 | /* Memory dump */ |
| 1885 | 1885 | logerror("Uncompressing %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM); |
| r17813 | r17814 | |
| 2035 | 2035 | LOAD_REG(cpu, Z80_IFF2, BIT(data, 2)); |
| 2036 | 2036 | |
| 2037 | 2037 | intr = BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE; |
| 2038 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, intr); | |
| 2039 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 2038 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr); | |
| 2039 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 2040 | 2040 | |
| 2041 | 2041 | /* Memory dump */ |
| 2042 | 2042 | addr = 0; |
| r17813 | r17814 | |
| 2301 | 2301 | /* machine.device("maincpu")->state().set_state_int(Z80_IRQ_STATE, 1); */ |
| 2302 | 2302 | } |
| 2303 | 2303 | |
| 2304 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 2305 | // cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, data); | |
| 2306 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); | |
| 2304 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 2305 | // machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, data); | |
| 2306 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 2307 | 2307 | |
| 2308 | 2308 | /* IFF2 */ |
| 2309 | 2309 | if (snapdata[28] != 0) |
| r17813 | r17814 | |
|---|---|---|
| 483 | 483 | |
| 484 | 484 | static TIMER_CALLBACK( keyboard_timer ) |
| 485 | 485 | { |
| 486 | cputag_set_input_line(machine, "maincpu", HD61700_KEY_INT, ASSERT_LINE); | |
| 487 | cputag_set_input_line(machine, "maincpu", HD61700_KEY_INT, CLEAR_LINE); | |
| 486 | machine.device("maincpu")->execute().set_input_line(HD61700_KEY_INT, ASSERT_LINE); | |
| 487 | machine.device("maincpu")->execute().set_input_line(HD61700_KEY_INT, CLEAR_LINE); | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | void pb1000_state::machine_start() |
| r17813 | r17814 | |
|---|---|---|
| 1373 | 1373 | { |
| 1374 | 1374 | state->m_io_status &= ~io_st_tyi; |
| 1375 | 1375 | if (USE_SBS) |
| 1376 | cput | |
| 1376 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1377 | 1377 | } |
| 1378 | 1378 | } |
| 1379 | 1379 | |
| r17813 | r17814 | |
| 1735 | 1735 | state->m_typewriter.tb = (i << 4) + j; |
| 1736 | 1736 | state->m_io_status |= io_st_tyi; |
| 1737 | 1737 | #if USE_SBS |
| 1738 | cput | |
| 1738 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 1739 | 1739 | #endif |
| 1740 | 1740 | machine.device("maincpu")->state().set_state_int(PDP1_PF1, 1); |
| 1741 | 1741 | pdp1_typewriter_drawchar(machine, state->m_typewriter.tb); /* we want to echo input */ |
| r17813 | r17814 | |
|---|---|---|
| 199 | 199 | /* Devices */ |
| 200 | 200 | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 201 | 201 | { |
| 202 | cputag_set_input_line_and_vector(device->machine(), "maincpu", M68K_IRQ_6, state, M68K_INT_ACK_AUTOVECTOR); | |
| 203 | //cputag_set_input_line_and_vector(device->machine(), "maincpu", M68K_IRQ_6, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 204 | //cputag_set_input_line_and_vector(device->machine(), "maincpu", M68K_IRQ_6, HOLD_LINE, vector); | |
| 202 | device->machine().device("maincpu")->execute().set_input_line_and_vector(M68K_IRQ_6, state, M68K_INT_ACK_AUTOVECTOR); | |
| 203 | //device->machine().device("maincpu")->execute().set_input_line_and_vector(M68K_IRQ_6, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); | |
| 204 | //device->machine().device("maincpu")->execute().set_input_line_and_vector(M68K_IRQ_6, HOLD_LINE, vector); | |
| 205 | 205 | }; |
| 206 | 206 | |
| 207 | 207 | static UINT8 duart_input(device_t *device) |
| r17813 | r17814 | |
| 249 | 249 | dectalk_state *state = machine.driver_data<dectalk_state>(); |
| 250 | 250 | // check if output fifo is full; if it isn't, set the int on the dsp |
| 251 | 251 | if (((state->m_outfifo_head_ptr-1)&0xF) != state->m_outfifo_tail_ptr) |
| 252 | cput | |
| 252 | machine.device("dsp")->execute().set_input_line( | |
| 253 | 253 | else |
| 254 | cput | |
| 254 | machine.device("dsp")->execute().set_input_line( | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | static void dectalk_clear_all_fifos( running_machine &machine ) |
| r17813 | r17814 | |
| 300 | 300 | #ifdef VERBOSE |
| 301 | 301 | logerror("speech int fired!\n"); |
| 302 | 302 | #endif |
| 303 | cput | |
| 303 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 304 | 304 | } |
| 305 | 305 | else |
| 306 | cput | |
| 306 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | // read the output fifo and set the interrupt line active on the dsp |
| r17813 | r17814 | |
| 336 | 336 | dectalk_clear_all_fifos(device->machine()); // speech reset clears the fifos, though we have to do it explicitly here since we're not actually in the m68k_spcflags_w function. |
| 337 | 337 | dectalk_semaphore_w(device->machine(), 0); // on the original state->m_dectalk pcb revision, this is a semaphore for the INPUT fifo, later dec hacked on a check for the 3 output fifo chips to see if they're in sync, and set both of these latches if true. |
| 338 | 338 | state->m_spc_error_latch = 0; // spc error latch is cleared on /reset |
| 339 | | |
| 339 | | |
| 340 | 340 | state->m_tlc_tonedetect = 0; // TODO, needed for selftest pass |
| 341 | 341 | state->m_tlc_ringdetect = 0; // TODO |
| 342 | 342 | state->m_tlc_dtmf = 0; // TODO |
| r17813 | r17814 | |
| 432 | 432 | logerror(" | 0x01: initialize speech: fifos reset, clear error+semaphore latches and dsp reset\n"); |
| 433 | 433 | #endif |
| 434 | 434 | dectalk_clear_all_fifos(machine()); |
| 435 | cput | |
| 435 | machine().device("dsp")->execute().set_input_line( | |
| 436 | 436 | // clear the two speech side latches |
| 437 | 437 | m_spc_error_latch = 0; |
| 438 | 438 | dectalk_semaphore_w(machine(), 0); |
| r17813 | r17814 | |
| 442 | 442 | #ifdef SPC_LOG_68K |
| 443 | 443 | logerror(" | 0x01 = 0: initialize speech off, dsp running\n"); |
| 444 | 444 | #endif |
| 445 | cput | |
| 445 | machine().device("dsp")->execute().set_input_line( | |
| 446 | 446 | } |
| 447 | 447 | if ((data&0x2) == 0x2) // bit 1 - clear error and semaphore latches |
| 448 | 448 | { |
| r17813 | r17814 | |
| 463 | 463 | #ifdef SPC_LOG_68K |
| 464 | 464 | logerror(" speech int fired!\n"); |
| 465 | 465 | #endif |
| 466 | cput | |
| 466 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | else // data&0x40 == 0 |
| r17813 | r17814 | |
| 471 | 471 | #ifdef SPC_LOG_68K |
| 472 | 472 | logerror(" | 0x40 = 0: speech int disabled\n"); |
| 473 | 473 | #endif |
| 474 | cput | |
| 474 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
| r17813 | r17814 | |
| 503 | 503 | #ifdef TLC_LOG |
| 504 | 504 | logerror(" TLC int fired!\n"); |
| 505 | 505 | #endif |
| 506 | cput | |
| 506 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | else // data&0x40 == 0 |
| r17813 | r17814 | |
| 512 | 512 | logerror(" | 0x40 = 0: tone detect int disabled\n"); |
| 513 | 513 | #endif |
| 514 | 514 | if (((data&0x4000)!=0x4000) || (m_tlc_ringdetect == 0)) // check to be sure we don't disable int if both ints fired at once |
| 515 | cput | |
| 515 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 516 | 516 | } |
| 517 | 517 | if ((data&0x100) == 0x100) // bit 8: answer phone relay enable |
| 518 | 518 | { |
| r17813 | r17814 | |
| 536 | 536 | #ifdef TLC_LOG |
| 537 | 537 | logerror(" TLC int fired!\n"); |
| 538 | 538 | #endif |
| 539 | cput | |
| 539 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 540 | 540 | } |
| 541 | 541 | } |
| 542 | 542 | else // data&0x4000 == 0 |
| r17813 | r17814 | |
| 545 | 545 | logerror(" | 0x4000 = 0: ring detect int disabled\n"); |
| 546 | 546 | #endif |
| 547 | 547 | if (((data&0x40)!=0x40) || (m_tlc_tonedetect == 0)) // check to be sure we don't disable int if both ints fired at once |
| 548 | cput | |
| 548 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | |
| r17813 | r17814 | |
| 593 | 593 | #ifdef SPC_LOG_DSP |
| 594 | 594 | logerror("dsp: SPC outfifo write, data = %04X, fifo head was: %02X; fifo tail: %02X\n", data, m_outfifo_head_ptr, m_outfifo_tail_ptr); |
| 595 | 595 | #endif |
| 596 | cput | |
| 596 | machine().device("dsp")->execute().set_input_line( | |
| 597 | 597 | // if fifo is full (head ptr = tail ptr-1), do not increment the head ptr and do not store the data |
| 598 | 598 | if (((m_outfifo_tail_ptr-1)&0xF) == m_outfifo_head_ptr) |
| 599 | 599 | { |
| r17813 | r17814 | |
|---|---|---|
| 317 | 317 | WRITE_LINE_MEMBER( pc100_state::pc100_set_int_line ) |
| 318 | 318 | { |
| 319 | 319 | //printf("%02x\n",interrupt); |
| 320 | cput | |
| 320 | machine().device("maincpu")->execute().set_input_line( | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | static const struct pic8259_interface pc100_pic8259_config = |
| r17813 | r17814 | |
|---|---|---|
| 1325 | 1325 | /* reset POR bit, TODO: is there any other way? */ |
| 1326 | 1326 | por = machine().device<i8255_device>("ppi8255_sys")->read(space, 2) & ~0x20; |
| 1327 | 1327 | machine().device<i8255_device>("ppi8255_sys")->write(space, 2,por); |
| 1328 | cput | |
| 1328 | machine().device("maincpu")->execute().set_input_line( | |
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | 1331 | if(offset == 0x02) |
| r17813 | r17814 | |
| 2194 | 2194 | static WRITE_LINE_DEVICE_HANDLER( pc9801_master_set_int_line ) |
| 2195 | 2195 | { |
| 2196 | 2196 | //printf("%02x\n",interrupt); |
| 2197 | | |
| 2197 | | |
| 2198 | 2198 | } |
| 2199 | 2199 | |
| 2200 | 2200 | static READ8_DEVICE_HANDLER( get_slave_ack ) |
| r17813 | r17814 | |
| 2271 | 2271 | |
| 2272 | 2272 | static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed ) |
| 2273 | 2273 | { |
| 2274 | | |
| 2274 | | |
| 2275 | 2275 | |
| 2276 | 2276 | /* Assert HLDA */ |
| 2277 | 2277 | i8237_hlda_w( device, state ); |
| r17813 | r17814 | |
|---|---|---|
| 691 | 691 | { |
| 692 | 692 | state->m_ipl_enable = 0; |
| 693 | 693 | /* correct? */ |
| 694 | | |
| 694 | | |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | beep_set_state(device->machine().device(BEEPER_TAG),data & 0x04); |
| r17813 | r17814 | |
|---|---|---|
| 600 | 600 | |
| 601 | 601 | WRITE_LINE_MEMBER( z100_state::z100_pic_irq ) |
| 602 | 602 | { |
| 603 | cput | |
| 603 | machine().device("maincpu")->execute().set_input_line( | |
| 604 | 604 | // logerror("PIC#1: set IRQ line to %i\n",interrupt); |
| 605 | 605 | } |
| 606 | 606 |
| r17813 | r17814 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | READ8_MEMBER( tec1_state::tec1_kbd_r ) |
| 190 | 190 | { |
| 191 | cput | |
| 191 | machine().device("maincpu")->execute().set_input_line( | |
| 192 | 192 | return m_kbd | ioport("SHIFT")->read(); |
| 193 | 193 | } |
| 194 | 194 | |
| r17813 | r17814 | |
| 250 | 250 | if (machine.root_device().ioport(keynames[state->m_kbd_row])->read()) |
| 251 | 251 | { |
| 252 | 252 | state->m_kbd = state->tec1_convert_col_to_bin(machine.root_device().ioport(keynames[state->m_kbd_row])->read(), state->m_kbd_row); |
| 253 | cput | |
| 253 | machine.device("maincpu")->execute().set_input_line( | |
| 254 | 254 | state->m_key_pressed = TRUE; |
| 255 | 255 | } |
| 256 | 256 | else |
| r17813 | r17814 | |
|---|---|---|
| 121 | 121 | WRITE_LINE_MEMBER( multi16_state::multi16_set_int_line ) |
| 122 | 122 | { |
| 123 | 123 | //printf("%02x\n",interrupt); |
| 124 | cput | |
| 124 | machine().device("maincpu")->execute().set_input_line( | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static const struct pic8259_interface multi16_pic8259_config = |
| r17813 | r17814 | |
|---|---|---|
| 1505 | 1505 | |
| 1506 | 1506 | if (state && !driver_state->m_vdp_nmi) |
| 1507 | 1507 | { |
| 1508 | | |
| 1508 | | |
| 1509 | 1509 | } |
| 1510 | 1510 | |
| 1511 | 1511 | driver_state->m_vdp_nmi = state; |
| r17813 | r17814 | |
|---|---|---|
| 984 | 984 | */ |
| 985 | 985 | case 0x00: // FDC mode register |
| 986 | 986 | m_fdc_mode = data & 1; |
| 987 | cput | |
| 987 | machine().device("fdccpu")->execute().set_input_line( | |
| 988 | 988 | break; |
| 989 | 989 | /* |
| 990 | 990 | --x- ---- CLK: FDC clock selection (0) 4.8MHz (1) 8 MHz |
| r17813 | r17814 | |
| 1499 | 1499 | |
| 1500 | 1500 | static WRITE_LINE_DEVICE_HANDLER( pc88va_pic_irq ) |
| 1501 | 1501 | { |
| 1502 | | |
| 1502 | | |
| 1503 | 1503 | // logerror("PIC#1: set IRQ line to %i\n",interrupt); |
| 1504 | 1504 | } |
| 1505 | 1505 | |
| r17813 | r17814 | |
| 1626 | 1626 | if(drvstate->m_fdc_mode) |
| 1627 | 1627 | pic8259_ir3_w(device->machine().device( "pic8259_slave"), state); |
| 1628 | 1628 | else |
| 1629 | | |
| 1629 | | |
| 1630 | 1630 | }; |
| 1631 | 1631 | |
| 1632 | 1632 | static const struct upd765_interface pc88va_upd765_interface = |
| r17813 | r17814 | |
|---|---|---|
| 759 | 759 | //machine().device(CASSETTE_TAG )->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); |
| 760 | 760 | //machine().device(CASSETTE_TAG )->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE); |
| 761 | 761 | //m_irq_vector = 0x00; |
| 762 | //cput | |
| 762 | //machine().device("maincpu")->execute().set_input_line( | |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | m_sys_latch = data; |
| r17813 | r17814 | |
| 1245 | 1245 | //machine().device(CASSETTE_TAG )->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); |
| 1246 | 1246 | //machine().device(CASSETTE_TAG )->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE); |
| 1247 | 1247 | //m_irq_vector = 0x00; |
| 1248 | //cput | |
| 1248 | //machine().device("maincpu")->execute().set_input_line( | |
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | m_sys_latch = data; |
| r17813 | r17814 | |
| 1355 | 1355 | { |
| 1356 | 1356 | if(IRQ_LOG) printf("Timer IRQ called %02x\n",state->m_timer_irq_vector); |
| 1357 | 1357 | state->m_irq_vector = state->m_timer_irq_vector; |
| 1358 | cput | |
| 1358 | machine.device("maincpu")->execute().set_input_line( | |
| 1359 | 1359 | } |
| 1360 | 1360 | } |
| 1361 | 1361 | |
| r17813 | r17814 | |
| 1591 | 1591 | //machine().device(CASSETTE_TAG )->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); |
| 1592 | 1592 | //machine().device(CASSETTE_TAG )->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE); |
| 1593 | 1593 | //m_irq_vector = 0x00; |
| 1594 | //cput | |
| 1594 | //machine().device("maincpu")->execute().set_input_line( | |
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | 1597 | m_sys_latch = data; |
| r17813 | r17814 | |
| 2032 | 2032 | cas_data_i = 0x80; |
| 2033 | 2033 | /* data ready, poll irq */ |
| 2034 | 2034 | state->m_irq_vector = 0x08; |
| 2035 | | |
| 2035 | | |
| 2036 | 2036 | } |
| 2037 | 2037 | else |
| 2038 | 2038 | cas_data_i>>=1; |
| r17813 | r17814 | |
| 2047 | 2047 | state->m_cas_switch = 0; |
| 2048 | 2048 | if(IRQ_LOG) printf("Tape-E IRQ 0x12\n"); |
| 2049 | 2049 | state->m_irq_vector = 0x12; |
| 2050 | | |
| 2050 | | |
| 2051 | 2051 | } |
| 2052 | 2052 | else |
| 2053 | 2053 | { |
| 2054 | 2054 | if(IRQ_LOG) printf("Tape-D IRQ 0x08\n"); |
| 2055 | 2055 | state->m_irq_vector = 0x08; |
| 2056 | | |
| 2056 | | |
| 2057 | 2057 | } |
| 2058 | 2058 | #endif |
| 2059 | 2059 | } |
| r17813 | r17814 | |
| 2075 | 2075 | state->m_cur_keycode = check_keyboard_press(space->machine()); |
| 2076 | 2076 | if(IRQ_LOG) printf("KEY IRQ 0x02\n"); |
| 2077 | 2077 | state->m_irq_vector = 0x02; |
| 2078 | | |
| 2078 | | |
| 2079 | 2079 | state->m_old_key1 = key1; |
| 2080 | 2080 | state->m_old_key2 = key2; |
| 2081 | 2081 | state->m_old_key3 = key3; |
| r17813 | r17814 | |
| 2087 | 2087 | if(state->m_cur_keycode) |
| 2088 | 2088 | { |
| 2089 | 2089 | state->m_irq_vector = 0x16; |
| 2090 | | |
| 2090 | | |
| 2091 | 2091 | } |
| 2092 | 2092 | } |
| 2093 | 2093 | #endif |
| r17813 | r17814 | |
|---|---|---|
| 502 | 502 | VII_VIDEO_IRQ_STATUS &= ~data; |
| 503 | 503 | if(!VII_VIDEO_IRQ_STATUS) |
| 504 | 504 | { |
| 505 | cput | |
| 505 | machine().device("maincpu")->execute().set_input_line( | |
| 506 | 506 | } |
| 507 | 507 | break; |
| 508 | 508 | |
| r17813 | r17814 | |
| 743 | 743 | COMBINE_DATA(&VII_CTLR_IRQ_ENABLE); |
| 744 | 744 | if(!VII_CTLR_IRQ_ENABLE) |
| 745 | 745 | { |
| 746 | cput | |
| 746 | machine().device("maincpu")->execute().set_input_line( | |
| 747 | 747 | } |
| 748 | 748 | break; |
| 749 | 749 | |
| r17813 | r17814 | |
| 752 | 752 | m_io_regs[0x22] &= ~data; |
| 753 | 753 | if(!m_io_regs[0x22]) |
| 754 | 754 | { |
| 755 | cput | |
| 755 | machine().device("maincpu")->execute().set_input_line( | |
| 756 | 756 | } |
| 757 | 757 | break; |
| 758 | 758 | |
| r17813 | r17814 | |
| 1045 | 1045 | if(state->VII_VIDEO_IRQ_STATUS) |
| 1046 | 1046 | { |
| 1047 | 1047 | verboselog(device->machine(), 0, "Video IRQ\n"); |
| 1048 | | |
| 1048 | | |
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | 1051 | // { |
| 1052 | 1052 | // verboselog(device->machine(), 0, "audio 1 IRQ\n"); |
| 1053 | // | |
| 1053 | // | |
| 1054 | 1054 | // } |
| 1055 | 1055 | if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x0c00) |
| 1056 | 1056 | { |
| 1057 | 1057 | verboselog(device->machine(), 0, "timerA, timer B IRQ\n"); |
| 1058 | | |
| 1058 | | |
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | 1061 | //if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x2100) |
| r17813 | r17814 | |
| 1063 | 1063 | if(state->VII_CTLR_IRQ_ENABLE) |
| 1064 | 1064 | { |
| 1065 | 1065 | verboselog(device->machine(), 0, "UART, ADC IRQ\n"); |
| 1066 | | |
| 1066 | | |
| 1067 | 1067 | } |
| 1068 | 1068 | // { |
| 1069 | 1069 | // verboselog(device->machine(), 0, "audio 4 IRQ\n"); |
| 1070 | // | |
| 1070 | // | |
| 1071 | 1071 | // } |
| 1072 | 1072 | |
| 1073 | 1073 | if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x1200) |
| 1074 | 1074 | { |
| 1075 | 1075 | verboselog(device->machine(), 0, "External IRQ\n"); |
| 1076 | | |
| 1076 | | |
| 1077 | 1077 | } |
| 1078 | 1078 | if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x0070) |
| 1079 | 1079 | { |
| 1080 | 1080 | verboselog(device->machine(), 0, "1024Hz, 2048HZ, 4096HZ IRQ\n"); |
| 1081 | | |
| 1081 | | |
| 1082 | 1082 | } |
| 1083 | 1083 | if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x008b) |
| 1084 | 1084 | { |
| 1085 | 1085 | verboselog(device->machine(), 0, "TMB1, TMB2, 4Hz, key change IRQ\n"); |
| 1086 | | |
| 1086 | | |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | 1089 | } |
| r17813 | r17814 | |
|---|---|---|
| 87 | 87 | fprintf(stderr,"kb input fifo fullness: %d\n",(state->m_infifo_head_ptr-state->m_infifo_tail_ptr)&0x1F); |
| 88 | 88 | #endif |
| 89 | 89 | // todo: following two should be set so clear happens after one cpu cycle |
| 90 | cputag_set_input_line(device->machine(), "maincpu", MCS51_RX_LINE, ASSERT_LINE); | |
| 91 | cputag_set_input_line(device->machine(), "maincpu", MCS51_RX_LINE, CLEAR_LINE); | |
| 90 | device->machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, ASSERT_LINE); | |
| 91 | device->machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, CLEAR_LINE); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static GENERIC_TERMINAL_INTERFACE( pes_terminal_intf ) |
| r17813 | r17814 | |
| 217 | 217 | m_rsstate = 1; |
| 218 | 218 | |
| 219 | 219 | m_port3_state = 0; // reset the openbus state of port 3 |
| 220 | //cput | |
| 220 | //machine.device("maincpu")->execute().set_input_line( | |
| 221 | 221 | devtag_reset(machine(), "tms5220"); // reset the 5220 |
| 222 | 222 | } |
| 223 | 223 |
| r17813 | r17814 | |
|---|---|---|
| 168 | 168 | { |
| 169 | 169 | device_set_input_line_vector(device->machine().device("maincpu"), F8_INPUT_LINE_INT_REQ, addr ); |
| 170 | 170 | |
| 171 | | |
| 171 | | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 |
| r17813 | r17814 | |
|---|---|---|
| 2426 | 2426 | state->x1_sub_io_w(*space,0,0xe6); |
| 2427 | 2427 | state->m_irq_vector = state->m_key_irq_vector; |
| 2428 | 2428 | state->m_key_irq_flag = 1; |
| 2429 | | |
| 2429 | | |
| 2430 | 2430 | state->m_old_key1 = key1; |
| 2431 | 2431 | state->m_old_key2 = key2; |
| 2432 | 2432 | state->m_old_key3 = key3; |
| r17813 | r17814 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | static TIMER_DEVICE_CALLBACK( update_nmi ) |
| 274 | 274 | { |
| 275 | | |
| 275 | | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | static TIMER_DEVICE_CALLBACK( update_nmi32 ) |
| 279 | 279 | { |
| 280 | | |
| 280 | | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | static MACHINE_START( glasgow ) |
| r17813 | r17814 | |
|---|---|---|
| 166 | 166 | WRITE8_MEMBER( fp1100_state::irq_mask_w ) |
| 167 | 167 | { |
| 168 | 168 | //if((irq_mask & 0x80) != (data & 0x80)) |
| 169 | // c | |
| 169 | // machine().device("sub")->execute().set_input_line( | |
| 170 | 170 | |
| 171 | 171 | irq_mask = data; |
| 172 | 172 | ///printf("%02x\n",data); |
| r17813 | r17814 | |
| 178 | 178 | WRITE8_MEMBER( fp1100_state::main_to_sub_w ) |
| 179 | 179 | { |
| 180 | 180 | machine().scheduler().synchronize(); // force resync |
| 181 | c | |
| 181 | machine().device("sub")->execute().set_input_line( | |
| 182 | 182 | m_sub_latch = data; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | READ8_MEMBER( fp1100_state::sub_to_main_r ) |
| 186 | 186 | { |
| 187 | 187 | machine().scheduler().synchronize(); // force resync |
| 188 | // cput | |
| 188 | // machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 189 | 189 | return m_main_latch; |
| 190 | 190 | } |
| 191 | 191 | |
| r17813 | r17814 | |
| 230 | 230 | READ8_MEMBER( fp1100_state::main_to_sub_r ) |
| 231 | 231 | { |
| 232 | 232 | machine().scheduler().synchronize(); // force resync |
| 233 | c | |
| 233 | machine().device("sub")->execute().set_input_line( | |
| 234 | 234 | return m_sub_latch; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | WRITE8_MEMBER( fp1100_state::sub_to_main_w ) |
| 238 | 238 | { |
| 239 | 239 | machine().scheduler().synchronize(); // force resync |
| 240 | // cput | |
| 240 | // machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 241 | 241 | m_main_latch = data; |
| 242 | 242 | } |
| 243 | 243 | |
| r17813 | r17814 | |
| 256 | 256 | WRITE8_MEMBER( fp1100_state::portc_w ) |
| 257 | 257 | { |
| 258 | 258 | if((!(m_upd7801.portc & 8)) && data & 8) |
| 259 | cput | |
| 259 | machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 260 | 260 | |
| 261 | 261 | m_upd7801.portc = data; |
| 262 | 262 | } |
| r17813 | r17814 | |
| 398 | 398 | fp1100_state *state = device->machine().driver_data<fp1100_state>(); |
| 399 | 399 | |
| 400 | 400 | if(state->irq_mask & 0x10) |
| 401 | cput | |
| 401 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | static MACHINE_CONFIG_START( fp1100, fp1100_state ) |
| r17813 | r17814 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | static INTERRUPT_GEN( gamecom_interrupt ) |
| 93 | 93 | { |
| 94 | | |
| 94 | | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static MACHINE_CONFIG_START( gamecom, gamecom_state ) |
| r17813 | r17814 | |
|---|---|---|
| 366 | 366 | |
| 367 | 367 | static TIMER_DEVICE_CALLBACK( set_irq ) |
| 368 | 368 | { |
| 369 | | |
| 369 | | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | |
| r17813 | r17814 | |
| 376 | 376 | |
| 377 | 377 | static TIMER_DEVICE_CALLBACK( clear_irq ) |
| 378 | 378 | { |
| 379 | | |
| 379 | | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 |
| r17813 | r17814 | |
|---|---|---|
| 278 | 278 | { |
| 279 | 279 | state->m_port_1ffd_data |= 0x02; |
| 280 | 280 | scorpion_update_memory(timer.machine()); |
| 281 | | |
| 281 | | |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 |
| r17813 | r17814 | |
|---|---|---|
| 291 | 291 | |
| 292 | 292 | static TIMER_CALLBACK(keyboard_callback) |
| 293 | 293 | { |
| 294 | cput | |
| 294 | machine.device("maincpu")->execute().set_input_line( | |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | static IRQ_CALLBACK(cat_int_ack) |
| 298 | 298 | { |
| 299 | | |
| 299 | | |
| 300 | 300 | return M68K_INT_ACK_AUTOVECTOR; |
| 301 | 301 | } |
| 302 | 302 |
| r17813 | r17814 | |
|---|---|---|
| 519 | 519 | |
| 520 | 520 | static WRITE_LINE_DEVICE_HANDLER(sg1000_vdp_interrupt) |
| 521 | 521 | { |
| 522 | | |
| 522 | | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | static TMS9928A_INTERFACE(sg1000_tms9918a_interface) |
| r17813 | r17814 | |
|---|---|---|
| 204 | 204 | // if it's not masked, also assert it now at the CPU |
| 205 | 205 | if (state->m_int3_regs[1] & source_mask) |
| 206 | 206 | { |
| 207 | cput | |
| 207 | machine.device("maincpu")->execute().set_input_line( | |
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | |
| r17813 | r17814 | |
| 225 | 225 | // if it's not masked, also assert it now at the CPU |
| 226 | 226 | if (state->m_int3_regs[2] & source_mask) |
| 227 | 227 | { |
| 228 | cput | |
| 228 | machine.device("maincpu")->execute().set_input_line( | |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| r17813 | r17814 | |
| 374 | 374 | // if no local0 interrupts now, clear the input to the CPU |
| 375 | 375 | if ((m_int3_regs[0] & m_int3_regs[1]) == 0) |
| 376 | 376 | { |
| 377 | cput | |
| 377 | machine().device("maincpu")->execute().set_input_line( | |
| 378 | 378 | } |
| 379 | 379 | else |
| 380 | 380 | { |
| 381 | cput | |
| 381 | machine().device("maincpu")->execute().set_input_line( | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | // if no local1 interrupts now, clear the input to the CPU |
| 385 | 385 | if ((m_int3_regs[2] & m_int3_regs[3]) == 0) |
| 386 | 386 | { |
| 387 | cput | |
| 387 | machine().device("maincpu")->execute().set_input_line( | |
| 388 | 388 | } |
| 389 | 389 | else |
| 390 | 390 | { |
| 391 | cput | |
| 391 | machine().device("maincpu")->execute().set_input_line( | |
| 392 | 392 | } |
| 393 | 393 | break; |
| 394 | 394 | case 0xb0/4: |
| r17813 | r17814 | |
|---|---|---|
| 204 | 204 | |
| 205 | 205 | static INTERRUPT_GEN( p2000_interrupt ) |
| 206 | 206 | { |
| 207 | | |
| 207 | | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 |
| r17813 | r17814 | |
|---|---|---|
| 142 | 142 | pcw_state *state = machine.driver_data<pcw_state>(); |
| 143 | 143 | // set NMI line, remains set until FDC interrupt type is changed |
| 144 | 144 | if(state->m_nmi_flag != 0) |
| 145 | cput | |
| 145 | machine.device("maincpu")->execute().set_input_line( | |
| 146 | 146 | else |
| 147 | cput | |
| 147 | machine.device("maincpu")->execute().set_input_line( | |
| 148 | 148 | |
| 149 | 149 | // set IRQ line, timer pulses IRQ line, all other devices hold it as necessary |
| 150 | 150 | if(state->m_fdc_interrupt_code == 1 && (state->m_system_status & 0x20)) |
| 151 | 151 | { |
| 152 | cput | |
| 152 | machine.device("maincpu")->execute().set_input_line( | |
| 153 | 153 | return; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if(state->m_timer_irq_flag != 0) |
| 157 | 157 | { |
| 158 | cput | |
| 158 | machine.device("maincpu")->execute().set_input_line( | |
| 159 | 159 | return; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | cput | |
| 162 | machine.device("maincpu")->execute().set_input_line( | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static TIMER_CALLBACK(pcw_timer_pulse) |
| r17813 | r17814 | |
| 436 | 436 | /* reboot */ |
| 437 | 437 | case 1: |
| 438 | 438 | { |
| 439 | cput | |
| 439 | machine().device("maincpu")->execute().set_input_line( | |
| 440 | 440 | popmessage("SYS: Reboot"); |
| 441 | 441 | } |
| 442 | 442 | break; |
| r17813 | r17814 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | m_led[4]|=data; |
| 179 | 179 | |
| 180 | cput | |
| 180 | machine().device("maincpu")->execute().set_input_line( | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static MOS6530_INTERFACE( mk2_mos6530_interface ) |
| r17813 | r17814 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static TIMER_CALLBACK( mekd2_trace ) |
| 163 | 163 | { |
| 164 | cput | |
| 164 | machine.device("maincpu")->execute().set_input_line( | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | WRITE_LINE_MEMBER( mekd2_state::mekd2_nmi_w ) |
| 168 | 168 | { |
| 169 | 169 | if (state) |
| 170 | cput | |
| 170 | machine().device("maincpu")->execute().set_input_line( | |
| 171 | 171 | else |
| 172 | 172 | machine().scheduler().timer_set(attotime::from_usec(18), FUNC(mekd2_trace)); |
| 173 | 173 | } |
| r17813 | r17814 | |
|---|---|---|
| 196 | 196 | ex800_state *state = field.machine().driver_data<ex800_state>(); |
| 197 | 197 | if (newval) |
| 198 | 198 | { |
| 199 | | |
| 199 | | |
| 200 | 200 | state->m_irq_state = (state->m_irq_state == ASSERT_LINE) ? CLEAR_LINE : ASSERT_LINE; |
| 201 | 201 | } |
| 202 | 202 | } |
| r17813 | r17814 | |
|---|---|---|
| 526 | 526 | |
| 527 | 527 | WRITE_LINE_MEMBER( qx10_state::qx10_pic8259_master_set_int_line ) |
| 528 | 528 | { |
| 529 | cput | |
| 529 | machine().device("maincpu")->execute().set_input_line( | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | READ8_MEMBER( qx10_state::get_slave_ack ) |
| r17813 | r17814 | |
|---|---|---|
| 387 | 387 | |
| 388 | 388 | static void bigbord2_interrupt(device_t *device, int state) |
| 389 | 389 | { |
| 390 | | |
| 390 | | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | const z80sio_interface sio_intf = |
| r17813 | r17814 | |
|---|---|---|
| 1875 | 1875 | { |
| 1876 | 1876 | mz2500_reset(state, WRAM_RESET); |
| 1877 | 1877 | /* correct? */ |
| 1878 | | |
| 1878 | | |
| 1879 | 1879 | } |
| 1880 | 1880 | |
| 1881 | 1881 | /* bit 2 is speaker */ |
| r17813 | r17814 | |
| 2042 | 2042 | { |
| 2043 | 2043 | mz2500_state *drvstate = device->machine().driver_data<mz2500_state>(); |
| 2044 | 2044 | if(drvstate->m_irq_mask[1]/* && state & 1*/) |
| 2045 | cput | |
| 2045 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 2046 | 2046 | } |
| 2047 | 2047 | |
| 2048 | 2048 | static const struct pit8253_config mz2500_pit8253_intf = |
| r17813 | r17814 | |
| 2071 | 2071 | //mz2500_state *drvstate = device->machine().driver_data<mz2500_state>(); |
| 2072 | 2072 | /* TODO: doesn't work yet */ |
| 2073 | 2073 | // if(drvstate->m_irq_mask[3] && state & 1) |
| 2074 | // cput | |
| 2074 | // device.device("maincpu")->execute().set_input_line_and_vector( | |
| 2075 | 2075 | } |
| 2076 | 2076 | |
| 2077 | 2077 | static RP5C15_INTERFACE( rtc_intf ) |
| r17813 | r17814 | |
|---|---|---|
| 270 | 270 | switch(offset) |
| 271 | 271 | { |
| 272 | 272 | case 0x00: // bit 7 = NMI vector protect, bit 6 = power off, bit 0 = software reset, bit 3 = A20 line? |
| 273 | // | |
| 273 | // | |
| 274 | 274 | logerror("SYS: port 0x20 write %02x\n",data); |
| 275 | 275 | break; |
| 276 | 276 | case 0x02: |
| r17813 | r17814 | |
| 2006 | 2006 | |
| 2007 | 2007 | static WRITE_LINE_DEVICE_HANDLER( towns_pic_irq ) |
| 2008 | 2008 | { |
| 2009 | | |
| 2009 | | |
| 2010 | 2010 | // logerror("PIC#1: set IRQ line to %i\n",interrupt); |
| 2011 | 2011 | } |
| 2012 | 2012 |
| r17813 | r17814 | |
|---|---|---|
| 208 | 208 | |
| 209 | 209 | static INTERRUPT_GEN( gmaster_interrupt ) |
| 210 | 210 | { |
| 211 | | |
| 211 | | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | static const UPD7810_CONFIG config = { |
| r17813 | r17814 | |
|---|---|---|
| 391 | 391 | if (timer.machine().root_device().ioport("LINE0")->read()) |
| 392 | 392 | { |
| 393 | 393 | state->m_int_vector = 6; |
| 394 | | |
| 394 | | |
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
| r17813 | r17814 | |
| 419 | 419 | fk1_state *state = timer.machine().driver_data<fk1_state>(); |
| 420 | 420 | |
| 421 | 421 | state->m_int_vector = 3; |
| 422 | | |
| 422 | | |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 |
| r17813 | r17814 | |
|---|---|---|
| 351 | 351 | |
| 352 | 352 | WRITE8_MEMBER( camplynx_state::lynx128k_irq ) |
| 353 | 353 | { |
| 354 | cput | |
| 354 | machine().device("maincpu")->execute().set_input_line( | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 |
| r17813 | r17814 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | if(strcmp((char*)machine.system().name,"aes") != 0) |
| 155 | 155 | { // raster and vblank IRQs are swapped on the NeoCD. |
| 156 | cputag_set_input_line(machine, "maincpu", 2, state->m_vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 157 | cputag_set_input_line(machine, "maincpu", 1, state->m_display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 158 | cputag_set_input_line(machine, "maincpu", 3, state->m_irq3_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 156 | machine.device("maincpu")->execute().set_input_line(2, state->m_vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 157 | machine.device("maincpu")->execute().set_input_line(1, state->m_display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 158 | machine.device("maincpu")->execute().set_input_line(3, state->m_irq3_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 159 | 159 | } |
| 160 | 160 | else |
| 161 | 161 | { |
| 162 | cputag_set_input_line(machine, "maincpu", 1, state->m_vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 163 | cputag_set_input_line(machine, "maincpu", 2, state->m_display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 164 | cputag_set_input_line(machine, "maincpu", 3, state->m_irq3_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 162 | machine.device("maincpu")->execute().set_input_line(1, state->m_vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 163 | machine.device("maincpu")->execute().set_input_line(2, state->m_display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 164 | machine.device("maincpu")->execute().set_input_line(3, state->m_irq3_pending ? ASSERT_LINE : CLEAR_LINE); | |
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
| r17813 | r17814 | |
| 696 | 696 | { |
| 697 | 697 | state->m_audio_cpu_rom_source_last = state->m_audio_cpu_rom_source; |
| 698 | 698 | |
| 699 | | |
| 699 | | |
| 700 | 700 | |
| 701 | 701 | if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space->device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); |
| 702 | 702 | } |
| r17813 | r17814 | |
| 977 | 977 | case 0x142/2: // end PCM transfer |
| 978 | 978 | break; |
| 979 | 979 | case 0x146/2: // end Z80 transfer |
| 980 | | |
| 980 | | |
| 981 | 981 | break; |
| 982 | 982 | case 0x148/2: // end FIX transfer |
| 983 | 983 | video_reset_neogeo(machine()); |
| r17813 | r17814 | |
|---|---|---|
| 586 | 586 | { |
| 587 | 587 | state->m_keyb_press = scancode; |
| 588 | 588 | state->m_keyb_press_flag = 1; |
| 589 | | |
| 589 | | |
| 590 | 590 | return; |
| 591 | 591 | } |
| 592 | 592 | } |
| r17813 | r17814 | |
| 599 | 599 | #if 0 |
| 600 | 600 | static INTERRUPT_GEN( bml3_irq ) |
| 601 | 601 | { |
| 602 | | |
| 602 | | |
| 603 | 603 | } |
| 604 | 604 | #endif |
| 605 | 605 |
| r17813 | r17814 | |
|---|---|---|
| 308 | 308 | |
| 309 | 309 | static WRITE_LINE_DEVICE_HANDLER( sms_int_callback ) |
| 310 | 310 | { |
| 311 | | |
| 311 | | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static const sega315_5124_interface _315_5124_ntsc_intf = |
| r17813 | r17814 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | WRITE_LINE_MEMBER( junior_state::junior_riot_irq ) |
| 177 | 177 | { |
| 178 | cput | |
| 178 | machine().device("maincpu")->execute().set_input_line( | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 |
| r17813 | r17814 | |
|---|---|---|
| 333 | 333 | |
| 334 | 334 | /* clear interrupt */ |
| 335 | 335 | if ((state->m_status & 0x1f) == 0x1f) |
| 336 | cput | |
| 336 | machine.device("maincpu")->execute().set_input_line( | |
| 337 | 337 | |
| 338 | 338 | } |
| 339 | 339 |
| r17813 | r17814 | |
|---|---|---|
| 403 | 403 | { |
| 404 | 404 | tutor_state *state = machine.driver_data<tutor_state>(); |
| 405 | 405 | //assert(state->m_tape_interrupt_enable); |
| 406 | cput | |
| 406 | machine.device("maincpu")->execute().set_input_line( | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /* CRU handler */ |
| r17813 | r17814 | |
| 439 | 439 | else |
| 440 | 440 | { |
| 441 | 441 | m_tape_interrupt_timer->adjust(attotime::never); |
| 442 | cput | |
| 442 | machine().device("maincpu")->execute().set_input_line( | |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | break; |
| r17813 | r17814 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | static MACHINE_RESET( casloopy ) |
| 187 | 187 | { |
| 188 | //cput | |
| 188 | //machine.device("maincpu")->execute().set_input_line( | |
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 |
| r17813 | r17814 | |
|---|---|---|
| 262 | 262 | |
| 263 | 263 | static WRITE_LINE_DEVICE_HANDLER(vdp_interrupt) |
| 264 | 264 | { |
| 265 | | |
| 265 | | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | static TMS9928A_INTERFACE(svi318_tms9928a_interface) |
| r17813 | r17814 | |
|---|---|---|
| 94 | 94 | WRITE8_MEMBER( mod8_state::kbd_put ) |
| 95 | 95 | { |
| 96 | 96 | m_tty_key_data = data ^ 0xff; |
| 97 | cput | |
| 97 | machine().device("maincpu")->execute().set_input_line( | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static GENERIC_TELEPRINTER_INTERFACE( teleprinter_intf ) |
| r17813 | r17814 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | static TIMER_DEVICE_CALLBACK( irq_timer ) |
| 177 | 177 | { |
| 178 | cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, ASSERT_LINE); | |
| 179 | cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE); | |
| 178 | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 179 | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /* Address maps */ |
| r17813 | r17814 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | static void z80daisy_interrupt(device_t *device, int state) |
| 128 | 128 | { |
| 129 | | |
| 129 | | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static const z80sio_interface sio_intf = |
| r17813 | r17814 | |
|---|---|---|
| 538 | 538 | m_nmi_trap |= 2; |
| 539 | 539 | |
| 540 | 540 | if(m_nmi_mask == 0) |
| 541 | cput | |
| 541 | machine().device("maincpu")->execute().set_input_line( | |
| 542 | 542 | } |
| 543 | 543 | } |
| 544 | 544 | |
| r17813 | r17814 | |
| 867 | 867 | { |
| 868 | 868 | m_nmi_reset &= ~4; |
| 869 | 869 | m_nmi_trap &= ~2; |
| 870 | //cput | |
| 870 | //machine().device("maincpu")->execute().set_input_line( | |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | 873 | } |
| r17813 | r17814 | |
|---|---|---|
| 95 | 95 | static INTERRUPT_GEN( sm1800_vblank_interrupt ) |
| 96 | 96 | { |
| 97 | 97 | sm1800_state *state = device->machine().driver_data<sm1800_state>(); |
| 98 | | |
| 98 | | |
| 99 | 99 | state->m_irq_state ^= 1; |
| 100 | 100 | } |
| 101 | 101 |
| r17813 | r17814 | |
|---|---|---|
| 171 | 171 | state->m_irq_flags |= flag; |
| 172 | 172 | |
| 173 | 173 | if(state->m_irq_flags != 0) |
| 174 | cput | |
| 174 | machine.device("maincpu")->execute().set_input_line( | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | static void main_irq_clear_flag(running_machine &machine, UINT8 flag) |
| r17813 | r17814 | |
| 180 | 180 | state->m_irq_flags &= ~flag; |
| 181 | 181 | |
| 182 | 182 | if(state->m_irq_flags == 0) |
| 183 | cput | |
| 183 | machine.device("maincpu")->execute().set_input_line( | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
| r17813 | r17814 | |
| 1217 | 1217 | { |
| 1218 | 1218 | fm7_state *state = machine.driver_data<fm7_state>(); |
| 1219 | 1219 | if(state->m_video.nmi_mask == 0 && state->m_video.sub_halt == 0) |
| 1220 | c | |
| 1220 | machine.device("sub")->execute().set_input_line( | |
| 1221 | 1221 | } |
| 1222 | 1222 | |
| 1223 | 1223 | // When a key is pressed or released (in scan mode only), an IRQ is generated on the main CPU, |
| r17813 | r17814 | |
| 1237 | 1237 | } |
| 1238 | 1238 | else |
| 1239 | 1239 | { |
| 1240 | c | |
| 1240 | machine.device("sub")->execute().set_input_line( | |
| 1241 | 1241 | } |
| 1242 | 1242 | logerror("KEY: sent scancode 0x%03x\n",scancode); |
| 1243 | 1243 | } |
| r17813 | r17814 | |
| 1301 | 1301 | if(machine.root_device().ioport("key3")->read() & 0x40000) |
| 1302 | 1302 | { |
| 1303 | 1303 | state->m_break_flag = 1; |
| 1304 | cput | |
| 1304 | machine.device("maincpu")->execute().set_input_line( | |
| 1305 | 1305 | } |
| 1306 | 1306 | else |
| 1307 | 1307 | state->m_break_flag = 0; |
| r17813 | r17814 | |
| 1345 | 1345 | static IRQ_CALLBACK(fm7_irq_ack) |
| 1346 | 1346 | { |
| 1347 | 1347 | if(irqline == M6809_FIRQ_LINE) |
| 1348 | | |
| 1348 | | |
| 1349 | 1349 | return -1; |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | 1352 | static IRQ_CALLBACK(fm7_sub_irq_ack) |
| 1353 | 1353 | { |
| 1354 | | |
| 1354 | | |
| 1355 | 1355 | return -1; |
| 1356 | 1356 | } |
| 1357 | 1357 | |
| r17813 | r17814 | |
| 1973 | 1973 | if(state->m_type == SYS_FM11) |
| 1974 | 1974 | { |
| 1975 | 1975 | // Probably best to halt the 8088, I'm pretty sure it and the main 6809 should not be running at the same time |
| 1976 | c | |
| 1976 | machine.device("x86")->execute().set_input_line( | |
| 1977 | 1977 | } |
| 1978 | 1978 | } |
| 1979 | 1979 |
| r17813 | r17814 | |
|---|---|---|
| 400 | 400 | |
| 401 | 401 | static INTERRUPT_GEN( vtech2_interrupt ) |
| 402 | 402 | { |
| 403 | | |
| 403 | | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | static const cassette_interface laser_cassette_interface = |
| r17813 | r17814 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | READ8_MEMBER( babbage_state::pio2_a_r ) |
| 187 | 187 | { |
| 188 | cput | |
| 188 | machine().device("maincpu")->execute().set_input_line( | |
| 189 | 189 | return m_key; |
| 190 | 190 | } |
| 191 | 191 |
| r17813 | r17814 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 194 | 194 | { |
| 195 | | |
| 195 | | |
| 196 | 196 | }; |
| 197 | 197 | |
| 198 | 198 | static UINT8 duart_input(device_t *device) |
| r17813 | r17814 | |
|---|---|---|
| 287 | 287 | { |
| 288 | 288 | logerror("int set %02x\n", state->m_irq_status & state->m_irq_mask); |
| 289 | 289 | /* set int */ |
| 290 | cput | |
| 290 | machine.device("maincpu")->execute().set_input_line( | |
| 291 | 291 | } |
| 292 | 292 | else |
| 293 | 293 | { |
| 294 | 294 | /* clear int */ |
| 295 | cput | |
| 295 | machine.device("maincpu")->execute().set_input_line( | |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
| r17813 | r17814 | |
| 515 | 515 | case NC_TYPE_1xx: |
| 516 | 516 | { |
| 517 | 517 | LOG(("nmi triggered\n")); |
| 518 | | |
| 518 | | |
| 519 | 519 | } |
| 520 | 520 | break; |
| 521 | 521 |
| r17813 | r17814 | |
|---|---|---|
| 433 | 433 | |
| 434 | 434 | READ32_MEMBER(mac_state::buserror_r) |
| 435 | 435 | { |
| 436 | cputag_set_input_line(machine(), "maincpu", M68K_LINE_BUSERROR, ASSERT_LINE); | |
| 437 | cputag_set_input_line(machine(), "maincpu", M68K_LINE_BUSERROR, CLEAR_LINE); | |
| 436 | machine().device("maincpu")->execute().set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); | |
| 437 | machine().device("maincpu")->execute().set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); | |
| 438 | 438 | return 0; |
| 439 | 439 | } |
| 440 | 440 |
| r17813 | r17814 | |
|---|---|---|
| 201 | 201 | |
| 202 | 202 | static void p8k_daisy_interrupt(device_t *device, int state) |
| 203 | 203 | { |
| 204 | | |
| 204 | | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /* Z80 DMA */ |
| r17813 | r17814 | |
|---|---|---|
| 470 | 470 | |
| 471 | 471 | static TIMER_DEVICE_CALLBACK( irq_timer ) |
| 472 | 472 | { |
| 473 | | |
| 473 | | |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | static MACHINE_CONFIG_START( prestige, prestige_state ) |
| r17813 | r17814 | |
|---|---|---|
| 425 | 425 | |
| 426 | 426 | static void ppu_nmi(device_t *device, int *ppu_regs) |
| 427 | 427 | { |
| 428 | | |
| 428 | | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 |
| r17813 | r17814 | |
|---|---|---|
| 412 | 412 | static void duarta_irq_handler(device_t *device, int state, UINT8 vector) |
| 413 | 413 | { |
| 414 | 414 | verboselog(device->machine(), 0, "duarta_irq_handler\n"); |
| 415 | cput | |
| 415 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 416 | 416 | }; |
| 417 | 417 | |
| 418 | 418 | static UINT8 duarta_input(device_t *device) |
| r17813 | r17814 | |
| 444 | 444 | static void duartb_irq_handler(device_t *device, int state, UINT8 vector) |
| 445 | 445 | { |
| 446 | 446 | verboselog(device->machine(), 0, "duartb_irq_handler\n"); |
| 447 | cput | |
| 447 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 448 | 448 | }; |
| 449 | 449 | |
| 450 | 450 | static UINT8 duartb_input(device_t *device) |
| r17813 | r17814 | |
|---|---|---|
| 125 | 125 | /* any bits set excluding vsync */ |
| 126 | 126 | if ((m_system_status & (~0x04))!=0) |
| 127 | 127 | { |
| 128 | cput | |
| 128 | machine().device("maincpu")->execute().set_input_line( | |
| 129 | 129 | } |
| 130 | 130 | else |
| 131 | 131 | { |
| 132 | cput | |
| 132 | machine().device("maincpu")->execute().set_input_line( | |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| r17813 | r17814 | |
| 1108 | 1108 | { |
| 1109 | 1109 | /* I'll pulse it because if I used hold-line I'm not sure |
| 1110 | 1110 | it would clear - to be checked */ |
| 1111 | cput | |
| 1111 | machine.device("maincpu")->execute().set_input_line( | |
| 1112 | 1112 | } |
| 1113 | 1113 | } |
| 1114 | 1114 | } |
| r17813 | r17814 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 93 | 93 | { |
| 94 | cput | |
| 94 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static void duart_tx(device_t *device, int channel, UINT8 data) |
| r17813 | r17814 | |
|---|---|---|
| 279 | 279 | WRITE_LINE_MEMBER( paso1600_state::paso1600_set_int_line ) |
| 280 | 280 | { |
| 281 | 281 | //printf("%02x\n",interrupt); |
| 282 | cput | |
| 282 | machine().device("maincpu")->execute().set_input_line( | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static const struct pic8259_interface paso1600_pic8259_config = |
| r17813 | r17814 | |
|---|---|---|
| 126 | 126 | { |
| 127 | 127 | state->m_keyboard_int = 1; |
| 128 | 128 | state->m_key_code = i | bit_sel(code); |
| 129 | | |
| 129 | | |
| 130 | 130 | break; |
| 131 | 131 | } |
| 132 | 132 | } |
| r17813 | r17814 | |
|---|---|---|
| 95 | 95 | /* presumably communication with T11 */ |
| 96 | 96 | READ8_MEMBER( vt240_state::test_r ) |
| 97 | 97 | { |
| 98 | //cput | |
| 98 | //machine().device("maincpu")->execute().set_input_line( | |
| 99 | 99 | |
| 100 | 100 | return rand(); |
| 101 | 101 | } |
| r17813 | r17814 | |
|---|---|---|
| 271 | 271 | |
| 272 | 272 | static void apollo_bus_error(running_machine &machine) |
| 273 | 273 | { |
| 274 | cputag_set_input_line(machine, MAINCPU, M68K_LINE_BUSERROR, ASSERT_LINE); | |
| 275 | cputag_set_input_line(machine, MAINCPU, M68K_LINE_BUSERROR, CLEAR_LINE); | |
| 274 | machine.device(MAINCPU)->execute().set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); | |
| 275 | machine.device(MAINCPU)->execute().set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); | |
| 276 | 276 | |
| 277 | 277 | apollo_csr_set_status_register(APOLLO_CSR_SR_CPU_TIMEOUT, APOLLO_CSR_SR_CPU_TIMEOUT); |
| 278 | 278 | } |
| r17813 | r17814 | |
| 280 | 280 | static IRQ_CALLBACK(apollo_irq_acknowledge) { |
| 281 | 281 | int result = M68K_INT_ACK_AUTOVECTOR; |
| 282 | 282 | |
| 283 | | |
| 283 | | |
| 284 | 284 | |
| 285 | 285 | DLOG2(("apollo_irq_acknowledge: interrupt level=%d", irqline)); |
| 286 | 286 | |
| r17813 | r17814 | |
| 455 | 455 | if (apollo_csr_get_control_register() & APOLLO_CSR_CR_INTERRUPT_ENABLE) { |
| 456 | 456 | // force parity error (if NMI is enabled) |
| 457 | 457 | // cpu_set_input_line_and_vector(&space.device(), 7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); |
| 458 | c | |
| 458 | machine().device(MAINCPU)->execute().set_input_line_and_vector( | |
| 459 | 459 | |
| 460 | 460 | } |
| 461 | 461 | } |
| r17813 | r17814 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | static void aica_irq(device_t *device, int irq) |
| 221 | 221 | { |
| 222 | | |
| 222 | | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | static const aica_interface dc_aica_interface = |
| r17813 | r17814 | |
|---|---|---|
| 450 | 450 | |
| 451 | 451 | static INTERRUPT_GEN( pasogo_interrupt ) |
| 452 | 452 | { |
| 453 | // cput | |
| 453 | // machine.device("maincpu")->execute().set_input_line( | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | static IRQ_CALLBACK(pasogo_irq_callback) |
| r17813 | r17814 | |
| 487 | 487 | |
| 488 | 488 | static WRITE_LINE_DEVICE_HANDLER( pasogo_pic8259_set_int_line ) |
| 489 | 489 | { |
| 490 | | |
| 490 | | |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | static const struct pic8259_interface pasogo_pic8259_config = |
| r17813 | r17814 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | WRITE8_MEMBER( basic52_state::kbd_put ) |
| 105 | 105 | { |
| 106 | cputag_set_input_line(machine(), "maincpu", MCS51_RX_LINE, ASSERT_LINE); | |
| 107 | cputag_set_input_line(machine(), "maincpu", MCS51_RX_LINE, CLEAR_LINE); | |
| 106 | machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, ASSERT_LINE); | |
| 107 | machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, CLEAR_LINE); | |
| 108 | 108 | m_term_data = data; |
| 109 | 109 | } |
| 110 | 110 |
| r17813 | r17814 | |
|---|---|---|
| 260 | 260 | /* the 'reset' key is directly tied to the reset line of the cpu */ |
| 261 | 261 | static INPUT_CHANGED( aquarius_reset ) |
| 262 | 262 | { |
| 263 | | |
| 263 | | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | static INPUT_PORTS_START( aquarius ) |
| r17813 | r17814 | |
|---|---|---|
| 208 | 208 | // if(state->m_mfp.iera & (1 << x)) |
| 209 | 209 | { |
| 210 | 210 | state->m_current_vector[6] = (state->m_mfp.vr & 0xf0) | (x+8); |
| 211 | cput | |
| 211 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 212 | 212 | // logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(state->m_mfp.vr & 0xf0) | (x+8),state->m_mfp.irqline); |
| 213 | 213 | return; // one at a time only |
| 214 | 214 | } |
| r17813 | r17814 | |
| 227 | 227 | // if(state->m_mfp.ierb & (1 << x)) |
| 228 | 228 | { |
| 229 | 229 | state->m_current_vector[6] = (state->m_mfp.vr & 0xf0) | x; |
| 230 | cput | |
| 230 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 231 | 231 | // logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(state->m_mfp.vr & 0xf0) | x,state->m_mfp.irqline); |
| 232 | 232 | return; // one at a time only |
| 233 | 233 | } |
| r17813 | r17814 | |
| 455 | 455 | if(machine.root_device().ioport("options")->read() & 0x01) |
| 456 | 456 | { |
| 457 | 457 | state->m_current_vector[6] = 0x4c; |
| 458 | cput | |
| 458 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 459 | 459 | logerror("MFP: Receive buffer full IRQ sent\n"); |
| 460 | 460 | } |
| 461 | 461 | } |
| r17813 | r17814 | |
| 466 | 466 | state->m_keyboard.headpos = 0; |
| 467 | 467 | // mfp_trigger_irq(MFP_IRQ_RX_ERROR); |
| 468 | 468 | state->m_current_vector[6] = 0x4b; |
| 469 | // cput | |
| 469 | // machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 470 | 470 | } |
| 471 | 471 | } |
| 472 | 472 | |
| r17813 | r17814 | |
| 654 | 654 | state->m_mouse.irqactive = 1; |
| 655 | 655 | state->m_current_vector[5] = 0x54; |
| 656 | 656 | state->m_current_irq_line = 5; |
| 657 | cput | |
| 657 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | } |
| r17813 | r17814 | |
| 1092 | 1092 | drvstate->m_ioc.irqstatus |= 0x80; |
| 1093 | 1093 | drvstate->m_current_irq_line = 1; |
| 1094 | 1094 | logerror("FDC: IRQ triggered\n"); |
| 1095 | cput | |
| 1095 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1096 | 1096 | } |
| 1097 | 1097 | } |
| 1098 | 1098 | |
| r17813 | r17814 | |
| 1701 | 1701 | v = 0x09; |
| 1702 | 1702 | if(ram[v] != 0x02) // normal vector for bus errors points to 02FF0540 |
| 1703 | 1703 | { |
| 1704 | cputag_set_input_line(machine, "maincpu", M68K_LINE_BUSERROR, ASSERT_LINE); | |
| 1705 | cputag_set_input_line(machine, "maincpu", M68K_LINE_BUSERROR, CLEAR_LINE); | |
| 1704 | machine.device("maincpu")->execute().set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); | |
| 1705 | machine.device("maincpu")->execute().set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); | |
| 1706 | 1706 | popmessage("Bus error: Unused RAM access [%08x]", val); |
| 1707 | 1707 | } |
| 1708 | 1708 | } |
| r17813 | r17814 | |
| 1714 | 1714 | then access causes a bus error */ |
| 1715 | 1715 | state->m_current_vector[2] = 0x02; // bus error |
| 1716 | 1716 | state->m_current_irq_line = 2; |
| 1717 | // cput | |
| 1717 | // space->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1718 | 1718 | if(state->ioport("options")->read() & 0x02) |
| 1719 | 1719 | { |
| 1720 | 1720 | offset *= 2; |
| r17813 | r17814 | |
| 1732 | 1732 | then access causes a bus error */ |
| 1733 | 1733 | state->m_current_vector[2] = 0x02; // bus error |
| 1734 | 1734 | state->m_current_irq_line = 2; |
| 1735 | // cput | |
| 1735 | // space->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1736 | 1736 | if(state->ioport("options")->read() & 0x02) |
| 1737 | 1737 | { |
| 1738 | 1738 | offset *= 2; |
| r17813 | r17814 | |
| 1749 | 1749 | Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */ |
| 1750 | 1750 | state->m_current_vector[2] = 0x02; // bus error |
| 1751 | 1751 | state->m_current_irq_line = 2; |
| 1752 | // cput | |
| 1752 | // space->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1753 | 1753 | if(state->ioport("options")->read() & 0x02) |
| 1754 | 1754 | { |
| 1755 | 1755 | offset *= 2; |
| r17813 | r17814 | |
| 1767 | 1767 | Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */ |
| 1768 | 1768 | state->m_current_vector[2] = 0x02; // bus error |
| 1769 | 1769 | state->m_current_irq_line = 2; |
| 1770 | // cput | |
| 1770 | // space->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1771 | 1771 | if(state->ioport("options")->read() & 0x02) |
| 1772 | 1772 | { |
| 1773 | 1773 | offset *= 2; |
| r17813 | r17814 | |
| 1789 | 1789 | if(ACCESSING_BITS_0_7) |
| 1790 | 1790 | offset++; |
| 1791 | 1791 | space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset); |
| 1792 | // cput | |
| 1792 | // machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 1793 | 1793 | } |
| 1794 | 1794 | return 0xffff; |
| 1795 | 1795 | } |
| r17813 | r17814 | |
| 1806 | 1806 | if(ACCESSING_BITS_0_7) |
| 1807 | 1807 | offset++; |
| 1808 | 1808 | space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset); |
| 1809 | // cput | |
| 1809 | // machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 1810 | 1810 | } |
| 1811 | 1811 | } |
| 1812 | 1812 | |
| r17813 | r17814 | |
| 1817 | 1817 | state->m_current_vector[3] = hd63450_get_vector(device, channel); |
| 1818 | 1818 | state->m_current_irq_line = 3; |
| 1819 | 1819 | logerror("DMA#%i: DMA End (vector 0x%02x)\n",channel,state->m_current_vector[3]); |
| 1820 | cput | |
| 1820 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 1821 | 1821 | } |
| 1822 | 1822 | |
| 1823 | 1823 | static void x68k_dma_end(running_machine &machine, int channel,int irq) |
| r17813 | r17814 | |
| 1836 | 1836 | { |
| 1837 | 1837 | state->m_current_vector[3] = hd63450_get_error_vector(device,channel); |
| 1838 | 1838 | state->m_current_irq_line = 3; |
| 1839 | cput | |
| 1839 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 1840 | 1840 | } |
| 1841 | 1841 | } |
| 1842 | 1842 | |
| r17813 | r17814 | |
| 1890 | 1890 | state = HOLD_LINE; // to get around erroneous spurious interrupt |
| 1891 | 1891 | // if((state->m_ioc.irqstatus & 0xc0) != 0) // if the FDC is busy, then we don't want to miss that IRQ |
| 1892 | 1892 | // return; |
| 1893 | | |
| 1893 | | |
| 1894 | 1894 | drvstate->m_current_vector[6] = 0; |
| 1895 | 1895 | drvstate->m_mfp_prev = state; |
| 1896 | 1896 | } |
| r17813 | r17814 | |
| 1924 | 1924 | if(state->m_current_vector[6] != 0x4b && state->m_current_vector[6] != 0x4c) |
| 1925 | 1925 | state->m_current_vector[6] = state->m_mfpdev->get_vector(); |
| 1926 | 1926 | else |
| 1927 | cput | |
| 1927 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1928 | 1928 | logerror("SYS: IRQ acknowledged (vector=0x%02x, line = %i)\n",state->m_current_vector[6],irqline); |
| 1929 | 1929 | return state->m_current_vector[6]; |
| 1930 | 1930 | } |
| 1931 | 1931 | |
| 1932 | cput | |
| 1932 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1933 | 1933 | if(irqline == 1) // IOSC |
| 1934 | 1934 | { |
| 1935 | 1935 | state->m_ioc.irqstatus &= ~0xf0; |
| r17813 | r17814 | |
| 1951 | 1951 | { |
| 1952 | 1952 | tstate->m_current_vector[1] = 0x6c; |
| 1953 | 1953 | tstate->m_current_irq_line = 1; |
| 1954 | cput | |
| 1954 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 1955 | 1955 | } |
| 1956 | 1956 | } |
| 1957 | 1957 | |
| r17813 | r17814 | |
| 2463 | 2463 | state->m_current_vector[1] = 0x61; |
| 2464 | 2464 | state->m_ioc.irqstatus |= 0x40; |
| 2465 | 2465 | state->m_current_irq_line = 1; |
| 2466 | | |
| 2466 | | |
| 2467 | 2467 | logerror("IOC: Disk image inserted\n"); |
| 2468 | 2468 | } |
| 2469 | 2469 | state->m_fdc.disk_inserted[floppy_get_drive(&image.device())] = 1; |
| r17813 | r17814 | |
| 2477 | 2477 | state->m_current_vector[1] = 0x61; |
| 2478 | 2478 | state->m_ioc.irqstatus |= 0x40; |
| 2479 | 2479 | state->m_current_irq_line = 1; |
| 2480 | | |
| 2480 | | |
| 2481 | 2481 | } |
| 2482 | 2482 | state->m_fdc.disk_inserted[floppy_get_drive(&image.device())] = 0; |
| 2483 | 2483 | } |
| r17813 | r17814 | |
| 2488 | 2488 | |
| 2489 | 2489 | state->m_current_vector[2] = 0xf9; |
| 2490 | 2490 | state->m_current_irq_line = 2; |
| 2491 | cput | |
| 2491 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 2492 | 2492 | } |
| 2493 | 2493 | |
| 2494 | 2494 | static void x68k_irq2_line(device_t* device,int state) |
| r17813 | r17814 | |
| 2499 | 2499 | tstate->m_net_timer->adjust(attotime::from_usec(16)); |
| 2500 | 2500 | } |
| 2501 | 2501 | else |
| 2502 | cput | |
| 2502 | device->machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 2503 | 2503 | logerror("EXP: IRQ2 set to %i\n",state); |
| 2504 | 2504 | |
| 2505 | 2505 | } |
| r17813 | r17814 | |
|---|---|---|
| 282 | 282 | if (px4->m_ier & px4->m_isr & INT0_7508) |
| 283 | 283 | { |
| 284 | 284 | px4->m_isr &= ~INT0_7508; |
| 285 | cput | |
| 285 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 286 | 286 | } |
| 287 | 287 | else if (px4->m_ier & px4->m_isr & INT1_ART) |
| 288 | cput | |
| 288 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 289 | 289 | else if (px4->m_ier & px4->m_isr & INT2_ICF) |
| 290 | cput | |
| 290 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 291 | 291 | else if (px4->m_ier & px4->m_isr & INT3_OVF) |
| 292 | cput | |
| 292 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 293 | 293 | else if (px4->m_ier & px4->m_isr & INT4_EXT) |
| 294 | cput | |
| 294 | machine.device("maincpu")->execute().set_input_line_and_vector( | |
| 295 | 295 | else |
| 296 | cput | |
| 296 | machine.device("maincpu")->execute().set_input_line( | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /* external cassette or barcode reader input */ |
| r17813 | r17814 | |
|---|---|---|
| 804 | 804 | |
| 805 | 805 | static TIMER_DEVICE_CALLBACK( cause_nmi ) |
| 806 | 806 | { |
| 807 | | |
| 807 | | |
| 808 | 808 | } |
| 809 | 809 | |
| 810 | 810 | static TIMER_DEVICE_CALLBACK( cause_M6502_irq ) |
| 811 | 811 | { |
| 812 | cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, ASSERT_LINE); | |
| 813 | cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE); | |
| 812 | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 813 | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); | |
| 814 | 814 | |
| 815 | 815 | } |
| 816 | 816 | |
| r17813 | r17814 | |
| 974 | 974 | |
| 975 | 975 | static TIMER_DEVICE_CALLBACK( timer_update_irq6 ) |
| 976 | 976 | { |
| 977 | | |
| 977 | | |
| 978 | 978 | } |
| 979 | 979 | |
| 980 | 980 | static TIMER_DEVICE_CALLBACK( timer_update_irq2 ) |
| 981 | 981 | { |
| 982 | | |
| 982 | | |
| 983 | 983 | } |
| 984 | 984 | |
| 985 | 985 | |
| 986 | 986 | static TIMER_DEVICE_CALLBACK( timer_update_irq_academy ) |
| 987 | 987 | { |
| 988 | 988 | if (academyallowNMI) { |
| 989 | | |
| 989 | | |
| 990 | 990 | } |
| 991 | 991 | } |
| 992 | 992 |
| r17813 | r17814 | |
|---|---|---|
| 905 | 905 | static TIMER_CALLBACK( clear_irq_cb ) |
| 906 | 906 | { |
| 907 | 907 | socrates_state *state = machine.driver_data<socrates_state>(); |
| 908 | cput | |
| 908 | machine.device("maincpu")->execute().set_input_line( | |
| 909 | 909 | state->m_vblankstate = 0; |
| 910 | 910 | } |
| 911 | 911 |
| r17813 | r17814 | |
|---|---|---|
| 1314 | 1314 | m_vrtc_irq_latch = 0; |
| 1315 | 1315 | |
| 1316 | 1316 | if(m_timer_irq_latch == 0 && m_vrtc_irq_latch == 0 && m_sound_irq_latch == 0) |
| 1317 | cput | |
| 1317 | machine().device("maincpu")->execute().set_input_line( | |
| 1318 | 1318 | |
| 1319 | 1319 | // IRQ_LOG(("%02x MASK (%02x %02x)\n",data,m_timer_irq_latch,m_vrtc_irq_latch)); |
| 1320 | 1320 | |
| r17813 | r17814 | |
| 1362 | 1362 | m_sound_irq_latch = 0; |
| 1363 | 1363 | |
| 1364 | 1364 | if(m_timer_irq_latch == 0 && m_vrtc_irq_latch == 0 && m_sound_irq_latch == 0) |
| 1365 | cput | |
| 1365 | machine().device("maincpu")->execute().set_input_line( | |
| 1366 | 1366 | |
| 1367 | 1367 | if(m_sound_irq_mask && m_sound_irq_pending) |
| 1368 | 1368 | { |
| 1369 | cput | |
| 1369 | machine().device("maincpu")->execute().set_input_line( | |
| 1370 | 1370 | m_sound_irq_latch = 1; |
| 1371 | 1371 | m_sound_irq_pending = 0; |
| 1372 | 1372 | } |
| r17813 | r17814 | |
| 1714 | 1714 | m_sound_irq_latch = 0; |
| 1715 | 1715 | |
| 1716 | 1716 | if(m_timer_irq_latch == 0 && m_vrtc_irq_latch == 0 && m_sound_irq_latch == 0) |
| 1717 | cput | |
| 1717 | machine().device("maincpu")->execute().set_input_line( | |
| 1718 | 1718 | |
| 1719 | 1719 | if(m_sound_irq_mask && m_sound_irq_pending) |
| 1720 | 1720 | { |
| 1721 | cput | |
| 1721 | machine().device("maincpu")->execute().set_input_line( | |
| 1722 | 1722 | m_sound_irq_latch = 1; |
| 1723 | 1723 | m_sound_irq_pending = 0; |
| 1724 | 1724 | } |
| r17813 | r17814 | |
| 2282 | 2282 | |
| 2283 | 2283 | drvstate->m_pic->r_w(~irq); |
| 2284 | 2284 | |
| 2285 | cput | |
| 2285 | machine.device("maincpu")->execute().set_input_line( | |
| 2286 | 2286 | } |
| 2287 | 2287 | else |
| 2288 | 2288 | { |
| 2289 | 2289 | //drvstate->m_int_state &= ~irq; |
| 2290 | 2290 | |
| 2291 | //cput | |
| 2291 | //machine.device("maincpu")->execute().set_input_line( | |
| 2292 | 2292 | } |
| 2293 | 2293 | } |
| 2294 | 2294 | |
| r17813 | r17814 | |
| 2318 | 2318 | UINT8 vector = (7 - state->m_pic->a_r()); |
| 2319 | 2319 | |
| 2320 | 2320 | state->m_int_state &= ~(1<<vector); |
| 2321 | | |
| 2321 | | |
| 2322 | 2322 | |
| 2323 | 2323 | return vector << 1; |
| 2324 | 2324 | } |
| r17813 | r17814 | |
| 2386 | 2386 | state->m_sound_irq_latch = 1; |
| 2387 | 2387 | state->m_sound_irq_pending = 0; |
| 2388 | 2388 | //IRQ_LOG(("sound\n")); |
| 2389 | | |
| 2389 | | |
| 2390 | 2390 | } |
| 2391 | 2391 | else |
| 2392 | 2392 | state->m_sound_irq_pending = 1; |
| r17813 | r17814 | |
| 2400 | 2400 | { |
| 2401 | 2401 | state->m_timer_irq_latch = 1; |
| 2402 | 2402 | //IRQ_LOG(("timer\n")); |
| 2403 | | |
| 2403 | | |
| 2404 | 2404 | } |
| 2405 | 2405 | } |
| 2406 | 2406 |
| r17813 | r17814 | |
|---|---|---|
| 1429 | 1429 | { |
| 1430 | 1430 | /* Reset and enable the sound cpu */ |
| 1431 | 1431 | #if !(SOUNDCPU_BOOT_HACK) |
| 1432 | | |
| 1432 | | |
| 1433 | 1433 | machine().device("soundcpu")->reset(); |
| 1434 | 1434 | #endif |
| 1435 | 1435 | } |
| r17813 | r17814 | |
| 1438 | 1438 | else |
| 1439 | 1439 | { |
| 1440 | 1440 | /* Halt the sound cpu */ |
| 1441 | | |
| 1441 | | |
| 1442 | 1442 | } |
| 1443 | 1443 | verboselog("maincpu", machine(), 0, "sound cpu ctrl: %04x\n", data); |
| 1444 | 1444 | break; |
| r17813 | r17814 | |
| 1783 | 1783 | { |
| 1784 | 1784 | supracan_state *state = machine.driver_data<supracan_state>(); |
| 1785 | 1785 | |
| 1786 | cput | |
| 1786 | machine.device("soundcpu")->execute().set_input_line( | |
| 1787 | 1787 | |
| 1788 | 1788 | state->m_video_timer->adjust( machine.primary_screen->time_until_pos( 0, 0 ) ); |
| 1789 | 1789 | state->m_irq_mask = 0; |
| r17813 | r17814 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | WRITE_LINE_MEMBER( pegasus_state::pegasus_firq_clr ) |
| 97 | 97 | { |
| 98 | cput | |
| 98 | machine().device("maincpu")->execute().set_input_line( | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | READ8_MEMBER( pegasus_state::pegasus_keyboard_r ) |
| r17813 | r17814 | |
|---|---|---|
| 276 | 276 | |
| 277 | 277 | static TIMER_CALLBACK( z80_irq_clear ) |
| 278 | 278 | { |
| 279 | cput | |
| 279 | machine.device("maincpu")->execute().set_input_line( | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
| 283 | 283 | static TIMER_DEVICE_CALLBACK( z80_irq ) |
| 284 | 284 | { |
| 285 | | |
| 285 | | |
| 286 | 286 | |
| 287 | 287 | timer.machine().scheduler().timer_set(attotime::from_usec(100), FUNC(z80_irq_clear)); |
| 288 | 288 | } |
| r17813 | r17814 | |
|---|---|---|
| 170 | 170 | *****************************************************************************/ |
| 171 | 171 | static WRITE_LINE_DEVICE_HANDLER( pic8259_set_int_line ) |
| 172 | 172 | { |
| 173 | | |
| 173 | | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static const struct pic8259_interface pic8259_config = |
| r17813 | r17814 | |
| 210 | 210 | */ |
| 211 | 211 | tsispch_state *state = machine().driver_data<tsispch_state>(); |
| 212 | 212 | state->m_paramReg = data; |
| 213 | cput | |
| 213 | machine().device("dsp")->execute().set_input_line( | |
| 214 | 214 | #ifdef DEBUG_PARAM |
| 215 | 215 | //fprintf(stderr,"8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; DSPIRQMASK: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0)); |
| 216 | 216 | logerror("8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; DSPIRQMASK: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0)); |
| r17813 | r17814 | |
| 320 | 320 | dspprg++; |
| 321 | 321 | } |
| 322 | 322 | m_paramReg = 0x00; // on power up, all leds on, reset to upd7720 is high |
| 323 | cput | |
| 323 | machine().device("dsp")->execute().set_input_line( | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /****************************************************************************** |
| r17813 | r17814 | |
|---|---|---|
| 798 | 798 | |
| 799 | 799 | static TIMER_CALLBACK(intv_interrupt2_complete) |
| 800 | 800 | { |
| 801 | c | |
| 801 | machine.device("keyboard")->execute().set_input_line( | |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | 804 | static INTERRUPT_GEN( intv_interrupt2 ) |
| 805 | 805 | { |
| 806 | | |
| 806 | | |
| 807 | 807 | device->machine().scheduler().timer_set(device->machine().device<cpu_device>("keyboard")->cycles_to_attotime(100), FUNC(intv_interrupt2_complete)); |
| 808 | 808 | } |
| 809 | 809 |
| r17813 | r17814 | |
|---|---|---|
| 1010 | 1010 | |
| 1011 | 1011 | static TIMER_DEVICE_CALLBACK( nmi_timer ) |
| 1012 | 1012 | { |
| 1013 | | |
| 1013 | | |
| 1014 | 1014 | } |
| 1015 | 1015 | |
| 1016 | 1016 | /****************************************************************************** |
| r17813 | r17814 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | m_keyb_column = data & 0x0f; |
| 84 | 84 | |
| 85 | cput | |
| 85 | machine().device("maincpu")->execute().set_input_line( | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| r17813 | r17814 | |
| 305 | 305 | { |
| 306 | 306 | // only if it goes up |
| 307 | 307 | if (state && !m_last_state) |
| 308 | cput | |
| 308 | machine().device("maincpu")->execute().set_input_line( | |
| 309 | 309 | |
| 310 | 310 | m_last_state = state; |
| 311 | 311 | |
| r17813 | r17814 | |
| 326 | 326 | | ioport( "IN8" )->read(); |
| 327 | 327 | |
| 328 | 328 | if ( key_pressed && m_key_pressed != key_pressed ) |
| 329 | cput | |
| 329 | machine().device("maincpu")->execute().set_input_line( | |
| 330 | 330 | |
| 331 | 331 | m_key_pressed = key_pressed; |
| 332 | 332 | } |
| r17813 | r17814 | |
|---|---|---|
| 333 | 333 | if (state->m_allowNMI) |
| 334 | 334 | { |
| 335 | 335 | state->m_allowNMI = 0; |
| 336 | | |
| 336 | | |
| 337 | 337 | } |
| 338 | 338 | beep_set_state(state->m_beep, state->m_led_status&64?1:0); |
| 339 | 339 | } |
| r17813 | r17814 | |
| 341 | 341 | static TIMER_DEVICE_CALLBACK( update_nmi_r5 ) |
| 342 | 342 | { |
| 343 | 343 | mephisto_state *state = timer.machine().driver_data<mephisto_state>(); |
| 344 | | |
| 344 | | |
| 345 | 345 | beep_set_state(state->m_beep, state->m_led_status&64?1:0); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | static TIMER_DEVICE_CALLBACK( update_irq ) //only mm2 |
| 349 | 349 | { |
| 350 | 350 | mephisto_state *state = timer.machine().driver_data<mephisto_state>(); |
| 351 | cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, ASSERT_LINE); | |
| 352 | cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE); | |
| 351 | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 352 | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); | |
| 353 | 353 | |
| 354 | 354 | beep_set_state(state->m_beep, state->m_led_status&64?1:0); |
| 355 | 355 | } |
| r17813 | r17814 | |
|---|---|---|
| 411 | 411 | switch( vpos ) |
| 412 | 412 | { |
| 413 | 413 | case 240: |
| 414 | cput | |
| 414 | machine.device("maincpu")->execute().set_input_line( | |
| 415 | 415 | break; |
| 416 | 416 | case 0: |
| 417 | cput | |
| 417 | machine.device("maincpu")->execute().set_input_line( | |
| 418 | 418 | break; |
| 419 | 419 | } |
| 420 | 420 | |
| r17813 | r17814 | |
| 741 | 741 | |
| 742 | 742 | WRITE_LINE_MEMBER( scv_state::scv_upd1771_ack_w ) |
| 743 | 743 | { |
| 744 | cput | |
| 744 | machine().device("maincpu")->execute().set_input_line( | |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | 747 |
| r17813 | r17814 | |
|---|---|---|
| 520 | 520 | |
| 521 | 521 | static TIMER_CALLBACK( update_irq ) |
| 522 | 522 | { |
| 523 | cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, ASSERT_LINE); | |
| 524 | cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE); | |
| 523 | machine.device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 524 | machine.device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); | |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | /* Save state call backs */ |
| r17813 | r17814 | |
|---|---|---|
| 88 | 88 | READ8_MEMBER( h19_state::h19_a0_r ) |
| 89 | 89 | { |
| 90 | 90 | // keyboard status |
| 91 | cput | |
| 91 | machine().device("maincpu")->execute().set_input_line( | |
| 92 | 92 | return 0x7f; // says that a key is ready and no modifier keys are pressed |
| 93 | 93 | } |
| 94 | 94 | |
| r17813 | r17814 | |
| 338 | 338 | |
| 339 | 339 | static WRITE_LINE_DEVICE_HANDLER(h19_ace_irq) |
| 340 | 340 | { |
| 341 | | |
| 341 | | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | static const ins8250_interface h19_ace_interface = |
| r17813 | r17814 | |
| 386 | 386 | WRITE8_MEMBER( h19_state::h19_kbd_put ) |
| 387 | 387 | { |
| 388 | 388 | m_term_data = data; |
| 389 | cput | |
| 389 | machine().device("maincpu")->execute().set_input_line( | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | static ASCII_KEYBOARD_INTERFACE( keyboard_intf ) |
| r17813 | r17814 | |
|---|---|---|
| 53 | 53 | READ8_MEMBER( zrt80_state::zrt80_10_r ) |
| 54 | 54 | { |
| 55 | 55 | UINT8 ret = m_term_data; |
| 56 | cput | |
| 56 | machine().device("maincpu")->execute().set_input_line( | |
| 57 | 57 | return ret; |
| 58 | 58 | } |
| 59 | 59 | |
| r17813 | r17814 | |
| 255 | 255 | WRITE8_MEMBER( zrt80_state::kbd_put ) |
| 256 | 256 | { |
| 257 | 257 | m_term_data = data; |
| 258 | cput | |
| 258 | machine().device("maincpu")->execute().set_input_line( | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | static ASCII_KEYBOARD_INTERFACE( keyboard_intf ) |
| r17813 | r17814 | |
|---|---|---|
| 62 | 62 | int irq = state->m_svision.timer_shot && (state->BANK & 2); |
| 63 | 63 | irq = irq || (*state->m_dma_finished && (state->BANK & 4)); |
| 64 | 64 | |
| 65 | cput | |
| 65 | machine.device("maincpu")->execute().set_input_line( | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static TIMER_CALLBACK(svision_timer) |
| r17813 | r17814 | |
|---|---|---|
| 196 | 196 | /* |
| 197 | 197 | static TIMER_DEVICE_CALLBACK( borisdpl_timer_interrupt ) |
| 198 | 198 | { |
| 199 | cput | |
| 199 | timer.machine().device("maincpu")->execute().set_input_line_and_vector( | |
| 200 | 200 | } |
| 201 | 201 | */ |
| 202 | 202 |
| r17813 | r17814 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | static INPUT_CHANGED( ef_w ) |
| 51 | 51 | { |
| 52 | | |
| 52 | | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static INPUT_PORTS_START( pecom ) |
| r17813 | r17814 | |
|---|---|---|
| 503 | 503 | |
| 504 | 504 | static WRITE_LINE_DEVICE_HANDLER( pce_irq_changed ) |
| 505 | 505 | { |
| 506 | | |
| 506 | | |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 |
| r17813 | r17814 | |
|---|---|---|
| 27 | 27 | psion_state *state = timer.machine().driver_data<psion_state>(); |
| 28 | 28 | |
| 29 | 29 | if (state->m_enable_nmi) |
| 30 | | |
| 30 | | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | UINT8 psion_state::kb_read(running_machine &machine) |
| r17813 | r17814 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | static WRITE_LINE_DEVICE_HANDLER(tms_interrupt) |
| 100 | 100 | { |
| 101 | | |
| 101 | | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | static TMS9928A_INTERFACE(tms9129_interface) |
| Previous | 199869 Revisions | Next |